Re: a van Emde Boas tree

2019-02-05 Thread Martin Drašar via Digitalmars-d-announce
Dne 5.2.2019 v 16:47 Dejan Lekic via Digitalmars-d-announce napsal(a):
> On Tuesday, 5 February 2019 at 15:28:04 UTC, Alex wrote:
>> Hi all,
>> my van Emde Boas tree finally reached an announceable state, at
>> version 0.12.0.
> 
> vEB tree is an interesting data structure. Where is the implementation?
> - You did not provide any links...

I guess it is: https://code.dlang.org/packages/vebtree


Re: SDL2 texture blend help

2017-12-13 Thread Martin Drašar via Digitalmars-d
Dne 13.12.2017 v 4:03 Ivan Trombley via Digitalmars-d napsal(a):
> On Wednesday, 13 December 2017 at 01:44:33 UTC, Dmitry wrote:
>> On Tuesday, 12 December 2017 at 23:28:23 UTC, Ivan Trombley wrote:
>>> Here's the code that produces the correct results (exactly the same
>>> as GIMP):
>> Share images you used, please.
> 
> Background image:
> http://a4.pbase.com/o10/09/605909/1/166706859.XKZZCnSO.background.png
> 
> Foreground image:
> http://a4.pbase.com/o10/09/605909/1/166706860.c1yD4VWp.image.png
> 
> Composited through SDL:
> http://a4.pbase.com/o10/09/605909/1/166706869.wLt9RofY.sdl.png
> 
> Composited in GIMP 2.9:
> http://a4.pbase.com/o10/09/605909/1/166706870.S01BIhVG.gimp.png
> 
> When composited using the code I posted looks exactly like the GIMP 2.9
> image.

I am not sure, about the tool you use to view the images, but on my side
(Firefox browser) the sdl and gimp output are very different. Maybe some
gamma shenanigans going on? Maybe related to PNG Gamma correction...


Re: remake of remake of Konami's Knightmare

2017-11-23 Thread Martin Drašar via Digitalmars-d-announce
Dne 23.11.2017 v 13:18 ketmar via Digitalmars-d-announce napsal(a):
> recently i worked on remake of DOS remake of Konami's Knightmare
> game[0]. the game is playable now, it has music from original MSX
> Knightmare, and sfx/gfx/levels from DOS remake. it is written in D, of
> course, and it is FOSS. you can find the sources here[1].
> 
> as usual, you'll need my IV modules[2], and Adam's ARSD modules[3].
> the code won't work on 64-bit arches, tho (due to some bugs in sdpy/iv).
> but it can be compiled for 32-bit GNU/Linux, and 32-bit windows.
> 
> here is windows binary for those who cannot (or don't want to) build the
> binary[4].
> 
> WARNING! the code is a partial port of old DOS turbo pascal sources, so
> it is *very* far from something even remotely sane.
> 
> it is not polished yet, but that should not stop you! play this
> excellent classic shooter while it is hot! ;-)
> 
> some tech info: arsd.simpledisplay is used for video (with OpenGL
> backend), arsd.simplesound for audio (with my AY-8910 emulator), iv.vfs
> for VFS support. as the game designed for 20 FPS, i didn't bother
> avoiding GC (that is, the engine allocates like crazy).
> 
> enjoy, and happy hacking!
> 
> 
> [0] https://en.wikipedia.org/wiki/Knightmare_(1986_video_game)
> [1] http://repo.or.cz/knightmare.git
> [2] http://repo.or.cz/iv.d.git
> [3] https://github.com/adamdruppe/arsd
> [4] http://files.catbox.moe/z19j91.7z

Neat! Instead of working, I was spamming shift like crazy...

Now, when you say a partial port, did you make some automated
translation or it is just a manual labor with lotta love?

Martin


Re: Using lazy code to process large files

2017-08-02 Thread Martin Drašar via Digitalmars-d-learn
Dne 2.8.2017 v 14:45 Steven Schveighoffer via Digitalmars-d-learn napsal(a):

> The problem is that you are 2 ranges deep when you apply splitter. The
> result of the map is a range of ranges.
> 
> Then when you apply stringStripleft, you are applying to the map result,
> not the splitter result.
> 
> What you need is to bury the action on each string into the map:
> 
> .map!(a => a.splitter(",").map!(stringStripLeft).join(","))
> 
> The internal map is because stripLeft doesn't take a range of strings
> (the result of splitter), it takes a range of dchar (which is each
> element of splitter). So you use map to apply the function to every
> element.
> 
> Disclaimer: I haven't tested to see this works, but I think it should.
> 
> Note that I have forwarded your call to join, even though this actually
> is not lazy, it builds a string out of it (and actually probably a
> dstring). Use joiner to do it truly lazily.
> 
> I will also note that the result is not going to look like what you
> think, as outputting a range looks like this: [element, element,
> element, ...]
> 
> You could potentially output like this:
> 
> output.write(result.joiner("\n"));
> 
> Which I think will work. Again, no testing.
> 
> I wouldn't expect good performance from this, as there is auto-decoding
> all over the place.
> 
> -Steve

Thanks Steven for the explanation. Just to clarify - what would be
needed to avoid auto-decoding in this case? Process it all as an arrays,
using byChunk to read it, etc?

@kdevel: Thank you for your solution as well.

Martin


Re: Using lazy code to process large files

2017-08-02 Thread Martin Drašar via Digitalmars-d-learn
Dne 2.8.2017 v 14:11 Daniel Kozak via Digitalmars-d-learn napsal(a):
> import std.stdio;
> import std.algorithm;
> 
> void main()
> {
> 
> 
> auto input  = ["... some text, another text", "some,another","...so,an"];
> 
> auto result = input.filter!(a => a.startsWith("..."))
>   .map!(a=>a.splitter(",").map!(a=>a.stripLeft(' ')))
>   .map!(a=>a.joiner(","));
> writeln(result);
> }


Thanks a lot. That did the trick.

Martin



Using lazy code to process large files

2017-08-02 Thread Martin Drašar via Digitalmars-d-learn
Hi,

I am struggling to use a lazy range-based code to process large text
files. My task is simple, i.e., I can write a non-range-based code in a
really short time, but I wanted to try different approach and I am
hitting a wall after wall.

Task: read a csv-like input, take only lines starting with some string,
split by a comma, remove leading and trailing whitespaces from splitted
elements, join by comma again and write to an output.

My attempt so far:

alias stringStripLeft = std.string.stripLeft;

auto input  = File("input.csv");
auto output = File("output.csv");

auto result = input.byLine()
   .filter!(a => a.startsWith("..."))
   .map!(a => a.splitter(","))
   .stringStripleft // <-- errors start here
   .join(",");

output.write(result);

Needless to say, this does not compile. Basically, I don't know how to
feed MapResults to splitter and then sensibly join it.

Thank you for any hint.
Martin


Re: Passing macros from commandline or enumerating versions

2017-03-08 Thread Martin Drašar via Digitalmars-d-learn
Dne 7.3.2017 v 22:36 Adam D. Ruppe via Digitalmars-d-learn napsal(a):
> The way I like to do it is to pass a module on the command line that
> contains the custom config. So in the app:
> 
> ---
> import myapp.config;
> 
> // use the variables defined in there like normal
> ---
> 
> 
> Now, to define a config file, you do something like:
> 
> 
> myconfiguration.d # note that the file name can be anything!
> ---
> module myapp.config; // but each must use this same module config
> 
> enum some_key = "some_value";
> // and so on
> ---
> 
> Now, when you compile, you build it with a particular config by passing
> one of those files to the compile:
> 
> dmd myapp.d myconfiguration.d # or whatever single config you want
> 
> 
> 
> Then you can define as much as you want in the config module, and have
> as many of them as you want too.

Yeah, that's definitely an option, but I expect to have troubles with
DUB if I use this approach. Also, I need these files to be json, not a D
code, because the same configuration mechanism can be used during
runtime and I need to parse these files easily.

So far, I incline to have a build script run separate builds and copying
different configuration files to one predefined and hardcode its name
into a string import, thus sidestepping the problem.

Anyway, thanks for an idea.

Martin




Passing macros from commandline or enumerating versions

2017-03-07 Thread Martin Drašar via Digitalmars-d-learn
Hi,

I was wondering, if there is a way to pass a macro with value to the
compiled program, i.e., something like -Dfoo="bar". And if that is not
possible, if there is a way to enumerate all set versions.

I want my application built with different string imported
configurations and I have no idea how to tell compiler which
configuration to choose, other than hardcoding it.

Thanks,
Martin


Re: Box2D Lite D Port (Yet Another)

2016-10-31 Thread Martin Drašar via Digitalmars-d-announce
Dne 31.10.2016 v 10:56 ketmar via Digitalmars-d-announce napsal(a):
>> I am asking, because it seems to contain some nice things (like a sat
>> solver port) that may help others and could benefit from being more
>> accessible than only with a programmer's spelunker gear. And I am
>> saying this with full knowledge of your passionate hate for github and
>> to some extent for dub.
> i investigated the possibility of having IV as collection of DUB
> projects (again), and it is still too intrusive. alas. actually, i'd
> like to feature IV as a set of libraries with dependencies on
> code.dlang.org, so people can easily use 'em, but DUB isn't very
> tolerant to things that aren't done in "DUB way". i am really saddened
> by that, but i have no desire to work on DUB, neither to "dubify" my
> workflow.

Got it.

> i'm trying to help those who wants to use my code, tho. ;-) i'm usually
> available on IRC.

Ok, that is also a good option :-) I will ping you if I find myself
needing an assistance.

Thanks.


Re: DlangUI 0.9.0: Console backend added

2016-09-09 Thread Martin Drašar via Digitalmars-d-announce
Dne 9.9.2016 v 13:21 Vadim Lopatin via Digitalmars-d-announce napsal(a):
> Hello!
> 
> Now it's possible to build DlangUI apps to run in console (Linux, Windows).
> When DlangUI is built with version=USE_CONSOLE (dub subconfiguration
> "console" for dlangui library) - it works in terminal.

