| URL | comment |
|---|---|
| https://www.serverproject.de/files/ | download |
| https://www.serverproject.de/etc/freax/files/ | programming |
| https://www.serverproject.de/driveby/ (team/team) | car management |
| https://configedit.wordpress.com/ | this |
| http://forumenger.de/ | old clubsite written by spassbremse temporary not functional |
Author: configedit
3066 (just a quick rant)
spoiler alert on edx_HKUST_ex2
https://pastebin.com/pMsQc7pJ
3062 (greek/english)
| no | item |
|---|---|
| 01 | Alpha |
| 02 | Beta |
| 03 | Gamma |
| 04 | Delta |
| 05 | Epsilon |
| 06 | Zeta |
| 07 | Eta |
| 08 | Theta |
| 09 | Iota |
| 10 | Kappa |
| 11 | Lambda |
| 12 | Mu? |
| 13 | Nu? |
| 14 | Xi |
| 15 | Omicron |
| 16 | Pi |
| 17 | Rho |
| 18 | Sigma |
| 19 | Tau |
| 20 | Upsilon? |
| 21 | Phi |
| 22 | Chi |
| 23 | Psi |
| 24 | Omega |
3060 (lab03)
hong kong university edx comp102x lab3 solution
import comp102x.ColorImage;
import comp102x.Canvas;
public class Lab03
{
public void loadAnImage()
{
// Please write your code after this line
ColorImage labimg1 = new ColorImage();
int w, h;
w = labimg1.getWidth();
h = labimg1.getHeight();
Canvas canvas = new Canvas (w, h);
canvas.add(labimg1);
}
public void loadTwoImagesOnTheSameCanvas()
{
// Please write your code after this line
int w1, w2, h1, h2;
ColorImage labimg2 = new ColorImage();
ColorImage labimg3 = new ColorImage();
w1 = labimg2.getWidth();
h1 = labimg2.getHeight();
w2 = labimg3.getWidth();
h2 = labimg3.getHeight();
Canvas canvas2 = new Canvas ((2 * w1), h1);
canvas2.add(labimg2, 0, 0);
canvas2.add(labimg3, w1, 0);
}
public void imageAddition()
{
// Please write your code after this line
int ww1, ww2, hh1, hh2;
ColorImage labimg4 = new ColorImage();
ColorImage labimg5 = new ColorImage();
ColorImage labimg6 = labimg4.add(labimg5);
ww1 = labimg4.getWidth();
hh1 = labimg4.getHeight();
ww2 = labimg5.getWidth();
hh2 = labimg5.getHeight();
Canvas canvas3 = new Canvas (((3 * ww1) + 20), hh1);
canvas3.add(labimg4, 0, 0);
canvas3.add(labimg5, (ww1 + 10), 0);
canvas3.add(labimg6, ((ww1 * 2) + 20), 0);
}
public void imageMultiplication()
{
// Please write your code after this line
int width1, width2, height1, height2;
ColorImage labimg7 = new ColorImage();
ColorImage labimg8 = new ColorImage();
ColorImage labimg9 = labimg7.multiply(labimg8);
width1 = labimg7.getWidth();
height1 = labimg7.getHeight();
width2 = labimg8.getWidth();
height2 = labimg8.getHeight();
Canvas canvas4 = new Canvas (((3 * width1) + 20), height1);
canvas4.add(labimg7, 0, 0);
canvas4.add(labimg8, (width1 + 10), 0);
canvas4.add(labimg9, ((width1 * 2) + 20), 0);
}
public void changeColor()
{
ColorImage image = new ColorImage();
image.increaseRed(40);
Canvas canvas = new Canvas(image.getWidth(), image.getHeight());
canvas.add(image);
image.save();
}
}
3058 (Car1.java/edx.org-week3-java-intro)
Car1.java – sample object from week3 java comp102x @ edx.org
import comp102x.Canvas;
import comp102x.ColorImage;
import java.io.PrintStream;
public class Car1
{
String owner = "NoName";
ColorImage carImage = new ColorImage("c5.png");
ColorImage wImage = new ColorImage(800, 600);
int odometer = 0;
public Car1() {
Canvas canvas = new Canvas();
canvas.add(wImage);
canvas.add(carImage, 200, 200);
}
public Car1(String nameOfOwner)
{
owner = nameOfOwner;
carImage = new ColorImage();
Canvas canvas = new Canvas();
canvas.add(wImage);
canvas.add(carImage, 200, 200);
}
public void move(int dist)
{
double radian = Math.toRadians(carImage.getRotation());
double distX = dist * Math.cos(radian);
double distY = dist * Math.sin(radian);
odometer += dist;
carImage.setX(carImage.getX() + (int)distX);
carImage.setY(carImage.getY() + (int)distY);
}
public void moveCar(int dist) {
int unit = 10;
int steps = Math.abs(dist / unit);
if (dist < 0) unit = -unit;
for (int i = 0; i < steps; i++) {
move(unit);
pause(20);
}
}
public void turnCar(int rotateAngle) {
double rAngleRadian = Math.toRadians(1.0D);
double radius = carImage.getWidth() * 2.0D;
while (rotateAngle > 0) {
carImage.setRotation((int)(carImage.getRotation() + 1.0D) % 360);
double moveDist = Math.abs(2.0D * radius * Math.sin(rAngleRadian / 2.0D));
move((int)moveDist);
rotateAngle--;
pause(10);
}
}
public static void pause(int sleepTime)
{
try {
Thread.sleep(sleepTime);
} catch (InterruptedException e) {
System.err.println("Error in running rotation animation!");
System.exit(-1);
}
}
}
3056 (5 social sites)
| item | no |
|---|---|
| https://plus.google.com/discover | 1 |
| https://human-connection.org/ | 2 |
| https://ello.co/ | 3 |
| https://www.pinterest.com/ | 4 |
| https://nebenan.de/ | 5 |
quelle/source: https://perspective-daily.de/ 2018-02-02
3053 (simplest possible I/O from edx.org)
the java-I/O-class itself is not included
import comp102x.IO;
public class test10x
{
public static void main (String[] args)
{
double eingabe, ausgabe;
IO.output("bitte double:");
eingabe = IO.inputDouble();
ausgabe = eingabe;
System.out.println(ausgabe);
System.out.println("this is the end of the program");
}
}
3047 (datum_app, java, wiwi2005)
das programm besteht aus 2 klassen(application and dateobject) (eine dritte, die eingabeklasse ist nicht aufgeführt und an einer anderen stelle zu finden) und berechnet gedöns mit jahren und werktagen zwischen 1901-01-01 und 2100-12-31.
application
import java.util.*;
class datum_app {
public static void main (String[] args) {
int l = 6;
int m = 10;
int n = 1909;
int nowtag = 0;
int nowmonat = 0;
int nowjahr = 0;
int s,t,u,diff,nsumme,msumme,x,y,z,i,help,whelp,dhelp;
int wzaehler = 0;
GregorianCalendar GC = new GregorianCalendar();
System.out.println("Dieses Programm loest eine wiwi-Programmieraufgabe von 2005 (Stand: 17.12.2007), laeuft sequentiell ab und erwartet vom Benutzer einige Parameter.");
System.out.println("Zunaechst werden zwei Daten zwischen 1901-01-01 und 2100-12-31 im Format yyyy<return>mm<return>dd<return> erwartet.");
System.out.println("Es folgen einige debug-parameter der Datumsobjekte.");
System.out.println("Die zu loesenden Bedingungen werden angezeigt.");
System.out.println("Der Gregorianische Kalender wird nur zur HEUTE-Feststellung benutzt.");
System.out.println("Ein drittes Datum YYYY-MM-DD wird erwartet");
n = eingabe.readInt("Erstes Datum, Jahr:");
m = eingabe.readInt("Erstes Datum, Monat:");
l = eingabe.readInt("Erstes Datum, Tag:");
u = eingabe.readInt("Zweites Datum, Jahr:");
t = eingabe.readInt("Zweites Datum, Monat:");
s = eingabe.readInt("Zweites Datum, Tag:");
Datum ndatum = new Datum (l,m,n);
System.out.println("n");
System.out.println ("gueltig : " + ndatum.gueltig);
System.out.println (ndatum.jahr + "-" + ndatum.monat + "-" + ndatum.tag);
System.out.println (ndatum.tagesdiff);
System.out.println (ndatum.wochentag);
System.out.println ("Werktag : " + ndatum.werktag);
if (ndatum.schaltjahr) { System.out.println ("Schaltjahr"); }
else { System.out.println ("kein Schaltjahr"); }
System.out.println();
nowtag = GC.get(Calendar.DATE);
nowmonat = GC.get(Calendar.MONTH) + 1;
nowjahr = GC.get(Calendar.YEAR);
Datum heute = new Datum (nowtag, nowmonat, nowjahr);
System.out.println("und jetzt heute");
System.out.println ("gueltig : " + heute.gueltig);
System.out.println (heute.jahr + "-" + heute.monat + "-" + heute.tag);
System.out.println (heute.tagesdiff);
System.out.println (heute.wochentag);
System.out.println ("Werktag : " + heute.werktag);
if (ndatum.schaltjahr) { System.out.println ("Schaltjahr"); }
else { System.out.println ("kein Schaltjahr"); }
System.out.println();
Datum mdatum = new Datum (s,t,u);
System.out.println("m");
System.out.println ("gueltig : " + mdatum.gueltig);
System.out.println (mdatum.jahr + "-" + mdatum.monat + "-" + mdatum.tag);
System.out.println (mdatum.tagesdiff);
System.out.println (mdatum.wochentag);
System.out.println ("Werktag : " + mdatum.werktag);
if (ndatum.schaltjahr) { System.out.println ("Schaltjahr"); }
else { System.out.println ("kein Schaltjahr"); }
System.out.println();
if ((ndatum.gueltig == true) && (mdatum.gueltig == true)) {
if (ndatum.tagesdiff == mdatum.tagesdiff) help = 0;
else if (ndatum.tagesdiff < mdatum.tagesdiff) help = 1;
else help = 2;
switch (help) {
case 0 : {
System.out.println("(Punkt2)Beide Tage identisch. Differenz 0");
}
case 1 :
case 2 : {
diff = Math.abs(mdatum.tagesdiff - ndatum.tagesdiff);
System.out.println("(Punkt2)Die Differenz betraegt " + diff + " Tage");
}
default : {
break;
}
}//switch--help
}//if
else {
System.out.println ("(mindestens) eines der Daten ist ungueltig");
}
nsumme = ndatum.tagesdiff - ndatum.jahrsumme;
msumme = mdatum.tagesdiff - mdatum.jahrsumme;
System.out.println ("(Punkt 1) :");
System.out.println ("Tage seit 1. Januar " + ndatum.jahr + " (n) " + nsumme);
System.out.println ("Tage seit 1. Januar " + mdatum.jahr + " (m) " + msumme);
System.out.println ("Eingabe eines Datums in der Vergangenheit (Punkt 3)");
z = eingabe.readInt ("Jahr");
y = eingabe.readInt ("Monat");
x = eingabe.readInt ("Tag");
Datum past = new Datum (x,y,z);
if (!past.gueltig) System.out.println("Datum nicht gueltig");
else if (past.tagesdiff > heute.tagesdiff) {
System.out.println ("Datum liegt nicht in der Vergangenheit. Identische Daten hier kein Fehlerfall.");
}//if
else if (past.tagesdiff == heute.tagesdiff) {
if (heute.werktag == true) System.out.println("Daten identisch. Werktag.");
else System.out.println("Daten identisch. kein Werktag.");
}//else-if1
else if (Math.abs(past.tagesdiff - heute.tagesdiff) < 3) {
diff = (heute.tagesdiff - past.tagesdiff);
switch (diff) {
case 1 : {
if (past.werktag && heute.werktag) wzaehler = 2;
else if (past.werktag || heute.werktag) wzaehler = 1;
else wzaehler = 0;
break;
}
case 2 : {
dhelp = past.wtag;
switch (dhelp) {
case 1 :
case 2 :
case 3 :
case 4 : wzaehler = 2;
break;
case 5 : wzaehler = 1;
break;
case 6 : wzaehler = 0;
break;
case 7 : wzaehler = 1;
break;
default : break;
}//switch--dhelp
}
default : {
break;
}
}//switch--diff
}//else-if_diff3
else {
wzaehler = 1;
for (i=past.tagesdiff; i<heute.tagesdiff; i++) {
whelp = i;
Datum idate = new Datum (whelp);
if (idate.werktag) { wzaehler+=1; }
}//for
}//else
System.out.println ("Werktage von " + past.jahr + "-" + past.monat + "-" + past.tag + " bis heute (Punkt 3): " + wzaehler);
System.out.println ("Programmende. success");
}//main
}//class
objectclass
class Datum {
Boolean gueltig;
int tag;
int monat;
int jahr;
String wochentag;
Boolean werktag;
Boolean schaltjahr;
int tagesdiff;
int jahrsumme;
int wtag;
//Standard-Konstruktor
public Datum () {
gueltig = true;
tag = 6;
monat = 10;
jahr = 2012;
wochentag = "Samstag";
werktag = false;
schaltjahr = true;
tagesdiff = 40822;
}//Standard-Konstruktor
public Datum (int neuerTag, int neuerMonat, int neuesJahr) {
int i = 0;
int jahrdiff = 0;
tag = neuerTag;
monat = neuerMonat;
jahr = neuesJahr;
if ((jahr < 1901) || (jahr > 2100)) {
gueltig = false;
tag = 0;
monat = 0;
jahr = 0;
werktag = false;
schaltjahr = false;
}
else {
if ((jahr % 4) == 0) {
if ((jahr % 100) == 0) {
if ((jahr % 400) == 0) {
schaltjahr = true;
}//400
else { schaltjahr = false; }
}//100
else { schaltjahr = true; }
}//4
else { schaltjahr = false; }
switch (monat) {
case 1 :
case 3 :
case 5 :
case 7 :
case 8 :
case 10:
case 12 : {
if ((tag < 1) || (tag > 31)) {
gueltig = false;
tag = 0;
monat = 0;
jahr = 0;
}//if
else { gueltig = true; }
break;
}
case 4:
case 6 :
case 9 :
case 11 : {
if ((tag < 1) || (tag > 30)) {
gueltig = false;
tag = 0;
monat = 0;
jahr = 0;
}//if
else { gueltig = true; }
break;
}
case 2 : {
if (schaltjahr) { i = 29; }
else { i = 28; }
if ((tag < 1) || (tag > i)) {
gueltig = false;
tag = 0;
monat = 0;
jahr = 0;
}//if
else { gueltig = true; }
break;
}
default : {
gueltig = false;
break;
}
}//switch--monat
//Referenztag
if ((tag == 1) && (monat == 1) && (jahr == 1901)) { wochentag = "Dienstag"; werktag = true; tagesdiff = 1; }
else {
jahrdiff = jahr - 1901;
for (i=1901; i<jahr; i++) {
if ((i % 4) == 0) {
if ((i % 100) == 0) {
if ((i % 400) == 0) {
tagesdiff += 366;
}//400
else { tagesdiff += 365; }
}//100
else { tagesdiff += 366; }
}//4
else tagesdiff += 365;
}//for
jahrsumme = tagesdiff;
switch (monat) {
case 1 : {
tagesdiff += tag;
break;
}
case 3 : {
if (schaltjahr) {
tagesdiff += 31;
tagesdiff += 29;
tagesdiff += tag;
}
else {
tagesdiff += 31;
tagesdiff += 28;
tagesdiff += tag;
}
break;
}
case 5 : {
if (schaltjahr) {
tagesdiff += 31;
tagesdiff += 29;
tagesdiff += 31;
tagesdiff += 30;
tagesdiff += tag;
}
else {
tagesdiff += 31;
tagesdiff += 28;
tagesdiff += 31;
tagesdiff += 30;
tagesdiff += tag;
}
break;
}
case 7 : {
if (schaltjahr) {
tagesdiff += 31;
tagesdiff += 29;
tagesdiff += 31;
tagesdiff += 30;
tagesdiff += 31;
tagesdiff += 30;
tagesdiff += tag;
}
else {
tagesdiff += 31;
tagesdiff += 28;
tagesdiff += 31;
tagesdiff += 30;
tagesdiff += 31;
tagesdiff += 30;
tagesdiff += tag;
}
break;
}
case 8 : {
if (schaltjahr) {
tagesdiff += 31;
tagesdiff += 29;
tagesdiff += 31;
tagesdiff += 30;
tagesdiff += 31;
tagesdiff += 30;
tagesdiff += 31;
tagesdiff += tag;
}
else {
tagesdiff += 31;
tagesdiff += 28;
tagesdiff += 31;
tagesdiff += 30;
tagesdiff += 31;
tagesdiff += 30;
tagesdiff += 31;
tagesdiff += tag;
}
break;
}
case 10 : {
if (schaltjahr) {
tagesdiff += 31;
tagesdiff += 29;
tagesdiff += 31;
tagesdiff += 30;
tagesdiff += 31;
tagesdiff += 30;
tagesdiff += 31;
tagesdiff += 31;
tagesdiff += 30;
tagesdiff += tag;
}
else {
tagesdiff += 31;
tagesdiff += 28;
tagesdiff += 31;
tagesdiff += 30;
tagesdiff += 31;
tagesdiff += 30;
tagesdiff += 31;
tagesdiff += 31;
tagesdiff += 30;
tagesdiff += tag;
}
break;
}
case 12 : {
if (schaltjahr) {
tagesdiff += 31;
tagesdiff += 29;
tagesdiff += 31;
tagesdiff += 30;
tagesdiff += 31;
tagesdiff += 30;
tagesdiff += 31;
tagesdiff += 31;
tagesdiff += 30;
tagesdiff += 31;
tagesdiff += 30;
tagesdiff += tag;
}
else {
tagesdiff += 31;
tagesdiff += 28;
tagesdiff += 31;
tagesdiff += 30;
tagesdiff += 31;
tagesdiff += 30;
tagesdiff += 31;
tagesdiff += 31;
tagesdiff += 30;
tagesdiff += 31;
tagesdiff += 30;
tagesdiff += tag;
}
break;
}
case 4 : {
if (schaltjahr) {
tagesdiff += 31;
tagesdiff += 29;
tagesdiff += 31;
tagesdiff += tag;
}
else {
tagesdiff += 31;
tagesdiff += 28;
tagesdiff += 31;
tagesdiff += tag;
}
break;
}
case 6 : {
if (schaltjahr) {
tagesdiff += 31;
tagesdiff += 29;
tagesdiff += 31;
tagesdiff += 30;
tagesdiff += 31;
tagesdiff += tag;
}
else {
tagesdiff += 31;
tagesdiff += 28;
tagesdiff += 31;
tagesdiff += 30;
tagesdiff += 31;
tagesdiff += tag;
}
break;
}
case 9 : {
if (schaltjahr) {
tagesdiff += 31;
tagesdiff += 29;
tagesdiff += 31;
tagesdiff += 30;
tagesdiff += 31;
tagesdiff += 30;
tagesdiff += 31;
tagesdiff += 31;
tagesdiff += tag;
}
else {
tagesdiff += 31;
tagesdiff += 28;
tagesdiff += 31;
tagesdiff += 30;
tagesdiff += 31;
tagesdiff += 30;
tagesdiff += 31;
tagesdiff += 31;
tagesdiff += tag;
}
break;
}
case 11 : {
if (schaltjahr) {
tagesdiff += 31;
tagesdiff += 29;
tagesdiff += 31;
tagesdiff += 30;
tagesdiff += 31;
tagesdiff += 30;
tagesdiff += 31;
tagesdiff += 31;
tagesdiff += 30;
tagesdiff += 31;
tagesdiff += tag;
}
else {
tagesdiff += 31;
tagesdiff += 28;
tagesdiff += 31;
tagesdiff += 30;
tagesdiff += 31;
tagesdiff += 30;
tagesdiff += 31;
tagesdiff += 31;
tagesdiff += 30;
tagesdiff += 31;
tagesdiff += tag;
}
break;
}
case 2 : {
tagesdiff += 31;
tagesdiff += tag;
}
default : {
break;
}
}//switch--monat
i = tagesdiff % 7;
switch (i) {
case 0 : {
wochentag = "Montag";
wtag = 1;
break;
}
case 1 : {
wochentag = "Dienstag";
wtag = 2;
break;
}
case 2 : {
wochentag = "Mittwoch";
wtag = 3;
break;
}
case 3 : {
wochentag = "Donnerstag";
wtag = 4;
break;
}
case 4: {
wochentag = "Freitag";
wtag = 5;
break;
}
case 5 : {
wochentag = "Samstag";
wtag = 6;
break;
}
case 6 : {
wochentag = "Sonntag";
wtag = 7;
break;
}
default : {
wtag = -1;
break;
}
}//switch--i
switch (wtag) {
case 1 :
case 2 :
case 3 :
case 4 :
case 5 : {
werktag = true;
break;
}
case 6 :
case 7 : {
werktag = false;
break;
}
default : {
break;
}
}//switch--wtag
}//Referenztag-else
}//gueltiger Bereich
}//Konstruktor
public Datum (int tageszaehler) {
int i = 0;
if ((tageszaehler < 1) || (tageszaehler > 73049)) {
gueltig = false;
}
else {
i = tageszaehler % 7;
switch (i) {
case 0 : {
wtag = 2;
wochentag = "Dienstag";
werktag = true;
break;
}
case 1 : {
wtag = 3;
wochentag = "Mittwoch";
werktag = true;
break;
}
case 2 : {
wtag = 4;
wochentag = "Donnerstag";
werktag = true;
break;
}
case 3 : {
wtag = 5;
wochentag = "Freitag";
werktag = true;
break;
}
case 4 : {
wtag = 6;
wochentag = "Samstag";
werktag = false;
break;
}
case 5 : {
wtag = 7;
wochentag = "Sonntag";
werktag = false;
break;
}
case 6 : {
wtag = 1;
wochentag = "Montag";
werktag = true;
break;
}
default : {
break;
}
}//switch--i
}//gueltig
}//Konstruktor2
}//class Datum
3045 (2017)
| sum | average | |
|---|---|---|
| in | ||
| out |
hier ist ein betriebswirtschaftlicher fehler drin, der in der originaldatei inzwischen behoben wurde…
