Wednesday, December 26, 2007

Long time no see...

Hey guys sorry if it seems that I've dropped off the map here lately. I've been helping a small site get on it's feet it can be found at http://www.christian-gaming.com . Since I've practically run out of idea I would like to hear from who ever reads this blog what would you like me to discuss? Or what are you having problems with? email me at chris.maness at christian-gaming.com.

Tuesday, October 16, 2007

Apple I'm pissed.....

This past Saturday the 13th my MacBook Pro bit the dust. It had been acting slow and randomly closing down apps. So I decided to reboot it and hope the problem would go away it didn't instead when I tried to turn it back on it came up to the gray screen that mac users are so familiar with and beeped three times. I tried to restart it again hoping that it would do something different but again it booted up and beeped three times. So I did the first thing anyone would do I went to apple.com to see if it was a battery problem or something. I looked around for half and hour and found nothing about a mac beeping three times on startup. I decided it was time to call the dreaded tech support line. I call and got the usual Indian voice 'thank you for calling apple tech support how may I help you' I told the rep my serial number and what was going on and he said 'I see you 90 days of free phone tech support has run out but before I charge you or try to sell you the applecare plan lets try some simple diagnostics so I can get a general idea if it's a software or hardware problem' I thought well that's nice. So he asks me if I have my OSX DVD with me. I tell him that I don't and he says I need to call back as soon as I get the disc. I was ok with that so as soon as I got off of work I went home got my disc and called back. This time I talked to a different rep and he was not nice to say the least. As soon as I told him my serial number and what it was doing he said I'll have to charge you 49.99 for this phone call. I was stunned being a college student I just don't have 50 bucks to blow off (that's 2 1/2 weeks of eatin). I told him what the other rep had told me and he put me on hold. 32 minutes later (yes I counted I was pissed already) he comes back and says 'What is the computer doing?' I told him the same thing I told him 30 minutes ago. He told me some instructions to run those simple diagnostics... turns out it wouldn't even load the cd and the rep thinks I'm some kind of idiot and he's like sir you need to follow these instructions specifically I told him I was but he didn't believe me. So ended up he thought there was something wrong with the optical drive; I found that kinda hard to believe since that doesn't have anything to do with my computer running slow or not starting up. So he sent me out a box and told me my computer's hard drive would have to be formatted; which again I had a hard time believing that the hard drive would need to be formatted if the optical drive was screwing up. I asked the rep if there was any way I could save my data and he said no. So I finished up the conversation and he didn't charge me (total hold time for this whole conversation was 50+ minutes) he sent me out a box and and shipping instructions. Then after hanging up the phone I decided to google the 3 beep error and found out that I could recover most of my data on the hard drive. It turns out that I had a bad ram module so I took the ram module out and it booted up just fine and I was able to recover the data that otherwise would have been lost. Needless to say I was surprised at how dumb Apple tech support could be. I thought Apples were for elites so I figured they would have a tech support service that could help me but I was sorely mistaken. So now I'm waiting for my box to get here (I'm still going to send it in to get my screen fixed it has about 50 dead pixels). So Steve if your out there reading this I just want you to know I'm having serious doubts about my next computer being a Mac.

Users of Digg please help me raise awareness about this issue; Digg this article

Saturday, June 16, 2007

Hard Time finding anything to write about.

Well I'm having a hard time finding something to write about. I just can't seem to finding anything really interesting to write about. If you know of anything you would like to learn about email me and I'll see what I can digg up for an article on here.

Thursday, May 31, 2007

Microsoft Surface

When I first heard about 'Surface' I thought wow that's a neat idea but sort of a novelty. Now that I've actually seen the videos all I can say is wow! If this new system works like they show it working it will be truly awesome. Imagine if it was compatible with all devices even other PCs and dare I say it Macs (Probably wishful thinking) for instance; Imagine setting your laptop down on this thing and syncing your photos from your laptop to your Zune or to your PSP if this just works off of wi-fi this isn't to far fetched. This is one technology that I think Microsoft is ahead of the game with. Imagine the possibilities, Not only would device lessen the learning curve for younger kids and elderly people. People tend to respond better to a technology that they can touch and feel. However Microsoft needs to watch which direction they take this in, if they keep everything open and keep up to date with the drivers and include drivers for everything that has Wi-Fi on it this will be a truly awesome piece of tech, however on the flip side if they close it to only Microsoft stuff they'll suffer a lot not necessarily failing but it won't be as good as it could be. Also being touch sensitive I can see designers using it like a wacom tablet using a stylus to draw out their creations. I could even see architects using this with digital modeling imagine taking a virtual tour through a house with a touch of your finger and flipping, modifying, and redoing anything with just a flick of a wrist. Watching the video I think that they have stolen a little bit from multi touch but as far as I can tell everything else is original. I know Apple came out with multi touch first and I'm even a big fan of Apple (I own a Mac Book Pro and love it), but Microsoft has taken it much further than I've seen with Apple's technology that's not saying Apple doesn't have something like this. I've heard that Apple is making a full-sized multi touch device (Like surface? More like the iPhone? I don't really know.). We're still a long way from the 'Minority Report' interface but we're getting there.

