On 2017-07-13 20:07, JN wrote:
Consider:
struct Foo
{
int bar;
}
void processFoo(Foo foo)
{
}
void main()
{
Foo f = {bar: 5};
processFoo(f);// ok
processFoo(Foo(5)); // ok
processFoo({bar: 5}); // fail
processFoo(Foo({bar: 5}));
On Thursday, 13 July 2017 at 22:30:29 UTC, crimaniak wrote:
On Thursday, 13 July 2017 at 21:49:40 UTC, dark777 wrote:
Pessoal eu fiz o seguinte programa em C++.
https://pastebin.com/CvVv6Spn
porem tentei fazer o equivalente em D mas nao entendi muito
bem...
https://pastebin.com/2xw9geRR
al
On Friday, 14 July 2017 at 00:40:38 UTC, FoxyBrown wrote:
Anyone have an efficient implementation that is easy to use?
If you are OK with just a range spanning the two or more strings,
then you could use chain as is.
On Friday, 14 July 2017 at 00:40:38 UTC, FoxyBrown wrote:
Anyone have an efficient implementation that is easy to use?
Not sure what you mean by efficient here, but a \theta(n+m) one
is done idiomatically with Allocator+ranges like this (note that
the casts to and from ubyte are necessary, be
On Friday, 14 July 2017 at 00:33:12 UTC, FoxyBrown wrote:
What I'm trying to do is fairly straightforward but I've wasted
nearly 2 days on it.
//added this so it would all compile
import core.sys.windows.windows;
import core.stdc.stdio;
import core.stdc.stdlib;
import std.stdio;
import std.conv
Anyone have an efficient implementation that is easy to use?
On Thursday, 13 July 2017 at 23:30:39 UTC, Moritz Maxeiner wrote:
On Thursday, 13 July 2017 at 22:53:45 UTC, FoxyBrown wrote:
On Thursday, 13 July 2017 at 20:35:19 UTC, Moritz Maxeiner
wrote:
On Thursday, 13 July 2017 at 18:22:34 UTC, FoxyBrown wrote:
The following code is pretty screwed up, ev
On Thursday, 13 July 2017 at 22:53:45 UTC, FoxyBrown wrote:
On Thursday, 13 July 2017 at 20:35:19 UTC, Moritz Maxeiner
wrote:
On Thursday, 13 July 2017 at 18:22:34 UTC, FoxyBrown wrote:
The following code is pretty screwed up, even though it
doesn't look like it. I have a buf, a simple malloc w
On Thursday, 13 July 2017 at 20:35:19 UTC, Moritz Maxeiner wrote:
On Thursday, 13 July 2017 at 18:22:34 UTC, FoxyBrown wrote:
The following code is pretty screwed up, even though it
doesn't look like it. I have a buf, a simple malloc which hold
the results of a win32 call. I am then trying to c
On Thursday, 13 July 2017 at 22:30:29 UTC, crimaniak wrote:
On Thursday, 13 July 2017 at 21:49:40 UTC, dark777 wrote:
char[] stalman()
{
return cast(char[])`
((__-^^-,-^^-__))
*---***---*
*--|o o|--*
\
On Thursday, 13 July 2017 at 21:49:40 UTC, dark777 wrote:
Pessoal eu fiz o seguinte programa em C++.
https://pastebin.com/CvVv6Spn
porem tentei fazer o equivalente em D mas nao entendi muito
bem...
https://pastebin.com/2xw9geRR
alguem poderia me ajudar?
Se acepta utilizar intervalos en lu
Pessoal eu fiz o seguinte programa em C++.
https://pastebin.com/CvVv6Spn
porem tentei fazer o equivalente em D mas nao entendi muito bem...
https://pastebin.com/2xw9geRR
alguem poderia me ajudar?
On 07/13/2017 08:22 PM, FoxyBrown wrote:
res = EnumServicesStatusExW(schSCManager,
SC_ENUM_TYPE.SC_ENUM_PROCESS_INFO, servicesType, SERVICE_STATE_ALL,
cast(ubyte*)buf, 5, &dwBytesNeeded, &dwCount, &resume,
cast(const(char)*)null);
The cast to `char*` here looks odd. The 'W' suffi
On Thursday, 13 July 2017 at 15:52:57 UTC, Dustmight wrote:
How do I read in input from the terminal without sitting there
waiting for it? I've got code I want to run while there's no
input, and then code I want to act on input when it comes in.
How do I do both these things?
As Stefan mentio
On Thursday, 13 July 2017 at 18:22:34 UTC, FoxyBrown wrote:
The following code is pretty screwed up, even though it doesn't
look like it. I have a buf, a simple malloc which hold the
results of a win32 call. I am then trying to copy over the data
in buf to a D struct.
But when copying the str
On Thu, Jul 13, 2017 at 06:48:27PM +, JN via Digitalmars-d-learn wrote:
> On Thursday, 13 July 2017 at 18:09:46 UTC, H. S. Teoh wrote:
> >
> > It's not quite so simple. Consider for example:
> >
> > struct Foo { int bar; }
> > struct Oof { int bar; }
> >
> > void process(Foo foo)
On Thursday, 13 July 2017 at 18:09:46 UTC, H. S. Teoh wrote:
It's not quite so simple. Consider for example:
struct Foo { int bar; }
struct Oof { int bar; }
void process(Foo foo) { }
void process(Oof oof) { formatDisk(); }
void main() {
On Thursday, 13 July 2017 at 18:45:45 UTC, JN wrote:
I know that's a wrong syntax, I was just showing an example.
Yes, here it will work, but if you want to initialize only some
fields (poor man's keyword arguments), you can't use the
default constructor.
easily fixable by using FunctionLite
I know that's a wrong syntax, I was just showing an example.
Yes, here it will work, but if you want to initialize only some
fields (poor man's keyword arguments), you can't use the default
constructor.
The following code is pretty screwed up, even though it doesn't
look like it. I have a buf, a simple malloc which hold the
results of a win32 call. I am then trying to copy over the data
in buf to a D struct.
But when copying the strings, the buf location changes, screwing
up the copying proc
On Thu, Jul 13, 2017 at 06:07:31PM +, JN via Digitalmars-d-learn wrote:
> Consider:
>
> struct Foo
> {
> int bar;
> }
>
> void processFoo(Foo foo)
> {
> }
>
> void main()
> {
> Foo f = {bar: 5};
> processFoo(f);// ok
> processFoo(Foo(5)); //
Consider:
struct Foo
{
int bar;
}
void processFoo(Foo foo)
{
}
void main()
{
Foo f = {bar: 5};
processFoo(f);// ok
processFoo(Foo(5)); // ok
processFoo({bar: 5}); // fail
processFoo(Foo({bar: 5}));// fail
}
On 07/13/2017 08:52 AM, Dustmight wrote:
How do I read in input from the terminal without sitting there waiting
for it? I've got code I want to run while there's no input, and then
code I want to act on input when it comes in. How do I do both these
things?
If you're fine with buffered input, i
On Thursday, 13 July 2017 at 15:52:57 UTC, Dustmight wrote:
How do I read in input from the terminal without sitting there
waiting for it? I've got code I want to run while there's no
input, and then code I want to act on input when it comes in.
How do I do both these things?
Might want to ch
On Thursday, 13 July 2017 at 15:52:57 UTC, Dustmight wrote:
How do I read in input from the terminal without sitting there
waiting for it? I've got code I want to run while there's no
input, and then code I want to act on input when it comes in.
How do I do both these things?
You have to ask
How do I read in input from the terminal without sitting there
waiting for it? I've got code I want to run while there's no
input, and then code I want to act on input when it comes in. How
do I do both these things?
On Thursday, 13 July 2017 at 12:49:40 UTC, Per Nordlöw wrote:
Have anybody constructed an idiomatic D wrapper for FFTW?
No, sorry, although I have used the library quite a bit in D.
http://www.fftw.org/fftw3_doc/Tutorial.html#Tutorial
I'm specifically concerned about
- `RefCounted`-wrapping
Have anybody constructed an idiomatic D wrapper for FFTW?
http://www.fftw.org/fftw3_doc/Tutorial.html#Tutorial
I'm specifically concerned about
- `RefCounted`-wrapping of the C structures `fftw_complex` and
`fftw_plan`
- range semantics, lazy evaluation and caching of result in
stream-based
On 7/12/17 1:24 AM, Brandon Buck wrote:
On Wednesday, 12 July 2017 at 02:06:41 UTC, Steven Schveighoffer wrote:
I'm sure there's a bug filed somewhere on this...
Is this bug worthy? I can search for one and comment and/or create one
if I can't find one.
Found it. It was mistakenly closed:
On Thursday, 13 July 2017 at 10:56:20 UTC, unDEFER wrote:
Seems I have found. I must do:
try{
File file;
try {
file = File(path);
}
catch (Exception exp)
{
return;
}
//Some actions with file
}
catch (ErrnoException)
{
return;
}
Well, yes, you can
Thank you. I will write if will find the reason of description
corruption.
On Thursday, 13 July 2017 at 09:53:05 UTC, Jacob Carlborg wrote:
On 2017-07-13 02:34, Joel wrote:
It doesn't look like there's any thing I can use. I've come
across: dbox, dchip, and blaze. Blaze is dsource. dbox is
alpha and hasn't been updated for 3 years. dchip [1] hasn't
been updated for
On Thursday, 13 July 2017 at 11:15:56 UTC, Moritz Maxeiner wrote:
---
ubyte[File.sizeof] _file;
ref File file() { return *(cast(File*) &_file[0]); }
[create File instance and assign to file]
scope (exit) destroy(file);
---
Forgot to add the try catch:
---
ubyte[File.sizeof] _file;
ref File fil
On Thursday, 13 July 2017 at 10:28:30 UTC, unDEFER wrote:
On Thursday, 13 July 2017 at 08:53:24 UTC, Moritz Maxeiner
wrote:
Where does that `File` come from? If it's std.stdio.File, that
one is a struct with internal reference counting, so it
shouldn't crash in the above. Could you provide a mi
Seems I have found. I must do:
try{
File file;
try {
file = File(path);
}
catch (Exception exp)
{
return;
}
//Some actions with file
}
catch (ErrnoException)
{
return;
}
On Thursday, 13 July 2017 at 08:53:24 UTC, Moritz Maxeiner wrote:
Where does that `File` come from? If it's std.stdio.File, that
one is a struct with internal reference counting, so it
shouldn't crash in the above. Could you provide a minimal
working (in this case crashing) example?
Yes File
On 2017-07-13 02:34, Joel wrote:
It doesn't look like there's any thing I can use. I've come across:
dbox, dchip, and blaze. Blaze is dsource. dbox is alpha and hasn't been
updated for 3 years. dchip [1] hasn't been updated for 2 years and
doesn't compile (that's with out using any thing, jus
On Thursday, 13 July 2017 at 08:38:52 UTC, unDEFER wrote:
Hello! I have the code like this:
File file;
try {
file = File(path);
}
catch (Exception exp)
{
return;
}
...
try {
}
Where does that `File` come from? If it's std.stdio.File, that
one
What the God? I was not ready to post...
File file;
try {
file = File(path);
}
catch (Exception exp)
{
return;
}
try {
//Some actions with file
}
catch (ErrnoException)
{
return;
}
catch (ErrnoException) is necessary b
Hello! I have the code like this:
File file;
try {
file = File(path);
}
catch (Exception exp)
{
return;
}
...
try {
}
On Wednesday, 12 July 2017 at 05:24:49 UTC, Brandon Buck wrote:
On Wednesday, 12 July 2017 at 02:06:41 UTC, Steven
Schveighoffer wrote:
I'm sure there's a bug filed somewhere on this...
Is this bug worthy? I can search for one and comment and/or
create one if I can't find one.
It's at bes
On Thursday, 13 July 2017 at 01:15:46 UTC, FoxyBrown wrote:
ENUM_SERVICE_STATUS_PROCESS[5000] services;
auto res = SVC.EnumServicesStatusExA(schSCManager,
SC_ENUM_TYPE.SC_ENUM_PROCESS_INFO, servicesType,
SERVICE_STATE_ALL, cast(ubyte*)services.ptr,
5000*ENUM_SERVICE_STATUS_PROCESS.siz
On 07/13/2017 12:01 AM, Ali Çehreli wrote:
On 07/09/2017 05:10 PM, NoBigDeal256 wrote:
HTTP http;
For what it's worth, defining it as __gshared seems to be a workaround:
__gshared HTTP http;
I sometimes amuse myself. What use is that? :o)
What I must have meant is you can have a
On 07/09/2017 05:10 PM, NoBigDeal256 wrote:
> HTTP http;
For what it's worth, defining it as __gshared seems to be a workaround:
__gshared HTTP http;
Ali
44 matches
Mail list logo