I am using Ubuntu 15.04 8u45-linux-x64.rpm and converting it to .deb using alien, then I am installing  it using gdebi package installer.  now when I run a apt-get command I get this error      E: The package jre1.8.0-45 needs to be reinstalled   but I can't find an archive for it.  anyone help me?  Thanks

Java 8 is now available according to , but  does not yet mention how to install OpenJDK 8 (not Oracle Java) on Ubuntu 14.04 Long Term Support. (For 14.10 and later just run apt-get install openjdk-8-jdk)  How and when can this be done?  (2017-08-08:  The very short answer is:  OpenJDK 8 as of 2017-08-08 is not officially available from the official repositories as an APT package for Ubuntu 14.04.  )  Note: For now we will use Oracle Java - the optimal solution for me is, however, OpenJDK from the Ubuntu repositories, until Oracle Java is available directly and effortless from the Ubuntu repositories.


is there any way to leave a time delay between the execution of two lines of code?

I would like to know how to put a time delay in a Python script.


I'm trying to execute the firefox binary:   root@454316a1a89a:/tmp/firefox-portable# ls -la total 220 drwxr-xr-x  4 jenkins jenkins   4096 Mar 18 21:15 . drwxrwxrwt  1 root    root      4096 Mar 18 21:48 .. -rwxr-xr-x  1 jenkins jenkins 202720 Feb 21 17:47 firefox   but when I try to execute it, I get the following error message:   root@454316a1a89a:/tmp/firefox-portable# ./firefox bash: ./firefox: No such file or directory

I want to launch the wine executable (Version 2.12), but I get the following error ($=shell prompt):  $ wine bash: /usr/bin/wine: No such file or directory $ /usr/bin/wine bash: /usr/bin/wine: No such file or directory $ cd /usr/bin $ ./wine bash: ./wine: No such file or directory   However, the file is there:  $ which wine /usr/bin/wine   The executable definitely is there and no dead symlink:  $ stat /usr/bin/wine   File: /usr/bin/wine   Size: 9712            Blocks: 24         IO Block: 4096   regular file Device: 802h/2050d      Inode: 415789      Links: 1 Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root) Access: 2017-07-13 13:53:00.000000000 +0200 Modify: 2017-07-08 03:42:45.000000000 +0200 Change: 2017-07-13 13:53:00.817346043 +0200  Birth: -   It is a 32-bit ELF:  $ file /usr/bin/wine /usr/bin/wine: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),  dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.32,  BuildID[sha1]=eaf6de433d8196e746c95d352e0258fe2b65ae24, stripped   I can get the dynamic section of the executable:  $ readelf -d /usr/bin/wine Dynamic section at offset 0x1efc contains 27 entries:   Tag        Type                         Name/Value  0x00000001 (NEEDED)                     Shared library: [libwine.so.1]  0x00000001 (NEEDED)                     Shared library: [libpthread.so.0]  0x00000001 (NEEDED)                     Shared library: [libc.so.6]  0x0000001d (RUNPATH)                    Library runpath: [$ORIGIN/../lib32]  0x0000000c (INIT)                       0x7c000854  0x0000000d (FINI)                       0x7c000e54  [more addresses without file names]   However, I cannot list the shared object dependencies using ldd:  $ ldd /usr/bin/wine /usr/bin/ldd: line 117: /usr/bin/wine: No such file or directory   strace shows:  execve("/usr/bin/wine", ["wine"], 0x7fff20dc8730 /* 66 vars */) = -1 ENOENT (No such file or directory) fstat(2, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 4), ...}) = 0 write(2, "strace: exec: No such file or di"..., 40strace: exec: No such file or directory ) = 40 getpid()                                = 23783 exit_group(1)                           = ? +++ exited with 1 +++   Edited to add suggestion by @jww: The problem appears to happen before dynamically linked libraries are requested, because no ld debug messages are generated:  $ LD_DEBUG=all wine bash: /usr/bin/wine: No such file or directory   Even when only printing the possible values of LD_DEBUG, the error occurs instead   $ LD_DEBUG=help wine bash: /usr/bin/wine: No such file or directory   Edited to add suggestion of @Raman Sailopal: The problem seems to lie within the executable, as copying the contents of /usr/bin/wine to another already created file produces the same error  root:bin # cp cat testcmd      root:bin # testcmd --help Usage: testcmd [OPTION]... [FILE]... Concatenate FILE(s) to standard output. [rest of cat help page]  root:bin # dd if=wine of=testcmd   18+1 records in 18+1 records out 9712 bytes (9.7 kB, 9.5 KiB) copied, 0.000404061 s, 24.0 MB/s  root:bin # testcmd bash: /usr/bin/testcmd: No such file or directory   What is the problem or what can I do to find out which file or directory is missing?    uname -a:  Linux laptop 4.11.3-1-ARCH #1 SMP PREEMPT Sun May 28 10:40:17 CEST 2017 x86_64 GNU/Linux


I have an old file named ˇ¡␀␀ˇ¡␀␀␀"9 ␀"9 which is not deleted when I empty the trash. I have tried renaming it but it does not accept any changes. Using the Terminal didn't work either so far:  Mac-Pro:deletethisfolder me$ find . -inum 425884608 -delete find: -delete: rmdir(./ˇ¡␀␀ˇ¡␀␀␀"9\006␀"9): Invalid argument   what can I do? Thanks!

When I try to move, rename, or delete a file named ␀in Finder, I get this error message:     The operation can't be completed, because an unexpected error occured (error code -50).   With mv, rm or find -delete in Terminal   rm: /Library/␀: Invalid argument  mv: rename /Library/␀ to /tmp/␀: Invalid argument  find: -delete: unlink(/Library/␀): Invalid argument   Can I move or delete this file in Mac OS X or do I have to use another operating system?  I even tried creating a file with this name in /tmp and it has not gone away since 8 reboots.


