Re: Visual D 0.51.0 - semantic engine based on dmd frontend

2020-09-09 Thread James via Digitalmars-d-announce

On Tuesday, 8 September 2020 at 19:38:17 UTC, mw wrote:

On Tuesday, 8 September 2020 at 19:36:51 UTC, mw wrote:

On Tuesday, 8 September 2020 at 18:42:28 UTC, James wrote:

how is the dub support work?

i don't understand how to load it in visual studio

is there any guide?


given you have dub.json build already,

```
C:\\ dub.exe generate visuald
```


then open the generated `proj.sln` file with VisualD



https://dub.pm/commandline


thanks a lot!


Re: Visual D 0.51.0 - semantic engine based on dmd frontend

2020-09-08 Thread James via Digitalmars-d-announce

how is the dub support work?

i don't understand how to load it in visual studio

is there any guide?

thanks!


Re: Reversing a string

2019-01-11 Thread Mike James via Digitalmars-d-learn

On Friday, 11 January 2019 at 09:41:30 UTC, bauss wrote:

On Friday, 11 January 2019 at 08:25:41 UTC, Seb wrote:
On Friday, 11 January 2019 at 08:05:39 UTC, AndreasDavour 
wrote:

Hi.

I've just started to learn some D, so maybe this question is 
extremely stupid, but please bear with me.


[...]


Use .retro - it is also lazy and won't allocate:

https://run.dlang.io/is/A6bjrC


What a terrible name.


Check out the origin :-)

https://forum.dlang.org/thread/hl8345$2b1q$1...@digitalmars.com?page=1


-=mike=-


Re: GTKD for android?

2018-09-09 Thread James via Digitalmars-d-learn
On Saturday, 8 September 2018 at 02:59:48 UTC, Josphe Brigmo 
wrote:
I have an app I'm writing using GtkD on windows. Eventually I'd 
like to port it to android. Since I have never been able to 
actually get anything to work on android I'm curious if there 
are any demos with gtkD for android? I'm wondering if I just 
scrap the idea of using it because it won't port without a ton 
of work. Ideally I'd like to just cross compile and it all work 
out except for a few bugs.


I don't think it can be currently in an easy way. Qt has better 
android support it seems. Dlangui programs can be cross-compiled. 
You could also write a seperate ui for android but still use D 
for the core of the program.


Re: GtkD global font size

2018-01-15 Thread Mike James via Digitalmars-d-dwt

On Monday, 15 January 2018 at 08:21:16 UTC, Jacob Carlborg wrote:

On 2018-01-15 00:55, Sai wrote:
I am writing a small GUI application using GtkD3 Builder and 
Glade. On a HD monitor the default font size is too small. The 
adwaita theme is not great but I can live with it.


Is there any way to globally increase the font size in the 
GtkD?


I tried the settings.ini file, but that did not help with my 
GtkD3 app. On the other hand, it did increase the global font 
size of the Glade tool, just not my application. Is some how 
GtkD different from pure Gtk application?


This is the forum for the DWT library. I suggest you try the 
"learn" forum instead.


Considering the amount of traffic in this forum wouldn't it be 
better to relabel it as a GUI Forum?


Regards,

-=mike=-


Buy Real passport, drivers license, IELTS, ID Cards (http://buyrealfakedocument.com)

2018-01-03 Thread james via Digitalmars-d-learn



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 passports, residence permit, social security number 
SSN, birth and marriage certificates, stamps, school diplomas, 
IELTS and TOEFL, ESOL, Visa, Business , Students and tourists and 
other products for a number of countries such as USA, Canada, 
Germany, Sweden, Norway, Denmark, Austria, Spain, Czech Republic, 
Portugal, Lithuania, Russia, Hungary, Portugal, Spain, Australia, 
Cambodia, Croatia, African Countries, Japan, China and so on. We 
also provide a service to help you cross your goals, we help you 
to get real government issued ID, check and secure the accounts 
for your new ID, credit card, coach services


We also deal and specialize in the production of registered 
TOEFL, IELTS, ESOL, CELTA/DELTA & other English Language 
Certificates. Please note that Our IELTS & TOEFL Certificates are 
Original and registered in the data base and Can be 
verified.After your order is placed it takes just few days for us 
to get your details in the system Once your details are imputed 
in the system it will be in the IELTS or TOEFL web sites/system 
once for ever and will appear real, legit and verifiable for ever.


* Contact: == http://buyrealfakedocument.com/

*General Email=== http://buyrealfakedocument.com/

https://ieltscertificatoonline.com/



Re: Problem building SWTSnippets with D 2.074.x

2017-11-27 Thread Mike James via Digitalmars-d-dwt

On Monday, 27 November 2017 at 19:21:52 UTC, Jacob Carlborg wrote:

On 2017-06-02 16:01, Jacob Carlborg wrote:

This is due to a regression in the compiler [1]. Please use 
2.073.x until this has been fixed.


[1] https://issues.dlang.org/show_bug.cgi?id=17371



The issue has now been fixed. We'll see in which release of the 
compiler it will show up.


Excellent. 2.077.1 I hope :-)

Regards, Mike.


Re: Problem building SWTSnippets with D 2.074.x

2017-11-23 Thread Mike James via Digitalmars-d-dwt

On Thursday, 16 November 2017 at 02:36:34 UTC, JamesD wrote:
On Wednesday, 15 November 2017 at 07:19:17 UTC, Mike Parker 
wrote:

On Tuesday, 14 November 2017 at 11:33:44 UTC, Mike James wrote:



Has there been any progress on this matter? The snippets 
still don't compile with the latest compiler...




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


Until the issue above is resolved, you can compile with dwtlib.
dwtlib is a work around that uses the *.d source files instead 
of the *.di files.


 dwtlib - DUB package for the D Widget Toolkit
 https://code.dlang.org/packages/dwtlib

Also try gdub, a gui to test individual snippets (see screen 
shot);


 GDUB is a DWT GUI front end for DUB, a D language build 
tool.

 https://code.dlang.org/packages/gdub


Hi James,

When I tried this I got...

Build_dwtlib working in  : 
C:\Users\mikej\AppData\Roaming\dub\packages\dwtlib-3.1.1\dwtlib\dwt

Build_dwtlib builiding   : Windows 64-bit
Build_dwtlib command line: rdmd build.d -m64 clean base swt
(in 
C:\Users\mikej\AppData\Roaming\dub\packages\dwtlib-3.1.1\dwtlib\dwt)

Cleaning
Building dwt-base
workdir=>C:\Users\mikej\AppData\Roaming\dub\packages\dwtlib-3.1.1\dwtlib\dwt\base\src
dmd.exe 
@C:\Users\mikej\AppData\Roaming\dub\packages\dwtlib-3.1.1\dwtlib\dwt\rsp
java\nonstandard\RuntimeTraits.d(61): Error: undefined identifier 
TypeInfo_Typedef


object.Exception@build.d(256): compile error

0x0040594A
0x00406E14
0x0041E56F
0x0041E533
0x0041E434
0x0041751F
0x75D78654 in BaseThreadInitThunk
0x77914A47 in RtlGetAppContainerNamedObjectPath
0x77914A17 in RtlGetAppContainerNamedObjectPath

object.Exception@tools\build_dwtlib.d(123): Build_dwtlib ERROR 
spawning cmd.


0x004029D0
0x00409ABF
0x00409A83
0x00409984
0x00406AE3
0x75D78654 in BaseThreadInitThunk
0x77914A47 in RtlGetAppContainerNamedObjectPath
0x77914A17 in RtlGetAppContainerNamedObjectPath
Press any key to continue . . .

Regards, Mike.


Re: DConf 2018 Call for Submissions

2017-11-16 Thread Mike James via Digitalmars-d-announce

On Thursday, 16 November 2017 at 00:45:58 UTC, codephantom wrote:
On Wednesday, 15 November 2017 at 23:53:40 UTC, Ali Çehreli 
wrote:


I would like to see Chuck Allison talk about the experiences of 
students approaching D. I think that would be really worthwhile 
- or even yourself for that matter, given your strong interest 
in this area. Technical stuff is good and helpful, but I like 
to know about peoples experiences too...that's what really 
interests me the most, and should be at the core of any 
language design. So somebody examining D from this perspective 
could be really insightful to those contributing to the 
language.


It's really critical that D remain accessible to newcomers, or 
its' replacement is just around the corner.


Chucks already done a talk like that - it was berry, berry good...

-=mike=-


Re: Problem building SWTSnippets with D 2.074.x

2017-11-14 Thread Mike James via Digitalmars-d-dwt

On Friday, 2 June 2017 at 14:01:35 UTC, Jacob Carlborg wrote:

On 2017-06-02 09:25, Mike James wrote:

Hi,

I get the following errors when trying to build the 
swtsnippets with the

latest SWT...


This is due to a regression in the compiler [1]. Please use 
2.073.x until this has been fixed.


[1] https://issues.dlang.org/show_bug.cgi?id=17371


Hi Jacob,

Has there been any progress on this matter? The snippets still 
don't compile with the latest compiler...


Regards, Mike


Re: D as a Better C

2017-08-25 Thread Jolly James via Digitalmars-d-announce

On Friday, 25 August 2017 at 15:29:54 UTC, Swoorup Joshi wrote:

On Friday, 25 August 2017 at 08:54:02 UTC, Kagamin wrote:

On Thursday, 24 August 2017 at 19:09:58 UTC, Parke wrote:

What is "intermediate D"?


D with minimal runtime.


5 years later...

D - BetterC++ (no gc)
D - BetterJava (full on gc + other goodie tissue)
D - BetterRust (full interoperability with rust)

Forgive my cynicism


D - BetterC# (no simple and easy-to-use generics, complex 
templates instead)
Phobos - Better.NET (pointless names, weird structure, outdated 
stuff)
DCD - BetterIntelliSense (tends to always not find about ~10 of 
all real possibilities, is rather "patched into" IDEs/editors 
than integrated)


Re: ffmpeg

2017-08-19 Thread Jolly James via Digitalmars-d-learn

On Saturday, 19 August 2017 at 02:50:44 UTC, Johnson Jones wrote:

Trying to get it to work.



You could just try to use/call the ffmeg executable as wrapper. 
For sure, not the best, but proabably the easiest solution. Afaik 
it also supports pipes.


Re: Release D 2.075.0 does not install on Windows 10 with VS2017

2017-07-20 Thread Jolly James via Digitalmars-d-announce

On Thursday, 20 July 2017 at 16:28:54 UTC, jan wrote:

seems like i am not the first one to have that problem.

please fix.


everything working fine from here :)
Maybe you should state what exactly is not working for you and 
paste some error messages...


Re: Remove instance from array

2017-07-06 Thread Jolly James via Digitalmars-d-learn

On Thursday, 6 July 2017 at 08:15:10 UTC, Andrea Fontana wrote:

On Wednesday, 5 July 2017 at 16:17:29 UTC, Jolly James wrote:

