Search Results

Showing results 1 to 9 of 9
Search took 0.01 seconds.
Search: Posts Made By: prime1999
Forum: Computer Science Jul 26th, 2009
Replies: 4
Views: 494
Posted By prime1999
I doubt it can be done with the command-line, but it could be done with the WSH, which comes preinstalled.

var fso,a,s,d,f,t,t0,t1;
var dr;
dr='c:\\mydocu~1\\test';
fso=new...
Forum: Computer Science Jul 26th, 2009
Replies: 12
Views: 1,140
Posted By prime1999
But obviously going through numbers from 0 to 2^n would exceed time limit way before it exceeds the limit of a long int.
Forum: JavaScript / DHTML / AJAX Jul 17th, 2009
Replies: 4
Views: 440
Posted By prime1999
You could look at this:
http://en.wikipedia.org/wiki/XMLHTTP#caching
Forum: Computer Science Jul 17th, 2009
Replies: 2
Views: 554
Posted By prime1999
The equation you gave, if the first term is corrected to t(k), should give a complexity of O(nk log k). Another algorithm that could do this was to use a heap -- it was so that you could get the...
Forum: Computer Science Jul 17th, 2009
Replies: 12
Views: 1,140
Posted By prime1999
At least for n<30 bits (which is probably near the maximum on one fast processor), you could just have a for loop from 0 to 2^n and get the binary representation for each number.
Forum: C++ Jul 6th, 2009
Replies: 8
Views: 951
Posted By prime1999
Look at post #3... the original poster seems to want to truncate the float to 1 dp.

And please close your code tag properly!
Forum: C++ Jul 4th, 2009
Replies: 11
Views: 344
Posted By prime1999
It will only do this forever: output "x=.." and input a number
Forum: C++ Jul 4th, 2009
Replies: 8
Views: 951
Posted By prime1999
Yeah I didn't realise your "caveat" that negative values would be truncated wrongly... but if you want an easier way other than if loops:

// #include<cmath>
float t=31.4592,x;
modf(t*10,&x);...
Forum: C++ Jul 4th, 2009
Replies: 8
Views: 951
Posted By prime1999
You could do this:

// #include<cstring>
float t=31.4592;
char num[100];
sprintf(num,"%f",t);
p=strchr(num,'.');
if( p!=NULL ) num[p-num+2]=0;
printf("%s\n",num);
Showing results 1 to 9 of 9

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC