str1 = ‘This is Pyhton’ print ("Slice of String : ", str1[1 : 4 : 1]) print ("Slice of String : ", str1[0 : -1 : 2])
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.
Want to install Ubuntu on Chromebook Prove the divergence of the sequence $\left\{ \sin(n) \right\}_{n=1}^{\infty}$. I am looking for nice ways of proving the divergence of the sequence $\left\{x_n\right\}_{n=1}^{\infty}$ defined by $$x_n=\sin{(n)}.$$ One (not so nice) way is to construct two subsequences: one where the indexes are picked such that they lie in the intervals  $$I_k=\left(\dfrac{\pi}{6}+2\pi(k-1),\dfrac{5\pi}{6}+2\pi(k-1)\right)$$ and one where they lie in $$J_k=\left(\dfrac{7\pi}{6}+2\pi(k-1),\dfrac{11\pi}{6}+2\pi(k-1)\right).$$ If ${x_n}$ converges, then all its subsequences must converge to the same limit, but here the first subsequence has all its values in the interval $\left[ \frac{1}{2}, 1\right]$ while the second has its values in $\left[-1,-\frac{1}{2}\right]$. Contradiction.  Filling the details of this proof is rather tedious and not very elegant. Anyone has a better idea? I have a laptop which I hook up to an external display when I'm at home. I also connected an external keyboard and mouse which makes it more comfortable for me.  I have noticed that pressing caps lock on the external keyboard does not light up the capslock indicator of the laptop keyboard (and vice versa).  When googling, I came across the setleds function, but when I type it into a console all I get is this:  KDGKBLED: Inappropriate ioctl for device Error reading current flags setting. Maybe you are not on the console?   Any idea if I can get this working? Is $\frac{1}{\sqrt{2}}$ a fraction or not?   I just came across a Grade 8 student's class work where the teacher has given the above as an example to differentiate fractions from rational numbers. I think this is wrong fundamentally, as $\sqrt2$ is irrational while all fractions would be rational. Please advise. Thanks! Show that if terms of a series have ratio less than the ratio of convergent series, then the series converges We have two infinite series $\sum a_n $ and $\sum b_n$, such that $a_n &gt; 0,\ b_n &gt; 0$ and $a_{n + 1}/a_n \leq b_{n + 1}/b_n$ for all $n$. Show that if $\sum b_n$ converges, then $\sum a_n$ also converges.   Any hints on how to prove this? I can sort of picture why this must be true, but I'm not sure how to prove this rigorously. I'm not sure using the ratio test would help here.. unable to reset root password of mysql I need to reset the root password of my local mysql installation but it woudln't let me. I've tried this:  $ sudo /etc/init.d/mysql stop  * Stopping MySQL database server mysqld                                                                                                              [ OK ]  [1]-  Exit 1                  sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking [2]+  Exit 1                  sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking reg@regDesktopHome:~$ sudo mysqld --skip-grant-tables &amp; [1] 13651 reg@regDesktopHome:~$ 140627 19:02:02 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.  reg@regDesktopHome:~$ mysql -u root mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) reg@regDesktopHome:~$ sudo mysql -u root mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) [1]+  Exit 1                  sudo mysqld --skip-grant-tables   How can I get the password reset? edit 1 I got this:  $ ps ax| grep mysql 16515 ?        Ssl    0:00 /usr/sbin/mysqld 16551 pts/23   S+     0:00 grep --color=auto mysql reg@regDesktopHome:~/semios/v3upgrade$ sudo kill -9 16515 reg@regDesktopHome:~/semios/v3upgrade$ ps ax| grep mysql 16678 ?        Ssl    0:00 /usr/sbin/mysqld 16715 pts/23   S+     0:00 grep --color=auto mysql reg@regDesktopHome:~/semios/v3upgrade$ mysql -u root ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)   looks like a process is automatically restarting mysql as soon as I kill it... Is it possible to append to innerHTML without destroying descendants' event listeners? In the following example code, I attach an onclick event handler to the span containing the text "foo". The handler is an anonymous function that pops up an alert().  However, if I assign to the parent node's innerHTML, this onclick event handler gets destroyed - clicking "foo" fails to pop up the alert box.  Is this fixable?  &lt;html&gt;  &lt;head&gt;  &lt;script type="text/javascript"&gt;    function start () {     myspan = document.getElementById("myspan");     myspan.onclick = function() { alert ("hi"); };      mydiv = document.getElementById("mydiv");     mydiv.innerHTML += "bar";   }   &lt;/script&gt;  &lt;/head&gt;   &lt;body onload="start()"&gt;    &lt;div id="mydiv" style="border: solid red 2px"&gt;      &lt;span id="myspan"&gt;foo&lt;/span&gt;    &lt;/div&gt;  &lt;/body&gt;  &lt;/html&gt; Question: If $R$ is a finite boolean ring, then show $R \cong \mathbb Z_2 \times \mathbb Z_2 \times \cdots\times \mathbb Z_2$.   I know that   $\mathrm{char}(R) =2$  $R$ has $2^k$ elements for some $k$  (this is because, if $p\neq 2$ is a prime with $p\mid|R|$, then there exists a non-zero $x \in R$ s.t. $px=0$ and $p $ is odd $\implies x=0$, contradiction).   Does this suffice to answer my question? Code coverage for wrapper class is 0% I have written below Wrapper class.  global class BI_VA_AutomationWrapper {      global class BI_VA_AutomationRequest {      webservice String userName;     webservice String emailId;     webservice String buinessUnit;     webservice String orgName;     webservice String country;     webservice String environment;     webservice String myShopNumber;     webservice String BidsId;//for testing     webservice String Type; //for testing  }  global class BI_VA_AutomationResponse {      webservice String responseStatus;     webservice String myShopNumber;     //webservice list&lt;Error&gt; errorMessages;     webservice String  errorMessages;//for testing   } global class BI_VA_Error {      webservice String type;     webservice String message;    }}   And test class is,  @isTest public class BI_VA_AutomationWrapperTestClass  { public static testMethod void unitTest(){      BI_VA_AutomationWrapper.BI_VA_AutomationRequest wrap= new BI_VA_AutomationWrapper.BI_VA_AutomationRequest();        wrap.userName='Test@test.com';     wrap.emailId='Test@test11.com';     wrap.buinessUnit='AH';     wrap.orgName='ORD';     wrap.country='US';     wrap.environment='QA';     wrap.myShopNumber='123456789';     wrap.BidsId='123';     wrap.Type='ResetPassword';              BI_VA_AutomationWrapper.BI_VA_AutomationResponse res= new BI_VA_AutomationWrapper.BI_VA_AutomationResponse();     res.responseStatus = 'Success';     res.myShopNumber = '987654321';     res.errorMessages = 'Test error';      BI_VA_AutomationWrapper.BI_VA_Error error = new BI_VA_AutomationWrapper.BI_VA_Error();     error.type = 'Test';     error.message = 'Test';  }}   Code coverage is 0% only. Blog Overflow database error durbinWatsonTest() in R for non time-series data I am trying to understand whether the Durbin-Watson test is meaningful at all when applied to regression data that have no temporal order (eg. blood pressure ~ bodyMassIndex + exercise).   I would say no, as the autocorrelation should obviously vary with the order of the subjects (which is random), but I wonder whether the durbinWatsonTest in R involves a bootstrapping of the data, where order of the bootstrapping data is shuffled each time, and then perhaps an average autocorrelation is computed over the bootstrapping samples (but then again, shouldn't this average autocorrelation be zero for randomly sampled data?).  On the other hand, the value of the statistics seems to be quite stable over multiple runs of the function, so I am even more confused...  I came across it in Andy Field's book "Discovering Statistics with R", where it is used is an example with non-time series data, although in another, more recent book of the same author ("Adventures in Statistics") it does say that the test is applicable only to time series data. "Pick up something" or "pick something up"? Subgroups of $U(n)$ isomorphic to a direct sum of cyclic groups Let $U(n)$ to be the set of all positive integers less then $n$ and relatively prime to $n$. Then $U(n)$ is a group under multiplication modulo $n$.  A. Find integer $n$ such that $U(n)$ contains subgroup isomorphic to $Z_5\oplus Z_5$.  B. Show that there is an $U(n)$ containing a subgroup isomorphic to $Z_3 \oplus  Z_3$, but not isomorphic to $Z_4 \oplus  Z_4$. Mothballs in the pantry: is it safe to keep food there? My roommate put some mothballs in the pantry and when I came home and saw them, I took them out.  They were probably only there for a few hours, but is it safe to store food in there?  Should I throw out the food that was in there together with the mothballs?  I'm leaning towards 'when in doubt throw it out' but I'm unsure whether that is overkill in this case. Can a regular salaried (w2) employee opt to pay quarterly taxes? As a consultant, I got used to paying quarterly taxes. Now that I'm a regular w2 salaried employee, I'm subject to normal withholding on each pay statement. I would like to keep making exact quarterly payments instead of having a (generally incorrect) amount held back each paycheck.   I haven't been able to find any information on the 1040-es that would make me think I'm ineligible to do so, but I suspect that it may be the case. I'd have to stop paycheck withholdings by updating my w4 to either have a high number of exemptions or mark myself as exempt from taxes, which I assume is where the rub lies.   So, as a regular salaryman, is it possible for me to pay taxes exclusively through quarterly payments in lieu of traditional withholdings? How to Implement Page Object and Page Factory Pattern in Selenium Webdriver? Is $\{\emptyset\}$ a subset of $\{\{\emptyset\}\}$? $\{\emptyset\}$ is a set containing the empty set. Is $\{\emptyset\}$ a subset of $\{\{\emptyset\}\}$?  My hypothesis is yes by looking at the form of "the superset $\{\{\emptyset\}\}$" which contains "the subset $\{\emptyset\}$". In a multiple linear regression, why is it possible to have a highly significant F statistic (p&lt;.001) but have very high p-values on all the regressor's t tests?  In my model, there are 10 regressors. One has a p-value of 0.1 and the rest are above 0.9    For dealing with this problem see the . $\epsilon$ undefined using Minion Pro with pdftex I'm using MiKTeX 2.9 and have recently installed the Minion Pro fonts for use with pdftex. I followed the instructions available on  to install them.  Everything works as expected, but in place of the Greek letter epsilon I get a box with a cross (see below), and the following warning:    I found the issue was reported , but I still can't fix it. xelatex works fine, but I'd like to to stick to pdftex so I can use microtype.  \documentclass{article}  \usepackage[T1]{fontenc} \usepackage{MinionPro}  \begin{document}  Text here. $\epsilon$  \end{document}       UPDATE: a set of instructions for the installation of the up-to-date FontPro scripts with MiKTeX can be found . Does opacity:0 have exactly the same effect as visibility:hidden