Friday, June 13, 2014

Football World Cup - Impact on Work

There are hardly any companies across the world that are not affected by major sports events. Be it the Super Bowl in USA or the IPL in India, these events result in sudden "sick" leaves, work from home requests and long canteen breaks (especially if the said canteen happens to have a large screen TV). I remember watching Sachin Tendulkar become the first cricketer ever to score 200 in an ODI match. This was in the canteen of a Capgemini Mumbai office, with a normal seating capacity of a 100 people, but filled at that time with at least 300 cheering (mostly male) cricket fans. This definitely has an impact on efficiency and in some cases may even affect delivery of service.

As far as sports events go, nothing can beat the FIFA World Cup. I daresay even the Olympic Games don't command the same kind of dedicated viewership. This naturally results in a drop in employee efficiency, since many people either skip work or take long breaks to watch WC matches. I remember matching many games of the 2002 World Cup on the upstairs TV at the office of Viewtrust, then known as Clean Communications. For the finals, a group of us bought tickets to watch Germany take on Brazil on the giant screen of a movie theatre in Pune. Even during the 2004 Euro Cup, I joined some other night shift employees in the canteen of another Capgemini Mumbai office.

So, with employee interest in the World Cup being a given, how can companies minimize the impact on efficiency and more importantly, on service delivery? I suggest that managers draw up a set of rules at the beginning of the tournament and communicate them clearly to their team members. The first rule would be that at no cost should service delivery suffer - the Customer always comes first, even before football. No one can go home early or watch a whole match in the canteen when there are customer issues waiting to be resolved. Other rules can be framed around work timings, work from home requests, minimum people at the work area (just in case the big boss pays a surprise visit), etc. Most importantly, the manager should set an example by following all the rules himself.

From a team building point of view, it may be a good idea for your team to watch one match together, ideally on a Sunday or a holiday, the way my colleagues and I did at Pune. This need not be a company-sponsored initiative, although that would be ideal, to show HR's commitment to fun at work. Otherwise, the team members can simply pool in. The important thing is to ensure that everyone (even those who don't particularly like football) are fully on board, ready to enjoy themselves and celebrate together in the true spirit of the beautiful game.

Thursday, June 5, 2014

Quick Thoughts on Wearable Technology

In the past couple of years, wearable technology has been the new buzzword in the ICT world. After "cloud", which turned out to be much simpler than it first sounded, and "big data", which remains too complicated an idea for mere mortals even today, one wonders how "wearable technology" will fare. So far, we have not seen anything beyond fancy gadgets for the youthful rich, including smartwatches and activity trackers (mainly writstbands). At one point, smartglasses held a lot of promise, as they had the potential to literally change the way we see the world. But the most promising one of the lot, Google Glass, is yet to take off in a big way. Even though the official release is expected to happen later in 2014, the product has not caught the imagination of the general public. Also, there are many concerns around safety (accidents caused by distracted drivers), privacy (recording videos without permission) and etiquette (quietly checking mail or social media during conversations). In the long run, Google Glass or its descendants may overcome these difficulties and gain widespread acceptance. But as of today, in most parts of the world, wearable technology remains more a concept than a reality.

Thursday, May 8, 2014

Quick Thoughts on Mobile UX

Mobile UIs haven't changed a lot in the dozen odd years that I've been using cellphones. My first phone, a Nokia 3310, had an icon-based menu that I struggled to navigate using physical keys. My current Android smartphone still has an icon-based menu, albeit one I can navigate more easily using a touch screen. Although I can now access most applications straight from my multiple home screens and the quick launch bar of my Android phone, the navigation paradigm essentially remains the same. With the possible exception of Windows 8, most mobile operating systems have failed to take full advantage of the touch screen to make the mobile user experience easier and more intuitive. This is where Panasonic's Gesture Play navigation promises to bring about a sea change. Though the company is yet to release more details about this new feature in their upcoming P31 phone, the ads that have been shown on TV do look promising.


Tuesday, May 6, 2014

JIRA (not Jeera)

Of late, every company that I speak to during my job search asks me if I have worked on JIRA. Since the only Jeera I have known is the humble cumin seed, used in many delicious Indian dishes like Jeera Rice, I decided to read up on this particular web-based software, which is used for issue tracking, software development and project management. Developed by an Australian company called Atlassian, JIRA has been around since 2002 and was originally made for issue management. JIRA’s flexible plugin architecture has spawned many integrations developed by the JIRA development community and third parties. It is available in desktop, hosted (Cloud) and mobile versions.

