While porting a simple Python script to D, I found the following
problem.
I need to read in some thousand of little text files and search
every one for a match with a given regular expression.
Obviously, the program can't (and it should not) be certain about
the encoding of each input file.
Just wondering if any library that supports putting network
adapter in promiscuous mode. As I new to D and heard something
about importing C libraries in to D, but I don't know how smooth
that will be so just was wondering if any D libraries that
support promiscuous mode.
Thanks to anyone tha
maxpat78:
Is there a simple and elegant solution in D for such case?
Python didn't gave such problems!
Do you mean Python3?
Bye,
bearophile
On Thursday, 5 December 2013 at 19:20:16 UTC, Mafi wrote:
I am on fresh install of Linux Mint 16 64bit and I tried to
compile some D code I have writen and I have problems ("Hello
World" works btw). I uses Derelict (v2) and I have successfully
compiled/linked/rurn my program on Windows 7 64bit.
On Friday, 6 December 2013 at 02:11:20 UTC, Jonathan M Davis
wrote:
Regardless, we're pretty much stuck at this point. Changing it
would silently
break lots of code.
I still wonder what was the reasoning behind C's warning about
comparison between signed and unsigned integers instead of givin
On 2013-12-06 08:53:04 +, maxpat78 said:
While porting a simple Python script to D, I found the following problem.
I need to read in some thousand of little text files and search every
one for a match with a given regular expression.
Obviously, the program can't (and it should not) be ce
On Friday, December 06, 2013 12:02:29 Fra wrote:
> On Friday, 6 December 2013 at 02:11:20 UTC, Jonathan M Davis
>
> wrote:
> > Regardless, we're pretty much stuck at this point. Changing it
> > would silently
> > break lots of code.
>
> I still wonder what was the reasoning behind C's warning abo
The best that could be done would arguably be to simply do the
comparison the 'right' way. E.g. static assert(-1 < 0u).
What's the 'right' way? assert(-1 < uint.max) will always fail
because
no matter whether you convert to int or uint, the comparison
simply
cannot be carried out at the machi
On Friday, 6 December 2013 at 11:56:35 UTC, Jonathan M Davis
wrote:
There's no such thing as standard warnins in C. What gets
warned about depends
entirely on the compiler and what it's settings are.
You are 100% right, I was speaking out of my mind.
Anyway, I still don't understand the ration
On Friday, 6 December 2013 at 10:32:52 UTC, Cabe wrote:
Just wondering if any library that supports putting network
adapter in promiscuous mode. As I new to D and heard something
about importing C libraries in to D, but I don't know how
smooth that will be so just was wondering if any D librari
On 2013-12-05 20:20, Mafi wrote:
I am on fresh install of Linux Mint 16 64bit and I tried to compile some
D code I have writen and I have problems ("Hello World" works btw). I
uses Derelict (v2) and I have successfully compiled/linked/rurn my
program on Windows 7 64bit. But on Linux I get errors
On 12/06/2013 02:06 AM, H. S. Teoh wrote:
On Thu, Dec 05, 2013 at 10:06:55PM +0100, Timon Gehr wrote:
On 12/05/2013 07:26 PM, Jonathan M Davis wrote:
The best that could be done would be to warn about the comparison
or to make it an error.
http://d.puremagic.com/issues/show_bug.cgi?id=259
...
You can compile with the verbose flag, -v, to make sure it
links as you expect it to. The linking command will be at the
bottom of the output.
Thank you! This has helped and I linked my program. As it turned
out dmd invoked gcc to link and it supplied my -ldl argument
first! I copy-pasted tha
Are there any Binary Data Serialization Libraries available
written in D2? I'm looking for something like a BSON read/write
library. (Although can be any other binary language really)
A dangerous topic for everyone :-)
I've been working with some unittests involving comparing the output of
different but theoretically equivalent versions of the same calculation. To my
surprise, calculations which I assumed would produce identical output, were
failing equality tests.
It se
On 12/06/2013 05:47 AM, Joseph Rushton Wakeling wrote:
> I decided to check by writing out the whole floating-point
> numbers formatted with %.80f. This confirmed my suspicion that the
> numbers were indeed identical.
Are they identical when printed with %a?
Ali
On 06/12/13 15:02, Ali Çehreli wrote:
Are they identical when printed with %a?
On my 64-bit Linux system, yes. I'll push an updated patch to test and see if
the various 32-bit systems report similar results (I was getting failures on
32-bit Darwin, BSD and Linux).
Thanks very much for the
On Friday, 6 December 2013 at 13:33:45 UTC, Jeroen Bollen wrote:
Are there any Binary Data Serialization Libraries available
written in D2? I'm looking for something like a BSON read/write
library. (Although can be any other binary language really)
vibe.d BSON :
https://github.com/rejectedsof
On 2013-12-06 13:33:44 +, Jeroen Bollen said:
Are there any Binary Data Serialization Libraries available written in
D2? I'm looking for something like a BSON read/write library. (Although
can be any other binary language really)
MessagePack - format very similar to BSON -
https://github
On 06/12/13 15:02, Ali Çehreli wrote:
Are they identical when printed with %a?
Yes. You can see some of the results here (for the 32-bit systems where I was
getting failures):
https://d.puremagic.com/test-results/pull.ghtml?projectid=1&runid=811923&logid=6
https://d.puremagic.com/test-result
On Friday, 6 December 2013 at 14:40:54 UTC, Max Klyga wrote:
On 2013-12-06 13:33:44 +, Jeroen Bollen said:
Are there any Binary Data Serialization Libraries available
written in D2? I'm looking for something like a BSON
read/write library. (Although can be any other binary language
really
On Friday, 6 December 2013 at 05:32:56 UTC, Mineko wrote:
On Friday, 6 December 2013 at 05:22:07 UTC, Ali Çehreli wrote:
On 12/05/2013 08:43 PM, Mineko wrote:
> I might be missing out on some D-only features
The first thing I've noticed is that you are not using UFCS,
perhaps because you don'
On 2013-12-06 14:25, Mafi wrote:
Thank you! This has helped and I linked my program. As it turned out dmd
invoked gcc to link and it supplied my -ldl argument first! I
copy-pasted that command into a shell and moved the -ldl to the very end
and it worked.
How do instruct dmd to do the same? As
Mineko:
https://github.com/MinekoRox/Breaker-3D-Game-Engine
Notes:
- Usually in D imports are at the top (after module name and
module ddoc).
- Perhaps io.getDir is better written an a switch on strings.
- I suggest to add the immutable/cost to every variable that
doesn't need to mutate, in
On Thursday, 5 December 2013 at 17:15:39 UTC, Steve Teale wrote:
Here I feel like a beginner, but it seems very unfriendly:
import std.stdio;
struct ABC
{
double a;
int b;
bool c;
}
ABC[20] aabc;
void foo(int n)
{
writefln("n: %d, aabc.length: %d", n, aabc.length);
if (n < aabc
On Thursday, 5 December 2013 at 18:26:48 UTC, Jonathan M Davis
wrote:
To be fair, you can't solve the problem automatically. It's
fundamentally
wrong to compare signed and unsigned values, and doing either
the conversion
to unsigned or to signed could be wrong (or both could be
wrong), dependin
On Friday, 6 December 2013 at 16:56:29 UTC, bearophile wrote:
Mineko:
https://github.com/MinekoRox/Breaker-3D-Game-Engine
Notes:
- Usually in D imports are at the top (after module name and
module ddoc).
I think it is a bad practice that should be discouraged. Moving
as much imports as po
Dicebot:
I think it is a bad practice that should be discouraged. Moving
as much imports as possible into local scope has lot of
practical benefits, primarily maintenance and compilation times.
Right. I was referring to the global ones.
Bye,
bearophile
On Friday, December 06, 2013 18:28:09 monarch_dodra wrote:
> On Thursday, 5 December 2013 at 18:26:48 UTC, Jonathan M Davis
>
> wrote:
> > To be fair, you can't solve the problem automatically. It's
> > fundamentally
> > wrong to compare signed and unsigned values, and doing either
> > the convers
I am using the derelict-sfml2 package in my code. My code:
import std.stdio;
import derelict.sfml2.window;
void main()
{
DerelictSFML2Window.load();
sfVideoMode videoMode = sfVideoMode(1280, 720);
sfWindow* window = sfWindow_create(videoMode, "Animation",
sfNone, null);
}
For
I have the following
void functionName(T)(T argumentVar)
{
/+
now i want that based on type of argumentVar, things will be
done
eg :
if there is a function gettype; then :
+/
switch(argumentVar.gettype)
{
case "string array":
//do something
On Fri, Dec 06, 2013 at 09:18:51PM +0100, seany wrote:
> I have the following
>
> void functionName(T)(T argumentVar)
> {
>
> /+
> now i want that based on type of argumentVar, things will be
> done
> eg :
> if there is a function gettype; then :
> +/
>
> switch(argumentV
Benji wrote:
> Hello,
> in order to have correctly displayed output (before reading
> something from stdin),
> I must call stdout.flush().
> Sometimes, it's really annoying, especially when it is necessarry
> to call it 10 times.
>
> For example:
> write("Enter some string: ");
> stdout.flush();
why do i need the static? (is that not supposed to prevent
insertations of new scopes inside the braces? is it really
needed?)
On Friday, 6 December 2013 at 20:58:15 UTC, seany wrote:
why do i need the static? (is that not supposed to prevent
insertations of new scopes inside the braces? is it really
needed?)
You can possibly use normal if but most likely you will get
compilation errors from other conditional branche
On Friday, 6 December 2013 at 20:39:22 UTC, Dejan Lekic wrote:
Benji wrote:
Is there any way to prevent this?
I doubt. Your IDE is buffering application's streams.
You know though, this happens often enough that maybe we should
just throw in a stdout.flush to the global readln function. I
On Friday, 6 December 2013 at 20:58:15 UTC, seany wrote:
why do i need the static? (is that not supposed to prevent
insertations of new scopes inside the braces? is it really
needed?)
'static if' means check this at compile time, which happens to
not introduce a new scope, because otherwise i
On Friday, 6 December 2013 at 19:50:52 UTC, Jeroen Bollen wrote:
I am using the derelict-sfml2 package in my code. My code:
import std.stdio;
import derelict.sfml2.window;
void main()
{
DerelictSFML2Window.load();
sfVideoMode videoMode = sfVideoMode(1280, 720);
sfWindow* window
On 12/05/2013 09:33 PM, Jesse Phillips wrote:
I don't think I understand what you mean:
this code illustrates it:
class Z {
string a() immutable {
return " 1";
}
string b() {
return "2";
}
}
template F(t) {
alias immutable(t) F;
}
alias typeof(&Z.init.a) T
Alright cool, I'll get on that real soon, I'm not too used to D's
importing system anyway, so I appreciate it. I suppose I'll have
to do some research on pure and nothrow too, I've never really
bothered with those.
On Friday, 6 December 2013 at 19:50:52 UTC, Jeroen Bollen wrote:
I am using the derelict-sfml2 package in my code. My code:
import std.stdio;
import derelict.sfml2.window;
void main()
{
DerelictSFML2Window.load();
sfVideoMode videoMode = sfVideoMode(1280, 720);
sfWindow* window
41 matches
Mail list logo