« first day (1024 days earlier)      last day (3924 days later) » 

6:00 PM
let it cool down and then dust off everything
 
@Ashima Yes.
 
@Pawnguy7 too vague
 
or i can put up my silly question?
:P
 
i have dust sitting on my graphics cards which is bad
@Ashima no you can't
 
@Ashima Stack Overflow is a good place to ask questions
 
user784668
6:00 PM
 
ok, let me try to understand,
 
@Ashima no
go to the C++ room or SO
 
ok
 
@Ashima You've just used up your allotment of questions for the day.
 
:)
 
user784668
6:01 PM
WTH is Lounge<Chat>?
 
you don't ask questions well
2 of your questions are negative and the other 2 are closed
 
@Fanael chat project
 
it's better if you go read a Java book then ask questions
 
@Fanael If you build it (a better chat) they will come!
 
@BenCollins mmmm, yummy
 
6:04 PM
where is kbok ......
 
He's gone, you superceeded him as Lounge<Hot Chick>
 
2 hours ago, by soon
Guys, if someone have g++ > 4.8.1, please, test this code. Note, the code fails with -g flag only(for me).
i love how this has python errors
there is no way on earth he's doing this right
 
@BartekBanachewicz seems well defined to me
 
@Pawnguy7 well I disagree :v
 
@EiyrioüvonKauyf iirc some components of GCC use python
 
6:06 PM
@BartekBanachewicz and that is why you make things that work, and I don't :D
 
@Rapptz ? like ... no i mean somehow there is a python interpreter call here
 
user784668
@Rapptz lol wat
 
@Fanael I'm probably confusing it with the GDB enhancer.
 
user784668
@Rapptz GCC uses mostly "C++".
 
user784668
6:07 PM
@Rapptz that's it, probably
 
C++ is short for cat++
:D
cat++ is short for caterpillar++
 
@Pawnguy7 I have an idea for a new funky project already :F
 
user784668
alias cat++=cat
 
@BartekBanachewicz do tell
 
@BartekBanachewicz what is it?
 
user784668
6:08 PM
@BartekBanachewicz something you'll never finish?
 
well, it will be in Haskell
 
also all of these code workshop things
seem like a really bad idea -.-
 
@Fanael you must have mistaken me with someone else
 
it's spawning legions of "coders"
 
@EiyrioüvonKauyf what code workshop things?
 
6:09 PM
@not-rightfold
@rightfold
like this
 
@Pawnguy7 it will be in Haskell, will use OpenGL, and will be connected to hashing
 
user784668
@BartekBanachewicz the guy who foldrd himself into oblivion?
 
for profit "teaching to code"
 
@Fanael indeed.
 
@EiyrioüvonKauyf because if you do, you can knock loose those tin whiskers which can cause shorts that you cannot see or fix. you can thank the EU for that.
 
user784668
6:10 PM
@BartekBanachewicz you mean, you're not his sockpuppet?
 
@BenCollins :| uhm if i can see them i'm just going to cut em
also personally i flip my box so that dust falls out
also tin whiskers should?
 
user784668
@BenCollins yeah, sure, blame EU for everything
 
no not the EU
*as a whole
 
@Fanael not really, no. I don't code in Erlang or Elixir or Go.
 
France is a large part
 
6:11 PM
@BartekBanachewicz I don't know how to use any of those
 
wat Elixir
 
user784668
@BartekBanachewicz ah, so he's yours, good to know
 
@EiyrioüvonKauyf ...you're not understanding. You cannot see tin whiskers. That's the point. But nevermind - do whatever you do, and then when you have funky hardware failures, you'll remember this convo :-)
 
holy shit
i want to try elixir
@BenCollins :c why?
 
@Pawnguy7 you are probably using unordered_map :F
 
6:12 PM
On the conspiracy theory front, perhaps Jeff Atwood's new startup is why SO treats chat improvements as such low priority.
 
and SFML uses OpenGL
 
they're pretty fing large
 
@EiyrioüvonKauyf why what?
 
@BartekBanachewicz I tried using a map yesturday, but it didn't work, so I made my own non-templated one :\
 
@JerryCoffin that's a) not new, b) not a chat c) Frankly not-related to SO chat at all
 
6:13 PM
And using SFML != knowing openGL :D
 
@Pawnguy7 did you use a compass
 
@Pawnguy7 what "didn't work" o.O
 
@BartekBanachewicz also, Jeff is no longer related to SO either, is he?
 
6:13 PM
@JerryCoffin hahaha
 
@jalf iirc he got into a screaming match a few years back?
 
@jalf not in a way that would influence SO chat's development
 
@BartekBanachewicz Um, it uses comparison operator. On something that didn't have one. All I wanted was a contains :\
 
user784668
@JerryCoffin Don't be surprised if you'll wake up banned tomorrow.
 
@Pawnguy7 you need Ord a, Eq a type for map. Which in you Savage C++ language would be a defined op< and op==
 
6:14 PM
@Fanael or... if you don't wake up at all...
 
God damn it Bartek.
You literally started learning Haskell a few days ago.
 
@Fanael Could happen. Such is life. Would probably be a good thing, really.
 
user784668
@BartekBanachewicz no, map doesn't use operator==
 
0
Q: Why are so many applications still programmed in C rather than C++

Random UserI have a theoretical programming question today. I know of so many open source programs that use C and completely avoid c++ to program their programs like: git, subversion, v8, most of linux, and many, many more. Many of these programs are recent enough that they could have easilly gone with c+...

 
user784668
Downvoted and VTCd, kthxbai.
 
Xeo
6:16 PM
@BartekBanachewicz Eq is a requirement for Ord, IIRC
 
@Rapptz my fanboyish tendencies are growing
 
user784668
@Xeo yes
 
Xeo
3 hours ago, by Xeo
@BartekBanachewicz What have we done?!
 
@Fanael there are approximately 5 orientations
you can't have any more
or you'll get in trouble
 
user784668
6:17 PM
@EiyrioüvonKauyf ur momma has 69 orientations
 
@Fanael nope quantum ;D
 
user784668
@Rapptz lol, someone upboated it
 
.... goddamit we need a physicist in here T_T
 
2 people did apparently
 
@Fanael twice =/
 
user784668
6:18 PM
Idiots everywhere.
 
H2CO3 and his sockpuppet im guessing
 
Xeo
lol
 
user784668
@Borgleader Bartek and Bartek
 
Xeo
@BartekBanachewicz Also, yeah, as Fanael said, std::map only relies on op<
 
is this the unofficial headquarters of SO C++ ;)
 
Xeo
6:19 PM
Nope, you're looking for the room next door.
 
ohh kk
sorry
 
user784668
Where can I learn C with classes?
 
Xeo
Over yonder.
 
@Fanael cplusplus.com
 
@Fanael It's not something you really learn -- more like a disease that you catch.
 
user784668
6:21 PM
@JerryCoffin joking aside, I have a piece of C with classes I have to deal with :/
 
user784668
Is "take C++ and invert all good idioms" a good approximation to C with classes?
 
Reinvent all the wheels and you'll be close.
 
@Fanael It's much harder to pin down than that. It's basically the union of all the ways people have tried to do development with C++ that haven't worked out well.
 
*Main> encode' "aaabbccccdef"
[Multiple 3 'a',Multiple 2 'b',Multiple 4 'c',Single 'd',Single 'e',Single 'f']
:3
 
user784668
@BartekBanachewicz It's a one-liner.
 
6:24 PM
@Borgleader How would I use it? — user2597879 1 min ago
He asks for a data structure, "how would i use it"... gdi im not here to teach you c++
 
@Fanael Dude, I am on exercise 11. Step by step. Also Exercise 13 states: Implement the so-called run-length encoding data compression method directly. I.e. don't explicitly create the sublists containing the duplicates, as in problem 9, but only count them.
 
lol
4
 
user784668
@BartekBanachewicz I didn't know you're learning Haskell.
 
@Fanael oh, I thought that was apparent.
 
@BartekBanachewicz op==, yes. Not sure why < though
 
