Profile

Cover photo
Vinay Kola
Worked at Amazon.com
Attended IIT Kharagpur
Lives in Atlanta, GA
1,104 followers|177,003 views
AboutPostsPhotosYouTube+1's

Stream

Vinay Kola

Shared publicly  - 
1
Add a comment...

Vinay Kola

Shared publicly  - 
 
 
I was asked on Twitter why Python uses 0-based indexing, with a link to a new (fascinating) post on the subject (http://exple.tive.org/blarg/2013/10/22/citation-needed/). I recall thinking about it a lot; ABC, one of Python's predecessors, used 1-based indexing, while C, the other big influence, used 0-based. My first few programming languages (Algol, Fortran, Pascal) used 1-based or variable-based. I think that one of the issues that helped me decide was slice notation.

Let's first look at use cases. Probably the most common use cases for slicing are "get the first n items" and "get the next n items starting at i" (the first is a special case of that for i == the first index). It would be nice if both of these could be expressed as without awkward +1 or -1 compensations.

Using 0-based indexing, half-open intervals, and suitable defaults (as Python ended up having), they are beautiful: a[:n] and a[i:i+n]; the former is long for a[0:n].

Using 1-based indexing, if you want a[:n] to mean the first n elements, you either have to use closed intervals or you can use a slice notation that uses start and length as the slice parameters. Using half-open intervals just isn't very elegant when combined with 1-based indexing. Using closed intervals, you'd have to write a[i:i+n-1] for the n items starting at i. So perhaps using the slice length would be more elegant with 1-based indexing? Then you could write a[i:n]. And this is in fact what ABC did -- it used a different notation so you could write a@i|n.(See http://homepages.cwi.nl/~steven/abc/qr.html#EXPRESSIONS.)

But how does the index:length convention work out for other use cases? TBH this is where my memory gets fuzzy, but I think I was swayed by the elegance of half-open intervals. Especially the invariant that when two slices are adjacent, the first slice's end index is the second slice's start index is just too beautiful to ignore. For example, suppose you split a string into three parts at indices i and j -- the parts would be a[:i], a[i:j], and a[j:].

So that's why Python uses 0-based indexing.
20 comments on original post
1
Add a comment...

Vinay Kola

Shared publicly  - 
 
Time to buy FIFA 14. But after my NLP mid-term tomorrow.
1
Add a comment...

Vinay Kola

Shared publicly  - 
 
This + the teaser trailer for Arkham Origins make me wanna play Arkham City on the PS3 right now! #ArkhamOrigin #PS3  
2
Sneha Polam's profile photo
 
oh hi
Add a comment...

Vinay Kola

Shared publicly  - 
 
The Verge's exclusive on Hangouts, which personally could be the one announcement from yesterday that I will use the most. #googleio  
1
1
Gaurav Rathi's profile photo
Add a comment...

Vinay Kola

Shared publicly  - 
 
Highlights of Google I/O for me:
* The new IDE for Android dev - I've been looking for an excuse to try my hand at an Android app again, and I think I've got mine.
* Hangouts - This is major for me. A lot of my communication is split between Whatsapp, GTalk and FB Messenger. A little homogeneity would be nice, but it will be tough to convince my friends to move over from WhatsApp. Let's see how this plays out.
* The Samsung Galaxy S4 "Nexus" - I'm really tempted to get this one. I'll be in the USA from August onwards, and the promise of awesome hardware + prompt updates might be too much to ignore. $649 ain't too much when you consider it costs Rs 41k in India.
* Google+  - The redesign is insanely cool, but once again, my friends aren't on it so it doesn't really matter much. Similarly with photos, I don't really take that many so although the enhancements are really cool, it's not something that I'll be using frequently.
* Play Music - All Access seems like a really good discovery/listening service , but I'll have to wait till I'm in the USA to judge. I'm loath to pay any money till I start earning though.
1
Add a comment...
Have him in circles
1,104 people
Atish Munje's profile photo
Adam Brinckerhoff's profile photo
M.S Zaman's profile photo
Zeel Goti's profile photo
Rishabh Ambasta's profile photo
Lee Gimenez's profile photo
Ally Lwimo's profile photo
Karthik Kongara's profile photo
Prasanna Royyuru's profile photo

Vinay Kola

Shared publicly  - 
 
Google's AutoAwesome is pretty awesome! 
1
Add a comment...

Vinay Kola

Shared publicly  - 
 
One of the many awesome posters in my room. 
6
Add a comment...

Vinay Kola

Shared publicly  - 
 
Just discovered a bug in Google Talk/ Hangouts. +Gmail, are you listening?

My friend, Karthikeyan, tried to send an IM to me, but it ended up going to a totally different person. As you can see in the first pic, he messaged me saying
"fgfsa
there's something wrong with my gtalk
dont mind"

But the Hangouts history shows that those IMs went to Aman Haji instead. Surprisingly they don't show up in his GTalk window. His reply saying "Haha Ok" shows that the message has indeed shown up on his side.

The second pic is just more proof of the same bug. This time GTalk sends the message to a totally different person.
The IM "mastered R" ends up going to Vijay Bhaskar instead of me.

This problem exists whomever he tries to contact, not only me. Also, he is using the old version of Google Talk. He hasn't upgraded to Google Hangouts yet.

This is a serious privacy breach on GMail's end and could have serious repercussions. My guess is that the recent updates to Hangouts could have caused some unknown bug. 
9
1
Parag Oak (PO)'s profile photoVinay Kola's profile photoGazal Garg's profile photoRuslan Zakharov (ruX)'s profile photo
3 comments
 
Happened with me today in office.
Add a comment...

Vinay Kola

Shared publicly  - 
 
Yes! I can finally upload my own e-books into the Google Play Books app. I just wish they would sync with my Kindle. Too much to hope for, I know.
Google has more to offer when you sign in to your Google Account. Sign in on the right or create an account for free. Gmail. Chat with friends and never miss an important email. Personalized Search. Get more relevant results based on your past searches. Like Google? Make Google your homepage.
1
Add a comment...

Vinay Kola

Shared publicly  - 
 
Whoa. This could be the new "Princess Leia in the Golden Bikini".
 
"Game of Thrones: Daenerys" Mother of Dragons

Mostly a test to see if +Google+ has still messed up photo sharing.. 

(sauce=http://shilesque.deviantart.com/)
75 comments on original post
2
Sneha Polam's profile photo
 
wut
Add a comment...
People
Have him in circles
1,104 people
Atish Munje's profile photo
Adam Brinckerhoff's profile photo
M.S Zaman's profile photo
Zeel Goti's profile photo
Rishabh Ambasta's profile photo
Lee Gimenez's profile photo
Ally Lwimo's profile photo
Karthik Kongara's profile photo
Prasanna Royyuru's profile photo
Work
Occupation
Student
Employment
  • Amazon.com
    SDE Intern, 2012 - 2012
  • Ozonetel Systems Pvt. Ltd
    Summer Intern, 2011 - 2011
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Currently
Atlanta, GA
Previously
Hyderabad, Andhra Pradesh - Kharagpur, West Bengal - Alameda, CA - Nashua, NH - Waterloo, Canada - Bangalore, Karnataka
Story
Tagline
Grad Student @ GeorgiaTech
Introduction
I'm a graduate student at Georgia Institute of Technology, interested in Machine Learning and Big Data.

Did my undergrad in Computer Science and Engineering at Indian Institute of Technology - Kharagpur.

I'm a technophile, football maniac (Glory Glory Man Utd!) and and a music lover too.
Bragging rights
Can juggle a football for as long as I want.
Education
  • IIT Kharagpur
    Computer Science and Engineering, 2009 - 2013
  • Georgia Institute of Technology
    Computer Science (Machine Learning), 2013 - 2014
  • FIITJEE Junior College
    Intermediate, 2007 - 2009
  • The Brigade School
    2004 - 2007
  • Hyderabad Public School
    2000 - 2004
Basic Information
Gender
Male
Relationship
Single
Apps with Google+ Sign-in
Vinay Kola's +1's are the things they like, agree with, or want to recommend.
Slingshot
market.android.com

Slingshot lets you quickly share moments—little and big—with lots of people at once. Shoot a photo or video of what you’re up to and sling i

Maps
market.android.com

The newly designed Google Maps app for Android phones and tablets makes navigating your world faster and easier. Find the best spots in town

Software in 2014
www.tbray.org

We’re at an inflection point in the practice of constructing software. Our tools are good, our server developers are happy, but when it come

SwiftKey Keyboard
market.android.com

Celebrating the winter holidays with Google Play!SWIFTKEY - THE MIND-READING KEYBOARD No.1 best-selling app in 58 Google Play countries, ove

MakeUseOf
plus.google.com

Cool Websites, Tools And Internet Tips

Why Free Software Is More Important Now Than Ever Before | Wired Opinion...
www.wired.com

GNU just turned 30 years old. But much has changed since the beginning of the free software movement; now there's SaaS and more. Malware is

Wunderlist - To-do & Task List
market.android.com

Wunderlist is the easiest way to manage and share your daily to-do lists. Whether you’re running your own business, planning an overseas adv

On a Song of Ice and Fire!
musingsofadream-wingedrookie.blogspot.com

The dark brown furnishings and the dim, dull orange lights adorn the popular hangout for jaunty friends, somnolent students, workaholics, li

Hangouts (replaces Talk)
market.android.com

Hangouts brings one-on-one and group conversations to life with photos, emoji, and video calls for free. Connect with friends across compute

Tasks
market.android.com

Tasks brings the full Google Tasks experience to Android. * Sync with Google Tasks at the core * Sync with Google Tasks is not just another

Gmail
market.android.com

Gmail is built on the idea that email can be more intuitive, efficient, and useful. And maybe even fun. Get your email instantly via push no

End Piracy, Not Liberty – Google
www.google.com

Millions of Americans oppose SOPA and PIPA because these bills would censor the Internet and slow economic growth in the U.S.. Two bills bef

Web Upd8: Ubuntu / Linux blog
www.webupd8.org

WebUpd8 is an Ubuntu / Linux blog which delivers daily news, tips and application reviews. We follow the Ubuntu and GNOME development and ke

Google+ - Apps on Android Market
market.android.com

Real-life sharing rethought for the web, wherever you are. Google+ for mobile makes sharing the right things with the right people a lot sim

Fruit Ninja Free
market.android.com

The worldwide smash hit Fruit Ninja is now on Android for FREE! Fruit Ninja is a juicy action game with squishy, splatty and satisfying frui

Machine Learning
www.ml-class.org

Honor Code. All students participating the class must agree to abide by the following code of conduct: I will only register for one account.

Google Plus Email App
apps.wisestamp.com

Share your latest Google+ updates and allow people to circle and follow you.

Any.DO: To Do List | Task List - Apps on Android Market
market.android.com

Any.DO Is a Crazy Intuitive, Gesture-Based To-Do App for Android (lifehacker) Any.DO is a free to-do list that helps you get things done wit

Twitter
market.android.com

Official Twitter app for Android. Follow your interests: instant updates from your friends, industry experts, favorite celebrities, and what

Google Now Commands for Jelly Bean Android 4.1 | Kickedface
www.kickedface.blogspot.in

Google Now tells you today's weather before you start your day, how much traffic to expect before you leave for work, when the next train wi