EDIT: By minority report I mean no apparent UI just like a window and using your hands to navigate without touching the surface.

Wednesday, May 02, 2007

Off Subject Sorry 09-f9-11-02-9d-74-e3-5b-d8-41-56-c5-63-56-88-c0

Ok so this morning when I got on the computer and set down to do my usual bit of browsing I went to digg to see what was interesting and as looked at the side bar I saw a very strange sight over 10,000 diggs on a post. I thought that was strange since I haven't seen an article like that since the iPhone. I looked at the article and it's title was: "Digg This: 09-f9-11-02-9d-74-e3-5b-d8-41-56-c5-63-56-88-c0". I thought to myself what a strange title so I looked at it and it was linked to another story concerning the cracking of an HD-DVD code the series of numbers 09-f9-11-02-9d-74-e3-5b-d8-41-56-c5-63-56-88-c0 is the encryption code for HD-DVDs Anyhow I looked around to see what this was all about and Toshiba has sent a cease and desist declaration to digg telling them to take down the code. So everyone has decided to fight back. Now comes my part I am going to post this everywhere I can't use it and I don't know how to use it but if Toshiba or whoever can't make any better encryption it deserves to be hacked. It just took the community about 5-6 months to crack it if they were at all serious they could have done it in about 3 months thats unacceptable. Toshiba if you don't want it cracked make it a little better next time..... oh and by the way 09-f9-11-02-9d-74-e3-5b-d8-41-56-c5-63-56-88-c0........

Sunday, April 01, 2007

My adventure with microformats on rails

My adventure with microformats on rails:

So after listening to all of the SXSW podcast I decided that I need to try something new namely microformats they seem like such a cool piece of tech and I wanted in on it too. I started looking around at these weird little things called microformats. I found out that they were just a simple little XHTML snippets but there is a standard of markup, I won't go into to much detail about that so for my contact info I would mark it up like such:


<div id="hcard-Chris-S.-Maness" class="vcard">
<span class="fn n">
<span class="given-name">Chris</span>
<span class="additional-name">S.</span>
<span class="family-name">Maness</span>
</span>
<a class="email" href="mailto:chrisprayingmantis@yahoo.com">chrisprayingmantis@yahoo.com</a>
<div class="adr">
<div class="street-address">Maness Hollow Ln.</div>
<span class="locality">Blackwater</span> ,
<span class="region">VA</span> ,
<span class="postal-code">24221</span>
<span class="country-name">USA</span>
</div>
<div class="tel">+1 555 999 2002</div>
<a class="url" href="aim:goim?screenname=prayingmantis207">AIM</a>
<a class="url" href="ymsgr:sendIM?chrisprayingmantis">YIM</a>
</div>


Now this is just a standard way of marking up the data that you already have inside of your site so that other applications can accessing your data easier. So adding it into your site is so easy I don't see why we couldn't start building this stuff right in from the start. Now I've got you wondering "Which applications can use these pieces data?" as of right now there are not to many apps that can use that have been developed yet (that I know of). Technorati is one of these few apps that searches blogs and looks for microformats in the process. Just having these microformats in there gives us a ton of functionality to use. Speaking of that let us take a look at a rails plugin that helps us to read these little pieces of information.

As you all may know I am a ruby on rails fanatic and I'm always ready to try something new. So I started looking around the net for a ruby gem or a ruby plugin that could read microformats , lo and behold I stumbled ac ross this plugin for rails called mofo (what a horrible pun). So I decide to take a look at it, and I've got to say it works pretty good but not as well as I would like it to, the only thing it won't do so far is read tags off of your own rails app (I found that little odd but I can work with that.). So all in all this looks really good so far. I'll keep looking for more interesting stuff for my next post.

