I’ve implimented captcha for comments. If this seems to work for eliminating bot-spam I’ll desist my comment moderation.
Cheers
DK
I’ve implimented captcha for comments. If this seems to work for eliminating bot-spam I’ll desist my comment moderation.
Cheers
DK
Sometimes us unix folk like to have a patchfile to upgrade our software (especially scripts) so I made one for upgrading my wordpress installation from 2.0.1 to 2.0.2.
~/my_wp_webroot $ patch -p1 < WordPress_2.0.1_to_2.0.2.patch
$query=”INSERT INTO weblogs (“.implode(“,”, $cols).”) VALUES(“.implode(“,”, $vals).”)”;
I’ve been writing PHP for a long time now. And one of the things that I see quite often is that people just dont get multidimensional arrays, and how to effectively store data in them for looping. Allow me to lead by example.
of course where the array comes from and what you do with it are completely optional. But it’s important to know that the array indexes should be as informational as the array values. Otherwise you arent using arrays properly.
Why the heck is there not a target for “open in new tab”?! Hello!? The future cometh… adopt it as a freaking standard already!
This is especially true when you’re writing a library which is meant to be absorbed into a larger codebase, but also true of a codebase in which you know you will be using foreign libraries to accomplish tasks. And I’m as guilty as anybody when it comes to this!
When you are naming your functions and classes be mindfull of the possibility of collision. I think that we (as a group of programmers) are generally mindful of this when we lay out things like our database schema, but can overlook this when we’re writing our libraries.
For example a class/function name of something like “database” seems good ad first glance: It’s clear, to the point, and descriptive (okay… *somewhat* descriptive). However consider that anyone who’se writing anything even remotely related to a database (and these days what *isnt* tied to a database?) will think to themselves at one point “hmm if i name the class database, it’ll be short enough not to be annoying to type, long enough to describe what its used for, and no one’s going to think its used for processing text strings!”
So, now, its possible that every library has a right to use this class name for their code because of its qualifications. But then you will be limited to only using one persons external libs (assuming that your internal libs arent already using it)
What we *ought* to do is, for our project Foo, call the class “databaseFoo”, then we can simply use something like $database = new databaseFoo; and we loose basically nothing, and be assured of compatibility with other libs.
DK
The most amusing things happen when you’re been coding a long time. I found, and used a “hole” in one of our database routines (which has since been fixed)
getOneValueFromTable($srcTable, $srcField, $whereField, $whereValue);
produces SQL like “SELECT $srcField FROM $srcTable WHERE $whereField = ‘$whereValue'”. Can you spot the potential problems in something like this? Consider this: getOneValkueFromTable($srcTable, $srcField, ‘1’, ‘1’; delete from $srcTable; ”);
Granted its not much of a problem if only proper developers are able to use this function, but if any untrusted party were able to affect any of those variables… big problems…
Everyone should know this. If you didnt know this kind of a problem existed… consider yourself warned. This has been a public service announcement. We now return you to the normal silence found on this blog
😉
cheers
DK
Visit the Storage3 home page here, and start using Amazon’s S3 in your web applications today!
Brought to you by Demitrious S. Kelly and Ookles, Inc!
Something I threw together in about 6 hours… it’s a good start (and its workable) but needs a lot of work (polish, etc)… but right now there is literally nothing out there even remotely close to this class. So I thought I would share it with the world… Perhaps I’ll setup a project page and put it under subversion if people care to actually contribute.
http://blog.apokalyptik.com/storage3.phps
Update: I’ve put together a “release” of this project. Please visit The Storage3 Interface to Amazons S3 “Simple Storage Service” home page.
As i mentioned (now) 2 posts ago I got subversion and Xcode working together. Problem is that apparently any time someone adds a file to subversion Xcode will first properly update the working codebase, but then fail to add the new file to the subversion project. Long story short this makes working with xcode on a collaborative SVN controlled project a *real* pita… More on this later If i find anything out.
As a side note Scott apparently liked the Textmate [Editor|IDE?] which apparently has svn support I’m assuming he’ll iether give it high praise or grind it beneath his proverbial boots once he’s given it a shot…