« first day (875 days earlier)      last day (4298 days later) » 

11:00
@BartekBanachewicz I think I just did.
@TonyTheLion No, he was right- it has nothing to do with the problem.
the problem is that he set the empty key to NULL, but then defined a comparison operator which could not handle NULL.
@FredOverflow One thing I really hated about C# was the inability to capture references by returning them.
Lounge<SC2> is getting larger
11:00
apparently the idea that the keys might be compared to others in the map is just ridiculous
@DeadMG hmmmm
although
formally, you are right in that it is UB.
the set_key_empty function has to be set to a value that will not be used in the map otherwise
he used NULL
which when having pointers as a key type seems kind of odd
@ThePhD Returning by reference is just not safe enough to allow it. Oh wait, that's probably not what you meant.
because pointers can be NULL
@DeadMG so he would need to fix that, no matter any other issues
11:02
@FredOverflow It made working with PoD types (e.g., vertex types in Graphics) much more difficult, because if you weren't directly working with an array type (Vertex[]) and were instead messing with a List<Vertex> or something else, everything had to be done VIA copying. =[
@TonyTheLion Obviously, the empty key value has to be an instance of the key type.
@TonyTheLion Yes.
C# isn't very friendly to in-place changing of structs...
user image
8
ahahahaha
how Lounge sees rest of stackoverflow
ug ug!!
haha
damn you @sehe I can't even read this makefiles :/
complicated
gotta love those simple websites, telling you what you really want to know
0
Q: How do I force the compiler not to skip my function calls?

us2012Let's say I want to benchmark some function double a(double b, double c). I already have a large array <double, 1000000> vals from which I can take input values, so my benchmarking would look roughly like this: //start timer here double r; for (int i = 0; i < 1000000; i+=2) { r = a(...

Seems really retarded.
hmmm
it's not a dumb question
what.
Why should you want to profile the code doing nothing?
why can't you just profile the code that is going to be optimized in the first place?
11:13
lol
cause noobs
@BartekBanachewicz The OP is trying to pick the better of two implementations of a.
Standard benchmarking techniques.
okey, now it's clearer
too bad most of this questions is "optimization"
I bet a 6-pack of beer that it's not a hotpath in his or any other code
@Mysticial I know I might be obsessing a bit too much about the overhead of one simple addition, but I'd still be interested to see whether there's a general way to tackle this. — us2012 43 secs ago
see?
Don
Don
If when trying to code a socket server you must use accept() to get new connections (which is also blocking) how can you constantly listen for new connections while also processing data received from clients at the same time?..
11:17
@Don threads or timeouts. Accept doesn't have to block
Don
Don
Oh
but if you want it to block, then threads obviously
@Don Looks like a good candidate for a proper SO question.
user1357851
newblet today is the pro tomorrow ... not every newblet of course. Some newbs remind newbs as long as this universe exists
@FredOverflow which has a 10000 duplicates already
Don
Don
11:18
Well the socket I'm currently using is always blocking, so my only option is threads / timeouts I suppose
well timeouts won't be too fast
they are convenient sometimes
@Don what language are you using?
@BartekBanachewicz If he had started asking a question, he would probably have seen those duplicates.
@FredOverflow right.
Don
Don
Since I'm no C++ programmer and I was curious about sockets, I tried to create a simple one with Actionscript 3 & Red Tamarin
Don
Don
11:21
(Open source project that runs actionscript on the console) lol
sockets in Lua are funky
I've written a nice distributed platform based on only Luasocket
so you might want to try it
Don
Don
Sure I'd love to
which has the additional benefit of being actually usable, contrary to AS
@Don I mean, Lua, because my code was sadly left in hands of my previous employer :(
I forget to steal grab it before leaving
Don
Don
Aw ;o
anyways, if you want to try Lua, I am willing to help
I am always eager to show this language to people
Don
Don
11:25
Haha I see, well I'd go for it if I can actually use it for my lil' projects in the future, for things like storing data in a database (SQLite / MySQL) and be able to hold a nice amount of connections
@jalf Thanks for your suggestions, but I don't quite see how this turned into "you don't have a basic understanding of". I have edited my question to make amends for the fact that += may be a valid solution for the practical problem at hand - but as stated, I knew about += before I asked this question. — us2012 25 secs ago
umm
SQLite doesn't require sockets at all
^^ I quit... And @jalf probably will too...
Don
Don
Well lets just go for it , learning is always nice :3
Don
Don
11:26
Gimme the Lua
4
<3
operating system?
Don
Don
Windows atm :o
so grab luaforwindows
it's for 5.1.4 right now, but as a beginner you'll hardly notice differences between 5.1 and 5.2
Don
Don
Oh alright
-1
A: Mysterious segmentation fault with dense_hash_map

John SmithAs per gdb's output, there is a nil-pointer deferencing. The function bool operator()(const c64 *p, const c64 *q) const { return *p == *q; } should rather be bool operator()(const c64 *p, const c64 *q) const { return p == q; } All works fine with the change.

now we can downvote him again
Don
Don
11:28
Installing 5.1.4
@CatPlusPlus Here's one for you to troll about "performance":
3
Q: How do I force the compiler not to skip my function calls?

us2012Let's say I want to benchmark two competing implementations of some function double a(double b, double c). I already have a large array <double, 1000000> vals from which I can take input values, so my benchmarking would look roughly like this: //start timer here double r; for (int i = 0; i...

@Mysticial too bad you didn't take my bet
Even I'm starting to call it ridiculous...
@DeadMG lol.
14 mins ago, by Bartek Banachewicz
I bet a 6-pack of beer that it's not a hotpath in his or any other code
Don
Don
11:29
Alrighty, installed
@BartekBanachewicz Not even that. The OP completely changed his question.
@Don did you run introduction? :)
Don
Don
Haha yep
I want the compiler to optimize by inlining, but it should not remove my function calls!
Don
Don
I'll go through it a bit :3
11:29
@rubenvb Yeah...
And now he's complaining about the phrase, "you don't have a basic understanding of" that @jalf told him.
~performance~
I am not ever touching that tag ever
it's worse than
<- best of both worlds? :)
@Mysticial no offence :)
4
A: Printing an array in C++?

