Java Open Source SDK Tools provided for Android Mobile OS.
in riferimento a: Android Developers (visualizza su Google Sidewiki)martedì 29 dicembre 2009
domenica 27 dicembre 2009
Play Framework - Build java web application faster
New java framework available for web development
in riferimento a: Play framework ★ Home (visualizza su Google Sidewiki)Blender 3d suite
Is a good SDK for 3d animation.
in riferimento a: blender.org - Features & Gallery (visualizza su Google Sidewiki)giovedì 17 dicembre 2009
Virtualbox Bridged network setup
Great tutorial on vbox
in riferimento a: How To Setup Bridge Networking for Virtualbox in Windows | Bauer-Power- Information is Power! (visualizza su Google Sidewiki)mercoledì 16 dicembre 2009
Eseguire codice Javascript in java
Esiste un package java il javax.script inserito nella versione JDK 6.0 che permette ad un programma java di eseguire del codice javascript.
Esattamente lo stesso codice esguito all'interno di browser ad esempio.
Su HTML.it trovate un articolo molto interessante in questo senso.
venerdì 11 dicembre 2009
Java Idiomatic Patterns
ckjm & JavaNCSS are two opensource tools used for object-oriented metrics and java cyclimatic complexity.
Goood Article on IBM Developerworks
venerdì 4 dicembre 2009
Oracle JDBC Connection string SID vs SERVICE_NAME
For sid use this :
jdbc:oracle:thin:@server:1521:
For service name this :
jdbc:oracle:thin:@//server:
"jdbc:oracle:thin:@//server:1521/SERVICE_NAME"
- Oracle SID != SERVICE_NAME - Rob@Rojotek (visualizza su Google Sidewiki)
sabato 28 novembre 2009
Good Article on Struts 2 on Google Appengine
Step by Step tutorial
in riferimento a: Creating Struts2 application on Google App Engine (GAE) « My Thoughts on software development (visualizza su Google Sidewiki)Google Latitude
Permette ai tuoi amici di sapere dove sei in tempo reale.
in riferimento a: Google Latitude (visualizza su Google Sidewiki)venerdì 27 novembre 2009
Generate Random Numbers in a range using Java
public final class RandomInteger {
public static final void main(String... aArgs){
log("Generating 10 random integers in range 0..99.");
//note a single Random object is reused here
Random randomGenerator = new Random();
for (int idx = 1; idx <= 10; ++idx){
int randomInt = randomGenerator.nextInt(100);
log("Generated : " + randomInt);
}
log("Done.");
}
private static void log(String aMessage){
System.out.println(aMessage);
}
}
"public final class RandomInteger { public static final void main(String... aArgs){ log("Generating 10 random integers in range 0..99."); //note a single Random object is reused here Random randomGenerator = new Random(); for (int idx = 1; idx <= 10; ++idx){ int randomInt = randomGenerator.nextInt(100); log("Generated : " + randomInt); } log("Done."); } private static void log(String aMessage){ System.out.println(aMessage); } }"
- Java Practices -> Generate random numbers (visualizza su Google Sidewiki)
martedì 24 novembre 2009
JSP Redirecting Page based on client device
client type.
<pre name=code class=java>
<%!
public String[] mobileTags = { "cellphone",
"iemobile",
"midp",
"mini",
"mmp",
"mobile",
"nokia",
"pda",
"phone",
"pocket",
"ppc",
"psp",
"symbian",
"up.browser",
"up.link",
"wap",
"windows ce" };
public Boolean isMobile( String browserInfo )
{
for ( int n=0; n<mobileTags.length; n++ )
{
if ( browserInfo.toLowerCase().contains(
mobileTags[n].toLowerCase() ) )
{
return true;
}
}
return false;
}
%>
<%
String bInfo = (String)request.getHeader( "User-Agent" );
if ( isMobile( bInfo ) )
{
response.sendRedirect( "mobile.jsp" );
}
else
{
response.sendRedirect( "home.jsp" );
}
%>
</pre>
mercoledì 18 novembre 2009
Tutorial no Appengine in Eclipse
Step by step tutirial on Google Appengine
in riferimento a: /n software inc. - Using IP*Works! in a Google App Engine Web Application (visualizza su Google Sidewiki)Embedded OC4J Process Detected
you should try to kill by task manager all java.exe o javaw.exe proccesses.
in riferimento a: OTN Discussion Forums : Orphan Embedded OC4J Process Detected ?? ... (visualizza su Google Sidewiki)lunedì 16 novembre 2009
Il Nuovo sito personale
Informazioni utili su "Vincenzo Amoruso ..............................
Per scrivere una voce relativa a una parte specifica della pagina, evidenzia le parole di tale parte nella pagina.
Java Other way to split string and add it to Vector
public void decompattaBufferAggiungiCausal
for (int j=0;j<98;j++) {
String causale=buffer.substring(j*3,(
if (causale.trim().length()>0) listaCausali.add(causale);
}
}
String split to specified length
public static String[] slice(String str, int maxLength)
{
Pattern p = Pattern.compile(".{1," + maxLength + "}");
Matcher m = p.matcher(str);
List result = new ArrayList();
while (m.find())
{
result.add(m.group());
}
return result.toArray(new String[result.size()]);
}
domenica 15 novembre 2009
Con side Sidewiki condividi il web
Con Sidewiki condividi le cose migliori del web con gli amici.
Ottimo strumento.
sabato 14 novembre 2009
Nuovo CMS powered by Joomla
Informazioni utili su "Benvenuto in Joomla".
Per scrivere una voce relativa a una parte specifica della pagina, evidenzia le parole di tale parte nella pagina.
Nuovo Sito per corsi on line
Tutti i corsi on line
in riferimento a: Vincenzo Amoruso - Online Training (visualizza su Google Sidewiki)venerdì 13 novembre 2009
Spreadsheet Dojo Widget
Emulate excel by dojo Widget
in riferimento a: Spreadsheet dojo widget (visualizza su Google Sidewiki)mercoledì 11 novembre 2009
Sort HahMap by TreeMap
HashMap listaPianificazione = new HashMap();
....
....
public AbstractList accodaPianificazioneFerieTempo
if (listaPianificazione!=null)) {
TreeMap m=new TreeMap(listaPianificazione);
Iterator iterator = m.values().iterator();
ArrayList l,l1;
while( iterator. hasNext() ){
l=(ArrayList)iterator.next();
if (l!=null) {
gl.add(l);
}
}
}
return gl;
}
martedì 10 novembre 2009
Sorted HashMap
public HashMap getSortedMap(HashMap hmap)
{
HashMap map = new LinkedHashMap();
List mapKeys = new ArrayList(hmap.keySet());
List mapValues = new ArrayList(hmap.values());
hmap.clear();
TreeSet sortedSet = new TreeSet(mapValues);
Object[] sortedArray = sortedSet.toArray();
int size = sortedArray.length;
// a) Ascending sort
for (int i=0; i
venerdì 6 novembre 2009
Array Search Text
Arrays.sort(array);
printArray("array ordinato", array);
int index = Arrays.binarySearch(array, 2);
System.out.println("Trovato 2 alla posizione :" + index);
"int index = Arrays.binarySearch(array, 2); System.out.println("Found 2 @ " + index);"
- Array Search Test : Arrays « Collections Data Structure « Java (visualizza su Google Sidewiki)
giovedì 5 novembre 2009
RIcerca Abi Cab online
Ricerca una banca
in riferimento a: Abi cab bancario e postale - Compraeaffitta (visualizza su Google Sidewiki)mercoledì 4 novembre 2009
Create java email Template
// Grab the email template. InputStream template = getServlet() .getServletConfig() .getServletContext() .getResourceAsStream( "/WEB-INF/email/in riferimento a:registrationNotification.xml") ; EmailTemplate notification = EmailTemplate. getEmailTemplate(template); // Create the section of the email containing the actual user data. String[] args = { "Rafe" }; EmailSender.sendEmail("mail@ mail.com ", notification, args);
"// Grab the email template. InputStream template = getServlet() .getServletConfig() .getServletContext() .getResourceAsStream( "/WEB-INF/email/registrationNotification.xml"); EmailTemplate notification = EmailTemplate.getEmailTemplate(template); // Create the section of the email containing the actual user data. String[] args = { "Rafe" }; EmailSender.sendEmail("rafe@rafe.us", notification, args);"
- Creating Email Templates with XML - O'Reilly Media (visualizza su Google Sidewiki)
martedì 3 novembre 2009
Java HashMap sorting
You can ure TreeMap for sorting your HashMap :
Map miaTreeMap = new TreeMap(miaHashMap);in riferimento a: HashMap sorting (Java in General forum at JavaRanch) (visualizza su Google Sidewiki)
Conditional Insert if exist
INSERT INTO sometable SELECT "code","description" FROM DUAL WHERE NOT EXISTS ( SELECT 1 FROM sometable WHERE column1 = "code" AND column2 = "description" );in riferimento a: ORACLE DECODE CASE SQL PL/SQL (visualizza su Google Sidewiki)
Servizio Notifica vincite via mail ,chat etc..etc..
Servizio a richiesta di notifica vincite on line.
in riferimento a: Win Check - Online .....................................................................................................winforlife estrazioni , estrazioni , vincite ,win for life ,soldi , money , lotto , superenalotto (visualizza su Google Sidewiki)Java HashMap reading using Iterator
Example :
HashMap hm = new HashMap(); ArrayList l; Iterator iterator = hm.values().iterator(); while( iterator. hasNext() ){ l=(ArrayList)iterator.next(); ...... ..... }
in riferimento a: g - Cerca con Google (visualizza su Google Sidewiki)
lunedì 2 novembre 2009
Intercept IE browser closing by Javascript
<--head> <--/head> <--body> .. <--/body>
From original post from Microsoft:
http://msdn.microsoft.com/en-
venerdì 30 ottobre 2009
vbscript : Automated Email sending
Const cdoSendUsingPickup = 1 'Send message using the local SMTP service pickup directory. Const cdoSendUsingPort = 2 'Send the message using the network (SMTP over the network). Const cdoAnonymous = 0 'Do not authenticate Const cdoBasic = 1 'basic (clear-text) authentication Const cdoNTLM = 2 'NTLM Set objMessage = CreateObject("CDO.Message") objMessage.Subject = "Example CDO Message" objMessage.From = "blabla@gmail.com" objMessage.To = "blabla@gmail.com" objMessage.TextBody = "This is some sample message text." '==This section provides the configuration information for the remote SMTP server. '==Normally you will only change the server name or IP. objMessage.Configuration.in riferimento a: g - Cerca con Google (visualizza su Google Sidewiki)Fields.Item _ ("http://schemas.microsoft. com/cdo/configuration/ sendusing") = 2 'Name or IP of Remote SMTP Server objMessage.Configuration. Fields.Item _ ("http://schemas.microsoft. com/cdo/configuration/ smtpserver") = "smtp.gmail.com" 'Type of authentication, NONE, Basic (Base64 encoded), NTLM objMessage.Configuration. Fields.Item _ ("http://schemas.microsoft. com/cdo/configuration/ smtpauthenticate") = 3 'Server port (typically 25) objMessage.Configuration. Fields.Item _ ("http://schemas.microsoft. com/cdo/configuration/ smtpserverport") = 587 'Your UserID on the SMTP server 'objMessage.Configuration. Fields.Item _ '("http://schemas.microsoft. com/cdo/configuration/ sendusername") = "blabla" 'Your password on the SMTP server 'objMessage.Configuration. Fields.Item _ '("http://schemas.microsoft. com/cdo/configuration/ sendpassword") = "mypass" 'Use SSL for the connection (False or True) objMessage.Configuration. Fields.Item _ ("http://schemas.microsoft. com/cdo/configuration/ smtpusessl") = True 'Connection Timeout in seconds (the maximum time CDO will try to establish a connection to the SMTP server) objMessage.Configuration. Fields.Item _ ("http://schemas.microsoft. com/cdo/configuration/ smtpconnectiontimeout") = 60 objMessage.Configuration. Fields.Update '==End remote SMTP server configuration section== objMessage.Send
vbscript That list pc network connections
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=
"\root\microsoft\homenet")
Set colItems = objWMIService.ExecQuery("
For Each objItem in colItems
Wscript.Echo "GUID: " & objItem.GUID
Wscript.Echo "Is LAN Connection: " & objItem.IsLANConnection
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "Phone Book Path: " & objItem.PhoneBookPath
Next
Google XMPP gTalk Notifier
Example :
package com.vincenzoamoruso.notifier;
import java.util.logging.Logger;
import com.google.appengine.api.xmpp.
import com.google.appengine.api.xmpp.
import com.google.appengine.api.xmpp.
import com.google.appengine.api.xmpp.
import com.google.appengine.api.xmpp.
import com.google.appengine.api.xmpp.
public class XMPPNotifier {
private static final Logger log = Logger.getLogger(XMPPNotifier.
public boolean sendXMPP(String toID,String Message,boolean tryByMail){
JID jid = new JID(toID);
String msgBody = Message;
Message msg = new MessageBuilder()
.withRecipientJids(jid)
.withBody(msgBody)
.build();
boolean messageSent = false;
XMPPService xmpp = XMPPServiceFactory.
if (xmpp.getPresence(jid).
SendResponse status = xmpp.sendMessage(msg);
messageSent = (status.getStatusMap().get(
}
if (!messageSent) {
System.out.println("Non Inviato");
log.warning("Non Inviato");
}
return messageSent;
}
}
Formatting Date in JSP
1) Import classes in JSP Page
<%@ page import="java.text.DateFormat" %>
<%@ page import="java.text.
2) Inizialize object and define date format
DateFormat formatter = new SimpleDateFormat("dd/MM/yyyy")
3) Format date value
"<%=formatter.format(new Date()) %>"
Formatting Date JSP
1) Import classes in JSP Page
<%@ page import="java.text.DateFormat" %>
<%@ page import="java.text.
2) Inizialize object and define date format
DateFormat formatter = new SimpleDateFormat("dd/MM/yyyy")
3) Format date value
"<%=formatter.format(new Date()) %>"
Wincheck Online on Google AppEngine
Win Check
Notifier on WinCheck123
sabato 24 ottobre 2009
Available memory from Vbs
strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") Set colCSItems = objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem") For Each objCSItem In colCSItems WScript.Echo "Total Physical Memory: " & objCSItem.TotalPhysicalMemory Next Set colOSItems = objWMIService.ExecQuery("SELECT * FROM Win32_OperatingSystem") For Each objOSItem In colOSItems WScript.Echo "Free Physical Memory: " & objOSItem.FreePhysicalMemory WScript.Echo "Total Virtual Memory: " & objOSItem.TotalVirtualMemorySize WScript.Echo "Free Virtual Memory: " & objOSItem.FreeVirtualMemory WScript.Echo "Total Visible Memory Size: " & objOSItem.TotalVisibleMemorySizeNext
Vbs starts Windows Services
This script start windows Service :
set myServices = GetObject("winmgmts:") set myObject = myServices.Get("Win32_Service.Name='MSSQLSERVER'") myObject.StartService()
IE vbs robot Browser - reading key in text file
On Error Resume Next DO Set fso = WScript.CreateObject("Scripting.FileSystemObject") Set file = fso.OpenTextFile( "Cerca.txt", 1, False, 0) Do While file.AtEndOfStream <> True set objExplorer=WScript.CreateObject("InternetExplorer.Application","objExplorer_") objExplorer.navigate2("http://www.google.it") objExplorer.ToolBar = 0 objExplorer.StatusBar = 0 objExplorer.Left = 0 objExplorer.Top = 0 objExplorer.Visible = 1 Do Until objExplorer.ReadyState=4 WScript.Sleep inti*100*Rnd() Loop objExplorer.Document.All.Item("q").Value = file.ReadLine objExplorer.Document.All.Item("sa").Click Do Until objExplorer.ReadyState=4 WScript.Sleep inti*100*Rnd() Loop WScript.Sleep inti*100*Rnd() Loop objExplorer.Quit file.Close() Set file=Nothing Set fso=Nothing inti = inti + 1 Loop Until inti = 1300 Wscript.Quit
Massive string in file sustitution by vbs script
' Script per Sostituzione di massa stringhe in file' Massive text in file substution
Set oFSO = CreateObject("Scripting.FileSystemObject")Set
objShell = WScript.CreateObject( "WScript.Shell" )
Set fOut = oFSO.CreateTextFile("StringInFileSubstitution.txt", True)
Dim FileName, Find,
ReplaceWith, FileContents, dFileContents, PathDirDim NomeP
Dim OutPut
'Modifica file nella cartella
Find = Inputbox ("Inserisci la stringa da cercare nei file","The Patcher","pippo")
ReplaceWith = Inputbox ("Inserisci la stringa da sostituire a " + Find ,"The Patcher","pippa")
PathDir = Inputbox ("Inserisci il path da cui partire","The
Patcher","C:\Test1")
DoStuff oFSO.GetFolder(PathDir).Path,Find,ReplaceWith
'Read text filefunction Fix(FileName, Find, ReplaceWith)
'Read source text
fileFileContents = GetFile(FileName)
'replace all string In the source
filedFileContents = replace(FileContents, Find, ReplaceWith, 1, -1, 1)
'Compare source And resultif dFileContents <> FileContents
Then'write result If different
WriteFile FileName, dFileContents
If Len(ReplaceWith) <> Len(Find) Then 'Can we
count n of replacements? fOut.WriteLine "DB " & FileName & "
file Fixed." fOut.WriteLine _ (
(Len(dFileContents) - Len(FileContents)) / (Len(ReplaceWith)-Len(Find)) ) &
_ " fixes Applied."End
IfElse ' fOut.WriteLine "No
Fixes Applied to source file " & FileNameEnd If
End Function'Read text file
function GetFile(FileName)
If FileName<>""
Then Dim FS, FileStream Set FS =
CreateObject("Scripting.FileSystemObject")on error resume Next
Set FileStream = FS.OpenTextFile(FileName)
GetFile = FileStream.ReadAll End IfEnd Function
'Write string As a text file.function WriteFile(FileName, Contents)
Dim OutStream, FS
on error resume NextSet FS = CreateObject("Scripting.FileSystemObject")
Set OutStream = FS.OpenTextFile(FileName, 2, True)
OutStream.Write Contents
End
Function Sub DoStuff(sDir,Find,ReplaceWith)
fOut.WriteLine sDirSet
oDir = oFSO.GetFolder(sDir)
For Each i In oDir.Filesf=Fix(i.Path, Find, ReplaceWith)Next
For Each i In oDir.SubFoldersDoStuff i.Path,Find,ReplaceWithNext
fOut.WriteLine ""'For Each i In oDir.SubFolders'DoStuff i.Path'
Next
End Sub
domenica 4 ottobre 2009
RDP command Connect to Console session
mstsc 1 -v:server /F -console /admin
sabato 16 maggio 2009
Oracle PL/SQL dual Table
Create update script of TABLEA based on fields of TABLEB.
Oracle PL/Sql Script :
set heading off set pagesize 50000 set echo off set trims on set verify off set feed off set linesize 2000 Spool &&FILE_NAME; select '-- Dati creati il 'to_char(sysdate,'dd/mm/yyyy hh24:mi') from dual; select '-- Inzio Scarico Tabella -- ' from dual; select 'update TABLEA set FIELDA=' FIELDB ' WHERE KEYA=''CHIAVE"; ' FROM TABLEB &&WHERE_CLAUSEB. ; select '-- Fine Scarico Tabella -- ' from dual; select 'exit;' from dual; Spool off;