On Fri, Jun 23, 2017 at 10:10:22PM -0700, Ali Çehreli via Digitalmars-d-learn
wrote:
> On 06/23/2017 09:26 PM, Felix wrote:
> > That works, thanks!
>
> I've just tried this, which seems cleaner:
>
> import std.stdio;
> import std.system;
> import std.bitmanip;
>
> void ensureBigEndian(T)(ref T
On 06/23/2017 09:26 PM, Felix wrote:
That works, thanks!
I've just tried this, which seems cleaner:
import std.stdio;
import std.system;
import std.bitmanip;
void ensureBigEndian(T)(ref T value) {
if (endian == Endian.littleEndian) {
value = *cast(T*)nativeToBigEndian(value).ptr;
That works, thanks!
On 06/23/2017 07:52 PM, Felix wrote:
> So I'm guessing my ubytes are in the
wrong order in the uint... how should I put them around the correct way
so that my code won't break on another machine with different endianness?
Yes, that would happen when your system is little-endian. (According to
I'm trying to read in just the first part of a .png file to peek
at it's width and height without loading in the whole file. I'm
using FreeImage for reading the whole file but since it doesn't
have a function to let me peek at the image size before loading
it all in I'm rolling my own.
I've
On Wednesday, 21 June 2017 at 11:30:56 UTC, Ivan Kazmenko wrote:
[...]
Step 5. I don't get any lib files.
I got lib files on another computer, though.
On Wednesday, 21 June 2017 at 20:48:52 UTC, ag0aep6g wrote:
On 06/21/2017 09:39 PM, timvol wrote:
size_t calcLength(ubyte ubFuncCode)() if ( ubFuncCode ==
1 )
{
return 10; // More complex calculated value
}
size_t calcLength(ubyte ubFuncCode)() if ( ubFuncCode ==
On 6/23/17 12:06 PM, Martin Tschierschke wrote:
You can use the html syntax for the class parameter, the funny/nice
thing is, that mystr can be used directly without "#{}" around.
code(class=mystr) #{line}
works.
Yes, I just found out recently -- when you don't use quotes for an
attribute
On Friday, 23 June 2017 at 06:59:22 UTC, Suliman wrote:
I need to get external variable and make class by it's value
- string mystr = "lng-" ~ language;
- foreach(i, line; arrayOfLines )
li
code.mystr #{line}
I need to get HTML code like this:
some D code
But class
On Thursday, 22 June 2017 at 09:57:44 UTC, Andre Pany wrote:
This line raises the error:
TestStruct s2 = TestStruct(Reason.FU);
Error: cannot implicitly convert expression ("Fu") of type
Reason to InitialEnum!(Reason)
While this line is working fine:
TestStruct s1 = {reason: Reason.FU};
I
On 06/23/2017 04:29 PM, Adam D. Ruppe wrote:
try `new immutable AppendChatCommand` instead of just `new`.
If it complains that it cannot call the mutable constructor, go to the
class definition and add `pure` to the constructor. Should take care of
that error.
With a `pure` constructor,
On Thu, 2017-06-22 at 18:38 +, Boris-Barboris via Digitalmars-d-
learn wrote:
> […]
>
> Casts are part of the type system. Yes, D type system allows
> invalid operations. It's not the compiler's fault, it's type
> system's fault.
> […]
Well maybe casts should be allowed as they effectively
On Friday, 23 June 2017 at 14:29:41 UTC, harakim wrote:
heh. I've been working on this for an hour or so. Right after I
posted, I tried casting it, which worked. Thank you for your
time.
cast works, but `new immutable` with a pure ctor should work
better. (casts are easy to get wrong so best
On Friday, 23 June 2017 at 14:29:40 UTC, Adam D. Ruppe wrote:
On Friday, 23 June 2017 at 14:25:48 UTC, harakim wrote:
immutable(AppendChatCommand) command = new
AppendChatCommand(type, text);
try `new immutable AppendChatCommand` instead of just `new`.
If it complains that it cannot call the
On Friday, 23 June 2017 at 14:25:48 UTC, harakim wrote:
I am building a system where one thread generates commands and
sends them to another thread. The commands will never change
once they are created. I have marked the values immutable, but
I've been struggling to understand the requirements
On Friday, 23 June 2017 at 14:25:48 UTC, harakim wrote:
immutable(AppendChatCommand) command = new
AppendChatCommand(type, text);
try `new immutable AppendChatCommand` instead of just `new`.
If it complains that it cannot call the mutable constructor, go
to the class definition and add
I am building a system where one thread generates commands and
sends them to another thread. The commands will never change once
they are created. I have marked the values immutable, but I've
been struggling to understand the requirements for sharing a
variable across threads.
cannot
On Wednesday, 21 June 2017 at 15:55:27 UTC, David Nadlinger wrote:
On Monday, 19 June 2017 at 14:08:56 UTC, Patric Dexheimer wrote:
Fresh install of GDC. (tried with 32x ad 32_64x)
Where did you get the GDC executable from? The GDC project
doesn't currently offer any official builds that
On Fri, 2017-06-23 at 09:24 +, Laeeth Isharc via Digitalmars-d-
learn wrote:
> […]
>
> Check out the Kaleidic fork maintained by John Colvin - currently
> in his personal repository on github. We submitted back our
> changes but ended up being quite a lot so not all have been
> accepted
On Friday, 23 June 2017 at 08:26:21 UTC, Russel Winder wrote:
On Fri, 2017-06-23 at 08:11 +, Nicholas Wilson via
Digitalmars-d- learn wrote:
On Friday, 23 June 2017 at 07:51:51 UTC, Russel Winder wrote:
> I am likely just staring at and missing the data needed:
>
> How does one invoke dub
On Fri, 2017-06-23 at 08:11 +, Nicholas Wilson via Digitalmars-d-
learn wrote:
> On Friday, 23 June 2017 at 07:51:51 UTC, Russel Winder wrote:
> > I am likely just staring at and missing the data needed:
> >
> > How does one invoke dub to fetch and build, and put into a
> > place other that
On Friday, 23 June 2017 at 07:51:51 UTC, Russel Winder wrote:
I am likely just staring at and missing the data needed:
How does one invoke dub to fetch and build, and put into a
place other that ~/.dub/… a package from Dub?
dub fetch foo --version=1.0.0
mv ~/.dub/packages/foo-1.0.0
I am likely just staring at and missing the data needed:
How does one invoke dub to fetch and build, and put into a place other
that ~/.dub/… a package from Dub?
--
Russel.
=
Dr Russel Winder t: +44 20 7585 2200
I need to get external variable and make class by it's value
- string mystr = "lng-" ~ language;
- foreach(i, line; arrayOfLines )
li
code.mystr #{line}
I need to get HTML code like this:
some D code
But class name become "mystr" and I am getting:
some D code
How
24 matches
Mail list logo