On Wednesday, 5 July 2017 at 16:04:16 UTC, Jolly James wrote:

[...]




Part of CoreCLR's 'List':


[...]



If there isn't already, maybe something similar to this should 
get part of Phobos. I think this could be really useful.


q = q.remove(1); // Remove element with index 1
q = q.remove(x => x == instance); // Remove all items that 
match instance


thx


Re: dub + local dependencies

2017-07-06 Thread Jolly James via Digitalmars-d-learn

On Thursday, 6 July 2017 at 00:12:25 UTC, Mike Parker wrote:

On Thursday, 6 July 2017 at 00:09:46 UTC, Mike Parker wrote:



You have a few options:

* Use a path dependency:
"dependencies": {
 "xyz": { "path": "path/to/xyz" }
}

* Use add-local with a version on the command line:
dub add-local path/to/xyz  0.0.1

* Use add-local or add-paths and specify a version as 
described by `dub add-paths -h`


Sorry -- extraneous `s` on the `path` bit.

And for the record:

https://code.dlang.org/docs/commandline#add-local
https://code.dlang.org/docs/commandline#add-path
https://code.dlang.org/package-format?lang=json#version-specs


thx


Re: unittest-cov - results?

2017-07-05 Thread Jolly James via Digitalmars-d-learn

On Wednesday, 5 July 2017 at 19:01:06 UTC, Jonathan M Davis wrote:
On Wednesday, July 05, 2017 18:50:32 Jolly James via 
Digitalmars-d-learn wrote:

On Wednesday, 5 July 2017 at 18:46:38 UTC, Jolly James wrote:
> On Wednesday, 5 July 2017 at 18:09:46 UTC, Seb wrote:
>> [...]
>
> where would I find these *.lst files. Searching for '*.lst' 
> in the source's root dir doesn't bring any results.


I have changed the 'build' to 'test' in the command. Now at 
least I get the following message: "All unit tests have been 
run successfully." which should not actually happen, as my 
code contains an 'assert(false);' unittest.


If you don't run the tests, you won't get any code coverage. 
Building with


dub test --coverage


The following command does not change anything:
  dub test --coverage --arch=x86_64 --compiler=ldc2
All I get is "All unit tests have been run successfully." in the 
command line.



should do it. As for your assert(false) test failing, was it in 
the same module with your main in it?


No, this test is actually in module 'tools.array'.



Re: unittest-cov - results?

2017-07-05 Thread Jolly James via Digitalmars-d-learn

On Wednesday, 5 July 2017 at 18:46:38 UTC, Jolly James wrote:

On Wednesday, 5 July 2017 at 18:09:46 UTC, Seb wrote:

On Wednesday, 5 July 2017 at 17:46:01 UTC, Jolly James wrote:

[...]


For every file a `.lst` file is generated (it's the same 
how `-cov` behaves at DMD).
These .lst files contain the original source code with number 
of hits of a respective line:


  2|auto copy = new char[s.length + 1];
  2|copy[0 .. s.length] = s[];
  2|copy[s.length] = 0;

Maybe you haven't seen the lst files?


Btw if you use Travis, you can use an `after_success` event to 
your `.travis.yml` to upload the results to CodeCov for a nice 
visuals & PR integration:


```
after_success:
 - bash <(curl -s https://codecov.io/bash)
```

We do this on most dlang repos, e.g. 
https://github.com/dlang/phobos/pull/5503


where would I find these *.lst files. Searching for '*.lst' in 
the source's root dir doesn't bring any results.


I have changed the 'build' to 'test' in the command. Now at least 
I get the following message: "All unit tests have been run 
successfully." which should not actually happen, as my code 
contains an 'assert(false);' unittest.


Re: unittest-cov - results?

2017-07-05 Thread Jolly James via Digitalmars-d-learn

On Wednesday, 5 July 2017 at 18:09:46 UTC, Seb wrote:

On Wednesday, 5 July 2017 at 17:46:01 UTC, Jolly James wrote:

[...]


For every file a `.lst` file is generated (it's the same 
how `-cov` behaves at DMD).
These .lst files contain the original source code with number 
of hits of a respective line:


  2|auto copy = new char[s.length + 1];
  2|copy[0 .. s.length] = s[];
  2|copy[s.length] = 0;

Maybe you haven't seen the lst files?


Btw if you use Travis, you can use an `after_success` event to 
your `.travis.yml` to upload the results to CodeCov for a nice 
visuals & PR integration:


```
after_success:
 - bash <(curl -s https://codecov.io/bash)
```

We do this on most dlang repos, e.g. 
https://github.com/dlang/phobos/pull/5503


where would I find these *.lst files. Searching for '*.lst' in 
the source's root dir doesn't bring any results.


unittest-cov - results?

2017-07-05 Thread Jolly James via Digitalmars-d-learn

How does unit testing with dub work?

dub build --arch=x86_64 --build=unittest-cov --force 
--compiler=ldc2


After execution, there is no result output in the command line.


Re: Remove instance from array

2017-07-05 Thread Jolly James via Digitalmars-d-learn

On Wednesday, 5 July 2017 at 16:55:43 UTC, bachmeier wrote:

On Wednesday, 5 July 2017 at 16:04:16 UTC, Jolly James wrote:

Here in D everything looks like climbing mount everest. When 
you ask how to use D's containers you are recommended to use 
dynamic arrays instead. When you look at the docs for 
std.algorithm, e.g. the .remove section, you get bombed with 
things like 'SwapStrategy.unstable', asserts and tuples, but 
you aren't told how to simply remove 1 specific element.


If you feel that there is a problem with the docs, you should 
file a bug: https://dlang.org/bugstats.php


The documentation is still not perfect, but the only way to 
improve it is to file bugs when you see something that needs 
fixing.


unfortunately, it's not that the docs would be wrong or something 
that can be easily corrected. Nope, the docs do everything right, 
they show you what the existing things do. But what they don't do 
is how to get stuff done. imho some additional, useful guides 
would be nice.


Re: Remove instance from array

2017-07-05 Thread Jolly James via Digitalmars-d-learn

On Wednesday, 5 July 2017 at 16:04:16 UTC, Jolly James wrote:

On Wednesday, 5 July 2017 at 15:56:45 UTC, Igor Shirkalin wrote:

[...]


Thank you! :)


But why a containers so complicated in D?

[...]




Part of CoreCLR's 'List':


   public bool Remove(T item)
   {
   int index = IndexOf(item);
   if (index >= 0)
   {
   RemoveAt(index);
   return true;
   }

   return false;
   }
// 
https://github.com/dotnet/coreclr/blob/master/src/mscorlib/src/System/Collections/Generic/List.cs



If there isn't already, maybe something similar to this should 
get part of Phobos. I think this could be really useful.


Re: Remove instance from array

2017-07-05 Thread Jolly James via Digitalmars-d-learn

On Wednesday, 5 July 2017 at 15:56:45 UTC, Igor Shirkalin wrote:

On Wednesday, 5 July 2017 at 15:48:14 UTC, Jolly James wrote:
On Wednesday, 5 July 2017 at 15:44:47 UTC, Igor Shirkalin 
wrote:

On Wednesday, 5 July 2017 at 15:30:08 UTC, Jolly James wrote:

WhatEver[] q = [];

[...]

auto i = new WhatEver();
q[] = i;



How does one remove that instance 'i'?


What exactly do you want to remove? After a[]=i your array 
contain a lot of references to 'i'.


I would like to know how works: removing
 - the first
 - and all
references to 'i' inside the 'q'.


Perhaps, for all references to i it should look like:
a = a.filter!(a => a !is i).array;


Thank you! :)


But why a containers so complicated in D?

In C# I would go for a generic List, which would support 
structs and classes, where I simply could call '.Remove(T item)' 
or '.RemoveAt(int index)'. I would know how this works, because 
the method names make sense, the docs are straight forward.


Here in D everything looks like climbing mount everest. When you 
ask how to use D's containers you are recommended to use dynamic 
arrays instead. When you look at the docs for std.algorithm, e.g. 
the .remove section, you get bombed with things like 
'SwapStrategy.unstable', asserts and tuples, but you aren't told 
how to simply remove 1 specific element.


Re: Remove instance from array

2017-07-05 Thread Jolly James via Digitalmars-d-learn

On Wednesday, 5 July 2017 at 15:44:47 UTC, Igor Shirkalin wrote:

On Wednesday, 5 July 2017 at 15:30:08 UTC, Jolly James wrote:

WhatEver[] q = [];

[...]

auto i = new WhatEver();
q[] = i;



How does one remove that instance 'i'?


What exactly do you want to remove? After a[]=i your array 
contain a lot of references to 'i'.


I would like to know how works: removing
 - the first
 - and all
references to 'i' inside the 'q'.


dub + local dependencies

2017-07-05 Thread Jolly James via Digitalmars-d-learn
WARNING: A deprecated branch based version specification is 
used for the dependency xyz.

Please use numbered versions instead.
Also note that you can still use the dub.selections.json file 
to override a certain dependency to use a branch instead.



The problem is: xyz is a local package and therefor I don't know 
how to specify its version. So in the dub.json of the package abc 
requiring xyz is written:




"dependencies": {
"xyz": "~master"
},



Is there a cleaner solution?


Remove instance from array

2017-07-05 Thread Jolly James via Digitalmars-d-learn

WhatEver[] q = [];

[...]

auto i = new WhatEver();
q[] = i;



How does one remove that instance 'i'?


Re: Linking external *.lib files

2017-06-21 Thread Jolly James via Digitalmars-d-learn

*push*



Re: Templated Lists

2017-06-16 Thread Jolly James via Digitalmars-d

On Saturday, 17 June 2017 at 00:28:50 UTC, Ali Çehreli wrote:

On 06/16/2017 05:02 PM, Jolly James wrote:
If I did well on my quick research, C#'s generic lists are 
exactly that. :)




C#'s generics allow to specify one datatype T that is used, some 
kind of similar to a template. So, a generic list can contain 
only elements of type T. That what makes it generic is that M$ 
had to implement this class only once and now it can be used with 
any datatype by simply specifying  it ( → List ).




With std.algorithm.remove:

import std.algorithm;

void main() {
auto arr = [ 1, 2, 3, 4, 5, 6 ];

arr = arr.remove(5);// Removes element at index 
3

assert(arr == [ 1, 2, 3, 4, 5 ]);

arr = arr.remove!(e => e % 2);  // Removes elements with 
odd values

assert(arr == [ 2, 4 ]);
}


Thank you very much :)




Re: Linking external *.lib files

2017-06-16 Thread Jolly James via Digitalmars-d-learn

On Saturday, 17 June 2017 at 00:33:01 UTC, Jolly James wrote:

On Saturday, 17 June 2017 at 00:09:41 UTC, Jolly James wrote:

Let's assume, I have the following 2 dub packages:


pkgBASE:
(depends on public DUB package)
source/
lib/
pkgAPP:
(depends on pkgBASE)
source/


