Re: How to assign and compare arrays to SumType?

2024-06-11 Thread confuzzled via Digitalmars-d-learn

On Tuesday, 11 June 2024 at 16:41:46 UTC, confuzzled wrote:
Comparison between a Variant and an array is straightforward. 
How does one accomplish the same between a SumType and an array?




Okay, this is what I came up with. Just a sanity check please. 
Did I do this correctly? Is there something I'm overlooking?


```d
import std.variant;
import std.sumtype;
import std.traits: isArray;

struct S
{
SumType!(double[]) data;
bool opEquals(T)(auto ref const T s) const
if (isArray!T)
{
return data == typeof(data)(s);
}
void opAssign(T)(T value)
if (isArray!T)
{
data = typeof(data)(value);
}
this(T)(T value)
if (isArray!T)
{
opAssign(value);
}
}

void main()
{
Variant v = [1.7, 2.7, 3.7, 4.7, 5.7];
assert(v == [1.7, 2.7, 3.7, 4.7, 5.7]);

S s = [1.7, 2.7, 3.7, 4.7, 5.7];
assert(s == [1.7, 2.7, 3.7, 4.7, 5.7]);
}
```

Thanks,
--confuzzled




[gcc r12-10548] Include safe-ctype.h after C++ standard headers, to avoid over-poisoning

2024-06-11 Thread Iain D Sandoe via Gcc-cvs
https://gcc.gnu.org/g:a995fded34fe488153b06bb41e026277f01efded

commit r12-10548-ga995fded34fe488153b06bb41e026277f01efded
Author: Francois-Xavier Coudert 
Date:   Thu Mar 7 14:36:03 2024 +0100

Include safe-ctype.h after C++ standard headers, to avoid over-poisoning

When building gcc's C++ sources against recent libc++, the poisoning of
the ctype macros due to including safe-ctype.h before including C++
standard headers such as , , etc, causes many compilation
errors, similar to:

  In file included from /home/dim/src/gcc/master/gcc/gensupport.cc:23:
  In file included from /home/dim/src/gcc/master/gcc/system.h:233:
  In file included from /usr/include/c++/v1/vector:321:
  In file included from
  /usr/include/c++/v1/__format/formatter_bool.h:20:
  In file included from
  /usr/include/c++/v1/__format/formatter_integral.h:32:
  In file included from /usr/include/c++/v1/locale:202:
  /usr/include/c++/v1/__locale:546:5: error: '__abi_tag__' attribute
  only applies to structs, variables, functions, and namespaces
546 | _LIBCPP_INLINE_VISIBILITY
| ^
  /usr/include/c++/v1/__config:813:37: note: expanded from macro
  '_LIBCPP_INLINE_VISIBILITY'
813 | #  define _LIBCPP_INLINE_VISIBILITY _LIBCPP_HIDE_FROM_ABI
| ^
  /usr/include/c++/v1/__config:792:26: note: expanded from macro
  '_LIBCPP_HIDE_FROM_ABI'
792 |
__attribute__((__abi_tag__(_LIBCPP_TOSTRING(
  _LIBCPP_VERSIONED_IDENTIFIER
|  ^
  In file included from /home/dim/src/gcc/master/gcc/gensupport.cc:23:
  In file included from /home/dim/src/gcc/master/gcc/system.h:233:
  In file included from /usr/include/c++/v1/vector:321:
  In file included from
  /usr/include/c++/v1/__format/formatter_bool.h:20:
  In file included from
  /usr/include/c++/v1/__format/formatter_integral.h:32:
  In file included from /usr/include/c++/v1/locale:202:
  /usr/include/c++/v1/__locale:547:37: error: expected ';' at end of
  declaration list
547 | char_type toupper(char_type __c) const
| ^
  /usr/include/c++/v1/__locale:553:48: error: too many arguments
  provided to function-like macro invocation
553 | const char_type* toupper(char_type* __low, const
char_type* __high) const
|^
  /home/dim/src/gcc/master/gcc/../include/safe-ctype.h:146:9: note:
  macro 'toupper' defined here
146 | #define toupper(c) do_not_use_toupper_with_safe_ctype
| ^

This is because libc++ uses different transitive includes than
libstdc++, and some of those transitive includes pull in various ctype
declarations (typically via ).

There was already a special case for including  before
safe-ctype.h, so move the rest of the C++ standard header includes to
the same location, to fix the problem.

PR middle-end/111632

gcc/ChangeLog:

* system.h: Include safe-ctype.h after C++ standard headers.

Signed-off-by: Dimitry Andric 
(cherry picked from commit 9970b576b7e4ae337af1268395ff221348c4b34a)

Diff:
---
 gcc/system.h | 39 ++-
 1 file changed, 18 insertions(+), 21 deletions(-)

diff --git a/gcc/system.h b/gcc/system.h
index e10c34f70eca..38733dd81a6e 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -194,27 +194,8 @@ extern int fprintf_unlocked (FILE *, const char *, ...);
 #undef fread_unlocked
 #undef fwrite_unlocked
 
-/* Include  before "safe-ctype.h" to avoid GCC poisoning
-   the ctype macros through safe-ctype.h */
-
-#ifdef __cplusplus
-#ifdef INCLUDE_STRING
-# include 
-#endif
-#endif
-
-/* There are an extraordinary number of issues with .
-   The last straw is that it varies with the locale.  Use libiberty's
-   replacement instead.  */
-#include "safe-ctype.h"
-
-#include 
-
-#include 
-
-#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO
-extern int errno;
-#endif
+/* Include C++ standard headers before "safe-ctype.h" to avoid GCC
+   poisoning the ctype macros through safe-ctype.h */
 
 #ifdef __cplusplus
 #if defined (INCLUDE_ALGORITHM) || !defined (HAVE_SWAP_IN_UTILITY)
@@ -229,6 +210,9 @@ extern int errno;
 #ifdef INCLUDE_SET
 # include 
 #endif
+#ifdef INCLUDE_STRING
+# include 
+#endif
 #ifdef INCLUDE_VECTOR
 # include 
 #endif
@@ -245,6 +229,19 @@ extern int errno;
 # include 
 #endif
 
+/* There are an extraordinary number of issues with .
+   The last straw is that it varies with the locale.  Use libiberty's
+   replacement instead.  */
+#include "safe-ctype.h"
+
+#include 
+
+#include 
+
+#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO
+extern int errno;
+#endif
+
 /* Some of glibc's string 

[gcc r12-10547] libcc1: fix include

2024-06-11 Thread Iain D Sandoe via Gcc-cvs
https://gcc.gnu.org/g:8f11ed1c58e14421ba4be1652764fc47fdce8dc7

commit r12-10547-g8f11ed1c58e14421ba4be1652764fc47fdce8dc7
Author: Francois-Xavier Coudert 
Date:   Sat Mar 16 09:50:00 2024 +0100

libcc1: fix  include

Use INCLUDE_VECTOR before including system.h, instead of directly
including , to avoid running into poisoned identifiers.

Signed-off-by: Dimitry Andric 

PR middle-end/111632

libcc1/ChangeLog:

* libcc1plugin.cc: Fix include.
* libcp1plugin.cc: Fix include.

(cherry picked from commit 5213047b1d50af63dfabb5e5649821a6cb157e33)

Diff:
---
 libcc1/libcc1plugin.cc | 3 +--
 libcc1/libcp1plugin.cc | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc
index bdd0bdabe77f..8d96667e33bd 100644
--- a/libcc1/libcc1plugin.cc
+++ b/libcc1/libcc1plugin.cc
@@ -32,6 +32,7 @@
 #undef PACKAGE_VERSION
 
 #define INCLUDE_MEMORY
+#define INCLUDE_VECTOR
 #include "gcc-plugin.h"
 #include "system.h"
 #include "coretypes.h"
@@ -69,8 +70,6 @@
 #include "gcc-c-interface.h"
 #include "context.hh"
 
-#include 
-
 using namespace cc1_plugin;
 
 
diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc
index e2d5039a0a1f..6c93e9121343 100644
--- a/libcc1/libcp1plugin.cc
+++ b/libcc1/libcp1plugin.cc
@@ -33,6 +33,7 @@
 #undef PACKAGE_VERSION
 
 #define INCLUDE_MEMORY
+#define INCLUDE_VECTOR
 #include "gcc-plugin.h"
 #include "system.h"
 #include "coretypes.h"
@@ -71,8 +72,6 @@
 #include "rpc.hh"
 #include "context.hh"
 
-#include 
-
 using namespace cc1_plugin;


Re: How to assign and compare arrays to SumType?

2024-06-11 Thread confuzzled via Digitalmars-d-learn

On Tuesday, 11 June 2024 at 16:41:46 UTC, confuzzled wrote:


Also, assuming that {1} read "SumType!(double)[] data;", what 
would be the proper way to accomplish the assignment at {2} and 
the subsequent comparison.




Not sure how to do solve the fist part of the question yet but I 
was able to get this part done.


s.data = [SumType!double(1.7), SumType!double(2.7), 
SumType!double(3.7), SumType!double(4.7), SumType!double(5.7)];
assert(s.data == [SumType!double(1.7), SumType!double(2.7), 
SumType!double(3.7), SumType!double(4.7), SumType!double(5.7)]);


Wander if there is a more succinct way to do this?



P.S. Is news.digitalmars.com still operational? I'm unable to 
access it through Thunderbird.





Re: [edk2-devel] [PATCH v3 1/1] MdeModulePkg: Add the EFI_RESOURCE_ATTRIBUTE_SPECIAL_PURPOSE attribute

2024-06-11 Thread Michael D Kinney
Hi Oliver,

The DXE Core already has a policy to auto convert untested memory to
tested memory if the DXE Core runs out of memory.

Should we have a different memory type to allocate memory with the
EFI_MEMORY_SP attribute?

What would be the side effects of performing general allocations from
memory with the EFI_MEMORY_SP attribute?  If there are potentially bad 
side effects, then the DXE Core should never allocate from those
ranges and it is up to the platform to make sure there is enough normal
memory to boot.

Mike

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Oliver Smith-
> Denny
> Sent: Tuesday, June 11, 2024 10:04 AM
> To: devel@edk2.groups.io; dha...@rivosinc.com; Michael Kubacki
> 
> Subject: Re: [edk2-devel] [PATCH v3 1/1] MdeModulePkg: Add the
> EFI_RESOURCE_ATTRIBUTE_SPECIAL_PURPOSE attribute
> 
> On 6/9/2024 6:44 PM, Dhaval Sharma wrote:
> > Related to this, I also faced this issue where in order to prevent edk2
> > from allocating this memory I had to modify CoreFindFreePagesI
> >      //
> >      // Don't allocate out of Special-Purpose memory.
> >      //
> >      if ((Entry->Attribute & EFI_MEMORY_SP) != 0) {
> >        continue;
> >      }
> > Can't we add PCD based logic here to selectively NOT use SP memory for
> > edk2 allocations? I think "reserved-memory" attr does not work well
> > because it would force OS/drivers not to use it. Which is not what we
> > want. We really want special drivers to make use of it.
> 
> We've had some other conversations around this and I agree, we don't
> want DXE Core to allocate this memory unless it has no other option.
> I don't think this should be a PCD, I think DXE can make the statement
> that it won't allocate EFI_MEMORY_SP memory unless it has run out of
> other memory.
> 
> Thanks,
> Oliver
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119552): https://edk2.groups.io/g/devel/message/119552
Mute This Topic: https://groups.io/mt/106165072/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: How to use D without the GC ?

2024-06-11 Thread Vinod K Chandran via Digitalmars-d-learn
On Tuesday, 11 June 2024 at 16:54:44 UTC, Steven Schveighoffer 
wrote:



I would instead ask the reason for wanting to write D code 
without the GC.


-Steve


Hi Steve,
Two reasons.
1. I am writting a dll to use in Python. So I am assuming that 
manual memory management is better for this project. It will give 
finer control to me.

2. To squeeze out the last bit of performance from D.





Re: How to use D without the GC ?

2024-06-11 Thread Steven Schveighoffer via Digitalmars-d-learn

On Tuesday, 11 June 2024 at 13:00:50 UTC, Vinod K Chandran wrote:

Hi all,
I am planning to write some D code without GC. But I have no 
prior experience with it. I have experience using manual memory 
management languages. But D has so far been used with GC. So I 
want to know what pitfalls it has and what things I should 
watch out for. Also, I want to know what high level features I 
will be missing.

Thanks in advance.


I could answer the question directly, but it seems others have 
already done so.


I would instead ask the reason for wanting to write D code 
without the GC. In many cases, you can write code without 
*regularly* using the GC (i.e. preallocate, or reuse buffers), 
but still use the GC in the sense that it is there as your 
allocator.


A great example is exceptions. Something that has the code `throw 
new Exception(...)` is going to need the GC in order to build 
that exception. But if your code is written such that this never 
(normally) happens, then you aren't using the GC for that code.


So I would call this kind of style writing code that avoids 
creating garbage. To me, this is the most productive way to 
minimize GC usage, while still allowing one to use D as it was 
intended.


-Steve


[Issue 24600] DMD nightly builds are outdated

2024-06-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24600

--- Comment #2 from Dlang Bot  ---
@tim-dlang created dlang/installer pull request #585 "GHA: Replace deprecated
set-output" mentioning this issue:

- GHA: Replace deprecated set-output

  See
https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

  This should fix a warning for the nightly builds in bugzilla issue 24600.

https://github.com/dlang/installer/pull/585

--


How to assign and compare arrays to SumType?

2024-06-11 Thread confuzzled via Digitalmars-d-learn
Comparison between a Variant and an array is straightforward. How 
does one accomplish the same between a SumType and an array?


```d
import std.variant;
import std.sumtype;
import std.stdio;

struct S
{
SumType!(double[]) data;  // {1}
}

void main()
{
Variant v = [1.7, 2.7, 3.7, 4.7, 5.7];
assert(v == [1.7, 2.7, 3.7, 4.7, 5.7]);

S s;
s.data = [1.7, 2.7, 3.7, 4.7, 5.7]; // {2}
assert(s.data == [1.7, 2.7, 3.7, 4.7, 5.7]);
}
```

Resulting Error:

var.d(17): Error: template \`opEquals\` is not callable using 
argument types `!()(double[])`

/Users/anju/dlang/dmd-2.109.0-beta.1/osx/bin/../../src/phobos/std/sumtype.d(712):
Candidate is: `opEquals(this This, Rhs)(auto ref Rhs rhs)`
 with `This = SumType!(double[]),
  Rhs = double[]`
 must satisfy the following constraint:
`   !is(CommonType!(This, Rhs) == void)`


Also, assuming that {1} read "SumType!(double)[] data;", what 
would be the proper way to accomplish the assignment at {2} and 
the subsequent comparison.


Thanks,
--confuzzled

P.S. Is news.digitalmars.com still operational? I'm unable to 
access it through Thunderbird.


[Issue 24600] DMD nightly builds are outdated

2024-06-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24600

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #1 from Dlang Bot  ---
@tim-dlang created dlang/dmd pull request #16580 "Fix bugzilla 24600 - DMD
nightly builds are outdated" fixing this issue:

- Fix bugzilla 24600 - DMD nightly builds are outdated

  The artifact names have been changed in
 
https://github.com/dlang/installer/commit/a8422151226d92f22fc2b83ae3713005bbf22f20,
  because version 4 of actions/upload-artifact needs unique names.
  Also use version 4 of actions/download-artifact and use a pattern instead of
a single name.

  See also
https://github.com/actions/upload-artifact/blob/main/docs/MIGRATION.md

https://github.com/dlang/dmd/pull/16580

--


[Issue 24600] New: DMD nightly builds are outdated

2024-06-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24600

  Issue ID: 24600
   Summary: DMD nightly builds are outdated
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: normal
  Priority: P1
 Component: installer
  Assignee: nob...@puremagic.com
  Reporter: tim.dl...@t-online.de

The nightly builds published on
https://github.com/dlang/dmd/releases/tag/nightly are from Apr 22, but the
latest build is https://github.com/dlang/dmd/actions/runs/9441078142 from Jun
11. Building DMD was successful and the artifacts can be downloaded from
https://github.com/dlang/dmd/actions/runs/9458046198. Only uploading failed.
>From the GitHub Action log:

2024-06-11T01:40:51.0308869Z Complete job name: Publish artifacts on the
release page
2024-06-11T01:40:51.1418049Z ##[group]Run actions/download-artifact@v3
2024-06-11T01:40:51.1418855Z with:
2024-06-11T01:40:51.1419222Z   name: dmd-release
2024-06-11T01:40:51.1419695Z   path: ~/artifacts/
2024-06-11T01:40:51.1420219Z ##[endgroup]
2024-06-11T01:40:51.2998624Z Starting download for dmd-release
2024-06-11T01:40:51.3585120Z ##[error]Unable to find any artifacts for the
associated workflow

The GitHub Action run page also shows some warnings:

Build nightly from master / Build documentation for all repos
The `set-output` command is deprecated and will be disabled soon. Please
upgrade to using Environment Files. For more information see:
https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

Build nightly from master / Build documentation for all repos
The `set-output` command is deprecated and will be disabled soon. Please
upgrade to using Environment Files. For more information see:
https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

Publish artifacts on the release page
Node.js 16 actions are deprecated. Please update the following actions to use
Node.js 20: actions/download-artifact@v3. For more information see:
https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.


Maybe the problem was caused by
https://github.com/dlang/installer/commit/a8422151226d92f22fc2b83ae3713005bbf22f20,
because the artifact name was changed from dmd-release to dmd-release-${{
matrix.os }}. This was necessary, because version 4 of actions/upload-artifact
needs unique names. The download job in
https://github.com/dlang/dmd/blob/master/.github/workflows/nightlies.yml still
uses version 3 und the old name.

See also https://github.com/actions/upload-artifact/blob/main/docs/MIGRATION.md

--


Re: How to use D without the GC ?

2024-06-11 Thread drug007 via Digitalmars-d-learn

On 11.06.2024 17:59, Kagamin wrote:
1) arena allocator makes memory manageable with occasional cache 
invalidation problem

2) no hashtable no problem


[OT] could you elaborate what problems they cause?

3) error handling depends on your code complexity, but even in complex 
C# code I found exceptions as boolean: you either have an exception or 
you don't

4) I occasionally use CTFE, where `@nogc` is a nuisance
5) polymorphism can be a little quirky




Re: How to use D without the GC ?

2024-06-11 Thread Vinod K Chandran via Digitalmars-d-learn

On Tuesday, 11 June 2024 at 14:59:24 UTC, Kagamin wrote:
1) arena allocator makes memory manageable with occasional 
cache invalidation problem

2) no hashtable no problem
3) error handling depends on your code complexity, but even in 
complex C# code I found exceptions as boolean: you either have 
an exception or you don't

4) I occasionally use CTFE, where `@nogc` is a nuisance
5) polymorphism can be a little quirky


Oh thank you @Kagamin. That's some valuable comments. I will take 
special care.


Re: How to use D without the GC ?

2024-06-11 Thread Kagamin via Digitalmars-d-learn
1) arena allocator makes memory manageable with occasional cache 
invalidation problem

2) no hashtable no problem
3) error handling depends on your code complexity, but even in 
complex C# code I found exceptions as boolean: you either have an 
exception or you don't

4) I occasionally use CTFE, where `@nogc` is a nuisance
5) polymorphism can be a little quirky


Re: How to use D without the GC ?

2024-06-11 Thread Vinod K Chandran via Digitalmars-d-learn

On Tuesday, 11 June 2024 at 13:35:19 UTC, matheus wrote:
On Tuesday, 11 June 2024 at 13:00:50 UTC, Vinod K Chandran 
wrote:

...


Similar posts that may help:

https://forum.dlang.org/thread/hryadrwplyezihwag...@forum.dlang.org

https://forum.dlang.org/thread/dblfikgnzqfmmglwd...@forum.dlang.org

Matheus.

Thank you Matheus, let me check that. :)



Re: How to use D without the GC ?

2024-06-11 Thread matheus via Digitalmars-d-learn

On Tuesday, 11 June 2024 at 13:00:50 UTC, Vinod K Chandran wrote:

...


Similar posts that may help:

https://forum.dlang.org/thread/hryadrwplyezihwag...@forum.dlang.org

https://forum.dlang.org/thread/dblfikgnzqfmmglwd...@forum.dlang.org

Matheus.


RFR: 8333801: Typos in @code references of BufferedImage and JTableHeader

2024-06-11 Thread Jayathirth D V
Resolved typos related to ArrayIndexOutOfBoundsException in BufferedImage and 
JTableHeader.

-

Commit messages:
 - 8333801: Typos in @code references of BufferedImage and JTableHeader

Changes: https://git.openjdk.org/jdk/pull/19654/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk=19654=00
  Issue: https://bugs.openjdk.org/browse/JDK-8333801
  Stats: 6 lines in 2 files changed: 0 ins; 0 del; 6 mod
  Patch: https://git.openjdk.org/jdk/pull/19654.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19654/head:pull/19654

PR: https://git.openjdk.org/jdk/pull/19654


[Issue 24590] Illegal instruction with module constructors cycle and shared libphobos2 in _d_criticalenter2

2024-06-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24590

--- Comment #3 from Dlang Bot  ---
@kinke created dlang/dmd pull request #16578 "Fix Bugzilla 24590 - Don't run
module destructors if druntime failed to initialize" mentioning this issue:

- Add test case for Bugzilla 24590

https://github.com/dlang/dmd/pull/16578

--


[Issue 24599] [REG2.103] Wrongly elided TypeInfo emission leading to undefined symbols at link-time

2024-06-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24599

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #1 from Dlang Bot  ---
@kinke updated dlang/dmd pull request #15868 "Draft: Tentative fix for missing
struct TypeInfo symbols" fixing this issue:

- Fix Bugzilla 24599 - Wrongly elided TypeInfo emission

  Reverting #14844, which caused such missing TypeInfos, *and* making
  sure the special TypeInfo members are fully analyzed and ready for
  codegen (otherwise hitting an assertion for the real-world project).

https://github.com/dlang/dmd/pull/15868

--


[Issue 24599] New: [REG2.103] Wrongly elided TypeInfo emission leading to undefined symbols at link-time

2024-06-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24599

  Issue ID: 24599
   Summary: [REG2.103] Wrongly elided TypeInfo emission leading to
undefined symbols at link-time
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: regression
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: ki...@gmx.net

This dustmited testcase regressed with v2.103, failing to link due to an
undefined TypeInfo (`_D24TypeInfo_xS3mod8Variable6__initZ`), introduced by
https://github.com/dlang/dmd/pull/14844:

```
module mod;

struct Variable
{
size_t toHash() const { return 0; }
}

enum hasInoutConstruction(T) = __traits(compiles, { struct S { T a; } });

struct Algebraic(T)
{
static if (hasInoutConstruction!T)
{
}
}

Algebraic!Variable foo();

struct S
{
Variable[] symbols;
}

void main() {}
```

--


Re: Comparing slice to an Array in assert

2024-06-11 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn

On 11/06/2024 9:51 PM, madwebness wrote:
Ah, my mistake. With the regular expression adjusted to 
`r"^[A-Z]+(=.*)?$"` it works just fine. Thank you very much for running 
the code for me. All very simple, I'm just new to the language.


All good, happy to help!

We also have people on Discord and IRC if either of those mediums would 
be more helpful.


Re: Comparing slice to an Array in assert

2024-06-11 Thread madwebness via Digitalmars-d-learn

On Tuesday, 11 June 2024 at 09:48:36 UTC, madwebness wrote:

On Tuesday, 11 June 2024 at 09:29:05 UTC, madwebness wrote:

My version that runs:


Ran the code exactly as you posted. It works and I found the 
issue. Apparently, if I add =* to the end of the last element, 
the assertion fails with the error.


```
auto words = ["HELLO", "world", "hi", "ENDOFTHERUNWAY=*"];
```

results in:
```
core.exception.AssertError@./code.d(23): Assertion failure

??:? _d_assertp [0x360904]
??:? _Dmain [0x3073c3]
```

I don't understand why, isn't it supposed to be treated as a 
string?


Ah, my mistake. With the regular expression adjusted to 
`r"^[A-Z]+(=.*)?$"` it works just fine. Thank you very much for 
running the code for me. All very simple, I'm just new to the 
language.


Re: Comparing slice to an Array in assert

2024-06-11 Thread madwebness via Digitalmars-d-learn

On Tuesday, 11 June 2024 at 09:29:05 UTC, madwebness wrote:

My version that runs:


Ran the code exactly as you posted. It works and I found the 
issue. Apparently, if I add =* to the end of the last element, 
the assertion fails with the error.


```
auto words = ["HELLO", "world", "hi", "ENDOFTHERUNWAY=*"];
```

results in:
```
core.exception.AssertError@./code.d(23): Assertion failure

??:? _d_assertp [0x360904]
??:? _Dmain [0x3073c3]
```

I don't understand why, isn't it supposed to be treated as a 
string?


Re: Comparing slice to an Array in assert

2024-06-11 Thread madwebness via Digitalmars-d-learn

On Tuesday, 11 June 2024 at 09:17:21 UTC, madwebness wrote:
While I do understand what you're saying, I'm not sure I 
understand how to fix the code.


With the following function definition what the function returns 
is correct and the problem is in the unittest code. Note that 
`writeln()` prints what's expected here program fails only when 
it gets to `assert()`:


```
auto sliceIt(string[] words_arr) {...};

unittest {
  auto words = ["HELLO", "world", "hi", "ENDOFTHERUNWAY"];
  auto resulting_arr = sliceIt(words);
  writeln(resulting_arr[0]); // => "world"
  assert(resulting_arr[0] == "world"); // => ERROR mentioned in 
(3) in the previous post.

}
```


Re: Comparing slice to an Array in assert

2024-06-11 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn



On 11/06/2024 9:17 PM, madwebness wrote:
On Tuesday, 11 June 2024 at 08:44:25 UTC, Richard (Rikki) Andrew 
Cattermole wrote:

There are two more corrections to make.

Both in sliceIt.

Note: array is a function not a type and is for ranges, slices are 
built in language concept. Associate Arrays (map) use the syntax 
``Type[Type]``.


While I do understand what you're saying, I'm not sure I understand how 
to fix the code.


1. Changing function's argument type to `Array(string)` results in the 
following error: `Error: function declaration without return type.`


2. Adding function type `Array(string) sliceIt(...)` results in the 
following error: `Error: function declaration without return type.`


3. Finally, changing function's argument type to `string[]`, so function 
definition looks like this:

```
auto extract_arg_names(string[] def_words_arr){...};
```


That is correct yes.


results in, what I presume, is a runtime error:

>

```
core.exception.AssertError@definition/sliceit.d(42): unittest failure

??:? _d_unittestp [0x357a31]
??:? void arg.__unittest_L39_C1() [0x302495]
??:? void arg.__modtest() [0x34ba78]
??:? int 
core.runtime.runModuleUnitTests().__foreachbody6(object.ModuleInfo*) 
[0x37316a]
??:? int object.ModuleInfo.opApply(scope int 
delegate(object.ModuleInfo*)).__lambda2(immutable(object.ModuleInfo*)) 
[0x34dde3]
??:? int rt.minfo.moduleinfos_apply(scope int 
delegate(immutable(object.ModuleInfo*))).__foreachbody2(ref 
rt.sections_elf_shared.DSO) [0x380257]
??:? int rt.sections_elf_shared.DSO.opApply(scope int delegate(ref 
rt.sections_elf_shared.DSO)) [0x382dd1]
??:? int rt.minfo.moduleinfos_apply(scope int 
delegate(immutable(object.ModuleInfo*))) [0x3801e5]
??:? int object.ModuleInfo.opApply(scope int 
delegate(object.ModuleInfo*)) [0x34ddb5]

??:? runModuleUnitTests [0x372fa0]
??:? void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int 
function(char[][])*).runAll() [0x372728]
??:? void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int 
function(char[][])*).tryExec(scope void delegate()) [0x3726b5]

??:? _d_run_main2 [0x37261e]
??:? _d_run_main [0x3723bf]
??:? main [0x34ba8d]
??:? __libc_start1 [0x82289eaf9]
/usr/src/lib/csu/amd64/crt1_s.S:83 _start [0x30213f]
??:? ??? [0xe83fb403007]
1/1 modules FAILED unittests
```

PS. Found more correction in the original code. The variable 
`def_words_arr` should just be `words_arr`. Was not paying attention 
when simplifying the code to post here.


Yes, that is the second one.

My version that runs:

```d
import std.stdio;
import std.regex;
import std.string;
import std.array;

auto sliceIt(string[] words_arr) {
   int i = 1;
   string word;
   while(i < words_arr.length) {
 word = words_arr[i];
 if(matchFirst(word, r"^[A-Z]+$")) { break; }
 i++;
   }
   return words_arr[1..i];
}

void main() {
   auto words = ["HELLO", "world", "hi", "ENDOFTHERUNWAY"];
   auto resulting_arr = sliceIt(words);
   assert(resulting_arr == ["world", "hi"]);
}
```


Re: Comparing slice to an Array in assert

2024-06-11 Thread madwebness via Digitalmars-d-learn
On Tuesday, 11 June 2024 at 08:44:25 UTC, Richard (Rikki) Andrew 
Cattermole wrote:

There are two more corrections to make.

Both in sliceIt.

Note: array is a function not a type and is for ranges, slices 
are built in language concept. Associate Arrays (map) use the 
syntax ``Type[Type]``.


While I do understand what you're saying, I'm not sure I 
understand how to fix the code.


1. Changing function's argument type to `Array(string)` results 
in the following error: `Error: function declaration without 
return type.`


2. Adding function type `Array(string) sliceIt(...)` results in 
the following error: `Error: function declaration without return 
type.`


3. Finally, changing function's argument type to `string[]`, so 
function definition looks like this:

```
auto extract_arg_names(string[] def_words_arr){...};
```

results in, what I presume, is a runtime error:


```
core.exception.AssertError@definition/sliceit.d(42): unittest 
failure


??:? _d_unittestp [0x357a31]
??:? void arg.__unittest_L39_C1() [0x302495]
??:? void arg.__modtest() [0x34ba78]
??:? int 
core.runtime.runModuleUnitTests().__foreachbody6(object.ModuleInfo*) [0x37316a]
??:? int object.ModuleInfo.opApply(scope int 
delegate(object.ModuleInfo*)).__lambda2(immutable(object.ModuleInfo*)) [0x34dde3]
??:? int rt.minfo.moduleinfos_apply(scope int 
delegate(immutable(object.ModuleInfo*))).__foreachbody2(ref 
rt.sections_elf_shared.DSO) [0x380257]
??:? int rt.sections_elf_shared.DSO.opApply(scope int 
delegate(ref rt.sections_elf_shared.DSO)) [0x382dd1]
??:? int rt.minfo.moduleinfos_apply(scope int 
delegate(immutable(object.ModuleInfo*))) [0x3801e5]
??:? int object.ModuleInfo.opApply(scope int 
delegate(object.ModuleInfo*)) [0x34ddb5]

??:? runModuleUnitTests [0x372fa0]
??:? void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int 
function(char[][])*).runAll() [0x372728]
??:? void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int 
function(char[][])*).tryExec(scope void delegate()) [0x3726b5]

??:? _d_run_main2 [0x37261e]
??:? _d_run_main [0x3723bf]
??:? main [0x34ba8d]
??:? __libc_start1 [0x82289eaf9]
/usr/src/lib/csu/amd64/crt1_s.S:83 _start [0x30213f]
??:? ??? [0xe83fb403007]
1/1 modules FAILED unittests
```

PS. Found more correction in the original code. The variable 
`def_words_arr` should just be `words_arr`. Was not paying 
attention when simplifying the code to post here.


Re: Comparing slice to an Array in assert

2024-06-11 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn

There are two more corrections to make.

Both in sliceIt.

Note: array is a function not a type and is for ranges, slices are built 
in language concept. Associate Arrays (map) use the syntax ``Type[Type]``.


Re: Comparing slice to an Array in assert

2024-06-11 Thread madwebness via Digitalmars-d-learn

On Tuesday, 11 June 2024 at 08:29:06 UTC, madwebness wrote:

unittest {
  auto words = ["HELLO", "world", "hi", "ENDOFTHERUNWAY"];
  auto resulting_arr = sliceIt(["world", "hi"]);
  assert(resulting_arr == ["world", "hi"]);
}



Correction here, I, of course, meant:

```
auto resulting_arr = sliceIt(words);
```


Comparing slice to an Array in assert

2024-06-11 Thread madwebness via Digitalmars-d-learn
I was following the documentation here: 
http://dlang.org.mirror/spec/arrays.html#slicing and I'm having a 
problem comparing the returned Slice from a function with an 
array.


Here's the simplified code:

```
import std.stdio;
import std.regex;
import std.string;
import std.array;

auto sliceIt(array[string] words_arr) {
  int i = 1;
  string word;
  while(i < words_arr.length) {
word = words_arr[i];
if(matchFirst(word, r"^[A-Z]+$")) { break; }
i++;
  }
  return def_words_arr[1..i];
}

unittest {
  auto words = ["HELLO", "world", "hi", "ENDOFTHERUNWAY"];
  auto resulting_arr = sliceIt(["world", "hi"]);
  assert(resulting_arr == ["world", "hi"]);
}
```

This produces a compile-time error:

```
Error: template `std.array.array(Range)(Range r) if 
(isIterable!Range && !isAutodecodableString!Range && 
!isInfinite!Range)` is used as a type
Failed: ["~/.local/dlang/dmd-2.108.1/freebsd/bin64/dmd", 
"-debug", "-unittest", "-main", "-v", "-o-", "words.d", 
"-Idefinition"]

```

I was thinking of maybe assigning correct return type for the 
function, tried it, but got more errors produced by the compiler. 
Can someone point me to an obvious mistake or lack of 
understanding?


[Issue 24598] OpenBSD: adapt compiler tests

2024-06-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24598

Dlang Bot  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Dlang Bot  ---
dlang/dmd pull request #16577 "Fix Bugzilla 24598" was merged into master:

- 0ed13b8d31de8dfea8f71b02a52765c49c68633b by Brian Callahan:
  Fix Bugzilla 24598

https://github.com/dlang/dmd/pull/16577

--


[weewx-user] Re: How to publish HTML from weewx to WordPress

2024-06-10 Thread 'Cameron D' via weewx-user
rtengine:   
>>>   File 
>>> "/usr/local/lib/python2.7/dist-packages/paramiko/sftp_client.py", line 460, 
>>> in mkdir
>>> Jun  9 13:08:24 raspberrypi weewx[5969] ERROR weewx.reportengine:   
>>>     self._request(CMD_MKDIR, path, attr)
>>> Jun  9 13:08:24 raspberrypi weewx[5969] ERROR weewx.reportengine:   
>>>   File 
>>> "/usr/local/lib/python2.7/dist-packages/paramiko/sftp_client.py", line 822, 
>>> in _request
>>> Jun  9 13:08:24 raspberrypi weewx[5969] ERROR weewx.reportengine:   
>>>     return self._read_response(num)
>>> Jun  9 13:08:24 raspberrypi weewx[5969] ERROR weewx.reportengine:   
>>>   File 
>>> "/usr/local/lib/python2.7/dist-packages/paramiko/sftp_client.py", line 874, 
>>> in _read_response
>>> Jun  9 13:08:24 raspberrypi weewx[5969] ERROR weewx.reportengine:   
>>>     self._convert_status(msg)
>>> Jun  9 13:08:24 raspberrypi weewx[5969] ERROR weewx.reportengine:   
>>>   File 
>>> "/usr/local/lib/python2.7/dist-packages/paramiko/sftp_client.py", line 903, 
>>> in _convert_status
>>> Jun  9 13:08:24 raspberrypi weewx[5969] ERROR weewx.reportengine:   
>>>     raise IOError(errno.ENOENT, text)
>>> Jun  9 13:08:24 raspberrypi weewx[5969] ERROR weewx.reportengine:   
>>>     IOError: [Errno 2] No such file
>>> Jun  9 13:08:24 raspberrypi weewx[5969] ERROR weewx.reportengine:   
>>>     Generator terminated
>>> Jun  9 13:08:24 raspberrypi weewx[5969] INFO paramiko.transport.sftp: 
>>> [chan 0] sftp session closed.
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/eb55b368-2b31-41ae-8894-b1096bfd5d77n%40googlegroups.com.


Bug#1072906: RFS: markdown-mode/2.6-2 [Team] -- mode for editing Markdown-formatted text files in GNU Emacs

2024-06-10 Thread Nicholas D Steeves
Xiyue Deng  writes:

You're incorrect about:

>* Drop unused override_dh_auto_test in d/rules (dh_elpa_test is in
>  effect)

  override_dh_auto_test:
@echo Using dh_elpa_test to run tests instead of upstream Makefile

Used to be useful, because the Makefile tests used to run as well as the
dh_elpa_test ones.  Dh_elpa_test was also "in effect then"...

>* Update debian copyright year in d/copyright

-Copyright: 2015-2017 David Bremner 
+Copyright: 2015-2024 David Bremner 

In terms of copyright, please explain your understanding of copyright
what you're doing here.  This is not a mere 's/17/24/' symbol
manipulation.

> Note: this revision drops the dependency on markdown, which is important
> so that itself and all its reverse dependencies are free from
> bug#1063645 so that they are free from being removed from testing.

This is premature.  Also, does upstream skip functional tests if a
$PATH/markdown binary cannot be called?  If this is the case then the
correct action is to configure a $PATH/compatible-markdown-replacement.


signature.asc
Description: PGP signature


Bug#1072906: RFS: markdown-mode/2.6-2 [Team] -- mode for editing Markdown-formatted text files in GNU Emacs

2024-06-10 Thread Nicholas D Steeves
Xiyue Deng  writes:

You're incorrect about:

>* Drop unused override_dh_auto_test in d/rules (dh_elpa_test is in
>  effect)

  override_dh_auto_test:
@echo Using dh_elpa_test to run tests instead of upstream Makefile

Used to be useful, because the Makefile tests used to run as well as the
dh_elpa_test ones.  Dh_elpa_test was also "in effect then"...

>* Update debian copyright year in d/copyright

-Copyright: 2015-2017 David Bremner 
+Copyright: 2015-2024 David Bremner 

In terms of copyright, please explain your understanding of copyright
what you're doing here.  This is not a mere 's/17/24/' symbol
manipulation.

> Note: this revision drops the dependency on markdown, which is important
> so that itself and all its reverse dependencies are free from
> bug#1063645 so that they are free from being removed from testing.

This is premature.  Also, does upstream skip functional tests if a
$PATH/markdown binary cannot be called?  If this is the case then the
correct action is to configure a $PATH/compatible-markdown-replacement.


signature.asc
Description: PGP signature


[Issue 24597] FreeBSD/OpenBSD: Enable ELF_COMDAT

2024-06-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24597

Dlang Bot  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Dlang Bot  ---
dlang/dmd pull request #16576 "Fix 24597 -- FreeBSD/OpenBSD: Enable ELF_COMDAT"
was merged into stable:

- 6b96552919e0ac7e80b18e8ce8d5ed1f7f779ae1 by Brian Callahan:
  Fix Bugzilla 24597

https://github.com/dlang/dmd/pull/16576

--


Re: How to generate a random number from system clock as seed

2024-06-10 Thread Steven Schveighoffer via Digitalmars-d-learn

On Saturday, 8 June 2024 at 13:19:30 UTC, Eric P626 wrote:
I managed to create a random number generator using the 
following code:


~~~
auto rng = Random(42);
//
uniform(0,10,rng);
~~~

Now I want to seed the generator using system time. I looked at 
Date & time functions/classes and systime functions/classes. 
The problem is that they all require a time zone. But I don't 
need a time zone since there is no time zone. I just want the 
number of seconds elapsed since jan 1st 1970. In other words, 
the internal system clock value.


I'm not sure if anyone said it explicitly, but `uniform(0, 10)` 
uses the default RNG 
[`rndGen`](https://dlang.org/phobos/std_random.html#rndGen), 
which is already properly seeded with an unpredictable seed:


Global random number generator used by various functions in 
this module whenever no generator is specified. It is allocated 
per-thread and initialized to an unpredictable value for each 
thread.


So unless you are explicitly doing something like saving the seed 
for future playback, I'd leave it off.


-Steve


[jira] [Commented] (COMPRESS-461) Add test for APK signing block

2024-06-10 Thread Gary D. Gregory (Jira)


[ 
https://issues.apache.org/jira/browse/COMPRESS-461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17853809#comment-17853809
 ] 

Gary D. Gregory commented on COMPRESS-461:
--

[~bodewig] , [~eighthave] 

Would you please create a PR on GitHub with this new test?

 

> Add test for APK signing block
> --
>
> Key: COMPRESS-461
> URL: https://issues.apache.org/jira/browse/COMPRESS-461
> Project: Commons Compress
>  Issue Type: Test
>  Components: Archivers
>Affects Versions: 1.17
>Reporter: Stefan Bodewig
>Priority: Minor
> Attachments: test-services-1.1.0.apk
>
>
> Add a regression test for the fix of COMPRESS-455.
> This involves creating a minimal apk file that we can distribute as a 
> testcase which contains an apk signing block. Creating such an apk file is 
> probably easy if you've got an android development environment.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (CONFIGURATION-825) INIConfiguration marks exceptions that will not be thrown

2024-06-10 Thread Gary D. Gregory (Jira)


 [ 
https://issues.apache.org/jira/browse/CONFIGURATION-825?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gary D. Gregory updated CONFIGURATION-825:
--
Fix Version/s: 2.11.1
   (was: 2.11.0)

>  INIConfiguration marks exceptions that will not be thrown
> --
>
> Key: CONFIGURATION-825
> URL: https://issues.apache.org/jira/browse/CONFIGURATION-825
> Project: Commons Configuration
>  Issue Type: Improvement
>  Components: Expression engine
>Affects Versions: 2.8.0
> Environment: java 8,win ,the file content is "/error/"
>Reporter: ChenYuwang
>Priority: Major
> Fix For: 2.11.1
>
>
> INIConfiguration.read() & INIConfiguration.write() marks 
> ConfigurationException, but has no chance to throw. I understand that a 
> ConfigurationException should be thrown if INIConfiguration read something 
> that is not  ini‘s format, but currently it doesn't. INIConfiguration just 
> ignores everything it doesn't recognize. For example, the file content is 
> "/error/"



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (NET-709) IMAP Memory considerations with large ‘FETCH’ sizes.

2024-06-10 Thread Gary D. Gregory (Jira)


 [ 
https://issues.apache.org/jira/browse/NET-709?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gary D. Gregory updated NET-709:

Fix Version/s: 3.11.2
   (was: 3.11.1)

> IMAP Memory considerations with large ‘FETCH’ sizes.
> 
>
> Key: NET-709
> URL: https://issues.apache.org/jira/browse/NET-709
> Project: Commons Net
>  Issue Type: Improvement
>  Components: IMAP
>Affects Versions: 3.8.0
>Reporter: Anders
>Priority: Minor
>  Labels: IMAP, buffer, chunking, large, literal, memory, partial
> Fix For: 3.11.2
>
>   Original Estimate: 96h
>  Remaining Estimate: 96h
>
> h2. *IMAP Memory considerations with large ‘FETCH’ sizes.*
>  
> The following comments concern classes in the 
> [org.apache.common.net.imap|https://commons.apache.org/proper/commons-net/apidocs/org/apache/commons/net/imap/package-summary.html]
>  package.
>  
> Consider the following imap ‘fetch’ exchange between a client (>) and server 
> (<):
> {{> A654 FETCH 1:2 (BODY[TEXT])}}
> {{{}< * 1 FETCH (BODY[TEXT] {*}{{*}{*}8000{*}{*}}{*}\r\n{}}}{{{}…{}}}
> {{< * 2 FETCH …}}
> {{< A654 OK FETCH completed}}
>  
> The first untagged response (* 1 FETCH …) contains a literal \{8000} or 
> 80MB.
>  
> After reviewing the 
> [source|https://gitbox.apache.org/repos/asf?p=commons-net.git;a=blob;f=src/main/java/org/apache/commons/net/imap/IMAP.java;h=d97f1073d8b97545d0a063c6832fe55c116166e2;hb=HEAD#l298],
>  it is my understanding, the entire 80MB sequence of data will be read into 
> Java memory even when using  
> ‘[IMAPChunkListener|https://commons.apache.org/proper/commons-net/apidocs/org/apache/commons/net/imap/IMAP.IMAPChunkListener.html]’.
>  According the the documentation: 
>  
> {quote}Implement this interface and register it via 
> [IMAP.setChunkListener(IMAPChunkListener)|https://commons.apache.org/proper/commons-net/apidocs/org/apache/commons/net/imap/IMAP.html#setChunkListener-org.apache.commons.net.imap.IMAP.IMAPChunkListener-]
>  in order to get access to multi-line partial command responses. Useful when 
> processing large FETCH responses.
> {quote}
>  
> It is apparent the partial fetch response is read in full (80MB) before 
> invoking the ‘IMAPChunkListener’ and then discarding the read lines (freeing 
> up memory).
>  
> Back to the example:
> > A654 FETCH 1:2 (BODY[TEXT])
> < * 1 FETCH (BODY[TEXT] \{8000}\r\n
> *{color:#ff}…. <— read in full into memory then discarded after calling 
> IMAPChunkListener{color}*
> < * 2 FETCH (BODY[TEXT] \{250}\r\n
> {color:#ff}*…. <— read in full into memory then discarded after calling 
> IMAPChunkListener*{color}
> < A654 OK FETCH completed
>  
> Above, you can see the chunk listener is good for each individual partial 
> fetch response but does not prevent a large partial from being loaded into 
> memory.
>  
> Let’s review the 
> [code|https://gitbox.apache.org/repos/asf?p=commons-net.git;a=blob;f=src/main/java/org/apache/commons/net/imap/IMAP.java;h=d97f1073d8b97545d0a063c6832fe55c116166e2;hb=HEAD#l298]:
>  
> [ 
> 296|https://gitbox.apache.org/repos/asf?p=commons-net.git;a=blob;f=src/main/java/org/apache/commons/net/imap/IMAP.java;h=d97f1073d8b97545d0a063c6832fe55c116166e2;hb=HEAD#l296]
>                  int literalCount = IMAPReply.literalCount(line);
> {color:#ff}Above counts the size of the literal, in our case 8000 or 
> 80MB (for the first partial fetch response).{color}
>  
>  
> [ 
> 297|https://gitbox.apache.org/repos/asf?p=commons-net.git;a=blob;f=src/main/java/org/apache/commons/net/imap/IMAP.java;h=d97f1073d8b97545d0a063c6832fe55c116166e2;hb=HEAD#l297]
>                  final boolean isMultiLine = literalCount >= 0;
> [ 
> 298|https://gitbox.apache.org/repos/asf?p=commons-net.git;a=blob;f=src/main/java/org/apache/commons/net/imap/IMAP.java;h=d97f1073d8b97545d0a063c6832fe55c116166e2;hb=HEAD#l298]
>                  while (literalCount >= 0) {
> [ 
> 299|https://gitbox.apache.org/repos/asf?p=commons-net.git;a=blob;f=src/main/java/org/apache/commons/net/imap/IMAP.java;h=d97f1073d8b97545d0a063c6832fe55c116166e2;hb=HEAD#l299]
>                      line=_reader.readLine();
> [ 
> 300|https://gitbox.apache.org/repos/asf?p=commons-net.git;a=blob;f=src/main/java/org/apache/commons/net/imap/IMAP.java;h=d97f1073d8b97545d0a063c6832fe55c116166e2;hb=HEAD#l300]
>                      if (line == null)  
> {                                  throw new EOFException("Connection closed 
> without indication.");   }

Re: D officially supported on Apache NuttX RTOS

2024-06-10 Thread Matheus Catarino via Digitalmars-d-announce

On Monday, 10 June 2024 at 14:59:53 UTC, Denis Feklushkin wrote:


Official esp32 software environment (ESP IDF) internally uses 
FreeRTOS. Thus, if you write hello_world_LED_blink snippet and 
compile it by ESP IDF your binary will contain FreeRTOS


Exactly! However, NuttX can replace ESP-IDF if desired. Espressif 
itself approves and provides an HAL for this access. (Same goes 
for Zephyr)


https://github.com/espressif/esp-hal-3rdparty


[Issue 24596] Rebindable2 corrupts objects

2024-06-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24596

Dlang Bot  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Dlang Bot  ---
dlang/phobos pull request #9012 "Fix bugzilla 24596: std.typecons.Rebindable2:
Don't destroy classes! Only destroy structs!" was merged into stable:

- ed41b39f5e8cef51aa84ee781c0d77072f1dadf9 by Mathis Beer:
  Fix bugzilla issue 24596: std.typecons.Rebindable2: Don't destroy classes!
Only destroy structs!

https://github.com/dlang/phobos/pull/9012

--


Re: D officially supported on Apache NuttX RTOS

2024-06-10 Thread Denis Feklushkin via Digitalmars-d-announce

On Sunday, 9 June 2024 at 23:19:44 UTC, Matheus Catarino wrote:

So, I take the opportunity to carry out some tests with the 
architectures available through NuttX (stm32/esp32/riscv/arm, 
etc...)


Official esp32 software environment (ESP IDF) internally uses 
FreeRTOS. Thus, if you write hello_world_LED_blink snippet and 
compile it by ESP IDF your binary will contain FreeRTOS


Re: How to generate a random number from system clock as seed

2024-06-10 Thread Eric P626 via Digitalmars-d-learn

On Sunday, 9 June 2024 at 23:31:47 UTC, drug007 wrote:

```d
const seed = cast(uint) Clock.currStdTime;
```


Casting like this looks nice. It fits my type of thinking.



[konsole] [Bug 481218] Konsole crashes when turning off monitor

2024-06-10 Thread Mattes D
https://bugs.kde.org/show_bug.cgi?id=481218

Mattes D  changed:

   What|Removed |Added

 Resolution|WAITINGFORINFO  |FIXED
 Status|NEEDSINFO   |RESOLVED

--- Comment #2 from Mattes D  ---
Hello,
true, I haven't seen a Konsole crash for quite some time now, so let's consider
this fixed.
Thanks.

-- 
You are receiving this mail because:
You are watching all bug changes.

[Issue 24598] OpenBSD: adapt compiler tests

2024-06-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24598

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #1 from Dlang Bot  ---
@ibara created dlang/dmd pull request #16577 "Fix Bugzilla 24598" fixing this
issue:

- Fix Bugzilla 24598

https://github.com/dlang/dmd/pull/16577

--


[Issue 24598] New: OpenBSD: adapt compiler tests

2024-06-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24598

  Issue ID: 24598
   Summary: OpenBSD: adapt compiler tests
   Product: D
   Version: D2
  Hardware: All
OS: Other
Status: NEW
  Severity: enhancement
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: bcal...@openbsd.org

I would like to champion the test changes found here:
https://github.com/dlang/dmd/pull/16278

This will help get more eyeballs on the tests.

--


[Issue 24597] FreeBSD/OpenBSD: Enable ELF_COMDAT

2024-06-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24597

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #1 from Dlang Bot  ---
@ibara updated dlang/dmd pull request #16576 "Fix 24597 -- FreeBSD/OpenBSD:
Enable ELF_COMDAT" fixing this issue:

- Fix Bugzilla 24597

https://github.com/dlang/dmd/pull/16576

--


[Issue 24597] New: FreeBSD/OpenBSD: Enable ELF_COMDAT

2024-06-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24597

  Issue ID: 24597
   Summary: FreeBSD/OpenBSD: Enable ELF_COMDAT
   Product: D
   Version: D2
  Hardware: All
OS: FreeBSD
Status: NEW
  Severity: enhancement
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: bcal...@openbsd.org

There is a note stating that old ld.bfd did not support ELF_COMDAT, and as such
it was made Linux-only.

This no longer needs to be the case. LLVM lld has been an option on FreeBSD
since 2016 and is the default linker since FreeBSD 13, released in 2021.
OpenBSD made lld the default linker in OpenBSD 6.5, released in 2019.

I think it is time to add these two OSes to the ELF_COMDAT list.

--


LE secure authentication

2024-06-10 Thread Jain A D
Hi all

I need LE secure authentication to be enabled on the device (nRF52 DK).
Enabled Legacy and LE secure authentication in syscfg.yml and added
*BLE_GAP_EVENT_PASSKEY_ACTION
*code (means calling *ble_sm_inject_io*()) in the *bleprph_gap_event*().
The Legacy authentication is working as expected, but if we select LE
secure authentication *BLE_GAP_SEC_STATUS_PDU_INVALID *is showing in nRF
Connect Desktop application.

Please anyone mention if there any other configurations or code I need to
add, for LE secure authentication to work.

Regards
Jain


[Issue 24596] Rebindable2 corrupts objects

2024-06-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24596

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #1 from Dlang Bot  ---
@FeepingCreature updated dlang/phobos pull request #9012 "Fix bugzilla 24596:
std.typecons.Rebindable2: Don't destroy classes! Only destroy structs!" fixing
this issue:

- Fix bugzilla issue 24596: std.typecons.Rebindable2: Don't destroy classes!
Only destroy structs!

https://github.com/dlang/phobos/pull/9012

--


[Issue 24596] New: Rebindable2 corrupts objects

2024-06-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24596

  Issue ID: 24596
   Summary: Rebindable2 corrupts objects
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: critical
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: default_357-l...@yahoo.de

object.destroy is, perhaps appropriately, the most destructive function ever
written.

It does something useful (resetting the value and calling the destructor) for
structs and struct derivatives, but something horrible (destroying the *class
data*) for objects. So you're always tempted to use it, but you have to
remember, every time, to disable the cases where it causes silent future
crashes.

I forgot this time.

```
module test;

import std.algorithm;

class A {
int i;
int getI() => i;
this(int i) { this.i = i; }
}

void main() {
auto arr = [new A(2), new A(3)];
auto max = arr.maxElement!(a => a.getI);
// Due to maxElement calling extremum which uses Rebindable2
// which calls destroy
// the vtable pointer of arr[0] is now zeroed out.
assert(arr[0].getI == 2);
}
```

--


[Issue 24566] condition that starts with runtime value and uses compile time array does not short circuit

2024-06-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24566

Dlang Bot  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Dlang Bot  ---
dlang/dmd pull request #16574 "Fix bugzilla issue 24566 - condition that starts
with runtime value and uses compile time array does not short circuit" was
merged into stable:

- 057170f9cef94eb94fa4ccabddd84540051c4283 by Timon Gehr:
  Fix bugzilla issue 24566 - condition that starts with runtime value and uses
compile time array does not short circuit

https://github.com/dlang/dmd/pull/16574

--


Compatible version with openjdk21

2024-06-10 Thread Sahil Sharma D
Hello team,

Which version of Apache commons is compatible with openjdk21?

Regards,
Sahil



[users@httpd] Compatible version with openjdk21

2024-06-10 Thread Sahil Sharma D
Hello team,

Which version of https client and Core is compatible with openjdk21?

Regards,
Sahil



[Issue 24566] condition that starts with runtime value and uses compile time array does not short circuit

2024-06-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24566

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #1 from Dlang Bot  ---
@tgehr updated dlang/dmd pull request #16574 "fix Issue 24566 - condition that
starts with runtime value and uses compile time array does not short circuit"
fixing this issue:

- Fix bugzilla issue 24566 - condition that starts with runtime value and uses
compile time array does not short circuit

https://github.com/dlang/dmd/pull/16574

--


[Issue 24595] OpenBSD: Use .init_array/.fini_array

2024-06-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24595

Dlang Bot  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Dlang Bot  ---
dlang/dmd pull request #16575 "FIX: Issue 24595 - OpenBSD: Use
.init_array/.fini_array" was merged into stable:

- 54e65e65135d8cb4a1c71350af88fb8c97db65ab by Brian Callahan:
  Fix Bugzilla 24595

https://github.com/dlang/dmd/pull/16575

--


Re: [VOTE] Release Apache Commons Net 3.11.1 based on RC1

2024-06-09 Thread Gary D. Gregory
Hi Phil,

I think those are OK, and likely old (or new but more on this later): The 
default goal in this POM (clean apache-rat:check javadoc:javadoc 
checkstyle:check verify japicmp:cmp) does not run SpotBugs or PMD; but the 
SpotBugs report is still generated. This means GH CI and and default builds 
don't fail for SpotBugs.

Cleaning up SpotBugs and PMD issue is on my long term to-do list, then SpotBugs 
and PMD checks can be added to the default goal.

It's likely that as SpotBugs versions have been bumped new types of issues are 
detected.

HTH,
Gary

On 2024/06/10 00:46:46 Phil Steitz wrote:
> There are a bunch of findbugs errors reported.  Is this expected?
> 
> Phil
> 
> On Fri, Jun 7, 2024 at 5:40 AM Gary Gregory  wrote:
> 
> > We have fixed a few bugs and added enhancements since Apache Commons
> > Net 3.11.0 was released, so I would like to release Apache Commons Net
> > 3.11.1.
> >
> > Apache Commons Net 3.11.1 RC1 is available for review here:
> > https://dist.apache.org/repos/dist/dev/commons/net/3.11.1-RC1 (svn
> > revision 69595)
> >
> > The Git tag commons-net-3.11.1-RC1 commit for this RC is
> > 0505563df6664a8c5b5fad6897cd373aba809c64 which you can browse here:
> >
> > https://gitbox.apache.org/repos/asf?p=commons-net.git;a=commit;h=0505563df6664a8c5b5fad6897cd373aba809c64
> > You may checkout this tag using:
> > git clone https://gitbox.apache.org/repos/asf/commons-net.git
> > --branch 
> > commons-net-3.11.1-RC1 commons-net-3.11.1-RC1
> >
> > Maven artifacts are here:
> >
> > https://repository.apache.org/content/repositories/orgapachecommons-1738/commons-net/commons-net/3.11.1/
> >
> > These are the artifacts and their hashes:
> >
> > #Release SHA-512s
> > #Fri Jun 07 12:26:06 UTC 2024
> >
> > commons-net-3.11.1-bin.tar.gz=90c1e62d8fe1d8c26588fbfefeb41f6ef16a349b8851e75297363c7d2eca5cb27d313a11e2f532f9b9c8b2790f1b9636f39c5fd563a6e9403ac6363415245bd9
> >
> > commons-net-3.11.1-bin.zip=e2e378d247ab4a1260d01c18579abe247bcca05246b9340edfb07f7bf5aa216ea745f590696bda9d43806b273ef8f8e73ed7a60b4f47f77dab45a5f657467fba
> >
> > commons-net-3.11.1-bom.json=f954bd7d2560a423b2c93f78d92cc6b658c5fab66465bc0adb3e455385448f8b32f0319c229703645a8ad9cae88dccb689e6783e85d4f450671d7563a485ac3d
> >
> > commons-net-3.11.1-bom.xml=0937d4448e3c52987ab3ba9268ebe68ab85e748a394d1c75efa6682dd265bd159c7f6c8e0bbb10fa61f2f13675ebb8d7753b2fefadee96be1e4c9da391bf9aff
> >
> > commons-net-3.11.1-javadoc.jar=fe46639c1df071ec1e4f785ff4c2b55f8b0604a3d90b9395852f9be4a4b57a9e490ab985a79fc29a6e287944a2cfc2352837685eb01795f5647ec5c95b6cbd43
> >
> > commons-net-3.11.1-sources.jar=9aa64b66154ee1775d9af6b8d99e9cb771c5234545df716e2273eb9a050cd683dda3d8520b660207f23229ccaf08533f6339ebfbb75210d0ff43df41d7419e33
> >
> > commons-net-3.11.1-src.tar.gz=0999067cc73cb0e0ab4940302180a0afa998b37c51f93c1c744bf1d346d14c89283166a665283d98200e98f0b8c39854f17493890d49ddad5769c4deb49de37e
> >
> > commons-net-3.11.1-src.zip=6820a334da2b4144acbd73e8f254bcd39cf46d83ecd4974d11e97c84fb573d78132546ac05530b3a88f7db3e59a3660600f3436716cd76c44016c797302ec8a9
> >
> > commons-net-3.11.1-test-sources.jar=0697dfe901f6f2f307c3ea813c22181c90b0b762549cc8a9e3e0394dadb2b5868e46b307630608a34df973ca5d6e346eb36823ae2a58d8d62d20ad47be3463dd
> >
> > commons-net-3.11.1-tests.jar=be5614c73ca8fe1f78ce58cc735ee34a32698ec956407562383b8257eb19a8211c0ca448507f4bfaf1bb85bbc6b3bb189edbbbfb71b5d92b5e113af579c74810
> >
> > commons-net-examples-3.11.1.jar=160512e72ae002e4214a23d0d20694295b8265a19a7889183e130d0b9e17f4a5edb22b12d3492e505269e3427935ff17d0f3f29557dd09103b68473df4648566
> >
> > commons-net-ftp-3.11.1.jar=1fc341b3ef5759858b355495d1d07fe8fdc4f6773d4619db6b67f86c39e60e7f25e208e2a4da7fa306172b7aca557c1a521144329cd6059ceaab603b7944f552
> >
> > commons-net_commons-net-3.11.1.spdx.json=0ccf4994b061451d93d1225a8960483bbfcf5e87d03caac8ed0d7e7a6e815d07b34d76c401156b2246829a30554dcb61419a6766b35451ad12a6251fa0f1eef9
> >
> > I have tested this with 'mvn' and 'mvn -V -Prelease -Ptest-deploy -P
> > jacoco -P japicmp clean package site deploy' using:
> >
> > openjdk version "21.0.3" 2024-04-16
> > OpenJDK Runtime Environment Homebrew (build 21.0.3)
> > OpenJDK 64-Bit Server VM Homebrew (build 21.0.3, mixed mode, sharing)
> >
> > Apache Maven 3.9.7 (8b094c9513efc1b9ce2d952b3b9c8eaedaf8cbf0)
> > Maven home: /usr/local/Cellar/maven/3.9.7/libexec
> > Java version: 21.0.3, vendor: Homebrew, runtime:
> > /usr/local/Cellar/openjdk@21/21.0.3/libexec/openjdk.jdk/Contents/Home
> > Default locale: en_US, platform encoding: UTF-8
> > OS name: "mac os x", version: "14.5", arch: "x86_64", family: "mac"
> >
> > Darwin  23.5.0 Darwin Kernel Version 23.5.0: Wed May  1 20:09:52
> > PDT 2024; root:xnu-10063.121.3~5/RELEASE_X86_64 x86_64
> >
> > Details of changes since 3.11.0 are in the release notes:
> >
> > https://dist.apache.org/repos/dist/dev/commons/net/3.11.1-RC1/RELEASE-NOTES.txt
> >
> > 

[Issue 24595] OpenBSD: Use .init_array/.fini_array

2024-06-09 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24595

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #1 from Dlang Bot  ---
@ibara updated dlang/dmd pull request #16575 "FIX: Issue 24595 - OpenBSD: Use
.init_array/.fini_array" fixing this issue:

- Fix Bugzilla 24595

https://github.com/dlang/dmd/pull/16575

--


Re: How to generate a random number from system clock as seed

2024-06-09 Thread drug007 via Digitalmars-d-learn

On 09.06.2024 16:37, Eric P626 wrote:

On Saturday, 8 June 2024 at 18:25:20 UTC, drug007 wrote:


~~~
    {
    const seed = castFrom!long.to!uint(Clock.currStdTime);
    auto rng = Random(seed);
    auto result = generate!(() => uniform(0, 10, rng))().take(7);
// new random numbers sequence every time
    result.writeln;
    }
}
~~~


I managed to use this piece of code and it worked.

~~~
uint seed = castFrom!long.to!uint(Clock.currStdTime);
auto rng = Random(seed);
~~~

I am not exactly sure what the exclamation points stand for in the first 
line of code. Probably, defining a type to class ```castFrom``` and 
function ```to```. But I get the idea that it just cast long to uint 
since ```Random``` requires an unsigned int >
I assume from this line of code that C casting like ```(uint)varname``` 
would not work.






`CastFrom!long` is a template instantiation. The instantiated template 
converts from `long` to `uint`. It is useful in meta-programming but 
here you can safely use other forms like c style cast:

```d
const seed = cast(uint) Clock.currStdTime;
```
or
```
const seed = to!uint(Clock.currStdTime & 0x);
```
here we need to use the `0x` mask, because `to!uint` throws a 
conversion positive overflow when the value of `Clock.currStdTime` 
exceeds the value of `uint.max`. But I don't like this variant and I 
don't recommend it.




Committer needed for build fix PR

2024-06-09 Thread Matthew D. Fuller
Hey all,

Can somebody squeeze in a minute to look at
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=279478
?  It fixes the currently-broken (with default python) build of
devel/brz, which serves the all-important task of making pkg-fallout
stop yelling at me.  I guess it would let people install the package
too, but really, mostly the pkg-fallout thing...


-- 
Matthew Fuller (MF4839)   |  fulle...@over-yonder.net
Systems/Network Administrator |  http://www.over-yonder.net/~fullermd/
   On the Internet, nobody can hear you scream.



[Issue 24595] New: OpenBSD: Use .init_array/.fini_array

2024-06-09 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24595

  Issue ID: 24595
   Summary: OpenBSD: Use .init_array/.fini_array
   Product: D
   Version: D2
  Hardware: All
OS: Other
Status: NEW
  Severity: enhancement
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: bcal...@openbsd.org

I think 8 years is long enough for people to upgrade their version of OpenBSD.

--


Re: Xalan-J release discussion

2024-06-09 Thread Gary D. Gregory
Hi Joe,

I do not see a "2.next" branch in:

>git branch -r
  origin/ExtensionEnhancements
  origin/HEAD -> origin/master
  origin/SBOAG_BRANCH_OPTIMIZATION1
  origin/SBOAG_BRANCH_OPTIMIZATION2
  origin/WebSite
  origin/Xalan3
  origin/jaxp-1_3_0-branch
  origin/jaxp-ri-1_2_0-beta-branch
  origin/jaxp-ri-1_2_0-fcs-branch
  origin/jaxp12112003_branch
  origin/master
  origin/xalan-j_2_7_x
  origin/xalan-j_xslt3.0
  origin/xalan-j_xslt3.0_mvn
  origin/xalan3
  origin/xslt20
  origin/xslt20-compiled

Is this a local branch you've not pushed? Something else?

Gary


On 2024/06/09 21:21:00 Joseph Kesselman wrote:
> The current 2.next branch should be master, assuming we are ready to commit 
> to Maven. The only issue I know of preventing that release is inclusion of 
> test in the distro archives, which I would like to see us phase out but I 
> will concede maybe not in this release. Announce intent and "deprecate" 
> perhaps.
> 
> I'm sure there is nothing "special" about Xalan release... but it has been 
> decades since I did _any_ Apache release and I need a remainder of what 
> buttons must be pushed, what checks are required, et cetera. Feel free to 
> point me at the obvious doc I haven't yet found. Would I already have all the 
> required permissions, or us that another hoop to be jumped through?
> 
> 
> I would still like to fold the 3.0 prototypes into the mainline branch at 
> some point, while keeping their prototype nature clear. While I still think 
> making them an extension package is the cleanest solution architecturally, we 
> *could* consider adding them as built in but in a separate namespace; that 
> wouldn't be as clean a code separation but would at least require that users 
> be aware that they are using something 2.0 doesn't support. I'd prefer an 
> extension-like Xalan-specific namespace since we aren't providing the rest of 
> 3.0, but if my arm is twisted hard enough I might be willing to see them in 
> the W3C's XSLT 3.0 namespace.
> 
> --
>/_  Joe Kesselman (he/him/his)
> -/ _) My Alexa skill for New Music/New Sounds fans:
>/   https://www.amazon.com/dp/B09WJ3H657/
> 
> Caveat: Opinionated old geezer with overcompensated writer's block. May be 
> redundant, verbose, prolix, sesquipedalian, didactic, officious, or redundant.
> 
> From: Gary Gregory 
> Sent: Sunday, June 9, 2024 9:25:21 AM
> To: dev@xalan.apache.org 
> Subject: Re: Xalan-J release discussion
> 
> We can decide what we want that state to be ;-)
> 
> I have questions before I experiment with running builds (below) and just 
> poking around.
> 
> There is no secret knowledge or hidden instructions to run builds and 
> releases. It's whatever we have on the site and repo. Many moons (years) ago, 
> I had asked questions on the mailing list about what branch contains what and 
> builds. I never got answers so I did the best I could with what I could find.
> 
> Our last release was 2.7.3 which Mukul performed (thank you!).
> 
> What branch is the current 2.7.4 (or 2.8.0) work?
> 
> Where is the XSLT 3 branch (I see two). Are they in sync with each other?
> 
> GitHub shows the default branch as "trunk" in 
> https://github.com/apache/xalan-j which surely can't be right. Or is it? I 
> might not even be looking at the right repo!
> Hm, I see TWO repositories:
> - https://github.com/apache/xalan-j
> - https://github.com/apache/xalan-java
> 
> Let's start with that dual repo mess, and delete the one we do not need. 
> Hopefully, there isn't a mix of work in both repositories ;p
> 
> Gary
> 
> 
> 
> 
> 
> 
> 
> On Sun, Jun 9, 2024, 1:27 AM Joseph Kesselman 
> mailto:kesh...@alum.mit.edu>> wrote:
> Actually... There was discussion of putting out one more Ant build before 
> cutting over. Problem is that either this would need to be from before I 
> merged the Maven restructuring, or we would need to make sure any actual code 
> changes got cherry-picked back into a new branch off that base (and possibly 
> then rebase the Maven build upon that, if possible).
> 
> The right answer may depend partly in who is willing to do how much of the 
> work to make it happen. Which brings me back to wanting a clear statement of 
> our current release process...
> 
> 
> --
>/_  Joe Kesselman (he/him/his)
> -/ _) My Alexa skill for New Music/New Sounds fans:
>/   https://www.amazon.com/dp/B09WJ3H657/
> 
> Caveat: Opinionated old geezer with overcompensated writer's block. May be 
> redundant, verbose, prolix, sesquipedalian, didactic, officious, or redundant.
> 
> From: Joseph Kesselman mailto:kesh...@alum.mit.edu>>
> Sent: Saturday, June 8, 2024 7:47:08 PM
> To: dev@xalan.apache.org 
> mailto:dev@xalan.apache.org>>
> Subject: Re: Xalan-J release discussion
> 
> I made some requests months back about whether we could do a release, 
> offering to do the work if someone could remind me of the process. The only 
> outstanding issue that I 

[jira] [Commented] (COLLECTIONS-701) StackOverflowError in SetUniqueList.add() when it receives itself

2024-06-09 Thread Gary D. Gregory (Jira)


[ 
https://issues.apache.org/jira/browse/COLLECTIONS-701?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17853536#comment-17853536
 ] 

Gary D. Gregory commented on COLLECTIONS-701:
-

Hello [~aikebah]  

Thank you for your report.

Would you please provide a new unit test here so we can reproduce the exact 
issue you are seeing? Or feel free to create a PR with a test and fix.

TY.

> StackOverflowError in SetUniqueList.add() when it receives itself
> -
>
> Key: COLLECTIONS-701
> URL: https://issues.apache.org/jira/browse/COLLECTIONS-701
> Project: Commons Collections
>  Issue Type: Bug
>  Components: Collection
>Affects Versions: 3.2.2
>Reporter: Shin Hong
>Priority: Critical
> Fix For: 4.3
>
>
> Hi.
> We found that the following test case fails with a StackOverFlowError 
> exception:
> {code:java}
> test() {        
>SetUniqueList l = new SetUniqueList(new LinkedList()) ;        
>l.add((Object) l) ;    
> }{code}
> The add() execution traps into an infinite recursion which crashes the 
> program.
> From the stack trace, we found that the infinite recursion occurs
> at AbstractList.hashCode() since it invokes hashCode() of each of its 
> elements.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: How to generate a random number from system clock as seed

2024-06-09 Thread monkyyy via Digitalmars-d-learn

On Sunday, 9 June 2024 at 07:11:22 UTC, Eric P626 wrote:

On Saturday, 8 June 2024 at 21:04:16 UTC, monkyyy wrote:
generate is a very rare function and do novices understand 
lamdas?


Yes I know lamdas, but try not to use them.

I am not very picky about the exact source of time, I just want 
a different integer every time I run the program. But while 
looking at the doc, it seemed complicated because I required 
time zones, and I could not get the entire time stamp as a 
single integer.


Im not sure exactly why it automagically works, but it does work, 
the defualt rng is time seeded somehow


I am not exactly sure what the exclamation points stand for in 
the first line of code.


templates

its a simplification but assume function headers have two parts, 
a compile time part and a runtime part thats from c; while it 
trys to fill in the compile time part implicitly if theres no 
information and your passing a type in, you use ! to fill the 
compile time header


[Issue 24594] New: ImportC: Packed struct has wrong layout

2024-06-09 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24594

  Issue ID: 24594
   Summary: ImportC: Packed struct has wrong layout
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: normal
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: tim.dl...@t-online.de

```
#include 
#include 

struct epoll_event
{
  uint32_t events;
  uint64_t data;
} __attribute__((packed));

int main()
{
printf("size: %zd\n", sizeof(struct epoll_event));
printf("data offset: %zd\n", &((struct epoll_event*)0)->data);
}
```

Output with gcc:

size: 12
data offset: 4

Output with dmd:

size: 16
data offset: 8

The type epoll_event is originally from Linux header /usr/include/sys/epoll.h,
but modified for this test.

The problem was found by comparing type sizes in druntime with type sizes found
with ImportC: https://github.com/dlang/dmd/pull/16571

--


[Issue 24593] New: Some structs in core.sys.posix.sys.types should be union instead of struct

2024-06-09 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24593

  Issue ID: 24593
   Summary: Some structs in core.sys.posix.sys.types should be
union instead of struct
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: normal
  Priority: P1
 Component: druntime
  Assignee: nob...@puremagic.com
  Reporter: tim.dl...@t-online.de

The types pthread_rwlock_t, pthread_rwlockattr_t, pthread_barrier_t,
pthread_barrierattr_t are unions in the glibc headers, but structs in druntime.
As a result they are bigger in druntime.

Found by comparing type sizes in druntime with type sizes found with ImportC:
https://github.com/dlang/dmd/pull/16571

--


[Issue 24592] New: ImportC: Bitfield layout wrong for int64 on 32-bit Linux

2024-06-09 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24592

  Issue ID: 24592
   Summary: ImportC: Bitfield layout wrong for int64 on 32-bit
Linux
   Product: D
   Version: D2
  Hardware: x86
OS: Linux
Status: NEW
  Severity: normal
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: tim.dl...@t-online.de

The followng struct from /usr/include/linux/perf_event.h has the wrong size
with ImportC:
```
struct perf_branch_entry {
__u64   from;
__u64   to;
__u64   mispred:1,  /* target mispredicted */
predicted:1,/* target predicted */
in_tx:1,/* in transaction */
abort:1,/* transaction abort */
cycles:16,  /* cycle count to last branch */
type:4, /* branch type */
spec:2, /* branch speculation info */
new_type:4, /* additional branch type */
priv:3, /* privilege level */
reserved:31;
};
```
With ImportC and dmd -m32 on Linux this has size 28, but with gcc -m32 it has
size 24.

Found by comparing type sizes in druntime with type sizes found with ImportC:
https://github.com/dlang/dmd/pull/16571

--


Re: How to generate a random number from system clock as seed

2024-06-09 Thread Eric P626 via Digitalmars-d-learn
On Sunday, 9 June 2024 at 13:20:09 UTC, Joseph Rushton Wakeling 
wrote:

On Saturday, 8 June 2024 at 16:09:04 UTC, monkyyy wrote:
rng is an optional parameter, `uniform(0,100).writeln;` alone 
works; the docs not telling you that is really bad


The docs do tell you that `rng` is an optional parameter of



I don't need anything fancy. Most of the time, it's for video 
games, so I want to make sure the numbers are always shuffled. 
Here it's for maze generation, so I wan each maze to be unique.


Eventually, I would like to use a fixed seed generator, so that I 
can generate the same maze over and over again if necessary. I 
guess, in that case, I could create a generator.


I found the the simplest way to implement this is not to define 
any seed or generator and simply call:


~~~
uniform(0,2)
~~~

with the range you want. It was a bit counter intuitive because 
most languages have a ```rand()``` function. But I prefer 
specifying a range.


Thanks again.



Re: How to generate a random number from system clock as seed

2024-06-09 Thread Eric P626 via Digitalmars-d-learn

On Saturday, 8 June 2024 at 18:25:20 UTC, drug007 wrote:


~~~
{
const seed = castFrom!long.to!uint(Clock.currStdTime);
auto rng = Random(seed);
auto result = generate!(() => uniform(0, 10, 
rng))().take(7);

// new random numbers sequence every time
result.writeln;
}
}
~~~


I managed to use this piece of code and it worked.

~~~
uint seed = castFrom!long.to!uint(Clock.currStdTime);
auto rng = Random(seed);
~~~

I am not exactly sure what the exclamation points stand for in 
the first line of code. Probably, defining a type to class 
```castFrom``` and function ```to```. But I get the idea that it 
just cast long to uint since ```Random``` requires an unsigned 
int.


I assume from this line of code that C casting like 
```(uint)varname``` would not work.





Class MC UI trick?

2024-06-09 Thread Gary D. Gregory
Do you have a trick to get the Classic UI for Maven Central?

My go to search.maven.org flashes the old UI in Firefix and then redirects to 
https://central.sonatype.com/?smo=true 

I really don't like the new UI :( It takes up way to much space for tool little 
information.

Sigh, progress,
Gary

-
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org



Re: How to generate a random number from system clock as seed

2024-06-09 Thread Joseph Rushton Wakeling via Digitalmars-d-learn

On Saturday, 8 June 2024 at 16:09:04 UTC, monkyyy wrote:
rng is an optional parameter, `uniform(0,100).writeln;` alone 
works; the docs not telling you that is really bad


The docs do tell you that `rng` is an optional parameter of 
`uniform`:

https://dlang.org/phobos/std_random.html#uniform

However, there are often good reasons to want to pass a specific 
RNG: you may want to pick the specific RNG algorithm, and you may 
want to be able to know exactly how it was seeded, e.g. if you 
want to be able to reproduce the same results.  I assume that 
Eric's use case may reflect that.


Re: How to generate a random number from system clock as seed

2024-06-09 Thread Joseph Rushton Wakeling via Digitalmars-d-learn

On Saturday, 8 June 2024 at 13:19:30 UTC, Eric P626 wrote:

Now I want to seed the generator using system time.


Just to be clear, do you _specifically_ want to use the system 
time, or are you aiming to use the system time to generate 
different seeds for each run?


If the latter you might prefer to use the `unpredictableSeed()` 
function from `std.random`:

https://dlang.org/phobos/std_random.html#unpredictableSeed

That may use a variety of different methods to generate the seed, 
depending on the capabilities of the system, but one of the 
fallback options (which is actually the original implementation 
IIRC) uses a pseudo-random transformation of values derived from 
the thread ID, the process ID, and the current time in ticks as 
reported by the system's monotonic clock.


A benefit of that is that it means that different threads in the 
same app, and different apps, are guaranteed to get _different_ 
random seeds if started at the same time.


The preferred alternatives to that use different mechanisms, but 
should all have the same desired property of guaranteeing that 
different threads get different random seeds.


But FWIW, if current time in ticks is valid for your use-case, 
`cast(ulong) MonoTime.currTime.ticks` should do.


Hope that helps!

Best wishes,

-- Joe


[Issue 24590] Illegal instruction with module constructors cycle and shared libphobos2 in _d_criticalenter2

2024-06-09 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24590

kinke  changed:

   What|Removed |Added

 CC||ki...@gmx.net

--- Comment #2 from kinke  ---
AFAICT, this happens because at program termination, each binary unregisters
itself via a CRT destructor, incl. running the module dtors of that binary if
druntime had been initialized via `rt_init()`. For libphobos2.so, this includes
the `rt.trace` module dtor (whereas static druntime probably doesn't unless
using tracing functionality), which uses an anonymous mutex, which depends on
an initialized druntime (`_d_critical_init()` without `_d_critical_term()`).

But `rt_init()` already cleans up via `_d_critical_term()` if initialization
failed, e.g., due to module cycles here. AFAICT, the problem is
`rt.sections_elf_shared._isRuntimeInitialized`, which is set once during the
`initSections()` call, but would need to be unset if module ctors later throw.
We should probably get rid of that variable and use `rt.dmain2._initCount`
instead.

This also crashes with `-defaultlib=libphobos2.so` only:
```
shared static this() {
throw new Exception("oops");
}

void main() {}
```

--


Re: D officially supported on Apache NuttX RTOS

2024-06-09 Thread Sergey via Digitalmars-d-announce

On Friday, 7 June 2024 at 12:23:54 UTC, Matheus Catarino wrote:

ref.: https://x.com/MisterTechBlog/status/1798918878350950840

**Note:** Currently, ldc2 compiler only for 
riscv/arm/sim[ulator]. gdc and dmd need PR!


For those who far away from embedding maybe you can add a couple 
of words about this system, and which applications it allows to 
create with D?
I suppose only betterC mode is supported, so there is no Phobos 
on those tiny machines?





Re: How to generate a random number from system clock as seed

2024-06-09 Thread Eric P626 via Digitalmars-d-learn

On Saturday, 8 June 2024 at 21:04:16 UTC, monkyyy wrote:
generate is a very rare function and do novices understand 
lamdas?


Yes I know lamdas, but try not to use them.

I am not very picky about the exact source of time, I just want a 
different integer every time I run the program. But while looking 
at the doc, it seemed complicated because I required time zones, 
and I could not get the entire time stamp as a single integer.




[Issue 24590] Illegal instruction with module constructors cycle and shared libphobos2 in _d_criticalenter2

2024-06-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24590

--- Comment #1 from Andrei Horodniceanu  ---
> The code above fails with both dmd and ldc2 but not with gdc.

My bad, I forgot to pass `-shared-libphobos` when building with gdc. With the
flag disabled I get:

object.Error@/var/tmp/portage/sys-devel/gcc-14.1.1_p20240518/work/gcc-14-20240518/libphobos/libdruntime/rt/minfo.d(372):
Cyclic dependency between module constructors/destructors of b and a
b* ->
a* ->
b*


And when passing the flag I get:

object.Error@/var/tmp/portage/sys-devel/gcc-14.1.1_p20240518/work/gcc-14-20240518/libphobos/libdruntime/rt/minfo.d(372):
Cyclic dependency between module constructors/destructors of b and a
b* ->
a* ->
b*


??:? _d_createTrace [0x7fafb9cfe3fb]
??:? _d_throw [0x7fafb9cf23b4]
??:? ???[0x7fafb9d02c08]
??:? ???[0x7fafb9d02b7d]
??:? ???[0x7fafb9d02d87]
??:? nothrow void rt.minfo.ModuleGroup.sortCtors(immutable(char)[])
[0x7fafb9d04317]
??:? ???[0x7fafb9d04427]
??:? int gcc.sections.elf.DSO.opApply(scope int delegate(ref
gcc.sections.elf.DSO)) [0x7fafb9cf321a]
??:? rt_init [0x7fafb9cfe84a]
??:? ???[0x7fafb9cfe9ef]
??:? _d_run_main2 [0x7fafb9cfed1b]
??:? _d_run_main [0x7fafb9cfeefc]
/usr/lib/gcc/x86_64-pc-linux-gnu/14/include/d/core/internal/entrypoint.d:29
main [0x560cd1844306]
??:? ???[0x7fafb96592df]
??:? __libc_start_main [0x7fafb9659398]
??:? _start [0x560cd1844094]
??:? ???[0x]


Which is an improvement since it's not a crash.

--


Re: Examples of concurrent coproc usage?

2024-06-08 Thread Martin D Kealey
On Wed, 10 Apr 2024 at 03:58, Carl Edquist  wrote:

> Note the coproc shell only does this with pipes; it leaves other user
> managed fds like files or directories alone.
>
> I have no idea why that's the case, and i wonder whether it's intentional
> or an oversight.
>

Simply closing all pipes is definitely a bug.

This is starting to feel like we really need explicit ways to control
attributes on filedescriptors.

It should be possible to arrange so that any new subshell will keep
"emphemal" filedescriptors until just before invoking a command.

One mechanism would be to add two new per-fd attributes: *inherited-by-fork*,
and *ephemeral*.

The *inherited-by-fork* attribute would be set on any fd that's carried
through a fork (especially the implicit fork to create a pipeline) and
reset on any fd that's the result of a redirection.

The *emphemal* attribute is set on any coproc fd (or at least, any that's a
pipe to the stdin of a coproc).

Then when *both* attributes are set on an fd, it would be closed just
before launching any inner command, after any redirections have been
done.That way we could simply turn off the close-after-fork attribute on a
coproc fd if that's desired, but otherwise avoid deadlocks in the simple
cases.

-Martin


Re: Bug tracking

2024-06-08 Thread Martin D Kealey
On Tue, 2 Apr 2024 at 00:31, Chet Ramey  wrote:

> On 3/31/24 8:34 PM, Martin D Kealey wrote:
> > That's a good start, but it seems incomplete, and there's little --
> perhaps
> > no -- overlap with bug reports in this list.
>

And this is still the most fundamental problem; the submission of bug
reports, the discussion around them, and the proposed fixes currently are
split between multiple platforms that don't talk to each other. So *very*
few people actually track everything.


> > Has bashbug always sent email to bug-bash@gnu.org, or was it previously
> fed into Savannah?
> bashbug long predates savannah.
>

We are instructed to submit bug reports via bash-bug, or by posting to this
mailing list, but none of those reports reach Savannah.

When Savannah became the primary repository, bash-bug should have been
updated to post to Savannah, and/or an email receiver should have been
created to inject into Savannah's "support" queue. Likewise, details
entered directly on Savannah should be sent to the mailing list. ("Overdue"
would be an understatement.)

First impressions when I sign into Savannah:

   - There's no "dashboard" or "overview" of stuff that I personally am
   likely to need. In particular, there's no mention of any projects I'm
   trying to engage with. OK I'll try to add some:
   - The sidebar has a (relatively) obvious link "My Groups", taking me to
   "My Group Membership".
   Nope, "You're not a member of any public group".
   - The right panel has "Request for inclusion", which sounds about right.
   OK, let's search for Bash. Yay, found ... oh wait, nope, "Bash Bear Trap"
   is not "Bash".
   - Let's back up, and use the site search in the side bar.
   OK, *this* time I see "The GNU Bourne-Again SHell" (and the Bear Trap
   again, and 13 other projects).
   Let's follow that link and ... yay, found it.

At this point I save a bookmark, because that was the short-and-simple
version of what was actually a much longer and far more tedious process of
discovery.

The summary page says that this project has:

   - 3 mailing lists
   - an SVN repository (which turns out to be empty)
   - a Git repository
   - a "tech support manager" (which turns out to be a general inquiries
   queue)
   - a "patch manager" (which turns out to be a bug-reporting and
   feature-request queue)
   - 3 mailing lists

Initial impression good.
Well okay.
For all of 10 minutes, by which time I've discovered that these facilities
have no mutual integration.

It seems like the "support" queue is intended for interactions with users
and the "patches" queue is for interactions between designers, developers
and Q/A reviewers. That arrangement could have some benefits, but
unfortunately:

   - The support and patch queues don't talk to each other. Once an actual
   bug is identified from a support request, a separate "patch" issue has to
   be opened, without any automatic cross referencing. And therefore when a
   bug fix finally makes it into a release, there's no automated process to
   close any original support requests.
   - Neither the support queue nor the patches queue has any integration
   with this email list (nor, I suspect, with any others).
   - Any cross-referencing between them is up to project members to perform
   manually.
   - The git repo has a fixed set of branches created by the members; other
   users cannot create their own branches.
   - When it says "patch", it really still means an actual context diff
   text file.
   Anyone used to using a modern source management system (e.g. Piper,
   Perforce, Bitbucket, Gitlab, or GitHub) would expect "patch" to mean a git
   branch or equivalent, which can be amended (with additional commits),
   merged, or rebased, all while being subject to regression testing, and then
   merged into the "master" branch once it has QA approval. (A major effect of
   this lack is that a textual patch can "go stale" while the master branch in
   the git repo moves on, without any tracking of how far out of date it's
   become.)
   But there is no linkage between the patch queue and any git repo, nor is
   there a branch per active patch issue.
   - We cannot use ssh to connect to git.savannah.gnu.org, despite the
   instructions for cloning the repo saying we should use
   @git.savannah.gnu.org:/srv/git/bash.git rather than just
git.savannah.gnu.org:/srv/git/bash.git
   .

This combination of missing features (and outright mis-features) amounts to
the antithesis of how one should design a modern collaborative development
process.

And that's a big part of why a one-man-band running the whole show is the
only feasible support model.

> Savannah seems too simplistic [...]
>
> If you have suggestions for the savannah maintainers, 

Iota v0.3.0 is entering beta stage

2024-06-08 Thread solidstate1991 via Digitalmars-d-announce
My own D native multimedia layer (similar to SDL, but even more 
minimalistic, especially as of now) is now capable of displaying 
OpenGL context and is capable of detecting inputs on both Windows 
and Linux. Has some bugs and things aren't 100% finalized, hence 
the beta version.


https://github.com/ZILtoid1991/iota/releases/tag/v0.3.0-beta

See the testcases for some examples, also I'll be writing a 
better documentation soon.


Re: How to generate a random number from system clock as seed

2024-06-08 Thread monkyyy via Digitalmars-d-learn

On Saturday, 8 June 2024 at 20:53:02 UTC, Nick Treleaven wrote:

On Saturday, 8 June 2024 at 16:09:04 UTC, monkyyy wrote:
rng is an optional parameter, `uniform(0,100).writeln;` alone 
works; the docs not telling you that is really bad


They do tell you:

urng 	(optional) random number generator to use; if not 
specified, defaults to rndGen


That overload is used in the 2nd example.

https://dlang.org/phobos/std_random.html#.uniform


generate is a very rare function and do novices understand lamdas?


Re: How to generate a random number from system clock as seed

2024-06-08 Thread Nick Treleaven via Digitalmars-d-learn

On Saturday, 8 June 2024 at 16:09:04 UTC, monkyyy wrote:
rng is an optional parameter, `uniform(0,100).writeln;` alone 
works; the docs not telling you that is really bad


They do tell you:

urng 	(optional) random number generator to use; if not 
specified, defaults to rndGen


That overload is used in the 2nd example.

https://dlang.org/phobos/std_random.html#.uniform



Re: How to generate a random number from system clock as seed

2024-06-08 Thread Salih Dincer via Digitalmars-d-learn

On Saturday, 8 June 2024 at 18:25:20 UTC, drug007 wrote:


```d
{
const seed = castFrom!long.to!uint(Clock.currStdTime);
auto rng = Random(seed);
auto result = generate!(() => uniform(0, 10, 
rng))().take(7);

// new random numbers sequence every time
result.writeln;
}
```


If UnixTime is desired, it is sufficient to have 
currTime.toUnixTime instead of currStdTime. It will not reset 
until January 19, 2038.


```d
auto seed = to!uint(Clock.currTime.toUnixTime);
```

SDB@79


Re: How to generate a random number from system clock as seed

2024-06-08 Thread drug007 via Digitalmars-d-learn

On 08.06.2024 16:19, Eric P626 wrote:

I managed to create a random number generator using the following code:

~~~
auto rng = Random(42);
//
uniform(0,10,rng);
~~~

Now I want to seed the generator using system time. I looked at Date & 
time functions/classes and systime functions/classes. The problem is 
that they all require a time zone. But I don't need a time zone since 
there is no time zone. I just want the number of seconds elapsed since 
jan 1st 1970. In other words, the internal system clock value.




```d
import std;

void main()
{
{
auto rng = Random(42);
auto result = generate!(() => uniform(0, 10, rng))().take(7);
// the same random numbers sequence
assert (result.equal([2, 7, 6, 4, 6, 5, 0]));
}

{
const seed = castFrom!long.to!uint(Clock.currStdTime);
auto rng = Random(seed);
auto result = generate!(() => uniform(0, 10, rng))().take(7);
// new random numbers sequence every time
result.writeln;
}
}
```


Re: Boot hangs on recent kernels

2024-06-08 Thread Michael D. Setzer II via users
On 8 Jun 2024 at 18:20, Klaus-Peter Schrage via users wrote:

Date sent:  Sat, 8 Jun 2024 18:20:26 +0200
To: users@lists.fedoraproject.org
Subject:Boot hangs on recent kernels
Send reply to:  Community support for Fedora users

From:   Klaus-Peter Schrage via users

Copies to:  Klaus-Peter Schrage 

> Since kernel 6.8.10-300.fc40.x86_64, boot hangs on KDE Plasma (kernel
> 6.8.9-300.fc40.x86_64 was the last good one).
> I found that there is a job running infinitely:
>
> 'Job dev-disk-by\x2duuid-8e895running ...'
> The above mentioned UUID (8e895 ...) corresponds to the kernel
> 'resume=uuid=...' command line parameter.
>
> When I comment it out in GRUB2, as suggested in
>
> https://discussion.fedoraproject.org/t/solved-boot-hang-job-dev-disk-by-x2uuid-no-limit/
>
> then the system boots as expected.
>
might want to run blkid and see what it reports.

My notebook reports this type of info.
Note lines wrap here, but you might see the uuid in that.
Old notebook that originally had windows 7 but works fine.
Uses kernel 6.8.11-300.fc40.x86_64

# blkid
/dev/sdb1: LABEL_FATBOOT="G4L" LABEL="G4L" UUID="17AF-405F" BLOCK_SIZE="512"
TYPE="vfat" PARTLABEL="G4L" PARTUUID="0b1903e5-65a5-429d-ad59-47e389d5e71b"
/dev/sda2: LABEL="SYSTEM RESERVED" BLOCK_SIZE="512" UUID="2036488536485DC2"
TYPE="ntfs" PARTUUID="7c819ab2-02"
/dev/sda9: UUID="0fada7bc-4eb7-4a9d-a80b-10093423db8d" BLOCK_SIZE="4096" 
TYPE="ext4"
PARTUUID="7c819ab2-09"
/dev/sda7: UUID="12b58c6d-c9f1-4ffe-ba7a-aa816f762ba3" BLOCK_SIZE="4096" 
TYPE="ext4"
PARTUUID="7c819ab2-07"
/dev/sda5: UUID="fa908208-22bd-4031-b620-841498e0708c" BLOCK_SIZE="4096" 
TYPE="ext4"
PARTUUID="7c819ab2-05"
/dev/sda3: LABEL="Acer" BLOCK_SIZE="512" UUID="6C224AD8224AA744" TYPE="ntfs"
PARTUUID="7c819ab2-03"
/dev/sda1: LABEL="PQSERVICE" BLOCK_SIZE="512" UUID="1C0647FA0647D384" 
TYPE="ntfs"
PARTUUID="7c819ab2-01"
/dev/sda8: UUID="0c44fcc6-2aa1-4dff-bd40-0dea2c17711f" BLOCK_SIZE="4096" 
TYPE="ext4"
PARTUUID="7c819ab2-08"
/dev/sda6: UUID="a5875ef2-b439-474f-9571-01e00c6599f3" TYPE="swap"
PARTUUID="7c819ab2-06"
/dev/zram0: LABEL="zram0" UUID="425a1d11-ec0a-495b-98f3-dd7aeb54b31b" 
TYPE="swap"
/dev/sr1: BLOCK_SIZE="2048" UUID="2008-05-06-12-26-42-" LABEL="U3 System" 
TYPE="iso9660"


> This is a rather fresh install of fedora 40 (running on ext4):
>
> da  8:0    0 232,9G  0 disk
> ├─sda1   8:1    0   1,1G  0 part /boot
> ├─sda2   8:2    0  49,1G  0 part /
> ├─sda3   8:3    0  31,7G  0 part /home
> └─sda4   8:4    0   151G  0 part /mnt/Daten3
>
> I have no swap partition, resume after hibernation works without errors.
>
> Although there is an obvious workaround (permanently removing the resume
> parameter from the kernel command line), I still wonder what has happened?
> --
> ___
> users mailing list -- users@lists.fedoraproject.org
> To unsubscribe send an email to users-le...@lists.fedoraproject.org
> Fedora Code of Conduct: 
> https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives: 
> https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
> Do not reply to spam, report it: 
> https://pagure.io/fedora-infrastructure/new_issue



++
 Michael D. Setzer II - Computer Science Instructor (Retired)
 mailto:mi...@guam.net
 mailto:msetze...@gmail.com
 mailto:msetze...@gmx.com
 Guam - Where America's Day Begins
 G4L Disk Imaging Project maintainer
 http://sourceforge.net/projects/g4l/
++


--
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: [MapServer-dev] GNU Regex Replacement?

2024-06-08 Thread Lime, Steve D (MNIT) via MapServer-dev
Maybe a 9.0 change then? Sounds like the underlying issues should be fixed 
regardless though.

From: MapServer-dev  On Behalf Of Even 
Rouault via MapServer-dev
Sent: Saturday, June 8, 2024 10:37 AM
To: Paul Ramsey ; Steve Lime 
Cc: MapServer Devs 
Subject: Re: [MapServer-dev] GNU Regex Replacement?

This message may be from an external email source.
Do not select links or open attachments unless verified. Report all suspicious 
emails to Minnesota IT Services Security Operations Center.



UPDATE: msautotest now pass against PCRE2 with a few extra fixes.

This was actually quite helpful to uncover 2 underlying issues, not related to 
PCRE2 itself:

- one (likely) wrong default regex with ms_map_bad_pattern_default in 
msCGILoadMap() where escaping antislash was missing (probably tolerated by GNU 
regex , but PCRE2 is more picky about that). Easy to fix

- and more embarrassing, our redefined MS_REG_ constants in mapregex.h 
happen to not match the values of GNU regex (they might perhaps have matched in 
earlier times, but things have drifted apart since then)... In particular, 
MS_REG_NOSUB = 4 was thus wrongly interpreted as REG_NEWLINE = (1 << 2). I 
loose some extra hair on figuring that out. The symptom was in rfc62.map where 
a query string parameter whose value is "foo%0Abar" (foo newline bar) happened 
to validate (with GNU regex) the following expression '^[a-z]{1,16}$' whereas 
it shouldn't have (our expected result was incorrect). The value matched 
because msEvalRegex() sets MS_REG_NOSUB which was wrongly interpreted as 
REG_NEWLINE, thus making the caret / dollar to apparently match any line 
instead of the whole string. When using PCRE2, the match didn't occur because 
PCRE2 and GNU regex have exactly subtle different semantics regarding newline 
matching (I tried to understand 
https://www.pcre.org/current/doc/html/pcre2posix.html#SEC5, but beyond my 
mastering)

So all in all, it seems PCRE2 could be a viable alternative. I would expect 
"subtle" differences, so any mapfile having regular expressions in it that was 
tested with GNU/BSD/POSIX/whatever regex should be carefully checked for 
correct execution if switching to PCRE2

Even
Le 08/06/2024 à 15:35, Even Rouault via MapServer-dev a écrit :

Hi,

my attempt at https://github.com/MapServer/MapServer/pull/7073 . It links, but 
PCRE2 doesn't seem to speak the same regex dialect as GNU regex...

Even
Le 08/06/2024 à 05:31, Paul Ramsey via MapServer-dev a écrit :
Looks like it was in Centos as far back as 7, and is in base Ubuntu. It’s in 
MacPorts and Homebrew. So, fairly common?
P.


On Jun 7, 2024, at 8:06 PM, Steve Lime 
 wrote:

One would think replacement wouldn’t be that hard. It’s pretty localized in 
MapServer. Is pcre2 widely available?

On Fri, Jun 7, 2024 at 2:40 PM Paul Ramsey via MapServer-dev 
mailto:mapserver-dev@lists.osgeo.org>> wrote:
We dragged around a dependency on pcre which got updated to pcre2 lately.

> On Jun 7, 2024, at 12:38 PM, Howard Butler via MapServer-dev 
> mailto:mapserver-dev@lists.osgeo.org>> wrote:
>
> I was playing around with getting Conda Forge builds of MapServer working, 
> and when I got to Windows, I realized we need the GNU Regex library
>
> https://github.com/conda-forge/mapserver-feedstock/issues/47#issue-2341018003
>
> It is ancient, not released as a standalone library anymore, and causes 
> anything linking against it to also be GPL (which we're doing in the Windows 
> build situation). Maybe it is not worth the trouble to change anything, but 
> if one were to do so, what should be used in its place?
>
> Howard
> ___
> MapServer-dev mailing list
> MapServer-dev@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-dev

___
MapServer-dev mailing list
MapServer-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-dev




___

MapServer-dev mailing list

MapServer-dev@lists.osgeo.org

https://lists.osgeo.org/mailman/listinfo/mapserver-dev

--

http://www.spatialys.com

My software is free, but my time generally not.



___

MapServer-dev mailing list

MapServer-dev@lists.osgeo.org

https://lists.osgeo.org/mailman/listinfo/mapserver-dev

--

http://www.spatialys.com

My software is free, but my time generally not.
___
MapServer-dev mailing list
MapServer-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-dev


[Issue 24591] New: [std.random] docs bad at communicating trivail usecase

2024-06-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24591

  Issue ID: 24591
   Summary: [std.random] docs bad at communicating trivail usecase
   Product: D
   Version: D2
  Hardware: All
   URL: http://dlang.org/phobos/
OS: All
Status: NEW
  Severity: enhancement
  Priority: P3
 Component: phobos
  Assignee: nob...@puremagic.com
  Reporter: crazymonk...@gmail.com

https://forum.dlang.org/post/etyigamzkmvinpooe...@forum.dlang.org

https://dlang.org/phobos/std_random.html#.uniform

uniform's docs code communicates using a verbose seed; this is wildly
unnecessary for 95% of cases(and if someones doing cyptro they should read and
understand the whole lib)

pathologically simple code such as:

```d
import std;
void main(){
uniform(0,100).writeln;
}
```

should be front and center

--


Re: How to generate a random number from system clock as seed

2024-06-08 Thread monkyyy via Digitalmars-d-learn

On Saturday, 8 June 2024 at 13:19:30 UTC, Eric P626 wrote:
I managed to create a random number generator using the 
following code:


~~~
auto rng = Random(42);
//
uniform(0,10,rng);
~~~

Now I want to seed the generator using system time. I looked at 
Date & time functions/classes and systime functions/classes. 
The problem is that they all require a time zone. But I don't 
need a time zone since there is no time zone. I just want the 
number of seconds elapsed since jan 1st 1970. In other words, 
the internal system clock value.


rng is an optional parameter, `uniform(0,100).writeln;` alone 
works; the docs not telling you that is really bad


the docs/api for std.time/random are bad if you need something 
specif Id suggest doing it yourself, but if you want to use 
std.time anyway the magic word I think is "localtime"(Ive pounded 
my head into those auto generated docs and had to dive deep to 
find such estoric knowledge)


if you need a spefic random number from a spefic timestamp, Id 
suggest making a rng function from scratch and using clibs time 
stuff


[Issue 24577] Struct with constructor returned from C++ wrong

2024-06-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24577

Dlang Bot  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #3 from Dlang Bot  ---
dlang/dmd pull request #16570 "Fix bugzilla 24577 - Struct with constructor
returned from C++ wrong" was merged into master:

- d8a684c435aca1f85fcb6a250beed5628284f777 by Tim Schendekehl:
  Fix bugzilla 24577 - Struct with constructor returned from C++ wrong

  The test case is copied from LDC, where it already worked. It also has
  an additional test for a member struct with constructor.

https://github.com/dlang/dmd/pull/16570

--


Re: How to generate a random number from system clock as seed

2024-06-08 Thread Salih Dincer via Digitalmars-d-learn

On Saturday, 8 June 2024 at 13:19:30 UTC, Eric P626 wrote:
I just want the number of seconds elapsed since jan 1st 1970. 
In other words, the internal system clock value.


#unix #time

@SDB79



How to generate a random number from system clock as seed

2024-06-08 Thread Eric P626 via Digitalmars-d-learn
I managed to create a random number generator using the following 
code:


~~~
auto rng = Random(42);
//
uniform(0,10,rng);
~~~

Now I want to seed the generator using system time. I looked at 
Date & time functions/classes and systime functions/classes. The 
problem is that they all require a time zone. But I don't need a 
time zone since there is no time zone. I just want the number of 
seconds elapsed since jan 1st 1970. In other words, the internal 
system clock value.




[Issue 24577] Struct with constructor returned from C++ wrong

2024-06-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24577

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #2 from Dlang Bot  ---
@tim-dlang created dlang/dmd pull request #16570 "Fix bugzilla 24577 - Struct
with constructor returned from C++ wrong" fixing this issue:

- Fix bugzilla 24577 - Struct with constructor returned from C++ wrong

  The test case is copied from LDC, where it already worked. It also has
  an additional test for a member struct with constructor.

https://github.com/dlang/dmd/pull/16570

--


Re: modInverse & powMod

2024-06-08 Thread Salih Dincer via Digitalmars-d-learn

On Friday, 7 June 2024 at 13:43:29 UTC, Salih Dincer wrote:


SDB@79

I have only one question: Is there a modInverse() function in 
the standard library for use in RSA?


Apparently not, it fell to lot :)

I already had such a function...

```d
auto modInverse(T)(T m, T n) pure
{
  T q, ilk = n;
  T y, tmp, x = 1;

  while (m > 1)
  {
q = m / n;

tmp = n;
  n = m % n;
  m = tmp;

tmp = y;
  y = x - q * y;
  x = tmp;
  }
  return x < 0 ? x + ilk : x;
}
```

And in the BigInt module there was divMod() next to powmod():

```d
auto modInverse(BigInt a, BigInt m)
{
  BigInt q, m0 = m;
  BigInt tmp, y, x = 1;

  while (a > 1)
  {
// m is remainder now
    tmp = m;
    divMod(a, m, q, m);

    // process same as Euclid's algorithm
    a = tmp;
tmp = y;

// Update y and x
y = x - q * y;
x = tmp;
  }

  // Make x positive
  if (x < 0) x += m0;

  return x;
}
```

Is PR required? Why not modInverse too!

SDB@79


Bug#1072817: bookworm-pu: package openrc/0.45.2-2+deb12u1

2024-06-08 Thread Adam D. Barratt
Control: tags -1 + moreinfo

Hi,

On Sat, 2024-06-08 at 11:59 +0100, Mark Hindley wrote:

[...]
>   [x] attach debdiff against the package in stable

While you have attached a debdiff, it's of the binary packages. Please
provide a source debdiff, i.e. between the current and proposed DSCs.

Regards,

Adam



[Issue 24590] New: Illegal instruction with module constructors cycle and shared libphobos2 in _d_criticalenter2

2024-06-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24590

  Issue ID: 24590
   Summary: Illegal instruction with module constructors cycle and
shared libphobos2 in _d_criticalenter2
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P1
 Component: druntime
  Assignee: nob...@puremagic.com
  Reporter: a.horodnice...@proton.me

Take the two files:

module a;
import b;
shared static this(){}


module b;
import a;
shared static this(){}

compiled with `dmd a.d b.d -defaultlib=libphobos2.so -main -ofmain`.

Running main produces:

$ ./main
object.Error@src/rt/minfo.d(372): Cyclic dependency between module
constructors/destructors of b and a
b* ->
a* ->
b*


??:? nothrow bool
rt.minfo.ModuleGroup.sortCtors(immutable(char)[]).findDeps(ulong, ulong*)
[0x7f240dc5a1e9]
??:? nothrow bool
rt.minfo.ModuleGroup.sortCtors(immutable(char)[]).processMod(ulong)
[0x7f240dc5a3fa]
??:? nothrow bool
rt.minfo.ModuleGroup.sortCtors(immutable(char)[]).processMod(ulong)
[0x7f240dc5a4eb]
??:? nothrow bool
rt.minfo.ModuleGroup.sortCtors(immutable(char)[]).doSort(ulong, ref
immutable(object.ModuleInfo)*[]) [0x7f240dc5a773]
??:? nothrow void rt.minfo.ModuleGroup.sortCtors(immutable(char)[])
[0x7f240dc59c89]
??:? void rt.minfo.ModuleGroup.sortCtors() [0x7f240dc5a838]
??:? int rt.minfo.rt_moduleCtor().__foreachbody1(ref
rt.sections_elf_shared.DSO) [0x7f240dc5abe8]
??:? int rt.sections_elf_shared.DSO.opApply(scope int delegate(ref
rt.sections_elf_shared.DSO)) [0x7f240dc5c557]
??:? rt_moduleCtor [0x7f240dc5abc8]
??:? rt_init [0x7f240dc524c9]
??:? void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int
function(char[][])*).runAll() [0x7f240dc52a6f]
??:? void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int
function(char[][])*).tryExec(scope void delegate()) [0x7f240dc52a0d]
??:? _d_run_main2 [0x7f240dc52976]
??:? _d_run_main [0x7f240dc5275f]
??:? main [0x55f47ddba1af]
??:? [0x7f240d5660cf]
??:? __libc_start_main [0x7f240d566188]
??:? _start [0x55f47ddba084]
Illegal instruction (core dumped)


The core dump shows:

(gdb) bt
#0  0x7f240dc519dd in _d_criticalenter2 () from
/usr/lib/dmd/2.108/lib64/libphobos2.so.0.108
#1  0x7f240dc5f498 in rt.trace._staticDtor_L408_C1() () from
/usr/lib/dmd/2.108/lib64/libphobos2.so.0.108
#2  0x7f240dc603c1 in rt.trace.__moddtor() () from
/usr/lib/dmd/2.108/lib64/libphobos2.so.0.108
#3  0x7f240dc5aece in
rt.minfo.runModuleFuncsRev!(rt.minfo.ModuleGroup.runTlsDtors().__lambda1).runModuleFuncsRev(const(immutable(object.ModuleInfo)*)[])
() from /usr/lib/dmd/2.108/lib64/libphobos2.so.0.108
#4  0x7f240dc5a8b9 in rt.minfo.ModuleGroup.runTlsDtors() () from
/usr/lib/dmd/2.108/lib64/libphobos2.so.0.108
#5  0x7f240dc5d5c2 in _d_dso_registry () from
/usr/lib/dmd/2.108/lib64/libphobos2.so.0.108
#6  0x7f240dbe83b6 in ?? () from
/usr/lib/dmd/2.108/lib64/libphobos2.so.0.108
#7  0x0001 in ?? ()
#8  0x7f240dda99a0 in ?? () from
/usr/lib/dmd/2.108/lib64/libphobos2.so.0.108
#9  0x7f240ddd2fe0 in vtable for etc.linux.memoryerror.NullPointerError ()
from /usr/lib/dmd/2.108/lib64/libphobos2.so.0.108
#10 0x7f240ddd4660 in ?? () from
/usr/lib/dmd/2.108/lib64/libphobos2.so.0.108
#11 0x7f240de640b0 in ?? ()
#12 0x7f240de670e2 in _dl_call_fini () from /lib64/ld-linux-x86-64.so.2
#13 0x7f240de6af9e in _dl_fini () from /lib64/ld-linux-x86-64.so.2
#14 0x7f240d57e656 in ?? () from /usr/lib64/libc.so.6
#15 0x7f240d57e790 in exit () from /usr/lib64/libc.so.6
#16 0x7f240d5660d7 in ?? () from /usr/lib64/libc.so.6
#17 0x7f240d566189 in __libc_start_main () from /usr/lib64/libc.so.6
#18 0x55f47ddba085 in _start ()


And the surrounding assembly:

Dump of assembler code for function _d_criticalenter2:
   0x7f240dc519a8 <+0>: push   %rbp
   0x7f240dc519a9 <+1>: mov%rsp,%rbp
   0x7f240dc519ac <+4>: sub$0x30,%rsp
   0x7f240dc519b0 <+8>: mov%rbx,-0x28(%rbp)
   0x7f240dc519b4 <+12>:mov%r12,-0x20(%rbp)
   0x7f240dc519b8 <+16>:mov%rdi,%r12
   0x7f240dc519bb <+19>:cmpq   $0x0,(%r12)
   0x7f240dc519c0 <+24>:jne0x7f240dc51a5e <_d_criticalenter2+182>
   0x7f240dc519c6 <+30>:mov0xff003(%rip),%rbx#
0x7f240dd509d0
   0x7f240dc519cd <+37>:add$0x8,%rbx
   0x7f240dc519d1 <+41>:mov%rbx,%rdi
   0x7f240dc519d4 <+44>:call   0x7f240da893b0 
   0x7f240dc519d9 <+49>:test   %eax,%eax
   0x7f240dc519db <+51>:je 0x7f240dc519df <_d_criticalenter2+55>
=> 0x7f240dc519dd <+53>:ud2
   0x7f240dc519df <+55>:cmpq   $0x0,(%r12)
   0x7f240dc519e4 <+60>:jne0x7f2

Bug#1072817: bookworm-pu: package openrc/0.45.2-2+deb12u1

2024-06-08 Thread Adam D. Barratt
Control: tags -1 + moreinfo

Hi,

On Sat, 2024-06-08 at 11:59 +0100, Mark Hindley wrote:

[...]
>   [x] attach debdiff against the package in stable

While you have attached a debdiff, it's of the binary packages. Please
provide a source debdiff, i.e. between the current and proposed DSCs.

Regards,

Adam



Re: How do I install a non-outdated D compiler on Linux? (not in userspace-container)

2024-06-08 Thread solidstate1991 via Digitalmars-d-learn

On Saturday, 8 June 2024 at 03:36:05 UTC, bachmeier wrote:
For Mint, I'd use the .deb and let it handle that stuff. For 
LDC, I have a bash alias for ldmd2 that points to the ldmd2 
binary. Of course there are multiple ways to handle this, but I 
don't understand the point of the install script, since it 
leaves you without a working installation.


Okay, does someone know how to set up the path for LDC on Linux, 
without the bash alias?


[Issue 24580] ImportC: Asm label after attributes results in syntax error

2024-06-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24580

Dlang Bot  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Dlang Bot  ---
dlang/dmd pull request #16569 "Fix bugzilla 24580 - ImportC: Asm label after
attributes results in s…" was merged into master:

- bad20d23438f9a0fa7456713cc9305d59a280286 by Tim Schendekehl:
  Fix bugzilla 24580 - ImportC: Asm label after attributes results in syntax
error

https://github.com/dlang/dmd/pull/16569

--


[Issue 2672] Delegate .funcptr returns wrong type.

2024-06-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2672

zopsi...@use.startmail.com changed:

   What|Removed |Added

 CC||zopsi...@use.startmail.com

--


[Issue 24580] ImportC: Asm label after attributes results in syntax error

2024-06-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24580

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #1 from Dlang Bot  ---
@tim-dlang created dlang/dmd pull request #16569 "Fix bugzilla 24580 - ImportC:
Asm label after attributes results in s…" fixing this issue:

- Fix bugzilla 24580 - ImportC: Asm label after attributes results in syntax
error

https://github.com/dlang/dmd/pull/16569

--


Re: Trying to call some C code using Extern(C) but got unexpected linker error

2024-06-08 Thread Basile B. via Digitalmars-d-learn

On Saturday, 8 June 2024 at 02:22:00 UTC, Xiaochao Yan wrote:
Hi, I am new to D and is experimenting with game development 
using D and C.


I had some problem when trying to recreate the
https://dlang.org/spec/importc.html

[...]

Thanks in advance!


on a recent compiler this should work:

```d
// .d file
import std.stdio;
import std.conv;
import test;

void main() {
writeln("Hello, World!");

pragma(mangle, "printMessage");
extern (C) void printMessage();

printMessage();
}
```

This was fixed by the dear GH Ghost in 
https://github.com/dlang/dmd/pull/15582.
A short technical explanation: mangling and call conventions are 
not 100% related.

You need to stuff the mangle for that to work.


Re: How do I install a non-outdated D compiler on Linux? (not in userspace-container)

2024-06-07 Thread bachmeier via Digitalmars-d-learn

On Saturday, 8 June 2024 at 00:21:59 UTC, solidstate1991 wrote:

On Friday, 7 June 2024 at 23:19:37 UTC, solidstate1991 wrote:
I **need** to link against various system libraries, and 
otherwise some tools won't be able to access the D compiler 
unless I start them from a command line after an 
initialization script.


I'm using Linux Mint, it's much more stable than Ubuntu (which 
started to completely collapse on me for just looking the 
wrong way at it), but unfortunately some packages are 
outdated, especially the D compilers.


Okay, I installed the "curl" versions, how do I edit the 
activating shell scripts of DMD and LDC that they'd work as if 
they were installed "normally"? I don't have the time, not the 
capacity to test my libraries with multiple different compiler 
versions, and document any oddities between them (and I almost 
never need it thanks to D).


For Mint, I'd use the .deb and let it handle that stuff. For LDC, 
I have a bash alias for ldmd2 that points to the ldmd2 binary. Of 
course there are multiple ways to handle this, but I don't 
understand the point of the install script, since it leaves you 
without a working installation.


  1   2   3   4   5   6   7   8   9   10   >