After taking a demo on the Atlassian website, I can tell you that JIRA remains at heart an issue tracking tool. But by defining "issue" in various ways like Defect, Requirement or User Story, you can use JIRA for bug tracking, general project management or Agile project management respectively. JIRA can be used for creating tasks, assigning tasks, tracking the task status, recording time spent on each task and generating status reports.

JIRA Agile (formerly GreenHopper) is an add-on for Scrum or Kanban teams. The easy user interface helps your team easily adopt Agile project management. Bonfire is another add-on that helps QA teams test Web applications. They can take screenshots with the Bonfire browser extension and tag them to Test Sessions, which are the central place in a JIRA project to track manual testing of a Defect, Requirement or User Story.

Atlassian offers various software development tools that are integrated into JIRA. Their team collaboration software, called Confluence, is designed to be used in conjunction with JIRA. JIRA even has a Service Desk module to streamline customer requests. Finally, Atlassian has a marketplace with more than a thousand add-ons available to extend JIRA and use it for more activities related to your daily project management needs.

Friday, April 18, 2014

Republishing Stuck Blogger Posts

This post is slightly off-topic for this blog but it can be classified as technical and also, I want to share this workaround with other users of the Blogger Android app. I managed to find it on the Google Product Forums but it's not an easy one to reach.

Sometimes, especially while traveling, you lose your net connection just before you hit "Publish" on a post. This causes the post to be forever stuck in "publishing" status. You aren't able to republish it even after your net connection gets restored, because the post is "greyed out" in the app.

In such cases, you can use the below workaround after your net connection is restored:

"User would need to use both thumbs as you are trying to force the system to do something with one while clicking on the affected post at the same time. User can hit any published/draft post with left thumb and follow it quickly with tapping on affected row with right thumb. It should happen quickly so that the published/draft post actually doesn't get the tap and rather the affected post row registers a tap event." Now edit the post just like any other draft and publish it.

Friday, March 28, 2014

3D Printing for Dummies

What is 3D printing: As per Wikipedia, "3D printing or Additive manufacturing is a process of making a three-dimensional solid object of virtually any shape from a digital model." It uses an additive process, where successive layers of material are laid down by a 3D printer in different shapes, based on a computer-generated 3D model of an object.

Why is it so useful: Wikipedia points out that 3D printing is useful right "from pre-production (i.e. rapid prototyping) to full-scale production (i.e. rapid manufacturing), in addition to tooling applications and post-production customization." Unlike traditional subtractive methods of manufacturing, there is less material wastage in case of 3D printing.

How is it important: Mark Fleming claims that "Medicine will forever be changed as new bioprinters actually print human tissue for both pharmaceutical testing and eventually entire organs and bones." Also, he says, "experimental, massive 3D printers are printing concrete structures, with the goal of someday creating entire buildings with a 3D printer."

Who uses 3D printing: TechRepublic reports that "A growing number of innovative companies are experimenting with 3D printers, propelling the technology closer to the mainstream market." These include major companies like General Electric, Boeing, Ford, Nike, Hasbro and Hershey's. Many hobbyists also use personal 3D printers in their homes.

Where to from here: As 3D printers become less expensive, more companies and even individuals will start adopting it. As Fleming puts it, 3D printing "is a disruptive technology of mammoth proportions, with effects on energy use, waste, customization, product availability, art, medicine, construction, the sciences, and of course manufacturing."

Thursday, March 27, 2014

Big Data for Dummies

What is Big Data: As per Wikipedia, "Big data is the term for a collection of data sets so large and complex that it becomes difficult to process using on-hand database management tools or traditional data processing applications. The challenges include capture, curation, storage, search, sharing, transfer, analysis and visualization". In 2001, industry analyst Doug Laney defined Big Data in terms of 3 Vs: high Volume, high Velocity and high Variety. Business Analytics firm SAS considers two additional factors: high Variability and high Complexity.

Where does Big Data Come From: Wikipedia says, "Data sets grow in size in part because they are increasingly being gathered by ubiquitous information-sensing mobile devices, aerial sensory technologies (remote sensing), software logs, cameras, microphones, radio-frequency identification readers, and wireless sensor networks." According to McKinsey, "The increasing volume and detail of information captured by enterprises, the rise of multimedia, social media, and the Internet of Things will fuel exponential growth in data for the foreseeable future."

Who works with Big Data: Again from Wikipedia, "Scientists regularly encounter limitations due to large data sets in many areas, including meteorology, genomics, connectomics, complex physics simulations, and biological and environmental research. The limitations also affect Internet search, finance and business informatics." Another category of Big Data users are law enforcement agencies across the world who have to work with multiple local databases containing different categories of information about various criminals and terrorists.

