Showing posts with label computers. Show all posts
Showing posts with label computers. Show all posts

Saturday, April 26, 2008

Homework

I'm taking a course in computer graphics. My project that I had to do was use Virtual Reality Modeling Language (VRML) to build a table and put three objects on top of it. 1) A shape that can move anywhere on the table top, 2) An object, when clicked, moves around the table top in a predefined path, and finally 3) An object, when clicked, rotates. Pretty exciting, eh?

Anyway, here's the link to my website where I uploaded the stuff: my Nova SCIS website.

Also, it will only work if your browser has a VRML plug-in, but here's a screenshot of what it looks like using Safari: Yay for me.

Mileage = 129.88. I've had to take a few days off to make sure I don't injure myself. I felt a twinge in my right knee...it wasn't hurting hurting (whatever that means) and with an ibuprofen the pain would go away (which means something in there was inflamed) which meant I really needed to take a break for a few days. We'll see how it feels in the morning--keep you posted.

Wednesday, March 28, 2007

Computer Geek Memory Lane

Found this: an ad from 1983 for a TRS-80 that admonishes that the TV is not included--correct me if I'm wrong dad, but I think this is the first home computer we had...I'm trying to remember all the "thrilling outer space and sports games" we used to play. Ooh, and how cool is that, you could use a modem to access tomorrow's news and stocks--it was a time travel machine too! I wonder if it could get over 2400 bps for the trip... Anyway, lots of very cool stuff on this site, a trip down a computer geeks memory lane. Funny article from PC World about the worst 10 computers of all time. Lots of links to other stories about bad products as well.

Wednesday, March 21, 2007

I've caught a bug...

Called building computers. A friend here brought a Compaq computer with her to her previous country (Niger). It was one of those computer in a box deals. She took it out of the box and it wouldn't work. The IT staff looked at it for twelve hours and couldn't figure it out. Fast forward two years and she's now leaving Tunisia. She advertised this computer for sale, I asked her how much. She said, well, it doesn't work, but I'll sell it for $100 (she paid well over $1000). She also said, come over, take a look and see if you want it. Sure enough, it took me less than five minutes to diagnose and fix the (first) problem. The harddrive power connector wasn't fully seated. The IT guys in Niger should be shot for not first "checking to make sure its plugged in." As annoying as it is to get that as a first question when you call a tech support line, sometimes that is actually what's wrong. She was astounded that I got it working and said "just take it." So I did. Turns out that the harddrive was bad anyway--maybe from all the "troubleshooting" the Nigerans did. Plus there were some other things going on. So, I decided to get a new motherboard, (mudderboard--as Dylan says, and as I would have said when I was his age--mudder dear!) and some other new things to "pimp my computer." All the stuff arrived in the mail and the kids and I put it together Monday and yesterday and it works just fine. I'm trying to hook it up with wi-fi, but my stupid Tunisian ADSL modem doesn't seem to want me to be able to do it--but for under $350 I have a pretty decent new computer. It's not real high-end or anything, but with the mods I've already made (overclocked it to 115%--added a graphics card and added memory) it's as good as the machine I already had. Anyway, I'm itching to build more computers now. It was a lot of fun--in fact I priced all the pieces and found that I can build a decent machine, word processor, email, web browers, limited games, for about $320 (that includes the monitor and everything). I think that Sofia needs one with a pink case and Dylan needs one that has a bright green alien on it. :)

Wednesday, March 14, 2007

So I had a breakthrough last night...

I spend most of my free time on the computer doing homework (free time defined as not at work, not spending quality time with family).

Anyway, this will be less than interesting to you, but I got so excited I had to share. I had a breakthrough last night--I'm not going to get nominated for a Nobel prize anytime soon because of it, but I was excited since this has been vexing me for days.

I'm writing a program that simulates a barber shop. Why a barber shop? Because it demonstrates some basic computer operating system concepts (Windows, Mac OS, Linux, and all the others all have to deal with this particular issue). The problem is that there is only one barber and he can only serve one person at a time. If the barber has several people come in at roughly the same time there has to be a mechanism to control who gets to sit down in the chair.

In a computer system the barber is a shared resource, usually thought of as a piece of data that resides on the system, but could be any other system resource. The customers are programs that need to use the piece of data--the task is to write an underlying operating system (like Windows) in order to match the needs of the customers to the availability of the barber. It’s both complicated and simple at the same time.

Basically what you have to do is have the customer look to see if the barber is already busy--if he is the customer sits in the waiting room and waits until the barber is free. If he's free the customer sits down and gets a haircut. Oversimplified of course, but that's the general concept.

Where my breakthrough came in though was in the timing of it all. Forcing pauses (each haircut is supposed to take a random time between 1 and 3 seconds and customers come in at random intervals, between 1 and 3 seconds), keeping the barber busy, and making sure the waiting room doesn't get overcrowded, are all very manageable actually. But how to continuously generate customers over a two minute period? Ah, that's what has been plaguing me for days. Now that I've solved it, the solution looks obvious.

I was trying to figure out how to make my program to run for two minutes and then stop, while continuously generating new "customers" every 1 to 3 seconds. I was using a for-loop, nested inside either a do- or while-loop, but I couldn't figure out why it was ignoring the do and while loops and only exiting when the for-loop completed. It also wasn't very elegant since I had to predefine an upper limit for the for-loop.

My first solution looked like the following. One other note is that the method call to System.currentTimeMillis() gives the time since January 1, 1970 in milliseconds (a very, very huge number)--120,000 milliseconds is two minutes. So basically, it is supposed to finish when the start time equals the current time minus two minutes (clever, actually--well, I think so anyway). Anyway, here's the code I tried first:

long startTime = System.currentTimeMillis();

while (startTime >= (System.currentTimeMillis() – 120000) ) {

for (int customerID = 1; customerID < 100 ; customerID++) {

threadWait();

customerID++;

}

}

It seemed like it would work, but runtime would take over three minutes and it wouldn't stop until customerID equaled 100! I know, right? Annoying.

Finally, late last night, around 12:30 AM, I realized that there is a much easier (and like I said, obvious) solution. Junk the for-loop since I don't really want to have a limit on the number of customers in the two minutes anyway. Reality is that I wouldn't approach one hundred in two minutes, but once the JVM enters a for-loop I guess it ignores whatever other instructions there might be. And voila! It becomes a simple do-loop that increases the customerID each time it generates a new customer.

long startTime = System.currentTimeMillis();

int customerID= 1;

do {

new customer(customerID);

threadWait();

customerID++;

} while (startTime >= (System.currentTimeMillis() -120000));

Like I said, this will be less than interesting for most folks, so if you've read this far then you have my congratulations. But, if you've read this far AND you've understood everything then we need to talk because I might have some questions for you... :)

Wednesday, February 14, 2007

So I am trying out Office 2007…

And I found out that I can use Word on my desktop to write blog entries and then have word communicate with blogger to post the blog entry for me. I like Office 07 so far, there doesn't seem to be any added features, but the features that are there are much easier to get at—no more digging through drop down menus. If you need something, it's right in front of you. I need to find a host for pictures now. Flikr is free, I think—does Yahoo! Have anything?

The biggest change though is that MS changed the default file format. They've gone to Office OpenXML (OOXML)—if someone sends you a document created in Word using the default setting, it'll come across as a .docx – you can change it to .zip and see the XML files directly. Versions prior to 2007 will have to have a compatibility update.

I also downloaded Vista, but I haven't been able to get the downloader to validate the file, and I don't feel like downloading the 2.5 gigabytes again.

Oh—probably the coolest thing though is OneNote, I use it to keep track of my schoolwork, it works like a notebook, creates tables automatically, an automatic calculator function. I bet though that it's at its best on a tablet though.