So, in my app, I am retrieving JSON data and parsing it. RIght now, it is displaying every record on a textView like this  Name: Eric Email: Eric.com  Name: Greg Email: Greg@Greg.com  .................. etc  Code:    //parse json data  try {    String s = "";    JSONArray jArray = new JSONArray(result);     for(int i=0; i<jArray.length();i++){        JSONObject json = jArray.getJSONObject(i);         s = s +                 "Name : "+json.getString("Name")+"\n"+                "Email : "+json.getString("Email")+"\n\n";    }     resultView.setText(s);   I want to be able to search and display only a single record, e.g. Eric's record. How could I do this? I tried this adding if (json.getString("Name") == "Eric") { } like this:  //parse json data  try {    String s = "";    JSONArray jArray = new JSONArray(result);     for(int i=0; i<jArray.length();i++){        JSONObject json = jArray.getJSONObject(i);            if (json.getString("Name") == "Eric) { //added if statement        s = s +                 "Name : "+json.getString("Name")+"\n"+                "Email : "+json.getString("Email")+"\n\n";                }    }     resultView.setText(s);   but it doesn't display anything, then. Any ideas on how I can search for a single person's record in JSON? Thanks!

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


What is the best recommended book on Bayesian Non parametric approaches ? Specifically something which also tackles regression problems such as Gaussian processes.

Having studied parametric Bayesian statistics during the two last years, I plan to begin to self-study non parametric Bayesian model during this summer and look for recommendations. I would like the book(s) to cover both the theoritical aspects and the practical ones (with implementation, examples of models ...) Thanks for your recommendations.


I am trying to use the  to create a fake player counter on the client server list, but it keeps throwing NullPointerExceptions  Here's my code  package mpolder;  import org.bukkit.plugin.java.JavaPlugin; import skionz.pingapi.PingAPI; import skionz.pingapi.PingEvent; import skionz.pingapi.PingListener;   public class fakePlayer         extends JavaPlugin         implements PingListener {      @Override     public void onEnable() {         PingAPI.registerListener(new PingListener() {             public void onPing(PingEvent event) {                 event.getReply().setOnlinePlayers(5000);             }         });      }       @Override     public void onPing(PingEvent event) {         event.getReply().setOnlinePlayers(5000);     } }   And here's the stacktrace  java.lang.NullPointerException     at skionz.pingapi.PingAPI.registerListener(PingAPI.java:26) ~[?:?]     at mpolder.fakePlayer.onEnable(fakePlayer.java:19) ~[?:?]     at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:316) ~[spigot_server.jar:git-Spigot-1544]     at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:329) [spigot_server.jar:git-Spigot-1544]     at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405) [spigot_server.jar:git-Spigot-1544]     at org.bukkit.craftbukkit.v1_7_R4.CraftServer.loadPlugin(CraftServer.java:476) [spigot_server.jar:git-Spigot-1544]     at org.bukkit.craftbukkit.v1_7_R4.CraftServer.enablePlugins(CraftServer.java:394) [spigot_server.jar:git-Spigot-1544]     at org.bukkit.craftbukkit.v1_7_R4.CraftServer.reload(CraftServer.java:866) [spigot_server.jar:git-Spigot-1544]     at org.bukkit.Bukkit.reload(Bukkit.java:301) [spigot_server.jar:git-Spigot-1544]     at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:23) [spigot_server.jar:git-Spigot-1544]     at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:181) [spigot_server.jar:git-Spigot-1544]     at org.bukkit.craftbukkit.v1_7_R4.CraftServer.dispatchCommand(CraftServer.java:767) [spigot_server.jar:git-Spigot-1544]     at org.bukkit.craftbukkit.v1_7_R4.CraftServer.dispatchServerCommand(CraftServer.java:753) [spigot_server.jar:git-Spigot-1544]     at net.minecraft.server.v1_7_R4.DedicatedServer.aB(DedicatedServer.java:326) [spigot_server.jar:git-Spigot-1544]     at net.minecraft.server.v1_7_R4.DedicatedServer.v(DedicatedServer.java:290) [spigot_server.jar:git-Spigot-1544]     at net.minecraft.server.v1_7_R4.MinecraftServer.u(MinecraftServer.java:584) [spigot_server.jar:git-Spigot-1544]     at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java:490) [spigot_server.jar:git-Spigot-1544]     at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:628) [spigot_server.jar:git-Spigot-1544]

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


I am currently studying Prescott's Microbiology, 10th edition, by Willey, Sherwood, and Woolverton. Chapter 1.2 Microbes Have Evolved and Diversified for Billions of Years presents the following figure:        The authors then ask the question: Why are the probionts pictures above not considered cellular life?  I'm unsure of why the probionts are not considered to be cellular life. If I'm not mistaken, the probionts contained ribozymes, no? This means that they have the capacity to catalyse their own reproduction. And, according to the figure, later probionts also consisted of proteins, so I'm presuming that catalysis and reproduction were not issues here.   I would greatly appreciate it if people would please take the time to clarify this.

The recent  about a new supermassive virus being discovered got me thinking about how we define viruses as non-living organisms whilst they are bigger than bacteria, and much more complex than we first gave them credit for.   What biological differences between viruses and cellular organisms have made viruses be deemed non-living?


Here's my scenario: about a year ago, I remember bookmarking a question that I would want to return to if I ever formatted my hard drive. That day came, but it took me a lot of time to find the bookmark because I had to click on every community, look at my profile, look at my bookmarks, and see if what I was looking for was mentioned there. Is there a way I can see all my bookmarks at once, regardless of which community they are on? It would save me a lot of time in situations like this.

I have been favouring questions using my phone for a few weeks thinking that I would look at them later, but I don't think there is any way I can see questions that I  favourite. Or is there?   If it is not possible, then what is the point of marking a question as a favourite?  If you can see them, than how? I am using my android phone.


I am currently running Ubuntu 14.04 as my main OS, with a Windows 7 installation inside VirtualBox for things I just can't easily do on Ubuntu (like running Microsoft Office). Now I am wondering if there are ways to send commands from your host to your virtual machine to, for example, launch Microsoft Word.  Does someone know if this is even possible? If it is, I could use it to integrate the Virtual Machine more closely in Ubuntu by making some pretty desktop shortcuts to office for example!

I'd like a write a shell script in Ubuntu that does the following:   Boot up a Windows 7 guest OS in Virtualbox, if it isn't running already. Run a shell script in Windows, where the shell script is invoked from the Ubuntu host operating system.   My goal is to create an application launcher on the Ubuntu host desktop for an application on the guest OS. For example, I could create a shortcut for Visual Studio on the Ubuntu desktop that launches Visual Studio in Windows. I've always wanted to be able to launch Windows applications directly from the Ubuntu desktop instead of waiting for Windows to start up before clicking an application shortcut.


Out of rage, I quit vim by using :wq!!!. This created a file named !!.  Given that !! references the previous command, attempting to interact with it yields interesting results.  I tried rm ./!! and rm -- !!. Both would pull in the previous command (as it should).  An easy solution is to simply start a shell that doesn't treat !! like anything special, but that's too easy.  How can I properly interact with the file in bash?

Today, I was caught redhanded while attempting to code golf a password generator for Twitter.  import string as s,random;print ''.join(random.sample(s.letters+s.digits+s.punctuation,9))   90 chars. Since that is a lot of spare space, I decided to raise the bar and make it executable too.  echo -e "#!/usr/bin/python\nimport string as s,random;print ''.join(random.sample(s.letters+s.digits+s.punctuation,9))">pg;chmod +x pg;./pg   139 chars. Nice, except obviously bash chokes on the exclamation point.  badp@delta:~$ echo -e "#!/usr/bin/python\nimport string as s,random;print ''.join(random.sample(s.letters+s.digits+s.punctuation,9))">pg;chmod +x pg;./pg bash: !/usr/bin/python\nimport: event not found   Pesky exclamation point. "Let's escape it," I thought! I do have one spare character after all.  echo -e "#\!/usr/bin/python\nimport string as s,random;print ''.join(random.sample(s.letters+s.digits+s.punctuation,9))">pg;chmod +x pg;./pg   Obviously...  badp@delta:~$ echo -e "#\!/usr/bin/python\nimport string as s,random;print ''.join(random.sample(s.letters+s.digits+s.punctuation,9))">pg;chmod +x pg;./pg ./pg: line 2: syntax error near unexpected token `(' ./pg: line 2: `import string as s,random;print ''.join(random.sample(s.letters+s.digits+s.punctuation,9))' badp@delta:~$ cat pg #\!/usr/bin/python import string as s,random;print ''.join(random.sample(s.letters+s.digits+s.punctuation,9))   Leaving my asinine code golfing aside -- I can't explain this.  With \!, the exclamation point was escaped, except it really wasn't, because the \! was left as-is for echo to pick up.  One solution could have been using \x21 instead, but I'm not convinced that's the proper way of escaping an exclamation point in a bash command.  tl;dr: How do you properly escape an exclamation point in a bash command?


c# Timer (System.Timers.Timer) is used to periodically trigger an event within windows form application. I would like to call function (for example logger() function) within the even handler. logger() is not a static method.  The function assigned to ElapsedEventHandler is a static function and therefore cannot call non-static methods. Code example:  public partial class MainForm : Form {     //...     private MyClass myClass;     //... }   private void SomeButton_Click(object sender, EventArgs e) {     //...     System.Timers.Timer t = new System.Timers.Timer(5000);      t.Elapsed += new ElapsedEventHandler(OnTimerElapsed);     t.Enabled = true;     //... }  static void OnTimerElapsed(object sender, ElapsedEventArgs e) {     //...     // here call myClass.doSomething();     //... }   How would be the correct way to go about this task? I do know that static variables/methods are not possible to be used within the OnTimerElapsed() - that is clear. I mainly ask to check whether there is another way of calling OnTimerElapsed(), maybe a non-static method or another timer type or handler method? Or if there is a way to pass the instance of myClass to the OnTimerElapsed()   Edit: it would be preferable to keep the myClass non-static, that is why this question.

