| Subcribe via RSS

PHP5 and MySQL5 With Thai Encoding

July 29th, 2008 | No Comments | Posted in PHP

Use this code to enable thai support

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$dbhost = 'localhost';
$dbuser = 'user';
$dbpass = 'pass';

$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');

$dbname = 'webboard';

mysql_select_db($dbname);

mysql_query("SET character_set_results=tis620");
mysql_query("SET character_set_client='tis620'");
mysql_query("SET character_set_connection='tis620'");
mysql_query("collation_connection = tis620_thai_ci");
mysql_query("collation_database = tis620_thai_ci");
mysql_query("collation_server = tis620_thai_ci");
Tags: ,

Javascript : A very simple modal form with a return value

July 28th, 2008 | No Comments | Posted in Javascript

To build a modal form web page. You can use this java script.

JAVASCRIPT
window.showModalDialog(‘popup.html’)

And set the return value by doing this

JAVASCRIPT
function doOk()
{
  window.returnValue = ‘hello’;
  window.close();
}
Tags: ,

JBoss : Datasource

July 24th, 2008 | No Comments | Posted in JBOSS

Just create a new xml file with *-ds.xml pattern. And paste inside the deploy folder

http://wiki.jboss.org/wiki/ConfigDataSources

Java and .NET Compact WebServices : SOAP Encoding problem

July 14th, 2008 | No Comments | Posted in Web Services

I found this problem three days ago. I was developing java web services to work with .NET Compact framework, WM5. Java web services will return a string which is Thai language, but .NET compact cannot translate into Thai, it showed ?????. I think the problem was SOAP version. I have to downgrade from 1.2 to 1.1. I guess that that WM5 doesn’t match with SOAP 1.2. It works, at least for me

Tags: ,

C# and SQL Express : Embedded SQL Server Express with custom application

July 1st, 2008 | No Comments | Posted in .NET, Database, SQL Server

Well, with my “Trinop” project that is built with C# .NET and SQL Server Express edition. However, the diffcult part is that when I deploy the application to end-user, the installation is very hard, becuase the use has to install SQL Server first and the install my program. At least, it’s hard for some people. So, the problem can be solved by installing SQL Server in silence mode. Therefore, the installation will be done by just one click.

This is the example I have found.

http://msdn.microsoft.com/en-us/library/bb264562.aspx

Design Pattern : Method Factory

July 1st, 2008 | No Comments | Posted in Programming

Method factory is built to prevent the user from creating an instance directly. For instance, MyClass myClass = new MyClass(); This will prevent from creating too many objects. I will explain no more, because wikipedia do it so much better than me.

http://en.wikipedia.org/wiki/Factory_method_pattern

Tags: