Benutzer:Meph666/Spielwiese
Zur Navigation springen
Zur Suche springen
New cost function:
where
d(n,l) is the manhattan distance between tiles n and l
colors
[Bearbeiten | Quelltext bearbeiten]adobe kuler zum herumexperimentieren mit Farben
cars: | background | orange-flash | cal-bg | hl-car | rosatext |
---|
old colors
[Bearbeiten | Quelltext bearbeiten]versionstabelle: | farbe1 | farbe2 | farbe3 | farbe4 | farbe5 |
---|
vorschlag1 zeittafel: | farbe1 | farbe2 | farbe3 | farbe4 | farbe5 |
---|
vorschlag2 zeittafel: | farbe0 (0.941,0.847,0.553) |
farbe1 (0.941,0.847,0.553) |
farbe2 (0.988,0.851,0.345) |
farbe3 (0.988,0.690,0.376) |
farbe4 (0.890,0.569,0.376) |
farbe5 (0.616,0.820,0.184) |
---|---|---|---|---|---|---|
aufgehellt | farbe_h_0 (0.859,0.847,0.757) |
farbe_h_1 (0.949,0.882,0.674) |
farbe_h_2 (1.000,0.906,0.486) |
farbe_h_3 (0.988,0.749,0.475) |
farbe_h_4 (0.890,0.647,0.506) |
farbe_h_5 (0.713,0.820,0.482) |
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class Book {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
try {
Class.forName("com.mysql.jdbc.Driver");
Connection conn = DriverManager.getConnection(
"jdbc:mysql://localhost:3306/dbname",
"user", "password");
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(
"SELECT title, published_date FROM test_table");
System.out.println("* books *");
while (rs.next()) {
System.out.print(rs.getString("title") + ", ");
System.out.print(rs.getString("published_date") + "\n");
}
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
import java.io.*;
import java.sql.*;
public class OraThin {
public static void main(String[] args) {
try {
Connection con=null;
Class.forName("oracle.jdbc.driver.OracleDriver");
con=DriverManager.getConnection(
"jdbc:oracle:thin:@machine_name:1521:database_name",
"scott",
"tiger");
Statement s=con.createStatement();
s.execute("
INSERT INTO BOOKS VALUES
(
'A Tale of Two Cities',
'William Shakespeare',
4567891231,
'5-JAN-1962'
)
");
s.close();
con.close();
} catch(Exception e){e.printStackTrace();}
}
}
Ndim-Key
[Bearbeiten | Quelltext bearbeiten]/* --------------------------------------------- */
de.wilken.energylib.util.NdimKey
Zusammengesetzter Schlüssel für Maps
ndim = n-dimensional
Verwendung:
private final static String KND_NR1 = "knd_nr1", MND_ID = "mnd_id", GUELTIG_AB = "gueltig_ab";
private final NdimKeyFactory keyFactory = new NdimKeyFactory(
Arrays.asList(KND_NR1, MND_ID, GUELTIG_AB));
// ...
NdimKey key = keyFactory.createNdimKey();
key.setAttr(KND_NR1, "12345666");
key.setAttr(MND_ID, Integer.valueOf(20));
key.setAttr(GUELTIG_AB, new LibDatum(1,1,2008));
// key.setAttr("irgendwas", "test") --> SystemException weil ungültiges Schlüsselattribut
Map<NdimKey, Object> kndMap = new HashMap<NdimKey, Object>();
kndMap.put(key, tmpKnd);
assert tmpKnd == kndMap.get(key);
NdimKey unvollstKey = keyFactory.createNdimKey();
unvollstKey.setAttr(KND_NR1, "2343")
// key.compareTo(unvollstKey) // -> SystemException weil nicht alle Attribute gesetzt
NdimKey anotherKey = keyFactory.createNdimKey();
anotherKey.setAttr(...) //... like key but:
anotherKey.setAttr(GUELTIG_AB, "a string");
// key.equals(anotherKey) //-> SystemException wegen inkomatibler Datentypen