Re: Vibed + OpenSSL on Windows 10?

2019-01-29 Thread Suliman via Digitalmars-d-learn
On Tuesday, 29 January 2019 at 10:06:43 UTC, Suliman wrote: On Tuesday, 29 January 2019 at 10:01:04 UTC, Suliman wrote: Always compile vibe.d with mscoff Could you show command to compile with mscoff? I am not sure that all works fine, but at last I do not have linking error. I have add to

Re: Vibed + OpenSSL on Windows 10?

2019-01-29 Thread Suliman via Digitalmars-d-learn
On Tuesday, 29 January 2019 at 10:01:04 UTC, Suliman wrote: Always compile vibe.d with mscoff Could you show command to compile with mscoff? I am not sure that all works fine, but at last I do not have linking error. I have add to dub.sdl ext string: "dflags-windows-x86": ["-m32mscoff"]

Re: Vibed + OpenSSL on Windows 10?

2019-01-29 Thread Suliman via Digitalmars-d-learn
Always compile vibe.d with mscoff Could you show command to compile with mscoff?

Vibed + OpenSSL on Windows 10?

2019-01-28 Thread Suliman via Digitalmars-d-learn
Does anybody have success with using vibed 0.8.4 with OpenSSL 1.0/1.1 on Windows? I tried all possible solutions without any result. I am getting linking error: Copyright (C) Digital Mars 1989-2013 All rights reserved. http://www.digitalmars.com/ctg/optlink.html

Can't build vibed:tls project

2019-01-28 Thread Suliman via Digitalmars-d-learn
If I am specifying (sic! TLS): dependency "vibe-d:tls" version="0.8.4" in my dub.sdl I am getting error when building simple project: module `vibe` is in file 'vibe\vibe.d' which cannot be read But I need to get vibed build with OpenSSL support

Re: Am I missing with ref in this code?

2019-01-25 Thread Suliman via Digitalmars-d-learn
Do I need in my code `ref`s ? https://run.dlang.io/is/8dtkC7 Or if vibed doing copy under the hood `ref`s useless?

Re: Am I missing with ref in this code?

2019-01-24 Thread Suliman via Digitalmars-d-learn
On Thursday, 24 January 2019 at 22:02:36 UTC, bauss wrote: On Thursday, 24 January 2019 at 21:25:45 UTC, Paul Backus wrote: So, I'm not sure what the best solution here is. The best solution is just to pass a copy since there's no absolute need for a reference to be passed. But if I will

Re: Am I missing with ref in this code?

2019-01-24 Thread Suliman via Digitalmars-d-learn
It's because runWorkerTask internally passes its arguments along to the function by value: https://github.com/vibe-d/vibe.d/blob/master/core/vibe/core/core.d#L364 The workaround is to pass a pointer instead: void getServiceStatus(MyUrl* url) { // ... } // ...

Am I missing with ref in this code?

2019-01-24 Thread Suliman via Digitalmars-d-learn
I am doing very small link-checker. Here is' code https://run.dlang.io/is/p8whrA I am expecting that on line: writefln("url: %s, status: %s", url.url, url.status); I will print link and it's status. But I am getting only: url: http://127.0.0.1:8081/hck, status: url: http://127.0.0.1:8081/hck2,

Re: Is there any working SQLite driver for windows?

2018-12-26 Thread Suliman via Digitalmars-d-learn
On Wednesday, 26 December 2018 at 12:13:27 UTC, Suliman wrote: On Wednesday, 26 December 2018 at 11:06:02 UTC, Andre Pany wrote: On Wednesday, 26 December 2018 at 08:19:03 UTC, Suliman wrote: Yesterday I tried several sqlite drivers and all of them have some issue that make it's build on

Re: Is there any working SQLite driver for windows?

2018-12-26 Thread Suliman via Digitalmars-d-learn
On Wednesday, 26 December 2018 at 11:06:02 UTC, Andre Pany wrote: On Wednesday, 26 December 2018 at 08:19:03 UTC, Suliman wrote: Yesterday I tried several sqlite drivers and all of them have some issue that make it's build on Windows impossible. Few examples

Is there any working SQLite driver for windows?

2018-12-26 Thread Suliman via Digitalmars-d-learn
Yesterday I tried several sqlite drivers and all of them have some issue that make it's build on Windows impossible. Few examples https://github.com/huntlabs/hunt-database/issues/24 https://github.com/biozic/d2sqlite3/issues/51

