Bill Withers and Mice in Java

Posted on 29th April 2011 in Something Daily

The few weeks before finals are never fun. I have way more stuff to be doing than time to do it in, and my desire to be productive is inversely proportional to how nice the weather is. But I think I spend too much time thinking about how much work I should be doing, which generally increases stress instead of decreasing it. Let’s just talk about what’s already done.

I had a long mix session last night for my second project for recording technology class, a cover of Bill Withers’ “Use Me”. The session seemed to go on forever, and I was totally cranky and tired by the end of it, but listening to our mix this morning, it sounds even better to me than it did last night. This is our rough mix, check it out.

Use Me by Raised by Robots

I played the clavinet part (not a real clav, unfortunately) and helped engineer and produce the whole thing. This has been a fun project, and it’s awesome to have another track for my portfolio.

I also was asked to present a project I did for my CS 101 class last year to the current 101 class, to give them ideas and confidence for the upcoming final project. I made this game where your cursor is a mouse and your move around collecting falling cheeses and avoiding mousetraps. Since making it, the laptop that I bring around with me has become an Ubuntu machine, and as a result, certain things I was doing in terms of graphics weren’t working anymore. So I just spent an hour or so fixing my year-old code to work on my new system, and taking a trip back in time as I did so. It’s interesting to look at my own old code and see how my practices have developed. When I finished the mouse game last April, it was throwing multiple NPEs per second as a result of some oversights I made at the time that I didn’t realize would affect performance on some systems. Clearing those up did the trick, though, and now I’ll be presenting my old work to a class of hopeful 101 students. I’m actually really excited, I love the opportunity to share knowledge (and be in a position of some power).

I think I’m going to put up the code for that old mouse game via webstart some time soon. It’s actually really addicting.

Ubuntu Natty Narwhal first impression

Posted on 28th April 2011 in Something Daily

So of course I downloaded Ubuntu 11.04 Natty Narwhal at my earliest convenience, which ended up being 9:30 this morning. I got incredibly fast download speeds for the computer science building (1100 kBps), which is strange for a network that usually kicks me off once every twenty minutes. But yeah. I downloaded it, and I’m using it now, and I like it, for the most part.

Good things about it include the new docking and window sizing options in Unity: you now have the option to automatically size a window by dragging it to a side of the screen. Docking on the left or right edge maximizes the window vertically and gives it half of the total screen width, so it’s easy to place two halfscreen windows next to each other. Also, docking on the top of the screen now maximizes the window, which I so far find alternately annoying and convenient. I find myself accidentally maximizing windows when I just wanted to move them up. Despite that, this is a great new addition to the user interface, because it provides a number of intuitive ways to do the same thing, none of which are confusing. This means that if you’re just meeting Ubuntu after using a different OS for a while, it’s more likely that you’ll have an easy time getting used to the interface.

The fact that the upper menu bar doesn’t really exist anymore is awesome. It bothers me to have “fullscreen” applications that don’t actually use the whole screen size, and this problem is diminished significantly with the consolidation of the global menu bar and the application menu bar. The new Firefox does something similar, doing away with some of the older default menu buttons in favor of a more streamlined, functional design. I like it.

I’m not so sure about the new applications dock menu thing. I’m having trouble finding the view settings for it, which I want to change because it looks too fisher-price with the huge rounded square buttons. I don’t know if there are other settings, but I’d like to use one if there are. The trash, desktop, and dock are all gone now, which makes me think of Mac OS X’s UI: everything is contained in the dock, with open applications indicated only there, instead of the older, Windows-esque tray method that contained an entry for each window. I’m ok with this, but it’ll take a little bit of getting used to.

Of course I think it’s awesome. I don’t have to tell you that. You knew that already. I love Ubuntu right now. This is the best interface it’s had since at least Intrepid (which I mention only because that’s the oldest distribution I’ve ever used). Download Ubuntu. It’s free, it’s awesome. Go.

comments: 1 » tags: , , ,

[insert name of beatles song here]

Posted on 24th April 2011 in Something Daily

Yesterday I got the first comment ever to be perpetrated on this blog that involved a positive reaction to one of my computer tutorials. It was the one where I explain how to make the keyboard backlight buttons work on Macbooks running Ubuntu. Surprisingly, someone actually followed the steps and it worked for them! Unexpected, for sure. Yet, of course, totally awesome.

I spent most of this wonderful afternoon in central park with my friend Sarah, just chatting and enjoying the very nice weather. I would have felt awful not spending at least part of today outside. I was tempted to wear shorts – that’s how warm it was, you guys. I got over my fear of sitting in the grass in new jeans, and I was reminded of the Tower of Terror by all the buildings surrounding central park. You know, they kind of look like this when you’re in the park and there are trees blocking the lower portions.

At least that’s what I think whenever I’m in the park. It reminds me of when we went there, and I rode that ride for the first and last time. Falling straight down isn’t really my thing. I like falling sideways, or forward.

I continued learning assembly, C, and as a result, memory architecture, today, and learned an interesting lesson in the process. Of course, this makes total sense, but I had to learn it firsthand. I’m following a tutorial that uses Linux and the GNU debugger to step through programs and teach assembly, and I decided to try it on Mac. I downloaded XCode and started running all of the tutorial examples, but soon found out that all of the register names are different under Mac. EIP wasn’t doing anything for me other than causing an unknown register error. So I examined the registers, and sure enough, they were all totally different from the Linux ones. I’m sure they have similar functions, but for now, I’m sticking to Linux, because that’s what the book I’m using covers, and it covers it very well. Interesting lesson, though. I also noted that the memory addresses that my Mac was displaying were twice as long as those on my Linux system, which makes a lot of sense as the Mac has 4GB of RAM and the Linux box only has 2GB. Hooray for learning.

Maybe I’ll go watch a movie tonight. Maybe I’ll just keep coding. Both are fun.

Free SNES Sprites? Yes Please.

Posted on 29th March 2011 in Something Daily

I discovered a site called nes-snes sprites a few days ago that has a huge collection of (you guessed it) NES and SNES sprites, often in all of their animation states, available for download. Right now it’s just great for nostalgia value for me, but I’m thinking about making some gifs with them, or maybe putting one on the header of my site. The site also has a decent collection of soundtracks from those two systems, which I’m almost inclined to put on my iPod and listed to for fun. I have a serious thing about chip music.

Posting daily starts to become difficult around the middle of the semester, for one reason or another. Sometimes it’s the increasing workload from classes, but it’s always the “stuff is happening” mindset that starts to kick in soon after midterms. Even if it’s not incredibly busy, there’s this feeling of having places to be and stuff to do. At least there is for me. Of course, I feel like I always have some project or another, and the more enthusiastic I get about whatever it happens to be, the less time I find myself having to do almost anything else. But that’s just me. Also, my living space is quite often much louder than it needs to be, mainly due to myself and my roommates all being close to 20 years old, fans of music, and owning big speakers. This sometimes makes it hard to concentrate on anything, which is a big reason that I’ve been spending more time in the courant library recently.

Speaking of my website, the design/development process is going well. The method I had been using to retrieve a Twitter feed via the Twitter API wasn’t working under Ubuntu, so I figured I’d at least attempt to make that better. As it turns out, I’m able to use a very similar method to the one described yesterday to get the tweet data from an RSS feed. Also, I’ve added some cool-looking stylistic elements to the homepage design, and given the header (my name) the Double Dragon treatment, which I was able to do with a font I found here and a bit of Gimping.

Also, my roommate gave me his GameBoy Pocket today! The stars have aligned in my favor! I was just starting to think about buying one, and then this happens. Seriously, that is awesome. I also picked up Street Fighter II Turbo yesterday, which is of course much harder than I remember it being. Ryu is quite annoying with the Haduoken.

Let it be known: I will eat my shoe

Posted on 14th February 2011 in Something Daily

I just got a package in the mail, and when I was going to get it I was so convinced that it was going to be my Tropicana gear, but it ended up being Valentine’s Day cookies from my mom. I was really excited for the Tropicana stuff, but cookies are very awesome too. Thanks mom. I’m expecting the gear tomorrow then, or (hopefully not) the day after that. It just needs to get here already. Along with letters from my friends and the confirmation of my double major declaration. I’m waiting for a bunch of stuff in the mail. And as I do so, I’m getting pumped up by I Get Wet. I honestly used to hate that album, but it’s growing on me rather quickly. I feel the same way about it as I do about Blink-182, in a sense – I acknowledge the fact that it’s simple and kind of idiosyncratic, and then stop worrying about it and jam out.

I finally finished getting all the star coins in New Super Mario Bros. Wii, which took an ungodly long time, even with our whole suite playing in a shared account. I decided that I’d just go ahead and do it today, but level 9-7 is so unbelievably annoyingly difficult. I don’t want to talk about it. I have bad memories attached to that level. The second star coin is stupid if you don’t have the propeller hat – which I never did – and I ended up trying it about forty times. I did succeed though. This was about an hour ago.

I was playing Mario instead of doing something productive partially due to the fact that I chose today to once again reconfigure my MacBook Pro – I deleted the Ubuntu partition (decided I have enough Ubuntu on my old MacBook, and Portal 2 is coming out for Mac) and reinstalled Snow Leopard, crossing my fingers very hard that my automated backup scheme had been working correctly. Turns out it had been. It’s gone through a lot of revisions over the last few months, but it works awesomely now. I am, once again, proud of myself. Also because of that piece I wrote in LSDJ over the weekend; I still think that sounds rockin. I rerecorded the guitar since it was a little bit out of tune, it’s way more rockin now. Check it out.

And I finally preordered Portal 2 on Steam today. It comes out on a Monday, and let it now be known that I will not stop playing on that Monday until it’s finished. If I can’t, I will eat my own shoe.

NetBeans in Ubuntu – “Project file is read only”

Posted on 8th February 2011 in Something Daily

This morning, I finally managed to ruin my Ubuntu installation for real. That is, the Linux partition on my MBP; I altered the X11 config file in what was aparently the wrong way, and I couldn’t even boot into single user mode. I had to reinstall the OS. It’s ok though, there were a bunch of things that were kind of messed up about it that I couldn’t fix. I’m just glad I posted some howtos here, because I didn’t write them down anywhere else and I need to restore my Ubuntu to its former glory.

Before that catastrophic failure, though, I did successfully install Steam under Wine, as well as solving an interesting NetBeans issue about which I couldn’t find any documentation online at all. For that reason, I feel like it’s kind of important to at least mention my problem here, in case you ever have the same issue and can’t find any help online. I’d been using NetBeans under Ubuntu 10.10, and the project that opened when the proram launched was one I’d been working on for a while. Yesterday when I tried to start Netbeans, the main window would show up, frozen, along with a dialog saying that the project file was read only. Netbeans was totally frozen, and I had to force quit. Updating the default JDK from the command line had no effect, neither did uninstaling/reinstalling NetBeans. It eventually occurred to me, though, that the default project data had to be stored somewhere, and I figured that place was probably the /home/emmett/.netbeans directory. After uninstalling NetBeans, deleting that directory, and reinstalling, the default project had been reset and my problem vanished. Great success.

What do you mean, “There’s no sound?”

Posted on 28th January 2011 in Something Daily

The thing about electric gear is that, a lot of times, it doesn’t work right. Hard drives fail, CDs get scratched, files get corrupted, Gameboy screens get cracked, whatever. Accepting these failures as inevitable, it’s the job of the troubleshooter (or “tech”) to correctly diagnose the problem and then efficiently and nondestructively resolve it. Simultaneously working as a studio tech and being poor, I’m beginning to gain some real experience in beating what usually seems like an insurmountable issue upon first inspection, regarding both the school studios and my own personal recording and computer gear.

My new-used copy of F-Zero for SNES, for example, wouldn’t start when I loaded the cartridge, no matter how much air I puffed into the contact. This isn’t an issue for me anymore, though, for any game, as I’ve discovered that a bit of isopropyl alcohol and a cotton swab fixes that problem a good deal of the time (in my experience, 100 per cent of the time). I did something similar with my friend’s Double Dragon NES cart, whose contacts were actually coated on both sides with a thick layer of white paint. The paint wasn’t anywhere to be found on the body of the cartridge, which makes me think that someone deliberately painted the contacts to make it unplayable. Who would do that to Double Dragon? Rubbing alcohol got it right off, though.

Of course, this is a very basic example, but it’s indicative of my movement away from the panicked feeling of having something for which I paid a lot of money suddenly not function properly. My tendency is to go into crisis mode as soon as my computer, SNES, microphone, etc. starts not working – a strategy which typically compounds the issue rather than resolve it. As I learn more about the common fixes and methods of discovering the uncommon ones, I move away from this habit. I attempted to repair my $300 condenser microphone not long ago, and though it was panic that drove me to remove the casing, I learned from the experience.

I woke up this morning, booted my Linux partition, and found myself staring at a hung startup screen. I could feel a bit of the old panic, but I knew at least that my files were all safe on the Mac volume. The most important thing I could do at that point was carefully remember any and all changes that I’d made to the system between this boot and the last one. That, combined with a few well thought-out googlings led me to the realization that I’d inadvertently disabled the driver for my GPU, causing a hung boot every time the graphics started to load. At that point, as with most Ubuntu issues, it was just a package download of the right driver to make it all better. This was a scary experience, but I’m a better tech for it.

Time to get outside

Posted on 11th January 2011 in Something Daily

First of all, I have a few corrections to make to yesterday’s guide. As it turns out, turning off journaling on an HFS+ partition is not a good idea. There is a (slightly more involved) method of getting read permission from Ubuntu, which is outlined here. Essentially, this tutorial boils down to using a new admin account to change the default Ubuntu UID and GID to those of their OS X counterparts. I could reproduce the instructions here, but I don’t really feel like it. Suffice to say that sudo fdisk -l will get you a list of the volumes on your drive, and adding [os x partition] /mnt/mac hfsplus user,ro 0 0 to /etc/fstab will cause your OS X partition to automount (albeit in read-only mode).

Those small tidbits are the result of a considerable effort today, during which I spent a lot of time attempting to gain the permissions in order to symlink my home directories together. Also, I learned that one of my portable hard drives may be breaking. At one point, I managed to lock myself out of my iTunes Music directory, which was certainly an interesting problem to troubleshoot. The point is that I spent pretty much my whole day doing this, and the payoff is rather tiny. I don’t even have write permission yet….bummer. I also woke up early this morning to drive out to Phoenixville so the allergy doctors could stick stuff up my nose – the uncomfortable feeling in the back of my throat still hasn’t completely cleared up.

I’m leaving with my family soon for our trip to Arizona/Las Vegas, and I don’t think I’ll be bringing my computer with me. As such, I’ll be blogging from my iPod when time and proximity to wifi allow (both of which I assume will be negligible). But going on this trip means that I’m getting very close to my return to NYC! As should be glaringly obvious from my posts, I am quite excited to be back in the city, and to start classes again. Data Structures will be cool. I don’t know how much I’ll get to post in the next few days, but hopefully it’ll be enough to satiate my desire for a feeling of productivity.

Check it out: I found a profile on Shigeru Miyamoto in the New Yorker today. It’s old, but still.

MacBook Pro Backlit Keyboard in Ubuntu Maverick

Posted on 4th January 2011 in Tutorials

I was browsing around a little while ago and it occurred to me that the keyboard backlight on my MacBook Pro 5,4 wasn’t working under Ubuntu 10.10 Maverick Meerkat. I found a few resources online to help with the problem, and it ended up teaching me a lot. I wrote a script that changes the numeric string stored in /sys/class/leds/smc::kbd_backlight/brightness, then set the script to be run every time the keylight increment/decrement buttons on the keyboard are pressed. Here are the steps I took, in case you want to try this for yourself.

I worked up a shell script that, depending on the string passed from the command line, either increments, decrements, sets to zero, or sets to 100% the value of the backlight brightness.

Go ahead and use the code, or write your own, I don’t care. You can either copy and paste from here into a file called keylight in /usr/bin, or download the file here.

Once you have /usr/bin/keylight on your system, run sudo chmod +x /usr/bin/keylight to make the script executable. You’ll know that you forgot this step if you get a “command not found” error when you try to run it.

To test the script, run sudo keylight full. The keyboard backlight should come on. To turn it off, run sudo keylight off. I use an alias to avoid the necessity of sudoing every time – that is, I added the line alias keylight='sudo keylight' to the /home/emmett/.bashrc file. Still, a password is required when running the script. Since we want this to be controlled with the keyboard, we have to override that somehow. This can be accomplished by adding the following lines to /etc/sudoers (run the command sudo visudo to edit this file).

Cmnd_Alias KEY = /usr/bin/keylight
%admin ALL = (ALL) NOPASSWD: KEY

(it’s hard to see, but there is an underscore between Cmnd and Alias – that is, Cmnd_Alias)

These lines tell the computer that, when running the keylight command, members of the admin group do not need to enter a password. With that accomplished, all that’s left is to create new keyboard shortcuts for the script. In System->Preferences->Keyboard Shortcuts, click “Add”. Fill the “Name” field with something like “Keylight up”, and enter sudo keylight up into the “Command” field. (Don’t forget the sudo!) Click OK, and change the hotkey for the command to the F6 key (XF86KbdBrightnessUp). Repeat the process for keylight down, keylight full, and keylight off. I use the F5 key for down, and add Ctrl for full and off.

Follow this process, and the backlight on your keyboard should work like it does under Mac OS X. At least, it does for me. Feel free to comment with feedback, comments, or additions you make to my code. Thanks for reading!

Munch Up

Posted on 4th January 2011 in Something Daily

Downingtown, PA – Day 11

My time at home so far has been marked by a surprising lack of downtime compared to previous winter breaks. The family trip to Canada to see family took up a lot of my on and around Christmas day, and our recent day trip to our beach house to do a bit of housework for the coming summer season interrupted what I had anticipated would be a relaxing break. I might mention here that, based on my past experiences with winter breaks in my family, this anticipation was unfounded…but I’m still allowed to dream.

Apart from these family trips (with another to Las Vegas upcoming), I’ve been seeing a lot more of my friends at home than I expected to – so much so that it’s actually taking up most of my time on any given afternoon at home. I bowled, walked dogs, and video gamed/bro chilled with three different people yesterday, and it was a bit draining, to be honest. They were all fun, but I was so tired at the end of the day (at 2 AM, go figure). Speaking of, I did something very much unlike myself this morning: I slept until ELEVEN THIRTY AM. I honestly cannot remember the last time I did that. It feels kind of bad, actually. My whole morning was gone! I mean, I’m well rested now, but my plans for the morning are in shambles.

So that’s why I’m currently eating a bagel, drinking some Florida’s Natural, and listening to My Morning Jacket while blogging at 1:30 PM. It’s the breakfast of champions. Today I may draw (more like start to draw) a new Three Stegosaurus Moon header; at the very least I’ll try to come up with some ideas for one. I’m getting tired of my poorly googled and GIMP-ed travesty, so I’m thinking about some different designs that are interesting but not too hard for me to doodle well. I think that’s a better description of what I do. I hardly consider it “drawing”, at least in the sense that I wouldn’t tell anybody that I “draw” – I feel like doodling is a much better way to describe it.

I installed Skype on my new Ubuntu MacBook Pro this morning, a process that I expected to be a huge hassle like my attempt to do the same on my white MacBook. Of course, I don’t mean the actual installation of the program itself, but the activation of the built in camera and microphone for video calls. On my white computer, this ended up being more trouble than it was worth at the time. I did manage to get both working in Ubuntu, but even after that, the response from both was still choppy and unusable for conversation. I expected the same with my newer computer, but as it turns out, the camera and mic work out of the box! I didn’t have to do any additional setup this time. In case you’re wondering, it’s Ubuntu 10.10 on a MacBook Pro 5,4. I did have to unmute the mic and use alsamixer to unmute the front speakers, but that’s it. No configuration required. Ubuntu is fantastic. I want to find some cool new software. I just got Skype, VLC, and NetBeans this morning, and I’ll do a bit more searching and configuration.

It’s been a while since I recommended music. My Morning Jacket are awesome, specifically their albums Evil Urges and Z. I’m listening to Evil Urges right now, appreciating even more the idea I have that My Morning Jacket is “big room music”, meaning that it sounds awesome when you play it on big speakers in a huge room that adds a lot of reverb to the track. Jim James’ vocal typically has a lot of reverb on it anyway, and putting it in a big space definitely adds something to it. That being said, it’s just good music – it hardly matters where you listen to it. If you ever get the chance, though, play “Mahgeetah” or “I’m Amazed” in a big auditorium. Make sure you’re in a transitional period first, or at least in the right state of mind – it’ll change your life (thanks, Natalie Portman).