Consider:  namespace WindowsApplication1 {     public partial class Form1 : Form     {         public Form1()         {             InitializeComponent();         }          private void button1_Click(object sender, EventArgs e)         {             //int[] val = { 0, 0};             int val;             if (textBox1.Text == "")             {                 MessageBox.Show("Input any no");             }             else             {                 val = Convert.ToInt32(textBox1.Text);                 Thread ot1 = new Thread(new ParameterizedThreadStart(SumData));                 ot1.Start(val);             }         }          private static void ReadData(object state)         {             System.Windows.Forms.Application.Run();         }          void setTextboxText(int result)         {             if (this.InvokeRequired)             {                 this.Invoke(new IntDelegate(SetTextboxTextSafe), new object[] { result });             }             else             {                 SetTextboxTextSafe(result);             }         }          void SetTextboxTextSafe(int result)         {             label1.Text = result.ToString();         }          private static void SumData(object state)         {             int result;             //int[] icount = (int[])state;             int icount = (int)state;              for (int i = icount; i > 0; i--)             {                 result += i;                 System.Threading.Thread.Sleep(1000);             }             setTextboxText(result);         }          delegate void IntDelegate(int result);          private void button2_Click(object sender, EventArgs e)         {             Application.Exit();         }     } }   Why is this error occurring?     An object reference is required for the nonstatic field, method, or property 'WindowsApplication1.Form1.setTextboxText(int)


I have a PDF file which was saved from Photoshop, that I need to edit. File size is 30 MB.  It opens in Photoshop directly, without an Import prompt window, so it was probably saved from Photoshop originally.  Then, after all the edits, I merge visible layers, so that the file would have roughly the same amount of information as before.  After it was saved, file size increased to 150MB, 5 times the original size.   Why? I haven't used "Save As" command so shouldn't it be saved with original settings and have roughly same size?  To add: I compared the initial file and the edited file dimensions in mm, DPI and pixel dimensions, with Pitstop Inspect tool - they are the EXACT same! The only thing which was changed is "Compressed file size" went from 19% to 37% of original size - what's up with that? What compression level does Photoshop use on regular "Save" command, how do I see/change it?

Why is it that when I save a file that has many, many layers to a PDF without layers as a copy that the file size is larger than flattening the layers and then saving the file as a copy to PDF? 19Mb vs. 5Mb?? Wouldn't saving a file without layers be the same as flattening the layers and then saving the file?? Can anyone explain this?


I have problems with apt-get update once in a while. This error is shown sometimes I try to run this command:  sudo apt-get update E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable) E: Unable to lock directory /var/lib/apt/lists/ E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?   What's going on? I'd like to know the problem and solve it. It's solved once I restart my pc though, but I would like to know what is this error. Thanks.

I get this error when trying to use apt-get:  E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/) is another process using it?     How can I fix this?


Let's say I have a 14.8V battery with capacity of 5200mAh. My load constantly draws 20 amps from it. I want to estimate the time it takes until the cell reaches let's say 10V. This is just an example, I dont't have this configuration. How would you calculate this time, to reach from one voltage level to an other?

I would like to know how to calculate battery life when using an LED strip. The LED strip is powered by 8 AA batteries in series. LED Current Draw = 260 mA. LED power consumption: 3.1 W. LED Operating Voltage range: 9-14.8 VDC. Please see attached images for battery datasheet.  This is my calculation, but I'm not sure if it's correct:     Battery Life = (Battery Capacity)/(Load Current) = 2000 mAh /260 mA = 7.7 Hours   This is for one battery, and the lights are powered by 8 batteries, so is the total battery life = (7.7)x(8) = 61.6 hours ?


Can I continue to use an multimap iterator even after a call to multimap::erase()?  For example:  Blah::iterator iter; for ( iter = mm.begin();       iter != mm.end();       iter ++ ) {     if ( iter->second == something )     {         mm.erase( iter );     } }   Should this be expected to run correctly, or is the iterator invalidated following the call to erase?  Reference sites like  are strangely quiet on this topic of the lifespans of iterators, or the effects of constructive/destructive methods on iterators.

In the following code I loop through a map and test if an element needs to be erased.  Is it safe to erase the element and keep iterating or do I need to collect the keys in another container and do a second loop to call the erase()?  map<string, SerialdMsg::SerialFunction_t>::iterator pm_it; for (pm_it = port_map.begin(); pm_it != port_map.end(); pm_it++) {     if (pm_it->second == delete_this_id) {         port_map.erase(pm_it->first);     } }   UPDATE: Of course, I then  which I didn't think would be related but answers my question.


Thrombin time (TT) and prothrombin time (PT) are two different clinical measures of blood plasma coagulation.  Both clotting tests end with the conversion of fibrinogen to fibrin; however, the TT skips directly to this conversion by adding thrombin reagent, while PT involves the entire extrinsic pathway. Despite the fact that PT involves the same clotting steps as TT plus several others, the normal range for TT is slightly longer than the normal range for PT.   Why is the normal range for TT longer than the normal range for PT when the former skips several clotting steps? Without background information about the normal ranges, it seems much more logical for the prothrombin clotting test to take longer.

Reference range for the TT is longer than that of the PT.


Should I use would or will:   I think this solution would be ok.  I think this solution will be ok.    And if both can be used then what is the difference?

which one is correct OR what is the difference between the following sentences:  I think the duration of the meeting would be two hours. I think the duration of the meeting will be two hours.


The first thing that comes to mind is:  >>> l = list('abcdef') >>> for i in range(len(l)-1, -1, -1): ...   item = l[i] ...   print(i, item) ... 5 f 4 e 3 d 2 c 1 b 0 a   I tried using the following:  >>> l ['a', 'b', 'c', 'd', 'e', 'f'] >>> for i,ch in reversed(enumerate(l)): ...   print(i,ch) ... Traceback (most recent call last):   File "<stdin>", line 1, in <module> TypeError: 'enumerate' object is not reversible   but apparently 'enumerate' object is not reversible. I can trick it with:  >>> for i,ch in reversed(list(enumerate(l))): ...   print(i,ch) ... 5 f 4 e 3 d 2 c 1 b 0 a   but that doesn't feel right - it's a bit cumbersome. Is there a better way to do this? Maybe some "inverse_enumerate" hidden is a lib like collections or itertools?  Thanks.

So I can start from len(collection) and end in collection[0].  I also want to be able to access the loop index.


I would like to add additional space between some selected ToC entries.  I can achieve this by adding \bigskip in the title. While this produces the required output it also produces an error (associated with the hyperref package - see below).  So it seems there must be a more correct way of doing this.   What I want to achieve:   MWE:  \documentclass{book}  \usepackage[utf8]{inputenc}  \usepackage[T1]{fontenc}  \usepackage{hyperref} \begin{document} \addcontentsline{toc}{chapter}{Summary\bigskip}  \addcontentsline{toc}{chapter}{Table of contents} \tableofcontents   \addcontentsline{toc}{chapter}{List of figures} \listoffigures   \addcontentsline{toc}{chapter}{List of tables\bigskip} \listoftables   \mainmatter \chapter{Chapter 1} \section{Section} \end{document}     This produces the following error:     Token not allowed in a PDF string (PDFDocEncoding):(hyperref) removing `\@ifnextchar'      Token not allowed in a PDF string (PDFDocEncoding):(hyperref) removing `\bigskipamount'

In a table of contents that has been generated with LaTeX's \tableofcontents command, I would like to add a vertical space before a Chapter item in the table of contents. One way that I have in my notes is to use  \addtocontents{toc}{\protect\vspace{10pt}}   at a desired location in the document so that this gets processed by \tableofcontents to include an appropriate vertical space in the table of contents. I have two questions:   Is the above the correct way to get a vertical space in a table of contents? Why is it necessary to use the \protect command here?   Thank you...


Task manager view   Process explorer view    Process thread details    I have noticed over the past weeks, that my system thread in task manager is always around 10%, which wasn't the case before.  Exploring the task in Process explorer showed something to do with  ntoskrnl.exe!DbgSetDebugFilterState+0x20 but searching on google for those things didn't come up with answers.   I don't know if some OS expert can give advice on what happened here?     UPDATE I went through the linked question and was able to install the Windows SDK for analyzing the performance, but even with the logs and analysis I couldn't find a specific culprit.     Eventually I was able to resolve the issue by disabling the page file first, and then setting custom size from 9GB to 100MB - 1GB.  This seems to have eliminated the kernel pagefile manipulation that would keep going on. I hope this is the correct culprit.

I have noticed that from some time my system is freezing and its probably caused by the high CPU usage which is caused by the system process.  All applications I'm running is the Skype, TeamSpeak and Chrome so it definitely shouldnt eat that amount of CPU.  You can see the problem itself and running processes in the screenshot below:    Sometimes CPU usage is reaching 90%, but the average usage is like 40-65%.  My PC parameters:   Windows 8 (customer preview) Intel Core i3 - 2350M 8 GB RAM   I'd appreciate any help attempt! Regards.  --UPDATE--  As the user below posted a great answer, I have noticed that the process that is eating the most CPU in the system is called Arthurx.sys, simple google tells that it's a TPLink driver (an wifi adapter, I have bought like 2 weeks ago!) drivers has been installed from the Windows MSDN, but also tried to install the drivers from the attached CD, but it doesn't help. From the system start, it is using like 5% of the CPU only, but after 2-4 hours of working it is growing up and reaching 40-60% of the CPU usage.  Device name: TPLink WN722N


I am looking for a command which would color a matching string in text. I.e. I am looking for functionality similar to what grep does, but I want to see the complete text not only the matching lines  Can somebody please advise whether such tool exists, or how I could best achieve this ?

Say I have the following file:  $ cat test  test line 1 test line 2 line without the search word another line without it test line 3 with two test words test line 4   By default, grep returns each line that contains the search term:  $ grep test test  test line 1 test line 2 test line 3 with two test words test line 4   Passing the --color parameter to grep will make it highlight the portion of the line that matches the search expression, but it still only returns lines that contain the expression. Is there a way to get grep to output every line in the source file, but highlight the matches?  My current terrible hack to accomplish this (at least on files that don't have 10000+ consecutive lines with no matches) is:  $ grep -B 9999 -A 9999 test test     If grep can't accomplish this, is there another command-line tool that offers the same functionality? I've fiddled with , but it doesn't seem to have an option for it either.


Let's say I have these files in my folder:  cat.txt dog.txt house.txt tree.txt   I want to rename all of them to something like this:  file1.txt file2.txt file3.txt file4.txt   Is that possible to do via the command line?  I've only seen questions about renaming files that have some kind of pattern, like rename dog1.txt, dog2.txt -> cat1.txt, cat2.txt.

I would like to rename all files in a folder so to have consecutive numbers. For instance:  1.png 2.png 3.png etc   I know there is the rename command and I know there are DOZENS of similar questions in here but I can't find the way.  NOTE: Suggested duplicate doesn't contain a solution specific for my case. Please stop flagging this as duplicate, because suggested duplicate does not answer my question


Prove the following statement by mathematical induction: For all integer $n \ge 2$, $$\sqrt n < \frac{1}{\sqrt 1} + \frac{1}{\sqrt 2}+\frac{1}{\sqrt 3}+\cdots+\frac{1}{\sqrt n}$$  My attempt: Let the given statement be $p(n)$ .  1.\begin{align*} \frac{1}{\sqrt 1} + \frac{1}{\sqrt 2} & =\frac{\sqrt 2 +1}{\sqrt 2} \\  2 &< \sqrt 2 +1 \\ \sqrt 2 &< \frac{\sqrt 2 +1}{\sqrt 2}=\frac{1}{\sqrt 1} + \frac{1}{\sqrt 2}  \end{align*}  Hence, $p(2)$ is true.  2.For an arbitrary integer $k \ge 2$, suppose $p(k)$ is true. That is, $$\sqrt k < \frac{1}{\sqrt 1} + \frac{1}{\sqrt 2}+\frac{1}{\sqrt 3}+\cdots+\frac{1}{\sqrt k}$$  Then we must show that $p(k+1)$ is true. We're going to show that $$\sqrt {k+1} < \frac{1}{\sqrt 1} + \frac{1}{\sqrt 2}+\frac{1}{\sqrt 3}+\cdots+\frac{1}{\sqrt k}+\frac{1}{\sqrt {k+1}}$$  I'm stuck on this step. I can't develop it further. How can I complete this proof?

I am just starting out learning mathematical induction and I got this homework question to prove with induction but I am not managing.  $$\sum\limits_{k=1}^{n}{\frac{1}{\sqrt{k}}\ge\sqrt{n}}$$  Perhaps someone can help me out I don't understand how to move forward from here: $$\sum\limits_{k=1}^{n+1}{\frac{1}{\sqrt{k}}+\frac{1}{\sqrt{n+1}}\ge \sqrt{n+1}}$$ proof and explanation would greatly be appreciated :) Thanks :)  EDIT sorry meant GE not = fixed :)


How to identify mac book pro product manufacturing year? And not the product release date. example is mac book pro series launched in 2012 but what is its product manufactured date?

I have an early 2011 17" Macbook Pro which is giving me issues related to SATA 6.0gbps; these issues were apparently consistent with the first machines off the line but some of the later machines have been better. I bought my first in March but fed up with the issue I went this week and bought another - alas - same issue.   How can I determine the manufacturing date of the machine?


Why is it a unicorn instead of an unicorn. Unicorn starts with a vowel and so shouldn't it be an?

On a Physics specification, it says:     6.7 Know how to use two permanent magnets to produce a uniform magnetic field pattern.   Isn't it "produce an uniform magnetic field", or is the existing "produce a uniform magnetic field pattern" correct?


I'm working on a project which needs to connect to a server over a secure socket connection and send some commands, in case one of the commands fail I get an error response on that socket and then the socket closes.  I have tried a single-threaded approach with a non-blocking ssl socket. I connect to the server and then send a few commands, do a non-blocking read for an error status, send some more commands, read again and so on. The server is an Apple Push Notification Service in case it helps.  Everything seems fine until I get an error response followed by the server closing the socket. I can read the error response and see that the socket has been closed but when I free the BIO object the application crashes (unhandled SIGPIPE). In my opinion it crashes because I may be sending data even after the socket has been closed. This is the backtrace after the SIGPIPE signal was issued:  queue = 'com.apple.main-thread', stop reason = signal SIGPIPE frame #0: 0x94cad46a libsystem_kernel.dylib`__write + 10 frame #1: 0x0007b835 APNTest`conn_write + 69 frame #2: 0x0007957d APNTest`BIO_write + 141 frame #3: 0x00100127 APNTest`ssl3_write_pending + 215 frame #4: 0x001001f9 APNTest`do_ssl3_write + 57 frame #5: 0x00101cab APNTest`ssl3_dispatch_alert + 59 frame #6: 0x000fdb80 APNTest`ssl3_shutdown + 112 frame #7: 0x00126e43 APNTest`ssl_ctrl + 83 frame #8: 0x00005653 APNTest`APNConnection::shutdown(this=0x00300fd0) + 83 at APNConnection.cpp:136 frame #9: 0x000055e5 APNTest`APNConnection::~APNConnection(this=0x00300fd0) + 21 at APNConnection.cpp:41 frame #10: 0x00005687 APNTest`APNConnection::~APNConnection(this=0x00300fd0) + 23 at APNConnection.cpp:40 frame #11: 0x000024d6 APNTest`APNService::run(this=0xbffff7a8) + 1190 at APNService.cpp:73 frame #12: 0x00006a6a APNTest`main + 1946 at main.cpp:36 frame #13: 0x94ce46d9 libdyld.dylib`start + 1   Here is the code I use to create my OpenSSL secure socket  BIO *bio; SSL_CTX *ctx; SSL *ssl;  ctx = SSL_CTX_new(SSLv23_client_method()); if (!SSL_CTX_load_verify_locations(ctx, strdup(trustStoreFile.c_str()), NULL)) {...} if (SSL_CTX_use_certificate_file(ctx, strdup(clientCertFile.c_str()), SSL_FILETYPE_PEM) <= 0) {...} if (SSL_CTX_use_PrivateKey_file(ctx, strdup(clientPKFile.c_str()), SSL_FILETYPE_PEM) <= 0) {...}  bio = BIO_new_ssl_connect(ctx); BIO_get_ssl(bio, & ssl); SSL_set_mode(ssl, SSL_MODE_AUTO_RETRY); BIO_set_nbio(bio, 1); BIO_set_conn_hostname(bio, serverURL.c_str()); int connErr = 0; do {     connErr = BIO_do_connect(bio); } while (BIO_should_retry(bio));   Reading and writing data is performed using BIO_write(bio, data, size) and BIO_read(bio, data, datasize)  Cleanup code and the one that crashes is   SSL_CTX_free(ctx); BIO_reset(bio); BIO_free_all(bio);   BIO_reset is the one that crashes right now, but if I remove it BIO_free_all will crash. What I can do to avoid the crash is send one command at a time and after each command is sent I should wait 1 second or so to see if the server sent an error for that command or not, send one more, wait again and so on. Or another thing that helped me hide the crash is installing a dummy signal handler for SIGPIPE but these are just workarounds.  I'm guessing that it may be crashing because of the data queued for sending after the socket was closed. What makes me believe this is that I see that ssl3_shutdown calls some ssl3_write_pending and also because the cleanup code will not crash if I am extra careful to not do any more BIO_write(s) after I get a non-zero SSL_shutdown().   Am I doing something wrong with the cleanup code or is there a way to instruct OpenSSL to discard any data when freeing the BIO and SSL objects?   Thank you for your help!

I have a small server program that accepts connections on a TCP or local UNIX socket, reads a simple command and (depending on the command) sends a reply. The problem is that the client may have no interest in the answer and sometimes exits early.  So writing to that socket will cause a SIGPIPE and make my server crash. What's the best practice to prevent the crash here? Is there a way to check if the other side of the line is still reading? (select() doesn't seem to work here as it always says the socket is writable). Or should I just catch the SIGPIPE with a handler and ignore it?


I'm pinging (from Europe) an IP belonging to Firebase's CDN via this command: ping 151.101.65.195  I get the following result:  PING 151.101.65.195 (151.101.65.195) 56(84) bytes of data. 64 bytes from 151.101.65.195: icmp_seq=1 ttl=57 time=6.78 ms 64 bytes from 151.101.65.195: icmp_seq=2 ttl=57 time=6.70 ms ...   6-7 ms sounds too low to me between Europe and this IP, which — according to IP geolocation websites — resides in San Francisco.  As part of another experiment, I logged into a VPS located in the east coast of US. Ping was reporting around 1 ms for the same IP.  Assuming that IP geolocation websites are right and ping results are not cached by the ISPs, the reported numbers are so low that they seem to violate the speed of light, so I must be overlooking something.  The only explanation I can think of (apart from misreading ping's output) is that maybe the IP is somehow specific and resolves to different computers depending on where the request is initiated from. This violates my assumptions about global IP addresses being unique though. Could somebody shed some light here please?  Both computers in the above experiments are running Ubuntu.

I just discovered very strange thing while testing my internet connection. My ping is smaller than it should be. For example ping time to Arizona State University is about 14ms.  eryk@eryk-pc:~$ ping www.asu.edu PING www.asu.edu.cdn.cloudflare.net (104.16.51.14) 56(84) bytes of data. 64 bytes from 104.16.51.14: icmp_seq=1 ttl=60 time=13.8 ms   I'm living in Poznań in Poland so my distance to Arizona State University in a straight line (very optimistic assumption) is about 10000 km. Considering the fact that ping time is a time for two directions (to the target and back to home). So my ping packet have to cross 20000 km distance. Speed of light is 300 000 km per second that is 300km per millisecond. So the smallest possible time to ping Arizona State University with my packet travelling at a speed of light is  20000/300=67ms   I have noticed similar results for servers located in Australia and some other States of America. Is my internet connection five times faster than light?


If a bullet was fired perfectly straight up (assuming a windless environment) such that the peak of its trajectory was just shy of orbit, would it fall back to Earth in the same spot, or would Earth’s rotation cause it to land in a different place?

If I'm standing at the equator, jump, and land 1 second later, the  Earth does NOT move 1000mph (or .28 miles per second) relative to me,  since my velocity while jumping is also 1000mph.   However, the Earth is moving in a circle (albeit a very large one),  while I, while jumping, am moving in a straight line.   How much do I move relative to my starting point because of this? I  realize it will be a miniscule amount, and not noticeable in practise,  but I'd be interested in the theoretical answer.


I recently shifted from windows to Ubuntu. I got a problem of SD Card partitioning. I run the sudo fdisk /dev/sdc1 and tried to manage it. I want only a single partition of 32 GB so that my sdcard works normally on any pc. Here is the details of current state of my sdcard. Please help me by telling the commands so that I can achieve the desired result.  It is currently having 1 sector of type extended and my sdcard is not detected on either wndows or linux

I have a blank USB flash drive I want to put a new filesystem on. If I try adding a new partition it complains "No partition table found on device /dev/sdc". Creating a msdos partition table seems to work correctly, except that when I go to add a new partition it complains with the same error. What am I missing?


I'm using Blender 2.81, when I open old Blender files such as Blender 2.80 or older the toolbar layout in the 3D Viewport are different than the default toolbar layout when starting a new project.  This is what it looks like when I open an old Blender 2.80 file    And this is what it looks like when I start a new Blender 2.81 project    And if I open projects from Blender 2.79 or older the toolbar appears on the bottom of the 3D viewport (which is even more annoying). Is it possible to reset all the layouts to the default 2.81 layout?

Is there a way to open files without changing the UI layout?  Sometimes in older files the layout will be in the old 2.4x style, which can be annoying.  One way would seem to be appending everything in, but that gets tedious with having to do it over again and again for objects, materials, textures, etc.


I don't want Google to show sub domain name (red circles in the below image) in search results. How to prevent Google from showing sub domain name as title in search result?

I've included my page title in the title tag in this format: " blah blah blah | sitename ". But for some reason it's showing up on Google search results as " sitename: blah blah blah ".  It shows up right on the actual tab itself, and even right on both Bing and Yahoo search, but different on Google search. Can't figure out why.  EDIT: Let me clarify: I really doubt that this is due to Google having not crawled my website yet. The title it previously had was very different from this (several different words), and the title that currently shows up on the search is not even remotely similar to my old one. Hence the confusion. And I've already submitted it and a sitemap to the Google webmasters tool.


I get user_point column's sum like  select sum(user_point) as user_total_point from users;   but I also want to use that sum result for new generated column like  select sum(user_point) as user_total_point, (user_total_point * 100) as hundred_times from users;   -  Error: Query 1 ERROR: Unknown column 'user_total_point' in 'field list'   How can i use user_total_point column's value for another colums?

I'm trying to create a new field based in another (sum field)  SELECT sum(price) AS old_price,    old_price+100 AS total_price FROM sales   This returns Unknown column 'old_price' in 'field list'  sum is just a example, my real issue is to use with a select inside this field  What am I doing wrong?  Thanks.  --edit I've used variables to reuse the alias, updated code:  SELECT @old_price := sum(price) AS old_price,    @old_price+100 AS total_price FROM sales   If you think that it is not a good practice, tell me.


I remember reading this story many years ago (at least ten).  A young girl (at least I think so), discovers that she has magic by throwing something. However, magic is restricted (or maybe even forbidden) and she must now hide from all magicians in her city. I think the local Thieves Guild helps her, hoping to get their own pet magician.  Other recollections:   It's low-fantasy, no elves or dragons I think there was a lot of homophobia in the setting I seem to recall that she can't control her magic and is eventually caught/taken in by the magicians.  I'm pretty sure it was a full-length novel. Possibly a novella.

I read a young adult novel around the turn of the century. This story features a young female protagonist that is very naturally gifted in magic. She is attending a  to learn mastery and control over her gifts.  A lot of her school revolves around magic dueling. The participants are taught to extend their inner aura like a second magical skin, possibly referred to as creating a shield, or . The user can increase the strength of the shield by focusing harder on it, but doing so means you have less ability to be offensive. The amount of energy needed to create a shield was half the energy a foe would need to focus at you to break it.  Ex: Mage A and B are equally matched. Mage A focuses half his power into a shield. Mage B would then need to focus 100% of his power to break A’s shield.  Another aspect I remember is that when dueling, a school master would extend a personal shield on to one of the combatants as a sort of secondary shield that goes underneath the combatants. When one mage broke the others mages personal shield, the school masters shield protects the losers life from harm, and the breaker of the shield is declared the winner.  I distinctly remember one match in which the protagonist is having a duel with another strong student. She creates a wind storm around herself that picks up the sand from the arena floor and makes her impossible to see and thus makes it hard for her opponent to focus on her shield to break it. She then lashes out at her opponent with incredibly powerful strikes with the final strike being so hard it shatters the opponents shield and then breaks the school masters shield as well and stops just shy of killing her dueling partner.  Any assistance on this one? I think my daughter would love to read it.


As I browse around pretty much anywhere in Stack Exchange, I can't help but notice that the list of "Hot Network Questions" doesn't seem to be consistent.  Not only is the order not consistent between different SE pages, the content of the list itself is not always the same. Is it meant to be randomized like this, and if so, why?

Whenever I refresh Stack Exchange sites or go to a question, the Hot Network Question list items are re-listed or re-ordered, quite dramatically it seems.  This seems like a .  It's actually a bit maddening to me to see the list change so frequently (or clearly I am refreshing too often or looking at it too much :-).  I understand the need to keep the list updated, but can the items in the list hold their positions a little more consistently?  The hot items can't be changing that fast.


Swarms can be a big problem. In both Dungeons & Dragons 3.5 and in Pathfinder they are either immune to weapon damage or take less damage than normal from many weapons (see  and , respectively). Sure, the PCs could use torches, but that's really inefficient against a swarm with lots of Hit Dice.  I am aware that wands and scrolls of spells can be used by some mundane characters, and expensive magic items can defeat swarms, but I am more interested in methods that are available to all characters—including those who can't cast spells—and in methods that don't cost a few thousand gp.  What efficient, inexpensive methods exist for mundane characters to deal with swarms?

In a session with a witch, a wizard and me, a rogue with a knife and crossbow, I found my character to be astonishingly useless against swarms. There was a swarm of Hellwasps and I quite literally just hid behind the magic users. The mages were rather absurdly effective (my contribution to the session was nil), and after looking up the general mechanics for swarms, it appears you have three options:   Area affect magic (I don't even have Minor Magic and don't plan on acquiring it) A torch/fire swung as an improvised weapon  A lantern/fire source as an improvised thrown weapon   My character is a halfling who of course travels light, and I try not to carry anything that emits visible auras or significant magic auras, so I really do just have my crossbow, knife and armor for the most part. I have 4 pathfinder pouches to hide small magic items though so I'm not opposed to carrying anything that can fit in those pouches; I just don't want to be caught with a giant glowing quarterstaff; my character often has to pass as an  innocent little (human) girl.  Is there any option for dealing with swarms like that? Are there items I could use or preferably tactics I could use to actually damage a swarm (or cause damage to them)? Or is running my only option when faced with a swarm when alone?


I am reading a 1946 paper on the Dirac equation (H. Chandra, “The correspondence between the particle and the wave aspects of the meson and the photon,” Proc. R. Soc. London, Ser. A 186(1007), 502–525 (1946)) where a symbol that resembles a reverse uppercase gamma appears (see image). Is there a name for this symbol, and is there a comparable LaTeX symbol?

I need a mirrored symbol \Gamma. Is it posible? I can't find this symbol and I do not know a way to mirror the symbol. I use unicode math.


I have an app written in PHP with MySQL in the back. Originally the app was using custom language class that was quite ineffective so I changed everything to use gettext.  The problem is a lot of strings are in the database, stored in tables that are never changed just read from. The good thing is every installation is in only one language.  In order to provide the strings in different languages, different databases were used before. There is database_en, database_fr, etc. and every new installation is using the appropriate localized database. I want to change this - one database for all languages.   I am thinking of moving everything language specific from the database to config files where gettext can be used again.  Do you think this is good idea or you would continue using different databases for different installations? Can you recommend something better ?

I'm developing a multilanguage software. As far as the application code goes, localizability is not an issue. We can use language specific resources and have all kinds of tools that work well with them.  But what is the best approach in defining a multilanguage database schema? Let's say we have a lot of tables (100 or more), and each table can have multiple columns that can be localized (most of nvarchar columns should be localizable). For instance one of the tables might hold product information:  CREATE TABLE T_PRODUCT (   NAME        NVARCHAR(50),   DESCRIPTION NTEXT,   PRICE       NUMBER(18, 2) )   I can think of three approaches to support multilingual text in NAME and DESCRIPTION columns:   Separate column for each language  When we add a new language to the system, we must create additional columns to store the translated text, like this:  CREATE TABLE T_PRODUCT (   NAME_EN        NVARCHAR(50),   NAME_DE        NVARCHAR(50),   NAME_SP        NVARCHAR(50),   DESCRIPTION_EN NTEXT,   DESCRIPTION_DE NTEXT,   DESCRIPTION_SP NTEXT,   PRICE          NUMBER(18,2) )  Translation table with columns for each language  Instead of storing translated text, only a foreign key to the translations table is stored. The translations table contains a column for each language.  CREATE TABLE T_PRODUCT (   NAME_FK        int,   DESCRIPTION_FK int,   PRICE          NUMBER(18, 2) )  CREATE TABLE T_TRANSLATION (   TRANSLATION_ID,   TEXT_EN NTEXT,   TEXT_DE NTEXT,   TEXT_SP NTEXT )  Translation tables with rows for each language  Instead of storing translated text, only a foreign key to the translations table is stored. The translations table contains only a key, and a separate table contains a row for each translation to a language.  CREATE TABLE T_PRODUCT (   NAME_FK        int,   DESCRIPTION_FK int,   PRICE          NUMBER(18, 2) )  CREATE TABLE T_TRANSLATION (   TRANSLATION_ID )  CREATE TABLE T_TRANSLATION_ENTRY (   TRANSLATION_FK,   LANGUAGE_FK,   TRANSLATED_TEXT NTEXT )  CREATE TABLE T_TRANSLATION_LANGUAGE (   LANGUAGE_ID,   LANGUAGE_CODE CHAR(2) )    There are pros and cons to each solution, and I would like to know what are your experiences with these approaches, what do you recommend and how would you go about designing a multilanguage database schema.


On a CentOS 7 server, a user is added to the wheel group, but then that same user is not able to run sudo commands.    What specific commands need to be added to the below in order for the user named wannabe_sudoer_user to be allowed to run sudo commands?  The Specifics:    Here is the terminal log that shows the failed attempt to add the wannabe_sudoer_user user to the sudoers list:  [wannabe_sudoer_user@localhost ~]$ su - Password: Last login: Mon May 15 13:58:21 PDT 2017 on ttyS0 [root@localhost ~]# gpasswd -a wannabe_sudoer_user wheel Adding user wannabe_sudoer_user to group wheel [root@localhost ~]# exit logout [wannabe_sudoer_user@localhost ~]$ sudo mkdir /opt/atlassian/  We trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things:      #1) Respect the privacy of others.     #2) Think before you type.     #3) With great power comes great responsibility.  [sudo] password for wannabe_sudoer_user: wannabe_sudoer_user is not in the sudoers file.  This incident will be reported.

I changed permissions of a file (chmod g+w testfile) and running ls -l testfile gives:  -rwxrwxr-x 1 user1 user1 0 2011-01-24 20:36 testfile   I then added a user to that group ("/etc/group" has user1:x:1000:user2 line), but am failing to edit that file as user2. Why is this so?


I always spend too much time trying to scale symbols or logos that are supposed to look harmoniously next to each other, like below:    These seem to be acceptable to me, but I wonder if there is any formula or recipe that can be used to make a row of random proportions symbols look good and save time? I guess spacing also can be optimised, like in case of fonts. It probably depends on shapes of symbols, not only on their outer boundaries, but maybe there is some not too complicated solution?  It would be ideal to have a script that does it.  EDIT: Thanks to  and  for suggesting a similar question (), there are some great answers there. However they stress on importance of making the text look of similar size. At the moment I usually deal with symbols that rarely have text in it, so it is more a matter of balancing the geometry. Ideally I'm interested in solution that could be scriptable, semi-automatic or fully-automatic.

A regular challenge that I face is balancing two (or more) logos. Whether they need to be equal or one needs to be given priority. Some logos however might be squares, others rectangles, circles, etc...   As a quick sample I snagged a nice high resolution photo from  and pretend its going to be an advertisement that needs to show some footwear brand logos on it. In this case I used Adidas and Saucony.  This is certainly not balanced even though they're height is the same:    Likewise this is not balanced even though they're width is the same:    So then the question becomes when are they in balance, is this balance:    Maybe a little more adjustment, is this balance:    And in these examples I'm only working with two Black Logos. Factor in color and it can get even more difficult to balance. Another issue being when there's tiny text as part of the logo.  So the question is, other than estimating / eye-balling it, what tips, methods or even tools are there to balance different sized logos?


i have written code in php file that to connect to database and get the requested data .    <?php  // 1. Create a database connection  $dbhost = "localhost";  $dbuser = "root";  $dbpass = "root";  $dbname = "widget_corp";    $connection = mysqli_connect($dbhost, $dbuser, $dbpass, $dbname);   // Test if connection succeeded    if(mysqli_connect_errno()) {      die("Database connection failed: " .       mysqli_connect_error() .       " (" . mysqli_connect_errno() . ")"    );  }        $query  = "SELECT * ";        $query .= "FROM subjects ";        $query .= "WHERE visible = 1 ";        $query .= "ORDER BY position ASC";        $result = mysqli_query($connection, $query);        $subject = mysqli_fetch_assoc($result);       print_r($subject);    ?>   i am getting the output in array format ,i want to get the out put in json format.how to change the code ,please help me .

How do I use the json_encode() function with MySQL query results? Do I need to iterate through the rows or can I just apply it to the entire results object?


Let $f_k$, $f \in L^1(0,1)$ with $f_k, f \geq 0$ in $(0,1)$. Suppose $f_k\rightarrow f$ a.e. and $$\int_0^1 f_k \rightarrow \int_0^1 f \, . $$ How could one prove that $f_k \rightarrow f$ in $L^1(0,1)$ ?

Let $1\leq p < \infty$. Suppose that    $\{f_k\} \subset L^p$ (the domain here does not necessarily have to be finite),  $f_k \to f$ almost everywhere, and  $\|f_k\|_{L^p} \to \|f\|_{L^p}$.    Why is it the case that $$\|f_k - f\|_{L^p} \to 0?$$   A statement in the other direction (i.e. $\|f_k - f\|_{L^p} \to 0 \Rightarrow \|f_k\|_{L^p} \to \|f\|_{L^p}$ ) follows pretty easily and is the one that I've seen most of the time. I'm not how to show the result above though.


I know this question has been asked many times but I still can't find a solution.  I'm redesigning icons that are going to be used on a web application. The former icons were placed on a PNG sprites sheet and the icons were 16x16px.  On Illustrator, I redesigned the icons with the 16x16px size but when I export them, they are blurry.  They are already blurry on my PNG file after the export.      I don't really know what to do. I tried the export for devices menu, everything... I even tried making a screenshot of my Illustrator artboard at 100% but then you lose transparency.

I've been stuck on illustrator for legit 2 days. All I am trying to do is create a simple icon at 30x30pixels for an app project I am making. The drawing consists of like 4 black lines. Looks perfect in Illustrator, but then as soon as I save for web its blurry. I switched from Photoshop to Illustrator as I was told vectors will make cleaner/sharper lines.   What is going on? Am I fighting a losing battle here? When an image is 30x30 pixels is it possible for them to be unpixelated? Please someone help !!!! :( PS have looked at so many other forums.


Apparently there are two ButterKnifes! 😎

Butterknife appears twice in the OSS attribution list of the Android app (v1.0.85). Based on the links, the second one should be JMustache.


If something says I have a bonus to damage rolls does that number get applied to the number on the dice or to the damage after the roll?  I was looking at the  feature which says I gain a +3 bonus (my proficiency bonus) to damage rolls. From reading that it sounds to me like it would apply to the number on the dice, adding 3 to whatever I roll up to the maximum (so if I rolled a 6 on a d8 I would add 2 to get to 8 but the last bit would be lost). This also matches up with what I thought I heard in the last campaign I played. But then I looked at the Improved Pact Weapon feature which says the weapon gets a +1 to damage rolls and on the DDB character sheet it treats it as bonus damage not a bonus to the roll. So which way would I apply this?  In response to the duplicate vote that question is asking about hitting a target in the first place. I'm not asking about that. I'm asking about the bonus to damage rolls.

Me and my friends are pretty new to D&D and are likely getting the majority of the rules wrong. I believe I understand AC: an AC of 16 means you must roll a die (+modifier) of 16 or greater to deal damage, and anything over that AC is taken as hitpoint damage?  What I was wondering was, at level 1, I believe I have a d10 halberd and a +4 strength modifier. However, the guards we're fighting have an AC of 16, making it completely impossible to even get past their AC. So we played it as if we could group attack, i.e. add up all our attack scores then remove whatever was excess of the AC from HP. Pretty sure we're playing some rules wrong, could anybody shed some light on the subject?  Not sure which version of D&D I'm using. It's the free pdf version released in August:   I have read the armour class section of the rulebook. Is it perhaps that first you roll a d20 (+modififers) to see if you beat armour class, then you do a damage roll?


I have the  4x4 keypad, and I need to connect it so that I can determine which key has been pressed without using a microcontroller. Is there a way I can connect it using logic gates? The final aim of connecting it is to determine which number has been pressed, decoding this value into BCD and storing it in an array of D Flip Flops. I can't see how to go about connecting it, and would greatly appreciate your help.

Is there a way to use a standard Matrix Keypad to set a synchronous counter IC without having to use a micro controller?


For example, Air France offer some tickets that combine flight and train to the final destination. After I arrive at CDG, if I don't take the train to the final destination, are they able to see whether or not I took the SNCF train?  If they can see it, will they cancel the return tickets for train and flight? It is important for me to understand this.   And if they really check, can I go to the train station, and then just leave the station? It's hard to believe they check whether I went to the final destination, right? I hope someone knows how this works.

I have a flight booked form Cairo to Amsterdam Schiphol via KLM and then a Thalys train from Amsterdam Schiphol to Brussels. As Brussels is not my final destination anyway I want to intentionally skip the train from Amsterdam airport to Brussels Midi. I have read many reviews about skipping a flight leg can lead to cancelling your entire flight but does the train booked with the flight included in this rule? What are the risks?


Is the function $f(x,y)=xy^{\frac{1}{3}}$ differentiable at $(0,0)$?  I'm trying to find the limit of $$ \lim\limits_{(x,y)\rightarrow(0,0)}\frac{xy^{\frac{1}{3}}}{\sqrt{x^2+y^2}} \;, $$ but when I use the inequality $x^2+y^2\geq 2|x||y|$, I get stuck at $$ 0 \leq \lim\limits_{(x,y)\rightarrow(0,0)}\frac{|x||y|^{\frac{1}{3}}}{\sqrt{x^2+y^2}} \leq \lim\limits_{(x,y)\rightarrow(0,0)}\frac{(x^2+y^2)|y|^{\frac{-2}{3}}}{2\sqrt{x^2+y^2}} = \lim\limits_{(x,y)\rightarrow(0,0)}\frac{1}{2}\sqrt{x^2+y^2}|y|^{\frac{-2}{3}} =\ ? $$

I looked at the graph of $f(x,y)=(xy)^{2/3}$ at the origin, and no matter how far I zoom in it has four corners along $x=\pm y$, so it doesn't look like it is differentiable as $z=0$ doesn't look like a tangent plane.  I also found that its partial derivatives are not continuous at $(0,0)$, e.g.  $$ \lim_{(ky^2,y) \to (0,0)} \frac{\partial f}{\partial x} = \lim_{(ky^2,y) \to (0,0)} \frac{2}{3}x^{-\frac{1}{3}}y^{\frac{2}{3}} = \frac{2}{3}k^{-\frac{1}{3}} $$ (although $\frac{\partial f}{\partial x}(0,0) = \frac{\partial f}{\partial y}(0,0) = 0$)  I also tried to prove/disprove its differentiability by definition, and for it to be differentiable I need $$ \lim_{(x,y) \to (0,0)} \frac{f(x,y)-0}{\sqrt{x^2+y^2}} =0 $$ but then I got stuck. Am I even on the right track?  [UPDATE] I need to do the same thing for $f(x,y)=(xy)^{\frac{1}{3}}$... I think the answer is that $(xy)^{2/3}$ is differentiable but $(xy)^{1/3}$ is not, according to my professor but I'm not sure


I am working on matching Qradar event ids to source address ids and list of lists and a list of values.  I would like to create a dictionary with both and have the list items be the keys(), and the list of lists be the values() in that dictionary. source_address_ids= [             [26],             [14],             [27],             [29,30],             [25]         ]  offense_ids = [             155,             154,             152,             145,             144         ]  Desired output: new_dict = {155: [26],             154: [14],             152: [27],             145: [29,30],             144: [25]}

Imagine that you have the following list. keys = ['name', 'age', 'food'] values = ['Monty', 42, 'spam']  What is the simplest way to produce the following dictionary? a_dict = {'name': 'Monty', 'age': 42, 'food': 'spam'}


I am trying to solve the following problem:  Let $G$ be a non-abelian group of order $21$. Show that $1)$ $Z(G)$ is trivial. $2)$ $G$ has an automorphism which is not inner.  Could you please give me a hint on how to solve it? Thanks!   My Work: $Z(G)$ can have order $1, 3, 7, 21$. It can't be $21$ since $G$ is not abelian. It can't be $3$ or $7$ since $G/Z(G)$ would be cyclic, and therefore $G$ would be abelian. Thus $|Z(G)|=1$. I also know that $G/Z(G) \cong \text{Inn}(G)$, so there are $21$ inner automorphisms. Thus if I could show that $|\text{Aut}(G)| >21$, I would be done. But I have no idea how to do that. I kow that we can write $G$ as a semidirect product, but I don't see how that helps.

Sia $G$ un gruppo non abeliano di ordine $21$, quanti automorfismi possiede un gruppo siffatto?  Translation (by Davide): Let $G$ be a non-abelian group of order $21$. How many automorphisms does such a group possess?


can anyone help me how to make ubuntu look like mac ? i tried using the ubuntu tweak tool. It didn't do me that good...

I want my Ubuntu to look like Mac OS X. Just icon and theme if possible! Is it possible? Is there any way to install slingshot launcher?


The question is :  Let $f : \mathbb {R} \longrightarrow \mathbb {R}$ be a continuous function such that $f(x) = f(x^2)$.Then show that $f(x) = f(0)$ , $\forall x \in \mathbb {R}$.  How can I solve it?Please help me.Thank you in advance.

Suppose that $f(x)$ is continuous on $(0, +\infty)$ such that for all $x > 0$,$f(x^2) = f(x)$. Prove that $f$ is a constant function. My attempt is to show that for any point $a \neq b$ , we have $f(a)=f(b)$. But I have no idea on how to get this. Anyone can help?


I am running a headless raspberry pi system, that will eventually be a generative music player. I am now trying to get jackd to run at startup but not entirely sure how.  I can run the command   jackd -R -dalsa   And jack runs fine. However this stops me from being able to run any more commands in the console, with the last few lines being  ALSA: final selected sample format for capture: 32bit integer little-endian ALSA: use 2 periods for capture ALSA: final selected sample format for playback: 32bit integer little-endian ALSA: use 2 periods for playback   I have put the jackd in an init.d script also, however the same problem appears. What I would like is a way for jackd to start up in a seperate process, or a way for it to hand "control" back to other startup scripts or the user.  M problem is different that the commented one in that I would like to start a daemon (I did not know this before, but now it seems like the sensible option)

