On 17/06/14 04:27, jicman wrote:
Greetings!
I have a bunch of files plain ASCII, UTF8 and UTF16 with and without BOM
(Byte Order Mark). I had, "I thought", a nice way of figuring out what
type of encoding the file was (ASCII, UTF8 or UTF16) when the BOM was
missing, by reading the content and
I ran the program suggested by H.S. Teoh and the reduced code
looks very similar
#11763.
I've submitted the bug at
https://issues.dlang.org/show_bug.cgi?id=12926
Thanks for your reply!
On Tuesday, 17 June 2014 at 04:50:43 UTC, Ali Çehreli wrote:
On 06/16/2014 09:44 PM, Keqin wrote:> Hi everyone,
> std.file.FileException@std\file.d(2519):
C:\$Recycle.Bin\S-1-5-18:
> Access is den
> ied.
>
> I believe the exception comes from the following line:
> auto en
On 06/16/2014 09:44 PM, Keqin wrote:> Hi everyone,
> std.file.FileException@std\file.d(2519): C:\$Recycle.Bin\S-1-5-18:
> Access is den
> ied.
>
> I believe the exception comes from the following line:
> auto entries = dirEntries(dirpath, SpanMode.depth);
Known issue:
https://issues.dlang.org
Hi everyone,
I have write a short program to check file size recursively as
bellow.
If i run this exe on windows eg.:
hello.exe --dir C:\
It will throw as:
std.file.FileException@std\file.d(2519):
C:\$Recycle.Bin\S-1-5-18: Access is den
ied.
I believe the exception comes from the follow
On 06/16/2014 07:45 PM, George Sapkin wrote:
I'm trying to sort shared data with a predicate. Buy that causes 'unable
to format shared objects'. Here's an example reproducing the issue
without any threading code:
shared class SomeClass {
immutable int value;
this(const int value) {
On 06/16/2014 09:37 AM, Tolga Cakiroglu wrote:
> On Monday, 16 June 2014 at 15:25:51 UTC, Ali Çehreli wrote:
> Okay, now I continue with another thing. After defining the event
> attribute as follows
>
> public void delegate( shared(SocketListener) sender ) shared
> eventWhenStarted;
>
>
> ---
>
On Tuesday, 17 June 2014 at 04:32:20 UTC, Jakob Ovrum wrote:
On Monday, 16 June 2014 at 20:49:29 UTC, monarch_dodra wrote:
MyCompare cmp(SortOrder.ASC, 10);
This syntax is not valid D.
It should be:
auto cmp = MyCompare(SortOrder,ASC, 10);
Sorry, that first comma is a typo and should b
On Monday, 16 June 2014 at 20:49:29 UTC, monarch_dodra wrote:
MyCompare cmp(SortOrder.ASC, 10);
This syntax is not valid D.
It should be:
auto cmp = MyCompare(SortOrder,ASC, 10);
I'm trying to sort shared data with a predicate. Buy that causes
'unable to format shared objects'. Here's an example reproducing
the issue without any threading code:
shared class SomeClass {
immutable int value;
this(const int value) {
this.value = value;
}
}
void main() {
Greetings!
I have a bunch of files plain ASCII, UTF8 and UTF16 with and
without BOM (Byte Order Mark). I had, "I thought", a nice way of
figuring out what type of encoding the file was (ASCII, UTF8 or
UTF16) when the BOM was missing, by reading the content and
applying the std.utf.validate
On Monday, 16 June 2014 at 19:42:14 UTC, Mike wrote:
I have refactored the code as recommended.
I have also modified the not-yet-reviewed writers part to take
advantage of the same approach (preallocated static-sized
buffer) rather than allocate slices in loops.
Hoping to hear something from
Adam, Dicebot, Thank you very much for the fast reply. I think
this should be addressed at the documentation since it has
ability to cause confusion for newbies like me.
On Monday, 16 June 2014 at 22:03:28 UTC, Mark Blume wrote:
Why exactly isn't a constructor without any parameters is not
allowed?
The idea is that declaring a plain struct always has almost zero
cost - it is just static data with no extra code run. A zero-arg
constructor (aka a default constr
On Monday, 16 June 2014 at 22:03:28 UTC, Mark Blume wrote:
Why exactly isn't a constructor without any parameters is not
allowed?
Why does
"Struct()" calls "Struct.opCall()," which means "Struct.init"
initially,
while
"Struct(params)" calls "Struct.this(params)?"
Does "Struct(params)" also ca
Why exactly isn't a constructor without any parameters is not
allowed?
Why does
"Struct()" calls "Struct.opCall()," which means "Struct.init"
initially,
while
"Struct(params)" calls "Struct.this(params)?"
Does "Struct(params)" also call "Struct.opCall(params)?"
I am new to D and I can't seem
On Monday, 16 June 2014 at 22:03:28 UTC, Mark Blume wrote:
Why exactly isn't a constructor without any parameters is not
allowed?
Why does
"Struct()" calls "Struct.opCall()," which means "Struct.init"
initially,
while
"Struct(params)" calls "Struct.this(params)?"
Does "Struct(params)" also ca
On Monday, 16 June 2014 at 09:24:22 UTC, Marc Schütz wrote:
You can pass anything to the sort function that's callable,
including an object:
struct MyCompare {
SortOrder order;
int column;
bool opCall(const ref DataRow lhs, const ref DataRow
rhs) {
retu
On Monday, 16 June 2014 at 19:42:14 UTC, Mike wrote:
I have refactored the code as recommended.
I have also modified the not-yet-reviewed writers part to take
advantage of the same approach (preallocated static-sized
buffer) rather than allocate slices in loops.
Hoping to hear something from
I have refactored the code as recommended.
I have also modified the not-yet-reviewed writers part to take
advantage of the same approach (preallocated static-sized buffer)
rather than allocate slices in loops.
Hoping to hear something from you guys!
Best,
Mike
AFAIK, no. You hit an Error, and those shouldn't occur unless
you go out of your way for them.
I'll look into it.
Superb!
What's there to say? They all take a range of characters, and
return it as a range of the corresponding requested type.
Excuse me for the kind of dumb question. I was u
I'm giving up
On Monday, 16 June 2014 at 16:49:46 UTC, Andrew Brown wrote:
Sorry, comments split over two lines, this should work:
import std.stdio, std.array, std.string; //need to import
std.array
void main() {
ulong[string] dictionary; // the length property is ulong,
not
uint
forea
Sorry, comments split over two lines, this should work:
import std.stdio, std.array, std.string; //need to import
std.array
void main() {
ulong[string] dictionary; // the length property is ulong, not
uint
foreach (line; stdin.byLine()) {
foreach (word; splitter(strip(line))) {
I think you can find splitter in std.array. I had a few other
problems compiling your code, I could get this version to work:
import std.stdio, std.array, std.string; //need to import
std.array
void main() {
ulong[string] dictionary; // the length property is ulong, not
uint
foreach (line;
On Monday, 16 June 2014 at 16:42:01 UTC, Brad Anderson wrote:
On Monday, 16 June 2014 at 16:38:15 UTC, Sanios wrote:
And I'm getting this - Error: undefined identifier splitter
It seems like std.string doesn't contain splitter.
You can find the solution to this and other issues you may hit
Thanks, but getting another error.
auto newID = dictionary.length;
Error: associative arrays can only be assigned values with
immutable keys, not char[]
On Monday, 16 June 2014 at 16:38:15 UTC, Sanios wrote:
And I'm getting this - Error: undefined identifier splitter
It seems like std.string doesn't contain splitter.
You can find the solution to this and other issues you may hit in
the errata:
http://erdani.com/tdpl/errata/
On Monday, 16 June 2014 at 15:25:51 UTC, Ali Çehreli wrote:
Here is a minimal example that reproduces the issue and the
hint that compiles the code:
class SocketListener
{
public void delegate( shared(SocketListener) sender )
/* shared */// <-- UNCOMMENT TO COMPILE
eventWhenSt
Hello guys, as first I don't know, if I'm writing to correct
section, but I've got a problem. I'm actually reading book of D
guide and trying to do it like it is in book.
My code is:
import std.stdio, std.string;
void main() {
uint[string] dictionary;
foreach (line; stdin.byLine
Add "import std.algorithm". Splitter is defined there.
http://dlang.org/phobos/std_algorithm.html#splitter
On Monday, 16 June 2014 at 16:38:15 UTC, Sanios wrote:
Hello guys, as first I don't know, if I'm writing to correct
section, but I've got a problem. I'm actually reading book of D
guide and
Thanks Ali. That has solved the problem. Actually I tried to use
that `shared` as follows before:
public shared void delegate( shared(BasicSocketListener) sender )
eventWhenStarted;
Though it didn't work with that. When it is put "before" the
attribute name, it works now. It is just confusin
Possibly https://issues.dlang.org/show_bug.cgi?id=11763 or
https://issues.dlang.org/show_bug.cgi?id=11903
On 06/16/2014 05:35 AM, Tolga Cakiroglu wrote:> In a class I defined an
event attribute as follows:
>
> public void delegate( shared(SocketListener) sender ) eventWhenStarted;
>
> ---
>
> An instance of SocketListener is created.
>
> auto listener = new shared SocketListener();
>
> ---
>
> I defi
On Monday, 16 June 2014 at 10:02:16 UTC, monarch_dodra wrote:
I'll look into it.
Yeah, there's an issue in the implementation. I brought it up in
the pull page. If it doesn't get attention there, I'll file it.
On Saturday, 14 June 2014 at 14:32:10 UTC, Xavier Bigand wrote:
I get a failure on a test in format.d when I build my own
project with unittest. I though importing phobos header would
not regenerate their unittest modules.
Any idea of what can cause this issue? I already have
reinstalled dmd
On Sat, 14 Jun 2014 10:32:04 -0400, Xavier Bigand
wrote:
I get a failure on a test in format.d when I build my own project with
unittest. I though importing phobos header would not regenerate their
unittest modules.
Any idea of what can cause this issue? I already have reinstalled dmd
In a class I defined an event attribute as follows:
public void delegate( shared(SocketListener) sender )
eventWhenStarted;
---
An instance of SocketListener is created.
auto listener = new shared SocketListener();
---
I defined a shared method that will be called when the event
occurs.
On Sunday, 15 June 2014 at 23:09:24 UTC, Nordlöw wrote:
Is this intentional?
utf.d on line 2703 is inside byCodeUnit().
AFAIK, no. You hit an Error, and those shouldn't occur unless you
go out of your way for them.
I'll look into it.
When I use byChar() i doesn't crash but then I get incor
You can pass anything to the sort function that's callable,
including an object:
struct MyCompare {
SortOrder order;
int column;
bool opCall(const ref DataRow lhs, const ref DataRow rhs)
{
return order == SortOrder.ASC ?
lhs[column] < rhs
On 06/06/2014 7:39 PM, Steven Schveighoffer wrote:
On Fri, 06 Jun 2014 06:14:30 -0400, Rene Zwanenburg
wrote:
Immutables should be usable at compile time and not allocate a new
instance on every use when in module scope.
I was about to say this. But immutable can have its own set of issues.
I
I use a library written in C. There are these two functions
1. MyLib_Initialize(), an existing 3rd party function
2. my_lib_initialize(), my custom function
On Linux (my main platform) it compiled and worked without an
error. On Windows, however, implib printed a warning and said
that two defi
41 matches
Mail list logo