ubuntu:
rm -rf lampp
ubuntu:
rm -rf lampp
1) First install Java onto your machine
2) You then have to set your environment variable JAVA_HOME to be the location where the bin directory of all the .dlls and .exes are.
Right click the windows icon on the very bottom left. Select System
Click on the Environmental variable button. And look for the JAVA_HOME variable. If its there, edit it. If its not, click on ‘New’, and create the JAVA_HOME variable.
The Variable value is where the location is. What we’re looking for is the location to the bin folder where all the .exe and .dll are. Hence, after you install Java, its usually somewhere in C://Program Files/Java/JRE_x.xx.xx/.
In our case, if you start from the C directory, find Program Files, then find Java. In my case, I found it at C:\Program Files (x86)\Java\jre1.8.0_73
Thus, you just paste that into the environment variable.
3) you then have to add the directory location of the PATH variable. When you see it, click edit, and then go to the end of the string. Then type in:
;C:\Program Files (x86)\Java\jre1.8.0_73
notice the semi-colon. this is to separate this entry from the other entries.
db.deviceCollection.insert({ “device_id” : “f0bafec6 be2a9e1a c31c9cb0 8c6589df 0bc1a7c4 ac9d7767 e63b7656 07c62145”, “bundle_id” : “com.rtsao.localapn”, “description” : “yes” })
Go to the url that’s set for your app.
Give an email so that the app can send your registration information.
Your email should arrive in a few minutes.
The email contains everything about the event, including the time, date, location, and maps of how to get there.
All you need to do is click on the “click here” to finish your registration so that the app can confirm you.
Once you click on the link, you will be brought to a page where it will tell you that you have finished registration and there’s nothing else to do.
There will be an email reminder sent to you a few hours before the event.
http://code.tutsplus.com/tutorials/fully-understanding-the-codethiscode-keyword–net-21117
note:
When a function is called without an owner object, the value of this becomes the global object.
In a web browser the global object is the browser window.
This example returns the window object as the value of this:
1 2 3 4 5 6 7 8 |
var Person = function(name) { this.name = name || 'johndoe'; // 'this' refers to the window object }; var cody = Person('Cody Lindley'); //console.log(cody.name); // UNDEFINED! console.log(window.name); //logs Cody Lindley, |
The reason why window.name logs Cody Lindley is because the ‘this’ inside the function references the window global object. Hence when we attach the attribute name to this, it attaches name to the window object. the ‘this’ has nothing to do with the object Person.
Now, when we use new Object, we create an object on the heap, and this in our function refers to that object. IT IS NOT connected to the (global or window) object anymore
Hence, when we log cody.name, it works because cody is that object in the heap. The this in the function, refers to cody.
We assign name attribute to the object cody.
1 2 3 4 5 6 7 8 9 10 |
var Person = function(name) { this.name = name || 'johndoe'; // this will refer to the instanc ecreated }; var cody = new Person('Cody Lindley'); // create an instance, based on Person constructor console.log(cody.name); // logs 'Cody Lindley' console.log(window.name); //empty //Take note to use global.name if working with node JS. |
Also, take note that the this properties are public because there is no closure. If we create a closure (by creating inner functions), then the properties attached to this will then be private.
Another example:
1 2 3 4 5 6 7 8 9 10 11 12 |
var Person = function(name) { this.name = name || 'johndoe'; //public if no closure, private if closured var m_SSN = '12345678'; //private }; //create an object. the object's this is connected to global var cody = Person('Cody Lindley'); console.log(global.name); //logs Cody Lindley, //notice the new var cody2 = new Person('Cody Lindley'); console.log("name: " + cody2.name); |
http://stackoverflow.com/questions/30314457/how-to-make-function-parameter-constant-in-javascript
It will not prevent modification of the attributes of the object.
For example, this will give you an error because you are trying to reassign the variable car to another object.
1 2 3 4 5 6 7 8 |
const car = { type: "bmw", color: "white" }; car = { }; |
But if you were to change the attribute of the object, it is valid:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
const car = { type: "bmw", color: "white" }; function changeCar(carObj) { if('type' in carObj) { carObj.type = "honda"; } } changeCar(car); |
You’d see honda, white
http://stackoverflow.com/questions/30314457/how-to-make-function-parameter-constant-in-javascript
Another example:
However, bear in mind that const in ES6 notation does not make the variable immutable.
1 |
const a = [1, 2]; a.push(3); |
is a completely valid program and a will become [1, 2, 3]. const will only prevent you from reassigning a, so that you can’t do a = [] or a = {} or whatever once const a = [1, 2]; already defined (in that particular scope).
ref – http://stackoverflow.com/questions/2821509/can-you-use-constant-variables-in-javascript
if you’re looking for a read-only variable, you simulate that with something like
1 2 3 4 |
var constants = new (function() { var x = 20; this.getX = function() { return x; }; })(); |
and then use it like
1 |
constants.getX() |
ref – https://github.com/devdoc/SublimeLinter-jslint
https://www.npmjs.com/package/nodelint
First, make sure you install the jslint npm package
npm install -g jslint
https://packagecontrol.io/installation
In your sublime, View > Console.
Then copy and paste this into the console and press enter:
1 |
import urllib.request,os,hashlib; h = '2915d1851351e5ee549c20394736b442' + '8bc59f460fa1548d1514676163dafc88'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by) |
Then after that, In Sublime,
Tools > Command Palette
type “Install” and type enter.
You will t hen see a menu popup with all the packages.
Look for SublimeLinter-jslint
ref – http://stackoverflow.com/questions/4811738/cron-job-log-how-to-log
http://stackoverflow.com/questions/15395479/why-ive-got-no-crontab-entry-on-os-x-when-using-vim
30 * * * * /Users/rickytsao/Desktop/run_email_to_admin >> /Users/rickytsao/Desktop/chron-log.txt
ref – http://makandracards.com/makandra/1145-how-to-send-http-requests-using-curl
curl http://localhost:6680/results -GET
to send a HTTP request
The following command will get the content of the URL and display it in the STDOUT (i.e on your terminal).
$ curl http://www.centos.org
ryh:Desktop rickytsao$ curl http://www.centos.org
To store the output in a file, you an redirect it as shown below. This will also display some additional download statistics.
$ curl http://www.centos.org > centos-org.html