precarious, 2006, cats, balanced

[info]kaolinfire


kaolin fire

a day in the life; and another; and another


Just a slice of niftiness - diff
manic, excited
[info]kaolinfire
I've found myself wanting a quick "diff" engine available somewhere online. So I found a quick diff script that's 100% PHP (GPL'd) and slapped it on diff.new.alethe.net. :) Helped me debug the minute differences between two dynamically generated pages to see why one "worked" and the other didn't (stylesheet issues except they used the same stylesheet, header, footer, ... but different by a couple of variables)

research tags/tagging methodologies
precarious, 2006, cats, balanced
[info]kaolinfire
http://www.pui.ch/phred/

And more: http://tagschema.com/blogs/tagschema/

OOh -- something that's been bugging me for a long time! (http://www.pui.ch/phred/archives/2006/02/delicious-vs-rawsugar-vs-simpy.html )

Feature in RawSugar -- "They have got /hierarchic tags/, and this is a very clever idea. First I wasn’t totally convinced about this feature but it has itself proved to be very helpful. I don’t like del.icio.us’ tag bundles. Tag bundles may be a good thing if you have 100 to 200 tags, but if you have 500 or 1000 tags (I currently have over 2000), it isn’t manageable any more. With RawSugar you can put a hierarchy in your tags while tagging an item. if you type “article>rant” you say that “rant” is a child tag to “article”. If you later tag a site with “rant”, the tag “article” will automatically be added."

A nice rant on what tags are good for, and what it's assumed they're good for, and such -- http://www.pui.ch/phred/archives/2005/11/how-tagging-could-gain-ground.html

broad versus narrow folksonomies: http://www.personalinfocloud.com/2005/02/explaining_and_.html (I thought I'd understood this until I went through the examples, which I didn't really follow; although then, from the comments, maybe I did..)

reviews of a lot of bookmark-tagging sites: http://3spots.blogspot.com/2006/01/all-social-that-can-bookmark.html

and wow, thorough matrix of them linked from here: http://www.roxomatic.de/archives/985/Social-bookmarks-review-version-3.5

and after all of that, http://www.pui.ch/phred/archives/2005/07/analyzing-tag-connections.html is really good (and yeah, I know more than half of these are articles from the first site I posted, but I figure this lessens the energy of activation for looking at them)

http://www.dlib.org/dlib/january06/guy/01guy.html

and

http://www.plasticbag.org/archives/2005/06/two_cultures_of_fauxonomies_collide.shtml

Okay, I'm done with tagging links for a bit.

Last thing, for now, is to investigate the worth of using FreeTag -- http://www.getluky.net/freetag/

Writersplanner
precarious, 2006, cats, balanced
[info]kaolinfire
Writersplanner now has a 'quickfind' searchbox that is AJAX enabled. Whee! Of course, it works like a normal thing if javascript is not enabled, and none (or almost none) of the javascript is on the page (I should move the last bit off... it's at the bottom of the page, and really doesn't need to be, I believe) It has it when you're logged in, at least. No point in confusing folks with a search bar when they're just figuring out what the system is.

Noticed that the Firefox Firebug debugging console extension thingy has a 'ShowHttpXmlRequests' option. So freaking awesome!

writer's planner has timezones
precarious, 2006, cats, balanced
[info]kaolinfire
Not that they do any real good for anything at the moment, but since I decided timezones were a blocking issue for "alerts", they got done. This is a bit bass-ackwards, but I eventually started with http://laughingmeme.org/articles/2003/09/25/timezone-selector

That's a bit of perl code that dumps the data from DateTime, DateTime::TimeZone, and/or DateTime::Locale -- into a nice little javascript selector box. I wanted to avoid the javascript so I hacked it to dump the regions/cities into a little php hash of arrays. Now I can play with it at my leisure, but for now it's a single select box with all the combinations. A bit long, but functional. Ideally, I'll add some behaviour tags to make it split the single select into a nifty combo select when javascript is available. Really, really not necessary though.

The DateTime perl module(s) use the near-canonical Olson Database. Of course, using that whole crazy database just to get

This is my timehack. I know my server's Eastern, so that's the way all the data's gone into mysql, and that's how the data comes out. I don't want to go and change the data unless I absolutely have to, so...
well, it's kind of sad, but it appears to work. :)

  function altertz($datetime,$timezone) {
    if (empty($datetime)) return $datetime;
    //we have something that is a datetime "assumed" to be correct,
    //most likely coming from mysql, and we need to nudge it around.
    //ICK!

    //first, we set timezone to the 'real' timezone the data was created
    //in.  for writersplanner, that's "eastern"
    $oldtz = getenv("TZ");
    putenv("TZ=US/Eastern");

    //then, turn our time into a unix stamp
    $time = strtotime($datetime);

    if (!$timezone) { $timezone = "GMT"; }

    putenv("TZ=".$timezone);
    $retval= date("Y-m-d H:i:s T",$time);

    putenv("TZ=".$oldtz);
    return $retval;
  }


Of course, with all this, the only thing that's changed at the moment is ... display of account creation/validation/last login datetimes. But that's proof of concept, right? ;)

