This could win stupid question of the year... but where do I get timeseal for the mac and for my raspberry pi??
The best I could turn up was here:
https://www.unix-ag.uni-kl.de/~chess/soft/timeseal/
But these are very old - and tbh I've no idea which is applicable.
Freechess.org say to use their ftp.freechess.org, but it doesn't seem to be active.
Where do people get it?
Thanks!
Timeseal
Moderators: hgm, Rebel, chrisw
-
- Posts: 20943
- Joined: Mon Feb 27, 2006 7:30 pm
- Location: Birmingham, AL
Re: Timeseal
Send me an email, I can send you one that will work on linux and one for OS X.Richard Allbert wrote:This could win stupid question of the year... but where do I get timeseal for the mac and for my raspberry pi??
The best I could turn up was here:
https://www.unix-ag.uni-kl.de/~chess/soft/timeseal/
But these are very old - and tbh I've no idea which is applicable.
Freechess.org say to use their ftp.freechess.org, but it doesn't seem to be active.
Where do people get it?
Thanks!
-
- Posts: 792
- Joined: Wed Jul 19, 2006 9:58 am
-
- Posts: 433
- Joined: Fri Jan 16, 2015 4:02 pm
Re: Timeseal
I use this one to connect zurichess to fics http://www.bergo.eng.br/chess/openseal.c
zurichess - http://www.zurichess.xyz
-
- Posts: 792
- Joined: Wed Jul 19, 2006 9:58 am
Re: Timeseal
Thanks to you alsobrtzsnr wrote:I use this one to connect zurichess to fics http://www.bergo.eng.br/chess/openseal.c
Thank goodness or forums...
-
- Posts: 12541
- Joined: Wed Mar 08, 2006 8:57 pm
- Location: Redmond, WA USA
Re: Timeseal
It's broken.
From the C-FAQ:
Notice:
From the C-FAQ:
Code: Select all
3.3b: Here's a slick expression:
a ^= b ^= a ^= b
It swaps a and b without using a temporary.
A: Not portably, it doesn't. It attempts to modify the variable a
twice between sequence points, so its behavior is undefined.
For example, it has been reported that when given the code
int a = 123, b = 7654;
a ^= b ^= a ^= b;
the SCO Optimizing C compiler (icc) sets b to 123 and a to 0.
See also questions 3.1, 3.8, 10.3, and 20.15c.
Code: Select all
#define SC(A,B) s[B]^=s[A]^=s[B],s[A]^=s[B]
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
-
- Posts: 690
- Joined: Mon Apr 19, 2010 7:07 pm
- Location: Sweden
- Full name: Peter Osterlund
Re: Timeseal
I don't think that is broken, as long as you don't invoke the macro with A==B. Notice the comma in the #define. The comma operator introduces a sequence point.Dann Corbit wrote:It's broken.
From the C-FAQ:Notice:Code: Select all
3.3b: Here's a slick expression: a ^= b ^= a ^= b It swaps a and b without using a temporary. A: Not portably, it doesn't. It attempts to modify the variable a twice between sequence points, so its behavior is undefined. For example, it has been reported that when given the code int a = 123, b = 7654; a ^= b ^= a ^= b; the SCO Optimizing C compiler (icc) sets b to 123 and a to 0. See also questions 3.1, 3.8, 10.3, and 20.15c.
Code: Select all
#define SC(A,B) s[B]^=s[A]^=s[B],s[A]^=s[B]
-
- Posts: 2559
- Joined: Fri Nov 26, 2010 2:00 pm
- Location: Czech Republic
- Full name: Martin Sedlak
Re: Timeseal
I don't see the need to do xor-swap either, compilers will use a register anyway, so the only cool thing about xor-swap is that it obfuscates code.Dann Corbit wrote:Code: Select all
#define SC(A,B) s[B]^=s[A]^=s[B],s[A]^=s[B]
Not to mention that this trick won't work with floats.
-
- Posts: 12541
- Joined: Wed Mar 08, 2006 8:57 pm
- Location: Redmond, WA USA
Re: Timeseal
As Peter points out, it is not (strictly speaking) illegal.mar wrote:I don't see the need to do xor-swap either, compilers will use a register anyway, so the only cool thing about xor-swap is that it obfuscates code.Dann Corbit wrote:Code: Select all
#define SC(A,B) s[B]^=s[A]^=s[B],s[A]^=s[B]
Not to mention that this trick won't work with floats.
It is clear from the code that it is never called with A==B as the XOR inputs, so it probably also created correct results.
The fact that the macro is not typesafe also does not matter, since it is only used with integer arguments in the function.
But I am with you -- a simple swap using a temp would have been more clear and therefore better. It's not like we will produce wrong timing results if we lose 10 cycles.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
-
- Posts: 2559
- Joined: Fri Nov 26, 2010 2:00 pm
- Location: Czech Republic
- Full name: Martin Sedlak
Re: Timeseal
xor trick works even if A==B:Dann Corbit wrote:It is clear from the code that it is never called with A==B as the XOR inputs, so it probably also created correct results.
assume a=44, b=44:
Code: Select all
a ^= b (a = 0, b = 44)
b ^= a (a = 0, b = 44)
a ^= b (a = 44, b= 44)