Chrome Doesn’t Trust GMail

by doug on February 8, 2010

in Editorial

A funny thing happened on my way to get my e-mail today. Chrome identified www.google.com as a dangerous site with a weird SSL certificate and told me to run for safety. In the image below, notice that the https protocol is crossed out, like this: https.

When I went tried to post this tidbit to Twitter (@douglasputnam), I got another warning cautionary note. It looks like Chrome is in Body Guard Mode today.

When the 800-pound Gorilla trips over its own feet, we’re allowed to chuckle.

Share and Bookmark
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Blogplay
  • FriendFeed
  • StumbleUpon
  • Tumblr
  • Twitter
  • Add to favorites
  • LinkedIn
  • Posterous
  • Reddit
  • Suggest to Techmeme via Twitter

{ 0 comments }

A reserved word in a programming language is a word that is off limits to the programmer. For example, in PHP print is a reserved word. This means that you, as the programmer, cannot create a function named print because PHP owns that word.

Most languages have reserved words, some a few, and some very, very many. Usually the fewer reserved words a language has, the more flexible it is. For example, in the list below, you will see that Lisp has no reserved words. We all know that Lisp is very flexible and powerful.

As you look at the table below, do not think unkind thoughts about PHP—it’s different from the other languages. It is not designed to be a general purpose programming language, though it can certainly do almost anything you want it to do. It is intended for web programming, which explains the existence of so many of the predefined functions and constants. Those are exactly the kinds of items that other languages must implement individually if they want to be as handy with web development as PHP. This is no small task, kids. Just take a look around try to find a web site implemented in C++.

Reserved Words

Language Count Reserved Words
Lisp 0 Lisp has no reserved words. Lisp is written in Lisp. Alan Kay, the creator of Smalltalk, said: “Lisp isn’t a language, it’s a building material.”
Smalltalk 5 self super nil true false
C 32 auto break case chart const continue default do double else enum extern float for goto if int long register return short signed sizeof static struct switch typedef union unsigned void volatile while
C++ ~62 and and_eq asm auto bitand bitor bool break case catch char class compl const const_cast continue default delete do double dynamic_cast else enum explicit export extern false float for friend goto if inline int long mutable namespace new not not_eq operator or or_eq private protected public register reinterpret_cast return short signed sizeof static static_cast struct switch template this throw true try typedef typeid typename union unsigned using virtual void volatile wchar_t while xor xor_eq
Ruby 38 alias and BEGIN begin break case class def defined? do else elsif END end ensure false for if in module next nil not or redo rescue retry return self super then true undef unless until when while yield
Python 31 and del from not while as elif global or with assert else if pass yield break except import print class exec in raise continue finally is return def for lambda try
Java 47 abstract do if package synchronized boolean double implements private this break else import protected throw byte extends instanceof public throws case false int return transient catch final interface short true char finally long static try class float native strictfp void const for new super volatile continue goto null switch while default assert
PHP 418 __CLASS__ __COMPILER_HALT_OFFSET__ __FILE__ __FUNCTION__ __LINE__ __METHOD__ __PHP_INCOMPLETE_CLASS ABDAY_1 ABDAY_2 ABDAY_3 ABDAY_4 ABDAY_5 ABDAY_6 ABDAY_7 ABMON_1 ABMON_10 ABMON_11 ABMON_12 ABMON_2 ABMON_3 ABMON_4 ABMON_5 ABMON_6 ABMON_7 ABMON_8 ABMON_9 ABSTRACT ALT_DIGITS AM_STR AND ARGC ARGV ARRAY AS ASSERT_ACTIVE ASSERT_BAIL ASSERT_CALLBACK  ASSERT_QUIET_EVAL ASSERT_WARNING AUTH_TYPE BREAK CASE CASE_LOWER CASE_UPPER CATCH CFUNCTION CHAR_MAX CLASS CLONE CODESET CONNECTION_ABORTED CONNECTION_NORMAL CONNECTION_TIMEOUT CONST CONTINUE COUNT_NORMAL COUNT_RECURSIVE CREDITS_ALL CREDITS_DOCS CREDITS_FULLPAGE CREDITS_GENERAL CREDITS_GROUP CREDITS_MODULES CREDITS_QA CREDITS_SAPI CRNCYSTR CRYPT_BLOWFISH CRYPT_EXT_DES CRYPT_MD5 CRYPT_SALT_LENGTH CRYPT_STD_DES CURRENCY_SYMBOL D_FMT D_T_FMT DAY_1 DAY_2 DAY_3 DAY_4 DAY_5 DAY_6 DAY_7 DECIMAL_POINT DECLARE DEFAULT DEFAULT_INCLUDE_PATH DIE DIRECTORY_SEPARATOR DO DOCUMENT_ROOT E_ALL E_COMPILE_ERROR E_COMPILE_WARNING E_CORE_ERROR E_CORE_WARNING E_ERROR E_NOTICE E_PARSE E_STRICT E_USER_ERROR E_USER_NOTICE E_USER_WARNING E_WARNING ECHO ELSE ELSEIF EMPTY ENDDECLARE ENDFOR ENDFOREACH ENDIF ENDSWITCH ENDWHILE  ENT_COMPAT ENT_NOQUOTES ENT_QUOTES ERA ERA_D_FMT ERA_D_T_FMT ERA_T_FMT ERA_YEAR EVAL EXCEPTION EXIT EXTENDS EXTR_IF_EXISTS EXTR_OVERWRITE EXTR_PREFIX_ALL EXTR_PREFIX_IF_EXISTS EXTR_PREFIX_INVALID EXTR_PREFIX_SAME EXTR_SKIP FINAL FOR FOREACH FRAC_DIGITS FUNCTION GATEWAY_INTERFACE GLOBAL GROUPING HTML_ENTITIES HTML_SPECIALCHARS HTTP_ACCEPT HTTP_ACCEPT_CHARSET HTTP_ACCEPT_ENCODING HTTP_ACCEPT_LANGUAGE HTTP_CONNECTION HTTP_HOST HTTP_REFERER HTTP_USER_AGENT HTTPS IF IMPLEMENTS INCLUDE INCLUDE_ONCE INFO_ALL INFO_CONFIGURATION INFO_CREDITS INFO_ENVIRONMENT INFO_GENERAL INFO_LICENSE INFO_MODULES INFO_VARIABLES INI_ALL INI_PERDIR INI_SYSTEM INI_USER INT_CURR_SYMBOL INT_FRAC_DIGITS INTERFACE ISSET LC_ALL LC_COLLATE LC_CTYPE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LIST LOCK_EX LOCK_NB LOCK_SH LOCK_UN LOG_ALERT LOG_AUTH LOG_AUTHPRIV LOG_CONS LOG_CRIT LOG_CRON LOG_DAEMON LOG_DEBUG LOG_EMERG LOG_ERR LOG_INFO LOG_KERN LOG_LOCAL0 LOG_LOCAL1 LOG_LOCAL2 LOG_LOCAL3 LOG_LOCAL4 LOG_LOCAL5 LOG_LOCAL6 LOG_LOCAL7 LOG_LPR LOG_MAIL LOG_NDELAY LOG_NEWS LOG_NOTICE LOG_NOWAIT LOG_ODELAY LOG_PERROR LOG_PID LOG_SYSLOG LOG_USER LOG_UUCP LOG_WARNING M_1_PI M_2_PI M_2_SQRTPI M_E M_LN10 M_LN2 M_LOG10E M_LOG2E M_PI M_PI_2 M_PI_4 M_SQRT1_2 M_SQRT2 MON_1 MON_10 MON_11 MON_12 MON_2 MON_3 MON_4 MON_5 MON_6 MON_7 MON_8 MON_9 MON_DECIMAL_POINT MON_GROUPING MON_THOUSANDS_SEP N_CS_PRECEDES N_SEP_BY_SPACE N_SIGN_POSN NEGATIVE_SIGN NEW NOEXPR NOSTR OLD_FUNCTION OR P_CS_PRECEDES P_SEP_BY_SPACE P_SIGN_POSN PATH_SEPARATOR PATH_TRANSLATED PATHINFO_BASENAME PATHINFO_DIR NAME PATHINFO_EXTENSION PEAR_EXTENSION_DIR PEAR_INSTALL_DIR PHP_AUTH_DIGEST PHP_AUTH_PW PHP_AUTH_USER PHP_BINDIR PHP_CONFIG_FILE_PATH PHP_CONFIG_FILE_SCAN_DIR PHP_DATADIR PHP_EOL PHP_EXTENSION_DIR PHP_INT_MAX PHP_INT_SIZE PHP_LIBDIR PHP_LOCALSTATEDIR PHP_OS PHP_OUTPUT_HANDLER_CONT PHP_OUTPUT_HANDLER_END PHP_OUTPUT_HANDLER_START PHP_PREFIX PHP_SAPI PHP_SELF PHP_SHLIB_SUFFIX PHP_SYSCONFDIR PHP_USER_FILTER PHP_USER_FILTER PHP_VERSION PM_STR POSITIVE_SIGN PRINT PRIVATE PROTECTED PUBLIC QUERY_STRING RADIXCHAR REMOTE_ADDR REMOTE_HOST REMOTE_PORT REQUEST_METHOD REQUEST_TIME REQUEST_URI REQUIRE REQUIRE_ONCE RETURN SCRIPT_FILENAME SCRIPT_NAME SEEK_CUR SEEK_END SEEK_SET SERVER_ADDR SERVER_ADMIN SERVER_NAME SERVER_PORT SERVER_PROTOCOL SERVER_SIGNATURE SERVER_SOFTWARE SORT_ASC SORT_DESC SORT_NUMERIC SORT_REGULAR SORT_STRING STATIC STDCLASS STR_PAD_BOTH STR_PAD_LEFT STR_PAD_RIGHT SWITCH T_FMT T_FMT_AMPM THIS THOUSANDS_SEP THOUSEP THROW TRY UNSET USE VAR WHILE XOR YESEXPR YESSTR LASS__ __COMPILER_HALT_OFFSET__ __FILE__ __FUNCTION__ __LINE__ __METHOD__ __PHP_INCOMPLETE_CLASS ABDAY_1 ABDAY_2 ABDAY_3 ABDAY_4 ABDAY_5 ABDAY_6 ABDAY_7 ABMON_1 ABMON_10 ABMON_11 ABMON_12 ABMON_2 ABMON_3 ABMON_4 ABMON_5 ABMON_6 ABMON_7 ABMON_8 ABMON_9 ABSTRACT ALT_DIGITS AM_STR AND ARGC ARGV ARRAY AS ASSERT_ACTIVE ASSERT_BAIL ASSERT_CALLBACK ASSERT_QUIET_EVAL ASSERT_WARNING AUTH_TYPE BREAK CASE CASE_LOWER CASE_UPPER CATCH CFUNCTION CHAR_MAX CLASS CLONE CODESET CONNECTION_ABORTED CONNECTION_NORMAL CONNECTION_TIMEOUT CONST CONTINUE COUNT_NORMAL COUNT_RECURSIVE CREDITS_ALL CREDITS_DOCS CREDITS_FULLPAGE CREDITS_GENERAL CREDITS_GROUP CREDITS_MODULES CREDITS_QA CREDITS_SAPI CRNCYSTR CRYPT_BLOWFISH CRYPT_EXT_DES CRYPT_MD5 CRYPT_SALT_LENGTH CRYPT_STD_DES CURRENCY_SYMBOL D_FMT D_T_FMT DAY_1 DAY_2 DAY_3
Share and Bookmark
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Blogplay
  • FriendFeed
  • StumbleUpon
  • Tumblr
  • Twitter
  • Add to favorites
  • LinkedIn
  • Posterous
  • Reddit
  • Suggest to Techmeme via Twitter

