« first day (779 days earlier)      last day (4171 days later) » 

Ell
12:02 AM
God ettermiddag
Good afternoon :L
 
That awkward moment when you realize that liquid running down your nose is actually blood. Now I need to clean my keyboard. Fuck.
To quote @Mysticial "way too much blood flowing around here".
 
Ell
Blood? O.o
Heh yeah. is it a random nose bleed?
 
Yeah.
No fucking idea why.
 
worse places for blood than the nose
 
Any idea how to make this thing stop?
 
12:07 AM
@sehe I'm not bipolar. :c
 
Xeo
@R.MartinhoFernandes Put a tampon in!
 
Yet
@R.MartinhoFernandes I know how that feels
@Xeo Verified method
 
Ell
Pinch the top of your nose?
Just don't lean back
 
I usually just tuck in a piece of tissue paper
 
@Xeo That will only solve the problem of having to clean up everything. It doesn't really stop it, does it?
 
12:09 AM
@sehe Yeah, I was gonna say. Tampon is a little excessive, and over-engineered for something like a nosebleed.
 
@R.MartinhoFernandes It should
@ThePhD Depends on the instance
 
Xeo
@R.MartinhoFernandes As long as the blood can congeal (?), it should.
 
@R.MartinhoFernandes If it doesn't, see your doctor. Only haemophiliacs should generally worry about it not stopping
 
@Xeo Coagulate.
 
operator= with 2 standard lists Move's the list where possible, right?
 
Xeo
12:12 AM
If the rhs is an rvalue, it will be moved.
 
Um. A class member - non const - is an rvalue, yes?
 
Depends.
 
Xeo
Maybe
Ask again.
/8ball
 
There's an accompanying headache. Should I be worried?
 
@R.MartinhoFernandes Headache might be normal, but if it gets worse, than, uh. Might want to peel out and hit up some medicine places or something.
 
12:14 AM
get some sleep
and food / energy
 
@R.MartinhoFernandes If this would feel like a usual headache I wouldn't be worried if it happened to me.
 
What's the problem?
 
Ell
Brain hemorahge or something
 
Oh. Nose bleed w/ a headache
 
Hm. I have a std::list on a class. An instance of that class, in one of its functions, is going to operator= the list into another list declared on the stack. None of the things involved are const.
 
12:16 AM
No biggie.
 
Ok.
Seems to have stopped.
 
I'm thinking a copy will happen. Let's compile and see if I'm right!
 
man
40 minutes to download 175MB
 
@ThePhD it is indeed a copy
 
Did you tilt your head back?
You're not supposed to do that.
 
12:18 AM
@Rapptz No.
 
Mmk.
 
I just painted a red path from my bedroom to the bathroom to get some toilet paper to put on it.
 
Next time just pinch your nostrils and then tilt your head forward for a bit.
 
@R.MartinhoFernandes I usually just jut my bottom lip out and suckle on the blood. I mean, it's not like I can give myself an STI or anything.
 
@Rapptz Won't that just fill his sinuses up with blood?
 
12:20 AM
@DeadMG Ouch! You need to find a job where the surroundings have better access. When you look for a flat, keep your priorities straight: 1) fast pipe 2) roof to keep computer dry 3) enough room for a chair next to the computer 4) Everything else.
 
@DeadMG No.
@ThePhD That's disgusting dude.
 
@Rapptz What? It's practical. ._.
 
@Rapptz I thought you were like, a medical student or something
 
@Rapptz I don't expect there to be a next time.
 
@R.MartinhoFernandes Everyone says that, but it never happens.
 
12:21 AM
@DeadMG I am. We're taught to avoid blood.
 
@R.MartinhoFernandes Nobody expects that Spanish Inquisition!
 
@Rapptz That's rational, not emotional. Disgust is an emotional reaction.
 
I meant disgusting because of the risk of a blood-borne disease even if you think you're clean.
 
... But it's my own blood.
 
well, I think he's quite right in that he can't give himself a disease from his own blood
if there's anything in there, then it's already infected him, no?
 
12:22 AM
Then again...
 
Maybe it needs to travel through his digestive system to activate.
 
The blood has exited the body.
 
Someone get working on a movie script.
 
lol
 
.... Maybe the stupid from my head could spread into my stomach. Then my stomach might be stupid. Oh god, what if it makes me not like cake?!
 
Ell
12:23 AM
Right. Will you guys give your opinion on something?
 
what, "Man drinks own blood, infected by unknown agent, becomes superhero"?
@ThePhD Fucking happened to me.
there's a fucking chocolate cake in the kitchen and I can't fucking eat it :(
 
But yeah, it's not just your own blood anymore.
 
@ThePhD If you tilt your head back during a nose bleed that can happen.
 
Ell
Let's say you have a friend. Said friend decides to not talk to you. You are not saddened by this. Does this mean they meant nothing to you?
 
@DeadMG Send it to me.
 
12:24 AM
@Ell No.
merely not sufficient that you maintain the need to keep speaking to them as much as previously
 
@Ell If they were a punkass bitch then whatever, dime a dozen. If they were the rock of your life, then it might be concerning.
 
How can friends decide not to talk to you? Are you talking about Facebook friends or something?
 
I love the way that's become a thing
there's "Friends" and then there's "Facebook friends"
 
@R.MartinhoFernandes Anger + stubbornness?
 
a.k.a. "Not really friends at all"
 
Ell
12:25 AM
No, I mean literally not talk to you, ignore you, never approach you, avoid you etc.
 
I think that goes beyond not talking to you.
 
@R.MartinhoFernandes No, I want to eat it :(
 
That's like, animosity.
 
maybe I'll finally find another doctor tomorrow
 
I'm beginning to have your problem now.
Or something similar to it, kind of annoying. It goes away if I lay down though
 
12:27 AM
What problem?
 
Stomach pains during indulgence of food.
 
pffft
the pain is really the least of my worries
 
The puppy is an expert.
 
if you had what I had, it would not be pain you would be complaining about
 
What is your biggest worry?
 
12:28 AM
also, indulgence is immaterial
I can indulge all I like in some very bad things (e.g. some brands of chocolate)
 
Oh, good old "my disease is bigger than yours".
 
@Rapptz Definitely the nausea and incessant belching.
@R.MartinhoFernandes It's like dick-waving, but the inverse (?)
 
@R.MartinhoFernandes Uphill both ways!
 
I can't copy a std::list of unique_ptr into another list of the same?
 
Yeah I get that too. That actually bugs me a lot more than it should because I have emetophobia.
 
12:29 AM
I remember reading about Chernobyl emergency workers, and they're all dying of horrific exposure, and they're having a "How much of a radiation overdose did you get?"
I guess that dick-waving is just human nature
@Rapptz The pain is definitely worse, but it tends to last for less time, and occurs a lot less frequently.
most of the time it's just nausea and belching
 
I hope you can burp. I'm like, unable to.
 
@ThePhD Uh, unique_ptr is non-copyable. How could the list possibly copy?
@Rapptz I do all the time. There's more coming up than there is going into my lungs.
back when I first had it, I was literally struggling to breathe
 
@DeadMG Ah. So I have to do this with raw Pointers, then, or maybe some other kind of special ptr type?
 
@ThePhD shared_ptr, or just move the list- or just make one of the lists not own their contents.
 
Don't recommend std::shared_ptr!
You don't know what are the intended semantics.
 
12:31 AM
@LucDanton If you need shared ownership, you need shared_ptr.
@LucDanton Hence why I offered two alternatives.
 
I don't really need shared ownership, unique_ptr does what I want it to do in terms of ownership, but I want to take that list, put it all in another temporary list, then clear the original list. Ownership should only happen once, which is why I went with unique_ptr in the first place.
 
Oh well I don't care.
 
@ThePhD Then move the list into the temporary list. That will effectively clear it anyway.
 
@DeadMG ... Oh. Uh. Okay. operator= doesn't do it, so this is a job for std::move ?
 
indeed it is
templist = std::move(srclist);
 
12:34 AM
You have a serious case of the XYs. I hope it's not lethal.
 
Look at me bein' all standard-library savvy!
 
Ell
I'm glad I don't have any conditions :D
 
@Ell I've learned to live with my Hepatitis.
 
Ell
Seriously? O.o
 
Pff no, if I got sick like that I'd just kill myself. =l
 
Ell
12:36 AM
:o
 
Then again, I can only say that because I'm healthy (not really).
 
Ell
The only problem I have is a ridiculously acne ridden face
 
Hm. So I think this is a perfectly thread-safe, efficient dispatcher, that doesn't block while it's doing work.
Dispatch, go! (ideone.com/o42oE2)
 
looks
not exception safe
thislock.lock();
work.push_back( TDispatch( new Dispatch0<R>( f ) ) );
thislock.unlock();
what if that throws?
deadlock city x)
 
@ThePhD std::lock_guard dude.
 
Ell
12:41 AM
Yeah
 
What's lock_guard's job? Prevent exception explosions or something?
 
has been writing low level locking semantics for a project >.> Fun stuff.
 
Ell
Unlocks on destructor
Locks on constructor, so unlocks on stack unwinding
 
The only safe function there is Do.
 
12:43 AM
Um. Okay. Do I pass a std::mutex or a std::lock into a std::lock_guard, and then just let it do its magic?
 
An std::lock_guard is a kind of lock, so yes you pass in a mutex.
 
And that is only because no exceptions are thrown inside the lock. (Assuming the functions called don't throw... their names indicate they should not)
 
std::move and clear() should never throw. If anyone invented a library where those threw I would throw HissyFitException()
 
Careful here. std::move doesn't do much of anything.
 
@ThePhD right, which is why I said Do looks ok. The rest of it, no; unless you disable exceptions.
 
12:45 AM
@ThePhD Dear lord, owch.
 
@LucDanton yea, I was going to say something about that, but the locking issues are way more serious.
 
firstly, why the ugly as fuck typedefs?
secondly, why a linked list? you want your performance to die for fun?
 
You want move constructors to be noexcept most of the time -- that is something a lot of people agree on, and a lot of types will fulfil that. However using std::move will not guarantee that a move constructor is used.
 
@DeadMG who cares on typedefs, that is style. atm this is prone to deadlock city.
Make it correct, then make it fast.
 
thirdly, holy shit, your idea of "thread safe" is "Murder my performance by locking every time anything happens, ever."
fourthly, "Exceptions", ever heard of them?
 
12:47 AM
@DeadMG Not really, I never bothered with exceptions until C#.
 
also @DeadMG sometimes locks are ok, they are not always bad depending on how often they are contended.
 
also
 
@ThePhD It's okay, C++ code with good exception guarantees doesn't have to look bad.
 
I like your completely redundant Do() method
 
@ThePhD fix the locking semantics first so it is correct, than worry about the rest of @DeadMG's issues.
 
12:48 AM
@LucDanton In the case of std::list, though, it will use a move, right?
 
@ThePhD In your case, yes.
Not in the general case.
 
That think looks suspiciously like an event queue.
 
@LucDanton I'm not all that sure what you are doing with the std::move stuff there. I just can tell you that the lock/unlock pair there is at least correct. That is there are no deadlock/race issues there.
 
@R.MartinhoFernandes That's the idea, but a little more generic.
 
Which, btw, is a problem that has been solved countless times before.
 
12:50 AM
@R.MartinhoFernandes I think he is just learning, which is fair enough
 
Also... std::function arguments on template functions?
Just say "no".
 
@R.MartinhoFernandes Is there another way I'm supposed to do it?
 
Have you tried foo.Add([]{ return 0; })?
Try it. Tell me if it is working.
 
For now I think you should just use template<typename Functor> void Add(Functor functor);. Have you tested your additional Add overloads that take more than one arguments? I can't imagine that they work.
 
Also, @Luc, you are an even slower writer than I am :P
 
12:53 AM
also
what the fuck is DispatchBase and all the rest of it?
did you reinvent std::function but substantially shittier?
 
I'm assuming your DispatchBase duplicates the functionality of std::function, the latter of which you still use.
@R.MartinhoFernandes Oh I've written it alright. I haven't published it though.
 
@DeadMG He reinvented std::bind, IIRC.
Cue "std::bind but some difference which is either not a difference, or a downgrade".
 
@DeadMG I think this has something to do with the callback stuff he was talking about earlier this week.
 
@LucDanton No observable difference :P
 
@DeadMG DispatchBase is a abstract base class with one call: Invoke (and soon I think I'll add a BeginInvoke for launching work from a Dispatcher onto another thread or into a ThreadPool). Anything that derives from DispatchBase just has to do whatever it needs to do in Invoke() .
 
12:55 AM
so basically it's std::function<void()> but shittier
 
Sounds like Java.
 
In the general case, it's just executing a std::function with the desired arguments.
 
But again, seriously. Fix the parallel stuff, the code is not even correct or well defined until you do so.
 
@nixeagle You're a million years too slow. I already changed it to use lock guards and have Invoke() tried and catched.
Is there anything else?
 
Okay, stop right now.
You need to learn about exceptions.
I don't think you should write try/catch.
 
12:56 AM
@ThePhD dunno until you publish your updates.
 
What iterator can I use with a vector to call a custom printout function?
 
@Moshe Why would you use an iterator for such a purpose?
 
@LucDanton Okay. How else do I exception-safety the individual Invoke calls?
 
@DeadMG Iterators are cool. I liked using the other one before. I could use a loop, I suppose...
 
@Moshe Or std::for_each
 
Ell
12:58 AM
Ostream_iterator?
 
@ThePhD At first glance the particular bit of code already provides the basic exception safety guarantee.
 
@DeadMG Ooh, sweet.
 
If you want to improve that you need to specify what particular behaviour you want.
 
@LucDanton It's a work queue. For example, my FileSystemWatcher has a separate thread blocking on an API call, waiting for changes to happen to a file system (it's NOT FindFirstChange*); I need to be able to send notifications that the file system has changed back to the user of the FileSystemWatcher for my game, on the main thread. The reason is, when I load a new resource or respond to a FileSystemWatcher event that indicates a file change, I don't want to start kicking the resource when I know
 
I meant in the case of an exception. Not when it works.
 
1:01 AM
Desired behaviour in case of an exception? I want it to work.
 
that it might be in use. So, I decided to have something on the main thread that owns all these resources to have a DIspatcher - a variable-work queue that will dispatch work related to what's supposed to run on it. A message queue, a job queue, whatever you want to call it.
 
We all know what you want to do btw.
 
Oh well okay then.
In the case of an exception, I'll probably just throw another exception or just rethrow the same exception. No point drowning it out in the work loop.
 
@ThePhD then you don't need to catch it.
 
What do you want to happen for the remaining work to process?
 
1:04 AM
Just let it propagate up to whoever can handle it properly.
 
@LucDanton It's meant to mimic a regular application in its while loop. If it explodes, then the application explodes. I have no expectations for the rest of the work.
 
It will explode the thread calling Add, not the one running the loop.
 
Technically exceptions are not for exploding. Things like std::abort are.
 
@R.MartinhoFernandes Add... has no exceptions that can be thrown in it?
Unless std::function throws in its constructor?
 
@LucDanton I don't think the manager thingie can really do much else as it really has no clue what kinds of exceptions can come out of the Invoke call. I guess if anything else, it can look for out of memory errors and attempt to free some memory.
Not that modern operating systems ever throw std::bad_alloc, they tend to overcommit instead.
 
1:08 AM
@nixeagle It can process the outstanding work.
 
@LucDanton true, but that assumes that none of the outstanding work is going to depend on the halted thread. x)
 
@ThePhD The copy constructor of std::function runs arbitrary user-provided code. How can it not throw?
 
You prettymuch are FOOBAR at this level, you really don't have the knowledge to handle errors.
 
Bad title of the day:
0
Q: What does am i being asked to do?

theolcI have an assignment to do and part of it does not make sense to me. Can anyone help me understand exactly what is required? This is what i was asked to do... Recursion Problem2: Adapt the triangular spiral program done in class to make a more usual spiral made up of straight line segments. H...

 
btw, on linux, if you adjust the memory allocation policy to not overcommit, you can get it. But that is no way default.
And @Mysticial whoo! I opened it before it gets deleted.
 
1:10 AM
@nixeagle It's not necessarily bad_alloc. The copy constructor of std::function runs arbitrary user-provided code. How can it not throw?
 
@nixeagle While the former design assumes that the already processed work doesn't require the outstanding work to be performed.
 
@R.MartinhoFernandes I wasn't aware the std::function runs anything other than what was necessary to store and preserve the call that its supposed to be making.
 
@R.MartinhoFernandes yea, well I was specifically mentioning std::bad_alloc in my example of something you could handle specifically (instead of catch (...) { ... }.
Then I realized that most environments won't actually give you a chance to free up RAM. x)
 
^ my work for the following month
 
@sehe Funny how most of it is in German, but then there's this giant "RECURSION" slapped in
 
1:13 AM
A lot of manual dependency tracking in PLSQL (long live Vim+ctags)
 
@sehe, needs some translation x)
 
@ThePhD And the code necessary to store is controlled by what?
 
@DeadMG Dutch
@nixeagle Nope
 
struct foo { foo(foo const&) { my_arbitrary_code(); } void operator()() {} };
 
@sehe Close enough.
 
1:14 AM
@DeadMG Can't be German. Not enough capitals.
 
@ThePhD The core of your functionality condensed. Basic exception safety guarantee inside operator() (with outstanding work being discarded) for free.
 
This is following my apparent success at translating 27k LoC PL/SQL -> 2.7k LoC C# the other time; The code has seen vast performance improvements and doesn't require scarce PL/SQL expertise* (*_expertise_ being a slightly funny choice of word for the codebase)
 
@ThePhD you also need to learn your perfect forwarding.
While the code has calls to std::forward, it doesn't forward anything correctly, it just copies.
 
I require more sleep
 
Alright, I'll just rewrite the whole thing from the ground up then.
std::function<void()>, anything else I missed?
 
1:16 AM
@R.MartinhoFernandes lols, I did not observe this, was not paying sufficient attention
 
I forgot to mention that I left encapsulation out.
 
@nixeagle You should see the 'functional specs'... 121 pages of hairy mess. Sadly don't have it (digitally) now, so I can't quote for proper fear-instillment
 
@sehe lol, all I see is lots of uml in a language I can't read. :P
 
@nixeagle UML? It's a phreaking dot graph...
 
blah :P
kinda sorta uml
 
1:17 AM
This is my personal tool to get 'some' overview of the major components. Now at least I know what was dead code (it's not in the picture) and what the complex blocks are
You know, I'm going to need to slap a number of hours on it somewhere monday/tuesday
 
what are the black bits for?
*bit
 
I wonder why Feeds has not noticed my new blog post yet. It is usually fast catching up.
 
@nixeagle the grey boxes are actual public services (callable from external software components on the self-proclaimed service-bus - kinda sorta).
The black box is a Business Rule. Meaning: a very very well hidden call to an internal function right from a database trigger. All that is leaning on Oracle TAPI/CAPI with Headstart (which is rather arcane, from where I'm sitting)
 
ah, so the black box is like black magic. x)
also tbh, that kinda looks like fun, in an odd way.
 
@nixeagle Yeah I wanted it to stand out. This part is going to hurt :)
@nixeagle It is fun. It is also mighty complicated. The fun is in deleting all the code :)
Making all that complexity evaporate whilst proving that the new implementation still does all the same things
 
