Tuesday, October 23, 2012

Printing India's Map using C !

I found this piece of code on stackoverflow. This prints the map of India in '!'. Have a look here http://codepad.org/UKwPb77f


#include "stdio.h"

main()
{
    int a,b,c;
    int count = 1;

    for (b = c = 10; 
    a = "- FIGURE?, UMKC,XYZHello Folks,\
    TFy!QJu ROo TNn(ROo)SLq SLq ULo+\
    UHs UJq TNn*RPn/QPbEWS_JSWQAIJO^\
    NBELPeHBFHT}TnALVlBLOFAkHFOuFETp\
    HCStHAUFAgcEAelclcn^r^r\\tZvYxXy\
    T|S~Pn SPm SOn TNn ULo0ULo#ULo-W\
    Hq!WFs XDt!"[b+++21]; )
      for(; a-- > 64 ; )
        putchar ( ++c=='Z' ? 
                             c = c / 9 : 
                             33 ^ b & 1  );

    return 0;
}

         !!!!!!                                                     
                    !!!!!!!!!!                                                 
                     !!!!!!!!!!!!!!!                                           
                       !!!!!!!!!!!!!!                                          
                     !!!!!!!!!!!!!!!                                           
                      !!!!!!!!!!!!                                             
                      !!!!!!!!!!!!                                             
                        !!!!!!!!!!!!                                           
                        !!!!!!!!                                               
                        !!!!!!!!!!                                             
                       !!!!!!!!!!!!!!                                          
                     !!!!!!!!!!!!!!!!                                          
                    !!!!!!!!!!!!!!!!                                  !!!!!    
                  !!!!!!!!!!!!!!!!!!!                               !!!!!!!!!! 
                 !!!!!!!!!!!!!!!!!!!!!!!                 !         !!!!!!!!!!  
            !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!              !!     !!!!!!!!!!!!    
           !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!        !!      !!!!!!!!       
            !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!      
             !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!       
              !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  !!!!!!!!!!!!       
       !!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!        !!!!!!        
      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!      !!!!!         
          !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!        !!!          
        !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!        !          
          !!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!                       
           !!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!                         
                  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!                          
                 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!                           
                  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!                               
                  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!                               
                  !!!!!!!!!!!!!!!!!!!!!!!!!!!!                                 
                  !!!!!!!!!!!!!!!!!!!!!!!!!!                                   
                  !!!!!!!!!!!!!!!!!!!!!!!!!                                    
                   !!!!!!!!!!!!!!!!!!!!!!!!                                    
                    !!!!!!!!!!!!!!!!!!!!                                       
                    !!!!!!!!!!!!!!!!!!!                                        
                     !!!!!!!!!!!!!!!!                                          
                      !!!!!!!!!!!!!!!!                                         
                      !!!!!!!!!!!!!!!                                          
                       !!!!!!!!!!!!!!                                          
                        !!!!!!!!!!!!                                           
                        !!!!!!!!!!!!                                           
                        !!!!!!!!!!!!                                           
                          !!!!!!!!                                             
                          !!!!!!                                               
                           !!!!    

Sunday, September 9, 2012

Is Business Analytics the next BOOM ?


Wikipedia refers business analytics to the skills, technologies, applications and practices for continuous iterative exploration and investigation of past business performance to gain insight and drive business planning. Well and rightly said so, now what does it mean to me, you or anyone who wishes to be a part of the next boom after IT. This time there is room for making mistakes as there is no shortage of skilled labour and availability of training. There is a huge corpus of unemployed and ready to graduate job-seekers who will at one signal jump into the vast ocean of this field of analytics.


