« first day (2054 days earlier)      last day (2880 days later) » 

12:00 AM
2
A: Efficient ways to calculate (-1)^n in C++

Maxim EgorushkinWith gcc 6.1 both produce the same assembly: int f(int n) { return n % 2 ? -1 : 1; } int g(int n) { return n & 1 ? -1 : 1; } Assembly: f(int): movl %edi, %eax andl $1, %eax negl %eax orl $1, %eax ret g(int): movl %edi, %eax ...

With gcc 6.1 both produce the same assembly great success
compilers 1, OP 0
 
> -(n & 1) | 1
if you read the answer
 
@Borgleader
-17
Q: *Please take a look at my code---> about Link List structure * Please* FAST ANSWER

M_Safaiyan77the sample result of this code should be "7 5 3" but it shows:"3" just. what is the problem? #include<iostream> using namespace std; class Link { public: long info; Link *next; Link *prev; Link(long i, Link *ne = NULL, Link *pr = NULL) : info(i), next(ne), prev(pr) {} ...

 
@Mysticial top kek
How close to your homework's deadline were you? — Borgleader 8 secs ago
 
Also, can I get some delete votes on this: stackoverflow.com/a/37495828/922184
It was deleted from review, then the OP undeleted. lol
 
12:08 AM
cant vote to delete, but i can flag as NAA
 
@Mysticial Who stared that?
 
@NaCl Me. I bookmark a lot of hilariously bad things.
 
haha :D
 
it is the wrong size of the array. You need to implement functionality so you do not have empty places at the end of the array. This is my question? Can you fix this mistake? cheek this code careful. i need an answer buy tonight. — Mebara 7 mins ago
@Mysticial Found another one
Fire the orbital downvote cannon.
 
12:23 AM
@VermillionAzure So, how did I do? No keyboards other than my PC one were harmed in the process (I even moused on Soundcloud!) paste.ubuntu.com/16854990
In case this is easier: paste.ubuntu.com/16855031
 
Sigh when running my app it causes random '~' keyboard presses in >any< window. Great. I will really have fun debugging that.
*sigh
 
oh hello!
 
@Gizmo lol what does your app do?
LOL
joke, or actually?
I feel re~ally bad for you... :~(
 
QT app, opens ~66 websocket connections, invokes another C# app and ręads console from it
closes and well, just chats with strangers
 
12:29 AM
does it invoke key presses anywhere?
 
OH CMON
no
 
I call UB
 
hm... does it ~send signals to keyboard anywh~ere?
 
yeah what the hell how
It's not going to be fun to debug :(
oh gawd even here
 
whats with the accénts?
 
12:31 AM
~ + a,c,e,s,n
polish keyboard
and a few more
 
oh, lol
is your code online?
 
can I see?
btw how old are are you?
what gender are you?
 
man? xD
haha what are those kind of questions xD
22
 
wow thats a LOT of files
okay can I ask you something?
 
12:33 AM
you only need qt_test and sidgen
nothing more
 
@thepiercingarrow again?
 
hm? lol
 
@sehe he's doing some survey?
 
@sehe uuh
 
why not link to a google.. survey thingy
 
12:33 AM
@Gizmo i started a chat
 
Seem like
 
its not a survey
 
I'm busy transcribing it so I can hear it
 
hmm.. ?
 
@VermillionAzure Just ask for the midi (not sure whether it plays, it doesn't for me): stackoverflow-sehe.s3.amazonaws.com/…
 
@sehe Yeah that's a bit nicer
 
I thought you said you had transcribed it >in order to make the sound file<
 
I did but you changed parts so I just started again
and I like what you did with the middle section it sounds less heavy
 
@VermillionAzure o.O The notes are so much nicer
 
@sehe What you teasing me for?
I guess I'm scared of writing boring baselines
 
12:36 AM
I mean literally. The music notes are worth more than a midi render.
Of course when it's a midi recording of actual live play that might be different
@VermillionAzure I don't think I missed much (although in midi rendering it's easier to miss an harmonic since the pitches blend too perfectly)
 
Yeah it's much much niver
 
You know. It's a 1:1 transcription. Any left-out note is accidental, and it's not gonna be more than 2 hardly noticeables
Forgot the ornament
 
hey
@Gizmo I recursively grepped for common phrases that trigger keyboard
@Gizmo didn't find any...
 
Yeah I also didn't find a thing :/
Didn't test it on any other system than W10 x64
PH FOR GOD's SAKE
Worst.bug.ever.
AAAAAAAAAAAAAAAAH
 
hmm have you gdb'd it yet?
 
12:40 AM
@sehe ???
 
how am I going to detect "ohai OS I'm sending you a ~, and a ~for you and a ~for yóu and ~for you~"
 
 
I didn't check, but I'm even absolutely sure about the key :)
 
