Not so long ago we argued about programming languages and IDEs. As expected several worlds collide. So maybe there is no answer to the question what’s best, but I want to draw your attention to a nice IDE.
I needed a platform-independent and comfortable tool for programming. One would say “Use Eclipse” but my past with Java and Eclipse was bad. Or one would say “Use Emacs or Vim, stupid”, true but Linux tools on Windows mostly are pain in the ass. What I finally found was Code::Blocks, available for Linux, Windows and MAC. It’s a nice, fast and in my opinion mighty IDE for C and C++ (other languages via plugins). It needs a bit time to get familiar with it but there are very powerful features making this worthwhile. I don’t want to waste your time anny longer so try by your own.
Little hint: the version receivable from the last Ubuntu LTS is ooooold so download debs from the website.

URL: www.codeblocks.org
Not so long ago we argued about programming languages and IDEs. As expected several worlds collide. So maybe there is no answer to the question what's best, but I want to draw your attention to a nice IDE.
I needed a platform-independent and comfortable tool for programming. One would say "Use Eclipse" but my past with Java and Eclipse was bad. Or one would say "Use Emacs or Vim, stupid", true but Linux tools on Windows mostly are pain in the ass. What I finally found was Code::Blocks, available for Linux, Windows and MAC. It's a nice, fast and in my opinion mighty IDE for C and C++ (other languages via plugins). It needs a bit time to get familiar with it but there are very powerful features making this worthwhile. I don't want to waste your time anny longer so try by your own.
Little hint: the version receivable from the last Ubuntu LTS is ooooold so download debs from the website.
URL: www.codeblocks.org
November 15th, 2011
robin
From http://www.esm.psu.edu/~ajm138/fortranexamples.html:
C programmers love to gloat that recursion can not be done in Fortran. When they say Fortran, they mean FORTRAN 77, since they absolutely refuse to acknowledge the existence of modern Fortran 90. (Fortran 90 came out over ten years ago. You would think they might know something about it by now!) But this example shows that even in FORTRAN 77 one can quickly and easily write routines that are recursive. So stick that in your complex variables, C programmers, and — oh wait, I forgot there are no complex variables in C. You have to manually define a complex data type. Not to mention having to write math functions like sin( ) and cos( ) to handle such data types.
Hahaaa … love it!
From http://www.esm.psu.edu/~ajm138/fortranexamples.html:
C programmers love to gloat that recursion can not be done in Fortran. When they say Fortran, they mean FORTRAN 77, since they absolutely refuse to acknowledge the existence of modern Fortran 90. (Fortran 90 came out over ten years ago. You would think they might know something about it by now!) But this example shows that even in FORTRAN 77 one can quickly and easily write routines that are recursive. So stick that in your complex variables, C programmers, and -- oh wait, I forgot there are no complex variables in C. You have to manually define a complex data type. Not to mention having to write math functions like sin( ) and cos( ) to handle such data types.
Hahaaa ... love it!
int m=167772161,N=1,t[1< <25]={2},a,*p,i,e=34893349,s,c,U=1;g(d,h){for(i=s;i<1<<
24;i*=2)d=d*1LL*d%m;for(p=t;p<t+N;p+=s)for(i=s,c=1;i;i--)a=p[s]*(h?c:1LL)%m,p[s]
=(m+*p-a)*(h?1LL:c)%m,a+=*p,*p++=a%m,c=c*1LL*d%m;}main(){while(e/=2){N*=2;U=U*
1LL*(m+1)/2%m;for(s=N;s/=2;)g(17,0);for(p=t;p<t+N;p++)*p=*p*1LL**p%m*U%m;for(s=1
;s<N;s*=2)g(29606852,1);for(a=0,p=t;p<t+N;)a+=*p<<(e&1),*p++=a%10,a/=10;}while(!
*--p);for(t[0]--;p>=t;)putchar(48+*p--);}
It is definitely not my code
. . . any guesses??
[update1]
As there were some offline discussions, here the original file as a download: Download File
[update2]
This is were I most probably got the code from: http://bellard.org/mersenne.html
int m=167772161,N=1,t[1< <25]={2},a,*p,i,e=34893349,s,c,U=1;g(d,h){for(i=s;i<1
Ich bin heut bei der Arbeit auf einen netten Codeabschnitt gestoßen, in Datei A stand:
osm_port_t *port = cl_item_obj(item, port, list_item);
So weit so gut, nur was ist dieses ‘list_item’? In der Funktion und in der Datei ist es zumindest nicht enthalten, also mal grep -R
In Datei B hab ich dann diesen Spaß gefunden:
#define cl_item_obj(item_ptr, obj_ptr, item_field) (typeof(obj_ptr)) \
((void *)item_ptr - (unsigned long)&((typeof(obj_ptr))0)->item_field)
Ok, vollsten Respekt vor dem Schreiber für seinen Hack, den ich immer noch nicht verstanden hab. Ist aber auch nicht ganz so wichtig, zumal wenn ich ihn verstehen würde, würde ich ihn nicht mehr so toll finden
ABER: wie zur Hölle kann man so was undokumentiert lassen!? (nix, nada, no comment)
PS: wer noch wissen will woher das stammt, aus dem SubnetManager von InfiniBand (open-source wohlgemerkt)
Ich bin heut bei der Arbeit auf einen netten Codeabschnitt gestoßen, in Datei A stand:
osm_port_t *port = cl_item_obj(item, port, list_item);
So weit so gut, nur was ist dieses 'list_item'? In der Funktion und in der Datei ist es zumindest nicht enthalten, also mal grep -R ;)
In Datei B hab ich dann diesen Spaß gefunden:
#define cl_item_obj(item_ptr, obj_ptr, item_field) (typeof(obj_ptr)) \
((void *)item_ptr - (unsigned long)&((typeof(obj_ptr))0)->item_field)
Ok, vollsten Respekt vor dem Schreiber für seinen Hack, den ich immer noch nicht verstanden hab. Ist aber auch nicht ganz so wichtig, zumal wenn ich ihn verstehen würde, würde ich ihn nicht mehr so toll finden ;)
ABER: wie zur Hölle kann man so was undokumentiert lassen!? (nix, nada, no comment)
PS: wer noch wissen will woher das stammt, aus dem SubnetManager von InfiniBand (open-source wohlgemerkt)
Recent Comments