Re: FTP LS

2022-05-15 Thread ikod via Digitalmars-d-learn
On Saturday, 14 May 2022 at 08:42:46 UTC, Anonymouse wrote: Before I go on duplicating effort, does anyone have anything that can access FTP beyond PUT and GET? I need to read file information from a NAS so I know if I should upload a file or not. `dlang-requests` has `Request.post` and

Re: FTP LS

2022-05-14 Thread ikod via Digitalmars-d-learn
On Saturday, 14 May 2022 at 08:42:46 UTC, Anonymouse wrote: Before I go on duplicating effort, does anyone have anything that can access FTP beyond PUT and GET? I need to read file information from a NAS so I know if I should upload a file or not. `dlang-requests` has `Request.post` and

Re: FTP LS

2022-05-14 Thread ikod via Digitalmars-d-learn
On Saturday, 14 May 2022 at 10:17:14 UTC, ikod wrote: On Saturday, 14 May 2022 at 08:42:46 UTC, Anonymouse wrote: Before I go on duplicating effort, does anyone have anything that can access FTP beyond PUT and GET? I need to read file information from a NAS so I know if I should upload a

Re: FTP LS

2022-05-14 Thread ikod via Digitalmars-d-learn
On Saturday, 14 May 2022 at 08:42:46 UTC, Anonymouse wrote: Before I go on duplicating effort, does anyone have anything that can access FTP beyond PUT and GET? I need to read file information from a NAS so I know if I should upload a file or not. `dlang-requests` has `Request.post` and

Re: How to work with hashmap from memutils properly?

2022-02-16 Thread ikod via Digitalmars-d-learn
On Wednesday, 16 February 2022 at 10:31:38 UTC, Siarhei Siamashka wrote: On Friday, 11 February 2022 at 19:04:41 UTC, Sergey wrote: Is this an attempt to implement a high performance solution for the Benchmarks Game's LRU problem in D language? Yes. There is no D version there. And I'm just

Re: Payload Details with std.net.curl:post

2021-11-29 Thread ikod via Digitalmars-d-learn
On Monday, 29 November 2021 at 01:49:37 UTC, Kyle Ingraham wrote: On Sunday, 28 November 2021 at 07:27:35 UTC, ikod wrote: On Sunday, 28 November 2021 at 01:06:45 UTC, Kyle Ingraham wrote: On Saturday, 27 November 2021 at 22:18:48 UTC, ikod wrote: Hi Kyle! I found

Re: Payload Details with std.net.curl:post

2021-11-27 Thread ikod via Digitalmars-d-learn
On Sunday, 28 November 2021 at 01:06:45 UTC, Kyle Ingraham wrote: On Saturday, 27 November 2021 at 22:18:48 UTC, ikod wrote: On Saturday, 27 November 2021 at 20:31:16 UTC, Kyle Ingraham Hi Kyle, ``` object.Exception@C:\Users\Kyle

Re: Payload Details with std.net.curl:post

2021-11-27 Thread ikod via Digitalmars-d-learn
On Saturday, 27 November 2021 at 20:31:16 UTC, Kyle Ingraham wrote: On Saturday, 27 November 2021 at 19:21:28 UTC, frame wrote: On Saturday, 27 November 2021 at 17:41:55 UTC, Kyle Ingraham wrote: I was afraid of that. Thank you for clarifying. I’ve tried other clients but they all seem to

Re: Best way to make a template function conditionally @trusted

2021-04-02 Thread ikod via Digitalmars-d-learn
On Thursday, 1 April 2021 at 22:35:01 UTC, tsbockman wrote: Suppose I have a templated struct member function for which I can compute at compile-time when the function is memory safe, and when it is not. But, the compiler cannot correctly determine this automatically. Compiler should be able

Re: dub fetching dependencies for wrong configuration(s)

2020-10-29 Thread ikod via Digitalmars-d-learn
On Wednesday, 28 October 2020 at 21:56:46 UTC, Anonymouse wrote: On Wednesday, 28 October 2020 at 19:34:43 UTC, ikod wrote: To make this transition as painless as possible I'll create new package with major version "2" if you confirm that everything works as expected. ... No vibe-d

Re: dub fetching dependencies for wrong configuration(s)

2020-10-28 Thread ikod via Digitalmars-d-learn
On Tuesday, 27 October 2020 at 22:15:34 UTC, Anonymouse wrote: On Tuesday, 27 October 2020 at 21:15:35 UTC, ikod wrote: On Tuesday, 27 October 2020 at 17:01:23 UTC, Anonymouse wrote: On Sunday, 4 October 2020 at 21:00:49 UTC, ikod wrote: Thanks, Andre! I'll split requests as you suggested

Re: dub fetching dependencies for wrong configuration(s)

2020-10-27 Thread ikod via Digitalmars-d-learn
On Tuesday, 27 October 2020 at 17:01:23 UTC, Anonymouse wrote: On Sunday, 4 October 2020 at 21:00:49 UTC, ikod wrote: Thanks, Andre! I'll split requests as you suggested (increasing minor version, so that this change will not hurt anybody who build current requests package for vibe-d). Will

Re: Help on asdf json module

2020-10-25 Thread ikod via Digitalmars-d-learn
On Sunday, 25 October 2020 at 06:05:27 UTC, Vino wrote: Hi All, Currently we are testing various json module such as "std.json, std_data_json, vibe.data.json and asdf", the below code works perfectely while use "std_data_json or vibe.data.json" but not working as expected when we use

Re: std.net.curl get json_encode

2020-10-08 Thread ikod via Digitalmars-d-learn
On Friday, 9 October 2020 at 01:45:37 UTC, Vino wrote: On Friday, 2 October 2020 at 23:20:48 UTC, Imperatorn wrote: On Friday, 2 October 2020 at 21:12:09 UTC, Vino wrote: Hi All, ... auto content = https.perform(); https.shutdown; JSONValue jv = parseJSONValue(content); Maybe JSONValue jv

Re: It is possible to substract 5 from 3 unsigned integer

2020-10-06 Thread ikod via Digitalmars-d-learn
On Tuesday, 6 October 2020 at 18:24:14 UTC, Alaindevos wrote: There are two subtractions possible. A machine-one which can be architecture dependent, does not have the same results on all computers, and behaves like a modulus in mathematics. A logical one. For the last one higher classes

Re: dub fetching dependencies for wrong configuration(s)

2020-10-04 Thread ikod via Digitalmars-d-learn
On Sunday, 4 October 2020 at 20:08:31 UTC, Andre Pany wrote: On Sunday, 4 October 2020 at 14:08:24 UTC, Anonymouse wrote: At the moment the only chance to avoid these additional dependencies would be to split requests into 2 dub packages. The core package which uses std, and an additional

Re: dub fetching dependencies for wrong configuration(s)

2020-10-04 Thread ikod via Digitalmars-d-learn
On Sunday, 4 October 2020 at 14:08:24 UTC, Anonymouse wrote: My project depends on the requests dub package, which has two build configurations; one with an extra vibe-d dependency, one without (default). "configurations": [ { "name": "std" }, {

Re: Fiber based HTTP client for load testing

2020-10-01 Thread ikod via Digitalmars-d-learn
On Thursday, 1 October 2020 at 03:10:32 UTC, ikod wrote: On Thursday, 1 October 2020 at 00:35:49 UTC, Arun wrote: I have a REST client that can do load test of my REST void main() { auto urls = ["http://httpbin.org/;, "http://httpbin.org/image;]; foreach(url; urls) {

Re: Fiber based HTTP client for load testing

2020-09-30 Thread ikod via Digitalmars-d-learn
On Thursday, 1 October 2020 at 00:35:49 UTC, Arun wrote: I have a REST client that can do load test of my REST services. It uses ikod's dlang-requests under the hood. https://github.com/ikod/dlang-requests At the moment I use a thread pool to dispatch the runtime operation and send the

Re: Safe to remove AA elements while iterating over it via .byKeyValue?

2020-09-29 Thread ikod via Digitalmars-d-learn
Hello, Sorry if I unintentionally hurt anybody in this thread. I'll try to implement sane and correct iteration behavior for AA without noticeable performance loss, and propose it if I succeed. Igor

Re: Safe to remove AA elements while iterating over it via .byKeyValue?

2020-09-28 Thread ikod via Digitalmars-d-learn
On Monday, 28 September 2020 at 19:18:20 UTC, H. S. Teoh wrote: On Mon, Sep 28, 2020 at 05:18:41PM +, ikod via Digitalmars-d-learn wrote: On Monday, 28 September 2020 at 14:58:15 UTC, Steven Schveighoffer wrote: [...] > One could write a specific function to iterate and remove

Re: Safe to remove AA elements while iterating over it via .byKeyValue?

2020-09-28 Thread ikod via Digitalmars-d-learn
On Monday, 28 September 2020 at 14:58:15 UTC, Steven Schveighoffer wrote: On 9/27/20 4:43 PM, Per Nordlöw wrote: On Sunday, 27 September 2020 at 14:23:11 UTC, H. S. Teoh wrote: No.  Modifying a container while iterating over it is, in general, a bad idea (unless the container is designed to be

Re: Safe to remove AA elements while iterating over it via .byKeyValue?

2020-09-28 Thread ikod via Digitalmars-d-learn
On Monday, 28 September 2020 at 10:10:10 UTC, Per Nordlöw wrote: On Monday, 28 September 2020 at 10:01:23 UTC, ikod wrote: Is it specific to some types? What if collection supports stable "foreach"? Yes it depends on how collection members (such as insert, find, replace, erase, etc) are

Re: Safe to remove AA elements while iterating over it via .byKeyValue?

2020-09-28 Thread ikod via Digitalmars-d-learn
On Monday, 28 September 2020 at 09:41:02 UTC, Per Nordlöw wrote: On Monday, 28 September 2020 at 07:15:27 UTC, Imperatorn wrote: Yes, this should be a compile-time error Spec here: https://dlang.org/spec/statement.html#foreach_restrictions Is it specific to some types? What if collection

Re: Safe to remove AA elements while iterating over it via .byKeyValue?

2020-09-28 Thread ikod via Digitalmars-d-learn
On Sunday, 27 September 2020 at 14:23:11 UTC, H. S. Teoh wrote: On Sun, Sep 27, 2020 at 01:02:04PM +, Per Nordlöw via Digitalmars-d-learn wrote: Is it safe to remove AA-elements from an `aa` I'm iterating over via aa.byKeyValue? No. Modifying a container while iterating over it is, in

Re: vibe.d: How to get the conent of a file upload ?

2020-09-19 Thread ikod via Digitalmars-d-learn
On Saturday, 19 September 2020 at 18:56:20 UTC, Steven Schveighoffer wrote: On 9/19/20 7:15 AM, ikod wrote: On Saturday, 19 September 2020 at 11:11:21 UTC, ikod wrote: On Friday, 18 September 2020 at 13:13:16 UTC, wjoe wrote: My preferable way to handle such thing is: convert incoming data

Re: vibe.d: How to get the conent of a file upload ?

2020-09-19 Thread ikod via Digitalmars-d-learn
On Saturday, 19 September 2020 at 11:11:21 UTC, ikod wrote: On Friday, 18 September 2020 at 13:13:16 UTC, wjoe wrote: On Friday, 18 September 2020 at 12:58:29 UTC, Steven Schveighoffer wrote: On 9/18/20 8:39 AM, Steven Schveighoffer wrote: But again, solved with an enhancement that allows you

Re: vibe.d: How to get the conent of a file upload ?

2020-09-19 Thread ikod via Digitalmars-d-learn
On Friday, 18 September 2020 at 13:13:16 UTC, wjoe wrote: On Friday, 18 September 2020 at 12:58:29 UTC, Steven Schveighoffer wrote: On 9/18/20 8:39 AM, Steven Schveighoffer wrote: But again, solved with an enhancement that allows you to process the data in your code. I'll file the enhancement

Re: Why is dtor called for lazy parameter?

2020-09-18 Thread ikod via Digitalmars-d-learn
On Friday, 18 September 2020 at 10:43:47 UTC, Andrey Zherikov wrote: I have this code: == class S ... auto create() { writeln("-> ",__PRETTY_FUNCTION__); scope(exit) writeln("<- ",__PRETTY_FUNCTION__); return scoped!S(1); } If you replace this line with "return new

Re: Construct an used-defined hash table container type from an AA-literal expression

2020-07-05 Thread ikod via Digitalmars-d-learn
On Sunday, 5 July 2020 at 21:06:32 UTC, Per Nordlöw wrote: Is there a way to construct a custom written hash-table container (struct) from an AA-literal expression? can opAssign help? struct AA(K,V) { void opAssign(V[K] aa) { } } void main() { AA!(string, int) custom_aa;

Re: Downloading files over TLS

2020-06-26 Thread ikod via Digitalmars-d-learn
On Friday, 26 June 2020 at 11:41:27 UTC, Jacob Carlborg wrote: On Friday, 26 June 2020 at 11:10:27 UTC, ikod wrote: [...] Oh, it's that bad. That's disappointing. [...] I'm using a script (written in D) in my tool, DStep [1][2], to identify which versions of libclang is available and to

Re: Downloading files over TLS

2020-06-26 Thread ikod via Digitalmars-d-learn
On Friday, 26 June 2020 at 10:12:09 UTC, Jacob Carlborg wrote: Downloading files over TLS. This seems that it's something that should be quite simple to do. My high level goals are cross-platform and easy distribution. I don't need anything fancy just a simple API like this:

Re: Use classes as keys in associative array

2020-06-06 Thread ikod via Digitalmars-d-learn
On Saturday, 6 June 2020 at 20:31:36 UTC, ikod wrote: On Saturday, 6 June 2020 at 16:49:29 UTC, JN wrote: Is it possible to use different class instances as keys for associative array, but compare them by the contents? I tried to override opEquals but it doesn't seem to work. Basically I'd

Re: Use classes as keys in associative array

2020-06-06 Thread ikod via Digitalmars-d-learn
On Saturday, 6 June 2020 at 16:49:29 UTC, JN wrote: Is it possible to use different class instances as keys for associative array, but compare them by the contents? I tried to override opEquals but it doesn't seem to work. Basically I'd May be wrong, but probably you have to override opEquals

Re: Fibers and std.socket

2020-05-22 Thread ikod via Digitalmars-d-learn
On Friday, 22 May 2020 at 06:10:38 UTC, Atwork wrote: Is it possible to mix fibers with sockets from phobos? If so, how would I do it? Like just a simple example of async sockets using fibers in D. I will say that I'd prefer to not use any packages ex. vibe.d Yes you can mix std sockets

Re: undefined reference to 'deflateEnd'

2020-05-18 Thread ikod via Digitalmars-d-learn
On Monday, 18 May 2020 at 07:33:29 UTC, Andre Pany wrote: On Monday, 18 May 2020 at 06:02:03 UTC, ikod wrote: NAME="Ubuntu" VERSION="18.04.4 LTS (Bionic Beaver)" [...] Thanks a lot. Kind regards André Just discovered that we can import etc.c.zlib and use low level zlib directly

Re: undefined reference to 'deflateEnd'

2020-05-18 Thread ikod via Digitalmars-d-learn
On Monday, 18 May 2020 at 05:01:45 UTC, Andre Pany wrote: Hi, I have some issues, the get this program working on ubuntu: ``` Dockerfile FROM ubuntu:focal RUN apt-get update && apt-get upgrade -y \ && apt-get install --no-install-recommends -y build-essential ldc dub zlib1g-dev COPY