{ 7 comments }

Smalltalk: The Good Parts Blog Is Moving

by doug on January 31, 2010

in Smalltalk

AOTS Olivia Munn
AOTS’ Olivia Munn

The Smalltalk: The Good Parts Blog over at http://smalltalkthegoodparts.com is moving to http://hackingthevalley.com/ and to a new RSS feed. The Slicehost server will still host SmalltalkTheGoodParts.com and my Smalltalk experiments.

I know. It seems like we just got here a few weeks ago. And now we’re moving?? Crazy. Actually, what’s crazy was trying to maintain 4 blogs. In a momentary fit of delusion and megalomania, I had hallucinated that I would be able to teach 4 classes, walk the dogs, prune the damn apple trees, mentor 150 students, and create content for 4 blogs—and watch AOTS every afternoon.

Something had to give, so the blog has to move. There’s no way I’m giving up AOTS.

I’m going to consolidate the PHP, Ruby, and Smalltalk Good Parts blogs into a single new Wordpress blog (HackingTheValley.com), and shut down hackingthevalley.blogspot.com. Fortunately I have only a few posts to import. I can do this in a couple of days.

This blog will be turned off in 30 days and Feedburner will disconnect those who are using the old RSS feed. If you want to transfer to the new feed, click here to add the Smalltalk: The Good Parts RSS feed.

So the moral of the story is, one blog per mere mortal.

Happy hacking…

Doug

Share and Bookmark
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Blogplay
  • FriendFeed
  • StumbleUpon
  • Tumblr
  • Twitter
  • Add to favorites
  • LinkedIn
  • Posterous
  • Reddit
  • Suggest to Techmeme via Twitter

{ 0 comments }

I haven’t felt this excited about a tech product since I got my Kaypro in 1982. The Apple Tablet is going to be awesome for publishers and self-publishers, which I fancy myself to be. I’m going to pre-order one instantly. If this thing is to my X-61 tablet PC as the iPhone was to my Razr, it’s going to be insanely great.

I know that I sound like an inflamed Apple Fanboy, but, let’s face it, where goes Steve and Company, there goes the world. You go, Steve.

Keep hacking…

Share and Bookmark
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Blogplay
  • FriendFeed
  • StumbleUpon
  • Tumblr
  • Twitter
  • Add to favorites
  • LinkedIn
  • Posterous
  • Reddit
  • Suggest to Techmeme via Twitter

{ 0 comments }

irb Screencast (Interactive Ruby)

by doug on January 27, 2010

in Editorial

If you need to see irb in action, check out this screencast.

Whenever I see a smooth, well-written, organized screencast I have a deep sense of appreciation. That’s my goal: be smooth, well-spoken, and organized. :)

Keep hacking Ruby…

Share and Bookmark
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Blogplay
  • FriendFeed
  • StumbleUpon
  • Tumblr
  • Twitter
  • Add to favorites
  • LinkedIn
  • Posterous
  • Reddit
  • Suggest to Techmeme via Twitter

{ 1 comment }

My Collection of Vintage Smalltalk Books

by doug on January 27, 2010

in Smalltalk

Every time I’m swept up in an new project I gird my loins by gathering a phalanx of books around me. I start by downloading all of the free PDF’s I can find. Stephane Ducasse, author the the Robots books, has an exhaustive list of free out-of-print Smalltalk books. So I got them all. I don’t know how many of these books I’ll ever read, but I feel good having them there, just in case.

Smalltalk PDF's

I like real books, so I scoured the used book list on Amazon and was able to find paper copies of many of my free PDF’s.

