Re: New developments on topic of memset, memcpy and similar

2021-11-27 Thread MrSmith via Digitalmars-d-learn
On Saturday, 27 November 2021 at 11:15:45 UTC, Igor wrote: Additionally, here is the twitter thread from the author: https://twitter.com/nadavrot/status/1464364562409422852

Re: How to make the compile time red color warning ?

2020-06-03 Thread MrSmith via Digitalmars-d-learn
On Wednesday, 3 June 2020 at 11:48:27 UTC, Виталий Фадеев wrote: Use case: I have class for Windows OS. I not implement class for Linux. I want message about it. When code compiled under Linux. You could use `static assert(false, "Message");` to make it an error.

Re: Can't compile dlangui

2020-03-03 Thread MrSmith via Digitalmars-d-learn
On Friday, 7 February 2020 at 12:04:10 UTC, A.Perea wrote: Hi, I'm trying to compile dlangide, and it fails when compiling the dependency dlangui. Trying to compile dlangui independently gives the same error message (see below for full stack trace) [...] On Friday, 7 February 2020 at 12:0

Re: calloc for std.experimental.allocator

2018-01-11 Thread MrSmith via Digitalmars-d-learn
On Thursday, 11 January 2018 at 21:09:01 UTC, Nordlöw wrote: Is there no equivalent of `calloc()` for `std.experimental.allocator`, something like Allocator.zeroAllocate(size_t numberOfElements) ? http://dpldocs.info/experimental-docs/std.experimental.allocator.makeArray.4.html

Re: partial application for templates

2017-12-25 Thread MrSmith via Digitalmars-d-learn
On Monday, 25 December 2017 at 20:39:52 UTC, Mengu wrote: is partially applying templates possible? template A(X, Y, Z) {} alias B(X, Y) = A!(X, Y, int);

Re: GUI app brings up console

2017-12-06 Thread MrSmith via Digitalmars-d-learn
On Wednesday, 6 December 2017 at 21:25:27 UTC, Ivan Trombley wrote: I created a cross-platform app using gtk-d. Everything works fine but when I run it from Windows, a console window is opened. How can I tell Windows that it's a GUI application so that a console is not opened (keeping in mind t

Linking error: unresolved external symbol internal

2017-10-10 Thread MrSmith via Digitalmars-d-learn
I have a static library and an application. When linking final executable I get: lib.lib(texteditor_1d_40c.obj) : error LNK2001: unresolved external symbol internal lib.lib(textbuffer_14_3ce.obj) : error LNK2001: unresolved external symbol internal Happens on Windows 32 and 64 bit. On

Re: Playing with Entity System, performance and D.

2017-06-19 Thread MrSmith via Digitalmars-d-learn
You may find this interesting https://github.com/MrSmith33/datadriven

Re: trying to implement lock-free fixedsize queue

2016-03-31 Thread MrSmith via Digitalmars-d-learn
On Thursday, 31 March 2016 at 18:25:46 UTC, jacob wrote: I try to implement chunk (something like lock-free fixedsize queue) ... Check out this implementation https://github.com/MartinNowak/lock-free/blob/master/src/lock_free/rwqueue.d

Re: Yieldable function?

2015-08-13 Thread MrSmith via Digitalmars-d-learn
http://dlang.org/phobos/core_thread.html#.Fiber

Re: Opening browser and url.

2015-06-25 Thread MrSmith via Digitalmars-d-learn
On Thursday, 25 June 2015 at 14:02:41 UTC, Bauss wrote: In other programming languages you can open a website in the default browser by spawning a process using the url, but it does not seem to work with D using spawnProcess(). Do I have to do API calls to get the default browser and then cal

Re: Best practices for reading public interfaces

2015-02-22 Thread MrSmith via Digitalmars-d-learn
On Saturday, 21 February 2015 at 20:46:09 UTC, Kenny wrote: I like D modules and it's a major point in the list of major points why I like D (there is also the second not so nice wft-list but it's for another post). I'm annoyed with C++ includes and I'm tired to create 2 files every time when I n

Re: Cannot use the same template arguments on function as the ones on struct

2015-02-12 Thread MrSmith via Digitalmars-d-learn
Thank you!

Re: Cannot use the same template arguments on function as the ones on struct

2015-02-12 Thread MrSmith via Digitalmars-d-learn
Thanks, everyone.

Cannot use the same template arguments on function as the ones on struct

2015-02-11 Thread MrSmith via Digitalmars-d-learn
Here I have templated struct that matches type with CborConfig tempate specialization CborConfig will have more parameters in future and all of them will be accessed via alias members, so I've used variadic (T...) parameter whule matching. --- template CborConfig(_nonSerializedAttribute)

Re: How to share modules when using -shared?

2014-12-14 Thread MrSmith via Digitalmars-d-learn
On Wednesday, 10 December 2014 at 00:44:41 UTC, Justin Whear wrote: I'm trying to build components that I can dynamically link and keep running into an issue with sharing modules between the host and the pluggable components. Assuming a layout like this: host.d -- loads components at runtim

Re: dub dustmite

2014-12-14 Thread MrSmith via Digitalmars-d-learn
On Friday, 12 December 2014 at 04:25:01 UTC, Vlad Levenfeld wrote: I'm trying to reduce a bug with dub dustmite feature and I must be doing it wrong somehow, my regular dub output looks like this: source/experimental.d(2403): Error: struct experimental.Product!(int[], int[]).Product no size

Re: regular expression engine and ranges

2014-12-02 Thread MrSmith via Digitalmars-d-learn
On Tuesday, 2 December 2014 at 19:17:43 UTC, ketmar via Digitalmars-d-learn wrote: Hello. is there any decent regular expression engine which works with input ranges? under "decent" i mean "good D code", "[t]nfa" and "no backtracking". support for captures and greedy/non-greedy modes are mus

Re: print yyyy-mm-dd

2014-11-20 Thread MrSmith via Digitalmars-d-learn
On Thursday, 20 November 2014 at 13:50:49 UTC, Suliman wrote: I can't understand how to get date in format -MM-dd from Clock.currTime auto time = Clock.currTime; And what next? Could anybody give any examples? http://dpaste.dzfl.pl/73c0438f9d1e currTime returns SysTime; You can then cast

Re: help

2014-11-20 Thread MrSmith via Digitalmars-d-learn
On Thursday, 20 November 2014 at 16:48:29 UTC, MachineCode wrote: On Thursday, 20 November 2014 at 07:25:45 UTC, Suliman wrote: You need to check if remote file exist of server and only after it download шею is this software name written in russian language? "шею" means "it." on russian keyb

Re: accessing numeric template parameters

