All posts by kenithaiyappa

Be A weirdo – Dare to be different !!

Have you ever felt that you don’t belong in your workplace ? Or those things are just not how they should be? Or how you find it difficult to blend in? Here I am to remind you that you were never meant to blend in but to stand out.

The Universe created all of us unique with our unique gene structures and unique fingerprints and unique personalities. Because it wanted all of us to be special, to be different, to….

…Think Different….

A lot of our times our younger days is spent in going to school, learning what other people have discovered, what our teachers want us to learn, what our parents want us to do, what our society and culture expects out of us. But we spend very little time discovering really who we are, what do we love, what makes us happy. So as you grow older and experience life, try to learn about yourself as much as possible – your strengths, your weaknesses, your desires, your passions and your goals. Don’t do anything just for the sake of doing it or for the sake of financial security but do it to really fulfil your own aspirations. Be brutally honest with yourself. Take your weaknesses and find complimentary strengths. Do it with absolute honesty. You can cheat the whole world but not yourself.

…You can choose to be a king, or just one of the legions

Don’t hide your passions. They’re the key to doing awesome shit. Weirdness is good. It sets us apart and allows us to be wholly different from the rest of the world, while still being innately the same. Humans tend to forget that what makes us weird are the things we are passionate about, and the levels that passion can reach.

People learn to do things by imitation. It’s the surest way to improve your technique and learn the ropes of anything. But the problem with this is that we learn who to be, too. And we learn not to be ourselves. We look at the successful people, the ones who played by the rules and we start to cut out the parts of our lives that don’t match.

When you were a kid, it wasn’t like that. When you were a kid, you let your freak flag fly. You did all crazy stuff which made you happy. But when you grow up, you learn to put that side away, to find somewhere to lock it up so you can forget it was ever there. We all go through this. Our passions just stop being important to us.

When you can approach a problem or a challenge from your own individual and singular viewpoint, using your innate weirdness and the personality that sets you apart from anyone else in the world who cannot live inside your head, you’ll reach creativity.
When you attempt to run in sync with what you see as the mainstream, with the worker in the cubicle next to you who always says and does the right thing — rather than the raw thing — you’ll never be able to embrace that creativity.

The best solutions, ideas, products, they don’t come from conventional thinking. They come from a creative twist that only a totally passionate weirdo could have come up with. If you stamp it down, you’ll be suppressing any chance you might have had to be remarkable.

When you’re not trying to hide away the real version of yourself, that’s when you find a way to reach out and connect with other human beings. I’m a huge fan of letting it all out there. Allowing the world to see the real person inhabiting your skin, rather than the image that you want to project. Everything I do is playing out a different part of my personality. But every part is always based on something genuine, something that comes from me. I had so many different personas that I could pick and choose between them for whatever situation I was facing. But in every one of them, I was connected with who I really was. And that’s authenticity.

The people you truly look up to are fully aware of their passions. This is a fact. They could be entrepreneurs and founders, or comic book artists, or speed metal musicians — there is a passionate weirdo behind everything that is creative. If they weren’t, the world would be missing a lot of colour.

You might think that your passions are going to set you too much apart, put up a barrier between you and other people. Generally, that’s not always the case. People will probably find your passion interesting. They will want to learn more. Nobody really gives a shit if you’re in your late 30’s and still play Pokemon. They might not totally get it, but it won’t stop them from respecting you professionally or wanting to associate with you.

Take chances. Embrace what you love. Life is too short to waste while you lock yourself away and pretend your past and your passions never existed. So get out there. And be a weirdo.

Lions don’t hunt in packs, Eagles don’t fly with Pigeons

Most importantly always remember that the Leader leads and he needs no one to follow him. Just like a Lion doesn’t need a hunting mate or an eagle doesn’t need a flying partner regardless of how high it soars, have faith in yourself to follow your dreams. It is that unique contribution that you can offer to these human organizations which will make you special. And while you make mistakes, maybe get fired, get socially alienated, forgive yourself for what you do wrong but don’t mistrust yourself for what you know is right. Continue to believe in yourself, accept your weaknesses, fears and failures. And grow….

So go out there, be a Tiger…. You don’t need anyone to stand by you…

Dependency Injection in Python

Dependency Injection is a very good mechanism of implementing loose couplings, it helps in making our application maintainable and extendable. Combine it with Duck Typing and the Force will be with you always.

Python offers us all we need to implement that easily. Think about its possible implementation in other languages such as Java and C#, and you’ll quickly realize the beauty of Python.

Let’s think about a simple example of dependency injection:

		
class Command:
   def __init__(self, authenticate=None, authorize=None):
       self.authenticate = authenticate or default_authenticate
       self.authorize = authorize or default_autorize

   def execute(self, user, action):
       self.authenticate(user)
       self.authorize(user, action)
       return action()

if in_sudo_mode:
   command = Command(always_authenticated, always_authorized)
else:
   command = Command(config.authenticate, config.authorize)
   command.execute(current_user, delete_user_action)

We inject the authenticator and authorizer methods in the Command class. All the Command class needs is to execute them successfully without bothering with the implementation details. This way, we may use the Command class with whatever authentication and authorization mechanisms we decide to use in runtime.

We have shown how to inject dependencies through the constructor, but we can easily inject them by setting directly the object properties, unlocking even more potential:

		
command = Command()
if in_sudo_mode:
   command.authenticate = always_authenticated
   command.authorize = always_authorized
else:
   command.authenticate = config.authenticate
   command.authorize = config.authorize
command.execute(current_user, delete_user_action)
           

There is much more to learn about dependency injection. Again, I just demonstrated how implementing this wonderful design pattern in Python is just a matter of using the built-in functionalities of the language.

Let’s not forget what all this means: The dependency injection technique allows for very flexible and easy unit-testing. If you are building classes to be used in multiple applications then Dependency Injection is a good choice.

Build Hybrid Apps using Jquery Mobile and Cordova

Apache Cordova is a set of device APIs that allow a mobile app developer to access native device function such as the camera or accelerometer from JavaScript. Combined with a UI framework such as jQuery Mobile or Sencha Touch, this allows a smartphone app to be developed with just HTML, CSS, and JavaScript. When using the Cordova APIs, an app can be built without any native code (Java, Objective-C, etc) from the app developer. Instead, web technologies are used, and they are hosted in the app itself locally (generally not on a remote http server).

jQuery Mobile framework takes the “write less, do more” mantra to the next level: Instead of writing unique applications for each mobile device or OS, the jQuery mobile framework allows you to design a single highly-branded responsive web site or application that will work on all popular smartphone, tablet, and desktop platforms. jQuery Mobile is a HTML5-based user interface system.

Steps to build Cordova App

1. Install Cordova

on OS X and Linux:

$ sudo npm install -g cordova

on Windows:

C:\>npm install -g cordova

2. Go to the directory where you maintain your source code, and run a command such as the following:

$ cordova create hello com.example.hello HelloWorld

First argument hello specifies a directory to be generated for your project which Cordova will create. Its www subdirectory houses your application’s home page, along with various resources under css, js, and img, which follow common web development file-naming conventions.
The config.xml file contains important metadata needed to generate and distribute the application.
The second argument com.example.hello provides your project with a reverse domain-style identifier.
The third argument HelloWorld provides the application’s display title.

3. Add Platforms

All subsequent commands need to be run within the project’s directory, or any subdirectories within its scope:

$ cd hello

Your ability to run these commands depends on whether your machine supports each SDK, and whether you have already installed each SDK. Run any of these from a Mac:

$ cordova platform add ios
$ cordova platform add android
$ cordova platform add blackberry10

Run any of these from a Windows machine, where wp refers to different versions of the Windows Phone operating system:

$ cordova platform add wp8
$ cordova platform add windows
$ cordova platform add android
$ cordova platform add blackberry10

Run this to check your current set of platforms:

$ cordova platforms ls

Run either of the following synonymous commands to remove a platform:

$ cordova platform remove blackberry10
$ cordova platform rm android

Running commands to add or remove platforms affects the contents of the project’s platforms directory, where each specified platform appears as a subdirectory. The www source directory is reproduced within each platform’s subdirectory, appearing for example in platforms/ios/www or platforms/android/assets/www.

4. Build the App

By default, the cordova create script generates a skeletal web-based application whose home page is the project’s www/index.html file. Edit the this file and add all necessary JS files like Jquery mobile,Jquery and all CSS files. Build a proper Jquery mobile application refering to the documentation in
http://api.jquerymobile.com/category/all/
http://demos.jquerymobile.com/1.3.2/#&ui-state=dialog.
Keep all files with in www folder itself.Run the following command to iteratively build the project:

$ cordova build
$ cordova build ios // platform-specific