Re: D and Async I/O

2020-05-11 Thread ikod via Digitalmars-d-learn
On Monday, 11 May 2020 at 21:15:28 UTC, Steven Schveighoffer wrote: On 5/11/20 3:46 PM, ikod wrote: On Monday, 11 May 2020 at 17:34:41 UTC, Jacob Carlborg wrote: On 2020-05-11 16:44, Russel Winder wrote: Crickey, a third option. This wil increase my dithering! ;-) Forth: Mecca [1] :) [1]

Re: D and Async I/O

2020-05-11 Thread ikod via Digitalmars-d-learn
On Monday, 11 May 2020 at 17:34:41 UTC, Jacob Carlborg wrote: On 2020-05-11 16:44, Russel Winder wrote: Crickey, a third option. This wil increase my dithering! ;-) Forth: Mecca [1] :) [1] https://github.com/weka-io/mecca And probably more. At least I also have my async library for

Re: How to get to body of HTTP 500 error with std.net.curl.get()?

2020-02-16 Thread ikod via Digitalmars-d-learn
On Saturday, 15 February 2020 at 20:38:51 UTC, Anonymouse wrote: On Saturday, 15 February 2020 at 16:25:42 UTC, Gregor Mückl When testing to confirm I ran into a bug[2] where the body is sometimes empty, but outside of fringe cases it should work. [1]:

Re: Intersection of two sets

2019-12-03 Thread ikod via Digitalmars-d-learn
On Tuesday, 3 December 2019 at 13:43:26 UTC, Jan Hönig wrote: It seems i don't google the right keywords. What i want to do: I have two sets. (I didn't find how to do sets, so i have two associative boolean arrays `bool[]`). And i want to join them, via an intersection. I know how to code

Re: dmd memory usage

2019-11-17 Thread ikod via Digitalmars-d-learn
On Monday, 18 November 2019 at 00:20:12 UTC, Steven Schveighoffer wrote: I'm fighting some out of memory problems using DMD and some super-template heavy code. I have ideas on how to improve the situation, but it involves redesigning a large portion of the design. I want to do it

Re: (SOLVED) requests module generates " Can't parse uri '' "

2019-11-10 Thread ikod via Digitalmars-d-learn
On Sunday, 10 November 2019 at 01:28:13 UTC, cartland wrote: On Saturday, 9 November 2019 at 01:02:57 UTC, cartland wrote: On Saturday, 9 November 2019 at 00:53:13 UTC, cartland wrote: On Friday, 8 November 2019 at 17:01:07 UTC, ikod wrote: *snip* Even this does it. import requests; void

Re: requests module generates " Can't parse uri '' "

2019-11-08 Thread ikod via Digitalmars-d-learn
On Friday, 8 November 2019 at 03:29:41 UTC, cartland wrote: First time D use :) After dub init, I used the example from https://code.dlang.org/packages/requests and ran "dub add requests" [...] If you still stuck with this problem, you can post new issue on github project page, I'll try

Re: How should I sort a doubly linked list the D way?

2019-08-13 Thread ikod via Digitalmars-d-learn
On Tuesday, 13 August 2019 at 09:48:52 UTC, Mirjam Akkersdijk wrote: Hello there, If I had a DLL, how would I sort it judging by the node contents, the D way? In C if I were to sort a piece of malloc'd memory pointing to node pointers, I would write my compare function and let qsort sort it

Re: Error: @nogc function run cannot call non-@nogc destructor TcpServer.~this

2019-07-17 Thread ikod via Digitalmars-d-learn
On Wednesday, 17 July 2019 at 10:51:53 UTC, Newbie2019 wrote: this is very hard to made a minimal example, and the projects only build with ldc. There is a struct TcpServer has no destructor, and all method is @nogc nothrow. Then just add destructor with @nogc attribute.

Re: How to debug long-lived D program memory usage?

2019-04-22 Thread ikod via Digitalmars-d-learn
On Sunday, 21 April 2019 at 21:04:52 UTC, Patrick Schluter wrote: On Thursday, 18 April 2019 at 12:00:10 UTC, ikod wrote: On Wednesday, 17 April 2019 at 16:27:02 UTC, Adam D. Ruppe wrote: D programs are a vital part of my home computer infrastructure. I run some 60 D processes at almost any

Q: docs and guides for hunt

2019-04-21 Thread ikod via Digitalmars-d-learn
Hello, I'l like to try 'hunt' project to solve one of my problems, but I can't find docs and code samples or tutorials, etc. I even can't find if hunt (or hunt-framework) can be used for my task. Please, help! Here is short descriptions what I need - long running application, periodically

Re: How to debug long-lived D program memory usage?

2019-04-18 Thread ikod via Digitalmars-d-learn
On Wednesday, 17 April 2019 at 16:27:02 UTC, Adam D. Ruppe wrote: D programs are a vital part of my home computer infrastructure. I run some 60 D processes at almost any time and have recently been running out of memory. I usually run program under valgrind in this case. Though it will

Re: ddox and exempting dependencies

2018-12-05 Thread ikod via Digitalmars-d-learn
On Wednesday, 5 December 2018 at 17:12:03 UTC, Anonymouse wrote: On Wednesday, 5 December 2018 at 16:56:12 UTC, Andre Pany wrote: The compiler (DMD) is triggered to generate a JSON file docs.json which contains technical information used by ddox in a later step. The error message you see is

Re: what are the rules for @nogc and @safe attributes inference?

2018-11-30 Thread ikod via Digitalmars-d-learn
On Friday, 30 November 2018 at 21:03:06 UTC, Neia Neutuladh wrote: On Fri, 30 Nov 2018 20:41:03 +, ikod wrote: I can't find the reason why nogc/nothrow can't be inferred in this case: class S(K,V) { auto get/*()*/(K a) { return 0; } } void main() @nogc nothrow {

Re: what are the rules for @nogc and @safe attributes inference?

2018-11-30 Thread ikod via Digitalmars-d-learn
On Thursday, 15 November 2018 at 21:55:18 UTC, Steven Schveighoffer wrote: On 11/15/18 4:09 PM, Adam D. Ruppe wrote: On Thursday, 15 November 2018 at 21:00:48 UTC, ikod wrote: what are the rules for @nogc inference? It attempts it if and only if it is a template. Well, the general "rule"

Re: what are the rules for @nogc and @safe attributes inference?

2018-11-16 Thread ikod via Digitalmars-d-learn
On Friday, 16 November 2018 at 12:12:12 UTC, Alex wrote: = This code compiles as long as `lazy` is commented out. But I'd like to have both lazy parameter and @nogc inferrence for `library_func` so that user is not locked to code @nogc or

Re: what are the rules for @nogc and @safe attributes inference?

2018-11-16 Thread ikod via Digitalmars-d-learn
On Thursday, 15 November 2018 at 21:55:18 UTC, Steven Schveighoffer wrote: On 11/15/18 4:09 PM, Adam D. Ruppe wrote: On Thursday, 15 November 2018 at 21:00:48 UTC, ikod wrote: what are the rules for @nogc inference? It attempts it if and only if it is a template. Well, the general "rule"

Re: how to make '==' safe for classes?

2018-10-28 Thread ikod via Digitalmars-d-learn
Thanks for excellent explanation! On Sunday, 28 October 2018 at 19:00:52 UTC, Jonathan M Davis wrote: Because Object predats @safe (and most attributes), it really isn't compatible with them. In fact, it predates const (since it's basically the same as it was in D1) and it's only possible