6:25 PM
@Pawnguy7 no, Fanael and Xeo are right, only < is needed. To sort them, obviously
 
user784668
@BartekBanachewicz I don't want to assume anything when it comes to dealing with people. Because if I assume something, some idiot will come and prove me wrong.
 
@Pawnguy7 Other way around man.
 
Xeo
unordered_map needs op== in addition to the hasher
 
user784668
I don't know what's the big deal with hash maps.
 
@Rapptz The principal's office for that? My principal was like a shiny pokemon in rarity.
 
6:26 PM
@Pawnguy7 has a talent for making simple things seem complicated.
 
I didn't want to sort them though.
 
Xeo
@Fanael They're hash maps.
That's the big deal with them.
 
@Xeo I thought we were discussing reg map.
 
they're ridiculously useful :|
 
user784668
@Xeo well, right
 
Xeo
6:27 PM
(read: They're nothing special, just another data structure.)
 
@Pawnguy7 that's irrelevant. To construct a tree you need some sort of relationship
 
Xeo
@Rapptz I was just voicing where Bartek may have gotten op== from
 
Well I actually was thinking about unordered_map, but I thought that map requires that too
 
user784668
@Xeo Well, it's one that's spectacularly easy to fuck up by choosing a terrible hash function.
 
user784668
@BartekBanachewicz what for? !(a < b || b < a) is a == b
 
6:30 PM
@Fanael not in php :)
 
@Fanael Perhaps more importantly: the difference between a good and a poor hash function can be quite subtle and varies depending on the input being processed.
 
Xeo
I think for many purposes, the default hasher provided by the implementation is fine (combined for compound data). A notable exception being MSVC's std::hash<std::basic_string>, which just uses strides if the string is larger than 10 chars.
 
user784668
@Xeo lol, they don't even read the whole string?
 
anyway @Fanael WRT that "one-liner", any comments/suggestions/feedback welcome
 
Xeo
33
A: C++ ~ 1M look-ups in unordered_map with string key works much slower than .NET code

XeoVisual Studio 2010 uses a performant hash function for std::string, rather than an accurate one. Basically, if the key string is larger than 10 characters, the hash function stops using every character for the hash, and has a stride greater than 1. size_t operator()(const _Kty& _Keyval) const ...

 
6:32 PM
@BartekBanachewicz I don't want them sorted at all
 
@Pawnguy7 then what do you want?
 
I just wanted a list of key-value pairs.
 
@Xeo have an upboat
 
@Pawnguy7 and how do you imagine lookup on that?
 
Xeo
@Pawnguy7 std::vector<std::pair<K, V>>
 
6:33 PM
@Borgleader can i have an upyacht
 
@Xeo that is what I ended up doing
 
user784668
@BartekBanachewicz use _ for bindings you don't use, f.ex. myLast (x:xs) = myLast xs should be myLast (_:xs) = myLast xs
 
Xeo
_ is olev
 
@Fanael hm right. First problems were on the beginning of my learning obviously.
@Pawnguy7 and how do you search based on key? Do you at all?
 
Xeo
@BartekBanachewicz linear search? vOv
 
6:34 PM
@Xeo I wanted him to say that.
 
user784668
@JerryCoffin it's easy if you tell performance to go fuck itself
 
user784668
Easier still if you don't use hash tables.
 
@BartekBanachewicz linear
 
@Pawnguy7 how many elements are to be stored?
 
@Xeo Is it fixed in VS2012?
 
6:35 PM
@Mysticial Oh it does go higher than ycruncher. but only during the AVX Mul + Add test. Before it was peaking at ~62-64, with MUL + ADD though its ~70-72
 
Xeo
@Fanael I measured a normal map and a hash map, even with VC's default hasher for strings (the strings were pretty short) on our game server, and the unordered_map won by a factor of 10 or so.
 
2000
And it was kind of slow.
 
@Rapptz I don't think it was broken in the first place
 
You win :D
 
@BartekBanachewicz A hash function with collisions isn't broken? TIL.
 
