GGP

Juni 14, 2013 at 9:49 am (Uncategorized)

Kami berempat berada di dalam mobil sudah lebih dari dua jam…. gelap malam terasa mencekam dan semakin gelap dengan redupnya lampu penerangan di jalan Tol… Erick menepikan mobilnya karena Bejo sudah tidak tahan buang air kecil… kami tidak tahu daerah itu… semua terlihat samar2 dan gelap… hanya beberapa mobil terlihat melintas dengan kecepatan tinggi…

Kami melanjutkan perjalanan dengan harapan cepat sampai tujuan… jam 11 malam seperti ini benar2 terasa sepi…. tapi canda tawa kami di dalam mobil masih terdengar untuk mengusir bosan…. hingga Aconk berkata… “pada ngerasa gak kalian? kok jalanan nya dari tadi begini terus…. “….

Bejo : “Iya ya… gw juga mau bilang gitu conk… “

Erick : “Ahh enggak lagi… itu ada cewe di pinggir jalan lagi berdiri… berarti kita ada di dekat pemukiman sekarang” (menunjukkan jari tangannya ke pinggir Tol sambil tetap melaju)

Kami sempat merasa tenang sebelum akhirnya tersadar …. mengapa ada seorang wanita berdiri di pinggir jalan Tol…. kami semua terdiam hingga melihat wanita  tadi kembali di depan pinggir jalan kami lagi… tidak ada yang berani menoleh…. tidak ada yang berkata lagi…. semua terdiam…. dan mobil terus melaju

Sejam sudah kami merasa terus selalu berjalan pada jalan yang sama…. tapi wanita itu tidak pernah muncul lagi hingga lampu mobil tiba2 mati … terdengar suara keras dari luar seperti menabrak sesuatu…. Mobil menepi dengan penerangan lampu Tol yang terlihat samar karena kabut…. Lampu mobil kembali menyala namun kami melihat keluar tidak ada apapun tanda2 menabrak…. Ingin rasanya melihat keluar tapi tidak ada yang berani…. akhirnya kami melanjutkan jalan walaupun terlihat di indikator bensin sudah hampir habis….

Erick berkata “kita gak mungkin jalan terus seperti ini di jalan seperti selalu berputar2… bensin sudah mau habis.. gak ada Pompa bensin…”…

Dari jauh berlihat sosok wanita itu lagi di pinggir jalan…. kali ini kami sudah lelah dan penasaran dengan semua ini… kami melihat jelas pada sosok itu… terlihat sangat cantik… sambil tersenyum kecil namun tatapan matanya begitu tajam terus melihat ke arah mobil kami….

Erick menepikan mobilnya kali ini….

Aconk :”Ngapain berhenti rik…. ?? Maju aja terus….”

Erick : “Gak bisa conk…. bensin udah mau habis…. kita terus2an berputar disini…”

Bejo : “ok kita keluar barengan aja gimana….. ?? “

Sosok wanita itu berdiri sekitar 30 meter di belakang mobil… dia hanya berdiri diam sambil melihat ke arah kami…. Kami tetap di dalam mobil selama beberapa menit tapi akhirnya Bejo memutuskan untuk keluar sendirian … Aku Erick dan Aconk masih merasa takut untuk keluar…. tapi setelah Bejo hampir mendekati wanita itu… kami memutuskan untuk ikut turun dan mendekati ….

Sambil berjalan perlahan…. kami melihat Bejo tiba2 terdiam berdiri terpaku di hadapan wanita itu…. kami mempercepat langkah kami hingga akhirnya kamipun berdiri di depan wanita itu…. terlihat di pinggiran Tol sebuah mobil hampir hancur terperosok dan di sekitarnya terbaring jasad kami….

Permalink Tinggalkan sebuah Komentar

locker .Bat

Januari 6, 2013 at 2:18 am (Uncategorized)

http://purkin.wordpress.com/2013/01/02/lock-bat/

Permalink Tinggalkan sebuah Komentar

bila repo belum di update

Februari 4, 2009 at 10:13 am (java, linux ubuntu, tips)

contoh untuk hapus yg lama dan update ke yg baru :

rm -fr ~/.m2/repository/com/sun/xml

rm -fr ~/.m2/repository/com/sun/tools

untuk menghapus bagian xml dan tools

bila tidak di update maka ketika build ada tampilan mirip2 :

