« first day (992 days earlier)      last day (3965 days later) » 

user142019
11:00 PM
I just terminated an instance of Z shell. Am I the Terminator now?
 
You want to control movement based on those 5 things.
 
That looks to be correct, yes.
 
@ThePhD It appropriates a well-defined name for something completely different.
It already has two definitions.
Don't add a third one.
UTF-16 means one of two things: the UTF-16 encoding form, which uses 16-bit units (not bytes => no byte order), or the UTF-16 encoding scheme, which uses 8-bit units, and BOMs to determine byte order.
 
Okay, let's break out the math! :-)
@Pawnguy7 Wait, what's your math background like?
 
(Don't ask me how I tell them apart in ogonek; I have been delaying solving that design problem since ever; don't tell anyone)
 
11:02 PM
Ehm... Algebra 2, I guess.
 
@R.MartinhoFernandes (Your secret is safe with me <3)
 
Oh. I guess I should go light on the calculus then.
 
@StackedCrooked anything wrong (boost upgrade?)? coliru.stacked-crooked.com/…
 
@R.MartinhoFernandes How can you have a 16-bit unit without having to deal with the byte order?
 
Right now I basically have no support for the UTF-16 encoding scheme.
 
11:02 PM
@Pawnguy7 I'm going to hand-wave this. If you're given a constant acceleration, and a starting velocity, the position of your object is:
 
@DeadMG 0xD800 is 0xD800...
 
x = x_0 + v_0 * t + 1/2 * a * t^2
 
root@stacked-crooked ~ $ locate phoenix.hpp
/usr/include/boost/spirit/phoenix.hpp
/usr/include/boost/spirit/home/phoenix.hpp
/usr/include/boost/spirit/home/classic/phoenix.hpp
/usr/include/boost/spirit/include/phoenix.hpp
 
@R.MartinhoFernandes So if I user says "I want UTF16", should I just give them one of the two and pretend nothing happened?
 
this answer I have completely failed to understand.
 
11:03 PM
Encoding forms are not serialization formats (because they don't encode as bytes).
 
@StackedCrooked That's.... boost pre 1_42?
 
So x is the position of your object.
x_0 is the starting position of the object
v_0 is the initial velocity
 
1_46_1 apparently
 
a is the constant acceleration
t is the time passed.
 
@StackedCrooked no kidding. I thought Phoenix V3 was older
 
11:04 PM
@DeadMG uint16_t doesn't have byte order because it's not a sequence of bytes.
 
Any chance we can haz upgrade (1_53 e.g.?)
 
@R.MartinhoFernandes Well, it does have a byte order, it's just fixed to the CPU's byte order.
 
Byte order only arises when you look at it through a char* i.e. as a sequence of bytes.
 
Yeah. But ask me again.
 
@DeadMG No. Something encoded in the UTF-16 encoding form is a sequence of numbers, not bytes.
 
11:05 PM
@Pawnguy7 Let's see how we can apply this equation to the first box in your picture (I'll call them regimes)
The initial velocity is zero, so v_0 = 0
The initial position is zero, so x_0 = 0
 
@R.MartinhoFernandes And those numbers have a byte order.
 
Only when you serialize them (or look at their serialized form).
 
t is the independent variable, we do not need to worry about that.
What we don't know is what the constant a needs to be.
 
I suggest you give up. Don't take this the wrong way--I just think Phoenix is too complicated to use for real, and you've found a great example of why--most C++ users will never be able to help you fix this, much less figure out how to modify it later on. Just use a normal for loop or something. — John Zwinck 12 hours ago
 
well, you could probably get away with claiming that a register has no byte order, but everything in RAM has a byte order (it's just fixed to the CPU's byte order)
 
11:06 PM
^ when did John become the sour pr*ck he appears to be there?
 
@DeadMG C++ has integral variables, not RAM.
 
@Pawnguy7 Follow so far?
 
those integral variables have to meet the requirements of RAM.
 
@sehe Never met him before.
 
@Insilico I am not certain how the equation works, otherwise yes.
 
11:08 PM
@Pawnguy7 Like how it's derived, or how it is used?
 
@R.MartinhoFernandes Mmm. Seen him lots of times. Perhaps in a different tag then. perhaps
 
also
 
@Insilico The first. Or, if the latter means how to use it to figure out a, then both.
 
correct me if I'm wrong, but doesn't setting the various bits in an integer reveal it's byte order?
 
11:09 PM
hmmm.
 
Which is exactly why I am staunchly insisting on my view.
 
