Blog posts tagged "articles"

Hi! Guess what came out a few days ago! The long-awaited iOS 4.2.1 jailbreak! Horray! At least, that's what I was thinking, having been stuck on iOS 4.1 for months. I eagerly downloaded Greenpois0n RC5 and tried to jailbreak. This was my horrific experience:

  1. First, I downloaded Greenpois0n RC5. Not as simple as you would think because so many other people were trying the same exact thing. I finally managed to get it off a mirror, though.
  2. Second, I upgraded my iPhone to iOS 4.2.1. It took quite a while and when it finished, it popped up with Error 1013 (or something like that) and demanded that I restore my iPhone to factory settings. I would rather not.
  3. Going out on a limb, I tried using RecBoot to kick my iPhone out of recovery mode and, what do you know, it worked! I later discovered that Error 1013 was a result of having Cydia's TSS server in my /etc/hosts file and that practically everybody knew to use RecBoot at that point. :P
  4. Now for the exciting part: untethered jailbreak. I ran Greenpois0n and... nothing happened. Greenpois0n said "Complete :)", but when my phone finished restarting, I could tell that clearly, nothing had happened. Wow. After a few more attempts with nothing happening, I gave up.
  5. Still needing a jailbreak, though, I downloaded redsn0w and an ISPW file.
  6. Then, I gained a tethered jailbreak using redsn0w. I was excited to see that, even though I had to reinstall all of my Cydia apps, all of my settings were still there.
  7. Upset that I was tethered and slightly regretting upgrading at all, I tried to get an untethered jailbreak again and re-ran Greenpois0n. This time, instead of just failing like usual, it got my iPhone stuck in the Apple Logo Boot Cycle Of Death. You know, when the phone starts booting and then restarts over and over again?
  8. Guess what the only solution to that is? Restore your iPhone. Great. Just great. I avoided having to do it before and now I'm ending up doing it anyway.
  9. I waited like a half an hour for it to finish and you know what happens next? Error 1013. (Or something like that). So, I blanked my iPhone and it was still stuck in the boot cycle. I did some research and discovered the cause of the error was the entry in the hosts file, so I removed the entry and restored again.
  10. Okay, better; it worked that time. Good thing I had a backup of my device from before I jailbroke, otherwise I would've been very annoyed at that point. Restoring from the backup also took a bit of time
  11. Then, I had to sync all of my media. Goodness, that took a long time.
  12. Finally, I was back to the point I was at during step 4, but this time, there was a new version of Greenpois0n to try: Greenpois0n RC5 v2. So, I tried to jailbreak and this time, instead of silently failing, it said "Failed :(". Wow, that's so much better.
  13. I decided to get serious and took a peek at the logs. They were filled with libusb errors and such, so I did some research and downloaded the newest version of libusb from MacPorts.
  14. Did that do anything? Nope. Very annoyed at this point, I opened my Twitter client and saw that some people suggested running the actual binary (instead of the bundle) from the Terminal as an administrator.
  15. sudo Greenpois0n.app/Contents/MacOS/Greenpois0n
  16. ohmygoditworked. :D Finally, after a whole ton my time was wasted, I got my untethered jailbreak back. Except, I didn't have Cydia yet. And the Loader.app wasn't working.
  17. Not a problem, though, because I had previously read that the strain put on Greenpois0n's servers had stopped Loader.app from working and that you could instead install Cydia using redsn0w without breaking your untethered jailbreak, so I loaded up redsn0w again and installed Cydia.
  18. Horray! Now, I just had to reinstall all of my apps (thankfully, the configuration was all still there, probably thanks to my backup) and I could finally listen to music on my iPhone again! You know, because I'm a last.fm nut and I can't listen to any music if it won't get scrobbled. :P

Upgrading to 4.2.1 certainly was an ordeal, but was it worth it? Well, so far as I can currently tell, not really. Well, sort of. I set up Find My iPhone and am very happy with it, though I think it's a bit unlikely that I'll lose my iPhone. You never know, though, right? Besides that, well, though I am very excited to have AirPrint, I'm not sure when I'll ever use it. Ditto to AirPlay, seeing as we don't actually have any AirPlay speakers and I would rather have an iTunes instance controlling AirPlay speakers. Also, I hate the new Voice Memos icon. Whatever; I guess it just best to always have the latest software.