This is indeed really cool.

How gracefully does it handle when the console is of limited size? Let's
say 80x25. Does it allow e.g. virtual screen of bigger size and then
moving around in console?

Martin



Re: IDE - Coedit 2, update 2 released

2016-03-19 Thread Martin Drašar via Digitalmars-d-announce
Dne 16.3.2016 v 13:41 Basile B. via Digitalmars-d-announce napsal(a):
> Maybe in the next major version.
> 
> Actually there's already a draft (see the source named ce_gdb.pas) but
> it's not activated because it was really not worth. The only feature
> that was implemented is the breaking on custom breakpoint and on
> exceptions and any other command had to be typed manually. Visually, the
> widget was just a made of a toolbar (start stop continue, step, etc) a
> big memo that displayed GDB output stream and at the bottom a field
> allowing to type gdb commands. Barely more friendly than a gdb cession
> in a console ;)

Cool! My Pascal days are long over, so I am not sure if I will be to
understand the source, nevertheless, having debug in preparation is
great news.


Re: IDE - Coedit 2, update 2 released

2016-03-15 Thread Martin Drašar via Digitalmars-d-announce
Dne 15.3.2016 v 3:09 Basile B. via Digitalmars-d-announce napsal(a):
> see https://github.com/BBasile/Coedit/releases/tag/2_update_2

Nice work!

Any chance of getting debugging support eventually? I would love to
ditch Visual Studio.


Re: extern(C++, ns)

2016-01-20 Thread Martin Drašar via Digitalmars-d
Dne 20.1.2016 v 23:01 Walter Bright via Digitalmars-d napsal(a):
> I understand his suggestion. I asked Manu to elaborate what the "serious
> problems" are. This code snippet doesn't work as it is not supposed to
> work, but still unknown is what the "serious problem" with it is - and I
> want to ensure that Manu knows this is not a bug in the implementation.

Bugs in implementation are a separate concern. The "serious" problem is
that the decision to have a namespace introduce a new scope needlessly
complicates writing D-like interfaces to C++ code, while catering for
one specific use-case that is considered niche.

Everything in this thread has been repeated at least three times. Yet
you still stand by your design decision and offer more or less
convoluted ways to deal with it.

I guess that at this point it would be great to introduce some hard
data. For example, how often would you encounter the problem with the
same identifiers distinguished by namespaces, if you tried to interface
to some typical C++ libraries. Because, unless you really must have your
interface in one file, this should be fairly rare (at least from my
experience).

Martin


Re: extern(C++, ns)

2016-01-13 Thread Martin Drašar via Digitalmars-d
Dne 13.1.2016 v 7:51 Walter Bright via Digitalmars-d napsal(a):
> If you like:
> 
> extern (C++) {
> int a;
> extern (C++,ns) {
> int a;
> }
> }
> 
> The whole point of scoped names is to be able to do this.
> 
> Also, I would expect to be able to access "ns.a" with the syntax "ns.a",
> meaning ns has to be a scope.

The question is, how often would you want to do that in a real-world
scenarios? By catering for this particular use-case, things got
needlessly more complicated. It is quite strange that you consider using
D's module system as awkward, yet you have no problem with all the
convoluted solutions to Manu's problem.

The scoping introduces only a poor man's analogy to C++ namespaces. As
was pointed out by others, the same namespace tends to reside in many
C++ files and if you attempt to mimic that file structure in D, you will
have to disambiguate. Which leaves you with a weird combination of
module system and namespaces.

Your solution with Rainer's example on map and vector is to _not_ use
the namespace at all, which is in conflict with your statement that you
'would expect to be able to access "ns.a" with the syntax "ns.a"'.

>> Of course, it would save a lot of effort if you agreed that the design
> is wrong, and none of us need to do anything further.
> 
> I regard it as crucial to determine the cause of your problems before
> assuming it is the design.

I am with Manu on this one. Introducing scoping to C++ namespaces is a
design mistake, because it fails to deliver on its promise to emulate
true C++ namespaces. Namespaces in extern declaration should only affect
linking and leave everything else to D's module system.

Martin




Re: "Good PR" mechanical check

2016-01-12 Thread Martin Drašar via Digitalmars-d
Dne 12.1.2016 v 14:34 Andrei Alexandrescu via Digitalmars-d napsal(a):
> Related to https://github.com/D-Programming-Language/dlang.org/pull/1191:
> 
> A friend who is in the GNU community told me a while ago they have a
> mechanical style checker that people can run against their proposed
> patches to make sure the patches have a style consistent with the one
> enforced by the GNU style. I forgot the name, something like
> "good-patch". I'll shoot him an email.
> 
> Similarly, I think it would help us to release a tool in the tools/ repo
> that analyzes a would-be Phobos pull request and ensures it's styled the
> same way as most of Phobos: braces on their own lines, whitespace
> inserted a specific way, no hard tabs, etc. etc. Then people can run the
> tool before even submitting a PR to make sure there's no problem of that
> kind.
> 
> Over the years I've developed some adaptability to style, and I can do
> Phobos' style no problem even though it wouldn't be my first preference
> (I favor Egyptian braces). But seeing a patchwork of styles within the
> same project, same file, and sometimes even the same pull request is
> quite jarring at least to me.
> 
> Who would like to embark on writing such a tool?
> 
> 
> Thanks,
> 
> Andrei

