Scott Hanselman

There is only one Cloud Icon in the Entire Universe

October 16, '11 Comments [45] Posted in Apple | Musings
Sponsored By

I recently worked on the update to the ASP.NET site, now in beta at http://beta.asp.net. On that site we used an icon from the Pictos collection. I have an email from March of 2010 where we selected that icon, in fact.

Recently we updated the old site's cloud icon from this, to this:

Old ASP.NET Cloud IconNew ASP.NET Cloud Icon

I saw a few tweets and got some emails that said "nice iCloud icon." Well, it does look familiar! ;)

iCloud Icon

Of course, MobileMe before this:

Mobile Me Icon

I knew I'd see this icon somewhere before. Folks have even written articles talking about how beautiful this icon is and how the Golden Ratio is infused in its design. There are even tutorials written on how to create the icon from scratch in PhotoShop.

iCloud Icon Golden Ratio

Apple's logo artists have infused the iCloud logo with some mathematical elegance. In this case, the golden ratio or φ...Simple, but profound. Awesome Apple's design philosophy.

Funny thing about the Golden Ratio, if you look for it, you'll find it everywhere. Read about it in the book "The Golden Ratio: The Story of PHI" or watch this video on the Golden Ratio.  It's intuitive. Cool, also that they attribute this icon and it's "brilliance" to the Apple Designers, except the icon isn't from Apple, it's straight from Pictos 1. I know, because we bought it from them for our site. Plus Pictos 1 has been around for years. It includes a regular cloud, clouds with arrows up and down and a lightening bolt cloud.

Pictos - The Original iCloud Icon

Of course, there's only so many ways to draw a cloud, right? But somehow this one just nails it and is itself iconic, if you'll excuse the pun.

Where else might you have seen this cloud icon? Seems everyone with an internet-connected or music app uses it:

Another app using the same cloud iconYet another app using the same cloud icon

Just a few...

Daum Cloud UtilitiesCloud 2 Go

Dreams ControllerCloud of Inspirations

Cloud WalletCosa Icon

Zendit iconWiFi Fast Connect

iStorage IconSound Cloud Icon

Even though the first appearance of this cloud icon was in the commercial Pictos 1 set, you'll find suspiciously similar clouds in other cloud icons packs like the one at Yay.se that's Creative Commons. Notice that you can change the look of the cloud icon slight if you the circles smaller or larger or add a border, push and pull, or squish and stretch.

More clouds!

But again, it's essentially four circles. My 3 year old draws similar clouds. At what point does a unique design stop being unique and just absorb into the consciousness?

Today, it seems there is only one cloud icon in the universe and it's four circles with a flat base. I like it.

UPDATE: Hat tip to Ian Griffiths who points out that the BBC Weather Service beat all of us to the iCloud icon, kind of...over 30 years ago. ;)

iCloud - BBC Style, 30 years ago

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

The Weekly Source Code 59 - An Open Source Treasure: Irony .NET Language Implementation Kit

October 14, '11 Comments [19] Posted in Learning .NET | Open Source | Source Code
Sponsored By

Select Grammars Dialog in Irony filled with grammarsOne of the best, if not the best way to sharpen the saw and keep your software development skills up to date is by reading code. Sure, write lots of code, but don't forget to explore other people's brains code. There's always fifteen different ways to create a "textboxes over data" application, and while it's interesting to take a look at whatever the newest way to make business software, sometimes it's nice to relax by looking at some implementations of classic software issues like parsers, lexers, and abstract syntax trees. If you didn't go to school or failed to take a compilers class at least knowing that this area of software engineering exists and is accessible to you is very important.

It's so nice to discover open source projects that I didn't know existed. One such project I just stumbled upon while doing research for a customer is "Irony," a .NET language implementation kit. From the CodePlex site:

Irony is a development kit for implementing languages on .NET platform. Unlike most existing yacc/lex-style solutions Irony does not employ any scanner or parser code generation from grammar specifications written in a specialized meta-language. In Irony the target language grammar is coded directly in c# using operator overloading to express grammar constructs. Irony's scanner and parser modules use the grammar encoded as c# class to control the parsing process. See the expression grammar sample for an example of grammar definition in c# class, and using it in a working parser.

Irony includes "simplified grammars for C#, Scheme, SQL, GwBasic, JSON and others" to learn from. There are different kinds of parsers that are grammar generators you might be familiar with. For example, ANTLR is a what's called a LL(*) grammar generator, while Irony is a LALR (Look Ahead Left to Right) grammar generator.

Here's a very basic SQL statement for getting a show from my Podcast database:

SELECT ID, Title FROM Shows WHERE ID = 1

Here's the Irony Parse Tree as viewed in the irony Grammar Explorer:

A complete parse tree of the SQL statement with every node expanded

Typically, in my experience, when creating a parser one will use a DSL (Domain Specific Language) like the GOLD Meta Language building on the BNF (Backus-Naur Form) expression grammar. These domain specific languages are tightly optimized to express exactly how a language is structured and how it should be parsed. You learn a language to create languages.

Remember in the Irony intro text earlier? Let me repeat:

Unlike most existing yacc/lex-style solutions Irony does not employ any scanner or parser code generation from grammar specifications written in a specialized meta-language. In Irony the target language grammar is coded directly in c# using operator overloading to express grammar constructs.

What Roman from Irony has done here is use C# language constructs as if it's a DSL. A fluent parser, as it were. So he's using C# classes and methods to express the language grammar. It's a very interesting and powerful idea if you are interested in creating DSLs but not interested in learning other parsers like GOLD. Plus, it's just fun.

The Irony Grammar Explorer

He has a very rich bass class called Grammar that you derive from, like:

[Language("SQL", "89", "SQL 89 grammar")]
public class SqlGrammar : Grammar {
public SqlGrammar() : base(false) { //SQL is case insensitive
...

But instead of a grammar language like this (simplified by me) to express a SQL SELECT Statement:

! =============================================================================
! Select Statement
! =============================================================================
<SELECT Stm> ::= SELECT <COLUMNS> <INTO Clause> <FROM Clause> <WHERE Clause>
<GROUP Clause> <HAVING Clause> <ORDER Clause><COLUMNS> ::= <RESTRICTION> '*' |
<RESTRICTION> <COLUMN List>...snip for clarity...<RESTRICTION> ::= ALL |
DISTINCT |<AGGREGATE> ::= Count '(' '*' ')' | Count '(' <EXPRESSION> ')' |
Avg '(' <EXPRESSION> ')' | Min '(' <EXPRESSION> ')' | Max '(' <EXPRESSION> ')' |
StDev '(' <EXPRESSION> ')' | StDevP '(' <EXPRESSION> ')' | Sum '(' <EXPRESSION> ')' |
Var '(' <EXPRESSION> ')' | VarP '(' <EXPRESSION> ')'<INTO Clause> ::= INTO Id |
<FROM Clause> ::= FROM <ID List> <JOIN Chain><JOIN Chain> ::= <JOIN> <JOIN Chain> |
...snip for clarity...

You'd have something like this instead, again, simplified so this doesn't turn into a giant listing of code rather than a blog post.

//Select stmt
selectStmt.Rule = SELECT + selRestrOpt + selList + intoClauseOpt + fromClauseOpt + whereClauseOpt + groupClauseOpt + havingClauseOpt + orderClauseOpt;
selRestrOpt.Rule = Empty | "ALL" | "DISTINCT";
selList.Rule = columnItemList | "*";
columnItemList.Rule = MakePlusRule(columnItemList, comma, columnItem);
columnItem.Rule = columnSource + aliasOpt;aliasOpt.Rule = Empty | asOpt + Id;
asOpt.Rule = Empty | AS;columnSource.Rule = aggregate | Id;
aggregate.Rule = aggregateName + "(" + aggregateArg + ")";
aggregateArg.Rule = expression | "*";
aggregateName.Rule = COUNT | "Avg" | "Min" | "Max" | "StDev" | "StDevP" | "Sum" | "Var" | "VarP";
intoClauseOpt.Rule = Empty | INTO + Id;fromClauseOpt.Rule = Empty | FROM + idlist + joinChainOpt;
joinChainOpt.Rule = Empty | joinKindOpt + JOIN + idlist + ON + Id + "=" + Id;
joinKindOpt.Rule = Empty | "INNER" | "LEFT" | "RIGHT";
whereClauseOpt.Rule = Empty | "WHERE" + expression;
groupClauseOpt.Rule = Empty | "GROUP" + BY + idlist;
havingClauseOpt.Rule = Empty | "HAVING" + expression;
orderClauseOpt.Rule = Empty | "ORDER" + BY + orderList;

Here the variables and terms that are being use to build the grammar were defined earlier like this, as an example:

var SELECT = ToTerm("SELECT"); var FROM = ToTerm("FROM");var AS = ToTerm("AS"); 

You might immediately declare, Dear Reader, that this is blasphemy!  How can C# compete with a specialized DSL like the BNF? This is a C# shaped peg being shoved into a round hold. Well, maybe, but it's interesting to point out that the SQL GOLD Grammar is 259 lines and the C# version of essentially the same thing is 247 lines. Now, I'm not pointing out line numbers to imply that this is a better way or that this is even a valid 1:1 comparison. But, it's interesting that the C# class is even close. You might have assumed it would be much much larger. I think it's close because Roman, the Irony developer, has a very well factored and specialized base class for the derived class to "lean on." Each of his sample grammars are surprisingly tight.

For example:

  • "Mini" Python - ~140 lines
  • Java - ~130 lines
  • Scheme - ~200 lines
  • JSON - 39 lines

To conclude, here's the JSON grammar generator. 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Irony.Parsing;

namespace Irony.Samples.Json
{
[Language("JSON", "1.0", "JSON data format")]
public class JsonGrammar : Grammar
{
public JsonGrammar()
{
//Terminals
var jstring = new StringLiteral("string", "\"");
var jnumber = new NumberLiteral("number"); var comma = ToTerm(",");

//Nonterminals
var jobject = new NonTerminal("Object");
var jobjectBr = new NonTerminal("ObjectBr");
var jarray = new NonTerminal("Array");
var jarrayBr = new NonTerminal("ArrayBr");
var jvalue = new NonTerminal("Value");
var jprop = new NonTerminal("Property");
//Rules
jvalue.Rule = jstring | jnumber | jobjectBr | jarrayBr | "true" | "false" | "null";
jobjectBr.Rule = "{" + jobject + "}";
jobject.Rule = MakeStarRule(jobject, comma, jprop);
jprop.Rule = jstring + ":" + jvalue;
jarrayBr.Rule = "[" + jarray + "]";
jarray.Rule = MakeStarRule(jarray, comma, jvalue);
//Set grammar root
this.Root = jvalue; MarkPunctuation("{", "}", "[", "]", ":", ",");
this.MarkTransient(jvalue, jarrayBr, jobjectBr);
}
}
}

Pretty clever stuff, and a well put together project and solution that is well structured. I could myself using this in a C# or Compiler class to teach some of these concepts. It's also a great little tool for creating small languages of your own. Perhaps you have a Wiki-dialect that's specific to your company and you want to get rid of all that nasty manual parsing? Or many you have an old custom workflow engine or custom expression system embedded in your application and never got around to changing all your parsing to a proper grammar? Maybe now is the time to get that little language you've been thinking about off the ground!

I encourage you, Dear Reader, to support open source projects like this. Why not go leave a comment today on your favorite open source project's site and just let them know you appreciate what they're doing?

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Just please comb their hair and wipe their noses - My month as a single dad

October 11, '11 Comments [53] Posted in Musings | Parenting
Sponsored By

OnomatopoeiaThis month I've definitely realized that intellectualizing something is different from actually living it. I've been a single dad for the last 24 days. My wife has been in South Africa attending a family wedding and visiting friends while I've been alone with our two boys, ages three and five. It's been an experience, to the say the least. I decided to take half-time vacation and worked 10am - 2pm while the boys were in school.

Other than my obligatory 4 hours of deleting email work it was all home-making and kids for me. Who knew that single parenting is so hard? There were the first few days of "this is new," followed by "when is Mommy coming back," and the inevitable "so this is what life is like without Mommy." Definitely an emotional roller coaster for everyone.

Then there seemed to be a series of phases I went through, not unlike the phases of grief.
Shock - This phase includes disbelief and numbness. What am I gonna do? Gotta make sure the boys get to school each day. I have to sleep well, don't want to burn out too early.

  • Denial - After a few 3am surprise wake-up calls and obligatory potty emergencies, one tends to find themselves overwhelmed.
  • Bargaining - Just sleep through this one night and...
  • Guilt - Oh, I'm a horrible parent, the boys were late for school today.
  • Anger - This is so frustrating. Just do what I say and everything will go fine.
  • Depression - This totally sucks, how does anyone do this without help?
  • Acceptance - OK, I've got this. Maybe not the laundry, but lunches and playtime, I've got that down solid.

Death by a Thousand Tiny Cuts

Sometimes in a marriage (with kids) one tends to assume that their job to see the hardest. The thing is though, each role fulfilled by each spouse is different. The thing I learned about single parenting is that it's truly incessant. By that I mean specifically "it never ceases." Taken individually the tasks involved aren't difficult: make lunch, do laundry, buy food, but the problem is - it never stops. Just because I made meals and cleaned up all day yesterday doesn’t mean I don’t get to do it again today. And tomorrow. And the day after that...There's no credit to be brought forward for doing well yesterday: the clock resets, and it starts all over.

It seems that single parenting is the ultimate project management job. Every day included not the dozens of daily details that keep a house running but another dozen irregular details that were challenging to keep track of. I keep a lot of lists and notes and to-dos in my day job, but I had 4x the lists and notes and to-dos in this new single-parent job.

Playing to my strengths

One of the most significant things I learned about myself is to play to my strengths. While I may not be very good at remembering whose hair is combed or to wipe noses, I'm pretty good at teaching. I worked with the 5-year old who has been a little stalled at sounding words out. Turns out he's just bored with the material. Seems that "See Spot Run" isn't as interesting as "Batman." I found some age-appropriate comics (no guns, easier stories) and rather than trying to get him to read the dialog of the comics we focused entirely on the onomatopoeia action words. After doing this for a week I discovered that using comic books to teach onomatopoeia is a real thing that's done in schools. Cool!

The Good and the Bad

A good friend of my got divorced a few months ago. He made a large purchase and mentioned said to me,

"You know what the best part was? Not having to ask permission before making the purchase. And the worst part? The same."

That's a powerful and profound statement right there. It really stuck with me and totally applied in my month alone. On the one hand, it was really enabling and empowering to be able to change the system. We ate what we wanted (it was still good food, just what I wanted) and did what we wanted (zoo, museums, etc.) It wasn't that we didn't do these things when my wife is here but the point is, there's just one less adult voting. It felt like things went more smoothly, probably because any debates happened in my own head. It was nice to just decide things.

On the down side, there's no one around to brainstorm with. And there's no break at 3am. Or 4am. Or 5:30am. I don't know how single parents get a break, especially if they don't have family to lean on.

If it works, keep it. If it doesn't, change it

Now that the wife is back, we're going to look at some of the systems that I came up with and combine them with the existing ones that she had going. The goal is for neither of us to burn out doing our jobs. I think each person in a partnership tends to get hyper-focused on the task in front of them and forget the stresses on the other partner. Both of us have jobs that "never stop." We can't turn off and focus on something else just because it’s after 5pm. I really enjoyed my time with the boys as a single parent, and hope I never have to do it again any time soon!

The Customers (Kids) Don't Care

Another fascinating part to this was the complete ambivalence and amazing resilience of the children. While they were sad after Mommy was gone, a few days later "the new normal" become clear and they were back to business. I was a wreck, of course, but the kids didn't miss a beat. Their inherent wonderful "childish selfishness" remains intact, as it should. "What? Mom's gone? Ok, so are you the one making sandwiches now? Service! There's only one waiter in this lousy restaurant?"

Reintegration

I appreciated that my wife didn't just fly in, raise the landing gear and immediately take over the whole ecosystem. The boys and I had a good thing going and found a kind of equilibrium. A snotty nosed, wrinkled clothed, uncombed equilibrium, but equilibrium nonetheless. (Dad's skills lie elsewhere. Their pants were on straight 85% of the time, so I take full credit for that success!) My wife recognized that she was returning to a new house with new rules and we have spent the last few days talking about what worked, what didn't and what things we discovered while she was gone that we might want to keep.

Walk a Mile

It's certainly hard to be judgmental of any single parent when you've been one. We've all seen a single mom or dad walking around and wondered "where's the other partner?" Well, who knows, maybe in Africa, but you can bet that the one left is working hard.

I was explaining how college degrees work to the kids as we drove my a university this morning.

Me: "...Well, Mommy has a Master's Degree, she's very smart."

3: "Where is it?"

Me: "What?"

3: "The master."

Me: "It's on the wall in the office."

3: "Why don't you have one of those smartie things that mommy has?"

This made me remember that my wife has taken time off from one career to make the kids her career for a few years. I definitely understand my wife's job better after this month.

Behind every great man is a woman who is not impressed. - Me on twitter

Now I just need to figure out how to get her to do my job for a month so she'll appreciate how hard it is to tweet and restart Outlook! ;)

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

410 Gone - Thoughts on Mark "diveintomark" Pilgrim's and _why's infosuicides

October 10, '11 Comments [66] Posted in Blogging | Musings
Sponsored By

Developer Tools - http___diveintomark.org_ (88)I don't know Mark Pilgrim personally. I only know his work and it's excellent. I knew of him first from his Dive Into Accessibility almost a decade ago and later from his other "Dive Into" books that educated a young generation on Python, and most recently HTML 5.

Mark is alive, but online he's gone. He committed "infosuicide" last week. All of his websites are Gone. That's capital G, Gone. Not 404, Not Found, but the not-often-used HTTP Status 410. And this is where it gets concerning to me.

HTTP Status 410 states per the spec with emphasis mine:

Indicates that the resource requested is no longer available and will not be available again. This should be used when a resource has been intentionally removed and the resource should be purged. Upon receiving a 410 status code, the client should not request the resource again in the future. Clients such as search engines should remove the resource from their indices. Most use cases do not require clients and search engines to purge the resource, and a "404 Not Found" may be used instead.

As it says, most use cases don't call for removal from a search engine, but in this case, Mark literally and figuratively "took his ball and went home," no longer interested in playing.

The first major "infosuicide" of note was that of whytheluckystiff, author of Why's Poignant Guide to Ruby. No one knows why _why left, but a tweet just before he left said:

programming is rather thankless. u see your works become replaced by superior ones in a year. unable to run at all in a few more.

Perhaps one can glean some meaning from that. In a similar vein, in 2008 Mark blogged on minimalism and then before Twitter existed Mark Pilgrim blogged (almost 7 years ago this month) a microblogpost, preserved via the Wayback Machine:

It’s time for me to find a new hobby. Preferably one that doesn’t involve angle brackets. Or computers. Or electricity.

Why do I care? I'm exploring this as someone who has been blogging publically and effectively nonstop since 2002. That's almost a decade, Dear Reader. For me to leave, either willingly or unwillingly, after putting so much useful (presumably, says my ego) information out there would be one thing. But to leave AND remove all that information, declaring it Gone and asking that it no longer be indexed seems, on the surface, to be a selfish act.

I realize it costs money to keep a website up but it's typically not a crushing expense. If one wanted to retreat from online life (as I sometimes do) one could add a banner to their existing sites that says something like "I'm taking a break and teaching high school" or "I've become a non-technical ER nurse" or "I've opened a hair salon" (each has been a one-time fantasy job for me) and setup an email auto-responder. This extraction from being online wouldn't take more than a week of prep and would be perceived as a much classier - although not as dramatic - move than a disappearance hinging on an HTTP status code.

Even so, Erik Meyer quotes Mark in a 2003 post:

"Embracing HTTP error code 410 means embracing the impermanence of all things."
- Mark Pilgrim, March 27, 2003 (diveintomark.com)

That's an accurate albeit mighty metaphysical reading into the HTTP spec. Do bloggers/teachers/infopublishers have the right to leave the community? Of course. Do we have the right to control, and ultimately remove our content? Surely. But to put so much information out and to remove it seems unnecessary. Is it to much to ask to maintain ones own archive, if only for a little while?

I've always said two things. First, respect the permalink. Second, don't give bile a permalink. While a 410 isn't bile, it's not the most respectful way to disappear.

Reading into Mark's blog, it's obvious that being on the web didn't feed his spirit. It does leave one to wonder, when you pass on, will you be mirrored or just 410 Gone?

Gone

The requested resource /
is no longer available on this server and there is no forwarding address. Please remove all references to this resource.

I truly wish Mark all the best in his disconnected life, as I do anyone else who wants to disconnect. If they come back, we'll be here.

Mirrors of Mark "diveintomark" Pilgrim's Work

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

RFC: New Beta.ASP.net website

October 10, '11 Comments [55] Posted in ASP.NET | ASP.NET MVC
Sponsored By

http://beta.asp.net Before I worked for the ASP.NET team as I do now, I worked for MSDN. While I was over there, part of my time was spent working on the http://asp.net team. I led the charge to move the site over to Umbraco, and we did. Over the last two years, we have continually made improvements to the .NET (asp.net, silverlight.net, windowsclient.net) sites. In July, the MSDN team announced the release of a new Silverlight site, and today I'm happy to announce the Beta launch of a redesigned ASP.NET website at http://beta.asp.net.

This redesign is still a work in progress, but we wanted everyone to see where we are heading with not just a new look and feel, but also improved organization and navigation that will hopefully make content easier to find. We'll be collecting feedback on UserVoice.

What's new with the redesign

You'll notice that the top-level navigation is similar to the current site (http://www.asp.net/) to keep the familiarity, however we have significantly improved the site design and navigational framework around Learn and Community content in an effort to make it easier to discover and find information on the site. The issue is that there's piles of great content on the site but it's hard to find. Here are some highlights of the redesign:

  • A newer Information Architecture (IA) that scales with different types of content. Trying to get you somewhere useful quickly.
  • Content organized into relevant topic areas (Overview, Videos, Tutorials, etc.) to make information easier to find and to learn a technology.
  • Improved on boarding experience – Developers new to ASP.NET should find it easier to get started and download what they need.
  • Important Samples and Tutorials are positioned prominently in the structure of the site so that they are easier to find.
  • Textual Tutorials are as important as videos - We've heard people want text tutorials more than videos, so we're finding balance between these two kind of content.
  • Improved Social Integration – Community info, pulling from Twitter, Facebook and blogs.
  • A less cluttered user experience to get you where you need to go in fewer clicks.
  • Open Source and Samples - We're looking for new ways to showcase great open source projects and excellent samples.

Next Steps

Not all the content and features are in place yet! The ASP.NET Website team will continue to iterate over the information architecture, layout, and content (with lots of new video and text content) in the coming weeks, and we are targeting to launch the final site by the end of November.

I know, more than anyone, that the #1 piece of feedback has been that folks don't like the ads. You don't need to tell me, as you're preaching to the (powerless) choir. Instead, make yourself heard - both positive and negative - at the ASP.NET Website section of our User Voice site.

I hope you like the site and find it useful. It's at http://beta.asp.net.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.