question

2023-12-13 Thread fred via Digitalmars-d-learn

import core.thread;
import std.concurrency;
import std.stdio : w = writeln;

void w2(shared(bool) *done)
{
while (*done == false)
{
Thread.sleep(100.msecs);
w("print done? ", *done);
}
}

void s2()
{
shared(bool) isDone = false;
spawn(, );
Thread.sleep(400.msecs);
isDone = true;

}

void main()
{
s2();
}

=

a bug ?
thanks anyway


microservice story needed

2022-04-22 Thread fred via Digitalmars-d-learn
just need the libraries you use in microservice, and the reason 
you use them, and of course the URL link.


dll

2019-06-27 Thread fred via Digitalmars-d-learn

https://forum.dlang.org/thread/osnema$d5s$1...@digitalmars.com

dll support is it ok now?
i cant find the docs on thatm


Re: Linking to OpenCV OSX (dub.json LFLAG)

2019-05-02 Thread Fred via Digitalmars-d-learn

On Thursday, 2 May 2019 at 23:38:29 UTC, Fred wrote:

On Thursday, 2 May 2019 at 23:33:17 UTC, H. S. Teoh wrote:
On Thu, May 02, 2019 at 11:24:12PM +, Fred via 
Digitalmars-d-learn wrote:

[...]

[...]

Do you have any specific error messages and/or other problems 
that you could post here?  Being more specific about what 
problems you're facing would make it easier for us to help you.



T


Yeah, basically my project cannot find opencv


ld: library not found for -lopencv


There is more information and things I've tried in the github 
issue too.


I think I have my email associated with this account, an invite 
to the slack channel would be sweet as the IRC is dead


Re: Linking to OpenCV OSX (dub.json LFLAG)

2019-05-02 Thread Fred via Digitalmars-d-learn

On Thursday, 2 May 2019 at 23:33:17 UTC, H. S. Teoh wrote:
On Thu, May 02, 2019 at 11:24:12PM +, Fred via 
Digitalmars-d-learn wrote:

Hey Guys,

Complete Dlang n00b here and I'm having awful problems linking 
to opencv using my projects dub.json.


I've been getting some help on Github 
(https://github.com/aferust/opencvd/issues/1) but had no luck 
so far, if anyone has any good ideas I'd ever so greatful!

[...]

Do you have any specific error messages and/or other problems 
that you could post here?  Being more specific about what 
problems you're facing would make it easier for us to help you.



T


Yeah, basically my project cannot find opencv


ld: library not found for -lopencv


There is more information and things I've tried in the github 
issue too.


Linking to OpenCV OSX (dub.json LFLAG)

2019-05-02 Thread Fred via Digitalmars-d-learn

Hey Guys,

Complete Dlang n00b here and I'm having awful problems linking to 
opencv using my projects dub.json.


I've been getting some help on Github 
(https://github.com/aferust/opencvd/issues/1) but had no luck so 
far, if anyone has any good ideas I'd ever so greatful!


Thanks


Re: javascript or typescript

2018-11-05 Thread Fred via Digitalmars-d-learn
On Monday, 5 November 2018 at 08:49:42 UTC, Laurent Tréguier 
wrote:

On Monday, 5 November 2018 at 02:51:19 UTC, Fred wrote:

hi,
my javascript skill is bad.
but i want to host some nodejs app

i am aware that there is converter to js like dtojs. but it is 
out of date.


i'd like to give d a try. is there any other converter 
available. a decent one.


I haven't personally tried it, but there is an example of 
compiling D to Javascript here : 
https://github.com/Ace17/dscripten


ok will look at it. thanks.


Re: javascript or typescript

2018-11-05 Thread Fred via Digitalmars-d-learn

On Monday, 5 November 2018 at 05:07:49 UTC, Adam D. Ruppe wrote:

On Monday, 5 November 2018 at 02:51:19 UTC, Fred wrote:

i'd like to give d a try.


Why do you need to convert it to javascript? D can serve up web 
stuff by itself too.


did you mean vibe.d?

but i want to use in a shared hosting environment where my 
options are : ruby, python, nodejs and as usual php


vibe.d as standalone app will not work.

i know kotlin with js support, but maybe there is another option 
..



thanks for your answer and insight.


javascript or typescript

2018-11-04 Thread Fred via Digitalmars-d-learn

hi,
my javascript skill is bad.
but i want to host some nodejs app

i am aware that there is converter to js like dtojs. but it is 
out of date.


i'd like to give d a try. is there any other converter available. 
a decent one.


Re: User input; quick question.

2017-04-29 Thread fred via Digitalmars-d-learn

On Saturday, 29 April 2017 at 21:18:27 UTC, cym13 wrote:

On Saturday, 29 April 2017 at 21:09:13 UTC, fred wrote:

import std.stdio;

I am somewhat new to D, and I am trying to receive user input, 
like this, with a prompt:


string str;
writeln("Enter a string: ");
str = readln;
writeln(str);

However, the prompt appears after I enter the input; any 
reason why?


I've trawled the internet for a good hour, but I can't seem to 
find an answer.


Your code is correct, it's your terminal or whatever you use to 
see your program's output that doesn't flush stdout. You can 
force it though:


string str;
writeln("Enter a string: ");
stdout.flush;
str = readln;
write(str);



Thank you, again.



User input; quick question.

2017-04-29 Thread fred via Digitalmars-d-learn

import std.stdio;

I am somewhat new to D, and I am trying to receive user input, 
like this, with a prompt:


string str;
writeln("Enter a string: ");
str = readln;
writeln(str);

However, the prompt appears after I enter the input; any reason 
why?


I've trawled the internet for a good hour, but I can't seem to 
find an answer.




simple newbie question

2015-11-22 Thread fred via Digitalmars-d-learn

How to generate temporary files so compilation time speeds up.
Normal compilation only produce obj, exe.

If what i mean is that if we compile the files that  unchanged, 
dmd will look for that temporary files instead of .d files.


simple newbie question

2015-11-22 Thread fred via Digitalmars-d-learn

Hi.
Dll or shared library is important feature of software 
development.

So why most d library still static link.
I am sorry for my stupid question.

Thanks.