I have an object like result: object which has the below parameters in it.  calcTimeHY2: "50", calcTimeHY3: "70", color: "GREEN", width: "3", channels: Array(1)   I am writing a general method to create similar result object.  I have called getClonedResult(result)  getClonedResult(result){     let temp: any;     var propertyNames = Object.getOwnPropertyNames(result);     for (var name in propertyNames) {          temp = propertyNames[name];          if (!temp instanceof Array) {              //Then I want to create similar object as above             //How to do it.           }     } }   I have both arrays and single values in the same object, how to clone to a new object.

What is the most efficient way to clone a JavaScript object? I've seen obj = eval(uneval(o)); being used, but . I've done things like obj = JSON.parse(JSON.stringify(o)); but question the efficiency.  I've also seen recursive copying functions with various flaws.  I'm surprised no canonical solution exists.


I have bought a new keyboard and noticed this glitch so many times now.  Whenever you type some two keys in a very quick succession, there is a chance that the OS will interpret those keys backwards? Like, when I quickly type "wq", it sometimes inputs as "qw" and I'm not mistaken, I measure my fingers very precisely :)  Could it be realted to the default USB-keyboard refresh rate? How can one increase it without any specialized software from vendor (because there is none)?

A friend of mine's having trouble with her computer. When typing really fast, the letters get swapped around.  All my years working with computers I've never encountered this. I'm guessing virus.  An example: s cterompus uck! (computer suck!)  As you can see, some of the letters are in completely the wrong place, which means the computer must buffer them, and output them in the wrong order.  What's causing this?


The Hunger Games says that the remains of the U.S. are 12 districts. But where are they placed? What states?

In , the nation of Panem (implied to be North America after some sort of post apocalyptic scenario) is divided into 13 districts and the Capitol. District 12 is hinted to be in the Appalachia Mountains, and the Capitol is hinted to be in the Rocky Mountains. District 13, which was destroyed, is described as "east of District 12", which made me think it's where Washington D.C. is today.  The other districts, however, were mostly ignored, and almost no detail was provided as to their locations in the books. Has there been any supplemental information that reveals where the districts are?


I'm very new to QGIS, and I have a sample GeoTIFF (and corresponding TFW) file(s) that I'm trying to determine what the longitude and latitude coordinates for each of the 4 corners of the image are - coordinates of 2 opposite corners of the image would also be okay.   I'm able to import the GeoTIFF as a raster layer in QGIS, but I noticed that all the coordinates that are displayed are in UTM format. In the metadata, I see the layer extent, which I was told are the UTM coordinates of the bottom-left and top-right of the corners of the image (square-shaped), which I can work with. However, I have to determine what the UTM zone is so I can use that along with the UTM coordinates in the metadata to convert the points to latitude and longitude.   This seems like a fairly simple task, but I'm unable to find out what the zone is of the image to move forward with the UTM to long/lat conversion.

I am trying to convert a latlong point to UTM.   To define UTM projection, I need to calculate zone for the point.   I am trying to figure out the best way to do this.   One way to do this would be use longitude values to find the proper zone.   This would require lot of coding.   I am curious if there is a better way of doing this?


I plan to cook a basic mushroom risotto. However, the supermarket near us did not have shitake or any other uncanned mushrooms, they only had dried ones.  My question is, do I just remove the stem and place it straight into the risotto as the risotto finishes cooking?   I've seen and watched tutorials on how to cook a mushroom risotto. There are those who cook the mushroom (take out the stem and cut coarsely) by sautéing them in oil and onion. When the mushrooms sweat out, they put it in the risotto. However, there are those who cook out the mushroom and then add the rice in the same pot and cook the risotto. The point is that sweating out the mushrooms concentrate the flavor.  Since my mushrooms are already dry, do I have to do anything else aside from taking out the stem and cutting them coarsely? Is it acceptable if I sauté them or if I let them sit in hot water?   EDIT:  I found  that adjusted the risotto recipe for what's available in our country. It mentioned that I should soak the dried mushrooms in hot water, strain that water, and if I got it correctly, add the liquid to my stock. Can I skip this process? What's the advantages of soaking the mushrooms in warm water?

I was recently given a bag of dried mushrooms and am unsure how to work with them.  What's the best way to use them?


Update:  Thanks for all the feedback and bug reports! I am locking this thread so people don't keep answering it when we no longer monitor it.  If you see a bug or want to raise a feature request, please do so in the usual manner, as a new question.    Some of you may have noticed that  the  and  pages that we have been talking about for a while now on .  Most? Well, yes, the new design is dependent on a SE network-wide update (a new base css framework) that the design team have been working on. This is an ongoing effort and we will be launching the new pages as sites are moved to the new design.  You've all been hugely helpful already - much of what we love most in here came from  and  you gave us on Meta.     But it's possible that it's not quite perfect yet. If you find any bugs and have any feedback to give, please post these as answers to this post.  Just post one issue per answer - that would help us focus on specific items one at a time.


I observed a small but annoying problem for a long time now. I have to design maps/plans of survey areas for work including maps where a satellite image is printed under a vector-layer showing the outlines of the single survey fields. For the satellite images I use the build in Google Satellite layer from the OpenLayers plugin.   In QGIS everything looks OK, but when I export a JPEG or PDF-File from QGIS there is often a significant displacement of the Satellite Layer.  I tried to solve this by setting different Spatial reference systems or using Bing Satellite instead of Google, but it seems to have nothing to do with that. I found out, that it sometimes helps to set the plan to another scale before exporting. But this is often to big or doesn't help.  Anyone ever had this problem and/or know how to get rid of it?

I'm having trouble with the OpenLayers Plugin of Qgis and the map composer:  If I create an OSM-background layer and if I want to export this, the OSM-Layer looks perfectly all right in the normal qgis program window. But in the map composer and after export the layer has shifted relatively to my other shape layers (EPSG:32633 - WGS 84 / UTM zone 33N).  The second thing is that the output resolution of the exported osm-layer is very, very poor.   A really bad way of getting around this whole trouble would be to increase the screen resolution and make a screenshot of the map composition window of qgis. But I don't think this would be very professional. It also would cause a lot of pain :)   I'm using Qgis 1.8.0-Lisboa under Linux. The openlayers plugin is version 0.92.


I am writing a shell installation script After each command I need to check if the command is successful or not - And I must notify the user what failed. If something fails - installation cannot continue, currently after each command I am adding   if [ $? -eq 0 ]; then     But this adds like 6 lines to every command of the shell script Is there a way to make this checks shorter?  sample:  do some command if [ $? -eq 0 ]; then     echo notify user OK else     echo notify user FAIL     return -1 fi do some command if [ $? -eq 0 ]; then     echo notify user OK else     echo notify user FAIL     return -1 fi

What is your favorite method to handle errors in Bash?  The best example of handling errors I have found on the web was written by William Shotts, Jr at .   He suggests using the following function for error handling in Bash:  #!/bin/bash  # A slicker error handling routine  # I put a variable in my scripts named PROGNAME which # holds the name of the program being run.  You can get this # value from the first item on the command line ($0).  # Reference: This was copied from <http://www.linuxcommand.org/wss0150.php>  PROGNAME=$(basename $0)  function error_exit {  #   ---------------------------------------------------------------- #   Function for exit due to fatal program error #       Accepts 1 argument: #           string containing descriptive error message #   ----------------------------------------------------------------       echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2     exit 1 }  # Example call of the error_exit function.  Note the inclusion # of the LINENO environment variable.  It contains the current # line number.  echo "Example of error with line number and message" error_exit "$LINENO: An error has occurred."   Do you have a better error handling routine that you use in Bash scripts?


Find number of real roots of equation $$e^{4x} + e^{3x} – 4e^{2x} + e^{x}  + 1 = 0$$ is   what i try  $$\frac{e^{4x}+e^{3x}+e^x+1}{4}\geq \bigg(e^{4x}\cdot e^{3x}\cdot e^x\cdot 1\bigg)^{\frac{1}{4}}$$  $$e^{4x}+e^{3x}+e^{x}+1\geq 4e^{2x}$$  equality hold when $e^{4x}=e^{3x}=e^{x}=1.$  How do i solve it Without Inequality

Based on pure intuition, the root is 0. It’s very obvious. But what is the proper way to solve it? Also how do we know it’s the only possible root (the answer is 1 root only, but how can I confirm?)


I am using following webservice but my quotes are not inserting it showing an error may i know how to modify my code. for insert of quotes. Can anyone give me suggestions how to modify my code for quote insert. while inserting it showing an error opportunity Id filed missing             for(integer j=0;j<req.accounts[i].quotes.size();j++)            {             qu = new Quote();             qu.Name = req.accounts[i].quotes[j].qName;            // op.CloseDate =system.today();            // op.StageName = req.accounts[i].opps[j].oStage;             qu.OpportunityId = srList[i].id;             qList.add(qu);             }             Database.insert(qList);            }        }          return res;      } }

while working with webservice quotes are not inserting may i know what i have to do. my code is     for(integer l=0;l<reqquotes;l++){          qu = new Quote();          qu.Name = qName;          //opp.CloseDate =system.today();           qList.add(qu);             insert oppList;          insert qList;     }


How do I privately tell the mods that I think a user is using a bot-net to gain points? Is there a way to do this privately?

I have, in my view, strong, albeit circumstantial, evidence that a particular user is operating a sock puppet account. It appears not to have been detected by any automated mechanisms–both users are still here.  The individual in question is not interested in collecting lots of rep but rather uses the account to carry out prolonged vindictive down-voting attacks. The down-voting account loses rep over time (due to the down-votes) and when it gets close to falling below 125, it is topped up.  Do moderators want to hear more details (e.g. via a flag)? Or do we just accept that if the automated detection scripts don't pick it up, then there's nothing more to be done.


I'm asynchronously rendering a template serverside with  in node. At the point of rendering the body, I have a string (containing line breaks) that needs to be inserted in the document head:  // this is what I have serverside var stylestring = `<style type="text/css" data-style="some-id-that needs to be preserved"> .lfwARz {   margin-bottom: 0;   margin-top: 0; } </style>`   Since at that point I've already sent the <head> to the client, I need to insert a script that sets these styles to the head clientside. But I'm having trouble getting this to work.  This approach works:  // gets run clientside <script>   var style = document.createElement('style')   style.type = 'text/css'   style.innerHTML = '${() => sheet.getStyleTags().replace(/(\r\n|\n|\r)/gm, '').replace(/<\/?style.*?>/g, '')}'   document.head.appendChild(style) </script>   But it results in a loss of the data attribute (which I need to preserve so the styles won't get rerendered on the client).

I'm looking for a way to insert a "; document.body.appendChild(divNode);   This works in Firefox, Opera and Internet Explorer but not in Google Chrome. Also it's a bit ugly with the
 in front for IE.  Does anyone know of a way to create a


I've already read through this , and I know "OP" stands for Original Poster. Now I would like to know what is "OP" referring to for nested citation?  Assume,   asker A posted a question (question_1) where an article is cited,   and then Answerer B posted an answer to that question  and then asker C posted another question (question_2) where question_1 is cited.  Now, when answerer D use the term "OP" in answer to question_2, what is "OP" referring to?  when answerer B use the term "OP" in answer to question_1, what is "OP" referring to?

What are the common phrases, words, abbreviations that are used on Stack Overflow, Server Fault, Super User, Meta Stack Overflow, and the other Stack Exchange sites? This is meant to be a very quick overview, not an in-depth tutorial. When considering whether a term ought to be included, please use this test:  New user comes in and posts on day 1. What terminology or jargon are they likely to run into (comments, support, system messages, etc.) that cannot be understood from the context without prior experience with the site (that is, clear only if known). For example: "This is a dupe. Flag a diamond mod to close or migrate to SU." Huh? Can these instruction be made clear from the glossary? Is it clear for those for whom English is a second language?  Please:  Edit the existing answer Insert relevant links to more detailed information on the term/phrase/abbreviation Add only factual information Keep it very, very brief, terse, and to the point Delete your own comments once they become irrelevant (integrated into the glossary) Use the Edit Summary box to note reasons for your edit, not comments  Please avoid:  Opinion Using abbreviations, terms, and phrases inside a description Unverified information Uncommon terms, abbreviations, phrases Long descriptions Unnecessary detail - link to the relevant FAQ instead Citations or examples of usage Inside jokes that are not common on all of the trilogy () Common Internet jargon (that is, , , , etc.) unless usage here differs significantly  Recurring discussion: While the experiment to keep meta-discussion in the comments is going well (that is, deleting them once consensus is reached) it is clear that some discussions will be recurring, and we'll have to keep a record around so people new to the glossary can understand the consensus already reached. Add a new answer if you believe a new issue is likely to come up repeatedly. For instance, discussion about what terms to include, whether the glossary should be broken up to make linking easier, or formatting issues might be best discussed in new answer/comment posts.


The preg_match_all()-function should find all occurances of this /\]\(.*.md\)/-Expression, it does, but somehow it detects multiple matches just as one. My input looks like this:  [example](foo/random/link.md) | [example2](other/some.md) Lorem ipsum..... [example3](foo/Readme.md)   It should match the three examples-links. But it returns:  Array[0] -> ](foo/random/link.md) | [example2](other/some.md) Array[1] -> ](../Readme.md)   Although example2 should also be found. I am quite confident it is a problem with the use of .*, but I was not able to come up with something better.  P.S.: For better understanding. I am writing a php-script that translates links from markdown docs to links that are relative to the php-scripts position in the filesystem.

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


Consider the following recursive sequence:  $$ \begin{cases} f_{0}=\sqrt{12}\\ f_{n+1}=\sqrt{12 + f_{n}} \end{cases} $$  for $n \geq 0$. How can I prove that this sequence is bounded above by $4$ and thus its limit is also $4$?

