Computer-Ag am WvS Blog der Computer-AG am Werner von Siemens Gymnasium Berlin

29. April 2015

29.4.2015

Morten und Angelo sind da. Wir sprechen über Nehrungskurisch. Frau Spyra kommt auch kurz vorbei und redet über den Schulfilter und die Probleme und das schwarze Brett. Die Aktualisierung von WordPress bleibt hängen.

Angelo muss einen WLAN-Treiber für Plan9 schreiben.

Robert versucht, seinen Server über Plesk upzugraden.

Moritz kommt auch. Johannes schreibt, er käme später. Angelo könnte jede zweite Woche am Mittwoch. Julian ist auch da.

Robert hat seinen virtuellen Server geupdatet, via Plesk, u.a. auch von Plesk 11.5… zu 12….

WordPress 4.2.1 wäre übrigens auch über die Plesk-Oberfläche installierbar …; wäre ja mal eine Idee.

Johannes ist auch da.

 

 

27. März 2015

27.3.2015

Morten, Angelo und Moritz sind da. Wir hatte Probleme mit dem Lernserver. Anscheinend werden nur bestimmte IP-Adressen ins Internet gelassen. Nach ewigem Hin- und Her hat der Lernserver jetzt mal die 10.16.205.153 auf eth0 erhalten. Die Verbindung über das Kabel zu eth1 (10.123.123.1) brach immer wieder ab. Angelo vermutet, dass irgendein DHCP dazwischen funkte. Mit 10.16.205.255 zB. kommt man überhaupt nicht ins Netz. Nichtmal Ping funktioniert, auflösen ließ sich aber eine Domain (google.de zB.). Nach manuellem Setzen der IP war noch „route add default gw 10.16.1.1“ nötig.

Am Ende sind sie alle im Internet. Aber https funktioniert wohl nicht mehr ohne workarround.

Nächste Mal dann nach Ostern! Frohe Ostern!!!

20. März 2015

20.3.2015

Letzten Freitag haben wir geholfen, dass digitale Schwarze Brett im Foyer ans WLAN zu bekommen und mit Teamviewer zu administrieren. Hat schlussendlich unter Beteiligung von allen (Angelo, Morten, Julian, Johannes, Moritz) geklappt, Frau Spyra und Hr. Dr. Rehnert dabei zu unterstützen. Da es immer Teamviewer-„Werbung“ auf dem digitalen schwarzen Brett gibt, schlägt Morten Hamachi vor.

Heute war partielle Sonnenfinsternis. Angelo hat jetzt eine FritzBox 7490. Robert hat nur die 7362.

Wir gucken uns Herr Kobins Kochbuch an. Pizzaessen ist dann Mittwoch um 14:00 bei Angelo. Das ist der 25.3.. Wir sind jetzt erstmal sechs, vielleicht noch Johannes. Paul ist da und kann da vermutlich nicht, weil er in Genf ist.

Morten und Angelo sprechen über die benötigten Pizzamengen. Angelo hilft Robert seine Laptoptastatur zu reparieren und auf Xubuntu zu aktualisieren bzw. das zu installieren.

 

6. März 2015

6.3.2015

Filed under: Allgemein,App,Assembler,Lernserver,Tagesberichte,Termine,Tisch — admin @ 15:52

Johannes war schon da. Angelo ist auch da. Ab nächste Woche machen wir nur noch freitags. Tsocks war übrigens das Programm, dass Angelo gesucht hatte. Das hatten wir schon mal auf dem Lernserver installiert.

Für Tunneln mit SSH gibt es auch MyEn-Tunnel.

Mit „ssh-keygen -t rsa“ ein Paar public-private-SSH-Key hergestellt. Den Public-Key bei bitbucket eingestellt und die .git/config entsprechend geändert (statt https auf git@bitbucket.org:<username>/<projectname>.git.

Robert hat seine App mit einem Icon versehen. Angelo versteht mehr vom Unix-Assembler für PDP11. Er überlegt noch, für welche Architektur er seinen Assembler schreiben soll.

Johannes meinte, er hätte lange nicht mehr 2048 gespielt. Robert erinnert sich, dass er das mal mit Javascript programmiert hatte.

Nächste Woche Mittwoch nicht, dafür Freitag.

 

4. März 2015

4.3.2015

Noch ist keiner da. Angelo ist da. Er hat letzte Woche seinen Vortrag gehalten. Bei AFRA.

Morten ist auch da. Es geht ihm gut. Er ist in den Regen gekommen.

Angelo will auf einer VAX Plan9 laufen lassen. Oder was mit APL machen. Aber es gibt nichts so richtiges, OpenAPL ließ sich auf BSD auf die Schnelle nicht kompilieren. GNU-APL wäre noch eine Variante.

Robert hat es geschafft, seinen Tracker in einer minimalistischen Basisversion zum Laufen zu bekommen. Javascript (Jquery) ist direkt eingebunden.

Linus Torvalds soll übrigens git erfunden haben und lebt im Silicon Valley, welches bei San Francisco liegt, nicht bei Los Angeles.

Robert will dieses Javascript nochmal überarbeiten. Angelo denkt, einen Assembler für eine der Plattformen zu schreiben. Morten findet das „ü“ für sein Blackberry. Angelo hat (bereits zu Hause) sein „k“ repariert. Nächster Termin am Freitag. Evtl. lassen wir es für die nächsten Wochen mal bei dem Freitagtermin. Morten aber kann diesen Freitag nicht.

 

27. Februar 2015

27.2.2015

Angelo hält heute einen Vortrag bei der AFRA. Julian und Moritz sind auch hier. Morten kann heute nicht. Johannes hat bestimmt Uni.

Angelo bereitet seine Vortrag etwas weiter vor. Er beschäftigt sich, wie er durch das geblockte Netzwerk an seine Plan9-Sachen zu Hause kommt. Mit ssh-Tunnel.

Johannes kommt.

Robert hat eine index.html zu seinem Tracker hinzugefügt und ihn in sein Tracker-Repository bei Bitbucket gepusht. Phonegap mault: „This app isn’t using the latest version of PhoneGap. We recommend upgrading to 3.6.3. “

Also alles neu gemacht:

sudo npm install -g cordova

rob@lernserver:~$ cordova create tracker_cordova com.example.tracker MyTracker
Creating a new cordova project with name "MyTracker" and id "com.example.tracker" at location "/home/rob/tracker_cordova"
Downloading cordova library for www...
Download complete

git init

git remote add origin https://frankxy@bitbucket.org/frankxy/tracker_cordova.git

git add -A
git status
git commit -m "erster commit"
git push -u origin master

Interface in C++  für Sockets haben Moritz und Julian gemacht. Johannes wollte Hausaufgaben machen.

Angelo wollte irgendwann Pizza machen.

18. Februar 2015

18.2.2015

Angelo, Moritz, Morten und Julian sind da. Johannes kann nicht. Angelo arbeitet am Gras vom PC-GTA.

Robert recherchiert mal wieder wegen App-Entwicklung. Dazu findet sich ein Selfhtml-Thread. Bei der Hamburger Appwerft gibt es einen Artikel zu Phonegap vs. Titanium. Smasshingmagazine hat auch einen Artikel dazu vom März 2014. U.a. hat Titanium Appcelerator das „look and feel“ einer nativen App. Infoworld vergleicht 5 App-Entwicklungs-Umgebungen (sog. MBaas: AnyPresence, Appcelerator, FeedHenry, Kinvey, und Parse). Cordovablogs hat auch einen Beitrag, in dem auch Xamarin erwähnt ist. Die Diskussion geht dann bei Stackoverflow weiter.

Das Thema Websockets kommt dann wieder auf, und auch, dass es das bei Plan9 nicht gibt.

Auf App-Entwicklung gibt es noch einen spezifischen Beitrag zu den Hürden in PhoneGap.

Xamarin ist gemäß Heiseartikel sperrig und teuer.

Angelo ist von seinem Gras genervt und sein Rasterisierer funktioniert auch nicht richtig.

Nächsten Freitag findet statt.

 

 

13. Februar 2015

13.2.2015

Heute sind Morten und Angelo da, immerhin. Wir reden über die Evangelien, Thomas, Judas und das 1. Konzil in Nicaea.

Wir besprechen noch diese Codezeile bzw. die Zeile in der Funktion:

void
drawPixel(int x, int y, Color c)
{
    *( (Uint32*) ( (char*) screen->pixels + x*screen->format->BytesPerPixel + y*screen->pitch ) ) = SDL_MapRGB(screen->format, c.r, c.g, c.b);
}

In der Funktion müsste man eigentlich noch x testen, dass es nicht größer als die maximale Breite ist. Zu deutsch also:

an die Adresse [*] schreibe vier Bytes (gecastet nach (Uint32*)) eines Pointers auf einen Character (char*), nämlich den Pointer screen->pixels plus x Mal die Länge eines Pixels in Bytes plus y Mal die Zeilenlänge. Ob das so stimmt?

Wir rätseln, wann die anderen mal wieder kommen …;

 

 

 

23. Januar 2015

23.1.2015

Morten, Johannes und Angelo sind da. Der Code wird perfektioniert:

 

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <SDL/SDL.h>

typedef struct _Color Color;
struct _Color 
{
    unsigned char r, g, b;
};

typedef struct _Point Point;
struct _Point
{
    int x, y;
};

SDL_Surface *screen;

void
drawPixel(int x, int y, Color c)
{
    *((Uint32*)((char*)screen->pixels + x*screen->format->BytesPerPixel + y*screen->pitch)) = SDL_MapRGB(screen->format, c.r, c.g, c.b);
}

void
drawLine(Point p1, Point p2, Color c)
{
    int dx, dy;
    int incx, incy;
    float m;
    dx = p2.x - p1.x;
    dy = p2.y - p1.y;
    incx = dx>0 ? 1 : -1;
    incy = dy>0 ? 1 : -1;
    if(dx == 0){
        int y;
        for(y = p1.y; y != p2.y; y += incy)
            drawPixel(p1.x, y, c);
        return;
    }

    if(abs(dx)>abs(dy)){
        int x;
        float y;
        m = (float)dy/(float)abs(dx);
        y = p1.y;
        for(x = p1.x; x != p2.x; x += incx){
            drawPixel(x, y+0.5f, c);
            y += m;
        }
    }else{
        int y;
        float x;
        m = (float)dx/(float)abs(dy);
        x = p1.x;
        for(y = p1.y; y != p2.y; y += incy){
            drawPixel(x+0.5f, y, c);
            x += m;
        }
    }
}

void
drawTriWire(Point p1, Point p2, Point p3, Color c)
{
    drawLine(p1, p2, c);
    drawLine(p2, p3, c);
    drawLine(p3, p1, c);
}

void
drawHorizontalLine(int y, float x1f, float x2f, Color c) {
    int x1, x2, tmp;
    x1 = (x1f == (int)x1f) ? x1f : x1f+1;
    x2 = (x2f == (int)x2f) ? x2f : x2f+1;
    if(x1 > x2){
        tmp = x1;
        x1 = x2;
        x2 = tmp;
    }
    while(x1 < x2)
        drawPixel(x1++, y, c);
}

void
//~ sortPoints(Point **p) ident mit zeile drunter, for educational purpose only 
sortPoints(Point *p[])
{
#define SWAPPOINT(p,q) { \
        tmp = p;      \
        p = q;     \
        q = tmp;      \
    }
    Point *tmp;
    if(p[0]->y > p[1]->y) 
        SWAPPOINT(p[0], p[1]);
    if(p[0]->y > p[2]->y)
        SWAPPOINT(p[0], p[2]);
    if(p[1]->y > p[2]->y) 
        SWAPPOINT(p[1], p[2]);
#undef SWAPPOINT
}

