Re: Issue with opening files on VSCode "D Language utility extension pack"

2020-11-16 Thread WebFreak001 via Digitalmars-d-learn
On Monday, 16 November 2020 at 01:38:10 UTC, data pulverizer wrote: Hi All, On VS Code "D Language utility extension pack", I notice that if I open a random D file, on the bottom left of the IDE, a message says "D: workspace/(0.0%): starting up...". It stays at 0.0% and doesn't go away and

Re: Efficient sort function allowing own test and swap function as parameter

2020-10-07 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 6 October 2020 at 22:18:39 UTC, Alaindevos wrote: I have a large table consisting of two columns.One with words.Another with frequencies. I want to sort them efficiently according to the names or frequency. For this I need an efficient sort function where I can plugin my proper

Re: vibe.d / experience / feedback

2020-10-01 Thread WebFreak001 via Digitalmars-d-learn
On Thursday, 1 October 2020 at 08:24:42 UTC, ab wrote: On Thursday, 1 October 2020 at 06:32:23 UTC, Robert M. Münch wrote: 3. Vibe can't handle GET & POST on the same URL... we solved this one as well: fortunately (and: of course) vibe can handle this. what lead us to believe otherwise,

Re: Templates and unaryFun!

2020-09-24 Thread WebFreak001 via Digitalmars-d-learn
On Thursday, 24 September 2020 at 11:15:11 UTC, ddcovery wrote: [...] Example: I tried with a global function Dot!R dt(alias fun, T, R)(Dot!T t){ auto f = cast(R function(T)) unaryFun!fun; return t.dot!R(f); } [...] the problem is the template can't automatically determine the type "R".

Re: Good repos to learn D

2020-09-21 Thread WebFreak001 via Digitalmars-d-learn
On Saturday, 19 September 2020 at 08:26:36 UTC, Imperatorn wrote: What are some good examples of pretty large/medium size, good structured repos in D? I'm looking for examples to learn from Thanks! I would include vibe.d in there of course! https://github.com/vibe-d/vibe.d Some legacy

Re: vibe.d and video files?

2020-09-17 Thread WebFreak001 via Digitalmars-d-learn
On Thursday, 17 September 2020 at 18:29:12 UTC, bauss wrote: Does vibe.d not work properly with ex. mp4 files? I have a consistent issues that it will only play part of video files in the browser. As if it won't "stream" the rest of the video. Is that a problem with vibe.d or is it some

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

2020-09-17 Thread WebFreak001 via Digitalmars-d-learn
On Thursday, 17 September 2020 at 16:00:33 UTC, wjoe wrote: I found this [1] but unfortunately the post this refers to is a dead link and the content, unfortunately, didn't tell me anything that I didn't already find in the docs. What I can get from the form is the form fields with content,

Re: Install multiple executables with DUB

2020-09-04 Thread WebFreak001 via Digitalmars-d-learn
On Thursday, 3 September 2020 at 08:22:25 UTC, glis-glis wrote: Hi, I have a few modules for parsing different file formats and a folder with d-scripts using these parsers to perform manipulations, extract information, ... Until now, I just added #!/usr/bin/env rdmd to the d-scripts and

Re: How to use libmir --> mir-algorithm, numir, mir-random?

2020-09-02 Thread WebFreak001 via Digitalmars-d-learn
On Wednesday, 2 September 2020 at 07:01:48 UTC, Shaleen Chhabra wrote: Hi, The libmir libraries can be found here: https://github.com/libmir I wish to use mir-algorithm and numir so that i can directly use .npy format from python and perform the required analysis. I checked out latest

Re: Tuple poilerplate code

2020-09-01 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 1 September 2020 at 02:08:54 UTC, JG wrote: [...] Here is some fun with operator overloading and pointers, but I don't really like it because it seems unsafe: import std; auto _(T...)(return ref T refs) @safe { static struct Assigner(Ptrs...) { @disable this(this);

Re: DMD: how to restore old unittest+main

2020-08-13 Thread WebFreak001 via Digitalmars-d-learn
On Thursday, 13 August 2020 at 07:52:07 UTC, novice3 wrote: Hello. I don't use dub. I use Windows and *.d file association to compile small apps by dmd with "-i -unittest -g" switches. Now i update dmd, and found, that apps compiled with "-unittest" not runs main(). How i can restore old

Re: vibe.d and my first web service

2020-08-13 Thread WebFreak001 via Digitalmars-d-learn
On Wednesday, 12 August 2020 at 21:11:54 UTC, Daniel Kozak wrote: [...] Unfortunately, I think vibe-d is dead. With every release it is worse than before and it seems there is almost no activity. So D really need new champion here maybe hunt will be next champion. Can you give an example

Re: Files and UTF

2020-08-06 Thread WebFreak001 via Digitalmars-d-learn
On Thursday, 6 August 2020 at 07:19:37 UTC, WebFreak001 wrote: [...] In line 11 in my example code this makes a better, safer if than `if (s.length)`: if (s.length && s[$ - 1] == '\n') s = s[0 .. $ - 1]; Note that I only need to do this because of the readln API, it would be much safer and