@Gizmo it'll be doing the ~'s into the gdb console?
@Gizmo then just see when it does it
win 10?? lol
 
12:42 AM
ye VS/W10, it's cross compatible tho (hm however I wonder if u can find a working XUL runner version with SidGen)
 
Found out how to do the ornament. Just a\prall there
K cya tomorrows
 
@sehe aw :)
i wish you could listen to one more
night
 
I am not so sure whether those who some journalists called trolls are just people who have different opinion than themselves
 
1:20 AM
any mods online?
 
why is the internet always so dead when it's 3 a.m. here
is Europe the only participating party here?
 
hi
from hawaii
 
hi from the continental US
 
Hey I have this thing I want to show you guys
 
:)
 
1:28 AM
I am U.S
 
I will show you
Can you guys tell me what you think?
 
mmm I like piano
nice melody but.. shit quality?
 
Oh
I'll turn it down then
 
I mean I have my earbuds in, nice hq sound, always clear, but that, much noise / or whatever that effect is
 
Oh it's the reverb
Let me try again
 
1:47 AM
reverb?
 
taking so long xd
y u no have 1gbit/1gbit?
and 980gtx
 
@VermillionAzure I got a 404
> We can’t find that track.
Did you try to access a private track while not being signed in?
Maybe the track has been removed.
 
got it thanks
what is soundcloud?
is that you?
 
at 0:32 it gets so <whizzy>
 
1:50 AM
not bad at all - sounds nice
 
soundcloud is the youtube of pure audio
 
@jaggedSpire wow... amazing
 
like I said melody is nice but :(
 
i've been looking for that for ages - how come i've never found it?
 
I dunno
 
1:51 AM
quality of sound is not very good though...
less expensive piano? or bad mic?
@VermillionAzure did you write that yourself?
 
yeah i did
 
pretty good!
 
thanks
 
2:16 AM
@QPaysTaxes vim
uh oh runs away
 
@QPaysTaxes emacs
@QPaysTaxes its more intuitive - most people who use vim or neovim started with emacs then switched when they got more familiar with how things work
@QPaysTaxes becuase emacs uses the controls, which more people are familiar with - vi introduces the concepts of different modes, etc.
@QPaysTaxes also emacs has better docs
its just easier to learn
 
@QPaysTaxes vi is everywhere
 
idk to this day, I'm still not entirely sure how to type on vi
 
@thepiercingarrow because maybe you didn't use it
 
I know how to insert a few characters, and :wq to save
but thats literally it
 
2:19 AM
@QPaysTaxes It's really up to you then
having a vi vs. emacs debate is pointless
7
 
@VermillionAzure but I tried to learn and all my friend said was "do i to insert"..
@VermillionAzure good point
XD
do whatever you are more familiar with
@QPaysTaxes yup exactly what he said
 
@QPaysTaxes You'll also have to tell her how to move up and down lol
 
but how do you type more than one line? and how does deleting work??
its just a new concept I don't have time to lern
@VermillionAzure I know its jkl;
 
@thepiercingarrow I personally find vim very powerful once you learn features
But I'm sure emacs is eventually more powerful
 
but its annoying because I'm more used to C^n, C^p, etc.
 
2:21 AM
@thepiercingarrow I rarely need to press Control in VIM
 
@VermillionAzure lol really?
 
@QPaysTaxes Yes that's the whole point
I believe it uses GNU Guile
vim has... vimscript
 
hello
I was gone for a bit
That was basically me making the switch from google chrome to chromium XD
Don't know why I waited till now... :/
emacs lisp is confusing though...
most of my config file was copy-pasted
 
@QPaysTaxes Emacs is meant to be extended more easily due to it using a Lisp dialect
It can even do email and stuff
 
@QPaysTaxes there's a good article for this
 
2:23 AM
@QPaysTaxes Lisp is a very expressive language, nevertheless
 
@QPaysTaxes found it: en.wikipedia.org/wiki/…
basically Google Chrome = Chromium but worse + autoupdate
now only thing I have to do is remember to update flash once in a while
honestly it feels almost exactly the same
still not as good as palemoon... whatever
i'll stay here for now
@VermillionAzure dunnet was written in lisp
and its an amazing game!
emacs -batch -l dunnet
 
 
1 hour later…
3:33 AM
destructor?
.. sorry I am dumb
 
4:00 AM
@QPaysTaxes you cannot put a derived in a vector<base>
 
@user326964 Unfortunately, it's hard to memorize a thought process. You already seem to understand most of what you're doing, so take the exam :D
 
 
1 hour later…
5:21 AM
that’s contradictory in that shared_ptr<some_superclass> does not extend shared_ptr<some_subclas>
@QPaysTaxes it’s not true whichever way
@QPaysTaxes I am not nitpicking
this is crucial for understanding
@QPaysTaxes have a look
you can’t goad me into goodwill
 
6:07 AM
morning
 
user1804599
6:49 AM
Hi
 
Ven
7:03 AM
Hi!
@QPaysTaxes has been for a good while
@QPaysTaxes that's literally meaningless
 
@QPaysTaxes Hi. Relieved to see it wasn't just me.
Goad morning :)
 
