Hip RoR Tip: Don’t name a field ‘type’

The field name type is a dangerous name for a field.

The ‘type’ method in Ruby became deprecated.

It is also considered a “Magic Field” name. Specifically, it is used for Single Table Inheritance.

So save 15 minutes of your life by considering the field names for the objects in your database. 🙂

Posted in General | Comments Off on Hip RoR Tip: Don’t name a field ‘type’

I’ve been using Ruby on Rails

Over the last year or so, I’ve been using Ruby on Rails. For my latest gig, we have a shipping a Ruby on Rails app that is critical to the success of our service.

Although I could expound on the Ruby on Rails framework right now, I won’t. I will do that later. For now I just wanted to mention that you may see more and more blog posts from me that are essentially rails recipes or tidbits. This adheres to the origininal intent of this blog. It was meant to be a public source of helpful information for anybody on the internet.

Ok, so now for some tips…

Posted in General | Comments Off on I’ve been using Ruby on Rails

Neat video about an old SGI computer

Here is a neat video about an old SGI computer. The interesting part was the hardware breakdown of the computer. They really had a great design for the hardware back then. You can see apple definitely moving in this direction, but it will be really nice when the entire computer industry is on board.

Posted in General | Comments Off on Neat video about an old SGI computer

Great old article

dvorak layout

I was thinking about optimization today, and I remembered the old posting about a guy at Cray using an evolutionary process to evolve the best keyboard layout. The gist was that dvorak was still good. I think I’ll switch one day.

At any rate, I found the article. The guy is Peter Klausler… I recommend reading his page. There is some interesting sfuff there.

One of the tidbits was that he won one of the IOCC categories for 2005 with his anagram generator!

This of course led me to another link. The IOCC winners are announced at the Vintage Computer Festival…. hey, isn’t that coming around…. Yes, it is. The next one is in November.

Posted in General | 1 Comment

More Wikipedia

IMHO, Wikipedia is the most interesting thing to happen to mathematics in a long long time.

I’m sure this can apply to other fields as well, but I feel that it is especially true for mathematics.

Posted in General | 2 Comments

Personal Submarines

psubs.org

For the last 5 minutes, I was thinking about personal submarines. How much would one of those cost? Who makes them? What is the latest technology in the personal submarine business?

So, after a little searching, here is what I find.

Here is a story about some guys that are testing their little sub in the Puget Sound up in Seattle. This is fairly recent. Their company is called u.s. submarines or http://www.ussubs.com, and the site is nice. It definitely has the right feeling for a submarine web site (kind of dark). The company sells all kinds of subs, and the used ones can probably be had for under $2 million. Check out their luxury sub, the Phoenix 1000… it even has a docking mini-sub! This is so 007! I’m sure they can build a trap door that goes to a shark chamber 🙂 They also sell underwater habitats. Neat stuff.

Moving on, I find a chinese sub manufacturer’s web site here. Definitely check that out.

Closer to home, there is a venture funded ‘jet sub’ over here. There is a story on the web about it being tested in the SF Bay for 10 mins.

Finally, there is psubs.org, an organization for “the discussion, design, construction, certification, and ownership of personal submersibles.”

Posted in General | 1 Comment

Declaration vs. Definition

Today I was thinking about something about programs. In most languages, you have to literally declare stuff before it can be used. This is true in C, Python, and a bunch of other languages. The annoying example that I’m thinking of is the ‘they are in the same file’ case. For example, in Python, if you try to call functions defined after the if name == “main“, it will fail. It will state that the function is not defined.

This is so damn annoying. What is annoying is that the compiler is going to discover all the functions and methods when it compiled the module. There shouldn’t be any ambiguity here. Yet, this little stuff forces the programmer to organize their software in a certain way. I have to have my ‘main’ at the bottom. In C, it also forces me to define my function prototypes. This is ok for external functions… but why do I have to do this for internal static functions?? Extra work.

When I have to look at someones code, I have to search for the bottom, and then scan around. It just seems unnecessary and inverted. If the main is the ‘top’, shouldn’t it be at the top for ‘top-down-design’?

C is rife with the same requirements. I’ll bet there is a story from 1972 where one of the designers said, ‘eh, lets just do it this way… we’ll fix it later’. How many hours of time has this consumed of programmers?

Ok, so what if… what if programs had their ‘main’ at the top? It seems trivial, but I’ll bet if you add all these little ‘decisions’ up you will understand why certain ‘new’ ways of doing things will make your existing code start to feel like cobol. (Example: semicolons at the end of the line :-). Has anyone else noticed the rise of languages that put significance in the EOL? It matters. )

Posted in General | Comments Off on Declaration vs. Definition

VMS

digital equipment logo

VMS

The other day, I was thinking about the old debate. Worse is better. Just good enough. One of the classic examples in those texts is the way that BSD was designed vs. the MIT operating systems. (The other big debate was C versus Lisp). The main distinction was with how they dealt with an interrupt to a process that was blocked on some system operation.

In the BSD world, you (the user space programmer) got interrupted and you had to restart things yourself. In the MIT world, the OS was so smart, it would restart the program at the correct point in the correct state so the programmer didn’t have to deal with these cases. The BSD system won, but I don’t think it was for this reason.

So, I started thinking… what did the MIT system do exactly. I’ll bet the internet knows… and of course, since this is the future, it does. The MIT system was called PCLSRing or Program Counter LoSeRing and is well described over here. Now add to that a vague recollection a couple of weeks back that VMS had a completely async IO system.

Sure enough, that old OS that I ran had an asynch model called QIO’s and AST’s which stand for Queued Input Outputs and Asynchronous System Traps. They handled this stuff fairly elegantly. I never got to that level in those days. I was using the C/POSIX layer on VMS. (Trivia, VMS was the first POSIX compliant OS… before Unix!) I think me and my boss at the time did do some performance analysis on this, and it was a win, but not by much. No matter, the machines were so slow… “how slow were they?” They were so slow, and generally running so many processes for things… that it wasn’t worth trying to push to the limit.

Well, I read a little more about VMS or OpenVMS on Wikipedia, and they expounded on a lot more of the good stuff that VMS had. The stuff I had direct experience with was LAT, Clustering, DCL, VMS Queues, DECnet, LANWorks, and the DB like API’s. The hardware was really good for lots of users on terminals, too. However, in terms of single user, GUI interactive work, it was just to clumsy and slow. So, the OS was good, but it only ran on 5 mip hardware when 40 was becoming super cheap. Oh yeah, I do remember lots of dollar signs and CAPITAL LETTERS FOR THINGS, too 🙂

Anyways, VMS used the asynch IO model in the form of ASTs, Unix had signals, and the MIT ITS had PCLSRing.

vms galaxy A VMS Galaxy Diagram

VMS vax bar

Posted in General | Comments Off on VMS