2014-11-03 Thread MrSmith via Digitalmars-d-learn
On Monday, 3 November 2014 at 14:27:47 UTC, Dominikus Dittes Scherkl wrote: If I have a struct with numeric template parameter, how can I access it within member functions? Like normal member variables? And how about the constructor? struct polynomial(uint base) { private: uint[] N; public:

Re: Question about eponymous template trick

2014-11-03 Thread MrSmith via Digitalmars-d-learn
On Monday, 3 November 2014 at 14:07:55 UTC, Uranuz wrote: I have an example of code like this: template Node(String) { struct Node {} struct Name {} struct Attr {} } void main() { alias MyNode = Node!(string).Node; alias MyName = Node!(string).Na

Re: HTML Parsing lib

2014-10-25 Thread MrSmith via Digitalmars-d-learn
On Saturday, 25 October 2014 at 19:55:10 UTC, Suliman wrote: How I can build such App with DUB? Unfortunately that library has no dub package. But you can include it in your project. See info here http://code.dlang.org/package-format

Re: HTML Parsing lib

2014-10-25 Thread MrSmith via Digitalmars-d-learn
On Saturday, 25 October 2014 at 19:46:01 UTC, MrSmith wrote: On Saturday, 25 October 2014 at 19:44:25 UTC, Suliman wrote: I found only https://github.com/Bystroushaak/DHTMLParser But I can't get it work: C:\Users\Dima\Downloads\DHTMLParser-master\DHTMLParser-master>dmd find_links.d

Re: HTML Parsing lib

2014-10-25 Thread MrSmith via Digitalmars-d-learn
On Saturday, 25 October 2014 at 19:44:25 UTC, Suliman wrote: I found only https://github.com/Bystroushaak/DHTMLParser But I can't get it work: C:\Users\Dima\Downloads\DHTMLParser-master\DHTMLParser-master>dmd find_links.d OPTLINK (R) for Win32 Release 8.00.15 Copyright (C) Digital Mars 1989-2

Re: Making plugin system with shared libraries. Upcast in shared lib

2014-10-21 Thread MrSmith via Digitalmars-d-learn
On Tuesday, 21 October 2014 at 13:57:23 UTC, Kagamin wrote: On Monday, 20 October 2014 at 15:07:43 UTC, MrSmith wrote: On Monday, 20 October 2014 at 14:05:29 UTC, Kagamin wrote: Do it the COM way: publish IModule2 interface and declare GetInterface method, which will return a prepared pointer

Re: Making plugin system with shared libraries. Upcast in shared lib

2014-10-20 Thread MrSmith via Digitalmars-d-learn
On Monday, 20 October 2014 at 15:30:28 UTC, Martin Nowak wrote: On 10/20/2014 12:32 AM, MrSmith wrote: Than any module can search for registered modules and try to cast them to concrete type (upcast). That can't work because the notion of types only exists during compilation. Therefor

Re: Making plugin system with shared libraries. Upcast in shared lib

2014-10-20 Thread MrSmith via Digitalmars-d-learn
On Monday, 20 October 2014 at 14:05:29 UTC, Kagamin wrote: Do it the COM way: publish IModule2 interface and declare GetInterface method, which will return a prepared pointer, which you would reinterpret cast to IModule2. Will it work on linux with simple .so libs? I want it to be as simple as

Making plugin system with shared libraries. Upcast in shared lib

2014-10-19 Thread MrSmith via Digitalmars-d-learn
I'm using Windows. I was making some sort of modular system where you can define modules that are loaded by host application. Here is a simple example https://gist.github.com/MrSmith33/7692328455a19e820a7c Now i want to separate these "modules" in separate shared libs and link them on the fly.

Re: Trying to get Derelict.opengl3.gl3 and derelict.glfw3.glfw3 to work together

2014-09-25 Thread MrSmith via Digitalmars-d-learn
On Wednesday, 24 September 2014 at 13:59:41 UTC, csmith wrote: On Wednesday, 24 September 2014 at 11:07:56 UTC, Mike Parker wrote: You're using deprecated OpenGL calls. The gl3 module only declares and loads modern OpenGL. If you really want to use the deprecated stuff, change the gl3 import to

Re: Ropes (concatenation trees) for strings in D ?

2014-08-16 Thread MrSmith via Digitalmars-d-learn
On Saturday, 16 August 2014 at 02:26:29 UTC, ketmar via Digitalmars-d-learn wrote: On Fri, 15 Aug 2014 19:04:10 -0700 Timothee Cour via Digitalmars-d-learn wrote: sounds like my C library based on this article: http://e98cuenc.free.fr/wordprocessor/piecetable.html i'm slowly converting my C co

Re: Using input ranges with std.regex?

2014-08-11 Thread MrSmith via Digitalmars-d-learn
On Wednesday, 25 April 2012 at 21:43:11 UTC, Dmitry Olshansky wrote: On 25.04.2012 23:08, H. S. Teoh wrote: Does std.regex support input ranges to match()? Or do I need to convert to string first? For now, yes you have to convert them. Any random access range of code units should do the tri

Re: delegate issue

2014-06-02 Thread MrSmith via Digitalmars-d-learn
On Monday, 2 June 2014 at 06:56:54 UTC, captaindet wrote: hi, i stumbled upon something weird - it looks like a bug to me but maybe it is a "feature" that is unclear to me. so i know i can declare function and delegate pointers at module level. for function pointers, i can initialize with a

Re: Programming a Game in D? :D

2014-05-25 Thread MrSmith via Digitalmars-d-learn
Also opengl tutorials for D https://github.com/d-gamedev-team/opengl-tutorials

Re: Inherit of attributes

2014-04-25 Thread MrSmith via Digitalmars-d-learn
On Friday, 25 April 2014 at 07:59:29 UTC, Temtaime wrote: Hi ! http://dpaste.dzfl.pl/2fa3dd2ea834 Why S.init not pure ? Is it expected behavior or bug ? Thanks! Fix http://dpaste.dzfl.pl/03f73cd958f4

Re: alias this and constructor

2014-04-12 Thread MrSmith
On Saturday, 12 April 2014 at 11:48:36 UTC, Jack Applegame wrote: Why this code doesn't want to compile? import std.algorithm; import std.array; struct Foo { int a; this(int v) {} alias a this; } void main() { immutable(Foo)[] foo; auto arr = array(foo.f

Re: build anchovy,find a bug when build utils.lib

2014-04-09 Thread MrSmith
On Wednesday, 9 April 2014 at 05:45:15 UTC, FrankLike wrote: Hi,MrSmith, Compilation failed: import\anchovy\utils\rect.d(110): Error: 'dlib.math.utils.clampValue!uint.clamp' is not nothrow import\anchovy\utils\rect.d(114): Error: 'dlib.math.utils.clampValue!uint.clamp&

Re: Anchovy is good,Find a bug: can't get the gui.lib

2014-04-08 Thread MrSmith
On Tuesday, 8 April 2014 at 14:31:42 UTC, FrankLike wrote: hello,MrSmith, I build the anchovy's guidemo, but can't get the gui.lib, the err is :timemanager.d(153) instantiated from here:sort!(a.) std\range.d(2188) can't be declared be a funtion you can test the

Re: Magic infinite loop inside foreach

2014-01-31 Thread MrSmith
On Friday, 31 January 2014 at 14:05:10 UTC, MrSmith wrote: On Thursday, 30 January 2014 at 23:45:14 UTC, Joseph Rushton Wakeling wrote: On 31/01/14 00:08, MrSmith wrote: Somehow if i comment out //matrix = solveTemp(temp); it works, but this method works fine, and after it done1 is printed

Re: Magic infinite loop inside foreach

2014-01-31 Thread MrSmith
On Thursday, 30 January 2014 at 23:45:14 UTC, Joseph Rushton Wakeling wrote: On 31/01/14 00:08, MrSmith wrote: Somehow if i comment out //matrix = solveTemp(temp); it works, but this method works fine, and after it done1 is printed. Strange. That does rather suggest that it's that m

Re: Magic infinite loop inside foreach

2014-01-30 Thread MrSmith
On Thursday, 30 January 2014 at 22:56:46 UTC, MrSmith wrote: I have some function which does some matrix calculations and prints them. It is actually calculationg determinant of the matrix and i need to call those functions several times in the loop, until i get the final result. Here is the

Magic infinite loop inside foreach

2014-01-30 Thread MrSmith
I have some function which does some matrix calculations and prints them. It is actually calculationg determinant of the matrix and i need to call those functions several times in the loop, until i get the final result. Here is the code. void solveAndPrint(T : CoeffMatrix!(ElementType, Element

Re: Removing multiple elements from array

2013-12-21 Thread MrSmith
On Saturday, 21 December 2013 at 00:47:04 UTC, aldanor wrote: Is there an efficient method to remove elements with multiple (compile-time-unknown) indices from an array? I currently do something like if (!index.empty) foreach (i; index.sort.reverse)

Re: How to link to libdl under linux

2013-12-20 Thread MrSmith
-L-ldl do not work but pragma(lib, "dl"); works! Wtf?

Re: How to link to libdl under linux

2013-12-19 Thread MrSmith
dmd -m32 -of.dub/build/application-debug-x86-dmd-DA39A3EE5E6B4B0D3255BFEF95601890AFD80709/test -c -of.dub/build/application-debug-x86-dmd-DA39A3EE5E6B4B0D3255BFEF95601890AFD80709/test.o -debug -g -w -version=Have_test -version=Have_derelict_glfw3 -version=Have_derelict_util -I../../.dub/packa

Re: How to link to libdl under linux

2013-12-19 Thread MrSmith
The -of flag tells the compiler which name to use for executable. Yep, but why it is used twice? dmd -m32 -of.dub/build/application-debug-x86-dmd-DA39A3EE5E6B4B0D3255BFEF95601890AFD80709/test -c -of.dub/build/application-debug-x86-dmd-DA39A3EE5E6B4B0D3255BFEF95601890AFD80709/test.o

Re: How to link to libdl under linux

2013-12-19 Thread MrSmith
Still need help. I've tried compiling a little test project with dub and it compiled. Then i tried to compile it by hand and got the same error. I think there is some issue in my command with parameter ordering. Here is test project module test; import derelict.glfw3.glfw3; import std.stdio;

Re: How to link to libdl under linux

2013-12-17 Thread MrSmith
Eventually i have lot of time to answer. Here is what 'find' emits: andrey@andress-ubuntu:~/anchovy$ find /lib /lib32 /usr/lib /usr/lib32 -name "libdl*.so*" -type f -exec file {} ";" /lib/i386-linux-gnu/libdl-2.17.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically lin

Re: how to detect OS architecture?

2013-12-16 Thread MrSmith
version(Windows) { // Windows code goes here } else { // Other OS code goes here } More here: http://dlang.org/version.html I think he wants determine at runtime what architecture x86 or x64 processor supprots and launch appropriate executable. I think this is what he want http:/

Re: How to link to libdl under linux

2013-12-16 Thread MrSmith
You're still not linking ld properly. It would help tremendously if you could show the command line you're using. Otherwise all people can do is make guesses about what *might* be wrong. Oh, right. Here is first with "/usr/lib32/libdl.a" -L-ldl andrey@andress-ubuntu:~/anchovy$ dmd -debug -gc

Re: How to link to libdl under linux

2013-12-16 Thread MrSmith
On Monday, 16 December 2013 at 07:36:12 UTC, Jacob Carlborg wrote: On 2013-12-16 01:54, Danny Arends wrote: Pass it depending if you use rdmd or dmd -L-ldl or -ldl It's -L-ldl regardless of it's rdmd or dmd. now i'm getting this error: deps/derelict-fi-master/lib/libDerelictFI.a(sharedl

How to link to libdl under linux

2013-12-15 Thread MrSmith
I am trying to compile my program which uses derelict under ubuntu 13.10. DerelictUtil needs access to dl library. Simply providing libdl.a as parameter to compiler doesn't work. deps/derelict-fi-master/lib/libDerelictFI.a(sharedlib_416_4ee.o): In function `_D8derelict4util9sharedlib13LoadShar

Re: Swapping nibbles range style

2013-12-10 Thread MrSmith
On Tuesday, 10 December 2013 at 22:08:17 UTC, Volcz wrote: Hi! As a small exercise I've been trying to implement a nibble swapping method which utilizes D's ranges. I received some help from eco on #d but still couldn't complete it. his contribution: http://dpaste.dzfl.pl/f228d0a8 Example:

Re: How to use retro over findSplitBefore result?

2013-12-04 Thread MrSmith
On Wednesday, 4 December 2013 at 18:26:43 UTC, Ali Çehreli wrote: On 12/04/2013 09:43 AM, MrSmith wrote: I am trying to compile following code import std.algorithm : findSplitBefore; import std.range : retro; import std.array : array; // returns file path where name has suffix and prefix

Re: How to use retro over findSplitBefore result?

2013-12-04 Thread MrSmith
On Wednesday, 4 December 2013 at 18:01:52 UTC, Jesse Phillips wrote: On Wednesday, 4 December 2013 at 17:43:22 UTC, MrSmith wrote: I am trying to compile following code import std.algorithm : findSplitBefore; import std.range : retro; import std.array : array; // returns file path where name

How to use retro over findSplitBefore result?

2013-12-04 Thread MrSmith
I am trying to compile following code import std.algorithm : findSplitBefore; import std.range : retro; import std.array : array; // returns file path where name has suffix and prefix string withSuffixPrefix(string filePath, string prefix, string suffix) { auto splitted = filePath.retro.fi

Re: Started to get 'Previous Definition Different' linking errors when compiling in debug mode

2013-05-21 Thread MrSmith
On Tuesday, 21 May 2013 at 01:55:34 UTC, evilrat wrote: wait, are you using 2.063 beta? No, dmd 2.062. Similar problem here http://forum.dlang.org/thread/rlphljyhtcikzllrg...@forum.dlang.org

Re: Linker error

2013-05-20 Thread MrSmith
On Monday, 20 May 2013 at 18:25:19 UTC, Namespace wrote: Nice. Hope that this will be solved. Do you have a working workaround? As you may have read, i had writeln statement which when removed from code causes linker error. In my case i can just place it back. It was writeln(uniforms);

Re: Linker error

2013-05-20 Thread MrSmith
On Monday, 20 May 2013 at 15:41:28 UTC, Namespace wrote: Works with dmd 2.062. Strange. Have the similar problem here http://forum.dlang.org/thread/zkbrvrlvujmnnjqqp...@forum.dlang.org

Re: Started to get 'Previous Definition Different' linking errors when compiling in debug mode

2013-05-20 Thread MrSmith
On Monday, 20 May 2013 at 12:42:50 UTC, evilrat wrote: do you have referenced projects in xamarin? if so, any time you change something in one of such projects you need to rebuild whole solution, that one of many reasons why i don't use xamarin/mono-d Yes, i have. This moment has started to a

Re: Started to get 'Previous Definition Different' linking errors when compiling in debug mode

2013-05-20 Thread MrSmith
On Monday, 20 May 2013 at 11:09:53 UTC, MrSmith wrote: Now i decided to try exlxlude files from LibCore until the problem disappears, to find the file that causes problem. Thanks for your answer! I found where is a bug. It is old magic bug that a have magically fixed in the past. But seems

Re: Started to get 'Previous Definition Different' linking errors when compiling in debug mode

2013-05-20 Thread MrSmith
On Monday, 20 May 2013 at 07:16:57 UTC, evilrat wrote: On Sunday, 19 May 2013 at 11:45:10 UTC, MrSmith wrote: I have also tried to use previous versions of Derelict and versions of my library. you use old lib compiled with older dmd? or using same compiler version you update derelict

Re: Started to get 'Previous Definition Different' linking errors when compiling in debug mode

2013-05-19 Thread MrSmith
I have also tried to use previous versions of Derelict and versions of my library.

Started to get 'Previous Definition Different' linking errors when compiling in debug mode

2013-05-19 Thread MrSmith
I am using Derelict for my GUI project and after moving to the newest version i am getting following errors. These errors are occuring in debug mode only. Here is the log from Xamarin studio: Building: guitest (Debug) Performing main compilation... Current dictionary: C:\Documents\Projects\vox