« first day (1965 days earlier)      last day (3209 days later) » 

I am getting this when reading from a named pipe (message mode) in C++.
It is supposed to be the string "0123456789", no idea why it ends up like this...
is it supposed to be wchar_t?
@Mikhail: The message is sent to the named pipe by C# as a normal string.
On the C++ side I read it with ReadFile() into a TCHAR[512]
06:05
What encoding was it printed as?
And which encoding are you reading it as?
its trivial to check in the debugger if the encoding is messed up
@Aaron3468: On the C# side it is just StreamWriter.WriteLine("0123456789")
@NicolasRaoul You are getting that. Your sending side has converted your string into ASCII or another 8 bit encoding but your receiving side is reading the stream a wchar_t at a time instead of char at a time.
@wilx: Thanks! So I should force C# to send as wchar_t (which if I understand correctly is the same as the C# string) right?
06:09
@NicolasRaoul Dunno. Probably.
@jaggedSpire Have a good one
↑ Now with C# StreamWriter configured for UTF-8
You might also consider encoding the sender to utf-8, and decoding on the receiving side as utf-8, because data structures aren't always represented the same in languages while encodings are fairly constant.
@NicolasRaoul neat you speak korean
perhaps the computer is trying to tell you something??
who wants to bet it's the BOM
@HubertApplebaum: My Korean skills tell me it reads to something like "meues" :-)
06:17
meu-it
Thanks^^
and then tchaek tchaek tchaek
@NicolasRaoul Looks like wchar is utf-16 encoded
And tchar is the same as wchar in most C++ platforms
FYI it looks very much like utf8 BOM
48111 is BBEF which is the beginning of utf8 bom
And then the first byte of the 2nd char is the rest of the bom
so everything is working fine!
it's just UTF8 that you're interpreting as utf16
we've been saying that for the last 30 minutes :-)
06:20
another mystery solved by luc danton hubaum applebert
Mikhail was your trusty Watson
I prefer Crick
Was I the commentator (narrator)?
06:33
Right now I'm working on an emulator project and I'm trying to decide how I'll implement the virtual memory. So far I have a bytearray and I'm considering loading and managing pages so I can control reads/writes to memory addresses. For example, ignoring writes to ROM or interpreting writes to addresses as swapping memory banks.
make every address an object
unique_ptr?
Would that be memory efficient? I can definitely try a wrapper class, and not writing one is premature optimization
A translation lookaside buffer (TLB) is a cache that memory management hardware uses to improve virtual address translation speed. The majority of desktop, laptop, and server processors includes one or more TLBs in the memory management hardware, and it is nearly always present in any hardware that utilizes paged or segmented virtual memory. The TLB is sometimes implemented as content-addressable memory (CAM). The CAM search key is the virtual address and the search result is a physical address. If the requested address is present in the TLB, the CAM search yields a match quickly and the retrieved...
and also just steal the code
I guess if you really wanted to emulate it like that, the more accurate thing to do would be to make each cacheline an object.
06:39
> As per standard business, I can’t say anything about release dates or future content, but I can say that we recognized that megaservers were a problem quite some time ago.
Then you can tag it with all the other things that the processor would (dirty bytes, TLB segmentation stuff, cached or not)
Haha, I basically had the pseudocode of a TLB
But a very crude one >.<
It's such a strange experience to start a project and realize you've been fumblingly recreating the same algorithms and data structures that already exist
Learn your lesson, google it first
06:49
lol people taking my advice seriously
:star:
You've earned it!
@LucDanton TMI
@HubertApplebaum Now I'm not sure if your advice was sarcastic, or if people don't usually take your advice
that's the spirit!
boost.spirit
06:54
spirit++
I wonder if ++spirit++ would evaluate... I'd laugh so hard if I found it intentionally used for no reason in source code
I checked stackoverflow... No results. Is it possible check if an instance of an object was cast invalidly?
A dynamic cast will fail if the attempted cast is invalid. All other casts are static and as such the concept of "instance" doesn't even apply there.
For example:
sample1* y = new sample1();
sample* x = ((sample*)y);

