If you haven't been watching it, I highly recommend the Stargate Universe series on the SyFy channel.
The basic premise is, a small band of military folks and civilians get stranded half way across the Universe. But instead of having a group of highly trained elite space travelers, most of the people are just thrown together. Only a few have any kind of training for the situation.
The show is a lot more gritty than a lot of scifi in recent years. Definitely worth checking out.
Apr 30, 2010
Apr 28, 2010
Paging Data with CodeIgniter
I was looking into how one would page table data using CodeIgniter. So I didn't find one answer, but found a PHP answer and the CodeIgniter documentation to answer my own question.The PHP technique is to add a LIMIT statement to your SQL request. So if you have a table size and a location, you can page through the data easily. The php-mysql-tutorial.com has the details here. Marry this to the CodeIgniter active record documentation, and that should be all I need.
Apr 23, 2010
How to Copy a Object in Java

What is an easy way to copy a Java object? This example over at StackOverflow shows how to copy an object with a copy constructor or or a copy factory. Both approaches essentially use the new operator and the object's properties to make the copy. Simple yet effective.
Apr 21, 2010
HTML5 Features You Should use Right Now
The folks at NetTuts created a video on HTML5 features you can use right now. I would like to focus on 4 of them.
HTML DocType
Instead of including a long link to a DTD in each of your HTML documents, you can simple replace it with:
Character Set
You can define a character set much more simply.
No More Type Attributes
You are no longer required to add type attributes to the <style> or <script> tags. For example:
or
I plan to test this a bit myself, but according to the author, Google is already using the DocType setting.
HTML DocType
Instead of including a long link to a DTD in each of your HTML documents, you can simple replace it with:
<!DOCTYPE html>
Character Set
You can define a character set much more simply.
<meta charset="utf-8"/>
No More Type Attributes
You are no longer required to add type attributes to the <style> or <script> tags. For example:
<script> // your code here </script>
or
<style>
p{ margin:0; }
</style>
I plan to test this a bit myself, but according to the author, Google is already using the DocType setting.
Apr 19, 2010
Turning a Blogger Blog into a Website
Another quick note. The dudes at Magic with Blogs have created a site with a number of Blogger video tutorials. If you look down at the bottom of their home page, you will notice a section on how to convert of a Blogger blog into a web site. The post on making your home page static is key. This is an idea that will be useful for a lot of people. A quick way to setup a Website site using the best site/blog creation software on the net. Expect a few posts from me on the subject. :)
Changing Your Blogger Account and Housekeeping
Over the weekend, I did a little housekeeping on this site. I discovered that you can actually change the Google account you use to host your blog. I have done that so I will be updating the about pages and stuff with the new information. Now my twitter and buzz accounts should have a little be more consistent branding. In addition, my about and contact information will be moving to my blogger account using the new static pages feature of Blogger.
Update: Note that once you do this, you have to go to Settings -> Basic and change to the new editor if you were using that on the old blog. The same goes for any other updated features I assume.
Update: Note that once you do this, you have to go to Settings -> Basic and change to the new editor if you were using that on the old blog. The same goes for any other updated features I assume.
Apr 15, 2010
Media Wiki on a Stick
Want to run Media Wiki on your local machine? Well the basic steps are described here. You basically have to download and install the MoWeS Portable server along with Media Wiki. You run the installer on your usb drive. Boom, you have MediaWiki on a USB Drive.
As a caveat, this sort of thing is not for the feint of heart. :) A basic understanding of the Apache web server is required.
As a caveat, this sort of thing is not for the feint of heart. :) A basic understanding of the Apache web server is required.
Apr 14, 2010
Wanna Learn Chinese?
Wanna learn Chinese? Get started learning Chinese with Peggy Lee's You Tube channel. She also does private Chinese tutoring via skype.
What a great idea for a business!
What a great idea for a business!
Apr 11, 2010
Steve Jobs goes Crazy and the Net Freaks Out!
While many people were watching the return of Tiger Woods and Phil Mickelson's awesome win at the Masters, the Internets were freaking out about Apple's new license agreement for iPhone development.The story was originally broken by Daring Fireball here. And has been commented on and expanded at the following sites. All three posts are awesome and I recommend you read each.
- Has Steve Jobs Gone Mad - Why Does Everything Suck Blog
- Why Apple Did it - Daring Fireball
- Steve Jobs Responds to Adobe - Mashable
Adobe has been developing a tool to allow Flash developers to compile Flash applications for the iPhone OS. Thus, Flash developers could completely bypass Apple tools or compilers to create their apps. By changing the license agreement, Apple has made this Adobe tool illegal on the iPhone platform. It also limits development to Objective C, C, C++, and HTML/Javascript on Webkit. So any cross platform compiler written in Ruby, or .Net would also be illegal. So as you might imagine, this has angered developers who were planning to use these 3rd party tools.
In my mind Apple has a point. They are trying to provide a simple, stable device with consistent interfaces. Nontechie's do not care if the platform is open or closed. Regular folks don't care about multitasking. They just want their phone to work all the time. PCs crash, phones don't. By tightly controlling design and development, Apple can meet their stability and design goals.
Google Android provides the open alternative to Apple's approach. Right now it is messier and probably not as good. But it is open, and that allows developers to iterate and improve. Over time, it seems possible that it will match or surpass its closed adversary.
Developers, customers, and the market will determine which approach is best. It is going to be an interesting fight.
In my mind Apple has a point. They are trying to provide a simple, stable device with consistent interfaces. Nontechie's do not care if the platform is open or closed. Regular folks don't care about multitasking. They just want their phone to work all the time. PCs crash, phones don't. By tightly controlling design and development, Apple can meet their stability and design goals.
Google Android provides the open alternative to Apple's approach. Right now it is messier and probably not as good. But it is open, and that allows developers to iterate and improve. Over time, it seems possible that it will match or surpass its closed adversary.
Developers, customers, and the market will determine which approach is best. It is going to be an interesting fight.
Apr 8, 2010
CSS: Center an Image with CSS
I have created a short write up on how to center an image using CSS. Two methods are covered, using a div and defining rules for the img tag directly. Enjoy!
Apr 7, 2010
CodeIgniter Unit Testing
CodeIgniter includes a unit test library as part of the framework. Documentation is included with the standard docs. If you follow the instructions, you can set it up and use it quite easily. However, the default output format leaves a little bit to be desired. Each test generates a separate table. This quickly becomes unwieldy and not very useful as the more tests added create longer and longer pages.To solve the problem modified the template a little so once a table is produced with a row for each test. Here is my code.
1: <h2>Unit Test Page</h2>
2: <p>This is the test page for the application.</p>
3:<?php
4:$str = '
5: <tr>
6: {rows}
7: <td style="border:1pt solid black;">{result}</td>
8: {/rows}
9: </tr>';
10:
11:$this->unit->set_template($str);
12:
13:// Sample Test 1
14:$test = 1 + 1;
15:$expected_result = 2;
16:$test_name = 'Adds one plus one';
17:$this->unit->run($test, $expected_result, $test_name);
18:
19:
20:?>
21:<table cellpadding="4" cellspacing="1" style="border:1pt solid black; font-size:9pt; width:625px">
22: <tr><th width="35%">Test Name</th><th>In Type</th><th>Test Type</th><th width="15%">Result</th><th width="0%">Path</th><th>No</th></tr>
23:<?php
24:// Create Report
25:echo $this->unit->report();
26:?>
27:</table>
28:
29:</body>
30:</html>
My template is defined on lines 4-9. Basically, we only want to output a row for each test. So lines 20-27 defines the table that contains the rows. This produces much more compressed output.
Apr 6, 2010
Hands on iPad
Well I finally got my hands on an iPad. It looks to be a very nice device for surfing. Plus I checked out some of the applications like the constellation app which is very cool.I didn't care for the screen much. It has a very glossy finish and in the store it was hard to ignore all the glare. So that said, I think I'm gonna wait. I want to see some of the Google tablets before I make any decision.
The tablets are here to stay methinks. Now let the tablet wars begin!
Apr 3, 2010
iPad finally Released!

After much hoopla, the Apple iPad was released today. Since I'm visiting my parents in Alamosa, I'm nowhere near any Apple store. I can't find any coverage online and such, but I did find this story from the Chicago Tribune with techies commenting on the impact of the new device.
The conversation seems to be clustering around the Apple closed store and single tasking OS versus Google Android and its open store and multitasking operating system. I tend to side with the open tribe. In the long run, more open systems and software win out. Is this the PC versus Mac battle all over again? But this time, it is smart phones and tablets. With a new iPhone coming out this summer and dozens of Android devices on the way, it is going to be an interesting next couple of years.
Apr 2, 2010
New Blogger Template Designer
The Google Blogger site is testing a new blog designer tool. I just noticed the announcement is a little old, but its new to me. So what's new about this design tool?First a bunch of new templates for your blog. Very cool looking templates. In addition, the new template designer gives nondevelopers a lot more control over their templates. The main caveat? The new designs will not work on IE 6. But that is not really a big deal, because it is time to move beyond IE 6.
Subscribe to:
Posts (Atom)