Which character set does D use?

2018-06-13 Thread Murilo via Digitalmars-d-learn
Does D use ASCII or UNICODE? It seems to use ASCII since it causes error whenever I use a non-ASCII character.

Re: How do I install a library?

2018-11-08 Thread Murilo via Digitalmars-d-learn
On Thursday, 8 November 2018 at 22:28:38 UTC, Steven Schveighoffer wrote: On 11/8/18 4:46 PM, Murilo wrote: I want to install the library DlangUI but I don't know how to do it. In python I just type pip and it works, but in D I don't know how to do it. Can anyone help me? dlangui will be

Re: How do I install a library?

2018-11-08 Thread Murilo via Digitalmars-d-learn
On Thursday, 8 November 2018 at 23:28:05 UTC, Steven Schveighoffer wrote: On 11/8/18 6:07 PM, Steven Schveighoffer wrote: If you want to build the dlangui library directly and install it on your own without dub, you would need to download the source (probably from github) and build it using

How do I install a library?

2018-11-08 Thread Murilo via Digitalmars-d-learn
I want to install the library DlangUI but I don't know how to do it. In python I just type pip and it works, but in D I don't know how to do it. Can anyone help me?

Working with randomSample

2018-12-27 Thread Murilo via Digitalmars-d-learn
Why is it that when I type "auto choice = randomSample(array);" and later when I try to index choice as in choice[1] it gives an error message?

Re: How do I install a library?

2018-12-11 Thread Murilo via Digitalmars-d-learn
On Tuesday, 11 December 2018 at 07:25:49 UTC, Seb wrote: On Monday, 10 December 2018 at 00:18:52 UTC, Murilo wrote: Hi guys, thank you for helping me out here, there is this facebook group for the D language, here we can help and teach each other. It is called Programming in D. Please join.

Why pow() won't go beyond 2^31?

2018-11-28 Thread Murilo via Digitalmars-d-learn
I am using the function pow() from std.math but if I try pow(2, 32) it returns 0, it doesn't compute beyond the maximum value of an int(2^31) and I am working with long. What should I do?

Re: Working with ranges

2018-12-07 Thread Murilo via Digitalmars-d-learn
On Saturday, 8 December 2018 at 03:46:11 UTC, Adam D. Ruppe wrote: On Saturday, 8 December 2018 at 03:37:56 UTC, Murilo wrote: Hi guys, I have created an array of strings with "string[12] ps string[12] isn't a range, but string[] is. Try passing `ps[]` to the function instead of plain `ps`

Re: Working with ranges

2018-12-07 Thread Murilo via Digitalmars-d-learn
On Saturday, 8 December 2018 at 03:51:02 UTC, Adam D. Ruppe wrote: On Saturday, 8 December 2018 at 03:48:10 UTC, Murilo wrote: Try passing `ps[]` to the function instead of plain `ps` and see what happens. How do I transform an array into a range? With the slicing operator, []. Thank you

Re: Working with ranges

2018-12-07 Thread Murilo via Digitalmars-d-learn
On Saturday, 8 December 2018 at 04:16:25 UTC, Adam D. Ruppe wrote: On Saturday, 8 December 2018 at 04:11:03 UTC, Murilo wrote: What is the difference between declaring "int[3] a = [1,2,3];" and declaring "int[] a = [1,2,3];"? Is the first an array and the second a range? They are both

Working with ranges

2018-12-07 Thread Murilo via Digitalmars-d-learn
Hi guys, I have created an array of strings with "string[12] ps = ["cat", "dog", "lion", "wolf", "coin", "chest", "money", "gold", "A", "B", "C", "D"];". I want to use the array as a range and I want to randomize it, like I want to transform that into several other ranges with the same

Re: Why pow() won't go beyond 2^31?

2018-12-09 Thread Murilo via Digitalmars-d-learn
Hi guys, thank you for helping me out here, there is this facebook group for the D language, here we can help and teach each other. It is called Programming in D. Please join. https://www.facebook.com/groups/662119670846705/?ref=bookmarks

Re: Working with ranges

2018-12-09 Thread Murilo via Digitalmars-d-learn
Hi guys, thank you for helping me out here, there is this facebook group for the D language, here we can help and teach each other. It is called Programming in D. Please join. https://www.facebook.com/groups/662119670846705/?ref=bookmarks

Re: Working with randomSample

2018-12-28 Thread Murilo via Digitalmars-d-learn
On Friday, 28 December 2018 at 03:59:52 UTC, Ali Çehreli wrote: It's because randomSample returns either an input range or a forward range depending both on the kind of range that it gets and the random number generator used. Documented here: Ali Thank you very much, now it all makes sense.

Re: How do I install a library?

2018-12-09 Thread Murilo via Digitalmars-d-learn
Hi guys, thank you for helping me out here, there is this facebook group for the D language, here we can help and teach each other. It is called Programming in D. Please join. https://www.facebook.com/groups/662119670846705/?ref=bookmarks

Re: Which character set does D use?

2018-12-09 Thread Murilo via Digitalmars-d-learn
Hi guys, thank you for helping me out here, there is this facebook group for the D language, here we can help and teach each other. It is called Programming in D. Please join. https://www.facebook.com/groups/662119670846705/?ref=bookmarks

Re: Block statements and memory management

2019-04-05 Thread Murilo via Digitalmars-d-learn
On Saturday, 16 March 2019 at 15:53:26 UTC, Johan Engelen wrote: On Saturday, 16 March 2019 at 03:47:43 UTC, Murilo wrote: Does anyone know if when I create a variable inside a scope as in {int a = 10;} it disappears complete from the memory when the scope finishes? Or does it remain in some

Using arsd.simpledisplay module

2019-02-25 Thread Murilo via Digitalmars-d-learn
I need help with the arsd.simpledisplay module. Is there anyone there who knows about it? I have doubts concerning SimpleWindow.eventLoop().

Re: Easiest way to display images

2019-02-25 Thread Murilo via Digitalmars-d-learn
On Tuesday, 12 February 2019 at 01:31:48 UTC, Adam D. Ruppe wrote: On Tuesday, 12 February 2019 at 01:16:21 UTC, Murilo wrote: Hi Adam. I have been using your arsd library and I have noticed that compiling with -m64 causes this error: huh, only on 64 bit windows. well, pushed a fix up, try

How to cast arrays?

2019-03-01 Thread Murilo via Digitalmars-d-learn
How do I cast a ubyte[] into uint[]? It keeps raising an error, I have read the documentation saying there are restrictions for that concerning the length of the arrays.

Re: Easiest way to display images

2019-03-11 Thread Murilo via Digitalmars-d-learn
Hi Adam, how do I set the color of the SimpleWindow background?

Block statements and memory management

2019-03-15 Thread Murilo via Digitalmars-d-learn
Does anyone know if when I create a variable inside a scope as in {int a = 10;} it disappears complete from the memory when the scope finishes? Or does it remain in some part of the memory? I am thinking of using scopes to make optimized programs that consume less memory.

Re: Easiest way to display images

2019-02-10 Thread Murilo via Digitalmars-d-learn
On Wednesday, 6 February 2019 at 03:35:03 UTC, Adam D. Ruppe wrote: On Wednesday, 6 February 2019 at 01:04:43 UTC, Murilo wrote: You should later joing the facebook group Programming in D. Eh, I don't really like facebook groups. With my libraries too, I don't really care if anyone uses

Re: Handling big FP numbers

2019-02-10 Thread Murilo via Digitalmars-d-learn
On Sunday, 10 February 2019 at 21:27:43 UTC, Dennis wrote: On Sunday, 10 February 2019 at 20:25:02 UTC, Murilo wrote: It seems this is a feature of D I will have to get used to and accept the fact I can't always get the same number as in C What compilers and settings do you use? What you're

Re: Handling big FP numbers

2019-02-10 Thread Murilo via Digitalmars-d-learn
On Saturday, 9 February 2019 at 05:46:22 UTC, H. S. Teoh wrote: On Sat, Feb 09, 2019 at 03:52:38AM +, Murilo via Digitalmars-d-learn wrote: On Saturday, 9 February 2019 at 03:28:24 UTC, Adam D. Ruppe wrote: [...] > But you can change this with the format specifiers (use > `wr

Re: Easiest way to display images

2019-02-10 Thread Murilo via Digitalmars-d-learn
On Sunday, 10 February 2019 at 21:26:56 UTC, Adam D. Ruppe wrote: On Sunday, 10 February 2019 at 18:42:59 UTC, Murilo wrote: Adam, is there a place where we can chat? I don't like chatting via this forum. I would like to talk to you about your modules and about the D lang. get on the

Re: Easiest way to display images

2019-02-11 Thread Murilo via Digitalmars-d-learn
On Tuesday, 12 February 2019 at 01:31:48 UTC, Adam D. Ruppe wrote: On Tuesday, 12 February 2019 at 01:16:21 UTC, Murilo wrote: Hi Adam. I have been using your arsd library and I have noticed that compiling with -m64 causes this error: huh, only on 64 bit windows. well, pushed a fix up, try

Re: Easiest way to display images

2019-02-11 Thread Murilo via Digitalmars-d-learn
On Sunday, 10 February 2019 at 21:26:56 UTC, Adam D. Ruppe wrote: On Sunday, 10 February 2019 at 18:42:59 UTC, Murilo wrote: Adam, is there a place where we can chat? I don't like chatting via this forum. I would like to talk to you about your modules and about the D lang. get on the

Re: Easiest way to display images

2019-02-11 Thread Murilo via Digitalmars-d-learn
On Tuesday, 12 February 2019 at 01:31:48 UTC, Adam D. Ruppe wrote: On Tuesday, 12 February 2019 at 01:16:21 UTC, Murilo wrote: Hi Adam. I have been using your arsd library and I have noticed that compiling with -m64 causes this error: huh, only on 64 bit windows. well, pushed a fix up, try

Re: Easiest way to display images

2019-02-06 Thread Murilo via Digitalmars-d-learn
On Wednesday, 6 February 2019 at 04:36:12 UTC, DanielG wrote: On Wednesday, 6 February 2019 at 01:04:43 UTC, Murilo wrote: You should later joing the facebook group Programming in D. The D community is small enough that it's unlikely anybody in that Facebook group, isn't already using the

Re: How do I use libraries manually?

2019-02-05 Thread Murilo via Digitalmars-d-learn
On Tuesday, 5 February 2019 at 19:46:32 UTC, H. S. Teoh wrote: Thank you very much, I will try what you just explained. And yes I would really appreciate it if people would make single file libraries that I can just import as if it were any other .d file.

Re: Converting a type to a char

2019-02-05 Thread Murilo via Digitalmars-d-learn
On Friday, 25 January 2019 at 15:53:10 UTC, Thomas Gregory wrote: I would like to check that a char (unknown at compile time) matches a particular type but I would like to do so without if statements or a hash map as I would like it to be as fast as possible. Ideally I would choose something

Easiest way to display images

2019-02-05 Thread Murilo via Digitalmars-d-learn
What would be the easiest way to simply display a jpg or png image on the screen for a few seconds in Windows?

How do I use libraries manually?

2019-02-05 Thread Murilo via Digitalmars-d-learn
Can anyone teach me how to download and use a library manually without having to use DUB?

Re: Easiest way to display images

2019-02-05 Thread Murilo via Digitalmars-d-learn
On Tuesday, 5 February 2019 at 21:25:54 UTC, Adam D. Ruppe wrote: On Tuesday, 5 February 2019 at 21:11:52 UTC, Murilo wrote: What would be the easiest way to simply display a jpg or png image on the screen for a few seconds in Windows? That's a little more complex than playing a sound,

Re: Easiest way to display images

2019-02-05 Thread Murilo via Digitalmars-d-learn
On Tuesday, 5 February 2019 at 21:25:54 UTC, Adam D. Ruppe wrote: On Tuesday, 5 February 2019 at 21:11:52 UTC, Murilo wrote: What would be the easiest way to simply display a jpg or png image on the screen for a few seconds in Windows? That's a little more complex than playing a sound,

Re: Handling big FP numbers

2019-02-08 Thread Murilo via Digitalmars-d-learn
On Saturday, 9 February 2019 at 03:03:41 UTC, H. S. Teoh wrote: On Sat, Feb 09, 2019 at 02:12:29AM +, Murilo via Digitalmars-d-learn wrote: Why is it that in C when I attribute the number 991234307654329925.7865 to a double it prints 991234299470108672. and in D

Re: Handling big FP numbers

2019-02-08 Thread Murilo via Digitalmars-d-learn
On Saturday, 9 February 2019 at 03:28:24 UTC, Adam D. Ruppe wrote: On Saturday, 9 February 2019 at 03:21:51 UTC, Murilo wrote: Now, changing a little bit the subject. All FPs in D turn out to be printed differently than they are in C and in C it comes out a little more precise than in D. Is

Re: Handling big FP numbers

2019-02-08 Thread Murilo via Digitalmars-d-learn
On Saturday, 9 February 2019 at 03:28:24 UTC, Adam D. Ruppe wrote: On Saturday, 9 February 2019 at 03:21:51 UTC, Murilo wrote: Now, changing a little bit the subject. All FPs in D turn out to be printed differently than they are in C and in C it comes out a little more precise than in D. Is

Re: Handling big FP numbers

2019-02-08 Thread Murilo via Digitalmars-d-learn
On Saturday, 9 February 2019 at 04:36:26 UTC, DanielG wrote: On Saturday, 9 February 2019 at 04:32:44 UTC, Murilo wrote: Thank you very much for clearing this up. But how do I make D behave just like C? Is there a way to do that? Off the top of my head, you'd have to link against libc so you

Re: Handling big FP numbers

2019-02-08 Thread Murilo via Digitalmars-d-learn
On Saturday, 9 February 2019 at 02:54:18 UTC, Adam D. Ruppe wrote: On Saturday, 9 February 2019 at 02:46:52 UTC, Murilo wrote: But I used the type double in D which is supposed to be only 64 bits long and not 80 bits long, the type real is the one which is supposed to be 80 bits long. Right?

Re: Handling big FP numbers

2019-02-08 Thread Murilo via Digitalmars-d-learn
On Saturday, 9 February 2019 at 04:30:22 UTC, DanielG wrote: On Saturday, 9 February 2019 at 03:33:13 UTC, Murilo wrote: Thanks but here is the situation, I use printf("%.20f", 0.1); in both C and D, C returns 0.1555 whereas D returns 0.10001000. So I understand

Handling big FP numbers

2019-02-08 Thread Murilo via Digitalmars-d-learn
Why is it that in C when I attribute the number 991234307654329925.7865 to a double it prints 991234299470108672. and in D it prints 9912342990. ? Apparently both languages cause a certain loss of precision(which is part of converting the decimal system

Re: Handling big FP numbers

2019-02-08 Thread Murilo via Digitalmars-d-learn
On Saturday, 9 February 2019 at 02:42:09 UTC, Adam D. Ruppe wrote: On Saturday, 9 February 2019 at 02:12:29 UTC, Murilo wrote: prints Two likely reasons: the D compiler does compile time stuff at 80 bit, whereas the C++ one probably uses 64 bit, and the D default print rounds more

Re: Simple way to play sounds using D

2019-02-05 Thread Murilo via Digitalmars-d-learn
On Tuesday, 5 February 2019 at 17:14:05 UTC, Adam D. Ruppe wrote: On Tuesday, 5 February 2019 at 17:09:10 UTC, Murilo wrote: When I compile the code above the compiler says Error: linker exited with status 1 What should I do? It might have to be "shoot.wav"w, notice the w on the end. But I

Simple way to play sounds using D

2019-02-05 Thread Murilo via Digitalmars-d-learn
Hi guys, I would like to play simple sounds but I want something easy to use, can you show me the simplest way to do that? Like a function that just loads a .wav and plays it.

Re: Simple way to play sounds using D

2019-02-05 Thread Murilo via Digitalmars-d-learn
On Tuesday, 5 February 2019 at 17:01:54 UTC, Adam D. Ruppe wrote: On Tuesday, 5 February 2019 at 16:50:36 UTC, Murilo wrote: Hi guys, I would like to play simple sounds but I want something easy to use, can you show me the simplest way to do that? Like a function that just loads a .wav and

Re: Elegant way to test if members of array A are present in array B?

2019-06-11 Thread Murilo via Digitalmars-d-learn
On Tuesday, 11 June 2019 at 17:12:17 UTC, Robert M. Münch wrote: Is there a simple and elegant way to do this? Or is just using a foreach(...) with canFind() the best way? I made it this way, I consider it elegant. I don't know if others will like it. Here it is: import std.stdio : writeln;

Re: Help me decide D or C

2019-08-01 Thread Murilo via Digitalmars-d-learn
On Wednesday, 31 July 2019 at 18:38:02 UTC, Alexandre wrote: Hi everyone, I would like an honest opinion. I have a beginner level (able to do very small programs) in a few languages such as python, go, C, guile(scheme) and common lisp. I want to pick a language and go deep with it and focus

Re: Help playing sounds using arsd.simpleaudio

2019-09-28 Thread Murilo via Digitalmars-d-learn
On Saturday, 28 September 2019 at 14:03:53 UTC, Adam D. Ruppe wrote: On Saturday, 28 September 2019 at 03:21:38 UTC, Murilo wrote: Can anyone just please show me how to play a background sound(like those in games) using arsd.simpleaudio? I'd like something simple with a code snippet please.

Re: Help playing sounds using arsd.simpleaudio

2019-09-28 Thread Murilo via Digitalmars-d-learn
On Saturday, 28 September 2019 at 14:03:53 UTC, Adam D. Ruppe wrote: On Saturday, 28 September 2019 at 03:21:38 UTC, Murilo wrote: Can anyone just please show me how to play a background sound(like those in games) using arsd.simpleaudio? I'd like something simple with a code snippet please.

Re: Help making a game with transparency

2019-09-28 Thread Murilo via Digitalmars-d-learn
On Saturday, 28 September 2019 at 05:57:55 UTC, Mike Parker wrote: On Friday, 27 September 2019 at 22:55:22 UTC, Murilo wrote: You might consider using SDL and SDL_image: Thank you very much. But I want to use only the arsd library.

Re: Help making a game with transparency

2019-09-30 Thread Murilo via Digitalmars-d-learn
Hi everyone, I tried creating a program which simply shows the image of the ship near the corner of the screen, just for testing sake. Here it is: import arsd.gamehelpers, arsd.image; ​ void main()​ {​ SimpleWindow window = create2dWindow("Space Invaders", 1000, 400);​ OpenGlTexture

Re: Help making a game with transparency

2019-09-27 Thread Murilo via Digitalmars-d-learn
Sorry this is a bit vague. I suppose you're using engine.d or screen.d directly right? Depending on your setup (OpenGL or Software) transparency will be different. For example take a look at line 733, putpixel function and you'll see that It handle Color differently if it's OpenGL x

Re: Help making a game with transparency

2019-09-27 Thread Murilo via Digitalmars-d-learn
On Friday, 27 September 2019 at 11:32:53 UTC, Adam D. Ruppe wrote: On Friday, 27 September 2019 at 11:28:35 UTC, matheus wrote: Sorry this is a bit vague. I suppose you're using engine.d or screen.d directly right? those two are obsolete, new stuff should use simpledisplay but with

Help making a game with transparency

2019-09-26 Thread Murilo via Digitalmars-d-learn
Hi guys, I am making a game but for some reason the sprites do not show with the transparent background that they were supposed to. I'm using the arsd library. Can anyone help me?

Re: Help making a game with transparency

2019-09-27 Thread Murilo via Digitalmars-d-learn
On Friday, 27 September 2019 at 17:53:33 UTC, matheus wrote: On Friday, 27 September 2019 at 16:36:14 UTC, Murilo wrote: ...Do you know the arsd library? Yes but I use mostly terminal.d and others. On the other hand I use to code games too using SDL and OpenGL. I know for example in OpenGL

Re: Help making a game with transparency

2019-09-27 Thread Murilo via Digitalmars-d-learn
On Friday, 27 September 2019 at 22:13:43 UTC, matheus wrote: On Friday, 27 September 2019 at 21:16:07 UTC, Murilo wrote: ... Here it is, how do I make the ship have a transparent background? First: Your PNG file has transparency data information right? Second: I was Looking into the

Re: Help making a game with transparency

2019-09-27 Thread Murilo via Digitalmars-d-learn
On Friday, 27 September 2019 at 22:40:14 UTC, Adam D. Ruppe wrote: On Friday, 27 September 2019 at 22:13:43 UTC, matheus wrote: https://github.com/adamdruppe/arsd/blob/b0d21de148ef0b23ea845be322af5e6931ca4cb6/screen.d I really should just remove that file as it is no longer well maintained.

Re: Help making a game with transparency

2019-10-01 Thread Murilo via Digitalmars-d-learn
On Tuesday, 1 October 2019 at 12:45:35 UTC, Adam D. Ruppe wrote: On Monday, 30 September 2019 at 23:52:27 UTC, Murilo wrote: {​ window.redrawOpenGlSceneNow;​ like I said on email, this is the ONLY thing you should to in the event loop to trigger the redraw.

Re: Help playing sounds using arsd.simpleaudio

2019-09-29 Thread Murilo via Digitalmars-d-learn
On Saturday, 28 September 2019 at 14:03:53 UTC, Adam D. Ruppe wrote: On Saturday, 28 September 2019 at 03:21:38 UTC, Murilo wrote: Can anyone just please show me how to play a background sound(like those in games) using arsd.simpleaudio? I'd like something simple with a code snippet please.

Re: Help playing sounds using arsd.simpleaudio

2019-09-29 Thread Murilo via Digitalmars-d-learn
On Sunday, 29 September 2019 at 13:24:40 UTC, Adam D. Ruppe wrote: On Sunday, 29 September 2019 at 04:37:43 UTC, Murilo wrote: Thanks. Now, I would like to know if I could just use it like this instead: What happens if an exception is thrown in the middle of your function? It shouldn't

Re: Help playing sounds using arsd.simpleaudio

2019-09-29 Thread Murilo via Digitalmars-d-learn
On Sunday, 29 September 2019 at 20:57:09 UTC, Adam D. Ruppe wrote: On Sunday, 29 September 2019 at 20:51:40 UTC, Murilo wrote: Are you sure it is like this: join waits for it to finish before returning. You need to stop before joining otherwise join may never return. Alright, thanks. So

Re: Help playing sounds using arsd.simpleaudio

2019-09-29 Thread Murilo via Digitalmars-d-learn
On Sunday, 29 September 2019 at 09:25:59 UTC, JN wrote: On Saturday, 28 September 2019 at 03:21:38 UTC, Murilo wrote: Can anyone just please show me how to play a background sound(like those in games) using arsd.simpleaudio? I'd like something simple with a code snippet please. I recommend

Re: Help playing sounds using arsd.simpleaudio

2019-09-29 Thread Murilo via Digitalmars-d-learn
On Sunday, 29 September 2019 at 22:52:02 UTC, Adam D. Ruppe wrote: On Sunday, 29 September 2019 at 21:06:02 UTC, Murilo wrote: .stop() will stop the thread More specifically, stop tells the audio output to stop. It finishes what it is doing and then exits. At this point, the thread

Re: Help making a game with transparency

2019-09-30 Thread Murilo via Digitalmars-d-learn
On Saturday, 28 September 2019 at 13:41:24 UTC, matheus wrote: Ok, I took a look over my old projects and I found exactly what you want, by the way it's from 2012. It uses Derelict 2.0 bindings and will draw a PNG image where you can move around with cursor keys. If you want I can send you

Re: Help making a game with transparency

2019-09-30 Thread Murilo via Digitalmars-d-learn
On Saturday, 28 September 2019 at 14:33:03 UTC, Adam D. Ruppe wrote: But if you all want that, on your schedule, smash that like button, comment, subscribe, and be sure to ring that bell so you get a notification every time I parrot what people say on Youtube at the end of their videos. Then

Help playing sounds using arsd.simpleaudio

2019-09-27 Thread Murilo via Digitalmars-d-learn
Can anyone just please show me how to play a background sound(like those in games) using arsd.simpleaudio? I'd like something simple with a code snippet please.

Re: Help making a game with transparency

2019-10-01 Thread Murilo via Digitalmars-d-learn
On Tuesday, 1 October 2019 at 12:46:58 UTC, Adam D. Ruppe wrote: On Monday, 30 September 2019 at 20:14:56 UTC, Murilo wrote: What are your pages that you want people subscribing to? I'm just trolling. And what is your patreon page? https://www.patreon.com/adam_d_ruppe but as you'll

Re: Help playing sounds using arsd.simpleaudio

2019-10-31 Thread Murilo via Digitalmars-d-learn
On Wednesday, 30 October 2019 at 19:11:00 UTC, Adam D. Ruppe wrote: On Saturday, 26 October 2019 at 19:48:33 UTC, Murilo wrote: I play a sound the program never ends, the terminal continues to run the program and I have to end it manually. Any ideas what could be causing this? I am using it

Re: How can I make a program which uses all cores and 100% of cpu power?

2019-12-05 Thread Murilo via Digitalmars-d-learn
On Friday, 11 October 2019 at 06:57:46 UTC, Russel Winder wrote: A neural net is, at it's heart, a set of communicating nodes. This is as much an I/O bound model as it is compute bound one – nodes are generally waiting for input as much as they are computing a value. The obvious solution

Re: How can I make a program which uses all cores and 100% of cpu power?

2019-12-05 Thread Murilo via Digitalmars-d-learn
On Friday, 11 October 2019 at 06:18:03 UTC, Ali Çehreli wrote: Your threads must allocate as little memory as possible because memory allocation can trigger garbage collection and garbage collection stops all threads (except the one that's performing collection). We studied the effects of

Re: Help playing sounds using arsd.simpleaudio

2019-10-18 Thread Murilo via Digitalmars-d-learn
but at the beginning of main() set it up with auto audio = new AudioPcmOutThread(); audio.start(); scope(exit) { audio.stop(); audio.join(); } Thanks Adam. That worked on Windows, but now that I have switched to Linux Mint it is

Re: Help playing sounds using arsd.simpleaudio

2019-10-19 Thread Murilo via Digitalmars-d-learn
On Saturday, 19 October 2019 at 13:08:49 UTC, Adam D. Ruppe wrote: try it now with the new version of simpleaudio.d from git Ahh, now it works! Thank you so much man. I really appreciate the work you do with your library, I have been using it for everything, I'm now training a neural

Re: Help playing sounds using arsd.simpleaudio

2019-10-18 Thread Murilo via Digitalmars-d-learn
On Saturday, 19 October 2019 at 02:10:54 UTC, Adam D. Ruppe wrote: On Saturday, 19 October 2019 at 01:48:57 UTC, Murilo wrote: init: Operation not permitted Your system probably uses PulseAudio which I don't like, so I don't support it in my code. It *might* work to run `pasuspender --

Re: Help playing sounds using arsd.simpleaudio

2019-10-26 Thread Murilo via Digitalmars-d-learn
On Saturday, 19 October 2019 at 13:08:49 UTC, Adam D. Ruppe wrote: try it now with the new version of simpleaudio.d from git Hi Adam, sorry to bother you, but I'm having a problem with simpleaudio.d. This problem was happening on Windows too. When I play a sound the program never ends, the

How can I make a program which uses all cores and 100% of cpu power?

2019-10-10 Thread Murilo via Digitalmars-d-learn
I have started working with neural networks and for that I need a lot of computing power but the programs I make only use around 30% of the cpu, or at least that is what Task Manager tells me. How can I make it use all 4 cores of my AMD FX-4300 and how can I make it use 100% of it?

So, you want to be a programmer? Here is the way to go.

2020-01-14 Thread Murilo via Digitalmars-d-learn
Hi everyone. I've received so many people asking me about how to learn programming, or complaining about how difficult it is, that I wrote a small text teaching the way to go for those who want to learn programming. I tried to write it in a funny and straight forward way. Here it is:

Re: What kind of Editor, IDE you are using and which one do you like for D language?

2019-12-24 Thread Murilo via Digitalmars-d-learn
On Sunday, 22 December 2019 at 17:20:51 UTC, BoQsc wrote: There are lots of editors/IDE's that support D language: https://wiki.dlang.org/Editors What kind of editor/IDE are you using and which one do you like the most? I use Notepad++ on Windows and Bluefish on Linux. I'm a minimalist

Re: 2d graphic and multimedia

2020-03-12 Thread Murilo via Digitalmars-d-learn
On Thursday, 12 March 2020 at 04:33:42 UTC, Noor Wachid wrote: I usually go with SFML (C++) library to write simple visualization. Is there any similiar library in D? I use the arsd library for everything. It allows multimedia and much more, it's light, fast, small and very easy to use since

Re: GUI library for DMD 2.090 or DMD 2.091

2020-04-25 Thread Murilo via Digitalmars-d-learn
On Friday, 24 April 2020 at 13:45:22 UTC, Phrozen wrote: I'm too new to DLang and I have a lot to learn. Probably that's why I have a lot of difficulties. Has anyone tried using a GUI library to the latest DMD 2.090 or DMD 2.091? I plan to use this language for a specific Thermal calculator

Re: DConf 2017 Videos

2020-04-26 Thread Murilo via Digitalmars-d-learn
On Friday, 24 April 2020 at 20:24:47 UTC, matheus wrote: Hi, please could someone tell me where can I find videos from DConf 2017? I pretty sure I watched them on Youtube sometime ago, but I can't find anymore. By the way, I'm looking from one video where someone shows some "C flaws" and

Re: Best way to learn 2d games with D?

2020-03-16 Thread Murilo via Digitalmars-d-learn
On Sunday, 15 March 2020 at 17:58:58 UTC, Steven Schveighoffer wrote: I want to try and learn how to write 2d games. I'd prefer to do it with D. I've found a ton of tutorials on learning 2d gaming with other languages. Is there a place to look that uses D for learning? Should I just start

Re: How do I check if a type is assignable to null at compile time?

2021-02-26 Thread Murilo via Digitalmars-d-learn
On Friday, 26 February 2021 at 05:25:14 UTC, Jack wrote: I started with: enum isAssignableNull(T) = is(T : Object) || isPointer(T); but how do I cover all cases? You can check if it's null with this `variable is null` and you can test it with assert as in `assert(variable is null);`

Re: Does anyone here know how to create a Telegram bot in D?

2022-07-30 Thread Murilo via Digitalmars-d-learn
On Saturday, 30 July 2022 at 05:12:23 UTC, AnimusPEXUS wrote: so basically you have to do http-client programming also there's some outdated tg packages in repo https://code.dlang.org/search?q=telegram Thanks you very much.

Does anyone here know how to create a Telegram bot in D?

2022-07-29 Thread Murilo via Digitalmars-d-learn
Hi guys, I need to create a Telegram bot in D, does anyone here know how to do it? Is it possible to do it using arsd?