Thursday, May 29, 2014

IP V6 addressing

http://ipv6.com/articles/general/IPv6-Addressing.htm

Why we need IPv6 Addressing

An escalating demand for IP addresses acted as the driving force behind the development of the large address space offered by the IPv6. According to industry estimates, in the wireless domain, more than a billion mobile phones, Personal Digital Assistants (PDA), and other wireless devices will require Internet access, and each will need its own unique IP address.

The extended address length offered by IPv6 eliminates the need to use techniques such as network address translation to avoid running out of the available address space. IPv6 contains addressing and control information to route packets for the next generation Internet.

Types of IPv6 Addresses

IPv6 addresses are broadly classified into three categories:

1) Unicast addresses A Unicast address acts as an identifier for a single interface. An IPv6 packet sent to a Unicast address is delivered to the interface identified by that address.

2) Multicast addresses A Multicast address acts as an identifier for a group/set of interfaces that may belong to the different nodes. An IPv6 packet delivered to a Multicast address is delivered to the multiple interfaces.

3) Anycast addresses Anycast addresses act as identifiers for a set of interfaces that may belong to the different nodes. An IPv6 packet destined for an Anycast address is delivered to one of the interfaces identified by the address.

IPv6 Address Notation

IPv6 addresses are denoted by eight groups of hexadecimal quartets separated by colons in between them.

Following is an example of a valid IPv6 address: 2001:cdba:0000:0000:0000:0000:3257:9652

Any four-digit group of zeroes within an IPv6 address may be reduced to a single zero or altogether omitted. Therefore, the following IPv6 addresses are similar and equally valid:

2001:cdba:0000:0000:0000:0000:3257:9652
2001:cdba:0:0:0:0:3257:9652
2001:cdba::3257:9652

The URL for the above address will be of the form:

http://[2001:cdba:0000:0000:0000:0000:3257:9652]/

Network Notation in IPv6

The IPv6 networks are denoted by Classless Inter Domain Routing (CIDR) notation. A network or subnet using the IPv6 protocol is denoted as a contiguous group of IPv6 addresses whose size must be a power of two. The initial bits of an IPv6 address (these are identical for all hosts in a network) form the network s prefix. The size of bits in a network prefix are separated with a / . For example, 2001:cdba:9abc:5678::/64 denotes the network address 2001:cdba:9abc:5678. This network comprises of addresses rearranging from 2001:cdba:9abc:5678:: up to 2001:cdba:9abc:5678:ffff:ffff:ffff:ffff. In a similar fashion, a single host may be denoted as a network with a 128-bit prefix. In this way, IPv6 allows a network to comprise of a single host and above.

Special Addresses in IPv6

 ::/96 The zero prefix denotes addresses that are compatible with the previously used IPv4 protocol.
 ::/128 An IPv6 address with all zeroes in it is referred to as an unspecified address and is used for addressing purposes within a software.
 ::1/128 This is called the loop back address and is used to refer to the local host. An application sending a packet to this address will get the packet back after it is looped back by the IPv6 stack. The local host address in the IPv4 was 127.0.0.1 .
 2001:db8::/32 This is a documentation prefix allowed in the IPv6. All the examples of IPv6 addresses should ideally use this prefix to indicate that it is an example.
 fec0::/10 This is a site-local prefix offered by IPv6. This address prefix signifies that the address is valid only within the local organization. Subsequently, the usage of this prefix has been discouraged by the RFC.
 fc00::/7 This is called the Unique Local Address (ULA). These addresses are routed only within a set of cooperating sites. These were introduced in the IPv6 to replace the site-local addresses. These addresses also provide a 40-bit pseudorandom number that reduces the risk of address conflicts.
 ff00::/8 This prefix is offered by IPv6 to denote the multicast addresses. Any address carrying this prefix is automatically understood to be a multicast address.
 fe80::/10 This is a link-local prefix offered by IPv6. This address prefix signifies that the address is valid only in the local physical link.

Reference: Please see RFC 1884 - IP Version 6 Addressing Architecture for more information. 

Monday, May 26, 2014

Church of light

Gestures in android devices

