29 December 2004

MMORPG the Open Source Way

Building MMORPGs, testing it and publishing it in the shortest possible time is always a game developer's path-to-bliss. Ever have that burned-out feeling after building a game or anything for years you even came short of player's or user's expectations? Absolutely frustrating.

In the Open Source development community at least there is NeL aka Nevrax Library. NeL is toolkit for building massively online universes both for client and server. Massively and Online, those are the keywords. I am proud that Philippines at least has published one RPG but it's really short of "Massively" and "Online" but as far as I can remember, this game was written for two years. Hopefully, in next few months there will be competition there will now be games written locally that is both "Massive" and "Online" role playing games. Some will use NeL and some will do better and wiser to use additional toolkits like Crazy Eddie's GUI. Some will stick to auld ways and die a natural "build-from-scratch-die-to-scratch" death.

With The NevRax Library and Crazy Eddie's GUI, local game development with will be more exciting and interesting, even cutting down development time dramatically which is the whole point. The faster you hit the market, the bigger the profits. Imagine developing more campaigns whether it's historical, fictional or "conspiracy-theoretical" or even almost anything.

22 December 2004

My Favorite Headache

I love that phrase ("My Favorite Headache"), it's akin to "It's a nice-to-have problem". These are the times when opportunities came and you only have two hands to catch them and that's "My Favorite Headache" or "It's a nice-to-have Problem". Those thing you've been wishing for and all of a sudden when it's about to come, you're not ready for it. :))


It was year 1975 when Rush's drummer Neil Peat introduced to the rocking world the double bass pedal technique and surprisingly the rockers' world was not ready for it and the new type rock music is about to unleash called Progressive Rock. Only around 18 years later did Neil's technique saw its appreciation and this time "The World" is ready. Listening to their music today by an uninitiated ear, one can think it's written just a few days ago and wondering why is it not on top of the hits. Rush's music with it's progressiveness is timeless. They might or might not know it. Try listening "Dreamline", that song is more that 10 years old and still sounds like it should be in the playlist of NU107 every week. And only one of the Pinoy Bands where I requested to play it actually DID play it and that is The Dawn with the late Teddy Diaz and no one else dared, though Jet Pangan's voice was not as high-pitched as Geddy Lee.


Rush, in many forms, has been my catalyst or inspiration in doing things. Has there been a Progressive Programming? Progressive Software Engineering? Progressive Software Development? Progressive Design Patterns? Where techniques are timeless or ahead of its time that almost creates an illusion of permanence or non-obsolescence? Truly there is none...yet.

Codename: CatEye

One of the R & D projects that I am looking forward to get an investment from is codenamed CatEye. CatEye is envisioned to be a low-cost implementation similar to CCTV surveillance camera systems for close-in room observations. These system uses Wireless-B Internet Video Camera. It's uses is mainly for closed-in public places where crowds usually line up or wait such as bank's main reception to the teller's station, ticket booths, train turnstiles, public-receiving offices, small shops, fast-food counters, hotel concierge, hallways and other spots where to-be-offenders can be pictured vividly unnoticed in the closest possible distance without the aid of expensive zoom lens.

CatEye can be more cost-effective than posting a guard that tend to neglect its duties and has the lesser risk to endanger human life. However, CatEye is not suitable to be placed in a wide-angle area such as airport lounges, malls or parking lots due to hardware limitations. Basically, the hardware requirements for CatEye is already available in the market, It is the software that needs to be developed in order to make close-in surveillance possible. The system is intended to be written in pure Java language using the Java Media Framework as part of the core system.

See the initial drawing below:

Click Here

21 December 2004

Risk Minimizers: Identity Management etc.

Last time I posted about iCafe security. I am currently designing a framework to be core for such system. The framework allows multiple "eye" view from one, single screen instead of multiple screens which is too costly and uses a Wireless-B Internet Video Camera that costs around $120 compared to a bulkier more expensive CCTV camera. With a 43" video monitor this is an ideal security killer application.



Another ideal risk minimizer is called Identity Management. Well, it's actually what we know before as Triple A(Authentication, Authorization and Accounting). So what's the big deal? According to IDC, Identity Management market will grow from US$150,000,000 to $300,000,000 in 2007 in the Asia-Pacific region. It's complicated yet it's simple. And the good news is, the ingredients are here and very cheap and all we need is to cook it.

Gaming

