<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5151165748331362515</id><updated>2011-07-31T02:45:40.344+05:30</updated><category term='print'/><category term='scheduler'/><category term='ant'/><category term='css'/><category term='timer'/><category term='javascript'/><category term='java'/><category term='sql'/><category term='build'/><category term='language support'/><category term='html'/><category term='classpath'/><category term='tablespace'/><category term='Windows'/><category term='special charaters'/><category term='file I/O'/><category term='move'/><category term='insert'/><category term='thread'/><category term='unicode_character'/><category term='jar'/><category term='entity'/><title type='text'>J2EE Notes</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://rijusnotes.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5151165748331362515/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://rijusnotes.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Riju Thomas</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5151165748331362515.post-7287388365896855256</id><published>2009-07-13T18:26:00.007+05:30</published><updated>2009-07-13T18:53:32.231+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='print'/><category scheme='http://www.blogger.com/atom/ns#' term='html'/><category scheme='http://www.blogger.com/atom/ns#' term='css'/><title type='text'>Hide an html element while printing the web page.</title><content type='html'>We may encounter certain scenarios where we may have to hide some part of our web page from printing.&lt;br /&gt;Eg: A printer icon shown in a print preview page. Or a price column in the shopping cart etc.&lt;br /&gt;&lt;br /&gt;we can use css for hiding the html elements while printing.&lt;br /&gt;&lt;br /&gt;1. Add the following css class to your stylesheet.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;@media print {&lt;br /&gt;        .printHide {&lt;br /&gt;            display:none;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;2. Add the style class, printHide for the elements which you want to hide.&lt;br /&gt;&lt;br /&gt;The following eg code will hide the link "print" while printing the page.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;!DOCTYPE HTML PUBLIC &amp;quot;-//W3C//DTD HTML 4.0 Transitional//EN&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;HTML&amp;gt;&lt;br /&gt; &amp;lt;HEAD&amp;gt;&lt;br /&gt;  &amp;lt;style&amp;gt;&lt;br /&gt;   @media print {&lt;br /&gt;    .printHide {&lt;br /&gt;     display:none;&lt;br /&gt;    }&lt;br /&gt;   }&lt;br /&gt;  &amp;lt;/style&amp;gt;&lt;br /&gt; &amp;lt;/HEAD&amp;gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;BODY&amp;gt;&lt;br /&gt;  &amp;lt;a href=&amp;quot;javascript:void(0);&amp;quot; onclick=&amp;quot;window.print();&amp;quot;&lt;br /&gt;       class=&amp;quot;printHide&amp;quot;&amp;gt;Print This Page&amp;lt;/a&amp;gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;p&amp;gt;&lt;br /&gt;  Text Text Text Text Text &lt;br /&gt;  Text Text Text Text Text &lt;br /&gt;  &amp;lt;/p&amp;gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;p&amp;gt;&lt;br /&gt;  Text Text Text Text Text&lt;br /&gt;  Text Text Text Text Text&lt;br /&gt;  &amp;lt;/p&amp;gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;/BODY&amp;gt;&lt;br /&gt;&amp;lt;/HTML&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5151165748331362515-7287388365896855256?l=rijusnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rijusnotes.blogspot.com/feeds/7287388365896855256/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rijusnotes.blogspot.com/2009/07/hide-html-element-while-printing-web.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5151165748331362515/posts/default/7287388365896855256'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5151165748331362515/posts/default/7287388365896855256'/><link rel='alternate' type='text/html' href='http://rijusnotes.blogspot.com/2009/07/hide-html-element-while-printing-web.html' title='Hide an html element while printing the web page.'/><author><name>Riju Thomas</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5151165748331362515.post-4619750728857642962</id><published>2009-06-24T18:10:00.002+05:30</published><updated>2009-06-24T19:35:30.543+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='sql'/><category scheme='http://www.blogger.com/atom/ns#' term='unicode_character'/><category scheme='http://www.blogger.com/atom/ns#' term='insert'/><title type='text'>Insert Double Byte Characters to Database</title><content type='html'>We cannot insert the double byte characters (eg: Chinese, Russian, Japanese etc) into a database directly. This is not possible even if we configure the database to Unicode encoding.&lt;br /&gt;&lt;br /&gt;All the editors we use to run the sql does not recognize the double byte characters. They support only ASCI characters. So if we try to run a query which contains a double byte character, say Chinese, then the editor will replace the characters with question marks (???) means it does not recognize the symbol.&lt;br /&gt;&lt;br /&gt;For Eg: if we copy the following query to an sql editor,&lt;br /&gt;&lt;br /&gt;insert into &lt;table_name&gt; (&lt;column_name&gt;) values ('&amp;#25903;&amp;#20184;&amp;#23453;');&lt;br /&gt;&lt;br /&gt;then the editor will convert it as&lt;br /&gt;&lt;br /&gt;insert into &lt;table_name&gt; (&lt;column_name&gt;) values ('???');&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;There is a solution for this issue.&lt;br /&gt;&lt;br /&gt;We can use the sql function compose() and we can pass the unicode of the characters to the function.&lt;br /&gt;&lt;br /&gt;Eg:  insert into &lt;table_name&gt; (&lt;column_name&gt;) values (compose(unistr('\652F\4ED8\5B9D')));&lt;br /&gt;&lt;br /&gt;This will insert the double character to the db.&lt;br /&gt;&lt;br /&gt;The characters can be converted to the unicode using the following site&lt;br /&gt;http://rishida.net/scripts/uniview/conversion.php&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5151165748331362515-4619750728857642962?l=rijusnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rijusnotes.blogspot.com/feeds/4619750728857642962/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rijusnotes.blogspot.com/2009/06/insert-double-byte-characters-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5151165748331362515/posts/default/4619750728857642962'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5151165748331362515/posts/default/4619750728857642962'/><link rel='alternate' type='text/html' href='http://rijusnotes.blogspot.com/2009/06/insert-double-byte-characters-to.html' title='Insert Double Byte Characters to Database'/><author><name>Riju Thomas</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5151165748331362515.post-9172831886759450033</id><published>2009-06-12T16:22:00.012+05:30</published><updated>2009-06-12T17:42:36.708+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='classpath'/><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='jar'/><category scheme='http://www.blogger.com/atom/ns#' term='build'/><category scheme='http://www.blogger.com/atom/ns#' term='ant'/><title type='text'>How to generate class-path variable in Manifest file of a jar</title><content type='html'>&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&lt;/o:p&gt;The project has dependency on some external jar files. To create a build file in such a way that build.xml doesn’t need to be modified when a new jar file is added to the lib folder.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;      &lt;p class="MsoNormal"&gt;For that we need to generate Class-Path attribute in the MANIFEST.MF dynamically. The following code shows how to do that.&lt;/p&gt;  &lt;p&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;br /&gt;1. Define a path element say, classpath      &lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;&amp;lt;path id="classpath"&amp;gt;&lt;br /&gt;&lt;span style=""&gt;        &lt;/span&gt;&amp;lt;fileset dir="${lib.dir}" includes="**/*.jar"/&amp;gt;&lt;br /&gt;&lt;span style=""&gt;    &lt;/span&gt;&amp;lt;/path&amp;gt;      &lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;The above code will set the absolute path of all the jar files in the lib folder to the path element 'classpath'&lt;br /&gt;&lt;br /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;p&gt;&lt;/p&gt;    &lt;p&gt;2. Convert the path element values into relative path and store it in a string property, say jar.classpath                &lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;&amp;lt;pathconvert property="jar.classpath" refid="classpath" pathsep=" "&amp;gt;&lt;br /&gt;&lt;span style=""&gt;        &lt;/span&gt;&amp;lt;mapper&amp;gt;&lt;br /&gt;&lt;span style=""&gt;            &lt;/span&gt;&amp;lt;chainedmapper&amp;gt;&lt;br /&gt;&lt;span style=""&gt;                &lt;/span&gt;&amp;lt;flattenmapper/&amp;gt;&lt;br /&gt;&lt;span style=""&gt;                &lt;/span&gt;&amp;lt;globmapper from="*.jar" to="lib/*.jar"/&amp;gt;&lt;br /&gt;&lt;span style=""&gt;            &lt;/span&gt;&amp;lt;/chainedmapper&amp;gt;&lt;br /&gt;&lt;span style=""&gt;        &lt;/span&gt;&amp;lt;/mapper&amp;gt;&lt;br /&gt;&lt;span style=""&gt;    &lt;/span&gt;&amp;lt;/pathconvert&amp;gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;3. Use the property 'jar.classpath' to define the manifest file while creating the jar.&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style=""&gt;    &lt;/span&gt;&amp;lt;target name="jar" depends="clean,compile"&amp;gt;&lt;br /&gt;&lt;span style=""&gt;        &lt;/span&gt;&amp;lt;mkdir dir="${jar.dir}"/&amp;gt;&lt;br /&gt;&lt;span style=""&gt;        &lt;/span&gt;&amp;lt;mkdir dir="${jar.lib.dir}"/&amp;gt;&lt;br /&gt;&lt;span style=""&gt;        &lt;/span&gt;&amp;lt;!-- Copying the external libraries to build/jar/lib folder. --&amp;gt;&lt;br /&gt;&lt;span style=""&gt;        &lt;/span&gt;&amp;lt;copy todir="${jar.lib.dir}"&amp;gt;&lt;br /&gt;&lt;span style=""&gt;            &lt;/span&gt;&amp;lt;fileset dir="${lib.dir}" excludes="**/*.svn"/&amp;gt;&lt;br /&gt;&lt;span style=""&gt;        &lt;/span&gt;&amp;lt;/copy&amp;gt;&lt;br /&gt;&lt;span style=""&gt;        &lt;/span&gt;&amp;lt;jar destfile="${jar.dir}/${jar.file}" basedir="${classes.dir}" excludes="**/*.svn"&amp;gt;&lt;br /&gt;&lt;span style=""&gt;            &lt;/span&gt;&amp;lt;manifest&amp;gt;&lt;br /&gt;&lt;span style=""&gt;                &lt;/span&gt;&amp;lt;attribute name="Class-Path" value=". ${jar.classpath}" /&amp;gt;&lt;br /&gt;&lt;span style=""&gt;            &lt;/span&gt;&amp;lt;/manifest&amp;gt;&lt;br /&gt;&lt;span style=""&gt;        &lt;/span&gt;&amp;lt;/jar&amp;gt;&lt;br /&gt;&lt;span style=""&gt;    &lt;/span&gt;&amp;lt;/target&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Note :- The lib directory with the external jar files should be in the same directory as that of the project jar file.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;We can't put the external jar files inside the project jar files with the above method.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5151165748331362515-9172831886759450033?l=rijusnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rijusnotes.blogspot.com/feeds/9172831886759450033/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rijusnotes.blogspot.com/2009/06/how-to-generate-class-path-variable-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5151165748331362515/posts/default/9172831886759450033'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5151165748331362515/posts/default/9172831886759450033'/><link rel='alternate' type='text/html' href='http://rijusnotes.blogspot.com/2009/06/how-to-generate-class-path-variable-in.html' title='How to generate class-path variable in Manifest file of a jar'/><author><name>Riju Thomas</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5151165748331362515.post-1246676174975905033</id><published>2009-06-09T17:13:00.001+05:30</published><updated>2009-06-09T17:14:57.036+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='thread'/><title type='text'>Reusability of Thread.</title><content type='html'>&lt;p class="MsoNormal"&gt;&lt;b style=""&gt;Can you resuse a Thread Object? Can you restart it by calling start() again?&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;    &lt;p class="MsoNormal"&gt;No. Once a thread's run() method has completed, the thread can never be restarted. In fact,&lt;span style=""&gt;  &lt;/span&gt;at that point the thread moves into a state - &lt;span style="font-weight: bold; font-style: italic;"&gt;dead&lt;/span&gt;. In dead state, the thead has finished its run()method and can never be restarted. The Thread object might still be on the heap, as aliving object that you can call other methods on (if appropriate), but the Thread object has permanently lost its &lt;span style="font-style: italic;"&gt;'threadness'&lt;/span&gt;. In other words, there is no longer a seperate call stack, and the Thread object is no longer a thread. It's Just an object, at that point, like all other objects.&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;But there are design patterns for making a pool of threads that you can keep using to perform different jobs. But you don't do it by retsarting a&lt;span style=""&gt;  &lt;/span&gt;dead thread.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5151165748331362515-1246676174975905033?l=rijusnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rijusnotes.blogspot.com/feeds/1246676174975905033/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rijusnotes.blogspot.com/2009/06/reusability-of-thread.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5151165748331362515/posts/default/1246676174975905033'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5151165748331362515/posts/default/1246676174975905033'/><link rel='alternate' type='text/html' href='http://rijusnotes.blogspot.com/2009/06/reusability-of-thread.html' title='Reusability of Thread.'/><author><name>Riju Thomas</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5151165748331362515.post-8091961800987677649</id><published>2009-06-09T15:21:00.008+05:30</published><updated>2009-06-09T15:59:37.669+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='scheduler'/><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='timer'/><title type='text'>How to Implement a scheduler in java</title><content type='html'>&lt;p class="MsoNormal"&gt;Use &lt;i style=""&gt;java.util.Timer&lt;/i&gt; and &lt;i style=""&gt;java.util.TimerTask&lt;/i&gt; to Implement a scheduler in java.&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/p&gt;    &lt;p class="MsoNormal"&gt;The following are all the Timer methods you can use to schedule repeated executions of tasks:&lt;span style=""&gt; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;          &lt;p class="MsoNormal"&gt;&lt;i style=""&gt;schedule(TimerTask task, long delay, long period)&lt;br /&gt;schedule(TimerTask task, Date time, long period)&lt;br /&gt;scheduleAtFixedRate(TimerTask task, long delay, long period)&lt;br /&gt;scheduleAtFixedRate(TimerTask task, Date firstTime, long period)&lt;/i&gt;&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;When scheduling a task for repeated execution, use one of the schedule methods when smoothness is important and a scheduleAtFixedRate method when time synchronization is more important.&lt;/p&gt;    &lt;p class="MsoNormal"&gt;&lt;i style=""&gt;schedule&lt;/i&gt; method is appropriate for activities where it is more important to keep the frequency accurate in the short run than in the long run.&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/p&gt;    &lt;p class="MsoNormal"&gt;While in &lt;i style=""&gt;scheduleAtFixedRate&lt;/i&gt;, each execution is scheduled relative to the scheduled execution time of the initial execution. If an execution is delayed for any reason (such as garbage collection or other background activity), two or more executions will occur in rapid succession to "catch up."&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/p&gt;    &lt;p class="MsoNormal"&gt;Call Timer.cancel() to stop the Timer.&lt;br /&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;    &lt;p class="MsoNormal"&gt;Example:&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/p&gt;        &lt;p style="font-style: italic;" class="MsoNormal"&gt;&lt;span style="font-size:85%;"&gt;public class AnnoyingBeep {&lt;br /&gt;&lt;span style=""&gt;    &lt;/span&gt;Toolkit toolkit;&lt;br /&gt;&lt;span style=""&gt;    &lt;/span&gt;Timer timer;&lt;br /&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;                &lt;p style="font-style: italic;" class="MsoNormal"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;    &lt;/span&gt;public AnnoyingBeep() {&lt;br /&gt;&lt;span style=""&gt;        &lt;/span&gt;toolkit = Toolkit.getDefaultToolkit();&lt;br /&gt;&lt;span style=""&gt;        &lt;/span&gt;timer = new Timer();&lt;br /&gt;&lt;span style=""&gt;        &lt;/span&gt;timer.schedule(new RemindTask(),&lt;br /&gt;&lt;span style=""&gt;                       &lt;/span&gt;0,&lt;span style=""&gt;        &lt;/span&gt;//initial delay&lt;br /&gt;&lt;span style=""&gt;                       &lt;/span&gt;1*1000);&lt;span style=""&gt;  &lt;/span&gt;//subsequent rate&lt;br /&gt;&lt;span style=""&gt;    &lt;/span&gt;}&lt;br /&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p style="font-style: italic;" class="MsoNormal"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;    &lt;/span&gt;class RemindTask extends TimerTask {&lt;br /&gt;&lt;span style=""&gt;        &lt;/span&gt;int numWarningBeeps = 3;&lt;/span&gt;&lt;/p&gt;                                &lt;p class="MsoNormal"&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;&lt;span style=""&gt;        &lt;/span&gt;public void run() {&lt;br /&gt;&lt;span style=""&gt;            &lt;/span&gt;if (numWarningBeeps &gt; 0) {&lt;br /&gt;&lt;span style=""&gt;                &lt;/span&gt;toolkit.beep();&lt;br /&gt;&lt;span style=""&gt;           &lt;/span&gt;&lt;span style=""&gt;     &lt;/span&gt;System.out.format("Beep!%n");&lt;br /&gt;&lt;span style=""&gt;                &lt;/span&gt;numWarningBeeps--;&lt;br /&gt;&lt;span style=""&gt;            &lt;/span&gt;} else {&lt;br /&gt;&lt;span style=""&gt;                &lt;/span&gt;toolkit.beep();&lt;br /&gt;&lt;span style=""&gt;                &lt;/span&gt;System.out.format("Time's up!%n");&lt;br /&gt;&lt;span style=""&gt;                &lt;/span&gt;//timer.cancel(); //Not necessary because&lt;br /&gt;&lt;span style=""&gt;                       &lt;/span&gt;&lt;span style=""&gt;                      &lt;/span&gt;//we call System.exit&lt;br /&gt;&lt;span style=""&gt;                &lt;/span&gt;System.exit(0);&lt;span style=""&gt;   &lt;/span&gt;//Stops the AWT thread&lt;br /&gt;&lt;span style=""&gt;                                             &lt;/span&gt;//(and everything else)&lt;br /&gt;&lt;span style=""&gt;            &lt;/span&gt;}&lt;br /&gt;&lt;span style=""&gt;        &lt;/span&gt;}&lt;br /&gt;&lt;span style=""&gt;    &lt;/span&gt;}&lt;br /&gt;&lt;span style=""&gt;    &lt;/span&gt;...&lt;br /&gt;}&lt;/span&gt;&lt;span style="font-size:11;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5151165748331362515-8091961800987677649?l=rijusnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rijusnotes.blogspot.com/feeds/8091961800987677649/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rijusnotes.blogspot.com/2009/06/how-to-implement-scheduler-in-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5151165748331362515/posts/default/8091961800987677649'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5151165748331362515/posts/default/8091961800987677649'/><link rel='alternate' type='text/html' href='http://rijusnotes.blogspot.com/2009/06/how-to-implement-scheduler-in-java.html' title='How to Implement a scheduler in java'/><author><name>Riju Thomas</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5151165748331362515.post-7065894604259246847</id><published>2009-06-09T15:09:00.011+05:30</published><updated>2009-06-09T15:48:07.852+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='file I/O'/><category scheme='http://www.blogger.com/atom/ns#' term='move'/><title type='text'>To Move a File from One directory to another in Java</title><content type='html'>&lt;p class="MsoNormal"&gt;We can use File.renameTo() method to move a file from one folder to another.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;u1:p&gt;&lt;/u1:p&gt;  &lt;p class="MsoNormal" face="times new roman"&gt;&lt;i&gt;&lt;u1:p&gt;&lt;/u1:p&gt;// File (or directory) to be moved&lt;/i&gt;&lt;br /&gt;&lt;i&gt;File file = new File("filename"); &lt;/i&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;u1:p&gt;&lt;/u1:p&gt;  &lt;p class="MsoNormal" face="times new roman"&gt;&lt;i&gt;// Destination directory&lt;br /&gt;File dir = new File("directoryname"); &lt;/i&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;u1:p&gt;&lt;/u1:p&gt;  &lt;p class="MsoNormal" face="times new roman"&gt;&lt;i&gt;// Move file to new directory&lt;br /&gt;boolean success = file.renameTo(new File(dir, file.getName()));&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/i&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;i&gt;if (!success) {&lt;br /&gt;// File was not successfully moved&lt;br /&gt;}&lt;/i&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;i style=""&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style=";font-family:times new roman;font-size:85%;"  &gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5151165748331362515-7065894604259246847?l=rijusnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rijusnotes.blogspot.com/feeds/7065894604259246847/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rijusnotes.blogspot.com/2009/06/to-move-file-from-one-directory-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5151165748331362515/posts/default/7065894604259246847'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5151165748331362515/posts/default/7065894604259246847'/><link rel='alternate' type='text/html' href='http://rijusnotes.blogspot.com/2009/06/to-move-file-from-one-directory-to.html' title='To Move a File from One directory to another in Java'/><author><name>Riju Thomas</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5151165748331362515.post-4458149775523238865</id><published>2009-04-23T09:24:00.007+05:30</published><updated>2009-04-23T09:42:47.231+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='special charaters'/><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='entity'/><category scheme='http://www.blogger.com/atom/ns#' term='html'/><title type='text'>Javascript to Encode and Decode Special charaters in HTML (Entities)</title><content type='html'>&lt;p style="font-weight: bold;" class="MsoNormal"&gt;&lt;span style=";font-family:Calibri;font-size:130%;"  &gt;The following javascript functions will be useful when working with special characters in HTML.&lt;/span&gt;&lt;/p&gt;                  &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;br /&gt;// This Fucntion will decode an entity to its original character&lt;br /&gt;// eg &amp;amp; will become ‘&amp;amp;’ and " will become “&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;/span&gt;&lt;i style=""&gt;&lt;span style="color: rgb(0, 51, 204);font-family:Calibri;" &gt;function entityToText(entityText) {&lt;br /&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;span style=""&gt;        &lt;/span&gt;var d = document.createElement("div");&lt;br /&gt;&lt;span style=""&gt;            &lt;/span&gt;d.innerHTML = entityText;&lt;br /&gt;&lt;span style=""&gt;            &lt;/span&gt;return d.firstChild.nodeValue;&lt;br /&gt;}&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style=""&gt;&lt;/span&gt;//This Fucntion will encode a special character to its entity&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;// eg ‘&amp;amp;’ will become &amp;amp; and “ will become "&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p class="MsoNormal"&gt;&lt;i style=""&gt;&lt;span style="color: rgb(0, 51, 204);font-family:Calibri;" &gt;function textToEntity(specialText) {&lt;br /&gt;&lt;span style=""&gt;            &lt;/span&gt;var d = document.createElement("div");&lt;br /&gt;&lt;span style=""&gt;            &lt;/span&gt;d.appendChild(document.createTextNode(specialText));&lt;br /&gt;&lt;span style=""&gt;            &lt;/span&gt;return d.innerHTML;&lt;br /&gt;}&lt;/span&gt;&lt;/i&gt;&lt;span style="font-family:Calibri;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5151165748331362515-4458149775523238865?l=rijusnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rijusnotes.blogspot.com/feeds/4458149775523238865/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rijusnotes.blogspot.com/2009/04/javascript-to-encode-and-decode-special.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5151165748331362515/posts/default/4458149775523238865'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5151165748331362515/posts/default/4458149775523238865'/><link rel='alternate' type='text/html' href='http://rijusnotes.blogspot.com/2009/04/javascript-to-encode-and-decode-special.html' title='Javascript to Encode and Decode Special charaters in HTML (Entities)'/><author><name>Riju Thomas</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5151165748331362515.post-8351817781209350411</id><published>2009-04-23T08:13:00.000+05:30</published><updated>2009-04-23T08:14:12.379+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='language support'/><title type='text'>Install system support for multiple languages (Asian Languages)</title><content type='html'>&lt;p&gt;&lt;u&gt;&lt;span style="font-family: Calibri;"&gt;Windows XP&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-family: Calibri;"&gt;This procedure applies only if you are running a language version of Microsoft Windows XP that doesn't match the language you want to type.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;ol start="1" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-family: Calibri;"&gt;On the Windows &lt;b&gt;Start&lt;/b&gt;      menu, point to &lt;b&gt;Control Panel&lt;/b&gt;, and then click &lt;b&gt;Date, Time,      Language, and Regional Options&lt;/b&gt;. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-family: Calibri;"&gt;Click the &lt;b&gt;Regional      and Language Options&lt;/b&gt; icon, and then click the &lt;b&gt;Languages&lt;/b&gt; tab. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-family: Calibri;"&gt;In the &lt;b&gt;Supplemental      languages support&lt;/b&gt; box, select the check boxes that correspond to the      languages you want to use. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;  &lt;p&gt;&lt;u&gt;&lt;span style="font-family: Calibri;"&gt;Windows 2000&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-family: Calibri;"&gt;This procedure applies only if you are running a language version of Microsoft Windows 2000 that doesn't match the language you want to type.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;ol start="1" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-family: Calibri;"&gt;On the Windows &lt;b&gt;Start&lt;/b&gt;      menu, point to &lt;b&gt;Settings&lt;/b&gt;, and then click &lt;b&gt;Control Panel&lt;/b&gt;. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-family: Calibri;"&gt;Double-click the &lt;b&gt;Regional      Options&lt;/b&gt; icon, and then click the &lt;b&gt;General&lt;/b&gt; tab. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;  &lt;span style="font-family: Calibri;"&gt;In the &lt;b&gt;Language settings for the system&lt;/b&gt; box, select the check boxes next to the languages you want to use.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5151165748331362515-8351817781209350411?l=rijusnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rijusnotes.blogspot.com/feeds/8351817781209350411/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rijusnotes.blogspot.com/2009/04/install-system-support-for-multiple.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5151165748331362515/posts/default/8351817781209350411'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5151165748331362515/posts/default/8351817781209350411'/><link rel='alternate' type='text/html' href='http://rijusnotes.blogspot.com/2009/04/install-system-support-for-multiple.html' title='Install system support for multiple languages (Asian Languages)'/><author><name>Riju Thomas</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5151165748331362515.post-8986152058233807855</id><published>2009-04-23T08:10:00.001+05:30</published><updated>2009-04-23T09:41:33.995+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='sql'/><category scheme='http://www.blogger.com/atom/ns#' term='tablespace'/><title type='text'>SQL for altering user schema to add a new tablespace</title><content type='html'>&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size: 14pt; font-family: Calibri; font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;  &lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;The following sql is to create a tablespace after creation of a user schema and then alter the user schema to take the new tablespace as default.&lt;br /&gt;It also changes the system defined tablespace 'temp' as the temporary tablespace for the user.&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;br /&gt;&lt;i&gt;&lt;span style="font-family: Calibri;"&gt;create tablespace pfss datafile '/u12/oradata/wcrsec01/PFSS.dbf' size 100m autoextend on next 50m maxsize 1000m;&lt;/span&gt;&lt;/i&gt;&lt;span style="font-family: Calibri;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;create tablespace pfss_idx datafile '/u12/oradata/wcrsec01/PFSS_IDX.dbf' size 100m autoextend on next 50m maxsize 1000m;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;alter user pfss default tablespace pfss temporary tablespace temp;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Alter user pfss quota unlimited on pfss_idx;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Alter user pfss quota unlimited on pfss;&lt;/i&gt;&lt;/span&gt;&lt;span style="font-size: 3pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;u1:p&gt;&lt;/u1:p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 5pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5151165748331362515-8986152058233807855?l=rijusnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rijusnotes.blogspot.com/feeds/8986152058233807855/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rijusnotes.blogspot.com/2009/04/sql-for-altering-user-schema-to-add-new.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5151165748331362515/posts/default/8986152058233807855'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5151165748331362515/posts/default/8986152058233807855'/><link rel='alternate' type='text/html' href='http://rijusnotes.blogspot.com/2009/04/sql-for-altering-user-schema-to-add-new.html' title='SQL for altering user schema to add a new tablespace'/><author><name>Riju Thomas</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
