jump to navigation

ajax im March 28, 2008

Posted by chris in : software , add a comment

Is sweet http://www.ajaxim.com

my zune just crashed March 28, 2008

Posted by chris in : rant , add a comment

I didn’t think it was possible for an mp3 player to crash and all the ones I’ve owned in the past never had, but my 30 GB zune just crashed. Leave it to microsoft. The zune was a great deal, 30 GB music storage device at $100. But beyond that its pretty horrible. The software microsoft gives you is the only way to add music, and the software is clunky. The only way around this is literally a hack by modifying a registry key. But who knows what kind of can of worms that opens up. My friends with IPODS make fun of me too, snooty apple zealot bastards.

Anyways I just thought it was funny. Except it was on random and I was digging every single song it was kicking, it was on Deftones when it crashed – maybe the Deftones are to hardcore for the Zune.

Zune

apc (alternative php cache) on debian etch March 26, 2008

Posted by chris in : linux, php , add a comment

This is one of the best packages you can incorporate into your web development. Basically APC allows you to cache data in memory for extremely fast data access. We are exploring writing an application at work the must have extremely fast access to data, so fast that we are willing to dedicate a server with lots of RAM to this application. Are other alternative is to store the data on XML files with small yet very fast disks that spin at high RPMs, with lots of onboard disk cache, most likely a SAS or SCSI disk. This would allow for fairly quick access as the disks would spin fast and be small so seek time etc…

Honestly both servers would come out to within a few hundred dollars of each other. So the memory-based solution utilizing APC in PHP is probably the best. So tonight I installed APC on my home server, a dual core xeon 2.6 Ghz server with 3 GB of RAM, and 4 SCSI disks in RAID 5, with the OS stored on 2 18 GB disks in a mirror. Yes I am a fucking geek. Would’ve like to have done this on my beta server (geek again), but it only has 1 GB of memory and I intend on storing that much data in memory :)

So here is my experience and how to with APC

(more…)

Javascript 2.0 March 22, 2008

Posted by chris in : ajax/dom/javascript , add a comment

This was posted to slashdot. I’d personally like to see Javascript get closer to C style languages as thats what I am most familiar with , the part that scares me though is backwards compatibility with ancient browsers. JavaScript is already a nightmare with browser compatibility.

http://blog.jeremymartin.name/2008/03/web-20-meet-javascript-20.html

making your email not show up in spam folders March 15, 2008

Posted by chris in : other , add a comment

I operate a website http://www.mp3crib.com that requires users to validate accounts. Unfortunately my email server was looked upon as a spam server. Though not blacklisted providers such as AOL and MSN/Hotmail were sending my emails directly to users spam folders. Luckily there are steps you can take to prevent this:

(more…)

passing objects from javascript to php with json March 13, 2008

Posted by chris in : ajax/dom/javascript, php , add a comment

In this article I gave a brief intro to using JSON to pass JavaScript arrays to PHP via Ajax. I’ve done a bit more with json since then and with the help of a co-worker discovered how to get javascript objects working together with php utilizing json.

Passing Multiple JavaScript objects to PHP

JavaScript class:

function product(id,name,price)
{
	this.id=id;
	this.name=name;
	this.price=price;
}

Above we just create a simple javascript class that we will call below.

Putting JavaScript objects into JavaScript array:

var object = new product('222','spectacular fizz','3.59')
var productsArr[productsArr.length] = object;

We can now add as many of the these objects as we would like to the products array. So lets say we have an array that looks like this below…

productsArr[0] = object...
productsArr[1] = object...
productsArr[2] = object...

…and we want to pass it over to PHP. So we use the following code to turn it into a JSON string.

var productsJSON = JSON.stringify(productsArr);

Now we need to do an AJAX Post and on the PHP side we decode the JSON string (note you only need to stripcslashes if magic quotes its turned on):

$productsArr = $this->json->decode(stripcslashes($productsJSON));

Now we can reference these objects multiple ways. One if we are just continuously looping through we can use a foreach:

foreach($productsArr  as $product)
{
	echo $product->id;
	echo $product->name;
	echo $product->price;
}

Or of course we can reference the object directly by its index in the array.

echo $productsArr[1]->name;

Pretty cool huh.

slimbox March 8, 2008

Posted by chris in : ajax/dom/javascript , add a comment

Pretty slick way for making a thumbnail viewer. This works in the following browsers: Safari (windows), FireFox 2 (windows), Internet Explorer 7, Internet Explorer 6, and Internet Explorer 5.5.

http://www.digitalia.be/software/slimbox

multiple ie March 1, 2008

Posted by chris in : rant , add a comment

Now there’s more of the browser you can’t stand!

http://tredosoft.com/Multiple_IE

But seriously this is great for testing your website in multiple versions of IE, it goes from 7 all the way down to 3!