« first day (1638 days earlier)      last day (3328 days later) » 

12:00 AM
but this is from yahoo answers so it has as much credibility as a hobo who said he saw an UFO
 
FML.
 
@AlexM. I think the guy is right. I haven't yet failed my German course, trust me, I'm practically an expert!
 
@AlexM. /cc @R.MartinhoFernandes can you confirm?
 
your pet is a loading icon?
 
user1804599
12:03 AM
@AlexM. "Burger" is Dutch for "citizen".
 
there we go
awwwwwwwwwwwwwwwww
pet chickens <3
 
@райтфолд Hamburgburger?
 
user1804599
@AlexM. Hamburg-inwoner :(
 
@райтфолд So its not Hamburger?
 
@orlp Pet koalas are far better than chickens.
 
12:04 AM
hamburger in dutch is hot dog
can confirm am dutch
 
you're talking out of your ass
 
Hello my fellow C++ programmers.
 
can not confirm, am dutch
 
user1804599
@AlexM. bullshit
 
@orlp Poor keyboard.
 
12:05 AM
What did i miss?
 
user1804599
The point.
 
@CallumCarmicheal nothing, move along citizen
 
☑ rekt ☐ not rekt
 
@Borgleader Interesting point of view.
 
12:06 AM
borgleader always has his view at P(0, 0)
 
Borgleader is Original
 
@AlexM. I prefer the gluLookAt.
 
EWW NO
 
glu?
topkek
 
@Nooble don't like gl?
 
12:08 AM
be sure to plonk orlp if he gets on your nerves
 
Direct X?
 
he's like that
 
@AlexM. Sure, will do. XD
 
@CallumCarmicheal No I like OpenGL, I just don't like glu.
 
wasn't Glu this company that made nice mobile games in days of ages past?
 
12:09 AM
@Nooble What do you prefer OpenGL, or DX?
 
back in the java days
 
from what I've heard DX is better nowadays
but OpenGL is not microsoft
so I like OpenGL more
 
man why is it so hard to serialize a time_point
and deserialize it correctly
 
user1804599
What is a time_point?
 
I've seen the api for both, i would like to learn DX but the thing is not english, its kinda scary.
 
12:10 AM
@CallumCarmicheal I prefer OpenGL. I just don't use (you shouldn't either) the glu toolkit.
 
@райтфолд for instance std::chrono::system_clock::time_point
basically a point in time
 
user1804599
> Class template std::chrono::time_point represents a point in time. It is implemented as if it stores a value of type Duration indicating the time interval from the start of the Clock's epoch.
 
user1804599
Meh, leaky abstractions.
 
@Nooble So should i rewrite it not using the glu toolkit?
 
12:11 AM
@AndyProwl it's so hard because it's a time interval from the start of the Clock's epoch
 
user1804599
What is the problem with serialising it?
 
@CallumCarmicheal use glm
 
@Borgleader What major differences are there?
 
@CallumCarmicheal If you're doing OpenGL, you shouldn't be using the deprecated versions which use the fixed function pipeline. Use OpenGL 3 and above.
 
@Nooble Well crap, looks like i lost a week...
 
user1804599
12:12 AM
Use Noda Time and C++/CLI/CX/WHATEVERITSCALLEDIN2015.
 
@райтфолд I haven't found a way to do it correctly. I tried with the get_time and put_time IO manipulators, but you also have to use std::tm, std::localtime, std::mktime`, and whatnot
 
Noda Time is .net is it not?
 
@AndyProwl let me guess the representation is implementation defined?
 
it's a ridiculously complicated task
@Borgleader I don't know actually, I didn't want to fiddle with the raw representation of the date (also because I suspected it to be implementation-defined, although it might not be)
 
user1804599
@AndyProwl If it's the system clock, you know the epoch and you can use time_since_epoch.
 
12:14 AM
I got a common question, say to make a X84 64 CPU emulator would would be a good language, excluding c++?
 
user1804599
What are you using it for?
 
@CallumCarmicheal The fixed function pipeline is deprecated. You should be using the programmable pipeline (with shaders and all that). Here's a basic OpenGL 3.2+ tutorial.
 