Wouldn't it be sufficient to mandate usage of dfmt with proper settings
before submitting a PR?

Martin



smime.p7s
Description: Elektronicky podpis S/MIME


Re: Regex benchmarks in Rust, Scala, D and F#

2016-01-05 Thread Martin Drašar via Digitalmars-d
Dne 5.1.2016 v 19:09 deadalnix via Digitalmars-d napsal(a):
> On Tuesday, 5 January 2016 at 17:52:39 UTC, Karthikeyan wrote:
>> Hi,
>>
>> Came across this post in rust-lang subreddit about the regex
>> benchamrks. Scala surprisingly outperforms D. LDC also gives a good
>> advantage for efficiency of D.
>>
>> http://vaskir.blogspot.ru/2015/09/regular-expressions-rust-vs-f.html
> 
> I'm willing to bet the bad result D has come from the use of DMD.
> 
> Honestly, pushing DMD as the reference implementation cost us quite a
> lot on the PR side of things. D appears to be slower that it really is.

To be fair, they have results for DMD and LDC:

regex - 10.6 s (DMD), 7.8 s (LDC)
ctRegex! - 6.9 s (DMD), 6.6 s (LDC)

Although no information about compiler switches.


Re: Please vote for the DConf logo

2015-11-14 Thread Martin Drašar via Digitalmars-d-announce
Dne 13.11.2015 v 15:52 anonymous via Digitalmars-d-announce napsal(a):
> On 13.11.2015 15:22, Andrei Alexandrescu wrote:
>> By my count:
>>
>> * 1.1:xxx
>> * 1.2:xxx
>> * 2:  xxx
>> * 3:  xx
>> * 3, change font: xxx
>>
>> So 3 by "anonymous" is it!
> 
> Whee!
> ...
> I/we should make an SVG version that uses paths instead of , so
> that it doesn't depend on a local font. Maybe agree on the font first,
> though.

Yes please. Although I have some reservations against the png font, it
is way better and visually pleasing than the svg serif font (or at least
the one I see).



smime.p7s
Description: Elektronicky podpis S/MIME


Re: 1st Ever Artificial Consciousness to be Written in D Language

2015-09-02 Thread Martin Drašar via Digitalmars-d-announce
Dne 2.9.2015 v 16:41 GrandAxe via Digitalmars-d-announce napsal(a):
> This is to inform the D Language community that the first viable general
> artificial algorithm is being written in D. It is called Organic Big
> data intelligence (OBI); the website is at www.okeuvo.com.
> 
> Some of its capabilities are:
> 
> 1. Ability to learn
> 2. Ability to analyse
> 3. Problem solving
> 4. Moral judgement
> 5. Ability to feel emotions
> 6. Free will
> 7. Consciousness
> 8. Self awareness
> 
> D Language was chosen for its versatility. It is a language with high
> level syntax and low capabilities, as well as excellent performance and
> being open source.
> 
> Unnetworked personal mobile devices are the target platform for the
> standard implementation of OBI. A demonstration release is scheduled for
> the end of this month (September 2015). The demonstration release will
> comprehend English prose only, later releases will be able to process
> input from other languages, as well as sensory input.
> OBI will be a mixture of open and closed source modules.
> 
> To God be the Glory.
> 
> Asame Obiomah

Umm... not that I would not like an AI like this written in D, but this
is probably the most extraordinary claim I have seen in some time. And
no extraordinary evidence seems to be available.

Also, points 4 - 8 scream SCAM! all around. Especially when there is no
credible research linked to the name of Asame Obiomah.

So, let's just hope that the linked page was not an attack vector and
this is not jsut an elaborate social engineering :-)

Martin



smime.p7s
Description: Elektronicky podpis S/MIME


Re: 1st Ever Artificial Consciousness to be Written in D Language

2015-09-02 Thread Martin Drašar via Digitalmars-d-announce
Dne 2.9.2015 v 19:10 GrandAxe via Digitalmars-d-announce napsal(a):
> Scam?! I haven't asked you for a farthing, so what nonsense are you
> talking about?
> 
> Why not just wait until the end of September before you explore the
> limits of rudeness?

That's just an observation based on experience with projects that
promised the world, yet had not delivered. If your project turns out to
be different, I'll be the first to apologize.

> On my website there is a picture I claim to be of myself at a ceremony
> to receive an award from Microsoft. Surely, it isn't that much of a
> stretch to ask Microsoft if they ever gave a certain Asame Obiomah an
> award, is it?

I have never doubted that you are who you say you are. I am not even
doubting your award. Why would I? I am just saying that there is no
credible research with your name on it.

> After you have verified that, you can go a step further; no, go the
> whole hog; tell the police that someone is scamming the world with the
> term "patent pending" with which I refer to OBI at www.okeuvo.com.
> Surely, a "clever" sod like you would know that it is a crime to abuse
> the term "patent pending."

I do not know that. Then again, I most likely live in a different
country with different take on patents. Here it would probably be a
civil issue, not a criminal one. Also, in a world of software, patents
were awarded for a bunch of stupid things (see 1-click patent), so
having a pending patent does not say that much.

Martin



smime.p7s
Description: Elektronicky podpis S/MIME


Re: [OT] Sharp Regrets: Top 10 Worst C# Features

2015-08-19 Thread Martin Drašar via Digitalmars-d
Dne 19.8.2015 v 3:12 Adam D. Ruppe via Digitalmars-d napsal(a):
 I just saw this link come by my desktop and I thought it was an
 interesting read because D does a lot of these things too, and avoids
 some of them:
 
 http://www.informit.com/articles/article.aspx?p=2425867
 
 I don't agree they are all mistakes, but it is a pretty quick and
 interesting read.

I really liked this bit that reminded me of endless discussions in this
mailing list:

 The moral is simple: You can't see the future, and you can't break
 backward compatibility once you get to the future. You make rational
 decisions that reach reasonable compromises, and you'll still get it
 wrong when requirements change unexpectedly. The hardest thing about
 designing a successful language is balancing simplicity, clarity,
 generality, flexibility, performance, and so on.





smime.p7s
Description: Elektronicky podpis S/MIME


Re: Future(s) for D.

2015-06-24 Thread Martin Drašar via Digitalmars-d
Dne 24.6.2015 v 11:07 Chris via Digitalmars-d napsal(a):
 Speaking of which, just found this in a job add (no joke). Sure, who
 doesn't have all of these qualifications:
 
 Required
 
 Doctorate Degree
 At least 5 years experience in the areas of information extraction
 and machine learning
 At least 1 year experience in publication in top-tier research
 conferences and journals
 At least 3 years experience in programming in Java and C++
 At least 1 year experience in open source NLP tools (i.e., Stanford
 NLP, OpenNLP)
 English: Fluent
 
 
 Preferred
 
 At least 1 year experience in one of the following domains: question
 answering, textual entailment, machine reading
 At least 1 year experience in software engineering
 At least 6 months experience in experience with speech processing

There are definitely people like this. If you focused your Ph.D. on
machine learning, than you likely qualify for most of the requirements.

Then again, there can just be an obligation to post this job add as a
requirement for getting grant money for a project (many EU projects have
this), but you have your own person in mind for the job, so you fit the
add for her.

Martin



smime.p7s
Description: Elektronicky podpis S/MIME


Re: Future(s) for D.

2015-06-24 Thread Martin Drašar via Digitalmars-d
Dne 24.6.2015 v 14:15 Chris via Digitalmars-d napsal(a):
 Sure, this smells like a job description tailor made for someone they
 already have in mind. However, I wonder what experience means. Yeah,
 I've played around with Java and C++ or I'm really into the two
 languages and know them very well. People who do research for their PhD
 in computational linguistics are often _familiar_ with programming
 languages but not necessarily to a degree that allows them to write real
 world production code, because it is very hard to excel in programming,
 data algorithms, NLP and academic research (literature review, writing
 the PhD) at the same time.

If you let researchers write production code, you are asking for
troubles. And that comes from someone who is doing research, is a
programming enthusiast and had programming as a day job for some time.

If I made such job add, the most important for me would be the ML
experience and publication skills. This is something you can't teach in
a short time. As for the rest of it - it would be good enough that the
candidates would not hurt themselves while using those tools and
languages. At least there will be less unlearning to do...

Martin



smime.p7s
Description: Elektronicky podpis S/MIME


Re: DDocs.org: auto-generated documentation for all DUB projects (WIP)