On the CLI, sometimes a command I type takes a while to complete, and sometimes I know when that's about to happen. I'm a bit confused on "backgrounding" and such in Linux.  What is the most common (or user-friendly way) of telling the CLI that I don't want to wait, please give me back my prompt immediately. And if it could give me a progress bar or just busy-spinner, that would be great!


I'm a Mac user and new to Windows. How can I execute a shell script in Windows?   Generally, I would save the text file with the extension .sh and run it via Terminal. But how could I do that in Windows?

When I am trying to execute a file(name.sh) in the command line by the command  ./name.sh  , I am getting the error that:     "." is not recognized as an internal   or external command, operable or batch   file   please help me execute the .sh file


I hope that my question is clear enough to understand.   If we need to calculate the probability of an event and we have historical data regarding our parameter of interest - When we have to assume distribution in order to calculate the probability of an event, or it is safe just to calculate the probability from a simple frequency distribution.   To put the question into context here is an example:   We want to calculate the probability of X numbers of sales in a certain period of time.  Assume Poisson distribution? Or it is enough and "safer" just to calculate the probability of X sales from the historical frequency of sales during that period?  Thank you very much!

Can someone explain to me why would anyone choose a parametric over a nonparametric statistical method for hypothesis testing or regression analysis?   In my mind, it's like going for rafting and choosing a non-water resistant watch, because you may not get it wet. Why not use the tool that works on every occasion?


