Archive for the ‘Programming’ Category

rrr

Friday, August 4th, 2006

Everyone in my resesarch group was goign to play video games tonight at a place called Game Works, where you pay $10 to play all the games you want for 3 hours. That sounded like a ton of fun to me. Rumor had it there were cheap drinks to be had, too. I felt really tired, though, so I figured i’d take a nap before we left. I felt much more tired when I woke up, so i decided not to go and got back in bed. After sleeping for another two hours, I was awakened by a bunch of screaming. I was worried at first- it sounded like a bunch of deep, coarse, barking interspersed with high pitched shrieking. What was going on outside? Terrorist activity in Claremont California? Some kind of fire? Spontaneous dance competition?

Then i remembered that there were a bunch of high school kinds on campus, and that whoever ran that group usually had them doing some group activity around 10 or so, probably to get them all tired out so that they’d sleep instead of running off and braiding each other’s hair or whatever it is high school kids are doing these days. Thanks a lot, guys.

Reading the news just makes me angry. Free Chipotle pretty every day, though, is a good thing.

Writing super slick python code is just awesome. I’d been doing theory all this summer so far, and working on some actualy coding lately has been wonderful. I found awesome graph theory and mathematical plotting tools for python, which make me want to study graph theory just so I can use the libraries. My python skills have inreased significantly ever since I discovered list comprehensions and how to use them. Them are so georgeous. Last fall I worked on code to simulate random walks on the surface of a sphere, and I used python scripts to generate large numbers of random experiments, then to analyze all the data. I did something simliar today, and I don’t know why but it find it supremely enjoyable to generate large amounts of data, then sift through the data looking for patterns.

Peter coded up a ‘pressure’ algorithm that Kevin and I came up with; I thought of requests for bandwidth as fluids trying to fit into buckets, and modeled some kind of weird potential-energy type hueristic that would select the fluid under the ‘most pressure’ to satisfy. We had no idea how to prove the optimality of the algorithm, and after some thought we found ways to concoct devious instances to make it perform arbitrarily poorly, but the analysis says it works quite well in randomly generated instances.

Work is moving along quickly because I get to (well at least untill yesterday; i might be done with coding … :( ) spend the day writing code to solve problems. I have tommorrow off to visit my sister and UCI, and then after that there’s just a week of work left to be done. It’ll be weird to leave this place behind, because it has been my life for the past 9 weeks. I have spent pretty much every day with the guys I’ve been working with, and it will be weird to leave knowing I will probably never see some of them again. I’ve gotten pretty close with a guy named Kevin, who comes from missouri and shares a lot in common with several of my friends; he tells me I bear an uncanny resemblance to his room mate. I wonder if we’ll see each other again.

Speaking of people whom I will never see again, I had a ’summer romance’ in a rather odd sense. There was a group of students here from Puerto Rico, doing research on an engineering project. They were part of this exchange program; some Harvey Mudd kids went to Puerto rico for a couple weeks, and then the Puerto rican kids came here for a couple of weeks. They were staying in our dorm, and Jerrah’s friend heather was part of that research group, so I ran into them a decent amount. One of them would sit next to me while i played poker, and I would show her my hand and ask for advice. Every time I did, this she would say “I don’t know how to play” and look slightly worried/confused, which I found very amusing, so I kept doing it. Whenever I won a hand, I would thank her for her advice, and whenever i lost a hand I would complain to her; she seemed to think this was funny, I guess, because she kept sitting next to me while I played.

They invited me to go clubbing with them the last night before they left, and I figured I’d go along because I’d never been to a club before. Here is a picture of us. On the right is Claudia, a UC biomedical engineering major who also happens to be in California. Weird how I keep running into those kids… Me and the girl who sat next to me while i played poker, Aisha, hung out the whole evening and got along really well. We spent the next night together talking and hanging out; it was hard to spend time with someone that I knew was going to leave and I’d never see again, but it was worth it. She left at 4am saturday morning, and I felt pretty crummy. I went to bed and was awakened at 6 the next morning to find out that their flight didn’t leave and they needed someone to go pick them up at LAX. I drove down there, very tired, and picked them up. I had one last day to spend with Aisha, and I knew it was going to be difficult to say goodbye. We went to the park and talked some more, and then we had to go back and get her stuff ready to leave again. There are some things that you can ‘know’ but not know at the same time. I ‘knew’ she was going to leave again, but i didn’t really ‘know’ it untill that ‘again’ was 5 minutes from right now. It was tough. But that’s life. Even the painful things are wonderful if you have the right attitude, i think.

Next saturday, I’m driving up to San Francisco with my dad, who needs to be there on buisness, and while there I plan to visit standford and hang out with my friend Chris Wanstrath. After that, I head out for the trip home; first stop is in Salt Lake City, Utah. That has special significance for me. The only time I have been there was in January of this year, and that was about the breaking point of my relationship with Megan. I wanted to do something while I was there, but I knew that I couldn’t. At the time, it seemed like a far-off impossible wish; a desire on par with wanting to fly a unicorn through space or converse with someone long dead; a desire for something glorious and wonderful that I could never have. Now, things in my life are very different than they were, and that desire is entirely realistic. I will go to salt lake city, and do what it was that I wanted to do so badly on January 9th, 2006. Nothing lifts my spirits like knowing that I am about to fulfill what once seemed an impossible dream.

I get home on August 16th. I will probably just drop my stuff off at the house I’m moving into, since there’s no point in loading it and unloading it twice. I’ll have that evening and the day of the 17th at home, and I’ve already made plans for both days. On the 18th I’m leaving for a whitewater rafting trip in West Virginia, and then I have a week to prepare for school to start. This summer has been great. It is winding down now, and the school year is in sight. The last time I looked forward to the start of the school year with as much anticipation as I do now was the summer before my senior year of school. I think it will be a good year, and after this year comes grad school somewhere far away from cincinnati. Lately I have entertained thoughts of going to Grad School outside the U.S.

This time last year, I dreaded the start of school and the future life that I was sure awaited me. Now I eagerly await them both. I feel like i woke up from a terrible dream and the realization that it was all just a dream has hit me now; nothing can bring me down for any sustained period of time. Before this year, I had no future to look forward to; now it shines brialliantly at me.

Hooray for Linux!

Saturday, April 15th, 2006

I am setting up Linux on my machine right now. Specifically, Ubuntu on the advice of good old defunkt. I dig it. I’m having a fun time getting everything to work, and I’ve learned a heck of a lot.

Also, apparently my post on video games and education was quoted on another blog! Awesome.

A little something to be proud of

Thursday, February 9th, 2006

I was looking for a python script I’d written to implement a factoring algorithm, when I found LaserShip, the first real video game I’ve ever made. I did it while I was at work this summer (they didn’t give me a lot to do at first – now things are different.) At the time I shrugged it off as being a simplistic attempt at making a game, but when I was looking at it just now I realized it actually looks and plays pretty decent for being my first game.

If you want to play it, you can get it here.
Let me know what you think.

Woohoo!

Wednesday, December 21st, 2005

I had just finished writing a script to take employee contact information from an Excel Spreadsheet and put it into Active Directory, which had a problem in some form or another for several months now, when I recieved an email message from the ‘AtriCure Stock Bot’ which I wrote to automatically mail AtriCure’s stock price to our CEO every hour on the hour.

It feels good to write code and know that the code you’re writing is doing something useful.

I Saw This One Coming

Tuesday, November 1st, 2005

Once I had a full and complete realization that all information is exchangable and the represenation of such is completely arbitrary, I realized that all attemps at DRM would fail. As I stated earlier, Attemping to come up with a functional DRM system is computationally equivalent to coming up with an encryption system that allows bob to recieve a message, but prevents him from sharing that message with Eve, even if he wishes to. If you understand cryptoology at all, you’d recognize that such a problem is really quite absurd and no reasonable cryptologist would begine to attempt it. You’d be laughed at if you tried to get cryptographers to undertake such a task, but that’s exactly what Hollywood, Microsoft, and all kinds of other folks have been trying to do. They’be been somewhat succesfull at it in the sense that if you’re an ‘average joe’ and don’t have a technogolically inclined friend to ask, it might be kind of difficult for you to copy the latest linkin park CD onto your .mp3 player, but as long as you know someone who is technogically inclined and ‘in the know’ it’s fairly easy to find someone who knows how to circumvent whatever kind of copy protection has got you down.

Because I’m lazy, I’ll just copy and paste the boingboing text about this article: Hollywood has fielded a shockingly ambitious piece of “Analog Hole” legislation while everyone was out partying in costume. Under a new proposed Analog Hole bill, it will be illegal to make anything capable of digitizing video unless it either has all its outputs approved by the Hollywood studios, or is closed-source, proprietary and tamper-resistant. The idea is to make it impossible to create an MPEG from a video signal unless Hollywood approves it.

I must point out another computational equivalency here: Taking a video signal and turning it into an MPEG is a form of “open encryption” – the result is a peice of information, significantly smaller than the original signal, which can be used to reconstruct an approxmation of the original signal. The RIAA is saying they ought to have a software patent on the MPEG format, as well as any other format which could concievably be used to compress video. What they don’t realize (or else what they’re not bothering to tell anyone) is that the MPEG format is a member of a broad class of Discrete Cosine Transformation based algorithms which use mathematical theories regaring a class for Fourier Transformations to create a simplified approxmation of a complicated signal. For the RIAA to say they ought to be the arbiters of the use of such algorithms to prevent piracy is the same as for the police to say that no one should be allowed to build anything using a rotating lathe, becuase if they were allowed to build things, they might build sharp objects which could be used to stab people. I exaggerate, but the point is the same. The RIAA is trying to abrogate control over some well-understood (and public domain) information because said information could be used to do something counter to their efforts. Even if you ignore the ridiculous equation of stabbing someone with copying a CD that you bought to your hard drive, you have to concede that it’s absurd to grant a body control over technology that might be used to infringe upon the rights granted them by law.

The RIAA has come to the realiztion (of which I have been aware for several years) that a choice must be made. They’ve been trying to construct their computationally ridiculous form of encryption for years now, and now they finnaly get that it can’t be done; it’s an impossible task to undertake unless you use the law to prevent people from using well understood (if only by mathematically inclinded individuals) mathematical operations on input signals. Unforunately, I think there’s a rather low probability that there are too many members of congress with a good solid grasp on Fourier Transformations and their Application to reduction of Information Entropy in a digitized representation of a video signal. So we’ll see how this plays out.

I know said I’d make this blog apolitical and I guess i could see how this could maybe be considered politics, so if i’ve offended you thenI’m sorry etc etc.

Sadface

Thursday, October 20th, 2005

We had a big problem at my Job with employee contact information listing. Microsoft Server has this thing called Active Directory, that stores all kinds of contact information, but in order to edit the thing you have to be logged in as an administrator. In order to sort of get around this problem, we had another directory that was just an excel spreadsheet floating around. If you wanted someone’s contact information, you could check the excel spreedsheet, or look in your outlook contacts, which was kind of related to the active directory thing.

I started looking into this and found a python module that let python connect to Active Directory. After a bit of screwing with it, I got it to work and talked to my boss about creating my own program to access the directory and make changes, so that we could let other people make active directory changes without having them go through us. He said ‘OK’ and I began cranking out code. I’d never done much with Tk so I learned a bit of that, and got started. I had just gotten to the point where you could enter a name to search for, and it would get a list of all the results, when Adam told me he’d found a solution online. It does everything my little program was going to do, but with much more ease and style.

I felt sad as I closed my text editor, knowing I could finish this program but now there’d be no point in doing so.

High School Math is Difficult

Saturday, October 15th, 2005

I’ve spent a good deal of time today working on a project of mine and it’ve had a heck of a time writing a function that will tell me when two segments intersect each other. It’s tricker than you’d think; you have to deal with cases when the lines are vertical and then there’s other issues as well; it’s easy to do if you’re given a specific line, but generalizing this thing has proven rather difficult. It’s really kind of embarassing, since it seems like it should be an easy thing to do.

Update: Finally got it working, and it wasn’t easy. My god.

FYI

Wednesday, September 21st, 2005

If you’re thinking that the image on top of the website is what I was talking about earlier when I said there woudl be cool visual improvements, there’s still more to come. You’ll see.

I love programming (once again)

Sunday, September 18th, 2005

I am working on my physics simulation, and I thought maybe i should use yaml to make my own ‘command line option’ markup language. A python program could use a simle yaml file to allow easy use of command line options. I love how writing code to do one thing makes you want to write all kinds of other programs.

Edit: Wow, look what I just found:
Python Cheese Shop

Edit 2: Finished programing for today. I wrote a python file that generates a batch script that runs my program bunch of times, changing command line arguments detailing the nature of the simulation each time. I think that’s pretty cool.

Yum

Tuesday, September 13th, 2005

I was looking for a way to open Panda3d .egg files in Blender, so I did a search for ‘blender egg.’ That didnt’ really get me what I wanted.