Index: /daten/README.htm =================================================================== --- /daten/README.htm (revision 23) +++ /daten/README.htm (revision 23) @@ -0,0 +1,28 @@ + +
+ +The data directory contain dozens of paper tape files. These + files are just ordinary binary files which content is exactly + the same which is punched on a 8-bit paper tape. + +
All files with the prefix "udo-" are machine code for the
+ NCR computer (see somewhere at http://www.technikum29.de/en).
+ They are written with some other selfmade Microsoft Excel
+ tools.
+
(C) Copyright 2008 Udo Meyer
+
+
This directory contains several program paper tapes for the + NCR computer which were read in with the paper tape + userspace reader (see directory ../reader/). I don't know + exactly who has written them, but copyright of course belongs + to these persons. + +
You can ask the technikum29.de development team at + development@[our domain] if you want to use these files. + +
--Sven, 19.07.2008 22:18 Index: ten/README.txt =================================================================== --- /daten/README.txt (revision 22) +++ (revision ) @@ -1,28 +1,0 @@ - - The Paper Tape Project -- The Data - ================================== - - The data directory contain dozens of paper tape files. These - files are just ordinary binary files which content is exactly - the same which is punched on a 8-bit paper tape. - - udo NCR files - ------------- - All files with the prefix "udo-" are machine code for the - NCR computer (see somewhere at http://www.technikum29.de/en). - They are written with some other selfmade Microsoft Excel - tools. - (C) Copyright 2008 Udo Meyer - - eingelesene NCR-Programme - ------------------------- - This directory contains several program paper tapes for the - NCR computer which were read in with the paper tape - userspace reader (see directory ../reader/). I don't know - exactly who has written them, but copyright of course belongs - to these persons. - - You can ask the technikum29.de development team at - development@[our domain] if you want to use these files. - - --Sven, 19.07.2008 22:18 Index: cumentation/index.html =================================================================== --- /documentation/index.html (revision 22) +++ (revision ) @@ -1,23 +1,0 @@ - -
--Start | -Punching | -Reading | -Labeling | -Visualisation | -Generating Paper Tapes online! -
- -Welcome to the Paper Tape Project. The goal of this project is to handle paper tapes handy - with today's computers. Therefore we have written drivers for punching and reading with - external devices, as well as a complete specialized hex editor for paper tape binary files. - This project has produced a lot of tools, partly high quality, partly quick & dirty. - It's an open source project – you can get the complete results, every single source - file, as well as compiled binaries for Microsoft windows and Linux. The development - proceeds mainly at linux workstations, thanks to their great and powerful Unix shells.
Index: /documentation/index.php =================================================================== --- /documentation/index.php (revision 23) +++ /documentation/index.php (revision 23) @@ -0,0 +1,97 @@ + a/b + + // redirect to default page if no one is given: + $default_page = 'documentation/start.htm'; + if(empty($filename)) { header("Location: $_SERVER[PHP_SELF]/$default_page"); exit; } + + // check if filename is correct + $jail_dir = realpath('../'); # don't display files higher than parental dir + $file_path = realpath('../'.$filename); + #var_dump(substr($file_path, -3, 3), $filename, $file_path, $jail_dir); + if(0 !== strncmp($file_path, $jail_dir, strlen($jail_dir)) || + substr($file_path, -3, 3) != 'htm') { + // user want's display file higher than parental dir + // or file is not a *.htm file + // then Redirect to file! Apache will handle error ;-) + header("Location: $_SERVER[SCRIPT_NAME]/../../$filename"); + echo "Won't make file $filename beautiful\nRefering to that file...\n"; + exit; + } + + // parse file until start.. + $handle = @fopen("../$filename", 'r'); + if(!$handle) { header("HTTP/1.0 403 Forbidden"); print "Must not open $filename\n."; exit; } + while(!feof($handle)) { + if(strpos(fgets($handle), " + + +Welcome to the Paper Tape Project. The goal of this project is to handle paper tapes handy + with today's computers. Therefore we have written drivers for punching and reading with + external devices, as well as a complete specialized hex editor for paper tape binary files. + This project has produced a lot of tools, partly high quality, partly quick & dirty. + It's an open source project – you can get the complete results, every single source + file, as well as compiled binaries for Microsoft Windows and Linux. The development + proceeds mainly at linux workstations, thanks to their great and powerful Unix shells.
+ +I'm about to switch to HTML files for documentation, but there still some README.txt + files flying around:
+See this progress README files:
+ + +The this shallabe README files:
+ + +Something about the goal
Index: /documentation/style.css =================================================================== --- /documentation/style.css (revision 23) +++ /documentation/style.css (revision 23) @@ -0,0 +1,13 @@ +/* + * PaperTape Project: Documentation design + * + */ +@import url(http://dev.technikum29.de/src/private.design/style.css); + +pre { + background-color: #F9F9F9; + border: 1px dashed #2F6FAB; + color: black; + line-height: 1.1em; + padding: 1em; +} Index: /perl-tools/README.htm =================================================================== --- /perl-tools/README.htm (revision 23) +++ /perl-tools/README.htm (revision 23) @@ -0,0 +1,28 @@ + + + +The perl tools are some self-explanatory perl scripts that e.g. + draw paper tapes (ASCII art), generate labels in different "fonts", + parse ASCII number files, etc. + +
They only require a perl compiler but nothing more -- no exotic + CPAN modules, etc. -- so they'll run on almost every platform. + +
Copyright 2008 Sven Köppel, all tools in this directory are + released under the GPL. + +
The Paper Tape Project Perl Tools are free software: you can + redistribute them and/or modify them 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. + +
Programs from the Paper Tape Project are distributed in the hope + that they 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. + +
For a copy of the GNU General Public License, see
+ By punching special bit patterns on paper tapes, you can "print" out
+ text on paper tapes. The result can be used in a wide variety of ways,
+ for example for labeling things, as unique souvenir or simply to
+ label mass produced paper tapes. Like ordinary computer fonts (e.g. True Type Fonts), there are also
+ many different possibilities to "paint" letters and digits on paper
+ tapes. We have implemented a couple of fonts as perl programs. They
+ are called quite like
+ Thus, they usually print out the generated bit patterns to stdout.
+ Mass punching and labeling is therefore quite simple:
+ To simplify this process, various punching frontens already use
+ the font generation programs internally.
+
+ The PaperTapeFont C library is a rather small pure C library that uses
+ only basis libc functions (no dependency at all). It consists of an
+ header file and a quite huge C file and has a pseudo object oriented
+ approach, comparable to the LOCHSTREIFEN object in
+ the visualisator subproject.
+ Furthermore, there's a very good documentated command line interface called
+ptfont with an excellence help system. Using this interface, you can
+create and modify any Paper Tape Font file, as well as render strings in good old
+Unix philosophy fashion. The GtkPaperTape widget features an implemented fully functional interface to
+ the PaperTapeFont library where you can create and modify any paper tape font,
+ as well as (of course) generate texts in any paper tape font. I've written a manual (or specification)
+ how to use and write Paper Tape Font files. I have developed a portable and easy to use ASCII storage format
+ for paper tape fonts, called Paper Tape Font file. While
+ paper tape fonts were formerly implemented as (perl) scripts,
+ with C (and C++) that's no more
+ practical, because setting up big nested hashes is not really
+ possible. Apart from that, it would not be a good style to set
+ up a giant header file with so much static data. I have considered using popular and approved data formats like
+ XML or Jason instead of a "proprietary" new, perhaps
+ even binary data format. On the one hand, using XML would have been
+ really portable, but also very unhandy, because I would have to look
+ for XML processors for Windows, and compiling would be get
+ complex and even more complex. Therefore I've decided in favor of simple ASCII files with some
+ not very strict layout. It's really obvious how it works: This is a typical paper tape file: As you see, paper tape files are quite funny ASCII files. Here are the
+rules you have to observe: I've developed a tiny stand alone C library which does not need
+ auxillary libraries like Glib and which will compile at windows,
+ too. It's quite simple to use that library. At first, there even
+ exists a command line interface that implements most of the
+ features. But here's how to use the C functions: The main "object like" structure is the PAPERTAPE_FONT structure.
+ It can be built directly by parsing an already opened file: Now the file has been parsed and every available letter is stored
+ in RAM. So you can directly go and generate labels:
+
+ Of course you can check if your string can be fully generated, too:
+
+ And after all, changing the papertape is fully implemented: This will change the letter immediately. So the following output
+ will give out "ABBA" on the papertape at the end (and not "ABAB"):
+
+ If you feel destructive, you can also delete characters:
+
+ At last, after messing around you can save the whole changed
+ thing (back) to a file.
+
+ Be aware that the following example will stripe out *ALL*
+ comments out of your font file:
+
+ In the end, an issue that is a bit more complicated: Special
+ characters. This includes white spaces, letter spacing, etc.
+ The names for these special characters are noted in the
+ papertapefont.h header file, so you can access them directly,
+ too, if you want:
+
+ I think that's all, for the moment. Happy coding :-)
+
+ -- Sven Köppel, 04.09.2008
Index: /visualisator/README.htm
===================================================================
--- /visualisator/README.htm (revision 23)
+++ /visualisator/README.htm (revision 23)
@@ -0,0 +1,205 @@
+
+
+ We have made many afforts to draw paper tapes on computer screens.
+ This subproject is surely one of the biggest and most complex
+ programs in the complete paper tape project. It hasn't be
+ simply written down in some days but has gone throught various
+ development generations, from simply two C files up to the current
+ bunch of a dozen C++ files.
+
+ This is the structure we are targetting:
+ The files lochstreifen.c and lochstreifen.h implement the
+ drawing of paper tapes by using the cairo graphics library.
+ These routines only need cairo, so they can be compiled
+ by using `pkg-config --cflags --libs cairo`. They do not
+ need neither GTK nor Glib (this is a special feature! :-) )
+ There are two generations of this file: The one before I
+learned that there's a standard for paper tapes and the one after
+I learned that there's such a standard, called ECMA 10. When
+I read about this ECMA standard, I've rewritten the routines completely,
+cleaning the programming interface and making it more flexible and
+robust. The new code is stable right now. Features of this library: The file cli.c uses the LOCHSTREIFEN structure
+ directly. It only depends on the two lochstreifen.c/h files.
+ For argument parsing, it uses the argp.h, from the
+ GNU C library.
+ Unfortunately argp.h doesn't seem to be present in other
+ c librarys, that's still an issue. Apart from that the CLI
+ program is complete platform independent and only has to be
+ linked against libcairo: gcc
+ cli.c lochstreifen.c `pkg-config --cflags --libs cairo`.
+ Features of the command line frontend:
+ We actually have developed a web frontend in PHP which uses
+ the command line interface to generate the results. It
+ recieves the user input by an huge HTML form. Using a lot
+ of AJAX magic, it even caches already created images and
+ creates reports which contain the input data and all
+ settings and which are finally available for the client.
+ To avoid denial of service attacks (DoS), the PHP frontend
+ will deny creating paper tapes if the input file exceeds
+ some MB because the resulting file will be very big
+ (most web browsers reject rendering such big files which are,
+ for example, 400.000px in width).
+ The library GtkPaperTape is a typical and unexpected result of
+ the growth of the complete program. Whereas the GTK visualisatoin
+ frontend initlally consisted of only one C file (corresponding to
+ cli.c), gtk.c, it rapidly got very big and
+ confusing so I decided to write divide the sourcecode into a
+ Gtk+ widget, called GtkPaperTape and the program around it,
+ still called gtk.c. Well, I developed this widget, and it
+ got even much bigger than the former gtk.c program
+ (about 1200 lines pure C and Glib code). There occured
+ quite some problems (the sourcecode was badly maintainable and
+ confusing, and there wer some drawing bugs that I could not
+ solve), but the program was working quite fine.
+ Well, there was the issue about the Windows version and the
+ implementation of punching/reading features. This made the
+ things much more complex, as it requires more features from
+ both LOCHSTREIFEN and GtkPaperTape. I therefore
+ decided to learn C++ and Gtkmm to produce a new program from
+ the scratch with a cleaner interface and a better documentation.
+ As was only to be expected, the sourcecode is now much more
+ bulky, we have now more than a dozen Cpp/header files with
+ more than 2400 lines of code (still growing). The third generation
+ of the GtkPaperTape is still supposed to be called
+ GtkPaperTape, but uses the gtkmm namespace Gtk,
+ so it's actually Gtk::PaperTape.
+ This is an overview of the features of the current generation of
+ GtkPaperTape: There is still a bug while scrolling over really big paper tapes,
+but I've managed to get solved who's the guilty library: It's a
+Gtk+ bug, commited on the GNOME
+bugzilla by me. Compared to the widget, there's a quite trivial and simple
+frontend programm called gtk.cc that replaces the old
+gtk.c.Paper Tape Fonts
+
+Introducion
+
+ $ ./schrift.pl "Text we want to print out" > paper-tape.bin
+
+
+
+ $ ./schrift.pl "File ABC on `date`" | cat - file.bin | ./punch
+
+
+
By the way, the german word schrift simpy means font.
+
+The PaperTapeFont C Library
+
This library can handle Paper Tape Font files in a very powerful manner.
+ These are some of the features:
+
+
+Paper Tape Font command line interface
+Paper Tape Font Gtk+ interface
+Paper Tape Font files
+Paper Tape Font files
+
+|***.*** |a You can write texts almost everywhere in the file,
+| .* * |a just the very first letters, which actually
+|***.*** |a *look* like a papertape (direction of movement, of
+| . | course, from top down), define the bytes from
+|***.*****|e that the letters are made up, which stand directly
+|* .* *|e next to the paper tape.
+|* .* *|e Yes, that's it! This file is a complete papertape
+|* . *|e font file, containing (until now) the letters a and e.
+
+
+
+Specification of Paper Tape files
+
+
+---- Start of example file ----
+The Paper Tape Project -- PAPERTAPE_FONT file.
+The content of this file describes a paper tape font...
+See this small key how the document is structured:
+ bits |identification
+ 123.45678|char/string
+| . |
+|+++.+++++|m
+| . + |m
+| . + |m this is a comment.
+| . + |m
+|+++.+++++|m
+|+ . +|I
+|+++.+++++|I
+|+ . +|I
+| . |
+| . |
+| . |
+| . |
+|+++.+++++|0
+ Comments can be typed
+right anywhere, everything that doesn't look like
+a paper tape on the right place, is ignored.
+ |+ . ++| <- even this one.
+|+ . +|0
+|+++.+++++|0
+| . |
+| . | =white_space this is a comment, too.
+| . | =white_space
+| . |
+
+---- End of example file ----
+
+
+
+
+
+
+ |123.45678| <- bit positions
+ |012.34567| <- how computers count the bits
+ e.g. | * . ** *| -> byte value = 2^1 + 2^4 + 2^5 + 2^7 = 178 = 0xbd
+
+
So all these bytes have the equal values:
+
+ |+ +.++ ++|
+ |h e.ll oo|
+ |# #.## ##|
+ || |.|| ||| (not recommended ;-) )
+ |( ).() ()| (also not recommendable)
+ |* *.** **|
+
+ like this: | * . ** *|r
+ but not like this: | *.* ***| w
+
+ That character is called the "ASCII identifier", because it shall be
+ ASCII (8bit). You can write comments right after the identifier,
+ because everything afterwards will be ignored.
+
+ * the normal byte |***.*****|p
+ that belongs to an | .* *|p
+ ASCII character: | . *** |p
+ * bytes which have no | . |
+ identifier at all | . |
+ They are ignored. | . |
+ * bytes that belong to |** . ****| special_character
+ special characters. | *.* | special_character
+
+ We give attention to special characters later.
+
+ |***.*****|p
+ | .* *|p
+ | . *** |p
+ | . | <- this line doesn't belong to p any more.
+
+ Don't mix up with letters. Compare these examples:
+
+ |***.*****|p |***.*****|p
+ | .* *|p | .* *|p
+ | . *** |p | . *** |p
+ | . | | . |
+ | . *|y | . *|y
+ | . * |y | . * |p
+ | .*** |y | .*** |y
+ | . * |y | . * |y
+ | . *|y | . *|y
+
+ The typo at the right ("p" instead of "y") will overwrite the
+ defined paper tape letter "p" above, because letters will always
+ be read as blocks. Furthermore the first "y" line is overwritten,
+ too, by the later 3 "y" lines. That is, due to the typo error, all
+ previous definitions of "p" and "y" before are thrown away.
+
Compare also these examples:
+
+ |***.*****|p |***.*****|p
+ | .* *|p | .* *|p
+ this does nothing. | . |
+ | . *** |p | . *** |p
+ | . | | . |
+
+ While the comment line on the left hand example is simply ignored,
+ the white space byte on the right hand side is parsed and therefore
+ the "p" value destroyed, like in the "y" and "p" example above.
+
+ |***.*****|p
+ | .* *|p This is an ordinary ASCII character
+ | . *** |p
+ | . |
+ | . | =white_space This is typically used to define
+ | . | =white_space how white_spaces have to look
+ | . | =white_space like. They typically contain
+ | . | only NULL bytes, of course ;-)
+ | . |
+ | . | =char_spacing And this defines how much space
+ | . | is packed between characters.
+ | . | Typically one NULL byte.
+ | . |
+ | *.* * | =secret_file
+ |* .* ** | =secret_file The name of a special character
+ | **.* ** | =secret_file may not contain whitespaces.
+ |* *. *** | =secret_file Thereby normal text/comments
+ | .**** | =secret_file can be written next to "special
+ | . * | =secret_file character" bytes just like next
+ | * . *** | =secret_file to ordinary bytes.
+ |***.* ** | =secret_file
+ |** . ** | =secret_file After all, the same limitiations
+ |** .* ** | =secret_file exist like for normal multiple
+ |** . *** | =secret_file byte definitions: Don't break in
+ |* . * | =secret_file the flow, like
+ | . | <- here, because this would
+ | * .* | =secret_file truncate secret_file to <-this byte.
+
+
+ So if your font file is well commented, don't let the implementation
+ write to it.Specification of the papertapefont.h library
+
+ #include <stdio.h>
+ #include "papertapefont.h"
+
+ FILE* font_file = fopen("/path/to/your/font.file", "r");
+ PAPERTAPE_FONT* font = papertape_font_new_from_file(font_file);
+
+
+
+ int label_size;
+ byte_t* label_bytes;
+
+ label_bytes = papertape_font_get_label(font,
+ "Hello World!", &label_size);
+
+ // further use, e.g. with LOCHSTREIFEN*:
+ LOCHSTREIFEN* papertape = lochstreifen_new();
+ lochstreifen_set_data(label_bytes, label_size);
+
+
+
+ if(! papertape_font_string_is_printable(font, "{H4x05]!")) {
+ printf("Sorry dude, the current font is not"
+ "script kiddie compatible.\n");
+ }
+
+
+
+ bytes_t* user_generated;
+ int len;
+
+ let_user_generate_letter("Please make an 'A'",
+ &user_generated, &len);
+
+ papertape_font_set_char(font, 'A', user_generated, len);
+
+
+
+ bytes_t* output, buf_for_a, buf_for_b;
+ int o_len, a_len, b_len;
+
+ // print out "ab" on papertape
+ output = papertape_font_get_label(font, "ab", &o_len);
+ send_to_papertape_puncher(output, o_len);
+
+ // flip a and b
+ buf_for_a = papertape_font_get_label(font, "a", &a_len);
+ buf_for_b = papertape_font_get_label(font, "b", &b_len);
+ papertape_font_set_char(font, 'B', buf_for_a, a_len);
+ papertape_font_set_char(font, 'A', buf_for_b, b_len);
+
+ // print out "ab" on papertape...
+ output = papertape_font_get_label(font, "ab", &o_len);
+ send_to_papertape_puncher(output, o_len);
+
+
+
+ // clean up all the mess by deleting everything!!111
+ papertape_font_del_char(font, 'a');
+ papertape_font_del_char(font, 'b');
+ if(!papertape_font_del_char(font, 'b'))
+ printf("There is no more 'b'. Of course!");
+ output = papertape_font_get_label(font, "abba", &len);
+ // this will give out 4 errors at stderr, because
+ // no character can be generated.
+
+
+
+ FILE* target = fopen("/existing/or/new.font.txt", "w");
+ papertape_font_write_to_file(font, target);
+
+
+
+ FILE* needs_cleanup = fopen("font.txt", "r+");
+ PAPERTAPE_FONT* font = papertape_font_new_from_file(needs_cleanup);
+ papertape_font_write_to_file(font, needs_cleanup);
+
+
+
+ byte_t *white = calloc(sizeof(byte_t), 100);
+ papertape_font_set_special(font, PAPERTAPE_FONT_SPACE_NAME,
+ white, 100);
+ // about 1k of bytes:
+ papertape_font_get_label(font, "A fairly long text ! ! ! ", &somewhere)
+ // deletion sets the space to some kind of default value
+ papertape_font_del_special(font, PAPERTAPE_FONT_SPACE_NAME);
+ // so this is quite short:
+ papertape_font_get_label(font, " s h o r t ", &somewhere);
+
+
+The Visualisation Sub project
+
+Introducion and Overview
+
+
+
+LOCHSTREIFEN cairo drawing routines
+
The routines only implement the drawing routines - the
+ cairo object (cairo_t) must be given from the implementing
+ programs. In this way you have full freedom to choose a
+ cairo surface -- among others PNG, SVG, PDF, ...).
+ See lochstreifen.h for the structure of the object
+ `LOCHSTREIFEN'. See lochstreifen.c for help with the usage
+ of the functions.
+
+
+
+
+ LOCHSTREIFEN *papertape = lochstreifen_new();
+ printf( "%d", lochstreifen_get_width(papertape) );
+ lochstreifen_set_d(papertape, 42);
+ int dir = lochstreifen_get_orientation(papertape);
+ lochstreifen_draw(papertape, cairo_context);
+ // ...
+
+
+
+
+
+ All modes can be used concurrently.
+ Command line and web frontend
+
+
+
This progam is an own sub project, see
+ ../web-frontend/ for the
+ sources and it's documentation.GtkPaperTape
+
There's a meta header file, gtkpapertape.h. Include
+ this file when you want to use the GtkPaperTape widget.
+
+