void
drawTriFlat(Point p1, Point p2, Point p3, Color c)
{
    float dx[3];
    int y;
    float x1, x2;
    Point *p[] = {&p1, &p2, &p3};
    sortPoints(p);
#define D(p,q) (q->y - p->y == 0 ? 0.0f : (float) (q->x - p->x) / (q->y - p->y))
    //~ dx[0] = (float) (p[2]->x - p[0]->x) / (p[2]->y - p[0]->y);
    dx[0] = D(p[0], p[2]);
    dx[1] = D(p[0], p[1]);
    dx[2] = D(p[1], p[2]);
#undef D
    y = p[0]->y;
    x1 = x2 = p[0]->x;
    while(y < p[1]->y){
        drawHorizontalLine(y, x1, x2, c);
        y++;
        x1 += dx[0];
        x2 += dx[1];
    }
    x2 = p[1]->x;
    while(y < p[2]->y){
        drawHorizontalLine(y, x1, x2, c);
        y++;
        x1 += dx[0];
        x2 += dx[2];
    }
}



void
drawRect(Point p1, Point p2, Color rgb)
{
    int i, j;
       for(i = p1.x; i < p2.x; i++)
        for(j = p1.y; j < p2.y; j++)
            drawPixel(i, j, rgb);
}

void
draw(void)
{
    drawRect((Point){40,140}, (Point){50,150}, (Color) {255, 0, 255});
    drawRect((Point){80,140}, (Point){90,150}, (Color) {255, 0, 255});
    drawRect((Point){62,160}, (Point){68,180}, (Color) {10, 123, 233});
    drawRect((Point){40,195}, (Point){90,200}, (Color) {123, 233, 10});
    
//    drawLine((Point){0, 0}, (Point){50, 30});
//    drawLine((Point){0, 0}, (Point){30, 50});
//    drawLine((Point){50, 0}, (Point){50, 50});
        drawTriFlat((Point){30,120}, (Point){100, 120}, (Point){65, 100}, (Color){25, 85, 155});
}

