Log SQL statements for Hibernate

if you ever want to see the actual SQL that any hibernate call makes you can add the following line to your log4j file

log4j.logger.org.hibernate.SQL=DEBUG, console

Naming a for loop in java

for(int i = 0; i<10; i++)
{
loopName: for(Organization org: organizations)
{
if(org.getId() .equals( new Long("5")))
break loopName;
}
//do other stuff

}


http://www.informit.com/library/content.aspx?b=STY_Java2_24hours&seqNum=96

MYSQL: Restoring DB from .sql backup

To restore a mysql database from Unix shell
mysql -u my_user_name -p db_name < my_sql_file.sql

NoSuchBeanDefinitionException

It is common to get similar error:
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'photoUserTag' is defined
The solution is:
Verify that bean name matches with the bean definition.  

Location by IP address

http://www.find-ip-address.org/

Location by Zip code

http://www.phpfever.com/soap-zip-code-web-service.html

How to show or hide hidden files in macOS Finder?

You can show hidden files by pressing together SHIF + COMMAND + "."



To display hidden files in your Mac that start with ".fileName":
- Open Terminal
- Execute

  • defaults write com.apple.finder AppleShowAllFiles TRUE
  • killall Finder

To hide hidden files in your Mac that start with ".fileName":
- Open Terminal
- Execute:

  • defaults write com.apple.finder AppleShowAllFiles FALSE
  • killall Finder

RSS Syntax

<?xml version="1.0" encoding="ISO-8859-1" ?>
<rss version="2.0">

<channel>
<title> <!---Channel Title---> </title>
<link> <!---Channel's Link---> </link>
<description> <!---Brief Description---> </description>

<item>
<title> <!---Item Title 1---> </title>
<link> <!---Item Link 1---> </link>
<description> <!---Brief Description 1---> </description>
</item>

<item>
<title> <!---Item Title 2---> </title>
<link> <!---Item Link 2---> </link>
<description> <!---Brief Description 2---> </description>
</item>

</channel>

</rss>

SQL: joint statment on 3 different tables

select distinct u.email from user u join season_roster sr on u.id=sr.user_id join team t on t.id=sr.team_id where t.league_id in (3, 13) and u.email like '%@%'  and u.email not like '%test.com';