@Nooble Thanks for that, ill read over it!
 
@райтфолд Yeah probably I should just store the number of seconds since the clock's epoch
 
user1804599
Beware of time zones.
 
user1804599
12:18 AM
I don't know how system clock deals with that (probably shittily).
 
I originally serialized the time zone through put_time, but get_time failed to deserialize it properly
 
user1804599
java.time and Noda Time are the only decent time APIs I've ever used.
 
Also some of the data serialized by put_time are not deserialized by get_time
 
I pray to the flying spaghetti monster I never have to write datetime code
 
user1804599
I ported part of them to PHP but lost interest. :P
 
12:19 AM
it's such a cesspool
 
@райтфолд what else is new :P
I'm an offspring of @ReSharper. I don't understand C#. But then again, knowing C++, why would I need to?
haha
 
@CallumCarmicheal The one language that you can actually handle? :)
 
user1804599
@AndyProwl What are you using chrono for?
 
@райтфолд I just want to store timestamps
and load them after
 
@wilx Well even if its C++, what language would be able to at least even if its just for 2% emulation, what language could cope with that many opcodes?
 
user1804599
12:23 AM
@AndyProwl Define "timestamp".
 
user1804599
It's a vague and overloaded term.
 
@райтфолд month, day, year, hour, minutes, second, time zone
or something like that
 
user1804599
time_point doesn't do that.
 
it doesn't?
 
@CallumCarmicheal You will inevitably have to use some tables or switches or perfect hashes to deal with that. It does not matter what language you are using.
 
user1804599
12:24 AM
It represents a point on a universal non-relativistic timeline.
 
user1804599
It doesn't deal with calendars and time zones.
 
@wilx okay, was just curious well thanks for help.
Well im off, i need to finish a OpenGL project. Cya and thanks for the company!
 
@райтфолд Yeah, well, I convert it to a time_t and then use localtime() and put_time. I do get a formatted representation of all that stuff
the problem is that I can't read out the same things that I wrote
 
user1804599
How are C++' time zone facilities?
 
I think it's C stuff
there are formatting flags for printing it out that you pass to put_time
I'm not really sure though, I'm quite ignorant about this stuff
I expected it to be simpler
 
user1804599
12:28 AM
Without proper knowledge of timezones you can't deserialise (day, month, year, hour, minute, second) tuples to instants.
 
Now I would even be OK with just storing/loading seconds
but even when I do that, the original time_point does not compare equal to the time_point I load
fuck it I think I'm going to sleep
 
lol
 
user1804599
@AndyProwl SSCCE.
 
@райтфолд Something like this, I guess
I'm sure I'm doing it horribly wrong
 
user1804599
@AndyProwl stored mayn't use seconds.
 
user1804599
12:35 AM
And std::chrono::duration_cast<std::chrono::seconds>(…) loses information.
 
I see
Can you think of a reliable way to take a time point, serialize it, deserialize it, and get something that compares equal to the original?
 
> mayn't
 
user1804599
@AndyProwl You have to store the original unit of measurement as well, or immediately cast after calling now.
 
I see
I will do that
 
user1804599
12:39 AM
Basically what you did was converting e.g. 1.5s to 1s, writing it to stream, reading it from stream and then comparing 1.5s == 1s which is false.
 
thank you
@райтфолд Yep
 
user1804599
@AndyProwl Or convert both to the highest possible precision, which is easier.
 
user1804599
Or use std::chrono::system_clock::duration for everything, but then your serialisation format is not portable.
 
@райтфолд You mean using nanoseconds? It still doesn't compare equal (coliru.stacked-crooked.com/a/9019e3b6e0415ca1)
 
user1804599
Best bet is using std::chrono::duration<std::uint64_t, std::yocto> although you may run into trouble with bit width.
 
user1804599
12:42 AM
Or create your own clock that wraps system_clock.
 
Do any of you know of tools similar to qt's rcc? That lets you embed files into your application during compilation and look them up within your source too?
 
user1804599
Lemme make an example.
 
Thank you for helping, I have to go to sleep
I'm too tired and this shit is making me feel sick :D
 
user1804599
@AndyProwl wait wait almost done!
 
this seems... okay i guess
 
12:48 AM
@райтфолд When I feed VC++ with your Coliru example it dies on enable_if. Computer hates me. Time to sleep
 
user1804599
Bye.
 
user1804599
I will write the example anyway.
 
user1804599
And post it here. :D
 
:D ok, thank you
 
user1804599
12:53 AM
std::int64_t us = -1; is also important; with auto us = -1; you may get integer overflow.
 
auto us = -1ll;
probably sucks :P
like the int64_t more
 
user1804599
I don't think I use int anywhere in the Mill VM.
 
user1804599
I almost always use std::size_t.
 
user1804599
Or one of the integer types from <cstdint> in case I need serialisation.
 
user1804599
% ack '\bint\b' src
src/main.cpp
23:int main(int argc, char const** argv) {
 
user1804599
12:58 AM
The only two occurrences of int in the entire codebase.
 
user1804599
I should keep a Git repository of all these C++ snippets I write.
 
1:13 AM
what do you then use for negative integers?
I agree that most of the time I use std::size_t for positive ones (and not int)
 
user1804599
Depends on what I need them for.
 
funny enough, I wrote like a 10k software library for my own research, and realized that I actually don't really need negative integers, except when I generate random numbers
in which case I tend to use long long int
but int by itself is out of question
 
user1804599
I'm implementing a VM which must support signed arithmetic, so in that part I obviously use signed integers.
 
Still, I use int when writing an answer on StackOverflow, as it saves me typing
yeah, but in that case I'd use a fixed (pseudo-fixed) format
like int_t
intXX_t
 
user1804599
But that's not an int but a boost::multiprecision::mpz_int. :P
 
1:16 AM
no no, was talking about int64_t and so on
 
user1804599
I wasn't.
 
mpz is a different beast
aaa ok
you want \infty precission
"precision"
in that case I'd just use boost (or gmplib)
 
user1804599
I have some places where std::distance returns a signed integer which I then immediately cast to std::size_t to prevent the compiler from complaining about a comparison between a signed and an unsigned type.
 
user1804599
std::distance can never return a negative number anyway so it's safe.
 
user1804599
I have an enum of which the underlying type is int but you don't do arithmetic with it.
 
1:19 AM
afaik it returns a std::iterator_traits<InputIt>::difference_type
 
user1804599
And my interpreter uses std::int32_t for the PushZ32 instruction.
 
user1804599
I guess that sums up the signed integers my code base uses.
 
I see
and I see the issue with the conversion, it can be negative indeed if it0 > it1
 
user1804599
no.
 
user1804599
The behaviour is undefined if the end iterator is not reachable from the begin iterator by (possibly repeatedly) incrementing the begin iterator.
 
user1804599
1:22 AM
So it can never return a negative number for a well-defined program.
 
yes yes, but you can do std::begin(v) - std::end(v)
 
user1804599
Sure.
 
user1804599
That's almost the same thing.
 
are you sure about that? that the code above is UB?
 
user1804599
Yes, that's UB.
 
1:24 AM
ok, yes, at least on cppreference it seems so
wonder why it gives -3 though and how they implemented it
 
user1804599
Oh wait, nevermind.
 
user1804599
It's well-defined if the iterators are random access iterators.
 
"increment"
can you increment by "-1"?
we should edit that cppreference page, as it is not altogether clear
although
"The behavior is undefined if last is not reachable from first by (possibly repeatedly) incrementing first." is technically correct
 
user1804599
> 4 Effects: If InputIterator meets the requirements of random access iterator, returns (last - first); otherwise, returns the number of increments needed to get from first to last.
5 Requires: If InputIterator meets the requirements of random access iterator, last shall be reachable from first or first shall be reachable from last; otherwise, last shall be reachable from first.
 
in case of random access iterators, you can access the end/begin
where is this?
in std.pdf?
 
user1804599
1:27 AM
It's in the standard.
 
ok I see
 
user1804599
24.4.4 [iterator.operations]
 
I learned something than :)
 
