Thursday, December 29, 2005

Adobe Acrobat has sucked for quite some time.   Actually it has sucked since version 6.0.  Now there is a great replacement for it.

Foxit (http://www.foxitsoftware.com/pdf/rd_intro.php)

It's small and fast and you simply download a single exe and execute it.  No fuss no muss and did I mention fast?  It smokes.  It's also free.  This has to be one of the best pieces of software I've seen in a long time.

This is going into the Pragmatic SDK.

 

 

Thursday, December 29, 2005 9:38:00 AM (Central Standard Time, UTC-06:00)  #    Comments [3]
 Thursday, December 15, 2005

You may be annoyed if you are used to a convenient trim function on your strings that eliminates leading and trailing whitespace and you've found that it doesn't exist in javascript.

Here's a quick fix:

//start code
// add the missing trim functions
String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ""); };

//end code

Add this in any javascript file or in between some <script> tags and your javascript strings will magically have the trim function.

This is because javascript classes are mutable.  There is a more accurate and technical explanation but I will spare you the pain. 

We are simply adding the trim function to the string class at runtime.  The trim function uses regular expressions to trim the string of leading and trailing whitespace. 

Thursday, December 15, 2005 11:47:55 AM (Central Standard Time, UTC-06:00)  #    Comments [0]
 Saturday, December 03, 2005
The Open Laszlo frame work is an RIA (Rich Internet Application) which is open-source.  It relies on the Flash plug-in in the browser for virtual machine functionality.

Q & A:

What is the benefit of using Open Laszlo as a client versus HTML?

Open Laszlo is a rich client.  This can best be compared to a Visual Basic application or any other Windows based application where the client can maintain state.  Also you have much greater control over application layout and appearance without worrying about the inconsistencies of web standards between different browsers.  As long as the client web browser has a Flash plug-in installed, the Laszlo application can run and will appear consistently across browsers.  No more CSS Layout hell.

Is the reliance on Flash a problem? 

Actually the Flash reliance can be a benefit.  Flash market penetration is somewhere above 97% for the 7.x version of the Flash plug-in.

What about text size?

Actually the application can be split among files so the main application can load quickly and other pieces of the application can be loaded on demand.

Is download size a problem?

Actually the application can be split among files so the main application can load quickly and other pieces of the applicaton can be loaded on demand.

How can you interact with other frameworks and technology?

Laszlo uses XML as the basic unit of data transfer.  As long as you can generate XML with your server application Laszlo can use it.  Data can be returned to the server in any form necessary including the typical form POST method or in an XML format or whatever other method you can conceive.

Do I need any special server software?

No, you need the ability to host SWF files, which should not be a problem for a majority of hosting solutions.  The Flash files are simply files downloaded like any other file (like a picture or PDF) to the client browser.  You can use the Laszlo server which is a Java based stack but I am using Ruby on Rails as my server software.  When Laszlo is deployed in SOLO mode (as my site is) you do not need any supporting server software.  Simply communicate through http to any resource that can return XML.


Saturday, December 03, 2005 12:47:20 PM (Central Standard Time, UTC-06:00)  #    Comments [0]

Here's a link to a presentation about some seemingly disjointed topics that blend into an architectural discussion about simplicity. 

Highlights:
We don't need middleware (There is no such thing as transport independance).
URL's are important
Small disconnected functionality can be combined with unexpted results (Google Maps + Craig's List)


http://intertwingly.net/slides/2005/rs/
 |  | 
Saturday, December 03, 2005 12:41:52 PM (Central Standard Time, UTC-06:00)  #    Comments [0]
 Wednesday, November 16, 2005
Look into this...
http://www.lifehacker.com/software/feature/geek-to-live-turn-firefox-into-a-web-writer-137450.php




Wednesday, November 16, 2005 4:21:45 PM (Central Standard Time, UTC-06:00)  #    Comments [0]
 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]
 Friday, September 23, 2005


If you're familiar with vi then gvim should be no problem.  If you're not you can still use gvim in a windows compatible mode.  Either way gvim can be used as a pretty good (not to mention free) IDE. 

First go get gvim at http://www.vim.org/.

Then go get the project "script" at http://www.vim.org/scripts/script.php?script_id=69  If you can't find it try searching for "project"

Now you need to install a nice little ruby gem named "vim-ruby" 

   You can go this with the following steps:

  •    gem install vim-ruby --remote
  •    vim-ruby-install.rb

   from your command line of choice.

Now one last bit, to make sure you can enable folding which helps a lot with large files remember to do the following step:

To enable folding, download the patched ruby.vim file shown atop this page. Then put the following lines into .vimrc (or ~/.vim/plugin/ruby.vim):

 set foldmethod=syntax
 set foldtext=getline(v:foldstart)
 " you may try out this: set foldcolumn=3
 set fillchars=fold:\ " note the whitespace after  
 " not neccessary but useful (so you can use the TAB key to fold/unfold):
 map <TAB> za

-- originally found at http://www.rubygarden.org/ruby?VimExtensions

You should be on productive dude after this!

Friday, September 23, 2005 5:15:52 PM (Central Standard Time, UTC-06:00)  #    Comments [0]
 Wednesday, September 21, 2005

ORM (Object Relation Mapping) is the new automatic memory management.  You wouldn’t want to go back to having manage pointers and allocate and de allocate memory.  This is how we advance.   The less unnecessary complexity the better.  I think most languages and platforms will eventually have this built in.  Rails provides Active Record which is based on a Martin Fowler pattern of the same name.  Java has hibernate, cocoon and about a hundred other frameworks most of which have/are being replicated into the .Net space.

So if you have a decent database design you can really take advantage of the ORM to make your life so much easier.  Of course queries can be optimized etc if you need them to be but all of this logic can be put into the Ruby (Java, .NET) language functions used to query the database.  Things like order by, limit, sorting can also be specified. 

The nice part is that the schema needs to make sense to be used.  The id field is always called “id”.  Foreign keys are always named with the tablename_id so it’s consistent.  That’s the advantage of Rails, there’s so much organization built in and you always know where pieces of code are going to be, ie models, views, controllers, libraries, etc.  

How many times have you opened someone’s project and had to hunt around trying to find what you are looking for.  

Why do we have 2 x 4’s?  Wouldn’t it be great if each carpenter could choose the dimensions of lumber to use for each project?  Why limit the choice? 

The answer is obvious or should be and the same thing goes for software development.  Microsoft has done a great disservice for developers by not mandating a coding standard which includes indentation and style along with project organization.  

This is the only way we can continue to handle more complexity; we must delegate some of it to the computer and use standards. 

Wednesday, September 21, 2005 8:41:37 AM (Central Standard Time, UTC-06:00)  #    Comments [0]