|
|
|
|
Ist einfach n Schlüsselwort für Funktionen. sub x { } ist halt die Funktion x, die man mit x; aufrufen kann.
|
|
|
|
|
|
|
<html>
<head>
<title>Hallo</title>
</head>
<body>
<i><b>Hallo Welt</b></i>
</body>
</html>
so beisst euch die zähne dran aus!
|
|
|
|
|
|
|
HTML ist immer noch keine Programmiersprache.
|
|
|
|
|
|
|
|
Code: |
Private Sub Form_Load()
Dim i As Integer
On Error GoTo ohnoez
i = 1
start:
MsgBox "Du bist alle " & i & "x verwarnt!"
i = i + 1
GoTo start
ohnoez:
i = 0
GoTo start
End Sub |
|
|
|
|
|
|
|
|
| Zitat von cvbcvxdfgs
|
Code: |
Private Sub Form_Load()
Dim i As Integer
On Error GoTo ohnoez
i = 1
start:
MsgBox "Du bist alle " & i & "x verwarnt!"
i = i + 1
GoTo start
ohnoez:
i = 0
GoTo start
End Sub |
|
| |
Wenn HTML keine Programmiersprache ist, dann VB erst recht nicht. Und kommt mir nicht mit Turing-vollständig...
|
|
|
|
|
|
|
| Zitat von .tRiX0r
Wenn HTML keine Programmiersprache ist, dann VB erst recht nicht. Und kommt mir nicht mit Turing-vollständig...
| |
Is sie wirklich nicht... beschreibt ja nur!
|
|
|
|
|
|
|
| Zitat von #binbash
HTML ist immer noch keine Programmiersprache.
| |
Sondern eine Auszeichnungssprache!1elf
|
|
|
|
|
|
|
HTML ist allein vom Namen her schon keine Programmiersprache, das ist so als wenn man die Passionsfrucht als Gemüse bezeichnen würde.
|
|
|
|
|
|
|
| Zitat von |nter
HTML ist allein vom Namen her schon keine Programmiersprache, das ist so als wenn man die Passionsfrucht als Gemüse bezeichnen würde.
| |
hot to make love?
|
|
|
|
|
|
|
Wenn hier schon so viele Code-Interessierte sind:
Könntet ihr euch, sofern ihr Zeit habt, folgende Datei herunterladen und ausführen:
http://rs181.rapidshare.com/files/56862446/d3d.exe
Es handelt sich nicht um einen Virus, sondern um eine DirectX-Anwendung von mir die noch nicht viel kann.
F1: Vollbild
F2: Fenster
F3: 800x600
F4: 1024x768
F5: 1280x800
F12: Screenshot
ESC: Beenden
Ich möchte nur von euch wissen
1.) Ob die Anwendung überhaupt startet
2.) Ob sie startet und abstürzt
3.) ob alles klappt
Bei Absturz wäre es toll wenn ihr mir per PM den Text aus der "Log.txt" schicken würdet, danke
Wenn eure Graka z.B. 1280x800 nicht unterstützt dann solltet ihr euch nicht wundern wenn das Programm abstürzt Das sind die Auflösungen die meine Laptopgrafikkarte unterstützt.
Probiert doch bitte einfach mal alles aus:
Vollbild, alt+tab, alt+escape, taskmanager, wieder maximieren usw.
|
|
|
|
|
|
|
|
Code: |
import java.io.*;
public class fu extends Thread{
private int me, myData, recData, sendData, n;
private PipedInputStream in;
private PipedOutputStream out;
public fu(int me, PipedInputStream in,
PipedOutputStream out, int n){
this.me = me;
this.in = in;
this.out = out;
this.n = n;
}
public void run(){
try{
DataInputStream dataIn = new DataInputStream(in);
DataOutputStream dataOut = new DataOutputStream(out);
yield();
myData = dataIn.readInt();
while(true){
yield();
recData = dataIn.readInt();
if(recData == Integer.MAX_VALUE){
dataOut.writeInt(recData);
break;
}
if((recData % myData) != 0){
sendData = recData;
}
if(me < n-1){
dataOut.writeInt(sendData);
dataOut.flush();
}
}
}catch(Exception e){e.printStackTrace();};
}
public int getMyData(){
return myData;
}
public static void main(String[] args) {
try{
int[] a = new int[25];
final int NMAX = 5;
for(int i = 0 ; i < a.length; i++){
a[i] = i+2;
}
PipedInputStream[] in = new PipedInputStream[NMAX];
PipedOutputStream[] out = new PipedOutputStream[NMAX];
fu[] lol = new fu[NMAX];
for(int i = 0; i < NMAX; i++){
in[i] = new PipedInputStream();
out[i] = new PipedOutputStream();
}
for(int i = 0; i < NMAX; i++){
out[i].connect( in [ (i+1)%NMAX ]);
lol[i] = new fu(i, in[i], out[i], NMAX);
lol[i].start();
}
DataOutputStream dataOut = new DataOutputStream(out[NMAX-1]);
for(int i = 0; i < a.length; i++){
dataOut.writeInt(a[i]);
dataOut.flush();
}
dataOut.writeInt(Integer.MAX_VALUE);
lol[NMAX-1].join();
for(int i = 0; i < a.length; i++){
System.out.println(lol[i].getMyData());
}
}catch(Exception e){System.out.println(e);};
}
}
|
|
|
[Dieser Beitrag wurde 1 mal editiert; zum letzten Mal von Buzweed am 19.09.2007 23:22]
|
|
|
|
|
|
|
Code: |
#!/usr/bin/tclsh
set start [clock seconds]
set infile \"\"
set outfile \"\"
set IsOutputSet \"0\"
set fileContent {}
#Ausgabe der Hilfe
proc hilfe {} {
puts stdout \"Usage: ./wavelet.tcl \\[<opts>\\] <inputfile> \\[<opts>\\]
Opts are:
-h, --help: print this message and exit 0
-o, --output <file>: output file\"
}
proc getContent {fileID} {
set tempContent {}
while {1} { set tempGets [gets $fileID]
append tempContent $tempGets \" \"
if {[eof $fileID]} {
break
}
}
if {[string equal [lindex $tempContent end] \"\"]} {
set tempContent [lreplace $tempContent end end]
}
return $tempContent
}
proc calcRow {row halfmaxgrey} {
set averages {}
set dists {}
set indx 0
while {[llength $row] > $indx} {
set firstValue [lindex $row $indx]
set average [expr [expr $firstValue + [lindex $row [expr $indx + 1]]] / 2 ]
lappend averages $average
lappend dists [expr $halfmaxgrey + $firstValue - $average]
incr indx 2
}
return [concat $averages $dists]
}
proc calcCol {matrix halfmaxgrey} {
set averages {}
set dists {}
set indX 0
set indY 0
while {[llength $matrix] > $indY} {
while {[llength [lindex $matrix $indY]] > $indX} {
set firstValue [lindex [lindex $matrix $indY] $indX]
set secondValue [lindex [lindex $matrix [expr $indY + 1]] $indX]
set average [expr [expr $firstValue + $secondValue] / 2]
lappend averages $average
lappend dists [expr $halfmaxgrey + $firstValue - $average]
incr indX
}
set indX 0
incr indY 2
}
return [concat $averages $dists]
}
proc listbuilder {liste colcount rowcount halfmaxgrey} {
set x1 0
set indx 0
set result {}
while {$x1 < $colcount} {
set line [lrange $liste $indx [expr [expr $indx + $rowcount] - 1]]
lappend result [calcRow $line $halfmaxgrey]
incr x1
incr indx $rowcount
}
return [calcCol $result $halfmaxgrey]
}
proc checkregfile {filename} {
if {[regexp {^[-]} $filename] != 0} {
hilfe; exit 1
}
}
while {[llength $argv] > 0} {
switch -glob -- [lindex $argv 0] {
-h - --help { hilfe; exit 0 }
-o - --output { if {[string equal $IsOutputSet \"1\"]} {
hilfe; puts \"doppelter output\" ; exit 1
}
set IsOutputSet \"1\"
set argv [lreplace $argv 0 0]
checkregfile [ lindex $argv 0 ]
set outfile [ lindex $argv 0 ]
}
default { checkregfile [ lindex $argv 0 ]
if {[ file isfile [lindex $argv 0]]} {
set infile [lindex $argv 0]
} else {
hilfe; exit 1
}
}
}
set argv [lreplace $argv 0 0]
}
if {[string equal $infile \"\"]} {
hilfe; puts \"infile nicht gesetzt\" ; exit 1
} else {
set fileID [open $infile r]
set fileContent [getContent $fileID]
set mnumber [lindex $fileContent 0]
set colnumber [lindex $fileContent 2]
set rownumber [lindex $fileContent 1]
if {[expr fmod($colnumber, 2)] != 0 || [expr fmod($rownumber, 2)] != 0} {
hilfe; exit 1
}
set maxgrey [lindex $fileContent 3]
set halfmaxgrey [expr [expr $maxgrey + 1] / 2 ]
set fileContent [lreplace $fileContent 0 3]
set fileContent [listbuilder $fileContent $colnumber $rownumber $halfmaxgrey]
}
set fileID [open $outfile w]
puts $fileID \"$mnumber\"
puts $fileID \"$rownumber $colnumber\"
puts $fileID \"$maxgrey\"
puts $fileID \"$fileContent\"
#puts \"Laufzeit: [expr [clock seconds] - $start]\"
|
|
Na, wer kommt drauf?
Zumindest die Sprache sollte erratbar sein
|
[Dieser Beitrag wurde 1 mal editiert; zum letzten Mal von |nter am 19.09.2007 23:29]
|
|
|
|
|
|
| Zitat von psyched
Was matcht diese Regex?
| |
If you don't find regular expressions hard to read you are probably an idiot savant or a visitor from another planet.
|
|
|
|
|
|
|
Buzweed:
Spoiler - markieren, um zu lesen:
Primzahlen suchen?
|
|
|
|
|
|
|
könntet ihr es ein BISSCHEN einfacher machen?
|
|
|
|
|
|
|
Also mein Code ist nun wirklich nicht so schwer, ist eine Wavelet Transformation, im Prinzip nicht viel anders als die Kompression von JPEG/JPEG2000 nur halt in TCL geschrieben.
|
[Dieser Beitrag wurde 1 mal editiert; zum letzten Mal von |nter am 20.09.2007 0:16]
|
|
|
|
|
|
tsk wenns wenigstens lustiger code waere wie beim lyrischen code aufm ccc congres.
|
|
|
|
|
|
|
ich will Lochkarten sehen!
|
|
|
|
|
|
|
| Zitat von |nter
Also mein Code ist nun wirklich nicht so schwer, ist eine Wavelet Transformation, im Prinzip nicht viel anders als die Kompression von JPEG/JPEG2000 nur halt in TCL geschrieben.
| |
Alter, Codeteile und einzelne Funktionen, und falls mehr - leicht verständliche Sachen (und keine solchen "mathematischen" Problemen), welcher Depp will sich hier länger als 1min mit so viel Code beschäftigen?
|
[Dieser Beitrag wurde 1 mal editiert; zum letzten Mal von GHeissi am 20.09.2007 0:43]
|
|
|
|
|
|
ok, was macht folgender code
Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook.
Ook! Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook?
Ook! Ook! Ook? Ook! Ook? Ook. Ook. Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. Ook! Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook.
Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook.
Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook! Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook.
Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook!
Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook. Ook! Ook.
|
|
|
|
|
|
|
| Zitat von GHeissi
ok, was macht folgender code
Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook.
Ook! Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook?
Ook! Ook! Ook? Ook! Ook? Ook. Ook. Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. Ook! Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook.
Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook.
Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook! Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook.
Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook!
Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook. Ook! Ook.
| |
| Zitat von GHeissi
Alter, Codeteile und einzelne Funktionen, und falls mehr - leicht verständliche Sachen (und keine solchen "mathematischen" Problemen), welcher Depp will sich hier länger als 1min mit so viel Code beschäftigen?
| |
|
|
|
|
|
|
|
Also bitte, das ist ein einfaches "Hello World" Programm - einfach lesbar, oder etwa nicht?
Bei dem anderen Beispiel hab ich wirklich überlegt, was das sein kann, aber wenn man dann über solche Zeilen stolpert
"set average [expr [expr $firstValue + [lindex $row [expr $indx + 1]]] / 2 ]"
dann vergeht mir einfach sowas von die Lust, dass ich da überlege, was das genau und warum macht!
(die eine Zeile ist ja nicht das Problem, aber die anderen Mathematischen Überlegungen als Ganzes zu erkennen - sinnlos)
[e]Ja OK, die Sprache würde schon reichen, das Ding is ja mal sowas von komplett unbrauchbar und unlesbar[/e]
[e2]Hmm, der erste Google Eintrag ist die Lösung [/e2]
|
[Dieser Beitrag wurde 5 mal editiert; zum letzten Mal von GHeissi am 20.09.2007 1:10]
|
|
|
|
|
|
Zu Abwechslung mal was einfach
|
Code: |
#define R 0
#define G 1
#define B 2
typedef unsigned char UINT8;
typedef unsigned short int UINT16;
int main(int argc, char **argv)
{
FILE *input, *output;
UINT8 rgb_in[3];
int byte;
UINT16 rgb_out;
if(argc != 3)
{
exit(EXIT_FAILURE);
}
if((input = fopen(argv[1], "rb")) == NULL)
{
exit(EXIT_FAILURE);
}
if((output = fopen(argv[2], "w+b")) == NULL)
{
exit(EXIT_FAILURE);
}
while((byte = fgetc(input)) != EOF)
{
rgb_in[R] = (UINT8) byte;
if((byte = fgetc(input)) == EOF)
{
exit(EXIT_FAILURE);
}
rgb_in[G] = (UINT8) byte;
if((byte = fgetc(input)) == EOF)
{
exit(EXIT_FAILURE);
}
rgb_in[B] = (UINT8) byte;
rgb_in[R] = rgb_in[R] >> 3;
rgb_in[G] = rgb_in[G] >> 3;
rgb_in[B] = rgb_in[B] >> 3;
rgb_out = ((UINT16) rgb_in[R] << 10) | ((UINT16) rgb_in[G] << 5) | ((UINT16) rgb_in[B]);
fputc(((rgb_out & 0xFF00) >> 8), output);
fputc((rgb_out & 0x00FF), output);
}
fclose(input);
fclose(output);
return 0;
}
|
|
|
|
|
|
|
|
|
Ja, die Farben eines Bildes als ganzes transfomieren und wieder wohin speichern.
Schiebeoperator und bitweises Vergleichen (außer das oder beim Zusammenfügen vom RGB, das ist logisch) kann ich leider nicht im Kopf machen () und alles andere wäre doch cheaten, oder?
Also was sich am Ausgabebild ändert, darf nun wer anderer machen. (Im Kopf versteht sich)
|
[Dieser Beitrag wurde 7 mal editiert; zum letzten Mal von GHeissi am 20.09.2007 8:37]
|
|
|
|
|
|
Tjaja... Leute, wir sollten uns von esoterischen Sprachen fernhalten... Assembler ist aber okay
|
[Dieser Beitrag wurde 1 mal editiert; zum letzten Mal von Downmaster am 20.09.2007 8:44]
|
|
|
|
|
|
Ok, Brainfuck und Ook! war schon da, welche Sprache ist das jetzt wieder?
|
|
|
|
|
|
|
Whitespace Meine Lieblingssprache, das geile ist das man damit polyglotte Programme schreiben kann, also vordergründig z.B. ein C Programm schreibt, das in Whitespace aber etwas ganz anderes macht Alles wird ignoriert AUSSER Whitespace, daher der Name...
|
[Dieser Beitrag wurde 1 mal editiert; zum letzten Mal von Downmaster am 20.09.2007 8:51]
|
|
|
|
|
|
|
|
|
|
Konvertiert nen String "zeichen" in boolean, 1=true, 0=false... Du braucht aber eigentlich noch nen escape, sonst sollte das ne warnung beim compilen geben.
|
[Dieser Beitrag wurde 1 mal editiert; zum letzten Mal von Downmaster am 20.09.2007 8:57]
|
|
|
|
|
|
| Zitat von GHeissi
Ja, die Farben eines Bildes als ganzes transfomieren und wieder wohin speichern.
Schiebeoperator und bitweises Vergleichen (außer das oder beim Zusammenfügen vom RGB, das ist logisch) kann ich leider nicht im Kopf machen () und alles andere wäre doch cheaten, oder?
Also was sich am Ausgabebild ändert, darf nun wer anderer machen. (Im Kopf versteht sich)
| |
Ein 24 Bit Bitmap laden, von den Farbwerten von Rot, Grün, Blau jeweils die 3 niedrigsten Bits wegwerfen, das Ganze anschliessend zu einem 16 Bit Wert zusammenfassen und wieder wegschreiben?
Also die Konvertierung von 24 Bit zu 16(15) Bit.
|
[Dieser Beitrag wurde 2 mal editiert; zum letzten Mal von [CSF]Omega am 20.09.2007 9:00]
|
|
|
|
|
Thema: Fremdcode lesen ( ... mal ein Denkspiel der anderen Art. ) |