Welcome to the Joint-Venture Blog from Fabio Cortesi and Stefan Jäger.
Lucene offers great full text search capabilities. It is based on an index, which is maintained by Lucene. With Luke, the Lucene Index Toolbox (http://www.getopt.org/luke/) you can analyze your index and let explain queries.
After startup, you have to select your index. For this example, I created a test index with one file. It’s content is “this is a lucene test”. I used the StandardAnalyzer, which uses the WhitespaceTokenizer and filters out all tokens less than 3 characters and stop words. This will result in an index of the terms “lucene” and “test”.
Use http://blindsearch.fejus.com/ to compare different search engines. After you see the results, you can choose, which one is the best and you will see, which search engine (Google, Yahoo or Bing) provided which search result.
There are times, where people ask you questions, which can directly be found on Google. This kind of questions are mostly boring. But hey, there is a nice solution for responding to those people:
On the website Let me google that for you you can enter any search query and send the generated link to the person, who asked you something. Perhaps, this person will learn something and will google the next question before he will ask you…
PS: just found Google ist dein Freund for the German readers.
Ant offers some XML features like the xslt task, which transforms XML files into other files. But unfortunately, with Ant you can’t make simple XPath Queries on a specific XML file.
Luckily, there is a nice open source solution called XmlTask, which offers many possibilities to work with XML files.
- Download the latest version of XmlTask from http://xmltask.sf.net
- Create a task definition in Ant
1 2 3 4
<taskdef name="xmltask" classname="com.oopsconsultancy.xmltask.ant.XmlTask" classpath="./xmltask-v1.15.1.jar" />
- Use it with the <xmltask> definition
For example, read out the number of a specific node in the XML file:1 2 3
<xmltask source="someFile.xml"> <copy path="count(//aNode)" property="numberOfNodes" /> </xmltask>
Or change an attribute:
1 2 3
<xmltask source="someFile.xml" dest="toAnotherFile.xml"> <attr path="//aNode[1]" attr="enabled" value="true"/> </xmltask>
There are many other possibilites to work with XML files inside Ant. Check out the documentation at http://xmltask.sf.net.
Wrong use of the memory options can cause serious performance problems. To optimize the right memory size of the JVM or to find some critical memory issues, the GC log of the JVM can be very useful. Simply start the Java application with the option -Xloggc:<file>. Every GC action gets logged into this file.
To analyse this log file, there is a nice tool called GCViewer, which can be downloaded from http://www.tagtraum.com/gcviewer-download.html. GCViewer is able to display the memory usage of the application based on time and old/young generation heap space.
There are some kind of tasks, which Ant won’t do. One of them is the loop. There is no simple way to implement a dynamic for or while loop in Ant. What do i mean with dynamic? Let me make an example. Ant reads out a number of iterations from a property file (we call it the number x) and should perform a loop x-times to call another Ant task. And this can only hardly be done with Ant.
But fortunately, there is Groovy. Groovy is a scripting language, which runs in a Java Virtual Machine. And because of that, it can be easily integrated with Ant.
By default WISE can’t delete a folder structure with all files and subfolders. The technologie of MSI is designed to delete only these components by uninstalling, which were installed.
With the following VB-Script can do just that. It makes sense, that the script uses a property of the directory-table. The example uses the “JUNIPER” directory, which will be deleted by the script.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | Option Explicit Dim WshShell,SystemFolder,Fso,strFolder, strFile, ret ' Set the property strFolder = GetAProperty("JUNIPER") ' Delete the last character at the end of the string ' -> example: C:\Programm Files\Test"\" ' For a correct deleting of a directory-property, ' the backslash at the end has to be deleted strFolder = Left(strFolder,Len(strFolder)-1) ' Environment variable reading set WshShell = CreateObject("WScript.Shell") set Fso=createobject("scripting.filesystemobject") ' Delete the folder If Fso.FolderExists(strFolder) Then ret = Fso.DeleteFolder (strFolder,True) End If Set WshShell = Nothing Set fso = Nothing ' Getting a property Function GetAProperty (PROPERTYNAME) dim szStringVal szStringVal = Session.Property(PROPERTYNAME) GetAProperty = szStringVal End Function |
Yesterday, I visited an interesting presentation from Tudor Girba. He showed us several ways for visualize code. One of the most interesting visualization was Code City.
(ArgoUML from http://moose.unibe.ch/tools/codecity)
Active Setup is included in the Windows Operating System and can be used to do something after the user logs in. Especially when you have to install some files, registry keys, user-certificates or other things into the user-profile is Active Setup a nice technology to use. It is originally a feature of Microsoft Internet Explorer and Microsoft Outlook.
With WISE Package Studio you can easily implement Active Setup by adding the following Registry-Keys (minimum) to your project:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\[UpgradeCode]
"ComponentID"="[ProductName]"
"StubPath"="[SystemFolder]\msiexec.exe /fu [ProductCode] /qb-!"
Source Control like CVS or Subversion is used almost in every software project. As a developer, it’s your responsibility to be up to date with the current version from the source control system. In Eclipse there is a nice feature to schedule such synchronizations. This means, you get regularly informed about all updates and you have less merging problems!
« Newer Posts — Older Posts »

