‘Acquire a certification in technology X‘ | ‘Earn a Domain Y certification‘
Do one of those statements list in your yearly goals ? It is almost certainly a bad idea. Let me explain why. I knew a company that required its employees to be acquire at least one certification on a technology per year. Its employees would work hard throughout the year and during appraisal time it is not uncommon to hear this converation
Foo: ‘Dude did you take that certification you were supposed to ?’
Bar: ‘Rats ! I didnt realize it was a part of our goals’
Foo: ‘hmm… what do we do ? John has already passed it and that puts him ahead of us’
Foo and Bar will probably end up reading real exam questions (also referred to as brain dumps) and passing the exam with only a day’s worth of preparation. That another way of saying ‘They cheated’. This hurts everyone.
Java’s side that is not too well known would be its interface with external devices. Java can read bar codes interface with serial / parallel ports , and communicate with a web cam (JMF)
Speaking of webcams, the following snippet in the Java media framework (JMF) should list your webcam as a device
Vector info = CaptureDeviceManager.getDeviceList(null);
The problem is that this piece of code does not work all the time. Your webcam should be compatible with JMF to be listed by this call. The gstreamer API can come to your rescue should the JMF call fail. Here is how the gstreamer API describes itself
GStreamer is a library for constructing graphs of media-handling components. The applications it supports range from simple Ogg/Vorbis playback, audio/video streaming to complex audio (mixing) and video (non-linear editing) processing.
Jconsole and visual VM help monitor java applications in any environment. Here are a few additional details that can help you monitor your java applications better
Jconsole and permissions:
Jconsole lists the PIDs of local java applications when you start it. But what if there are java applications that are running under a different user ? Jconsole will not display those java PIDs that do not belong to the user who started Jconsole. The JConsole FAQ lists a few troubleshooting tips to get around this problem. You can alternatively expose the Jconsole connection through a remote port using the -Dcom.sun.management.jmxremote.port property. Securing the remote JMX URL with a username and password should do the trick.
Viewing Jconsole / JMC Beans with VisualVm:
Developers on the web increasingly deal with remote APIs. SOAP Web services / REST rest services are consumed by a myriad of consumers. What format this communication should be carried on is a matter of debate. Each format has its own pros and cons. Inevitably any format that is sent / received from the service needs to be serialized and deserialized. There is a cost associated with this process and the bulky nature of payloads (XML is pretty verbose for example) becomes a factor too. To address these problems you can switch to alternate formats such as google protobufs
and message pack
Pros of using custom formats:
- A lighter payload
- Better serialization / deserialization performance
- Payload is not verbose
- Lack of tooling / plugins can be a cause for concern
- Debugging the format over the wire can prove troublesome
Java is sprinkled with classes that are immutable. Wrapper classes especially make for a good example. A co-worker recently asked me “Give me an example of immutability.”. “The String class” I answered, to which he scoffed. He had a good reason however. Consider this code…
public class GenericTest
public static void main(String... args)
public void go()
String name = "David";
Those of you with a keen eye for detail would have quickly seen the problem with this code. If you didnt catch it, dont blame yourself. The String “name” is immutable and the replaceAll() method creates a new String with all the ‘D’s replaced with ‘d’. It appears as though the String has been mutated, but in reality nothing has changed. The problem has a simple fix. Simply change a line of code.
name = name.replaceAll("D", "d");