Thursday, November 20, 2014

iOS praktikum swift


Using delegates
http://makeapppie.com/2014/07/01/swift-swift-using-segues-and-delegates-in-navigation-controllers-part-1-the-template/

To traverse back to previous page after button click
eg.
controller.navigationController?.popViewControllerAnimated(true)

How to open safari browser using swift
https://www.reddit.com/r/swift/comments/27o9s9/ios_open_webpage/

   let url = NSURL(string: "http://www.apple.com/")

        let status = UIApplication.sharedApplication().openURL(url)

        println("Browser status: \(status)")

implementing CoreLocation for GPS services using swift
http://rshankar.com/get-your-current-address-in-swift/ Javascript datetime picker
http://www.jqueryrain.com/demo/jquery-date-time-picker/
http://bikasv.com/blog/2013/04/14/cordova-datepicker/
http://blog.teamtreehouse.com/best-jquery-date-picker-plugins-for-input-fields
http://www.jqueryrain.com/demo/jquery-date-time-picker/
http://api.jqueryui.com/datepicker/#entry-examples

Useful links for plant quiz game image
 plant game links
http://bestpaperz.com/ct/8837948-flower-nature.html

http://background-pictures.picphotos.net/net-download-full-version-3d-camera-v1-516-android-apps-games-download/2/

http://wall.alphacoders.com/by_sub_category.php?id=168658

http://wall.alphacoders.com/search.php?search=leaf

http://www.freepik.com/free-photo/aqua-buttons_620479.htm

iphone screen resolution
http://www.iphoneresolution.com/
http://www.paintcodeapp.com/news/ultimate-guide-to-iphone-resolutions

iOS storyboard tutuorials
https://www.youtube.com/watch?v=ztIBNHOm35E

https://www.youtube.com/watch?v=E3glNbNnokw

Editor for changing image color of png
http://www165.lunapic.com/editor/ 


Embeding font in spritekit
http://blog.chucksanimeshrine.com/2014/10/how-to-add-glyphdesigner-custom-bitmap.html#.VIA_dmTF_xg

First of all I'm assuming that SpriteKit doesn't make any difference.
  1. You need your font in .otf or .ttf copied to your project. For example in Supporting Files.
  2. You need to edit .plist file. Add "Fonts provided by application" key into your plist and in Item 0 copy the exact filename of the font you copied to your Supporting files WITH extension. For example: "JosefinSansStd-Light_0.otf"
  3. Make sure that the font you imported to your app is being packed into app itself. Do that by selecting your Target, then Build Phases, then Copy Bundle Resources. If you don't see your font in there, drag it from Supporting Files.
How to navigate back to multiple storyboard screens ? (Use unwind segue)
http://stackoverflow.com/questions/12561735/what-are-unwind-segues-for-and-how-do-you-use-them

Localization 
http://rshankar.com/internationalization-and-localization-of-apps-in-xcode-6-and-swift/
http://www.appcoda.com/localization-tutorial-ios8/
http://www.appcoda.com/ios-programming-tutorial-localization-apps/

Test colorblindness of image
http://www.color-blindness.com/coblis-color-blindness-simulator/


ios colors code
http://ios7colors.com/

Sunday, November 16, 2014

What is aliasing in java?

http://www.ibm.com/developerworks/library/j-jtp06243/

Aliases, also known as ...

A primary contributor to the complexity of memory management is aliasing: having more than one copy of a pointer or reference to the same block of memory or object. Aliases occur naturally all the time. For example, in Listing 1 there are at least four references to the Something object created on the first line of makeSomething:
  • The something reference
  • At least one reference held within collection c1
  • The temporary aSomething reference created when something is passed as an argument to registerSomething
  • At least one reference held within collection c2
Listing 1. Aliases in typical code
    Collection c1, c2;
    
    public void makeSomething {
        Something something = new Something();
        c1.add(something);
        registerSomething(something);
    }

    private void registerSomething(Something aSomething) {
        c2.add(aSomething);
    }
There are two major memory-management hazards to avoid in non-garbage-collected languages: memory leaks and dangling pointers. To prevent memory leaks, you must ensure that each allocated object is eventually deleted. To avoid dangling pointers (the dangerous situation where a block of memory is freed but a pointer still references it), you must delete the object only after the last reference is released. The mental and digital bookkeeping required to satisfy these two constraints can be significant.


From which point GC in java starts collecting garbage?
    Automatic garbage collection is the process of looking at heap memory, identifying which objects are in use and which are not, and deleting the unused objects. An in use object, or a referenced object, means that some part of your program still maintains a pointer to that object. An unused object, or unreferenced object, is no longer referenced by any part of your program. So the memory used by an unreferenced object can be reclaimed.
    In a programming language like C, allocating and deallocating memory is a manual process. In Java, process of deallocating memory is handled automatically by the garbage collector. The basic process can be described as follows.