For the example of an infinite square well, $\psi(x)=0$ for $x$ outside the well/interval, and we are to interpret this as the particle cannot be found outside the well because $|\Psi(x,t)\bar{\Psi}(x,t)|^2=0$ in these regions. But probability of $0$ does not necessarily imply that an event is impossible, so I'm a bit confused as to why you can say that it's impossible for the particle to be in this region or that just based off of this. Can anyone clarify?

A friend of mine asked me a question, which I considered trivial at first, but after a while gave rise to some doubts.  For instance, we have a potential well in 1 dimension defined by $$ V(x)= \begin{cases} +\infty &\text{if}& x<0 \text{ and } x>L\\ 0 &\text{if} &0\leq x\leq L \end{cases} $$ We know the wave function that describes the particle in the potential at a given energy level $$ E_n=\frac{\hbar^2\pi^2n^2}{2mL^2} $$  Now if we take the state at the energy level $E_2$ we have a wavefunction that behaves like $\psi_2\sim\sin(\frac{2\pi x}{L})$. We are interested in the probability density, so we take the square modulus, which would be $0$ at $L/2$. According to this fact I would say that it's impossible to find the particle in the position $L/2$, which can be said as: the event: "find the particle at $L/2$" is impossible.  The problem is that probability tells me that the fact that the probability is zero doesn't mean that the event is impossible. Of course to get the probability I should integrate over a length, but how can I say that the event IS impossible? Isn't it?  Maybe it's a stupid question and I'm missing something, but I just can't fulfill my purpose.