int
main(void)
{
    int running = 1;
    int w = 640;
    int h = 480;
    SDL_Event event;

    SDL_Init(SDL_INIT_VIDEO);

    screen = SDL_SetVideoMode(w, h, 32, SDL_HWSURFACE);

    while(running){
        while(SDL_PollEvent(&event))
            if(event.type == SDL_QUIT)
                running = 0;
        SDL_LockSurface(screen);
        draw();
        SDL_UnlockSurface(screen);
        SDL_UpdateRect(screen, 0, 0, 0, 0);
    }

    SDL_Quit();
    return 0;
}

bringt:

 

test3

 

Angelo will keine Kreise machen.

#include 
#include 
#include 
#include <SDL/SDL.h>
#include 
typedef struct _Color Color;
struct _Color 
{
    unsigned char r, g, b;
};

typedef struct _Point Point;
struct _Point
{
    int x, y;
};

SDL_Surface *screen;

void
drawPixel(int x, int y, Color c)
{
    *((Uint32*)((char*)screen->pixels + x*screen->format->BytesPerPixel + y*screen->pitch)) = SDL_MapRGB(screen->format, c.r, c.g, c.b);
}

void
drawLine(Point p1, Point p2, Color c)
{
    int dx, dy;
    int incx, incy;
    float m;
    dx = p2.x - p1.x;
    dy = p2.y - p1.y;
    incx = dx>0 ? 1 : -1;
    incy = dy>0 ? 1 : -1;
    if(dx == 0){
        int y;
        for(y = p1.y; y != p2.y; y += incy)
            drawPixel(p1.x, y, c);
        return;
    }

    if(abs(dx)>abs(dy)){
        int x;
        float y;
        m = (float)dy/(float)abs(dx);
        y = p1.y;
        for(x = p1.x; x != p2.x; x += incx){
            drawPixel(x, y+0.5f, c);
            y += m;
        }
    }else{
        int y;
        float x;
        m = (float)dx/(float)abs(dy);
        x = p1.x;
        for(y = p1.y; y != p2.y; y += incy){
            drawPixel(x+0.5f, y, c);
            x += m;
        }
    }
}

