On 02.01.18 14:51, Adam D. Ruppe wrote:
> On Tuesday, 2 January 2018 at 10:27:11 UTC, Christian Köstlin wrote:
>> After this I analyzed the first step of the process (gunzipping the
>> data from a file to memory), and found out, that dlangs UnCompress is
>> much slower than java, and ruby and plain
On Wednesday, 3 January 2018 at 07:43:52 UTC, Jonathan M Davis
wrote:
On Wednesday, January 03, 2018 06:10:10 Soulsbane via
Digitalmars-d-learn wrote:
[...]
The entire reason that the package.d feature was added was so
that it would be possible to split a module into a package
without breaki
On Saturday, 30 December 2017 at 03:49:37 UTC, ChangLong wrote:
What I am try to do is implement a unique data type. (the
ownership auto moved into new handle)
Have you considered std.typecons.Unique[0]? If yes, in what ways
does it not cover your needs?
Your example code written with Unique
On Wednesday, 3 January 2018 at 06:42:42 UTC, Andrei wrote:
AFAIK, Windows GUI have no ANSI/OEM problem.
You can use Unicode.
Partly, yes. Just for a test I tried to "russify" the example
Windows GUI program that comes with D installation pack
(samples\d\winsamp.d). Window captions, button ca
Get Registered IELTS certificates without attending the Exam (
http://buyrealfakedocument.com )
We are a unique manufacturer of high-quality registered
citizenship documents with the best machines and holograms that
duplicate as database database driver's license, passports,
biometric pas
On Wednesday, 3 January 2018 at 09:11:32 UTC, thedeemon wrote:
you need to use TextOutW that accepts 16-bit Unicode, so just
convert your UTF-8 D strings to 16-bit Unicode wstrings, there
are appropriate conversion functions in Phobos.
Some details:
import std.utf : toUTF16z;
...
string s = "п
On Friday, 29 December 2017 at 11:14:39 UTC, zabruk70 wrote:
AFAIK, Windows GUI have no ANSI/OEM problem.
You can use Unicode.
Be advised there are some problems with console UTF-8
input/output in Windows. The most usable is Win10 new console
window but I recommend to use Windows API (WriteC
// C:\libs\my_module.d
module my_module;
void foo() {}
// main.d
module main;
import my_module;
void main() {
foo();
}
Running dmd with:
dmd -IC:\libs main.d my_module.d
I get:
Error: module my_module is in file 'my_module.d' which cannot
be read
import path[0] = C:\libs
On 1/3/18 2:47 AM, Christian Köstlin wrote:
On 02.01.18 21:13, Steven Schveighoffer wrote:
Well, you don't need to use appender for that (and doing so is copying a
lot of the data an extra time). All you need is to extend the pipe until
there isn't any more new data, and it will all be in the bu
Hi,
I have a very large gziped text file (all ASCII characters and
~500GB) that I want to stream and process line-by-line, and I
thought the iopipe library would be perfect for this, but I can't
seem to get it to work. So far, this is the closest I have to
getting it to work:
import iopipe.
On Wednesday, 3 January 2018 at 12:21:28 UTC, tipdbmp wrote:
// C:\libs\my_module.d
module my_module;
void foo() {}
// main.d
module main;
import my_module;
void main() {
foo();
}
Running dmd with:
dmd -IC:\libs main.d my_module.d
I get:
Error: module my_module is in file 'my_modu
Long time ago, IIRC, I read somewhere there was a ncurses for D
but now I can't find it are there any wrapper or am I mistaken?
anyway, I'm doing it from scratch and not porting anything so
even a library with same functionality as ncurses for D is
welcome.
On Wednesday, 3 January 2018 at 09:11:32 UTC, thedeemon wrote:
Windows API contains two sets of functions: those whose names
end with A (meaning ANSI), the other where names end with W
(wide characters, meaning Unicode). The sample uses TextOutA,
this function that expects 8-bit encoding.
Gos
On 1/3/18 9:45 AM, Andrew wrote:
Hi,
I have a very large gziped text file (all ASCII characters and ~500GB)
that I want to stream and process line-by-line, and I thought the iopipe
library would be perfect for this, but I can't seem to get it to work.
So far, this is the closest I have to get
On Wed, Jan 03, 2018 at 07:02:28AM +, Tim Hsu via Digitalmars-d-learn wrote:
> On Tuesday, 2 January 2018 at 22:49:20 UTC, Adam D. Ruppe wrote:
> > On Tuesday, 2 January 2018 at 22:17:14 UTC, Johan Engelen wrote:
> > > Pass the Vector3f by value.
> >
> > This is very frequently the correct ans
On Wednesday, January 03, 2018 15:47:58 Marc via Digitalmars-d-learn wrote:
> Long time ago, IIRC, I read somewhere there was a ncurses for D
> but now I can't find it are there any wrapper or am I mistaken?
> anyway, I'm doing it from scratch and not porting anything so
> even a library with same
On Wednesday, 3 January 2018 at 16:09:19 UTC, Steven
Schveighoffer wrote:
On 1/3/18 9:45 AM, Andrew wrote:
Hi,
I have a very large gziped text file (all ASCII characters and
~500GB) that I want to stream and process line-by-line, and I
thought the iopipe library would be perfect for this, but
dmd main.d C:\libs\my_module.d
That does not use the -I switch.
It compiles if I specify the full path to my_module.d:
dmd -IC:\libs main.d C:\libs\my_module.d
I don't understand the error message though.
for a safe programming, since C/C++ times I try to make thing
const as possible. locals, parameters etc anything which isn't
going to change.
How do you do that in D? immutable everywhere?
for example:
foreach(Field field; fields) {
immutable string htmlOutputfile = ge
On Wednesday, January 03, 2018 17:27:38 Marc via Digitalmars-d-learn wrote:
> for a safe programming, since C/C++ times I try to make thing
> const as possible. locals, parameters etc anything which isn't
> going to change.
> How do you do that in D? immutable everywhere?
>
> for example:
> > forea
On Wed, Jan 03, 2018 at 12:43:52AM -0700, Jonathan M Davis via
Digitalmars-d-learn wrote:
> On Wednesday, January 03, 2018 06:10:10 Soulsbane via Digitalmars-d-learn
> wrote:
> > I've only understood that imports should go in package.d. I'm seeing
> > more and more packages on code.dlang.org usin
On Wednesday, 3 January 2018 at 17:10:22 UTC, tipdbmp wrote:
dmd main.d C:\libs\my_module.d
That does not use the -I switch.
It compiles if I specify the full path to my_module.d:
dmd -IC:\libs main.d C:\libs\my_module.d
I don't understand the error message though.
I tried a few other op
Hi
Are there any use cases or libraries for using D in Microsoft's
universal windows platform environment? It would be nice to have
XBOX Apps build on D ;-)
Regards Ozan
On 01/03/2018 09:10 AM, tipdbmp wrote:
dmd main.d C:\libs\my_module.d
That does not use the -I switch.
It compiles if I specify the full path to my_module.d:
dmd -IC:\libs main.d C:\libs\my_module.d
I don't understand the error message though.
-I is for import directives only. imports
On Tuesday, 2 January 2018 at 23:27:22 UTC, H. S. Teoh wrote:
When it comes to optimization, there are 3 rules: profile,
profile, profile. I used to heavily hand-"optimize" my code a
lot (I come from a strong C/C++ background -- premature
optimization seems to be a common malady among us in
when calling winapi functions, usually you to deal with the
result in wchar[]. How do I convert it to string in D to be
usable by the application? does D have a native for this?
On 01/03/2018 10:50 AM, Marc wrote:
when calling winapi functions, usually you to deal with the result in
wchar[]. How do I convert it to string in D to be usable by the
application? does D have a native for this?
std.conv has to and text:
auto s0 = w.text;
auto s1 = w.to!string;
Ali
On 01/03/2018 10:40 AM, Patrick Schluter wrote:
> On Tuesday, 2 January 2018 at 23:27:22 UTC, H. S. Teoh wrote:
>>
>> When it comes to optimization, there are 3 rules: profile, profile,
>> profile. I used to heavily hand-"optimize" my code a lot (I come from
>> a strong C/C++ background -- premat
On Wednesday, 3 January 2018 at 18:59:39 UTC, Ali Çehreli wrote:
On 01/03/2018 10:50 AM, Marc wrote:
when calling winapi functions, usually you to deal with the
result in wchar[]. How do I convert it to string in D to be
usable by the application? does D have a native for this?
std.conv has t
On Wed, Jan 03, 2018 at 03:47:58PM +, Marc via Digitalmars-d-learn wrote:
> Long time ago, IIRC, I read somewhere there was a ncurses for D but
> now I can't find it are there any wrapper or am I mistaken? anyway,
> I'm doing it from scratch and not porting anything so even a library
> with sam
On 1/3/18 9:42 AM, Steven Schveighoffer wrote:
On 1/3/18 2:47 AM, Christian Köstlin wrote:
On 02.01.18 21:13, Steven Schveighoffer wrote:
Well, you don't need to use appender for that (and doing so is copying a
lot of the data an extra time). All you need is to extend the pipe until
there isn't
On Wednesday, 3 January 2018 at 18:33:27 UTC, Ozan wrote:
Hi
Are there any use cases or libraries for using D in Microsoft's
universal windows platform environment? It would be nice to
have XBOX Apps build on D ;-)
Regards Ozan
Ethan Watson gave a talk about D and they launched their game o
On 2018-01-03 08:02, Tim Hsu wrote:
It needs some experiment.
This is the correct answer. Never assume anything about performance
before having tested it.
--
/Jacob Carlborg
On Wednesday, 3 January 2018 at 19:15:18 UTC, H. S. Teoh wrote:
https://github.com/adamdruppe/arsd/blob/master/terminal.d
indeed. some dox here http://dpldocs.info/arsd.terminal
Best of all: zero dependencies, just copy terminal.d into a
subdirectory called arsd, and `import arsd.term
On 1/3/18 3:28 PM, Steven Schveighoffer wrote:
1. The major differentiator between the C and D algorithms is the use of
C realloc. This one thing saves the most time. I'm going to update
iopipe so you can use it (stand by). I will also be examining how to
simulate using realloc when not using C
On Wednesday, 3 January 2018 at 18:35:21 UTC, Ali Çehreli wrote:
On 01/03/2018 09:10 AM, tipdbmp wrote:
dmd main.d C:\libs\my_module.d
That does not use the -I switch.
It compiles if I specify the full path to my_module.d:
dmd -IC:\libs main.d C:\libs\my_module.d
I don't understand the e
On Wednesday, 3 January 2018 at 18:35:21 UTC, Ali Çehreli wrote:
-I is for import directives only. imports are needed to compile
the importing module. All other modules still need to be
compiled themselves and added to the program either as
individual .o files or as libraries (e.g. .a, .lib,
On 01/03/2018 01:42 PM, Tony wrote:
> On Wednesday, 3 January 2018 at 18:35:21 UTC, Ali Çehreli wrote:
>> Working as expected... :)
>>
> What about the error message? If -I is only for DMD finding "import ..."
> files, and not files on the command line, why does DMD list what was in
> the -I "w
On Wed, Jan 03, 2018 at 09:04:00PM +, Adam D. Ruppe via Digitalmars-d-learn
wrote:
> On Wednesday, 3 January 2018 at 19:15:18 UTC, H. S. Teoh wrote:
> > https://github.com/adamdruppe/arsd/blob/master/terminal.d
[...]
> > Depending on what you want, you could also tack on eventloop.d from
>
The documentation says the modification of pointer values is not
allowed in safe functions. Yet the following compiles fine on dmd:
void main() @safe
{
int* x = new int;
int* y = new int;
y=x;
}
Is this simply a compiler bug?
On Wednesday, 3 January 2018 at 22:02:22 UTC, Mark wrote:
The documentation says the modification of pointer values is
not allowed in safe functions.
I think that refers to like x++ rather than x=y.
On Wednesday, January 03, 2018 22:02:22 Mark via Digitalmars-d-learn wrote:
> The documentation says the modification of pointer values is not
> allowed in safe functions. Yet the following compiles fine on dmd:
>
> void main() @safe
> {
> int* x = new int;
> int* y = new int;
> y=x;
> }
>
>
char * get_dangling_ptr() {
char[] a;
a.reserve(15);
a ~= 'x';
char *x = &a[0];
auto a_initial_ptr = a.ptr;
foreach (_; 0 .. 30) {
a ~= 'y';
//a.assumeSafeAppend() ~= 'y';
}
assert(a.ptr != a_initial_ptr, "a should've reallocated");
// trying
On Wed, Jan 03, 2018 at 10:02:22PM +, Mark via Digitalmars-d-learn wrote:
> The documentation says the modification of pointer values is not
> allowed in safe functions. Yet the following compiles fine on dmd:
>
> void main() @safe
> {
> int* x = new int;
> int* y = new int;
>
On Wednesday, 3 January 2018 at 12:21:28 UTC, tipdbmp wrote:
// C:\libs\my_module.d
module my_module;
void foo() {}
// main.d
module main;
import my_module;
void main() {
foo();
}
Running dmd with:
dmd -IC:\libs main.d my_module.d
I get:
Error: module my_module is in file 'my_modu
On Wednesday, 3 January 2018 at 22:12:01 UTC, Jonathan M Davis
wrote:
On Wednesday, January 03, 2018 22:02:22 Mark via
Digitalmars-d-learn wrote:
The documentation says the modification of pointer values is
not allowed in safe functions. Yet the following compiles fine
on dmd:
void main() @sa
On Wednesday, January 03, 2018 22:25:16 Mark via Digitalmars-d-learn wrote:
> On Wednesday, 3 January 2018 at 22:12:01 UTC, Jonathan M Davis
>
> wrote:
> > On Wednesday, January 03, 2018 22:02:22 Mark via
> >
> > Digitalmars-d-learn wrote:
> >> The documentation says the modification of pointer val
On Wednesday, 3 January 2018 at 21:51:07 UTC, jmh530 wrote:
On Wednesday, 3 January 2018 at 18:35:21 UTC, Ali Çehreli wrote:
-I is for import directives only. imports are needed to
compile the importing module. All other modules still need to
be compiled themselves and added to the program ei
I found no way with __traits() on std.traits. I found
isStaticFunction and isStaticArray but nothing about a member. Is
this by desgin?
Give a class like:
class C { static int a, b, c; int d; }
I'd like to get a, b and c.
I'm using this:
__traits(allMembers, C)
On Wed, Jan 03, 2018 at 03:42:07PM -0700, Jonathan M Davis via
Digitalmars-d-learn wrote:
> On Wednesday, January 03, 2018 22:25:16 Mark via Digitalmars-d-learn wrote:
[...]
> > https://dlang.org/spec/function.html#safe-functions
> >
> > "The following operations are not allowed in safe functions:
On 01/03/2018 03:48 PM, Marc wrote:
I found no way with __traits() on std.traits. I found isStaticFunction
and isStaticArray but nothing about a member. Is this by desgin?
Give a class like:
class C { static int a, b, c; int d; }
I'd like to get a, b and c.
I'm using this:
__traits(allMem
On Wednesday, 3 January 2018 at 22:52:10 UTC, Seb wrote:
Which documentation are you referring to? If it's the
specification, just click "edit".
I know how to edit it. I just don't know how to word it so that
it isn't so confusing.
What I'm trying to do here is to be able to call a function based
off of a key.
I'm not sure how to do this, I've been messing around a bit, but
the compiler doesn't like what I'm doing.
Im getting:
test.d(20): Error: cannot implicitly convert expression &this.A
of type void delegate() to vo
Following the instructions here on Ubuntu 16.04:
https://github.com/dlang/dlang.org/blob/master/CONTRIBUTING.md
I did the command
make -f posix.mak html
but it failed to successfully complete:
---
make[1]: Leaving directory '/home/user/dlang/dmd/src'
On Thursday, 4 January 2018 at 01:50:47 UTC, Tony wrote:
Following the instructions here on Ubuntu 16.04:
https://github.com/dlang/dlang.org/blob/master/CONTRIBUTING.md
I did the command
make -f posix.mak html
but it failed to successfully complete:
---
On Thursday, 4 January 2018 at 01:40:21 UTC, Mark wrote:
What I'm trying to do here is to be able to call a function
based off of a key.
class tester {
private void delegate() [char] funcs;
this() {
funcs = ['a': &A, 'b': &B];
}
public void
On 1/3/18 12:03 PM, Andrew wrote:
Thanks for looking into this.
So it looks like the file you have is a concatenated gzip file. If I
gunzip the file and recompress it, it works properly.
Looking at the docs of zlib inflate [1]:
" Unlike the gunzip utility and gzread() ..., inflate() will
On Wednesday, 3 January 2018 at 08:51:55 UTC, Simen Kjærås wrote:
On Saturday, 30 December 2017 at 03:49:37 UTC, ChangLong wrote:
What I am try to do is implement a unique data type. (the
ownership auto moved into new handle)
Have you considered std.typecons.Unique[0]? If yes, in what
ways do
On Thursday, 4 January 2018 at 02:20:32 UTC, Seb wrote:
On Thursday, 4 January 2018 at 01:50:47 UTC, Tony wrote:
Following the instructions here on Ubuntu 16.04:
https://github.com/dlang/dlang.org/blob/master/CONTRIBUTING.md
I did the command
make -f posix.mak html
but it failed to successfu
On Wednesday, 3 January 2018 at 22:22:06 UTC, tipdbmp wrote:
x doesn't seem to be a dangling pointer, how come?
What is your definition of a dangling pointer?
In the shown example we have a reference to a piece of memory
containing 'x', so this memory is not freed, it's used by the
program.
On 03.01.18 22:33, Steven Schveighoffer wrote:
> On 1/3/18 3:28 PM, Steven Schveighoffer wrote:
>> 1. The major differentiator between the C and D algorithms is the use
>> of C realloc. This one thing saves the most time. I'm going to update
>> iopipe so you can use it (stand by). I will also be ex
61 matches
Mail list logo