I was unable to write a few days because I am back to my natural addiction, gaming. Well, I am reviewing this Squad-base thingy called Delta Force Black Hawk Down, being born from the land of natural warriors I could say the game is too easy. I could finish 5 to 7 missions without saving a segment. The game allows me to lead a few nervous, paranoid, shaky Delta Ops in the virtual urban battlefield of Mogadishu. In fairness, the weapons are awesome but killing the pixelized Somalis are just a walk in the park their AI is stupid and so is my squad that sometimes I need to shove or shoot them off the alley to avoid a Fatal Funnel that will wipe out my whole squad. These Delta Assholes won't recognize my TACOPS sign language and want me to always lead the way without covering my six, nasty freeloaders.

16 December 2004

Open source SS7 for Java Implementation

I have been sporadically receiving requests for observer status on the SS74J project. I am really, really sorry that I can't accept any requests right now due to some other priorities but the SS7 for Java will move to the development stage pretty soon. I know how important SS7 to some of you(that is money in the name of international roaming). Rest assured that I'll be taking care of this project once other more salient things has been accomplished. Thanks for the patronage. :)

09 December 2004

Haaay!!!

DynamicBeans has been patiently grinding for one year. Just enough capital and I'll give up my day job for good. But how much capital is enough? I think PHP1M will do or even PHP.5M is just enough to start the ball rolling by itself in 6 months, get me glued to my PC for 3 fucking months to get all my stuff off to market and 3 months of aggressive pitching and that's it. We're loose on the homestretch!

Screw the VCs

It has been learned that VCs(Venture Capital) are not the recommended source of initial funding especially for a high-tech startup. It's tedious, I am only good in explaining profitability in technical terms not in business terms because I am not a salesman, I can't sell refrigerators to eskimos. I don't care but I know what's going on in the competition, that's how competent this business is. I can give elevator pitch but I will need an expert on the formal business plan. I have repeatedly kicked the asses of the "Big Boys" in the bid for gigs though my services are not cheap as well, but that's not what I want to do on a regular basis. So I guess I have to dig up my own seed funding and let the VCs come in later.

Clarity

A very important part of setting goals is clarity. Endurance and clarity goes side by side, because as we go along the way, the direction to our objective is not always straight. Therefore we have to endure the twists and turns in order to maintain clarity. What is clear today? Release *THAT*. Who is the enemy? Time is the enemy. The goal is clear but time is not on our side of the fence, so it's a sorry state to be in an ass-dragging situation. Endurance is the ally.

Graduation

My exit strategy: bring DynamicBeans as far as being publicly held or traded I don't care where, I'll be happy to let the board kick me out so I can write code in a more poetic sense :) and spend Monday mornings playing guitar, biking or whatever I like. Spin off new gigs; game dev and computer graphics animation. Finally, I will stand back and watch them all in action.

Shit, I hope it rains money(in bundled P1000 bills) just for 10 seconds. :))



Deterring burglary in iCafes

Internet Cafes and Game Shops are one of the most profitable small businesses here in the Philippines. This business almost runs by itself, but of course, just like other businesses it has its own share of problems. One of the shop owners' worries is burglary. So what can a burglar take in an iCafe given that he has the biggest pot in his lifetime? Everything! But for those with uncanny stealthiness; memory modules, webcams, optical pointing devices, headphones, usb hubs are the most attractive giveaways. To some this is small time, but if the owner keeps on losing those stuff on an almost regular basis, he has an obvious business risk right under his nose, a losing business risk.

As a solution, a solution?!? There's no solution to this kind of problem. But deterrence will put this risk at the minimum tolerable level. So what kind of deterrent is the best? Depends on the size of the shop and the number of people of coming in at a given time. One example of a deterrent is a security camera and perhaps the cheapest deterrent in the short or long run. Security cams are useful regardless of the size of the shop being operated, whether it's a simple setup with 10 workstations or a maze of 30-50 workstations. Depending on the owner's budget, the whole area can be covered with enough security cams to shoot a "bullet-time" scene or corner-to-corner coverage.

CCTV or Webcam? Believe it or not, some webcams especially the most expensive ones shoots better than a CCTV camera that is more than twice the price and very cumbersome to install. One of which is (no plugging intended) the Logitech QuickCam Pro 4000, this cam has a very good zoom in and out feature. So how do you install a CCTV-style close-in video surveillance system using everything needed that is available at any PC store? That's what I am going to talk about privately if the reader wants more information.

So how this will help shop owners deter burglary? The purpose of video surveillance in iCafes is no different in other type of shops, to get the bastard red-handed or if he gets away, he can't get away far enough. Now with a circumstantial evidence at hand, reporting or blottering incidences of burglary would help law enforcement agencies solve the case quickly. The webcam-based CCTV-style video surveillance system can also do wonders in aiding real-time emergency response to address larger and more insidious situations. But that is a bigger picture ;)

08 December 2004

Something that should be posted in most pinoy corporate developer's ass

People's Action Rules:
(1) Some people who can, shouldn't.
(2) Some people who should, won't.
(3) Some people who shouldn't, will.
(4) Some people who can't, will try, regardless.
(5) Some people who shouldn't, but try, will then blame others.

07 December 2004

GeekSpeak

LOL! I just learned a new buzzword from Hani today.

DEUGLIFIED(pronounced: de-ugly-fied)

My own meaning: Beautified something, like using Jalopy to beautify your ugly Java code.

e.g.

CHANGELOG

Deuglified the module-one using a code prettifier
Deuglified the original writer's face including his code-writing

06 December 2004

Executing native system commands with Java Native Interface.

As an alternative to the Java Runtime API, I would like to share another technique of performing native system calls from a Java program. This technique uses the Java Native Interface(JNI) which makes it possible for Java to communicate with platform-specific native libraries such as shared objects(.so) in Unix/Linux and dynamic-link libraries(DLL) in Windows. The advantage of using this technique is that native commands are passed using strings as if it is being entered into the commandline instead of instead of Runtime API's exec() method which needs some few guessing or trial-and-errors in order to get native system calls from Java working properly.

The only disadvantage for JNI is that this technique is platform-specific, meaning, what works in Linux is not or not guaranteed to work in Windows or any other platforms. Therefore, breaking the Java's concept of Write-Once-Run-Anywhere. So it's always been strongly advised that this technique should only be performed by experienced developers.

Let's start with a scenario in which there's a requirement for a Java program to execute an external native program that is written in C, The command that we are going to send to the native environment is "hostname --ip-address" this is a Linux command that retrieves the ip-address from /etc/hosts file if configured properly.

First, let's define the header file for the C program that will actually perform the native system call.

Listing 1: RunExternal.h



#include <stdio.h>
#include <string.h>



#ifndef __RUN_EXTERNAL_H
#define __RUN_EXTERNAL_H


// input:
// buffer = storage for output of external script
// sizeOfBuffer = sizeof(buffer), for max length checking..
// cmdstring = command / script to be executed
// output:
// ptr to buffer for success
// NULL for error
char *RunExternalScript(char *buffer, int sizeOfBuffer, const char *cmdstring);

#endif




Next, we will create the implementation code for RunExternal.h file.

Listing 2: RunExternal.c



#include <stdio.h>
#include <string.h>
#include "RunExternal.h"

// input:
// buffer = storage for output of external script
// sizeOfBuffer = sizeof(buffer), for max length checking..
// cmdstring = command / script to be executed
// output:
// ptr to buffer for success
// NULL for error
char *RunExternalScript(char *buffer, int sizeOfBuffer, const char *cmdstring)
{
FILE *fp;
char tmp[1024];
int buffer_length;
int tmp_length;

// do a fork(), exec(cmdstring), get a stdio file ptr (read-mode)
if (!(fp=popen(cmdstring, "r")))
{
fprintf(stderr, "Error in opening pipe for %s\n", cmdstring);
return NULL;
}

// initialize buffer = ""
buffer[0]=0;

while (!feof(fp))
{
// exit loop if NULL is read .. usually at EOF.
if (!fgets(tmp, sizeof(tmp), fp))
{
break;
}

// check for buffer overflow
buffer_length=strlen(buffer);
tmp_length=strlen(tmp);

// printf("debug: L=(%d, %d)appending tmp=<%s> to buffer=<%s>\n", buffer_length, tmp_length, tmp, buffer);

if ((buffer_length + tmp_length) >= sizeOfBuffer)
{
fprintf(stderr, "Buffer overflow.\n");
pclose(fp);
return NULL;
}

// append output to buffer, including newlines and other characters retrieved..
strcat(buffer, tmp);
}
pclose(fp);

return buffer;
}






Now that we have written the implementation the program that will call any native programs, let's build the JNI bridge by creating a native-aware class.

Listing 3: NativeCommander.java



/**
*
* Created Dec 6, 2004 9:15:39 AM
* @author Jared Odulio
*
* Description:
* This classes will perform native system calls that will act as a
* helper for CORBA servants too.
*
*
*/
public class NativeCommander {

static{
System.loadLibrary("runner");
}
/**
*
*/
public NativeCommander() {
super();
// TODO Auto-generated constructor stub
}

/**
* The entry point of native call from the Java side.
* @param cmdString the command string to be passed.
* @return the string result of the execution.
*/
public native String runCommand(String cmdString);

}



Before generating a JNI header file that above code must be compiled first, just simply do this command:



javah -jni NativeCommander.java



After compiling, a header file (.h) will be generated with the name net_smart_smspro_jni_NativeCommander.h that looks like this:

Listing 4: net_smart_smspro_jni_NativeCommander.h



/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class net_smart_smspro_jni_NativeCommander */

#ifndef _Included_net_smart_smspro_jni_NativeCommander
#define _Included_net_smart_smspro_jni_NativeCommander
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: net_smart_smspro_jni_NativeCommander
* Method: runCommand
* Signature: (Ljava/lang/String;)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_net_smart_smspro_jni_NativeCommander_runCommand
(JNIEnv *, jobject, jstring);

#ifdef __cplusplus
}
#endif
#endif




Java provides a logical way of mapping its data type to the target native data type see Mapping Between Java and Native Types for more details. Notice that jstring return type and a jstring argument has been included in the header file generation.

The next step is the implementation of the JNI-generated header file that includes the usage of the RunExternal.h implementation as well.

Listing 5: NativeCmdr.c



/*
* Created Dec. 6, 2004
* Author: Jared Odulio
*
* Description:
*
* Implementation module use to run native system calls for Java programs.
*
*/

#include <jni.h>
#include <stdio.h>
#include <stdlib.h>
#include "RunExternal.h"
#include "net_smart_smspro_jni_NativeCommander.h"

JNIEXPORT jstring JNICALL Java_net_smart_smspro_jni_NativeCommander_runCommand
(JNIEnv *env, jobject obj, jstring cmd){

char buffer[8196];
char *exec;
char result[8196];
jstring retval;

const char *cmdstring = (*env)->GetStringUTFChars(env, cmd, 0);
exec = RunExternalScript(buffer, sizeof(buffer), cmdstring);
strcpy(result, exec);
(*env)->ReleaseStringUTFChars(env, cmd, cmdstring);
retval = (*env)->NewStringUTF(env, result);

return retval;

}




In the code above is the code that provides inter-communication between Java and a C program. We are almost complete and the next procedure is to compile the C programs to a shared object in order for the Java to access it. To compile in Linux see listing below:

gcc -I/opt/j2sdk1.4.2_04/include/ -I/opt/j2sdk1.4.2_04/include/linux/ *.c -o librunner.so -shared

In Linux, in order for Java's System.loadLibrary(String lib) to actually load, naming conventions has to be followed, a shared object should have "lib" as prefix and ".so" as extension. In this case, "runner" is the name of our library. The "-I" option is a flag indicating the include directories to be used by this compilation in addition to the include directories that has been defined within the native environment.

Finally, we have now our librunner.so compiled, we need to create a main Java program to test our native system calls.

Listing 6: MainJNI.java




public class MainJNI{

public static void main(String[] args){

NativeCommander nc = new NativeCommander();
//issue of the native command here are more straightfoward than Runtime API
String results = nc.runCommand("hostname --ip-address");
System.out.println("What I got: " + results);

}
}



Let's compile this class:

javac MainJNI.java

And then let's execute this class:

java -Djava.library.path=<LIB_DIR> MainJNI

where LIB_DIR is where the compile .so file is located.

If everything is done properly, a result will be displayed something like:


What I got: 127.0.0.1

or an actual IP address defined in the /etc/hosts.

This is one of the simple ways of unleashing the power of JNI, other stuff can include manipulating microcontrollers, industrial instrumentations, extending MSF COM APIs to be used for Java applications and the rest is in your imagination.


04 December 2004

Visual Editors still sucks

I have watching the progress of different visual editors such as Jigloo, Visual Editor for Eclipse and SWTBuilder and still frustrates me to find that these tools still generates crappy codes. One example is that when I start to create a class that will be a main SWT window, which means it has to extend JFace's ApplicationWindow class these tools fell short of automating this simple task.

Right now, I still contented with hand-coding all my visual components from frames to buttons in this way I have more control on my codes.

03 December 2004

The Devil's Dictionary

This stuff was written 1881, the guy who conceptualized this is truly ahead of his time. Truly high-tech. :))

Here's a few of my favorite entries:

ALLIANCE, n.
In international politics, the union of two thieves who have their hands so deeply inserted in each other's pockets that they cannot separately plunder a third.

BORE, n.
A person who talks when you wish him to listen.

CONGRATULATION, n.
The civility of envy.

asteeg di ba?




02 December 2004

Move away "flat" Windows, Looking Glass is here...

I know there are people who would still prefer command line over GUIs for whatever lame excuse they have. But for now may I ask you to bury your head inside your asses for a while because definitely this stuff will blow away what's left between your ears.

After several days for ignoring the hype that is the Project Looking Glass, I gave myself a favor to start reading an article about it. Although my GUI skills, I might say not yet in the "advanced" level, I found the LG3D to be a "breakthrough" open source GUI project and will be the preferred environment for user interaction in the years to come.

LG3D from how I see it is not intended to be simple therefore it's not for the developers who do not have the patience of Job. But what are the applications that will benefit from this new level of visual interaction? Primarily, it can be used to enhance customer experience when browsing a mall navigation system thru its SceneManager API, Access control systems that uses contactless cards or biometric scans, wearables and many more.

Fortunately, the project is open source so I really don't know how MS will going to keep the pace with it.

So what's next for Anito?

Congrats! After surviving a year after release! So what's the next plan for Anito?

Here's a few of my takes:

Title: "Anito: The Wrath of Senastille"
Genre: RTS-RPG ala Warcraft 3 with Land and Naval Battles.

Synopsis: It's simple, you're the commander of the Senastille forces whose mission is to extend Western culture and civilization for every parcel of land you conquer within Maroka by building towns, churches, farms, barracks etc. etc. in order to accomplish this you have to enslave local peasants to work for you which you will win the ire of the elite locals until a bloody conflict enrage.


New Creatures: The Manananggal, not old and grumpy but voluptous and sexy like Maya. The Tiyanaks that can viciously attack in groups but can easily be killed in singles.

New Characters: The Senastille Monk(Fraile) that has the power to perform miracles and magic. The Senastille Scout(Explorador) an used mainly for clearing the "fog-of-war". The Senastille Lance Infantry(Lancear; lance-ar) the cheapest military unit that can be mobilized to ravage a native village. The Senastille Cavalry(Cavallero) which is a heavily armored fierce mounted warrior. The Arqueros(Archers) essential for defending towns and covering the Lancears during assault. The Artillero(Gunners) mans the gun batteries

New Equipment: Corvette, a small boat that can be launched from a Galleon that can carry troops inland. The corvette can only be launched at an specific intervals, and a corvette upgrade is required.



Just a few suggestions, hehehe may be the title could be "Anito: The Opposing Force" :))

01 December 2004

I am an OGG

You are .ogg Even though many people consider you cool and happening, a lot still find that you're a bit too weird to hang out with.
Which File Extension are You?




So what kind of file extension are you?

Software Developers, 16th Century Masons; Superior Skills, What's not to like?

Software developers just like the 16th Century Masons, are craftsmen. But the latter has Lodges which serves as workshop and store where they keep tools and interacts with other craftsmen to sharpen and improve their skills in effect they were able to build massive structures that lasted for centuries. Obviously, they were preferred by kings, nobles and churchmen to build their castles, town halls, colleges and cathedrals which made them influential and essentially wealthy. As a result, their organization became attractive to non-craftsmen or non-operatives such as lawmakers, businessmen, military officials etc. who has no direct business with masonry. Contrary to software developers, 16th Century Masons don't have a systematic way of training, they obtained their skills from their fathers, journeymen, peers or other resources while software developers obtain theirs during college or in a vocational training. But within the context of building high-quality structures, masons have higher success rates than software developers building supposedly high-quality applications.

The "medieval guilds" and the "users' groups" in principle, functions similarly except that the latter is more of a "speculative" in nature rather than "operative". Why is it so? because the early "medieval guilds" work on really serious projects and not just discuss and debate stuff putting their skills at its finest. Only the rich and powerful can afford the services of a mason because his craft is always stunningly marvelous.

Since the "users' groups" of today has never churned out high-quality crafted applications they failed to influence and failed to win the respect of the CTOs and CIOs who are the "rich and powerful" in the area of software development craft. But time will come that the focus is not solely in building better software but building better software developers.