Re: Piping from terminal into D program

2021-09-05 Thread Виталий Фадеев via Digitalmars-d-learn
On Saturday, 4 September 2021 at 15:41:51 UTC, eXodiquas wrote: My question is now, can someone explain what I am doing wrong? Maybe I misunderstood the pipe in Linux systems and it is obvious for someone who knows how this works exactly, or maybe D works differently with pipes and I havn't

Re: A way to mixin during runtime?

2021-08-28 Thread Виталий Фадеев via Digitalmars-d-learn
On Friday, 27 August 2021 at 06:52:10 UTC, Kirill wrote: Is there a way to do mixin or similar during runtime? I'm trying to read a csv file and extract data types. Any ideas on how this should be approached in D are greatly appreciated. mixin at runtime not possible. Source code compilation

Re: C to D convertor

2021-08-24 Thread Виталий Фадеев via Digitalmars-d-learn
On Tuesday, 24 August 2021 at 11:52:45 UTC, Dennis wrote: On Saturday, 21 August 2021 at 08:14:22 UTC, Виталий Фадеев wrote: Any more ? CPP2D https://github.com/lhamot/CPP2D Dennis, thank!

Re: dlang opengl / gl / glu /glut library.

2021-08-22 Thread Виталий Фадеев via Digitalmars-d-learn
On Sunday, 22 August 2021 at 13:28:24 UTC, Mike Parker wrote: On Sunday, 22 August 2021 at 12:22:41 UTC, Виталий Фадеев wrote: https://forum.dlang.org/post/s5pvtq$2q83$1...@digitalmars.com On Wednesday, 21 April 2021 at 19:54:35 UTC, rikki cattermole wrote: On 22/04/2021 7:51 AM, Alain De

Re: dlang opengl / gl / glu /glut library.

2021-08-22 Thread Виталий Фадеев via Digitalmars-d-learn
On Sunday, 22 August 2021 at 13:28:24 UTC, Mike Parker wrote: On Sunday, 22 August 2021 at 12:22:41 UTC, Виталий Фадеев wrote: https://forum.dlang.org/post/s5pvtq$2q83$1...@digitalmars.com On Wednesday, 21 April 2021 at 19:54:35 UTC, rikki cattermole wrote: On 22/04/2021 7:51 AM, Alain De

dlang opengl / gl / glu /glut library.

2021-08-22 Thread Виталий Фадеев via Digitalmars-d-learn
https://forum.dlang.org/post/s5pvtq$2q83$1...@digitalmars.com On Wednesday, 21 April 2021 at 19:54:35 UTC, rikki cattermole wrote: On 22/04/2021 7:51 AM, Alain De Vos wrote: import bindc.opengl; bindbc bindbc-opengl provides glu* functions ? gluNewTess gluTessCallback gluTessProperty

Re: C to D convertor

2021-08-21 Thread Виталий Фадеев via Digitalmars-d-learn
On Saturday, 21 August 2021 at 08:59:55 UTC, evilrat wrote: On Saturday, 21 August 2021 at 08:14:22 UTC, Виталий Фадеев wrote: I know, i know... It not possible, but part of the C code we can to convert to the D. Show me, please, solutions, projects, tools, scripts, docs. Can you give the link

C to D convertor

2021-08-21 Thread Виталий Фадеев via Digitalmars-d-learn
I know, i know... It not possible, but part of the C code we can to convert to the D. Show me, please, solutions, projects, tools, scripts, docs. Can you give the link ? Examples of what the wanted: // C typedef struct { uint32_t version; /* 0x5000 */

Re: Trivial simple OpenGl working example

2021-07-11 Thread Виталий Фадеев via Digitalmars-d-learn
On Saturday, 10 July 2021 at 19:43:07 UTC, Danny Arends wrote: On Saturday, 10 July 2021 at 12:41:19 UTC, Виталий Фадеев wrote: [...] Just disable shader compilation using dub, the shader only needs to be compiled once. Since you're on linux it fails to execute glslc.exe (the windows

Re: Trivial simple OpenGl working example

2021-07-10 Thread Виталий Фадеев via Digitalmars-d-learn
On Saturday, 10 July 2021 at 08:36:07 UTC, Danny Arends wrote: On Thursday, 8 July 2021 at 13:51:51 UTC, Виталий Фадеев wrote: Hi! I searching trivial simple D/OpenGL working in 2021 year example. It may be triangle. It may be based on any library: SDL, GLFW, Derelict, etc. Can you help me

Re: Trivial simple OpenGl working example

2021-07-09 Thread Виталий Фадеев via Digitalmars-d-learn
On Friday, 9 July 2021 at 19:15:44 UTC, H. S. Teoh wrote: On Fri, Jul 09, 2021 at 05:11:06AM +, Виталий Фадеев via Digitalmars-d-learn wrote: [...] [...] [...] [...] Generally, text rendering on OpenGL is a huge pain to implement. This is not specific to D, but to OpenGL in general

Re: assign to property 2 values

2021-07-09 Thread Виталий Фадеев via Digitalmars-d-learn
On Friday, 9 July 2021 at 11:04:23 UTC, Dennis wrote: On Friday, 9 July 2021 at 10:19:59 UTC, Виталий Фадеев wrote: It possible in current version 2.097 ? If you `import std.typecons` you can do: ```D element.border = tuple(1, solid).expand; ``` But it's not pretty. I suggest either calling

Re: assign to property 2 values

2021-07-09 Thread Виталий Фадеев via Digitalmars-d-learn
On Friday, 9 July 2021 at 10:19:59 UTC, Виталий Фадеев wrote: I want this feature in D: ``` element.border = 1, solid; struct Element { @property void border( int width, BorderStyle style ) { this.borderWidth = width; this.borderStyle = style; } } ``` Description: ```

assign to property 2 values

2021-07-09 Thread Виталий Фадеев via Digitalmars-d-learn
I want this feature in D: ``` element.border = 1, solid; struct Element { @property void border( int width, BorderStyle style ) { this.borderWidth = width; this.borderStyle = style; } } ``` Description: ``` element.border = 1, solid; ``` will rewriten to the ```

Re: Trivial simple OpenGl working example

2021-07-08 Thread Виталий Фадеев via Digitalmars-d-learn
On Thursday, 8 July 2021 at 16:11:17 UTC, Guillaume Piolat wrote: On Thursday, 8 July 2021 at 14:09:30 UTC, drug wrote: 08.07.2021 16:51, Виталий Фадеев пишет: Hi! I searching trivial simple D/OpenGL working in 2021 year example. It may be triangle. It may be based on any library: SDL,

Re: Trivial simple OpenGl working example

2021-07-08 Thread Виталий Фадеев via Digitalmars-d-learn
On Thursday, 8 July 2021 at 16:32:44 UTC, drug wrote: 08.07.2021 19:11, Виталий Фадеев пишет: I fix source code, as drug say. I've fixed the issue upstream, shortly gfm7 v1.1.2 will be available. Drug, thank! I using!

Re: Trivial simple OpenGl working example

2021-07-08 Thread Виталий Фадеев via Digitalmars-d-learn
On Thursday, 8 July 2021 at 16:01:37 UTC, Dennis wrote: On Thursday, 8 July 2021 at 14:20:16 UTC, Виталий Фадеев wrote: Has dub flag for disable "warnings are treated as errors" ? You have to edit the package file to include `buildRequirements "allowWarnings"`, see

Re: Trivial simple OpenGl working example

2021-07-08 Thread Виталий Фадеев via Digitalmars-d-learn
On Thursday, 8 July 2021 at 15:57:53 UTC, drug wrote: 08.07.2021 18:46, Виталий Фадеев пишет: On Thursday, 8 July 2021 at 15:30:07 UTC, drug wrote: 08.07.2021 17:20, Виталий Фадеев пишет: [...] I failed to reproduce that. What platform you use and what is the compiler version? drug,

Re: Trivial simple OpenGl working example

2021-07-08 Thread Виталий Фадеев via Digitalmars-d-learn
On Thursday, 8 July 2021 at 15:30:07 UTC, drug wrote: 08.07.2021 17:20, Виталий Фадеев пишет: [...] I failed to reproduce that. What platform you use and what is the compiler version? drug, Linux, Ubuntu, x64 # uname -a Linux unknown 5.11.0-22-generic #23-Ubuntu SMP Thu Jun 17 00:34:23

Re: Trivial simple OpenGl working example

2021-07-08 Thread Виталий Фадеев via Digitalmars-d-learn
On Thursday, 8 July 2021 at 14:20:25 UTC, Adam D Ruppe wrote: On Thursday, 8 July 2021 at 13:51:51 UTC, Виталий Фадеев wrote: It may be based on any library: SDL, GLFW, Derelict, etc. my library http://arsd-official.dpldocs.info/arsd.simpledisplay.html#topic-modern-opengl

Re: Trivial simple OpenGl working example

2021-07-08 Thread Виталий Фадеев via Digitalmars-d-learn
On Thursday, 8 July 2021 at 14:09:38 UTC, Dennis wrote: On Thursday, 8 July 2021 at 13:51:51 UTC, Виталий Фадеев wrote: I searching trivial simple D/OpenGL working in 2021 year example. https://github.com/dkorpel/glfw-d/tree/master/examples/triangle-gl Uses bindbc-opengl + glfw-d (my

Re: Trivial simple OpenGl working example

2021-07-08 Thread Виталий Фадеев via Digitalmars-d-learn
On Thursday, 8 July 2021 at 14:09:30 UTC, drug wrote: 08.07.2021 16:51, Виталий Фадеев пишет: Hi! I searching trivial simple D/OpenGL working in 2021 year example. It may be triangle. It may be based on any library: SDL, GLFW, Derelict, etc. Can you help me ?

Trivial simple OpenGl working example

2021-07-08 Thread Виталий Фадеев via Digitalmars-d-learn
Hi! I searching trivial simple D/OpenGL working in 2021 year example. It may be triangle. It may be based on any library: SDL, GLFW, Derelict, etc. Can you help me ?

Re: wanting to try a GUI toolkit: needing some advice on which one to choose

2021-05-27 Thread Виталий Фадеев via Digitalmars-d-learn
On Thursday, 27 May 2021 at 01:17:44 UTC, someone wrote: Yes, I know this is a question lacking a straightforward answer. Requirements: [...] sciter, of course. https://sciter.com/ Or write Dlang alternative.

Re: Remove own post from forum

2021-05-10 Thread Виталий Фадеев via Digitalmars-d-learn
On Monday, 10 May 2021 at 04:29:29 UTC, Paul Backus wrote: On Monday, 10 May 2021 at 03:36:02 UTC, Виталий Фадеев wrote: I have missformated post in thread: https://forum.dlang.org/thread/kwpqyzwgczdpzgsvo...@forum.dlang.org Say, please, how to remove own post from this forum ? There's

Remove own post from forum

2021-05-09 Thread Виталий Фадеев via Digitalmars-d-learn
I have missformated post in thread: https://forum.dlang.org/thread/kwpqyzwgczdpzgsvo...@forum.dlang.org Say, please, how to remove own post from this forum ?

Re: what exactly is string length?

2021-04-01 Thread Виталий Фадеев via Digitalmars-d-learn
On Friday, 2 April 2021 at 04:32:53 UTC, mw wrote: https://run.dlang.io/is/B4jcno --- import std; import std.conv : text; void main() { char[6] s; s = "abc"; writeln(s, s.length); // abc6, ok it's the static array's length string t = text("head-", s, "-tail");

Re: Two functions with different args. Taking address of the one

2021-03-11 Thread Виталий Фадеев via Digitalmars-d-learn
On Thursday, 11 March 2021 at 14:23:39 UTC, Adam D. Ruppe wrote: On Thursday, 11 March 2021 at 12:26:07 UTC, Виталий Фадеев wrote: _processMouseKey = // <-- not works _processMouseMove = // <-- not works This *should* actually work. What type are those variables? struct

Re: Two functions with different args. Taking address of the one

