Clear Illusion

26May/110

NoBlogDefFound: Clean code, clean logs: use appropriate tools (1/10)

NoBlogDefFound
May 3, 2010
Clean code, clean logs: use appropriate tools (1/10)

Many programmers seem to forget how logging application behavior and its current activity is important. When somebody puts:

1
log.info("!@#$%");

happily somewhere in the code, he probably don't realize the importance of application logs during maintenance, tuning and failure identification. Underestimating the value of good logs is a terrible mistake. I have collected few random advices that I find especially useful when it comes to writing logging routines and I will present them in a series of short articles. First tip (out of ten) is about logging libraries and tools.

In my opinion, SLF4J is the best logging API available, mostly because of a great pattern substitution support:

1
log.debug("Found {} records matching filter: '{}'", records, filter);

In Log4j you would have to use:

1
log.debug("Found " + records + " records matching filter: '" + filter + "'");

This is not only longer and less r [From NoBlogDefFound: Clean code, clean logs: use appropriate tools (1/10)]

Filed under: Java No Comments
10May/110

Javascript Mistakes You Must Avoid

Javascript Mistakes You Must Avoid
Posted on May 8, 2011 by iFadey

If you are new to javascript and you write raw javascript or use any framework (jQuery, Mootools, Dojo, YUI) with it, you must avoid few mistakes. Actually these are my experiences when I was learning javascript.

Equality Operator

You may know that in js, two operators are used for comparing values. First is == (two equal signs). This operator compare the values but it doesn’t compare the data type of operands. For example if first operand is 1 and the second is true, the result will be true.

if( 1 == true ) {
//this code will run
}
Here are more examples.

1 == "1" //true "true" == true //false 1 == true //true "0" == 0 //true "" == 0 //true " " == 0 //true "Str" == false //false "Str" == true //false Some of the results are [From Javascript Mistakes You Must Avoid]

Filed under: JavaScript No Comments
28Apr/110

Just what is Node.js?

Technical topicsEvaluation softwareCommunityEvents

developerWorksTechnical topicsOpen sourceTechnical library Just what is Node.js? A ready-to-code server Michael Abernethy, Freelance Programmer, Freelancer Summary: Node is a server-side JavaScript interpreter that changes the notion of how a server should work. Its goal is to enable a programmer to build highly scalable applications and write code that handles tens of thousands simultaneous connections on one, and only one, physical machine. Tags for this article: apache, application_and_information_integration, application_development, application_porting, architecture, architecture_-_application, architecture_-_information, architecture_-_web, databases_and_data_management, general_programming... more tags java_technology, open_source, open_technology_web_se..., php_(hypertext_preproc... Tag this!Update My dW interests (Log in | What's this?) Skip to help for Update My dW in [From Just what is Node.js?]

Filed under: JavaScript No Comments
21Apr/110

The Top Java Memory Problems – Part 1 Application Performance, Scalability and Architecture – The dynaTrace Blog

The Top Java Memory Problems – Part 1
by Michael Kopp, Apr 20, 11

Memory and Garbage Collection problems are still the most prominent issues in any java application. One of the reasons is that the very nature of Garbage Collection is often misunderstood. This prompted me to write a summary of some of the most frequent and also most obscure memory related issues that I have encountered in my time. I will cover the causes of memory leaks, high memory usage, class loader problems and GC configuration and how to detect them. We will begin this series with the best known one - memory leaks.
Memory Leaks
A memory leak is the most-discussed java memory issue there is. Most of the time people only talk about growing memory leaks, that is the continuous rise of leaked objects. They are in comparison, the easiest to track down as you can look at trending or histogram dumps.

Memory Trending Dump that shows that the number of objects of the same type increa [From The Top Java Memory Problems – Part 1 Application Performance, Scalability and Architecture – The dynaTrace Blog]

Filed under: Java No Comments
19Apr/110

The Usability of Passwords (by @baekdal) #tips

The Usability of Passwords: /by @baekdal .
Written by Thomas Baekdal | Saturday, August 11, 2007 | Section: tips
Security companies and IT people constantly tells us that we should use complex and difficult passwords. This is bad advice, because you can actually make usable, easy to remember and highly secure passwords. In fact, usable passwords are often far better than complex ones.

So let's dive into the world of passwords, and look at what makes a password secure in practical terms.

Update: Read the FAQ (updated January 2011)

How to hack a password

The work involved in hacking passwords is very simple. There are 5 proven ways to do so:

Asking: Amazingly the most common way to gain access to someone's password is simply to ask for it (often in relation with something else). People often tell their passwords to colleagues, friends and [From The Usability of Passwords (by @baekdal) #tips]

Filed under: Misc No Comments