Showing posts with label google. Show all posts
Showing posts with label google. Show all posts

Tuesday, June 26, 2018

[v2.0] Ok Google, Open my curtains!

This post is a follow-up to my previous post http://vignesh.foamsnet.com/2018/06/ok-google-open-my-curtains.html.

Note: I've created a github repository which contains the code and some more details. I intend to keep that up to date with newer ideas, etc. https://github.com/vickyg3/curtain-automation

When i posted the previous set-up on reddit, one of them suggested a better way to do this that will overcome the cons of the previous method (noise and lack of manual control).

In a nutshell, these are the replacements i made:
  • Use a stepper motor instead of a servo.
  • Use a timing belt pulley and timing belts instead of a pulley and rope.

Here are the updated list of parts (with links to the cheapest ones i could find online to keep the cost minimum - although i didn't necessarily buy it from these links):

* Mounting bracket for the pulley on the non-motor end - I used a servo mounting bracket with a long screw. I am sure there are better alternatives for this one - $12.99
* Super glue - $4
* Vibration dampener for stepper motor (optional but highly recommended to keep the noise down) - $2.98
* 12V DC adapter - $8.99

Total Cost - $67.69 (some of it can probably be gotten for a cheaper price on ebay/gearbest/aliexpress).

Step 1 - Screw in the mounting bracket

This is quite straightforward. I drilled in a couple of drywall anchors and screwed in the mounting bracket to the wall.

Step 2 - Install the motor and the vibration dampener

Place the vibration dampener on the motor. Make sure that the non-threaded holes on the dampener are touching the motor and use two M3 screws to attach the motor and the dampener. Attach the pulley wheel to the motor's shaft using the screws on the side of the pulley.

Now the motor can be mounted on to the mounting bracket using 2 M3 screws which connect to the dampener's threaded holes.
Motor attached to the mounting bracket (shown without the vibration dampener).

Step 3 - Install the pulley mounting bracket on the other end

I drilled a drywall anchor on the other end and screwed the pulley mounting bracket in. I then used a long screw with a couple of plastic fillers to hold the other pulley roughly in the center.

Step 4 - Loop the timing belt around the pulleys

I had bought an open ended timing belt. I looped it around either pulleys and tightened them as much as i could by hand and cut off the rest of the belt leaving about an inch of overlap. I then used super glue on the extra inch of belt to stick to them together with as much tension as possible. You could also use a clamp like this with a screw to close the loop on the belt.

At this point, you should be able to move the belt manually by hand by pulling it gently in either direction. If so, there is enough tension on the belt to move the curtains.

Step 5 - Attach the curtains to the timing belt

Just as before, i placed the curtains in the completely closed state and attached each curtain to either side of the timing belt using a safety pin.

Here's a sketch from before about how the pulleys and the curtains move:

Step 6 - Program the microcontroller

I used the same NodeMCU ESP8266 controller as before. Here's the gist that contains the Arduino sketch: https://gist.github.com/vickyg3/623ca535b565ed43c8b617a6f7c7c06f (it is a crude version and has a lot of room for improvement, but i left it for another day).

Step 7 - Microcontroller and Motor Driver setup

Here's the wiring:
* DIR+ to D2
* PUL+ to D5
* ENA+ to D8
* DIR-, PUL- and ENA- to GND (can either be bundled together or connected separately to individual GND pins on the NodeMCU)
* A+, A-, B+ and B- need to be connected to the motor (refer to the motor's spec for the wiring colors for your motor).
* The switches on the driver need to be set to ON, ON, OFF, ON, ON, OFF (S3 and S6 should be off).

Connect the DC power supply to the driver. I cut the ends of an old DC adapter and identified the positive and negative wires using a multimeter.

I then glued the driver and the NodeMCU board to the wall behind the curtain using small command strips. Any double sided tape should work as they aren't that heavy.

Step 8 - Home Assistant Configuration


That is pretty much it. For more details on how you can control it from Google Home/Alexa, please see my previous post.

The noise level of the old servo based system was around 60 decibels (as measured by an app on my phone). The new system with vibration dampeners works at 30-35 decibels and is barely audible. Most of the noise is from the curtains actually moving on the rod.

Here's how it works (The video is noisy because the roomba was running when i recorded the clip):


Here's a video without much of external noise:



Thursday, January 1, 2015

Tis The Season - 2014!

Hola!

This is me with another attempt in vain to remind myself that i should write more.

2014 has been wonderful. Lot of memorable moments. First full year as a married person. A wife who loves you more than the world. A job that, well, i really have no words to describe it, it's that good. I could not have imagined a better life.

The year started just like any other. The first big moment was in March where we celebrated our first anniversary.

And then along came a pretty sweet moment at work. I got an opportunity to give a recorded-talk at Google I/O, Google's annual developer conference. It was a big deal as developers from all over Earth tune into it.


Then thanks to my girl we got to spend the summer in Seattle as she was taking up an internship there. It was three awesome months that encompassed a wide range of cool things like living across the street from Space Needle, flying on a sea plane, an awesome trip to the island capital of British Columbia. Not to mention, getting away from the heat of California's summer.



Along came October where there was a really fun filled party for her birthday.


Then came the holidays where we did crazy things like reaching 130ft beneath the Pacific Ocean on a submarine.

126ft beneath the Pacific Ocean!

I am writing this as we pack our stuff headed to celebrate the dawn of 2015 in random parts of the California West Coast.

Until then, Mahalo & Happy new year 2015!

To end this post, a random quote from Phoebe that always makes me laugh - "If you wanna receive email about my upcoming shows, please give me money so that i can buy a computer".

-Vignesh

P.S.: I cheated in this post by including more pictures than words. Although, i really hope that i will write more in 2015!

Wednesday, October 23, 2013

Open sourcing Social Photos

I have been working on a lot of open source projects lately (chromium, AOSP, ffmpeg, etc.) and I have had this tremendous change in the way i look at software projects now. I am all the more convinced that open source is the only right way of doing software.

With that in mind, I've made a pledge to myself that no matter what I do, I am going to put the source out there. As a first step, i'm open sourcing the one big project of mine, Social Photos.

The source can be found here: https://github.com/vickyg3/social-photos

It is a snapshot of the one that's currently powering the live site: http://socialphotos.net (with API keys redacted). Feel free to fork and use as you please. Although i'd appreciate a link back, it's not mandatory. Also, i'll be more than happy to look at Pull Requests.

One of the main reasons that developers (including myself) don't post our code out there is that we are ashamed of our code. I was really ashamed by the number of hacks i did in this project that i couldn't even think of making it public. I'm over it. I'm ready to accept people fixing my mistakes.

Happy Coding!



-Vignesh

Friday, September 20, 2013

Bucket List of People to Meet in Lifetime!

We all love meeting celebrities. Because of the geography that I live in right now, I have had the opportunity to meet quite a few of them over the past year.

I always had this list of people to meet in person before I die in my mind. Until a year ago, It was mostly more of a fantasy list. But once I moved to where I am now, the fantasy started becoming reality. So I wanted to transfer that list from my brain to a document so that I don't miss out on anyone if an opportunity knocks on the door.

Here is the list (in no particular order):

PersonWho/What/Why?Met/Been There?Note/Souvenir
Thierry HenryThe person I respect the most in the world.No-
Don KnuthFather of modern computer science.No-
Dennis RitchieFounder of C (The R in K&R).Not possible anymore!-
Brian KernighanFounder of C (The K in K&R).Yes2013-06-20: Autograph
Linus TorvaldsFounder of Linux and Git. Strongly believes in whatever he believes in.No-
Robert LoveA huge contributor to the Linux kernel.Yes2013-06-13: Autograph
Bjarne StroustrupFounder of C++.Yes2013-08-15: Picture with him & Autograph
Randall MunroeHe is a hero of mine and worship his sense of Sarcasm and WitNo-
Matthew PerryMy most favorite actor in the world.No-
Lisa KudrowMy most favorite actress in the world.No-
Michael SchumacherHe was a huge inspiration as i grew up watching him win.No-
Larry & SergeyMy role models in life.YesEvery Fridays (now every Thursdays).
Matt CuttsOne of the early employees of Google and famous for his work on Web Spam.Yes2012-12-20: Lunch
Jeff DeanThe most bad-ass engineer ever.Yes2013-01-22: A walk around Charleston Park
Stade De FranceMy most favorite football stadium in the world.No-
Nou CampThe holy grail of football.No-
The Corrs (Sharon Corr)My most favorite band and most favorite violinist.No-
Felicity HuffmanHer character's attitude in Desperate Housewives resembles almost 100% that of my wife.No-
Jim ParsonsWho wouldn't wanna meet him?No-
Ramsus LerdorfFounder of PHP. The language i have written most of my code in.No-
Jeffrey ArcherMost favorite author in the world.No-
Paolo MaldiniI grew up watching him play. Perfect combination of style and class.No-
Arsene WengerI grew up watching him. One of the most inspirational people.No-
Vint CerfThe reason why we all have a job. Founder of TCP.Yes2012-11-20: Said hi and shook hands
Kunnakudi VaidyanathanA person who can talk with violin.Not possible anymore!-
Ron RivestThe R in RSA.No-
Petr MitrichevHas been Topcoder #1 for many years.No-
Mary Lynn RajskubSecond most favorite actress.No-

I will try to keep this list updated mostly as a record for myself rather than for the world to see.


-Vignesh

Sunday, July 14, 2013

Announcing Social Photos v2!

I have been working on this side project for quite a while now and I am happy to announce that it is launch ready now!

Visit http://socialphotos.net to manage all your digital photos across Social Networks in one roof using a simple intuitive user interface.

Features Include:

  • Transfer Photos
  • Transfer Albums
  • Download selective albums as a zip file
  • View Slideshow of your albums
  • Monitor progress in a simple pane
  • And much more!

Please do feel free to give feedbacks/suggestions. Use it and Share it!


-Vignesh

Tuesday, February 26, 2013

The Last One by Myself!

Before you start reading, I really would like to warn you: Stop, Do not read. What follows is utter crap.

It has been almost 5 years now since i fell in love with this amazing girl. It’s almost time now. I am literally counting the last few days of my bachelor life. The 7 and odd years that i have known her has just swung by very fast. It just seems like yesterday that I was a small school kid. I honestly can’t remember how college life went on so fast. Here I am now, sitting in a totally different part of the world, still unable to believe that I am actually here.

When I look back at the past 7 and odd years, there are various wonderful moments which I would say have made my life what it is now. Not to brag, but not many people in life get almost everything they want, especially at such an early point in life. I am indeed one of the lucky ones. I am surprised at so many things that I do these days. It just seems like yesterday (literally like yesterday) that i went around nagging people for career advice. Yet here I am today, talking to many of my friends about building their career, etc. I really am surprised at the way I have turned out.

I am in this state where i ponder upon looking for words to express how my life has turned around to what it is now. There has been unexpected twists and surprises, expected happiness and so many other feelings which words cannot describe.

If I sit back for a moment and think about why I am writing this post, I honestly have no clue. I just felt like I should write something that will forever remain as the last post I ever wrote as a bachelor. Not that it is a big feat or anything, but blogging was something which, despite many resolutions and swearings, i could not keep up with. So, not to feel bad about myself that I hardly write anything these days, I started out writing this particularly pointless post.

I am flying out to India tomorrow. It’s gonna be the most #epic trip of my life. Loads of things to look forward to. Girl of my dreams, getting together with her. Life is fun. Hopefully I write something meaningful sometime soon (of course after I am back from the India trip).

-Vignesh

Wednesday, December 12, 2012

Life on the Pacific Coast!

Disclaimer: These are my impressions. They're not facts, they're my impressions, so they can't be argued with. Also, it's quite a lengthy post! With that out of the way let’s begin.

It has been close to 3 months since i moved to a totally different part of the world. The experience so far has been mind blowing if anything. Dream job, wonderful location, awesome co-workers and above all, amazing culture of people. I have been taking notes since the past three months and am posting my observations about this part of the world as i have seen it in this short period.


First Picture after I landed in the US

Human involvement == Expensive
Anything involving one to one human attention for a significant amount of time will be significantly expensive. For instance, you can reach from place to another in a bus for $2 but the same might cost anywhere between $20 and $100 in a cab. A loaf of bread costs around $3 whereas a bread toaster costs $13. This is because bread loafs are perishable and requires constant human interaction for replacing it, probably on a daily basis. Whereas the toaster will be mass manufactured by a machine in thousands and requires the least human interaction. The main upside to this is that people are very hands on. They usually assemble their own furniture and so on. Hiring a human on a hourly basis is *much more* expensive than buying the required tools and doing the job yourself.

Public transport == Longer
In India, if you can cover a certain distance by car in 15 minutes, you can usually cover that in a public bus in 30 to 45 minutes. Here, if you take the bus for the same distance, it could take anywhere between 60 to 90 minutes (depending on whether you have direct bus access or not). You can see this for yourself as to how long it takes from a location to SJC airport by car (15 mins) and by public bus (85 mins). The reason behind this is quite straightforward. In the US, traffic is in two extremes: you either take the freeway which has no signals whatsoever or you take some internal road with overwhelming signals and other obstructions. Cars take the freeway and public buses don’t, hence the significant time difference.

CTM!
Can anybody guess what CTM stands for? Ok now can anybody guess what this is doing in this post? I’m unsure of the reason, but whenever people here refer to Indian food, CTM is the de facto scale of reference. They tend to compare the spiciness of other stuff with CTM as the base scale. Also, people who have never been to India usually differentiate between North and South India as bread eating and rice eating parts of India.





New term for Public Wifi
When i was back in India, I always used to wonder what’s the point in having any wifi only tablet, or any other wifi only device for that matter. Now I understand why it totally makes sense. All the public places usually have free wifi. Especially since i live in mountain view, i enjoy free city wide wifi provided by Google. Also, Starbucks wifi is the most common example of public wifi. Starbucks is a coffee shop which exists on almost every street and usually all Starbucks shop have free wifi, thereby extends that almost all streets have free wifi.

New notion of City
The notion of a “city” is very different when compared to what it means in India. Cities in the US are small, very very small when compared to cities in India. For instance, the distance between Mountain View and San Francisco airport is 25 miles (~40 kilometers). In India, if you drive 40 kilometers from a place, it is very likely that you’ll still be in the same city. Whereas there are some 5 to 7 cities between Mountain View and San Francisco. They are that small. On an average, if you drive about 6 to 7 miles from any city, you’ll definitely be in some other city. There’s another level of granularity known as counties. County sizes here match with city sizes in India (size, not the population!).

Meat is De Facto
I am not sure if it seems so because i am a vegetarian, but in general what i have noticed is that meat is the de facto ingredient for preparing any sort of food. Even soups by default have a meat based stock. You will have to specifically ask for the restaurant guy for food without meat and seafood (for which the choices will be usually limited in a normal restaurant). But there are a lot of places in the bay area where one can get very nice vegetarian/vegan food. By the way, McDonalds in the US does not have any vegetarian dishes which makes me realize how much they have customized their menus for their Indian version (there’s McAloo Tikki!). Tofu is the usual vegetarian replacement for any meat.

Go Karting
Car driving in this country is a joke. Yes, the traffic is high speed, but apart from that there’s no thrill in driving. Majority of the vehicles have automatic transmission (which means that one hand and one leg is always free while driving). The only challenge is to learn the lane discipline, but that’s a matter of very short time. Once you learn the rules, driving is a piece of cake. If you have ever done Go Karting in India, you can drive real cars here. That being said, rules have to be followed here even while driving in a small road where there is no traffic whatsoever. Cars are the default mode of transport, there are a very very small number of motorcycles (bike == bicycle here, hence the term motorcycle). Motorcycles are more of an enthusiasm here than a mode of transport. They cost about 4 times as a car and hence very rarely found on roads (Edit: I realized this was an exaggeration. Depending on the type of car and type of motorcycle the prices vary. But the general idea is that motorcycles aren't intended as a primary mean of transport. They are more of a fun thing).



US-101

Water, Coke and Beer
Almost all these three cost the same, in the sense that the difference isn’t significant as it is in India. You can get water and coke for the same price and beer will cost a little more. Again like meat, beer is very commonplace. All shops usually sell beer and there are bars in almost every major places in the city.

Pedestrians and Bicyclists
Contradicting Indian behavior, pedestrians and bicyclists (bikers) are given priority at any intersection. Vehicles taking free right turns or passing an intersection without signal always come to a complete halt to look out for pedestrians and bikers. Even if the pedestrian or biker is a little away from the intersection, the vehicles usually wait for them to pass. This is religiously followed by all vehicle drivers irrespective of the type of powered vehicle they drive.

Silicon Valley == Epitome of Technology
Technology is used almost everywhere, it is more or less ubiquitous. One of the main reasons for this is availability of internet everywhere (as i mentioned earlier 1Mbps internet is free in mountain view). Buses and trains are high tech and have systems for ticketing that logically make a lot of sense. For instance, a single ride in a bus costs $2 and a day pass costs $6. You can use a prepaid smart card and the system is actually smart enough to charge you not more than $6 for the rides you take in any 24 hour period. Debit card cash back is really an awesome system. I don’t see any reasons why they don’t have that in India. It is a true win-win.



San Antonio Caltrain Station

Cash? Why not card?
Cash transactions are very very rare. It’s been three months and i still have the cash that i bought along with me when i came from India. Every shop, as in every single shop, accept credit/debit cards. So there is no necessity carry a wallet. I just carry my card in the pocket along with the phone. There are even mobile phone cases with credit card holders.

Differences in words
There is a lot of difference between American english and Indian english, many of which i learnt only after getting here. Glaring ones include: 1) Ground floor is mentioned as First floor here, First is Second and so on. 2) Capsicum is called Green pepper (the guy from subway stared at me when i said capsicum). 3) Bill is called Check and Cash is called Bill (the paper note). There are loads of such word differences.