2021-03-11 Thread Виталий Фадеев via Digitalmars-d-learn
On Thursday, 11 March 2021 at 13:14:56 UTC, Paul Backus wrote: On Thursday, 11 March 2021 at 12:56:34 UTC, Виталий Фадеев wrote: [...] Something like this: template Overloads(alias symbol) { static if (__traits(compiles, __traits(parent, symbol))) alias Overloads

Re: Two functions with different args. Taking address of the one

2021-03-11 Thread Виталий Фадеев via Digitalmars-d-learn
On Thursday, 11 March 2021 at 12:48:13 UTC, Paul Backus wrote: On Thursday, 11 March 2021 at 12:26:07 UTC, Виталий Фадеев wrote: Have: void process( ref MouseKeyEvent event ) { ... } void process( ref MouseMoveEvent event ) { ... } Want:

Two functions with different args. Taking address of the one

2021-03-11 Thread Виталий Фадеев via Digitalmars-d-learn
Have: void process( ref MouseKeyEvent event ) { ... } void process( ref MouseMoveEvent event ) { ... } Want: _processMouseKey = // <-- not works _processMouseMove = // <-- not works What is correct way to get address of function with specific

Re: string to type

2021-02-24 Thread Виталий Фадеев via Digitalmars-d-learn
On Thursday, 25 February 2021 at 06:53:28 UTC, Виталий Фадеев wrote: On Thursday, 25 February 2021 at 06:51:11 UTC, Виталий Фадеев wrote: Say, please, how to convert string to type ? [...] Simple version of this question is: string t = "X"; mixin t!(); // <-- HERE TROUBLE I was

string to type

2021-02-24 Thread Виталий Фадеев via Digitalmars-d-learn
Say, please, how to convert string to type ? Is: interface IX { // } mixin template X() { // } // Mixin templates to class. // Scan class interfaces, then mix mixin template Members() { alias T = typeof( this ); static

Re: string to type

2021-02-24 Thread Виталий Фадеев via Digitalmars-d-learn
On Thursday, 25 February 2021 at 06:51:11 UTC, Виталий Фадеев wrote: Say, please, how to convert string to type ? [...] Simple version of this question is: string t = "X"; mixin t!(); // <-- HERE TROUBLE

Creating 1000 instances

2021-02-19 Thread Виталий Фадеев via Digitalmars-d-learn
We have: class File { // WIN32_FIND_DATAW data; } void fastReadDir() { File[] files; // reserve space, allocating instances files = new File[]( 1000 ); // <--- trouble here ? // filling instances auto file = files.ptr;

Re: Can change vtbl record at runtime ?

2021-02-03 Thread Виталий Фадеев via Digitalmars-d-learn
On Wednesday, 3 February 2021 at 10:20:44 UTC, evilrat wrote: On Wednesday, 3 February 2021 at 08:26:05 UTC, Max Haughton wrote: On Wednesday, 3 February 2021 at 05:30:37 UTC, Виталий Фадеев wrote: Possible to change the vtbl record at runtime ? Has functional for update vtbl records ? Do

Re: Can change vtbl record at runtime ?

2021-02-03 Thread Виталий Фадеев via Digitalmars-d-learn
On Wednesday, 3 February 2021 at 08:26:05 UTC, Max Haughton wrote: On Wednesday, 3 February 2021 at 05:30:37 UTC, Виталий Фадеев wrote: Do you mean "Can I set onSuccess" at runtime? Yes.

Can change vtbl record at runtime ?

2021-02-02 Thread Виталий Фадеев via Digitalmars-d-learn
Reason: Reuse component, bind custom callback without creating new class. Concept example: class SaveFilePopup { void onSuccess() { /* default operations */ } } auto saveFile = new SaveFilePopup(); saveFile.onSuccess = { /* New operations */ } Delegate:

Re: list system drives

2021-02-01 Thread Виталий Фадеев via Digitalmars-d-learn
On Tuesday, 2 February 2021 at 07:18:02 UTC, Ferhat Kurtulmuş wrote: On Tuesday, 2 February 2021 at 06:31:27 UTC, Виталий Фадеев wrote: Give, please, Dlang tools for list system drives. Some like a: enumVolumes(); // [ 'C:\', 'D:\' ] I have found this code by a google search. I don't

list system drives

2021-02-01 Thread Виталий Фадеев via Digitalmars-d-learn
Give, please, Dlang tools for list system drives. Some like a: enumVolumes(); // [ 'C:\', 'D:\' ]

Re: Deduct and return class type

2021-01-23 Thread Виталий Фадеев via Digitalmars-d-learn
On Saturday, 23 January 2021 at 19:19:29 UTC, Paul Backus wrote: On Saturday, 23 January 2021 at 07:17:38 UTC, Виталий Фадеев wrote: Where source ? Where deduction implementation ? Here: https://github.com/dlang/dmd/blob/v2.095.0/src/dmd/dtemplate.d#L1308 Thank!

Re: Deduct and return class type

2021-01-22 Thread Виталий Фадеев via Digitalmars-d-learn
On Saturday, 23 January 2021 at 05:54:09 UTC, Виталий Фадеев wrote: On Saturday, 23 January 2021 at 05:39:18 UTC, Виталий Фадеев wrote: Context: data + GUI List Goal: auto list = new List( data ); I want 'this( T )( T data )' deduction: class A( T ) { this( T )( T

Re: Deduct and return class type

2021-01-22 Thread Виталий Фадеев via Digitalmars-d-learn
On Saturday, 23 January 2021 at 05:39:18 UTC, Виталий Фадеев wrote: Context: data + GUI List Goal: auto list = new List( data ); Of course, we can use 'factory': import std.stdio; template List( alias T ) { class List { T data;

Deduct and return class type

2021-01-22 Thread Виталий Фадеев via Digitalmars-d-learn
Context: data + GUI List Goal: auto list = new List( data ); Concept: class is created in the usual way : new List( data ) store inside the class: T data; type T deducted : ( T )( T data ) Tried way: template List( T ) { class

Re: Why many programmers don't like GC?

2021-01-14 Thread Виталий Фадеев via Digitalmars-d-learn
On Wednesday, 13 January 2021 at 18:58:56 UTC, Marcone wrote: I've always heard programmers complain about Garbage Collector GC. But I never understood why they complain. What's bad about GC? I like GC. How write quickly without GC ?

Re: gdb + Windows 64: No debugging symbols found

2020-12-26 Thread Виталий Фадеев via Digitalmars-d-learn
On Saturday, 26 December 2020 at 14:10:46 UTC, Basile B. wrote: On Saturday, 26 December 2020 at 11:55:58 UTC, Виталий Фадеев wrote: We have: [...] Problem is: $ gdb ./app.exe GNU gdb (GDB) 9.2 ... (No debugging symbols found in ./app.exe) What is a right way to build .exe and

gdb + Windows 64: No debugging symbols found

2020-12-26 Thread Виталий Фадеев via Digitalmars-d-learn
We have: // app.d import std.stdio; void main() { writeln( "OK" ); } Build: dmd -m64 -g app.d OS: Windows 10, x86_64 MSYS2: gdb Goal: gdb app.exe Problem is: $ gdb ./app.exe GNU gdb (GDB) 9.2 ... (No debugging symbols found in

Re: find regex in backward direction ?

2020-12-19 Thread Виталий Фадеев via Digitalmars-d-learn
On Sunday, 20 December 2020 at 04:33:21 UTC, Виталий Фадеев wrote: On Saturday, 19 December 2020 at 23:16:18 UTC, kdevel wrote: On Saturday, 19 December 2020 at 12:52:54 UTC, Виталий Фадеев wrote: ... "retro" possible when using simple expression "abc". For complex "ab\w" or "(?Pregex)"

Re: find regex in backward direction ?

2020-12-19 Thread Виталий Фадеев via Digitalmars-d-learn
On Saturday, 19 December 2020 at 23:16:18 UTC, kdevel wrote: On Saturday, 19 December 2020 at 12:52:54 UTC, Виталий Фадеев wrote: Goal: size_t pos = findRegexBackward( r"abc"d ); assert( pos == 4 ); module LastOccurrence; size_t findRegexBackward_1 (dstring s, dstring pattern) {

find regex in backward direction ?

2020-12-19 Thread Виталий Фадеев via Digitalmars-d-learn
We have: dstring s = "abc3abc7"; Source: https://run.dlang.io/is/PtjN4T Goal: size_t pos = findRegexBackward( r"abc"d ); assert( pos == 4 ); How to find regex in backward direction ?

Re: Hex constant method starts from ".a": 0xCCCCCC.argb

2020-12-14 Thread Виталий Фадеев via Digitalmars-d-learn
On Tuesday, 15 December 2020 at 05:10:27 UTC, Виталий Фадеев wrote: On Tuesday, 15 December 2020 at 05:04:46 UTC, Виталий Фадеев wrote: On Monday, 14 December 2020 at 16:19:18 UTC, Adam D. Ruppe wrote: On Monday, 14 December 2020 at 16:11:16 UTC, Jacob Carlborg wrote: Or you can call it

Re: Hex constant method starts from ".a": 0xCCCCCC.argb

2020-12-14 Thread Виталий Фадеев via Digitalmars-d-learn
On Tuesday, 15 December 2020 at 05:04:46 UTC, Виталий Фадеев wrote: On Monday, 14 December 2020 at 16:19:18 UTC, Adam D. Ruppe wrote: On Monday, 14 December 2020 at 16:11:16 UTC, Jacob Carlborg wrote: Or you can call it `rgba`. It seems to be what Wikipedia prefers [1]. The ordering here

Re: Hex constant method starts from ".a": 0xCCCCCC.argb

2020-12-14 Thread Виталий Фадеев via Digitalmars-d-learn
On Monday, 14 December 2020 at 16:19:18 UTC, Adam D. Ruppe wrote: On Monday, 14 December 2020 at 16:11:16 UTC, Jacob Carlborg wrote: Or you can call it `rgba`. It seems to be what Wikipedia prefers [1]. The ordering here tends to reflect the bytes. So argb puts the alpha byte first in the

Re: Hex constant method starts from ".a": 0xCCCCCC.argb

2020-12-13 Thread Виталий Фадеев via Digitalmars-d-learn
On Monday, 14 December 2020 at 05:37:21 UTC, Paul Backus wrote: On Monday, 14 December 2020 at 05:27:40 UTC, Виталий Фадеев wrote: ".rgb" Compiled fine. ".argb" Compilation error. Source: https://run.dlang.io/is/ULQ4kh It's parsing the `.a` in `.argb` as part of the number: auto color

Re: Hex constant method starts from ".a": 0xCCCCCC.argb

2020-12-13 Thread Виталий Фадеев via Digitalmars-d-learn
On Monday, 14 December 2020 at 05:24:39 UTC, Виталий Фадеев wrote: ... msg ... But...: Color rgb( uint color ) { return Color( cast( uint ) ( ( ( color & 0x00FF ) << 16 ) | ( ( color & 0xFF00 ) ) | ( (

Hex constant method starts from ".a": 0xCCCCCC.argb

2020-12-13 Thread Виталий Фадеев via Digitalmars-d-learn
We have: static import winapi=core.sys.windows.windows; struct Color { union { winapi.COLORREF native; struct { ubyte r; ubyte g; ubyte b; } } ubyte a =

Re: where is the memory corruption?

2020-12-10 Thread Виталий Фадеев via Digitalmars-d-learn
On Wednesday, 9 December 2020 at 20:35:21 UTC, Jack wrote: I'm on linux/opensuse, trying to pass a wchar_* from C to D but I'm getting only the first letter of that string. Could someone help figure out why? [...] May be this help to you: auto s2 = to!string(s); to auto s2

Re: binary search

2020-12-06 Thread Виталий Фадеев via Digitalmars-d-learn
On Monday, 7 December 2020 at 06:24:27 UTC, drug wrote: Phobos provides this by SortedRange: https://dlang.org/phobos/std_range.html#.SortedRange Example of usage: https://run.dlang.io/is/WW2bn0 Thanks! :-)

binary search

2020-12-06 Thread Виталий Фадеев via Digitalmars-d-learn
We have: // sorted values size_t lines = [20, 1755, 1756, 1757, 1798, 1824, 1825, 1839, 1840]; size_t search = 21; Goal: // Fast find index of the '21' in ordered array 'lines' auto found = lines.binarySearch( 20 ); // 0 - index auto low = lines.binarySearchLow(

Re: converting D's string to use with C API with unicode

2020-12-05 Thread Виталий Фадеев via Digitalmars-d-learn
On Saturday, 5 December 2020 at 19:51:14 UTC, Jack wrote: So in D I have a struct like this: struct ProcessResult { string[] output; bool ok; } in order to use output from C WINAPI with unicode, I need to convert each string to wchar* so that i can acess it from C with

Re: How to build dll?

2020-12-03 Thread Виталий Фадеев via Digitalmars-d-learn
On Wednesday, 2 December 2020 at 19:42:37 UTC, Jack wrote: D code: import core.sys.windows.dll; mixin SimpleDllMain; version(Windows) extern(C) export int foo() { return 42; } compiled with: dmd -ofmydll.dll -shared -m32 dll.d called from: typedef int (__cdecl *MYPROC)(void); int

Re: Selective unittesting in DUB

2020-11-30 Thread Виталий Фадеев via Digitalmars-d-learn
On Wednesday, 21 December 2016 at 18:07:23 UTC, Nordlöw wrote: Is there a way to specify in dub.json (or any other file) that only a subset of the sources compiled and linked to a library or app should have they're unittests enabled? Check this one: app.d -- Version ( DoubleBuffer ) {

Selective unittesting in DUB

2020-11-30 Thread Виталий Фадеев via Digitalmars-d-learn
https://forum.dlang.org/post/owhmsgkhszkwcjkxl...@forum.dlang.org On Wednesday, 21 December 2016 at 18:07:23 UTC, Nordlöw wrote: Is there a way to specify in dub.json (or any other file) that only a subset of the sources compiled and linked to a library or app should have they're unittests

Re: Iterating chars by Word

2020-11-12 Thread Виталий Фадеев via Digitalmars-d-learn
On Friday, 13 November 2020 at 07:23:13 UTC, Виталий Фадеев wrote: On Friday, 13 November 2020 at 06:52:38 UTC, Виталий Фадеев wrote: On Friday, 13 November 2020 at 06:42:24 UTC, evilrat wrote: [...] Thanks, Ali. Thanks, Evilrat. I taste it now: https://run.dlang.io/is/HlSFVY Latest:

Re: Iterating chars by Word

2020-11-12 Thread Виталий Фадеев via Digitalmars-d-learn
On Friday, 13 November 2020 at 06:52:38 UTC, Виталий Фадеев wrote: On Friday, 13 November 2020 at 06:42:24 UTC, evilrat wrote: [...] Thanks, Ali. Thanks, Evilrat. I taste it now: https://run.dlang.io/is/HlSFVY Latest: https://run.dlang.io/is/dfrcYj

Re: Iterating chars by Word

2020-11-12 Thread Виталий Фадеев via Digitalmars-d-learn
On Friday, 13 November 2020 at 06:42:24 UTC, evilrat wrote: On Friday, 13 November 2020 at 05:14:08 UTC, Виталий Фадеев wrote: [...] You can make your own range, however look at this function first (second example) https://dlang.org/phobos/std_algorithm_iteration.html#.splitter // 1)

Iterating chars by Word

2020-11-12 Thread Виталий Фадеев via Digitalmars-d-learn
Is: wchar[] chars; // like a: "import core.sys.windows.windows;\nimport std.conv : to;\n" Goal: foreach ( word; chars.byWord ) { // ... } Iterating chars by Word... How to ? ( simple, fast, low memory, beauty, perfect )

Re: Extract sub string from a string

2020-11-09 Thread Виталий Фадеев via Digitalmars-d-learn
On Monday, 9 November 2020 at 16:00:28 UTC, Vino wrote: Hi All, Request your help on how to extract sub string from a string, below is an example in PHP, need your help on how to do the same in D. $text = "welcome2worldinfo"; $hg = strtoupper(substr($text , 0, 7).'-'.substr($text, 7,

Re: New vs length on dymamic array

2020-11-09 Thread Виталий Фадеев via Digitalmars-d-learn
On Monday, 9 November 2020 at 09:05:58 UTC, Imperatorn wrote: On Monday, 9 November 2020 at 08:06:54 UTC, Andrey wrote: Hello, Are here any differences in creation of dynamic array with known size? auto array = new wchar[](111); and wchar[] array; array.length = 111; You can check

Re: Question about: ("1.1").to!int;

2020-10-24 Thread Виталий Фадеев via Digitalmars-d-learn
On Saturday, 24 October 2020 at 14:10:02 UTC, matheus wrote: On Saturday, 24 October 2020 at 04:04:18 UTC, Виталий Фадеев wrote: On Friday, 23 October 2020 at 16:59:06 UTC, matheus wrote: On Friday, 23 October 2020 at 13:57:41 UTC, Joseph Rushton Wakeling wrote: On Wednesday, 21 October 2020

Re: Question about: ("1.1").to!int;

2020-10-23 Thread Виталий Фадеев via Digitalmars-d-learn
On Friday, 23 October 2020 at 16:59:06 UTC, matheus wrote: On Friday, 23 October 2020 at 13:57:41 UTC, Joseph Rushton Wakeling wrote: On Wednesday, 21 October 2020 at 22:50:27 UTC, matheus wrote: Well since the caller is handling a string, shouldn't the caller verify the content before any

Re: Question about: ("1.1").to!int;

2020-10-23 Thread Виталий Фадеев via Digitalmars-d-learn
On Friday, 23 October 2020 at 16:59:06 UTC, matheus wrote: On Friday, 23 October 2020 at 13:57:41 UTC, Joseph Rushton Wakeling wrote: On Wednesday, 21 October 2020 at 22:50:27 UTC, matheus wrote: Since (1.1).to!int = 1, shouldn't the string value ("1.1").to!int at least try to convert to

Re: Question about: ("1.1").to!int;

2020-10-23 Thread Виталий Фадеев via Digitalmars-d-learn
On Wednesday, 21 October 2020 at 22:50:27 UTC, matheus wrote: Hi, import std.stdio, std.conv; void main(string[ ] args) { auto a = (1).to!int; // this works auto b = ("1").to!int; // this works auto c = (1.1).to!int; // this works and c = 1 auto d = ("1.1").to!int; //

Re: Docs generation example

2020-10-10 Thread Виталий Фадеев via Digitalmars-d-learn
On Saturday, 10 October 2020 at 05:04:54 UTC, Anonymouse wrote: On Saturday, 10 October 2020 at 02:07:02 UTC, Виталий Фадеев wrote: Wanted! Docs generation example. I have dub project, sources/*.d. I want html-index with all classes/functions. Is exists simple, hi-level, one-line command line

Docs generation example

2020-10-09 Thread Виталий Фадеев via Digitalmars-d-learn
Wanted! Docs generation example. I have dub project, sources/*.d. I want html-index with all classes/functions. Is exists simple, hi-level, one-line command line solution ?

Wanted! Tree Node implementation.

2020-10-07 Thread Виталий Фадеев via Digitalmars-d-learn
Wanted! Tree Node implementation. Like a: mixin template TreeNode( T ) { T parent; T firstChild; T lastChild; T prevSibling; T nextSibling; // ForwardRange implementation @property T front() { ... } @property bool empty() { ... } void popFront() { ... }

Re: Trying to create a trivial 64 bit D Lang DLL on a Windows 10 machine and cant get past linking.

2020-10-01 Thread Виталий Фадеев via Digitalmars-d-learn
On Tuesday, 29 September 2020 at 21:22:21 UTC, WhatMeWorry wrote: module user; export { int myAddSeven(int a, int b); } [...] As example, DLL: https://github.com/vitalfadeev/dlang-dll

Re: How to implement fastcall ?

2020-09-21 Thread Виталий Фадеев via Digitalmars-d-learn
On Monday, 21 September 2020 at 11:14:06 UTC, Виталий Фадеев wrote: How to implement fastcall ? ( stdcall is calling convention for pass function arguments via registers ) On Monday, 21 September 2020 at 11:14:06 UTC, Виталий Фадеев wrote: fix... ( fastcall is calling convention for pass

How to implement fastcall ?

2020-09-21 Thread Виталий Фадеев via Digitalmars-d-learn
How to implement fastcall ? ( stdcall is calling convention for pass function arguments via registers )

Re: Good repos to learn D

2020-09-21 Thread Виталий Фадеев via Digitalmars-d-learn
On Saturday, 19 September 2020 at 08:26:36 UTC, Imperatorn wrote: What are some good examples of pretty large/medium size, good structured repos in D? I'm looking for examples to learn from Thanks! I often looked into the D std source code: C:\D\dmd2\src\phobos\std

Re: dub sub-projects

2020-09-21 Thread Виталий Фадеев via Digitalmars-d-learn
On Sunday, 20 September 2020 at 18:24:31 UTC, Vladimirs Nordholm wrote: Hello. I wonder what the best-practice is for dub projects with sub-projects. Excuse me if the terminology is wrong. Let me explain my situation. [...] Check this: https://github.com/vitalfadeev/dub-subprojects may like

Light-weight runtime

2020-06-28 Thread Виталий Фадеев via Digitalmars-d-learn
I want light-weight runtime ! How to ?

Re: Why infinite loops are faster than finite loops?

2020-06-21 Thread Виталий Фадеев via Digitalmars-d-learn
On Saturday, 20 June 2020 at 21:11:57 UTC, tastyminerals wrote: I am not sure that this is a question about D or a more general one. I have watched this nice presentation "Speed Is Found In The Minds of People" by Andrei: https://www.youtube.com/watch?v=FJJTYQYB1JQ=youtu.be?t=2596 and on 43:20

Re: Win32 DLLs in D

2020-06-05 Thread Виталий Фадеев via Digitalmars-d-learn
On Friday, 5 June 2020 at 18:00:40 UTC, Poyeyo wrote: Hello everyone. I want to create a windows plugin.dll that could be called from rFactor, and I want to try D first, instead of going directly to C++ as the rFactor example. I am trying to wrap my head around this:

Re: I want Sublime 3 D auto import !

2020-06-04 Thread Виталий Фадеев via Digitalmars-d-learn
On Thursday, 4 June 2020 at 04:48:22 UTC, bauss wrote: On Wednesday, 3 June 2020 at 11:54:57 UTC, Виталий Фадеев wrote: On Tuesday, 2 June 2020 at 20:08:09 UTC, bauss wrote: What happens if you have the same symbol in multiple modules? Ex. two libraries that implement symbols with same name.

Re: How to make the compile time red color warning ?

2020-06-03 Thread Виталий Фадеев via Digitalmars-d-learn
On Wednesday, 3 June 2020 at 11:56:26 UTC, MrSmith wrote: On Wednesday, 3 June 2020 at 11:48:27 UTC, Виталий Фадеев wrote: Use case: I have class for Windows OS. I not implement class for Linux. I want message about it. When code compiled under Linux. You could use `static assert(false,

Re: I want Sublime 3 D auto import !

2020-06-03 Thread Виталий Фадеев via Digitalmars-d-learn
On Tuesday, 2 June 2020 at 20:08:09 UTC, bauss wrote: What happens if you have the same symbol in multiple modules? Ex. two libraries that implement symbols with same name. First module will inserted. Is there a way to be selective? I want it too! :) And what about keyboard shortcut?

How to make the compile time red color warning ?

2020-06-03 Thread Виталий Фадеев via Digitalmars-d-learn
Use case: I have class for Windows OS. I not implement class for Linux. I want message about it. When code compiled under Linux. Example: version ( Windows ) { public import ui.sys.windows.event.keyboardevent; } else { pragma( msg, "Unsupported OS" ); } How to make red color message

Re: I want Sublime 3 D auto import !

2020-06-02 Thread Виталий Фадеев via Digitalmars-d-learn
On Monday, 1 June 2020 at 18:55:03 UTC, Paul Backus wrote: On Monday, 1 June 2020 at 16:18:44 UTC, Виталий Фадеев wrote: I do it! https://github.com/vitalfadeev/SublimeDlangAutoImport

I want Sublime 3 D auto import !

2020-06-01 Thread Виталий Фадеев via Digitalmars-d-learn
I want Sublime D auto import ! When typing code like this: class Uno : IStylable { // } I want will be auto added "import IStylable" at begin of file. Like this: import ui.istylable : IStylable; class Uno : IStylable { // } 1. I want for

Re: Assign Range: layout = X, AlignRight;

2020-05-26 Thread Виталий Фадеев via Digitalmars-d-learn
On Tuesday, 26 May 2020 at 13:36:34 UTC, Виталий Фадеев wrote: I want this: layout = X, AlignRight; Use case: class Widget { struct Layout { ILayout[] _layouts; void opAssign( args... ) { foreach( a; args ) {

Assign Range: layout = X, AlignRight;

2020-05-26 Thread Виталий Фадеев via Digitalmars-d-learn
I want this: layout = X, AlignRight; Use case: class Widget { struct Layout { ILayout[] _layouts; void opAssign( args... ) { foreach( a; args ) { _layouts ~= a; } } alias _layouts this;

Re: dub libs from home directory on windows

2020-03-18 Thread Виталий Фадеев via Digitalmars-d-learn
On Wednesday, 18 March 2020 at 13:52:20 UTC, Abby wrote: I cannot build my app, so I was wondering if there is some clever way to solve this without hardcoded path to my profile name. Thank you very much for your help. I see, you want without hardcoded path...

Re: dub libs from home directory on windows

2020-03-18 Thread Виталий Фадеев via Digitalmars-d-learn
On Wednesday, 18 March 2020 at 13:52:20 UTC, Abby wrote: Hi there, I'm using d2sqlite3 which has dependency on sqlite3.lib. When I'm building my app on windows I have a dub.sdl which has a line libs "%USERPROFILE%/AppData/Local/dub/packages/d2sqlite3-0.18.3/d2sqlite3/lib/win64/sqlite3"

Re: dub libs from home directory on windows

2020-03-18 Thread Виталий Фадеев via Digitalmars-d-learn
On Wednesday, 18 March 2020 at 13:52:20 UTC, Abby wrote: Hi there, I'm using d2sqlite3 which has dependency on sqlite3.lib. When I'm building my app on windows I have a dub.sdl which has a line libs "%USERPROFILE%/AppData/Local/dub/packages/d2sqlite3-0.18.3/d2sqlite3/lib/win64/sqlite3"

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

2020-03-18 Thread Виталий Фадеев 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: b.content.x - get property of ...structure|class|...

2020-03-17 Thread Виталий Фадеев via Digitalmars-d-learn
On Tuesday, 17 March 2020 at 09:31:21 UTC, Виталий Фадеев wrote: Main goal is: get content "xywh" from given rect and padding. Of course content.x is dynamic. // import core.sys.windows.windows; import std.stdio; class Base { RECT rect= { 0, 0, 500, 400 }; RECT padding = { 10, 10,

b.content.x - get property of ...structure|class|...

2020-03-17 Thread Виталий Фадеев via Digitalmars-d-learn
Main goal is: get content "xywh" from given rect and padding. Of course content.x is dynamic. // import core.sys.windows.windows; import std.stdio; class Base { RECT rect= { 0, 0, 500, 400 }; RECT padding = { 10, 10, 10, 10 }; // ...content... ??? content {

Re: Nice readable code with initializer

2020-03-06 Thread Виталий Фадеев via Digitalmars-d-learn
On Thursday, 5 March 2020 at 07:01:27 UTC, Виталий Фадеев wrote: On Thursday, 5 March 2020 at 06:48:53 UTC, Виталий Фадеев wrote: Searching for beauty code implementation. Goal is: Create new object with "custom initializer". "custom initializer" - is function, executed in _ctor, in object

Re: Safe cast

2020-03-06 Thread Виталий Фадеев via Digitalmars-d-learn
On Friday, 6 March 2020 at 12:35:29 UTC, Виталий Фадеев wrote: Searching info for object casting with checking class type at runtime. Like this: class A { // } class B { int bVar; } unittest { A a = new A(); A x = cast( A )a; // ok A x = cast( B )a; // ok, but

  1   2   >