Re: Beta 2.079.0

2018-02-23 Thread zabruk70 via Digitalmars-d-announce
i don't understand whole theread. why all import must be written on one line? curent syntax very handy and readable.

Re: how to localize console and GUI apps in Windows

2017-12-29 Thread zabruk70 via Digitalmars-d-learn
On Friday, 29 December 2017 at 10:35:53 UTC, Andrei wrote: Though it is not suitable for GUI type of a Windows application. AFAIK, Windows GUI have no ANSI/OEM problem. You can use Unicode. For Windows ANSI/OEM problem you can use also https://dlang.org/phobos/std_windows_charset.html

Re: how to localize console and GUI apps in Windows

2017-12-28 Thread zabruk70 via Digitalmars-d-learn
you can just set console CP to UTF-8: https://github.com/CyberShadow/ae/blob/master/sys/console.d

Re: Release D v2.076.1

2017-10-09 Thread zabruk70 via Digitalmars-d-announce
On Monday, 9 October 2017 at 19:44:24 UTC, Martin Nowak wrote: Glad to announce D v2.076.1. http://dlang.org/download.html This point release fixes a few issues over v2.076.1, see the changelog for more details. http://dlang.org/changelog/v2.076.1.html - -Martin

Re: Building (and including libraries) without dub

2017-08-27 Thread zabruk70 via Digitalmars-d-learn
On Saturday, 26 August 2017 at 09:03:03 UTC, Hasen Judy wrote: What if I want to include a 3rd party library? Surely before dub existed, people were incorporating other libraries in their projects. sometimes pragma("lib", ...) very usefull (if i understand you correctly)

Re: Compile Imported Modules

2017-08-25 Thread zabruk70 via Digitalmars-d
On Thursday, 24 August 2017 at 15:56:32 UTC, H. S. Teoh wrote: Isn't this what rdmd already does? This is my favorite rdmd feature. But there is local import bug :( https://issues.dlang.org/show_bug.cgi?id=15533

Re: Long File path Exception:The system cannot find the path specified

2017-08-25 Thread zabruk70 via Digitalmars-d-learn
On Thursday, 24 August 2017 at 18:02:24 UTC, vino wrote: Thanks for your support, was able to resolve this issue. Hello. IMHO, it will be better, if you will share your solution for other peoples :)

Re: Cannot find std.datetime when linking after upgrade to 2.075.0

2017-07-21 Thread zabruk70 via Digitalmars-d-learn
https://dlang.org/changelog/2.075.0.html#split-std-datetime

Re: What is Base64 part in Base64.encode

2017-05-14 Thread zabruk70 via Digitalmars-d-learn
On Sunday, 14 May 2017 at 21:22:20 UTC, Moritz Maxeiner wrote: The full line is `alias Base64 = Base64Impl!('+', '/');` Yes. When we use it like this: const(char)[] encoded = Base64.encode(data); then template instantiated and produce ... what? I don't understand what you're trying to

What is Base64 part in Base64.encode

2017-05-14 Thread zabruk70 via Digitalmars-d-learn
I look to std.base64 module source. And dont unerstand what is the "Base64" part in "Base64.encode(data)" example. I see std.base64 module use template Base64Impl. I see alias Base64 = Base64Impl!... But down understand. Base64 not module, not structure, not class? Template Base64Impl shoud

Re: union.sizeof

2017-03-26 Thread zabruk70 via Digitalmars-d-learn
On Sunday, 26 March 2017 at 07:18:14 UTC, ketmar wrote: i.e. what compiler does (roughly) is inserting anonymous fields of the appropriate size *into* the container. for "inner" aligning compiler inserts anonymous fields *between* other fields. for "outer" aligning compiler just appends

Re: union.sizeof

2017-03-26 Thread zabruk70 via Digitalmars-d-learn
On Sunday, 26 March 2017 at 06:45:13 UTC, ketmar wrote: yes. you have a typo in second `writefln`: S1 instead of S2. ;-) thank you. another question, related to my first post: why size of S2.b1 and S2.b2 still 3, not 4? am i right: then align applied to members, compiler not change size of

