Friday, March 26, 2010

Date Extract function of Oracle

select extract(day from date1) from table
select extract(month from date1) from table
select extract(year from date1) from table

Thursday, March 25, 2010

JSP request.setCharacterEncoding

Today I just find that what I have inserted into database (Chinese characters) is scrambled code.

Finally, the solution is
request.setCharacterEncoding("utf8");

JavaServer Page Implicit Objects

http://www.gulland.com/courses/JavaServerPages/jsp_objects.jsp

Oracle Special Table - Dual

Oracle:

Dual is a special table with a garbage cell which is used for our queries.

For example,
select seq.nextval from dual

Friday, March 19, 2010

Useful .net 4.0 features

http://msdn.microsoft.com/en-us/library/ms171868%28VS.100%29.aspx

The following list describes additional new capabilities, improvements, and conveniences. Several of these are based on customer suggestions.

To support culture-sensitive formatting, the System.TimeSpan structure includes new overloads of the ToString, Parse, and TryParse methods, as well as new ParseExact and TryParseExact methods.

The new String.IsNullOrWhiteSpace method indicates whether a string is null, empty, or consists only of white-space characters. New overloads have been added to the String.Concat and String.Join methods that concatenate members of System.Collections.Generic.IEnumerable<(Of <(T>)>) collections.


The String.Concat method lets you concatenate each element in an enumerable collection without first converting the elements to strings.

The System.Guid structure now contains the TryParse and TryParseExact methods.

Secure Sockets Layer (SSL) support for the System.Net.Mail.SmtpClient and related classes.

Credentials for password-based authentication schemes such as basic, digest, NTLM, and Kerberos authentication in the System.Net..::.NetworkCredential class. To improved security, passwords may now be treated as System.Security.SecureString instances rather than System.String instances.

Ability to specify how a URI with percent-encoded values is converted and normalized in the System..::.Uri and System.Net.HttpListener classes. For more information, see the System.Net.Configuration.HttpListenerElement, System.Configuration.SchemeSettingElement, System.Configuration.SchemeSettingElementCollection, and System.Configuration.UriSection classes.

Sunday, March 7, 2010

Internet Explorer shows error when downloading excel file in SSL site

My post at stackoverflow today:

Internet Explorer shows error when downloading excel file in SSL site
http://stackoverflow.com/questions/2399203/internet-explorer-shows-error-when-downloading-excel-file-in-ssl-site

It's aboutthe Reponse Header's cache control.