ZHAW

Struktur von HTML

Block- vs. Inline Elemente

Beispiel: Ein inline Zitat

Ein block Zitat
beides unterscheidet sich durch den Style und Textfluss

Block ElementInline Element
BedeutungSind sturgebende, grossen Bausteine, die einen Umbruch erzeugen.Sind eher inhaltlich relevante Bausteine, die keinen Umbruch erzeugen.
Beispieleh1..h6 - Ueberschriften
div - Container
blockquote - Ein Zitat
img - Bilder
a - Anchor (Link)
q - Ein Zitat

Die strukturgebenden Elemente im HTML

  • Nutze <div>, um logische Block Elemente zu kapseln
  • Nutze <span>, um logische Inline Elemente zu kapseln
  • Nutze id und class, um diese Blöcke gleich zu stylen
  • Nutze width Attribut, um Breite der Elemente anzugeben
  • Nutze height Attribut, um Höhe der Elemente anzugeben
  • Beide nur für Inhalt der Elemente, ohne Padding und Border

Sonderzeichen

Hier eine <ol> (ordered list) mit Sonderzeichen.

  1. &amp; - &
  2. &gt; - >
  3. &lt; - <
  4. &auml; - ä
  5. &uuml; - ü
  6. &ouml; - ö

Verschiedene Tags

Hier eine <ul> mit verschiedenen Tags

  • hr/ - horizontale Linie
    [Block Element]
  • code - Sourcecode [Inline Element]
  • pre -
    Textblock mit monotyper Schrift 
    [Block Element]
  • strong - starke Betonung (meist fetter Text) [Inline Element]
  • em - leichte Betonung (meist kursiver text) [Inline Element]

Oder auch mal ein Bild WoooW das Wiki Bild zu HTML! (hier sogar ein Bild mit Link Ein weiteres brutal von Wikipedia gestolenes Bild)!

CSS

Übersicht über das CSS (Cascading style sheet) zugrunde liegende Box-Model

Quelle: http://www.w3schools.com/css/css_boxmodel.asp!

Die Kaskade

  1. Treffen Selektoren direkt auf das Element zu?
  2. Treffen Selektoren auf die oberliegenden Elemente zu?
  3. Nutze Voreinstellungen des Browsers

Bei Konflikten gewinnt die Regel mit der höheren Präzision. Wenn die Präzisionen gleich sind, gewinnt die Regel, die im File weiter unten definiert ist.

Ablauf

Schritt 1: Hole alle Stylesheets (Autor, Benutzer, Browser)
Schritt 2: Finde Regeln, welche passen
Schritt 3: Sortiere Treffer aufsteigend nach Autor, Benutzer, Browser
Schritt 4: Sortiere Treffer nach Präzision
Schritt 5: Sortiere Treffer mit Konflikten nach Auftrittzeitpunkt

Präzision

  1. Wenn das Element Inline Styling hat, dann gewinnt dieses
  2. Für jede ID, addiere 0,1,0,0 Punkte
  3. Für jede Klasse, Pseudo-Klasse oder Attribut, addiere 0,0,1,0 Punkte
  4. Für jede Referenz auf ein Element, addiere 0,0,0,1 Punkte

Der !important Wert an einem CSS Attribut übersteuert alle Regeln

Eselsbrücke für Geodäten

Windrose (Nord Ost Süd West) = Nicht Ohne Seife Waschen

Pseudo Klassen

Stati wie die in Links heissen in CSS Speak Pseudo Klasse

Project for for the Zurich university of applied sciences course in web programing.

A simple todo-list using JavaScript, HTML5 Application Cache and Twitter Bootstrap

Ungültige Eingabe!

zu erledigen

Priorität per Beschreibung

erledigt

Priorität per Beschreibung

Turing machine

This is a project for the Zurich university of applied sciences course 'Computer Science II'

It provides a simple graphical implementation of a multi band TM for Multiplication and Fractorial (using the Multiplication TM). Since the course is held in German all labels are german, too. Sorry for the inconvenience.

Example:

In the initial screen of the application you can select "Machine in action" and afterwards "Multiplizuieren" for multiplication or "Fakultät" for fractorial.

alt text

After selecting one of these options you have to provide the input (two numbers that shall be multiplied or one number for that the fractorial should be calculated)

alt text

The computation can either be run step by step (using "Nächster Schritt" for each step) or automaticly (after selecting "Automatisch"). A automatic computation can be paused using "Stop". To select the speed of the automatic computation use "Machine in action" and choose timeout afterwards. The Timeout is given in milliseconds between each step of the TM.

While the computation is running you can view the state of the turing machine in a state diagram.

alt text

You can also look at the different bands and the movement of the heads (green if the head went to the right or orange if it went to the left)

alt text

As soon as the computation is finished you can see the result as well as the number of steps taken in the top of the GUI.

Results:

With GUI:
0!: Result: 1       Steps: 1             Elapsed time:   < 1 Second
1!: Result: 1       Steps: 6             Elapsed time:   < 1 Second
2!: Result: 2       Steps: 44            Elapsed time:   < 1 Second
3!: Result: 6       Steps: 185           Elapsed time:   < 1 Second
4!: Result: 24      Steps: 1'276         Elapsed time:   < 1 Second
5!: Result: 120     Steps: 21'021        Elapsed time:   < 1 Second
6!: Result: 720     Steps: 678'668       Elapsed time:   < 1 Second
7!: Result: 5040    Steps: 32'610'385    Elapsed time:     4 Seconds
8!: Result: 40320   Steps: 2'081'079'132 Elapsed time:   291 Seconds

Without Without:
0!: Result: 1       Steps: 1             Elapsed time:   < 1 Second
1!: Result: 1       Steps: 6             Elapsed time:   < 1 Second
2!: Result: 2       Steps: 44            Elapsed time:   < 1 Second
3!: Result: 6       Steps: 185           Elapsed time:   < 1 Second
4!: Result: 24      Steps: 1'276         Elapsed time:   < 1 Second
5!: Result: 120     Steps: 21'021        Elapsed time:   < 1 Second
6!: Result: 720     Steps: 678'668       Elapsed time:   < 1 Second
7!: Result: 5040    Steps: 32'610'385    Elapsed time:     1 Second
8!: Result: 40320   Steps: 2'081'079'132 Elapsed time:   121 Seconds
9!: Result: 362880  Steps: 1'002'179'117 Elapsed time: 20645 Seconds (5h 41m 5s)

Please note that the number of steps in the computation of 9! is obviously wrong. Most likely there is an integer overflow in the counter.

License:

This project is free software: You can redistribute it and/or modify it under the terms of the European Union Public Licence (EUPL v.1.1) or – as soon they will be approved by the European Commission - subsequent versions of the EUPL (the "Licence"); You may not use this work except in compliance with the Licence.

The project is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Licence for the specific language governing permissions and limitations under the Licence.

PocketPC

This is a project for the Zurich university of applied sciences course 'Computer Science III'

It provides a simple (graphical) implementation of general purpose computer that can parse a given assembler code. Since the course is held in German all labels are german, too. Sorry for the inconvenience.

Functionality:

A file with ASM code as well as the input data has to be provided. The input is assumed to be located at word 500 of the virtual RAM. The commands will be read into the virtual RAM beginning at wort 500.

While processing the ASM the following values are displayed:

  • Program counter
  • Current command (+ / - 10 next commands)
  • Akkumulator
  • Register 1 - 3
  • Carrr-Bit
  • Content of the filled virtual RAM from word 500 on

All registers are 16 bit long and beeing displayed binary and as decimal value.

The processing of the ASM can happen in 3 modes:

  • STEP: Every command has to be processed with an individual click.
  • SLOW: The commands are beeing processed automaticly (can be paused).
  • FAST: No output of the registers etc. until the computation is terminated.

Usage:

You can provide a parameter nogui for GUI or Commandline interface. The default is false (Application is started with GUI). If started without GUI the following parameters should be provided:

  • asm = Asembler file to parse
  • BLOCKS_PER_LINE = Number of ASM commands displayed per line (default = 5)
  • mode = One of the three modes described above

Example:

Without GUI:

Sample call:

java -Dmode=STEP -Dasm=asmfiles/multiplication.asm -Dnogui=true -DBLOCKS_PER_LINE=5 -jar PocketPC-0.1-SNAPSHOT-jar-with-dependencies.jar 

The current step beeing displayed on the command line (to run the next Step in STEP mode just press Enter).

alt text

With GUI:

In the initial screen of the GUI application you can select "Optonen" and afterwards "Datei laden" to load a file in the format described above. Running the GUI you may select:

  • "Nächster Schritt" for the computation of the next ASM command
  • "Langsam" for the automatic computation in SLOW mode
  • "Schnell" for the automatic computation in FAST mode
  • "Pause" to pause a computation in SLOW mode
  • "Stop" to cancel a computation

alt text

Selecting the "Alle Befehle" tab you can edit the ASM and memory to see what happens in other configurations.

alt text

If you like the new version of the code you may also store this file by selecting "Optionen" and then "Datei speichern"

License:

This project is free software: You can redistribute it and/or modify it under the terms of the European Union Public Licence (EUPL v.1.1) or – as soon they will be approved by the European Commission - subsequent versions of the EUPL (the "Licence"); You may not use this work except in compliance with the Licence.

The project is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Licence for the specific language governing permissions and limitations under the Licence.

Seminar Concurrent C programming

Term paper for the Zurich university of applied sciences seminar in Concurrent C programming.

Implementation of a virtual (in memory) Fileserver that can be accessed via TCP/IP and supports the following commands:

  • CREATE
  • READ
  • UPDATE
  • DELETE
  • LIST

The implementation is optimized for concurrent multi client interaction. A client is also provided.

Make

The following make targets exist:

  • all: creates the most relevant binaries of the term paper: run and test
  • run: creates only the server: run
  • test: creates only the module test binary: test
  • client: creates an interactive client for manual tests of the server: client

Usage

Server

The run binary is the server for the application.

