Re: Namespaces like C++

2017-01-16 Thread rjframe via Digitalmars-d-learn
On Mon, 16 Jan 2017 18:02:09 +, Andrey wrote: > Hello, can I using namespaces like in C++, for example: ui::Widget or > ui::Manager? I created ui/widget.d and ui/manager.d for implementation > classes Widget and Manager, bun I can't import their correctly for using > ui.Manager uiManager; >

Re: DMD specify VS version in sc.ini

2016-12-27 Thread rjframe via Digitalmars-d-learn
On Tue, 27 Dec 2016 22:09:49 +, Ryan wrote: > I have a C library I want to link against that was compiled with VS > 2013. I have VS2013 and VS2015 installed. I want DMD to use the 2013 > version, since the C-runtime in 2015 is not backwards compatible. > > Looking at sc.ini I see several

Re: It makes me sick!

2017-07-28 Thread rjframe via Digitalmars-d-learn
On Fri, 28 Jul 2017 05:14:16 +, FoxyBrown wrote: > > You can make any claim you want like: "The end user should install in to > a clean dir so that DMD doesn't get confused and load a module that > doesn't actually have any implementation" but that's just your opinion. I have never seen

Re: GDC generate wrong .exe ("not a valid win32 application")

2017-06-19 Thread rjframe via Digitalmars-d-learn
On Mon, 19 Jun 2017 14:08:56 +, Patric Dexheimer wrote: > Fresh install of GDC. (tried with 32x ad 32_64x) > > GDC: 6.3.0 DUB: 1.3.0 > > dub run --build=release --arch=x86 --compiler=gdc > > (...) > Running .\main Failed to spawn new process (%1 is not a valid win32 > application) If you

Re: Why do I have to cast arguments from int to byte?

2017-10-10 Thread rjframe via Digitalmars-d-learn
On Tue, 10 Oct 2017 19:55:36 +, Chirs Forest wrote: > It wouldn't be so bad if I didn't have to use the word cast before each > cast, bust since I have to specify both the word cast and the cast type > and then wrap both the cast type and the value in brackets... it just > explodes my code

Re: D program in Windows Task Scheduler.

2017-11-28 Thread rjframe via Digitalmars-d-learn
On Tue, 28 Nov 2017 09:44:39 +, Vino wrote: > Hi All, > > I have small D program which run's perfectly when i run it > manually, but when I schedule the same via windows task scheduler and > choose the option "Run whether user is logged on or not" the program > does not execute, the task

Re: dirEntries() and exceptions

2017-11-24 Thread rjframe via Digitalmars-d-learn
On Fri, 24 Nov 2017 12:02:47 +, doc wrote: > I'm trying recursively find files, and have some trouble to catch > exceptions if have no permission to read directory. > ... > > std.file.FileException@std/file.d(3798): > /tmp/systemd-private-8338348a306b4d589e3f6ba2bfd0c8fe-systemd-

Re: Windows Share Path

2017-12-03 Thread rjframe via Digitalmars-d-learn
On Sun, 03 Dec 2017 16:42:46 +, vino wrote: > Question: > Is there a way to map network drive in windows using D code, similar to > the windows command such as "net use" or "pushd" or powershell command > New-PSDrive.? > > From, > Vino.B There's WNetAddConnection2[1] and

Re: Windows Share Path

2017-12-02 Thread rjframe via Digitalmars-d-learn
On Sat, 02 Dec 2017 14:16:17 +, Vino wrote: > Hi, > >The script is schedule using a domain user id(domain\user id), > and the windows share are mapped using the same user id /password and > ran the scheduled task by login with the same domain user(Not > Administrator) , the script

Re: Windows Share Path

2017-12-02 Thread rjframe via Digitalmars-d-learn
On Sat, 02 Dec 2017 07:48:14 +, Vino wrote: > On Saturday, 2 December 2017 at 05:08:27 UTC, Vino wrote: >> Hi All, >> >> Request your help, I have samll program which validates the >> file path, the script run perfectly when i run it manually, but if i >> run it via windows task scheduler i

Re: Sort in return statement

2017-12-08 Thread rjframe via Digitalmars-d-learn
On Sat, 09 Dec 2017 02:34:29 +, codephantom wrote: > Anyone got ideas on how to get sort() working in the *return* > statement? > > // > > ushort[] draw8Numbers() > { > import std.meta : aliasSeqOf; > import std.range : iota; > ushort[] numbers = [

Re: Sort in return statement

2017-12-09 Thread rjframe via Digitalmars-d-learn
On Sat, 09 Dec 2017 07:32:42 +, Seb wrote: > > Use .release to obtain the underlying array. No need to do another > allocation! > > ``` > numbers.take(8).sort.release; > ``` I did not realize that was there; thanks.

