RSSAmplifier

Blog

Real's HowTo

Latest updates of useful code examples for Java, Javascript, Powerbuilder and VBScript

rgagnon.comRSS feed ↗21 posts

Latest posts

Java : Process MP3 Tags

Update and fix. Add detect big artwork.

Batch : Turn off all the screens from a Windows batch file

Turn off all the screens with this poowershell one-liner.

Java : Create XLS/XLSX file with Apache POI

You can use Apache POI HSSF to create an XLS file or Apache POI XSSF for an XLSX file.

Java : Run Applet in a modern browser

Run legacy Java Applets on modern browsers without a Java plugin or a Java installation

Java : Display numbers with leading zeroes

Many ways to display numbers with leading zeroes

Java : Display currency

Display currency using Java Money or NumberFormat

HTML : HTML list with empty square as bullet style

HTML UL style provides only filled square as bullet. Use this simple CSS, to have a empty square (like a checkbox) instead.

Java : Get the atomic time (using Gregorian Calendar or java.time)

We connect to a publicly accessible time server on the internet and parse the result. Using a Gregorian Calendar or new way using java.time

Java : Resolve environment variable in a property value

Solution with APache Text StringSubstitutor is added

Java : Generate or validate a password

The generate() method produces a password using some rules and the validate() method validates a password against the same rules. Also an Apache Commons solution is provided to generate a random string.

Powerbuilder : Use Regular Expression from Powerscript

Support for regular expression in Powerscript is minimal, you need to use an external COM object like VBScript.RegExp to do something useful.

Windows : Count files in directory and subdirectories

2 ways to count files in directory and subdirectories

Windows : Launch an executable, resize and position from CMD file (Win/PS)

A CMD file to launch an executable, resize its window and position it on the screen.

Powerbuilder : Launch executable and capture its handle

This HowTo launch an executable using the Win API ShellExecuteEx and retrieve the handle of the launched executable. This handle can be used later to interact with it. Like, for example, if we want to terminate it form Powerbuilder.

Powerbuilder : Print to the console

One missing thing is that Powerbuilder provides no direct API to display information in the console to display processing or debugging information.

Java : Enable logging for HttpURLConnection/UrlConnection

Enable the java-logging mechanism for HttpURLConnection/UrlConnection by setting a special property when starting the JVM

Java : Enable logging for JAX-WS

Try these properties to enable logging with JAX-WS (javax.ws.*)

Java : Check if a file

Check if a file, the classic way ou the NIO way

Java : Get the running JVM Path

Get the running JVM Path, JDK9 and pre-JDK9 solution

Java : Kill a process with a PID

Kill a process with its PID, one solution is using taskkill.exe (Windows-only) and the other is pure Java (JDK9)

Java : Get a PID given a process name

Retrieve the PIDs, one solution is using WMIC (Windows-only) and the other is pure JAva (JDK9)