• Home
  • About

Snippet IT

IT News, Programming, Internet and Blogging

  • Programming and Scripting
  • Tips and Tricks
  • Software and Hardware
  • New and Happening
You are here: Home / Archives for Java

Java: Least Recently Used (LRU) Cache

May 14, 2009 by Sze Hau Leave a Comment

Least Recently Used or in short LRU is an performance optimizing algorithm. LRU algorithm is widely used in software programming as well as in hardware instructions (e.g. CPU). In many case, in programming, we may want to cache some data from physical disk, for example database and files, but we cannot load all the data into memory due to the memory limitation on the server o … [Read more...]

JSP: How to Declare Methods and Inner Class in JSP

May 11, 2009 by Sze Hau Leave a Comment

JSP itself is just a plaint text and will be translated into Java source file (actually a servlet), compiled into class file and only interpreted at the end during runtime. All these happen at the backend. When the whole JSP is translated into Java source file, all the HTML codes will be translated and source lines in <% %> tag will be included in a function of the t … [Read more...]

Java: Static Variables, Static Methods and Static Constructor

May 6, 2009 by Sze Hau 1 Comment

Java's static variables are variables or fields that are common to all object of a class. Unlike instance variables, objects of the same class have their own distinct copies of the variables and values. In other words, a static variable is shared among objects of the same class. You can declare static variables (or static fields or class variables) by adding static modifier to … [Read more...]

Java: Randomly sort values in a array (the generic way) in single pass

April 12, 2009 by Sze Hau Leave a Comment

Few years back (yes, about 4 years back), I wrote an article about randomly sort query results in MySQL. The main problem in randomly sort query results is that when you have a very large data in your database and the statement to sort the result may change the data execution plan causing DMBS does not choose the right plan. Therefore, sometime it is more wise to sort it in … [Read more...]

Java: Format integer into number of decimal places and performance

March 20, 2009 by Sze Hau 2 Comments

For certain reasons (e.g. precision issue), some programmer may store a float value (e.g. money) in integer variable. For example -12345678.90 is stored as -1234567890. To convert the integer value to number with number of decimal places is a problem. There are several way to do it. You can simply use the Java's String.format(), DecimalFormat or Float.toString(). Most of … [Read more...]

« Previous Page
Next Page »

Advertisement

  • Facebook
  • Google+
  • Instagram
  • Twitter

Email News Letter

Sign up to receive updates daily and to hear what's going on with us

Software and Hardware

MD5 and SHA1 Checksum Using Windows

July 5, 2017 By Sze Hau Leave a Comment

Blog Network

  • Personal Fincance Personal Finance – Personal Money Tips, Stock Investment, Small Business and Make Money Online
  • szehau's weblog Life, Internet, Software, Gadgets, Programming and Investments

Snippet IT

This is the place where I want to share anything about information technology.

Search

Recent

  • MD5 and SHA1 Checksum Using Windows
  • MD5 and SHA1 Checksum Using Linux
  • Java: Unlimited Strength Jurisdiction Policy
  • WordPress: How To Change Admin Username
  • Linux: How To Compress And Decompress Folders And Files

Tags

Adsense advertisement advertising apache blog blogging tips C# EGPC error estimation format format Integer Gmail Google Google Adsense Google Chrome Google Search Engine Google search result how to HTTP internet marketing Java JavaScript Linux money password performance PHP programming search engine optimization secure security short URL SQL static constructor String tiny URL Tips and Tricks twitter video Windows Vista Wordpress wordpress plugin wordpress theme Youtube

Copyright © 2025 · Magazine Pro Theme on Genesis Framework · WordPress · Log in