FredOverflowMay I suggest using the fish bone operator? for (auto it = std::end(a); it != std::begin(a); ) { std::cout <<*-- it <<' '; } (Can you spot it?)

^ Spare some rep? :)
11:33
@FredOverflow there's a girl on SO who has 8k rep, over a half of it from one question tagged exactly that
@BartekBanachewicz Cicada?
user142019
2 messages moved from Java Sucks
@FredOverflow nah
@BartekBanachewicz I thought Cicada was the only girl on SO?
user142019
inb4 Telkitty.
11:34
@FredOverflow there are no girls on the internet :(
Ell
Ell
Hi guys
alestanis, Paris, France
8.3k 2 12 37
557
A: JavaScript - Are loops really faster in reverse...?

alestanisIt's not that i-- is faster than i++. Actually, they're both as fast. What takes time in ascending loops, is to evaluate, for each i, the size of your array. In this loop: for(var i = array.length; i--; ) You evaluate .length only once, when you declare i, whereas for this loop for(var i = 1...

@Ell hi Ell
Ell
Ell
Agh her blog puts code in images >.<
@BartekBanachewicz Starts well on the left, then you scan right.. :(
11:36
@Ell do you possibly have any makefiles from when you built minicraft?
Ell
Ell
@BartekBanachewicz I have the cmakelists.txt but really it wasn't very difficult
ah you used cmake
Ell
Ell
all I did was build all the dependencies and then added include/library directories
yah, I don't have a clue how to write normal makefiles xD
I am reading through sehe makefiles ATM
Ell
Ell
well, I've never tried really
11:42
@Don LuaforWindows has "batteries included", so you should just be able to require("socket")
Don
Don
@BartekBanachewicz I see, and the actual socket will be the one you made I guess?
@Don hmmm? did you read luasocket docs?
Don
Don
@BartekBanachewicz Oh, no not yet~ I'm still following the introduction lol, it's quite nice and simple :) I'll have a look in a moment
@BartekBanachewicz lol
11:45
@Don I found the backups
Don
Don
:o
I don't know how old they are
Don
Don
So you did take them after all!
but after I wrote to you I've lost them
I've run *.lua search pc-wise
and found Dropbox archives
Don
Don
Oh I see lol
11:46
ohmigosh
one of the backups is old
but the second looks nice
2012-07-30
Ell
Ell
Ima boot into linux
^ grab it while it's hot
I might put it on github anyway :P
It has stuff like
You can run an app on one PC
then serialize it and run on the other
and it will still work
Don
Don
o-o
hot-moving
It was a Proof of Concept in my job
I had a snake server
@us2012 It might be useful to know that RDTSC has a variation that is almost 100x the cost of a +=. — Mysticial 5 secs ago
11:50
One PC was displaying the snake (the client)
^^ see how he responds to that
and you coudl just move the server between the other PC and my iPad
it had like 10ms switch time
Don
Don
Oh wow that's sweet ;o
to serialize, close app a, send the data, run it on other server and continue
Ell
Ell
Can I compile engine & minicraft on linux now?
11:51
I was going to add High Availability to that, but well, they weren't interested in that anymore :/
Ell
Ell
without modification :3
@Ell just makefiles
huh
a protected function just saved my bacon from a potentially nasty code generation bug.
well, I was going to make a nasty mistake, and then the compiler (accurately and very helpfully) complained.
11:53
@Don the .7z I've sent you has both snake server and client
Client is written in LuaGL :)
yea, I totally should post it to github someday
maybe someone else will see the potential :|
Don
Don
Yep you should :)
i will have to clean it up a bit
It's like 10 minutes of work
Wait snake as in the game snake?
@CatPlusPlus I don't want to put "just files". It needs readme and instructions
@Aleks yep
11:55
I rarely bother with throwaway projects
lol that's pretty sweet
this wasn't throwaway!
it was my petty for a while
but I stopped working on it when I left Adva
Well then release it
help me with linux makefiles then first :3
or any other build system
I've read about SCons and Waf
Ell
Ell
or cmake!
11:57
I honestly don't care.
user142019
CMake is horrible.
I want it to be as idiot-proof and easy to use as possible
user142019
Waf.
it isn't in my apt-get repos :/
Ell
Ell
cmake has cool coloured progress bars when you build on linux!
user142019
11:59
Which nobody cares about.
I have to agree with Zoidberg here
user142019
@BartekBanachewicz you don't need to install it.
user142019
You just put it in your repo. It's a single file.
CMake also calls itself repeatedly to make those coloured progress bars which slows the build down like fuck
11:59
should I download the binary?

« first day (875 days earlier)      last day (4298 days later) »