Re: Files and UTF

2020-08-06 Thread WebFreak001 via Digitalmars-d-learn
On Wednesday, 5 August 2020 at 17:39:36 UTC, Mike Surette wrote: In my efforts to learn D I am writing some code to read files in different UTF encodings with the aim of having them end up as UTF-8 internally. As a start I have the following code: import std.stdio; import std.file; void

Re: Strong typing and physical units

2020-07-28 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 28 July 2020 at 04:40:33 UTC, Cecil Ward wrote: I found an earlier post somewhere about work someone has done on physical units such as kg, volts and so forth. It would be very good to catch bugs such as volts_t v = input_current; [...] This is easily done and uses enums:

Re: How DerelictCL works

2020-07-22 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 21 July 2020 at 12:00:03 UTC, bioinfornatics wrote: Dear, I would like to use OpenCL in D. Thus I try to use DerelictCL. But I fail to use it I encounter this error message: -- /opt/jonathan/jonathan-dlang_ldc2092/root/usr/include/d/derelict/opencl/constants.di(835):

Re: Alternative to std.range.choose

2020-07-22 Thread WebFreak001 via Digitalmars-d-learn
On Wednesday, 22 July 2020 at 04:33:20 UTC, James Gray wrote: Is there a better way to achieve behaviour similar to rangeFuncIf below? f gives a contrived example of when one might want this. g is how one might try and achieve the same with std.range.choose. import std.stdio; import std.range

Re: D Wiki: run.dlang.io integration?

2020-07-16 Thread WebFreak001 via Digitalmars-d-learn
On Thursday, 16 July 2020 at 13:54:56 UTC, aberba wrote: On Thursday, 16 July 2020 at 13:41:31 UTC, aberba wrote: On Thursday, 16 July 2020 at 09:47:02 UTC, WebFreak001 wrote: [...] Since its based on WikiMedia, searched an came up with this [1] to embed in iframe 1.

Re: Using_string_mixins_for_logging error

2020-07-16 Thread WebFreak001 via Digitalmars-d-learn
On Wednesday, 15 July 2020 at 07:36:49 UTC, Vitalii wrote: Many thanks! I have now deprecated the old wiki page and linked to a new one with more examples: https://wiki.dlang.org/Logging_mechanisms

D Wiki: run.dlang.io integration?

2020-07-16 Thread WebFreak001 via Digitalmars-d-learn
Is there a way to integrate some kind of "run this source code" button into the D wiki using run.dlang.io? If there isn't, it would be nice to add this kind of thing as plugin with the possibility of also including the editor so you never need to leave the wiki. (like on the D Tour)

Re: Error: `std.uni.isUpper` conflicts with `std.ascii.isUpper`

2020-07-15 Thread WebFreak001 via Digitalmars-d-learn
On Wednesday, 15 July 2020 at 11:25:34 UTC, aberba wrote: On Wednesday, 15 July 2020 at 07:01:34 UTC, WebFreak001 wrote: On Tuesday, 14 July 2020 at 20:37:53 UTC, Marcone wrote: [...] Additionally to the other answers telling you how to fix it, it's important to know why it happens in the

Re: Using_string_mixins_for_logging error

2020-07-15 Thread WebFreak001 via Digitalmars-d-learn
On Wednesday, 15 July 2020 at 07:07:55 UTC, Vitalii wrote: Hello everyone! I try to compile this recipe with dmd (2.089.0), ldc2 (1.18.0): https://wiki.dlang.org/Using_string_mixins_for_logging but get the same error: mixin_log.d(64): Error: basic type expected, not __FUNCTION__

Re: Error: `std.uni.isUpper` conflicts with `std.ascii.isUpper`

2020-07-15 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 14 July 2020 at 20:37:53 UTC, Marcone wrote: import std: isUpper, writeln; void main(){ writeln(isUpper('A')); } Why I get this error? How can I use isUpper()? Additionally to the other answers telling you how to fix it, it's important to know why it happens in the first

Re: Choosing a non-default linker for dmd (via dub)

2020-07-13 Thread WebFreak001 via Digitalmars-d-learn
On Sunday, 12 July 2020 at 16:36:09 UTC, Per Nordlöw wrote: The line dflags "-linker=gold" platform="linux-ldc" # use GNU gold linker in dub.sdl enables me to change linker for LDC. Is it possible to choose a specific linker for DMD aswell in a similar way? I only find the flag `-L` that

opOpAssign of AA: defined behavior?

2020-06-23 Thread WebFreak001 via Digitalmars-d-learn
I have the following code: double[string] foo; foo["a"] += 1; how is the opOpAssign on the AA defined? Is it defined to set the value to the value to the right of the opOpAssign if it isn't set for primitives or does it add the given value onto T.init? Doing foo["b"]++; gives

