I am having a problem in understanding what happens when i put negative value to step in case of slicing.  I know [::-1] reverses a string. i want to know what value it assign to start and stop to get a reverse.  i thought it would be 0 to end to string. and tried  f="foobar"  f[0:5:-1]---&gt; it gives me no output. why?  and i have read start should not pass stop. is that true in case of negative step value also?  can anyone help me to clear my doubt.
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.
I can't remember the gender of the main character.  I remember bits and pieces from different books, but I think they're all part of the same series. The pieces may not be in order or from multiple books.   Boy somehow ends up in a mirror universe that's darker and seems to have no people. He has to travel to a certain office(?) building and steal a book. I think this is towards the end of the book (I can't remember the events leading up to it). I think he finds the portal in a forest or something behind his school. He goes into the ocean with mermaids or something and has to save the ocean from pollution. Aliens exist and are observing Earth, because they think it's undeveloped and are waiting for them to be advanced enough. His mother ends up in hospital and he does something to save her. He goes to Ireland(?) and enters a mountain or something to find a race of people. I can't remember who showed him how, but I'm pretty sure she used magic. He goes to Mars and saves a race from war with themselves(?). This place was hidden inside an illusion. He's also grouped with a linguist that learned their language. He travels to another world where there's a prince. I can't remember, but I think it might've been part of a tournament. His sister goes to a robot planet through a portal. I think the actual planet was a robot/AI and had lots of little robots on it. Can't remember what happens here, but he goes there and saves her from something.   It was set a few years ago, when computers weren't common (his family got one early in the first book, I think).  Thanks in advance if someone finds it. Script for modifying file content in specified files I tried searching previous questions but none worked, or I couldn't adapt them to my needs.  I want to write a script that asks for:   folder criteria old string new string   And replace every file in the specified folder and subfolders (and force user to type one) with specific criteria (for example, it must be a ".cue" file), and:   If the file is read-only, disable it. Search for specified old string in the file content and replace it with new string , and save changes in same file. If the file was read-only, enable it again.   I have this code so far, but I don't know what to do in the do part:  @echo off   setLocal enableDELAYedexpansion  :START set "var2=" set /P var2="type folder "  if "%var2%"=="" goto ERROR  set /p old="old string ? " set /p new="new string ? " set /p files="what criteria ? " echo modifying files...  for /r "%var2%" %%v in (%%files) do (  ???  ) pause  goto START  :ERROR echo type something!! goto START MariaDB won't start on Ubuntu: Can't lock aria control file Smooth shaded model has odd shading I'm currently working on a model of an X-wing that I'm intending for use in a game and running into a bit of trouble with the shading of the mesh. The upper nose is rounded off where the sensor cone attaches, but at the point it reaches the canopy frame it flattens out and meets at a corner.  Everything is fine and dandy when the sides are modeled:    but once I close it off and add the top of the nose, the shading goes to hell:    As you can see, the smoothing gets confused at the lip of the cockpit.  I've tried a couple different means of getting around this, none of which looks right while maintaining the correct shape. The transition from the rounded to flat is a fairly important part of the ship's character, so I don't want to discard the contours, either.  Any tips or suggestions on modeling this area?  Addendum:  If I eliminate that second angle where the canopy frame meets the fuselage as marked in red:    this also fixes the smoothing. However this is not a solution, as the angle is a part of the design. It DOES give me another thought on fixing, but I won't be able to test it until I get home. Inequality $\frac1a + \frac1b + \frac1c \leq \frac{a^8+b^8+c^8}{a^3b^3c^3}$ Let $a,b,c$ be positive reals . Prove that $\displaystyle \frac1a + \frac1b + \frac1c \leq \frac{a^8+b^8+c^8}{a^3b^3c^3}$  I found this one in a book, no hints mentioned, but marked as very hard. I can't make any progress... How to change the background color only for the current page? Find the volume common to two circular cylinders, each with radius r, if the axes of the cylinders intersect at right angles. (using disk/washer) Find the volume common to two circular cylinders, each with radius r, if the axes of the cylinders intersect at right angles. (using disk/washer)  I saw no example of this problem anywhere.. I saw an example how to solve it without calculus but I'm afraid that'll be deductions on my test.. I have the volume of a cylinder and the method of area between two curves but this is out of my reach.... I don't know what I can try... If $0 &lt; \alpha &lt; 1$, then       $$ (x + y)^{\alpha} &lt; x^{\alpha} + y^{\alpha} $$      for $x$, $y$ positive.   Is this inequality true in general?  I tried using Young's Inequality: For $z,t &gt; 0$, and for $n$, $m$ such that $n+m=1$, then   $$ z^n + t^m \leq nz + mt $$  So, using this we have   $$ (x+y)^{\alpha} \cdot 1^{1 - \alpha} \leq \alpha(x+y) + (1-\alpha) = \alpha x + \alpha y + (1-\alpha)$$  which is not as tight as I want. Multiplying by a $1\times 1$ matrix? For matrix multiplication to work, you have to multiply an $m \times n$ matrix by an $n \times p$ matrix, so we have $$\bigg(m \times n\bigg)\bigg(   n\times p \bigg).$$  But what about a $1 \times 1$ matrix? Is this just a scalar? But every matrix can be mulitplied by a scalar; so do $1 \times 1$ matrices break the rule? Find Total number of ways out of N Number taking K numbers every M interval I have been stuck in a problem, that has thrown my brain out of the coding. This problem is at very high priority and I need the solution as early as possible. Problem is as :  There are exactly N advertising boards on the highway. Now a company want to advertise on some of these advertising boards(each advertising board costs some money) .  Company strategy is that, they want at least 'K' advertisement should be there among M consecutive advertising boards. But at the same time Company want to pay minimum for its advertisement .  Now, what is the total number of ways, different ways Company can advertise meeting its minimum cost strategy.  As for Example: N= 3, M = 2, K=1 ==> there is only one way for minimum cost, ie. 0C0 , where '0' denotes No company advertisement, and 'C' denotes company advertisement board.  Similarly, for N =4, M =2, K =1 ==> there is 3 possible ways, ie. C0C0, 0C0C, 0CC0.  Hope to get a reply from someone soon. Thanks. If I have a dataset with a very rare positive class, and I down-sample the negative class, then perform a logistic regression, do I need to adjust the regression coefficients to reflect the fact that I changed the prevalence of the positive class?  For example, let's say I have a dataset with 4 variables: Y, A, B and C.  Y, A, and B are binary, C is continuous.  For 11,100 observations Y=0, and for 900 Y=1:  set.seed(42) n &lt;- 12000 r &lt;- 1/12 A &lt;- sample(0:1, n, replace=TRUE) B &lt;- sample(0:1, n, replace=TRUE) C &lt;- rnorm(n) Y &lt;- ifelse(10 * A + 0.5 * B + 5 * C + rnorm(n)/10 &gt; -5, 0, 1)   I fit a logistic regression to predict Y, given A, B and C.   dat1 &lt;- data.frame(Y, A, B, C) mod1 &lt;- glm(Y~., dat1, family=binomial)   However, to save time I could remove 10,200 non-Y observations, giving 900 Y=0, and 900 Y=1:  require('caret') dat2 &lt;- downSample(data.frame(A, B, C), factor(Y), list=FALSE) mod2 &lt;- glm(Class~., dat2, family=binomial)   The regression coefficients from the 2 models look very similar:  &gt; coef(summary(mod1))               Estimate Std. Error   z value     Pr(&gt;|z|) (Intercept) -127.67782  20.619858 -6.191983 5.941186e-10 A           -257.20668  41.650386 -6.175373 6.600728e-10 B            -13.20966   2.231606 -5.919353 3.232109e-09 C           -127.73597  20.630541 -6.191596 5.955818e-10 &gt; coef(summary(mod2))               Estimate  Std. Error     z value    Pr(&gt;|z|) (Intercept) -167.90178   59.126511 -2.83970391 0.004515542 A           -246.59975 4059.733845 -0.06074284 0.951564016 B            -16.93093    5.861286 -2.88860377 0.003869563 C           -170.18735   59.516021 -2.85952165 0.004242805   Which leads me to believe that the down-sampling did not affect the coefficients.  However, this is a single, contrived example, and I'd rather know for sure. From Euler we've learned that $z=re^{i\theta}$.  And it's easy to see that $|z|^2=r^2$, since $re^{i\theta}\times re^{-i\theta}=r^2$.  Why must we use e to represent these numbers correctly? It seems that I could arbitrarily choose a different exponent $z=r\pi^{i\theta}$ and get the same size for $z$ as I did before: $|z|^2=r\pi^{i\theta}\times r\pi^{-i\theta}=r^2$  What did I miss? If a person was sitting on a craft that has accelerated to near light speed speed from Earth (e.g. 99.999% of light speed) would there be any impact on his or her human biology due to relativistic effects on mass, time and distance?    For example, would the heart still be able to pump blood effectively if the relativistic mass of the blood has increased?    Or would accelerating the blood a bit further towards light speed requires more energy than when stationary on earth? How do you keep user.config settings across different assembly versions in .net? Basically the problem is that each time the assembly version changes (i.e. the user installs a new version of the application) all their settings are reset the the defaults (or more accurately a new user.config file is created in a folder with a different version number as the name)  How can I keep the same settings when upgrading versions, since using ini files or the registry seem to be discouraged?  When we used Clickonce it seemed to be able to handle this, so it seems like it should be able to be done, but I'm not sure how. I have a Gary Fisher bike (wahoo I believe). I think it's considered the entry level Fisher mountain bike.  Could I put on disc brakes as opposed to using the standard  brakes on this bike?  Standard brakes are the rim brakes.   Thanks Carlos What information does the trace of a matrix give? How do I reset my manor so I can rebuild it with different options? How to export SVG without lines, polylines and polygons? Clipping LAS data using shapefile polygons and open source software? I am trying to clip or filter lidar files (.las, .xyz) using a shapefile that contains multiple polygons.  Is there open source software that can do this spatial operation?  My .las files are enormous, and I should say that I am very new to DEM data and analysis so any help would be very welcome. I have a Asus ROG G551VW laptop and I'm trying to install Ubuntu 16.04 on my laptop, but when i try to load the installer, my laptop just freezes and its fan starts working for no reason. I have tried to install Ubuntu 14.04 on my laptop and the installation went smoothly. What should I do if I want to install Ubuntu 16.04 on my laptop?  Any help would be greatly appreciated.