I like non-smoothed fonts on my desktop's monitor, but some apps just don't look okay because they use built-in fonts which are not suitable for aliased rendering. So when I need to do some reading, I have to re-enable font smoothing system-wide by checking the ClearType option in control panel. I am using ClearType Switch to speed up the process, but still this is not very convenient.   I'm looking for solutions for Windows 7, 8 or the upcoming 10. So far I know there are applications that modify Windows' native font rendering modules, like MacType, but in case of MacType, it does not remember which apps it should and should not affect. I'd like to find a more reliable solution that would "just work" without constant adjustment. Is there any way (native or using third-party software) to render text in a specified way for specific applications?

Is there a tool or something which can quickly enable or disable ClearType without going through the windows 7 ClearType-configuration dialog every time?  I need this because I have to make screenshots quite often and screenshots look blurred when ClearType is activated. And when ClearType is disabled everything looks blurred on my screen, so I usually enable it again after taking a screenshot.


def compose(f,g):     return lambda f: f + 1   return lambda g: g   how can I specify the order of the return statements  These are the test cases;  add1 = lambda a: a+1 this   = lambda a: a  test.expect( compose(add1,this)(0) == 1 )

I have a function where I need to do something to a string.  I need the function to return a boolean indicating whether or not the operation succeeded, and I also need to return the modified string.    In C#, I would use an out parameter for the string, but there is no equivalent in Python.  I'm still very new to Python and the only thing I can think of is to return a tuple with the boolean and modified string.  Related question:


I'm trying to get cyrillic data from MySQL database using php I set utf-8  $db = mysql_select_db(DB_DATABASE) or die(mysql_error()) or die(mysql_error());      mysql_query("SET character_set_client = utf8");     mysql_query("SET character_set_connection = utf8");     mysql_query("SET character_set_results = utf8");   And when i set cyrillic data in db it works properly, but when I'm trying to get it:   $product["id"] = $row["id"];     $product["first_name"] = $row["first_name"];     $product["last_name"] = $row["last_name"];     $product["vk_id"] = $row["vk_id"];     $product["points"] = $row["points"];      // push single product into final response array     array_push($response["users"], $product);  echo json_encode($response);   And it gives me \u0416\u0430\u043c\u0431\u044b\u043b  and when I change json_encode($response); to json_encode($response, JSON_UNESCAPED_UNICODE);  it gives me :Р–Р°РјР±С‹Р  How can I get readable cyrillic data?

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


I have been given the following:  If X is a positive random variable with E(X) = 0, find P(X=0).  I am guessing this is 1 but how do i prove this?

We have proven the following in class:     If $X$ is a finite random variable with $X\geq 0$ then $$E(X)=0  \iff  P(X=0)=1$$ (By finite I meant that the range has finitely many elements).   Does it hold for any non-negative random variable $X:\Omega\to\mathbb R_{\geq0}$?  (I've tried proving it with the indicator function yet it didn't help.)


I'd like to prove that, for any $M,N\in\mathbb{N}$ with $M\leq N$, and any $n\in\mathbb{N}$ with $n\leq M$, the sum: $$\sum\limits_{k=0}^n\frac{\binom{M}{k}\!\!\binom{N-M}{n-k}}{\binom{N}{n}}=1.$$ I have proved it for $n=2$ by hand, and got stuck on the induction because trying to extract the previous sum is always unsuccesful. Let me expand on that. I tried twice, and always got stuck. I'll tell you only about the first time, because it is the attempt that tried to go from the induction hypothesis to the thesis, and it lays out all the equalities used in the second attempt, which went the other way, and was also unsuccessful. The induction step is: $$\sum\limits_{k=0}^{n-1}\frac{\binom{M}{k}\!\!\binom{N-M}{n-k-1}}{\binom{N}{n-1}}=1.$$ Using that the following holds: $$\binom{N}{n}=\frac{N!}{n!(N-n)!}=\frac{N-n+1}{n}\binom{N}{n-1}\!\!\implies\!\!\!\!\binom{N}{n-1}=\frac{n}{N-n+1}\binom{N}{n},$$ one turns the inductive hypothesis into: $$\sum\limits_{k=0}^{n-1}\frac{\binom{M}{k}\!\!\binom{N-M}{n-k-1}}{\binom{N}{n}}\frac{N-n+1}{n}=1.$$ This first step is lucky since the extra factor doesn't depend on $k$, so can be extracted from the sum and brought to the right side. The next step, though, is less lucky. One can easily see that: $$\binom{N-M}{n-k}=\frac{(N-M)!}{(n-k)!(N-M-n+k)!}=\frac{N-M-n+k+1}{n-k}\binom{N-M}{n-k-1}\!\!\implies$$ $$\implies\!\!\!\!\binom{N-M}{n-k-1}=\frac{n-k}{N-M-n+k+1}\binom{N-M}{n-k}.$$ This shows us how going on like this would give us a factor that can't be taken outside the sum, and can therefore not be isolated to get to the sum of the thesis (Note: "thesis" is what I have to prove, so the statement for $n$; I'm not sure if that term is used in English with that sense; it is in Italian). I tried using: $$\binom{N-M}{n-k}=\!\!\binom{N-M-1}{n-k-1}+\!\binom{N-M-1}{n-k}$$ as well, but that didn't get me any further. If we use the second equality above to substitute, we get: $$\sum\limits_{k=0}^{n-1}\frac{\binom{M}{k}\binom{N-M}{n-k-1}}{\binom{N}{n}}\frac{N-n+1}{n}\frac{n-k}{N-M-n+k+1}=1.$$  Any ideas?

I stumbled across this identity involving binomial coefficients this morning:  If $n$, $k$, $a$, and $b$ are positive integers and $n=a+b$, then  $$ \binom{n}{k} =\sum_{i=0}^k \binom{a}{k-i}\binom{b}{i}.$$  The proof is trivial. (Partition a set $N$ of $n$ things into disjoint sets $A$ of $a$ things and $B$ of $b$ things. Now to pick $k$ items from $N$, either all $k$ are from $A$, or $k-1$ are from $A$ and $1$ is from $B$, or...)  Has this identity appeared before (I expect the answer to be "Yes!") and if so, does it have a name?


On Stackoverflow, I have flagged a question for security purposes. The user has provided a link to the admin panel of their site along with a username and password. As these credentials are for a super user, anything can be done on the site.   I posted this flag on 15th January and 5 days later, it's still pending (active). I'm fully aware that the Mods have a lots of things to do, however seeing as this poses a rather big threat, I thought I would bump it on here. I assume the Mods have some sort of page with pending flags, therefore I won't post a link to the question on here for security purposes.  Maybe it might be an idea to add another option to the "flag reasons" list, which makes it a top priority and can be dealt with quickly.

I've observed several incidents where users inadvertently posted detailed, sensitive information. For example, a Server Fault user who posted a question with working login credentials to his actual production server, or the Stack Overflow user who posted actual medical records as example data for his question.   What should be the procedure for handling such cases?


I write html and javascript:    $(document).ready(function(e) {   $('#btadd').click(function(e) {     $('#content').html('' + $('#result').html());     $('.btnmsg')[i].click(function(e) {       alert('span ' + i);     });     i++;   }); });  var i = 0; <input type='button' value='add' id='btnadd'>

     On html code, I create a button and a div. When click on button, on div will add new element span.   I want that when click on span, there will be a alert message. I don't want to use inline js (add onClick to span), because I write this addon for browser.   So I just want to write this event for span in js only.   I write as above code, but nothing to see (no alert message). What can I do?

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


I am a history student who was challenged to make this program so please assume I have little knowledge of coding.  I thought my program was approaching completion but am getting an error that the variables inside the roll function are not defined. However, when I run the roll function on its own there is no problem. I'm sure this is a simple mistake but, would like to know how to correct it, and why. (learning things is cool)  import random  def roll():     die1 = random.randint(1, 6)     die2 = random.randint(1, 6)               r =  die1 + die2 return r  def Turn():     pScore = 0     cScore = 0     turn = True     while turn == True:         pChoice = str(input("Would you like to roll? Type yes or no."))         if pChoice == "yes":             roll()             if r == 2:                 turn = False                 pScore = 0                 print("You have rolled snake eyes. Your turn is over and         your score is 0.")             elif die1 == 1 or die2 == 1:                 turn = False                 pScore += r                 print("You rolled {}, {} and your score is {}. your turn is     over".format(die1, die2, pScore))             else :                 turn = True                 pScore += r             print("You rolled {}, {} and your score is {}".format(die1, die2, pScore))         if pChoice == "no":             turn = False             print("You have chosen not to roll. Your score is {}.".format(pScore))      while turn == False:         roll()         if r == 2:             turn = True             cScore = 0             print("The computer has rolled snake eyes. It's turn is over")         elif die1 == 1 or die2 == 1:             turn = true             print("The computer {}, {} and its score is {}. Its turn is over".format(die1, die2, cScore))         else:             turn = False             pScore =+ r             print("The computer {}, {} and its score is {}.".format(die1, die2, cScore))  def main():     pScore = 0     cScore = 0     while pScore <100 and cScore <100:         Turn()     if pScore >= 100:         print("Your score is {} you win!".format(pScore))             return     elif cScore >= 100:         print("The computer score is {} you lose!".format(cScore))         return main()

What exactly are the Python scoping rules?  If I have some code:  code1 class Foo:    code2    def spam.....       code3       for code4..:        code5        x()   Where is x found?  Some possible choices include the list below:   In the enclosing source file In the class namespace In the function definition In the for loop index variable Inside the for loop   Also there is the context during execution, when the function spam is passed somewhere else. And maybe  pass a bit differently?  There must be a simple reference or algorithm somewhere.  It's a confusing world for intermediate Python programmers.


I want to prove that the number of surjective functions from $[k]$ to $[n]$ is given by $$\sum_{j=0}^n \binom{n}j (-1)^j (n-j)^k$$ I know there is a link with inclusion exclusion formula because the first term of the sum counts all possible functions from a set of k elements to a set of n elements but then I don't see what is happening.

Let $m,n$ be two integers such that, $m\ge n$. Compute the number of surjections from $\{1,...,m\}$ to $\{1,...,n\}$   There are $n^m$ functions (total).  we subtract from $n^m$ the number of non-surjective functions.  There are $\binom{n}{1}(n-1)^m$ functions missing one element.  There are $\binom{n}{2}(n-2)^m$ functions missing two elements, but how many times did we count this in the previous count ?  Then we have to add this again by inclusion-exclusion but why is the difference always 1?


$$\lim_{n \to \infty}\frac{1}{n}\sqrt[n]{\frac{(2n)!}{n!}}$$  I was practicing exercise with a visible sum in those but how to get one here?

Wonder how to determine this limit by the use of Riemann integral. The limit is as follows:  $$\lim_{n \to +\infty} \frac{1}{n}\sqrt[n]{\frac{(2n)!}{n!}} $$  My instructor told me that the usage of Riemann integral gives spectacular result. Checked Rudin, but did not find any valuable references.  I am very interested in seeing how this "spectacular result" emanates.  Help/advices/solutions very, very appreciated!


How can I stop software installed using checkinstall from being updated in the software updater?  In my case, I install emacs from source via checkinstall and set the version to 26. I have removed all system versions of emacs using apt.  Every time software updater pops up it wants to update emacs.  How can I stop this behaviour?  Edit:  TLDR: Ubuntu uses higher numbers than current emacs version for emacs package -- see See

I've been building my own emacs because I want to fix some issues in it and get the bug fixes upstream. However, Ubuntu keeps automatically removing my own built emacs and I have to keep rebuilding and reinstalling it.  Here's my output of apt-cache policy emacs when I went to bed last night:  ~/emacs$ sudo apt-cache policy emacs emacs:   Installed: 26.0.50.aaron-1   Candidate: 46.1   Version table:      46.1 500         500 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 Packages         500 http://us.archive.ubuntu.com/ubuntu xenial/main i386 Packages  *** 26.0.50.aaron-1 100         100 /var/lib/dpkg/status   Here it is when I wake up:  ~/emacs$ sudo apt-cache policy emacs [sudo] password for excelsiora: emacs:   Installed: 46.1   Candidate: 46.1   Version table:  *** 46.1 500         500 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 Packages         500 http://us.archive.ubuntu.com/ubuntu xenial/main i386 Packages         100 /var/lib/dpkg/status   Why is this package being versioned at 46 instead of 24 or 25? 26 is the currently the highest major emacs version you can get.   I can see that this is a meta-package:   Why is Ubuntu updating software without asking?  Main Question: What am I supposed to do - assign my package version a number higher than 46 just to make it stick?   That seems like a horrible hack, or maybe that's how it's supposed to work?


How to get from terminal 1 to terminal 5 at Rome airport?  Where I can get my boarding pass?  I have 3:25h between flights; is that okay?

The official site mentions a shuttle bus service, I also googled but the infos are not clear, so I hope to find some firsthand experience.  I have a flight with a stop in Fiumicino, I will arrive in Terminal 1 and the next departure is from Terminal 5, the transfer time is around 5 hours.  Is it correct that I should go to Terminal 3 first (using the internal transfer area) and after exit from Terminal 3 and take the shuttle to Terminal 5?  The terminal 5 has a waiting area with some shops or is just a terminal for departure? In your opinion is better to wait some hours inside Terminal 3 before going out to take the shuttle bus?


I want to make a bash script that clears the history i.e. works similarly as the command  history -c   So I started with the following code:-  #!/bin/bash history     #displaying history history -c  #clearing history   None of them worked. On some searching around, I came to know that bash disables history in non-interactive shells by default, but we can turn it on. So after editing I tried the following code :-  #!/bin/bash HISTFILE=~/.bash_history   # Or wherever you bash history file lives set -o history             # enable history history history -c   It shows the output :-  [root@localhost lib]# bash a.sh 1  history [root@localhost lib]#   And besides that the hisory -c command did not work. Because I am still getting the history of commands when I type history. This means both history and history -c didnt work inside the bash script. How should we use it then?  EDIT 1- I want to delete the history of the current session, it must be stored somewhere. I have tried using commands like the following but to no effect:-  cat /dev/null > ~/.bash_history && history -c && exit     cat /dev/null > ~/.bash_history   P.S.-This is not a duplicate question. Please try to understand the difference before marking it as duplicate. I want to clear the history of the current session through a script . I don't care if it is written back or whatever. The other question is about to permanently delete the history. It has nothing to do with the script or through other terminal.

I want to clear all previous commands from the history of my server. I used history -c and it seems all things are cleared but when I ssh to the server, all the commands are still there.  How can I clear them permanently?


Prove that $\int_0^{\infty}\sin(x^2)dx$ converges by making the change of variable $u=x^2$, and applying integration by parts to the resulting integral. Prove the integral does not converge absolutely.(Use the $u$ form.)  $\int_0^{\infty}\sin(x^2)dx = \int_0^\infty \sin u \frac{1}{2\sqrt u}du = \sin u \sqrt u|_0^\infty - \int_0^\infty \cos u \sqrt udu$. Then I don't know how to proceed.

$$\int_{0}^{\infty }\sin(x^{2})dx$$  I'm confused with this integral because the square is on the x, not the whole function. How can I integrate it? Thank you.  I have not done complex analysis (only real analysis as I am a high school student) so how can I evaluate it using elementary functions (without complex analysis)?


I have a Linux system which has a monitor plugged into it, but no keyboard. I would like to ssh into it and run startx as if I had typed this at virtual terminal 1. I have set up  for a non-root user on this terminal.  How can I do that?  $ ssh -x myhost Last login: Mon Dec  9 00:55:14 2019 from 192.168.42.3  # I have permissions to write to /dev/tty1 $ ls -al /dev/tty1 crw------- 1 myusername tty 4, 1 Dec  9 09:21 /dev/tty1  # but I need to tell startx how to use /dev/tty1 instead of /dev/pts/3 $ startx  /usr/lib/xorg-server/Xorg.wrap: Only console users are allowed to run the X server xinit: giving up xinit: unable to connect to X server: Connection refused xinit: server error Couldn't get a file descriptor referring to the console [1]  # redirecting doesn't work $ startx <> /dev/tty1 zsh: device or resource busy: /dev/tty1 [1]  # I can run startx as root, but that's not what I wanted to do $ sudo sh -c "startx <> /dev/tty1"  X.Org X Server 1.18.4 Release Date: 2016-07-19 X Protocol Version 11, Revision 0 ...   This is meant to be a question about "how can I run a command as if it had been typed in on /dev/tty1, with the same permissions etc.". For example, if I want to run a command in X, but from a remote login, I can run "DISPLAY=:0.0 xterm", and xterm will come up on the server's monitor. Can someone provide a script called for example run-on-tty, where run-on-tty /dev/tty1 startx will work as expected?  I'm pretty sure there must be a way to do this with ttys on Linux, either with ttysnoop or screen or openvt, but I can't figure it out, and the answers to other similar questions , , and  all seem to advocate working around the missing functionality.

I want to start an Xorg server (which should only feature a minimal xterm terminal emulator from a newly created "pristine" tty). I have thought this to be as simple as issuing a xinit or maybe a startx however both have failed me. Therefore the question: How to manually run/init/start a Xorg server on a different VT/TTY? here the Longer background story to the question at hand: This is the backgroud and what I have tried already: Looking at man openvt I was able to run a shell on a newly created tty (or vt, cannot tell precisly the different vt<>tty) like this:  $> sudo openvt -s /bin/bash  the -s of causes the direct switch to that new tty/vt on that new tty I wanted to manually start a Xorg server which according to man xinit should start with a minimal xterm application. On the new shell on the switched to tty I (created via openvt) I hence issues this command:  $> su -c 'xinit xterm -display :4 -- :4' - mahr &>/tmp/output  and I receive this output $> cat /tmp/output X.Org X Server 1.19.6 Release Date: 2017-12-20 X Protocol Version 11, Revision 0 Build Operating System: Linux 4.4.0-148-generic x86_64 Ubuntu Current Operating System: Linux scitech 4.15.0-70-generic #79-Ubuntu SMP Tue Nov 12 10:36:11 UTC 2019 x86_64 Kernel command line: BOOT_IMAGE=/vmlinuz-4.15.0-70-generic root=/dev/mapper/ubuntu--vg-root ro Build Date: 03 June 2019  08:10:35AM xorg-server 2:1.19.6-1ubuntu4.3 (For technical support please see http://www.ubuntu.com/support)  Current version of pixman: 0.34.0     Before reporting problems, check http://wiki.x.org     to make sure that you have the latest version. Markers: (--) probed, (**) from config file, (==) default setting,     (++) from command line, (!!) notice, (II) informational,     (WW) warning, (EE) error, (NI) not implemented, (??) unknown. (==) Log file: "/home/mahr/.local/share/xorg/Xorg.4.log", Time: Thu Nov 28 10:57:53 2019 (==) Using system config directory "/usr/share/X11/xorg.conf.d" (EE)  Fatal server error: (EE) parse_vt_settings: Cannot open /dev/tty0 (Permission denied) (EE)  (EE)  Please consult the The X.Org Foundation support       at http://wiki.x.org  for help.  (EE) Please also check the log file at "/home/mahr/.local/share/xorg/Xorg.4.log" for additional information. (EE)  (EE) Server terminated with error (1). Closing log file.  Session terminated, terminating shell...xinit: giving up xinit: unable to connect to X server: Connection refused xinit: unexpected signal 2  ...terminated.


What's the difference between both the sentences:-  I am going to show you something. I am going to be showing you something. I will be showing you something. I am going to send. I am going to be sending. I believe ex 2 and 3 has the same meaning.

Note: this post is different to , which just cites part from somewhere else, without any further analysis and thinking. Furthermore, none of the answers to that post answers my question - the situations where "will (going to) be doing" is more appropriate.   I will be participating in IELTS test next Tuesday afternoon.  In an online class, the teacher says the following at the beginning of the lesson.  I will be using NotePod (pointed out by red rectangle) to write relevant points we talk about today.   I guess "will be using" is more appropriate than "will use" there, right?  A  explains  This "tense" is used for reporting a scheduled activity with special focus on its timing— as if one is standing in the future and experiencing the flow of the time. The focus is on the temporary, ongoing, or repetitive nature of the activity.   I understand the grammar rules of those verb tenses and the difference between this group  I am going to drive home tomorrow.   I am going to be driving home tomorrow.  The former is just convey my activity in the near future while the latter probably makes an implication that "don't disturb me as I am driving in that time" However, in the following situations, I don't see the difference between 2 verb tenses.  Welcome back to this class. Today's lesson is for the IELTS students who are going to be taking the IELTS test. it's for everybody to be honest with you. this lesson is useful for anybody who needs to do some writing.   who are going to take the IELTS test ...


I am trying to build a simple LinkedList in Java which takes chunks of a String. I am getting NullPointerException when i try to pop the elements. Below is my code. Please help me out.  public class LinkedList {      private class Node {          private String info;         private Node next;          Node() {             this.info = null;             this.next = null;         }          Node(String item, Node next) {             this.info = item;             this.next = next;         }      }      // private Node start;      Node start = new Node();     Node end = new Node();     Node top;      public void addNode(String item) {         if (start.next == null) {             top = new Node(item, end);             start.next = top;             return;         }          if (start.next != null) {              top.next = new Node(item, end);             top = top.next;             // top.next = end;          }     }      public String[] pop() {         String[] result = null;         Node popping = start;         while (popping.next != end) {             popping = popping.next;             int count = 0;             System.out.println(count);             result[count] = popping.info;              count++;         }          return result;     }      public static void main(String args[]) {         LinkedList kds = new LinkedList();         for (String s : "kds on a roll".split(" ")) {             kds.addNode(s);             // System.out.println(kds.toString());         }          String[] s = null;         System.out.println("Popping Begins");         s = kds.pop();         System.out.println(s);     } }

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 cannot find the answer to my question anywhere, I hope someone can help.   I did a Chi-Square test with several variables to see if they were dependent or independent. The result showed that they were dependent.   After that I did a Spearman´s rho test to see if they were correlated or not (looking at the P-value). All of them were correlated except one. Can this be correct?   Can two dependent variables not be correlated?

Correlation does not imply causation, as there could be many explanations for the correlation. But does causation imply correlation? Intuitively, I would think that the presence of causation means there is necessarily some correlation. But my intuition has not always served me well in statistics. Does causation imply correlation?


Firefox 43 comes with a 64bit version. But the one delivered with Ubuntu is 32bit.    but in this link there is an option to download 64bit version but its in tar.gz format. Does that mean firefox gets automatically updated and its resources gets added to the software sources or do I have to download again when a new version comes?

I have a 64-bit Ubuntu. For the preinstalled Firefox I had to download the 64-bit plugins (, ); the 32 bit plugins didn't work. Then I downloaded Firefox from , which just has one version to download, and it does not state whether it is 32 bit or 64 bit (as of november 2010). Using this downloaded Firefox all the 64-bit plugins no longer work. I had to download the 32 bit plugins.  How can I tell whether my Firefox is 32 bit or 64 bit?


Eureka! I have got it.  $$E-mc^2= \frac12mv^2$$ The interpretation goes like this. Total energy- rest energy= kinetic energy. But we all know Total Energy = Potential Energy + Kinetic Energy. Since  $$E= mc^2 + \frac12 mv^2.$$ So the rest energy must be potential energy which is $mc^2$. Which means Einsteins formula gives us potential energy.  Please tell me if I am right.

If the kinetic energy formula is the same as Einstein's formula then $E=mc^2=\dfrac{1}{2} mv^2$. Or, $\dfrac{1}{2}v^2=c^2$. What does this prove? Does it prove that $\dfrac{1}{2}$ of the velocity squared of a moving object is always equal to speed of light squared?


So I'm creating a simple javascript program that allows me to add text boxes and a remove button that when clicked removes the button and the text box next to it:   <!DOCTYPE html>   <meta charset="UTF-8"> <title>Title</title>

     <input type="text" class="in"/>     <button class="btn" id="1">Remove</button>

 <button id="add">Add</button>
 <button id="cacl">Calculate</button>

     And here is the script   $(function () {     var i=2;     $("#add").click(function () {         $("#space").append('
<input type="text" class="in"/> <button class="btn" id="'+i+'">Remove</button>

');         i++;     });      $(".btn").on('click', function () {         console.log("OK");         $(this).parent().remove();     }) });   However when I click on the remove button nothing happens it doesn't even log "OK".  Any ideas?

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


The author of a plugin has abandoned it. The community has created patches and I have created updates. Right now it's in another public repository but it's becoming unyielding to maintain both. Is it possible to fork it?   UPDATE The link in the similar post provided some answers. But it did not answer can I create my own version?

I have come across a few WordPress plugins on  with this warning:     This plugin hasn't been updated in over 2 years. It may no longer be   maintained or supported and may have compatibility issues when used   with more recent versions of WordPress.   Is there a way to "adopt" or "verify" a plugin like this? I do have one plugin on wordpress.org so I understand the process. What is the correct process to bring an old or possibly abandoned plugin current?


I am using mysql_real_escape_string and strip_tags as follows:  strip_tags(mysql_real_escape_string($postvariable));   I just want to know if this makes sense. Will strip_tags still work, aka remove  tags and html tags after the string has been filtered by mysql_real_escape_string ?

If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example:  $unsafe_variable = $_POST['user_input'];   mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");   That's because the user can input something like value'); DROP TABLE table;--, and the query becomes:  INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')   What can be done to prevent this from happening?


Here's an interesting question:  Let $F$ be a field and $a\in F$. Prove that the functor from the category of commutative $F$-algebras to $\textbf{Set}$ taking an algebra $R$ to the set of invertible elements of the ring $R[X]/(X^2-a)$ is representable.  To make my writing easier, let $\textbf{F-alg}$ denote the category of commutative F-algebras, and let $\mathcal{F}$ denote our functor from $\textbf{F-alg}$ to $\textbf{Set}$. We want to find a commutative $F$-algebra $K$ such that there is a natural isomorphism $\textbf{F-alg}(K,-)\cong \mathcal{F}$. I think it might follow from the fact that the set of invertible elements of $R[X]/(X^2-a)$ is in 1-1 correspondence with $\textbf{F-alg}(F[Y,Y^{-1}],R[X]/(X^2-a))$ for all commutative $F$-algebras $R$. Other than that, I am stuck. Having an $F$-algebra homomorphism mapping to $R$ correspond to an invertible element of $R[X]/(X^2-a)$ doesn't seem obvious. Any hints are appreciated!

The following question is from the Fall 2016 UCLA algebra qualifying exam:  Let $F$ be a field and $a\in F$. Show that the functor that takes $R$, commutative $F$-algebras to the invertible elements of $R[X]/(X^2-a)$ is representable.  What I have so far: If $a\in F$, then then we have that $R[X]/(X^2-a)\cong R\times R$. Hence we get that $$ Hom_{F-\text{alg}}(F[t,t^{-1}]\otimes_FF[t,t^{-1}],R)\cong Hom_{F-\text{alg}}(F,R\times R)\cong U(R)$$ where $U$ is the functor that take $R$ to units of $R[X]/(X^2-a)$. Hence in this case, the functor is representable.  I'm unsure how to extend this to the general case.


I'm writing a simple script to monitoring the disk space in the / partition and I want to grep only numbers in my output.  tabbi@tabbi:~/scripts$ df -h /  Filesystem      Size  Used Avail Use% Mounted on /dev/sda2       234G  7,6G  214G   4% /   Let's say I want to remove the % from the Use column (or remove it everywhere); when I use df -h / | grep -v '%' nothing is printed.  How can I exclude the % symbol from my output?

I want to remove last character from a line:  [root@ozzesh ~]#df -h | awk  '{ print $5 }' Use% 22% 1% 1% 59% 51% 63% 5%  Expected result:  Use 22 1 1 59 51 63 5


I am new to Java Spring Boot - and I am trying to invoke a Mailer class to send out an email.  -- so at this forgot password stage - I reset the password and now I want to send the user their new password via email.  I've tried to do the following.  -- in my user handling controller          //send         MailService mailer = new MailService();             mailer.sendEmail();   -- the mail service looks like this -- before there was a request mapping to send an email out when you went to /simpleemail.  package services;  import java.util.HashMap; import java.util.Map;  import javax.mail.MessagingException; import javax.mail.internet.MimeMessage;  import org.springframework.beans.factory.annotation.Autowired; import org.springframework.mail.javamail.JavaMailSender; import org.springframework.mail.javamail.MimeMessageHelper; import org.springframework.stereotype.Controller; import org.springframework.ui.freemarker.FreeMarkerTemplateUtils; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody;  //import org.apache.velocity.app.VelocityEngine; import freemarker.template.Configuration;  @Controller public class MailService {      @Autowired     private JavaMailSender mailSender;      @Autowired     Configuration fmConfiguration;          /*     @RequestMapping("/simpleemail")     @ResponseBody     String home() {         try {             sendEmail();             return "Email Sent!";         }catch(Exception ex) {             return "Error in sending email: "+ex;         }     }*/      public MailService(){      }       public void sendEmail() throws Exception{           MimeMessage mimeMessage = mailSender.createMimeMessage();          try {              MimeMessageHelper mimeMessageHelper = new MimeMessageHelper(mimeMessage, true);              mimeMessageHelper.setSubject("Hi");             mimeMessageHelper.setFrom("zzzz@gmail.com");             mimeMessageHelper.setTo("xxxx@gmail.com");                Map < String, Object > model = new HashMap < String, Object > ();             model.put("firstName", "Yashwant");             model.put("lastName", "Chavan");               mimeMessageHelper.setText(geContentFromTemplate(model), true);              mailSender.send(mimeMessageHelper.getMimeMessage());         } catch (MessagingException e) {             e.printStackTrace();         }               }      public String geContentFromTemplate(Map < String, Object > model) {         StringBuffer content = new StringBuffer();          try {             content.append(FreeMarkerTemplateUtils                 .processTemplateIntoString(fmConfiguration.getTemplate("email-template.txt"), model));         } catch (Exception e) {             e.printStackTrace();         }         return content.toString();     } }

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 just received a badge () for .  I don't think I visited this question before, let alone share it.  When I click on the share button, it gives me a link with my user id. This means that anyone can easily increase someone else's visit amount, and I think this might be how I got these visits. I don't really think this is a security issue (but still tagged it, it weirded me out when I saw the notification). I love earning badges, but only when I actually earned them.

Today I got both the Announcer badge and the Booster badge for  that I asked last year.   I don't remember ever sharing a link to it, and it seems odd to me that I would get both badges in one day, implying that there were at least 276 people who viewed it today from a link I don't remember ever sharing.  What's going on?


The masses of ,  and  (in SI units) are (approx.):  \begin{equation} m_e=\text{electron mass}=9.109\times 10^{-31}\ \text{kg} \end{equation} \begin{equation} m_p=\text{proton mass}=1.673\times 10^{-27}\ \text{kg} \end{equation} \begin{equation} m_n=\text{neutron mass}=1.675\times 10^{-27}\ \text{kg} \end{equation}  The  ($u$) is defined as one twelfth of the mass of .  \begin{equation} u=1.661\times 10^{-27}\ \text{kg} \end{equation}  Now, Carbon-12 contains 6 electrons, 6 protons and 6 neutrons, so the mass of this isotope should be:  \begin{equation} m=\text{Carbon-12 mass}=6\times(m_e + m_p + m_n)=6\times 3.3489 \times 10^{-27}\ \text{kg} \end{equation}  Then:  \begin{equation} \frac{m}{12}=0.5\times 3.3489 \times 10^{-27}\ \text{kg}=1.674 \times 10^{-27}\ \text{kg} \end{equation}  But this value is different from the value of $u$. Shouldn't $m/12$ be equal to $u$?

When I add up the mass of 6 protons and 6 neutrons in amu, I get a mass that is greater than the mass of carbon. I thought that it should be the other way around, because I have not including binding energy when I add up the mass of the protons and neutrons.  Proton: 1.007276466812 u  Neutron: 1.00866491600 u  6(1.007276466812)+6(1.00866491600)=12.099  Carbon: 12 u  Why is this so?


Let $f_n$ be a sequence of measurable functions defined on a measurable set $E$ .Define $E_0$ to be the set of points $x$ in $E$  at which $\{f_n(x)\}$ converges .Is the set $E_0$ measurable?   My try:  Let $f(x)=\lim _{n\to \infty} f_n(x)$  $E_0=\{x\in E:f_n(x)  \mbox{converges}\}$  To show that $E_0$ is measurable consider the set $\{x:f(x)>c\}$ for any $c\in \Bbb R$.  If $f_n(x)$ converges for some $a\in E_0$ then  $f(a)=\lim _{n\to \infty} f_n(a)$ then $|f_n(a)-f(a)|<\frac{1}{n}\forall n\in \Bbb N$  So $f(a)-\frac{1}{n}<f_n(a)<f(a)+\frac{1}{n};\forall n\in \Bbb N$  Then $\{x:f(x)>c\}=\cap_{{n\in \Bbb N}}[\{x:f_n(x)>f(a)-\frac{1}{n}\}\cap \{x:f_n(x)<f(a)+\frac{1}{n}\}]$ which is measurable as $f_n$ is measurable  and measurable sets form a $\sigma-$ algebra.  Is the proof correct?

Let $E$ be a measurable subset of $\mathbb{R}$ and let $F_n :E \to \mathbb{ R} $ be a sequence of measurable functions. Let $$E^*= \{ x\in E : F_n  \text{ is convergent } \}$$ Is the set $E^*$ measurable?    To solve this, I need to understand the relation between the set $E^*$ and the functions $F_n$. They are strongly related, but how can I express this relation in terms of sets and measure?


Is there any theorem which states the asymptotic distribution for the sample mean when the samples are drawn from a random variable which has a bounded interval?

I've always taken issue with, and never been given a good answer, for how it is possible that the central limit theorem - the classical version where the distribution of sample means approaches normality - can apply to say a Poisson or Gamma distribution, where $P(x<0)=0$. Or, for that matter, any other distribution for which $\exists X:X \neq -\infty ,F(X)=0$, or perhaps $\exists X:X \neq \infty, 1-F(X)=0$.  As an example, given a Gamma distribution, as the number of samples $n \rightarrow \infty$, $P( \bar{X} = \alpha) \rightarrow 1$, $\forall \alpha \geq 0$, for some $\bar{X}_i$. But if $\alpha<0$, $P(\bar{X}=\alpha)=0$. There simply will never, EVER be an $\bar{X}_i<0$. This suggests to me that the distribution of $\bar{X}$ cannot be, nor approach, normality because $f(\bar{X})$ must necessarily be $0$, $\forall \bar{X}<0$, which does not meet the requirements of a normal distribution where $f(y)>0, \forall y \in R$.  I'd feel much better about life and anything based on the CLT if someone could help me understand where my logic has gone astray.


Writing a driver script for my git hooks in Perl.  Unfortunately, I keep getting this syntax error that doesn't make sense.  Can't locate Git/Hooks.pm in @INC (@INC contains: /path/to/myLibraries.)   I understand it is looking for Git/Hooks.pm in my include directories.  Unfortunately, I only see the Git directory, but no Hooks.pm file.    I tried finding Hooks.pm on GitHub (i.e. source code of Git), but can't even find it there.    The only thing I see in the library I am using is I18N.pm IndexInfo.pm SVN SVN.pm, which is exactly what I see for git's source code.  Does this file even exist...anywhere?  If so, where and when I find it can I just copy it into the directory and call it good?

I get this error:  Can't locate Foo.pm in @INC  Is there an easier way to install it than downloading, untarring, making, etc?


What is the limit on what the holodeck can generate? From the episodes of Star Trek that I've seen, the holodeck is at least capable of generating a few city blocks. But can it do more, an entire city, a country, or even a whole world?  Does it also depend on the ship? For example the holodeck on Enterprise might be more powerful than the one on Voyager, and thus might be able to generate more of a scene.

I can understand how the holodeck creates virtual environments. But I don't see any mechanism that prevents people from walking into walls. Are the floors moving? Are they in a different dimension that has more space? Do they simulate the feeling of movement while keeping you stationary?  Some simulations appear to take up far more physical space than the holodeck would allow (as in people are physically all over the virtually created world - like Voyager's 24/7 running Irish city).


I'm still circling around this quasi belief that ends and beginnings are somehow problematic.  Suppose that physicists or philosophers could show that we cannot know when time begins. Would that mean that we cannot know ever know that time has begun?  I.e. is there anything about tense that means that if knowing something in one tense is metaphysically impossible, then we cannot know it in any tense?  Obviously we can know what it was physically impossible to... Right?

Although, I can conceive of a potentially infinite amount of time ahead of me, for it is not actual as it remains to be experienced, I can't conceive of a potentially infinite amount of time behind me, for having been experienced it is actual, and being actual it is finite, as I can't conceive of actual infinities.   Hence there is a beginning to time.  Has anyone discussed this argument in the literature?


I use this function to make excerpt of text and link to full content. Now when reach the count of symbols(letters) is cutting the word. I don't want to cut the on first, second or any word. How to check and make excerpt before or after the word?  Here is function that I use  function getExcerpt($str, $startPos=0, $maxLength=150) {     if(strlen($str) > $maxLength) {         $excerpt   = substr($str, $startPos, $maxLength-3);         $lastSpace = strrpos($excerpt, ' ');         $excerpt   = substr($excerpt, 0, $lastSpace);         $excerpt  .= '...';     } else {         $excerpt = $str;     }      return $excerpt; }

I have a code snippet written in PHP that pulls a block of text from a database and sends it out to a widget on a webpage.  The original block of text can be a lengthy article or a short sentence or two; but for this widget I can't display more than, say, 200 characters.  I could use substr() to chop off the text at 200 chars, but the result would be cutting off in the middle of words-- what I really want is to chop the text at the end of the last word before 200 chars.


Maybe the question is stupid, but I haven't been able to find anything anywhere to confirm that.  I have 1TB HDD which has two ext4 partitions. In one partition, I've my main OS (Ubuntu). And another partition is empty.  I'd like to install an another OS in my second partition. Is it possible, while being in one partition (Ubuntu), to install an OS in another unmounted partition ( and finally update the grub menu ).  Thank you.

I recently purchased an external USB hard drive and wanted to use it as a portable boot drive. I installed Linux Mint 18.1 on it and got everything working.  Then I started to think about using that drive to install Linux on other machines. I assumed that whatever a live boot USB does should be possible from a full-blown Linux installation. I looked around and the only option I found was from Ubuntu: . Their solution is to create a partition, fill it with the ISO contents and then boot from that to launch the installer. I did follow those instructions and got it working as expected, however, I still feel there must be a way to install Linux from Linux without booting into an ISO.  I just found a related question: . There is an answer there that suggests there is some sequence of operations that could be run to install Linux on another partition, but I would need more detail than provided there. Is that process documented somewhere?  Honestly, I would be more comfortable if I could just run the installers that are included in the live boot images of each distro. Or some kind of semi-authoritative script that would do the same thing. Is there a package in the repos that would provide such a thing (eg. a Linux Mint installer package that could be installed using apt-get or yum)?


Good day! Blender 2.79. When I create any new object by Shift+A (for instance, torus), I have panel "Add torus" unactivated. Can't click  Generate UV's, Allign to View, Location, etc. What's wrong? Thanks for answers.

I am trying to model a tree. I turned on the Add a sapling add-on in user preferences, however once I want to begin editing the settings, they come up but is grey and doesn't let me click on it.    I have also attached my blend file here:


So I bought a new Christmas tree this year.  One with LEDs which makes setting up and tearing down simple.  It has a remote control which can set the lights blinking in different patterns.  A lot of really brilliant reds, blues, greens, violet, orange, and white.  They can dance and repeat patterns, chase each other up and down the tree, all that.  It's really pretty great.  Then I noticed something puzzling.  The replacement pack of lights.  For the tree they gave me a small packet of 6 replacement LEDs.  Enclosed is a picture of one.  My question.  How in the world would this work?  It's a two wire connection.  From the variety of colors there has to be at least 4 LEDs in there - RGB and W.  How can the CPU in the base of the tree address any light in the thread and assign it a color with only two wires?  Anyone know the protocol this thing is using?  How can they get such color diversity and positional addressability from only 2 wires?

I have a few 3mm color-changing LEDs which I harvested from a toy. They fade in between all different colors, and then after a little while, they blink crazily between all the colors. After a few moments, the cycle repeats.  What is interesting about them (and what I wasn't expecting) is that they only have two leads, like a normal hobbyist LED.   I understand that, like an RGB LED, they have multiple elements (probably not the right word) inside. But how do they achieve the color changing and cycling?  Here is a picture of the LED in question:    Notice the little bit of black material inside the LED. Could this possibly be a tiny chip?


I want to implement a simple LRU cache in Java using only Java's built in data structures.   The idea is to use a Map and a doubly linked list (DLL).  So for Map I'm using HashMap. The problem I'm facing now is that I want that an item in the HashMap will point to the corresponding item in the DLL, but I don't have an access to the internal nodes of the LinkedList.  What could be a reasonable solution without creating my own new data structure?

Please don't say EHCache or OSCache, etc. Assume for purposes of this question that I want to implement my own using just the SDK (learning by doing). Given that the cache will be used in a multithreaded environment, which datastructures would you use? I've already implemented one using  and , but I'm curious if any of the new concurrent collections would be better candidates.  UPDATE: I was just reading through  when I found this nugget:     If you need constant-time access and want to maintain the insertion order, you can't do better than a LinkedHashMap, a truly wonderful data structure. The only way it could possibly be more wonderful is if there were a concurrent version. But alas.   I was thinking almost exactly the same thing before I went with the LinkedHashMap + Collections#synchronizedMap implementation I mentioned above. Nice to know I hadn't just overlooked something.  Based on the answers so far, it sounds like my best bet for a highly concurrent LRU would be to extend  using some of the same logic that LinkedHashMap uses.


I am trying to set this up to be able to run a docker-compose setup on my Windows 10 Home with docker toolbox. I need WSL2 to be able to do port forwarding from the Docker container, through WSL2 and access those services from my Windows browser.  I encountered an issue with Virtualization and Hyper-V:  1) After installing Docker Toolbox and WSL2, I ran the following commands to enable virtualization:  dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart   That allows me to use the Ubuntu-18.04 App, but when trying to run the Docker Quickstart Terminal from the Docker Toolbox, I encounter the following error:  Unable to start the VM: C:\Program Files\Oracle\VirtualBox\VBoxManage.exe startvm default --type headless failed: VBoxManage.exe: error: Raw-mode is unavailable courtesy of Hyper-V. (VERR_SUPDRV_NO_RAW_MODE_HYPER_V_ROOT) VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component ConsoleWrap, interface IConsole  Details: 00:00:01.902344 Power up failed (vrc=VERR_SUPDRV_NO_RAW_MODE_HYPER_V_ROOT, rc=E_FAIL (0X80004005)) Looks like something went wrong in step ´Checking status on default´... Press any key to continue...   It seems its an issue due to having the Hyper-V enabled by default, so I removed it from the Windows Functionalities and also set the hypervisorlaunchtype using:  bcdedit /set hypervisorlaunchtype off   Now I can use the Docker Quickstart Terminal and the Docker VM runs correctly, however, now I cannot boot the Ubuntu-18.04 App since I now get the following Error:  Please enable the Virtual Machine Platform Windows feature and ensure virtualization is enabled in the BIOS.   Seems there is an option that I'm missing or perhaps due to the fact it's a Windows 10 Home edition?  I have already checked Virtualization is on from the BIOS directly, also restarted every time a change is made and I can either boot up the Docker VM or boot up the Ubuntu VM but not both.  EDIT:  OS and build> Microsoft Windows 10, V2004 [Version 10.0.19041.208]

I'm using windows home edition, I have the latest update installed 1909.  I want to install docker for windows 10 home edition. It keeps saying  Docker Desktop requires Windows 10 Pro/Enterprise (15063+) or Windows 10 Home (19018+).  Should I join Windows insider? How long should I wait for that update to be released if I don't want to join windows insider?


A specific file on our production servers is being modified at apparently random times which do not appear to correlate with any log activity.  We can't figure out what program is doing it, and there are many suspects.  How can I find the culprit?  It is always the same file, at the same path, but on different servers and at different times.  The boxes are managed by , but the puppet logs show no activity at the time the file is modified.  What kernel hook, tool, or technique could help us find what process is modifying this file?    lsof is unsuitible for this, because the file is being opened, modified and closed very quickly.  Any solution that relies upon polling (such as running lsof often) is no good.      OS: Debian testing Kernels: Linux, 2.6.32 through 3.9, both 32 and 64-bit.

Given file path, how can I determine which process creates it (and/or reads/writes to it)?


I wonder how can I test if a data sequence is really random?  Of course I can randomly cut it into equal pieces, and check if the correlation coefficient between different pieces on average is zero.  But is that sufficient?  Or if that is the best way to do it?  Thank you

Which methods are used for testing random variate generation algorithms?


I have been facing multiple problems after upgrading to ubuntu 14.04. All the problems are related to the desktop interface.  After upgradation, I have been unable to change my wallpaper. Firstly wallch (a program which automatically changes wallpapers) started becoming unresponsive. I used it to set a wallpaper but due to its unresponsiveness, I uninstalled it. Then I tried changing the wallpaper from the "Appreance Settings" but was unsuccessful. I also tried the "Set as wallpaper" option which we get when we right-click an image file (lets call it imgA) but was still unsuccessful. I then checked the value of the desktop-background in dconf-editor and it was showing the value path to imgA file but the background which is displayed is a completely different image.   I also tried re-installing unity and nautilus packages from synaptic but still the problem persists.  Another issue I started facing was when minimizing windows, from the window bar, unity hangs when I minimize the last of all the opened windows and only responds when I press 'Alt'  I recently installed playonlinux and played a couple of games in the full screen mode. When I exit from any game, the desktop backrgound goes all black and I have to logout and login again to restore the background.  I am assuming that the above 3 problems are connected somehow.  I am using a Dell laptop with intel graphics card.  Let me know if further information is required from my side.  -- EDIT --  As suggested in the comment below, I opened the unity-control-center from the terminal. Here's the ouput:  (unity-control-center:15831): Gtk-CRITICAL **: gtk_radio_button_set_group: assertion '!g_slist_find (group, radio_button)' failed  (unity-control-center:15831): Gtk-CRITICAL **: gtk_radio_button_set_group: assertion '!g_slist_find (group, radio_button)' failed  (unity-control-center:15831): Gtk-CRITICAL **: gtk_radio_button_set_group: assertion '!g_slist_find (group, radio_button)' failed  (unity-control-center:15831): unity-control-center-WARNING **: Could not load /usr/share/themes/HighContrast/index.theme: No such file or directory  (unity-control-center:15831): GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT (object)' failed *** BUG *** In pixman_region32_init_rect: Invalid rectangle passed Set a breakpoint on '_pixman_log_error' to debug   (unity-control-center:15831): unity-control-center-WARNING **: Failed to load picture '/home/user1/Pictures/big_4c5beb001d9090853e1bf9af24147e63de79edf0.jpg': Error opening file: Too many open files  (unity-control-center:15831): unity-control-center-WARNING **: Failed to load picture '/home/user1/Pictures/big_4d1a4510071da06bfe2351d0a59c54271c7bda3a.png': Error opening file: Too many open files  (unity-control-center:15831): unity-control-center-WARNING **: Failed to load picture '/home/user1/Pictures/big_04b22aa796b650c7364bd84da515d8b527f5dcbd.png': Error opening file: Too many open files  (unity-control-center:15831): unity-control-center-WARNING **: Failed to load picture '/home/user1/Pictures/big_4aac96caa049ac3e5a62a90c78f21945b1b27ce6.jpg': Error opening file: Too many open files   .... many of these output messages  and then when I closed it .. I got the following two lines  (unity-control-center:15831): Gtk-CRITICAL **: gtk_builder_get_object: assertion 'GTK_IS_BUILDER (builder)' failed  (unity-control-center:15831): Gtk-CRITICAL **: gtk_icon_view_get_selected_items: assertion 'GTK_IS_ICON_VIEW (icon_view)' failed

After the upgrade from 12.10 to 13.04 my desktop background turns black after I try to set a image for that. How to fix it?  This is my desktop screen:


I want to return two values from method which is used to get input from the user and after getting input I haev to return those values in another method as a parameter/argument. i tried to use "return a,b" but its not working. please suggest me the solution.... ` public static int fnInput(){     Scanner sc1 = new Scanner(System.in);      System.out.println("Enter 1st Number:");     int a = sc1.nextInt();      System.out.println("Enter 2nd Number:");     int b =  sc1.nextInt();          return a,b;  } ` I tried to use this array method too but this method is also not working and returning the values ` public static int fnInput(){     Scanner sc1 = new Scanner(System.in);      System.out.println("Enter 1st Number:");     int a = sc1.nextInt();      System.out.println("Enter 2nd Number:");     int b =  sc1.nextInt();          return new int[] {a ,b };  } `

I want to return two objects from a Java method and was wondering what could be a good way of doing so?  The possible ways I can think of are: return a HashMap (since the two Objects are related) or return an ArrayList of Object objects.  To be more precise, the two objects I want to return are (a) List of objects and (b) comma separated names of the same.  I want to return these two Objects from one method because I dont want to iterate through the list of objects to get the comma separated names (which I can do in the same loop in this method).  Somehow, returning a HashMap does not look a very elegant way of doing so.


I have a class that reads a file and stores the values found in a map, in memory. I'v declared a member function using templates, so that I can extract any value from a string.   ConfigReader.h  class ConfigReader {     private:         More Code...     public:         ...         template<typename vType>         vType GetValue(const char * key); };   ConfigReader.cpp  ...  template<typename vType> vType ConfigReader::GetValue(const char * key) {     stringstream buffer(GetStringValue(key));      vType extrValue;     buffer >> extrValue;      if(!buffer)         throw invalid_argument("Failed to extract the value!");      return extrValue; }   Main.cpp  int main() {     ...      try{         cout << "Encryption: " << boolalpha << config.GetValue<bool>("use_enc") << endl;      }catch(invalid_argument err){         cerr << "Error: " << err.what() << endl;      } }   I get the following link error:  1>Main.obj : error LNK2019: unresolved external symbol "public: bool __thiscall ConfigReader::GetValue<bool>(char const *)" (??$GetValue@_N@ConfigReader@@QAE_NPBD@Z) referenced in function _main  1>..\Visual Studio 2017\Projects\...\Debug\FilePhraser.exe : fatal error LNK1120: 1 unresolved externals  Wich means that the function GetValue<bool>() hasn't been found.   Could you please explain me why the linker can't find that function ?

Quote from :     The only portable way of using templates at the moment is to implement them in header files by using inline functions.   Why is this?  (Clarification: header files are not the only portable solution. But they are the most convenient portable solution.)


I'm a CNA and I just got home from a very long day at work. I just started this job and I got hurt at work last night which made me wonder can enough pain cause death (without suicide)?  I think the answer is yes, but I'd like to know how/why.

Is it possible that a human or any other creature can die from pain?  I googled and found different answers. Some articles say Yes while others say No.


I'm not able to understand the solution to this problem. It says selecting $17$ items from a set of $(x,y,z)$ Final answer: $(17+3-1)C17$

I actually got this part and I got $16$ choose $2$, which would be $120$. The part I didn't get which wouldn't fit into the title was in how many of these solutions is $x_1 \geq 1$, $x_2 \geq 2$,and $x_3 \geq 3$? I'm not very good at combinatorics so I don't really know. I think the way to approach it would be saying how many solutions where $x < 1 +$ solutions where $x < 2 +$ solutions where $x < 3$ and subtract that from $120$, but I don't know how to do that.


This has always struck me as odd, in Harry Potter and the Philosopher’s Stone,  Harry, Ron, and Hemione get past 7 obstacles in order to stop Quirrell. Although, even if Harry and his pals don’t show up, Quirrell still wouldn’t have gotten the stone. Why? It’s because of the enchantments Dumbledore himself put. Quirrell would never have gotten the stone because his intentions weren’t honorable. That renders the others kind of pointless. When I say “kind of pointless” I mean they do not need to be there, Dumbledore could have set the mirror in Quirrell's office and he still wouldn’t have gotten the stone. So why all these death traps Dumbledore? Besides, If Dumbledore really wanted the students to keep out, he should have made it harder to get to then just: Even Umbridge is able to seal her office from the likes of Alohomora, but this is guarding the Philosopher's stone we’re talking about! Plus, on Christmas, Harry finds The Mirror of Erised and looks into it. In case you need a refresher, Hagrid took the stone from the vault in July and it is now December so why is it taking so long to put the stone, in the mirror, in the chamber? Uh, so why is the mirror up in the school when it should be down in the chamber? Why are there so many obstacles when they’re pointless?

The Sorcerer's/Philosopher's Stone was removed from Gringotts to be placed under the most impenetrable of protections at Hogwarts under Dumbledore's custody. But it seems clear Dumbledore took protections which could have been impenetrable, and deliberately made them less so, such that at best they would only slightly slow down anybody trying to access the Stone, rather than just plain block them.  For example, after the Devil's Snare, you have a locked door enchanted such that it cannot be opened by any charm or other means except its own assigned key. That's a great protection, potentially an impassable barrier if the key is not available.  But the key is then left right there in front of the door in the same room.  At least the key is flying around the ceiling. But there are broomsticks right there in the same room, too.  The room with the fires front and back—that could also have been a solid defense—deadly fires that cannot be passed through unless you drink very specific potions tailored to each particular fire's properties.  Except that those potions providing safety are put right there in the same room.  At least, perhaps, they're surrounded by other bottles, some of which contain poison. With no way to know which bottle is safe, that could still almost be a solid protection.  Except that a piece of paper with a logic puzzle detailing exactly which bottles are which is put on the table with them.  Dumbledore always had reasons, and those reasons were always virtuous. What was he up to, deliberately weakening the protections in this way?


Prove that      $$ \large{\left|\int_{\gamma} e^{iz^2} dz\right | \leq \frac{\pi(e-1)}{4e}}$$   where $\gamma(t)=e^{it}, t\in[0,\frac{\pi}{4}]$  Since  $|e^{iz^2}|=e^{-2xy}$ now  $x=\cos(t),y=\sin(t)$   This mean $-1 \leq-2xy \leq0$ which imply maximum value of $|e^{iz^2}|=1$  And hence  $$ \left|\int_{\gamma} e^{iz^2} dz \right| \leq  \frac{\pi}{4}$$  but this is not what we are supposed to prove. what is missing here. Any hint.  Thank you

Verify that $$\left|\int_{\gamma} \exp(iz^2)dz\right| \leq \frac{\pi\big(1-\exp(-r^2)\big)}{4r}$$ where $\gamma(t)=re^{it}$, for $0\leq t \leq \pi/4$ and $r > 0$.   I'm stuck. here is my attempt:  $|\int_{\gamma} e^{i\cdot z^2}dz|\leq \int_{\gamma} |e^{i\cdot z^2}|dz=\int_{\gamma}|(e^{z^2})^i|dz$. As $t > 0$ on $0\leq t \leq \pi/4$. $\Rightarrow|e^{r^2 e^{2it}}|=|e^{r^2}e^{e^{2it}}|>0$ $\Rightarrow\int_{0}^{\pi/4} e^{r^2}e^{2it}rie^{it}dt=e^{r^2}ri\int_{0}^{\pi/4} exp(e^{2it}+it)dt$ Let $\alpha=e^{r^2}ri$ $\Rightarrow \alpha\int_{0}^{\pi/4}e^{\cos2t}e^{i\cdot \sin2t}(\cos(t)+i\cdot \sin(t)dt)$  Am I on track?


Our community took () a poll on our meta. The question has 14 answers, 12 of which are all posted by the same user. By the looks of it, some votes were reversed due to the serial voting detection mechanism.  It seems to me that "real" serial voting would occur across many questions. If one user posts 12 answers to the same question, it is perfectly reasonable to vote on all of them. It might even be reasonable to downvote ten of them and only upvote two.  Can we amend the logic for detecting serial voting to look wide instead of deep? In other words, can we modify it to detect patterns across many questions instead of triggering from a bunch of votes on a small handful of questions? Is there a reason why we wouldn't want to do this?

I've downvoted several of the answers on these Meta discussions:       Both questions are typical self evaluations, Stack Exchange runs them on all young Beta sites and as you may have noticed they are essentially polls, a series of example questions from the site that we are supposed to vote on.  Today I noticed that almost all of my votes have disappeared on both evaluations, only an upvote remains in the later one. My votes triggered the serial voting script, something that :      Heh, it appears I just serially downvoted you (I downvoted a lot of the answers here), hopefully the script is smart enough to not reverse my votes. Will check back in 24h, and if it does, I'll rant about it on MSO ;)    My voting behaviour on both evaluations was very simple:   I had the evaluation open in the left monitor, Opened all the example questions in their own tab, in the right monitor, Scanned each question quickly, and voted on the Meta answer (most of my votes were downvotes), Repeat for the next one, and so on...   I didn't spend more than a few seconds on any question, as I'm fairly regular on the site and I've already read all of them while casually browsing the site. In fact, if my memory isn't failing me, I had voted (up/down) and/or commented, and/or voted to close on each of the 20 example questions. I might have spend a minute or two re-reading a couple, but I mostly scanned through them. In any case I think my voting pattern is quite normal, and the script should be somehow tweaked to take serial posts, posted by the same user in quick succession, into consideration, especially on Metas.   Since I had anticipated that the script would kick in, I could have tried to fool it by pausing a bit between votes or trying to look for other Meta posts to vote on, in between voting on the evaluation answers. However I'm a very active voter on Meta Workplace, there aren't many posts I haven't already voted on, and the few that I haven't is probably because I neither agree or disagree with (my opinion on them is simply "meh"). In any case I think my voting behaviour was natural, and although the serial voting script is awesome, this time it caught and reversed a perfectly legitimate behaviour.  Animuson, in , mentions that the script isn't really optimal on Area51 as well:      Yes, please implement this on Area 51 proposals too! Oftentimes a single user would suggest a plethora of "example" questions to their own proposal which are just terrible, yet all of everyone's votes get reversed and the question just sits there at 0. I've noticed several times that my votes have gotten reversed.    I haven't noticed it myself, but it certainly seems plausible, especially early in a proposal's life.  Mysticial found a related discussion, , but it's focused on voting patterns on main sites, where reputation is also a factor. I can understand jumping through hoops to satisfy the script on main sites where, unfortunately, there are a lot of people trying to get some cheap rep or "punish" others with their downvotes, but not on Metas, and especially not on these evaluation posts.   Voting fraud is a problem, and more often than not the script works wonderfully, but in my case it was extremely counterproductive. Critical evaluations are essential for a young Beta site, and their answers typically only get a handful of votes. I wonder how many of these votes have silently gone away...  Fix this please.


One month ago I bought a set of stainless steel cookware from Cuisinart. Today I noticed that the smallest pan is not flat - the base has bended so that the center is a little lower than the edgees.  That made me wonder what could have caused it? I was quite watchful to wash it only after it cools down a bit (though I'm not sure how my girlfriend was). Can overheating cause that too? Or heating without oil? (my girlfriend uses it to toast toasted bread)

I am new to cast iron skillet. I have cooked with it several times and found the Lodge 12" cast iron skillet has a convex surface which is not observable unless you pour oil on it.  When I cook, the oil move to rim of the skillet and makes the center short of oil. Is it normal?  EDIT: I added the photo of the stove and skillet for reference


A beginner's question: Why does friction vanish at the top and bottom of loops? If friction works in the opposite direction of motion, then surely there must be some element of friction that is in the same direction as the normal force at the top of the loop? Or does friction have to always lie on the plane on which the motion occurs? Edit in attempt to improve the question: Given a motorcycle travelling in a looping, then when it's at the right-most point of the looping there are three forces acting upon it - its weight due to gravity, which points downwards, friction, which is exactly opposite in direction and equal in magnitude to its weight, and centripetal force, which coincides exactly with the normal force. My understanding is that, as the motorcycle moves from the right-most point to the very top of the looping, the friction gradually decreases (because the part of the weight vector it needs to compensate gets smaller) until, at the very top, there is only the centripetal force acting on it, which is now the sum of the normal force and its weight. What happens with the friction at this point?

For context, please consider the following problem from an older AP Physics C: Mechanics practice exam:  Since the ball is rolling without slipping, there is static friction between it and the ground such that torque is exterted on it, making it rotate. If I understood correctly, the frictional force f, in this scenario, opposes the movement of the object, and it is zero if it stops rolling and starts slipping, or ceases contact with the surface. Therefore, at point A on the loop f would point downward, and in point B, since it is still rolling, it would point to the right like so:   However, the CollegeBoard answer sheet shows otherwise. It indicates that at point A f points upwards and at point B it does not act on the ball at all:   Does friction still act on the ball at point B? Is the friction on a rotating body opposite to its movement? If so, did CollegeBoard perhaps get the answer sheet wrong?


I installed Arch recently (as in, yesterday). I was able to successfully install Grub in the EFI system Partition with grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub --recheck, os-prober and grub-mkconfig -o /boot/grub/grub.cfg. After booting, though, I had two issues: First, I wanted grub to boot linux and not linux-lts kernel by default and second, I wanted it to select Windows by default and a timeout of 1s. In the /boot/grub/grub.cfg file, I replaced three instances of linux-lts with linux in the first menuentry. In the /etc/default/grub file, I set GRUB_DEFAULT as 'Windows Boot Manager on (/dev/nvme0n1p1)' and GRUB_TIMEOUT as 1. When I ran grub-mkconfig -o /boot/grub/grub.cfg, it did not list Windows 10. Even when I ran os-prober, no results were shown. On rebooting, Windows entry was not shown but timeout was 1s. So, what should I do? Thank you!

I'm trying to do a dual boot in Arch, I install Arch how is recommended in the official guide but when I run os-prober don't find Ubuntu. The partition where is EFI "Ubuntu" is the same partition for EFI "Arch".      But os-prober in Ubuntu works and Find Arch without problems.


the other day i was driving from work (on west side highway in nyc) and the weather was stunning! red skies with orange sun with few sparse clouds!   i really really wished i had my big camera, and planned a good location, because that was the day to take a great photo.     any way to have predicted this? seems like a few-times-a-year occurrence.

I have a spot that I like to take sunset pictures. I find that the most spectacular moments last for only maybe 5-10 minutes. What I would like to do is know about a half hour before that a sunset is going to be spectacular, so I can grab my camera, tripod, walk 5-10 minutes to my sunset spot, set up, and have a few minutes to spare in case something happens. However, I've often missed really cool sunsets, because I just don't know when to photograph them. How can you tell beforehand when a sunset is going to be spectacular? Thanks!


I'm trying to merge the three chapters of my PhD thesis using \subfile, and I want the .bib files to be added at the end of each chapter. I'm trying with only one .bib file first and it doesn't work, ie. the output doesn't take into account my input style=numeric and doesn't print any bibliography (it just prints \biblio_chap1 at the end of the document !).  \documentclass[a4paper]{book} \usepackage[utf8]{inputenc} \usepackage{subfiles} \usepackage[backend=biber,style=numeric]{biblatex} \addbibresource{/biblio_chap1.bib}  \title{PhD thesis} \author{Anaïs} \date{}  \begin{document}  \chapter*{Acknowledgements}\subfile{Acknowledgements}  \chapter*{Introduction}\subfile{Intro}  \chapter{Paper 1}\subfile{chapter_1} \printbibliography{/biblio_chap1}  \end{document}   And here is a minimal code for the chapter_1:  \documentclass{subfiles} \begin{document} \section{Introduction} (CCRIF, 2017)\cite{ccrif} GDP\footnotemark{GDP 2016} \end{document}   and for the .bib file  @techreport{ccrif,  title = {CCRIF SPC Annual Report 2016-2017},  author = {},  group = {Caribbean Catastrophe Risk Insurance Facility},  year = {2017},  institution = {CCRIF SPC},  address = {},  month = {} }   I have changed the execution mode accordingly from bibtex.exe to biber.exe and I compile using PDFTeXify. The bibliography works fine in a separate article, with the \bibliography command.

Running the minimal example  \documentclass{article} \usepackage{filecontents} \begin{filecontents*}{\jobname.bib} @ARTICLE{example,   author  = {Other, Anthony Norman},   title   = {Some things I did},   year    = {2014},   journal = {J.~Irrep. Res.},   volume  = {1},   number  = {1},   pages   = {1-10} } \end{filecontents*} \usepackage[backend=biber]{biblatex} \addbibresource{\jobname.bib} \begin{document} Hello\cite{example}. \printbibliography \end{document}   I get the warning There were undefined references.  I have read  and know that I need to run:   LaTeX Biber LaTeX   However, my editor is only set up to run BibTeX. How do I go about setting up my editor/IDE to be able to run Biber, and how do I run the LaTeX/Biber/LaTeX cycle?  Answers (sorted alphabetically by editor name)                    Answer guidelines   Each answer should be for one editor. If the editor is cross-platform, if possible give a single answer with notes covering the minor platform variations. Please edit the question to include new answers in the 'link list' Each answer should be 'stand alone', i.e. don't say 'It's almost the same as editor Y but ...' for the editor part Instructions for 'build tools' such as arara or latexmk are welcome but should explain how to set up the editor in question as not all editors allow simple addition of arbitrary tools


My question is what happened to       Remus Lupin and his wife Tonks?   Who killed them?  I watched the movies and also read the books but I didn't understand that part.

I have always wondered this, and as today is the anniversary of the battle of Hogwarts, I think I will ask this:      Who killed Tonks and Lupin in the battle of Hogwarts?


I don't know how I may be got attacked with malware, but my laptop is slowed down to hell. I checked the Task Manager, there I found that a command line "C:/Windows/system32/taskkiller.exe" is taking up all my memory. It pops up one after another after another, my PC is so slow that I can't even take the offline version of Antivirus (Bitdefender, Avira) from my Android to PC.   I tried switching off Windows Defender for good, no results. I know, all I need is to get the Antivirus in my Laptop. I even tried to kill "taskkiller.exe" by deleting from Command Prompt (Admin) by trying "del taskkiller.exe". It said,"Access Denied".   I have Windows 10,

What should I do if my Windows computer seems to be infected with a virus or malware?  What are the symptoms of an infection? What should I do after noticing an infection? What can I do to get rid of it? how to prevent from infection by malware?   This question comes up frequently, and the suggested solutions are usually the same. This community wiki is an attempt to serve as the definitive, most comprehensive answer possible. Feel free to add your contributions via edits.


I am getting this above error when the json response values are null  { "restaurant_area_min_order":null, "restaurant_id":null }.   The above error is appearing inside try catch block. When there is values inside restaurant_area_min_order and restaurant_id, The function is working fine without error. How can I check if the response data are null and continue the function without any error?  Here is my code.   private void getAreaMinOrders() {     for(int i = 0; i < Utils.cart_restaurants.size(); i++)     {         RestaurantModel restaurant = Utils.cart_restaurants.get(i);         String restaurant_id = restaurant.getId();          String url = LinksConstants.BASE_URL + LinksConstants.CHECK_MINIMUM_ORDER;          RequestParams params = new RequestParams();         params.put("restaurant_id", restaurant_id);         params.put("area_id", city_id);          NetworkRestClient.post(url, params, new JsonHttpResponseHandler()         {             @Override             public void onStart()             {                 super.onStart();                 progressActivity.showLoading();             }              @Override             public void onSuccess(int statusCode, Header[] headers, JSONObject response)             {                 super.onSuccess(statusCode, headers, response);                 try                 {                     if (response != null)                     {                         String restaurant_id = response.getString("restaurant_id");                          String rest_area_min_order = null;                          if(rest_area_min_order != null)                         {                             rest_area_min_order = response.getString("restaurant_area_min_order");                         }                         HashMap<String, Object> items_hash = (HashMap<String, Object>) rest_cart_hash.get(restaurant_id);                         items_hash.put("rest_area_min_order", rest_area_min_order);                     }                     progressActivity.showContent();                 }                 catch (Exception ex)                 {                     GSLogger.e(ex);                     showError();                 }             }               @Override             public void onFailure(int statusCode, Header[] headers, String errorResponse, Throwable throwable)             {                 super.onFailure(statusCode, headers, errorResponse, throwable);                 showError();                 if (AppConstants.DEBUG_MODE)                     showToast(errorResponse);             }           }); //end of NetworkRestClient.post     } //end of for }

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?


Is it possible to give an estimation (maybe an approximation) of the size of the $k$-th prime number?

In  I have found that the bounds for $n$-th prime is given by, $$n(\ln n+\ln \ln n)>p_n>n(\ln n+\ln \ln n-1)$$ for all $n\ge6$. Are there even stronger bounds for the $n$-th prime?   If possible (of course if the answer is affirmative) in the answer (or comment) please give the link of the paper in which it first appears.


I am a Stack Overflow user.  I just wanted to know if any change in my reputation here will cause a change in my reputation in Stack Overflow?  Also, I just wanted to know since I am new to this site, is this site used to ask questions related to using Stackoverflow.com?

On Stack Exchange, users may gain a certain level of reputation.  What does reputation do? How can a user gain or lose reputation?   See also   in the Help Center  - Maximum amount of votes a user can use in a day and reputation requirements to vote.  - How to get an exact overview of the actions that got you your reputation.  - A full list of all privileges granted at each reputation level on all sites.


I know that if a the knot group of a classical knot is isomorphic to the infinite cyclic group, then the knot is unknotted. How about the link, is this result also valid for links. In other words, if the knot group of a link is $\mathbb{Z}^n$, then does this imply that the link is unknotted, where n is the number of components?

It is known that the unknot is the only knot whose complement has fundamental group $\mathbb{Z}$.  Does this fact generalize to links?  That is, suppose that $\ell= \ell_1 \cup \dots \cup \ell_n$ is an $n$-component link in $\mathbb{R}^3$ such that $\pi_1(\mathbb{R}^3-\ell)$ is a free group on $n$-generators. Is $\ell$ the unlink on $n$-components?


I have only one partition right now. I want to make two partitions. But I am unable to do so. I am using GParted for this. Here is the screenshot of gparted.    When I click on resize. The minimum amount is always 0.

Previously, I have installed Windows 7 on my 320 GB laptop with three partitions 173, 84 and 63 GB each. The 63 GB partition was where the Windows was installed. The rest were for file containers.  Now I changed my OS to Ubuntu 12.04 LTS. I installed Ubuntu by replacing the entire Windows 7 on the 63 GB partition. The rest of the partitions remain as an NTFS Windows partition and I can still access them both (the 173 and 84 GB partitions).  Now I want to change the two partitions of Windows into an Ubuntu format partitions plus most importantly, I want to extend the 63 GB partition to more than a 100 GB because at the moment I am running out of disk space. Whenever I try to install any application, especially using wine, it always complains for a shortage of disk space.  How do I do the extending activity before I entirely format my laptop again and lose all the important files on my partitions?


I have a dataset with disease frequency in age groups.  <1   <3   <5   <7   >=7  14   19   15    3    10    And now, when actual data lost, I've been asked to assess the mean age. The problem that I don't know the midpoint for last interval ">=7".  How should I do it? Can I model the distribution of age and get the mean using formula?  I've splitted groups to be width of 1 age, from 0 to 7, and it seems that age have exponential distribution (like it should be in theory). But how to assess distr. parameters? I've assessed the median from groupped data using the formula : $$Me = L_m + (\frac{n/2 -F_{m-1}}{f_m}) \cdot c = 2.737$$  After that I've calculated $\lambda$ using it like this: $\lambda = ln(2)/Me = 0.253$. Assessing $\lambda$ visually I've got pretty same value $0.23$. Here is the plot.    For me this distributions look almost equal except point 0, but which should I choose and why? Is it ok to use median to assess $\lambda$?  If so, is the next argument true? I can get the estimate for upper bound of the last interval using 0.975 quantile. Use it to get the midpoint. And now calculate the mean using midpoints. How much it should be different? Doesn't midpoints introduce bias because data distributed exponentially? Using distributions I've got: $4.348$ (for 1st), $3.949$ (2nd) And using midpoints: $3.902$, $3.784$  Thanks for any help or correction.

I understand the Max likelihood estimators for mu and sigma for the lognormal distribution when data are actual values.  However I need to understand how these formulas are modified when data are already grouped or binned (and actual values are not available).  Specifically, for mu, the mle estimator is the sum of the logs of each X (divided by n which is the number of points).  For sigma squared, the mle estimator is the sum of (each log X minus the mu, squared); all divided by n. (Order of operations is taking each log X minus the mu; square that; sum that over all X's; then divide by n). Now suppose data in bins b1, b2, b3, and so on where b1 to b2 is the first bin; b2 to b3 second bin and so on.  What are the modified mu and sigma squared? thank you.


I need to pull in the first X characters/bytes/whatever of a large remote XML file.  The code below successfully pulls down the file in chunks but I can't figure out how to cut it off after a certain size/amount of data.      uri = "https://domain.com/file.xml"      Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|         request = Net::HTTP::Get.new uri         http.set_debug_output $stderr          http.request request do |response|           StringIO.open do |str|             response.read_body do |chunk|                 str.puts chunk             end           end         end     end   I've tried something like the below, but that creates a string with the contents of the first chunk repeated over and over.  response.read_body do |chunk|     while str.size < 50000      str.puts chunk     end   end   I've also tried:  response.read_body do |chunk|    if str.size > 50000        puts "BIG ENOUGH!"       break    end end   This also results in the result str to be the contents of the first chunk repeated over and over until it reaches the specified size limit.

It seems like the methods of Ruby's Net::HTTP are all or nothing when it comes to reading the body of a web page. How can I read, say, the just the first 100 bytes of the body?   I am trying to read from a content server that returns a short error message in the body of the response if the file requested isn't available. I need to read enough of the body to determine whether the file is there. The files are huge, so I don't want to get the whole body just to check if the file is available.


Is it ok to say:  Then, I started watching an episode of...  or should I say  Then, I started to watch an episode of...  Which one is correct or are both correct? Can you explain me what's the difference between these two sentences? I would really appreciate your help, thank you so much.

Which one is correct and more common? is there better way?        Let’s start speaking English.   Let’s start to speak English.


The command dpkg -l is used to list all installed packages in the system.  But if you look to the output such as below:  ii  whoopsie       0.1.34         Ubuntu crash database submission daemon rc  wicd-daemon    1.7.2.3-1ubunt wired and wireless network manager - daemon rc  wicd-gtk       1.7.2.3-1ubunt wired and wireless network manager - GTK+ cl ii  winbind        2:3.6.3-2ubunt Samba nameservice integration server ii  wine           1:1.7.18-0ubun Microsoft Windows Compatibility Layer (meta- ii  wine-gecko2.21 2.21-0ubuntu1~ Microsoft Windows compatibility layer (embed ii  wine-gecko2.21 2.21-0ubuntu1~ Microsoft Windows compatibility layer (embed ii  wine-mono0.0.8 0.0.8-0ubuntu1 Microsoft Windows compatibility layer (.NET  rc  wine1.4        1.4.1-0ubuntu1 Microsoft Windows Compatibility Layer (Binar rc  wine1.4-amd64  1.4.1-0ubuntu1 Microsoft Windows Compatibility Layer (64-bi rc  wine1.4-i386:i 1.4.1-0ubuntu1 Microsoft Windows Compatibility Layer (32-bi ii  wine1.6        1:1.6.1-0ubunt Microsoft Windows Compatibility Layer (Binar   you can see the first element is either ii or rc.  So my question what is the meaning of  ii and rc?

I frequently need to check which packages are installed, and I use the following command:  dpkg -l | grep foo  which gives the following output  Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name                       Version         Description ii   foo                       <version>         <description>    What does the ii mean?  What other flags are there? How to read the flags? (because the explanation is quite complicated, IMO)   Thanks.


I'm using RedHat version 7.  My AWS instances are in a security group with ample permissions for inbound connectivity.  I can do Yum updates.  The servers can ping each other.  I can transfer files from my workstation to the servers.  I even temporarily allowed all traffic from any IP address.  This didn't seem to help me.  I understand that RedHat v7 doesn't use IP tables by default.  RedHat v.7 uses firewalld or something similar.  I tried shutting off the firewall.    I used this command to configure the firewall: system-config-firewall-tui I unchecked the "Enabled" option for the firewall and saved changes.  I ran these commands:   systemctl stop iptables   systemctl stop firewalld   systemctl disable firewalld  I have root permissions.  The nmap utility indicates that almost every port is blocked.  I tried the nmap utility against specific ports and multiple ports from one Linux server to itself and a second Linux server on the network to the original Linux server.  I would get something like this:  Host is up (0.00042s latency). PORT     STATE  SERVICE VERSION 6379/tcp closed unknown  I double checked the nmap results with a bash script with these lines:  exec 6<>/dev/tcp/127.0.0.1/6379 || echo "Not listening on port 6379" exec 6>&- # close output connection exec 6<&- # close input connection  The above bash script indicated that the port was closed. (The script was from this link: )  I enabled the iptables just to see if a firewall needed to be running.  I ran this to try to open port 6379:  iptables -A INPUT -p tcp --dport 6379 -j ACCEPT  The above command has no response.  I just go to another prompt.  What can I do to open port 6379?  It seems like only port 22 is open.

This is a  about Connection Refused    We see a lot of questions to the effect      When I try to connect to a system I get a message      Connection refused      Why is this ?


on Ubuntu 14.04 has python-3, python-2.7 and python is linked to python-2.7 by default. I have to run python-3 code on ubuntu -14.04. Can I modify /usr/bin/python link to python3? Any idea?  Thanks

Currently, when I type "python" at the terminal I get v2.6 which is all fine and dandy but how can I set it to use v3.1 instead?  Is there a "path" variable out there somewhere that I can change like windows?  EDIT: I already have python3 installed and up and running.  I just want to know how to set it as the shells default python version.


I've been sitting on this practice question for a while but haven't been able to make any progress. Thanks in advance for any help.  Below is an $n \times m$ matrix over $\mathbb{R}$:  $$A= \begin{bmatrix}a_{1,1}& \dots &a_{1,n}\\  \vdots & \ddots & \vdots \\  a_{m,1}&...&a_{m,n}\end{bmatrix} \text{with} \ a_{i,j} = i + j  \ \text{for all} \ i \in {1,..m}, \  j\in{1,...n}.$$  Determine the row and column rank of the matrix $A$ for any $n,m > 0$.  How do I go about this question? I know the rank of a matrix is the number of linearly independent rows or columns, but I don't really know how to apply that to this matrix.  P.S: please excuse my poor formatting.

Let $A$ be a $n\times n$ matrix with entries $a_{ij}=i+j $ . Calculate rank of $A$.  My work : I noticed that A is symmetric . Hence all of its eigen vectors are real .. That is all i have got .   Your help will be highly appreciated .Thank you .


Let us have a hyperbola $\frac{x^2}{a^2} - \frac{y^2}{b^2} = 1$ and assume the normal at P meets the transverse (horizontal) axis $AA'$ in $G$ and the conjugate (vertical) axis $BB'$ in $g$. Assume CF be perpendicular to the normal from the center.   Find $\frac{PF \cdot PG}{CB^2}$ Find $PF \cdot Pg$   How can I solve the question in least amount of steps?  My attempt:  I first formed the equation of the normal and then I found out the points where it cuts the conjugate and transverse axis. After finding these points I used distance formula to find the distance required and convert it in the form that the question asked. But its a long method and took lot of steps

If the normal at P to the hyperbola $\frac {x^2}{a^2}-\frac {y^2}{b^2}=1$ meets the transverse axis in G and the conjugate axis in G' and CF be the perpendicular to the normal from the center C then show that $$PF.PG=b^2\space and \space PF.PG'=a^2.$$ We know that the equation of the normal at parametric point $P\equiv(a\sec\theta,b\tan\theta)$ is given by  $$a\,x\cos\theta+b\,y\cot\theta=a^2+b^2$$   Equation of the transverse axis is $y=0$ and that of the conjugate axis is $x=0$.   Hence   $$G\equiv(\frac {a^2+b^2}{a}\sec\theta,0), \, G'\equiv(0,\frac {a^2+b^2}{b}\tan\theta)$$  C is the origin and CF is perpendicular to the normal. Hence   $$ CF\equiv b\,x\sec\theta-a\,y\tan\theta=0\implies y=\frac {b\,x\sec\theta}{a \tan\theta}$$   Substituting this in the equation of the normal we get   $$a\,x\cos\theta+b \,\cot\theta\,\frac {b\,x\sec\theta}{a\,\tan\theta}=a^2+b^2\ $$   implies  $$ (a^2 \cos\theta \sin^2\theta+ b^2\cos\theta)x=(a^2+b^2)\sin^2\theta$$  After finding the coordinates of F, the calculation becomes very complicated. So is there an easier way to approach the problem? I would love to see a pure geometric solution to this problem.


I have a favorite jambalya recipe. I usually saute the trinity (celery, onions, green peppers) for a short while before adding garlic and then a longer while later I will add my Cajun seasoning. For some reason the other day I did it differently and added my Cajon seasoning to the oil before adding the trinity and garlic (like I do when making Thai curry - adding the curry paste to the oil to start the cooking). I was surprised to find my final dish at the end was far less spicy (less hot) and there was less of the flavor from the Cajon seasoning. That surprised me. Slightly less spicy would make sense but this was WAY less spicy. I used the normal quantity of all ingredients so that wasn't the cause of the difference. EDIT: DIshes made 3 days apart with spices that have been stored the same length of time (months+). What is going on?

My favorite chicken-and-mushroom soup recipe incorporates hot peppers and, on upon immediate serving has a lovely kick. However the reheated leftovers are entirely bland, almost as if the "hot" from the peppers dissolves away into the soup.  I've tried using more peppers and hotter varietals, but still can't get the leftovers to have any appreciable level of spiciness.  This is the general recipe that I'm following:   Poach chicken breasts in 6 cups water along with spices and garlic. Remove chicken, strain stock, discard solids. Add chopped mushrooms (hen-of-the-woods or shiitake), chile pepper, chopped ginger, tbsp vinegar, tbsp soy sauce, and simmer. After ~10 minutes, add back chopped up chicken breasts and simmer until meat is warmed through.   The original recipe called for 1 Fresno chile, thinly sliced. I've tried up to 6 Fresno chiles, but also, in separate tries, 6 serrano peppers and 6 habanero peppers. (My local supermarket doesn't carry anything hotter than habaneros.) When I slice the peppers, I retain the seeds and pith.  In all attempts, the broth itself doesn't become spicy, but on the first day the sliced peppers provide an ample "kick" and act like little pockets of spiciness. Regardless of the pepper type or quantity, the peppers in the leftover soup lose their kick, and the broth remains un-spicy.  My first instinct here is to remove the peppers from the broth and use them as a garnish; the fact that they're cooked with the broth however makes me think that the original recipe authors intended for the broth to take on some of the spiciness from the peppers.  Questions:   Why do the peppers lose their spiciness in the leftovers? What are some possibly ways to adjust this recipe to make the broth take on the spiciness of the peppers?1     1 I ask this so that I can try and do what the original recipe author intended by cooking the peppers with the broth: making the broth spicy. If I can manage that, then I can service the hot peppers as a garnish and then not worry about them losing their kick overnight.