Why Big Data Matters: McKinsey maintains that "From the standpoint of competitiveness and the potential capture of value, all companies need to take big data seriously." SAS believes that organizations can analyze Big Data "to find answers that enable 1) cost reductions, 2) time reductions, 3) new product development and optimized offerings, and 4) smarter business decision making". They have given the example of UPS who started analyzing Big Data in the 1980s, long before the term was coined, and used it to achieve major savings.

How to work with Big Data: Since Big Data can't be processed by traditional database management tools or data processing applications, a new set of applications have evolved to specifically deal with Big Data. Some examples are Hadoop (by the Apache Foundation), MongoDB and Splunk. From a hardware point of view, practitioners of Big Data analytics prefer the faster and cheaper Direct-attached storage (DAS) over the traditional shared storage architectures such as Storage area network (SAN) and Network-attached storage (NAS).

Whether Big Data matters to You: Some companies claim that Big Data analysis is the hottest new practice in the field of BI today. McKinsey predicts that "By 2018, the United States alone could face a shortage of 140,000 to 190,000 people with deep analytical skills as well as 1.5 million managers and analysts with the know-how to use the analysis of big data to make effective decisions." Clearly, if you an IT employee at a technical or lower-to-middle management level, knowledge of Big Data analytics could help you in the future.

Friday, February 21, 2014

"Strong" Leaders - Good or Bad?

Journalist-turned-author Sankarsan Thakur is not known to be a leadership guru. But in a recent interview to a Web portal, he brought up an important point related to leadership, which is very relevant to the Indian political scene as of today. He says, "I think it is important for leaders to be decisive. But in a democracy like ours, it is equally important for leaders to consult and build consensus. Another important issue relates to party and organisation building. Too many of our political entities revolve around individuals or a set of individuals and I think that is not healthy. I see that already happening with the fledgling AAP (Aam Aadmi Party) as well. Arvind Kejriwal [has] already become a cult figure around [whom] everything is beginning to revolve. Leaders should be able to build institutions and leave a legacy behind. Sadly, that does not happen too often."

A decisive leader who takes firm action, even unilaterally, is generally rated higher than a consensus builder who delays decisions by trying to take everybody along. But such leaders are not necessarily good for their team, whether a business organization or a political party. Self-belief and decisiveness are important in a leader but equally important is the ability to convince those around you, including dissenters, about the correctness of your decisions. Otherwise you end up steamrolling all opposition by the sheer force of your personality (or the image your PR team has built for you). This weakens your team in the long run by preventing the emergence of new leaders with their own points of view. While Sankarsan is right about the cult of Kejriwal, the cult of Modi is even more dangerous, for being more powerful and yet more intolerant of criticism.

Tuesday, February 4, 2014

Winning Ways

I'm currently reading "The Winning Way" by Anita and Harsha Bhogle. Awarded by the HR team of my previous company more than 2 years ago, it had been gathering dust on my bookshelf. But once I started with it, I rather liked the way this team of the HR person wife and cricket commentator husband has presented their insights on the art of Winning. Here are some (edited) excerpts that I found worth sharing:

When companies start becoming completed goal-centric and forget that it is people who produce results, they struggle. Just as players in good teams enjoy going to compete, so should people enjoy going to work. This is one reason why the human resource function is such an important aspect of winning teams!

A steady inflow of fresh and young talent becomes potent only when that talent is encouraged to think and is empowered to express their views. Getting people to express their views leads to greater accountability. Once a decision is taken and the whole team comes on board, it is difficult to pass the buck.

There are certain things in life that you want to accomplish or milestones that you wish to achieve. Fix a deadline and just go ahead and do them. Then there are those wonderful feel good things that you always wanted to do. Store them away at the back of your mind till you really have the time. The first set of thoughts are your goals, the second, your dreams. The moment you put a deadline on a dream, it becomes a goal.

One way for teams to overcome a lack of self-belief is to celebrate even small wins, which remind them that they can win and thus start breaking the downward spiral. Slowly, the team develops a winning habit, it builds confidence and the wins attract talent since everyone loves to work with a winning team.

During testing times, leaders often take risks. When they can pull of those risks, the team starts backing them for their courage. A team would be anxious to turn things around as fast as possible but sometimes performance does not improve overnight. Everyone, including the leader, must be patient.

Mistakes are invaluable because they teach you lessons. They are like potholes on the road that you learn to avoid. Mistakes warn you about where you shouldn't be going and what not to do the next time. Winning is not about not making mistakes, but about how to learn from them and become wiser and stronger. It's not about not getting knocked down but about how fast you can get up and fight again.

Change is not an enemy, it is merely a challenge to a set way of doing things, a compulsion to get out of your comfort zone and go into unfamiliar territory. We live in a dynamic environment and so, whether it is a change from within or forced upon us from outside, we have to discard old ways of doing things and learn new ways that are essential to survival. Eventually we discover that change is not the monster we feared it to be.

Communication is the final barometer to test team health. Lack of communication, or one-way communication, can spell trouble for any team. Communication involves clarity of goals and roles, a respect for the views of all team members, a climate conducive to debate and discussion and finally, walking the talk.

A leader is particularly disadvantaged if he lacks communication skills. This is not as much to do with fluency and glibness as it is to do with coming through as genuine, and the ability to connect with the heterogeneous people who sometimes constitute a team. It is about reaching out to those team members who are not doing so well. It is about trusting the team and being seen as someone who can be trusted.

Friday, January 24, 2014

Proactive Re-skilling

Today's ET contains a short interview with management guru Ram Charan. The gyaan he gave was more or less routine, but one paragraph that caught my eye was this one:
To be world class you need to focus on people. A leader's highest lever is people: people before strategy. People compete, businesses don't. Leaders create vision or embrace a vision, they align people emotionally, they lead other people to a certain direction, but they also have to develop people ahead of the business needs.

Let's take a closer look at the last bit: "leaders have to develop people ahead of the business needs". Companies will go through ups and downs but as a leader, you need to keep moving things forward, for which you may sometimes have to redeploy key people in new and unfamiliar roles. Such changes may especially be required in bad years like 2008 and 2013, when it would not be unusual to move someone from delivery to sales or from production to maintenance. But such a transformation cannot be achieved suddenly or in a "perform or perish" mode. As a leader, you need to anticipate the need for such role changes well in advance and start re-skilling the concerned employee. This is where constant engagement with the team becomes crucial. If you have regular meetings with your staff, even during "business as usual" times, you can identify candidates for re-skilling and get them started on the learning curve. This makes it easy for them to pick up the new skills at their own pace and more importantly, it becomes easy for you to re-deploy them at the right time.

Friday, January 17, 2014

Football and Leadership

The Corporate Dossier supplement of today's ET has an interesting article about the lessons a corporate Senior Manager can draw from the world of football. Anyone who follows the English Premier League would know that Managers of top club football teams face much more pressure than their corporate counterparts. So it is difficult to disagree with leadership expert Mike Carson when he says that if you can manage a football team, you can lead anywhere in the world. Here are the 5 key learnings from the said article, albeit slightly modified to be less football-specific.

A Manager:
1. Needs to be equipped to handle exogenous shocks
2. Should understand the values and beliefs that drive the team members
3. Has to realize that no team member is bigger than the team
4. Should know how to manage multiple stakeholders
5. Must relish the role and focus on getting the priorities right

Saturday, January 4, 2014

Leadership, Guru, Broom

In a supplement of yesterday's ET, Sadhguru Jaggi Vasudev says that leaders need three Is - inspiration, integrity and insight. "Leaders essentially grapple with something larger than what others are willing to grapple with, which is what makes them leaders. They need inspiration to be able to do that, else they will get frustrated. The second component is integrity, which is a key element in building trust, without which you are never ever going to be a leader. Integrity is about coherence between what you say, do and think. It is in your actions, in the way you are, the way you carry yourself. [...] Life offers leader a perch higher than other people have. If leaders cannot see any better than others, they become objects of ridicule. They must have insight into situations, into problems and possible solutions."

The guru also offers an excellent explanation for the "drought of leadership at all levels of life in our country". He says, "Being an occupied nation for centuries, we have learnt to keep our heads down. If I get up and do something, I may get into trouble." I think he has really nailed that one - whether in politics or in the corporate world, we Indians have an in-built tendency to lie low and go with the flow. We know that anyone who dares to stand up and challenge the status quo is either cut down to size or forced out of the race. To break the monopoly of the leadership elite, you need to build up a certain escape velocity, for which you need to be very strong-willed and thick-skinned.

But that is what leadership is all about, isn't it? Breaking the shackles... As the guru further says, "Leadership is neither about you or me, it is about something that needs to be done. Leaders figure out how it can be made to happen and get ten or a million people to see that this is the way to do it." In the field of politics, Arvind Kejriwal is a good example of this. Although the existing political parties tried their best to derail his popular movement, AK managed to get millions of Indians hooked on to his simple but powerful message of demolishing corruption. The results are there for all to see. What remains to be seen is how far AK's movement goes towards its ultimate goal.