1:26 AM
x)
Still in school, so I don't have a "job" yet :P
Lots of math stuff though x)
 
Note als the RED box (FH2050) which is a function, that is actually dynamically 'engaged' but doesn't exist in the database - I wonder when it will get hit :) That's a guaranteed production problem report waiting to happen
 
ah, you know I kinda thought those were objects or namespaces. Hence why I was thinking a bastard form of uml.
Does not help that I can't read the language :P
 
@nixeagle They're mostly functions. Some are packages. Everything depicted is Oracle code from ~2005 (currently, not for long)
 
Wait, so are you at oracle or are you doing inhouse dev/consulting for a company with oracle licenses.
 
@nixeagle The latter
 
1:34 AM
@R.MartinhoFernandes I decided to remove some of the more useless feeds...
 
@JerryCoffin You did not remove mine.
 
@R.MartinhoFernandes Actually, I didn't remove any, but as the old saying goes, "made you look!" :-)
 
I had looked when I wondered before.
Nice try.
 
@R.MartinhoFernandes Oh, now I'm disappointed. I think I'll go away to cry for a while.
 
@JerryCoffin Sick
 
1:43 AM
@LucDanton I'm trying to flatten calls with variable arguments using std::bind, but as far as I can see when reading the docs and some examples, std::bind tells you to use placeholders and then supply the real arguments when calling the actual std::function. Is there a way to have std::bind also wrap the arguments as well?
 
Is there an existing algorithm which will measure the % accuracy of one picture to another?
 
@Crowz % accuracy according to what.
 
Is it possible to lose a badge that requires a certain percentage of something, like Unsung Hero, for example?
 
@Crowz the accuracy?
@chris nope
 
@sehe Thank you. It's not easy, but I do try.
 
1:45 AM
Say I have two pics, a sketched outline (scanned from paper) and a picture. I then run an edge detector on both
 
@sehe, Thanks, I wasn't sure if you had to maintain the ratio or not.
 
I want to find the % accuracy of the sketch to the original picture
 
is it black and white?
 
@chris Once you have a badge, you keep it forever (short of something like deleting the account).
 
if so, just count overlapping areas and non-overlapping areas and go from there.
 
1:46 AM
@nixeagle After the edge detector runs through, yes
 
@ThePhD Try something like std::bind(foo, bar, baz) where foo(bar, baz) is a valid call.
 
example output from edge detector: i.imgur.com/zM52A.jpg
 
100% accurate implies that both copies have exactly the same overlapping areas.
 
@Crowz looks familiar
 
@sehe I wrote this program hah
 
1:47 AM
@sehe I'm pretty sure I read somewhere that they figure Lena's been compressed with more different algorithms than any other picture in history.
 
hmm... it looks like Visual Studio 2012 turns on SSE2 by default.
 
