Login:
Pass:
Forgotten Pass?
Forums
Forum Home
Search
Today's Posts
Members List
Calendar




Search
Google
Search TBCS
Search the Web


Follow Us On




Go Back   TBCS Community Forums > Community Center > TBCS Challenges


Welcome to the TBCS Community Forums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.
Reply
 
Thread Tools
  #81  
Old 04-27-2008, 12:28 PM
Trace's Avatar
Trace Trace is offline
Posts: 2,059
Overclocking Guru
 
Trace knows almost everything about modding.Trace knows almost everything about modding.Trace knows almost everything about modding.Trace knows almost everything about modding.Trace knows almost everything about modding.Trace knows almost everything about modding.Trace knows almost everything about modding.Trace knows almost everything about modding.Trace knows almost everything about modding.Trace knows almost everything about modding.Trace knows almost everything about modding.
My System
Default Re: Counting

Can't wait!
__________________
Quote:
Originally Posted by Lothair View Post
I guess it's just widely used and has had some of the best people in the world work on it, costing a ridiculous amount of money, for no actual reason. :/
Have you checked out the front page lately?
Projects:
Moe's Tavern | Sponsored by: Mimo Monitors, Crucial, Thermaltake
Book Of Knowledge
Reply With Quote
  #82  
Old 04-27-2008, 02:19 PM
XcOM's Avatar
XcOM XcOM is offline
Posts: 2,931
Ceann na Drochaide Bige!
 
XcOM Modder SupremeXcOM Modder SupremeXcOM Modder SupremeXcOM Modder SupremeXcOM Modder SupremeXcOM Modder SupremeXcOM Modder SupremeXcOM Modder SupremeXcOM Modder SupremeXcOM Modder SupremeXcOM Modder Supreme
My System
Default Re: Counting

And the results are in, honstly im suppurised at them.

And helix, your app didn't have a counter and you didn't reply with a revision that did so, in efect your app does not have any scores becuase i couldn't get any.

__________________


Mary had a little lamb. It bumped into a pylon. Ten thousand volts went up its arse and turned its wool to nylon!
Reply With Quote
  #83  
Old 04-27-2008, 02:26 PM
XcOM's Avatar
XcOM XcOM is offline
Posts: 2,931
Ceann na Drochaide Bige!
 
XcOM Modder SupremeXcOM Modder SupremeXcOM Modder SupremeXcOM Modder SupremeXcOM Modder SupremeXcOM Modder SupremeXcOM Modder SupremeXcOM Modder SupremeXcOM Modder SupremeXcOM Modder SupremeXcOM Modder Supreme
My System
Default Re: Counting

its strange i think, VB has 2 out of 5 victorys and Java has 2 out of 5, and C++ has only 1 out of 5.

I was expecting C++ to wipe the floor with everything, but apperently not!
__________________


Mary had a little lamb. It bumped into a pylon. Ten thousand volts went up its arse and turned its wool to nylon!
Reply With Quote
  #84  
Old 04-27-2008, 02:38 PM
jdbnsn's Avatar
jdbnsn jdbnsn is offline
Posts: 8,050
iShot the Sheriff
 
jdbnsn has disabled reputation
My System
Default Re: Counting

so who won?
__________________
"At the midpoint on the journey of life, I found myself in a dark forest, for the clear path was lost..." -Dante Alighieri
Reply With Quote
  #85  
Old 04-27-2008, 03:04 PM
silverdemon's Avatar
silverdemon silverdemon is offline
Posts: 518
Water Cooled
 
silverdemon is a helpful and decent person.silverdemon is a helpful and decent person.silverdemon is a helpful and decent person.
My System
Default Re: Counting

Quote:
Originally Posted by jdbnsn View Post
so who won?
Yeah, who won?

I can see that VB (my program) wins in the shorter countings, but java (trace) takes over at the larger numbers. Also C++ (Mtekk) is quicker at those numbers.
It seems to me that both Java and C++ count faster, but the program takes a little time to initialize or somthing, since the lower numbers all take about 15-16ms...

