CUSIPs are a 9-digit alphanumeric code for uniquely identifying a financial security. https://en.wikipedia.org/wiki/CUSIP They were invented in the 1964, and given the reliability of data transmission in the 60’s, the 9th digit is actually a check digit used to confirm the validity of the first 8 charac…
Tag: java
Jackson Json Deserialisation: Unrecognized field “…” , not marked as ignorable
I’m getting the following error and no resolution i found did the trick for me: Unrecognized field “GaugeDeviceId” (Class GaugeDevice), not marked as ignorable The problem seems, that the service returns the property names with a leading upper letter, while the class properties begin with a …
Java – Asteroids – acceleration in two dimensions
I am currently writing Asteroids for extra credit in my computer science class, following a very loose guide that provided some starter code. I have a ship and I can use key presses to change its position. The starter code provided a method of drawing the ship based on a Point position. I was then given this …
Reliance on default encoding, what should I use and why?
FindBugs reports a bug: Reliance on default encoding Found a call to a method which will perform a byte to String (or String to byte) conversion, and will assume that the default platform encoding is suitable. This will cause the application behaviour to vary between platforms. Use an alternative API and spec…
Throw exception vs Logging
Is the following way to code good practice? Moreover, should I.. use only the logger? throw only the exception? do both? I understand that with throw I can catch the exception in another part of the callstack, but maybe additional logging has some hidden benefits and is useful as well. Answer I use both in so…
Invalid Availability Zone when creating Instance
I’m attempting to create instance on us-west-1c (though I get the same error when trying 1b, or any other AZ) and I’m getting this error: I can manually create the instance via the AWS console. Here is my code to create that instance: I’ve looked over this a hundred times, compared to other …
Is it a bad practice to use a ThreadLocal Object for storing web request metadata?
I am working on a j2ee webapp divided in several modules. I have some metadata such as user name and preferences that I would like to access from everywhere in the app, and maybe also gather data similar to logging information but specific to a request and store it in those metadata so that I could optionally…
Unexpected GDS Exception: 335544726. Error reading data from the connection
I have a Web app running on Apache Tomcat 6, using ZK, Hibernate and Jaybird JDBC for accessing a Firebird database. For some unknown reason, after a not yet mapped operation in the app that performs a dynamic SQL, it crashes with the following exception: ERROR: org.springframework.transaction.TransactionSyst…
android get radio stream data
I am trying to get what song is on with this code: } Url I want to use are from this page: http://radio.m-1.fm/ so for example http://radio.m-1.fm/M-1PLIUS (which is http://84.46.147.81/m1plius/mp3) but I get error java.net.SocketException: Permission denied Any ideas what is wrong? Answer Add Internet Permis…
Getting error in Eclipse: syntax error on token start identifier expected
I am getting a strange error while creating a simple thread program in JAVA using Eclipse. The code is: I am getting error “syntax error on token start identifier expected” in the line ts.start();. Why am I getting this? EDIT I have used the code from http://tutorials.jenkov.com/java-concurrency/c…