Quantcast
Channel: Reza's Weblog
Browsing all 50 articles
Browse latest View live

Simple Tomcat and Apache HTTP Server Configuration

It took about an hour to do this seemingly simple thing so I write it here not to forget it later! I needed Apache server to be as an interceptor for tomcat calls.install both Tomcat and Apache...

View Article


SCEA Exam

I paid and registered to take the first part of SCEA (Sun Certified Enterprise Architect) exam. Even I have been studing for the past couple of months and everything was almost OK! But there was a...

View Article


Choosing an IDE - JDeveloper 11g

To start a new open source project I was looking for some handy IDE. I tried the following famous ones:  Eclipse (SDK 3.2 and ee) IntelliJ Idea 7 (beta) Netbeans 6 (nightly builds) JDeveloper 11g...

View Article

Target Typing in Java

Target typing is a language feature wherein the type of the variable in which a result is to be stored influences the type of the computation. Java does not have it, and then the following expression...

View Article

Java's compound assignment operators

The compound assignment operators are +=, –=, *=, /=, %=, <<=, >>=, >>>=, &=, ^=, and |=.The Java language specification says that the compound assignment E1 op= E2 is...

View Article


Iterating a Map

I am sorry to post this fairly simple piece of code here but I usually forget how to iterate a Map so I wire it here not to forget it again:                    Iterator it =...

View Article

String Concatenation with +

The + operator performs string concatenation if and only if at least one of its operands is of type String; otherwise, it performs addition. In this case 'a'+ 'b' prints an int number not the string...

View Article

Internet in Iran

Around a year ago the Iranian minister of communication and telecommunication said that "home users" DO NOT NEED more than 128 KB Internet speed and all ISPs were banned to give home users faster...

View Article


String Interning

Java provides two basic mechanisms for equality testing. The “==” operator can be used to test primitive values for equality, and can also be used to determine if two object references point to the...

View Article


Using Pattern.quote

We know that for replacing all the periods in "a.b.c" we can use replaceAll method of String. It take a regular expression and a replacement string.This is a mistake:...

View Article

Integer Underflow

It is stupid that java underflows when it reaches the boundries of some primities types. For example: int i = Integer.MAX_VALUE + 1; goes back to the lowest possible int which is also a negative...

View Article

Java's Mathematical Infinity

We have the mathematical representation of infinity in double or float:double i = Double.POSITIVE_INFINITY;and it behaves like mathematical infinity so that i == i+1; is correct! In Java adding a small...

View Article

exit(0) over finally

I have always thought that finally blocks are executed in any circumstances; but that wasn't true! public class Test {    public static void main(String[] args) {               try {...

View Article


IE for Linux

Our client at work reported that some javascript is not working on IE but it was working on firefox. I was at the edge of taking my whole dev environment back to windows on my dual boot windows/Ubuntu...

View Article

Apache Rewrite Rules

I have always been thinking that apache rules are useless! but recently I came across a situation that left me with no choice other than using apache redirect rules. There was a web based project with...

View Article


insideApps

The other day, I was trying the new open source application monitoring tool called insideApps. Features seem to be good but the installation process is lengthy and does not go smoothly. I encountered...

View Article

Java Frameworks and Pattern Usage by Developers

A couple of days ago I was thinking of the last time I used a pattern in my daily programming. I think it was 3 months ago! Then I tried to find out why. What I mean about a pattern is a GOF or J2EE...

View Article


Delete the Returns of a SQL Select Statement

I needed to delete the rows returned by a complex and nested select statement. Something like this: DELETE FROM table1 where table1.x NOT IN (SELECT table1.x ...) Which was not possible in MySQL or at...

View Article

Logging Tips

I noticed a lot of enhancement in production environment performance when we turn the logging from debug to info. Another best practice is this piece of code:if (loger.isDebugEnabled()) {...

View Article

Fixed IP addresses in Home LAN with Netcomm Router

I was wondering for a while how I can have fixed IP addresses on my home LAN. I needed that because I was getting different IPs after a each boot and this was a problem in port forwarding since I had...

View Article
Browsing all 50 articles
Browse latest View live