วันพุธ, ตุลาคม 05, 2548

Helpful web developer tips.

sitepoint.com
My Top Ten CSS Tricks
By Trenton Moss

1. Block vs. Inline Level Elements
2. Another Box Model Hack Alternative
3. Minimum Width for a Page
4. IE and Width and Height Issues
5. Text-transform Command
6. Disappearing Text or Images in IE?
7. Invisible Text
8. CSS Document for Handhelds
9. 3-d Push Button Effect
10. Same Navigation Code on Every Page

วันอาทิตย์, พฤษภาคม 08, 2548

เทคนิคการใช้รูปปกหนังสือจาก Amazon.com

สมมติเราได้รูปหน้าปกแบบนี้

http://images.amazon.com/images/P/1590592433.01._PIdp-schmoo2,TopRight,7,-26_PE32_SCMZZZZZZZ_.jpg

PE32 แปลว่าลด 32% ถ้าลบออกก้อจะไม่มี คำว่า discount 32% เลข 32 อาจแก้ได้เป็น 99% ก้อได้

http://images.amazon.com/images/P/1590592433.01._PIdp-schmoo2,TopRight,7,-26_SCMZZZZZZZ_.jpg

ถ้าจะลบคำว่า look inside ก้อลบออกจนเหลือ url ข้างล่าง

http://images.amazon.com/images/P/1590592433.01._SCMZZZZZZZ_.jpg

image size ยังมีอีก 3 ขนาด

THUMBZZZ | 40 x 60 pixels, very small

MZZZZZZZ | 93 x 140 pixels, standard size

LZZZZZZZ | 317 x 475 pixels, very large

Thanks, K.sui (e-pro)

วันจันทร์, เมษายน 11, 2548

Using MySQL database with OC4J

From http://radio.weblogs.com/0135826/2004/03/29.html
? Copyright 2004 Debu Panda.


