Re: Write native GUI applications for Windows

2017-12-18 Thread Zz via Digitalmars-d-learn

On Monday, 18 December 2017 at 08:49:51 UTC, Binghoo Dang wrote:

On Monday, 18 December 2017 at 07:55:25 UTC, Andrey wrote:

Hello!
I have a question about creating native GUI applications for 
Windows 7 or/and Windows 10.
I know that exist DWT, DlangUI and other... But I'm 
interesting in native GUI. If it will be C++ then I would use 
WinAPI from SDK.
And what about D? What should I do? Make some kind of wrapper 
above C WinApi?
I also know that on GitHub exists such wrapper 
(https://github.com/AndrejMitrovic/DWinProgramming) but it is 
old - last commit was 4 years ago.


Could you help me?


You can use libuid which can be found here 
https://code.dlang.org/packages/libuid.


It wrapped the native os gui for d, and it's cross-platform.


Any chance of having a version that allows static linking?

Zz


Re: Guide - Migrating from std.experimental.ndslice to mir-algorithm

2017-06-03 Thread Zz via Digitalmars-d-learn

On Saturday, 3 June 2017 at 05:21:13 UTC, 9il wrote:

On Friday, 2 June 2017 at 16:08:20 UTC, Zz wrote:

Hi,

Just tried migrating from std.experimental.ndslice to 
mir-algorithm.


Is there a guide on how migrate old code?

I used the following imports before and using then with 
ndslice.


import std.experimental.ndslice;
import std.algorithm : each, max, sort;
import std.range : iota, repeat;

simplified example of how it was used.
auto a = cr.iota.sliced(r, c);
auto b = a.reshape(c, r).transposed!1;

auto c = a.reversed!1;
auto d = a.reshape(c, r).transposed!1.reversed!1;

auto f = new int[cr].sliced(r, c);
auto h = f.transposed(1);

how can I do the following in mir-algorithm.

Note: I will be going through the documentation.

Zz


Hello Zz,

std.experimental.ndslice -> mir.ndslice

std.range : iota, repeat -> mir.ndslice.topology: iota, repeat;
std.algorithm : each; -> mir.ndslice.algorithm: each;
std.algorithm : max; -> mir.utility: max;
std.algorithm : sort; -> mir.ndslice.sorting: sort;


Note, that Mir functions has different semantics compared with 
Phobos!
For example, each iterates deep elements, so should be combined 
with `pack` to iterates rows instead of elements.


Ndslices work with Phobos functions but it is suggested to use 
Mir analogs if any.


// Mir's iota! It is already 2D ndslice :-)
auto a = [r, c].iota;

auto b = a
   // returns flattened iota, a has Contiguous kind,
   // so the result type would be equal to `iota(r*c)`
.flattened
// convert 1D iota ndslice to 2D iota ndslice
.sliced(c, r)
// It is required to use transposed
// Convert ndslice kind from Contiguous to Universal.
.universal
// Transpose the Universal ndslice
.transposed;

auto c = a.universal.reversed!1;
auto d = a.flattened.sliced(c, 
r).universal.transposed!1.reversed!1; // see also `rotated`


auto f = slice!int(c, r); // new int[cr].sliced(r, c); works 
too.

auto h = f.universal.transposed(1);

---
Mir ndslices have three kinds: 
http://docs.algorithm.dlang.io/latest/mir_ndslice_slice.html#.SliceKind


If you have any questions feel free to ask at the Gitter:
https://gitter.im/libmir/public

Best,
Ilya

Best,
Ilya


Thanks


Guide - Migrating from std.experimental.ndslice to mir-algorithm

2017-06-02 Thread Zz via Digitalmars-d-learn

Hi,

Just tried migrating from std.experimental.ndslice to 
mir-algorithm.


Is there a guide on how migrate old code?

I used the following imports before and using then with ndslice.

import std.experimental.ndslice;
import std.algorithm : each, max, sort;
import std.range : iota, repeat;

simplified example of how it was used.
auto a = cr.iota.sliced(r, c);
auto b = a.reshape(c, r).transposed!1;

auto c = a.reversed!1;
auto d = a.reshape(c, r).transposed!1.reversed!1;

auto f = new int[cr].sliced(r, c);
auto h = f.transposed(1);

how can I do the following in mir-algorithm.

Note: I will be going through the documentation.

Zz





Re: ndslice help

2016-02-18 Thread Zz via Digitalmars-d-learn

On Thursday, 18 February 2016 at 02:24:20 UTC, ZombineDev wrote:

On Thursday, 18 February 2016 at 00:25:09 UTC, Zz wrote:

Hi,

I'm trying to generate the following sequences with ndslice.

0 0 0
1 1 1

1 1 1
0 0 0

0 1 2
0 1 2

2 1 0
2 1 0

It's okay with loops but was checking to see if it's possible 
with ndslice.


Zz


Here's my solution:
http://dpaste.dzfl.pl/29676608fd88

The best part about ndslice is that you can use the ordinary 
slice operations with it like:

http://dlang.org/spec/arrays.html#array-copying,
http://dlang.org/spec/arrays.html#array-setting,
http://dlang.org/spec/arrays.html#array-operations, etc.

and also leverage the existing ranges, range transformations 
and algorithms from

http://dlang.org/phobos/std_range and
http://dlang.org/phobos/std_algorithm.

In addition, I used nested array formatting with
http://dlang.org/phobos/std_format.


Thanks

Zz


ndslice help

2016-02-17 Thread Zz via Digitalmars-d-learn

Hi,

I'm trying to generate the following sequences with ndslice.

0 0 0
1 1 1

1 1 1
0 0 0

0 1 2
0 1 2

2 1 0
2 1 0

It's okay with loops but was checking to see if it's possible 
with ndslice.


Zz


ndslice help.

2015-12-30 Thread Zz via Digitalmars-d-learn

Hi,

Just playing with ndslice and I couldn't figure how to get the 
following transformations.


given.

auto slicea = sliced(iota(6), 2, 3, 1);
foreach (item; slicea)
{
   writeln(item);
}

which gives.

[[0][1][2]]
[[3][4][5]]

what transformation should i do to get the following from slicea.

[[0][2][4]]
[[1][3][5]]

[[4][2][0]]
[[5][3][1]]

Zz






Re: ndslice help.

2015-12-30 Thread Zz via Digitalmars-d-learn
On Wednesday, 30 December 2015 at 20:43:21 UTC, Ilya Yaroshenko 
wrote:

On Wednesday, 30 December 2015 at 18:53:15 UTC, Zz wrote:

Hi,

Just playing with ndslice and I couldn't figure how to get the 
following transformations.


given.

auto slicea = sliced(iota(6), 2, 3, 1);
foreach (item; slicea)
{
   writeln(item);
}

which gives.

[[0][1][2]]
[[3][4][5]]

what transformation should i do to get the following from 
slicea.


[[0][2][4]]
[[1][3][5]]

[[4][2][0]]
[[5][3][1]]

Zz


Hi,

void main()
{
auto slicea = sliced(iota(6), 2, 3, 1);
auto sliceb = slicea.reshape(3, 2, 1).transposed!1;
auto slicec = sliceb.reversed!1;

writefln("%(%(%(%s%)\n%)\n\n%)", [slicea, sliceb, slicec]);
}

Output:
[0][1][2]
[3][4][5]

[0][2][4]
[1][3][5]

[4][2][0]
[5][3][1]

Ilya


Thanks