Sunday, February 01, 2015

Apache Cordova : Create your First Android app (the easy way) + ios/ Windows Phone/Store + Firefox OS

If you have considerable amount of knowledge in developing web based applications using HTML, CSS and Javascript and also very much interested in developing applications across multiple platform such as Android, iOS and Firefox OS, Apache Cordova is just for you. Apache Cordova is a cross platform application developmental framework based on HTML, CSS and JS. In this tutorial, I will be helping you to develop your first cordova app. If you face any challenges in either of the step, please comment.

1.    While learning Javascript, you would have probably come across this cliché “Javascript is a client side scripting language”. Well, you would not be believing this if you have come across Node JS. Node JS is a runtime environment for server side and networking applications. Apache cordova needs Node JS. So, Install Node JS.

2. After Installing Node JS. Set up your Android developer environment. You can either download them as a package or you can install Android as a plugin in your eclipse. Please refer this for reference. Anyway, before starting with step 2, make sure you have Java installed.

3. I hope that you have completed step 1 and 2 without any complications. Node JS installation in Step 1 will also install Node JS command prompt. So search for Node JS command prompt and open it.

4. Once you open node js command prompt enter “npm install –g cordova”. If you face something like “npm command not found”, you have either not installed node js properly or the npm has not been added to the path in the environment variable.

5. If step 4 is completed, you are well set to create your first app. Go to Node JS command prompt and navigate to the directory in which you want to set up your project. Enter “cordova create <name of the project directory> <like package name in java (domain style identifier)> <Application name>”. For example: “cordova create hello com.example.hello HelloWorld”.

6. Enter the newly created directory “cd ”.

7. To view the different platform that you app can be scaled in enter “cordova platform ls”

8. To add a platform enter “cordova platform add android” and to remove a platform “cordova platform remove ios”.

9. Once the platform for the project is ready. Enter “cordova build”. If the build is successful, you are ready with your first android project.

10. To view the application, go into eclipse and import this project from existing application, create an Android virtual device and run the android application.

11. Now inside eclipse, in the project directory in the left, there will be a folder called www where you can develop your application with html, css and javscript.

12. For further documentation and deployment refer here.

One of my apps that I published in Windows Phone store was also built using Cordova.

Note: This article is solely based on my experience during installation process. The content posted is original and not replicated from any external source.

If you want any intermediate step as a separate article (such as how to add the directory path in the environmental variable), please let me know.

Stay tuned for more.

Thursday, January 08, 2015


Adaptive resonance theory or ART is a theory developed by Stephen Grossberg and Gail carpenter. It is based on how brain processes information.  It is generally used in the context of pattern recognition and prediction. Prediction/PR occurs as a result of interaction of top down observers expectations with bottom up sensory information i.e. the information obtained about an entity as detected by your senses is compared with the prototype or memory template of the expectation. If the difference does not exceed a threshold value, the sensed object is considered to be a member of the expected class. Thus it does not affect the plasticity/stability of the existing knowledge.

The primitive ART model is an unsupervised model. It consists of a comparison field and a recognition field composed of neurons, a vigilance parameter (threshold value) and a reset module. The comparison field takes an input vector and transfers it to its best match in recognition field. The best match refers to a single neuron whose weight vectors closely matches the input vector. The other neurons of the recognition field exhibits lateral inhibition by sending out negative signal and as a result the best match neuron is allowed to represent a category to which input vectors are classified.

After the input vector is classified, the reset module compares the strength of the recognition field to the vigilance threshold. If the threshold is overcome, the recognition field neuron is adjusted towards the input vector. Otherwise, if the strength gauged by the reset module is below the threshold, the winning neuron is inhibited and a search procedure is carried out. In this search procedure, the recognition field neurons are inhibited one by one until the vigilance parameter is overcome. If no such neuron of the recognition field overcomes the vigilance parameter, then an uncommitted neuron is committed and its weights are adjusted towards matching the input vector.  The quality of the memory is directly proportional to the vigilance threshold.

