Yahoo! Open Hack 5 – The Experience

August 25, 2012 Leave a comment

Before we even start, here’s the idea which we hacked up during the 24 hour contest timeline. Brand horizon – When all the social media focuses on the count of re-tweets or share (or whatever they’d like to call it) None of it actually gives you the count of people your product update reached out to. That particular missing link is what addressed in Brand Horizon is. It’s not actually how many shared your update, rather it is who shared your update. The most influential person’s share would spread the word faster. You hit the right nerve, you get the information across faster.

Well before the event:

After Yahoo! Open Hack 4, the expectations were really high for the next edition. The two day weekend at The Lalit Ashok Palace Bangalore during July 2011 hiked up the anticipation for this one. The date was fixed for August second weekend at The Sheraton Bangalore. Two weeks prior to the event, me and my co-hacker came up with countless suggestions for the hack we were about to build. Some of it were: Rupyaa++ – a social media based money management tool which would help you split up the costs of a group hangout or a trip. TwitVote – a voting system with crowd sourced data from twitter. A sentiment analysis based system which gives you a pulse of the crowd’s thought over a given subject. We even came up with some fun hack ideas – A guy-bot who changes his emotions based on tweets he receives and a Guess-the-movie-based-on-its-quote site.

Just before the event:

As the event neared, the official categories for the hacks were published as: Digital Communications, Digital Media & Advertising, Multi-media Experiences and a wide bucket category called “Surprise Us”.  The last one was quite tempting. Although we chose to take the defined category of Digital Media & Advertising and that’s when we brought the idea of Brand Horizons to the fore.

The event:

Like any of its precedents, fifth edition had all the usual elements: Swanky hotel, Yahoos, A huge crowd of eager developers and none other than Anil. He’s Yahoo’s secret sauce when it comes to YDN and developer engagement. After the usual sessions from Murray, Saurabh, Jai – we drove straight into the hack and started with our product. We learnt a lot from our mistakes at YOH 4 which we vowed not to repeat this edition.

The Issues:

Well for starters, the WiFi gave away and we lost precious time after the 24 hour countdown started ticking down. Those wonderful Yahoos wracked their brain to help us connect, but our laptops just wouldn’t give up and connect. Next, once we started querying Twitter through YQL console we never got what we wanted. Turned out, due to multiple pings to Twitter APIs through YQL, Twitter blocked YQL. So our original idea of mashing up data from Twitter and Facebook was given up and the product specifically focussed on brands based out of Twitter. The last one was, neither of our team members, knew in-depth PHP. So we had to struggle overnight to complete the app which required a good use of OAuth.

Panel Evaluation:

The 24 hours counted down to 00:00:00 and we wrapped up our hack with a good description, a screencast on youtube. We were given the first slot for presentation, yay! And We were ready for the panel evaluation.  Our panel was of 3 judges with one extra time-keeper. We were offered strictly 2 minutes with 90 seconds for the demo and 30 seconds for any Questions from the judges. The key person on our panel was Shouvick and was indeed a pleasure to see our product examined by an industry leader.

The presentation went well although sadly for a remark that the prototype was constrained just to Twitter and there were other competitors like TweetReach with similar ideas. This gave a clear idea that our prototype didn’t make the cut, Nevertheless we were satisfied we could come up with a complete working prototype in under 24 hours.

The actual winners:

The final few hours of the event were made of the very popular open bar, and the presentations from the selected hacks. As remarked by one of the judges, not all ideas were worth selling but only a few were. And those were the ones which made the cut. Later that day, saurabh announced the winning hacks through the YDN website Brock, vibration reduction, pictrends, i am bored, bookmafia, beamOS. All deserved the accolades. It was a real experience into the world of startups where in a simple idea turns into something worth making money out of!

 

Creating a smoke using Particle System in Silverlight


Here’s what we’re trying to achieve: demo

One of a fellow programmer came up with a question of “How do you create Smoke effect using Silverlight?” Well there may be plenty of code, third-party tools and plug-ins strewn over the internet for this, but out of a professional curiosity I got into the business of creating one out of my own hands.

The whole concept of creating smoke (without fire ;)) can be done through what they call as Particle System. It’s a technique where in you employ very small graphical objects in large numbers to simulate effects like say Smoke, Fire, Snow, Dust, etc…

We need the smoke to be moving freely, so a canvas would be a best bet for the layout.

<Canvas x:Name="myCanvas" Background="White">
</Canvas>

From this point on the rest of the Smoke effect would be programmed in code behind file (C-Sharp in my case)

Let’s think a minute about smoke, shall we? Smoke starts at a point, very concentrated (Generation Point). According to the complex laws of physics, it simply rises up becoming dilute all the way. Finally blending well with the air where it seems to disappear (Vanishing Point).

Smoke

Understanding the dynamics of smoke

Our approach would be to consider smoke as made up of small particles, which would originate at the Generation Point. These particles as time passes would simply rise up, becoming transparent by smaller percentages as it goes and finally becoming invisible at the Vanishing Point.

These particles are going to be ellipses. Let’s have a method which does just that.

public static Ellipse createEllipse()
{
Ellipse objEllipse = new Ellipse();
//Smaller sized particles
objEllipse.Width = 1;
objEllipse.Height = 1;

//Giving the particles a Smokey look
RadialGradientBrush rgbObj = new RadialGradientBrush();

GradientStop gsObj1 = new GradientStop();
gsObj1.Color = Colors.Transparent;
gsObj1.Offset = 2;
GradientStop gsObj2 = new GradientStop();
gsObj2.Color = Colors.DarkGray;
gsObj2.Offset = 0.5;
GradientStop gsObj3 = new GradientStop();
gsObj3.Color = Colors.Black;
gsObj3.Offset = 0.001;

rgbObj.GradientStops.Add(gsObj1);
rgbObj.GradientStops.Add(gsObj2);
rgbObj.GradientStops.Add(gsObj3);

objEllipse.Fill = rgbObj;

//Set the position of the ellipses to the Generation Point
Canvas.SetTop(objEllipse, 300);
Canvas.SetLeft(objEllipse, 150);
return objEllipse;
}

While the Silverlight application initializes, we’d simply call the following line to add a new smoke particle:

myCanvas.Children.Add(createEllipse());

Well, this is just one particle. By every tick of the clock, new particles should be generated to give the effect of the smoke billowing. This calls for a DispatcherTimer instance which would give me an event for say every 2 millisecond.

System.Windows.Threading.DispatcherTimer timer = new System.Windows.Threading.DispatcherTimer();
timer.Interval = new TimeSpan(2);
timer.Tick += timer_Tick;
timer.Start();

At every tick, we need to be doing a set of tasks based on a few decisions.

Firstly, we cannot afford to overload the memory/screen with infinite number of particles. When a smoke particle simply disappears beyond the vanishing point, we can move them down to the generation point and reuse them. For this purpose, let’s have a limit of 1000 particles that can be freshly generated. If the screen has less than 1000 of them, we can go ahead and generate a new one.

if (myCanvas.Children.Count < 1000){
generateFireParticles();
}

Secondly, at every instant – *all* the smoke particles should perform the following tasks:

  • Rise up
Canvas.SetTop(item, Canvas.GetTop(item) - 1.25);
  • Grow and become lighter in visibility
item.Opacity = item.Opacity - 0.009;
item.Width = item.Width + 0.075;
item.Height = item.Height + 0.075;
  • And take a wavy path up. Smoke particles take a simply chaotic path up, they just don’t go up in a straight line.
Random randObj = new Random(10);
Canvas.SetLeft(item, Canvas.GetLeft(item) - (Math.Pow(-1, randObj.Next(5)) * randObj.Next(2)));

Thirdly, Move every vanished particle back to its original point.

if (item.Opacity < 0.0001){
item.Opacity = 1;
item.Width = item.Height = 1;
Canvas.SetTop(item, 150);
Canvas.SetLeft(item, 300);
}

So, considering all above, my timer tick event would look like this:

void timer_Tick(object sender, EventArgs e)
{
if (myCanvas.Children.Count < 1000)
{
generateFireParticles();
}
foreach (Ellipse item in myCanvas.Children)
{
if (item.Opacity < 0.0001)
{
item.Opacity = 1;
item.Width = item.Height = 1;
Canvas.SetTop(item, Y);
Canvas.SetLeft(item, X);
}
else
{
item.Opacity = item.Opacity - 0.009;
item.Width = item.Width + 0.075;
item.Height = item.Height + 0.075;
Canvas.SetTop(item, Canvas.GetTop(item) - 1.25);
Canvas.SetLeft(item, Canvas.GetLeft(item) - (Math.Pow(-1, randObj.Next(5)) * randObj.Next(2)));
}
}
}

Thus, was how we can generate a smoke effect in Silverlight using Particle System. With a minor change in the color and nature of the ellipse, you can create Fire or other similiar effects.

Suggestions welcome from expert readers on alternate or even better ways!

Book-Shelf : The White Tiger (Part 1)

April 24, 2012 1 comment

Of all my investment, I’d call my books as the best. I ensure a new addition to my book shelf every other month. Finding a reading time between a heavy schedule of work and family is tough, but it is just wonderful to turn off the annoying cell phone, shut the attention-seeking laptop down and get back to the wonders of the written word.

Literary prize winning books are never fun and it’s the general truth. The pleasure a Brown or a Sheldon gives is in no way comparable to such a prize winning book. But on the contrary I say you can appreciate a prize winning book only if you possess the eye for that. Two of the Man Booker Prize winners adorn my bookshelf – one from Ms. Desai “Inheritance of loss” and the other Mr. Adiga’s “The White Tiger”. And this particular post is about the latter. I know it’s a bit late, not just a bit – a good 4 year delay. But I blame myself for being on and off about my reading habits. If you haven’t read this one, go ahead and knock yourself out. If you have, then choice is yours to continue reading the post or just quit.

You’re an ardent reader or someone who’s just getting into this hobby? I’d gladly suggest Adiga. For one, his is the standard simpleton Indian English anyone could appreciate. None of those fancy buzzwords or words with more than 10 syllables. Two, and almost “The” best reason – you’d for once be supporting an Indian Litterateur.

Coming back to “The White Tiger”, here’s what I’d like to say about it (probable spoiler alert):

The plot – To give a very high-level overview of the story, it’s about how Balram Halwai from The Dark turns into Mr. Ashok Sharma of the White Tiger. The back cover describes Balram as The White Tiger, Servant, Philosopher, Entrepreneur, and also as a Murderer. The story runs from describing about a boy named Balram from Gaya who takes up the job of driver at Delhi and finally evolves into an entrepreneur Mr.Ashok at Bangalore. The story revolves around Balram’s philosophical musings and his experiences with the Indian society at large.

Storyflow – The story unassumingly begins as a one-sided rant (letter) from the author on the eve of Chinese premiere’s visit to India. Dark humour ensues with how the Premier would be treated in India giving him a Green Grass Image of India – when the ground realities are much worse. The story continues over a week, mostly through the nights with the author reminiscing his entire life under an eerie chandelier. In some way, tying the narration to a current event kept my pulse beating on the story and I could never skip a page.

… Part 2 to continue

Mistakes: To err is human, so is to fret about it.


Life is so full of mistakes. You see your friends making irrecoverable mistakes, but you can still offer them a shoulder and console them. You always can afford to say it’s not a big deal – there are far worse problems.

But when the same happens to you, you’re stumped! You feel it’s the end of the world, your days feel gloomy and dull. All that you can think of is that mistake you did. You replay those moments over and over on your head – fantasizing if things didn’t go the way it did. You painfully anticipate the harvest of your mistake. Every moment, every happening around you seem to be an excruciating reminder to that mistake.

Here are some things you can try doing:

Confess – Not to a confidante, not to a friend, but directly to the person whom your mistake impacts. It gets a huge load off your chest, and who knows you might have corrected your mistake by just this act!

Be proactive – Never wait for something, time will increase the impact of the mistake. Act swiftly.

Introspect – Would you remember this problem 5 days from now? 5 months now? 5 years from now? If no, then stop worrying. It wouldn’t even matter in the long run.

Learn – To err is human. But to learn is humane. Forget the specifics of the mistake, but understand the dynamics of your mind which put you there in the first place.

