There may be a question out there for this somewhere. But I wasn't able to find it easily.   Basically I want to write a bash script on a new box. A script that I've previously used.   Example:  #!/bin/bash -ex hi='hello world!' echo $hi   I've always used (for multiline output)  cat &gt; script.sh &lt;&lt;EOF #!/bin/bash -ex hi='hello world!' echo $hi EOF   But as you may have noticed this has issues with $hi, and other symbols. Is there a good way to do this? Tips Tricks?
If you copy the contents of   httpd.conf   and then paste it into a cat command.. such as this one..  #!/bin/bash cat &gt; /test &lt;&lt; EOF pasted here.. EOF   you run into this error:  -bash: command substitution: line 1: unexpected EOF while looking for matching `'' -bash: command substitution: line 4: syntax error: unexpected end of file   perhaps the solution is to escape the dollar signs and maybe even quotes and so on..  but given that this is such a large file.. can dollar signs be automatically be escaped ?  is my only option to escape them via another program and then give it to the cat command ?
Failed to Login : Invalid session (Try restarting your game) Minecraft Error When I try to connect to servers or join up on lan worlds in Minecraft it says "Failed to Login : Invalid session (Try restarting your game)". Multiplayer used to work fine but now keeps coming up with this error. Can anybody help? Problem about angle in isosceles triangle Scoping in assigning a derivative Tool to confirm Gaussian fit I have a series of (x1,y1) points.  I'm using a 3rd party software tool to which I feed these points. The tool then provides a mechanism for me to get back a series of (x2,y2) points that are on a Gaussian curve that has been fit to the data.  I'd like to confirm that the points I'm getting back are correct (because, frankly, sometimes they don't look like they are.)  What would be an easy on-line or Excel procedure that would allow me to enter the X1, Y1 series and then get back a series of X2, Y2 points, plot both series, and maybe even see the s.d.?  It's been 20+ years since I did any stats, so I'm just "cook-booking" this with no understanding of what I'm trying to do.  EDIT  The is a plot by wavelength, of intensity.  X-axis is the colors of a rainbow, in the familiar ROYGBIV order. The Y-axis is measured intensity of that particular color.   The help page from the vendor is here:    I call the library with each x1, y1 data point.  I then call the method above. I then call the library again with a series of x values (or maybe the x1 series itself), retrieving the y2 values on the fitted curve. I also retrieve the sd of the fit.  EDIT 2  Below is a link to an image of the dataset and Gaussian fit that has me concerned.  I think that the peak of the fitted curve is too low. Converting a drupal/drupal site to Work With Composer How to change keyboard layout in Lubuntu 15.10? I have recently upgraded my PC from Lubuntu 14.10 to 15.10. Before the upgrade my keyboard layout matched my Danish keyboard. But after the upgrade I probably have a standard English/US layout.   Preferences/Language Support, doesn't let me configure the keyboard layout. Preferences/Keyboard and Mouse, only let me configure stroking delay and similar.    I don't know about iBus and fcitx, as far as the tooltip infomation tells me, its for more complex languages such as Chinese.  I don't have a US icon in the taskbar, no keyboard and/or language icon at all.  Things I have tried:   Running the following in a terminal works, but only until the next reboot:  setxkbmap -layout dk  I got the following parameter in the file /etc/default/keyboard:  XKBLAYOUT="dk"  Installing and running the app Lxkeymap changes the keyboard to Danish when I run it, but rebooting will change the layout back to US.   I don't want anything fancy, I just want to set my keyboard layout to Danish. How can I do that? I can write  VAR=$VAR1 VAR=${VAR1} VAR="$VAR1" VAR="${VAR1}"   the end result to me all seems about the same. Why should I write one or the other? are any of these not portable/POSIX? How to calculate $f(x)$ in $f(f(x)) = e^x$? How would I calculate the power series of $f(x)$ if $f(f(x)) = e^x$?  Is there a faster-converging method than power series for fractional iteration/functional square roots? Find in Files: Search all code in Team Foundation Server How to contact professors for PhD vacancies? I know many master's students who get an opportunity to talk to their potential PhD advisors well before applying. In most cases this opportunity is available by the professors with whom they worked for their master's. Moreover, there are many others who establish a contact with professors by mailing them and enquiring about PhD vacancies.   My questions are:   How important is knowing an advisor prior to applying for PhD?  Does an email interaction play a vital role when the department makes its admit decisions? If email contact is important, can a student send out mails to 2-3 professors (working in the same area) in case one of them does not bother to reply? To sum up, is applying of any use (especially in top universities) when you have no contacts and only your credentials to bank on? How could I go about detecting (returning true/false) whether an ArrayList contains more than one of the same element in Java?  Many thanks, Terry  Edit Forgot to mention that I am not looking to compare "Blocks" with each other but their integer values. Each "block" has an int and this is what makes them different. I find the int of a particular Block by calling a method named "getNum" (e.g. table1[0][2].getNum(); Do indexes work with "IN" clause If I have a query like:  Select EmployeeId  From Employee  Where EmployeeTypeId IN (1,2,3)   and I have an index on the EmployeeTypeId field, does SQL server still use that index? Subset of a countable set is itself countable How is it proved that if $$A \subset B\ \text{with}\ B\ \text{countable} $$ then $A$ is either countable, finite, or empty? I think the proof involves a $1-1$ correspondence between $\mathbb{N}$ and $A$ but other than that I do not know how to proceed.  EDIT: I have checked the solution and it advises me to proceed as follows. " As a start to a definition of $$g: \mathbb{N} \rightarrow A$$ set $$g(1)=f(n_1) $$ Then show how to inductively continue this process to produce a $1-1$ function $g$ from $\mathbb{N}$ onto $A$."  So the proof according to my book involves induction. Image upload from photo gallery So this is pretty obvious. Image upload?    How about allowing to attach images in questions from the photo gallery, by perhaps sending the image for off-site storage like done from the full-web version? Probability of winning the game "1-2-3" If a lightning-radio-group has two options, and a user selects one, I want to programmatically have the UI changed back to the other one.  Link to a . (code copied below)  import { LightningElement, track } from 'lwc';  export default class RadioGroupRequired extends LightningElement {     @track value = 'option1';      get options() {         return [             { label: 'Option one', value: 'option1' },             { label: 'Option two', value: 'option2' },         ];     }      handleOnChange(evt) {         this.value = 'option1';         // how to make the UI select Option one?     } }   And the html:  &lt;template&gt;     &lt;lightning-radio-group name="radioGroup"                            label="Radio Group"                            options={options}                            value={value}                            required                            type="button"                            onchange={handleOnChange}&gt;&lt;/lightning-radio-group&gt;                             value={value} &lt;/template&gt;     I think that there is no rerendering because the bind variable, {value} doesn't actually change. However, the selected state of the lightning-radio-group does, and I want to be able to change it back. How can that be achieved?   I did not notice any methods or attributes that would seem to do the trick in the . Consider a string under tension, for example, a string on a guitar. When a guitar string is plucked, it vibrates at a certain frequency. When the tension on the string is increased by twisting the tuning peg at the end of the neck, the frequency of the string increases. According to , increasing the tension on a string also increases the speed of the wave moving through it. According to  the speed of a wave is higher in a more dense medium.  Does this mean that increasing the tension also increases the density?  This does not seem very logical to me, since density is the "compactness" of a substance, or how close together the individual molecules are. By twisting the tuning peg on a guitar, you rotate the cylinder that the string is fixed to, wrapping it around more tightly. This pulls more of the string around that cylinder, similarly to when you reel in a fishing rod. Since more of the string's molecules are now wrapped around the peg, there should be fewer molecules over the same distance between the bridge and the nut (the two ends of the vibrating portion of the string), therefore bringing the density down. python3 is not supporting gtk module How to define a recurrence relation in Maple without the command proc? Is it possible to create a "weak reference" in javascript? Is there any way in javascript to create a "weak reference" to another object?   Can anyone think of a way to implement this  behavior in javascript?