lime icon

Phosphorus and Lime

A Developer's Broadsheet

This blog has been deprecated. Please visit my new blog at klenwell.com/press.
Linux: Damn Small Linux
I have an old Toshiba 2800 laptop that I inherited. It came with Windows XP home installed, but with only 64 MB RAM is slower than a mail-in rebate. So I decided to move it over to one of those small Linux distros.

I tried Puppy Linux and that failed. So I tried DSL (Damn Small Linux) -- and that froze, too. The Ubuntu live CD loaded -- in 40 minutes!

Then I found this note on the web:

After more searching I found out that in the BIOS I had to change the 'PC Card Controler Mode' from 'Auto selected' to 'CardBus/16-bit'.

source: damnsmalllinux.org


Don't know what the difference is. But it worked. Also solved my problem with Puppy Linux. So if you're having trouble loading Linux on a Toshiba laptop, try that.

One more note: hit esc on load to enter bios and page down to change PC Card Controller mode.
Morpher
Just ran into this (while browsing a site boycotting the new James Bond.)

I was looking for one of these a while back. I forget exactly why now. Anyway, now I found it. (And it looks as though it's been around for a while!)

keywords: images, graphics, morph, morphing
Spam Control: Gmail
There was some buzz recently in the blogosphere about spammers breaking Gmail and I noticed myself that more spam (3-4 per day?) were making it into my inbox. It appears, however, Google has got the problem back under control. I'd guess that I'm still averaging 1-2 spam in my inbox a day. But I just looked in my spam box and I'm averaging about a dozen spams today. (Any false positives? I didn't notice any but I confess I don't look all that hard.)

So it looks, for the time being at least, that Google turned the tide and kept it manageable. How much of this is a result of my own spam marking, I'm not sure. But I'm appreciative in any event.
Spam Control
Still contemplating the problem of form-based web spam. Wondering just now whether there weren't some event based challenges that might thwart spammers. A trivial right-click task, or something like:

copy and paste the animal from this string into the field below:
monday/lion/bank/green


Word categories, terms, and delimiters could be easily randomized -- three chances, impose a time penalty for wrong guesses, reset challenge. You might even color code responses to give a bit of a visual cue to viewers (though this would present a numerical pattern that would be a vulnerability.)

A nuisance even if it works, but a stopgap that, if properly implemented, might qualify as an effective reverse-Turing test and require quasi-AI to break.
MySQL notes
A couple notes:

1. affected rows

In updating a record using PHP/MySQL where the data is not actually changed, PHP will return 0 rows affected. To get around this, there is a flag that can be set when establish the db connection. Details here:

http://www.php.net/manual/en/function.mysql-affected-rows.php#33509

2. MySQL 'INSERT ... ON DUPLICATE KEY UPDATE'

I wrote a function that does this the long way by trying to select the row then inserting or updating based on the result. This is probably much more efficient. Details here:

http://dev.mysql.com/doc/refman/4.1/en/insert-on-duplicate.html

keywords: php, mysql, insert, update, affected, rows, duplicate
PHP: MySQL query function
A slight encapsulation of the PHP mysql_query function. I used to add this line to all my scripts:

$_sqlr = mysql_query($SQL['select']) or trigger_error('MySQL error number '.mysql_errno().': '.mysql_error(), E_USER_WARNING);


Now I use this:

// AMVC_mysql_query
/*____________________________________________________________________________*/
function AMVC_mysql_query($query)
{
// *** DATA

# internal
$_err_num = 0;
$_err_exp = '';
$_err_msg = '';

# return
$resource = FALSE;

// *** MANIPULATE

# run query
$resource = mysql_query($query);

# check result
if ( !$resource )
{
$_err_num = mysql_errno();
$_err_exp = mysql_error();
$_err_msg = "MySQL error number $_err_num : $_err_exp <br /> query: $query";
trigger_error($_err_msg, E_USER_WARNING);
}

// *** RETURN

return $resource;

} # end Fx
/*____________________________________________________________________________*/


A little more descriptive when things don't go as planned.

keywords: php, mysql, fx, query
OSS: GPL
I'm working on a more serious, commercialesque website and wish to incorporate some open source GPL libraries, so I've been trying to figure out the implications. This from the Wikipedia entry on GPL:

Note that the copyleft only applies to the software and not to its output (unless that output is itself a derivative work of the program); for example, a web portal running a modified GPL content management system is not required to distribute its changes to the underlying software. (It has been suggested that this be changed for version 3 of the GPL.)


From the horse's mouth: GNU General Public License v2.0

keywords: GNU, licensing, open source
Email to Dr. Dave of Spam Karma
Thinking out loud:

Read recent entry on the step-up in spam attacks -- not encouraging. I'm getting to work on a comment system for a php-based project I'm working on -- nothing extraordinary -- and have been exploring spam-filtering options.

One idea I'm considering: a two-button radio group at bottom of comment form by which user chooses either a captcha (default option) or an email message to validate the comment. If the commentor chooses email, the message is still posted, but say only for a short time -- say 2 hours -- before it is suppressed if the user has not validated it by clicking a URL link in email message. Simply an adaptation of the old user signup rigamarole but seems it might perhaps offer an extra layer of protection on top of other filtering techniques.

Or has this system itself been broken? Curious to have your opinion.

And kudos on your great work.

Thanks,
Tom

 
The Car Crash on Spam
There are terrorists among us, and they're not calling each other on unencrypted cell phones to talk in broken English about the next skyscraper they're going to level. They're spammers -- and if Bush wanted to do something useful with $200 billion, he could have thrown it at this problem.

Anyway, a few interesting blog entries I bounced between today as I researched PHP solutions that sum up the state of the art:

The State of Spam [Karma] (unknowngenius.com)

Bad Behavior 2 Roadmap Update (wordpress.com)

weblog spam (diveintomark.org)

Spam Karma looks the most promising of the solutions on offer, but I'm going to tinker with Bad Behavior since it's GPL and is about the only thing I found for PHP that sounds half-way effective and not tailored to wordpress.

On a tangential thread, I came across this:

ripple monetary system (wikipedia)

Whuffie (wikipedia)

ripple project (sourceforge)

Interesting concept. Afraid we'll never really see the proof.

keywords: spam, karma, wordpress, whuffie, ripple
Profile Icons

Need to make some room on the page.
PHP: include file template
My revised template for library-like include files. Simple enough, but since adopting the form as my standard, I've found development speed and quality has improved noticeably.


/*** DOCUMENTATION LAYER

AMVC Include Template

Directory: VAR
File: VAR.inc.php
Last Update: Feb 2006
Author: Tom Atwell (klenwell@gmail.com)

FUNCTIONS:

NAME()


NOTES:

______________________________________________________________________________*/



// NAME
/*____________________________________________________________________________*/
function NAME()
{
// *** DATA

// *** MANIPULATE

// *** RETURN

} # end Fx
/*____________________________________________________________________________*/



// Testbed
/*____________________________________________________________________________*/


/*____________________________________________________________________________*/

?>


keywords: PHP, template, library, include, function