Re: union.sizeof

2017-03-26 Thread zabruk70 via Digitalmars-d-learn
On Sunday, 26 March 2017 at 06:38:59 UTC, zabruk70 wrote: oh sorry sorry - mistyping ok. DMD use padding, so for real container.sizeof i should use lastMemeber.offsetof+lastMemeber.sizeof

Re: union.sizeof

2017-03-26 Thread zabruk70 via Digitalmars-d-learn
On Sunday, 26 March 2017 at 05:09:15 UTC, ketmar wrote: most of the time either location or padding will work the same. hmm.. you ruined my expirence.. i made another experiment. whould you please explain me S2 size 6? thank you for you time. https://dpaste.dzfl.pl/9a31b6e370a0 struct S1

Re: union.sizeof

2017-03-25 Thread zabruk70 via Digitalmars-d-learn
Thank you ag0aep6g and ketmar!! I will use additional outside align. I want packing inside, you are right. But i check result size with assert() and failed. But for clearness... I was thinked, that align not changes SIZE, but changes LOCATION. I was thinked, that "align(X) union Union1" just

union.sizeof

2017-03-25 Thread zabruk70 via Digitalmars-d-learn
//DMD 2.073.1 and latest 2.075.0-master-972eaed //Windows 7 32-bit union Union1 { align(1): byte[5] bytes5; struct { align(1): char char1; uint int1; } } void main () { import std.stdio: writefln; writefln("Union1.sizeof=%d", Union1.sizeof); //prints 8, not 5 } I

Re: Newbie: can't manage some types...

2016-10-31 Thread zabruk70 via Digitalmars-d-learn
On Monday, 31 October 2016 at 16:06:48 UTC, Adam D. Ruppe wrote: dmd yourfile.d winmm.lib i personally like https://dlang.org/spec/pragma.html#lib pragma(lib, "winmm.lib");

Re: full path to source file __FILE__

2016-07-21 Thread zabruk70 via Digitalmars-d-learn
On Thursday, 21 July 2016 at 19:54:34 UTC, Jonathan Marler wrote: thisExePath won't work. won't? what this means? this work on my windows import std.file: thisExePath; import std.stdio: writeln; void main() { writeln(thisExePath()); }

Re: Is there a way to "see" source code generated by templates after a compile?

2016-07-17 Thread zabruk70 via Digitalmars-d-learn
On Sunday, 17 July 2016 at 11:14:39 UTC, Stefan Koch wrote: If you want to see template expansions you have to wait a little longer. Wow! Is this really possible?! So long time several peoples asked this...

Re: Properties don't work as expected