Numbers can be Deceiving
Not following the metric system is a pain in the ass. The distance unit is particularly very deceiving since you look at 1.3 miles and start walking, whereas walking 2 and odd kilometers is really difficult (when comparing the distances which i used to walk in India). 



Note: Image copied from Facebook

More than all this, the best part about this country is its people. They are friendly by heart. Even strangers greet each other. The bus driver tells you to have a nice rest of your day when you get out of the bus. The person whom you held the door for tells thanks. To reiterate, the best part for me so far has been the People!

Such has been my experience in this country so far. I am enjoying every moment of it. It has given me a whole new view of how life can be, since all this is a sudden surprise (something i never constantly dreamt of). Maybe i’ll do another blog post after 6 months describing the views then.

Good grief, my blog is not dead. I will definitely write more soon!

-Vignesh

Thursday, September 20, 2012

On Leaving India!

Warning: This is a random rant. And some of you may not be ok with the attitude of this rant.

It's almost time and I'm all set to leave India for the first time and it is probably for my good. It is a bit ironic that of all people I've been the one chosen to leave the country at such an early stage of life. As my email id goes, few months back, i had the least idea that i would go out of the country and that too as a long term business. Nevertheless, it's hard to turn down when your lifelong dream calls you to make a choice between itself and the country you love.

