Copying and placing folders

http://askubuntu.com/questions/86822/how-can-i-copy-the-contents-of-a-folder-to-another-folder-in-a-different-directo For local paths:

For full paths:

Objc/c++: Can local variable be accessed outside of its scope

http://stackoverflow.com/questions/6441218/can-a-local-variables-memory-be-accessed-outside-its-scope If you push a local variable onto the stack, and return its address. Then in the parent scope, you have a pointer point to the return address. After the function completes, you dereference the pointer. The result is unstable. …and really depends on whether the system decides to leave your space alone, or have […]

Javascript garbage collection and memory

http://stackoverflow.com/questions/31698747/does-the-js-garbage-collector-clear-stack-memory/31701771#31701771 http://stackoverflow.com/questions/31230245/memory-allocation-using-new-in-javascript/31230543#31230543 As a programmer, in JavaScript you do not have control over stack or heap allocation. You create objects or primitives that are located somewhere in the memory. Internally JS engines (such as V8 or Spidermonkey) perform all kinds of optimizations. Generally you can think of everything as if it’s stored on heap. To […]

Mark and Sweep algorithm for GC

http://www.cnblogs.com/tekkaman/archive/2012/07/05/2578131.html http://stackoverflow.com/questions/24799297/circular-reference-memory-leak/24963376#24963376 This algorithm reduces the definition of “an object is not needed anymore” to “an object is unreachable”.   This algorithm assumes the knowledge of a set of objects called roots Periodically, the garbage-collector will start from these roots, find all objects that are referenced from these roots, then all objects referenced from these, etc. […]

Handoff from  Watch to iOS app

download source On the Watch side, in a button click responder, we call updateUserActivity method, which is a way to hand off data that the user is currently working on. This method is part of WKInterfaceController.h. InterfaceController.m

Notice the string key com.rtsao.handoff. You need to go to your project folder’s Info.plist, add NSUserActivityTypes as […]

Adding LumberJack via source code to your project

ref – http://code.tutsplus.com/tutorials/cocoalumberjack-logging-on-steroids–mobile-15287 Go to CocoaLumberJack’s site and download their source code here Unzip the LumberJack project and take a look at the LumberJack class folder’s source files. Import LumberJack’s Source files Start a new xCode project. Drag the listed files: DDLog.h/.m DDASLLogger.h/.m DDTTYLogger.h/.m DDFileLogger.h/.m DDLegacyMacros.h DDLegacyMacros.h from the LumberJack project’s class folder, and into […]

Adding colors to xCode debug console

download the project from here 1) Open the XcodeColors project with Xcode 2) select the XcodeColors Plugs in your target. Then compile and build it. When you do this, the Xcode plugin is automatically copied to the proper location. This is done via the build settings. Validate by opening up Finder. While the window is […]