user1804599
I wish the standard was available in HTML format. Copying text from a PDF is horrible.
 
YES, INDEED, I hate it, especially when trying to ask a question
answer a question
I think there is some github code that does it, I remember seeing it somewhere
but cannot recall now
but you can probably manually compile the tex file into some html format (I have the source but never tried to compile to html)
 
1:37 AM
My flight got delayed for the next hour.
Ugh.
 
user1804599
2:04 AM
I can't get it any better than this: coliru.stacked-crooked.com/a/33d132b383cf1ddd
 
user1804599
I want to have the > on line 15 but I can't find a way to do it.
 
do you really need to wrap that in enable_if thing in a macro
 
ew
 
I'm writing a small util to parse a json file and generate a c++ file. I need names for JSON attributes that mean something like "prepend" and "append" to allow the user to add code at the beginning of the c++ file and right at the end... Anyone have any suggestions? So far I've thought of: prepend/append, prefix/suffix
 
why..
just use a JSON library..
 
user1804599
2:09 AM
@Rapptz It's not ew.
 
you're right
 
user1804599
I want forwards-compatibility.
 
it's disgusting
 
user1804599
clang already has reasonable diagnostics for std::enable_if.
 
user1804599
But typename = typename std::enable_if<…>::type is fucking ugly.
 
2:10 AM
the , void> is default
 
user3010322
typename = std::enable_if_t<....> // drops the ::type
 
user1804599
Meh, still ugly.
 
no typename needed there
you had it right the first time
 
user3010322
@Rapptz I've spent too long in Java land.
 
user1804599
If you want SOME_MACRO(…) { … } you can do the lambda trick, or in the global scope the function trick.
 
user1804599
2:12 AM
But I can't think of any place you can have a trailing type name.
 
user1804599
I want a type-level comma operator.
 
@ThePhD The error message is much worse with enable_if_t, though :/
 
user3010322
@Griwes That's pretty lame.
 
lol yeah
gotta love Clang special casing
only std::enable_if gets special treatment
 
user1804599
Btw are there traits for checking iterator categories?
 
2:19 AM
haha
 
no
 
Mcdonalds does delivery in Korea
I've just made an order
 
user1804599
Like is_forward_iterator<T>?
 
It takes u 30 minutes
 
user1804599
Oh. That's shit.
 
2:19 AM
nope
 
@Rapptz Do you workout?
 
user3010322
@райтфолд std::is_same and then use iterator_traits<...>::category or w/e it is
 
user1804599
Uh, no?
 
user1804599
That returns false when checking whether a pointer is a forward iterator.
 
user1804599
Because it doesn't consider supercategories.
 
user1804599
2:22 AM
You can use std::is_base_of.
 
user1804599
> There is no separate tag for ContiguousIterator
 
user1804599
fail
 
> A wiki does NOT qualify as official documentation. If possible, avoid wikis entirely. Having a wiki gives off a bad impression to new (and existing) users.
Is this true?
 
no
just someone with strong opinions
 
@Rapptz I am using a json lib, I read in the json lib with a c++ util to generate a c++ file. the prepend / append bits add like a 'header' or 'footer' (hey! header/footer is another pair of words I can use)
 
2:44 AM
Anyone been able to use libclang on windows?
Need the configuration headers but there is no version of the configure tool/script for windows
 
2:56 AM
Hi
 
What's up?
 
user3010322
Yo!
 
nm, slow friday night
 
user3010322
Dat weekend?
 
3:03 AM
boredom
 
I'm only at my 2nd gin tonic.
Very slow Friday indeed.
 
bit drunk
where the hell is @Martin
@Puppy Good news!
 
You're so mean.
 
Wait, has your name always been racis in obrit, or have you somehow changed it? So insane ive never seen its misspelled
ALWAYS read it as "Lightning races in orbit"...
 
It was never that
 
3:17 AM
wow
Either im dyslectic or my brain is on constant autocorrect
 
