There is a task in the current project I am working with, which is getting a product (that could be anything, in our case it was products users had to do some work with) for a user logged in to the system, and simultaneously locking it so that no other user can access it. While my first idea about solution was having a synchronized piece of code which would first make a query to search for a product, and another query to lock it in the database. Note that we are using database table for locking.Read more...
Today while updating my Ubuntu installation(Ubuntu 9.10 Karmic Koala) ,
mysql package also had an update, but after installation it refused to start.
Version of package failing to install was
Looking around I found out that problems with mysql updates occur quite frequently, and what usually helps is a fresh install.
It does, to my biggest surprise, I got UnsupporttedOperationException when I tried to add objects into the list I received via invoking a call to
Arrays.asList(). And even bigger surprise that looking at the stack trace I found out that the exception is thrown from the
add() method of
Today I was writing a code that would loop over an ArrayList and if some condition occurs remove it from the collection. It looked similar to this:Read more...
During studying for SCJP I came to the topic of valid characters for identifiers, and what caught my attention was that its not only $ character is meant as currency character, but also €, £ and probably all other currency signs. So valid identifiers are characters, numbers, underscore and currency characters. And also we must not forget that number cannot be the first character of the name of an identifier.Read more...
I recently had a task where I had to make a servlet which would store a configuration data for a large GWT project.
Writing a servlet that would read everything from
web.xml file, I later realized that servlet needs to be initialized before it has values from
web.xml, and Tomcat initializes it only when the request is made towards it.
Looking through various solutions, I found out that the easiest way would be telling Tomcat to initialize it on load, or on startup, rather than initializing it on first request.
It can be achieved by simply adding
<servlet> tags in
Overall picture looks something like this:
I found today that doing setFocus on elements may not work properly all the time, due to thread issue. Solution to this problem would be using
DeferredCommand class with passing a new
Command to it. So instead of
subscribe via RSS