Don't understand a construct in a JS Decorator
How do JavaScript closures work?
I installed or upgraded to Ubuntu 16.04, but I'm having some problems with my graphics card.   The display is blank The display flickers Items on the screen do not display correctly Certain programs complain of graphics issues The computer boots to low-graphics mode Your specific issue may not be here, but try the solutions described in the answers anyway.   This question is very broad, but each one of these issues likely has one solution.    If you are experiencing a login loop, check the last part of my answer.    If you experience one of the listed issues and have your own solution (mine didn't work, or there's a faster way), feel free to post another POLITE answer, describing your problem and how you fixed it.    Those attempting to install Ubuntu, please refer to the section titled: If you are unable to enter a TTY or are trying to install Ubuntu. Storing C++ template function definitions in a .CPP file I have some template code that I would prefer to have stored in a CPP file instead of inline in the header.  I know this can be done as long as you know which template types will be used.  For example:  .h file  class foo { public:     template &lt;typename T&gt;     void do(const T&amp; t); };   .cpp file  template &lt;typename T&gt; void foo::do(const T&amp; t) {     // Do something with t }  template void foo::do&lt;int&gt;(const int&amp;); template void foo::do&lt;std::string&gt;(const std::string&amp;);   Note the last two lines - the foo::do template function is only used with ints and std::strings, so those definitions mean the app will link.  My question is - is this a nasty hack or will this work with other compilers/linkers? I am only using this code with VS2008 at the moment but will be wanting to port to other environments. Subscribers currently in a Journey What ways could you create a data extension that contains all the subscribers (SubscriberKeys) that are currently “in” a Journey (Journey Builder)?  The Journey I would like to do this for is a complex activity with multiple decision branches resulting in multiple possible journey durations. For example; if the customer didn’t open Email1 after 2 days, then send Email2; else Exit Journey. If the customer didn’t open Email2 after 2 days, then send Email3; else Exit Journey. Wait 2 more days, then End Journey. The minimum journey duration for the above example is 2 days, while the maximum is 6 days.  Note that I don’t want a list of subscribers that “entered” a Journey, but a list of the ones that are “currently in” a Journey and have not yet exited. Answer must account for non-standard Journey exits including Unsubscribes/Contact Deletes, etc. Where can I get a device with 'Ubuntu for phones' pre-installed? How do I monitor the computer's CPU, memory, and disk usage in Java? I've seen many science popularisation documentaries and read few books (obviously not being scientist myself). I am able to process and understand basic ideas behind most of these. However for general relativity there is this one illustration, which is being used over and over (image from Wikipedia):    I always thought that general relativity gives another way how you can describe gravity. However for this illustration to work, there needs to be another force, pulling the object down (referring to a direction in the attached image). If I put two non-moving objects in the image, what force will pull them together?  So where is my understanding incorrect? Or is general relativity not about explaining gravity and just describes how heavy objects bends spacetime (in that case the analogy is being used not correctly in my opinion)?    UPDATE Thank you for the answers and comments. Namely the XKCD comics is a spot on. I understand that the analogy with bent sheet of fabric pretty bad, but it seems that it can be fixed if you don't bent the fabric, but just distort the drawn grid.   Would you be so kind and answer the second part of the question as well - whether general relativity is explaining gravitational force. To me it seems that it is not (bending of spacetime simply can not affect two non-moving objects). However most of the time it is being presented that it does. Data Not Backed Up, Partition Type: FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF I was trying to install Linux on my MacBook for class when I bricked my computer, which now in an unbootable state.   I made my partition too small, so I was going to delete and create a larger one. However, Disk Utility did not allow me to delete the small partition. I followed the instructions from   However, not only was I still unable to delete it, but upon restarting I realized my primary partition (located on the same disk) changed into FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF, and I had no options to boot.  (I am sure I performed the command on the correct disk and partition)  I saw some similar threads, but my main bootable drive is the one that got corrupt.   I don't want to lose any data. I'm not the most terminal savvy, so ANY help is appreciated, and I will kindly provide any additional information!  (Disk 0, partition 2 is my main partition, and that only one I care about)  Below are the results of  $ diskutil list and $ gpt -r show disk0.        UPDATE: :  I have followed @klanomath 's instructions. At the last step I received the following error:  Checking prerequisites Checking the partition list Checking for an EFI system partition Checking the EFI system partition's size Checking the EFI system partition's file system Problems were found with the partition map which might prevent booting Error: -69766: The partition map needs to be repaired because there's a problem with the EFI system partition's file system Underlying error: 8: POSIX reports: Exec format error    FINAL UPDATE: SUCCESS!  I just wanted thank @klanomath for helping me through this entire process. He spent 11 hours TeamViewing with me until not only my files were accessible, but until I could access my computer as could before this whole debacle (and this was after 5 hours of email correspondence).   To any future reader with this problem: PLEASE don't give up, it can be fixed! vertical alignment of text in tikz node The output from the following script \documentclass{article} \usepackage{tikz} \usepackage{graphicx} \begin{document} \begin{tikzpicture}   \node(title)[text width = 0.25\textwidth, text height = 3 cm, draw]{title};   \end{tikzpicture} \end{document}  is  How can I vertically align the text in the node? Specifying the text depth as in \node(title)[text width = 0.25\textwidth, text height = 1cm, text depth = 1 cm, draw]{     title line 1\\     title line 2\\     title line 3};  Does not result in the text being vertically centred. BibTeX handling of the Dutch "van" name prefix with natbib I want to produce the following with LaTeX/BibTeX:  In the running text:     ... we refer the reader to the work of Van Noort (2010).   In the bibliography:     Thomas van Noort. An important paper. 2010.   I have tried many tricks, but I don't seem to able to fulfill all the requirements:   "Thomas van Noort" has to appear sorted in the bibliography by the name "Noort". In the running text, the "Van" needs to have an uppercase 'V' In the bibliography, the "van" needs to have a lowercase 'v' I am using hyperref, and I want the whole "Van Noort (2010)" text to link to the reference.   Using plain \citet will generate:     ... we refer the reader to the work of van Noort (2010).   Note the lowercase 'v'; this is not acceptable, as per standard treatment of Dutch names. Setting the BibTeX name to Van Noort, Thomas makes the running text citation look ok, but then in the bibliography I get     Thomas Van Noort. An important paper. 2010.   Note the uppercase 'V'; this is also not acceptable, as it should only be uppercase if it is not preceded by the first name.  (1) is easy: I set the BibTeX author field to {\noopsort{Noort}}{van Noort}, Thomas. (2) and (3) I can fake by saying something like we refer the reader to the work of Van Noort \citeyear{...}, but this is not nice, and does not fulfill (4).  Anyone has any suggestions? I was under the impression that LaTeX and BibTeX were designed with these kind of things in mind, so maybe I'm missing something... IE9 HTML5 video support Can I travel within the US with an expired visa? I am an international student and authorized to stay in US for 2 years on my I-20 form. My visa expired on June this year and I need to fly to some states outside Georgia to visit colleges. Can I fly within the US?  If I can, what kind of document will the airport check when I depart? Will they notice my expired visa and turn me in to Homeland Security? In other words, will I get into trouble? A Particular Two-Variable System in a Group Suppose $a$ and $b$ are elements of a group $G$. If $a^{-1}b^{2}a=b^{3}$ and $b^{-1}a^{2}b=a^{3}$, prove $a=e=b$.   I've been trying to prove but still inconclusive. Please prove to me.  Thanks very much for proof. Variable variable class extensions in PHP--is it possible? Is something like the following possible in PHP?  $blah = 'foo1';  class foo2 extends $blah {     //... }  class foo1 {     //... }   This gives an error.  I want to dynamically set $blah so I can extend whatever class I want.  Edit: The reason for wanting to do this because I wanted to use a function out of another class in a related class. In the end it would have been something like:  Final extends foo1 extends foo2 extends foo3 extends foo4 extends parent { ... }   In the end I decided to instantiate the other class within the class and use it. Not the best options because they both you 2 of the same classes, but this won't be used that often, so it will work for now. Let's take the numbers 0-10.  Their mean is 5, and the individual deviations from 5 are -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5 And so the average (magnitude of) deviation from the mean is $30/11 \approx 2.72$.  However, this is not the standard deviation.  The standard deviation is $\sqrt{10} \approx 3.16$.  The first mean-deviation is a simpler and by far more intuitive definition of the "standard-deviation", so I'm sure it's the first definition statisticians worked with.  However, for some reason they decided to adopt the second definition instead.  What is the reasoning behind that decision? Why do video cables (DVI, VGA) still screw in? I guess I could imagine that there was a time when accidentally disconnecting the monitor would have been catastrophic, though I don't see that being the case today.  Is it just a legacy holdover that they are still secured with screws?  Also, why is it that the video connection is really the only one that is still secured this way?  It seems like the power cable would be a better candidate to be secured with screws.  That really could be catastrophic.  In the end, the reason this question occurred to me is that I've never had a video cable come out when not screwed in, so why the significant security? I clicked on  to a comment in my email and it prompted a list of apps to open link. All browsers (Chrome, Firefox and etc) are in the list, but not SE app.  Most apps that can open site specific links get prompted for that app to open  the link, but not Stack Exchange links for some reason.    App Version: 1.0.95 Device Manufacturer: Asus Device Model: ASUS_Z010D   OS Version: 6.0.1 (WW_Phone-13.8.26.76-20161230) How to perform a logistic regression for more than 2 response classes in R I want to predict the impact of oil price over a Colombian oil company's stock price. I plan to use a logistic regression for this with a categorical variable (Up or Down given the direction of the stock price). Here is part of my dataset:  Minute  ecopet  profit  sum_profit   direccion  cl1_chg   sum_cl1    direccion_cl1 571     2160     0       10           Up         -0.03     0.00      Down 572     2160     0        0           Neutral     0.07    -0.03      Down 573     2160     0       -5           Down       -0.08     0.04      Up 574     2160     0       -5           Down       -0.07    -0.04      Down 575     2160     5       -5           Down       -0.08    -0.11      Down 576     2165     0       -25          Down        0.00    -0.19      Down 577     2165     0       -25          Down       -0.05    -0.19      Down 578     2165     0       -15          Down       -0.17    -0.24      Down 579     2165     5       -15          Down       -0.06    -0.41      Down 580     2170     0       -20          Down        0.03    -0.47      Down 581     2170    -10       0           Neutral     0.04    -0.44      Down   My dependent variable is 'direccion'. But as you can see it has 3 response classes. I know that to implement a binary logistic regression in R the code is:  glm.fit=glm(direccion~direccion_cl1, data=datos, family=binomial)   I am working with intraday information and plan to predict what happens when the oil moves up/ down (in the previous 10 minutes) and how it impacts the stock price in the next 10 minutes.  Could anyone tell me how could I perform this? I don't really know how to perform the logistic regression with 3 response classes. Thanks! Are humans the only animal that requires "clean water"? Detect the Internet connection is offline? How to detect the Internet connection is offline in JavaScript? Force fsck.ext4 on reboot, but really "forceful" One of my Ubuntu 10.04 servers is giving me trouble. When I run fsck.ext4 -n /dev/sda5 it tells me there are errors in the free inode count, free block count, and more.  I have tried:  touch /forcefsck   Also tried:  shutdown -rF now   and still, after reboot, I see errors.  I also just checked on my eeePC netbook, Ubuntu 10.10, and have the same issue!  How can I force a really "forced" "forceful" "seriously fix my filesystem" fsck of the "/" filesystem on reboot?  Clarification: I run fsck.ext4 -n because it's a mounted filesystem, to check if there are errors. This tells me that there are. I thought that the automatic fsck every 30 mounts during the boot-up process is precisely to take care of errors in the root filesystem. But it doesn't do it in my case. I could reboot with a LiveCD and fix the errors, and then reboot again, but that's some serious downtime for a live server. A reboot, auto fsck, then continue booting is much more sustainable on a live server, and I believe should be the right behaviour.  Additional info: Here is the output. It looks like something that the autofsck would fix, doesn't it?  root@server:~# fsck.ext4 -n /dev/sda5 e2fsck 1.41.11 (14-Mar-2010) Warning!  /dev/sda5 is mounted. Warning: skipping journal recovery because doing a read-only filesystem check. /dev/sda5 contains a file system with errors, check forced. Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information Free blocks count wrong (1849368, counted=1948909). Fix? no  Free inodes count wrong (545504, counted=552134). Fix? no   /dev/sda5: ********** WARNING: Filesystem still has errors **********  /dev/sda5: 116752/662256 files (0.2% non-contiguous), 795324/2644692 blocks