2007/05/30

authentication with php from otn

Link REST versus SOAP

REST versus SOAP - the REST story
http://searchwebservices.techtarget.com/tip/0,289483,sid26_gci1227190,00.html
REST versus SOAP - the SOAP story
http://searchwebservices.techtarget.com/tip/0,289483,sid26_gci1231889,00.html

Chinese Version
http://searchwebservices.techtarget.com.cn/comment/425/2707925_1.shtml
http://searchwebservices.techtarget.com.cn/comment/28/3026028.shtml

Change Smartphone Video Preferences

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MediaPlayer\ASFCodecs\Video

Clear Windows Media Player 10 already established history.
Privacy tab of Tools > Options > Clear Cache button

How to Sync Google Calendar with Outlook and Smartphones Automatically

remotecalendars
http://remotecalendars.sourceforge.net/

java join and split

I did implement it in my many projects. Because of my common library is not a part of the java standard, I have to write it each time. I think many people must have almost the same experience.


public static String join( String token, String[] strings )
{
StringBuffer sb = new StringBuffer();

for( int x = 0; x < ( strings.length - 1 ); x++ )
{
sb.append( strings[x] );
sb.append( token );
}
sb.append( strings[ strings.length - 1 ] );

return( sb.toString() );
}

for guys who have an old JDK, the split function doesn't exist prior to jdk1.3. The alternative is the following, using the StringTokenizer class

instead of

String line_fields[]=line_data.split("\\t");

use

StringTokenizer line_fields = new StringTokenizer(line_data,"\t");


reference:
the enhancement require to sun
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5015163

2007/05/29

Aptana - The JavaScript IDE

Link Ajax and REST

Part One
http://www.ibm.com/developerworks/web/library/wa-ajaxarch/?S_TACT=105AGX52&S_CMP=cn-a-web
Part Two
http://www.ibm.com/developerworks/web/library/wa-ajaxarch2.html

Ruby on Rails Guide

Amazing feature:
RJS, DB Migration, REST

Link Crossing borders: REST on Rails



Create: HTTP put
Read: HTTP get
Update: HTTP post
Delete: HTTP delete

Listing 6. Rendering HTML for a JavaScript client

def list
# wants is determined by the http Accept header in the request
@people = Person.find_all
respond_to do |wants|
wants.html
wants.js
wants.xml { render :xml => @people.to_xml }
end
end

Listing 8. Invoking the service from Ruby
require 'net/http'

Net::HTTP.start('localhost', 3000) do |http|
response = http.get('/people/list', 'Accept' => 'text/xml')

#Do something with the response.

puts "Code: #{response.code}"
puts "Message: #{response.message}"
puts "Body:\n #{response.body}"
end

Listing 9. Invoking the service with Java code

package com.rapidred.ws;

import java.net.*;
import java.io.*;

public class SimpleGet {

void get() {

try {
URL url = new URL("http://localhost:3000/people/list");
URLConnection urlConnection = url.openConnection();
urlConnection.setRequestProperty("accept", "text/xml");
BufferedReader in =
new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String str;

while ((str = in.readLine()) != null) {
System.out.println(str);
}

in.close();
}
catch (Exception e) {
System.out.println(e);
}
}



Listing 10. Calling HTTP post with Java code
void post() {
try {
String xmlText = " " +
"Maggie" +
"Maggie" +
"maggie@tate.com" +
"
";

URL url = new URL("http://localhost:3000/people/create");
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
conn.setDoOutput(true);
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "text/xml");
OutputStreamWriter wr = new
OutputStreamWriter(conn.getOutputStream());
wr.write(xmlText);
wr.flush();

BufferedReader rd = new BufferedReader(new
InputStreamReader(conn.getInputStream()));
String line;
while ((line = rd.readLine()) != null) {
System.out.println(line);
}
wr.close();
rd.close();
} catch (Exception e) {
System.out.println("Error" + e);
}
}

dbput data transfer 3.1

DBPut data transfer 3.1

Converting data between different databases.

DBPut data transfer is a creative and advanced software used for converting data between different databases. such as: MySQL, Oracle, DB2, Microsoft SQL Server Sybase, Access, dBase, Paradox, Foxpro, Text etc. With the DBPut data transfer transferring and maintaining databases is a snap, even though you are a rookie in SQL grammar.

3.1 now released!

3.1 version new features

  • Support MySQL Server 5.0.
  • Modify the kernel of converting mechanism, using ADO to replace Borland BDE.
  • Add ADO dataset, allow access database through ADO connection.
  • Allow selecting different database type in ODBC dataset, and getting the exact file data type.
  • Allow using Text dataset and FileDB dataset to read many text file or dbf file at one time.
  • Add WinExec function that allow execute a alone program.
  • Add function:FileName(),FilePath(),CopyFile(),MoveFile().
  • Not support Paradox. If you need to access Paradox, please use the old version.

3.0 version allow converting data to the following file:

  • Text file
  • HTML file
  • Excel spreadsheet
  • SYLK (Symbolic Link)
  • DIF (Data Interchange Format)
  • Lotus 1-2-3 file
  • QuattroPro file
  • XML file
  • Rich Text format
  • SPSS format
  • Adobe Acrobat Document(pdf)
  • LDAP/Lightweight Data Interchange Format

Key Benefits

Convert data between many database.

  • Support access MySQL through IP protocol directly.
  • Support access Oracle through IP protocol directly without Oracle client library installed.
  • Convert other database to MS SQL Server.
  • Convert other database to DB2.
  • Convert text data to MySQL, Oracle, MSSQL, DB2 or other database.
  • Convert data between many database through ODBC.
  • Directly read data from Paradox, dbase or FoxPro.

Flexible transfer function

  • Run job as custom execution flow.
  • Transfer a table; Merge more tables into one.
  • Split one table into more.
  • Automatically mapping between source and target tables.
  • Split source fields
  • Calculate between multi-fields
  • Multiple transfer modes: append, update, append-update, delete, copy.
  • Filter source data with flexible condition.
  • convert data of datetime type.
  • wipe off the repeated record of source dataset.
  • Split record.
  • Switch between row and col.
  • Generate temporary primary key.
  • Support debug dblink.
  • Preview result of convert process.
  • Re-process error data.

Run job as specified schedule automatically.

  • Run job automatically as day, week, month, year by seting datetime trigger.

Supported databases:

  • Oracle 10G, 9i, 8i, 8.0.x and 7.x
  • MySQL 5.0, 4.1, 4.0., 3.23 and earlier
  • Microsoft SQL Server 2000, 7.0 and 6.5
  • IBM DB2 8.1, 7.2, 6.1 and earlier
  • Informix 9.3, 7.3 and earlier
  • Microsoft Access 2000, 97, 95 and 2.0
  • dBase, FoxPro, Excel, Paradox,
  • Sybase Adaptive Server Anywhere
  • Sybase SQL Anywhere
  • Sybase Adaptive Server Enterprise
  • Interbase, Pervasive.SQL and any other ODBC-compliant database
  • Text file
  • HTML file
  • Excel spreadsheet
  • SYLK (Symbolic Link)
  • DIF (Data Interchange Format)
  • Lotus 1-2-3 file
  • QuattroPro file
  • XML file
  • Rich Text format
  • SPSS format
  • Adobe Acrobat Document(pdf)
  • LDAP/Lightweight Data Interchange Format

Support different databases and data type.

  • Read:Oracle, SYBASE, DB2, SQLServer, Informix, Interbase, Access, MySQL, dbf, Foxpro, Paradox, text file.
  • Write:Oracle, SYBASE, DB2, SQLServer, Informix, Interbase, Access, MySQL, dbf, Foxpro, Paradox, Text, HTML, Excel, SYLK, DIF, Lotus 1-2-3, QuattroPro, XML, RTF, SPSS, PDF, LDAP.
  • Support many data type: character string, integer, floating-point, bool, and datetime type.

DBPut runs on Microsoft Windows 98/ME/2000/XP/2003



Supported databases:

  • Oracle 10G, 9i, 8i, 8.0.x and 7.x
  • MySQL 5.0, 4.1, 4.0., 3.23 and earlier
  • Microsoft SQL Server 2000, 7.0 and 6.5
  • IBM DB2 8.1, 7.2, 6.1 and earlier
  • Informix 9.3, 7.3 and earlier
  • Microsoft Access 2000, 97, 95 and 2.0
  • dBase, FoxPro, Excel, Paradox,
  • Sybase Adaptive Server Anywhere
  • Sybase SQL Anywhere
  • Sybase Adaptive Server Enterprise
  • Interbase, Pervasive.SQL and any other ODBC-compliant database
  • Text file
  • HTML file
  • Excel spreadsheet
  • SYLK (Symbolic Link)
  • DIF (Data Interchange Format)
  • Lotus 1-2-3 file
  • QuattroPro file
  • XML file
  • Rich Text format
  • SPSS format
  • Adobe Acrobat Document(pdf)
  • LDAP/Lightweight Data Interchange Format

Support different databases and data type.

  • Read:Oracle, SYBASE, DB2, SQLServer, Informix, Interbase, Access, MySQL, dbf, Foxpro, Paradox, text file.
  • Write:Oracle, SYBASE, DB2, SQLServer, Informix, Interbase, Access, MySQL, dbf, Foxpro, Paradox, Text, HTML, Excel, SYLK, DIF, Lotus 1-2-3, QuattroPro, XML, RTF, SPSS, PDF, LDAP.
  • Support many data type: character string, integer, floating-point, bool, and datetime type.

DBPut runs on Microsoft Windows 98/ME/2000/XP/2003