Thursday, December 30, 2010

Happy New Year 2011

Helloo Guys !

It almost new year already, and it has been months I abandoned this blog. sorry that I’ve been really busy.

I’m not thinking about something End-year special coding or tips to post at now, I just would to wish you belated

Merry Christmas 2010

and wish you with upcoming

Happy New Year 2011

I hope I can do better next year, I hope I can bring more to you guys a more new knowledge.

Thank you for reading ^^

Monday, October 11, 2010

Windows Control Panel Run Command

I’ve just found my friend working very well with keyboard, minimize the usages of mouse.

then below is keyboard shortcut to access the control panel for Windows, to make you looks more cool on working :)

 

Control panel tool Command
-----------------------------------------------------------------
Accessibility Options control access.cpl
Add New Hardware control sysdm.cpl add new hardware
Add/Remove Programs control appwiz.cpl
Date/Time Properties control timedate.cpl
Display Properties control desk.cpl
FindFast control findfast.cpl
Fonts Folder control fonts
Internet Properties control inetcpl.cpl
Joystick Properties control joy.cpl
Keyboard Properties control main.cpl keyboard
Microsoft Exchange control mlcfg32.cpl
(or Windows Messaging)
Microsoft Mail Post Office control wgpocpl.cpl
Modem Properties control modem.cpl
Mouse Properties control main.cpl
Multimedia Properties control mmsys.cpl
Network Properties control netcpl.cpl
NOTE: In Windows NT 4.0, Network
properties is Ncpa.cpl, not Netcpl.cpl
Password Properties control password.cpl
PC Card control main.cpl pc card (PCMCIA)
Power Management (Windows 95) control main.cpl power
Power Management (Windows 98) control powercfg.cpl
Printers Folder control printers
Regional Settings control intl.cpl
Scanners and Cameras control sticpl.cpl
Sound Properties control mmsys.cpl sounds
System Properties control sysdm.cpl

Thursday, September 16, 2010

Update Collation SQL Server

Still talking about implementing foreign characters to your application. in SQL Server database we know what so-called Collation. you need to set the collation of the database and the table’s column to collation type that support to keep the foreign characters into the table. what I’m going to show here, is a solution for a problem that you may have when you want to alter table collation in a situation where there’s numerous number of tables to alter. hope this below SQL script might help you

 declare   
@NewCollation varchar(255)
,@Stmt nvarchar(4000)
,@DBName sysname
set @NewCollation = 'Thai_CI_AS' -- change this to the collation that you want to use
set @DBName = DB_NAME()
declare
@CName varchar(255)
,@TName sysname
,@OName sysname
,@Sql varchar(8000)
,@Size int
,@Status tinyint
,@Colorder int
declare curcolumns cursor read_only forward_only local
for select
QUOTENAME(C.Name)
,T.Name
,QUOTENAME(U.Name) + '.' +QUOTENAME(O.Name)
,C.Prec
,C.isnullable
,C.colorder
from syscolumns C
inner join systypes T on C.xtype=T.xtype
inner join sysobjects O on C.ID=O.ID
inner join sysusers u on O.uid = u.uid
where T.Name in ('varchar', 'char', 'text', 'nchar', 'nvarchar', 'ntext')
and O.xtype in ('U')
and C.collation != @NewCollation
and objectProperty(O.ID, 'ismsshipped')=0
order by 3, 1
open curcolumns
SET XACT_ABORT ON
fetch curcolumns into @CName, @TName, @OName, @Size, @Status, @Colorder
while @@FETCH_STATUS =0
begin
set @Sql='ALTER TABLE '+@OName+' ALTER COLUMN '+@CName+' '+@TName+ isnull ('('
+convert(varchar,@Size)+')', '') +' COLLATE '+ @NewCollation
+' '+ case when @Status=1 then 'NULL' else 'NOT NULL' end
begin try
exec(@Sql)
end try
begin catch
--error catch
set
print error_message()
end catch
fetch curcolumns into @CName, @TName, @OName, @Size, @Status, @Colorder
end
close curcolumns
deallocate curcolumns


you can run the script in SQL server 2005 or above, well, that’s a little trick for me, hope can help.



Thanks to Kim that had helped me on this :)

Sunday, August 29, 2010

Today’s Tips – Use Thailand Character, Database Collation

Here I am again, with the problem : how to use non-Latin characters in your Application ?

at the Programming side, you need configure the ColdFusion so it can support the non-Latin characters, please see my previous post that explain how to do it, but now, we’ll go with the database.

I assume you usually creates an application in EN localization, that’s why, by default, all the setting will refer to EN. included your SQL database collation, which by default, it can not merely accept the Thailand’s characters since the Collation is Latin. the solution is : you need to update the Database and Table Column’s Collation.

Collation for EN localization default is SQL_Latin1_General_CP1_CI_AS (at least this default collation where my Computer Server is installed)

in Thai, you need to use THAI_CI_AS collation (at least this what I used by now, probably you can use THAI_CI or other THAI collation).

1. Update Database Collation. to Alter the database collation, you can go to SQL Management, under the Object Browser, find the database you want to alter. then right-click to edit the database properties. you will find Collation options in the pop up screen, then you need to select the THAI_CI_AS for the database collation.

please note that you can update the collation if Database is not being used, if it is, then you can Restart the SQL server and try again.

2. Update Table’s Column Collation. You can run this SQL script to alter the column’s collation. (just example, you can modify the table name and column name) :

 ALTER TABLE temployee ALTER COLUMN first_name varchar(50) COLLATE THAI_CI_AS  


Then now, after you update the database and table’s column collation, you Now should be able to put Thai character to the database. This solution can be implemented in Database which has only less number of tables, but how if you has hundreds of Tables ? please find the tips on my next Post :)



Until next time, keep cheer up !

Today’s Tips – Use Thailand Character in ColdFusion

images Have you guys ever involved in project where you need to use non-Latin character ? I did

I came across with problem to make my application to run the Thailand’s characters. if you usually develop the CF application in English localization, probably, you cannot merely apply the foreign characters. (you will find the characters in unknown format)

and how the simplest way to solve this ?

Update the ColdFusion encoding to UTF-8. you can do this by go to CFIDE administrator, under Java and JVM tabs, and in the JVM Parameters, add the additional Parameter : -encoding=UTF-8

and Restart your CF application server

Now you should be able to put the Thailand’s characters in your CF application. I never used any other characters except Latin and Thai, but I’m pretty sure it will be the same encoding if you want to use another characters such as Chinese, Russian, or maybe Arabian.

well, after this, you probably will find another problem, in regard to the database collation. I will give you some tips in my next post,

Hope can Help,

Stay tune and Cheer up your Monday !!

Friday, August 27, 2010

Hello ! ColdFusion

been so long time no write anything on this site, what can I say, I just want to say hello !

wonder how to write this in ColdFusion ? for you who never know ColdFusion before please use this line :

 <cfoutput>  
Hello
</cfoutput>


finally, welcome to Coldfusion readers !