Time Until Wedding
Days
Hours
Minutes
Seconds
 
Navigation
 
Search
 
My Usable Projects
 
Reading...
 
Listening...
 
Random Image
Reception (25)
 
Archives
 
Me. Elsewhere.
 
Feeds and Such

Google Reader or Homepage
Add to My Yahoo!
Add to Technorati Favorites!
Bookmark del.icio.us
Bookmark Furl
Bookmark Spurl
 
Darcy
 
Things I Like
Sidux Linux
 
License
 
Javascript Countdown Timer

I wrote a little countdown timer for my wedding while waiting for stuff to compile today. It uses PHP to get itself initialized, and should be accurate as long as the server has the correct date set. Below is the basic guts of the script. You would call refreshClock() onload.

<?php
  $now = time();
  $wedding = strtotime('August 23, 2008 4:00 pm');
  print 'end = '.$wedding.";\n// Used to fix lag, if any.\n";
  print 'now_p = '.$now.";\n";
?>
now_j = new Date();
diff = Math.ceil(now_j.valueOf()/1000) - now_p;
function refreshClock () {
  now_r = new Date();
  seconds = end - Math.ceil(now_r.valueOf()/1000) + diff;
  document.getElementById('days').innerHTML = Math.floor(seconds/60/60/|>24);
  document.getElementById('hours').innerHTML = Math.floor((seconds/60/|>60)%24);
  document.getElementById('minutes').innerHTML = Math.floor((seconds/60)%60);
  document.getElementById('seconds').innerHTML = seconds%60;
  setTimeout("refreshClock()",1000);
}

Posted May 20th, 2008 - Permalink
Categories: JavaScript - PHP - Programming - Snippets
No Comments »
 
VCReviews - A MediaWiki Extension

Recently I worked on a review extension for the Omaha Wiki. They wanted to give users of the wiki the ability to write reviews for pages, while still keeping control of the content and separating the factual information from the opinions.

Initially I just worked on adapting the Rating extension by Sanford Poon, but it was getting hard to deal with and make all the changes that were needed, so I started over.

The end result is VCReviews which combines the rating and review process into one submission, and is only accessible by logged in users. You can check it out at the Omaha Wiki. Just pick an article and click on a “reviews” tab.

Source is available: VCReviews Version 0.2.2

Posted November 4th, 2007 - Permalink
Categories: PHP - Programming - Projects - VCReviews
No Comments »
 
BlowPass Alpha Release

I released an alpha of the latest version of BlowPass today. It’s almost a full rewrite, the structure is that different. Anyway, you can get more information on the BlowPass dev blog.

Posted July 7th, 2007 - Permalink
Categories: BlowPass - JavaScript - Open Source - PHP - Programming - Projects
No Comments »
 
Disappointed In SimpleXML

So I’m a little disappointed in PHP5’s SimpleXML object. Don’t get me wrong, it works great for accessing XML, but it’s terrible for deep manipulation. The biggest problem is that you can’t append SimpleXMLElement objects to each other.

For instance, I was working on a little project tracker that would use all XML for storage. Here is the var_dump of my XML file.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
object(SimpleXMLElement)#1 (1) {
  ["project"]=>
  array(3) {
    [0]=>
    object(SimpleXMLElement)#4 (5) {
      ["idstring"]=>
      string(10) "1180050874"
      ["name"]=>
      string(22) "Example Project Bottom"
      ["created"]=>
      string(19) "2007-05-24 17:57:29"
      ["modified"]=>
      string(19) "2007-05-24 17:59:44"
      ["contact"]=>
      array(2) {
        [0]=>
        object(SimpleXMLElement)#5 (3) {
          ["name"]=>
          string(10) "John Hobbs"
          ["title"]=>
          string(12) "Project Lead"
          ["email"]=>
          string(20) "j0hn@velvetcache.org"
        }
        [1]=>
        object(SimpleXMLElement)#6 (3) {
          ["name"]=>
          string(9) "Mom Hobbs"
          ["title"]=>
          string(3) "Mom"
          ["email"]=>
          string(19) "mom@velvetcache.org"
        }
      }
    }
    [1]=>
    object(SimpleXMLElement)#3 (5) {
      ["idstring"]=>
      string(10) "1180050874"
      ["name"]=>
      string(19) "Example Project Top"
      ["created"]=>
      string(19) "2007-05-24 17:57:29"
      ["modified"]=>
      string(19) "2007-05-24 18:57:44"
      ["contact"]=>
      array(2) {
        [0]=>
        object(SimpleXMLElement)#7 (3) {
          ["name"]=>
          string(10) "John Hobbs"
          ["title"]=>
          string(12) "Project Lead"
          ["email"]=>
          string(20) "j0hn@velvetcache.org"
        }
        [1]=>
        object(SimpleXMLElement)#8 (3) {
          ["name"]=>
          string(9) "Mom Hobbs"
          ["title"]=>
          string(3) "Mom"
          ["email"]=>
          string(19) "mom@velvetcache.org"
        }
      }
    }
    [2]=>
    object(SimpleXMLElement)#2 (5) {
      ["idstring"]=>
      string(10) "1180050892"
      ["name"]=>
      string(22) "Example Project Middle"
      ["created"]=>
      string(19) "2007-05-24 18:45:06"
      ["modified"]=>
      string(19) "2007-05-24 18:45:06"
      ["contact"]=>
      object(SimpleXMLElement)#9 (3) {
        ["name"]=>
        string(10) "John Hobbs"
        ["title"]=>
        string(12) "Project Lead"
        ["email"]=>
        string(20) "j0hn@velvetcache.org"
      }
    }
  }
}

Long, I know. The point is that even though the structure looks pretty normal, you can’t do this, in this case in a sort function:

1
2
3
$temp = $projects->project[0];
$projects->project[0] = $projects->project[2];
$projects->project[2] = $temp;

You get the error message:

Warning:  sortProjects() [function.sortProjects]: It is not yet possible to assign complex types to properties in /var/www/timetracker/index.php on line 63
Warning:  sortProjects() [function.sortProjects]: It is not possible to assign complex types to nodes in /var/www/timetracker/index.php on line 63

That, my friends, is a bummer. You can’t assign sub-elements into the tree. Bummer. Now I have to switch back to my normal MySQL.

Posted May 24th, 2007 - Permalink
Categories: PHP - Programming - Projects
No Comments »
 
OurUNO is Our Reviews

Well, tonight I finally got around to working on OurUNO. I decided a long time ago to convert it to a framework around which anyone can build up a college review site. I started cutting up the code around 9:00 and it’s now 3:45 of the next day. Ouch.

I naturally decided to use Smarty to template this guy, and then I decided that there was going to be a definite need for good docs. I chose NaturalDocs and it’s pretty good. It’s got 0 learning curve for the basic functionality, and outputs pretty docs.

I got most of the system documented tonight, and converted about, contact, index, and viewReviews to Smarty. There are still some problems with NaturalDocs I have to figure out (like how to group files together) and lots of files to template of course.

I think I can have a package together within a month. I’ll hook up to sourceforge soon, maybe snag a domain. It’s actually been a lot easier than I thought it would be so far. Smarty is pretty kickin, as is NaturalDocs. The latter could, ironically, use better documentation.

Posted May 1st, 2007 - Permalink
Categories: Open Source - OurUNO - PHP - Programming - Projects
No Comments »
 
More Posts
« Older
Newer »