Thursday, July 10, 2008

last day.

i hate hate hate goodbyes.

Sunday, July 6, 2008

unforgettable

I just wanted to outline my day on the 4th. I've never laughed so hard in my entire life, I don't think.

So we drove into College Park on the 3rd and slept until about 8AM, when we got up and ate breakfast at our hotel. We decided that we would eat an early lunch around here and then pack a picnic dinner to eat in the city so that we could get a good spot to see the fireworks at 9:15 that evening.

There was a 60% chance of rain.

So, we went on our quest to find groceries. First, we went to "My Organic Market," which is completely windpowered and had tasty food. Yay. However, since they're into saving the planet, they did not have ziploc bags, which are necessary for putting peanut butter and jelly in your pocketbook. So, we GPSsed it and found that there is a Safeway. We drove in that direction.

Well, when we got to the Safeway, it was not a Safeway; instead, it was a Bestway, which is a Latino market. This was quite funny. But the food was really cool-looking so we bought some. We also found some "Awesome!" brand ziploc bags, but alas, there were no umbrellas. So, we went over to the Rite Aid to buy umbrellas. And chocolate. And card games to entertain us while we were waiting on the fireworks.

So far so good.

After that, we headed into the city on the Metro. The station we went to has a "Kiss and Ride" parking lot that we find amusing.

So we get off at the Capitol South stop and try to go to the Library of Congress, and it's closed. So we take pictures there, take pictures at the capitol, eat Snoopy bars (which I forgot existed), continue to head towards the national mall...and there are all these tents there! The first one we see is for "Vegetarianism." We continue to wander around and figure out that we're in the middle of a Hare Krishna festival tent outreach thing. But they let us try on saris and gave us vegetarian food and books about their religion. I've always wanted to wear a sari, and now I have. *checks off of life to-do list *

After that we continued to wander around the mall. We tried to get into the national gallery but it was closed. After that we decided that most everything was probably closed since it was the 4th and we wandered around in the Smithsonian Folklife festival, where they covered the random topics of Texas, Bhutan, and NASA. There was some pretty cool stuff there.

We were going to visit the monuments/memorials but found most of them were blocked off. So, we just headed down toward Lincoln Memorial where we had decided to sit and wait for the fireworks. There were a whole lot of people there, and by this time, probability had won and the rain had started. We hung out under cover of the Lincoln Memorial until the rain subsided, then sat down at the bottom of the steps there, spreading out our plastic bags and the sheet we brought to sit on.

We ate dinner and started playing Uno, and then...start feeling rain drops. It's getting faster, not slower. We have nowhere to go, so we form a tight huddle and make an umbrella dome where we're way too close and all getting wet anyhow and laughing so hard. It rained for so long and the entire time we were laughing and trying to take pictures and hoping it will stop soon. Soo Been starts trying to grab the ankles of the people walking by us, because that's all we can see. She succeeds in touching one guy's leg. hahaha.

Finally it did. We did damage evaluation. Victoria's purse is soaked all the way through, the blanket is completely wet, we're wet, the ground's wet, everyone's wet. But we survived!!!

Still dripping wet, two high-school age guys approach us, one explaining to us that the other does not have a 4th of July date, and the dateless one expressing what a horrible idea this is. We take a picture with him.

The fireworks were incredible. We watched them, got our things together, and began to leave. People are wading in the Reflection Pool. And they're not getting arrested. This is a golden opportunity. We step into the edge of the reflection pool and take pictures of us jumping out of it. We don't get arrested either, only warned by a kind bypasser that we should put peroxide on any open wounds since we will get infected by the goose poop in the pool. We get out of the pool. We walk forever to the L'enfant station, which I call the "Elephant" station or the "Infant" station. We get back to my car.

It's late now. We GPS a Seven Eleven to get peroxide. GPS leads us to a nonexistent Seven Eleven. We GPS another Seven Eleven and find it. No peroxide; there's only Neosporin. We'll settle. I'm completely disoriented. I GPS the hotel, so I think. I start driving and we end up on a freeway where traffic is crazy and drivers are inconsiderate and we almost die like three times. I say, "I know our hotel wasn't this far away." I hand the GPS to Soo Been, and she discovers that our hotel is on Baltimore Avenue while I chose Maryland Avenue...which is the location of the Elephant station. Oh. That's where we're going.

GPS finds us. We get back to the hotel without dying.

The end.

Best, craziest, fourth of July ever.

Friday, July 4, 2008

the fact is

that i am living in a dream come true.

Monday, June 30, 2008

taming the infinite loop

Because I have made this mistake more times than I can count, I thought I'd write a bit about it.