Anyways, good job you all!
now: let's see the sources
Reply With Quote
  #86  
Old 04-27-2008, 03:20 PM
mtekk's Avatar
mtekk mtekk is offline
Posts: 469
Resident EE
 
mtekk knows almost everything about modding.mtekk knows almost everything about modding.mtekk knows almost everything about modding.mtekk knows almost everything about modding.mtekk knows almost everything about modding.mtekk knows almost everything about modding.mtekk knows almost everything about modding.
My System
Default Re: Counting

Quote:
Originally Posted by XcOM View Post
its strange i think, VB has 2 out of 5 victorys and Java has 2 out of 5, and C++ has only 1 out of 5.

I was expecting C++ to wipe the floor with everything, but apperently not!
In all reality, there are much faster ways of doing this in C++, but mine was the quickest to write, and kept with the STL. I wrote it in the middle of two weeks filled with midterms. Prince probably used vectors, but probably didn't do any preallocation which decreases performance (mine preallocated before counting). I think the timing method I used isn't necessarily the best either, it's resolution is a little low (has a resolution of 1ms).

I'd like to see the code silverdemon used. Mine is in the bottom of this post.

Just out of curiosity, did you do multiple runs and average them? And what system specs?

Here's my code
Code:
/*
John Havlik
4-18-2008
Count Benchmark
*/
#include <iostream>
#include <vector>
#include <fstream>
#include <ctime>
using namespace std;

int main()
{
	clock_t start, end, elapsed;
	vector dump;
	unsigned char foo;
	unsigned int count(1000000), temp(0);
	do
	{
		cout << "How many iterations do you want to do?\n";
		cin >> temp;
		count = ++temp;
		dump.assign(count, 0);
		start = clock();
		while(--count)
		{
			dump[count] = count;
		};
		end = clock();
		elapsed = end - start;
		cout << "For " << temp << " loops (count from 0 to " << temp - 1 << ")\n We took: " << elapsed << " ms \n Saving...";
		ofstream fout;
		fout.open("count.out");
		for(unsigned int i(0); i < temp; i++)
		{
			fout << dump[i] << endl;
		}
		fout.close();
		dump.clear();
		cout << " Done.\nWould you like to run again?(y/n)\n";
		cin >> foo; 
	}
	while(foo == 'y');
	return 0;
}
__________________
Quote:
Originally Posted by xRyokenx View Post
...I'm getting tired of not being able to figure this crap out because it's apparently made for computer-illiterate people by computer-illiterate people. lol
Reply With Quote
  #87  
Old 04-27-2008, 04:16 PM
Trace's Avatar
Trace Trace is offline
Posts: 2,059
Overclocking Guru
 
Trace knows almost everything about modding.Trace knows almost everything about modding.Trace knows almost everything about modding.Trace knows almost everything about modding.Trace knows almost everything about modding.Trace knows almost everything about modding.Trace knows almost everything about modding.Trace knows almost everything about modding.Trace knows almost everything about modding.Trace knows almost everything about modding.Trace knows almost everything about modding.
My System
Default Re: Counting

Well, who won?
My code is below.
I entered the second 1.

If you want my VB6 code let me know.(PM)

Java (with output):
Code:
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintStream;
import java.util.Scanner;
class Count2 
{
	
	public static void main(String args[]) throws FileNotFoundException 
	{
		Scanner input = new Scanner( System.in );
		PrintStream diskWriter = new PrintStream( "D:/java/numbers.txt" );
		System.out.print( "Enter number to count to: " );
		int countto = input.nextInt();
		int count = 0;
		long time = System.currentTimeMillis();
		while (count < countto)
		{
			count = count + 1;
			diskWriter.println( count );	
		}
		long timeTook = System.currentTimeMillis() - time;
		System.out.println("It took you "+timeTook+"ms to count to "+count);
	}
}
Java(without output):
Code:
import java.util.Scanner;