Re: "Start a Minimal web server" example do not work.

2018-05-08 Thread rjframe via Digitalmars-d-learn
On Tue, 08 May 2018 13:23:07 +, BoQsc wrote: > On Tuesday, 8 May 2018 at 13:04:12 UTC, Seb wrote: >> >> Did you try the newer MSCOFF format >> >> dub --arch=x86_mscoff start_minimum_server.d >> >> or >> >> dub --arch=x64 start_minimum_server.d > > C:\Users\Vaidas\Desktop>dub

Generate documentation for mixin'd function?

2018-06-01 Thread rjframe via Digitalmars-d-learn
Hi I'm making an API for a web service, and have a small collection of endpoints where I'd basically be creating copy+paste functions (a small enough number that this isn't really that important for this project). I thought I'd generate them via a mixin, but haven't seen that I can generate

Re: GDC on Travis-CI

2018-06-02 Thread rjframe via Digitalmars-d-learn
On Sat, 02 Jun 2018 03:15:56 +, crimaniak wrote: > I started to work with Travis-CI, building packages using all three main > compilers, and noticed that I have problems with gdc every time and need > to tweak code because of many things missing. > For example:

Re: Generate documentation for mixin'd function?

2018-06-02 Thread rjframe via Digitalmars-d-learn
On Fri, 01 Jun 2018 22:48:41 -0600, Jonathan M Davis wrote: > > It's currently possible to put ddoc on template mixins but not string > mixins: > > https://issues.dlang.org/show_bug.cgi?id=2420 > > It was fix for template mixins with > > https://issues.dlang.org/show_bug.cgi?id=648 > > but

Re: Determine if CTFE or RT

2018-06-24 Thread rjframe via Digitalmars-d-learn
On Sun, 24 Jun 2018 14:43:09 +, Mr.Bingo wrote: > let is(CTFE == x) mean that x is a compile time constant. CTFE(x) > converts a x to this compile time constant. Passing any compile time > constant essentially turns the variable in to a compile time > constant(effectively turns it in to a

Re: take symbol as parameter

2017-12-30 Thread rjframe via Digitalmars-d-learn
On Sat, 30 Dec 2017 13:07:49 +, Marc wrote: > how do I take a symbol as parameter? > > for example: > >> template nameof(alias S) { >> import std.array : split; >> enum nameof = S.stringof.split(".")[$-1]; >>} > > Works fine for say a enum member such nameof!(myEnum.X) but this:

Re: structs inheriting from and implementing interfaces

2017-12-29 Thread rjframe via Digitalmars-d-learn
On Fri, 29 Dec 2017 12:39:25 +, Nicholas Wilson wrote: > On Friday, 29 December 2017 at 12:03:59 UTC, Mike Franklin wrote: > > The problem is that interfaces are a runtime thing (e.g. you can cast a > class to an interface) > structs implement compile time interfaces via template duck typing

Re: dmd error - unrecognized file extension

2018-01-29 Thread rjframe via Digitalmars-d-learn
On Mon, 29 Jan 2018 17:25:34 +, Evan Burkey wrote: > Hi there, I have a problem that is eluding me, hoping someone can help > me see the light. I'm on Windows 10 using the latest version of dmd. I > have a directory with 2 files: "version.txt" and "versioncheck.d". > version.txt contains a

Re: How to proceed with learning to code Windows desktop applications?

2018-01-30 Thread rjframe via Digitalmars-d-learn
On Tue, 30 Jan 2018 05:56:51 +, DanielG wrote: > Then there's all the modern Microsoft stuff (WPF/XAML/WinRT/etc), > but you pretty much have to use either .NET or C++ for that. VS release builds compile to native now by default; for easy Windows programming, you really can't beat C# and

Re: assert and enforce both compiled out with -release

2018-01-27 Thread rjframe via Digitalmars-d-learn
On Sat, 27 Jan 2018 13:52:47 +, kdevel wrote: > https://dlang.org/phobos/std_exception.html#enforce states: > > | Also, do not use enforce inside of contracts (i.e. inside of in and > out blocks | and invariants), because they will be compiled out when > compiling with -release. > | Use

Re: assert and enforce both compiled out with -release

2018-01-27 Thread rjframe via Digitalmars-d-learn
On Sat, 27 Jan 2018 17:12:25 +, kdevel wrote: > This is not a problem, because this is perfectly legal. The problem is > the wording of this phrase on the docs: > > | Also, do not use enforce inside of contracts (i.e. inside of in and > out blocks | and invariants), because they will be

Re: assert and enforce both compiled out with -release

2018-01-28 Thread rjframe via Digitalmars-d-learn
On Sun, 28 Jan 2018 00:59:12 +, lobo wrote: > On Saturday, 27 January 2018 at 22:53:37 UTC, Ali Çehreli wrote: >> On 01/27/2018 10:33 AM, kdevel wrote: >> >>> I suggest the deletion of the sentence "Use assert in contracts." >> >> Done. >> >> Ali > > Wait, no this isn't right, is it? Enforce

Re: Interfacing with C++

2018-02-04 Thread rjframe via Digitalmars-d-learn
On Sun, 04 Feb 2018 08:33:20 +, Mike Parker wrote: > Though, I'm curious why anyone would want to declare a callback in a C++ > program as cdecl only on Windows and use the default C++ > convention everywhere else. I suggest you dig into it and make sure > that's what's intended. And good

Re: Debugging bad requests with vibe

2018-02-09 Thread rjframe via Digitalmars-d-learn
On Fri, 09 Feb 2018 15:48:54 +, Nicholas Wilson wrote: > On Friday, 9 February 2018 at 08:06:53 UTC, Seb wrote: >> On Thursday, 8 February 2018 at 17:09:44 UTC, Nicholas Wilson wrote: >>> Is there a way I can see/log what requests are being made? I can >>> change both the client and server.

Re: Fixed size array initialization

2018-02-11 Thread rjframe via Digitalmars-d-learn
On Sat, 10 Feb 2018 10:55:30 +, rumbu wrote: > I know that according to language spec > (https://dlang.org/spec/arrays.html#static-init-static) you can skip > declaring all your elements in a fixed size array. > > I'm just recovering from a bug which took me one day to discover because > of

Re: structs inheriting from and implementing interfaces

2018-01-01 Thread rjframe via Digitalmars-d-learn
On Tue, 02 Jan 2018 00:54:13 +, Laeeth Isharc wrote: > On Friday, 29 December 2017 at 12:59:21 UTC, rjframe wrote: >> On Fri, 29 Dec 2017 12:39:25 +, Nicholas Wilson wrote: >> >> I've actually thought about doing this to get rid of a bunch of if >> qualifiers in my function declarations.

Re: Returning dynamic array from the function?

2018-09-08 Thread rjframe via Digitalmars-d-learn
On Sat, 08 Sep 2018 10:22:38 +, SuperPrower wrote: > Also, is this me and my bad English, or first comment in code in this > paragraph (linked above, not in the discussion) is supposed to be > something different? Shouldn't it be reference? Static arrays are value types, so the values are

Re: How to enable verbose logging during application run

2018-03-17 Thread rjframe via Digitalmars-d-learn
On Sat, 17 Mar 2018 22:37:36 +, Venkat wrote: > Sorry posted the above message by accident. > > I am running a vibed app using `dub` command. But it produces no logging > what so ever when requests are made. The server returns http error codes > but it doesn't log anything to the console.

Re: How to implement D to HTML pages ?

2018-10-01 Thread rjframe via Digitalmars-d-learn
On Mon, 01 Oct 2018 19:29:56 +, Aurélien Plazzotta wrote: On Mon, 01 Oct 2018 19:29:56 +, Aurélien Plazzotta wrote: > Hello guys, > > I would like to implement a forum and a blog within my website > (currently including only HTML, CSS and JS, written without CMS), using > D and SQL but I

Re: D-oriented Syntax Highlighting Plugin for WordPress?

2019-01-01 Thread rjframe via Digitalmars-d-learn
On Tue, 01 Jan 2019 14:46:15 +, Ron Tarrant wrote: > I've found a ton of syntax highlighter plugins for WordPress, but none > that admit to supporting D. Anyone know of one? > > Or, short of that, perhaps a different site build/management tool (read: > not WordPress) with decent D syntax

Re: D-oriented Syntax Highlighting Plugin for WordPress?

2019-01-01 Thread rjframe via Digitalmars-d-learn
On Tue, 01 Jan 2019 16:48:00 +, Ron Tarrant wrote: > SilverStripe, on the surface, seems quite WordPress-alike. Did you find > advantages over WordPress, or is it personal preference? > How's the syntax highlighting? (I skimmed the video, but didn't see any > mention of this.) > > PrismJS

Re: Map of functions

2018-12-14 Thread rjframe via Digitalmars-d-learn
On Fri, 14 Dec 2018 16:33:44 +, Giovanni Di Maria wrote: > > I need the flow of calls. > Thank you Giovanni gprof will do this on Linux/BSD if gdc supports the -pg flag (I don't know whether it would, but assume so) and your application is working. >From code, you'd need to call a trace

Re: Problem with aliasing member function

2019-08-18 Thread rjframe via Digitalmars-d-learn
On Sun, 18 Aug 2019 19:17:16 +, Andrey wrote: > Here in tester I want to alias a template method and call it on object > if this object isn't null. But I don't understand how to do it. > How to solve the problem? I don't think you can alias an object method directly; three methods I know