www.BrettDaniel.com

Notebook Doodle #11

This latest notebook doodle comes from my operating systems class. I just started drawing a girl, and it turned into a skater chick of its own accord.

A skater chick

Update

After finishing the latest operating systems project, I went back and colored this drawing.

Stocks, Bonds, and Investing. Oh my!

In my economics class, one of our assignments is to create and maintain a stock portfolio over the course of the semester. Each member of the class gets $100,000 to start, but unlike normal stock picking games, the goal is not necessarily to reap the largest return. Instead, we must research our decisions, write a prospectus, and basically act as if we were running a mutual fund. This assignment is especially timely because my parents gave me my birthday present on Thursday: stock in the company or companies of my choosing.

For a long time Dad was heavily into stocks. When he and Sue got married, the groom's wedding cake had a climbing price graph on it. I remember every morning he would turn on CNBC and watch the ticker as my sister and I got ready for school. He has told me several stories about his investment experiences: About the time he "sold short" on some stock and could not sleep for three nights worrying about the price. About the tech stock that split twice and paid for part of his previous car. About the stock options that cost him nothing but crashed with the dotcom bubble. He has paid less attention to the market more recently, but he still has some "hot tips" and advice for my investing.

Eric said, "That could be either a really good birthday gift, or a really bad one." I am confident it will be the former. Between the economics assignment, my father, and the long amount of time I can afford to let stock sit, I feel I have a good chance of seeing a return in the future.

Stats Page Improvements

Weblogs are sometimes criticized for obsessive navel-gazing. Exhibit A: my improved stats page. Since posting it last September, I have made many additions and incremental changes.

Three New Graphs

I added three new graphs plotting comments, links per entry, and sorted entry lengths.

The comments graph was the easiest to put together. It was nearly the same MySQL query that I use to display the count in the comment link below each post. I decided to truncate the graph since I added commenting only last August.

