Using JSF 1.2 on Oracle Workshop for Weblogic (Portal 10.3)
Posted by watashii | Filed under Programming, Web
When choosing facets during the creation of a new portal web project, the built-in Sun RI JSF 1.2 (together with JSTL 1.2) facets cannot be selected. Here are the recommended (by Oracle) steps to get around this problem. Note that this is because Apache Beehive Page Flow has a dependecy with JSF 1.2, therefore only follow this if not using the page flow integration components provided by Beehive.
Tags: facets, jsf, jstl, portal, weblogic
Syntax Highlight Code On Any Page Using Google Code Prettify
Posted by watashii | Filed under Programming, Web

The Google Code Prettify is a JavaScript module that allows syntax highlighting of any code snippets on a HTML page. Setting this up on any web page is a simple 3 step process, and is supported on most common browsers.
[Demo] (Based on: prettify-21-May-2009.zip)
[Download Source Files]
Tags: highlight, html, javascript, prettify, syntax
Live Messenger 8.1/8.5 Bypass Mandatory Upgrade
Posted by watashii | Filed under Software, Web

Today when logging into my Windows Live Messenger 8.1, I received a message forcing me to upgrade to the latest Windows Live Messenger (2009). This was discussed on their blog less than 1 month ago (thanks for the short heads-up). However, like many others, upgrading to the 2009 version was not ideal. That is: it just doesn’t work at all.
For me, I ran into problems logging in (via my workplace), as I kept getting the error: “Signing in to Windows Live Messenger failed because the authentication service is not compatible with this version of the program.
Error code: 8100030f”. And NOTHING in the online help provided any clues with this message!
So the only resolution for me was to find a way to continue using the old version. Here I found a workaround to skip the mandatory upgrade (I’m on XP, however Vista should work also).
Tags: live messenger, msn, windows
BusinessObjects Enterprise – Changing Tomcat Session Timeout
Posted by watashii | Filed under BusinessObjects, Software, Web
To change the timeout limit of a BusinessObjects Enterprise XIR2 (Solaris) logged-in session (with Tomcat), the following files needs to be modified:
$BOBJE_HOME/tomcat/webapps/businessobjects/WEB-INF/web.xml
$BOBJE_HOME/tomcat/webapps/businessobjects/enterprise115/desktoplaunch/WEB-INF/web.xml
$BOBJE_HOME/tomcat/webapps/businessobjects/enterprise115/adminlaunch/WEB-INF/web.xml
$BOBJE_HOME/tomcat/webapps/businessobjects/enterprise115/adhoc/WEB-INF/web.xml
Find the following setting within the web.xml file to change the timeout value in minutes.
<!-- Define the default session timeout for your application,
in minutes. From a servlet or JSP page, you can modify
the timeout for a particular session dynamically by using
HttpSession.getMaxInactiveInterval(). -->
<session-config>
<session-timeout>20</session-timeout> <!-- 20 minutes for session objects -->
</session-config>
Then just restart the Apache Tomcat webserver to take effect.
Tags: BusinessObjects, jsp, timeoute, tomcat
Get URL Variables in JavaScript & HTML
Posted by watashii | Filed under Programming, Web
The following structure stores variables within a request URL:
http://www.mydomain.com/index.html?month=January&day=Tuesday
To read the variables within the index HTML file, we must process the URL string entirely, since there is no built-in functions which magically does it. The following JavaScript demonstrates this:
function getUrlVars()
{
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for(var i = 0; i < hashes.length; i++)
{
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
}
To use the variables, we run the following to extract the values:
var myHash = getUrlVars();
alert(myHash['month']); // prompts the value 'January'
alert(myHash['day']); // prompts the value 'Tuesday'
Tags: html, javascript, url
Easily Find Wallpaper For Your Desktop Resolution
Posted by watashii | Filed under Web

There is a nice little trick (or hidden feature) on Google Image Search that allows you to search images of specific resolution size and filetype. Using this technique, we can search for the right image our desktop wallpaper. This can be achieved by using the imagesize and filetype search parameter.
For example:
[imagesize:1900x1200 filetype:jpg design] finds 1900px by 1200px images related to design.
[imagesize:256x256 filetype:png icon] finds 256px by 256px icons.
Tags: google, image, search engine, wallpaper
Display WordPress Unicoded Characters
Posted by watashii | Filed under Web, WordPress
Recently upgraded my WP blog, and released some japanese/chinese characters (in Unicode) were displaying strangely, giving me question marks (????) and funny symbols (トトãƒ).
I learnt that this can be fixed by modifying the WP source file wp-config.php on the web server. The change required is simply commenting the following 2 lines of code, by adding a // in front of:
/** Database Charset to use in creating database tables. */
//define('DB_CHARSET', 'utf8');
/** The Database Collate type. Don't change this if in doubt. */
//define('DB_COLLATE', '');
Directly Modify & Edit A Webpage
Posted by watashii | Filed under Software, Web

Want to modify a web page on your browser, or delete an image directly from the page? Here is a very cool shortcut that allows you to do this without using any other programs.
In fact, you can do this right here by loading this link.
Tip: Add the link as a bookmark, then whenever you would like to modify a page, just click on the bookmark. Easy!
Tags: bookmarklet, Web
A Better LightBox Using jQuery
Posted by watashii | Filed under Programming, Web

The jQuery lightBox plugin (by Leandro Vieira Pinho) uses the jQuery JavaScript library to create an overlay effect of opening up images on top of a web page, and creating a navigable slideshow view. See my demo below.
Setting this up on your own web page is an easy 2-step process: include the JavaScript and CSS on the webpage header, and then call the jQuery function. The only change required is on the header.
This plugin is an improvement over the LighBox2 plugin which was demonstrated earlier, because we didn’t need to modify our link tags to activate it, thanks to the jQuery element selector.
[Demo]
[Download Source Files]
Tags: css, demo, images, javascript, jquery, lightbox
Overlay & Slideshow Images with Lightbox 2
Posted by watashii | Filed under Programming, Web

The Lightbox2 plugin uses the Prototype and Scriptaculous JavaScript libraries to create an overlay effect of opening up images on top of a web page, and creating a navigable slideshow view.
Setting this up on your own web page is an easy 2-step process: include the JavaScript and CSS on the header, and then on each link tag embed the rel=”lightbox” and title=”my caption” attributes.
[Demo]
[Download Source Files]
Tags: css, images, javascript, lightbox
