Thursday - December 04, 2008OS X talking to Windows with SocketsFound an unusual compatibility problem last week
when using Sockets to communicate between OS X and Windows. The bottom line is
if you have a java application on OS X that does some high volume TCP/IP socket
communications to a Windows service, then you had better be using OS X Leopard
to get the best performance ... about 9X better.
Thursday - August 24, 2006Understanding Class PathsClass Paths can be confusing. Here is some info
and links to info on that:...
Thursday - April 06, 2006Removing HTML tags from textCourtesy of Zak Burke on the WebObjects dev
list:
/** * Return input string with simple HTML tags removed. The * original string is not changed. * * @param s string with embedded HTML markup * @return string with HTML tags removed. */ public void tagZap(String s) { return s.replaceAll("<[^>]+>", ""); } Monday - March 20, 2006Instantiating inner classes using Class.forNameI designed a class with a number of pluggable
behaviours using the strategy pattern . However this time, I decided to
implement the concrete Strategy algorithm classes as inner classes of the
Context class just to keep the code organized and reduce the number of tiny
classes hanging around the project. Rather than use a bunch of if statements,
the concrete Strategy class was simply created using its text name which came
from an attribute of the Context
class.
...It turns out that there is an implicit constructor for inner classes that passes the outer enclosing class as a reference ..... Thursday - December 29, 2005Common Programming MistakesHere are some simple common programming errors
that the compiler will not necessarily catch. Obviously I've been caught by each
one of these at one time or another!
Thursday - May 19, 2005Default Java CLASSPATH on OS XEver wonder where java looks for jars by default
on OS X. Just check out the default classpath.
Wednesday - May 18, 2005HttpsURLConnection and HttpClientI recently implemented java's built-in HttpsURLConnection
class to process credit card transactions using a POST request over SSL. I also
spun off new threads to do the processing (connect, send request, read response)
since waiting for the connection and waiting for the response could get
time-consuming. I expected that HttpsURLConnection would open multiple parallel
HTTP connections to the service provider's host, but it did not. Then I
discovered the HttpClient
library from the Apache Jakarta Commons project and this nailed the
problem.......
Tuesday - January 18, 2005The Power of Regular ExpressionsRegular Expressions (RegEx for short) are a very
powerful tool that can save a LOT of lines of code especially when validating
input data...
|
|