I did a pic of boxxy on my other edge detector: i.imgur.com/wV9vG.jpg
 
Everyone uses Lena.
 
And she likes it
 
@Crowz That's not Lena.
 
1:49 AM
yesterday, by R. Martinho Fernandes
@Mysticial You are very perceptive.
 
My edge detectors are terrible :(
 
@Mysticial Hence why he said "I did a pic of boxxy" :P
 
@Mysticial I guess that's not a big surprise -- what was the last CPU that didn't have SSE 2?
 
@Crowz for color1(mapped from <0,0> to <n,m>) and color2(mapped from <0,0> to <n,m> ) in both images { if (color1 == color2) {match++} else {nomatch++} } total = match + nomatch; accuracy = match/total.
 
@JerryCoffin yeah, I was wondering why my pure x86 binary was faster than expected.
Guess that explains it.
 
1:51 AM
@nixeagle Ah clever maan. I should also adjust it to compensate for the fact that they'll never be THE SAME... also I need to adjust the images to the same size beforehand
 
@Mysticial Probably at least part of it, anyway. OTOH, even for integer-only code, I've seen some fairly decent improvements over VS 2008.
 
simplistic accuracy algorithm, of course if you want some "fudge room" for "human error", it'll get way more complex.
@Crowz well yea, this is not exactly trivial. But you did say the same, so I took the leeway in your specification and ran with it :D
Blasted users changing their requirements all the time. x)
 