I have added pkgBASE via add-path. This wasn't a problem at 
all.


Unfortunately, the public DUB package requires to be linked 
with the libs from pkgBASE/lib. What do I have to add to 
pkgBASE's dub.json?


Side-note: the lib/ should not be moved for portability reasons 
if this is possible




My bad solution:


"lflags": [
"-Llib\\"
],



but this requires the lib folder to be part of pkgAPP, not 
pkgBASE where I would like to have it. Does anyone have an idea?


Re: Linking external *.lib files

2017-06-16 Thread Jolly James via Digitalmars-d-learn

On Saturday, 17 June 2017 at 00:09:41 UTC, Jolly James wrote:

Let's assume, I have the following 2 dub packages:


pkgBASE:
(depends on public DUB package)
source/
lib/
pkgAPP:
(depends on pkgBASE)
source/


I have added pkgBASE via add-path. This wasn't a problem at all.

Unfortunately, the public DUB package requires to be linked 
with the libs from pkgBASE/lib. What do I have to add to 
pkgBASE's dub.json?


Side-note: the lib/ should not be moved for portability reasons 
if this is possible


Re: Linking external *.lib files

2017-06-16 Thread Jolly James via Digitalmars-d-learn

Let's assume, I have the following 2 dub packages:


pkgBASE:
(depends on public DUB package)
source/
lib/
pkgAPP:
(depends on pkgBASE)
source/


I have added pkgBASE via add-path. This wasn't a problem at all.

Unfortunately, the public DUB package requires to be linked with 
the libs from pkgBASE/lib. What do I have to add to pkgBASE's 
dub.json?


Re: Templated Lists

2017-06-16 Thread Jolly James via Digitalmars-d

On Friday, 16 June 2017 at 23:38:46 UTC, Ali Çehreli wrote:

On 06/16/2017 04:08 PM, Jolly James wrote:

On Friday, 16 June 2017 at 19:42:44 UTC, Cym13 wrote:

I'm unclear about your intent: do you want a compile-time list


I am looking for something similar to C#'s generic list.


std.variant.Variant perhaps?

  https://dlang.org/phobos/std_variant.html

import std.variant;

void main() {
Variant[] arr;
arr ~= Variant(42);
arr ~= Variant("hello");
}

Also consider Algebraic in that module.

Ali


Thx, but I do not need to mix different types (using variant). 
Assuming I use simply an dynamic array, how does one remove an 
specific item?


Linking external *.lib files

2017-06-16 Thread Jolly James via Digitalmars-d-learn

Let's assume, I have the following 2 dub packages:

pkgBASE:
source/
lib/

pkgAPP:



Re: Templated Lists

2017-06-16 Thread Jolly James via Digitalmars-d

On Friday, 16 June 2017 at 19:42:44 UTC, Cym13 wrote:

I'm unclear about your intent: do you want a compile-time list


I am looking for something similar to C#'s generic list.


interface IList
{
int Count { get; }

void Add(T item);
void Remove(T item);

T this[int index];

// [...]
}


Templated Lists

2017-06-16 Thread Jolly James via Digitalmars-d
I know that there are arrays, some strange container classes and 
so on.


But how does one create and use a templated list in D that 
supports adding, removing and sorting items? One that can be used 
for structs and for classes?


Re: DMD VS2017 Support

2017-06-04 Thread Jolly James via Digitalmars-d

On Monday, 1 May 2017 at 18:30:53 UTC, Rainer Schuetze wrote:



On 01.05.2017 10:03, Igor wrote:

On Monday, 1 May 2017 at 01:54:30 UTC, evilrat wrote:

[...]


That was it. It didn't occur to me that this was the problem 
because I
payed closed attention during VisualD installation and saw it 
properly
recognized where DMD was installed but for some reason the 
path wasn't
set in Options. Once I did set it, compile and build worked. 
Thanks

evilrat!

So in conclusion it seems the problem is in VisualD 
installation which
doesn't set the path properly even though it recognizes where 
DMD is
installed. Hope the author takes a look at this problem so 
beginners

wanting to try D don't give up on a problem like this.


VS 2017 uses a "private" registry that the Visual D installer 
doesn't have access to. I'll change the registry location in 
the next release.


Please note that the next dmd installer will also detect VS2017 
and setup directories correctly in sc.ini: 
https://github.com/dlang/installer/pull/227


Today I saw that a new DMD version had been released. So I 
downloaded it (dmd-2.074.1.exe).


Unfortunately, the installer does *not* detect VS2017, instead it 
asks me to install VS2013 for x64 support.


Problem building SWTSnippets with D 2.074.x

2017-06-02 Thread Mike James via Digitalmars-d-dwt

Hi,

I get the following errors when trying to build the swtsnippets 
with the latest SWT...


PS C:\d\gui\dwt> rdmd build swtsnippets
(in C:\d\gui\dwt)
Building swtsnippets[Snippet10]
dmd.exe @C:\d\gui\dwt\rsp
C:\d\gui\dwt\imp\org\eclipse\swt\ole\win32\OleClientSite.di(84): 
Error: basic type expected, not class
C:\d\gui\dwt\imp\org\eclipse\swt\ole\win32\OleClientSite.di(84): 
Error: { members } expected for anonymous class
C:\d\gui\dwt\imp\org\eclipse\swt\ole\win32\OleClientSite.di(84): 
Error: found 'class' when expecting ';' following state

ment
C:\d\gui\dwt\imp\org\eclipse\swt\ole\win32\OleClientSite.di(85): 
Error: found '{' when expecting ';' following statement
C:\d\gui\dwt\imp\org\eclipse\swt\ole\win32\OleClientSite.di(86): 
Error: found 'public' instead of statement
C:\d\gui\dwt\imp\org\eclipse\swt\ole\win32\OleClientSite.di(89): 
Error: function declaration without return type. (Note

that constructors are always named 'this')
C:\d\gui\dwt\imp\org\eclipse\swt\ole\win32\OleClientSite.di(89): 
Error: no identifier for declarator frame.addListener(S

WT.Resize, listener)
C:\d\gui\dwt\imp\org\eclipse\swt\ole\win32\OleClientSite.di(90): 
Error: function declaration without return type. (Note

that constructors are always named 'this')
C:\d\gui\dwt\imp\org\eclipse\swt\ole\win32\OleClientSite.di(90): 
Error: no identifier for declarator frame.addListener(S

WT.Move, listener)
C:\d\gui\dwt\imp\org\eclipse\swt\ole\win32\OleClientSite.di(91): 
Error: function declaration without return type. (Note

that constructors are always named 'this')
C:\d\gui\dwt\imp\org\eclipse\swt\ole\win32\OleClientSite.di(91): 
Error: no identifier for declarator addListener(SWT.Dis

pose, listener)
C:\d\gui\dwt\imp\org\eclipse\swt\ole\win32\OleClientSite.di(92): 
Error: function declaration without return type. (Note

that constructors are always named 'this')
C:\d\gui\dwt\imp\org\eclipse\swt\ole\win32\OleClientSite.di(92): 
Error: no identifier for declarator addListener(SWT.Foc

usIn, listener)
C:\d\gui\dwt\imp\org\eclipse\swt\ole\win32\OleClientSite.di(93): 
Error: function declaration without return type. (Note

that constructors are always named 'this')
C:\d\gui\dwt\imp\org\eclipse\swt\ole\win32\OleClientSite.di(93): 
Error: no identifier for declarator addListener(SWT.Foc

usOut, listener)
C:\d\gui\dwt\imp\org\eclipse\swt\ole\win32\OleClientSite.di(94): 
Error: function declaration without return type. (Note

that constructors are always named 'this')
C:\d\gui\dwt\imp\org\eclipse\swt\ole\win32\OleClientSite.di(94): 
Error: no identifier for declarator addListener(SWT.Pai

nt, listener)
C:\d\gui\dwt\imp\org\eclipse\swt\ole\win32\OleClientSite.di(95): 
Error: function declaration without return type. (Note

that constructors are always named 'this')
C:\d\gui\dwt\imp\org\eclipse\swt\ole\win32\OleClientSite.di(95): 
Error: no identifier for declarator addListener(SWT.Tra

verse, listener)
C:\d\gui\dwt\imp\org\eclipse\swt\ole\win32\OleClientSite.di(96): 
Error: function declaration without return type. (Note

that constructors are always named 'this')

object.Exception@build.d(375): compile error

0x00406C4F
0x004084CF
0x004049CC
0x004207E3
0x004207A7
0x004206A8
0x0041828B
0x74378744 in BaseThreadInitThunk
0x7773587D in RtlGetAppContainerNamedObjectPath
0x7773584D in RtlGetAppContainerNamedObjectPath
PS C:\d\gui\dwt> SampleNoiseMeasureSampleNoiseMeasure


Regards, Mike.


Re: DMD VS2017 Support

2017-05-24 Thread Jolly James via Digitalmars-d
On Wednesday, 24 May 2017 at 03:21:56 UTC, Vladimir Panteleev 
wrote:

On Tuesday, 23 May 2017 at 23:11:30 UTC, Jolly James wrote:
Come one, let's be ones: If DMD has no x64 linker, VS 
integration is not a bit optional.


Unlike some other operating systems, 64-bit Windows versions 
can run 32-bit software just fine. If you require targeting 
Win64 (or the Microsoft C runtime), that is specific to your 
use case.


That's true. But when D's GC does not trigger early enough, my 
program runs out of memory (due to the 2 GB limit of 32 bit 
process), x64 solves this more or less. As a side note: I am 
talking about allocating huge arrays.



And, again, Visual Studio is not required if you want to target 
Win64 - only the necessary toolchain components (linker and C 
runtime), which you can also obtain from an SDK.


So you are telling me "not working at all" is not worth 
releasing a fix? xD


Again, everything should be already working. We are talking 
about a convenience feature that automatically sets up the D 
compiler's configuration file, nothing more. That's all there 
is to the "integration". You can trivially do the same thing by 
hand, or set up your environment accordingly - all in a 
fraction of the time it took you to write these pointless 
complaints on this forum.


I admit, you are right in some points. Nevertheless, have you 
ever tried letting a novice configuring this stuff? The 'sc.ini' 
is neither easy to read nor logic. In my particular case I am 
overchallenged by this task.


Re: DMD VS2017 Support

2017-05-23 Thread Jolly James via Digitalmars-d

On Monday, 22 May 2017 at 23:58:37 UTC, Vladimir Panteleev wrote:
Additionally, Visual Studio integration is an optional feature 
of the Windows version, and of course VS2017 is just one 
supported version of VS.
Come one, let's be ones: If DMD has no x64 linker, VS integration 
is not a bit optional.


The scope of the problem may seem larger to you because you are 
affected by it personally, however at any point in time there 
may be any number of fixes queued for release of similar 
relative importance. Making an urgent release for every such 
occurrence would be impractical, if not impossible given the 
necessary work involved with making each new release.


