On Friday, 19 May 2017 at 12:55:05 UTC, Biotronic wrote:
revComp6 seems to be the fastest, but it's probably also the
least readable (a common trade-off).
Try revComp7 with -release :)
string revComp7(string bps)
{
char[] result = new char[bps.length];
auto p1 = result.ptr;
auto p2
On 05/19/2017 03:46 PM, Timoses wrote:
foreach (field; fields)
{
// Here it should actually not enter when field is mbyte
(byte)
if (isStaticArray!(typeof(field)))
You probably want `static if` here.
With normal `if`, the body still gets compiled,
Hey there,
trying to read data into the fields of a class.
This is what I got so far:
```
import std.traits;
import std.bitmanip;
class Test {
byte[4] marray;
byte mbyte;
this(ubyte[] data)
{
auto fields = this.tupleof;
foreach (field; fields)
{
On 05/19/2017 02:55 PM, Biotronic wrote:
On Friday, 19 May 2017 at 12:21:10 UTC, biocyberman wrote:
1. Why do we need to use assumeUnique in 'revComp0' and 'revComp3'?
D strings are immutable, so if I'd created the result array as a string,
I couldn't change the individual characters.
On Friday, 19 May 2017 at 12:21:10 UTC, biocyberman wrote:
On Friday, 19 May 2017 at 09:17:04 UTC, Biotronic wrote:
On Friday, 19 May 2017 at 07:29:44 UTC, biocyberman wrote:
[...]
Question about your implementation: you assume the input may
contain newlines, but don't handle any other
On Friday, May 19, 2017 12:09:38 PM PDT Suliman via Digitalmars-d-learn
wrote:
> I would like to check if user specified `0` as getopt parameter.
> But the problem that `int`'s are default in `0`. So if user did
> not specified nothing `int x` will be zero, and all other code
> will work as if
On Friday, 19 May 2017 at 12:21:10 UTC, biocyberman wrote:
1. Why do we need to use assumeUnique in 'revComp0' and
'revComp3'?
D strings are immutable, so if I'd created the result array as a
string, I couldn't change the individual characters. Instead, I
create a mutable array, change the
On Friday, 19 May 2017 at 09:17:04 UTC, Biotronic wrote:
On Friday, 19 May 2017 at 07:29:44 UTC, biocyberman wrote:
[...]
Question about your implementation: you assume the input may
contain newlines, but don't handle any other non-ACGT
characters. The problem definition states 'DNA string'
I would like to check if user specified `0` as getopt parameter.
But the problem that `int`'s are default in `0`. So if user did
not specified nothing `int x` will be zero, and all other code
will work as if it's zero.
In std.typecons I found Nullable that allow init int to zero. I
tried to
On 5/18/17 4:20 PM, Gary Willoughby wrote:
This might be a really silly question but:
I've allocated some memory like this (Foo is a struct):
this._data = cast(Foo*) calloc(n, Foo.sizeof);
How can I then later check that there is a valid Foo at `this._data` or
`this._data + n`?
The
On Friday, 19 May 2017 at 07:29:44 UTC, biocyberman wrote:
I am solving this problem http://rosalind.info/problems/revc/
as an exercise to learn D. This is my solution:
https://dpaste.dzfl.pl/8aa667f962b7
Is there some D tricks I can use to make the
`reverseComplement` function more concise
On Friday, 19 May 2017 at 07:46:13 UTC, Stefan Koch wrote:
On Friday, 19 May 2017 at 07:29:44 UTC, biocyberman wrote:
I am solving this problem http://rosalind.info/problems/revc/
as an exercise to learn D. This is my solution:
https://dpaste.dzfl.pl/8aa667f962b7
Is there some D tricks I can
On Friday, 19 May 2017 at 07:29:44 UTC, biocyberman wrote:
I am solving this problem http://rosalind.info/problems/revc/
as an exercise to learn D. This is my solution:
https://dpaste.dzfl.pl/8aa667f962b7
Is there some D tricks I can use to make the
`reverseComplement` function more concise
I am solving this problem http://rosalind.info/problems/revc/ as
an exercise to learn D. This is my solution:
https://dpaste.dzfl.pl/8aa667f962b7
Is there some D tricks I can use to make the `reverseComplement`
function more concise and speedy? Any other comments for
improvement of the whole
14 matches
Mail list logo