"Links per Entry" required more thinking. To determine the number of links in an entry, I needed to count the number of occurrences of the string "<a href=". I could have done this in the PHP code after retrieving every entry, but I wanted to leave the counting to the SQL statement (I'll explain why under "Top Five Lists"). MySQL lacks a function that would do this, so I used a messy hack instead. I removed every occurrence of "<a href=" from the entry text and subtracted the length of that new entry from the original length. This gave me a count of the number of characters removed from the original entry. I then divided this result by eight, the length of "<a href=", to give me the number of links in each entry.

SELECT (char_length(entrytext) - char_length(replace(entrytext,'<a href=',''))) / 8 AS occurrences ...

The "sorted entry lengths" graph is certainly the most beautiful of any of the graphs I have plotted so far. It shows what you might have already guessed from looking at the normal entry length graph: I have only a handful of longer posts and a boatload of short ones. It is a perfect illustration of The Long Tail or the 80-20 Rule.

I thought there might be a normal distribution hidden in there somewhere, so I tried various ways of grouping entries by length and counting the number of entries in each group. It was pretty messy. Because my entry length has increased over time, I do not have the comfortable average that would have made a nice bell curve.

Top Five Lists

The top five lists provide links to the five most important peaks or troughs that you may have wondered about when looking at the graphs. I just took the SQL statements used to create the graphs, stuck on an ORDER BY, and limited them to five results each. Easy.

This was where the SQL substring counter became useful. When finding the five entries containing the most links, it was far easier to send a single SQL query than to use PHP to loop through every entry and extract the correct ones.

The makeGraph() Source

I posted the makeGraph() source code for anyone who may want to make his or her own graphs. Let me know if you find it useful for your own site or make any improvements to the code.

Obligatory Daily Movie Reference

Michael, Jason, and I had this conversation while lifting yesterday evening:

Michael (to Jason): Do you want to do lat pulls?

Jason: No. I'm doing back tomorrow.

[pause]

Me: Back, to the future!

I found it hilarious, but Michael and Jason just shook their heads. At least I didn't try to work a pun around "back" and "slack".

Undergraduate Research

I have some news on the undergraduate research situation that I briefly mentioned at the beginning of the semester. However before I get to that, let me expand on the bullet point in the linked post. (I apologize for the length. As usual, this one aspect of my life expanded to epic proportions.)

I want to go on to graduate school after I complete my four years here at Purdue. I am 99% sure that will result in a master's degree, but I am still split 50-50 on whether to continue to a PhD from there. The 1% in the former case is reserved for some amazing job offer that would warrant postponing grad school. The latter case is far more complex and worthy of a post unto itself. Luckily I still have a year and a half to think about it.

In preparation for whatever I decide, my counselor advised me to do undergraduate research. Grad schools appreciate research experience when considering admissions, and it is good to start as early as possible. I did not start looking for a research sponsor early enough last semester and projects consumed all my time once I did. Despite that I had two tenuous leads.

The first professor specialized in GUIs and GUI optimization. Lee and I spoke to him about one of his projects involving program auralization. Think "visualization" but with MIDI. By running source code through the application and compiling the output, the resulting program would play "music" when it executed. Somewhat nifty. It goes along with programmers' love of bizarre data representations. However the application was almost finished and had few uses beyond a toy or hard-to-use addition to a debugger. Our research would involve "finding its killer app". We could expect minimal programming; certainly nothing involving MIDI or language parsing, the two parts of the project that interested Lee and me.

I decided not to pursue that research opportunity. Was I being picky? Perhaps, but if I am going to work on a semester-long independent study project, I want it to be with something I enjoy and that would look good to recruiters. I didn't feel that a nearly complete "music box" satisfied either criterion.

I learned about the second professor— let's call him Professor J.— through a classmate named Chris. Professor J. specialized in programming languages and was interested in discussing some of the ideas Chris and I had brought up in last semester's "preparation for undergraduate research" seminar course. It seemed like a good fit except that he was out of the country. I had not heard from him by the end of the semester, so I feared I would have to postpone my undergrad research for next year.

Professor J. responded just as the new semester began (here we arrive at the bullet point). He, Chris, and I quickly scheduled a meeting to brainstorm on research options. We touched on visual programming languages, typography, program visualization, and functional languages, among other things. We didn't reach a conclusive project idea, but it gave Chris and me a place to start thinking.

Chris and I planned to get together a few days later to bang out a project idea. I proposed that we include Lee in the meeting and project group. After all, I worked with him in our compilers course and had planned to do research with him and the first professor. Chris was open to the idea, so the three of us met.

The following is a snippet of the email I sent to Professor J. explaining the project idea we came up with at that meeting.

[snip]

Chris and I have made progress on starting the undergraduate research we spoke to you about last week. We met on Friday to brainstorm ideas based on the topics we discussed in your office. I invited a fellow CS honors student named Lee Ballard to join us. We had a productive three-way discussion and now feel we have a good basic idea for a semester project. Can we meet with you sometime this week to get your input and direction as well as discuss the possibility of Lee joining the group? Chris and I both feel that a three-person team would yield a very impressive project.

The idea we came up with drew from our talk about typesetting and visually augmented languages. We batted around ideas for visual debuggers, improved typesetting languages, and niche visual languages based on functional languages; all things brought up in last week's meeting. From typesetting and functional languages we progressed to more generalized vector languages such as Postscript, SVG, and others. It seems these languages lack-- and you will be able to help us verify this-- some kind of built-in programmatic functionality. For example, to plot some mathematical curve, a scientist must write a program or use a pre-made package that plots points and exports a final picture in the vector language. We asked ourselves, "Would it be possible to make a vector language that includes this functionality natively? That is, could a vector image language contain control flow and functional structure similar to a multipurpose language? If so, how would one design such a language, how would it function, and what would be a good use for it?" These questions are all good foci for research.

One can also look at this question from the point of view of a general-purpose language. Most languages with a graphical component tack it on as a secondary library. (i.e. Java's various Swing graphics classes) On the other hand, some vector languages allow for programmatic control via a programming language tacked on to the vector data. (i.e. SVG and Javascript) A programmatic vector language such as the one we were discussing would blend the drawing and control flow into a unified environment.

We feel this path (if it hasn't already been tread; again, you can help us determine that) offers a great deal of research promise. We look forward to discussing it or possible alternatives whenever you are available to meet.

[/snip]

The four of us met today to talk about where to go next. The meeting was terrible (I do not want to go into why), but we left with three goals for the near future:

  1. Define the abstract scope of the project. We need to figure out what the program will do while avoiding the trap of defining exactly how the application will work. Questions about the languages, libraries, interfaces, and output need to wait.
  2. Think about the basic questions. Why pursue this project? What problems will it solve? What needs will it satisfy? What can we or the world learn from it?
  3. Figure out if it has already been done before and modify numbers one and two as necessary. This is the important one. It is disturbingly likely that someone has thought of something similar before. As undergraduates without research experience or research knowledge, we have no clue what work people have done already. We hope that our idea fits in a niche between graphics libraries and declarative vector languages. If not, we need to think harder or expand on what has already been done. "To Google!" is our mantra.

All three of us have built personal programs for our own enjoyment and class projects for the grade, but this will be our first big independent project in academia. I plan to record our progress throughout the semester. Unlike a job, I can write about a research project as much as I want.

Four Half-Life 2 Mods I’d Like to See

I beat Half-Life 2 a few days ago, and my opinion of it has not swayed. I hope to go through it again on a harder skill level or with cheats enabled or both. In the meantime, I have put in a few hours of multiplayer games and also began playing with Hammer, Valve's development kit and level editor. The program lets users create their own HL2, Counterstrike, or deathmatch levels, objects to fill the levels, or even entirely new games. So far my short time getting accustomed to the environment has yielded a two-room brick dungeon, a house façade, and a barren open air arena. Exceedingly simple stuff, but the potential is certainly there. My uninformed impression tells me the Steam engine has room for far more modification and expansion than Modders have taken advantage of. Garry's Mod is just the beginning. As time goes on, players will see more physics-based objects like this trebuchet built into the levels.

Along those lines, the following are four mod ideas that I would like to see. Put a URL in the comments if any of them already exist. Note that these are not restricted to Half-Life 2. Some of the ideas could work for Unreal Tournament or another modifiable first person shooter.

1. Booby Trap World

This would be an arena filled with traps that players could set to catch other players. A hidden trap door would be the simplest: just a very thin skin that breaks or a door that swings down when a player walks across it. Perhaps players could move them around like the "portable holes" from that one Looney Tunes cartoon. The modder could make more complex objects like a gigantic mousetrap with an weapon or ammo box on the trigger. How about a swinging logs à la the Ewoks in Return of the Jedi? Falling cars from the Ravenholm level in the game?

Each participant could have his or her own bag of tricks to set before the match starts. They could spread the traps across the level and then drive the other participants them with gunfire. Players could diffuse traps or move them to catch the original setter. In Counterstrike, the traps could be used to protect the hostages or bomb target.

It would be difficult to prevent Booby Trap World from becoming very, very frustrating. There would have to be some incentive to prevent people from camping behind an impenetrable moat of booby traps. Perhaps diffusing a trap could be as easy as firing at it.

2. Sphere World

Does anyone remember The Adventures of the Little Prince? I remember watching it as a small, small child. All I recall is that the main character, the Prince, lived on a tiny planet only about 20 or 30 feet across. Childhood memories aside, something like that would make a cool deathmatch level. The gravity would pull toward the center, so players could run around on the surface of the small planet, shooting bullets at each other that would travel tight orbits. Would the bullets "evaporate" before traveling all the way around the planet only to hit the shooter in the back or would the level get more and more cluttered with fast, orbiting satellites?

One could extend this idea to different surfaces. For example, Torus World would have some bizarre bullet trajectories. Shell World, the inside of Sphere or Torus World, would have interesting sniping opportunities. What if one wanted to play on both the inside and outside of a surface? Then one could play on (in?) Klein Bottle World.

3. The Mushroom Kingdom

The Mushroom Kingdom arena would have bright, pixelated textures with koopas and goombas running about. Players could throw Koopa shells using the gravity gun. One could shoot floating question mark boxes, and out would pop health or ammo. Stone boxes, on the other hand, would break and disappear, perhaps revealing secret power-ups. The modder could decrease gravity to allow for higher jumps. Team deathmatch uniforms would be red and green plumbers' overalls.

With the Mushroom Kingdom created, could Hyrule be far behind?

4. Generated Level/Revolution Expansion

Nethack has had automatically generated dungeons for 20 years. I think time is ripe to make an automated level generator for a first person shooter. It could create a random section of City 17 filled with both Combine soldiers and revolutionaries. A player could join either side. The Revolution's object would be to take over that section of the city, while the Combine's would be to defend it. It could be modeled after Unreal Tournament's Onslaught mode and act as an expansion to the all-too-short revolution levels at the end of HL2. The difference would be that the terrain would be different every time. Either that, or the host server could regenerate a level after some number of rounds. That would let the participants become accustomed to the layout while still keeping it surprising.

Any other ideas?

“DUDE! You need to get plastered!”

My first legal beer

Today I turn 21, and the question on everyone's lips is: "So what are you going to do?"

I don't know. If it wasn't Martin Luther King Jr. Day, I could go to the BMV and get my license renewed. If I didn't live in the dorm, I could have a whole bunch of friends over. If I was at home I could buy my parents some wine and go to one of the blues bars downtown. If I had thought about it before today, I could have gotten a group together to go to the Cleveland or Chicago Houses of Blues.

If, if, if.

As it is, I have little desire to go to one of the half-dozen bars around Purdue and drink until I fall over. I have heard this suggestion the most.

Update

I can finally answer the question: I ate a delicious steak dinner with a handful of friends. I ordered my first two legal beers and got to spend time with people that I don't get to hang out with often enough.

The only snag— and there had to be a snag or it would not have been a Brett-organized event— was that I gave everyone good directions to the steakhouse but mixed up its name with a similar steakhouse about five miles away. I couldn't easily rectify the problem because I also forgot my cell phone containing everyone's numbers.

Eric and Lauren, one of Eric's ChemE friends, stayed at the Steakhouse A while I shot across town to see if anyone had arrived at Steakhouse B. There, I found Marc and his roommate Ashish. They had realized something was wrong after driving up and down Steakhouse A's street twice before asking for directions and ending up at Steakhouse B. I explained my mistake and left a message with the greeter telling her to direct any other people looking for Brett Daniel over to the Steakhouse A. I returned to find Michael, Jason, and Stuart had made it despite the confusion.

The rest of dinner was snag-free and enjoyable.

Update #2

I forgot to mention the science lesson that occurred after everyone had eaten.

I was pouring the last of my second beer, a Guinness, into my glass. Eric mentioned that the rattling in the empty can was the "nitrogen bead", a plastic, nitrogen-filled sphere that supposedly makes the bubbles finer. We each shook the can to hear it bounce around, then curiousity got the best of us. We wanted, nay, needed to see that bead. Michael first tried to cut open the can with a steak knife. It failed to find any purchase on the metal, so he tried to pry open the top with a bottle opener he had on his keychain. He gave up and passed it to Marc took a stab at it, literally, with his fork. He tore open the side, releasing the bead in all its glory. It was about an inch in diameter, made of cheaply-molded white plastic. Michael dried it off and passed it around the table like show-and-tell. That prompted the chemical engineers and biology majors to start talking about how beer is brewed.

Warm and Fuzzy

Every once in a while, Purdue does something that gives me the warm, fuzzy feeling that I am in good hands. Like when the Big Computer in the Sky cancels my entire differential equations lab division mere hours before it was supposed to meet.

I found out while sitting in a 50-person lab with just four other people. Ten minutes in to the scheduled time, it collectively dawned on us that something was amiss. I checked the scheduling website. "Well, this is the right time and room," I said. "Ah wait. This link says I had a conflict. That wasn't there before." I clicked it and deciphered the cryptic, monospaced page. "That explains it. The computer cancelled this lab and tried to reschedule us. I have a conflict with my CS classes. I bet all four of us have classes all day before this one, am I right?"

I rushed over to my counselor's office, an oasis of help in the desert of Purdue bureaucracy. The conflict was insurmountable, so I dropped differential equations. I will take it next semester. In its place I transferred into a ridiculously easy logic course that is required for my math major. Removing diffeq from my schedule cleaned up four of the hour-long breaks I mentioned and gave me an extra hour where the lab used to be. Quite nice.

Some Notes on the First Day of a New Semester

  • Hour-long breaks pepper my schedule again. Luckily, the midafternoon ones on MWF take me past a library where I might get some homework done.
  • In addition to his day job as an IT manager, my father teaches operating systems and advanced Visual Basic programming at IUPUI. I'm using the same operating systems book that he used last year. I know who I'm talking to if I need help.
  • Speaking of textbooks, I bought all of mine online. I double-checked ISBNs and ordered early so that a few were waiting for me when I arrived on Saturday. It has been far less painful than last semester's textbook epic.
  • I went to the Corec today for the first time in at least two months. Vacation and last semester's irregular lifting schedule has taken its toll. I'm weak... so very weak. I lost about 25% just on dumbell bench. Terrible. I hope to gain it back by summer. I should have more time to lift this semester. My CS classes— operating systems and numerical methods— should be far less time-intensive than compilers was.
  • I had given up on doing undergraduate research this semester. I started looking for a sponsor too late and got distracted when the projects hit. I still had two possible sponsors despite that. One worked in an area I had little interest in and the other never got back to me... until today. Tomorrow I have a meeting with him and a classmate whom I may be working with. More news as events warrant.

I am not a Gamer… Really

My parents got me two games for Christmas: Half-Life 2 for the PC and Tony Hawk's Underground for the PS2. I'm playing them as much as I can this week before homework saps up all my free time.

HL2 is unbelievable. What can I say that hasn't already been said before? The environment perfectly reflects the vision of a downtrodden, post-alien invasion Earth. The story set in this world feels like an action movie full of hair's breadth escapes and plenty of explosions. At point I was driving a fan boat down a channel while enemies shot rockets at me from the banks. I hit a ramp and flew underneath a bridge from which more enemies where dropping burning barrels. A game has never gotten my heart pounding like that did. I am also constantly amazed at the physics. Objects fly, fall, stack, roll, and break with near-perfect realism. See-saws and pulleys both act as one would expect in the real world. The programming that must have gone into all that boggles my mind. I can't comment on the graphics, unfortunately. My computer can't handle the highest setting. It doesn't dull my overall enjoyment, however.

Eric also bought HL2 over break, and we have already Counterstriked (Counterstruck?) twice on a ChemE friend's server.

THUG is grand fun. It is the fifth Tony Hawk game I've played and the fourth I own. It is by no means groundbreaking in the sense of HL2, but it doesn't disappoint. The levels grew and the graphics improved slightly from THPS4. I like the improved stats system the most. Instead of being rewarded "stat points" for completing various odd goals in the game, THUG increases stats when I perform some action related to the stat itself. For example, performing a 20-second grind increses my rail balance.

Open Mic Night or High School Reunion?

A ponytailed coffehouse worker asking, 'Who oredered two frappemochalattes, a quintuple espresso, and the sheet music for Freebird'

I spent Friday being inexcusably lazy. Charlie organized a concert/open mic night/high school reunion on Thursday that I have yet to write about. Come back later today; I should have this entry finished by then. In the meantime, please enjoy some pictures of the event.

Update: The Entry, Finally

I arrived late, which is unusual for me. The coffeehouse– the third I had visited that evening after realizing I didn't know exactly which one Charlie specified– was already half full. I recognized the majority of the audience from high school. Almost the entire guitar jam crew was there: Jeremy, Mark, Erol, Nick, Geoff, plus a few people who showed up later. Just like during Charlie's Purdue Concert, the whole evening was very reminiscent of the many coffeehouse concerts in high school.

The audience had arranged themselves in irregular semicircles around Charlie's "stage" at the front of the building. He had set up two microphones, a multicolored bongo drum, an electronic keyboard, and his PA. The wires seemed worse than usual; several people narrowly avoided certain death when they got snared. One guy whose name escapes me at the moment was the designated "bongo guy". Charlie would call him up to the front to play, prompting him to excuse himself from whatever conversation he was having at the time and hectically navigate the tables, chairs, cords, and people crowding the cafe.

Charlie only played for a short time before handing the mic off to the other musicians in the room. At least eight "acts" played. One of Charlie's friends from college played a steel guitar solo first. I found it especially impressive because no one in high school owned a steel guitar or played with a slide with any regularity. It was the same way with Erol's classical guitar solo later in the evening. Awe-inspiring stuff.

While the musicians did their thing, the rest of the coffehouse filled with friends and family who had heard about the concert. I'm sure it was the busiest place in town that Thursday night. We must have broken several dozen fire codes by having so many people in such a small place. Charlie returned to the stage at the peak of the crowd. I took up the microphone and asked them to give Charlie a round of applause. "No one else could have gotten this many people from high school together in one place," I said. From there the concert devolved into a good old fashioned jam session.

Notebook Doodle #10

I drew a quick cartoon for my trip to the library. I originally posted it here as a standalone notebook doodle, but I decided to move it back to Monday's post. It makes more sense there.

More Advice for Computer Science Students

Anyone who read my brief Tips for Purdue Computer Science should definitely read Joel Spolsky's entertaining and informative Advice for Computer Science College Students. Unlike my six bullet points which I distilled from just two and a half years of Purdue undergraduate education, Joel gets his seven from his work in the Real World.

  1. Learn how to write before graduating.
  2. Learn C before graduating.
  3. Learn microeconomics before graduating.
  4. Don't blow off non-CS classes just because they're boring.
  5. Take programming-intensive courses.
  6. Stop worrying about all the jobs going to India.
  7. No matter what you do, get a good summer internship.

I think I can check off one, two, thee, five, six, and seven, but I constantly need to remind myself of four. I blew off all three semesters of French, but still got good grades. Does that still count as blowing off?

A Trip to the Library

Today I went to the library for the first time in at least four years. Why so long? I realized I need to spend less on books. I read a lot, and I buy a lot of books to support this habit. However Christmas and a semester's worth of nickel-and-dime expenses have depleted my funds. While they have not yet fallen to emergency levels, I know I need to cut expenditures if I am to survive until next summer. Borrowing rather than buying books is an easy sacrifice.

I was in the mood to spend my last week of vacation reading a graphic novel; either the first Sandman book or Watchmen. Both are praised as some of the best comic storytelling in existence, but I wasn't sure if I would like either of them. They seem a bit dark for my taste. As I said, I also didn't feel that I should spend the money.

The library it was, then.

"Where might I find the graphic novels?" I asked the distracted lady at the circulation desk. She looked at me quizzically. "The bound comic book collections. Ones by Neal Gaiman or Alan Moore, in particular." I explained.

"Oh I'm sorry. The entire computer system is down today. It's been a real mess," she said. "Those would probably be in the young adult section."

I, a nearly 21-year-old college student, walked sheepishly into the brightly-colored children's wing of the library. Another librarian pointed me toward the young adult room behind a pregnant lady and her hyper son. There was a small boy reading a Transformers comic at a miniature pink table nearby. I found the Sandman book and walked quickly to the checkout. My card was expired. I expected this, but I foolishly failed to realize that the computer problems would prevent me from getting a new one.

"This is why I buy books," I thought to myself as I left emptyhanded.

Update

A guy about my age asks a small boy, 'Are you going to read all of those comic books?' They boy looks at the guy skeptically.

List O’ Links

I think I'll kick off the new year with a good old-fashioned list of links: