Re: Wich: opIndex overloading by return type

2020-04-19 Thread unDEFER via Digitalmars-d-learn
It is easy. You can make both types as children of common parent class myT, and when return myT.

Re: How to build dmd properly?

2018-12-18 Thread unDEFER via Digitalmars-d-learn
On Tuesday, 18 December 2018 at 16:19:33 UTC, unDEFER wrote: Yes, thank you for the hint. You are almost right. I did not ENABLE_DEBUG=1, but I also did not ENABLE_RELEASE=1 So it is the bug. I will report about it. https://issues.dlang.org/show_bug.cgi?id=19500

Re: How to build dmd properly?

2018-12-18 Thread unDEFER via Digitalmars-d-learn
On Tuesday, 18 December 2018 at 15:54:28 UTC, Seb wrote: On Tuesday, 18 December 2018 at 14:35:46 UTC, unDEFER wrote: What I could build wrong and how to build dmd properly? Maybe you built dmd.d with debug assertions? (ENABLE_DEBUG=1) You can build dmd with the `./build.d` script or `make

How to build dmd properly?

2018-12-18 Thread unDEFER via Digitalmars-d-learn
Hello, I have the next code (minimized with DustMite): struct Tup(T...) { bool opEquals() { foreach (i; T) static if (__traits(compiles, mixin("new InputRangeObject11261!(abs_class)"))) msg; } } /**/ void test3() {

Re: Anonymous mapped regions increases unlimitely on spawn

2018-12-14 Thread unDEFER via Digitalmars-d-learn
So it looks like a bug, and I have reported about it: https://issues.dlang.org/show_bug.cgi?id=19487

Re: Anonymous mapped regions increases unlimitely on spawn

2018-12-14 Thread unDEFER via Digitalmars-d-learn
So more digging.. dtor of Thread calls in GC.collect() if thread is finished. But it's do nothing because bool not_registered = !next && !prev && (sm_tbeg !is this); is always true... So how to register the thread?

Re: Anonymous mapped regions increases unlimitely on spawn

2018-12-14 Thread unDEFER via Digitalmars-d-learn
So in digging by this problem, I have made simple patch to druntime. I have added in druntime/src/core/thread.d to final Thread start() nothrow of class Thread import core.stdc.stdio; printf("start Thread\n"); And to ~this() nothrow @nogc import core.stdc.stdio;

Anonymous mapped regions increases unlimitely on spawn

2018-12-14 Thread unDEFER via Digitalmars-d-learn
Hello! I have the program which uses BDB and while testing often makes spawn. And after 12 hours of testing bdb said: mmap: Cannot allocate memory But the problem that I've found that it is not BDB created too many maps. Watching for /proc/[PID]/maps shows that number of anonymous mapped

Dizzy Omega 0.37

2018-12-01 Thread unDEFER via Digitalmars-d-announce
Hello, everyone! I have done the second demo version of my game fully written in D. Dizzy is a puzzle game, Purpose of which is the collection and use of items. Dizzy Omega (Dizzy on Mars) is the sequel of the game Dizzy Y (which was for ZX-Spectrum). The game has 3D graphic, but 2D logic.

Re: How to debug FinalizeError?

2018-11-29 Thread unDEFER via Digitalmars-d-learn
On Thursday, 29 November 2018 at 14:51:40 UTC, Steven Schveighoffer wrote: You need to compile druntime in debug mode. One thing you can do is implement the function locally, and then break on it (it's a C linkage, so I think the linker will grab your copy instead of the one in druntime)

Re: How to debug FinalizeError?

2018-11-28 Thread unDEFER via Digitalmars-d-learn
No I'm not preallocating any exceptions. It was idea, but I removed all calls which can make throw. I'm using very old dmd 2.074.1, so as I have patched it for my text editor with IDE functions. I had a year break in development, so now I need to rewrite all my patches. But exactly the output

Re: derelict-sdl2 automatically stripping the SDL_ prefix from names

2018-11-28 Thread unDEFER via Digitalmars-d-learn
Hello, as I know allMembers returns members not recursively. If you want to get really all members you need to make recursive function. In my program I used the next routine to print all members of module: static void allMembersOfModule(string module_name, bool root=false)() { static if

How to debug FinalizeError?

2018-11-28 Thread unDEFER via Digitalmars-d-learn
Hello! After long-long time of debugging, I just have decided InvalidMemoryOperationError in my program. But now my program after few hours of testing again crashes with "Finalization error". What this error means exactly? I again did something wrong in destructor? And how to debug it? I

Re: Usage of memory by arrays

2018-04-05 Thread unDEFER via Digitalmars-d
So, I completely found all answers. In my game of 260 Mb: 100 Mb consumes GC, 100 Mb consumes scene in glNewList. And 30 Mb textures in glTexImage2D. Very well, now I know what to do and how to get it smaller. Big thanks to all.

Re: Usage of memory by arrays

2018-04-05 Thread unDEFER via Digitalmars-d
On Thursday, 5 April 2018 at 22:23:12 UTC, Steven Schveighoffer wrote: 1. Compare to C malloc-ing 1.2MB at once (GC uses C malloc underneath) Yes after initialize malloc'ed 1.2Mb in C it consumes 1.6 Mb. 4.8 Mb => 4.9 Mb 2. Have you examined smaller numbers for total? Does it scale

Re: Usage of memory by arrays

2018-04-05 Thread unDEFER via Digitalmars-d
On Thursday, 5 April 2018 at 22:06:10 UTC, Jonathan M Davis wrote: You could also look at how x.capacity compares to x.length as well as core.memory.GC.stats() to see what the GC thinks that it's using. On my system, the x.capacity was only 9 greater than x.length, and GC.stats printed as

Re: Usage of memory by arrays

2018-04-05 Thread unDEFER via Digitalmars-d
OK, without reallocation: 8< void main() { float[3] f; float[3][] x; writefln("float = %s bytes", float.sizeof); writefln("float[3] = %s bytes", f.sizeof); int before = MemoryUsage(); int total = 100; x = new

Re: Usage of memory by arrays

2018-04-05 Thread unDEFER via Digitalmars-d
On Thursday, 5 April 2018 at 21:11:53 UTC, Steven Schveighoffer wrote: But the old block doesn't go away! It's collected and stored in a free list for future allocations. -Steve Big thanks, -Steve! Really program like the next: ==8<== void main() { float[3] f;

Usage of memory by arrays

2018-04-05 Thread unDEFER via Digitalmars-d
Hello! Here very simple test program: --->8 import std.conv; import std.stdio; import std.string; int MemoryUsage() { auto file = File("/proc/self/status"); foreach (line; file.byLine()) { if (line[0..6] == "VmRSS:") {

Re: Dizzy Omega 0.17

2018-04-05 Thread unDEFER via Digitalmars-d-announce
On Thursday, 5 April 2018 at 14:33:16 UTC, ashit axar wrote: do i need to install derelict ? im using windows7 No, You don't need derelict (it is needed only at compile time and dub downloads it automatically).. Which video card you have? Maybe you tried run any other OpenGL games?

Dizzy Omega 0.17

2018-04-04 Thread unDEFER via Digitalmars-d-announce
I have done the first demo version of my game fully written in D. Dizzy is a puzzle game, Purpose of which is the collection and use of items. Dizzy Omega (Dizzy on Mars) is the sequel of the game Dizzy Y (which was for ZX-Spectrum). The game has 3D graphic, but 2D logic. The first demo has

Re: Hacking the compiler: Get Scope after some line of function

2017-07-27 Thread unDEFER via Digitalmars-d-learn
On Thursday, 27 July 2017 at 11:59:51 UTC, unDEFER wrote: So how to get scope e.g. after line "B b;"? I have found. That in scopes was found symbols from declarations, you must iterate by declarations (DeclarationExp) and add symbols by sc.insert(decexp.declaration);

Hacking the compiler: Get Scope after some line of function

2017-07-27 Thread unDEFER via Digitalmars-d-learn
Hello! I'm trying to do some strange thing: compile some Statement (do semantic3 phase) in the scope of other function. Other function is for example: auto megafunction() { B b; uint a = 25; return b; } AST of this code looks like: FuncDeclaration { fbody = CompoundStatement

Re: How to make autocompletion for IDE?

2017-07-26 Thread unDEFER via Digitalmars-d-learn
On Wednesday, 26 July 2017 at 07:41:20 UTC, Andrea Fontana wrote: Did you try with [1]? [1] http://forum.dlang.org/post/okktlu$2bin$1...@digitalmars.com Thank you, interesting. But I'm afraid it is not enough.

Re: Cast to subclass in the dmd compiler

2017-07-26 Thread unDEFER via Digitalmars-d-learn
On Wednesday, 26 July 2017 at 06:50:21 UTC, Jacob Carlborg wrote: For Expression, there's a field called "op" that indicates what kind of expression it is, which can used in combination with a cast. Thank you for hint!

Re: Cast to subclass in the dmd compiler

2017-07-25 Thread unDEFER via Digitalmars-d-learn
I have found the answer in the code. Right code is: Import imp = m.isImport(); if (imp !is null) Thank you.

Cast to subclass in the dmd compiler

2017-07-25 Thread unDEFER via Digitalmars-d-learn
Hello! I'm hacking dmd compiler and trying to look on members array just after parse module. for(uint i = 0; i < members.dim; i++) { Dsymbol m = (*members)[i]; // It is good, but further: Import imp = cast(Import) m; if (imp !is null) { printf(" import %s.%s\n",

Re: How to make autocompletion for IDE?

2017-07-25 Thread unDEFER via Digitalmars-d-learn
On Tuesday, 25 July 2017 at 10:42:40 UTC, Basile B. wrote: I think that you underestimate the amount of work needed and your solution which is to use the compiler with -o- looks bad. What you really need is a compiler front-end which is basically what libdparse + DSymbol are. DCD uses them.

Re: How to make autocompletion for IDE?

2017-07-25 Thread unDEFER via Digitalmars-d-learn
On Tuesday, 25 July 2017 at 10:35:14 UTC, Andrea Fontana wrote: If you want to add UFCS suggestions to DCD it would be useful for your project and all other IDEs too! Andrea Thank you, I will think. But if it was easy, authors self would do it :-)

Re: How to make autocompletion for IDE?

2017-07-25 Thread unDEFER via Digitalmars-d-learn
On Tuesday, 25 July 2017 at 10:24:13 UTC, Andrea Fontana wrote: On Tuesday, 25 July 2017 at 10:23:33 UTC, Andrea Fontana wrote: On Tuesday, 25 July 2017 at 10:06:47 UTC, unDEFER wrote: Any ideas? I think you should use/contribute to DCD project https://github.com/dlang-community/DCC Andrea

How to make autocompletion for IDE?

2017-07-25 Thread unDEFER via Digitalmars-d-learn
Hello! I have written my text editor with highlighting, and now I want to add IDE features to it. I want to make autocompletion, but not only complete members of class/struct, but also all functions which maybe used with type, if the first argument of the function is this type. I.e. in

Re: regex(q"<[^]>")

2017-07-19 Thread unDEFER via Digitalmars-d
On Wednesday, 19 July 2017 at 16:59:24 UTC, Dmitry Olshansky wrote: On Monday, 17 July 2017 at 17:00:10 UTC, unDEFER wrote: Please file at: issues.dlang.org Thanks! --- Dmitry Olshansky Thank you, https://issues.dlang.org/show_bug.cgi?id=17668 https://issues.dlang.org/show_bug.cgi?id=17667

Re: regex(q"<[^]>")

2017-07-18 Thread unDEFER via Digitalmars-d
On Tuesday, 18 July 2017 at 08:56:12 UTC, Anton Fediushin wrote: Not a bug, but I think that `regex()` should fail with a nice exception, not silently fail. Yes, exception, not assert.

Re: regex(q"<[^]>")

2017-07-17 Thread unDEFER via Digitalmars-d
On Monday, 17 July 2017 at 20:43:29 UTC, unDEFER wrote: Sorry, fixed in the newest DMD also as the other bug in regex... Oh, no. Not fixed. Fixed only other bug.

Re: regex(q"<[^]>")

2017-07-17 Thread unDEFER via Digitalmars-d
Sorry, fixed in the newest DMD also as the other bug in regex...

regex(q"<[^]>")

2017-07-17 Thread unDEFER via Digitalmars-d
Hello! The code in the header leads to assertion! But the user inputed data don't must leads to any assertions!

Re: Too slow readln

2017-07-16 Thread unDEFER via Digitalmars-d-learn
I understand the main problem. dirEntries by default follows symlinks. Without it my first grep works only 28.338s. That really cool!

Re: Too slow readln

2017-07-16 Thread unDEFER via Digitalmars-d-learn
On Sunday, 16 July 2017 at 17:37:34 UTC, Jon Degenhardt wrote: On Sunday, 16 July 2017 at 17:03:27 UTC, unDEFER wrote: [snip] How to write in D grep not slower than GNU grep? GNU grep is pretty fast, it's tough to beat it reading one line at a time. That's because it can play a bit of a

Too slow readln

2017-07-16 Thread unDEFER via Digitalmars-d-learn
Hello, there! I have the next "grep" code: https://dpaste.dzfl.pl/7b7273f96ab2 And I have the directory to run it: $ time /home/undefer/MyFiles/Projects/TEST/D/grep "HELLO" . ./strace.log: [pid 18365] write(1, "HELLO\n", 6HELLO real1m17.096s user0m54.828s sys 0m13.340s The same

Re: Bad file descriptor in File destructor

2017-07-13 Thread unDEFER via Digitalmars-d-learn
Thank you. I will write if will find the reason of description corruption.

Re: Bad file descriptor in File destructor

2017-07-13 Thread unDEFER via Digitalmars-d-learn
Seems I have found. I must do: try{ File file; try { file = File(path); } catch (Exception exp) { return; } //Some actions with file } catch (ErrnoException) { return; }

Re: Bad file descriptor in File destructor

2017-07-13 Thread unDEFER via Digitalmars-d-learn
On Thursday, 13 July 2017 at 08:53:24 UTC, Moritz Maxeiner wrote: Where does that `File` come from? If it's std.stdio.File, that one is a struct with internal reference counting, so it shouldn't crash in the above. Could you provide a minimal working (in this case crashing) example? Yes File

Re: Bad file descriptor in File destructor

2017-07-13 Thread unDEFER via Digitalmars-d-learn
What the God? I was not ready to post... File file; try { file = File(path); } catch (Exception exp) { return; } try { //Some actions with file } catch (ErrnoException) { return; } catch (ErrnoException) is necessary

Bad file descriptor in File destructor

2017-07-13 Thread unDEFER via Digitalmars-d-learn
Hello! I have the code like this: File file; try { file = File(path); } catch (Exception exp) { return; } ... try { }

Re: How to write Good IDE?

2017-02-05 Thread unDEFER via Digitalmars-d
On Sunday, 5 February 2017 at 17:11:02 UTC, MGW wrote: On Sunday, 5 February 2017 at 16:16:42 UTC, unDEFER wrote: On Sunday, 5 February 2017 at 14:37:48 UTC, MGW wrote: Can't load libQtE5Widgets64.so from current directory. Tried $ export LD_LIBRARY_PATH=`pwd`; ./ide5 -i pr1.ini $ export

Re: How to write Good IDE?

2017-02-05 Thread unDEFER via Digitalmars-d
On Sunday, 5 February 2017 at 14:37:48 UTC, MGW wrote: On Sunday, 5 February 2017 at 10:43:38 UTC, unDEFER wrote: $ dmd ide5 qte5 qte5prs asc1251 ini -release -m64 ide5.d(130): Error: undefined identifier 'Highlighter', did you mean variable 'highlighter'? Скорее всего qte5.d взята из

Re: How to write Good IDE?

2017-02-05 Thread unDEFER via Digitalmars-d
On Sunday, 5 February 2017 at 09:20:36 UTC, MGW wrote: // Compile executable ide5 for 64 // Компилируем для 64 разрядного варианта dmd ide5 qte5 qte5prs asc1251 ini -release -m64 $ dmd ide5 qte5 qte5prs asc1251 ini -release -m64 ide5.d(130): Error: undefined identifier 'Highlighter', did you

Re: How to write Good IDE?

2017-02-04 Thread unDEFER via Digitalmars-d
On Friday, 3 February 2017 at 19:17:54 UTC, MGW wrote: On Wednesday, 1 February 2017 at 15:12:42 UTC, unDEFER wrote: And what important for you for Good IDE? Simple IDE. It is possible that that is useful from this what is. I permanently use it as it is very quickly.

Re: unDE 0.2.0 - unusual command line and keybar

2017-02-03 Thread unDEFER via Digitalmars-d-announce
On Friday, 3 February 2017 at 17:11:26 UTC, Chris Wright wrote: I think `mkdirRecurse` doesn't complain about directories that already exist. Thank you!

Re: unDE 0.2.0 - unusual command line and keybar

2017-02-03 Thread unDEFER via Digitalmars-d-announce
On Friday, 3 February 2017 at 14:18:05 UTC, Basile B. wrote: Also before that there's two FileException thrown because you use mkdir() systematically with a silent try catch. You should rather test if the the directories exist (when you create ~/.unde/ and ~/.unde/bdb/, global_state.d)

Re: unDE 0.2.0 - unusual command line and keybar

2017-02-03 Thread unDEFER via Digitalmars-d-announce
On Friday, 3 February 2017 at 14:05:58 UTC, Basile B. wrote: What is the name of the static lib we have to install for for "DB" ? /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: ne peut trouver -ldb collect2: error: ld returned 1 exit status Error: linker exited

Re: How to write Good IDE?

2017-02-03 Thread unDEFER via Digitalmars-d
On Friday, 3 February 2017 at 12:37:53 UTC, Jacob Carlborg wrote: The old Eclipse plugin for D1, Descent [1], is the gold standard when it comes to IDE's for D. Check the features list [2] to get some ideas and inspiration. [1] http://www.dsource.org/projects/descent [2]

Re: How to write Good IDE?

2017-02-02 Thread unDEFER via Digitalmars-d
On Friday, 3 February 2017 at 01:31:03 UTC, Chris Wright wrote: It's awkward to use dmdfe as a library, mainly because it's not vetted to work with the GC. You *can* disable the GC, invoke dmdfe, copy out the data you need, and then enable the GC. Thank you Chris, really I don't want use dmd

Re: How to write Good IDE?

2017-02-02 Thread unDEFER via Digitalmars-d
On Thursday, 2 February 2017 at 15:04:10 UTC, Jack Stouffer wrote: Speed. Yes, speed it will one of the main characteristic of my IDE.

How to write Good IDE?

2017-02-01 Thread unDEFER via Digitalmars-d
Hello! So my unDE 0.2.0 is released (http://forum.dlang.org/thread/yzfthfipouzhejfsk...@forum.dlang.org), and this means that the time to write unDE 0.3.0 - text editor and IDE. And I grab my head when thinking how much I want to implement. 1) It must shows unused modules 2) It must shows

Re: unDE 0.2.0 - unusual command line and keybar

2017-01-30 Thread unDEFER via Digitalmars-d-announce
On Monday, 30 January 2017 at 11:20:40 UTC, FreeSlave wrote: Can't load /home/freeslave/git_projects/unde/images/clear_errors.png: Invalid renderer Yes, it is very strange message, I still didn't find how to clean it out...

Re: unDE 0.2.0 - unusual command line and keybar

2017-01-29 Thread unDEFER via Digitalmars-d-announce
On Sunday, 29 January 2017 at 23:57:30 UTC, FreeSlave wrote: On Sunday, 29 January 2017 at 19:00:30 UTC, unDEFER wrote: Very interesting concept (Probably it's not new, but I never actually used file managers like this). It looks you put much love and effort in it. Damn, you even made

unDE 0.2.0 - unusual command line and keybar

2017-01-29 Thread unDEFER via Digitalmars-d-announce
unDE's not DE which in the future must be replacement for all programs in OS. But today is very original file manager, image and text viewer and (what discovered with 0.2.0 version) command line and keybar. More information: http://unde.sourceforge.net/en/ch25.html Video with English subtitles:

Re: bdb2d and openSUSE

2017-01-25 Thread unDEFER via Digitalmars-d
So, the problem: $ cc --version cc (SUSE Linux) 4.8.3 20140627 [gcc-4_8-branch revision 212064] Copyright (C) 2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR

bdb2d and openSUSE

2017-01-24 Thread unDEFER via Digitalmars-d
Hello! Trying to build my project for Open SuSE and my project bdb2d unexpectedly brings error: Linking... ../../.dub/packages/bdb2d-5.3.28/bdb2d/.dub/build/library-debug-linux.posix-x86_64-dmd_2071-9E956773380BE684D56F8F1619A72458/libdb.a(db_126_1b8.o): In function

Re: Hangs on toStringZ()

2016-12-28 Thread unDEFER via Digitalmars-d
On Wednesday, 28 December 2016 at 12:39:46 UTC, Nemanja Boric wrote: Right, nothing wrong with threads, but super tricky to combine it with fork. So, it could be that one of your threads is using GC at the point of the forking, so it keeps the GC locked. Now you fork, and _all your threads

Re: Hangs on toStringZ()

2016-12-28 Thread unDEFER via Digitalmars-d
On Wednesday, 28 December 2016 at 11:32:09 UTC, Nemanja Boric wrote: My other guess is that you're using D threads in your application? Of course I'm using D threads, but with it all is normally.

Re: Hangs on toStringZ()

2016-12-28 Thread unDEFER via Digitalmars-d
On Wednesday, 28 December 2016 at 11:30:22 UTC, Nemanja Boric wrote: What you should do is following: 1. Allocate all needed data, convert all D strings into C strings, etc. 2. fork 3. exec immediately, not using anything from standard library between 2 and 3. OK, thank you.. I'm trying it

Re: Hangs on toStringZ()

2016-12-27 Thread unDEFER via Digitalmars-d
On Tuesday, 27 December 2016 at 21:33:46 UTC, Marc Schütz wrote: What context are you calling this from? Is this in a signal handler? Or from inside a destructor of a GC-owned object? It is child of my process after fork and before execl. No signal handler, no destructor, no catch-block,

Re: Hangs on toStringZ()

2016-12-27 Thread unDEFER via Digitalmars-d
The last backtrace shows that it hangs on the line: immutable(char) *bash = "/bin/bash".toStringz();

Re: Hangs on toStringZ()

2016-12-27 Thread unDEFER via Digitalmars-d
On Tuesday, 27 December 2016 at 18:01:36 UTC, Stefan Koch wrote: Have you tried assigning it to a variable ? Yes, I have tried, now backtrace of hanged process is: (gdb) bt #0 0x7f4e18260c6d in ?? () #1 0x in ?? ()

Re: Hangs on toStringZ()

2016-12-27 Thread unDEFER via Digitalmars-d
On Tuesday, 27 December 2016 at 17:50:14 UTC, Stefan Koch wrote: The string is allocated on the gc-ed heap. And since it's an R value it might get destroyed before execl is finished. Assign the result of toStringz to a char* variable and use that in the call. But execl not goes to Seg.fault.

Re: Using dlopen/dlsym

2016-12-27 Thread unDEFER via Digitalmars-d
It works on my Ubuntu 16.04 and dmd v2.071.1 But it wants to call dlopen() as core.sys.posix.dlfcn.dlopen().

Hangs on toStringZ()

2016-12-27 Thread unDEFER via Digitalmars-d
Hello I have very simple line with exec-command: execl("/bin/bash".toStringz(), "/bin/bash".toStringz(), "-c".toStringz(), command.toStringz(), null); And on this line on toStringz my program sometimes hangs. backtrace: (gdb) bt #0 0x7f3acd535c6d in nanosleep () at

Re: Many documentation examples can now be run online

2016-12-19 Thread unDEFER via Digitalmars-d-announce
Excellent work, thank you!

Re: unDE 0.1.0: original file manager, image and text viewer

2016-12-16 Thread unDEFER via Digitalmars-d-announce
On Friday, 16 December 2016 at 19:03:29 UTC, MGW wrote: Очень интересная работа. Взглянул на некоторые проблемы с другой стороны. Интересно, это реализовано на D? I'm translating: "Very interesting work. I looked on some problems with other hand. Interesting, is it implemented on D?"

Re: unDE 0.1.0: original file manager, image and text viewer

2016-12-16 Thread unDEFER via Digitalmars-d-announce
On Friday, 16 December 2016 at 14:51:53 UTC, John Colvin wrote: This looks like a very interesting project. I have had similar ideas recently but haven't had time to do anything. I'm looking forward to seeing what you create. Thank you!

Re: unDE 0.1.0: original file manager, image and text viewer

2016-12-15 Thread unDEFER via Digitalmars-d-announce
On Thursday, 15 December 2016 at 20:35:16 UTC, Basile B. wrote: That's interesting, unfortunately for you there's a more advanced version of a ZUI file explorer (http://eaglemode.sourceforge.net/index.html). How much your respective projects are related ? As I understand eaglemode is only

unDE 0.1.0: original file manager, image and text viewer

2016-12-15 Thread unDEFER via Digitalmars-d-announce
Hello, my dear friends! So many days you answers on many my questions. And today I glad to present my work: unDE 0.1.0. It is very original file manager, image and text viewer. More information: http://unde.sourceforge.net/en/ch24.html Video with English subtitles: https://youtu.be/29zuxU9eyXo

Re: mkdir; remove; under Windows throw Exception

2016-12-10 Thread unDEFER via Digitalmars-d-learn
On Saturday, 10 December 2016 at 18:30:53 UTC, Adam D. Ruppe wrote: On Saturday, 10 December 2016 at 18:09:43 UTC, unDEFER wrote: I know, but why it works in Linux by Linux documentation? Coincidence. That detail is undefined in the D documentation which means the implementation is free to

Re: mkdir; remove; under Windows throw Exception

2016-12-10 Thread unDEFER via Digitalmars-d-learn
On Saturday, 10 December 2016 at 14:10:15 UTC, ag0aep6g wrote: On 12/10/2016 04:39 AM, unDEFER wrote: man remove: remove - remove a file or directory That's documentation for C, not for D. I know, but why it works in Linux by Linux documentation?

Re: mkdir; remove; under Windows throw Exception

2016-12-09 Thread unDEFER via Digitalmars-d-learn
On Saturday, 10 December 2016 at 03:36:11 UTC, Adam D. Ruppe wrote: On Saturday, 10 December 2016 at 03:29:18 UTC, unDEFER wrote: But it works under Linux That's just because the underlying C function handles the case. But the D function makes no promises about that: std.file.remove's

Re: mkdir; remove; under Windows throw Exception

2016-12-09 Thread unDEFER via Digitalmars-d-learn
On Saturday, 10 December 2016 at 01:30:52 UTC, Jonathan M Davis wrote: On Saturday, December 10, 2016 01:19:45 unDEFER via Digitalmars-d-learn wrote: Well, much as I'd love to rag on Windows for doing dumb and annoying stuff with file locks (which they do do), in this case, your code

Re: mkdir; remove; under Windows throw Exception

2016-12-09 Thread unDEFER via Digitalmars-d-learn
On Saturday, 10 December 2016 at 01:28:13 UTC, SonicFreak94 wrote: On Saturday, 10 December 2016 at 01:19:45 UTC, unDEFER wrote: remove("D:\\TEST"); Try rmdir instead. But it works under Linux

Re: The program exits unexpectedly

2016-12-09 Thread unDEFER via Digitalmars-d-learn
On Friday, 9 December 2016 at 21:20:12 UTC, Martin Krejcirik wrote: On Friday, 9 December 2016 at 16:50:05 UTC, unDEFER wrote: And in mini program it works and shows diagnostic message. Where my diagnostic message in more complicate program??? Try redirecting stdout and stderr to a file(s).

Re: The program exits unexpectedly

2016-12-09 Thread unDEFER via Digitalmars-d-learn
On Friday, 9 December 2016 at 20:35:07 UTC, Ali Çehreli wrote: Assuming boundschecking is turned off, I think you get unlucky in the mini program and happen to hit a '\0' byte. No, no.. the program built in debug mode with dub.

mkdir; remove; under Windows throw Exception

2016-12-09 Thread unDEFER via Digitalmars-d-learn
Hello! $ cat try.d import std.file; void main () { mkdir("D:\\TEST"); remove("D:\\TEST"); } $ ./try.exe std.file.FileException@std\file.d(731): D:\TEST: Access Denied. What I don't know about removing directories in Windows? Why I can't remove directory

Re: The program exits unexpectedly

2016-12-09 Thread unDEFER via Digitalmars-d-learn
On Friday, 9 December 2016 at 14:29:38 UTC, unDEFER wrote: I'm afraid that the problem that my program wants to say something, but there is no "flush" so message leaves in the buffer. I have found, it was code like: string path = "C:"; string parent = path[0..path.lastIndexOf("\\")]; And in

Re: The program exits unexpectedly

2016-12-09 Thread unDEFER via Digitalmars-d-learn
I'm afraid that the problem that my program wants to say something, but there is no "flush" so message leaves in the buffer.

Re: The program exits unexpectedly

2016-12-09 Thread unDEFER via Digitalmars-d-learn
On Friday, 9 December 2016 at 10:08:24 UTC, unDEFER wrote: On Friday, 9 December 2016 at 09:42:52 UTC, unDEFER wrote: Exceptions works good, and prints debug message always. It is not exception.. I have tried to add try/catch around full loop of the program. It doesn't work. And program has

Re: The program exits unexpectedly

2016-12-09 Thread unDEFER via Digitalmars-d-learn
On Friday, 9 December 2016 at 09:42:52 UTC, unDEFER wrote: Exceptions works good, and prints debug message always. It is not exception.. I have tried to add try/catch around full loop of the program. It doesn't work. And program has infinite loop. But maybe it is unhandled signal? I have

Re: The program exits unexpectedly

2016-12-09 Thread unDEFER via Digitalmars-d-learn
On Friday, 9 December 2016 at 09:29:36 UTC, rikki cattermole wrote: On 09/12/2016 10:26 PM, unDEFER wrote: An exception/error might be thrown, try catching Error's in the threads function. Also try adding an infinite loop to it. Exceptions works good, and prints debug message always. It is

The program exits unexpectedly

2016-12-09 Thread unDEFER via Digitalmars-d-learn
Hello! I'm starting port my program to Windows _without_ Cygwin and found big trouble. My main thread exits unexpectedly without any diagnostic messages. The second thread still lives when it happens. The visual studio debugger say that thread exits with code 2. What it maybe?

Re: D with CygWin

2016-12-06 Thread unDEFER via Digitalmars-d
So it was not finish :-( mkdir("C:\\cygwin\\home\\undefer\\TEST") is working mkdir("/home/undefer/TEST") creates directory and hangs, doesn't pass control to the next instruction. DirEntry("/") works in my simple program, but doesn't work in big program.. windbg, gdb doen't help at all.

Re: The order of libraries makes error in dub

2016-12-05 Thread unDEFER via Digitalmars-d-learn
On Monday, 5 December 2016 at 15:16:27 UTC, unDEFER wrote: 2) Its put to linker command at the first "libdb53d.lib WS2_32.lib" and AFTER that -m32mscoff. As result "cannot open file". Oh, the reason was mistype. And I have found how-to hide linker warning ("lflags-windows":

Re: The order of libraries makes error in dub

2016-12-05 Thread unDEFER via Digitalmars-d-learn
On Monday, 5 December 2016 at 14:59:26 UTC, Mike Parker wrote: "libs-windows-dmd":["libdb53d.lib","ws2_32.lib"] I have used "sourceFiles-windows-dmd", because it is the single that I could find. Thank you, "libs-windows-dmd":["libdb53d","WS2_32"] works much better, but again these errors:

Re: The order of libraries makes error in dub

2016-12-05 Thread unDEFER via Digitalmars-d-learn
On Monday, 5 December 2016 at 11:51:52 UTC, unDEFER wrote: "libs-posix": ["db"], "sourceFiles-windows-dmd": ["libdb53d.lib", "WS_32.LIB"], "dflags-windows": ["-m32mscoff"], "subPackages": [ I understand that I don't must add "sourceFiles-windows-dmd" to lib project, I

The order of libraries makes error in dub

2016-12-05 Thread unDEFER via Digitalmars-d-learn
Hello, dub makes string like the next to compile my program (WS_32.LIB at the beginning): $ dmd -m32mscoff -lib -of.dub\\build\\library-debug-windows-x86-dmd_2072-83D2723917096513EB360761C22DDD87\\db.lib -debug -g -w -version=Have_bdb2d WS_32.LIB libdb53d.lib source/berkeleydb/* -vcolumns

Re: How to use library compiled with Microsoft Visual Studio 2015 in D?

2016-12-05 Thread unDEFER via Digitalmars-d-learn
OK, I have found. It must be library WS2_32.LIB from Microsoft SDK. But dumpbin doesn't show __imp__htonl@4 symbol there. The magic! Thank you!

Re: How to use library compiled with Microsoft Visual Studio 2015 in D?

2016-12-05 Thread unDEFER via Digitalmars-d-learn
On Monday, 5 December 2016 at 07:21:30 UTC, Jacob Carlborg wrote: If you compile your D code with the "-m32mscoff" flag it will produce COFF objects and use the Visual Studio tool chain (linker and runtime). Compiling for 64bit (-m64) will always produce COFF objects. Big thanks! -m32mscoff

How to use library compiled with Microsoft Visual Studio 2015 in D?

2016-12-04 Thread unDEFER via Digitalmars-d-learn
Hello! I have compiled libdb (BerkeleyDB) with Microsoft Visual Studio 2015. 1) "Debug" mode. I have libdb53d.dll file. Do implib. The linker doesn't seen symbols from the library! Do "lib -l". In the list of symbols "db_create", linker searches "_db_create". Is it the problem? 2)

Re: D with CygWin

2016-12-04 Thread unDEFER via Digitalmars-d
DONE!!! === $ cat try.d import std.stdio; import std.string; import cygwin.std.file; import cygwin.loader; void main() { CygwinInit(); foreach (string name; dirEntries("/", SpanMode.shallow)) { writefln(name);

Re: D with CygWin

2016-12-04 Thread unDEFER via Digitalmars-d
I have found. I have to use cygwin_dll_init == $ cat try.d import std.stdio; import std.string; import core.sys.windows.windows; extern(C) { alias int function(const (char)*, int, ...) open_t; alias void function() init_t; alias void

Re: D with CygWin

2016-12-03 Thread unDEFER via Digitalmars-d
So, just another attempt.. = import std.stdio; import std.string; import core.sys.windows.winbase; extern(C) { alias int function(in char*, int, ...) open_t; open_t _my_open; extern uint errno; } void main() { writefln("Open

Re: Delegates: Print 0..9

2016-12-01 Thread unDEFER via Digitalmars-d-learn
On Thursday, 1 December 2016 at 20:12:15 UTC, Ali Çehreli wrote: First, the scary syntax that produces a lambda from an int: ... Better: ... All methods.. Thank you!

  1   2   >