http://developer.android.com/design/patterns/gestures.html

Gestures

Gestures allow users to interact with your app by manipulating the screen objects you provide. The following table shows the core gesture set that is supported in Android.

Touch

Triggers the default functionality for a given item.
  • Action

    Press, lift

Long press

Enters data selection mode. Allows you to select one or more items in a view and act upon the data using a contextual action bar. Avoid using long press for showing contextual menus.
  • Action

    Press, wait, lift

Swipe or drag

Scrolls overflowing content, or navigates between views in the same hierarchy. Swipes are quick and affect the screen even after the finger is picked up. Drags are slower and more precise, and the screen stops responding when the finger is picked up.
  • Action

    Press, move, lift

Long press drag

Rearranges data within a view, or moves data into a container (e.g. folders on Home Screen).
  • Action

    Long press, move, lift

Double touch

Scales up a standard amount around the target with each repeated gesture until reaching maximum scale. For nested views, scales up the smallest targetable view, or returns it to its original scale. Also used as a secondary gesture for text selection.
  • Action

    Two touches in quick succession

Double touch drag

Scales content by pushing away or pulling closer, centered around gesture.
  • Action

    A single touch followed in quick succession by a drag up or down:
    • Dragging up decreases content scale
    • Dragging down increases content scale
    • Reversing drag direction reverses scaling.

Pinch open

Zooms into content.
  • Action

    2-finger press, move outwards, lift

Pinch close

Zooms out of content.
  • Action

    2-finger press, move inwards, lift

touch events in cordova

http://askubuntu.com/questions/428342/get-emulate-touch-event-in-cordova-app
http://www.w3.org/TR/touch-events/#changedtouches-of-a-touchevent
https://software.intel.com/en-us/html5/articles/touch-drawing-app-using-html5-canvas

http://stackoverflow.com/questions/16645448/what-events-are-supported-by-phonegap-cordova-besides-the-ones-listed-in-the-api

http://phonegap-tips.com/
http://www.netcu.de/templates/netcu/js/jquery.touchwipe.1.1.1.js

google developers
http://commondatastorage.googleapis.com/io-2013/presentations/222%20-%20Point,%20Click,%20Tap,%20Touch%20-%20Building%20Multi-Device%20Web%20Interfaces%20(I_O%202013).pdf


Problems with touchmove events
http://stackoverflow.com/questions/11204460/the-touchmove-event-on-android-system-transformer-prime

/**
 * jQuery Plugin to obtain touch gestures from iPhone, iPod Touch and iPad, should also work with Android mobile phones (not tested yet!)
 * Common usage: wipe images (left and right to show the previous or next image)
 * 
 * @author Andreas Waltl, netCU Internetagentur (http://www.netcu.de)
 * @version 1.1.1 (9th December 2010) - fix bug (older IE's had problems)
 * @version 1.1 (1st September 2010) - support wipe up and wipe down
 * @version 1.0 (15th July 2010)
 */
(function($) { 
   $.fn.touchwipe = function(settings) {
     var config = {
      min_move_x: 20,
      min_move_y: 20,
    wipeLeft: function() { },
    wipeRight: function() { },
    wipeUp: function() { },
    wipeDown: function() { },
   preventDefaultEvents: true
  };
     
     if (settings) $.extend(config, settings);
 
     this.each(function() {
      var startX;
      var startY;
   var isMoving = false;

      function cancelTouch() {
       this.removeEventListener('touchmove', onTouchMove);
       startX = null;
       isMoving = false;
      } 
      
      function onTouchMove(e) {
       if(config.preventDefaultEvents) {
        e.preventDefault();
       }
       if(isMoving) {
        var x = e.touches[0].pageX;
        var y = e.touches[0].pageY;
        var dx = startX - x;
        var dy = startY - y;
        if(Math.abs(dx) >= config.min_move_x) {
        cancelTouch();
        if(dx > 0) {
         config.wipeLeft();
        }
        else {
         config.wipeRight();
        }
        }
        else if(Math.abs(dy) >= config.min_move_y) {
         cancelTouch();
         if(dy > 0) {
          config.wipeDown();
         }
         else {
          config.wipeUp();
         }
         }
       }
      }
      
      function onTouchStart(e)
      {
       if (e.touches.length == 1) {
        startX = e.touches[0].pageX;
        startY = e.touches[0].pageY;
        isMoving = true;
        this.addEventListener('touchmove', onTouchMove, false);
       }
      }      
      if ('ontouchstart' in document.documentElement) {
       this.addEventListener('touchstart', onTouchStart, false);
      }
     });
 
     return this;
   };
 
 })(jQuery);