Re: how to make '==' safe for classes?

2018-10-28 Thread ikod via Digitalmars-d-learn
On Sunday, 28 October 2018 at 18:00:06 UTC, Stanislav Blinov wrote: On Sunday, 28 October 2018 at 12:38:12 UTC, ikod wrote: and object.opEquals(a,b) do not inherits safety from class C properties, and also I can't override it. Yep. Since Object is the base class and it defines opEquals as:

how to make '==' safe for classes?

2018-10-28 Thread ikod via Digitalmars-d-learn
Hello How to make this code to compile? My goal is safe(not @trusted) longFunction(). --- class C { override bool opEquals(Object o) const @safe { return true; } } bool longFunction(C a, C b) @safe { return a==b; } void main() { } --- As far as I understand the

Re: How to curl!

2018-05-02 Thread ikod via Digitalmars-d-learn
On Wednesday, 2 May 2018 at 16:58:35 UTC, IntegratedDimensions wrote: On Wednesday, 2 May 2018 at 03:03:19 UTC, ikod wrote: On Wednesday, 2 May 2018 at 00:04:49 UTC, IntegratedDimensions wrote: On Tuesday, 1 May 2018 at 23:35:42 UTC, Arun Chandrasekaran wrote: [...] Ok, first try:

Re: How to curl!

2018-05-01 Thread ikod via Digitalmars-d-learn
On Wednesday, 2 May 2018 at 00:04:49 UTC, IntegratedDimensions wrote: On Tuesday, 1 May 2018 at 23:35:42 UTC, Arun Chandrasekaran wrote: On Tuesday, 1 May 2018 at 21:57:22 UTC, IntegratedDimensions wrote: [...] std.net.curl is not quite up to date when compared to the curl command. It is

Re: HTTP-methods and encoding

2018-04-08 Thread ikod via Digitalmars-d-learn
On Saturday, 7 April 2018 at 23:54:21 UTC, Vindex wrote: On Saturday, 7 April 2018 at 15:58:14 UTC, Seb wrote: On Saturday, 7 April 2018 at 13:02:39 UTC, Vindex wrote: There is an error on some sites when using HTTP-methods (std.net.curl.get, std.net.curl.post):

can be (){yield();} mark as @trusted?

2018-03-28 Thread ikod via Digitalmars-d-learn
Hello, I have very short function with only Fiber.yield() inside it, like: void f1() { yield(); } This function is called inside @safe function f2: void f2() @safe { f1(); } Can f1 be marked as @trusted so that I can keep @safe for the whole hierarchy of calls? Thanks!

inline @trusted code

2018-01-30 Thread ikod via Digitalmars-d-learn
Hello, Several times I faced with next problem: I have "@safe" routine with few calls to @system functions inside: OS calls (recv, send, kqueue) os some phobos unsafe functions like assumeUnique. I'd like not to wrap these @system functions in @trusted wrappers, but somehow mark these calls

Re: libcurl acting differently to curl.exe

