Determining the distribution of fitted values and residuals
Distribution of linear combination of OLS regression coefficients
How to make horizontal lists? This might seem like a very simple question, but what is the easiest way to turn a normal vertical list into a horizontal one? How do regular expressions differ from wildcards used to filter files Counting unique records across 2 columns and computing a score based on boolean values I have a table that looks like this in Google Big Query:  custID  InteractionDate Purchased?  Sales 1       20150312           F         0 1       20150312           T         200 1       20150314           T         150 2       20150221           T         400 2       20150221           F         0 2       20150221           T         120   ..that I need to transform to the following structure:   custID InteractionDate Success Sales  1     20150312          0.5    200  1     20150314           1     150  2     20150221         0.66    520   ..where in this second table the success column is defined as  count(purchase=Yes)/(count(purchase=Yes) + count(purchase=No)),   and sales is just the sum.  I'm quite new to BQ and no-SQL languages. I simply don't know how to do this, I've searched and seen examples that suggest using partition over but I simply haven't seen any example that does just this. Thanks a lot in advance. Does Stack Exchange have an Economics section? How to create a rounded cone Multiple Linked Objects with unique Materials / Group Materials override How to completely disable the Windows taskbar? I've installed Taskbar eliminator, while it works most of the time, alerts being the taskbar back.  I've also installed object dock which can disable the taskbar, object dock appears during window changes.   Has anyone had any luck permanently removing, hiding the taskbar in Windows 7?  Update  I found an application that seems to be working here:    Second update  I took the leap and installed a shell replacement (). So far so good. I'd like to create a picture like the one with TikZ:    I've already created the electrical part using circuitikz. I'd like to add the part on the right (the motor's shaft with arrows), but don't know how to start, actually. Is there a way to draw 3D shapes, maybe? Or should I draw circles and rotate them?  \documentclass{article} \usepackage{tikz} \usetikzlibrary{intersections} \usepackage{circuitikz} \usepackage{siunitx}  \begin{document}  \begin{figure} \centering \begin{circuitikz} \draw (0,0) to [V, v=$v(t)$, *-*] (0,2)      to [R, l=$R_d$] (2,2)     to [L, l=$L_d$] (4,2)     to [V, v&lt;=$e(t)$] (4,0) to [generic] (4,2) -- (4,0) -- (0,0); \end{circuitikz} \end{figure}  \end{document}   What I have now:   What I'm still missing: I'm a Georgian national holding a multiple entry Schengen visa.  Last summer I was traveling to Hungary, spent a few days there, then flew to the UK. The Hungarian border official did NOT stamp my passport on exiting the Schengen area. I had to enter it again a few days later and the German border guards were confused by what had happened. Finally they let me enter.  Now I have one more entry stamp into Schengen than exit stamp and run into problems EVERY time at a Schengen border.  Is there a way to fix this? So I'm getting my listItems with a Camlquery, but i want to calculate the avg of the "price" rows  This is the code I've used so far:  function VisaLista() {     namn = document.getElementById("txtNamn");     var camlQuery = new SP.CamlQuery();     camlQuery.set_viewXml(     "&lt;Where&gt;" +     "&lt;And&gt;" +     "&lt;Eq&gt;&lt;FieldRef Name='Title'/&gt;&lt;Value Type='Text'&gt;" + namn + "&lt;/Value&gt;&lt;/Eq&gt;" +     "&lt;Or&gt;" +     "&lt;Eq&gt;&lt;FieldRef Name='Prioritet'/&gt;&lt;Value Type='Text'&gt;Hög&lt;/Value&gt;&lt;/Eq&gt;" +     "&lt;Eq&gt;&lt;FieldRef Name='Status'/&gt;&lt;Value Type='Text'&gt;Startad&lt;/Value&gt;&lt;/Eq&gt;" +     "&lt;/Or&gt;" +     "&lt;/And&gt;" +     "&lt;/Where&gt;");     listItems1 = list.getItems(camlQuery);     clientContext.load(listItems1);     clientContext.executeQueryAsync(OnSuccessVisa, OnFail); } function OnSuccessVisa() {     var listEnumerator = listItems1.getEnumerator();     var elmt = 0;     while (listEnumerator.moveNext()) {         var currentItem = listEnumerator.get_current();         elmt = (currentItem.get_item('_x0072_zb6'));          var sum = 0;         for (var i = 0; i &lt; elmt.length; i++) {             sum += parseInt(elmt[i], 10);         }          var avg = sum / elmt.length;          document.write("The sum of all the elements is: " + sum + " The average is: " + avg);     }     $("#Kategori1").text = "Medelvärdet för dessa ordrar: " + avg }   I am getting following error     "Cannot get the value length of null - at elmt, line 43 ESTA approved on the same day as B-1/B-2 visa refused I am writing because I have a question regarding my ESTA application and because I could not find a similar case online that would help me at this stage. I have never been to the U.S. so this would be my first visit.    I am a German citizen, hence eligible for the Waiver Program. I applied for an ESTA in June 2014 and got approved. After further research on the Internet I learned that the passport should be valid until 6 months after the planned return date. My passport was due to run out in Feb 2015 - which still should have been fine but because I didn't want to take chances I applied for a new passport which was issued August 2014 and is now valid until August 2024. My passport number has been changed also.    After I received my new passport I was advised by a friend to apply for a B-1/B-2 visa as it would allow me to extend my stay and it seemed like a good idea at first. On the day of my interview I also applied for a new ESTA with my new passport number (just in case) which again was granted.   Unfortunately for me the interview for the B-1/B-2 visa was unsuccessful and I got rejected. I was not aware then that after a rejected interview one could not travel with ESTA, otherwise I would have never risked it!  Now I am very concerned, can I still use my ESTA and enter the U.S.? as I read everywhere that once you get rejected the chances of getting through are very slim and any visa rejection will result in not being able to use the waiver program.  It might be important to note that both the B-1/B-2 interview and the waiver application were on the same day, 21st of August 2014, so depending on how one might look at it that might present a problem too I suppose.  I guess the frustration lies in the fact that I did not need to apply for a B-1/B-2 visa to begin with, and had I not I would now not have these problems. I would like to know how likely it is that I can still travel under the waiver program, if at all, and what my options are at this point. find $\sum_{k=2}^{\infty}\frac{1}{k^2-1}$ Calculate difference between two dates (number of days)? I found 11 questions like this on gamingSE already, but none of them have proper and up-to-date answers. So I'm creating this Q&amp;A:  How do you either activate a command x seconds/minutes/hours/… in the future or every x seconds/minutes/… in a loop?  Repeating command blocks and ticking functions execute 20 times per second, redstone is  in many situations and most of the extremely fancy solutions, like falling blocks in cobwebs, have broken over time or are needlessly complicated. How do I use filenames that start with a dash "-" as command arguments? This may be a simple question, but how do I use files starting with "-" with command line programs?   For example,  I am trying to use pdfgrep on a file named -2013-01-01.pdf but it complains that there are no options defined for 2, 0, 1, 3 and so on.  Changing the filename to something that does not start with "-" solves it, but this is not an option since the files aren't created by me. I simply want to check for a specific change I know is coming. 14.04.5 to 16.04 Update failed - xenial.tar.gz.gpg missing The update from Trusty to Xenial is officially available via the software updater. After updating all packages, upgrading through the software updater yields:  Fetching the upgrade failed. There may be a network problem.   Doing a sudo do-release-upgrade yields:      Checking for a new Ubuntu release Err Upgrade tool signature                                                        403  Sorry, not allowed to fetch that type of file: xenial.tar.gz.gpg         Err Upgrade tool                                                                  403  Sorry, not allowed to fetch that type of file: xenial.tar.gz             Fetched 0 B in 0s (0 B/s)                                                       WARNING:root:file 'xenial.tar.gz.gpg' missing Failed to fetch Fetching the upgrade failed. There may be a network problem. How do Southern people discern Night's Watch deserters from truthful brothers sent south? Night's Watch deserters are sentenced to death, as we've seen in the very first episode of Game of Thrones. A man dressed all in black is apprehended by Stark men and brought before Lord Eddard Stark. Lord Stark sees him as a deserter and sentences him to die (and then executes that death penalty).  However, there are men of the Night's Watch south of the Wall, on a legitimate mission or on some kind of allowed leave. For instance, we have Benjen Stark visiting Winterfell when the king and his party is there. There is also Yoren, who travels around Westeros in search of new recruits.  I could imagine that the Warden of the North (and other lords in the northern part of Westeros) would have a good idea of who would be allowed further south and whose appearance would raise suspicion. But I reckon the southern lords don't have as many visits from the Night's Watch, so they might not know who would be allowed to be there and who wouldn't.  How would lords who are rather unfamiliar with the specific brothers of the Night's Watch discern deserters from brothers sent out for some reason?  That ends my question, but there is a spoiler from the season 5 finale that continues the question a bit more:      Sam is sent to Oldtown to become a Maester, so he can replace Maester Aemon at Castle Black.  But he is riding together with Gilly (a woman!) and her baby (a baby!), which might raise a lot of suspicion from people who don't know what he is sent out to do.  What prevents southern lords of sentencing Sam as a deserter from the Night's Watch? Trying to identify a short sci-fi story about a human that is "resurrected" by malignant aliens I am playing a bit around with Qgis 2.14.6 to understand how it deals with distance measurement.  I took a line-shapefile that I saved in 3 different coordinate systems (4326, 32642 and a national one that doesn't exist in Qgis yet).  Using 32642 and the national one, the length is quite similar (6442m vs. 6428m)  But using 4326 (unprojected WGS84), I get 8057m  In all cases, I just used the Field Calculator and introduced $length.  I was already positively surprised that the result using 4326 was in meters and not in degrees.  To calculate the distance on the dataset in 4326, I assume that Qgis does some kind of re-projection in the background. Does anyone know which one?   Shapefiles here if anyone wants to play around:   EDIT - adding more info after more tests  As you can see, now both my shapefile and the project are in EPSG:4326, so unprojected:    Here the rough measurement of my shapefile, with the Qgis measure tool:   When I use the field calculator, the preview gives me a value in degrees, while the result seems to be in meters:      This would mean that the function $length, like the measurement tool, always gives a result in meters, but using a very coarse approximation of the degrees => meters transformation:    Is this a bug? or should it really behave like this? I find it at best counter-intuitive (but maybe it's just me) and, at worse, completely misleading (it makes very little sense to use, everywhere on earth, the length of 1 degree at the Equator). Any input or opinion here? Should I open a bug report (at least for the inconsistency between the preview and the actual result)? Setting camera clip end via Python