Thursday, March 15, 2007

Non-secure item in a webpage accessed through HTTPS

Just got a good article about handling the pop-up message box "This page contains non-secure items, would you like to display those items?" from Scott Yang's playground .

Here's an excerpt from the article:

At work, the web application that I’ve been developing has always had this problem over a secure SSL link. On certain pages, before the document is fully loaded, a dialog box will popup telling me that “This page contains non-secure items, would you like to display those items?”. Whether I choose ‘Yes’ or ‘No’ does not really make a difference, and the application can still be executed perfectly. However, this dialog box is really annoying to the point that many people in the office has turned off this checking in their Internet Explorer preferences.

Solution:
Make Sure You Have SRC Attribute In Your IFRAME!
We have quite a few IFRAME tags in our code, either pre-generated or appended to the document using DOM. Many of them are pointing to a relative URL when they are created, however, some of them are just created as hidden place holders. They are used in DHTML to replace some DIV code because DIV does hover well above the editing widgets. They are created without a SRC attribute, because their documents are created on the fly! Because the document does not have an URL, Internet Explorer gets confused and thus yield a warning on displaying non-secure items.
It ends up as an easy fix - just create thus IFRAME’s with SRC pointing to a dummy page using a relative URL.

WYSIWYG script error in Joomla

When WYSIWYG editor is used in a Joomla site and you use subdomains, you should be careful with setting your live site global variables, because the Joomla page uses $mos_Config_live_site to load the java script of WYSIWYG editor.
In order to protect you against potentially malicious scripting. IE only allows script from your domain to run on it's page. If you didn't specify the correct subdomain in the configuration.php file for your joomla site, you may have the following error:
Error: Access is denied.
Normally, in linux system, your website files will be located in the "www" folder, whose contents correspond to the "www.yoursite.com" domain name. So if you install joomla in a subdirectory called "myJoomla" under "www", you should configure $mos_Config_live_site="http://www.yoursite.com/myJoomla" for your IE users.
According to Joomla Forum , this problem does not exist for firefox users because firefox considers folder-domain and sub-domain to be matched.

Tuesday, March 13, 2007

how to back up mysql database for a website?

Just got a good article about how to back up MySQL database using phpMyAdmin, which is very useful when maintaining a website.
Please click " Backup and Importing Joomla Database " (from GeekTips.net) to get the detailed information.

Monday, March 12, 2007

Configuring Internet Connection for vmware

Today when I was working on my SUSE vmware, I made a little change with the network configuration. But what I didn't realize was that it would cause the failure of internet connection. The problem turned out to be even worse because vmware network connection was configured through vmware softwares not the guest OS, which means I could not revert the modification in SUSE.
After several attempts that didn't resolve this issue, I had to power off the vmware because the OS was not useful to me if there was no internet connection. But at that moment, I happened to see that there was the other vmware image in my system, which has the internet connection. So I compared the 2 vmwares' .vmx files, and found out there was one major difference in the network configuration:
ethernet0.connectionType="bridged"
When I changed the network configuration in SUSE, it would be modified to ethernet0.connectionType="nat", which caused the disconnection to the network.

Wednesday, March 07, 2007

Different oracle JDBC drivers

This information is from Oracle, I collect it here just for convenience.

