Tuesday January 04, 2005 In IntelliJ IDEA when you open those xml config files (struts, hibernate,...) you see the dtd reference in red color. for example: in struts-config.xml
| <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd"> |
To get rid of it and make IDEA help you with smart completion, do the following o click on it, you will see an intention bulb near the first column of that line o click it and you have an option to fetch the dtd file or ignore it o select the fetch option o this will download the file and register it in your IDEA settings Now the annoying error disappears and the smart complete starts working....Posted by nithy ( Jan 04 2005, 07:18:13 PM CST ) Permalink Comments [11804]
spaces in env variables on AIX
I was tring to execute a java process via a script and want to pass some
variables, which has spaces. I found a work around for it. If there is a
better way please let me know.
Following is my workaround solution:
Test.java
=========
public class Test
{
public static void main( String[] args ) throws Exception
{
System.out.println("Hello");
System.out.println("aaa = [" + System.getProperty("aaa") + "]");
}
}
run.sh
=======
export args=$*
echo args=[$args]
export cmd=java' '$args
echo cmd=[$cmd]
echo $cmd > dummy.sh
cat dummy.sh
. ./dummy.sh
execute from cmdline
====================
. ./run.sh '"-Daaa=f oo"' Test
output
======
args=["-Daaa=f oo" Test]
cmd=[java "-Daaa=f oo" Test]
java "-Daaa=f oo" Test
Hello
aaa = [f oo]
Posted by nithy
( Aug 31 2004, 09:17:30 PM CDT )
Permalink
Comments [11372]
Trying to use textarea for displaying xml text in a blog entry
Sample xml using textarea:Posted by nithy ( Apr 08 2004, 08:29:48 PM CDT ) Permalink Comments [4648]
Tip to speed up the jsp compilation process with weblogic
This works with weblogic 6.1, not tested on later versions.
If you are using ant to compile your jsps with weblogic.jspc then u can improve the build time by specifying the undocumented flag to weblogic.jspc
<!-- 1. compile the jsp's to create only the java files and skip the javac using the flag -skipJavac -->
<property name="cmd.line" value=" -keepgenerated -depend -webapp ${dir.tmp.war} -compileAll -d ${dir.tmp.webinf.classes} -skipJavac"/>
<echo level="info" message="${cmd.line}"/>
<java fork="true" failonerror="true" classname="weblogic.jspc" classpathref="precompilejsp.classpath">
<arg line="${cmd.line}"/>
</java>
<-- 2. compile the generated java files separately -->
<javac deprecation="${deprecation.javac}" fork="${fork.javac}" source="${source}" debug="${debug}"
srcdir="${dir.tmp.webinf.classes}" destdir="${dir.tmp.webinf.classes}" classpathref="precompilejsp.classpath"/>
This will improve the jsp compilation time. It reduced the Jsp compilation time from 15 minutes to 1 minute for me for around 150 jsps, because javac is invoked only once instead for every jsp.
Posted by nithy ( Apr 07 2004, 11:57:12 AM CDT ) Permalink Comments [15288]Using the entity includes in xml
Ant supports an import tag for including another xml file as Lance explained, which is very nice.
But with cruisecontrol I have no other option than using the entity includes method, which is not very bad in this case.
For example I am running multiple projects in the continuous integration build and my cruisecontrol config xml file looks like the following
<?xml version="1.0"?>
<!DOCTYPE cruisecontrol [
<!ENTITY project1 SYSTEM "file:./prj1.xml">
<!ENTITY project2 SYSTEM "file:./prj2.xml">
<!ENTITY project3 SYSTEM "file:./prj3.xml">
<!ENTITY project4 SYSTEM "file:./prj4.xml">
]>
<cruisecontrol>
&project1;
&project2;
&project3;
&project4;
</cruisecontrol>
This looks simple when compared to having configurations of all the projects in one xml file.
This is not a clean way, but it is useful.
Posted by nithy ( Jan 28 2004, 07:11:07 PM CST ) Permalink Comments [11786]
Virtual Keyboard "The VKB attaches to handhelds and projects the image of a full-size
keyboard onto the surface of the desk where the handheld is placed,
allowing the user to input text without a physical keyboard"... iBiz releasing virtual keyboard soon
I hope there will be a virtual Monitor soon :) , then all we need is a
small handheld which can serve as a cellphone, PDA, TV, DVD player,
laptop, dektop,....
Posted by nithy
( Jan 04 2004, 03:12:58 PM CST )
Permalink
Comments [12694]
Xerces DOM implementation is not thread safe for read only Couple of months back I wrote a test driver, which was using a single instance of DOM document and the test was reading some values and processing some other application logic. It was working fine until I ran the test in multiple threads. I started getting some unexpected errors from DOM objects. I used Xerces as DOM implementation.
Then I started reading the DOM spec. I found that there is no requirement for the DOM implementation to be thread safe(even for read-only purpose).
Usually everyone assumes that if we do read operations then it is thread safe as long as we do not do any write operation. But it is not true, it totally depends on what the read operation does.
Most of the time we use windows and the multi thread tests also pass, coz the chances of creating a race condition with a single processor machine is very less. I have noticed that the multi thread tests I ran on my laptop(single processor) with windows xp succeeds most of the time and they fail on IBM AIX(4 processors) most of the time.
Posted by nithy
( Dec 22 2003, 07:57:39 AM CST )
Permalink
Comments [12039]
FIRST POST! This is my first post Posted by nithy ( Dec 07 2003, 08:41:30 PM CST ) Permalink Comments [5138]