Have you had any horrific jailbreaking experiences? Do you want to jailbreak and now can because of Greenpois0n RC5? Do you want a burrito? Leave a comment and I'll consider taping it to my fridge!

Hatkirby on February 6th, 2011 at 2:23:07pm
πŸ‘ 0 πŸ‘Ž

Mac OS X 10.6.6 was released this morning, and you know what that means! Actually, you might not, so I'll tell you: the Mac App Store! The Mac App Store is like the App Store on iDevices--it's an Apple-controlled repository of Mac apps that you can buy with your Apple ID. It also automates update delivery, which is pretty nice. All in all, I think the App Store needs some more development and some more features, but it's a pretty neat idea and I think it's a nice addition to Mac OS X.

Image

There are some really cool-looking free apps available, like the long-awaited Tweetie 2 (renamed "Twitter for Mac"), a Solitare game with various versions of the game, not just Klondike (this will be great for those transitioning from Windows :P ) and an alternate to Spotlight: Alfred. The problem is, I can't log in. :( The Mac App Store seems to be having a lot of initial teething problems and one of them is the "MZFinance.NoGUIDTokenFailureKey_message" error. Yeah, great message. So, until Apple fixes the problem, I can't get any apps from the Mac App Store. Bummer. :(

The other thing I wanted to talk about in this post is the upgrade itself, and how it affects those who are using Mac OS X on decidedly non-Mac hardware (like me). Usually, OS upgrades can cause major problems, but this one was very easy. I really just had to install the upgrade via Apple Software Upgrade. It was really that simple! However, do keep in mind that if you use the SleepEnabler kext, you have to delete it and clear the extensions cache before installing the upgrade (like I did) because SleepEnabler kexts are version-specific. There isn't yet a new version for 10.6.6, but you can be sure that there will be one before long. But, other than that, nothing too bad went wrong. You may have to run MultiBeast again to reinstall some fallback kexts if you need them (I didn't), but the only thing I've really noticed about this upgrade is that my startup time seems to have increased. Which is pretty annoying, but hopefully it can be eventually fixe--KERNEL PANIC AIEEEE :P

Anyway, I hope that Apple gets its act together soon and fixes the App Store--I really want to play some solitaire! :P

EDIT: 24 hours later and the problem has been fixed. Now, time to download random apps! :D :P

Hatkirby on January 6th, 2011 at 6:41:56pm
πŸ‘ 1 πŸ‘Ž

On the second day of Kirby Week, Four Island gave to me: a tutorial on pretty error messages.

Disclaimer: The post assumes you have Rails 3. It may work with Rails 2, but I dun know about that. Just to be safe, go ahead and install Rails 3. :P We good? Great.

Hi, 'yall! It's me! Do you know what's sort of annoying? Rails is really wonderful with all the things you can do with models. Specifically, validations are just great, and most of the time, they're really pretty too (because Rails is about Readability!), so you can write beautiful code like this:

validates_presence_of [:anon_name, :anon_email], :if => :anonymous?

You see? In one line, I made it so that the model checked for the presence of "anonname" and "anonemail" when "anonymous?" returned true. That's just great. However, there's a problem with this that you may be able to foresee. Let's see what kind of error messages are returned when "anonname" and "anonemail" are left out:

Anon Name is blank Anon Email is blank

That's not really that user friendly, is it. Oh well, we can just change our code a bit, right? Make it a bit less pretty?

validates_presence_of :anon_name, :message => "Your name is blank", :if => :anonymous?
validates_presence_of :anon_email, :message => "Your email is blank", :if => :anonymous?

It's a bit longer and clunkier, but it should work, right? Nope.

Anon Name Your name is blank Anon Email Your email is blank

D'oh! After searching around the Internet, the only solution I could find was this disgusting jumble:

validate do |comment|
  if comment.anonymous?
    comment.errors.add_to_base("Your name is blank") if comment.anon_name.blank?
    comment.errors.add_to_base("Your email is blank") if comment.anon_email.blank?
  end
end

