From: io_x on 18 Dec 2009 07:48 "io_x" <a(a)b.c.invalid> ha scritto nel messaggio news:4b2551e6$0$8861$4fafbaef(a)reader5.news.tin.it... > > #define F for > #define P printf > #define R return > #define G goto > > // ritorna 0 errore 1 tutto ok > int DaiNumeri(fnum* nDeb, fnum* nCred, u32 nConto, i find a little bug, but this would be ot (because it would be 1/2 C++ + 1/2 C) for find it i had manually done 21 bank operation for find that the error was in the last one; then it seems there is one error that signal itself only one time don't know how correct it int DaiNumeri(fnum* nDeb, fnum* nCred, u32 nConto, Data inizio, Data fine, Conto0* filiale, FILE_m* FileStriscieP, FILE_m* FileStriscieOldP, FILE_m* FilePuntatoriStriscieP, FILE_m* FileSaldiP) {i32 n_elx[2], r, r0, r1, k, n_el, j, delta; u32 dovefile; i8 **pi, *p, *p1, *elencox[2], *elenco; Striscia *s1, *s2; Data dataP; fnum saldo, t, v; if(nDeb==0||nCred==0||filiale==0) R 0; *nDeb=0; *nCred=0; if(inizio>fine||(fine-inizio)>370) R 0; if(fine.anno<200) R 0; r0=StriscieContoAnno(&elencox[0], &n_elx[0], nConto, fine.anno-1, filiale, FileStriscieP, FileStriscieOldP, FilePuntatoriStriscieP); if(r0==0) R 0; r1=StriscieContoAnno(&elencox[1], &n_elx[1], nConto, fine.anno, filiale, FileStriscieP, FileStriscieOldP, FilePuntatoriStriscieP); if(r1==0){l0:; ZeroFree(elencox[0]); R 0;} r0=n_elx[0]; if(r0< 0){l1:; ZeroFree(elencox[1]); G l0;} r1=n_elx[1]; if(r1< 0) G l1; r=r0+r1; if(r < 0) G l1; if(r+2<0) G l1; if((k=(r+2)*sizeof(Striscia))<0) G l1; p=(char*)Malloc_m(k); if(p==0) G l1; p1=MemCat_m(p, elencox[0], r0*sizeof(Striscia)); MemCat_m(p1, elencox[1], r1*sizeof(Striscia)); elenco=p; n_el=r; ZeroFree(elencox[0]); ZeroFree(elencox[1]); pi= (i8**) Malloc_m((n_el+8)*sizeof(i8*)); if(pi==0){l2:; ZeroFree(elenco); R 0;} F(j=0; j<n_el; ++j) pi[j]=elenco+j*sizeof(Striscia); if(qsortPnt_m(pi, n_el, comparaStrisciaValuta)==0) {l3:; ZeroFree(pi); G l2;} r=SaldoInData(&saldo, &dovefile, nConto, (inizio-1), filiale, FileStriscieP, FileStriscieOldP, FilePuntatoriStriscieP, FileSaldiP); if(r==-1) G l3; cout << "Saldo iniziale in data " << (inizio-1) << " : "; StampaSaldo(stdout_m, saldo, globalPrecision); P("\n"); s2=0; F(j=0, dataP=(inizio-1); j<n_el; ++j) {s1=(Striscia*)pi[j]; if(s1->DataValuta> fine) break; if(s1->DataValuta>=inizio) {if( DaCifraAfnum(&t, s1->imp)==0) G l3; delta=(s1->DataValuta)-dataP; dataP=(s1->DataValuta); v=saldo*delta; if(saldo>=0) *nCred+=v; else *nDeb -=v; cout << v << " "; saldo=saldo+t; s2=s1; } else if(s1->DataOperazione>=inizio) {if( DaCifraAfnum(&t, s1->imp)==0) G l3; saldo=saldo+t; cout << saldo << "s "; } } if(s2!=0){delta=fine-(s2->DataValuta); v=saldo*delta; if(saldo>=0) *nCred+=v; else *nDeb -=v; } ZeroFree(pi); ZeroFree(elenco); R 1; }
From: Esra Sdrawkcab on 18 Dec 2009 13:52 On Fri, 18 Dec 2009 12:48:50 -0000, io_x <a(a)b.c.invalid> wrote: > > "io_x" <a(a)b.c.invalid> ha scritto nel messaggio > news:4b2551e6$0$8861$4fafbaef(a)reader5.news.tin.it... >> >> #define F for >> #define P printf >> #define R return >> #define G goto >> >> // ritorna 0 errore 1 tutto ok >> int DaiNumeri(fnum* nDeb, fnum* nCred, u32 nConto, > > i find a little bug, but this would be ot (because it would be 1/2 C++ + > 1/2 C) > for find it i had manually done 21 bank operation for find that the error > was in the last one; > then it seems there is one error that signal itself only one time > don't know how correct it > > int DaiNumeri(fnum* nDeb, fnum* nCred, u32 nConto, > Data inizio, Data fine, Conto0* filiale, > FILE_m* FileStriscieP, FILE_m* FileStriscieOldP, > FILE_m* FilePuntatoriStriscieP, FILE_m* FileSaldiP) > {i32 n_elx[2], r, r0, r1, k, n_el, j, delta; > u32 dovefile; > i8 **pi, *p, *p1, *elencox[2], *elenco; > Striscia *s1, *s2; > Data dataP; > fnum saldo, t, v; > > if(nDeb==0||nCred==0||filiale==0) R 0; > *nDeb=0; *nCred=0; > if(inizio>fine||(fine-inizio)>370) R 0; > if(fine.anno<200) R 0; > r0=StriscieContoAnno(&elencox[0], &n_elx[0], nConto, fine.anno-1, > filiale, FileStriscieP, FileStriscieOldP, FilePuntatoriStriscieP); > if(r0==0) R 0; > r1=StriscieContoAnno(&elencox[1], &n_elx[1], nConto, fine.anno, > filiale, FileStriscieP, FileStriscieOldP, FilePuntatoriStriscieP); > if(r1==0){l0:; ZeroFree(elencox[0]); R 0;} > r0=n_elx[0]; if(r0< 0){l1:; ZeroFree(elencox[1]); G l0;} > r1=n_elx[1]; if(r1< 0) G l1; > r=r0+r1; if(r < 0) G l1; if(r+2<0) G l1; > if((k=(r+2)*sizeof(Striscia))<0) G l1; > p=(char*)Malloc_m(k); if(p==0) G l1; > p1=MemCat_m(p, elencox[0], r0*sizeof(Striscia)); > MemCat_m(p1, elencox[1], r1*sizeof(Striscia)); > elenco=p; n_el=r; > ZeroFree(elencox[0]); ZeroFree(elencox[1]); > pi= (i8**) Malloc_m((n_el+8)*sizeof(i8*)); > if(pi==0){l2:; ZeroFree(elenco); R 0;} > F(j=0; j<n_el; ++j) > pi[j]=elenco+j*sizeof(Striscia); > if(qsortPnt_m(pi, n_el, comparaStrisciaValuta)==0) > {l3:; ZeroFree(pi); G l2;} > > r=SaldoInData(&saldo, &dovefile, nConto, (inizio-1), > filiale, FileStriscieP, FileStriscieOldP, > FilePuntatoriStriscieP, FileSaldiP); > if(r==-1) G l3; > cout << "Saldo iniziale in data " << (inizio-1) << " : "; > StampaSaldo(stdout_m, saldo, globalPrecision); > P("\n"); > s2=0; > F(j=0, dataP=(inizio-1); j<n_el; ++j) > {s1=(Striscia*)pi[j]; > if(s1->DataValuta> fine) break; > if(s1->DataValuta>=inizio) > {if( DaCifraAfnum(&t, s1->imp)==0) G l3; > delta=(s1->DataValuta)-dataP; > dataP=(s1->DataValuta); > v=saldo*delta; > if(saldo>=0) *nCred+=v; > else *nDeb -=v; > cout << v << " "; > saldo=saldo+t; > s2=s1; > } > else if(s1->DataOperazione>=inizio) > {if( DaCifraAfnum(&t, s1->imp)==0) G l3; > saldo=saldo+t; > cout << saldo << "s "; > } > } > > if(s2!=0){delta=fine-(s2->DataValuta); > v=saldo*delta; > if(saldo>=0) *nCred+=v; > else *nDeb -=v; > } > > ZeroFree(pi); ZeroFree(elenco); > R 1; > } > > I'm sorry, but th structure (or lack of) plus obfuscation make me unwilling to look at what happens - maybe others are OK with it. Ciao! -- Nuns! Reverse!
From: io_x on 18 Dec 2009 16:15 "Esra Sdrawkcab" <admin(a)127.0.0.1> ha scritto nel messaggio news:op.u45desb6hswpfo(a)dell3100... > On Fri, 18 Dec 2009 12:48:50 -0000, io_x <a(a)b.c.invalid> wrote: > >> >> "io_x" <a(a)b.c.invalid> ha scritto nel messaggio >> news:4b2551e6$0$8861$4fafbaef(a)reader5.news.tin.it... >>> >>> #define F for >>> #define P printf >>> #define R return >>> #define G goto >>> >>> // ritorna 0 errore 1 tutto ok >>> int DaiNumeri(fnum* nDeb, fnum* nCred, u32 nConto, >> >> i find a little bug, but this would be ot (because it would be 1/2 C++ + 1/2 >> C) >> for find it i had manually done 21 bank operation for find that the error >> was in the last one; >> then it seems there is one error that signal itself only one time >> don't know how correct it >> >> int DaiNumeri(fnum* nDeb, fnum* nCred, u32 nConto, >> Data inizio, Data fine, Conto0* filiale, >> FILE_m* FileStriscieP, FILE_m* FileStriscieOldP, >> FILE_m* FilePuntatoriStriscieP, FILE_m* FileSaldiP) >> {i32 n_elx[2], r, r0, r1, k, n_el, j, delta; >> u32 dovefile; >> i8 **pi, *p, *p1, *elencox[2], *elenco; >> Striscia *s1, *s2; >> Data dataP; >> fnum saldo, t, v; >> >> if(nDeb==0||nCred==0||filiale==0) R 0; >> *nDeb=0; *nCred=0; >> if(inizio>fine||(fine-inizio)>370) R 0; here i say can not calculate nDeb and nCred for period > 1 year >> if(fine.anno<200) R 0; >> r0=StriscieContoAnno(&elencox[0], &n_elx[0], nConto, fine.anno-1, >> filiale, FileStriscieP, FileStriscieOldP, FilePuntatoriStriscieP); here i load in memory all the bank operations of nConto in the fine.anno-1 elencox[0], with n_operation in n_elx[0] >> if(r0==0) R 0; if some error exit >> r1=StriscieContoAnno(&elencox[1], &n_elx[1], nConto, fine.anno, >> filiale, FileStriscieP, FileStriscieOldP, FilePuntatoriStriscieP); >> if(r1==0){l0:; ZeroFree(elencox[0]); R 0;} here the same for the fine.anno >> r0=n_elx[0]; if(r0< 0){l1:; ZeroFree(elencox[1]); G l0;} >> r1=n_elx[1]; if(r1< 0) G l1; >> r=r0+r1; if(r < 0) G l1; if(r+2<0) G l1; >> if((k=(r+2)*sizeof(Striscia))<0) G l1; >> p=(char*)Malloc_m(k); if(p==0) G l1; >> p1=MemCat_m(p, elencox[0], r0*sizeof(Striscia)); >> MemCat_m(p1, elencox[1], r1*sizeof(Striscia)); here cat all the elemnts in one big memory pointed by p >> elenco=p; n_el=r; and total element are r==n_el >> ZeroFree(elencox[0]); ZeroFree(elencox[1]); here free the old pointers >> pi= (i8**) Malloc_m((n_el+8)*sizeof(i8*)); >> if(pi==0){l2:; ZeroFree(elenco); R 0;} >> F(j=0; j<n_el; ++j) >> pi[j]=elenco+j*sizeof(Striscia); here pi[j] point to operation j >> if(qsortPnt_m(pi, n_el, comparaStrisciaValuta)==0) >> {l3:; ZeroFree(pi); G l2;} here sort all the pi[j] pointers using "data Valuta" of the ioperation >> r=SaldoInData(&saldo, &dovefile, nConto, (inizio-1), >> filiale, FileStriscieP, FileStriscieOldP, >> FilePuntatoriStriscieP, FileSaldiP); here from one file with each year have the year "saldo" it find the start value >> if(r==-1) G l3; >> cout << "Saldo iniziale in data " << (inizio-1) << " : "; >> StampaSaldo(stdout_m, saldo, globalPrecision); >> P("\n"); print it this is below is how calculate from the inital "saldo" the "numeri creditori" and "numeri debitori" >> s2=0; >> F(j=0, dataP=(inizio-1); j<n_el; ++j) "inizio-1" is the day before "inizio" if for example inizio=="1/1/2009" inizio-1=="31/12/2008" >> {s1=(Striscia*)pi[j]; >> if(s1->DataValuta> fine) break; >> if(s1->DataValuta>=inizio) >> {if( DaCifraAfnum(&t, s1->imp)==0) G l3; >> delta=(s1->DataValuta)-dataP; >> dataP=(s1->DataValuta); >> v=saldo*delta; >> if(saldo>=0) *nCred+=v; >> else *nDeb -=v; >> cout << v << " "; >> saldo=saldo+t; >> s2=s1; >> } >> else if(s1->DataOperazione>=inizio) >> {if( DaCifraAfnum(&t, s1->imp)==0) G l3; >> saldo=saldo+t; >> cout << saldo << "s "; >> } >> } >> >> if(s2!=0){delta=fine-(s2->DataValuta); >> v=saldo*delta; >> if(saldo>=0) *nCred+=v; >> else *nDeb -=v; >> } this place is what i forget the last time >> ZeroFree(pi); ZeroFree(elenco); >> R 1; >> } >> >> > I'm sorry, but th structure (or lack of) plus obfuscation make me unwilling > to look at what happens - maybe others are OK with it. Ciao! easy > -- > Nuns! Reverse!
From: Nathan Baker on 18 Dec 2009 20:44 "io_x" <a(a)b.c.invalid> wrote in message news:4b2a9587$0$1120$4fafbaef(a)reader2.news.tin.it... > > "Nathan" <nathancbaker(a)gmail.com> ha scritto nel messaggio > news:aa554226-ea19-4c07-89bf-3a57b62fcf3a(a)f20g2000vbl.googlegroups.com... > On Dec 14, 4:52 am, "Esra Sdrawkcab" <ad...(a)127.0.0.1> wrote: >> >> It doesn't help that I don't know Italian, but more off-putting is the >> strange assembler syntax. >> > > It is an esoteric asm language. Perhaps it is best described as an > 'obfuscated' asm language? > > Nathan. > > it is 'obfuscated' for you > like some code people write could be 'obfuscated' for me > True. > things are easy but > people find many way to complicate them > > Also true. I recently wanted to become more knowledgable about the wierd Python language, so I quickly coded a Brainf**k interpreter. I can't think of anything more 'esoteric' or 'obfuscated' than Brainf**k. But after writing this interpreter, I can almost read Brainf**k code as easily as any other language. import sys mem = [] stk = [] comments = [] prg = '++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.' mptr = 0 x = 0 # set the following value to size of memory desired while x < 100: mem.append(0) x = x + 1 tkn = [] stk.append(0) y = 0 t = 0 while y < len(prg): c = prg[y] if c == '+': tkn.append(1) elif c == '-': tkn.append(2) elif c == '>': tkn.append(3) elif c == '<': tkn.append(4) elif c == '.': tkn.append(5) elif c == ',': tkn.append(6) elif c == '[': tkn.append(7) tkn.append(0) stk.append(t+1) t = t + 1 elif c == ']': tkn.append(8) bow = stk.pop() if bow == 0: raise SyntaxError, "Unmatched Brackets" tkn[bow] = t tkn.append(bow) t = t + 1 else: # collect comments comments.append(c) y = y + 1 t = t + 1 y = 0 while y < len(tkn): c = tkn[y] j = 0 if c == 1: j = mem[mptr] + 1 mem[mptr] = j elif c == 2: j = mem[mptr] - 1 mem[mptr] = j elif c == 3: if mptr == len(mem)-1: raise RangeError, "Memory wall reached" mptr = mptr + 1 elif c == 4: if mptr == 0: raise RangeError, "Memory wall reached" mptr = mptr - 1 elif c == 5: j = mem[mptr] sys.stdout.write(str(chr(j))) elif c == 6: s = sys.stdin.read(1) mem[mptr] = ord(s) elif c == 7: if mem[mptr] == 0: j = tkn[y + 1] y = j y = y + 1 elif c == 8: if mem[mptr] != 0: j = tkn[y + 1] y = j else: y = y + 1 y = y + 1 w = 0 # while w < len(mem): # print mem[w], # w = w + 1 # w = 0 # while w < len(tkn): # print tkn[w], # w = w + 1 Nathan.
First
|
Prev
|
Pages: 1 2 Prev: HOT NEWS FOR EVERYONE!!! Next: peter-bochs debugger released 20091214 version |