2015-02-11 Thread Martin Drašar via Digitalmars-d-announce
Dne 10.2.2015 v 23:40 Kiith-Sa via Digitalmars-d-announce napsal(a):
 DDocs.org (http://ddocs.org) is a repository of documentation for DUB
 projects that automatically re-generates docs as new
 projects/releases/branch changes are added.
 
 ...

That is fantastic! I always wanted something like CPAN for D...
Thanks




smime.p7s
Description: Elektronicky podpis S/MIME


Re: DlangIDE

2015-02-11 Thread Martin Drašar via Digitalmars-d-announce
Dne 11.2.2015 v 14:16 Vadim Lopatin via Digitalmars-d-announce napsal(a):

 Matching [ { ( ) } ] highlight is implemented
 
 Delete line is available with Ctrl+Y
 Indent/unindent - new shortcuts added Ctrl + [ ]

Hi, when you say that a certain combination is used for something, does
that mean that you are not supporting setup of actions for key
combinations? So I could, e.g., map Ctrl+L or Shift-Del as line delete
as in Notepad++ or Visual Studio respectively?

Anyway, it is a nice project. Thanks for doing that!

Martin



smime.p7s
Description: Elektronicky podpis S/MIME


Re: Czech D community

2015-01-31 Thread Martin Drašar via Digitalmars-d
Given the overwhelming number of responses you received, I would suggest
to adhere to Kiith-Sa's suggestion of dropping the idea of a czech-only
forum. I think that we are more likely to meet for a beer than to make
such forum alive in near future.

Martin



smime.p7s
Description: Elektronicky podpis S/MIME


Re: [website redesign] PR for the one with the big red menu bar

2015-01-28 Thread Martin Drašar via Digitalmars-d
Dne 27.1.2015 v 21:02 anonymous via Digitalmars-d napsal(a):
 PR: https://github.com/D-Programming-Language/dlang.org/pull/869 - For
 details see here.
 Live version: http://ag0aep6g-dlang.rhcloud.com - If you've visited this
 before, you may have to clear your cache to see the proper logo color.

I generaly dislike the flatening trend in design, i.e., removing button
borders and such, but all in all it looks fresh and streamlined. I have
however issues with navigation - once I click on standard library I
can't go back to upper level. Also the link to code.dlang.org is named
more libraries in top-level and 3rd party packages in phobos level.
I would vote for consistency.

Also the darker color looks better imho.

Martin





smime.p7s
Description: Elektronicky podpis S/MIME


Re: Czech D community

2015-01-25 Thread Martin Drašar via Digitalmars-d
Dne 25.1.2015 v 19:23 Daniel Kozak via Digitalmars-d napsal(a):
 Cus,
 
 je tady nekdo z ceska? Vlastnim domenu dlang.cz a mam v planu tam rozchodit
 stranky tykajici se jazyka D (navody, dokumetaci, forum, mozna i neco
 jako knihu o Decku).
 
 Pokud ano a mate zajem se na tom jakkoliv podilet pripadne mate namety
 na to co by tam melo byt budu rad za jakekoliv pripominky.

Ahoj, jsem tu :)
Jakekoliv rozsirovani povedomi o Dcku v ceskych luzich i hajich se
urcite hodi. Klidne bych se na tom i podilel, ale nejsem si uplne jisty,
kolik casu tomu budu schopen venovat.

Pokud jde o namety a napady, tak by se urcite hodily nejake preklady.
Napriklad Aliho knizka, nebo Philippova o sablonach, pripadne cokoliv
zakladniho, co vzejde ze soucasneho usili o vylepseni anglickeho webu.

A jinak samozrejme jakekoliv tutorialy pro typicke use-casy...

Budu chtit vypisovat bakalarky a diplomky, ktere by pouzivaly Dcko,
takze pokud bych mohl nekam odkazovat ty mene jazykove vybavene, tak by
se to urcite hodilo.

A taky by me uprimne zajimalo, jak velka je ceska komunita ;-)

Martin

 / english //
 
 Hi
 
 Is there anybody from Czech? I own dlang.cz domain and I like to make czech
 pages about D (tutorials, some czech documentation, forum, maybe book)
 
 If yes and want to help or make some suggestions please do not hesitate
 and contact me.

... some czech blabbering ...




smime.p7s
Description: Elektronicky podpis S/MIME


Re: dlang.org redesign -- the state of documentation and learning resources [part 2]

2015-01-23 Thread Martin Drašar via Digitalmars-d
Dne 23.1.2015 v 19:16 Andrei Alexandrescu via Digitalmars-d napsal(a):
 Both are nice:
 
 http://tour.golang.org/welcome/1
 http://rustbyexample.com/

Or something along the lines of https://tryhaskell.org
With possible integration with D REPL.



smime.p7s
Description: Elektronicky podpis S/MIME


Re: How to prevent sensitive information is displayed when the extension 'exe' is modified to 'txt' on windows?

2015-01-07 Thread Martin Drašar via Digitalmars-d-learn
Dne 7.1.2015 v 12:00 Laeeth Isharc via Digitalmars-d-learn napsal(a):
 

 What you want is some kind of code obfuscation. The easiest thing for
 you is to use exe compression. It is not going to stop a dedicated
 attacker, but ordinary people will not be able to extract any
 information from it.
 
 And I guess as an alternative to the utility you linked to, you could
 use D's ability to run code at compile time to encrypt your sensitive
 literals during compilation and then decrypt them on program startup.

I don't think you would really need any compile time capabilities. You
could just xor your strings and xor them again before using them to make
it reasonably unreadable. But the thing is that doing these changes
inside the code adds unnecessary complexity and is a potential source of
bugs. Using an exe packer has the advantage of being practically a
one-click solution.



smime.p7s
Description: Elektronicky podpis S/MIME


Re: How to prevent sensitive information is displayed when the extension 'exe' is modified to 'txt' on windows?

2015-01-06 Thread Martin Drašar via Digitalmars-d-learn
Dne 6.1.2015 v 18:15 FrankLike via Digitalmars-d-learn napsal(a):
 How to prevent sensitive information is displayed when the extension
 'exe' is modified to 'txt' on windows?
 
 If you build a exe ,such as which can get Data from DataBase,when you
 modify the exe's  extension to 'txt',
 and you open it by notepad.exe (on windows),you will find the info,it's
 important for me,so how to stop  the info to display  ?
 
 
   Driver={SQL Server Native Client
 10.0};Server=127.0.0.1;Database=test;Trusted_Connection=Yes\   €`B
 SELECT top 10 * FROM testtable     鑐B atest.d    aB
 testcolumnname  aB std.stdio.File err.text    GaB w      XaB
 error :
    haB  @ 
 
 
 Thank you.

What you want is some kind of code obfuscation. The easiest thing for
you is to use exe compression. It is not going to stop a dedicated
attacker, but ordinary people will not be able to extract any
information from it.

http://upx.sourceforge.net/

Martin



smime.p7s
Description: Elektronicky podpis S/MIME


Re: Error: function declaration without return type.

2015-01-06 Thread Martin Drašar via Digitalmars-d-learn
Dne 6.1.2015 v 22:25 Suliman via Digitalmars-d-learn napsal(a):
 On Tuesday, 6 January 2015 at 21:19:38 UTC, bearophile wrote:
 Suliman:

 void foo()
 {
 writeln(test);
 writeln(mystring);
 }
 foo();   
 }

 I guess you have to remove that line.

 Bye,
 bearophile
 
 Why? I can't call function in instance of class?

What would that even mean? When would the function ran? If you want to
call that function during instantiation, put it into constructor. If you
want to call it sometime later, than you have to call it from somewhere
else. But having a function call inside a class does not compute...

Martin



smime.p7s
Description: Elektronicky podpis S/MIME


Re: Very short anonymous survey

2014-12-10 Thread Martin Drašar via Digitalmars-d
Dne 10.12.2014 v 6:33 Anonymous via Digitalmars-d napsal(a):
 Hello all,
 
 If I could have a minute of your time for a short anonymous survey
 regarding D libraries and tools, I'd really appreciate it.
 
 http://goo.gl/forms/lMrHRr335C
 
 
 This is explained further in the link above, but for context: I'm a
 developer working on a library for D that I need for an application I'd
 like to write in D. I need the community's opinion of paying for builds
 of open source software, as my library requires extra work to build and
 cannot be built with just dub. I want to make it as easy as possible for
 others to use the library, but providing/maintaining builds for
 different compilers and platforms is time-consuming and costly.
 
 Thanks for your time!

Hi,

I would like to fill out your survey, but the description makes it too
abstract for me to reasonably choose my answers.

The price I am willing to pay for a piece of software is always dictated
by the prices of other software available and by returns of the software
I am programming (be it money or just joy).

You wrote some interesting things:
However, this library has some *very* large generated sources, which
makes it difficult (if not impossible) to compile using common D tools
(namely, dub). It is using a different build system, which allows it to
generate and build quite easily, but would likely create headaches for
dub users.

These are some strong claims, would you care to back them up with some
numbers?

Also, could you give more details about the library? Or the build
system? It may turn out that the library itself is not likely to be a
source of your income, but the build system can be. Who knows... Unless
you give more details, you are not likely to get reasonable answers.

Just my opinion...

Martin



smime.p7s
Description: Elektronicky podpis S/MIME


Re: Programming in D book, draft of the first print edition and eBook formats

2014-11-26 Thread Martin Drašar via Digitalmars-d-announce
This is HUGE!

I've gone through many of your chapters, but it was just now, after
seeing it as a one 700 pages long book, that I truly realized how much
of a work this must have been.

Thank you. Can't wait to have it on the shelf...

Martin



smime.p7s
Description: Elektronicky podpis S/MIME


Re: What are the worst parts of D?

2014-10-13 Thread Martin Drašar via Digitalmars-d
Dne 13.10.2014 v 23:09 ketmar via Digitalmars-d napsal(a):
 as i can't publish my current version of cmdcon, i decided to write
 another one from scratch. it contains alot less of mixin() codegens,
 can do everything cmdcon.d can do and has structs/classes already
 working. this is the excerpt from testing code:

Nice! That's what I call a can-do attitude :) I just happen to have a
nice place in code where it can get used. I'm looking forward for
playing with it.

Martin



smime.p7s
Description: Elektronicky podpis S/MIME


Re: Make const, immutable, inout, and shared illegal as function attributes on the left-hand side of a function

2014-10-09 Thread Martin Drašar via Digitalmars-d
Dne 9.10.2014 v 10:50 Martin Nowak via Digitalmars-d napsal(a):
 Would this affect your code?

yes, but I understand the rationale so I don't mind

 Do you think it makes your code better or worse?

less ambiguous, so I would say better

 Is this just a pointless style change?

no

--
Martin




smime.p7s
Description: Elektronicky podpis S/MIME


Re: What are the worst parts of D?

2014-10-06 Thread Martin Drašar via Digitalmars-d
Dne 3.10.2014 v 16:42 ketmar via Digitalmars-d napsal(a):
 alas, only very old and rudimentary module is available. basically,
 it's the core of the full-featured console, but... only the core, and
 not very well written. i'm planning to opensource fully working thingy
 with bells and whistles eventually, but can't do it right now. :-(
 
 anyway, here it is:
 http://repo.or.cz/w/iv.d.git/blob_plain/HEAD:/cmdcon.d
 
 please note that this is not very well tested. i'm keeping it just for
 nostalgic reasons.
 
 ah, and you can ignore the license. consider that code as public
 domain/WTFPL.
 
 there is no struct/class support there, only variables and free
 functions. yet free functions supports various types of arguments and
 understands default agrument values.

Thanks a lot. I just briefly gone through the code and I have a question
about the console use:

That code is able to register functions and variables with some
annotations and execute them by string commands. How do you generally
use it for debugging purposes? That is, how do you use this console
interactively? In your previous mail you wrote that you use a telnet. Do
you have another mixin that at some specific point inserts a code that
pauses the execution of surrounding code and starts listening for telnet
commands?

Also, how do you make your console work in multithreaded programs?

Thanks,
Martin




smime.p7s
Description: Elektronicky podpis S/MIME


Re: What are the worst parts of D?

2014-10-06 Thread Martin Drašar via Digitalmars-d
Dne 6.10.2014 v 12:15 ketmar via Digitalmars-d napsal(a):
 On Mon, 06 Oct 2014 10:22:01 +0200
 Martin Drašar via Digitalmars-d digitalmars-d@puremagic.com wrote:
 
 as i said this is the very first version of cmdcon, not the one i'm
 using now. i'm not able to publish the current version yet.
 
 That is, how do you use this console interactively?
 In your previous mail you wrote that you use a telnet.
 Do you have another mixin that at some specific point inserts a code
 that pauses the execution of surrounding code and starts listening
 for telnet commands?
 it depends of event loop, actually. i have my own event loop code, and
 there is hook for telnet channel. that hook collects line to execute,
 calls cmdcon executor and outputs cmdcon output. maybe i'll publish
 some std.socket-based sample later.
 
 Also, how do you make your console work in multithreaded programs?
 you should register only shared and global vars (and i'm really missing
 __trait(isGShared) here!), there is no sense to register thread locals
 in multithreaded program.
 
 but you can register free functions and execute 'em. that free
 functions should take care of threading.
 
 really, i have to revisit that code and write some samples. i'll try to
 do that soon. and maybe i'll update public versino of cmdcon a little
 too. ;-)
 

Ok, thanks for your answers. If you get your code to publishable state,
I am sure a lot of people will be interested.

Cheers,
Martin



smime.p7s
Description: Elektronicky podpis S/MIME


Re: What are the worst parts of D?

2014-10-03 Thread Martin Drašar via Digitalmars-d
Dne 2.10.2014 v 19:02 ketmar via Digitalmars-d napsal(a):
 On Thu, 02 Oct 2014 16:45:21 +
 via Digitalmars-d digitalmars-d@puremagic.com wrote:
 
 That's pretty cool, so you basically use the reflection 
 capabilities of D to generate your own custom CLI to the 
 application?
 yes. some naming conventions and one mixin -- and all interesting
 variables and functions from the given module are automatically
 registered in command console. so i can inspect and change variables
 and fields, call free functions and class/struct member functions, even
 write simple scripts. it's really handy. and i connect to this console
 using telnet (if telnet support is activated).
 
 this also allows some forms of unified automated testing even for GUI
 apps, all without building special debug versions, i.e. on production
 code.
 

That is mighty interesting. Would you be willing to share some code?
Right now, I am teaching my students about debugging in C/C++ and I want
to give them some perspective from other languages and environments.

Thanks.
Martin



smime.p7s
Description: Elektronicky podpis S/MIME


Re: Voting: std.logger

2014-07-29 Thread Martin Drašar via Digitalmars-d

Dne 29.7.2014 7:11, Dicebot via Digitalmars-d napsal(a):

(sorry for being a bit late, was distracted)

std.logger proposal by Robert Schadek enters voting period which will
last two weeks starting from now.

Discussion thread :
http://forum.dlang.org/post/zhvmkbahrqtgkptdl...@forum.dlang.org

This voting will be somewhat different from previous ones because it
will be done with std.experimental in mind. Because of that please reply
with a bit more structured votes:

1) Yes / No for inclusion into std.experimental

At this point please consider if module has functionality you want to
see in standard library in general and if implementation is not
fundamentally broken. This is a simple sanity check.


Yes.

The API is sane and the design has withstood a lot of relevant criticism 
as well as bikeshedding. Although, I do not really like log function 
suffixes and would prefer overloads.



2) Yes / No for inclusion into Phobos in its current state

This is where you should summarize your concerns raised during review if
there are any and make decision if existing API / architecture are
promising enough to be set in stone via Phobos inclusion.


No.

There were a lot of changes during the review process. The module should 
IMO go to experimental to have some time to take care of all those small 
things as well as to get (hopefully) some larger adoption.



3) If you have answered No for (2) :  list of mandatory changes that
are needed to make you vote Yes


For me it is the stay in std.experimental and seeing that nobody is 
pressing for another api changes (like Andrei is doing now).



4) Any additional comments for author.


Great work and some great patience you have displayed in the process.
Thank you!