@nixeagle The thing that'll be annoying is resizing them correctly... I imagine a huge number of errors coming from that
 
@Crowz oh yea, you really do need some sort of fuzzy matching here.
 
@nixeagle I mean like, what if a pic is 30cm x 30cm and the other pic is 30cm x 40 cm?
 
1:54 AM
some idea of "if it is close enough"... for example say you use black to mean the "line", as long as there is black within say... 3 or 4 pixels of the black in the human drawn image, put it in the "match" bin.
 
@Crowz You might want to look at something like the SIFT algorithm. Not sure how it'll do on sketch vs. picture, but it's frequently used for things like computer vision and finding overlapping areas when creating stitched panoramas.
 
@JerryCoffin ooooo I like this!
 
Two warnings though: there's a patent on it, and it's not really simple.
 
Oh nevermind then
 
@JerryCoffin that would let him stretch the image to the required size. Still needs a decent comparison function.
@Crowz you basically have to do a pass to change the image into the correct size for comparing, then have an algorithm similar to the "simple" one I put above. But the algorithm for comparing probably ought to be "fuzzy", as in accepting "close enough" for some value of "close enough" as a match.
 
1:57 AM
@Crowz I should add, however, that the patent apparently only applies when/if you use it to stitch panoramas over something like 200 degrees.
 
@JerryCoffin ...
 
Reminds me of seem carving
 
So if you use it for 199 you are ok?
If it is not 200, but say x, if you use it for x-1 are you ok? x)
 

« first day (779 days earlier)      last day (4171 days later) »