Tuesday, September 25, 2012

Get Webpage Design template for FREE


1) Select Template in https://wrapbootstrap.com/

2) To grap all the pages for free for a theme, use the following command in ubuntu
wget -rR -np http://wbpreview.com/previews/WB0G66334/

Monday, December 5, 2011

LadderSoft Research Project

A research project that enable circuit diagram being built easily even for primary student. That is to unleash the creativity from our kid.



LadderSoft IDE - Draw circuit diagram by just using visualise tool.

Video of robot car coming soon!!!

Monday, January 25, 2010

SQL Best Practise


Isolating indexed field
//Bad Idea.
Where TO_DAYS(order_created) - TO_DAYS(CURRENT_DATE())>= 7

//Better Idea. CURRENT_DATE() not working for query cache
Where order_created >= CURRENT_DATE() - INTERVAL 7 DAY

//Best Idea
Where order_created >= '11/11/2009' - INTERVAL 7 DAY


Using calculated field
//Bad idea
WHERE email_address LIKE '%.com';

//Better idea
ALTER TABLE CUSTOMERS
ADD COLUMN rv_email_address VARCHAR(80) NOT NULL;
UPDATE customers SET rv_email_address = REVERSE(email_address);
CREATE INDEX ix_rv_email ON customer (rv_email_address(20));

DELIMITER ;;
CREATE TRIGGER trg_bi_cust BEFORE INSERT ON customers
FOR EACH ROW BEGIN
SET NEW.rv_email_address=REVERSE(NEW.email_address);
END;;

//same trigger for BEFORE UPDATE...
//Then SELECT on the new field...
WHERE r_email_address LIKE CONCAT(REVERSE('.com'),'%');

Saturday, January 2, 2010

J2ME HttpConnection issue

J2ME HttpConnection issue when testing with Digi telco and Sony Ericsson W810i

I am wondering why Lwuit-Makeover is able to connect but my own application can not. Then i found out that my application need to run in Internet setting but Lwuit-Makeover just need WAP setting.

If request connection setting from telco, they will send you the following setting.
  • Digi Streaming
  • Digi Internet
  • Digi MMS
  • Digi WAP
My personal experience about requesting the Digi internet setting. I had make more than 10 times to request Digi Internet setting. First few time failed was because of the "data account full...". Then i browsed to data comm.->data account to delete all the settings. After that, finally i can install successfully with those settings BUT there was no internet setting... So I kept on calling them to send me the internet setting. After few times request i met a guy who suggested to send only internet setting and not like previously send all settings(MMS,WAP,STREAMING, INTERNET...) in once. It work!!! Thanks guy.

Lwuit-Makeover
  • "Setting for java" can be WAP setting.
  • Internally this application use com.sun.me.web.request api and Get method to make connection.

My own application
  • "Setting for java" does not work with WAP setting. It need internet setting.
  • I use (HttpConnection) Connector.open("http://.."); and writebyte method to make connection.
Is it mean that WAP only work for GET and internet setting is able to work with writebyte? I still need time to figure out what so special in com.sun.me.web.request.

Reference
Avoid Connection Problems with Your Java Applications

Friday, December 18, 2009

SSO : JOSSO VS CAS

JOSSO, CAS and openSSO are famous Java Single Sign-On in the open source world. The following are some comments on JOSSO and CAS.

CAS
  • Architecture is simple to install. Security filtering is inside war file.
  • Only work with SSL.
  • Easily integrate in Spring security.
CAS + Spring Security integration guide


JOSSO
Architecture is hard to deploy. It consists of gateway and agent. Gateway is the project of SSO/login module. Agent need to be installed in all servers for security filtering. Thus, it tights the configuration to server and bunch of xml files in lib folder of tomcat. The security is configure in the server and not within the project. Even thought installation script is provided but it is just for all(agent, gateway,project) in one server. I got no idea how the configuration should be if more than one server is using...

JOSSO + Acegi integration
Look like outdated because have not upgraded to spring security.

Sunday, October 4, 2009

Cross Platform Hibernate @Id Sequence setting

Cross platform @Id setting
@SequenceGenerator(name = "SEQ_HRMS_EMP", sequenceName = "SEQ_HRMS_EMP", initialValue = 1, allocationSize = 1)
@GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ_HRMS_EMP")
@Id
@Column(name = "user_id")
private Integer userId;

Schema export from hibernate
  1. MySql
    create table HRMS_EMP (
    user_id integer not null auto_increment,

    MySql will ignore the generator = "SEQ_HRMS_EMP" setting because MySql does not have sequence.
  2. Postgres
    create sequence SEQ_HRMS_EMP;
  3. Oracle
    create sequence SEQ_HRMS_EMP;