I have a simple script, that is essentially a list of dpkg -i ... commands in a chroot.  It looks something like this:  chroot /path/to/chroot /bin/bash -e &lt;&lt; EOF cd /opt  dpkg -i package1_*  dpkg -i package50_* dpkg -i package51_*  dpkg -i package100_*  EOF   The problem is, when I call the script like, bash -c "script here" or bash &lt;( echo "script here" ), i get an error message.  The error message looks something like:   Selecting previously unselected package libss2:i386. (Reading database ... 1376 files and directories currently installed.) Preparing to unpack libss2_1.42.9-3ubuntu1_i386.deb ... Unpacking libss2:i386 (1.42.9-3ubuntu1) ... Setting up libss2:i386 (1.42.9-3ubuntu1) ... Processing triggers for libc-bin (2.19-0ubuntu6.5) ... /bin/bash: d: not found   It seems like the code is cut off at d(pkg -i ...).  I changed the dpkg that is being cut off to an echo. The error message stayed the same, only that now e is not being found.  I could of course save the script in a temp file and call it, since that works. But I would like to know what is happening here. The cutoff mark (including the 'd') is at the 1048 byte point.
I'm running the following script on Ubuntu 14.04:  #!/bin/bash  apt-get purge -y nginx apt-get install -y nginx  date   When I run it like cat /tmp/script | bash, apt-get starts installing, then "date" is printed (not the actual date, but the command name), then the remaining apt-get output is printed.  If however I run the script like /tmp/script, it works as expected: printing the date after apt-get finished.  Why does this happen and how can I force bash to work when being piped to the same way it does when invoked directly?
Handle .bib in subfiles I have a problem very similar to the question being asked in  . My .bib is references in main.tex. When compiling main, everything works like a charm. Working on the subfiles, I have two issues though (which are most likely related):   I can't access the bib with auto-completion When compiling the subfile, it doesn't insert the citations.   I tried including  \bibliographystyle{plainnat} \bibliography{mybib}   in the subfiles, which also worked smoothly. Obviously, the bibs are included in every chapter of the document when compiling main.tex, then. I tried setting a global boolean in main.tex:  \newboolean{printBibInSubfiles} \setboolean{printBibInSubfiles}{false}    and in the subfiles:  \ifthenelse{\boolean{printBibInSubfiles}}    {}    {\bibliographystyle{plainnat}     \bibliography{../betterbib.bib}}    For some reason, then setting the boolean to false, the "bibliography"-header was printed in the subfiles as well as for the main file, but there was no output of citations under any of the "bibliography"-headers. Furthermore, compiling only the subfiles didn't work correctly.  My document structure is the following:  main.tex:  \begin[document] ... \subfile{sub/dataprocessing} ... \bibliographystyle{plainnat} \bibliography{mybib} \end{document}   the subfiles:  \documentclass[../main.tex]{subfiles} \begin{document} ... \cite{Random2014} ... \end{document}   After all this explanation: the only thing I want is to access the .bib from the subfiles without having to manually uncommenting something when compiling the main file. Any takers?  PS: Obviously, I also tried the solution provided in "" but couldn't get it to work. I don't know whether that would solve my problem anyway, since I don't have the \printbibliography-issue of the thread opener. raw_input in python without pressing enter So I am using  package for code examples. But there is a problem. When I copy the code examples from the final PDF document, they are usually not the same - the indentation is gone, there are random spaces after parenthesis, etc. Does anyone know how to make sure that the code that I copy from the final document is the same as I wrote it in the LaTeX document?  Here is what I mean. Compile this document:  \documentclass[12pt,oneside]{memoir}  \usepackage{listings} \usepackage[T1]{fontenc} \usepackage{xcolor} \usepackage{textcomp}  \definecolor{codebg}{HTML}{EEEEEE} \definecolor{codeframe}{HTML}{CCCCCC}  \lstset{language=Awk} \lstset{backgroundcolor=\color{codebg}} \lstset{frame=single} \lstset{framesep=10pt} \lstset{rulecolor=\color{codeframe}} \lstset{upquote=true} \lstset{basicstyle=\ttfamily} \lstset{showstringspaces=false}  \begin{document}  This code example prints out all users on your system:  \begin{lstlisting}[language=c] #include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; #include &lt;string.h&gt;  #define MAX_LINE_LEN 1024  int main() {     char line[MAX_LINE_LEN];     FILE *in = fopen("/etc/passwd", "r");     if (!in) exit(EXIT_FAILURE);      while (fgets(line, MAX_LINE_LEN, in) != NULL) {         char *sep = strchr(line, ':');         if (!sep) exit(EXIT_FAILURE);         *sep = '\0';         printf("%s\n", line);     }     fclose(in);     return EXIT_SUCCESS; } \end{lstlisting}  \end{document}   Now compile it, open it, select and copy the code example and paste it in a text editor. Here is the result I get:  # include &lt;stdio .h&gt; # include &lt;stdlib .h&gt; # include &lt;string .h&gt; # define MAX_LINE_LEN 1024 int main () { char line [ MAX_LINE_LEN ]; FILE *in = fopen ("/ etc / passwd ", "r"); if (! in) exit ( EXIT_FAILURE ); while ( fgets (line , MAX_LINE_LEN , in) != NULL ) { char * sep = strchr (line , ':'); if (! sep ) exit ( EXIT_FAILURE ); * sep = '\0 '; printf ("%s\n", line ); } fclose (in ); return EXIT_SUCCESS ; }   Jeez! What's this... The indentation is gone. There are spaces in included headers &lt;stdio .h&gt;, there are spaces after parenthesis [ MAX_LINE_LEN ].  Anyone knows how to fix this? I'd like the code examples in my book to be copy/paste-able into a text editor so people can try them out easily. Sharing a Bluetooth Keyboard and Mouse sequentially between two Macs Review overview shows two suggested edits for a long time, but the review queue is empty When I went to the review overview on Meta on 08.01.2015, 19:16, it listed two open items in the suggested-edits queue, however when I clicked on the queue, I was told that the queue had been cleared. When I went back to the review overview, however, the edits were there again.  Since the icons for recent reviews had not moved, I suppose that these were still the same two items waiting for review, and since phenomenon lasted for half an hour now, I would rule out  or  to be the reason for this.  After a while, the phenomenon ceased, with one new reviewer popping up in the icon list of recent reviewers.  I had not performed or skipped any suggested-edit review from the queue at that point.    A similar phenomenon occurred for several hours up to 11.04.2015, 11:05: The review overview showed two suggested edits and when I went to the suggested-edits queue, it was cleared. Sometimes, edits that I could review appeared, but two phantom edits remained. The biggest peeve is sometimes I vote up an answer mid-way through reading it, and the "don't forget to accept" message blocks the remaining text, so I scramble and triple-click it until it closes.  Anyways I frequently scan my question list and search for SO's reminders, ("Consider accepting an answer") so the "don't forget to accept" is wholly unnecessary to some, and there should be a way to disable it. Do you think so too? What is the difference between "twenty-four-hour shift" and twenty-four hour shift"? Just read somewhere about this puzzling puzzle:  What is the difference between:   I'm doing a twenty four-hour shift tonight. I'm doing a twenty-four hour shift tonight. I'm doing a twenty-four-hour shift tonight.   I know number 1 is 20 x 4 hours. Number 2 and 3 is the same as far as I know. Is this true? Show reference label when it is undefined How to describe a guy who is popular with girls? Perhaps I should make it clear:  - He naturally attracts girls.  - He doesn't chase girls and have no intention for any relationship.  - You just see him often together with girls. Can a PC with the Alert feat alert his friends? Assume the following situation: The party has been surprised by an ambush. Every PC is surprised except PC Bob because he has the Alert feat. Thanks to his high initiative bonus Bob gets to go first. He shouts "look out" to alert his party members of the imminent threat. The idea is that his party members are no longer surprised because he warned them.   While I think that this makes sense from a storytelling perspective, I am afraid this would be too strong. as it allows one PC with the Alert feat to give the "not surprised" benefit to other members of his party pretty much for free.  Is this allowed? Are there rules or an official ruling or similar on this?  If not, do you have any experience with this situation, and how did it play out in your games? I have this, in D1:  =sum(D3:D)   I want D1 to always be the sum of the rest of column D (D2 is a header)  I sometimes move a row, from eg 8 to 3, and that causes D1 to change to sum(d4:d).    I want D1 to stay as my sum of the column. I have a DVD I was trying to rip, and handbrake froze up when scanning it.  I tried to eject the DVD by dragging and dropping it to the trash, which trashed the icon, but didn't eject the DVD.  I then forced Handbrake to quit, but without an icon on my desktop to select, how can I eject the DVD? This is probably pretty basic, but to save me an hour or so of grief can anyone tell me how you can work out the number of bits required to represent a given positive integer in Java?  e.g. I get a decimal 11, (1011). I need to get the answer, 4.  I figured if I could work out how to set all the bits other than the most significant bit to 0, and then >>> it, I'd get my answer. But... I can't. I have been asked by a client to implement some views for reporting purposes, the views will be accessed via PowerBI, Excel and SSRS. The designated user will only have access to the view and no underlying tables must be available to the user.  The problem I have encountered in that the SQL within the view touches 3 different schemas (All within the same database):   Pupil Provider  Security   The view is:  CREATE VIEW dbo.vTestPermissions AS SELECT a.Column1,        b.Column1,        c.Column1 FROM Pupil.Table1 a JOIN Provider.Table2 b ON a.Column1 = b.Column1 JOIN Security.Table3 c ON a.Column1 = c.Column1   The owners of the Tables/View are as follows:   Pupil.Table1 - Owner Pupil Provider.Table2 - Owner Provider Security.Table3 - Owner Security vTestPermissions - Owner dbo   When I select from the view I get an error:     The SELECT permission was denied on the object 'table3', database   'TEST', schema 'Security'   I have tried giving SELECT permission with and without the GRANT option to the schema, and the tables, but that makes the underlying tables available to the user.  Any help on this will be greatly appreciated. $(i)$ $a&gt;0,b&gt;0,p&gt;0,q&gt;0$   $(ii)$ $\frac{1}{p}+\frac{1}{q}=1$     How can we prove it?   ${a}{b}≤\frac{a^p}{p}+\frac{b^q}{q}$ Is a   select *  from myView   faster than the query itself to create the view (in order to have the same resultSet):  select * from ([query to create same resultSet as myView])   ?  It's not totally clear to me if the view uses some sort of caching making it faster compared to a simple query. My organization is looking at developing mobile applications, we have a wealth of web development resources. There are many factors to consider in making the decision of how to develop this application such as Cost(s), platform support, performance, and maintainability.   But, I have not found any research that actually backs up the assumptions that users prefer the experience of a native app over a hybrid mobile web app (A hybrid app is a HTML5 app distributed in an embedded web view using PhoneGap, etc.).   Some  that native apps are more performant and have a better user experience, but why? Have there been any user surveys or analytics that indicate this user preference towards native? Clusering based on categorical variables? I am working on a project and currently experimenting cluster analysis. The dataset is mainly categorical variables and discrete numbers. Please pardon my poor programming skills as I am not very familiar with MathJax, but I will try to summarize the data set in words in the following three examples.   imagine column 1 is participants names of course, from column2 - 5, each column's value range from 1 (least important) - 5 (most important). so in this case, column 2-8 only have discrete data.  column 6 for example, since this is a multiple choice question. row 1 chose "nice" as an answer, however, row 2 chose "poor". In this case, we have one column that contains multiple categorical answers. for column 7-9, this is another type of multiple choice questions. However this time, each column represents only one answer. column 7 only allows string values "true", column 8 only allows string "somewhat". So in this case, we have multiple columns that represent multiple answers of the same question.    Any ideas how to solve this? Thankful to any input!   A2       A3       A4       A5       A6       A7         A8         A9 1        4        5        4        nice     true       somewhate  false 2        4        3        1        poor     true                  false 1        5        2        1        nice                somewhate     3        2        1        5        nice     true                  false I set up Windows 10 and have been using it for months on a spare laptop.  When installing, I did not use a Microsoft account to enable all of the app connectivity because I don't need that functionality.  I do not want these features active on this device, and I used a simple user name during the install.  Everything was going fine until I read about the Linux/bash features that are available in the anniversary update.  I decided to try them out and entered my Microsoft Insider credentials to enable the features in the developer options of the Control Panel.  I didn't realize the primary account on this device would now become linked to that Microsoft account.  Is there a simple way to disassociate the Microsoft account from the local account, or are they now linked forever in an unholy union?  I can set up a new local account, but I'd rather not lose all the settings and folder preferences prior to my gaffe. In Windows 10 how can we change the name of this folder under C:\Users? I'm using Windows 10 on my personal computer (HP Pavilion Laptop) and you can see in the Screen Shot under C:\Users there are two folders.    The name of the first folder is C:\Users\SINGHA, however, the correct spelling of my last name is SINHA.  I need to change the name of this folder to C:\Users\SINHA so that it shows the correct name.     Under User Account, the spelling of my name is correct - it's only under C:\Users\ where the name is spelt incorrectly. Consequently, if I open/edit a Word or Excel document, the name of the owner being shown is the incorrect one (i.e it's shown as C:\Users\SINGHA instead of C:\Users\SINHA)   If I right-click on this folder, I won't get the Rename option; How can I change the name of this folder?