Finestra modale (jquery based): http://leanmodal.finelysliced.com.au/
help window (jquery based):
martedì 5 luglio 2011
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
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 doublepublic 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);
}
}
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);
}
}
venerdì 3 giugno 2011
Ma come la chiamo un'interfaccia java?
Bella discussione su Stack Overflow:
http://stackoverflow.com/questions/541912/interface-naming-in-java
http://stackoverflow.com/questions/541912/interface-naming-in-java
martedì 24 maggio 2011
Link su subversion e Ant
SUBVERSION
ANT
- http://tech.focustheweb.com/programmazione/come-fondere-merge-un-ramo-branch-di-un-repository-svn/
- http://svnbook.red-bean.com/
- http://stackoverflow.com/questions/698313/what-is-trunk-branch-and-tag-in-subversion
ANT
- Ant: http://ant.apache.org/manual/
- Task Sync di Ant : http://ant.apache.org/manual/Tasks/sync.html
- Task ftp di Ant: http://ant.apache.org/manual/Tasks/ftp.html
- Task Exec, esecuzione comandi (es. .sh): http://ant.apache.org/manual/Tasks/exec.html
- Esempio interessante: http://www.experts-exchange.com/Web_Development/Miscellaneous/A_644-Publishing-you-websites-using-ANT-scripts.html
Iscriviti a:
Post (Atom)