@Pawnguy7 The derivation involves calculus. Basically you integrate a certain equation twice.
(You tell me you have at most Algebra 2, which is why I'm hand-waving the derivation)
 
uint32_t x = 0x12345678;
assert(x & 0xFF == 78); // always
 
Ok. Continue.
 
@R.MartinhoFernandes I thought that can fail on a big-endian machine?
 
11:11 PM
You can think of the equation as something that will set the position of the object over time.
 
@ThePhD Not unless the compiler is buggy.
 
If you want future maintainers to thank you, don't use C++. hrhr
 
Hm.
 
user142019
If I have a function of type f :: Show a => a -> String, is a a subtype of Show a or is subtyping completely irrelevant?
 
ah, now I recall.
72
A: Detecting endianness programmatically in a C++ program

David CournapeauI don't like the method based on type punning - it will often be warned against by compiler. That's exactly what unions are for ! int is_big_endian(void) { union { uint32_t i; char c[4]; } bint = {0x01020304}; return bint.c[0] == 1; } The principle is equivalent t...

 
11:11 PM
@ThePhD Why do you think I keep insisting that you use bitshifts and masks instead of silly hacks to see the representation?
 
@rightfold It's not subtyping.
 
@Pawnguy7 Now, what we need to determine is what the constant a needs to be for the first regime in your picture.
 
user142019
Ah, okay.
 
user142019
Does Haskell have subtyping at all?
 
11:12 PM
you can determine the byte order by aliasing the integer as a char*.
 
That's what I said!
7 mins ago, by R. Martinho Fernandes
Byte order only arises when you look at it through a char* i.e. as a sequence of bytes.
 
right, but since that is a perfectly legal thing to do for a C++ integer, then they do have a byte order, and therefore something which is a sequence of them will also have a byte order.
 
@CatPlusPlus Zing
 
@DeadMG But that's an artifact of the implementation. The encoding itself as defined doesn't have such a thing.
 
implementation details would imply that you can't observe them, whereas you can quite legally observe the byte order of a uint16_t.
 
11:16 PM
I'm so lost now. ;~;
 
@R.MartinhoFernandes artefact? artifact? artic pact? antic fart?
 
artifact is fine
 
Fourth of July!
 
@Insilico Can you just solve the equation(where x = distance of regime)?
 
@DeadMG Implementations of UTF-16 in other languages don't have such implementation artifacts.
 
11:18 PM
@Pawnguy7 Yes. So you can punch in all the known equations.
 
@DeadMG Give a uint16_t you can observe it's byte order? :)
 
I suspect that they probably do when the user starts writing it to the disk and reading it back on a machine with the wrong endianness and gets the wrong thing.
 
So basically you apply the equation twice.
The first time you find what a needs to be
and the second time you find what x needs to be with respect to time
 
15 mins ago, by R. Martinho Fernandes
Encoding forms are not serialization formats (because they don't encode as bytes).
 
@Pawnguy7 Let's try to keep this reasonably simple. Start with an S-curve like this:
 
11:19 PM
@StackedCrooked Yep.
 
@R.MartinhoFernandes i tried it your way and now I'm ending up with utter garbage letters. =[
 
@Insilico I am confused what this is for. Wouldn't the time and x both be inputs in the origional equation?
 
@R.MartinhoFernandes Right, and the fact that you can't do that is a user-visible effect of byte order.
 
@JerryCoffin Your position increases over time?
 
11:19 PM
Draw vertical lines even spaced for the number of frames you want to animate over. Where each of those intersects the curve, draw a line left to tel you the position at that point in time.
 
@DeadMG You can't because it's impossible.
 
@Pawnguy7 No, x is the output. t is the input.
 
it's impossible because of byte order.
 
You can only store something in the UTF-16 encoding form on a drive that uses 16-bit units.
@DeadMG Nope, it's impossible because it doesn't have bytes.
 
11:20 PM
@StackedCrooked The idea (I believe) is to move something from one place to another. The "increase" is an increase along the line from A to B.
 
so UTF-16 is only legal for 16-bit byte systems- i.e., nowhere.
 
Erm, no.
The C++ abstract machine has 16-bit units available.
 
@Insilico what would we do with that output?
 
@Pawnguy7 You set the object's position with the output of the function.
 
You can have it there.
 
11:22 PM
Oh. Right.
So we first solve that equation for a.
 
If you want to put it to disk you need to use the other UTF-16, or UTF-16LE, or UTF-16BE.
 
And using the output of that, input it into it rearranged to find x?
 
Xeo
@R.MartinhoFernandes That shit's confusing.
 
well, not only have I already pointed out the whole "alias with char*" thing, which I think kinda proves my point
 
11:23 PM
@Pawnguy7 Basically, yes. But let's work through the problem one step at a time.
 
but secondly, why on earth would anyone ever use UTF-16-but-you-can't-use-it-for-shit, compared to UTF-16-but-it's-good-everywhere
 
I already pointed out that that is a property of a particular implementation.
 
Before you try solving for a, try and see if you can control the object's position based on the equation.
 
See if you can program in the equation x = x_0 + v_0 * t + 1/2 * a * t^2
 
11:24 PM
@StackedCrooked lolwat
 
Basically, { D800, DC00 } is a different sequence than { FE, FF, D8, 00, DC, 00 }. They both encode the same data.
 
x_0, v_0, and a are constants. Play around with the constants and see how they change the movement of the object.
 
If the frame rate is constant, you can directly punch in the frame number as time.
 
Why can't you see other people flag count?
 
11:26 PM
{ D800, DC00 } UTF-16 the encoding form
{ FE, FF, D8, 00, DC, 00 } UTF-16 the encoding scheme
{ FF, FE, 00, D8, 00, DC } UTF-16 the encoding scheme
{ D8, 00, DC, 00 } UTF-16BE
{ 00, D8, 00, DC } UTF-16LE
 
Encoding Scheme is silly and looks useless.
 
It's UTF-16LE/BE + BOM.
 
It's silly. D:
 
It's required.
 
So what, all text using the utf16es must have a BoM?
Every single string ever? That's pretty lame. I'd not support that at all if I had a choice.
 
11:29 PM
Well, I don't know about "must" per Unicode, but they definitely should.
Unless you carry endianness information in out-of-band encoding data.
 
@ThePhD If it's strictly UTF-16, yes. If it doesn't have a BOM it's UTF-16LE or UTF-16BE.
 
@StackedCrooked I'm surprised at the amount of anime that takes place in high schools, and that involve anti-social main characters
 
The latter two don't need BOMs because the byte order information is fixed.
 
@Borgleader Japan is the only country to embrace the introvert.
others are all about extroverts
 
Note that you can't assume encoded blob's byte order is the same as your system's.
 
11:30 PM
@R.MartinhoFernandes So in the end you could pick an encoding based on BoM and then "downconvert" to utf16le/be ?
 
BOM is not present in the decoded data anyway.
 
@ThePhD Don't get fooled by us all using "UTF-16" loosely to mean any of those four things when it isn't important which.
 
@DeadMG Makes sense. Maybe I should go live there.
 
woulda been simpler if the Consortium had just defined UTF-16 to be LE or BE only.
 
@DeadMG Depends. The "Otaku Killer" still has an extremely bad rap in Japan.
 
11:32 PM
let everyone have it as native in memory
 
@Borgleader For Japanese, high school was the time when they had individuality. Once they enter the workforce no more. So they have fond memories of high school. Or so I read.
 
@DeadMG That's the first one :|
 
@R.MartinhoFernandes UTF16 according to your computer's view of it, right? (UTF-16 EF)
 
@ThePhD Yes.
 
template<template<class...> class T, class... Us>
std::tuple<Us...> Fx (T<Us...>);

template<typename Outer>
using foo_bar = decltype (Fx (std::declval<Outer> ()));

// foo_bar<Obj<int,float>> == std::tuple<int,float>
// can anyone think of a cleaner/better way to do this?
 
11:33 PM
@R.MartinhoFernandes I would argue that having it native ordering in memory is the implementation detail.
UTF-16 is just UTF-16NativeEndianness
at least, I think that is the most practical viewpoint.
 
typedef tutf16<uint16, Sys::CompiledEndianByteOrder> utf16; // <333
 
I won't go over the bytes thing again.
@ThePhD That's pretty much useless.
 
It's accurate. :D
 
an encoding form that can't be decomposed into bytes isn't of great use, really.
 
@ThePhD Isn't that uint16_t?
 
11:35 PM
@StackedCrooked I removed teh _t with all my own typedefs.
'cause hate underscores and lazy.
 
I mean, isn't that entire typedef equivalent to just uint16_t?
 
@ThePhD I did the same with Wide.
 
@DeadMG It can. That's why the encoding schemes exist.
 
@StackedCrooked Yah. :D
Unless I'm compiling on some whack platforms.
Then I take my best guess.
 
@ThePhD Will that be the same type as one of the other two? i.e. is CompiledEndianByteOrder a typedef to one of the others?
 
11:37 PM
and this got me thinking.. can anyone think of a hack to get the Indices... out of FooBar<size_t... Indices> without creating an actual instance of FooBar<...>?
 
@Insilico Do you happen to have the rearranged forms? I seem to be failing badly at it.
 
typedef uint16_t LittleEndian16;
typedef uint16_t BigEndian16;
 
@R.MartinhoFernandes Essentially. CompiledEndianByteOrder is typedef'd to one of the other two, in some complicated fashion.
 
@R.MartinhoFernandes Just skip it entirely and use UTF-16BE/LE directly.
 
@ThePhD So you can only use it to read from sources with an endianness that you don't really know. Great.
And you have no way to read from a file with a BOM (which should be what you use that name for).
 
11:40 PM
@R.MartinhoFernandes All of my readers call a function to crunch the BoM and use a runtime text encoding. Encoding Scheme UTF16 can't be accomplished at compile-time, unless it's just a wrapper that picks one or the other once you feed it a BoM.
 
Encodings are not a compile-time thing.
Also it's really BOM not BoM.
 
@DeadMG Sometimes not possible. E.g. getting a UTF16 XML file from the wire (BE), and one on your computer (LE). It's something you can only figure out at run time, and technically what something like utf16 would mean is really something with run-time mechanics in it, which is beyond the scope of a compile-time system. =[
@CatPlusPlus Yeah, but we're trying to make them as compile-time as possible. :D
 
What for?
 
@ThePhD Then when the hell with your tutf16<uint16, Sys::CompiledEndianByteOrder> be useful?
After you read a BOM and it tells you... What?
 
@ThePhD Nah, you would simply do "If BOM, swap bytes if necessary into native endianness; else assuming native endianness. Then copy into string."
 
11:42 PM
Mark your encoded blobs with encoding tag, and that's about it.
Note that you don't need UTF-16LE/BE encoding tag, because that's resolved while decoding.
 
@R.MartinhoFernandes It's just a plain typedef to give you either le or be, based on your system. Shrug. Maybe a better name would be utf16ef.
 
@ThePhD so... uint16 then.
 
And you can safely always write with host endianness and mark with proper BOM.
 
@ThePhD What's that useful for?
 
@R.MartinhoFernandes Laziness. text<utf16> <3
 
11:43 PM
The difference between the EF and the ES is that one can be stored on std::u16string and the other on std::string.
Where's my fucking charger cable.
 
charging shit?
 
I'm sure it isn't. I only own one device it can be used on, and said device is in my hands begging to be charged.
Shit, I left it at work.
 
xD
Well, you'll have to go a day without your phone. :D
 
oops
 
I need to buy another.
 
11:46 PM
can't you just go into work tomorrow and get it?
 
@DeadMG Yes, but since this is not the first time it happened, I'd rather just keep one in each place.
 
fair enough
I adopted a similar strategy with phone chargers
 
It's just a stupid USB->microUSB cable anyway.
 
Lol.
In either case, utf16es is impossible as a compile-time mechanic, and I have a run-time version of all the compile-time mechanics I make, so if I need encoding scheme I'll just switch to RuntimeTextEncoding<utf16> <3
 
@R.MartinhoFernandes That's what I do.
 
11:48 PM
There is a problem with my interface, however..
 
@ThePhD You should slow down and think more.
 
@ThePhD What you have is still useless (it is useful to encode and decode shit into/from... an unknown encoding).
 
How is it unknown? D:
 
If you know it, why aren't you using utf16le or utf16be?
 
Because not every programmer should have to check the endianess of their machine to decide which one is useful to have?
 
11:51 PM
@ThePhD You mean they should not know it?
 
The compiler figures it out.
Not the programmer. That's all that utf16 is there for.
 
@ThePhD And what happens when you write it to the network?
 
I don't know. That's a serializer's job. :D
 
The compiler cannot go across the wire and inform the other side of it, can it?
 
It can't. But neither can any other compile-time encoding scheme, unless you -- at runtime -- insert some additional information into the data when you send it across the network.
 
11:53 PM
So you'll always serialize with BOMs or something?
 
To convert host-encoded uint16_t to network encoding you have POSIX htons.
 
Yeah. Or a Tag of some kind.
 
y'know
what's amazing is that I had my old crappy graphics project listed on my CV, but not Wide.
 
by the way robot
I have a really bad feeling about Wide now.
 
11:55 PM
Is that a bad way to do things? D:
 
Is it self-aware?
 
no.
it's too easy.
I implemented in-class initializers yesterday and it was like, five minutes
almost every part that does not involve linking with Clang is just so easy now.
in fact, I gotta admit that I'm starting to get a serious case of the bored with it.
 
Are you going to rightfold Wide?
 
We all had our hopes up for Wide. Don't abandon us now!
 
(Man, that works great as a verb)
 
11:56 PM
probably not
but there's no question that my activity on it is a bit of a slump right now
 
Hire a whipper.
 
lol
and linking with Clang is really depressing
it's fuckin' impossible to get that shit to do what you want
 

« first day (992 days earlier)      last day (3965 days later) »