How would I start a program when I login to terminal?
Execute a program at login
I have a JavaScript object like the following:  var p = {     "p1": "value1",     "p2": "value2",     "p3": "value3" };   Now I want to loop through all p elements (p1, p2, p3...) And get their keys and values. How can I do that?  I can modify the JavaScript object if necessary. My ultimate goal is to loop through some key value pairs and if possible I want to avoid using eval. I have noticed a significant number of suggested edits that attempt to fix code, or change the original meaning of someone else's post.    Is this really a good idea?    I've been on StackOverflow awhile, and among the editors who have sufficient reputation to edit without approval, I've never seen anyone modify the technical content or meaning of someone else's post.   I would consider obvious syntax and spelling errors OK to change, but I have seen many suggested edits that change the meaning of the code that was posted, or add things to the code that have nothing to do with the original question. A good example of this would be adding parameters to a SQL command, when the question was not asking about SQL injection. SharePoint 2013 Online - Missing Follow Link Tikzpicture-figure: Order plot data (asc/desc)? I am using a tikzpicture for plotting. the values I want to plot are typical (X,Y) pairs. The x-value is an uninteresting id-value. I want to order the bins ascending/descending according to the y-value, but how do I do that? The figure seems to automatically take the x-values for ordering, how can I override that? (I am not particularly fixed to tikzpicture - its just the first thing that actually worked and displayed the plot....) Following minimal-working example, how could I achieve a reordering according to the y-value?  \documentclass{article} \usepackage[english]{babel} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{relsize} \usepackage{times} \usepackage{url} \usepackage{latexsym} \usepackage{graphicx} \usepackage{colortbl} \usepackage{color} \usepackage{caption} \usepackage{pgfplots, pgfplotstable} \usetikzlibrary{arrows} \usepackage{amsmath} \usepackage{multirow} \usepackage{booktabs}  \usepackage{filecontents} \definecolor{OgAns}{rgb}{0, 0.8, 0.4}  \begin{filecontents}{testdata.dat} 1   30 2   44 4   26 3   39 \end{filecontents}  \begin{document} \begin{figure} \begin{tikzpicture}         \begin{axis}[                ybar stacked,             ymin=0,             ymax=100,             bar width=5pt,             legend style={at={(0.35, -0.4)},anchor=south west},             legend columns=-1                       ]           \addplot[ybar,fill=OgAns]  file {testdata.dat};          \end{axis}     \end{tikzpicture} \end{figure}   \end{document} Working with systems with Perfect Multicollinearity I am working with a time-series dataset that is based on demand-supply dynamics with several variables.  THe sample data for one time period is: &gt; data # A tibble: 19 x 6    Pred_error_A Pred_error_B  Pred_error_C  Pred_error_D  Pred_error_E  Pred_error_Target                  &lt;dbl&gt;         &lt;dbl&gt;          &lt;dbl&gt;      &lt;dbl&gt;      &lt;dbl&gt;           &lt;dbl&gt;  1            -0.45           1.72          -0.170      1.85       -0.01          -0.7    2            -0.45           1.72          -0.170      2.35       -0.01          -1.2    3            -0.45           1.92          -0.170      2.35       -0.01          -1      4            -0.0500         0.37          -0.12       1.65       -0.01          -1.5    5             0             -0.840         -0.12       0.950      -0.01          -1.7    6             0             -0.200         -0.12       1.35       -0.01          -1.5    7             0             -0.460         -0.12       1.35       -0.01          -1.8    8             0             -0.520         -0.12       1.05       -0.01          -1.5    9             0             -0.340         -0.12       1.05       -0.01          -1.4   10             0             -0.340         -0.12       1.35       -0.01          -1.7   11             0             -0.110         -0.12       1.05       -0.01          -1.2   12             0             -0.110         -0.12       0.850      -0.01          -1     13             0              0             -0.12       0.350      -0.01          -0.4   14             0              0             -0.12      -0.15       -0.01           0.100 15             0              0             -0.12      -0.350      -0.01           0.300 16             0              0             -0.02       0          -0.01          -0.1   17             0              0              0          0           0              0     18             0              0              0          0           0              0     19             0              0              0          0           0              0   I was working on a regression for each time period with data and wanted to find the relative importance of regressors in explaining the target variable ( Pred_error_A through E and dependent variable is Pred_error_Target ) using relaimpo package in R. However, I soon realized I can't use regression setting because of near to perfect collinearity and hence no relative importance values. Is there a way to go around this? Or, can I use any other method (instead of regression)? Any suggestions will be useful. The predictors are near to perfect and each one is important. I can't exclude any single one and I need the relative importance of all 5 regressors. I am also trying XGBoost as an alternative. However, I am not sure if it takes care of multicollinearity. Timeline vote summary shows votes for the 24 hours following the timestamp, which is confusing The new timeline is pretty snazzy. But there's one thing I've noticed that's a bit jarring; the timestamp for vote summaries is always 0:00:00 on a particular day, and the summary covers the rest of that day. So you end up with a summary that always shows up earlier than the events that presumably triggered the votes that show up in it.  A simple solution is to have it display 23:59:59 instead, and sort accordingly. This way the summary comes in after the events it summarizes. Is there any difference between "offense" and "offence"? "Offense" vs. "offence", which is more correct? If both are correct, are there any differences in shades of meaning and/or usage? How do I deal with a runaway bride? There are a few questions on this forum asking about why Latex3 is taking so long to come out. However, all of these are from the early 2010s. I'm just wondering what the current state of the project is and whether it's ready (or nearly ready) for prime time? Layers with different directional drop shadows in Photoshop I am wondering how to have 2 different directional drop shadows in the one file with Photoshop. e.g. 2 different type layers — one has a drop shadow at 90 degrees, the other at -45 degrees.  Currently it seems Photoshop only lets me have 1 universal direction for the whole file, which I find really pointless.   I know how to apply different drop shadows and merge down layers to achieve the same thing, but its tedious and not exactly streamlined for making future changes to that layer.  How is this achieved? I'm using Xubuntu 14.04 64 bit. I know that question been asked a billion times, but all of them consist of editing following file:  /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla   That file does not exist on my system. I tried com.xubuntu.enable-hibernate.pkla but doesn't exist either, locate command doesn't find it. Is it the case that for all sets $A, B, C,$ and $D$, $(A \times B) \cup (C \times D) = (A \cup B) \times (C \cup D)$? I think I have managed to work this out, however there is no solution provided with the question so I thought it best to check.   My working:  Let $(x,y) \in (A \times B) \cup (C \times D)$  $\Rightarrow x \in (A$ or $C)$ and $y \in (B$ or $D)$  $\Rightarrow (x, y) \in (A \cup C) \times (B \cup D)$  $\Rightarrow (A \times B) \cup (C \times D) \subseteq (A \cup C) \times (B \cup D)$  Now let $(x,y) \in (A \cup C) \times (B \cup D)$  $\Rightarrow x \in (A$ or $C) $ and $y \in (B$ or $D)$  $\Rightarrow (x, y ) \in (A \times B) \cup (A \times D) \cup (C \times B) \cup (C \times D)$  $\Rightarrow (A \cup C) \times (B \cup D) \nsubseteq (A \times B) \cup (C \times D)$  $\Rightarrow (A \times B) \cup (C \times D) \not= (A \cup C) \times (B \cup D)$  Is this correct?  Thank you. I had to create an 800mm x 2000mm print and so I started by actually creating a 800mm x 2000mm file in Illustrator.  The file contained only vectors so my question is:  Can I create my file size dimensions to be smaller as long as it keeps the correct ratio for the final print?  Like I said, vector ONLY, no photos or raster images. Most of the time, it should be really easy to determine who is my ally and who is not. The people who try to kill me are most likely my foes, whereas the people who entered the dungeon with me are probably my allies.   But sometimes it’s not that simple. What if one of my party members got replaced by an evil doppelganger, who plans to kill me in the near future? What if one of my allies infiltrated the court of the evil king and I accidentally have to fight her, while she is (unbeknownst to me) under the effect of a  spell? What if a character fell in love with the BBEG and just wants to save him from himself, while the BBEG hates the character and actively tries to murder him?  Most spells and abilities that affect others specify the targets as “creatures” or “willing creatures”. Some explicitly affect allies only. That’s why I want to know, how to determine who’s allied with whom. Do I have to think that someone is my ally for someone to count as my ally? Does someone else have to believe to be my ally in order to count? Do both of us have to agree on being allies? Is there an objective observer who determines who’s allied? Can Person A be the ally of Person B, while Person B is not the ally of Person A?  There are many examples for spells/abilities that care about allies, among others:   the Exalted Champion feature from the  (SCAG, p. 132-133), that grants allies within 30 feet advantage on Wisdom saving throws. the Inspiring Surge feature from the  (SCAG, p. 128), that allows one or two allies within 60 feet to make a melee weapon attack as a reaction.   With features like this, you could accidentally affect someone who’s not actually your ally. You could fail to affect someone who is actually your ally, but you don’t know it (yet). Or you could affect someone who doesn’t want to be affected (because they don’t want to be allied with you). This all depends on the interpretation of the word “ally”. I’m not sure if "ally" is a defined game term (but I don’t think so), or if I have to rely on the dictionary definition. That’s why I want to ask:  How do I determine who’s allied with whom? Will $\sum^{\infty}_{n=1}|a_n|^p$ converge? Does a passive Perception (Wisdom) check add WIS mod + Perception skill? I'm new to D&amp;D. There seems to be a discrepancy between the 5e Starter Set Rulebook and the associated character sheets. The Rulebook says that a passive wisdom (percep) score is "10 + the creature's wisdom modifier, as well as any bonuses."  In the example they have a 1st-level character (with a proficiency bonus of +2) Wisdom of 15 (+2) and a  proficiency in Perception, he or she has a passive Wisdom (Perception) of 14 (10+2+2).  But the Human Fighter Folk hero character has a WIS mod of +1, and a +3 written beside perception, and a passive Wis percep of 13 (not 14?).  The Dwarven Cleric has Wis mod of +3 and a +3 written beside perception, and only a 13 passive wisdom.  I guess this has to do with proficiency in the skill, but I'm confused. Can someone explain these instances and maybe also when proficiency is used, vs when just the modifier or just the skill without proficiency? Scala final vs val for concurrency visibility I think this story dates from the 1950s, plus or minus a decade - I read it about 30-35 years ago in a (then) fairly old story collection. It involves explorers on a planet falling into a gelatinous object that dissolves most of their bodies except for their brains and nervous systems. About four of them fall in to the same creature, and they discover that by thinking about it they can grow limbs and other body parts. At first they try to fight each other, by growing arms so they can hit each other's brains - and one of them realises that growing a skull would be a good idea - but later they agree to grow legs and move the creature around co-operatively. I would love to identify this story. Upgrade SQL Server 2000 database to 2008 R2 and enable new features I'm trying to change the numbers in problems I write for examples I use in my class as well as assignments. However the problems are still inspired by the textbook. Are the problems sufficiently different from the textbook problems to not have copyright issues? There is also an issue of theorems and definitions. Authors of the calculus textbook certainly did not come up with these things. Is it OK to just copy them down in my lecture notes?  By the way I do share my lecture notes on Piazza and the course I'm teaching is multivariable calculus.