how to access a ftp sever with socket

2014-12-08 Thread michael via Digitalmars-d-learn
Hello Anyone: i am trying make a ftp client with socket,i have tried std.net.curl,but i cont stand with so many try-catch structure in my code,i am not familiar with socket,i write a pecie of code but it cont give me the welcome message which i want,and then i use wireshark to trace the

Re: how to access a ftp sever with socket

2014-12-08 Thread ketmar via Digitalmars-d-learn
On Mon, 8 Dec 2014 17:16:23 +0800 (CST) michael via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Hello Anyone: i am trying make a ftp client with socket,i have tried std.net.curl,but i cont stand with so many try-catch structure in my code,i am not familiar with

Derelict / SDL error

2014-12-08 Thread Paul via Digitalmars-d-learn
Sorry this is a bit off topic but as there doesn't seem to be an active forum for Derelict atm This simple test code is giving me an error 'Error executing command run: Program exited with code -11' (or a seg fault if executed from a terminal). The problem line is:

Re: Derelict / SDL error

2014-12-08 Thread ketmar via Digitalmars-d-learn
On Mon, 08 Dec 2014 12:53:10 + Paul via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Sorry this is a bit off topic but as there doesn't seem to be an active forum for Derelict atm This simple test code is giving me an error 'Error executing command run: Program

Re: Derelict / SDL error

2014-12-08 Thread Paul via Digitalmars-d-learn
On Monday, 8 December 2014 at 13:08:58 UTC, ketmar via Digitalmars-d-learn wrote: On Mon, 08 Dec 2014 12:53:10 + Paul via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Sorry this is a bit off topic but as there doesn't seem to be an active forum for Derelict atm This

Re: Derelict / SDL error

2014-12-08 Thread ketmar via Digitalmars-d-learn
On Mon, 08 Dec 2014 13:16:37 + Paul via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Monday, 8 December 2014 at 13:08:58 UTC, ketmar via Digitalmars-d-learn wrote: On Mon, 08 Dec 2014 12:53:10 + Paul via Digitalmars-d-learn digitalmars-d-learn@puremagic.com

Re: Sorted Array Wrapper Range

2014-12-08 Thread Nordlöw
On Sunday, 7 December 2014 at 13:12:06 UTC, Tobias Pankrath wrote: Something like this https://github.com/Panke/phobos/blob/std_container_sorted/std/container/sorted.d It should additionally support c.remove(r), c.removeKey(k), opIn and insertFront/removeFront if the underlying store

Re: Derelict / SDL error

2014-12-08 Thread Paul via Digitalmars-d-learn
On Monday, 8 December 2014 at 13:23:12 UTC, ketmar via Digitalmars-d-learn wrote: On Mon, 08 Dec 2014 13:16:37 + Paul via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Monday, 8 December 2014 at 13:08:58 UTC, ketmar via Digitalmars-d-learn wrote: On Mon, 08 Dec 2014

Re: Derelict / SDL error

2014-12-08 Thread ketmar via Digitalmars-d-learn
On Mon, 08 Dec 2014 13:37:20 + Paul via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: The program now works from a terminal as expected (!) BUT when SDL_RenderCopy is called SDL_GetError() shows an 'error code' (or just some address/value as it is different each time).

Re: Derelict / SDL error

2014-12-08 Thread Mike Parker via Digitalmars-d-learn
On 12/8/2014 10:37 PM, Paul wrote: I added this around the problem line to catch the problem: try{ SDL_RenderCopy(renderer, texture, sourceRect, destRect); } catch{} finally { writeln( Error: , SDL_GetError() ); } The program now works from a terminal

Re: Delegate returning itself

2014-12-08 Thread Jonathan Marler via Digitalmars-d-learn
On Saturday, 6 December 2014 at 15:46:16 UTC, Adam D. Ruppe wrote: The problem is the recursive *alias* rather than the delegate. Just don't use the alias name inside itself so like alias MyDelegate = void delegate() delegate(); will work. The first void delegate() is the return value of the

Re: Derelict / SDL error

2014-12-08 Thread Paul via Digitalmars-d-learn
On Monday, 8 December 2014 at 13:48:27 UTC, Mike Parker wrote: import std.conv : to; writeln( Error: , to!string( SDL_GetError() )); Cleaner! Any ideas where to look for the source of the problem?

Re: Derelict / SDL error

2014-12-08 Thread Paul via Digitalmars-d-learn
On Monday, 8 December 2014 at 13:47:47 UTC, ketmar via Digitalmars-d-learn wrote: On Mon, 08 Dec 2014 13:37:20 + Paul via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: besides, i don't think that you'll get something sane from `SDL_GetError()` in the case of segfault.

Re: Delegate returning itself

2014-12-08 Thread Jonathan Marler via Digitalmars-d-learn
On Monday, 8 December 2014 at 14:08:33 UTC, Jonathan Marler wrote: On Saturday, 6 December 2014 at 15:46:16 UTC, Adam D. Ruppe wrote: The problem is the recursive *alias* rather than the delegate. Just don't use the alias name inside itself so like alias MyDelegate = void delegate()

Re: Derelict / SDL error

2014-12-08 Thread ketmar via Digitalmars-d-learn
On Mon, 08 Dec 2014 14:13:54 + Paul via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Monday, 8 December 2014 at 13:48:27 UTC, Mike Parker wrote: import std.conv : to; writeln( Error: , to!string( SDL_GetError() )); Cleaner! ah, sure. i just wanted to use libc's

Re: Delegate returning itself

2014-12-08 Thread via Digitalmars-d-learn
On Monday, 8 December 2014 at 14:31:53 UTC, Jonathan Marler wrote: On Monday, 8 December 2014 at 14:08:33 UTC, Jonathan Marler wrote: On Saturday, 6 December 2014 at 15:46:16 UTC, Adam D. Ruppe wrote: The problem is the recursive *alias* rather than the delegate. Just don't use the alias name

Re: Accented Characters and Counting Syllables

2014-12-08 Thread Nordlöw
On Sunday, 7 December 2014 at 15:47:45 UTC, H. S. Teoh via Digitalmars-d-learn wrote: Ok, thanks. I just noticed that byGrapheme() lacks bidirectional access. Further it also lacks graphemeStrideBack() in complement to graphemeStride()? Similar to stride() and strideBack(). Is this difficult

Re: Derelict / SDL error

