Officer in Civvies

The life of a soldier at a civilian university.

Archive for August, 2009

Squirrel!

Posted by officerincivvies on August 22, 2009

Posted in Pictures | Leave a Comment »

CSS 3 – Rounded Corners

Posted by officerincivvies on August 22, 2009

If you can’t see the round corners on this div layer, it’s because you are using IE, so really I have no sympathy for you.

I just discovered a new feature in CSS 3 which is rounded corners in div layers.

This is cool so now you can place images as the background of a div to give it rounded corners without having to use photoshop. You can get images like this:

Now that Firefox is in Version 3 it has support for CSS3. I think most browsers do except for IE. There is still the downside to this that CSS doesn’t have the ability to stretch or shrink images, so if you are trying to shrink a 200 x 200 image to a 100 x 100 div layer with rounded corners you will get something that looks like this.

I am trying to find a way around this problem without using server side scripting languages. My current host doesn’t have the GD PHP library installed so that option is out.

Posted in Technology | 1 Comment »

F-E-A-R

Posted by officerincivvies on August 17, 2009

No, this post isn’t about the game FEAR.

Instead it’s about a genius move that I discovered on bulbapedia with how you can beat a level 100 pokemon using a level 1 rattata. Hence why the abbreviation for Fear is “Fucking Evil Annoying Rodent.”

All you have to do is equip a Focus Sash to your rattata who knows Quick Attack and Endeavor. For your first move use Endeavor, your opponent is likely to use an offensive move which will bring you to 1 HP. Your endeavor will bring your opponent to 1 HP as well. Now finish them off with a quick attack, which is a priority move meaning you will attack first.

There are some flaws to this move, but often it works quite well.

You can read about it here, where I learned about it.

And for a video on this rattata “pwning shit up” take a look here:

Posted in Technology, Videos | Leave a Comment »

CRIM-413 BS

Posted by officerincivvies on August 12, 2009

I took CRIM-413 by terrorism this semester and so far the Tutor Marker (TM) has been … an idiot for lack of a better word. A couple weeks before the final she wrote a post explaining us what to expect and she said the following:

You will not be required to memorize dates, but will need to know the order of key historical events.

Ok fair enough… except look at what was staring at me on the first question on the test:

What year was the Lebanese Civil War?
a. 1800-1815
b. 1900 – 1915
c. 1975 – 1990
d. 2000 – 2009

Now I am not retarded, but these are dates and we were told we did not need to memorize dates. So I try and protest this to the TM but her response:

The message I sent out did specify that you will need to be aware of the order of key dates and the dates that were provided to you as responses in that questions were so far from one another, that if you knew the order that events took place historically, you would have no difficulty deducing the answer. It is important to be aware of the period in which events took place to be able to contextualize them and this question was designed to test whether students were able to do this. The question will not be removed from the exam.

Bullshit. That is the only word to describe this situation. I know I really shouldn’t care because that one question is only worth 0.35% of the year. I am not trying to figure out whom I bring it up to next because obviously arguing with the TM is going to get me no where. While arguing with anyone else still probably won’t be me anywhere, it’s the matter of the fact.

Posted in Rants, School | 2 Comments »

End of Semester

Posted by officerincivvies on August 9, 2009

Well it’s the end of semester, and I am in the middle of finals so we can definitely call this a procrastination post. I wrote my CRIM-413 final on Friday which was decently easy. It only had 100 MC questions. I have two finals on Friday, then one more next Monday.

Once finals are over I will review the classes.

For now I am still working on my website project and I have been playing a lot of Pokemon Pearl on my DS. I’ve been wanting to play it for a while for the nostalgia. Usually I just only use my start pokemon and get him up to level 80+ before going after the elite four. This time I have about four pokemon I use all the time which is better, although the pokemon are weaker in terms of level.

And why does the PokeCentre wish to “see you again soon?” I could never figure this out.

As you can see on the right hand side of my blog I have linked my last.fm feeds so you can see the last 10 songs I have listened to and I am currently working on getting my Weekly Top Artists feed to work. That’s last.fm’s fault not mine.

Posted in Misc | Leave a Comment »

PHP – Finding Geographical Location

Posted by officerincivvies on August 2, 2009

In the past on previous websites in the registration field for “Location” I have found users would always lie about that. I hate it. I am working on a new website for a personal project and one thing I wanted to do was with PHP find the geographical location.

Despite what Cory thinks there is no

canHazLocation() or

whereTheHellIsTheUserLocatedIncludingAddress() function.

So after searching through a bunch of random blogs I managed to find this site: http://ip-to-country.webhosting.info/. What they offer is a download-able CSV file which contains the current location of where all the IP ranges are assigned to. Because IPs can change you will need to download this file once a month or so.

There are five columns in the CSV file: IP_FROM, IP_TO, COUNTRY_CODE2, COUNTRY_CODE3, COUNTRY. You need to make a table in your database with those columns (types: double, double, char(2), char(3), char(255)). Then import the CSV file into the table. PHPmyAdmin should have a feature to do this.

Now to find the users location, we can just use the following code:

$ip = getenv('REMOTE_ADDR');

$ip_number = sprintf("%u", ip2long($ip));

$sql = mysql_query("SELECT country FROM ipcountries WHERE ip_from = $ip_number") or die(mysql_error());
$info = mysql_fetch_array($sql);

echo ucfirst(strtolower($info['country']));

An example can be seen here.

Posted in Technology | Leave a Comment »