So you are telling me "not working at all" is not worth releasing 
a fix? xD


Re: DMD VS2017 Support

2017-05-22 Thread Jolly James via Digitalmars-d

On Monday, 22 May 2017 at 07:28:23 UTC, Vladimir Panteleev wrote:

On Sunday, 21 May 2017 at 22:47:44 UTC, Jolly James wrote:

On Monday, 1 May 2017 at 18:30:53 UTC, Rainer Schuetze wrote:
Please note that the next dmd installer will also detect 
VS2017 and setup directories correctly in sc.ini: 
https://github.com/dlang/installer/pull/227


I really like this philosophy:
"It does not work, a fix is available, but it won't be rolled 
out (for now). Who cares about those who cannot use the broken 
software?"


Please don't antagonize volunteer contributors who are actually 
creating and improving things. We have a release process for a 
reason, we can't ship every single change immediately. If you 
require a solution urgently, use a workaround or build it from 
source yourself.


My message was neither addressed directly to anybody of the 
volunteer contributors (I have a huge respect of them and their 
great work), nor to anyone at the D Foundation directly. I just 
wanted to critize the whole release cycle stuff itself.


I mean, if for any circumstance, e.g. like the VS2017 thing 
(which did not suddenly appear from one day to another anyway), 
the whole software cannot be used without larger fiddling (in 
this case: setting up NSIS + plugins), it seems quite strange to 
not simply update the installer, which would be a work for a few 
minutes - and after that everybody would be happy.
But to be honest, I don't think that this is a problem of D. More 
or less, this is something that appears everywhere in the world 
of open-source. Here it annoys and chases away users, in the 
corporate sector you could not do so, as this would cause the 
company's ruin.


Re: DMD VS2017 Support

2017-05-21 Thread Jolly James via Digitalmars-d

On Monday, 1 May 2017 at 18:30:53 UTC, Rainer Schuetze wrote:
Please note that the next dmd installer will also detect VS2017 
and setup directories correctly in sc.ini: 
https://github.com/dlang/installer/pull/227


I really like this philosophy:
"It does not work, a fix is available, but it won't be rolled out 
(for now). Who cares about those who cannot use the broken 
software?"


Re: DMD now has colorized syntax highlighting in error messages

2017-05-16 Thread Mike James via Digitalmars-d-announce

On Sunday, 14 May 2017 at 14:07:20 UTC, Walter Bright wrote:

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

It turned out to be unexpectedly easy to implement.

The only downside is now we have to rather tediously tweak the 
error message texts so they use backticks.


The next step is Color D...

https://github.com/narke/colorForth

-=mike=-


Re: DMD 2.074.0

2017-05-04 Thread Jolly James via Digitalmars-d

On Thursday, 4 May 2017 at 16:43:27 UTC, jj wrote:

the installer does not work for VS 2017 - that sucks!!!


see also: 
https://forum.dlang.org/post/oe7usu$bvf$1...@digitalmars.com


String Comparison Operator

2017-04-30 Thread Jolly James via Digitalmars-d-learn

Is there a String Comparison Operator in D?


Re: DMD VS2017 Support

2017-04-20 Thread Jolly James via Digitalmars-d

On Thursday, 20 April 2017 at 17:10:05 UTC, Meta wrote:

On Thursday, 20 April 2017 at 17:06:15 UTC, Mike Parker wrote:

On Thursday, 20 April 2017 at 14:44:54 UTC, Meta wrote:

On Thursday, 20 April 2017 at 14:29:28 UTC, Jolly James wrote:
What has the DMD compiler to do with a VS plugin that I am 
not using?


You said in your original post "DMD installer only offers to 
install VS2013". This isn't the DMD installer but the Visual 
D installer that installs the plugin for the appropriate 
version of Visual Studio. As Mike said, though, you can also 
just edit sc.ini if you don't want to use Visual D.


It actually does offer to install both VS 2013 and Visual D.


Wow, I did not know that. Seems a little excessive.


But anyway, that's how it is.

By the way: installing VS2013 is only offered to you, if no 
compatible version (atm VS2015 or older) is found on your machine.


Re: DMD VS2017 Support

2017-04-20 Thread Jolly James via Digitalmars-d

On Thursday, 20 April 2017 at 05:02:37 UTC, Mike Parker wrote:

On Thursday, 20 April 2017 at 04:58:55 UTC, Mike Parker wrote:

[...]


I should add that Mike's suggestion to edit sc.ini should do 
the trick, but I find it convenient to have both toolsets 
installed.


I'll give it a try, thanks to you and Mike J.! 


Re: DMD VS2017 Support

2017-04-20 Thread Jolly James via Digitalmars-d

On Thursday, 20 April 2017 at 00:13:29 UTC, Meta wrote:

On Wednesday, 19 April 2017 at 20:47:51 UTC, Jolly James wrote:

[...]


Please ignore Mike's answer. Visual D is maintained by Rainers 
Schuetze and is hosted here[1] on github. From the readme:


For more information on installation, a quick tour of Visual D 
with some screen shots and feedback, please visit the project 
home for Visual D at 
http://rainers.github.io/visuald/visuald/StartPage.html.