I was going through the chapter of  "Newton's Laws of Motion", where I was introduced to the concept of inertia in Newton's First Law. I saw that all objects that have mass  will have inertia. But I do not really get it. What is the reason behind objects having inertia? And why is it that only those objects that have mass have inertia? I tried researching on the matter a bit, but until now I have not found any satisfactory answer.

In  R P Feynman relates a story where his father told him that, even though we know the word "inertia" and what it means, nobody knows why inertia happens. Is that still true?


Imagine a situation where you want to reward an exceptionally good answer to a question, with an additional bonus bounty. Why don't we have the ability to specify which answer it is in the first place, so it'll get the bonus automatically at the expiration of the bounty?   says   If you do not award your bounty within 7 days (plus the grace period), the highest voted answer created after the bounty started with at least 2 upvotes will be awarded half the bounty amount. If there's no answer meeting that criteria, the bounty is not awarded to anyone.   Question: Does that mean that if no new answers were created after the bounty was started, the bounty won't be automatically awarded to any of the pre-existing answers, and will go completely to waste?   I can see the reason for such behaviour for bounties which solicit new answers, but the whole reason for this bounty in the first place was to reward a pre-existing answer?!

I was impressed by the effort that Ankur put into his answer to my question "", so I created a bounty so that I could award extra reputation as a way of thanking him for his help.  As the reason for my bounty, I specified, "One or more of the answers is exemplary and worthy of an additional bounty":    When I went to award the bounty, however, I noticed that I still have to wait 24 hours:    Is this really necessary, seeing as how I started the bounty specifically to award it to an existing answer?


The general linear group is generated by elementary matrices that add a multiple of row $j$ to row $i$ and elementary matrices that multiply row $i$ by a scalar. This is because you can write an invertible matrix as the product of elementary matrices, and a row swap matrix can be written as a product of the other two types of elementary matrix.   So far, I've worked out that all matrices that are products of this type of elementary matrix are in the special linear group, but I don't know how to proceed.

I need to prove that the transvection matrices generate the special linear group $\operatorname{SL}_n \left(\mathbb{R}\right) $.  I want to proceed using induction on $n$.  I was able to prove the $2\times 2$ case, but I am having difficulty with the $n+1$ case.  I supposed that the elementary matrices of the first type generate $\operatorname{SL}_n(\mathbb{R})$. And I want to show that an elementary matrix of the first type of order $n+1$ can generate $\operatorname{SL}_{n+1}(\mathbb{R})$


We know that Naruto's parents died right after his birth, and by the time he was in the Academy he was living alone. However, there must have been a period of time when he was being raised by someone, because babies can't take care of themselves. Is it ever said who raised him for that initial time or where he lived?

In episode 350, we see that the Third Hokage took on to take care of Naruto. But towards the beginning of the anime Naruto is seen to be living alone.   Did Naruto live with the Third? If so, why did he leave there?


Assume h is an increasing function from the set of real numbers to the set of reals. (h: R -> R). Show h(R) connected implies that h is continuous.

I am having difficulties showing that this is true. How would you prove this statement?  Given that the function $h: \mathbb{R}\rightarrow\mathbb{R}$ is increasing. Show that $h$ is continuous if and only if  $h(\mathbb{R})$ is connected.


NOTE: This is not a duplicate of, nor is the answer here:      On my local Apache webserver, and I have PHP 5.6 and 7.0 installed. When I run 7.0 the scripts are not executed (just raw text is displayed), but when I switch to PHP 5.6 everything is fine.  I've checked my httpd.conf when running 7.0, and it's correct:  LoadModule php7_module /usr/local/opt/php70/libexec/apache2/libphp7.so  Typing php --ini in terminal produces the following:  Configuration File (php.ini) Path: /usr/local/etc/php/7.0 Loaded Configuration File:         /usr/local/etc/php/7.0/php.ini Scan for additional .ini files in: /usr/local/etc/php/7.0/conf.d Additional .ini files parsed:      /usr/local/etc/php/7.0/conf.d/ext-mcrypt.ini   Which looks correct.   Typing apachectl -v produces:  Server version: Apache/2.4.18 (Unix) Server built:   Feb 20 2016 20:03:19   I feel like it's an issue with my Apache config.

I recently downloaded OpenSUSE OS version 11.4 from the site to use it as a server..In order to do that I downloaded the server edition that has Apache/2.2.17 and PHP5 downloaded by default.....Ok till now it is fine  Now I started the Apache successfully and put a test.php file in the documentRoot directory. test.php contain only <?php phpinfo() ?>  Then using my browser I typed http://localhost/test.php and here was the problem  the browser didn't display what phpinfo() should display, instead it asked me whether I want to open or save test.php...which is driving me crazy.... I googled a lot but no solution  THis is /etc/apache2/conf.d/php5.conf  <IfModule mod_php5.c>     AddHandler application/x-httpd-php .php4     AddHandler application/x-httpd-php .php5     AddHandler application/x-httpd-php .php     AddHandler application/x-httpd-php-source .php4s     AddHandler application/x-httpd-php-source .php5s     AddHandler application/x-httpd-php-source .phps     DirectoryIndex index.php4     DirectoryIndex index.php5     DirectoryIndex index.php </IfModule>


How to collect command's output/results to the log file? What command can write all msg's in shell to the file?

How do I save the output of a command to a file?  Is there a way without using any software? I would like to know how.


Note: by neighborhood of $x$ we mean a set $N$ s.t. there exists open $U$ s.t. $x \in U \subseteq N$.   We only care about the "if" as the "only if" is trivial. The usual proof goes as follows. Suppose $U$ if a neighborhood of all its points, i.e. $\forall x\in U \exists V_x$ open s.t. $x \in V_x \subseteq U$. Then $\bigcup_{x \in U} V_x = U$ (as is easy to check) and hence $U$ is open as the union of open sets. The point that I think we need choice is in taking the union $\bigcup_{x \in U} V_x$ as we are effectively doing an arbitrary amount of existential instantiation to construct a function $x \mapsto V_x$ where $V_x$ is some such set (where we proved there exists at least one such) s.t. $x \in V_x \subseteq U$ and it is open.  As I am writing this, I feel like there is a way to eliminate choice from the proof. Here's my attempt. Suppose $U$ is a neighborhood of all its points. Denote the topology (i.e. the set of open sets) by $T$. Let $W = \{V \in T \mid V \subseteq U\}$. Let $A = \cup W$. Then as a union of open sets, $A$ is open. Claim: $A = U$. Well clearly $A \subseteq U$. Let $x \in U$. Then by assumption there exists an open set $B$ s.t. $x\in B \subseteq U$. Then $B \in W$ so $B \subseteq A$. Hence $x \in A$. Thus $U \subseteq A$ and hence $U = A$.  Am I correct that the usual proof implicitly uses choice but my proof doesn't? In my classes, every so often someone will make a big deal that a certain theorem relies on choice (e.g. Tychonoff or Hahn-Banach) yet it seems that people are throwing around choice all the time implicitly.

I am reading "A Course in Analysis vol.3" by Kazuo Matsuzaka.    There is the following proposition in this book.    Does the author use the axiom of choice in the proof?    Proposition 4:       A subset $A$ of a metric space $X$ is open in $X$ if and only if $A$ is a union of open balls in $X$.     Proof:       An open ball is open, so a union of open balls is open. Conversely, if $A$ is open and $a \in A$, then there exists a positive real number $r(a)$ such that $B(a ; r(a)) \subset A$. Obviously $$A = \bigcup_{a \in A} B(a ; r(a))$$ holds.     I think the author's proof uses the axiom of choice as follows:    Let $S_a := \{x \in \mathbb{R} | x > 0, B(a ; x) \subset A\}$. Since $A$ is open, for any $a \in A$, $S_a \ne \emptyset$. So, by the axiom of choice, there exists a mapping $r$ from $A$ to $\bigcup_{a \in A} S_a$ such that $r(a) \in S_a$.


Is it possible to find a closed form for the expression below? $\sum_{k=0}^n\binom{2n}{n} \binom{2n-2k}{n-k}$ I think it is possible to use a former solved one below. $\frac{1}{\sqrt{1-4x}} =  \sum_{n=0}^\infty \binom{2n}{n} x^n $