Is it's correct to say that ALL types that can grow are place on heap?

2018-09-08 Thread Suliman via Digitalmars-d-learn
Is it's correct to say that ALL types that can grow are place on heap and types that not growing (int, char, pointer) are place on stack? Or there is some exceptions? Is there any tools that can visualize place of data in memory?

Re: How to use LLD linker?

2018-07-06 Thread Suliman via Digitalmars-d-learn
Well I just installed the VS 2017 to try the ldc and get (maybe) the same error. dub run --config=application --arch=x86_64 --build=debug --compiler=ldc2 Performing "debug" build using ldc2 for x86_64. lib ~master: building configuration "application"... OPTLINK (R) for Win32 Release 8.00.17

Can't build app. VS Build Tools is installed

2018-06-30 Thread Suliman via Digitalmars-d-learn
I am trying to build simple app. And getting next error: OPTLINK (R) for Win32 Release 8.00.17 Copyright (C) Digital Mars 1989-2013 All rights reserved. http://www.digitalmars.com/ctg/optlink.html .dub\build\application-debug-windows-x86-dmd_2081-AC4AEBC828F1A14C3806E4E63B3CEEF3\app.obj(app)

How to use LLD linker?

2018-06-30 Thread Suliman via Digitalmars-d-learn
Correct me if I am wrong, but I have read news that dmd now can be used without C++ Build Tools. I trying to build simple project. And getting Error: Warning: no Visual C++ installation detected OPTLINK (R) for Win32 Release 8.00.17 Copyright (C) Digital Mars 1989-2013 All rights reserved.

Dependency injection pattern

2018-05-13 Thread Suliman via Digitalmars-d-learn
Could anybody give small example of Dependency injection pattern? I googled about it, but found only C# examples and I am not quite sure how to use them. Also I would like get some explanation/comments for code.

What principle difference between structure and Tuple?

2018-03-10 Thread Suliman via Digitalmars-d-learn
writeln(is(Tuple!(string, int) == struct)); // true What is real user case where I should use Tuple instead of Struct?

Why dynamic lib can't be converted to static and vise versa

2017-12-18 Thread Suliman via Digitalmars-d-learn
I understand that dll can be loaded dynamically, and static lib is allow export functions than embedded to binaries. But what difference in their structure? What stop to export needed function from dynamic lib and embed it to bin?

Re: Struct List Human

2017-09-24 Thread Suliman via Digitalmars-d-learn
On Sunday, 24 September 2017 at 14:32:14 UTC, dark777 wrote: I have the following code: https://pastebin.com/PWuaXJNp but typing my name does not go to the next line as soon as I press enter how to solve this? use writeln instead write

What is top 5 patterns that you use in real life?

2017-09-09 Thread Suliman via Digitalmars-d-learn
Just interesting, what top 5 programming patterns that you use in real D projects. For example I know that Singleton is very popular pattern, but I have never used it in real project. Same I can say about dependency injection.

Re: DLang IDE [RU]

2017-09-07 Thread Suliman via Digitalmars-d-learn
А можно сделать как-то так, чтобы автокомплит работал сразу? Как в студии. То есть бы не приходилось ctrl+пробел нажимать.

How Appender calculate cash size?

2017-09-06 Thread Suliman via Digitalmars-d-learn
If I right understand Appender and ~ have buffers to minimize allocations. "Appender's local capacity storage will give you a pretty big boost" (с) Adam "Appender maintains its own array metadata locally, so it can avoid global locking for each append where capacity is non-zero." (с) Docs

Re: vibed services stop response after several days of work

2017-09-01 Thread Suliman via Digitalmars-d-learn
It's seems that it's error in libevent on Linux. I tried to add to dub.sdl: versions "libasync" and it's seems that not it's working (but I need more time to test).

Re: vibed services stop response after several days of work

2017-09-01 Thread Suliman via Digitalmars-d-learn
On Friday, 1 September 2017 at 08:01:24 UTC, Suliman wrote: I got same problem on Windows Server 2016 and on Linux Debian 8.5. I have few very simple backend based on vibed 0.8.1, compiler dmd 2.075.1. nginx servise is do port forwarding. Nothing more is used. After several days of working I

vibed services stop response after several days of work

2017-09-01 Thread Suliman via Digitalmars-d-learn
I got same problem on Windows Server 2016 and on Linux Debian 8.5. I have few very simple backend based on vibed 0.8.1, compiler dmd 2.075.1. nginx servise is do port forwarding. Nothing more is used. After several days of working I am begining to get "502 Bad Gateway" error. The service is

