Javascript Functions, scoping, and changing context

Since no inner function is declared, this function object is bound to the global scope.

In the above code: global scope has one variable globalVariable. However in globalFunction function object, notice notice we have a inner function, and thus, each function’s this scope is bound to itself. the inner function cannot read the […]

mongo dump

Say you want to do a dump of your mongo database onto your desktop. You’d go: mongodump -d DumpFolderName -o /location/of/your/directory Once it makes a dump, you’ll see the DumpFolderName folder with various files in there. It contains the data of your database. When you want to make the restore, copy the DumpFolderName to that […]

Private methods in Objective C are semi private

ref – A word about usage When implementing a class, it is common to have a set of methods that only appear in the class’s @implementation. Often, they are spread around the @implementation and generally appear just above whatever method first uses the private method (if they were to appear below, the compiler […]

iOS interview questions NSUserDefaults (store only user settings) NSUserDefaults is really meant for storing small pieces of data such as settings, preferences, and individual values. It’s pretty fast and easy to do, though it’s supposed to store only user settings. To write them to the userdefaults:

To read the from the userdefaults:


Sending file from html to node server (multer)

node server download ref – client side Server side – index.js Make sure you create the folder Images at the the directory your index.js is at.

However, our solution always jumps to another page. In order to do it without any jump, we do it without a form non-form way First, we create […]

Javascript Prototype Prototype, function, and New

When you call a function with new, four things happen under the hood: A new object gets created (let’s call it O) O gets linked to another object, called its prototype The function’s this value is set to refer to O The function implicitly returns O We can […]

setting JAVA environment variable

Windows 8 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 […]

APN server notes

To insert device db.deviceCollection.insert({ “device_id” : “f0bafec6 be2a9e1a c31c9cb0 8c6589df 0bc1a7c4 ac9d7767 e63b7656 07c62145”, “bundle_id” : “com.rtsao.localapn”, “description” : “yes” })