Jump to page: 1 216  
Page
Thread overview
A little of coordination for Rosettacode
Feb 04, 2013
bearophile
Feb 05, 2013
Jos van Uden
Feb 05, 2013
bearophile
Feb 05, 2013
Jos van Uden
Feb 05, 2013
bearophile
Feb 16, 2013
Jos van Uden
Feb 16, 2013
bearophile
Feb 16, 2013
bearophile
Feb 16, 2013
bearophile
Feb 16, 2013
Jos van Uden
Feb 16, 2013
bearophile
Feb 16, 2013
bearophile
Feb 16, 2013
Jos van Uden
Feb 16, 2013
bearophile
Feb 16, 2013
bearophile
Feb 16, 2013
bearophile
Feb 16, 2013
bearophile
Feb 16, 2013
Jos van Uden
Feb 16, 2013
bearophile
Feb 16, 2013
bearophile
Feb 16, 2013
Jos van Uden
Feb 16, 2013
bearophile
Feb 17, 2013
Jos van Uden
Feb 17, 2013
bearophile
Feb 17, 2013
bearophile
Feb 09, 2013
SomeDude
Feb 10, 2013
Jos van Uden
Feb 10, 2013
bearophile
Feb 12, 2013
Jos van Uden
Feb 12, 2013
bearophile
Jul 31, 2014
safety0ff
Jul 31, 2014
bearophile
Aug 07, 2014
safety0ff
Aug 14, 2014
bearophile
Ping qznc: Re: A little of coordination for Rosettacode
Feb 16, 2013
Jos van Uden
Feb 16, 2013
qznc
Feb 16, 2013
qznc
Feb 16, 2013
monarch_dodra
Feb 16, 2013
bearophile
Re: A little of coordination for Rosettacode
Feb 19, 2013
Jos van Uden
Feb 19, 2013
bearophile
Feb 22, 2013
Jos van Uden
Feb 22, 2013
bearophile
Feb 16, 2013
Jos van Uden
Jun 22, 2013
Brian Rogoff
Jun 22, 2013
bearophile
Jun 22, 2013
Ali Çehreli
Jun 22, 2013
bearophile
Jun 22, 2013
bearophile
Jun 24, 2013
Brian Rogoff
Jul 03, 2013
Marco Leise
Feb 12, 2013
ixid
Feb 12, 2013
bearophile
Feb 12, 2013
ixid
Feb 12, 2013
bearophile
Feb 13, 2013
bearophile
Feb 25, 2013
bearophile
Feb 25, 2013
Jos van Uden
Feb 26, 2013
bearophile
Feb 26, 2013
Jos van Uden
Feb 26, 2013
bearophile
Feb 26, 2013
bearophile
Feb 26, 2013
bearophile
Feb 26, 2013
Jos van Uden
Feb 27, 2013
FG
Feb 27, 2013
FG
Feb 27, 2013
bearophile
Feb 28, 2013
bearophile
Mar 04, 2013
bearophile
Mar 04, 2013
Jos van Uden
Mar 05, 2013
Jos van Uden
Mar 05, 2013
bearophile
Mar 05, 2013
bearophile
Mar 05, 2013
Jos van Uden
Mar 05, 2013
bearophile
Mar 05, 2013
bearophile
Mar 05, 2013
Jos van Uden
Mar 05, 2013
Jos van Uden
Mar 05, 2013
bearophile
Mar 05, 2013
Jos van Uden
Mar 19, 2013
ixid
Mar 19, 2013
Andrea Fontana
Mar 19, 2013
ixid
Mar 19, 2013
bearophile
Mar 19, 2013
ixid
Mar 19, 2013
bearophile
Mar 19, 2013
bearophile
Mar 20, 2013
ixid
Mar 20, 2013
bearophile
Mar 24, 2013
bearophile
Mar 24, 2013
bearophile
Mar 24, 2013
bearophile
Mar 24, 2013
Jos van Uden
Mar 24, 2013
bearophile
Mar 24, 2013
bearophile
Mar 26, 2013
bearophile
Mar 27, 2013
Jos van Uden
Mar 27, 2013
Jos van Uden
Mar 27, 2013
bearophile
Apr 05, 2013
bearophile
Apr 05, 2013
Jos van Uden
Apr 05, 2013
bearophile
Apr 06, 2013
bearophile
Apr 18, 2013
bearophile
Jun 13, 2013
bearophile
Jun 14, 2013
bearophile
Jun 14, 2013
Adam D. Ruppe
Jun 14, 2013
bearophile
Jun 15, 2013
Adam D. Ruppe
Jun 15, 2013
bearophile
Jun 16, 2013
Adam D. Ruppe
Jun 16, 2013
bearophile
Jun 16, 2013
Adam D. Ruppe
Jun 18, 2013
bearophile
Jun 18, 2013
Simen Kjaeraas
Jun 18, 2013
bearophile
Jun 18, 2013
Adam D. Ruppe
Jun 18, 2013
bearophile
Jun 23, 2013
bearophile
Jul 16, 2013
bearophile
Jul 17, 2013
bearophile
Jul 17, 2013
bearophile
Jul 17, 2013
bearophile
Jul 21, 2013
bearophile
Jul 25, 2013
bearophile
Jul 25, 2013
bearophile
Aug 31, 2013
bearophile
Aug 31, 2013
maarten van damme
Aug 31, 2013
Jos van Uden
Aug 31, 2013
bearophile
Aug 31, 2013
Adam D. Ruppe
Nov 25, 2013
bearophile
Jan 15, 2014
qznc
Jan 16, 2014
bearophile
Jan 16, 2014
bearophile
Jan 16, 2014
bearophile
Jan 16, 2014
Brad Roberts
Jan 16, 2014
bearophile
Jan 16, 2014
Brad Roberts
Jan 16, 2014
bearophile
Jan 16, 2014
qznc
Jan 16, 2014
bearophile
Jan 16, 2014
bearophile
Jan 16, 2014
bearophile
Feb 25, 2014
bearophile
Feb 26, 2014
Ali Çehreli
Feb 26, 2014
bearophile
Feb 26, 2014
Stanislav Blinov
Feb 26, 2014
Stanislav Blinov
Feb 26, 2014
bearophile
Feb 26, 2014
Stanislav Blinov
Feb 26, 2014
Ali Çehreli
Feb 26, 2014
Ali Çehreli
Feb 26, 2014
bearophile
Feb 26, 2014
Ali Çehreli
Feb 26, 2014
Stanislav Blinov
Feb 26, 2014
bearophile
Feb 26, 2014
Stanislav Blinov
February 04, 2013
Is the Fwend user of Rosettacode (or some other interested person) around here? I have written partial D implementations for three tasks, maybe a little of coordination will speedup the work:

http://rosettacode.org/wiki/Permutations/Rank_of_a_permutation
http://rosettacode.org/wiki/Universal_Turing_machine
http://rosettacode.org/wiki/RCRPG

Bye,
bearophile
February 05, 2013
On 5-2-2013 0:55, bearophile wrote:
> Is the Fwend user of Rosettacode (or some other interested person) around here? I have written partial D implementations
>for three tasks, maybe a little of coordination will speedup the work:
>
> http://rosettacode.org/wiki/Permutations/Rank_of_a_permutation
> http://rosettacode.org/wiki/Universal_Turing_machine


> http://rosettacode.org/wiki/RCRPG

I'll give it a shot if you like. The RCRPG I'd like to try first.

By the way, I think 'Qznc' may want to have a look at 'The dining
philosophers':

http://rosettacode.org/wiki/Dining_philosophers





February 05, 2013
Jos van Uden:

> I'll give it a shot if you like. The RCRPG I'd like to try first.

I have already partially written those:

Partial translation of rcrpg-Python:
http://codepad.org/SflrKqbT

Partial translation of permutations_rank_of_a_permutation-Python:
http://codepad.org/El9SQwOE
Plus a better Perl implementation of the uniform() on BigInts:
http://codepad.org/LGcMpk2f

Partial translation of the universal_turing_machine-Ruby:
http://codepad.org/nUXLzAg2

Bye,
bearophile
February 05, 2013
On 5-2-2013 21:10, bearophile wrote:

How do we avoid working on the same thing?

> Partial translation of rcrpg-Python:
> http://codepad.org/SflrKqbT
>
> Partial translation of permutations_rank_of_a_permutation-Python:
> http://codepad.org/El9SQwOE

The 2 above, I could try.

> Plus a better Perl implementation of the uniform() on BigInts:
> http://codepad.org/LGcMpk2f

My perl is too rusty.
 
> Partial translation of the universal_turing_machine-Ruby:
> http://codepad.org/nUXLzAg2

I'd have to first read up on the subject.

> Bye,
> bearophile

February 05, 2013
Jos van Uden:

> How do we avoid working on the same thing?

With a little coordination :-)


>> Partial translation of rcrpg-Python:
>> http://codepad.org/SflrKqbT
>>
>> Partial translation of permutations_rank_of_a_permutation-Python:
>> http://codepad.org/El9SQwOE
>
> The 2 above, I could try.
>
>> Plus a better Perl implementation of the uniform() on BigInts:
>> http://codepad.org/LGcMpk2f
>
> My perl is too rusty.

That perl is meant as a part of permutations_rank_of_a_permutation. Feel free to search for other good algorithms to implement uniform(BigInt,BigInt) much better than me. If this code comes out good enough, it must be added to Phobos (and it's meant to be designed better than the Java uniform generator for its bigintegers, because it doesn't give a correct range).


>> Partial translation of the universal_turing_machine-Ruby:
>> http://codepad.org/nUXLzAg2
>
> I'd have to first read up on the subject.

It's a simple task, just to implement an universal Turing machine. It's a matter of finding a balance between the too much high level Ruby version and a too much C-like version.
In D a simple way to implement a tape is with two dynamic arrays, one represents all the cells on the right to the starting position, and the other array is used "inverted", to represent all the cells on the left of the right position. There are faster solutions, but this is enough for the purposes of Rosettacode.

Bye,
bearophile
February 09, 2013
On Tuesday, 5 February 2013 at 20:10:37 UTC, bearophile wrote:
> Jos van Uden:
>
>> I'll give it a shot if you like. The RCRPG I'd like to try first.
>
> I have already partially written those:
>
> Partial translation of rcrpg-Python:
> http://codepad.org/SflrKqbT
>
> Partial translation of permutations_rank_of_a_permutation-Python:
> http://codepad.org/El9SQwOE
> Plus a better Perl implementation of the uniform() on BigInts:
> http://codepad.org/LGcMpk2f
>
> Partial translation of the universal_turing_machine-Ruby:
> http://codepad.org/nUXLzAg2
>
> Bye,
> bearophile

codepad.org doesn't work at all here. Maybe you should use dpaste (or pastebin for other languages) instead ?
February 10, 2013
On 9-2-2013 23:14, SomeDude wrote:
 
> codepad.org doesn't work at all here. Maybe you should use dpaste (or pastebin for other languages) instead ?

It's not working for me either. It's probably a temporary problem. It worked fine before.
February 10, 2013
SomeDude:

...
>> Partial translation of rcrpg-Python:
>> http://codepad.org/SflrKqbT
>>
>> Partial translation of permutations_rank_of_a_permutation-Python:
>> http://codepad.org/El9SQwOE
>> Plus a better Perl implementation of the uniform() on BigInts:
>> http://codepad.org/LGcMpk2f
>>
>> Partial translation of the universal_turing_machine-Ruby:
>> http://codepad.org/nUXLzAg2
>>
>> Bye,
>> bearophile
>
> codepad.org doesn't work at all here. Maybe you should use dpaste (or pastebin for other languages) instead ?

Links in the same order:
http://dpaste.dzfl.pl/10eff346
http://dpaste.dzfl.pl/bfde8010
http://dpaste.dzfl.pl/3a172308
http://dpaste.dzfl.pl/22b7a931

Bye,
bearophile
February 12, 2013
On 10-2-2013 1:57, bearophile wrote:
> ...
>>> Partial translation of rcrpg-Python:
>>> http://codepad.org/SflrKqbT

I have the rcrpg working, but I want to test it some more. I'm not very happy
with the alias function, it accepts just about any input, it can put the program
in an invalid state.

There was a bug by the way in the Python code, that slowed me down a bit.

As for the "getattr", I've hacked a CTFE loop together that writes out if
statements. I'm not sure how robust it is. We can always go for a handwritten
"if else" or switch block.

http://dpaste.dzfl.pl/5e6b824e


February 12, 2013
Jos van Uden:

> I have the rcrpg working, but I want to test it some more.

Good. Adding a bit of unittesting is acceptable, I think.


> I'm not very happy
> with the alias function, it accepts just about any input, it can put the program in an invalid state.

I presume this is a design bug shared with the original Python code.

You have also fixed a translation bug of mine with remove(). I don't like that function. In past I did another mistake (in another program), forgetting to assign its result back to the array.


> There was a bug by the way in the Python code, that slowed me down a bit.

D static type system asks for more coding work, but it has caught very quickly that bug of this line of Python code:

tokens[0] = aliases[tokens[0]]

Dynamic typing has some advantages and in some cases it's handy, but it has some disadvantages too. On the other hand I think that Python code was not well tested; Python unittesting is able to catch most of similar bugs.

I think we should fix the Python entry too (or at least add a note in the Talk page).


> As for the "getattr", I've hacked a CTFE loop together that writes out if statements. I'm not sure how robust it is.

I think in normal D code you don't catch Throwable, but maybe in this case it's OK.


> http://dpaste.dzfl.pl/5e6b824e

The D code has lot of imports because Python has a ton of built-in things.

I have shortened the lines to about 72 chars max, and reformatted the code a bit. If you like it and you have a Rosettacode account, you can put it there yourself (otherwise I'll do it myself). If later you find bugs or you want to change something, there's always the possibility to modify it on the site.

http://dpaste.dzfl.pl/6778053f

In practice at the moment I am maintaining all the D entries of Rosettacode. I keep the coding style uniform, but sometimes I change some parts of such style on purpose to show different ways to use D, or specific things. Several Rosettacode solutions have more than one D entry, like when there is a very short and high-level entry and a longer and low level entry that's faster.

Bye,
bearophile
« First   ‹ Prev
1 2 3 4 5 6 7 8 9 10 11