Ven
Very simple: you have no clue how people are gonna extend your/other classes
 
@VermillionAzure that's cruel. I don't wish vim script on my foes
 
Ven
Secondly, even if you could traverse an inheritance chain downwards, it'd return a list of most-derived classes, not a single type.
 
You can test for a list and go with the one that matches :)
 
Ven
7:09 AM
shrugs
 
@6502 why would that ever happen (also, very little wrong with that choice of EDSL syntax. %= is quaint, but so are its semantics; no reason to use it here at all) — sehe 1 min ago
@StackedCrooked something wrong with coliru?
 
Even the best firewall can not compete with no internet at all on a dev machine
 
7:25 AM
Even with obvious truths like that... you manage to make it a weird statement by tacking on random stuff like "on a dev machine".
Need to read "on a dev machine!" in James Brown voice.
 
/dev/null machine
 
@sehe lol
you’re pretty fly for a white bear
 
polar bear look fat because white
if black then bear would look thinner
 
7:47 AM
Is it preferable to use an std::vector of smart pointers compared to raw pointers?
 
user1804599
@quiZ___ It depends on whether you need the pointers to have ownership of the pointees.
 
Can't you um, not use pointers? An STD vector can hold the actual objects right?
The only time I've had to use a std::vector of smart pointers was when they pointed to hardware device addresses and had some vendor specific destruction procedure.
 
Ven
Yeah but not references
 
I use pointers for polymorphism. But, comparing storing raw pointers to smart pointers, both methods are equally exception safe aslong as they are stored in the vector?
 
What? How does the vector call delete on them in the case of raw pointers?
 
user1804599
7:54 AM
RIP
 
Right, it doesnt, thank you.
 
user1804599
And don't dare judge a video by its title.
 
Ven
I judge you by your name
 
@rightfold I didn't get the talk, why is inheritance the base class of evil?
 
7:56 AM
;_;
I wan to stop doing Java and shit.
 
user1804599
Learn Scala.
 
I want to go back to C++ if only to remember how hard it was.
 
more like hardcore
 
But I am reluctant to change jobs because this job has lenient time constraints.
I am trapped.
 
{joke about poor condition variable response times in Java}
 
user1804599
8:01 AM
@wilx Try Stockholm syndrome.
 
@rightfold lol
 
@rightfold lol
 
8:17 AM
So today I finally learned how to spell a word I've loved since childhood...
Speculaasjes ^m^
 
Ven
gay4words
 
sbi
Hi.
 