Thus, ART is Artificial Neural Network system that must be able to adapt to changing environment and a potential solution for the Plasticity/Stability dilemma.

Stay tuned for more.

Wednesday, December 10, 2014

What is cognitive modeling?

The term Cognition refers to the mental action or process of acquiring knowledge and understanding through thought, experience and the senses. Modeling refers to the process of devising a representation, especially a mathematical one. Collectively, Cognitive modeling deals with simulating problem solving and other mental tasks in a computerized model.  I believe that two important questions would have flashed your mind after reading the definition of cognitive modeling. First: Assuming that it is possible to imitate the task process of human brain, what is the prospective of cognitive modeling from application point of view? Second:  How are the cognitive models represented (i.e. how does it actually work?).

Cognitive modeling is being used in different artificial intelligence application especially neural networks, robotics and virtual reality. It plays a crucial role in the development of futuristic applications which can be programmed in such a way that the application will be capable enough to imitate or rather predict human perception and react correspondingly. It provides support for large scale decision making especially for the marketing and sales sector. Currently, Cognitive models are commonly found in Computer games (making it more interactive and realistic). Example of a system that uses cognitive modelling: an intelligent tutoring system for school children which can gradually increase the retention capacity of a student by analysis and feedback.

Cognitive models are generally represented as mathematical models. Mathematical model refers to a set of equations which takes a set of input to produce the corresponding output. Consider the discrepancy detection application. According to Discrepancy Detection Principle, recollections are more likely to change if a person does not immediately detect discrepancies between misinformation and memory for the original event. At times people recognize a discrepancy between their memory and what they are being told. People might recollect, "I thought I saw a stop sign, but the new information mentions a yield sign, I guess I must be wrong, it was a yield sign." Although the individual recognizes the information as conflicting with their own memories they still adopt it as true. If these discrepancies are not immediately detected they are more likely to be incorporated into memory. To avoid/remove such discrepancies from a statistical data set, a classifier (a set of equations which when provided with the input will be able to classify/identify the inconsistent data points in space) cognitive model.

It is amazing how much can be accomplished using cognitive modeling. It is a hot topic that is under extensive research. We can expect a lot of applications which uses the cognitive model in the near future.

Note: I’m not an expert in Cognitive modeling. The blog article was just an outcome of my passionate interest towards the subject. If you find any corrections, please let me know.

Stay tuned for more.

Tuesday, December 02, 2014

NEAT (Neural Evolution of Augmented topologies)

You would probably be wondering what this blog post is all about. Anyway, I will just jump into the topic. NEAT stands for NeuroEvolution of Augmented topologies. It is a method for evolving artificial neural networks with a genetic algorithm. NEAT implements the idea that is most effective to start evolution with small, simple networks and allow them to become increasingly complex over generations. That way, just as organisms in nature increased in complexity since the first cell, so do neural networks in NEAT. This process of continual elaboration allows finding highly sophisticated and complex neural networks.

So what is so special about NEAT. Ken Stanley (from UTexas Austin) who developed this algorithm (in 2002) claims that NEAT outperforms fixed topology method primarily for three reasons.
1.       Employing a principled method of crossover of different topologies
2.       Protecting structural innovation through speciation (formation of new and distinct species in the course of evolution)
3.       Incrementally growing from minimal structure

In traditional Neural Evolution approaches, a topology is chosen for the evolving network before the experiment begins. Usually, the network topology is a single hidden layer of neurons connected to every network input and every network output. Evolution searches the space of connection weights of this fully, connected topology by high-performing network to reproduce. The weight space is explored through crossover of network weight vectors and through the mutation (the process of mutating/alteration) of single networks’ weights. Thus, the goal of Neuro evolution is to optimize the connection weights that determine the functionality of a network.

Many systems have been developed over the last decade to evolve both neural network topologies and weights. These methods encompass a range of ideas about how Topology and Weight Evolving Artificial Neural Networks (TWEANNs) should be implemented. NEAT focused on how a neuro evolution method can use the evolution of topology to increase its efficiency. In TWEANNs, innovation takes place by adding new structure to networks through mutation. Protecting this innovation is achieved through the GNARL system (adding a node to the genome without any connections) by adding non-functional structure. NEAT uses explicit fitness sharing which forces individuals with similar genomes to share their fitness payoff.

The two types of structural mutation in NEAT. Both types, adding a connection and adding a node, are illustrated with the connection genes of a network above their phenotypes. The top number in each genome is the innovation number of that gene. The innovation numbers are historical markers that identify the original historical ancestor of each gene. New genes are assigned new increasingly higher numbers. In adding a connection, a single new connection gene is added to the end of the genome and given the next available innovation number. In adding a new node, the connection gene being split is disabled, and two new connection genes are added to the end the genome. The new node is between the two new connections. A new node gene representing this new node is added to the genome as well. Matching up genomes for different network topologies using innovation numbers. Although Parent 1 and Parent 2 look different, their innovation numbers (at the top of each gene) tell us which genes match up with which. Even without any topological analysis, a new structure that combines the overlapping parts of the two parents as well as their different parts can be created. Matching genes are inherited randomly, whereas disjoint genes (those that do not match in the middle) and excess genes (those that do not match in the end) are inherited from the more fit parent. In this case, equal fitnesses are assumed, so the disjoint and excess genes are also inherited randomly. The disabled genes may become enabled again in future generations: there’s a preset chance that an inherited gene is disabled if it is disabled in either parent.

NEAT biases the search towards minimal-dimensional spaces by starting out with a uniform population of networks with zero hidden nodes (i.e., all inputs connect directly to outputs). New structure is introduced incrementally as structural mutations occur, and only those structures survive that are found to be useful through fitness evaluations. In other words, the structural elaborations that occur in NEAT are always justified. Since the population starts minimally, the dimensionality of the search space is minimized, and NEAT is always searching through fewer dimensions than other TWEANNs and fixed-topology NE systems.

The main conclusion is that NEAT is a powerful method for artificially evolving neural networks. NEAT demonstrates that evolving topology along with weights can be made a major advantage.
There are various sources in the internet where you can find information about NEAT.

Stay tuned to the blog for more.

Wednesday, August 13, 2014

Wi-Fi Direct

Bluetooth has been the popular wireless technology standard for some time now and still trending. The numbers of Bluetooth supported devices have scaled up rapidly over the past few years. It has been designed specifically for exchanging data over short distance (say 10m). Technically speaking, it makes use of Ultra High Frequency radio waves in the band (2.4-2.5 GHz) to create a Personal Area network (PAN) to share data over the network. The latest version is Bluetooth v4.0 which supports data transfer rate up-to 24Mbit/s. The pace of the contemporary society demands/encourage increase in data transfer rate. This demand in turn led to the advent of Wi-Fi Direct.

Although you may have a perceptive definition in mind about the definition of Wi-Fi, I would like to define it again, just to maintain the logical flow of this post. Wi-Fi refers to a facility allowing computers, smartphones, or other devices to connect to the Internet within a particular area bounded by the range of the wireless access point. The bandwidth rate may depend on the nature of the access point. Wi-Fi direct is a Wi-Fi standard that can function like a Bluetooth (i.e. without a wireless access point (P2P)) but with Wi-Fi speeds. So as you can imagine, it is possible to transfer a bigger chunk of data much faster without any hassle.

In addition, to share a data from one device to another, only one of the Wi-Fi devices need to be complaint with Wi-Fi Direct to establish a peer to peer connection. This usability makes it interoperable with the Wi-Fi enabled devices in the current market.

The basic idea behind Wi-Fi Direct is that simple tasks need simple connections with multiple devices. It makes use of Wi-Fi protected setup thus preventing unauthorized connections. In addition, it also has a special kind of device discovery mechanism where you will be able to identify what kinds of devices are available. For example: if you're trying to display an image, you'll only see devices that you can beam images to; if you want to print, you'll only see devices that are or that are connected to printers.

Thursday, May 22, 2014

