Please explain me what does this piece of code do.  h should be 32Byte result from sha256 calculation.  I am rewriting parts of this code for my project in C++ and I'm not sure if this switches byte order per 4byte chunk or change byte order on whole 32byte number.  def reverse_hash(h):     return struct.pack('&gt;IIIIIIII', *struct.unpack('&gt;IIIIIIII', h)[::-1])[::-1]   And, how does this array index work ?     [::-1]   Thanks for any and all info
I need a good explanation (references are a plus) on Python's slice notation.   To me, this notation needs a bit of picking up.   It looks extremely powerful, but I haven't quite got my head around it.
Why didn't Palpatine publicly change his name once he became Emperor? Anakin Skywalker was known as Darth Vader (this was already his Sith name) after the creation of the Galactic Empire.  So why did Palpatine remain "Emperor Palpatine"? Why didn't he embrace his persona as Darth Sidious?  I started wondering after reading one of the answers to How can I find the version of Ubuntu that is installed? I installed some version of Ubuntu on my VMware, but I don't know what version exactly it is. How can I find it out? Where can I find sample or real Selenium projects. All the material I can find on github and on internet are basic, and never intermediate or advanced.  How does a real Selenium project look in real life? How can I find sample code? How to find out what init mode system is using? I was looking at this and I'm not sure how to find out which startup service is used on my machine (Ubuntu 14.04 on Digital Ocean). Can it use all of them? (upstart, system v, systemd) Why should the Standard Model be renormalizable? Effective theories like Little Higgs models or Nambu-Jona-Lasinio model are non-renormalizable and there is no problem with it, since an effective theory does not need to be renormalizable. These theories are valid until a scale $\Lambda$ (ultraviolet cutoff), after this scale an effective theory need a UV completion, a more "general" theory.  The Standard Model, as an effective theory of particle physics, needs a more general theory that addresses the phenomena beyond the Standard Model (an UV completion?). So, why should the Standard Model be renormalizable? Difference in sentence meaning between present continuous and simple present constructions I need to cite the journal "Sankhyā: The Indian Journal of Statistics" in a paper.  I would like to draw the ā character properly (i.e., I'd prefer, if possible, to avoid using some hack, such as \bar or \overline).  Question: How do I properly write ā in LaTeX?  I didn't have luck with  (after several attempts in both in capital and lowercase) nor The Comprehensive LATEX Symbol List (searching the file for "ā" and "india" revealed no hits). Flagging summary improvement: filters Here is my flagging summary on SU:   Your flagging history   32 posts flagged as requiring moderator attention    2 are waiting for review   3 were marked valid   1 were marked invalid   (older flags were not recorded valid/invalid)    2 posts marked as spam    It is too complicated to look for invalid flags. Would it be possible to make filters on the top of the page (like on favorites for example) with:  By date, By type (off-topic, spam, dupes), By status (accepted, pending, rejected)  It would make it easier for reviewers to check their flagging and eventually know what to improve on.  Or is there another easy way to audit this? Check out the below program.   try {     for (String data : Files.readAllLines(Paths.get("D:/sample.txt"))){         String[] de = data.split(";");         System.out.println("Length = " + de.length);     } } catch (IOException e) {     e.printStackTrace(); }   Sample.txt:   1;2;3;4 A;B;; a;b;c;   Output:   Length = 4 Length = 2 Length = 3   Why second and third output is giving 2 and 3 instead of 4. In sample.txt file, condition  for 2nd and 3rd line is should give newline(\n or enter) immediately after giving delimiter for the third field. Can anyone help me how to get length as 4 for 2nd and 3rd line without changing the condition of the sample.txt file and how to print the values of de[2] (throws  ArrayIndexOutOfBoundsException)? A Tweedie distribution can model skewed data with a point mass at zero when the parameter $p$ (exponent in the mean-variance relationship) is between 1 and 2.   Similarly a zero-inflated (whether otherwise continuous or discrete) model may have a large number of zeros.  I'm having trouble understanding why it is that when I do prediction or calculate fitted values with these kinds of models, all of the predicted values are non-zero.  Can these models actually predict exact zeros?  For example  library(tweedie) library(statmod) # generate data y &lt;- rtweedie( 100, xi=1.3, mu=1, phi=1)  # xi=p x &lt;- y+rnorm( length(y), 0, 0.2) # estimate p out &lt;- tweedie.profile( y~1, p.vec=seq(1.1, 1.9, length=9)) # fit glm fit &lt;- glm( y ~ x, family=tweedie(var.power=out$p.max, link.power=0)) # predict pred &lt;- predict.glm(fit, newdata=data.frame(x=x), type="response")   pred now does not contain any zeros.  I thought the usefulness of models such as the Tweedie distribution comes from its ability to predict exact zeros and the continuous part.  I know that in my example the variable x is not very predictive. Can I travel within the Schengen area without a passport if I have my residency permit card? $$\int^2_{-2}\frac{x^2}{1+5^x}$$  How do I start to integrate this?  I know the basics and tried substituting $5^x$ by $u$ where by changing the base of logarithm I get $\frac{\ln(u)}{\ln 5}=x$, but I got stuck.  Any hints would suffice preferably in the original question and not after my substitution.  (And also using the basic definite integrals property.)  Now I know only basic integration, that is restricted to high school, so would prefer answer in terms of that level. Replace environment variables in a file with their actual values? Is there an easy way to substitute/evaluate environment variables in a file? Like let's say I have a file config.xml that contains:  &lt;property&gt;     &lt;name&gt;instanceId&lt;/name&gt;     &lt;value&gt;$INSTANCE_ID&lt;/value&gt; &lt;/property&gt; &lt;property&gt;     &lt;name&gt;rootPath&lt;/name&gt;     &lt;value&gt;/services/$SERVICE_NAME&lt;/value&gt; &lt;/property&gt;   ...etc. I want to replace $INSTANCE_ID in the file with the value of the INSTANCE_ID environment variable, $SERVICE_NAME with the value of the SERVICE_NAME env var. I won't know a priori which environment vars are needed (or rather, I don't want to have to update the script if someone adds a new environment variable to the config file). Thanks! I just reinstalled my Ubuntu system with 11.10, but ran into a problem when I tried to install Gimp 2.7.  I always get unmet dependencies (it's german, so I can't tell you the exact english translation):     Needs gimp-data (&lt;= 2.6.11-z) but 2.7.3-2011082002~oo should be installed   I already read the follow post, but the answers didn't really help me.  When I type in     sudo apt-get install gimp=2.6   it just says that there is no version 2.6 found. I get the same with 2.7.  I really need Gimp. But installing Gimp 2.6 isn't possible as well.  When I remove the repos for 2.7, I still get the same error. In my grammar book (English Grammar, HarperCollins Publishers), I read that none is occasionally treated as plural, but it is usually regarded as singular. Can you give me an example of sentence where none is used as plural pronoun? I have a simple one line command which works perfectly in terminal, but does not work in the "Startup Applications" app thing.  The line of code is : xmodmap /home/seph/Code/Ubuntu\ Scripts/Xmodmap  It's not that much of a hassle to copy it from "Startup Applications" and paste it into terminal, but I don't really get why it isn't working.  I followed someone else's instructions to do it in the first place, so maybe I did something wrong?  In any case, wouldn't it be the obvious and logical assumption that it just types whatever you put in it into Terminal? I've recently taken up a position in an all Mac workshop - We have Intel based Apple machines. Can I dual boot Ubuntu on my machine, if so how? Inspecting standard container (std::map) contents with gdb Supposing to have something like this:  #include &lt;map&gt; int main(){     std::map&lt;int,int&gt; m;     m[1] = 2;     m[2] = 4;     return 0; }   I would like to be able to inspect the contents of the map running the program from gdb. If I try using the subscript operator I get:    (gdb) p m[1] Attempt to take address of value not located in memory.   Using the find method does not yield better results:  (gdb) p m.find(1) Cannot evaluate function -- may be inlined   Is there a way to accomplish this? The close dialog says there are two off-topic votes, but none of the off-topic reasons have votes next to them I've found strange behavior when closing this  - I definitely see that there are 3 closing votes and 2 of them are at "Off-topic" section:   -but there are no explanations on section itself:   -while, normally, it's expected that it will appear. In custom comments section there are also no closing-votes displayed.   Perhaps it's just my browser (which is FF 26 x64 under Win) - so marking this as a "possible bug". Thank you for your attention. How do I switch between keyboard layouts? I want to switch between English and another language.  I have tried Lubuntu and it was easy, I figured it out from the friendly menus. But in Ubuntu everything is so cryptic.