logophile, I believe
 
sbi
What was it with function templates being declared as friend of some class? Do you have to declare them before the class' definition?
 
Whichever way you do it, it'll break in some compiler. :P
 
sbi
8:20 AM
Oh, c'mon, this was in C++98!
 
I mean, there's some clusterfuckery with surrounding namespaces and shit.
I still don't understand why the version I have settled on for my variant's get works, but the other ones don't (and by "don't work" I mean "break in one of the compilers I want to support).
 
@sbi IIRC they don't need to be declared before the class definition.
Should just try it out.
 
sbi
Sigh.
boost::flat_map is acting up, so I'm cooking my own flat map on top of a sequential container...
 
It's pretty easy with std::lower_bound. (I only recently discovered that one.)
 
sbi
Mhmm??
 
8:30 AM
Incidentally this is how programming without types makes me feel #PyCon #juggling https://twitter.com/itsmemattchung/status/737469931994779648
PyCon is evolving towards a true juggling conference
 
@sbi It can be used to implement binary search.
 
@sbi How would it act up
 
Actually, it is binary search. (At least when used with random access iterators.)
So there's not much work left.
 
@sehe it wants a tattoo and to come home later in the evenings
 
sbi
@sehe See here.
@StackedCrooked Of course it can. Care to elaborate why it would be (as you seem to imply) specifically helpful for doing so?
 
8:35 AM
Hehe. You mean, GCC 4.1.2 is throwing a fit
 
Well, if you don't use it then you'd need to implement binary search yourself. Which would be error prone.
 
user1804599
oh god this file API is so damn stupid
 
sbi
@StackedCrooked Oh, I see: "The number of comparisons performed is logarithmic..." I didn't know that!
 
sbi
So map::find() boils down to std::lower_bound(begin(), end(), value_compare(comp))?
 
8:38 AM
That looks right.
 
sbi
Nope. That needs some std::bind() in order to bind the Key to the comparator...
 
@sbi And check that is actually arrived at an equivalent key!
@sbi That doesn't really make sense. How about key_compare
(assuming it exists)
 
sbi
@sehe Nope. The algorithm is iterating over value_type. (You need to know: bool value_compare::operator()(const value_type& x, const value_type& y) const {return comp(x.first, y.first);}.)
@sehe Oh, right, it doesn't necessarily return end() when it failed. Ugh.
 
That's not ugh IMO. It's the sensible thing. The name is lower_bound after all, not find
 
sbi
That might well be, but it is ugh in the context I am applying it. :)
 
8:44 AM
@sbi That looks fine then. Don't see why it would require a bind to access the key (it's clearly done)
 
ugh is the new cool
 
@sbi Oh yeah. It's always ugly to reinvent wheels :)
 
sbi
@sehe But only if I also pass the key: std::lower_bound(begin(), end(), k, value_compare(comp))
 
user1804599
I want an OS that uses HTTP for system calls.
 
@sbi ah in that context; you're right
 
8:47 AM
It's not reinventing the wheel. It's making your own wheel instead of ordering one on Amazon.
 
Except that making it involves inventing the design choices
 
sbi
const iterator result = std::lower_bound(begin(), end(), k, value_compare(comp));
if(result != end())
    if(result->first == k)
        return result;
return end();
That should do.
 
I'm nto touching that. I'd very much say the problem is the compiler. I'd sooner reduce optimization levels ubt that's me
 
sbi
@sehe We're on an embedded platform with limited memory and CPU. It took lots of fiddling to find the optimization settings resulting in executables small enough to be even loadable on that platform...
 
@rightfold wouldn't that be a Distributed OS?
 
8:49 AM
@sehe strict aliasing is one of the big ones though
 
Ven
oooh blue \o/
 
@Ven looks like a bug splat
 
Ven
@LucDanton thanks <3
 
user1804599
And of course the examples don't link to the API reference so I have no idea what the 0 does there.
 
user1804599
8:51 AM
Why are people so so so so bad at software development
 
sbi
What would be faster when inserting a range of elements into such a sorted vector: finding the right spot to insert for every element or just appending all of them and sorting then?
 

« first day (2054 days earlier)      last day (2880 days later) »