Profile

Cover photo
Fulvio Casali
Lives in Seattle, USA
649 followers|30,607 views
AboutPostsPhotosVideos+1'sReviews

Stream

Fulvio Casali

Shared publicly  - 
 
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists.
1
Add a comment...

Fulvio Casali

Shared publicly  - 
1
Add a comment...
 
Thank you, I so need this!
 
nice progress, I see Alin at 200% here ;)
a plone must must have add-on, very nice.
3
1
Rosario Savarese's profile photodavide moro's profile photo
 
Wow, thank you guys!
Add a comment...

Fulvio Casali

Shared publicly  - 
 
Plone Conference 2013
Wed, October 2, 2013, 8:00 AM
1
 
This is ESAF, the training venue for #ploneconf  
1
Add a comment...
Have him in circles
649 people
Rosario Savarese's profile photo
Alex Tokar's profile photo

Fulvio Casali

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.
1
Jesse Snyder's profile photo
 
"split a string into three parts at indices i and j -- the parts would be a[:i], a[i:j], and a[j:]" - that's a great mnemonic for remembering how slice indexes work (which I have never been able to remember!)
Add a comment...

Fulvio Casali

Shared publicly  - 
 
Escola de Administração Fazendária - School of finance administration, Brasilia
http://www.esaf.fazenda.gov.br/a_esaf/institucional/esaf-40-anos/esaf-2013-40-anos-uma-historia-de-muitas-realizacoes
1
1
Fulvio Casali's profile photo
Add a comment...
People
Have him in circles
649 people
Rosario Savarese's profile photo
Alex Tokar's profile photo
Work
Occupation
Activist Software Engineer
Basic Information
Gender
Male
Story
Tagline
Plone developer
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Currently
Seattle, USA
Previously
Genova, Italy - Livorno, Italy - Düsseldorf, Germany - Manhattan, Kansas
Links
Other profiles
Contributor to
Fulvio Casali's +1's are the things they like, agree with, or want to recommend.
Google Voice - Apps on Android Market
market.android.com

Make cheap international calls with your Google number. Send free text messages. Place calls and send text messages showing your Google numb

Google I/O 2012: Integrating Google+ Into Mobile Apps
developers.google.com

Create a more engaging and personalized experience for your users by incorporating aspects of Google+ into your mobile app. Learn how your u

Google I/O 2012: Getting More from the Google+ Platform
developers.google.com

You've implemented some Google+ platform features and now you want more. Learn the how, why, and measurement of increasing engagement on you

Version and availability : Getting started - Google Mobile Help
www.google.com

Version This topic describes Gmail version 2.3.5 for Android version 2.2 (Froyo) or 2.3 (Gingerbread). You can determine your version of Gm

Euro2012
plus.google.com

Euro2012, football, soccer, Twitter, live, streams, participate, join

'2012': Genki Sudo's World Order Puts Out New Track With Trademark Robot...
www.huffingtonpost.com

Former mixed-martial-arts master Genki Sudo once again applied his unconventional moves to his band's latest music video, "2012." World Orde

Rick Santorum's Anal Sex Problem
motherjones.com

Why Rick "Man on Dog" Santorum can't beat his Google troubles.

Kim by Rudyard Kipling
www.gutenberg.org

Project Gutenberg offers over 36,000 free ebooks to download to your PC, Kindle, Nook, iPad, iPhone, Android or other portable device.

MarineTraffic.com - Apps on Android Market
market.android.com

Real-time ships positions based on Automatic Identification System (AIS). Watch the positions reported by more than 35000 vessels per day on

doe bay resort and retreat on orcas island
www.doebay.com

A relaxing waterfront resort on thirty-three acres in the San Juan Islands, with rustic cabins, yurts, and campsites.

Global Warming's Terrifying New Math | Politics News | Rolling Stone
www.rollingstone.com

Three simple numbers that add up to global catastrophe - and that make clear who the real enemy is

Marinette Marine Launches the Reuben Lasker Research Ship [VIDEO]
gcaptain.com

YouTube Preview Image. This past weekend, Marinette Marine Corporation (MMC), a Fincantieri company, launched the Reuben Lasker, a fisheries

Exploring “Adjacent Markets”, Teekay Floats Entry In Offshore Wind Insta...
gcaptain.com

At it's annual Investors Day event held in New York City Monday, Teekay Corporation announced its ambitions to enter the offshore wind indus

Samsung Galaxy S3 International Giveaway #2
www.androidauthority.com

Following the blowout success of our first Samsung Galaxy S3 giveaway, we decided to set up a new sweepstakes. You can now win another S3!

Gaping Void Art
www.gapingvoidart.com

11x14 Limited Edition Printed on acid free, textured fine art paper 330 gsm

TripCase - Apps on Android Market
market.android.com

The smartest travel app in the world! Named "Best Travel App" by Business Week. Named “Best Travel App” by Business Week, featured

Harvest Time Tracker - Apps on Android Market
market.android.com

Track time and expenses the easy way on an Android device. Track time and log expenses on-the-go with Harvest, whether you're online or offl

OneBusAway - Apps on Android Market
market.android.com

Real-time transit information for the Puget Sound region and beyond. Never miss the bus again! OneBusAway gives you real-time arrival infor

Food: Very goodDecor: Very goodService: Excellent
Public - a year ago
reviewed a year ago
My favorite Sunday breakfast place. I like dinner there, too.
Public - a year ago
reviewed a year ago
3 reviews
Map
Map
Map
The friendliest barista ever.
Public - 2 years ago
reviewed 2 years ago