Re: Software validation

2018-06-04 Thread Petar via Digitalmars-d

On Monday, 4 June 2018 at 15:48:35 UTC, DigitalDesigns wrote:
Does D have any methods of validating code in a natural manner 
besides unit tests and contracts?


I'm specifically thinking of validating mathematical 
calculations and boolean operations that could depend on very 
improbable scenarios but are technically invalid logic.


These issues tend to creep up in calculations that involve 
floating points due to various reasons or comparisons that 
mistakenly use > for >= or vice versa.


If I have a variable such as a buffer which has a length and an 
offset in to that buffer is calculated using double precision 
then rounding errors could cause the offset to except the 
length and create an access violation.


To be able to theoretically test all the possibilities all 
valid inputs would need to be checked. One can setup unit tests 
to test these possibilities but it can be difficult to cover 
all cases in even a semi-complex program.


Just curious if something exists that allows for mathematical 
validation such code in an relatively canonical way. This isn't 
too hard for pure functions but dealing with non-pure functions 
can be a pain.


Perhaps not quite what you're looking for, but I think you would 
be interested in the LLVM fuzzing part of Johan Engelen's talk at 
DConf 2018:

https://www.youtube.com/watch?v=GMKvYrjaaoU (at around 34:30).


Re: stride in slices

2018-06-04 Thread David Bennett via Digitalmars-d

On Tuesday, 5 June 2018 at 05:05:47 UTC, David Bennett wrote:

On Tuesday, 5 June 2018 at 03:13:05 UTC, Meta wrote:


14 ms, 520 μs, and 4 hnsecs
13 ms, 87 μs, and 2 hnsecs
12 ms, 938 μs, and 8 hnsecs


When using `dmd -inline -O -release` with an extra simd 
benchmark I get:


for loop:21 ms, 291 μs, and 6 hnsecs
stride/fill: 64 ms, 927 μs, and 9 hnsecs
stride/each: 52 ms, 740 μs, and 8 hnsecs
simd &=: 6 ms, 900 μs, and 8 hnsecs

https://run.dlang.io/gist/5fe73cbf9943aa57be1101e597bb25e4?args=-inline%20-O%20-release

Though the simd version does not work in ldc...


Here's a version that works in ldc:

https://run.dlang.io/gist/1d4bb542427fb82cc455fe9dc30185d7?compiler=ldc&args=-inline%20-O4%20-release

for loop:16 ms, 594 μs, and 1 hnsec
stride/fill: 14 ms, 918 μs, and 9 hnsecs
stride/each: 14 ms and 813 μs
simd &=: 7 ms, 153 μs, and 6 hnsecs



Re: stride in slices

2018-06-04 Thread David Bennett via Digitalmars-d

On Tuesday, 5 June 2018 at 03:13:05 UTC, Meta wrote:


14 ms, 520 μs, and 4 hnsecs
13 ms, 87 μs, and 2 hnsecs
12 ms, 938 μs, and 8 hnsecs


When using `dmd -inline -O -release` with an extra simd benchmark 
I get:


for loop:21 ms, 291 μs, and 6 hnsecs
stride/fill: 64 ms, 927 μs, and 9 hnsecs
stride/each: 52 ms, 740 μs, and 8 hnsecs
simd &=: 6 ms, 900 μs, and 8 hnsecs

https://run.dlang.io/gist/5fe73cbf9943aa57be1101e597bb25e4?args=-inline%20-O%20-release

Though the simd version does not work in ldc...


Re: stride in slices

2018-06-04 Thread Meta via Digitalmars-d

On Monday, 4 June 2018 at 23:08:17 UTC, Ethan wrote:
On Monday, 4 June 2018 at 18:11:47 UTC, Steven Schveighoffer 
wrote:

BTW, do you have cross-module inlining on?


Just to drive this point home.

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

Manually implemented stride and fill with everything forced 
inline. Otherwise, the original code is unchanged.


17 ms, 891 μs, and 6 hnsecs
15 ms, 694 μs, and 1 hnsec
15 ms, 570 μs, and 9 hnsecs

My new stride outperformed std.range stride, and the manual 
for-loop. And, because the third test uses the new stride, it 
also benefited. But interestingly runs every so slightly 
faster...


