I'd like to be able to get my hands on an array of possible completions for a given partial command. For example, the partial command service um has the following possible completions:  $ service um&lt;TAB&gt;&lt;TAB&gt; umountfs      umountnfs.sh  umountroot   I'd like to have a function completions with the following behavior:  $ for x in $(completions 'service um'); do &gt; echo $x &gt; done umountfs umountnfs.sh umountroot   Partial progress: what I've learned so far  Here is an approach which I think can be made into a full answer. I'd definitely like to see that full answer, but given that the relatively simple &lt;TAB&gt;&lt;TAB&gt; gives the same functionality in a non-programmatic way, it feels like there could also be a slicker solution.  I can find out that the completion mechanism for the service command is the _service function:  $ complete -p service complete -F _service service   When this completion function _service is called, a bunch of environment variables are set (namely COMP_{LINE,POINT,KEY,TYPE,WORDS,CWORD}; see ), the function is given as arguments the command being completed, word being completed, and previous word, and it populates COMPREPLY with the possible completions. So my desired completions function could be defined something like this:  function completions() {     # Produce an array of tokens in the input.     read -a words &lt;&lt;&lt; $1      # Use "complete -p ${words[0]}" to determine how the      # completions are computed. This could be complicated     # if complete is given flags other than -F.     completion_func=???      # Set all those COMP_* environment variables appropriately.      # Run the function to populate COMPREPLY. This version     # assumes words has length at least 2, but that can be     # fixed.     $completion_func ${words[0]} ${words[-1]} ${words[-2]}      echo ${COMPREPLY[@]} }   Aside from the complexity relative over &lt;TAB&gt;&lt;TAB&gt;, a drawback of this approach is that it changes the environment.
Some of the git commands have many options, and it would often be useful to search through them for the one I need - I was just looking for the option which controls the TAB width in git-gui, but there are about 200 completions for git config. An obvious workaround is to copy all the completions into an editor and search through them, but I'd rather do  [something] | grep tab   There are no man or info pages for compgen, help compgen doesn't even explain its own options, and there's no auto-complete for compgen (how's that for irony?).  PS:  doesn't work.  PPS: This is not a question about git-gui - The  was elsewhere.  PPPS: This is not about auto-completing commands, only command parameters.
I plan to self-study linear algebra this summer. I am sorta already familiar with vectors, vector spaces and subspaces and I am really interested in everything about matrices (diagonalization, ...), linear maps and their matrix representation and eigenvectors and eigenvalues. I am looking for a book that handles every of the aforementioned topics in details. I also want to build a solid basis of the mathematical way of thinking to get ready to an exciting abstract algebra next semester, so my main aim is to work on proofs for somehow hard problems. I got Lang's "Intro. to Linear Algebra" and it is too easy, superficial.  Can you advise me a good book for all of the above? Please take into consideration that it is for self-study, so that it' gotta work on its own. Thanks. Did your team win the football match yesterday?         The weather was very bad, so we weren't playing.   vs     The weather was very bad, so we didn't play.   Is the first one not correct? Why is it? Identification of mid-80s time travel tv show `apt update` failed on Debian Linux Attempting to upgrade testing/stretch Debian Linux:  $ sudo apt update  Ign:1 http://dl.google.com/linux/talkplugin/deb stable InRelease Hit:2 http://dl.google.com/linux/talkplugin/deb stable Release                                                                    ... Get:25 http://mirror.vorboss.net/debian unstable/main i386 Packages 2016-03-25-1456.28.pdiff [15.0 kB]              Fetched 686 kB in 7s (89.5 kB/s)                                                                                                                                                         Reading package lists... Done W: gpgv:/var/lib/apt/lists/dl.google.com_linux_talkplugin_deb_dists_stable_Release.gpg: The repository is insufficiently signed by key 4CCA1EAF950CEE4AB83976DCA040830F7FAC5991 (weak digest) W: gpgv:/var/lib/apt/lists/deb.opera.com_opera_dists_stable_InRelease: The repository is insufficiently signed by key 419D0ACF314E8E993F7F92E563F7D4AFF6D61D45 (weak digest) W: Failed to fetch http://dl.google.com/linux/talkplugin/deb/dists/stable/Release  No Hash entry in Release file /var/lib/apt/lists/dl.google.com_linux_talkplugin_deb_dists_stable_Release, which is considered strong enough for security purposes E: Some index files failed to download. They have been ignored, or old ones used instead.  What's wrong? How to fix it? Package incompatibilites: etoolbox, hyperref, and bm, standalone? I am trying to transition to using the etoolbox package, but seem to have run into some difficulties and they appear related to the hyperref and bm packages which to me seem totally unrelated.  The MWE example compiles since \RemoveEToolbox is defined and shows that there is no apparent problem before etoolbox was used.    Commenting out the \def\RemoveEToolbox{} line produces two problems:   With both the \renewcommand, and the usepackage{hyperref} commented, this results in "Runaway argument? Paragraph ended before \bm@test@token was complete". Including the usepackage{hyperref} (with \renewcommand commented) results in "Undefined control  sequence. \Call@AtVeryEndDocument ...cumentHook \@undefined"   But if uncomment the \renewcommand{\bm}{#1} line (effectively doing without any \bm), then this seems to compile.  I have been using this for a while now and things appeared to have been working fine, but now that I attempt to use etoolbox I seem to run into problems.  \documentclass{standalone} \def\RemoveEToolbox{}% Shows that this works fine without {etoolbox}  \usepackage{amsmath} \usepackage{xcolor} \usepackage{bm}  \ifdefined\RemoveEToolbox     \newcommand*{\iftoggle}[3]{#2}% Default to true value of "if" \else     \usepackage{etoolbox}     \newtoggle{paper}     \toggletrue{paper}      %\renewcommand{\bm}[1]{#1}% Why can't I have a normal \bm with {etoolbox}? \fi  % \usepackage{hyperref}  \begin{document}  This document is intended for  \iftoggle{paper}{paper}{electronic} distribution.  \bm{\textcolor{blue}{Solve $x^2-1=0$}}  \begin{align*}     a &amp;= b\\     \iftoggle{paper}{         c &amp;= d\\     }{}     e &amp;= f\\ \end{align*} \end{document} Passing a formatted NSDate lsusb relevant output Bus 001 Device 006: ID 0bda:8812 Realtek Semiconductor Corp. RTL8812AU 802.11a/b/g/n/ac WLAN Adapter  Upon plugging the device it is recognized by lsusb, however when I go to wireless settings no adapter is recognized. The driver is installed (by going to software and updates -> addition drivers and selecting the open source driver). Two days had passed since she had last eaten or slept.   Or should it be:     Two days have passed since she last ate or slept.   Or something else? And why? The combinatorial explosion of past simple, past perfect and present perfect is killing me. "no public key available" while upgrading using update-manager How do I invoke a private static method using reflection (Java)? Why is LaTeX3 taking so long to come out? I feel as though I have been hearing about the LaTeX3 project for a very long time.   Why is it taking so long for it to come into fruition? Are there major technical difficulties, or is it purely a lack of developers that is causing a bottleneck? If I have the following code:  MyClass pClass = new MyClass(); pClass.MyEvent += MyFunction; pClass = null;   Will pClass be garbage collected? Or will it hang around still firing its events whenever they occur? Will I need to do the following in order to allow garbage collection?  MyClass pClass = new MyClass(); pClass.MyEvent += MyFunction; pClass.MyEvent -= MyFunction; pClass = null; Here's what I am trying to do:  1) User creates record A.  2) Time-based workflow sends an email to the Record A creator based on a date field in the record.  3) The email template has a URL link.  4) The URL links to a Visualforce page that is basically a form with fields to be filled out (this Visualforce page is in a managed package) and a save button that creates a new User record.  5) When the User clicks the URL link in the email, the Visualforce page opens in a new window.  6) I would like to pass the values of the fields in record A to pre-fill the Visualforce page fields.   Here's my link:  &lt;a href="https://cs19.visual.force.com/apex/CloneThisUser?Desktop=true&amp;Id={!Pending_User__c.User_to_CloneId__c}&amp;formGroupInputSmall={!Pending_User__c.First_Name__c}   And here's the code from the relevant section of the Visualforce page:  &lt;div class="form-group form-group-sm"&gt;       &lt;!-- &lt;apex:outputLabel styleClass="col-sm-2 control-label" for="formGroupInputSmall"&gt;First Name&lt;/apex:outputLabel&gt; --&gt;       &lt;div class="col-xm-11 col-sm-12"&gt;           &lt;apex:inputField html-placeholder="First Name" styleClass="form-control FirstNameInput"  value="{!u.FirstName}" id="formGroupInputSmall"/&gt;       &lt;/div&gt;     &lt;/div&gt;   I have only included the first field I would like to pass the parameter to, in order to keep this post simple.   The link passes the User_to_Clone_Id__c just fine but does not fill in the "First Name" field with the value of the First_Name__c .  What am I doing incorrectly? Thanks. Getting CalloutException when testing Batchable class with Callouts and HttpCalloutMock How to override Drupal.ajax.prototype.beforeSend? I need to add my own little if's and checks in 3 functions inside   misc/ajax.js (   Drupal.ajax.prototype.beforeSend,   Drupal.ajax.prototype.success,   Drupal.ajax.prototype.error )   How can I override them in my module? I can't find a manual and it's not in Examples for Developers. Sorry if it seems a dumb question, but I'm a php developer - I can work with js, but I'm not so fluent with it.   Can I simply write it in my module's js file? If 2 or 3 modules needs to modify them, how to avoid conflicts? What are the practical implications of a name change for international travel and activities abroad? I am considering a name change, which seems to be a relatively straightforward action, when one remains in the same country: certain documents are replaced with new ones bearing the new name, and others are presented together with the name change document.  However, I travel internationally multiple times per year, and I often change temporary residence from one country to another. So I often deal with immigration and similar things. Furthermore, I have a lot of things going on like work and studies.  Quite obviously, if I change my name, I would often have to produce a proper translation of the name change document, which may include notarized translation thereof with apostille or, for example, traduction assermentée in France.  However, it would be great to hear about experiences of people, who have dealt with this issue first-hand, so I can weight the disadvantages against advantages of this correctly. In particular, I would like to know if anyone has encountered unforeseen difficulties with this, and how people rate the overall difficulty of such experiences. Is $\emptyset \in \emptyset$ or $\emptyset \subseteq \emptyset$? How do I execute a program X times in the terminal?  I read that I have to do a bin/bash txt, but I don't know how to execute this X times. A Big fancy "Q" One time I remember seeing a Q ligature in \setmainfont{EB Garamond} (fontspec, EB Garamond, etc.) that involved a wonderful long swash. Now I don't know how to get it. Contrary to most other questions in this topic, how do I force this big Q?  Here's a (not too) minimal working example:  \documentclass{article} \usepackage[margin=0.9in]{geometry} \usepackage{microtype} \usepackage{fontspec}  \usepackage{xspace} \defaultfontfeatures{SmallCapsFeatures={Renderer=Basic}} %\setmainfont{EB Garamond} \usepackage{multicol}  \def\cm#1{\relax} \newcommand{\qsec}[1]{{\mbox{}\hfill\scshape #1}} \newenvironment{qset}[1]{         \mbox{}\\\qsec{#1}\par\begin{multicols}{2}     }{         \end{multicols}     } \newcommand{\q}[2]{{\em #1} #2\xspace} %\def\q#1#2{{{\em #1} #2\xspace}}  \begin{document} \fontsize{11pt}{14pt}\selectfont \fontspec[Ligatures={Required,Common,Contextual,Discretionary,TeX},Style=Alternate]{EB Garamond} \noindent\mbox{Simon Kuang}\hfill\mbox{\today} \centerline{\emph{Oedipus Rex} Study Guide Questions} \begin{qset} {First Episode --- Oedipus, Chorus, and Tiresias} \noindent \q{Explain the following ironies in Oedipus's speech (218--220; 236--248; 249--251; 259--265).}{Que is.} \end{qset} \end{document} How to encrypt folders (not in Home)? Is there a way to encrypt a folder, which is not in Home (/home/user/) but even in a different partition, so only my user can access/read contained files?  Alternatively, I would like to understand if it is possible to turn a complete ext4 partition into an encrypted volume, which would be mounted at user login.  If possible, I would like to make the change without reinstalling Ubuntu.  My PC has (mount output):  /dev/sda1 on / type ext4 (rw,errors=remount-ro) /dev/sda3 on /home type ext4 (rw) /dev/sda4 on /home/igor/Personale type ext4 (rw)   sda4 is the partition containing folders I would like to protect.