Too many dml rows:10001 - why is this error thrown when the maximum number of records SOQL can return is 50,000.

when I try to run the code below I am getting this error: 'Too many DML rows: 10001'. The object that I am trying to update is one of the main object in the org. so it has multiples triggers, workflows, etc. and one API that runs all day long. I am trying to update 29000 records. can anybody please tell me why i am getting this error or if something is wrong with the code. I will appreciate any help!  Class code:     public class updateNRProdObject{    public Decimal Debug{ get; set; }         public void updateObject(){     List<NRProducts__c> products = [SELECT id  FROM NRProducts__c WHERE  Active__c = true];   Debug = products.size();    for(NRProducts__c p : products){       p.Active__c=false;    }    update products ;   } }


I just began filling out a survey for a contest that Walmart is hosting. Since I live in Canada there is a skill testing question which was as follows: $$(4×2)+(6/3)?5=$$ The answer to the equation was omitted.  What kind of mathematical significance does the question mark hold?  I have tried Googling the equation for an explanation, but to no avail.  Is the equation bunk?  FWIW, the answer turned out to be 5... so obviously the question mark represented a subtraction symbol, but how was I ever supposed to induce that if the answer is/was omitted?

I just began filling out a survey for a contest that Walmart is hosting. Since I live in Canada there is a skill testing question which was as follows: $$(4×2)+(6/3) ? 5 =$$ The answer to the equation is/was omitted.  What kind of mathematical significance does the question mark hold?  I have tried Googling the equation for an explanation, but to no avail. Is the equation bunk?  FWIW, the answer turned out to be 5... so obviously the question mark represented a subtraction symbol, but how was I ever supposed to induce that if the answer is/was omitted?


I've read the  about HeartBleed, but still wonder if it affects openssh servers? Most people talk about HTTPs and VPN.

The OpenSSL 'heartbleed' vulnerability () affects webservers serving HTTPS. Other services also use OpenSSL. Are these services also vulnerable to heartbleed-like data leakage?  I'm thinking in particular of   sshd secure SMTP, IMAP etc -- dovecot, exim & postfix VPN servers -- openvpn and friends   all of which, on my systems at least, are linked to the OpenSSL libraries.


I have Date like this Sun May 20 09:18:44 GMT+04:30 2018 how i can get clock from this Date, i want result like this 09:18 am  Log.v(TAG,"date "+ date.toString());// output is Sun May 20 09:18:44 GMT+04:30 2018 SimpleDateFormat sdf=new SimpleDateFormat("hh:mm"); String time=sdf.format(date);//NullPointerException

How to format correctly according to the device configuration date and time when having a year, month, day, hour and minute?


I am not able to understand the following assignment  statement:  ImageButton btnsave = (sender) as ImageButton;   what it actually does?

When programming interfaces, I've found I'm doing a lot of casting or object type conversion.  Is there a difference between these two methods of conversion?  If so, is there a cost difference or how does this affect my program?  public interface IMyInterface {     void AMethod(); }  public class MyClass : IMyInterface {     public void AMethod()     {        //Do work     }      // Other helper methods.... }  public class Implementation {     IMyInterface _MyObj;     MyClass _myCls1;     MyClass _myCls2;      public Implementation()     {         _MyObj = new MyClass();          // What is the difference here:         _myCls1 = (MyClass)_MyObj;         _myCls2 = (_MyObj as MyClass);     } }   Also, what is "in general" the preferred method?


I'm not 100% sure if this is suitable for meta but anyhow.  In , I can type this as shown in the image.  Note - the letter is the Hebrew letter aleph (UTF-16 code of 05D0). It can be copy/pasted from charmap.    On a Stack Exchange site, I can type  aaa,אאא,bbb  and have it aligned left.  But I can't see how to type the other line. It keeps ending up looking like 1,אאא,2  Even if I type 1 then, then אאא, and then 2, it ends up as 1, then 2, and then אאא.  Interestingly, if I type 1, then 2, and then אאא it also ends up in that order, 1, then 2, and then אאא.  Hebrew is a right-to-left language...  It seems that the Stack Exchange site is counting the number and the comma as Hebrew... And thus it won't do it; it won't put the comma after the Hebrew, whereas a word seems to count comma as English, and so lets me.  And that's even when/though I'm using the English keyboard to type comma.  I've tagged it bug, but I don't know if one would call it a bug...  has the same issue... Word is fine... But it seems strange that whether I type the keys 1,aleph,aleph,aleph,2 or I type 1,2,aleph,aleph,aleph, the text comes up the same order,  1,2,aleph,aleph,aleph. That, and that I can't get 1,aleph,aleph,aleph,2 to appear in that order.

You know, some of us read right to left...  Certain sites like  and  have an obvious need for this, as Arabic and Hebrew are Right To Left (RTL) languages. Many answers on those sites cite the Torah and the Quran respectively. Directly quoting these sources properly requires RTL text.


$Z = x+ iy$ Find real and imaginary part of $\sqrt{x+iy}$ I don't know how to even begin with this , I am really confused

If I'm given a complex number (say $9 + 4i$), how do I calculate its square root?


I have a code and it is almost complete. If you type something and a "," in input box it will add a tag.  I just need to insert/add those tags in input box, not before the input box.  Somehow I managed to insert/add those tags in a div before the input box.  What should I use instead of this code div.insertBefore(tag.element, maininput);.  Here is the main code    var i;  var tags=[];  var close=document.getElementsByClassName("close");  for(i=0; i<close.length; i++){  close[i].onclick=function(){  this.parentElement.style.display="none";  }  }  var div=document.createElement("DIV");  document.body.appendChild(div);  div.className="tags-input";  var maininput=document.createElement("INPUT");  var hiddeninput=document.createElement("INPUT");  div.appendChild(maininput);  maininput.setAttribute("type", "text");  maininput.setAttribute("class", "main-input");  div.appendChild(hiddeninput);  hiddeninput.setAttribute("type", "hidden");  hiddeninput.setAttribute("class", "tags-input");  maininput.addEventListener("input", function(t){  var enteredTags=maininput.value.split(",");  if(enteredTags.length>1){  maininput.value="";  enteredTags.forEach(function(t){  var filter=filterTag(t);  if(filter.length>0){  addTag(filter);  }  });  }  });  addTag("HTML");  function addTag(text){  var tag={  text: text,  element: document.createElement("SPAN")  };  tag.element.className="tag";  tag.element.textContent=text;  var span2=document.createElement("SPAN");  span2.className="close";  var cl=tag.element.appendChild(span2);  tags.push(tag);  span2.addEventListener("click", function(){  this.parentElement.style.display="none";  removeTag();  });  div.insertBefore(tag.element, maininput);  refreshTag()  }  function removeTag(){  tags.splice(tags.indexOf(tags), 1);  refreshTag()  }  function refreshTag(){  var taglist=[];  tags.forEach(function(t){  taglist.push(t.text);  });  hiddeninput.value=taglist.join(",");  }  function filterTag(tag){  return tag.replace(/[^\w -]/g, "").trim().replace(/\W+/g, "-");  } .tag{      padding:4px;   padding-left:10px;   padding-right:20px;   background:#ddd;   color:black;   margin-right:10px;   user-select:none;  }   .tag:hover{            background:#2196f3;      color:white;      }     .close::after{           content:"x";           position:absolute;           padding:3.5px;     margin-top:-4px;           cursor:pointer;     user-select:none;     margin-left:2px;           }    .close:hover::after{              color:gray;               } <!DOCTYPE html>  <html>  <body>  </body>  </html>

What solutions accomplish the same auto-completion that SO uses for entering tags?  There are plugins that can handle one word but I haven't seen any that handle multiple words.


I am learning LaTeX from a book, and I am using TeXnicCenter. The book has a chapter about the graphics package, so I download it and try the commands. But I find that when I use commands like \scalebox and \resizebox, they cannot take effect. Also, the PDF seems to be "dead" after that, i.e. when I make some changes and click "build and view", the PDF remains unchanged. I have tried the graphicx package but the result is the same.  For example, firstly I type  \documentclass[12pt]{article} \usepackage{amsfonts, amsmath, amsthm, amstext, amssymb, amscd, ulem, array} \begin{document} abc \end{document}   then this produces a pdf with a word 'abc'. At the bottom of TeXnicCenter, I see 0 error, 0 warning, 0 bad box, and 1 page.  Then I change it to  \documentclass[12pt]{article} \usepackage{amsfonts, amsmath, amsthm, amstext, amssymb, amscd, ulem, array} \usepackage{graphicx} \begin{document} \scalebox{2}{abc} \end{document}   The same pdf occurs, i.e. no size enlarged. At the bottom of TeXnicCenter, I see 0 error, 0 warning, 0 bad box, and 0 page.  Finally I change it to  \documentclass[12pt]{article} \usepackage{amsfonts, amsmath, amsthm, amstext, amssymb, amscd, ulem, array} \usepackage{graphicx} \begin{document} \scalebox{2}{efg} \end{document}   I still see the word 'abc' with the same size. At the bottom of TeXnicCenter, I see 0 error, 0 warning, 0 bad box, and 0 page.  Would any one please help me?  In the output area of the TeXnicCenter, I find the following which is unusual:  "C\User\user\Desktop\myfile\test.aux)pdflatex.exe: GUI framework cannot be initialized."

I don't know what I've done, but all of a sudden I am unable to compile any document which uses the geometry package. Minimal (non)-working example:     \documentclass[11pt]{article}      \usepackage{geometry}  \begin{document} test \end{document}   doesn't produce any output, and this is what I see in my error summary screen in TeXnicCenter:    The red arrow points to what seems to be the problem: something about the bundle "oberdiek" and its package "ifvtex" is causing pdflatex.exe (which, while I don't really know what it does, sounds pretty important) to "not be initialized". I , and it's relevance here is a mystery to me.  I've confirmed that all of my files without the geometry package compile just fine; however, that doesn't mean that the problem is with the geometry package - what seems more likely is that there is some hidden cause of the error, and geometry happens to be one way to induce that. By the way, I've tried compiling a document which includes the ifpdf and ifvtex packages separately, and they do just fine; it's only when I include the geometry package (which for some reason requires these ifpdf and ifvtex packages) that the error occurs.  I've tried the only things I can think of:   going into MiKTeX Package Manager (by the way I am using 2.8), and removing + reinstalling both geometry and oberdiek refreshing the file name database ("FNDB") deleting all automatically generated files, as well as simply starting over in a new document   So I'm stuck now. I've considered attempting to just get rid of all traces of MiKTeX and TeXnicCenter from my computer and starting over, but that seems a bit excessive - after all, the geometry package was working for me . I honestly am not sure what I did to cause this; I've spent today trying to make a better template file for myself, and so I've been trying out new packages, but if I'm not loading these new packages there shouldn't be any conflicts, right?   Actually, I've just now thought of something that I think I did between the last time it worked and now, so is a possible candidate for the cause: I had to install some package manually, as it wasn't available on MiKTeX, and so I created a folder and pointed MiKTeX to it (i.e. the second option ). The package didn't do what I wanted, so I deleted the folder and removed it from the list of folders I told MiKTeX to check. Perhaps it's still trying to reach it for some reason?


Suppose we have fields $\mathbb{K}_1, \mathbb{K}_2$ such that $$\mathbb{K}_1 \subset \mathbb{K}_2.$$      Question Let $A, B$ be square $n\times n$ matrices over $\mathbb{K}_1$. If there exists $P_2 \in \mathrm{GL}(n, \mathbb{K}_2)$ s.t.       $$ P_2^{-1}AP_2=B, $$      then there exists $P_1 \in \mathrm{GL}(n, \mathbb{K}_1)$ s.t.    $$ P_1^{-1}AP_1=B. $$   Is it true?

Given a field $F$ and a subfield $K$ of $F$. Let $A$, $B$ be $n\times n$ matrices such that all the entries of $A$ and $B$ are in $K$. Is it true that if $A$ is similar to $B$ in $F^{n\times n}$ then they are similar in $K^{n\times n}$?   Any help ... thanks!


Hi,  I am wondering why do my reputation points go down if I downvote someone else's post?  Thank you for your time.

It is incredibly rare that I downvote on this or any other community site. I would rather just ignore the item. However, occasionally some very bad advice is given that is worthy of a downvote. Why should this adversely affect the reputation of the person who downvotes?


The shell script is expected to call only one function, but calling both. How to fix this, the output is   both are same  both are not same  #!/bin/bash  var1=ORCL var2=ORCL  function f1     {       echo "both are same" }  function f2 {     echo "both are not same" }  if [ $var1=$var2 ];  then     f1   fi  if [ $var1!=$var2 ];  then     f2 fi

I am using the below script to move two days back when script runs at starting two days of the year and also check first and second days of every month and move two days back. if [$month="01"] && [$day="01"]; then         date="$last_month/$yes_day/$last_year"         fulldate="$last_month/$yes_day/$last_year" else         if [$month="01"] && [$day="02"]; then                 date="$last_month/$yes_day/$last_year"                 fulldate="$last_month/$yes_day/$last_year"         else                 if [ $day = "01" ]; then                         date="$last_month/$yes_day/$year"                         fulldate="$year$last_month$yes_day"                 else                         if [ $day = "02" ]; then                                 date="$last_month/$yes_day/$year"                                 fulldate="$year$last_month$yes_day"                         else                                 date="$month/$yes_day/$year"                                 fulldate="$year$month$yes_day"                         fi                 fi         fi fi  But my bad am getting the below error message Etime_script.sh: line 19: [06=01]: command not found Etime_script.sh: line 24: [06=01]: command not found


I'm using dual monitor configuration (laptop + external CRT). Each time I lock my screen I need to restore my CRT screen parameters (actually refresh rate only) on next unlock. Screen refresh rate of external monitor is reset to 60Hz and desktop picture moved (or better to say compressed) to left creating black zone right.  I'm running following command to restore correct parameters  xrandr --output VGA-0 --mode 1280x1024 -r 75   I need to run this script each time I'm unlocking my screen and it would be nice to make this happening automatically.  Startup applications won't help as they run once only during system boot.  Another solution is to save those VGA parameters somewhere but I'm not sure how. Probably in /etc/X11/xorg.conf (which actually don't have) but I need to generate full config first and then put that 75 rate in it.   UPDATE  I can't understand why was this marked as DUPLICATE of another question where in the description a man says "... upon boot? (not upon user login)" and my question is inverted - "upon login (not upon boot)".  Also I mentioned that putting a script to "Startup applications" does not do the trick.

As of Ubuntu 12.04, what is the proper/clean way to make the system execute a script upon boot? (not upon user login) e.g. running a daemon.


print("hello")  If I wanted the word "World" to be outputed as red on the kali linux terminal, how can I do that? print("World")

How can I output colored text to the terminal in Python?


SELECT   DISTINCT OH.MRN,OH.VISIT_NUMBER,OH.EVENT_TIME FROM ONCOLOGY_HISTROY_MV OH WHERE   OH.PROC='BC - Heamatology-Oncology Appt' ORDER BY EVENT_TIME ASC   I'm trying to get the first visit for each MRN (Patient) in a particular PROC (which is Procedure)  Please help :)

Table:   UserId, Value, Date.   I want to get the UserId, Value for the max(Date) for each UserId. That is, the Value for each UserId that has the latest date. Is there a way to do this simply in SQL? (Preferably Oracle)  Update: Apologies for any ambiguity: I need to get ALL the UserIds. But for each UserId, only that row where that user has the latest date.


What do the red ellipses mean to us in the chart below? Does it have a relationship with RMSE values?  Figure 3.11 from Elements of Statistical Learning by Hastie, Tibshirani, and Friedman

I am reading books about linear regression. There are some sentences about the L1 and L2 norm. I know the formulas, but I don't understand why the L1 norm enforces sparsity in models. Can someone give a simple explanation?


While everything was going good with my design I started noticing some edges started showing up on other object. I am not sure if I messed up a setting or checked some checkbox, has anyone stumbled upon this, or knows what is wrong   the cylinders face looks like it is inside the edges     but it is actually in correct place

I have recently started using blender and one of the models I'm working on has dark shadows along edges. I started this model from scratch. I can't remember them being there when I first started the model, but I had trouble joining areas together and think I've pressed something I shouldn't have. However, there are so many options I'm not sure what I did.  Here is an image of what I mean   The one on the left has the shadow. As a test I started a new model, which is on the right in the image, and as you can see it doesn't have any shadows.  Also, occluded vertices partially show through the model. Occlusion doesn't work properly.   In orthogonal view small darkened triangles appear along the the edges.    I don't really want to start the model again from scratch so any ideas on how to remove this shadow would be great. Thanks.


This Error Message pops when i press the button to open an other activity that has 2 text fields and a save and cancel button.The error is being pointed out to this part of the code in the save function-       listView.setAdapter(adapter);   Full Error  Attempt to invoke virtual method 'void android.widget.ListView.setAdapter(android.widget.ListAdapter)' on a null object reference   Java for the Save function  protected void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.activity_add);      Button btnSave = (Button) findViewById(R.id.btnSave);     ListView listView = (ListView) findViewById(R.id.listDisp);     arrayList = new ArrayList<>();     edName = (EditText) findViewById(R.id.editName);     edMobile = (EditText) findViewById(R.id.editMobile);      adapter = new ArrayAdapter<Classes>(this, R.layout.activity_add, R.id.txtItem, arrayList);     Log.i("test", " " + arrayList.size());     listView.setAdapter(adapter);      btnSave.setOnClickListener(new View.OnClickListener() {         @Override         public void onClick(View v) {             Classes class1 = new Classes(edName.getText().toString(), edMobile.getText().toString());             arrayList.add(class1);             adapter.notifyDataSetChanged();               Log.i("test", " " + arrayList.size());              try {                  FileOutputStream fos = openFileOutput("Saves.tim", Context.MODE_PRIVATE);                  ObjectOutputStream oos = new ObjectOutputStream(fos);                 oos.writeObject(arrayList);                 oos.close();             } catch (IOException ex) {                 ex.printStackTrace();             }         }     });   Java for the Load function  private ViewPager viewPager; private SectionsPagerAdapter mSectionsPagerAdapter; ListView lv; public static ArrayList<Classes> arrayList; private ArrayAdapter<Classes> adapter; private EditText etName, etMobile;   @Override protected void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.activity_main);      lv = (ListView) findViewById(R.id.listDisp);     Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);     setSupportActionBar(toolbar);      etName = (EditText) findViewById(R.id.editName);     etMobile = (EditText) findViewById(R.id.editMobile);     Button btSave = (Button) findViewById(R.id.btnSave);     arrayList = new ArrayList<>();     try {         FileInputStream fis =  this.openFileInput("Saves.tim");         ObjectInputStream ois = new ObjectInputStream(fis);         arrayList = (ArrayList<Classes>) ois.readObject();         ois.close();       } catch (IOException ex) {         ex.printStackTrace();     } catch(ClassNotFoundException ex){         ex.printStackTrace();     }   Method that launches the activity      public void loadAddActivity (View v) {     startActivity(new Intent(this,AddActivity.class)); }

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


I'm developing a POSIX compliant script in which I want to do a dynamic replace of strings, something like:  sed "s/${pattern}/${replace}/g"   Problem: if the pattern includes the delimiting character, sed returns error, and I want to be able to use all possible characters.     Attempt (with regex): using a non printable delimiter character:  ( Edited to  syntax)  d=$(printf '\1') sed "s${d}${pattern}${d}${replace}${d}g"   Probably not portable.      Attempt (with regex): if pattern contains a certain delimiter, uses another delimiter  (edited: now in POSIX-WAY):  test "${pattern#*$delim}" != "${pattern}" && delim='@' sed "s${delim}${pattern}${delim}${replace}${delim}g"   Not bad but if the pattern contain both / more @ sed would return error.      Edited Solution (without regex): Following , escaping chars related to regular expressions.  pattern=$(printf '%s\n' "${pattern}" | sed 's:[][\/.^$*]:\\&:g')  replace=$(printf '%s\n' "${replace}" | sed 's:[\/&]:\\&:g;$!s/$/\\/')    Is there a better POSIX compliant solution with or without sed?

I have a script that reads a text stream and generates a file of sed commands that is later run with sed -f. The generated sed commands are like:  s/cid:image002\.gif@01CC3D46\.926E77E0/https:\/\/mysite.com\/files\/1922/g s/cid:image003\.gif@01CC3D46\.926E77E0/https:\/\/mysite.com\/files\/1923/g s/cid:image004\.jpg@01CC3D46\.926E77E0/https:\/\/mysite.com\/files\/1924/g   Assume the script which generates the sed commands is something like:  while read cid fileid do     cidpat="$(echo $cid | sed -e s/\\./\\\\./g)"     echo 's/'"$cidpat"'/https:\/\/mysite.com\/files\/'"$fileid"'/g' >> sedscr done   How can I improve the script to ensure all regex metacharacters in the cid string are escaped and interpolated properly?


