I wanted to know if we can overload a function on prototype object in JavaScript?          function Person(name, family) {   this.name = name;   this.family = family; }  Person.prototype.getFull = function() {   return this.name + " " + this.family; };  Person.prototype.getFull = function(someParam) {   return this.name + " " + this.family; };   var p =  new Person(); p.getFull(); p.getFull(someparam);

What is the best way(s) to fake function overloading in Javascript?   I know it is not possible to overload functions in Javascript as in other languages.  If I needed a function with two uses foo(x) and foo(x,y,z) which is the best / preferred way:   Using different names in the first place Using optional arguments like y = y || 'default' Using number of arguments Checking types of arguments Or how?


I don't know if you here at Arquade SE accept technical questions, but I'm willing to try anyway. I am a huge Dark Souls fan, so naturally, I have all three games on my laptop. Before we go into my problem, let me specify my laptop's "kind". I have a HP EliteBook 8760w. This puppy is sporting intel CORE i7 and Nvidia Quadro 3000M with 8 GB of RAM. I know that this is not a gaming laptop (it is a workstation, hence the Quadro dedicated graphics), so I naturally won't be able to get straight 60 FPS on 2016/2017 games like Dark Souls III for example. But recently, something strange occurred. I just started playing Dark Souls II three weeks ago. I immediately noticed FANTASTIC performance. My frames never dropped below 30 FPS, and the average was around 45 to 50 FPS. At first I though this was due to my "Best Performance" option enabled, but then I reconfigured the settings to HIGHEST POSSIBLE: all best quality textures, Anti-Aliasing, depth of field etc. The performance stayed exactly the same. But when I play Dark Souls III (on lowest possible settings of course with "Best Performance" mode enabled), my performance is abominable. The average FPS is about 12 to 16, and the cap is 20. My main question is: Why on Earth does this happen? I'm dying to know the answer, as I am looking for ways to boost up my laptop performance to at least 30 FPS. I have three hypotheses:  (Very unlikely) The low FPS is due to the "age gap" between games. While Dark Souls II was originates in 2014, Dark Souls III is a 2016 game. But as I said, I don't think that 2 years could impact performance so heavily.  (Straight up impossible) Dark Souls II uses OpenGL or OpenCL for compilation (this would explain great performance, as Quadro architecture is specifically aimed at OpenGL and OpenCL), while Dar Souls III uses DirectX. I don't think that is possible though, as I had to install DirectX 2010 in order for Dark Souls II to work.  The older version of DirectX is (somehow) more compatible with Quadro architecture than the one that runs with Dark Souls III.   I hope my question won't get immediately purged as off-topic just because it contaigns a technical issue. All remarks, criticisms and answers are welcome! Thank you in advance. EDIT: One thing you might want to consider: a lot of people are telling me that Dark Souls II performs so well because it was made for previous gen consoles. Well, that was my initial thought as well, but then I compared it to the original Dark Souls: Prepare to Die Edition. Even this ancient (brilliant) game from 2011 has worse framerate than its 3-years-younger successor (I DO have DSFix installed to be fair) - Dark Souls II. I have a strong feeling that there is something special in Dark Souls II that makes my Quadro tick. Any ideas what this could be?

Is there a service that I can use to check if my machine will be able to run a certain game?


Instead of putting in 40 for the for loop i want to get the length of the array which is where i want to store the information from the file. Would I use strlen or sizeof? Overall, how would i take in the information from the file and then store it in the array to get the size of the array in the for loop where the 40 would have been. Thank you. Also I am assuming to use strlen, correct?  Int40 *loadPlainText(char *fname){//declare function         int i; //for eventual for loop         char c;//declare character c         Int40 *Point=createInt40(); //call the create function because it returns a pointer to the int40 struct that holds an array filled with 0s         //something has to catch the value that the function returns. thats why its equal to  structure         FILE* ifp = fopen(inputFilename, "r");//opens thew file in read mode         int arr[40];//declare an array         for(i=0;i<=40;i++){//for loop             fscanf(ifp, "%c", &arr[i]);//read file into an array             Point->digits[i]=c;         }//end for loop         return Point;//return the pointer     }//end function

How can I figure out the size of a file, in bytes?  #include <stdio.h>  unsigned int fsize(char* file){   //what goes here? }


Deleting items from an Array List from the end has a time complexity of O(1), just like deleting items from the head of a Linked List. But Linked List is still a bit faster when I test it in java and I don't quit understand why. Can somebody explain why is Linked List still faster even though they're both in O(1) time complexity? In other words, why deleting the first element from a Linked List faster than deleting the last element from an Array List? I don't think that my code will help you answer my question, since it is more about Data Structure. But here it is just in case (don't mind the French it's for a homework) : LinkedList<Integer> LinkL = new LinkedList<Integer>();         ArrayList<Integer> ArrL = new ArrayList<Integer>();         int N;         N = 1000;         //2.creer le Linked List         for(int i=0; i<N; i++) {             LinkL.add(i);         }         //System.out.println(LinkL);           //3. et 4.Supprimer les elements de Linked List et afficher le temps         long debut = System.nanoTime();          for(int i=0; i<N; i++) {         LinkL.removeFirst();         }         long fin = System.nanoTime();         long tempsExecution = fin - debut;         System.out.println("1.Suppression des éléments de LinkL avec la méthode \nremoveFirst( ) de LinkedList, avec une durée \nduréeLinkedList = "+tempsExecution+ " nanosecondes");  //-                  //5.Creer Array List         for(int i=0; i<N; i++) {                 ArrL.add(i);             }         //System.out.println(ArrL);         //6.Supprimer les elements de Array List et afficher le temps         debut = System.nanoTime();          for(int i=0; i<N; i++) {         ArrL.remove(0);         }         fin = System.nanoTime();         tempsExecution = fin - debut;                System.out.println("\n2.Suppression des éléments de ArrL avec remove(0) d’un \nArrayList, durée duréeArrayDirect = "+tempsExecution+ " nanosecondes");                  //7. Recreer ArrL         for(int i=0; i<N; i++) {                 ArrL.add(i);             }         //System.out.println(ArrL);         //Supprimer les elements de ArrL         debut = System.nanoTime();          for(int i=N-1; i>=0; i--) {             ArrL.remove(i);             }         fin = System.nanoTime();         tempsExecution = fin - debut;            System.out.println("\n3.Suppression des éléments de ArrL avec remove(i) ciblant \nles derniers éléments d’un ArrayList, avec une durée \nde duréeArrayInverse = "+tempsExecution+ " nanosecondes");      } }  Thanks in advance.

How do you write (and run) a correct micro-benchmark in Java?  I'm looking for some code samples and comments illustrating various things to think about.  Example: Should the benchmark measure time/iteration or iterations/time, and why?  Related:


In an answer to a previous post of the same question, it was stated that the gravitational constant can not be determined theoretically yet!  From my perspective, the reason this is not yet possible is because of a flaw in the assignment of units in the SI system.   It is possible to derive the gravitational constant multiple ways using known physical constants but because of the flaw in the SI system the dimensions will not work out.  Thus the proof would be defined as a numerical coincidence and would be rejected.  If one was to show the proof using a new system of units it would still be rejected because the new system would suggest a flaw in theory of something which has been established for over one hundred years.  So the argument of a numerical coincidence based on unjustifiable units is used to defend a faulty set of units which is the source of the problem in the first place.  So my question is, "How does one defeat this problem?"

We know all that the  is $$G=6.67428±0.00067\times 10^{-11}\mathrm{m^{3} \:kg^{-1} s^{-2}}.$$ But can we calculate it theoretically?


I bought $4.5 Call (1/15/21) on 4/27 for $ .17 the day before the split. Today the value of the options is $.09. The crude oil has increased since 4/28. Would anyone help to explain on this ?

I held 1 put option for 100 shares of USO that expires on May 8. Yesterday, USO underwent an 8:1 reverse stock split. My options are now for USO1 instead of USO, but what does that mean?  The strike price hasn't changed, so does that mean that my option will expire worthless as it's unlikely the stock will drop (significantly) to back below the strike price?


If $a$ and $b$ are positive real numbers, then $a+ b \ge 2 \sqrt{ab}$.  Can you guys help me with this problem? I'm still trying to learn how to do proving and I don't really know how to start or complete this problem.

If $a$ and $b$ are positive real numbers, then $a + b \geq 2 \sqrt{ab}$.   I know how to do the direct proof, but in this case, I want to try proving it by contradiction. I have tried manipulating the inequality $a + b < 2 \sqrt{ab}$ after making the assumption that $a,b >0$ to get a contadiction $a,b \leq 0$.  $\begin{align} a + b &< 2 \sqrt{ab} \\a^2-2ab+b^2 &< 0 \\(a-b)^2 &< 0\end{align}$  How do I show that $a,b \leq 0$?


In previous editions of Windows you could hold Shift and then Right Click an application from the Start Menu and you would see the "Run as different user" option. In Windows 10 it just closes the menu.  I know if I do it from the desktop/file explorer it works but I would like to get this working from the Start Menu when you search applications.

Running an application as a different user (e.g. domain admin account) from the start menu (by shift + right-clicking the application) used to be an option in Windows 7 & XP.  However, I can't find that option in Windows 10. The workaround seems to be either 1) to find the application in Windows Explorer (shift + right-click) or 2) use runas.exe from the command line.  However, in order to use those workarounds, I have look up the executable name first. It's a bit difficult because I don't have the name of every RSAT tool or executable name memorized.  (e.g. "Active Directory Users and Computers" is dsa.msc, "Routing and Remote Acces" is rrasmgmt.msc)  Is there a simpler way to do this?


I'm trying to use fixed distance buffer, and had a few questions. One, what units is the distance being measured in? I assumed meters, but after doing a test run it clearly isn't. And two, what is "Segments"? I checked the documentation, and it doesn't give any hints about either (I think this part of the documentation was never finished)

I  have had no luck getting the buffer tool to accept anything but degrees as units of measure.  I have found lots of stuff saying the layer needs to be reprojected and saved but it hasn't worked at all for me.   Is there a way I could create a buffer without using ftools or at least force the units to meters somehow?  As a workaround I converted meters to degrees (lat) and used that but the final product needs to be as close to reality as possible.  Things I've tried:   setting every unit option I could find to meters (where possible). setting everything to NAD83/Maryland (data is for Washington, DC) and saving it as such (as layers in ESRI shape files). reimporting the reprojected layers setting relevant layers to Google Mercator   The was tried followed by creating a buffer. Many were tried in combination. QGIS 1.7.3 Slackware64 current (qgis from SBo-13.37 repo, tried on multilib and plain 64it with same results)


The web site   provides a chrome browser extension which colorizes paragraphs so that moving your eyes from one  line to the next is much quicker than with just black text.  See  for  a graphic which should make this clear.  Can this be done in LaTeX in a semi-automatic or automatic way?  Mark

I've looked at the demo of Beeline reader and would like to test it out on a physical version of my books, which are done in LaTeX. I'm wondering if it would even be possible.   Beeline reader takes online test a puts a slight gradient on the letters for a single line of text. On the next line it reverses the direction of the gradient. The idea being that it helps tracking text and improves speed of reading.  Any hints or suggestions as to how to do this in LaTeX?  What follows is an example taken from


Let $f = x^3 + x + 1$. How many elements does $\mathbb{Z}_2[x]/(f)$ have? Write out all of the elements of this field, and find the inverse of each nonzero element.  I know that $f$ is irreducible in $\mathbb{Z}_2[x]$ and thus has no roots. How would I calculate what kinds of elements are contained in $\mathbb{Z}_2[x]/(f)$? What's the form of elements in $\mathbb{Z}_2[x]/(f)$?

How many elements are in the quotient ring $\displaystyle \frac{\mathbb Z_3[x]}{\langle 2x^3+ x+1\rangle}$ ?  I guess I should be using the division algorithm but I'm stuck on how to figure it out.


The centroid of a cluster is defined as centroid. It is defined as the mean of each dimension across all samples of the cluster.  What is the analogous that uses the median of each dimension? As far as I know, a similar concept is the medoid, which needs to be an actual sample of the cluster.

The representative point of a cluster or cluster center for the k-means algorithm is the component-wise mean of the points in its cluster. The mean is chosen because it helps to minimize the within cluster variances (which is to say that it is minimizing within cluster squared Euclidean distance, since its the same). Now, when I want to use a different distance metric, like L1 (Manhattan distance), I would be minimizing the within cluster absolute deviations (if I choose to). I was looking at what the centers calculation would be like, because the mean won't reduce the new objective function, and I found this on the Matlab documentation of their kmeans function for the distance parameter     cityblock - Sum of absolute differences, i.e., the L1 distance. Each centroid is the component-wise median of the points in that cluster.   Now, how did they come up with the component-wise median? How does a median minimize absolute deviations?


I run a Box-Cox transformation for a linear model to find an appropriate transformation for a response variable, which is a number of insect per sq.meter. I need to transform the response variable because of a pattern in the residual plot obtained after running the linear regression using none-transformed response variable. I used a boxcox() function from the ‘MASS’ package in R. Box-Cox suggested the best lambda value of 0.055 for transformation, which is close to 0 and corresponds to natural log transformation (Osborne 2010).   My question is may I use log10 transformation instead of natural log transformation? log10 transformation is the most common transformation my field. Are there any references, to back up this decision?     Just to mention, I can’t use Poisson regression because I work with averaged values of insects per sq.m, it is complications of using different sampling equipment.    Thanks

I have few seemingly simple questions.   I am working on time series data and applying vector error correction model. I find different results when I transform the data into LOG and LN. Which one is better? I have variables in % and in levels (numbers). I have for example one which is measured in million USD and others in %. My question: shall I list the whole number in eviews like 47,000,000,000 or just 47 and then bring in the billion when interpreting the results? Does it make any difference when running Johansen's test?


I have a Samsung Galaxy Nexus and I'm trying to do a fresh reinstall of Cyanongenmod.  I see in their website that there are three different versions of this phone: ;  Now I am confused and don't know which version I have? I bought it in Portugal. But is there a way to automatically identify the phone?  Thank you

There have been some Jelly Bean updates for Galaxy Nexus, but most of these are specific to a certain variant of the Nexus. How can I easily find out which variant I have?


I'm trying to draw a similar molecule as the picture below using the \chemfig package, but don't really know where to start.  How would I do it?

how can I add the charge and the counter ions to my complex? I'm using chemfig.  \schemestart \chemname{\chemleft[\chemfig{Ni (<:[1]OH_2) (-[2]OH_2) (<:[3]OH_2) (<[5]OH_2) (-[6]OH_2) (<[7]OH_2) }\chemright]}{\ce{[Ni(OH2)6]Cl2}} \schemestop     Thanks!


says that "in general, the refractive index of a glass increases with its density." And the refraction index of water vapor is less than ice, and even less than liquid water. Is there any simple explanation to that?

I know that if we solve the Maxwell equation, we will end up with the phase velocity of light being related to the permeability and the permittivity of the material. But this is not what I'm interested in - I want to go deeper than that. We know that the real speed of light is actually not changing, the decrease in speed is just apparent. Material is mostly empty, the light will still travel with $c$ in the spacing. The rare atoms will disturb the light in some way. So I am interested in how the atoms affect the light. Photon absorption-emission theory Some textbooks that I read explain it in a way kind of like this: In a material the photons are absorbed by atom and then re-emitted a short time later, then they travel a short distance to the next atom and get absorbed&emitted again and so on. How quickly the atoms in a material can absorb and re-emit the photon and how dense the atoms decides the apparent speed of light in that material. So the light appears slower because it has a smaller “drift speed”. Interference theory But recently I realize an alternative explanation: Atoms respond to the light by radiating electromagnetic wave. This “new light” interferes with the “old light” in some way that results in delayed light (advanced in phase), this can easily be shown by using simple phasor diagram. Consequently effectively the light covers a smaller phase each second, which gives the impression of a lower phase velocity. However the group velocity is changing in a complicated way. I think that the first explanation does not explain the change in phase velocity of light. if we consider light travelling into a slab of negative refractive index non-dispersive material, let’s say the light is directed perpendicular to the slab. The phase velocity’s direction will be flipped, but group velocity’s direction in the material will not change. Only the second explanation can explain the flipped phase velocity direction. I guess that the velocity that we get in the first explanation is actually belongs to the group velocity. It makes sense to me that the front most of the photon stream determines the first information that the light delivers. So the question is What really cause the phase velocity of light to be decreased?  "drift velocity" of photons (they aren't the same photons, they are re-emitted all the time) phase difference between absorbed and emitted light something else  And also, I still don't really understand detailed explanation of the absorption-emission process for small light's wavelength (for large lambda compare to the atoms spacing, the photons will be absorbed by the phonons). The dispersion relation that we know is continuous and also some material is non-dispersive, therefore the absorption process must occur in all frequency for a certain range. So definitely it doesn't involve the atomic transition, otherwise it will be quantized. My guess is that the relevant absorption process gets smooth out by the dipole moment. What makes the spectrum continuous? EDIT: link for dispersion relation:


