body1
stringlengths 20
4.1k
| body2
stringlengths 23
4.09k
|
---|---|
I need to vertically centre the ion-menu contents so that it is easier to access from a UX perspective. I am not sure of the best way to do it. This is the code, which was set up by ionic start myProjectName sidemenu. <ion-content> <ion-card class="welcome-card"> <ion-img src="/assets/shapes.svg"></ion-img> <ion-card-header> <ion-card-subtitle>Get Started</ion-card-subtitle> <ion-card-title>Welcome to Ionic</ion-card-title> </ion-card-header> <ion-card-content> <p>Now that your app has been created, you'll want to start building out features and components. Check out some of the resources below for next steps.</p> </ion-card-content> </ion-card> <ion-list lines="none"> <ion-list-header> <ion-label>Resources</ion-label> </ion-list-header> <ion-item href="https://ionicframework.com/docs/"> <ion-icon slot="start" color="medium" name="book"></ion-icon> <ion-label>Ionic Documentation</ion-label> </ion-item> <ion-item href="https://ionicframework.com/docs/building/scaffolding"> <ion-icon slot="start" color="medium" name="build"></ion-icon> <ion-label>Scaffold Out Your App</ion-label> </ion-item> <ion-item href="https://ionicframework.com/docs/layout/structure"> <ion-icon slot="start" color="medium" name="grid"></ion-icon> <ion-label>Change Your App Layout</ion-label> </ion-item> <ion-item href="https://ionicframework.com/docs/theming/basics"> <ion-icon slot="start" color="medium" name="color-fill"></ion-icon> <ion-label>Theme Your App</ion-label> </ion-item> </ion-list> </ion-content> So I am trying to do something like below. Edit: Ionic component directives already use flex. I'm seeking a solution specific (preserving the responsiveness) to Ionic 4 where an ion-menu is nested in an ion-list inside an ion-content directive. None of the answers provided in the SO links is applicable to my question. | I want to center a div vertically with CSS. I don't want tables or JavaScript, but only pure CSS. I found some solutions, but all of them are missing Internet Explorer 6 support. <body> <div>Div to be aligned vertically</div> </body> How can I center a div vertically in all major browsers, including Internet Explorer 6? |
#include <iostream> using namespace std; int main () { string a; cin >> a; int b=10; cout << a+b; return 0; } I have a problem with the code above. I know it's wrong, but it shows my point. I'm wondering if I get a number as a string, how can I have it as an integer? For example, I give 12 to the program after running. So a will be "12". Now I want the summation of 12 and the variable b. What should I do? How can I extract 12 as an integer from my string? | What's the C++ way of parsing a string (given as char *) into an int? Robust and clear error handling is a plus (instead of ). |
I started receiving the following error on a WordPress site: Warning: Declaration of SplitMenuWalker::walk($elements, $max_depth) should be compatible with Walker::walk($elements, $max_depth, ...$args) in /home/relati67/public_html/wp-content/themes/mentis/inc/mega-menu/split-menu.php on line 0 I have no idea what to do here. I found a thread with something similar, but the error pointed to a specific line (not line 0) and wasn't the exact same error. I'm new to Stack Exchange -- thanks in advance for any help! | I'm currently working on a WordPress site and whenever in the admin I go the Appearance > Menus page I get the following error: ErrorException: Runtime Notice: Declaration of Walker_Nav_Menu_Edit::start_lvl() should be compatible with that of Walker_Nav_Menu::start_lvl() in wp-admin/includes/nav-menu.php line 203 It seems like some sort of PHP compatibility issue. I'm running PHP 5.3.10 on my local dev machine. What would be the best way to remedy this problem? |
I have a question about botulism when canning pickles. I realize that most canning recipes use 1:1 vinigar to water ratio for canning pickles. I accidently used 1:4 vinigar to water ratio for canning pickles. Now i am wondering if I will get botulism and if so can i re-use the jars or do i have to throw the jars out? if i can re use the jars then what is the best way to clean and steralize them? | If a home canned jar has botulinum in it can the jar be cleaned and saved? If so what is the correct way to clean the jar? |
Windows XP's Search Companion seems to be a lot more powerful than searching in Windows 7. Particularly, I want to be able to search for filenames matching some pattern, containing a particular word. For instance, how do I find files with the extension "sql" containing the word "view_customer"? | In Windows XP we can search for files that contain a defined keyword (inside all files types). Windows 7 can look inside files for a keyword, but only for text files. (*.doc, *.txt, *.inf, ...), not (*.conf, *.dat, *.*, ...). don't contain any filter I can use for this. How is this possible? |
I have a "sSamples" table which contains UniqueID, sDate and sID-s like: I need the SID-s by the latest sDate and grouped by UniqueID. Result should look like: UniqueID | SID --------------------- 031311579 | 11641325 053600109 | 11641353 066051428 | 11641379 093468114 | 11641350 I tried with different query versions but the perfomance was very slow. What is the best solution for this? Thanks for the answers! | Table: UserId, Value, Date. I want to get the UserId, Value for the max(Date) for each UserId. That is, the Value for each UserId that has the latest date. Is there a way to do this simply in SQL? (Preferably Oracle) Update: Apologies for any ambiguity: I need to get ALL the UserIds. But for each UserId, only that row where that user has the latest date. |
I guess it is kind of obvious that it diverges. But what divergent series do I compare it to? | Sorry for the oversimplified question, but does the series $\sum_{n=1}^{\infty} \frac{1}{n+1}$ converge? The ratio test of it gives the result of "1". Thanks a lot. |
I have bought a new PC with Windows 10. Is it possible migrate all data and programs from my old laptop to new one? Thanks | I know about the Easy Transfer tool included in Windows 7 that will transfer all my files but I want to transfer my programs. Also, I don't want to buy any gimmicky program if I don't have to. |
I have an object with multiple materials. All these materials have their own textures and their UV maps overlaps. How can I bake without editing textures and not overlapping textures? | I have a finished model where the UV maps overlap - lots of wood that isn't detailed to be particular to the model. I'd like to re-map the texture so that specific details can be added. I'd like to rebuild the UV map into non-overlapping islands, without losing the current texture application, and preferably without manually pulling apart the islands. Is this possible? |
I have the following c program, and some of the times I run it, the output differs, based on the compiler and the platform. I understand that double to int conversion could cause problems. Here is the code: //Compiler version gcc 6.3.0 #include <stdio.h> #include <math.h> int main(void){ double d = 2; printf("%.20lf\n", pow(10, d)); printf("%d\n", (int)pow(10, d)); printf("%d\n", (int)pow(10, 2)); } 100 is the expected value, but the statement printf("%d\n", (int)pow(10, d)); has 99 as output when I use both gcc 6.3.0 and Windows 10 x64, but not in other cases. Here are some results: //gcc 6.3.0 (Sublime Text 3) in Windows 10 x64 100.00000000000000000000 99 ->this is the problem 100 //gcc 6.3.0 in Android (using Dcoder app) 100.00000000000000000000 100 100 //MSVC(VS 2017 x86) in Windows 10 x64 100.00000000000000000000 100 100 I also tested some online gcc(6.3.0) compilers but all the outputs were 100. Thanks for the help. | Consider the following code: 0.1 + 0.2 == 0.3 -> false 0.1 + 0.2 -> 0.30000000000000004 Why do these inaccuracies happen? |
I have to study the character of this series $$\sum_{n=1}^\infty \frac{1}{n^{\alpha}(\log n)^{\beta}}.$$ $\alpha$ and $\beta$ are two parameters. I'm considering the case $\alpha >1 $ and all real values for $\beta $ . If $\beta \ge 0$, $\exists n_0 \in N $ such that $\forall n\ge n_0, \dfrac{1}{n^ {\alpha}(\log n)^ {\beta}}<\dfrac{1}{n^ {\alpha}}$. For the comparison test $\dfrac{1}{n^{\alpha} (\log n)^ {\beta}}$ converges. I tried to analyze the case $-1<\beta<0,\beta=-1, \beta<-1$ but I'm not sure. Anyway, for $\beta<-1$ the series is convergent for $\alpha > 1- \beta$, divergent for $\alpha < 1- \beta$. For $-1<\beta<0$ the series is convergent for $\alpha > 2$, divergent for $\alpha <2$. For $\beta=-1$ the series is convergent for $\alpha > 2$, divergent for $1<\alpha < 2$. I've used the fact that $\log n<n$ | Study the convergence of $$\sum_{n=2}^{\infty} \frac{1}{n^{\alpha}\ln^{\beta}(n)}$$ where $\alpha, \beta \in \mathbb{R}$ I have proved that: This series diverges when $\alpha \leq 0$. This series converges when $\alpha > 1, \beta > 0$ This series diverges when $0 < \alpha < 1, \beta > 0$ This series converges when $\alpha = 1, \beta > 1$ Question: What happens when $\alpha > 0$ and $ \beta < 0$? There are other questions on MSE which ask about this series, but this question is distinct because I would like an argument which does not rely on the integral test for series convergence, and this question considers all real $\alpha$ and $\beta$, while other questions ask only about $\alpha, \beta > 0$, where we can apply Cauchy condensation criterion |
Suppose we randomly draw a real number from $[0, 1]$ for $n$ times, and get an array: $a_1, a_2, ..., a_n$. If for some integer $i$ such that $2<=i<=n-1$ and $a_{i-1}<a_i$ and $a_i>a_{i+1}$, we call $a_i$ a peak in the array. The question is: what is the expected number of peaks in the array $a_1, a_2, ..., a_n$? For example, in array $[0.6,0.3,0.7,0.4,0.9,0.8]$, there are $2$ peaks: $0.7$ and $0.9$. | Recently I came across this question: Given a random permutation of integers 1, 2, 3, …, n with a discrete, uniform distribution, find the expected number of local maxima. (A number is a local maxima if it is greater than the number before and after it.) For example, if n=4 and our permutation was 1, 4, 2, 3, then the # of local maxima would be 2 (both 4 and 3 are maxima). I know the answer will be (n+1)/3 .I wanted to know what will be the answer when we have to consider the local maxima as well as the local minima i.e Finding out the expected number of local maxima and local minima. |
In LOOCV, in general, the model has to be fit n times (n being the number of observations). The test error is then estimated as a mean of all the individual test errors. Hastie and Tibshirani mention in section 5.1.2 of their that with least squares linear or polynomial regression, the cost of LOOCV reduces to that of a single model fit, given by $CV_{(n)} = \frac{1}{n}\sum_{i=1}^n (\frac{y_i - \hat{y_i}}{1 - h_i})^2$ where $\hat{y_i}$ is the $i$th fitted value from the original least squares fit, and $h_i$ is the leverage statistic. Could you please explain how this result can be proved? Even after getting the estimate for the test error, how is the model chosen? | From An Introduction to Statistical Learning by James et al., the leave-one-out cross-validation (LOOCV) estimate is defined by $$\text{CV}_{(n)} = \dfrac{1}{n}\sum\limits_{i=1}^{n}\text{MSE}_i$$ where $\text{MSE}_i = (y_i-\hat{y}_i)^2$. Without proof, equation (5.2) states that for a least-squares or polynomial regression (whether this applies to regression on just one variable is unknown to me), $$\text{CV}_{(n)} = \dfrac{1}{n}\sum\limits_{i=1}^{n}\left(\dfrac{y_i - \hat{y}_i}{1-h_i}\right)^2$$ where "$\hat{y}_i$ is the $i$th fitted value from the original least squares fit (no idea what this means, by the way, does it mean from using all of the points in the data set?) and $h_i$ is the leverage" which is defined by $$h_i = \dfrac{1}{n}+\dfrac{(x_i - \bar{x})^2}{\sum\limits_{j=1}^{n}(x_j - \bar{x})^2}\text{.}$$ How does one prove this? My attempt: one could start by noticing that $$\hat{y}_i = \beta_0 + \sum\limits_{i=1}^{k}\beta_k X_k + \text{some polynomial terms of degree }\geq 2$$ but apart from this (and if I recall, that formula for $h_i$ is only true for simple linear regression...), I'm not sure how to proceed from here. |
I am trying to figure out how the top answerers score is calculated for a given tag. I saw the post below, but when I checked my own score It has a value of 2, but I have 3 Up Votes and No Down Votes. Are the scores only updated periodically? | How often is my total score for a particular tag calculated. I've gotten several recent upvotes under android but my total score hasn't seem to have gone up. When I say total score, I mean like the total score displayed on this . |
I have a proposition which says that an ideal $I$ is a prime ideal in $R$ iff its quotient ring $R/I$ is a domain. I know that for an ideal to be a prime ideal, $xy\in I\implies x\in I\lor y\in I$. My thought is this: $x\notin \langle x^2-x\rangle$ and $x-1\notin \langle x^2-x\rangle$, but $x(x-1)=x^2-x\in \langle x^2-x\rangle$, so $\mathbb{Q}[x]/\langle x^2-x\rangle$ is not a domain. Am I thinking this right? | So I know that for it to be an integral domain it has to have the following properties: Commutative Has multiplicative identity No Zero-Divisors and if $p(x)$ is reducible it can be written as $p(x) = (x-a)q(x)$ but I can't seem to link it together to prove that it violates one of the three properties. |
Objective: given the file, determine whether it is of a given type (XML, JSON, Properties etc) Consider the case of XML - Up until we ran into this issue, the following sample approach worked fine: try { saxReader.read(f); } catch (DocumentException e) { logger.warn(" - File is not XML: " + e.getMessage()); return false; } return true; As expected, when XML is well formed, the test would pass and method would return true. If something bad happens and file can't be parsed, false will be returned. This breaks however when we deal with a malformed XML (still XML though) file. I'd rather not rely on .xml extension (fails all the time), looking for <?xml version="1.0" encoding="UTF-8"?> string inside the file etc. Is there another way this can be handled? What would you have to see inside the file to "suspect it may be XML though DocumentException was caught". This is needed for parsing purposes. | How do you get a Media Type (MIME type) from a file using Java? So far I've tried JMimeMagic & Mime-Util. The first gave me memory exceptions, the second doesn't close its streams properly. How would you probe the file to determine its actual type (not merely based on the extension)? |
I have searched the internet for the definition of mass when looking up about the difference mass vs inertia. There are two definitions of mass the I see: "Mass is the quantity of matter in an object," and "It is the measure of an object's resistance to acceleration." Which of these definitions is the correct? Or are they both correct and mean the same thing? | I have learned in my physics classes about five different types of and I am confused about the differences between them. What's the difference between the five masses: inertial mass, gravitational mass, rest mass, invariant mass, relativistic mass? |
I have this query =QUERY( 'Monitor'!$A$4:$AB, "select * WHERE " & IF(C2="Yes","A=1 ",IF(C2="No","A=0 ","(A=0 OR A=1) ")) & "AND " & IF(ISBLANK(C3),,"D="&C3&" ") & "AND "& IF(ISBLANK(C4),"B IS NOT NULL ", "B="&C4&" ") & "AND " & IF(ISBLANK(C5),"F IS NOT NULL ","F> "&C5&" ") ) The last part refers to dates where C5 = Date in format YYYY/MM/DD F = Column with dates in same format I want to get only the rows where the date is larger than that of cell C5. I don't get an error back, I just get an empty range. I've checked if the other filters could be the reason but they're not. Couldn't find answer here and do not want to use FILTER. Any ideas? | I'm trying to create two cells that will update my query: A >= date"A1" and A <= date "B1". My goal is to create a search page for the data, where the end user could insert a date or the =today() function and it would update the query. I am currently getting a formula parse error from: =QUERY(Data!6:1397,"SELECT A,B,C,D,E,F,G,H,I,J,K,L WHERE A >= date"A1"and A <= date"B1"") |
I am trying to install nautilus-gksu in Ubuntu 14.04 LTS by sudo apt-get install nautilus-gksu but I am having the following error. Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package nautilus-gksu I also tried but It did not work. Is there a way to install it. | I heard about nautilus-gksu and would like to install it. Unfortunately, when I try, I get this: glemi@XPS:~$ sudo apt-get install nautilus-gksu Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package nautilus-gksu How and where can I get this package? |
The actual capacity of the USB device is 8GB, but after using it as a live-usb device the available memory has reduced to 31MB. I tried formatting the device but that does not solve the problem. Any ideas? | I have a Sandisk Cruzer 16GB USB flash drive, but it started to show up as 16MB. And I can't use it, it tells me that I need to format the drive or Please insert a disk into drive X. What software do I need to check the flash drive? I can't format it since the format fails, and it shows as 16MB instead of 16GB. |
Okay, so I even printed out the values of the variables that will be compared to the username and password. Username luke Password: password Username Attempt: luke Password Attempt: [C@5e15c325 But I'm attempting to input 'password'.... The JPasswordField holds a character array, so I have to use the 'toCharArray' when comparing the char [] 'passwordAttempt' and the String 'pass' that holds the password that is held in a file. Maybe this is why the password attempt is some strange value? Here's the code of the login() function: public void login() { //booleans for error-handling and user authentication boolean usersInDatabase = true; boolean userAuthentication = false; boolean passwordAuthentication = false; //create the data reader try { reader = new Scanner(user1); //user1 is a file } catch (FileNotFoundException noUsers) { JOptionPane.showMessageDialog(window, "No users in the database"); usersInDatabase = false; } //variables String user = ""; //variables that will hold the file data which has the String pass = ""; //username and password try { user = reader.nextLine(); pass = reader.nextLine(); } //you can skip through the error-handling catch (NoSuchElementException noUsers) { JOptionPane.showMessageDialog(window, "No users in the database"); usersInDatabase = false; } if (usersInDatabase) { String userAttempt = usernameField.getText(); String message = ""; //message to display if authentication is unsuccessful char[] passwordAttempt = passwordField.getPassword(); //okay -- important stuff //username authentication if (userAttempt == user) { userAuthentication = true; } else message += "Incorrect Username -- "; //password authentication if (passwordAttempt == pass.toCharArray()) { //check to see if the input matches the string (a character array) that has the value of the file passwordAuthentication = true; } else message += "Incorrect Password"; if (passwordAuthentication == true && userAuthentication == true) { JOptionPane.showMessageDialog(window, "Authorization Successful"); cards.show(cardPanel, "documents"); } else if(passwordAuthentication == false && userAuthentication == false) JOptionPane.showMessageDialog(window, message); //to print out the values for debugging System.out.println("Username " + user + "\nPassword: " + pass + "\nUsername Attempt: " + userAttempt + "\nPassword Attempt: " + passwordAttempt); } } | 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? |
Is there any difference in declaring array argument in java like: public void method(Type[] arg) { ... } and in that way: public void method(Type arg[]) { ... } Just curiosity... | I have recently been thinking about the difference between the two ways of defining an array: int[] array int array[] Is there a difference? |
What is $$\int_0^\infty e^{-t}\log tdt?$$ Plugging into yields that it's $-\gamma$, where $\gamma$ is Euler's constant. How can we get it? Maybe by some contour integration? | I'm trying to show that $$\lim_{n \to \infty} \left[\sum_{k=1}^{n} \frac{1}{k} - \log n\right] = -\int_0^{\infty} e^{-t} \log t \,dt.$$ In other words, I'm trying to show that the above definitions of the Euler-Mascheroni constant $\gamma$ are equivalent. In another post here (which I can't seem to find now) someone noted that $$\int_0^{\infty} e^{-t} \log t \,dt = \left.\frac{d}{dx} \int_0^{\infty} t^x e^{-t} \,dt \right|_{x=0} = \Gamma'(1) = \psi(1),$$ where $\psi$ is the digamma function. This may be a good place to start on the right-hand side. For the left-hand side I was tempted to represent the terms with integrals. It is not hard to show that $$\sum_{k=1}^{n} \frac{1}{k} = \int_0^1 \frac{1-x^n}{1-x} \,dx,$$ but I'm not sure this gets us anywhere. Any help would be greatly appreciated. |
How many particles are in the entire (rather than just the observable) universe? I would guess that if the universe is open, or infinite, then there is a countable infinity of particles. But if the universe is closed, or finite, then there is only a finite number of particles. Is this correct? Or could a finite universe have a countable infinity of particles or an infinite universe an uncountable infinity of particles. | It is often quoted that the number of atoms in the universe is 10$^{70}$ or 10$^{80}$. How do scientists determine this number? And how accurate is it (how strong is the supporting evidences for it)? Is it more likely (logically >50% chance) that the numbers are right, or is it more likely that the numbers are wrong? |
My exercise for a quantum optics course tells me to "find a normal ordering" for an Operator $\hat{O}(\hat{a},\hat{a}^\dagger)$, which is given as a (rather complicated) string of $\hat{a}$'s and $\hat{a}^\dagger$'s in random order. To me, it is not clear, whether the tasks wants me to apply the normal ordering operator $:\ :$, which acting on an operator simply pulls all daggers to the right while neglecting the commutator rule or whether to use the proper commutation to create a normally ordered expression. But that is not directly the question. When I open a textbook or my lecture note, when it is time to introduce the $P$, $Q$ and $W$ functions, they normally start by looking at some operator $\hat{O}$, then defining $:\hat{O}: = \hat{O}^{(N)}$. For example $:\hat{n}^2:= \left(\hat{a}^\dagger\right)^2\hat{a}^2$. Then an expectation value is calculated: $$\left\langle:\hat{n}^2:\right\rangle = \int d^2\alpha\ P(\alpha)\left|\alpha\right|^4$$ My problem is, that I don't see why one would use the normal ordering operator, because clearly the normally ordered operator is different from the unordered operator and will have a different expectation value. And to extend that question: Can I calculate the expectation value for any normally ordered operator using the $P$ function? If I wanted the expectation value for $\hat{n}^2$ instead of $\left\langle:\hat{n}^2:\right\rangle$, would I have to bring the operator into normal order using the commutator relation? | According to the commutation relation of annihilation and creation operators, $$[a,a^{\dagger}]=1. \tag{1}$$ I would like to calculate the vacuum expectation value of the normal order of this commutator. We claim that since this commutator is just a c-number, then there is no effect from the normal ordering. We therefore get $$\langle 0|(:[a,a ^\dagger]:)|0 \rangle=1. \tag{2}$$ However, if we expand the commutator first and do normal order later, we will get something like $$\langle0|(:[a,a^\dagger]:)|0\rangle=\langle0|(:aa^\dagger-a^\dagger a:)|0\rangle=\langle0|(a^\dagger a-a^\dagger a)|0\rangle=0.\tag{3}$$ Which is contradicting with itself. |
I have lot of confusion regarding TeX and LaTeX. What I have understood is TeX is basically macro instructions, and LaTeX uses that macros or we can say TeX is extended to LaTeX. But, really not very clear. Can I get a simple def of TeX and a example of TeX? Is the TeX program executed in a same way like LaTeX? That is creating .tex file and then converting into .dvi and pdf? | I know LaTeX and I've heard that LaTeX is a set of macros in TeX. But what does it exactly mean? |
Getting Null Pointer Exception in my addMarking method. I'm new to buffered images so I'm not completely sure what the problem is. I have a seperate class that breaks an image up into 3x3 arrays and calls findEnds() with it. When findEnds find the correct condition in the 3x3 array it calls addMarking with the coordinates to make a red dot on the picture. Note: Previously I tried using a 2dGraphic to write the picture on the bufferedImage but took it out in an attempt to fix this problem and copy the pixels manually with setRGB (haven't written this method yet). Note: The reason I can't just make the buffered image with the original file is that the file has a black and white color type not TYPE_INT_RGB. Error: Exception in thread "main" java.lang.NullPointerException at findFeatures.addMarking(findFeatures.java:43) at getImage.getColor(getImage.java:44) at fingerprintDriver.main(fingerprintDriver.java:15) The getImage is a class that breaks the photo into 3x3 arrays, it also returns the coordinates of requested arrays to the addMarking class. fingerprintDriver: /** * Driver for the ElevationScanner Class * * @author benjamincole * @version 4/23/18 */ public class fingerprintDriver { public static void main(String[] args) { String fileName = JOptionPane.showInputDialog("Please enter a name for the file"); getImage test = new getImage(fileName); findFeatures find = new findFeatures(); find.imageConstructor(); test.getColor(); } } findFeatures class: /** * This class tests a 3x3 array. The method findEnds tests this array for * two black pixels. If this condition is found it is an end and the x * and y-coords are marked. * * @author benjamincole * */ public class findFeatures { BufferedImage markedImage; int counter; public void imageConstructor() { // creates image to add markings to markedImage = new BufferedImage(getImage.width, getImage.height, BufferedImage.TYPE_INT_RGB); } public void findEnds(boolean[][] colorArray) { // finds the ends of arches counter = 0; System.out.println(); for (int x = 0; x < 3; x++) { System.out.println(); for (int y = 0; y < 3; y++) { System.out.print(" " + colorArray[x][y]); if (colorArray[x][y]) counter++; } } if (counter == 2 || counter == 1) { // if only 2 or less pixels are // black in the 3x3 System.out.println(getImage.xCord + " " + getImage.yCord); System.out.println(" end found"); // end has been found addMarking(getImage.getXCord(), getImage.getYCord(), Color.red.getRGB()); } } public void addMarking(int x, int y, int rgb) { // adds red `marking to image` markedImage.setRGB(x, y, rgb); //ERROR HERE! (Null Pointer) markedImage.setRGB(x + 1, y + 1, rgb); markedImage.setRGB(x + 2, y + 2, rgb); markedImage.setRGB(x, y + 2, rgb); markedImage.setRGB(x + 2, y, rgb); } | What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely? |
My current code is: for i in range(len(phoneList)): print("|{}|{}|{}|{}|".format(formattedPhoneList[i],namesList[i],number[i], lastDue[i])) if float(lastDue[i]) > 850: print("**") elif float(lastDue[i]) < 850 and int(number[i]) > 350: print("++") else: continue Desired Output would be: |Index[0] of formattedPhoneList|Name Index[0]|384|$ 976.97|** |Index[1] of formattedPhoneList|Name Index[1]|132|$ 188.81| |Index[2] of formattedPhoneList|Name Index[2]|363|$ 827.48|++ Current Output: |Index[0] of formattedPhoneList|Name Index[0]|384|$ 976.97| ** |Index[1] of formattedPhoneList|Name Index[1]|132|$ 188.81| |Index[2] of formattedPhoneList|Name Index[2]|363|$ 827.48| ++ I have tried inserting a trailing comma and import stdout with no success. Is there another way to format this? Thank you for reading. | I'd like to do it in Python. What I'd like to do in this example in C: #include <stdio.h> int main() { int i; for (i=0; i<10; i++) printf("."); return 0; } Output: .......... In Python: >>> for i in range(10): print('.') . . . . . . . . . . >>> print('.', '.', '.', '.', '.', '.', '.', '.', '.', '.') . . . . . . . . . . In Python print will add a \n or space, how can I avoid that? Now, it's just an example, don't tell me I can first build a string then print it. I'd like to know how to "append" strings to stdout. |
I need to replace all '%' characters in string with "%25" but I don't want to replace % in %25 to avoid situation, when I get something like this %%25. I want to do it in Java. Example: input: % sdfsdaf %25 expected result: %25 sdfsdaf %25 Do you know what should I use to get it? | I don't really understand regular expressions. Can you explain them to me in an easy-to-follow manner? If there are any online tools or books, could you also link to them? |
Can someone please explain in what cases the following syntax can be used and how does this work? (function($) { $.fn.hoverIntent = function(f,g) { }; })(jQuery); Thanks! | In javascript, when would you want to use this: (function(){ //Bunch of code... })(); over this: //Bunch of code... |
$$\int_0^\infty {(\ln x)^2 \over {1+x^2}} dx$$ I need to evaluate the above integral using to obtain the answer $\dfrac{\pi^3}8$: However the only example involving rectangular contours I've seen in the textbook or in the many Youtube videos I've searched is the following: $$\int_{-\infty}^{\infty} {{e^{ax} \over {1+e^x}}dx}$$ where $a$ is a constant between $0$ and $1$. The hint is to use the substitution $x=e^t$ so I assume I'm suppose to turn the first integral into the form of the second, but then I end up with a $t^2$ I don't know what to do with. I am aware that if I solve the first integral from $-\infty$ to $\infty$ I just divide that answer by $2$ to get the answer from $0$ to $\infty$ so I guess the answer I'm really looking for is $\dfrac{\pi^3}4$. | George Arfken's book: Mathematical Methods for Physicists has the following problem in a chapter on contour integration: $\displaystyle \int_0^{\infty} \dfrac{(\log x)^2}{x^2 + 1} dx$. Their suggestion is to make the substitution $x \rightarrow z=e^t$. I'm not sure what they meant by this, but I tried making the substitution $x = e^t$, which turns the integral into: $\displaystyle\int_{-\infty}^{\infty} \dfrac{t^2 e^t}{1+e^{2t}} dt$. The hint is then to take the contour from -R to R, to R+$\pi i$, to -R + $\pi i$, to -R. Since this has a pole at $t = \pi i/2$, a Laurent series expansion about this point gives the residue as $i \pi^2/8$, so the contour integral equals $-\pi^3/4$. I've been able to show that the integral along R to R + $\pi i$ and along -R + $\pi i$ to -R goes to zero by the ML inequality - the denominator grows exponentially but the numerator quadratically. But at this point, I'm a bit lost as to what to do with the integral over Im $t = \pi$. Any help? The book gives the answer as $\pi^3 /8$. |
I'm writing a plugin, and for the most part I'm following the with the addition of autoloading and namespacing. When running the main class, where you include methods to run in the constructor function run_plugin_name() { $plugin = new Plugin_Name(); $plugin->run(); } run_plugin_name(); in the Plugin_Name class we have class Plugin_Name { protected $loader; protected $plugin_name; protected $version; public function __construct() { if ( defined( 'PLUGIN_NAME_VERSION' ) ) { $this->version = PLUGIN_NAME_VERSION; } else { $this->version = '1.0.0'; } $this->plugin_name = 'plugin-name'; $this->load_dependencies(); $this->set_locale(); $this->define_admin_hooks(); $this->define_public_hooks(); } } I am wondering what is the best practice, and if there is any benefit if I define the objects that will be used in the add_action / add_filter methods inside the constructor like public function __construct() { if ( defined( 'PLUGIN_NAME_VERSION' ) ) { $this->version = PLUGIN_NAME_VERSION; } else { $this->version = '1.0.0'; } $this->plugin_name = 'plugin-name'; $this->admin = new Admin( $this->plugin_name, $this->version ); $this->load_dependencies(); $this->set_locale(); $this->define_admin_hooks(); $this->define_public_hooks(); } and then use this inside, say define_admin_hooks() method private function define_admin_hooks() { $this->loader->add_action( 'admin_enqueue_scripts', $this->admin, 'enqueue_styles' ); $this->loader->add_action( 'admin_enqueue_scripts', $this->admin, 'enqueue_scripts' ); } Or should I do it like it's done in the plugin boilerplate private function define_admin_hooks() { $plugin_admin = new Admin( $this->get_plugin_name(), $this->get_version() ); $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' ); } The reason I'm asking is because I have several methods where I add my actions and filters, based on the plugin functionality, and there are some classes that I'm using in both methods. So it seems better to have them in the constructor and then just use them in the methods. That way I'm not breaking the DRY principle. Is my reasoning correct? | I've created a plugin, and of course being me, I wanted to go with a nice OO approach. Now what I've been doing is to create this class and then just below create an instance of this class: class ClassName { public function __construct(){ } } $class_instance = new ClassName(); I'm assuming there is a more WP way to have this class initiated, and then I came across people saying that they prefer to have an init() function than a __construct() one. And similarly I found the a few people using following hook: class ClassName { public function init(){ } } add_action( 'load-plugins.php', array( 'ClassName', 'init' ) ); What is generally considered the best way to create a WP class instance on load and have this as a globally accessibly variable? NOTE: As an interesting side point, I've noticed that while register_activation_hook() can be called from within the __construct, it cannot be called from within the init() using the second example. Perhaps someone could enlighten me on this point. Edit: Thanks for all the answers, there clearly is a fair bit of debate as to how handle the initialization within the class itself, but I think there's generally a pretty good consensus that add_action( 'plugins_loaded', ...); is the best way to actually kick it off... Edit: Just to confuse matters, I've also seen this used (although I wouldn't use this method myself because turning a nicely OO class into a function seems to defeat the point of it): // Start up this plugin add_action( 'init', 'ClassName' ); function ClassName() { global $class_name; $class_name = new ClassName(); } |
I am trying to autostart a music player when my Lubuntu boots but I can't seem to get it to work. I am fairly new to Linux systems and have searched the internet for hours but I am out of ideas. This is a .desktop file I made: [Desktop Entry] Name=Script Exec=/home/t/script.sh Icon=home/t/script.sh Terminal=true Type=Application X-KeepTerminal=true StartupNotify=false When I manually start it it works perfectly. I've added this file in: /.config/autostart /etc/xdg/autostart /usr/share/applications At: /.config/lxsession/Lubuntu I added the line @/home/t/dtest.desktop I also added the directory to rc.local | How can I make an application automatically start when I have logged in? |
What is a good way to cut a 55 gal plastic drum in half? | I have this 55 gallon blue drum that I just picked up from car spa, but the top is not removable. What tool should I buy to remove just the top part of the plastic drum so that I can replace it with a wire mesh? Update: I just looked into the Dremel tool, maybe this could work? |
I am planning on renting a VPS. How much memory is required for a base setup of Debian, Apache, Mysql, PHP? By base, I mean not considering traffic (which will be below 1k hits a day). No complicated databases or memory eating scripts. For reference, I would consider 512MB more than I need. (But i'm unsure of how right I am.) Possible duplicate: The difference would be, I am specifically asking about Debian, Apache, Mysql and PHP by default Debian configuration. No memory tweaking or replacing Apache with a lighter daemon. The other question also has wildly inconsistent answers. | This is a about Related: I have a question regarding capacity planning. Can the Server Fault community please help with the following: What kind of server do I need to handle some number of users? How many users can a server with some specifications handle? Will some server configuration be fast enough for my use case? I'm building a social networking site: what kind of hardware do I need? How much bandwidth do I need for some project? How much bandwidth will some number of users use in some application? |
Explain why $\mathbb{Z \times Z}$ and $\mathbb{R \times R}$ is not a field and that why any external direct sum of two fields cannot be a field. I believe it has much to do with the lack of every non-zero element having an inverse, however I am having difficulty seeing it. | I have a question, and this is it in entirety: Let R be a non-zero ring(that is, R contains at least one element other than the zero element). Prove that $R \times R$ is NOT an integral domain. Now I haven't done a problem like this before, and it seems to be(from the Wikipedia definition) that this ring $R$ needs to be commutative to be an integral domain. Which it isn't stated to be here. What exactly am I meant to do? I haven't been given anything else than the area in grey. |
I checked whether this question was answered before but because of notation, it's hard to see. I am a reading a paper that defines the following two RVs $$ z \mid y \sim Binomial(\pi, y) \\ y \sim Poisson(\lambda) $$ then concludes (by integration and Bayes Rule) that $$ z \sim Poisson(\pi \cdot \lambda) \\ y - z \sim Poisson( (1 - \pi)\cdot \lambda) $$ I tried working it out on paper but since I am not a trained statistician, I am not sure where I am going wrong. If I want to derive $z \sim Poisson(\pi\lambda)$, then I use the conditional probability i.e. $$ p(z) = \int_y p(z, y) \,\, dy $$ where $p(z, y)$ is the joint probability. Expanding this out, I have $$p(z) = \int_y {y\choose z} \pi^z (1 - \pi)^{(y - z)} \frac{e^\lambda \lambda^y}{y!} \, \, dy $$ but I am guessing I have to get to the following equation somehow $$p(z) = \frac{e^{\pi\lambda} (\pi\lambda)^{z}}{z!}$$ but I was not able to manipulate the integral above to get this form. Not sure if that's even possible. | I have been stuck with a problem for a couple of days regarding the distribution of outcomes from a two-stage process. Specifically, what is the distribution of the number of successes in a poisson process followed by a series of bernoulli trials, where the number of trials is determined by the result of the poisson process. If this is not clear, I’ll explain by way of example. Suppose we have a hunter who is setting out to catch rabbits. To do this he sets up a trap. Rabbits pass over the trap at a rate of $r$ times per day (poisson distributed). However, the trap is not very good. If a rabbit walks over the trap, there is only a $p$ (probability) chance that it activates. If the trap has no limit on the amount of rabbits it can catch, what does the distribution of rabbits caught per day look like? My intuition is that it should follow a poisson distribution with mean $r.p$. However, I have been unable to prove this analytically. I figure that the probability of a given number of ‘successes’ should be calculable through the poisson distribution and the binomial distribution. Something like: $ P(X=x) = \sum_{i=x}^{Inf} poisson_{pmf}(i | r) . binomial_{pmf}(x | i, p) $ We can then substitute in the respective mass functions into the above equation. However, beyond that I am getting stuck. Any help or a point in the right direction would be great appreciated. |
I have recently enrolled my Mac to a company that I am working with. After the enrollment the performance of the machine drastically degraded. When I decided to un-enroll, I contacted the helpdesk and their suggestion was to save the necessary documents and go back in the time machine. Which I did not like as a method. Now I am trying to understand what has been pushed to the machine so that I can check and rollback them one by one. Up to now what I have figured was some profiles and the filevault disc encryption. Other than these two what kind of things are typically pushed to Macs when a machine is enrolled to a company? PS: As of now the profile status shows DEP as No. MB-22F1FWW4:~ mehmetkaplan$ profiles status -type enrollment Enrolled via DEP: No MDM enrollment: No | I just bought a used macbook air 2015 I made a system restore... and was confident the mac is not stolen because of these checks 1- there were no icloud on the computer, and I was able to add my own iCloud normally. 2- the mac firmware had no password but now, I see something that I have never seen before I keep seeing this message, always skipping it 1- what are the consequences of allowing DEP, and is it reversible? 2- how to contact the person who has DEP and ask them to remove it from the program? 3- when buying a new mac, how to know if it's on DEP? (the most important question) 4- someone on IRC said that if i was unable to authorize my machine from itunes then the machine is on DEP.. is this correct? 5- the same person on IRC says that there could be a previous owner, and this owner can format my computer and see all of my files even if i have my own icloud on it, is this correct? the person who sold it to me imported 60 macs from a closed startup in sweden, I can return it to the seller and get my money back, but I really need an answer for these questions... |
Okay, so I have read a lot around about the issues im having and the solutions people are offering only solve part of the problem. 1) We have a domain 2) The domain points to our VPS with a static IP running FreeBSD 3) The domain has Google Apps configured 4) Our MX Records point to Google 5) If someone sends us an email we get it in our Gmail, fine. 6) Google apps costs 50 dollars per email address, so we want some pop3 accounts just for development of various things 7) Google is forwarding all our mail to our VPS, and our VPS has postfix and accepts mail for the domain. 8) If in PHP on the VPS we send email to our domain and it gets delivered to the local postfix accounts only What we want is. A) Postfix on our VPS to "accept" email for our domain and deliver it locally B) Postfix to deliver email from our box to Google and not the local boxes So.... the complication is that it must answer to the domain but not deliver mail locally if it originates from itself / e.g. PHP. Does anyone have any bright ideas? This one has our network admin stumped because its easy to not deliver locally but then we cant accept incoming mail. And its easy to send all email out, but then we cant accept incoming mail. Cheers, Madhava Jay | I have a following setup: linux box with postfix configured to be responsible for example.com domain domain's MX servers are configured so that mail sent to example.com is sent to google mail servers several user accounts on linux machine exist (same machine also hosts example.com site) When someone from the outside attempts to send mail to address ending with @example.com, it gets routed to google mail (and there handled appropriately). When linux machine tries to send mail to outside world, mail is delivered correctly, as reverse dns and spf records are configured correctly, so linux machine is valid mail sender for example.com domain (along with google mail servers). However, here's the problem. When php application (hosted at linux box) tries to send mail to [email protected] (and someuser doesn't exist on linux box), it fails, since it doesn't even consult google mail servers, but postfix smtp locally concludes that "someuser" is unknown. So, the question is: how do I tell postfix to relay mails sent to @example.com domain to google mail servers (so, to servers specified in MX records), IF and only if a mailbox is not found locally. |
Does time stretch all the way back for infinity or was there a point when time appears to start in the universe? I remember reading long ago somewhere that according to one theory time began shortly before the creation of the universe. Does time have a starting point of note? | Did spacetime start with the Big Bang? I mean, was there any presence of this spacetime we are experiencing now before big bang? And could there be a presence/existence of any other space-time before the big bang? |
I enjoy watching people suffering. I enjoy watching people suffer. I feel more comfortable using the second one, but I also think that the first one is right... so which one should I use? | "Heard me [infinitive]" vs. "heard me [present participle]" At that time, you wouldn't have heard me talk about it. At that time, you wouldn't have heard me talking about it. At that time, you wouldn't have heard me condemn it. At that time, you wouldn't have heard me condemning it. Which one of the above sentences are incorrect and why? |
$n(n+1)2^{n-2} = \sum_{i=1}^ni^2\binom{n}{i}$ I would like to prove above identity combinatorially. $n(n+1)$ of LHS is doubled amount of summing up from $1$ to $n$ and remaining $2^{n-1}$ denotes that there's some $n -1$ consecutive choice of something being exist or not. How could I relate this two factors into potential those of RHS ? Or will there any other option that I can refer to? Any advice would be appreciate. | Find a combinatorial argument for the following binomial identity: $$n(n+1)2^{n-2} = \sum_{k=1}^{n}k^2\binom{n}{k} .$$ Algebraic proofs can be found at , and a related identity at . |
I have an email field having some values. I want to make this field blank. The problem is I have to make this field blank for 1000 records. When I try to update the email with blank in data loader it does not update. Please help | I'm uploading records with the amazing dataloader.io and have a hard time to upload some records with NO value for optional fields. What do I have to put in those fields? #N/A 'null' NULL '' "" 0 Is there a definite guide or reference document that answers this? |
I need to express the following improper integral as a double integral of $x$ and $y$ and then, using polar coordinates, evaluate it. $$I=\int_{-\infty}^{\infty}e^{-x^2}dx$$ Plotting it, we find a Gaussian centered at $x=0$ which tends to infinity to both sides. We can easily express it as a double integral : $$I=\int_{0}^{1}\int_{-\infty}^{\infty}e^{-x^2}dxdy$$ Evaluating both using Wolfram Alpha gives $\sqrt{\pi}$, so it converges. I know that $x=rcos(\theta)$ and that $dxdy=rdrd\theta$, but substituing this in the above integral and evaluating $\theta$ from $0$ to $2\pi$ and $r$ from $0$ to $\infty$ doesn't yield the correct answer. What's wrong here? Thanks a lot ! | How to prove $$\int_{0}^{\infty} \mathrm{e}^{-x^2}\, dx = \frac{\sqrt \pi}{2}$$ |
I am compressing 3 text files around 80 bytes each by a python code. I start with the following size of the folder: And when I compress it, it's the following size: It appears to be bigger than the original folder. Isn't it supposed to be compressed? The 3 files are some basic NotePad text files. Why is the compressed folder bigger? | I have a text file that is 19 bytes in size and having compressed the file using zip and 7zip, it appears to be larger. I had a read of the question on as well as but considering the file is not already compressed I would have expected further compression. Attached is a screenshot. EDIT0 I took the example further by creating a file that contained random data as follows dd if=/dev/urandom of=sample.log bs=1G count=1 and attempted to compress the file using both zip and 7zip however there were no compression gains. Why is that? |
I have a windows 10 laptop at work. It's set up to show default icons on the desktop from the C:\Users\Public\Desktop folder. I hate that these icons clutter up my workspace but I have no privilege to delete them, and I think even if they were deleted, some group policy would recreate them sooner or later. How can I hide or remove them? Note: In File Explorer, I have allowed to show hidden files and I want to keep it that way. | I share a PC with some other people in the office (we all work different hours). They've installed a bunch of programs they use (AIM, etc...) that place a shortcut in C:\Users\Public\Desktop. If I delete the icon, it's also going to be gone from their desktops as well. Is there a way to hide these icons on my desktop, yet have them be visible on other people's desktops? |
Let $A=\{{m+n\sqrt{2}}:m,n\in Z\}$, where $Z$ stands for the set of all integers .Then which of the following is correct (a) $A$ is dense in $R$ (b) $A$ has only countably many limits points in $R$ (c) $A$ has no limit point in $R$ (d) only irrational numbers can be limit points of $A$ If m=0 and n=1 .Then $\sqrt{2}\in A$ and $(\sqrt{2}-0.5,\sqrt{2}+0.5)\cap A\sim{\sqrt{2}}=\Phi$ . Then , only option c is correct. Please correct if I am wrong . I am not able to find any counter examples. | I am having trouble proving the statement: Let $$S = \{m + n\sqrt 2 : m, n \in\mathbb Z\}$$ Prove that for every $\epsilon > 0$, the intersection of $S$ and $(0, \epsilon)$ is nonempty. |
After delaying for quite a while, I'm trying to upgrade from 10.10 through to the current version. When I hit the "check" button in Update Manager, I get the following error: Failed to Download Repository Information. Check your internet connection. I can't post the full list of what it failed to fetch as the website won't let me post more than 2 links, but here is the first part: W:Failed to fetch /main/source/Sources.gz 404 Not Found [IP: 91.189.91.15 80] , W:Failed to fetch 404 Not Found [IP: 91.189.91.14 80] etc. , E:Some index files failed to download, they have been ignored, or old ones used instead. These are not packages I can disable from "other software". How can I fix this so that I can upgrade? | Recently I have installed an older version of Ubuntu on my old machine. Whenever I try to install any software, I get an error saying it couldn't be found: $ sudo apt-get install vlc Reading package lists... Done Building dependency tree Reading state information... Done E: Couldn't find package vlc |
I am applying for the UK standard visit visa. I have filled my application and also entered details of my children traveling with me (it suggested that they still need to have separate applications filled) Now I have started filling my 11 years old daughter's application, and there are few things the form is asking which are a bit confusing: What is the ownership status of your home Shall I choose 'other' and highlight that she is not renting it? How much money are you personally planning to spend on your visit to the UK? (Required) Should I put the same amount for my daughter as well which I entered for myself? What is the total amount of money you spend each month? (Required) Not sure what to fill here, it does not allow me to enter 0, is it OK to enter pocket money amount? | We are sponsoring a family to visit us in UK as friends from Madagascar for two weeks. They have a 6 year old and a 16 month old. Do the kids need their own visas, and are they the standard visitor visa or a special child visa? Also, when I try and apply on the website I can only apply for one person so how do I apply for all the individuals in the family? I have looked on the Immigration website and can't find the answers I need. |
Changing the lengths of the intervals excluded during the construction of the ternary Cantor set, show that is possible to build a compact, totally disconnected and perfect set (a Cantor set) with positive Lebesgue measure. I have no idea on how to solve this question. It seems also counter-intuitive to me there is a Cantor set whose Lebesgue measure is positive. Question: How should I solve the exercise? Thanks in advance! | So the standard Cantor set has an outer measure equal to $0$, but how can you construct a "fat" Cantor set with a positive outer measure? I was told that it is even possible to produce one with an outer measure of $1$. I don't see how changing the size of the "chuck" taken out will change the value of the outer measure. Regardless of the size, I feel like it will inevitably reach a value of $0$ as well... Are there other constraints that need to be made in order to accomplish this? |
I'm trying to find a way to incorporate an A3 landscape page in my report. I found a way using \newgeometry, but the problem here is, I can't get it to return to my preamble settings after using it. I wondered if there were another way to do it. It should be just like a normal side in the document, with headers, page numbers and everything, but on an A3 landscape page. | My document should be letterpaper and my attachments should be a4paper. I had high hopes for the \newgeometry command from the geometry package, but the documentation says \newgeometry is almost similar to \geometry except that \newgeometry disables all the options specified in the preamble and skips the papersize-related options: landscape, portrait and paper size options (such as papersize, paper=a4paper and so forth). Any help is appreciated! |
[CLOSED] Thanks GoodDeeds and Henry [1] I understood the fundamental problem. As √9 = ± 3 If , √A = √B Thus, ** ±a = ±b** And so a = b; -a = b; and a = -b;; Thus, √9 = +3 OR -3 Let, √A = ±a and, √B = ±b Is this reasoning correct? If not how does this actually work? [1] \bib{26369}{misc}{ title={Square roots -- positive and negative}, author={Henry ()}, note={URL: (version: 2011-03-11)}, eprint={}, organization={Mathematics Stack Exchange} } | It is perhaps a bit embarrassing that while doing higher-level math, I have forgot some more fundamental concepts. I would like to ask whether the square root of a number includes both the positive and the negative square roots. I know that for an equation $x^2 = 9$, the solution is $x = \pm 3$. But if simply given $\sqrt{9}$, does one assume that to mean only the positive root? And when simply talking about the square root of a number in general, would one be referring to both roots or just the positive one, when neither is specified? |
I have read many books say that they ran fast. But that sounds wrong compared to they ran quickly. Which should it be? | A has been asked. However, is it possible to give (general) differences in usage of fast, quickly, speedy and rapidly? And with respect to : Are quick and fast absolutely interchangeable? |
I just made an edit to a question I asked. Quite often I don't write summaries, but this time I felt that I should have added some explanation to the edit. Is there a way to add a summary afterwards? I know that I can do a rollback and a new edit and such things, but I don't think the summary is worth polluting the edit history. I simply want to add a summary to an existing edit. | It often occurs to me to add an edit summary to a question-edit immediately after submitting the edit, especially if the changes aren't obvious (formatting etc.). So I: Click "edit" again. Fill in the summary Click on "Save Edits". The 'edit' (no actual change has been made to the title/body/tags) is accepted, but the summary doesn't show up, i.e. it is silently rejected. I don't think it should work this way because the summary has been added by the original editor within the original edit's edit-window. In fact if I remember correctly, it to used to work as expected earlier; so perhaps this is a recent change. |
I am trying to figure out how to make $\lim_{x \to 0} (1-2x)^{1/x}$ into $\frac{\infty}{\infty}$ or $\frac{0}{0}$ form for L'Hospital's Rule. Using Desmos.com I have found that $(1-2x)^{1/x} \neq 1-2^{1/x}x^{1/x}$ and I'm not sure why that is either. That is the only thing I can think of to change the function's form. | I have recently come across a problem concerning the limit of a sequence given as, $$\lim_{n\rightarrow \infty} (a^n + b^n)^\frac{1}{n}$$ Where $0<a<b$. Solving the limit is not a concern. But applying L'Hospital's rule to this limit is one to me. On rearranging we get, $b \lim_{n\rightarrow \infty} ((\frac{a}{b}) ^n + 1)^\frac{1}{n}$. The solver had then applied the L'Hospital's rule to evaluate the limit. Here, as $n\rightarrow \infty$, the limit approaches the form $1^0$. I have tried to think about this limit approaching an indeterminate form. It does not. From my knowledge of Cauchy's Mean Value theorem, I say that we cannot apply the rule to determinate forms. But it seems to me that we can because it worked for the solver. I think I am not clear on this. Can somebody help? |
To prove $f(A\cap B)=f(A)\cap f(B) \Longleftrightarrow \text{f is injective}$ Beginning: $f(A\cap B)=\{f(x): x\in (A\cap B)\}=\{f(x): x\in A ∧ x\in B\}$ Is that correct and how can I proceed? | Let $f:X\to Y$ where $X$ and $Y$ are nonempty. Prove that a sufficient and essential condition for any two subsets $A,B\subseteq X$ to fulfill $f(A\cap B)=f(A)\cap f(B)$ is that $f$ is injective. I sense there is some problem in my proof. I would be glad if you assisted me. $Attempt:$ Let $f$ be injective and let $A,B\subseteq X$ be two subsets. If $A$ and $B$ are disjoint, then $A\cap B=\emptyset$ $\Rightarrow$ $f(A\cap B)=\emptyset$. Since $f$ is injective then there are no two elements with the same image and therefore $f(A)\cap f(B) =\emptyset =f(A\cap B)$. Now suppose $A\cap B\ne \emptyset.$ Let $ y\in f(A\cap B)$. There exists an $x\in A\cap B$ such that $f(x)=y$. Since $x \in A$ then $f(x)=y\in f(A)$ and since $x \in B$ then $f(x)=y\in f(B)$ $\Rightarrow$ $y\in f(A)\cap f(B)$. Therefore $f(A\cap B)\subseteq f(A)\cap f(B)$. Now let $y\in f(A)\cap f(B)$. ( $f(A)\cap f(B)$ is not empty because if it were then $A$ and $B$ would have an empty intersection as well, which they don't.). Therefore $y\in f(A)$ and $y\in f(B)$ and therefore in $A$ there exists $x_1$ such that $f(x_1)=y$. The same with $B$, $f(x_2)=y$. By injectivity: $x_1=x_2 \Rightarrow x_1=x_2\in A\cap B\Rightarrow f(x_1)=y\in f(a\cap B)\Rightarrow f(A)\cap f(B)\subseteq f(A\cap B) \Rightarrow f(A\cap B)=f(A)\cap f(B).$ Necessary: Suppose it weren't necessary that $f$ is injective. Then there would exist a non-injective function $f$ such that for any two subsets $A,B\subseteq X$ we get $f(A\cap B)=f(A)\cap f(B)$. $f$ is non-injective and therefore there would be $x_1,x_2\in X$ such that $f(x_1)=f(x_2)$. Let us look at $\{x_1\},\{x_2\}\subseteq X$. $f(\{x_1\})\cap f(\{x_2\})=\{f(x_1)=f(x_2)\}\ne f(\{x_1\}\cap\{x_2\})=f(\emptyset)=\emptyset$. A contradiction. |
Flair not showing the image all over the stack exchange sites. Do I need to update the code ? Note: I'm using the flair in About you section. | My question is the same as . I put my stackexchange flair at the bottom of my sites: And get a "profile for Ninsuo on Stack Exchange, a network of free, community-driven Q&A sites" link instead of my nice flair. By opening Firebug, I can read the following error: Or as text: NetworkError: 500 Internal Server Error - I did not tried to update a new picture - just in case you want to get further first. Good luck! |
I put together some math to show what I'm talking about: TL;DR: the earlier the timestep, the more number of forget gate terms present in our derivative that multiply together. If one of these is equal or close to 0, then the whole gradient dies. How is this not an issue, if we train the forget gate [weights] simultaneously? Even if we set a really large forget bias, as the training progresses it'll correct this and make the forget gate at a timestep closer to what is optimal. Eg. if learn that f_10 should be 0, then the whole thing dies, even though we're still making contributions albeit small. Am I missing something here? | LSTM was invented specifically to avoid the vanishing gradient problem. It is supposed to do that with the Constant Error Carousel (CEC), which on the diagram below (from ) correspond to the loop around cell. (source: ) And I understand that that part can be seen as a sort of identity function, so the derivative is one and the gradient stays constant. What I don't understand is how it does not vanish due to the other activation functions ? The input, output and forget gates use a sigmoid, which derivative is at most 0.25, and g and h were traditionally tanh. How does backpropagating through those not make the gradient vanish ? |
I noticed that many black-ish people I've met have bigger lips than the white-ish people I've met. However, not all black-ish people have big lips. Is there any explanations in terms of natural selection, geographic localisation, common ancestors, or something else that could explain why a subset of dark skin people have bigger lips on average than pale skin people? Edit: This question is different from the other one because the answer talks about the nose and its function (air temperature) linked to the environmental factors. I don't see how this applies to lips. | I am not even remotely an expert in this field; I just got curious, so help me. First of all, let us remove all human sentimental attributes from this question (such as connotations of or emotional reactions thereof) and ask it from a purely scientific point of view. The typical facial feature of a West/Central African person (the so-called ) exhibits a wide nose, a lack of nasal bridge projection (similar to many Asian noses) and a prognathous skull shape that resembles more closely to our ancestor Homo Heidelbergensis than many other indigenous phenotypes from other parts of the world do. I agree that this claim sounds anecdotal, and is certainly not true of all Africans (for example, Ethiopians), but one cannot dismiss it simply on grounds of ethical policing. I cannot help but notice that many of my African friends remind me of our shared ancestry (with no disrespect meant whatsoever), as is clear from the photographs below, one of a supposed Homo Heidelbergensis and one of a random African Homo Sapiens of today. My question is the following. What is the reason behind this seeming resemblance? Is this appearance an illusion and possibly a construct of a prejudiced mind, or does this have a valid scientific answer? For example, are most Africans closer to our ancestors than the rest of humanity is? How does evolution answer this question? Thank you for your help. |
I opened up my first chatroom for help on a question. It can be found . Now I'm wondering, is it my responsibility to delete the chatroom? What is the proper etiquette? | I created a test room on chat, but I can't see how to delete it. |
Yesterday the shift stopped working most of the time (it works 1/100) suddenly (did not spill anything), and the weird thing is that today the Control & Option keys joined the party — they stopped working (only left keys). It's a MacBook Pro "Core i7" 2.2 15" Mid-2015 (IG) (MJLQ2LL/A). I have tried the keys in my Windows VMWare and they don't work. In keyboard viewer in Mac they are not highlighted when tapped. How to know for sure if this is a hardware issue (with keyboard or elsewhere too) and how can I fix the problem? Update: External bluetooth works fine | This is an attempt to write a canonical QA for this issue, as per the Meta post: I expect it to be periodically edited with the goal of becoming a comprehensive information resource. I have a MacBook Pro that has a key(Shift, Return, Command, P, etc.) that doesn’t respond when pressed or is stuck in the down position. It's possible that my favorite beverage was spilled (or some other liquid damage). It's also possible that I have no idea what happened. It was working yesterday and suddenly today it's no longer working. Is there any way to bypass or remap the key? Can I have the system ignore it completely? (This question can also apply to external USB keyboards or the Bluetooth keyboards) |
I have tried all the tutorials to install uTorrent, but I still can't get any of them to work. They are all identical. Basically, you get the .tar.gz file, unzip it to /opt/, mark it as executable, link it to /usr/bin/utserver, install libssl0.9.8, and run it. I've done all this, but here's what I get: utserver -settingspath /opt/utorrent-server-v3_0/ bash: /usr/sbin/utserver: No such file or directory So, I tried this: sudo ln -s /opt/utorrent-server-v3_0/utserver /usr/sbin/utserver ln: failed to create symbolic link `/usr/sbin/utserver': File exists So, the utserver command says that the directory/file doesn't exist, but the ln command says it does. What's the problem? (I've already tried rebooting. For a while after a reboot, the command utserver doesn't return any errors; it just exits.) | I am trying to install utorrent instead of using the torrent apps and I just came off windows seven can someone help me? |
I want to calculate the S-box for AES. But I have a problem with the multiplicative inverse step. For example, the inverse of 95 is 8A. I don't know how to get this result. How is the multiplicative inverse computed? | I know how to do multiplication over ${\rm GF}(2^8)$: uint8_t gmul(uint8_t a, uint8_t b) { uint8_t p=0; uint8_t carry; int i; for(i=0;i<8;i++) { if(b & 1) p ^=a; carry = a & 0x80; a = a<<1; if(carry) a^=0x1b; b = b>>1; } return p; } So, I tried to create a ${\rm GF}(2^8)$ multiplication table using this code. I've given below the values in the 3rd row of the table, but I don't think they're correct: 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 0 2 4 6 8 A C E 10 12 14 16 18 1A 1C 1E 3 . . E F I don't know what went wrong. I built the table by multiplying the values in the first row with those in the first column. E.g. in the third row, I multiplied 2 × 0, 2 × 1, …, 2 × E, 2 × F. How can I create a multiplication table for arithmetic in ${\rm GF}(2^8)$? Also, how can I find the multiplicative inverse of a number in ${\rm GF}(2^8)$? For example, how can I determine that the inverse of 95 is 8A? I tried to do this using the multiplication table above, but when I took 9th row and the 5th column in the multiplication table I got 2D, not 8A. |
Recently my PAYDAY has been crashing a lot because I have been installing and uninstalling a lot of mods. I think that because I have tweaked with the PAYDAY files so much it is starting to crash. I basically want to do a fresh install of the whole game by right clicking on PAYDAY on Steam and clicking 'Delete Local Files'. However I wanted to know if this would also erase my progress. | If you remove a single player game installation with the Delete Local Content option from the Steam Libary, in general will save files be deleted or retained? |
I have a Brother DCP-195C printer ubuntu 13.04 32-bit scanner works but the printer does not print works but there is nothing on the paper out of the printer | Can someone please help me to install brother dcp195c drivers on Ubuntu v12? Using the default driver, the printer says that it is receiving data but nothing happens. |
I would like to construct a map tool application that allows only to add some point features. How do I complete the following code to activate snap mode while editing a layer with PyQGIS 3? from qgis.core import * from qgis.gui import * from PyQt5.QtGui import * from PyQt5.QtCore import * class AddPointTool(QgsMapTool): def __init__(self, mapCanvas, layer): QgsMapTool.__init__(self, mapCanvas) self.layer=layer self.setCursor(Qt.CrossCursor) def canvasReleaseEvent(self, event): point=self.toLayerCoordinates(self.layer, event.pos()) fields=self.layer.dataProvider().fields() feature=QgsFeature() feature.setFields(fields) feature.setGeometry(QgsGeometry.fromPointXY(point)) self.layer.addFeature(feature) self.layer.updateExtents() self.layer.triggerRepaint() canvas=iface.mapCanvas() layer=iface.activeLayer() layer.startEditing() layer.triggerRepaint() tool=AddPointTool(canvas,layer) canvas.setMapTool(tool) | The following expression enables snapping for PyQGIS 2.0 : QgsProject.instance().setSnapSettingsForLayer(layer.id(), True, 2, 1, 10, True) What is the equivalent expression in PyQGIS 3.0? |
Since MSE posts frequently hit 100+, this seems to be a problem. The "What is a disputed flag?" post has a score of 157. The highest rated question here currently has a score of 1341, so in fixing this you should probably make it safe for at least 4 character scores. Alternatively, you could show scores in base 64. | The score for the 4 questions are 111, 1218, 261 and 5 respectively, but they display 2 digits per line. This is an obvious bug in design. |
Question: Is it possible to compile a program on linux using a .dll file? Where this is going: This .dll will be used to write a php extension to some proprietary software from a third party. Background and Research: I have been given a library called proprietary.lib. I was curious, as I have never seen the .lib extension before, so I typed: file proprietary.lib The output was: proprietary.lib: current ar archive I did some research and found that ar is more-or-less tar (and in fact, I guess tar has since replaced ar in most *nix environments). Upon inspecting the ar manpage, I saw the t option, which displays a table listing of the contents of that archive. Cool. So I type: ar t proprietary.lib And get: proprietary.dll proprietary.dll ... (snip X lines) ... | We need to interface to 3rd party app, but company behind the app doesn't disclose message protocol and provides only Windows DLL to interface to. Our application is Linux-based so I cannot directly communicate with DLL. I couldn't find any existing solution so I'm considering writing socket-based bridge between Linux and Windows, however I'm sure it is not such a unique problem and somebody should have done it before. Are you aware of any solution that allows to call Windows DDL functions from C app on Linux? It can use Wine or separate Windows PC - doesn't matter. Many thanks in advance. |
Let $\lambda>0$ be a fixed number. Suppose $X_n\sim Bin(n,\frac{\lambda}{n})$, for $n\in\mathbb{N}\setminus\{0\}$. Find the moment-generating function $M_{X_n}(t)$ for $X_n$. Compute for $t$ fixed, $\lim_{n\rightarrow\infty}M_{X_n}(t)$. What is the distribution of the m.g.f. that corresponds to the limit? My Attempt $\displaystyle{M(t)=\mathbb{E}[e^{tx}]=\sum_{x=0}^xe^{xt}\binom{n}{x}\left(\frac{\lambda}{n}\right)^x\left(1-\frac{\lambda}{n}\right)^{n-x}=\sum_{x=0}^x\binom{n}{x}\left(\frac{\lambda e^{t}}{n}\right)^x\left(1-\frac{\lambda}{n}\right)^{n-x}=\left(\frac{\lambda e^t}{n}+1-\frac{\lambda}{n}\right)^n}$ \begin{align} \lim_{n\rightarrow\infty}\left(\frac{\lambda e^t}{n}+1-\frac{\lambda}{n}\right)^n&=\lim_{n\rightarrow\infty}\left(1+\frac{\lambda e^t-\lambda}{n}\right)^n\\ &=\lim_{n\rightarrow\infty}e^{n\ln(1+\frac{\lambda e^t-\lambda}{n})}\\ &=\lim_{n\rightarrow\infty}(\lambda e^t-\lambda)+\frac{o(n)}{n}\quad\text{(where $\lim_{n\rightarrow\infty}\frac{o(n)}{n}=0$)}\\ &=\lambda e^t-\lambda \end{align} The part that I am having trouble with is figuring out which distribution the limit of the m.g.f. corresponds to. | $X_n = \operatorname{Bin}(n,\frac{\lambda}{n})$ for $\lambda > 0$. Show $M_{X_n}(t)$ converges to the MGF of Poisson($\lambda)$ as $n\rightarrow \infty$ So far I got MGF of $$\operatorname{Poi}(\lambda)=e^{-\lambda}\sum_{x=0}^\infty(e^tx)^x/x!$$ MGF of $$\operatorname{Bin}(n,\frac{\lambda}{n})=\sum_{x=0}^{\infty}e^{tx}{n\choose x}(\frac{\lambda}{n})^x(1-\frac{\lambda}{n})^{n-x}$$ $$\lim_{n\to\infty} \sum_{x=0}^{\infty}e^{tx}{n\choose x}(\frac{\lambda}{n})^x(1-\frac{\lambda}{n})^{n-x}$$ I can see that $n \choose x$ as n goes to infinity will be $\frac1{x!}$, but I don't know how they got the $e^{-\lambda}$ and $x^x$. I could be wrong but I feel like $(1-\frac{\lambda}{n})^{n-x}$ just becomes 1 and $(\frac{\lambda}{n})^x$ becomes 0, which wouldn't really work out. |
Being fairly new to jQuery and the AJAX basics, I've been trying to set up some fairly simple dynamic loading. I include a .js file setting up the click event handler, and it looks like this: var baseurl = document.getElementById("baseurl").getAttribute("href"); var pattern = new RegExp("[^/]+"); var page = "cnt/" + pattern.exec(window.location.href.substr(baseurl.length)) + ".php"; $(document).ready(function(){ $('a.ajax').bind('click',function(event){ event.preventDefault(); $('#content').load("cnt/" + pattern.exec(this.href.substr(baseurl.length)) + ".php") }) }); Note that I do some changes to the file so the relative href "testing/" would turn into an absolute path to the file "cnt/testing.php". My anchor tags look like this: <a href="testing/" class="ajax">Link to testing page</a> My problem is, that whenever new content is loaded into div#content the handler in my .js file is not registered for any links that may have appeared using AJAX. In other words the links will simply act as ordinary anchor-tags. I want it to load the next page using AJAX, just like it does with the first page. | 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. |
In the above screenshot you can see I've already crossed the quest. But it is still not awarding it to me and remaining in the available list. Can anyone say what is the reason of this and what to solve this issue. Update 1: As of seeing answer of the duplicate linked question what I understand is I've to maintain a positive question record, not only good question. The has two criteria to be awarded: Ask a good question on 5 separate days Maintain a positive question record My Suggestion is to make them separate or split that count with negative mark beside it. As it is looking odd on seeing 6/5 completed and still pending. Just asking to make it more user friendly look. | As you can see in the picture, I have 13 out of 5. But it's been like this for about two months! What's the reason for that? |
Well something similar to that. Got an ancient desktop running a ubuntu-based distro and an equally ancient macbook. Would like to connect and utilize both their computing capability for day-to-day tasks, you know like browsing, gaming, coding, movies, etc. Have heard of cluster computers, which look good but most of them suggest a similar hardware. And also read that they can actually get counter-useful because of the way the master node would task the sub-nodes, so lot of wasteful energy consumption of the sub-nodes if the master dont delegate. But I only have a vague idea. Question is, a desktop and a laptop, with different hardware, can it be made to work in tandem, elegantly and for normal tasks? And how? Desktop specs (Elementary OS, 32-bit) 1. Intel Pentium Dual Core CPU E2180 @ 2.00GHz 2. 1GB RAM SDRAM (yeah, its that old!) 3. 160GB SATA Disk 4. Intel Corporation 82945G/GZ Integrated Graphics Controller Laptop specs (Snow Leopard, 32-bit?) 1. Intel Core 2 Duo CPU @ 2.16GHz 2. 2GB 667MHz DDR2 RAM 3. 250GB SSD 4. Intel GMA 950 64MB PS - Of course, will put in Ubuntu-based distro in both. PPS - There should be a solution, right? PPPS - A step-by-step would be cool. EDIT - Have read many threads, and they all state the accessing the RAM of a different machine is too costly. So there can be a scenario where the RAM is shared as one and only the CPU is "clustered" as such. OR maybe putting a big RAM in one of the machine, whichever is easier. | Here are a few questions, I wish you could enlighten me. Is it possible to combine processing power of 2 computers? How do I do it? |
Example: Tell her and teller Or cellar and sell her | When two phrases are pronounced alike but have different spelling and meaning, can we call them homophones? e.g. "ice-cream" and "I scream", "nitrate" and "night rate", "that's tough" and "that stuff". Or is there another term for them? What linguistic phenomenon distiguishes these near homophones? I've checked the putative duplicate at but it isn't exactly what I'm asking here. |
I'm trying to install httrack. I used this comnmand: sudo apt-get httrack with no luck. How can I install? | How can I install applications like Google Chrome on Ubuntu? Are there any commands to install an application? Index of answers: |
Evaluate if the following series is convergent or divergent: $\sum\limits_{n=2}^\infty \frac {1} {n\ln(n)\ln\ln{n}}$. I cannot properly understand the notation that the book employs here $\ln\ln(x)$, but I guess it is referring to $\ln(\ln(x))$. Assuming $\ln \ln(x)=\ln(\ln(x))$, I used the Weierstrass's or comparasion test to evaluate the series: $$\sum\limits_{n=2}^\infty \frac {1} {n\ln(n)\ln\ln{n}}<\sum\limits_{n=2}^\infty \frac {1} {n\ln(n)\ln(n)}=\sum\limits_{n=2}^\infty \frac {1} {n\ln^2{n}}<\sum_\limits{n=2}^{\infty}\frac{1}{n^2},$$ proving the series converge. However the solution point out the series diverge. I have already proved the convergence $\sum_\limits{n=2}^{\infty}\frac{1}{n^2}$. Question: What am I doing wrong? How can I prove the series diverge? Is $\ln\ln(x)=\ln(\ln(x))$ meant by the author of the book? | I'm being asked to determine if $\displaystyle\sum\limits_{n=3}^\infty \frac1{n (\ln n)\ln(\ln n)}$ converges. So, using Cauchy's Condensation Test, I reduced the problem to one of determining the convergence of $\displaystyle\sum\limits_{n=3}^\infty\frac 1{n\ln (n\ln 2)}$. Am I on the right path, and how do I proceed from here? |
I have a string like this 1) /* This is the Start for the Test : 1 */ 2) Lu8_Ret = GetStatus_1(); 3) Lu8_Ret = Lu8_Ret + 1; 4)/* This is the End for the Test : 1 */ 5) 6) /* This is the Start for the Test : 2 */ 7) Lu8_Ret = GetStatus_2(); 8) Lu8_Ret = Lu8_Ret + 1; 9) /* This is the End for the Test : 2 */ 10) 11) /* This is the Start for the Test : 1 */ 12) Lu8_Ret = GetStatus_1(); 13) /* This is the End for the Test : 1 */ By using following regular expression I am reading the content between the start and end comment lines regex = r"This is the Start for the Test : 1(([\S\s])*) This is the End for the Test : 1" for match in re.finditer(newrx, content): print(match.group(1)) But it's giving the content between the start comment of Test: 1 to last end comment of Test: 1(line number 2 to 12). How to get the content as a separate group (from line 2-3 as one group and line 12 as another group)? (My program will take care of unwanted /* , */ ) | I have this gigantic ugly string: J0000000: Transaction A0001401 started on 8/22/2008 9:49:29 AM J0000010: Project name: E:\foo.pf J0000011: Job name: MBiek Direct Mail Test J0000020: Document 1 - Completed successfully I'm trying to extract pieces from it using regex. In this case, I want to grab everything after Project Name up to the part where it says J0000011: (the 11 is going to be a different number every time). Here's the regex I've been playing with: Project name:\s+(.*)\s+J[0-9]{7}: The problem is that it doesn't stop until it hits the J0000020: at the end. How do I make the regex stop at the first occurrence of J[0-9]{7}? |
I am using author year together with biblatex. Q: How can I change the reference list: Instead of Name,S. (1930) Titel etc. Name2, S2 (year) .... I would like to have Name, S. (1930) Titel etc. Name2, S. (year) , .... If I have several items for the same author, then the reference list looks similar, but not for the first item. Thanks ind advance (reference to the manual would be fine) Here the code: \documentclass{scrartcl} \usepackage[style=authoryear,sorting=nyt,backend=biber]{biblatex} \bibliography{mathematik_bibliothek} \begin{document} %% \nocite{achieser:1975,tao-compactness,tao:analysis1,tao:analysis2,schaefer:tvs} \printbibliography \end{document} There should be a break after Glasmann and the (1975) should be on the next line like in the case of Tao. | I'm looking for a BibTeX style that formats the reference list at the end in the way shown below. The key points are: The references are sorted by the (list of) authors, and then each author has a list of references keyed by year. Each author has a full line for the name, and then the references for that author are listed below with no name, not even "—" I'm not too worried about the exact punctuation; if I had any class that sorted by authors, I could hack the punctuation if I had to. I have seen this style in various books. One modern example is Jech's Set Theory, 3rd edition. But I have never found a BibTeX style that generates this kind of output. Example of desired output: Jones, Sam [2001] "Paper", Journal, etc [2002] "Other paper", Journal, etc Lewis, Jo [1999a] Some book, Publisher, etc [1999b] "Another paper", Big Journal, etc |
I need to replace string between first SELECT and first FROM, but still not working if I try this : Here is my SQL string to replace : $strSQLreport = "SELECT ... FROM ... WHERE ... AND volu_id IN (SELECT FK_volu_id FROM)" Here is my preg_replace : preg_replace( "/SELECT(.*)FROM/s", "SELECT volu_id AS id FROM", $strSQLreport, 1 ) It takes the second from, and I want only replace before de first FROM! Thanks for help! | I have this gigantic ugly string: J0000000: Transaction A0001401 started on 8/22/2008 9:49:29 AM J0000010: Project name: E:\foo.pf J0000011: Job name: MBiek Direct Mail Test J0000020: Document 1 - Completed successfully I'm trying to extract pieces from it using regex. In this case, I want to grab everything after Project Name up to the part where it says J0000011: (the 11 is going to be a different number every time). Here's the regex I've been playing with: Project name:\s+(.*)\s+J[0-9]{7}: The problem is that it doesn't stop until it hits the J0000020: at the end. How do I make the regex stop at the first occurrence of J[0-9]{7}? |
1/7 is 1x 6digits repeating, 1/13 is 2x 6 digits repeating. Why? I can see this pattern of repeating digits, I can calculate it for most primes but I don't have an intuitive understanding of why it happnes. I know there are certain rules like 10 ^ k = 1 mod(p) and so on but I am after a plain English understanding if there exists one :) I would really appreciate it if you could help me with this or point me to resources that explain this. Fun fact: 2/23 = 22 digits repeating 0.222222222222222/23 = first 15 digits of 2/207 followed by 22 repeating digits of 6/23. True and is similar with different numbers but no clue why? | The number $142,857$ is widely known as a cyclic number, meaning consecutive multiples are cyclic permutations, i.e. $1 × 142,857 = 142,857$ $2 × 142,857 = 285,714$ $3 × 142,857 = 428,571$ and so on. 142857 is the repeating unit of $\frac{1}{7} = 0.\overline{142857}$ and in fact, every prime for which $10$ is a primitive root will generate a cyclic number (if we allow $0$ as a first digit, for example $0588235294117647$ which is the repeating unit of $\frac{1}{17}$). These primes are called full reptend primes. From what I've read, it seems that there is a bijection between full reptend primes and cyclic numbers: a number is cyclic if and only if it is the repeating unit for the reciprocal of a full reptend prime. I was able to find a proof for the if part. I was wondering if anyone can provide a proof for the only if part. Edit: It's been a while since I posed this question and I still haven't found a proof. I've added a bounty in hopes of prompting some interest. |
How can I debug this? If I change the option to show the Emojis, it's working just fine. | Using Macbook Air M1. The keyboard Fn (Function) key has a globe icon to switch between languages. It works but a bit quirky. When it's not working, it tries to switch language but couldn't, and when I switch screen, the language switching dialog keeps popping up. To make the keyboard Fn key work again in switching language, I have to restart my computer. See video attached - the Fn key is not even pressed. |
I have a .pdf that I am trying to send to our printer which has a few color images in the manuscript. These few high resolution images are appearing to have a weird grid in them that was not present before. What is causing the appearance of this grid and how can I get rid of it? Also, I pulled down the proof and looked at with Acrobat Pitstop combo and I am realizing that the images are quite massive. It's telling me that the image is a collection of images (each one in the grid box is a separate image that each have something like 900 x 900 px. Could this be relevant? | I designed a christmas card and I normally print it on vista print. When I ask for a print proof the outlines show. They don’t show when I print it at home. Why are there unwanted white lines appearing in this PDF print proof and how can I solve this problem? |
I have two tables land =========== lid name meter address owner ========== ownerid name family mobile lid Every land can have maximum 12 owners. The result that I need: lid name meter address owner_name_1 owner_family_1 owner_mobile_1 owner_name_2 owner_family_2 owner_mobile_2 .... owner_name_12 owner_family_12 owner_mobile_12 I tried pivot but I can not write it correctly. | I have a table that looks like this: RECIPE VERSION_ID INGREDIENT PERCENTAGE 4000 100 Ing_1 23,0 4000 100 Ing_100 0,1 4000 200 Ing_1 20,0 4000 200 Ing_100 0,7 4000 300 Ing_1 22,3 4000 300 Ing_100 0,9 4001 900 Ing_1 8,3 4001 900 Ing_100 72,4 4001 901 Ing_1 9,3 4001 901 Ing_100 70,5 5012 871 Ing_1 45,1 5012 871 Ing_100 0,9 5012 877 Ing_1 47,2 5012 877 Ing_100 0,8 5012 879 Ing_1 46,6 5012 879 Ing_100 0,9 5012 880 Ing_1 43,6 5012 880 Ing_100 1,2 There are 100 ingredients per recipe/version. I'd like to display the data from this table like this: RECIPE INGREDIENT_Vxxx PERCENTAGE_Vxxx INGREDIENT_Vyyy INGREDIENT_Vyyy (ETC) 4000 Ing_1 23,0 Ing_1 20,0 4000 Ing_100 0,1 Ing_100 0,7 Because in different versions of recipes, ingredients could be removed or added, I'd like to display both ingredient and percentage per version per recipe. There's also the difficulty that different recipes have different number of versions. I'm not even sure if this is possible at all or where to begin. Maybe with the PIVOT function? Could anyone please point me in the right direction? |
I'm using blender2.79 and I have looked for ANT Landscape for a long time (it doesn't exist in add-ons). I have also searched the question and I found the link: but it writes"There is currently no text in this page." So I wonder does anyone know where can I download ANT Landscape. Thanks! | I just downloaded Blender and am going to use it to generate landscapes. I saw references to ANT landscape generator, but have no idea how to activate it or download it. One video supposedly showed how to activate it, I found it but there was no activate check box shown. Do I have to download it? One site said it was included with Blender. If so, where is it located because for the life of me I cannot find it anywhere and am getting frustrated. I just want an easy way to generate landscapes(mountains, etc). I searched the Blender file location (ProgramFiles\Blender Foundation\Blender\2.78\scripts\addons) with no success. Any help is appreciated. Thanks, Jim Lawrence |
A few years ago scientists found that neutrinos were going faster than the speed of light. Then they found some problem with the calculations. I read an article that was made this year about faster than light neutrinos. I'm not sure if the journalist is ignorant or if they found that the neutrinos really were going faster. | I was quite surprised to read this all over the news today: Elusive, nearly massive subatomic particles called neutrinos appear to travel just faster than light, a team of physicists in Europe reports. If so, the observation would wreck Einstein's theory of special relativity, which demands that nothing can travel faster than light. — Apparently a CERN/Gran Sasso team measured a faster-than-light speed for neutrinos. Is this even remotely possible? If so, would it be a real violation of Lorentz invariance or an "" effect? The ; a webcast is/was planned . News conference video |
I've downloaded Far Cry 3 through the steam account on my laptop, then copied the files to the Steam account on my desktop PC. I've put the game folder into the common files folder, just as I always do when I copy a game from another computer. This has always worked before. But this time, steam is acting as if the files weren't there, and is trying to download all 10 GB of it, again. I'm reasonably sure I've put the Far Cry file into the correct directory (steamapps\common). When I tell steam to open local files, it opens the correct Far Cry folder, which has all 10 GB of the required data in it, and when I tell steam to check the files for errors, it tells me everything's fine. And yet it keeps downloading the game and right now is telling me it's got 300 MB downloaded and ten hours to go. What can I do to make it recognize the existing files? | Let's say I have a game bought on retail/other digital download and installed on my hard drive. I buy the same game (or a minor variant of it, say the GOTY edition) on Steam. It should be possible to use the existing installation to avoid the generally big downloads. This is very useful as it saves both bandwidth and time. Previously, as far as I understood, Steam downloaded the game files directly to steam\steamapps\common\<game_name>. Since this folder would be created on starting the download, pausing and closing steam, copying the game files to this folder and then validating game files would make Steam absorb as much as possible and just download the missing files. Currently, Steam downloads the files to steam\steamapps\downloading\<game_id> and then moves them over to the aforementioned folder once the download finishes. So first of all, what the final folder would be is not clear. So what would be the correct way of doing the same thing, that is, make steam use as much of the existing files as possible? Should the files be copied to downloading\*\, or should I figure out the actual folder (say via googling) and copy the files to steamapps\common\*\? More specifically, I had a retail copy of Arkham City installed and I just bought the GOTY version on Steam. Now I tried both of the above things, in either case, the validating does not seem to do anything. Assuming I have the correct folder name steamapps\common\Batman Arkham City GOTY, according to , if I copy the files there, Steam seems to just continue with its 17GB download. If I copy it to steamapps\downloading\200260 then the download keeps stopping every few seconds with "Disk Write Error" after modifying 1 or 2 files, and I have to keep hitting resume. |
The achievement icon doesn't change color or show a number to inform the user of reputation changes. I ran instances on two separate devices during the same period of time (the last few hours), one with settings > notifications enabled, one disabled. Neither one displayed any change in the icon, though I had three positive (and zero negative) reputation change events. When actually opening the dialog, events are correctly displayed. The phone with notifications enabled did not receive any android system notifications either (push notifications are enabled and functioning on it). I was not interacting with the site in any other way during this time, so the notifications would not have been dismissed from outside the app. Notifications-on device: Samsung Galaxy S3, ATT version Android 4.4.2 Running slimkat 4.4.2.build.4.1.Official Notifications-off device: HTC One E8, Hong Kong version Android 5.0.2 Stock Both devices are rooted and running the latest version of the SE app, and are logged in to the same account (this one). | The Recent achievements & Recent inbox messages are not functioning in the Android app. They do function in the browser (on Android and otherwise) and in the iPhone app: |
I am trying to compute the sum $\sum_{i=0}^{\infty} \frac{i}{2^i}$ which I know should be equal to $2$, but I cannot prove it. If I am not mistaken, it should be a arithmetico-geometric series (), hence the title. Any help greatly appreciated! | Apparently, $$ \sum_{n = 0}^\infty \frac{n}{2^n} $$ converges to 2. I'm trying to figure out why. I've tried viewing it as a geometric series, but it's not quite a geometric series since the numerator increases by 1 every term. |
The popup window has to be shown when the app is started. The function that calls the popup window is located in the OnCreate() method. When I start debugging the app it constantly crashes. public void ShowPopup() { dialog.setContentView(R.layout.mainactiv); dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); dialog.show(); } And this is the error message: java.lang.RuntimeException: Unable to start activity ComponentInfo Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.Dialog.setContentView(int)' on a null object reference | What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely? |
I'm trying to create a random map, with lists inside the main list representing the lines. The "createBlankMap" function works perfectly fine, for creating a placeholder map, and the "displayMap" function also works fine, for printing the map and changing the 0s or 1s to "." or "#". But when i try to update the blank map, using the "generateMap" function, all the nested lists get the same random generated value, instead of all of them generating random generated values. # -*- coding: utf-8 -*- import random def displayMap(canvas): for i in range(len(canvas)): #LINE for j in range(len(canvas[i])): if canvas[i][j] == 0: print(".", end='') elif canvas[i][j] == 1: print("#", end='') else: break print() def createBlankMap(x,y): MAP = [] LINE = [] for j in range(y): #COLUMN LINE.append(0) for i in range(x): #LINE MAP.append(LINE) return MAP def generateMap(canvas): for i in range(len(canvas)): #LINE for j in range(len(canvas[i])): #COLUMN choice = random.uniform(0,1) if choice < 0.5: canvas[i][j] = 1 else: canvas[i][j] = 0 return canvas displayMap(generateMap(createBlankMap(5, 10))) The output is always like this: (remembering those values are randomly generated, so they're different every time i run the program). ###.##.#.# ###.##.#.# ###.##.#.# ###.##.#.# ###.##.#.# So basically, i want all the lines to have random generated values, instead of them repeating the first one. | 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? |
Am I able to play my Xbox one online and join my friends game who is playing on a Xbox 360? If so what games? | Is it possible to play against and with Xbox 360 players through my Xbox One? |
Let $A$ be an $n \times n$ invertible matrix and $v_1,v_2,...,v_m$ an element of $\mathbb{R}^{n}$. Prove if $\{v_1,v_2,...,v_m\}$ spans $\mathbb{R}^{n}$ then $\{Av_1, Av_2,...,Av_m\}$ also spans $\mathbb{R}^{n}$. I'm not sure how to use the definition of spanning to prove this statement...do I have to get a homogeneous linear system? | Let $A$ be an invertible $n\times n$ matrix. Let $\mathcal C=\{\vec v_1,\ldots,\vec v_k\}$ be a set of vectors with $\def\span{\operatorname{span}}\span(\mathcal C)=\Bbb R^n$. Show that the set $\mathcal D=\{A\vec v_1,\ldots,A\vec v_k\}$ satisfies $\span(\mathcal D)=\Bbb R^n$. The columns of an $n \times n$ invertible matrix are a basis for $\Bbb R^n$, so multiplying $A$ by $C$ wouldn't change the span. I'm just not sure how to "show" it. |
I am using Ubuntu 13.10. After upgrading and fixing some things the one thing I cannot fix is that the start menu lists Shutdown and Restart and both these buttons just open a menu with shutdown and restart as options. Previously on 13.04 only shutdown was present and it opened the same menu. | This is the first time I'm having problems during Ubuntu upgrade. I had previously enabled the new Unity logout/shutdown dialogs and the restart option had gone. But now it's back again, though utterly useless, because each one leads to the same new Unity dialog: restart or shutdown. I wonder how I can get rid of this duplicate menu option? |
I have a 2010 iMac and I'm considering upgrading to Mavericks. Will I notice any significant decreases in speed? My specs: | Today my Mac wanted me to upgrade it to Mavericks. I'm hesitating because it is a bit old (Mid 2009 MacBook Pro) and I don't want things to run slow. I'm currently using 10.8.5 and it is OK. I have a Core 2 duo (2.53 GHz) with 4 GB of RAM. What do you recommend? How was your experience? |
I have made a recover of deleted files with a software which was stopped and after that I can't login. When I write my password and enter the login display is appearing again. How could I resolve this problem? I don't want to reinstall having afraid of loosing my other files. | My Ubuntu is stuck in a login loop when trying to enter my desktop. When I login, the screen gets black and soon after that the login screen comes back. I've read that the problem might be caused by an error depending on the graphics, here's my graphics card: ATI Radeon 7670M |
I want to generate correlation matrix such that it follows the below structure $$\Sigma = B \Lambda B^T $$ where $\Lambda$ is a diagonal matrix containing positive elements, $\Sigma \in R^{n \times n}$ is a correlation matrix and $B \in R^{n \times k}$ where $k$ is less than $n$. Here each column of $B$ is a sparse column with a certain sparsity $\lambda$ and $B$ is not necessarily orthogonal matrix. I am not sure how to generate a correlation matrix given above structure. | I want to simulate a correlation matrix which has some off-diagonal structures and also should have some hierarchical structures. For simulating correlation matrices which contain hierarchical structures, I am using . But, I don't know how to add off-diagonal structures to it. I want to simulate a correlation matrix which somewhat have off-diagonal structures as below image An example of a hierarchical structure in the correlation matrix is below image Does anyone have a suggestion on how to simulate such correlation matrices? |
Is there an intuitive explanation for Maxwell's equations? I know they are axioms but is there a logical understanding of why instead of mathematical. Both forms don't explicate the scientific reasoning behind them to me. I would appreciate a non- or minimally mathematical approach to them. | Is it possible to describe the physical meaning of and show how they lead to electromagnetic wave, with little involvement of mathematics ? |
A process occupies a lot of CPU, and when I kill it by kill -9, it just re-runs with another name. How can I find it out, kill and delete it?. Its parent pid is 1, started by root user, and on the directory of /usr/bin with a random hex name like 3b62ba238f. And when I try to kill it, it just re runs with another new name/command. For example, if I kill the process 15459 in the first picture, another process starts to run with a new name/command. The both occupy a lot of CPU and with the parent id of 1. The syslog prints the following when the new process starts How can I find, shut down and delete the process/file? The malware was found following the steps below. Find the service corresponding to the process. systemctl status <PID> Locate the service file, stop and remove the service. Then delete the files. systemctl stop pmapx_start_2 systemctl disable pmapx_start_2 rm -f /etc/systemd/system/multi-user.target.wants/pmapx_start_2.service rm -f /usr/sbin/route_forbidden-close | I found malware on my ec2 instance which was continuously mining bitcoin and using my instance processing power. I successfully identified the process, but was unable to remove and kill it. I ran this command watch "ps aux | sort -nrk 3,3 | head -n 5" It shows the top five process running on my instance, from which I found there is a process name 'bashd' which was consuming 30% of cpu. The process is bashd -a cryptonight -o stratum+tcp://get.bi-chi.com:3333 -u 47EAoaBc5TWDZKVaAYvQ7Y4ZfoJMFathAR882gabJ43wHEfxEp81vfJ3J3j6FQGJxJNQTAwvmJYS2Ei8dbkKcwfPFst8FhG -p x I killed this process by using the kill -9 process_id command. After 5 seconds, the process started again. |
If $f:R\to R$ is bounded on bounded intervals, and $\lim f(x+1) - f(x) = L$ when $x\to +\infty$ then $\lim f(x)/x = L$ when $x\to +\infty$ I found answers here at the site when $f$ is differentiable, but I just don't know what to use in this case, where we don't have differentiability (at least not explicitly stated). Any help would be appreciated. | Let $f:[0,+\infty)\to\Bbb R$ be a function bounded on each finite interval. I want to show that if $\lim\limits_{x\to+\infty}[f(x+1)-f(x)]= L,$ then also $\lim\limits_{x\to+\infty}\dfrac{f(x)}x = L$ |
I want to copy a file to a folder called "Modules". I opened in the folder that contains that one and used: sudo chown -R danielyeste Modules When I access the properties, root still has the ownership. danielyeste is my user, checked with whoiam in terminal. Also tried to do it with sudo mv and other options. Full path is: /snap/clion/current/bin/cmake/linux/share/cmake-3.16/Modules | I have installed a package using snap and I need to modify one of the files but when I try to change its ownership or permissions, I always get the following message: sudo chmod +x ./my_file.js chmod: changing permissions of '/snap/my_app/my_file.js': Read-only file system How can I modify files that are installed via snap? |
I was playing Diablo 3's new season, and realized that there are 3 different types of hit splats (white, yellow, and orange). I think white is a regular hit, and yellow is a critical hit, but I am not sure what the orange represents. What do the hit splats mean in Diablo 3? | I have been using a Holy weapon for most of the game and so I assumed these yellow numbers indicated Holy damage. Now I also have an Arcane weapon, but I never see a color for Arcane damage. Do the colors mean something else? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.