I received few requests to provide the steps to configure OC4J to use MySQL database. You can configure any database if you have a JDBC driver to be used with OC4J, however Oracle supports third-party databases like IBM DB2, Microsoft SQLServer, Sybase, etc. by using DataDirect JDBC drivers. The DataDirect drivers can be dowloaded from OTN (http://otn.oracle.com) for exclusive use with Oracle Application Server. In this blog entry, I will provide the steps to configure OC4J to use MySQL database. Please note that this note is for demonstration purpose only and is not officially supported by Oracle.

Assumption

This example assumes MySQL database is installed and configured. Let us assume that you have a name named EMP created in the Test database. Also you have downloaded the MySQL Connector/J JDBC driver from http://www.mysql.com/downloads/api-jdbc.html and readily available for use. Also I'm assuming that you are using OC4J 9.0.4 production or OC4J 10.0.3 Developer preview. You can download OC4J from http://otn.oracle.com/tech/java/oc4j/index.html.

Configure OC4J

1. Install JDBC Diver

You have to copy the JDBC driver library i.e. mysql-connector-java-3.0.11-stable-bin.jar to %OC4J_HOME%/j2ee/home/applib directory.

2. Create DataSource

Create the datasource entry for connecting to the MySQL database in the %OC4J_HOME%/j2ee/home/config/data-sources.xml as follows:

class="com.mysql.jdbc.jdbc2.optional.MysqlDataSource"

name="mysqlDS"

location="jdbc/mysqlCoreDS"

xa-location="jdbc/xa/mysqlXADS"

ejb-location="jdbc/mysqlDS"

connection-driver="com.mysql.jdbc.Driver"

username="root"

password="welcome"

url="jdbc:mysql://144.25.134.24/Test"

inactivity-timeout="30"

/>

3. Test DataSource

You have to restart OC4J before you can use the DataSource you created in the previous step. Here is a sample JSP that you can use to test the DataSource that you created in the previous step.

<%@ page import="java.sql.*, javax.naming.*, javax.sql.*" %>

<% try { InitialContext ctx = new InitialContext();

DataSource ds = (DataSource) ctx.lookup("jdbc/mysqlDS");

Connection con = ds.getConnection(); Statement statement = con.createStatement();

ResultSet rset = statement.executeQuery("select * from emp"); %>

Test OC4J with MySQL DB



<table align="center" border="1">

<% while (rset.next()) { %>

<tr><td>

<%= rset.getInt(1) %>

<tbody><tr><td>

<%= rset.getString(2) %>
<td>

<% } statement.close();

con.close(); }

catch(Exception e)

{ out.print(e.getMessage()); }

%>

วันศุกร์, เมษายน 08, 2548

Firefox Shortcut

To use the keyboard shortcuts hold down CTRL and press one of the following:

TOpens a new tab and takes the focus to the new tab
OOpen Local File. This is one of the biggest changes from IE where both Ctrl-O and Ctrl-L opened a dialogue box for a URL.
LChanges focus to the Address bar
TabScrolls through the tabs from current window towards the right. Loops back to the first tab when rightmost tab is reached
1..0The numbers 1 to 0 takes the focus to Tab 1 to 10
NOpens a new window like IE
Wa tab or if there are no tabs, close the window
BOpen bookmark sidepanel
DBookmark current page
HBrings up the history dialogue box on the right. Useful if you closed a page accidentally and forgot the URL. Or to make sure your kids are not looking at pr0n
UShow page source
YOpen downloads window
KFocus goes to search bar

Some of the more common shortcuts just for the heck of it.

RRefresh current page
FFind in page
GFind Again (used in conjunction with Ctrl F)
JPage Info (same as properties in IE)
-Decrease font size
+Increase font size
SSave current page to disk
PPrint current page
ASelect All

A note about copy and pasting in Firefox; it is not integrated as closely as IE and the Office Suite for better or worse. For example copying the contents of a page directly in IE and pasting into Word for example keeps the formatting most of the time. Doing the same thing with Firefox results in plain text being copied over.

*edit An astute reader has pointed out another shortcut, "/" just the slash, not brackets which activates an incremental search; it will go to the first instance of the string that is typed in. Hit F3 to find again or hit ESC to cancel the search.

A more specific version of the incremental search is "'" which only finds links with the string entered.

*edit July 26th 2004 Thanks to August who pointed out yet a few more shortcuts as well as a small note - increasing the font size is the = and + key an would more correctly be CTRL =

F5 - refresh page
F6 - Same as CTRL-L, focus is taken to the address bar
CTRL Y - Open up the downloads window
CTRL K - Focus is taken to search bar
-----------------
Thanks to Achilles @www.tweakfactor.com

Firefox Tweak

Performance Settings

Quick and Dirty Settings
user_pref("network.http.pipelining", true);
user_pref("network.http.pipelining.firstrequest", true);
user_pref("network.http.pipelining.maxrequests", 8);
user_pref("nglayout.initialpaint.delay", 0);

Common to all configurations

These are the settings that seem to be common to all configuration files regardless of connection speed or computer speed with a couple of additions - plugin paths can be found with about:plugins and the bookmark menu delay is turned off.

user_pref("network.http.pipelining", true);
user_pref("network.http.proxy.pipelining", true);
user_pref("network.http.pipelining.maxrequests", 8);
user_pref("content.notify.backoffcount", 5);
user_pref("plugin.expose_full_path", true);
user_pref("ui.submenuDelay", 0);

Fast Computer Fast Connection

user_pref("content.interrupt.parsing", true);
user_pref("content.max.tokenizing.time", 2250000);
user_pref("content.notify.interval", 750000);
user_pref("content.notify.ontimer", true);
user_pref("content.switch.threshold", 750000);
user_pref("nglayout.initialpaint.delay", 0);
user_pref("network.http.max-connections", 48);
user_pref("network.http.max-connections-per-server", 16);
user_pref("network.http.max-persistent-connections-per-proxy", 16);
user_pref("network.http.max-persistent-connections-per-server", 8);
user_pref("browser.cache.memory.capacity", 65536);

A couple settings of note - Firefox is allocated 4096 KB of memory by default and in this configuration we give it roughly 65MB as denoted by the last line. This can be changed according to what is used.

Fast Computer, Slower Connection

This configuration is more suited to people without ultra fast connections. We are not talking about dial up connections but slower DSL / Cable connections.

user_pref("content.max.tokenizing.time", 2250000);
user_pref("content.notify.interval", 750000);
user_pref("content.notify.ontimer", true);
user_pref("content.switch.threshold", 750000);
user_pref("network.http.max-connections", 48);
user_pref("network.http.max-connections-per-server", 16);
user_pref("network.http.max-persistent-connections-per-proxy", 16);
user_pref("network.http.max-persistent-connections-per-server", 8);
user_pref("nglayout.initialpaint.delay", 0);
user_pref("browser.cache.memory.capacity", 65536);

Fast Computer, Slow Connection
user_pref("browser.xul.error_pages.enabled", true);
user_pref("content.interrupt.parsing", true);
user_pref("content.max.tokenizing.time", 3000000);
user_pref("content.maxtextrun", 8191);
user_pref("content.notify.interval", 750000);
user_pref("content.notify.ontimer", true);
user_pref("content.switch.threshold", 750000);
user_pref("network.http.max-connections", 32);
user_pref("network.http.max-connections-per-server", 8);
user_pref("network.http.max-persistent-connections-per-proxy", 8);
user_pref("network.http.max-persistent-connections-per-server", 4);
user_pref("nglayout.initialpaint.delay", 0);
user_pref("browser.cache.memory.capacity", 65536);

Slow Computer, Fast Connection
user_pref("content.max.tokenizing.time", 3000000);
user_pref("content.notify.backoffcount", 5);
user_pref("content.notify.interval", 1000000);
user_pref("content.notify.ontimer", true);
user_pref("content.switch.threshold", 1000000);
user_pref("content.maxtextrun", 4095);
user_pref("nglayout.initialpaint.delay", 1000);
user_pref("network.http.max-connections", 48);
user_pref("network.http.max-connections-per-server", 16);
user_pref("network.http.max-persistent-connections-per-proxy", 16);
user_pref("network.http.max-persistent-connections-per-server", 8);
user_pref("dom.disable_window_status_change", true);

One of the changes made for this particular configuration is the final line where the status bar is disabled for changing web pages to save processor time.

Slow Computer, Slow Connection

We have entered the doldrums of the dial-up user

user_pref("content.max.tokenizing.time", 2250000);
user_pref("content.notify.interval", 750000);
user_pref("content.notify.ontimer", true);
user_pref("content.switch.threshold", 750000);
user_pref("nglayout.initialpaint.delay", 750);
user_pref("network.http.max-connections", 32);
user_pref("network.http.max-connections-per-server", 8);
user_pref("network.http.max-persistent-connections-per-proxy", 8);
user_pref("network.http.max-persistent-connections-per-server", 4);
user_pref("dom.disable_window_status_change", true);


วันพฤหัสบดี, มีนาคม 24, 2548

Play with google.com : search (many many) ebook

credit to: projectw.org
realguju
As you know Google.com is the most popular search engine in the world.
Here are some tips to helps you find eBooks with Google:
Find Apache's (default) Index page
Try this query:
+("index of") +("/ebooks"|"/book") +(chm|pdf|zip|rar) +apache
Find a particular eBook file
allinurl: +(rar|chm|zip|pdf|tgz) TheTitle
i.e. allinurl: +(rar|chm|zip|pdf|tgz) Human Instinct
- - - - - - - - - - -
Hello all,

Google supports several advanced operators, which are query words that have special meaning to Google. Typically these operators modify the search in some way, or even tell Google to do a totally different type of search. For examples :

site: If you include [site:] in your query, Google will restrict the results to those websites in the given domain. For instance, [help site:www.google.com] will find pages about help within www.google.com. [help site:com] will find pages about help within .com urls. Note there can be no space between the "site:" and the domain.

allintitle: If you start a query with [allintitle:], Google will restrict the results to those with all of the query words in the title. For instance, [allintitle: google search] will return only documents that have both "google" and "search" in the title.

intitle: If you include [intitle:] in your query, Google will restrict the results to documents containing that word in the title. For instance, [intitle:google search] will return documents that mention the word "google" in their title, and mention the word "search" anywhere in the document (title or no). Note there can be no space between the "intitle:" and the following word.

Putting [intitle:] in front of every word in your query is equivalent to putting [allintitle:] at the front of your query: [intitle:google intitle:search] is the same as [allintitle: google search].

allinurl: If you start a query with [allinurl:], Google will restrict the results to those with all of the query words in the url. For instance, [allinurl: google search] will return only documents that have both "google" and "search" in the url.

Note that [allinurl:] works on words, not url components. In particular, it ignores punctuation. Thus, [allinurl: foo/bar] will restrict the results to page with the words "foo" and "bar" in the url, but won't require that they be separated by a slash within that url, that they be adjacent, or that they be in that particular word order. There is currently no way to enforce these constraints.

inurl: If you include [inurl:] in your query, Google will restrict the results to documents containing that word in the url. For instance, [inurl:google search] will return documents that mention the word "google" in their url, and mention the word "search" anywhere in the document (url or no). Note there can be no space between the "inurl:" and the following word.

Putting "inurl:" in front of every word in your query is equivalent to putting "allinurl:" at the front of your query: [inurl:google inurl:search] is the same as [allinurl: google search].

Newkid
- - - - - - - - -
It was the cool tips I found today ;) enjoy!