AK's inspiration, one can say, was the redoubtable Anna Hazare. His insight was the realization that no system can be changed from the outside - when the political parties scuttled his Jan Lokpal agitation, AK decided that "if you can't beat them, join them". He waded into the cesspool of politics wielding the broom of his own political party, to sweep away the entrenched resistance to change. Now we come to the guru's third point of integrity, which will be the toughest challenge yet for AK and his team. If they can't walk the anti-corruption talk in terms of their own behaviour, the very citizens who have empowered their broom will also sweep them out of existence.

Tuesday, December 31, 2013

5 Rules for Outsourcing Interviews

Before I get to the actual rules, let me tell you a story. A few weeks ago, I was approached by an HR Associate of a Bangalore-based e-Learning Solutions company. They had an "Engineering Manager" opening, for which this HR fellow thought my profile was well suited. After going through the Job Description, I felt the role was a bit more "technical" than I would like. But then again, most companies do give a technical slant to their Project Manager JDs, to ensure that the candidate has some past coding experience, instead of being a typical "MBA-pass manager". So I asked him to go ahead and schedule a telephonic discussion. Soon he called me and told me that his CTO Mr. Charles Dickhead (not his real name) would call me on the morning of 27th December. He also said that he'd send a confirmation email, which never came. Still I remained available at that time, just in case CD gave me a call. When the call didn't come, I went on with my day, and forgot about the position.

Out of the blue, the HR guy called me again yesterday and apologized for the non-availability of CD due to Christmas (on 27th December???) and confirmed the rescheduled telephonic interview for today afternoon. Since I've been giving many interviews of late for Project Manager positions, I did not feel it necessary to do any specific preparation. If you've managed projects for 7 years, including Development, Production Support and Upgrade projects, across various technologies, you can manage practically any IT project. All that an interview needs to check is the depth of your PM experience, along with your personality and fitment to the organization. But CD apparently had other ideas, because he outsourced the job of taking my interview to someone else, let's call him Mr. AK-47. To my horror, this guy followed up the standard, much-abused "tell me more about yourself" question with a set of queries that are normally reserved for freshers straight out of engineering college.

"What are the differences between the deployment of a Java project and that of a PHP project?" was followed by "What are the key features of MVC architecture?" By the time I'd wriggled my way out of those two, I realized that AK was at best a Technical Architect, at worst a Tech Lead, and most likely that amorphous entity called a Project Lead. He had probably never met a person with 14+ years of IT experience, much less interviewed one. As I desperately tried to talk myself out of jumping through the window, AK came up with a classic: "What are the 4 pillars of Object Oriented Programming?" As I hemmed and hawed, not knowing whether to kill him or strangle myself, I managed to blurt out "polymorphism" and "inheritance". Sensing that I was choking on the question, AK helpfully came up with "abstraction" and "encapsulation". At this point I was wondering how to end this nightmare, when AK went and outdid himself, if at all that was possible. He said, "Give a one-line definition of each of the 4 pillars." That was it for me; I openly told AK that his questions were far too technical for me, and that I couldn't answer them. AK decided to put me out of my agony by ending the interview and offering to convey "his feedback" to the CTO.

So, without further ado, here are the 5 rules you need to follow while outsourcing interviews, which you were supposed to take, to your juniors:

1. Team Member interviews can be outsourced to Team Leads and above
2. Team Lead interviews can be outsourced to Project Leads and above
3. Project Lead interviews can be outsourced to Project Managers and above
4. Project Manager interviews can be outsourced to Senior Managers and above
5. Never break any of the above 4 rules. Never! NEVER EVER!!!

Friday, December 27, 2013

Leadership and Transparency

This morning, while reading the Economic Times, I came across this quote from the global HR head of one of India's leading Consumer Products & Services companies: "In turbulent times there is a need for greater transparency at the workplace, which will lead to higher accountability, responsibility and responsiveness on [the employee's] part". This struck me as a very powerful idea, one that I believe needs to be implemented urgently by all companies.

Whether your company has just lost a big deal, or has run out of working capital in a recession year, or is facing a hostile takeover by a rival organization, be transparent - go ahead and tell your employees all about it. Also tell them the short-term and long-term impacts of the problem. Normally, whenever a company faces tough times, the natural reaction of the leadership is to shut themselves off from the employees. They feel that, by not conveying the bad news for as long as possible, they can protect the employees from demotivation and low productivity. But we need to realize that such an information blackout normally has the opposite effect on our team. An employee who knows what is going on is more secure mentally, since there is no uncertainty about the situation of the company. Such an employee has two straightforward choices - either stick with the company and help it tide over the bad times, or leave immediately for greener pastures. On the other hand, an employee who is kept insulated from the bad news will soon realize that something is being hidden from him but at the same time will not be sure as to what that hidden matter is. This uncertainty will keep preying on his mind continuously, thereby reducing both his immediate productivity and his long-term engagement with the organization.