void
drawTriWire(Point p1, Point p2, Point p3, Color c)
{
    drawLine(p1, p2, c);
    drawLine(p2, p3, c);
    drawLine(p3, p1, c);
}

void
drawHorizontalLine(int y, float x1f, float x2f, Color c) {
    int x1, x2, tmp;
    x1 = (x1f == (int)x1f) ? x1f : x1f+1;
    x2 = (x2f == (int)x2f) ? x2f : x2f+1;
    if(x1 > x2){
        tmp = x1;
        x1 = x2;
        x2 = tmp;
    }
    while(x1 < x2)         drawPixel(x1++, y, c); } void //~ sortPoints(Point **p) ident mit zeile drunter, for educational purpose only  sortPoints(Point *p[]) { #define SWAPPOINT(p,q) { \         tmp = p;      \         p = q;     \         q = tmp;      \     }     Point *tmp;     if(p[0]->y > p[1]->y) 
        SWAPPOINT(p[0], p[1]);
    if(p[0]->y > p[2]->y)
        SWAPPOINT(p[0], p[2]);
    if(p[1]->y > p[2]->y) 
        SWAPPOINT(p[1], p[2]);
#undef SWAPPOINT
}

void
drawTriFlat(Point p1, Point p2, Point p3, Color c)
{
    float dx[3];
    int y;
    float x1, x2;
    Point *p[] = {&p1, &p2, &p3};
    sortPoints(p);
#define D(p,q) (q->y - p->y == 0 ? 0.0f : (float) (q->x - p->x) / (q->y - p->y))
    //~ dx[0] = (float) (p[2]->x - p[0]->x) / (p[2]->y - p[0]->y);
    dx[0] = D(p[0], p[2]);
    dx[1] = D(p[0], p[1]);
    dx[2] = D(p[1], p[2]);
#undef D
    y = p[0]->y;
    x1 = x2 = p[0]->x;
    while(y < p[1]->y){
        drawHorizontalLine(y, x1, x2, c);
        y++;
        x1 += dx[0];
        x2 += dx[1];
    }
    x2 = p[1]->x;
    while(y < p[2]->y){
        drawHorizontalLine(y, x1, x2, c);
        y++;
        x1 += dx[0];
        x2 += dx[2];
    }
}



void
drawRect(Point p1, Point p2, Color rgb)
{
    int i, j;
   	for(i = p1.x; i < p2.x; i++)
		for(j = p1.y; j < p2.y; j++)
			drawPixel(i, j, rgb);
}

void 
drawCircle(Point center, int radius, Color c) {
    Point p;
    int x;
    int y;
    for(x = 0; x < radius; x++){
        y = sqrt(radius*radius - x*x);
        drawLine((Point) {center.x + x, center.y + y}, (Point) {center.x + x, center.y - y}, c); 
        drawLine((Point) {center.x - x, center.y + y}, (Point) {center.x - x, center.y - y}, c); 
    }

}

void
draw(void)
{
    drawCircle((Point){65, 170}, 45, (Color) {128, 128, 0});
    drawRect((Point){40,140}, (Point){50,150}, (Color) {255, 0, 255});
    drawRect((Point){80,140}, (Point){90,150}, (Color) {255, 0, 255});
    drawRect((Point){62,160}, (Point){68,180}, (Color) {10, 123, 233});
    drawRect((Point){40,195}, (Point){90,200}, (Color) {123, 233, 10});
    
//    drawLine((Point){0, 0}, (Point){50, 30});
//    drawLine((Point){0, 0}, (Point){30, 50});
//    drawLine((Point){50, 0}, (Point){50, 50});
        drawTriFlat((Point){30,120}, (Point){100, 120}, (Point){65, 100}, (Color){25, 85, 155});
}

int
main(void)
{
	int running = 1;
	int w = 640;
	int h = 480;
	SDL_Event event;

	SDL_Init(SDL_INIT_VIDEO);

	screen = SDL_SetVideoMode(w, h, 32, SDL_HWSURFACE);

	while(running){
		while(SDL_PollEvent(&event))
			if(event.type == SDL_QUIT)
				running = 0;
		SDL_LockSurface(screen);
		draw();
		SDL_UnlockSurface(screen);
		SDL_UpdateRect(screen, 0, 0, 0, 0);
	}

	SDL_Quit();
	return 0;
}