public class Count

{
	public static void main( String args[] )

	{
		Scanner input = new Scanner( System.in );
		System.out.print( "Enter number to count to: " );
		int countto = input.nextInt();
		int count = 0;
		long time = System.currentTimeMillis();
		
		while ( count < countto)
		{
			count = count + 1;
		}
		long timeTook = System.currentTimeMillis() - time;
		System.out.println("It took you "+timeTook+"ms to count to "+count);
	}
}
__________________
Quote:
Originally Posted by Lothair View Post
I guess it's just widely used and has had some of the best people in the world work on it, costing a ridiculous amount of money, for no actual reason. :/
Have you checked out the front page lately?
Projects:
Moe's Tavern | Sponsored by: Mimo Monitors, Crucial, Thermaltake
Book Of Knowledge
Reply With Quote
  #88  
Old 04-27-2008, 04:17 PM
mtekk's Avatar
mtekk mtekk is offline
Posts: 469
Resident EE
 
mtekk knows almost everything about modding.mtekk knows almost everything about modding.mtekk knows almost everything about modding.mtekk knows almost everything about modding.mtekk knows almost everything about modding.mtekk knows almost everything about modding.mtekk knows almost everything about modding.
My System
Default Re: Counting

Just for fun I opened up Mathematica and did some plots of the times. For the following plots, orange is Trace, blue is me (mtekk), red is Silverdemon, and green is Prince.

Here's Trace's Time vs. Count graph

Here's My Time vs. Count graph

Here's Silverdemon's Time vs. Count graph

Here's Prince's Time vs. Count graph

Here is a combined, graph on the common axis of Prince's plot.
__________________
Quote:
Originally Posted by xRyokenx View Post
...I'm getting tired of not being able to figure this crap out because it's apparently made for computer-illiterate people by computer-illiterate people. lol

Last edited by mtekk : 04-27-2008 at 04:29 PM. Reason: Fixed the combined plot
Reply With Quote
  #89  
Old 04-27-2008, 04:21 PM
mtekk's Avatar
mtekk mtekk is offline
Posts: 469
Resident EE
 
mtekk knows almost everything about modding.mtekk knows almost everything about modding.mtekk knows almost everything about modding.mtekk knows almost everything about modding.mtekk knows almost everything about modding.mtekk knows almost everything about modding.mtekk knows almost everything about modding.
My System
Default Re: Counting

Quote:
Originally Posted by Trace View Post
Well, who won?
My code is below.
I entered the second 1.

If you want my VB6 code let me know.(PM)
Err, that second one isn't actually storing the count. Unless I'm missing something
__________________
Quote:
Originally Posted by xRyokenx View Post
...I'm getting tired of not being able to figure this crap out because it's apparently made for computer-illiterate people by computer-illiterate people. lol
Reply With Quote
  #90  
Old 04-27-2008, 04:34 PM
Trace's Avatar
Trace Trace is offline
Posts: 2,059
Overclocking Guru
 
Trace knows almost everything about modding.Trace knows almost everything about modding.Trace knows almost everything about modding.Trace knows almost everything about modding.Trace knows almost everything about modding.Trace knows almost everything about modding.Trace knows almost everything about modding.Trace knows almost everything about modding.Trace knows almost everything about modding.Trace knows almost everything about modding.Trace knows almost everything about modding.
My System
Default Re: Counting

Wait, I think that's the one I entered. I'm not completely sure actually.
__________________
Quote:
Originally Posted by Lothair View Post
I guess it's just widely used and has had some of the best people in the world work on it, costing a ridiculous amount of money, for no actual reason. :/
Have you checked out the front page lately?
Projects:
Moe's Tavern | Sponsored by: Mimo Monitors, Crucial, Thermaltake
Book Of Knowledge
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is On
Forum Jump

Translate This Page

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
thebestcasescenario.com