Most of these books were first published in the 80’s and 90’s, with a few of the Squeak books arriving after 2000.

Of all of these books, my favorite is SMALLTALK-80 by Adele Goldberg and David Robson (1989). Though the book’s cover gives it a quaint vintage look, the content is contemporary and the writing admirably clear—perfect for a student like me.

I like this book so much that I carry it with me on my walks around San Francisco and read it while I sit in Starbucks eating pastries and drinking espressos. Now and then some generic dude will see my antique book and comment, “Damn. Is that language still around? Why would you want to learn that when you could learn Java?”

I also have a soft spot in my heart for Squeak: Learn Programming with Robots by Stephane Ducasse, which I’ve mentioned previously. This book is good-spirited and all about having fun with programming. It’s an absolutely painless, fun introduction to Smalltalk. A kid can handle this book easily—even an adult kid.

My buddy Bill G. observed me collecting these dusty, out of print tomes. Back in the 80’s he did some Smalltalk programming in The Valley. He said, “There used to be an all-Smalltalk books store in Palo Alto on University Avenue, right down the road from Xerox. That’s how hot Smalltalk was in those days.” He paused. “I think that place is a Starbucks now.”

That’s cool with me. I need a clean, well-lighted place to hang out and read my books and get hassled by Java programmers.

Happy hacking…

Share and Bookmark
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Blogplay
  • FriendFeed
  • StumbleUpon
  • Tumblr
  • Twitter
  • Add to favorites
  • LinkedIn
  • Posterous
  • Reddit
  • Suggest to Techmeme via Twitter

{ 4 comments }

My Collection of Vintage Smalltalk Books

by doug on January 26, 2010

in Smalltalk

I have a new post about my mania for collecting vintage computer books. Check it out on Smalltalk: The Good Parts.

Share and Bookmark
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Blogplay
  • FriendFeed
  • StumbleUpon
  • Tumblr
  • Twitter
  • Add to favorites
  • LinkedIn
  • Posterous
  • Reddit
  • Suggest to Techmeme via Twitter

{ 0 comments }

Which Flavor of Smalltalk Is Right For Me?

by doug on January 25, 2010

in Editorial

Learning two languages at once can be hazardous to your mental health.

Now that I know I can deploy Seaside on my Slicehost server, I can move on to the next step, which is deciding which version of Smalltalk I should learn.

The languages I’m familiar with come in only one flavor: vanilla. With C++, PHP , Ruby, and Python there’s no choice at all: you take what they give you. But there are many varieties of Smalltalk to choose from; they all do great stuff, they all have the great features, and  they’re all just different enough that it’s in your best interest to choose one and stick with it. Some are free and som you have to pay for. Which one do you choose?

I’ll cut the suspense and say that my first choice for learning Smalltalk is Squeak. But my choice was entirely accidental. I didn’t choose Squeak on its merits, and it has many. I simply stumbled upon it.

I was taking a math course and wanted to graph some of the equations we were discussing in the class. I considered using PHP but working with PHP’s low-level GD library had already killed off too many of my brain cells. Then by accident, I happened across a book named Squeak: Learning Programming With Robots. I could see at a glance that I could make this Squeak robot do my bidding. Here’s my first Smalltalk program: drawing a square. In fact, drawing 100 squares.

Here’s a small screencast of how Squeak looks in the hands of a rank amateur.

Share and Bookmark
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Blogplay
  • FriendFeed
  • StumbleUpon
  • Tumblr
  • Twitter
  • Add to favorites
  • LinkedIn
  • Posterous
  • Reddit
  • Suggest to Techmeme via Twitter

{ 3 comments }

How to Draw Squares With Squeak Smalltalk

by doug on January 25, 2010

in Smalltalk

I posted my first Smalltalk program on SmallTalkTheGoodParts.com. It’s all about squares. You’ll love it, if you love squares…100’s of them.

Keep hacking…

