Java, oop

Classi Java – un semplice esempio

Ripreso e semplificato da Cornell – Horstmann

/**
@version 1.10 1999-12-18
@author Cay Horstmann
*/

// import java.util.*;

public class EmployeeTest
{
public static void main(String[] args)
{
// fill the staff array with three Employee objects
Employee[] staff = new Employee[3];

staff[0] = new Employee(“Carl Cracker”, 75000);
staff[1] = new Employee(“Harry Hacker”, 50000);
staff[2] = new Employee(“Tony Tester”, 40000);

// raise everyone’s salary by 5%
for (int i = 0; i < staff.length; i++)
staff[i].raiseSalary(5);

// print out information about all Employee objects
for (int i = 0; i < staff.length; i++)
{
Employee e = staff[i];
System.out.println(“name=” + e.getName()
+ “,salary=” + e.getSalary());
}
}
}

class Employee
{
public Employee(String n, double s)
{
name = n;
salary = s;

}

public String getName()
{
return name;
}

public double getSalary()
{
return salary;
}

public void raiseSalary(double byPercent)
{
double raise = salary * byPercent / 100;
salary += raise;
}

private String name;
private double salary;
// private Date hireDay;
}

Inglese

Dieci cose su Shakespeare che forse non tutti sanno

Una divertente composizione di piccoli ma talvolta significativi dettagli sulla (presunta) vita di Shakespeare, di cui  Wikipedia riporta l’epitaffio scolpito sulla tomba

Good frend for Jesus sake forebeare,
To digg þe dust encloased heare.
Blese be þe man þat spares þes stones,
And curst be he þat moves my bones.

In modern spelling:
Good friend for Jesus sake forbear,
To dig the dust enclosed here.
Blessed be the man that spares these stones,
And cursed be he that moves my bones.

A proposito, se vi correggono la grafia quando scrivete il nome, pare ne esistano ottanta varianti, con un po’ di fortuna può passare per una citazione.

Attualità, Internet e reti

Icann cede il passo ?

Stando ad un articolo del New York Times, potrebbe avvicinarsi un cambio nella gestione dei nomi di dominio attualmente riservata all’Internet Corporation for Assigned Names and Numbers .

Niente a che fare, naturalmente, con le recenti disavventure dello spionaggio NSA:

Those spying programs had nothing to do with the role of the United States or Icann in administering Internet addresses. But the perception that the United States was pulling all the strings led to a global uproar.

(And Crimea loves Russia)