Monday, October 30, 2006

Puakma: Under the hood:

3,001 Ajax web chat applications have been written. It's almost a right of passage for developers learning the capabilities of the Ajax paradigm. I have been putting off writing one because there were already 3,000 in existence, but last week I bit the bullet and scratched my itch. Sometimes it's good to do stuff just because you can.

The problem I had to solve is: We are about to start a weekly Tornado meeting. I want everyone to be able to find the chat session easily and have it start at a designated time (and finish so noone can rejoin an old one later!). Further, everyone shouldn't need a fancy schmancy chat client and an account somewhere (eg, skype, msn, icq, ...).

So how does it work?

I have two tables, one called CHATEVENT which holds the meeting information such as start date, time, description etc. The other table is called CHATDATA and this holds the text people type, only row per chat message tagged to a CHATEVENT. At this stage I am not concerned about managing invitees but that could be easily added later. YAGNI

On the client side, each time you type some text in the input field, it is sent to hte server via an ajax request and poked into the CHATDATA field. There is also a client side thread that polls the server for new messages, reading the CHATDATA table to find any new messages since the last poll. Any new messages are returned and dynamically added to the div which holds the chat messages, creating the illusion of messages being pushed to the client.

The trick I found was to ensure everyone only uses the server time for timestamping messages and have the server return the time of the last message. If you don't you'll get things doubled up - or missed.

On performance, because the ajax chat mechanism works on a polling basis you need to tweak the poll interval so that each client will poll regularly enough so the user experience is nice and infrequently enough to reduce the server load.

Hopefully we can get this integrated into podmatcher soon and start using it as the chat medium, that way if you miss a meeting you can come back later and read the pod meeting's transcript.

If you'd like a copy of this Tornado app, email me :-)

Friday, September 22, 2006

Frankly, the Philippine attitude should be like China, which, as the Chinese officials quoted in this book are saying, is concentrating on learning what it can from the US with the vision of one day becoming the designers of products, not just the cheap alternative for countries offshoring their manufacturing needs.

Monday, August 28, 2006

some filipino homonyms ambiguity

http://video.yahoo.com/video/play?vid=18bc876987a407d3ce81d2b4195ce0d1.667581&cache=1 <-- aso nanghahabol ng naka-bisikleta

Saturday, August 26, 2006

original article:
http://www.dvorak.org/blog/?p=6557

Tokyo tops the ‘Big Mac’ index — USA NOT Number One


Residents of Tokyo have the highest purchasing power in the world, edging out people in Los Angeles, Sydney, London and Toronto, according to a new survey by the Swiss banking giant UBS that uses the “Big Mac” as its benchmark.

“Wages only become meaningful in relation to prices — that is, what can be bought with the money earned,” it said.

The bank calculated the “weighted net hourly wage in 14 professions” and divided it into the local price of “a globally available product,” for which it chose McDonald’s flagship hamburger.

“On a global average, 35 minutes of work buys a Big Mac,” it said. “But the disparities are huge: in Nairobi, 1 1/2 hours’ work is needed to buy the burger with the net hourly wage there. In the U.S. cities of Los Angeles, New York, Chicago and Miami, a maximum of 13 minutes’ labor is needed.”

In Tokyo, it takes a mere 10 minutes. Bogota, Colombia, came in last among the 70 cities surveyed at 97 minutes.

Of course, you should add the cost of having your arteries defatted every 20 years or so.

Wednesday, August 16, 2006

Slashdot | Did Humans Evolve? No, Say Americans: ". Show me a single person who is both an aetheist AND against evolution. The problem with religious people is that they have an agenda, and logic usually takes a back seat"

Tuesday, August 15, 2006

For your eyes only


http://research.microsoft.com/university/ntsrclicensees.asp


Windows® Source Code Licensees

North America

Arizona State University
Boston University
Brigham Young University
Brown University
Capitol College
Cogswell College North
Columbia University
Cornell University
Dartmouth College
Eastern Kentucky University
Evangel University
Florida Institute of Technology
Georgia Institute of Technology
Howard University
Lamar University
Louisiana State University at Shreveport
Loyola College in Maryland
Massachusetts Institute of Technology
McGill University
New York University
Oregon Graduate Institute of Science and Technology
Princeton University
Rice University
Saginaw Valley State University
San Jose State University
Seattle Pacific University
Stanford University
Stevens Institute of Technology
SUNY/Stony Brook
Texas A&M University
The Johns Hopkins University
University of Alabama at Birmingham
University of California at Irvine
University of California at Los Angeles
University of California at Riverside
University of California at San Diego
University of California at Santa Cruz
University of Colorado at Boulder
University of Florida
University of Houston at Clear Lake
University of Idaho
University of Illinois
University of Kentucky
University of Memphis
University of Michigan
University of Notre Dame
University of Rochester
University of Southern California
University of Southern Mississippi
University of Texas at Austin
University of Virginia
University of Washington
University of Wisconsin
Vanderbilt University
Walla Walla College
Washington University
Wayne State University
Western Illinois University

International

Brandenburg University of Technology
Budapest University of Technology
Carlos III University of Madrid
Chalmers University of Technology
Czech Technical University
ETH Zentrum
Hebrew University
Humboldt-Universität
INRIA LORRANE
INRIA RENNES
INRIA RHONE-ALPES
INRIA ROCQUENCOURT
KAIST
Keio University
LAAS-CNRS
Lancaster University
MS Institute (MS Australia)
National University of Singapore
Queensland University of Technology
Slovak University of Technology
Swinburne University of Technology
Technion
Technische Universität Darmstadt
Technische Universität Graz
Technische Universität Hamburg-Harburg
Technische Universität München
Technische Universität Wien
Tel Aviv University
Trinity College Dublin
Universidade de Lisboa
Università di Genova
Università di Milano
Universität Kaiserslautern
Universität Karlsruhe
Universität Potsdam
Universität Zu Köln
University College London
University of Aarhus
University of Aizu
University of Alberta
University of Cambridge
University of Cape Town
University of Greenwich at Medway
University of Kent
University of Linz
University of Oslo
University of Patras
University of Salford
University of Southampton
University of Tromsø
University of West Bohemia
Is Full Disclosure Advisable?: "'loose lips sink ships.'"

some patent problem

Slashdot | What's Fedora Up To? Ask the Project Leader: "NTFS support in Fedora/RedHat.
(Score:5, Interesting)
by Anonymous Coward on Monday August 07, @11:58AM (#15859337)
If Fedora is actually not controlled by Red Hat anymore, and Fedora is user-oriented, why are both the only general-purpose GNU/Linux distributions that disable the NTFS driver from the Linux kernel?

Users do need this option (unlike RedHat's customers, which are organizations as far as I know), and for evidence, Linux-NTFS is one of the projects with the most downloads on sourceforge.

I would like to add that NTFS is part of the mainline kernel. Compiling it as a module will cause it to not take any memory resources other than the few kilobytes on disk that any un-used hardware module is taking, unless of course the user has a mounted NTFS partition.

RedHat's reason for disabling NTFS support was that RedHat is a US-based organization and that they fear patenting problems from MS. No law action was ever taken, and no actual patent was referenced. As far as I know, NTFS is not even patented or patentable. Fedora is not RedHat as you say, so this old reasoning is not exactly valid for Fedora. The IBM/SCO saga also cleared the issue about patents in the mainline kernel.

Unless Fedora will change this simple flag in the kernel config file, I assume it is still controlled (and not only sponsered as some would say) by RedHat."
Slashdot | Google Sends Legal Threats to Media Organizations: "Googling woes
(Score:5, Funny)
by Rob T Firefly (844560) on Monday August 14, @09:09AM (#15901979)
(http://robvincent.net/ | Last Journal: Wednesday April 27, @09:22AM)
Once I was feeling artistic, so I Googled how best to Xerox my head onto a Playboy Bunny, maybe using some Scotch Tape, but found out I could Photoshop it instead. So, I had a Coke, grabbed some Kleenex, and got to work.. but was disturbed by my mom coming in to Hoover. So I quickly shut down the PC, and decided to use Crayolas and Play-Doh instead."

Sunday, August 13, 2006

Does PLDT really suck? » @ Ambot ah! [ technology news and reviews ]: "I switched to BayanDSL and have been using it for almost 2 years now. Its a dedicated line (no phone - from the poste, straight to the ADSL MODEM) 384kbps at two-thirds the price I was paying for PLDT’s 256kbps. NO COMPLAINTS - they have 24 hr. service crew and they guarantee a technician at your door in 1 day kung hindi ma-resolve through phone ang problem. I can’t really account for other horror stories out there about Bayan DSL (if any) pero as for me, its been peaches and cream ever since."

Saturday, August 12, 2006

Slashdot | MS .net vs Mono, Open Source: "you've been duped
(Score:4, Informative)
by g4dget (579145) on Wednesday December 25, @09:32PM (#4958666)
(i) Sun has supported third party implentations to the point where they used a third party implementations themself. What's the original linux jvm a third party jvm ( name was black-something, I can't remember).

It's Blackdown Java. It is not a third party implementation. Sun simply dumped their source code onto a bunch of people outside Sun who then fixed a bunch of bugs and ported it to Linux.

IBM has had it's JVM for eons now. There are lots of embedded JVMs.

IBM does not have its own Java implementation--they have a license to Sun's Java implementation, and they replace some of Sun's components with their own.

(ii) Sun has tolerated those implementations for years now.

Sun hasn't tolerated anything. As far as I can tell, anybody who is shipping anything remotely resembling a Java platform implementation has a contractual agreement with Sun. In fact, merely to claim that something is Java, you need a contractual agreement with Sun (because of their trademark).

(iii) In the past, Sun has never shown to be anti-competitive as microsoft. They don't defend or promote Solaris at any cost the way microsoft does.

I see no basis for that statement. Sun simply isn't leveraging their monopoly because they don't have one. As a 15 year Sun customer, all the indications I have seen are that Sun is worse than Microsoft when it comes to cut-throat competition and intellectual property, they are simply not as successful."
Slashdot | MS .net vs Mono, Open Source: "Re:Eclipse and SWT on Monster
(Score:4, Insightful)
by 1000StonedMonkeys (593519) on Wednesday December 25, @08:19PM (#4958463)
Most users' experience with swing can be summed up with the following:

1. Open any swing application
2. Right click the mouse button somewhere a context menu should appear, or click on one of the file menus.
3. Wait 3 seconds
4. Form the incorrect conclusion that Java is slow
5. Go back to using native win32 programs

Sun's been trying to 'fix swing' for the last 5 years, and they've had no luck. What makes you think IBM has the magic bullet?

Swing will never be fast. The same abstractions that make it such a joy to program with make it terribly inefficiant. Print out a stack trace in a event handler function in swing and take a look at how deep it is. Every one of those functions had to be called before the event was process, and ever call had to be done through a table lookup. I'll avoid going into the whole native vs. non-native widgets debate, but forgive me if I remain skeptical about the non-native approach sun has been using with swing.

IBM (well, the company that wrote eclipse that IBM bought) did the right thing when they started from scratch to design SWT. Eclipse is amazingly responsive when compared to any swing application I've seen. Try it out yourself, I think you'll be impressed."
More than an open-source curiosity | Newsmakers | CNET News.com: "The problem with J2EE really is that it became very, very academic and the complexity of all these perfectly designed systems in schools does not necessarily map when you have deadlines and all kinds of other things"

Thursday, August 10, 2006

commandline clipboard under gnome

http://uwstopia.nl/blog/2006/05/command-line-and-the-clipboard

A few days ago I stumbled upon a question in a newsgroup: how to put text on the Gnome clipboard from the command line?

In response, I wrote a small Python script (using PyGTK) that can be used as a pipe in your command line scripts. It puts all data from stdin on the clipboard. For this to work, you will need the correct $DISPLAY environment variable set (which will be the case most of the time, but it doesn’t work from cron for example).

CLI lovers, download copy-to-clipboard here and rejoice!

Update: Sure, there’s also tons of other solutions like xclip and of course the script could be more like a one-liner, but I like to demonstrate the ease of use Python and PyGTK offer.

---------


#!/usr/bin/env python

import sys

import pygtk
pygtk.require('2.0')
import gtk

buffer = []
for line in sys.stdin:
buffer.append(line)

c = gtk.Clipboard()
c.set_text(''.join(buffer))
c.store()
How to redirect output to "clipboard" on command line: "

#:912674 12:42 am on Dec. 26, 2004 (utc 0)

For those not using Cygwin, there is an X-Windows utility called 'xclip' which reads STDIN and puts the input into an X clipboard.

cat filename ¦ xclip

X clipboards are not the same as Gnome or KDE clipboards, however. Someone wrote a bash function for KDE called 'klip' that uses the KDE utility 'klipper' to do the same thing (search for it).. I didn't find anything similar for Gnome, but some Gnome apps play nicely with X clipboards...so maybe xclip would work?

So it will depend on which application are you pasting into, unfortunately. "

Wednesday, August 09, 2006

Find the most recently changed files (recursively) [linux] [find] [command] [line] [morten] [recently] [changed]: "Find the most recently changed files (recursively) (See related posts)

find . -type f -printf '%TY-%Tm-%Td %TT %p\n' | sort"

Monday, August 07, 2006

open a port

Just in case you need it in the future, I use this for opening a port:
Code:
iptables -I INPUT -p tcp --dport $1 -j ACCEPT
Where $i is the port number you wish to open.

Like the others said, it sounds to me like telnet is not even running, and the connection refused is because there isn't actually a service to connect to.

backup tomboy notes

[tomboy-list] Backup files:

Hi Shannon,

Tomboy stores all your notes in ~/.tomboy/*.note. It keeps a few simple
settings in GConf, but nothing major.

-Alex

On Fri, 2004-12-10 at 20:43 +0000, Shannon Baker wrote:
> I move data and reinstall on my machines fairly frequently but don't want to
> lose my Tomboy notes. What files do I need to back up to transfer them to
> another machine? Is there any special process or procedure to reimport them
> on the new machine?
>
> Thanks
>
> Shannon T. Baker
>

linux equivalent

c:\documents and settings\start menu

/usr/share/applications/

-----------------

system-wide startup folder

/etc/xdg/autostart

linux

c:\documents and settings\start menu

/usr/share/applications/

-----------------

system-wide startup folder

/etc/xdg/autostart