I am using sed to replace all lines in the txt file matching the selected patterns in each line #make 2 substitutions with sed sed 's|\/Volumes/Macintosh HD 2/Analys/output/CNE/RG/||; s|\.log||'  where I need to replace the path &quot;/Volumes/Macintosh HD 2/Analys/output/CNE/RG/&quot; However, if I define the path into variable set in bash script path_to_replace='/Volumes/Macintosh HD 2/Analys/output/CNE/RG/'  and then to use it with sed sed 's|\&quot;${path_to_replace}&quot;||; s|\.log||'  sed do nothing. How the variable could be properly used with the sed function?
I want to do:  cat update_via_sed.sh | sed 's/old_name/new_name/' &gt; new_update_via_sed.sh   in my program.  But I want to use variables, e.g.  old_run='old_name_952' new_run='old_name_953'   I have tried using them but the substitution doesn't happen (no error). I have tried:  cat update_via_sed.sh | sed 's/old_run/new_run/' cat update_via_sed.sh | sed 's/$old_run/$new_run/' cat update_via_sed.sh | sed 's/${old_run}/${new_run}/'
Showing there is no ring whose additive group is isomorphic to $\mathbb{Q}/\mathbb{Z}$ If $z_{1},z_{2},z_{3}$ are three complex number Such that $|z_{1}| = 2\;\;,|z_{2}| = 3\;\;, |z_{3}| = 4\;\;$ Then $\max$ of $|z_{1}-z_{2}|^2+|z_{2}-z_{3}|^2+|z_{3}-z_{1}|^2$  $\bf{My\; Try::}$ Let $z_{1}=2\left(\cos \alpha+i\sin \alpha\right)$ and $z_{2}=3\left(\cos \beta+i\sin \beta\right)$ and $z_{3}=4\left(\cos \gamma+i\sin \gamma\right)$ So $$f(\alpha,\beta,\gamma) = 58-\left[12\cos(\alpha-\beta)+24\cos(\beta-\gamma)+16\cos(\gamma-\alpha)\right]$$ Now How can I calculate $\max$ of $f(\alpha,\beta,\gamma)$ Help me Thanks It used to be in settings under the friends tab. The friends tab no longer exists! Where do I find that infuriatingly missing setting now? What is the most efficient way to deep clone an object in JavaScript? What is the most efficient way to clone a JavaScript object? I've seen obj = eval(uneval(o)); being used, but . I've done things like obj = JSON.parse(JSON.stringify(o)); but question the efficiency.  I've also seen recursive copying functions with various flaws.  I'm surprised no canonical solution exists. Can Git hook scripts be managed along with the repository? We'd like to make a few basic hook scripts that we can all share -- for things like pre-formatting commit messages.  Git has hook scripts for that that are normally stored under &lt;project&gt;/.git/hooks/.  However, those scripts are not propagated when people do a clone and they are not version controlled.    Is there a good way to help everyone get the right hook scripts?  Can I just make those hook scripts point to version controlled scripts in my repo? The dock doesn't work correctly after I enter my password, either. I am travelling from Panama to Los Angeles and around the States for approx 80 days then flying back to Panama and making my way up Central America for approx 3 months before flying back to LA to fly home to Australia.    Will this be OK with an ESTA?    Does it count as spending too long in the States?    I have been told that Panama is not far enough away. Let me begin by stating that I did google the answers (and I'll reference to them soon). Yet each of the resources I found discussed one particular method, I'm interested in a comparison of the approaches.  So far, I've found three ways to deal with this problem:   split the number into two columns (integer and fractional parts), as documented  or . The LaTeX code is simple, but the approach is a pain when it comes to copying and pasting tables from external sources. use  manually use Mike Zhang's automatic  (). I have yet to test it.   What do most people use? dcolumn? Are there other options? Is it possible to produce a context free grammar for Tikz path? node? Even further, I would be happy to see a definition of the tikz language in the usual manner programming languages such as Java and Pascal are defined.   The reason I ask is that I keep getting mysterious error messages for the tiniest typos. Essentially, incorrect use of the underlying languages leads to a "crash" of the compiler. This crash sometimes gives useful error messages, but sometimes they are hard to decipher. How to install the latest versions of NodeJS and NPM? Creating random numbers with no duplicates What else do I need to produce two dots above o? I know from reading  that the "primary" use of the IDisposable interface is to clean up unmanaged resources.  To me, "unmanaged" means things like database connections, sockets, window handles, etc.  But, I've seen code where the Dispose() method is implemented to free managed resources, which seems redundant to me, since the garbage collector should take care of that for you.  For example:  public class MyCollection : IDisposable {     private List&lt;String&gt; _theList = new List&lt;String&gt;();     private Dictionary&lt;String, Point&gt; _theDict = new Dictionary&lt;String, Point&gt;();      // Die, clear it up! (free unmanaged resources)     public void Dispose()     {         _theList.clear();         _theDict.clear();         _theList = null;         _theDict = null;     }   My question is, does this make the garbage collector free memory used by MyCollection any faster than it normally would?  edit:  So far people have posted some good examples of using IDisposable to clean up unmanaged resources such as database connections and bitmaps.  But suppose that _theList in the above code contained a million strings, and you wanted to free that memory now, rather than waiting for the garbage collector.  Would the above code accomplish that? Intuition behind the definition of a measurable set This week I saw the definition of a measurable set for an outer measure.     Let $\mu^*$ be an outer measure on a set $X$. We call $A \subseteq X$ measurable if $$\mu^*(E) = \mu^*(A\cap E) + \mu^*(A^c\cap E)$$ for every $E \subseteq X$.   This is not the first time I've seen this definition. Unlike most other things in mathematics, over time I have gained absolutely no intuition as to why this is the definition.   The only explanation I've ever seen is that a set is measurable if it 'breaks up' other sets in the way you'd want. I don't really see why this is the motivation though. One reason I am not comfortable with it is that you require a measurable set to break up sets which, according to this definition, are non-measurable; why would you require that? Of course, you can't say what a non-measurable set is without first defining what it means to be measurable so I suppose no matter what your condition is, it will have to apply to all subsets of $X$.     Is there an intuitive way to think about the definition of measurable sets? Is there a good reason why we should use this definition, aside from "it works"? Let's say I write a mine.service file. Then I use systemctl enable mine.service.  If I later decide to edit mine.service, do I have to tell systemd that mine.service was changed? If so, how do I do that? Delete own query on data explorer I came across a user with a notification that states:     This account is temporarily suspended network-wide. The suspension period ends on Dec 2 '18 at 2:35.   Screencap for posterity:    Unless this user is  (in which case the full year should be shown, or at least a tooltip), it seems like they should have been unbanned 4 months ago. This is a homework question of mine that Ive answered and I'd really like some feedback on my solution.       Prove or find a counter example to the claim that for all sets $A,B,C$, $$\text{if  }A\cap B=B\cap C=A\cap C=\emptyset \text{ then } A\cap B\cap C\neq \emptyset$$.   Since I can only either prove it is true, OR find a counter example I have gone with the latter because I think this statement is not true. My counter example is as follows:  Let $A = \{1,2,3 \}$ , $B = \{4,5,6 \}$ and $C = \{7,8,9 \}$. It is then clear that $A ∩ B =  B ∩ C =  A ∩ C = \emptyset$ .  If we let $x ∈ A\cap B\cap C$ then $x$ must be in $A$ and $B$ and $C$. Since this cannot be possible because there are no common elements then this implies that $A∩B∩C$ has to be equal to a null set i.e $A∩B∩C = \emptyset$ and thereby showing that (at least for this scenario) if $A \cap  B =  B \cap  C =  A \cap  C = \emptyset$ then $A\cap B\cap C = \emptyset$.  Is this okay? Any feedback will be greatly appreciated thank you! What is a mixin, and why are they useful? Touchpad not recognized on Asus N550JK - TP500L (FocalTech) I'm installing a new laptop and the touchpad is not fully recognized. Specifically, two finger scrolling does not work.  extract from /proc/bus/input/devices  I: Bus=0011 Vendor=0002 Product=0001 Version=0000 N: Name="PS/2 FocalTech FocalTech Touchpad in mouse emulation mode" P: Phys=isa0060/serio1/input0 S: Sysfs=/devices/platform/i8042/serio1/input/input5 U: Uniq= H: Handlers=mouse0 event4 B: PROP=1 B: EV=7 B: KEY=30000 0 0 0 0 B: REL=3   Also, xinput list gives me:  ⎡ Virtual core pointer  id=2    [master pointer  (3)] ⎜   ↳ Virtual core XTEST pointer id=4   [slave  pointer  (2)] ⎜   ↳ ELAN Touchscreen id=10    [slave  pointer  (2)] ⎜   ↳ PS/2 FocalTech FocalTech Touchpad in mouse emulation mode id=14   [slave pointer  (2)] ⎣ Virtual core keyboard                     id=3    [master keyboard (2)]     ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]     ↳ Power Button                              id=6    [slave  keyboard (3)]     ↳ Video Bus                                 id=7    [slave  keyboard (3)]     ↳ Video Bus                                 id=8    [slave  keyboard (3)]     ↳ Sleep Button                              id=9    [slave  keyboard (3)]     ↳ USB2.0 HD UVC WebCam                      id=11   [slave  keyboard (3)]     ↳ Asus WMI hotkeys                          id=12   [slave  keyboard (3)]     ↳ AT Translated Set 2 keyboard              id=13   [slave  keyboard (3)]   And finally, synclient tells me there is no synaptics driver active:     Couldn't find synaptics properties. No synaptics driver loaded?   So, it seems the touchpad is not recognized as a synaptics touchpad. It works, but not the synaptics specific parts.  It's in mouse emulation mode (no idea what it means). And it works together with other pointing devices, especially the touchscreen (I can confirm this works).  I have tried adding i8042.nomux=1 to the kernel parameters, but it didn't change anything... Any hint ?