Just as an aside:

...
pragma( inline ) @property length() const { return 
range.length / strideCount; }
pragma( inline ) @property empty() const { return currFront > 
range.length; }
pragma( inline ) @property ref Elem front() { return range[ 
currFront ]; }

pragma( inline ) void popFront() { currFront += strideCount; }
...

pragma( inline ) auto stride( Range )( Range r, int a )
...

pragma( inline ) auto fill( Range, Value )( Range r, Value v )
...

pragma(inline), without any argument, does not force inlining. It 
actually does nothing; it just specifies that the 
"implementation's default behaviour" should be used. You have to 
annotate with pragma(inline, true) to force inlining 
(https://dlang.org/spec/pragma.html#inline).


When I change all the pragma(inline) to pragma(inline, true), 
there is a non-trivial speedup:


14 ms, 517 μs, and 9 hnsecs
13 ms, 110 μs, and 1 hnsec
13 ms, 199 μs, and 9 hnsecs

There's further reductions using ldc-beta:

14 ms, 520 μs, and 4 hnsecs
13 ms, 87 μs, and 2 hnsecs
12 ms, 938 μs, and 8 hnsecs


Re: stride in slices

2018-06-04 Thread Ethan via Digitalmars-d
On Monday, 4 June 2018 at 18:11:47 UTC, Steven Schveighoffer 
wrote:

BTW, do you have cross-module inlining on?


Just to drive this point home.

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

Manually implemented stride and fill with everything forced 
inline. Otherwise, the original code is unchanged.


17 ms, 891 μs, and 6 hnsecs
15 ms, 694 μs, and 1 hnsec
15 ms, 570 μs, and 9 hnsecs

My new stride outperformed std.range stride, and the manual 
for-loop. And, because the third test uses the new stride, it 
also benefited. But interestingly runs every so slightly faster...


Re: stride in slices

2018-06-04 Thread DigitalDesigns via Digitalmars-d

On Monday, 4 June 2018 at 17:40:57 UTC, Dennis wrote:
On Monday, 4 June 2018 at 15:43:20 UTC, Steven Schveighoffer 
wrote:
Note, it's not going to necessarily be as efficient, but it's 
likely to be close.


-Steve


I've compared the range versions with a for-loop. For integers 
and longs or high stride amounts the time is roughly equal, but 
for bytes with low stride amounts it can be up to twice as slow.

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

50 Mb array, type = byte, stride = 3, compiler = LDC -O4 
-release

For-loop  18 ms
Fill(0)   33 ms
each! 33 ms

With stride = 13:
For-loop  7.3 ms
Fill(0)   7.5 ms
each! 7.8 ms



This is why I wanted to make sure! I would be using it for a 
stride of 2 and it seems it might have doubled the cost for no 
other reason than using ranged. Ranges are great but one can't 
reason about what is happening in then as easy as a direct loop 
so I wanted to be sure. Thanks for running the test!






Re: D on top of Hacker News!

2018-06-04 Thread I love Ice Cream via Digitalmars-d

On Monday, 4 June 2018 at 19:21:22 UTC, Ethan wrote:

On Monday, 4 June 2018 at 19:17:47 UTC, I love Ice Cream wrote:
It seems you guys are undercutting the results because you 
don't like them:


Never mind that it is a commonly accepted criticism of the 
Tiobe index. Someone on the internet wants to strawman, so it 
must be valid!


(The only source you listed there that would give unbiased 
search results is Wikipedia. Every other aggregate engine 
weighs results per user.


Can you name something without valid criticisms? Things could 
always be done better. But that doesn't mean they aren't useful. 
In this case it isn't meant to be an all encompassing answer, 
just a viewpoint that suggests a particular answer.


Re: D on top of Hacker News!

2018-06-04 Thread I love Ice Cream via Digitalmars-d

On Monday, 4 June 2018 at 19:17:47 UTC, I love Ice Cream wrote:

On Monday, 4 June 2018 at 16:05:24 UTC, rikki cattermole wrote:

On 05/06/2018 3:56 AM, I love Ice Cream wrote:

On Monday, 4 June 2018 at 11:14:42 UTC, bauss wrote:
On Sunday, 3 June 2018 at 17:40:46 UTC, I love Ice Cream 
wrote:
Is D really a top 20 language? I don't remember seeing it 
anywhere close to the top 20.



https://www.tiobe.com/tiobe-index/ has them in 31


Top comment is kind of depressing.


Tiobe is based on Google searches, so it's not relevant 
anymore.


Since when is Google not relevant?


Google modifies search results per person/client and can hide 
results out right if it chooses to (unconfirmed, but its a 
good guess).


When it comes to analysis it does not qualify as a research 
source anymore. It is merely a starting point for your 
research and does not play a major role.


It seems you guys are undercutting the results because you 
don't like them:


The index covers searches in Google, Google Blogs, MSN, 
Yahoo!, Baidu, Wikipedia and YouTube.


http://githut.info/

http://pypl.github.io/PYPL.html

http://sogrady-media.redmonk.com/sogrady/files/2018/03/lang.rank_.118.png

https://spectrum.ieee.org/computing/software/the-2017-top-programming-languages

https://insights.stackoverflow.com/survey/2016

Looks consistent with other results.


Re: D on top of Hacker News!

2018-06-04 Thread Ethan via Digitalmars-d

On Monday, 4 June 2018 at 19:17:47 UTC, I love Ice Cream wrote:
It seems you guys are undercutting the results because you 
don't like them:


Never mind that it is a commonly accepted criticism of the Tiobe 
index. Someone on the internet wants to strawman, so it must be 
valid!


(The only source you listed there that would give unbiased search 
results is Wikipedia. Every other aggregate engine weighs results 
per user.


Re: D on top of Hacker News!

2018-06-04 Thread I love Ice Cream via Digitalmars-d

On Monday, 4 June 2018 at 16:05:24 UTC, rikki cattermole wrote:

On 05/06/2018 3:56 AM, I love Ice Cream wrote:

On Monday, 4 June 2018 at 11:14:42 UTC, bauss wrote:
On Sunday, 3 June 2018 at 17:40:46 UTC, I love Ice Cream 
wrote:
Is D really a top 20 language? I don't remember seeing it 
anywhere close to the top 20.



https://www.tiobe.com/tiobe-index/ has them in 31


Top comment is kind of depressing.


Tiobe is based on Google searches, so it's not relevant 
anymore.


Since when is Google not relevant?


Google modifies search results per person/client and can hide 
results out right if it chooses to (unconfirmed, but its a good 
guess).


When it comes to analysis it does not qualify as a research 
source anymore. It is merely a starting point for your research 
and does not play a major role.


It seems you guys are undercutting the results because you don't 
like them:


The index covers searches in Google, Google Blogs, MSN, Yahoo!, 
Baidu, Wikipedia and YouTube.


Re: stride in slices

2018-06-04 Thread Dennis via Digitalmars-d
On Monday, 4 June 2018 at 18:11:47 UTC, Steven Schveighoffer 
wrote:
BTW, do you have cross-module inlining on? I wonder if that 
makes a difference if you didn't have it on before. (I'm 
somewhat speaking from ignorance, as I've heard people talk 
about this limitation, but am not sure exactly when it's 
enabled)


I don't know much about this either. Clang has link-time 
optimization with -O4, but looking at the --help of LDC it turns 
out -O4 is equivalent to -O3 for D. Maybe someone else knows?




Re: stride in slices

2018-06-04 Thread Steven Schveighoffer via Digitalmars-d

On 6/4/18 1:40 PM, Dennis wrote:

On Monday, 4 June 2018 at 15:43:20 UTC, Steven Schveighoffer wrote:
Note, it's not going to necessarily be as efficient, but it's likely 
to be close.


I've compared the range versions with a for-loop. For integers and longs 
or high stride amounts the time is roughly equal, but for bytes with low 
stride amounts it can be up to twice as slow.

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

50 Mb array, type = byte, stride = 3, compiler = LDC -O4 -release
For-loop  18 ms
Fill(0)   33 ms
each! 33 ms

With stride = 13:
For-loop  7.3 ms
Fill(0)   7.5 ms
each! 7.8 ms


Interesting!

BTW, do you have cross-module inlining on? I wonder if that makes a 
difference if you didn't have it on before. (I'm somewhat speaking from 
ignorance, as I've heard people talk about this limitation, but am not 
sure exactly when it's enabled)


-Steve


Re: stride in slices

2018-06-04 Thread Dennis via Digitalmars-d
On Monday, 4 June 2018 at 15:43:20 UTC, Steven Schveighoffer 
wrote:
Note, it's not going to necessarily be as efficient, but it's 
likely to be close.


-Steve


I've compared the range versions with a for-loop. For integers 
and longs or high stride amounts the time is roughly equal, but 
for bytes with low stride amounts it can be up to twice as slow.

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

50 Mb array, type = byte, stride = 3, compiler = LDC -O4 -release
For-loop  18 ms
Fill(0)   33 ms
each! 33 ms

With stride = 13:
For-loop  7.3 ms
Fill(0)   7.5 ms
each! 7.8 ms




Re: gRPC in D

2018-06-04 Thread aberba via Digitalmars-d

On Monday, 4 June 2018 at 11:40:54 UTC, Nicholas Wilson wrote:

On Monday, 4 June 2018 at 11:21:57 UTC, aberba wrote:
At DConf 2018,there was a talk by ?? about blockchain and gRPC 
library for D came up.


That was Kai Nacke.


Thanks :)


Re: Pyd updates

2018-06-04 Thread Laeeth Isharc via Digitalmars-d

On Monday, 4 June 2018 at 01:17:31 UTC, Norm wrote:

On Monday, 4 June 2018 at 00:53:26 UTC, ROB wrote:
On Wednesday, 12 July 2006 at 23:35:55 UTC, Kirk McDonald 
wrote:

[...]


has there been any updates since July 2006 there does not seem 
to be any new msg's since unless you have forked this forum to 
a new location.  if you have please provide I am new to D I 
have been learning python for some time and thought Python and 
D would work well together.


Also are there any Projects using it yet I would like to get 
involved and contribute if possible.


Try this repo:

https://github.com/ariovistus/pyd
https://github.com/ariovistus/pyd/wiki


https://github.com/kaleidicassociates/autowrap
makes using PyD a little simpler.




Re: D on top of Hacker News!

2018-06-04 Thread rikki cattermole via Digitalmars-d

On 05/06/2018 3:56 AM, I love Ice Cream wrote:

On Monday, 4 June 2018 at 11:14:42 UTC, bauss wrote:

On Sunday, 3 June 2018 at 17:40:46 UTC, I love Ice Cream wrote:
Is D really a top 20 language? I don't remember seeing it anywhere 
close to the top 20.



https://www.tiobe.com/tiobe-index/ has them in 31


Top comment is kind of depressing.


Tiobe is based on Google searches, so it's not relevant anymore.


Since when is Google not relevant?


Google modifies search results per person/client and can hide results 
out right if it chooses to (unconfirmed, but its a good guess).


When it comes to analysis it does not qualify as a research source 
anymore. It is merely a starting point for your research and does not 
play a major role.


Re: D on top of Hacker News!

2018-06-04 Thread I love Ice Cream via Digitalmars-d

On Monday, 4 June 2018 at 11:14:42 UTC, bauss wrote:

On Sunday, 3 June 2018 at 17:40:46 UTC, I love Ice Cream wrote:
Is D really a top 20 language? I don't remember seeing it 
anywhere close to the top 20.



https://www.tiobe.com/tiobe-index/ has them in 31


Top comment is kind of depressing.


Tiobe is based on Google searches, so it's not relevant anymore.


Since when is Google not relevant?


Software validation

2018-06-04 Thread DigitalDesigns via Digitalmars-d
Does D have any methods of validating code in a natural manner 
besides unit tests and contracts?


I'm specifically thinking of validating mathematical calculations 
and boolean operations that could depend on very improbable 
scenarios but are technically invalid logic.


These issues tend to creep up in calculations that involve 
floating points due to various reasons or comparisons that 
mistakenly use > for >= or vice versa.


If I have a variable such as a buffer which has a length and an 
offset in to that buffer is calculated using double precision 
then rounding errors could cause the offset to except the length 
and create an access violation.


To be able to theoretically test all the possibilities all valid 
inputs would need to be checked. One can setup unit tests to test 
these possibilities but it can be difficult to cover all cases in 
even a semi-complex program.


Just curious if something exists that allows for mathematical 
validation such code in an relatively canonical way. This isn't 
too hard for pure functions but dealing with non-pure functions 
can be a pain.


Re: stride in slices

2018-06-04 Thread Steven Schveighoffer via Digitalmars-d

On 6/3/18 7:13 AM, DigitalDesigns wrote:

On Sunday, 3 June 2018 at 07:30:56 UTC, Meta wrote:

On Saturday, 2 June 2018 at 18:49:51 UTC, DigitalDesigns wrote:

Proposal:

[a..b;m]

m is the stride, if ; is not a good char then |, :, !, or # could be 
good chars.


This is exactly what std.range.stride does. The syntax [a..b;m] 
directly translates to [a..b].stride(m).



So, can I do

X[a..b].stride(m) = 0;


X[a..b].stride(m).fill(0);

? Just curious because if it is exactly the same notion then I should be 
able to do it, right?


You are confusing range and array syntax. All of what you want exists, 
but isn't necessarily using the same syntax.


Of course, I'm sure another hoop could be created to jump through and it 
will work, will it still be exactly the same though?


If there is an efficient and optimal setting so one could get the same 
effect, then I guess it might be a direct translation. If not then it 
isn't.


What I am looking for is a sort of zeromemory or memset with stride. It 
should not allocate a new array or be significantly slower. I'd like 
some proof that they are "equivalent" such as a disassembly or a 
profiling... just to satisfy my own skepticism.


fill is what you are looking for.

Note, it's not going to necessarily be as efficient, but it's likely to 
be close.


-Steve


Re: stride in slices

2018-06-04 Thread Paul Backus via Digitalmars-d

On Sunday, 3 June 2018 at 11:13:52 UTC, DigitalDesigns wrote:

On Sunday, 3 June 2018 at 07:30:56 UTC, Meta wrote:

On Saturday, 2 June 2018 at 18:49:51 UTC, DigitalDesigns wrote:

Proposal:

[a..b;m]

m is the stride, if ; is not a good char then |, :, !, or # 
could be good chars.


This is exactly what std.range.stride does. The syntax 
[a..b;m] directly translates to [a..b].stride(m).



So, can I do

X[a..b].stride(m) = 0;


You can use std.algorithm.iteration.each to modify a range 
in-place:


https://run.dlang.io/is/2jjZHh


Re: ost to pst convertes

2018-06-04 Thread jonshenalina via Digitalmars-d

On Monday, 26 March 2018 at 08:36:42 UTC, Blackwellwalker wrote:

Hi,

My user used exchange in the past and now uses pop3 client... 
exchange doesn't exist anymore. her new pop client only has one 
pst data file... one can't import the ost files.  How convert 
ost to pst?


Need OST to PST Converter recommendations

Due to hard drive fails, i lost my data. But i need to recover 
mail data from office 365 outlook 2013. So, i need a some OST 
to PST converter recommendation, if you have used a good one. 
Thanks in advance for your time and recommendations!

---


Quick software for exchange OST recovery, use this free OST to 
PST Converter Software that removes Synchronizing error, File 
size error, Virus attacks and Trojan errors and repair damaged 
and corrupted OST File and convert OST File data into several 
kinds of formats such as- PST, EML, MSG, H TML, EMLX, MBOX, vCard 
and office 365 format along with emails, contacts, calendars, 
task, notes, inbox items, outbox items and appointments.  OST to 
PST Software provides demo facility to restore 20 emails per 
folders into every format and supports all MS Outlook versions 
upto 2016.


http://www.regzasoftware.com/ost-recovery.html

 OST Recovery Software with no trouble recover selective single 
and multiple OST File and convert OST File with emails and 
attachments. MS Outlook installation not required. It supports 
free demo version that allows users view all software 
functionality and let users 25 emails per folders into every 
format.



Free to Download Software:-  
http://www.regzasoftware.com/ost-to-pst-converter/




SysInspire Free Exchange Recovery Software

2018-06-04 Thread jonshenalina via Digitalmars-d
Free Exchange Recovery Software helps users fluently recover the 
exchange mailboxes data and convert exchange to PST Outlook file 
with overall data present in it and also export mailbox from EDB 
to PST with maintains emails formatting and attachments. It will 
extract EDB emails, contacts, task, notes, calendars and etc.


Recover EDB to PST File by using this EDB to PST Recovery 
Software that successfully works to recover complete items of EDB 
file & Export exchange mailboxes to PST,  MSG, EML, EMLX and MBOX 
format.  Software never lose any information from EDB file during 
conversion and never create problem during EDB to PST Conversion.


Through this brilliant EDB Recovery application the entire users 
can solve their problem and also recover the deleted folders 
mailboxes items and save them into PST and other format. After 
converting all database they can open them in suite mail 
application like- MS Outlook application, Windows, Windows live 
mail, Thunderbird and Outlook express.


Exchange Email Recovery Software successfully convert the emails 
from priv1.edb file and pub1.ebd file into PST Outlook file. It 
is compatible to MS Office MS Office (both 32 bit and 64 bit) 
2016, 2013, 2010 and below versions. Even when EDB Files are 
formatted by Unicode characters, this software repair and recover 
all of them and also compatible to Exchange Server 2016, 2013, 
2010 to 97.


Free 2016 Exchange EDB Recovery is possible with this software 
and also preview all database of EDB file. It is compatible to 
Windows 10, 8.1, 8, Windows Server 2012, Windows Server 2008 R2, 
Windows 7, Vista, XP, 2008, 2003, 2002, 2000.


Read more:-  http://www.sysinspire.com/edb-to-pst-converter/



Re: D on top of Hacker News!

2018-06-04 Thread Sameer Pradhan via Digitalmars-d

On Sunday, 3 June 2018 at 20:12:03 UTC, JakubJ wrote:

On Sunday, 3 June 2018 at 16:58:23 UTC, Sameer Pradhan wrote:

It was nice to read Walter's article from 2014...
Wonder who posted it, and how long it will stay in the 
visibility range, but it was a nice feeling to see it at the 
top.


--
Sameer


Hi Sameer, I just discovered it today and posted it afterwards. 
Then, looked into this forum and surprise ;) .


:-)

However, I don't plan on jumping into D right now because I'm 
starting to use Elixir/OTP seriously at GSoC and between that 
and the finals at uni there's little time left.


In case you missed it, Walter did an AMA and answered some of the 
issues raised in the HN comments.




Re: gRPC in D

2018-06-04 Thread Nicholas Wilson via Digitalmars-d

On Monday, 4 June 2018 at 11:21:57 UTC, aberba wrote:
At DConf 2018,there was a talk by ?? about blockchain and gRPC 
library for D came up.


That was Kai Nacke.


gRPC in D

2018-06-04 Thread aberba via Digitalmars-d
At DConf 2018,there was a talk by ?? about blockchain and gRPC 
library for D came up.


In summary, grpc a universal rpc framework by Google and can be 
implemented in any language. It enables you to call methods on a 
remote server from a client as if they're both on the same host. 
Its use http/http2 as its protocol and protobuffer as the schema 
for api definition.



Its quite an interesting subject in large scale enterprise 
development and microservices. gRPC is now a good reason to use 
Go or Java for development...at least for distributed 
services...including blockchain. Its actually very powerful.


There's a protobuffer implementation at code.dlang.org

What remains is a D grpc implementation or bindings using the c++ 
or c version.


You may read more about it at https://grpc.io. Huge potential.




Re: D on top of Hacker News!

2018-06-04 Thread bauss via Digitalmars-d

On Sunday, 3 June 2018 at 17:40:46 UTC, I love Ice Cream wrote:
Is D really a top 20 language? I don't remember seeing it 
anywhere close to the top 20.



https://www.tiobe.com/tiobe-index/ has them in 31


Top comment is kind of depressing.


Tiobe is based on Google searches, so it's not relevant anymore.