I want a friendly fox…
Who does the plumbing work in the women’s locker room of a 24 Hour Fitness?
“Writely”:http://www.writely.com is incredible. I’m not sure if I’m doing myself a tiny disservice by posting this here, because the servers can’t possibly remain as fast as they are after the site catches on like wildfire and their userbase (all your userbase are belong to us) explodes. This is combined with the fact that while editing a document, it auto-saves itself back to the server every ten seconds, which must generate a gazillion (not quite a googol, although note that Google recently bought Writely) hits. Anyway, in the span of a couple days, I’m now keeping track of almost everything in Writely documents. For work, I can create a document for each project we’re working on and type notes related to the project; my coworkers can read and maintain their own notes simultaneously. Finding and opening documents is also much faster than doing so within the operating system, since they’re all just right there in one place and there’s no Word-like startup time; a document just loads in a new window/tab right away. There’s no Word-like concept of a printed page or page-width forced on you; the default typing mode is much like opening a blank Notepad.exe instance and typing in it. Although unlike Notepad, Writely saves often and makes it easy to manage files. I haven’t relied much on the automatic revision tracking feature yet, but I’m sure that’ll come in handy down the line, too.
Incidentally, I just noticed something interesting. I’m typing this, you might imagine, in Writely itself. I’m using Firefox and happen to have Firebug enabled. So I see the periodic POST requests being sent to the server to support the ten-second autosave. Instead of saving my whole document, each request sends just the text I’ve added or changed since last autosave. Of course you know it has to work that way when you think about it, but I wouldn’t have thought to think about something like that in the first place.
Did you know it’s easy to tell whether someone wearing glasses is nearsighted or farsighted? Amazed someone with the observation she was farsighted, yesterday, but myself coming from a family where once upon a time every one of us wore glasses, you might not have been so surprised I knew this. Glases to correct nearsightedness make a person’s eyes/face/anything beneath appear smaller, and when one looks back through the lens at the edge of the face, it’s discontinuous and pulled in at that point. Glasses for farsightedness are the opposite (each lens is like a magnifying glass, though not as strong the typical item you’d find a kid frying ants with) and the edge of the face appears pushed out.
Someone ought to manufacture a remote control which is shaped like a piece of pizza. The buttons could be the slices of pepperoni and mushrooms. Slap a Cartoon Network logo on it, and there you go, instant brand-recognition promotion tool, let alone cute and appealing product that can be sold for profit!
Why aren’t there any libraries with coffee shops?
Maybe they’re afraid people are going to spill coffee in the books.
Although, the earnings from selling the coffee would probably more than make up for lost books due to coffee damage.
You know?
No coffee allowed in the Reference Section, though. Those Britannicas are probably worth a lot.
How are gun sights tuned? With one weapon, I aimed at the center of the target but consistently hit a point about 3/4 of the way up and to the right. So I had precision, but not accuracy. Or, well, accuracy considering that once I knew after the first shot that aiming at the middle of the target would get me the upper-right corner, conceivably I would have only aimed at the center if I had _wanted_ to hit that corner. But it was only circumstancial accuracy, given that I didn’t know what corresponding spot to aim at in the lower-left corner in order to hit the center. So if one wants to become a sharp-shooter with great accuracy, one should probably own a gun and practice with that same weapon to learn its firing characteristics. I have a feeling that I’ve just stated something completely obvious and known to anyone who knows anything about guns, but that was my observation, anyway. On the other hand, perhaps gun owners, or, I should say, afficionadoes (since one can (as is probably often the case) own a gun for self-defense and (despite advice to the contrary) not be particularly proficient or experienced in its use) are able to tune the sights to visual accuracy along the line of sight. Or just mount a laser pointer on the thing. Or get a shotgun.
I was finally able to get Rails mostly working by downloading InstantRails and pulling bits and pieces out of it. The philosophy of InstantRails seems to be “throw in everything including the kitchen sink”, because it includes a full installation of Apache 2, MySQL, PHP, phpmyadmin, Ruby, _two_ IDEs for Ruby and more. In my first little test program I discovered that Rails calls a plural “person” “people”, but to nitpick, “persons” is not only simpler but grammatically correct. You use “people” when talking about a coherent group of persons, like “a people”, or as Moses said, “let my people go”. Of course he wasn’t talking about a bunch of individuals, as in “let my persons go”, and you can’t say “my person”, anyway. (That implies ownership — though perhaps an Egyptian could have referred to his personal slaves as “my persons”.) But you can say “my nation” or “my tribe” or “my class” meaning the group to which you belong, and of course that’s what Moses meant. Let my people go. So when you have multiple instances of something you’re calling “person” in your database, and you like pluralizing table names, “people” is flat out the wrong usage. So this proves that Ruby on Rails sucks.
Just kidding, of course. As I keep saying it seems like a nice framework. As long as everything is customizable and over-rideable, I could transition over to using it. Ruby keywords are strange to me, but these can come with time. A couple things were off-putting, though. The first was that at the end of the “Four Days on Rails”:http://rails.homelinux.org/ tutorial, the author points out that using the ActiveRecord ORM, you can’t sort by any column. Just to do a simple sort, he had to revert to SQL. Which is okay, but that makes me wonder what other slightly more complex than basic operations might require the same. The second was that the CRUD (Create, Retrieve, Update, Delete) scaffold for database operations rendered what I call the “postback” page directly. This is when you fill out a form, press “Submit”, and the Web server replies with a page explaining which fields you missed or entered wrong and need to fill out. Generally I like using a redirect to get to this page, so that the partially-filled-out form comes back to you on a “fresh” Web page where you can press “reload” in your browser without the annoying “Resubmit form data?” pop-up box that comes up otherwise. Also, some browsers (IE) will cause the previous page to appear as “expired” when you press the “back” button — making it annoying or difficult to go back to where you came. This behavior requires sticking all the form information into the user’s session. Nothing wrong with that. I’m sure this can be accomplished with RoR, but strange that the scaffold wasn’t set up this way by default. I realize these both may seem minor, though. I’ll be able to speak to the framework better in a while.
Someday when I’m old and gray and I look back on my days of spry youthfulness I’m going to miss working at the office ’til 2 A.M.
7.1 mph for 45 minutes = 5.3 miles. Got some new running shoes the other day, so this was a break-in/test — results are that my left foot hurts now when I walk. I’ll probably end up returning ‘em and trying something else…
(Still not seeing the world through ruby-tinted glasses.)
Argh. Killed another few hours on the below problem with no progress. Or rather, maybe a miniscule bit of progress. It seems that after I start the WEBrick server, the very first page load sees the database, but no additional hits do. I can connect to the “new” function in my test controller and see a “create” button there along with fields it’s pulled out of the database. However on refreshing the page or selecting anything, the same old error (mysql.o can’t be found) comes back, and persists until I restart the server. After poring over page after web-page of Q&A issues/solutions with RoR’s MySQL connectivity, reinstalling MySQL and trying 15 other things, I’m going to say that… I’m sure with enough effort I could track down a solution, but for the time being I’m laying this to rest. My next step might be to bite the bullet and just download Instant Rails and see if I can pull pieces out of that, but I get the sense after reading all those pages that parts of this framework are a bit immature, like that database connector. The programming model at least sounds solid.
(The train hasn’t quite left the station.)
Last night I was feeling brave and decided to take the plunge and learn a little about “Ruby on Rails”:http://www.rubyonrails.com/. First step, of course, was to install the needed components.
Following the directions on the RoR homepage, everything went smoothly until I tried to get MySQL hooked up. Although there’s the “Instant Rails”:http://rubyforge.org/projects/instantrails/ package which includes everything preconfigured (Ruby, Rails, MySQL, some Web server or other), I already had MySQL and Apache running (with a live “testbed” site — didn’t want to damage anything here) so I opted for the “manual” install. Besides, it shouldn’t be too hard. After installing various versions of PHP+Apache+MySQL on at least 5 machines, getting everything to work together is sometimes tricky and takes a little troubleshooting, but I’m familiar with the process.
I was able to create and run a “Hello World” app and understand more about what Rails does. Basically, Ruby is just a programming language. I’m not familiar with it so I can’t comment too much about the feel of it yet, but by ASP standards (where by default you have the choice of Visual Basic or JScript), it’s more like Visual Basic: line endings have meaning, you won’t find braces or semicolons lying around anywhere, and also Like Python, indentation level also has meaning. But enough about the language itself; hopefully I’ll be able to comment more about that at a later date.
Rails is simply a set of scripts (written in Ruby, of course) which creates folders and writes out a whole slew of source code and configuration files which form your Web application’s framework. So by the time you start developing, you’re running on a nice framework of code which abstracts routine database operations (typically done tediously through SQL queries) into simple language constructs. Instead of SQL, you just deal with objects in the language.
So in the above sense, there’s no reason for it to be _Ruby_ on Rails. It could have been PHP on Rails or C++ on Rails. It seems the Rails developers had a “thing” for Ruby, and who knows, maybe it _is_ more elegant than other languages out there. I can’t tell you about that yet.
Anyhow, the Ruby interpreter is the same sort of thing as the PHP interpreter. You invoke it from the command prompt with a script as input, and it runs the script. Unlike PHP, it seems that there currently is no Apache module for Ruby. If you want to use it with Apache, it has to get invoked in CGI mode, and you need FastCGI to make that efficient.
Installing Ruby was easy. Next I installed RubyGems, which is a tool written in Ruby for automatically downloading and installing packages (sort of like PEAR from the PHP world, but seemingly more feature-rich.) I issued a command to tell Gems to downloaded and installed Rails, and another command to download and install the MySQL adapter. That’s where something must have gone wrong… since no matter what I did, my application would not connect to the database. It printed this error:
no such file to load -- ./mysql.o
Uninstalling and re-installing the MySQL adapter did not work. Attempting to install different versions of the adapter did not work, since something went wrong during the installation.
This version’s installation worked:
C:\ruby>gem install mysql Select which gem to install for your platform (i386-mswin32) 1. mysql 2.7.1 (mswin32) 2. mysql 2.7 (ruby) 3. mysql 2.6 (ruby) 4. mysql 2.5.1 (ruby) 5. Cancel installation > 1 Successfully installed mysql-2.7.1-mswin32 Installing ri documentation for mysql-2.7.1-mswin32... Installing RDoc documentation for mysql-2.7.1-mswin32...
C:\ruby>
All other versions did not work:
Building native extensions. This could take a while... *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.
...
ERROR: While executing gem ... (RuntimeError)
ERROR: Failed to build gem native extension.
Gem files will remain installed in c:/ruby/lib/ruby/gems/1.8/gems/mysql-2.7 for
inspection.
The folder mentioned immediately above needed to be manually deleted whenever this occurred.
Anyway, that’s as far as I got in a few hours last night. I’ll go fight with this some more, later.