Converting LLA to XYZ
Lat Long to X Y Z position in JS .. not working
I want to insert something into a STL list in C++, but I only have a reverse iterator. What is the usual way to accomplish this?  This works: (of course it does)  std::list&lt;int&gt; l; std::list&lt;int&gt;::iterator forward = l.begin(); l.insert(forward, 5);   This doesn't work: (what should I do instead?)  std::list&lt;int&gt; l; std::list&lt;int&gt;::reverse_iterator reverse = l.rbegin(); l.insert(reverse, 10); I'm trying to solve hard combinatorics that involve complicated factorials with large values.  In a simple case such as $8Pr = 336$, find the value of $r$, it is easy to say it equals to this: $$\frac{8!}{(8-r)!} = 336.$$  Then $(8-r)! = 336$ and by inspection, clearly $8-r = 5$ and $r = 3$.  Now this is all and good and I know an inverse function to a factorial doesn't exist as there is for functions like sin, cos and tan etc. but how would you possibly solve an equation that involves very large values compared to the above problem without the tedious guess and checking for right values.  Edit: For e.g. if you wanted to calculate a problem like this (it's simple I know but a good starting out problem) Let's say 10 colored marbles are placed in a row, what is the minimum number of colors needed to guarantee at least $10000$ different patterns? WITHOUT GUESS AND CHECKING  Any method or explanation is appreciated! I really enjoyed that site. I've only posted on it once, but I enjoyed seeing other people's posts and appreciated reading about entrepreneurial dilemmas. Teleporting a player from the overworld to the end Is there any way to teleport a player from the overworld to the end?   Or a way of teleporting a player to a random enderman in the end? Java volatile reference vs. AtomicReference Can't install Oracle JDK 9 I uninstalled jdk packages and now can't install them back. I managed to install oracle-java7-installer and oracle-java8-installer but can't install oracle-java9-installer. It seems that my computer tries to download wrong version of oracle-java9-installer 177 when version i would be able to download is 178.    $ wget http://download.java.net/java/jdk9/archive/178/binaries/jdk-9+178_linux-x64_bin.tar.gz --2017-07-21 11:00:02--  http://download.java.net/java/jdk9/archive/178/binaries/jdk-9+178_linux-x64_bin.tar.gz Connecting to 10.144.1.10:8080... connected. Proxy request sent, awaiting response... 200 OK Length: 293348142 (280M) [application/x-gzip] Saving to: 'jdk-9+178_linux-x64_bin.tar.gz'  jdk-9+178_linux-x64_bin.tar.gz     1%[&gt;                                                          ]   5.42M  5.04MB/s               ^C  $ wget http://download.java.net/java/jdk9/archive/177/binaries/jdk-9+177_linux-x64_bin.tar.gz --2017-07-21 11:00:16--  http://download.java.net/java/jdk9/archive/177/binaries/jdk-9+177_linux-x64_bin.tar.gz Connecting to 10.144.1.10:8080... connected. Proxy request sent, awaiting response... 404 Not Found 2017-07-21 11:00:17 ERROR 404: Not Found.   Can you help? apt-get tries to install Oracle JDK 9.  I run Ubuntu 16.04 in virtual machine hosted by win7  Full error message:  sudo apt-get install oracle-java9-installer Reading package lists... Done Building dependency tree        Reading state information... Done oracle-java9-installer is already the newest version (9b177-1~webupd8~0). 0 upgraded, 0 newly installed, 0 to remove and 147 not upgraded. 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Do you want to continue? [Y/n] Y Setting up oracle-java9-installer (9b177-1~webupd8~0) ... Using wget settings from /var/cache/oracle-jdk9-installer/wgetrc Downloading Oracle Java 9... --2017-07-21 10:54:11--  http://download.java.net/java/jdk9/archive/177/binaries/jdk-9+177_linux-x64_bin.tar.gz Connecting to 10.144.1.10:8080... connected. Proxy request sent, awaiting response... 404 Not Found 2017-07-21 10:54:13 ERROR 404: Not Found.  download failed Oracle JDK 9 is NOT installed. dpkg: error processing package oracle-java9-installer (--configure):  subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing:  oracle-java9-installerE: Sub-process /usr/bin/dpkg returned an error code (1) Suppose there are two users that have commented on an answer. Both have the same user name, and I want to reply to one of them. How can I do this?  It appears that, under the current system, there is no way for me to do this. Specifically, from , I see that:     4. Matching is performed in reverse chronological order, so if five people named John are participating, @john will match the most recent John   So, consider this a request to add this feature using an -n suffix or something similar; e.g. @john-2 could be used to reply to the second John from the top.  Update Thanks to  for nice answer of @name(userid) based auto-complete suggestion which has no loophole. It involves no counting from top &amp; has no consequences when a comment is deleted. But, I think @name(userid) should be used directly in comment as all form inputs at SE are text (nothing embedded).  Now, I'm trying to finalize it based on it: The system should allow optional @name(userid) format for reply. Provided userid with this format, system should ignore name. And, in the situation of duplicate name based confusion, system should demand this format as mandatory to submit comment.  How to get userid? In case of duplicate name based confusion, system should append (userid) in hypertext to their profile. It'd work for mobile version too. On full version, for easy fill-up, a hover reply icon would be fine (like hover vote up icon). Upon clicking it, system should fill @name(userid) in comment text box.  From reply reader side: Multiple Johns could be confused even if they didn't come from notification (because nobody remembers his/her own userid). So, highlight the background of comments which are replied to them. How do I change the hostname without a restart? I want to change the OS hostname but I do not want to restart.  I have edited /etc/hostname but it requires a restart to get implemented. How to avoid this? Information about (simple) mask wearing (concerning covid19) is a complete mystery to me. On several official places it is not recommended for a person without symptoms to wear a mask. For example:    (time 0:20)  or here:    However no explanation is given - which makes me wonder (and even angry). I think everybody should wear a mask because:   Many persons feel ashamed wearing it, even those with symptoms. If everybody wears it, they do not feel ashamed and wear it. As far as I know, one is (wrt covid19) contagious before developing symptoms. So if everybody wears the mask also these people do.   The two above points act as a collective protection.   Simple mask certainly will lower "getting / spreading illness" probability. Of course the "holes" (in a simple mask) are too big to prevent completely virus to enter (or get out when coughing), but it lowers probability! Even if it lowers the transmission probability by e.g. 5%, it might be a lot. As a hypothetical example: it might reduce R0 from 1.02 to 0.97 and so stop the virus spread so fast.   The videos are full of self-contradiction. In the same video    time 0:50 the lady says I should wear a mask if I am in contact with an infected person... why if it is inefficient?  Question: What are reasons for not recommending wearing a mask? Vertex groups can not be named in blender 2.70 For some reason the name text field doesn't appear for vertex groups in blender 2.70. I tried in 2.69 and it's there and works fine. Was this feature removed in 2.70 or am I missing something? I have several entries in my list of references that include of the order of 40 authors. Is there a way to make bibtex automatically reduce these lists to e.g. the first name + "et al."?  I don't want to edit the BibTeX entries manually and I cannot use biblatex. If at all possible I would also make as little changes as possible to the bibliography style.  There are similar questions, but none of those had a concise answer:       natbib e.g. seems to change only the reference within the text, but not the entry in the bibliography.  EDIT: I am using \bibliographystyle{unsrt} as style definition. What does 'apt-get install update' do? I saw this snippet in some installation instructions:  $ apt-get install update   I know what apt-get install XXXX does and I know what apt-get update does, but I can't find any info on what this combined statement does. What does it do? To what extent are child actors exposed to the violent aspects of the movie they perform in? I am trying to use following apex class with invocable method but its not showing in process builder.  global with sharing class SlackOpportunityPublisher {      private static final String slackURL = 'https://testsalesforceapps.slack.com/';      global class Oppty {         @InvocableVariable(label='Opportunity Name')         global String opptyName;         @InvocableVariable(label='Stage')         global String stage;     }      @InvocableMethod(label='Post to Slack')     global static void postToSlack(List&lt;Oppty&gt; oppties) {         Oppty o = oppties[0]; // If bulk, only post first to avoid overloading Slack channel         Map&lt;String,Object&gt; msg = new Map&lt;String,Object&gt;();         msg.put('text', 'The following opportunity has changed:\n' + o.opptyName + '\nNew Stage: *' + o.stage + '*');         msg.put('mrkdwn', true);         String body = JSON.serialize(msg);             System.enqueueJob(new QueueableSlackCall(slackURL, 'POST', body));     }      global class QueueableSlackCall implements System.Queueable, Database.AllowsCallouts {          private final String url;         private final String method;         private final String body;          global QueueableSlackCall(String url, String method, String body) {             this.url = url;             this.method = method;             this.body = body;         }          global void execute(System.QueueableContext ctx) {             HttpRequest req = new HttpRequest();             req.setEndpoint(url);             req.setMethod(method);             req.setBody(body);             Http http = new Http();             HttpResponse res = http.send(req);         }      }  } I'm very new to GIS concepts. Is there a way or procedure of finding out whether the co-ordinate system is in UTM, latitude/longitude or in stateplane using .prj file?   My .prj file contains the following text:      GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS   84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]] Difference between logit and probit models Image of concave mirror when object is farther than the focal point I have a set of concave/convex mirrors/lenses, and I have drawn out all of the ray tracing diagrams for each possible combination and type of image each optical element can produce. When I look at the ray tracing diagrams then reproduce the situation in the real world with myself as the &quot;object&quot;, all the scenarios make sense to me except one: when I as the object stand beyond the focal point of a concave mirror.  The image ends up as &quot;real&quot; and appears to be in front of the mirror. Now I understand that in the situation above, I as the object would stand at 6m and this would result in the image appearing at 12m. So if I placed a wall or screen at the 12m mark, the image would form on that surface (just like a movie theater screen).... at least I think I interpreted that correctly. But I still see myself when I look in the mirror?! If the image is supposed to form and come into focus behind me, what in the world am I seeing when looking at the surface of the mirror? I still see myself, just inverted. The surface of the concave mirror still has a reflection on it. It doesn't look quite like a normal flat mirror, in that the image doesn't really look like it's &quot;inside&quot; the mirror, more like it's right on the surface of it. It's really frustrating because every other possible arrangement of optical elements makes total sense to me, except this one. Any suggestions on how to think about it? Thank you for your time! top command in cygwin? I am starting to use Cygwin(64) on my Windows 8 laptop, however, the top command is not recognized. I have read online that I need to get the procps package, but it is not available on the 'Cygwin Setup' package selections. How should I go about installing the procps package so that I can use top?  ps. for whatever reason ps and kill both work so I would think top would be included in whatever package allowed those guys to work, but there is no top command. I'm not a git master, but I have been working with it for some time now, with several different projects.  In each project, I always git clone [repository] and from that point, can always git pull, so long as I don't have outstanding changes, of course.  Recently, I had to revert to a previous branch, and did so with git checkout 4f82a29.  When I was again ready to pull, I found that I had to set my branch back to master.  Now, I can not pull using a straight git pull but instead, have to specify git pull origin master, which is annoying, and indicates to me that I don't fully understand what is going on.  What has changed which does not allow me to do a straight git pull without specifying origin master, and how to I change it back?  UPDATE:  -bash-3.1$ cat config [core]     repositoryformatversion = 0     filemode = true     bare = false     logallrefupdates = true [branch "master"] [remote "origin"]     url = git@github.com:user/project.git     fetch = refs/heads/*:refs/remotes/origin/*   UPDATE 2: To be clear, I understand that my original method may have been incorrect, but I need to fix this repo so that I can simply use git pull again.  Currently, git pull results in:  -bash-3.1$ git pull You asked me to pull without telling me which branch you want to merge with, and 'branch.master.merge' in your configuration file does not tell me either.  Please name which branch you want to merge on the command line and try again (e.g. 'git pull  '). See git-pull(1) for details on the refspec.  If you often merge with the same branch, you may want to configure the following variables in your configuration file:      branch.master.remote =      branch.master.merge =      remote..url =      remote..fetch =   See git-config(1) for details.   I can tell git pull which branch to merge, and it works correctly, but git pull does not work as it did originally before my git checkout. Java FileReader encoding issue I tried to use java.io.FileReader to read some text files and convert them into a string, but I found the result is wrongly encoded and not readable at all.  Here's my environment:   Windows 2003, OS encoding: CP1252 Java 5.0   My files are UTF-8 encoded or CP1252 encoded, and some of them (UTF-8 encoded files)  may contain Chinese (non-Latin) characters.  I use the following code to do my work:     private static String readFileAsString(String filePath)     throws java.io.IOException{         StringBuffer fileData = new StringBuffer(1000);         FileReader reader = new FileReader(filePath);         //System.out.println(reader.getEncoding());         BufferedReader reader = new BufferedReader(reader);         char[] buf = new char[1024];         int numRead=0;         while((numRead=reader.read(buf)) != -1){             String readData = String.valueOf(buf, 0, numRead);             fileData.append(readData);             buf = new char[1024];         }         reader.close();         return fileData.toString();     }   The above code doesn't work. I found the FileReader's encoding is CP1252 even if the text is UTF-8 encoded. But the JavaDoc of java.io.FileReader says that:     The constructors of this class assume   that the default character encoding   and the default byte-buffer size are   appropriate.   Does this mean that I am not required to set character encoding by myself if I am using FileReader? But I did get wrongly encoded data currently, what's the correct way to deal with my situtaion? Thanks.