Okay, I'm sure this question is a bit trivial, but I'm curious!  In python, it is completely legal to do this:  a = [1,2,3,4,5] print(a[:123])  &gt;&gt; [1, 2, 3, 4, 5]   but as soon as you try to do this:  a = [1,2,3,4,5] print(a[123])  &gt;&gt; IndexError: list index out of range   Why is this so, in the context of how it is stored in memory and interpreted by the compiler?   I have tried storing the first example in a variable and checking the length of that variable but it is simply the length of the original list, ignoring the subsequent empty places.   I'm genuinely curious and interested to see what the answers are!
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.
How to set metadata for music files? In windows music files have metadata like artist name, album name associated with them. How is this metadata stored. Is it stored in file system like other file attributes or is it part of MP3 data that Windows Explorer extracts using a MP3 reader plugin?  Is it possible to read/change this information in Linux? Is it possible with commandline?  (I know these attributes can be set using Rhythymbox or some music player but I'm curious if these could also be set directly. Like in Windows the windows itself shows you artist information if you right click the file and open properties dialog) i m using ubuntu 10.10. please tell me how to type in hindi fonts in open office word. please help For bash script, I can use "$@" to access arguments. What's the equivalent when I use an alias? Can I use a one time pad key twice with random plaintext? I understand the basics of OTP: $|\text{key space}| = |\text{plaintext space}|$ implies perfect security, key reuse destroys this.  Cryptanalysis on the $N$-Time Pad for $N &gt; 1$ involves finding patterns in the ciphertext; this, however, all seems based on the premise that patterns exist in the plaintext (e.g. English language).  My question is: if $m_1$ and $m_2$ are two truly random strings, and they are both encrypted with the same OTP key to yield $c_1$ and $c_2$, is it possible to recover $m_1$ and $m_2$ from $c_1$ and $c_2$?  In other words: while "perfect security" (aka perfect indistinguishability) is obviously lost (constructing a distinguisher for two messages is trivial), is the plaintext still safe? I want to run a ppp connection when my USB modem is connected, so I use this udev rule:  ACTION=="add", SUBSYSTEM=="tty", ATTRS{idVendor}=="16d8",\     RUN+="/usr/local/bin/newPPP.sh $env{DEVNAME}"  (My modem appears in /dev as ttyACM0)  newPPP.sh:  #!/bin/bash /usr/bin/pon prov $1 &gt;/dev/null 2&gt;&amp;1 &amp;   Problem:  The udev event fires, and newPPP.sh is running, but newPPP.sh process is killed after ~4-5s. ppp does not have time to connect (its timeout is 10s for dial up).  How can I run a long time process, that will not be killed?  I tried using nohup, but it didn't work either.  System: Arch Linux  Update  I found a solution , thanks to .  I use at now to run my job detached from udev process.  But the one question remains unanswered: Why do nohup and &amp; not work? Last digits, numbers Can anyone please help me?  1) Find the last digit of $7^{12345}$   2) Find the last 2 digits of $3^{3^{2014}}$.  Attempt: 1)  By just setting the powers of $7$ we have $7^1 = 7$, $7^2=49$, $7^3=343$, $7^4 = 2401$, $7^5 = 16807$, $7^6 = 117649$, $\dots$  After the power of $4$, the last digits will repeat. Then by noticing the pattern the digits will end in $7,9,3$ and $1$.  Then we can divide the exponent $(12345)$ by $4$ since this is the cycle that makes it repeat. Then $12345 : 4$ has remainder $1$. So $7^1 = 7$ is the unit digit to $7^{12345}$.   So the last digit is $7$.   I know how to do it like this, the problem does not state how to find the last digit, but I know it has something do do with Euler's theorem.  for part $2$) I don't know how to start. Can anyone please help me?   Thank you for the help. Encouraging software publishers to use StackExchange as support mechanism How do I get 0-padded numbers in {} (brace expansion)? I'm trying to write a simple script to retrieve mem and swap usage from a list of hosts. Currently the only way I've been able to achieve this is to write 3 seperate scripts:  for a in {1..9}; do echo "bvrprdsve00$a; $(ssh -q bvrprdsve00$a "echo \$(free -m|grep Mem|/bin/awk '{print \$4}';free -m|grep Swap|/bin/awk '{print \$4}')")"; done &gt; /tmp/svemem.txt; for a in {10..99}; do echo "bvrprdsve0$a; $(ssh -q bvrprdsve0$a "echo \$(free -m|grep Mem|/bin/awk '{print \$4}';free -m|grep Swap|/bin/awk '{print \$4}')")"; done &gt;&gt; /tmp/svemem.txt; for a in {100..218}; do echo "bvrprdsve$a; $(ssh -q bvrprdsve$a "echo \$(free -m|grep Mem|/bin/awk '{print \$4}';free -m|grep Swap|/bin/awk '{print \$4}')")"; done &gt;&gt; /tmp/svemem.txt   The reason for this is that the hostname always ends in a 3 digit number and these hosts go from 001-218 so I've needed to do a different for loop for each set (001-009, 010-099, 100-218). Is there a way in which I can do this in one script instead of joining 3 together? Is it possible to configure Windows 7 to use YYYY-MM-DD instead of DD/MM/YYYY as the date format? How? Where? Variable declaration placement in C How to turn off "unread messages" feature on Windows XP login screen? In Windows XP, if you have logged onto Windows Live Messenger at some point, then it'll start displaying how many unread messages on the Windows login screen. How can I turn it off? I'm trying to make a command block that spawns an item in front of you if you are holding an item with a specific name. I've got these two working scripts;  /testfor @p[r=10] {Inventory:[{tag:{display:{Name:"Item Name"}}}]}  /testfor @p[r=10] {SelectedItemSlot:0,Inventory:[{Slot:0b,­id:"minecraft:diamond_sword"}]­}   but I can't get them together. The block should only look for an item in the active slot. When asking about , people sometimes refer to the strict aliasing rule. What are they talking about? Let $G(r, n)$ be the Grassmannian of the set of all $r$-planes in a $n$-dim vector space. How to show that the cohomology of a Grassmannian has a basis consisting of the equivalent classes represented by Schubert cycles? I am confused since I don't know how to compute the cohomology of a variety (how to construct the co-chain complex). I am really appreciate if you can compute the cohomology of, for example, $G(2,4)$ and show that it has a basis consisting of the equivalent classes represented by Schubert cycles. How do I clone a generic list in C#? Is there any easy LINQ expression to concatenate my entire List&lt;string&gt; collection items to a single string with a delimiter character?  What if the collection is of custom objects instead of string? Imagine I need to concatenate on object.Name. In Magic, at the start of the game, you draw 7 cards. How would you calculate the likelihood of drawing a specific card in your opening hand?  For example, let's say I have a 60 card deck, and I'm running 4 . What is the percent chance that I will have at least one Bird in my opening hand? I am a kid trying to teach myself Calculus in order to prepare for next year.   I have the expression  $$\lim_{x\to 2}\frac{\cos(\frac \pi x)}{x-2} $$  There is a hint that says to substitute t for $(\frac \pi2 - \frac \pi x)$ and WolframAlpha evaluates this expression as $\frac \pi4$. However, I got the answer of $1$. Can someone clarify the steps to solving this problem. How can I make Chrome open bookmarked pages in new tab by default? Current situation:  I am currently browsing a page (say, www.google.com). I want to open a bookmarked page (say, www.bing.com), but I want to keep the current page (Google) opened. I need to click on new tab, then click on the bookmark for Bing. Alternatively, I can right click and open Bing in new tab.  But I want none of those because why click twice when one is enough?    What I want:  I am currently on Google. I want to open Bing, so I click on the bookmark and Bing opens in a new tab. Google remains open.    I am aware of a duplicate question linked . However it didn't really provide a satisfactory answer. Changing every link to javascript breaks the icon and is a pain to do; middle clicking doesn't really work because I'm on a laptop and the touchpad does not support middle clicking. I hope there is an extension for Chrome that can redefine this behavior to the way I want. A hidden setting in Chrome would be even better but I doubt Chrome offers that. Terminal limits scrolling I have a running log, it outputs a lot to the terminal. Unfortunately, when I try to scroll up and view older output, it appears there is a limit. And I am unable to scroll past a certain point. On the Mac, the terminal allows you to scroll up to the start of the session. Is there a way to do this in ubuntu terminal?