Saturday, March 31, 2007

Sorry it's been so long.

Sorry it's been so so long since I've posted I've been tied up with school trying to get everything in order before I graduate. Regular service will return in about a month and do I have a lot of things to talk to you about!

Friday, January 19, 2007

Rflickr and Google maps mashup

So you've started with rails and now your looking for something else to do after all you didn't think that the book was to hard easy right? Gems are an awesome part of ruby they can add a good deal of functionality to your project. In this tutorials we are going to be using the rflickr gem not to be confused with the flickr gem; These two are complete polar opposites. Getting started you can use Maxx Dunn's tutorial for installing and activating the rflickr gem (if you don't have it installed already). Now that you have all that done lets begin to write some code. Since the rflickr gem doesn't have any built in geo functions we'll have to construct them ourselves. First we need create a new rails project so that we can start off with a nice clean canvas.

rails mynewproject


Now change directories to the mynewproject and create a new controller with an index page.


cd mynewproject

script/generate controller View index


Alright now that we have that completed, start writing some code after all that's what we came to do. Open up the view.rb file found in app/controller directory. We'll get the peliminaries out of the way first. Declare you variables which are API_KEY and SHARED_SECRET these are just so we don't have to write them over and over again. Then we set the flickr gem to required.


require 'flickr'

API_KEY = "your_api_key"

SHARED_SECRET = "your_secret"


Now we need to create the index actions. For the index we need to load in a flickr instance and get the proper authorizations.


flickr = Flickr.new("/tmp/flickr.cache", API_KEY, SHARED_SECRET)

flickr.auth.token


Now we get to write our own custom function using the xml and rflickr libraries not really too complicated. I'll try to explain what each line does. First lets define a new function that way everything is separated.


def GetLocation(photo)

end


Then we start adding more code in this function.


flickr = Flickr.new("/tmp/flickr.cache", API_KEY, SHARED_SECRET)

photo = photo.id if photo.class == Flickr::Photo


Now what we've done is made another instance to use just for this function then we added the photo.class to make sure we get a photo after all that's what we wanted right?



res = flickr.call_method('flickr.photos.geo.getLocation',

'photo_id'=>photo)


What we just did is added the method that we want to call and believe it or not it is that easy. Now that method will return an xml response which we can use. Which would look something like this.


<rsp stat="ok">

<photo id="269619243">

<location latitude="36.675303" longitude="-82.816829" accuracy="16"/>

</photo>

</rsp>


Now add the last bit of code.


lat = [ ]

res.elements['/photo'].each_element do |location|

att = location.attributes

lat << att['latitude'] + ", " + att['longitude']

end

return lat


And now that's the last bit of code we have to add. First we made a variable to contain the data then we have to put data into or it is useless. The att variable just makes our program look at the attributes instead of the content because with these xml files we don't have any content that's useful. So after we pick off the lat and lng we end it and return the lat variable which has now got our geo data in it. Lets add that function we just created into our index function. For now we'll just hard code the id in. To make this really functional we would load the id# from a text box on the page or something like that but I'm sure that you can figure out how to do that.


@loc = GetLocation('269619243')


Now go to the app/views/view/ directory and open up the index.rhtml. Delete all of the content inside of it. I prefer starting with a clean slate. I don't really need to explain all of this code just the ruby parts the google maps documentation does a pretty good job of explaining everything.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="content-type" content="text/html; charset=utf-8"/>

<title>View</title>

<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAUzR0Te-MXqdOV0HHbLuZzxTJQa0g3IQ9GZqIMmInSLzwtGDKaBQCm9xJHrKAuzvUhpgFvwlPeNxPnw"

type="text/javascript"></script>

<script type="text/javascript">

//<![CDATA[


function load() {

if (GBrowserIsCompatible()) {

var map = new GMap2(document.getElementById("map"));



<% for location in @loc %>

map.setCenter(new GLatLng(<%= location %>), 13);

map.addOverlay(new GMarker(<%= location %>));

<% end %>

}

}


//]]>

</script>

</head>

<body onload="load()" onunload="GUnload()">

<div id="map" style="width: 500px; height: 300px"></div>

<br />

<% for location in @loc %>

<%= location %> <br />

<% end %>

</body>

</html>


Ok I know if we were loading multiple locations we would want something fancier than what I've got but this tutorial is just to get you started by no means is it all you can do with it. So basically all our ruby does is set the map center to the location we gave it and put a marker there (I'm trying to keep this simple so you can follow that's why I just did one image at a time.). We'll boot up web brick and watch this thing run.


When your done your source for the view.rb file should look like this:


class ActivateController < ApplicationController


require 'flickr'


API_KEY = "7483873a88574d1ec1cdb94ee3ccf0b1"

SHARED_SECRET = "b08a4090e6b235a3"


def index

flickr = Flickr.new("/tmp/flickr.cache", API_KEY, SHARED_SECRET)

flickr.auth.token

@loc = GetLocation('269619243')

end


def GetLocation(photo)

flickr = Flickr.new("/tmp/flickr.cache", API_KEY, SHARED_SECRET)

photo = photo.id if photo.class == Flickr::Photo

res = flickr.call_method('flickr.photos.geo.getLocation',

'photo_id'=>photo)

lat = []

res.elements['/photo'].each_element do |location|

att = location.attributes

lat << att['latitude'] + ", " + att['longitude']

end

return lat

end


and the index.rhtml should look like this:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="content-type" content="text/html; charset=utf-8"/>

<title>View</title>

<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=your_api_key_here" type="text/javascript"></script>

<script type="text/javascript">


function load() {

if (GBrowserIsCompatible()) {

var map = new GMap2(document.getElementById("map"));



<% for location in @loc %>

map.setCenter(new GLatLng(<%= location %>), 13);

map.addOverlay(new GMarker(<%= location %>));

<% end %>

}

}


</script>

</head>

<body onload="load()" onunload="GUnload()">

<div id="map" style="width: 500px; height: 300px"></div>

<br />

<% for location in @loc %>

<%= location %> <br />

<% end %>

</body>

</html>


I hope you've enjoyed this tutorial and I look forward to writing more. Please send all of your feedback to chrisprayingmantis@yahoo.com.

Saturday, January 13, 2007

The real guide for getting up and running with rflickr

OK so a project I'm working on now is using the flickr api to get pictures, so my team looked around the web for a good library for ruby and at last we found rflickr. Rflickr has very little documentation except for Max Dunn's tutorial witch I borrowed some from so here's how I did it

First create a new rails project:

%> rails myapp
%> cd myapp

Now lets make sure we have the latest version of the gem installed

%> sudo gem install rflickr

Make sure you install all of the required dependencies
Now we're ready to get started open the ruby console

%> script/console
Loading development environment.

now we make sure we require the flickr library

>> require 'flickr'

now set your api key and your shared secret

>>API_KEY = "your_api_key_here"
>>SHARED_SECRET = "your_secret_here"

now we start flickr up don't forget to include the path to flickr.cache

>>flickr = Flickr.new ("/tmp/flickr.cache", API_KEY, SHARED_SECRET)

now we get the frob,

>>flickr.auth.getFrob

and generate the login link.

>>flickr.auth.login_link('write')

now copy that link into your browser and allow it
Now all that's left to do is to get the token and cache the token

>>flickr.auth.getToken
>>flickr.auth.cache_token

Rock on now we're up and running...so we got this flickr think so ummm what can we do with it. Well lets try it on something simple shall we? First restart the console, then we just have a few steps instead of all of those steps all over again.

Set your api key and your secret
>>API_KEY = "your_api_key_here"
>>SHARED_SECRET = "your_secret_here"

Then load your environment and the token.

>>flickr = Flickr.new("/tmp/flickr.cache", API_KEY, SHARED_SECRET)
>>flickr.auth.token

Lets try a simple function first. Let's get a users tags.

>>flickr.tags.getListPhoto('269619243')

The rest of the api is straight forward. It's just like the flickr api. If you have any topics that you find interesting or want to learn about and I'll try to post them here. As always you can contact me at chrisprayingmantis@yahoo.com. I would love to hear from anyone who is reading this blog.

Sunday, January 07, 2007

Happy New Year

Well this a new year time for new beginnings new software and more learning. Its more so a new beginning for me because I got a new Macbook Pro over the holidays and I'll have to say that I am now an Apple fanboy. Also over the Holidays Adobe released their new CS3 which is awesome. Finally over the holidays I learned about the new D programming language that's aimed at taking ruby and C and using the best of both to create a new language. I have to say I like what I've seen from D so far it looks to be far easier to learn than C or C++ . Well I'll be signing off for this week see y'all later.