I want to split a string in the first space it has, but when I try to use the splited string in the condition "if" it doesn't work.  String parentName = new String(); String[] fullName = a.getPathComponent(1).toString().split("\\s+"); //also try with split (" "); parentName = fullName[0]; if (parentName == "DBPedia"){    ...  }   for example, fullName will take the string "DBPedia (23)", and the splited string "parentName" will have only the string "DBPedia", but when I use the string on the "If" it does not enter to the condition. What can be the problem?

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?


The callbacks functions are not working on the elements which are added by JQuery. Here in my example there is a parent div with class=parent. After clicking on it a Child is being added. But when I am click on the the child it does not alert the message. Please see the example below
             Parent

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 understand the basic premise behind subnet masks, such as 255.255.255.0. But all the subnet examples I’ve seen have been (from left-to-right) contiguous 1s (HI bits). For instance, 255.255.0.0 (/16) translates to the following octets:  11111111 . 11111111 . 00000000 . 00000000   I believe that these bits must be contiguous, because the whole point of subnetting is to derive host ID and ranges of available device IDs. But it does have me wondering, might you ever have a subnet mask of, say, 255.17.255.0, or:  11111111 . 00010001 . 11111111 . 00000000    Would this ever happen? Or is it impossible for subnets to exist without contiguous 1s? If so, why? Otherwise, if it is possible to do this, why would you (some concrete examples)?

I have been told that we have two devices on a network:  10.40.225.142 and 10.40.225.144  These devices both have   Gateway 10.40.225.129  Subnet mask 225.225.225.128 (note 225 is Not a typo)   These are communication intermittently with a server 10.40.224.156  So my question is: Is that a valid subnet? I have only ever seen 255 or 0 in the first one - three octets.


I was thinking that the electron, proton, neutron etc. are human given names to some particles. So, are the signs, positive of proton and negative of electron, given just to show their opposite behaviour? If yes, then can we assume electron to be positive and proton to be negative? And can the direction of electric fields (emerging from positive and converging to negative charge) be reversed if we assume that the sign is reversed? In short,what I want to ask whether the electric fields really emerge from a positive charge and move inwards to a negative charge or are they just assumed to do so to show opposite behaviour of the two charges(and if proton can be taken as negative)?  Also, I'm not talking about change in current but electric field due to reversed sign of charges.

This was a question on a worksheet during my first week in a class on Electromagnetism. The answer is essentially:     No. Life would be no different if electrons were positively charged and protons were negatively charged. Opposite charges would still attract, and like charges would still repel. The designation of charges as positive and negative is merely a definition.   But how would we have negative charges within the nucleus? Taking a look at the , it seems that down quarks are required in this new "negative proton" to help with creating the pion to "transmit a residual part of the strong force even between colorless hadrons".  I tried to set out and try to find a particle with (-1) charge with a down quark (by going through this ) but all the particles are not stable with the exception of two unknown:   Bottom Xi Baryon Double Bottom Xi Baryon   Assuming one of the above are stable, could the strong force act between one of them and a neutron, implying its alright to have a negatively charged nucleus?  Edit: If it wasn't clear, my question concerned whether or not there existed stable baryons of $-1$ charge with down quarks that could "replace" the proton.


For several webpages, Google provides me with language localized search results.  For example, I search for bread and I get as a result:  www.cooking.example/bread/de   which is the German localized version of what I was actually looking for:  www.cooking.example/bread   How do I teach Google that I'm capable of understanding English and actually prefer the English version of most websites?

I'm in France and trying to use Google in English only. My Google settings are set to English everywhere:    I've also clicked on the link "use google.com" but when I do a search, it still shows some results in French, and I suspect the results are somehow tweaked for a French audience, which means some important English ones might be missing.    Is there any way to force it to really use only English (except for using a VPN or proxy server)?


By playing around with the settings in gnome-shell.css (under the section "App Vault/Grid") I can get more lines of icons to display on the "Show Applications" screen,  but how can I get more rows to display?  My goal is to make better use of the screen by having more app icons on the screen even if the icons are smaller.  I realize the proper way to edit gnome-shell.css is to make a custom theme, but until I get my hands around my main goal, I am editing /usr/share/gnome-session/theme/Yaru/gnome-shell.css directly and using Alt-F2-r to see the results of my changes.

I would like to be able to show more columns since a lot of lateral space is lost. Any ideas on how to do this?


I am relatively new to SO and see this very often. As the title suggests there are many questions that are answered in comments itself and they remain unanswered forever. Shouldn't there be an option to mark a comment as an answer and the comment is copied over as an answer or something like that?  I guess there should be an option to the creator of the question to do this.

I'm trying to go through and provide answers to every unanswered question (search "closed:0 answers:0"), somewhat following the spirit that was blogged about at  .  However, I'm finding this much more difficult than it needs to be, as many of the questions have already been answered without the use of an "answer" - but instead, in the form of a comment by either the OP or another poster. I wouldn't mind reading through and skipping these, as long as there was some appropriate action I could take to at least assist with preventing these questions from being seen again from the same query - either by myself or another SO member.  Is there such an appropriate action?  Should we vote to close?  If so, using what reason? Even if I vote to close, what are the chances that 4 other users will also view the question and also vote to close?  (i.e., will my individual vote even do any good?  Is there any report to show recent close votes, so that others may also review and contribute supporting close votes?) Should we post some sort of an answer - even just something to the effect of "this was already answered by the OP's own comment to his answer (above)"? Would something like this be appropriate to flag for moderator attention, and let the moderators deal with it?  (Or would this be considered too trivial?) Should we rename the question title to something standard that can be used in a search exclusion?  (Maybe "SOLVED:"?)  Basically, how can I help to denote questions as "This question is no longer in active search of an answer - though better answers may still be appreciated."? I've already reviewed , which was closed as a duplicate of  - but this requires effort on part of a user who may very likely no longer be active. Otherwise, is there something I should be doing to improve my search to filter out these types of questions? I've run across this many times, so I don't consider it to be a rare issue.  However, the last question like this I just ran across, prompting this question, was .  In this case, the question was self-answered by the OP in the form of a comment, this question is the OP's only question, the OP has no other visible activity on SO, and the OP hasn't been seen on SO since he registered and posted the question 5 months ago. Another one I just ran across is .  However, here the "answer" comment was posted by a reputable and recently active SO member.  Should I leave a comment directed at him, asking him to re-post his comment as an answer, or should I post my own answer echoing his comment?  (Or something else?) Yet another is .  Interestingly, the OP actually self-edited the question to include the "SOLVED:" prefix on to the question, instead of posting his resolving comment as an answer (and ideally accepting it) as he was asked to do by another comment.  This brings up another good idea - is there a "standard" we should use to rename the titles on these "resolved but unanswered" posts that could be used as a search exclusion?  (Also added to the above list.)


I wish to calculate correlation between external rating of accounts and internal ratings of the accounts in my branch. Which out of Pearson correlation or rank correlation will be better to use and why.

How do I know when to choose between Spearman's $\rho$ and Pearson's $r$? My variable includes satisfaction and the scores were interpreted using the sum of the scores. However, these scores could also be ranked.


