-
Running TomCat 6 in Debug Mode under Windows
While tracing some problems in one of my grails applications I had the need to do step debugging on a remote Tomcat server. Eventually I came up with the following lines to launch TomCat in debug mode:
@echo off set JPDA_TRANSPORT="dt_socket" set JPDA_ADDRESS="8000" set JPDA_SUSPEND="y" catalina.bat jpda start
Simply create a debug.bat file in TomCat’s bin directory and add these lines.
-
Lotus Notes’ [Send only] and [Send and File] buttons for Outlook 2003
You can say what you want about Lotus Notes, if you have used it for a while and switched e.g. to Outlook, you’ll find yourself missing one or the other nifty Notes function.
Already two of my customers “forced” me to use MS Outlook 2003 and since this isn’t likely to change in the near future, I implemented two of these handy Notes functions for Outlook 2003:
- The button [Send only] sends e-mails without storing a copy of it in the local mailbox.
- The button [Send and File...] prompts you for the folder where to store the e-mail being send.
Installation:
- Download the Visual Basic module in the favored language.
Send Mail Macros for MS Outlook 2003 (EN) (4.9 KiB, 1,750 hits)
Send Mail Macros for MS Outlook 2003 (DE) (5.1 KiB, 813 hits)
- In Outlook open the Visual Basic editor.

- Import the Visual Basic module.
- Save the project.
- Install the buttons in the toolbar.
- When composing a new e-mail the additional buttons should appear in the toolbar.
- When clicking “Send and File…” the folder dialog is displayed before the e-mail is send.

-
getpass for Jython
In my current project I am developing some Jython based command line tools and had the need for masking passwords entered in the command shell. Python provides the getpass module for this purpose. Unfortunately this module has not been made available for Jython.
Here comes a module I wrote to provide this kind of functionality. It uses the mechanism described here http://java.sun.com/developer/technicalArticles/Security/pwordmask/ to mask characters entered at the command prompt. Additionally if Java 6 or higher is running Jython the module will instead use the new Console.readPassword() method. In case the module is running in an environment where the getpass module is available it will delegate to the corresponding methods of this module instead of using its own implementations.
# ext_getpass.py # @author Sebastian Thomschke, http://sebthom.de/ import thread, sys, time, os # exposed methods: __all__ = ["getpass","getuser"] def __doMasking(stream): __doMasking.stop = 0 while not __doMasking.stop: stream.write("b*") stream.flush() time.sleep(0.01) def generic_getpass(prompt="Password: ", stream=None): if not stream: stream = sys.stderr prompt = str(prompt) if prompt: stream.write(prompt) stream.flush() thread.start_new_thread(__doMasking, (stream,)) password = raw_input() __doMasking.stop = 1 return password def generic_getuser(): for name in ('LOGNAME', 'USER', 'LNAME', 'USERNAME'): usr = os.environ.get(name) if usr: return usr def java6_getpass(prompt="Password: ", stream=None): if not stream: stream = sys.stderr prompt = str(prompt) if prompt: stream.write(prompt) stream.flush() from java.lang import System console = System.console() if console == None: return generic_getpass(prompt, stream) else: return "".join(console.readPassword()) try: # trying to use Python's getpass implementation import getpass getpass = getpass.getpass getuser = getpass.getuser except ImportError, e: getuser = generic_getuser # trying to use Java 6's Console.readPassword() implementation try: from java.io import Console getpass = java6_getpass except ImportError, e: # use the generic getpass implementation getpass = generic_getpassHere is an usage example:
import ext_getpass as getpass pw = getpass.getpass("Please enter your password:") print "The entered password was: " + pw -
Sun JDK5/6 compilers broken when linking overloaded methods with variable arguments
We are currently switching the build system of OVal from custom Ant scripts to Maven 2. During that process we accidentally compiled the project using the Java compiler of the Sun JDK 5 instead of the AspectJ compiler. Surprisingly javac did not complain about the missing aspect class files. Instead it already aborted while compiling an ordinary Java class which only referenced other non-AspectJ related classes. This is the original error message:
[INFO] [compiler:compile] [INFO] Compiling 180 source files to C:\projects\oval\src\trunk\target\classes [INFO] ------------------------------------------------------------------------ [ERROR] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Compilation failure C:\projects\oval\src\trunk\src\main\java\net\sf\oval\Validator.java:[373,58] addMethodParameterChecks(java.lang.reflect.Method,int,java.lang.Object) has private access in net.sf.oval.internal.ClassChecks
There exist multiple methods named addMethodParameterChecks in the class ClassChecks with different signatures. The problem is that javac tries to link against the wrong method when compiling the class calling one of the methods.
-
OVal 1.0 released!
OVal is a pragmatic and extensible validation framework for any kind of Java objects (not only JavaBeans). Constraints can be configured with annotations, POJOs or XML. Custom constraints can be expressed in pure Java or by using scripting languages such as JavaScript, Groovy, BeanShell, OGNL or MVEL. Besides simple object validation OVal implements Programming by Contract features by utilizing AspectJ based aspects.
Visit the project page at http://sourceforge.net/projects/oval/
-
MyPad v1.1.6 – a PHP Editor
MyPad is a very compact PHP Editor. I developed this editor because I could not find a suitable PHP Editor with a Single Document Interface.
The Editor I was searching for should look and behave like Notepad, but should be able to colorize PHP source code.
Such a small Editor can be perfectly used in conjunction with a norton commander like filemanager.


Looking for a high performer for your next IT project?


English
Deutsch
Recent Comments