วันอาทิตย์, มีนาคม 20, 2548

Remove un-wanted programs in XP

This eKB will let you Remove Windows Components such as Windows Messenger, MSN Explorer, Pinball, Word Pad, Terminal Serve (XP Pro Only, Needed for Remote Desktop.) and programs in the Accessories menu on the All Programs menu.


Open Notepad (Start->All Programs->Accessories)

Click File, open. Navigate to the Windows folder or the WINNT folder if you upgraded from Win 2k or NT. Then open the INF folder. Open up the SYSOC.INF file.

Delete the HIDE towards the end of the line. Do not delete the commas. Don't put any spaces in-between the commas.


Sample sysoc.inf file: (Note all of them are listed here: MSN Explorer, Windows Movie Maker)
========================================================
[Version]
Signature = "$Windows NT$"
DriverVer=07/01/2001,5.1.2600.0

[Components]
NtComponents=ntoc.dll,NtOcSetupProc,,4
WBEM=ocgen.dll,OcEntry,wbemoc.inf,hide,7
Display=desk.cpl,DisplayOcSetupProc,,7
Fax=fxsocm.dll,FaxOcmSetupProc,fxsocm.inf,,7
NetOC=netoc.dll,NetOcSetupProc,netoc.inf,,7
iis=iis.dll,OcEntry,iis.inf,,7
com=comsetup.dll,OcEntry,comnt5.inf,hide,7
dtc=msdtcstp.dll,OcEntry,dtcnt5.inf,hide,7
IndexSrv_System = setupqry.dll,IndexSrv,setupqry.inf,,7
TerminalServer=TsOc.dll, HydraOc, TsOc.inf,hide,2 <== Terminal Server (Disables Fast User Login, Remote Desktop.)
msmq=msmqocm.dll,MsmqOcm,msmqocm.inf,,6
ims=imsinsnt.dll,OcEntry,ims.inf,,7
fp_extensions=fp40ext.dll,FrontPage4Extensions,fp40ext.inf,,7
AutoUpdate=ocgen.dll,OcEntry,au.inf,hide,7 <== Auto Update
msmsgs=msgrocm.dll,OcEntry,msmsgs.inf,hide,7 <== Windows Messenger (aka MSN Messenger)
RootAutoUpdate=ocgen.dll,OcEntry,rootau.inf,,7
IEAccess=ocgen.dll,OcEntry,ieaccess.inf,,7


Games=ocgen.dll,OcEntry,games.inf,,7 <== Games
AccessUtil=ocgen.dll,OcEntry,accessor.inf,,7
CommApps=ocgen.dll,OcEntry,communic.inf,HIDE,7
MultiM=ocgen.dll,OcEntry,multimed.inf,HIDE,7
AccessOpt=ocgen.dll,OcEntry,optional.inf,HIDE,7
Pinball=ocgen.dll,OcEntry,pinball.inf,HIDE,7 <== Pinball
MSWordPad=ocgen.dll,OcEntry,wordpad.inf,HIDE,7 <== WordPad
ZoneGames=zoneoc.dll,ZoneSetupProc,igames.inf,,7


[Global]
WindowTitle=%WindowTitle%
WindowTitle.StandAlone="*"
===========================================================

Click File, then save.

Open The Add or Remove Programs in Control Panel.


Click on Add/Remove Windows Components. You will now see options for Accessories and Utilities (the programs in the Accessories menu on the Start panel), MSN Explorer and several other components.


Remove the check next to the component to remove it or check it to install it from your XP CD.

Please be careful what components you remove though!
----------------------------------
Author: Eric C. Vogel
Source: Eric C. Vogel
Posted: 10/6/2001
Updated: 6/7/2002

วันพฤหัสบดี, มีนาคม 17, 2548

Setting up to enable internet browsing via bluetooth with Nokia modem (GPRS)

Preiquesited:
  1. bluetooth dongle
  2. Nokia mobile, GPRS and bluetooth enabled
  3. GSM sim (dtac,ais,true-orange)
  • Go to : Start menu>control panel > phone and modem options>
  • select Tap Modem
  • select item Bluetooth Modem then select Properties from context menu (right click)
  • select Tap Advance then type +cgdcont=1,"ip","www.dtac.co.th" into Extra initailization Commands box.
    *parameter may work for DTAC with nokia mobile only
  • Then click OK to confirm modification. OK again.
  • go to bluetooth software...pairing device together.
  • Explore blueetooth device. Excute on item Dial-up Networking on xxx.
  • There's a "Connect Bluetooth Connection" window appeared. use *99***1# for dial no.
    leave other field blank.
  • That's it. It should work!!

