Differences in the Interpreter
One gotcha is that the Prolog interpreter runs in a query mode, while code in file runs as assertions. Python, on the other hand, makes no such distinction. Code that you can compile in a file can equally be typed into the interpreter.
i.e. You have to write the rules in a text [...]
Archives for the Month of September, 2007
Prolog For Python Programmers
Monday, 24 September 2007
Fighting Comment Spam
Saturday, 15 September 2007
It’s so easy to get throwaway email addresses and throwaway domains combatting forum spam can be very difficult.
Here are some options:
1) use mod_access to ban open proxies
Similar to the approach used by denyhosts, this would blackhole proxies that are often used by bots.
2) publish ip addresses and signup dates to a central server
If there [...]
Should A Desktop Application Have A Sitemap?
Friday, 14 September 2007
Leon Brambick has been grappling with the conundrum of navigational spaghetti (warning: gratuitious drawings of the Spaghetti Monster).
If we can’t implement URLs for easy bookmarking in desktop applications, what about having a site map for usabilities’ sake?
Example from KwikPay Payroll Program:
Wordpress with Sqlite
Monday, 10 September 2007
I’m testing out wordpress with sqlite, it seems to work pretty well so far.
I’ve got it in a patch file format, and added some fixes to make it work with PHP4.
diff -Pbu -r /home/private/wordpress/data/.htaccess ./data/.htaccess
— /home/private/wordpress/data/.htaccess Thu Jan 1 00:00:00 1970
+++ ./data/.htaccess Mon Sep 10 00:51:43 2007
@@ -0,0 +1,2 @@
+order deny,allow
+deny from all
Binary files /home/private/wordpress/data/wordpress.db and [...]
Blog Spamming Through Widgets
Wednesday, 5 September 2007
Check out how a widget has spammed a blog
On this page about Factor Programming http://psalm35.blogspot.com/
It has a script in it’s footer:
<script src=http://www.oedemera.com/blogger_navbar/navbar_012.php>
When you visit the page with Javascript turned on, all the contents are replaced dynamically with ads.
This is beyond sick.
Patches to CodeIgniter for Sqlite Support
Monday, 3 September 2007
See CodeIgniter Forums
Note: The following doesn’t quite work as well.
From Price Change Blog (in Japanese):
function list_fields($table = ”)
{
// Is there a cached result?
if (isset($this->data_cache['field_names'][$table]))
{
return $this->data_cache['field_names'][$table];
}
if ($table == ”)
{
if ($this->db_debug)
{
return $this->display_error(’db_field_param_missing’);
}
return FALSE;
}
$sql = “SELECT * FROM “.$this->escape($table).” LIMIT 1″;
$query = $this->query($sql);
$retval = array();
if ($query->num_rows() > 0)
{
$row = $query->row_array();
$keys = array_keys($row);
foreach ($keys as $val)
{
if (!is_int($val))
$retval[] = $val;
}
}
$this->data_cache['field_names'][$table] [...]