Thursday, July 21, 2005

JavaScript buildin object

JavaScript buildin Objects:

String object:
length: a.length
charAt(pos): a.charAt(2)
charCodeAt(pos): a.charCodeAt(2)
fromCharCode(code): String.fromCharCode(99);
indexOf(searchSting, startPosition): myString.indexOf("abc"); myString.indexOf("abc", 5);
lastIndexOf(seachString, startPos);
substr(startPos, endPos); support by IE4+
substring(startPos, endPos); supported by IE3+
toLowerCase(): myString.toLowerCase();

Math object:

Math.PI
Math.abs(number);
Math.ceil(number);
Math.floor(number);
Math.round(number);
Math.randow();
Math.pows(numberToPower, power);

Number object:

toFixed(pos): myNumber.toFixed(2);

Array object:

length: myArray.length();
concat(anotherArray) join two array together: myArray1.concat(myArray2)
slice(startPos, endPos) slice out a portion of array: myArray1.slice(1, 3)
join() concatenates all the elements in an array and returns them as a string.:
myArray.join(
);
sort() sort in ascending order How about multidemential array?
reverse() sort in descending order

Date object:

create data object:
myDate1 = new Date(); current date ant time
myDate1 = new Date(949278000000) millisecond since Jan 1, 1970 at 00:00:00GMT
myDate1 = new Date("31 January 2000"); any kind of date format
myDate1 = new Date(2000, 0, 31, 15, 35, 20, 20);
getDate() : get the date of the month
getDay() : get the day of the week
getMonth(): get the month as integer
getFullYear(): get the year in four-digit number
toDateString():

setDate() : set date of the month
setMonth(): set the month of the year
setFullYear(): sets the year to the four-digit integer

getHour()
getMinutes()
getSeconds()
getMiliseconds()
toTimeString()
setHour()
setMinutes()
setSeconds()
setMilisconds()

Tuesday, June 21, 2005

NXT-827

NXT-827 : sanityNonserial : 815 line

if (!isNonnegativeInteger(quantity))

{

dbg.alert(TRANSACTION_MESSAGE_COMMON_3+" ["+quantity+"]");

>document.getElementById("DynamicTableNONSERIALPartNumber");

document.getElementById("DynamicTableNONSERIALQuantity").value = ""; if (rbNonserial)

Saturday, November 06, 2004

possible solution for CATLPA-02

The local MS DTC detected that the MS DTC on CATALPA-02 has the same unique identity as the local MS DTC. This means that the two MS DTC will not be able to communicate with each other. This problem typically occurs if one of the systems were cloned using unsupported cloning tools. MS DTC requires that the systems be cloned using supported cloning tools such as SYSPREP. Running 'msdtc -uninstall' and then 'msdtc -install' from the command prompt will fix the problem. Note: Running 'msdtc -uninstall' will result in the system losing all MS DTC configuration information.

SQL 2000 distributed transaction coordinate setup in windows 2003

IN ORDER TO SOLVE THE PROBLEM 7391

http://support.microsoft.com/default.aspx?scid=kb;en-us;329332&Product=sql

Monday, November 01, 2004

APACHE, PHP, MYSQL SETUP

1. Apache
2. PHP

  • copy php4ts .dll and php5apache2.dll into the appropriate system directory. windows/system32.
  • go to php5 directory, copy php.ini-recommended to windows directory.
  • edit apache2\conf\httpd.conf
  • add the following two lines to the httpd.conf file. Add these code directory below the block of LoadModule entries located in the botton of the Global Environment Section LoadModule php5_module c:/php5/sapi/php5apache2.dll
  • AddType application/x-httpd-php .php .html

3. MYSQL
4. PhpMyAdmain setup
  • install phpmyadmain to the apache server ht doc dirctory
  • set up the config.inc.php: setup the host user and auth_type
  • modify the php.ini in the windows directory: modify the extension_dir = "E:\php5\ext" and extension=php_mysql.dll
  • copy the libmysql.dll to windows/system32 directory

Thursday, October 28, 2004

How to setup jb8 BES environment.

1 setup bes 5.21
2. setup jb8
3 set bes jb8 connection by enable bes, directory..
4. select enterprise setup, visibroker
5. microsoft sql 2000 jdbc just specify three jar.
6. jdk
7. idl setup visibroker
8. idl properyies, set package parallel...
9, run smartagent
10, run server
11, run gatekeeper

using vbj -VBJclasspath ... to run server

smartagent can perform load balancing in round robin machinism.
however, because the gatekeeper is regarded as a single client, so two
serer object does not perform load balancing.

But two can be failover. perform fault tolerante function.

Have to figure out how to perform load balancing by using gatekeepers.

Sunday, October 10, 2004

How to create updateable distributed partitioned view

NEED TO NOTICE:

  • SET XACT_ABORT ON : this enables a distributed transaction to auto rollback.
  • create check constraint before create primary key
  • Better not to use char type, and varchar type. It will cause problem in updateable distributed view, such as not specified the partitioned row. use nchar, or nvarchar instead.
  • It seems that the partition can use only "between and", I tried to use %, but does not work, and cause error.
  • In my practice, I use foreign key in enterprise manager, instead of t-sql to alter the table. becuase I use t-sql and cause error.
  • In JDBC, it seems hard to set the XACT_ABORT on, so instead I used sp_configure sp_configure 'user options', 16384GORECONFIGUREGO to set up the XACT_ABORT on for all users in SQL server.

Here are some examples how to create updatable partitioned view.

  • create a table in another computer

USE BookStoreGO
CREATE TABLE [dbo].[books2] ( [bookNo] [bigint] NOT NULL CHECK ([bookNo]BETWEEN 101 AND 200), [bookTitle] [nvarchar](100) NOT NULL, [bookEdition] [smallint] NULL , [bookAuthor] [nvarchar](20) NOT NULL , [bookPrice] [float] NOT NULL , [bookPublisher] [int] NOT NULL , [bookQuantity] [int] NOT NULL
)
ALTER TABLE [books2]ADD PRIMARY KEY ([bookNo])
GO

  • create a table in one computer

USE BookStoreGO
CREATE TABLE [dbo].[books1] ( [bookNo] [bigint] NOT NULL CHECK ([bookNo] BETWEEN 1 AND 100), [bookTitle] [nvarchar](100) NOT NULL, [bookEdition] [smallint] NULL , [bookAuthor] [nvarchar](20) NOT NULL , [bookPrice] [float] NOT NULL , [bookPublisher] [int] NOT NULL , [bookQuantity] [int] NOT NULL
)
ALTER TABLE [books1]ADD PRIMARY KEY ([bookNo])

  • create view for tables in different tables

CREATE VIEW [dbo].[books_view] ASSELECT * FROM [DESKTOP].[BookStore].[dbo].[books1] UNION ALLSELECT * FROM [DELL].[BookStore].[dbo].[books2]GO

  • Add new records to the view.

USE BookStoreGO
SET XACT_ABORT ON
INSERT INTO [books_view]VALUES (4, 'A',1,'B',200.00,1,1)
INSERT INTO [books_view]VALUES (1, 'A',1,'B',200.00,1,1)

  • Set the user option for XACT_ABORT on for all users

sp_configure 'user options', 16384GORECONFIGUREGO

Saturday, October 09, 2004

create distributed partition view in sql 2000

1. create table
2. create constraint
3. create link server
use security setting user: sa password:
4. create view in each server

notic: use sql 2000 sp3
use jdbc sp3

set network trust in notorn internet security.

start DTS and SQL , SQL Agent service