Categories
Uncategorized

I introduce to you, a new way to rant

It occurred to me that a lot of people have things to rant about. Your first option might be to rant on twitter or facebook, but you “sort of” know those people. Those sites aren’t anonymous and you sure as heck aren’t going to waste your time creating a blog. Enter NerdRANT.

NerdRANT is a bit different than a normal website.  Right off the bat you’ll notice that the box to post a rant is on the top of every page, kind of like Twitter.  It needs to be EASY and painless to complain, right?

Second, you’ll notice that there is no “sign up” button.  There is a sign in button.  Instead of wasting your time with yet another sign up box, NerdRANT authenticate’s users from other services such as Google and Twitter.  All you have to do is already be logged into these things and allow NerdRANT to populate some basic user info.

I know what your thinking.  If It’s grabbing your info, how the hell is posting anonymous?

Each user has the option of submitting a rant or comment with 3 different display names.  Yes, each user is essentially 3 users in one.  You can submit a post based on your userid #, location, or real credentials we collected.  By default, its based on number.  It’s up to you which display name you’d like to use.

If I see a decent amount of people using the site then I will be adding more features.  Until then, rant.

Categories
cpanel

The perl module DateTime could not be installed

For those of you experiencing the sporadic error “[checkperlmodules] The perl module DateTime could not be installed”, there is hope for you! Over at the cpanel forums they have a simple suggested fix that seemed to work for me.

SSH to your server and type in:

/scripts/perlinstaller --force List::MoreUtils

Reply back with your comments if it did or did not work for you.

Categories
jquery

jQuery 1.3+ Autocomplete, The Newbie Guide

This is my first jQuery guide specifically for newbies who either don’t have much experience with jQuery or just need to see an example to understand it. The more examples you read, the better off you are at developing your own stuff.

For those of you hoping to see jQuery UI 1.8’s autocomplete, sorry to disappoint you. I tried to use their new autocomplete built in feature, but was unsuccessful using their new plugin. The autocomplete plugin I will be using was created by Jörn Zaefferer and can be found here.  Even though he has several examples, I still couldn’t figure out how to achieve the autocomplete I was looking for.  My guide also has techniques borrowed from 1300 grams.  My goal is that this guide will be newbie friendly so just about anyone can pick it up from here.

For this example we will be using similar code from FantasySP to search for baseball players. (If you haven’t heard of FantasySP, its a fantasy sports news aggregator that collects player updates from dozens of sites to give you an edge when managing your fantasy team.) When typing a name we want to see what team he plays for and his position:

Let’s take a look at the input box that is used to achieve the autocomplete:

MLB Player Search

Nothing too complex going on here.  The autocomplete=”off” is to make sure the web browser’s autocomplete is disabled.  Now onto the jQuery function. (Unfortunately syntax highlighting won’t be used because it screws with the code. No idea why.)


$(document).ready(function() {

$('#player').autocomplete("/tutorials/autocomplete/auto_complete.php", {
dataType: 'json',
parse: function(data) {
var rows = new Array();
for(var i=0; i
rows[i] = { data:data[i], value:data[i].pos, value:data[i].team, result:data[i].value };
}
return rows;
},
formatItem: function(row, i, n) {
return row.value + ' ' + row.pos + ' ' + row.team +' ';
},
extraParams: {
q: '',
limit: '',
maxRows: 15,
term: function () { return $('#player').val() }
},
max: 25,
width: 200
});
});

Things get complicated when it gets to parse:. Essentially all it’s doing is taking the returned JSON response and organizing it an array so it can be manipulated. I am adding two new JSON values that need to be manipulated, pos and team. They are listed like so: value:data[i].pos, value:data[i].team. The section where it says result:data[i].value is what is returned into the input box when it is selected. We don’t want pos or team included in the box, so we simply use .value.

Next up is “formatItem:”. This is what adds extra styling to the results. It’s fairly straightforward, we are using the same values that were just added to the array in the previous function.

“extraParams:” are the added variables that will be passed to the PHP script. We have q, limit, maxRows and term. q and limit are set to blank because I won’t be using them in this particular example.

Now the easy part is the PHP function:

$var = mysql_real_escape_string(strip_tags($_GET['term']));
$sport = 'mlb';

if($sport == 'mlb' && strlen($var)  >= 1){

	$result = mysql_query("SELECT * FROM players WHERE sport = '$sport' and hisname LIKE '%$var%' LIMIT 25");

	while($row = mysql_fetch_assoc($result)){

        $row_array['pos'] = $row['pos'];
        $row_array['team'] = strtoupper($row['team']);
        $row_array['value'] = $row[hisname];

 array_push($return_arr,$row_array);

}

echo json_encode($return_arr);
}

That is all there is to it folks! Check out the barebones demo. It shows the necessary javascript files needed and syntax highlighting.

If you are great with jQuery and would like to rewrite the javascript function to work with the jQuery UI autocomplete, be my guest. I will glady link to your post or append the code to this post.

Categories
jquery php

jQuery vs Prototype, a newbies perspective

When I first started to dabble with javascript and ajax, Prototype was the only game in town that was making any headlines. So of course I used prototype with script.aculo.us .  I was able to make some simple stuff, but my coding with Prototype wasn’t very elegant and it certainly wasn’t the best way to code things.  But you know what, I’m a javascript newbie and  it worked!

Over the last few years it seems like Prototype development has slowed down a lot, while jQuery is making huge headway.  Every tutorial I see is using jQuery.  So I FINALLY decided to buy a book and learn it.  They are vastly different to say the least.  My prototype code had an awful lot of onclick=”” kinda stuff inside the HTML, while jQuery let’s your code appear more transparent and natural.  I love being able to pass my own variables using html attributes.

I went through a lot of WTF, why isn’t this working moments during my first attempts at coding using jQuery techniques.  However, overall I love jQuery.  Now my code is optimized, cleaner, and I feel as though I am not limited in what I want to do.  If I can dream it, I can code it with jQuery.  Not a small feat for someone like myself.

For example, with Prototype I simply didn’t know how to show a loading gif when an ajax command was in use.  It sounds simple and a lot of you are probably thinking what an idiot.  I turn to jQuery and my first attempt I find that it’s so simple to achieve.  Not only that but I can easily manipulate form values, check their validity,and pass them along with no problem at all.

To learn jQuery I completely rewrote all of my javascript code for FantasySP.  It took me about 2 LONG weeks, but now I feel as though I can code just about anything I want.  My code is a mere 7kb in size now, compared to 49kb in Prototype.  I am actually making reusable functions now and you can too.

My only quibble with jQuery is that coding an advanced autocomplete function is a huge pain in the ass.  Prototype let me customize it from the backend (PHP), whereas jQuery forced me to use JSON and adding extra javascript code.

So for those of you who haven’t used a framework before, or are still using Prototype, give jQuery a try.  You won’t be disappointed.

Categories
apple rant

Thank you for DRM free music Scott Ambrose Reilly

I read a post today at c|net saying that Scott Ambrose Reilly is moving on from Amazon.com’s music division. I of course had no idea who he was until I read the article. Now that I know who it is, I have to say thanks for all he has done.

3+ years ago, 98% of the online digital music user base blindly and without question bought music from iTunes with Apple DRM so they could play in only Apple products. Smart business decision by Apple. ::cough:: monopoly, illegal business activities ::cough:: Of course the customers didn’t care because they had no choice. Not only that, but consumers are nothing but stupid, uninformed, lazy sheep.

Other services were out that offered music DRM free. Allofmp3.com was the first commercial music service that was DRM free and you could select the bitrate of your choice. Absolutely brilliant and ahead of its time. Of course they were sued and forced out of business (surprise, surprise). Nevertheless, it showed the way mp3 music is meant to be distributed. I never thought a major retail outlet would ever offer DRM free at reasonable prices.

Then came Amazon.com online music library. When I heard the news that they would be opening an online music library with no DRM at 99 cents a song I was completely amazed. How in the world did Amazon pull that off and get music labels to agree to it? What businessman had the ability to convince music labels this was the wave of the future?

Meanwhile iTunes still had DRM.

Amazon changed the game so much that it FORCED Apple to provide a DRM free alternative to customers, albeit at a cost to the consumer. Prices were over 99 cents for DRM free music on iTunes and no one seemed too outraged about it.

Meanwhile I thought to myself, only a fucking moron would ever buy anything from iTunes. I still believe that and have always thought that. I implore everyone to buy their music from Amazon whenever possible.

While I may have gone off-topic (can you blame me?), I want to come back to my original point of this article. To thank Scott Ambrose Reilly, because to me, he is the person we can thank for DRM free music today.

Categories
Uncategorized

Change Google Chrome’s UserAgent

Many of us heard of the iPad’s new Gmail interface and want to check it out themselves.  The good news is that it’s extremely easy to change Chrome’s user agent for Windows users without an extension or anything too complicated.  Click properties on your chrome shortcut and add the following:

-user-agent="Mozilla/5.0(iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10"

Please be aware that using the iPad version of Gmail on your PC doesn’t make much sense because you can’t scroll down your list of emails (your supposed to be using your finger). But for those curious, it’s worth a look.

Categories
Uncategorized

X3DAudio1_7.dll is missing

You just started to play your game (possibly Metro 2033) and saw the error pop up about X3DAudio1_7.dll is missing.  This error is about Microsoft’s DirectX missing a few required files. All you need is a simple update, so let’s get straight to the fix.

Head over to Microsoft’s website to download DirectX End-User Runtime.  This file will update your DirectX, regardless of what version you have installed.  I had this issue on a Windows 7 machine and after the update was applied the error message was gone.  On previous versions of Windows, you may need to reboot.

Categories
Google SEO

Free Google Search Keyword Tracking

Finally an advanced Google keyword ranking checker that is free.  The site is aptly named KeywordRankings and is geared towards SEO people looking to save a history of where their keywords rank in Google.

Feature List:

  1. Entire Service is free
  2. Add unlimited domains
  3. Add unlimited keywords
  4. Each keyword ranking is checked once per day
  5. Each domain is checked for index’d pages in Google once per day.
  6. Graphs are created for each keyword’s history and domain’s index’d history.
  7. A public secure and sharable link is provided for each keyword to show clients.
  8. Available for google.com, google.co.uk, google.ca, google.dk, google.es, google.it.
  9. Keyword Queue Ranking decides in what order your keywords get updated.
  10. Demo account available: login as [email protected] / demo .

The site is coded in PHP with a  jQuery front-end and is extremely fast.  Anyone involved in Search Engine Optimization should be happy with it.  At the moment it is in invite only mode so I can squash all of the bugs.

There have been questions as to how the site determines each users “Keyword Queue Ranking”.  There are a multitude of factors, such as how long you’ve been a member.  I cannot give out all the details, but I can say that it is an ongoing process and will be continuously tweaked.

Of course if you’d prefer to not deal with the Keyword Queue Ranking, then the option to donate to the site is available to get priority keyword checking.  The site has not recevied any donations yet, so for just $1, you will be at the top of the list.  Over time, if everyone donates $1, then you would need to donate another dollar to be first again.

Essentially the price for 1st in keyword priority is determined by you guys, not me.  The site will show you where you rank in the keyword queue.

I am allowing 5 new signups. (1 SIGNUP LEFT)  Enter code: fantasysp.com

If you have any questions or comments, respond below.

Categories
rant

Lost is a Travesty

I was doing my daily rounds of sites that I visit and noticed that The Big Lead had a post about Lost.  My hope was that they were going to make fun of the nonsense and explain how many times they laughed out loud.  Like when Hurley was doing yet another slow-motion scene.  But of course not.

Much to my surprise they actually praised the show.  TheBigLead apparently loves the new Ben and says:

What a travesty that there are only nine episodes left.

There is no sarcasm here either folks, they were saying that line with a straight face.  It’s absolutely stunning that a character can be villain for 4 seasons, then in the span of 2 or 3 episodes viewers see Ben become a good guy and they think nothing of it.  AMAZING.

I’m not going to waste my time to say all the reasons why Lost was completely ruined into a pile of dogshit.  Suffice it to say that there is not one character on the show who maintained his character through 5 seasons.  I guess when you like a show so much, you ignore all of the negative aspects of it.  Exactly like being a sports fan.  You say things like “your team got unlucky, the refs made bad calls, next year will be our year, Sanchise, etc etc”.

So in the end The Big Lead, you’re  just proving what it’s like to be a typical biased sports fan.

All I ask is that you watch season 1 of Lost again.  Look at the tone of the show and the direction they are going with the characters.  Take note of the eerie feeling you get while watching, what was once a great show. . .LOST.

Categories
SEO Uncategorized

SEO, To Hyphen or Underscore URLs Revisited

I’ve seen a lot of SEO Experts and many SEO tools recommend that you should be using hyphens in URLs rather than underscores, one example was Ann Smarty over at SearchEngineJournal.  For the disadvantages of the underscore in URLs she says:

Traditionally it isn’t seen by search engines as a word separator (this is slowly changing now)

Slowly changing?  It was reported in 2007 that Google and other search engines treat underscores like hyphens.  To say it’s slowly changing is like saying Facebook is finally catching on.  Three years on the web is an eternity.  She also says that there are no disadvantages to hyphens.  Though I’m not so sure about that. . .

Think about multiple ways that hyphens are used.  Hyphens are added in-between words and in people’s names.  For example, Maurice Jones-Drew of the Jaugars has a name with a hyphen.  Let me give you an example of a potential sentence that includes his name:

website.com/Maurice-Jones-Drew-has-all-star-week

Now if we use underscores it would look like this:

website.com/Maurice_Jones-Drew_has_all-star_week

Slightly different meaning in both of those URLs, wouldn’t you agree?  It is also much easier to read with underscores.  Therefore the BEST option is underscores because people rarely use them when it comes to typing names or phrases.  There is no way they will get in the way.

I know what your saying, I’m preaching to use underscores when this blog uses hyphens.  Wordpress uses them by default (though I’m not sure why and I never changed it)  Though I have used underscores on other projects….  Check out Jones-Drew’s page at FantasySP.com.

I don’t mean to single out Ann because she certainly knows her SEO, but this issue just keeps popping up every now and then and it truly annoys me.  It needs to be squashed once in for all.

UPDATE: In the comments below, Kieron Hughes provides a link to Matt Cutts suggesting to use hyphens.  I guess I stand corrected.

Do you guys agree with me or am I being too nit picky?