@^#(@*&(@#*&(@*&#(@*&(*
skeptical, wtf, puzzle, question
[info]kaolinfire
A warning with IE, sessions, and domain names with an underscore (and possibly other special characters?)

IE does not seem to be able to keep a session when your domain has an _ in it.

test it if you want to see:

session_start();
echo session_id();
die();

foozle.blah.bar.org will set the session and stick with it.

foozle.blah_two.bar.org will give you a new id every time.

WHOO. SO much to do.
precarious, 2006, cats, balanced
[info]kaolinfire
So much to do, but I'm feeling minorly accomplished, which at the moment is a fairly wonderful thing. I fixed two things that have been bugging me for half a year or longer, and have high hopes that I can fix one more thing in the set.

My CPU fan had been making loud and obnoxious noises for a long time--it'd run smoothly (but loudly--it was the default AMD brushless fan--crap, but certainly good enough for my piddly 600MHz Duron), and then it would just start grinding. Not going visibly slower, but man, it sucked. Distracting, to say the least. Fooling around with that, long ago, I determined also that the secondary CPU fan (not really sure what is or what it's on top of--smaller thing, has its own housing on the mobo, but the housing doesn't seem conductive) wasn't even spinning.

So when I needed to power down my system to upgrade my AV, I decided to unscrew the (dying) fan and put a different one on (I have a box of standard and semi-standard cpu fans). Popping it off, I was amazed my computer hadn't died the good death years ago--the blades of the heatsink were almost entirely encrusted with dust. The fan's blades themselves were, as well, especially the undersides which hadn't been visible. TRUSTY VACUUM TO THE RESCUE! I vacuumed the #(*$#( out of my computer. Man oh man, it's looking kind of shiny. ;) Then I washed the chincy fan, and filtered through my box for something quieter. I tried a few, and picked a ball bearing one from... I forget who. Ice Cool, maybe?

So much quieter! And it looks like it's moving a lot more air, too. Then I pop off the mini-cooler, which has long seemed rusted cold. Spin, spin, spin, it don't like to spin. WD-40 to the rescue, and recue it did. The thing spins beautifully, now. Cleaned it up, put it back on, and whirrrrrr quiet as a bird (compared to the quieter-than-previous cpu-fan). Woot. :)

The fan on the graphics card isn't spinning, either, but I'll see about dealing with that _next_ powerdown. I have high hopes. =)

I haven't been feeling very accomplished of late, and part of that is now that I'm home the enormity of all the tasks I have in front of me is becoming more apparent. Working from home is not a panacea, and I knew that. But maybe I didn't know it quite as well emotionally--I'm slowly making a lot of progress on things that have needed to be done for half a year to a year, but none of the "glory" items that I spent so much time thinking about when I was working the dayjob. My writing has not increased. My drawing hasn't really increased. My videogames are still all at a standstill. I _am_ sleeping more, and I'm spending more time with Amy (both good things--she's rediscovered the joy of Star Craft, even!), but it's still frustrating, day to day, that I haven't done more.

And don't get me wrong. I'm still working in the day--my work is just more scattered about. It involves talking to people on the phone, researching technologies/platforms/whatnot, emails, detailing specifications of what projects are going to be, estimating costs, conferring with my partner on all of the above and more, server maintenance on our own server(s) as well as maintenance on client servers as necessary, maintaining and extending old code for various clients, developing new code, procuring servers and/or domains and/or security certificates and/or a host of other things as needed for clients, and so on ad nauseum. Ideally I would be defining projects and methodologies well enough that I and/or my partner could better parcel them out, but that's all part of growing. We're still trying to figure out a good timetracking system--we've tried a bunch, and nothing quite feels right, yet. I'm doing my own hours in excel, and until I find something that's as simple as the worksheet I've got, yet makes me feel like I have full reporting and visibility on what I'm doing... And it pretty much has to be linux-based, web-driven.

As for tools, we use svn for revision control (and pulling things onto production), mantis for bugtracking (and I'm thinking about making a timetrack extension to it--it has support for custom variables and custom reports, so ... yeah). mysql is our database of choice, mostly because that's what our clients typically have, because that's what shared servers and even dedicated servers tend to be packaged with; adodb is our database abstraction layer of choice (it so rocks). nusoap is the soap thingy we use, for some things. and we've got a basic email layer, too, though I wrote some quickndirty functions to do form email population. We tend to code in a barebones pseudo-MVC manner, with data population at the top of a given php file, display and display logic as necessary afterwards, and any form processing happening in separate ".do" php files (all, of course, interacting with data-oriented library pseudo-classes). Every "display" page includes a configuration header, does what logic/data population it needs to, then includes the "top" of the html template, then does what display it needs to, then includes the "bottom" of the html template. Oh, and CSS may not be God, but it's up there.

looking for a php bulletin board _library_ or _module_
precarious, 2006, cats, balanced
[info]kaolinfire
It would have its own dbtables, wouldn't handle user registration/editing, would have special-purpose functions to help nest threaded conversations and the like, maybe even do BB code and offer smiley completion and stuff like that... wouldn't have its own pages but could have "stubs" ready and waiting.

If it doesn't exist (and I don't see how it couldn't), I may just write something. It would be nice to have _something_ reusable, eh?

Something simple. Something happy. Something that integrates with existing sites (and databases) to the point where you don't realize it's an integration. I'm talking _seamless_. Eh?

Eh?

english subtitled japanese database
precarious, 2006, cats, balanced
[info]kaolinfire
This is one of the older php sites I've done, and it's really astounding how far I've come in a year. The libraries I've found, mostly. ADODB is a miracleworker, and then there's just things I've figured out here and there to make my life easier. Anyway, I went and added a field to movies (amazon id) so that the amazon advertising will show up if that's selected, on top of the google advertising (which has made me all of $1.37 to date); and then a suggestions box! [[suggestions box and a "require this field, please" from [info]mopedronin, who, I must remind, this site was pretty much entirely built for. I know nothing of the content, though it does interest me.]]

That's http://subtitled-japan.com/ if you're curious. :) It's been a while since I tried to promote it.

I'm a data fiend
precarious, 2006, cats, balanced
[info]kaolinfire
I should launch into a diatribe, or perhaps an ode, but I think action speaks louder than words (and I'm pressed for time).

http://alethe.net/~k/fictionwise/chartdb.php

I've got a screenscraper pulling in all rankings of a friend's books on fictionwise four times a day, and dropping that into a db. Which then gets graphed by a most wonderous php->xml->swf graphing library. Dude.

Can't recommend that graphing library enough. I'm not paying for it, so clicking on the generated graph will take you to their site. Long live shareware! If I ever have a client that wants me to do something like that, I will more than happily advise them how to fork out the money. :) It's not that much, in the scheme of things.

cheap thrills
precarious, 2006, cats, balanced
[info]kaolinfire
I don't know why, but adding notes to php.net is one of the biggest thrills for me, of late. I'm giving something back. I'm showing off. I'm putting myself up for rejection. So far, I'm just ignored. But I'm not giving up! First bit of code went up, well, if you were paying attention you saw it. I don't remember. Aha! Oct 17. I'm actually recording these things, now -- http://erif.org/code/php.php

Oops! I never posted about it, then. Silly me. Well, check out the link above if you want to see the other super-craziness =)

Today's code:


test for valid US phone number, and get it back formatted at the same time

  function getUSPhone($var) {
    // area code
    $US_PHONE_PREG ="/^(?:\+?1[\-\s]?)?(\(\d{3}\)|\d{3})[\-\s\.]?"; 
    // seven digits
    $US_PHONE_PREG.="(\d{3})[\-\.]?(\d{4})"; 
    // any extension
    $US_PHONE_PREG.="(?:\s?x|\s|\s?ext(?:\.|\s)?)?(\d*)?$/"; 
    if (!preg_match($US_PHONE_PREG,$var,$match)) {
      return false;
    } else {
      $tmp = "+1 ";
      if (substr($match[1],0,1) == "(") {
        $tmp.=$match[1];
      } else {
        $tmp.="(".$match[1].")";
      }
      $tmp.=" ".$match[2]."-".$match[3];
      if ($match[4] <> '') $tmp.=" x".$match[4];
      return $tmp;
    }
  }



usage:
  $phone = $_REQUEST["phone"];
  if (!($phone = getUSPhone($phone))) {
    //error gracefully :)
  }



Home