Tuesday, October 25, 2005
Funny thing is all the new language features of C# are very old LISP features and Ruby already has them...
 
"Anonymous methods allow code blocks to be written “in-line” where delegate values are expected. Anonymous methods are similar to lambda functions in the Lisp programming language. C# 2.0 supports the creation of “closures” where anonymous methods access surrounding local variables and parameters. " - MSDN
 
I just mean that I've been reading about LISP lately and how Ruby is a very closely related language and even thought LISP has been around for something like 4 decades it's features are still being picked up by Java, C# and other languages.  In fact one of the co-creators of Java said somethong about Java bringing C++ developers half way to LISP. 
 
LISP is a very ugly language but Scheme, a variant, is not so bad.  I'm not sure I would have picked up Ruby if I hadn't migrated to C# from VB6 and then had to learn Java and Progress.  The thing is I like learning this stuff and if knowing Ruby helps me understand C# so much better which I can say it does because I can see the intent of the abstract constructs in C# so much clearer through the lense of Ruby then I could through the broken glasses of VB6.   
 |  | 
Tuesday, October 25, 2005 8:47:54 PM (Central Standard Time, UTC-06:00)  #    Comments [0]
 Tuesday, October 18, 2005
How to detect JavaScript in a browswer - Version 1 - Poorman's special.

This is a simple hack to detect whether JavaScript is enabled in a browser.  This trick should work for ASP.NET or Ruby on Rails or any other framework.  The trick is to use the noscript tag.  Here is a snippet of code:

 <noscript>
  <INPUT TYPE='hidden' NAME='jsdisabled' VALUE='true'>
  <span class='warning'>JavaScript must be enabled to use this site!</span>
 </noscript>

Make sure you place this code inside the form that is to be posted.

The noscript tag is only active when script is either not supported or disabled.  This chunk of code gives a warning to the user and also sets a hidden form value.  When the form is posted you can then check to see if the jsdisabled parameter is included with the post.  If it is you know that JavaScript is enabled.

Notice I call this a poor man's method as it needs more testing.  If you can see any problems with this please add a comment so I can change it
Tuesday, October 18, 2005 10:34:11 AM (Central Standard Time, UTC-06:00)  #    Comments [0]