Erwaman's Personal Journal - February 2009

Back


2nd CS assignment for Data Structures & Programming Techniques (in C)

Whew! I turned in my CS assignment late tonight. It was due 2 AM on Friday, but I didn't really start it until Thursday afternoon, so I didn't finish on time. It's only 5% off your grade for each day late, so it was worth it for me to take the 5% penalty and spend an extra day finishing my program and getting it to pass all the test cases.

Our assignment was the bin packing problem: given a bin size and a list of items, what is the least number of bins required to store all the items? We had to use backtracking in order to find the optimal solution. I was able to implement the backtracking, but that alone wasn't enough. We also had to implement five heuristics so that the backtracking didn't take too long for a longer list of items.

Without too much difficulty, I implemented the first three heuristics and passed 11 out of 13 public test cases. But the last two heuristics seemed so hard to implement! Finally, I got one of them working. 12 out of 13 test cases passed. Then, an hour and a half before the 5% late deadline, I figured out how to implement the last heuristic. I ran the public test script. Still 12 out of 13 tests passed. What? The previous heuristic had stopped working. Then I thought about it, and I realized one of the places in my code where I implented the last heuristic was overriding the previous heuristic. I removed the two lines of code, and OMG!, my program finally passed ALL the test cases!!! 17 total hours spent on this assignment, and over half was spent on backtracking and implementing the five heuristics (the other half was spent learning more about C and implementing non-optimal fitting algorithms like first-fit, best-fit, first-fit decreasing, and best-fit decreasing.

CS is so full of up-and-downs <3.

If this were a site with tags, this would get the geek tag.


JHU Visit, Friday - Sunday, 2/20-2/22

Thursday night, I left around 11:30 for Union Station in New Haven. Ran the mile to the station and barely caught the 11:38 train. Arrived at Port Authority, NYC, walked to Grand Central, had about an hour to kill, so I went outside and looked for a hotel to chill at. Found a Westin nearby and went in. Guy at the front desk asked me, "Sir, can I help you?"

I replied, "No, thanks. I'm just here to chill until my bus comes."

"Excuse me? You're here to chill?"

"Yeah."

"Um, you can't be wandering around our hotel with those bags if you aren't staying here."

"Oh, don't worry, I'm just gonna hang out in this here chair in the lobby. I won't cause any trouble. My bus'll be here in half an hour and I'll be gone."

Receptionist doesn't respond, gives me a look, and then goes back to chatting with another person on the hotel staff. A few minutes later, I get bored sitting around, so I decide to explore the hotel, see if it has a free business center or nice restrooms or a fitness center or something. I start toward the escalators with my bags, and then: "Whoa, whoa, whoa, sir, where're ya going?"

"Oh, I was just gonna explore the hotel."

"No, sir, no. You can't do that with all those bags."

"Oh, I'm sorry. Nevermind then." And I went back to my chair in the lobby, pulled out the C Programming Language book by Kernighan and Ritchie, and read for half an hour.

Took Greyhound bus to Baltimore, arriving around 7:45 am. For whatever reason, when I looked up the address earlier, I thought the station was at 210 E Fayette St and only 2.8 miles from JHU. When I got to the Downtown Baltimore Greyhound Station, there was no E Fayette St nearby, and I ended up just walking northeast, using the sun and the N/S, E/W streets as a guide. Eventually, I hit N. Charles St., which is the road JHU is on, and I just walked north a few miles until I hit JHU. (Later on, I learned that the actual location of the Greyhound Station was 4.2 miles from JHU. No wonder the walk seemed so far.)

I met Andy at JHU's Milton S. Eisenhower Library - he must've anticipated me because he appeared at the top of the staircase just as I entered the library. Andy had just finished his physics midterm, but he still had three more classes that day along with a second midterm. He's pretty chill though, so he managed to play off his intense schedule and didn't seem too stressed. He's got a realistic view of life.

In the afternoon, I showered, watched SC videos, and then napped on Andy's bed. Then, after Andy got back from his Java midterm, we ate $5 Subway footlongs (I see the ads EVERYWHERE), bought some food and drink, played a blitz game of chess, and started setting up for the SC tourney. Like 20-25 people showed out (great turn-out IMO), though only 8 of them actually competed in the SC tourney - the rest just watched or played DOTA. There were definitely some technical and organizational issues, but for a first attempt at hosting an SC tourney, I'd say it was pretty decent job. We even had a spectator room where we projected games on the wall and I commentated. The guy who won was a Korean dude who PLAYED USING THE TOUCHPAD and still owned his opponents. In the final game, he had complete map control, taking up all the expansions on the map, and being bored and toying around, he even spelled out JHU with his units on the map.

Saturday, we ate brunch in the FCC (Freshman something Cafe) - food was all right, the grilled veggies didn't have much flavor, but there was a good selection of ice cream. Then we hit up the Levering Lounge to do work - after like half an hour of reading CS, I got sleepy and napped on a couch for like three hours. Then I got up and did CS for about two hours. The breakdance crew called up Andy, so then we went to a practice session. Andy showed me some basic moves and I was honored to practice with all the skillful breakdancers there. I left after an hour - I didn't have the stamina of the other dancers - did some more CS, then Andy came and we went back to the dorm.

We were hungry and debated what to eat. Ultimately, Andy decided to cook instant noodles in the common kitchen. We feasted on the noodly goodness, celery, bread, and peanut butter. Afterward, we were pretty exhausted from a long day and went to sleep.

Sunday, I woke up, showered, and did some CS. There was a special brunch at the FCC this morning, so Andy, his roommate Sang, and I went and feasted on MASSIVE amounts of desserts. I possibly could've died from a sugar rush considering how much dessert I intook. Cherry pie, cheesecake, coconut hazelnut bars, cherry twist, danishes, chocolate cake, other pastries, etc. My pancreas is crying right now.

Afterward, we played tennis in the nippy weather - oh snap I am so noob now (well, more noob than I was senior year of HS) - I hit like two balls out of the courts and could hardly keep the ball in bounds.

Then we went back to Andy's room and wrapped up with some DDR. I failed Maxx Unlimited Heavy on the last note :(.

I left at 3 pm, taking the JHU shuttle to the Washington Monument before trekking the remaining 2.2 miles to the Greyhound station. On the trek, I found a broken street sign on the ground, and I determined to bring this back to the Lair for decorative purposes. The sign read Russell St. & Worchester St., with "«2000" attached above Worchester. I managed to detach the "«2000" part and put that in my backpack, so at least I would have something to bring back even if I was stopped by the police. I managed to get the sign on the Greyhound bus without incident. I walked six blocks through NYC from Port Authority to Grand Central without incident. I got the sign on the Metro-North RR train without problems. I got off the train and walked through Union Station without incident. I exited Union Station, turned right, and then from behind, "You there! Stop right there!" I turned around, and it was a police officer. "Do you know you could get charged with larceny for stealing that sign?"

"No."

"Where did you get that sign, son?"

"I found it in Baltimore."

"In Baltimore? That sign belongs to a state and it belongs to a city. You can't just take it."

"But it was broken, just lying on the ground. I didn't know. I've never taken a sign before; I didn't know it was illegal. Officer, do you think just this one time you could let this slide? Now I know this law, I won't take any more signs in the future."

"Hah, you thought the sign would make a nice fixture for your dorm room, huh? Give it to me."

*SIGH*. I had already transported the sign over 250 miles, and in the last mile of the trip, I get busted. Such is life. But at least I have the "«2000" part of the sign as a memento. Thus concludes my JHU visit.

Overall, this trip gave me a very good impression of JHU. Maybe it's just Andy's friends, but people seem more laid back. They work really hard (according to Andy) but you don't get the impression that they're academics-obsessed when you hang out with them. People seemed less in a hurry; conversations were more extended and intimate. People seemed very sincere and friendly. People seemed enthusiastic about their own interests and pursued random interests like StarCraft, breakdancing, DDR, pen-spinning, gaming, badminton, and other miscellaneous things.

Facilities were very new, very modern, cleaner than Yale's. They have a GAMING LAB? You can borrow gaming consoles, games, projectors, and other electronic equipment for FREE from the digital media center? It's almost like they encourage students to spend more time playing and relaxing.

Security was pretty tight though - I guess that's why Hopkins is #1 "safest university" (Um, why is Yale not even on the list?) - there's always an attendant 24/7 at the entrance to dorms and guests have to deposit IDs there. Even Andy had to drop off his ID to enter some buildings. I guess it's more secure, but it was kinda annoying at times.

The campus was very compact. I was quite jealous of how the tennis courts were visible from Andy's room. They were like 100 meters from his dorm building. Having walked through much of downtown Baltimore, there definitely seemed to be a lot more restaurants, shops, and sites than in New Haven, but you have to take a bus to get places unless you don't mind walking a couple miles. Around the central campus within close walking distance, there didn't seem to be too many shopping or dining outlets (but this is based off three days experience so I could be wrong).

Pictures

When I saw Russell St., I immediately thought Bertrand Russell, the philosopher whose book I am reading in my "Problems of Philosophy" class. I believe he guided me on this journey :).


Back