That's what I use to help me figure things out. May not help, but it's a good reference on it all the same.
WshShell.Run("[ your command line ]", 0)If you need to pass parameters you can pass them to the VBS and then build the command line string from within the script.
int numFirst, numSecond;Random generator = new Random();numFirst = generator.nextInt(10);numSecond = generator.nextInt(9);if( numSecond >= numFirst ) numSecond++;... so there's always an equal chance for numSecond to generate every value from 0-9 except the one picked for numFirst. But it bothers me what awful principles are being taught in these classes. >.<
public static int countBits(int i){ i -= ( (i >>> 1) & 0x55555555 ); i = (i & 0x33333333) + ( (i >>> 2) & 0x33333333 ); return (((i + (i >>> 4)) & 0x0F0F0F0F) * 0x01010101) >>> 24;}
a & (b-1);Where a is some integer and b is a power of 2.
'Before/after comparison of programmer thinking patterns."Before" represents the mind of an underdeveloped programmer."After" represents the mind of a mature software engineer.Before:x = y % 32;x = y * 8;x = y / w + z / w;if( a==b &&c==d &&e==f ) {...}if( (x &1) || (x &4) ) {...}if( x&--#62;=0 &&x&--#60;8 &&y&--#62;=0 &&y&--#60;8 ) {...}if( (x==1) || (x==2) ||(x==4) || (x==8) || ... )if( (x==2) || (x==3) || (x==5) ||(x==7) || (x==11) || (x==13) ||(x==17) || (x==19) ) {...}#define abs(x) (((x)&--#62;0)?(x):-(x))int a[3][3][3];int b[3][3][3];...for(i=0;i&--#60;3;i++)for(j=0;j&--#60;3;j++)for(k=0;k&--#60;3;k++)b[i][j][k] = a[i][j][k];for(i=0;i&--#60;3;i++)for(j=0;j&--#60;3;j++)for(k=0;k&--#60;3;k++)a[i][j][k] = 0;for(x=0;x&--#60;100;x++) {printf("%d\n",(int)(sqrt(x)));}unsigned int x, y, a;...a = (x + y) &--#62;&--#62;1;/* overflow fixup */if( a &--#60;x &&a &--#60;y ) a += 0x8000000;c:\&--#62;tc myprog.cuser% cc myprog.cUse the quicksort algorithm.Use the Bresenham line algorithm.Look through school notes for ideas.Ignore suggestions from others.Code, code, code, code ...After:x = y &31;x = y &--#60;&--#60;3;x = (y + z) / w;if( ((a-|(c-d)|(e-f))==0 ) {...}if( x & 5 ) {...}if( ((unsigned)(x|y))&--#60;8 ) {...}if( x&(x-1)==0 &&x!=0 )if( (1&--#60;&--#60;x) & ((1&--#60;&--#60;2)|(1&--#60;&--#60;3)|(1&--#60;&--#60;5)|(1&--#60;&--#60;7) \|(1&--#60;&--#60;11)|(1&--#60;&--#60;13)|(1&--#60;&--#60;17)|(1&--#60;&--#60;19)) ) {...}static long abs(long x) {long y;y = x&--#62;&--#62;31; /* Not portable */return (x^y)-y;}typedef struct {int element[3][3][3];} Three3DType;Three3DType a,b;...b = a;memset(a,0,sizeof(a));for(tx=1,sx=0,x=0;x&--#60;100;x++) {if( tx&--#60;=x ) {tx+=2*sx+3;sx++;}printf("%d\n",sx);}unsigned int x, y, a;...a = (x & y) + ((x ^ y)&--#62;&--#62;1);c:\&--#62;wpp386 /6r/otexan myprog.cuser% gcc -O3 myprog.cUse radix, intro or heap(!) sort.Use fixed point DDA line algorithm.Get examples from USENET/WEB/FTPGet suggestions but be skeptical.Think, code, think, code ...
booleanVar = (booleanVar==false);Because booleanVar==false will return true when booleanVar is false, booleanVar will be set to true when booleanVar is false and vice versa.
public static boolean toggle(boolean a){ a = (a == false); return a;}Works fine in Java /tongue.png' class='bbc_emoticon' alt=':P' />