« first day (1648 days earlier)      last day (3302 days later) » 

6:02 AM
Static reflection is much more fiddly than I imagined.
 
Or I guess it’s really internal recursion that’s fucking me up.
I guess I can separate the static reflection from the recursion, leaving the latter as a 'useful' default.
 
There is an internal function in gcc for bitswap in a header something like <bitswap.h>
Not getting that name in mind
byteswap got it
 
Internal iteration in the guise of recursion, is what I meant.
 
6:22 AM
are Java Doubles different from C doubles ?
 
no
 
I have a client that sends double with writeDouble on a socket. I am on the recieving side.
 
@Rapptz It’s IEEE 754.
 
I am not able to parse it
 
@LucDanton ?
 
6:24 AM
yes and C doubles are also IEEE 754 ?
 
@NeelBasu It’s not required.
 
oh pedantry
@NeelBasu 99.9% chance
 
@Rapptz It’s not pedantic. Different projects use different flags.
 
@LucDanton so is there anything special I need to do to parse floats >
?*
 
@NeelBasu They'd be hanged if a compiler don't support it.
 
6:25 AM
This may not affect serialization but spreading the myth leads to sloppy reasoning for operations and the like.
 
I don't know anyone who uses -Ofast.
 
@NeelBasu dunno
 
@Rapptz Somewhere between -O0 and -O*N*?
 
it's just -ffastmath for C++
 
I’ve seen it in the wild.
 
6:28 AM
Hi
 
Fast math: fast to execute, fast to break your software.
 
I can read the double with python struct.pack
 
give an SSCCE m8
maybe I should just use SDL again
 
Hey so um I've been flogging around my junk again: compactcpp.wordpress.com/2015/04/01/… Is it bad?
 
too lazy; didn't read
 
6:32 AM
@Rapptz first use of std::cin
first mention of operator overloading
explained use of std::cout
abstraction is awesome for the C++ std lib
(note: people hook in lower, platform-specific functionality into C++ to allow it to do stuff)
Finally, floating point numbers don't work with std::cin >> int;
 
std::cinch
 
Not getting an way to parse 64-bit IEEE 754 floating point in C
 
Why...
 
fatal error: sscce.cpp missing
 
@NeelBasu ...
Sucks.
 
6:37 AM
Don't know just casting char[8] dont work
 
@NeelBasu well duh.
 
@Rapptz Use a bigger spoon.
 
You're casting a bunch of disjointed characters to a float and then expect it to work
 
they're bytes m8
 
@NeelBasu Sounds like you need a lexical cast
 
6:38 AM
pls stop
 
@Cinch No no its raw binary
 
@NeelBasu Oh.
That's what you mean
IEEE Float has a specific format lol
 
some one on clientside is doing writeDouble through a Java socket to my server.
 
@NeelBasu Well are you sure it's the raw data? And not still wrapped?
 
Yes ues
yes*
 
6:40 AM
Okay then we gotta get into formatting
Double-precision floating-point format is a computer number format that occupies 8 bytes (64 bits) in computer memory and represents a wide dynamic range of values by using floating point. Computers with 32-bit storage locations use two memory locations to store a 64-bit double-precision number (a single storage location can hold a single-precision number). Double-precision floating-point format usually refers to binary64, as specified by the IEEE 754 standard, not to the 64-bit decimal format decimal64. == IEEE 754 double-precision binary floating-point format: binary64 == Double-precision binary...
IEEE starts with the sign bit
11 bits to hold the exponent, all together
 
Yes but isn't C IEEE 754 also ?
 
and then the rest is the "fraction"
 
So doesn't just casting char[8] to double should work ?
 
@NeelBasu No.
Did you not hear me?
Casting directly will cast the 8 bits to god knows what
 
pls stop Cinch
 
6:41 AM
You gotta extract the first bit first
 
@Cinch OMG so I need to do the whole math by myself ?
 
@Cinch Is the no library ?
 
gosh
 
@NeelBasu ...
 
6:42 AM
Check endianness.
 
Alright, groceries. I’ll make sure to bring popcorn.
 
@NeelBasu So you seriously think there's no library for handling the extraction of floats from binary. In C. For networking.
 
@Cinch No no I am aksing for a library
 
@Rapptz It's endianness?
Ah fuck I'm wrong. Like always
Where's my dunce cap somebody give it to me
 
@R.MartinhoFernandes thanks
not sure how much longer it would have been
 
6:45 AM
@R.MartinhoFernandes checked
@R.MartinhoFernandes first converted to uint64_t then did __bswap_64 on it and then casted to double again
that didn't work too
 
@Rapptz Someone linking that floating-point paper/page.
 
Check the bits.
 
Then the other thinking to implement the whole standard. :P
 
@R.MartinhoFernandes but is there a library for that ?
 
@NeelBasu Why don't you just print out the bits one by one
 
6:47 AM
lol
 
or do the hexidecimal thing
 
did hex dump
I can see hexdumps
 
1.2345 correctly gives me 0x3ff3c083126e978d
 
Ah god I hate C never mind
 
40:69:60:00:00:00:00:00
this is the hex dump
when I cast it to double I get 0
absolute 0
 
6:48 AM
Ohhh so it's endianness
 
I can't repro this at all
 
I tried not doing __bswap_64 then also It didn't work
 
What computer are you on?
 
something's probably fucked up with your data sending/receive or the transformations you're doing
 
But I am getting the same data on python
 
6:50 AM
@NeelBasu Okay this isn't 1.2345 in any endianness
I'm pretty sure
 
itstimetostopposting.png
 
@Rapptz nevar.
 
Oh hey it's Cinch
 
@Cicada I've been here before you
no this is my line
"Oh hey it's Cicada"
 
@Cicada time for you to scroll up
 
6:51 AM
@Cicada Did you bring my dunce cap?
 
@Rapptz shudder
24 mins ago, by Cinch
Hi
So this is how it began.
 
@Cinch Nah.
 
double a = Double.longBitsToDouble(0x4069600000000000L);
double b = Double.longBitsToDouble(0x0000000000606940L);
System.out.println(a);
System.out.println(b);
203.0
3.1217044E-317
@Cinch I agree.
 
@Rapptz Damn it
I need it
@fredoverflow Ugh C is too fucking screwed up
I have shunned it ever since I've seen it
 
long x = Double.doubleToLongBits(1.2345);
System.out.printf("%8x%n", x);
// -> 3ff3c083126e978d
@Cinch Have you shown us the code that does the conversion yet?
 
6:56 AM
@fredoverflow Not my problem
@NeelBasu It's this guy's
 
oh nvm then
 
I'm not going to dive into C
 
this is C++ too
 
@Rapptz Why the hell
would I want to do this myself in C++
 
@Cinch You can in C++, if you buy this book...
 
6:57 AM
networking is fun
 
@Rapptz ah god
Why do they do the endian thing anyways?
 
@StackedCrooked is having fun.
 
because consistency is good
 
@Rapptz no
I mean why are they still split
And why did they decide to do one or the other
 
> wiki: endianness
 
6:59 AM
It's not like one is superior, from what I can make out
...
oh shit
Little endian is better?!
wtf
...Of course little endian is better
 
wot
I might as well not even ask
 
Big Endian = Tabs
Little Endian = Spaces
2
 
No
Little endian is slightly superior because you can easily cast from one size to another without having to reset the address
 
Who cares? You get offsets for free in today's architectures, don't you?
 
@fredoverflow Hm idk
In my head, I'd see that it'd be easier to host extensible types with little endian
 
7:03 AM
mov al, [esi] isn't faster than mov al, [esi+7], for example.
 
also UTF-8 is somewhat of a little-endian format
 
@Mysticial Can you confirm?
 
@Mysticial pls respond
 
I called him a noob today on Steam and he didn't reply
 
He probably doesn't know how
 
7:04 AM
@fredoverflow no that's not the point
 
What is the point then?
 
The point is that having variable length types might be easier on the lower level
i.e. I just add a byte to the end to make my int larger
Casting is as easy as adding two bytes to the end
Or taking them away
 
Variable length types? What have you been smoking?
 
@Cinch Make your int larger today! Just add a byte to the end! [As seen on TV] [100% natural] [Results guaranteed!]
4
 
@fredoverflow i.e. casting from long to short is as simple as reading two less bytes or something like that
 
7:06 AM
@Cinch Again, mov ax, [esi+6] or something.
 
@Rapptz He's probably on the process of moving his stuff.
 
this also has the added bonus of having short and float's mantissa be identical i think (up to the data capacity of short)
 
How? short is 16 bits, float is 32.
 
Mantissa is 23 though
 
@Cicada ...Assuming this is unsigned
 
7:07 AM
Do you have any idea how the mantissa of a float actually works?
 
Sign is not part of the mantissa (as the name suggests)
 
@fredoverflow Is it just an integral?
 
Because getting at the lower 16 bits of a mantissa is pretty much useless.
 
It's just an integral, right?
It's like scientific notation
 
Just read an article about it for the love of Bjarne
 
user1804599
7:09 AM
identification division.
program-id. hello.
procedure division.
display "Hello, world!".
 
@rightfold Cobol?
 
user1804599
@fredoverflow big endian ftw, but I use little endian to make decoding faster!
 
bummer
 
@fredoverflow lower-case cobol
 
7:10 AM
Hello everybody
Today, I became linux sys-admin :/
 
user1804599
@khajvah R.I.P.
 
So you've got nothing to do? Welcome to the Lounge...
 
@rightfold Exactly
 
@fredoverflow lol
 
@fredoverflow Good one. I am actually a developer. I just had to configure a linux hosting server
 
7:12 AM
What are you developing? Countries?
 
Okay
 
@fredoverflow yes
 
So it's just sig fig.
 
Are you a Minecraft Developer?
 
@fredoverflow I am a president
 
7:13 AM
AMAZEBALLS
 
user1804599
Such ich dich hinter dem Licht
Wo bist du, wo bist du
So allein will ich nicht sein
Wo bist du, wo bist du
 
Terrible German
 
ja ja
 
user1804599
:v
 
Hm but then again big endian is better for enlargening systems
welp it's Yin endian and Yang endian I guess
 
7:14 AM
Big endian is better if you want to be able to read byte strings in memory or something.
Like 0x12345678 looks like 12 34 56 78 in memory.
Whereas in little endian, you would see 78 56 34 12.
 
user1804599
big-endian is actually human-readable
 
But who wants to look at memory, anyway?
 
@Rapptz That’s not even it. That breaks C or C++ conformance, but we’re concerned with floating-point here. Have a look at the section that follows. Some flags preserve language conformance, some twiddle with IEEE conformance, and some flags affect both!
 
We don't take kindly to flags in the Lounge!
@rightfold Can you make that a compile-time if?
 
7:16 AM
@rightfold This guys.
 
user1804599
It is a compile-time if.
 
Oh, you can mark ranges in github links? awesome
 
user1804599
It's called inlining and constant folding hth.
 
Looks like a run-of-the-mill runtime if to me...
 
user1804599
But if you're really paranoid, you can make bo a template parameter, sure.
 
7:16 AM
@Rapptz When I make an irrelevant pedantic aside I normally note it with e.g. 'strictly speaking', 'nitpicking', and so on. I honestly believe the distinction matters here.
 
@LucDanton Strictly speaking, when I make an irrelevant pedantic aside I normally note it with e.g. 'strictly speaking', 'nitpicking', and so on. I honestly believe the distinction matters here.
 
Good demo.
 
@rightfold Everbody's paranoid when it comes to performance.
 
lies
good morning
 
@sehe good evening
 
7:19 AM
@fredoverflow that's lacist!
 
@sehe Homophlobe, you meant ;)
> Please consider disabling your adblocking software, as a 16 year old developer I can only keep the site running through ad revenue. Alternatively, please consider donating.
Your age is fucking irrelevant you adwhore
 
user1804599
 
@Cicada Also, consider donating
 
There, considered it.
 
@Cicada You are a good man.
 
7:26 AM
@Cicada yes, I agree with Luc
 
Were you forced to
 
@LucDanton -ffast-math enables most of these
 
oh my oh my, I have serious sneezes this morning
 
@Rapptz That’s not the point.
 
59
Q: What is the advantage of little endian format?

CrackerIntel processors (and maybe some others) use the little endian format for storage. I always wonder why someone would want to store the bytes in reverse order. Does this format have any advantages over the big endian format?

 
7:37 AM
I was browsing reddit
when suddenly
rapptz, stackedcrooked and STL
small world :P
 
Why is the default reddit logo like that?
(I know the meme, but I don't know why it's there)
 
@thecoshman That's good, serious sneezes make you look more professional than, say, humorous sneezes.
 
4/20
 
4/21 21/4 doe
 
@Cicada I am totes a pro
 
7:40 AM
@NeelBasu we're all aksing
 
@Rapptz Some US holiday?
 
stoner joke
 
OIC
 
@orlp @StackedCrooked is disloyal to SO!
 
@Rapptz you guys seem to have a real obsession with that number
I read that some town had to get rid of their 420m sign because it kept getting stolen
 
7:43 AM
@orlp I am imagining STL linking that thread in the error message.
 
7 hours ago, by milleniumbug
You know SO is doomed when you are afraid to ask such simple questions.
 
SO is doomed because an increasing number of students seems to mistake it for a helpdesk site.
 
I like how STL's tidbit has more upvotes than me :(
 
SO is so doomed.
 
@fredoverflow that and it's obsession with saying questions belong else where
 
7:45 AM
@Rapptz He's an upvote magnet.
 
@Rapptz people care about him...
 
@StackedCrooked yeah I know
 
@StackedCrooked He's an upvote magnate.
 
@fredoverflow it's not?
 
@thecoshman Implying?
guys I have a genius plan
 
7:46 AM
> Implying people on reddit are people.
 
we build "csstudents.stackexchange.com"
 
user1804599
I need a data type for user IDs.
 
dump all the shitfest to there
 
user1804599
I thought of just [16]byte.
 
@orlp CSS students? :P
 
7:47 AM
keep SO clean
@MarkGarcia CSS TU dents
 
@rightfold double
 
user1804599
The only reason Stack Overflow is full of shit is because the people who post that shit are the ones that don't use AdBlock (since they're noobs) and therefore the ones that keep Stack Exchange alive.
 
@fredoverflow You're a genius! Double the number of users!
 
user1804599
@fredoverflow :(
 
The SE business model is based off Careers, not ads.
 
user1804599
7:49 AM
How about Booleans?
 
@rightfold I have adblock, and it doesn't block the career ads
 
what ads
 
which is fine with me
 
@rightfold ¬_¬ I was just going to say that
 
user1804599
using UserID = bool;
 
7:49 AM
@Cicada the ones for nub cakes
 
user1804599
@orlp You must be using some shitty AdBlock ripoff then, such as AdBlock Plus.
 
@Rapptz I think it's a little far fetched to claim they have a plan
 
user1804599
I see no ads at all.
 
I think it's a little far fetched to claim they don't.
They're a business, of course they have a business plan.
They're not stupid.
 
@Rapptz I'm a person, I don't have a person plan.
 
7:50 AM
@rightfold I use ublock
 
gj
 
user1804599
As I said. :D
 
and it doesn't matter what blocker you use
 
it's about the lists
ublock is better than adblock lol
 
7:51 AM
I use uBlock too
 
user1804599
using UserID = std::tuple<>; // my program won't have more than one user anyway
 
@rightfold ... so struct user_id{};
 
also I'm talking about this ad
it doesn't bother me
 
might spot something interesting
oh noes, it's bartek
everyone stop barteking
 
7:52 AM
lel
 
@orlp hehe, backend
 
user1804599
@orlp I don't see that.
 
I've decided I'm going to do the A licence next year
 
for the most part I didn't care about adds, but then they started playing annoying voices
 
@thecoshman ? never had that
 
7:53 AM
never had it either
I have adblock off on SO
 
@BartekBanachewicz the full bike right? These letters must be EU standard
@orlp no on SO
 
user1804599
I see only upcoming events, featured on meta, hot meta posts, favorite tags and Hot Network Questions.
 
@rightfold A chat program limited to one user would be useful. You could call it "Logger" or something.
 
@Rapptz too much effort to sort that out
 
7:53 AM
@rightfold do you have a careers account?
 
user1804599
Yup.
 
@thecoshman lol
so much effort to click a button
 
@fredoverflow it wouldn't be long before people start reading the logs, and then using the program like a terrible terrible BBS
@Rapptz you turn it on and off each time?
 
user1804599
@thecoshman Is a BBS a big black shit?
 
I just keep it off
the "ads" don't bug me
 
7:55 AM
@thecoshman yeah. arbitrary size. And I believe they are standarized across the EU yeah
 
@Rapptz you have a one click "don't filter this site"?
 
yes
 
o_0 woah...
 
what the hell do you use
 
I'd have to click TWICE!
 
7:55 AM
ABP on FF does that.
@thecoshman dammit
 
> Instead, where the [Honda CB 500] X comes into its own is as an all-day, ‘man’-sized, touring capable and truly versatile machine – yet one which remains about as daunting as a basketful of kittens.
lmao
good review
 
@BartekBanachewicz clearly that person has never had kittens grow up
 
KITTENS <3
 
either that, or that bike is a big pile of crazy
 
I want a cat :(
 
7:58 AM
Kittens, yay, cats, complete and utter pain in the arse.
Cats are fuckers
utter twats
 
@CatPlusPlus ^
claw him
 

« first day (1648 days earlier)      last day (3302 days later) »