It's not difficult to show that  $$(1-z^2)^{-1/2}=\sum_{n=0}^\infty \binom{2n}{n}2^{-2n}z^{2n}$$  On the other hand, we have $(1-z^2)^{-1}=\sum z^{2n}$.  Squaring the first power series and comparing terms gives us  $$\sum_{k=0}^n \binom{2k}{k}\binom{2(n-k)}{n-k}2^{-2n}=1$$  that is,  $$\sum_{k=0}^n \binom{2k}{k}\binom{2(n-k)}{n-k}=2^{2n}$$  My question: is there a more direct, combinatorial proof of this identity?  I've been racking my brains trying to come up with one but I'm not having much success.


This is my method here:  private void trackPrinter(){      File file = new File("track.txt");     String absolutePath = file.getAbsolutePath();     String filePath = absolutePath;      try {       FileReader readerT = new FileReader(filePath);     BufferedReader brT = new BufferedReader(readerT);     jTextArea2.read(brT, null);     brT.close();     jTextArea2.requestFocus();     } catch(Exception e) { JOptionPane.showMessageDialog(null, e);     } }   I've tried many different ways to pass the file in but each time it throws a NullPointerException. if i use jfilechooser the method works fine, except i want the file to open and read on start up.

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


In Mario Kart 8, the player can pick up coins. Having never played the game (only watched You-tubers play it), I don't see the importance of these. But, the people I watch seem to make a big deal about getting as many as they can, up to a max of 10.  What is the point of collecting these coins?

In Mario Kart 8, what is the benefit of coins you pick up while racing? You can't have more than 10 at any given time. Are there benefits for having 1-9 coins? Or do you only get benefits when you are maxed out at 10?    How does this system work?


I need to install the firewall certificate on the devices of my company. Since I can't install a system trusted certificate without rooting the device I thought of creating an Android image that comes with the certificate and flash it into the devices, but...  Where or how should I put such cert on the image? Or if there is another solution that also doesn't envolves rooting I would be happy to hear!

I work on a site that serves mobile phones and shares some file. When I publish my site in http everything works great.  But when I activate SSL and publish my site via HTTPS with my own certificate, Android doesn't download any file from my site.  I create my own SSL CA certificate via openSSL in my local  PC and not purchasing from standard seller like GoDaddy.  How do I install my CA certificate to Android?  Do I have to purchase SSL from a standard seller to solve this issue?  My android version is 4.4.4.


I have two quotient rings over $\Bbb F := GF(3)$: $$\Bbb F[x] / (x^3 -x - 1) \qquad \text{and} \qquad \Bbb F[x] / (x^3 -x + 1) .$$  These things I know: Both quotient rings are irreducible, that means they are the same size, so there should exist isomorphism.   I think these two quotient rings should be a field because they have maximum ideals.  I am trying to find function phi to create isomorphism between these quotient rings but not using brute force method. I have tried several ways but they are not "easy" enough. I know that identity element must be mapped to identity element but it didn't help me to find that exact isomorphic function.  Can somebody push me the correct way or give me tip how and where should I look to easily find isomorphism between these quotient rings without necessity to "heavy" computing.

So I want to find the isomorphism $\phi$ that takes $F = \mathbb{Z}_3/\langle x^3 - x - 1\rangle$ to $E = \mathbb{Z}_3/\langle x^3 - x + 1\rangle$.  I understand that these are both finite fields of size 3^3 since $x^3 - x - 1$ and $x^3 - x + 1$ are both irreducible polynomials of degree 3.  I feel like a good start would be to take the subfield $\mathbb{Z_3}$ in $F$ to the subfield $\mathbb{Z_3}$ in $E$.  Or maybe find the right generator of each multiplicative group of size $3^3-1$ of each field and send those to each other.


I was logging on to my online credit card account and I saw that there were now offering better cards but with annual fees. My current card is the same variation, but less benefits and zero annual fee.  I've heard some people negotiate their credit card annual fees and they are successful. Is it possible to do the same for a "credit card upgrade"?  I've been using their services for a year now and I've always paid my bills on time in full.

I've had my credit card for two years. I use it extensively for all kinds of purchases and I have never gone over my limit or incurred a late payment fee. The card has an annual fee and I was wondering if there are any circumstances when a bank might waive the fee, given that I have proven I am a reliable customer and make extensive use of it.


Let $X$ be a uniformly distributed random variable on $[0,\lambda]$. Let $\{x_i\}$ be a random sample of size $n$ from the population.  Is there any way to compute $E[max\{x_1,...,x_n\}]$ with this information?

Let $ x_i $ be iid observations in a sample from a uniform distribution over $ \left[ 0, \theta \right] $.  Now I need to estimate $ \theta $ based on $N$ observations and I want the estimator to be unbiased.  I thought about simple estimator $ \hat{\theta} = \max \left( x_i \right) $.  Based on simulation it is not biased, yet I couldn't show it analytically.  Could anyone, please, show it is unbiased?  BTW, I could easily find another, easy to prove, unbiased estimator, $ \hat{\theta} = 2 \mathrm{mean} \left( {x}_{i} \right) $


Disprove that if $n$ is an odd positive integer greater than $1$ then $2^n-1$ is prime.   So my approach to this is as follows but I have no idea where to go from here or whether this is the right approach.  Let $n=2x+1$ where $x\in\Bbb Z^+$  Then  $2^n+1=2^{2x+1}-1$  $=6(2^n)-1$

Possible Duplicate:          I'm taking elementary number theory and there is this one question that I don't know where to start at... Please help me, thanks!     Prove that if $n$ is composite, then $2^n - 1$ is composite.


Are  practically possible to exist? if they are how can we harness them? I have already tried finding answers but none are satisfactory. please help.

Is there a particle called a "tachyon" that can travel faster than light?  If so, would Einstein's relativity be wrong?  According to Einstein no particle can travel faster than light.


Let $K$ be a field, $P(X)$ an irreducible polynomial in $K[X]$, and let $\alpha$ be a root. This is a very common statement I've seen in lecture notes. The question is: how does $\alpha$ even exist? If $P(X)$ is an irreducible polynomial, then by definition, shouldn't it have no roots? What exactly is the above statement supposed to mean?

We know the following fact from field theory. Let $F$ be a field and $p(X)$ an irreducible polynomial in $F[X]$. Then we can find a field extension $L$ of $F$ such that $p(X)$ has a root in $L$. Proof: Clearly the ideal $\langle p(X)\rangle$ generated by $p(X)$ is maximal in $F[X]$. So $F[X]/\langle p(X)\rangle$ is a field. Let us denote it by $L$. So $L$ is a field extension of $F$ since we have $F \hookrightarrow F[X] \xrightarrow{\rm \pi} L$ in a natural way. Note that $F[X] \leq L[X]$ and $\pi(X)$ is a root of $p(X)$ in $L[X]$.  Is it true that $\pi(X)$ is the unique root of $p(X)$ in $L$ ? What is the relation between $\pi(X)$ and other roots of $p(X)$ if $deg(p) > 1$ ?  Thanks!


I am a naturalized American travelling to Ghana and UK. I know I need a visa for Ghana, but what do I need to show at the Ghana airport coming to UK?

Everything I've seen points to no (and I would love that to be true since applying for a visa online costs money) but I'm worried about getting refused due to the length of time I wish to stay, which is 6 months.  I went to university in the UK on a Tier 4 visa, but have never just been a tourist which is what I would like to do now. Since graduating, I have started working but am underwhelmed and would love to travel again. My original plan was Australia but now I would like to see the rest of the UK as well beforehand.  If I arrived with the following, would I be refused entry simply for not applying online?: an approved Australian work & holiday visa, a mini itinerary, bank statements for the last 6 months.


If one considers the following MWE one sees that theorems and lemmas have their number as a suffix:  \documentclass[fleqn]{scrartcl} \setkomafont{disposition}{\normalfont\bfseries} \makeatletter\let\TTTemp\cap\makeatother \usepackage[greek,english]{babel} \usepackage{teubner} \makeatletter\let\cap\TTTemp\makeatother \usepackage{eurosym} \usepackage{amssymb} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{lgreek} \usepackage{graphicx} \usepackage{textcomp} \usepackage{cancel} \usepackage{soul} \usepackage{cjhebrew} \usepackage{mathtools} \usepackage{rotating} \usepackage{esvect} \usepackage{natbib} \usepackage{MnSymbol} \usepackage{centernot} \usepackage{cancel} \usepackage{scalerel} \usepackage{hyperref} \usepackage{tocbibind}   \allowdisplaybreaks   \newbox\gnBoxA \newdimen\gnCornerHgt \setbox\gnBoxA=\hbox{$\ulcorner$} \global\gnCornerHgt=\ht\gnBoxA \newdimen\gnArgHgt \def\Godelnum #1{% \setbox\gnBoxA=\hbox{$#1$}% \gnArgHgt=\ht\gnBoxA% \ifnum     \gnArgHgt<\gnCornerHgt \gnArgHgt=0pt% \else \advance \gnArgHgt by -\gnCornerHgt% \fi \raise\gnArgHgt\hbox{$\ulcorner$} \box\gnBoxA % \raise\gnArgHgt\hbox{$\urcorner$}}  \newcommand{\bleq}{\mathrel{\mathpalette\bleqinn\relax}} \newcommand{\bleqinn}[2]{%   \ooalign{%     \raisebox{0.04ex}{\scalebox{1.24}[1.15]{$#1\blacktriangleleft$}}\cr     $#1\leq$\cr   }% }  \newcommand{\blt}{\mathrel{\mathpalette\bltinn\relax}} \newcommand{\bltinn}[2]{ \ooalign{ \raisebox{0.04ex}{\scalebox{1.23}[1.22]{$#1\blacktriangleleft$}}\cr $#1$\cr } }   \newcommand\fat[1]{\ThisStyle{\hstretch{1.4}{\ooalign{%   \kern.46pt$\SavedStyle#1$\cr\kern.33pt$\SavedStyle#1$\cr%   \kern.2pt$\SavedStyle#1$\cr$\SavedStyle#1$}}}} \def\fvee{\mathbin{\fat{\vee}}}  \newcommand*{\aoverb}[2]{\ensuremath{\genfrac{}{}{0pt}{}{#1}{#2}}} \newcommand\updown[1]{\rotatebox[origin=c]{180}{\ensuremath{#1}}} \newcommand\atangle[2]{\rotatebox[origin=c]{#1}{\ensuremath{#2}}}  \renewcommand*{\koppa}{\ensuremath{\text{\textgreek\coppa}}} \renewcommand*{\Koppa}{\ensuremath{\text{\textgreek\Coppa}}}  %\newcommand*{\koppa}{\ensuremath{\c{k}}} %\newcommand*{\Koppa}{\ensuremath{\c{K}}}   \newtheorem{theorem}{Theorem}[section] \newtheorem{acknowledgement}[theorem]{Acknowledgement} \newtheorem{algorithm}[theorem]{Algorithm} \newtheorem{axiom}[theorem]{Axiom} \newtheorem{case}[theorem]{Case} \newtheorem{cannon}[theorem]{Cannon} \newtheorem{claim}[theorem]{Claim} \newtheorem{conclusion}[theorem]{Conclusion} \newtheorem{condition}[theorem]{Condition} \newtheorem{conjecture}[theorem]{Conjecture} \newtheorem{corollary}[theorem]{Corollary} \newtheorem{criterion}[theorem]{Criterion} \newtheorem{definition}[theorem]{Definition} \newtheorem{example}[theorem]{Example} \newtheorem{exercise}[theorem]{Exercise} \newtheorem{hint}[theorem]{Hint} \newtheorem{lemma}[theorem]{Lemma} \newtheorem{notation}[theorem]{Notation} \newtheorem{postulate}[theorem]{Postulate} \newtheorem{postulation}[theorem]{Postulation} \newtheorem{problem}[theorem]{Problem} \newtheorem{proposition}[theorem]{Proposition} \newtheorem{remark}[theorem]{Remark} \newtheorem{solution}[theorem]{Solution} \newtheorem{summary}[theorem]{Summary} \newenvironment{proof}[1][Proof]{\noindent\textbf{#1.} }{\ \rule{0.5em}{0.5em}}  \title{Test}  \author{Frode Bj\o rdal}  \date{}  \begin{document}       \section{Test}      \begin{theorem}     This is a theorem.     \end{theorem}      \begin{lemma}     This is a lemma.     \end{lemma}      \begin{proposition}     Ths is a proposition     \end{proposition}       \end{document}   How can I have the numbers as a prefix? Just adding the amsthm with swapnumbers give errors.