When the cordova build command is run, the www source directory is reproduced within each platform’s subdirectory, appearing for example in platforms/ios/www or platforms/android/assets/www. Because the Cordova constantly copies over files from the source www folder, you should only edit these files and not the ones located under the platforms subdirectories.

5. Add Plugin Features

A plugin is a bit of add-on code that provides an interface to native components. More commonly, you would add a plugin to enable one of Cordova’s basic device-level features detailed in the API Reference. The cordova plugin add command requires you to specify the repository for the plugin code. Here are examples of how you might use the Command Line Interface to add features to the app:Basic device information (Device API):

$ cordova plugin add org.apache.cordova.device

Use plugin ls (or plugin list, or plugin by itself) to view currently installed plugins.

$ cordova plugin ls # or ‘plugin list’

To remove a plugin, refer to it by the same identifier that appears in the listing

$ cordova plugin remove org.apache.cordova.device

6. Test the App on an Emulator or Device

Load the platforms/android folder into Eclipse and make sure all dependencies are correct and run the App in either emulator or you can plug the handset into your computer and test the app directly. In case of Ios load the platforms/ios app into Xcode and run the application.

7. Production Release

Now that we have a working app, we are ready to push it live to the world. Before we deploy, we should take care to adjust plugins needed during development that should not be in production mode For example, we probably don’t want the debug console plugin enabled, so we should remove it before generating the release builds:

$ cordova plugin rm org.apache.cordova.console

To generate a release build for Android, we can use the following cordova command:

$ cordova build – - release android

To generate a release build for Ios, we can use the following cordova command:

$ cordova build ios – - release – - device

For Reference please check http://cordova.apache.org/docs/en/4.0.0/guide_overview_index.md.html#Overview

Python magic methods

There are far more magic methods in Python than we could ever hope to cover. However, we believe that the arithmetic and boolean magic methods are fairly intuitive to use, and so don’t deserve special attention.What are magic methods? They’re everything in object-oriented Python. They’re special methods that you can define to add “magic” to your classes. They’re always surrounded by double underscores (e.g. __init__ or __lt__).

Magic Method When it gets invoked (example) Explanation
__new__(cls [,...]) instance = MyClass(arg1, arg2) __new__ is called on instance creation
__init__(self [,...]) instance = MyClass(arg1, arg2) __init__ is called on instance creation
__cmp__(self, other) self == other, self > other, etc. Called for any comparison
__pos__(self) +self Unary plus sign
__neg__(self) -self Unary minus sign
__invert__(self) ~self Bitwise inversion
__index__(self) x[self] Conversion when object is used as index
__nonzero__(self) bool(self) Boolean value of the object
__getattr__(self, name) self.name # name doesn't exist Accessing nonexistent attribute
__setattr__(self, name, val) self.name = val Assigning to an attribute
__delattr__(self, name) del self.name Deleting an attribute
__getattribute__(self, name) self.name Accessing any attribute
__getitem__(self, key) self[key] Accessing an item using an index
__setitem__(self, key, val) self[key] = val Assigning to an item using an index
__delitem__(self, key) del self[key] Deleting an item using an index
__iter__(self) for x in self Iteration
__contains__(self, value) value in self, value not in self Membership tests using in
__call__(self [,...]) self(args) “Calling” an instance
__enter__(self) with self as x: with statement context managers
__exit__(self, exc, val, trace) with self as x: with statement context managers
__getstate__(self) pickle.dump(pkl_file, self) Pickling
__setstate__(self) data = pickle.load(pkl_file) Pickling

Journey to the world of coding

Programmers are essential to the development of computers because without coding that is necessary to make a computer work properly, the machine would be useless.

Hi guys, I am Kenith Aiyappa a passionate software developer from a small,beautiful place called Kodagu, located in the southern part of India. My love towards computers and great desire to learn new stuffs helped me to get into software Industry. I wanted to share my experience since a long time as how I started my carrier as a coder, where exactly I learnt programming and the drawback that I came across in our education system.

Starting from my school days, I had a subject called Computers which was almost like a leisure time. Since I was put in a school which had state syllabus, my learning scale was limited only for MS office package, but unfortunately most of us never understood even that. I hardly knew what I would type in computer during practical sessions or what I memorized in order to pass with good grades in exams. My learning was just for the sake of good grades in exams and nothing else.

