Archive for November, 2008

Ruby and RoR file extensions

Thursday, November 13th, 2008

Writing in Flex was a nice experience because it’s so Java-like.   Then I started writing Ruby on Rail apps.

Don’t get me wrong, I definitely appreciate the power that the ruby language and RoR framework provides.   But, face it, if you’re used to Java, the ruby syntax can be …hmmm…. unfamiliar.

My first obstacle was figuring out file extensions:

  • .erb are embedded ruby tags, e.g. <%.  May see an html.erb file.
  • .rb are ruby scripts or RoR class files
  • .rhtml - ruby on rails script (application/x-httpd-eruby)

That’s when I found a helpful site called filext.com which is pretty good for looking up file extensions.

Stuck in SYN-SENT

Thursday, November 13th, 2008

Recently, in an Adobe Flex project running on Windows OS, I was noticing a huge delay when tearing down the process.  The process used URLMonitor to access a service and, if the service was unreachable or if a timer went off, it just exited.

By the way, URLMonitor just sends out an HTTP request.   In our application if the timer went off URLMonitor.stop() was called and the application exited.

Upon exit(), the application would disappear from Windows Task Manager, but the process would still be in the task list.   By running a netstat, we saw that the process still held a socket in the SYN_SENT state.  (For a pretty good diagram of TCP socket state machine, see wikipedia.)

In Windows, the process wouldn’t return to the OS or .bat file, until this socket state was cleared up.