Re: If structures places data to stack why we do not getting stackoverflow on array of structures?

2017-08-16 Thread Suliman via Digitalmars-d-learn
On Wednesday, 16 August 2017 at 13:41:29 UTC, Biotronic wrote: On Wednesday, 16 August 2017 at 12:50:07 UTC, Suliman wrote: MyStruct[] is actually a struct similar to this: struct MyStruct[] { MyStruct* ptr; size_t length; } That struct is placed on the stack, but the data it points

Re: If structures places data to stack why we do not getting stackoverflow on array of structures?

2017-08-16 Thread Suliman via Digitalmars-d-learn
MyStruct[] is actually a struct similar to this: struct MyStruct[] { MyStruct* ptr; size_t length; } That struct is placed on the stack, but the data it points to, via the ptr field, is heap allocated. What is struct? Just name and size?

Re: If structures places data to stack why we do not getting stackoverflow on array of structures?

2017-08-16 Thread Suliman via Digitalmars-d-learn
On the heap, unless you are allocating it via e.g. alloca. If struct MyStruct { int x; int y; } MyStruct mystruct; is located on stack, why: MyStruct [] mystructs; should located on heap?

Re: If structures places data to stack why we do not getting stackoverflow on array of structures?

2017-08-16 Thread Suliman via Digitalmars-d-learn
On Wednesday, 16 August 2017 at 07:09:02 UTC, rikki cattermole wrote: On 16/08/2017 8:06 AM, Suliman wrote: If structures placing data on the stack why we do not getting stackoveflow while we creating array of structures? Or for example big structure. Am I right understand that structures

If structures places data to stack why we do not getting stackoverflow on array of structures?

2017-08-16 Thread Suliman via Digitalmars-d-learn
If structures placing data on the stack why we do not getting stackoveflow while we creating array of structures? Or for example big structure. Am I right understand that structures placing data _only_ on stack? But the stack size is very limited (on Widnows it's just 1MB). So how it's

Re: Is it's possible to make modular pug template in vibed?

2017-08-09 Thread Suliman via Digitalmars-d-learn
On Tuesday, 8 August 2017 at 15:54:29 UTC, Steven Schveighoffer wrote: On 8/8/17 10:52 AM, Suliman wrote: your examples generate me: DLANG.ru (c) DLANG 2017 That's the template without the

Re: Is it's possible to make modular pug template in vibed?

2017-08-08 Thread Suliman via Digitalmars-d-learn
your examples generate me: DLANG.ru (c) DLANG 2017 The only one modification that I did I changes pages names: extends home

Re: Is it's possible to make modular pug template in vibed?

2017-08-08 Thread Suliman via Digitalmars-d-learn
Am I right understand that I can extend only one template?

Re: Is it's possible to make modular pug template in vibed?

2017-08-08 Thread Suliman via Digitalmars-d-learn
On Tuesday, 8 August 2017 at 13:22:58 UTC, Steven Schveighoffer wrote: On 8/8/17 9:10 AM, Suliman wrote: Yes, thanks what: extends layout mean? It means that your final file will be layout.dt, but with the block statements replaced with the contents defined by the specific view file.

Re: Is it's possible to make modular pug template in vibed?

2017-08-08 Thread Suliman via Digitalmars-d-learn
Still can't get it work. include header .MainContainer .Header .HeaderMenu .HeaderBlock a(href="/") General .HeaderBlock a(href="/FAQ") FAQ .HeaderBlock a(href="/book") Book .HeaderLoginBlock Sign in .Middle f include footer it's template is compilable,

Re: Is it's possible to make modular pug template in vibed?

2017-08-08 Thread Suliman via Digitalmars-d-learn
Yes, thanks what: extends layout mean?

Re: Is it's possible to make modular pug template in vibed?

2017-08-08 Thread Suliman via Digitalmars-d-learn
On Tuesday, 8 August 2017 at 11:59:38 UTC, Suliman wrote: On Tuesday, 8 August 2017 at 11:55:09 UTC, Suliman wrote: For example I am making simple site with header and footer. header and footer will be same for all pages. I do not want to do copy-paste it in every page. I want write it's once

Re: Is it's possible to make modular pug template in vibed?

2017-08-08 Thread Suliman via Digitalmars-d-learn
On Tuesday, 8 August 2017 at 11:55:09 UTC, Suliman wrote: For example I am making simple site with header and footer. header and footer will be same for all pages. I do not want to do copy-paste it in every page. I want write it's once and than simpy import in every page. Is it's possible to

Is it's possible to make modular pug template in vibed?

2017-08-08 Thread Suliman via Digitalmars-d-learn
For example I am making simple site with header and footer. header and footer will be same for all pages. I do not want to do copy-paste it in every page. I want write it's once and than simpy import in every page. Is it's possible to do with vibed?

Why D have two function contains and canFind?

2017-07-24 Thread Suliman via Digitalmars-d-learn
Why D have two function `contains` and `canFind` if C# have only contains and it's enough?

Re: How to replace pairs tags with regexp

2017-07-21 Thread Suliman via Digitalmars-d-learn
On Friday, 21 July 2017 at 07:30:07 UTC, Antonio Corbi wrote: On Friday, 21 July 2017 at 07:08:34 UTC, Suliman wrote: On Friday, 21 July 2017 at 06:19:43 UTC, Suliman wrote: There reason of issue above is spaces before "#". What wrong with next regex https://dpaste.dzfl.pl/024a47ed2a56 I

Re: How to replace pairs tags with regexp

2017-07-21 Thread Suliman via Digitalmars-d-learn
On Friday, 21 July 2017 at 06:19:43 UTC, Suliman wrote: There reason of issue above is spaces before "#". What wrong with next regex https://dpaste.dzfl.pl/024a47ed2a56 I expect that it will select: #Header my header text ##SubHeader my sub header text Because: ^#{3}

Re: How to replace pairs tags with regexp

2017-07-21 Thread Suliman via Digitalmars-d-learn
There reason of issue above is spaces before "#".

Re: How to replace pairs tags with regexp

2017-07-20 Thread Suliman via Digitalmars-d-learn
Ali Thanks! I opened answer form before you answered me!

Re: How to replace pairs tags with regexp

2017-07-20 Thread Suliman via Digitalmars-d-learn
Question above do not actual now. Now I have got next problem. import std.stdio; import std.regex; import std.file; void main() { auto text = "#Header my header text ##SubHeader my sub header text ###Sub3Header my sub 3 text #Header2 my header2 text";

How to replace pairs tags with regexp

2017-07-20 Thread Suliman via Digitalmars-d-learn
I have got next code: import std.stdio; import std.regex; import std.file; void main() { auto text = readText("book.txt"); auto inlineCodeBlock = regex("`([^`\n]+)`"); auto bigCodeBlock = regex(r"`{3}[\s\S]*?`{3}"); foreach(t;

Re: Need help to get OpenSSL 64 work on Windows x64 | I hate D's GC!

2017-07-14 Thread Suliman via Digitalmars-d-learn
On Friday, 14 July 2017 at 14:50:04 UTC, bauss wrote: On Friday, 14 July 2017 at 13:16:17 UTC, Suliman wrote: It's look that GC in D is really suxx. There is already second toy-project where I am getting stuck on Windows with D for last 3 month. I'm using 32-bit build, because I can't

Need help to get OpenSSL 64 work on Windows x64 | I hate D's GC!

2017-07-14 Thread Suliman via Digitalmars-d-learn
It's look that GC in D is really suxx. There is already second toy-project where I am getting stuck on Windows with D for last 3 month. I'm using 32-bit build, because I can't understand which libs I should use to get OpenSSL 64 bit work with dlang-request. 32-bit version compile and works

Re: How to add authentificaion method to request?

2017-07-12 Thread Suliman via Digitalmars-d-learn
Compiler require libssl32.dll for run dlang-request based app. Where I can get it? I installed, OpenSSL, but can't find this lib in C:\OpenSSL-Win64

How to add authentificaion method to request?

2017-07-11 Thread Suliman via Digitalmars-d-learn
I am using dlang-requests. I need authentificate on https://scihub.copernicus.eu/dhus/login and than do some data-parsing. MultipartForm form; form.add(formData("login_username", "Suliman")); form.add(formData("login_password", "123")); // changed auto content =

Re: Diet template is crush

2017-06-28 Thread Suliman via Digitalmars-d-learn
It's look like issue in another part of code...

Diet template is crush

2017-06-28 Thread Suliman via Digitalmars-d-learn
I can't understand why follow code is crushing: string error = "503 Server error!"; int error_code = 503; res.render!("error.dt", error, error_code); on res string (last in code above) I am getting error: CoreTaskFiber was terminated unexpectedly: Access Violation error.dt

How to add class in DIET template

2017-06-23 Thread Suliman via Digitalmars-d-learn
I need to get external variable and make class by it's value - string mystr = "lng-" ~ language; - foreach(i, line; arrayOfLines ) li code.mystr #{line} I need to get HTML code like this: some D code But class name become "mystr" and I am getting: some D code How

Re: How to cleanup array of structs?

2017-06-04 Thread Suliman via Digitalmars-d-learn
// Will reuse the array, overwriting existing data. // If other parts of the program are using existing data // in the array, this will lead to hard-to-track-down bugs. mytracks.length = 0; mytracks.assumeSafeAppend(); Could you give an example where it can lead bugs? Do you mean multi-thread

How to cleanup array of structs?

2017-06-02 Thread Suliman via Digitalmars-d-learn
I remember that there was topic about remobing data from struct/arrays of structs. But I do not remember what is idiomatic way to do it, and can't google it. something like: struct MyTrack { ulong id; string recordDate; int velocity; int

Re: Best way for handle missing args in REST interface in vibed

2017-05-30 Thread Suliman via Digitalmars-d-learn
I had post question here http://forum.rejectedsoftware.com/groups/rejectedsoftware.vibed/thread/43511/

Re: Best way for handle missing args in REST interface in vibed

2017-05-29 Thread Suliman via Digitalmars-d-learn
@rootPathFromName interface API { @path("mytrack") @method(HTTPMethod.GET)Json doTrackSpeedAnalyze(int trackid, string startDateTime, string endDateTime); } class MyRouter : API { Config config; Database database; this(Config config, Database database) {

Re: Best way for handle missing args in REST interface in vibed

2017-05-29 Thread Suliman via Digitalmars-d-learn
I wrote next code: void foo(string _error = null) { writeln("Error"); } override: @errorDisplay!foo Json doTrackSpeedAnalyze(int trackid, string startDateTime, string endDateTime) // /api/mytrack?trackid=123=2000=2010 {

Re: Best way for handle missing args in REST interface in vibed

2017-05-29 Thread Suliman via Digitalmars-d-learn
On Monday, 29 May 2017 at 12:23:59 UTC, Suliman wrote: I am doing REST interface with vibed. And thinking about handling errors, if users forgot to pass all expected args in function. For example: foo(int x, int y) // get request { } /api/foo?x=111 And if user is forgot to pass `y` we will

Best way for handle missing args in REST interface in vibed

2017-05-29 Thread Suliman via Digitalmars-d-learn
I am doing REST interface with vibed. And thinking about handling errors, if users forgot to pass all expected args in function. For example: foo(int x, int y) // get request { } /api/foo?x=111 And if user is forgot to pass `y` we will get error in the browser. What is the right way to

Getopt default int init and zero

2017-05-19 Thread Suliman via Digitalmars-d-learn
I would like to check if user specified `0` as getopt parameter. But the problem that `int`'s are default in `0`. So if user did not specified nothing `int x` will be zero, and all other code will work as if it's zero. In std.typecons I found Nullable that allow init int to zero. I tried to

How to write parser?

2017-05-14 Thread Suliman via Digitalmars-d-learn
I am trying to learn how to write text parser. I have example doc with follow format: #Header my header text ##SubHeader my sub header text ###Sub3Header my sub 3 text #Header21 my header2 text ##SubHeader21 my header2 text ###SubHeader22 my header3 text I would like to wrap all level(#)

Re: File Input

2017-05-07 Thread Suliman via Digitalmars-d-learn
On Sunday, 7 May 2017 at 13:57:47 UTC, JV wrote: Hi guys I'd like to know how to get an input from the user to be stored in a .txt file using import std.file and is it possible to directly write in a .txt file without using a variable to store the user input? Thanks for the answer in

Re: problem with std.variant rounding

2017-05-02 Thread Suliman via Digitalmars-d-learn
On Tuesday, 2 May 2017 at 08:02:23 UTC, Suliman wrote: On Saturday, 29 April 2017 at 08:57:09 UTC, Petar Kirov [ZombineDev] wrote: On Friday, 28 April 2017 at 18:08:38 UTC, H. S. Teoh wrote: On Fri, Apr 28, 2017 at 04:42:28PM +, via Digitalmars-d-learn wrote: [...]

Re: problem with std.variant rounding

2017-05-02 Thread Suliman via Digitalmars-d-learn
On Saturday, 29 April 2017 at 08:57:09 UTC, Petar Kirov [ZombineDev] wrote: On Friday, 28 April 2017 at 18:08:38 UTC, H. S. Teoh wrote: On Fri, Apr 28, 2017 at 04:42:28PM +, via Digitalmars-d-learn wrote: [...] writefln(text("%.", i, "f"), x); [...] There's no need to use text()

Re: problem with std.variant rounding

2017-04-28 Thread Suliman via Digitalmars-d-learn
On Friday, 28 April 2017 at 16:49:18 UTC, kinke wrote: On Friday, 28 April 2017 at 16:24:55 UTC, Suliman wrote: import std.stdio; import std.variant; void main() { Variant b = 56.051151; float x = b.coerce!float; writeln(x); } 56.0512 void main() { import

Re: problem with std.variant rounding

2017-04-28 Thread Suliman via Digitalmars-d-learn
On Friday, 28 April 2017 at 15:45:25 UTC, Suliman wrote: I am using https://github.com/mysql-d/mysql-native It's return from DB variant data-type. My DB include value: 56.051151 (double type in DB) I need to extract it. I tried several variants: writeln(point[3].coerce!float);

problem with std.variant rounding

2017-04-28 Thread Suliman via Digitalmars-d-learn
I am using https://github.com/mysql-d/mysql-native It's return from DB variant data-type. My DB include value: 56.051151 (double type in DB) I need to extract it. I tried several variants: writeln(point[3].coerce!float); writeln(point[3].coerce!string); writeln(point[3].coerce!double); but

Re: Can't break App execution by ctrl+c

2017-04-27 Thread Suliman via Digitalmars-d-learn
Just catch the empty result exception. I do not want to go to catch block if I have empty result. I just want to get there if any other error type occur. If result is empty that simply skip this step.

Re: Can't break App execution by ctrl+c

2017-04-27 Thread Suliman via Digitalmars-d-learn
On Thursday, 27 April 2017 at 12:25:11 UTC, Adam D. Ruppe wrote: On Thursday, 27 April 2017 at 12:17:12 UTC, Suliman wrote: Before my code handle empty result in `catch` block. You must be catching the ctrl+c exception... don't do that. Just catch the empty result exception. The issue is

Can't break App execution by ctrl+c

2017-04-27 Thread Suliman via Digitalmars-d-learn
Before my code handle empty result in `catch` block. Then I moved it's checking to main loop, and now I can't abort App execution by ctrl+c. It's simply continue working. Here is my code: foreach(cargpspoint; cargpspoints) { auto cmd_dist = new

Re: How to fix date format?

2017-04-26 Thread Suliman via Digitalmars-d-learn
On Wednesday, 26 April 2017 at 05:21:32 UTC, Jonathan M Davis wrote: On Wednesday, April 26, 2017 04:02:12 Suliman via Digitalmars-d-learn wrote: I tried to do: writeln(DateTime.toISOExtString(DateTime.fromSimpleString(point[1].coerce! string))); But got error: Error: function

Re: How to fix date format?

2017-04-25 Thread Suliman via Digitalmars-d-learn
I tried to do: writeln(DateTime.toISOExtString(DateTime.fromSimpleString(point[1].coerce!string))); But got error: Error: function std.datetime.DateTime.toISOExtString () const is not callable using argument types (DateTime) Error: function database.Database.getSingleTrackInfo no return exp;

Re: How to fix date format?

2017-04-25 Thread Suliman via Digitalmars-d-learn
On Tuesday, 25 April 2017 at 20:10:02 UTC, Jonathan M Davis wrote: On Tuesday, April 25, 2017 17:41:25 Suliman via Digitalmars-d-learn wrote: I am using mysql native. Date in DB have next format: 2016-11-01 06:19:37 But every tile when I am trying to get it I am getting such format: 2016-Oct

How to fix date format?

2017-04-25 Thread Suliman via Digitalmars-d-learn
I am using mysql native. Date in DB have next format: 2016-11-01 06:19:37 But every tile when I am trying to get it I am getting such format: 2016-Oct-31 15:37:24 I use next code: writeln(point[1].coerce!string); Why coerce is forcing format changing? How I can extract result as without

Why File is exists in std.stdio and in std.file?

2017-04-25 Thread Suliman via Digitalmars-d-learn
Just interesting. Is there any rational reasons for this decision?

Re: The app hanging after reach 1750MB of RAM

2017-04-24 Thread Suliman via Digitalmars-d-learn
The problem is solved. See for more detail https://github.com/mysql-d/mysql-native/issues/104

Re: The app hanging after reach 1750MB of RAM

2017-04-19 Thread Suliman via Digitalmars-d-learn
On Wednesday, 19 April 2017 at 15:18:32 UTC, crimaniak wrote: On Tuesday, 18 April 2017 at 11:43:24 UTC, Suliman wrote: I am writing app that extract data from DB to array of structures. void getSingleTrackInfo() { foreach(item;

Re: The app hanging after reach 1750MB of RAM

2017-04-19 Thread Suliman via Digitalmars-d-learn
I have added GC.stat https://dlang.org/library/core/memory/gc.stats.html here the result: freeSize: 49698640 | usedSize: 170502320 freeSize: 41174592 | usedSize: 217823680 freeSize: 53868576 | usedSize: 247072736 freeSize: 86494800 | usedSize: 307769776 freeSize: 58176640 | usedSize:

Re: The app hanging after reach 1750MB of RAM

2017-04-19 Thread Suliman via Digitalmars-d-learn
auto mymem = cargpspoints.length * typeof(cargpspoints[0]).sizeof; writeln(mymem); And it's print: 16963440 it's about 16MB... What is takes all other memory? 1. You're measuring it wrong. Array length is already measured in terms of type size. So should I do: cargpspoints.length *

Re: The app hanging after reach 1750MB of RAM

2017-04-18 Thread Suliman via Digitalmars-d-learn
On Tuesday, 18 April 2017 at 14:15:59 UTC, Stanislav Blinov wrote: On Tuesday, 18 April 2017 at 14:09:28 UTC, Stanislav Blinov wrote: foreach(row; result) { arr ~= row.toStruct(cargpspoint); } Sorry, this should be foreach(row; result) {

Re: The app hanging after reach 1750MB of RAM

2017-04-18 Thread Suliman via Digitalmars-d-learn
Also I can't understand why app take so much memory? I checked array of structures size with this code: auto mymem = cargpspoints.length * typeof(cargpspoints[0]).sizeof; writeln(mymem); And it's print: 16963440 it's about 16MB... What is takes all other memory?

The app hanging after reach 1750MB of RAM

2017-04-18 Thread Suliman via Digitalmars-d-learn
I am writing app that extract data from DB to array of structures. void getSingleTrackInfo() { foreach(item; getTablesGPSSensorList) { ResultRange result = mysqlconnection.query(sqlquery);

Re: Can't build simple project. Very strange errors

2017-04-17 Thread Suliman via Digitalmars-d-learn
On Friday, 14 April 2017 at 15:53:18 UTC, Rene Zwanenburg wrote: On Friday, 14 April 2017 at 15:42:33 UTC, Suliman wrote: On Friday, 14 April 2017 at 15:40:18 UTC, Rene Zwanenburg wrote: On Friday, 14 April 2017 at 15:31:21 UTC, Suliman wrote: On Friday, 14 April 2017 at 15:22:49 UTC, Rene

Re: Can't pass data from filter to each

2017-04-17 Thread Suliman via Digitalmars-d-learn
New question. Can I put result of filtering in itself without creation of new variables like x: auto x = MySQLTablesRange.array.filter!(a=>a[0].coerce!string.canFind("_"));

Can't pass data from filter to each

2017-04-17 Thread Suliman via Digitalmars-d-learn
I am writing lambda function. I need filter data at first step and than do dome operation on them (for start simply print on the screen. I wrote next code: MySQLTablesRange.filter!(a=>a[0].coerce!string.canFind("_")).each!(a => to!int(a[0].coerce!string.split("_")[1]).writeln); But it's

Re: Why map return [] ?

2017-04-14 Thread Suliman via Digitalmars-d-learn
On Friday, 14 April 2017 at 15:55:13 UTC, Rene Zwanenburg wrote: On Friday, 14 April 2017 at 15:49:00 UTC, Suliman wrote: I found problem! ResultRange should be converted to array before it can be `map`ed That shouldn't be necessary. Can you post your complete code? ResultRange

Re: Why map return [] ?

2017-04-14 Thread Suliman via Digitalmars-d-learn
On Friday, 14 April 2017 at 15:38:19 UTC, Suliman wrote: On Friday, 14 April 2017 at 15:35:15 UTC, cym13 wrote: On Friday, 14 April 2017 at 15:29:33 UTC, Suliman wrote: auto x = MySQLTablesRange.map!(a=>a); writeln(x); return: [] while next code: MySQLTablesRange.each!(a=>a.writeln); return

Re: Can't build simple project. Very strange errors

2017-04-14 Thread Suliman via Digitalmars-d-learn
On Friday, 14 April 2017 at 15:40:18 UTC, Rene Zwanenburg wrote: On Friday, 14 April 2017 at 15:31:21 UTC, Suliman wrote: On Friday, 14 April 2017 at 15:22:49 UTC, Rene Zwanenburg wrote: On Friday, 14 April 2017 at 09:49:09 UTC, Suliman wrote: on: dub build --compiler=ldc2 link OPTLINK (R)

Re: Why map return [] ?

2017-04-14 Thread Suliman via Digitalmars-d-learn
On Friday, 14 April 2017 at 15:35:15 UTC, cym13 wrote: On Friday, 14 April 2017 at 15:29:33 UTC, Suliman wrote: auto x = MySQLTablesRange.map!(a=>a); writeln(x); return: [] while next code: MySQLTablesRange.each!(a=>a.writeln); return data line by line. Why? What library is that supposed

Re: Can't build simple project. Very strange errors

2017-04-14 Thread Suliman via Digitalmars-d-learn
On Friday, 14 April 2017 at 15:22:49 UTC, Rene Zwanenburg wrote: On Friday, 14 April 2017 at 09:49:09 UTC, Suliman wrote: on: dub build --compiler=ldc2 link OPTLINK (R) for Win32 Release 8.00.17 Optlink isn't able to link object files produced by ldc. Could you try an x64_86 build?

Why map return [] ?

2017-04-14 Thread Suliman via Digitalmars-d-learn
auto x = MySQLTablesRange.map!(a=>a); writeln(x); return: [] while next code: MySQLTablesRange.each!(a=>a.writeln); return data line by line. Why?

Re: Can't build simple project. Very strange errors

2017-04-14 Thread Suliman via Digitalmars-d-learn
On Friday, 14 April 2017 at 10:40:00 UTC, Suliman wrote: I checked all possible combination of dmd and vibed (0.7.30 brunch). No result. Only a little bit another error: Copyright (C) Digital Mars 1989-2013 All rights reserved. http://www.digitalmars.com/ctg/optlink.html

Re: Can't build simple project. Very strange errors

2017-04-14 Thread Suliman via Digitalmars-d-learn
I checked all possible combination of dmd and vibed (0.7.30 brunch). No result. Only a little bit another error: Copyright (C) Digital Mars 1989-2013 All rights reserved. http://www.digitalmars.com/ctg/optlink.html

Re: Can't build simple project. Very strange errors

2017-04-14 Thread Suliman via Digitalmars-d-learn
On Friday, 14 April 2017 at 09:51:55 UTC, Suliman wrote: But I tested it on 2.073.0 too Not 2.073.0 but v2.073.2 I checked v2.073.1 too and he reported that it's buildable with v2.073.1 on his PC. Any ideas?

Re: Can't build simple project. Very strange errors

2017-04-14 Thread Suliman via Digitalmars-d-learn
But I tested it on 2.073.0 too Not 2.073.0 but v2.073.2

Can't build simple project. Very strange errors

2017-04-14 Thread Suliman via Digitalmars-d-learn
I am getting very strange bug on very simple project. Here is sources http://rgho.st/7j5LQLZxb (blue button for downloading). On: dub build I am getting error: Unexpected OPTLINK Termination at EIP=0040F60A EAX=0393 EBX=00438C70 ECX=0EE6 EDX=02CE ESI=0104 EDI=03930468

Re: Single exe vibe.d app

2017-04-11 Thread Suliman via Digitalmars-d-learn
On Friday, 7 April 2017 at 07:15:44 UTC, rikki cattermole wrote: I'm going to give you a very bad but still a good place to begin with explanation. So, what is an executable? Well in modern operating systems that is a file with a very complex structure inside, like PE-COFF or ELF. It has a

Re: Single exe vibe.d app

2017-04-07 Thread Suliman via Digitalmars-d-learn
On Thursday, 6 April 2017 at 17:39:15 UTC, Stefan Koch wrote: On Wednesday, 5 April 2017 at 12:13:38 UTC, Satoshi wrote: Hi, How can I build single exe application with vibe.d (windows)? now it require zlib.dll, libeay32.dll and ssleay32.dll But I need it as single app. One solution would be

  1   2   3   4   5   >