Fantasy by xkcd
| nogutter | Will display no gutter. |
| nocontrols | Will display no controls at the top. |
| collapse | Will collapse the block by default. |
| firstline[value] | Will begin line count at value. Default value is 1. |
| showcolumns | Will show row columns in the first line. |
from Tkinter import *
class Alarm(Frame):
def repeater(self):
self.bell()
self.after(self.msecs, self.repeater)
def __init__(self):
Frame.__init__(self)
self.msecs = 1000
self.pack()
stopper = Button(self, text='Stop the beeps!', command=self.quit)
stopper.pack()
stopper.config(bg='navy', fg='white', bd=8)
self.stopper = stopper
self.repeater()
if __name__ == '__main__':
Alarm().mainloop()
function get_public_blogs()
{ // Get a list of 'Public Blogs'
$this->BlogCache = & get_Cache( 'BlogCache' );
// pre_dump($this->BlogCache);
$pub_blogs = $this->BlogCache->load_public();
$pub_blogs = implode( ', ', $pub_blogs );
return $pub_blogs;
}
function addNames(xml) {
selected = jQuery("#to").selectedValues();
jQuery(xml).find("user").each(function(number) {
jQuery("#to").addOption(jQuery(this).find("name").text(), jQuery(this).find("name").text());
});
jQuery("#to").selectOptions(selected[0]);
}
function updateSelectBox() {
jQuery.get(jQueryChatPluginUrl, {
plugin_ID: jQueryChatPluginId,
After a hard day's work I release version 1.0.4 of the jQuery Chat widget. You find it at Sourceforge.
With a big help from blueyed I moved the code from the loose file backend.php to the plugin. It now uses B2evo's htsrv methods. This is a major breakthrough because now I have all the variables from B2evo available in the method that is the core of the widget. I need this for installing the widget on all platforms and now I can use the DB class that B2evo supports.
From here on I can build all kinds of additions to the widget. So do comment on this post if you require a feature.
The future version will have a basic 'Private Chat'. Those of you who are not member of this blog, this is what it looks:
Have fun
I finally found a QR Code decoder through http://www.hafenscher.net/qrcode/. I use the Offline QRCode Decoder by Yusuke Yanbe. This is a screenshot of the QR Code from this blog:
That's not bad at all.
What's more is this article "Pull" Barcode Scanning Could Be Android's Killer App on Slashdot suggesting the QR Code Widget has some use opposed to my original idea it has no use at all.
*update*
The plugin is released: see here
Have fun
The QR Code widget is new. I need to get the caching right and then it's ready to be released. It's completely useless. I usually love those features. Remember my Lottery plugin?
Fr some more information on what it's all about visit: QR Code. The core code that generates the image is QRcode Perl CGI & PHP scripts ver. 0.50. The code is fully procedural. I wrapped it in a class and am able to call it from the plugin. I later found a WordPress plugin using the same code. He wraps it in an ob_start to retrieve the image. Ugly poetry.
ob_start();
require_once 'php/qr_img.php';
$out = ob_get_contents();
ob_end_clean();
Where I do
require( 'qr_code/php/qr_img.php' );
$qr_code = new qr_img;
$qr_code->prepare_image( $data );
I had some serious troubles getting the image to display. It would output only weird characters. The function imagepng() should take care of that. I now save to file first (imagepng() does that if you provide a filename as second argument, very cool.)
This is the maximum I can get into a QR Code image. The text is 'The Raven' by Edgar Allan Poe and it's the first six stanza's only (2316 characters, according to the specs it should be possible to do more.)
Who said: "Code is poetry"?
As mentioned, it needs to be cached now. That's done before, so I'll manage. MD5 all the variables, add .png, generate the image with that name and put it in a cache folder. (No, I did not nick this idea from the author of the WordPress plugin, I saw it done earlier with the font replacement thingy).
Next I can make all variables as a setting, but no need for that, those variables are extremely specific, like Error Correction Capacity, forced size (it now calculates the size based on length of data, more data would mean a larger image) and such. Not really interesting, not even as a setting. Would any user care if the image is a jpeg or a png?
Next up is the shoutbox. Blueyed cracked it (I won't tell at this moment, but it wasn't that hard). There were two errors, one caused by adding console.log in the js. People without FireFox *and* FireBug got errors. I mistakenly thought
if(console.log){console.log('Hello World!)}
would stop errors, but IE complains and to my amazement so does FireFox. Note to non geeks: FireBug uses console.log to output some debug data. It's like the alert in javaScript but it outputs to the console in FireBug.
The other error is a MySQL error. It pops up from time to time and is related to he table where the messages are stored. This is the code that created that table:
'CREATE TABLE ' . $this->get_sql_table( 'messages' ) . "(
`id` int(7) NOT NULL auto_increment,
`user` varchar(255) NOT NULL,
`msg` text NOT NULL,
`time` int(11) NOT NULL,
PRIMARY KEY (`id`)
)"
I haven't found what's wrong there. The error, whenever it pops up is
No KEY/INDEX defined for AUTO_INCREMENT column!
If you have any idea please let me know.
That's all for now. Do visit this blog from time to time and keep playing with those gagdets. Feel free to register to this blog so your name will be autofilled in the shoutbox (Once again really useless.) As a bonus registered users can turn this blog back to English. Gerard Prins sent me a recent Dutch translation so I'm testing that as well.