2017-12-11 Thread ikod via Digitalmars-d-learn
On Monday, 11 December 2017 at 03:53:25 UTC, Josh wrote: The POST C code was: /* Sample code generated by the curl command line tool ** * All curl_easy_setopt() options are documented at: * https://curl.haxx.se/libcurl/c/curl_easy_setopt.html Maybe off-topic but you can

dub optional dependency

2017-10-28 Thread ikod via Digitalmars-d-learn
Hello, I have dub.json with two configurations: "configurations": [ { "name": "std", "targetType": "library" }, { "name": "vibed",

Re: Skynet 1M Fiber microbenchmark in D

2017-10-18 Thread ikod via Digitalmars-d-learn
On Wednesday, 18 October 2017 at 11:52:08 UTC, Biotronic wrote: On Wednesday, 18 October 2017 at 11:34:57 UTC, Nordlöw wrote: Another thing...how should the synchronization between the fibers figure out when the total number of fibers have reached one million?...via an atomic counter fed by

Re: What is the best way to use requests and iopipe on gzipped JSON file

2017-10-17 Thread ikod via Digitalmars-d-learn
Hello, Steve On Friday, 13 October 2017 at 22:22:54 UTC, Steven Schveighoffer wrote: On 10/13/17 6:18 PM, ikod wrote: On Friday, 13 October 2017 at 19:17:54 UTC, Steven Schveighoffer wrote: Eventually, something like this will be possible with jsoniopipe (I need to update and release this

Re: What is the best way to use requests and iopipe on gzipped JSON file

2017-10-13 Thread ikod via Digitalmars-d-learn
On Friday, 13 October 2017 at 19:17:54 UTC, Steven Schveighoffer wrote: On 10/13/17 2:47 PM, Andrew Edwards wrote: A bit of advice, please. I'm trying to parse a gzipped JSON file retrieved from the internet. The following naive implementation accomplishes the task: auto url =

Re: Different Output after each execution

2017-08-18 Thread ikod via Digitalmars-d-learn
On Friday, 18 August 2017 at 08:00:26 UTC, Vino.B wrote: Hi All, I have written a small program to just list the directories, but when i run the program each time i am getting different output, hence request you help, below is the code [...] Do you expect some strict execution order when

Re: D outperformed by C++, what am I doing wrong?

2017-08-13 Thread ikod via Digitalmars-d-learn
On Sunday, 13 August 2017 at 08:32:50 UTC, amfvcg wrote: Gives me 5 μs and 2 hnsecs 5000 3 secs, 228 ms, 837 μs, and 4 hnsecs 5000 And you've compiled it with? Btw. clang for c++ version works worse than gcc (for this case [112ms vs 180ms]). DMD64 D Compiler v2.074.1

Re: D outperformed by C++, what am I doing wrong?

2017-08-13 Thread ikod via Digitalmars-d-learn
On Sunday, 13 August 2017 at 08:13:56 UTC, amfvcg wrote: On Sunday, 13 August 2017 at 08:00:53 UTC, Daniel Kozak wrote: my second version on ldc takes 380ms and c++ version on same compiler (clang), takes 350ms, so it seems to be almost same Ok, on ideone (ldc 1.1.0) it timeouts, on dpaste

Re: lambda function with "capture by value"

2017-08-05 Thread ikod via Digitalmars-d-learn
On Saturday, 5 August 2017 at 18:45:34 UTC, Simon Bürger wrote: On Saturday, 5 August 2017 at 18:22:38 UTC, Stefan Koch wrote: [...] No, sometimes I want i to be the value it has at the time the delegate was defined. My actual usecase was more like this: void delegate()[3] dgs;

Re: Having a strange issue with std.net.curl.HTTP as a struct dependency

2017-07-12 Thread ikod via Digitalmars-d-learn
On Wednesday, 12 July 2017 at 08:24:12 UTC, NoBigDeal256 wrote: On Monday, 10 July 2017 at 20:55:19 UTC, ketmar wrote: NoBigDeal256 wrote: Do you happen to have a link to the bug report for this specific issue that I could look at? I looked at the known bugs list and couldn't find anything

Re: How to add authentificaion method to request?

2017-07-11 Thread ikod via Digitalmars-d-learn
On Tuesday, 11 July 2017 at 12:15:39 UTC, Suliman wrote: 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"));

Re: 'Access Violation Error' with parallel-foreach loop

2017-03-19 Thread ikod via Digitalmars-d-learn
On Sunday, 19 March 2017 at 00:46:29 UTC, ooyu wrote: On Saturday, 18 March 2017 at 22:27:27 UTC, Vladimir Panteleev wrote: [...] Aha! Thank you. I try again using std.file.write and input ubyte[] data. auto rq = Request(); auto d =

Re: 'Access Violation Error' with parallel-foreach loop

2017-03-18 Thread ikod via Digitalmars-d-learn
On Saturday, 18 March 2017 at 16:15:30 UTC, ooyu wrote: When i was uing parallel-foreach loop, got this error: object.Error@(0): Access Violation 0x0056CCB8 in _flushbu 0x005663C7 in fwrite 0x0041D39F in nothrow @nogc

Re: Date formatting in D

2017-03-07 Thread ikod via Digitalmars-d-learn
On Tuesday, 7 March 2017 at 20:29:07 UTC, aberba wrote: I've been trying to figure out an inbuilt functionality in phobos for formatting date. In my use case, I've been trying to format current Unix timestamp to something like "Thu, 08 Mar 2017 12:00:00 GMT". How do I go by this easily

Re: foreach for string[string]AA

2017-02-28 Thread ikod via Digitalmars-d-learn
On Tuesday, 28 February 2017 at 15:15:00 UTC, Anton Pastukhov wrote: I can't see the logic in AA foreach order. Consider this code: ``` void main() { string[string] test = [ "one": "1", "two": "2", "three": "3", "four": "4" ]; import

Re: trick to make throwing method @nogc

2017-02-25 Thread ikod via Digitalmars-d-learn
On Saturday, 25 February 2017 at 20:49:51 UTC, Adam D. Ruppe wrote: A wrapper that unifies these 4 steps like enforce is pretty easy to implement. yeah easy to use exception in @nogc as long as the catch knows to free it too. Alas, not my case. Exception can be catched not in my code.

Re: trick to make throwing method @nogc

2017-02-25 Thread ikod via Digitalmars-d-learn
On Saturday, 25 February 2017 at 19:59:29 UTC, ikod wrote: Hello, I have a method for range: struct Range { immutable(ubyte[]) _buffer; size_t _pos; @property void popFront() pure @safe { enforce(_pos < _buffer.length, "popFront from empty buffer");

trick to make throwing method @nogc

2017-02-25 Thread ikod via Digitalmars-d-learn
Hello, I have a method for range: struct Range { immutable(ubyte[]) _buffer; size_t _pos; @property void popFront() pure @safe { enforce(_pos < _buffer.length, "popFront from empty buffer"); _pos++; } } I'd like to have @nogc here, but I can't

vibed ssl stream and SSL_CTX_set_default_verify_paths

2016-11-15 Thread ikod via Digitalmars-d-learn
Hello, Sorry if this is FAQ, or any other way stupid question, e.t.c. I have to configure vibe.d tlsstream to verify remote certificate. Please correct me if I'm wrong -- here is part of my code to request certificate verification: auto sslctx = createTLSContext(TLSContextKind.client);

Re: Classes and Structs, Memory management questions

2016-09-02 Thread ikod via Digitalmars-d-learn
On Friday, 2 September 2016 at 08:43:45 UTC, dom wrote: Since garbage collection is a very nice feature that I wouldn't wanna miss for certain scenarios I think D should give us the opportunity to determine how an object is allocated. In the example above putting it on the stack is probably

Re: new XML and JSON libs and replacement of std.net.curl

2016-08-16 Thread ikod via Digitalmars-d-learn
On Tuesday, 16 August 2016 at 09:16:40 UTC, yawniek wrote: imo things should be modularized. so there should be (fast) protocol parsers first, something like https://github.com/h2o/picohttpparser or https://github.com/seanmonstar/httparse then a very simple eventloop that has abstractions and

Re: new XML and JSON libs and replacement of std.net.curl

2016-08-15 Thread ikod via Digitalmars-d-learn
On Monday, 15 August 2016 at 15:01:13 UTC, Oleg B wrote: Hello. As replacement of std.net.curl I found https://github.com/ikod/dlang-requests. Who know's about this lib? Is this good replacement of std.net.curl? Maybe if I need json and http requests I must fully use vibe for these things?

Re: std.range pipelike interface, inverting OutputStreams?

2016-08-13 Thread ikod via Digitalmars-d-learn
On Saturday, 13 August 2016 at 02:15:55 UTC, cy wrote: I was trying to use std.regex, and it takes an output stream to pump the result to, which is great, but I wanted to perform TWO replacements, one with the output of the previous, with data that might be a tricky size to cache redundantly.

docs generation for mixins

2016-05-15 Thread ikod via Digitalmars-d-learn
Hello, sorry if this question was asked before... How can I get docs generated for int z? - string V(string var) { return "int " ~ var ~ ";"; } /// struct X { /// comment for y int y; /// comment for z mixin(V("z")); } void main() { } - "dmd -D -Dddocs" generate

Re: What reasons are known a thread stops suddenly?

2016-02-04 Thread ikod via Digitalmars-d-learn
On Thursday, 4 February 2016 at 20:25:27 UTC, tcak wrote: Is there any known reason for a thread to suddenly stop like this? Your listener object can be GC-ed. Check if you have any live ref to it.

attributes and properties lookup order

2016-01-26 Thread ikod via Digitalmars-d-learn
Hello $ cat t.d import std.net.curl: get; void main() { string[string] x; string y = x.get("",""); } $ dmd t.d t.d(6): Error: template std.net.curl.get cannot deduce function from argument types !()(string[string], string, string), candidates are: