Request you advise : isValidFilename

2023-09-22 Thread Vino via Digitalmars-d-learn
Hi All, Request you help in understanding why the below code is always returning true when it should return false as per the documentation. Documentation ``` Checks that the given file or directory name is valid. The maximum length of filename is given by the constant

Re: container vs standard array

2023-09-19 Thread vino via Digitalmars-d-learn
On Tuesday, 19 September 2023 at 20:20:17 UTC, Nick Treleaven wrote: On Tuesday, 19 September 2023 at 19:57:34 UTC, Nick Treleaven wrote: This is because a single array can be passed to a typesafe variadic parameter rather than elements of that array type. And then immutable(char) doesn't

Array!string -> data compression -> Data Encryption -> Hash statement

2023-09-19 Thread Vino via Digitalmars-d-learn
Hi All, We have a requirement as below, and I tried the libraries such as std.digest, crypto, botan etc but no luck, hence request you suggestion's on how to achieve the below requirement. Array!string -> data compression -> Data Encryption -> Hash statement -> store the result in

container vs standard array

2023-09-18 Thread vino via Digitalmars-d-learn
Hi All, I am trying to understand as to why the below code is throwing error Code ``` import std.stdio: writeln; import std.container.array; void main () { //auto a = Array!string("Aname"); // throws error auto b = Array!char("Bname");// works auto c =

Re: Help on array pointers

2023-09-17 Thread vino via Digitalmars-d-learn
On Sunday, 17 September 2023 at 18:28:36 UTC, Joe wrote: On Friday, 15 September 2023 at 16:55:34 UTC, Vino wrote: [...] [...] char[] invalid = (cast(char*)malloc(char.sizeof * len))[0..len]; This is not the way to go about it. You are mixing "pointer arrays" with "arrays". [...]

Re: Help on array pointers

2023-09-15 Thread Vino via Digitalmars-d-learn
On Friday, 15 September 2023 at 15:27:00 UTC, Vino wrote: On Friday, 15 September 2023 at 02:25:09 UTC, Joe wrote: On Thursday, 14 September 2023 at 14:21:09 UTC, Vino wrote: [...] A pointer is a type that points to something. It's literally that simple. Every piece of data and code exist

Re: Help on array pointers

2023-09-15 Thread Vino via Digitalmars-d-learn
On Friday, 15 September 2023 at 02:25:09 UTC, Joe wrote: On Thursday, 14 September 2023 at 14:21:09 UTC, Vino wrote: [...] A pointer is a type that points to something. It's literally that simple. Every piece of data and code exist somewhere in memory. Every piece of memory has an address.

Re: Help on array pointers

2023-09-14 Thread vino via Digitalmars-d-learn
On Thursday, 14 September 2023 at 17:23:53 UTC, Vino wrote: On Thursday, 14 September 2023 at 15:33:45 UTC, Paul Backus wrote: On Thursday, 14 September 2023 at 14:21:09 UTC, Vino wrote: Questions:1 ``` char[] invalid = (cast(char*)malloc(char.sizeof * length))[0..length]; ``` The above

Re: Help on array pointers

2023-09-14 Thread Vino via Digitalmars-d-learn
On Thursday, 14 September 2023 at 15:33:45 UTC, Paul Backus wrote: On Thursday, 14 September 2023 at 14:21:09 UTC, Vino wrote: Questions:1 ``` char[] invalid = (cast(char*)malloc(char.sizeof * length))[0..length]; ``` The above statement allocate memory for char type and the size of the

Struct nested function

2023-09-13 Thread vino via Digitalmars-d-learn
Hi All, Request your help, I have a struct which has many functions, I need to run a function from within another function(From Display function execute the runner function), an example as below ``` import std.stdio: writeln; import std.algorithm: joiner; import std.parallelism: task;

Re: pipeProcess output to hash string

2023-09-11 Thread vino via Digitalmars-d-learn
On Monday, 11 September 2023 at 22:08:54 UTC, Christian Köstlin wrote: On 09.09.23 17:44, Vino wrote: Hi All,   Request your help on how to convert the output of std.process.pipeProcess to hash string ``` auto test(in Redirect redirect=Redirect.stdout | Redirect.stderr) {     import

Json Help

2023-09-10 Thread Vino via Digitalmars-d-learn
Hi All, Request your help on the below code,I am trying to convert the below string to json and it always throws the error, if the below can be accomplished with any other json package even that is fine, I tired only the std.json package. Test Program: Works import std.json; import

Re: pipeProcess output to hash string

2023-09-10 Thread Vino via Digitalmars-d-learn
On Saturday, 9 September 2023 at 16:49:30 UTC, user1234 wrote: On Saturday, 9 September 2023 at 15:44:44 UTC, Vino wrote: [...] With a slightly modified command line that works on linux here : ```d import std.process, std.stdio; auto test(in Redirect redirect=Redirect.stdout |

pipeProcess output to hash string

2023-09-09 Thread Vino via Digitalmars-d-learn
Hi All, Request your help on how to convert the output of std.process.pipeProcess to hash string ``` auto test(in Redirect redirect=Redirect.stdout | Redirect.stderr) { import std.process; import std.digest.crc; import std.stdio: writeln; result =

Re: isBinary

2023-09-03 Thread Vino via Digitalmars-d-learn
On Sunday, 3 September 2023 at 10:15:31 UTC, FeepingCreature wrote: On Sunday, 3 September 2023 at 10:11:22 UTC, Vino wrote: Hi All, Any update as to when the function described in the below ticked would be action-ed, I am more interested in isBinary (check a file whether is is binary

Unicode validation for Posix

2023-09-03 Thread Vino via Digitalmars-d-learn
Hi All, As per the documentation from std.process it states that an exception is thrown if the variable contains invalid UTF-16 characters and it can also be validated using "validate" function from std.utf, so the question is do we have a similar one for Posix as this seem to be

Re: Function Pointer

2023-08-31 Thread vino via Digitalmars-d-learn
On Wednesday, 30 August 2023 at 21:12:57 UTC, Paul Backus wrote: On Wednesday, 30 August 2023 at 17:48:19 UTC, Vino wrote: Hi All, Request your help on hot to create a pointer for a function whose function type is Result. ``` ReturnType!(typeof()).stringof; // Result From Vino ``` To

Re: pointer to std.algorithm.iteration : splitter

2023-08-31 Thread vino via Digitalmars-d-learn
On Thursday, 31 August 2023 at 10:46:53 UTC, Dukc wrote: On Thursday, 31 August 2023 at 05:16:02 UTC, Vino wrote: [...] I'm assuming you want to instantiate `splitter` and take the address of the resulting function, so that `splitter_ptr` will be a function pointer or a delegate. [...]

pointer to std.algorithm.iteration : splitter

2023-08-30 Thread Vino via Digitalmars-d-learn
Hi All, Request your help on the below error Program ``` void main() { import std.stdio:writeln; import std.algorithm.iteration : splitter; auto splitter_ptr = !((a, b) => a.splitter(b).array); string str = "TEST1;TEST2;TEST3"; auto words =

Re: Pointer to environment.get

2023-08-30 Thread Vino via Digitalmars-d-learn
On Monday, 28 August 2023 at 10:27:07 UTC, Basile B. wrote: On Monday, 28 August 2023 at 10:20:14 UTC, Basile B. wrote: [...] To go further, the correct code for syntax you wanted to use is actually ```d alias Ext_T = string (const char[] a, string b); // define a function type alias

Re: Function to get the current hostname for both Windows and Posix

2023-08-28 Thread Vino via Digitalmars-d-learn
On Sunday, 27 August 2023 at 21:33:57 UTC, Jonathan M Davis wrote: On Sunday, August 27, 2023 10:02:35 AM MDT vino via Digitalmars-d-learn wrote: Hi All, May i know whether these is function to find the current hostname both in windows and Posix. From, Vino It looks like std.socket's

Pointer to environment.get

2023-08-28 Thread Vino via Digitalmars-d-learn
Hi All, The the below code is not working, hence requesting your help. Code: ``` import std.stdio; import std.process: environment; void main () { int* ext(string) = ("PATHEXT"); writeln(*ext); } ```

Re: Finding duplicate elements

2023-08-27 Thread vino via Digitalmars-d-learn
On Wednesday, 16 August 2023 at 12:51:31 UTC, FeepingCreature wrote: On Tuesday, 15 August 2023 at 17:59:27 UTC, vino wrote: [...] ``` import std; void main() { string[] args = [" test3", "test2 ", " test1 ", " test1 ", " "]; findDuplicates(args); } void findDuplicates(string[]

Package resusage issue.

2023-08-26 Thread vino via Digitalmars-d-learn
Hi All, I am trying to use the package resusage, and I am getting the below error message, googled for this error and tried all the solution provided still facing the same issue, hence requesting your help. Solution Provided ``` dism.exe /image:C: /cleanup-image /revertpendingactions

Config and Config.Flags difference

2023-08-25 Thread vino via Digitalmars-d-learn
Hi All, Request you to please help me in understanding the difference between the below 2, if possible with an example. Config.suppressConsole Config.Flags.suppressConsole From, Vino.

Help on reading an yaml file using dyaml

2023-08-25 Thread vino via Digitalmars-d-learn
Hi All, Request your help on reading a yaml file using dyaml. input.yaml ``` name: "This is test Program" program: prg: "whoami" args: "/?" env: config: flag: workdir: shellPath: ``` Program: ``` import dyaml; import std.stdio; void main () { Node config;

Finding duplicate elements

2023-08-15 Thread vino via Digitalmars-d-learn
Hi All, Request your help in finding duplicate element without sorting as per the below example ``` Example: string[] args = [" test3", "test2 ", " test1 ", " test1 ", " "]; Output Required: If duplicate element found then print "Duplicate element found: " else print ["test3", "test2",

vibe.db.postgresql: Example not working in Windows

2023-04-14 Thread Vino via Digitalmars-d-learn
Hi All, I was just trying the new package vibe.db.postgresql and the example provided is not working, can some one provide me an working example. Step performed ``` dub init dub add vibe-d-postgresql copy the example program to source/app.d dub run ``` Error ``` source\app.d(3,8): Error:

Mir-ion:YAML Example

2023-04-12 Thread Vino via Digitalmars-d-learn
Hi All, Can some point me where i can find examples on how to use mir-ion YAML From, Vino.B

DYaml

2023-04-09 Thread Vino via Digitalmars-d-learn
Hi All, I am trying to use D-YAML for one of my project, and just tired the example for this link https://dlang-community.github.io/D-YAML/tutorials/getting_started.html, the example is working fine, so i would like to know who to i validate the node, eg Example Code ``` import std.stdio;

Starting and managing threads

2023-03-24 Thread Vino via Digitalmars-d-learn
https://forum.dlang.org/post/eeqqmlojlniiihgyb...@forum.dlang.org On Sunday, 16 January 2022 at 09:38:52 UTC, Bagomot wrote: The program does nothing probably because of that continue. (?) No, it does work inside the loop. So, the event loop is in a separate thread. What should happen when

File difference module similar to the Linux command "comm"

2021-09-11 Thread Vino via Digitalmars-d-learn
Hi All, May i know whether there is any module similar to the Linux command "comm" (finding difference between 2 files), if present can you please guide me through link to the page nor do let me know if there is any other solution. Eg File1 list1 list2 list3 lsit5 File2 list1 list3

Re: Array permutations

2021-09-11 Thread Vino via Digitalmars-d-learn
On Saturday, 11 September 2021 at 23:04:29 UTC, Vino wrote: On Saturday, 11 September 2021 at 19:57:26 UTC, jfondren wrote: [...] Hi, Thank you very much, let me try to explain the actual requirement, the actual requirement is to find all the permutations of a given array, I modified

Re: Array permutations

2021-09-11 Thread Vino via Digitalmars-d-learn
On Saturday, 11 September 2021 at 19:57:26 UTC, jfondren wrote: On Saturday, 11 September 2021 at 19:37:42 UTC, Vino wrote: Hi All, Request your help on the below to print the below array as "Required output", Was able to get these values "[1,2],[2,3],[3,4],[4,5]" by using list.slide(2),

Array permutations

2021-09-11 Thread Vino via Digitalmars-d-learn
Hi All, Request your help on the below to print the below array as "Required output", Was able to get these values "[1,2],[2,3],[3,4],[4,5]" by using list.slide(2), need your help to get values "1,3],[1,4],[1,5],[2,4],[2,5],[3,5]" auto list[] = [1,2,3,4,5] Required output

Re: Calling function within class.

2020-11-19 Thread Vino via Digitalmars-d-learn
On Wednesday, 18 November 2020 at 21:33:58 UTC, Ali Çehreli wrote: On 11/18/20 7:01 AM, Vino wrote: >Request your help on how to call a function(listFile) from another > function(getFilelist) within the same class(GetDirlist), below is an > example code. That code looks unnecessarily

Re: Calling function within class.

2020-11-18 Thread Vino via Digitalmars-d-learn
On Wednesday, 18 November 2020 at 18:24:59 UTC, frame wrote: On Wednesday, 18 November 2020 at 17:55:36 UTC, Vino wrote: I made the changes as below , still not working auto fltask = task!listFile(st); to auto fltask = task!({listFile(st);})(this).executeInNewThread(); The syntax is

Re: Calling function within class.

2020-11-18 Thread Vino via Digitalmars-d-learn
On Wednesday, 18 November 2020 at 16:53:44 UTC, frame wrote: On Wednesday, 18 November 2020 at 15:01:53 UTC, Vino wrote: Hi All, Request your help on how to call a function(listFile) from another function(getFilelist) within the same class(GetDirlist), below is an example code. I think

Re: Executing AWS commands

2020-11-18 Thread Vino via Digitalmars-d-learn
On Tuesday, 17 November 2020 at 21:08:21 UTC, Paul Backus wrote: On Tuesday, 17 November 2020 at 19:07:42 UTC, Vino wrote: auto pid = execute(["/usr/bin/aws ec2 describe-images --filters 'Name=state,Values=available' --query 'Images[*].[ImageId]'"]); [...] auto pid = execute(["/usr/bin/aws

Calling function within class.

2020-11-18 Thread Vino via Digitalmars-d-learn
Hi All, Request your help on how to call a function(listFile) from another function(getFilelist) within the same class(GetDirlist), below is an example code. Code: class GetDirlist { @system private auto listFile(immutable string st) { auto fl = execute(["ls","-l"]); enforce(fl.status

Executing AWS commands

2020-11-17 Thread Vino via Digitalmars-d-learn
Hi All, Request your help on how to execute aws commands, below is an example code, and this code is not working, tried several options nothing seem to be working. Code: import std.process: environment, execute; import std.stdio: writeln; void main() { environment["AWS_DEFAULT_REGION"] =

Re: Request our suggestio: better way to insert data from Array!string[string] into a database table

2020-11-16 Thread Vino via Digitalmars-d-learn
On Monday, 16 November 2020 at 18:30:01 UTC, Max Haughton wrote: On Monday, 16 November 2020 at 17:44:08 UTC, Vino wrote: Hi All, Request your suggestion, we have a program which call's an api, the output of the api is parsed using json parser and the result is stored in an

Request our suggestio: better way to insert data from Array!string[string] into a database table

2020-11-16 Thread Vino via Digitalmars-d-learn
Hi All, Request your suggestion, we have a program which call's an api, the output of the api is parsed using json parser and the result is stored in an array(Array!string[string] data), then these stored result are inserted into MySQL table, for inserting the data into the table we use

Re: canFind all elements in a array.

2020-11-10 Thread Vino via Digitalmars-d-learn
On Tuesday, 10 November 2020 at 09:47:06 UTC, sarn wrote: On Tuesday, 10 November 2020 at 08:19:15 UTC, Vino wrote: [...] This is iterating over all the elements in data2 and outputting some of them, so the output will never be longer than data2. [...] Hi Sarn, Thank you very much

canFind all elements in a array.

2020-11-10 Thread Vino via Digitalmars-d-learn
Hi All, Request your help, the below code output's as below hence request your help on hot to get the output as below(Required Output). Output DEV Cluster QAS Cluster Required Output DEV Cluster DEV Cluster DEV Cluster QAS Cluster Code import std.container.array; import std.stdio:

Re: std.net.curl : Performance

2020-11-09 Thread Vino via Digitalmars-d-learn
On Monday, 9 November 2020 at 20:57:33 UTC, Daniel Kozak wrote: On Mon, Nov 9, 2020 at 9:50 PM rinfz via Digitalmars-d-learn < digitalmars-d-learn@puremagic.com> wrote: On Monday, 9 November 2020 at 20:40:59 UTC, rinfz wrote: > On Monday, 9 November 2020 at 19:55:07 UTC, Vino wrote: >> ... >

std.net.curl : Performance

2020-11-09 Thread Vino via Digitalmars-d-learn
Hi All, Request your help to on how to improve the performance of the below code. import std.conv: to; import std.net.curl : get, HTTP, CurlOption; import std.parallelism: parallel; import std.range: chain, only; import std.typecons: Tuple, tuple; void main () { Array!(Tuple!(int,string))

Re: Extract sub string from a string

2020-11-09 Thread Vino via Digitalmars-d-learn
On Monday, 9 November 2020 at 18:55:44 UTC, Ali Çehreli wrote: On 11/9/20 9:53 AM, k2aj wrote: > string text = "welcome2worldinfo"; > string hg = toUpper(text[0..7] ~ "-" ~ text[7..8] ~ "-" ~ text[8..13]); If those concatenations with the ~ operators prove to be costly at runtime, the

Extract sub string from a string

2020-11-09 Thread Vino via Digitalmars-d-learn
Hi All, Request your help on how to extract sub string from a string, below is an example in PHP, need your help on how to do the same in D. $text = "welcome2worldinfo"; $hg = strtoupper(substr($text , 0, 7).'-'.substr($text, 7, 1).'-'.substr($text, 8, 5)); print_r($hg) \\ Output :

Re: asdf get first value from a json string.

2020-11-09 Thread Vino via Digitalmars-d-learn
On Sunday, 8 November 2020 at 19:31:50 UTC, frame wrote: On Sunday, 8 November 2020 at 19:29:39 UTC, frame wrote: On Sunday, 8 November 2020 at 16:30:40 UTC, Vino wrote: Request your help on how to get the first value of "type" from the below json, the expected output required is as below,

asdf get first value from a json string.

2020-11-08 Thread Vino via Digitalmars-d-learn
Hi All, Request your help on how to get the first value of "type" from the below json, the expected output required is as below, {"characteristicValue":"TT,t...@dev.com,DEV"} output1: TT output2: t...@dev.com Code: /+dub.sdl: dependency "asdf" version="~>0.6.6" +/ import std; import

Re: Comparison : mysql-native + asdf and hunt-database + asdf

2020-11-07 Thread Vino via Digitalmars-d-learn
On Saturday, 7 November 2020 at 15:26:48 UTC, frame wrote: On Saturday, 7 November 2020 at 14:57:39 UTC, Vino wrote: After further analysis we suspect that the issue is at the package std.net.curl the flow of the program is as below Establishing a new connection may vary in duration of

Re: Comparison : mysql-native + asdf and hunt-database + asdf

2020-11-07 Thread Vino via Digitalmars-d-learn
On Saturday, 7 November 2020 at 14:38:35 UTC, Vino wrote: On Saturday, 7 November 2020 at 14:16:46 UTC, Vino wrote: On Saturday, 7 November 2020 at 12:29:46 UTC, Andre Pany wrote: On Friday, 6 November 2020 at 04:58:05 UTC, Vino wrote: [...] While doing performance measurements you should

Re: Comparison : mysql-native + asdf and hunt-database + asdf

2020-11-07 Thread Vino via Digitalmars-d-learn
On Saturday, 7 November 2020 at 14:16:46 UTC, Vino wrote: On Saturday, 7 November 2020 at 12:29:46 UTC, Andre Pany wrote: On Friday, 6 November 2020 at 04:58:05 UTC, Vino wrote: [...] While doing performance measurements you should do each test multiple time (at least 5 times). There could

Re: Comparison : mysql-native + asdf and hunt-database + asdf

2020-11-07 Thread Vino via Digitalmars-d-learn
On Saturday, 7 November 2020 at 12:29:46 UTC, Andre Pany wrote: On Friday, 6 November 2020 at 04:58:05 UTC, Vino wrote: [...] While doing performance measurements you should do each test multiple time (at least 5 times). There could be for example an effect that executing a db query the

Re: Vibe.d build on LDC error

2020-11-06 Thread Vino via Digitalmars-d-learn
On Friday, 6 November 2020 at 10:30:03 UTC, Mathias LANG wrote: On Friday, 6 November 2020 at 05:52:56 UTC, Vino wrote: [...] Which Linux distribution ? Which version of Vibe.d ? A recent enough Vibe.d should detect OpenSSL based on 1) pkg-config 2) the openssl binary. Make sure you have the

Vibe.d build on LDC error

2020-11-05 Thread Vino via Digitalmars-d-learn
Hi All, When we try to build vide.d using ldc (dub build) we are getting the below error, openssl is already been installed (OpenSSL 1.0.2j-fips 26 Sep 2016), hence request your help on the same. openssl.d:84: error: undefined reference to 'OPENSSL_init_ssl' openssl.d:121: error:

Comparison : mysql-native + asdf and hunt-database + asdf

2020-11-05 Thread Vino via Digitalmars-d-learn
Hi All, We recently tested the below components and the test results are as below, even though hunt-database is faster than mysql-native it is hard to use this package as it lacks on documentation, non of the example provided in the documentation works, one has to go through the code and

Re: Hunt database

2020-11-03 Thread Vino via Digitalmars-d-learn
On Tuesday, 3 November 2020 at 18:14:33 UTC, Andre Pany wrote: On Tuesday, 3 November 2020 at 14:05:18 UTC, Vino wrote: Hi All, Currently testing Hunt database, and facing an issue as below, hence request your help File : GetConnections.d ### module

Re: Hunt database

2020-11-03 Thread Vino via Digitalmars-d-learn
On Tuesday, 3 November 2020 at 14:47:01 UTC, Imperatorn wrote: On Tuesday, 3 November 2020 at 14:05:18 UTC, Vino wrote: Hi All, Currently testing Hunt database, and facing an issue as below, hence request your help [...] What datatype is Seq in your settings table? Hi, The filed Seq

Hunt database

2020-11-03 Thread Vino via Digitalmars-d-learn
Hi All, Currently testing Hunt database, and facing an issue as below, hence request your help File : GetConnections.d ### module common.GetConnections; import hunt.database; class Connections { public Database conn; this() { conn = new

Removind duplicates for JSON string

2020-11-01 Thread Vino via Digitalmars-d-learn
Hi All, Request your help on how to remove duplicates in JSON. Code: import asdf; import std.algorithm : map, filter, uniq; import std.container.array; import std.stdio : writeln; import std.typecons : Tuple, tuple; import std.array; void main() { string apidata = `{ "items": [ {

Re: merging container arrays

2020-10-31 Thread Vino via Digitalmars-d-learn
On Saturday, 31 October 2020 at 15:16:22 UTC, Vino wrote: Hi All, Request your help on the below code, the requirement is that result's are stored in one single container. Code: import asdf; import std.algorithm: map; import std.container.array; import std.stdio: writeln; import

merging container arrays

2020-10-31 Thread Vino via Digitalmars-d-learn
Hi All, Request your help on the below code, the requirement is that result's are stored in one single container. Code: import asdf; import std.algorithm: map; import std.container.array; import std.stdio: writeln; import std.typecons: Tuple, tuple; import std.range: lockstep; auto api1()

Re: Json output to container

2020-10-31 Thread Vino via Digitalmars-d-learn
On Friday, 30 October 2020 at 19:33:43 UTC, Paul Backus wrote: On Friday, 30 October 2020 at 19:07:20 UTC, Vino wrote: [...] Here's a working version of the code from your original post: import asdf : parseJson; import std.algorithm; import std.container.array; import std.stdio : writeln;

Re: Json output to container

2020-10-30 Thread Vino via Digitalmars-d-learn
On Friday, 30 October 2020 at 19:07:20 UTC, Vino wrote: On Friday, 30 October 2020 at 18:41:35 UTC, Paul Backus wrote: On Friday, 30 October 2020 at 10:23:22 UTC, Vino wrote: Hi, Request your help on the below code [...] .filter!(a => a.(["items"].byElement)) What exactly

Re: Json output to container

2020-10-30 Thread Vino via Digitalmars-d-learn
On Friday, 30 October 2020 at 18:41:35 UTC, Paul Backus wrote: On Friday, 30 October 2020 at 10:23:22 UTC, Vino wrote: Hi, Request your help on the below code [...] .filter!(a => a.(["items"].byElement)) What exactly are you trying to accomplish with this `a.(stuff)`

Re: Json output to container

2020-10-30 Thread Vino via Digitalmars-d-learn
On Friday, 30 October 2020 at 17:56:22 UTC, Andre Pany wrote: On Friday, 30 October 2020 at 10:23:22 UTC, Vino wrote: Hi, Request your help on the below code Code: import asdf: parseJson; import std.algorithm; import std.container.array; import std.stdio: writeln; import std.typecons:

Json output to container

2020-10-30 Thread Vino via Digitalmars-d-learn
Hi, Request your help on the below code Code: import asdf: parseJson; import std.algorithm; import std.container.array; import std.stdio: writeln; import std.typecons: Tuple, tuple; void main() { string apidata1 = `{"items": [ {"name":"T01","hostname":"test01","pool":"Development"},

Associative array using std.container.array

2020-10-28 Thread Vino via Digitalmars-d-learn
Hi All, Is it possible to create an associative array using std.container.array, if possible can you please provide me an example nor send me some link which has this information. From, Vino.B

asdf: filter value and print the next value

2020-10-28 Thread Vino via Digitalmars-d-learn
Hi All, Request your help in the below code, the logic is that fetch the json data(Pool) from apidata1 and use that and search for "pool" in sapidata2 and print the matched(pool) type from apidata2. Code: import datacollector.GetLamaAssignment; import std.stdio: writeln; import asdf:

Re: Foreach output into a multi dimensional associative array.

2020-10-28 Thread Vino via Digitalmars-d-learn
On Tuesday, 27 October 2020 at 08:00:55 UTC, Imperatorn wrote: On Monday, 26 October 2020 at 19:05:04 UTC, Vino wrote: [...] Some comments: 1. You're missing a comma (,) after the first item in your apidata 2. You're creating a string[int][string] instead of string[][string] (your

Re: mir.ndslice : multi dimensional associative array - Example/Docs

2020-10-28 Thread Vino via Digitalmars-d-learn
On Tuesday, 27 October 2020 at 02:50:55 UTC, 9il wrote: On Monday, 26 October 2020 at 14:31:00 UTC, Vino wrote: [...] No. ndslice provides rectangular arrays. An associative array (as it defined in D) can't be really 2D, instead, it is an AA of AAs like in your example. A real 2D analog

Foreach output into a multi dimensional associative array.

2020-10-26 Thread Vino via Digitalmars-d-learn
Hi All, Request your help on the below on how to store the output to a multi dimensional associative array. Code: import std.stdio: writeln; import asdf: parseJson; import std.conv: to; void main() { string[int][string] aa; string apidata = `{"items": [

mir.ndslice : multi dimensional associative array - Example/Docs

2020-10-26 Thread Vino via Digitalmars-d-learn
Hi All, Is it possible to create a multi dimensional associative array using mir.ndslice, if yes, (1): request you to point me to some example / docs (2): below is an example multi dimensional associative array using the core d module, and how can we to implement the same

Re: Help on asdf json module

2020-10-26 Thread Vino via Digitalmars-d-learn
On Monday, 26 October 2020 at 09:43:44 UTC, Vino wrote: On Sunday, 25 October 2020 at 08:22:06 UTC, 9il wrote: [...] Hi All, Thank you for your help, and now need your suggestion as the below code is working and it also prints an additional value which is not expected, so request your

Re: Help on asdf json module

2020-10-26 Thread Vino via Digitalmars-d-learn
On Sunday, 25 October 2020 at 08:22:06 UTC, 9il wrote: 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

Help on asdf json module

2020-10-25 Thread Vino via Digitalmars-d-learn
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 "asdf" and throwing the below error, hence request your

Re: mysql-native Help required

2020-10-25 Thread Vino via Digitalmars-d-learn
On Friday, 23 October 2020 at 20:28:40 UTC, aberba wrote: On Thursday, 22 October 2020 at 18:43:40 UTC, Steven Schveighoffer wrote: [...] Was about to say that. Part of why I think some people hate OOP...due to misuse. All my MySQL projects have this getConnection() function. Hi All,

Re: mysql-native Help required

2020-10-22 Thread Vino via Digitalmars-d-learn
On Thursday, 22 October 2020 at 14:08:30 UTC, Steven Schveighoffer wrote: On 10/22/20 7:04 AM, Vino wrote: Hi All,   Request your help on the below code as it is not working as expected. GetConnections.d module common.GetConnections; import mysql; class Connections {   private

mysql-native Help required

2020-10-22 Thread Vino via Digitalmars-d-learn
Hi All, Request your help on the below code as it is not working as expected. GetConnections.d module common.GetConnections; import mysql; class Connections { private Connection conn; auto constr = "host=localhost;port=3910;user=user;pwd=password#;db=testdb"; this.conn = new

Re: std.net.curl get json_encode

2020-10-11 Thread Vino via Digitalmars-d-learn
On Friday, 9 October 2020 at 17:50:16 UTC, Andre Pany wrote: On Friday, 9 October 2020 at 05:56:05 UTC, Vino wrote: On Friday, 9 October 2020 at 05:30:34 UTC, ikod wrote: 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

Re: std.net.curl get json_encode

2020-10-09 Thread Vino via Digitalmars-d-learn
On Friday, 9 October 2020 at 05:30:34 UTC, ikod wrote: 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;

Re: std.net.curl get json_encode

2020-10-08 Thread Vino via Digitalmars-d-learn
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, Request your help, the below code is working but we need the output as a json array, in PHP we have json_encode(content), so how to do the same in D, the output is

std.net.curl get json_encode

2020-10-02 Thread Vino via Digitalmars-d-learn
Hi All, Request your help, the below code is working but we need the output as a json array, in PHP we have json_encode(content), so how to do the same in D, the output is as below, as we need to store this output into database table which contains columns' (Id, Hostname,

Re: std.net.curl.CurlException Couldn't resolve host name on handle

2020-03-13 Thread Vino via Digitalmars-d-learn
On Saturday, 14 March 2020 at 04:24:20 UTC, Vino wrote: On Friday, 13 March 2020 at 18:10:51 UTC, Vino wrote: Hi All, Request your help, the below code is fetching the required data, after fetching the data at the end it throws the below errors , hence request your help on how to handle

Re: std.net.curl.CurlException Couldn't resolve host name on handle

2020-03-13 Thread Vino via Digitalmars-d-learn
On Friday, 13 March 2020 at 18:10:51 UTC, Vino wrote: Hi All, Request your help, the below code is fetching the required data, after fetching the data at the end it throws the below errors , hence request your help on how to handle this issue. Code: import std.net.curl, std.stdio,

std.net.curl.CurlException Couldn't resolve host name on handle

2020-03-13 Thread Vino via Digitalmars-d-learn
Hi All, Request your help, the below code is fetching the required data, after fetching the data at the end it throws the below errors , hence request your help on how to handle this issue. Code: import std.net.curl, std.stdio, std.conv: to; void main () { auto http = HTTP();

Re: PHP to D Conversion

2019-10-21 Thread Vino via Digitalmars-d-learn
On Saturday, 19 October 2019 at 20:40:36 UTC, Boris Carvajal wrote: On Saturday, 19 October 2019 at 19:08:45 UTC, Vino wrote: On Friday, 18 October 2019 at 14:56:05 UTC, Andre Pany wrote: On Friday, 18 October 2019 at 09:21:46 UTC, Vino wrote: On Friday, 18 October 2019 at 09:17:24 UTC, Vino

Re: PHP to D Conversion

2019-10-19 Thread Vino via Digitalmars-d-learn
On Friday, 18 October 2019 at 14:56:05 UTC, Andre Pany wrote: On Friday, 18 October 2019 at 09:21:46 UTC, Vino wrote: On Friday, 18 October 2019 at 09:17:24 UTC, Vino wrote: [...] And now getting the error : Program exited with code -1073741819 Hi, Maybe port 8080 is blocked, because

Re: PHP to D Conversion

2019-10-18 Thread Vino via Digitalmars-d-learn
On Friday, 18 October 2019 at 09:17:24 UTC, Vino wrote: On Friday, 18 October 2019 at 09:11:18 UTC, Vino wrote: [...] App.d import vibe.vibe; import avm.test; void main() { auto settings = new HTTPServerSettings; settings.port = 8080; settings.bindAddresses =

Re: PHP to D Conversion

2019-10-18 Thread Vino via Digitalmars-d-learn
On Friday, 18 October 2019 at 09:11:18 UTC, Vino wrote: On Friday, 18 October 2019 at 08:54:40 UTC, Jacob Carlborg wrote: On Friday, 18 October 2019 at 06:22:33 UTC, Vino wrote: [...] The instance variable in the D code, `conn`, doesn't have a type. I guess the type should be `Connection`.

Re: PHP to D Conversion

2019-10-18 Thread Vino via Digitalmars-d-learn
On Friday, 18 October 2019 at 08:54:40 UTC, Jacob Carlborg wrote: On Friday, 18 October 2019 at 06:22:33 UTC, Vino wrote: [...] The instance variable in the D code, `conn`, doesn't have a type. I guess the type should be `Connection`. In the D version of `avmconnect` you're declaring a

Re: Vibe.d Error

2019-10-18 Thread Vino via Digitalmars-d-learn
On Thursday, 17 October 2019 at 19:02:14 UTC, Vino wrote: On Thursday, 17 October 2019 at 18:12:54 UTC, Andre Pany wrote: On Thursday, 17 October 2019 at 10:58:20 UTC, Vino wrote: Hi All, We are planning to migrate our website form Mysql/PHP to Mysql/D using vibe.d , as part of the plan we

PHP to D Conversion

2019-10-18 Thread Vino via Digitalmars-d-learn
Hi All, Request your help in converting a PHP code to D equivalent code PHP Code: class avmtest { private $con; function __construct() { global $config; $this->con = new mysqli(test.srv.com:3910, testusr, #, test);

Re: Vibe/Mysql Testing

2019-10-18 Thread Vino via Digitalmars-d-learn
On Thursday, 17 October 2019 at 20:21:39 UTC, Andre Pany wrote: On Thursday, 17 October 2019 at 19:05:44 UTC, Vino wrote: [...] Hi, I assume you are using this mysql package http://code.dlang.org/packages/mysql-native. (If not please check wheter the package you are using is vibe-d

Vibe/Mysql Testing

2019-10-17 Thread Vino via Digitalmars-d-learn
Hi All, Request your help on the below code and error Error: source\app.d(25,15): Error: none of the overloads of writeBody are callable using argument types (VariantN!20LU), candidates are Code: import vibe.vibe; import std.array : array; import mysql; import std.stdio; import std.range;

Re: Vibe.d Error

2019-10-17 Thread Vino via Digitalmars-d-learn
On Thursday, 17 October 2019 at 18:12:54 UTC, Andre Pany wrote: On Thursday, 17 October 2019 at 10:58:20 UTC, Vino wrote: Hi All, We are planning to migrate our website form Mysql/PHP to Mysql/D using vibe.d , as part of the plan we tried to install the vibe.d (vibe.d 0.8.6 release) and we

Vibe.d Error

2019-10-17 Thread Vino via Digitalmars-d-learn
Hi All, We are planning to migrate our website form Mysql/PHP to Mysql/D using vibe.d , as part of the plan we tried to install the vibe.d (vibe.d 0.8.6 release) and we are facing below issue, we have tried both the version of compiler (DMD 2.088.1 DMD Beta 2.089.0-beta.1) the issue is

Re: DUB mysql-native

2019-10-08 Thread Vino via Digitalmars-d-learn
On Tuesday, 8 October 2019 at 14:02:03 UTC, Vino wrote: On Tuesday, 8 October 2019 at 11:26:24 UTC, Daniel Kozak wrote: [...] Hi Daniel, As stated I have removed those line and ran the below command [...] Hi Daniel, Was able to resolve the dub test issue using the you tube video

  1   2   3   >