Search found 66 matches

by beloni
Fri Dec 11, 2009 10:12 pm
Forum: Off topic (General chit-chat)
Topic: Who will win the World Cup?
Replies: 53
Views: 127077

Re: Who will win the World Cup?

Well, I was wrong. This is football.
by beloni
Thu Jun 18, 2009 5:01 pm
Forum: Off topic (General chit-chat)
Topic: Who will win the World Cup?
Replies: 53
Views: 127077

Re: Who will win the World Cup?

Hello, Just to restart the discussion, as we have seen in the previous editions, the Confederations Cup winner did not won the World Cup, however, I bet for Spain to win both tournaments. Football is a complex game (and so why it is awesome), everything can happen in a game. Today Brazil can beat so...
by beloni
Thu May 28, 2009 5:09 pm
Forum: C
Topic: compare and swap
Replies: 3
Views: 4458

Re: compare and swap

Thanks, man I've found one CAS implemetation on the file /usr/include/asm/system.h of old slackware 10.2 kernel 2.4.31 and it did works. So I just copy it to my project and voilà. Here is the CAS code that worked well for me: #ifndef CAS_H #define CAS_H #define LOCK_PREFIX "lock ; " struct __xchg_du...
by beloni
Thu May 28, 2009 5:02 pm
Forum: C
Topic: work-stealing deques
Replies: 0
Views: 2578

work-stealing deques

Hi there,
I'm here to find some implementation of work-stealing deques without using locks. If anyone of you got one please post it here. It will help me a lot.
by beloni
Fri Oct 10, 2008 3:45 pm
Forum: C
Topic: compare and swap
Replies: 3
Views: 4458

compare and swap

Hello,
is there some kind of compare and swap function or macro available in GNU gcc for linux?
I'm trying to implement a lock-free work-stealing queue...

Thanks
by beloni
Mon Apr 02, 2007 4:40 pm
Forum: Algorithms
Topic: Maximum distinguished ones
Replies: 0
Views: 1368

Maximum distinguished ones

Hello,
Have you heard about Maximum distinguished ones?
Can you give some URL, explain or algorithm for that?

Thank you
by beloni
Fri Mar 09, 2007 2:21 pm
Forum: Algorithms
Topic: fill polygon
Replies: 3
Views: 1998

I am sorry. This code was from my friend and it was wrote in Portuguese, so I translated it to English for post here, but as you could see, I forgot some functions... The message "overflows the recurse stack" does not occurs, but the program craches... My friend did use TurboC, so he paints just lit...
by beloni
Thu Mar 08, 2007 7:06 pm
Forum: Volume 1 (100-199)
Topic: 156 - Ananagrams
Replies: 30
Views: 3499

Thanks, did works and I got AC! For those who want help, my ACed code outputs: beloni@hopcroft:~/programming/judge/ananagram_156_0$ cat ananagram.in2 A a a A a a B B B C Hello HELLO Hi REpLy ladder came tape soon leader acme RIDE lone Dreis peat ScAlE orb eye Rides dealer NotE derail LaCeS drIed noe...
by beloni
Thu Mar 08, 2007 7:03 pm
Forum: Algorithms
Topic: fill polygon
Replies: 3
Views: 1998

fill polygon

Hello, I need some help to fill any polygon (concave or convex). The function must receive one point (x,y) inside the shape. I've tried the recurse solution: void fillpoly(int x, int y, int color) { putpixel(x,y,color); if (getpixel(x-1,y) == BLACK) fillpoly(x-1,y,color); if (getpixel(x+1,y) == BLAC...
by beloni
Wed Feb 21, 2007 1:06 pm
Forum: Volume 1 (100-199)
Topic: 156 - Ananagrams
Replies: 30
Views: 3499

Hello,

Can I read the input for this problem this way?

Code: Select all

char dic[MAX_DIC][MAX_DIC];
while(true)
	{
		cin >> dic[i];
		if( dic[i][0] == '#' )
			break;
		else
			i++;
	}
If no, why? Thanks.
by beloni
Wed Dec 06, 2006 6:32 pm
Forum: C++
Topic: friend function from a namespace
Replies: 2
Views: 1614

thanks, but I know that and I used #ifndef, #define and #endif in my codes, I just have cut out it to simplify my examples...
by beloni
Mon Dec 04, 2006 1:16 pm
Forum: C++
Topic: friend function from a namespace
Replies: 2
Views: 1614

friend function from a namespace

hello, I want a friend function void set_prob( Combinadic &comb ) to be friend of a class Combinadic . but class Combinadic is splited in two files (combinadic.h and combinadic.cpp). set_prob is extern on a namespace in other file (wildcat.h) and must be implemented in file probability.cpp. it must ...
by beloni
Thu Nov 30, 2006 5:30 pm
Forum: Volume 101 (10100-10199)
Topic: 10194 - Football (aka Soccer)
Replies: 119
Views: 36631

so can you help me?
by beloni
Tue Nov 21, 2006 10:42 pm
Forum: Volume 101 (10100-10199)
Topic: 10194 - Football (aka Soccer)
Replies: 119
Views: 36631

ok, I've submitted my code with some modifications: int str_nocase_cmp( const char *a, const char *b ) { int i(0); while( a[i] && b[i] ) { if( a[i] >= 'a' && a[i] <= 'z' && b[i] >= 'A' && b[i] <= 'Z' ) { if( (a[i]-32) > b[i] ) return 1; else if( (a[i]-32) < b[i] ) return -1; else i++; } else if ( a[...
by beloni
Tue Nov 21, 2006 3:00 pm
Forum: Volume 101 (10100-10199)
Topic: 10194 - Football (aka Soccer)
Replies: 119
Views: 36631

thanks, so
should I implement some function like str_insensitive_case_cmp?

Go to advanced search