Source part: if [ $(jq -r '.patch_at' update.json) -ge &quot;4&quot; ]; then     recentlycheckedat=$(echo '('`date +&quot;%s.%N&quot;` ' * 1000000)/1' | bc)     contents=&quot;$(jq '.recently_checked_at = &quot;$recentlycheckedat&quot;' update.json)&quot; &amp;&amp; \     echo &quot;${contents}&quot; &gt; update.json # have to fix, its literally writing $recentlycheckedat fi  Focus: contents=&quot;$(jq '.recently_checked_at = &quot;$recentlycheckedat&quot;' update.json)&quot;  How to insert the content of the variable &quot;recentlycheckedat&quot; instead of literally printing out &quot;$recentlycheckedat&quot;? It stores the current timestamp as a command on a variable, but this variable can't work inserted in a command inside another variable. How to achieve this? And feel free to edit with an more appropriate title. full source -  Update - solution: &quot;.recently_checked_at = &quot;$recentlycheckedat&quot;&quot; (many thanks to @ilkkachu)
I am trying to pass a variable into jq like this '.Linux.date.$var' so far I have tried quoting them by name which is working fine. But I want to use variable to call them.  I have this, which is working fine  exectime=$(date -d now);     cp $check_exec_history $check_exec_history.tmp     jq --arg key1 true --arg key2 "$exectime" --arg name "$name" '.Linux.script_executed.first = $key1 | .Linux.date_executed.first = $key2' $check_exec_history.tmp &gt; $check_exec_history;      rm $check_exec_history.tmp;   I want to get to this, but not working:  name=first; exectime=$(date -d now); cp $check_exec_history $check_exec_history.tmp jq --arg key1 true --arg key2 "$exectime" --arg name "$name" ".Linux.script_executed.$name = $key1 | .Linux.date_executed.$name = $key2" $check_exec_history.tmp &gt; $check_exec_history;  rm $check_exec_history.tmp;   I came this far: using this answer  But I am not sure where I am doing mistake.  name=first; exectime=$(date -d now);     cp $check_exec_history $check_exec_history.tmp     jq --arg key1 true --arg key2 "$exectime" --arg name "$name" '.Linux.script_executed.name==$name = $key1 | .Linux.date_executed.name==$name = $key2' $check_exec_history.tmp &gt; $check_exec_history; rm $check_exec_history.tmp;
How do I transcode a Javascript string to ISO-8859-1? What is a good website to hack around using Selenium? I want to learn Selenium, but I don't know what to code. Sure, I can throw Google some queries, I can fill out some forms, press buttons, find divs and links, etc. But I think this stuff is pretty basic.  What would be more "advanced" ideas to try out? Can you give real-life examples? "...would have trouble imagining...": Is this present participle or gerund? Why is the set of commutators not a subgroup? Why use a z test rather than a t test with proportional data? When testing the difference between 2 proportions why do we use a z-test rather than a t-test?    Further, is there a simple way to conduct an omnibus test for significant differences between more than 2 proportions (in the form of percentages). Is there an equivalent to a one-way ANOVA for this?  I imagine that you could use logistic regression (assuming you have the original data for the proportions in the form of 0s and 1s) Are there other options? i have a scenario where i want to know in which position number the column name comes   like i have sample data below   ID|NAME|S1|BQ|S2|VN|D1 1|vimal|10.12|12.4|56.2|12.2|11.22 2|vilas|10.12|12.4|56.2|12.2|11.22 3|viky|10.12|12.4|56.2|12.2|11.22   Colum name : S1 S2 D1   output should be :  3 5 7 Prove that $\gcd(a^n - 1, a^m - 1) = a^{\gcd(n, m)} - 1$ For all $a, m, n \in \mathbb{Z}^+$,   $$\gcd(a^n - 1, a^m - 1) = a^{\gcd(n, m)} - 1$$ Ordered N-Tuples as Cartesian Products of Indexed Families In Introduction to Topology, Mendelson defines the Cartesian Product of an Indexed Family as follows:     DEFINITION  Let $\{X_\alpha\}_{\alpha \in I}$ be an indexed family of sets. The product  of the sets $\{X_\alpha\}_{\alpha \in I}$,    written  $\prod_{x\in I}X_\alpha$ consists of all functions $x$ with domain the indexing set $I$ having the property that for each $\alpha \in I$, $x(\alpha)\in X_\alpha$.    Halmos, in Naive Set Theory, makes the following observation about this sort of product:     Ordered triples, ordered quadruples, etc., may be defined as families whose index sets are unordered triples, quadruples, etc.   However, it is not immediately apparent to me why this is true. It makes sense if we understand the prior assertions in Halmos that $\prod_{i \in I} X_i = X_i$ and that $\prod_{i \in I} X_i = X_a \times X_b$ when $I = \{a, b\}$, but these already pose difficulty for me.  Let $I = \{0, 1\}$, let $X_0 = \{A, B\}$, and let $X_1 = \{C, D\}$. Then by Mendelson's (and Halmos's) definitions, it would seem to me that . . .  $$\prod_{i \in I} X_ i = \{\{(0, A), (1, C)\}, \{(0, A), (1, D)\}, \{(0, B), (1, C)\}, \{(0, B), (1, D)\}\}$$  This would appear to me to be the set of all functions matching the definition given, but it is not equal to $X_0 \times X_1$. Moreover, extending this to a case where the index set $I$ is a triple, we would not end up with ordered triples, but with each subset of the product containing three ordered pairs.  When Halmos posits the equalities he does, the idea seems easy to grasp, but the peculiar wording of Mendelson's definition suggests something different to me. In the 70's I had a stack of old Amateur Radio magazines (50s-60s), and for a long time I saved an article about using the  to combine a number of resistors to achieve a specific value. Does anyone recall and have a copy of this article, or know how the Euclidean algorithm is applied to solve this problem? When I visit the reputation tab of my profile, I see a lot of stuff. I can make out some of it, but not all.   What do all the event types mean? Why do some events show an odd reputation gain or not show any reputation change at all? Why are some events sometimes highlighted in yellow? My reputation suddenly dropped, but I don't see anything. What happened? Why do some events disappear from my reputation history? Are there any banned subjects on Area 51? I know of the following rules for creating a proposal on Area 51:  The scope must be reasonably well-defined, not too unclear (e.g. &quot;cool stuff&quot;), too opinion-based (e.g. &quot;car reviews&quot;), too broad (e.g. &quot;life on Earth&quot;), or too narrow (e.g. &quot;The 1995 academic misconduct scandal at East Oak Mews High School&quot;). One  come to Area 51 with an already existing community rather than hope to build one on Area 51. Proposals that are subsets of existing sites are not acceptable (e.g.  — deleted). These get closed as &quot;This subject is already well-covered by a live Stack Exchange site. We generally do not split off subjects simply to give them their own space.&quot; Proposals for non-English sites .  Other than the criteria above, are there any per se restrictions on site content for an Area 51 proposal? If so, what topics are currently banned? I would expect a proposal for a &quot;Let's organize a lawsuit against Stack Exchange&quot; or &quot;[Specific SE staff member] sucks, amirite?&quot; would get closed for obvious reasons, but I'm interested if there are any non-obvious topics that are not currently allowed in proposals regardless of how well-defined, well-scoped, original, and well-supported by a community they are. Having a list of banned topics would be helpful to potential proposers as well as the communities that back them. For example, I wouldn't want to go to all the effort of organizing a community, bringing them to Area 51, etc., only to have my proposal closed with a curt &quot;Sorry, due to the political climate, we are not currently accepting proposals for sites about real-life weapons.&quot; custom closure. To be clear, I am asking solely about topic restrictions (e.g. &quot;no sites about fishing, hunting, or weapons&quot;). I'm not asking about clarity requirements, the requirement to have a pre-existing community, not duplicating an existing site, or the requirement to not use sock puppets to artificially inflate proposal stats. Those requirements are already well-defined elsewhere or else are common sense. Also to be clear, I don't have a specific proposal idea in mind right now or the community to make it happen. I'm asking in general. The question could be rephrased as &quot;What are those topics where I shouldn't even bother to try to define, gather a community, etc. because any attempt to propose a site will be summarily closed due to covering a banned topic?&quot; This is not a duplicate of  because that question is about the appropriateness of expanding a proposal to cover things that are acceptable proposal topics but arguably don't make sense in combination with the original proposal scope. My question is about topics that are completely banned from proposals regardless of whether they are included in the original proposal description or tacked on by the community later. Ruby can add methods to the Number class and other core types to get effects like this:  1.should_equal(1)   But it seems like Python cannot do this. Is this true? And if so, why? Does it have something to do with the fact that type can't be modified?  Update: Rather than talking about different definitions of monkey patching, I would like to just focus on the example above. I have already concluded that it cannot be done as a few of you have answered. But I would like a more detailed explanation of why it cannot be done, and maybe what feature, if available in Python, would allow this.  To answer some of you: The reason I might want to do this is simply aesthetics/readability.    item.price.should_equal(19.99)   This reads more like English and clearly indicates which is the tested value and which is the expected value, as supposed to:  should_equal(item.price, 19.99)   This concept is what  and some other Ruby frameworks are based on. Why avoid increment ("++") and decrement ("--") operators in JavaScript? Spaces and em-dash In using the em-dash, where do you put the spaces? Which of the following is correct?     School is based on the three R’s —reading, writing, and ’rithemtic.   or     School is based on the three R’s— reading, writing, and ’rithemtic.   or     School is based on the three R’s — reading, writing, and ’rithemtic. Is it true that quantum mechanics technically allows anything to happen? Maybe this is a silly question (I think it is), but it's a question I'm arguing with some of my friends for a long time.  The ultimate question is: Is everything (in our Universe) possible ?  I've read some books (Penrose, Hawking, Greene, etc.) where it was clearly stated several times that quantum mechanics allows any situation to happen (e.g. everything is possible) - even with absurdly tiny probabilities?  Does this mean only physically possible - or "ultimate" possible ?  For example (I know this example seems really absurd, but I'm saying this so you get the idea) what my friends clame it is possible:   If I ask my friend(s): "Is it possible there is a Sun-sized star in my pocket right now?" They will respond: "Yes, there is very very tiny possibility this can be true!" Etc. How to include custom non-system folder under This PC in Windows 8.1? I've recently upgraded from Windows 8 to 8.1 and noticed the restructured This PC folder, formerly Computer.   What I want to achieve is to include custom folder under "This PC".    What I've found after googling is that what is displayed under "This PC" is stored in registries under   HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace  However those folders (such as Desktop, Documents, etc) are referenced via CLSID and the folder I want to include in the list does not have CLSID. How to echo output of a top into a text file? I want to write batch or something, that will write output of top into a file on login.  I did top &gt;&gt; output-file, but it contains some strange character!  Can somebody give a simple tutorial about how to write batch file in Linux? "Leave a comment" link even when you can't On  I disabled  comments for "USDCAD options vs CADUSD options arbitrage?", but it  still has a "Leave a Comment" link.   Clicking the link takes you to    where it, of course, shows that you can't leave a comment.   The timeline page correctly does not show the 'comment' link:    How to fix? Folding a cube (animation) I'm trying to fold a cube with an animation. I've tried inverse kinetics with no luck. Here are some images that explain what I'm trying to do. I'm trying to make this so that    when the upper bone is pushed down, the box is folded to the ground. when the upper bone is pulled up, it unfolds the box. The following MWE compiles (for me)  \documentclass{article}  \usepackage{pgfplots} \pgfplotsset{compat=newest} \usetikzlibrary{external} \tikzexternalize[prefix=figures/externalized/]   \begin{document} \begin{figure}     \centering     \begin{tikzpicture}          \begin{axis}  %           \addplot3[surf,mesh/rows=129,mesh/cols=129,mesh/ordering=y varies] table[x=X,y=Y,z=psi] {figures/data/LidDrivenCavity/Lid_SPIKE_128x128_Re1000_psi.dat};              \addplot3[contour gnuplot,mesh/rows=129,mesh/cols=129,mesh/ordering=y varies] table[x=X,y=Y,z=psi] {figures/data/LidDrivenCavity/Lid_SPIKE_128x128_Re1000_psi.dat};          \end{axis}      \end{tikzpicture}     \caption{ciao} \end{figure} \end{document}   where the data file is . If I de-comment the first \addplot3 and comment the second one, then I get an error. The final part of the log file (the interesting one, I think) is  ===== 'mode=convert with system call': Invoking 'pdflatex -shell-escape -halt-o n-error -interaction=batchmode -jobname "figures/externalized/prova-figure0" "\ def\tikzexternalrealjob{prova}\input{prova}"' ======== \openout3 = `prova.auxlock'.  runsystem(pdflatex -shell-escape -halt-on-error -interaction=batchmode -jobname  "figures/externalized/prova-figure0" "\def\tikzexternalrealjob{prova}\input{pr ova}")...executed.  \openout3 = `prova.auxlock'.   ./prova.tex:22: Package tikz Error: Sorry, the system call 'pdflatex -shell-esc ape -halt-on-error -interaction=batchmode -jobname "figures/externalized/prova- figure0" "\def\tikzexternalrealjob{prova}\input{prova}"' did NOT result in a us able output file 'figures/externalized/prova-figure0' (expected one of .pdf:.jp g:.jpeg:.png:). Please verify that you have enabled system calls. For pdflatex,  this is 'pdflatex -shell-escape'. Sometimes it is also named 'write 18' or som ething like that. Or maybe the command simply failed? Error messages can be fou nd in 'figures/externalized/prova-figure0.log'. If you continue now, I'll try t o typeset the picture.  See the tikz package documentation for explanation. Type  H &lt;return&gt;  for immediate help.  ...                                                l.22    \end{tikzpicture}  ?  PGFPlots: reading {figures/data/LidDrivenCavity/Lid_SPIKE_128x128_Re1000_psi.da t} Runaway argument? {\pgfkeyssetvalue {/pgfplots/execute at begin plot visualization}{}\pgfkeyssetv alue \ETC. ./prova.tex:22: TeX capacity exceeded, sorry [main memory size=5000000]. &lt;argument&gt; ...5e-1],2Y7.753628e-3]}{2Y8.20894\ETC.  l.22    \end{tikzpicture}  If you really absolutely need more capacity, you can ask a wizard to enlarge me.   Here is how much of TeX's memory you used:  20761 strings out of 493054  547383 string characters out of 6134761  5000001 words of memory out of 5000000  23958 multiletter control sequences out of 15000+600000  3640 words of font info for 14 fonts, out of 8000000 for 9000  1141 hyphenation exceptions out of 8191  62i,4n,84p,728b,1519s stack positions out of 5000i,500n,10000p,200000b,80000s ./prova.tex:22:  ==&gt; Fatal error occurred, no output PDF file produced!   similar (or the same) error appears if externalization is not enabled/used.  My TeX distribution is TeX Live on Mac OS X 10.9.5 and I use TeXShop as editor.  Once I (partially) solved a  on Windows+MikTeX+TeXniccenter by modifying/adding options to the command executed when compile button is pressed. I say partially since I actually solved the problem for some data file. Then I experienced the same problem with larger datafile and/or different plots (I don't remember anymore) and didn't find a way out, no matter how much I extended the memory.  What should I do now?