Doing a python problem and trying to create a new string that omits a single char at index n. This works: newstr = str[:n] + str[n+1:]  but wondering why this didn't work: newstr = str[:n] + str[-1:-(n+1)]  Thanks in advance^
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.
Followup to "".  It is argued that even a tiny residual charge would result in huge amounts of electricity in bulk matter, everything would be different, etc. I do not find that a convincing answer: suppose $n$ protons plus $n+1$ electrons are neutral. Why wouldn't we also expect there to be $n$ protons to every $n+1$ electrons? That is, there is no bulk matter problem if every $n$'th atom is a negative ion (for hydrogen).  Now, what empirical lower bound can we give for $n$ in that kind of scenario? Prove if $f:[a,b] \rightarrow \mathbb{R}$ is integrable, then so is $|f|$ and $\left|\int_{a}^{b}f(x)dx\right| \leq \int_{a}^{b}|f(x)|dx$ Prove that if $f:[a,b] \rightarrow \mathbb{R}$ is integrable, then so is $|f|$ and $\left|\int_{a}^{b}f(x)dx\right| \leq \int_{a}^{b}|f(x)|dx$   I already proved that |f| is integrable, but how do I show that $|\int_{a}^{b}f(x)dx| \leq \int_{a}^{b}|f(x)|dx$   ? Get text between two strings Regex VB.Net HDMI over cat extender video Have Kylo Ren's Force abilities been shown before? I'm only familiar with the movies, so in The Force Awakens I saw some use of the Force that was new to me.  Most notable were these two abilities:      freezing blaster bolts in mid-air, and directly reading someone's mind like he tried with Rey.   Have either of these happened before? Change MySQL default character set to UTF-8 in my.cnf? How to get a UK visa refund I applied online for a visa application to the UK. I'm from Sri Lanka. Yesterday I cancelled the appointment, I changed my mind. I will not go to the visa appointment. Now my question is how I get my refund? When I open the file in Vim, I see strange ^M characters.  Unfortunately, the world's favorite search engine does not do well with special characters in queries, so I'm asking here:   What is this ^M character? How could it have got there? How do I get rid of it? Why does this test program result in a java.lang.IllegalMonitorStateException?  public class test {     static Integer foo = new Integer(1);     public static void main(String[] args) {         synchronized(foo) {             foo++;             foo.notifyAll();         }         System.err.println("Success");     } }   Result:  Exception in thread "main" java.lang.IllegalMonitorStateException         at java.lang.Object.notifyAll(Native Method)         at test.main(test.java:6) What should I do to avoid ear pain when flying? I always feel a pain in my ears when flying. Specially when descending. The last time I had extreme pain, feeling it inclusive around my eye balls. It felt like someone was touching the eye and pulling it from the inside. I really had to focus, close my eyes and hold to avoid screaming. I am not sure but I think both things might be related. Such a severe situation only happened once.  I just heard that with a cold the ear pain gets worse. I am bit worried that I might go through that situation again. I have a cold and I am going to fly soon.  What can I do to improve this?  I see that some consider this a duplicate of the question "best way to make my ears pop" but after reading the answers I think my question goes a bit beyond that since my pain is more extreme and I think it goes beyond just popping the ears. I also want to know if other methods, like using earplugs, might be effective. What is the function __construct used for? I have been noticing __construct a lot with classes. I did a little reading and surfing the web, but I couldn't find an explanation I could understand. I am just beginning with OOP.  I was wondering if someone could give me a general idea of what it is, and then a simple example of how it is used with PHP? Invert "if" statement to reduce nesting When I ran  on my code, for example:      if (some condition)     {         Some code...                 }   ReSharper gave me the above warning (Invert "if" statement to reduce nesting), and suggested the following correction:     if (!some condition) return;    Some code...   I would like to understand why that's better. I always thought that using "return" in the middle of a method problematic, somewhat like "goto". How can I easily encrypt a file? Searching for Google contacts not in Groups Possible Duplicate:          In Google Contacts, I've had Groups set up which look like this: All Contacts.. Family.. School.. Work.. etc.  Each contact I have is assigned to All Contacts. In addition, it is assigned to at least one more Group.  Sometimes when I add contacts, I forgot to bucket them in the respective groups, so I was wondering is there anyway I could do a search for contact that belongs toAll Contact-group, but does not belong to any other group ? I want to synchronise two folders in real time under Windows 7.  Basically, I want to monitor a folder and synchronise each change (new files, changed files, deleted files) to another drive. It has to be in real time, so it gets synchronised instantly when a change happens. A one-direction synchronisation is enough.  I tried Microsoft's , but it does only syncing by hand or scheduled (thus not satisfying the "real-time" requirement).  Can this be achieved with Windows 7 itself? If not, are there other methods of doing this? Not able to install Win Xp on Lenovo Ideapad z570 I want to install Win Xp on my Ideapad Z 570 laptop but i always get blue screen with message with some drive related problem which asks me to run CHKDSK command. I tried with that but no luck. Is there any way i can install Win Xp with SP 2 ?  Edit: i searched across the sites and came to know there could be some Compatibility problems, and i could fix it by setting HDD mode to IDE; will it solve the problem? Pass parameters to program started with Runas I am trying to start Performance monitor as different user. I found runas.exe but syntax for program arguments makes me go crazy. The following syntax works: C:\Windows\System32\runas.exe /user:domain\username perfmon.exe  But since perfmon.exe has the argument */res* the following line doesn't work: C:\Windows\System32\runas.exe /user:domain\username perfmon.exe /res  I tried to escape */res* but without any success. I tried: &quot;/res&quot; \&quot;/res\&quot;&quot; \&quot;\/res\&quot;&quot;  Any ideas? Is there any quality difference between PNG vs BMP image formats? I have just learned that PNG is a lossless image format while BMP can be both uncompressed or lossless format. Should there be a quality difference between these two? If not, does it mean that other lossless formats like TIFF, JPEG2000 and PNG offer the same quality as BMP? Can a Mac be used by different users at the same time?  I mean to say that we have a single Mac but 3 users. Can they access the same machine remotely at the same time for developing applications on iPhone or Mac?  Does Mac OS X server allow us to do this?  If so, how do I configure it for that? How do i know which wheels will fit my bike? my bike is:  and everything I have came with the bike, only now the axle of the rear wheel bent and the skewer has lost its grooves.  and I would like to replace the rear wheel with the 12 x 142mm version of:   I want to reuse the old casettes and disc break. I was told to buy new rotor bolts, will these do?   Will I be able to migrate all my previous parts onto this new wheel and will the wheel fit onto my bike?  update: A replacement axle would be prefered. What axle would work for my bike?