Java Random Number

package test;
/**
 * Scrivere un metodo che, dato un numero intero tra 2 e 12, simuli il lancio di due dadi finchè la loro somma non sia uguale al numero dato
 * @author Abejan
 * @version 14/12/2010
 */

public class Numero_Casuale {	
	
	public static void LancioDado(int p){ 
		if(p>1 && p<13){
			int val_dado1=0;
			int val_dado2=0;
			long numero_lanci=0;

		    while ((val_dado1+val_dado2)!=p){
			      //ottengo un numero casuale da 1 a 6
			      val_dado1=(int)(6*Math.random())+1;
			      //ottengo un numero casuale da 1 a 6
			      val_dado2=(int)(6*Math.random())+1;
			      numero_lanci++;
			}
		    System.out.println("Trovato lancio in "+numero_lanci+" lanci.");
		}else{
			System.out.println("Numero di input non valido");
		}
	}
	
	public static void main(String[] args) {
		LancioDado(2);
	}
}
Posted in Java, Programming Languages | Comments Off on Java Random Number

Java Booble Sort

package test;

/**
 * Classe che implementa il metodo di ordinamento del BoobleSort
 * @author Abejan
 * @version 14/12/2010
 *
 */

public class BoobleSort {

	public static void ordina(int[] array_elementi){
		
		int i=0;
		int swap;//variabile di appoggio per lo swap
		int count=0;
		boolean flgswap=true;
			
		while (flgswap){
			flgswap=false;
			i=0;
			System.out.println("Passaggio " + count);
			while (i<array_elementi.length-1-count){
				print_array(array_elementi);			
				//swap
				if(array_elementi[i]>array_elementi[i+1]){
					swap=array_elementi[i+1];
					array_elementi[i+1]=array_elementi[i];
					array_elementi[i]=swap;
					flgswap=true;
				}	
				i++; 				
			}
			count++;//conteggio numero passaggi
		}
	}
	
	//metodo che stampa l'array
	public static void print_array(int[] array_elementi){
		int i;
		for (i=0;i<array_elementi.length;i++){
			System.out.print("["+i+"]->" + array_elementi[i]+" ");
		}			
		System.out.println("");
	}
	
	public static void main(String[] args) {
		int ar[]={3,1,5,2,4};
		ordina(ar);
	}		
}
Posted in Java, Programming Languages | Comments Off on Java Booble Sort

Java Binary Tree

package test;
/**
 * Classe principale per gestire l'ordinamento ad albero binario 
 * @author Abejan
 * @version 14/12/2010
 *
 */

public class BinaryTree {

	public static void popola_albero(int array_elementi[]){		
		int i;
		BinaryTreeNodo root = new BinaryTreeNodo(array_elementi[0]);
		
		for (i=1;i<array_elementi.length;i++){
			insert_nodo(root,new BinaryTreeNodo(array_elementi[i]));					
		}
		
		stampa_albero_ordinato(root);
	}//end popola_albero
	
	public static boolean insert_nodo(BinaryTreeNodo nodo_nav, BinaryTreeNodo nodo_ins){
		if (nodo_nav.getValore()>nodo_ins.getValore() && nodo_nav.getNodo_sx()==null ){
			nodo_nav.setNodo_sx(nodo_ins);
			return true;
		} else if (nodo_nav.getValore()>nodo_ins.getValore() && nodo_nav.getNodo_sx()!=null ){
			insert_nodo(nodo_nav.getNodo_sx(),nodo_ins);
			return false;
		} else if (nodo_nav.getValore()<nodo_ins.getValore() && nodo_nav.getNodo_dx()==null ){
			nodo_nav.setNodo_dx(nodo_ins);
			return true;
		} else if (nodo_nav.getValore()<nodo_ins.getValore() && nodo_nav.getNodo_dx()!=null ){
			insert_nodo(nodo_nav.getNodo_dx(),nodo_ins);
			return false;					
		} else {
			return false;
		}
	}//end insert_nodo
	
	public static void stampa_albero_ordinato(BinaryTreeNodo nodo){
		if (nodo.getNodo_sx()!=null){
			stampa_albero_ordinato(nodo.getNodo_sx());
		}
		System.out.println("Valore nodo="+nodo.getValore());
		if (nodo.getNodo_dx()!=null){
			stampa_albero_ordinato(nodo.getNodo_dx());
		}
	}
	
	public static void main(String[] args) {
		int ar[]={3,10,5,2,4,9,7,8,1,6};
		popola_albero(ar);
	}//end main

}
package test;
/**
 * Classe secondaria per gestire l'ordinamento ad albero binario 
 * @author Abejan
 * @version 14/12/2010
 *
 */
public class BinaryTreeNodo {

	private int valore; //valore contenuto nel nodo
	private BinaryTreeNodo nodo_sx; 
	private BinaryTreeNodo nodo_dx; 
	

	//costruttore
	public BinaryTreeNodo(int p_valore){
		this.setValore(p_valore);
		nodo_sx=null;
		nodo_dx=null;
	}

	public void setValore(int valore) {
		this.valore = valore;
	}

	public int getValore() {
		return valore;
	}

	public void setNodo_sx(BinaryTreeNodo nodo_sx) {
		this.nodo_sx = nodo_sx;
	}

	public BinaryTreeNodo getNodo_sx() {
		return nodo_sx;
	}

	public void setNodo_dx(BinaryTreeNodo nodo_dx) {
		this.nodo_dx = nodo_dx;
	}

	public BinaryTreeNodo getNodo_dx() {
		return nodo_dx;
	}
}
Posted in Java, Programming Languages | Comments Off on Java Binary Tree

VirtualBox New Harddisk UUID

Procedura di Virtual Box per reimpostare un nuovo UUID al disco virtuale.

Può capitare a volte di reimpostare il codice UUID della macchina virtuale, quando appare il seguente messaggio:
Trying to open a VM config nome_file which has the same UUID as an existing virtual machine.

Seguire i seguenti passaggi per correggere il problema.

  1. In una shell lanciare il seguente comando

    VBOXMANAGE.EXE internalcommands sethduuid "<nome_file>.vdi"
    

  2. Modificare nel file .vbox il nuovo codice UUID, nei seguenti Tag:

    <Machine uuid="" . . . . >
    <HardDisk uuid="" . . . . >
    <Image uuid="" . . . . >
    

  3. Fine procedura

VBoxManage internalcommands sethduuid disk2.vdi

Posted in Application, Virtualbox | Comments Off on VirtualBox New Harddisk UUID

UML

Un prodotto opensource per la realizzazione di grafici UML

http://dia-installer.de/

Posted in Application | Comments Off on UML

Appunti di informatica

Un bel blog che raccoglie diversi appunti di informatica

technotes.altervista.org non più attivo

Posted in Application | Comments Off on Appunti di informatica

Serial Number

Alcuni link di siti web che condividono serial number.

http://www.serialnumber.in/

Posted in Application | Comments Off on Serial Number

Velocità trasferimento dati

ADSL (Asymmetric Digital Subscriber Line)

Nome Standard Tipo di Traffico Trasferimento dei bit
Adsl

ATM

20M / 1M
Adsl ETH 20M / 1M

SHDSL (Single-Pair High-speed Digital Subscriber Line) o anche (Symmetric High-speed Digital Subscriber Line)

Nome Standard Tipo di Traffico Trasferimento dei bit
Shdsl ATM – Tipo A 4M / 4M
Shdsl ATM – Tipo B 8M / 8M
Shdsl ETH 10M / 10M

Esempi di velocità di trasferimento dati di linee ad alta capacità. La fibra ottica viene usata per ottenere elevate velocità di trasferimento su lunghe distanze.

