#if defined (BOSS_A_WANTS_SOMETHING) && !defined (BOSS_B_WANTS_SOMETHING)
//piece of code
#if !defined (BOSS_A_WANTS_SOMETHING) && defined (BOSS_B_WANTS_SOMETHING)
//another piece of code
#else
#error FIGHTCLUB
#endif
13 martie 2007
Eastern Polish Christmas Tree Notation
public
DataPair[] getHotelInformation(String hotelId, String informationId)
{
return getHotelInfo("EN", hotelId, informationId);
}
public
DataPair[] getHotelInformation(String lang, String hotelId, String informationId)
{
String key = "_HOINF_"+lng+"_"+hotelId+"_"+informationId;
DataPair[] tbl = (DataPair[])csh.getObject(key);
if(tbl!=null) return tbl;
Connection cn = null;
OracleCallableStatement cs = null;
try {
String qry = " begin HotelServices.getHotelInfo(?, ?, ?, ?, ?); end; ";
logger . debug("---"+qry+" "+hotelId+" "+informationId);
cn = DriverManager.getConnection("jdbc:weblogic:pool:oraclePool",null);
cs = (OracleCallableStatement)cn.prepareCall(qry);
cs . registerOutParameter(1,java.sql.Types.INTEGER);
cs . registerOutParameter(2,java.sql.Types.OTHER);
cs . setString(3,hotelId);
cs . setString(4,informationId);
cs . setString(5,lang);
cs . execute();
int sta = cs.getInt(1);
if(sta!=0) throw new Exception("status not zero sta="+sta);
ResultSet rs = cs.getResultSet(2);
tbl = getDataPairArray(rs);
logger . debug("sta="+sta+" key="+key+" cn="+cn);
csh . put(key,tbl);
}
catch(Exception e)
{
logger . debug("!!! "+e.toString()+" "+key);
}
finally
{
try {
if(cs!=null) cs . close();
if(cn!=null) cn . close();
}
catch(Exception x)
{
logger . debug("!!! "+x.toString()+" "+key);
logger . error("!!! "+x.toString());
}
}
return tbl;
}
W3C Standards
Pentru cei care stiu cate ceva de standardele Web, este cunoscut faptul ca Microsoft saboteaza constant standardele celor de la W3C (din care si el face parte). Surprinzator totusi, site-ul Microsoft este printre putinele care il respecta.
- Alienware - 48 Errors
- Apple - 6 Errors
- C|Net - 1452 Errors! The most!
- Del.icio.us - 21 errors
- Dell - 131 Errors
- Digg - 7 Errors
- Fedora - 1 Error
- GNU - Complete Failure (encoding error).
- Google - 48 Errors
- HP - 29 errors
- Konqueror - Passed Validation
- Microsoft - 0 Errors What???
- Mozilla - 0 Errors (Finally)
- MSN - 0 Errors What??? Again.
- Slashdot - 200 Errors (Slashdot has a mechanism that prevents you from validating, so I validated a Google cache of Slashdot.)
- Sourceforge - 24 Errors
- Sun Microsystems - 8 Errors
- Suse - 3 Errors
- Opera - 0 Errors
- Redhat - 7 Errors
- Wired - 51 Errors
- Yahoo - 265 Errors Wow.
01 martie 2007
Fucking dayOfWeek !
if (day = 1) or (day = 8) or (day = 15) or (day = 22) or (day = 29) then
weekday = "Monday"
elseif (day = 2) or (day = 9) or (day = 16) or (day = 23) or (day = 30) then
weekday = "Tuesday"
...
weekday = "Monday"
elseif (day = 2) or (day = 9) or (day = 16) or (day = 23) or (day = 30) then
weekday = "Tuesday"
...
Make it real, make it final !
public class IntWrapper {private final String value;
public IntWrapper(int value) {
this.value = String.valueOf(value);
}
public String getValue() {
return value;
}
}
Abonați-vă la:
Comentarii (Atom)