I'm using this MS SQL Script:       select NumberId, ART_No, InkColor       from INK_STOCK   and I have an output like this:       NumberId         ART_No          InkColor      ------------------------------------------      0010             23003             BLUE      0010             23003             RED      0010             23003             GREEN      0013             23004             ORANGE      0013             23004             PINK      0013             23004             WHITE      0015             23007             GREEN      0015             23007             PINK   How can I make the output should be like this:       NumberId         ART_No          InkColor      ------------------------------------------      0010             23003             BLUE, RED, GREEN      0013             23004             ORANGE, PINK, WHITE      0015             23007             GREEN, PINK   Thanks
How do I get:  id       Name       Value 1          A          4 1          B          8 2          C          9   to  id          Column 1          A:4, B:8 2          C:9
Postfix Connection Timed out I used the  tutorial below to setup postfix and dovecot on a Digital Ocean server. But I'm getting "Connection Timed out" when postfix/smtp tries to deliver an email to a remote host like gmail or yahoo..      RECEIVING A NEW MESSAGE /var/log/mail.log    Feb 2 22:33:38 localhost dovecot: auth-worker: Debug: Loading modules from directory: /usr/lib/dovecot/modules/auth  Feb 2 22:33:38 localhost dovecot: auth-worker: Debug: pam(app,189.63.49.XXX): lookup service=dovecot  Feb 2 22:33:38 localhost dovecot: auth-worker: Debug: pam(app,189.63.49.XXX): #1/1 style=1 msg=Password:   Feb 2 22:33:38 localhost dovecot: auth: Debug: client out: OK#0111#011user=app  Feb 2 22:33:40 localhost postfix/submission/smtpd[1045]: E9AA724264: client=unknown[189.63.49.XXX], sasl_method=PLAIN, sasl_username=app  Feb 2 22:33:43 localhost postfix/cleanup[1052]: E9AA724264: message-id=  Feb 2 22:33:43 localhost postfix/qmgr[32661]: E9AA724264: from=, size=485, nrcpt=1 (queue active)  Feb 2 22:33:45 localhost postfix/submission/smtpd[1045]: disconnect from unknown[189.63.49.XXX]  Feb 2 22:34:14 localhost postfix/smtp[1053]: connect to mta5.am0.yahoodns.net[98.136.216.25]:25: Connection timed out    Feb 2 22:24:21 localhost postfix/smtp[1013]: connect to mta6.am0.yahoodns.net[98.136.217.202]:25: Connection timed out  Feb 2 22:24:21 localhost postfix/smtp[1014]: connect to gmail-smtp-in.l.google.com[173.194.76.27]:25: Connection timed out  Feb 2 22:24:21 localhost postfix/smtp[1015]: connect to gmail-smtp-in.l.google.com[173.194.76.27]:25: Connection timed out  Feb 2 22:24:21 localhost postfix/smtp[1012]: connect to aspmx.l.google.com[173.194.68.27]:25: Connection timed out    Here is /etc/postfix/main.cf   /etc/postfix/master.cf   Result from #> netstat -nlptu Analogue of the Cantor-Bernstein-Schroeder theorem for general algebraic structures The Cantor-Bernstein-Schroeder theorem states that if there are two sets $A$ and $B$ such that there exist injective (alternatively, surjective, assuming choice I think) maps $A \to B$ and $B \to A$, then $A$ and $B$ are in bijection.  It then seems natural to try to strengthen the result to other structures.  If $A$ and $B$ are, say, groups (or rings, modules, etc) such that there are injective homomorphisms from each to the other, then $A$ and $B$ are isomorphic.  I'm wondering if there are any results on this, or if there are known counterexamples.  The theorem for sets alone is nontrivial, so I feel like any results about how it holds for other structures would be quite interesting. Let $y$ be a differentiable function on $\mathbb{R}$. If  $$\lim_{x\rightarrow \infty}(y(x)+y'(x))=0$$ Then how does one show that $$\lim_{x\rightarrow \infty}y(x)=0$$ I'd appreciate some help on this problem. Thanks a lot. How would you count occurrences of a string (actually a char) within a string? I am doing something where I realised I wanted to count how many /s I could find in a string, and then it struck me, that there were several ways to do it, but couldn't decide on what the best (or easiest) was.  At the moment I'm going with something like:  string source = "/once/upon/a/time/"; int count = source.Length - source.Replace("/", "").Length;   But I don't like it at all, any takers?  I don't really want to dig out RegEx for this, do I?  I know my string is going to have the term I'm searching for, so you can assume that...  Of course for strings where length > 1,  string haystack = "/once/upon/a/time"; string needle = "/"; int needleCount = ( haystack.Length - haystack.Replace(needle,"").Length ) / needle.Length; Comment character counter does not trim, while the server does If $f^2$ is Riemann Integrable is $f$ always Riemann Integrable? Show that $\ker \hat{T} = \text{ann}(\text{range } T)$ What is the difference between a "link function" and a "canonical link function" for GLM TAR 6 GB worth of files into separate 1.9 GB TAR files I have 28,000 files of size 6.7 GB in the directory aaa/input. I need create TAR files in the directory aaa/output, such that each TAR file cannot exceed 1.9 GB, so I have to tar the 28,000 files into 4 TAR files (6.7/1.9) as Log_(current date)_01.tar Log_(current date)_02.tar ... etc.  such that each tarball is less than 1.9 GB. Is there a way to do this using a Unix script? Switch statement fallthrough in C#? Switch statement fallthrough is one of my personal major reasons for loving switch vs. if/else if constructs. An example is in order here:  static string NumberToWords(int number) {     string[] numbers = new string[]          { "", "one", "two", "three", "four", "five",            "six", "seven", "eight", "nine" };     string[] tens = new string[]          { "", "", "twenty", "thirty", "forty", "fifty",            "sixty", "seventy", "eighty", "ninety" };     string[] teens = new string[]         { "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen",           "sixteen", "seventeen", "eighteen", "nineteen" };      string ans = "";     switch (number.ToString().Length)     {         case 3:             ans += string.Format("{0} hundred and ", numbers[number / 100]);         case 2:             int t = (number / 10) % 10;             if (t == 1)             {                 ans += teens[number % 10];                 break;             }             else if (t &gt; 1)                 ans += string.Format("{0}-", tens[t]);         case 1:             int o = number % 10;             ans += numbers[o];              break;         default:             throw new ArgumentException("number");     }     return ans; }   The smart people are cringing because the string[]s should be declared outside the function: well, they are, this is just an example.  The compiler fails with the following error:   Control cannot fall through from one case label ('case 3:') to another Control cannot fall through from one case label ('case 2:') to another   Why? And is there any way to get this sort of behaviour without having three ifs? How to archive the whole website? To save a single page via Wayback Machine I can go to:      How can I archive the website recursively by Wayback Machine?    There is some project such as , but I'm looking for a feature which allows me the upload the website recursively. What are those characteristics by which every sound can be identified uniquely? CK2 is a big game with lots of variables, so I'll stick to adding them upon being requested to minimize the hassle.  Anyway, let's say that you have a lot of children and the oldest one claims all the land according to laws of succession. After the father dies, the circumstances will obviously piss off a lot of people (in my case that would be 6 out of 8 vassals and 4 siblings with an opinion of -50 and below one of which is a sister married to the Basileus of the Byzantine friggin' Empire, a case of excommunication, 4 failed assassination attempts under 3 years... and lots and lots of vikings). Let's also say that the current playable character is completely incompetent compare to the next sibling in line.  So, what would be the most optimal methods to off myself without further screwing over the countryside so the next heir in line has to fix it (if we assume that said heir is actually capable of doing so)?  This is my list of DLCs (not including music and unit packs):   Charlemange Legacy of Rome Sword of Islam The Republic Way of Life I've seen plots of test/training error suddenly dropping at certain epoch(s) a few times during the neural network training, and I wonder what causes these performance jumps:    This image is taken from Kaiming He's Github, but similar plots show up in many papers. forecast using arima models I am trying to predict values using arima(0,1,1). After doing predict(mod,n.ahead=5) (in R) am getting the same value for all the predictions:   5947.681 5947.681 5947.681 5947.681 5947.681    Is it correct? How do I remove a file I accidentally created named $file? I was working on a shell script and I accidentally created a file with the variable as its name. Now I have $file in my ls output, and cannot remove it.  What can I do? I downloaded the July 30th update for Pokemon Go and when I open the app I'm prompted to login, But once I login, it redirects me to this page on Cookies::     If I click "Done" in the top left, it prompts me to login again! I've tried reinstalling the game, restarting my phone, etc. I can't much enable Cookies on the inline Safari browser. It doesn't make sense, and cookies are on in Safari (because I don't use Safari and they're enabled by default).  How can I fix this? LaTeX template for typesetting a novel The following question was asked on a high school test, where the students were given a few minutes per question, at most:     Given that,   $$P(x)=x^{104}+x^{93}+x^{82}+x^{71}+1$$   and,   $$Q(x)=x^4+x^3+x^2+x+1$$   what is the remainder of $P(x)$ divided by $Q(x)$?     The given answer was:     Let $Q(x)=0$. Multiplying both sides by $x-1$:   $$(x-1)(x^4+x^3+x^2+x+1)=0 \implies x^5 - 1=0 \implies x^5 = 1$$   Substituting $x^5=1$ in $P(x)$ gives $x^4+x^3+x^2+x+1$. Thus,   $$P(x)\equiv\mathbf0\pmod{Q(x)}$$     Obviously, a student is required to come up with a “trick” rather than doing brute force polynomial division. How is the student supposed to think of the suggested method? Is it obvious? How else could one approach the problem? Design Review: 3.3V Logic to 12V Logic (Uni-directional and Bi-directional) I'm looking for feedback and improvements on my design below. Specific questions are at the end. I created this as an attempt to answer my own, . From my feedback there, it seems like I needed to be more clear in my requirements. These are screenshots from Eagle. If there's a better way to share, please let me know so I can correct it. Entire board  The overall purpose of this board is to translate between 12V logic, and 3.3V logic. The top portion of the board represents the 12V side. The LEDs are placeholders to indicate whether the 12V signal is HIGH or LOW. In practice, these would be replaced with more , requiring up to 3A. The switches are also placeholders, allowing one to manually turn the 12V signal on and off. They are only for test purposes, the &quot;real&quot; 12V signal would be coming as the output from other relays. The bottom half is the 3.3V side. This will be connected to a  (BBB). The board will connect to 2 output GPIO pins and 2 input GPIO pins of the BBB. Overall, I want to translate the 3.3V I/O from the BBB to the 12V signals on the other side (to control more relays and read their signals). I have designed 3 modules to control both directions individually, and together. 3V3_TO_12V Module  This module converts the 3.3V GPIO output from the BBB to a 12V signal on the other side. When the 3.3V signal is low, the 12V signal is low. When the 3.3V signal is high, the 12V signal is high. To do this, the 3.3V GPIO output is connect to a , which turns a  relay on and off. This switches the 12V power as output of the module to be used elsewhere. 12V_TO_3V3 Module  This module converts a 12V signal to 3.3V signal, to be read by a GPIO input from the BBB on the other side. When the 12V signal is low, the 3.3V signal is low. When the 12V signal is high, the 3.3V signal is high. To do this, the 12V signal simply turns a  relay on and off. This switches the 3.3V power to be read as input by the BBB. DUAL_12V↔3V3 Module  This module combines the previous two modules to create a bidirectional translation. If the 12V side is high, the 3.3V input to the BBB GPIO should be high. If the 3.3V output from the BBB GPIO is high, then the 12V side should be high too. It's similar to a logical OR, if either side is high, the corresponding signal on the other side should be high too. A single 12V signal has to be split into individual input and output signals on the 3.3V side for the BBB. Questions  Is the  and  relay combination overkill for having the BBB GPIO output control the 12V power line? I like the isolation and safety it provides, but it seems too much (in terms of cost and board space) Is there a better solution for the 12V to 3.3V conversion. I like the simplicity of the  relay switching a 3.3V signal, but it takes up lots of room. Does the DUAL_12V↔3V3 Module (which combines each translation direction) even make sense? This seems wasteful to use 2 relays and a high side driver, but I haven't found simpler solution that achieves the same result. Should I add pulldown resistors for the BBB GPIO inputs, or are the internal pulldown resistors good enough?  Any other feedback is welcome. I'm new to electronic design.