body1
stringlengths 20
4.1k
| body2
stringlengths 23
4.09k
|
---|---|
Find the number of irreducible polynomials of degree 4 in $\boldsymbol{Z}_3[x]$. Not really sure what to do here, I've tried listing them all out but this seems tedious, and all I need to find is the number of irreducible polynomials, not their values. Is there perhaps a general formula for this? | I know that for every $n\in\mathbb{N}$, $n\ge 1$, there exists $p(x)\in\mathbb{F}_p[x]$ s.t. $\deg p(x)=n$ and $p(x)$ is irreducible over $\mathbb{F}_p$. I am interested in counting how many such $p(x)$ there exist (that is, given $n\in\mathbb{N}$, $n\ge 1$, how many irreducible polynomials of degree $n$ exist over $\mathbb{F}_p$). I don't have a counting strategy and I don't expect a closed formula, but maybe we can find something like "there exist $X$ irreducible polynomials of degree $n$ where $X$ is the number of...". What are your thoughts ? |
I have a naive question about regression. How does R function predict.lm compute the 95% confidence interval of the fitted line? In particular why is this not a straight line? x <- rnorm(10,0,10) y <- 20*x + rnorm(10,0,2) fit <- lm(y ~ x) newx <- sort(x) prd <- predict(fit,newdata=data.frame(x=newx),interval = c("confidence"),level = 0.95,type="response") # plot plot(x,y) abline(fit) lines(newx,prd[,2],col="red",lty=2) lines(newx,prd[,3],col="red",lty=2) Can somebody help me understand how the upper and lower bounds of 95% CI of the fitted line are computed by predict? | I have noticed that the confidence interval for predicted values in an linear regression tends to be narrow around the mean of the predictor and fat around the minimum and maximum values of the predictor. This can be seen in plots of these 4 linear regressions: I initially thought this was because most values of the predictors were concentrated around the mean of the predictor. However, I then noticed that the narrow middle of the confidence interval would occur even if many values of were concentrated around the extremes of the predictor, as in the bottom left linear regression, which lots of values of the predictor are concentrated around the minimum of the predictor. is anyone able to explain why confidence intervals for the predicted values in an linear regression tend to be narrow in the middle and fat at the extremes? |
I am trying to set on change listener to some of the elements which are dynamically added but it's not working. This is my html file: <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Cool Maths</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> <script src="js/Constants/Url.js"></script> <script src="js/Constants/AdminConstants.js"></script> <script src="js/Create%20Level/question.js"></script> <script src="js/Create%20Level/listener.js"></script> <script src="js/Create%20Level/controller.js"></script> <script src="js/Create%20Level/createLevel.js"> </script> <link rel="stylesheet" href="css/createLevel.css" > </head> <body> <nav class="navbar navbar-inverse"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="index.html">Cool Maths</a> </div> <ul class="nav navbar-nav"> <li ><a href="createModule.html">Create Module</a></li> <li ><a href="allModules.html">All Modules</a></li> <li class="active" ><a href="#">Create Level</a></li> </ul> </div> </nav> <div class="container"> <form > <input type="text" id="level-name" placeholder="Level Name" class="form-control"> </form> <br/> <button onclick="newQuestion()" class="btn btn-primary" id="add-question-button" >Add Question</button><br/> <br/><br/> <div class="questions" id="all-questions-container"> </div> </div> </body> </html> This is my javascript file: var i = 0; $(document).ready(function(){ }); function newQuestion(){ //I am trying to set on change listener to these elements var newQuestionHtml = "<div class='question-container'>"+"<b>Question no "+i+"</b><br/>"+ "<textarea class='form-control' type='text' id='question"+i+"' placeholder='Question'></textarea><br/>"+ "<textarea class='form-control' type='text' id='hint"+i+"' placeholder='Hint'></textarea><br/>"+ "<input class='form-control' type='text' id='answer"+i+"' placeholder='answer'><br/>"+ "<button class='btn btn-danger' onclick=''>Add Step</button></div>"; $("#all-questions-container").append(newQuestionHtml); var question = new Question(i,"","","",""); var controller = new Controller(question); //this line sets on change listener for the textarea with id question0 which was dynamically added $("#answer0").on('change',function(){ alert("changed"); }); i++; } The elements are being added but when the value of the textarea is changed alert is not being displayed. Can anyone please tell me where I am going wrong?? Thank-you | I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off. This happens on page ready and works just fine. The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound. I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option. |
This is the bit of code that does all of the drawing, but it's only drawing half of the arrow. When it's a vertical arrow (North or South), it cuts off the left side, and when it's horizontal (East or West) it cuts of the top, both centered right at the tip; becoming a perfect half an arrow. public void paint(Graphics g) { setSize(100, steps * 50); for (int i = 1; i < steps + 1; i++) { y = i * 20; if (directions.peek() == "North") { int[] xNPoints = {x, x + 6, x + 2, x + 2, x + 2, x + 2, x + 6}; int[] yNPoints = {y - 5, y, y, y, y + 10, y, y}; g.drawPolygon(xNPoints, yNPoints, 7); } else if (directions.peek() == "East") { int[] xEPoints = {x + 10, x + 5, x + 5, x - 5, x - 5, x + 5, x + 5}; int[] yEPoints = {y, y + 6, y + 2, y + 2, y + 2, y + 2, y + 6}; g.drawPolygon(xEPoints, yEPoints, 7); } else if (directions.peek() == "South") { int[] xSPoints = {x, x + 6, x + 2, x + 2, x + 2, x + 2, x + 6}; int[] ySPoints = {y + 5, y, y, y - 10, y - 10, y, y}; g.drawPolygon(xSPoints, ySPoints, 7); } else if (directions.peek() == "West") { int[] xWPoints = {x - 5, x, x, x + 10, x + 10, x, x}; int[] yWPoints = {y, y + 6, y + 2, y + 2, y + 2, y + 2, y + 6}; g.drawPolygon(xWPoints, yWPoints, 7); } g.drawString((String)directions.pop(), 5, y + 5); The goal of the program is to return a set of user provided directions in reverse order, and I have a lot to clean up (add exceptions, clean up the GUI), but all of the code aside from what I just provided is used for prompting and storing the user's input for how many steps there are and what they are. | I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug. Is == bad? When should it and should it not be used? What's the difference? |
I have a marshmallow device, it has custom ROM, and is obviously rooted. I am looking for a way to access the app data, cache of other apps. As I am rooted, I guess this is possible. I tried searching and found that Titanium Backup can access databases and cache files. I am only able to save databases but not all the cache files. So, is there any app to get all the cache files saved? | On Android's root (/), what is the purpose of each folder? I want to learn the folder hierarchy structure. I would like to know the differences between Android 2.3 and 4.x, if they have different folders in "/". |
RAW, is there anything that explicitly states what happens to a creature (either PC or monster) when a weight that exceeds their carry capacity is suddenly dropped on them? EDIT: The intent is to find out the mechanics, if any exist, of what would happen if a Goliath Barbearian PC unceremoniously dropped, say, a 1000 lb. iron ball on a wolf. How would damage and other things be handled? If existing mechanics can't fully describe this situation, how would you handle it at your table? | Fall damage is 1d6 per 10 feet. What adjustments if any should I make for objects falling on a player character? (e.g. a bear) Assuming the objects are meaningful threats but not instant character death, should the weight of an object change the calculation, e.g. more then 1d6 per 10 feet. Or is this more in the spirit of improvising damage chart? i.e. the setback (cat to face) dangerous (orc fell on me), and deadly (the large bear). If this is house-rule territory does any one have any experience or advice beyond relevant to 5e. |
I try to make a backup script, but when i create a zip with the script, and use cd myzip it sais that it dosnt exitst even when i can see it on the server with FileZilla. This is my script: TIME=BACKUPMC-`date +%d-%m-%Y-%H:%M`.zip DEST="/home/daixhosting/d1" zip -r $TIME /home/daixhosting/d1 Does someone know what the cause can be? | Just downloaded a .zip file from the internet. I want to use the terminal to unzip the file. What is the correct way to do this? |
I decided to write my own Vector class for my library but when I try to compile it using g++ -Wall -std=c++11 -O a.cpp -c -o a.o and read the symbols from the output file using nm a.o I don't see any member functions that I wrote for that class and when I try to link it with a program that uses them I get undefined reference to errors. Here is the a.h file: template<typename T> class Vector { private: int vsize; const int maxsize=2147483647; T* array; public: Vector(); ~Vector(); bool push_back(T t); bool pop_back(T* t); bool replace(int element, T t); bool resize(int newsize); bool getP(int element, T* t); bool clear(); T* getArray(); int size(); T operator[](int n); }; And the a.cpp file: #include <stdlib.h> #include "a.h" template<typename T> Vector<T>::Vector() { vsize=0; array=(T*)malloc(sizeof(T)*vsize); } template<typename T> Vector<T>::~Vector() { free(array); } template<typename T> bool Vector<T>::push_back(T t) { if(resize(vsize+1)) return 1; array[vsize-1] = t; return 0; } template<typename T> bool Vector<T>::pop_back(T* t) { *t = array[vsize-1]; return resize(vsize-1); } /* Other member function definitons... */ I'm using g++ 5.4.0 and nm 2.26.1 | Quote from : The only portable way of using templates at the moment is to implement them in header files by using inline functions. Why is this? (Clarification: header files are not the only portable solution. But they are the most convenient portable solution.) |
I have an javascript array of string that looks like: A = ['a', 'b', 'c']; I want to convert it to (all string): strA = '"a","b","c"' How do I achieve this? | I have a one-dimensional array of strings in JavaScript that I'd like to turn into a comma-separated list. Is there a simple way in garden-variety JavaScript (or jQuery) to turn that into a comma-separated list? (I know how to iterate through the array and build the string myself by concatenation if that's the only way.) |
The issue of variable declaration in switch-case statements is well discussed in , and the answers covered most of the aspects. But I faced a problem for that I couldn't find a solid reason. Can someone please explain what is wrong with this code? switch (var) { case 0: int test; test = 0; // no error int test2 = 0; // ERROR: initialization of 'test2' is skipped by 'case' label std::string str; str = "test"; // ERROR: initialization of 'str' is skipped by 'case' label break; case 1:; break; } I know why the 6th line results in error. But what is wrong with the next two lines? I think this may have something to do with the difference between native types and class types, but I am not sure. This is not a duplicate question of ! As I have provided a link to the original one. Please read the two questions and note the difference. AFAIK, issue is not discussed in the original question. | I've always wondered this - why can't you declare variables after a case label in a switch statement? In C++ you can declare variables pretty much anywhere (and declaring them close to first use is obviously a good thing) but the following still won't work: switch (val) { case VAL: // This won't work int newVal = 42; break; case ANOTHER_VAL: ... break; } The above gives me the following error (MSC): initialization of 'newVal' is skipped by 'case' label This seems to be a limitation in other languages too. Why is this such a problem? |
I recently installed 14.04 on my Dell gaming laptop. This gives my laptop specs. As the title suggests, the Wireless connection isn't working (isn't visible for access). I scoured the net for possible solutions. I found 3 relevant links on askUbuntu - suggests that 14.04 is too old for my laptop configuration and hence I should be installing 16.04. However, I need 14.04 itself, since I need it mainly to work on which is compatible only with 14.04. suggests that I should be installing a 4.8.14 kernel to solve this issue. But one of the links in the answer is broken. I'm not sure whether I should go ahead with the procedure given. again suggests that I should be updating my kernel. Again, I'm not sure whether that's the procedure I should be following since that is not the exact network controller I have. Here are some relevant outputs from my system - srinidhi@srinidhi-Inspiron-7577:~$ lspci -knn | grep Net -A2 3c:00.0 Network controller [0280]: Intel Corporation Device [8086:24fd] (rev 78) Subsystem: Intel Corporation Device [8086:0050] Here is the Network controller output of lspci -v 3c:00.0 Network controller: Intel Corporation Device 24fd (rev 78) Subsystem: Intel Corporation Device 0050 Flags: fast devsel, IRQ 255 Memory at dd100000 (64-bit, non-prefetchable) [disabled] [size=8K] Capabilities: access denied Here is my lsusb output srinidhi@srinidhi-Inspiron-7577:~$ lsusb Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 003 Device 003: ID 04e8:6863 Samsung Electronics Co., Ltd GT-I9500 [Galaxy S4] / GT-I9250 [Galaxy Nexus] (network tethering) Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 004: ID 27c6:5301 Bus 001 Device 003: ID 8087:0a2b Intel Corp. Bus 001 Device 005: ID 0c45:6718 Microdia Bus 001 Device 002: ID 04ca:00a5 Lite-On Technology Corp. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub I would greatly appreciate anyone to help me out with fixing this as I am not sure how to solve this issue. I've worked with ubuntu before in my undergrad mainly for ROS and I desperately need it working for grad school now. Thanks. | I've been trying to follow around to fix my wifi problems, however I don't know how to find out my actual wifi device name. The problem is that on Ubuntu (14.04) there seems to be no indication that the computer is aware it has a wifi adapter (it definitely has one) and it can't connect to or see wireless networks. I guess it could be a device driver problem, but I can't find out the name of my adapter, other than that it is either one of the two: Intel Corporation Device 24fd (rev 78) Subsystem: Intel Corporation Device 1010 Which don't seem to match with what I need to figure out which driver to install. Here is the output Network Controller part of the output of lspci -v 01:00.0 Network controller: Intel Corporation Device 24fd (rev 78) Subsystem: Intel Corporation Device 1010 Flags: bus master, fast devsel, latency 0, IRQ 11 Memory at dc100000 (64-bit, non-prefetchable) [size=8K] Capabilities: <access denied> And here is the lsusb output lsusb Bus 004 Device 003: ID 0bda:8153 Realtek Semiconductor Corp. Bus 004 Device 002: ID 05e3:0617 Genesys Logic, Inc. Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 003 Device 003: ID 0835:2a01 Action Star Enterprise Co., Ltd Bus 003 Device 002: ID 05e3:0610 Genesys Logic, Inc. 4-port hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 003: ID 8087:0a2b Intel Corp. Bus 001 Device 002: ID 064e:3401 Suyin Corp. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub UPDATE - When trying to install the new kernel: linux-headers-4.8.14-040814-generic depends on linux-headers-4.8.14-040814; however: Package linux-headers-4.8.14-040814 is not installed. dpkg: error processing package linux-headers-4.8.14-040814-generic (--install): dependency problems - leaving unconfigured |
I have implemented a Meyer's singleton pattern. And I try to do some stuff testing it in a multithreading environment. Here is how I implemented the class in C++. #include<thread> #include<mutex> class singleton { public: static singleton& instance() { std::lock_guard<std::mutex> lck(mtx); static singleton *my = new singleton; return *my; } private: static std::mutex mtx; singleton() {} ~singleton() {} singleton(const singleton &) {} singleton& operator=(const singleton &) {} }; But when I compile this with g++ -std=c++11 singleton.cpp -o singleton -lpthread, it says /tmp/ccfEBnmN.o: In function `singleton::instance()': singleton.cpp(.text._ZN11singleton12instanceEv[_ZN11singelton12instanceEv]+0x10): undefined reference to `singleton::mtx' collect2: error: ld returned 1 exit status I understand this might be some problem in design, since without initializing the first singleton instance how could we get the mtx. If in this case, my question comes to how to implement a thread safe singleton class based on my code? How do we initialized the mtx in my singleton class? I know there is a traditional way to create a singleton pattern by maintaining a static pointer points to the singleton class. But indeed that is not "so" thread safe. Even applying the double check mechanism in the instance() method. | Can anyone explain why following code won't compile? At least on g++ 4.2.4. And more interesting, why it will compile when I cast MEMBER to int? #include <vector> class Foo { public: static const int MEMBER = 1; }; int main(){ vector<int> v; v.push_back( Foo::MEMBER ); // undefined reference to `Foo::MEMBER' v.push_back( (int) Foo::MEMBER ); // OK return 0; } |
I have communicated my article to one elsevier journal. After being with editor for more than one month, the current status is "submitted to journal". I am confused regarding this status? What does it signify, kindly answer me? | What steps does a manuscript typically go through from submission to publication (or rejection) in a typical journal? How are these steps referred to, in particular by editorial systems, and how long do they each typically take? Note that this question is about the typical situation and hence not about: Journals with an atypical workflow, e.g. those that allow for an instantaneous reviewer–author interaction. Exceptional steps or rare occurrences such as withdrawal or . This is a canonical question on this topic as per . Due to its nature, it is rather broad and not exemplary for a regular question on this site. Please feel free to improve this question. |
I have tried to use induction, but after I assume that P(n) is true, I can't go further to prove that P(n+1) is true as well. I also have tried to find an intermediate inequality, but I can't figure out which inequality I should start from. Something that seemed to be useful was taking P(n) and multiplying it by $(1+\frac{1}{(n+1)^3})$, therefore I have come to this $(1+ \frac{1}{1^3})(1+\frac{1}{2^3})...(1+\frac{1}{n^3})<3 | \times(1+\frac{1}{(n+1)^3})$ $(1+ \frac{1}{1^3})(1+\frac{1}{2^3})...(1+\frac{1}{n^3})(1+\frac{1}{(n+1)^3})<3(1+\frac{1}{(n+1)^3})$ but, as anyone could imagine, I came to contradiction because I've tried to prove that $3(1+\frac{1}{(n+1)^3})<3$ which is false. Any help it would be useful. | Prove that $\left(1+\dfrac{1}{1^3}\right)\left(1+\dfrac{1}{2^3}\right)\cdots\left(1+\dfrac{1}{n^3}\right)<3$ for all positive integers $n$ This problem is copied from Math Olympiad Treasures by Titu Andreescu and Bogdan Enescu.They start by stating that induction wouldn't directly work here since the right hand side stays constant while the left increases.They get rid of this problem by strengthening the hypothesis.$$\left(1+\dfrac{1}{1^3}\right)\left(1+\dfrac{1}{2^3}\right)\cdots\left(1+\dfrac{1}{n^3}\right)\le3-\dfrac{1}{n}$$ and then proceed by induction. The problem is that I can't find a motivation for the above change.I mean,we could have subtracted a lot of things from the RHS but what should nudge us to try $\dfrac{1}{n}$?The rest of the proof is quite standard,but I can't see how I am supposed to have thought of it.Is it just experience?Or is it a standard technique?A little guidance and motivation will be appreciated. |
First of all, I got this picture from one of Downgraf's designs on Pinterest, and I am very interested in creating a design similar to this. I want to know what it's called and how it's made with less difficulty. Thank your in advance. | So I've got a file with loads of simple objects. This will later be used to cut out these shapes out of plastic. So, using the material optimally is of outmost importance. I was wondering if there is any script or plugin that could automaticly arrange the objects within the artboard so they could fit best. |
Consider the cauchy problem of finding u=u(x,t) such that $u_{t}+uu_{x}=0$ for $x \in \mathbb R$ , $t \gt 0$ with $ u(x,0)= u_0(x)$ for $x \in \mathbb R$ then, which choices of the following functions for $u_0$ yields a $C^1$ (here, $C^1$ is the space of continuously differentiable functions) solution $u(x,t) $ for $x \in \mathbb R$ , $t \gt 0$ (a) $\frac{1}{1+x^2}$ (b) $ x $ (c) $1+ x^2$ (d) $1+2x$ I have no idea on how to proceed in this problem. | Consider the Cauchy problem of finding $u=u(x,t)$ such that $$\frac{\partial{u}}{\partial{t}}+u\frac{\partial{u}}{\partial{x}}=0\text{ for }x\in\mathbb{R},t>0\\u(x,0)=u_0(x),\;x\;\epsilon\;\mathbb{R}$$ which choice(s) of the following functions for $u_0$ yield a $C^1$ solution $u(x,\ t)$ for all $x\in\mathbb{R}$ and $t>0.$ $u_0(x)=\frac{1}{1+x^2}$ $u_0(x)=x$ $u_0(x)=1+x^2$ $u_0(x)=1+2x$ Because characteristic of the given PDE is $U=U_0(x-ut)$ from option 2, 4 only the satisfies the given PDE is i am right |
I just want to know why we take only long type serialVersionUID variable in java `public static final long serialVersionUID = 1L;` I mean i know how it works + what is serialization etc. But i am just curious to know that why we only take long primitive type ? why not int or any other type? like this public static final int serialVersionUID = 1; Is java specification tell us to do that? | Eclipse issues warnings when a serialVersionUID is missing. The serializable class Foo does not declare a static final serialVersionUID field of type long What is serialVersionUID and why is it important? Please show an example where missing serialVersionUID will cause a problem. |
I followed this using the Fashion MNIST dataset. The training set contains 60,000 28x28 pixels greyscale images, split into 10 classes (trouser, pullover, shoe, etc...). The tutorial uses a simple model: model = keras.Sequential([ keras.layers.Flatten(input_shape=(28, 28)), keras.layers.Dense(128, activation='relu'), keras.layers.Dense(10) ]) This model reaches 91% accuracy after 10 epochs. I am now practicing with another dataset called CIFAR-10, which consists of 50,000 32*32 pixels RGB images, also split into 10 classes (frog, horse, boat, etc...). Considering that both the Fashion MNIST and CIFAR-10 datasets are pretty similar in terms of number of images and image size and that they have the same number of classes, I naively tried training a similar model, simply adjusting the input shape: model = keras.Sequential([ keras.layers.Flatten(input_shape=(32, 32, 3)), keras.layers.Dense(128, activation='relu'), keras.layers.Dense(10) ]) Alas, after 10 epochs, the model reaches an accuracy of 45%. What am I doing wrong? I am aware that I have thrice as many samples in an RGB image than in a grayscale image, so I tried increasing the number of epochs as well as the size of the intermediate dense layer, but to no avail. Below is my full code: import tensorflow as tf import IPython.display as display from PIL import Image from tensorflow import keras import numpy as np import matplotlib.pyplot as plt import pdb import pathlib import os from tensorflow.keras import layers #Needed to make the model from tensorflow.keras import datasets, layers, models (train_images, train_labels), (test_images, test_labels) = datasets.cifar10.load_data() IMG_HEIGHT = 32 IMG_WIDTH = 32 class_names = ['airplane', 'automobile', 'bird', 'cat', 'deer', 'dog', 'frog', 'horse', 'ship', 'truck'] train_images = train_images / 255.0 test_images = test_images / 255.0 def make_model(): model = keras.Sequential([ keras.layers.Flatten(input_shape=(IMG_HEIGHT, IMG_WIDTH, 3)), keras.layers.Dense(512, activation='relu'), keras.layers.Dense(10) ]) model.compile(optimizer='adam', loss=tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True), metrics=['accuracy']) return model model=make_model() history = model.fit(train_images, train_labels, epochs=10) EDIT: In order to address colt.exe's suggestion below, I converted the CIFAR-10 images from RGB to greyscale, using: rgb_weights = [0.2989, 0.5870, 0.1140] train_images = np.dot(train_images, rgb_weights) test_images = np.dot(test_images, rgb_weights) However, using the same model with 10 epochs yields an accuracy of about 38%, even worse than before! I am starting to think that the Fashion MNIST is "easier" to work with since all images have a light background, whereas the CIFAR-10 consist of pictures taken outdoors in a wide variety of contexts. | I followed this using the Fashion MNIST dataset. The training set contains 60,000 28x28 pixels greyscale images, split into 10 classes (trouser, pullover, shoe, etc...). The tutorial uses a simple model: model = keras.Sequential([ keras.layers.Flatten(input_shape=(28, 28)), keras.layers.Dense(128, activation='relu'), keras.layers.Dense(10) ]) This model reaches 91% accuracy after 10 epochs. I am now practicing with another dataset called CIFAR-10, which consists of 50,000 32*32 pixels RGB images, also split into 10 classes (frog, horse, boat, etc...). Considering that both the Fashion MNIST and CIFAR-10 datasets are pretty similar in terms of number of images and image size and that they have the same number of classes, I naively tried training a similar model, simply adjusting the input shape: model = keras.Sequential([ keras.layers.Flatten(input_shape=(32, 32, 3)), keras.layers.Dense(128, activation='relu'), keras.layers.Dense(10) ]) Alas, after 10 epochs, the model reaches an accuracy of 45%. What am I doing wrong? I am aware that I have thrice as many samples in an RGB image than in a grayscale image, so I tried increasing the number of epochs as well as the size of the intermediate dense layer, but to no avail. Below is my full code: import tensorflow as tf import IPython.display as display from PIL import Image from tensorflow import keras import numpy as np import matplotlib.pyplot as plt import pdb import pathlib import os from tensorflow.keras import layers #Needed to make the model from tensorflow.keras import datasets, layers, models (train_images, train_labels), (test_images, test_labels) = datasets.cifar10.load_data() IMG_HEIGHT = 32 IMG_WIDTH = 32 class_names = ['airplane', 'automobile', 'bird', 'cat', 'deer', 'dog', 'frog', 'horse', 'ship', 'truck'] train_images = train_images / 255.0 test_images = test_images / 255.0 def make_model(): model = keras.Sequential([ keras.layers.Flatten(input_shape=(IMG_HEIGHT, IMG_WIDTH, 3)), keras.layers.Dense(512, activation='relu'), keras.layers.Dense(10) ]) model.compile(optimizer='adam', loss=tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True), metrics=['accuracy']) return model model=make_model() history = model.fit(train_images, train_labels, epochs=10) |
Download of files successful. Power failed about halfway through build. Have used the tools in grub, e.g fsck to no avail. Is there a root command that will restart the build from the new files? I'm unable to get to login, network, etc. I can get in as root from grub restore menu. Norm13 | During my attempt to upgrade my Xubuntu 14.04 installation with sudo apt-get dist-upgrade I made the mistake of interrupting the process by closing my laptop, which caused it to suspend to disk. After re-opening, the monitor remained black, so I was forced to reboot the system. I have since discovered many failures of drivers (wlan0 missing, USB memory stick cannot be mounted, USB mouse not recognised, and maybe more undiscovered problems with hardware). My beginner's attempts to manually repair the single problems could have made it even worse. During the installation of the current distribution I chose to encrypt my whole hard disk. |
In essence, what I'm looking for is a procedural 2D tilemap continuously generated in a fashion like Minecraft - which is to say generated as the player approaches the edges of the already explored parts of the map. Map is going to be for a topdown 2D-shooter and the purpose of the map is mostly just for background and determining types of enemies and loot to spawn, so it really doesn't need to be very complex. I've already researched some into the topic, but most of the answers have honestly been a bit too complicated or seemingly made for pregenerated maps. Voronoi Diagrams and Simplex Noise, while impressive, I don't really understand how to implement in a continuous fashion in realtime. Or at all, really. What I'm imagining with the generator would be to create simple biomes, composed of two values determining its 'artificiality' (i.e. how man-made the biome is) and 'life' (which is how populated it is). An example would be a city, with high values of life and artificiality both. The values for each would be skewed towards that of its neighbour to ensure that you don't have completely random values. It'd probably be a good idea to ensure that a 'biome' doesn't get too large too, by limiting the amount of tiles? My question is, are there any better or simpler algorithms to use for something like this beyond Voronoi and Simplex? The game is programmed in C#, I feel I should mention. | I'm starting/started a 2D tilemap RPG game in Java and I want to implement random map generation. I have a list of different tiles, (dirt/sand/stone/grass/gravel etc) along with water tiles and path tiles, the problem I have is that I have no idea where to start on generating a map randomly. It would need to have terrain sections (Like a part of it will be sand, part dirt, etc.) Similar to how Minecraft is where you have different biomes and they seamlessly transform into each other. Lastly I would also need to add random paths into this as well going in different directions all over the map. I'm not asking anyone to write me all the code or anything, just piont me into the right direction please. tl;dr - Generate a tile map with biomes, paths and make sure the biomes seamlessly go into each other. |
We know that if $\{M_n\}$ is a martingale, we know from definition of martingale that $E(M_n) = M_0$ for all $n \geq 0$. However, if we only know that a sequence of random variables $\{X_n\}$ is a local martingale, do we still have the result that $$E(X_n) = X_0, \forall n\geq 0?$$ And why? | Find an example of a discrete-time local martingale that is not a true martingale. I was thinking hard for some time about this fun problem. I know that $\mathbb{E}[|M|_t]=\infty \text{ for some } t\geq0$ should hold. Moreover any non-negative local martingale in discrete time is a true martingale, so this restricts my choice even more. I played around with Cauchy distribution, doubling strategy. |
How to log in one time and can use multiple domain example : Google account can use , by single login [Server side PHP] | Our company has multiple domains set up with one website hosted on each of the domains. At this time, each domain has its own authentication which is done via cookies. When someone logged on to one domain needs to access anything from the other, the user needs to log in again using different credentials on the other website, located on the other domain. I was thinking of moving towards single sign on (SSO), so that this hassle can be eliminated. I would appreciate any ideas on how this could be achieved, as I do not have any experience in this regard. Thanks. Edit: The websites are mix of internet (external) and intranet (internal-used within the company) sites. |
I have a complex style named code in my Word 2007 normal.dotm document on one machine (setting 'New documents based on this template'). I want to transfer it to another machine (also Word 2007), also to be available in all documents. I see plenty of tips about transferring styles on one machine, but how do I transfer it across (Windows) machines? BTW In an attempt to recreate the style there is already a style named code on the target machine. | I have created a Quick Style Set in Word 2010 that I would like to share with colleagues. I have called this QSS OurReport. Another web site suggested the following For Windows 7, the folder should be Users[username]\AppData\Roaming\Microsoft\QuickStyles. Open Word File > options > advanced Scroll all the way down to section titled “General” Click “File locations” Click “User templates” – this will bring you to templates but also quick styles folder I have no Quick Styles Folder in my Roaming file locations |
Some papers are published under category "communicated by ...". Do this mean the author contact this person to review the paper instead of editorial board? My question is: do journals generally allow authors to bring their own reviewers for evaluating the papers? It seems that some journals allow that. | What does it mean when it says under a journal article that it has been communicated by "XYZ" where XYZ is not the author but some other scholar with a very strong reputation? What is the relationship to the actual author and/or the content? Is this some sort of seal of approval to get results out and known quickly? (I am specifically wondering in the context of mathematics and mathematical physics.) |
I give my installation method below. Basically cannibalized from older posts on other drivers for older Ubuntu releases. The purpose of this question is three fold: Learn the preferred way of installing the driver mentioned in the header of this post for the hardware in the header of this post. Learn pros/cons of my current approach Document my approach as there doesn't seem to be a clear post for my particular hardware/Ubuntu combination to aid others in a similar situation Some context I'm setting up a Deep Learning environment on my machine so am currently going through the pains of setting up the host machines driver and then will move on to installing nvidia-docker and so on. My installation method: Download latest long lived release (367.44): sudo apt install nvidia-modprobe Restart At login prompt: ctrl-alt-F1 for tty Login with credentials sudo service lightdm stop sudo init 3 cd ~/Downloads chmod u+x [Nvidia installer here].run sudo init 3 sudo ./[Nvidia installer here].run Ignore errors about pre-install script failing and 32 lib target install location not found. If there are errors saying that nouveau is still in use (after being blacklisted) then might be necessary to update the initramfs disk, so then do: sudo update-initramfs -u reboot A black screen will be present on reboot instead of normal Ubuntu splash screen. Repeat steps 3 and on. Ignore step 9 (only necessary once). Not sure if step 7 is needed again I had to do two iterations starting from step 3 and on since sudo init 3 seemed to actually start the X server so I was getting an “X server is running” error during install of .run file. So on second iteration (and consequently second reboot) I left out step 7 and it seemed to work. sudo service lightdm start sudo reboot Log in and check: System Settings -> Details -> Graphics Should read something like “GeForce ...” (assuming you have a GeForce series GPU) In my case: “GeForce GTX 970/PCIe/SSE2” NVIDIA X Server Settings -> NVIDIA Driver Version Should read “367.44” Addendum: I did see an Xorg error on startup/login: “Xorg crashed with SIGABRT in RRSetChanged()”. It seems that this is a known bug for Nvidia gpus and doesn’t seem to be critical. Questions: I see that it "may" be possible to accomplish this installation via ppa:graphics-drivers Reference: Would this have accomplished the very same thing as my installation method and how does it compare (pros/cons) to mine above? Even though my installation above seems to have been successful, I'd like to know what pros/cons exist due to my approach and what (if any) issues might arise from my approach as I continue to install my Deep Learning environment (e.g. nvidia-docker, theano, keras, etc)? | I just ordered the Nvidia GTX card. I have a dilemma, though. Should I keep using the driver which is available in "additional drivers" in Ubuntu, or should I install the driver from the Nvidia site? So which driver is the best for me? |
I have a server with high cpu and ram, they are not getting hit hard. I am trying to hit 4,000 concurrent connections. I have done: 1) increase mysql max connections 2) update prefork settings in /etc/apache2/apache2.conf <IfModule mpm_prefork_module> StartServers 100 MinSpareServers 10 MaxSpareServers 10 ServerLimit 40000 MaxClients 40000 MaxRequestsPerChild 1000 </IfModule> What other steps should can i take? | This is a about capacity planning for web sites. Related: What are some recommended tools and methods of capacity planning for web sites and web-applications? Please feel free to describe different tools and techniques for different web-servers, frameworks, etc., as well as best-practices that apply to web servers in general. |
I need some help with a work project I have been assigned. At the moment we manually go to the site, logon and then download 2 excel files from a supplier's website every month. The files are then loaded into SQL. We want to automate this process. Now the loading of the files into SQL I can do, but I am not sure how I can automate logging onto the website entering my user details and collecting the files. I mostly deal with SQL and have very little .NET experience, so any code samples would be most appreciated. Just to confirm. The logon form is on a aspx page. just a basic form with a table containing the username & password fields, the forgotten password link and the logon button | How can I login to the this page by using HttpWebRequest? Login button is "Pošalji" (upper left corner). HTML source of login page: <table id="maintable" border="0" cellspacing="0" cellpadding="0" style="height:100%; width:100%"> <tr> <td width="367" style="vertical-align:top;padding:3px"><script type="text/javascript"> function checkUserid(){ if (document && document.getElementById){ var f = document.getElementById('userid'); if (f){ if (f.value.length < 8){ alert('Korisničko ime treba biti u formatu 061/062 xxxxxx !'); return false; } } } return true; } </script> <div style="margin-bottom:12px"><table class="leftbox" style="height:184px; background-image:url(/web/2007/slike/okvir.jpg);" cellspacing="0" cellpadding="0"> <tr> <th style="vertical-align:middle"><form action="http://sso.bhmobile.ba/sso/login" method="post" onSubmit="return checkUserid();"> <input type="hidden" name="realm" value="sso"> <input type="hidden" name="application" value="portal"> <input type="hidden" name="url" value="http://www.bhmobile.ba/portal/redirect?type=ssologin&amp;url=/portal/show?idc=1111"> <table class="formbox" align="center" cellspacing="0" cellpadding="0"> <tr> <th style="vertical-align:middle; text-align:right;padding-right:4px;">Korisnik:</th> <td><input type="text" size="20" id="userid" name="userid"/></td> </tr> <tr> <th style="text-align:right;padding-right:4px;">Lozinka:</th> <td><input type="password" size="20" name="password" /></td> </tr> <tr> <th colspan="2"> <input class="dugmic" type="image" id="prijava1" alt="Prijava" src="/web/2007/dugmici/posalji_1.jpg" onmouseover="ChangeImage('prijava1','/web/2007/dugmici/posalji_2.jpg')" onmouseout="ChangeImage('prijava1','/web/2007/dugmici/posalji_1.jpg')"> </th> </tr> </table> <div style="padding:12px;"> <a href="/portal/show?idc=1121">Da li ste novi BH Mobile korisnik?</a><br /> <a href="/portal/show?idc=1121">Da li ste zaboravili lozinku(šifru)?</a><br /> </div> </form></th> </tr> </table></div> Form action is . How can I use this with HttpWebRequest to get a cookie and use some date from this page? |
Let A1 = 14, and let An be the number of the form 1444... with n fours following the 1. Find all n such that An is a perfect square. It is obvious that A2 = 144 is a perfect square and possibly the only one, yet I haven't found a way to prove that. Possibly the biggest hint is that if $$ An = (13*10^n - 4) / 9\\$$ and if $$ An = k^2 $$ then $$ k = 13i + 1 \\ or \\ k = 13i + 12 $$ for some value of i. | We know that $12^2 = 144$ and that $38^2 = 1444$. Are there any other perfect squares in the form of $\frac{13}{9} (10^n - 1) + 1$ (i.e. $1$ followed by $n$ $4$'s), and how would we prove it? |
Why is the actual custom message not shown? I may agree with the custom message that the other person used... | When I come across a suggested edit in the review queue that has already been given a custom rejection reason, it will be common for me to also want to give the exact same custom rejection reason (if I happen to agree with the rejection reason of the previous reviewer). I suggest that, in the case where a previous reviewer has cast a reject vote with a custom reason, that there be another radio button, after custom, that contains the exact reason they used. Another similar option would be to have a link/button that automatically populates the rejection reason with the rejection reason of the previous reviewer (if applicable) directly into the custom rejection textbox. Yes, I can copy paste, but it's not quite as trivial if there is markup in the custom reason (it's not uncommon to see links to the FAQ or other guidelines in the rejection reason). |
I have made a small eclipse type object with black material. One of the face is not displayed correctly in edit mode. It is displayed correctly in object mode and in final render. I have attached a screenshot with the culprit face highlighted in red circle. | I just started blender a few days ago and I noticed that when making faces, they sometimes have this dotted texture compared to the generic smooth texture. I have been having difficulties with this and was wondering why these dotted faces are different from the regular faces, how do I get rid of them and what are the advantages of using them? This is my image: Thank you! |
I have a simple water setup: water flowing into a basin. In edit mode, I can see the wireframe of the water, but once it is rendered, I don't see anything. What is going on here? is my .blend | I have a model of a building with a sidewalk around it. Both show up when I switch to rendering mode in both Blender Render and Cycles Render mode. But: when I hit F12 for a final proper render, the building shows up -- but the sidewalk doesn't. I've checked the normals and I thought the normals seemed pointed in the right direction. I've set the Clipping on the Camera to a high number. I removed all the materials from the sidewalk and added a new material-- the problem persists. I've exported the blend as an FBX file and the Sidewalk shows up fine in Unity. Just in final renders, it doesn't show up. Here is a blend file: . I tried to destroy everything unrelated to the issue and label things in a clear way. Thanks. |
I've encountered on SO. At the end of the answer the user has placed a link to his article on a 3rd party site that requires paid subscription before reading articles. This makes the link totally useless. The answer by itself is useful, however. After my downvote with comment why I did so, there was a bit of flame that ended up with a phrase, the paywalled link is useless only for penniless freeloaders, hence the title. Worse than that. I'm a curious guy, so I went the user's profile and looked at the recent answers. Out of five most recent answers, three contain links to the same site: , , and the least one is useless without the content of the article. I did not look in older answers (), and the pattern makes me thinking that the misleading link was not an innocent mistake, but the entire reason this user's presence on SO is promoting a paid site. Again, by itself there's no crime if the links are attributed well. I've read carefully several articles here on Meta: - I don't think it should be banned. But I'm still confused. It is more surprising for me to see not a newbie like myself doing that, but someone with 3 years membership and 14k rep (I'm not kidding!). So, considering the fact that removing bad links is against the major user's goal here, I'd like to know: Should I flag the answer (and comments within) as spam? If so, what formal reason to be there? "Soliciting"? Should such links clearly say don't go there unless you have a paid subscription? Am I too sensitive, and it's just an innocent bad habit, or "penniless freeloaders" is a real horrible offense? Am I required to submit my own answer before being eligible for downvoting this particular user? :-) One more thing. I don't care about the personality of this user simply because you can't bring everyone to reason; legio mihi nomen est, quia multi sumus. What I want is just an ability to distinguish misleading links from valid ones. UPD After reading the answers and comments, I would like to direct the discussion in the following manner: If you tend to prevent any paywalled links: What to do with really good answers and a decent reputation that people make while answering? SO can't just throw it away; If you're up to a free speech paradigm: @Chris: @Widor: Also, how these links are to be attributed? | It's that posting links to your own website is ok, but should there be a line drawn? There were several spam flags today for 's recent posts, presumably because they all link to his website. Initially I disagreed because his answers seem for the most part relevant to the question, but then I looked into it more and realized there's three things that set this apart from most of the related cases that have come up: This isn't an occasional thing -- he's posted in the last year This isn't a random blog he writes for a fun, it's a for-profit company he and makes money promoting I'm not willing to go through all 412, but from the sample I checked, he generally doesn't mention that the products he's recommending are his own. The site is linked from his profile, but most people aren't going to check that Is all this considered acceptable use, or are the spam flags accurate? |
So yesterday I had a grub issue that required me to comment out the other two drive sin my fstab that get mounted. 1. an ssd that houses my qcow2 vm. 2. a 1tb seagate So all I had listed was / and swap. After I got booted in to the system I notice the ssd which was /dev/sdd changed to /dev/sdc. OK I thought.. whatever I'll recreate the vm to look at sdc now. Fast forward to 20 minutes ago, my vm stopped booting, upon further inspection sdc was now back to sdd. What gives? What could cause this or where can I look to determine the cause? | I've set up fstab to auto mount media drives on a Linux Mint machine. The OS is installed on a IDE/ATA Disk while 3 SATA disks hold data to share. The BIOS has the ATA disk as first boot device. All SATA drives are NTFS non bootable with a single partition. When I installed the OS: The ATA disk was seen as sda and the other drives as sdb, sdc and sdd. The problem is that every so often when I reboot, the drives are changing: sda becomes sdd, sdb becomes sda, etc... It doesn't seem to affect the OS, but obviously my fstab config sends errors. All the drives seem fine, and none of them is ever missing. So, question: can I force to map the drives with fixed path? I tried using Labels but it didn't seem to work. Also, I don't know if it is abnormal and/or relevant but my ATA drive has four partitions: - sda1 => OS - sda2 => Empty EX4 partition, maybe concurrent OS in the future - sda4 => Extended partition - sda5 => Swap - sdb4 => SATA HDD 1 - sdc1 => SATA HDD 2 - sdd1 => SATA HDD 3 Isn't there something weird? I'd have thought I would get sda1 to 4, then sdb1, sdc1, and sdd1. Thanks for your help! |
I have a class named Point that overloading "==" and "!=" operators to compare two Point object. How can I compare my Point object with "null", this a problem because when I call == or != operator with null a problem inside Equals method. Please open a console application and see what I want to say.How can I fix it. public class Point { public int X { get; set; } public int Y { get; set; } public static bool operator == (Point p1,Point p2) { return p1.Equals(p2); } public static bool operator != (Point p1, Point p2) { return !p1.Equals(p2); } public override bool Equals(object obj) { Point other = obj as Point; //problem is here calling != operator and this operator calling this method again if (other != null) { if (this.X == other.X && this.Y == other.Y) { return true; } return false; } else { throw new Exception("Parameter is not a point"); } } } class Program { static void Main(string[] args) { Point p1 = new Point { X = 9, Y = 7 }; Point p2 = new Point { X = 5, Y = 1 }; p1.X = p2.X; p1.Y = p2.Y; bool b1=p1==p2; Console.ReadKey(); } } | I came across this recently, up until now I have been happily overriding the equality operator (==) and/or Equals method in order to see if two references types actually contained the same data (i.e. two different instances that look the same). I have been using this even more since I have been getting more in to automated testing (comparing reference/expected data against that returned). While looking over some of the I came across an that advises against it. Now I understand why the article is saying this (because they are not the same instance) but it does not answer the question: What is the best way to compare two reference types? Should we implement ? (I have also seen mention that this should be reserved for value types only). Is there some interface I don't know about? Should we just roll our own?! Many Thanks ^_^ Update Looks like I had mis-read some of the documentation (it's been a long day) and overriding may be the way to go.. If you are implementing reference types, you should consider overriding the Equals method on a reference type if your type looks like a base type such as a Point, String, BigNumber, and so on. Most reference types should not overload the equality operator, even if they override Equals. However, if you are implementing a reference type that is intended to have value semantics, such as a complex number type, you should override the equality operator. |
I have recently swapped to Ubuntu 18.04 after being 'Windows 10'd'- with a system that isn't up to running 10. The standard download doesn't have a driver for my WiFi (Broadcom BCM43142). I have found a driver download for this, but I am having trouble getting it installed. | I'm having serious problems installing the Broadcom drivers for Ubuntu. It worked perfectly on my previous version, but now, it is impossible. What are the steps to install Broadcom wireless drivers for a BCM43xx card? I'm a user with no advance knowledge in Linux, so I would need clear explanations on how to make, compile, etc. lspci -vnn | grep Network showed: Broadcom Corporation BCM4322 802.11a/b/g/n Wireless LAN Controller [14e4:432b] iwconfig showed: lo no wireless extensions. eth0 no wireless extensions. NOTE: Answer below is updated every time new information is added and confirmed working. |
As the "computer guy" in the family, I am the default person to ask computer questions. My 10 year old nephew wants to install a Minecraft mods and asked me how to do it. I have never played Minecraft, so I am unfamiliar with it. I did some quick searches and it appears Curse supports Minecraft. I used Curse back in my Warcraft days and found it easy to use for installing mods. Is Curse as easy to use for Minecraft as it was for Warcraft? If I get it installed on their computer remotely, will it be easy for a 10 year old to use? | I've recently changed to the new Minecraft launcher, and I have noticed a change in the .minecraft folder layout. I can no longer install mods just by copying it over into the versions/1.6.1 jar file, as this file refreshes every time it is launched. For those who don't know what I am talking about, here is the new layout: I am specifically trying to install Optifine, which does work with 1.6.1. Where do I drag in the mod files now? I can't seem to find a jar file that is suited to it, except in the version folder, but as I stated above, this refreshes every time. After copying a recent version and renaming it in the version folder, I get this error in the development console: Unexpected exception refreshing version list java.lang.IllegalArgumentException: Version '1.6.1' is already tracked at net.minecraft.launcher.updater.VersionList.addVersion(VersionList.java:91) at net.minecraft.launcher.updater.LocalVersionList.refreshVersions(LocalVersionList.java:44) at net.minecraft.launcher.updater.VersionManager.refreshVersions(VersionManager.java:47) at net.minecraft.launcher.Launcher$2.run(Launcher.java:164) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) |
How is it possible to change the name sorting for every last author in the bibliography? In the following WME it should be ... and N. Tesla instead of ... and Tesla, N. I'm using biblatex with biber and pdflatex from texlive 2017 Please see this WME: \documentclass{article} \usepackage{filecontents} \usepackage{etoolbox} \usepackage[style=authoryear, maxnames = 1, maxbibnames=99,firstinits=true]{biblatex} \DeclareNameAlias{sortname}{family-given} % Reihenfolge beim Namen \begin{filecontents}{\jobname.bib} @article{test, author = "Einstein, Albert and Mouse, Mickey and Duck, Donald and Tesla, Nikola ", title = "Is reality fun?", year = "2201"} \end{filecontents} \addbibresource{\jobname.bib} \begin{document} Here is some random text with a cite \cite{test}. In the biblopgraphy the last author after the \textbf{and} should be sorted Given-Family, i.e. \textit{N. Tesla}. \printbibliography \end{document} | Thank you in advance. So apparently I spent a lot of time editing Citavi styles to find out I cannot use them in LATEX :D What I need is a bibliography with several authors being in this order: last name, first name, last name, first name and first name last name -> instead of "and" an "und" would be great (german) what I get in Bibliography: what I need it to look like (created with Citavi): |
On page 107 of the DND 5E players handbook there is a labeled area called "Spells known of first level and higher", in this section it says "when you gain a level in this class, you can choose one of the warlock spells you know and replace it with another spell from the warlock spell list, which also must be of a level for which you have spell slots. I am starting out a new character as a warlock, and I thought well what are cantrips if not spells. I saw that on this answers forum it says in the DND Rulebook that cantrips are level 0 spells. If they(warlock cantrips) are spells does that mean I can upgrade my 2x0 Level cantrips to, lets say 2x2nd level spells or can you not upgrade cantrips to higher spell slots? | Many classes: bard, ranger, sorcerer, and warlock have this type of text in their Spellcasting or Pact Magic feature under Spells Known of 1st Level or Higher: Additionally, when you gain a level in this class, you can choose one of the spells you know and replace it with another spell from the spell list, which also must be of a level for which you have spell slots. Can I choose to replace cantrips or only spells of 1st level or higher? |
Hi I am writing my resume in Latex. In "Professional service" section, I wish to list journals I refereed papers to. And I wish to do something like the following template. It seems that the names of journals are put in a table and as items. Could any one let me know how to achieve this? Thanks. Update: Another minor issue is that in the picture, we see the line "refereed articles for ..." and the line right below has a large blank space. Is there a way to remove that? Obviously we wish to save space in a resume. Thanks. | Is it possible to split an itemize list into several columns? (I'm sure it is, but I couldn't find a solution around here) And additionally: Is it possible to automatically split a list into multiple columns if it reaches a certain item length? so i want to display item1 item2 item3 instead of item1 item2 item3 while this should still happen item1 item4 item2 item5 item3 item6 |
Certainly a stupid question. I have a newcounter defined normaly, that is \newcounter{sharc} How can I call a specific value of this counter with a command like label/ref ? Exemple blabla `\thesharc` blala blabla `\thesharc` blabla blabla `\thesharc` blabla <- I want to refer to this value blabla `\thesharc` blabla | I have an implications environment impl whose counter works as intended (1,2...). In a subsequent chapter, I develop a series of hypotheses for each implication, and I want the hypothesis environment hypo to recognize the counter of the implication that it belongs to. So far what I have is: \documentclass{article} \usepackage{amsmath} %% Implications \newcounter{implcounter} \newenvironment{impl}{ \refstepcounter{implcounter} \textbf{Implication \theimplcounter:} }{\par} %% Hypotheses \newcounter{hypcounter} \newenvironment{hypo}{ \refstepcounter{hypcounter} \textbf{Hypothesis \thehypcounter:} }{\par} \numberwithin{hypcounter}{implcounter} \begin{document} This is one implication: \begin{impl} \label{impl:a} Hello \end{impl} This is another implication: \begin{impl} Bye bye \end{impl} But then: \begin{hypo} Not the numberwithin I would like! % I would like for this to be implication 1.1 \end{hypo} \end{document} I would like to have a hypo environment for which the number within is the one referenced by \label{impl:a}, in this case 1. |
On my website, I have always ordered my code with the code for the sidebar coming first, then the navigation bar, then the content section (with the individual paragraphs, images, etc... specific to each page), and lastly the footer. By order, I simply mean the code for my sidebar is first in the HTML document. The sidebar, navigation bar, and footer are all pretty much the same on all pages of the website. Is it bad that I am listing the duplicate content first? Should I be putting my content code first, because that is the part that is unique to each individual page? Does it matter what order code is listed in (especially for example if the navigation is absolute positioned and not within the flow of the document)? Edit This is specific not only about the order of HTML code but also the influence of duplicate content within the order of HTML. It may be that text that comes first in an HTML document is more heavily weighted, but does duplicate content apply to that as well. | Possible Duplicate: Across different sites on different second-level domains exists a universal navigation bar with a collection of roughly 30 links. This universal bar is exactly the same for every page on each domain. The bar's HTML, CSS and JavaScript are all stored in a subfolder for each domain and the HTML is embedded upon serving the page and is not being injected on the client side. None of the links use any rel directives and are as vanilla as can be. My question is about Google's duplicate content rule. Would something like this be considered duplicate content? Matt Cutt's about duplicate content mentions boilerplate repetition, but then he mentions lengthy legalese. Since the text in this universal bar is brief and uses common terms, I wonder if this same rule applies. If this is considered duplicate content, what would be a good way to correct the problem? |
I do sudo apt-get update from time to time, and find it frustrating to have to check when it is done doing its thing. Is there anyway I can get it to offer a notification popup or play a sound when it has finished executing, so I can get on with my work? | How can I add a notification of some sort (like playing a .wav file or creating a pop-up on the status bar) when a process finishes. For example, I am compiling a program that takes a couple of hours to finish. I would like to hear/see some sort of message when it completes compiling. Is there a tool for doing this (like tying an alarm program to the pid of a process) or something like that? |
It can be handy to time code execution so you know how long things take. However, I find the common way this is done sloppy since it's supposed to have the same indentation, which makes it harder to read what's actually being timed. long start = System.nanoTime(); // The code you want to time long end = System.nanoTime(); System.out.printf("That took: %d ms.%n", TimeUnit.NANOSECONDS.toMillis(end - start)); An attempt I came up with the following, it looks way better, there are a few advantages & disadvantages: Advantages: It's clear what's being timed because of the indentation It will automatically print how long something took after code finishes Disadvantages: This is not the way AutoClosable is supposed to be used (pretty sure) It creates a new instance of TimeCode which isn't good Variables declared within the try block are not accessible outside of it It can be used like this: try (TimeCode t = new TimeCode()) { // The stuff you want to time } The code which makes this possible is: class TimeCode implements AutoCloseable { private long startTime; public TimeCode() { this.startTime = System.nanoTime(); } @Override public void close() throws Exception { long endTime = System.nanoTime(); System.out.printf("That took: %d ms%n", TimeUnit.NANOSECONDS.toMillis(endTime - this.startTime)); } } The question My question is: Is my method actually as bad as I think it is Is there a better way to time code execution in Java where you can clearly see what's being timed, or will I just have to settle for something like my first code block. | How do you write (and run) a correct micro-benchmark in Java? I'm looking for some code samples and comments illustrating various things to think about. Example: Should the benchmark measure time/iteration or iterations/time, and why? Related: |
Let $n$ and $d$ denote integers. We say that $d$ is a divisor of $n$ if $n = cd$ for some integer $c$. An integer $n$ is called a prime if $n > 1$ and if the only positive divisors of $n$ are $1$ and $n$. Prove, by induction, that every integer $n > 1$ is either a prime or a product of primes. My try: First, that there's nothing to prove because a number is always a prime or not, so do not what to think. Step: $P(n): n$ is either a prime or a product of primes. If n=2 then 2 is prime. $P(n): True$ I want to see $P(n) \rightarrow P(n+1)$ If $n$ is a prime then $2$ is a divisor of $p+1$, then is a product of primes. If $n$ is a product of primes... I can't say anything about $n+1$. Some help... please. | I'm trying to get through Spivak's Calculus on my own and even though I kinda understand induction I'm not so sure that's the case when it comes to complete induction. So I tried to do a starred problem which involves using it. But I'm not sure that my proof is valid, can someone check this for me? So the problem is that I have to prove that For every natural $n>1$, if $n$ is not prime we can write it as a product of primes. I'm starting with a base case. For $n=2$, $n$ is prime, so the assumption holds. Let's assume that for some $n > 1$ and also all numbers $p <= n$ the assumption holds. Then $n+1 = cd$. If $n+1$ is not prime, then $c < n+1$ and $d < n+1$, but as they are natural numbers, we can also write that $c <= n$ and $d <= n$. But we assumed that if $p <= n$, and $p$ is not prime, we can write it as a product of primes. So if $c$ or $d$ are not primes, we can write them as a product of primes. That means that $n+1$ can be written as a product of primes if it's not prime, which completes the proof. |
I am reading which gives the following examples about redirection and file descriptors. ls > dirlist 2>&1 will direct both standard output and standard error to the file dirlist, while the command ls 2>&1 > dirlist will only direct standard output to dirlist. This can be a useful option for programmers. Are these examples the wrong way round? It seems to me the second example "will direct both standard output and standard error to the file dirlist" while the first example "will only direct standard output to dirlist". If I'm wrong about this (...probably...) can someone explain the logic of these 2 examples clearly? | I don't quite understand how the computer reads this command. cat file1 file2 1> file.txt 2>&1 If I understand, 2>&1 simply redirect Standard Error to Standard Output. By that logic, the command reads to me as follows: concatenate files file1 and file2. send stdout from this operation to file.txt. send stderr to stdout. end? I'm not sure what the computer's doing. By my logic, the command should be cat file1 file2 2>&1 > file.txt but this is not correct. |
For every fixed integer a we consider the following system of congruences: $$ax \equiv 1 \pmod{12}$$ $$x \equiv a \pmod{13}$$ If for example $a=0$, it's easy to see that the system does not have any solutions. The question is, for what integer values $a$ does the system have at least one solution? Here comes my answer to the question: The first equation has a solution if and only if $gcd(a,12)|1$. The only divisors that divide $1$ are ${-1,1}$. Therefore $a$ and $12$ must be co-prime due to the fact that $gcd(a,12)$ must be $1$ or $-1$ in order to divide $1$. Knowing that $a$ is co-prime with $12$, we can use Euler's Phi Function $$\phi(N) = | \{1 \leq a < n : gcd(a,N)=1\}|$$ to find the possible values of $a$. $$\phi(12) = |\{1,5,7,11\}|=4$$ With this new information regarding what possible values $a$ can attain. It is clear that the second equation has at least one solution for every allowed $a$. $a=1 \rightarrow x=1$ solves the system. $a=5 \rightarrow x=5$ solves the system. $a=7 \rightarrow x=7$ solves the system. $a=11 \rightarrow x=11$ solves the system. So the answer to the question is: The system has at least one solution when $gcd(a,12)=1$. Is my answer/reasoning correct? EDIT: Changed The system has at least one solution when $a \in \phi(12)$. to The system has at least one solution when $gcd(a,12)=1$. | Isn't finding the inverse of $a$, that is, $a'$ in $aa'\equiv1\pmod{m}$ equivalent to solving the diophantine equation $aa'-mb=1$, where the unknowns are $a'$ and $b$? I have seem some answers on this site (where the extended Euclidean Algorithm is mentioned mainly) as well as looked up some books but there is no mention of this. Am I going wrong somewhere or is this a correct method of finding modular inverses? Also can't we find the Bézout's coefficients by solving the corresponding diophantine equation instead of using the extended Euclidean Algorithm? |
I am confused about why this doesn't work. Pls help me. MC 1.12.2 /setblock ~ ~ ~ minecraft:command_block 11 replace {Command:"/summon Item ~ ~ ~ {Item:{id:"iron_ingot",Count:1,tag:{}}}"} | I need help with a specific command that I am using in a new game that I am creating inside of Minecraft. The command is: /give @p sign 1 0 {BlockEntityTag:{Text1:"{"text":" [MF2]","color":"gold","clickEvent": {"action":"run_command","value":"tellraw @a [""{"text":"[MF2] ","color":"gold"},{"selector":"@p","color":"dark_aqua"},{"text":" is now an admin of the server!","color":"white"}]"}}",Text3:"{"text":"Click to join Admin","color":"dark_aqua","clickEvent": {"action":"run_command","value":"scoreboard teams join admin @p"}}"},display: {Name:"Custom Sign"}} If I take out the /tellraw command then the command works fine, but I need the command in there to announce to the game that a new admin has joined. With the tellraw command, the error message is the following: Data tag parsing failed: Unexpected token 't' at: text":" [MF2]","color":"gold","clickEvent":{"action":"run_command","value":"tellraw @a [""{"text":"[MF2] ","color":"gold"}, {"selector":"@p","color":"dark_aqua"},{"text":" is now an admin of the server!","color":"white"}]"}}",Text3:"{"text":"Click to join Admin","color":"dark_aqua","clickEvent": {"action":"run_command","value":"scoreboard teams join admin @p"}}" If anyone knows how to fix this, please let me know. |
I do not know how to approach this problem. Is there something related to integrating? The function $f$ is defined on $[0,1]$, continuous, and positive. Find the following limit: $$\lim_{n\to \infty} \sqrt[n]{f \left( \frac{1}{n} \right) \cdot f\left(\frac{2}{n}\right)\cdot f\left(\frac{3}{n}\right)\cdots f\left(\frac{n}{n}\right)}$$ | Let there be a given function $f \in C([0,1])$, $f(x)>0$; $x\in [0,1]$. Prove $$\lim_{n\to\infty} \sqrt[n]{f\left({1\over n}\right)f\left({2\over n}\right)\cdots f\left({n\over n}\right)}=e^{\int_0^1 \log f(x) \, dx} $$ All the questions before this required solving an definite integral without Newton Leibnitz formula, then this came up, can anyone provide help? |
I don't know what's wrong with this statement, but whenever i run this i always get an error here is my sql: DELETE FROM tbl_usersinfo WHERE users_lname IN (SELECT users_lname FROM tbl_usersinfo WHERE users_lname = 'asd') here is my error: #1093 - You can't specify target table 'tbl_usersinfo' for update in FROM clause | I have a table story_category in my database with corrupt entries. The next query returns the corrupt entries: SELECT * FROM story_category WHERE category_id NOT IN ( SELECT DISTINCT category.id FROM category INNER JOIN story_category ON category_id=category.id); I tried to delete them executing: DELETE FROM story_category WHERE category_id NOT IN ( SELECT DISTINCT category.id FROM category INNER JOIN story_category ON category_id=category.id); But I get the next error: #1093 - You can't specify target table 'story_category' for update in FROM clause How can I overcome this? |
I want that when I apply glass shader then transparency must display but it is not , when I applied glass shader then reflection of trees are dipplayed instead of transparency , why? please help me, I am using blender 2.8, this problem is in both cyclic and EVEE | What I’m trying to achieve is an glassy object. Therefore I’ve opened a new scene in Blender 2.82a. I’ve Enabled Screen Space Reflections in Render Properties and set “Shade Smooth” for the object. I’ve set Transmisson to 1, reduced Roughness to 0 and enabled Screen Space Refraction in Material Properties. I didn’t do anything else. Entering the Viewport Shading view I’m seeing this: I’m afraid this is as newbie as it gets, but I’m stuck. I’ve dived into various settings for an hour or so and I’ve tried to google a solution for another without having any luck because I’ve no idea what’s happening and why. Why are there trees reflecting in my glass cube in an otherwise empty scene? And how do I get rid of them? I’ve found a place where I can change the image by clicking on the upper right downwards pointing arrow. But I’m unable to remove it or to replace it with a plain color or whatever. I’ve tried to enable ”Scene Lights“ and ”Scene World“ but that’s turning everything into anthracite leaving me literally groping in the dark. |
Sometimes (like 10 times a day) my ubuntu completely freezes (mouse stop working, the sound who whas playing start a annoying loop "repeating like the last 0.2 seconds") and the only thing im able to do is mannualy restart via the reset button on cpu case. What should i do? is there some system log where i can find the reason? thx and sorry my bad english | All operating systems freeze sometimes, and Ubuntu is no exception. What should I do to regain control when... just one program stops responding? nothing at all responds to mouse clicks or key presses? the mouse stops moving entirely? I have an In what order should I try various solutions before deciding to pull the power plug? What should I do when starting up Ubuntu fails? Is there a diagnostic procedure I can follow? |
I use \begin{enumerate} to label the equations (more precisely, problems for the assignments). And I found that the line changes if I change \item. I know that this situation is natural, but I've seen some papers (the picture included will be one example) that they use multiple spaces in one paper. Please teach me the method of doing this. (And actually, I'm using the template code downloaded from the internet, so I don't know how my codes are translated.) | This might seem like a very simple question, but what is the easiest way to turn a normal vertical list into a horizontal one? |
I am asking a related question here: If a ball is accelerating at a surface at a non-straight angle, it will bounce off with the opposite trajectory, like if you imagine a line under a V, and shoot a ball at the wall from one side of the V it will follow the whole V. But, why would the ball keep moving at all? If it's impact on the wall applies an equal and opposite force to it, shouldn't the two forces cancel out, stopping the ball, at least in the direction of the wall? | I am taking for granted that when we say that something is conserved it is understood 'in its full integrity'. Energy is represented by a scalar J, and is conserved in elastic collision. momentum is the product of a number (of Kg) by velocity which is a vector, and therefore has a direction: $p = m * v$. (In circular motion we say that speed is constant but velocity is constantly changing). In an elastic collision if a ball A (m = 1) with v = p = +8 in the x axis (E = 32) hits a ball B at rest (M =3) , B will proceed ( p = 4 *3 = +12, E = 24) and A will bounce in the opposite direction (p = v = -4, E = 8). We conclude that: +12 -4 = +8, momentum is conserved (and also energy: E = 8 + 24 = 32 J) If a perfectly elastic ball is thrown against a wall energy J is conserved, $E-i = E_f$ the value of the speed is unchanged, but the direction of the vector is reversed. I am asking: the momentum of what is conserved? if it is the momentum of the system this is not true in the first case, if it is the momentum of the single balls this is not true in the second case. Language of science must be precise, I hope you will not consider this as hair-splitting, but I ask: is there a general definition of 'conserved' valid for all instances? why a broad/permissive interpretation of the principle in the case of momentum? Or, most likely, where did I go wrong? EDIT : This does mean that the wall contains a momentum of 2mv (for mass m and velocity v). But note that since the mass of the wall is incredible compared to the ball, the velocity is notably imperceptible! If the momentum of the wall were to be 2mv, the energy of the bouncing ball should be impercetibly less but yet less: $E - \epsilon < E$ and the Energy of the ball would not be conserved. That means that a perfect elastic collision against a fixed body is not possible, in the sense that no body can have a CoR = 1. right? |
My data look like the below Rauf 11/12/2017 635 1240 1430 1630 Rauf 12/12/2017 630 1230 1430 1630 From Excel, I want to get the data as follows, Rauf 11/12/2017 635 Rauf 11/12/2017 1240 Rauf 11/12/2017 1430 Rauf 11/12/2017 1630 Rauf 12/12/2017 630 Rauf 12/12/2017 1230 Rauf 12/12/2017 1430 Rauf 11/12/2017 1630 | I have data that looks like this: Id | Loc1 | Loc2 | Loc3 | Loc4 ---+------+------+------+----- 1 | NY | CA | TX | IL 2 | WA | OR | NH | RI And I want to convert it to this: Id | LocNum | Loc ---+--------+---- 1 | 1 | NY 1 | 2 | CA 1 | 3 | TX 1 | 4 | IL 2 | 1 | WA 2 | 2 | OR 2 | 3 | NH 2 | 4 | RI What's the easiest way to do this in Excel 2007? |
I study with Friedberg's Linear Algebra 4th edition. I'm hesitating for my way to study linear algebra. Should I try to solve all problems in textbook or some choosen problems? Please give me an advise. Thank you. I major in physics and I also interested in mathematics. I want to build bases for my later learning physics and mathematics. | I have no idea if this question is appropriate for this forum, but I hope you guys can overlook the fact that I asked it on a wrong forum (if I did) and still help me answer it (of course, if this is indeed the wrong forum for the type of question I'm about to ask, do please say so). I am a 16 year old guy who is passionate about physics and as a result wants to increase his knowledge in mathematics, the language of physics. I've read and heard a lot about Linear Algebra and how crucial it is to physics and I am deeply motivated to self study this intriguing part of mathematics. However, I have limited knowledge of maths. I (for example) know basic algebra, trig, diff/int calc and some analytical geometry, but I wouldn't say I master these subjects past the high school curriculum. Now my question is: Would you kind people say I am able to self study Linear algebra or is it too tough and/or does it require too much of a math background? And are there any good books out there for BEGINNERS in LA? I found this (free) e-book called: Elementary Linear Algebra by Kenneth Kuttler and another one called 'Linear Algebra: Theory and its applications' also by Kuttler? Are these any good? Or would you recommend other books? If you guys have any tips regarding books for LA but also tips in general, please, I'd appreciate them! |
I want to create a shortcode using ACF Repeater Field and so I've found this code and when I tried to apply it on my website it doesn't work. Am using genesis frame work. my aim is create a shortcode using ACF Repeater Field and display table in post or page. Here is my code in functions.php: function menu_loop () { echo '<div class="entry-content dishes">'; // check if the repeater field has rows of data if( have_rows('menu_sections') ): // loop through the rows of data while ( have_rows('menu_sections') ) : the_row(); // display a sub field value echo '<h2>' . get_sub_field('section_title') . '</h2>'; if ( have_rows('sections_items'));?> <table> <thead> <tr> <td class="ja_name">Name</td> <td class="ja_description">Description</td> <td class="ja_price">Price</td> </tr> </thead> <?php while (have_rows('section_items') ): the_row(); ?> <tr> <td><?php the_sub_field('dish_names'); ?></td> <td><?php the_sub_field('dish_description'); ?></td> <td>$ <?php the_sub_field('dish_price'); ?></td> </tr> <?php endwhile;?> </table> <?php endwhile; else : // no rows found endif; ?></div> add_shortcode('testimonials', 'menu_loop'); | I want to create a shortcode using ACF Repeater Field and so I've found this code and when I tried to apply it on my website it doesn't work. Am using genesis frame work. my aim is create a shortcode using ACF Repeater Field and display table in post or page. Here is my code in functions.php: function menu_loop () { $menu = '<div class="entry-content dishes">'; // check if the repeater field has rows of data if( have_rows('menu_sections') ): // loop through the rows of data while ( have_rows('menu_sections') ) : the_row(); // display a sub field value $menu.= '<h2>' . get_sub_field('section_title') . '</h2>'; if ( have_rows('sections_items')); $menu.= '<table><thead><tr><td class="ja_name">Name</td><td class="ja_description">Description</td><td class="ja_price">Price</td></tr></thead>'; while (have_rows('section_items') ): the_row(); $menu.= '<tr><td>'.the_sub_field('dish_names').'</td><td>'.the_sub_field('dish_description').'</td><td>$ '.the_sub_field('dish_price').'</td></tr>'; endwhile $menu.= '</table> '; endwhile; else : // no rows found endif; ?> $menu.= '</div>'; // Code return $menu; } add_shortcode('testimonials', 'menu_loop'); using this code it shows syntax error, unexpected '$menu' (T_VARIABLE), expecting ';' |
can SMB1 be added back into Windows 10 AGAIN after it uninstalled itself? The net has NO searches for "downloading" SMB1 but lots of ENABLES. Can SMB1 be added back into Windows 10 for Router Storage sharing? Having SHARED storage on my ROUTER to Windows 7/10 is more important than the risk. | I find today that I can no longer mount my Netgear ReadyNas drive because apparently it is using SMB1 and Windows 10 have disabled since release 1709. This is very problemaic because I need to access these files and because I have lost the admin password for the ReadyNas itself so I cannot login in order to update/reconfigure it to use SMB2 instead. Microsoft refers me to which in turn refers me to if I really want re-enable SMB1 And I successfully did re-enable SMB1 by running Enable-WindowsOptionalFeature -Online -FeatureName smb1protocol from Powershell as Adminstrator. However even after reboot I still cannot re-establish connection to my Netgear from Windows Explorer, it gives the same error What else do I need to do ? PS C:\WINDOWS\system32> Get-WindowsOptionalFeature –Online –FeatureName SMB1Protocol FeatureName : SMB1Protocol DisplayName : SMB 1.0/CIFS File Sharing Support Description : Support for the SMB 1.0/CIFS file sharing protocol and the Computer Browser protocol. RestartRequired : Possible State : Enabled CustomProperties : ServerComponent\Description : Support for the SMB 1.0/CIFS file sharing protocol and the Computer Browser protocol. ServerComponent\DisplayName : SMB 1.0/CIFS File Sharing Support ServerComponent\Id : 487 ServerComponent\Type : Feature ServerComponent\UniqueName : FS-SMB1 ServerComponent\Deploys\Update\Name : SMB1Protocol Solution Thanks Bob, SMB 1.0/CIFS File Sharing Support was enabled but within it SMB 1.0 Client was not enabled, checking that box and rebooting fixed the issue. |
I have a pretty specific question, and have been able to find lots on conditional subsetting using awk but none that lends enough explicit code for me to generalize to my situation. I have a file 'keys' and a file 'features' both without headers. The 'keys' table contains two variables, KEY and GROUP (1st and second columns, respectively), toy example below. 1 GROUP0 2 GROUP0 3 GROUP1 4 GROUP1 5 GROUP2 6 GROUP2 The file 'features' contains a list of features of widgets like so (ID, FEATURE, VALUE 1st, 2nd and 3rd columns, respectively). A num_user 10 A KEY 4 B num_user 2 B KEY 2 B battery Large C num_user 10 C KEY 15 D num_user 2 D KEY 2 D battery Small E num_user 2 E KEY 7 E battery Small I am trying to select all rows for an ID which has a value of 'KEY' that is in the 'KEY' column of 'keys' for a hardcoded list of 'GROUP' values. The desired result is A num_user 10 A KEY 4 B num_user 2 B KEY 2 B battery Large D num_user 2 D KEY 2 D battery Small Any ideas? | I have a pretty specific question, and have been able to find lots on conditional subsetting using awk but none that lends enough explicit code for me to generalize to my situation. I have a file 'keys' and a file 'features'. The 'keys' table contains two variables, KEY and GROUP, toy example below. KEY GROUP --- ----- 1 GROUP0 2 GROUP0 3 GROUP1 4 GROUP1 5 GROUP2 6 GROUP2 The file 'features' contains a list of features of widgets like so ID FEATURE VALUE -- ------- ----- A num_user 10 A KEY 4 B num_user 2 B KEY 2 B battery Large C num_user 10 C KEY 15 D num_user 2 D KEY 2 D battery Small E num_user 2 E KEY 7 E battery Small I am trying to select all rows for an ID which has a value of 'KEY' that is in the 'KEY' column of 'keys' for a hardcoded list of 'GROUP' values. The desired result is ID FEATURE VALUE -- ------- ----- A num_user 10 A KEY 4 B num_user 2 B KEY 2 B battery Large D num_user 2 D KEY 2 D battery Small Any ideas? |
While compositing a series of long exposure images, I noticed this strange fringe-like pattern getting brighter at each layer blended in "lighten" mode. It features a circle and a cross in the middle and those deformed lines around it, sightly brighter than the rest of the image. It looks like a lens issue, but I've shot some sky photos with it before, , so I think a badly placed light source could be the cause of this effect. Lens: Vivitar 28-210mm F3.5-5.6 AF Zoom Camera: Canon t5i Shot at 28mm F3.5, 20 images of 30s each, raw, no camera denoise. Is there a way to remove such pattern? Is it something common in this kind of setup? | I'm shooting with a Nikon 810, and my night shots often have a strong moire when I export them from Lightroom at 640x640 (optimized for Instagram). This photo was shot at f2.8, ISO 4000, 15 seconds with a Nikkor 17-35mm. Does anyone know why this is happening?? |
As iron reacts with magnets producing a field dependent on magnet's pole orientation should an iron sphere when covered with little magnets which nord poles aim towards the center of the sphere become nothing less than a monopole with spawning south poles lines outwards? | If I place many micro-bar-magnets on the surface of hollow sphere such that the pole of every magnet points towards the same side then, you could imagine that a monopole would be produced. So, I just created a monopole. But we all know that monopoles don't exist. Then what is wrong in this procedure? Assuming that I got some kind of power that I can put the magnets together in one place without getting budged by the repulsive forces! |
I have a csv file index.dat with data Year,0-19 years,20-39 years,40-59 years,60-79 years,80-99 years,100 years+ 2000,100,100,100,100,100,100 2001,101,102,101,102,101,102 ... I am trying to plot this with pgfplots. I have made this script \begin{tikzpicture} \begin{axis}[ width=\textwidth, height=0.5\textwidth, grid=both, xmin=2000, xmax=2010, xticklabel style={/pgf/number format/1000 sep=, rotate=45}, ymin=80, ] \addplot table [x=Year, y=0-19 years, col sep=comma] {./data/index.dat}; \addlegendentry{0-19 years} \addplot table [x=Year, y=20-39 years, col sep=comma] {./data/index.dat}; \addlegendentry{20-39 years} \addplot table [x=Year, y=40-59 years, col sep=comma] {./data/index.dat}; \addlegendentry{40-59 years} \addplot table [x=Year, y=60-79 years, col sep=comma] {./data/index.dat}; \addlegendentry{60-79 years} \addplot table [x=Year, y=80-99 years, col sep=comma] {./data/index.dat}; \addlegendentry{80-99 years} \addplot table [x=Year, y=100 years+, col sep=comma] {./data/index.dat}; \addlegendentry{100 years+} \end{axis} \end{tikzpicture} and it works fine, but I think it's a bit stupid way to do it. Can I do the same by just specifying that I want to plot all columns from 2 to 7 and use column 1 as x values? | I like TikZ's capability to traverse multiple variables separated by a slash in the foreach (as in the example below). I am looking for something equivalent in PGFplots? I saw in the documentation that say you can't nest the foreach in PGFplots as you can in TikZ, but that only make this kind of feature more important. Two other small issues: I like the \x notation so that is why I am using \pgfplotsforeachungrouped. Is there a reason why I should be using pgfplotsinvokeforeach instead? Also, what is the correct syntax to be able to use a variable to define the list instead of having the actual list in the code. In the following I'd like to be able to reference \ListWithLabels in the foreach. \documentclass{minimal} \usepackage{pgfplots} \newcommand*{\ListWithLabels}{-2/a, -1/b, 1/c, 2/d} \newcommand*{\ListWithoutLabels}{-2, -1, 1, 2} \begin{document} \begin{tikzpicture} \draw [->][gray, thin](-3,0) -- (3,0) node[blue, right] {$x$}; \draw [->][gray, thin](0,-3) -- (0,3) node[blue, above] {$y$}; %\foreach \x/\l in \ListWithLabels { % works \foreach \x/\l in {-2/a, -1/b, 1/c, 2/d} { \draw [thick, red] (\x,-2pt) -- (\x,2pt) node [red, above] {\l}; } \end{tikzpicture} \begin{tikzpicture} \begin{axis}[ minor tick num=0, axis y line=center, axis x line=middle, xmin=-3, xmax=3, ymin=-3, ymax=3, xlabel=$x$, ylabel=$y$, xtick={0}, xticklabels={} ] %\pgfplotsinvokeforeach{-2, -1, 1, 2}{ % works % \addplot [mark=none,color=red, thin, samples=2] % coordinates{(#1,-0.05) (#1,0.05) }; %} %\pgfplotsforeachungrouped \x in {\ListWithoutLabels}{ % does not work \pgfplotsforeachungrouped \x in {-2, -1, 1, 2}{ % works \addplot [mark=none,color=red, thick, samples=2]% coordinates{ (\x,-0.08) (\x,0.08) }; } %\pgfplotsforeachungrouped \x/\l in {-2/a, -1/b, 1/c, 2/d}{ % does not work % \addplot [mark=none,color=red, thin, samples=2]% % coordinates{ (\x,-0.05) (\x,0.05) } % node [red, below] {\l}; %} \end{axis} \end{tikzpicture} \end{document} Update: I saw post which explains that the macro in TikZ needs to be not be sourrouned by {}. But that does not work for the PGF commands. Here is another related post on |
You can read everywhere about water's extraordinary property of expanding when frozen, thus the reason ice floats on liquid water. What other substances do this? There are claims of mercury, silica, germanium, bismuth, and antimony, but I've had trouble tracking down the data to back these up. | One of the wonderful properties of water (as my high school biology teacher would say) is that in its solid form, it is lighter than its liquid form. This means that when temperatures drop below 0 degrees Celsius, the top layer of water on, say, a lake freezes first. This works out pretty well for any fish or other aquatic creatures living underneath, because the lower layers of water will not freeze. I know that this is an exception to the general rule of solid and liquid states: A given substance, when transformed into its solid state, will generally sink in a container of its liquid state. My question is this: What other substances are exceptions to this rule (if any?). What features do they share with water that are responsible for this? |
I must have generated at least 5 Q-Q plots until now when trying to fit my data into a known distribution but I just noticed something that I could not understand. In the figure shown below, from what I've read from the wiki, X-axis is supposed to read "Negative Binomial Theoretical Quantiles" and Y-axis is supposed to read "Data quantiles". Agreed that this makes perfect sense. But when I looked at the figure, the X and Y axis go beyond 100 but how can there be quantiles beyond 100? What do they mean if they exist? Or is this graph produced by the qqplot of R totally different? Can someone help me understand this? The way I was generating this data was using the following script: library(MASS) # Define the data data <- c(67, 81, 93, 65, 18, 44, 31, 103, 64, 19, 27, 57, 63, 25, 22, 150, 31, 58, 93, 6, 86, 43, 17, 9, 78, 23, 75, 28, 37, 23, 108, 14, 137, 69, 58, 81, 62, 25, 54, 57, 65, 72, 17, 22, 170, 95, 38, 33, 34, 68, 38, 117, 28, 17, 19, 25, 24, 15, 103, 31, 33, 77, 38, 8, 48, 32, 48, 26, 63, 16, 70, 87, 31, 36, 31, 38, 91, 117, 16, 40, 7, 26, 15, 89, 67, 7, 39, 33, 58) # Fit the data to a model params = fitdistr(data, "Negative Binomial") #using the answer from params create a set of theoretical values plot(qnbinom(ppoints(data), size=2.3539444, mu=50.7752809), sort(data)) abline(0,1) | I am working with a small dataset (21 observations) and have the following normal QQ plot in R: Seeing that the plot does not support normality, what could I infer about the underlying distribution? It seems to me that a distribution more skewed to the right would be a better fit, is that right? Also, what other conclusions can we draw from the data? |
I am trying to write the program that will be given a 2d list with coordinates of points on a grid (ex.[[4, 7], [5, 6], [5, 2]]), and will return all points passed during "walking". We can go diagonal. def pole(lista): passed = [] #List with all points passed before = lista[0] #list with coordinates before for i in range(1,len(lista)): first = [list(range(before[0],lista[i][0]))] # Lists that should have all points second = [list(range(before[1],lista[i][1]))] # passed from point to point if(len(first) == 1): #If we do not go diagonal, one list will only have one number here, first = [before[0]*len(second)] # but we need the same number of itmes, if(len(second) == 1): # so we do not get IndexOutOFRange error in next for second = [before[1]*len(first)] #print(first,second) for j in range(len(first)): passed.append([first[j], second[j]]) before = lista[i] return passed We are using the example list as an input. [[4, 7], [5, 6], [5, 2]] The problem is that the output is wrong and I do not know why: [[4, 7], [5, 6]] And the output should be: [[4,7], [5,6], [5,5], [5,4], [5,3], [5,2]] I think it is a problem of range function | I needed to create a list of lists in Python, so I typed the following: my_list = [[1] * 4] * 3 The list looked like this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]] Then I changed one of the innermost values: my_list[0][0] = 5 Now my list looks like this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]] which is not what I wanted or expected. Can someone please explain what's going on, and how to get around it? |
I have just received a bunch of messy data files in CSV (Comma Separated Value) format. I need to do some normal clean up, validation and filtering work on the data set. I will be doing the clean up in Scala (2.11.7). In my search to find a solution for both directions, input parsing and output composing, mostly I found lots of , including one from the "", on the input parsing side. And most of those focused on the terribly erroneous solution "use String.split(",")" to get a CSV line back as a List[String]. And I found almost nothing on the composing output side. What kind of nice simple Scala code snippets exist which can easily do the above described CSV round trip? I'd like to avoid importing an entire library just to pick up these two functions (and using a Java library is not an acceptable option for my business requirements at this time). | Can you recommend a Java library for reading, parsing, validating and mapping rows in a comma separated value (CSV) file to Java value objects (JavaBeans)? |
If particles are waves, then what really is spin? | I often hear about subatomic particles having a property called "spin" but also that it doesn't actually relate to spinning about an axis like you would think. Which particles have spin? What does spin mean if not an actual spinning motion? |
I recently came to know that banana produces antimatter. How does this happen and why doesn't the antimatter annihilate as our Earth has matter. I looked for a relevant answer but could not find it. | I heard that even a banana generates a minute quantity of antimatter. Does any know radioactive nuclear reaction produce antimatter along with alpha, beta and gamma radiation? |
My server (CentOS) recently got hacked by some Crypto Hackers. They encrypted all of my files and asking for ransom to decrypt the files. They kept a message in all folders, which start like this Your personal files are encrypted! Encryption was produced using a unique public key RSA-2048 generated for this computer. To decrypt files you need to obtain the private key. The single copy of the private key, which will allow to decrypt the files, located on a secret server on the Internet. After that, nobody and never will be able to restore files... To obtain the private key for this computer, which will automatically decrypt files, you need to pay 1 bitcoins (~240 USD). Without key, you will never be able to get your original files back... Now they have sent me the decrypt keys and I'm still Could someone please help me how I can recover my files? What are the possible vulnerabilities that they took advantage of? Any other tips/pointers to avoid future threats? Thanks in advance. Edit: They send me a PHP script with the private key, which I should upload to the server and run through a URL. is the decrypt file they sent me. | This is a about Server Security - Responding to Breach Events (Hacking) See Also: Canonical Version I suspect that one or more of my servers is compromised by a hacker, virus, or other mechanism: What are my first steps? When I arrive on site should I disconnect the server, preserve "evidence", are there other initial considerations? How do I go about getting services back online? How do I prevent the same thing from happening immediately again? Are there best practices or methodologies for learning from this incident? If I wanted to put a Incident Response Plan together, where would I start? Should this be part of my Disaster Recovery or Business Continuity Planning? Original Version 2011.01.02 - I'm on my way into work at 9.30 p.m. on a Sunday because our server has been compromised somehow and was resulting in a attack on our provider. The servers access to the Internet has been shut down which means over 5-600 of our clients sites are now down. Now this could be an FTP hack, or some weakness in code somewhere. I'm not sure till I get there. How can I track this down quickly? We're in for a whole lot of litigation if I don't get the server back up ASAP. Any help is appreciated. We are running Open SUSE 11.0. 2011.01.03 - Thanks to everyone for your help. Luckily I WASN'T the only person responsible for this server, just the nearest. We managed to resolve this problem, although it may not apply to many others in a different situation. I'll detail what we did. We unplugged the server from the net. It was performing (attempting to perform) a Denial Of Service attack on another server in Indonesia, and the guilty party was also based there. We firstly tried to identify where on the server this was coming from, considering we have over 500 sites on the server, we expected to be moonlighting for some time. However, with SSH access still, we ran a command to find all files edited or created in the time the attacks started. Luckily, the offending file was created over the winter holidays which meant that not many other files were created on the server at that time. We were then able to identify the offending file which was inside the uploaded images folder within a website. After a short cigarette break we concluded that, due to the files location, it must have been uploaded via a file upload facility that was inadequetly secured. After some googling, we found that there was a security vulnerability that allowed files to be uploaded, within the ZenCart admin panel, for a picture for a record company. (The section that it never really even used), posting this form just uploaded any file, it did not check the extension of the file, and didn't even check to see if the user was logged in. This meant that any files could be uploaded, including a PHP file for the attack. We secured the vulnerability with ZenCart on the infected site, and removed the offending files. The job was done, and I was home for 2 a.m. The Moral - Always apply security patches for ZenCart, or any other CMS system for that matter. As when security updates are released, the whole world is made aware of the vulnerability. - Always do backups, and backup your backups. - Employ or arrange for someone that will be there in times like these. To prevent anyone from relying on a panicy post on Server Fault. |
So I'm trying to prove that every isometry $I:\mathbb{R}^2 \to \mathbb{R}^2$ is bijective. I have already proved that I is injective (which is almost immediate) and I also proved $I$ is continuous (because I thought that might be useful) but I'm having trouble with the proof for surjectivity. | Let $d(x,y)=\sqrt{(x_1-y_1)^2+(x_2-y_2)^2}$ for $x=(x_1,x_2), y=(y_1,y_2)$. A isometry of $\mathbb{R^2}$ is an image $f:\mathbb{R^2}\to\mathbb{R^2}:d(x,y)=d(f(x),f(y))$. Show that every isometry is bijective. I don't know where to start, any hints ? |
Is there an already existing way to display directionality in a path integral? \oint works fine to indicate that you have a path integral, but (at least for the 2D case) directionality is important. Do I have to put my own arrow on the circle or has someone already done that somewhere and I just don't know how to find it? | If you do know, which package do I need to use? Thanks. |
$(a)$ Consider the recurrence relation $a_{n+2}a_n = a^2 _{n+1} + 2$ with $a_1 = a_2 = 1$. $(i)$ Assume that all $a_n$ are integers. Prove that they are all odd and the integers $a_n$ and $a_{n+1}$ are coprime for $n \in \mathbb N$ $(ii)$ Assume that the set $\{a_n , a_{n+1} , a_{n+2}\}$ is pairwise coprime for $n \in \mathbb N$. Prove that all $a_n$ are integers by induction. $(b)$ Consider the recurrence relation $a_{n+2}a_n = a^2_{n+1} + 1$ with $a_1 = 1, a_2 = 2$ and compare this sequence to the Fibonacci numbers. What do you find? Formulate it as a mathematical statement and prove it. | 1.(a) Consider the recurrence relation $a_{n+2}a_n = a^2_{n+1} + 2$ with $a_1 = a_2 = 1$. (i) Assume that all $a_n$ are integers. Prove that they are all odd and the integers $a_n$ and $a_{n+1}$ are coprime for $n \in \mathbb{N}$. (ii) Assume that the set $\left\{ a_n,\ a_{n+1},\ a_{n+2}\right\}$ is pairwise coprime for $n \in \mathbb{N}$. Prove that all $a_n$ are integers by induction. (b) Consider the recurrence relation $a_{n+2}a_n = a^2_{n+1} + 1$ with $a_ 1= 1,\ a_2 = 2$ and compare this sequence to the Fibonacci numbers. What do you find? Formulate it as a mathematical statement and prove it. I have no idea where to start with 1(ai) but with 1(aii) i have started with: Given that $\left\{a_n,\ a_{n+1},\ a_{n+2}\right\}$ is pairwise coprime you get $gcd(a_n,a_{n+1})=1,\ gcd(a_n,a_{n+2})=1,\ gcd(a_{n+1},a_{n+2})=1$ Using the initial terms, you can do base induction on $a_{n+2} = \frac{a^2_{n+1}+2}{a_n}$ to prove whether the next terms will be integers. $a_3 = \frac{1^2+2}{1}$ $a_4 = \frac{3^2+2}{1}$ $a_5 = \frac{11^2+2}{3}$ gives: $a_1=1,\ a_2 = 1,\ a_3 = 3,\ a_4 = 11,\ a_5 = 41$ which are all integers. So the base induction is correct. Now for the inductive step $n=k, k \rightarrow k+1$ $a_{k+3} = \frac{a^2_{k+2}+2}{a_{k+1}}$. I am not sure how to prove this for the inductive step. Also for (b) how do you formulate a mathematical statement and prove it? |
I have 12.04 and I'm looking for a way to store all the currently installed packages names into a file or archive. Not the packages themselves, but the names. Or the package management's state. I'd like to do this in order for the ability to synchronize the installed packages on demand on two computers. The idea would be to save the installed names on computer A, go to computer B, make a diff of the names and uninstall extra packages from B and install the missing ones. For this it would be good if the version could also be saved for each package. Also I'm not sticking to the names if there is something that better suits my scenario, something that the package management can work with as automatic as it can be. Out of preference, I'd like to do it without the use of a sync-server. Looking for file-based solutions. | So I can run on one machine: dpkg --get-selections '*' > selection.txt On another machine: dpkg --set-selections < selection.txt ... followed by either of the following: aptitude install apt-get -u dselect-upgrade ... to install the packages that. However, it appears that some information gets lost in the process, such as whether a package (say xyz) got installed automatically as dependency of another package (abc). You can see that whenever you do something like apt-get --purge remove abc. On the original machine you would be notified that package xyz was installed as dependency of abc and that you may use apt-get autoremove to get rid of it. Now I am aware of deborphan and debfoster, but they're cumbersome to use given the (simple) task at hand. It seems saving and restoring the selections as shown above is not sufficient to restore the subtle dependencies of installed packages. Is there a way to back up the complete set of metadata for package management and restore it then in its entirety? |
I am brand brand brand new to coding. I started with Javascript and thought that Java and Javascript were the same thing. Learned real quick that that is not true. Point to that is: I have been using the Bash terminal to run my Javascripts through NodeJS. I am having trouble doing the same thing with Java. I know have accessed the directory that my java applications are stored (cd /mnt/c/Users...) and installed the java application on bash (sudo...). when I type the command to run a Java application ($ java ) I receive the error: ERROR: Could not find or load main class . Is it even possible to do what I want it to do and if so, what am I missing? | I know that to execute a file, I use the . command, then the file name with a space between them. But I'm trying to execute a .jar file using the . and it does not work. I went into the properties and marked it as executable and made it run with Java. Is there a way to execute a file with Java in the Bash Terminal? I am trying to execute the Minecraft.jar file. |
I am working on a problem in my Algebra homework and I am having some problems. The question is: if $H_1$ and $H_2$ are normal subgroups of $G_1$ and $G_2$ respectively and we know that $G_1$ is isomorphic to $G_2$ and $G_1/H_1$ is isomorphic to $G_2/H_2$, can we conclude from this that $H_1$ is isomorphic to $H_2$? I need to prove that is true or give a counterexample if it is false. My first idea was to use the idea behind the proof of the 1st isomorphism theorem. For this I have considered the inclusion homomorphisms $i_1: H_1 \to G_1$ and $i_2:H_2 \to G_2$, which are injective homomorphisms. These homomorphisms admit left inverses. Then I considered the surjective homomorphisms $f_1: G_1 \to G_1/H_1$ and $f_2: G_2 \to G_2/H_2$ which admit right inverses. And the last the isomorphism $\varphi:G_1/H_1 \to G_2/H_2$ that exists by assumption. Then, we can construct the homomorphism $\psi$ from $H_1$ to $H2$ as $$\psi = i_2^{-1}f_2\varphi f_1^{-1}i_1.$$ But, I dont know if I am tired enough to confuse these things but I think that my beautiful homomorphism takes everybody in $H_1$ to the identity in $H_2$, 'cause if $h \in H_1$, then $i_1(h)=h \in G_1$, then, $f_1^{-1}(h)=hH_1=H_1$, then $\varphi(H_1)=H_2$ and $f_2(H_2)=1$ and $i_2^{-1}(1)=1.$ I don't know if this reasoning can take me somewhere. Can anybody give me a hint to solve this problem? Any hint, any reference, any idea is gonna be welcome for me. Thank you so much, everyone. | I know that given a group $G$ and two normal subgroups $H,K \subset G$ then it is not true that: "if $H \cong K$ then $ \frac{G}{H} \cong \frac{G}{K} $ (the counterexample is quite easy with products of cyclic groups) " My question is: Is the converse true? i.e. Given that $\frac{G}{H} \cong \frac{G}{K}$ then $H \cong K$ ? I feel that the answer is no, but I can't think of an example. |
How to turn off this pop-up PowerShell notification that appears at start-up? When trying to install Photoshop from torrents, I had to disable Windows real time Defender, and the msvcr100.dll file was missing. I got both .dll files from dll-files.com. I incorrectly replaced the msvcp110.dll file, but figured out my mistake soon enough and put back the original file. When installing Photoshop it didn't work, so I replaced both the new .dlls with the original files. Now my computer is asking me to do click yes every time I start my computer up. I would appreciate any answers or just a way to stop me from clicking the Yes button in the PowerShell pop-up all the time. Nksvoo is causing my problems: | What should I do if my Windows computer seems to be infected with a virus or malware? What are the symptoms of an infection? What should I do after noticing an infection? What can I do to get rid of it? how to prevent from infection by malware? This question comes up frequently, and the suggested solutions are usually the same. This community wiki is an attempt to serve as the definitive, most comprehensive answer possible. Feel free to add your contributions via edits. |
All of the windows on my Windows 8 computer have started to lose focus every minute or so and get focus back quickly. Any ideas what this could be? I have tried to see which application is using most CPU when this happens, but to no success. I am running a Norton scan at the minute, so that should sort out any malware. It is starting to get VERY annoying! | Recently all of my applications keep losing focus every minute (or so) for a few seconds (then the window gets the focus back). It is very annoying, since I'm typing most of the time and get interrupted by this behavior. Things worked fine until a week ago and I have no idea what is causing this error, but I noticed the mouse moves to a certain point on one of my screens when this happens. I would appreciate any advice: it starts to drive me crazy... |
I need an sql query to select a value from a table where it doesn't have a certain entry in another table. For example, considering the tables customers and customershop: Customers Id Name 1 Steve 2 John 3 Bob Customershop CustomerId Item 1 Kiwi 1 Apple 2 Kiwi 2 Banana 3 Banana 3 Apple I need a query for mysql so it can return Bob if looking for customers that don't have Kiwi in the customershop table. Any help is greatly appreciated. | I've got the following two tables (in MySQL): Phone_book +----+------+--------------+ | id | name | phone_number | +----+------+--------------+ | 1 | John | 111111111111 | +----+------+--------------+ | 2 | Jane | 222222222222 | +----+------+--------------+ Call +----+------+--------------+ | id | date | phone_number | +----+------+--------------+ | 1 | 0945 | 111111111111 | +----+------+--------------+ | 2 | 0950 | 222222222222 | +----+------+--------------+ | 3 | 1045 | 333333333333 | +----+------+--------------+ How do I find out which calls were made by people whose phone_number is not in the Phone_book? The desired output would be: Call +----+------+--------------+ | id | date | phone_number | +----+------+--------------+ | 3 | 1045 | 333333333333 | +----+------+--------------+ |
This is the result of sudo apt update on my system: Ign:1 http://ppa.launchpad.net/webupd8team/atom/ubuntu focal InRelease Hit:2 http://archive.ubuntu.com/ubuntu focal InRelease Get:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease [111 kB] Get:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease [98.3 kB] Get:5 http://archive.ubuntu.com/ubuntu focal-security InRelease [107 kB] Err:6 http://ppa.launchpad.net/webupd8team/atom/ubuntu focal Release Could not connect to ppa.launchpad.net:80 (2001:67c:1560:8008::15). - connect (101: Network is unreachable) Could not connect to ppa.launchpad.net:80 (91.189.95.83), connection timed out [IP: 91.189.95.83 80] Reading package lists... Done E: The repository 'http://ppa.launchpad.net/webupd8team/atom/ubuntu focal Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. | When updating, I get the following error message: W: The repository 'http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial Release' does not have a Release file. Here, I find another statement on this error: This recommends removing certain PPAs; and, I'm not sure if I should do that since it might mean not getting the updates that I need. Is this what I should do? |
I'm trying to install the (so that I can get and send my Protonmail via Thunderbird) on my new Ubuntu 20.10 install. Unfortunately it states it has unmet dependencies: ttf-dejavu. Anybody got a tip how to correct this? ***@***:~/Downloads$ sudo apt install ./protonmail-bridge_1.4.5-1_amd64.deb [sudo] password for ***: Reading package lists... Done Building dependency tree Reading state information... Done Note, selecting 'protonmail-bridge' instead of './protonmail-bridge_1.4.5-1_amd64.deb' Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies. protonmail-bridge : Depends: ttf-dejavu but it is not installable E: Unable to correct problems, you have held broken packages. | After upgrading from 10.04 to 12.04 I am trying to install different packages. For instance ia32-libs and skype (4.0). When trying to install these, I am getting the 'Unable to correct problems, you have held broken packages' error message. Output of commands: sudo apt-get install -f Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. After running this: sudo dpkg --configure -a foo@foo:~$ sudo apt-get install -f Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. |
I'm using Noesis to export Collada files and then import them into Blender 2.82 but the textures are not loaded at all. Is there a way to force the system to load textures? | I purchased Fuse Character Creator and made a rigged model that I imported into Blender from Fuse. The model is a Collada File and it comes in fine, the model comes rigged and is fully poseable except that the textures aren't applied. I switch to texture view but still nothing. Here's how fuse works, you upload your model to their site, have it autorigged, and then choose the format that you want the model file in. I chose Collada. It then gives you the zip folder with the model and the textures in their own folder named "textures". I don't know what to do from here. The textures are all PNG's. When I exported to as an obj file the model came with the textures applied, but the obj doesn't come rigged. I included a picture of the textures if it helps. |
I was trying to use this code I made to reverse a array. I don't understand why I was getting [I@7a84639c as my output in my console. And for some reason why doesn't this method actually save my reversed array into the array? If i add a print at the bottom of x[i]=c[i]; it shows the array reversed but when i add a call for example karn[0] it shows that my array isn't actually reversed. I want to solve this by staying true to the code i made. import java.util.Arrays; public class HelloWorld { public static void main(String[] args) { int[]karn={1,2,3}; rev(karn); System.out.println(karn.toString()); } public static void rev(int[]x){ int[]c=new int[x.length]; for(int i=x.length-1;i>-1;i--){ c[i]=x[i]; x[i]=c[i]; } } } | In Java, arrays don't override toString(), so if you try to print one directly, you get the className + '@' + the hex of the of the array, as defined by Object.toString(): int[] intArray = new int[] {1, 2, 3, 4, 5}; System.out.println(intArray); // prints something like '[I@3343c8b3' But usually, we'd actually want something more like [1, 2, 3, 4, 5]. What's the simplest way of doing that? Here are some example inputs and outputs: // Array of primitives: int[] intArray = new int[] {1, 2, 3, 4, 5}; //output: [1, 2, 3, 4, 5] // Array of object references: String[] strArray = new String[] {"John", "Mary", "Bob"}; //output: [John, Mary, Bob] |
I've recently got into that "hipster" trend of long shadowing. I have seen this example quite a lot, and have tried replicating it myself. No efforts have been successful though. And even the close ones seemed like to much work for that effect. Main issue i'm having are the middle green triangles, and their shadows down. If you notice they fold over the background circle, which is another issue of mine. How can I replicate this technique as accurately as the image? | I want to make a long shadow just like in this image. I can create this shadow with shapes and by deleting the unwanted shadows after rasterizing the layer. But it's not very reusable. I can't resize the layer after rasterizing it. Is there any easy way to make a long shadow like in the image below? |
I'm looking to cite the source of a definition, but there seems to be a bug. An example of something I'm looking to type: \begin{definition}[\cite[Definition 1.4.2]{Hilbert10}] content \end{definition} It seems that the right bracket after Definition 1.4.2 is interfering with the right bracket after {Hilbert10}. Latex thinks I'm misusing \cite, but it's just not reading the entire line. | I accidentally discovered () that a closing square bracket within an optional argument delimited by [ ] can cause problems. Here is example code illustrating the issue: \documentclass{article} \begin{document} \tableofcontents \section[Square brackets ([ and ])]{Square brackets: [ and ]} % bad: the TOC now has "Square brackets ([ and", and the actual title is a mere ")". Some text. \section[{Square brackets ([ and ])}]{Square brackets: [ and ]} % good (works as originally intended) Some text. \end{document} The text to be used as the optional (as well as the non-optional) argument contains a ], and this character is not supposed to function as the optional argument terminator but as a matching square bracket/parenthesis. Perhaps this is as it should be, but the question is how to best circumvent any potential problems. Enclosing this in a group works, but I don't know whether doing this has other side effects (perhaps not here in the case of \section but hopefully someone else has a better example of where grouping could lead to a problem). There is no (obvious) way other than writing [{ }] because [ and ] are not normally escaped. That [ and ] are normal characters and bear syntactic function (as optional argument delimiters) creates this potentially problematic situation. Is simply enclosing the entire optional argument in a group ({ }) a good solution? Are there other/better ways? |
I'm trying to find the most probable path (i.e. sequence of states) on an HMM using the Viterbi algorithm. However, I don't know the transition and emission matrices, which I need to estimate from the observations (data). To estimate these matrices, which algorithm should I use: the Baum-Welch algorithm or the Viterbi Training algorithm? Why? In case I should use the Viterbi training algorithm, can anyone provide me a good pseudocode (it's not easy to find)? | I am currently using Viterbi training for an image segmentation problem. I wanted to know what the advantages/disadvantages are of using the Baum-Welch algorithm instead of Viterbi training. |
"Solve the following congruence. Make sure that the number you enter is in the range $[0,M−1]$ where $M$ is the modulus of the congruence. If there is more than one solution, enter the answer as a list separated by commas. If there is no answer, enter $N.$" $102x = 220 \pmod{266}$ $x = ?$ So I've tried using Euclidean's algorithm on this nearly 10 times already(no exaggeration) but every time I try getting past the point below the whole thing falls apart and I just end up getting another incorrect answer for x. Would anyone mind showing how to continue on from this point and if there are any methods other than Euclidean's that one can use to calculate such equations, thanks :) $102x = 220\pmod{266}$ $\gcd(102,266) = 2$ $266 = (102 \times 2) + 62$ $102 = (62 \times 1) + 40$ $62 = (40 \times 1) + 22$ $40 = (22 \times 1) + 18$ $22 = (18 \times 1) + 4$ $18 = (4 \times 4) + 2$ $4 = (2 \times 2) + 0$ | What is the best way to solve equations like the following: $9x \equiv 33 \pmod{43}$ The only way I know would be to try all multiples of $43$ and $9$ and compare until I get $33$ for the remainder. Is there a more efficient way ? Help would be greatly appreciated! |
I had a broken installation of mariadb over mysql 5.5. For hours i have tried to reinstall mysql with the usage of apt-get - tried to purge, remove etc everything mysql related. Uninstalled php aswell. Apache got reinstalled too. Every single install was throwing errors during mysql-server configuration. I finally managed to perform a succesfull installation from deb package from website. I ran this after the package was installed: sudo apt-get install mysql-server-5.5 Installtion failure part: Setting up mysql-server-5.5 (5.5.35-0ubuntu0.12.04.2) ... start: Job failed to start invoke-rc.d: initscript mysql, action "start" failed. dpkg: error processing mysql-server-5.5 (--configure): subprocess installed post-installation script returned error exit status 1 No apport report written because MaxReports is reached already dpkg: dependency problems prevent configuration of mysql-server: mysql-server depends on mysql-server-5.5; however: Package mysql-server-5.5 is not configured yet. dpkg: error processing mysql-server (--configure): dependency problems - leaving unconfigured No apport report written because MaxReports is reached already Setting up libmariadbclient18 (10.0.8+maria-1~precise) ... Processing triggers for libc-bin ... ldconfig deferred processing now taking place Errors were encountered while processing: mysql-server-5.5 mysql-server All right, so I ran sudo dpkg --configure mysql-server-5.5 and got Setting up mysql-server-5.5 (5.5.35-0ubuntu0.12.04.2) ... start: Job failed to start invoke-rc.d: initscript mysql, action "start" failed. dpkg: error processing mysql-server-5.5 (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: mysql-server-5.5 If we try to run mysql we get ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) Which guides me back to my.cnf manipulation and mysql reinstallation. Goddamn closed error circle. I have tried every solution related to mysql installation I have found. Really running out of options here, reinstalling and configuring ubuntu would be easier and faster. Any feedback appreciated. EDIT: One notice - why am I prompted for mysql admin password 3 times during an installation? | I have read a number of the posts here and they all state to run the following commands: Apt-get -f remove ** apt-get update apt-get upgrade apt-get -f install ** I have seen these in various order etc, and none are resolving, my issue. No matter what I try I get: apt-get -f install mysql-server Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: mysql-server-5.5 mysql-server-core-5.5 Suggested packages: tinyca mailx The following NEW packages will be installed: mysql-server mysql-server-5.5 mysql-server-core-5.5 0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded. Need to get 0 B/14.9 MB of archives. After this operation, 53.0 MB of additional disk space will be used. Do you want to continue [Y/n]? y Preconfiguring packages ... Selecting previously unselected package mysql-server-core-5.5. (Reading database ... 83134 files and directories currently installed.) Unpacking mysql-server-core-5.5 (from .../mysql-server-core-5.5_5.5.29- 0ubuntu0.12.04.1_amd64.deb) ... Selecting previously unselected package mysql-server-5.5. Unpacking mysql-server-5.5 (from .../mysql-server-5.5_5.5.29-0ubuntu0.12.04.1_amd64.deb) ... Selecting previously unselected package mysql-server. Unpacking mysql-server (from .../mysql-server_5.5.29-0ubuntu0.12.04.1_all.deb) ... Processing triggers for man-db ... Processing triggers for ureadahead ... Setting up mysql-server-5.5 (5.5.29-0ubuntu0.12.04.1) ... Setting up mysql-server-5.5 (5.5.29-0ubuntu0.12.04.1) ... invoke-rc.d: initscript mysql, action "start" failed. invoke-rc.d: initscript mysql, action "start" failed. dpkg: error processing mysql-server-5.5 (--configure): subprocess installed post-installation script returned error exit status 1 dpkg: dependency problems prevent configuration of mysql-server: mysql-server depends on mysql-server-5.5; however: Package mysql-server-5.5 is not configured yet. dpkg: error processing mysql-server (--configure): No apport report written because the error message indicates its a followup error from a No apport report written because the error message indicates its a followup error from a previous failure. Errors were encountered while processing: mysql-server-5.5 mysql-server I have tried several things over the past week and cannot get this to resolve, any assistance would be appreciated. I did notice the message: Package mysql-server-5.5 is not configured yet. and i have yet to get this configured so I am working on that aspect. Any other assistance will be very appreciated. |
If someone could explain to me the first step or two so I could solve this that would be great. All the e's are confusing me Solve the equation. (Round your answer to four decimal places.) $$e^x − 6e^−{^x} − 1 = 0$$ | $$e^x − 6e^{-x} − 1 = 0$$ No idea how to solve this. If someone could show me the first one or two steps to push me in the right direction that would be great. |
I've been developing a WCF Service where clients logon with their guid that they obtain when logging in to the client and the guid gets registered at the WCF Service. But every once in a while... about almost everytime I logon with the same user login. The guid from user 'x' gets re-used.. This is the code: public void Logon(ReceiveClient rc, string name) { try { inst = new InstanceContext(rc); DMSNotificationClient = new DMSCSSendServiceClient(inst); var ci = Guid.NewGuid(); ClientId = ci; LoggedOnSince = DateTime.Now; DMSNotificationClient.Logon(name); ReceiveMsg += OnReceiveMsg; FolderChange += OnFolderChange; } catch (Exception ex) { var dmsEx = new DmsException(ex); DmsException.WriteErrorsToLog(dmsEx); } } After some analyses of my C# Code I'm asking you this question: Can I say that a GUID is NOT unique? | Is a GUID unique 100% of the time? Will it stay unique over multiple threads? |
I was querying data from using a LINQ query in LINQPAD and found that the data I got back is quite obsolete. I searched for Shekhar-Pro (me) by using a where clause on ID 399722 and the data returned was for 8 Jan 2011. Why was the data so old? Isn't the data updated in real time, or at least frequently? If not, where can I get realtime data? | promised that data.SE would "soon" get live data: I realize it's a long weekend, but given that data.SE is now over 2 months out of date, it would be nice if this was finally rolled out. |
Somehow I switched my default selection with Ctrl+B to a rendering window mode. How do I switch it back to default mode so I can actually select objects again? | In the 3d viewport I am using a border region to only render things inside the selected region. I did this with CtrlB. I cannot get rid of the region. How can I make the border disappear? |
Installed a new hard drive on a iMac 2011 27": old drive would not boot (node errors which FSK cannot fix). This faulty drive was running High Sierra before it stopped booting. Removed the old drive and installed in an external powered enclosure. Installed new HDD -- but remote install of OSX limited to Lion (10.7), as Apple remote recovery only reinstalls original OSX imac came with. I cannot find any way to find the recovery partition on the old drive. Tried to update OSX from app store but my account purchase list does not show any OSX (lots of my apps though) Cannot check my Apple App store account settings as "To make changes to your payment information, you need to upgrade your Mac to the latest version of macOS."(Which is what I am trying to do!!) Tried to download El Capitan from the great Apple page set up for this, but on clicking 'Get' it says Paypal will send me a text to confirm the account, but that was over a day ago. Also worked out how to use terminal (fsck_hfs -r /dev/disk1s2) to try to rebuild catalogue on the now connected external enclosure with old drive. Says it can't be verified after executing command. My question: So how can I upgrade OS, when I can't access app store or Apple App store account, or find the recovery partition on what is now the external drive, and I can't get a CD with OS? Even if I could find the recovery partition, I cant see any information on how to use apart from starting the external disk in target disk mode perhaps? (which will not work as it won't boot) Running out of options...thank you good folk in advance. The best thing I can think of is to fond some way to copy the recovery partition from the old drive to the new drive (as I can read the old disk), but where is the partition? Stefan Melbourne Australia | I want to install a new Solid State Drive (SSD) into the Mac. Can I just build in the SSD, start the MacBook in Recovery Mode and install OS X from there on? After reading a lot on the internet I still have some doubts… My HDD crashed, I can't repair it using disk utility or the fsck methods as mentioned on the internet. According to it should be possible. I know how to replace the HDD with the SSD. I would go for the Samsung 850 EVO SSD - 500GB. My Mac is a MacBook Pro Mid 2012, model A1278. |
I've just downloaded ubuntu and transferred it to a memory stick. I pressed restart as per guide and the computer restarted -- in Windows10. It seems like an impasse. Can anyone advise? | I'm absolutely new to Linux. I would like to know how to install Ubuntu alongside the pre-installed Windows 8+ OS. Should I do it with Wubi, or through the Live USB/DVD? What steps do I need to take to correctly install Ubuntu? |
EDIT: tl;dr; How to turn off Snap Assist (that is the word I was looking for) Since Windows 10 there is this annoying behaviour from which I cant find the name off. Previously, when I press the Windows-key + (left or right), one and only one window would move to the designated position. When I do this now, all other windows that I have will move to the opposite site and I need to select one of them in order to continue. I don't want to have this effect anymore, but I don't know how this procedure is called. Can anyone here help me? Below you can see what I was trying to explain. Hope this helps | Okay, whenever I want to tile a window on the right I hit Win+→, and I tile my window. And I'm fine with that, that's what I want. However Windows always wants me to tile another window on the left, and minimizes the rest of the windows that are open for me to choose one. I'd like help to disable this second part of the process of tiling. That is, I'd like to tile my window and have it tiled and continue with my workflow. Instead of always having to cancel the choosing of the second window to tile. This is a minor issue that I can go around every time. The reason I'm asking for help is that I do this so many times in the day, that it somehow became a little annoying. |
I am trying to solve $2^x = 4x$. Have taken logs on both sides, represented as an exponent and haven't got it close to the form from which I could find a solution. | Given that $x$ is a positive integer. By using methods of trial and error as well as plotting two lines: $y=2^x$, $y=4x$ on a graph and find their intersection point, we can easily solve for $x$ which is equal to 4. However, I do not know how to solve this using only equation. Can anyone help me? |
The title speaks for itself. We will be doing research on software documentation, part of this research consists of a survey targeted at software developers. We would like to reach the developer community of Stack Overflow with our survey but we are not sure if asking the developers to complete the survey is against the guidelines. Does anyone here have something helpful to say about this? | Is it OK to post a questionnaire on Stack Exchange sites? I'm currently working on a project at my uni and need some empirical information about workouts. I want to explain more about the project, but that will come if it's "legal" to post a questionnaire here. |
After listening of some of Leonard Susskind about black holes, he mentioned that conservation of information is one of the foundations of physics. After searching the web I cannot seem to find how we came up with this theory. Could someone explain how we know this is true and/or how did we come to this conclusion? | I really can't understand what Leonard Susskind means when he says in the video that information is indestructible. Is that information that is lost, through the increase of entropy really recoverable? He himself said that entropy is hidden information. Then, although the information hidden has measurable effects, I think information lost in an irreversible process cannot be retrieved. However, Susskind's claim is quite the opposite. How does one understand the loss of information by an entropy increasing process, and its connection to the statement “information is indestructible”. Black hole physics can be used in answers, but, as he proposes a general law of physics, I would prefer an answer not involving black holes. |
Is there a specific reason that the number of views is not included as a feature on the mobile version? I understand there are certain features which are better to be viewed on desktop rather than on a mobile device. However, the number of views for a question, which is shown along with the topic title on left on the desktop browser shouldn't be much resource consuming to be displayed on the mobile browsers too. Is it specific to the desktop/mobile browser or is it a feature which is not at all included for mobile browsers. I am only talking about mobile version and not the mobile application. | I often use Stack Exchange sites from my smartphone. It works great, but I always have to switch to full version to see view counts of a question. Can you please add it? There's plenty of space on question page for it to place. I request community to suggest a location. |
I am currently visiting the USA from the UK (I am a UK citizen) and am intending on staying here for the full 90 days under the Visa Waiver Program. How long would I have to stay out of the US at the end of this period before returning again? Would I have to return to the UK, or could I stay with friends in another country (such as Canada) for a while? | I entered the USA on a three month visa waiver program from Australia. I am about to return to Australia and would like to come back again to the USA. How long do I have to wait until I can re-enter the USA for another 3 months? |
I've read all answers and comments here: but still not clear about the answer. Can someone please elaborate why the following equation means model is well calibrated? The two sides of above equation are sum of products. I don't quite understand why we can take off the equation and have Thank you very much! | I understand that one of the reason logistic regression is frequently used for predicting click-through-rates on the web is that it produces well-calibrated models. Is there a good mathematical explanation for this? |
I am very new to java, and this seems very simple, perhaps I am missing something. Below is a little bit of my code, what it should do is have the user enter the a password, which is stored in userinput, unfortunately if I type admin which I have it set to == "admin" it will not work, even if I do all caps or all lowercase like I have it. I even tried pre-setting a variable such as String password = "admin"; and having it set to be if (userinput == password) but that did not seem to work either. Please help! } public void protect(){ Scanner input = new Scanner(System.in); System.out.println("Enter password: "); String userinput = input.nextLine(); if (userinput == "admin"){ System.out.println("Correct!"); } else if (userinput != "admin"){ System.out.println("Wrong!"); } } } Quick summary, no matter what password I type, even if it is "admin" it goes right to wrong. | I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug. Is == bad? When should it and should it not be used? What's the difference? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.