Give Up with Raw Printing on Linux


It is good to post my newest blog today, after 4 days hard researched finding a way out how to make raw printing enable in LAN environment from an application built with delphi which running on linux box by crossover 4 pro emulator. Unfortunetely, it seem unsucceded with several ways including using external component such TDXPrint, TRAWPrint and others or with native delphi commands it self such AssignPrn and AssignFile. Those ways has worked fine with windows LAN but nor on linux (the AssignFile work great on single linux machine attached with dot matrix printer by LPT cable). I had been gathering lots of informations from any resources from internet, but there was no responded well yet (click here to track my question).

This problem caused by linux raw printing methodes which definitely differ from windows. Other aspects involved the emulator which has much limitation about handling the win32 api's commands. There was some issues about the latest version of crossover 5, but i am not tried yet. From the log history i've seen, there was no significantly changes about the engine. This is the link of the manual from the crossover developer. So, why I have to bother with the think (the raw printing) that not supported yet?

Anyway, we are completely hi-frustation facing this problem on linux. Next big question is what compiler tools we should use to resolve it? The power builder looks unsustainable against windows raw printing, more over she's doesn’t run on linux by the emulator. What about the PHP? Ahrg... Just forget it. It might take couple years to develop a single modules with hundreds report existing and basically, I am the only web programmer in my team.
Instead of taking much more energy on this fasting month, it will be better if I soon ended this researched. My incoming project will suspended until the company - let's says - using windows as legally and paying for 3 billions per year to micros*ft (;-p). God blessed me.

  Post a Comment

Rp.500 Coins Collector and The Problem

This nonsense article idea was came when my eyes focused in a small bottle contains a hundred of only Rp.500 coins, placed on the corner of my room. Yes, I've collected it since over a year ago from any around places.

There were no particular reasons why I so dumb collecting this stuffs. It just a kind of my unstructured hobbies. However, the total amount of it might reached more than Rp.100.000 by now. Not too bad having this savings.

Anyway, grown it up one by one from time to time needed a hard patiently. While my wife - just as her please - sometime fetching for some necessarities such as buying a full dish of siomay at night. Hik..hik.. And the weird things is, she refuse to shared out the foods with me. What a shame?

  Post a Comment

An Overview About SMS Gateway

While i've been seriously creating a module to support RAW printing procedure from Delphi running on LINUX box, let me explain a short overview about an SMS gateway engine i used to made. This parts has been often patched to build my existing SMS service application projects before.

What you need is knowledges about:
1. Linux (including syslog handling)
2. GSM modem
3. SMS daemon
4. PHP script
5. BASH shell script
6. C++ and SQL logging (for some cases)

Linux is the best environment ever to have a SMS gateway, in my opinion. It's stability, flexibility and powerfully console can't defeated by others operating systems. I used to installed Mandrake 8.2 to my prior projects for some reasons, such as user-friendly and low hardware requirements aspect.



Modem GSM is a part of hardware primarily targeted to code to. There were lots of products available but you have to watched carefully to their backwards compatibility. I always used a GSM modem TC35 series made by Siemens. It has no problems at all as long as I had used to. If you doesn't have any GSM modem, just replace it's functionality with Siemens cellular phone. I oftenly tested with x45 series with RS233 connectivity (such a SL45i or C45).

Next topic focused to SMS daemon it self. SMS daemon provide transactions API layer about sending, receiving and retrieving information from or to both sender and receiver. There were thousands SMS engines available on the internet. You have to selectively picking up the right choice. A good one engines has their support to provide an easy way connecting to the databases, inspite of the installation, stability, scripting and system supports. The more compatibilities to any GSM modem hardwares, the more grade it reached.

The SMS daemon I used to, supporting natively with PHP and BASH scripts. It makes more dynamics from it composition. This example below contains general operations regarding to SMS gateway development:

#!/bin/sh
#run this script only when a message was received.
if [[ "$1" != "RECEIVED" ]]; then exit; fi;

#Define the database parameters
SQL_HOST=localhost
SQL_USER=root
SQL_PASSWORD=
SQL_DATABASE=smsd
SQL_TABLE=demo

#Extract data from the SMS file
FROM=`formail -zx From: < $2` TEXT=`formail -I "" <$2 | sed -e"1d"`

#Set some SQL parameters
if [[ "$SQL_PASSWORD" != "" ]]; then SQL_ARGS="-p $SQL_PASSWORD"; else SQL_ARGS=""; fi SQL_ARGS="-h $SQL_HOST -u $SQL_USER $SQL_ARGS -D $SQL_DATABASE -s -e"

#Do the SQL Query
AMOUNT=`mysql $SQL_ARGS "select amount from $SQL_TABLE where msisdn=\"$FROM\" and password=\"$TEXT\" ;"`

#Create an answer SM with the amount
FILENAME=`mktemp /var/spool/sms/outgoing/answerXXXXXX` echo "To: $FROM" >$FILENAME
echo "" >> $FILENAME
echo "Your amount is $AMOUNT" >>$FILENAME
You see that there were SQL logging routines and internal command system executed by BASH scripts. For more expertise of use, you can combined to execute another binary right away you need to. This sample below is a routine to controlling electronics equipment on and off by SMS command (written in C++ and compiled with GCC, application is available and ready to modify as my prior project called “MIKROCERDAS” developed on 2004)

#include
#include
#include
#include

#define BASEPORT 0x378

int main() {

if (ioperm(BASEPORT,1,1)) {
perror("ioperm");
exit(1);
}

outb(0x80,BASEPORT);
usleep(100000);

if (ioperm(BASEPORT,1,0)) {
perror("ioperm");
exit(0);
}
}
Do you remember the announcement of my pre-project named SIAGA (Sistem Informasi Awas GempA)? Above is the secret how to develop the system. Any suggestion and question due to this article are widely acceptable.

  Post a Comment

Temporary Summary : TDXPrint, TRAWPrint, AssignPrn has Failed

How glad to see my family again, especially meet my dearest baby. I've been missed him so much. I had arrived at jakarta this morning after a night long travelling with taksaka (an express train from yogyakarta to jakarta). As like ussual, i also bought gifts for my closest neighbours. It was a kind of typical yogyakarta snacks called bakpia.

Anyway, the resume of the courses yesterday was not very well satisfied, it is my opinion. A primary problem has not solved, raw printing operation has failed to do. The TDXPrint component it self is not compatible to linux since it using win32 API layer which not yet supported by the emulator (crossover) on linux. Others component named TRAWPrint also did the same thing. Another native delphi function command - "assignprn" - was clearly failed too. This condition makes me hi-frustation.

It will need more self-research on the next day to find a way how to raw printing from delphi. Now, what i need is a day-long sleeps.

  Post a Comment

Yogyakarta: Day 5

Yes, it is my last day in this city. I've got to leave it next on the afternoon. Nevertheless, the problem of the courses due to printing operation seems become a big matter yesterday. The trainer looked-like misunderstanding with our this one request. And my guessed was right about him.

The problem it self came since the delphi still unable to do raw-printing as the same as DOS application (such as clipper or pascal) which directly terminated the printing operation when last character printed out (not scrolling the pages like common win32 application did).

He assumed that pages which printed out was typically line based visual layout. But the fact is not just simply as his tought. Our existing reports used in branches is unique in it visual layout. In my opinion, ideally for the faster edit & better result, it might using kind like a TQuickReport component which have special printing terminated command.

He offered an add-in component named TDXPrint. While me found a similar one named TRAWPrint. This both components have a great result terminating printing process after reaching at the end of the character. But not working with the TQuickReport report designer. This was shock me up too!.

Meanwhile, the last places i've been visited was center of dagadu t-shirt kiosk and malioboro mall. The both places just for the pleasure time during my exhausted weeks on yogyakarta. See ya in Jakarta...

  Post a Comment

Yogyakarta: Day 4

The saturday night has passed. There were no good places to releases this tired. Imagine that you feels hungry but can’t find any stalls around because you are in the middles of the jungle.

However, I met my old friend last night. He was my partner used to worked together in this city for couple years. All the way somehow, I give him my projects proposals. Just wishing that there might be a better fortunity looking for more money out there.

This got to be the 4th days i've been stayed on this city. Today topics training take a notes of both reports and printing. We are primary waiting for this session, have to see what kind of technics offered by the trainer. Even there are so many tricks accomodating this problem.

  Post a Comment

Yogyakarta: Day 3


Today become my 3rd days training's team. The topics of the day will take parts of some miscellaneous problems regarding to our both database and application schemes. From beginning, we had seriously squeezed the trainer to shared his more knowledges over and over again. This is what he should do equal to what we had paid. It was a damned big money (for this city terms).

Anyway, every night after had a dinner, we always had a meeting, discussed and reviews about what lessons we had get and also collecting more hard problems for tomorrow session. Well, I am saying about 12 hours of heavy-thinking. I'll free my brain at the moments if I can.

Outside above things, mind exhausted had attacked some of the teams - slowly but sure -, just like me. We are planning about leaving the hotel for tonight. It must be bustle of the night when we reached the town center (got to be arround the solo street straight to west until tugu monument and resembling to the south, passing the malioboro regions).

  Post a Comment

Yogyakarta: Day 2

A full day throughout the first training held yesterday had opened my teams insight. They were seriously learned the conceptual of both delphi and the connections to the databases, while me just sit on the back and surf the internet all day long. I thought that they just understanding what is the main differentiation between delphi and power builder instead.

Today, i'm planning about break-in my prototype i've been made before. Just share to the trainner what will have to be done to make it more perfectly.

However, after an exhausted day yesterday, my whole body muscles was irritated - until now precisely. I had swallowed a piece of procold and enervon-c last night, hoped that it fitted this morning. But it didn't. Maybe, what I need is a real massage to recover my tendons. We'll see it later...

  Post a Comment

Yogyakarta: Day 1

First day in yogyakarta and still nothing hard-jobs to do. I was checked-in at hotel at 06.00 am after train arrived at 05.00 am. Probably, this first day training will take an overview sessions.

My friend said that the trainer is a good one graduated from MTI UGM, eventhough I don’t even know his name. So, I am planning about to retrieve some deep informations from him about the kylix scalabilities comparable to delphi.

  Post a Comment

2 Days Research: Delphi Defeated Kylix


My hesitancy about kylix was over. After several days getting deeper with hard-code researched, finally i decided not to use this compiler for my next project in my company.

Why?

1. It was not running well on fedora core 4. The IDE's was hard to see, the fonts looks to creepy and also lots of bugs (hangs every time you want to exit). It is not totally recommended used to developing & deploying an application indeed. Even they said it well, it was a commercial though. I had tested on mandrake 10.0, but it was seems unstable too. I am predicting about the incompatibillity matters with linux, but unfortunately there are no more extra-times to have a linux beauty contest again. We are so running out of time now.

2. Borland as the corporation which producting this compiler has stopped their supports since they feels that millions of bugs resided inside the engines. This statements (from someplace kylix milist users group www i forgot) answered the question, why does the version ended on a number of 3, while delphi still growning up with their latest version (version 8).

3. There are complicated structures of dbexpress standard component about connecting to differ mysql database. In fact, the mysql 3.23.xx was rather supported than others versions. I'm not planning to use any external components since (again) we are really really have not much time to do a selection sessions.

4. The kylix core was built using the same way structures as the wine did (windows emulator) in order to nativelly supporting to win32 api a la linux version (CLX instead of VCL), so we can say that kylix just not more than an emulator. My researches had proven that the kylix cpu's load was more heavier than if we use linux running delphi emulated with crossover. While the database connection speed on linux was slower 50% instead of windows.

Those aspects explained above was done in a extremely short time by my self. Some how it just concluding that it is better to developing an application using delphi rather than kylix.

Anyway, i'll leave jakarta for a week to studying about delphi & kylix more deeper in yogyakarta, precisely placed on the Bugs Training Center. And the trips will started this afternoon.

  Post a Comment

Short Reviews: Age of Empires Pocket PC Edition

Probably, this is my most favorite strategy games ever for my pocket pc. It is so awesome games! It is looked identically with the pc version - except the multiplayer is absent for some reasons -, however the screen is zipped to 320x240 pixel in landscape mode.



I got this for somewhere out there on the internet for a long time ago, moreover the exact address was forgotten. They came with approximately 20mb installation disk. Fully completed both from the video intros, the overviews and the manuals, also the champagne and the scenario included in it.



It was said that the games compatible with ARMS processors and common CE operating system, so it was my device too (HP iPAQ 6365 with Ti OMAP 168 Mhz processors runned Windows CE 4.2/2003) - except it was not expected to run in Windows CE 5.0 -. Overall, it played smoothed with no rough graphics.



I used to play this on my spare time, oftenly simultaneously when the battery been charged. From it started until it ended, ussually takes about 2 hours to win the games. Mostly, it decrease approximately 40% of battery life if the battery is not plugged to the craddle charge.



Moreover, this is a must the games you have. No one games offered more fun than this. Believed me.

  Post a Comment

My Weapon, My Money Maker Machine

Who said that old laptop was useless? My laptop powered by old pentium III 600 Mhz with 128Mb RAM & 20Gb hard drive. It was trademark of Micron inc. I knew that publics don't recognized this brands, but it used to famous name, right on the years I bought it at 2000.

I was bought it new from the computer market in yogyakarta at the price of Rp.8 millions. Until 6 years withstand with my hands, it second-hand price just not more than Rp.1,5 millions. Yes, it is indeed so saddening to hear that.

However, lots of project ordered finished with this old machine. Someway, it was assisted with my others old machine too (look at the pictures below). This desktop I bought at year 1998, functioned as a server now. It is powered by pentium III 800 Mhz, 512Mb RAM & 80Gb hard drive. And LINUX Slackware 8.0 inside of it, stills faithfull to serve me.

At the same year I had laptop, I also bought a Siemens SL45i cellphone. It costs Rp.3 millions at that time. But, since 2002, finally I replace the functionality to become my GSM modem for some projects.

My mobility jobs also helped by 2 flash storage trademark of Kingston. The disk capacity are 128Mb and 1Gb. I liked the brands since its offered special featured to working from pure DOS, inspite of the speed access it self.



Until know, there are more than 40 projects done by this all old machines and it was seriously my money maker machine.

Just in order to complete my communicaton and entertainment life, finally I had bought PDA phone HP 6365 series equipped with 1Gb secure digital card and a PMP (Portable Media Player) from Archos brands name (Gmini 500) with 40Gb storage inside it. It is brings me full entertainment show in my trips go to anywhere, and also full support to blogging activities.

  Post a Comment

What's Wrong with the Telkomsel GPRS Billing Machine?

I had pay the attention for this 2 last blog posts from my pda. I was focused about anomally happened with the Telkomsel GPRS tariffs (SimPATI) since i used it connection to send my posts.

On friday, september 7th - 2 days ago - my posts sized 10kb and it was need Rp.300 to paid. So, the averages per kb was Rp.300 / 10kb = Rp.30/kb.

On saturday, september 8th - a day ago - my posts sized 8kb and it was need Rp.90 to paid. So, the averages per kb was Rp.90 / 8kb = Rp.11,25/kb.

It was weirds since actually the normal cost was Rp.35/kb. He..he.. What's wrong with the Telkomsel billing machine?

  Post a Comment

Kylix, Delphi or PHP? (Part II)

The interesting parts why I prefered to use kylix rather than others is because its "dual" operating system ability supported. You might say, "web based application also multi platform ready". But, the point is, there a huge advantages you can get both from libraries aspects, hardware interrupts, and also supports from the internet if you using kylix. The webs are very highly depending from the internet browsers since its interpretated locally.

Let me explains it one by one:
1. Kylix primarily targeted to linux, while delphi is for windows. However, they both is actually build from the same languages. There will be no problem to implementing it. Just compile kylix code to delphi and you will get a windows applications and so on for the contrary.
2. A highly expansions functionality to develop. I planed to use it since kylix/delphi have their large capability to control the hardware. My idea was integrated the application with queue systems. It just for the future features.
3. Lots of friends you can asks out there on the internet. Many of them had several experiences in delphi/kylix both from databases, hardware interrupts, printing methodes, the win32 API's it self and mores.
4. My team had a good background of visual programming. Although their skills was fine with power builder, I though it was enough to covered the jobs.

Hopefully that my schedules succeded to having the system released for this mission. Sometimes, i'll tell you the secret behind the technology as my planed already. Any comments regarding to this 2 last articles are widely accepted.

  Post a Comment

Kylix, Delphi or PHP? (Part I)

Toward my nearest missions about developing an application in order to supports online data in my company, all the more hesitated thinks grown up more bigger in my minds. The missions it self begin on the next September 14th, signed by our team (me and others 4 peoples) will have a journey to yogyakarta to have "brain storming" about Kylix. My biggest question was, "am I doing right way to choose up kylix as the script compiler?". I used to planed about using this since i've got no choice others than build with it or developing a web based applications such as PHP. Beside, LINUX had decided to choosed officially as the legal operating system used on 800 mores branches spread through all over indonesia.

Anyway, here was a short resume about what was happened in my division - functioned as the center of strategical IT decision maker - due to development of online system.

I am not planning to build by web based application, because of some reasons:
1. I am just the only one in my division who know about PHP programming. So, I don’t want to become a busiest man who develop with my own hands.
2. I am preparing conditions where the online connection will not ready in closest time.
3. The operators is a "sharp-tongued" end users. They want everything exactly at the same time. It is a hard-pleased to announce if sometime the application get some troubles. I mean the quality and computer minded skills is much lower than the banks labors.
4. Due to list #2, there will be posibility hacks sessions if some trouble-maker going to get trough the server since the script stored locally. The connection methode is batch-processes.
5. There will be more time spend out to coding since the notes transaction is not ordinary papers and it have to become identically the same way with DOS application printing - ended at the EOL - such as pascal, clipper, etc.
6. The webs are predictly will running slowly because it consists lots of modules & reports. I am telling about thousands modules, hundreds reports and complicated databases, just likes the old one application.
7. Last but not least, guest what? There will be no appreciation from everyone! Ha..ha.. This is a governmental organization and the appreciation expectation is low. Believe me.

The reason why I choosed kylix will continued to the next episodes. Right now is 02.51 am, I have to get sleep for morning awakening. See ya...

  Post a Comment

God Damned F*cking Insurance!


Imagine that you and your family covered by health insurance. In your think, it aint no worried about what would be happened if someone got sick. Just go to hospital, get a doctor, and waiting for the medicine or maybe have a nice rest in a treatment room if needed. No money will spent! This is an ideal condition likes others think.

What about - in the next couple weeks - you have an incoming insurance bills to pay? You might says "god damned f*cking insurance!". This is my recent problem and let me straight it from the beginning.

My company gave an insurance facilities to the workers since it used to be many many years ago. Something happened at the end of the last year regarding to health cost rising significantly and the officials decided to change the insurance provider to the new ones.

Finally, the beauty contest of it held and a winner had been choosed. Not so long time, the terms from the provider was released (and probably approved by the officials - some dirty officials - because of some tricks).

A few months ago, my son got ills and he had to taked care intensively by stay at hospital for 5 days in 1st class room (as my plan limited to, there were no lowest class since it was already filled). I had no worried at all at that time because everything covered by this b*tch insurance, I though - I also used to called the insurance staffs to reported that I ran my plan higher and they permitted to do so.

Couple days ago, there were came the statements said that I had to pay the debt less (some confused costs since it had no bill lists sent and it was totally different with others details, approximately Rp. 1,2 millions!). The weird things was, it happened not only with me. Some of my friends also received that sh*t "love letter". It was not a matters of the amounts for me, but why? The staff which handled the jobs seems to be unwell responded after I tried to confirmed it. What the hell is going on?

  Post a Comment

Dosemu (pities…), past and present