Another aspect of transparency is to treat all employees equally during a crisis. If you apply one set of rules for some employees, and another set of rules for others, you run the risk of alienating both groups by making each think you favored the other. For instance, if you implement a cost cutting drive, ensure that applies to everyone, including the leadership team. If the leaders don't lead by example, they will find it difficult to push through any unpopular measures in their respective departments. Or else, if there is a cash crisis and salary payments are delayed, ensure that all the employees are paid at the same time or nobody is. If you decide to pay the junior employees first, saying that they are more dependent on salary income, the seniors will definitely support you. But somewhere in their minds, they will feel betrayed and the first thought of quitting will begin to arise. A third instance where transparency is needed is during appraisals. When one employee gets a good rating, or an award, or a promotion, it is your responsibility as a leader to explain to the rest of the team why that person is getting the special recognition. This will guard against bad blood and allegations of favoritism.

Wednesday, December 11, 2013

RoR Music Database Project

Finally, I've created a Rails + SQLite version of my favorite practice project - the Music Database. This one looks very different from my other (Perl, Python, PHP, ASP, ASPX) implementations of the project - as Ruby is an object-oriented language, I tried to model the application as closely as possible to real life. Usually I store the details of each song in a row of the database table, with the album details (Album Name, Year, Artist Name) being repeated for multiple songs. But here I made Album the primary model and Song a secondary one. So the user has to first create an album and then add multiple songs to it. Here are the steps I followed, once I had the design ready in my mind:

  rails new MusicDatabase
  cd MusicDatabase
  rails generate scaffold Album albumname:string albumartist:string albumyear:datetime
  rake db:migrate

Edit the file "config\routes.rb" to open "views\albums\index" by default, by adding the line:
  root :to => "albums#index"

rails generate model Song songname:string album:references
rake db:migrate
rails generate controller Songs index show new edit

Edit the file "controllers\song_controller.rb" to have the standard methods for showing, adding, editing and deleting songs

Edit the files under the "views\songs\" directory to have the standard forms for showing, adding, editing and deleting songs

In my case, because of the form code that I copied from the Rails tutorial, I also had to edit my Gemfile to include the line "gem 'dynamic_form'" and then do a "bundle install". And thus, I completed my Ruby on Rails "self test" by getting the Music Database project running successfully

Wednesday, December 4, 2013

Steps Taken to Revive Galaxy Tab 2 P3100

When my tab recently suffered a battery drainout issue, these are the steps I took to revive it:

Charge battery to 99%
Perform factory reset
Connect to Wi-Fi
Provide Samsung account settings
Provide Google account settings
Update Samsung apps
Power off
Insert SIM card and Micro SD card
Power on
Save GPRS settings
Install essential apps only (Clean Master, Facebook, Blogger, MyMail in my case)
Update stock Android and Samsung apps as needed
Add apps and widgets to home screen as needed

Friday, November 22, 2013

SOLVED: Rails with MySQL on Windows

For the last couple of days, I was struggling to get Rails to talk to MySQL on Windows. Though I was able to install the "mysql" gem, I got an error message when I tried to run the "rake db:create" command for creating the database tables needed for my model. Web searches revealed many detailed discussions on the problem, but no definite solution. Whatever approach I tried only resulted in a different error message. Finally, against the run of play (as cricket commentators would say), I was able to get things working. So here are the steps I followed, for the benefit of others who may be facing the same issue:

1. Install Ruby and Rails using the RailsInstaller - I used version 1.3, which provides Ruby 1.8.7 and Rails 3.0.7, along with other related packages like Bundler and DevKit

2. Install MySQL Community Server - I already had version 5.5.23

3. Install the mysql gem:

gem install mysql

4. Carefully read the message from the mysql gem installer - I got:

You've installed the binary version of mysql2. It was built using MySQL Connector/C version 6.0.2. It's recommended to use the exact same version to avoid potential issues.

At the time of building this gem, the necessary DLL files where available in the following download:

http://dev.mysql.com/get/Downloads/Connector-C/mysql-connector-c-noinstall-6.0.2-win32.zip/from/pick

And put lib\libmysql.dll file in your Ruby bin directory, for example C:\Ruby\bin