The [ORACLE_HOME]/jdbc/lib directory contains:
- classes111.zip & classes111.jarClasses for use with JDK 1.1.x. It contains the JDBC driverclasses except classes necessary for NLS support in Object andCollection types.
- nls_charset11.zip & nls_charset11.jarNLS classes for use with JDK 1.1.x. It contains classes necessaryfor NLS support in Object and Collection types.
- classes111_g.zip & classes111_g.jarSame as classes111.zip, except that classes were compiled with"javac -g" and contain OracleLog traceing code.
- classes12.zip & classes12.jarClasses for use with JDK 1.2.x. It contains the JDBC driverclasses except classes necessary for NLS support in Object andCollection types.
- nls_charset12.zip & nls_charset12.jarNLS classes for use with JDK 1.2.x. It contains classes necessaryfor NLS support in Object and Collection types.
- classes12_g.zip & classes12_g.jarSame as classes12.zip, except that classes were compiled with"javac -g" and contain OracleLog tracing code.
- classes12dms.jarSame as classes12.jar except contains additional code to supportOracle Dynamic Monitoring Service.
- classes12dms_g.jarSame as classes12dms.jar except that classes were compiled with "javac -g" and contain OracleLog traceing code.
- ojdbc14.jarClasses for use with JDK 1.4. It contains the JDBC driverclasses except classes necessary for NLS support in Object andCollection types. Use nls_charset12.jar if needed.
- ojdbc14_g.jarSame as ojdbc14.jar except that classes were compiled with"javac -g" and contain OracleLog tracing code.
In general, .zip and .jar are identical except for theformat of the archive. Both the .zip and .jar formats are providedfor JDK 1.1 and JDK 1.2. Only .jar files will be provided for JDK1.4 and beyond. So far, there is no need for JDK 1.3 classes files;use classes12.jar with JDK 1.3.
Note that most of the classes pertaining to specific character setssupport in Oracle Object and Collection types are separated from thebasic zip/jar files. These NLS classes are packaged into theextension zip/jar files. This allows the user to include the NLSclasses only if necessary. Please refer to the "NLS Extension ZipFiles (for client-side only)" section for further details. Alsonote that the nls_charset files are much smaller than in priorreleases. These .zip/.jar files now contain a more compactrepresentation of the conversion information rather than actual.class files.
[ORACLE_HOME]/lib directory contains libocijdbc9.so, libocijdbc9_g.solibheteroxa9.so and libheteroxa9_g.so (on Solaris), which are theshared libraries used by the JDBC OCI driver.
[ORACLE_HOME]/jdbc/doc/javadoc.tar contains the JDBC Javadoc. Thisrelease contains a beta release of the Javadoc files for the publicAPI of the public classes of Oracle JDBC.
[ORACLE_HOME]/jdbc/demo/demo.tar contains sample JDBC programs.All of the sample programs have been rewritten to use JDK 1.2 and thenew Oracle standard sample schemas. They no longer use the old standbyscott/tiger schema. These new sample schemas are much more featurerich and so make it easier to demonstrate Oracle features. All Oraclesample code and training will be using these new schemas verysoon. Most already does.

Thin Driver:
the thin JDBC Driver can be used to develop both Java applets and Java applications. Since it is written completely in Java it is downloadable and therefore can be used with Java applets. It can also be used for Java applications but only if you are using TCP/IP. Unlike the JDBC OCI driver, the Thin JDBC driver only works with TCP/IP-based networks. Users who are running applications on non-TCP/IP networks are encouraged to use the JDBC OCI driver.

OCI Driver:
the JDBC OCI Driver is not designed for use with Java applets but designed for client-server Java applications and Java-based middle tiers. The Thin JDBC Driver is targeted for Java applet developers. The JDBC OCI driver transforms calls from Java to C [since the driver must use a layer of C in order to make calls to the OCI], the driver is written in a combination of Java and C which precludes it from being downloadable. Further, JDBC OCI driver also requires installation of the OCI libraries, SQL*Net, CORE libraries and other required support files on the machine on which the JDBC driver is installed i.e. on each of the client machines or the middle-tier Java application server.

Access Oracle JDBC FAQ.

Tuesday, March 06, 2007

How to view all the oracle tables in a schema?

In MySQL, we can use commands like "show tables" to view all the tables in the current database. However, when I tried to find such a command in the Oracle documentation, i didn't succeed.
I'm not should if there is such a command.
But if you want to display all the oracle tables, here's the sql statement you should use:
SELECT table_name FROM tabs;