Including parts of a diet template in another

2023-03-25 Thread seany via Digitalmars-d-learn
Hello If we are creating a multipage Vibe.d application, we need to use diet templates. I can't find any info on how to include parts or whole of a diet template in another. So for example, if i had pages : 1 => ``` html head //stuff in head body // a

What makes vibe.d Incredibly Slow on a VPS?

2023-03-18 Thread seany via Digitalmars-d-learn
Consider this fraction of code Please: void createNewOwner(HTTPServerRequest req, HTTPServerResponse res) { writeln("NEW OWNER requests are : -");

Re: vibe.d

2023-03-11 Thread seany via Digitalmars-d-learn
On Saturday, 11 March 2023 at 12:56:16 UTC, Steven Schveighoffer wrote: On 3/11/23 5:12 AM, seany wrote: email.headers["Sender"] = "<"; // valid mail Looks like an extra `<`, is that correct? No, i mistyped that when i changed the email address after copyin

vibe.d

2023-03-11 Thread seany via Digitalmars-d-learn
Hi I am trying to send an email via vibe .d Here is the code snippet. ``` Mail email = new Mail; email.headers["Date"] = Clock.currTime(PosixTimeZone.getTimeZone("America/New_York")).toRFC822DateTimeString(); // uses UFCS email.headers["Sender"] = "<"; // valid mail email.headers["From"]

How can I easily determine the last charachter of a file?

2023-02-14 Thread seany via Digitalmars-d-learn
Hello Consider the content of a file First line \n Second line data data data data ... last char My goal is to find out whether the last character is a new line or not. Please not, it will be sufficient if this works on Linux. More specifically I want to insert a new

MongoDB and vibe troubles.

2023-02-09 Thread seany via Digitalmars-d-learn
Please consider the code: mClient = connectMongoDB("127.0.0.1"); auto db = mClient.getDatabase("webAppMaster"); writeln(db); auto users = db["users"]; writeln(users); This follows this example:

vibe.d + mongoDB

2023-01-20 Thread seany via Digitalmars-d-learn
Hi I am googling to find some vibe.d and mongoDB tutorial. Are their some available? Thank you

How to Add CSS and JS to vibe.d templates

2023-01-19 Thread seany via Digitalmars-d-learn
Hi Howcan one add CSS and JS to vibe.d templates? Here is my setup (vibe.d project initiated with dub using dub init myproject vibe.d): ./public: main.css main.js ./source: app.d ./views: auth2fa.dt fail.dt login.dt pair.dt passfail.dt userfail.dt I am trying to add a css file

Re: Vibe.d Diet Templatesand Forms

2023-01-19 Thread seany via Digitalmars-d-learn
On Friday, 20 January 2023 at 01:32:04 UTC, Steven Schveighoffer wrote: On 1/19/23 6:24 PM, seany wrote: [...] Did you mean to include straight HTML here? I don't think that is supported. [...] You are indeed right. The Link was a problem, and removing the link actually have sorted

Vibe.d Diet Templatesand Forms

2023-01-19 Thread seany via Digitalmars-d-learn
Hello Please consider this diet template: doctype html html(lang="es", dir="ltr") head meta(name="viewport", content="width=device-width, user-scalable=no, initial-scale=1.0") meta(charset="utf-8")

Re: Nested sibling classes

2023-01-12 Thread seany via Digitalmars-d-learn
On Thursday, 12 January 2023 at 17:41:39 UTC, Salih Dincer wrote: On Thursday, 12 January 2023 at 17:05:04 UTC, seany wrote: How can I make it, that classes b and c can access each other, and create instances of each other freely? Thank you. Ignoring the typos you could try auto and static

Nested sibling classes

2023-01-12 Thread seany via Digitalmars-d-learn
Please Consider the code: import std.stdio; class a { public: this(){} ~this(){} class b { public: this.outer.c C = new this.outer.c(); this() {

yet another segfault - array out of bound is not caught by try catch

2021-09-17 Thread seany via Digitalmars-d-learn
I have now this function, as a private member in a Class : double calculate_lineLength( int i) { field.rawData [] * rd; // ignore the details, this works; rd = cast (field.rawData [] *) dataSet; // ignore the details, this works;

Re: dub segfault and range error handling

2021-09-16 Thread seany via Digitalmars-d-learn
On Thursday, 16 September 2021 at 20:49:28 UTC, seany wrote: I create a new project with : `dub init myproj`. Then I change the source/app.d file with this : [...] PS :compiling with : `dub build -b release ` ( i.e. no ldc2) is a direct segfault of the code posted above. PPS : my system

dub segfault and range error handling

2021-09-16 Thread seany via Digitalmars-d-learn
I create a new project with : `dub init myproj`. Then I change the source/app.d file with this : ` import std.stdio; import std.math; import std.stdio; import std.conv; import std.format; import std.math; import std.algorithm;

Re: associative array with Parallel

2021-07-23 Thread seany via Digitalmars-d-learn
On Thursday, 22 July 2021 at 16:39:45 UTC, Steven Schveighoffer wrote: On 7/22/21 1:46 AM, seany wrote: [...] Correct. You must synchronize on ii. [...] This isn't valid code, because you can't append to an integer. Though I think I know what you meant. Is it thread-safe (assuming

Re: catching segfault using try_ catch

2021-07-22 Thread seany via Digitalmars-d-learn
On Thursday, 22 July 2021 at 15:12:37 UTC, Adam D Ruppe wrote: On Thursday, 22 July 2021 at 14:19:37 UTC, seany wrote: how can I specify this with dub ? Probably easiest to just copy the memoryerror.d file from druntime into your dub source dir. I did copy in subfolder /etc/linux. same

Re: catching segfault using try_ catch

2021-07-22 Thread seany via Digitalmars-d-learn
On Thursday, 22 July 2021 at 14:19:37 UTC, seany wrote: On Tuesday, 13 July 2021 at 17:49:54 UTC, Adam D Ruppe wrote: On Tuesday, 13 July 2021 at 16:52:43 UTC, seany wrote: What will it return to me? true if it succeeded. I want to catch the segfault and a segfault has occured, I want run

Re: catching segfault using try_ catch

2021-07-22 Thread seany via Digitalmars-d-learn
On Tuesday, 13 July 2021 at 17:49:54 UTC, Adam D Ruppe wrote: On Tuesday, 13 July 2021 at 16:52:43 UTC, seany wrote: What will it return to me? true if it succeeded. I want to catch the segfault and a segfault has occured, I want run a different code at that point. You mean transparently

Re: associative array with Parallel

2021-07-22 Thread seany via Digitalmars-d-learn
On Thursday, 22 July 2021 at 09:02:56 UTC, jfondren wrote: On Thursday, 22 July 2021 at 07:51:04 UTC, seany wrote: OK. Sorry for the bad question : what if i pregenerate every possible key, and fill the associative array where each such key contains some invalid number, say -1 ? You mean

Re: associative array with Parallel

2021-07-22 Thread seany via Digitalmars-d-learn
On Thursday, 22 July 2021 at 07:27:52 UTC, jfondren wrote: On Thursday, 22 July 2021 at 07:23:36 UTC, seany wrote: On Thursday, 22 July 2021 at 05:53:01 UTC, jfondren wrote: No. Consider https://programming.guide/hash-tables-open-vs-closed-addressing.html The page says : A key is always

Re: associative array with Parallel

2021-07-22 Thread seany via Digitalmars-d-learn
On Thursday, 22 July 2021 at 05:53:01 UTC, jfondren wrote: No. Consider https://programming.guide/hash-tables-open-vs-closed-addressing.html The page says : A key is always stored in the bucket it's hashed to. What if my keys are always unique?

associative array with Parallel

2021-07-22 Thread seany via Digitalmars-d-learn
Consider : int [] ii; foreach(i,dummy; parallel(somearray)) { ii ~= somefunc(dummy); } This is not safe, because all threads are accessing the same array and trying to add values and leading to collision. But : int [] ii; ii.length = somearray.length;

Re: Performance issue with fiber

2021-07-21 Thread seany via Digitalmars-d-learn
On Wednesday, 21 July 2021 at 22:51:38 UTC, hanabi1224 wrote: Hi, I'm new to D lang and encounter some performance issues with fiber, not sure if there's something obviously wrong with my code. [...] Following. I am also in need of more information to increase speed of D binaries using

Associative Array with double[][]

2021-07-21 Thread seany via Digitalmars-d-learn
I have a perimeter of a shape, given by a `double [][]` . I want to keep the lengths of various diagonals in another associative array. So, /// define some associative array to keep track of diagonals here.. auto perimeter = new double[][] (0,0); /// --- fill up perimeter here

Re: Yet another parallel foreach + continue question

2021-07-19 Thread seany via Digitalmars-d-learn
On Tuesday, 20 July 2021 at 02:58:50 UTC, H. S. Teoh wrote: On Tue, Jul 20, 2021 at 02:39:58AM +, seany via Digitalmars-d-learn wrote: > [...] [...] [...] Logically speaking, the size of the work unit should not change the semantics of the loop. That's just an implementation det

Re: Yet another parallel foreach + continue question

2021-07-19 Thread seany via Digitalmars-d-learn
On Tuesday, 20 July 2021 at 02:31:14 UTC, H. S. Teoh wrote: On Tue, Jul 20, 2021 at 01:07:22AM +, seany via Digitalmars-d-learn wrote: On Tuesday, 20 July 2021 at 00:37:56 UTC, H. S. Teoh wrote: > [...] Ok, therefore it means that, if at `j = 13 `i use a continue, then the thread wher

Re: Yet another parallel foreach + continue question

2021-07-19 Thread seany via Digitalmars-d-learn
On Tuesday, 20 July 2021 at 00:37:56 UTC, H. S. Teoh wrote: On Tue, Jul 20, 2021 at 12:07:10AM +, seany via Digitalmars-d-learn wrote: [...] [...] I didn't test this, but I'm pretty sure `continue` inside a parallel foreach loop simply terminates that iteration early; I don't think

Yet another parallel foreach + continue question

2021-07-19 Thread seany via Digitalmars-d-learn
Consider : for (int i = 0; i < max_value_of_i; i++) { foreach ( j, dummyVar; myTaskPool.parallel(array_to_get_j_from, my_workunitSize) { if ( boolean_function(i,j) ) continue; double d = expensiveFunction(i,j); // ... stuff ... } }

Re: catching segfault using try_ catch

2021-07-13 Thread seany via Digitalmars-d-learn
On Tuesday, 13 July 2021 at 17:49:54 UTC, Adam D Ruppe wrote: On Tuesday, 13 July 2021 at 16:52:43 UTC, seany wrote: [...] true if it succeeded. [...] You mean transparently rerun some code? That's better done with the lowlevel sigaction handler. [...] Thank you. Is there a tutorial

Re: catching segfault using try_ catch

2021-07-13 Thread seany via Digitalmars-d-learn
On Monday, 12 July 2021 at 00:04:05 UTC, Adam D Ruppe wrote: On Sunday, 11 July 2021 at 23:34:38 UTC, seany wrote: Is there an example i can use Thank you. You just call the registerMemoryHandler() function from that module at some point in your main function before doing other work. PS

Re: catching segfault using try_ catch

2021-07-13 Thread seany via Digitalmars-d-learn
On Monday, 12 July 2021 at 00:04:05 UTC, Adam D Ruppe wrote: On Sunday, 11 July 2021 at 23:34:38 UTC, seany wrote: Is there an example i can use Thank you. You just call the registerMemoryHandler() function from that module at some point in your main function before doing other work. OK

Re: catching segfault using try_ catch

2021-07-11 Thread seany via Digitalmars-d-learn
On Sunday, 11 July 2021 at 21:15:30 UTC, Paul Backus wrote: I know it's possible on Linux using the `etc.linux.memoryerror` module [1]. Not sure about Windows. Linux would be sufficient. Is there an example i can use Thank you.

catching segfault using try_ catch

2021-07-11 Thread seany via Digitalmars-d-learn
Is it possible to catch a segfault - using try/catch loop? Thank you

Re: vibe.d compilation error

2021-07-04 Thread seany via Digitalmars-d-learn
On Monday, 5 July 2021 at 01:11:22 UTC, Mathias LANG wrote: On Sunday, 4 July 2021 at 12:36:24 UTC, seany wrote: Is there any way, I can avoid this error? You are using an old version of Vibe.d, change your dependency to "~>0.9.0". Okey, thank you. That resolved it.

vibe.d compilation error

2021-07-04 Thread seany via Digitalmars-d-learn
"authors": [ "Seany" ], "copyright": "Copyright © 2021, Seany", "dependencies": { "vibe-d": "~>0.8.0", }, "description": "Econsor data receive",

Re: How to call stop from parallel foreach

2021-06-25 Thread seany via Digitalmars-d-learn
On Friday, 25 June 2021 at 19:30:16 UTC, jfondren wrote: On Friday, 25 June 2021 at 19:17:38 UTC, seany wrote: If i use `parallel(...)`it runs. If i use `prTaskPool.parallel(...`, then in the line : `auto prTaskPool = new TaskPool(threadCount);` it hits the error. Please help. parallel

Re: How to call stop from parallel foreach

2021-06-25 Thread seany via Digitalmars-d-learn
On Friday, 25 June 2021 at 16:37:44 UTC, seany wrote: On Friday, 25 June 2021 at 16:37:06 UTC, seany wrote: On Friday, 25 June 2021 at 15:50:37 UTC, seany wrote: On Friday, 25 June 2021 at 15:16:30 UTC, jfondren wrote: [...] Try : (this version)[https://github.com/naturalmechanics/mwp/tree

Re: How to call stop from parallel foreach

2021-06-25 Thread seany via Digitalmars-d-learn
On Friday, 25 June 2021 at 15:50:37 UTC, seany wrote: On Friday, 25 June 2021 at 15:16:30 UTC, jfondren wrote: On Friday, 25 June 2021 at 14:44:13 UTC, seany wrote: This particular location does not cause segfault. It is segfaulting down the line in a completely unrelated location... Wait I

Re: How to call stop from parallel foreach

2021-06-25 Thread seany via Digitalmars-d-learn
On Friday, 25 June 2021 at 16:37:06 UTC, seany wrote: On Friday, 25 June 2021 at 15:50:37 UTC, seany wrote: On Friday, 25 June 2021 at 15:16:30 UTC, jfondren wrote: [...] Try : (this version)[https://github.com/naturalmechanics/mwp/tree/nested-loops] The goal is to parallelize

Re: How to call stop from parallel foreach

2021-06-25 Thread seany via Digitalmars-d-learn
On Friday, 25 June 2021 at 15:16:30 UTC, jfondren wrote: On Friday, 25 June 2021 at 14:44:13 UTC, seany wrote: This particular location does not cause segfault. It is segfaulting down the line in a completely unrelated location... Wait I will try to make a MWP. [Here is MWP](https

Re: How to call stop from parallel foreach

2021-06-25 Thread seany via Digitalmars-d-learn
On Friday, 25 June 2021 at 15:08:38 UTC, Ali Çehreli wrote: On 6/25/21 7:21 AM, seany wrote: > The code without the parallel foreach works fine. No segfault. That's very common. What I meant is, is the code written in a way to work safely in a parallel foreach loop? (i.e. Is the c

Re: How to call stop from parallel foreach

2021-06-25 Thread seany via Digitalmars-d-learn
On Friday, 25 June 2021 at 14:22:25 UTC, seany wrote: On Friday, 25 June 2021 at 14:13:14 UTC, jfondren wrote: On Friday, 25 June 2021 at 13:53:17 UTC, seany wrote: [...] A self-contained and complete example would help a lot, but the likely problem with this code is that you're accessing

Re: How to call stop from parallel foreach

2021-06-25 Thread seany via Digitalmars-d-learn
On Friday, 25 June 2021 at 14:13:14 UTC, jfondren wrote: On Friday, 25 June 2021 at 13:53:17 UTC, seany wrote: [...] A self-contained and complete example would help a lot, but the likely problem with this code is that you're accessing pnts[y][x] in the loop, which makes the loop bodies

Re: How to call stop from parallel foreach

2021-06-25 Thread seany via Digitalmars-d-learn
On Friday, 25 June 2021 at 14:10:52 UTC, Ali Çehreli wrote: On 6/25/21 6:53 AM, seany wrote: > [...] workUnitSize)) { > [...] Performance is not guaranteed depending on many factors. For example, inserting a writeln() call in the loop would make all threads compete with each

Re: How to call stop from parallel foreach

2021-06-25 Thread seany via Digitalmars-d-learn
On Friday, 25 June 2021 at 13:53:17 UTC, seany wrote: On Thursday, 24 June 2021 at 21:19:19 UTC, Ali Çehreli wrote: [...] I tried this . int[][] pnts ; pnts.length = fld.length; enum threadCount = 2; auto prTaskPool = new

Re: How to call stop from parallel foreach

2021-06-25 Thread seany via Digitalmars-d-learn
On Thursday, 24 June 2021 at 21:19:19 UTC, Ali Çehreli wrote: On 6/24/21 1:41 PM, seany wrote: > Is there any way to control the number of CPU cores used in > parallelization ? Yes. You have to create a task pool explicitly: import std.parallelism; void main() { enum threadCou

Re: How to call stop from parallel foreach

2021-06-24 Thread seany via Digitalmars-d-learn
On Thursday, 24 June 2021 at 20:33:00 UTC, Bastiaan Veelo wrote: By the way, nesting parallel `foreach` does not make much sense, as one level already distributes the load across all cores (but one). Additional parallelisation will likely just add overhead, and have a net negative effect. —

Re: How to call stop from parallel foreach

2021-06-24 Thread seany via Digitalmars-d-learn
On Thursday, 24 June 2021 at 20:08:06 UTC, seany wrote: On Thursday, 24 June 2021 at 19:46:52 UTC, Jerry wrote: On Thursday, 24 June 2021 at 18:23:01 UTC, seany wrote: [...] Maybe I'm wrong here, but I don't think there is any way to do that with parallel. What I would do is negate

Re: How to call stop from parallel foreach

2021-06-24 Thread seany via Digitalmars-d-learn
On Thursday, 24 June 2021 at 19:46:52 UTC, Jerry wrote: On Thursday, 24 June 2021 at 18:23:01 UTC, seany wrote: [...] Maybe I'm wrong here, but I don't think there is any way to do that with parallel. What I would do is negate someConditionCheck and instead only do work when there is work

How to call stop from parallel foreach

2021-06-24 Thread seany via Digitalmars-d-learn
I have seen [this](https://forum.dlang.org/thread/akhbvvjgeaspmjntz...@forum.dlang.org). I can't call break form parallel foreach. Okey, Is there a way to easily call .stop() from such a case? Here is a case to consider: outer: foreach(i, a; parallel(array_of_a)) { foreach(j, b;

How to I get pointer to an Array and cast to a void * and back ?

2021-06-24 Thread seany via Digitalmars-d-learn
I have a struct : struct a { int i; // some more stuff ... } In a Class, I define public global `void * dataSet; ` In a function `f`, of the same class: i call : void f() { a[] rd_flattened; a[] * rd; // DO SOME WORK HERE this.dataSet =

Re: Parallel For

2021-06-15 Thread seany via Digitalmars-d-learn
On Tuesday, 15 June 2021 at 09:09:29 UTC, Ali Çehreli wrote: On 6/14/21 11:39 PM, seany wrote: > [...] I gave an example of it in my DConf Online 2020 presentation as well: https://www.youtube.com/watch?v=dRORNQIB2wA=1324s > [...] That is vio

Re: Parallel For

2021-06-15 Thread seany via Digitalmars-d-learn
On Tuesday, 15 June 2021 at 07:41:06 UTC, jfondren wrote: On Tuesday, 15 June 2021 at 06:39:24 UTC, seany wrote: [...] add a `writeln(c.length);` in your inner loop and consider the output. If you were always pushing to the end of c, then only unique numbers should be output. But I see e.g

Re: Parallel For

2021-06-15 Thread seany via Digitalmars-d-learn
On Tuesday, 15 June 2021 at 06:39:24 UTC, seany wrote: I know that c# has parallel for [like this](https://dotnettutorials.net/lesson/parallel-for-method-csharp/) . [...] PS : I need the entire include list - while they are not necessary for this minimal example - they are needed

Parallel For

2021-06-15 Thread seany via Digitalmars-d-learn
I know that c# has parallel for [like this](https://dotnettutorials.net/lesson/parallel-for-method-csharp/) . I know that D has parallel foreach [like this](http://ddili.org/ders/d.en/parallelism.html). I want to do the following : Given 4 sets , A = {a_1, a_2, ... }; B = {b_1, b_2, ... } ;

Re: Flaoting point operations : unexpected results

2021-06-10 Thread seany via Digitalmars-d-learn
On Thursday, 10 June 2021 at 19:51:51 UTC, Dennis wrote: On Thursday, 10 June 2021 at 19:37:36 UTC, seany wrote: However, i sometimes see, that the results are _radically_ different. Are you using uninitialized memory or multi-threading? I am using things like : `double [][] myArr = new

Flaoting point operations : unexpected results

2021-06-10 Thread seany via Digitalmars-d-learn
I have (as mentioned before) an AI project in D. It is doing several million Floating Point operations. However, i sometimes see, that the results are _radically_ different. The same input, fed to the same system . I do not have and random values. There are some *foreach* loops. By

Re: Faster Dlang Execution

2021-06-08 Thread seany via Digitalmars-d-learn
On Tuesday, 8 June 2021 at 18:03:32 UTC, H. S. Teoh wrote: But more importantly, if you can elaborate a bit more on what your program is trying to do, it would help us give more specific recommendations. There may be domain-specific optimizations that you could apply as well. T Hi

Faster Dlang Execution

2021-06-08 Thread seany via Digitalmars-d-learn
Hello How can I increase the speed of executable files created via : `dub build -b release` I am unable to parallellise all of it, as it depends on part of the result being calculated before something else can be calculated. I have many `nonsafe, nonpure` functions. Classes are virtual by

Re: dub build output redirect

2021-06-08 Thread seany via Digitalmars-d-learn
On Tuesday, 8 June 2021 at 14:15:47 UTC, Steven Schveighoffer wrote: On 6/8/21 10:05 AM, seany wrote: Hi Thank you for pointing this out. Indeed, much later in the code, there is a `readln()`. But, the program needs to run 1-2 minutes, until it reaches that point - it is doing a complex AI

Re: dub build output redirect

2021-06-08 Thread seany via Digitalmars-d-learn
On Tuesday, 8 June 2021 at 13:51:10 UTC, Steven Schveighoffer wrote: On 6/8/21 8:38 AM, seany wrote: I have compiled a complex project via `dub build`. I used both `-b release` and `-b debug`. But i cant redirect the output (generated by `writeln`) to a file. I call by : `./executable

dub build output redirect

2021-06-08 Thread seany via Digitalmars-d-learn
I have compiled a complex project via `dub build`. I used both `-b release` and `-b debug`. But i cant redirect the output (generated by `writeln`) to a file. I call by : `./executable --param p1 > a`. But execution hangs immediately. If I do `./executable --param p1 ` no issue. What am I

Question about initialization

2021-06-04 Thread seany via Digitalmars-d-learn
Consider initializing a dictionary or associative array : T[U] AA; For example : double [int] AA; This will be dynamic in size. Now consider initializing a dynamic array : T[] A = new T[] (0); or U[][] B = new U [][] (0,0); This will also be dynamic in size. In my

Re: vibe.de multiple ports.

2020-09-30 Thread seany via Digitalmars-d-learn
On Wednesday, 30 September 2020 at 12:29:06 UTC, Daniel Kozak wrote: Dne st 30. 9. 2020 13:25 uživatel seany via Digitalmars-d-learn < digitalmars-d-learn@puremagic.com> napsal: Hello I am trying to use this example for a iot application: https://aberba.com/2018/using-vibe-d-web-int

vibe.de multiple ports.

2020-09-30 Thread seany via Digitalmars-d-learn
Hello I am trying to use this example for a iot application: https://aberba.com/2018/using-vibe-d-web-interface/ The code i use is: ushort port = 5504; void main(char[][] args) { auto router = new URLRouter; router.post("/archive", );

Re: vibe.d no routes match path

2020-02-04 Thread seany via Digitalmars-d-learn
* sorry, i meant 'archive' This is a production server. Is there anything i am doing wrong?

vibe.d no routes match path

2020-02-04 Thread seany via Digitalmars-d-learn
Please consider the code: import vibe.vibe; import std.conv; import std.file; import std.stdio; ushort port = 5502; void main(char[][] args) { auto router = new URLRouter; router.post("/archive", ); router.get("/archive", ); //also tested without this line

More vibe.d : Receiving Post params

2020-02-01 Thread seany via Digitalmars-d-learn
Consider this : import vibe.vibe; import std.conv; ushort port = 5502; void main(char[][] args) { auto router = new URLRouter; router.post("/archive", ); router.get("/archive", ); auto settings = new HTTPServerSettings;

Re: Dub - vibe.d - hunt framework ... problems

2020-02-01 Thread seany via Digitalmars-d-learn
On Saturday, 1 February 2020 at 22:25:38 UTC, Danny Arends wrote: On Saturday, 1 February 2020 at 20:06:42 UTC, seany wrote: [...] Hey Seany, A quick follow up post. I think/suspect that something might be broken in your dub installation if the mean import is not found. This is the first

Dub - vibe.d - hunt framework ... problems

2020-02-01 Thread seany via Digitalmars-d-learn
I solved this by following: sudo wget https://netcologne.dl.sourceforge.net/project/d-apt/files/d-apt.list -O /etc/apt/sources.list.d/d-apt.list sudo apt-get update --allow-insecure-repositories sudo apt-get -y --allow-unauthenticated install --reinstall d-apt-keyring sudo apt-get update &&

Re: Dub - vibe.d - hunt framework ... problems

2020-02-01 Thread seany via Digitalmars-d-learn
On Saturday, 1 February 2020 at 14:42:58 UTC, Seb wrote: On Saturday, 1 February 2020 at 10:35:52 UTC, seany wrote: Hi I want to start a small server, that will be accessible form outside. Not a huge deal right? Not quite. [...] What version of dub did you install? 1.19 should

Re: Dub - vibe.d - hunt framework ... problems

2020-02-01 Thread seany via Digitalmars-d-learn
On Saturday, 1 February 2020 at 14:42:58 UTC, Seb wrote: On Saturday, 1 February 2020 at 10:35:52 UTC, seany wrote: Hi I want to start a small server, that will be accessible form outside. Not a huge deal right? Not quite. [...] What version of dub did you install? 1.19 should

Re: Dub - vibe.d - hunt framework ... problems

2020-02-01 Thread seany via Digitalmars-d-learn
On Saturday, 1 February 2020 at 14:30:36 UTC, Steven Schveighoffer wrote: How is your network connection to the dub server? Maybe there is a separate problem with network connectivity. This thing works for me (dub upgrade takes about 2.5 seconds and finishes). How long does it take for your

Re: Dub - vibe.d - hunt framework ... problems

2020-02-01 Thread seany via Digitalmars-d-learn
On Saturday, 1 February 2020 at 11:15:49 UTC, seany wrote: On Saturday, 1 February 2020 at 11:08:46 UTC, Ferhat Kurtulmuş wrote: [...] I even tried: $ dub fetch dub Fetching dub 1.19.0... Please note that you need to use `dub run ` or add it to dependencies of your package to actually use

Re: Dub - vibe.d - hunt framework ... problems

2020-02-01 Thread seany via Digitalmars-d-learn
On Saturday, 1 February 2020 at 11:08:46 UTC, Ferhat Kurtulmuş wrote: Have you tried dub upgrade $ dub init server -t vibe.d Package recipe format (sdl/json) [json]: Name [server]: Description [A simple vibe.d server application.]: Author name [root]: License [proprietary]: Copyright string

Re: Dub - vibe.d - hunt framework ... problems

2020-02-01 Thread seany via Digitalmars-d-learn
On Saturday, 1 February 2020 at 10:58:14 UTC, Ferhat Kurtulmuş wrote: On Saturday, 1 February 2020 at 10:35:52 UTC, seany wrote: As suggested, i try to build dub from github, following: https://github.com/dlang/dub/releases I don't know if it is a solution. But you can try using ~master

Dub - vibe.d - hunt framework ... problems

2020-02-01 Thread seany via Digitalmars-d-learn
Hi I want to start a small server, that will be accessible form outside. Not a huge deal right? Not quite. My machine: 4.15.0-66-generic #75-Ubuntu SMP Tue Oct 1 05:24:09 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux DMD : DMD64 D Compiler v2.090.0 Copyright (C) 1999-2019 by The D Language

Estimating free system resource at runtime

2017-08-20 Thread seany via Digitalmars-d-learn
Hi I have a system that has to deal with 30+GB files. They can't be loaded to the amount of memory I have. So my idea was to create a way to estimate available system RAM, and read a chunk from file which is 1/10 of size of available RAM, and process it as far as i can. If the read chunk is

Cross platform Development

2015-01-23 Thread seany via Digitalmars-d-learn
Hello I read this page, but I still have questions : http://forum.dlang.org/thread/fzbaxwcrbztqedqgm...@forum.dlang.org#post-mailman.1142.1332716016.4860.digitalmars-d:40puremagic.com I also read this :

vibe.d Subdirectory?

2015-01-14 Thread seany via Digitalmars-d-learn
I am new to vibe.d and plying a bit with it. I notice, that in case of Apache, there is a root directory, often by default under /var/www or /srv/http (resp. ftp) if you are using linux, and then every time the client sends a request, apache looks in to the root directory, deduces the

Re: vibe.d Subdirectory?

2015-01-14 Thread seany via Digitalmars-d-learn
On Wednesday, 14 January 2015 at 12:25:12 UTC, ketmar via Digitalmars-d-learn wrote: just forgot about that crappy scripting stuff and write your code in D! Actually I want to serve some JSON packed weather data (heck I also wrote my Global Climate Model partially in D and in C) - so I

regex problems

2014-09-20 Thread seany via Digitalmars-d-learn
consider this: import std.conv, std.algorithm; import core.vararg; import std.stdio, std.regex; void main() { string haystack = ID : generateWorld; Position : {

Re: String[] pointer to void* and back

2014-09-19 Thread seany via Digitalmars-d-learn
On Thursday, 18 September 2014 at 22:16:48 UTC, Ali Çehreli wrote: If you are holding an address in a void*, you must make sure that the original object is still at that location when you attempt to access the object. Does that mean, that there is no way to make a global stack accessible

String[] pointer to void* and back

2014-09-18 Thread seany via Digitalmars-d-learn
Consider this snippet: import std.stdio; import std.conv; import core.vararg; void main() { string[] s = [aa, bb, cc]; string []* ss; void * v; ss = s; v = cast(void*)s; ss = cast(string[]*) v; s = *ss; writeln(s); } This fails, Stack

Re: String[] pointer to void* and back

2014-09-18 Thread seany via Digitalmars-d-learn
Found, it should have been v = cast(void*)ss; sorry.

Re: String[] pointer to void* and back

2014-09-18 Thread seany via Digitalmars-d-learn
Yes, thank you, I corrected that. However, if this v is a member of a class, like import std.stdio; import std.conv; import core.vararg; struct S { void *v; } class C { S* sx = new S; void dothings() { string[] ss = [1, 2, 4]; string[] *s; void *vv; s =

Re: String[] pointer to void* and back

2014-09-18 Thread seany via Digitalmars-d-learn
what if i needed to access many such runtime variables of many types, and did not want to create a member for each type?

Extremely funny behavior .. could be a bug?

2014-09-12 Thread seany via Digitalmars-d-learn
consider the following : in file a.d module a; class class_a { struct RESULT{ string[] raw; void* res; } RESULT r; void dothing() { r = new RESULT; string aa = string; r.raw ~= aa; r.res = cast(void*) aa; } } in file b.d import a;// import path is okey

Re: Extremely funny behavior .. could be a bug?

2014-09-12 Thread seany via Digitalmars-d-learn
On Friday, 12 September 2014 at 15:26:34 UTC, Ali Çehreli wrote: you are right, it was a reduced form, of a very complex software. in file a.d module a; class class_a { struct RESULT{ string[] raw; void* res; } RESULT * r; void dothing() { r = new RESULT; string aa =

Re: Reading unicode chars..

2014-09-03 Thread seany via Digitalmars-d-learn
On Tuesday, 2 September 2014 at 21:13:04 UTC, monarch_dodra wrote: What's wrong with reading line by line, but processing the characters in said lines 1 by 1? That works out of the box. import std.stdio; import std.conv; import core.vararg; void main() { string aa = abc „; foreach

Reading unicode chars..

2014-09-02 Thread seany via Digitalmars-d-learn
How do I read unicode chars that has code points \u1FFF and higher from a file? file.getcw() reads only part of the char, and D identifies this character as an array of three or four characters. Importing std.uni does not change the behavior. Thank you.

Re: Reading unicode chars..

2014-09-02 Thread seany via Digitalmars-d-learn
Hi Ali, i know this example from your book. But try to capture „ the low quotation mark, appearing in the All-purpose punctuations plane of unicode, with \u201e - I worte I am having problems with \u1FFF and up. This particular symbol, is seen as a dchar array \x1e\x20 - so two dchars,

Re: Reading unicode chars..

2014-09-02 Thread seany via Digitalmars-d-learn
Linux 64 bit, D2, phobos only.

Re: Reading unicode chars..

2014-09-02 Thread seany via Digitalmars-d-learn
On Tuesday, 2 September 2014 at 18:22:54 UTC, Ali Çehreli wrote: That would happen when you you treat the chars on the input and individual dchars. That is precisely where the problem is. If you use the character in a file, and then open it as a stream, then use File.getc() or

Re: Reading unicode chars..

2014-09-02 Thread seany via Digitalmars-d-learn
Your example reads the file by lines, i need to get them by chars.

Tango Problems..

2014-08-31 Thread seany via Digitalmars-d-learn
I have several files, which I am trying to import as modules to a central file. However, whyile trying to complie with dmd -L-ltango-dmd list of files space separated However, I am getting this error : /usr/lib/libtango-dmd.a(tango-io-Stdout-release.o): In function

Re: Tango Problems..

2014-08-31 Thread seany via Digitalmars-d-learn
Oh, I am using netrunner linux with arch/manjaro core.

Re: Tango Problems..

2014-08-31 Thread seany via Digitalmars-d-learn
On Sunday, 31 August 2014 at 15:40:04 UTC, Rémy Mouëza wrote: From what I understand in the error message, the linker cannot find a druntime function: void core.stdc.stdarg.va_end(void*). I would advise to check that the druntime lib is in the import path. In your the dmd repository, you

Re: Tango Problems..

2014-08-31 Thread seany via Digitalmars-d-learn
I am linking against tango ldc -I/path/to/tango -L-L/path/to/tango -L-ltango-dmd \

  1   2   3   >