Tuesday, May 14, 2013

Groupon, please don't force your users to stereotype themselves.

I recently signed up for Groupon because it generally offers some deals that are of interest to me. While filling out my profile I was confronted with three options:

  1. "Guy"
  2. "Gal"
  3. "I'd rather not"
I thought that was rather enlightened of Groupon, because, well, I'd rather not answer that question. I'm no less interested in stereotypically "gal" deals than I am in stereotypically "guy" deals. To my delight, I began receiving offers in my inbox for both gender stereotypes.

Unfortunately, the Groupon system ultimately didn't appreciate this perceived incompleteness of identity, so I'm forever stuck at 80% complete.


This waste of screen space, and implication that I haven't fully "personalized" my deals, began to annoy me, so I wrote a polite inquiry to Groupon. I don't have the exact text because it was a form submission.
In turn I received a polite reply:

Hi Yuvi,
I'm sorry for the trouble. I am not too sure why it is stuck at 80% but it may certainly be because the gender question has not been answered. I apologize that there is not a way to work around it. Don't worry though, this shouldn't affect the deals you'll see. Also, there are other ways to curtail the interests our site stores for you.
Once you are signed into your account at www.groupon.com, you will see your name at the top right of the deal page. Place your cursor over your name and your account menu will drop down for you to access "My Profile." From there, you can provide more specific information about yourself and select the types of deals that interest you the most. After that, your daily emails will feature more of those deals. Click "Save" when you are finished.
Thanks for your understanding while we work to make the Groupon experience better!
Please let me know if I can help you further.
Regards,
[snip]
Groupon Customer Support
No immediate resolution, but let's all take this as a lesson: please don't force your users to stereotype themselves. That's not "web intelligence," it's just frustration for many of your users. 

Saturday, May 12, 2012

Printing an infinite Stream with Scalaz effects

This one took a ton of help from Runar on Twitter.

Wednesday, August 10, 2011

Functional programming trivia from Scalathon

By popular request, here are the questions and answers from the quizzo at Scalathon. I've formatted them so you can try the questions for yourself! The questions were written by Ben Karel, Randall Schulz, and yours truly. I put the final wording on all the questions, so any mess-ups are my fault alone.

Round 1
  1. What language is most closely associated with the actors model of concurrency?
  2. Who wrote "Purely Functional Data Structures"?
  3. Place the following languages in chronological order, from oldest to newest: Lisp, Fortran, Cobol.
  4. Two of the three primary techniques of giving formal semantics to a programming language are operational and denotational semantics. What is the third of the trio?
  5. What term am I defining? "A tractable syntactic method for proving the absence of certain program behaviors by classifying phrases according to the kinds of values they compute."
Round 2
  1. Can you have functional programming without static typing?
  2. Who invented LISP?
  3. What is the name of the type inference algorithm used by Haskell and ML?
  4. What is the more common name for Schönfinkelization?
  5. What language is CompCert, the formally verified C-compiler written in?
Round 3
  1. Analogy: Types are to values, as kinds are to what?
  2. Some type systems have the feature that a type can depend upon a value. What is that feature called?
  3. Name the co-author of most of the original Lambda papers (his name is the longer one).
  4. According to Tony Hoare, this was "a language so far ahead of its time that it was not only an improvement on its predecessors but also on nearly all its successors." Name the language, which was (almost) based on the fully-typed call-by-value lambda calculus.
  5. Peter J. Landin described the SECD machine in 1963; what language was he defining?
Round 4
  1. What is the difference between a total function and a partial function?
  2. Name the titles of two of the three original "lambda papers"?
  3. Which of these languages is Turing-complete: SQL, The Coq Specification Language, XSLT, XML, JSON, Prolog, Ant.
  4. What common higher-order function implements a catamorphism?
  5. Who quipped that "Syntactic sugar causes cancer of the semicolon."?
Tie-break Round
  1. The quirky bird, thrush, and mockingbird are all names of closed lambda terms, also known as what?
  2. A paper called "Macaroni is better than spaghetti" was published in 1977 on efficient implementation of call stacks. Name the author, who also gave an OOPSLA speech starting only with words of one syllable, and is known for his work on Scheme and Common Lisp, among many other languages.
  3. Peter Landin defined an operator to capture continuations; it shares a name with an array-based functional programming language derived from APL. What was the name of Landin's operator?
  4. Compositional type inference is assured by the property of what?














Round 1 Answers
A1: Erlang, A2: A: Chris Okasaki, A3: Fortran (1956), Lisp (1958), Cobol (1959), A4: axiomatic semantics, A5: "type system"

Round 2 Answers
A1: Yes; A2: John McCarthy; A3: Hindley-Milner [Hindley-Dumas was also accepted. Daniel Spiewak registered his strong protest that the question as worded does not make sense. It confuses type systems and type inference algorithms.]; A4: Currying; A5: Coq

Round 3
Answers
A1: Types; A2: Dependent typing; A3: Gerald Jay Sussman; A4: Algol 60; A5: ISWIM

Round 4
Answers
A1: Partial functions are undefined for some argument values. [Many other answers were accepted since the term "function" is used in many contexts.]; A2: [This question should have been worded differently. We only wanted papers with the words "Lambda the Ultimate" in the title, so any three of these four counted: "Lambda The Ultimate Imperative", "Lambda The Ultimate Declarative", "... Lambda The Ultimate GOTO", "... LAMBDA the Ultimate Opcode"] A3: XSLT, Prolog, Ant; A4: Fold/reduce; A5: Alan Perlis

Tie-break Round
Answers
A1: combinators; A2: Guy Steele; A3: J; A4: principal typings

Wednesday, July 20, 2011

Scalathon 2011 recap

The idea for Scalathon sprang into my head on a Thursday four months ago. Brian Clapper (organizer of the Philly Area Scala Enthusiasts, and the consultant behind ArdenTex) and Jamie Allen (Chariot Solutions) were quickly on board. By Monday we had a website and were actively looking for sponsors and speakers. My primary motivations were, at first, to simply improve the Scala ecosystem and have some fun. Later on, Scalathon planning took on new dimensions as I learned more about the Scala community and development process.

The event started on Friday with Adriaan Moors' talk to Penn's PL Club on Dependent Object Types. Following the talk we had a lunch with the Scalathon attendees, PL Club, and many Penn professors, including the programming languages group (Benjamin Pierce, Steve Zdancewic and Stephanie Weirich). After lunch we launched into a documentation spree run by Scala's new doc czar Heather Miller. She explained the system for contributing documentation on GitHub. Paul Phillips was on hand to promptly merge pull requests.

Unlike most hackathons, Scalathon wasn't a competition. Well, except for Friday night which had a ferocious functional programming quizzo (Philadelphia pub trivia contest) between groups from Scalathon and Philly Lambda. After the normal four rounds, two teams (Daniel Spiewak, Ricky Nilsson, and Runar Oli Bjaranson on team forall a . a, and Daniel Sobral, Iain McGinniss, Pedro Furlanetto, and Seth Tisue on team _|_) were tied for first place. A tie-break round ensued after which forall a . a emerged victorious by one point. (Winning question, Q: Compositional type inference is assured by the property of what? A: Principal typings).

Saturday and Sunday brought the main events, and over 100 developers from Belgium, Brazil, Canada, France, Germany, Russia, Switzerland, Sweden, the United States, and the United Kingdom). In addition to dozens of representatives from major Scala libraries, Typesafe and EPFL sent several representatives each. The format of the event itself was a hybrid of a Scala Days-style conference and a traditional hackathon. At all times there were presentations in the auditorium (Saturday project talks and Sunday Scala enrichment talks) and hacking outside the auditorium. Many attendees told me they were relieved that no one was forced to sit through any particular talk or hack to the point of exhaustion.

Saturday and Sunday also had a few special lunches: Scala community leaders, Scala commercial users, and MongoDB users. Donald Fischer, CEO of Typesafe, flew in from Boston specifically to meet the community and hear from the commercial users. Minutes from these meetings are being expanded and prepared for discussion with EPFL, Typesafe, and the community. Sneak preview: at the community leaders lunch the documentation situation was extensively discussed with Heather, who will be preparing a new centralized, searchable site for the best Scala documentation on the Internet.

I hope Scalathon's lasting accomplishment will be bridge-building. Bridges between community leaders, industry leaders, Typesafe, and EPFL. Although there were plenty of commits, there were innumerably more conversations, plans, jokes, and business cards exchanged that will influence the Scala ecosystem for years to come.

Photos are already up (Friday, Saturday, Sunday). Stay tuned, videos will be up very shortly, to be announced on the scala-announce listserv.

Monday, June 6, 2011

Scala Community Petition

After many discussions with individuals in the community about how to improve the Scala development process, I've decided to create a democratic forum for people to present suggestions.
Please see our Google Moderator page to see suggestions for the Scala core developers. You can make your own suggestions, as well as voting on and replying to others.

The leading suggestions will be discussed with the various Scala insiders who attend Scalathon. Plus the whole Internet.

This is being done in a positive, friendly spirit. Scala needs the community. So let's improve Scala!