Woah, An Update

Why hello there. As I sit here and wait for my pot roast to finish. Lately, has been busy. Really busy.

Before the year ended we adopted a puppy. Let me tell you, he is a handful. We have gone through multiple trainers with him now. The latest trainer however has come through for us. I am not going to lie, my puppy is a bit more behaved than before. Don’t get me wrong, Bean is a great dog inside but outside on his walks, all bets are off. He is the most loving dog inside our apartment but when he sees another dog outside he goes bat shit crazy. Thank the Universe he is improving everyday. His main problem is being around other dogs. It’s an issue we are working day by day.

On the work front my company did some restructuring in my department. We have a new VP of Engineering, essentially a new boss for me. I am pretty stoked for the future of my department. We are very structured and more process oriented than before. Makes me a very happy engineer.

Speaking of work, I have been enhancing my programming skillset. I’ve been working more on Java, Spring, and Hibernate projects. I don’t think I’ll get over the fact that I have to write 100000000000000 lines of code to do one thing. I am exaggerating of course…maybe.

Along with work my new boss pointed out that 10Gen is offering free MongoDB Courses. I am currently in Week 5 with a couple of more weeks to go. I am kicking ass at it, 100% on each HW so far and we can drop the lowest score.

Anyhoo, I think it’s time to check on the roast. I promise not ignore you dear blog. Cheers for now.

MongoDB (Sorta Quickstart Guide)

There has been a lot of traction in general about the entire NoSQL movement. You’ll hear a lot about Cassandra, MapReduce (MapR), and MongoDB when it comes to this realm. At work I’ve been tasked and have had the pleasure of playing with MongoDB. Today, I spent most of the time playing with it, mainly tried to get it up and running.

I was having trouble at the beginning trying to get everything. It was mainly due to some server configuration ignorance on my end but now it’s up and running. The server I have it on is our dev server. Currently, the server is running a Centos 6, PHP and now Mongo locally. Mind you, this is purely for development purposes.

I’d like to share some information for those of you starting MongoDB to help save you some time. Read this blog post to get yourself up and running. Make a /data/db directory and the command below gets Mongo daemon running:

$ mongod --bind_ip <IP ADDR> --rest --fork --logpath /var/log/mongodb.log --logappend

Cast Iron Grill Pan

I seriously miss being able to BBQ. I remember I could just go out on my deck and throw some steaks or chicken on the grill. Living in the city and having to downsize a lot of our things, most of important of them all is my kitchen. My kitchen was small back in LA but now it’s even smaller. I use my kitchen table and oven as storage areas. Anyhoo, I bought a grill pan to offset not having a BBQ grill. I know it’s not the same it’s just going to have to do.

SWTOR

I am officially addicted to this game. The gameplay brings me back to all the RPGs I’ve played early on and loved. It’s nice to finally see a game contend against WoW. At level 17 I was given a space ship in the game for travel and SPACE COMBAT. MOTHER EFFING SPACE COMBAT!

Bulk Script for Store Locator

Currently, I am working on a website for a client who purchased a zip code locator for their website. The product itself did not come with functionality to bulk import stores from a CSV file so I had to do it myself. After using the MySQL load functionality I noticed that the app didn’t return any stores without longitude and latitude. I was looking through their functions and something was off. It wouldn’t let me do it. I contacted the vendor and they responded with “We could do it for more money.” PFFFT! Fark that!

So below is the script I used to grab the longitude and latitude from the Google Maps API and plop it back into the app’s table. After I ran this script the store locator started working. So for those of you that use PHP Store Locator from PHPJabbers, enjoy.

require_once("options.php");
require_once("include.php");
require_once("include/functions.php");

	$qry = mysql_query("SELECT store_id,address_1,address_city,address_state,address_zip FROM storelocatorstores") or die(mysql_error());

	while ($r = mysql_fetch_array($qry))
	{
		$address = array ( );
		$address[] = $r[1];
		$address[] = $r[2];
		$address[] = $r[3];
		$address[] = $r[4];

		$_address = implode("+,",$address);
		$file = 'http://maps.google.com/maps/api/geocode/json?address=' . urlencode($_address) . '&sensor=false';

		$geocode=file_get_contents($file);

		$output= json_decode($geocode);

		var_dump($output);
		echo "---";
		var_dump($r[0]);

		$lat = $output->results[0]->geometry->location->lat;
		$long = $output->results[0]->geometry->location->lng;

		mysql_query("UPDATE storelocatorstores SET lat='" . $lat . "',lng='" . $long . "' WHERE store_id=" . $r[0]) or die("update err: " . mysql_error());
		sleep(2);

	}

Upgraded to PHP 5.3

Finally! Upgraded my server to run PHP 5.3.

Been busy with work and such. We just underwent a big DC migration, let me tell you working seventy hour weeks is not fun. I am still exhausted from it. Anyhoo, it’s done for the most part even though I have to get our stage environment up and some push scripts need to be created.

Side Project

I plan on starting my side project back up again soon. By soon I mean this weekend. At first I was going to go with Django/Python for it but I decided to give CodeIgniter another whirl. Seems like an easy enough transition from CFWhels.

Goodbye HostGator, Hello Linode

I figure it was time to grow up and have my own server. Maybe not server but VPS. Close enough, right? I moved all my sites to Linode. Running beautifully on my LAMP box. I have Django going on Cookie Loves Fortune so that’s the next big step for me to learn more Python. Anyhoo, I am enjoying the new virtual digs.