There's a forum dedicated to IDE discussions 
(http://forum.dlang.org/group/digitalmars.D.ide), where you can 
leave your comments and suggestions. Bug reports can be filed 
to the D bugzilla database for Component VisualD.


Have fun, Rainer Schuetze

1. https://github.com/dlang/visuald


What has the DMD compiler to do with a VS plugin that I am not 
using?


Re: DMD VS2017 Support

2017-04-19 Thread Jolly James via Digitalmars-d
I cannot even fix it myself because DMD is looking for 
"bin\link.exe". But with VS2017 the path would actually be 
something like "\bin\HostX64\x64".


The lost Group

2017-04-19 Thread Jolly James via Digitalmars-d
https://forum.dlang.org/group/D does not appear in the forum's 
index or sidebar.


DMD VS2017 Support

2017-04-19 Thread Jolly James via Digitalmars-d
DMD does not support VS2017. Therefore I cannot link x64 
applications. DMD installer only offers to install VS2013 (what I 
am absolutely not going to do, as that would be a real shame with 
the disk space it consumes).


Any plans for supporting VS2017?


Re: Howto catch SocketOSException?

2017-03-27 Thread Jolly James via Digitalmars-d-learn

On Sunday, 26 March 2017 at 21:57:29 UTC, Jolly James wrote:

On Sunday, 26 March 2017 at 18:50:13 UTC, bauss wrote:

[...]


If you want try to help me, mabye this helps you:
https://github.com/CyberShadow/ae/blob/master/net/asockets.d#L1237


Finally found the bug: I had a logical error in the way how I 
used this code.


Re: Howto catch SocketOSException?

2017-03-26 Thread Jolly James via Digitalmars-d-learn

On Sunday, 26 March 2017 at 18:50:13 UTC, bauss wrote:

On Sunday, 26 March 2017 at 11:46:39 UTC, Jolly James wrote:

[...]


Chances are it's invoked in another thread and thus you can't 
catch it like that.


To sum it up.

Ex.

void thisFunctionThrows() { ... }

void ableToCatch() {
try {
thisFunctionThrows();
}
catch (Exception e) {
// We can catch the exception ...
}
}

void notAbleToCatch() {
try {
spawn();
}
catch (Exception e) {
// We cannot catch the exception ...
}
}

void ableToCatchToo() {
spawn(); // We're able to handle the exception, 
because the try/catch is handled in the thread that calls the 
function that throws.

}


If you want try to help me, mabye this helps you:
https://github.com/CyberShadow/ae/blob/master/net/asockets.d#L1237


Re: Howto catch SocketOSException?

2017-03-26 Thread Jolly James via Digitalmars-d-learn

On Sunday, 26 March 2017 at 11:35:00 UTC, Jolly James wrote:

On Sunday, 26 March 2017 at 02:41:46 UTC, Adam D. Ruppe wrote:

On Sunday, 26 March 2017 at 02:24:56 UTC, Jolly James wrote:
You can ignore the loop()-method. It is not called as the 
application will never reach this statement, because it 
cannot, because it crashes already in the listen()-method in 
consequence of the exception that does not get caught by the 
try-catch block.


Try putting it in the try anyway and see what happens.

It is an async socket library, they can do weird things.\


Unfortunately not working either. I should not forget to 
mention that the exception also raises when the code does not 
contain the loop()-call.


Found out something: You cannot catch any exception thrown in the 
listen()-method in general.



■ Original code:
auto addressInfos = getAddressInfo(addr, to!string(port), 
AddressInfoFlags.PASSIVE, SocketType.STREAM, ProtocolType.TCP);



■ Modified one:

AddressInfo[] addressInfos;

try
{
	addressInfos = getAddressInfo(addr, to!string(port), 
AddressInfoFlags.PASSIVE, SocketType.STREAM, ProtocolType.TCP);

}
catch(SocketOSException e)
{
throw new Exception("Invalid address: " ~ addr, e);
}



■ Not working try-catch:

try
{
tcp.listen(2345, "127.0.0.1c");
socketManager.loop();
}
catch (Exception e)
{
return;
}


Re: Howto catch SocketOSException?

2017-03-26 Thread Jolly James via Digitalmars-d-learn

On Sunday, 26 March 2017 at 02:41:46 UTC, Adam D. Ruppe wrote:

On Sunday, 26 March 2017 at 02:24:56 UTC, Jolly James wrote:
You can ignore the loop()-method. It is not called as the 
application will never reach this statement, because it 
cannot, because it crashes already in the listen()-method in 
consequence of the exception that does not get caught by the 
try-catch block.


Try putting it in the try anyway and see what happens.

It is an async socket library, they can do weird things.\


Unfortunately not working either. I should not forget to mention 
that the exception also raises when the code does not contain the 
loop()-call.


Re: Howto catch SocketOSException?

2017-03-25 Thread Jolly James via Digitalmars-d-learn

On Sunday, 26 March 2017 at 01:22:24 UTC, bauss wrote:

On Sunday, 26 March 2017 at 00:34:03 UTC, Jolly James wrote:

[...]


This part:
catch (std.socket.SocketOSException e)

[...]


[...]


I know that inheritance stuff, but none (!) of them catches that 
strange exception either. You can ignore the loop()-method. It is 
not called as the application will never reach this statement, 
because it cannot, because it crashes already in the 
listen()-method in consequence of the exception that does not get 
caught by the try-catch block.



std.socket.SocketOSException@std\socket.d(975): getaddrinfo 
error: Unknow host.


	0x004205BE in pure @safe bool 
std.exception.enforce!(bool).enforce(bool, lazy object.Throwable)
	0x0040D3A2 in @trusted std.socket.AddressInfo[] 
std.socket.getAddressInfo!(immutable(char)[], 
std.socket.AddressInfoFlags, std.socket.SocketType, 
std.socket.ProtocolType).getAddressInfo(const(char[]), 
immutable(char)[], std.socket.AddressInfoFlags, 
std.socket.SocketType, std.socket.ProtocolType).__lambda7()
	0x0040D37B in @safe std.socket.AddressInfo[] 
std.socket.getAddressInfo!(immutable(char)[], 
std.socket.AddressInfoFlags, std.socket.SocketType, 
std.socket.ProtocolType).getAddressInfo(const(char[]), 
immutable(char)[], std.socket.AddressInfoFlags, 
std.socket.SocketType, std.socket.ProtocolType) at 
C:\dlang\dmd2\windows\bin\..\..\src\phobos\std\socket.d(945)
	0x00404DAF in ushort ae.net.asockets.TcpServer.listen(ushort, 
immutable(char)[]) at C:\Users\jolly\src\ae\net\asockets.d(1242)

0x00416749 in _Dmain at C:\Users\jolly\src\app.d(48)
	0x00423597 in 
D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv
	0x0042355B in void rt.dmain2._d_run_main(int, char**, extern 
(C) int function(char[][])*).runAll()

0x0042345C in _d_run_main
0x00417D74 in main at C:\Users\jolly\src\ae\net\asockets.d(7)
0x00443EBD in mainCRTStartup
0x757362C4 in BaseThreadInitThunk
0x773C0FD9 in RtlSubscribeWnfStateChangeNotification
0x773C0FA4 in RtlSubscribeWnfStateChangeNotification


↑ stacktrace


Howto catch SocketOSException?

2017-03-25 Thread Jolly James via Digitalmars-d-learn

How do you catch an std.socket.SocketOSException?


The following does not work, as the exception occurs anyway and 
leads to a crash:



import ae.net.asockets;

void main(string[] args)
{
TcpServer tcp = new TcpServer();

try
{
tcp.listen(2345, "127.0.0.1c");
// '...c' makes the IP address invalid
}
catch (std.socket.SocketOSException e)
{
return;
}
catch (Exception e)
{
return;
}

socketManager.loop();
}


Output:
std.socket.SocketOSException@std\socket.d(975): getaddrinfo 
error: Unknown Host


Re: About void[] and asockets

2017-02-22 Thread Jolly James via Digitalmars-d-learn
On Wednesday, 22 February 2017 at 17:57:31 UTC, Adam D. Ruppe 
wrote:
On Wednesday, 22 February 2017 at 17:53:21 UTC, Jolly James 
wrote:

No matter how I try, I am always getting:
Error: none of the overloads of '__ctor' are callable using 
argument types (Data*), candidates are: (my-project)


I don't know the library, so I'd have to see the Data class, 
but you might just be using  when you should be using 
plain data.


Silly me!
Now I used Xamarin's Find-Usage-Feature, found one usage in ae 
and realized that there is no reason for using the keyword `new`, 
as Data is a struct (and so one does not need `new` unlike in C#) 
...


Re: About void[] and asockets

2017-02-22 Thread Jolly James via Digitalmars-d-learn

On Wednesday, 22 February 2017 at 17:06:51 UTC, Jolly James wrote:
On Wednesday, 22 February 2017 at 17:01:11 UTC, Adam D. Ruppe 
wrote:
On Wednesday, 22 February 2017 at 16:55:03 UTC, Jolly James 
wrote:
Well, what are these void-arrays for real? I mean, they 
contain data what does not make them really void, does it?


They represent an array of anything; the user can pass ubyte[] 
to it, or int[] to it, or char[] to it, or anything else (even 
string if it is in void[] or const void[]).



And how to I get received data out of Data.content[]?
How to use TcpConnection.send()? E.g. for sending a string?


Cast it to `const(ubyte)[]` then use it as a bag of bytes. 
That's almost always what you want to do inside.


The function signature uses `in void[]` instead of `ubyte[]` 
because void will accept strings and other stuff too, whereas 
ubyte specifically requires it to be typed as bye.


You want to use it INTERNALLY as bytes, but the external 
interface can accept almost anything.


Thank you very much!
Now it makes sense and I understand.


But I have one problem: How to use the constructor of the Data 
class?


No matter how I try, I am always getting:
Error: none of the overloads of '__ctor' are callable using 
argument types (Data*), candidates are: (my-project)


Re: About void[] and asockets

2017-02-22 Thread Jolly James via Digitalmars-d-learn
On Wednesday, 22 February 2017 at 17:01:11 UTC, Adam D. Ruppe 
wrote:
On Wednesday, 22 February 2017 at 16:55:03 UTC, Jolly James 
wrote:
Well, what are these void-arrays for real? I mean, they 
contain data what does not make them really void, does it?


They represent an array of anything; the user can pass ubyte[] 
to it, or int[] to it, or char[] to it, or anything else (even 
string if it is in void[] or const void[]).



And how to I get received data out of Data.content[]?
How to use TcpConnection.send()? E.g. for sending a string?


Cast it to `const(ubyte)[]` then use it as a bag of bytes. 
That's almost always what you want to do inside.


The function signature uses `in void[]` instead of `ubyte[]` 
because void will accept strings and other stuff too, whereas 
ubyte specifically requires it to be typed as bye.


You want to use it INTERNALLY as bytes, but the external 
interface can accept almost anything.


Thank you very much!
Now it makes sense and I understand.


Re: Class Order Style

2017-02-22 Thread Jolly James via Digitalmars-d-learn
On Tuesday, 21 February 2017 at 23:06:23 UTC, Jonathan M Davis 
wrote:
On Tuesday, February 21, 2017 22:41:40 Lenny Lowood via 
Digitalmars-d-learn wrote:

[...]


It's completely a stylistic preference. There are a number of 
different ways to order your member variables and functions, 
and there are several different ways to apply attributes to 
them.


[...]


thank you!


About void[] and asockets

2017-02-22 Thread Jolly James via Digitalmars-d-learn
For sure, some might know ae. I am trying to use it as TcpServer. 
I got almost everything working fine concerning connection 
establishment and disconnecting. But there is one thing that 
makes it hard for me to understand, how to handle data.


https://github.com/CyberShadow/ae/blob/master/net/asockets.d

Well, what are these void-arrays for real? I mean, they contain 
data what does not make them really void, does it?


And how to I get received data out of Data.content[]?
How to use TcpConnection.send()? E.g. for sending a string?


Re: Class Order Style

2017-02-20 Thread Jolly James via Digitalmars-d-learn

On Monday, 20 February 2017 at 13:50:26 UTC, ketmar wrote:
just add ddoc documentation to 'em, and then it doesn't matter 
in which order they are declared: people will generate 
documentation to find out how to use your code. ;-)


ah okay, thx


But what about this?


class A
{
private:
   int a;
   int b;
public:
   int c;
   int d;
}

or

class A
{
   private
   {
   int a;
   int b;
   }
   public
   {
   int c;
   int d;
   }
}


Class Order Style

2017-02-20 Thread Jolly James via Digitalmars-d-learn

How to sort the members of a class?

like:

1. properties
then
2. private 3. methods
4. ctors

... and so on. are there any recommendations?


And what is better?


class A
{
private:
   int a;
   int b;
public:
   int c;
   int d;
}

or

class A
{
   private
   {
   int a;
   int b;
   }
   public
   {
   int c;
   int d;
   }
}


Re: Card on fire

2016-07-11 Thread Mike James via Digitalmars-d
On Sunday, 10 July 2016 at 02:43:42 UTC, Andrei Alexandrescu 
wrote:
Got a text from Walter - his famous fanless graphics card 
caught fire along with the motherboard. He'll be outta 
commission for a few days. -- Andrei


I hope he wasn't using it on the back of a camel in the desert...

http://forum.dlang.org/post/nl5hqu$1atc$1...@digitalmars.com



Re: DConf Videos

2016-07-01 Thread Mike James via Digitalmars-d

On Monday, 6 June 2016 at 16:22:18 UTC, Gary Willoughby wrote:

On Monday, 6 June 2016 at 10:40:01 UTC, sarn wrote:
What's the best source of DConf videos at the moment?  Are 
there are any edited versions released?


I'd like to share some of my favourite talks.


Also, where are the DConf 2016 videos? I was under the 
impression that they would be released on YouTube?


Yeh - it's taking its time. I'm not expecting Lawrence of Arabia 
quality...


-=mike=-


Re: Always false float comparisons

2016-05-16 Thread Mike James via Digitalmars-d

On Monday, 16 May 2016 at 06:46:59 UTC, Walter Bright wrote:

On 5/15/2016 10:37 PM, Manu via Digitalmars-d wrote:

[...]


Because, as I explained, that results in a 2x or more speed 
degradation (along with the loss of accuracy).




[...]


I used to do numerics work professionally. Most of the troubles 
I had were catastrophic loss of precision. Accumulated roundoff 
errors when doing numerical integration or matrix inversion are 
major problems. 80 bits helps dramatically with that.




A classic example... :-)


http://www.stsci.edu/~lbradley/seminar/butterfly.html



Re: Please mark off-topic discussions with [OT]

2016-05-14 Thread Mike James via Digitalmars-d

On Saturday, 14 May 2016 at 14:41:06 UTC, ZombineDev wrote:

On Saturday, 14 May 2016 at 14:32:03 UTC, Mike James wrote:
On Saturday, 14 May 2016 at 13:07:56 UTC, Andrei Alexandrescu 
wrote:
The thread "Github names & avatars" is not related to the D 
language, and adds much traffic to the forum. Please place 
[OT] in title when posting anything that is not releated to 
the D language.


Thanks,

Andrei


A lot of message forums have an "Off Topic" section for non 
subject related discussion. Why not create such a section?


Regards,
-=mike=-


At first I also thought about that, but since this is a mailing 
list and not a forum, it is not possible to move threads to 
different sections/groups, AFAIK.


Maybe create a "bikeshed" forum so topics can begin and end 
there... :-)


Regards,
-=mike=-



Re: Please mark off-topic discussions with [OT]

2016-05-14 Thread Mike James via Digitalmars-d
On Saturday, 14 May 2016 at 13:07:56 UTC, Andrei Alexandrescu 
wrote:
The thread "Github names & avatars" is not related to the D 
language, and adds much traffic to the forum. Please place [OT] 
in title when posting anything that is not releated to the D 
language.


Thanks,

Andrei


A lot of message forums have an "Off Topic" section for non 
subject related discussion. Why not create such a section?


Regards,
-=mike=-



Re: DWT fails to build with DMD 2.069.1

2015-11-18 Thread Mike James via Digitalmars-d-dwt
On Tuesday, 17 November 2015 at 20:16:48 UTC, Jacob Carlborg 
wrote:

On 2015-11-17 14:57, Mike James wrote:


Thanks.

Libraries and snippets (apart from snippet 288 - std.stream
depreacation) build ok.


Sorry about that. I forgot to update the snippets submodule, 
please try now.


Thanks.

All OK now :-)

Regards,

-=mike=-


Re: DWT fails to build with DMD 2.069.1

2015-11-17 Thread Mike James via Digitalmars-d-dwt

On Monday, 16 November 2015 at 20:52:53 UTC, Jacob Carlborg wrote:

On 2015-11-11 17:17, Mike James wrote:

Hi.

Is there an updated release of DWT for 2.069? There seems to 
be a

deprecation problem...


Should be working now (at least on Windows).


Thanks.

Libraries and snippets (apart from snippet 288 - std.stream 
depreacation) build ok.


Regards,
-=mike=-


Re: 2.069.0 Installation problem with .exe for Windows

2015-11-11 Thread Mike James via Digitalmars-d-announce
On Wednesday, 11 November 2015 at 03:13:18 UTC, Martin Nowak 
wrote:

On Tuesday, 10 November 2015 at 14:17:28 UTC, Mike James wrote:

The x64 sub-directory does not exist on my system.


We found the bug and I build a new installer with the fix.
https://dlang.dawg.eu/downloads/dmd.2.069.0~fix15824/
As soon as someone confirms the fix, we'll make a new point 
release.


Hi Martin,

I can confirm it installs correctly on:

Windows 10 64-bit.
Windows Vista 32-bit.
Windows 7 64-bit.

Thanks.

Regards,

-=mike=-


Re: 2.069.0 Installation problem with .exe for Windows

2015-11-10 Thread Mike James via Digitalmars-d-announce

On Monday, 9 November 2015 at 13:44:59 UTC, Martin Nowak wrote:

On 11/09/2015 09:46 AM, Mike James wrote:


Hi Martin,

I've tried the new install with Windows Vista and Windows 7 
and the problem is the same as before.


Regards,
-=mike=-


Can you try again, I updated the installer and tried to revert 
the other part of the change (though I don't see why that would 
fix the problem). More details would help a lot at this point, 
e.g. what windows are open (also look whether the uninstaller 
hides any window) and what files are left in the install dir 
(C:\D by default) while the installation hangs.


And let's please continue this in Bugzilla. 
https://issues.dlang.org/show_bug.cgi?id=15284


Hi Martin,

I've not got a login for the bug tracking so here is part of the 
log file...


Call: 2674
Jump: 2691
Jump: 2708
Check previous dmd installation
Check dmd already installed
Remove dmd already installed
MessageBox: 33,"DMD v2.068.2 is installed on your system

Press 'OK' to replace by DMD 2.069.0"
Call: 2734
Jump: 2756
Exec: command="C:\D\uninstall.exe /IC False _?=C:\D"
Exec: success ("C:\D\uninstall.exe /IC False _?=C:\D")
Exec: command="C:\D\uninstall.exe /IC False /S"
Exec: success ("C:\D\uninstall.exe /IC False /S")
Uninstall done
DetectVSAndSDK
Call: 2564
Read VisualStudio\*\Setup\VC
detect ucrt
detect KitsRoot*
IfFileExists: file "C:\Program Files\Microsoft 
SDKs\Windows\v7.0A\Lib\x64\kernel32.lib" does not exist, jumping 0
IfFileExists: file "C:\Program Files\Microsoft 
SDKs\Windows\v6.0A\Lib\x64\kernel32.lib" does not exist, jumping 0

detect KitsRoot*
IfFileExists: file "C:\Program Files\Microsoft 
SDKs\Windows\v7.0A\Lib\x64\kernel32.lib" does not exist, jumping 0
IfFileExists: file "C:\Program Files\Microsoft 
SDKs\Windows\v6.0A\Lib\x64\kernel32.lib" does not exist, jumping 0

detect KitsRoot*

with the last 2 lines repeating...

The x64 sub-directory does not exist on my system.

Hope this helps.

Regards,
-=mike=-



Re: 2.069.0 Installation problem with .exe for Windows

2015-11-09 Thread Mike James via Digitalmars-d-announce

On Sunday, 8 November 2015 at 23:33:31 UTC, Martin Nowak wrote:

On 11/04/2015 10:05 AM, Mike James wrote:

Copied here for extra visibility...

Hi.

There seems to be an install problem with the .exe version for 
Windows. The installer removes the old DMD then doesn't 
install the 2.069.0 version. In the task manager it's still 
running at 50% CPU time. It fails on Windows Vista and Windows 
7.


Could some try and verify that this installer fixes the issue. 
I wasn't able to reproduce the issue myself. 
https://dlang.dawg.eu/downloads/dmd.2.069.0~fix15824/


Hi Martin,

I've tried the new install with Windows Vista and Windows 7 and 
the problem is the same as before.


Regards,
-=mike=-


2.069.0 Installation problem with .exe for Windows

2015-11-04 Thread Mike James via Digitalmars-d-announce

Copied here for extra visibility...

Hi.

There seems to be an install problem with the .exe version for
Windows. The installer removes the old DMD then doesn't install
the 2.069.0 version. In the task manager it's still running at
50% CPU time. It fails on Windows Vista and Windows 7.

Regards,
--


Re: Release D 2.069.0

2015-11-04 Thread Mike James via Digitalmars-d-announce

On Wednesday, 4 November 2015 at 01:50:38 UTC, Martin Nowak wrote:

Glad to announce D 2.069.0.

http://dlang.org/download.html 
http://downloads.dlang.org/releases/2.x/2.069.0/


This is the first release with a self-hosted dmd compiler and 
comes with even more rangified phobos functions, 
std.experimental.allocator, and many other improvements.


See the changelog for more details. 
http://dlang.org/changelog/2.069.0.html


-Martin


Hi.

There seems to be an install problem with the .exe version for 
Windows. The installer removes the old DMD then doesn't install 
the 2.069.0 version. In the task manager it's still running at 
50% CPU time. It fails on Windows Vista and Windows 7.


Regards,
--


Re: D ranked as #25 by IEEE spectrum

2015-09-25 Thread Mike James via Digitalmars-d
On Friday, 25 September 2015 at 09:17:46 UTC, Jonathan M Davis 
wrote:

On Friday, 25 September 2015 at 08:45:08 UTC, Kagamin wrote:

[...]


Well, gnome is written entirely in C AFAIK, so it's definitely 
possible to write full-scale desktop applications in C without 
C++. But off the top of my head, I don't know of any C GUI 
toolkits other than GTK. All the rest are C++. And honestly, I 
don't understand why anyone would write large applications in C 
instead of C++, but there are definitely folks that prefer to 
do that.


[...]


IUP is written in C...

Regards, --


Re: Hello World Example with Glade?

2015-09-11 Thread Mike James via Digitalmars-d-learn

On Friday, 11 September 2015 at 06:45:07 UTC, Mike McKee wrote:

On Friday, 11 September 2015 at 06:00:39 UTC, Mike McKee wrote:

[...]


I think the start of this probably looks like the following, 
but I'm not certain:


import gtk;
import gobject.Type;
import std.stdio;
import std.c.process;

int main (string[] args)
{
Main.init(args);
Builder b = new Builder();
b.addFromFile("test1.glade");
Window w = cast(Window)b.getObject("window1");
w.showAll();
Main.run();
return 0;
}


Hi Mike,

There's a Glade example in the demos/builder directory...

Regards, --



...so, this assumed that I had a test1.glade file, and that I 
had this line inside it:




So now I need to figure out how to get GtkD installed on Ubuntu 
Linux 14.04.




Re: Hello World Example with Glade?

2015-09-11 Thread Mike James via Digitalmars-d-learn

On Friday, 11 September 2015 at 07:13:22 UTC, Mike McKee wrote:

On Friday, 11 September 2015 at 06:53:07 UTC, Mike James wrote:

There's a Glade example in the demos/builder directory...


I'm having trouble installing GtkD on Ubuntu Linux 14.04. I did 
the apt steps from here:


http://d-apt.sourceforge.net/

$ sudo su
# wget 
http://master.dl.sourceforge.net/project/d-apt/files/d-apt.list 
-O /etc/apt/sources.list.d/d-apt.list
# apt-get update && apt-get -y --allow-unauthenticated install 
--reinstall d-apt-keyring && apt-get update

# apt-get install libgtkd3-dev libgtkd3-doc

I then run the following and it fails:

# dmd test1.d
test1.d(1): Error: module gtk is in file 'gtk.d' which cannot 
be read

import path[0] = /usr/include/dmd/phobos
import path[1] = /usr/include/dmd/druntime/import



It looks last keep you're missing an import path 
(-Ipath_to_source). Check out 
http://dlang.org/dmd-linux.html#switches


Regards, --


Re: Hello World Example with Glade?

2015-09-11 Thread Mike James via Digitalmars-d-learn

On Friday, 11 September 2015 at 07:29:23 UTC, Mike McKee wrote:

On Friday, 11 September 2015 at 07:20:57 UTC, Mike James wrote:
It looks last keep you're missing an import path 
(-Ipath_to_source). Check out 
http://dlang.org/dmd-linux.html#switches


I tried this just now:

# dmd test1.d -I/usr/include/dmd/gtkd3/gtkc
/usr/include/dmd/gtkd3/gtkc/gtk.d(28): Error: module gtktypes 
is in file 'gtkc/gtktypes.d' which cannot be read

import path[0] = /usr/include/dmd/gtkd3/gtkc
import path[1] = /usr/include/dmd/phobos
import path[2] = /usr/include/dmd/druntime/import

It's saying that it can't read gtkc/gtktypes.d, but there is a 
file in path /usr/include/dmd/gtkd3/gtkc/gtktypes.d



try # dmd test1.d -I/usr/include/dmd/gtkd3

I'm using GtkD on Windows so there is a .../src directory with 
all the source files in.


regards, --


Re: Hello World Example with Glade?

2015-09-11 Thread Mike James via Digitalmars-d-learn

On Friday, 11 September 2015 at 07:47:15 UTC, Mike McKee wrote:

[...]


The undefined references mean you haven't provided a linker path 
to the GtkD libs.

Have you built the GtkD libraries?
Check out https://github.com/gtkd-developers/GtkD



Re: Interesting user mistake

2015-09-04 Thread Mike James via Digitalmars-d
On Friday, 4 September 2015 at 14:05:09 UTC, Jonathan M Davis 
wrote:
On Friday, 4 September 2015 at 13:55:03 UTC, Jonathan M Davis 
wrote:

[...]

[snip]

[...]


Isn't it called Maximal Munch...

https://en.wikipedia.org/wiki/Maximal_munch

Regards, --


Re: Current state of GUI's

2015-09-03 Thread Mike James via Digitalmars-d

On Thursday, 3 September 2015 at 12:19:25 UTC, motaito wrote:

Hi,

I haven't used D before and wanted to take a closer look at it. 
However, there are a few things that keep me from doing so. 
Most notably I am somewhat confused about the state of GUI's. I 
have looked at a couple projects and online resources, but the 
resources I found seam to be quite outdated. Sorry in advance, 
if I have missed some update on the topic. I wanted to ask, if 
there is something in the workings (or already done) to provide 
a standard way to create GUI's. Something supported by D, not 
an independent project. Independent projects tend to scare me 
away, as they almost always get abandoned at some point. I am 
looking for a cross platform (Windows, Linux, BSD) solution.


[...]


Have a look at GtkD and DWT - they are the most complete. I've 
written small apps using both and they work :-)
With GtkD you can use the Glade Builder to simplify design of the 
GUI elements.


Re: 1st Ever Artificial Consciousness to be Written in D Language

2015-09-03 Thread Mike James via Digitalmars-d-announce
On Wednesday, 2 September 2015 at 15:20:13 UTC, Rikki Cattermole 
wrote:

On 03/09/15 2:41 AM, GrandAxe wrote:

[...]


To save time maybe I should send my bank details right now... 
Western Union anyone?


--

[...]


That's quite a large set of features, considering the site 
still says 2014 for copyright I am sure it is worthy of being 
doubted.


I on the other hand hope it is indeed real and will succeed!
Would love to have my own digital personal assistant. Not that 
Cortana / Google Now really works for me.


Humpth maybe my evil bytecode dreams for D may be a good use 
case for it. After all, I'm sure being able to evaluate code 
could be quite useful.




Re: Reading and converting binary file 2 bits at a time

2015-08-29 Thread Mike James via Digitalmars-d-learn

On Saturday, 29 August 2015 at 20:15:53 UTC, Marc Schütz wrote:

Just cast to `Crumbs[]` directly:

import std.bitmanip;
import std.stdio;
import std.file;

struct Crumbs {
mixin(bitfields!(
ubyte, one,   2,
ubyte, two,   2,
ubyte, three, 2,
ubyte, four,  2
));
}

void main(string[] argv)
{
auto raw = read(binaryfile);
auto buffer = cast(Crumbs[]) raw;

foreach (cmb; buffer) {
writefln(Crumb one:   %s, cmb.one);
writefln(Crumb two:   %s, cmb.two);
writefln(Crumb three: %s, cmb.three);
writefln(Crumb four:  %s, cmb.four);
}
}


I like that :-)



Re: Reading and converting binary file 2 bits at a time

2015-08-27 Thread Mike James via Digitalmars-d-learn

On Thursday, 27 August 2015 at 09:00:02 UTC, Andrew Brown wrote:

Hi,

I need to read a binary file, and then process it two bits at a 
time. But I'm a little stuck on the first step. So far I have:


import std.file;
import std.stdio;

void main(){
  auto f = std.file.read(binaryfile);
  auto g = cast(bool[]) f;
  writeln(g);
}

but all the values of g then are just true, could you tell me 
what I'm doing wrong? I've also looked at the bitmanip module, 
I couldn't get it to help, but is that the direction I should 
be looking?


Thanks very much

Andrew


How about...

module main;

import std.bitmanip;
import std.stdio;

struct Crumbs {
@property ref ubyte whole() {
return m_whole;
}

union {
private ubyte m_whole;
mixin(bitfields!(
ubyte, one,   2,
ubyte, two,   2,
ubyte, three, 2,
ubyte, four,  2
));
}
}

void main(string[] argv)
{
ubyte[] buffer = [123, 12, 126, 244, 35];
Crumbs cmb;

foreach (octet; buffer) {
cmb.whole = octet;

writefln(Crumb:   %08b, octet);
writefln(Crumb one:   %s, cmb.one);
writefln(Crumb two:   %s, cmb.two);
writefln(Crumb three: %s, cmb.three);
writefln(Crumb four:  %s, cmb.four);
}
}


Regards, Mike.


Re: DWT fails to build with DMD 2.068.0

2015-08-25 Thread Mike James via Digitalmars-d-dwt

On Monday, 24 August 2015 at 12:55:50 UTC, Jacob Carlborg wrote:

On 2015-08-24 09:10, Mike James wrote:


Bump! :-)


Ah, sorry, completely forgot about this post. But the good news 
is that it's already merged :)


Hi Jacob,

when I try to build the latest I get this...


C:\D\gui\dwtrdmd build base swt
(in C:\D\gui\dwt)
Building dwt-base
workdir=C:\D\gui\dwt\base\src
dmd.exe @C:\D\gui\dwt\rsp
dmd.exe @C:\D\gui\dwt\rsp  C:\D\gui\dwt\olog.txt
Building org.eclipse.swt.win32.win32.x86
workdir=C:\D\gui\dwt\org.eclipse.swt.win32.win32.x86\src
dmd.exe @C:\D\gui\dwt\rsp
org\eclipse\swt\widgets\Table.d-mixin-125(125): Error: cannot 
cast expression WC_LISTVIEW of type const(wchar*) to 
const(wchar[])
org\eclipse\swt\widgets\Tree.d-mixin-139(139): Error: cannot cast 
expression WC_TREEVIEW of type const(wchar*) to const(wchar[])
org\eclipse\swt\widgets\Tree.d-mixin-141(141): Error: cannot cast 
expression WC_HEADER of type const(wchar*) to const(wchar[])
org\eclipse\swt\widgets\CoolBar.d-mixin-69(69): Error: cannot 
cast expression REBARCLASSNAME of type const(wchar*) to 
const(wchar[])
org\eclipse\swt\widgets\DateTime.d-mixin-67(67): Error: cannot 
cast expression DATETIMEPICK_CLASS of type const(wchar*) to 
const(wchar[])
org\eclipse\swt\widgets\DateTime.d-mixin-69(69): Error: cannot 
cast expression MONTHCAL_CLASS of type const(wchar*) to 
const(wchar[])
org\eclipse\swt\widgets\Link.d-mixin-80(80): Error: cannot cast 
expression WC_LINK of type const(wchar*) to const(wchar[])
org\eclipse\swt\widgets\ProgressBar.d(56): Error: cannot cast 
expression PROGRESS_CLASS of type const(wchar*) to const(wchar[])
org\eclipse\swt\widgets\Scale.d-mixin-59(59): Error: cannot cast 
expression TRACKBAR_CLASS of type const(wchar*) to const(wchar[])
org\eclipse\swt\widgets\Spinner.d-mixin-70(70): Error: cannot 
cast expression UPDOWN_CLASS of type const(wchar*) to 
const(wchar[])
org\eclipse\swt\widgets\TabFolder.d-mixin-72(72): Error: cannot 
cast expression WC_TABCONTROL of type const(wchar*) to 
const(wchar[])
org\eclipse\swt\widgets\ToolBar.d-mixin-71(71): Error: cannot 
cast expression TOOLBARCLASSNAME of type const(wchar*) to 
const(wchar[])

object.Exception@build.d(256): compile error

0x00404C46
0x004060B7
0x00403DD2
0x004182DA
0x004182AF
0x004181C3
0x00410AAB
0x771D3744 in BaseThreadInitThunk
0x77C9A064 in RtlSetCurrentTransaction
0x77C9A02F in RtlSetCurrentTransaction


Regards, Mike.


Re: DWT fails to build with DMD 2.068.0

2015-08-24 Thread Mike James via Digitalmars-d-dwt

On Tuesday, 11 August 2015 at 21:03:23 UTC, Jacob Carlborg wrote:

On 2015-08-11 10:23, Mike James wrote:

Is there an updated release for DWT - it fails to build with 
the latest

version of DMD - mainly casting errors...


There's an open pull request for adding support for 2.068.0. 
I'll take a look at it as soon as possible.


Bump! :-)


DWT fails to build with DMD 2.068.0

2015-08-11 Thread Mike James via Digitalmars-d-dwt

Hi,

Is there an updated release for DWT - it fails to build with the 
latest version of DMD - mainly casting errors...


Thanks.

Regards, Mike.


Converting Java code to D

2015-04-20 Thread Mike James via Digitalmars-d-learn

Here is a fragment of Java code from an SWT program...

public enum LineStyle {
NONE(None),
SOLID(Solid),
DASH(Dash),
DOT(Dot),
DASHDOT(Dash Dot),
DASHDOTDOT(Dash Dot Dot);

public final String label;

private LineStyle(String label) {
this.label = label;
}
}

What would be the best ('canonical') way of translating it to D?

Regards,

-=mike=-


Re: Converting Java code to D

2015-04-20 Thread Mike James via Digitalmars-d-learn

On Monday, 20 April 2015 at 17:28:27 UTC, John Colvin wrote:

On Monday, 20 April 2015 at 17:24:30 UTC, bearophile wrote:

John Colvin:


struct LineStyle
{
  enum NONE = None;
  enum SOLID = Solid;
  enum DASH = Dash;
  enum DOT = Dot;
  enum DASHDOT = Dash Dot;
  enum DASHDOTDOT = Dash Dot Dot;

  string label;

  private this(string label)
  {
  this.label = label;
  }
}


The constructor doesn't look very useful.

Perhaps a named enum is safer.

Bye,
bearophile


True, the constructor doesn't really add anything here.

To be honest, the combination of enumeration and runtime 
variables in the Java code seems like a rubbish design, but 
perhaps there's a good reason for it that I'm not aware of.


Maybe they extended enum to get over the lack of structs.

Looking at the spec for java enums it appears that you can return
an enumeration or the associated string using the original code.

Regards, -=mike=-


Re: DMD 2.067.0 Programming Language Specifications

2015-04-09 Thread Mike James via Digitalmars-d-announce

On Monday, 6 April 2015 at 12:04:40 UTC, Jordi Sayol wrote:
D Programming Language Specifications for dmd 2.067.0 in 
several formats, available at:

http://d-apt.sourceforge.net/


dlangspec-2.067.0.chm  --  (Microsoft Compiled HTML Help)

dlangspec-2.067.0.epub  --  (Electronic Publication for 
e-book readers)


dlangspec-2.067.0.mobi  --  (Mobipocket e-book for Kindle)

dlangspec-2.067.0.pdf  --  (Portable Document Format)


That's great.
Just a small observation - why does the kindle not remember the 
page when you close the mobile file then open it up again?


regards, -=mike=-


Re: DWT fails to build with DMD 2.067.0

2015-04-01 Thread Mike James via Digitalmars-d-dwt

On Tuesday, 31 March 2015 at 19:54:27 UTC, Jacob Carlborg wrote:

On 2015-03-31 21:09, Mike James wrote:

Hi,

When I run the build using dub I get the following errors...

java\lang\util.d(396): Deprecation: typedef is removed
java\lang\util.d(405): Deprecation: typedef is removed
java\nonstandard\Locale.d(66): Error: cannot append type 
string to type

wchar[]
java\nonstandard\Locale.d(89): Error: template instance
java.nonstandard.Locale.caltureNameI
error instantiating
object.Exception@build.d(251): compile error

0x00404C92
0x00405EA1
0x00403DD4
0x00417D32
0x00417D07
0x00417C1F
0x0041076F
0x751F7C04 in BaseThreadInitThunk
0x76F5B54F in RtlInitializeExceptionChain
0x76F5B51A in RtlInitializeExceptionChain


Is there an update for DWT using the latest D compiler?


Yes, should work now [1].

[1] 
https://github.com/d-widget-toolkit/dwt/commit/d43ce0cfec48c499cf43f4002e8916158b175847


Thanks.

Libs and snippets build no problem.

regards,
-=mike=-


extending 'import' using 'with'

2015-04-01 Thread Mike James via Digitalmars-d

Just a thought...

How about adding the keyword 'with' to 'import' to save on typing 
:-)


import  org.eclipse.swt.widgets.Canvas,
org.eclipse.swt.widgets.Composite,
org.eclipse.swt.events.DisposeListener,
org.eclipse.swt.events.DisposeEvent,
org.eclipse.swt.events.PaintListener,
org.eclipse.swt.events.PaintEvent;

import with (org.eclipse.swt) {
widgets.Canvas,
widgets.Composite,
events.DisposeListener,
events.DisposeEvent,
events.PaintListener,
events.PaintEvent;
}


Regards,

-=mike=-


Re: DlangUI

2015-03-26 Thread Mike James via Digitalmars-d-announce

On Tuesday, 20 May 2014 at 18:13:36 UTC, Vadim Lopatin wrote:

Hello!

I would like to announce my project, DlangUI library -

SNIP

Hi Vadim,

I have just installed the latest D 2.067.0, ran the git install 
and the build now fails. The errors are as follows:



C:\D\dmd2\gui\dlanguidub run dlangui:example1 --build=release
Building package dlangui:example1 in 
C:\D\dmd2\gui\dlangui\examples\example1\

Target gl3n 1.0.1 is up to date. Use --force to rebuild.
Building dlib ~master configuration library, build type release.
Running dmd...
..\..\..\..\Users\mikej\AppData\Roaming\dub\packages\dlib-master\dlib\image\io\jpeg.d(681): 
Warning: instead of C-style

syntax, use D-style syntax 'ubyte[64] dezigzag'
..\..\..\..\Users\mikej\AppData\Roaming\dub\packages\dlib-master\dlib\filesystem\windows\directory.d(77): 
Error: undefin

ed identifier wcslen
FAIL 
..\..\..\..\Users\mikej\AppData\Roaming\dub\packages\dlib-master\.dub\build\library-release-windows-x86-dmd_2067-17

3DBA1310DF90D85EA81F6AA09FBD95\ dlib staticLibrary
Error executing command run: dmd failed with exit code 1.


C:\D\dmd2\gui\dlangui

any clues?

Thanks.

Regards, Mike.


Re: DlangUI

2015-03-26 Thread Mike James via Digitalmars-d-announce

On Thursday, 26 March 2015 at 11:47:59 UTC, Vadim Lopatin wrote:

On Thursday, 26 March 2015 at 11:41:17 UTC, Mike James wrote:

On Tuesday, 20 May 2014 at 18:13:36 UTC, Vadim Lopatin wrote:

Hello!

I would like to announce my project, DlangUI library -

SNIP

Hi Vadim,

I have just installed the latest D 2.067.0, ran the git 
install and the build now fails. The errors are as follows:



C:\D\dmd2\gui\dlanguidub run dlangui:example1 --build=release
Building package dlangui:example1 in 
C:\D\dmd2\gui\dlangui\examples\example1\

Target gl3n 1.0.1 is up to date. Use --force to rebuild.
Building dlib ~master configuration library, build type 
release.

Running dmd...
..\..\..\..\Users\mikej\AppData\Roaming\dub\packages\dlib-master\dlib\image\io\jpeg.d(681): 
Warning: instead of C-style

syntax, use D-style syntax 'ubyte[64] dezigzag'
..\..\..\..\Users\mikej\AppData\Roaming\dub\packages\dlib-master\dlib\filesystem\windows\directory.d(77): 
Error: undefin

ed identifier wcslen
FAIL 
..\..\..\..\Users\mikej\AppData\Roaming\dub\packages\dlib-master\.dub\build\library-release-windows-x86-dmd_2067-17

3DBA1310DF90D85EA81F6AA09FBD95\ dlib staticLibrary
Error executing command run: dmd failed with exit code 1.


C:\D\dmd2\gui\dlangui

any clues?

Thanks.

Regards, Mike.


Try `dub upgrade --force-remove` followed by `dub build --force`


Thanks Vadim, That did the trick.

regards, -=mike=-


Re: A few notes on choosing between Go and D for a quick project

2015-03-24 Thread Mike James via Digitalmars-d

On Friday, 20 March 2015 at 20:34:36 UTC, Walter Bright wrote:

On 3/20/2015 8:25 AM, weaselcat wrote:
All of the content on rosettacode appears to be licensed under 
GNU FDL, I
believe it would just have to be released under the GNU FDL or 
a similar

copyleft license that fulfills the GNU FDL.


http://www.gnu.org/licenses/fdl-1.2.html

Sigh, looks like we can't use it.


Maybe bearophile can dual-licence them - he probably wrote most 
of them ;-)


-[=mike=-


Re: Would Lcl be better if it was in D?

2015-03-01 Thread Mike James via Digitalmars-d

On Sunday, 1 March 2015 at 20:41:30 UTC, Taylor Hillegeist wrote:
So I was using the Lazarus IDE the other day, and i thought to 
myself, what if i create an application with only a button in 
it. well it was easy enough to do. but behold I saw the 
executable and it was 14 MB, and I said 'well damn.' It seems 
to me that pascal does not do lazy inclusion when it comes to 
components of Lcl apart from pre-compiler directives.


I noticed some includes in d are inside of functions.

void foo() {
 import thingIneed:subfoo;
 subfoo();
}

would this allow people to use a large library like LCL but 
with much smaller executables?


Turn off the debug build - it's then only a few meg...

-Mike-


Re: DlangUI

2015-02-02 Thread Mike James via Digitalmars-d-announce

Hi Vadim,

When I follow the Build and Run Demo App using DUB I get the 
following...


C:\D\dmd2\srcgit clone https://github.com/buggins/dlangui.git
Cloning into 'dlangui'...
remote: Counting objects: 13291, done.
remote: Compressing objects: 100% (186/186), done.
remote: Total 13291 (delta 113), reused 0 (delta 0)
Receiving objects: 100% (13291/13291), 8.78 MiB | 538.00 KiB/s, 
done.

Resolving deltas: 100% (10144/10144), done.

C:\D\dmd2\srccd dlangui

C:\D\dmd2\src\dlanguidub run dlangui:example1 --build=release
Building package dlangui:example1 in 
C:\D\dmd2\src\dlangui\examples\example1\

Fetching derelict-util 1.9.1 (getting selected version)...
Placing derelict-util 1.9.1 to 
C:\Users\mikej\AppData\Roaming\dub\packages\...

Building dlib 0.4.1 configuration library, build type release.
Running dmd...
Building derelict-util 1.9.1 configuration library, build type 
release.

Running dmd...
Building derelict-ft 1.0.1 configuration library, build type 
release.

Running dmd...
Building derelict-sdl2 1.9.1 configuration library, build type 
release.

Running dmd...
Building derelict-gl3 1.0.12 configuration library, build type 
release.

Running dmd...
Building dlangui:dlanguilib 0.4.35+commit.4.gf902ceb 
configuration library, build type release.

Running dmd...
src\dlangui\graphics\resources.d(152): Error: file 
btn_background.xml\x0d cannot be found or not in a path 
specified with -J
src\dlangui\graphics\resources.d(153): Error: data.length cannot 
be evaluated at compile time
src\dlangui\graphics\resources.d(166): Error: template instance 
dlangui.graphics.resources.embedResource!res/btn_background.xml\x0d 
error instantiating src\dlangui\graphics\resources.d(173):


Is the setup missing extra directories?

Regards, -=mike=-


Re: Anyone interested in embedding a JVM in their D app?

2015-01-14 Thread james via Digitalmars-d-announce
I think the goal of this may be backwards of what most people are 
thinking.


What I am trying for is not to write extensions to a java app in 
D through JNI.  Anyone is welcome to use any of this work to 
achieve that if they'd like.


The actual goal is to embed a JVM inside of a D program.  This is 
actually a practice from C++ that happens more than one would 
think.  This also makes several things easier as the D subsystem 
is correctly initialized.


There are several things that come with Java APIs only.  A few 
that come to mind are some database drivers (hsql recommends 
doing JNI from C++ to Java to use their driver).  Anyone familiar 
with hadoop, their remote file system driver is the same way (in 
older versions anyways).  They do provide a c library that does 
the embedding for you (so you may not of noticed).


There are other languages that do this to take advantage of the 
massive amount of DB support in java (last time I checked that's 
how DB drivers in R worked).


Anyone familiar with doing this from C or C++ knows it looks 
nothing like java though.


If you look at https://github.com/jamesmahler/djvm#example ... 
that's the equivalent of System.out.println(100) with the 
cleaned up api in djvm.


While using JNI inside a java app is messy... using JNI inside a 
C app is sometimes way easier.


Anyways, you are free to continue discussing trying to use D in 
Android.  I'd be willing to share any information and try to 
assist with that project as able.


On Wednesday, 14 January 2015 at 09:29:25 UTC, Russel Winder via 
Digitalmars-d-announce wrote:
On Wed, 2015-01-14 at 02:00 +, james via 
Digitalmars-d-announce

wrote:

I've been playing with jni.h and D.  I think I've got a fully
working jni.d and I have the start of a nicer D wrapper around 
it

with djvm.d.



Whilst I have tinkered with JNI, I have never had to really use 
it in
anger. And I, and many others, really want to keep it that way 
even
though there are many who use it. It's like trying to program 
Python

from C, only worse performance.

There is JNA of course, which does some similar stuff, many use 
that I

have never used it.

The current fashion is (or will be) JNR (which leads to JEP 
191).


As far as I know JNA, JNR (and JEP 191) use JNI, more or less 
because

they have to. The issue is to make using the adaptor as easy as
possible. JNI is not easy; JNA is easy but slow; JNR is 
supposedly easy

and fast, so hopefully JEP 191 will be.




Anyone interested in embedding a JVM in their D app?

2015-01-13 Thread james via Digitalmars-d-announce

I've been playing with jni.h and D.  I think I've got a fully
working jni.d and I have the start of a nicer D wrapper around it
with djvm.d.

https://github.com/jamesmahler/djvm

There is an example usage in the README.md.  There's also why I'd
do such a thing in there.

I'm not sure if anyone else would be interested in this.  I'm
open to help and merge requests if anyone wants to join in.

In the short term, I still have several low level things to wrap
with the more D interfaces.

In the longer term, I want to have D interfaces around JDBC.


Re: NASA/JPL Rules for writing Critical Software

2015-01-09 Thread Mike James via Digitalmars-d
Walter Bright newshou...@digitalmars.com wrote in message 
news:m8n4c2$2ovq$1...@digitalmars.com...

http://pixelscommander.com/wp-content/uploads/2014/12/P10.pdf


Misra is also a good set of guidelines to follow...

http://www.misra.org.uk/

-=mike=- 



  1   2   >