tag:blogger.com,1999:blog-110063782024-03-17T02:53:13.381+08:00Helmi Ble'be'Open Source, programming and related stuffFoobazhttp://www.blogger.com/profile/13447190038974406237noreply@blogger.comBlogger111125tag:blogger.com,1999:blog-11006378.post-33836348926050945892012-10-16T10:17:00.000+08:002012-10-16T10:17:10.324+08:00Cat
Jelita
Foobazhttp://www.blogger.com/profile/13447190038974406237noreply@blogger.com6tag:blogger.com,1999:blog-11006378.post-60301408992484254472012-05-15T13:55:00.000+08:002012-05-15T13:55:29.791+08:00RabbitMQ PHP in Ubuntu 12.04Testing RabbitMQ PHP in Ubuntu 12.04
Examples for AMQP in official PHP site (last check 2012/05/15) not sync with API for PECL 1.0.1.
This is my version to test simple php amqp
emit_log.php:
// Create a connection
$cnn = new AMQPConnection(array('login'=>'guest', 'password'=>'abc123'));
$cnn->connect();
// Create a channel
$ch = new AMQPChannel($cnn);
// Declare a new exchange
$exFoobazhttp://www.blogger.com/profile/13447190038974406237noreply@blogger.com7tag:blogger.com,1999:blog-11006378.post-60451648896490142552010-10-30T14:16:00.000+08:002010-10-30T14:16:55.957+08:00Custom Street View panorama using Google Maps v3Notes and command line script to run when create custom Street View.
Demo
Create initial panorama
* using point and shoot camera take enough pictures to cover all around (8-12 is good enough)
* use stitching software to create equirectangular projection of the panorama
* panorama must be aspect ratio 2:1
Streetview tiles
* if initial panorama size 8192x4096, then for tile size Foobazhttp://www.blogger.com/profile/13447190038974406237noreply@blogger.com2tag:blogger.com,1999:blog-11006378.post-12036506921062109552010-09-07T12:27:00.000+08:002010-09-07T12:27:45.733+08:00Running two instances of Mozilla simultaneouslyUseful when testing login multiple users for a web application during development
firefox -P profile1 -no-remotefirefox -P profile2 -no-remote
see https://developer.mozilla.org/en/Debugging_Mozilla_on_Windows_FAQ#Running_two_instances_of_Mozilla_simultaneouslyFoobazhttp://www.blogger.com/profile/13447190038974406237noreply@blogger.com1tag:blogger.com,1999:blog-11006378.post-69530142945032062562010-04-21T23:29:00.000+08:002010-04-21T23:29:36.849+08:00Ubuntu in ThinkPad X100eThinkPad X100e
Few notes while install Ubuntu Lucid:I install Lucid after upgrade from Karmic. Downloaded the Karmic AMD64 ISO, and run usb-creator to copy to my USB stick.
Make sure wireless enabled in BIOS, there is no hardware button to enable wireless! My lappy disabled it by default (I bought it without OS from Digital Mall, Petaling Jaya )
Get latest wireless driver and install it (wirelessFoobazhttp://www.blogger.com/profile/13447190038974406237noreply@blogger.com5tag:blogger.com,1999:blog-11006378.post-62006369318031866992010-04-14T21:57:00.002+08:002010-04-14T22:04:49.113+08:00Optimize P1 W1MAX SignalPosition is the key. There is difference when P1 modem inside and outside (balcony) of my house.
Inside
Outside
I been using P1 since Aug 2009, and the signal mostly strong when placing the modem inside house. The signal is significantly difference this couple of days, might be due to P1 Network Upgrade Exercise (9-12 March 2010). Anyway hope better signal while streaming Arsenal games Foobazhttp://www.blogger.com/profile/13447190038974406237noreply@blogger.com1tag:blogger.com,1999:blog-11006378.post-12773866907801606722010-03-11T14:51:00.001+08:002010-03-11T14:51:43.566+08:00Information Overload - Google Maps
There is reason for word 'More...'Foobazhttp://www.blogger.com/profile/13447190038974406237noreply@blogger.com7tag:blogger.com,1999:blog-11006378.post-5774899971982963552010-02-02T16:15:00.000+08:002010-02-02T16:15:57.841+08:00Tilecache TMS fixesError message when working with tilecache TMS:
An error occurred: The requested layer (1.0.0) does not exist. Available layers are:
To fix it, only add one line as below:
helmi@gandalf:~/Packages/tilecache-2.10/TileCache/Services$ diff -C3 TMS.py TMS_fix.py
*** TMS.py 2010-02-02 16:12:32.000000000 +0800
--- TMS_fix.py 2010-02-02 16:13:06.000000000 +0800
***************
*** 13,18 ****
---Foobazhttp://www.blogger.com/profile/13447190038974406237noreply@blogger.com1tag:blogger.com,1999:blog-11006378.post-36382233045246152942009-10-28T17:52:00.001+08:002009-10-28T17:53:27.269+08:00gearman php problem on jauntyGet this error on my ubuntu jaunty, works perfectly on hardy. I don't have the solution (hope expert out there post solution in comment)
helmi@gandalf:/tmp> php reverse_client.php
Sending job
ALERT - canary mismatch on efree() - heap overflow detected (attacker 'REMOTE_ADDR not set', file '/tmp/reverse_client.php', line 10)
How I install:
helmi@gandalf:~/Packages/php> sudo pecl install Foobazhttp://www.blogger.com/profile/13447190038974406237noreply@blogger.com2tag:blogger.com,1999:blog-11006378.post-48572378292756064462009-10-16T21:41:00.000+08:002009-10-16T21:41:02.412+08:00Fix IE6 png transparencyDon't know who use IE6 these days (already 2009 lah), but one of my friend need to fix his website. So here the css (modified from a google result)
<!--[if lt IE 7]>
<style>
img {
position: relative;
behavior: expression((this.runtimeStyle.behavior="none")&&(this.pngSet?this.pngSet=true:(this.nodeName == "IMG" && this.src.toLowerCase().indexOf('.png')>-1?(Foobazhttp://www.blogger.com/profile/13447190038974406237noreply@blogger.com0tag:blogger.com,1999:blog-11006378.post-58433729025566315272009-10-09T11:10:00.002+08:002009-10-09T11:24:20.190+08:00Inconsistent PHP - I'm sick of itPHP is inconsistent, sick of it. $needle or $haystack? Which one first? List of php function that inconsistent needle/haystackhelmi@gandalf:/usr/share/doc/php-doc/html> grep -l needle *| grep ^function | sed 's/^function.//'| sed 's/.html$//'| sed 's/-/_/'Foobazhttp://www.blogger.com/profile/13447190038974406237noreply@blogger.com0tag:blogger.com,1999:blog-11006378.post-4164765457597238372009-10-02T20:53:00.005+08:002009-10-08T07:53:26.294+08:00OpenStreetMap data for Malaysia = impressive progress!Version 17 Apr 09Version 24 Sept 09OpenStreetMap data for Malaysia = impressive progress!Quite a lot of new road added at Kuala Lumpur for 5 months work.Map above viewed using udig.Google Map Maker is available for Malaysia, but don't think it easy for offline usage/internal use (hint:shapefile).Foobazhttp://www.blogger.com/profile/13447190038974406237noreply@blogger.com0tag:blogger.com,1999:blog-11006378.post-69520345359382312522009-08-28T12:21:00.003+08:002009-08-28T12:36:12.852+08:00Which location column more trusted?You have database from your client with fields state, district (description of locations), and the_geom (latitude/longitude) column. Example of the db| state | district | the_geom || Selangor | Petaling | POINT(101.497838106615 3.27468487066054) |Anyone doing GIS should know that, the state, district fields is duplicate with the_geom since once we know the Foobazhttp://www.blogger.com/profile/13447190038974406237noreply@blogger.com0tag:blogger.com,1999:blog-11006378.post-67176312543919156812009-06-26T00:15:00.003+08:002009-06-26T00:26:29.382+08:00Mapnik need to know postgis column typeMapnik need to know postgis column type to render properly. This mapnik xml for style not working for me. <Style name="jalan_casing2"> <Rule> <Filter>[jenis] = 'lebuhraya'</Filter> <MaxScaleDenominator>&maxscale_zoom7;</MaxScaleDenominator> <MinScaleDenominator>&minscale_zoom7;</MinScaleDenominator> <Foobazhttp://www.blogger.com/profile/13447190038974406237noreply@blogger.com1tag:blogger.com,1999:blog-11006378.post-32765899608511258002009-05-27T16:14:00.004+08:002009-10-08T07:54:26.929+08:00MapGuide 2.1betaEager to try beta version, here I log the problem I face and how I solve.Error msg:httpd.exe: Syntax error on line 127 of C:/Program Files/OSGeo/MapGuide/Web/Apache2/conf/httpd.conf: Cannot load ../Php/MgHttpHandler.dll into server: The specified procedure could not be found.Fix by move directive 'MgHttpHandler.dll' upLoadFile ../Php/php5ts.dllLoadFile ../Php/ACE.dllLoadFile ../Php/Foobazhttp://www.blogger.com/profile/13447190038974406237noreply@blogger.com0tag:blogger.com,1999:blog-11006378.post-34245338253690330962009-05-26T17:29:00.001+08:002009-05-26T17:30:20.556+08:00No nginx gzip on jauntyhttps://bugs.launchpad.net/ubuntu/+source/nginx/+bug/346010Foobazhttp://www.blogger.com/profile/13447190038974406237noreply@blogger.com0tag:blogger.com,1999:blog-11006378.post-76203537350221538422009-05-13T15:39:00.003+08:002009-05-13T15:46:42.782+08:00schema.table to "schema"."table"PHP<?php$st = 'schema.table';print join('.', array_map(create_function('$a', 'return \'"\'.$a.\'"\';'), explode('.', $st)));Selected 3 of 3 Lines; 11 of 11 Words; 124 of 124 BytesPythonst = 'schema.table'print '.'.join('"'+i+'"' for i in st.split('.'))Selected 2 of 2 Lines; 9 of 9 Words; 69 of 69 BytesPython=PHP/2Foobazhttp://www.blogger.com/profile/13447190038974406237noreply@blogger.com1tag:blogger.com,1999:blog-11006378.post-90446200147087937012009-05-05T17:38:00.002+08:002009-05-05T17:44:06.026+08:00Trac error - database disk image is malformedOne of my trac page got the error message "database disk image is malformed""underlying Trac DB is in serious trouble, may corrupted" - Ticket #6347How I fix:sqlite3 trac.db .dump | sqlite3 trac2.dbcp trac.db trac.broken.dbcp trac2.db trac.dbFoobazhttp://www.blogger.com/profile/13447190038974406237noreply@blogger.com0tag:blogger.com,1999:blog-11006378.post-46882625681985875662009-05-04T18:26:00.005+08:002009-05-04T18:38:50.238+08:00Find files, php5 wayFind files, implemented using iterator.class RegexFilter extends FilterIterator { protected $regex; public function __construct(Iterator $it, $regex) { parent::__construct($it); $this->regex = $regex; } public function accept() { return preg_match($this->regex, $this->current()); }}function find_files($path, $pattern, $include_dir=FALSE) { $objects = new Foobazhttp://www.blogger.com/profile/13447190038974406237noreply@blogger.com0tag:blogger.com,1999:blog-11006378.post-20365678717107578142009-05-04T12:03:00.003+08:002009-05-04T12:09:28.679+08:00import data from csv into postgresqlWe can use sql command, COPY. But programmer still need to create the table before copy the data. Simple python script to help#!/usr/bin/pythonfn = '/home/helmi/world.csv'columns = file(fn).readline()print 'create table world (%s text);' % " text,".join(columns.split(','))print "copy world from '%s' with csv header;" % fnthenpython csv2psql.py | psql mydbFoobazhttp://www.blogger.com/profile/13447190038974406237noreply@blogger.com2tag:blogger.com,1999:blog-11006378.post-91652717732558250342009-03-06T16:14:00.008+08:002009-04-01T17:14:50.235+08:00Validate KMLI implement dynamic KML data using PHP + Postgis for a pet project. The problem is, Google Earth don't tell you the error when our kml file have problem, such as invalid KML. It just not appear in 'My Places' or 'Temporary Places'. So, I keep wondering whether I open correct link, or php not working, etc.Previously how I debug is by check apache log or postgresql log. But just found the 'macho' Foobazhttp://www.blogger.com/profile/13447190038974406237noreply@blogger.com0tag:blogger.com,1999:blog-11006378.post-14019762185064157302008-11-29T23:50:00.002+08:002008-11-30T00:03:20.104+08:00Vim smart syntax highlightingSmart because it syntax highlighting sql in php heredoc. gedit and nano don't support this. I don't know about other editor.I used font size 16 all the time, big font eh ;-)Foobazhttp://www.blogger.com/profile/13447190038974406237noreply@blogger.com1tag:blogger.com,1999:blog-11006378.post-28542137088358323632008-11-24T01:08:00.005+08:002008-11-24T13:40:01.946+08:00Disable scrollkeeper on Ubuntu"proses ini hampir memakan 90% cpu dan memory, dan seringkali menyebabkan sistem menjadi hang" -- happen to me today and not at right time.To disable:sudo mv /usr/bin/scrollkeeper-update /usr/bin/scrollkeeper-update.realsudo ln -s /bin/true /usr/bin/scrollkeeper-updatesudo find /var/lib/scrollkeeper/ -name \*.xml -type f -exec rm -f '{}' \;sudo dpkg-divert --local --divert /usr/bin/Foobazhttp://www.blogger.com/profile/13447190038974406237noreply@blogger.com1tag:blogger.com,1999:blog-11006378.post-85784976329440999292008-10-31T09:41:00.002+08:002008-10-31T10:09:42.223+08:00Google Maps driving direction to Machang, MalaysiaGoogle Maps driving direction back again as today, 31 Oct 2008. It not official, I guessed (since not mentioned in Google LatLong). So, I give it a try from Kuala Lumpur to MachangFrom MiscThe routing is accurate and fast (compared to Garmin Que+malsingmaps which lead me to Ipoh instead of Gua Musang before reach Machang). But the direction is not detail enough, see the instruction no 24 in Foobazhttp://www.blogger.com/profile/13447190038974406237noreply@blogger.com1tag:blogger.com,1999:blog-11006378.post-49342013851154492602008-10-16T04:21:00.002+08:002008-10-16T04:27:19.751+08:001.0 is greater than 0.9.x [ies4linux]helmi@gandalf:~/Packages/ubuntu/ies4linux-2.99.0.1$ ./ies4linux IEs4Linux 2 is developed to be used with recent Wine versions (0.9.x). It seems that you are using an old version. It's recommended that you update your wine to the latest version (Go to: winehq.com).and whenhelmi@gandalf:~/Packages/ubuntu/ies4linux-2.99.0.1$ wine --versionwine-1.0what?? I't wrong warning dude. 1.0 > 0.9.xFoobazhttp://www.blogger.com/profile/13447190038974406237noreply@blogger.com1