Then "x" is passed to a function(sample*);
Here dynamic_cast doesn't pick up the invalid cast.
Of course no problem if you avoid c-style casts....
So again... is it possible to check for an invalid cast?
Or should I just ignore this?
07:13
You just answered your own question
In other words, avoid c-style casts.
yes
everytime you use a c-style cast you lose 2 years of life expectancy
Why doesn't the compiler/intellisense in VS pick this up?
Yeah, there's a reason C++ improved C with so many features; use the new libraries and syntax because they will solve problems you didn't know existed
Lol.
07:15
VS is retarded
But
C style cast says "shut up I know what I'm doing"
8
Ah...
So you get what you asked for
ie garbage
Alright, that solves my question then. Thank you.
I'm gonna get coffee before I fall asleep on my keyboard
Get me some too!
07:19
Oh! And here is an interesting thing I found. So you can "swap" integer values between variables using an XOR swap. Although if you do the XOR swap like this: "x ^= y ^= x ^= y;"

That will compile in C++ and evaluate properly, but not in C#. No idea why--not that anyone should ever do this regardless...
It'll compile in C#, but not evaluate properly.
Any ideas?
x = x + y; y = x - y; x = x - y equally pointless when you can use a temp variable for no cost.
It may be that C# parses and executes the statement in a different order
For example if you did this in .NET though: x ^= (y ^= (x ^= y));
It still fails.
Apparently strcmp( abc , abc\0efg ) returns different form zero.
The second argument is a char[] that contained abcdefg but I replaced d with \0
Am I missing something? Is there another strcmp that stops comparing when it reaches \0?
oops
07:36
are you doing this on purpose
0 if equal I guess
My bad
this isn't the C room
Lol.
07:47
Isn't this sweet?
whats midi?
also why are there only 12 sticks in that box?
@Mikhail Size or brand of the pocky? The point is the picture, not the food!
More sour, because its lemon flavor
@wilx gay
typical chinese
Makes me want to watch Fruits Basket again.
07:52
I think its very much a double standard
@Mikhail Fan art that hits right in the feels. I think this one's better, but mostly because I know the characters and it's really depressing if you know the context
Honestly not sure why people are so obsessed with homosexuality; whether love or hate. It's just something that some people do.
it's disgusting
08:17
> Everyone is so terrified of nuclear waste, because it lasts "hundreds of years"
lmao let me check the half life of radioactive waste again you moron
> Plutonium-239 has a half-life of 24,000 years.
hundreds of years!
have you been reading HN again?
> Np-237 (half-life two million years)
wow that's a lot of hundreds!
@Mikhail I'm afraid yes
I hate them
Ven
Ven
yo
I hate them for their profligate lifestyle and happiness. (the HN people, not the gays)
Ven
Ven
Gay away the preys.
08:25
I hate mostly everyone
You misunderstood me doctor, I need a cure for the Javscript
@HubertApplebaum also known as a semi-life
@JerryCoffin: I have improved the document, if you are still interested: dropbox.com/s/pf6mlbbuao16dln/corrected-gggr-2015.pdf?dl=0
wow 10% unemployment in france omg
didn't know there were so many immigrants
@HubertApplebaum Is this sarcasm? :)
what?
I fail to see how it can possibly be sarcasm
08:49
I'm pretty sure unemployment in the France is closer to 15%, especially for youth demographics
@Ven what
Ven
Ven
@slaphappy the driving dream is ded,right?
sorry got confused. yes it's ded
@HubertApplebaum It is hard to tell just from text.
Why doesn't reinterpret_cast do object slicing?
08:54
@Mikhail XY
CameraConfig newest = chan;//good
auto newest = reinterpret_cast<CameraConfig>(chan);//bad?
that’s (probably) not in the list of allowed reinterpret_casts
to put it succinctly, reinterpret_cast handles a few kinds of conversions only
Ven
Ven
@slaphappy okay
e.g. integral to and from pointer, many forms of pointer to pointer (ditto references)
whatever’s not on the list is not allowed
@Ven gist of it is I'm staying in poland afterwards, so not doing the return trip, and tony and ell don't feel like driving the way back just the two of them
08:57
It feels, wrong because a c-style cast works
maybe you want a static_cast after all?
reinterpret cast can't reinterpret non-pointers/referneces
@Mikhail yes, you can replace any cast by a C-style cast
Ven
Ven
@slaphappy oh, you are? using your holidays for that?
But it doesn't feel static
08:58
yes I will leave this typo
> feel static
the C++ casts partition all the different things a C-style cast may do into several categories
@Mikhail rub your feet on a carpet and you should be good to go
Morning guise
Ven
Ven
huh, a stresstest with 1000threads modifying an int concurrently (well, among other things) didn't blow up. wow
@Rerito yo
09:17
@Ven benchmarking is very tricky
putain la couleur qui arrache les yeux @Ven
Ven
Ven
Well, the benchmark was the original goal, but I only later realized there were unprotected int increments/decreemnts
@HubertApplebaum ouais désolé, je choisis pas..
was the result correct?
5
Q: Cheapest way to travel inside Europe