Now the error messages are correct, but the code itself is horrendously disgusting. I can't settle for that! Well, it turns out that there's another way. A way that works with the first method of validation shown above, the one that validated both fields in one line. Yes. Go back to that. Next, look inside your config/initializers folder for a file called "inflections.rb". Add the following to the bottom:

ActiveSupport::Inflector.inflections do |inflect|
  inflect.human "anon_name", "Your username"
  inflect.human "anon_email", "Your email"
end

Now, restart your server and check your error messages. Guess what?

Your username is blank Your email is blank

This works because the inflector is used to humanize the names of fields before they are prepended to the error message. By customizing how the inflector humanizes the field names, you can effectively customize your error messages! Horray! The inflector can be a good ally once you learn how to use it properly because Rails humanizes things in a lot of places. Let the inflector be with you. Okay. I should end this post now. :P

Hatkirby on December 14th, 2010 at 12:30:07pm
πŸ‘ 0 πŸ‘Ž

On the first day of Kirby Week, Four Island gave to me: A tutorial on how to get Rails 3.

Oh my god, it's Kirby Week. That. Was. Fast. I just remembered yesterday (which was the first day of Kirby Week, but I didn't have to post on Sunday anyway) that I usually post once a weekday for Kirby Week (except Friday, which I have traditionally failed at life on :P ). Right. Anyway, since I have been doing a lot of work with Ruby on Rails recently with Four Island 3, I think I should focus this year's Kirby Week on Rails! :D

Now, I have been using Rails 3 to develop Four Island 3 (OH MY GOD THE THREES! RUN AWAY!!!!!) and it's quite nice. It doesn't seem beta-ish at all, and do you know why? Because it isn't beta-ish at all! :P Today, I'm going to show you how to install Rails 3 (as well as some other stuff) onto your computer because Rails 3 is pretty awesome yo dawg business. O_O

Now, as you may know, Rails 3 requires Ruby 1.9. Ruby 1.9 is pretty awesome, but it breaks a lot of old Ruby programs, so we're going to install it alongside your system Ruby installation by using something called "rvm", or the Ruby Version Manager. Note that this will only work on UNIX-based OSes, that means Linux and OS X (no Windows! :P ). First, ensure that you have "git" installed. Second, open a terminal and run this command:

bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )

It seems pretty mysterious, but all it does is download rvm. You're not quite done yet--you have to inject rvm into your bash session. To do this, follow the instructions that the above command showed you, or just add this line to your ~/.bash_profile file:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"  # This loads RVM into a shell session.

Next, open a new bash session or just source the profile (source ~/.bash_profile) to load rvm into your session. Finally, just ensure that everything worked by running the following command:

type rvm | head -1

If it replies with rvm is a function, then congratulations! You've successfully installed rvm, and not much else yet! :P Just to keep things safe, run rvm notes to see if there's anything special you have to do for your particular operating system (for instance, I believe you need to have Xcode installed for OS X).

Great! Now, let's install Ruby 1.9.2. It's fairly simple--just run the following commands:

rvm install 1.9.2
rvm --default use 1.9.2
rvm default

The first line is the one that will take a while, but it's a fairly simple process overall--it just installs Ruby 1.9.2, sets it as the default ruby and then chooses it to be the interpreter for the current session.

Finally, let's install Rails 3. Run the following command:

gem install rails

Note that you should never use sudo when installing gems when you are using rvm. Anyway, yes, it really was that easy. Now that you have Rails 3 installed, you should explore the great wondernesses of its wonderness! :P You should read that page. Yes. Anyway, I'm going to be writing about some cool tips and tricks of this you can do with Rails this week and it's going to be great. :D And, now that you have Rails 3 like I do, you can be sure they'll work! :P

Oh, and if you ever want to switch back to your system's default Ruby, run this command:

rvm use system
Hatkirby on December 13th, 2010 at 12:30:13pm
πŸ‘ 0 πŸ‘Ž

I know, I know, it may not be the best of titles as one of OS X's most criticized elements is how bad it is at window management, but hear me out. Okay, so Snow Leopard has been the latest version of Mac OS X for quite a while now and it's the OS X I fell in love with and the OS X I currently use. I really do enjoy Snow Leopard. Then, about a month ago, I sat around on October 20th, waiting to hear what Apple was going to announce because we all knew it would be a new version of Mac OS X. Yes, we were right. But, no, I was not satisfied at all with the news of Mac OS X Lion, and here I am, finally about to explain it. :P

Macs have always been criticized (quite frequently by me) as being too different, but since discovering that I love Macs, I've realized that it's not supposed to be the same as anything. And why should it? There's no reason that Mac OS X should be the same as Windows or Linux, and there's no reason it should have the same paradigms. One huge paradigm difference I've noticed between Windows and OS X is window management.

In Windows, it's not only easy to do, but it's practically expected of you that you will pretty much have your windows maximized at all times, unless you're doing something that requires you to see two windows at once. Windows is a huge fan of the MDI (Multiple Document Interface) paradigm which allows you to have one window maximized, but able to see and interact with a lot of information.

Image

By contrast, OS X's window management paradigm is centered around SDI (Single Document Interface) windows, and a lot of them. In OS X, it's not fashionable to have a window filling your screen--you can do many things at once and the windows are all there! In fact, one of the biggest annoyances that people switching to the Mac find is that they expect the three stoplights in the top left of every window to act similarly to the window control buttons in the top right of every window in Windows, probably because they look similar. And yes, for the most part, they do act similarly, but the green stoplight does not do the same thing as the maximize button--it simply resizes the window to best fit its contents.

Image

Now, as I'm sure you'll notice, the SDI paradigm doesn't really work out too well on my laptop with its tiny 1280x800 screen. While I totally agree with the Mac's SDI paradigm, I believe it only really works well on desktop computers because they have much larger screens. On computers like my laptop, the screen is so small that I normally have to keep certain apps' windows maximized all the time like Mail, Safari and NetNewsWire. But on desktop computers and laptops that are hooked up to larger screens (which I totally plan to do some day! :D ), SDI works fine and is so awesome.

One of OS X Lion's most touted features is the addition of full-screen modes to a whole ton of apps. This worries me. I mean, yes, I can certainly see it being handy on a laptop, but when I get my LED Cinema Display and hook my laptop up to that so I have a bigger screen, what then? I don't want full screen apps with such a large screen--I want my SDI paradigm back! The iPad is the iPad, but the Mac is the Mac--they're two completely separate things and I really don't think OS X needs to take anything from iOS.

Yes. Change is always bad. :P

No, but really, this really bothers me. I have strange dreams of having a large-screen Mac and writing a post on Four Island with MarsEdit while reading an email and surfing the web at the same time as chatting with friends and doing a little programming in TextMate. No, seriously, I'm not weird. :P

This isn't the only problem I have with OS X Lion, but it's a pretty big one. One of the other problems I have is the iOS-ization of some built-in apps, such as Mail and iCal:

Image

Doesn't that look... just... bad? Snow Leopard stole my heart with its colorful, sleek interface and iOS just does not work like that. iOS belongs on the iPhone / iPod touch / iPad / Apple TV / WHATEVER, and Mac OS X belongs on the Mac. Let's keep it that way, shall we?

I'd like to make one last note regarding the criticism of Mac window management, specifically with regards to resizing windows. Sure, you can only resize Mac windows from one corner, and yes, that is fairly annoying, but it's not too bad. On the other hand, Windows programs, when not maximized, have a hideous border around them that allows you to resize in any direction. No. Just.... no. There is no real middle point, though, because GNOME on Linux allows resizing from any direction without a hideous border and it's just impossible to resize a window without either clicking through to the background or clicking in the window. Yay for Macs.

Finally, I'd like to say: Happy Thanksgiving and Happy Birthday To TimTam! :P

Hatkirby on November 25th, 2010 at 10:19:37am
πŸ‘ 0 πŸ‘Ž

The other day, I was searching the web for fantastic applications for Mac OSX because I'm obsessed and they're pretty. Anyway, one website suggested "MarsEdit" as a must-have. "Okay," I thought, "It's probably a text editor. It probably doesn't compare to TextMate, but I might as well give it a look." Yeah, it wasn't a text editor. It was a desktop blogging client, and it looks awesome. :D

Image

Okay, this post isn't (entirely) about how I was taken by some smooth advertising, it's about how my blog sucks. No, really. I'll fully admit it: since realizing that Four Island was ready to be rewritten again, I have found so many thing wrong with it that it's just amazing. Obviously, I can't enumerate all of these to you, but the ones that bothered me into writing this post are:

  • The custom BBcode system is stupid and insane. "Seriously, let's use a half-baked BBcode system that butchers Unicode characters instead of HTML." No, really, the admin panel should be able to use the full spectrum of HTML elements, plus some timesaving shortcodes. Comments should be allowed to use whitelisted HTML elements. This BBcode system is insane and I regret it so much.
  • The current layout is a bit hideous. Yes, it's revolutionary in that it does so many things that the previous layouts didn't, but seriously, it just doesn't look nice. The blog is seriously difficult to read and a nice clean layout would make things much nicer.
  • The admin panel, while much better than the original (which actually still exists on the server somewhere... shivers), is still pretty basic. No autosave, no revisions, no tag suggestions, etc...

The place I'm trying to get with this is that while my website may be completely written by me, and I'm proud of that, it lacks a lot of useful features that a real solution like Wordpress would have. Namely, in this instance, an implementation of the MetaWeblog API allowing me to write and edit posts from a desktop client. It would be so classy! For one, the autosave feature on its own would snag me. In fact, I actually lost this post while writing it the first time due to a kernel panic--if I had been using a desktop client like MarsEdit, I would've had an autosave copy of the post waiting for me when the computer rebooted. What style. Do I even need to mention the number of posts that I've lost due to the fact that it took longer for me to write it than it took for my session to expire? I've now grown the habit of hitting Cmd-A, Cmd-C before I save the post in case the session expired.

This, along with many other reasons, is why I've decided to fully implement the Wordpress XML-RPC API (which means I also have to implement the MetaWeblog and MoveableType APIs) in Four Island 3. It'll let me use MarsEdit on my computer and the Wordpress app on my iPhone to write posts, which will be pretty awesome. It's an arduous task, due to the fact that the relevant documentation is pretty mediocre. But, I'm getting through it. The Wordpress app still crashes every time I reload the posts, but that's development for you! :P However, I bet that when Four Island 3 is done and everything has been released, it'll not only be easier to write posts, it'll be more fun. And when it's more fun, it's more likely that I'll do it! :P

So, I wanted to ask, who else writes from a blogging client rather than from the admin panel of their blog? Sure, the admin panel is usually pretty intuitive and easy to use, but in my opinion, desktop clients are just so much better! What do you think?

And, no, this post wasn't really written in MarsEdit. My evil custom BBcode system prevents that. Someday, though, someday Four Island 3 will be out and I'll be writing from MarsEdit. How fantastic! :P

Hatkirby on November 21st, 2010 at 12:30:14pm
πŸ‘ 0 πŸ‘Ž

Thumbnail2It's time, folks! If you're jailbroken, backup your SHSH blobs! If you're not jailbroken, but want to be, backup your SHSH blobs! Don't know what they are or why you should do it? Well, to make a long story short, since the new bootrom version of the iPhone 3GS, iOS updates have been very controlled. Apple has set it up so that, if they are not currently offering SHSH blobs on their website for the pair of your iDevice and a specific iOS version, you are unable to load that version onto your iDevice (this obviously doesn't apply if the software is already installed). So, ever since then, jailbreakers have had a way of getting around this by backing up the SHSH blobs for their iDevice and iOS version so that if they ever need to downgrade to a specific version of iOS, they can. Note: you can only downgrade if you already have the SHSH blobs for that iOS version, and you can only backup your SHSH blobs while Apple still offers them. So, yeah. If you don't know how to backup your SHSH blobs, perform a Google search on a program called "TinyUmbrella".

Anyway, why am I saying this? Two reasons: first, it's November now, so, if we can believe Steve Jobs, iOS 4.2 should be coming out this month. If you upgrade to iOS 4.2 and are unhappy with your inability to jailbreak, if you have your iOS 4.1 SHSH blobs, you can always just downgrade. Second, there has been some exciting jailbreak news even before iOS 4.2 is out:

Anyone with blobs for 4.1 or earlier should be able to get an untethered 4.2 jailbreak; this is not done but is being actively worked on.

comex

It seems that this may work by pwning an iOS 4.1 IPSW and somehow using that with iOS 4.2; I don't quite know. :P Note, it may not be out very soon because:

However, a 4.2 jailbreak might be delayed because Cydia doesn't work on 4.2 yet. Not sure how close @chpwn is to finishing his fixes.

comex

Regardless, we can expect an untethered jailbreak for iOS 4.2 and until then, I'll be staying on iOS 4.1.

Finally, I think we can expect iOS 4.2 pretty soon because, not only is the iOS 4.2 GM release already out for developers, Apple has responded to the current problem with iOS 4.1 and daylight savings time. They have posted a support document to their website saying that you will need to set your alarms to repeat "Never" until November 7th. Whether the date specified is the release date of iOS 4.2 or it's just specified because that's when daylight savings time starts is unknown.

Hatkirby on November 4th, 2010 at 12:30:13pm
πŸ‘ 0 πŸ‘Ž

Okay, as mentioned previously, I greatly dislike Ubuntu 10.10. You may too! And if you do, I want you to check something out. Does your computer have an Intel-based graphics card? You said "yes", right? Okay, good. Because then I have some good news: apparently the Intel driver for Ubuntu sucks. Oh, wait, that wasn't good news, but this:

How to install an updated Intel graphics card driver for Ubuntu 10.10!

Since installing this new driver, stuff has stopped getting stuck on my screen. I searched for this driver after a particularly annoying incident with a random square on the screen that wouldn't invalidate, so I had to kill X. Note: this won't fix some of the other annoying bugs, like the super slow gnome-terminal, the mouse with a mind of its own and the multiple attempts to unlock the keyring when I log in.

Anyway, yeah, if you've been having troubles with Ubuntu 10.10 and are ready to install Mac OS X illegally but have an Intel graphics card, first, wait: try this. If it doesn't work, then you can illegally install an OS. Not really.

EDIT: After some more annoyed yelling, I discovered that my mouse problems are likely the fault of Ubuntu 10.10's touchpad driver. I found tons of errors like the following in syslog:

[69276.814022] psmouse.c: TouchPad at isa0060/serio1/input0 lost synchronization, throwing 4 bytes away.
[69277.333722] psmouse.c: resync failed, issuing reconnect request
[69293.813324] psmouse.c: TouchPad at isa0060/serio1/input0 lost synchronization, throwing 3 bytes away.
[69294.826388] psmouse.c: resync failed, issuing reconnect request

I found some other people who have the same problem. We're having tea on Tuesday, wanna come? /jokewhat Anyway, I hope this gets resolved soon because December 25th is still like two months away.

Hatkirby on October 30th, 2010 at 8:16:31am
πŸ‘ -1 πŸ‘Ž

Okay, folks, as I mentioned last week, Ubuntu 10.10 Maverick Meerkat came out. I decided to use it for a week before writing a post about it (9.10's was a bit hasty). And, you know what? It's just getting worse. Kind of makes me happy that I like Macs now because Ubuntu is kind of starting to anger me.

Okay, first of all, the upgrade itself. The upgrade was fantastically easy. I'm telling you, the upgrades are getting easier, but the OS is getting worse. But last time, easy meant "torrent the alternative CD from Windows and install half of the packages from there". This time, easy meant "click Upgrade." Really, I went to Update Manager and I clicked Upgrade. And it worked. Wow.

Anyway, I then had Ubuntu 10.10 and was find that I liked quite a lot of things about it. First of all, as I mentioned earlier, the Ubuntu Font. It's just freaking awesome. It's used pretty much everywhere now and combined with rounder controls and a pastel-ish color scheme, Ubuntu looks prettier than ever. Not prettier than Mac OSX, though, but still, pretty nice.

The second thing I noticed was that the flashing problem had diminished. In Ubuntu 10.04, whenever I closed the lid of my laptop, when I opened it again, EVERYTHING WOULD START FLASHING. For a while. It was UNBEARABLE. Well, in 10.10, the problem is mostly gone. It now only flashes once or twice. Not as annoying.

However, the good things seemed to stop there and the whole experience started to get very, very annoying:

  • I found that, with certain wireless access points, my computer absolutely refused to co-operate. It would (sometimes) let me connect and occasionally allow me to load a page or two, but it would be infinitely slow and it would just stop serving me pages. I eventually found out that blacklisting a bunch of alternate drivers for my wireless card fixed the problem, but still. Very annoying.
  • Slow. SLOW SLOW SLOW. What has happened? For one thing, the mouse occasionally just gets "stuck". And by occasionally, I mean increasingly frequently. And sometimes, the mouse moves as if it had a mind of its own: the other day, the mouse was actually avoiding Drifty's name as I tried to initiate a chat with her (I eventually used the keyboard). Also, when I use the terminal, text appears very slowly.
  • When you start to drag an image, and then let go because you've changed your mind, it gets stuck there until you restart X. Actually, it's not just images, random stuff in general can get stuck on your screen. An autocomplete popup is now stuck on my screen. I am very, very angry.
  • Okay, for some reason, GNOME just went insane. Both the dock and the panel at the top vanished and a Nautilus window filled the screen. I found out that the display was semi-frozen--moving the mouse around changed the cursor and made popups appear and I could click on menus, but I had no clue what was giong on. I had to kill X. With all of this X killing that's going on, I'm losing a ton of work. This is really frustrating.
  • After another week of testing Ubuntu 10.10, I've found that a whole ton of things can get frozen on the screen accidentally. You can usually remove them by repeating whatever trigger caused them to appear in the first place. However, it's still very annoying and argh, Ubuntu 10.10 is just so slow. Today, the mouse suddenly froze for a very long time (about 5 minutes) while the wireless disconnected (though I was in a high-signal area) and refused to reconnect until I restarted the computer.

All in all, Ubuntu 10.10 really annoys me. Really can't wait until I get a Mac. :P

Hatkirby on October 21st, 2010 at 4:44:22pm
πŸ‘ 0 πŸ‘Ž

While working on the rewrite of Four Island (go 3.0! :D) in Ruby on Rails, I hit a roadblock. Four Island, since perhaps Layout 3, has had an old concept of multiple layouts and since the Theme Switcher, has had the concept of being able to switch between them. How was I going to go about this in Ruby on Rails?

Well, actually, it's quite easy with the help of an awesome gem, [themes_for_rails](http://github.com/lucasefe/themes_for_rails). Note that's the Rails 3 version, if you still use Rails 2 (and most people do), you'll need [theme_support](http://github.com/zedalaye/theme_support). theme_support does technically work for Rails 3 as well, but I don't like it because you can only override views; if there's no corresponding view in the app/views hierarchy, it won't work. This annoyed me because my plan is to have the main site layouts in themes and have the admin panel in app/views because the admin panel never changes but, while pre-3.0 layouts share a ton of code, they are rather different.

Anyway, this was going really well, but there were three things I had to know. First, did it support asset hosts? Second, did it support HAML? And third, did it support SASS? Asset hosts allows you to specify that all assets (javascripts, images and stylesheets) be loaded from an alternative, cookie-less subdomain. And yes, it worked. HAML is an awesome alternative to RHTML/ERB that is really elegant and organized. And yes, it worked. SASS, a sub-project of HAML that is used to generate stylesheets, allows you to nest declarations which I believe makes things make so much more sense. And no, it didn't work.

What? Why? Well, the way SASS works is at runtime, it reads your SASS file and converts it to a CSS file. Since my stylesheets were stored in the themes hierarchy, SASS didn't know where to find them and thus the CSS files weren't generated and my layout couldn't find the stylesheet. However, I wrote a small script that you can place into your config/initializers directory to get SASS working with themes_for_rails:

# Adds Sass support to themes_for_rails

themes = Dir.new 'themes'
themes.each do |theme|
  unless theme == ".." or theme == "."
    Sass::Plugin.add_template_location(
      Rails.root.join("themes/#{theme}/stylesheets/sass").to_s,
      Rails.root.join("themes/#{theme}/stylesheets").to_s
    )
  end
end

And there you go! Sassy themes. It'll probably work with theme_support too, but you may need to modify it a bit.

Hatkirby on October 15th, 2010 at 8:39:46pm
πŸ‘ 0 πŸ‘Ž