13 hours ago, by Lightning Racis in Obrit
yesterday, by Lightning Racis in Obrit
1 hour ago, by Lightning Racis in Obrit
I changed it for the morning of April Fools' Day, not realising that Snack Overgrow sealed the loophole allowing us to change our nicks as many times as we have Stack Exchange accounts. Long story short, (a) I can't change it back until May 1st, and (b) the joke's on me.
@DavidKron fail
also SO oneboxing fail, to a degree
 
how can std::string's interface be so bad
 
dude
where have you been
 
I know I know
 
Rekktz, C++. C++, Rekktz.
 
3:20 AM
I'm just ranting
 
renting
also it's not that bad..
 
lol
 
It could have been IString
 
std::string::replace is pretty fucking retarded
 
so many abjectly shite questions tonight
> I don't know why my C++ class won't print
> How do I make this C++ code into a function?
> I don't quite understand what does the reference mean in this function, I got an error if I delete the reference.
ffs
 
3:22 AM
Just tell them to "install" debian
gentoo
*
 
Divad Kren
@MARTIN where are you
 
@Rapptz Those who fail to study SNOBOL are doomed to screw up what it so long ago did utterly beautifully.
 
Well that might be as close you are ever getting to saying my name, so I guess i should be honored
 
TIL Forbidden Planet is based on Shakespeare's The Tempest.
 
3:26 AM
853 undefined references, hurray linking time
Now i just have to hunt down which of the 100+ clang+llvm libs i need...
 
OMG Avengers is going to be in theatre in 10 days
SHIT
 
10 days srs
wow
cool
that sounded sarcastic but it wasn't
> You stayed at Chris' ?
FUCK YOU FACEBOOK FEED APPEARER
GET APOSTROPHES RIGHT
argggghhhh
 
3:50 AM
bye
i'll go take my haskell pdf to bed
 
Protip: don't chug a gin tonic.
 
it's starting to look like real standard library code: github.com/orlp/pdqsort/blob/libstdc%2B%2B-merge/pdqsort.h
 
Not speaking from experience. Maybe.
 
in all its uglified glory
 
lol
 
3:56 AM
tomorrow I'm going to expand my benchmark suite with more tests for expensive comparisons (strings) and benchmarking under C++03 (no moves)
 
4:23 AM
I am working on various things while watching this little crow tearing a maccas bag into pieces, trying to find leftover inside
 
purchase a feline
to rid yourself of the crow
 
I'll pay you to take mine
 
you don't want your kitty? :(
 
streambufs are cool
std::ifstream file(...);
std::istreambuf_iterator file_it(file);
std::istreambuf_iterator eos;
std::vector<char> list_bytes(file_it,eos);
 
that's not a streambuf
 
4:33 AM
hmm should I be using istream_iterator instead?
 
no
it's slower
but that's an iterator, not a streambuf
 
Yeah, I should have written stream iterator
I didn't know they were a new c++11 thing
 
they're C++98
 
I should learn to read without making assumptions I guess... kinda assumed they were c++11 from that blog post
 
meh C++ blogs
most are pretty bad
@Pris lol none of that is C++11
quite impressive
I mean, it works in C++11.
 
4:40 AM
what about the uniform init {}
 
the text is so small I couldn't tell
How not to blog
small ass text
I see some using statements etc
But the core idea is not C++11 at all
 
man I really hate 'char' not being defined as signed or unsigned but it being the default for data bytes
unsigned char is best char
 
k
char, unsigned char and signed char are all different types
just saying
alright fuck make
 
Is there a reason that char isn't always one of the other?
 
@Pris char is one of the two
 
4:44 AM
yeah and if I remember right its a platform dependent thing
but why isn't it fixed as one
 
char is not signed char or unsigned char.
It can be signed or unsigned
but they're distinct types
is_same<char, unsigned char>() || is_same<char, signed char>() returns false.
 
good point
 
I just tried to make my ifstream <int8_t> and it failed, but <char> works
 
@Pris Historical baggage.
 
4:46 AM
actually i think theres a thing about ifstreams only working with char
or something
 
prolly strings too
 
No char_traits specialisation.
 
aren't strings templated on char
 
It's complicated for streams.
There needs to be ctype and other facets available.
Along with char_traits.
like num_get and num_put etc.
 

« first day (1638 days earlier)      last day (3328 days later) »