« first day (1010 days earlier)      last day (3954 days later) » 

9:00 PM
@rightfold the spec says non throwing
 
user142019
Remove the spec.
 
@rightfold very funny
 
user142019
Are you using Java or what?
 
user142019
If so, use Lombok and remove the spec.
 
@rightfold omfg. no the job spec lol
 
Xeo
9:00 PM
@rightfold The problem is constraining the template then, not how strings are concatenated, no?
 
user142019
What language are you using?
 
@rightfold C++ and gcc 4.4
 
user142019
In C++ you throw an exception on error.
 
user142019
You don't return error codes.
 
@Eiy Multiple inheritance is great for combinatorial stuff.
 
9:01 PM
@StackedCrooked oh god no
 
hm, CMake -i is funky
 
@BartekBanachewicz in place? what's wrong with that also -j :3
 
@EiyrioüvonKauyf Wizard Mode
 
well, uh, yes.
 
9:02 PM
dam forgot it's cmake not make T___T
euh when i see C i think just a C version of it; Cython/Jython/derpthon has spoiled me lol
 
make is useless
 
I should try out cmake wizard mode.
Mobile chat is wonky.
 
@BartekBanachewicz not really
and Automake helps to fix that
 
excuse me?
 
I wonder if I should adopt the convention to always throw runtime_error unless there is the need to catch by type.
 
9:06 PM
@EiyrioüvonKauyf Ahahahahahahaha
 
@EiyrioüvonKauyf if you mean "makes it even more useless", then yes
 
automake
 
autobreak
but still not that bad
 
Ahahahahhahaha
I will forever laugh at your choice of tools.
 
you want to use Apache Ant? lol
 
9:08 PM
automake forces you to write a lot of bloat which gives some programmers a sense of accomplishment or even professionality.
 
sense of work done
@StackedCrooked what do you prefer to use
 
user142019
I use go, cabal-dev and mix.
 
user142019
Depending on my choice of language.
 
I'd definitely pick Ant before autoshit.
 
I've used CMake. It fulfils my needs although many people here dislike it.
 
user142019
9:10 PM
Or mcs with glob. :D
 
I've heard that scons is supposed to be better, but never tried that.
 
user142019
I like Waf too.
 
I want a map that instead of being a collection of pair<key, val> is a collection of struct { key; //etc. How is that named?
 
Xeo
@rightfold Wafu~
 
scons and waf are very similar
 
user142019
9:12 PM
@Xeo Wafel
 
user142019
Need moar warm cherries though.
 
damn, my luarocks install got borked somehow
I found luacurl and there's no reason to use PS anymore dances
 
user142019
@kbok An std::set of structs with a custom comparator wrapped in the desired interface.
 
@rightfold Not the same thing.
@kbok Only achievable by Standard in C++14.
 
Careful, we have an asshole incoming
 
9:15 PM
@DeadMG How so?
 
Holy shit, STL commented on my answer.
 
find . -name *.cpp | xargs g++ ; g++ *.o
 
[deleted]
 
might replace many build systems
 
@kbok Because looking up requires constructing the whole struct instead of only the key.
 
Xeo
9:16 PM
optional<value_t> value;!
 
heterogenous lookup in ordered containers is in C++14, so you can find by key without needing the whole struct.
 
@StackedCrooked My non-existing dog is a better build system than this.
 
user142019
@StackedCrooked -c
 
@DeadMG That's actually what STL commented about, well kinda.
Praetorian, consider C++11's heterogeneous lower_bound(), where the range and the desired value can have different types. C++98's less<T> takes (const T&, const T&), so no matter what T you choose, you can't perform a heterogeneous comparison. This matters even for simple cases like std::string and const char *. — Stephan T. Lavavej 2 mins ago
 
user142019
Also I just do g++ **/*.cpp. :P
 
9:17 PM
hm, RAII in Lua
 
user142019
What a horrible idea.
 
@Rapptz Hide this before @ThePhD sees it. He'll be all jealous.
 
@DeadMG I don't userstand why the lookup should be heterogeneous
 
@rightfold hm, why exactly? for closing files looks ok
 
user142019
You bring the biggest pain of C++ to Lua.
 
9:18 PM
I didn't even know he was on SO.
 
user142019
At least make it 100% optional then.
 
@rightfold no, I don't want to close files by hand
 
@Borgleader WHAT
STL IS ON SO!!!!!!!!!!!!!
 
Dammit, I'm drunk.
 
of course it's optional
 
Xeo
9:19 PM
@rightfold ... what
 
function dostuff()
  scope(function()
    local fh1 = assert(io.open('file1'))
    on_exit(function() fh1:close() end)
    ...
    local fh2 = assert(io.open('file2'))
    on_exit(function() fh2:close() end)
    ...
  end)
end
 
@ThePhD And left a comment on my answer.
 
user142019
Say; { raii MyType foo; doSomething(); }.
 
@Rapptz We should invite him to the lounge? <3
 
@kbok Because if you have a std::set<T>, you can only ever find by T, even if you actually want to find by your proposed key type.
 
9:19 PM
It'd be a great thing for everyone no? <3
 
@Rapptz Where? I must see this.
 
I linked it above
 
@chris scroll up nub
:P
 
Xeo
@ThePhD I doubt he has much if any time to chat, really.
 
@Borgleader Oh, geez.
 
9:20 PM
@Xeo I got that impression when I talked to him before. :c
We need to get his attention.
 
Ell
@BartekBanachewicz do you have to precede every local variable with local?
 
WHERE ARE OUR LIBRARY PROPOSALS?!
 
@Rapptz He was in the room when we were discussing this in Bristol.
 
If he were on chat he might use a monniker.
 
I just found a Lua-C++ library
God, is it terrible.
 
user142019
9:21 PM
What a surprise.
 
Xeo
@DeadMG I somehow thought you just meant this room.
 
I'll go with map then
 
Well actually it's not that bad
 
@StackedCrooked He should go under STL and maybe we can see Tomalak get mad
 
but this sucks
 
user142019
9:21 PM
SQLite.
 
@kbok what sucks
std::map< std::string, lutok::cxx_function > module;
    module["factorial"] = lua_factorial;
    lutok::create_module(state, "native", module);
 
@BartekBanachewicz I want a map where the key is actually inside the value
 
I just found a C++ library ...God, it's terrible.
 
@kbok can't you duplicate it?
1 min ago, by Bartek Banachewicz
Well actually it's not that bad
 
@BartekBanachewicz Yes, I can. That's what sucks
 
Xeo
9:22 PM
Pointer?
 
can i use { } anywhere to make subscopes :3 i haven't ever seen this before really used
 
@EiyrioüvonKauyf I use it.
 
Xeo
I wrote something to that length once, a little helper.
 
I have seen it used and most of the time it's superfluous
 
Xeo
Which uses the member of a struct as the key, and the struct as the value.
 
9:24 PM
@kbok why not use a set then?
 
@Xeo @Dead said it was impossible for some reason I don't understand
@StackedCrooked Because I want to search by key, not the whole value
 
Xeo
@kbok No, heterogenous lookup is impossible with std::set (for now)
 
Inherit the key and use a set<key*> :D
 
@BartekBanachewicz and i assume that creates a sub-scope where the variables do not leak out?
 
@EiyrioüvonKauyf if they are proper (no raw pointers etc) then yeah
 
Xeo
9:25 PM
@StackedCrooked map<Key*, Value> :P
Not that that really cuts it
Since the pointer will point to the wrong place, and has to be reseated after insertion
 
@BartekBanachewicz cool; sounds like bad design somewhat though no? is there any guide
 
Xeo
It's finicky, but works
 
@BartekBanachewicz also just wondering what year are you in college
 
@EiyrioüvonKauyf no, why should it be a bad design?
 
9:26 PM
find_if on a vector is also an option
 
@EiyrioüvonKauyf (hopefully) starting 3
 
cool; did you intern for any other places besides intel?
 
@StackedCrooked I thought about that
 
@EiyrioüvonKauyf yes
 
where? if i may ask
 
9:29 PM
AMD
 
btw isn't AMD way behind Intel?
 
Dammit, I got excited by this question:
1
Q: disproportional processing time with arithmetic operations [C]

user2389519can somebody explain what is going on here with this small program? #include<stdio.h> int main() { float a=0.577; float b=0.921; float c; int i; for (i=0;i<100000000;i+=1){ c=0.7*a-0.2*b; //a=0.145*c+2.7*b; } printf ("%.3f\n",c); } Note, there i...

Turned out to be pretty mundane... :(
 
@Mysticial how is that one not common sense; you're not doing anything -> therefore why should the compiler care about it?
 
@EiyrioüvonKauyf The title was very appealing since it's clearly a "Why is A faster than B?" type of question. Next the code was a very short SSCCE. But I didn't expect the problem to be so mundane.
 
@EiyrioüvonKauyf it kinda is, but I shouldn't say that
 
9:36 PM
mhmm some of these questions
2
Q: Average List from a List of Lists - Is there a more efficient way?

RentsyI have a list of lists named 'run'. I am creating an average of those lists using this section of my code: ave = [0 for t in range(s)] for t in range(s): z = 0 for i in range(l): z = z + run[i][t] #Converted values to a string for output purposes # Added \n to out...

1 good answer; the rest are stupid
yes that's cool you can use a list comprehension; but comparing python to C in math is a horrible idea
doing a avg(list of 100 million elements) in numpy vs python easily got me > 1000x speedup lol
 
damn, I want to go to Great Guitar Escape :<
 
@EiyrioüvonKauyf I don't think people here actually care about performance.
 
I want to go to the pool
 
Ell
Can anyone explain this madness? gist.github.com/elliotpotts/87ab06bcf2c6bafaa6d2 grep wont find a match when there is blatantly a match!
 
@Ell ah shell languages are so intuitive
 
Ell
9:46 PM
@BartekBanachewicz that is very intuitive
the problem isn't with the shell language
it's with grep
 
I see
this amazing piece of technology is failing?
 
Ell
well, no, it's my fault
but I don't know what I'm doing wrong :3
 
It's all your fault, Ell!
 
Ell
:'(
 
It's ok
I don't blame you
 
9:47 PM
without grepping gives the file, right?
 
grepping usually gets you a slap
 
Ell
@kbok what do you mean?
cat "Scripts/blah" gives the correct file
 
Dammit Ell.
 
Ell
and there is obviously a saveData there
 
Discovery of the night: Elgood’s Warrior
not bad at all
 
9:50 PM
You could output to file and then search for saveData inside the file. Maybe it's an encoding issue or something..
 
Ell
gah. The problem is, that was just an example file, I have a whole directory tree to do!
 
Maybe it's really sa@@@veData.
 
Ell
Hmm. When double clicked, it opens in GHex, that isn't right xD
 
find . | xargs grep. -i save | grep -i data
I you are really desperate..
 
Ell
file gives Little-endian UTF-16 Unicode text
 
9:54 PM
Without the dot after grep, which I can 't edit out on mobile.
 
@BartekBanachewicz That looks painfully nerdy
 
@sehe a week of guitar. Pure guitar. nothing but guitar
in the mountains.
 
@BartekBanachewicz in a group. everybody aligned and... taking turns shredding :/
@BartekBanachewicz those are nice
 
@sehe that's not only shredding y'know
 
Ell
I think grep thinks it's binary. Still no matches with -a though.
 
9:57 PM
@BartekBanachewicz ... I was giving it the benefit of the doubt. But wokay. What strikes me as odd is the 'group' thing, especially everybody sitting there, instruments ready and armed
 
@sehe there are group sessions and each player has some 1on1 time with the teachers. Trading ideas, techniques and stuff is encouraged.
@sehe I guess they just won't let go of their guitars :)
 
Xeo
Crap. The toycode I've just written for using internal keys in a std::map seems to invoke UB :(
 
grep probably can't process UTF-16.
 
Xeo
The comparision seems to be wonky on GCC, but works fine on MSVC
 
@CatPlusPlus does it make it a nonturing machine? :D
> Download .zip 32-bit 7-Zip Command Line Version
you're fucking kidding me
why would you want to pack 7zip in a zip archive.
why.
 
10:04 PM
Because people downloading 7z wouldn't have 7z to begin with?
 
@ThePhD ?
 
^ what a troll :D
 
Lol.
@Rapptz If you don't have 7zip and you download a .7z archive, how are you supposed to open it?
 
@BartekBanachewicz So you have to download WinZip first. It's all a conspiracy!!
 
@ThePhD your last message seemed out of context with no one talking about 7zip
 
10:06 PM
@Tuntuni ...
 
@Rapptz Oh.
 
Ell
damn. Someone hacked ubuntu forums
what dickheads.
 
@Ell also Apple Developer?
 
Xeo
Maybe somebody can help me find the UB? /cc @kbok coliru.stacked-crooked.com/…
 
10:11 PM
oh nice
 
Xeo
Yeah, if it worked
As I said, finicky.
Must be something internal to libstdc++'s std::map that breaks this
Since MSVC 'works'
 
I'm too tired and it's too hot, sorry
 
Xeo
Yeah.
Better just write your own map-type, or duplicate the key.
 
I used @StackedCrooked's suggestion, which will work fine for the time being
vector with find_if
 
Xeo
mh
 
Ell
10:17 PM
meh. I can't get any utf-16LE search to work
I'll have to convert everything >.<
 
interesting, found a bug in our code a while back where if a file is an exact multiple of 88000 bytes of data, our code goes into an infinite loop
 
"What have you tried?" comments no longer possible. Fuck you, SO.
 
@BartekBanachewicz it looks much like that is in the case
@LightnessRacesinOrbit On it
 
Ell
Yay I did it!
find . -type f -name *.as | xargs -I{} iconv -f UTF16LE -t UTF8 {} | grep save
 
hmmm got to this answer
3
A: "What have you tried" epidemic

Lightness Races in Orbit Posting "what have you tried" when the user has clearly shown that they have tried to solve it on their own The problem is that you're taking the message literally. "What have you tried?" comments do not mean "I want to see the limited, failing research that you have sort of done, because y...

 
10:25 PM
@LightnessRacesinOrbit I remember seeing a meta discussion about that.
 
read it .. thought "I agree with this guy"
turns out it's me
 
@Ell erhm.. why are you using xargs?
 
Ell
@refp why not? :3
-exec?
 
@Ell next time; find . -type f -name '*.as' -exec iconv -f UTF16LE -t UTF8 {} \; | grep save
fuck.. I don't have a charger for my phone and I'm expecting a kinda important call in about 3 hours
ie. at 3am
also I'm mad at mpd since it's magically found some weird artist name that doesn't show up when I check the id3 tags
 
Ell
10:28 PM
well. I didn't find what I wanted anyways :3
 
@Ell *.as will be expanded to match whatever in cwd, wrap it in single quotes (could be why you didn't find anything)
 
@LightnessRacesinOrbit I use "Have you tried anything?"
 
@Xeo related: that container seems extremely likely to be abused -> resulting in UB.
map["abc"].key = "zyx";
 
@Rapptz not PA enough! :P
 
10:36 PM
Well, with italics it can be. "Have you tried anything?"
 
guys ;_; too much programming what am I doing?
 
@Xeo in "map.emplace(kv(v), std::forward<T>(v));", how is it constructing the internal_key from a std::string const&?
 
Xeo
address
 
have you tried throwing it in the dumpster? that will def' get rid of whatever is causing the problem.
@Crowz porn. we are always doing porn.
 
Xeo
hm, I think I can see a potential problem
 
10:40 PM
I can't see nothing, I'm blinded by the porn.
porn.
P0RN.
 
Xeo
value being moved in emplace
 
@Xeo kv(v) returns a const reference, and somehow map is converting that to a non-const reference, or a pointer?
 
Xeo
no
look at the typedef
 
ah, missed the const there
 
Xeo
1 min ago, by Xeo
value being moved in emplace
 
10:41 PM
so you have a mutable const T*?
 
Xeo
is likely a problem, though
ya
 
@Xeo yes
@Xeo why mutable?
 
Xeo
Welp, you really gotta write such classes yourself.
 
Also, why all of this instead of set?
 
Xeo
@MooingDuck emplace returns a pair with an iterator, and the iterator points to pair<K const, V>
@MooingDuck No heterogenous lookup
When I access .first.key of that pair, the type is T const* const
That's why the mutable
 
10:44 PM
got it
 
Xeo
assignment
Could also be done with a second pointer (pkey = &key) and then *pkey = &newkey
 
> Je style comme un esti de jambon.
 
dafuq
 
I've been wondering why my list view item always had the same background color no matter what I did.
Turns out I hardcoded it in my style.
 
@EtiennedeMartel If I have a C++ project that is a static lib, can i used it to drive a DirectX11 "surface" in a WPF application or does it have to be a dll?
 
10:49 PM
user image
2
lol
 
I'd smile too
 
@Borgleader You can't P/Invoke from a static lib, so you'll have to either put that in a DLL or do some glue code (ideally C++/CLI).
 
why would you smile? D:
 
@Crowz Because beautiful women deserve smiles.
 
Are you hitting on me?
Because I accept your sexual advances
 
10:51 PM
@EtiennedeMartel Hmm, I might make a dll wrapper then.
thanks
(In case you're wondering, I was thinking of doing maybe, an ultra basic "UDK Editor")
 
@Borgleader ...
 
@BartekBanachewicz Dont want to hear it Bartek
I said "maybe thinking of" keep your ... for later
 
@Borgleader what?
I didn't say anything
 
@BartekBanachewicz You did type something.
 
ohnoes three dots
so offensive
 
10:55 PM
You like to assume things, it seems.
 
...
whatever.
@EtiennedeMartel you said you use C# as scripting language. Did you try running your code on non-Windows system?
 
Think it would be possible to make enum values be a subset of another enum value?
 
@Pawnguy7 nope. I'd like that oo
 
Neuroscience books are happy fun times
 

« first day (1010 days earlier)      last day (3954 days later) »