Having listed down, sometimes these might not suit everywhere. There are places you need to be cunning. Times when you need to wait out. After all, you were destined to make that single mistake and worry for a week.

Pseudo-elusive career switch : A change waiting to happen


For all those of you out there, struggling to make sense out of your moronic work routine – this one’s for you: http://productivitymentor.com/2012/03/08/point-17-stop-going-to-work/

If you really visited the above link (It’s a very short article, I’ll wait for you until you’re done – and do come back here) what I intend to write is precisely about point 3.

It’s the same pothole that seem to appear every often, and it’s necessary that we look at the problems rather than the symptoms and identify a workable solution. @productivitymentor’s above article is more than just inspiring. May be this was just the kind of perspective we needed.

Stepping away from this and introspect the reason for work becoming mundane, a little social experiment reveals – not everyone is doing their current work as a matter of choice. Many in fact are poly-skilled or have deep passion in areas other their current areas of work. And why they still hang on to this, is 1. Either they look at this as means to “eventually” reach their passion or 2. They are just too comfortable with how things are. What is required for you to make that elusive shift is efforts and what more, persistent efforts.

Unless you are persistent in your efforts, you might just slip from category 1 to 2

So what keeps you persistent to reach out to your work of passion? Besides monetary and financial security, I believe, confidence in yourself to excel in your passion plays a pivotal role. If you’re shaky, then you might not have the spirit to take that extra stride away from the pavement.

Introspect if what you’re doing is in line with your goals, Build confidence, Equip yourself with necessary skills, Make persistent efforts, and Step out of the line – walk your way!

Online Identity Explosion – Securing your identities

March 4, 2012 2 comments

Firstly, be it a tech-savvy or be it a normal person, everyone has a life online. Here online, I refer to the internet and the myriads of websites there in. Programming forums, healthcare, lifestyle, romance, banking, travel, blogging, electronic mail, ecommerce; these are just few of the categories that pop in my head when I think of what we do online.

Let’s do the math. Each of these categories has at least n different websites/vendors associated with it. Say, electronic mail – you have Gmail, Hotmail, and MSN and so on. Take for instance ecommerce, you have Amazon, e-bay, or may be even the flip kart. Each of these require you to register and have an identity (username and password) associated with them.

Normally you choose to have the same username with all of them. But the rules vary with many, some allowing symbols, some disallowing numbers – you are forced to vary your usernames with the websites. And same is true for passwords – One of your comfortable passwords might be unacceptable by some accounts. Some websites have to be associated with email identities. If you took to internet after Gmail came in, then chances are you’ve associated all your email accounts with it. If otherwise, you might have had a host of other email accounts like, yahoo.com or live.com.

Now each identity needs a password. Let’s see.

1.       You can use the same password for all your accounts.

      Great choice. Allows you to remember a single password for all your identities. But this leaves you at a risk. One of your accounts gets hacked into, and you lose across the board.


2.       You use a new password for each of your accounts.

      This reduces your vulnerability to a hack. Even if one of your accounts gets compromised, you can save all your rest. But that gives you N passwords for n accounts you hold. Mighty hard to remember isn’t it?

Good online behaviour states, you cycle your passwords at least every 45 days to prevent your accounts from getting compromised. Now how do you do that, without having to go through the trouble of remembering the new sets of passwords again?

This discussion did not mention, ghost accounts (which you have probably false identities), intranet accounts (which are not under the internet category – but still requires a username/password and hence a necessary payload on your brain)

IMO, this seems to be a pretty interesting and wide area for research. If necessity is the mother of invention, this is the right time to invent, discover or re-discover a cost-effective solution that is within reach for a normal internet user. A normal user is right now juggling with at least 10 online accounts in his hands, forgetting passwords every 10 days, clicking on that seemingly helpful “Forgot your password” link. Or an unassuming user is in a false-sense of assurance having a same password for all his online accounts, screaming to be hacked and compromised.

The solution being proposed for curbing online identity explosion should provide, a way to access all your online accounts in an easier manner, while ensuring that:

  1. Safety of the identities are secure against any forms of hack
  2. Solution is accessible to nay web user – with minimal or zero-overhead
  3. Various modes of access are addressed – Mobile, single point of access, multiple point of access
%d bloggers like this: