Re: windows wininet library

2015-02-01 Thread Jeremy DeHaan via Digitalmars-d-learn
On Sunday, 1 February 2015 at 07:32:05 UTC, ketmar wrote: how can i use wininet.dll from D? i got bindings from https://github.com/ CS-svnmirror/dsource-bindings-win32.git, and then i tried to create wininet.lib with implib.exe from DMC package. no matter how i tried, the resulting "wininet.lib

Re: windows wininet library

2015-02-01 Thread ketmar via Digitalmars-d-learn
On Sun, 01 Feb 2015 08:10:30 +, Jeremy DeHaan wrote: > On Sunday, 1 February 2015 at 07:32:05 UTC, ketmar wrote: >> how can i use wininet.dll from D? i got bindings from >> https://github.com/ >> CS-svnmirror/dsource-bindings-win32.git, and then i tried to create >> wininet.lib with implib.exe

Re: windows wininet library

2015-02-01 Thread ketmar via Digitalmars-d-learn
On Sun, 01 Feb 2015 07:32:05 +, ketmar wrote: > how can i use wininet.dll from D? i got bindings from > https://github.com/ > CS-svnmirror/dsource-bindings-win32.git, and then i tried to create > wininet.lib with implib.exe from DMC package. no matter how i tried, the > resulting "wininet.lib"

Re: dco how to specify Jpath?

2015-02-01 Thread FrankLike via Digitalmars-d-learn
On Friday, 9 January 2015 at 16:40:37 UTC, FrankLike wrote: https://github.com/FrankLIKE/dco you can use dco by local.ini( create it by dco -ini ),config your info into local.ini. modify the ';dflag=' to 'dflags=-JyourPath' Thank you.

Re: Error when profiling

2015-02-01 Thread Nicholas Wilson via Digitalmars-d-learn
On Saturday, 31 January 2015 at 14:12:59 UTC, Phil wrote: When trying to run my program with profiling enabled it dies before the first line of my main function runs. Everything works fine without profiling. I get the following stack trace: thread #1: tid = 0x38de4, 0x00010008d985 vision

Re: foreach - premature optimization vs cultivating good habits

2015-02-01 Thread Laeeth Isharc via Digitalmars-d-learn
Thank you Adam, Bbaz and Ola for the helpful thoughts. I dumped them in a wiki page off the sandbox but needs editing and refining.

Can't understand how to compare DateTime with opCmp

2015-02-01 Thread Suliman via Digitalmars-d-learn
I need to compare to DateTime. I looked at docs and found opCmp for DateTime type. The problem is that I can't understand how to use it. http://dlang.org/phobos/std_datetime.html#DateTime opCmp(in DateTime rhs); what is rhs? I am trying to do something like this: if( DateTime.opCmp(dtindb, ou

Re: Can't understand how to compare DateTime with opCmp

2015-02-01 Thread Rene Zwanenburg via Digitalmars-d-learn
On Sunday, 1 February 2015 at 15:04:39 UTC, Suliman wrote: I need to compare to DateTime. I looked at docs and found opCmp for DateTime type. The problem is that I can't understand how to use it. http://dlang.org/phobos/std_datetime.html#DateTime opCmp(in DateTime rhs); what is rhs? I am try

Re: Can't understand how to compare DateTime with opCmp

2015-02-01 Thread FG via Digitalmars-d-learn
On 2015-02-01 at 16:04, Suliman wrote: opCmp(in DateTime rhs); what is rhs? RHS is probably short of "right hand side", ie. the argument on the right side of the operator in a binary operator expression. In `a < b` it would be b. I am trying to do something like this: if( DateTime.opCmp(dti

Re: Can't understand how to compare DateTime with opCmp

2015-02-01 Thread Suliman via Digitalmars-d-learn
Thanks! Could anybody say how can I use roll if I need to date to date. For example I need to plus: DateTime currentdt = cast(DateTime)(Clock.currTime()); with another DateTime var foo.

Re: windows wininet library

2015-02-01 Thread John Chapman via Digitalmars-d-learn
On Sunday, 1 February 2015 at 08:37:23 UTC, ketmar wrote: seems that my idea of using D to write a simple windows utility was very wrong. ok, another attempt to use D for our windows developement has failed. i'm in no way can sell manual ".def" creation to our team -- they will make fun of me

Re: windows wininet library

2015-02-01 Thread ketmar via Digitalmars-d-learn
On Sun, 01 Feb 2015 16:07:58 +, John Chapman wrote: > On Sunday, 1 February 2015 at 08:37:23 UTC, ketmar wrote: >> >> seems that my idea of using D to write a simple windows utility was >> very wrong. ok, another attempt to use D for our windows developement >> has failed. i'm in no way can se

Re: windows wininet library

2015-02-01 Thread ketmar via Digitalmars-d-learn
On Sun, 01 Feb 2015 16:07:58 +, John Chapman wrote: > On Sunday, 1 February 2015 at 08:37:23 UTC, ketmar wrote: >> >> seems that my idea of using D to write a simple windows utility was >> very wrong. ok, another attempt to use D for our windows developement >> has failed. i'm in no way can se

Re: windows wininet library

2015-02-01 Thread Benjamin Thaut via Digitalmars-d-learn
Am 01.02.2015 um 17:15 schrieb ketmar: On Sun, 01 Feb 2015 16:07:58 +, John Chapman wrote: On Sunday, 1 February 2015 at 08:37:23 UTC, ketmar wrote: seems that my idea of using D to write a simple windows utility was very wrong. ok, another attempt to use D for our windows developement ha

strlen, strcpy, etc errors when trying to link an object

2015-02-01 Thread irtcupc via Digitalmars-d-learn
Hello, I try to link an object file under win32, the format is ok (omf), i haven't yet started to write the di interface (it exists in a c H file that i'll translate) that a simple compilation try gives me: --- C:\...\myObj.obj(myObj) Error 42: Symbol Undefined strlen C:\...\myObj.obj(myObj

Re: strlen, strcpy, etc errors when trying to link an object

2015-02-01 Thread irtcupc via Digitalmars-d-learn
On Sunday, 1 February 2015 at 18:19:54 UTC, irtcupc wrote: Hello, I try to link an object file under win32, the format is ok (omf), i haven't yet started to write the di interface (it exists in a c H file that i'll translate) that a simple compilation try gives me: --- C:\...\myObj.obj(myObj

Re: Can't understand how to compare DateTime with opCmp

2015-02-01 Thread Suliman via Digitalmars-d-learn
"+ n.days" solved my problem.

Conway's game of life

2015-02-01 Thread gedaiu via Digitalmars-d-learn
Hi, I implemented Conway's game of life in D. What do you think that I can improve to this program to take advantage of more D features? https://github.com/gedaiu/Game-Of-Life-D Thanks, Bogdan

Re: how convert the range to slice ?

2015-02-01 Thread Nordlöw
On Wednesday, 28 January 2015 at 23:21:34 UTC, Nordlöw wrote: I'll dig into it later on... Is started digging a bit... The magic happens at line 103 in cast.c. How do I most conveniently figure out which members (functions) a type (e->type) has? I figured I could check for typical InputRan

Re: Conway's game of life

2015-02-01 Thread Tobias Pankrath via Digitalmars-d-learn
1. I prefer alias CellList = Cell[]; over alias Cell[] CellList; 2. Do you really need to create a complete new CellList for every single removal? If so, you'd know the size of the new list in advance and can allocate it directly at the correct size. I get the impression that you think Cell[

Re: Conway's game of life

2015-02-01 Thread Foo via Digitalmars-d-learn
On Sunday, 1 February 2015 at 21:00:07 UTC, gedaiu wrote: Hi, I implemented Conway's game of life in D. What do you think that I can improve to this program to take advantage of more D features? https://github.com/gedaiu/Game-Of-Life-D Thanks, Bogdan For each remove you create a new array. T

Re: Can't understand how to compare DateTime with opCmp

2015-02-01 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, February 01, 2015 19:22:40 Suliman via Digitalmars-d-learn wrote: > "+ n.days" solved my problem. Roll is specifically for cases where you want one of the fields to increase or decrease without affecting the others (e.g. if you had a spin control in your GUI with a DateTime backing it a

Re: Conway's game of life

2015-02-01 Thread FG via Digitalmars-d-learn
On 2015-02-01 at 22:00, gedaiu wrote: I implemented Conway's game of life in D. I think you are playing a different game here. /// Count cell neighbours long neighbours(Cell myCell, CellList list) { long cnt; foreach(cell; list) { auto diff1 = abs(myCell.x -

Re: Conway's game of life

2015-02-01 Thread data man via Digitalmars-d-learn
On Sunday, 1 February 2015 at 21:00:07 UTC, gedaiu wrote: Hi, I implemented Conway's game of life in D. What do you think that I can improve to this program to take advantage of more D features? https://github.com/gedaiu/Game-Of-Life-D Thanks, Bogdan If the subject of the game "Life" is inte

Re: strlen, strcpy, etc errors when trying to link an object

2015-02-01 Thread ketmar via Digitalmars-d-learn
On Sun, 01 Feb 2015 18:34:01 +, irtcupc wrote: did you build BeaEngine with dmc? if not, try to rebuild with dmc compiler. signature.asc Description: PGP signature

Re: windows wininet library

2015-02-01 Thread ketmar via Digitalmars-d-learn
On Sun, 01 Feb 2015 17:54:50 +0100, Benjamin Thaut wrote: > Am 01.02.2015 um 17:15 schrieb ketmar: >> On Sun, 01 Feb 2015 16:07:58 +, John Chapman wrote: >> >>> On Sunday, 1 February 2015 at 08:37:23 UTC, ketmar wrote: seems that my idea of using D to write a simple windows utility w