Recent Notes

Displaying notes 141 - 150
Created by voodoo on April 01, 2010 04:28:04    Last update: April 01, 2010 04:37:32
You were tempted by "my fun cards" and installed "my web search" on your computer. Although some people say "my web search" is harmless, but still it behaved scary. So you want to uninstall it. You click the "Add/Remove Programs" and removed the "my web search" toolbar. But then when you type in things in the Firefox address bar you find that it still brings up "my web search"! Here's how to get rid of it: Enter "about:config" in the address bar (and promise that you'll be careful). Enter "myweb" in the filter box Reset browser.search.selectedEngine and keyword.URL , extensions.mywebsearch.openSearchURL , extensions.mywebsearch.prevKwdEnabled , and extensions.mywebsearch.prevKwdURL . The extensions.mywebsearch.* settings will be removed after Firefox restart. The parameter that affects the address bar search is keyword.URL ...
Created by Dr. Xi on March 31, 2010 19:32:42    Last update: March 31, 2010 19:41:14
The dev database keeps locking up because of failed login attempts. For a dev database, we really don't need such security measure. This is how to remove the limit. Log in as sysdba sqlplus sys@xe as sysdba Find out the profile for the user. SQL> select profile from dba_users where username = 'HIBERNATE'; PROFILE ------------------------------ DEFAULT Look at the current limits SQL> select resource_name, limit from dba_profiles where profile = 'DEFAULT'; RESOURCE_NAME LIMIT -------------------------------- ---------------------------------------- COMPOSITE_LIMIT UNLIMITED SESSIONS_PER_USER UNLIMITED CPU_PER_SESSION UNLIMITED CPU_PER_CALL UNLIMITED LOGICAL_READS_PER_SESSION UNLIMITED LOGICAL_READS_PER_CALL UNLIMITED IDLE_TIME UNLIMITED CONNECT_TIME UNLIMITED PRIVATE_SGA UNLIMITED FAILED_LOGIN_ATTEMPTS 10 PASSWORD_LIFE_TIME UNLIMITED RESOURCE_NAME LIMIT -------------------------------- ---------------------------------------- PASSWORD_REUSE_TIME UNLIMITED PASSWORD_REUSE_MAX UNLIMITED PASSWORD_VERIFY_FUNCTION NULL PASSWORD_LOCK_TIME UNLIMITED PASSWORD_GRACE_TIME UNLIMITED 16 rows selected. Increase the value for failed login attempts SQL> alter profile default ...
Created by Dr. Xi on March 31, 2010 19:18:33
Query the dba_users view to find locked accounts. SQL> select username, account_status, lock_date from dba_users order by username; USERNAME ACCOUNT_STATUS LOCK_DATE ------------------------------ -------------------------------- --------- ANONYMOUS OPEN CTXSYS EXPIRED & LOCKED 20-NOV-06 DBSNMP EXPIRED & LOCKED 07-FEB-06 DIP EXPIRED & LOCKED 07-FEB-06 FLOWS_020100 EXPIRED & LOCKED 07-FEB-06 FLOWS_FILES EXPIRED & LOCKED 07-FEB-06 HIBERNATE OPEN HR EXPIRED & LOCKED 20-NOV-06 JEMUSER OPEN JPA OPEN MDSYS EXPIRED & LOCKED 07-FEB-06 USERNAME ACCOUNT_STATUS LOCK_DATE ------------------------------ -------------------------------- --------- OUTLN EXPIRED & LOCKED 20-NOV-06 SRDEMO OPEN SYS OPEN SYSTEM OPEN TSMSYS EXPIRED & LOCKED 07-FEB-06 XDB EXPIRED & LOCKED 07-FEB-06 17 rows selected. SQL> alter user hibernate account lock; User altered. SQL> select username, account_status, lock_date from dba_users where username = 'HIBERNATE'; USERNAME ACCOUNT_STATUS LOCK_DATE ------------------------------ -------------------------------- --------- HIBERNATE LOCKED 31-MAR-10
Created by Dr. Xi on March 31, 2010 15:35:53
DBA_BLOCKERS displays a session if it is not waiting for a locked object but is holding a lock on an object for which another session is waiting. Column Datatype Description HOLDING_SESSION NUMBER Session holding a lock SQL> select * from dba_blockers; HOLDING_SESSION --------------- 364 SQL> select * from v$lock where sid = 364; ADDR KADDR SID TY ID1 ID2 LMODE REQUEST CTIME BLOCK -------- -------- ---------- -- ---------- ---------- ---------- ---------- ---------- ---------- 978B3CBC 978B3CE8 364 AE 99 0 4 0 2531 0 00502BC4 00502BF4 364 TM 73541 0 3 0 2531 0 96CF4888 96CF48C8 364 TX 196617 151100 6 0 2531 1 SQL> -- find the session that's blocked SQL> select v1.* 2 from v$lock v1, v$lock v2 3 where v1.id1 = v2.id1 and ...
Created by Dr. Xi on March 31, 2010 15:14:39    Last update: March 31, 2010 15:17:46
DBA_WAITERS shows all the sessions that are waiting for a lock. Column Datatype Description WAITING_SESSION NUMBER The waiting session HOLDING_SESSION NUMBER The holding session LOCK_TYPE VARCHAR2(26) The lock type MODE_HELD VARCHAR2(40) The mode held MODE_REQUESTED VARCHAR2(40) The mode requested LOCK_ID1 VARCHAR2(40) Lock ID 1 LOCK_ID2 VARCHAR2(40) Lock ID 2 SQL> set lin 120 SQL> select * from dba_waiters; WAITING_SESSION HOLDING_SESSION LOCK_TYPE MODE_HELD --------------- --------------- -------------------------- ---------------------------------------- MODE_REQUESTED LOCK_ID1 LOCK_ID2 ---------------------------------------- ---------- ---------- 235 364 Transaction Exclusive Exclusive 196617 151100 SQL> Or join the v$session view to find out who it is: select w.waiting_session, w.mode_requested, s.username, s.machine, s.osuser from v$session s, dba_waiters w where s.sid = w.holding_session;
Created by James on March 29, 2010 03:11:38    Last update: March 31, 2010 16:27:58
This is an age old problem. Since it comes up time and time again, I'm writing this down for future reference. Let's start with a two-column layout generated by the 2 Column Layout Generator : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>2 Column CSS Layout - concise design</title> <style type='text/css'> .mask{ position: relative; overflow: hidden; margin: 0px auto; width: 100%; background-color: #f4f4f4 } .header{ float: left; color: white; width: 100%; background-color: #5474f4 } .colleft{ position: relative; width: 100%; right: 32%; background-color: #f4f4f4 } .col1{ position: relative; overflow: hidden; float: left; width: 30%; left: 101%; background-color: #e6e6e6 } .col2{ position: relative; overflow: hidden; float: left; width: 66%; left: 3%; background-color: #e6e6e6 } .footer{ float: left; width: 100%; background-color: #b4caf7 } body ...
Created by James on March 28, 2010 22:09:34    Last update: March 29, 2010 15:01:23
This CSS behavior looks weird to me and I don't know if it's by the spec. It doesn't make sense to me at all. Using this markup: <!doctype html> <html> <body style="width:250px;"> <div style="float:left;background:#ddd;padding:5px;margin:5px;"> The Float </div> <div id="contents"> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </div> </body> </html> the page is rendered like this: i.e., the text of the non-floating div wraps ...
Created by Fang on March 23, 2010 03:50:11    Last update: August 18, 2010 21:59:52
This is a simple web application with a single servlet and a single JSP page. It is intended to be a test bed for JSTL tags. You may want to store all syntax, rules, and exceptions in your head, but in my opinion nothing beats a simple test program that allows you play with it all you want. So here it is (build with Maven ). Prerequisites: Maven: http://maven.apache.org/ . You don't need any prior knowledge of Maven, but you need to install the binary. JBoss: http://jboss.org/jbossas/downloads/ , or Tomcat: http://tomcat.apache.org/ if you don't run the SQL tests. You need to know how to deploy a web application (shh! Don't tell your boss it's just copying a file to the deployment folder). Steps: The directory ...
Created by Fang on March 23, 2010 02:33:54    Last update: March 31, 2010 04:16:40
Expression Language (EL) was introduced since JSTL 1.0, it is part of the JSP spec since JSP 2.0/JSTL 1.1. There's no JSTL without EL. But don't let the name scare you, EL is not another programming language. It's just a simple construct: ${expr} , which means that instead of taking expr literally, it should be evaluated in the page using any page/request/session/application variables exposed to that page. For example, if you put Hello ${world}! in your JSP, world will be evaluated in the page context. If you had set a value for world before, for example, request.setAttribute("world", "John Doe"); in your Struts action class or a servlet, the JSP page would show: Hello John Doe! There were confusions about EL support in various servlet/JSP/JSTL version ...
Created by Fang on March 23, 2010 01:43:47    Last update: September 03, 2010 14:21:15
This is a bare bones, no frills, just the facts tutorial on JSTL. I will not bother you with theories, principles, best practices, anecdotes, or any other junk, because JSTL is shallow and simple, and I don't want to make it sound deep or complex. Getting ready Core Tags : <c:out> , <c:set> , <c:remove> , <c:catch> : <c:if> , <c:choose> , <c:when> , <c:otherwise> , <c:forEach> , <c:forTokens> : <c:import> , <c:url> , <c:redirect> , <c:param> Internationalization (i18n) and formatting tags : <fmt:setLocale> , <fmt:requestEncoding> : <fmt:message> , <fmt:bundle> , <fmt:setBundle> , <fmt:param> : <fmt:formatNumber> , <fmt:parseNumber> , <fmt:formatDate> , <fmt:parseDate> , <fmt:setTimeZone> , <fmt:timeZone> SQL tags SQL tags are used to run SQL statements. I don't know why they are in JSTL, but ...