On Monday, 5 August 2013 at 01:47:26 UTC, JS wrote:
Anyways, is this a bad or good way and how can I call Factory
to get a new object? (I know that ther is .init and other stuff
that can be used by Factor/New. I'm just trying to get the
skeleton to compile and make sure there are not going to b
On Monday, 5 August 2013 at 07:15:30 UTC, Tobias Pankrath wrote:
On Monday, 5 August 2013 at 01:47:26 UTC, JS wrote:
Anyways, is this a bad or good way and how can I call Factory
to get a new object? (I know that ther is .init and other
stuff that can be used by Factor/New. I'm just trying to g
On 08/01/2013 07:46 PM, Gary Willoughby wrote:
> There must be a simpler way to pass these files to dmd in the right order?
> rdmd
> does it somehow.
>
> Any ideas? How do you handle compiling projects with 50+ source files?
This is a Makefile pattern I've found useful:
https://github.com/WebDra
Hi,
Does Phobos have a way to portably get the user's configuration directory?
As an example, GTK+ has this:
http://www.gtk.org/api/2.6/glib/glib-Miscellaneous-Utility-Functions.html#g-get-user-config-dir
Thanks,
Nick
On Monday, 5 August 2013 at 11:43:05 UTC, Nick Treleaven wrote:
Hi,
Does Phobos have a way to portably get the user's configuration
directory?
As an example, GTK+ has this:
http://www.gtk.org/api/2.6/glib/glib-Miscellaneous-Utility-Functions.html#g-get-user-config-dir
No, it doesn't. I use P
On Monday, 5 August 2013 at 08:11:59 UTC, JS wrote:
I guess you mean that I should use a template as a factory
instead of an interface? I'll have to think about it to see
what the pro's and con's of each are. The interface pattern
should include the template pattern though. (after all, the
in
Some small style rules for D user code:
1) All variables and functions arguments should be
immutable/const (or enum), unless they have to mutate (or there
is some other problem in Phobos, in the D type system, or in your
other code).
2) The code should contain as few cast() as possible. [*]
On 08/05/2013 03:01 PM, bearophile wrote:
> 2) The code should contain as few cast() as possible. [*]
What about to!() ... ? Is it possible to gain the performance of cast() while
using to!() ... ?
> 4) for/foreach/while loops are not evil, but it's better to use map/filter/zip
> where possible
Greetings!
I have this code,
foreach (...)
{
if (std.string.tolower(fext[0]) == "doc" ||
std.string.tolower(fext[0]) == "docx" ||
std.string.tolower(fext[0]) == "xls" ||
std.string.tolower(fext[0]) == "xlsx" ||
std.string.tolower(fext[0]) == "ppt" ||
std.string.tolower(fe
On Monday, 5 August 2013 at 13:59:24 UTC, jicman wrote:
Greetings!
I have this code,
First option...
foreach (...)
{
if (std.string.tolower(fext[0]) == "doc" ||
std.string.tolower(fext[0]) == "docx" ||
std.string.tolower(fext[0]) == "xls" ||
std.string.tolower(fext[0]) == "xl
On Monday, 5 August 2013 at 14:13:33 UTC, Timon Gehr wrote:
On 08/05/2013 03:59 PM, jicman wrote:
Greetings!
I have this code,
foreach (...)
{
if (std.string.tolower(fext[0]) == "doc" ||
std.string.tolower(fext[0]) == "docx" ||
std.string.tolower(fext[0]) == "xls" ||
std.string
On 08/05/2013 03:59 PM, jicman wrote:
Greetings!
I have this code,
foreach (...)
{
if (std.string.tolower(fext[0]) == "doc" ||
std.string.tolower(fext[0]) == "docx" ||
std.string.tolower(fext[0]) == "xls" ||
std.string.tolower(fext[0]) == "xlsx" ||
std.string.tolower(fe
did you benchmarked your current szenario - how do you know that this is
the slow part - or are you working on an only-extension-compare-tool?
btw: they are both equal and slow - and full of partly code-duplication
std.string.tolower(fext[0]) multiple times, i hope your list isn't going
much lo
On Monday, 5 August 2013 at 14:27:43 UTC, dennis luehring wrote:
did you benchmarked your current szenario - how do you know
that this is the slow part - or are you working on an
only-extension-compare-tool?
btw: they are both equal and slow - and full of partly
code-duplication
std.string.to
On Mon, Aug 05, 2013 at 03:59:23PM +0200, jicman wrote:
>
> Greetings!
>
> I have this code,
>
> foreach (...)
> {
>
> if (std.string.tolower(fext[0]) == "doc" ||
> std.string.tolower(fext[0]) == "docx" ||
> std.string.tolower(fext[0]) == "xls" ||
> std.string.tolower(fext[0]) ==
On Monday, 5 August 2013 at 13:01:19 UTC, bearophile wrote:
Some small style rules for D user code:
1) All variables and functions arguments should be
immutable/const (or enum), unless they have to mutate (or there
is some other problem in Phobos, in the D type system, or in
your other code).
> Ok, how would you make it faster?
i don't see a better solution here - how to reduce ONE lowercase and
SOME compares in any way? (i dont think a hash or something will help)
but i know that anything like your continue-party is worth nothing
(feels a little bit like script-kiddies "do it with
jicman:
How would you make it faster in D1?
Compute std.string.tolower(fext[0]) and put it in a temporary
variable. And then compare that variable with all your string
literals. In most cases that's fast enough. If it's not enough,
you could create a little finite state machine that represe
On Monday, 5 August 2013 at 12:41:19 UTC, Tobias Pankrath wrote:
On Monday, 5 August 2013 at 08:11:59 UTC, JS wrote:
I guess you mean that I should use a template as a factory
instead of an interface? I'll have to think about it to see
what the pro's and con's of each are. The interface patter
I made a markdown gist for the above module import tips:
https://gist.github.com/nikibobi/6156492
On Monday, 5 August 2013 at 13:59:24 UTC, jicman wrote:
Greetings!
I have this code,
foreach (...)
{
if (std.string.tolower(fext[0]) == "doc" ||
std.string.tolower(fext[0]) == "docx" ||
std.string.tolower(fext[0]) == "xls" ||
std.string.tolower(fext[0]) == "xlsx" ||
std.stri
On Monday, 5 August 2013 at 14:47:37 UTC, dennis luehring wrote:
> Ok, how would you make it faster?
i don't see a better solution here - how to reduce ONE
lowercase and SOME compares in any way? (i dont think a hash or
something will help) but i know that anything like your
continue-party is
On Monday, 5 August 2013 at 14:50:27 UTC, bearophile wrote:
jicman:
How would you make it faster in D1?
Compute std.string.tolower(fext[0]) and put it in a temporary
variable. And then compare that variable with all your string
literals. In most cases that's fast enough. If it's not enough,
On 05/08/2013 13:24, Mike Parker wrote:
On Monday, 5 August 2013 at 11:43:05 UTC, Nick Treleaven wrote:
Hi,
Does Phobos have a way to portably get the user's configuration
directory?
As an example, GTK+ has this:
http://www.gtk.org/api/2.6/glib/glib-Miscellaneous-Utility-Functions.html#g-get-us
Am 05.08.2013 15:59, schrieb jicman:
>
> Greetings!
>
> I have this code,
>
> foreach (...)
> {
>
> if (std.string.tolower(fext[0]) == "doc" ||
> std.string.tolower(fext[0]) == "docx" ||
> std.string.tolower(fext[0]) == "xls" ||
> std.string.tolower(fext[0]) == "xlsx" ||
> std
On Mon, Aug 05, 2013 at 03:01:18PM +0200, bearophile wrote:
> Some small style rules for D user code:
[...]
Note that in git HEAD, importing of packages as modules has been
implemented via package.d:
import my.path.module;
will now also work with:
/my
/my/path
/m
Am 05.08.2013 17:18, schrieb jicman:
>
It is a tool that was a script, but I have turned it into do,
which now has taken two hours from the last jscript script. I
have not benchmarked it, yet. I may. But I see that a great
idea has been provided, which I will use. Thanks for the help.
> hav
On Mon, Aug 05, 2013 at 04:47:36PM +0200, dennis luehring wrote:
> > Ok, how would you make it faster?
>
> i don't see a better solution here - how to reduce ONE lowercase and
> SOME compares in any way? (i dont think a hash or something will
> help) but i know that anything like your continue-par
On Monday, 5 August 2013 at 15:18:42 UTC, John Colvin wrote:
On Monday, 5 August 2013 at 13:59:24 UTC, jicman wrote:
Greetings!
I have this code,
foreach (...)
{
if (std.string.tolower(fext[0]) == "doc" ||
std.string.tolower(fext[0]) == "docx" ||
std.string.tolower(fext[0]) == "xls" |
On Monday, 5 August 2013 at 15:21:25 UTC, David wrote:
Am 05.08.2013 15:59, schrieb jicman:
Greetings!
I have this code,
foreach (...)
{
if (std.string.tolower(fext[0]) == "doc" ||
std.string.tolower(fext[0]) == "docx" ||
std.string.tolower(fext[0]) == "xls" ||
std.string.tolow
On Monday, 5 August 2013 at 15:18:42 UTC, John Colvin wrote:
better:
foreach (...)
{
auto tmp = std.string.tolower(fext[0]);
if(tmp == "doc" || tmp == "docx"
|| tmp == "xls" || tmp == "xlsx"
|| tmp == "ppt" || tmp == "pptx")
{
continue;
}
}
but still not s
On Monday, 5 August 2013 at 15:27:09 UTC, dennis luehring wrote:
Am 05.08.2013 17:18, schrieb jicman:
>
It is a tool that was a script, but I have turned it into do,
which now has taken two hours from the last jscript script. I
have not benchmarked it, yet. I may. But I see that a great
idea
On Monday, 5 August 2013 at 17:04:36 UTC, monarch_dodra wrote:
On Monday, 5 August 2013 at 15:18:42 UTC, John Colvin wrote:
better:
foreach (...)
{
auto tmp = std.string.tolower(fext[0]);
if(tmp == "doc" || tmp == "docx"
|| tmp == "xls" || tmp == "xlsx"
|| tmp == "ppt" || tmp
On 08/05/2013 10:04 AM, jicman wrote:
> The files are in a network drive, so, that has some slowness already
> involved because of that.
Which may dominate the running time.
> The jscript use to take over 8 hours. The new D program has
> dropped that to under less than six.
And that is proof
On Monday, 5 August 2013 at 13:59:24 UTC, jicman wrote:
Greetings!
I have this code,
foreach (...)
{
if (std.string.tolower(fext[0]) == "doc" ||
std.string.tolower(fext[0]) == "docx" ||
std.string.tolower(fext[0]) == "xls" ||
std.string.tolower(fext[0]) == "xlsx" ||
std.stri
On Mon, Aug 05, 2013 at 07:30:36PM +0200, JS wrote:
> On Monday, 5 August 2013 at 13:59:24 UTC, jicman wrote:
> >
> >Greetings!
> >
> >I have this code,
> >
> >foreach (...)
> >{
> >
> > if (std.string.tolower(fext[0]) == "doc" ||
> >std.string.tolower(fext[0]) == "docx" ||
> >std.string.t
Hi,
I would like to use a tuple template parameter in the default
value of another template parameter in the same class declaration
as follows.
class A(P...) {}
class B(R = A!P, P...) {}
P... should be rightmost, so how can I use it in the preceding
parameter?
Thanks.
On Monday, August 05, 2013 15:46:13 Joseph Rushton Wakeling wrote:
> On 08/05/2013 03:01 PM, bearophile wrote:
> > 2) The code should contain as few cast() as possible. [*]
>
> What about to!() ... ? Is it possible to gain the performance of cast()
> while using to!() ... ?
That depends. In gener
On Saturday, 3 August 2013 at 22:17:32 UTC, Gabi wrote:
I need a Lua 5.2.2 wrapper, So I started working on one..
I am new to D so probably there is a lot of room for
improvements..
Any feedback is welcome..
You'll probably like the LuaD wrapper
https://github.com/JakobOvrum/LuaD
It uses 5.
On 08/05/13 20:45, kdmult wrote:
> Hi,
>
> I would like to use a tuple template parameter in the default value of
> another template parameter in the same class declaration as follows.
>
> class A(P...) {}
>
> class B(R = A!P, P...) {}
>
> P... should be rightmost, so how can I use it in the p
On Monday, 5 August 2013 at 19:14:25 UTC, Jesse Phillips wrote:
On Saturday, 3 August 2013 at 22:17:32 UTC, Gabi wrote:
I need a Lua 5.2.2 wrapper, So I started working on one..
I am new to D so probably there is a lot of room for
improvements..
Any feedback is welcome..
You'll probably like
I'm using std.concurrency message passing and I'd like to check which thread
might be a bottleneck. The easiest would be check number of messages piled
up for each of them, but I could not find a way to do that. Is it possible?
Every detail about MessageBox seems to be hidden...
--
Marek Januk
On 8/6/13, Marek Janukowicz wrote:
> I'm using std.concurrency message passing and I'd like to check which thread
> might be a bottleneck. The easiest would be check number of messages piled
> up for each of them, but I could not find a way to do that. Is it possible?
>
> Every detail about Messag
Le 05/08/2013 15:59, jicman a écrit :
Greetings!
I have this code,
foreach (...)
{
if (std.string.tolower(fext[0]) == "doc" ||
std.string.tolower(fext[0]) == "docx" ||
std.string.tolower(fext[0]) == "xls" ||
std.string.tolower(fext[0]) == "xlsx" ||
std.string.tolower(fe
On 08/05/2013 04:18 PM, Marek Janukowicz wrote:
I'm using std.concurrency message passing and I'd like to check which thread
might be a bottleneck. The easiest would be check number of messages piled
up for each of them, but I could not find a way to do that. Is it possible?
Every detail about Me
On Monday, 5 August 2013 at 13:59:24 UTC, jicman wrote:
Greetings!
I have this code,
foreach (...)
{
if (std.string.tolower(fext[0]) == "doc" ||
std.string.tolower(fext[0]) == "docx" ||
std.string.tolower(fext[0]) == "xls" ||
std.string.tolower(fext[0]) == "xlsx" ||
std.stri
What is the recommended approach for adding logging and tracing
to D apps?
Is there a library for it?
On Saturday, 3 August 2013 at 18:23:58 UTC, Gary Willoughby wrote:
On Saturday, 3 August 2013 at 18:14:47 UTC, Gary Willoughby
wrote:
This sounds a great idea but once the file has been opened as
a MmFile how to i convert this to a ubyte[] so the
std.bitmanip functions work with it?
I'm curre
On Monday, 5 August 2013 at 18:45:49 UTC, kdmult wrote:
class A(P...) {}
class B(R = A!P, P...) {}
P... should be rightmost, so how can I use it in the preceding
parameter?
The default parameter value doesn't make sense as it's shown
above.
Actually I want to port C++ code which looks like
On 08/05/2013 09:51 PM, kdmult wrote:
On Monday, 5 August 2013 at 18:45:49 UTC, kdmult wrote:
class A(P...) {}
class B(R = A!P, P...) {}
P... should be rightmost, so how can I use it in the preceding parameter?
The default parameter value doesn't make sense as it's shown above.
Actually I wa
On Tue, Aug 06, 2013 at 06:48:12AM +0200, Jesse Phillips wrote:
[...]
> The only way I'm seeing to advance through the file is to keep an
> index on where you're currently reading from. This actually works
> perfect for the FileRange I mentioned in the previous post. Though
> I'm not familiar with
Ali Çehreli wrote:
> On 08/05/2013 04:18 PM, Marek Janukowicz wrote:
>> I'm using std.concurrency message passing and I'd like to check which
>> thread might be a bottleneck. The easiest would be check number of
>> messages piled up for each of them, but I could not find a way to do
>> that. Is it
On Monday, August 05, 2013 23:04:58 H. S. Teoh wrote:
> On Tue, Aug 06, 2013 at 06:48:12AM +0200, Jesse Phillips wrote:
> [...]
>
> > The only way I'm seeing to advance through the file is to keep an
> > index on where you're currently reading from. This actually works
> > perfect for the FileRang
Am 05.08.2013 19:04, schrieb jicman:
so its totaly unclear if the presented code is your 2h monster,
what was
the runtime of your jscript?
The files are in a network drive, so, that has some slowness
already involved because of that. The jscript use to take over 8
hours. The new D program has
On Tuesday, 6 August 2013 at 05:07:51 UTC, Ali Çehreli wrote:
On 08/05/2013 09:51 PM, kdmult wrote:
On Monday, 5 August 2013 at 18:45:49 UTC, kdmult wrote:
class A(P...) {}
class B(R = A!P, P...) {}
P... should be rightmost, so how can I use it in the
preceding parameter?
The default param
On Monday, August 05, 2013 15:59:23 jicman wrote:
> Greetings!
>
> I have this code,
>
> foreach (...)
> {
>
>if (std.string.tolower(fext[0]) == "doc" ||
> std.string.tolower(fext[0]) == "docx" ||
> std.string.tolower(fext[0]) == "xls" ||
> std.string.tolower(fext[0]) == "xlsx
56 matches
Mail list logo