chinese

Nächste Woche ist nicht.

 

Angelo orientiert sich nach dem GS UsersManual für die PS2.

21. Januar 2015

21.1.2015

Morten ist da. Wir reden über Windows ultimate. Und Ableton.

Jetzt sieht der Code so aus:

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <SDL/SDL.h>

typedef struct _Color Color;
struct _Color 
{
    unsigned char r, g, b;
};

typedef struct _Point Point;
struct _Point
{
    int x, y;
};

SDL_Surface *screen;

void
drawPixel(int x, int y, Color c)
{
    *((Uint32*)((char*)screen->pixels + x*screen->format->BytesPerPixel + y*screen->pitch)) = SDL_MapRGB(screen->format, c.r, c.g, c.b);
}

void
drawLine(Point p1, Point p2, Color c)
{
    int dx, dy;
    int incx, incy;
    float m;
    dx = p2.x - p1.x;
    dy = p2.y - p1.y;
    incx = dx>0 ? 1 : -1;
    incy = dy>0 ? 1 : -1;
    if(dx == 0){
        int y;
        for(y = p1.y; y != p2.y; y += incy)
            drawPixel(p1.x, y, c);
        return;
    }

    if(abs(dx)>abs(dy)){
        int x;
        float y;
        m = (float)dy/(float)abs(dx);
        y = p1.y;
        for(x = p1.x; x != p2.x; x += incx){
            drawPixel(x, y+0.5f, c);
            y += m;
        }
    }else{
        int y;
        float x;
        m = (float)dx/(float)abs(dy);
        x = p1.x;
        for(y = p1.y; y != p2.y; y += incy){
            drawPixel(x+0.5f, y, c);
            x += m;
        }
    }
}

void
drawTriWire(Point p1, Point p2, Point p3, Color c)
{
    drawLine(p1, p2, c);
    drawLine(p2, p3, c);
    drawLine(p3, p1, c);
}

void
drawRect(Point p1, Point p2, Color rgb)
{
    int i, j;
       for(i = p1.x; i < p2.x; i++)
        for(j = p1.y; j < p2.y; j++)
            drawPixel(i, j, rgb);
}

void
draw(void)
{
    drawRect((Point){40,40}, (Point){50,50}, (Color) {255, 0, 255});
    drawRect((Point){80,40}, (Point){90,50}, (Color) {255, 0, 255});
    drawRect((Point){62,60}, (Point){68,80}, (Color) {10, 123, 233});
    drawRect((Point){40,95}, (Point){90,100}, (Color) {123, 233, 10});
    
//    drawLine((Point){0, 0}, (Point){50, 30});
//    drawLine((Point){0, 0}, (Point){30, 50});
//    drawLine((Point){50, 0}, (Point){50, 50});
        drawTriWire((Point){10,10}, (Point){100, 70}, (Point){30, 150}, (Color){255, 255, 255});
}

int
main(void)
{
    int running = 1;
    int w = 640;
    int h = 480;
    SDL_Event event;

    SDL_Init(SDL_INIT_VIDEO);

    screen = SDL_SetVideoMode(w, h, 32, SDL_HWSURFACE);

    while(running){
        while(SDL_PollEvent(&event))
            if(event.type == SDL_QUIT)
                running = 0;
        SDL_LockSurface(screen);
        draw();
        SDL_UnlockSurface(screen);
        SDL_UpdateRect(screen, 0, 0, 0, 0);
    }

    SDL_Quit();
    return 0;
}

 

Und das Resutlat so:

 

 

c2

Nächste Mal dann Ausfüllen von Dreiecken, 3D-Rotation und Kreise …;

Morten bastelt daran rum, wie ein Spiel unter Windows startet …;

Diesen Freitag ist noch einmal, dann zwei Wochen Pause.

 

« Newer PostsOlder Posts »