Projects


January 9, 2006: 3:18 pm: LokkjuProjects

BAStats is a statics package for tracking visitors to Wordpress enabled sites. Though in beta stage, it works great in both WP 1.5 and 2.0, however it has a flaw in being able to store ip addresses where the initial quad is greater then 127. There have been a few ideas for fixes posted in the comments of the BAStats blog announcement, but not none of them seem to be effective.

After looking into the code for a while, I think I found the problem, and a simple fix. The stats package is attempting to write a signed integer value into an unsigned bigint database field (mysql only supports unsigned bigints perhaps?). The simple solution is to wrap all calls to the php function ip2long() in a sprintf function, converting the signed int into an unsigned one before writing it to the database.

Here is a unified diff patch for fixing this bug:

BAStats patch for fixing the 255.255.255.255 Bug

January 5, 2006: 10:11 pm: LokkjuProjects, Google Maps, Javascript

About 6 months ago, when the Google Maps API first came out, I did some major work with it, both in providing functions to make it run better, and in extending it. Based on the idea by David Schuetz’s TerraServer functionality for the old style of Google Maps hacking, I wrote a simple library to enable TerraServer maps through the Google Maps API (you can still get it here). I released it through the newsgroups, and then prompty forgot about it.

Well, today I was looking into some more Google Maps stuff (I use it on and off in many of my projects), and I found that there are quite a few sites out there using my library. Needless to say, I was pleasantly suprised. The two best are below:

AccuTracking - http://www.accutracking.com/
Weather Quality Reporter - http://weather.gladstonefamily.net/site/C0506

: 2:18 pm: LokkjuProjects, Javascript

Demo:

Filter:

States
Alabama
Alaska
Arizona
Arkansas
California
Colorado
Connecticut
Delaware
Florida
Georgia
Hawaii
Idaho
Illinois
Indiana
Iowa
Kansas
Kentucky
Louisiana
Maine
Maryland
Massachusetts
Michigan
Minnesota
Mississippi
Missouri
Montana
Nebraska
Nevada
New Hampshire
New Jersey
New Mexico
New York
North Carolina
North Dakota
Ohio
Oklahoma
Oregon
Pennsylvania
Rhode Island
South Carolina
South Dakota
Tennessee
Texas
Utah
Vermont
Virginia
Washington
West Virginia
Wisconsin
Wyoming

So I was working on my DNS Editor back end last night, while using iTunes - and I decided I want the same type of filtered list that iTunes has. About 4 hours later, I came up with this, so here it is. It really only takes two lines of code, and one class statement, to add:

HTML:
  1. <script charset="utf-8" language="javascript" type="text/javascript" />
  2. <input type="text" maxlength="10" size="8" id="filterable_filter" name="filterable_filter" />

then, in your table, just make sure your class name includes "filterable". The input box ID must be the table id plus "_filter". In addition, if you want to make a row that never gets filtered, you can include "nofilter" in the td's class name.

If you want to get the library right now, you cen grab it here. You will find the code for the demo down further.

Right now, I am filtering on the inputbox value being anywhere in each cell's text - however, since I am using a regex, it would be very easy to modify to only match at the start of the string, etc. Here within the next few weeks, I hope to mature this library to the point of have some way of specifying (perhaps based on the class) what type of match you want, as well as specifying which columns in the table you want to match against.

Thanks go to Stuart Langridge, over at Kryogenix, for ideas on handling tables unobtrusively, in his sorttable library (here). In fact, I wrote this library to be compatible with his - so you can have sortable tables, that are also filterable.

Sample code after the break

(more...)

December 27, 2005: 11:25 pm: lokkjuProjects

Well, I have had a few requests for descriptions and sample files for some of my current projects, so I will go ahead and start uploading/posting the projects I am working on. Feedback is always welcome, of course.

« Previous Page

Make payments with PayPal - it's fast, free and secure!