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 – http://blog.akquinet.de/2013/03/28/clean-objective-c-private-methods-in-objective-c/ http://www.friday.com/bbum/2009/09/11/class-extensions-explained/ 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

https://www.codementor.io/ios/tutorial/ios-interview-tips-questions-answers-objective-c http://stackoverflow.com/questions/7058858/should-i-use-nsuserdefaults-or-a-plist-to-store-data http://stackoverflow.com/questions/24033148/deciding-to-use-core-data-or-nsuserdefaults http://stackoverflow.com/questions/6173625/what-are-the-limitations-of-nsuserdefaults?rq=1 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 – https://dzone.com/articles/upload-files-or-images-to-server-using-nodejs 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

https://javascript.info/prototype-inheritance Prototype, function, and New https://scotch.io/tutorials/better-javascript-with-es6-pt-ii-a-deep-dive-into-classes

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” })