« first day (1136 days earlier)      last day (3823 days later) » 

3:00 PM
1
Q: Nested iterators access

PsychomanI have a question about iterators.The question is:" How can I access ( if it's a nested iterator ) the element in row, that is higher or below.Here's an example what I mean: for( auto i = graphMatrix.begin();i != graphMatrix.end();i++ ) { for( auto j = i->begin();j != i->end();j++ ) { ...

 
actually
 
user3010322
Oh.
 
upvotes innit
 
user3010322
That makes sense.
 
best-guess is going to work far better for me than in the average case.
 
user3010322
3:00 PM
@CatPlusPlus Do you want me to make a Repo for Lounge.Net and begin working on a separate AuthServer project?
 
because I already know what a good chunk of the decoded text should look like- e.g. keywords.
 
user3010322
Which will be entirely for auth? Or have you already for that covered?
 
Yes, and all of those are in the ASCII space.
Which means they help zilch.
 
@R.MartinhoFernandes Yes, but I only really care about UTF-16 vs UTF-8 vs UTF-32 and byteorder.
 
I don't even know what I want to use for it yet
 
3:01 PM
I don't really care about the strange 8-bit encodings like windows1252 or something.
 
user3010322
UTF16 and UTF32 should be somewhat easy to detect
 
user3010322
"Am I coming across consistent groups of 3 0 bytes? Probably UTF32"
 
user3010322
"Consistently going 0 [byte] 0 [byte] 0 [byte]? Probably UTF16"
 
well, let's face it, most Wide files will almost certainly open with a keyword.
 
user3010322
Checking the first 100 bytes or so for three zeros and a byte value, or a single 0 and a byte value alternatingly, will give you fairly good confidence you're dealing with one or the other (since it's source code and most source code text is in english).
 
3:04 PM
and if push comes to shove, I'll just implement an override.
@ThePhD More importantly, the keywords are also in English.
 
user3010322
That may only come in handy if someone doesn't include a MASSIVE non-Latin comment at the beginning, though
 
user3010322
So many 100 bytes off the end of the file might be a better choice.
 
@DeadMG Meh, then why not just stick to UTF-8?
 
still gotta open with // or /*
 
(i.e. just fix your other files)
 
3:05 PM
@R.MartinhoFernandes Well, for one, I know in advance that I will be getting UTF-16 input from my Visual Studio extension.
 
@ThePhD that applies only if a sufficiently large set of the characters in the files is ASCII, right? A UTF16 file with a CJK text should not have much 0 [byte] patterns in it
 
Ugh, Q_Q why?
Oh, .NET.
 
user3010322
@ArneMertz Source code is generally in English.
 
because they are using .NET, and that's UTF-16.
 
Why was stacking /* bad again?
 
Xeo
3:06 PM
They don't nest in C++
 
@ArneMertz It's source code.
 
I know.
I was trying to remember why.
 
Anyway, I still think it's a bad idea to have the compiler do any detection.
 
Xeo
Because they don't
 
@R.MartinhoFernandes uh ok missed that point
 
Xeo
3:06 PM
The standard doesn't specify them to nest, so they don't
 
user3010322
@Pawnguy7 Implies that there's /* /* */ */ <---- last one is an error in your source code.
 
Don't guess encodings bah
 
well
 
$ ninja -t clean > /dev/null
$ \time -f "%E" ninja >/dev/null
0:09.71
$ \time -f "%E" ninja test >/dev/null
2:06.96
$
 
user3010322
Guessing is bad, I like explicit encodings.
 
3:07 PM
Hmm, my server is slower Q_Q
 
user3010322
Liek WebSocket. <3 UTF8, and only UTF8.
 
@ThePhD that is what it currently does
 
@R.MartinhoFernandes lol
 
user3010322
Yes, so nesting them is a bad idea.
 
I guess that strictly, since the VS extension only uses the API, I'd just have to provide a function to override.
 
3:08 PM
@ThePhD because?
 
@R.MartinhoFernandes Good
:v
 
Xeo
There is nothing you can do but copy. You're trying to maky many values out of a single value. What other techniques are there for that? — Xeo 5 secs ago
Perfect forwarding be hard
 
@CatPlusPlus I mean, it's even slower than my machine.
 
user3010322
@Pawnguy7 Because you'll get an error in your source code. What other reason do you need?
 
@ThePhD in past code?
 
user3010322
3:08 PM
In current C++ code.
 
user3010322
Can I declare a variable inline in a header?
 
Let's imagine we are implementing it for the first time.
Is it bad then?
 
user3010322
If we're implementing a language, then you're free to do whatever the hell you want.
 
user3010322
You could demand every source file starts with "I AM A BLOATED FISH."
 
Just...
Is there a reason that them nesting would be bad?
In a theoretical new language?
 
user3010322
3:10 PM
No. It was an implementation choice.
 
user3010322
Throws up hands. I'm going to shut up now.
 
What if the comment contains /*? Say, a path globbing thing?
 
globbing?
 
You know, rm garbage/*
 
3:12 PM
True.
Trying to comment out blocks with commented out blocks is a pain though.
 
Commenting code is kinda bad, anyway.
Just delete it.
(Or in C++, #if 0 .. #endif)
(Or ask your favourite editor to comment out all the lines, and it will probably use //)
 
user3010322
#dead

#alive <--- that'd be cool
 
Yeah, commented out code should be temporary
 
It was meant to.
But it got bigger than expected, with several attempts.
 
user3010322
Gah.
 
3:14 PM
You have the old code in VCS history, there's no need to keep commented out bits in the file
 
user3010322
I'm trying to make these all inline functions
 
Just remove it
If you have several attempts then branch
 
Well.
It isn't in the history, is my problem :D
 
@CatPlusPlus -_0 why even keep it?
 
I only keep commented code when it's part of another comment, like // compiler suxxorz, should be `foo(whatever, yes, fuck, you, gcc);` instead of this bullshit workaround
 
3:15 PM
Sometimes you just need to comment something out for 10 seconds
 
@CatPlusPlus //!
@Pawnguy7 Then why do you want it around?
 
@CatPlusPlus oh yeah, but code you are committing to is another mater
@R.MartinhoFernandes but that's more 'have to do it stupid way, would like to do a nice <this> but thing is crap, so canny'
 
@R.MartinhoFernandes if the current attempt fails, what I had before is better than nothing
 
@thecoshman Well, I don't comment any other code.
 
@R.MartinhoFernandes <pat's head>
 
3:17 PM
@thecoshman Yes, that's what I said...?
 
user1804599
Congrats, MySQL.
 
user1804599
You’re giving a file not found error message for a permission denied error.
 
Even if you want to comment something out for 10 seconds, you can delete it and then restore it from VCS.
 
user3010322
That's a lot fo extra work.
 
@ThePhD Tisn't for me vOv
Not my fault if my tools are cool.
 
user3010322
3:19 PM
Pfff.
 
,c<space> :v
 
<3 fugitive.
 
I can't use Fugitive because console windows
 
That said, we have our share of commented code in our repo at work.
 
@ThePhD Declare or define?
 
3:20 PM
@rightfold security, make them think they have valid login details, when really they don't... smart...
 
@CatPlusPlus Hmm, why?
 
gvim on Windows is bad at spawning processes
But that reminds me
 
Oh that. Yes. Horrible.
 
I should fix my gvim, Python support broke
 
user3010322
@FredOverflow declare and define in a header, not inside a class, namespace scope.
 
3:22 PM
If you define a variable inside a header and include that header multiple times, you get multiple definitions.
You could make the variable static, but then each TU has its own variable. Do you want that?
If you want only one variable, then you must define it in its own implementation file and only declare it in the header.
 
ARGH, VS should get its thing together regarding warnings.
 
> Abandoning traditional gameplay for a pure story-driven experience
-_- a film?
 
A film that you have to mystery-meat-navigate to enjoy?
 
I tried to setup gvim once
 
is it just me, or is a game where you just click through to the next scene not a game?
 
3:24 PM
didn't get very far
 
Now why did I install 32-bit Py2
 
@thecoshman It's a game of "how long can you consider this to be a game?"
 
Not sure what you mean by "setup"
 
@CatPlusPlus Same reason you do most things
 
@R.MartinhoFernandes get syntax highlighting to work
 
3:25 PM
Inertia?
 
@CatPlusPlus No reason at all
 
@LightnessRacesinOrbit ergh... the worst type of game, meta game
 
@CatPlusPlus Wait... you do thing cause inertia?
 
32-bit MySQL-python
 
3:26 PM
@TonyTheLion That works out of the box. (unless you need some weird language it doesn't support OOB; in that case it's just a matter of dropping the files in a folder)
 
My post and the following replies... Are they not a bit hostile or am I just too touchy?
 
@R.MartinhoFernandes didn't work out of the box here
unless I had no idea how to use it either :(
 
You might have to go to the Syntax menu and click "Turn on". Not sure about the default settings.
But even then, that's rather simple and obvious.
 
@thecoshman Yes
 
Sex: Yes, please!
Turn on: Syntax
 
3:27 PM
lol
 
> We have been in Stage 1 for 8 months now. Now is time to look
into one of the gazillion regressions we have accumulated.
 
@wilx They seem fine to me.
 
@R.MartinhoFernandes OK. Then I am touchy. :)
 
What do you think?
 
user1804599
Matrix.
 
3:35 PM
Green
 
JBL
It's green and black.
 
fucking hard to observe any meaningful pattern.
 
I don't think there is one.
 
then my conclusion is: meaningless noise.
 
More or less.
Does it look cool?
 
3:37 PM
it looks like meaningless noise.
 
Is it cool meaningless noise? :D
 
meaningless noise is never cool.
 
JBL
What's the point ? I mean, there'll be people liking it and others who won't.
 
I like it.
It looks like sexy noise~
 
Although, I don't know what color I can use for a text overlay now.
 
3:38 PM
@Pawnguy7 Did you break something?
 
JBL
@Pawnguy7 Not-too-flashy red ?
 
@R.MartinhoFernandes nope
 
@Pawnguy7 Orange
It's legible, but it won't fit in...
Put text over some metallic plate
 
:E what did I do now
 
You hurt IntelliSense's feelings.
 
3:47 PM
screw intellisense :P
 
You cheated on Visual Studio's Compiler with Clang didn't you ;_;
 
what? no
I'd never do that..
unless it actually worked :E
 
JBL
Phew, at least it stopped at 17 args.
 
It goes up to 11 and beyond
Updated my vim to 7.4.103 yay
And everything works
 
@CatPlusPlus Now you can have rnu and nu on simultaneously!
 
Xeo
4:01 PM
auto p = new T();
::new (p) T(); // UB, right?
 
Not really.
 
Xeo
Assume non-POD T
 
mm
Ask on SO
so I can get repz
 
@R.MartinhoFernandes Neat
nu is not that useful but neat
 
4:03 PM
@CatPlusPlus It's more useful than a zero.
@Xeo Only if the program depends on the first object not leaking.
 
Gotta finish that presentation
The worst 30 minutes this semester in 16 hours
 
fuck it, I'll do it
 
Xeo
@R.MartinhoFernandes hm... I remember something about storage reuse if lifetime is not yet over etc
 
0
Q: Is it UB to re-use an object's storage without destroying it first?

Lightness Races in OrbitGiven non-POD type T: auto p = new T(); ::new (p) T(); This is UB, right? Clearly I'm not leaking any memory, but that first T never got destroyed, which seems to me to be a great candidate for spontaneous destruction of galaxies populated by sentient cat-like beings.

Thanks, dear.
 
JBL
> which seems to me to be a great candidate for spontaneous destruction of galaxies populated by sentient cat-like beings
Oh gawd
 
4:10 PM
I got bored of nasal demons
 
It's a universe made of shrimp
 
JBL
^The only cat in this universe which is not sentient, then.
 
:D
going well so far
 
@R.MartinhoFernandes Holy shit you look good.
 
ITT: Robot turns Etienne gay
 
4:15 PM
"turns"?
 
~~Programmers are intrinsically sexy~~
 
I'm not a programmer
 
true
you're a Cat
 
Xeo
@LightnessRacesinOrbit Du Sau!
 
Ell
4:19 PM
@EtiennedeMartel +1
 
Next up, Scott falls in love with Robot
wouldn't surprise me
 
JBL
I sense someone's jealousy is growing strong.
 
Everyone wants the D.
 
No love for C.
 
4:22 PM
Where the hell is @ScottW?
 
WTF is going on.
 
Love. That's what's going on.
 
JBL
@MohammadAliBaydoun C deserves no love.
So no big deal actually.
 
I need to read paaapers
 
you need braaains.
 
4:24 PM
It's extremely boring
Yes
 
Someone accidentally a word there.
 
You can't xbox yo
 
@EtiennedeMartel oh Microsoft. you bunch of.
 
@LightnessRacesinOrbit I agree, they're complete
 
“Xbox, upload my epic fail while I find noms for my feels #yolo #generationremix” http://t.co/QQoyxUyHkO
 
JBL
4:25 PM
@LightnessRacesinOrbit Idiots is the word I believe.
 
@Xeo :)
@DeadMG .
 
Looks like a case of "Because of your past behavior, you can't %s".
 
JBL
"But wait, our console has received all the attention it needs !"
 
@LightnessRacesinOrbit no
 
And then concatenation fucked somewhere.
 
JBL
4:26 PM
Just "Fucks" somewhere I'd say.
 
you cant concat
 
Cats who are also con artists.
 
Hmmmm, maybe client certificates for SSO?
 
repz. REPPPPPZ
 
you repwhore
 
JBL
Repzombie.
It's getting indecent at this point.
 
@LightnessRacesinOrbit I answered your comment. There is no possibility of "releasing the storage of the first object".
 
If you sleep there, you gotta have been really drunk
 
@ArneMertz The storage of the first object becomes storage for the second ([C++11: 3.8/7]). You can absolutely release it thereafter.
 
4:34 PM
@TonyTheLion or a kitty cat
 
@LightnessRacesinOrbit yeah forget my comments. I misread the cited paragraphs. I somehow came to think that you may not destroy the second object either.
 
@ArneMertz Phew! You had me worried for a few minutes there. But thank you for prompting me to check in further detail, as I'm relieved to discover 3.8/7 allows me to answer several people's doubts :)
 
man I hate merge conflicts
 
downvote. predictable.
 
4:37 PM
@LightnessRacesinOrbit in short: you may just scrap the first object without actually destroying it if and only if the program does not rely on any side effects of its destruction. Right?
 
@ArneMertz Right
Hopefully now we've all stopped having fun trying to blow apart the question with irrelevant side-theories ;)
 
JBL
Well, time to leave ! Bye !
 
Bye!
Repcap, tyvm @Xeo
 
@TonyTheLion How would somebody (even close to) that drunk manage to get up there in the first place?
 
@EtiennedeMartel you mean it's going to be a game-zombie? Instead of one of the countless zombie-games.
 
4:47 PM
@ArneMertz I mean the franchise is a zombie.
They're trying to resurrect it again.
Last time it was good was when Naughty Dog was behind it.
 
@JerryCoffin I have no idea.
 
So... all you win32 dev gurus....
How do you usually prevent <windows.h> from messing upi your API? I have a member function SendMessage and it gets... mutilated into SendMessageW. (Thanks Microsoft?! You always know exactly what I need. Urrgrgrgrgrh)
 
By not including windows.h anywhere but few very isolated TUs
 
Ell
something about lean and mean?
 
That doesn't help
 
4:50 PM
@CatPlusPlus Yeah. Figures. Sadly, some header I depend on appears to have included it for me
@Ell VC_EXTRA_LEAN etc. I have it
 
Ell
oh nvm
I think you're gonna have to manually #undef stuff :S
or something
 
@sehe They (at least mostly) use PascalCase, so if you (for example) use snake_case, you're mostly fairly safe.
 
@JerryCoffin lol. I'll ask the guys to change their style guides accordingly :)
 
user3010322
Heh.
 
No seriously, I'm going to hunt down what the fuck includes this. In fact, it might be intellisense mucking with my head. Better inspect the preprocessed source for some authoritative info first
 
user3010322
4:52 PM
This is why I abstracted everything with void*
 
user3010322
type erasuse, handle<void*> <3
 
This is why I don't write C++ :v
 
user3010322
:3
 
Well, okay, not just that
 
:D
My solution used to be even simpler: don't write code on Windows.
 
4:53 PM
@ThePhD void * is a concretion, not an abstraction.
 
It's an excretion
 
void* is a cabbage
 
caulishower
Also, anyone know of a a quick way to make my Catch.hpp test cases friends of the class-under-test?
 
user1804599
It’s an abomination.
 
user1804599
@TonyTheLion looks like a bad photoshop.
 
4:56 PM
hmnmm
> Tickets for the Monty Python reunion performance went on sale on Monday for as little as £32 ($51), sold out in 43 seconds and promptly resurfaced on the auction site eBay for £750 ($1212).
I hate people that do that stupid Ebay reselling shit
just to get rich of those few that are desperate
 

« first day (1136 days earlier)      last day (3823 days later) »