|
SubscriptionsSites I Read
|
|
|
|
| Bye bye Xanga. These days, so few of my friends read their Xanga
subscriptions that there isn't much point in maintaining this page. It
was cool while it lasted, but it seems to me the novelty has worn off.
To Be Continued... | | |
| > CodewiseBlog 1.0.0-BETA
(Automatically cross-posted from CodewiseBlog.)All
my hard work on CodewiseBlog (a lot of hard work, believe me) is finally
taking shape in a form ready for release. I just got done committing a
handful of changes to the Subversion repository and tagged the trunk as release 1.0.0-BETA-r0. I
also changed blog.codewise.org so it no longer uses the
original CodewiseBlog system but uses the new version instead. It will
always use the latest stable version. The software is licensed
under the GNU GPL and is free software for all. There's no good
documentation yet, and I'm going to bust out the pen and paper hardcore
over the next few weeks and try and document it all before I release it
as 1.0.0 final. So what is it, and why should you care? Good question. CodewiseBlog is
a nice blog system. It's got everything I'd ever want in a blog
system, it runs fast, it's simple enough that changing things in it
doesn't give me a huge headache, and it's über customizable. What more
could you want? An overview of the critical features: - Multi-User
Thismeans
that you install CWB once on your server, and then if you're like me and
host websites for several of your friends, they can have their own blogs
powered by CWB all using the same codebase. No more making dozens of
updates when a new version comes out. Make the update once and get on
with other things. - Skinnable
CWB's skin
engine, which I nicknamed "Voodoo" because it almost works like magic,
means serious business. CodewiseBlog's appearance is completely customizable through its skins. I dare you to find a more powerful skin system that's as easy to use and is implemented as cleanly as Voodoo is. :D - Sweet Control Panel
I'm especially
proud of the user control panel. Through it, you can write your posts,
edit them, change the skin, and change your user info, all without ever
touching a MySQL database. It's painless. The list of things left to do before a final release: - Write tons of documentation
- Make a real front page, with the latest posts from all users.
- Write an installer
- Add page to the admin control panel for adding new users.
Yeah,
that's a lot of stuff. If anyone finds this interesting and would like
to suggest features and/or help out with the project,feel free to
contact me. My contact info is listed on my user page. Comment here or directly at CodewiseBlog. | | |
| > Bored, But Here's Something Anyway (Automatically cross-posted from CodewiseBlog.) Nothing really happened at school today... There
were a couple of crazy moments, like sneaking a danish the size of my
fists out from under the teacher's nose during speech while the whole
class watched, and pissing off the security guard at the front door
this morning. But overall, pretty lame. The lab in AP Chem might be
ruined beyond repair, but I don't know yet. All I know is that the
solution of mystery chemical + stannous chloride + hydrochloric didn't
turn clear like it was supposed to at all, but instead turned egg yolk
yellow... :P
So here's a random survey I read this morning and decided to steal. *shrug*
BASIC- Time started: 15:21 Name: William Robert Fraser Nickname: Bill, Netman w00t, Billy Hoods Birthday: June 16, 1988 Siblings: Sarah, 11 Eye color: blue Shoe size: 13 Height: 6'0" Where do you live: Lombard, IL Righty or lefty: righty Aftershave/Perfume: Axe 'Voodoo' on occasion
HAVE YOU EVER- Given anyone a bath: nope Have you ever smoked: twice Bungee Jumped: nope Parasailed: nope Made yourself throw-up: bleh, nope Gone skinny dipping: nope Been in the opposite sex's bathroom: yes Got your tongue stuck to a pole: nope Loved someone so much it made you cry: nope Played truth or dare: haha, yeah Been in a physical fight: yes, but not in several years Been in a police car: once Been in a sauna: yeah Been in a hot tub: lots of times :D Swam in an ocean: yep Got stung by a jellyfish: nope Fallen asleep in school: ahh, how I miss those restful mornings in Physics AP Ran away: when I was little Broken someone's heart: as far as I know, no Cried when someone you love died: yes Cried in school: no Fell off your chair: more than I care to admit Sat by the phone all night waiting for a call: no, but once for about 2 hours during the day Saved MSN / YAHOO / AOL / AIM conversations: everything Saved e-mails: everything Fallen for your best friend: yeah Been cheated on: no
FIRST THING THAT COMES TO MIND- Red: black Blue: eyes Autumn: leaves Cows: mooooo! Greenland: cold Cat: meow Nickel: oxide Elbow: joint Arm: muscle
RANDOM- Your good luck charm: nothing What's your room like: way too messy, but I'm working on that. Last thing you said: "see you tomorrow..." - to Janessa What is beside you: computer & stuff, scanner, broken watch, cans of Squirt and Cherry Coke, subwoofer, Czech currency set Believe in love at first sight: yes Like piercings: in girls yes. In guys no. Like school: not really. I want to move out and get on with college. Who is your loudest friend: Sharon Do you wear contacts or glasses: I'm supposed to wear contacts, but I don't. Do you like yourself: yes Do you get along with your family: sometimes Do you do drugs: no (insane amounts of caffeine don't count!) Have piercing below the waist: no Depressed: no Suicidal: no
FINAL QUESTIONS- What are you listening to right now: Roots Manuva - Toothbrush Can you do a front or back flip: not nearly flexible enough What did you do today: essentially wasted a day at school (minus a few isolated classic moments) What is your favorite band: Sublime or Rage Against The Machine Hate any of your family: my maternal grandmother Got
any awards: my photos have won some awards at the county fair, and I
won 4th place in the 400-meter dash at a track invitational last year. Have you ever gone streaking: no Want to get married: eventually What is your favorite video game: Unreal Tournament, Battlefield 2, NFS Porsche Have a lava lamp: somewhere around here... *digs through stuff* How many remote controls are in your house: 4 Are you double jointed: no What do you dream about: I very rarely remember my dreams, and when I do, they're too bizarre to explain in words The last movie you saw at the theatres: Corpse Bride Scary or happy movies: happy Root beer or Dr. Pepper: Dr. Pepper Silver or Gold: silver Diamond or pearl: pearl Sunset or Sunrise: sunrise Phone or in person: in person Do you want your friends to fill this out and repost: sure, it's interesting Time you Finished: 15:32 Comment here or directly at CodewiseBlog. | | |
| > PHP Fun, Continued (Automatically cross-posted from CodewiseBlog.)Okay, I'm a moron. I
spent a ton of time trying to write out a regular expression which
would match an infinitely nested set of if/else/end tags in my skin
sets. That didn't work at all. I then spent a ton of time trying to write a recursive function to do the same. That worked even less well. Then, while trying to find out why my recursive regular expression didn't work (damn you "(?R)"
!!), it came to me like a blinding light from heaven. ZOMG! Why didn't
I think of this earlier?! Write a regular expression that finds the
innermost set of if/else/end tags, process those, then repeat until
there's nothing left. Brilliant I say! Well, it would've been brilliant
if I had actually thought to do that in the first place instead of
wasting an hour and a half in utter feutility. The golden code: *a heavenly chorus sings*
<?php
$ifcapture = "<\\!-- #cwb_if# (?P<condition>(?:.(?!-->))+) -->"; $if = "<\\!-- #cwb_if# ((?:.(?!--))+) -->"; $else = "<\\!-- #cwb_else# -->"; $end = "<\\!-- #cwb_endif# -->"; $pattern = "/$ifcapture(?P<true>(?>.(?!$if))*?)($else(?P<false>(?>.(?!$if))*?))?$end/s";
/* ** Here, we work on the innermost set of tags first. ** The regex only matches sets of tags that have no #cwb_if# tags inside. ** We keep re-evaluating the regex until there are no tags left. ** You don't want to know how long it took to work this out... :P */
preg_match_all($pattern, $skin, $matches, PREG_SET_ORDER); do { foreach($matches as $match) { $old = $match[0]; $condition = $match["condition"]; $true = $match["true"]; $false = $match["false"];
$result = . ";");
if($result) { $skin = str_replace($old, voodoo($true, $args), $skin); } else { $skin = str_replace($old, voodoo($false, $args), $skin); } }
preg_match_all($pattern, $skin, $matches, PREG_SET_ORDER); } while(count($matches) > 0);
?>
voodoo()
is the function that does all the processing of the tags, and is in
itself a recursive function because that's where this code is located.
Not so complex as what I was trying to do earlier, though. Comment here or directly at CodewiseBlog. | | |
| > Some PHP Fun (Automatically
cross-posted from CodewiseBlog.)I just found that the skin engine I wrote to power my blog has a fatal flaw in its if/ else parsing regex. I tried nesting some if statements and it used the wrong corresponding endif statement,
which was very bad... I've been looking at the regex for a while now,
and I think I'm going to have to rewrite that entire portion of the skin
engine without regexes, because I think I'd need an infinitely nested
regex to properly do what that code needs to do, and such a regex is,
naturally, impossible. Oh well, back to the drawing board. (the regex that's ruining my fun)I also just had fun writing a replacement for the built-in PHP parse_ini_file() function because the host for the OpenBoard site changed
some Safe Mode settings and made the aforementioned builtin unusable.
The replacement was relatively easy to write, but I've got to wonder,
what about parse_ini_file() makes it such a security risk that Safe Mode
would disable it? For the PHP inclined, this is the replacement I came up with.
<?php
function parse_ini_file_userspace($filename, $process_sections = FALSE) { $section = NULL; $return = array(); $const = get_defined_constants(); $file = file($filename); foreach($file as $i => $line) { $line = trim($line);
if(strlen($line) === 0) continue;
if(substr($line, 0, 1) == "[" && substr($line, -1, 1) == "]") { if($process_sections) { if($section_name !== NULL) // new section, add the old one to the return array $return[$section_name] = $section; $section_name = substr($line, 1, strlen($line) - 2); $section = array(); } continue; }
list($lvalue,$rvalue) = explode("=", $line, 2); $lvalue = trim($lvalue); $rvalue = trim($rvalue);
if($rvalue == "true" || $rvalue == "yes") $rvalue = 1; if($rvalue == "false" || $rvalue == "no" || $rvalue == "null") $rvalue = ""; if(in_array($rvalue, array_keys($const))) $rvalue = $const[$rvalue]; if(substr($rvalue, 0, 1) == "\"" && substr($rvalue, -1, 1) == "\"") $rvalue = substr($rvalue, 1, strlen($rvalue) - 2);
if($process_sections) $section[$lvalue] = $rvalue; else $return[$lvalue] = $rvalue; }
// add the last section to the return array if($process_sections) { // no section was ever defined, return as if $process_sections had been FALSE if($section_name === NULL) $return = $section; else $return[$section_name] = $section; } return $return; }
?>
There are
some minor issues, such as the fact that it doesn't follow the strict
requirements the builtin places on the variables. For instance, using
double quotes around a value with non-alphanumeric characters
is unneccessary, because my code will pick it all up regardless, and
the variable name can have any values you want - the code doesn't
care whether it's a valid name for a PHP variable. Comment here or
directly at CodewiseBlog. | | |
|