We are producing around 2328306436 GB of data each day. Now we can't just simply generate this data, we have to make meaning and sense out of it, and build something useful that helps us improve our lives. The previously relied upon "gut feeling" to make decisions, is no longer highly reliable in this technological world.Today VPs' and CEOs' are trying trying to get the best out of their massive data and IT alone can't just help them. Keeping a real-time tab on customer's demands and fulfilling them is what they desire today.
In this uncertain world, how does analytics promises powerful insights, reduced costs and increased profits ?
Analytics converts extensive data, stats and quants into insights that can drive efficient decisions and derive strategies.For every buck spent on analytics, companies reportedly get a return value of almost 1000%. Leave alone the industries, just imagine how much could governments save in terms of operational costs if they were to adopt analytics to analyse their earnings and expenditures. 
 Needless to say but my gut feeling says that business analytics is ready to take the world by storm, and we might be lucky (intelligent) enough to swing a ride with it into the future.

Wednesday, August 15, 2012

Change in the definition of growth ? Not just number of employees or revenue, but also quality !!!

(Please don't think I am biased to favour the Indian IT industry, I am a part of the bandwagon so I include references to it)
Recently while talking to a senior executive at a company I came across this question written in the blog title, he mentioned that companies have recently started to realize that while growth is important, but increasing number of employees into the firm is no good way to achieve it.
In the last decade companies hired lots of graduates and staffed them into various projects outsourced from abroad. The resources were shown to the clients as resources waiting to start executing the projects. More the resources more chances of getting newer projects. 
One good thing which the recession brought in was growth of analysts and consultants.
10-12 years down the line HR analysts realized that companies have grown to fat sizes and that this is no good way to grow. By simple high school math one can figure out that by increasing resources and doing the same amount of work reduces productivity per resource !
This meant improvising the existing talent so that productivity and revenue both could be increased.
This doesn't mean that we need to stop hiring at the entry levels in the future but we need to definitely get the best people at entry levels itself. By hiring quality people at the entry level, companies will get better people at higher levels in the future. Better people means more quality work is done, ensuring client satisfaction and finally growth in terms of revenue.
So it seems, gone are the days of rampant and blind hiring at colleges during final/pre-final years of graduation. If you are reading this and if you are looking for a job then its time to be not only talented, but also to do your work in a qualitative manner rather than just quantitatively. To tell you the truth, if you are good, people will like to stay with you and companies will make efforts to retain you (in cash or in kind). But if you ain't good nobody cares, there is a huge ocean of people waiting to showcase their skills and talent.

Wednesday, August 8, 2012

Reasons why IT industry isn't the same anymore

Back in time 10 years back, being a part of the IT industry in India was considered uber-cool and elite. The profession commanded respect and even the mention of the word computer science engineer sent bells ringing in the ears of neighborhood aunties looking for grooms for their daughters. Onsite trips for a few months or sometimes years were the norm and people got richer and richer. Property prices zoomed up in cities and suburbs and property brokers thought of different techniques to fleece the buyers in the name of IT boom.

But what happened to the once elite considered profession ? Why isn't it the same anymore ?
Why has it become a dharamshala for all kinds of people ? Why doesn't it come back to it normal self (pre-2007 era) ? Where are the phenomenal salaries that were offered to employees earlier ?

Reason #1 : ( There is no IT in IT ! )
IT work involves insignificant amount of knowledge related to computer science or information technology for that matter. Anybody who knows how to click and type with decent amount of common-sense can come over and start working.

Reason #2: ( IT work is nearly complete )
Most of the IT work has already been completed and optimized in these last 12-15 years of IT boom, which leaves behind little to be done. Clients can today just order a solution over the internet, just like you order a book from amazon.com. The little configuration or customization that needs to be done doesn't need to be outsourced , it can done by hiring a few more members into the IT team of the client themselves.

Reason #3: ( Privacy Issues )
People are today concerned about their privacy and hence are the companies handling the common people's data also concerned about data security and privacy. This has led to companies forming their teams which does the IT work at their own location with lesser issues of data privacy and theft. Specially banks and investment firms.

Reason #4: ( Supply >>> Demand )
The industry is today over-saturated with employees. There is no need for much head-hunting. Thousands of employees are sitting idle today having no work to do at all (read bench). Now, how can one expect that one will be offered a envious hike when he switches companies ?

Reason 5: (Reason#1 + Reason#4)
Finally, the job is such that it doesn't require any heroic programming or analytic skills. On the floor (the workstation where you work) everybody is alike.So this leaves little for the supervisor to differentiate on the basis of your academic background/skills. So you might find a science graduate doing the same work as a electrical engineer. Companies have been seen promoting schemes for bachelor of science graduates to complete their masters along with a job at their offices. It helps them to save costs and get trained bonded resources to work for peanuts.

Sunday, August 5, 2012

Why a QA makes a better BA !

Some people asked me to write more about how does a test engineer gains an advantage over developers when it comes to being a good business analyst. Here's it.
As a tester, you get access to certain integration and pipe diagrams which are often not given to developers, maybe due to contractual obligations and often because projects are so large that a developer would not like to waste his time understanding the different flows across modules but instead focus on understanding his own module. (Keeping in mind number of modules run into four or five digits)
The understanding of key business flows help build and gain knowledge of systems and also the domain of the project. And a business analyst does just the same !
So if you are looking for a future in analyst or consultant roles, then quality analyst is the role to play in your early  years. Yes there are other ways to go about that also, such as doing a MBA or some management related course, but it then it compromises on your work experience for that period of time.
Take your call carefully buddy :)

Saturday, August 4, 2012

Life as a test engineer (to make it look sophisticated a quality analyst)

Yes, I know the title of this post is a bit strange.
Anyways leaving the title to its own condition, let me write more about what is all the fuss about being tester or developer. To begin the with, the (Indian) IT industry having a glorious past, today has less projects which relate to development of new products or services. Support and maintenance is the flavor of the projects being executed today. For those development guys who I know are clenching their fists, would accept that today instead of development from scratch, there is more of customization work. Platforms have been built, the benchmarks have been set and the pseudo-code is already in place. Definitely this saves time but it can't be called development, rather I would call it customization.

Coming back to the title, the clients or users of products and services of these IT giants today are not only concerned with what technology or platform is being used to develop their products. They want reliable services, defect free products and failure-proof systems. This brings into picture the poor long-forgotten test engineer. Once a looked down upon member of the  team, the test engineer suddenly becomes an all-important member. The test team now works upon a test approach, makes estimates and writes all permutations and combinations of test cases to somehow make the product fail (and win brownie points from the management). But alas testing can never be complete. There is no 100% defect free product nor is their a 100% failure-proof service. More on about the job-profiles later on someday.

There are some benefits of being a test engineer/quality analyst. Firstly, you get to learn a lot in a shorter period of time. A analyst has a complete holistic overview as well as a deep understanding of the product/service (or as you might call it the project). Secondly, it is a bit more relaxed job as compared to developers. Yes, no need to read it the third time, it is more relaxed [PERIOD]. Thirdly, it opens up options for you to become a business analyst sooner than you developer friends :)

