I recently installed Grive, a third party Google Drive tool for Ubuntu, and in order to sync the folders, you must run the command grive in the Google Drive folder in your home page. Is there a way I can automate a simple command before my system shuts down to ensure I always sync my libraries?  Thanks!
I have a machine running a couple of vagrant VM. The problem I have is that sometimes I forget to shutdown those VM before I shutdown or reboot my machine. Because of that my machine get stuck with this message: waiting for vboxnet0 to become free  I searched about solutions and I found this page :    I tried what they for shutdown, but it doesn't work.  I wrote an sh file for that command:  #!/bin/bash  cd ~/workspace/git/mediaservice vagrant halt   any suggestions?
Texture messes up after extruding a modified plane How can I use Netflix on Ubuntu? What is the proper name for a "river plot" visualisation In a famous plot, Charles Minard visualised the losses of the French Army in the Russian campaign of Napoleon:    (another nice example is  xkcd plot)  Is there a canonical name for this type of visualisation? I'm actually looking for an R package to create such plots, but I don't even know how to look for it.  EDIT:  As I could not find a good package in R do do this type of plots, I have created my own, called "riverplot" -- you can download it . Here is a simplified version of the above diagram:    And an example of what other diagrams can be created with the package: Cards entering the battlefield simultaneously and "Enter the Battlefield" effects How do I calculate someone's age based on a DateTime type birthday? Can a coin with an unknown bias be treated as fair? How can I shorten my command line (bash) prompt? Currently it is:   michael@Castle2012-Ubuntu-laptop01:~/Dropnot/webs/rails_v3/linker/spec/controllers$   Outside of renaming my machine and directory structure...  How could I make it be something more like:  michael:controllers$ Remove Reviewer and Steward badges Badges should encourage good behaviour. But what when a badge encourages more bad behaviour than good?  We hear it all the time - robo reviewers, badge-hunters. The review system fights with that users that only want badges and not want to help.  There are many suggestions how to find such robo-reviewers or how to make it difficult to robo-review. But why not cut them off at the source? Don't make them want to review for badges at all.  Remove the Reviewer and Steward badges! The Custodian Bronze badge should suffice to bring a user to the review system. And we really only want users doing reviews who want to help and not doing it for the badges. Get month name from Date How to make sure one understands each and every detail while reading a textbook/research paper without leaving any gaps? I am a physics Master's student.  I have good grades, with CGPA above 9(/10)(However, all courses in my university are graded on a curve so the actual marks are significantly lower than 90%). This has been my marks throughout my undergraduate and graduate courses and I was happy because this was above average. Also, my summer projects in UG were usually computational and any difficulty I had in theoretical aspects I attributed it to my inexperience in advanced Physics.   However, recently I have started to work on pure theoretical project and while reading for the project I realized that I consistently miss some details from each topic. I understand the general idea, can re-derive most of the equations(with some effort) however when I discuss things with my professor or when I read further topics I realize that I have missed certain key-details. This is exactly similar to the case of me missing a few key questions in my exams and getting that 9 grade point instead of 10(or at-least I think so). I was not worried about this before but now I realize that there is some flaw in the way I study (but I do not know what).   Since I want to apply for Physics PhD I realized that I will need to have solid concepts and it would be best to correct my mistakes but I do not know how or even what could be the reason for my imperfect understanding.  Any direct suggestion would help or even certain general guidelines on what I can do.    Things I've tried recently -   1) I've started to written down almost everything I read. This is slightly laborious but is certainly helping. It also helps me to gloss over the things I read previously when I come back the next day.  2) I completely avoid smartphone when I'm library/study room so that I won't get distracted. Not sure if it helps me solve the above problem but certainly helps me study better in general.  3) I've tried to read the topics from several sources. The books I am reading is somewhat like a collection of research papers and hence does not have a exercises. So I though reading from various sources might help get better ideas but it's not really helping because most other sources are too high level as an introductory text. But this will probably help me in cases where it's practical to do this.  4) Somewhat similar to point (1)- I am trying reread, whenever I can, what I've done until that point. But not sure how much this will help me in filling the gaps. Showing a Sequence and its Limit are Closed Let $(X, d)$ be a metric space, and $(x_n)_{n \in \mathbb{N}}$ a sequence in $X$, with $x_n \rightarrow x$ w.r.t. $d$ for some $x \in X$. Show that the set $\{x_n : n \in \mathbb{N}\}\cup\{x\}$ is closed in $(X, d)$.   I figured I should use $\overline{F} = F \cup F'$ to show the above set is closed. Let $(x_n)_{n \in \mathbb{N}} = F$. Then, all elements of the sequence are in  $F$, which is equal to $\{x_n : n \in \mathbb{N}\}$. Clearly, the sequence (or $F$) has only one accumulation point, $x$. So, $F' = \{x\}$. This shows $\{x_n : n \in \mathbb{N}\}\cup\{x\} = \overline{F}$, and thus is closed.  Is this sufficient in proving the problem? Or would I have to show that $x$ is the only accumulation point as well (figured I don't have to because we know limits are unique)? Any advice would be very helpful. Thank you. 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. Pathologies in module theory Linear algebra is a very well-behaved part of mathematics. Soon after you have mastered the basics you got a good feeling for what kind of statements should be true -- even if you are not familiar with all major results and counterexamples.  If one replaces the underlying field by a ring, and therefore looks at modules, things become more tricky. Many pathologies occur that one maybe would not expect coming from linear algebra.  I am looking for a list of such pathologies where modules behave differently than vector spaces. This list should not only be a list of statements but all phenomena should be illustrated by an example.  To start the list I will post an answer below with all pathologies that I know from the top of my head. This should also explain better what kind of list I have in mind. Determiners: anyone versus someone Clicking on tags in global search results is broken If you search for something on "all sites" (using the searchbox at the top of , you'll reach the search results, e.g.  .  If you click directly on a tag on that page, e.g.        You get 404 Page Not Found error, e.g.     Steps to reproduce   Go to  and enter e.g. "keyforge" into the "Search all sites" field. Arrive at  Click on the "keyforge" tag below a search entry. Reach  (404 page not found)   Expected behaviour  Reach   System Info  Happens in both Firefox and Vivaldi browsers on Windows 10. What is the best prepaid SIM card for data in France? I'm going to travel to Paris in two weeks for 5 days. I'd like to buy a prepaid SIM card for my phone, no calls or SMS needed - only data is sufficient. I've looked through French mobile operators and found nothing really acceptable. For example, in Finland I bought SIM card for €5 with 3GB of data.   So, the question is - what is the best SIM card for me, assuming that 1GB is enough (considering the prices) and that I am actually will be able to use it (I've read that some operators turn on mobile data only after 5 days which is unacceptable for me considering that I'll be there for 5 days only)? Best way to return multiple values from a function? The canonical way to return multiple values in languages that support it is often . Option: Using a tuple Consider this trivial example: def f(x):   y0 = x + 1   y1 = x * 3   y2 = y0 ** y3   return (y0, y1, y2)  However, this quickly gets problematic as the number of values returned increases. What if you want to return four or five values? Sure, you could keep tupling them, but it gets easy to forget which value is where. It's also rather ugly to unpack them wherever you want to receive them. Option: Using a dictionary The next logical step seems to be to introduce some sort of 'record notation'. In Python, the obvious way to do this is by means of a dict. Consider the following: def g(x):   y0 = x + 1   y1 = x * 3   y2 = y0 ** y3   return {'y0': y0, 'y1': y1 ,'y2': y2}  (Just to be clear, y0, y1, and y2 are just meant as abstract identifiers. As pointed out, in practice you'd use meaningful identifiers.) Now, we have a mechanism whereby we can project out a particular member of the returned object. For example, result['y0']  Option: Using a class However, there is another option. We could instead return a specialized structure. I've framed this in the context of Python, but I'm sure it applies to other languages as well. Indeed, if you were working in C this might very well be your only option. Here goes: class ReturnValue:   def __init__(self, y0, y1, y2):      self.y0 = y0      self.y1 = y1      self.y2 = y2  def g(x):   y0 = x + 1   y1 = x * 3   y2 = y0 ** y3   return ReturnValue(y0, y1, y2)  In Python the previous two are perhaps very similar in terms of plumbing - after all { y0, y1, y2 } just end up being entries in the internal __dict__ of the ReturnValue. There is one additional feature provided by Python though for tiny objects, the __slots__ attribute. The class could be expressed as: class ReturnValue(object):   __slots__ = [&quot;y0&quot;, &quot;y1&quot;, &quot;y2&quot;]   def __init__(self, y0, y1, y2):      self.y0 = y0      self.y1 = y1      self.y2 = y2  From the :  The __slots__ declaration takes a sequence of instance variables and reserves just enough space in each instance to hold a value for each variable. Space is saved because __dict__ is not created for each instance.  Option: Using a  (Python 3.7+) Using Python 3.7's new dataclasses, return a class with automatically added special methods, typing and other useful tools: @dataclass class Returnvalue:     y0: int     y1: float     y3: int  def total_cost(x):     y0 = x + 1     y1 = x * 3     y2 = y0 ** y3     return ReturnValue(y0, y1, y2)  Option: Using a list Another suggestion which I'd overlooked comes from Bill the Lizard: def h(x):   result = [x + 1]   result.append(x * 3)   result.append(y0 ** y3)   return result  This is my least favorite method though. I suppose I'm tainted by exposure to Haskell, but the idea of mixed-type lists has always felt uncomfortable to me. In this particular example the list is -not- mixed type, but it conceivably could be. A list used in this way really doesn't gain anything with respect to the tuple as far as I can tell. The only real difference between lists and tuples in Python is that lists are , whereas tuples are not. I personally tend to carry over the conventions from functional programming: use lists for any number of elements of the same type, and tuples for a fixed number of elements of predetermined types. Question After the lengthy preamble, comes the inevitable question. Which method (do you think) is best? What's the difference between denizen, resident, inhabitant? What's the difference between , , and ?  Even if their ODO definitions suggest they are interchangeable most of the time, are there fine differences in meaning between them? Page number in title page What is the best way to detect if a user leaves a web page?  The onunload JavaScript event doesn't work every time (the HTTP request takes longer than the time required to terminate the browser).  Creating one will probably be blocked by current browsers.