(Fitzpatrick Advanced Calculus 2e, Sec. 2.4 #12)  For $c \gt 0$, consider the quadratic equation $x^2 - x - c = 0, x > 0$.  Define the sequence $\{x_n\}$ recursively by fixing $|x_1| \lt c$ and then, if $n$ is an index for which $x_n$ has been defined, defining  $$x_{n+1} = \sqrt{c+x_n}$$  Prove that the sequence $\{x_n\}$ converges monotonically to the solution of the above equation.  Note: The answers below might assume $x_1 \gt 0$, but they still work, as we have $x_3 \gt 0$.    This is being repurposed in an effort to cut down on duplicates, see here: .  and here: .


I've got Apache set up on a remote server.   Here's the contents of file /etc/apache2/sites-available/example.com.conf:  <VirtualHost *:80>      ServerAdmin admin@example.com      ServerName example.com      ServerAlias images.example.com      DocumentRoot /home/myUserName/var/www/example.com/public_html/      ErrorLog /home/myUserName/var/www/example.com/logs/error.log      CustomLog /home/myUserName/var/www/example.com/logs/access.log combined </VirtualHost>   I've set up the right "A" and "AAAA" records with my hosting provider. But when I go to http://images.example.com, I get a 403 error.  Forbidden You don't have permission to access / on this server.  Apache/2.4.7 (Ubuntu) Server at images.example.com Port 80   How do I set things up so that going to http://images.example.com lets me see the contents of /home/myUserName/var/www/example.com/public_html/?  Update  Contents of error.log:  [Sun May 20 21:37:05.305775 2018] [authz_core:error] [pid 4858] [client 2601:587:5:6a70:428d:5cff:fe71:b1e4:56518] AH01630: client denied by server configuration: /home/myUserName/var/www/example.com/public_html/ [Sun May 20 21:41:15.517163 2018] [authz_core:error] [pid 4859] [client 51.38.12.23:42405] AH01630: client denied by server configuration: /home/myUserName/var/www/example.com/public_html/ [Sun May 20 21:43:49.090780 2018] [authz_core:error] [pid 4860] [client 2601:587:5:6a70:428d:5cff:fe71:b1e4:56678] AH01630: client denied by server configuration: /home/myUserName/var/www/example.com/public_html/ [Sun May 20 21:48:59.756624 2018] [authz_core:error] [pid 4861] [client 179.127.179.39:43803] AH01630: client denied by server configuration: /home/myUserName/var/www/example.com/public_html/ [Sun May 20 21:53:22.709395 2018] [authz_core:error] [pid 4864] [client 178.73.215.171:28502] AH01630: client denied by server configuration: /home/myUserName/var/www/example.com/public_html/   Running ls -la /home/myUserName/var/www/example.com/public_html/ outputs this:  total 12 drwxrwxr-x  3 myUserName myUserName 4096 May 20 22:58 . drwxrwxr-x  4 myUserName myUserName 4096 May 20 21:32 .. drwxr-xr-x 13 myUserName myUserName 4096 Apr 14 02:18 tile

I'm getting a 403 error message with Apache, in Debian Testing.  Apache version:  # aptitude show apache2 | grep -i version Version: 2.4.9-1  # ls -la /home/  total 28 drwxr-xr-x  4 root    root     4096 Apr  3 13:19 . drwxr-xr-x 23 root    root     4096 Apr  4 07:28 .. drwx------  2 root    root    16384 Apr  3 13:13 lost+found drwx--x--x 36 username username  4096 Apr  7 13:30 username  # ls -la /home/username/Development/PHP/foo.dev.com/  total 16 drwx--x--x 4 username username 4096 Apr  3 14:35 . drwx--x--x 6 username username 4096 Apr  3 14:36 .. drwx--x--x 2 username username 4096 Apr  3 14:35 logs drwx--x--x 8 username username 4096 Apr  3 14:35 public_html  # cat /etc/apache2/sites-enabled/dev.com.conf UseCanonicalName Off  <VirtualHost *>     VirtualDocumentRoot "/home/username/Development/PHP/%0/public_html/"     <Directory "/home/username/Development/PHP/%0/public_html/">         Require all granted     </Directory> </VirtualHost>  # cat /var/log/apache2/error.log [Mon Apr 07 14:08:15.069251 2014] [authz_core:error] [pid 8649] [client 127.0.0.1:48578] AH01630: client denied by server configuration: /home/username/Development/PHP/foo.dev.com/public_html/   Firefox, "No proxy for" configuration:     localhost, 127.0.0.1, *.dev.com  # cat /etc/hosts: hosts        hosts.allow  hosts.deny root@username:/home# cat /etc/hosts 127.0.0.1   localhost 127.0.1.1   username.mymachine.local    username  # Custom 127.0.0.1   teste.dev.com  # The following lines are desirable for IPv6 capable hosts ::1     localhost ip6-localhost ip6-loopback ff02::1 ip6-allnodes ff02::2 ip6-allrouters   UPDATE 1:  SELinux does not seems to be installed:  $ aptitude search ~i | grep selinux i   libselinux1                     - SELinux runtime shared libraries   UPDATE 2:  $ ls -la /home/ total 28 drwxr-xr-x  4 root    root     4096 Apr  3 13:19 . drwxr-xr-x 23 root    root     4096 Apr  4 07:28 .. drwx------  2 root    root    16384 Apr  3 13:13 lost+found drwx--xr-x 38 username username  4096 Apr  9 08:26 username


class A {     method x() {     }      method y() {     } }  class B {     A a = new A();     String methodName = "x";     // I want to execute this statement **a.x();** }   I know the method name and I want to call the method automatically.

If I have two variables:  Object obj; String methodName = "getName";   Without knowing the class of obj, how can I call the method identified by methodName on it?  The method being called has no parameters, and a String return value. It's a getter for a Java bean.


I have no starting point on which formula to use:  One draws 5 samples from a cont. distribution. Now, what is the approx. probability p that the median of the Population falls within the smallest and largest samples drawn?** Can anybody guide me on which formula to use or if any other approach is better suited?

If I draw 5 samples from a distribution that is cont., what is the probability that the median of the population is between the xmin and xmax of the draw samples?  What is the formula to apply here?


My input String is like   abc,def,wer,str   Currently its splitting  only on comma but in future it will contain both comma and newline. Current code as below:     $scope.memArray = $scope.memberList.split(",");     In future I need to split on both comma and newline what should be the regex to split both on comma and newline. I tried - /,\n\ but its not working.

How do I split a string with multiple separators in JavaScript? I'm trying to split on both commas and spaces, but AFAIK JavaScript's split() function only supports one separator.


I have a lot (~100) of TikZ plots, autogenerated with a .  I want to resize the font of the plots, because it is currently too large. I googled a bit, and found some answers (even from this stackexchange). None of them seems to apply to my case.  I have tried \scalefont and \small so far.  A typical .tikz file is like this:  \begin{tikzpicture}   \begin{axis}[%      width=\figurewidth,      height=\figureheight,      scale only axis,      xmin=0.6,      xmax=1.4,      xlabel={$\text{S/S}_{\text{mindrag}}$},      ymin=74000,      ymax=94000,      ylabel={b},      title={$\text{M}_{\text{des}}\text{ =0.77 AR =9.3}$}    ]   % Tons of lines...   \end{axis} \end{tikzpicture}%   What I have is:  \begin{figure}[htbp]   \centering   \subfloat{\input{plots/WTO_plot_1_1.tikz}}   \subfloat{\input{plots/WTO_plot_1_3.tikz}}   \subfloat{\input{plots/WTO_plot_1_5.tikz}}\\    \subfloat{\input{plots/WTO_plot_3_1.tikz}}   \subfloat{\input{plots/WTO_plot_3_3.tikz}}   \subfloat{\input{plots/WTO_plot_3_5.tikz}}\\    \subfloat{\input{plots/WTO_plot_5_1.tikz}}   \subfloat{\input{plots/WTO_plot_5_3.tikz}}   \subfloat{\input{plots/WTO_plot_5_5.tikz}}\\    \caption{MTOW}   \label{figs} \end{figure}   I am looking for a "global" solution, one which does not need to edit every single file.

I have made many figures with tikz and want to include them in a template. Unfortunately I used ex as a measure and the template I have to use redefines the font size. THis leads to wrong distances in the figures. is there a way to set the font size for all tikz figures in a document, so I do not have to adjust my figures?


I am writing a thesis for which the majority of my references are in the standard style text [XX] (or text^XX, depending on citation style) achieved by doing \cite{ThingThatGivesXX}. However, for a couple of citations, I need to adapt papers I have co-written, and include the phrase Adapted from Ref. YY (without the brackets) and want to achieve it with something like \cite[special_option]{ThingThatGivesYY} but haven't had luck tracking down [special_option].  Note: XX and YY are numbers.  Edit: clarified question.  Answer: looks like what I need is Ref. \citealp{ThingThatGivesYY} to get Ref. YY for this particular special use case.   Thanks for the natbib reference

I am using natbib with superscript numbered citations as follows:  \usepackage[super,comma,sort&compress]{natbib}    It works great when I have the case This is a reference~\cite{author1999}. My reference appears as a superscript.   However, I occasionally want write something like: As shown by \citet{author1999} where I want the citation written out and not as a superscript. natbib in super mode inserts a superscript when using \citet.  Is there a way to have natbib use \citet in regular mode despite being in super mode? Can one change the mode temporarily to not have super and then switch it back on again?


Let $p$ be a prime number and $r$ an integer such that $1 \le r \lt p$. If $(-1)^rr! \equiv 1 \pmod p$, then $(p-r-1)! \equiv -1 \pmod p$  I know that $n$ is a prime if and only if $(n -2)! \equiv 1 \pmod n$ and Wilson’s theorem: $p$ is a prime if and only if $(p - 1)! \equiv -1 \pmod p$. Still I haven’t found the right relation between them.  I would appreciate some help. Thanks.

Suppose that $p$ is a prime. Suppose further that $h$ and $k$ are non-negative integers such that $h + k = p − 1$.   I want to prove that $h!k! + (−1)^h \equiv 0 \pmod{p}$  My first thought is that by Wilson's theorem, $(p-1)! \equiv -1 \pmod{p}$, and $h!k!$ divides $(p-1)!$ (definition of a binomial). Where would I go from here?


I'm looking for good online course for an introduction into theoretical electrodynamics. However, it seems that the MIT opencourseware only contains partial lectures for this topic.  Has anyone got a recommendation for me?

This is a rather broad question. Does anyone know of good video lectures for graduate level classical electrodynamics?


I'm putting together a structure to run a Rails application. The application itself runs on Heroku. However, it makes requests to a cluster, which performs the call through a program in C.  To be able to recover from crashes faster, I want to create a routine using Chef. I managed to write a "cookbook" that installs everything you need, and it works perfectly when I use a Vagrant virtual machine.  However, when I apply for a real server, it fails. Besides, I'm using Chef Solo, and I need to manually install some things on the machine before running the script, which is not very practical.  I do not know if I should take the Chef Server in this case. I'm afraid that is a "great" tool for a "small" need.  This cluster is composed of only three machines, this should not increase much. However, the application also makes requests to another cluster slightly larger (6 machines), which despite being very quick to install, could also make use of the Chef Server.  Should go with the Chef or Chef Solo Server? Is there any didactic guide about it? The developer documentation is very confusing.

I am looking at automated deployment solutions for my team and have been playing with Chef for the past few days. I've been able to get a simple web app up an running from a base Red Hat VM using chef-solo.  Our end goal is to use Chef (or another system) to automatically deploy application topologies to the cloud as we run builds. Our process would basically run like this:   Our web app code, dependencies, and chef cookbooks are stored in SCM A build is executed and creates a single package for images to acquire and test against The build engine then deploys new cloud images that run a chef client to get packages installed. The images acquire the cookbooks from SCM or the Chef server and install everything to get up and running   What are the benefits and/or use cases for getting a Chef Server running?  Are there any major benefits to have a Chef Server hold and acquire the cookbooks from SCM vs. using chef-solo and having a script that will pull the cookbooks from SCM?


Is it possible to transfer files (client-server) from inside a ssh session?.   I know how to transfer files using SCP, This question is about transference from inside a ssh session.  For example I start the ssh session:  ssh root@example.com   I perform some operations  echo "Test" > FILE   I transfer the files (pseudocode)  remotecp FILE client_directory   I want to know this because I want to make an automation script from some process (mostly backup operations) and I want to make it the most atomic way possible.

If I'm logged in to a system via SSH, is there a way to copy a file back to my local system without firing up another terminal or screen session and doing scp or something similar or without doing SSH from the remote system back to the local system?


I am trying to extract the text between two specific line numbers using  sed 'startLine,endLined' myFile.txt   But somehow it keeps extracting from the begining of the file to endLine.  What is wrong here?

I have a ~23000 line SQL dump containing several databases worth of data. I need to extract a certain section of this file (i.e. the data for a single database) and place it in a new file. I know both the start and end line numbers of the data that I want.  Does anyone know a Unix command (or series of commands) to extract all lines from a file between say line 16224 and 16482 and then redirect them into a new file?


I want to store these information into my list called QuizList.  I have the following code:  var dtm = new Date();  var itemCreateInfo = new SP.ListItemCreationInformation();  var listItem = resultList.addItem(itemCreateInfo);      listItem.set_item("Student", UserName);     listItem.set_item("TestDate", dtm);     listItem.set_item("Score", (score / testQuestions) * 100);     listItem.set_item("QuizID", currentQuizItem.get_id());     listItem.update();     context.load(listItem);  context.executeQueryAsync(function () {         $('#TestUI').fadeOut(500, function () { $('#TestReport').fadeIn(500, null)   How can I save these information into my QuizList? Any suggestion?

I have a quiz in SharePoint.   It works perfectly but what I want is:   After a student have taken the quiz, I would like a list named quizlist to store information for the users who has taken the quiz to show what the score he/she got and to show the user name.  How can I do this?


Can the face of a person be accurately rendered just from analysing a DNA sample of that individual?

In light of the , I'm curious if enough information can be teased out of a DNA sample to get a "reasonable" approximation of the suspect (never mind the legality). I realize the term reasonable is subjective, so characteristics, such as skin color, hair color/texture, approx height, eye color, freckles, etc. I came across  article a few years ago, but the company that made the test went bust in 2009. It could detect race (how accurately?). I seem to recall reading an article a few years ago stating that "soon" we'd be able to get an approximation of appearance from a DNA sample that was better than a sketch artist could provide, though I can't recall now where I read it.


Hello Stackoverflow users, Why it is recommended to not exceed 80 chars in python code ? I feel like it's completely useless, but someone told me it was important for some reason, what are these reasons and is it really important ? Thank you in advance.

Why in this millennium should Python  specify a  of 79 characters? Pretty much every code editor under the sun can handle longer lines.  What to do with wrapping should be the choice of the content consumer, not the responsibility of the content creator. Are there any (legitimately) good reasons for adhering to 79 characters in this age?


An electron (negative charge) and a positron (positive charge) annihilate in pure energy. For an electron and a proton it is all similar, the different charge, the mutual attraction and the emission of EM radiation. What is the mechanism by which an electron and a proton do not annihilate, but stop their approach at some distance? To confine the answers, please do not refer to statements such as that the calculated energy levels are stable states. This is a consequence of the initial observations; the corresponding calculations only reflect the observations.

How do these particles exchange information about charge and position between themselves, even though there's mostly empty space between them?  Also what happens if a free electron passes closer to a nucleus of a hydrogen atom than its own electron?   My random guesses so far:   Proton won't react because it's somehow locked with its existing electron Proton will catch it and release the previous one  Proton will catch it and keep both of them with half the force Existing electron will simply repel incoming one Something else?


I'm very new at VBA and I can't seem to solve this problem. It seems like it should be an easy problem to fix, I just don't know how. I've looked around on the web, but the question remains unsolved.  So what the code does: In the main form is a record. This record will be copied to another table bij pressing a button on the form. Before the copying begins, the code checks first if the 'OMnummer' has been filled in in the subform. If not, a message box appears saying that the user should fill in the subform and the code stops running.   Secondly the code checks if the record is allready present in the other table. If so, a messagebox appears and the record will not be copied. If not, the record will be copied to the other table.   Both pieces of code work ok seperately. However, when I try to include both pieces in the same private sub, only the first one works. It may be something with the 'Exit Sub' code or I am not using the If - Then right.   Really hope you can help me! Monika   Private Sub KnopProjectVersturen_Click() On Error GoTo ErrProc   'This is the first part of the code checking if the subform has been filled in  If IsNull(Me!Subform_OMnummers.Form!Omnr) Then If MsgBox("Vul het OMnummer in. Je kan het project niet exporteren zonder OMnummer.")     Then Exit Sub    'This is the second part of the code, checking if the record exists in the other table and then copying part of the record  DoCmd.OpenQuery "Qry_Depo_ControleAanwezig" If DCount("Deponering.projectnummer", "Qry_Depo_ControleAanwezig") = 0 Then     DoCmd.SetWarnings False     DoCmd.OpenQuery "Qry_projectnaarDepot"     DoCmd.OpenQuery "Qry_ToevoegProjectDepot"     DoCmd.OpenForm "Depot_uitvoer", , , "[Projectnummer] = '" & Me![Projectnummer] & "' And [subID]=[subID]"     Me.Status = 8     DoCmd.Close acQuery, ("Qry_Depo_ControleAanwezig")     DoCmd.SetWarnings True  Else     MsgBox "Dit project bestaat al in de Depot_Uitvoer, verander de status in het projectformulier", vbInformation, "Example"     DoCmd.Close acQuery, ("Qry_Depo_ControleAanwezig")  End If End If End If    'Als er fouten zijn laat deze code een messagebox zien met het nummer en de melding.  ExitProc:  Exit Sub  ErrProc:  Select Case Err.Number  Case Else     MsgBox Err.Number & "--" & Err.Description     Resume ExitProc     End Select  End Sub

I'm very new at VBA and I can't seem to solve this problem. It seems like it should be an easy problem to fix, I just don't know how.   So what the code does: In the main form is a record. This record will be copied to another table bij pressing a button on the form. Before the copying begins, the code checks first if the 'OMnummer' has been filled in in the subform.  If not, a message box appears saying that the user should fill in the subform and the code stops running.   Secondly the code checks if the record is allready present in the other table. If so, a messagebox appears and the record will not be copied. If not, the record will be copied to the other table.   Both pieces of code work ok seperately. However, when I try to include both pieces in the same private sub, only the first one works. It may be something with the 'Exit Sub' code or I am not using the If - Then right.   Hope you can help me!  Monika   Private Sub KnopProjectVersturen_Click() On Error GoTo ErrProc  If IsNull(Me!Subform_OMnummers.Form!Omnr) Then  If MsgBox("Vul het OMnummer in. Je kan het project niet exporteren zonder OMnummer.")     Then       Exit Sub      DoCmd.OpenQuery "Qry_Depo_ControleAanwezig"  If DCount("Deponering.projectnummer", "Qry_Depo_ControleAanwezig") = 0 Then         DoCmd.SetWarnings False         DoCmd.OpenQuery "Qry_projectnaarDepot"          DoCmd.OpenQuery "Qry_ToevoegProjectDepot"         DoCmd.OpenForm "Depot_uitvoer", , , "[Projectnummer] = '" & Me![Projectnummer] & "' And [subID]=[subID]"     Me.Status = 8     DoCmd.Close acQuery, ("Qry_Depo_ControleAanwezig")     DoCmd.SetWarnings True  Else         MsgBox "Dit project bestaat al in de Depot_Uitvoer, verander de status in het projectformulier", vbInformation, "Example"         DoCmd.Close acQuery, ("Qry_Depo_ControleAanwezig")     End If  End If  End If    'Als er fouten zijn laat deze code een messagebox zien met het nummer en de melding.  ExitProc:  Exit Sub  ErrProc:     Select Case Err.Number     Case Else         MsgBox Err.Number & "--" & Err.Description         Resume ExitProc         End Select End Sub


bash completion is not working with a vnc connection. I works if I login with ssh, but not with xterm/bash in a vnc connection. I tried with different display managers and with different machines, no solution. I checked .bashrc - it is enabled. I have no idea where to look now.

I'm using Xubuntu and connecting over RemoteDesktop with Windows 7.  Everything works fine, but the auto_completion in my bash doesn't work. I checked the .bashrc file in my home directory and also the /etc/bash.bashrc.  I uncommend the lines below in my local bashrc configuration and also in bash.bashrc, but nothing changes.  if ! shopt -oq posix; then   if [ -f /usr/share/bash-completion/bash_completion ]; then     . /usr/share/bash-completion/bash_completion   elif [ -f /etc/bash_completion ]; then     . /etc/bash_completion   fi fi


I have to find the minimum value of the expression  $$\frac{2 - \cos x}{ \sin x}$$ Also $x$ lies between $0$ to $\pi$. One way is to find the minima using differentiation. But it is not taught in my grade so my teacher asked me to do it without differentiation.  Here's what I did   Let$$\frac{2 - \cos x }{ \sin x} = y~,$$ so that $$ (2-y \sin x)^2 = 1 - \sin^2(x) \\ \implies \sin^2(x) \cdot (y^2 +1) - 4 y \sin x +3=0$$  Now I am struck. I tried using Discriminant $\ge{0}$ but no use as our variable $\sin x$  lies between $0$and $1$. Please help.

I've tried substituting $1+\cos\theta=2\cos^2(\frac{\theta}{2})$ but it didn't give me the answer.


I am looking for a particular linguistic term for this process of turning words like hot into words like heat. English has a bunch of pairs like these:  Hot -> heat Whole -> heal (Folk)lore -> learn Dole -> deal? Token -> teach?  What is going on there? What does it mean?

"Foot" is a curious word in English because it is pluralized in an unusual way; the "oo" in the word is changed to "ee".  Did this once use to be a standard way of pluralizing things in English (or a language that contributed to English), which would mean that the plural of "book" was "beek" instead of "books"?  Or, is "feet" just a one-off?


I have a little problem with netbeans and SQL Developer. Failed to move to sql date Date. Netbeans freezes :S the above error was the casting of date to sql.date.   Any solution? brings me crazy.  I attached pieces of my code and see if you can help me. (i use jDateChooser)    Main:   java.util.Date d = FechaEntrada.getDate(); java.sql.Date fecha = new java.sql.Date(d.getDate());           Entrada ent= new Entrada(Integer.parseInt(idEntrada.getText()),                 Integer.parseInt(idTaquilla.getText()),                 Integer.parseInt(Cantidad.getText()),                 fecha,                 Integer.parseInt(pPrecio.getText()));              CrudEntrada.create(ent);                       Crud:    public static boolean create (Entrada entrads) {                  String sql = "INSERT INTO ENTRADA VALUES (?, ?, ?, ?, ?)";  int nFilas = 0;                  try {    PreparedStatement pstm = ConnectDB.conectar().prepareStatement(sql);                           pstm.setInt(1, entrads.getId_entrada());    pstm.setInt(2, entrads.getId_taquilla());    pstm.setInt(3, entrads.getCantidad());    pstm.setDate(4, entrads.getFecha());             pstm.setDouble(5, entrads.getPrecio());                                                                               nFilas = pstm.executeUpdate();    .     .    .    .             return (nFilas > 0) ? true : false;         }

I am trying to use a  as input and then creating a query with it - so I need a .    I was surprised to find that it couldn't do the conversion implicitly or explicitly - but I don't even know how I would do this, as the Java API is still fairly new to me.


My Linux version is 2.6.32-47-server (gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5.1) ) #109-Ubuntu SMP Tue May 7 02:17:05 UTC 2013  I am currently doing a tail -f file  and life is good. But that only shows the last X lines. Is it possible for tail to first display the whole file and then behave like tail -f?  I tried tail -500 -f file but that gave me tail: option used in invalid context -- 1 In a sense, it would be like cat file; tail -f file; But showing only the lines that were not displayed since the cat  Is it possible?

I need to display whole file before tracking it for a new changes, not only the last 10 lines (yep, I know it's not tail conceptually). In other words, something like cat -f would do, if it would ever existed. Tail's man doesn't give me any ideas. The only option I see right now is to somehow combine cat all but last 10 lines and tail -f output.  Any hints, please?


At least I think what I'm referring to is a delegate. Here's my scenario  bool allow_login;  StationDC.Load(query, p => {     if (p.Entities.SingleOrDefault(q => q.Category == "Site Status").Value == "Offline") allow_login = false;     else allow_login = true;  }, true);   I still only barely understand what's actually going on here, but from what I do know the delegate I'm passing to StationDC.Load runs asynchronously, even if on the same thread. I'm confused though that I can access the boolean allow_login since I always thought delegates were more like a separate method, so should be in a different scope. Anyone have some insight as to what's going on under the hood here? How is my boolean persisting to still be around when my delegate is called?

What is a closure? Do we have them in .NET?  If they do exist in .NET, could you please provide a code snippet (preferably in C#) explaining it?


I have two creatures and barrage of expendables on the battlefield. My opponent casts a spell with the effect: "Each opponent sacrifices a creature" Can I choose to sacrifice creature 1, then before my opponent's spell resolves, sacrifice creature 1 as the cost for barrage of expendables, thus resulting in only having lost creature 1?

Say I have a Zombie token, , and  on the battlefield. Can I sacrifice the Zombie token to activate both the Altar's and Seer's abilities?  Similarly, if I have one card in hand, and  and  on the battlefield can I discard the one card to both of their abilities?  If I have a  with 3 charge counters can I activate both of its abilities by tapping it to add a counter, and tapping it to remove 3 counters and destroy a permanent without untapping it in between?


I have some old Windows 95-98 era PCs that I would like to recover data from if possible. They have all had the hard drive partitions deleted using 'fdisk' and have not been used since. Would it be possible to recover any data and, if so, what would be the safest ways to go about attempting this?

What steps can I take to try to recover lost or inaccessible data from any storage device?  Answers:   This applies to any computer storage device, e.g. internal/external hard drives, USB sticks, flash memory. The most important thing is to STOP using it, any type of I/O can ruin your chances of a recovery.     We have separate questions covering common problems with USB flash drives in greater detail:


Usage of this code is to show only the last four digits of an input.  Here I want to replace this "(/.(?=.{4})/g, '*')" '4' with variable 'mask' . Something like that.  x.value = x.value.replace(/.(?=.{+mask+})/g, '*');   Any suggestion plz    function myFunction(mask) {     var x = document.getElementById("cc");     x.value = x.value.replace(/.(?=.{4})/g, '*'); } <input type="text" id="cc" onkeyup="myFunction(4)" style="text-align:right">

I would like to create a String.replaceAll() method in JavaScript and I'm thinking that using a regex would be most terse way to do it.  However, I can't figure out how to pass a variable in to a regex.  I can do this already which will replace all the instances of "B" with "A".  "ABABAB".replace(/B/g, "A");   But I want to do something like this:  String.prototype.replaceAll = function(replaceThis, withThis) {     this.replace(/replaceThis/g, withThis); };   But obviously this will only replace the text "replaceThis"...so how do I pass this variable in to my regex string?


I have a question and cannot figure out.  It is Solaris. the over simplified source & reference files.  s.txt source file:  dn: cn=task,cn=Groups,dc=domain  changetype: modify  add: uniquemember  uniquemember: cn=user1,cn=users,dc=domain  dn: cn=task,cn=Groups,dc=domain  changetype: modify  add: uniquemember  uniquemember: cn=user9,cn=users,dc=domain  dn: cn=task,cn=Groups,dc=domain  changetype: modify  add: uniquemember  uniquemember: cn=user10,cn=users,dc=domain   r.txt reference file:   uniquemember: cn=user9,cn=users,dc=domain  uniquemember: cn=user8,cn=users,dc=domain   I'd want a script for using the reference record uniquemember file to extract the source file's cn=user9's line and 3 lines Above,  add to a result file usermember_  add.ldif:  dn: cn=task,cn=Groups,dc=domain  changetype: modify  add: uniquemember  uniquemember: cn=user9,cn=users,dc=domain

grep returns just the line where it matched the regex and often what I want to really see is a few (say 2) lines above and below the matched one. Is there a simple way to achieve it?  EDIT: OS: Ubuntu based Bodhi Linux.  As mentioned in comments, -C does not work in vanilla but its GNU grep in my case.


Find the equations of both of the tangent lines to the ellipse $x^2+4y^2=36$ that pass through the point $(12,3)$.   Finding Slope  The derivative of $x^2 + 4y^2 = 36$ is $y'= -\dfrac{x}{4y}$.  Finding arbitrary point where tangent line is at  If I arrange the equation $x^2 + 4y^2 = 36$,  $$y= \pm\frac{\sqrt{x^2+36}}{2}$$  Let $(k, \pm\frac{\sqrt{k^2+36}}{2})$ be the point where tangent line is at. Thus the tangent line slope at that point is $$-\frac{k}{4\left(\pm\frac{\sqrt{k^2+36}}{2}\right)}$$  Equation of tangent line is  $y-y_0 = m (x-x_0)$  Let $(k, \pm\frac{\sqrt{k^2+36}}{2})$ be $(x_0, y_0)$.  Let $(12,3)$ be $(x,y)$  $$12-k = -\frac{k}{4\left(\pm\frac{\sqrt{k^2+36}}{2}\right)}\left(3- \pm \frac{\sqrt{k^2+36}}{2}\right)$$  And I'm stuck here. It gets really confusing?

I was solving a few problems from a textbook and I came across this one:     Find the tangent lines to the graph of $x^2+4y^2 = 36$ that go through   the point $P=(12,3)$   I could find the tangency points $$ but my solution was completely messy (I had four equations that I had to go back-and-forth with.  Is there an elegant/simple solution to that?  Tangency points:  $$P_1 = (0,3)$$ $$P_2 = \left( \frac{24}{5} , 3-\frac{24}{5} \right)$$


This is a layman's question. The only thing I know about quantum physics is from casual reading and documentaries. I can imagine electrons being probabilistic waves. Their position is an infinite number of weighted points and only upon observing the actual position do we know which of those points was its actual position.  I program in Haskell so I imagine the concept as laziness. Only upon actually needing the information, we get it.  But what does observing actually mean? In Haskell I can treat a lazy value as if it were already there and manipulate it as such. One way of starting the actual evaluation is by printing some value, this then causes all the values that are depended on to also evaluate, then all the ones those depended one and so on.  I figure the universe isn't that human centric and "observing" means something other than actually seeing something, but the quotes like "I like to imagine the Moon being there even when I'm not looking at it" make me wonder.

Fundamental notions of QM have to do with observation, a major example being The Uncertainty Principle.    What is the technical definition of an observation/?  If I look at a QM system, it will collapse. But how is that any different from a bunch of matter "looking" at the same system?  Can the system tell the difference between a person's eyes and the bunch of matter?  If not, how can the system remain QM?  Am I on the right track?


Define an equivalence relation $\sim$ on $\mathbb{R}$ by $x\sim y\leftrightarrow x-y\in\mathbb Q$. Write $\mathbb R/\mathbb Q$ for the set of equivalence classes under $\sim$. If we assume the axiom of choice, then a choice function on $\mathbb R/\mathbb Q$ would be an injection from $\mathbb R/\mathbb Q$ into $\mathbb{R}$. On the other hand, it is consistent that, without the axiom of choice, no such injection exists (for example see the accepted answer ). I am curious about the other direction. What can we say about the other direction? With the axiom of choice, as in the accepted answer , we have an injection from $\mathbb R$ into $\mathbb R/\mathbb Q$. Is AC necessary for this? In other words, without the axiom of choice, can we have an injection from $\mathbb R$ into $\mathbb R/\mathbb Q$?

This is a response to the following exchange at    [Bill constructs a $\aleph_0$ linearly independent set in $\Bbb R$]  Can you extend the idea of this proof to get the right dimension? Currently, you only have a countably infinite independent set, but the dimension is size continuum. –   I believe the answer to this question is no, for the following reason. Suppose we have a spanning set for $\Bbb R$ over $\Bbb Q$, of cardinality $\frak n$. Then by definition we have the cardinality equation ${\frak c}\le^*[{\frak n}]^{<\omega}\cdot \aleph_0$ (where $[{\frak n}]^{<\omega}$ is the cardinality of finite subsets, and $\frak m\le^*n$ means there is a surjection from $\frak n$ to $\frak m$). If $\frak n$ is finite, then we get ${\frak c}\le^*\aleph_0$ which is false, so $\frak n$ is infinite (but not necessarily Dedekind-infinite). If we assume the axiom of choice, then the equation reduces to $\frak c\le n$, hence every Hamel basis is size continuum. But without AC I don't know any way to simplify the original equation to get anything stronger than "$\frak n$ is infinite". This is at best heuristic evidence for the original question, since it is considering a different problem (spanning sets instead of linearly independent sets). How could one show that there are no ZF-constructible $\Bbb Q$-linearly independent subsets of $\Bbb R$ of cardinality continuum?


Studying capacitors, this question struck me. If we know that there is a large potential difference between the ground and the atmosphere, why dont we use that to power our machinery? I understand that lightning is the result of breakdown of the dielectric(air). Why dont we utilize this energy instead of letting it get neutralized into ground?

I would like to update my knowledge in this area, that is really out-of-dated and stopped somewhere like ten years ago.  I asked the very same question on my physics lecture at my studies and got the answer, that although some tests and experiments were made (by French scientists?), there is no material, either natural or man-made, that would suffer direct lightning hit and therefore could be used to "capture" and store energy from lightning, for future use or processing of any kind.  Can someone tell me, how does it looks now? Has anything changed during last ten years in this area?


Describing the typical Twitter user:     I criticize what you wrote/have written and then I block you, without   waiting for your reply.   Which one is correct? Thank you.

Non-native speakers often get confused about what the various tenses  and aspects mean in English. With input from some of the folk here I've put together a diagram that I hope will provide some clarity on the matter.  I offer it as the first answer to this question. Consider it a living document. Input is welcome, and good suggestions will be  incorporated into the diagram.    Nota bene: What this is not is a discussion of whether there are  more than two tenses in English. , to which this question is not intended to supply arguments one way or the other.  Here, the aim is to provide an overview of what constructions English-speaking people use for conveying information about actions referring to past, present, and future, and to provide it first and foremost to precisely the people who are likely to use "tense" as a catch-all term in their search, rather than to linguists who know better.  Breaking News There is now an excellent ELU blog article titled  . It is highly recommended reading.


I am currently using a Boolean Modifier to animate half of object to disappear. I have already tried a fading away affect with a transparent Shader, but it takes about 5 hours to render each frame doing it that way.  Anyway, this is what happens when I render it. This is a quick test one, in low quality.  I am using cycles Render.

I'm trying to model an , but it's not going so well when it comes to the magazine of the weapon.   Next to the magazine is a mesh. I want to cut holes in the mag with that mesh. But the magazine just goes invisible or connects with the mesh when trying to execute the Boolean Modifier. I have tested to invert the normals and some other stuff, but it isn't working.


I want to make a toggle button that hides/shows cube objects. but this seems not to be working. Here is my code: import bpy if bpy.data.objects['Cube'].hide_set == True:     bpy.data.objects['Cube'].hide_set(False) else:     bpy.data.objects['Cube'].hide_set(True)

In my plugin I have an operator that needs to iterate through potentially 100's of objects that might be 'hidden in viewport' or 'disabled in viewport' and perform some operations  that require the object to be visible in viewport. Afterwards I want to restore whatever visibility the object had, so I need to both get and set these options.  IE, get/set the status of these. When I hover over the icons, both show the parameter bpy.context.object.hide_viewport. Obviously they can't both be the same parameter as they both do different things. How do I get and set 'hidden in viewport' and how do I get and set 'disabled in viewport' using the Python API? Edit: I can see that both ObjectBase(bpy_struct) and Object(ID) have the hide_viewport property, however ObjectBase is documented as 'Temporarily hide in viewport' and Object is documented as 'Globally disable in viewports'. How do I access an Object's ObjectBase?


There is weird candidate information block on the :    Whole block is grayed, no information, no up/down-vote button, score is missaligned etc ... What's going on here? If that candidate is removed from election, can we show more obvious information in that block? Or even do not show that candidate at all.

There seems to be a lot of candidate attrition right at the beginning of the primary voting (over 10% in a few hours time).  The faded text is distracting in an already long page.  If we have to have them on the page, can we at least sort them to the bottom of the page?


There must be thousands of people in the same situation as me, so I find it hard to believe there isn't a solution.  But I've looked all over and have come up dry.  My elderly Dad got an iPad and is having trouble with it.  He's no dummy, but iOS is new to him and he's not good at describing his problem and what he's seeing to me, 1100 miles away.  I'm sure I could help him if I could just see what he sees.  I had installed LogMeIn on his laptop, and could remotely control and view his screen when he had problems.  I know iOS is different and has different levels of sandboxing and other protection from Windows.  But is there any way to remotely view a WiFi-connected iPad, without jailbreaking?  If not, this seems like a great opportunity for an app developer, or maybe Apple if things are too locked down for a 3rd party app.

I would like to know, is there a way to control your iPad with your Mac remotely (be able to see and manipulate iPad's desktop on your Mac)? I know that with the TeamViewer or other programs you can control your Mac with your iPad but not vice versa.


What happened to the Death Eaters after the Battle of Hogwarts?  Were they pardoned?  Imprisoned?  Stripped of their positions at the Ministry?  Have they fled from Great Britain?

After the downfall of Voldemort, what happened to the Death Eaters?  They committed many crimes, including mass murder and torture. Nothing in the books made mention of their punishments. What happened?


So, I have this lit up ball on a black background.    The background needs to be black, and i would like a sort of haze around the ball. Other questions did not solve my problem. I was thinking something with a volume scatter node, but i tried it and it doesn't work with a black background.  Here's the world setup:   So, yeah. Any help would be great. Thanks!

I am trying to figure out how to make the space around the sun glow and than fade away into darkness.  The sun was made in blender using cycles render and several noise textures. The glow I have around my sun was made using Blenders Gurus tutorial for earth, atmosphere effect, to create a red glow. The sun will be animated so using composition is not going to work for me (sadly);  I realized one of the reasons why the method is not working is I am using surface rather than a volume shader, but As I tried to do it using volume shaders, I could not figure out what direction to take.


I have cmd1 and cmd2.  cmd1 && cmd2 will not run cmd2 if cmd1 fails.  cmd1 || cmd2 will run cmd2 if cmd1 fails  How do I run cmd2 regardless of whether cmd1 succeeds or not?

Currently I have a script.sh file with the following content:  #!/bin/bash wget -q http://exemple.com/page1.php; wget -q http://exemple.com/page2.php; wget -q http://exemple.com/page3.php;   I want to execute the commands one by one, when the previous finishes. Am I doing it in the right way? I've never worked with Linux before and tried to search for it but found no solutions.


I am clear with the idea that holes move in direction of electric field because of motion of bound electrons that get just some energy to jump into next hole.But i am confused with giving holes a positive charge.  I understood that in intrinsic semiconductor removal of electron is associated with less screening of some protons so their is a positive charge effect that can be made associated with location where electron left i.e hole ,so some people and textbook say hole has a net positive charge.like this shown in my book and answered to question      But my question is if we apply this positive charge to hole in p type semiconductor then semiconductor is no more neutral that is a contradiction to property given in my textbook.Please consider explaning how in this case we can assiciate the hole with a positive charge.  In this above picture we can see how neutral charge of semiconductor is affected when we associate postive charge with holes.(Note in picture already 10 protons are screened with 10 electrons so it shows +4)  picture of textbook that says semiconductor should be neutral.

Some electronics textbooks seem to refer to holes as just a construct, while solid state physics textbooks seem to imply that holes are a very real thing. I understand that holes are vacancies (p-n junctions) that move towards the cathode while electrons move towards the anode, however, is a hole a real thing, or is it just a construct? I just want to think of it as a construct but I want to hear the general consensus. For example, recombination occurs in a semiconductor when an electron fills a hole.  What exactly is meant, then, when a photon is absorbed in semiconductor (e.g. a silicon p-i-n photodetector absorbs a lower-energy visible red photon about 400 nm within its band gap energy). When the semiconductor absorbs the photon, it cannot simply convert to an electron because charge, spin and lepton number would be violated. Is it converting into an electron and hole, and is a hole an actual, elemental particle? Does it make sense that an electron and hole move in opposite directions towards the anode and cathode, respectively, when radiative absorption occurs?


Im using Cycles renderer and there is no reflection when I render the image I ve been searching for solutions but I couldnt find any, Im using Blender 2.83 This is how it looks in the viewport  This is how it looks when I render it  This is the material  And these are the render settings

I want to export my objects to unity, but in blender I`m using Eevee engine. However the light in rendered more and material preview mode is completely different, which impacts the colors of objects. Which one can i trust to see the true final colors of the objects so that they will be the same when i export them to unity?


There have been a  of  here on meta asking about changing questions to fit existing answers.  However, this presupposes the existence of a question for which there exists a question/answer mismatch.  I am wondering if it is ever okay to go somewhat beyond this and contrive a question to which a known answer will be given.    For example, I was recently  and although I could unit test my small piece, I could not end-to-end test the solution because I was missing some of their precursor code.  They then .  It occurred to me that since that bit of information is useful to me, and is useful to them, and seems a priori to possibly be useful to others, then as an answer to an implied question in the comment thread, namely "how to transform a square-pixel image into a hex-pixel image?", that such a question might deserve to be asked.  Presumably, the other user in the comment thread would then provide an essentially ready-made answer to that question.  So, how does the meta community feel about this type of behavior?  Are there any psychological pitfalls I might fall into by practicing this sort of thing?  Are there any sociological pitfalls that might emerge by encouraging this sort of thing?

I might want to answer my own question because:  I arrived at a solution before there were any other correct answers or I like mine better, can I still answer my own question?  I have a folder with lists of code snippets for things I always forget or get wrong, such as regular expressions for processing XML, common WinForms control idioms, etc. Is it considered poor etiquette for Stack Overflow to ask a question I already know the answer to, and then self answer, just so it gets recorded on the website?   Related:          For more information, see "" in the .


I was working with some computer vision source code I found and didn't realize that it creates a cache file that has a VERY LONG name and now I can't delete the 2 of them. I tried to rename it to a shorter name but I can't do anything to the file, I also tried to restart my computer and see if it would just go away. The error message says:  Destination Path Too Long. The file name(s) would be too long for the destination folder. You can shorten file name and try again, or try a location that has a shorter path.   How can I delete the files in this case?

Windows seems to have a length limit on file names when trying to delete, though it won't prevent those files from being created.  Our build process creates a number of temporary files (many build off of a WSDL) that run afoul of this limit.  Our ant script is somehow able to delete them when doing a clean, but sometimes I need to delete the workarea directory (where all the temp files go) without actually doing a full clean from ant.  This is the same errors , but the answers there don't really work for me as I'm dealing with a directory, not a file, and I don't always know what specific files or subdirectories are causing the problem.  And I'm trying to avoid any manual process (other than triggering a single command) to actually delete them.  If I try deleting the directory from Explorer I get the error   Cannot delete [file name]: The file name you specified is not valid or too long.   Specify a different file name   Trying Remove-Item in powershell gives the following error:  Remove-Item : The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. At line:1 char:12 + Remove-Item  <<<< -force -Recurse <directory>   Does anyone know of any tools or easy ways to get around this delete error without having to manually find the problem files and move/rename them?


How can you create a keyboard shortcut to bring up the Finder, as if you had clicked on the Finder on the Dock?

Is there a default keyboard shortcut to start a new Finder window? If not, is there a way to assign one?  I tried System Preferences > Keyboard > Shortcuts > App Shortcuts and created a new item for Finder, and assigned shift-command ⌘-F, among other things, but nothing worked.


I would like to clarify how  can/should be used in practice, and how to interpret the statistical significance given by the test.  Also, I would like to fill this table with things like "we don't know" or if we know something, what do we know (It will for sure not be causality, but maybe something else?).                          X Granger cause Y sig.   X Granger cause Y not  Y Granger cause X sig.                     ...                     ...  Y Granger cause X not                      ...                     ...

I'm trying to educate myself on Granger Causality. I've read the posts on this site and several good articles online.  I also came across a very helpful tool, the , that allows you to enter your time series and calculate the Granger Stats.  Below, is the output from the sample data included on the site. I have also taken a crack at interpreting the results.   My Questions:     Is my interpretation directionally correct?   What key insights have I overlooked?   Also what is the meaning and interpretation of the CCF charts?  (I'm assuming CCF is cross correlation.)     Here are the results and plots that I have interpreted:  Summary of computational transaction Raw Input   view raw input (R code) Raw Output  view raw output of R engine Computing time  2 seconds R Server    'Herman Ole Andreas Wold' @ wold.wessa.net  Granger Causality Test: Y = f(X) Model   Res.DF  Diff. DF    F   p-value Complete model  356          Reduced model   357 -1  17.9144959720894    2.94360540545316e-05  Granger Causality Test: X = f(Y) Model   Res.DF  Diff. DF    F   p-value Complete model  356          Reduced model   357 -1  0.0929541667364279  0.760632773377753       My interpretation:    Test was based upon 357 data points and was performed with a lag value of 1 The p-value of 0.0000294 means I can reject the null hypothesis that x does not cause y for the Y = f(x). The p-value of .76 allows me to accept the null for X = f(Y) The fact that first hypothesis was rejected and second accepted is a good thing  I'm a little rusty on my F-test so I don't really have anything to say on this for now. I'm also not sure how to interpret the CCF graph.   I really appreciate it if any of you who are well versed with Granger-causality could let me know if I'm interpeting this correctly and also fill in some of the blanks.   Thanks for your help.


I have a simple visualforce page that is meant to give a location for admins to disable a trigger and schedule a batch. I have not been able to get any test coverage when I run the test. I've ran the same tests in a developer org as part of a package and got 100% coverage. I added it to another orgs sandbox to push it up to production, and when I run the test I don't even get a response that a test has been ran. Any ideas what is missing?  Controller  public class CMRulesController {  public CM_Rule_Settings__c sett {get; set;}   public CM_Rule_Triggers__c settTrig {get; set;}    public CMRulesController(){     this.sett = CM_Rule_Settings__c.getOrgDefaults();     this.settTrig = CM_Rule_Triggers__c.getOrgDefaults(); }  public PageReference saveSett() {     //update sett;     CM_Rule_Settings__c settOld = CM_Rule_Settings__c.getOrgDefaults();      upsert sett;     // upsert settTrig;     return Page.CMRulesSettings; }  // schedules hourly batch job for CM Rules public void scheduleCMRules(){     CMRuleBatch batchable = new CMRuleBatch();     String CRONSTRING = '0 0 * * * ?';     System.schedule('CM RULE BATCH_'+System.today(), CRONSTRING ,batchable);  }     }   Test Class  @isTest public with sharing class TestCMRulesController {  public static testMethod void settingsTest(){      CM_Rule_Triggers__c settTrig = new CM_Rule_Triggers__c();     settTrig.name = 'Trigger Setting';     settTrig.Enable_Email_Summary_Rollups__c = TRUE;     insert settTrig;      CM_Rule_Settings__c sett = new CM_Rule_Settings__c();     sett.Name = 'CM Rule Configuration';     sett.Batch_Size__c = 35;     sett.Last_Run_Batch_Date_Time__c = datetime.parse('10/6/2019 12:00 AM');     insert sett;      CMRulesController cmr = new CMRulesController();        test.startTest();     cmr.SaveSett();     cmr.scheduleCMRules();      List<CM_Rule_Settings__c> t = CM_Rule_Settings__c.getAll().values();     boolean bSize = null;     if(t[0].Batch_Size__c == 35){         bSize = true;     }     system.assertEquals(bSize, True);      test.stopTest();  }     }

This is a canonical question and answer developed by the community to help address common questions. If you've been directed here, or your question has been closed as a duplicate, please look through the resources here and use them to shape more specific questions. To browse all canonical questions and answers, including more unit test resources, navigate to the  tag.  This canonical question is intended to address several classes of common questions by providing a quick summary and links to comprehensive resources:   How is code coverage obtained and calculated? How do I increase my coverage?  Why can't I cover these lines? Why isn't the body of my loop or conditional statement covered?


I don't know how I did this. Can someone explain. Is this lighting? shading? why the extreme black and how do I fix this? Thank you. Cheers!

While rendering a mesh with smooth shading on, I get a dark region/shadow on certain faces. The effect is more evident when smooth shading is applied to a mesh containing ngons, with the ngons turning black when rendered.   The blackening effect is visible in the viewport too.  How can I solve this problem?


How to find 100 consecutive composite numbers? After many attempts I arrived at the conclusion that to find $m$ consecutive composite numbers we can use this $n!+2, n! +3, ..., n! + n$ where $n! + 2$ is divisible by $2$, $n! + 3$ is divisible by $3$ and so on... and where $m$ = $n-1$ Thus $n!+2, n! +3, ..., n! + n$ tells that there are $(n-1)$ consecutive numbers. However, there seems to be some gaps or incompetence. For example: $4!+2, 4! +3, 4! +4$ $→$ $26, 27, 28$. Although it's right there are for sure smaller numbers such as $8, 9, 10$ and $14, 15 ,16.$ Is there another method for solving such a problem mathematically? Is it a correct method or have I misunderstood it?

When I took basic number-theory course there was this exercise to find 2000 consecutive numbers. And of course it's well known that the trick to take numbers of the form  $$ (n+1)!+m, \quad 2 \leq m \leq n+1 $$ does the trick with $n=2000$. But these numbers are really huge which makes me think of the following question.  Is there a better way to construct consecutive composite numbers? With better I mean that is there a way to find smaller consecutive composites for each $n$? Or even the smallest?  Example: Smallest 3 consecutive composites are clearly $8,9,10$ but the formula gives us the numbers $26, 27, 28$ and even $14,15,16$ would be smaller. So I'm asking a way to find these smaller/smallest consecutive composites.


I wonder if there is a way to efficiently manage abbreviations. When I do my Ph.D. work, I usually copy the contents from one document to the other. When rewriting contents to a journal or for a presentation, it is time-consuming to keep tracking the abbreviations and see whether they are defined or consistent. Also, adding a table of abbreviation can take a long time at the end of a large project or report. As a result, I think it is good idea to develop a package to manage abbreviations with functionalities as follows   Define abbreviations with a command like \declareabbreviation{<abbreviation tag>}{<full abbreviated name>}{<text to typeset (the abbreviation itself)>} and \abbreviaton{<abbreviation tag>}. The package then uses the command \abbreviation to typeset the abbreviation according to certain rules in the options. For instance, all abbreviations should be capitals regardless of how they were declared By default, when the abbreviation is introduced in the text for the first time, the package typesets the full name of the abbreviation followed by the abbreviation itself between brackets. It could also be specified that the full name is printed in caps or, say, bold caps for first letters regardless of how the full name is declared Highlight all abbreviations in the text or change their color. This could improve the ability of the author to (at a glance) see where the abbreviation is introduced for the first time and whether that location is good or not. It also helps see how frequently it is mentioned in the text Replace all abbreviations (i.e., all instances of \abbreviations{<abbreviation tag>}) with their full name instead Add an automatically generated table to the document showing the full name of each abbreviation and even the page where it was first mentioned in the text. This would be even better if it was compatible with hyper links For common abbreviations such as PhD, it could be nice to set an option allowing the package to automatically add dots (i.e., Ph.D.) or remove them regardless of how the abbreviation name is provided when it was declared Generate warnings when an abbreviation tag is used when it has not been defined. Also, replace the text with something like ?? for undefined abbreviation tags

I'm in the process of writing a long document and need a List of abbreviations. I've been reading the LaTeX wiki book about this and have had a play with the packages  and . What package is the most straight forward for developing a List of abbreviations? Is there a package I've missed?


Accordingly to the result  $$ (\bar{\psi}\psi)^\dagger = (-1)\bar{\psi}\psi \tag1$$  coming from the fact that fields with and without bar anti-commutes, you can deduce that the QCD mass term  $$ -m\bar{\psi}\psi, \quad m \in \mathbb{R} \tag2$$  is not hermitian, so QCD Lagrangian is not. Nevertheless, it has to be hermitian since we have the scattering matrix to be unitary. What is happening here?

Let's have Dirac mass term in lagrangian: $$ L_{M} = \bar{\Psi}\Psi $$ Lagrangian must be real-valued, i.e., its Hermitian conjugation doesn't change it. But due to Grassmann nature of spinor fields, $[\psi_{a}^{*}, \psi_{b}]_{+} = 0$, $$ L_{M}^{\dagger} = -\bar{\Psi}\Psi $$ Where have I make a mistake?


I want to make a link with a picture symbolizing play next to the text. What is the best way to do this? I wrote this code, but I don't think it's perfectly centered vertically. How can I center it perfectly?    a:after {   content: '';   display: inline-block;   vertical-align: middle;   width: 20px;   height: 20px;   background: url(https://img.icons8.com/material-sharp/24/000000/circled-play.png) center / cover no-repeat;   margin-left: 5px; } Watch video

I have a div with two images and an h1. All of them need to be vertically aligned within the div, next to each other. One of the images needs to be absolute positioned within the div. What is the CSS needed for this to work on all common browsers?

testing...


What are the different invalid characters that I am not allowed use in a macro ? It seems that #define TE$T 8 is working, so $ is valid. Does somebody have a list of the invalid characters ? (or on the contrary the list of the valid ones).

Are C-style macro names subject to the same naming rules as identifiers?  After a compiler upgrade, it is now emitting this warning for a legacy application:  warning #3649-D: white space is required between the macro name "CHAR_" and its replacement text   #define         CHAR_&        38   This line of code is defining an ASCII value constant for an ampersand.  #define   DOL_SN        36 #define   PERCENT       37 #define   CHAR_&        38 #define   RT_SING       39 #define   LF_PAR        40   I assume that this definition (not actually referenced by any code, as far as I can tell) is buggy and should be changed to something like "CHAR_AMPERSAND"?


says that KL can never be negative. But e.g. for texts where the probabilities are very small I somehow get negative values? E.g.   Collection A:  - word count: 321 doc count: 65888 probA: 0,004871904  Collection B:  - word count: 1244 doc count: 120344 probB: =0,010337034  KL = $0.004871904 \cdot \ln\frac{0.004871904}{0.010337034} = -0.003664881$

Why is KL divergence non-negative?  From the perspective of information theory, I have such an intuitive understanding:  Say there are two ensembles $A$ and $B$ which are composed of the same set of elements labeled by $x$. $p(x)$ and $q(x)$ are different probability distributions over ensemble $A$ and $B$ respectively.   From the perspective of information theory, $\log_{2}(P(x))$ is the least amount of bits that required for recording an element $x$ for ensemble $A$. So that the expectation $$\sum_{x \in  ensemble}-p(x)\ln(p(x))$$ can be interpreted as at least how many bits that we need for recording an element in $A$ on average.   Since this formula puts a lower bound on the bits that we need on average, so that for a different ensemble $B$ which brings about a different probability distribution $q(x)$, the bound that it gives for each element $x$ will surely not bit that is given by $p(x)$, which means taking the expectation, $$\sum_{x\in ensemble}-p(x)\ln(q(x))$$ this average length will surely be greater than the former one, which leads to $$\sum_{x\in ensemble }p(x)\frac{\ln(p(x))}{\ln(q(x))} > 0$$  I don't put $\ge$ here since $p(x)$ and $q(x)$ are different.  This is my intuitive understanding, is there a purely mathematical way of proving KL divergence is non-negative? The problem can be stated as:  Given $p(x)$ and $q(x)$ are both positive over real line, and $\int_{-\infty}^{+\infty}p(x)dx = 1$, $\int_{-\infty}^{+\infty}q(x)dx = 1$.  Prove $$\int_{-\infty}^{+\infty}p(x)\ln\frac{p(x)}{q(x)}$$ is non-negative.  How can this be proved? Or can this be proved without extra conditions?


I am trying to set GRUB to not show at startup by using the command line. For this I try editing /etc/default/grub with sudo, but I get a Permission denied error as a response:  myuser@mysystem:~$ sudo echo "GRUB_HIDDEN_TIMEOUT_QUIET=true" >> /etc/default/grub bash: /etc/default/grub: Permission denied   What I want to set:  sudo echo "" >> /etc/default/grub sudo echo "# Hide Grub" >> /etc/default/grub sudo echo "GRUB_HIDDEN_TIMEOUT=0" >> /etc/default/grub sudo echo "GRUB_HIDDEN_TIMEOUT_QUIET=true" >> /etc/default/grub sudo update-grub   Permissions of the file:  myuser@mysystem:~$ ll /etc/default/grub -rw-r--r-- 1 root root 1211 Feb 12 20:00 /etc/default/grub   Shouldn't I be able to use sudo to edit this file? Why doesn't sudo give me the permission even though the file belongs to root:root?  EDIT:  Found out that the two above GRUB settings do not work for the desired goal. To still achieve GRUB not showing the following setting needs to be added to /etc/default/grub using:  sudo bash -c "echo 'GRUB_DISABLE_OS_PROBER=true' >> /etc/default/grub"

When using sudo to allow edits to files, I regularly get 'permission denied'.  For example, my mouse is jittery and sluggish, so I want to disable polling:  sudo echo "options drm_kms_helper poll=N">/etc/modprobe.d/local.conf   I'm prompted for a password, and then get:  bash: /etc/modprobe.d/local.conf: Permission denied   So I tried to do a temporary change to disable polling by using:  sudo echo N> /sys/module/drm_kms_helper/parameters/poll   Yet again the system responded with:  bash: /sys/module/drm_kms_helper/parameters/poll: Permission denied   Any ideas?


Let $f(x)=\log x$, and $g(x)=x^i$, where $0<i<1$. How can I correctly proof that $f(x)=o(g(x))$?  Try 1: By the definition of little-o, a function is little-o of other function if $|f(x)|\leq C|g(x)|$ for all $x>m$. I was thinking of choosing $i$ to be 1, then proof that $\log x = o(x)$ but I am not sure if this is correct.

Sorry about asking such an elementary question, but I have been wondering about this exact definition for a while. What power of $n$ is $\log(n)$. I know that it is $n^\epsilon$ for a very small $\epsilon$, but what value is $\epsilon$ exactly?


I found a stored procedure in our sql server 2016 db  Create PROCEDURE XXX    @complicatedQuery bit AS BEGIN    SELECT some fields FROM      Table A join Table B on something      JOIN Giant Table C on @complicatedQuery=1 and SomeOtherCondition END   Will we get bit better performance if I do this:  Create PROCEDURE XXX        @complicatedQuery bit     AS     BEGIN        IF @complicatedQuery =0 then        SELECT some fields FROM          Table A join Table B on something        ELSE        SELECT some fields FROM          Table A join Table B on something          JOIN Giant Table C on complicatedQuery=1 and SomeOtherCondition      END   I think in both cases,sql search will create a plan that goes through both branches. But will second one be better or in reality there is no performance difference (as the first sp has @complicatedQuery in the table join condition anyway)?  I read another post which says that it is best to create sub stored procedures to cover different scenarios.   Is there a way to write some tests to prove it?  Many Thanks

SQL Server 2012 and 2016 Standard:  If I put if-else logic in a stored procedure to execute one of two branches of code, depending on the value of a parameter, does the engine cache the latest version?  And if on the following execution, the value of the parameter changes, will it re-compile and re-cache the stored procedure, since a different branch of the code must be executed? (This query is quite expensive to compile.)


As far as i know, microwave (used in microwave oven) and wifi all operate on the same frequency, but why microwave can heat the foods while wifi wave can't?

If we ignore 5GHz WiFi, then both microwaves and WiFi create photons at ~2.4GHz but one of them will boil water in a few seconds but the other doesn't have any effect. So what's the difference?  Is it simply the number of photons created? Is that what the wattage of a microwave measures? If so, what would be the wattage of a wireless router?  Does the enclosed space have anything to do with it?   If it all has to do with power output could I put enough WiFi routers together in a room to cook a turkey (from microwaves and not waste heat)?


I have a multiple regression model.The predictors A,B,AB are all significant. But the coefficients of A and B are positive while the coefficient of AB is negative. How to interpret it? (A ranges from -1 to 1, while B>=0)Thanks!

I create a linear regression model with interaction term in the model say: $$y=a_0+a_1x_1+a_2x_2+a_3x_1*x_2+e$$ where $x_1$ is continuous and $x_2$ is binary. Now, I have couple of questions:   If $x_1$ and $x_2$ both are significant and have positive coefficients, that means that if $x_1$ and $x_2$ increase, then $y$ increases. What can I say if $x_1*x_2$ is statistically insignificant? Does it mean that increase in. Does it mean that for $x_2=1$, the effect of $x_1$ on $y$ is not changed, i.e. increase in $x_1$ still leads to increase in $y$? What if the interaction is statistically significant? What can I say if the interaction term is statistically insignificant and negative? Does it indicate that if $x_2=1$, increase in $x_1$ actually leads to decrease in $y$?   Thanks.


I'm well aware of  ,   nonetheless I was wondering whether is it appropriate to clearly specify what I'm doing, rather then posting it as a normal question.  The specific case I'm referring to is my recent 'self Q/A' here    I introduced the question with this note     This is not a real question, but just a way of bringing to StackOverflow this nice trick that I recently discovered reading this blog entry by Erica Sadun.   but it feels not completely ok with the StackOverflow question format.  Should I leave the note there or remove it?

Often you have a question, you can't find the answer on Stack Overflow so you search for it (or think a bit more). Having found the answer you'd like to keep a record so you can find it again later.  Before Stack Overflow I would write a blog post so I could search for it later. Jeff and Joel, I think, specifically said SO is a good place to replace these blog posts. So what is the best etiquette for adding your answer?   Just ask the question, then post your answer immediately and let voting sort the answers out. This is okay, but it looks like you are just trying to generate reputation, and other people often don't vote or answer, and a lot of the SO information is lost. Provide the answer in the question and ask the question phrased as "is there a better answer". This allows others to gain reputation, and doesn't look so greedy but makes your answer harder to vote on. Post your question, let others answer it. If no-one puts the answer you already found, then add it an hour or so later. If someone else gets it then accept their answer (or the best one). This is more selfless with reputation, but makes other people do work you have already done which feels a bit lazy and a waste of everyone's time.   Or maybe there is another way?


I have seen many articles' titles, with almost all words having the first letter capitalized. For example:      We can see many examples where many seriously big publishers follow this trend. There is something common they're following, but I can't figure out what. Question:  Does capitalizing affects a user's readability? If not, why is it common amongst big publishers?  Note: The links are given as examples.

Are there any concrete rules that say which words (parts of speech) in a title should start with a capital letter? What would be a correct capitalization for the title of this question?


Question on the choice of boundary in the CUSUM test when we make some resampling We are considering to make a CUSUM test for some economical time series $X = (x_1,..,x_n)$. Suppose $X$ contains many noises which need to be removed in some ways. Simply speaking, the CUSUM test considers the empirical process, $W_n = \frac{1}{\sigma \sqrt{n}}\sum_{i=1}^{n} (x_i - \mu )$ and check if it hits the boundary corresponding to the Brownian bridge. In practice, for execution of the CUSUM test, we utilize an R package, strucchange. Now we have a question. The question is related to the scaling of boundary since we are considering to make a resampling or filtering raw data, and perform a CUSUM test, again. Question is as follows: Do we need to make any rescaling the boundary when we make a filtering data? For instance, should we need to multiply the original boundary by $\frac{1}{\sqrt{m}}$ (m: sample length)? Since we are using the open source R package, strucchange in performing the CUSUM test, it is not so clear if we need to take care of such a rescaling factor of the boundary function.

We are considering to make a CUSUM test for such a time series X = (x1,..,xn). Suppose X contains many noises which need to be removed in some ways. Simply speaking, the CUSUM test considers the empirical process, and check if it hits the boundary corresponding to the Brownian bridge. In practice, for execution of the CUSUM test, we utilize an R package, strucchange. Now we have a question. The question is related to the scaling of boundary since we are considering to make a resampling or filtering raw data, and perform a CUSUM test, again. Question is as follows: Do we need to make any rescaling the boundary when we make a filtering data? For instance, should we need to multiply the original boundary by 1/sqrt(m) (m: sample length)? Since we are using the open source R package, strucchange in performing the CUSUM test, it is not so clear if we need to take care of such a rescaling factor of the boundary function.


This is a question I found in a test:     Run tree from your home directory.   Explain and demonstrate what it does.   Use output redirection to do this.   I don't understand the output redirection part. Could you explain it to me please?

I am compiling a program using make and want the output of make to be written to a file. I have tried using > operator like  make > build_log.txt   and using tee command like  make | tee build_log.txt   but the problem is that some of the ouput goes into the file but rest keeps appearing on the screen.   I can simply copy/paste the text from terminal into a file after running make but that is not a solution.    So my question is how do I save i.e redirect all the output to file so that it goes into file only without appearing on screen.


Let $V,W$ be subspaces of vector space $U$ where $U=V+W$. Now, my question is if it is true that if $X$ is a subspace of U, then $X=(X\cap V)+(X\cap W)$? I think this should be true since the direct sum $V\oplus W$ is a smaller set than $V+W$ which covers the space U. Could someone please help prove or counterexample for why this is or isn't always true? Thanks.

I am struggling with this question from Halmos's text, please ignore the imperative language.  "Suppose that $L, M$  and $N$ are subspaces of a vector space. Show that the equation    $$L \cap (M + N) = (L \cap M) + (L \cap N)$$   is not necessarily true.  Since each of these subspaces has origin in them, clearly there intersections could not be empty. I wasn't able to formulate an example where this result did n't hold. Any help would be highly appreciated.