Yeah, this is not a complete post. I will be adding on more follow-up posts for this one. Take care.

Wednesday, June 27, 2012

What is missing in our computer science curriculum?

This is a nice article, i have abridged it from an existing blog I read somewhere else. I have added the link in this article.


It seems that universities fail to train students who can build good software. Most graduates know what inheritance and interface are, but few of them can properly choose and defend which to use. Most graduates have taken classes in “Operating Systems” and thus can talk a lot about threads and scheduling, but few actually have read books like the one from Doug Lea. They cannot be entrusted to write multi-threaded code. Most graduates memorize the visited nodes when writing a function to detect cycle in a linked list, but few of them are aware of Floyd’s cycle-finding algorithm. The funniest thing is that a lot of them think that they are writing object-oriented code because they have replaced ‘struct’ in C with ‘class’ in C++. They are yet to read a book on design pattern.
In other words, these graduates cannot use the programming languages effectively (ineffective). They cannot communicate their ideas to colleagues in their code (incomprehensible). They do not evaluate the space and time complexities of their algorithms (inefficient). They produce spaghetti code that is so difficult to modify (unmaintainable) so we have this motto in the industry: if it ain’t broke, don’t fix it. It is next to impossible to add new requirements without rewriting it from scratch (inextensible). Often when I do code review, the code looks like scribble to me. I have no way to tell whether it is right or wrong (incorrect).
I would like to point out that computer programming is a real professional that requires more than merely reading “C++/Java/C# for Dummies”. We need the programmers to know more than just the programming constructs and some irrelevant theories they never use on the job. Given a project, a competent programmer should be able to understand the problem, design efficient algorithms in terms of space and time complexities, evaluate different implementations, type in legible code, and provide systematic evidences that the code work. It is very unfortunate that universities fail to deliver students that qualify.
Why don’t universities produce good programmers? The major problem lies in the curriculum. Somehow the schools assume everyone can read the book such as “C++/Java/C# for Dummies” on their own. Consequently, most fresh graduates write dummy code.
Yes, we do programming projects for courses like Data structure, Operating System, Artificial Intelligence and etc. But these assignments aim to enhance the students’ knowledge in the particular topics. The code is never graded based on how professional it is written. Take Operating System as an example, the assignments aim to enhance the students’ knowledge on the concepts of thread and the OS scheduling algorithms but they are never designed to train students on writing good multi-threaded programs. The textbooks used in class teach about mutex and semaphore but they do not teach how to use them effectively. How many students, after taking an OS class, can design a thread-safe stack? I bet that most of them know what threads are and what a stack is, but few can design an efficient and effective thread-safe stack class.
The second problem is faculty. As a university the undergraduate courses are usually taught by newly graduated students. These students are trained to publish journal papers. Many never deliver any industrial applications in their life time (not hands-on anyway). Not only do they not know how to write good code, but they cannot appreciate how important it is to produce good code. For instance, in a Data Structure course, a professor teaches about stack, but he is unlikely to implement a thread-safe stack class for professional use. Without ever working in the industries, it is very difficult for a professor to understand the details and issues associated with using a thread-safe stack. It would even be more difficult for him to appreciate how important it is to provide systematic evidences to show that his class works and is ready for a third-party to use.
One may argue that “Computer Science” is about science so we study Artificial Intelligence, Operating System, etc. Science is about research and innovation. It is not about programming. My dilemma is that if we cannot go to computer science schools to seek qualified programmers, where should we turn to? Also, what exactly is the use of these university trained computer science graduates if they cannot write good code? After all, not everyone becomes a scientist. Most of them are engineers that code the science ideas into real products that benefit our societies.