Share and Bookmark
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Blogplay
  • FriendFeed
  • StumbleUpon
  • Tumblr
  • Twitter
  • Add to favorites
  • LinkedIn
  • Posterous
  • Reddit
  • Suggest to Techmeme via Twitter

{ 0 comments }

?!

It’s the first week of the semester for my online Ruby course. One of the first meta lessons I try to teach is to pull on the thread. I’m thinking of a loose thread on a knitted sweater. You have an itch to pull on that thread, knowing the sweater will unravel; if you pull long enough and patiently enough, you’ll end up with the other end of the thread in your hand.

Everyone in the class wants to know Ruby. Wanting to learn will carry you to the first step, and the second. However, if you want to really learn Ruby, you’ve got to be curious about it because curiosity carries you through to the end of the thread.

Today, a student asked me a question I didn’t know the answer to. When this happens in the classroom, I can say “I don’t know. Your assignment is to dig up that answer and tell us about it next class meeting.” In 9 years of teaching, only 3 students have been energetic enough to take up my challenge, but I always go home and look up the answer for myself.

An online course is different. I can dig up the answer. Here’s the question I got today:

I have two installations of Ruby: 1.8.7 on a laptop and 1.9.1 on a desktop, both Windows. In my 1.8.7 install I can do this:

    y 99.methods.sort

This y command does something like take in an array and output YAML. Is there a require that I have to do or a gem that I have to download to use this?

I can tell that this student is already committed to learning Ruby and already knows about gems and require. Here’s my answer.

This is a really interesting question. To answer it we need to talk about Modules and require, and how Modules can be used in classes. We’ll be talking about this subject later in the course, so if you (the class in general) feel mystified at this point, fret not. We’ll be covering this idea later.

However, for those who are interested, I’ll go a little further into it.

That ‘y’ method comes into irb when the Yaml module is “required”. irb does not do this by default, so I would guess that your particular version of irb is configured to ‘require’ Yaml. (None of my installations of Ruby on my Mac, PC, etc do.) It turns out that different implementations of Ruby, on different systems, configure irb differently. Your 1.8.7 version happens to ‘require’ Yaml.

If you want to use ‘y’ in irb, you can do this do this at the irb prompt:

require 'yaml'

If you are really curious you can to this.

1) Start irb afresh and do:

self.private_methods.sort

2) Visually scan the list of methods to get an idea of what’s in the environment.

3) Do this:

require 'yaml'

4) Run this code again:

self.private_methods.sort

5) Notice that methods have been imported from the Yaml module, and a new method called ‘y’ appears in the list.

6) You may think that the y method is in the Yaml module, but being the curious soul you are, you decide not to make unwarranted assumptions. Instead, you decide to dig into the source code. This a beautiful thing about open source languages: you have the source code to answer all questions about how the language implements its “magic”.

7) Next you do a search on your system (PC, Mac, Linux doesn’t matter) and look for a file named ‘yaml.rb’, which is the file that Ruby will look for when you say “require ‘yaml’”
8) Once you find ‘yaml.rb’ and look at the code, you finally know where ‘y’ came from.

Of course, along the way you may encounter mysteries and more questions will flood into your mind. But, this is a good thing. Ruby is deep and subtle. And fun.

You get the idea. I encourage digging through the source code. It’s a great way to see how Ruby code is really written. When you have technical questions that go beyond the scope of the assignment, beyond what “Beginning Ruby” offers, beyond my knowledge and experience, you can always go to the source code itself.

In this case, the file you’re looking for will be someplace like this (Windows users will have to look in C:\Ruby):

/usr/lib/ruby/1.8/yaml.rb

Have fun.

And of course, happy hacking…

Share and Bookmark
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Blogplay
  • FriendFeed
  • StumbleUpon
  • Tumblr
  • Twitter
  • Add to favorites
  • LinkedIn
  • Posterous
  • Reddit
  • Suggest to Techmeme via Twitter

{ 0 comments }