6:36 PM
@Pawnguy7 what a surprise :P
 
@Borgleader aha! Yep. Because the MUL + ADD stresses both units at the same time.
 
@BartekBanachewicz and it looked ugly, so scrapped either way :D
 
@Rapptz every hash function of fixed size has collisions
 
@Mysticial so yeah it wins on ycruncher by about 5 degrees
 
user784668
If I have a set or undordered_set, can I const_cast<T&>(*it) and modify the element assuming I modify something that doesn't participate in ordering/hashing?
 
6:37 PM
@Borgleader I'd have expected it to beat y-cruncher - since it quite literally cheats.
 
Xeo
@Rapptz Every hash function except perfect hash functions produce collisions oO
 
user784668
@Xeo I don't doubt it, but the point is about the problem of choosing a hash function. Not speed.
 
Xeo
@Fanael Not necessarily, since the key is likely actually created as const key, meaning you invoke UB
 
@Xeo My point is: An implementation with frequent collisions isn't a good one; it should be fixed.
 
@BartekBanachewicz would a comparison operator just return false, then?
 
6:39 PM
@Rapptz again, define "frequent". That was a benchmark, no?
@Pawnguy7 what is your key type?
 
@BartekBanachewicz sf::Vector2i
Or generic x, y, struct.
 
@Rapptz fun fact: in the debug version of the CLR they force string hashes to 1 so they all collide. The reasoning being that you shouldn't depend on a hash function for speed
 
@Pawnguy7 return std::tie(x,y) < std::tie(other.x, other.y)
 
user784668
@BartekBanachewicz frequent = much more than one'd expect from pigeonhole principle alone
 
@BartekBanachewicz like, if I don't care about order
 
Xeo
6:40 PM
@Rapptz Seems like it.
 
@Pawnguy7 just use that.
 
@Xeo k
 
Xeo
	for (size_t _Next = 0; _Next < _Count; ++_Next)
		{	// fold in another byte
		_Val ^= (size_t)_First[_Next];
		_Val *= _FNV_prime;
		}
No strides involved
 
in C#, 3 mins ago, by Kendall Frey
http://stackoverflow.com/q/2069940/785745 This question needs reopening, folks.
 
Unlike you were not jedis, so we cant read minds. Were going to need your code to help you. — Borgleader 15 secs ago
 
6:41 PM
He is too scared to post here :D
 
Xeo
@JohanLarsson He better be!
 
yeah, he has a history
The closing of that type of questions is the most annoying thing with SO imo, lots of votes and not troll should be enough to show that the community find it useful.
 
Xeo
lolz, STL even worked a static_assert into the primary template for std::hash
static const bool _Value = __is_enum(_Kty);
static_assert(_Value, "The C++ Standard doesn't provide a hash for this type.");
 
Having custom readable error messages is cool.
Too bad #error sucks.
 
Xeo
6:45 PM
How so? Because it's part of the preprocessor?
 
Mostly yeah. It really limits it.
 
Xeo
Yeah, sometimes I want something that sits above TMP, aka can actually generate source, but has access to all the template machinery.
 
I like static_assert though, only thing I'd like better is if it accepted const char* instead of a string literal.
 
Xeo
@Rapptz Propose it. :)
Not entirely impossible to actually do format strings as constant expressions
 
@Xeo Surely there was a reason why it wasn't like that in the first place.
 
Xeo
6:47 PM
Never assume that for C++
 
@BartekBanachewicz how much faster do you imagine a hashmap with comparison would be to my linear search?
 
@Pawnguy7 like n vs log n
 
Xeo
The reason was likely the same as for limited constexpr: Make it easier to implement and play around with.
@BartekBanachewicz You mean 1 vs n
 
Xeo
log n would be normal map
 
6:47 PM
@Xeo You can make it something like constexpr const char* error_msg(...) { }
 
@Xeo twice now ive seen you write normal map and i thought "but that's a texture wt-oh..."
 
@Xeo Question.. why can I get away with marking member functions as constexpr even though they're clearly not?
 
Xeo
Huh?
 
In GCC 4.8.1 I can mark all my member functions as constexpr with no errors even though they're not.
 
Xeo
Define "clearly not"
 
6:50 PM
@Xeo They don't fit the requirements of a constexpr function.
 
Xeo
example?
 
constexpr auto step(std::ptrdiff_t t) -> decltype(*this) {
        first.step = t;
        last.step = t;
        return *this;
    }
 
Xeo
relaxed constexpr?
 
It's C++11.
 
Xeo
... so?
 
6:51 PM
If I try to use it when required for compile time it errors out.
 
Xeo
Is it inside a class template?
 
But I don't know why it lets me label it in the first place, seems like a lie.
Yeah
 
Xeo
Member functions of a class template aren't really parsed until used.
maybe that has something to do with it
Also, if in doubt, try Clang
 
Feels odd looking back at old code when I have no idea how to do something.
 
Xeo
Fammit, I want something to snack on, but the closest supermarket has already closed, and the others are 15mins of walking away
 
Mysticials code is done torturing my CPU, temps are back down to 40C from 70C
 
@Xeo Any pub-grub that's closer?
 
Why do I find code hard to read if it isn't syntax highlighted :(
 
But speaking of that, I think it's time for me to go have lunch.
 
@Rapptz because it is
 
Xeo
7:01 PM
@JerryCoffin not really
 
@Borgleader I can read BASIC and other simple languages fine w/o it.
but not with C++
 
@Rapptz You're spoiled. Though I do remember a time in college that syntax highlighting would have saved a lot of time. CDC Fortran compiler accepted line numbers, but somebody had accidentally replaced a leading 0 with ` C`, turning the whole line into a comment. Of course, nobody spent any time looking at the line numbers to find the bug...
 
Xeo
@EtiennedeMartel Ugh, always sad to read that.
 
@EtiennedeMartel Damn... :(
 
7:06 PM
@EtiennedeMartel :|
 
Evening
 
@Pawnguy7 not enough comments
 
Bye
 
@BartekBanachewicz Hm?
 
@Pawnguy7 if you don't know what the code does...
bad naming, not enough comments, bad design
 
7:11 PM
Hm? No, I couldn't think of how to do something I did in the past without looking back at what I did. I know what it does :D
 
@Pawnguy7 ok
 
My point is, I forgot how to do something I evidently knew earlier.
 
7:23 PM
@Pawnguy7 that's called getting old ;)
 
Sigh. I don't seem to be thinking right now.
 
@Xeo Wait, how many times has it happened?
It just didn't onebox
 
@sehe Unfortunately, innocent children have been killed in senseless ways many times. Or did you mean specifically "...by a large snake that escaped from a un-sanctioned zoo"?
 
7:39 PM
@JerryCoffin The latter.
 
@sehe Ah -- though he hasn't said so specifically, I think @Xeo intended the former.
 
@Mysticial is data explorer broken..?
 
@JerryCoffin You think :) ?
 
@sehe Hmm...perhaps my humor/sarcasm/irony detector has failed again?
 
@sehe i like one boxes
 
7:45 PM
@EiyrioüvonKauyf you do?
 
@Rapptz Yeah. It's been at only partial capacity for a while.
Almost all my queries will timeout.
I asked about it, and they said that they recently moved it back to New York and that they were "still working on it". That was a few weeks ago.
 
Hello.
 
Hi.
 
Evening
 
Time of day
 
7:58 PM
$(Time)
 
now
 
SELECT SYSDATE FROM DUAL;
 
0
Q: c++ std::map operator[] causes seg fault

infiniti35You mentioned that your problem was resolved in this question:std::map segfaults when using operator [] Could you please care to elaborate on this problem. I am hitting the same issue and can't figure out what's causing the problem. Thanks, Kunal

 
8:17 PM
std::unordered_map needs comparison operator as well?
 
operator== and std::hash<Key>.
 
Xeo
@JerryCoffin Yea, former
I haz vla.
 
@Pawnguy7 Needs equality comparison to confirm results from hash (i.e., that two items with same hash are really equal).
 
Xeo
And wet hair :|
 
Who said we don't answer old questions? I just replaced an old, super nerdy, hacky answer with this one:
0
A: How to get current value of EIP in managed code?

seheWith C# 5.0 there is a new, well-hidden feature that enables this. Caller Info attributes Note Apparently, there is also the Microsoft BCL Portability Pack 1.1.3 Nuget package so you can use the Caller Info Attributes in .NET 4.0. What this does, is make your optional parameters magically ...

 
Xeo
8:20 PM
@JerryCoffin Not confirm, but disambiguate in case of a collision.
 
@sehe Wow you have 3 answers there.
by the way C:\Users\username\ can be shortened to %USERPROFILE%
 
Xeo
Apparently someone called Jonathan Wakely reported this as a bug in libstdc++ and said they were going to fix it: gcc.gnu.org/bugzilla/show_bug.cgi?id=57465 -- Oops. — Jonathan Wakely 25 mins ago
lol
 
@Xeo Fair enough. Now that you mention it, "confirm" is probably a poor choice of words. There's actually a pretty cool technique that uses what's called a confirmer that's stored with the hashed key so using confirm for something else just adds confusion.
 
@Rapptz Yup. The new answer is actually a reasonable solution (it's actually like the AOP suggestion from my former "sane" answer). Of course, the "insane" answer was much more fun to do
@Xeo dat "fix" as well
 
Xeo
@sehe I was just scratching my head about that.
 
8:27 PM
@Xeo I didn't actually bother. But it looks like a proper c++ trap. Only Malbolge can tip that
 
Xeo
@sehe Oh, wait, I guess _M_not_empty_function is overloaded.
@Rapptz: The third linked proposal talks about initializer_list in the very first paragraph.
 
@Rapptz Not dependably. User can edit environment. SHGetKnownFolderPath(FOLDERID_Profile) might be worth considering (assuming C# lets you use it without P/Invoke or other hoops).
 
Xeo
 
@Xeo Ah.
 
@Xeo So awesome.
 
8:36 PM
I think I'll buy Pikmin 3 today.
 
@sehe sometimes two boxes
but never n-boxes
also n-bodies is a nice way to break physics
 
@Rapptz I heard it's good.
 
.... goddamit we need a physicist
all my puns go out the window :(
 
By that I mean Shigeru said he played it and he thought it was fun.
Which means it's probably good.
 
#include <physics_department>
did it work?
 
8:38 PM
@EtiennedeMartel hehe
 
Eh, currently using Ruby gems stuff. It's like I'm on OS X with port.
 
Evening
 
@TonyTheLion Evening. can you find me a physicist?
@Chemistpp :3
 
There's a certain irony on the slides I'm writing for my "Semantics Matter" talk - they are meaningless on their own, without the talk.
 
8:44 PM
hahaha
 
Ell
Bonjour amigos
J'ai vodka
 
ohhh Vodka
 
:( we need more science in this room
science puns ftw
 
Ell
Iisdrinking vodka and cordial
 
@EiyrioüvonKauyf Our need for science is directly proportional to its ability to provide women and alcohol.
 
8:48 PM
@JerryCoffin so you mean asymptotically 0 ?
:(
 
@EiyrioüvonKauyf I don't think asymptotically 0 is correct. There's certainly science involved in fermentation and distilling. Women -- well, definitely prefer clean and healthy, which both involve science as well.
 
.
hmm (struct){init values} is called a literal constant declaration right?
 
Power outtage T_T
 
:11074694 you momma so fat she's causes the bending of spacetime
.....
many things are magical
things i remove are not
 
You can link to it even though it's been removed?
 
8:56 PM
So poetic
 
@Tuntuni room owners can see deleted messages
 
@Tuntuni Owners can
 
Ah.
 
@EiyrioüvonKauyf A literal constant expression is a prvalue core constant expression of literal type, but not pointer type.
 
8:56 PM
@EiyrioüvonKauyf Aggregate initialization by uniform initialization. In popular speak: "brace initialization"
 
wrong one
 

« first day (1024 days earlier)      last day (3924 days later) »