Maximus DecimusI'm visiting Europe soon, and I need some advice for transportation inside Europe on an extremely low budget. I probably will spend many days there, so I want to visit as many countries as I can. I'm thinking of an itinerary like this, including countries of Schengen territory, from Portugal to...

Just pretend you're a Syrian refugee!
Ven
Ven
@StackedCrooked it was a http server benchmark, and nothing blew up, so.. yes
@slaphappy so, planes it will be? I gather you're not interesting in a 17hrs bus trip?
09:21
I've done tests where I increment integer in parallel. The unprotected version always gives wrong result.
As expected.
So, whats atomic in this world?
atoms are
Ven
Ven
my love for you is atomic
You can't hug a child with atomic arms!
Ven
Ven
09:31
yo bartek
i have little motivation to work today
how do I slack off
here + discord
negative productivity guaranteed
Perhaps you should consider doing difficult things that add no business value?
@Mikhail I've already been doing that
Great then you're well on your way to a day of slacking off!
09:37
@BartekBanachewicz become addicted to an MMORPG
@StackedCrooked already playing Ogame
i could answer on slack overflow I guess
play cookie clicker
barnek
Ven
Ven
learn some fun programming stuff you don't need at work
try elm, learn APL, insult cobol
Visual Basic for Applications
Ven
Ven
no, I've got a great idea
A game of "Kiss, Marry, Kill" with programming languages.
09:43
@Ven a what
@Ven maybe I should start learning python
Ven
Ven
Mar 12 '13 at 19:01, by user142019
Doctor John A. Zoidberg is a fictional character in the television series Futurama. He is a lobster-like alien from the planet Decapod 10, who immigrated to 30th century Earth, where he works as the staff doctor for Planet Express, despite his woeful understanding of human physiology and allusions to his questionable credentials. Zoidberg is voiced by Billy West, who performs the character with a Yiddish-inflected accent inspired by actors George Jessel and Lou Jacobi. Character creation Zoidberg is named after an Apple II game that David X. Cohen created in high school called Zoid, simi...
@BartekBanachewicz you don't know that? you have 3 names given to you, and you have to decide which one to kiss, which one to marry, and which one to kill.
who gives the names?
Ven
Ven
@BartekBanachewicz the one who's making you play
09:46
who starts? :D
Ven
Ven
people slacking off
@Ven C, Fortran, R
Ven
Ven
well, kiss fortran, marry r, and kill C. easy one.
I wouldn't want to spend too much time with fortran, but just a night stand (of programming) can do.
remember Java, Flash, Silverlight, PNaCl? JS won.
ah horse_js
quality content
> The donkey or ass is a domesticated member of the horse family,
> or ass
oh well
ahah
> When I try to call this from Swift I get the error cannot convert value from UnsafePointer<ComplexNumber> to expected argument type UnsafePointer<ComplexNumber>
Neovim segfaulted
Ven
Ven
10:01
neorip
@LucDanton the world must know
indeed
10:23
Neovim became Novim.
I’ve been wondering about concepts and their associated types (probably invalid code, but kinda shows what I want)
I say probably cos GCC segfaults on it and even if it didn’t and worked it’s not very robust
Ven
Ven
just how do you have so many bikes?!
is that a bikeshed?
Ven
Ven
well, it's another coliru link with "date" as the command, so it looks like it
@Ven wot
what do you suggest there should be instead of date
Ven
Ven
10:36
an example of said segfault
the fuck
I need Ven diagrams to follow your (alleged) logic
ICE aside the elaborate call is actually non-deducible, I guess the default in Foo has no bearing on the elaborate declaration
Hi
I'm new to the chat
I had question tracking algorithms that can result in subpixel accuracy
Yes this is the room for subpixel accuracy tracking algorithms
11
Can you please suggest me
some algorithm to start in this direction
I;m using template matching
it gives me data upto a pixel shift
what about a for loop
those often lead to great algorithms
Ven
Ven
10:44
I thought it was cicada at first
yeah me too
still not entirely convinced
Ven
Ven
which really says a lot.
@Ven some of
Ven
Ven
@slaphappy okay.
10:49
@Ven lolno
Ven
Ven
@LucDanton elaborate wat
@Ven that’s the name of the function template
Ven
Ven
@LucDanton wtf is this "Foo{F, Assoc} Assoc" shenanigan?
@NikitaChopra Man, instead of this chat room, ask on some appropriate board like SO itself or one of its specialized boards.
concept introduction
Ven
Ven
@LucDanton wot
@Ven I don’t know the rules fully but it desugars to something similar to template<typename F, typename Assoc> requires Foo<F, Assoc>
Ven
Ven
Oo
@Ven yeah I don’t know why they called it that, maybe it’s something like 'a short way to introduce a template constrained by concepts'
Ven
Ven
insaniiiityyyy
10:53
were you familiar with the template<Foo<void> F> syntax I also use there (to get around that GCC ICE)
it’s… wonky but for 'relational' concepts I’m starting to see the point of introductions cc @Rapptz
familiar example: RandomAccessIterator{It, Diff} void advance(It& it, Diff offset);
I’m going to give it a go and there’s nothing you can do to stop me
@Ven do you want in on a bikeshed now? ( ͡° ͜ʖ ͡°)
Ven
Ven
Do you waaaant to build a bikesheeeed
@slaphappy you had a question for me
for now I’ll have multiple concepts, something like RandomAccessIterator1{It} to introduce, well, just the iterator type and RandomAccessIterator_b{It, Diff} to introduce more things—what to name the one in relation to the other, that’s the bikeshed
Github just sent me an e-mail about an issue comment... that I already saw and responded to several hours ago.
Get your shit together, Github. :B
11:03
@ThePhD orlp already shared it a few hours ago, sorry :p
@Morwenn Curse you, Orson Peters.
Eh you'll be fne.
@Ven lol
@GettingNifty this looks like an OOOOOLD OSX
Hey, std::gcd and std::lcm might say « Fuck you Library Fundamentals TS V2 » and jump directly into C++17.
@wlix Thanks for the suggestion .
11:14
it's leopard
i mean lion
supports Java 1.8
@wilx Thanks for the suggestion
apple does free os upgrades to the latest os that your mac will support
you have to go to the store
it's not in solid writing but the one here in Knoxville has always done it for me, i just get a new hard drive, make a backup
i had to copy some of my files over manually though
No nested namespace identifiers for VC++
Sawface.
went shopping then macbook keyboard stopped working upon return
Ven
Ven
@ThePhD :[[[
11:23
@ThePhD Sad but fortunately we can live without them.
Ven
Ven
@Morwenn yes but we'd really like them still
Well, use GCC 6 or Clang 3.6 :p
Ven
Ven
that's the plan :D
@Telkitty ??
Once GCC 6 is available from MinGW and on Travis, I plan to start a c++17 branch on my library. I can't wait :D
11:28
did you know the late 08 g4's had the chrome body too
fooled me the other day and it was selling for 300
Even though I'd actually expect experimental Chinese artists to be a bit more against their government.
@Ven Good news! I misremembered, they’re sensibly named template introductions
@Telkitty Is there a connection between the two? :)
you close class right not methods
I am just paranoid after my website got DDoS attacked, my iphone account hacked and my microsoft & paypal accounts tempted (hacker wasn't successful)
11:43
make sure they're all mobile that's my best advice
i mean download the mobile app and keep it on your phone, so if anything else tries to connect it will warn you
I do receive warnings, but sometimes I don't check certain email accounts for days
I start to check them more often now
i wonder if i'm going to have to recode my whole app, gwt has restrictions for converting to javascript
it said something about not being able to override something.. if i can't override action listeners it's pointless
11:58
This post is kinda interesting. Beginner is afraid to write code due to fear of bad practice.
I was pretty fearless when I started writing code. I had never even heard of bad practice.
So it was pretty bad code. But at least I learned.
@StackedCrooked Redirect him to Code Review :p
Oh, he's reading Scott Meyer. He might soon start writing better code than most C++ programmers.
fuck scott vOv
@StackedCrooked what were you're main downfalls, i'm pretty new
user1804599
12:14
@Ven ugly avatar
Ven
Ven
I know.
user1804599
for (let [attributeID, optionID] of _.pairs(c.options)) {
    const attribute = _.find(c.norm.attributes, a => a.id == attributeID);
    const option = _.find(attribute.options, o => o.id == optionID);
    name += '; ' + attribute.name + ': ' + option.name;
}
Ven
Ven
@LucDanton ugly name
@Zoidberg rightfold-so-js as well
lol just opening that soundcloud tab made my laptop slow
@ScarletAmaranth wow r00d
@jaggedSpire RIP :(
(you'll be back though)
12:25
@GettingNifty It was just a big mess. I improved a lot thanks to books like Pragmatic Programmer and Code Complete. After that SO turned out to be very helpful.
@jaggedSpire Catch the ball. Be the ball. :D
Bark.
user784668
SO still allows one to use word joiners to write a comment with less than whatever the limit was characters?
@Ven perhaps you’re a proponent of template elimination
Ven
Ven
@LucDanton what
user784668
12:34
@LucDanton templates are just poor man's macros
user784668
fite me
@Ven type theory joek
Ven
Ven
ok
user784668
Oh god.
user784668
C++ is so fucking annoying.
12:46
@ThePhD Hey bby <3
> A concept referred to by a qualified-concept-name may have template parameters with default template arguments. An introduction-list may omit identifiers for a corresponding template parameter if it has a default argument. Only the introduced-parameters are declared as template parameters.
tl;dr it’s exactly what I wanted
pretty cool, new rule of thumb: concepts as relations
Ell
Ell
@LucDanton as in set membership or what? :V
@Ell that’s kinda backwards but sure
Ell
Ell
How come it's backwards? If class X satisfies concept Y, then it's as if X ∈ Y
also fuck pimoroni haven't dispatched my order yet arghh
I paid for 1 day delivery!
@Ell usually when you define relations in terms of sets it’s because you’re in a setting where sets are 'basic'—but that’s not what makes relations relations, or what makes them interesting
Ell
Ell
12:55
basic as in can't contain other sets?
the same way if I say 'the naturals' I don’t expect 'oh you mean the encoding of naturals in the theory of sets' as a comeback
@Ell no as in the foundations of the theory
@Ell relations don’t need no sets and these are not the natural numbers
user784668
FUUUUUUUUUU C APIs that don't use const
@BartekBanachewicz yeah. what's the minimum age to rent a car in poland? minimum experience? it's for uncon

« first day (1965 days earlier)      last day (3209 days later) »