Thursday, May 15, 2008
Java Design Patterns
http://www.fluffycat.com/Java-Design-Patterns/
http://www.javacamp.org/designPattern/
Tuesday, May 6, 2008
Currently doing research on oBIX & Tridium
oBIX (Open Building Information Xchange) is a focused effort by industry leaders and associations working toward creating a standard XML and Web Services guideline to facilitate the exchange of information between intelligent buildings, enable enterprise application integration and bring forth true systems integration. Based on Standards widely used by the IT Industry, the oBIX guideline will improve operational effectiveness giving facility managers and building owners increased knowledge and control of their properties. Comprised of representatives from the entire spectrum of the buildings systems industry, oBIX includes professionals from the security, HVAC, building automation, open protocol and IT disciplines.
Resources:
http://www.obix.org/
A Beginner's Guide to oBIX (even if you're not a developer!)
http://www.niagara-central.com/ord?portal:/blog/Blog/17
This is 6 parts series explaining how oBIX can be used in Tridium Niagara Framework.
http://www.tridium.com/
Monday, April 21, 2008
Spring framework resources
Tuesday, April 15, 2008
Useful Javascript functions
function isEmpty(fieldName){
/*
* This method will return true if the field is empty and return
* false if it is not empty.
*/
emptyFlag = true;
if (fieldName.value == ''){ //to check the given value is empty or not
return true;
}
else{
for(i=0;i<(fieldName.value).length;i++)
{
if((fieldName.value).charAt(i)!=''){
emptyFlag = false;
break;
}
}
return emptyFlag;
}
}
#Today's date
var date = new Date();
var d = date.getDate();
var m = date.getMonth() + 1;
var yy = date.getYear();
var day = (d < 10) ? '0' + d : d;
var month = (m < 10) ? '0' + m : m;
var year = (yy < 1000) ? yy + 1900 : yy;
//put the day, month and year in whatever format you require.
var todayDt = year+"-"+month+"-"+day
document.write(todayDt);
Friday, April 11, 2008
Retrieving website content with Java
import java.io.BufferedReader;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
public class WebContent
{
URL url = null;
URLConnection urlConn = null;
BufferedReader br = null;
public WebContent(String urlStr)
{
try
{
if (urlStr != null)
{
url = new URL(urlStr);
urlConn = url.openConnection();
br = new BufferedReader(new InputStreamReader(urlConn.getInputStream()));
String line = null;
StringBuffer sbf = new StringBuffer();
File outFile = new File("out.txt");
FileWriter fw = new FileWriter(outFile);
while ((line = br.readLine()) != null)
{
fw.write(line);
fw.write("\n");
}
}
}
catch (MalformedURLException mue)
{
System.out.println("mue = " + mue.getMessage());
}
catch (IOException ioe)
{
System.out.println("ioe = " + ioe.getMessage());
}
finally
{
if (br != null)
{
try
{
br.close();
}
catch (IOException ioe)
{
}
}
}
}
public static void main(String args[])
{
try
{
WebContent webObj = new WebContent("http://www.yahoo.com");
}
catch (Exception e)
{
e.printStackTrace();
}
}
}