Divisibility Rules for Bases other than $10$ I still remember the feeling, when I learned that a number is divisible by $3$, if the digit sum is divisible by $3$. The general way to get these rules for the regular decimal system is asked/answered here: . Now I wonder, what divisibility rules an alien with $12$ (or $42$) fingers would come up with?  So let $n=\sum_k c_k b^k$ be the representation with base $b$. Looking at some examples shows indicate that $n$ is divisible by $b-1$, if $\sum_k c_k$ is. This seems to be a poor man's extension to the decimal divisibility by $9$ rule.  The answer to the above mentioned question, says that "One needn't memorize motley exotic divisibility tests. ". Motley exotic divisibility tests are very welcome here!
Division rules for other number systems? How could we make the same division rules for other number systems, like in our decimal system: a number is divisible with 2 if it's last digit is 0,2,4,6,8, by 3 if the sum of digits is divisible with 3, and so on.  Can we do the same rules for g-based number systems too, where g is not 10, and greater than 1?
Can it happen that the image of a functor is not a category? Drawing/Sketching Tool for elaborating questions More often than not I need to elaborate my question put up on Stack Overflow with a custom sketch, UML class diagram, flow chart.    It is in these times I have to open up a custom paint software, factor out some diagrams, export it as an image, attach it to Stack Overflow. I wouldn't know how complicated it is to invest in having such a sketching or drawing tool integrated, It could even be a basic pen stripped off all the advanced features leaving it a bare minimum.  Such a tool if incorporated into the Stack Overflow "ask question" UI would be certainly helpful.  As of Today this Question has been visited around 170 times and 7 answers, This was meant to be the voice of Stack Overflow users. Would you need a Drawing Tool for you on the Stack Overflow site, would it help you to express you questions and answers better? Sadly, only 2, or 3 answers are in the context of the question. The bounty was meant to be a bait and even that ends tomorrow. Hope you'll get the will and the zest to comment on this question today and in the future . How to trim whitespace from a Bash variable? Homeomorphism of the real line-Topology What's the difference between a microcontroller and a microprocessor? Let $\{x_n\}$ and $\{y_n\}$ be sequences of real numbers which converge to $\ell$ and $m$ respectively. Show that  $$\lim_{n\to \infty} \frac{1}{n}\sum_{k=1}^{n}x_ky_{n+1-k}=\ell m$$  This is a problem I found in a book, it seemed to be routine, but now I can't solve it.  What I tried :     Let us take some $\epsilon&gt;0$. Now after a stage $N$, both $|x_n-\ell|&lt;\epsilon$ and $|y_n-m|&lt;\epsilon$. Now I wanted to break the sum $$\left|\frac{1}{n}\sum_{k=1}^{n}x_ky_{n+1-k}-\ell m\right|$$in two parts, one upto $N$, and other one for $N+1$ to $n$. Now we need this to be arbitrarily small. But here I am lost. I don't know how to proceed anymore. Because when I take $x_i's$ to make up a finite sum, then the $y_j's$ are there too with $j$ very large. I think this is the main idea, but unable to do anything further. Can someone help me? Thanks. What is the difference between a static and a non-static initialization code block My question is about one particular usage of static keyword. It is possible to use static keyword to cover a code block within a class which does not belong to any function. For example following code compiles:  public class Test {     private static final int a;         static {         a = 5;         doSomething(a);     }     private static int doSomething(int x) {         return (x+5);     } }   If you remove the static keyword it complains because the variable a is final. However it is possible to remove both final and static keywords and make it compile.   It is confusing for me in both ways. How am I supposed to have a code section that does not belong to any method? How is it possible to invoke it? In general, what is the purpose of this usage? Or better, where can I find documentation about this? Difference between correlation and covariance: is covariance only useful if the relation is linear? I'm trying to understand better the difference between  covariance and correlation, besides the fact that the correlation coefficient is a dimensional and has values between $-1$ and $1$.   One unclear point is the following: the correlation coefficient can highlight only a linear relation between two variables, but does  covariance only work for linear relations too? Supposing that the relation is not linear, is the covariance not zero? Is it bigger than in the case in which the relation is linear?   Cauchy inequality says $$|\sigma_{xy}|&lt;\sigma_{x} \sigma_{y}$$  Which seems to say that the covariance is maximum when there is a perfect linear relation.    So I do not get what does happen if the relation is not linear, and, if covariance is not a suitable parameter in that cas I don't get the reason for that, since simply looking at the definition:  $$\sigma_{xy}=\frac{\sum(x-\bar{x})(y-\bar{y})}{N}$$  it looks like that this should be non zero for any kind of relation (like parabolic).  So can this be a difference between the use of covariance and correlation coefficient? (The first is useful for any kind of relation, the second one only for linear ones). How to schedule a cron job to run a video fill every 5 minute? How do I use jpnevulator to capture and log the serial traffic between an application and hardware serial port? OK, I've been googling for hours so I obviously have not been able to understand the answers to the various questions that have already been asked about this subject.  I am hoping that, by asking the question again in a more specific way, I will be able to get an answer I can understand.  I have some application running in linux that communicates with an external device attached to a serial port.  I want be able to capture and log the data sent in both directions between the application and the device, with timestamps at the beginning of each line in the file.  As a test case, I am using minicom as the application I want to monitor, connected via a null modem cable to another computer also running minicom.  I have already confirmed that, if I type characters on either of the computers, characters appear in the other computer's terminal.  So far, so good.  I then found this question:    In the answer to this question, the program jpnevulator is suggested.  However, when reviewing the man page, I could not figure out the right way to use jpnevulator to get what I want.  Here is what I tried to do:  First, I opened a terminal window and typed the following command:  $jpnevulator --tty=/dev/ttyS0 --pty --pass --read --ascii --timing-print --file=serial.log   I saw the output:     jpnevulator: slave pts device is /dev/pts/18  I then opened another terminal window and typed the following command:  minicom -D/dev/pts/18 -b115200   Minicom opened without complaint.  However, when I typed characters in either terminal (local and remote), nothing appeared in either terminal.  jpnevulator only logged the data written to /dev/pts/18.  My expectation is that jpnevulator :   reads data from /dev/pts/18 and "passes" this data on to /dev/ttyS0 while also writing this data to the specified file. reads data from /dev/ttyS0 and "passes" this data on to /dev/pts/18 while also writing this data to the specified file.   I am aware of the remark in the faq that says "Jpnevulator was never built to sit in between the kernel and your application. I'm sorry."  However the very same faq states in the second paragraph down: "Now with a little bit of luck some good news: A little while ago Eric Shattow suggested to use pseudo-terminal devices to sit in between the kernel and your application."  That is the approach I am trying to take but I am having no success.  What am I missing?  Thanks to all in advance.  Cheers, Allan  p.s. I was successfully able to capture the back and forth traffic using the socat method mentioned in the existing question I referenced but this method did not offer any way of timestamping the traffic.  I was hoping that jpnevulator would have provided this for me. I have opened Disks program today and noticed that there is FAILING in the Assessment column for the SMART status.     What does this error mean? Is it serious problem?  I have Lenovo G50-45 laptop, disk is SEAGATE ST1000LM014-SSHD-8GB(LVD3) 1TB SSHD with 8GB NAND Flash (original disk in this latop).  Update 2017-09-24:  The disk has died yesterday. 1 year and 3 months have passed since 1st hint of problem. About 4 months ago I had few issues with it not booting, but I was able to make another clean install. Since yesterday the disk is non-responsive. As this was long expected I had backup of all important data.(!) The disk was about 2 years old, so that was quite premature death. xgboost tayler expansion detail This is the objective function for Xgboost.  I have no idea where $g_{i}$ and $h_{i}$ came from  is some one explain how this two terms came form?  or direct me to the related tutorial page then I will search for it Identical creatures entering the battlefield If I have two cards called  in hand and I play my first, Sin Collector (A). I use its triggered ability.   "When Sin Collector enters the battlefield, target opponent reveals his or her hand. You choose an instant or sorcery card from it and exile that card."  Now, I play Sin Collector (B), I use B's triggered ability.  But now my question. Does Sin Collector (A)'s ability trigger again as well? 'Sin Collector' entered the battlefield again, right? How do I add a repository from behind a proxy? I've a problem at the office. We're behind a proxy (which is set and applied at ubuntu proxy settings) and when I try to add a repository from terminal, I get:      Error reading --some url here--: urlopen error [Errno 113] No route to host   I've tried with   Launchpad-getkeys script. I get this (image)      I've tried with another "hack", without luck   Press Alt-F2 and type gksu gedit /usr/lib/python2.6/dist-packages/softwareproperties/ppa.py Find line 88, change keyserver.ubuntu.com to hkp://keyserver.ubuntu.com:80 Save, close and reboot.    Does anyone know if I could solve this problem in any way? Thanks Let us say we have the following Makefile  include config.mk  # Generate summary table. results.txt : $(ZIPF_SRC) isles.dat abyss.dat last.dat     $(ZIPF_EXE) *.dat &gt; $@  # Count words. .PHONY : dats dats : isles.dat abyss.dat last.dat  %.dat : books/%.txt $(COUNT_SRC)     $(COUNT_EXE) $&lt; $*.dat  .PHONY : clean clean :     rm -f *.dat     rm -f results.txt   where all the variables are defined in config.mk  LANGUAGE=python COUNT_SRC=countwords.py COUNT_EXE=$(LANGUAGE) $(COUNT_SRC) ZIPF_SRC=testzipf.py ZIPF_EXE=$(LANGUAGE) $(ZIPF_SRC)   Is there any tool available that can expand all the include lines within the makefile so as to produce a bigMakefile? If such a tool does not currently exist, can a python/perl/awk/bash script be cooked up to achieve this goal? In Book 1, Artemis et al escaped from the time stop by drugging themselves to sleep.  In the same time stop, Julius Root "accidentally" plugged Briar Cudgeon with a tranquilizer dart.  Cudgeon fell asleep, but did not disappear from the time stop.  Why not? If I write the following class:  public class Example {        int j;       int k;        public Example(int j, int k) {            j = j;            k = k;       }        public static void main(String[] args) {            Example exm = new Example(1,2);            System.out.println(exm.j);            System.out.println(exm.k);       }  }   The program compiles, but when I run the program, the main method will print out two 0s. I know that in order to say that I want to initialize the instance variables in the constructor I have to write:  this.j = j; this.k = k;   But if I don't write it, then which variable is evaluated (or considered) in the constructor (on the left and on the write hand side of the expressions)? Is is the argument or the instance variable? Does it make a difference?  Are there other cases where the use of this is obligatory? Proof that a sequence converges. What would happen if you put your hand in front of the 7 TeV beam at LHC? Some speculation here:   Is there a possibility it would pass 'undetected' through your hand, or is it certain death?  Can you conclude it to be vital, or only loose your hand?  Would it simply make a small cylindrical hole through your hand, or is there some sort of explosion-effect?  Assume your hand has a cross section of 50cm², and a thickness of 2cm, how much of the beam's energy would be transferred to your hand? Doing bad in undergraduate but good in a masters program Suppose you do bad in undergraduate school in say computer science. But you do very well in a masters program in computer science. If you want to apply to a PhD program in computer science, will the masters degree grades offset the undergraduate degree grades?