martedì 5 luglio 2011

Nuove risorse Ajax

Finestra modale (jquery based): http://leanmodal.finelysliced.com.au/
help window (jquery based):

lunedì 4 luglio 2011

Generare jar con key signature

http://download.oracle.com/javase/tutorial/security/toolfilex/index.html

giovedì 30 giugno 2011

Directory e file temporanei in java

Directory temporanea

System.getProperty("java.io.tmpdir")

File temporanei
File temp = File.createTempFile("real",".howto"); temp.deleteOnExit();

String tempdir = System.getProperty("java.io.tmpdir");
if ( !(tempdir.endsWith("/") || tempdir.endsWith("\\")) )
tempdir = tempdir + System.getProperty("file.separator");

mercoledì 29 giugno 2011

Conversioni di tipi in java

Da double a String

public class
ConvertDoubleToString {
public static void main(String[] args) {
double aDouble = 0.11;
String aString = Double.toString(aDouble);
}
}

Da String a double

public class ConvertStringToDouble {
public static void main(String[] args) {
String aString = "78";
double aDouble = Double.parseDouble(aString);

System.out.println(aDouble);
}
}

Da String a int

String colorChoosed_s = this.prop.getProperty("colorChoosed");
return Integer.parseInt(colorChoosed_s);


Da int a String

int fileFormat= 1;
return Integer.toString(fileFormat)


Da String a boolean

String twainInterfaceEnable_s = this.prop.getProperty("twainInterfaceEnable");
return Boolean.parseBoolean(twainInterfaceEnable_s);


Da boolean a String

boolean
twainInterfaceEnable = false;
return Boolean.toString(twainInterfaceEnable)


lunedì 27 giugno 2011

Serializzazione/deserealizzazione Oggetti Exception con ULC

Lato Client
public void printMessageDialog(IOException exception) {
ByteArrayOutputStream os;
ObjectOutputStream oos;
try {
os = new ByteArrayOutputStream();
oos = new ObjectOutputStream(os);
oos.writeObject(exception);
invokeULC("printMessageDialog", new Object[] { os.toByteArray() });
oos.close();
} catch (FileNotFoundException e) {
logger.error("Unable to send message to server", e);
} catch (IOException e) {
logger.error("Unable to send message to server", e);
}
}


Lato Server


public void printMessageDialog(byte[] bytes) {
ByteArrayInputStream bis = new ByteArrayInputStream(bytes);
ObjectInputStream ois;
try {
ois = new ObjectInputStream(bis);
IOException e = (IOException) ois.readObject();
MessageDialogs.error(owner, "Errore nella creazione del file", e.getMessage(), e)
.show();
} catch (IOException e) {
logger.error("Unable to deserialize message object", e);
} catch (ClassNotFoundException e) {
logger.error("Unable to deserialize message object", e);
}
}

martedì 24 maggio 2011

Link su subversion e Ant

SUBVERSION


  1. http://tech.focustheweb.com/programmazione/come-fondere-merge-un-ramo-branch-di-un-repository-svn/
  2. http://svnbook.red-bean.com/
  3. http://stackoverflow.com/questions/698313/what-is-trunk-branch-and-tag-in-subversion


ANT

  1. Ant: http://ant.apache.org/manual/
  2. Task Sync di Ant : http://ant.apache.org/manual/Tasks/sync.html
  3. Task ftp di Ant: http://ant.apache.org/manual/Tasks/ftp.html
  4. Task Exec, esecuzione comandi (es. .sh): http://ant.apache.org/manual/Tasks/exec.html
  5. Esempio interessante: http://www.experts-exchange.com/Web_Development/Miscellaneous/A_644-Publishing-you-websites-using-ANT-scripts.html