Posts

Java-based Domain Driven Frameworks

Yesterday I'm browsing and exploring about Full-stack Domain Driven Application Frameworks written in the Java platform. The Java platform still has a lot of potential, but somehow the Rails framework tells me that we're still far from it, my exploration yesterday. Here is a brief of the frameworks I read about: JMatter - This one I already use a few months back. The UI is pretty decent, but the lack of production quality web-based view technology.. makes it very far behind others. It currently only has production-grade Swing viewer, making it a two tier application platform. Security-wise, two-tier platforms are not good -> each client must have a database connection to the db server, which potentially could be abused. Has no authorization code built in. Actions on the entity written in the domain model, encapsulating business logics. OpenXava - Web-based GUI with some AJAX parts. Has no authorization code built in. Separates actions from domain model, the concept is that a...

HTB traffic control burst calculation inaccuracy

My previous Kubuntu 7.04's Linux 2.6.20 kernel uses a 1000 Hz timer kernel (refer to HZ constant defininition and fourth value of kernel ABI /proc/net/psched routine psched_show in sch_api.c ). HTB's burst is calculated by tc binary using the formula : bitrate/timer frequency + maximum transfer unit. Ubuntu 8.04's Linux 2.6.24 kernel have an improved packet scheduler timer resolution. It now uses high resolution timer, with nanosecond accuracy. Refer to psched_show in sch_api.c , and Fourth value of /proc/net/psched now returns 1 G (10^ 9 ). HTB burst calculation is now bitrate/10^ 9 + mtu.. Somehow this is will always a small value, and as a side-effect HTB qos scheduler no longer capable of delivering high bitrates accurately to stations. My analysis based on my limited knowledge of the packet scheduler : the linux's packet scheduler is driven by calls to dequeue function. This might be driven by tx complete interrupt or something else. So it is not timer-driven. B...

Names in our code

This is just a summary of some rule-of-thumbs when developing source codes. When coding, do these : use descriptive names please classify/categorize so we have shorter source files. Or, we have fewer source files in each folder (distribute files into category folders). In OOP, we should refactor into new classes if things gotten too crowded in one class, or even refactor the class into different packages. In PHP, we should refactor into new files and/or new folders. Rules that were Anti-patterns : don't use generic names like $query. When reading it, I don't have a clue what does it stands for, a query to the users table, or a query to delete a user, or what? OK, maybe it can be used if the scope is local, that is, I could easily look for the meaning in the same function or small file. avoid long parameter list. It is difficult to find out which parameter means what. We could use: a value class in OOP languages, or associative array in PHP, or even object in PHP, to give meanin...

Multiple PHP in a machine blues

I am compiling PHP's source code and a PHP extension (apc). The reason for not using packaged version of PHP is that there is another critical application running in the server, with its own PHP version, and we don't want to risk incompatibility issues forcing the application run with a different PHP version. Meanwhile I need PHP compiled with debug flags, and also with gd enabled and apc extension for another application. I prefer Debug flags to be enabled because we're testing this whole stuff and don't want to be in the dark when error (s) cropped up (previous set of PHP-apache-oci8 triad sometimes issued segmentation faults but we don't now the source of the errors). The problem is, that the apc Makefile won't use the debug flag set during previous PHP compilation. It turns out that we must be very careful that: the phpize being used is from the correct PHP compilation (I deleted the scripts/phpize and scripts/php-config after changing PHP's configure ...

Munin, again

More problems come when I'm just starting to use Munin-Node to monitor several Windows 2003 servers : the memory value reported by Munin-Node are all wrong. The sum of app and unused is not related to total physical memory installed in the servers. It turns out that the Windows API used returns 64-bit values, and simple change to the format specified fixes the problem. external plugin doesn't work. Turns out that the external plugin must not print the trailing newline when invoked by 'name' argument, and it also must prints a line of '.' after each 'config' and 'value' (or default) invocation. after several days of running, external plugins stopped working. I used sysinternals' process explorer in the server, and found out that there is some chance that external plugin invocation doesn't close the listener thread. After a few days the unclosed threads became too much and prevent the Munin-Node service from spawning new external plugins.

Munin-Node 1.5 with correct memory plugin

Munin is a solution to monitor servers. It shows graphs of some important server's system parameters, such as disk free space, cpu utilization, memory usage, network traffic, and even the HD temperature. Munin requires an agent, called Munin Node, installed at the server (you must be root or administrators to do this). Of course, there is a specific Munin Node to be installed for each operating system. On Ubuntu systems, there is munin packages in ubuntu's repository. Meanwhile Jory Stone created Munin Node for Windows, and I'd be needing that because some of the servers used at my workplace is powered by Windows Server 2003. I read the postings at jory's Munin Node site, and seems that memory plugin must be patched in order to have visible memory graphs. I've downloaded the source code from jory's site, then I followed the instructions to fix the memory plugin (uncommented few lines in MemoryMuninNodePlugin.cpp), and the next task is to compile the whole thi...

OpenOffice 3.1

OpenOffice 3.1 melakukan startup dengan cepat - itu impresi pertama saya. 11 detik membuka OpenOffice Calc. Close, kemudian buka lagi - 3 detik untuk membuka Calc untuk kedua kalinya. http://www.openoffice.org/dev_docs/features/3.1/index.html http://openoffice.bouncer.osuosl.org/?product=OpenOffice.org&os=winwjre&lang=en-US&version=3.1.0