I've been known among my friends and family to often pass off niche comments whenever I'm asked about going to another country for a long term. And truly, by heart, even now i cannot think of settling down permanently in country other than India. So I've been in extremely mixed emotions about this. I'm not saying it was a hard choice to make, the choice i had to make was damn easy. But somewhere in the corner of the heart it pricks a little bit as i am actually about to go through with it. Nevertheless I'm damn excited on this new phase of my life. It has really moved very fast so far.

As most of you might already know, I'm now formally engaged to my long term girl friend Gayathri. She is the most amazing human being I've ever met in my life. So naturally, this adds even more excitement to my trip given that marriage is around the corner. In a way, I'm more excited about coming back here for marriage than about going there and taking up my first job.

Personally this journey is a big step for me as I've never gone beyond South India most of my life. Bangalore and Hyderabad have been my borders except for one Delhi trip during college. So I'm half excited and half scared to face the new geography, new culture and what not. Everything is a bit overwhelming, I'm gonna be staying right across the road from Stanford for my first few weeks there.

Off late the only question I'm being asked by everyone is "Are you gonna permanently settle down in the US?". I really don't know the answer for this question. All my life i never thought I'd set foot in another country for a long time. But here i am all excited about how things have turned over in a few months. So I'm not really in the mindset of planning for the long term. Deep down the heart i wish to be back in India sometime in the future.