[INFO] Scanning for projects…
[INFO] ————————————————————————
[INFO] Building EasywebAdmin-Engine
[INFO]    task-segment: [package]
[INFO] ————————————————————————
Downloading: http://mvn03.src.dev.imocha.com.my/nexus/content/groups/public/com/sun/xml/bind/jaxb-impl/2.0-SNAPSHOT/jaxb-impl-2.0-SNAPSHOT.pom
Downloading: http://mvn03.src.dev.imocha.com.my/nexus/content/groups/public/com.sun.xml.bind/poms/jaxb-impl-2.0-SNAPSHOT.pom
Downloading: http://mvn03.src.dev.imocha.com.my/nexus/content/groups/public/com/sun/xml/bind/jaxb-impl/2.0-SNAPSHOT/jaxb-impl-2.0-SNAPSHOT.pom
Downloading: http://mvn03.src.dev.imocha.com.my/nexus/content/groups/public/com/sun/xml/bind/jaxb-xjc/2.0-SNAPSHOT/jaxb-xjc-2.0-SNAPSHOT.pom
Downloading: http://mvn03.src.dev.imocha.com.my/nexus/content/groups/public/com.sun.xml.bind/poms/jaxb-xjc-2.0-SNAPSHOT.pom
Downloading: http://mvn03.src.dev.imocha.com.my/nexus/content/groups/public/com/sun/xml/bind/jaxb-xjc/2.0-SNAPSHOT/jaxb-xjc-2.0-SNAPSHOT.pom
Downloading: http://mvn03.src.dev.imocha.com.my/nexus/content/groups/public/com/sun/xml/bind/jaxb-impl/2.0-SNAPSHOT/jaxb-impl-2.0-SNAPSHOT.jar
Downloading: http://mvn03.src.dev.imocha.com.my/nexus/content/groups/public/com.sun.xml.bind/jars/jaxb-impl-2.0-SNAPSHOT.jar
Downloading: http://mvn03.src.dev.imocha.com.my/nexus/content/groups/public/com/sun/xml/bind/jaxb-impl/2.0-SNAPSHOT/jaxb-impl-2.0-SNAPSHOT.jar
Downloading: http://mvn03.src.dev.imocha.com.my/nexus/content/groups/public/com/sun/xml/bind/jaxb-xjc/2.0-SNAPSHOT/jaxb-xjc-2.0-SNAPSHOT.jar
Downloading: http://mvn03.src.dev.imocha.com.my/nexus/content/groups/public/com.sun.xml.bind/jars/jaxb-xjc-2.0-SNAPSHOT.jar
Downloading: http://mvn03.src.dev.imocha.com.my/nexus/content/groups/public/com/sun/xml/bind/jaxb-xjc/2.0-SNAPSHOT/jaxb-xjc-2.0-SNAPSHOT.jar
[INFO] ————————————————————————
[ERROR] BUILD ERROR
[INFO] ————————————————————————
[INFO] Failed to resolve artifact.

Missing:
———-
1) com.sun.xml.bind:jaxb-impl:jar:2.0-SNAPSHOT

Try downloading the file manually from the project website.

Then, install it using the command:
mvn install:install-file -DgroupId=com.sun.xml.bind -DartifactId=jaxb-impl -Dversion=2.0-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file

Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=com.sun.xml.bind -DartifactId=jaxb-impl -Dversion=2.0-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

Path to dependency:
1) com.sun.tools.xjc.maven2:maven-jaxb-plugin:maven-plugin:1.0
2) com.sun.xml.bind:jaxb-impl:jar:2.0-SNAPSHOT

2) com.sun.xml.bind:jaxb-xjc:jar:2.0-SNAPSHOT

Try downloading the file manually from the project website.

Then, install it using the command:
mvn install:install-file -DgroupId=com.sun.xml.bind -DartifactId=jaxb-xjc -Dversion=2.0-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file

Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=com.sun.xml.bind -DartifactId=jaxb-xjc -Dversion=2.0-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

Path to dependency:
1) com.sun.tools.xjc.maven2:maven-jaxb-plugin:maven-plugin:1.0
2) com.sun.xml.bind:jaxb-xjc:jar:2.0-SNAPSHOT

———-
2 required artifacts are missing.

for artifact:
com.sun.tools.xjc.maven2:maven-jaxb-plugin:maven-plugin:1.0

from the specified remote repositories:
nexus (http://mvn03.src.dev.imocha.com.my/nexus/content/groups/public)

[INFO] ————————————————————————
[INFO] For more information, run Maven with the -e switch
[INFO] ————————————————————————
[INFO] Total time: 15 seconds
[INFO] Finished at: Wed Feb 04 16:13:59 WIT 2009
[INFO] Final Memory: 8M/98M
[INFO] ————————————————————————

Permalink Tinggalkan sebuah Komentar

awal php install server xampp versi linux

Januari 20, 2009 at 5:15 am (Uncategorized)

su ## login sebagai super user (root)

tar xvfz xampp-linux-1.6.tar.gz -C /opt ## ekstrak lampp ke folder /opt

/opt/lampp/lampp start ## untuk menjalankan lampp

/opt/lampp/lampp php4 ## menjalankan lampp memakai php v4

/opt/lampp/lampp php5 ## menjalankan lampp memakai php v5 /opt/lampp/lampp phpstatus ## melihat status versi php

/opt/lampp/lampp stop ## menghentikan lampp

/opt/lampp/lampp restart ## me-restart (stop-start) lampp

rm -rf /opt/lampp ## meng-uninstall lampp

cp /opt/lampp/lampp /etc/init.d/lampp

# ln -s /etc/init.d/lampp /etc/rc2.d/S86lampp

# ln -s /etc/init.d/lampp /etc/rc3.d/S86lampp

Permalink Tinggalkan sebuah Komentar

pasang log4j

Januari 14, 2009 at 8:02 am (Uncategorized) (, , , , , )

import org.apache.log4j.Logger;

public class aha {
private static final Logger log = Logger.getLogger(aha.class);
private String coba=”percobaan log4j”;
log.info(“LOGNYA:”+coba);
}

untuk keterangan tempat log.. lihat di log4j.properties

Permalink Tinggalkan sebuah Komentar

Converter variable Java

Januari 14, 2009 at 8:01 am (Uncategorized) (, , , , , )

Java – comparing strings

Use == for primitive data types like int

If (mystring == null)

Use the equals() method to compare objects

Use .equals for strings : if (a.equals(“cat”))

Java – Converting int to string

String myString = Integer.toString(my int value)

or

String str = “” + i

Java – Converting String to int

int i = Integer.parseInt(str);

or

int i = Integer.valueOf(str).intValue();

double to String :

String str = Double.toString(i);

long to String :

String str = Long.toString(l);

float to String :

String str = Float.toString(f);

String to double :

double d = Double.valueOf(str).doubleValue();

String to long :

long l = Long.valueOf(str).longValue();

or

long l = Long.parseLong(str);

String to float :

float f = Float.valueOf(str).floatValue();

decimal to binary :

int i = 42;

String binstr = Integer.toBinaryString(i);

decimal to hexadecimal :

int i = 42;

String hexstr = Integer.toString(i, 16);

or

String hexstr = Integer.toHexString(i);

or (with leading zeroes and uppercase)

public class Hex {

public static void main(String args[]){

int i = 42;

System.out.print

(Integer.toHexString( 0x10000 | i).substring(1).toUpperCase());

}

}

hexadecimal (String) to integer :

int i = Integer.valueOf(“B8DA3”, 16).intValue();

or

int i = Integer.parseInt(“B8DA3”, 16);

ASCII code to String

int i = 64;

String aChar = new Character((char)i).toString();

integer to ASCII code (byte)

char c = ‘A’;

int i = (int) c; // i will have the value 65 decimal

integer to boolean

b = (i != 0);

boolean to integer

i = (b)?1:0;

Permalink Tinggalkan sebuah Komentar

ajax laksana VB

November 4, 2008 at 4:40 am (Uncategorized)

http://www.zkoss.org/download/

Permalink Tinggalkan sebuah Komentar

belajar validasi sederhana

November 3, 2008 at 9:30 am (java)

Name : String with a maximum length of 50 characters
Age : Integer between 1 and 120
Email : A valid email address

The sample screen is given below.

sample-validation-screen1.jpg

First we need an action class to display the new customer form.

CustomerNewAction.java – Action class to dispatch to customer data capture form

  1. package validation.action;
  2. import com.opensymphony.xwork2.ActionSupport;
  3. public class CustomerNewAction extends ActionSupport {
  4. public String execute(){
  5. return SUCCESS;
  6. }
  7. }

package validation.action; import com.opensymphony.xwork2.ActionSupport; public class CustomerNewAction extends ActionSupport { public String execute(){ return SUCCESS; } }

customer_new.jsp – Form to capture customer data

  1. <%@ taglib prefix=“s” uri=“/struts-tags” %>
  2. <html>
  3. <head>
  4. <s:head/>
  5. </head>
  6. <body>
  7. <s:form action=“CustomerSaveAction”>
  8. <h2>Enter Customer Details</h2>
  9. <s:textfield label=“Name” name=“name”></s:textfield>
  10. <s:textfield label=“Age” name=“age”></s:textfield>
  11. <s:textfield label=“Email” name=“email”></s:textfield>
  12. <s:submit label=“Save” name=“Save”></s:submit>
  13. </s:form>
  14. </body>
  15. </html>

<%@ taglib prefix=”s” uri=”/struts-tags” %> <html> <head> <s:head/> </head> <body> <s:form action=”CustomerSaveAction”> <h2>Enter Customer Details</h2> <s:textfield label=”Name” name=”name”></s:textfield> <s:textfield label=”Age” name=”age”></s:textfield> <s:textfield label=”Email” name=”email”></s:textfield> <s:submit label=”Save” name=”Save”></s:submit> </s:form> </body> </html>

One important thing to note here is the use of s:head tag. This injects the required stylesheets for error display after validation. The default theme used here is xhtml.

As you can see the input form is submitted to CustomerSaveAction. This will save the data and will dispatch to a page customer_save_success.jsp.

CustomerSaveAction.java – This is responsible for saving customer data. In this example, actual save is not implemented.

  1. package validation.action;
  2. import com.opensymphony.xwork2.ActionSupport;
  3. public class CustomerSaveAction extends ActionSupport {
  4. private String name;
  5. private int age;
  6. private String email;
  7. public String getName() {
  8. return name;
  9. }
  10. public void setName(String name) {
  11. this.name = name;
  12. }
  13. public int getAge() {
  14. return age;
  15. }
  16. public void setAge(int age) {
  17. this.age = age;
  18. }
  19. public String getEmail() {
  20. return email;
  21. }
  22. public void setEmail(String email) {
  23. this.email = email;
  24. }
  25. public String execute(){
  26. return SUCCESS;
  27. }
  28. }

package validation.action; import com.opensymphony.xwork2.ActionSupport; public class CustomerSaveAction extends ActionSupport { private String name; private int age; private String email; public String getName() { return name; } public void setName(String name) { this.name = name; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String execute(){ return SUCCESS; } }

customer_save_success.jsp

  1. <%@ taglib prefix=“s” uri=“/struts-tags” %>
  2. <html>
  3. <head>
  4. </head>
  5. <body>
  6. <h2>Customer information saved successfully</h2>
  7. </body>
  8. </html>

<%@ taglib prefix=”s” uri=”/struts-tags” %> <html> <head> </head> <body> <h2>Customer information saved successfully</h2> </body> </html>

Now we need to apply the declarative validation to CustomerSaveAction. To do that create a file CustomerSaveAction-validation.xml in the same folder which contains CustomerSaveAction.java. In Struts2, validation rules for an action class X is saved in a file X-validation.xml.

CustomerSaveAction-validation.xml

  1. <!DOCTYPE validators PUBLIC “-//OpenSymphony Group//XWork Validator 1.0.2//EN”
  2. http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd&#8221;>
  3. <validators>
  4. <field name=“name”>
  5. <field-validator type=“requiredstring”>
  6. <message>You must enter a value for Name</message>
  7. </field-validator>
  8. <field-validator type=“stringlength”>
  9. <param name=“maxLength”>50</param>
  10. <message>
  11. Name cannot contain more than 50 characters
  12. </message>
  13. </field-validator>
  14. </field>
  15. <field name=“age”>
  16. <field-validator type=“int”>
  17. <param name=“min”>1</param>
  18. <param name=“max”>120</param>
  19. <message>Age must between 1 and 120</message>
  20. </field-validator>
  21. </field>
  22. <field name=“email”>
  23. <field-validator type=“email”>
  24. <message>Please enter a valid email address</message>
  25. </field-validator>
  26. </field>
  27. </validators>

<!DOCTYPE validators PUBLIC “-//OpenSymphony Group//XWork Validator 1.0.2//EN” “http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd”&gt; <validators> <field name=”name”> <field-validator type=”requiredstring”> <message>You must enter a value for Name</message> </field-validator> <field-validator type=”stringlength”> <param name=”maxLength”>50</param> <message> Name cannot contain more than 50 characters </message> </field-validator> </field> <field name=”age”> <field-validator type=”int”> <param name=”min”>1</param> <param name=”max”>120</param> <message>Age must between 1 and 120</message> </field-validator> </field> <field name=”email”> <field-validator type=”email”> <message>Please enter a valid email address</message> </field-validator> </field> </validators>

For more details on each of the validators and their parameters, please see here.

Let us connect everything together using struts.xml. Note the extra result tag (input) for CustomerSaveAction. It indicates the page to be displayed in case of input error.

struts.xml

  1. <?xml version=“1.0” encoding=“UTF-8” ?>
  2. <!DOCTYPE struts PUBLIC
  3. “-//Apache Software Foundation//DTD Struts Configuration 2.0//EN”
  4. http://struts.apache.org/dtds/struts-2.0.dtd&#8221;>
  5. <struts>
  6. <package name=“validation” extends=“struts-default”>
  7. <action name=“CustomerNewAction”
  8. class=“validation.action.CustomerNewAction”>
  9. <result>/validation/customer_new.jsp</result>
  10. </action>
  11. <action name=“CustomerSaveAction”
  12. class=“validation.action.CustomerSaveAction”>
  13. <result name=“input”>/validation/customer_new.jsp</result>
  14. <result>/validation/customer_save_success.jsp</result>
  15. </action>
  16. </package>
  17. </struts>

<?xml version=”1.0″ encoding=”UTF-8″ ?> <!DOCTYPE struts PUBLIC “-//Apache Software Foundation//DTD Struts Configuration 2.0//EN” “http://struts.apache.org/dtds/struts-2.0.dtd”&gt; <struts> <package name=”validation” extends=”struts-default”> <action name=”CustomerNewAction” class=”validation.action.CustomerNewAction”> <result>/validation/customer_new.jsp</result> </action> <action name=”CustomerSaveAction” class=”validation.action.CustomerSaveAction”> <result name=”input”>/validation/customer_new.jsp</result> <result>/validation/customer_save_success.jsp</result> </action> </package> </struts>

web.xml

  1. <?xml version=“1.0” encoding=“UTF-8”?>
  2. <web-app xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance&#8221;
  3. xmlns=http://java.sun.com/xml/ns/javaee&#8221;
  4. xmlns:web=http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&#8221;
  5. xsi:schemaLocation=http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&#8221;
  6. id=“WebApp_ID” version=“2.5”>
  7. <display-name>struts2</display-name>
  8. <filter>
  9. <filter-name>struts2</filter-name>
  10. <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
  11. </filter>
  12. <filter-mapping>
  13. <filter-name>struts2</filter-name>
  14. <url-pattern>/*</url-pattern>
  15. </filter-mapping>
  16. </web-app>

<?xml version=”1.0″ encoding=”UTF-8″?> <web-app xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221; xmlns=”http://java.sun.com/xml/ns/javaee&#8221; xmlns:web=”http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&#8221; xsi:schemaLocation=”http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&#8221; id=”WebApp_ID” version=”2.5″> <display-name>struts2</display-name> <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> </web-app>

To invoke this sample, access the URL http://localhost:8080/struts2/CustomerNewAction.action. This is how the screen appears after validation,

sample-validation-screen2.jpg

Permalink 1 Komentar

english – indonesia – english

Oktober 30, 2008 at 4:57 am (tips)

http://www.speedytown.com/kimyong/translator.html

Permalink 1 Komentar

update plugin eclipse … reminder

Oktober 28, 2008 at 2:45 am (java, tips)

subversion
http://download.eclipse.org/technology/subversive/0.7/update-site/
Subversive Integrations
http://www.polarion.org/projects/subversive/download/integrations/update-site/
Subversive SVN Connectors
http://www.polarion.org/projects/subversive/download/eclipse/2.0/update-site/
maven
http://m2eclipse.sonatype.org/update-dev/

Permalink Tinggalkan sebuah Komentar

Next page »