2014-12-08 Thread Paul via Digitalmars-d-learn
On Monday, 8 December 2014 at 14:35:17 UTC, ketmar via Digitalmars-d-learn wrote: On Mon, 08 Dec 2014 14:13:54 + Paul via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Monday, 8 December 2014 at 13:48:27 UTC, Mike Parker wrote: import std.conv : to; writeln( Error: ,

Re: Accented Characters and Counting Syllables

2014-12-08 Thread Nordlöw
On Monday, 8 December 2014 at 14:57:06 UTC, Nordlöw wrote: What's the best source of information for these algorithms? Is it certain that graphemes iteration is backwards iteratable by definition? I guess https://en.wikipedia.org/wiki/Combining_character could be a good start.

Re: Sorted Array Wrapper Range

2014-12-08 Thread Tobias Pankrath via Digitalmars-d-learn
On Monday, 8 December 2014 at 13:34:33 UTC, Nordlöw wrote: On Sunday, 7 December 2014 at 13:12:06 UTC, Tobias Pankrath wrote: Something like this https://github.com/Panke/phobos/blob/std_container_sorted/std/container/sorted.d It should additionally support c.remove(r), c.removeKey(k), opIn

Re: Derelict / SDL error

2014-12-08 Thread Jack via Digitalmars-d-learn
On Monday, 8 December 2014 at 12:53:11 UTC, Paul wrote: Sorry this is a bit off topic but as there doesn't seem to be an active forum for Derelict atm This simple test code is giving me an error 'Error executing command run: Program exited with code -11' (or a seg fault if executed from

Re: Delegate returning itself

2014-12-08 Thread Jonathan Marler via Digitalmars-d-learn
On Monday, 8 December 2014 at 14:38:37 UTC, Marc Schütz wrote: On Monday, 8 December 2014 at 14:31:53 UTC, Jonathan Marler wrote: On Monday, 8 December 2014 at 14:08:33 UTC, Jonathan Marler wrote: On Saturday, 6 December 2014 at 15:46:16 UTC, Adam D. Ruppe wrote: The problem is the recursive

Re: Delegate returning itself

2014-12-08 Thread Ali Çehreli via Digitalmars-d-learn
On 12/06/2014 07:28 AM, Jonathan Marler wrote: Is there a way to create a delegate that returns itself? Y combinator helps exactly with that: http://rosettacode.org/wiki/Y_combinator#D Copying the code from there: import std.stdio, std.traits, std.algorithm, std.range; auto Y(S, T...)(S

How do i use std.functional.binaryFun?

2014-12-08 Thread Gary Willoughby via Digitalmars-d-learn
How do i successfully use std.functional.binaryFun in the following example? import std.stdio; import std.functional; class Foo(T, alias greater = a b) if (is(typeof(binaryFun!(greater)(T.init, T.init)) == bool)) { private alias compare = binaryFun!(greater); public this()

Re: Sorted Array Wrapper Range

2014-12-08 Thread Nordlöw
On Monday, 8 December 2014 at 15:43:37 UTC, Tobias Pankrath wrote: Was my fault. The phobos checkout didn't match my dmd version. Here is my current state (has some more unittest, bugs fixed, no assignment via SortedRange views on Sorted.):

Re: Sorted Array Wrapper Range

2014-12-08 Thread Nordlöw
On Monday, 8 December 2014 at 15:43:37 UTC, Tobias Pankrath wrote: Was my fault. The phobos checkout didn't match my dmd version. Here is my current state (has some more unittest, bugs fixed, no assignment via SortedRange views on Sorted.):

Re: Derelict / SDL error

2014-12-08 Thread Paul via Digitalmars-d-learn
On Monday, 8 December 2014 at 17:48:55 UTC, Jack wrote: I'm running ArchLinux 64-bit on Vbox and tested out the code. There haven't been any problems. Have you tried updating whatever tools you're using?(dmd, dub, etc) Might've been an outdated piece of software that's been making the fuss.

Re: How do i use std.functional.binaryFun?

2014-12-08 Thread anonymous via Digitalmars-d-learn
On Monday, 8 December 2014 at 20:08:35 UTC, Gary Willoughby wrote: import std.stdio; import std.functional; class Foo(T, alias greater = a b) if (is(typeof(binaryFun!(greater)(T.init, T.init)) == bool)) { private alias compare = binaryFun!(greater); public this() {

Re: threading issues with D - C - Python

2014-12-08 Thread Michael via Digitalmars-d-learn
On Monday, 8 December 2014 at 01:17:16 UTC, Ellery Newcomer wrote: On 12/07/2014 03:12 PM, Michael wrote: On Saturday, 6 December 2014 at 00:40:49 UTC, Ellery Newcomer wrote: On 12/04/2014 10:55 PM, Ellery Newcomer wrote: I guess tomorrow I can try messing around with thread_attachThis, as

Re: @property usage

2014-12-08 Thread Nicholas Londey via Digitalmars-d-learn
as this can break some invalid code (the code where people using properties as functions) Does @property ever make sense for a free floating function? I would have thought no but was recently asked to add it if using the function with uniform call syntax.

Re: @property usage

2014-12-08 Thread ketmar via Digitalmars-d-learn
On Tue, 09 Dec 2014 07:31:20 + Nicholas Londey via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: as this can break some invalid code (the code where people using properties as functions) Does @property ever make sense for a free floating function? I would have thought