SDH
(Synchronous Digital Hierarchy)
SONAR (multiplex SONET)
Raggruppamento STM
(Synchronous Transport Module di livello N)
[Ottico]
Raggruppamento STS
(Synchronous Transport Signal di livello N)
[Elettico]
Nome della fibra ottica
(Optical Carrier)
[Ottico]
Trasferimento dei bit
(Grezzo)
Linee Vocali
STM-0 STS-1 OC-1 51,840 Mbps 810
STM-1 STS-3 OC-3 155,520 Mbps 2430
STM-3 STS-9 OC-9 466,56 Mbps
STM-4 STS-12 OC-12 622,080 Mbps 9720
STM-6 STS-18 OC-18 933,12 Mbps
STM-8 STS-24 OC-24 1.244,160 Mbps 19440
STM-12 STS-36 OC-36 1.866,24 Mbps
STM-16 STS-48 OC-48 2,488320 Gbps 38880
STM-? STS-96 OC-96 4,976 Gbps 64512
STM-64 STS-192 OC-192 9,953280 Gbps 129024
STM-? STS-256 OC-256 13,271 Gbps 172032
STM-256 STS-768 OC-768 39,813120 Gbps 516096

Velocità reti mobile

Net Name Tech Name Description download upload
1G TACS Total Access Communication System
1G ETACS Extended Total Access Communication System
2G GSM Global System for Mobile
2.5G [G] GPRS General Packet Radio Service 40 Kbps 5 Kbps
2.75G [E] EDGE (EGPRS) Enhanced Data rates for GSM Evolution 180 Kbps 20 Kbps
3G UMTS Universal Mobile Telecommunications System 700 Kbps 90 Kbps
3.5G [H] HSPA High Speed Packet Access 7.2 Mbps 900 Kbps
3.75G [H+] HSPA+ High Speed Packet Access Evolution 56 Mbps 7 Mbps
4G LTE Cat.3 (standard) Long Term Evolution 100 Mbps 50 Mbps
4G LTE Cat.4 Long Term Evolution 150 Mbps 50 Mbps
4G LTE Cat.5 Long Term Evolution 300 Mbps 50 Mbps
4G LTE Cat.6 (LTE-A) Long Term Evolution Advanced 300 Mbps 75 Mbps
4G LTE Cat.7 (LTE-A) Long Term Evolution Advanced 300 Mbps 100 Mbps
4G LTE Cat.8 (LTE-A) Long Term Evolution Advanced 3000 Mbps 1500 Mbps
4G LTE Cat.9 (LTE-A) Long Term Evolution Advanced 450 Mbps 50 Mbps
4G LTE Cat.10 (LTE-A) Long Term Evolution Advanced 450 Mbps 100 Mbps
4G LTE Cat.11 (LTE-A) Long Term Evolution Advanced 600 mbps 50 Mbps
4G LTE Cat.12 (LTE-A) Long Term Evolution Advanced 600 Mbps 100 Mbps
4G LTE Cat.13 (LTE-A) Long Term Evolution Advanced 400 Mbps 150 Mbps
4G LTE Cat.14 (LTE-A) Long Term Evolution Advanced 400 Mbps 100 Mbps
4G LTE Cat.15 (LTE-A) Long Term Evolution Advanced 4000 Mbps 1500 Mbps

Un utile convertitore unità di misura Bit per secondo (es: bps, kbps, mbps) in byte (es: B byte, KB kilobyte, MB megabyte, GB gigabyte)
https://jumk.de/calc/trasmissione.shtml

Un altra funzionalità che aiuta a rilevare le caratteristiche del proprio smartphone / device.
https://www.frequencycheck.com/models

Mappa della copertura in fibra ottica in Italia.
https://fibermap.it
Mappa fibra ottica Rete “euNetworks” (Germany, France, Benelux, United Kingdom)
https://map.eunetworks.com/

Posted in Network | Comments Off on Velocità trasferimento dati

Computer Doctor

Bella questa

Doctor Computer

Posted in Sistemi | Comments Off on Computer Doctor

CRM Top 10 List Open Source

Molto utile questo articolo che elenca i migliori 10 crm open source

http://www.insidecrm.com/features/top-open-source-solutions-121307/

  • SugarCRM Inc
  • SplendidCRM Software Inc
  • CentricCRM
  • Hipergate
  • Compiere Inc
  • Vtiger CRM
  • CentraView Inc
  • XRMS CRM
  • Cream CRM
  • Tustena CRM
  • Posted in Application, CRM Customer Relationship Management | Comments Off on CRM Top 10 List Open Source