Re: GC.addRange in pure function

2021-02-09 Thread Temtaime via Digitalmars-d-learn
On Sunday, 7 February 2021 at 14:13:18 UTC, vitamin wrote: Why using 'new' is allowed in pure functions but calling GC.addRange or GC.removeRange isn't allowed? pure is broken. Just don't [use it]

Re: Unfold string array

2020-01-05 Thread Temtaime via Digitalmars-d-learn
On Sunday, 5 January 2020 at 22:39:37 UTC, Teo wrote: On Sunday, 5 January 2020 at 13:37:58 UTC, JN wrote: [...] Thanks for the input. I just realized that I was not precise enough in my description. Apologies for that. My intention is to use std.algorithm, if possible. I read the documenta

Re: [windows] Can't delete a closed file?

2019-05-10 Thread Temtaime via Digitalmars-d-learn
Lol, you don't have to load and unload the curl dll. std.net.curl have its own lazy libcurl loader. But i'm not sure if it tries to find the dll in the temp directory. If it is the case, then it simply doesn't unload the dll when you have called some function from it.

Re: Can't cast from void*

2018-02-06 Thread Temtaime via Digitalmars-d-learn
On Tuesday, 6 February 2018 at 08:29:05 UTC, Kagamin wrote: On Monday, 5 February 2018 at 15:33:02 UTC, Steven Schveighoffer wrote: Is there a more pragmatic use case why this should be possible? Maybe for least surprise. The error message almost convinced me that such cast is impossible, onl

Re: Does to!(string)(char[]) do any memory allocation on conversion?

2017-12-25 Thread Temtaime via Digitalmars-d-learn
On Monday, 25 December 2017 at 14:37:01 UTC, Mengu wrote: On Monday, 25 December 2017 at 14:12:32 UTC, Marc wrote: Does to!(string)(char[]) do any memory allocation on conversion or is this similar to a cast or what else? yes, it is allocating memory. you can test such cases with @nogc [0].

Re: Does to!(string)(char[]) do any memory allocation on conversion?

2017-12-25 Thread Temtaime via Digitalmars-d-learn
On Monday, 25 December 2017 at 14:12:32 UTC, Marc wrote: Does to!(string)(char[]) do any memory allocation on conversion or is this similar to a cast or what else? It is translated to idup. So yes, it allocates memory.

Re: No of threads

2017-12-20 Thread Temtaime via Digitalmars-d-learn
On Wednesday, 20 December 2017 at 13:41:06 UTC, Vino wrote: On Tuesday, 19 December 2017 at 18:42:01 UTC, Ali Çehreli wrote: On 12/19/2017 02:24 AM, Vino wrote: > Hi All, > >Request your help in clarifying the below. As per the document > > foreach (d; taskPool.parallel(xxx)) : The total num

Re: Tried C++ to D. Wrong result.

2017-11-28 Thread Temtaime via Digitalmars-d-learn
On Tuesday, 28 November 2017 at 06:46:18 UTC, Dmitry wrote: On Monday, 27 November 2017 at 19:01:28 UTC, Ali Çehreli wrote: P.S. I think you have an unnecessary 'ref' on the D version because a slice is already a reference to elements: Fixed, thank you. https://pastebin.com/xJXPBh0n Converted

Re: reduce condition nesting

2017-11-23 Thread Temtaime via Digitalmars-d-learn
On Thursday, 23 November 2017 at 14:16:25 UTC, Andrea Fontana wrote: On Thursday, 23 November 2017 at 13:47:37 UTC, Adam D. Ruppe wrote: On Thursday, 23 November 2017 at 05:19:27 UTC, Andrey wrote: for instance in kotlin it can be replace with this: when { c1 -> foo(), c2 -> bar(),

Re: minElement on array of const objects

2017-11-13 Thread Temtaime via Digitalmars-d-learn
On Monday, 13 November 2017 at 10:20:51 UTC, Aurelien Fredouelle wrote: Hi all, It seems that it is not possible to use minElement on an array of const objects: class A { int val; } const(A) doStuff(const(A)[] v) { import std.algorithm.searching : minElement; return v.minElement!"a.val

Re: Temporary objects as function parameters or when-is-this-shit-going-to-end?

2017-10-13 Thread Temtaime via Digitalmars-d-learn
On Friday, 13 October 2017 at 11:21:48 UTC, Biotronic wrote: On Friday, 13 October 2017 at 10:35:56 UTC, Jack Applegame wrote: Compiler creates struct on the stack and silently (without postblitting and destruction old object) moves it to another address. Is it normal? I don't think so. It is

Re: Format g bug ?

2017-08-09 Thread Temtaime via Digitalmars-d-learn
Sorry, messed up numbers Expected: 3.11 3.11 3.1 3.1 Seems g outputs one digit less

Format g bug ?

2017-08-09 Thread Temtaime via Digitalmars-d-learn
import std.stdio; void main() { writefln(`%.2g`, 3.11); writefln(`%.2f`, 3.11); writefln(`%.1g`, 3.11); writefln(`%.1f`, 3.11); } 3.1 3.11 3 3.1 But expected 3.1 3.11 3.1 3.11

Re: lambda function with "capture by value"

2017-08-05 Thread Temtaime via Digitalmars-d-learn
On Saturday, 5 August 2017 at 19:19:06 UTC, Simon Bürger wrote: On Saturday, 5 August 2017 at 18:54:22 UTC, ikod wrote: Maybe std.functional.partial can help you. Nope. int i = 1; alias dg = partial!(writeln, i); i = 2; dg(); still prints '2' as it should beca

Re: Getting enum from value

2017-08-05 Thread Temtaime via Digitalmars-d-learn
On Saturday, 5 August 2017 at 15:42:53 UTC, Rene Zwanenburg wrote: On Saturday, 5 August 2017 at 15:33:57 UTC, Matthew Remmel wrote: Any ideas? You can use to! in std.conv: import std.stdio; import std.conv; enum Foo { A = "A", B = "B" } void main() { writeln("A".to

Re: Why free and realloc seem to include .

2017-08-03 Thread Temtaime via Digitalmars-d-learn
On Thursday, 3 August 2017 at 14:03:56 UTC, Michael wrote: So this might be a bit of a stupid question, but looking at the DMD source code (dmodule.d in particular) I see the following code: if (srcfile._ref == 0) .free(srcfile.buffer); srcfile.buffer = null; srcfile.len = 0; and I was j

Re: Static array * scalar is not working for me

2017-07-30 Thread Temtaime via Digitalmars-d-learn
On Sunday, 30 July 2017 at 08:18:07 UTC, Danni Coy wrote: The following code is not working for me float[3] f; f[] = abs(f)[] * -1.0f; where abs is a function that returns a float[3]; it complains that f should be attached to some memory. Is it a bug or am I missing something? This is unimpl

Re: Profiling after exit()

2017-07-28 Thread Temtaime via Digitalmars-d-learn
On Friday, 28 July 2017 at 08:06:33 UTC, Eugene Wissner wrote: On Friday, 28 July 2017 at 06:32:59 UTC, Jacob Carlborg wrote: On 2017-07-27 16:30, Eugene Wissner wrote: I have a multi-threaded application, whose threads normally run forever. But I need to profile this program, so I compile the

Re: Profiling after exit()

2017-07-27 Thread Temtaime via Digitalmars-d-learn
Also there was an issue that profiling doesn't work with multi-threaded apps and leads to a crash. Don't know if it is fixed.

Re: Profiling after exit()

2017-07-27 Thread Temtaime via Digitalmars-d-learn
Exit is not "normal exit" for D programs so, do not use it. Your threads should stop at some point to make able the app exit successfully. There's a "join" method. You can use it with your "done" variable.

Re: Why can't typeof() be used in member method?

2017-07-26 Thread Temtaime via Digitalmars-d-learn
On Wednesday, 26 July 2017 at 19:06:24 UTC, Andre Pany wrote: On Wednesday, 26 July 2017 at 17:04:59 UTC, Adam D. Ruppe wrote: On Wednesday, 26 July 2017 at 16:50:35 UTC, Andre Pany wrote: [...] FYI, you shouldn't use .stringof here. Just use `T` instead of `T.stringof`. [...] Thank you

Re: How can I serialize a struct into a file in the style of C?

2017-07-23 Thread Temtaime via Digitalmars-d-learn
Hi ! I have a dub package that doing this. https://github.com/Temtaime/tt-utils/blob/master/source/tt/binary/tests.d Have a look at the tests. Currently it has no documentation, but feel free to ask questions

Re: Duplicated functions not reported?

2017-04-16 Thread Temtaime via Digitalmars-d-learn
On Sunday, 16 April 2017 at 15:54:16 UTC, Stefan Koch wrote: On Sunday, 16 April 2017 at 10:56:37 UTC, Era Scarecrow wrote: On Saturday, 15 April 2017 at 11:10:01 UTC, Stefan Koch wrote: It would requires an O(n^2) check per declaration. Even it is never used. which would make imports that much

Re: newbie problem with nothrow

2016-10-31 Thread Temtaime via Digitalmars-d-learn
On Monday, 31 October 2016 at 16:55:51 UTC, WhatMeWorry wrote: Is there a way to turn off nothrow or work around it? Because to me it looks like nothrow prevents me from doing anything useful. extern(C) void onKeyEvent(GLFWwindow* window, int key, int scancode, int action, int modifier) not

Re: Is there Typeof template ?

2016-10-28 Thread Temtaime via Digitalmars-d-learn
On Friday, 28 October 2016 at 18:39:36 UTC, Ali Çehreli wrote: On 10/28/2016 11:25 AM, Jonathan M Davis via Digitalmars-d-learn wrote: >> void main() { >> @(`str`, 123) uint k; >> foreach (a; __traits(getAttributes, k)) { >> pragma(msg, typeof(a)); >> } >> } > I don't k

Re: Is there Typeof template ?

2016-10-28 Thread Temtaime via Digitalmars-d-learn
On Friday, 28 October 2016 at 12:44:20 UTC, Adam D. Ruppe wrote: On Friday, 28 October 2016 at 10:52:05 UTC, Temtaime wrote: Are there something or should I create a PR to phobos? Why would you want that? I have UDAs with values à la @(`str`, 123) uint k; And i want to know a type of a

Is there Typeof template ?

2016-10-28 Thread Temtaime via Digitalmars-d-learn
Hi ! Tried to find alias Typeof(alias A) = typeof(A); or something, but failed. Are there something or should I create a PR to phobos? Thanks

Address of an element of AA

2016-04-02 Thread Temtaime via Digitalmars-d-learn
Hi ! I can't find this in specs. If i add an element to AA: aa[10] = 123; Will &aa[10] be always the same (of course i don't remove that key) ? Thanks for a reply. I think specs should be enhanced.

Destructor order

2016-03-19 Thread Temtaime via Digitalmars-d-learn
Hi ! I wonder if i can rely on this code : http://dpaste.dzfl.pl/745cc5b1cdfb There's two questions: 1) Is dtors always called in reverse order ? 2) Is all the dtors always called when i call destroy ? Thanks for a reply !

Re: Maximum number of threads

2015-09-24 Thread Temtaime via Digitalmars-d-learn
Offtop: i think if number of threads > number of real cores, than there's something wrong with your design. Maybe fibers suit better ?

Re: using memset withing a pure function

2015-08-15 Thread Temtaime via Digitalmars-d-learn
There's a problem with « dst[0 .. n] = val; ». It should be « dst[0 .. n][] = val; »

Re: Associative array literal. Why doesn't it compile?

2015-08-14 Thread Temtaime via Digitalmars-d-learn
It's because it's implemented in DMD only partly. There's a bug report associated with it.

Re: How disruptive is the GC?

2015-08-02 Thread Temtaime via Digitalmars-d-learn
I'm writing a game engine in D. Try to minimize allocations and that's will be OK. I'm using delegates and all the phobos stuff. I allocate only in few places at every frame. So i can reach 1K fps on a complicated scene. GC is not a problem. DMD optimizes so ugly that all the math is very, ver

Re: Converting uint[] slice to string for the purpose of hashing?

2015-07-23 Thread Temtaime via Digitalmars-d-learn
All types are hashable and for your own structs and classes you can redefine opHash

Re: Escape a string ?

2015-04-09 Thread Temtaime via Digitalmars-d-learn
Sorry, i meant it gives b == "fooo\\nbar" I'm writing an interpreter and it should dump original string from memory. Also i wonder if there's a function to convert "aaa\\nbb" to "aaa\nbb" (i.e. to unescape)

Escape a string ?

2015-04-09 Thread Temtaime via Digitalmars-d-learn
Hi ! I wonder how to escape a string in phobos ? For example auto a = [ "fooo\nbar" ]; auto b = format("%(%s%)", a); gives b: "fooo\nbar" Is there any other function to escape string? I'm looking for something that doesn't require to make an array at first. For example is there string escape

Re: Why the DMD Backend?

2014-12-02 Thread Temtaime via Digitalmars-d-learn
Setting up LLVM infrastructure is only needed when you is a LDC developer. I think for ordinary users it's not their business.

Re: Why the DMD Backend?

2014-12-02 Thread Temtaime via Digitalmars-d-learn
It's only words. If we speak about LDC it can compile fast in debug mode with performance average to DMD's backend but with much great performance in release mode thanks to vectorization and other techniques. Also LDC thanks to LLVM supports X86, X86-64, PowerPC, PowerPC-64, ARM, Thumb, SPARC,

Re: static array alignment

2014-11-30 Thread Temtaime via Digitalmars-d-learn
align doesn't work in DMD. There's bugreport for a long time.

Re: D1: Windows DWORD conversion in D

2014-09-08 Thread Temtaime via Digitalmars-d-learn
DWORD is an uint.

Re: Appender.put return value

2014-07-24 Thread Temtaime via Digitalmars-d-learn
Offtop It's better to return "this" and have return type "ref auto" i think.

Re: Test if member is static variable

2014-06-02 Thread Temtaime via Digitalmars-d-learn
Also second question is what are better to use, current template recursion-based code or rewrite it to CTFE ?

Test if member is static variable

2014-06-01 Thread Temtaime via Digitalmars-d-learn
Hi ! http://dpaste.dzfl.pl/e21082716396 Is there a way to optimize static if(is(typeof(__traits(getMember, T, name).offsetof)) == false && is(FunctionTypeOf!(__traits(getMember, T, name)) == function) == false && __traits(compiles, &__traits(getMember, T, name))) ? I think there shoult be

Re: Inherit of attributes

2014-04-25 Thread Temtaime via Digitalmars-d-learn
Hi ! Thanks for reply. Why so ? And why @nogc not transitive too ?

Re: Inherit of attributes

2014-04-25 Thread Temtaime via Digitalmars-d-learn
Hi, MrSmith ! Yes, i know that, but my question isn't about it. I want to type `pure:` at module's beginning and have all function(in classes, too) declared as pure. I think `pure:` should do it. But it doesn't.

Inherit of attributes

2014-04-25 Thread Temtaime via Digitalmars-d-learn
Hi ! http://dpaste.dzfl.pl/2fa3dd2ea834 Why S.init not pure ? Is it expected behavior or bug ? Thanks!

Re: Array of user's structs & slicing & opBinary

2014-03-08 Thread Temtaime
Ok, with ints 2.065: http://dpaste.dzfl.pl/5057b6ce3ff8 And git head says Error: Array operation a[] * 10 not implemented Too strange. But that compiles: http://dpaste.dzfl.pl/0e98d1110d77 Ok, if i rewrite my example in such way: http://dpaste.dzfl.pl/f7aa6aa96821 Should i report a bug? Thank

Array of user's structs & slicing & opBinary

2014-03-08 Thread Temtaime
Hi ! http://dpaste.dzfl.pl/d5b69cfb98f4 Fails to compile. Why? Thanks.

Re: Allocating memory from library

2014-03-08 Thread Temtaime
Thanks !

Allocating memory from library

2014-03-08 Thread Temtaime
Hi ! I just wondered if this code is valid: void main() { auto p = my_allocate(); // ... my_free(p); } extern(System): void *my_allocate(); void my_free(void *); Where my_allocate and my_free are in the external dll. Main question is: is this code transparent to GC? Will not it try to coll

Re: Destructors calling sequence

2013-11-29 Thread Temtaime
I see. Thanks for all for yours replies !

Re: Destructors calling sequence

2013-11-29 Thread Temtaime
Please, don't advise to call b.destroy.

Destructors calling sequence

2013-11-29 Thread Temtaime
Hi ! http://dpaste.dzfl.pl/53d9a59e How i can enforce that ~A will be called after ~B ? I'm writing 3D engine and it's critical to me. Thanks for yours aid !

Re: Strange error

2013-11-15 Thread Temtaime
Go to bugzilla.

Re: GC.collect bug ?

2013-09-17 Thread Temtaime
I cannot use the delete/destroy. I want to call dtor at all unreferenced objects. Manual from Dlang size says that GC.collect triggers a full collection. But it doesn't.

GC.collect bug ?

2013-09-13 Thread Temtaime
Hello for all ! I need to call all objects destructors in one place. It's guaranted, that there is no objects instances. I tried use GC.collect but it's produces strange results. import std.stdio; import core.memory; class A { ~this() { writeln(`dtor`); }; }; void main() { aut

Re: std.socket connect

2013-08-17 Thread Temtaime
Oh, i've found that that can be resolved by select(). Thanks.

std.socket connect

2013-08-17 Thread Temtaime
Hello guys! void connect(Address to); Establish a connection. If the socket is blocking, connect waits for the connection to be made. If the socket is nonblocking, connect returns immediately and the connection attempt is still in progress. How can i obtain information about progress when s

Re: Inline assembly registers

2013-08-10 Thread Temtaime
Now it's clear. Thanks very much!

Struct's alignment

2013-08-10 Thread Temtaime
Hello, guys! I have Matrix class(that contains an array of 16 floats) and SSE code to mult it. It's neccessary to have an array alignment 16. I'm figured out simple test-code: align(16) struct S { align(16) int a; } void main() { align(16) S s; writeln(cast(void *)&s

Re: Struct's alignment

2013-08-10 Thread Temtaime
Sorry, not class, but struct.

Re: Inline assembly registers

2013-08-10 Thread Temtaime
I'm writing some ASM code in my function. Does it mean that DMD saves "his" registers before my asm code and restores after? So i can use all registers without interaction with code that DMD backend produces?

Inline assembly registers

2013-08-10 Thread Temtaime
Hello for all! Which registers in IASM i must preserve? http://dlang.org/iasm.html says nothing. Regards.

Re: Declare reference to variable ?

2013-07-29 Thread Temtaime
No, i cannot. struct S { uint longnamed; } void main() { S somestruct; alias v = somestruct.longnamed; writeln(v); } Error: need 'this' for 'longnamed' of type 'uint' Is it a bug ?

Declare reference to variable ?

2013-07-29 Thread Temtaime
I have a long named variable in a struct. For example let's name that longnamedstruct.longnamedmember I need to use that variable in many places of the code and i cannot create the copy of it. In c++ i can auto &v = longnamedstruct.longnamedmember; Now i can use v anywhere. Why i cannot decl

Strange error

2013-07-04 Thread Temtaime
Hello guys ! I'm found strange error when compiling following code: http://dpaste.1azy.net/b40ce9a4 The error is: src\phobos\std\stdio.d(1872): Error: variable _param_1 used before set Problem exists only when using following options: -inline -O I'm using DMD 2.063.2 on Windows. Can anybody

Possble bug ? Adding

2013-06-24 Thread Temtaime
Hello, guys ! http://dpaste.1azy.net/8917c253 Thanks. Regards.

Re: Strange error when importing std.regex

2013-06-12 Thread Temtaime
Oh, thanks very much.

Strange error when importing std.regex

2013-06-12 Thread Temtaime
Hello guys! http://dpaste.1azy.net/9c4c3eb8 http://dpaste.1azy.net/afd8d20b How i can avoid this?

Re: Why there is too many uneccessary casts?

2013-06-11 Thread Temtaime
No. I means, that uint a = uint.max; uint b = a + 1; writeln(b); Works OK. Why? Compiler doesn't know if a + b fits in uint, right? Then why overflow with ints are accepted? So your example is meaningless.

Re: Why there is too many uneccessary casts?

2013-06-11 Thread Temtaime
There is overflow and it can be with int too. It's standard behavior.

Why there is too many uneccessary casts?

2013-06-11 Thread Temtaime
ubyte k = 10; ubyte c = k + 1; This code fails to compile because of: Error: cannot implicitly convert expression (cast(int)k + 1) of type int to ubyte Why? It's pain in the ass, i think. My code contains only casts then.

Re: Constants doesn't have UDA's?

2013-06-10 Thread Temtaime
Oh, i see, thanks. P.S. туй васю нигодяй.

Constants doesn't have UDA's?

2013-06-09 Thread Temtaime
Hello guys! @("att") int t = 1; auto b = [ __traits(getAttributes, t) ]; Works. @("att") enum int t = 1; auto b = [ __traits(getAttributes, t) ]; Works also. @("att") const int t = 1; auto b = [ __traits(getAttributes, t) ]; Doesn't work. Error: first argument is not a symbol Why? Also a li

Re: UDA strange behavior

2013-06-09 Thread Temtaime
Thanks for all, it's unactual anymore.

Re: Compiler bug ?

2013-06-09 Thread Temtaime
Yes, it's strange. Using alias doesn't lead to this.

Re: Compiler bug ?

2013-06-09 Thread Temtaime
Oh, i see. Great thanks!

Compiler bug ?

2013-06-09 Thread Temtaime
Hello guys! It seems that it is bug. And critical for me. http://dpaste.1azy.net/b93f5776 Regards.

Re: UDA strange behavior

2013-06-09 Thread Temtaime
Oh, thanks. But then that code doesn't work: http://dpaste.dzfl.pl/262b966c

UDA strange behavior

2013-06-09 Thread Temtaime
@(3) int a; enum tp = __traits(getAttributes, a); enum b = tp[0]; writeln(b); Compiler doesn't accept enum b = tp[0] and says to me: Error: variable _tp_field_0 cannot be read at compile time Why? And writeln(tp[0]) works as expected.

Re: isMutable doesn't work with enum ?

2013-06-02 Thread Temtaime
I'm writing serializer and it iterates all members of struct. It compares fields marked as "enum" when reading from file to check BOM, for example. I'm using enum now because const members are deprecated in 2.063.

Re: isMutable doesn't work with enum ?

2013-06-02 Thread Temtaime
It's intresting. So the only way to pass "a" to overloaded function like that ? void foo(T)(ref T) { writeln("true"); } void foo(T)(auto ref in T) { writeln("false"); } enum int a = 10; foo(a); // false int b = 1; foo(b); // true

isMutable doesn't work with enum ?

2013-06-02 Thread Temtaime
Hi! enum int a = 5; writeln(isMutable!(typeof(a))); Writes true. Why? How i can figure out if variable is "enum" constant ? Thanks. Regards.

until strange behavior

2013-06-02 Thread Temtaime
Why char arr[3] = "abc"; arr[].until('b').front has type of dchar ???

Re: Compiler bug ?

2013-05-17 Thread Temtaime
Yes, i want to see 'undeclared variable' error, but the compiler omits function declaration instead. And why i shouldn't use __? I think it's ordinary identifier.

Compiler bug ?

2013-05-17 Thread Temtaime
struct A { int opBinary(string op)(A) { k++; return 0; } } struct B { A __a; alias __a this; } void main() { B b; auto c = b * b; } This code doesn't compiles with an error: Error: 'b' is not of arithmetic type, it is a B If i remove k++, then it's OK. It seems

Structure's inheritance

2013-05-12 Thread Temtaime
Hello to all ! I'm surprised that there is no structure's inheritance. There is a problem: I want to make Matrix MxN class. I also want to make child classes Square Matrix and Vector from it with additional functions. I don't want use "class" cause of "new" overhead. Std typecons's Scoped - wo

Re: D is totally useless

2013-05-01 Thread Temtaime
And why not? If not, then you should drop support of platform specific headers like windows.d. Because it's full of a drawing and many other functions. OpenGL is part of WinAPI.

Re: D is totally useless

2013-05-01 Thread Temtaime
I had investigate a little more in it. Thanks to Jack Applegame, we made a copy of gl/gl.h and opengl32.lib for DMD. http://acomirei.ru/u/gl.d http://acomirei.ru/u/opengl32.lib I hope it will be included in DMD, now it's first draft of our work.

D is totally useless

2013-05-01 Thread Temtaime
I'm new in D, so i'm tried to write some in that langugage. That's story about how i tried to port OGL sample, that renders one triangle. I was very surprised when i found, that D doesn't have equivalent of gl/gl.h. Any C++ compiler has it. Okay, i'm investigate in it and found OpenGL in dei

Can't compile the code

2013-04-28 Thread Temtaime
int main() { auto f = (bool = false) {}; f(); return 0; } I can't compile this code on DMD32 D Compiler v2.062 On windows. It says to me: Error: expected 1 function arguments, not 0 On linux it seems to work(http://ideone.com/fsKYWR).