Dosemu is stands for DOS emulator, it's a kind of virtual machine which emulating the DOS processes. Dosemu had an excellent performance to running 16 bit application compared to others emulator likes qemu. I believed that because I had proven it. The projects it self laid on an international open-source community called sourceforge.

Dosemu used to developed by a team contains 5 members. The one I recognized named Mr. Stas Sergeev. He used to be a senior programmer came from rusia. I often made some contacs with him in order to support my project to transforming DOS application running from windows os to LINUX in my company. I knew him in earlier 2006 from dosemu support millist. You can read some of my question in here.

My last contact with him happened about 2 weeks ago. He told me that he went out from the development team since he had a great polemics with the project manager (I also tried to made a contact with the project manager too regarding about new over coming release programs, but none of an answer replied). His action continued by the other team to moved out from the group. I bet that it had cracked by now. And it supposed that the projects development will died slowly (too bad for me). Nevertheless, the development team currently supported by 3 peoples now.

However, Mr. Stas Sergeev explains about dosemu and the tricks was too important for me. So, this page I dedicated personally to him.

Thanks a lots Mr. Stas Sergeev.

  Post a Comment

The Keyword is Sinergy

Just at a certain time, the minister of state-owned company organization had declared "the sinergy" word in order to strength the (state) finances betweens state-owned companies which have an agreement to work together collectively. This might be a better way to made some more benefits for each of it.

Like the ways my company did, there were also agreements created within others state-owned companies. In fact, still there is no real action to do until know (perhaps, they could be sleeped after had a long...long...deep studies).

Last week, telkom had sent the delegations to meet my company officials including both directors it self due to sinergy mission. They offered wide signal network coverages which can be use to transmitting our data by online way (technically called VPN dial). However, each meetings finished with "yes, we agree, sir!" word, nor what would be happened until we know how much we pay for that (it must be damn-big money will sacrified).

It is true that we have to comprehensively analyze whether the telkom sinergy is relevance or not both from the technology and finance. At least, it is equal with the future company target: "ONLINE DATA".

(Any opinions widely accepted)

  Post a Comment

Storing Files in a Database

A new featured module has been added into my corporate site. It called "Arsip Digital" and laid on left side of profiles page. The "Arsip Digital" functioned as a storage groups of decision letters and revolver letters (SK & SE). It was designed & programmed by my self since it was requested after last meeting with the officials.

The "Arsip Digital" is a kind of electronic document (e-doc) stored on a web server - specificly saved in a database row. Some people might says as a digital archieves.

The e-doc technology can create paperless methode in companies and significantly reducing the budget spend of both papers, inks, duplicates and conventional mails. You can retrieved the archieves whereever and whenever you are as long as you have connected to the internet.

What is the secret behind the e-doc? Well, it is so simple. I used to take profit from the existence of BLOB (Binary Large OBject) data types. Have a clearly see an PHP example below:

$get_image = "your SQL query";
$get_image_result = @mysql_query($get_image) or die("Couldn't get image.");

$binary_file = @mysql_result($get_image_result,0,'BLOB_field");
$type_file = @mysql_result($get_image_result,0,"type_file");

header("Content-Type: application/$type_file");
header("Content-Length: ".filesize($binary_file));
header("Content-Disposition:attachment;filename=$nama_file");
echo "$binary_file";

The script above is the core process of how to retrieve the data stored on a BLOB types. Don’t forget to manually add some encrypt decrypt funtions to secure your code. Any questions?

  Post a Comment

Pawn Exchange, What it Would Be?

An innovative product has been planned to launched in my company. It called Pawn Exchange. I dont know exactly what kind of the flows was, but they very optimisticly to rising it.

Anyway, the local blue chip stocks become primary target of the works since it having a good chance to collecting more profits. As they planned, the branches will be opened in each regional offices to keep wide coverage network customers while in the heads become center of consolidation and also accepting the transactions it self.

It is opposites with my thinking that this product have a good prospect in the future. They just loosed one key, there were no persons dedicated had a real experiences with the stocks. All resources came from books, literatures and peoples explanation. So, the fact was they too teoriticly - it is about a great gambling project shows - and they did not had more deeper analyze about the tricks.

What it would be?

  Post a Comment