This is probably a simple question and I'm just wording it wrong but I can't figure out how to set this program as a favorite.  I just installed IBM SPSS stats program on Ubuntu GNOME 16.04. Unfortunately, the installation neglected to place a shortcut on my programs list. The only way to open it is to go to where I installed it and open it manually. Then, I have to left click the "stats" file and click execute, which opens a blank terminal with the title "stats" and then it opens the actual program. When I click the activities button in the upper left corner, it shows the program as open but does not allow me to add it to favorites. The only thing that can be added to favorites is the blank terminal which is only known as "unknown". I tried adding that to favorites and opening that but it only opens a blank terminal, no different than any other terminal.  MY question is, how do I set this up so I can open IBM SPSS without having to navigate through the file manager every time? I tried making a custom script that runs cd /opt/IBM/SPSS/Statistics/23/bin && ./stats which works but can't be placed as a favorite and is not searchable on the activities menu.

Will Unity allow making custom launcher icons from .desktop files or via menu editing system? (Right now the launcher doesn't give the option to "keep in launcher" on all programs.  For some programs I use, I have to make custom launchers or .desktop files.  For instance, daily blender builds are generally just folders with an executable.  In basic Gnome or KDE, I can make a new menu entry with the menu editing system. Then, I can also add it to Docky either from the menu or by dragging a .desktop file to it. Unity launcher doesn't support drag and drop, so thats not a bug or anything, but when I open a .desktop file, it has unpredictable results. Most time it will not have "keep in launcher". Sometime it will have a pinnable item without the .desktop's icon, and if I pin the item to the launcher, it will not call upon the program again after closing it. I've also gotten it to just work with a .desktop file for celtx.


After a fresh install of Ubuntu 12.04.1 (64bit), I get the following message when I want to install software via terminal:  The following packages were automatically installed and are no longer required: linux-headers-3.2.0-29 linux-headers-3.2.0-29-generic   Is this normal? As it's related to the Linux core itself, I am confused that it might break my system.

After trying to open and install google earth through the terminal it keeps bringing up this message.   The following packages were automatically installed and are no longer required:   gir1.2-ubuntuoneui-3.0 language-pack-kde-en kde-l10n-engb   libubuntuoneui-3.0-1 thunderbird-globalmenu language-pack-kde-en-base Use 'apt-get autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 27 not upgraded.   I am wondering what I can do next?


Can anyone help me? I am currently a Windows 10 user on my laptop and I want to dual boot my laptop so I can have Ubuntu and Windows 10. Can anyone give me an instruction on how to do it?

I'm absolutely new to Linux. I would like to know how to install Ubuntu alongside the pre-installed Windows 8+ OS.  Should I do it with Wubi, or through the Live USB/DVD?  What steps do I need to take to correctly install Ubuntu?


I am getting linking error when I build the project. I have a static member pointer which I am setting from a static member function. Any ideas what's the problem   class Logger {   private:      static MyComp* pComp;  public:       static void setComp(MyComp* comp);       // more methods .. };    void Logger::setComp(MyComp* comp)  {    pComp = comp;  }   Get the linking error     Undefined symbols for architecture x86_64:     "Logger::pComp", referenced from:         Logger::setComp(MyComp*) in Logger.o

Can anyone explain why following code won't compile? At least on g++ 4.2.4.  And more interesting, why it will compile when I cast MEMBER to int?  #include <vector>  class Foo {   public:       static const int MEMBER = 1;   };  int main(){       vector<int> v;       v.push_back( Foo::MEMBER );       // undefined reference to `Foo::MEMBER'     v.push_back( (int) Foo::MEMBER ); // OK       return 0; }


Is it possible to echo the two-character string -n using just the echo command built into the bash shell? I know I can do printf '%s\n' -n but was just wondering if the echo built-in is capable of outputting the string -n at all.

I can't figure how to print the string "-n" with the over 30 years-old command echo.  I tried these:  Michaels:Scripts$ echo -n Michaels:Scripts$ echo "-n" Michaels:Scripts$ echo -e "-n" Michaels:Scripts$ echo -- -n -- -n Michaels:Script$ echo -- "-n" -- -n Michaels:Script$ echo "\-n" \-n   I use Mac OS X ML. I consider this behaviour very weird and unexpected.


So I have been viewing stack overflow to see if any questions have been answered referring to my problem, but I feel as if my array was indeed initialized. Currently I am attempting to make a simple card game but I continue to get the same error no matter what I do.   Main:  public class Main { public static void main(String[] args) {     Dealer deal = new Dealer();     User use = new User();     Player play = null;     Logistics log = new Logistics();      boolean[] initElementList = {false, false, false};     use.initElementList(initElementList);     deal.initElementList(initElementList);      while(play == null){         use.printDeck();         Card userChoice = use.chooseCard();         Card dealerChoice = deal.chooseCard();         **log.roundWinner(userChoice, dealerChoice);**         play = log.gameWinner();     }     System.out.println(play); } }   Logistics:  public Card roundWinner(Card user, Card dealer){     Dealer deal = new Dealer();     User use = new User();     String userChoiceE = user.getElement();     String dealerChoiceE = dealer.getElement();      int userChoiceS = user.getStrength();     int dealerChoiceS = dealer.getStrength();      **if(userChoiceE.equalsIgnoreCase("FIRE") && dealerChoiceE.equalsIgnoreCase("ICE")){         use.setElementList(0);         return user;     }**   Player:  public abstract class Player {  private boolean[] hasElement; private Card[][] deck;  public boolean[] getElementList(){     return this.hasElement; } **public void setElementList(int index){     this.hasElement[index] = true; }  public void initElementList(boolean[] ElementList){     this.hasElement = ElementList; }** public void createDeck(){     CardGenerator cg = new CardGenerator();     this.deck =  cg.Deck(); } public Card[][] getDeck(){     return this.deck; } }

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 am trying to practice calculating categorical quotients and I ran into this example. I am unable to get the answer and was wondering if someone can help?  Let $G = Z/3Z =$ $\{1, \omega, \omega^2\}$, where $\omega$ is a cube root of unity. Let $G$ act on $𝔸^{2}$ via $\omega(x, y) = (\omega x, \omega y)$. Find the categorical quotient of $𝔸^{2}$ by G.


The child meta sites have been renamed for the move to https. As a side effect their names in the API changed, making the favorite sites in the app display "unknown site" in the list.  So far so good. Clicking that entry results in the standard crash message (Stack Exchange stopped working) and the app restarting.

When I select the unknown site (i.e. the meta sites) the app crashes.   I have a Samsung Note 5 and version 1.0.89 of the app.


Let $f:X \rightarrow Y$ be a function. Prove that if $f$ is continuous, then for every convergent sequence $(x_n)$ lim$_{n\rightarrow \infty}\,f(x_n)=f(\text{lim}_{n \rightarrow \infty} \, x_n)$  My attempt: Assume $f$ is continuous. Then $\forall \epsilon >0, \exists \delta > 0$ such that $\forall p \in X$ and $q \in X: d(p,q) < \delta \implies d(f(q),f(q)) < \epsilon.$  And also assume that $(x_n)$ converges. Then $\exists L$ such that $\forall \epsilon >0, \exists N$ such that $n>N \implies d(x_n, L) < \epsilon.$  I need to use these definitions to show lim$_{n\rightarrow \infty}\,f(x_n)=f(\text{lim}_{n \rightarrow \infty} \, x_n)$ . Any hints?  Edit: lim$_{n \rightarrow \infty}(x_n) \in X$

Let $f : (X, d_X) \to (Y, d_Y )$ be a map between two metric spaces. Recall that $f$ is called continuous at $x ∈ X$ if for any open ball $ B_f(x)(ϵ)$ of radius $ϵ$ around $f(x)$ there exists a ball $B_x(δ)$ of radius $δ$ around $x$ such that $f(B_x(δ))⊂B_f(x)(ϵ)$. Show that $f$ is continuous at $x$ if and only if for any sequence ${x_n}$ in $X$ converging to $x$ the sequence $f(x_n)$ converges in $Y$ to $f(x)$. Hint: imitate the proof of the corresponding statement for functions $R → R$.


It's been along time that I have wanted to get started with post processing, but I have a big problem.  I don't know where to start. I have looked around internet and this site too, but I can't figure out how and where to start.  I wonder if someone could introduce a book, course or anything, as the first step to me. Please be specific.

I don't really know where to start with post-processing my images. I normally just straighten, crop and sharpen. Do people know of any good resources on the internet for getting a grip with Photoshop and similar tools?


I am new in Javafx programming with java for graphic interfaces, and after research for possible solutions, i still have the problem  I've got this code in my Main Javafx App which extends Application   public void initRootLayout() throws IOException {             FXMLLoader loader;             Parent rootLayout;              loader = new FXMLLoader();                       loader.setLocation(getClass().getResource("/fiec/dst/seer/screen/login/login.fxml"));                    rootLayout = loader.load();             LoginController = (loginFXMLController)loader.getController();             // Show the scene containing the root layout.             Scene scene = new Scene(rootLayout);             primaryStage.setScene(scene);             primaryStage.setMaximized(false);             primaryStage.setResizable(false);             primaryStage.show();       }   LoginController is an instance of loginFXMLController which is the controller of fxml file that displays a login interface (user and password).  I don't know if i'm in the right path, but i have a method in Main class that needs to check if user and password are corrects(these attributes are in loginFXMLController), as you may see, first i call load method, and i need to ask constantly the values of user and password provided from LoginController.  initRootLayout is called in start method of Main Application       @Override     public void start(Stage primaryStage) throws IOException {          this.primaryStage = primaryStage;         this.primaryStage.setTitle("System");         initRootLayout();     }   I need help, because with these i'm getting the exception:  java.lang.NullPointerException when i call attributes from LoginController  This is de StackTrace :  java.lang.NullPointerException at fiec.dst.seer.main.RFIDReader.messageReceived(RFIDReader.java:323) at org.llrp.ltk.net.LLRPIoHandlerAdapterImpl.messageReceived(LLRPIoHandlerAdapterImpl.java:109) at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.messageReceived(AbstractIoFilterChain.java:570) at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299) at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53) at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648) at org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput.flush(SimpleProtocolDecoderOutput.java:58) at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:180) at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299) at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53) at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648) at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:220) at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:264) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51) at java.lang.Thread.run(Unknown Source)   MainApp extends from Application and implements LLRPEndpoint LLRPEndpoint contains methods to communicate with objects with RFID tags  This problem occurs when i try to get attribute from loginFXMLController (user and password)


So i have a hdri on, In the picture you can see the ceiling is completely brown but the shading is a non reflective white (Concrete), After checking on to it i found out that it is from the hdri. how do fix this while still retaining the hdri or how can i have my white ceiling?

I'm currently testing Eevee.  Seems so promising !  Here, i'm trying to make my Eevee render the closest I can to my previous render Cycles of the same scene. This scene do not have any lights but an HDRI background.  Thing is, the renders looks very, very different.  How can I improve this ?  Cycles:   Eevee:   And .  Thanks a lot.


My coworkers and I are having an argument regarding AI feeling emotions. Basically, the overarching question is whether or not AI will eventually be able to feel emotions. Here are the arguments.  First, we do not understand emotions within our own human brains, nor within any other living organisms. However, they do exist. These emotions could be produced with algorithms or could be produced using some method we cannot even comprehend. So, if centuries down the road, we do understand emotion, and program it into something, that AI could potentially feel emotion.  Second, AI is currently defined by, usually, something involving program code. However, if some day, we discover that it is more efficient or more productive to produce AI by building a neuron-connected system similar to the human brain, that would still be AI, though seeming rather similar to a real human brain.  So, from your perspective, does the possibility exist that AI can/will feel emotion at some point in the future?

According to the  video, researchers have been able to develop an AI unit that is able to experience emotional states, such as greed, hunger, and curiosity. If the AI is currently experiencing an emotion, it will engage in certain behaviors. For example, if Mario is very greedy, Mario will look for coins. This approach is very similar to the Sims video game series, where emotional states are also represented, and AI characters will attempt to fulfill those drives.  Now, I can concede that the Mario AI is effective at simulating emotions. The media, however, has gone beyond this. Two articles, in particular,  troubles me.       I can accept the idea of Mario 'learning'. I can even accept the idea that Mario is 'self-aware' within his own environment. But I cannot intuitively accept the idea that Mario is feeling any emotions. It seems weird to think that EA programmers and German AI researchers were both able to accomplish the dreams of science fiction writers all over the world, and without anybody ever noticing.  Maybe my intuition is wrong though, and maybe Mario is indeed feeling emotions (even if they are not the same emotions as humans feel).


I have a group of 5 players, 3 are long time veterans and we have been playing together for 15 years, the other is a newcomer who is actually liking the game a lot, and there's a 5th player that joined recently, the gf of one of the veterans. She is also new to roleplaying games.  I'm running an introductory and modified version of Wizard's amulet/Crucible of Freya (Chauntea) on the Forgotten Realms setting, adding a bit more detail and NPCs and preparing the background so the players put their eye on the Silver Marches. Everything was running smoothly until the new player joined the game. She seems to dislike everything that happens in the game. Roleplaying with the other players and with the NPCs at the town seemed to bore her, more action packed sessions like the assault on the orc infested fortress got her sleepy, and exploring a wizards sanctum and laboratory also looked unappealing to her.  Most of the time she stays quiet, and when me or another player ask her directly if she wants to do something she does, but just because she has to. Whats worst is that after 2 or 3 hours into the session, she starts arguing with her bf about gods know what, and that breaks the good atmosphere of the game and the session turns uncomfortable.  I don't really know what to do to make her enjoy the game. Maybe she doesn't like the other players, maybe she doesn't like me, or maybe she doesn't like the setting/adventure.  Any ideas on how to approach this situation?  Edit:  First, thanks everyone for the input. I guess asking her it's the first thing to do, but this behaviour was new to me and I wasn't sure what to do.   Scott, they started playing as level 1 characters, and she joined when the rest of the party were level 2 and yesterday they all progressed to level 3. We are only using the players handbook, DM guide, monster manual and Forgotten Realms setting and the Quintessential books for each class to add a little more flavour to the characters. Initially it was an introductory adventure for the new guy, so I wanted to keep it simple to give him a general idea of the setting and our game style.  The 3 veterans are playing a rogue, a bard and a druid (her bf). The other new guy started as a barbarian, and the new girl is playing a fighter. So far no player kills, they are being very VERY lucky (and smart) So far they have battled low level undead such as zombies, orcs, a low level necromancer and a 5th level cleric, so there are not a lot of rules floating around.  I'm all against creating encounters that take forever to resolve, I played Rolemaster for a long time and I learned to hate those kind of encounters that lasted for hours, so even if we are using an existing module I write everything in my book so I have a quick reference of everything at hand. I don't think it's a pace issue, as I try to focus more and what the characters want to do and less on the strict rules, although I use the rules for solving the situations, of course.  Edit 2: KRyan pointed a very similar thread so I think this one doesn't add much to the web. Now its me playing the newb. Ouch! So yeah, this question is very similar to the other one so close it. Thanks again for the input guys.

Game is DnD 3.5, not that it matters.   So, yeah, she is playing an Elf Rogue and she is like a ghost during the game.   In the last session, the party was searching for a guy and some Halfling told them that they can meet at midnight and he will take them to this guy. They went to the tavern and waited until it's midnight. The Ranger went early and climbed a tall building to check the surroundings. Wizard and Druid went to the meeting point, and when I asked Rogue what she wanted to do, she said "I go to sleep". I was like "Okay, you go to sleep" and then she literally went to sleep. LARPing at it's finest.  It happened one more time too. There was a lot of talking going on for some time, with PCs tying up two suspected Necromancers and trying to figure out who was the bad guy, and she just went to sleep.  While talking on our Whatsapp group, I was telling the players that I thought of something new. After each session, every player will award someone XP for good roleplaying, being active, etc. And I joked about trying not to award those who fall asleep during play. She suddenly got sensitive about my joke. Anyway, after that, I told the group to throw the old character sheets to garbage because there was a lot of stuff to update. and she said "I don't want XP. I'm sleeping during play anyway. I also lost my old character sheet."  Even when she plays, she is pretty much disinterested all the time. During combat, when she rolls one or two bad attack rolls, she is like "Well, I can't hit anyone anyway" and it's like we almost force her to roll the die. Then she starts playing with her phone while others make their move.  That's pretty much it. She still cares to come to the sessions at least. I'm setting up a quest about her character's background. If that doesn't work, I don't know what else I can do. I don't want to kick her out of the group but things are going in that way. It just downs everyone else in the group and kills the mood.  So, how do engage an uninterested player? If all fails, how do you deal with her?


I was trying to solve some change of basis exercises, so I've done them and I want you to tell me if I've done it correctly.     1) Given the coordinates system $(O'; X'' Y'')$ asociated to the   basis $B=[{b_1=\frac{1}{\sqrt{2}}; \frac{1}{\sqrt{2}};  > b_2=\frac{-1}{\sqrt{2}}; \frac{1}{\sqrt{2}}}]$ with origin in   $O'=(2;5)$, find the intersection between $Q: y''^2=-4 \sqrt{2} x''$   and the straight line $V=(0;5)+t(-1;1)     t\epsilon R$   Well, first I tried to write $Q$ in terms of $X$ and $Y$, and not in terms of $X''$ and $Y''$. I used the formula: $(\begin{matrix}     X''\\     Y'' \\     \end{matrix})$ =$(C)_B$ × $(\begin{matrix}     X-2\\     Y-5 \\     \end{matrix})$  Then I replaced those values in the equation of $Q$ and I got $Q: \frac{(-x+y-3)^2}{2}=-4 \sqrt{2} \frac{(x+y-7)}{\sqrt{2}}$  After that, I found the intersection between $Q$ and $V$ using equations and I got that the intersection points in $(O;XY)$ are $P_1(3;2)$ and $P_2(-1;6)$     2)Given the coordinates system $(O,X'Y')$ asociated to the basis   $B=[{b_1=\frac{1}{\sqrt{2}}; \frac{1}{\sqrt{2}}; > b_2=\frac{-1}{\sqrt{2}}; \frac{1}{\sqrt{2}}}]$ with origin in   $O=(0;0)$ and the ellipse $9X'^2+5Y'^2-3X'+2Y'-10=0$ find the   coordinates of the centre of the ellipse in $(O,XY)$   So, here I found the centre of the ellipse in $(O,X'Y')$ and it was $(\frac{1}{6}; - \frac{1}{5})$, then, doing something similar to what I've done before I found out that the centre in $(O,XY)$ was $( \frac{11}{30 \sqrt{2}};$ $\frac{-1}{30 \sqrt{2}}$)

I tried to solve the following exercises, so I want to ask you if my answers are correct.     1) Given the coordinates system $(O'; X'' Y'')$ asociated to the    basis $B=[{b_1=\frac{1}{\sqrt{2}}; \frac{1}{\sqrt{2}};  > b_2=\frac{-1}{\sqrt{2}}; \frac{1}{\sqrt{2}}}]$ with origin in    $O'=(2;5)$ and the system $(O;XY)$ asociated to the standar basis, find the intersection between $Q: y''^2=-4 \sqrt{2} x''$    and the straight line in $(O,XY)$ $V=(0;5)+t(-1;1) t\epsilon R$    Well, first I tried to write $Q$ in terms of $X$ and $Y$, and not in terms of $X''$ and $Y''$. I used the formula:  $(\begin{matrix}  X''\\  Y'' \\  \end{matrix})$ =$(C)_B$ × $(\begin{matrix}  X-2\\  Y-5 \\  \end{matrix})$   Then I replaced those values in the equation of $Q$ and I got $Q: \frac{(-x+y-3)^2}{2}=-4 \sqrt{2} \frac{(x+y-7)}{\sqrt{2}}$   After that, I found the intersection between $Q$ and $V$ using equations and I got that the intersection points in $(O;XY)$ are $P_1(3;2)$ and $P_2(-1;6)$      2)Given the coordinates system $(O,X'Y')$ asociated to the basis    $B=[{b_1=\frac{1}{\sqrt{2}}; \frac{1}{\sqrt{2}};  > b_2=\frac{-1}{\sqrt{2}}; \frac{1}{\sqrt{2}}}]$ with origin in    $O=(0;0)$ and the ellipse $9X'^2+5Y'^2-3X'+2Y'-10=0$ find the    coordinates of the centre of the ellipse in $(O,XY)$    So, here I found the centre of the ellipse in $(O,X'Y')$ and it was $(\frac{1}{6}; - \frac{1}{5})$, then, doing something similar to what I've done before I found out that the centre in $(O,XY)$ was $( \frac{11}{30 \sqrt{2}};$ $\frac{-1}{30 \sqrt{2}}$)


Is there any other bijection from $\mathbb{N}^{2}$ to $\mathbb{N}$ other than the pairing function? My search so far has come up empty.

I'm looking for a 'simple' bijection $$ \pi \colon \mathbb N_0 \times \mathbb N_0 \to \mathbb N_0, $$  where 'simple' in this context means that it should be as easy as possible to define and it should be self-evident that said function is in fact a bijection. It's a quest for convenience - not minimal complexity in any rigorous sense.  Here are a couple of examples I came up with - none of which satisfy both requirements:   Let $\pi(m,n) = c(2^m3^{n+1})$, where $c \colon \{2^m3^{n+1} \mid m,n \in \mathbb N_0 \}\to \mathbb N_0$ is the order isomorphism (or in fact Mostowski collapse) of its domain under the natural ordering, Let $\pi(m,n) = \langle n,m \rangle$ - Gödel's pairing function, Let $\pi(m,n) = m \oplus n$ - the number resulting from '' $m,n$ (where we imagine both $m$ and $n$ as in infinite decks of cards whose $i$th element is labeled with its respective $i$th digit). ...


I want to know how install and manage packages for TeX Live 2011 on Linux Open Suse; with Windows systems it is possible to manage packages for TeX Live with the Package Manager program included in the MiKTeX installation, but I don't now how to install and manage packages for TeX Live on Linux. I installed TeX Live 2011 with YaST2 Software Management but when I want execute the command tlmgr I get the following message:       dev@dhcppc1:~> tlmgr If 'tlmgr' is not a typo you can use command-not-found to lookup the package that contains it, like this:     cnf tlmgr   So, how I can manage packages if tlmgr is not found or does not work? How I can "reinstall" tlmgr?  My TeX Live version is: TeX, Version 3.1415926 (TeX Live 2011) My OS:  Open Suse 12.2

I'm trying to compile a document that only works with an up-to-date distribution, so I'd like to know: how do I update my distribution? Please provide screenshots where appropriate.  List of answers           To keep an eye on what’s going on at CTAN you may subscribe to the  or the RSS feed feed://www.mail-archive.com/ctan-ann@dante.de/maillist.xml


Due to some questions of questionable quality from the times when I was still at school I am unable to post questions on Stack Overflow. I want to make my amends and the  suggest I should "begin by fixing my existing questions".  What if the only problem with the question was that it was deemed to be a duplicate (e.g. )? There is literally nothing I could change about the question to make it a non-duplicate unless I am willing to totally change the subject, which would be counterproductive.

If I were in danger of being banned from asking questions, I'd be advised:     ... Also, edit your previous questions to improve formatting and clarity.   It happened to me, very recently. At the time, I only had three questions here on Meta SE. To quote Shog:     That's one positively-received question, followed by two duplicates - the last downvoted and deleted.   How do I improve a question marked as a duplicate?   Rewrite it to something else? Maybe that's gaming the system but at least its a way out. Rewrite it so that it is better than its predecessor? At least then it can maybe serve as a useful landing spot for a search engine result where the search terms matched it rather than the original. Get into the time machine, go back to just before posting the duplicate, do a better job of searching for alternate wordings of the question, then not post it? The only problem being, the Stack Exchange's search engine is, how to put it, far from perfect. Oh yes, and the time machine thing. Forget about it improving "duplicates" -- focus on improving deleted questions instead? How do I manage that?   Please, rethink the way you handle question banning warnings.


I'm trying to set up Kubuntu 11.10 so I can type Japanese. I've searched online but have had little luck. My installation is fresh so it'd be great if someone could walk me through it and tell me how to do it from the beginning.

I have a new fresh Kubuntu installation. I have used Linux Mint and Ubuntu before, those OS have GUI settings for input method, where I can choose ibus or fcitx and type Vietnamese (my language, we use  to type Vietnamese).  I did install ibus-teni, I can run ibus from Search tool, but couldn't type Vietnamese. So how do I setup the input method from default to ibus? Why does Kubuntu not have GUI settings for it like Ubuntu?


As a mathematics graduate student whose research area lies in low-dimensional topology (more precisely, invariants of 3-dimensional topological manifolds), I heard that there exist multiple applications of this theory to theoretical physics, and moreover, that many mathematical problems in the field actually arise from physical ones.  I would appreciate any examples of such applications/motivation, and references to textbooks (or articles which don't require a deep knowledge of physics) where I could read more on the subject.

I have always wondered about applications of Algebraic Topology to Physics, seeing as am I studying algebraic topology and physics is cool and pretty. My initial thoughts would be that since most invariants and constructions in algebraic topology can not tell the difference between a line and a point and $\mathbb{R}^4$ so how could we get anything physically useful?  Of course we know this is wrong. Or at least I am told it is wrong since several people tell me that both are used. I would love to see some examples of applications of topology or algebraic topology to getting actual results or concepts clarified in physics. One example I always here is "K-theory is the proper receptacle for charge" and maybe someone could start by elaborating on that.   I am sure there are other common examples I am missing.


I need to build an server (Ubuntu 9.10 server) to host source control (subversion) from my house.  What are the minimum specs (processor and RAM) to do this with good performance?  I'll need to buy some new parts from newegg and just need enough to get by.  It may also serve as a file server for other things in the future, but nothing intensive like media streaming.  I only need about a 1GB repository, and 2 or 3 users.

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?


Hello I just setup a ubuntu server running samba and I want it to shut down every night at 11PM.   I'm using this command in crontab 30 9    * * *   root   shutdown -h now   but its not running the command at the desired time.   Thanks in advance!

I'm aware I can use (sudo?) shutdown -h hh:mm in a terminal window to shut down a system, however the user that is logged in is a kiosk user, which is locked down in such a way that terminal (or any window other than firefox, for that matter) cannot be opened.  My question is: Is there a way I can do this without having a terminal window opened? I've read about cron, but can't quite work it out. How can I change the shutoff time depending on what day it is?


As a graduate student I switch between many tasks during each week. My activities consist of attending classes, doing homework, grading, working on my research and studying for exams. However I notice that from time to time I tend to procrastinate and this happens mostly when I have to switch from one task to another or when I feel that a task is difficult and I am not yet sure of how to handle it. It also may occur when I work at home in Sundays or when unexpected lab meetings interrupt me from my schedule.  My situation is not that I do not feel productive, but some hours per week can be lost due to this issue (which is an important thing).  In general the main idea of my problem is: I tend to procrastinate when switching tasks.  To protect me from distractions I have installed browser plug-ins that do not allow me viewing distracting websites more than 5 minutes per day. I also try to keep track of how much time I spend on each task and have established a relatively stable weekly program.  However I believe I could benefit from better time management advices to handle procrastination...  What are your suggestions ?  p.s. Sometimes what also takes time, is communicating with family and friends. I am an international student and I dont want to lose touch with my people. Although I have a relatively steady pattern of communication with them (usually within weekends) nostalgia beats me wanting more discussion.  ----EDIT---- Most answers seem to suggest micromanagement time approaches. However I believe that micromanagement tends to take a lot of time too. How can you reduce effectively the time it takes to make a schedule for a specific day ?

I just finished all of my coursework for my PhD program, and am entering the research phase of my degree with a topic already in mind.  I've already started the research, but I'm already finding that I end up procrastinating a lot of my time away.  When I was taking courses, I felt like i didn't have time to procrastinate because of the pace of the classes and I felt like I had to always keep up with the pace.  But now that I have no specific constraints, I feel like its harder to pace myself.    Of course, I know it's a bad habit to procrastinate and I should probably devote most of my waking hours to my research.  Sometimes, (especially when I get stuck) I find it's so easy to get distracted on the computer (websites, youtube, text messages, etc.).    What are some effective strategies to avoid procrastination during this research phase?  How do you stay on task, especially when you get stuck?


i was coding a puzzle program. When i compiled my Java program, it was successful. But when i run it, it shows   Solution to problem using breadth first : Exception in thread "main" java.lang.NullPointerException  at SolvingProblem.isGoal(SolvingProblem.java:24) at AbstractTreeSearch.solve(AbstractTreeSearch.java:31) at EightP.main(EightP.java:15)   I spent several hours and fixing the code but unsuccessful. Ideally, it is supposed to show 3x3 array configuration. Could anyone help me here and point out what is the problem?  State initialState = new State(State.arrayA); State GoalState = new State(State.arrayG);  @Override public Object getInitialState() {     return initialState; }  @Override public boolean isGoal(Object state) {     return state.equals(GoalState); }   Another class below    public Node solve(Problem problem) {      //initialize the search tree using the initial state of problem     frontier = initFrontier();     frontier.addAll(expand(new Node(problem.getInitialState()), problem));     //Starting frontier     boolean done = false;     Node solution = null;     while (!done) {         if (frontier.isEmpty()) {             System.out.println("Blank frontier");             done = true;         } else {             Node node = chooseLeafNode(frontier, problem);             //inspecting node             if (problem.isGoal(node.getState())) {                 System.out.println("Solution found");                 System.out.println();                 solution = node;                 done = true;             } else {                 //Expanding node, frontier is..                 frontier.addAll(expand(node, problem));              }         }     }

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 want to store chinese characters from an html page into oracle database using ajax concept.  Front end : HTML & PHP. Back end  : Oracle 11G.   Oracle Characteristics:  NLS_LANGUAGE = AMERICAN NLS_CHARACTERSET = AL32UTF8 NLS_NCHAR_CHARACTERSET = AL16UTF16   The above characteristics cannot be changed.   when i try to store chinese character using form submit it's storing successfully, if i try to store through ajax i am getting weird characters in the database.  in the ajax page i have added this line:  header("Content-type: text/html; charset=utf-8");   and in the html page added the below line:  <meta http-equiv="Content-type" value="text/html; charset=utf-8">   i have gone through many stack overflow suggestions but no luck.  please advice me on how to solve this.  Thanks in advance.  Code:HTML Code.  <html> <head> <meta http-equiv="Content-type" value="text/html; charset=utf-8"> <title>Test</title> <script src="jquery.min.js"></script> <script> function addForm() { var english=document.getElementById('txt_english').value; var id=document.getElementById('txt_id').value; var chinese=document.getElementById('txt_chinese').value; $.ajax( {     type : "POST",     async: false,     url :"ajax/ajax_add_form.php",     data :     {     english:english,     chinese:chinese,     id:id     } }).done( function(html) {         alert(html);  }); } </script> </head> <body> <input type='text' name='txt_id' id='txt_id' value='' /><br> <input type='text' name='txt_english' id='txt_english' value='' />                           <input type='text' name='txt_chinese' id='txt_chinese' value='' />  <button type="button" onclick="addForm()">Click Me!</button>  </body> </html>   PHP Code: ajax/ajax_add_form.php  <?php header("Content-type: text/html; charset=utf-8"); include("../config.php"); extract($_REQUEST); $sql=oci_parse($conn,"insert into test(id,english,chinese)values('".$id."','".$english."','".$chinese."')"); oci_execute($sql); echo "success"; ?>

I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1.  Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur?  This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2.


I am quite confused by . At the time that I am writing, it states that:   Review completed 9 hours ago:; two lines below, it says that a certain user “reviewed this 9 hours ago”. However, between those two lines, it says that that another user reviewed the answer a few minutes ago.   How can someone review a Late Answer hours after the review was completed?

This is a revisit of  that seems to have grown stale without any solid answer. Just recently I was baffled by 's ability to :  In my experience, certain review queues seem to be more inclined to "single-user reviews" (like First Posts and/or Late Answers), while others are more geared to "multi-user reviews" (like Close Votes and/or Suggested Edits). This does not seem to be the case here. The "requirement" for such late, duplicate reviews are questionable and               (         ). Even being able to  (I highly doubt this was an instance of keeping the review window open for more than an hour and only reviewing it post mortem - first post reviews are dealt with far more quickly than most other review queues):   While these examples do not speak to the , it sure seems biased. Something is amiss... Over at  we have a far smaller community, so these situations are far more noticeable.  Edit: The following are all candidates for the above discussion:


I write application for studies, i am not experienced with c/c++. I have problem with call callback function, when I try call callback function i have an error  invalid use of non-static member function      if(pcap_loop(handle, 1, got_packet, NULL)<0){  Here is my callback function:  void got_packet(u_char *args, const struct pcap_pkthdr *header, const u_char *packet)     {         static int count = 1;             fprintf(stdout,"%d, ",count);             if(count == 4)                 fprintf(stdout,"Come on baby sayyy you love me!!! ");             if(count == 7)                 fprintf(stdout,"Tiiimmmeesss!! ");             fflush(stdout);             count++;     }   this is how I call this function      int CapThread::capture() {      char *dev, errbuf[PCAP_ERRBUF_SIZE];      dev = pcap_lookupdev(errbuf);      QString filter_expression = "udp and ip dst host "+ui->ip_addr->text();     QByteArray byte_array =filter_expression.toUtf8();      const char *filter_exp = byte_array.data();      struct bpf_program fp;       bpf_u_int32 mask;            bpf_u_int32 net;        /* The IP of our sniffing device */     struct pcap_pkthdr header;       struct ether_header *eptr;       struct udphdr *udp_header;       const u_char *packet;        struct ip *ip;     struct rtp_header *rtp_header;       u_char *ptr;      if (pcap_lookupnet(dev, &net, &mask, errbuf) == -1) {         fprintf(stderr, "Couldn't get netmask for device %s: %s\n", dev, errbuf);         net = 0;         mask = 0;         return(1);     }      pcap_t *handle;     handle = pcap_open_live(dev, BUFSIZ, 1, 1000, errbuf);     if (handle == NULL) {         fprintf(stderr, "Couldn't open device %s: %s\n", dev, errbuf);         return(2);     }      if (pcap_compile(handle, &fp, filter_exp, 0, net) == -1) {         fprintf(stderr, "Couldn't parse filter %s: %s\n", filter_exp, pcap_geterr(handle));         return(3);     }     if (pcap_setfilter(handle, &fp) == -1) {         fprintf(stderr, "Couldn't install filtecho deb http://repository.spotify.com stable non-free | sudo tee /etc/apt/sources.list.d/spotify.lister %s: %s\n", filter_exp, pcap_geterr(handle));         return(4);     } //    packet = pcap_next(handle, &header); //    pcap_loop(handle,5,got_packet,NULL);     if(pcap_loop(handle, 6, got_packet, NULL)<0){         qDebug()<<"got packet";     }      pcap_close(handle);     return 0; }   this is how my header file look like:      #ifndef CAPTHREAD_H #define CAPTHREAD_H #include <pcap.h> #include <netinet/ether.h>  //plik nagłówkowy umożliwiający przekonwertowanie danych z nagłówka na kod ASCII #include <netinet/ip.h>     //plik zawierający struktury nagłówka IP i umożliwiający przekonwertowanie danych z nagłówka na kod ASCII #include <net/ethernet.h> #include <netinet/udp.h> #include <arpa/inet.h> #include <QDebug> #include <iostream> #include <stdio.h> #include "ui_mainwindow.h"  class CapThread { public:     CapThread();     CapThread(Ui::MainWindow *ui);     ~CapThread();     void got_packet(u_char *args, const pcap_pkthdr *header, const u_char *packet);     int capture(); private:     struct rtp;     Ui::MainWindow *ui;     char *dev, errbuf;     pcap_t *handle;     char filter_exp[];     struct bpf_program fp;     struct ether_header *eptr;     bpf_u_int32 mask;     bpf_u_int32 net; };   #endif // CAPTHREAD_H   actually i am out of ideas, can someone help me?

I'm using an API that requires me to pass a function pointer as a callback. I'm trying to use this API from my class but I'm getting compilation errors.   Here is what I did from my constructor:  m_cRedundencyManager->Init(this->RedundencyManagerCallBack);   This doesn't compile - I get the following error:      Error  8 error C3867: 'CLoggersInfra::RedundencyManagerCallBack': function call missing argument list; use '&CLoggersInfra::RedundencyManagerCallBack' to create a pointer to member   I tried the suggestion to use &CLoggersInfra::RedundencyManagerCallBack - didn't work for me.   Any suggestions/explanation for this??  I'm using VS2008.  Thanks!!


If a single subatomic hypothetical fundamental particle incapable of decay (such as an electron) with a mass exceeding Planck mass possessed angular momentum and it collapsed into a black hole, would it be a Kerr ring black hole?

Let's say I have the ability to crunch a given quantity of particles into a black hole.  I now use a sizeable quantity of electrons to do this, with the restriction being that all of them have $+\frac{1}{2}$ spin.   Apart from the charge, does this intrinsic angular momentum exhibit itself in the black hole?  Would the resulting black hole resemble a Reissner–Nordström black hole or a Kerr-Newman black hole?   Would it be different from a black hole that I make out of equal amounts of $+\frac{1}{2}$ and $-\frac{1}{2}$ electrons? It should be, shouldn't it? (because the information about those spins should be conserved)


I want to migrate data contained in an Oracle Table A to SQL Server. The table A contains a column CIN with unique constraint but mutliple null values. The problem is that SQL Server is rejecting the data. Is there any workaround for this ?

Technically, NULL = NULL is False, by that logic no NULL is equal to any NULL and all NULLs are distinct. Shouldnt this imply that all NULLs are unique and a unique index should allow any number of NULLs?


I want to display all the dates between two dates for a particular record  And this is the table :  ID Start_Date  End_Date ------------------------- 1  2013-01-14  2013-01-18 2  2013-02-01  2013-02-04   and now i want to get all the dates between from date and to date.  Expected output  ID Date ------------- 1  2013-01-14 1  2013-01-15 1  2013-01-16 1  2013-01-17 1  2013-01-18 2  2013-02-01 2  2013-02-02 2  2013-02-03 2  2013-02-04   any help will be appreciated

Using standard mysql functions is there a way to write a query that will return a list of days between two dates.  eg given 2009-01-01 and 2009-01-13 it would return a one column table with the values:   2009-01-01   2009-01-02   2009-01-03  2009-01-04   2009-01-05  2009-01-06  2009-01-07  2009-01-08   2009-01-09  2009-01-10  2009-01-11  2009-01-12  2009-01-13   Edit: It appears I have not been clear. I want to GENERATE this list. I have values stored in the database (by datetime) but want them to be aggregated on a left outer join to a list of dates as above (I am expecting null from the right side of some of this join for some days and will handle this).


A fairly self explanatory title; do Tarski's first order axioms given in his famous 'What is Elementary Geometry?' Suffice to prove all of the theorems in Euclid's Elements? (Excluded non-plane geometric theorems).   Now, Euclid spends a considerable amount of time using geometry to develop number theory systematically, including the theory of primes and the like. Tarski proved his axioms complete, but if his axioms suffice for all Euclidean geometry, how does this not contradict Godel's incompleteness theorem since a theory that contains number theory is certainly strong enough for Godel incompleteness to appy?

In David Hilbert's 1899 Grundlagen der Geometrie, Hilbert gives a rigorous axiomatization of Euclidean geometry. As I understand it, some of Hilbert's axioms must be expressed in second order logic (for example his "Euclid's axiom") and as his system contains some notion of arithmetic (this is perhaps not correct?), by Gödel's first incompleteness theorem this means that Hilbert's axiomatic system is incomplete (meaning that there exist statements expressed by the vocabulary of the system that cannot be proven to be true) and by Gödel's second incompleteness theorem, his system cannot demonstrate its own consistency.  Later, Tarski gave his own axiomatization of Euclidean geometry that is entirely in first order logic so by Gödel's completeness theorem, it can demonstrate its consistency, it is decidable and complete.   Is the above accurate and if so, is Tarski's axiomatic system still inferior in some ways to Hilbert's (with a lack of expressive power or doesn't cover the entire Euclidean geometry as we understand it)?


When creating something like a vehicle or any other object with parts that stick out like mirrors, wheels, spoilers, how do you know what else should be a separate object. Example mug tutorials build the mug and the handle as a separate object why does this need to be separate, all I can think of is its less work. New to blender but I got stuck with adding detail.

Is there any benefit of creating model in one piece or I can create separate pieces and just overlap them to create a visually joint part.  For example, the below image were made from two parts 1. Blade 2. Spinner  Is there any benefit to model them (e.g. extrude from the spinner) or it is actually ok to have them separated since visually I can achieve the same effect (See picture 2)


Is there a function in mysql that would return all items in just one row?  EXAMPLE:  Table:  | id | name | ------------- | 1  | john | | 2  | mike | | 3  | jane |   Query:  SELECT concat_name(name) FROM tbl_name   concat_name as the function.   Expected Result:  |       name      | ------------------- | john, mike, jane|

Using MySQL, I can do something like:  SELECT hobbies FROM peoples_hobbies WHERE person_id = 5;   My Output:  shopping fishing coding   but instead I just want 1 row, 1 col:  Expected Output:  shopping, fishing, coding   The reason is that I'm selecting multiple values from multiple tables, and after all the joins I've got a lot more rows than I'd like.  I've looked for a function on  and it doesn't look like the CONCAT or CONCAT_WS functions accept result sets.  So does anyone here know how to do this?


Let $F:\mathbb{R^2}\rightarrow \mathbb{R}$ be a function, such as : $$F(x,y)=\begin{cases}        0 & (x,y)=(0,0) \\       \frac{xy}{x^2+y^2} & (x,y)\neq (0,0)    \end{cases}$$      Is $F$ differentiable at $(0,0)$?   My attempt :  Consider the limit, $\lim_{(x,y)\rightarrow (0,0)} F(x,y)$ along the line $y=x$. The limit equals to $\frac{1}{2}$. However, $F(0,0)=0$. Hence $F$ is not continuous at $(0,0)$ which implies that $F$ isn't differentiable as well.  Is this approach okay ?

$$f(x,y) = \left\{\begin{array}{cc} \frac{xy}{x^2+y^2} & (x,y)\neq(0,0) \\ f(x,y) = 0 & (x,y)=(0,0) \end{array}\right.$$  In order to verify if this function is differentiable, I tried to prove it by the theorem that says that if $\frac{∂f}{∂x}$ and $\frac{∂f}{∂y}$ exist and are continuous at the point $(x_0,y_0)$, then the function is differentiable at this point. So I did:  $$\frac{\partial f}{\partial x}(0,0) = \lim_{h\to 0}\frac{f(0+h,0)-f(0,0)}{h} = 0$$ $$\frac{\partial f}{\partial y}(0,0) = \lim_{h\to 0}\frac{f(0,0+h)-f(0,0)}{h} = 0$$  so we have that the partial derivatives at point $(0,0)$ is $0$. Now, if we take the derivative at $(x,y)\neq (0,0)$ and then take the limit of it as $(x,y)\to(0,0)$, we can see if the derivatives are continuous or not. So here it is:  $$\frac{\partial f}{\partial x}(x,y) = \frac{y(y^2-x^2)}{(x^2+y^2)}$$  but   $$\lim_{(x,y)\to(0,0)} \frac{y(y^2-x^2)}{(x^2+y^2)} $$ does not exist (by wolfram alpha... but can anybody tell me an easy way to prove this limit does not exist? easier than taking the limit in different directions?), therefore the derivative is not continuous at $(0,0)$, so we can't say $f$ is differentiable at $(0,0)$, but for $(x,y)\neq (0,0)$ the function is continuous, as it is a quotient of continuous functions. So $f$ is at least differentiable at $(x,y)\neq (0,0)$.   Now, to verify differentiability at $(0,0)$ I think we must use the limit definition of differentiablity: A function is differentiable at $(0,0)$ iff: $$\lim_{(h,k)\to (0,0)} \frac{f(0+h,0+k)-f(0,0)-\frac{\partial f}{\partial x}(0,0)-\frac{\partial f}{\partial y}(0,0)}{\|(h,k)\|} = 0$$  Let's calculate this limit:  $$\lim_{(h,k)\to (0,0)} \frac{f(0+h,0+k)-f(0,0)-\frac{\partial f}{\partial x}(0,0)-\frac{\partial f}{\partial y}(0,0)}{\|(h,k)\|} = \\ \lim_{(h,k)\to (0,0)} \frac{\frac{hk}{h^2+k^2}}{\sqrt{h^2+k^2}} = \\ \lim_{(h,k)\to (0,0)} \frac{hk}{(h^2+k^2)\sqrt{h^2+k^2}}$$  which I think, it's a limit that does not exist, therefore the function isn't differentiable at $(0,0)$


I thought this would be a popular question but couldn't find it here so if you do please let me know.  My mother just got a new HTC Inspire and is brand new to using a data plan.  Since she is worried that she might go over her cap I want to know how can she track how much data she has used in a certain time (preferably within a billing period). I am on Sprint so I've never had to worry about how much data I use. My question is: Can you recommend a method to manage/track data?  Also, I figure that apps like weather and news should be changed to check less frequently... any other default apps that should be changed to check less frequently?  Thanks for the help

I would like to monitor how much data-traffic I use. How?


I know that a question about why the photon is massless already exists, however it did not answer this question.  First off, I do understand why the photon does neither have a bare mass term due to gauge invariance of the standard model lagrangian nor does it get mass from the Higgs mechanism.   However as far as I understood it particles generally can get loop corrections to their mass (e.g. possibly generating neutrino masses). Since I am not really familiar with this mechanism I would like to know why there seem to be no loop corrections to the photon mass. Do they cancel out or am I just missing something obvious.  I'd also appreciate a link to a review-paper or book chapter dealing with this.

The Higgs boson and gluons have no electric charge and photons couple to charge, so there is no tree level interaction between them and photons.  But what prevents higher order diagrams from contributing a non-zero mass term to the photon, for instance    where a photon couples to some fermion (say an electron, or a top quark) which can interact with the Higgs field.   Or consider that same diagram but with quarks and a gluon interacting between them? Or any higher diagram with even more loops?  I have heard charge conservation depends on gauge invariance, which in turn depends on photons being massless.  So it appears the photon has no mass, and these diagrams must all cancel somehow.  So I'm hoping there is a very nice symmetry explanation for why they all disappear, but if I say "because of gauge invariance" that would be circular logic, so there must be another symmetry at stake here?     What prevents photons from obtaining a mass from high-order self-energy loop diagrams?


I stumbled upon this method  Clipboard.GetDataObject()   It returns an IDataObject so I figured there (maybe) was already a Class implementing the IDataObject Interface in the .net framework, but how can I find it?

Using reflection, how can I get all types that implement an interface with C# 3.0/.NET 3.5 with the least code, and minimizing iterations?  This is what I want to re-write:  foreach (Type t in this.GetType().Assembly.GetTypes())     if (t is IMyInterface)         ; //do stuff


After doing some change As Mr Vérace told me here , by changing the id names of each table into table_name_id and using the singular notation, I still need your opinion about this database and if it is ok to start with for a dentists application.    Here is some information about it  I added a table called dentist_info to add information about each dentist.  Login Table contain login information for dentists (it may be used by multiple dentists online)  The id_logged column is a foreign key of the id of logged in dentists, and it should be in all tables. (To let dentists see only their own patient info and details).  The patient_id column is a foreign key too. And it is taken from patient table and used as foreign key in med_history that represents the general medical information of the patients, patient_info that represents the general information, and the reason of visit and what tasks to do, and in the appointment table.  I have 2 questions:  1- Is there more than that information to add for a dentist database?  2- Is this database correct? Or are there errors?

I have a homework, where I should create a database for a dental clinic using MySQL Workbench. This database will be used later for a web app for dentists.  Here is a picture of the database design:    Login Table:  Contain login information for dentists (it may be used by multiple dentists online)  The id_logged column is a foreign key of the id of logged in dentists, and it should be in all tables. (To let dentists see only their own patient info and details).  The patient_id column is a foreign key too. And it is taken from patient table and used as foreign key in med_history that represents the general medical information of the patients, patient_info that represents the general information, and the reason of visit and what tasks to do, and in the appointment table.  I have 2 questions:  1- Is there more than that information to add for a dentist database?  2- Is this database correct? Or are there errors?


I would like to know what triggers a question ban? Is it based on votes?  After self deleting a question on programmers, I got a question ban. What's the reason?  This question is submitted at MSO : "The only advice I could give is to consider posting on Meta Stack Overflow since the algorithm is used across the network. Is it weird that a self-deletion triggered it..."

I've tried to make some search but I couldn't find an answer.   Is it possible to incur in a question ban with only one downvoted question?


Let us define Fibonacci Numbers as: $F_1=F_2=1,F_n=F_{n-1}+F_{n-2}$ for $n>2$.  $F_1$,$F_2$, and $F_{12}$ are perfect squares.     Find the least integer $n>12$, if any, such that $F_{n}$ is a perfect   square.        If there is no integer $n>12$ for which $F_n$ is a perfect square,   then prove that.     I tried using Microsoft Excel, I found that $F_{51}$ is close to be a perfect square, but it is not.  I tried to use the parabola $y=x^2-x-1$ (the roots of which are the golden ratios $1.618...$ and $-0.618...$) somehow, but it was not helpful for me.

Are there Fibonacci numbers other than $F_0 = 0 = 0^2, F_1 = F_2 = 1 = 1^2,$ and $F_{12} = 144 = 12^2$ which are square numbers? If not, what is the proof?


I have an issue with LibreOffice Calc. When I try to start the application, it doesn't show up. I do have the icon in my dock indicating that it is running. If I click the icon, nothing happens. Holding the key-comb for tabbing through Windows does show an open window, but it can't be selected. All other LibreOffice applications, e.g. Writer, do work without any issue. I am on kernel 5.4.0-47-generic with Ubuntu 20.04. I have already tried the following steps:  sudo apt purge libreoffice && sudo apt install libreoffice Manually deinstaling and installing through the software center (no snap!) Upgrading to openjdk-14-jdk (that was a tip in the LibreOffice forum) Starting the application from terminal with libreoffice --calc  For sanity, I tried in a VM and it works there without a hassle. I am confused.

I moved the LibreOfficeCalc window from full width to my other screen and suddenly it became just a line:   Now I cant find it on my desktop anymore:  The problem is, even if I close the LibreOfficeCalc from the navbar and reopen it again, its still not visible. Probably because it saved the "line" width as default. I can't find anything to click and expand on my desktop. What can I do so I can use it again? I already tried to remove and reinstall it, but the issue remains. Every file that I open is now a line.


I'm trying to stop the foreach when $counter reaches 5 , but i can't , i've tried to change the "break;" place , my try/catch inside the if,  but with no success, i keep getting 103 games(image) and I only want 5 .........     $leagues= $api->getLeagueEntries("RANKED_SOLO_5x5", "Gold", 'I');           $counter = 0;           foreach ($leagues as $t=> $op) {          if (++$counter < 5) {                      }                 try {                     $account_id = $api->getSummoner($op->summonerId);                     $date = time();                     $ab = $api->getMatchlistByAccount($account_id->accountId,  "420", null, null, $date, NULL, null, null, null);                               echo "<pre>" ; var_dump($ab);   echo "<pre>" ;                       break;                 } catch (Exception $e) { }             }

I have a loop that is doing some error checking in my PHP code. Originally it looked something like this...  foreach($results as $result) {     if (!$condition) {         $halt = true;         ErrorHandler::addErrorToStack('Unexpected result.');     }      doSomething();  }  if (!$halt) {     // do what I want cos I know there was no error }   This works all well and good, but it is still looping through despite after one error it needn't. Is there a way to escape the loop?


In the scene in Shutter Island where Dicaprio's character interrogates an old patient, she asks for water. After a while, Chuck gets her a glass of water, which is nowhere to be seen as she drinks from it.  Am I blind? Or isn't there a real glass? And if so, it's too hard to be an error. It must have been done on purpose. So what does it mean?

In the movie Shutter Island, there is a scene where a lady during interrogation asks for a glass of water. However, when she drinks the water, there is no glass at all. A moment later, the glass reappears. I also noticed, on the table, there are "water prints" (I'm not sure how they are called in English) of the glass.                                   I wonder, what is the meaning of this "no-glass scene", and what is the meaning of "water prints" (in the video above, you can see them at 0:07) on the table?


Some spells are mostly beneficial to the rest of the party. My question is to figure out whether or not the caster benefits from this as well.   Take for example the first level spell Color Spray, which has a casting time of one action and a duration of one round:     A dazzling array of flashing, colored light springs from your hand.    Roll 6d10, the total is how many hit points of creatures this spell can effect. Creatures in a 15-foot cone originating from you are affected in ascending order of their current hit points (ignoring unconscious creatures and creatures that can’t see).       Starting with the creature that has the lowest current hit points, each creature affected by this spell is blinded until the spell ends. Subtract each creature’s hit points from the total before moving on to the creature with the next lowest hit points. A creature’s hit points must be equal to or less than the remaining total for the creature to be affected.    Since the spell takes one action to be cast and then has a duration of one round, is it correct to assume that its effects take place at the very end of the caster's turn, thus lasting until the end of its next turn as well?   The way I see it, this means that at the caster's next turn, right before the duration ends, the enemy will still be blinded and he/she gets advantage on an attack as well.  I'd love to hear your opinions/experiences with this.  Note: This is not a duplicate, I found  question on the site as well, but this does not answer my question since in my opinion a barbarian's rage starts instantly, so at the beginning of his turn or at the beginning of his bonus action, right in the middle of a turn, whereas a spell takes a while to cast and -then- starts.

The Rage class feature of the Barbarian allows you to rage for one minute given you either took damage or attacked every round. A round is defined as a 6-second interval. So the rage can last up to 10 rounds. Now my question is, does it end at the end of your 10th round or at the beginning of your 11th round? There are other effects like that, also concentration spells with the duration of 1 or 10 minutes. Sometimes those are activated before combat starts and end during combat. In general: Does an effect/concentration end at the end of your last turn during the timespan or at the beginning of your first turn after the timespan?


I know from  that at one stage Luke attempted to visit the temple on Coruscant, But did Luke ever visit the Jedi temple on Coruscant?

After the New Republic gains control of Coruscant through the Galactic Concordance, did Luke Skywalker attempt to reclaim (or even visit) the former and still very much intact Jedi Temple, now converted to be the deceased Emperor's palace?   If Luke is so insistent on saving a tree just because it belongs to the Jedi and the Empire stole it, then shouldn't reclaiming the Jedi Temple be even higher priority?  If he did, is he aware of the Sith shrine beneath it? Which is something even Yoda does not know. And if he didn't, why didn't he?


I have the following code...  namespace ConsoleApplication2 {     public delegate void Task();      class Scheduler     {         private List<Task> tasks = new List<Task>();          public void AddTask(Task myTask)         {             tasks.Add(myTask);         }          public void Start()         {             foreach (var task in tasks)                 task();         }     }      class Program     {         static void Main(string[] args)         {                         var list = new List<string>() { "A", "B", "C" };             var scheduler = new Scheduler();             foreach (var item in list)             {                 scheduler.AddTask(() => { Console.WriteLine(item); });             }             scheduler.Start();         }     } }   The output is...  C C C   However, if I change the foreach part of the Main method to this:      foreach (var item in list)     {         var i = item;         scheduler.AddTask(() => { Console.WriteLine(i); });     }   I get the following output:  A B C   My noobish assumption was that both programs should generate the same output. Can someone please explain why it's behaving that way?

I met an interesting issue about C#. I have code like below.  List<Func<int>> actions = new List<Func<int>>();  int variable = 0; while (variable < 5) {     actions.Add(() => variable * 2);     ++ variable; }  foreach (var act in actions) {     Console.WriteLine(act.Invoke()); }   I expect it to output 0, 2, 4, 6, 8. However, it actually outputs five 10s.  It seems that it is due to all actions referring to one captured variable. As a result, when they get invoked, they all have same output.  Is there a way to work round this limit to have each action instance have its own captured variable?


can I put a double 50 amp pole in a 100 amp box


I'm trying to calculate the frequency of overlapping lines.   The question is pretty identical to the illustration show here   However I have no python programming skills, so any advice or guidance on achieving a similar result would be a great help.  I'm using ArcGIS 10 Basic.

I have number of persons located on a road network and I have calculated their shortest distance to a particular location.  From the routes output created from Closest Facility can I   break the routes down into the individual arcs traversed by each person? assign each arc a count attribute indicating the number of individuals who use that arc to get to their destination?   I am using Network Analyst in ArcGIS 10.2 for Desktop.


I am getting this error - java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference at com.example.meetup.HomeActivity.onOptionsItemSelected(HomeActivity.java:100)   @Override public boolean onOptionsItemSelected(@NonNull MenuItem item) {     switch (item.getItemId()) {         case R.id.Settings_btn:             return true;         case R.id.Logout_btn:             Dialog dialog = new Dialog(HomeActivity.this, R.style.Dialog);              dialog.setContentView(R.layout.dialog_layout);             Button yes, no;             yes = findViewById(R.id.yesBtn);             no = findViewById(R.id.noBtn);              yes.setOnClickListener(new View.OnClickListener() {           //**ERROR**                 @Override                 public void onClick(View v) {                     FirebaseAuth.getInstance().signOut();                     startActivity(new Intent(HomeActivity.this, LoginActivity.class));                 }             });             no.setOnClickListener(new View.OnClickListener() {                 @Override                 public void onClick(View v) {                     dialog.dismiss();                 }             });             dialog.show();             return true;     }     return super.onOptionsItemSelected(item); }

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?


In the aftermath of the space shuttle Challenger explosion, where seven crew members were killed, the NASA program underwent a massive examination of priorities.   My SAT grammar book claims that where is incorrect and should be replaced with in which.   I tried googling the difference, and the answers have been saying those two are practically the same. I was wondering if it was not the case with this sentence?

In my mother tongue I can use the word where not only to describe something connected to a location, but also to substitute in which.   My question is: Is it correct to use where in a sentence like this?       Describe a situation where you had to show leadership.   Or it would be better to use in which instead?


When you \RequirePackage{foo} in a document class, this "loads" the package so you can start using it. But what if you don't want to do that? What if you only want to ensure it is available for loading, e.g. for other code to be able to \usepackage{foo} later on?  Is that possible?  Motivation: I'm going to be  within a document class, but I do want to fail immediately if the package isn't there so as not to confuse whoever is reading the logs.

I am writing a program, and I want it to do different things depending on which LaTeX packages have been installed.  My current solution is to automatically generate simple .tex files that \usepackage the packages I care about and then automatically check if pdflatex can compile them or not.  This solution seems slow and fragile.  What is a better solution?  Edit: The program I am writing is in Python.


Some time ago I submitted a paper to a preeminent journal, and yesterday I received the review letter from the editor. The email contained reviews from two reviewers.  Reviewer 1 has been very professional, and wrote a detailed, constructive, useful report of the main aspects of the paper to improve.  Reviewer 2, on the contrary, did the opposite: he/she just wrote five superficial sentences. Some of his/her comments are just false, some of them don't make any sense, and some of them are even incorrect in English!  In fact, this reviewer wrote: "The data of the manuscript are NOT available", when the truth is that our data file is publicly available online! It has always been available before submission, during the submission, and now; we the authors wrote this in the manuscript and in the cover letter. I wonder how it is possible that he/she wrote that!  Regarding the English grammar, I'm very surprised to see such poor usage of the language in this review. This is one of his/her original comments, for example:     How did you use the data to contruct and evaluate the models? I didn't see any mechnism for these purposes   Can you believe it? This sentence is very scarce and ambiguous, and even contains two English mistakes.  Reviewer 2 did not suggest a decision but just wrote:     This research is interesting, but I have a few concerns   I cannot explain in detail the comments of Reviewer 2 right now, but I can tell you that most of them make no scientific sense. I am very surprised and sorry to see that my paper, that my collaborator and I wrote in months of energy and effort, has been treated so unprofessionally, both by Reviewer 2 and by the editor who selected him/her.  The editor’s current decision is "major revision". The editor wrote that we should address the flaws of both the reviewers.  Question: What should I do now?   How can I communicate politely the issues of Reviewer 2's report to the editor? Should I address these non-sense comments in the new version of the manuscript or not? I strongly believe this person does not have the skills and knowledge to judge my paper. Can I ask to remove him from the reviewer list?

How do you respond to a reviewer who is very critical about your paper but from whose comments you can easily see that he/she has misunderstood the key concepts of the paper?  In my case, the first reviewer had no issues with the paper and suggested only a minor revision. But the second reviewer seems to have not spent too much time on understanding the paper. This reviewer's misunderstanding made the editor suggest a major revision of the paper.  In my response to the reviewer (not sent yet), I used the sentence "This comment completely misrepresent the methodology described in the paper." Is this too much?  UPDATE: I am glad to inform you all that after the second round of reviews, the paper was accepted with minor revisions. I followed the general advice given in the accepted answer for this post. Instead of being too defensive, I agreed in my response to the reviewer that the misunderstanding may be due to wording of certain sentences and changed them. Specifically, I used the following sentence:     "There seems to be a misunderstanding about the methodology, which we   hope to clear through our responses below and by revising the text in   the manuscript. Contrary to what the reviewer states, ..."   Hope this update helps someone in future.


Is this sentence ok or should it say I have bought one and will buy another. The first sentence seems to lead the reader into the idea that I have not bought any music yet.     i'm going to buy the two songs he wants me to memorize for $6 a piece. I already have one purchased and I'll practice it.

I asked this question  but I haven't gotten a useful answer. Could you tell me the difference in meaning between these sentences?        Do you think you will visit them next week?     Will you visit them next week?     Are you going to visit them next week?     Are you visiting them next week?     Are you going to be visiting them next week?     Are you planning to be visiting them next week?     Do you plan to visit them next week?      Will there be any difference in the answers?        I think I will visit them next week.     I will visit them next week.     I am going to visit them next week.     I am visiting them next week.     I am going to be visiting them next week.     I am planning to be visiting them next week.     I plan to visit them next week.      Can I use "planning to" instead of "going to"?  (E.g. "Are you planning to visit them next week? — Yes, I am planning to visit them next week.") Which of these sentences show that the subject of conversation has already been discussed? For example, I talked with a friend of mine about my plans to visit somebody. So my friend is aware of my plans.  And my last question. Which of these seven sentences express that the action will certainly take place?


I have a flask app, where i have implemented a snippet, to check if a user is logged in, in order to acces certain webpages on my application.  My method looks like this:  #check if session is avaliable to access hidden pages for non users def is_logged_in(f):     @wraps(f)     def wrap(*args, **kwargs):         if 'logged_in' in session:             return f(*args, **kwargs)         else:             flash('Please Login ', 'danger')             return redirect(url_for('login'))     return wrap   Here I check if the session has a logged_in attribute attached the the session.  However, I get an error saying global name @wraps is not defined, but I have no idea as to why?

In a comment on this , someone said that they weren't sure what functools.wraps was doing. So, I'm asking this question so that there will be a record of it on StackOverflow for future reference: what does functools.wraps do, exactly?


How can I find such a limit: $$\lim_{n\to\infty}n(x^{1/n}-1)$$ I tried using a kind of binomial formulas. But nothing helped so far.  Thank you!

How to compute the following limit?  $\lim\limits_{n\to\infty} n·(\sqrt[n]{a}-1)$  We know that it's got something to do with $\ln$ or $\exp$.  We know that $\lim\limits_{n\to\infty} \sqrt[n]{a} = 1$ but it seems to not to be true that therefore $\lim\limits_{n\to\infty} n·(\sqrt[n]{a}-1) = \lim\limits_{n\to\infty} n·(1-1) = 0$.  What we know is  $\lim\limits_{n\to\infty} (1-\frac{1}{n})^n = \lim\limits_{n\to\infty} (1 + \frac{1}{n})^n \lim\limits_{n\to\infty} (1-\frac{1}{n})^{n+1} = e$  and  $\lim\limits_{n\to\infty} (1+\frac{x}{n})^n = \exp(x)$


Recently while getting an review-audit I wanted to edit the post. A message like  This post was deleted. You can't edit deleted entries.   appeared. I think this shouldn't be displayed because it shows that we are in an audit.

On a recent review audit on SU, I clicked "Edit" and was greeted with the plain text "This post was deleted and cannot be edited". It wasn't in a popup box or anything; the actual page consisted of just that text, with no formatting (as though it were the only content of the HTML page). This makes it really obvious I'm dealing with an audit.