self.__dict__
I haven’t posted a non-computer entry in a long time, so here we go. I’ve been relaxing over Spring Break, despite my 11-point list of things I wanted to accomplish over break (I’ve done 4ish). But, I feel much better than I did over the past month or so; passing ME 410 definitely made this week much more awesome than it was originally. I moved out of my studio apartment that cost $515/mo. to a much cheaper one – I’m shackin’ up with the girlfriend. She has plenty of space, and splitting the rent will save a decent chunk of money. So far, it’s gone quite well and I’m finally getting the apartment cleaned up after all of the mess around moving.
I hung out with Tammy the other day and went to a birthday party, both were pretty nice; it was good to get out of the house that I’ve been in for most of the week. Basically, my plan for the near future:
- Coast through my last quarter at OSU
- Find an apartment without seeing it, via housingmaps.com
- Do the graduation thing, yadda yadda yadda
- Pack up all of U. and my things and put them on a truck bound for Seattle
- Say goodbye for the summer while U. goes to Dresden, bummer.
- Get on a plane and fly to Seattle
- Start working for Microsoft
I did find out several of my friends will be in the area over the summer (or permanently!), so that’s pretty awesome. I’ll at least start out with more people I know in Seattle than I had last time, which will be good. I’m still not looking forward to empty apartments though. I will however enjoy finally starting the next part of my life instead of langishing in the current one – that will definitely be exciting. And new. Excitanew, if you will. Now if only I can convince Crazy Timmels to teach in Seattle I’ll be good to go.
Graphs in LaTeX using GNU Octave
The other day, I finished two assignments in my crappy ME 410 statics class that involved me making graphs and writing out equations, and it was required that it be done on a computer. For the first one I used OpenOffice and it was really ghetto; I was determined to do a “proper one” for the second assignment, and so I went out to learn LaTeX and how to generate graphs using GNU Octave, which is written to be (mostly) syntax-compatible with Matlab. I also wrote a really hacky script that helps in compiling LaTeX into the PDF file so you don’t have to run the same commands all the time.
What is LaTeX?
For those of you who haven’t heard of LaTeX, it’s a program that creates formatted PDF documents using a text file (like a web browser draws a page using HTML). Why go back to pre-Word days? Well, LaTeX is really good at doing text layout and generally making your document look good and consistent; it’s been in existence for almost 23 years. For example, you don’t have to worry about where to put your diagrams to make them fit or how to make a document look nice, it does that all for you. A majority of it was also written by Donald Knuth, one of the best computer scientists ever. The fact is, if you have to write mathematical equations in a document, LaTeX is the best and easiest way to do it. Period.
Generating graphs using Octave
For generating graphs, I used a feature of Octave that connects to GnuPlot, a plot rendering program. Here’s my Octave file (which is a good example file because it’s pretty simple):
gset term postscript eps
theta = linspace(0, 60, 200);
function r = Na(theta, L)
W = 800*1000;
w = 20;
w_one = 200*1000;
po180 = 3.14159 / 180;
r = (w_one * 1.5 + (w_one*L).*(L.*cos(theta * po180)) – W*(L-3.3)) / 2.3;
endfunction
xlabel("T")
ylabel("Na")
plot(theta, Na(theta, 2), "-;aaaaaaaaa;", theta, Na(theta, 4), "-;bbbbbbbbb;", theta, Na(theta, 5),
"-;cccccccccc;")
Run this file with the command octave the_file.m and you’ll get a file called ‘the_file.eps’
Most of the file is pretty self-explanatory, there’s some things to note here; the first lines tell Octave to write to a file labeled ‘the_file.eps’ (if you want color graphs, add the word ‘color’ after ‘postscript eps’). Also, label your graphs using simple one-word labels, don’t worry about how they look. Later, we’re going to use these labels and replace them with prettier ones. Also, the reason that we use ‘aaaaaaaaa’ as a label is a hack to get the spacing right; not very elegant.
One more thing for people who are stuck with errors in the equation, you have to use ‘.*’ when you multiply a scalar by a vector (in this example, theta is the vector). Basically, just try to rearrange your equation so the non-vector terms are all together and replace the ‘*’s next to the vectors with ‘.*’s
Integrating the graphs with LaTeX
Next, we write a LaTeX file with our document. There are many tools to help you do this such as Kile and I won’t get into a general LaTeX tutorial here because I’m lazy. Here however, is how to get your graphs into your document
\usepackage{graphicx,psfrag,floatflt,hyperref}
****** Some text in your document ******
\begin{figure}[h]
\psfrag{Na}{$N_{a}$}
\psfrag{T}{$0 \leq \theta < 60^{\circ}$}
\psfrag{aaaaaaaaa}{\tiny{$N_{a}, L=2$}}
\psfrag{bbbbbbbbb}{\tiny{$N_{a}, L=4$}}
\psfrag{cccccccccc}{\tiny{$N_{a}, L=5$}}
\includegraphics[scale=0.93]{the_file.eps}
\caption { Plot of normal force at point A showing various lengths }
\end{figure}
We use a package called PSfrag that lets us replace labels in the graph with labels generated by LaTeX. This is important because it allows you to put in mathematical symbols into the graph, and it looks nicer too.
How do I get the final output?
To get the final output, you run a series of commands on the .tex file (latex the_file.tex; dvips -o the_file.ps the_file.tex; pstopdf the_file.ps), but this quickly becomes tiring after a few rounds, not to mention you’ll forget to regenerate your graphs when you change them and get confused. To solve this, I put together a very hacky Ruby script that basically just builds everything in the current directory. It also does the correct thing for BibTeX if you’re using it (and if you have to cite something more than once, you should be because it makes your life much easier).
Download the LaTeX build script here!
I wrote it in Linux but no reason it shouldn’t work everywhere. Run it as such: latex_build.rb /path/to/directory or leave the directory off for the current directory. If all goes well, you should end up with a PDF; if not, check the output of the script, it halts on errors if it runs into any (except BibTeX errors, long story).
Blender post – brought back to life
Thanks to Brian from the CS department at Aalborg University, I now have my original post back. Thanks a lot!
I’ve always wanted to become better at 3D modeling ever since both my senior project as well as after finding out how cool graphics are going to be in desktop applications like Windows DreamScene as well as Beryl, but getting a 3D modeler for less than $300 is pretty tricky. Most of them like Maya or SoftImage|XSI cost a ton of money, and the free ones are usually pretty limited editions of their costly cousins.
The Blender project has just released the newest version of their 3d modeler and while I knew about this project before this, the program has come a long way. However, here are some things I found to ‘fix’ what I originally didn’t like about Blender.
- Originally, once I figured out how to pan the camera around, I thought, “Man, Blender’s rendering is awful!”. That’s because I didn’t realize that Blender draws everything in Orthogonal mode by default. Hit ‘5′ on the Numpad and everything looks the way it should. Orthogonal mode is actually quite handy though when you’re trying to line stuff up.
- Blender’s rotation mode is set to trackball by default, which might make sense to professionals, for me it means that I often end up gimbal locked at some funny angle. In preferences, you can change the rotation mode to Turntable, which fixes it.
I’ve been following the Blender n00b to Pro tutorial and it’s pretty decent, I’m hoping to use Blender to make some great 3D animations for my final in ISE 573: Cognitive Interface Design class; we have to design the systems to coordinate a bomb squad and I’m in charge of designing the interface for the robot bomb disarmer. It’s especially tricky because the professor did his master’s thesis on controlling robotics in these kind of situations, so I’m sure he has a lot of opinions on the subject.
The end-all definitive guide to getting wireless working in Ubuntu Edgy Eft
Alright, people are always asking at OSU Opensource Club, “How do I get my wireless card working?” So instead of answering this question over and over, I decided to write this guide instead.
Step 1. Do I have a wireless card?
The first thing we have to figure out is whether Ubuntu knows about the wireless card. Unfortunately, some wireless companies refuse to tell the community how their cards work and don’t see the demand to write Linux drivers. In this case, people are working to reverse-engineer these wireless cards but it’s still very sketchy right now. If you have Intel Centrino, you’re in luck because these will almost certainly work without any added nonsense.
To see if your wireless card is recognized, we will run some commands in the Terminal. Of course, you can do almost all of this without it in Ubuntu, but it’s much easier to copy and paste text then to go through lots of dialogs. To start the terminal, go to Applications->Accessories->Terminal, and type iwconfig.

After running the command, you should get something similar to this:
lo no wireless extensions.
eth0 no wireless extensions.
eth1 IEEE 802.11b/g ESSID:"Intarnet" Nickname:"Broadcom 4318"
Mode:Managed Frequency=2.417 GHz Access Point: 00:16:01:4A:C5:48
Bit Rate=11 Mb/s Tx-Power=18 dBm
RTS thr:off Fragment thr:off
Link Quality=56/100 Signal level=-49 dBm Noise level=-70 dBm
Rx invalid nwid:0 Rx invalid crypt:1345 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
If you see this, you should be good to go. If you only see “no wireless extensions” for every entry, your wireless card isn’t supported natively.
My wireless card isn’t here!
Fear not! Your wireless card can still work using a program called NDISWrapper. This allows you to use Windows wireless drivers in Linux. To get this to work:
- In the terminal window you opened, run lspci -nn. Then look for the numbers highlighted in red here:
05:02.0 Network controller [0280]: Broadcom Corporation BCM4318 [AirForce One 54g] 802.11g Wireless LAN Controller [14e4:4318] (rev 02)
- Go to the NDISWrapper Compatibility List and search the page for the ID, then download the driver. After unzipping, you should end up with (at least)two files, a .INF file and a .SYS file.
- In the terminal run sudo apt-get install ndisgtk, then go to System->Administration->Windows Wireless Drivers. Install the Windows drivers by browsing to the .INF file
- Try iwconfig again. If it doesn’t work, run sudo modprobe ndiswrapper in the terminal then try again. If it still doesn’t work, you may have to try another driver.
Install NetworkManager
Now that you have your wireless card working, let’s install a program to let us select wireless networks directly called NetworkManager. Run the command (in the terminal!) sudo apt-get install network-manager-gnome, then reboot. You’ll be greeted by a new icon:

Congratulations! Your wireless should work with standard access points.
What about OSU Wireless?
Now, for OSU Wireless, you need to do a bit extra. Make sure to register to get your username (usually your OSU username + ‘w’, mine is “betts.62w”) and get your password. When you try to connect using Network Manager, you should get a dialog similar to this one:

Only fill in the two fields colored in red, NetworkManager sets the rest of the fields correctly by default. Some people report they don’t get this dialog when they try to connect to OSU Wireless; if this happens, make sure your NetworkManager is up to date (it should be >= version 0.6.3). It could also be that your native wireless driver isn’t finished, so try the NDISWrapper driver if you aren’t already using it.
Update: I was able to get the actual OSU Wireless dialog
Mirror lake 2006
I wish I had this earlier in college
Everything you need for undergraduate computer science math stuff, my life would’ve been a lot easier had I known about this:
NetworkManager + OSU = Very Yes
I found out yesterday on a whim just to see if it would work, the latest versions of NetworkManager will successfully recognize and connect to OSU’s Wireless network without any scary configuration or editing WPA Supplicant files. Very awesome, and even easier than getting Windows to work. I’m not sure which version it started working on, as I compiled mine from CVS but mine is at least a few months old.
PS: Speaking of NM, my patch to enable smart connect in Gaim seems to have been accepted and is somewhat popular, so that’s pretty cool.
Oh yeah, I have a blog?
Oops, maybe I should update this thing more often. Things that are going on in my life, in bullet-point form:
- Listening to the Beatles a lot
- Working on Rawhide Frontier, my senior design project
- Learned a bit of a new programming language
- Seeing someone new, which is pretty awesome-great
- Getting ready for rest-of-life (aka end of “college”, even though I’ve got two more quarters, it won’t be quite the same after the kids are all graduated)
- Shaking my fists at Haskell Conference 2006, because it’s 7 days after I leave the west coast. The founder of the OSU Opensource Club is on the board and I recently met him.
- Reaffirmed my love for Lisp, the one true programming language.
- Looking forward to Microsoft and Seattle this summer, it should be really awesome. Lots of hacking the gibson will be done.
PS: I just tried to type “:w” into a HTML textbox. I think I’ve been using Vim too long…
School sucks somewhat less now
Alright, after coming to terms with school a bit, I’ve decided that it’s not nearly as bad as it seemed earlier. I think that I start to feel this way when it happens that a bunch of unrelated things don’t work by random chance. I think that I can turn this quarter around for the most part; it’s time to get the awesome back.
In other news, my music for Patrick’s dance piece went really well, people are already asking me to do sound / music for their pieces as well. For being a computer scientist, I think I’m actually really good at it. I mean, when the famous dance professor in the best undergraduate dance program in the US says your arrangement is good, that’s gotta mean something (I “suck less”, as Mick Shaull used to say).
I also heard something somewhat intriguing at dinner; evidently Patrick’s planning to move to Germany next year and start a company, of which I would strongly consider joining to do the music for, were he to ask me. I don’t think I’m quite ready to find myself boxed into a cubicle quite yet, and since moving to Europe was already pretty high on my list of what I want to do when I graduate, moving to Europe + writing music would be even better. No, I take that back; it’d be better than ‘better’, it’d be fucking amazing. Not only that, I could get involved in the huge Open Source movement in Europe. After I do that for awhile, I could possibly end up going back to school, get my Masters in CS, and settle down with a Real Job(tm), or who knows? Maybe I’d end up doing music for a long time. So many possibilities!
Now all I have to do is decide what I actually want to do…
Spring Quarter has jumped the shark
It’s amazing that after only three weeks, I’ve had so much frustration with all of my classes; all of the work I do is thrown out or marked as inferior. At the beginning of this quarter, I was completely looking forward to working hard and doing well this quarter, but I’m only trying to paddle against the ocean waves.
So you know what? It can’t be helped, so there’s no reason to get worked up about it, it’s time to just let it go. I’m going to enjoy my last quarter with my friends; I don’t really care how school turns out. That’s not even true, I do care but it’s a write-off; I’m just going to cut my losses and move on.