Re: How debugg unittest with visual code + code-d

2020-06-06 Thread WebFreak001 via Digitalmars-d-learn
On Saturday, 6 June 2020 at 08:06:02 UTC, Luis wrote: On Friday, 5 June 2020 at 18:13:52 UTC, WebFreak001 wrote: [...] It isn't working correctly on my case : I get this error : Performing "unittest" build using dmd for x86_64. ddiv ~sparseSet: building configuration "unittest"...

Re: How debugg unittest with visual code + code-d

2020-06-05 Thread WebFreak001 via Digitalmars-d-learn
On Friday, 5 June 2020 at 17:03:40 UTC, Luis wrote: So I actually managed to "debug" my unittests but It requires that I run previsuly "dub test" on console, so the executable is update. As I understand, I need to setup a task to be prelaunched by debug to generate the unittest executable, but

Re: [Windows]Need an example: How to read and list names of USB devices via Windows API without using Utilities

2020-05-29 Thread WebFreak001 via Digitalmars-d-learn
On Friday, 29 May 2020 at 09:04:30 UTC, WebFreak001 wrote: [...] I realized it may be useful to have a much more complete example, so replace the while (true) loop in my first code with this to get much more information dumped: while (true) {

Re: [Windows]Need an example: How to read and list names of USB devices via Windows API without using Utilities

2020-05-29 Thread WebFreak001 via Digitalmars-d-learn
On Wednesday, 27 May 2020 at 14:16:56 UTC, BoQsc wrote: I always wanted to know if there is any proven example on how to interface with USB devices by using Windows operating system. Any explanations, snippets in relation to topic would help. What I expect: Being able to detect if a new USB

Re: How to parse enum from a string ?

2020-05-27 Thread WebFreak001 via Digitalmars-d-learn
On Wednesday, 27 May 2020 at 17:33:33 UTC, Vinod K Chandran wrote: Hi all, Assume that i have an enum like this. enum TestEnum { Received = 1, Started , Finished , Sent } I am saving this enum values as string in database. So, when i retrieve them from the database, how can i

Re: Assign Range: layout = X, AlignRight;

2020-05-26 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 26 May 2020 at 13:36:34 UTC, Виталий Фадеев wrote: [...] I want this feature in D! I think you are rather looking for tuples: void opAssign(Args...)(Tuple!Args args) { foreach( a; args ) { _layouts ~= a; }

Re: Distinguish between a null array and an empty array

2020-05-26 Thread WebFreak001 via Digitalmars-d-learn
On Sunday, 24 May 2020 at 12:37:20 UTC, ag0aep6g wrote: On 24.05.20 14:29, bauss wrote: Dang, that sucks there is no proper way and I would say that's a big flaw of D. Because what I need it for is for some data serialization but if the value is an empty array then it should be present and

Re: Compare string with German umlauts

2020-05-18 Thread WebFreak001 via Digitalmars-d-learn
On Monday, 18 May 2020 at 13:44:15 UTC, Martin Tschierschke wrote: Hi, I have to find a certain line in a file, with a text containing umlauts. How do you do this? The following was not working: foreach(i,line; file){ if(line=="My text with ö oe, ä ae or ü"){ writeln("found it at

Re: Easy way to format int in pragma msg ?

2020-05-14 Thread WebFreak001 via Digitalmars-d-learn
On Thursday, 14 May 2020 at 09:49:15 UTC, wjoe wrote: Is there an easy way to print an int in hexadecimal, octal or binary representation ? The documentation on pragma(msg, ...) and a quick web search didn't provide an answer. for simple hex/binary/etc printing use import std.conv;

Re: Get months / years between two dates.

2020-05-07 Thread WebFreak001 via Digitalmars-d-learn
On Wednesday, 6 May 2020 at 19:51:01 UTC, bauss wrote: How do you exactly do that? Like if I have two dates as std.datetime.DateTime How will I get the months or years between the two dates? I was surprised to learn that Duration does not support them and only has weeks, days etc. but not

Re: std.uni, std.ascii, std.encoding, std.utf ugh!

2020-05-06 Thread WebFreak001 via Digitalmars-d-learn
On Wednesday, 6 May 2020 at 10:57:59 UTC, learner wrote: On Tuesday, 5 May 2020 at 19:24:41 UTC, WebFreak001 wrote: On Tuesday, 5 May 2020 at 18:41:50 UTC, learner wrote: Good morning, Trying to do this: ``` bool foo(string s) nothrow { return s.all!isDigit; } ``` I realised that the

Re: Error running concurrent process and storing results in array

2020-05-06 Thread WebFreak001 via Digitalmars-d-learn
On Wednesday, 6 May 2020 at 07:42:44 UTC, data pulverizer wrote: On Wednesday, 6 May 2020 at 07:27:19 UTC, data pulverizer wrote: On Wednesday, 6 May 2020 at 06:54:07 UTC, drug wrote: Thing are really interesting. So there is a space to improve performance in 2.5 times :-) Yes, `array` is

Re: std.uni, std.ascii, std.encoding, std.utf ugh!

2020-05-05 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 5 May 2020 at 18:41:50 UTC, learner wrote: Good morning, Trying to do this: ``` bool foo(string s) nothrow { return s.all!isDigit; } ``` I realised that the conversion from char to dchar could throw. I need to validate and operate over ascii strings and utf8 strings, possibly in

Re: real operations imprecise?

2020-05-05 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 5 May 2020 at 14:15:03 UTC, H. S. Teoh wrote: On Tue, May 05, 2020 at 01:44:18PM +, WebFreak001 via Digitalmars-d-learn wrote: [...] Whoa, hold your horses right there! What does `pragma(msg, real.dig);` output on your machine? [...] You are right, probably should have

real operations imprecise?

2020-05-05 Thread WebFreak001 via Digitalmars-d-learn
I was dumping the full PI value on my machine with the highest precision it could get and got: $ rdmd --eval='printf("%.70llf\n", PI)' 3.14159265358979323851280895940618620443274267017841339111328125 now this all looks good, but when I tried to print PI_2 I got $ rdmd

Re: Dub failing with message about DFLAGS

2020-04-28 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 28 April 2020 at 14:26:11 UTC, Russel Winder wrote: On Tue, 2020-04-28 at 14:03 +, WebFreak001 via Digitalmars-d-learn wrote: […] in this case, try dub upgrade --vverbose and the full exception message should hopefully show I have no idea what has changed, but things are now

Re: Dub failing with message about DFLAGS

2020-04-28 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 28 April 2020 at 13:44:14 UTC, Russel Winder wrote: On Tue, 2020-04-28 at 12:04 +, WebFreak001 via Digitalmars-d-learn wrote: [...] I am not sure this gives any further information. :-( [...] in this case, try dub upgrade --vverbose and the full exception message should

Re: Dub failing with message about DFLAGS

2020-04-28 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 28 April 2020 at 11:56:26 UTC, Russel Winder wrote: Hi, Has anyone seen this before, it has just started happening to me and is stopping me doing any work on this D project. |> dub build Invalid variable: DFLAGS try running with `dub build -v`

Re: mir: How to change iterator?

2020-04-17 Thread WebFreak001 via Digitalmars-d-learn
On Friday, 17 April 2020 at 08:40:36 UTC, WebFreak001 wrote: On Tuesday, 14 April 2020 at 20:24:05 UTC, jmh530 wrote: [...] Use std.algorithm:equal for range compare with approxEqual for your comparator: assert(equal!approxEqual(y, [2.5, 2.5].sliced(2))); simplified:

Re: mir: How to change iterator?

2020-04-17 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 14 April 2020 at 20:24:05 UTC, jmh530 wrote: In the code below, I multiply some slice by 5 and then check whether it equals another slice. This fails for mir's approxEqual because the two are not the same types (yes, I know that isClose in std.math works). I was trying to convert

Re: make dub use my version of dmd

2020-04-17 Thread WebFreak001 via Digitalmars-d-learn
On Thursday, 16 April 2020 at 19:56:44 UTC, Adam D. Ruppe wrote: For future reference, newer dubs (v 1.17 + i think) allow --compiler=dmd-version for example. You need to put the exe in your PATH and rename it yourself, but it recognizes *dmd-* (or *ldc2-* or *gdc-*) all the same so you can

interop with c++ coroutines

2020-04-14 Thread WebFreak001 via Digitalmars-d-learn
To my understanding the C++20 coroutines are very similar to what we have in D using Fibers. How could I interop with a library exposing this kind of functionality in D? I haven't really used C++ coroutines but I would like to have some sort of compatibility with the standard C++ types for

switch case range inclusive or exclusive?

2020-04-06 Thread WebFreak001 via Digitalmars-d-learn
In the D spec it says for CaseRangeStatement: https://dlang.org/spec/statement.html#CaseRangeStatement A CaseRangeStatement is a shorthand for listing a series of case statements from FirstExp to LastExp. does this mean LastExp is inclusive or exclusive part of the range? I think the spec

Re: How user dub packages in dmd without dub.exe ?

2020-04-05 Thread WebFreak001 via Digitalmars-d-learn
On Sunday, 5 April 2020 at 14:02:19 UTC, Baby Beaker wrote: On Saturday, 4 April 2020 at 21:54:34 UTC, Andre Pany wrote: On Saturday, 4 April 2020 at 20:21:03 UTC, Marcone wrote: [...] [...] If you can copy the D packages from the Dub packages into your main source folder, the command

Re: Vibe-d Error Message and failed with exit code 1

2020-04-05 Thread WebFreak001 via Digitalmars-d-learn
On Saturday, 4 April 2020 at 14:40:16 UTC, Baby Beaker wrote: Program.d #!/usr/bin/env dub /+ dub.sdl: name "hello_vibed" dependency "vibe-d" version="~>0.8.0" +/ import vibe.vibe; import std; [...] First of all try using the latest vibe.d release instead: /+ dub.sdl: name

Re: Static if a Function Exists

2020-04-03 Thread WebFreak001 via Digitalmars-d-learn
On Friday, 3 April 2020 at 01:03:01 UTC, Jonathan Levi wrote: I am trying to make a templated function for any arguments which will work for another. Like this: ``` class Cls { auto opBinary(string op, T)(T b) if (__traits(compiles, opBinaryImpl!op(this, b))) { return

Re: Whats wrong with binery heap or i am not understand something?

2020-04-02 Thread WebFreak001 via Digitalmars-d-learn
On Thursday, 2 April 2020 at 12:59:06 UTC, AlexM wrote: Please explain me whats wrong with binery heap?!!! Simple example: import std.container.binaryheap; import std.stdio; void main() { int[] a = [ 4, 1, 3, 2, 16, 9, 10, 14, 8, 7 ]; int[] b = new int[a.length]; auto h =

Re: What does the [] operator do here?

2020-04-02 Thread WebFreak001 via Digitalmars-d-learn
On Wednesday, 1 April 2020 at 19:35:30 UTC, Net wrote: from the below code, the expression "case [c]": void main() { import std.stdio, std.string, std.algorithm, std.conv; // Reduce the RPN expression using a stack readln.split.fold!((stack, op) { switch (op) {

Re: How add all folders of a diretory using -J ?

2020-04-02 Thread WebFreak001 via Digitalmars-d-learn
On Wednesday, 1 April 2020 at 23:19:39 UTC, Baby Beaker wrote: Exemple: Inside folder Project I have ten folders. How can I add this ten folders using dmd and -J command? I don't want add one by one. you could use `-J .` (-J projectFolder) so in your imports you can use

Re: dub sourceFiles

2020-04-01 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 31 March 2020 at 15:23:48 UTC, Anonymouse wrote: I have a library package that I split up into subpackages, but I'm having to do mental gymnastics to make it only compile the files I want. [...] how about targetType "none" if you don't have any source in the main package but

Re: How to deploy on GitHub pages

2020-04-01 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 31 March 2020 at 12:52:09 UTC, Ahmat wrote: Hi all, I want to use vibe.d for my personal website hosted on Github pages. I am not familiar with vibe.d and I am confused about how to approach this. Any suggestions, ideas ? I will appreciate your help. as Mathias said, GitHub

Re: Allocating an empty non null associative arary

2020-03-31 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 31 March 2020 at 02:51:11 UTC, Superstar64 wrote: I want to be modify an associative array by reference from another function. However null associative arrays are pass by value. How do I generically create an empty associative array? --- import std.stdio; void addElement(int[int]

Re: Find the heir.

2020-03-30 Thread WebFreak001 via Digitalmars-d-learn
On Sunday, 29 March 2020 at 15:07:37 UTC, Simen Kjærås wrote: On Sunday, 29 March 2020 at 14:04:53 UTC, TodNaz wrote: Hello! class A { ... } class B : A { ... } class C : A { ... } A example1; B example2 = new B(...); A = example2; auto heir = A.whoheir(); /// The question in

Re: Blog post about multidimensional arrays in D

2020-03-27 Thread WebFreak001 via Digitalmars-d-learn
On Friday, 27 March 2020 at 10:57:10 UTC, p.shkadzko wrote: I decided to write a small blog post about multidimensional arrays in D on what I learnt so far. It should serve as a brief introduction to Mir slices and how to do basic manipulations with them. It started with a small file with

Re: How package Dlang in a standalone portable executable?

2020-03-27 Thread WebFreak001 via Digitalmars-d-learn
On Thursday, 26 March 2020 at 23:19:20 UTC, Marcone wrote: I need package Dlang in a standalone portable executable. I need packcages all dependencies, dlls, files, etc in one executable file. by default if you use dub it will statically link phobos and druntime into the executable, so you

Re: How to code Z-Function of string?

2020-03-27 Thread WebFreak001 via Digitalmars-d-learn
On Thursday, 26 March 2020 at 20:08:39 UTC, Dennis wrote: On Thursday, 26 March 2020 at 19:34:08 UTC, Quantium wrote: 1. How can I make string ONLY char[] (Not immutable) You can use .dup to make a mutable copy of an array. ``` char[] a = "abc".dup; ``` extending on this: if you want to

Re: Swedish letters fuck up parsing into SQL querry

2020-03-24 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 24 March 2020 at 11:15:24 UTC, matheus wrote: On Monday, 23 March 2020 at 15:41:50 UTC, Adam D. Ruppe wrote: On Monday, 23 March 2020 at 15:15:12 UTC, Anders S wrote: I'm creating a connection to the db and conn.exec(sql) It depends on the library but it is almost always easier

Re: Swedish letters fuck up parsing into SQL querry

2020-03-24 Thread WebFreak001 via Digitalmars-d-learn
On Monday, 23 March 2020 at 15:15:12 UTC, Anders S wrote: On Monday, 23 March 2020 at 15:07:31 UTC, Adam D. Ruppe wrote: On Monday, 23 March 2020 at 14:26:46 UTC, Anders S wrote: do you mean I should loop through each pos till strlen(cellTab[CellIndex].name) to find "\0"? strlen is ok, that

@future attribute / @future keyword?

2020-03-18 Thread WebFreak001 via Digitalmars-d-learn
I have read about @future before being some kind of opposite of deprecated. However when trying to search about it now again I can't find any mentions of it anywhere except on https://dlang.org/spec/traits.html#isFuture It's difficult enough to search for "future" but even if limiting it to

@safe std.file.read

2020-01-06 Thread WebFreak001 via Digitalmars-d-learn
I was wondering, how are you supposed to use std.file : read in @safe code when it returns a void[] but you want to get all bytes in the file? Is void[] really the correct type it should be returning instead of ubyte[] when it just reads a (binary) file to memory? Or should void[] actually

Re: How to debug in vscode Windows?

2020-01-01 Thread WebFreak001 via Digitalmars-d-learn
On Friday, 27 December 2019 at 18:48:50 UTC, cfcd14f496326e429ce03c48650b7966 wrote: Hello. I spent many time to searching for find a solutions. Many posts not clearly or tell like brief. :( I tried "Microsoft C/C++(ms-vscode.cpptools)" and "Native Debug (webfreak.debug )" plugin. And I

Re: Blog Post #79: Notebook, Part III - Customized Tabs, Part I

2019-10-15 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 15 October 2019 at 20:03:00 UTC, Ron Tarrant wrote: On Tuesday, 15 October 2019 at 14:00:32 UTC, WebFreak001 wrote: thank you so much for these tutorials! I love how they are progressing. Thanks, WebFreak001. Small, simple and concise topics with good images, nice drawings, and

Re: Blog Post #79: Notebook, Part III - Customized Tabs, Part I

2019-10-15 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 15 October 2019 at 12:07:22 UTC, Ron Tarrant wrote: Well, if that title isn't confusing, I'm not doing my job right. Today's post starts a three-part mini-series within the Notebook series on building customized tabs in a DrawingArea. There's a ton of stuff to go over; that's why

Re: Blog Post #0039 - File Dialog V - Adding SaveAs and Titlebar Filename Reflection

2019-05-28 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 28 May 2019 at 09:47:23 UTC, Ron Tarrant wrote: Good day to you all. 'Tis another Tuesday and time for a new blog post. This is a continuation of the series on Dialogs and further, a continuation of the mini-series-within-a-series on file Dialogs. The subject is in the title as

Bug with profiling GC with multiple threads/fibers

2019-04-21 Thread WebFreak001 via Digitalmars-d-learn
I'm trying to GC profile serve-d which uses a lot of fibers potentially also across some threads and some threads doing some dedicated work, however -profile=gc doesn't seem to work properly. It logs `shared static this` calls and some methods, however none of the actual stuff is in there (and

Re: Linux & DMD & GtkD

2019-02-16 Thread WebFreak001 via Digitalmars-d-learn
On Saturday, 16 February 2019 at 13:35:57 UTC, Ron Tarrant wrote: Hi guys, I finally got a Linux Mint installation happening (very impressed, BTW) and did the usual HelloWorld.d compile with dmd, but I'm having trouble working out how to link to GtkD. dmd -de -w -m64 -L+gtkd

Re: Submenu Not Responding Until Second Click

2019-02-05 Thread WebFreak001 via Digitalmars-d-learn
On Monday, 4 February 2019 at 18:34:55 UTC, Ron Tarrant wrote: I posted about this over on the GtkD site, but I suspect no one's home until later in the day. [...] works fine here, can't reproduce with your example code. Maybe some GTK configuration of your system?

Re: Can't build vibed:tls project

2019-01-30 Thread WebFreak001 via Digitalmars-d-learn
On Monday, 28 January 2019 at 20:08:31 UTC, Suliman wrote: If I am specifying (sic! TLS): dependency "vibe-d:tls" version="0.8.4" in my dub.sdl I am getting error when building simple project: module `vibe` is in file 'vibe\vibe.d' which cannot be read But I need to get vibed build with

Re: code-d and serve-d fail to load after vs update

2019-01-25 Thread WebFreak001 via Digitalmars-d-learn
On Friday, 25 January 2019 at 19:47:59 UTC, greatsam4sure wrote: Just update vs code and since then I cannot use code-d and serve-d. below is dmd 2.084 complains. I will appreciate any help Installing into C:\Users\Greatsam\AppData\Roaming\code-d\bin git clone --recursive

Re: serve-d break on every update of vs code

2018-11-30 Thread WebFreak001 via Digitalmars-d-learn
On Friday, 30 November 2018 at 22:37:02 UTC, greatsam4sure wrote: On Friday, 30 November 2018 at 16:24:35 UTC, Laurent Tréguier wrote: On Friday, 30 November 2018 at 13:04:37 UTC, greatsam4sure wrote: vs code update every time I am connected to internet. Each time I accept the update my code-d

Re: serve-d break on every update of vs code

2018-11-30 Thread WebFreak001 via Digitalmars-d-learn
On Friday, 30 November 2018 at 13:04:37 UTC, greatsam4sure wrote: vs code update every time I am connected to internet. Each time I accept the update my code-d stops to show autocomplete. what is the best way to solve this problem. [...] hi, update dmd

Re: Could not setup D extension on vs code

2018-11-14 Thread WebFreak001 via Digitalmars-d-learn
On Wednesday, 14 November 2018 at 20:44:26 UTC, Neia Neutuladh wrote: On Wed, 14 Nov 2018 19:28:44 +, WebFreak001 wrote: It's a real pain that you can't select specific commits in dub, but I try to keep up with the updates and make them work somehow. Yeah, I've used submodules and

Re: Could not setup D extension on vs code

2018-11-14 Thread WebFreak001 via Digitalmars-d-learn
On Wednesday, 14 November 2018 at 13:20:31 UTC, greatsam4sure wrote: What is the solution to this: Unresolvable dependencies to package libdparse: dfmt ~master depends on libdparse ~>0.10.7 libddoc 0.4.0 depends on libdparse ~>0.9.0 Failed to install serve-d (Error code 2) Where can i

Re: Native PDB Error

2018-11-06 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 29 May 2018 at 07:47:07 UTC, Begah wrote: I have recently reinstalled a fresh version of Windows 10. I installed DMD 1.9.0 and compiled my code ( that was compiling before reinstalling Windows ). I get this error at the linking phase : Native PDB Error: The entry already exists.

Re: vibe.d: problematic "Non-@safe methods are deprecated in REST interfaces"

2018-07-10 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 10 July 2018 at 13:14:24 UTC, Piotr Mitana wrote: Hello, I've recently started building a little REST application on vibe.d. I decided to use the "database" library, as I need to communicate with the PostgreSQL instance. During the compilation I see the deprecation warning:

Re: How to call a C function from D that takes a FILE * as an argument?

2018-07-04 Thread WebFreak001 via Digitalmars-d-learn
On Wednesday, 4 July 2018 at 02:54:47 UTC, Joe wrote: On Wednesday, 4 July 2018 at 02:16:00 UTC, Seb wrote: Hmm, calling e.g. fprintf with stdout should just work: --- void main() { import core.stdc.stdio; fprintf(stdout, "Hello %s", "world".ptr); } --- Could you maybe provide your

Re: How do I break from loop when using parallel()?

2018-05-28 Thread WebFreak001 via Digitalmars-d-learn
On Monday, 28 May 2018 at 21:04:21 UTC, Dr.No wrote: import std.parallelism : parallel; foreach(t; parallel(arr)) { if(!doSomething(t)) { return false; }

Re: How do I make the debugger break when an exception is thrown in D?

2018-05-15 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 15 May 2018 at 10:50:15 UTC, Ethan Scott wrote: I constantly keep getting this error. Please help. you can override the default exception handling to skip the global try/catch block and then GDB will halt instead of letting it run.

Re: Advice on : rmdirRecurse and setAttributes in Windows

2018-04-22 Thread WebFreak001 via Digitalmars-d-learn
On Saturday, 21 April 2018 at 18:39:02 UTC, Vino wrote: Hi All, The function rmdirRecurse does not work in Windows if the file has the READ ONLY permission, so to over come this issue, i have written the below function to set the permission on file and folder using the function

Re: is this even possible? newbie + mixin template + foreach (allMembers)

2018-04-03 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 3 April 2018 at 18:49:00 UTC, Carlos Navarro wrote: QUESTION: Obviously I'm no geting mixins/templates nor traits and I'm failing miserably to find/identify the right examples or documentation to help me tackle this thing. What is wrong in this code? is this pattern sintactically

Re: workspace-d dsymbol Visual Code macOS

2018-02-06 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 6 February 2018 at 20:43:55 UTC, Joel wrote: On Tuesday, 6 February 2018 at 19:36:54 UTC, WebFreak001 wrote: On Tuesday, 6 February 2018 at 05:41:19 UTC, Joel wrote: I'm using a macOS (10.12.6) computer. workspace-d used to work, but now it says it's not installed, (I think since I

Re: workspace-d dsymbol Visual Code macOS

2018-02-06 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 6 February 2018 at 05:41:19 UTC, Joel wrote: I'm using a macOS (10.12.6) computer. workspace-d used to work, but now it says it's not installed, (I think since I quit out of Visual Code before shutting down the computer). I tried compiling with with the option, but got this:

Re: Can I use D with the Microsoft universal windows platform?

2018-01-05 Thread WebFreak001 via Digitalmars-d-learn
On Wednesday, 3 January 2018 at 18:33:27 UTC, Ozan wrote: Hi Are there any use cases or libraries for using D in Microsoft's universal windows platform environment? It would be nice to have XBOX Apps build on D ;-) Regards Ozan I made a half functioning winrt wrapper once but eventually I

Re: bitmanip : read does not accept my array slice

2017-12-26 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 26 December 2017 at 21:45:29 UTC, Dennis wrote: I was trying to translate this kind of C code to D: void calc(unsigned char *buf) { (...) res = read_u32_be([i]); } So I tried this: import std.bitmanip : read, Endian; void calc(ubyte[] buf) { (...) res = read!(uint,

Re: Dub project has both .sdl and .json files. Is this normal or did I do something wrong?

2017-12-18 Thread WebFreak001 via Digitalmars-d-learn
On Monday, 18 December 2017 at 22:36:44 UTC, WhatMeWorry wrote: I've been using Dub for a while but from the very beginning I decided to go with SDL 100% of the time, So I've got a dub.sdl file like: name "01_10_camera_view_space" description "A minimal D application." authors "kheaser"

Re: How to debug in vscode with mago-mi?

2017-07-20 Thread WebFreak001 via Digitalmars-d-learn
On Monday, 17 July 2017 at 08:44:46 UTC, Domain wrote: Could anyone show me how to debug in vscode with mago-mi? I have installed vscode with Native Debug, SDLang. I have tried dlang-vscode and code-d. [...] Is the application actually being put in bin/app.exe? Also try a different

Re: Derelict SDL segfaulting on ubuntu?

2017-03-21 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 21 March 2017 at 13:04:29 UTC, Robly18 wrote: On Tuesday, 21 March 2017 at 12:39:26 UTC, WebFreak001 wrote: On Tuesday, 21 March 2017 at 12:31:41 UTC, Robly18 wrote: I've been working on a small game of tic tac toe using Derelict SDL, and development has been going along great...

Re: Derelict SDL segfaulting on ubuntu?

2017-03-21 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 21 March 2017 at 12:31:41 UTC, Robly18 wrote: I've been working on a small game of tic tac toe using Derelict SDL, and development has been going along great... Until I tried to develop on my Ubuntu laptop. [...] Derelict-SDL is binding against newer functions than ubuntu

Re: core.sys.windows.winldap

2017-03-09 Thread WebFreak001 via Digitalmars-d-learn
On Thursday, 9 March 2017 at 10:44:00 UTC, rikki cattermole wrote: On 09/03/2017 11:19 PM, WebFreak001 wrote: ... Import libs like static libraries adhere to the same specs of PE-COFF versus OMF. So if you want things to work without much hassle, hello -m64! Thanks, adding

core.sys.windows.winldap

2017-03-09 Thread WebFreak001 via Digitalmars-d-learn
I tried using core.sys.windows.winldap (winldap.h) but I get linker errors when I try to run my code. I tried copying Wldap32.lib from my Windows Kits folder but then optlink always says Error 43 Not a Valid Library File. I simply use `dub test` to compile, adding `"libs": ["Wldap32"]` only

Re: Can't rending DT template

2017-02-26 Thread WebFreak001 via Digitalmars-d-learn
On Sunday, 26 February 2017 at 12:22:01 UTC, Suliman wrote: I have this code: module pages; import vibe.d; import database; import vibe.web.web; class MyPages { @path("/page1") void getPage() { render!("home.dt"); } } The error: https://snag.gy/PtNeSs.jpg Error: template

Re: Debugging D applications from VS code with webfreak.debug

2017-02-23 Thread WebFreak001 via Digitalmars-d-learn
On Thursday, 23 February 2017 at 16:28:26 UTC, FR wrote: Hi everyone, as the subject says, I'm trying to get a debugger running with visual studio code on windows. I have installed WebFreak001's code-d and debug extensions but fail to figure out how to install a working debugger. The gdb I

Re: Vibe.d form file attributes

2016-12-20 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 20 December 2016 at 18:22:51 UTC, aberba wrote: [...] Now I wanted to implement this in D (vibe.d) and here is what I did in the file upload handler. void upload(HTTPServerRequest req, HTTPServerResponse res) { import std.stdio; foreach(picture; req.files) // req.files

Re: typeof(SortedRange) and is operator

2016-11-08 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 8 November 2016 at 13:59:19 UTC, Nicholas Wilson wrote: You can't, this is a mailing list not a forum. > forum.dlang.org

Re: SQLite

2016-10-19 Thread WebFreak001 via Digitalmars-d-learn
On Wednesday, 19 October 2016 at 16:01:37 UTC, Alfred Newman wrote: Hello, I am trying to handle a SQLite3 table with D. During my researchs, I discovered the lib https://dlang.org/phobos/etc_c_sqlite3.html. However, for any reason, there is no code snippets or sample codes available

  1   2   >