I'll conclude this almost pointless rant by saying i will miss a lot of things about Indian lifestyle but I'm looking forward to the most important phase of my life and I'm not a least bit sad about it not being in India.

And hey, I'm getting married on March 4, 2013 in Chennai. I will surely invite every one of you personally later, just book your calendar for that date right away :-)

-Vignesh

Thursday, September 15, 2011

Google DevFest 2011 - Bangalore!


Atlast, I attended a professional developer meet! And it couldn't be better. It was the Google Developer Fest organized by Google at Lalit Ashok Hotels, Bangalore. Most of the speakers were from Google headquarters, working on key Google products like Android, Chrome, Maps and App Engine.



The registration process went on very easily as they had a QR code in the confirmation mail, and used an android phone to take a picture of the same and verify the registration. Also, they had queues based on alphabets range. The T-Z queue was empty while the other queues were having atleast 20 to 30 people in it. For the first time in my life, i experienced an advantage of my name starting with V!

In this post, I am sharing the raw notes which i took during the keynote and various other talks. Hope this will be of some use.




Keynote - Android
* 550k+ activations per day
* Complex Screen density vs Size matrix - unifying everything => android
* Always use DPI (density per square inch) for specifying assets
* Honeycomb features
* Fragments
* Loaders - wrapper on top of asynctask
* Action bar
* Tabs
* Animation framework
* Compatibility library
* Multiple APK Support

Keynote - Bleeding edge HTML5 - http://india-devfest-keynote.appspot.com
* Interestingly, this keynote isn't called as "Chrome", though most of the topics were Chrome specific
* 160M active users
* Page Visibility API
* Prerendering
* Offline capabilities
* Web animation - CSS3, WebGL
* Native Client
* Future
* Web intents
* Fullscreen content - Fullscreen API
* Web Audio API - Real time processing and analysis of audio
* WebRTC - Real time communication
* Be updated
* chromestatus.com
* updates.html5rocks.com



Android Market - Tony Chan
* 250k + apps, 6B+ downloads
* In app billing, carrier billing
* Licensing
* All licenses allowed
* Code Obfuscation
* Don't reuse sample code
* In app billing
* Sell only digital content
* Reports for developers
* Device Filter
* Ability to exclude handpicked devices
* Multiple APK
* Filter by specific segments (platform version, screen size, etc.)
* App available as one product listing
* Apps upto 4GB coming soon (50mb app + 2gb archive)
* Pay attention to graphics - Featuring in android market depends mainly on that

Android Fragments & Open Accessory ADK - Tony Chan
* Fragments
* Fragments need not always have UI
* Fragments are an investment for the future!
* Fragments vs <include/>
* Fragments (optional UI, has lifecycle, not standalone, no direct interaction with intents) vs Activity
* Open accesory & ADK
* USB Device basics (Descriptor, etc)
* Open Accessory -> A USB host device that can communicate with an android device (e.g. Arudino)
* Use Android Accessory Protocol for communication

Building Integrated Apps on Google Cloud Technologies - Alfred Fuller
* App Engine intro
* Google Storage
* Store data in google's cloud
* Access via RESTful API
* Objects of any type (100GB / object)
* OAuth / Web browser
* Prediction API
* Machine learning API
* Upload training data -> Build model -> Predict new data
* Many machine learning techniques, Asynchronous training, Many platforms access
* BigQuery
* Analyze massive amounts of data in seconds
* SQL like query language, REST, RPC, etc.
* Batch jobs (Mapreduce)
* App Engine Identity API (For secure authentication)

Google Apps Marketplace - Claudio Cherubino
* Google Apps as a pure platform
* Google Apps APIs
* Success Stories
* OpenID SSO & OAuth
* Provisioning API
* Gmail contextual gadgets
* Sidebar gadgets in Gmail/Calendar
Twitter: @ryguyrg @scottmcmullan @stevenbazyl

Chrome Developer Tools - Boris Smus
* Basics - Cheat Sheet
* Revision history for all changes made inline in dev tools
* Aim to transform this into an IDE
* Commandline API - console.log takes n parameters, copy(), inspect() and $0
* Javascript debugging - See call stack, Pretty print
* Breakpoints - Line, Conditional, Exception, DOM, Event, XHR
* Future
* Extensions can extend developer tools too!
* Use chromiumer
* Remote debugging (--remote-debugging-port=31337 , Blackberry PlayBook only)



Google Places API - Chris Broadfoot
* What is a Place -> Abstract & Concrete
* Available as a web service and as a part of javascript maps library

Designing UIs for Phones and Tables
* UI Patterns for Honeycomb
* Action Bar
* App Icon - Where am i?
* View details - What can i see?
* Action buttons - What can i do here?
* Multi Pane Layouts
* Take advantage of screen real estate
* Consolidate multiple related screens into a compound view (similar to iframe in web)
* Screen rotation handling - Stretch (Settings), Stack (Calendar), Expand/Collapse (Gtalk), Show/Hide (Gmail)
* App Navigation
* Beyond the List
* Think and use innovative UIs to replace traditional lists (carousel, slidestack, etc.)
* Do's
* Aim for single APK
* Use compatibility library
* Customize visual design completely, if straying from Holo theme
* Support both landscape and portrait
* Extract dimensions for phones and tablets
* Use theme/style/etc. to reduce redundancy
* Marry OS visual style with your brand
* Don'ts
* Assume API level >= 11 (tablet)
* Assume xlarge == tablet (7" inch tablet is large)
* Use small font sizes
* Overuse fill_parent; Avoid excessively long lines of text
* Think tablets are big phones

Btw, the lunch was awesome too! :-P Overall, a great experience! :-)

-Vignesh

Saturday, May 7, 2011

Orkut Deja Vu - The Technical Side!


Its been almost two months now since I first launched "Orkut Deja Vu" - A series of web applications and a chrome extension that helps you move your memories from orkut to facebook. Personally, I think the application was a good hit. In this article i will try and explain the technical side of it and the various hurdles faced on the due course of development.


Note: This article is for the technically inclined and if you don't want the technical details and just want to use the application, visit http://orkutdejavu.foamsnet.com!


Java and My server!


To begin with it, my server is a VPS running linux with a humble 700MB RAM and a shared processor. My search for an Orkut API ended with orkut os client - An official API provided by Google. This is more of a library than an API and only the java implementation of the library was very sophisticated (though there were php implementations, they weren't that good). Ever since i started learning computer science, if there was one thing i hated, it was java (now don't even get me started about perl).


So there lied the first problem in front of my eyes: Running java in my server. I didn't want to take up the pain of setting up JSP for this sake and decided to just call the java program that does the orkut calls from PHP using shell_exec. I know it isn't a safe option, but since there is no user passed data and the calls are hard-coded, i was sure that there was no injection vulnerabilities. Yet this approach isn't very efficient as it spawns a separate java vm for every exec call, but it was a compromise that i had to make for not setting up a java based server.


OAuth - The headache!


The orkut library's OAuth implementation was really messy. Fortunately, it had a method to explicitly set an OAuth access token obtained from elsewhere. That said, I used Zend OAuth library in PHP to perform the 3 legged OAuth and use that access token in the java programs. There were totally four java programs: one each to fetch the user's orkut name, albums list, photos and scraps. The java programs printed the output as JSON if it was successful or nothing if there was an exception. PHP then parses that JSON. I used JSON so that all the escaping will be taken care by the JSON libraries and thereby ensuring safety of data transmission.


Photo Album Migrator


The photo album migration was quite straight forward without much hurdles. All i had to do was integrate the following: Image gallery, Facebook API, Orkut API and write some simple javascript that made AJAX calls to transfer the photos. This was quite a cakewalk as i was already very familiar with the Facebook graph API.



Scrapbook Downloader


Again, the programming side of this was quite straight forward. But there was one major challenge involved in designing this. The java program generates a html file containing the scraps which is then converted to PDF. HTML to PDF conversion is CPU intensive and hence needs to be done with care. I could have used a resource manager like Sun Grid Engine, but i did not want to make things complex for a simple job to be done. Also, the conversion is not done programatically by a library as all the PHP PDF libraries were memory-wise very expensive (a file with ~100 scraps always exceeded PHP's memory limit of 64MB). So, I used a external command line utility (wkhtmltopdf) to accomplish this conversion. Again it was a simple shell_exec with hard-coded arguments.




Testimonials Migrator


This was the really challenging part. There was no Orkut API that gave access to users' testimonials. But i didn't want to give up. I really wanted to pull off a tool that can migrate testimonials to facebook. So I thought of attacking this problem from the heart of orkut - the orkut website. Obviously, the first thing that came to my mind was a Google Chrome extension. The extension will inject a javascript into orkut.com website and add a "Post to Facebook" button beneath eacch of your testimonials.


The first hurdle in accomplishing this was that there were two versions of orkut (old and new) with different page structures. I didn't want to write two different scripts to handle the versions. Instead i wrote another script that detects the version and if it is new, it prompted the user to redirect to the older version in order to use the extension. The next job was to understand orkut's DOM so that I can place the buttons. This ended up being quite an easy job too.


Another glitch in chrome extensions is that we cannot specify images directly in CSS for content scripts(for e.g.: background: url(a.jpg); is not possible), as the CSS will run in the scope of the website. So, it has to be either done programatically using javascript or encode the image in base64 and hard code it in the CSS. I chose the first option. From this point, it was fairly straight forward. When the user clicks on the post button, store the corresponding testimonial using HTML5's local storage and create a new tab where the user can choose the posting options. Again, the facebook authentication and API usage here were simple as i had enough exposure already.


Epilogue


Though it seems like a simple app, huge amount of thoughts are put into every single aspect in design of the application and the entire development process was a fun journey with a great learning curve. This application has made me feel my web presence. Web is really a great platform for amateur developers like me. I have got around 20 new followers in twitter and a person from brazil appreciating me for this application. I have really been motivated a lot by this and hope to continue the same stride in creating usable applications as this one!


This post will not be complete without a heartfelt thanks to all those who supported me on due course of development and all those who used and shared this with your friends!


-Vignesh

Tuesday, April 19, 2011

The Social Network - Build it Google, We will Come!

I recently read an article about Larry Page taking over as the CEO of Google and sending an internal memo to googlers about 25% cut in their bonuses if Google didn’t do well in social arena this year. I was disturbed a lot ever since I read that and wanted to pour out my thoughts about a dream social network from Google. Yes, I frankly think Google can still do much better than Facebook.

A headnote, this article is totally how i view a Google social network shall be made possible. I have tried to think of it as practically as possible. Some of it may sound silly/stupid for expert readers, so kindly bear with me.

Orkut was the trend setter! - What went wrong?

Orkut was the first and most famous "social network" of all time. It came during the period where the term "social network" was not really defined. Orkut gave that term a definition. And it was doing really well especially in places like India and Brazil. Ever since Facebook came in, Orkut started to lose.

I, personally, would say that the reason why Orkut never caught on was because Google tried to remain professional. They probably wanted to stick to the Google style of doing things and in the process forgot that people just wanted to have fun and party on in the social network unlike other Google services where professionalism kept people happy. The best example i would like to quote is, Orkut did not have scrap threading for a long time and that was available even for SMS by the time Orkut added that. Naturally, we don’t want to roam around in a blazer/suit 365x24x7. Facebook realized it and they just let people do whatever they wanted to do, literally no restrictions whatsoever.

Sign of Innovation - Google Wave

Google then launched wave and claimed that "it is simply going to change the way people communicate". Well, we know how true it is from the fact that wave has been axed by Google few months back and is now residing in its open source home of Apache.


Build it Google - We will come!

Again, the problem with Google Wave has been that it was difficult for a layman to understand and use it on a day-to-day basis. Even when wave was axed, not a single layman cared about it, only computer professionals cared since the underlying technology and protocols were really well built. Yet again, Google had failed to capitalize the wonderful technology they built by coping it up to what everyone actually wanted. In short, Google tried to remain professional with wave too.

Sign of Desperation - Google Buzz

Then came Google Buzz, supposedly the "Twitter killer". One major factor that i feel Google doesn’t realize when building social products is that, You cannot force people down their throats to go Social. Yes, I love Twitter and can’t live without it but at the same time I don’t want to read my tweets in my Gmail inbox.


Build it Google - We will come!

Similarly, Google Reader is one of the most wonderful software ever built. But with literally no connection whatsoever, Google decided to tie Buzz with Reader. This tie up lead to nothing but junk in both Reader and Buzz. And when people wanted to opt out of Buzz, it resulted in loss all their Reader follow list too. Making it opt-in is a really good vision by Google and at the same time they should also make sure that the opt-out is cleanly done.

What next? Social + Google = ??

So can Google ever surpass the mountain, that is Facebook, and succeed in social like they did in search? My answer is, yes they surely can. Sure Facebook has some 600 million users but Google is no poor lad when it comes to userbase too. Infact, Google is still a more prominent part of our life than Facebook is. Conduct a poll asking "Which of the following can’t we live without - Facebook or Google?" and i bet the winner will be Google.

Imagine a social network that revolves around all of Google’s services. Imagine a service that aggregates all of gmail, youtube, reader, maps, picasa, talk, news, voice and even orkut. Google, if you can build a rock solid service that does this and add your typical magical touch to it, then definitely you can climb the mount everest that is Facebook. Add to this the crazy, yet possible, thought of Google acquiring Twitter and integrating Buzz with it seamlessly. By recitifying all the mistakes that it did in the social arena in the past and building such a clean and fun service, it can surely overpower Facebook.

Google’s userbase is much more loyal when compared to that of Facebook. Google, as a company, with its policies is much closer to our hearts than Facebook is. Identify Facebook’s problems and fix it. Facebook’s main concerns today are spam and privacy. I can’t think of a product other than Gmail that can handle spam so near to perfection. Also, Google Talk has been an integral part of Gmail and Orkut for so many years now and not once we have seen any spam in it that can even be compared with the Facebook chat spam we have these days. Though Google have had their own share of controversies regarding privacy, they have somehow held on and been in the good books of their users when it came to privacy.


Build it Google - We will come!


Of course all this is not going to be an overnight affair, it is going to take lots of effort and time. Given that Google is investing so keenly on getting that top spot in the social arena, proper focus, being unprofessional and learning from the past are the key factors that will decide the fate of Google in the social arena. They can’t afford to flop anymore. This may be Google’s last chance to make an impact. By heart, i sincerely hope that Google can just snatch that number one spot in the social arena!

So, my message is short and simple: "Build it Google - We will come!".

-Vignesh

Wednesday, March 16, 2011

Introducing Orkut Déjà Vu! - Orkut to Facebook Photo Album Migrator!

As we all know, Orkut was the trend setter of the modern "Social Networks". Few years back, Facebook took over that top spot in social networks from Orkut. Yet we all have lots of sweet memories stuck with Orkut in the form of Scraps, Photo Albums, Testimonials, etc. This website helps you pull out your old memories from Orkut and make them brand new by moving them over to Facebook!



This is just a night time project that i have been working on for almost a month now!

I don't want to bore you with stories. Try out the app straight away here: http://orkut.foamsnet.com or http://orkutdejavu.foamsnet.com

I am sure there are plenty of bugs. Please email me at vig..@gmail.com(click to expand) for any comments/feedbacks!

-Vignesh

Saturday, February 26, 2011

Why Plagiarism Hurts?

I recently attended a so called "online programming contest" of one of the premier institutions in the state (not mentioning the name to not stir any arguments over it - I tweeted it here and here though). I have been attending this contest since the past 3 years and was highly disappointed about this year's event.

The reason is, as the title suggests, it was nothing but a blatant ramp of plagiarism. There were totally 8 questions to be solved out of which 4 questions were mere "copy-paste" jobs from spoj. Such events need not be perfect, but when you conduct an event of such stature you are atleast expected to make sure that google doesn’t give an exact match for the questions you give. As i mentioned in the tweet, the other 4 questions were very poorly worded and more or less dumb. Anyways, i am not going to ramble about the contest in this post. But it got me thinking, plagiarism can really hurt. It can hurt both the ends of users badly.

First things first, what is plagiarism? Sounding like a fancy GRE word, it has a simple meaning: Copying someone else’s content without their consent. I know spoj doesn’t mind if their questions are being copied, but it should either be altered so that it doesn’t look like the original question or (even and) spoj should have been properly cited.

When someone writes something on the internet these days, it has become like they have lost complete ownership over it. Plagiarism is a very big problem these days. It exists on all levels. Starting from a simple online programming contest to industry definers like Microsoft. Google even launched an algorithm change to their core search engine algorithm this week that ranks plagiarised pages lower than pages with original content.

My point is, when you plagiarise something without consent and citations, its not just a matter of two keystrokes in your computer. You hurt people’s feelings. And you will never understand those feelings unless you start writing something on your own and someone else copies and pastes it without your consent. It takes very little effort to cite the original source of any content you use, but that gesture will make your users respect you more than they did before.

There are even licensing policies that helps you prevent plagiarism and at the same time lets you use others content (one such license is Creative Commons License).Always place appropriate citations. If an author is writing content on the internet, then he’d sure respond to you via email/twitter if you want to use pieces from his article. Be gentle and place the credit to the work where the credit actually belongs to rather than stealing it. You will definitely be insulted when the plagiarism is spotted. So why not place credit and not screw up your reputation? You may have loads of original content. But even a small piece of plagiarised content is capable of bringing you under the spotlight (the recent Ankit Fadia scam for example - Fadia may have saved a war or billions of rupees for the indian government, but now he’s been registered in my mind as the guy who copied a book in the name of authoring it).

To sum up things, The world has evolved, Internet has become commonplace but what will always remain is the human values that we possess. If you copy content without consent, you are violating the human values that morally governs the internet.

Take a stand, Say no to plagiarism, Innovate the planet together!

-Vignesh

Monday, January 10, 2011

InstaShare - Facebook Extension for Google Chrome! :-)

InstaShare - Share everything you find interesting on the web as and when you browse to your Facebook profile! The web you surf daily is now just a single click away from your facebook profile!

This is a mature version of yet another script that i have been using personally so far.

Features include:

  • Post status updates through an always-present browser icon

  • Share any image in the pages you visit in a single click

  • Share any link in the pages you visit in a single click

  • Share any piece of text in the pages you visit in a single click



Download You can download the extension from here: http://www.foamsnet.com/instashare

Screenshots
Sharing Images





Sharing Links





Sharing Selected Text





Posting Status Update




You are sure to find a lot of bugs. Feel free to contact me at vig...@gmail.com (Please click to view the full address) for any bug reports or suggestions!

-Vignesh

Sunday, December 19, 2010

Improved IRCTC Ticket Booking - Google Chrome Extension

*Note: This extension does not work anymore and I have stopped updating it. Please do not contact regards to this*

AutoIRCTC! - A Google Chrome extension that helps in speeding up the IRCTC ticket booking process.

Scripting has always interested me and being a reasonably active member of the internet community, i always tried to customize the road of web i travel to my likes and needs. This is one such script that i thought will be helpful if shared. So i have added minimal features to the script i have been using personally for quite a while now. It has really helped me speed up the ticket booking process.

Features include:
  • Automatic Login
  • Swap from and to stations in a single click
  • See all the trains availability in a single screen
  • Pre-fill the passenger details


Download: You can download the extension from here!

Instructions and Screenshots
  • Accept the warning and click on continue

  • Click on Install

  • After the installation is complete, You will see a confirmation like this:

  • Also, you can view AutoIRCTC in the list of extensions in chrome://extensions
  • Now, when you visit www.irctc.co.in, you will see a small icon next to the bookmark star. Clicking on that icon will give you a pop up where you can configure your settings. If you leave the login credentials empty, then auto login will be disabled. Click on "Save Settings" after you have entered your details.
  • Now, when you reload your page, you will be automatically logged into IRCTC. And instantly, you will be able to notice the "Swap from and to" option under "Plan my travel". This button helps you to swap the from and to cities without making an unnecessary server request.
  • Enter your travel city and date. Now you will be able to see the availability of all trains matching your criteria in a single screen. Also, the page has been cleaned up to now show First class AC and First class (if you are making a first class booking, then disable the extension and go ahead as usual). The default class to check availability for can be changed by clicking the page icon near the bookmark star.
  • Now, in the passenger details form, you can see that it has been pre-filled with your data thereby avoiding your need to type your details every time (Note that pre-filling senior citizen is not supported in this version).
  • The quick book form too will be pre-filled with your data.
  • After these steps, proceed as usual for payment options and complete your ticket booking.


Disclaimer
The purpose of this extension is to increase the ticket booking experience of a common man and it no way intended to be commercial. Using this extension does not guarantee your ticket booking. Its just a minor enhancement to the ugly IRCTC user-interface.

Footnotes
I am still a beginner to the world of Google Chrome extensions. So you are sure to find a lot of bugs. In case of any feedbacks/issues, please write to me at vig...@gmail.com (please click to view the full address).

-Vignesh