Friday, May 16, 2014

android shared preferences to store auth token

3D graphics

http://www.hongkiat.com/blog/25-free-3d-modelling-applications-you-should-not-miss/

http://www.opentk.com/doc/links/tools

http://www.opengl.org/resources/libraries/windowtoolkits/

Windows form with GL control
http://www.opentk.com/doc/chapter/2/glcontrol




















Bbusiness Models canvas

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

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

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

https://www.youtube.com/watch?v=5sn7pZXY5b4

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

Computer networking info.

http://www.tecmint.com/ifconfig-command-examples/

http://www.tecmint.com/20-netstat-commands-for-linux-network-management/

Telnet
Start telnet
  • sudo service xinetd restart       'OR'
  • sudo /etc/init.d/xinetd restart

xinetd

In computer networkingxinetd (extended Internet daemon) is an open-source super-server daemon which runs on many Unix-like systems and manages Internet-based connectivity. It offers a more secure extension to or version of inetd, the Internet daemon, thus most modern Linux distributions have switched to it.[1]


Description[edit]

xinetd listens for incoming requests over a network and launches the appropriate service for that request.[2] Requests are made using port numbers as identifiers and xinetd usually launches another daemon to handle the request. It can be used to start services with both privileged and non-privileged port numbers.
xinetd features access control mechanisms such as TCP Wrapper ACLs, extensive logging capabilities, and the ability to make services available based on time. It can place limits on the number of servers that the system can start, and has deployable defense mechanisms to protect against port scanners, among other things.
On some implementations of Mac OS X, this daemon starts and maintains various Internet-related services, including FTP and telnet. As an extended form of inetd, it offers enhanced security. It replaced inetd in Mac OS X v10.3, and subsequently launchd replaced it in Mac OS X v10.4. However, Apple has retained inetd for compatibility purposes.

super-server or sometimes called a service dispatcher is a type of daemon run generally on Unix-like systems.
======================================

Daemon (computing)


In multitasking computer operating systems, a daemon (/ˈdmən/ or /ˈdmən/)[1] is a computer program that runs as a background process, rather than being under the direct control of an interactive user. Traditionally daemon names end with the letter d: for example, syslogd is the daemon that implements the system logging facility and sshd is a daemon that services incoming SSH connections.
In a Unix environment, the parent process of a daemon is often, but not always, the init process. A daemon is usually created by a process forking a child process and then immediately exiting, thus causing init to adopt the child process. In addition, a daemon, or the operating system, typically must perform other operations, such as dissociating the process from any controlling terminal (tty). Such procedures are often implemented in various convenience routines such as daemon(3) in Unix.
Systems often start daemons at boot time and serve the function of responding to network requests, hardware activity, or other programs by performing some task. Daemons can also configure hardware (like udevdon some GNU/Linux systems), run scheduled tasks (like cron), and perform a variety of other tasks.


Networking concepts

http://www.youtube.com/watch?v=EkNq4TrHP_U
-------------
tcpdump -i eth0 -nn -c 10 tcp and host 192.168.57.176
tcpdump -D , shows network interfaces available for capture
-------------

  • etc/hosts file
     http://lifehacker.com/5817447/how-to-block-unwanted-ads-in-all-applications-and-speed-up-web-browsing-with-the-hosts-file
http://h30499.www3.hp.com/t5/System-Administration/large-etc-hosts-file-performance-issues/td-p/4996840#.U1wHgvmSzIY

-------------------------
http://superuser.com/questions/744219/interpretation-of-the-unix-command-ip-address

eth-man: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    inet 192.168.6.4/24 brd 192.168.6.255 scope global eth-man
       valid_lft forever preferred_lft forever
    inet6 xxxx::xxxx:xxxx:xxxx:xxxx/64 scope link 
       valid_lft forever preferred_lft forever

-----------------------------

Cinema 4d Render tube tutorials

play framework

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

Android zip align apk for fast and smooth execution

http://www.addictivetips.com/mobile/what-is-zipalign-in-android-and-how-it-works-complete-guide/

What Is Zipalign In Android And How To Make Apps Zipaligned [Complete Guide]

If you’re a hardcore Android fan, chances are strong that you’d be eagerly trying out new themes, custom ROMs and all such mods for your device. One of the main confusion points is the terminology associated with these mods – something quite familiar to the developers, but not to much to the novice user. Two of the most commonly-occurring words in custom ROMs and themes are ‘deodexed’ and ‘zipalign’. A few days back, we covered ‘deodexed’ in detail. In this article, we’ll explore what zipalign means and how APKs can be zipaligned.
WHAT IS ZIPALIGN?
zipalign is an archive alignment tool introduced first time with 1.6 Android SDK (software development kit). It optimizes the way an Android application package (APK) is packaged. Doing so enables the Android operating system to interact with the application more efficiently, and hence has the potential to make the application and overall the whole system much faster. Execution time is minimized for zipaligned applications, resulting is lesser amount of RAM consumption when running the APK.
SO HOW DOES IT EXACTLY WORK?
In an Android operating environment, data files stored in each application package are accessed by multiple processes, for example, the installer will read the data manifest to determine the associated permissions; the system server can read these resources for multiple reasons, like displaying notifications; the Home application, for example, will read resources to get the application’s name and icon. Since Android is based on a a true multi-tasking operating infrastructure, these files are continually and repeatedly accessed. Finally, but not least, the application itself reads the manifest data.
As Android is Linux-based, memory-mapping plays a key role in efficient handling of processes. Essentially, the optimal alignment for the Android OS’ resource-handling code is 4-byte boundaries. What this means is that, if APKs are memory-mapped to 4-byte boundaries, and aligned accordingly, the OS will not need to ‘read through’ the whole application package to get to the desired data manifest. Every system process will know in advance where to look for it’s desired resources, and hence will execute much smoother and faster.
Summing it up, zipaligning an APK results in all uncompressed data within the package to be aligned on 4-byte boundaries, allowing all portions to be accessed directly with the memory-map. RAM consumption is lowered while execution because the querying code doesn’t have to read through the entire application package.
DISADVANTAGES OF UNALIGNED APKs

Quite understandably, situation would be reserved for unaligned application packages. Resource reading would be slow and memory usage would be on the higher end of the spectrum. It would also depend on how many unaligned applications are present. For example, if less number of applications with an unaligned home application, you’d see slower application launch times. This is the best case scenario. For a worst case scenario, having a number of unaligned applications will result in the system repeatedly starting and killing processes, struggling with lags and huge battery drain.
HOW DO YOU DO IT, THEN?
As mentioned earlier, the zipalign tool became a part of Android SDK from 1.6 onwards. It can be found under the ‘tools’ folder of the SDK. To use it, simply run the command:
zipalign [-f] [-v] <alignment> infile.apk outfile.apk
where infile.apk is the source file, and outfile.apk is the output file.
Furthermore, you can also verify the alignment of an APK file using the following command:
zipalign -c -v <alignment> existing.apk
where existing.apk can be any application package that you need to get verified. Also, the <alignment>tag in both the commands needs to be an integral value (otherwise the command will return invalid). This value, although can be any integer, MUST always be 4, which would provide 32-bit alignment. Any other value and it will effectively do nothing.
Finally, for the flags used in these commands,
  • -f : overwrites existing outfile.zip
  • -v : will give verbose output
  • -c : will confirm the alignment of a given file
WORD OF CAUTION: zipalign operation must only be performed after you have signed the APK file with your private key. If zipaligned before signing, the signing procedure will disturb the alignment. Same holds true for any other alteration, addition or removal to the APK file. Any change after running zipalign will undo the alignment.