Original Here:
http://numericalmethod.com/blog/2010/11/03/what-is-missing-in-our-computer-science-curriculum/

Sunday, June 24, 2012

Swapping the odd and even position in a linked list

A simple and intuitive solution to the problem !! It might not be very efficient but it does certainly work.


node* swap(node *head)
{
    node dummy;
    node *prev, *curr, *u, *tmp;

    if (head==NULL) return head;

    prev=&dummy;
    for(curr=head; curr!=NULL && curr->next!=NULL; ) {
        u = curr->next;
        tmp = u->next;
        prev->next = u;
        u->next = curr;
        prev = curr;
        curr = tmp;
    }
    prev->next = curr;
    return dummy.next;
}

void print(const node *head)
{
    for(const node *p=head; p; p=p->next)
        printf("%d ", p->val);
    putchar('\n');
}

Friday, June 22, 2012

Linked List Insert nth problem

A linked list problem for inserting a node after the nth index !!

InsertNth() Solution


void InsertNth(struct node** headRef, int index, int data)
if (index == 0)
   Push(headRef, data);                       // position 0 is a special case...
else {
  struct node* current = *headRef;
   int i;
     for (i=0; i<index-1; i++) {
     assert(current != NULL); // if this fails, index was too big
     current = current->next;
      }
Push(&(current->next), data);
}
}
Its been nearly 2 months now that I have shifted to Pune, and  I have pretty much enjoyed my stay till now. Accenture's a nice company to work for, and after few days of initial glitches all is well now. Although my work doesn't leave any free time during the day for me to blog, I'll try to keep this going on. BTW drop in queries if you have any about Accenture or IT industry or start ups ;)