Sep 3 2008

For best viewing, use chrome

As you should know, Chrome was released last night at 12 am GMT. It was announced 2 days ago much to the surprise of most (though there were rumours, there was no actual proof of its existence). Many people have now taken the plunge, downloaded it, and tried it out.

My experiences have been almost completely without problem. There was a small problem on grooveshark.com where I could not use the spacebar in flash, but that could have been flash acting up instead of Chrome. I just tried it out again, I think it is Chrome, good thing there is a bug report link built in so I don’t forget to report it this time. ;)

Oh ya, and for websites that use a lot of javascript, there currently is nothing faster (could be because you [I] have extensions for firefox running, which need to be processed as the pages load). Oh… and the Wordpress backend is wicked fast now (thanks to Chromes speed and the new “Turbo” feature that uses google gears incorporated into Wordpress’ backend).

Sorry Gavin and co, it is only available for Windows for now :P


Jul 8 2008

Spartan Coding

I thought it would probably be rude to post this on Coding Horror, as it is rediculously long… but here is my attempt at Spartan coding.

So, the first function… changes a users information in the database:

	function update_User($user,$id) {
 
 
		if (isset($user['deleteprofile']))
		{
			//array(3, 'live', 'Rick'
			$this->db->where('user_id', $id);
			$this->db->delete('users');
 
			$this->db->where('id', $id);
			$this->db->delete('ez_users');
 
			$this->db->where('user_id', $id);
			$this->db->delete('ez_auth');
 
			$this->db->where('user_id', $id);
			$this->db->delete('ez_access_keys');
 
			$this->db->where('user_id', $id);
			$this->db->delete('faves');
 
 
			return true;
		}
 
 
		$user['first_name']= isset ($user['first_name'])? $user['first_name']: "";
		$user['last_name']= isset ($user['last_name'])? $user['last_name']: "";
		$user['academic_status']= isset ($user['academic_status'])? $user['academic_status']: "";
		$user['college']= isset ($user['college'])? $user['college']: "";
		$user['department']= isset ($user['department'])? $user['department']: "";
 
		$data = array(
               'first_name' => $user['first_name'],
               'last_name' => $user['last_name'],
                'academic_status' => $user['academic_status'],
               'college' => $user['college'],
				'department' => $user['department'],
		 		'user_id' => $id
            );
 
		$this->db->where('user_id', $id);
 
		if (!$this->db->update('users', $data)) {
			return false;
		}
 
 
		if (!isset($user['access']))
			return true;
 
		$data = array(
               'access' => $user['access'],
				'user_id' => $id
            );
	//	print_r($data);
		$this->db->where('user_id', $id);
 
		if (!$this->db->update('ez_access_keys', $data)) {
 
			//incorrect parameters. maybe one of your form field names is different from the database fields
			//in the 'users' table?
			//common mistake: using a name for the submit button. don't do that!
			//also: you have to have a hidden field in the form called $user_id with
			//the value of the ID of the user you are playing with.
			return false;
		}
 
		return true;
	}

It became this:

function updateProfile($data, $id){
		$this->db->where('user_id', $id);
		if(!$this->db->update('users', $data)){
			return false;
		}
		return true;
	}

This is possible because arrays can be passed to the function. All of the functionality that was needed in the function is still there, it is perfectly readable, and it does the same tests… I guess it could become this:

function updateProfile($data, $id){
		$this->db->where('user_id', $id);
		if($this->db->update('users', $data)){
			return true;
		}
		return false;
	}

Which is probably better as it will return false automagically if there is a problem…. in fact, I think I will be changing it to that. Yes it does hide a lot of the functionality, but… it allows the functionality to be huge… I can edit the whole table or just one column with this function, unlike the other function where the author apparently wanted to create a function for each of the options that were needed…. sigh… The unfortunate thing is that I have not been able to get rid of this code completely yet because I have not yet looked to find out where else it is used… And yes, I know it would be more complex if it were not for the fact that I was using the code igniter framework, but… not as complex as the one that preceeded it.

Wow, the code for the syntax highlighter needs to be fixed…

<pre lang="php">

works, but

<pre lang = "php">

does not…


Jul 7 2008

Komodo Edit on Ubuntu (Linux)

I use Komodo Edit all the time on Windows (XP and Vista) but up till now I have not used it in any Linux environment. I decided it was time to take the plunge and try things out. First I had to download the tar file from the activestate website (here), that was easy, the one thing that I was wary about was this:

AS package (libcpp6)

I had never heard of that, but as it turns out it is an [A]ctive [S]tate package. So, not a problem. When I got it there was an install .html. It had all of the instructions for all of the operating systems. As it turns out that was a bit overkill considering this was the Linux version not a Windows one or a mac one…

The only thing that I needed from the help file was the information that you had to install these packages (I use apt-get to do it, you might use something else):


scim scim-gtk2-immodule scim-qtimm scim-tables-additional

You might also need to install these ones if they are not already in your Linux of choice:

glibc libjpeg libstdc++

You will also need to have perl installed.

Finally once those packages are all installed you can run the install file

./install.sh

And then once that is done (you get to chose the path that it installs to (I left it as default because I am the only user of this machine), add komodo to your path by entering:

export PATH="/home/[username]/Komodo-Edit-4/bin:$PATH”

in the terminal (well, that is the quick way, you would probably have to type that in every time you wanted to use it… a better way is to add that line to the end of your ~/.bashrc file).

You could also create a symbolic link to it:

ln -s "/home/username/Komodo-Edit-4/bin/komodo" /usr/local/bin/komodo

Finally, you can just type in komodo to run it, or create a link in your menu (or on the desktop) to run it.

Once I get some money, I will probably be buying the full version (Komodo IDE) which has more features in it. Until then, I am more than happy with Komodo Edit 4.

If you have any problems installing it, please refer to the install file that they include as I have skipped some of the stuff that did not have any relevance to me.


Apr 2 2008

Fried? Apparently only a little bit…

Why am I up so late? I fried my computer. Not with software, but rather, I electrocuted it and seem to have lost all of the data that was on it. I cannot mount the file system with a live cd. That sucks, but what sucks more is that it wont even boot on a fresh install. I think the hard drive is toast… I wonder if Windows will boot… Hopefully it will and I will not have lost all of the data (I am mostly worried about my homework) that was on my computer…

Ok, weird, I just forced it to boot (to see what would happen) and it booted up just fine… even with the short read errors. It wouldn’t do that before the fresh install. Strangeness. Now I have to set it up the way that I want it again, but at least it is working (for the moment). I wonder what else got corrupted when I zapped it?

Edit

Apparently this has had no effect on the Windows XP install that is located on a different partition (but not a different drive). Weird.


Jul 19 2007

Update your software!

Since Linux is so good at checking to see whether or not something is out of date, you would think that there would be a program for Windows that does the same… None that I know of, but there is a website that will do a quick scan of the software you have and then it will tell you whether or not it is out of date and it will also tell you how to update the programs that are out of date.

Apple have released V7.2 of QuickTime that patches eight serious flaws in the product the worst of which could allow your computer to compromised simply by watching a specially crafted QuickTime movie. If you QuickTime version number is less than 7.2 then please update now. Adobe has also released a patch for its highly popular Macromedia Flash plug-in. This fixes flaws in Flash that, like the QuickTime flaw, could allow your computer to be compromised simply by watching a malicious Flash movie. According to the Adobe bulletin the flaw affects “9.0.45.0 and earlier, 8.0.34.0 and earlier, and 7.0.69.0 and earlier.” These flaws are serious folks; update immediately.

http://secunia.com/software_inspector/?task=load