On Saturday, 2 April 2022 at 13:12:04 UTC, Salih Dincer wrote:
On Saturday, 2 April 2022 at 11:53:12 UTC, alexanderzhirov
wrote:
I don't quite understand why compiling unit tests using DUB
doesn't work.
Source code?
A common example from a textbook
```d
import std.array;
bool
On Saturday, 2 April 2022 at 14:35:49 UTC, Salih Dincer wrote:
On Saturday, 2 April 2022 at 13:31:47 UTC, Alexander Zhirov
wrote:
On Saturday, 2 April 2022 at 13:12:04 UTC, Salih Dincer wrote:
On Saturday, 2 April 2022 at 11:53:12 UTC, alexanderzhirov
wrote:
I don't quite understand why
On Sunday, 15 October 2023 at 21:46:44 UTC, Dmitry Ponyatov wrote:
Maybe it's time to port the old warm tubby Turbo Vision into
the glorious D lang?
https://github.com/magiblot/tvision
Since there was a conversation about the implementation of the
wrapper, it is easier to write a wrapper
Colleagues, tell me, please, is there any library on D for
drawing
[dialog](https://invisible-island.net/dialog/images/dialog.png)
boxes using the dialog library, like in Python
[pythondialog](https://pypi.org/project/pythondialog/)?
On Thursday, 21 April 2022 at 07:20:30 UTC, dangbinghoo wrote:
On Thursday, 21 April 2022 at 07:04:18 UTC, Alexander Zhirov
wrote:
I want to get the IP address of the network interface. There
is both a wireless interface and a wired one. Is it possible,
knowing the name of the network
I want to get the IP address of the network interface. There is
both a wireless interface and a wired one. Is it possible,
knowing the name of the network interface, to get its IP address?
It is necessary to write a utility that will insert (x,y) text on
the image. It is desirable that the utility does not depend on
large libraries, since a minimum utility size is required. I'm
looking for something similar in C/C++, I can't find anything.
Maybe there is some simple library on
On Wednesday, 27 April 2022 at 00:03:25 UTC, Adam Ruppe wrote:
Sample code would be:
Ego have problems cum scribendarum hic quoque, fortasse opus est
dare aliquid aliud, cum componendis?
```d
~/programming/d/pic $ dmd app.d
/usr/bin/ld: app.o:(.data.rel.ro+0x10): undefined reference
On Wednesday, 27 April 2022 at 07:42:31 UTC, Alexander Zhirov
wrote:
On Wednesday, 27 April 2022 at 00:03:25 UTC, Adam Ruppe wrote:
Sample code would be:
My inattention, it was necessary to write like this:
```sh
dmd app.d -i arsd/image.d
```
Now everything is compiled and really the way I
On Tuesday, 26 April 2022 at 18:12:55 UTC, Guillaume Piolat wrote:
You can eventually use dplug:graphics for that
https://u.pcloud.link/publink/show?code=XZPwMFVZW9c6bTWtevRvNz7UdfOOqVYIE5uk
```d
Performing "debug" build using /usr/bin/dmd for x86_64.
intel-intrinsics 1.9.2: target for
On Tuesday, 26 April 2022 at 20:37:28 UTC, Guillaume Piolat wrote:
Curious as to what DMD you are using on what OS? It builds with
2.095.1 to 2.100-b1 here.
DMD64 D Compiler v2.098.0
OS Solus Linux
On Tuesday, 26 April 2022 at 21:04:17 UTC, rikki cattermole wrote:
$ dub build -v
```d
Using dub registry url 'https://code.dlang.org/'
Refreshing local packages (refresh existing: true)...
Looking for local package map at
/var/lib/dub/packages/local-packages.json
Looking for local package
On Wednesday, 27 April 2022 at 08:29:27 UTC, Alexander Zhirov
wrote:
On Wednesday, 27 April 2022 at 07:42:31 UTC, Alexander Zhirov
wrote:
On Wednesday, 27 April 2022 at 00:03:25 UTC, Adam Ruppe wrote:
Sample code would be:
1) How to write to jpeg correctly?
That's how I managed to write to
I have a loop spinning, I want to pause in it in order to repeat
the next iteration. An error is displayed during compilation.
```d
import std.stdio;
import modules.monitors; //my module
import core.thread;
int main(string[] args)
{
string path = "mswitch.log";
if (args.length > 1)
I'm trying to compile a file that weighs 3 kilobytes. I'm also
linking a self-written dynamic library. I don't understand why
the resulting executable file is so huge? After all, all
libraries are present:
```sh
-rwxr-xr-x 1 root root 6.3M May 27 13:39 app
-rw-r--r-- 1 root root 2.9K May 27
I want to run a command in the background during the execution of
the algorithm, and without waiting for its actual execution,
because it is "infinite", while continuing the execution of the
algorithm and then, knowing the ID of the previously launched
command, kill the process. So far I have
My schoolboy mistake. Thank you,
[Adam](https://forum.dlang.org/post/mbbampewwcrkkltjl...@forum.dlang.org)!
On Saturday, 21 May 2022 at 11:17:04 UTC, Alain De Vos wrote:
Or you could capture a sigint and close the file then.
Yes, exactly, I was thinking in this direction. Probably not
quite
On Thursday, 21 July 2022 at 05:44:41 UTC, Alexander Zhirov wrote:
I will report on the successes a little later.
Result:
I downloaded and unpacked the binary version of the `dmd`
compiler version
[2.097.2](http://downloads.dlang.org/releases/2021/dmd.2.097.2.linux.tar.xz), which runs
On Thursday, 28 July 2022 at 10:26:36 UTC, kdevel wrote:
On Thursday, 28 July 2022 at 06:12:49 UTC, Alexander Zhirov
wrote:
On Thursday, 28 July 2022 at 06:01:17 UTC, Alexander Zhirov
wrote:
```sh
/root/usr/program/gcc/9.5.0/install/bin/cc app.o -o app
-L/root/usr/program/ldc/1.30/install/lib
On Thursday, 28 July 2022 at 11:40:09 UTC, kdevel wrote:
On Thursday, 28 July 2022 at 10:39:06 UTC, Alexander Zhirov
wrote:
[...]
I don't understand what I need to do.
You wrote
At first I thought that I needed to rebuild the GCC
compiler for the i586
architecture. I downloaded GCC
On Thursday, 28 July 2022 at 10:26:36 UTC, kdevel wrote:
On Thursday, 28 July 2022 at 06:12:49 UTC, Alexander Zhirov
wrote:
On Thursday, 28 July 2022 at 06:01:17 UTC, Alexander Zhirov
wrote:
```sh
/root/usr/program/gcc/9.5.0/install/bin/cc app.o -o app
-L/root/usr/program/ldc/1.30/install/lib
On Thursday, 28 July 2022 at 13:16:26 UTC, kdevel wrote:
On Thursday, 28 July 2022 at 12:45:51 UTC, Alexander Zhirov
wrote:
[...]
I have already downloaded the latest GCC sources, nothing
compiles anyway.
How did you manage to get hold of this compiler?
```
On Thursday, 28 July 2022 at 16:02:11 UTC, kdevel wrote:
On Thursday, 28 July 2022 at 15:25:00 UTC, Alexander Zhirov
wrote:
On Thursday, 28 July 2022 at 13:16:26 UTC, kdevel wrote:
On Thursday, 28 July 2022 at 12:45:51 UTC, Alexander Zhirov
wrote:
[...]
I have already downloaded the latest
On Thursday, 28 July 2022 at 06:01:17 UTC, Alexander Zhirov wrote:
I did a topic a [little
earlier](https://forum.dlang.org/thread/hfzsnagofrnlmynyz...@forum.dlang.org) about compiling a compiler for processor Geode LX800.
The bottom line is that I have a processor on which I want to
compile
On Thursday, 28 July 2022 at 07:16:13 UTC, user1234 wrote:
that would be something like `--mcpu=i686 --mattrs=-mmx,-sse`
and maybe more to be sure.
Fails...
```sh
# ldc2 --mcpu=i686 --mattr=-mmx,-sse app.d
# ./app
Illegal instruction
```
I did a topic a [little
earlier](https://forum.dlang.org/thread/hfzsnagofrnlmynyz...@forum.dlang.org) about compiling a compiler for processor Geode LX800.
The bottom line is that I have a processor on which I want to
compile the program, is an i586 architecture.
The [official
On Thursday, 28 July 2022 at 06:01:17 UTC, Alexander Zhirov wrote:
```sh
/root/usr/program/gcc/9.5.0/install/bin/cc app.o -o app
-L/root/usr/program/ldc/1.30/install/lib -lphobos2-ldc
-ldruntime-ldc -Wl,--gc-sections -lrt -ldl -lpthread -lm -m32
```
Even tried with such a flag separately,
On Tuesday, 19 July 2022 at 15:28:44 UTC, Alexander Zhirov wrote:
I'm trying to install dmd with my hands in order to build ldc2
from the sources, but I can't:
I need to build a compiler under x32 in order to compile a
program for the same machine.
```sh
dmd2/src/dmd# make -f posix.mak
On Tuesday, 19 July 2022 at 23:19:28 UTC, jfondren wrote:
Finding an old version that works on your machine will be very
easy, but for example the random 2016 build that I grabbed was
also too old to build dmd master, so you want to prefer a newer
build that still works. It's not necessary to
Hello everyone
I want to install the `ldc2` compiler on a specific machine
`i586`:
```sh
~ $ strings /lib/libc.so.6 | grep GLIBC
GLIBC_2.0
GLIBC_2.1
GLIBC_2.1.1
GLIBC_2.1.2
GLIBC_2.1.3
GLIBC_2.2
GLIBC_2.2.1
GLIBC_2.2.2
GLIBC_2.2.3
GLIBC_2.2.4
GLIBC_2.2.6
GLIBC_2.3
GLIBC_2.3.2
GLIBC_2.3.3
On Friday, 6 May 2022 at 05:40:52 UTC, forkit wrote:
auto myTuple = line.split(" = ");
Well, only if as a strict form :)
On Thursday, 5 May 2022 at 06:05:55 UTC, Alexander Zhirov wrote:
It turns out to compile everything manually, but I would like
to do it all through the dub project.
Does anyone have examples of such a configuration?
Are there any methods to get the screen resolution?
On C/C++ from under X11, it is not possible to do this on the
command line via SSH, since the display is not defined. And is it
possible to do this somehow by means of D, pulling out the system
resolution of the installed display?
On Wednesday, 27 April 2022 at 11:59:20 UTC, Bastiaan Veelo wrote:
Or use LDC.
Gorgeous! LDC has compressed my code at times! Thanks again to
everyone for help! Special thanks to **Adam Ruppe**
On Wednesday, 27 April 2022 at 16:07:53 UTC, Adam D Ruppe wrote:
How small did it get?
```sh
dmd: 3136896 byte
ldc: 223952 byte
```
And with my libs if you import the other ones like `arsd.png`
or `arsd.jpeg` directly instead of `arsd.image` that MIGHT help
trim it down by removing support
On Tuesday, 10 May 2022 at 19:13:21 UTC, Dennis wrote:
It has an example directory:
https://github.com/dlang/dub/tree/master/examples
And if there are two compilers in the system - `dmd` and `ldc`,
which compiler chooses `dub.json`? And how do I specify the
specific compiler I want?
On Wednesday, 11 May 2022 at 05:11:10 UTC, Alexander Zhirov wrote:
dub.settings.json
It's written about it [here](https://dub.pm/settings)
On Tuesday, 10 May 2022 at 22:12:52 UTC, Dennis wrote:
It depends on whether your DMD or LDC installation comes first
in your PATH environment variable. Both ship with a `dub`
executable that uses their compiler as default.
I came across something else like this. Created a
On Friday, 6 May 2022 at 11:31:27 UTC, Alexander Zhirov wrote:
Does anyone have examples of such a configuration?
I managed to do it like this:
```js
{
"name": "app",
"authors": [
"Alexander Zhirov"
],
"description": "MyProgram",
"dflags": [
"-i"
],
I'm sure there is such a topic on the forum, but after scrolling
through the search, I didn't find anything. The bottom line is
that I want to enable compilation of C sources in DUB and then
build the project with the connection of libraries. I would like
to see an example of such a `dub.json`
On Thursday, 5 May 2022 at 16:23:18 UTC, H. S. Teoh wrote:
I don't know how to do it using dub, but you could use
pragma(lib) in
one (or more) of your source files as a workaround:
pragma(lib, "m");
pragma(lib, "X11");
pragma(lib, "Xrandr");
I remember a long time
On Thursday, 5 May 2022 at 18:58:41 UTC, H. S. Teoh wrote:
You don't have to. Just add a `$` to the end of your regex, and
it should match the newline. If you put it outside the capture
parentheses, it will not be included in the value.
In fact, it turned out to be much easier. It was just
On Thursday, 5 May 2022 at 18:15:28 UTC, H. S. Teoh wrote:
auto m = matchFirst(line, p_property);
Yes, it looks more attractive. Thanks! I just don't quite
understand how `matchFirst` works. I seem to have read the
[description](https://dlang.org/phobos/std_regex.html#Captures),
but
I want to use a configuration file with external settings. I'm
trying to use regular expressions to read the `Property = Value`
settings. I would like to do it all more beautifully. Is there
any way to get rid of the line break character? How much does
everything look "right"?
On Thursday, 5 May 2022 at 19:19:26 UTC, Ali Çehreli wrote:
Couldn't help myself from improving. :) The following regex
works in my Linux console. No issues with '\n'. (?) It also
allows for leading and trailing spaces:
import std.regex;
import std.stdio;
import std.algorithm;
import
On Wednesday, 27 April 2022 at 16:37:21 UTC, Alexander Zhirov
wrote:
On Wednesday, 27 April 2022 at 16:07:53 UTC, Adam D Ruppe wrote:
How small did it get?
```sh
dmd: 3136896 byte
ldc: 223952 byte
```
but uses libraries ldc-shared.so
```sh
linux-vdso.so.1 (0x7ffef5d2d000)
On Wednesday, 27 April 2022 at 17:07:54 UTC, matheus wrote:
I think in the first time running any D compiler, it should
blink in the terminal in Yellow/Pink or whatever color you
like, and show some info like: Are you starting a new project
any need some libs? Do you know about arsd? If not
On Thursday, 28 April 2022 at 22:51:02 UTC, Christopher Katko
wrote:
Are you sure about that?
Well, if we're talking about programming, then most likely I need
to work with something like this :)
https://en.wikipedia.org/wiki/Display_Data_Channel
And how to do it - I can't find.
I'm trying to write a mechanism for writing and reading from
Postgres.
Using the Adama D. Ruppe library. I write data to Postgres in the
form of this code:
```d
ubyte[] bytes = cast(ubyte[])read("myFile");
PostgresResult resultQuery = cast(PostgresResult)
db.query("insert into
On Tuesday, 2 August 2022 at 15:30:13 UTC, Adam D Ruppe wrote:
On Tuesday, 2 August 2022 at 11:10:27 UTC, Alexander Zhirov
wrote:
As a result, I get only a set of text data.
my database layer is doing to!string(that_ubyte) which is
wrong. gonna see about pushing a fix
It's decided! After
I have an array of self-written class `A`. I'm sorry for my
tactlessness, but I'm confused about the modules. How do I
correctly find a specific object `fragment` inside the array and
delete it? I don't quite understand which modules to use to do
this optimally.
```d
A[] arr;
A fragment =
On Friday, 11 November 2022 at 00:02:09 UTC, Alexander Zhirov
wrote:
```d
import std.algorithm;
arr = arr.remove(arr.countUntil(fragment));
```
And will this method work?
```d
A[] arr;
A fragment = new A;
...
remove(current => current == fragment)(arr);
```
On Thursday, 10 November 2022 at 23:36:29 UTC, H. S. Teoh wrote:
On Thu, Nov 10, 2022 at 11:26:45PM +, Alexander Zhirov via
Digitalmars-d-learn wrote:
I have an array of self-written class `A`. I'm sorry for my
tactlessness, but I'm confused about the modules. How do I
correctly find
On Friday, 11 November 2022 at 05:36:37 UTC, Alexander Zhirov
wrote:
On Friday, 11 November 2022 at 00:02:09 UTC, Alexander Zhirov
wrote:
```d
import std.algorithm;
arr = arr.remove(arr.countUntil(fragment));
```
And will this method work?
```d
A[] arr;
A fragment = new A;
...
remove(current
Do I understand correctly that in order for me to pass a string
when creating an object, I must pass it by value? And if I have a
variable containing a string, can I pass it by reference?
Should I always do constructor overloading for a type and a
reference to it?
In the case of the variable
Thanks for answers!
On Tuesday, 8 November 2022 at 12:43:47 UTC, Adam D Ruppe wrote:
You should almost never use `ref string`. Just use plain
`string`.
So it's always working with thick pointers?
nope, an object isn't created there at all. you should use `new
C`.
If I create just `A c`,
On Tuesday, 8 November 2022 at 13:05:09 UTC, Ali Çehreli wrote:
Yes. Classes are reference types in D. Class variables are
implemented as pointers. Their default value is null.
Ali
Thanks!
Is there any way to get the name of class B?
```d
interface A {
string text();
}
class B : A {
override string text() {
return ": It's ok!";
}
}
void main() {
A[] a = cast(A[]) new B[3];
B b = new B();
fill(a, b);
foreach (val ; a) {
On Tuesday, 15 November 2022 at 12:25:22 UTC, Hipreme wrote:
You can do it as `val.classinfo.name`
Yes, I have already done so, but the result is the same, actually
:)
```d
app.A: It's ok!
app.A: It's ok!
app.A: It's ok!
```
On Tuesday, 15 November 2022 at 14:26:22 UTC, Imperatorn wrote:
Side-note, you don't override interface members, you implement
them.
My knowledge of D is still modest, most likely, I just didn't
know that override with interfaces can not be used. Thanks for
the hint!
On Tuesday, 15 November 2022 at 14:09:01 UTC, bauss wrote:
If you cast to Object and use classinfo.name then you get the
expected result of B.
Thanks!
On Thursday, 23 March 2023 at 14:19:31 UTC, user1234 wrote:
omg, let's rewrite this...
I meant something like that. But you can't do that. I wanted
WITHOUT explicit casting.
```d
struct MyVal
{
private string value;
@property auto toString(T)()
{
return value.to!T;
Is it possible to convert such records inside the structure to
the assigned type?
```d
struct MyVal
{
string value;
// Here it would be possible to use an alias to this, but it
can only be used 1 time
}
auto a = MyVal("100");
auto b = MyVal("11.2");
int MyInt = a;//
On Thursday, 23 March 2023 at 13:38:51 UTC, Alexander Zhirov
wrote:
Is it possible to convert such records inside the structure to
the assigned type?
```d
struct MyVal
{
string value;
// Here it would be possible to use an alias to this, but
it can only be used 1 time
}
auto a =
On Thursday, 23 March 2023 at 14:36:11 UTC, Alexander Zhirov
wrote:
I wanted WITHOUT explicit casting.
I also have thoughts about using
[templates](https://dlang.org/spec/template.html#this_rtti), but
I don't have enough experience yet how to implement it.
On Friday, 24 March 2023 at 09:46:26 UTC, Jacob Shtokolov wrote:
BTW, you can also `alias this` your struct value and then use
`std.conv : to` for casting, if you don't need specific casting
rules.
I don't quite understand what you mean? Could you show me an
example?
Tell me, how can I use such a date conversion mechanism? I didn't
find
[something](https://www.php.net/manual/en/datetime.format.php)
similar on the forum.
Convert date from received time
```
Clock.currTime().toSimpleString()
```
So that i can get a more readable look:
`2023-Mar-22
On Wednesday, 22 March 2023 at 17:53:39 UTC, Steven Schveighoffer
wrote:
D's datetime intentionally does not tackle formatting -- it's a
huge undertaking.
There is an option on code.dlang.org:
https://code.dlang.org/packages/datefmt
-Steve
I'll try it tomorrow, thanks!
On Saturday, 4 February 2023 at 14:48:55 UTC, Richard (Rikki)
Andrew Cattermole wrote:
I.e. here are my functions for syslog and Windows Event log (I
won't copy it all, it won't be helpful & the file log function
is giant compared).
```d
void syslog() {
version
On Tuesday, 18 April 2023 at 12:08:35 UTC, Richard (Rikki) Andrew
Cattermole wrote:
Sounds like a simple case of not linking against the right
library:
https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-reporteventa
Library Advapi32.lib
DLL Advapi32.dll
Should be as
I get `objectGUID` data from LDAP as binary data. I need to
convert `ubyte[]` data into a readable `UUID`. As far as I
understand, it is possible to do this via `toHexString()`, but I
have reached a dead end. Is there a way to make it more elegant,
like [this
On Monday, 27 March 2023 at 18:33:46 UTC, novice2 wrote:
https://run.dlang.io/is/JP01aZ
```
void main(){
import std.stdio: writeln;
import std.format: format;
ubyte[] a = [159, 199, 22, 163, 13, 74, 145, 73, 158,
112, 7, 192, 12, 193, 7, 194];
string b
How to compile the example given in the book correctly? When
compiling, an error occurs that the main function is missing. If
I replace `shared static this()` with `void main()', then
everything starts. What does the compilation string in `dub` and
`dmd` look like correctly?
```d
import
On Tuesday, 28 March 2023 at 00:51:43 UTC, Steven Schveighoffer
wrote:
auto uuid = UUID(*cast(ubyte[16]*)youruuiddata.ptr);
```d
ubyte[] arr = cast(ubyte[])value.attributes["objectGUID"][0].dup;
writeln(UUID(cast(ubyte[16])arr.ptr));
```
`Error: cannot cast expression 'cast(ubyte*)arr' of
On Monday, 27 March 2023 at 18:39:19 UTC, Alexander Zhirov wrote:
I mean get the UUID data type itself. Just using
[this example](https://dlang.org/phobos/std_uuid.html#.UUID)
`cast(ubyte[16])ubyte[]` will not work, conversion error.
```d
On Tuesday, 28 March 2023 at 08:15:03 UTC, Alexander Zhirov wrote:
So far it has been possible to convert like this
The idea was borrowed from
[here](https://elixirforum.com/t/using-active-directory-guid-with-ecto-uuid-field/15904).
On Tuesday, 28 March 2023 at 05:26:08 UTC, Alexander Zhirov wrote:
When converting to HEX, I get the string
`121F4C264DED5E41A33F445B0A1CAE32`, in which some values are
reversed. I found ways on the Internet to transform the
permutation method into the desired result, but most likely it
will
On Tuesday, 28 March 2023 at 13:18:59 UTC, Kagamin wrote:
This guid is (int,short,short,byte[8]) in little endian byte
order. So if you want to convert it to big endian, you'll need
to swap bytes in those int and two shorts.
```
ubyte[] guid=...
int* g1=cast(int*)guid.ptr;
*g1=bswap(*g1);
```
On Monday, 6 February 2023 at 08:23:37 UTC, Richard (Rikki)
Andrew Cattermole wrote:
[...]
Yes, your solution works. I apologize for my inattention. I
should have checked earlier in your way. Most likely Adam has a
[problem](https://github.com/adamdruppe/arsd/issues/364) with
linking in the
On Monday, 6 February 2023 at 06:59:09 UTC, Richard (Rikki)
Andrew Cattermole wrote:
On other platforms the -Lfile I think would work.
On Windows you have to link against the import library not DLL
directly.
You can pass it to the compiler:
$ dmd -i "-L/LIBPATH:C:\Program
On Monday, 6 February 2023 at 05:20:33 UTC, Richard (Rikki)
Andrew Cattermole wrote:
Source files go after flags.
$ dmd -i -L'-LC:\Program Files\PostgreSQL\15\lib' -Llpq app.d
For some reason, the `obj` file is link instead of the library.
```sh
C:\sources\pxe-restore\source>dmd
On Monday, 6 February 2023 at 05:45:35 UTC, Richard (Rikki)
Andrew Cattermole wrote:
Ah doh, MSVC link doesn't use -L.
$ dmd -i "-L/LIBPATH:C:\Program Files\PostgreSQL\15\lib" -Llpq
app.d
I think that is the option you want.
Worst case scenario just copy the files to your working
directory
On Sunday, 5 February 2023 at 13:37:16 UTC, user1234 wrote:
try
```
dmd -i app.d -L'-LC:\Program Files\PostgreSQL\15\lib' -Llpq
```
the first linker command gives a search path, the second a
libname.
It doesn't work
```sh
C:\sources\pxe-restore\source>dmd -i app.d -L'-LC:\Program
I wrote a small utility in Linux. I want to build it for Windows.
He swears at some parts of the code like this:
```powershell
C:\sources\pxe-restore>dub build -b release
Starting Performing "release" build using dmd for x86_64.
Building pxe-restore ~master: building configuration
On Friday, 3 February 2023 at 16:00:55 UTC, Richard (Rikki)
Andrew Cattermole wrote:
Yes syslog is not available on Windows as that is a Posix API.
All of your calls to syslog should be guarded by a version for
Posix.
Is there an analogue for Windows? And is it possible to implement
it with
On Wednesday, 8 February 2023 at 19:32:22 UTC, Ali Çehreli wrote:
This should do it:
[...]
Yes, it works! I'll try it tomorrow on a large array of data.
Thank you very much!
This turns out to be a simple loop with a comparison of the
existence of a key (whether it is included in an array or
foo.byPair
.array
.sort!((a, b) => a.key < b.key)
.map!(a => a.value);
Is it possible to specify in `map` to return the result `[a.key]
= a.value`? To make the result look like `[key:[val], key:[val]]`
On Friday, 3 February 2023 at 18:02:59 UTC, Richard (Rikki)
Andrew Cattermole wrote:
Here is a starting point that I myself have used in the past:
I understand that programming under Windows is a shame for a
programmer, but is there really no ready-made solution for using
the system log in
I have never programmed in Windows, so I don't quite understand
how to link the library correctly. I have a compiled Postgres
library from under mingw. There is both a static library `*.a`
and a dynamic library `*.dll`. I don't understand how to compile
my project correctly at all. I tried to
On Saturday, 4 February 2023 at 14:48:55 UTC, Richard (Rikki)
Andrew Cattermole wrote:
I.e. here are my functions for syslog and Windows Event log
I'll try to check. Thank you very much!
On Saturday, 4 February 2023 at 17:02:11 UTC, Ferhat Kurtulmuş
wrote:
On Windows, dub's default behavior is to search for "foo.lib",
usually compiled with Visual Studio C/C++ compilers. However,
you have mingw-compiled "libfoo.a". I would not use
MinGW-compiled libs with d compilers. I don't
On Saturday, 4 February 2023 at 15:56:41 UTC, Richard (Rikki)
Andrew Cattermole wrote:
On Windows you don't link directly against a DLL.
You link against a static library (.lib) of the same name.
The binding doesn't change between a static library and a
shared library as long as you're
Not an easy task for me, maybe you can advise your compact
solution. There are two associative arrays of type
`string[string][int]`. It is necessary to find the differences
and return them when comparing:
```d
[
6:["id":"6", "deleted":"f", "name":"6.2_test"],
5:["id":"5",
On Wednesday, 8 February 2023 at 18:08:40 UTC, Ali Çehreli wrote:
Just because this sounds complicated, I hope the data structure
can be designed differently to be more friendly to this
operation. (?)
Ali
This is the result of an SQL query. Roughly speaking, I need to
compare the result of
On Wednesday, 8 February 2023 at 18:57:00 UTC, Anonymouse wrote:
Can you explain how you determine how/if two entries are
different?
I apologize. I have not written, in fact, what I need to get.
Array `A`
```d
[
4:["id":"4", "deleted":"f", "name":"6.2"],
3:["id":"3", "deleted":"f",
On Tuesday, 18 July 2023 at 22:09:40 UTC, Adam D Ruppe wrote:
You need to use WriteFile when it is redirected, which you can
detect with GetFileType to see if it is a character device or
not.
The redirection issue has been resolved. Another one has now
emerged. Since I have unicode, I need
I'm trying to redirect unicode in the windows console, but when
redirecting, empty files are created. If i do it without
redirects, then the text is displayed correctly in the console:
```d
import core.sys.windows.windows;
import std.stdio;
void main() {
wstring str = "Just text...";
On Tuesday, 18 July 2023 at 22:12:17 UTC, Alexander Zhirov wrote:
with threads
streams*
On Tuesday, 18 July 2023 at 22:09:40 UTC, Adam D Ruppe wrote:
On Tuesday, 18 July 2023 at 21:31:54 UTC, Alexander Zhirov
wrote:
HANDLE h_stdout = GetStdHandle(STD_OUTPUT_HANDLE);
WriteConsoleW(h_stderr, str.ptr, cast(DWORD)str.length,
NULL, NULL);
If you checked the return value of
On Sunday, 16 July 2023 at 11:16:55 UTC, Danilo wrote:
Would a static constructor be okay? This way the static data
is not initialized at every `new` and object creation is faster.
Alternatively, i can think about your proposal. At the moment, I
have solved my problem using the following
1 - 100 of 110 matches
Mail list logo