During the vacations of my 10th grade I took up a basic course in computers from a institute called ‘APTECH’ which was pretty much close from my house. This course included stuffs like basic computer operations, MS office package,paint,internet usage & etc, this was the first stage where I actually understood some thing about Computers. I was amazed by the power of computer and amount of work we could do using it and gradually started to love computers. After that basic course which lasted for a month or more, I took up C programming in the same institute, I would like to mention a name “Nanjappa”-Man of simplicity and wisdom, he was my first teacher of programming. His excellent teaching helped to put up a good foundation for my programming skills. Later during my Pre-university education I took up computers and had determined to complete my Engineering in computers itself. Even during those days of pre-university I studied all subjects just for the sake of good numbers in exams and never understood where exactly I could use or implement the subject knowledge. Math was the only subject which never bugged me because its purely logical and nothing to memorize and I excelled well in it. Though I loved computers I hated its theoretical part which had lengthy explanations hence I studied it just to get high scores in exams and never understood its theoretical concepts in depth.

I remember a joke to describe the situation of our Education System –

A student is sitting idly in class while others are furiously jotting down the professor’s words.
Professor: why are you not taking notes??
Student: I already have it from my grandfather.

What I m trying to tell is we are following the same algorithm again and again. And we are expecting a wonderful result. If we want to get the desired output, we have to make changes in that algorithm and execute it. Or else we will keep on saying that ‘India is a developing country’ for ever.
To put in a nutshell – India Reforming its education will become Developed from Developing.

During the vacations of my Pre-university education I decided to take up Hardware course and learn the internal structure and working of computer. As a result at the end of my course I was capable of handling basic repair works of computers and understood the internal functionality of computer well. This was the time my mom got me my first laptop for which I rejoiced whole-heartedly. Once I got into my Bachelor of Engineering in computers I found all programming related subjects much easier. But, still my mind was programmed only to get good numbers and grades in internals and exams, apart from it never understood the need for better understanding of the subject. During those days from my 1st year till 4th year , every year during the programming competitions held in our college I would make sure that my name is always there in the winning list. Inspite of all these, I am not hesitant to share that my knowledge in programming was limited to less than 5%.

Since I had a better knowledge in C programming some how I managed to crack an interview and got placed in a prestigious company called “Sasken”. But that didn’t work out for me because Sasken delayed my date of joining and I had to spend couple of months at home. That was the time I got in touch with few good coders in the Industry and started to learn programming languages on my own and built my first website and hosted it successfully. With the reference of few good friends I got an opportunity to attend an interview in a small startup company called “Enfini Technology Pvt Ltd”, managed to get into this small startup of 5 guys including me.

Enfinites took me with open arms, helped me gel up well and were the torch bearers of my knowledge. I started my work as a web & mobile developer, found great passion on it and just loved what I was doing. Henceforth, never turned back to join Sasken. Having known a smattering of programming, I was like a Tod in the well, It is this small team which helped me learn programming better and taught me each and every stuff that a programmer must know. Only after joining this startup I understood ups and downs of coding and the art of programming irrespective of the language we use.

Through out my education the only thing I did was studied only for the sake of internals and exams. Not only me there are several students who follow the same principle. I still repent for those lost days of mine where I could actually sharpen my coding skills and could have gained better knowledge of programming. Our Education system is designed in such a way where students are made to study the subjects which they will never use in real life. Parents at home and teachers at school pressurize students to study only to excel with good grades and never ask them to study to understand the subject. These numbers and grades in exams play a key role in student’s life, only if a student gets high grades he is capable of getting into a good college and later a job. One should realize that by delving deep in a particular field which they love, they could do miracles. Here it doesn’t matter whether the student really has knowledge of the subjects in his work area, only thing that matters is his high grades. Most of the Software companies hire students from college based on their grades, irrespective of the BE branch they are in. Do you really feel grades are sufficient without the basic knowledge of work area?? Suppose a student from Civil, Mechanical or any other branch apart from computer science and Information science has good grades, do you really think he is eligible for the Software Industry ? Currently our Indian Software Industries works out this way , they are in competition to hire the students with high grades. This curbs the talent the student has in his platform or stream.

Probably you might have heard this sentence which was buzzing in facebook
“INDIA IS A COUNTRY WHERE PEOPLE FIRST BECOME ENGINEERS AND THEN FIGURE OUT WHAT THEY WANT TO BECOME”
This sounds like a joke but this is the naked truth. Several students get into BE because of parents and relatives pressure, though they are not interested in the particular field and later struggle for jobs and end up in any job that comes to their feet. I want every individual who reads this post to understand the fact that its better to make children understand at an early age that they study for the sake of knowledge and not high numbers or grades and encourage children in any field that they love.