GNU (GNU's Not Unix!)

GNU is a unix like operating system developed by the GNU Project. This project was initiated by Richard Stallman at MIT on 27th September 1983. It is a free software mass collaboration project aimed at giving the computer users freedom and control by developing and providing 100% free software. Some of the GNU packages that form an integral part of a basic system include GNU Compiler Collection (GCC), the GNU C Library (glibc), GNU Core and binary utilities (coreutils/binutils) and bash shell. The number of contributors for this project have increased over the years and strongly supported by Free Software Foundation.

If you have a fair knowledge about computer operating systems, you would have heard the word “Linux” or “Ubuntu”. All these are name of Operating systems under GNU project.  Operating system refers to a collection of software that stands as a medium between the application and the underlying computer hardware.  Microsoft 98, Microsoft XP, Windows Vista, 7, 8, Mac OS are all examples of Operating systems. The core part of an operating system is the kernel. Kernel is a computer program that manages input/output requests from software and translates them into data processing instructions.

Ubuntu is a debian based linux operating system with a GNOME interface. GNOME project comes under GNU and is related to the programs for desktop environments. Debian is an operating system that can either use linux kernel, the FreeBSD kernel, GNU Hurd Kernel or GNU Mach microkernel. Ubuntu is aone of the most popular debian system.

There are different ways to contribute to this GNU project. If you want to release your own software under GNU Project you can use GNU Public license V2 or V3 in order to support the cause of this project. The goal was to bring a wholly free software operating system into existence. Stallman wanted computer users to be "free", as most were in the 1960s and 1970s – free to study the source code of the software they use, free to share the software with other people, free to modify the behavior of the software, and free to publish their modified versions of the software.

The logo for GNU is a gnu head (antelope). It appears in GNU software and in printed and electronic documentation for the GNU Project, and is also used in Free Software Foundation materials.

Please feel free to comment.

Stay tuned for more.

Friday, May 09, 2014

How to develop new app ideas

At present, the pace of technology has enabled us to create any type of application even beyond our imagination. Perception computing is one such topic. Most of you would have seen games  where you use gestures (say wave your hand and the system interacts with you) . Developing such game have always been a dream for every developer out there. But  right now it is possible for you to develop such games (or applications) on your own. All that stands between development and your application is your app idea. A brilliant app idea can make you very popular and if lucky will turn out as your career. So in this post i have put forth some of my ideas to think or develop your own app idea.

1. Look around. Look for things that may make your life better. For example: A driver-less car (BTW Google has been working on it..It was just an example).
2. Look for things that can make other live better For example: An application to report garbage dumps to help the corporation in clearing it faster.
3. Something that already exists but needs improvement. For example: A shopping app where the users can view the products as holograms (so that they can know the proper size of that product)
4. A feature that can be applied for a different problem at hand (for example: recently there was an alarm app which made use of gyro sensor that doesn't  snooze until you shake it hard)
5. Something related to your school or college (for example: the announcements in your college as an android app..I'm damn sure you will be quite popular if you come up with something like that )
6. Something for the children or elderly (The applications have been scaled across different age groups and the usability also differs. So an application that can help them would be really considered as a good application )
7. Games (This is quite competitive and dangerous because everyone wants to create a game!!. However if you can create games that you invented, it may turn out to be popular (for example: flow free game is a simple but popular game in android market ))
8. On demand applications  for example: 9 out of 10 people i meet today wants to be on diet..so such demand based apps can be your next app idea.
9.  Simpler. yet more simpler. Some applications you have seen may exist either in one platform or does not have a mobile version (For example: some companies wants to build their android apps but will not have developers at its disposal. You talk to them and may be you can end up doing an intern with them)
10. Passion. Its your passion. Some people are gifted with talents. One of my friend is a crazy foodie. He knows A-Z every food outlet near my place. COOL!!. Why not share it with the world??.

I have run out of ideas and hope that your app idea falls in either of these category. If you want to add any other ideas about ideas :P just drop a comment.

Stay tuned for more...