5. Download the exact same version of the MySQL C connector as mentioned in the message you see. Get the zip archive, not the MSI installer. Simply extract the "lib\libmysql.dll" file and put it in your "Ruby\bin" directory (you don't really need the rest of the C connector files).

6. Add a new line "gem mysql" to the Gem file of your Rails project.

7. Replace the (sqlite) contents of your config\database.yml file with:

development:
  adapter: mysql
  encoding: utf8
  database: blog_development
  pool: 5
  username: root
  password:
  socket: /tmp/mysql.sock

Now, when you run the "rake db:create" command, it should work without any issues. Even before that, you can test the MySQL connectivity using irb (the Interactive Ruby shell):

C:\Documents and Settings\User>irb
irb(main):001:0> require "Rubygems"
=> true
irb(main):002:0> require "mysql"
=> true
irb(main):003:0> Mysql.connect("localhost", "root", "", "phpwork")
=> #<Mysql:0x2cdfca8>
irb(main):004:0>

Tuesday, November 19, 2013

Hi, Ruby!

In the last couple of months, I've more or less completed my target of revising the basic concepts of Perl, Python and PHP. So I decided to check out a relatively newer member of the Open Source Programming Languages family. Ruby, along with the Rails framework that is based on it, has captured the imagination of web developers worldwide.

Ruby is said to be a truly object-oriented language that is easy to learn, and has rich libraries that are easy to extend. The Rails framework includes everything that you would need to create a database-driven web application using the MVC pattern. As it needs minimal configuration, you can develop applications faster than with other frameworks.

At least that's what the tutorials say. Today I'll put these statements to the test by (a) learning the basics of Ruby, (b) installing Ruby, (c) running a Hello World program, (d) running a simple Embedded Ruby program, (e) installing and testing the Rails framework, and (f) creating a Rails + MySQL version of my good ol' music database project.

Note that I'll follow the "Ruby on Rails Introduction" tutorial on tutorialspoint.com, which was the first Ruby tutorial I found, and use their sample code. After going through the first few pages of this tutorial, I installed Ruby from http://rubyinstaller.org/

I then tested the Hello World program and the simple Embedded Ruby program from the tutorial. Next, I tried to install the Rails framework using the "gem" utility that comes with Ruby. This utility can be used to install Ruby packages, called "Gems".

But I ran into an error during the Rails installation, due to the absence of the necessary build tools for the 'atomic' native gem. To get around this issue, I had to first install the Ruby Developer Kit. I downloaded the installer from the same URL as Ruby - http://rubyinstaller.org/ - and then followed the step by step installation instructions given by http://learnwebtutorials.com/.

(Note: An easier way is to visit the RailsInstaller website and install Ruby, Rails and many other packages at one go)

Next I had to create a demo Rails project as given in the tutorial, run the WEBrick web server that is bundled with Rails, and test the demo page from my browser. Note that the right command to create a demo Rails project is "rails new demo" and not "rails demo" as given in the tutorial. Also, the right commands to start the WEBrick web server are "cd demo" followed by "rails server". In both these cases, the commands given in the tutorialspoint.com web tutorial seem to be outdated ones.

Thus I've completed 5 of my 6 objectives for today, viz.: (a) learnt the basics of Ruby, (b) installed Ruby, (c) ran a Ruby Hello World program, (d) ran a simple Embedded Ruby program, and (e) installed and tested the Rails framework. Creating a Rails + MySQL version of my music database project will take more study and, quite possibly, a lot of trial and error. So I'll try and complete that objective later this week. Meanwhile let me search for some more good Ruby tutorials on the Web.

Monday, November 11, 2013

Skills for Starting a Company

A young trekker friend recently asked me what are the key skills he would need for starting his own company, which is something he intends to do in the future. Since we were just chatting, I asked him for some time to put together my thoughts on this subject. Not that I'm an expert on the topic but I can surely speak from second-hand experience, having been part of many startups and small IT companies. Some of these have done reasonably well, others have done spectacularly badly and some have just maintained a status quo (which I personally believe is worse than a spectacular failure, but that's another blog post). So here are the 5 top skills that I believe my friend needs to develop before he starts his own company:

Communication
Any company needs to sell something - an idea, a product or a service - in order to succeed. So the very first skill you need is the ability to communicate your company's offerings. Of course, you can always employ a sales guy to handle the actual selling but as an entrepreneur, you need to be in the forefront of marketing your company and its products. Years before you actually start your firm, you need to start building a network of contacts. This network will eventually give you the leads that your sales team would exploit, to win business for your company. Once you get the deals, you need to keep communicating with your customers to ensure timely payments, to get contract renewals or new deals and to gather more leads.

Leadership
In most fields, you cannot be a one-man company. That may be how you start off but eventually you have to build and lead a team of specialists in various functions like sales, delivery, support, admin, etc. Leading is not just about coordinating - you have to define your company values, communicate those to the team, and lead by example. Communication plays a very key role in keeping your team engaged. Initially there may be hiccups and setbacks. But if you keep your team informed about the problems, they will support you through thick and thin. Even when the business is doing well, you cannot afford to neglect your communication duties as a leader. Many promising companies have floundered by losing the support of their core team.

Problem Solving
Many people wonder whether technical skills are necessary to start your own company. For example, do you need to be a baker to start a cake shop? Or do you need to be a web programmer to start a dot-com? The answer is clearly No. But at the same time, you cannot be totally unaware of the subject. Even if you have experts to do the dirty work, you still need to understand the problems your business is facing and you need the skills to solve those problems. Simply put, problem solving is the process of identifying, analyzing and solving problems. This is a skill that you pick up through work experience more than anything else. So I would advise my friend to work in the chosen field for 5-10 years before he starts his own company.

Empathy
Earlier, I talked about the importance of communicating with your team about your successes and failures. But mere communication is not enough, especially in tough times. Telling your employees about your problems will not automatically buy you their support. For example, if the company runs into losses in a recession year, you cannot just expect the team members to work for a fraction of their salary. You need to be able to put yourself in their shoes and understand their problems, especially financial ones. Then you need to provide solutions for those problems, even at the cost of your profit calculations. At the same time, you need to ensure that you are investing in the right people, those who would stick with you in the long run. 

Humility
In my view, it is easier to be a leader in a period of failure than in a period of success. The intoxicating sweetness of success has a tendency to go to your head, impairing your judgement and taking you to the edge of pitfalls. Maybe CXOs of large corporations can afford their eccentric ego trips and subsequent losses, but you cannot. Keep yourself humble at all times and resist the temptation to believe the larger than life image of your company that is created by your marketing team. Remember that the competition is always out there, waiting for you to make one false move. Stay focussed on your customers, stay in touch with your employees and stay rooted to your company's values and core competencies and your business plan. 

Friday, November 1, 2013

Excel output from Perl script

In an earlier post, I had explained how to output some tabular data from a PHP script into an Excel sheet using PHPExcel. Today, I shall explain the Perl equivalent, using a module named Spreadsheet::WriteExcel. This module can be easily installed using PPM. By looking at the documentation and the code examples, we can quickly rustle up our own Perl code to create an Excel sheet containing the songs data from our famous music database.

    # Create a new Excel workbook
    my $workbook = Spreadsheet::WriteExcel->new('music_list.xls');
    
    # Add a worksheet
    my $worksheet = $workbook->add_worksheet();
    
    #  Add and define a format for title row
    my $format = $workbook->add_format(); # Add a format
    $format->set_bold();
    $format->set_color('black');
    my $slate_grey = $workbook->set_custom_color(40, '#6D7B8D'); # slate grey color
    $format->set_bg_color($slate_grey);
    $format->set_align('center');
    
    # Write the Excel title row using the new format
    $worksheet->write(0, 0, "Song Title", $format);
    $worksheet->write(0, 1, "Artist Name", $format);
    $worksheet->write(0, 2, "Album Title", $format);
    $worksheet->write(0, 3, "Year Title", $format);
    
    # Increase the column width for clarity
    $worksheet->set_column('A:D', 25);

    # Define the format for the cell borders
    my $cell_border_format = $workbook->add_format(border => 1);

    if ($row_count == 0) {
        $worksheet->write(1, 0, "No records");
    } else {
        for (my $i=0; $i < $row_count; $i++) {
            # Write the actual table contents and also set the cell borders
            $worksheet->write($i+1, 0, $excel_content->{"a" . $i}, $cell_border_format);
            $worksheet->write($i+1, 1, $excel_content->{"b" . $i}, $cell_border_format);
            $worksheet->write($i+1, 2, $excel_content->{"c" . $i}, $cell_border_format);
            $worksheet->write($i+1, 3, $excel_content->{"d" . $i}, $cell_border_format);
        }
    }

One catch is that the Spreadsheet::WriteExcel module cannot overwrite an existing Excel file (by design, to avoid accidental data loss). So let us put in a bit of code to delete the existing file, if any.

    # Check if Excel file already exists
    if (-e 'music_list.xls') {
        # Try and delete old Excel file
        if (unlink('music_list.xls') == 0) {
            # Show error message if delete fails
            print "Old Excel file could not be deleted";

            # Show the HTML footers and exit
            &tail($dbh);
            exit(0);
        }
    }