Templated class requires values even though having default value

2021-05-09 Thread tcak via Digitalmars-d-learn
public class OpenCLKernel(size_t dim = 1) if( (dim >= 1) && (dim <= 3) ) { public this( OpenCLProgram program, in string kernelName ) { // ... } } I have a class definition as above. When I want to create

Re: String concatenation segmentation error

2021-04-22 Thread tcak via Digitalmars-d-learn
On Friday, 23 April 2021 at 00:30:02 UTC, Adam D. Ruppe wrote: On Thursday, 22 April 2021 at 21:15:48 UTC, tcak wrote: "positions" array is defined as auto positions = new float[ 100 ]; So, I am 100% sure, it is not out of range. "ri*dim + 1" is not a big number at all. Oh and *where* is

Re: String concatenation segmentation error

2021-04-22 Thread tcak via Digitalmars-d-learn
In other parts of the code, concatenation operations are all failing with same error. I need guidance to get out of this situation. My assumption was that as long as there is empty heap memory, concatenation operation would succeed always. But, it doesn't seem like so.

String concatenation segmentation error

2021-04-22 Thread tcak via Digitalmars-d-learn
string fileContent = ""; ... writeln(ri, ": debug 1"); foreach(i; 0..dim) { if( i > 0 ){ fileContent ~= "\t"; } writeln(ri, ": debug 1.1: ", ri*dim + i, ": ", positions[ ri*dim + i ]); fileContent ~= to!string(positions[ ri*dim + i ]); writeln(ri, ": debug 1.2: ", ri*dim

Re: Read X many bytes from File to address Y

2021-04-07 Thread tcak via Digitalmars-d-learn
On Wednesday, 7 April 2021 at 12:50:01 UTC, Adam D. Ruppe wrote: On Wednesday, 7 April 2021 at 11:42:56 UTC, tcak wrote: There is rawRead, but it takes an array as parameter, which causes a dirty looking code with cast etc! What did you wrote? file.rawRead(address[0 .. desiredLength])

Don't allow to reassign, but content is editable

2021-04-07 Thread tcak via Digitalmars-d-learn
In javascript, with "const" keyword, you assign an object to a variable. Later, you cannot assign anything else to that variable, but content of it still can be changed. No matter by using "immutable" or "const", I cannot imitate that. Is there a way to do this without an overhead (like

Read X many bytes from File to address Y

2021-04-07 Thread tcak via Digitalmars-d-learn
I am talking about std.file.File. I have opened the file, and at a specific offset. I want to read X many bytes from the file, and want it to be written to given address directly without any Magical D-stuff like ranges etc. Is there a way to do this without getting into C or Posix header

Include http based module

2021-02-19 Thread tcak via Digitalmars-d-learn
I have written a test module and put it into /var/www/html: module mymodule; import std.stdio; void testMe(){ writeln("I tested you!"); } Then I have a main file where I would like to call the function "testMe". My build line is as follows: dmd main.d "http://localhost/mymodule.d;

New with alias

2020-03-10 Thread tcak via Digitalmars-d-learn
I write a code as below: auto result = new char[4]; It allocates memory as expected. Later I define an alias and do the above step: alias Pattern = char[4]; auto result = new Pattern; But compiler says: Error: new can only create structs, dynamic arrays or class objects, not `char[4]`'s

Re: Alias of template class

2019-11-30 Thread tcak via Digitalmars-d-learn
On Saturday, 30 November 2019 at 09:39:59 UTC, tcak wrote: I defined a class: class KNN(size_t k){} I want to define an alias for KNN when k=5, alias KNN5 = KNN!5; So that I could define a variable as KNN5 knnObject; Then create it later as knnObject = new KNN5(); But the compiler

Alias of template class

2019-11-30 Thread tcak via Digitalmars-d-learn
I defined a class: class KNN(size_t k){} I want to define an alias for KNN when k=5, alias KNN5 = KNN!5; So that I could define a variable as KNN5 knnObject; Then create it later as knnObject = new KNN5(); But the compiler gives error for the alias line: Error: template instance

Re: String Comparison Operator

2017-04-30 Thread tcak via Digitalmars-d-learn
On Sunday, 30 April 2017 at 15:31:39 UTC, Jolly James wrote: Is there a String Comparison Operator in D? You normally use double equation marks (==) to do that. auto name = "Jack"; if( name == "Jack" ) writeln("Hi Jack!");

Get list of public methods of struct

2017-03-09 Thread tcak via Digitalmars-d-learn
Is there any way to get list of public methods of a struct? I looked at both "traits" and "std.traits". getVirtualFunctions and getVirtualMethods are closest I guess, but they don't seem like general purpose due to "Virtual" part. (Wouldn't it work if a method was final?) I saw

Re: Referring to array element by descriptive name

2017-01-14 Thread tcak via Digitalmars-d-learn
On Saturday, 14 January 2017 at 15:11:40 UTC, albert-j wrote: Is it possible to refer to an array element by a descriptive name, just for code clarity, without performance overhead? E.g. void aFunction(double[] arr) { double importantElement = arr[3]; ... use importantElement ... }

Creating shared library on Monodevelop with MonoD, Implib problem

2016-11-18 Thread tcak via Digitalmars-d-learn
I am on Ubuntu. I try to create a very basic (one empty function declaration) shared library for testing. MonoD (version 2.14.5), generates a command line similar to following: dmd -debug -gc "myclass.d" "-I/usr/include/dmd" "-L/IMPLIB:/home/user/Projects/Router/bin/Debug/libRouter.a"

Re: Real Simple Question?

2016-10-25 Thread tcak via Digitalmars-d-learn
On Saturday, 22 October 2016 at 21:34:36 UTC, WhatMeWorry wrote: On Saturday, 22 October 2016 at 20:51:14 UTC, Jonathan M Davis wrote: [...] Ok, but now I'm getting these error in my new mypackage/constants.d ..\common\vertex_data.d(5,15): Error: undefined identifier 'GLfloat'

Re: dmd or phobos were broken in ubuntu 16.10 d-apt

2016-10-21 Thread tcak via Digitalmars-d
On Friday, 21 October 2016 at 04:16:38 UTC, mogu wrote: [...] Yes, we (I and one another person on this forum) have the same problem. As a temporary solution, while compiling your program, add -defaultlib=libphobos2.so -fPIC This solved my problem on Ubuntu 16.10. But with one problem.

Posix access function

2016-10-18 Thread tcak via Digitalmars-d-learn
Checked std.stdio, std.file, std.path, couldn't have found anyway to check permissions on a file for read, write, execute. Without getting into core module, does it exist anywhere in std module?

Re: Programming in D by Ali Çehreli

2016-10-17 Thread tcak via Digitalmars-d-learn
On Monday, 17 October 2016 at 18:20:00 UTC, cym13 wrote: On Monday, 17 October 2016 at 18:10:01 UTC, vino wrote: [...] I don't see what you don't understand, you said it yourself: "neither the slice nor its elements can be modified". So you can't modify the elements of an immutable array.

Re: Cannot link with libphobos2.a with GCC 6.2 on Ubuntu 16.10

2016-10-17 Thread tcak via Digitalmars-d-learn
On Sunday, 16 October 2016 at 22:36:15 UTC, Nordlöw wrote: On Sunday, 16 October 2016 at 22:00:48 UTC, Nordlöw wrote: Which flag(s) in `src/posix.mak` did you change? Does make -f posix.mak MODEL_FLAG=-fPIC work? I'm sitting on a 16.04 system right now (which I don't dare to upgrade

Re: Cannot link with libphobos2.a with GCC 6.2 on Ubuntu 16.10

2016-10-16 Thread tcak via Digitalmars-d-learn
On Sunday, 16 October 2016 at 17:42:44 UTC, tcak wrote: On Thursday, 13 October 2016 at 17:02:32 UTC, Nordlöw wrote: [...] I have upgraded my Ubuntu to 16.10 yesterday as well, and I am getting following error: /usr/bin/ld: obj/Debug/program.o: relocation R_X86_64_32 against symbol

Re: Speed of synchronized

2016-10-16 Thread tcak via Digitalmars-d-learn
On Sunday, 16 October 2016 at 08:41:26 UTC, Christian Köstlin wrote: Hi, for an exercise I had to implement a thread safe counter. This is what I came up with: [...] Could you try that: class ThreadSafe3Counter: Counter{ private long counter; private core.sync.mutex.Mutex mtx;

Re: Cannot link with libphobos2.a with GCC 6.2 on Ubuntu 16.10

2016-10-16 Thread tcak via Digitalmars-d-learn
On Thursday, 13 October 2016 at 17:02:32 UTC, Nordlöw wrote: I just upgraded my Ubuntu to 16.10 and now my rebuilding of dmd from git master fails as /usr/bin/ld: idgen.o: relocation R_X86_64_32 against symbol `__dmd_personality_v0' can not be used when making a shared object; recompile with

Re: Anonymous class

2016-10-12 Thread tcak via Digitalmars-d-learn
On Wednesday, 12 October 2016 at 11:56:21 UTC, tcak wrote: I feel like I remember that this was added to D a while ago, but I am not sure. Is it possible to create anonymous classes? public interface Runnable{ void run(); } runIt( new Runnable(){ void run(){ /* do stuff */

Anonymous class

2016-10-12 Thread tcak via Digitalmars-d-learn
I feel like I remember that this was added to D a while ago, but I am not sure. Is it possible to create anonymous classes? public interface Runnable{ void run(); } runIt( new Runnable(){ void run(){ /* do stuff */ } }); I want to do this without making the things any

Re: Module Clarification

2016-09-21 Thread tcak via Digitalmars-d-learn
On Wednesday, 21 September 2016 at 14:17:56 UTC, Jonathan Marler wrote: I'm working on a code generation tool and wanted to make sure my module approach was correct. The generated code has a module hierarchy, where modules can appear at any level of the hierarchy. module foo; module

Re: consequences of removing semicolons in D like in Python

2016-09-17 Thread tcak via Digitalmars-d
On Saturday, 17 September 2016 at 05:03:17 UTC, Chris Wright wrote: On Fri, 16 Sep 2016 23:00:08 +, eugene wrote: Hello everyone, what if to remove semicolons at the end of each line of code in D like in Python? Is it worth it? It's more than reinterpreting newline as a semicolon. For

Re: Export GC Usage Statistics on Request for Profiling

2016-07-15 Thread tcak via Digitalmars-d
On Friday, 15 July 2016 at 17:04:35 UTC, Andrei Alexandrescu wrote: On 07/15/2016 12:31 PM, tcak wrote: Do you know about --profile=gc? 1. Never worked for me in a multithreaded program. Could you please give it another look. Walter fixed it relatively recently. Hmm, I will check it

Re: Export GC Usage Statistics on Request for Profiling

2016-07-15 Thread tcak via Digitalmars-d
On Friday, 15 July 2016 at 19:22:41 UTC, Jacob Carlborg wrote: On 2016-07-15 18:14, tcak wrote: It is great to see memory usage on Xcode while running an iOS app. Have you tried to run a D application inside Xcode to get the same information? Or is it not available due to the GC? Never

Re: Export GC Usage Statistics on Request for Profiling

2016-07-15 Thread tcak via Digitalmars-d
On Friday, 15 July 2016 at 16:21:15 UTC, Jack Stouffer wrote: On Friday, 15 July 2016 at 16:14:39 UTC, tcak wrote: It is great to see memory usage on Xcode while running an iOS app. What I thought is that: 1. GC knows available heap memory locations and their length. 2. GC can detect what

Export GC Usage Statistics on Request for Profiling

2016-07-15 Thread tcak via Digitalmars-d
It is great to see memory usage on Xcode while running an iOS app. What I thought is that: 1. GC knows available heap memory locations and their length. 2. GC can detect what parts of heap is in use. 3. A program can create a file to write (stdout, stderr, etc.) So, when desired (e.g. use of

Re: Using electron for IDE development

2016-07-05 Thread tcak via Digitalmars-d
On Monday, 4 July 2016 at 19:42:33 UTC, Ola Fosheim Grøstad wrote: On Monday, 4 July 2016 at 19:30:37 UTC, Dmitry wrote: On Monday, 4 July 2016 at 18:55:57 UTC, Gerald wrote: Visual Studio Code is based on electron and works very well for me with D when using the code-d plugin for it: Yes, it

Using electron for IDE development

2016-07-04 Thread tcak via Digitalmars-d
As far as I known, and FEEL, one of the biggest problems of IDE development is cross platform user interface development. I haven't started using, but Electron seems like a good tool to develop applications by using HTML, JS, CSS. Because it is based on node.js, it can run on many platforms.

Re: Program locked at joinAll and sched_yield

2016-07-03 Thread tcak via Digitalmars-d-learn
On Sunday, 3 July 2016 at 17:19:04 UTC, Lodovico Giaretta wrote: On Friday, 1 July 2016 at 12:02:11 UTC, tcak wrote: I have my own Http Server. Every request is handled by a thread, and threads are reused. I send 35,000 request (7 different terminals are sending 5000 requests each) to the

Re: shared Mutex?

2016-06-09 Thread tcak via Digitalmars-d-learn
On Thursday, 9 June 2016 at 18:31:16 UTC, cy wrote: I was thinking of using threads in a D program (ignores unearthly wailing) and I need 1 thread for each unique string resource (database connection info). So I did this: shared BackgroundDB[string] back; I don't see any way to make less

Re: Shared, but synchronisation is not desired for multithreading

2016-06-04 Thread tcak via Digitalmars-d
On Saturday, 4 June 2016 at 15:51:22 UTC, Alex Parrill wrote: (It also doesn't help that many "thread-safe" functions in D aren't marked as shared where they really ought to be, ex. all the functions in core.sync.mutex) And you have to be continuously casting the methods of Mutex, Thread,

Shared, but synchronisation is not desired for multithreading

2016-06-04 Thread tcak via Digitalmars-d
If you ignore the discouraged __gshared keyword, to be able to share a variable between threads, you need to be using "shared" keyword. While designing your class with "shared" methods, the compiler directly assumes that objects of this class must be protected against threading problems.

Base64 of String without casting

2016-06-01 Thread tcak via Digitalmars-d-learn
I understand that Base64 uses Ranges, and since String is seen and used as unicode by Ranges (please tell me if I am wrong). I am guessing, for this reason, auto btoa = std.base64.Base64.encode("Blah"); doesn't work. You need to be casting the string to ubyte[] to make it work which doesn't

Re: Is there a 128-bit integer in D?

2016-05-22 Thread tcak via Digitalmars-d-learn
On Saturday, 21 May 2016 at 09:56:51 UTC, Stefan Koch wrote: On Saturday, 21 May 2016 at 09:43:38 UTC, Saurabh Das wrote: I see that 'cent' and 'ucent' are reserved for future use but not yet implemented. Does anyone have a working implementation of these types? Alternatively, is there an

Why are tests restarting in Github?

2016-04-24 Thread tcak via Digitalmars-d
There are 10 test. Some of them gets completed. And then, I look at it again, tests have restarted, and less number of tests are passed at that point. 1. What is the reason of restarts? 2. What is reason of long waiting time? Sometimes number of passed tests stay there 2-3 days.

Re: Compiling with -profile=gc makes program crash - why?

2016-04-21 Thread tcak via Digitalmars-d
On Wednesday, 20 April 2016 at 22:31:31 UTC, Ivan Kazmenko wrote: On Wednesday, 20 April 2016 at 22:27:36 UTC, Ivan Kazmenko wrote: I'm trying to use DMD option "-profile=gc". With this option, the following simple program crashes with 2.071.0 down to 2.069.0 but still works on 2.068.2. The

Re: [PRs] How to update on Github

2016-04-19 Thread tcak via Digitalmars-d
On Thursday, 21 May 2015 at 10:39:46 UTC, ZombineDev wrote: Basically you need clone your fork to your computer, add a "upstream" remote to github.com/D-Programming-Language/[repo name, eg. phobos], pull from upstream the new changes and optionally update github by pushing to origin (origin

Re: multithreading profiling

2016-04-18 Thread tcak via Digitalmars-d-learn
On Monday, 18 April 2016 at 13:33:20 UTC, jj75607 wrote: Hello! Is it possible to start profiling on multithreaded app with Dmd? https://issues.dlang.org/show_bug.cgi?id=14511 is open. I am doing wrong or why this program segfaults if compiled with profiler hooks? import core.atomic;

Re: Sample Rate

2016-04-10 Thread tcak via Digitalmars-d
On Saturday, 9 April 2016 at 14:15:38 UTC, Nordlöw wrote: Has anybody more than I thought about representing the sample rate of a sampled signal collected from sources such as microphones and digital radio receivers? With it we could automatically relate DFT/FFT bins to real frequencies and

Re: Fiber and Thread Communication

2016-04-08 Thread tcak via Digitalmars-d-learn
On Friday, 8 April 2016 at 15:33:46 UTC, Dicebot wrote: On Friday, 8 April 2016 at 14:08:39 UTC, Nordlöw wrote: So a TId can represent either a thread or a fiber? AFAIR, yes (I haven't used std.concurrency in a long while, telling all from memory only). yes what? Thread or Fiber. ---

Segmentation Fault on rt.tlsgc.init

2016-04-05 Thread tcak via Digitalmars-d-learn
If I create many threads (starts, does a short work, and ends) repeatedly (>10,000), at some point rt.tlsgc.init() gives SEGMENTATION_FAULT. It doesn't check whether malloc fails to allocate any memory, and I cannot find the source code of "rt.sections.initTLSRanges()" anywhere. Is it left

Re: Convert wchar* to wstring?

2016-04-04 Thread tcak via Digitalmars-d-learn
On Tuesday, 5 April 2016 at 01:21:55 UTC, Thalamus wrote: I'm sorry for this total newbie question, but for some reason this is eluding me. I must be overlooking something obvious, but I haven't been able to figure this out and haven't found anything helpful. I am invoking an entry point in

Re: Catching thread creation error

2016-04-04 Thread tcak via Digitalmars-d-learn
On Monday, 4 April 2016 at 20:28:13 UTC, tcak wrote: In my server program, when a request comes, I create a new thread for that. I put memory limit to program with setrlimit. So, when the limit is reached, new thread cannot be created. I want to tell client back that there is system

Catching thread creation error

2016-04-04 Thread tcak via Digitalmars-d-learn
In my server program, when a request comes, I create a new thread for that. I put memory limit to program with setrlimit. So, when the limit is reached, new thread cannot be created. I want to tell client back that there is system problem. But catching "Throwable" does not suffice for this

How big memory is allocated by GC?

2016-04-03 Thread tcak via Digitalmars-d-learn
Is there any way to know how big memory has been allocated by GC currently (or in the last scan)? I want to limit the total memory usage of program manually. So, while I am allocating some space (in server program), if the desired memory will exceed the limit, I will fail the operation

Minimise and collect by GC when OutOfMemory

2016-02-25 Thread tcak via Digitalmars-d-learn
Would it be a good idea to call "collect" and "minimize" methods of core.memory.GC when OutOfMemory error is received FOR A LONG RUNNING PROGRAM? or there won't be any benefit of that? Example program: A web server that allocates and releases memory from heap continuously.

What happens if memory allocation fails?

2016-02-20 Thread tcak via Digitalmars-d-learn
This is not easy to try. So I need ask, maybe someone has experienced. What happens if memory allocation fails with "new" keyword? Does it throw an exception? throwable? All I want is to be able to catch OutOfMemory event, and take other steps based on that.

Re: Get memory usage report from GC

2016-02-19 Thread tcak via Digitalmars-d-learn
On Saturday, 20 February 2016 at 05:55:26 UTC, Jon D wrote: On Saturday, 20 February 2016 at 05:34:01 UTC, tcak wrote: On Saturday, 20 February 2016 at 05:33:00 UTC, tcak wrote: Is there any way (I checked core.memory already) to collect report about memory usage from garbage collector? So, I

Get memory usage report from GC

2016-02-19 Thread tcak via Digitalmars-d-learn
Is there any way (I checked core.memory already) to collect report about memory usage from garbage collector? So, I can see a list of pointer and length information. Since getting this information would require another memory area in heap, it could be like logging when report is asked. My

Re: What is the best way to stop App after exception?

2016-02-15 Thread tcak via Digitalmars-d-learn
On Monday, 15 February 2016 at 11:38:05 UTC, Suliman wrote: I have got class Config with method parseconfig. I need terminate App if parsing of config was failed. The problem that I do not know how to do it better. void parseconfig() { try { //something go wrong } catch(Exception e) {

Encode string as json string

2016-02-15 Thread tcak via Digitalmars-d
Other than generating normal JSON content (stringify), JSON string is used for Javascript string expressions as well. To create a properly encoded Javascript string, the shortest way is JSONValue("this'\\is//the\"text").toString(); Yes, it works, but it is uncomfortable to write the code as

Re: Singleton, alias to self?

2016-02-14 Thread tcak via Digitalmars-d-learn
On Sunday, 14 February 2016 at 12:56:51 UTC, Vladde Nordholm wrote: I'm not sure of how to use alias efficiently, so I want to know if I could somehow do this (psuedo-code) class Singleton { //So instead of calling `Singleton.getSingleton()` you just call `Singleton` alias this =

Index file for ddoc

2016-02-13 Thread tcak via Digitalmars-d-learn
Maybe I am missing, but I do not see any index file when html files are generated by ddoc. Is there any way to generate index file automatically, so, a tree like links will be listed all created documentation files? If the problem is about the possibility of having index.d and it would be

Re: wrapSocket for socket_t? As wrapFile for FILE*

2016-02-13 Thread tcak via Digitalmars-d-learn
On Sunday, 14 February 2016 at 04:13:12 UTC, Beginner-8 wrote: Hi! Anyone seen Socket constructor which uses already available socket of socket_t type? I am need to use already connected socket imported from C library without closing them after using. One of the constructors of class

Re: std.socket question

2016-02-04 Thread tcak via Digitalmars-d-learn
On Thursday, 4 February 2016 at 06:40:15 UTC, sanjayss wrote: Are the functions lastSocketError() and wouldHaveBlocked() from std.socket thread-safe? i.e. can they be reliably used to see the status of the last socket call when sockets are being read/written in multiple threads? Not directly

Re: What reasons are known a thread stops suddenly?

2016-02-04 Thread tcak via Digitalmars-d-learn
On Friday, 5 February 2016 at 06:23:09 UTC, Daniel Kozak wrote: V Fri, 05 Feb 2016 03:47:40 + tcak via Digitalmars-d-learn <digitalmars-d-learn@puremagic.com> napsáno: [...] Did you try catch Throwable instead of Exception? Undid the fix, and wrapped the problem causing functio

Re: What reasons are known a thread stops suddenly?

2016-02-04 Thread tcak via Digitalmars-d-learn
On Thursday, 4 February 2016 at 22:27:31 UTC, Ali Çehreli wrote: On 02/04/2016 12:25 PM, tcak wrote: > void threadFunc(){ > scope(exit){ > writeln("Leaving 2: ", stopRequested); > } > > > while( !stopRequested ){ > /* THERE IS NO "RETURN" HERE AT ALL */ > } > >

Re: What reasons are known a thread stops suddenly?

2016-02-04 Thread tcak via Digitalmars-d-learn
On Friday, 5 February 2016 at 03:47:40 UTC, tcak wrote: On Thursday, 4 February 2016 at 22:27:31 UTC, Ali Çehreli wrote: On 02/04/2016 12:25 PM, tcak wrote: > [...] That would happen when there is an exception. > [...] If a thread is terminated with an exception, its stack is unwound and

What reasons are known a thread stops suddenly?

2016-02-04 Thread tcak via Digitalmars-d-learn
I have implemented a standalone HTTP server. So everything is in single executable. Requests come, for responding a new thread is started, etc. To listen new socket connections, and socket events, a single thread is used (Call this event listener thread). Everything works perfectly. Firefox

Defining event handlers for function, method, or shared method

2016-01-26 Thread tcak via Digitalmars-d-learn
In many multi threading module designs of mine, I generally design a base class, and this class have some events. Exempli gratia: void eventOnStart(); void eventOnStop(); void eventOnItemAdded( size_t itemIndex ); There is this problem though. I need/want this class to be able to bind a

Re: Defining event handlers for function, method, or shared method

2016-01-26 Thread tcak via Digitalmars-d-learn
On Tuesday, 26 January 2016 at 19:42:42 UTC, tcak wrote: On Tuesday, 26 January 2016 at 19:22:58 UTC, Ali Çehreli wrote: [...] Hmm. Your example works fine for functions, but I can't pass a method instead of function as alias. Check my example: [...] Edit: ... "I guess because it is

Re: Defining event handlers for function, method, or shared method

2016-01-26 Thread tcak via Digitalmars-d-learn
On Tuesday, 26 January 2016 at 19:22:58 UTC, Ali Çehreli wrote: On 01/26/2016 10:41 AM, tcak wrote: > I need/want this class to be able to bind > a function, a method, or a shared method. From the perspective of class > design, there shouldn't be any > difference. Its purpose is to let know

Re: Vision 2016 H1

2016-01-24 Thread tcak via Digitalmars-d
On Monday, 25 January 2016 at 03:14:47 UTC, Andrei Alexandrescu wrote: In case you missed it from the announce forum: http://wiki.dlang.org/Vision/2016H1 -- Andrei Is there a list or a proper place to put the list of desired/asked/necessary tools together with their purpose?

core.thread.Thread.start is marked as "nothrow" but documentation says it throws

2016-01-23 Thread tcak via Digitalmars-d-learn
https://dlang.org/phobos/core_thread.html#.Thread final nothrow Thread.start() Looking at the code, no "throw new ..." is seen, but the function "onThreadError" is called which has "throw" in it. Most weird thing is that "onThreadError" function is marked as "nothrow" but it still throws.

Re: DIP 88: Simple form of named parameters

2016-01-23 Thread tcak via Digitalmars-d
On Saturday, 23 January 2016 at 14:19:03 UTC, Jacob Carlborg wrote: This is mostly to prevent ugly hacks like Flag [1]. http://wiki.dlang.org/DIP88 [1] https://dlang.org/phobos/std_typecons.html#.Flag Without making things any complex, the simplest thought of mine is: Keep everything

Re: Define "createXXX" functions for the constructors of class XXX

2016-01-23 Thread tcak via Digitalmars-d-learn
On Saturday, 23 January 2016 at 19:42:29 UTC, Johan Engelen wrote: Hi all, While trying to interface C++ and D, I have to new a few D objects in C++ code. I am doing this using a D function: "XXX createXXX(...) { return new XXX(...); }". I am sure there must be some great way to

Re: forum.dlang.org is now available via HTTPS

2016-01-21 Thread tcak via Digitalmars-d
On Thursday, 21 January 2016 at 12:41:21 UTC, Era Scarecrow wrote: On Thursday, 21 January 2016 at 12:08:23 UTC, Sebastiaan Koppe wrote: On Wednesday, 20 January 2016 at 18:36:12 UTC, Vladimir Panteleev wrote: It took a while but I finally got around to adapting a Let's Encrypt ACME client to

Re: Distributed Memory implementation

2016-01-20 Thread tcak via Digitalmars-d
On Wednesday, 20 January 2016 at 07:58:20 UTC, Marco Leise wrote: Am Mon, 18 Jan 2016 05:59:15 + schrieb tcak <1ltkrs+3wyh1ow7kz...@sharklasers.com>: I, due to a need, will start implementation of distributed memory system. Idea is that: Let's say you have allocated 1 GiB space in

Re: Distributed Memory implementation

2016-01-19 Thread tcak via Digitalmars-d
On Tuesday, 19 January 2016 at 10:09:01 UTC, Ola Fosheim Grøstad wrote: On Monday, 18 January 2016 at 05:59:15 UTC, tcak wrote: Is there anything like this in Phobos, or shall I start my own implementation? It isn't really clear to me what you are trying to do. IIRC the C++ deque is usually

Re: Distributed Memory implementation

2016-01-18 Thread tcak via Digitalmars-d
On Monday, 18 January 2016 at 08:12:03 UTC, Nemanja Boric wrote: On Monday, 18 January 2016 at 05:59:15 UTC, tcak wrote: [...] Check https://dlang.org/phobos/std_experimental_allocator.html Which part of this module provide the functionality of using non-consecutive memory(distributed)

Re: [dlang.org] new forum design

2016-01-18 Thread tcak via Digitalmars-d
New design is good, though it uses "Roboto Slab" according to Firefox Web tools. But due to lack of this font (does the web site use Google Fonts?), I see everything in Sans Serif. As far as I see, no other font name is provided in CSS as well.

Re: Distributed Memory implementation

2016-01-18 Thread tcak via Digitalmars-d
On Monday, 18 January 2016 at 09:56:17 UTC, Adrian Matoga wrote: On Monday, 18 January 2016 at 05:59:15 UTC, tcak wrote: I, due to a need, will start implementation of distributed memory system. Idea is that: Let's say you have allocated 1 GiB space in memory. This memory is blocked into 4

Distributed Memory implementation

2016-01-17 Thread tcak via Digitalmars-d
I, due to a need, will start implementation of distributed memory system. Idea is that: Let's say you have allocated 1 GiB space in memory. This memory is blocked into 4 KiB. After some reservation, and free operations, now only the blocks 0, 12, and 13 are free to be allocated. Problem

Re: Changing Name of a thread

2016-01-09 Thread tcak via Digitalmars-d-learn
On Saturday, 9 January 2016 at 11:02:53 UTC, Keywan Ghadami wrote: Hello, i am trying to the set the name of thread with: import core.thread; auto thisThread = Thread.getThis(); thisThread.name = "kiwi"; but GDB prints the name of the programm ("helloworld") [Thread debugging

Re: Linking a DLL to a DLL with packages

2016-01-09 Thread tcak via Digitalmars-d-learn
On Friday, 8 January 2016 at 12:13:15 UTC, Benjamin Thaut wrote: On Thursday, 7 January 2016 at 19:29:43 UTC, Thalamus wrote: Hi everyone, First off, I've been working with D for a couple of weeks now and I think it's the bee's knees! :) Except for DLLs. thanks! :) Dlls don't currently

Re: Calling functions from other files/modules

2016-01-06 Thread tcak via Digitalmars-d-learn
On Wednesday, 6 January 2016 at 23:12:27 UTC, Namal wrote: On Wednesday, 6 January 2016 at 23:06:38 UTC, Adam D. Ruppe wrote: On Wednesday, 6 January 2016 at 23:00:43 UTC, Namal wrote: I just tried to import one module with a main into another, but I get this: You can't have two mains, but

Verbal Expressions can be a good addition to Phobos for strings

2016-01-05 Thread tcak via Digitalmars-d
It does not have to same, but it is so readable and clear to understand by anybody. https://twitter.com/andreysitnik/status/683258432493907968 https://github.com/VerbalExpressions/JSVerbalExpressions As far as I understand, from the call of functions, the library generates the regular

Re: Strange 'memset' error when using std.range.repeat and std.array.array

2016-01-04 Thread tcak via Digitalmars-d-learn
On Monday, 4 January 2016 at 10:50:17 UTC, Ur@nuz wrote: Sorry, the actual code is: ... lines ~= ' '.repeat.take(newIndentCount).array; ...with character quotes. But it still fails with error described in stack trace in Gcx.bigAlloc() What's your OS? On Linux x64, it works without any

Re: Proposal: Database Engine for D

2015-12-31 Thread tcak via Digitalmars-d
On Thursday, 31 December 2015 at 17:14:55 UTC, Piotrek wrote: The goal of this post is to measure the craziness of an idea to embed a database engine into the D language ;) I think about a database engine which would meet my three main requirements: - integrated with D (ranges) - ACID

Re: Bug? or do I something wrong

2015-12-30 Thread tcak via Digitalmars-d
On Wednesday, 30 December 2015 at 14:07:54 UTC, Daniel Kozak wrote: import std.stdio; void main() { auto x = 9223372036854775807L; auto x2 = 9223372036854775807L + 1; long x3 = -9223372036854775808U; //auto x4 = -9223372036854775808L; //Error: signed integer overflow

Re: Is there a FIX engine written in D?

2015-12-27 Thread tcak via Digitalmars-d
On Sunday, 27 December 2015 at 09:27:18 UTC, Kokyo wrote: Hi there, I've just read a thread about low latency programming using D. As a Java user, I'm developing low latency applications in the financial area. In Java, there are some comprehensive FIX engines like QuickFix/J or lightweight

Re: How to use GDC to get .a file on Linux?

2015-12-27 Thread tcak via Digitalmars-d-learn
On Sunday, 27 December 2015 at 15:19:21 UTC, FrankLike wrote: Hi, Now I need get the .a file on Linux,target system is ARM. If you use gcc ,you will use the 'ar' to get .a file, but how to do by GDC ? And how to get the execute file by .a file and .d file? Thank you. I couldn't have

Re: basic interactive readf from stdin

2015-12-26 Thread tcak via Digitalmars-d-learn
On Saturday, 26 December 2015 at 20:19:08 UTC, Adam D. Ruppe wrote: On Saturday, 26 December 2015 at 20:11:27 UTC, karthikeyan wrote: I experience the same as the OP on Linux Mint 15 with dmd2.069 and 64 bit machine. I have to press enter twice to get the output. I read

Re: dmd without gcc depency

2015-12-25 Thread tcak via Digitalmars-d
On Friday, 25 December 2015 at 12:57:50 UTC, Jardik wrote: Now that dmd is written in D language, is it possible to use dmd without the need to have gcc and its libraries installed? Or would it be possible, if I didn't need to call any extern C++ functions? If not, is it planned for dmd to be

Re: [Feature Request] Single name access when module name and content are same

2015-12-25 Thread tcak via Digitalmars-d
On Friday, 25 December 2015 at 15:45:16 UTC, tcak wrote: I only want to discuss an idea here. I am hoping see some nice pros and cons from people. [...] My mistake at the end. It should be: my.big.lib.createFile("FSociety.dat");

[Feature Request] Single name access when module name and content are same

2015-12-25 Thread tcak via Digitalmars-d
I only want to discuss an idea here. I am hoping see some nice pros and cons from people. --- We have this feature in D: template something(T){ void something(T value){ writeln( value ); } } something("Hello"); Because the name of template and function match each other, "something" is

Re: [Feature Request] Single name access when module name and content are same

2015-12-25 Thread tcak via Digitalmars-d
On Friday, 25 December 2015 at 15:45:16 UTC, tcak wrote: I only want to discuss an idea here. I am hoping see some nice pros and cons from people. --- We have this feature in D: template something(T){ void something(T value){ writeln( value ); } } something("Hello"); Because the name

Re: [Feature Request] Single name access when module name and content are same

2015-12-25 Thread tcak via Digitalmars-d
On Friday, 25 December 2015 at 17:08:04 UTC, default0 wrote: On Friday, 25 December 2015 at 15:46:23 UTC, tcak wrote: On Friday, 25 December 2015 at 15:45:16 UTC, tcak wrote: I only want to discuss an idea here. I am hoping see some nice pros and cons from people. [...] My mistake at the

Convert to string an enum item

2015-12-23 Thread tcak via Digitalmars-d-learn
[code] import std.stdio; import std.conv; enum Values: ubyte{ One = 1, Two = 2 } void main(){ writeln( std.conv.to!string( Values.One ) ); } [/code] Output is "One". casting works, but to be able to cast correctly, I need to tell compiler that it is "ubyte". Isn't there any

Re: Socket - handling large numbers of incoming connections

2015-12-21 Thread tcak via Digitalmars-d-learn
On Monday, 21 December 2015 at 20:53:14 UTC, Jakob Jenkov wrote: On Monday, 21 December 2015 at 20:20:44 UTC, Stefan wrote: How about https://github.com/dcarp/asynchronous ? Asyncio Socket handling is sometimes quite nice. It's performance is okay for nearly no effort and the code looks clean.

Re: Template specialization using traits?

2015-12-21 Thread tcak via Digitalmars-d-learn
On Monday, 21 December 2015 at 11:12:10 UTC, Jonathan M Davis wrote: On Monday, 21 December 2015 at 11:07:16 UTC, Jonathan M Davis wrote: For your example to work with template constraints, the most straightforward solution would be void func(T)(T t) if(!isIntegral!T) { writeln(1); }

Re: Can't debug my solution

2015-12-19 Thread tcak via Digitalmars-d-learn
On Saturday, 19 December 2015 at 20:52:41 UTC, Matheus Reis wrote: Hello, people! I'm Matheus, a 20 y/o game developer who wants to get started with D. It has really caught my attention, and I've been playing with it for some hours now. I've got it all working (without some "phobos.lib", is

Re: We need a good code font for the function signatures on dlang.org

2015-12-17 Thread tcak via Digitalmars-d
On Thursday, 17 December 2015 at 16:01:01 UTC, Wyatt wrote: On Wednesday, 16 December 2015 at 21:05:27 UTC, Andrei Alexandrescu wrote: I was looking at https://github.com/D-Programming-Language/dlang.org/pull/1169 and that bold sans serif proportional text for the code is just... well let's

Re: Another cool project: make double.to!string CTFEable

2015-12-16 Thread tcak via Digitalmars-d
On Wednesday, 16 December 2015 at 15:44:45 UTC, Andrei Alexandrescu wrote: This has been discussed in the past and at a point Walter was looking into it. Currently std.conv.to applied to double uses snprintf, which is obviously non-CTFEable. There's been recent work (also discussed here) on

Re: We need better documentation for functions with ranges and templates

2015-12-16 Thread tcak via Digitalmars-d
On Wednesday, 16 December 2015 at 18:25:31 UTC, Luís Marques wrote: On Monday, 14 December 2015 at 19:04:46 UTC, bachmeier wrote: Something has to be done with the documentation for Phobos functions that involve ranges and templates. Just today: - "Where's the documentation for makeIndex?"

  1   2   3   4   >