I would like all my theorem-like environments (theorem, example, etc.) to be numbered but such that the number appears before the environment's name, more or less like this:  1. Theorem  2. Example  How can I do this?


So, I'm now (for some weeks) a user with more than 10k reputation (on Stack Overflow). I can access the moderation tools, one of them is the . This lists some of the flags on posts (questions and answers) which were not yet handled by a moderator, as I understand.  In the time since I had the right, I often looked through this list, and reflagged some of the flagged posts. This rapidly raised my flag weight from 150 to 500 (I got the deputy badge yesterday) ... but I'm not sure this really helped the work of the diamond moderators.  So, which of my possible actions really do help the moderators?   If I see an answer flagged not an answer, it often is something that either should be a comment or an edit to the question. I then (after looking at the question page) flag it again, and some time later a moderator has to press the right buttons to convert it - i.e. the same actions he/she would have to do without my flag. Does my reflag really help here (apart from raising my flag weight)? If I see a question flagged as duplicate, not a real question or off topic, I check the question (and maybe the linked duplicate), and if the flag is right, I vote to close with the right reason. I can see that this would be useful, if enough people are doing this to close/migrate the question without moderator intervention. I often see very low quality flags (both for questions and answers). What am I (or moderators, really) supposed to do here? Vote to close/delete? Edit it to make it better quality? (Then it would be useful to have a filtered view of these, just for my tags.) Simply downvote (maybe with a comment, if there is not already one)? Sometimes there are flags where I think they are not justified, and then I flag invalid flag. What is the effect on this (other than raising my flag weight when I'm right or lowering it when I'm wrong)? As I understand, a moderator still has to review it (at least, the message Thanks, we will take a look at it seems to indicate this). Sometimes I see possible vandalism of own posts - someone deleted his own posts, and the system autogenerated a flag here. Is there something useful I could do here, as a non-moderator? Vote to undelete if there is something useful? Vote as invalid, if it is nothing useful? Does my vote/flag here actually help the moderators? Sometimes there are duplicate posts - usually the same user answering two similar questions with exactly the same text. Where I understand the topic, this is most often a valid answer for both questions. Should I mark this as invalid flag? Does this actually help? (Once I found someone just posting a link to a blog entry to several related questions, then I flagged as spam.)   There are some related questions, but those did not really help me here:         (I did not view the video yet, though)

are pretty cool... You get a birds-eye view of activity on the site, a "dashboard" view of what's happening. Some of the individual tools haven't scaled particularly well with Stack Overflow's growth, but the concept behind them is still sound: we trust you to enough to be a bee watcher now.  ...and then there's . What a let-down! Once upon a time, this queue contained spam and offensive flags, which one might reasonably assume were important enough to put in front of the more trusted members of the site. Re-flagging them brought them that much closer to deletion, while editing them offered salvation to some hapless author. Nowadays, it's a bunch of Not an Answer flags and a smattering of assorted cruft. 10K users can't even vote to delete these; only 20K users have that privilege. Re-flagging them does nothing but increase their priority in the moderator flag queue, where they frequently outrank more pressing issues;  has . Also, it's , and the behavior has diverged far enough from that of the moderator flag queue on which it is based that it has become an active hindrance to further development of the tooling there. Worst of all, we have  that's available to anyone with the editing privilege. It even has logic built in to prioritize answers likely to be deleted for users with . It's like we gave you a car for your 10th birthday, and then replaced it with a rusty bicycle when you turned 16. It was a nice idea, but it has outlived its usefulness. Proposed changes The /tools/flagged route goes away. Period. No replacement. The rest of the 10K tools stick around as informational pages. Not an Answer flags go into /review/low-quality, . Then we beef up the Low Quality review process to make better use of more experienced reviewers and solve this whole "declined / helpful / disputed" flag debate once and for all:  Effective # of reviews required == ReviewsRequired + # of applicable flags (where ReviewsRequired is 2 on Stack Overflow, 1 everywhere else). So 1 VLQ or NAA flag means EffectiveReviewsRequired=3. LQ tasks are not dequeued until one of the following conditions is met:  Post is edited from within review. Outcome: flags are marked "helpful" (current behavior). Post accumulates 3 Delete votes (can only happen when post scores <= 0 and reviewers have >= 20K rep). Outcome: post is deleted, flags are marked "helpful". Task accumulates EffectiveReviewsRequired "Looks Good" reviews. Outcome: if the number of (Recommend)Delete reviews is >= the number of Looks Good reviews, mark flags "disputed" and raise DisputedLowQuality mod flag. Otherwise, mark flags "declined". Task accumulates 6* RecommendDelete + Delete reviews. Outcome: mark flags "helpful". If the post scores > 0 then raise DisputedLowQuality mod flag, else just delete post (current behavior).   As under the current system, flags on posts that've already completed one full review cycle without being deleted should skip /review and go directly into the mod queue.  End result  Flags get handled faster, more accurately, and with less wasted effort from 10K reviewers. Moderators are free to focus on situations that can't be handled by the community - the ! Developers are free to make enhancements to the moderator tooling without having to work around 10K user restrictions.  Questions Am I forgetting anything here? I haven't really spent much time in the 10K flag queue since back when it was filled with spam flags and therefore useful - is there a use-case that you depend on that would be lost with its removal? Post 'em below. *: on Stack Overflow, only .


public static void main(String str[]){// String type     System.out.println("Main()");     main(0100);} public static void main(int a){//integer type     System.out.println(a); }   answer should be 100 rather 64

This prints 83  System.out.println(0123)   However this prints 123  System.out.println(123)   Why does it work that way?


Would anyone know how to compare an parameter with an object? I've been trying to do it following the instructions given in the last question here:  But, doesn't seem to wrork.  public class Classification     {         String changes;         String rating;         String description;      Classification()     {         rating = "G";         description = "Suitable for general audiences";     }      Classification(String must)     {         if(must != "G" || must!= "PG" || must!="M")         {             throw new NullPointerException ("Not equal");         }         rating = must;         if(rating == "G")         {             description = "Suitable for general audiences";         }         if(rating == "PG")         {             description = "Parental guidance recommended";          }         if(rating == "M")         {             description = "Suitable for mature audiences";         }     }      Classification (int num, String para)     {         if(num!= 13 || num!= 15 || num!=16 || num!=18)         {             throw new IllegalArgumentException("Not equal");         }         if(para==null)         {             throw new NullPointerException("String is null");         }         if(num == 16)         {             rating = "R";             description = para;         }         changes = rating + num;     }      void printClassification()     {         print("Rated " + rating + ": " + description);     }      void derestrict()     {         if(rating == "M")         {             rating = "PG";             }         if(rating == "PG")         {             rating = "G";         }         if(rating == "G")         {             throw new IllegalArgumentException("G is least restrictive");         }         if(changes == "R18")         {             changes = "R16";         }         if(changes == "R15")         {             changes = "R13";         }     }      Classification isLessRestrictive(Classification compare)     {         if(compare==null)         {             throw new NullPointerException ("Classification para is null");         }         if(changes<compare)         {             return true;         }         return false;     } }

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


I'm new to differential equations and I was wondering if I could use the Euler method and the midpoint method to approximate the solution to these three differential equations, as I cannot solve this set of differential equations at my skill level. In addition, are any other ways to approximate these solutions? These equations are the SIR equations used to model an infectious disease.  $${\frac {dS}{dt}}=-{\frac {\beta IS}{N}}$$ $${\frac {dI}{dt}}={\frac {\beta IS}{N}}-\gamma I$$ $${\displaystyle {\frac {dR}{dt}}=\gamma I}$$

I know how to solve SIR model with ode45, but I just wanted to try it out using Euler Method. The SIR model is: $\dot S=-\beta IS \\ \dot I = \beta IS - \gamma I \\ \dot R = \gamma I$ The code that I wrote is function Euler deltaT=1; s=1; i=1e-6; r=1-(s+i); beta=1.4247; gamma=0.14286-1e-6; maxTime=70; t=[0]; for n=1:maxTime     t(n+1)=t(n)+deltaT;     s(n+1)=s(n)-beta*s(n)*i(n)*deltaT;     i(n+1)=i(n)+(beta*s(n)*i(n)-gamma*i(n))*deltaT;     r(n+1)=r(n)+gamma*i(n)*deltaT; end figure plot(0:maxTime,s) hold on  plot(0:maxTime,i) hold on  plot(0:maxTime,r)    when I make the step size to be 1, I get the following figure which looks like the expected behaviour.  But when I make the step size small= 0.001, I get a very different figure.  Why does the behaviour change when I change the step sizes. What have I done wrong in the code?


I am doing some proofs in real analysis with the sup-norm metric.  In my arguments, I have that $sup\: x\in[0,1] \big\{\int_{0}^{x}|f(t)-g(t)|dt\big\}\leq sup\: x\in[0,1] \big\{|f(t)-g(t)|\big\}$. My question; is this true for all continuous functions on $[0,1]$?

Let $f$ be a continuous and integrable function over $[a,b]$. Prove or disprove that $$\int_a^b |f(x)|\ \mathrm{d}x\geq \left | \int_a^b f(x)\ \mathrm{d}x\right| $$