In operating systems we often learn this type of construct in order for sharing resources:

ask for a resource
if (resource isn't free){
while (resource isn't free){
do nothing
}
}


use the resource
release the resource

This is kind of a semaphore, allowing only one process to access the resource at a time. It works great for operating systems. However it is not an okay construct to use in a single process.

Why the difference? Well, in operating systems, each process is scheduled out--one process does not have to complete before another process executes. So, in the middle of that busy wait, the operating system stops that process from executing and gives the other process(es) a chance to execute. If it didn't, then that first process with the busy wait would never complete because all the CPU time would be used just waiting for that while loop to be over instead of executing the other process that's currently using the resource. That's called deadlock.

Deadlock is exactly what happens when you use that kind of construct in a single, non-threaded program. Instead of executing that other function all your resources are dedicated to wait in that busy loop.

Sometimes this kind of thing is necessary, though. In the program I'm working on right now, I need a function to wait until an object is not null in order to continue. So I've been working for three days on this and this morning I finally realized that I was in deadlock like that. Easy solution: add a timer.

function myFunction(){
if (we're calling this function for the first time)
send request for the resource
else
after a set amount of time call timerFunction
}

function timerFunction(){
if (the resource is available)
do what I need to with it
else
call myFunction
}

Problem solved. While that timer is waiting to execute, it gives the other functions a chance to return that resource.

And now to more interesting problems, such as data logging over a web application. Eww. The stateless nature of web programming makes this an unhappy task. Yay PHP sessions!

crunch time

two weeks left.

feels like about three weeks of work to do.

wonder how this is going to turn out.

In other news, I went to see my amazing sister in WV yesterday. I miss her a lot. I miss my family and my friends back home. I am ready to go home.

I've been making important life decisions, since one day I woke up and realized that grad school applications will be due unbelievably soon, and since time is moving unbelievably fast. I am pretty sure that I will blink and it will all the sudden be Christmas.

I have decided that I am not moving across the country until I am married unless crazy things happen. If that makes me weak, then whatever. I don't care about your opinion. I'm all for seeing my dreams come true and moving across the country to take that perfect job if the opportunity arises, but being near to people I love is part of that dream. It's so important to me to be working with good people and to have people to share my life with. Life is so much richer when you're sharing it with someone, and here close to my friends and family I can do that. If I'm a day's journey away from the people I love it is harder to communicate and much less fun. If/when I move far away I want to have someone to share it with. It's not an independence or incapability issue; I have proven to myself many times that I am capable of starting over in a new place and taking care of myself. It's a matter of my priorities, my desires, my dreams, and what I am convinced will be the happiest life for myself.

I love my life. I'm pretty excited about all that is to come. It's awesome to be here with so many choices and opportunities, and I mean awesome in the full sense of the word: bringing about awe, admiration, wonder, terror. Who would have guessed that I would end up here and now? It is intimidating and unbelievable and incredible. I can't wait to see how it all turns out.

And now...to fit three weeks worth of work into two. I can do this if I work at full potential. Here's to making the most of every moment.

Saturday, June 28, 2008

a simple guide to static variables

I have been doing programming type stuff since middle school now (nine years, whoa) , with my first object-oriented experiences in high school Java class. I remember talking about static variables then (maybe in college too, I don't know). However, last Thursday I was writing some Actionscript code for my research project and realized I was mindlessly typing "public static var" in front of all my declarations, and that I really didn't know what "static" meant. So, I checked to see who was online, and my friend Lane was, and I asked him what static variables are. He explained it this way:

class Orange{
public var count;
public static var staticCount;

Orange(){
count++;
staticCount++;
}

}
...

var valencia = new Orange();
var navel = new Orange();

So, what will valencia.staticCount be? What will navel.staticCount be? What about valencia.count and navel.count?

Turns out that static variables are shared across all instances of a class. So, either of the staticCounts will be 2 after each instance is created (since each time the instance is created, the class increments staticCount), while each count will be 1, since the constructor also increments the non-static, unshared variable as well.

After I asked that question I figured out that a whole bunch of my program's bugs had to do with me declaring static variables where they should not be.

I don't know, it seems like several people I've talked to don't (or didn't) fully understand static variables either, but it's something really helpful to know.

Friday, June 20, 2008

i think this happens a lot

...wellll, except for the whole jumping out the window part, anyhow.


Planning ahead has its merit, but at the same time I think we miss a lot of opportunities in life
if we're letting our planned future get in the way of things that could be really good here and now. That's just my take on it.


(by the way, that's from http://www.xkcd.com)