Archive for the ‘software’ category

Deserves a pizza inaugural post

July 17th, 2009

A new category of post.  People who deserve a pizza.

For helping my out of my can’t-install-mysql-gem problem, I present to you http://marcgrabanski.com/article/installing-mysql-ruby-gem-mac-media-temple-dv.

Use of a mac will be forgiven for pure awesomeness.

I was getting errors along the lines of:

Building native extensions.  This could take a while…
ERROR:  Error installing mysql:
ERROR: Failed to build gem native extension.

/usr/local/bin/ruby extconf.rb install mysql
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lm… yes
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lz… yes
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lsocket… no
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lnsl… yes
checking for mysql_query() in -lmysqlclient… no

uninitialized constant Thin::Server::Forwardable

July 2nd, 2009

I may be getting batty in my old age here, but for whatever reason Thin decided to just stop running on my system.  When trying to invoke thin to further development on the code behind my awesome website, I was treated to the following:


ethan:ethang juanpaco$ thin start
/Library/Ruby/Gems/1.8/gems/thin-1.0.0/lib/thin/server.rb:51: uninitialized constant Thin::Server::Forwardable (NameError)
from /Library/Ruby/Gems/1.8/gems/thin-1.0.0/lib/thin/runner.rb:38:in `initialize'
from /Library/Ruby/Gems/1.8/gems/thin-1.0.0/bin/thin:6:in `new'
from /Library/Ruby/Gems/1.8/gems/thin-1.0.0/bin/thin:6
from /usr/bin/thin:19:in `load'
from /usr/bin/thin:19

I didn’t like that.

I went to the line number where the error occurred (/Library/Ruby/Gems/1.8/gems/thin-1.0.0/lib/thin/server.rb:51), and found:
extend Forwardable

Not knowing what Forwardable was, and for giggles, I went to irb and typed “Forwardable” thinking I’d get the class object.  Not defined.  So I try “require ‘forwardable’.”  There was no period in what I typed, but I haven’t figured out how to get Ruby and English to play well together.  Anyway, that worked, and a subsequent typing of “Forwardable” returned the object. So then I tried putting require ‘forwardable’ at the top of server.rb in thin’s gem.

And then it worked.

I’m not sure why it used to work and then suddenly didn’t.  This was after several install/uninstall, swear off programming moments.  Weird.  So, if you’re struggling with this same problem, perhaps the above can be of service.

Deleting a remote branch it git

December 18th, 2008

This is another “command I always forget and want a reference to” post.

To delete a remote branch, type: git push origin :<branch name>.

Apple strikes again

December 18th, 2008

This time it’s with TextEdit, which is probably WAAAAAY better than Notepad, because Micro$oft didn’t write it.

Well, true to Apple’s form of thinking its users are too dumb to know how to use a computer, I found out that TextEdit does not let you choose what extension to put on a file.  I’m doing a MySQL create table statement, and copying/pasting the results of a show create table statement was overloading the terminal window– really weird text was coming out, and MYSQL couldn’t make sense of it.  So I decided to paste it into a simple text editor, save that as a .sql file, and then import that into the database via the command line.

Now, I know that file doesn’t have to have a .sql extension.  I like it that way though, and seeing how I’m the user, the computer should listen to me.

So what happens when one goes to specify one’s own extension on a file in TextEdit?  One is treated to the following dialog box (which is modal, of course):

An Apple staple

It isn’t particularly difficult to save a file with a different extension, and Apple’s philosophy of hiding any sort of file-system-level issues from ALL users weakens TextEdit’s usefulness.  When I’m using a Windows machine and need to quickly test something in HTML (for example), I load up Notepad, quickly enter the snippet under test, and then save it as an HTML document.  I would not have any such luck as a TextEdit user.

Am I left the option of changing the extension in Finder after?  Sure.  But that requires leaving TextEdit, finding the file, praying that I can even see the extension, and so forth.  Not the gold standard of usability.  Do I have a more able text editor on the machine?  Yes, TextMate, but it’s a bloated monstrosity (ever done a ‘Find in Project?’) without the power of Visual Studio, and it doesn’t come to mind for quick editing tasks.  And yes, in this particular example, the extension didn’t actually matter because thankfully mysql is better software than TextEdit.  The point is, I should be able to use a different file extension if I want to. Not all users are as scared of the file system as you think Apple.  Leave us the option!

This is yet another reason why I would never spend any of my own money on an Apple computer.

Edit: So, I got mad and wrote the post.  Then I gave the file the extension I wanted and tried importing it into my database, only to be greeted by the following error: ERROR 1049 (42000) at line 1: Unknown database ‘tf1ansiansicpg1252cocoartf949cocoasubrtf350′.  I thought, “I sure don’t remember specifying database tf1ansiansicpg1252cocoartf949cocoasubrtf350.”  TextEdit is serious when it says it only does .rtf files.  That polution of a .sql script is quite normal for an .rtf.  So Apple does not provide a plain text editor, or if TextEdit does do plain text, it isn’t readily apparent.

2nd edit: apparently it does other file formats, if you choose them from a drop-down menu on the save dialog box.  However, you’re still locked into the extension associated with the format.  And it doesn’t have a plain-text option.  TextEdit still loses.

Apple gripe: Pages file format

December 5th, 2008

Since Pages is from Apple, one would expect it to be awesome and without flaw.  Unless of course one hadn’t been baptized in the Church of Apple.

I know that the standard when there is a problem with something Apple is that it’s the user’s (my) fault, but I’m not so sure on this one.  I’m trying to upload a Pages document to Basecamp.  Now, Basecamp is made by 37Signals, some of the most rabid Apple fans out there (but also the origin of Rails, so they get just a snicker on their stance).

It turns out Pages saves “documents” as a directory with several files below it (they call it a “package,” but calling my unwrapped Christmas presents wrapped Christmas presents doesn’t make it so).  I’m sure there is a reason for that, just as I’m sure there’s a reason for the obnoxious screen capture behavior built into OsX (OSx?  Who cares?).  The problem is that browsers don’t do folder uploads, so one can’t just upload their Pages document without first zipping it up.  Then, presumably one would have to unzip it to read it again.  Zipping/unzipping isn’t a terribly painful process, but neither is stubbing my toe– not exactly the gold standard against which I measure an action.

Of course, this could just be the fault of every browser, because if it weren’t, then it would be Apple’s fault.

Come on Apple! Or is that one should never have to transfer a Pages document?  Stuff written in Pages should only ever be viewed on that same machine?  Did Apple just miss the existence of the Internet, or do they expect everyone to only use Apple products which, presumably, are equipped to ship a folder around? If Pages is any indication of Apple’s quality (and it seems to be), why on Earth would someone want to switch?

Of course, on all the message boards, all anyone talks about is how bad Microsoft products are, WHILE THEY’RE HAVING PROBLEMS WITH AN APPLE PRODUCT! It would be funny if I didn’t have to work with Apple products.

New Apple gripe

October 6th, 2008

I hope it’s a new one anyway.

So yeah, Mac OSX provides a screen capture utility that makes a cute little camera sound when a user takes a “snapshot.”  How sweet and usability-enhancing that is.

Well, it appears that Mac OSX makes the sound and then tries to take the screen grab.  Often I’ll take a screenshot to attach to a bug report at work.  I hit the buttons for the screenshot and then immediately go to look at the resulting file to make sure it was correct.  The problem though is that since it makes the sound BEFORE it has actually taken the screenshot, when I hit F11 to see my desktop, the resulting picture shows my windows on their way out to being hidden.

Apple, USE CONFIRMATION NOISES ONCE THE PROCESS IS COMPLETE!  It’s little things like this that are so frustrating with Apple because of how obnoxious the devotion of its acolytes are.

Git, GitHub, and Windows

August 4th, 2008

A blog post isn’t quite the format in which to go into the length details of why, so it sufficeth me to say that Git is great source control software. Local commits. 1 command to initialize a repo.  Branching and merging isn’t so ridiculous that you never do it.

GitHub also seems pretty neat, though I confess to be a GitHub newb (or noob– I forget which is derogatory. I don’t mean that one). GitHub allows free hosting of open-source Git repositories. I don’t really plan on making the project I’m working on open source– and for no particular reason– so that’ll get changed when I want to close things down. It does cost money to host closed-source projects. Point being, off-site backup is a Good Thing, a quality especially noticeable when one accidental rm -Rf’s their repository. Oops. Good thing I had basically only clicked New Project in Visual Studio.

So, this post is supposed to matter because you get some useful information and not just some narcissism. If you’re a Windows user at least part of the time, it’s readily apparent that Git wasn’t written for Windows users. Do the author check. It’s slightly confusing to get Git working, and rather than re-invent the wheel– though I’m not afraid of beating dead clichés– checkout the work of some dude named Kyle Cordes.

His post works as advertised. I did skip all the bit about being added to his repository, as I wanted to do my own. Also, I stopped the whole thing at “Approach 1: GUI.” It was pretty easy getting the repo into git-hub by following git-hub’s instructions.