1

GXT Paging Row Number

I got problem to display the row number for the paging grid.
The value always start from 1 to the end of row in the grid.
After trying several methods (actually several frustrated hours), finally I found the soultion.
It's very simple and I don't believe, why I not think of this before.

Here is the code

final RowNumberer rn = new RowNumberer();
rn.setWidth(30);
rn.setRenderer(new GridCellRenderer() {

public Object render(ModelData model, String property, ColumnData config, int rowIndex, int colIndex, ListStore store, Grid grid) {
int offset = 0;
if (store.getLoadConfig().get("offset") != null) {
offset = Integer.parseInt(store.getLoadConfig().get("offset").toString());
}
return offset + rowIndex + 1;
}
});
0

GWT - PHP on Apache 2nd Review

My latest project doesn't let quercus running on glassfish. I need to to remove quercus before the project can be deployed.

Finally I found a new way to enable data transfer from GWT application on GlassFish Server to Apache Web Server. The solution is simpler. No querchos and curl php script required.

How it can be possible?

Let say the Apache is running on port 80 and glassfish is running on port 8080.
Let say your GWT project is in /web1 folder on glassfish.
Let say your PHP project in in /web1 folder on Apache.

First you need to set Apache proxy settings. You might need to install the module if you don't have one on your Apache.

Open the apache httpd.conf file and add the following lines

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so

Order deny,allow
Allow from all


ProxyRequests on
ProxyPreserveHost on

ProxyPass /web2 http://localhost:8080/web1/
ProxyPassReverse /web2 http://localhost:8080/web1/


using the setting your GWT project can be access using this following URL

http://localhost/web2

In your GWT project the data can be access using http://localhost/web1. Now it's on the same domain with your GWT project on http://localhost/web2. You can access to any php script on your Apache from GWT without creating any proxy servlet or curl script.
0

Working with Zebra RW420

Bulan lepas aku buat program untuk project MEPA, untuk print resit guna Zebra Rw420 melalui bluetooth. Printer banyak org pakai untuk portable billing macam TNB, SYABAS dan yang seaktu dengannya. Sebenarnya, printer tu jadi serial port je. Jadi kena buat serial port programming la untuk hantar data ke printer.

Cara mudah nak pakainya macam ni.

  1. Untuk design resit, boleh guna label vista. Program ni datang sekali dengan printer ni.
  2. Untuk grafik, font yang x standard, kena upload ke printer terlebih dahulu sebelum boleh pakai.
  3. Lepas tu, untuk text just guna mana tag untuk replace tag tu nanti dengan value yang sebenar. Sebagai contoh {$tarikh}.
  4. Save file projek label vista tu. Sebenarnya fail project tu dia simpan dalam format CPL.
  5. Untuk program serial port, just read file template tu, replace string tag tu dengan value-value yang sepatutunya dan send ke serial port.
  6. Serial port perlu dibuka sepanjang process printing. Kalau close, printer x akan print resit. Sementara nak tunggu tu, boleh baca status printer busy , paper status dan sebagainya.
  7. Dah siap print, baru la tutup serial port.
0

DeepSea Obfuscator

Aku nk obfuscate kod automatik bila aku compile projek.
Setakat yang aku try, aku jumpa DeepSea Obfuscator dan aku rasa agak menarik untuk dicuba.

Boleh pakai secara external atau integrate terus dengan .NET 2005/2010.
Senang je nak pakai, since just set config atau load config guna software dia dan load balik masa compile.

Untuk ILmerge aku dah pakai script lain masa post-build.
Jadi aku boleh automatekan code merge & obfuscate semasa build time.

url : http://www.deepseaobfuscator.com/home.aspx
0

Using ILMerge in a post build step

Reference : http://geekswithblogs.net/mapfel/archive/2008/11/01/126469.aspx

I want automate the ILMerge process on build time.
I found this article and it works for me with minimal modification.

This is my ilmerge.bat file content

ECHO parameter=%1
CD %1
D:
COPY testLib.dll temp.dll
"C:\Program Files\Microsoft\ILMerge\ILMerge.exe" /out:testlib2.dll testLib.dll VL.dll
DEL temp.dll


on project configuration, build event just add below text in post-build event

"$(TargetDir)ILMerge.bat" "$(TargetDir)"
0

Couldn't open outlook Windows

My boss asked me, why his outlook couldn't be started and keep giving the error message "Couldn't open outlook Windows". Luckily I found the solution on google.
  1. Just open the start menu dan type outlook /resetnavpane on the run command text box.
  2. If you could'nt find the run command text box, just simply press the Windows button and R button simultaneously.
Now he can start the outlook dan running faster than ever.
1

Lighttpd PHP File Upload - Error 413 request entity is too large

I'm having problem with PHP File upload running on lighttpd web server deployed on my VortexSX86. Lighttpd keep giving me the 413 error message ( 413 request entity is tool large)

Open /etc/lighttd/lighttpd.conf change the following parameters :
server.max-request-size=100000000     # or whatever you want max file size to be
server.upload-dirs=( "/mnt" ) # location to place the uploaded file
# probably should be the same as php.ini
server.network-backend="write" # this one was the key one for me

if the value of "write" doesn't work, try "writev".

server.network-backend="write" or server.network-backend="writev"
Make sure the upload directory is exist and writable.
Done.
 
Copyright © peyotest