2016-07-05 Thread zabruk70 via Digitalmars-d-learn
On Tuesday, 5 July 2016 at 10:52:10 UTC, zodd wrote: Property functions are used wrong by a compiler when it needs i am sorry for my dumbness, what wrong with this code? import std.stdio; struct A { @property ref int value() { return value_; } @property void value(int v)

Re: Anybody still using the chm docs

2016-06-15 Thread zabruk70 via Digitalmars-d
On Wednesday, 15 June 2016 at 10:58:04 UTC, Martin Nowak wrote: So I'm wondering if in 2016 someone really needs an offline copy of a website shipped with a binary release? i use chm doc - it easy integrates with ide

Re: Command line parsing

2016-05-16 Thread zabruk70 via Digitalmars-d
On Sunday, 15 May 2016 at 18:20:54 UTC, Andrei Alexandrescu wrote: please take a look can't get usage text when it very needed https://issues.dlang.org/show_bug.cgi?id=14525

Re: imports && -run [Bug?]

2016-05-13 Thread zabruk70 via Digitalmars-d-learn
On Friday, 13 May 2016 at 06:33:40 UTC, Jacob Carlborg wrote: Even better is to use "rdmd" which will automatically track and compile dependencies. but i should warn about annoing bug with local import http://forum.dlang.org/post/mailman.1984.1373610213.13711.digitalmar...@puremagic.com

Re: Is it legal to use std.windows modules?

2016-04-09 Thread zabruk70 via Digitalmars-d-learn
On Saturday, 9 April 2016 at 02:14:48 UTC, Jonathan M Davis wrote: So, if anything, I'd open a bug report about how std.windows is old bug https://issues.dlang.org/show_bug.cgi?id=13516

Re: calculating CRC32

2016-04-08 Thread zabruk70 via Digitalmars-d-learn
print result as hex try to xor result with 0x

Re: fix for enumerating local import dependencies, resolving all rdmd link errors

2016-01-17 Thread zabruk70 via Digitalmars-d
On Friday, 12 July 2013 at 06:23:33 UTC, Timothee Cour wrote: I wrote a recursive dependency analyzer and plugged it in a modified rdmd, and it does indeed work in all cases I tried Timothee, can you share your RDMD changes? This is annoing bug still here. Thank you.

Re: Is this rdmd bug or my fault ?

2016-01-16 Thread zabruk70 via Digitalmars-d-learn
Can anybody explain: Is dependencies file produced from command: dmd -deps=moduleA.deps moduleA.d must contains mention of moduleC? Is dependencies file produced reccursively? Thanks.

Function accepts const ubyte[], const char[], immutable ubyte[], immutable char[]

2016-01-10 Thread zabruk70 via Digitalmars-d-learn
Hello. 1st Novice question: i want function, operates sometimes with char[], sometimes with ubyte[]. internally it works with ubyte. i can use overloading: void myFunc(ubyte[] arg) {...}; void myFunc(char[] arg) { ubyte[] arg2 = cast(ubyte[]) arg; ...} It is OK. But i want 2 params (arg1,

Re: Function accepts const ubyte[], const char[], immutable ubyte[], immutable char[]

2016-01-10 Thread zabruk70 via Digitalmars-d-learn
On Sunday, 10 January 2016 at 11:13:00 UTC, Tobi G. wrote: ubyte[] myFunc(T1,T2)(T1[] a, T2[] b) Tobi, big thanks!!! I should learn templates...

Re: Function accepts const ubyte[], const char[], immutable ubyte[], immutable char[]

2016-01-10 Thread zabruk70 via Digitalmars-d-learn
On Sunday, 10 January 2016 at 14:17:28 UTC, Adam D. Ruppe wrote: A `const(void)[]` type can accept any array as input. void[] is Ah, how i can forget about void[] ! Thanks Adam!

Re: Is this rdmd bug or my fault ?

2016-01-09 Thread zabruk70 via Digitalmars-d-learn
On Friday, 8 January 2016 at 22:36:49 UTC, Tobi G. wrote: On Saturday, 9 January 2016 at 01:43:57 UTC, Ivan Kazmenko wrote: I get also a compilation error (with rdmd and -g). Thanks Tobi and Ivan. https://issues.dlang.org/show_bug.cgi?id=15533

Re: Convert a hex string into a ubyte[] or OutBuffer

2016-01-08 Thread zabruk70 via Digitalmars-d-learn
On Thursday, 7 January 2016 at 23:15:41 UTC, Basile B. wrote: Damn, I've been trapped, thread exhumated from 2014 ... Yes, but my post was made yesterday. I don't want create new post and found this. Thank you for your time.

Is this rdmd bug or my fault ?

2016-01-08 Thread zabruk70 via Digitalmars-d-learn
OS: Windows 7 (32 bit) dmd: 2.069.2 and 2.070.0-b1 Then i used "-g" switch with RDMD, then i have OPTLINK error. Reduced code, 3 modules, 2 of them in subdir: moduleA.d test\moduleB.d test\moduleC.d / module moduleA; public void funcA () { import test.moduleB: funcB; return; }

Re: Convert a hex string into a ubyte[] or OutBuffer

2016-01-07 Thread zabruk70 via Digitalmars-d-learn
Hello. In modern phobos ver 2.069.1 exists template hexString https://dlang.org/phobos/std_conv.html#.hexString to convert hex string to bytes. It works in compile time only. But what if i need it in run time? Is the answer in this topic still best way? Or now we have some function/template in