Disclaimer: Before anyone marks this a duplicate of , I know what a NullPointerException is and how to fix it. This concrete NullPointer, for some reason after a few hours I can't fix. So, I have a simple socket class where I create my socket and send two Hello as a test: package network.outgoing;  import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import java.net.InetAddress; import java.net.Socket;   public class MySocket extends Thread{     private Socket socketServer;     private DataOutputStream doStream;     private DataInputStream diStream;     private final int PORT;      public MySocket(int port) {         this.PORT = port;     }       public void run() {         InetAddress iAddress;         try {             iAddress = InetAddress.getLocalHost();             String ip = iAddress.getHostAddress();              socketServer = new Socket(ip, PORT);             doStream = new DataOutputStream(socketServer.getOutputStream());             diStream = new DataInputStream(socketServer.getInputStream());             doStream.writeUTF("Hello, I'm " + Node.name);             doStream.writeUTF("Hello 2");          } catch (Exception e) {             e.printStackTrace();         }     }       public void notifyData(String operation, String name) {         try {             doStream.writeUTF("OPERATION"); //NullPointerException             doStream.writeUTF(operation);         } catch (IOException e) {             e.printStackTrace();         }     } }  I need several instances of this class, so in my main controller I have an array where I store them: private final ArrayList<MySocket> socketListA;  which is initialized in the constructor: socketListA = new ArrayList<>(); // only place where a new is called on socketListA setSockets(ports, myPort);  in the setSockets method (a simplified version removing other innecessary stuff): for (int port : ports) {     MySocket mySocket = new MySocket(port); // only place where a new is called on MySocket     mySocket.start();     socketListA.add(mySocket); }  Creating and starting the MySocket thread sends correctly the two test Hello from the run method, but accessing it from the array as such: socketListA.get(random.nextInt(socketListA.size() - 1)).notifyData(line, name);  gives null pointer on the doStream inside the notifyData method. I tested several things:  Not using the arrayList: setSocket returning directly a single instance of MySocket and trying a doStream (set to public for this test) from the returned instace, but it's null: Checked if the instance in the arrayList, is the same as the one created and stored in it (with both hash and equals) and yes, they are the same (not accessing an invalid or different instance when calling notifyData). Same check was done in the previous point for the returned instance of MySocket Created (again) a doStream on the notifyData method. This works, but it shouldn't be necessary as doStream should have a value.  Note: The socketListA arrayList is created only once, and the MySocket instance is created also once. Why is the doStream in notifyData null, if it has been created in the run method and the instance of the class is the same?

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 tried installing PHPMyAdmin in my local system. When started, it only shows the PHP code in the browser as you can see:    What could be the problem, and how can I fix it?

I am totally new to Linux, servers and websites. I recently set up Apache2, Python, PHP, and MySQL for setting up a LAMP server. I am using Xubuntu 16.04 and PHP 7.0.11. I followed a guide and placed a PHP file named testing.php in it with:  <?php phpinfo(); ?>    It doesn't show anything on localhost/testing.php All it shows is the code itself.


returns zero results.  Just include the duplicate suggestions behavior in that as an option

When I search for similar questions that I am going to ask, I usually can't find anything through the search box on Stack Overflow. But when I enter my question on the "Ask Question" page, the questions suggested through the "Questions with similar titles" box are usually relevant. Do you experience the same thing?


I am trying to compare the two String to check if the values are the same from a scanner input. The problem is that after the input of both of the values, the output is saying the two Strings are not the same.  import java.util.Scanner;  public class Test {      public static void main(String[] args) {          String testOne = "";         String testTwo = "";          Scanner input = new Scanner(System.in);         testOne = input.next();          Scanner inputOne = new Scanner(System.in);         testTwo = inputOne.next();          System.out.println("Before comapring: testOne = " + testOne + "\t testTwo = " + testTwo +"\n");          if(testOne == testTwo){             System.out.println("The same");             System.out.println("After comparing: TestOne = " + testOne + "\t testTwo = " + testTwo);         }         else{             System.out.println("Not The same");             System.out.println("After comparing: testOne = " + testOne + "\t testTwo = " + testTwo);         }        } }   I have tried this with multiple inputs, and the outcome is always they are not the same.  Any thoughts would be appreciated.

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


I was trying to understand the solution of this problem;  Two samples $\{x[0], x[1]\}$ are independently observed from a $N(0,\sigma^2)$ distribution. The estimator $\hat{\sigma}^2 = \frac{1}{2}(x^2[0]+x^2[1])$ is unbiased. Find the pdf of $\hat{\sigma}^2$.  The solution goes as follows. First divide by standard deviation to obtain $\frac{x[n]}{\sigma} \sim N(0,1)$. This equals a chi-square distribution with 1 degree of freedom. Then $y = (\frac{x[0]}{\sigma})^2+ (\frac{x[1]}{\sigma})^2 \sim \chi^2_2 $ which has the pdf $p(y) = \frac{1}{2}e^{-y/2}, y > 0$ and 0 for y < 0. Substituting, we obtain $\hat{\sigma^2} = \frac{\sigma^2}{2}y$ So far I understood with no problem. However I think I'm missing some knowledge to understand the following part. $p(\hat{\sigma^2}) = \frac{p_y(y(\hat{\sigma}^2))}{|d\hat{\sigma}^2/dy|} = \frac{\frac{1}{2}e^{-\frac{1}{2}(2\hat{\sigma}^2/\sigma)}}{\sigma^2/2} $ Where exactly did the derivative in the denominator come from?

In Bishop's Pattern Recognition and Machine Learning I read the following, just after the probability density $p(x\in(a,b))=\int_a^bp(x)\textrm{d}x$ was introduced:     Under a nonlinear change of variable, a probability density transforms   differently from a simple function, due to the Jacobian factor. For   instance, if we consider a change of variables $x = g(y)$, then a   function $f(x)$ becomes  $\tilde{f}(y) = f(g(y))$. Now consider a   probability density $p_x(x)$ that corresponds to a density $p_y(y)$   with respect to the new variable $y$, where the sufﬁces denote the   fact that $p_x(x)$ and $p_y(y)$ are different densities. Observations   falling in the range $(x, x + \delta x)$ will, for small values of   $\delta x$, be transformed into the range $(y, y + \delta y$) where   $p_x(x)\delta x \simeq p_y(y)δy$, and hence $p_y(y) = p_x(x) |\frac{dx}{dy}| = p_x(g(y)) | g\prime (y) |$.   What is the Jacobian factor and what exactly does everything mean (maybe qualitatively)? Bishop says, that a consequence of this property is that the concept of the maximum of a probability density is dependent on the choice of variable. What does this mean?  To me this comes all a bit out of the blue (considering it's in the introduction chapter). I'd appreciate some hints, thanks!


I'm focusing on clarifying this  for the 5th edition.  Due to wordings like the Bardic Inspiration, it seemed clear to me that rolls should be out in the open, they should not be hidden. However, I can also see the argument where the DM rolls in secret, but then announces a fake number (maybe he rolled a 5, but he announces he rolled a 17).      You can use your reaction to expend one of your uses of Bardic Inspiration. You can choose to use this feature after the creature makes its roll, but before the GM determines whether the Attack roll or ability check succeeds or fails.    The other question's answers seem mostly focused on 3.5e, so I'm asking for RAW guidance, are DMs supposed to roll in the open, or in secret (with fumbling if necessary)? Is this mentioned in any book?

I'm a new DM and over the last few weeks I've been slowly learning the game and how it runs. My party consists of 5 PCs.   One thing I have been wondering after our last two sessions is: What rolls should all the players see and which rolls shouldn't they see?  Is there a comprehensive list of what rolls are public and which go behind the DM screen, or is it more down to house rules or personal preference?


This is my first post, so I hope I have this set out correctly.  I'm looking to identify a story that I read many years ago, probably written in late 70's or early 80's.  The main points I can remember are below but the plot concerned a young boy/man and an attempt to destroy an undersea city or habitat.  The main protagonist was the son of a diplomat and came from somewhere with lower than normal gravity, I recall one of the early scenes in the book with the boy swimming to build his leg muscles and a girl being in the pool when he arrives.  They talk and she tells the boy about the underwater city she lives in.  As earth gravity made the boy weak, his father sends him to the underwater habitat that the girl lives in, and once there he becomes involved in various adventures, discovering men with artificial gills and other elements that I can no longer remember.  I think the overall plot was to bring down the Earth government by destroying the habitat in an explosion.  Can anyone help identify the story?

About twenty years ago, I read a sci-fi novel where, if I recall correctly:   The protagonist is a guy, and probably a teenager or a young adult. Like most of humanity, he lives on land; but he's visiting an undersea colony (one of many?), and that's where most of the action takes place. He gets to know a girl there about the same age; maybe he's staying with her family for some reason? (Maybe they're relatives of his?) The girl had an older brother ("Ian", maybe?), but he died. He goes out of the city (i.e., goes for a dive) at some point, and gets in trouble, but is mysteriously rescued. He learns about an underground separatist movement of some sort. (I don't remember the details.) He eventually discovers that:       Ian is actually alive, and his family (or at least his sister) is still in touch with him; but they're covering up the fact that he's joined this separatist movement, and (like some other separatists) has modified his body to have gills so he can live out in the ocean.      Ian is actually who rescued him mysteriously.     I would guess, in retrospect, that the novel is from the 70s or so; but I don't really know.  I read the novel in English, and I don't think it was a translation.


I have problem with custom exceptions. I'd like to throw and catch my own exception if standard exception was caught. But it's impossible when I try to throw my own exception in catch block. Can you tell me how to do it properly? :(  SampleClass.java:  public class SampleClass {      int[] arr = new int[6];      public void fillArray() {         for (int i = 0; i < 6; i++) {             arr[i] = i;         }     }      public void getElement(int index) {         try {             System.out.println(arr[index]);         } catch (IndexOutOfBoundsException ex) {             throw new MyIoobEx();         } catch (MyIoobEx e) {             e.getMessage();         }     }      public static void main(String[] args) {      } }   MyIoobEx.java:      public class MyIoobEx extends IndexOutOfBoundsException {         @Override         public String getMessage() {             return "Bad index given";         } }

This may seem like a programming 101 question and I had thought I knew the answer but now find myself needing to double check. In this piece of code below, will the exception thrown in the first catch block then be caught by the general Exception catch block below?  try {   // Do something } catch(IOException e) {   throw new ApplicationException("Problem connecting to server"); } catch(Exception e) {   // Will the ApplicationException be caught here? }   I always thought the answer would be no, but now I have some odd behaviour that could be caused by this. The answer is probably the same for most languages but I'm working in Java.


Would it make sense to use wool batting like  as a window quilt? Why or why not? What factors would affect its suitability? For context, I propose using this on the inside of one of those  in the US midwest.

I have some windows that I want to insulate at night during the winter. I have energy star windows, thermal drapes, and cellular blinds and those plastic window film kit things, but I want to reduce my heating costs even more. So here's my idea. What if I took a bunch of fiberglass or mineral wool insulation, wrapped it in a bunch of plastic, and shoved that in between the window and blinds at night, possibly filling in gaps between the plastic and the the window frame with other material, and possibly secured on the inside end by a board or something? Then I would probably take it out during the day. I'm wondering  whether you think this would significantly affect heat loss through the window, whether it would cause any condensation problems, and about any unintended consequences I might be missing.


Fallowing thread class is working fine. I can understand its process. Then I changed  mc.srart() into mc.run() but nothing changed and there was no any errors.  Can someone please explain this to me ? can we always use run() instead of start() ?  public class Main {      public static void main(String[] args) {          Myclass mc = new Myclass();         mc.start();     } }  class Myclass extends Thread {     public void run() {         for (int i = 0; i < 10; i++) {             System.out.print(i + "--");         }     } }

When would you call Java's thread.run() instead of thread.start()?


At 2000 reputation, users are given the ability to "edit anything in the system without it going through the peer review system", which is undoubtedly useful when it comes to correcting poor grammar and making a question more intelligible in general.  However, I often find myself thinking I know what a question means without actually being sure, and consequently I am reluctant to make an edit clarifying said question, as I don't want to change what it is really asking. For this reason, it may prove useful to have a mechanism through which 2000+ reputation users can still suggest edits to an OP without actually making them.

I came upon a question where I wanted to make an edit, but I wasn't sure if it would change the original meaning of the question - as I did not know enough about the subject material to be sure.   I could wait for another user to come around and make the edit, but perhaps they wouldn't notice the problem that I wanted to edit. I could also suggest the edit in the comments, but it is such a minor nitpick of grammar that I seemed like a waste of a comment.   Of course, I can't just let a minor grammatical mistake go unnoticed.   So my suggestion is to allow an editor to mark an edit to instead be suggested to the author for approval, if the author believes it does not sufficiently alter the meaning of the question. It would pop up under their usual notification area to approve or reject a suggested edit.   This is different than the 5k/mod suggested edits version in that it would be from a user who could have edited the question, but still seeks the approval of the original poster.


I need to use \ref{} command with a list of figures. So, instead of using the command multiple times as follows: Figures \ref{fig:1}, \ref{fig:2}, and \ref{fig:3} %the output will be Figures 1,2 and 3.  I need to use it one time to refer to a list of figures, so the required output looks like Figures 1-3.

I'm preparing my manuscript for a journal in which figures are in the following clickable format like, for exapmle, "Fig. 1", "Figs. 2 and 3" and "Figs. 4-6". I'm trying to use the same environment of \hyperref as given in the  provided by , but not getting the required format. Please have a look on the attached screenshot for figure referencing style. The MWE is copied from ,  \documentclass[10pt,a4paper]{article} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage{todonotes} \usepackage{hyperref}  \newcommand*{\figref}[2][]{% \hyperref[{fig:#2}]{% Fig.~\ref*{fig:#2}% \ifx\\#1\\% \else \,#1% \fi   }% } \begin{document}  \begin{figure}[t] \missingfigure[figwidth=6cm]{- << Ciel, mon mari >> dit-elle !} \caption{Missing figure 1.} \label{fig:missing Figure1} \end{figure}  \begin{figure}[t] \missingfigure[figwidth=6cm]{- << Ciel, mon mari >> dit-elle !} \caption{Missing figure 2.} \label{fig:missing Figure2} \end{figure}  \begin{figure}[t] \missingfigure[figwidth=6cm]{- << Ciel, mon mari >> dit-elle !} \caption{Missing figure 3.} \label{fig:missing Figure3} \end{figure}  The single figure should be like that \figref{missing Figure1}. And two figures be like that \figref{missing Figure1} and \figref{missing Figure2},  moreover the combination of three figures like tha \figref{missing Figure1,  missing Figure2,missing Figure3} as you can see in the attached journal's  screenshot.  \end{document}


Some of the questions appear invisible. I can still scroll down through white space and see answers.  I can see the question itself if I switch to Edit.  This does not happen to all questions and I was not able to discover any pattern.  For example, it happens with the following SO Meta post:    I'm using version 1.0.58 of the app on Samsung Galaxy SCH-I545 with Android version 4.4.2.  It looks like this:        EDIT  This very question is invisible in app as well.  Now I think it could be something with posts that include images.

Version 1.0.58  When viewing questions that contain multiple code blocks, the question is blank for a few screens. Answers and comments are OK.   I tried clearing application data, and rebooting they phone, no change. Mobile sites work perfectly.   Example:      Also, now that I posted the pictures and links, this question also went blank


I have downloaded the install-progress.cc file which is the same as .   I have tried following  and even  instructions to enable the progress bar in the terminal, but even if I run apt processes I don't get the progress bar.   What am I doing wrong? Can someone please help me?

I've heard that apt has a new fancy colour and progress bar feature, but that I have to manually enable it.   How do I do this?


I use the xelatex with the biblatex package and with indexing author names. The biber works fine with bibliography of books in English and in Russian. The author index is generated. In the bibliography the order is correct but in the index of names I get bad order - Russian names does not follow the latin index names order. How can I correct it? Here is the test.tex example:   \documentclass{article}  \usepackage{geometry} \geometry{a5paper}  \usepackage{xltxtra} \usepackage{polyglossia}  \setdefaultlanguage{english} \setotherlanguages{russian} \defaultfontfeatures{Mapping=tex-text} \setmainfont{FreeSerif} \newfontfamily\russianfont{FreeSerif}  \usepackage{index} \newindex{default}{idx}{ind}{My Index} \newindex{titles}{tdx}{tnd}{My Titles}  \usepackage[style=authortitle-icomp,indexing=true,sorting=nty,backend=biber]{biblatex} \addbibresource{\jobname.bib} \DeclareIndexFieldFormat{indextitle}{\index[titles]{#1}}  \listfiles \usepackage{filecontents} \begin{filecontents}{\jobname.bib} @BOOK{Alma,     author = {Alma, B.},     title = {Test},     year = {2000} } @INBOOK{Roma,     author = {Рома, Ю.},     title = {Oбраз},     booktitle = {Материал},     year = {2001},     sortkey = {Roma} } @BOOK{Sama,     author = {Sama, C.},     title = {Last one},     year = {2002} } \end{filecontents}  \begin{document}  \section{Testing}  Three \cite{Sama}. Two \cite{Roma}. One \cite{Alma}.  \printbibliography  \printindex  \end{document}   The References are almost OK (there are two dots after the Рома, Ю):  References Alma, B. Test. 2000. Рома, Ю.. “Oбраз”. In: Материал. 2001. Sama, C. Last one. 2002.   But the index is not (by means of makeindex test):  My Index Alma, B., 1 Sama, C., 1 Рома, Ю., 1   The texindy test.idx makes the same error:  A Alma, B., 1 S Sama, C., 1 Рома, Ю., 1   This is, of course, because in the test.idx we have \indexentry {Sama, C.}{1} \indexentry {Рома, Ю.}{1} \indexentry {Alma, B.}{1} \indexentry {Alma, B.}{1} \indexentry {Рома, Ю.}{1} \indexentry {Sama, C.}{1}  We should have there something like: \indexentry {Roma@Рома, Ю.}{1}  because there is sortkey = {Roma} in the bib file for biblatex.

If my input file is utf8 encoded, how to I create an index where the entries are properly sorted?  Minimal example  \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{makeidx} \makeindex \begin{document} Hello World\index{Gödel}\index{Galois} \printindex \end{document}   After compiling with pdflatex and makeindex, the entries show up with “Gödel” before “Galois”, which is wrong.  In another  it is suggested to compile with xelatex instead; however I'm trying to do this in a large-ish project already written by someone else, and trying to switch to xelatex is proving a bit problematic.  So, is there a way to make it work with pdflatex?


I want to know wht's equal this number :${\frac 12 ^ \frac 13} ^{\cdots \frac1n}$, however it's seems trivial that is converge to 1 , but i don't know how i can evaluate it , Really i have two question: the first is : what is the partial sum of it ? and what's equal for n large enough or go to infty ?

The sequence $a_n=(1/2)^{(1/3)^{...^{(1/n)}}}$ doesn't converge, but instead has two limits, for $a_{2n}$ and one for $a_{2n+1}$ (calculated by computer - they fluctuate by about 0.3 at around 0.67). Why is this?


I am creating collapsable pageblocks in visualforce and im new to visualforce i tried implementing the following code but its not working and throwing error in jquery file like Refference error $header not defined. my code is     <apex:page >    <apex:includeScript value="{!$Resource.jqueryCollapse}"/>      <apex:includeScript value="{!$Resource.jqueryCollapse1}"/>    <apex:includeScript value="{!$Resource.jqueryCollapse2}"/>    <apex:form >                  <apex:pageBlock > <apex:pageBlockSection columns="10" collapsible="True" >

              <apex:pageBlock >                <apex:pageBlockSection columns="5"  >             <apex:outputLabel value="Collapse"  id="theSecond1"/>             <apex:inputText />          </apex:pageBlockSection>                   </apex:pageBlock>

             <apex:outputText value="First" id="theFirst"/>             <apex:InputText />          </apex:pageBlockSection>      </apex:pageBlock>        </apex:form> </apex:page>   The div region is visible on page load itself .Can anyone guide me in this

I am tryin to create expand and collapse functionality between pageblocks.The scenario is when i click the collapse button in one pageblock ,it should render another pageblock.How this can be achieved ? I tried using java script but the pageblock is not displaying properly. My current code is   <apex:page >   <apex:includeScript value="{!$Resource.jqueryCollapse}"/>   <apex:includeScript value="{!$Resource.jqueryCollapse1}"/>    <apex:includeScript value="{!$Resource.jqueryCollapse2}"/>    <apex:form >                 <apex:pageBlock > <apex:pageBlockSection columns="10" collapsible="True" >

          <apex:pageBlock >            <apex:pageBlockSection columns="5"  >         <apex:outputLabel value="Collapse"  id="theSecond1"/>         <apex:inputText />         </apex:pageBlockSection>                     </apex:pageBlock>

         <apex:outputText value="First" id="theFirst"/>         <apex:InputText />      </apex:pageBlockSection>     </apex:pageBlock>         </apex:form>   </apex:page>


How do I prove convergence of below alternating sequence with a factorial in the denominator?  $\{\frac{\left(-5\right)^n}{n!}\}$  How can I apply the principles described in  post to this question? What sequences can I use to apply Squeeze Theorem?

Why is     $$\lim_{n \to \infty} \frac{2^n}{n!}=0\text{ ?}$$   Can we generalize it to any exponent $x \in \Bbb R$? This is to say, is     $$\lim_{n \to \infty} \frac{x^n}{n!}=0\text{ ?}$$     This is being repurposed in an effort to cut down on duplicates, see here: Coping with  duplicate questions.  and here: .


love between husband and wife   What is the reason that there is no article (e.g. "love between a husband and a wife") in the above? Has some kind of a rule been identified grammatically when it comes to such a case? If I were to guess I think it's because the indefinite article 'a', the purpose of that, is taking a generic sample (or 'instance') from a 'class' (the class of husbands), but in the above sentence you want to refer to the class itself... the husband class and the wife class... and not an 'instance' of them, because it just is more to the point. Do you think this is a fair reasoning? Also, a thought came to me that with the use of the indefinite article, you get a generic husband and a generic wife, which, may not necessarily love each other (for they are not a specific pair of a specific husband and a specific wife who in fact love each other).

Here's a fragment from Jack London's Star Rover:     Wordsworth knew. He was neither seer nor prophet, but just ordinary man like you or any man. What he knew you know, any man knows. But he most aptly stated it in his passage that begins "Not in utter nakedness, not in entire forgetfulness.   To the best of my — admittedly sketchy — knowledge of grammar, the second sentence should read neither a seer nor (a) prophet, but just an ordinary man. Even if we accept the seer and the prophet as "poetic entities" ("father and son," "robber and robbed," "man to man," or whatever), logic would still dictate that ordinary man should be preceded by an an.  It is a well-known fact that Jack London's usage wasn't always up to par; his grammar, on the other hand, was always top-notch.  Logically, the sentence is grammatically incorrect (correct me if I'm wrong: no pun intended).  Illogically, it reads smoothly: intuitively, a native speaker understands that there's nothing wrong here.  However, those to whom English is not the first language cannot be expected to be intuitive in this case and would want an explanation. Any suggestions?


Scenario: driving to tampa, have two laptops (win 7 and win xp) and vga to vga cord (the blue one used to connect pc's to their monitor) Screen on win7 laptop is broken to the point of no visibility. I want the win xp laptop to show the win 7 laptop's screen. Is there a program i can download or a setting in the control panel to do this?

Is it possible to make my laptop's screen act as a second monitor for my desktop computer?


The question asks to use a proof by contradiction. I know that the coefficients of $\{v_1,v_2,v_3,v_4\}$ are all zero, but then I don't know what to do next-how to translate that into the $\Bbb R^3$ vector. Any help would be appreciated, thanks!

My problem: Prove that a set of vectors $S$ is linearly independent if and only if any finite subset of $S$ is linearly independent.  I tried like this:  Suppose S is LI.Then the vector $0$ cannot be expressed as a linear sum of all elements of $S$.  How it follows that a finite subset is also LI from this fact. I think $S$ can be finite or infinite.  This is a question from the book Linear Algebra - Friedberg et al.


I'm currently studying the RSA algorithm and while I understand why if $b$ is the inverse of $a$ in $\Bbb Z_n $ then $ab  \equiv 1\pmod{n}$.  I don't quite understand why $x^{ab} \equiv x \pmod{n}$. Can I just replace $ab$ with $1$? A proof showing why this holds would be really helpful.

As you know, in RSA encryption, we calculate an n value by multiplying two long primes. Then we calculate Φ(n), which is equal to (p-1)(q-1). After that, we choose an encryption key which satisfies gcd(e,Φ(n))=1. I know that it is necessary to calculate decryption key, which is the modular inverse of e. My question is: Why do we use Φ(n) in determination of encryption and decryption key processes? How can one prove it is working for RSA encryption?


How can I move all files bigger than lets say 10MB into a different folder?  -rw-r--r-- 1 nath nath 4,3M Apr 21  2018 "file1.mp3" -rw-r--r-- 1 nath nath 1,7M Jun 10  2017 'file2.mp3' -rw-r--r-- 1 nath nath  76M Okt 12 05:33  file3.mp3 -rw-r--r-- 1 nath nath 3,7M Mär  1  2016 'file4.mp3'   so in this case it would only move file3

I tried this:  find . -type f -size 128 -exec mv {} new_dir/  \;   Which didn't work, and it didn't give me an error. Here is an example of what the file looks like, when using stat -x  $ stat -x ./testfile | grep Size    Size: 128          FileType: Regular File


When you lose the both sides. (Consider this literally translated Idiom:  "I'm now a two-heads-burned wood.")  I don't mean lose-lose situation. It's the antithesis of "hitting two targets with one bullet" (I know I'm wrong in saying this one too).    E.g. (for the original question) one of your friends asks you a favor, parallel another friend asks you another favor. If you choose to help only one of them, any, you will do it for sure. Now you choose to help both, then you become unsuccessful on both, and now they're chagrined of you.    Now, after this failure on both sides, you call yourself "I'm a two-heads-burned wood."  No, it's not the duplicate of what Tymek said.

I'm basically searching for the opposite of putting all your eggs in one basket, where the risk is total failure because you did not hedge your efforts. I'm searching for a phrase that encompasses splitting your efforts and evokes the prospect of failing at both. A bird in the hand is worth two in the bush also encompasses a sense of having focused your efforts, but only alludes to total failure. To satisfy the criteria, the phrase must cover:  attempting two things (or multiple iterations of one thing) both of which you might succeed at, if you addressed them serially but both of which you fail at because you address them in parallel  Here are the idioms/phrases that do not sufficiently cover the idea and why:  "A servant to two masters"  This has the sense of competing priorities, but not the sense of failing to achieve your goals.  "Jack of all trades. Master of none."  The sense is insufficiently pejorative. Being a jack-of-all-trades can be seen as an advantage; I'm trying to focus on the lack of mastery.  "The man who fancied himself a wit, and was half-right."  From Christopher Hitchens. Hilarious, but lacking the sense of split effort between two things.  "Walking and chewing gum at the same time."  An idiom for multi-tasking, not for failing to multi-task. Edit Addressing a few suggestions and another one that occurred to me:  "Hedging your bets" or "Betting against yourself"  In this case, you cannot win both bets, but you will almost certainly win one. You limit your upside, but also limit your risk. I'm looking in particular for total, catastrophic failure due to split attention/effort.  "Can't walk and chew gum at the same time"  Failing to do two fairly simple things that most everyone can do, not failing at two hard things because you tried to do both.  "Robbing Peter to pay Paul"  In this case, Paul gets paid. If you were to rob Peter to pay Paul, and get robbed yourself before you could get the money to Paul, that'd be closer. :)  "Spreading yourself too thin"  An actual English idiom, but missing the implied sense of failure.  "Too many irons in the fire"  "A lot of irons in the fire" can be viewed positively, so this is missing the sense of a strategic misstep.  "Between a rock and a hard place"  The sense is of needing to act but having no good alternative.  "Falling between two stools"  My favorite answer so far because it does appear to be an actual English idiom (not a proverb). In that sense, it's great, but some of the usages are closer to a failure of  than a failure of effort. And falling between two stools implies that the attempted action was simply sitting down.  "Chasing two rabbits and catching none."  This is the exact sense I was looking for, but it appears to be a cross-cultural proverb rather than idiomatic English like "putting all your eggs in one basket". I'll be accepting it, and using it in my work! But if there are other ideas, please let me know.


Some phycisits have found photons that has a spin of 1,5. Now fermions has always a half spin and bosons like photons always with a whole spin. But if those photons really exists are they than fermions?    In the other similar question is answered: 'this hints at a possible "fermionization" of photons in situations where J1/2J1/2 is a good operator, i.e. a description of the photonic system by an equivalent fermionic system.' But what is meant by fermionization? If a photon is measured a half can it be fermion or are there other conditions?

A  suggests that photons can have half-integer spins. This seems to contradict the well understood notion that photons are vector (1-form) fields  What does this mean for the fundamental picture of electromagnetic propagation?


Since I upgraded to Android 2.2, I noted some minor disadvantages of moving an app to SD card, like having to wait the SD card to be mounted after a reboot to be able launch the app.  What other disadvantages are there?

Are there any particular advantages/disadvantages to storing apps on the external storage of an Android device? As I have a Nexus S,  I can't think of advantages for me as I can't remove the storage, also the internal storage is more than enough for my needs.  I noticed that on phone start up, when I had all my apps moved to USB storage it was quite sluggish to register all the apps on the menu/home screens.  I also read somewhere that having a wallpaper set from a photo that was stored on the external memory actually drained quite a bit of battery too with all the reads (although I think this may have been a bug).


I have a very simple problem. I want to display a simple php code in Latex using listings. For example  {goToPage('nextpage'); }   My problem is, that if I compile the code the apostrophs ' are displayed as ´ in the document. I can't figure out how to change this.  Here is the Latex Code I use:  \documentclass[12pt,a4paper,xcolor=dvipsnames]{article} \usepackage[utf8]{inputenc} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{listings} \usepackage[T1]{fontenc} \usepackage[usenames,dvipsnames,svgnames,table]{xcolor}  \lstset{ %     language=php,                     % the language of the code     basicstyle=\footnotesize,       % the size of the fonts that are used for the code     numbers=left,                   % where to put the line-numbers     numberstyle=\tiny\color{gray},  % the style that is used for the line-numbers     stepnumber=1,                   % the step between two line-numbers. If it's 1, each line     % will be numbered     inputencoding = utf8,     numbersep=5pt,                  % how far the line-numbers are from the code     backgroundcolor=\color{white},  % choose the background color. You must add \usepackage{color}     showspaces=false,               % show spaces adding particular underscores     showstringspaces=false,         % underline spaces within strings     showtabs=false,                 % show tabs within strings adding particular underscores     frame=single,                   % adds a frame around the code     extendedchars=true,      rulecolor=\color{black},        % if not set, the frame-color may be changed on line-breaks within not-black text (e.g. commens (green here))     tabsize=2,                      % sets default tabsize to 2 spaces     captionpos=b,                   % sets the caption-position to bottom     breaklines=true,                % sets automatic line breaking     breakatwhitespace=false,        % sets if automatic breaks should only happen at whitespace     title=\lstname,                 % show the filename of files included with \lstinputlisting;     % also try caption instead of title     keywordstyle=\color{blue},      % keyword style     commentstyle=\color{OliveGreen},   % comment style     stringstyle=\color{Purple},      % string literal style     escapeinside={\%*}{*)},         % if you want to add a comment within your code     morekeywords={*,...}            % if you want to add more keywords to the set }  lines=true} \lstset{framextopmargin=50pt,frame=bottomline} \author{Philipp Hubert} \title{SoSci Hilfe} \begin{document}     \begin{lstlisting}[language=php]     {goToPage('***');     }     \end{lstlisting} \end{document}   Thank you in advance.

All single quotes in code samples are displayed as backticks and the copy-pasted code can't be compiled without fixing the quotation. Is it possible to prevent this?  for example:  \documentclass{beamer} \usepackage{listings} \begin{document}  \lstset{language=Python} \begin{frame}[fragile]{Code} \begin{lstlisting} print 'hi'  \end{lstlisting} \end{frame} \end{document}   Compiled with latexmk -pdf file.tex, which creates a log starting like: This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013).  Output:


In conversational and spoken English, it's common to hear statements like     I only answer phone calls from people I know.   The "correct" form of this would be     I answer phone calls only from people I know.   In rare situations this can lead to ambiguity, but usually only in written English; when speaking, emphasis and intonation clears all doubt about what is 'only'. For instance, someone might say     You only run during the day.   Which of the possible meanings is intended could be clarified by adding more information or by changing the position of 'only':     (1) You only run during the day, but you also walk at night.   (2a) You run only during the day. or   (2b) You run during the day only.   It seems that 'only' moves only leftward, farther away from what it qualifies. A similar thing happens with 'either'.  Is there some sort of explanation for this movement?

Is there any difference in meaning between the three following sentences?   We only have two possibilities. We have only two possibilities. We have two possibilities only.   I have already read  and I know that the position of only and the emphasis (written or oral) may change the meaning of some sentences, but I am not sure if it does here.  Note: It is clear that “only we have two possibilities” has a different meaning. My question is restricted to the sentences I’ve listed above.


I have developed my own Bash Script (to undo the last APT commands), and now I'm looking for the best directory to install it.  Is the /usr/bin always the best choice?  Just for information this is my script:    and this is a little demo:

I am developing a set of scripts, which I want to be present for all users, when I set up a server. But I don't want them in the standard locations like /usr[/local]/[bin],[sbin] etc.  Is there some existing convention for where such scripts should be placed?


Shame the previous thread on this was closed. A lot of my work entails getting stuff right and being able to justify it but like many on this previous thread  point out it's kind of a)arbitrary decisions (e.g. a sub at PC World) or b)a slippage/usage-frequency thing which defines spelling of this and that.  While the word cat is pretty fixed, we're on a spectrum of usage with a lot of tech terms. In my view Wi-Fi is not a trademark and even by now people talk about doing the hoovering when Hoover is a trademarked product. So "Where are we at with Wi-FI, WiFi, wi-fi, wifi?" is my question to folk here.

This is probably related to whether one should capitalize Internet or not. I am looking for the correct spelling of wifi when referring to a wireless connection to the Internet. I want to tell the users of my iPhone app that they cannot use their cellular network to watch the HD videos.  If I use the capitalized and hyphenated version as seen on , will I be referring to the Wi-Fi brand rather than the concept of wifi?      "Wi-Fi" is a trademark of the Wi-Fi Alliance and the brand name for   products using the IEEE 802.11 family of standards.   Some dude on  made this claim with no explanation:      WiFi" is a bit better than "wifi" as it asserts the etymology, compare   history of usage of "hifi" from which it derives. – Steve-o Aug 29 at   3:59


I would draw more sine waves where wave parameter (top, bottom interval between two waves) depends from a value inserted on a \foreach (or similar) value.  Can someone give me example?  Renato   ok, maybe the cycle is too much. Ho can I Dra one single sine wave ?

\documentclass[12pt]{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document}     \begin{axis}[hide axis,red,width=16cm,height=8cm,thick]          \addplot[domain=20:300,samples=800, colormap={}{ color(2cm)=(red);    },   ultra thick, point meta=x*x,mesh]{sin(150*pow(x,1/2))};  %You could also ask a new question. Or you could just flip the picture.      \begin{tikzpicture}[xscale=-1]          \begin{axis}[hide axis,red,width=16cm,height=4cm,thick]             \addplot[domain=20:300,samples=800, colormap={}{ color(2cm)=(red); color(16cm)=(blue); },             ultra thick, point meta=x*x,mesh]                 {sin(pow(x,2)/15)};         \end{axis}      \end{tikzpicture} \end{document}   This code work well for me. But I would obtain just one more thing: - How can I obtain a more hight wave the more waves are tracked? I would increase also distance between waves


How would one show that the  $\sum_{k=1}^{n} c^k = \frac{c(c^n-1)}{c-1}$ is true?

Why does the following hold:  \begin{equation*} \displaystyle \sum\limits_{n=0}^{\infty} 0.7^n=\frac{1}{1-0.7} = 10/3\quad ? \end{equation*}  Can we generalize the above to      $\displaystyle \sum_{n=0}^{\infty} x^n = \frac{1}{1-x}$ ?   Are there some values of $x$ for which the above formula is invalid?  What about if we take only a finite number of terms? Is there a simpler formula?     $\displaystyle \sum_{n=0}^{N} x^n$   Is there a name for such a sequence?    This is being repurposed in an effort to cut down on duplicates, see here: Coping with  duplicate questions.  and here: .


The bug is that while it can see and use the various drives, it only listed one in the drive selection drop down list.  I tried to install Ubuntu 18.04 to an old computer (Dell Inspiron 580) currently running Windows 7 Home Premium 64 bit.  Its from 2010 and had the hard drive replaced due to failure. I left the bad drive in the machine as it had user data on it and hadn’t failed completely. It currently isn’t in use, it just wasn’t worth it to me remove after getting data off of it. The computer also had a 2TB external USB drive attached.  I wanted to dual boot Window 7 and Ubuntu and used the ubuntu-18.04.3-desktop-amd64.iso to try to install Ubuntu.  I Choose install, English, Normal Install, (Download updates and install 3rd party software checked), Install alongside existing OSes.  Then it asked for which drive to use, automatically selecting the 2 TB external drive. Went to the drop down drive list and it was the only drive listed. Shut everything down, disconnected the external drive.  Tried again, making the same installation selections. When it asked for which drive, it selected the bad drive and again the drop down list had nothing else.  Shut everything down, went into the BIOS and removed the bad drive from the boot options (Boot settings, Hard drive priority, only first good drive enabled). Booted into Windows to verify and that worked.  Tried again, making the same installation selections. When it asked for which drive, it selected the bad drive and the drop down list had nothing else.  Shut everything down, disconnected everything, etc... then disconnected and removed the bad drive. Tested booting into Windows, went fine. Ran the installer again with the same choices and it selected the correct drive. It was the only drive in the list but by this point it was the only drive on the system. Installation went fine after that.  The bug is that while it can see and use the various drives, it only listed one in the drive selection drop down list.  I can’t tell if this bug has been reported yet.  Thanks,  Luke

I found a problem with an application on Ubuntu.   Questions :   How do I best report the issue?  What sort of information should I provide?


I'm going through an online course, and don't understand the 4th line of this code:   import numpy as np  H1 = np.random.randn(50, 50) + 10  p = 0.5  U1 = np.random.rand(*H1.shape) < p   In particular, what is the * doing to H1.shape inside the np.random.rand function?

In the following method definitions, what does the * and ** do for param2?  def foo(param1, *param2): def bar(param1, **param2):


The Return key in my keyboard is broken, so I have chosen to make my PgDn key to act like the Return key. Now I learned how to do this using 'xmodmap'. The command I have to run is:  xmodmap -e 'keycode 117 = Return'   But I have to run this command everytime I reboot. I googled around and found that placing this command in the /etc/rc.local file should run it automatically at start-up. However, it does not work.  Can anyone tell me how can I execute this command when I boot up? I am using Ubuntu 14.04.

How can I run scripts automatically when Ubuntu starts up so I don't have to run them manually after startup?


I was playing around Java script. I was expecting an output of 10 twice. Since I have declared  var a = b = 10;  here I struck, got error saying "a" is undefined and hiding that console.log(a); next console.log(b) gives me output as 10. I am not getting how "a" become undefined, even the console is after the function execution it must be undefined to b as well. or Is this wrong way to assign a value. Any clarification is on scenario is much appreciated.    (function(){ var a = b = 10; })(); console.log(a); console.log(b);       (function(){ var a = b = 10; })(); //console.log(a); console.log(b);

What is the scope of variables in javascript? Do they have the same scope inside as opposed to outside a function? Or does it even matter? Also, where are the variables stored if they are defined globally?


There certainly exist commutative rings $R$ with unity containing a maximal ideal $m \subsetneq R$ such that $$\bigcap_{k=1}^\infty m^k \neq \{0\}.$$ (Thanks to Dietrich Burde, rschwieb and Lord Shark the Unknown.)  Question: What happens if we further assume that   (i) $R$ is an integral domain,   $\rightarrow$ (EDIT3:) No, see here: .  or that   (ii) the quotient $R/m$ is finite?  $\rightarrow$ (EDIT2:) No, take $R = \mathbb{C} \times \mathbb{F}_2$ and $m = \mathbb{C} \times \{ 0 \}$.  Or more general, is there a way to describe those rings $R$ such that $\bigcap_{k=1}^\infty m^k = \{0\}$ holds?

Given a Noetherian ring $R$ and a proper ideal $I$ of it.  Is it true that $$\bigcap_{n\ge 1} I^n=0$$ as $n$ varies over all natural numbers? If not, is it true if $I$ is a maximal ideal? If not, is it true if $I$ is the maximal ideal of a local ring $R$? If not, is it true under additional assumptions on $R$ (like $R$ is regular)?


I am on holiday using hotel Wi-Fi.  None of my apps will update, and I cannot install any new ones. Got the mesage error code 919. Is it the hotel Wi-Fi or a tablet problem (Sony S)?

I am experiencing a problem with Google Play in my Android phone. When I download new apps from the Play Store, it completes 100% and then shows me an error:  (unknown Error code during application install:''919'')


Does right continuity imply only countably many discontinuities? That is, if $f:\mathbb{R}\rightarrow \mathbb{R}$ is right continuous then does it only have countable many discontinuities?  Thanks

If $f:\mathbb{R}\to\mathbb{R}$ is a left continuous function can the set of discontinuous points of $f$ have positive Lebesgue measure?  I wondered this today, but made little progress. Thank you.


I have Android device Samsung S4.  Is that possible to turn off Battery Charging when my phone connected to my Computer via USB Cable.  Any ways to turn off or disable it from settings?

I'm using my Samsung Galaxy S2 for development so I regularly plug it while it's not fully charged, and my phone starts charging over USB. I think this (charging while in use) can affect battery life (is that correct)? Is there any way to avoid charging while the phone is on and connected via USB?


The planes are: $$2x-3y+z=4 \quad \text{and}\\ 4x-6y+2z=3,$$ my answer that I got as I tried so far is $\dfrac{5}{\sqrt{56}}$

The following show you the whole question.     Find the distance d bewteen two planes   \begin{eqnarray} \\C1:x+y+2z=4 \space \space~~~ \text{and}~~~ \space \space C2:3x+3y+6z=18.\\ \end{eqnarray}   Find the other plane $C3\neq C1$ that has the distance d to the plane $C2$.   According to the example my teacher gave me, the answer should be :     Am I right? However, I do not know what is normal and why there are P(5) and Q($-\frac{1}{2}$).    Thank you for your attention


Is it possible for the penalty to be played by two players as a passed ball? Means the first player can pass the ball to the second player who will kick the ball in the goal.

I saw a video of Johann Cruyff , isn't that against the rules?


Is there a way to set up the explorer in a way that it moves the selection to the files starting with the letter which was pressed on the keyboard button?  Just like Mac and Windows handle it for example.

Until now I was using a "traditional" version of Nautilus: that that comes with Ubuntu 10.10. Now I'm using 3.6.3, included with Ubuntu 13.04 (most likely any recent version is equivalent for the scope of my question, anyway).  One major difference between the two is the search-as-you-type behavior: in classic versions of Nautilus, when you typed an input, the file with the closest alphabetical match would become the selected one, the eligible files/folders being restricted to the current directory.  The new behavior is to perform an optionally-global search instead.  Can one configure Nautilus to provide the previous functionality ?


So the question is "How many different topologies exist on A union, where is |A| = n"?

I would like to know if there is like a magical formula to know how many topologies exist on a finite set  For example for $X = \{ a, b, c \}$ I found $29$, but I dont know if there are more or how to know this exact number without writing all topologies first.


In the Harry Potter books and films, we saw that Expecto Patronum is mainly used for tackling Dementors and Lethifolds. But what (if any) are other things that Expecto Patronum can be used for?  In-universe references only, please.

Inspired by :  In my answer, I had stated that Patronuses appear to not be physical beings because they have no effect on anything other than Dementors.     They don't cause leaves to stir in the movies. They passed straight through the tent. They don't appear to be bound by normal laws pf physics and can travel great distances almost immediately (Shacklebolt was presumably in London when his Patronus issued the warning). They can apparently walk across water without sinking (as they did in The Prisoner of Azkaban). They can jump, walk, and float in mid-air (as seen in the Room of Requirement in the movie version of The Order of the Phoenix). They make no footprints in lightly powdered snow (The Deathly Hallows Chapter 19) and make no sound of crunching snow as Harry does (further down the same page in Chapter 19).   I stated incorrectly that the only place in canon where there is an exception is with Dementors, where the Patronus physically fends them off with its horns.  A Dementor is clearly a physical being, if it prised Dudley's mouth open and (in the movie anyway) physically slid open the train door.)   Based on comments and further thought, I can think of at least two other examples when a Patronus interacts physically with a physical being.   As pointed out by Slytherincess, a Patronus can fend off a Lethifold (Living Shroud). When training, the Patonus took form against a Boggart, which had taken the form of a Dementor.   All three of these things have, AFAIK, only three things in common (but I may be off).   They are evil They are magical They are, indeed, physical beings.   So the question is, why can a Patronus interact with all three of these, but seems to have no physical effect on everyday things?


Hello I am Bangladesh Citizen currently studying in india and I am on a tourist  visa. In the month of October 2019 I am travelling to china for vacations and I booked a ticket from india to Bangkok and than form Bangkok to china with a layover time of 10 hours in Bangkok and I am not going to leave the airport but my flights are different, so do I need to get and Airport Transit Visa in Bangkok?

I am a Bangladeshi citizen.  will be traveling from Kolkata to Guangzhou, China.  Ticket Transit to Bangkok Bangkok suvarnabhumi airport transit ticket.  Do I need a Bangkok visa?


Having a bounty open, it's almost five days, but I haven't got any answer. But being said that "All bounties are paid for up front and non-refundable under any circumstances.", neither I am going to get an answer not the bounties back.  Though I have read somewhere in comments, that if there is no risk, everyone would have stared bounties. But isn't it unfair not to get those bounties back for those where there haven't been posted any answers or where none of the answers meets the eligibility criteria? Though you can have bounties disabled for such questions to be started again.   I could have considered deleting the question before starting bounty, but I neither got any comment nor any downvote to indicate if there is a problem with the question.  PS: Had I been Jon Skeet, loosing a thousand bounties wouldn't have mattered :)

I have  with a bounty that will expire in a few days. It looks like nobody will get the bounty; only one answer was posted during the bounty period, and it has no upvotes.  In cases like this, the bounty is thrown away.  Why isn't it refunded instead, if no answerer has earned it?


On  my badge shows Documentation Beta reputation next to Stack Overflow (where reputation is exactly the same), therefore it's showing on the top, despite I haven't edited a single page.    Secondly the link points to:        which is redirecting back to Stack Overflow user profile.  It's still fine having two of the same badges pointing to the same page, but is it necessary? Is it a bug or a feature? I think the fix would be either to correct the link, or if the documentation is part of Stack Overflow, then one icon should be enough, right?

In , in , I see my total reputation is suddenly increased.   Hover on the each community in the score board, I see the Documentation beta reputation is 4,662 (the same reputation as Stack Overflow), actually I scored only 175 in the documentation beta.  So the Stack Overflow reputations and badges are duplicating in the Area 51 score card.  As I know the  from Documentation beta to Stack Overflow is in-progress. But this is looking like a bug to me.  Screenshot for reference.


So I'd like to run World of Warcraft's .exe (wow.exe) with the following command from the terminal:   __GL_THREADED_OPTIMIZATIONS=1 WINEDEBUG=-all wine wow.exe -opengl   The reason for this is because when I launch the game with this, it literally doubles my fps.  Before I could do this so, I need to type the cd /..path/ in the terminal and then the command above.   Is there any way to make a script for this, so I could launch this with one click or two?  Thanks forward.

It's weird that creating desktop shortcuts is currently so primitive.  I found the following:   That helps.  However, if there's something wrong with the shortcut, it just doesn't do anything.  For instance, I tried to create a shortcut for this command line to create a shortcut.  When I double-click it, it just does nothing.  This is the resulting text of my "Create Desktop Shortcut.desktop" file on the desktop:  [Desktop Entry] Version=1.0 Type=Application Terminal=false Icon[en_CA]=gnome-panel-launcher Exec=/usr/bin/gnome-desktop-item-edit ~/Desktop/ --create-new Name[en_CA]=Create Desktop Shortcut Name=Create Desktop Shortcut Icon=gnome-panel-launcher   As I said, when I double-click this, or right-click it and select Open, nothing happens.  Is there a log file where something about this would be written to?


On my user profile, on Suggestions under the Activity tab, I see no spaces between "suggested edit on" and the item that I suggested an edit on on each of my suggestions:

In my profile under the  there is a small visual bug: a space is missing between the word "on" and the subsequent word.   See the following image:


I want to add options to a drop down list dynamically as per the integer value of a variable  this is my html code of dropdown list  <select class="inputreq" id="qty" name="qty"><option value="1">1</option></select>   Like below i am getting integer value at run time  var optioneValue = <%=getCurrentAttribute('item','custitem_max_qty_limit')%>         Suppose if optioneValue is 3 i want to display 3 options in dropdown list like this  <select class="inputreq" id="qty" name="qty"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> </select>   I have tried with javascript but its not working..I am new to this can we achieve this using jquery?  <script type="text/javascript"> var i = 1; while ( i <= <%=getCurrentAttribute('item','custitem_max_qty_limit')%> ) { var addSelectOption = document.getElementById('qty'); addSelectOption.options[i-1]= new Option(i,i); i++; // Increment i } </script>

What is the best method for adding options to a <select> from a JavaScript object using jQuery?  I'm looking for something that I don't need a plugin to do, but I would also be interested in the plugins that are out there.  This is what I did:  selectValues = { "1": "test 1", "2": "test 2" };  for (key in selectValues) {   if (typeof (selectValues[key] == 'string') {     $('#mySelect').append('<option value="' + key + '">' + selectValues[key] + '</option>');   } }   A clean/simple solution:  This is a cleaned up and simplified :  $.each(selectValues, function(key, value) {      $('#mySelect')           .append($('<option>', { value : key })           .text(value)); });   Changes from matdumsa's: (1) removed the close tag for the option inside append() and (2) moved the properties/attributes into an map as the second parameter of append().


This is a recurrent issue I have always had while dealing with iterations or actions over files found using find. I have the following files:  $ find . -name "*ES 03-11*"  ./01jan/ES 03-11.txt ./02feb/ES 03-11.txt ./03mar/ES 03-11.txt ./04apr/ES 03-11.txt ./05may/ES 03-11.txt  And I would like to launch the following command: $ cat "./01jan/ES 03-11.txt" "./02feb/ES 03-11.txt" "./03mar/ES 03-11.txt" "./04apr/ES 03-11.txt" "./05may/ES 03-11.txt" | process  Which means concatenating each line provided by find but enclosed into double quotes or simple quotes I guess. I have tried this: find . -name "*ES 03-11*" | awk '{printf "\"%s\" ", $0}' | xargs cat | process  Which seems to work, but I am wondering if there is any other way to do it without using awk or doing something easy to remember or type. I am using FreeBSD and Bourne Shell.

I want to redirect the output of the find command to cat command so I can print the data of the given file.   So for example if the output of find is /aFile/readme then the cat should be interpreted as cat ./aFile/readme. How can I do that instantly ?  Do I have to use pipes ?   I tried versions of this :  cat | find ./inhere -size 1033c 2> /dev/null   But I guess this is completely wrong? Of course I'm sure that the output is only one file and not multiple files.  So how can I do that ? I've searched on Google and couldn't find a solution, probably because I didn't search right :P


In an analysis lecture today the lecturer used the following curly D symbol to denote a dissection (for a Riemann integral):    How can I get this symbol with LaTeX? I've tried to find it in the comprehensive symbol list, as well as with Detexify, but haven't succeeded.

I know what my symbol or character looks like, but I don't know what the command is or which math alphabet it came from. How do I go about finding this out?


What is the probability that a 6 digit number selected at random contains at most three digits repeated?  I'm new to probability, and try as I might, I cannot solve this. Any help will be appreciated.  P.S. first digit cannot be zero

How many 6 digit numbers are possible with at most three digits repeated?  My attempt:  The possibilities are:   A)(3,2,1) One set of three repeated digit, another set of two repeated digit and another digit (Like, 353325, 126161)  B)(3,1,1,1) One set of three repeated digit, and three different digits.(Like 446394, 888764)  C)(2,2,1,1) Two sets of two repeated digits and two different digits (Like, 363615, 445598)  D)(2,2,2) Three sets of two repeated digits (Like, 223344, 547547)  E)(2,1,1,1,1,1) One set of two repeated digit and four different digits (Like 317653, 770986)  F)(1,1,1,1,1,1) Six Different digits (like 457326, 912568)  G)(3,3) Two pairs of three repeated digits. Let's try to calculate each possibilities separately.    F) is the easiest calculate.   Let us try to workout  Case E)  Let's divide the case into two parts:  Case E(1) Zero is not one of the digit   We can choose any $5$ numbers form $9$ numbers $(1,2,3,\cdot, 9)$ in $\binom{9}{5}$ ways , the digit which one is repeated can be chosen in 5 ways, and you can permute the digits in $\frac{6!}{2!}$ ways. The total number of ways$=\binom{9}{5}\times 5\times \frac{6!}{2!} $  Case E(2) Zero is one of the digit.  Case E(2)(a) Zero is the repeated digit We need to choose four other numbers which can be done in $\binom{9}{4}$ ways, the digits can be permuted in $\frac{6!}{2!}$ ways, but we need to exclude the once which starts with zero ($5!$ many). The total number of ways =$=\binom{9}{4}\times  (\frac{6!}{2!} -5!)$.  Case E(2)(b) Zero is not the repeated digit We need to choose four other numbers which can be done in $\binom{9}{4}$ ways, the repeated digit can be chosen in 4 ways,  the digits can be permuted in $\frac{6!}{2!}$ ways, but we need to exclude the once which starts with zero ($5!$ many). The total number of ways =$=\binom{9}{4}\times 4\times  (\frac{6!}{2!} -5!)$.  Before, proceeding to workout the other cases, I want to know   Is my attempt correct? If it is correct, it is too lengthy, is there any other way to solve this?


I have it tamed, but it still doesn't follow me. It just walks away after I feed it.   I stayed away from it (about 10 or 5 blocks) and didn't move so it would come to me, I fed it fish and red hearts formed above, and after that, as soon as I started to leave it didn't follow me, or wear the collar or anything. Is that supposed to happen?

I have several raw fish and have been trying to tame an ocelot. However, every time I get it to approach and feed it a fish, it simply wants to breed. I am playing on SMP, and have tried logging in/out to see if maybe the texture just didn't change, but it appears the ocelot is simply un-tamed. The  that this should tame the ocelot.  Is this a bug or a change? How can I tame this ocelot?    Here is a screenshot of my second attempt. This time, unlike last, clicking with the fish caused the ocelot to also flee. I am not sure if this is the same ocelot or not.


Why not make it mandatory to leave a reason or at least a remark of some sort whenever down voting?  You see more and more often questions being down voted while many times they are simply perfectly legitimate, as questions/as people being unable to achieve some desirable result. I am not talking about "Hey, please do this and that for me, thanks :D " posts.  I would like to know what reasons there are for not making it mandatory to leave a reason for a down vote.

Note: If you're looking for a simple explanation as to why comments aren't required on downvotes, see .   I used to get "upset" (though that is too strong a term) when I got downvoted without comment. If my answer isn't good enough then I'd like to know why. Not only does it improve the answer for the OP but it improves my knowledge too.  Where the down-vote has been explained I've found it useful & it has improved my answer, or forced me to delete the answer if it was totally wrong.  So is there any way we can encourage people to leave a comment? Perhaps they don't lose rep if they explain their down-vote?  I must admit though that I haven't always explained my down-vote either so you could call me a hypocrite. I've also grown a thicker skin over the months of using SO (it seems to have come with the higher rep score ;-)), so I'm less bothered about this now.


If I take a infinite-dimensional square matrix, what can I say about its eigenvalue spectrum? Will they have a discrete infinity of eigenvalues or continuous infinity of them?

In my quantum mechanics class, my professor explained that the Hamiltonian along with position and momentum operators can be represented by matrices of countable dimension. This is especially usefull in harmonic oscillator problems. My professor explained that the eigenvalues of the Hamiltonian are (of course) the discrete allowed energies of the system, while the eigenvalues of the position operator are all possible positions, a continuum. How can a countable matrix have an uncountable number of eigenvalues? Why do the Hamiltonian and the position operator have the same dimension but different numbers of eigenvalues?


So, I installed server edition 16.04.  Network manager is not installed.   > ~$ less /etc/network/interfaces  >#auto  enp3s0 >#iface lo inet loopback  >iface enp3s0 inet dhcp   I have tried various combinations here, but with this spesifik config i can reboot and  lo still comes up.  Seems that no matter what I set i etc/network/interfaceses, it is ignored and the computer brings up lo and enp3s0 on every boot.   Can anyone help?

I've just installed ubuntu server 17.10. During installation, it suggested me to connect to the network through wifi, and so i did. After installation was finished and system was rebooted, computer connected to the wifi automatically (which means, it saved the connection creds somewhere). But in /etc/network/interfaces i found nothing. I need my computer connect to wifi network with static ip, so I've put configuration into the /etc/network/interfaces:  # /etc/network/interfaces -- configuration file for ifup(8), ifdown(8) # Generated by debian-installer.  # The loopback interface auto lo iface lo inet loopback   iface wlp2s0b1 inet static         wpa-driver wext         address 192.168.0.12         netmask 255.255.255.0         gateway 192.168.0.1         wpa-ssid *****         wpa-psk **********         dns-nameservers 8.8.8.8 192.168.0.1 auto wlp2s0b1   When system starts, it doesn't connect using my configuration. It does only after  sudo ifdown wlp2s0b1 && sudo ifup -v wlp2s0b1  and after this command, system getting a SECOND IP! Server is still available by the ip it gets from DHCP, and in the same time, it is available by the static ip!


I have a drive that I cannot boot, but it has an installation of Windows 8 on it. I need to know what type of Windows 8 it has. Is there a folder or file I can look at that might give me a clue as to the flavor of 8 (Standard, Pro, Enterprise, or RT) I need to use for a recovery installation?   Since the OS is not booting even in safe mode I can only use command prompt. Thanks.

I am attempting to recover an old computer that won't boot and I'm not sure what version of Windows it is running. How do I tell simply by examining the file system?  I am fairly confident it is either Vista or Windows 7. There is a small chance it is Windows Server 2008.


Is the Collatz function $x\mapsto\dfrac{3x+1}{2^{\nu_2(3x+1)}}$ continuous on $\Bbb Z_2^\times$? Let $\Bbb Z_2^\times$ be the 2-adic units. Then e.g. $3\mapsto\dfrac{10}2=5$ Attempt Here's what I know:  The function above can be thought of as a map $x\mapsto3x+2^{\nu_2(x)}$ on all of $\Bbb Z_2\to\Bbb Z_2$ which descends to the quotient map $x\mapsto\{2^ix\in\Bbb Z_2:i\in\Bbb Z\}$. Since $x\mapsto3x+2^{\nu_2(x)}$ is continuous and the function $x\mapsto\dfrac{3x+1}{2^{\nu_2(3x+1)}}$ descends to the quotient, it must too be continuous on $\Bbb Z_2/{\sim}$ However, I think $\Bbb Z_2/{\sim}$ isn't homeomorphic to $\Bbb Z_2^\times$.  If it were, I could answer in the positive.  There's an obvious bijection between them but I think $\Bbb Z_2/{\sim}$ has the trivial topology because every element is arbitrarily close to $0$.  So the trivial continuity in $\Bbb Z_2/{\sim}$ says nothing of continuity in $\Bbb Z_2^\times$.

How do I show a function on 2-adic units is continuous (using the 2-adic metric)?   I'd be happy to learn the general rule or definition. But in particular I need to show that $f(x)=\dfrac{3x+1}{2^{v_2(3x+1)}}$ is continuous at all odd numbers.  Since the function is isometric in $\lvert\cdot\rvert_2$, i.e. since $\lvert f(x)\rvert_2=\lvert x\rvert_2$ every orbit of the function is duplicated, multiplied by any power of $2$.  This can therefore be formulated in various ways; as a function though the odd numbers, through the dyadic rationals, but the following seems good to work with.  If we let $n$ be a positive integer and $k$ be the power of $2$ we can define:  $f(2^k(2n+1))=(3(2n+1)+1)\cdot2^k\cdot\lvert3(2n+1)+1\rvert_2$  So $f(2^k(2n+1)=(3n+2)\times2^k\times\lvert3n+2\rvert_2$  Here is what I have so far:  I think to prove continuity in the 2-adic metric I need $\lvert x_n-x\rvert_2=0\implies\lvert f(x_n)-f(x)\rvert_2=0$  I think $k$ and $n$ are independent so I think I can examine them independently.  Taking $k$ to infinity brings both $x$ and $f(x)$ to zero so that seems to satisfies the continuity requirement.  Moving on to $n$; this seems to be an exercise in proving convergence within odd integers which are in a sense a subset of the 2-adic units.  I know all Cauchy sequences in these converge to 2-adic units but not much more than that.  However I do have a little insight into this particular function.  For example if we examine the inputs $x$ which map to any given output of $f(x)$, it can fairly easily be shown that these $x$'s take the form of a set $\left\{4^mp+\dfrac{4^m-1}{3}:m,n\in\mathbb{N}\right\}$ so, at least for any given output $f(x)$ the inputs always converge to $x=\frac{-1}{3}$ as the intervals between them become large powers of $2$.  In fact the orbit of the function $a(2^kx)=2^k(4x+1)$ on variation of $x$ and holding $k$ fixed is in a sense orthogonal to $f(x)$; which is a restatement of the above except not in closed form.


Question How can I create a new label for list items in the enumitem environment with tikz that include a variable (a counter in this case)? Problem Code does not compile. Runaway argument?.... Example \documentclass{article} \usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry} \usepackage{fontspec} \usepackage{graphicx} \usepackage{tikz} \usepackage{enumitem} \newcommand{\redcircle}[1]{% \begin{tikzpicture}[font=\sffamily\bfseries]     \node[shape=circle,fill=red,text=white] at (0,0) {#1}; \end{tikzpicture} }%  \begin{document}     \begin{enumerate}[label=\redcircle{\arabic*.}]         \item Test     \end{enumerate} \end{document}

I am creating a manual for an application and I would like to provide step by step directions of the application. For the step numbers, I would like to use big, blue circles with white numbers in it. Thus I was thinking if I can modify the bullet style, I would be able to achieve such list. I read few similar questions and it looks like it will have to use the enumitem package and the likes. Probably, there would be a new command for a big circle. I just don't know how to pull everything together.  Example:


I’m looking for an adjective that is similar to eponymous as in:     He is playing a role of Terminator in the eponymous movie.   Except that it should be possible to use this adjective as a substitute for the phrase “same-way called” as in:     The Luxembourg village called Shengen and the _______  located in Eurasia.

I was in London and visited the Tower Bridge. Afterwards, I went to a pub called The Tower Bridge. Just to be clear, the pub is named after the bridge.   Which of the following are correct?   The bridge is the eponym of the pub. The pub is the eponym of the bridge. From the pub, I could see the eponymous bridge. After I saw the bridge, I went to the eponymous pub. The bridge is the namesake of the pub. The pub is the namesake of the bridge.


I'm using Icegram (an "exit intent" modal popup plugin) on a page. We have click-to-call links on the page, and the problem is that anytime someone clicks to call, the browser sees it as leaving the page so our exit intent popup shows while people try to call, which is definitely not what we want.  So, I've tried adding a jQuery function to the call links, like this:    8888888888

      But no matter what I do, the "hide-icegram" class does NOT get applied to the icegram popup, so it stays visible.  I noticed that
 is inserted in the page only when it's  activated. So I'm wondering if the addClass isn't working because it's looking for the "icegram-popup" div, but it doesn't exist on page load so maybe that's the issue?  I just want the "hide-icegram" class applied to
 anytime someone clicks the call links. Any ideas?

I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off.  This happens on page ready and works just fine.  The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound.  I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.


I am applying for a tourist Schengen visa type C. It is unclear if they will grant me a multiple entry visa. My currently planned trip lasts for 30 days. So what should be the duration of the insurance?   The reason why I am asking is, is the number of entries dependent upon the duration of the insurance? That is, if the insurance is valid for 30 days then does that have any effect on issuing a multiple-entry visa (considering my first trip is 30 days)?   In other words, is having a 180 days insurance necessary for getting a multiple entry visa?

My father in law is travelling to France, for 4 days, (01/07-04/07). Is there a minimum duration for which the travel insurance needed to apply for a Schengen visa must be valid? In other words, can his travel insurance cover just the duration of the trip, or should it last longer?


When I started using TeX, it was easy to build. Today I discovered that I can use different flavor of LaTeX to build my (La)TeX files. Is there a general rule of which flavor I should consider for a regular project (let say a letter to the Tax Office)?  With inputenc and fontenc I was able to use unicode so why should I consider XeLaTeX or LuaTeX instead?

I’m interested in the differences and commonalities between the “new” (La)TeX processors:   , , and .   Personally, I’ve only used XeTeX so far and without having the time to try out all three systems, I’m having a surprisingly hard time setting them off from one each other.  As I understand it, these systems are actually very different in some regards. So I’m explicitly asking for strengths and weaknesses in every-day use (whatever that is), rather than very special scenarios.  (I’ve already asked a  on Super User some time ago.)


she says and i have seen visa, pasport and now she is  asking for 1.000 to prove she can support her self while she is here in the united states . And she says that she has every thing but does not have the funds to continue

On Travel.SE we often see questions about a person (usually a love interest) asking for money to pay for airfare, visas, permits and other expenses. For example        What general advice can be given in such situations to the person asking the question? Is it all a scam or can there be legitimate situations in which an online friend could be asking for money?


I am trying to decide on topics for my independent study this semester. I am a Pre-Doctoral Mathematics student, so looking for a more math based text rather than engineering based (which I have found a lot of). I have already taken extensive courses in probability and statistics. Looking for something more challenging and more proof based considering I have background in analysis. Know of any textbooks?

Before I ask my question, let me give you a bit of background about what I know about statistics so that you have a better sense of the types of resources that I'm looking for.  I'm a graduate student in psychology, and as such, I use statistics almost every day.  By now I'm familiar with a pretty broad array of techniques, mostly as they are implemented in the general structural equation modeling framework.  However, my training has been in the use of these techniques and the interpretation of results -- I don't have much knowledge of the formal mathematical foundations of these techniques.  However, increasingly, I've had to read papers from statistics proper.  I've found that these papers often assume a working knowledge of mathematical concepts that I don't know much about, such as linear algebra.  I have therefore become convinced that if I wish to do more than blindly use the tools that I have been taught, it would be useful for me to learn some of the mathematical basis of statistics.  So, I have two related questions:   What mathematical techniques would be useful for me to know if I want to brush up on the mathematical foundation of statistics?  I've encountered linear algebra pretty often, and I'm sure that learning about probability theory would be useful, but are there any other areas of math that would be useful for me to learn about? What resources (online or in book form) can you recommend to me as someone who wants to know more about the mathematical foundations of statistics?


I use dwm as a window manager on Ubuntu, I like tiled windows and I like them as few as possible. I sometimes need to run an application (let's say it's the pdf viewer mupdf in x11) from the terminal, the application will be launched in a new window but the terminal from which I launched becomes this prompt-less console for that application to log whatever.  I use dmenu to launch applications, but sometimes an application needs arguments (file names) to start. I use uxrvt within x11 managed by dwm.

I recently installed 12.04. When I try to edit a file with gedit, I can't use the terminal until I close the editing file or I have to open a new terminal. But I think I didn't have this problem with 11.04, however I'm not sure. Is there anyway to avoid this and to use same terminal while editing files.


Let $f$ be differentiable on $\Bbb R$ and suppose that $f'(x)\ge c >0$ for all $x$. Show that for each $y\in \Bbb R$, there is an unique $x$ such that $f(x)=y$.  By assumption and mean value theorem, $f$ is strictly increasing on $\Bbb R$. If I can prove $\lim \limits_{x\to \infty}f(x)=\infty$ and $\lim \limits_{x\to -\infty}f(x)=-\infty$. Then by definition, Given $y>0$, there exist $t_0$ and $t_1$ such that $f(t_0)>y$ and $f(t_1)<-y<y$. By intermediate value theorem, there exists $z$ between $t_0$ and $t_1$ such that $f(z)=y$, and since $f$ is strictly increasing, this $z$ is unique. We can do it for any $y\in \Bbb R$, so we are done. I want to ask how to prove $\lim \limits_{x\to \infty}f(x)=\infty$ and $\lim \limits_{x\to -\infty}f(x)=-\infty$?

Let $f : \mathbb{R} \longrightarrow \mathbb{R}$ be a differentiable function such as $\forall x \in \mathbb{R}, f'(x) > 2$. What could I do to show that $\exists c \in \mathbb{R} : f(c) = 0$ ? At first I thought I could use the mean value theorem but it did not help me. In fact, I don't really understand why $f(x)$ couldn't be strictly positive $\forall x \in \mathbb{R}$. Would you know how to proceed ? Thanks for your help.


Let $Q_n$ be the $n-dimensional$ cube graph:  Its vertices are all the $n-tuples$ of $0$ and $1$ with two vertices being adjacent if they dier in precisely one position.For example, in $Q_3$, the vertices $(1,0,0)$ and $(1,0,1)$ are adjacent because they differ only in the third position.Show that $Q_n$is bipartite.  Can anybody help me with this question please?

How to find chromatic number the $n$-dimensional hypercube $Q_n$?  I know $\chi(Q_2)$=2 , $\chi(Q_3)$=2 , $\chi(Q_4)$=4


Given is the polynomial $\varphi(X)=X^4+1$.  Now there are two tasks:  (1) Show, that $ \varphi(X)$ is reducible in $\mathbb F_p [X]$, where $p$ is prime number with  $p \equiv1$ (mod 4).  (2) Show, that $ \varphi(X)$ is reducible in $\mathbb F_p [X]$, where $p$ is prime number with  $p \equiv3$ (mod 4).  My ideas until now:  (1) I try to find $a,b \in \mathbb F_p [X]$, such that $X^4+1 = (X^2+a)(X^2+b)$. Not to use the middleterm $+cX$ was a hint. Now $(X^2+a)(X^2+b)=X^4+aX^2+bX^2+ab=X^4+(a+b)X^2+ab$. This should equal $X^4+1$, so I know, that $a+b \equiv 0$ mod p and $ab \equiv 1$ mod p. This means, that $a$ and $b$ must be units in $\mathbb F_p$, more exactly, $a$ is the multiplicative inverse element of $b$ in $\mathbb F_p$. $a+b \equiv 0$ reasons, that $a$ is the additive inverse to $b$.  But know I don't know, how I can go on with conclusion. I hope, somebody can help me.

How to show that $x^4+1$ is irreducible in $\mathbb Z[x]$ but it is reducible modulo every prime $p$?   For example I know that $x^4+1=(x+1)^4\bmod 2$. Also $\bmod 3$ we have that $0,1,2$ are not solutions of $x^4+1=0$ then if it is reducible the factors are of degree $2$. This gives that $x^4+1=(x^2+ax+b)(x^2+cx+d)$ and solving this system of equations $\bmod 3$  gives that $x^4+1=(x^2+x+2) (x^2+2x+2) \pmod 3$. But is there a simpler method to factor $x^4+1$ modulo a prime $p$?


I have a free project that is all based on Free and Open source programs:   some of them have pom and public accessible jars some of them have pom but no public accessible jars some of them have no pom   I want to distribute the project as a unique jar since all licences are compatible I legally can, if it's possible to generate such a jar with maven, I don't know how. Can you help?  If it's not possible what is the best way to distribute such project?    My pom is managed by netbeans, here is the missing configuration:  <build>     <plugins>         <plugin>             <groupId>org.apache.maven.plugins</groupId>             <artifactId>maven-compiler-plugin</artifactId>             <version>2.3.2</version>             <configuration>                 <source>1.7</source>                 <target>1.7</target>             </configuration>         </plugin>         <!-- I added the following -->         <plugin>             <groupId>org.apache.maven.plugins</groupId>             <artifactId>maven-assembly-plugin</artifactId>             <configuration>                 <descriptorRefs>                     <descriptorRef>jar-with-dependencies</descriptorRef>                 </descriptorRefs>                 <archive>                     <manifest>                         <mainClass>net.hypermove.graphitidb.GraphitiDB</mainClass>                     </manifest>                 </archive>             </configuration>         </plugin>     </plugins> </build>

I want to package my project in a single executable JAR for distribution.  How can I make a Maven project package all dependency JARs into my output JAR?


I have on DB2 table that stores one Json string on one of the fields and I need to get this value and display on a browser, so this is here my problem begins...  Some json string has German chars that for some reason only when I execute the php from a browser gets error 5 on json_last_error(), if I execute the same script on terminal, it execute with success.  Another thing is, if I get the same json string, and put direct on a var instead of get the var from DB2 using db2_exec() it works too.  so I built one script to test, and here my tests:  EXECUTING FROM TERMINAL:  message to be decoded:  From DB: {"location":" Ã–sterr","street1":"straÃŸe"}  From var: {"location":" Ã–sterr","street1":"straÃŸe"}  -------------------------------------------------------------  Json Decode From Var... stdClass Object (     [location] =>  Ã–sterr     [street1] => straÃŸe )   -------------------------------------------------------------  Json Error Checking Json Decode Var...   - No errors  -------------------------------------------------------------  Json Decode From DB... stdClass Object (     [location] =>  Ã–sterr     [street1] => straÃŸe )   -------------------------------------------------------------  Json Error Checking Json Decode DB...   - No errors   EXECUTING FROM BROWSER:    I already tried:  utf8_encode() - but this does nothing and the var still the same.  iconv - get an error saying that there is one invalid char.  I am running out of options to solve this.. I really need help on this.  Thank you.

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 have two stochastic variable $X\sim B(n,p)$ and $Y\sim B(m,p)$, I need to prove that $Z=X+Y \sim B(n+m,p)$.  Why is $$\sum_{k=0}^{u} \binom{n}{k} \binom{m}{u-k} = \binom{n+m}{u}$$

How can we prove that     $$\sum_{k=0}^{n}\binom{R}{k}\binom{M}{n-k}=\binom{R+M}{n}?$$   (Presumptive) Source: Theoretical Exercise 8, Ch 1, A First Course in Probability, 8th ed by Sheldon Ross.


I set up a bounty of 50. No one made a good answer, and the only answer available has 0 votes.  The bounty perioid now has expired. Did I simply lost 50 of reputation without getting nothig back?  Question:

I have started a bounty:   It expires in 3 days. I don't have an appropriate answer to accept, and the only answer which it has gotten has no votes.  So am I going to simply lose 100 reputation without getting a satisfactory answer?  Or should I accept the lone inappropriate answer so that I will not lose my right to accept answers to any questions which I might ask in the future, which is what the bounty rules claim?


I have 200 files in a folder. I downloaded them in a certain order -- often only a few seconds apart. I would like to append a number to the beginning of each of the files.  So the first file I downloaded (the oldest one) would need to change from name.txt to 001_name.txt.  All the way up to the last file (most recently downloaded) changing from name.txt to 200_name.txt.  How can I do it using the command-line?

I've got some photos with quite random names, but the dates (not exif, but when they were last edited) are correct. I'd like to rename them in that order, preferably so that the first photo is named 1.jpg and so on, but anything goes. How can I do that?


Her coming home was unprecedented?  Do all verbs have gerunds like "coming" in the sentence above?

I assume that the following sentences are grammatically correct:   He resents your being more popular than he is. Most of the members paid their dues without my asking them. They objected to the youngest girl's being given the command position. What do you think about his buying such an expensive car? We were all sorry about Jane's losing her parents like that.   I'm still getting used to this possessive gerund structure. It sounded so weird to me at first. Is the structure used in both formal and informal contexts? Are there any alternative structures that result in the same meaning and are more frequently used? (Examples taken from )


Reading the  of dealing with  in Javascript, I am still uncertain because I can compare the value with a forged value, while I should compare only to a "enum" type value:   var DaysEnum = {"monday":1, "tuesday":2, "wednesday":3, ...}  Object.freeze(DaysEnum)   switch( day ){    case "monday":      return "Hello"    case "tuesday":      return "Hi"    case "blahblahday":      return "No"  }   The strings I made the switch to compare against ("monday", "tuesday", "blahblahday") are totally free from my "enum type: DaysEnum", can be provided by the user and this could lead to some subtle errors not spotted by the interpreter (like typos).  Is there a way to have/lock unique index values of the Enum object?

Would the following make the objects fulfill all charasteristics that enums have in JavaScript? Something like: my.namespace.ColorEnum = {     RED : 0,     GREEN : 1,     BLUE : 2 }  // later on  if(currentColor == my.namespace.ColorEnum.RED) {    // whatever }  Or is there some other way I can do this?


Find the number of ways in which $1000$ can be written as a sum of two or more consecutive natural numbers.  The number of ways of finding the sum of two or more consecutive number will be 1 less than the number of odd factors of 1000. How?

All the positive numbers can be expressed as a sum of one, two or more consecutive positive integers. For example $9$ can be expressed in three such ways, $2+3+4$, $4+5$ or simply  $9$. In how many ways can a number be expressed as a sum of consecutive numbers?  In how many ways can this work for $65$?  Here, for $9$ answer is $3$, for $10$ answer is $3$, for $11$ answer is $2$.


Is it possible to remap MAC to treat a certain key combination as a different key. As example, I want to CTRL+P to act as ArrowUp. In Terminal and InteliJ I have it working already as that. However, it becomes surprising to not have the same behavior in other places as well. Hence, to avoid trying to figure out how to remap the key in every app that I use I was wondering whether it was possible to do the remapping at Operating System level for CTRL+P to be treated as a press of ArrowUp.

I used to use  to remap Right Alt to Right Control (as an Emacs user I use Control MUCH more that Alt) but updating to Sierra broke this.  Downgrading is not an option.  How do I manually remap keys in Sierra?  I specifically would like to remap Right Alt to Right Control.


Let $R$ be a ring with unity, and suppose $x\in R$ is nilpotent $(i.e. x^n=0$ for some positive integer $n$ $)$. Prove that $1-x$ is a unit in $R$.  Any hints or proofs are greatly appreciated. Rings are really new to me.

Let $(A, +, \cdot)$ be a ring with $1$.  An element $a\in A$ is nilpotent if there exists $n\in \mathbb{N}$ so that $a^n=0$.      Show that if $a$ is nilpotent then $1+a$ and $1-a$ are invertible.


On a document library (under SP2013) we have created multiple views. In the view selector, the default view is listed at leftmost. All the other views are sorted in alphabetical order based on the view name.  Our user would like to determine the sorting order of view selector. Take below screenshot as example, how can we put the view selector in this order:   Deeds - Permits - All Documents - Agreements    P.S. I have read  and seems a good start but not exactly answer my question.

How do I re-order the views? E.g. "To be invoiced" to appear where "Current invoice" appears


While talking about blood purity to Harry, Hagrid says this.     And it's codswallop, to boot. 'Dirty blood.' Why, there isn’t a wizard alive today that’s not half-blood or less.   The question  indicates that all Wizard families are muggle born at some point. So how did the concept of 'blood purity' arise, and what did Hagrid mean by 'Half blood or less'?

What is a wizard that makes them non-Muggle? Or, more directly, what ancestry does the witch/wizard gene follow? Is there a patriarchal wizard (or matriarchal witch) that Muggles have no part in? Elves perhaps? Stop reading here.  Purpose of the Question/History/Don't Read There seem to be solid consequences associated with being Muggle, or Muggle-related. A dominant theme in the novels is discrimination against the non-gifted race, but, when read into, the wizard bloodline doesn't appear all that well defined. JKR indicates that wizard-ness is genetic, or inherited:  "Muggle-borns will have a witch or wizard somewhere on their family tree, in some cases many, many generations back. The gene resurfaces in some unexpected places."  By the above, it stands that a family that produces a squib (non-magical born of magical parents) must be a half-blooded family in some way, since half-blooded only requires one non-magical ancestor. Of course, we are dealing in magic genetics. Any other form of genetics would make this inherited, seemingly recessive trait (or squibs couldn't exist), never appear at all. Unless they were XMen. If it is so important, what does the wizard-bloodline follow? Other Mythos In other literature a wizard can be nearly anything, but magical powers are typically inherited as well as learned. Merlin of the Arthurian Legend (also mentioned in HP) is Cambian, meaning he is born of demonic intervention; this explains his source of enchantment. Gandalf of Middle Earth is a Maiar, as are all Wizards of Middle Earth. Wizards in Harry Potter seem to follow a bloodline, and it has been mentioned (in the question Gabe linked) that genetics have a heavy play in it, meaning that squibs and parents of Muggle-born wizards should have identical genetics. This bloodline must come from somewhere. Magical Creatures In Harry Potter it is common for magical creatures to "mingle" with humans, these beings are typically somewhat magical. Elves have been described to have very strong magic, but are for some unreasonable reason subservient to humans. I may be mistaken, but believe it was hinted that elves and the wizarding lineage had intersected at one time. Maybe I'm imagining this. Genocidal Allusions Voldemort hates muggles, and half-bloods, and whatever else is non-wizard. The presence of this theme, suggests that this wizardly bloodline must be at least defined if the main antagonist is so obsessed with keeping that mysterious bloodline pure. Since Slytherin himself was said to be a supremacist (circa a really long time ago) it suggests that this bloodline should have existed long before he was around, especially if he founded a school with people he was not related to, but were also magical.


So I am having trouble trying to loop through an array list but i dont want to use a println statement to print the elements from the array list. Is it possible if i could store all the elements into a local variable through each loop and then return the local variable when i call the method later on?e Here is my code:  public String displayProperties() {         String property = null;         for (int i = 0; i < properties.size(); i++) {             property = properties.get(i);         }         return property;          }

I have an ArrayList that I want to output completely as a String. Essentially I want to output it in order using the toString of each element separated by tabs. Is there any fast way to do this? You could loop through it (or remove each element) and concatenate it to a String but I think this will be very slow.


I never fully understood why the Lagrangian density (let's say for a scalar field) was restricted to have only first order derivatives of the field in time and space in QFT. One reason I can think of is to ensure locality. But that doesn't restrict one from having a finite number of higher-order derivatives of the field, does it? Thanks!

Why is the Lagrangian a function of the position and velocity (possibly also of time) and why are dependences on higher order derivatives (acceleration, jerk,...) excluded?  Is there a good reason for this or is it simply "because it works".


In  question it is recommended repeatedly that to figure out where an executable is located, one should run command -v file.  I've tried running command -v ls on a few different systems now and I keep getting alias ls='ls --color=auto' (always in Bash).  I have three questions:   What am I missing? How is it that command -v ls helps? Given that which doesn't work properly (according to the comments and answers to the linked question) and assuming that I'm not missing anything in question 1 and command -v ls does help, how can I know which ls is actually ran? What is a POSIX compliant way of figuring this out? My examples are in Bash, but I'm hoping for a portable solution. I know about type -P.

Like most users, I have a bunch of aliases set up to give a default set of flags for frequently used programs. For instance,  alias vim='vim -X' alias grep='grep -E' alias ls='ls -G'   The problem is that if I want to use which to see where my vim/grep/ls/etc is coming from, the alias gets in the way:  $ which vim vim: aliased to vim -X   This is useful output, but not what I'm looking for in this case; I know vim is aliased to vim -X but I want to know where that vim is coming from.  Short of temporarily un-defining the alias just so I can use which on it, is there an easy way to have which 'unwrap' the alias and run itself on that?  Edit: It seems that which is a shell-builtin with different behaviors across different shells. In Bash, SiegeX's suggestion of the --skip-alias flag works; however, I'm on Zsh. Does something similar exist there?


The reason I ask is because Valerica won't offer it and I don't know if it's glitched or she doesn't offer it.

I've finished Dawnguard and chose to cure Serana of vampirism, but now I think I'd like to have the option of become a vampire lord and getting bloodcursed arrows. I've done some basic console fiddling but was unable to faithfully reproduce a vampire lord transformation (adding the vampire lord spell turns you into a weaksauce version that dies in 2 hits on Master). Mods and console commands welcome, though I'd prefer something along the lines of Valerica taking on Serana's "duties" or simply turning Serana back into a vampire lord.