วันพุธ, มีนาคม 16, 2548

Finding things from google

just nw to the forum

i have seen many request for free games of nokia on this forum..the best method i found is through google..

just type the following line in your google search box and see experience a new world of finding games

for games
"parent directory" nokia games -xxx -html -htm -php -shtml -opendivx -md5 -md5sums

for tones
"parent directory " nokia polyphonic -xxx -html -htm -php -shtml -opendivx -md5 -md5sums

for symbian games
"parent directory " symbian games -xxx -html -htm -php -shtml -opendivx -md5 -md5sums

for Wallpapers
"parent directory " nokia wallpapers -xxx -html -htm -php -shtml -opendivx -md5 -md5sums

for general Midi
"parent directory " midi -xxx -html -htm -php -shtml -opendivx -md5 -md5sums
Got From ZEDGE Tutorials

วันจันทร์, กุมภาพันธ์ 14, 2548

HOW-TO configure Oracle Datasource with Tomcat 4.1.x

JNDI Datasource HOW-TO
Database Connection Pool (DBCP) Configurations
DBCP provides support for JDBC 2.0. On systems using a 1.4 JVM DBCP will support JDBC 3.0.
    DBCP uses the Jakarta-Commons Database Connection Pool. It relies on number of Jakarta-Commons componenets:
  • Jakarta-Commons DBCP 1.0
  • Jakarta-Commons Collections 2.0
  • Jakarta-Commons Pool 1.0

These jar files along with your the jar file for your JDBC driver should be installed in $CATALINA_HOME/common/lib.

NOTE:Third Party drivers should be in jarfiles, not zipfiles. Tomcat only adds $CATALINA_HOME/common/lib/*.jar to the classpath.

NOTE: Do not install these jarfiles in your /WEB-INF/lib, or $JAVA_HOME/jre/lib/ext, or anywhere else. You will experience problems if you install them anyplace other than $CATALINA_HOME/common/lib.

Firstly by default, Tomcat will only use *.jar files installed in $CATALINA_HOME/common/lib therefore classes111.zip or classes12.zip will need to be renamed with a .jar extension. Since jarfiles are zipfiles, there is no need to unzip and jar these files - a simple rename will suffice. Also, you should be aware that some (early) versions of Tomcat 4.0 when used with JDK 1.4 will not load classes12.zip unless you unzip the file, remove the javax.sql.* class hierarchy and rejar.


    1. server.xml configuration
    You will need to define your Datasource in your server.xml file. Here we define a Datasource called myoracle using the thin driver to connect as user scott, password tiger to the schema called myschema in the sid called mysid. (Note: with the thin driver this sid is not the same as the tnsname)

    <Resource name="jdbc/myoracle" auth="Container"
    type="javax.sql.DataSource"/>

    <ResourceParams name="jdbc/myoracle">
    <parameter>

    <name>factory</name>
    <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
    </parameter>
    <parameter>
    <name>driverClassName</name>

    <value>oracle.jdbc.driver.OracleDriver</value>
    </parameter>
    <parameter>
    <name>url</name>
    <value>jdbc:oracle:thin:@[db's ip address]:1521:mysid</value>

    </parameter>
    <parameter>
    <name>username</name>
    <value>scott</value>
    </parameter>

    <parameter>
    <name>password</name>
    <value>tiger</value>
    </parameter>
    <parameter>

    <name>maxActive</name>
    <value>20</value>
    </parameter>
    <parameter>
    <name>maxIdle</name>

    <value>10</value>
    </parameter>
    <parameter>
    <name>maxWait</name>
    <value>-1</value>

    </parameter>
    </ResourceParams>

2. web.xml configuration
You should ensure that you respect the element ordering defined by the DTD when you create you applications web.xml file.

<resource-ref>
<description>Oracle Datasource example</description>

<res-ref-name>jdbc/myoracle</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>


3.Code example
You can use the same example application as above (assuming you create the required DB instance, tables etc.) replacing the Datasource code with something like


Context initContext = new InitialContext();
Context envContext = (Context)initContext.lookup("java:/comp/env");
DataSource ds = (DataSource)envContext.lookup("jdbc/myoracle");
Connection conn = ds.getConnection();




..Happy Valentine's Day ..