$ ./ run -h
Help: 

Usage:
./run  [-p Port] [-d Out] [-i Out] [-e Out]

Server for the term paper in concurrent C programming
Will start a virtual file server that accepts connections via
TCP

[-p Port] Optional: Tries to connect to a server on the given port.
           Default: 7000

[-d Loglevel] Optional: Alter the output for DEBUG messages.
               Default: No logging

[-i Loglevel] Optional: Alter the output for INFO messages.
               Default: stdout

[-i Loglevel] Optional: Alter the output for ERROR messages.
               Default: stderr 

 Possible log Outputs: 0 = No logging
                       1 = Logfile
                       2 = stdout
                       3 = stderr

(c) Max Schrimpf - ZHAW 2014

Client

$ ./ client -h
Help:

Usage:
./client [-c Line1] [-C Line2] [-a IP] [-p Port] [-d Out] [-i Out] [-e Out]

Connects to a server and provides an interactive multiline command
interface. You can simply start a new line with \n (Enter)
The command will be send to the server as soon as a empty line is
entered. The interactive interface can be ended using <Ctrl-C> 
or by entering QUIT

You may also provide a command that is executed without an interactive
command interface using the [-c Line] option
If you want to specify a second line that is send to the server after
-c you can use -C 

[-c Line1] Optional: A command that should be send to the server.
                     This option disables the interactive mode

[-C Line2] Optional: A second line for the command - only possible
                     if a first line is provided

[-a IP] Optional: Tries to connect to the server on the given IP.
         Default: 127.0.0.1

[-p Port] Optional: Tries to connect to a server on the given port.
           Default: 7000

[-d Loglevel] Optional: Alter the output for DEBUG messages.
               Default: No logging

[-i Loglevel] Optional: Alter the output for INFO messages.
               Default: stdout

[-i Loglevel] Optional: Alter the output for ERROR messages.
               Default: stderr 

 Possible log Outputs: 0 = No logging
                       1 = Logfile
                       2 = stdout
                       3 = stderr

(c) Max Schrimpf - ZHAW 2014

Test

There are several automated tests available to ensure the full functionality of the server.

$ ./ test -h
Help:

Usage:
./test  [-a IP] [-p Port] [-d Out] [-i Out] [-e Out]

Executes various tests on the fileserver
A running server at the given address is needed

[-a IP] Optional: Tries to connect to the server on the given IP.
         Default: 127.0.0.1

[-p Port] Optional: Tries to connect to a server on the given port.
           Default: 7000

[-d Loglevel] Optional: Alter the output for DEBUG messages.
               Default: No logging

[-i Loglevel] Optional: Alter the output for INFO messages.
               Default: stdout

[-i Loglevel] Optional: Alter the output for ERROR messages.
               Default: stderr 

 Possible log Outputs: 0 = No logging
                       1 = Logfile
                       2 = stdout
                       3 = stderr

(c) Max Schrimpf - ZHAW 2014

License

This term paper is free software: You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.

The file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Seminar parallel computing

Term paper for the Zurich university of applied sciences seminar in parallel computing.

This paper aims to check for a possible correlation of sentiments and chosen values in a specified period. The sentiment analysis is done with the Standord Core NLP framework. For the parallel computation an own Java based Map-Reduce framework is used.

Sample Case:

  1. Analysis of given Twitter data for London
  2. Check for a possible correlation with the FTSE 100 trend in the given period

Usage:

To perform a analysis three steps are needed:

  1. Configuration of the input CSV
  2. Computation of the sentiments
  3. Comperation with some values you like plotted in a nice graph

alt text

In the overview you can choose the inputfile, the output file and the File you want to compare your data with. It is also possible to launch each of the three steps and to view the log.

alt text

As configuration of the sentiment computation you have to choose a date field as well as the text field in your data. You also have to specify the in and out format of the date field. If a timestamp exists more than once after the transformation of input to output format the average value of all given data is calculated. If you like you may also enable a logging of part results, e.g. as a kind of audit trail, on each of the workers that are part of your computation.

alt text

For the final comparison of the file other data you may specify the timestamp and value field of your data and again the input and output format of the timestamp. Again, if the same timestamp has multiple values after transformation a average value is computed and displayed in the graph.

alt text

The output of your comparison may look like this.

Just download and have some fun ;)

Dependencies:

Stanford Core NLP

A older term paper is used for map-reduce

JFreeChart

License:

This term paper is free software: You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.

The file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Linux rootkit

Term paper for the Zurich university of applied sciences seminar in network security.

This project is a very basic implementation of a Linux rootkit. Main objectives were:

  • Hiding on the disk (can not be found by ls)
  • Hiding in the process table (can not be found by ps)

Therefore a system_call hijack was written based on Tyler Borland's great tutorial.

License

This project is free software: You can redistribute it and/or modify it under the terms of the European Union Public Licence (EUPL v.1.1) or – as soon they will be approved by the European Commission - subsequent versions of the EUPL (the "Licence"); You may not use this work except in compliance with the Licence.

The project is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Licence for the specific language governing permissions and limitations under the Licence.