I have a .shp file (downloaded from ), but it is a bunch of pink lines (I expected something like a bunch of dots or something and I have to transform it into gps coordinates (which I guess it's a .gpx file), but I have a lot of trouble finding the tools to do so and understanding what everything means. Right now I'm using QGIS, and I think once I have the coordinates I should dump the values into PostGIS. Could you guys point me in the right direction about which tools I should use, how or tips about how to do things the right way?  Further explanation: I want to get coordinate points that "shape" the coastline, so given a house's position, it can tell you how far away the coast is from the house.  Edit: I managed to get some stuff with QGIS "extract nodes" option, but I don't see any use for this data:  Shape_Leng,Shape_Area 309.72983208000,4079.18723489000 309.72983208000,4079.18723489000   Values repeat a lot and they don't look like map coordinates. What went wrong?

What is the best method to calculate the distance from the nearest road for a series of address points in QGIS, having a very big dataset? (QGIS 2.0.1, Win XP)  I read the answers to previous similar questions:           Nevertheless:   MMQGIS plugin find the disance to the nearest node of a line network, not the shortest (perpendicular) distance to a line. R and Python proposed scripts correctly works for small datasets and can be implemented in the modeler, however for my job I have 530 points and a regional street layer with about 135'000 features, and cycling through all the features then taking the shortest distance for all points will take an enormous amount of time I have problems in making GRASS work in QGIS 2.0.1 ().


I’m new to ConTeXt, and noticed that \part{Some title} (and neither \start part[title={Some title}]…\stoppart) will produce and output (besides an empty page with footer and header). Nevertheless, other settings as \setuphead[part][footer=empty] will have an effect on that page, but I can’t get to display the number nor the title of the \part.  I remember had read in some introductory doc (not sure which one) that this was because the \part command required mostly a special (visual) setup from the editor, but don’t know how this can be achieved (and said doc didn’t go into that). Does anybody know how?

ConTeXt has \part, \chapter, and \section titles, however, it seems that \part is disabled by default. If I used \part in my document, it is visible in the table of contents, but not in the document. I have tried setting it up myself, but this does not work:  \setuphead[part][number=no, align=middle]    What is the basic code needed to display and begin setting up and customizing \part titles?


In Linux when I create a directory mkdir newdir then the newly created directory has these permissions and ownership: drwxr-xr-x  2 owner group My Question How can I make the default permissions for newly created DIRECTORIES be: drwxrwxrwx  2 owner group regardless of who created the directory? Some research I made I know that from within a Samba share you can enforce that with directory mask but what if someone goes to the terminal and makes a directory as root and then a regular user comes along and he then won't be able to create files in that directory that the root user made? I have been playing with ACLs and I understand how to make all newly created FILES have certain permissions. e.g:  setfacl -dRm u::rwX,g::rwX,o::0 newdir/ This makes all files in the newdir folder have permission: -rw-rw---- regardless of who created the file. I also learnt about "setting the directory group id bit" so that any files (or directories) created in the "newdir" directory will have group ownership equal to the group ownership of the "newdir" directory. chmod g+s newdir/ I have not been able to find out how to make the default permissions for a newly created DIRECTORY be: drwxrwxrwx  2 owner group regardless of who ever created the directory? Maybe it's something to do with umask? Can it be done with ACLs?

In the past, I have always set umask at ~/.profile. I set a umask of 077 so my documents get a permission of 600 (rw-------). But setting this at ~/.profile no longer works in Ubuntu 17.04.  So as new documents get created in a gnome session on Ubuntu 17.04, where can I configure so that they get created with permission 600?


I'm trying to use Python's raw notation to find a pattern that includes special characters with no success.  When using the 'r' notation to ignore the special characters nothing is found - see the example below:  Problematic Code  import re pattern = re.compile(r"testing+101@gmail.com") sentence = '___dsdtesting+101@gmail.comaaa___'  result = re.search(pattern, sentence).group()  print(result)   The above code will not find the pattern and return     AttributeError: 'NoneType' object has no attribute 'group'   Working Code  When escaping the '+' with '\' it works as expected:  import re pattern = re.compile("testing\+101@gmail.com") sentence = '___dsdtesting+101@gmail.comaaa___'  result = re.search(pattern, sentence).group()  print(result)   The above code will return the desired outcome of "testing+101@gmail.com".  Am I using the raw notation wrong? What's going on?  TO CLARIFY: I am not interested in escaping with the '\', rather I want to use the raw notation.

I want to use input from a user as a regex pattern for a search over some text.  It works, but how I can handle cases where user puts characters that have meaning in regex? For example, the user wants to search for Word (s): regex engine will take the (s) as a group.  I want it to treat it like a string "(s)" .  I can run replace on user input and replace the ( with \( and the ) with \) but the problem is I will need to do replace for every possible regex symbol. Do you know some better way ?


On the  page, the number of questions using the tag is shown for each tag, except those which are used on 0 or 1 questions.  This makes it impossible to tell which bad new tags have already been removed from their questions without duplicating someone else's effort of clicking on the tag and observing that it's unused.  I'd like to see the question count for either the 0s or 1s (or possibly both) to save time when looking through new tags.

When browsing the list of tags on a site, a number is shown next to each tag indicating how many questions have that tag, e.g. “ × 42”. If there is a single question with that tag, no indication is shown. If the tag is a synonym of another tag, or if the tag has no questions and is scheduled for deletion the next time the cleanup job runs, no indication is shown.  Please visually distinguish tags with a single question from tag names that are synonyms and tags that are scheduled for deletion. This is very useful information when reviewing tags.


I read this novel at least 40 years ago.  It is clearly SF, some of the action is not on Earth. I don’t remember interstellar travel, only within solar system, Moon and/or Mars and/or  Venus and/or asteroids. So space colonisation is there, but in fact is a minor ingredient : if those parts of the action had been on some remote corner on Earth, it would not have changed the plot much, really.  What I remember best is some "sociological" aspects. There seem to be no countries, no polities.  Big companies rule the world (the worlds, rather, since there are several inhabited planets/satellites). Even law and order are maintained by private security agencies. I think I remember Brink’s being mentioned.   The main protagonist works for one such big company. He has no decision power, but has the ear of the CEO of that company, who trusts him. Of course, some people are not happy with that.  So one morning the main protagonist  wakes up, probably not on Earth, as an indentured worker (translate : a slave) and is shown a contract he is supposed to have signed to pay back some huge debt he has no memory of owing. And since his expenses are higher than his salary, he’ll never pay it back. I don’t remember how he does it, but he manages to escape, without killing anyone. However he is now wanted by the authorities-that-be for contract breach and “femicide”.   At some point he gets in touch with, either the CEO he worked for, or some person really loyal to the latter. In any case, this person does not blink an eye at the charge of femicide, but asks him whether the contract that was breached really was invalid.  (It is not clear where, in this hierarchy of severity, homicide would find its position.)  At his assurance that the contract was totally phoney, he obtains help, but there are still more happenings that I forgot.   In the end, the CEO dies and the main protagonist is told by a inheritance lawyer that the CEO has willed him a majority of shares of some obscure sub-company. But by some complicated mechanisms, this puts him in control of the entire big company of which he becomes the CEO.

I'm trying to help my mother find a short story that she remembers reading some, oh, 30 or more years ago.   I don't have a lot to go on, but apparently the main concept of the story was that the food that everyone was eating was said to come from “The Giant Chicken” or “The Great Chicken” kept somewhere (she read it in a Hebrew translation), but when the protagonists delve into the matter, they discover that this “chicken” (as it was translated) is actually a giant cancerous tumor, kept alive and growing for food.  I've established, probably, that this is not Harry Harrison's Make Room! Make Room! or Roommates, the basis for Soylent Green. That was my first thought. I also couldn't find a lead in the  section on wikipedia.  I don't know any more - not what the main characters were, what book it was published in or the actual decade it was written, unfortunately. It would have been read in the early 80's at the very latest.


This one is more of a netiquette question.  Sometimes I stumble on "unanswered" questions that were actually answered - in their comments. Those questions are shown as unanswered in the statistics.  For example: .  What should be done?   Flag the question so one moderator can somehow mark it as answered. Answer the question yourself (as a community wiki answer), mostly by copying the comments. Nothing. Move along.   EDIT  I'm talking about questions without activity for weeks or months.  Feature request  Give diamond-mods the ability to change a comment to an answer; and allow users to flag for this action.

Sometimes I have asked a question which got no answers, but is answered in the comments to the question.  How should I handle these questions? I can't accept an answer, so it is never an accepted question.  For example this one:   (ok here the answer in the comments is from me, but nevertheless I also have others of them)


A black window covers almost the entire desktop. It looks like a broken terminal window.  I thought that the cause might be Intel proprietary drivers so I removed it, but that did not help.  Also, I noticed that the system boots without logo Ubuntu.    When I choose a particular kernel in GRUB (4.2.0-19), everything work fine, the problem does not occur.    When I start with the default kernel (4.2.0-35) I have this black window on my desktop.  I added a camera picture because when I made the screenshot, the black windows cannot be seen as if it were not there at all.  My computer is HP 530 Intel® 945GM x86/MMX/SSE2.  I will add that I am new to Linux.     *-display:0                   description: VGA compatible controller      product: Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller      vendor: Intel Corporation      physical id: 2      bus info: pci@0000:00:02.0      version: 03      width: 32 bits      clock: 33MHz      capabilities: msi pm vga_controller bus_master cap_list rom      configuration: driver=i915 latency=0      resources: irq:16 memory:f0400000-f047ffff ioport:3000(size=8) memory:e0000000-efffffff memory:f0480000-f04bffff   *-display:1 UNCLAIMED      description: Display controller      product: Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller      vendor: Intel Corporation      physical id: 2.1      bus info: pci@0000:00:02.1      version: 03      width: 32 bits      clock: 33MHz      capabilities: pm bus_master cap_list      configuration: latency=0      resources: memory:f0500000-f057ffff     When I switch tty, the black window fills the screen and is damaged, the font is unreadable.

I am trying to boot Ubuntu on my computer.  When I boot Ubuntu, it boots to a black screen.  How can I fix this? Table of Contents:


When writing a letter to officials you don't know the sex of, do you say Dear Madam / Sir or Dear All?  How do you avoid the fact that you don't know the sex of the official(s) to whom you are writing?

When is it appropriate to use the terms Dear Sir or Madam and To whom it may concern?  The rules I was taught state that Dear Sir or Madam should be used when you're writing a letter to a person about something that person has direct involvement in (e.g. returning a defective product to a customer service department).  By the same rules, To whom it may concern would be used for situations in which the recipient is a third party to the topic of the letter (e.g. regarding a letter of reference or recommendation).  Was I taught correctly?  Is the rule actually something else?  Or is this one of those situations where many people have an opinion but there is no real rule?


I am planning to buy a laptop that meets my requirements and is compatible with Linux,this one meets my desired requirements, but will it run Linux Ubuntu or no?  Dell Inspiron 7567 is said to be certificated, but I'm not sure if this applies to gaming edition, here is the laptop:

I have a device on which I would like to install Ubuntu. How do I find out if Ubuntu will work on it?


I've been reading the Introduction to Statistical Learning and Elements of Statistical Learning by the Stanford professors Hastie and Robert Tibshirani and I've been trying to derive the discriminating function knowing the posterior for LDA, assuming common covariance matrix, p=1 and Gaussian distribution. . If our assumption for normal Gaussian distribution of the likelihood holds we obtain the Bayes Classifier.   In the second picture it's mentioned that we take the log of the posterior but detailed steps of the derivation are not provided and I'm not sure  how to derive it.

I'm studying 'Introduction to Statistical Learning' by James, Witten, Hastie, Tibshirani.   In page 139, of their book, they began by introducing Bayes' Theorem $p_k(X)=P(Y=k|X=x) = \dfrac{\pi_kf_k(x)}{\sum_{l=1}^k \pi_l f_l(x)}$. $\pi$ is not mathematical constant, but denotes the prior probability. Nothing is strange in this equation.   The book claims that it wants to obtain an estimate for $f_k(x)$ that it can plug into the equation given above. To estimate $f_k(x)$, it assumes that is normal. In the one dimensional setting, $f_k(x)=\dfrac{1}{\sqrt{2\pi}\sigma}\exp(-\dfrac{1}{2\sigma^2}(x-\mu_k)^2)$, where $\mu_k$ and $\sigma^2_k$ are the mean and variance for the $k$th class. It is assumed that $\sigma^2_1 = \sigma^2_2 = \cdots = \sigma^2_K$. (I began to get confused from the last statement.)   Plugging $f_k$ into $p_x$, you have this quite messy equation (1) :   $$p_x(k)=\dfrac{\pi_k \frac{1}{\sqrt{2\pi}\sigma}\exp(-\frac{1}{2\sigma^2}(x-\mu_k)^2)}{\sum_{l=1}^K \pi_l \frac{1}{\sqrt{2\pi}\sigma}\exp(-\frac{1}{2\sigma^2}(x-\mu_l)^2)}. $$  Again, no surprises here since it is just substitution.     The Bayes' Classifier involves assigning an observation to the class for which equation (1) is the largest. Taking the log of Equation (1) and rearranging terms, it is not hard to show that this is equivalent to assigning the observation to the class for which the following is the largest:  $$\delta_k(x)=x \cdot \dfrac{\mu_k}{\sigma^2} - \dfrac{\mu_k^2}{2\sigma^2} + \log(\pi_k) $$  Question: I do not understand where this came from, and what it means. I tried doing the log of equation and it doesn't become this. Are we taking the derivative somewhere here, since this is the largest observation?


I'm programming a web app to track my hedge fund performance. I'd like to find my overall ROI for all time.  If I had a beginning balance and my current balance then finding the ROI is easy. For instance ((current balance / beginning balance) * 100) to get the percentage.  Where I am having difficulty is in the fact that each week there are debits/credits to the account.  So how can I accurately figure a lifetime ROI when each week I'm adding/removing funds?  Here is an example weekly report.  9/9/2013-9/13/2013 :  beginning balance = 25000 :  Profit/Loss in % = 16.45 :  Gross Profit/Loss = 4,112.72 :  Debit/Credit = -2000 :  New Balance 27,114   Imagine the next 9 weeks look similar with fluctuating profit/loss percentages (weekly roi's)  Can any of you geniuses provide me with a formula for discovering how to ascertain exactly how well the hedge fund manager has been doing up to present day regardless of how many weeks I have been involved? I'm assuming some type of weekly compounding.  EDIT: So I found a formula that I think is useful and plugged in 4 weeks worth of data      25000((1+i)^4) - 4000((1+i)^3) - 300((1+i)^2) - 1500((1+i)) = 32318.63   How might I solve for 'i'?

I have a simple spreadsheet where I track the balance in my investment account.  What should I do to handle new deposits in the account?  For example:   End of Day 1: balance = $100   End of Day 2: $120 (daily gain 20%)   End of Day 3: $150 (daily gain 25%)   So after Day 3 I have made 50%. Let's say that in between Day 3 and Day 4, I deposit $100, so at the beginning of Day 4, the balance is $250.    If I compute the return as above, all of a sudden it drops to 25% ($250 balance, $200 in), which is clearly wrong.  And furthermore obviously the gain from Day 3 to Day 4 is not 66% ($250/$150), it's zero.  I'm pretty frequently depositing new money into my investment account, so what's the best way to account for this?  Is the rate of return some weighted average based on how long the money was in the account?


We recently got a new party member, and she is ... well, extremely distracting if you catch my drift. As the DM it is frustrating, because all the guys are trying to flirt with her, and shower her with items in game. The whole thing is quickly becoming a mess. (One even attempted to grope her, In the game and real life, ) Seriously, I have no freaking idea what to say to the guys, and how to do it, the whole thing just seems so ... awkward. Not only that, but I too have found myself attracted to her. How do I get my own, and my group's hormones to be put away so we can play the game and have fun; which is what I’m sure she is trying to do also. We are a bunch of 8th and 9th graders and we are all friends.  Can someone help me?

I'm concerned because a new player just joined our D&D 5e group and is super flirty with all the male players (both in person and as her character - she's a bard). And the problem is that she's changed the whole vibe of our gaming group.  We used to be a really cohesive team, and now almost every decision takes ages to make because the guys are defending all her stupid ideas and not acting from their characters' perspectives. Even our online chats with the DM are strangely sexual now.   The new player is completely NEW to D&D (a complete beginner), and we only met her recently when the DM said she could join the group. Our group is not a friends-group; we met through a gaming group online. The DM likes to get people interested in D&D, so that's how she got in the door. Our group is aged in their 20s; I think (3 of us are over 35). We have mixed genders and mixed ethnicities (though most Australians). Most players are beginners (except 2 of us who grew up playing D&D in the 80s- I'm 1 of such).  I am a female player in the group, but it's not an issue of jealousy for me. If she's super flirty, it reflects badly on her, and in any case, if she "succeeds" in finding a partner, it doesn't bother me. I don't care if people date in our group (we already have a couple in the group).  The issue is that, since she joined our campaign, our team dynamic (in game) has changed. One such problem is that her character is a level 1, and we're all higher levels, so we're constantly trying to "save" her. I find it really annoying that the guys act all "smitten" and can't see she just has changed our group dynamic. It's a rift, and I don't know what to do to fix it.  I have mentioned my problem with this to the DM, who suggests we play harder campaigns. But the DM has not made any decision to kill her character off either way. Do we kill her? Or level her up? Or...?  The net problem is that decisions are taking too long, and the dynamic of the group is leaning on sexual-tension instead of gameplay.  Please share how you have seen a similar problem resolved using our site's ; specifically, back up your answer with relevant experience or citations. An "idea you think might be good" without any evidence isn't a good answer.


I have the following text:    <:Hello  World :>  Blah Blah Blah  <:Hello  Foobar :>     And i want to match every <:Hello ... :> Tag with a regular expression (In JavaScript). So what's supposed to be matched is World and Foobar but not blah blah blah.  I tried using /<:HELLO([\s]{1,})([\s\S]{1,})?:>/gi But it matches the whole text From the first <:Hello to the last :> How can i match each tag separately?

I have this gigantic ugly string: J0000000: Transaction A0001401 started on 8/22/2008 9:49:29 AM J0000010: Project name: E:\foo.pf J0000011: Job name: MBiek Direct Mail Test J0000020: Document 1 - Completed successfully  I'm trying to extract pieces from it using regex. In this case, I want to grab everything after Project Name up to the part where it says J0000011: (the 11 is going to be a different number every time). Here's the regex I've been playing with: Project name:\s+(.*)\s+J[0-9]{7}:  The problem is that it doesn't stop until it hits the J0000020: at the end. How do I make the regex stop at the first occurrence of J[0-9]{7}?


Kleene states Theorem 1. on p. 14 that if we have a formula $E$ of atomic variables $p_1,p_2,\cdots,p_n$, then we may substitute in formulas $A_1$ for $p_1$, $A_2$ for $p_2$ etc... to get $E^*$ such that $\vDash E$ implies $\vDash E^*$. While the result seems completely obvious, I don't see much of any proof of this theorem. Would we argue in the metalanguage that every compound formula is either true or false, so we can always choose atomic formula in the tautology that match the compound formula's truth values? I'm just trying to understand how you would prove something so obvious in a rigorous manner.

This semester I take Introduction to logic and sets theory and for logic our reference is A Mathematical Introduction to Logic by H.B.Enderton.  I have some problems with this course I mean it is somehow unfamiliar ! our professor teach well and I learn at class but when I want to solve my homework ,I have no idea ,how to solve problems !  I don't have any idea how to prove this :  suppose a and b are tautologically equivalent, where A is wff and a is used in A and B is  another wff that b is used in; prove that A and B are tautologically equivalent.  Any one can help me ?


I have the following dropdown from a view model:
    @Html.DropDownListFor(model => model.QuoteModelSea.OriginAdd.Country, new SelectList(Model.QuoteModelSea.OriginAdd.CountryList, "Text", "Value"), "", htmlAttributes: new { @class = "mdl-selectfield__select" })    @Html.LabelFor(model => model.QuoteModelSea.OriginAdd.Country, htmlAttributes: new { @class = "mdl-selectfield__label" })
   This is in a partial view which is being attached to a div upon an ajax call.  Then in the main view I have a javascript:  $('#QuoteModelSea_OriginAdd_Country').change(function () {         $('#searchTextField').val('');        *actions* });   The rendered html of the razor view is as follows:
    <select id="QuoteModelSea_OriginAdd_Country" name="QuoteModelSea.OriginAdd.Country">      <option value=""></option>      <option value="1">abc</option>      <option value="2">abc Islands</option>      <option value="3">abc</option>      <option value="4">abc</option>    </select>    Country
   However when I select a value from the dropdown, the javascript is not being hit.  The dropdown is in a partial view and the javascript in the main view. Any idea why the javascript function is not being called?

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.


can I return a single instance of a row after using a join on a categories table.   Entries  | id | Name   |  | 1  | Johnny | | 2  | Steve  | | 3  | Bam    |   Categories  | cat_id | Name        |  | 1      | Season one  | | 2      | Season two  | | 3      | Season three|   Category Posts  | id | cat_id |  | 1  | 1      | | 1  | 2      | | 1  | 3      | | 2  | 2      | | 2  | 3      | | 3  | 1      |   What I want to do is select all cast where members that have been in season 2 and 3, they must have been in both and I only want a single instance returned.   Expected output  | id | Name   |  | 1  | Johnny | | 2  | Steve  |   How would I got about selecting these? I've thought about grouping the user based on their name however because I'm selecting IN ("2", "3") I get some users that have been in two but not three and the expected results are wrong.   Thanks

This is a very basic query I can't figure out....  Let's say I have a two column table like this:  userid  |  roleid --------|--------    1    |    1    1    |    2    1    |    3    2    |    1   I want to get all distinct userids that have roleids 1, 2 AND 3.  Using the above example, the only result I want returned is userid 1.  How do I do this?


I wanted to use RSS to get notification of new questions. I set everything up only to be disappointed by the fact that there is a significant delay between the asking of a question and its being included in the feed. By significant I mean on the order of 5 minutes. For most questions I am interested in answering, the question has already been answered by the time I see it. It is not a matter of refreshing the feed too slowly. No matter how fast I refresh, I can see that there are questions that are not in the feed by manually refreshing the stackoverflow page in a browser. Even if I repeatedly refresh the feed, the new questions do no appear for sometimes more than 5 minutes.  Is there a faster alternative to RSS for seeing new questions (other than scraping the web page)?

I have tried using Google Reader, FeedDemon and different Chrome extensions to follow Stack Overflow's tag feeds (e.g. newest question RSS feeds for a given tag), but nothing seems to give me alerts quickly enough. Even if I set the refresh time to as little as one minute, there is considerable delay. Any suggestions/recommendations for a faster tool or way of getting updates?


i want to use the same socket address for multiple calls for this task.  i tried to get the address from different class but didn't work .  please help !!!  my call from different class is:  new ConnectToServer().execute(ip, "2000", "br1");   my code for task is:  public class ConnectToServer extends AsyncTask<String, Void, Void> {      @Override     protected Void doInBackground(String... parms) {         // TODO Auto-generated method stub         try {              Socket s = new Socket(parms[0], Integer.parseInt(parms[1]));             // ******              OutputStream os = s.getOutputStream();             BufferedOutputStream out = new BufferedOutputStream(os);              if (parms[2] == "br1") {                 out.write("rr1".getBytes());                 out.write('\n');                 out.flush();             } else if (parms[2] == "br2") {                  out.write("rr2".getBytes());                 out.write('\n');                 out.flush();             } else if (parms[2] == "br3") {                 out.write("rr3".getBytes());                 out.write('\n');                 out.flush();             } else if (parms[2] == "br4") {                 out.write("rr4".getBytes());                 out.write('\n');                 out.flush();             } else if (parms[2] == "bb1") {                 out.write("bb1".getBytes());                 out.write('\n');                 out.flush();             } else if (parms[2] == "bb2") {                 out.write("bb2".getBytes());                 out.write('\n');                 out.flush();             } else if (parms[2] == "bb3") {                 out.write("bb3".getBytes());                 out.write('\n');                 out.flush();             } else if (parms[2] == "bb4") {                 out.write("bb4".getBytes());                 out.write('\n');                 out.flush();             }              // s.shutdownOutput();          } catch (NumberFormatException e) {             // TODO Auto-generated catch block             e.printStackTrace();         } catch (UnknownHostException e) {             // TODO Auto-generated catch block             e.printStackTrace();         } catch (IOException e) {             // TODO Auto-generated catch block             e.printStackTrace();         }         return null;     }  }

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 want to see how many frames per second (FPS) I am running at, on my computer. Is there a way to do that in Ubuntu?

I'd like to find an analogue of  or any other fps counter on Ubuntu 12.10.  After some googling I found 2 solutions:   To use  (I found it from ). This solution didn't work for me because after launching the game:  mumble-overlay game   I got this error:  game: symbol lookup error: /usr/lib/mumble/libmumble.so.1: undefined symbol: glPopClientAttrib   And I didn't find any fix of this error in the WEB. To use WINEDEBUG=fps with osd_cat. It works only with  (only Windows games). Found from reading  and . It shows FPS during play but the output is definitely wrong - 0.15-0.18 fps. And it doesn't matter if game really runs slow or fast - the result is always the same.   Does anyone know how to fix these errors? Or are there any other solutions? Thanks for the help.


I receive emails but I get account error and cannot send.  Any idea what can be the problem?

I added a new gmail account to Mac Mail via the File> Add Account, but the mailbox does not show up in mail.  If I try to add it again, it says the account already exists. It does exist in System Preferences > Internet Accounts, but does not exist in Mail.   I am updated to 10.10.3 and Mail.app is Version 8.2 (2098)  Anyone have a fix?


I have 1,015 images in a folder and these images is classified into seven categories of medical diagnoses of skin cancer, and the same images are classified in the Excel file by number (the number of each image corresponds to the type of diagnosis of this image). The type of image is labelled as "dx".  Clearly, each image has a specific number corresponding to the diagnostic type, my question is How do I search for a group of files by copying their names from the Excel file and then paste them in the search box in Windows at once. In other words i want to take the names of a hundred images from  the Excel file then search for them by pasting their names in the search box. Can I do that or do I need a particular tool?

I have 1,015 images in a folder and this image is classified into seven types and these types are categories of medical diagnoses of skin cancer, and the same images are classified in the Excel file by number (the number of each picture corresponds to the type of diagnosis of this image). Clearly, each image has a specific number corresponding to the diagnostic type, my question is how to sort these images in the folder in groups so that each group of images have the same diagnosis.


There is resistance when you stretch a rubber band. That makes sense to me because the energy you exert is turned into potential energy of the rubber band, but if you hold the rubber band in the same stretched position, it requires constant energy from your body to keep it stretched, but the rubber band doesn't gain any extra potential energy. Where does that energy go?

I read the definition of  as  $$W ~=~ \vec{F} \cdot \vec{d}$$  $$\text{ Work  =  (Force) $\cdot$ (Distance)}.$$ If a book is there on the table, no work is done as no distance is covered. If I hold up a book in my hand and my arm is stretched, if no work is being done, where is my energy going?


Can you do a t-test or ANOVA between 2 or 3 groups respectively if one of those groups has a sample size of 2? Are the results interpretable in the same way as with larger sample sizes(n=4,5,6?). If you can provide any references to read more about very small sample size statistics, that would be helpful.

I have a 2x2, between-subjects experimental design (2 independent variables (IVs) with 2 levels each) and one dependent variable (DV).  My data are unbalanced and an interaction between the IVs seems likely, so I plan to use ANOVA with Type III Sums of Squares to test whether my DV is different across one of my IVs while controlling for any influence of the other IV (or the interaction, if present).    My question is this: what is the minimum number of data points that I need in each of my 4 cells, to ensure that ANOVA likely won't give spurious results? I'm aware of  of having at least 20 data point in each cell, but that recommendation only serves to control the test's rate of false negatives. What I'm more worried about is that with a small enough cell size, the statistics on which ANOVA is based probably won't be very reliable, and so the results of the test would be unreliable as well (in terms of either false negatives or false positives). Are there any papers or texts out there that have studied and made recommendations regarding this concern?


I have the AT&T Samsung Android Mobile with 2.3.5 OS and it's model no is SGH-I897. Now I want to upgrade my mobile os to lates 4.1 or 4.2, So can any body help me how to do that. Thanks in Advance.

Android 4.1 (Jelly Bean) was announced at Google I|O 2012 on June 27, 2012.  (You can review  at the official Android Developer's site.)  Of course, not all devices will get this update right away and others won't get it at all. Each manufacturer and carrier often choose to add their custom modifications which tend to delay the official release.  When will each device get Android 4.1, either officially or unofficially, if ever?  See also:


Public class Singleton{               //private static ref              private Static Singleton uniqueInstance;                 //private constructor               private Singleton(){               }               public static Singleton getInstance{               if(uniqueInstance==null){              uniqueInstance= new Singleton();              }             return uniqueInstance;             }  }   The above class is my current implementation of the traditional use of singleton. How would I implement the enum version of singleton on this class? And what are its benefits over the traditional?  I.e. how does this work:  public enum Foo {    INSTANCE; }

What is an efficient way to implement a singleton pattern in Java?


By brute force I'm noticing that for all $a ∈ 𝔽_7$, we have $a^{19}\bmod 7 \equiv a $. Now this looks very much like Fermat's Little Theorem, but this theorem should hold if the primes are the same, whereas 19 and 7 are clearly not. Is this just a coincidence?

I've read about Fermat's little theorem and generally how congruence works. But I can't figure out how to work out these two:   $13^{100} \bmod 7$ $7^{100} \bmod 13$   I've also heard of this formula:  $$a \equiv b\pmod n \Rightarrow a^k \equiv b^k \pmod n $$  But I don't see how exactly to use that here, because from $13^1 \bmod 7$ I get 6, and $13^2 \bmod 7$ is 1. I'm unclear as to which one to raise to the kth power here (I'm assuming k = 100?)  Any hints or pointers in the right direction would be great.


Let's take the following code  board = [[0,0,0],[0,0,0],[0,0,0]] versionsOfBoard = [] versionsOfBoard.append(board); #this will keep the versions of board array print(versionsOfBoard); # output # [[[0,0,0],[0,0,0],[0,0,0]]] # later I change few values in the board and append 'board' to my versions array board[0][0] = 1 versionsOfBoard.append(board) print(versionsOfBoard) # output # [[[1, 0, 0], [0, 0, 0], [0, 0, 0]], [[1, 0, 0], [0, 0, 0], [0, 0, 0]]] # if you notice here, the 0th index value is also changed board[1][2] = 1 versionsOfBoard.append(board) print(versionsOfBoard) # output # [[[1, 0, 0], [0, 0, 1], [0, 0, 0]], [[1, 0, 0], [0, 0, 1], [0, 0, 0]], [[1, 0, 0], [0, 0, 1], [0, 0, 0]]]   Every index value displays the latest state of 'board'. it is referencing the board. I have tried with .append(board[:]) and .append(board.copy()). Both these options too do not solve the problem.  Any help would be highly appreciated

I needed to create a list of lists in Python, so I typed the following: my_list = [[1] * 4] * 3  The list looked like this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]    Then I changed one of the innermost values: my_list[0][0] = 5  Now my list looks like this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]]    which is not what I wanted or expected. Can someone please explain what's going on, and how to get around it?


I am trying to install JAVA on my Ubuntu 12.04, and I followed the official instructions:   I am stuck at #3: Unpack the tarball and install Java. I have succesfully run tar zxvf jre-7u7-linux-x64.tar.gz (which just unpacks), but what is the command for installing it?

I want to install Oracle's JRE and to update to the latest version with the Software Updater when they released. Is there a Ubuntu package that is provided by Canonical or Oracle?  Before release Java 7, I followed  to install Java 6.  But it doesn't work for Java 7. There is no package sun-java7-xxx. How can you install Java 7?


I have 2 drop down boxes for users to select the country and city. Ho can i get all the countries and cities? Is there any easiest way to obtain this? Please help me. I'm new to the iPhone programming.

I have a menu that let's a user select a country. Exactly like that in the contacts.app country menu within the address field.   Does anyone know a simple way of getting a list of countries? I have used NSLocale to generate an array of countries but it's only the country codes unfortunately and not the human readable equivalent. I don't want 'GB' I want Great Britain.


If I open a program, say evince, from the GNOME GUI, it is not attached to a terminal. If I send it a signal, it acts accordingly but nothing shows up in my terminal.  If I were to open it in a terminal to start with and allow it to run in the foreground, it would show what signals it had received.  Say I run evince as just evince from the terminal. And then in another, I run ps -e, find its PID, and then do kill -11 [PID]. It will print out "Segmentation fault (Core dumped)". For other signals, it may print "Received signal..." How can I start a terminal and have it shows signals that are sent to a program that was not started within a terminal but rather a GUI?  Is it possible to open a program in the GUI, and then attach a terminal to it so I can see the same behavior as if I had opened it from within the terminal?

I have a running program on a SSH shell. I want to pause it and be able to unpause its execution when I come back.  One way I thought of doing that was to transfer its ownership to a screen shell, thus keeping it running in there.  Is there a different way to proceed?


I'm supposed to prove the theorem in the title for a combinatorics class (continuation of discrete structures class). At the moment I have no idea how to aproach this question.  I would appreciate some pointers to set me on the right path. I don't really want to just copy a full solution and hand it over as mine.  Any help will be greatly appreciated.

I recently solved a , which says that,     A positive integer can be multiplied with another integer resulting in   a positive integer that is composed only of one and zero as digits.   How can I prove that this is true(currently I assume that it is). Also, is it possible to establish an upper bound on the length(number of digits) of the number generated?


hello = "Hello there" print(hello[10:0:-1])   This outputs:  ereht olle   And I can't figure out how or why.  print(hello[10:0:-2])   And this one outputs:  eetol   Could someone please help me to understand what the [10:0:-1] is actually doing?  Thanks!

I need a good explanation (references are a plus) on Python's slice notation.   To me, this notation needs a bit of picking up.   It looks extremely powerful, but I haven't quite got my head around it.


I know that if a function $f:[a,b]\rightarrow \mathbb{R}$ is Riemann Integrable  then it is Lebesgue Integrable there with respect to the lebesgue measure and the integrals coincide. Does this theorem also apply to improper Riemann integrability on unbounded intervals of the real line e.g. over $\mathbb{R}=(-\infty,\infty)$ itself?

I understand that there are functions where the Lebesgue integral exists, but they are not Riemann integrable (e.g. the Dirichlet function). Are there also functions that are Riemann integrable but not Lebesgue integrable?  If we e.g. have a function $f(x)=x$, $x\in[0,5]$ and have to find the Lebesgue integral of that function $\int_x x d\lambda$ how is the calculus then. I know it should be the same as when we integrate with respect to Riemann (25/2). But how do we calculate it if we don't use the Riemann integral?


Something like :  First line of a praragraph followed by   indented text and some   more indented text   In other words the inverse of what you usually get. MWE :  \documentclass{book}  \usepackage{kantlipsum}  \begin{document}  \kant[1-2]  \end{document}

I'm trying to define a hangindent (I managed that) which is repeated for each new line or each new paragraph or something. Do I really have to repeat that before each entry or is there a way of setting that generally for each line / paragraph in this particular chapter? The idea is that if an entry is longer than a line the later lines should have a hanging indentation.  (And yes, I'm aware that writing the bibliography manually is totally silly but my department is very peculiar about how the bibliography has to look like and I wasted 2 days already trying to get a custom style to work (and failed obviously) so I figured doing it manually would in the end be quicker.. -.-)  thx a lot in advance :)  \chapter{Bibliography} \addcontentsline{toc}{chapter}{Bibliography} \label{Bibliography}  \hangindent=\parindent \hangafter=1  Adams, Ansel. \emph{Die neue Ansel Adams Photobibliothek: Das Negativ}. Ed. Robert Baker. 9th ed. München: Christian Verlag GmbH, 1998.\\ Kiefer, Roland. \emph{Nikon Fotoschule}. Schaffhausen: Verlag Photographie, 1981.


$f(x)$ is a real valued function on the reals, and has a continuous derivative such that $$\lim_{x\to\infty} f'(x)^2 + f(x)^3 = 0.$$  How do i show that $$\lim_{x\to\infty} f(x) = \lim_{x\to\infty} f'(x)=0?$$  Note I tried to take $f(x)=\frac{1}{x}$ but it did not work  Thank you for any kind of help

Question:     Let $f$ be differentiable on $[0,+\infty)$, such as$$\lim_{x\to+\infty}\left([f'(x)]^2+f^3(x)\right)=0$$show that $$\lim_{x\to\infty}f(x)=\lim_{x\to\infty}f'(x)=0$$   I think this problem is similar to  and (the  background)  For my problem I guess that if  $$\lim_{x\to+\infty}\left([f'(x)]^{2m}+f^{2n+1}(x)\right)=0,m,n\in N^{+},n,m>1$$ then we have $\lim_{x\to\infty}f(x)=\lim_{x\to\infty}f'(x)=0$.


root@modsmy:~# add-apt-repository ppa:webupd8team/java -bash: add-apt-repository: command not found   I got this error when I type the following:   add-apt-repository ppa:webupd8team/java

The server version of Ubuntu does not have the  command. How can I add a  (PPA) to the server without this command?


Would it be correct to say that before the round can be officially 'over' in Phase 10, everyone playing should be able to take a turn? For example: three people are playing Phase 10 and just started a new phase, we'll say Phase 6: 1 run of 9.  Player 1 picks up from the deck and discards a card from his hand; Player 2 picks up that card and is able to lay down 10 cards and discard the last card-thus, completing and finishing the phase.  However, would Player 3 be entitled to a turn before the round is completed? I can't recall if this is an actual rule in the Phase 10 rule book or if over the years our family had just adopted the rule to let the example Player 3 have a turn to try and be fair.

In Phase 10, is it legal to lay out your phase and play out your hand (placing remaining single card in the discard pile) in the first round, before all players have had a chance to play in that round (i.e. pick up a card and discard)?


If I do not ask for permission, is it acceptable to take pictures from posters and slide presentations in a conference by camera? Can I record a presentation?

Is it accepted/appropriate to take pictures of presentation slides at conferences for private use?   I am not talking about putting those pictures out in the public afterwards, I know this is illegal without consent of the presenter.    Should it matter, I am talking about math conferences.  And I am asking because I don't see anyone taking pictures.


Exercise 3.1.9. (Novosibirsk 2007)   Let $a$ and $b$ be positive numbers, and $n \in N$. Prove that  $(n + 1)(a^{n+1} +b^{n+1}) \ge (a+b)(a^n + a^{n-1}b + · · · +b^n)$  The exercice is taken from . I've been trying to employ the mentioned approaches and theory, but without much success and I'm pretty much clueless as of right now. Any ideas would be greatly appreciated! Thanks in advance!

Let $a$ and $b$ be positive numbers, and $n \in \mathbb{N}$. Prove that (using Rearrangement Inequality) $$(n+1)\left(a^{n+1}+b^{n+1}\right) \geq (a+b)\left(a^n+a^{n-1}b+\ldots+b^{n}\right). $$  Thanks :)


I am new to LaTeX.   would like to insert the copyright on the title page of my ebook. This is what I want it to look like (centered in the middle of the page):  Title, Author, Copyright (copyright symbol) 2013 by Author, All Rights Rserved, eISBN:    Below is what I have tried so far. However, I continue to get an error for the copyright line. I chose report because it was closer to an ebook format. After trying to read through some LaTeX "basics" this is what I came up with.  \documentclass[titlepage,a4paper,12pt]{report} \begin{document}  \title{ebook title here} \author{my name} \Copyright \copyright\; 2013 my name\\ All Rights Reserved\\  \maketitlepage

How do I add a copyright page, just after the title page in the report or book class? (Like in standard books about a block of a copyright license at the bottom of the page).


Failed to start wordpress-5-vm: Operation type [start] failed with message "The zone 'projects/X-wordpress/zones/us-east1-d' does not have enough resources available to fulfill the request. Try a different zone, or try again later." Can somebody help with this issue, I have tried all the things nothing is working.

This is a  about a temporary shortage of available resources in Google Cloud services.   I'm a Brazilian user of Google Cloud's Compute Engine for a while and I managed to use it fine for quite some months. Unfortunately, in the last one month or so, I've been facing difficulties starting my instances (around 9 AM) due to the problem "the zone does not have enough resources available to fulfill the request".    At the start, it happened once or twice and then I was able to start my instance. But now it's almost impossible to start it even after dozens of attempts! Following the message's suggestion, I tried to create other instances in southamerica-east1-a nd c (mine was in b) only to find out the same problem happening there. The impression I get from this is that Google has saturated their physical capacities in South America and are doing nothing to increase it.  So what can I do about it? I can't move my server to the USA or something because it's ping sensitive (stock market applications) and, as someone still using the free trial period, I certainly won't start paying for GC if Google may handle me a product I can't use and will take weeks or months to fix.


Recently  for why, if $Z \sim N(0,1)$ denotes the standard normal, $\mathbb{E}|\frac{1}{Z}| = \infty$. However, in hindsight this argument does not seem to rely on many special properties of $Z$. As a test of my understanding, I have tried to make the following generalization:     Claim (Sufficient Condition for $\mathbb{E}|\frac{1}{X}| = \infty$): For any random variable $X$ with a density $p(x)$ strictly positive and continuous at every point of $[0,1]$, it is the case that $\mathbb{E}|\frac{1}{X}|=\infty$.   Question: Is this claim true?  Purported proof: By , $$\mathbb{E}\left[\left|\frac{1}{X}\right|\right] = \int_{\mathbb{R}} \frac{1}{|x|}p(x) dx = \int_{-\infty}^0 \frac{1}{|x|}p(x) dx + \int_0^1 \frac{1}{x}p(x) dx + \int_1^{\infty} \frac{1}{x}p(x) dx $$  Because $p(x)$ is strictly positive and continuous at every point of $[0,1]$, by the  there exists an $x_0 \in [0,1]$ such that $p(x_0)>0$ and for all $x \in [0,1]$, $$p(x) \ge p(x_0)\,,$$ i.e. $\min\limits_{x \in [0,1]}p(x) =: p(x_0)$ can be well-defined.  Therefore, by  we have:  $$\mathbb{E}\left[\left|\frac{1}{X}\right|\right] \ge \int_0^1 \frac{1}{x} \left(\min\limits_{x \in [0,1]}p(x) \right) dx + \dots = \left( \min\limits_{x \in [0,1]} p(x) \right) \int_0^1 \frac{1}{x}dx + \dots = \infty  $$ since the integral $\int_0^1 \frac{1}{x}dx$ is . "$\square$"  Can this actually be correct? It seems odd to me that the behavior of the random variable on the interval $[0,1]$ alone can determine whether its reciprocal has finite expectation or not, especially for distributions which are not symmetric about $0$. It also seems too generally/widely applicable to too many important examples of (continuous) distributions to go completely unmentioned, for example, .

The title is the question. I am told that ratios and inverses of random variables often are problematic. What is meant is that expectation often do not exist. Is there a simple, general explication of that?


In SFMC, I need to show a specific block at the 1st order and after that it needs to be displayed at every 4th order. Meaning 4+1 (5,9,13 and so on). My current ampscript looks like this, but I am very much in doubt on how to make the counts match. %%[  VAR @customerid, @orderrows, @rowCount, @modulo  SET @customerid = _subscriberkey /* value from attribute or DE column in send context */ SET @orderrows = LookupRows("Orders","subscriberkey", @customerid) SET @rowCount = rowcount(@orderrows)  SET @modulo  = mod(@rowCount, 4) IF rowcount(@orderrows) == 1 OR (@rowCount > 0 AND @modulo == 0) THEN     SET @purchase = ContentBlockByID("1")     ]%%      %%=v(@purchase)=%%      %%[ ENDIF ]%%  Thank you :)

In SFMC we need to show a block after the customers 4th purchase. This means when the customer have bought: 4, 8, 12 and so on. I know I could use a dynamic content block and then you add the numbers manually, but I was wondering if it was possible to use ampscript that do the count for me. If so, how would that look like?


If I wanted to say that I am not hungry I could leave out the "no more" so shouldn't the "no more" cancel out the "not hungry" to mean that you are hungry. However other examples, like "I don't love her no more", still make me think that the meaning doesn't change but I don't see how this is grammatically correct and think "anymore" should be used instead. "I am not hungry anymore." So why dont the two negatives in the original sentence cancel each other out?

In my native language, double negations "cancel out". I have been trying to learn English using movies and such things, but double negation confuses me. I see instances when double negation cancels out, and some when they do not.  For example, "I haven't got no money" is interpreted as "I have no money." "There wasn't anyone who didn't enjoy the party" is interpreted as "Everyone enjoyed the party."  Is this context dependent? If so, how does one decide which interpretation is correct?


is not a duplicate of my question. I checked it and mine is how to use proper Predicate, and THAT is about differences between removeIf & remove.  I'm beginner Java programmer. Yesterday, I tried to follow this tutorial   After I leared how to use Lambda expressions and Predicate, I made my own code to practice. like, sum all numbers if(n % 3 == 0 || n % 5 == 0). here is my code.  public class Euler1Lambda {     long max;     public Euler1Lambda(long max) {         this.max = max;     } public static boolean div3remainder0(int number) {     return number % 3 == 0; }  public static boolean div5remainder0(int number) {     return number % 5 == 0; }  public long sumAll() {     long sum = 0;     for(int i=1; i<max; i++) {         if (div3remainder0(i) ||div5remainder0(i)) {             sum += i;         }     }     return sum; }  public long sumAllLambda(Predicate<Integer> p) {     long total = 0;     for (int i = 1; i< max; i++){         if (p.test(i)) {             total += i;         }     } return total; }  public static void main(String[] args) {     //conv     long startTime = System.currentTimeMillis();     for(int i = 0; i < 10; i++){         new Euler1Lambda(100000000).sumAll();     }     long endTime = System.currentTimeMillis();     long conv = (endTime - startTime);     System.out.println("Total execution time: " + conv);     //lambda     startTime = System.currentTimeMillis();     for(int i = 0; i < 10; i++){         new Euler1Lambda(100000000).sumAllLambda(n -> div3remainder0(n) || div5remainder0(n));     }     endTime = System.currentTimeMillis();     long lambda = (endTime - startTime);     System.out.println("Total execution time: " + lambda);     System.out.println("lambda / conv : " + (float)lambda/conv); } }   In this code, did timing tests. and result is like this.  Total execution time conv: 1761 Total execution time lambda: 3266  lambda / conv : 1.8546281   As you can see, lambda expression with predicate is slower than simple for-loop. I have no idea why does the result like this. What am I doing wrong? or just predicate is too slow way to use?

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


I will be travelling to Copenhagen and from there to Helsingborg on 1 June and back again on 3 June.  How much time do I need at Copenhagen airport to get off the plane, fetch my baggage and go on the train from the Copenhagen airport railway station to Helsingborg?  And when coming back, how much time do I need to get off the train at Copenhagen airport railway station, check in and check my luggage in, go through security control and get on the plane?  Currently I have reserved two hours to get from the plane to the train, and when coming back, three and a half hours to get from the train to the plane. Will this be enough, or do I need more time?  More information was requested, so I'm editing my question. I'm Finnish and travelling from/to Helsinki. The flights are in early afternoon, the flight to Copenhagen arrives at 15:10 and the flight back leaves at 14:45.

My son will be flying into Copenhagen in July arriving at 7:15am.  He will need to travel by train to Kalmar. He must go through border control. I am wondering: how much time he will need to get through border control at the Copenhagen airport and then onto the train?


Please see this question:   I've tried everything I can think of for the code to show up as normal.

Consider the following piece of Markdown code:  This is some regular text.      >>> def factorial(n):     ...     return 1 if n < 2 else n * factorial(n - 1)     ...   * This is a list item.      >>> def factorial(n):     ...     return 1 if n < 2 else n * factorial(n - 1)     ...    Notice that the second code block is preceded by a list item.   Why is the factorial code not properly formatted under these circumstances? To demonstrate the problem, I'll insert the Markdown code show above:    This is some regular text.  >>> def factorial(n): ...     return 1 if n < 2 else n * factorial(n - 1) ...     This is a list item                 def factorial(n):       ...     return 1 if n < 2 else n * factorial(n - 1)       ...               This applies to numbered as well as unnumbered lists.


Why to execute a shell script I have to write:  ./shell   why can't I execute it just using  shell   being in the directory with the file?

While executing a C program, a.out, using the Ubuntu terminal, why do I always need to type ./ before a.out, instead of just writing a.out? Is there solution for this?


Will delete free the right amount of bytes ? unique_ptr<sockaddr_in> up = make_unique<sockaddr_in>();         // or unique_ptr<sockaddr_in> up( new sockaddr_in ); ???  /*      Some stuff      sockaddr and sockaddr_in are two different types of struct and are not relateted  */  sockaddr *p = reinterpret_cast<sockaddr *>( up.release() );  delete p;

Say I have the following C++:  char *p = new char[cb]; SOME_STRUCT *pSS = (SOME_STRUCT *) p; delete pSS;   Is this safe according to the C++ standard? Do I need to cast back to a char* and then use delete[]? I know it'll work in most C++ compilers, because it's plain-ordinary-data, with no destructors. Is it guaranteed to be safe?


I want to represent the following sum in LaTeX.    I have tried it in the following way:  $$\sum_{{1 \le k \le n}_{ k odd}} k^2$$   But I have not got the desired result. Please help me.

I did a search trying to find out how one can typeset multiple lines under a sum and found out that there is the possibility to use \atop or \substack together with a remark that one shouldn't use \atop.   Is there any good reason for that? Does it commit some typographical sins I am not aware of?


My nikon d3100 has broken flash... what can I use to replace it, externally?  I just want something small and lightweight, as fill flash. I have a large external flash unit, but it's HEAVY. Thanks! Claudia

I have read a lot about the SB-800/SB-900 but I am on a low budget (around ~120$). Is there an external flash that I can have to start learning to use it? I do not need TTL compatibility so it can be an older model. I have a Nikon D5000.


I have found a simple floating point error and I was wondering if there is a way around it. I'm compiling in Haiku OS.  I'm in Haiku r1 Alpha 4  #include <iostream> #include <cmath>  float P(float PV, float r, int t){   return(r * PV/1-pow((1+r),-t)); }  int main(void){   float PV = 100000;   float r = .005;   int t = 350;    std::cout << "A loan valued at $" << PV << " at a rate of %" << r << " with a payment period of " << t << "months would be $" << P(PV,r,t) << ", per-payment.\n";    return 0; }   When I run it P(PV,r,t) comes out as 499.834 it should be 500. Though if I set r = 0.06 P is correct and comes out as P = 6000.  Maybe it's a compiler error. I'm using gcc version 2.95.3-haiku-121101.

Consider the following code:   0.1 + 0.2 == 0.3  ->  false   0.1 + 0.2         ->  0.30000000000000004   Why do these inaccuracies happen?


(1) Network works fine  (2) In Software Center, search doesn't work, search anything gives no result.  (3) Chromium install failed: E: Could not get lock /var/lib/dpkg/lock-frontend - open...  Then I've installed Chromium successfully from command line.  Is there a way to install application from the Software Center (not command line)? How to fix the Software Center problems?  Update:  After reboot Chromium can be removed and reinstalled in Software Center, but search still doesn't work, and update doesn't work as

I'm trying to run this command in the terminal:  sudo apt install software-properties-common   This is the error message I get:  E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)   E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend),     is another process using it?


When I run date +"%Y%m%d%H%M%S" I receive 20171225203309 here in CET time zone.   Can I use date to obtain a the current time in the same format, but for timezone GMT?

I have a server running with the timezone set to UTC. It seemed like that was generally a good practice (please correct me if I'm wrong).  Anyhow, one of the servers I connect to, in order to scp files, is running on EDT and stores files that I need to copy in the format /path/to/filename/data20120913  I looked at trying to rsync files using something like find's -mtime -1 flag for files modified in the last day, but I didn't have any luck.  I don't mind just using scp to copy the current day's file, but as of right now there is a 4-hour window where running date +%Y%m%d will give a different day on each server and that bugs me a little.  Looking through man date I see that I can have the time output as UTC, but I don't see a way to have it output as another timezone like EDT  I suppose I could also use something like the GNU date extension date -d 20100909 +%s to get the date in seconds from the epoch, apply a manual 4 * 60 * 60 second calculation, and see about rendering that as a date - but then when daylight time kicks in it will still be an hour off.  Is there a simpler way to output the date in a YYYYMMDD format for EDT on a server that is set to UTC ?


What happens to the local users and groups when promoting a domain member to a domain controller?  I have a Windows Server 2008 that I have made to a domain controller by installing AD DS, but it was not really what I wanted to achieve with the server so I uninstalled AD DS and removed the server's role as a domain controller.  What happens to the local users and groups that existed before I installed AD DS? Will they return? Will I be able to get into the server by logging in as admin?  I really need answers to these questions, I have a little panic because it is a customer server.   Please tell me that they will come back

I'm kinda newbie in this Windows 2008 Server R2 configuration stuff, so I would appreciate any help regards the issue I'm facing.  After a Windows 2008 Server R2 clean install I created a couple of local user accounts and joined them to the administrators group, I tested them and I was able to log on with each one.  Then I installed Active Diectory role (DNS role implied) and runned DCPromo. The domain was created and promoted succesfully and I was able to log on into the domain from a client machine.  The issue began when I realized that I was no longer able to log on locally into the server (meaning LOCALMACHINE\localusername). I looked into domain user accounts and noticed that the local user accounts I created previously were now part of the domain. I consider a bad thing not being able to log on locally anymore, so in a shot to fix it I stopped the Active Directory service... my bad! Now I'm sort of locked up, I can't log either locally or as part of the domain.  Can someone please shed some light in this? What did I miss in the process? I tried googling but could find any straight forward solution or explanation. What concept I'm not catching?How can I promote a server to PDC and still be able to log on locally?  Thanks in advanced.


What multiple, m, of a, divided by b, returns a remainder that is c below m? What formula do you use for this math question? for example if a is 73 and b, the divisor is 97. Then what multiple, m, is to be multiplied such that the remainder is 35 below m In this case the answer by searching is 79. That is, (79 x 73) mod 97 = 44 [44 is 35 below 79]. If I don't want to search then how to devise formula to give correct answer? For example, if a is 475813677834783 and b, the divisor, is 37683749758978594988734958734997589341. Then what multiple, m, is to be multiplied such that the remainder is 6783687436873 below m?

When I am faced with a simple linear congruence such as  $$9x \equiv 7 \pmod{13}$$ and I am working without any calculating aid handy, I tend to do something like the following:  "Notice" that adding $13$ on the right and subtracting $13x$ on the left gives: $$-4x \equiv 20 \pmod{13}$$  so that $$x \equiv -5 \equiv 8 \pmod{13}.$$  Clearly this process works and is easy to justify (apart from not having an algorithm for "noticing"), but my question is this: I have a vague recollection of reading somewhere this sort of process was the preferred method of C. F. Gauss, but I cannot find any evidence for this now, so does anyone know anything about this, or could provide a reference? (Or have I just imagined it all?)  I would also be interested to hear if anyone else does anything similar.