« first day (1463 days earlier)      last day (3471 days later) » 

user1804599
12:00 AM
Too much relying on separate documentation rather than formal specification.
 
user1804599
Hell even PHP can do that to some extent.
 
separate as in not the official python docs?
 
user1804599
Separate as in not as code.
 
user1804599
But instead in docstrings or separate text files.
 
12:03 AM
docstrings are so useful though
 
user1804599
lol programming as a subject in elementary school
 
user1804599
such a terrible idea
 
user1804599
guaranteed failure
 
@rightføld you mean the year of code shit?
btw, is it over yet?
 
user1804599
@Sofffia No.
 
user1804599
12:10 AM
Moronic noob politician wants it.
 
body paint ... so essentially half naked
 
user1804599
Computer science would be more useful, but even then there are more important things.
 
user1804599
Like teaching children of immigrants Dutch (moronic parents don't talk Dutch to their children) and teaching the teachers elementary mathematics (they're terrible at it).
 
And cooking
FFS, teach kids how to cook
 
user1804599
 
user1804599
12:13 AM
Great song.
 
user1646075
@Sofffia Eiffel. Don't forget Eiffel.
 
I don't know Eiffel, so it's not part of the "languages I know" set.
 
user1646075
oh, youse guiz didn't...
 
user1646075
heh
 
user1804599
I want to learn Eiffel.
 
user1804599
12:18 AM
But all implementations are horribly outdated.
 
user1646075
of the traditionally compiled and structured languages, it's ... canonical
 
user1646075
YES - eiffel shits me that it wasn't open source from the get-go. A massively wasted opportunity, and relegates it to a 'see also' status
 
user1646075
The Comp. Sci in it is brilliant. Highly recommended to learn it
 
user1804599
> I find I must use abstract override once or twice a year or else that brain cell will die.
 
user1804599
lol dat reason
 
12:37 AM
aren't we all abstract in a metaphorical sense
 
Ell
Hi guise
LTer guise
 
user1646075
how did you recognise us? We're in dis guise
 
my website sucks
 
Ell
Mine too
 
1:15 AM
 
 
2 hours later…
2:52 AM
this is so wrong ...
 
You're right.
 
3:17 AM
@chmod711telkitty thats a fucking huge image =/
 
@MarkGarcia its not actually a problem, until you onebox it. big images tend to flicker/reload whenever i switch back to this tab, whereas smaller ones dont.
 
3:59 AM
I didn't realize how close I was to my grandfather until last night. It's been a hellish day.
 
Um, why is it hellish?
 
I mentioned about a month ago here that my grandfather fell, broke something and had to go under surgery. Well, he held on for a month - at times seemingly on his way to recovering enough to go home. But last night he passed.
 
Oh, I'm sorry. My condolences.
 
Didn't get any sleep - couldn't get my mind to rest. Today was all funeral service arrangements.
 
sorry 2 hear that ...
but I had tough year myself
 
4:06 AM
@Mysticial That's almost always how it is with people close to us.
 
We (the entire family) have been visiting him every day for the past 2 weeks. After we saw him yesterday and got home, we got that call saying he has gone. So we rushed back to see him lying flat and covered. Body still warm, face very relaxed. The only thing ere was that he wasn't breathing. First time I've seen someone dead.
 
I lost my grandma, she was very very close to me when I was young, then a friend who I knew for nearly 20 years was diagnosed with cancer, then I lost my dearest pet roosters
 
@Mysticial The thing is, you were close, and you both have experiences to tell.
 
He probably passed the moment we left. (as is often the case) And the nurses didn't realize it until they did the hourly checkup.
 
@Mysticial My condolences.
 
4:11 AM
@MarkGarcia We had dinner today with my grandmother. We always sit in the same seating pattern. And seeing my grandfather's seat empty hurts. A lot.
 
 
1 hour later…
@StackedCrooked I like how you pass a human to a shoe
 
 
1 hour later…
6:43 AM
@Rapptz In the end, how did you choose to deal with the mismatch between a runtime format string, and the variadic (known at compile-time) args?
 
I used a tuple and a visitor with SFINAE.
it kinda hurts compile-time performance.
but I have no other way of doing it
 
Ah, all (or most) of the formatting in the header then.
 
named parameter proposal
Did you see my format string btw?
 
I played around and I convert the arguments to arrays of erased, individual formatters + array of void const*. Then the implementation can be compiled separately.
The grammar? Yes.
 
I don't feel comfortable with that approach
how does it work with r-values or literals?
 
6:48 AM
Binding to const& doesn’t care.
 
I think I'll stick to the tuples.
my thing is header only anyway :s
 
Doesn’t seem like a feature for formatting :Þ
 
7:00 AM
might as well implement the new format spec
I find it decent
 
I’m aching all over. Trying to survive the morning. I would have showed you the PoC otherwise.
 
Well I have everything done essentially.
The only thing that needs changing is the parser code.
I'm not convinced I should allow non-positional variable width or precision specifiers
like e.g. |0:*.*|
 
|0:*1.*1| would be the syntax for 'positional' variable width/precision. :v
 
7:31 AM
I'm hungry.
 
7:46 AM
@rightføld Computer science is now a mandatory subject in the UK thanks to Simon Peyton Jones and others.
 
8:01 AM
@FredOverflow Oh fuck. That's 95% turned off and 5% poisoned.
 
Hello there! I'm building a balanced binary search tree (AVL) and I want to add an extra pointer on each node called "next" that would let me move to the next node from any random node as if I was traversing the tree in-order.
 
“Year of Code.” Fucking marvellous. I wonder if they will ever get around to the 'Year of Data". Since "Year of Debugging" will never happen, the bad questions from UK will get.. gahhhhh!
 
Something like B+trees and their leaf noded but for BST
is there a known technique for that?
 
Talking of bad questions...
 
@KarimAgha Wouldn't that make re-balancing quite hard?
Anyway, if all you're asking is if there is an established name for this technique, I have a simple answer for you: I don't know.
 
8:08 AM
FredOverflow, rebalancing (rotation) preserves the traversal order, so it wouldn't affect the actual next
 
@KarimAgha oh, right
Why do you think you need this pointer? Isn't traversing a binary tree in-order a solved problem?
 
@KarimAgha Look, I have a hangover. Google for 'Indexing a balanced binary tree'.
 
Martin Jameson? ;)
 
@FredOverflow, it is a solved problem. My problem is that this tree grows into thousands of nodes over time, and I have a common operation that is: "Find X and get me the next Y elements from there"
 
sounds reasonable
Are you having trouble implementing your idea?
Or are you just curious about the name?
 
8:18 AM
I know how to implement it, but I'm wondering if this is already a solved problem with a simpler implementation. One way of implementing it is just relying on BST's properties and knowing that the next element is the immediately larger node, and look for it (if you have right subtree then its the deepest leftmost node in the right subtree, etc..)
just researching
 
Is this your first time in the Lounge? This is an unusually interesting question. Most noobs just storm in here with a "gimme teh code" or "why does i++ + ++i not work?" attitude.
 
:)
Its not my first time.
"gimme the code - my search tree is not the way I want it to be!!"
 
@sehe Where do you teach student bodies? In the morgue?
@KarimAgha You misspelled "teh" ;)
 
my browser autocorrected it :(
 
You need to put 'teh' into the dictionary.
 
user1804599
8:29 AM
@FredOverflow better than programming.
 
user1804599
> The British Government just put America to shame by mandating a programming curriculum in all primary and secondary schools.
 
user1804599
ok fail
 
Mwaaarhhhhh! 'Nearly 60% of people think computer coding is an important skill for today's job market'. It's a useless skill if you cannot design the data well and cannot get the code to work after it's compiled. Cluless morons in power..
 
172
A: What is the best comment in source code you have ever encountered?

proudgeekdadOur DBA found this in the middle of a 3000 line stored procedure written by a third party. /* IF DOLPHINS ARE SO SMART, HOW COME THEY LIVE IN IGLOOS? */

lol
 
8:32 AM
@FredOverflow That's what SQL does to you:(
 
@MartinJames I think the argument in the UK is more like "We teach math and physics and chemistry to all pupils, even those that will never become mathematicians or physicists or chemists, because we think these subjects are important to know about. Why then not teach computer science, too?"
 
user1804599
@FredOverflow Also, teaching people how computers are not magic makes my work less cool!
 
@FredOverflow It's not the aim I have a problem with. It's the weapons.
 
user1804599
 
user1804599
Maybe run your code through gofmt first. And then explain what your exact problem is. And remove all the excessive full stops. — rightføld 1 min ago
 
user1804599
8:36 AM
What a moron.
 
@MartinJames What are the weapons? Incompetent teachers?
 
user1646075
@KarimAgha "Find X and get me the next Y elements from there" sounds like a search decent that morphs into an in-order walk. Can't see any need for indulging in a pointer and it's maintenance.
 
@rightføld Doesn't SICP portrait programmers as magicians and programs as spells?
 
@FredOverflow More like teachers led by incompetent ministers and civil servants.
 
user1804599
@FredOverflow They'll sure not teach Lisp! Thanks!
 
8:39 AM
@aclarke probably purrformance
@rightføld What do you think they will teach? If I had any weight in this argument, I would teach Karel ;)
 
user1804599
@FredOverflow C++! Should be doable when you have eight years!
 
user1646075
@FredOverflow but the recursion to get to X, along with referencing a counter primed with Y... maintenance will surely suck up any imaginary time savings.
 
user1646075
I'm almost tempted to write something
 
Also in the news: Compact Fusion
 
@aclarke, Sorry for not being clear. "Find X" and "give me the next Y elements from there" are two separate operations that do not share the same working stack.
 
8:41 AM
@rightføld JavaScript, for sure:((
 
user1646075
B+ trees have their forwarding 'cos they pack many nodes on a page and then it's a nice lazy thing
 
user1804599
@MartinJames inb4 while (true) { } browser borked.
 
So the traversal would have to be restarted from the beginning in the second operations
*operation
 
user1646075
i think they can... my brain is waving nodes and pointers in the imaginary air and it feels like it should work
 
@rightføld while (1) { post the crap on SO}
 
user1804599
8:43 AM
Cannot post on Stack Overflow until you're 13.
 
@rightføld I could not drink alcohol until I was 18... oh wait! I lied!
 
@aclarke: op1: Finds X, that happens to be at offset 7000 from the beginning of the collection and returns "7000", op2 (in a different process, shares storage): takes 7000 and returns elements between 7000 - 9000.
 
user1646075
Have you made an SO question about it?
 
not yet, I'll ask a question if I won't find anything interesting.
 
user1646075
hang on, at offset 700? I thought you said an aVL tree. Descend recursively, find X and let the unwind indulge in a tree walk as it decrements a counter.
 
user1646075
8:46 AM
if different processes - hmmmmmm
 
offset 700 in the sorted collection.
 
@KarimAgha How about you simply convert your tree into a sorted list then? ;)
 
it doesn't have to be actually 700, but if you had 1000 elements, all ordered according to some comparison function, then X would be the 700th element
 
user1646075
sure
 
@FredOverflow, nope. I'll loose some key performance characteristics.
 
user1646075
8:49 AM
well, maintaining an in-order linked list would be simple enough. The inserter, hunting for which node to hang it off, needs to record the previous node so it can insert the new one using a boring single-link-list insert. Sounds simple in principle. Don't make me cut code, I'm bludging and watching my kid kill aliens on the PS
 
@KarimAgha that must be one of the worst questions on SO.
 
@rubenvb why?
 
53
A: What is the best comment in source code you have ever encountered?

Mike Two// human madable inconvenient. Way too sucks. I still don't fully understand what it means, but I have found it to be very true about a lot of code.

 
user1646075
looks like you've got a handful of answers, and I can't see why you'd split the work across threads. You look only for a single node, and then only after that you realise you need the next 200? doesn't make sense. Parent ref would at least allow entry into any part of the tree and then start walking
 
8:52 AM
@KarimAgha ah, every answer will depend on implementation details. Plus, it's a question for wikipedia
 
user1646075
oh - that's someone elses quetsion. Still...
 
@ac
@aclarke here's a practical example: AVL trees maintain a sorted order of a collection. If you want to find the first number that is > 20 in one process (e.g. returned 21) and another process wants to get the next 50 numbers (e.g. 21, 27, 29, 42, 51, ...)
you have to split your work across threads.
if you want the next 50 to maintain the same logical order
+ have log(n) insertions that maintain the order
 
user1646075
well, I can't see that maintaining an in-order list would be difficult. I'd be inclined to start with a doubly-linked list to ease that process, and then see how easy it is to degenerate it to a single-linked list. Also if you ever want to look backwards, the double list gives you the win straight away.
 
user1646075
I hope you're not storing integers with the aid of 3 or 4 ptrs per node + the balance number
 
My nodes are ~1-12MB ;-)
... in the worst case. avg is about 0.5KB
 
user1646075
9:07 AM
then a few more pointers sounds very affordable.
 
I wish STL had permitted versions of its containers
like a persisted std::set would be awesome
*persisted
 
user1804599
Recommending tools/libraries is off-topic, sorry — Marco A. 46 mins ago
 
user1804599
Why sorry? OP is the one who's wrong.
 
user1646075
@rightføld sometimes a sorry is just to soften a 'fuck-off'
 
user1646075
"sorry (you're about to be unhappy you baby)"
 
user1804599
9:11 AM
One of the mistakes you are making is posting unformatted code in a question. — rightføld just now
 
Scala requires a shotgun loaded with @
 
@rightføld that's not very nice, is it?
 
user1804599
Indeed.
 
user1804599
Formatted code is much nicer.
 
iTunes icon is red now. That's damn confusing.
 
user1804599
9:20 AM
I only have six icons in my Dock so I don't care.
 
same
but it's red
 
user1804599
I don't know what to do.
 
user1804599
Boring weekends are so terrible.
 
I'm amazed that Apple doesn't seem to care about blocking the GUI thread.
 
user1804599
What do you mean?
 
9:25 AM
If I click all my iTunes albums and right-click the "Get Album Artwork" action then the gui is blocked for a while.
It seems to be that this could be done async easily.
Also I you use Preview.app to open a large collection of photos then it keeps eating memory until it crashes. (Maybe this is fixed by now.)
 
user1804599
I've never done those things.
 
@rightføld Have you tried node.js?
 
user1804599
Yes. It's shit.
 
Really?
 
user1804599
Async I/O is explicit, so it's not worth it.
 
9:28 AM
I think @jalf also toyed with it for a while.
@rightføld You mean it's not as good as await?
 
user1804599
The only thing Node.js got right is the package manager, and Node.js seems to be the only one to get it right.
 
user1804599
@StackedCrooked await is the same shit.
 
Callbacks are probably the next, or third, best thing.
 
user1804599
You can do await with Node.js if you use Traceur.
 
So what's a good approach then?
 
user1804599
9:30 AM
What Erlang, Go and GHC do.
 
Queues?
 
user1804599
You can spawn many threads and do blocking I/O on them without context switches and without consuming huge amounts of memory.
 
user1804599
Kinda like Boost.ASIO with stackful Boost.Coroutine.
 
Dunno what node.js does in that regard.
 
user1804599
Callbacks, which are isomorphic to promises/futures.
 
9:31 AM
But I read it's super fast because YOU DON'T BLOCK (sic).
Damnit, now I have to Google isomorphic.
 
user1804599
@StackedCrooked You can implement them in terms of each other.
 
user1804599
Traceur has async/await based on Promise.
 
Currently C++ futures are inherently blocking (their only methods are .get() and .wait()). And callbacks don't require blocking.
 
user1804599
But given I/O is about the only thing you can do with Node.js (doing expensive calculations blocks all I/O since there's only one thread) you'd expect it to be unobtrusive, and it isn't.
 
I've never done a calculation so expensive that it blocks the GUI.
It's always IO that is the culprit.
 
user1804599
9:35 AM
It's especially terrible when doing abstract interfaces, because now your stringstream needs a promise-based API.
 
Does it?
Haven't looked at it in depth.
 
user1804599
Yes, because otherwise you don't have the same interface as an fstream, because that one definitely needs async I/O or it will block everything.
 
user1804599
// This is the ideal way of doing async I/O (example is in pseudo-Go):
listenSocket := net.Listen("tcp", ":8080")
while true {
    client := listenSocket.Accept() // this blocks this coroutine!
    spawn(func() {
        request := client.Read(1024) // this blocks this coroutine!
        client.Write(request) // this blocks this coroutine!
    })
}
 
"this blocks the coroutine" means that it triggers change of stack pointer? or you mean that it actually blocks.
 
user1804599
// This is how you'd do it in Node.js:
net.listen("tcp", ":8080", function(err, listenSocket) { // ahah exceptions don't work suckers
    listenSocket.on('connection', function(err, client) {
        var buffer = new Buffer();
        client.on('data', function(err, data) {
            buffer.append(data);
            if (buffer.size >= 1024) {
                var readBuffer = buffer.slice(0, 1024);
                buffer = buffer.slice(1024);
                client.write(readBuffer, function(err) { … });
 
user1804599
9:43 AM
@StackedCrooked Yes it unschedules the current coroutine.
 
user1804599
And coroutines are cheap. You can spawn as many as you want without using much memory.
 
user1804599
Difference with pthreads is that they don't require system calls for scheduling and creation, and they have very little memory overhead.
 
user1804599
There is a way you can transform the former (spawn and seemingly blocking) into the latter (callbacks) by defining a calling convention that uses CPS for all function calls except for the call to spawn. But V8 will laugh at you since it lacks tail-call optimisation so you're screwed hahahahaha!
 
user1646075
Awesome. This will impress the PHP fans in the room: websnark.com/archives/2004/12/when_did_we_bec_3.html Love how PHP shows your dirty laundry for all to see.
 
user1804599
mysql_real_escape_string is also deprecated.
 
user1804599
9:48 AM
That website uses an old PHP version!
 
user1646075
@rightføld ... and tells everyone except maybe the people who should be informed...
 
user1804599
> Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries
 
Ell
Apple always writes their own libraries
 
user1804599
@StackedCrooked lolcool
 
@rightføld I don't blame them :-o
 
I bought my iMac less than a year ago and now they come with this.
 
Ell
I wrote an async stream source
With boost.coroutine
Which returned control to the caller when blocking occurred
 
user1804599
10:07 AM
Nooo.
 
user1804599
Return control to the caller when the operation is done.
 
Ell
@stacked always check macrumors before buying apple stuff :P
@rightfold but then it blocks!
 
user1804599
So?
 
user1804599
Conceptual blocking is what I want.
 
Ell
That defeats the point of asynchronous doesn't it?
 
user1804599
10:08 AM
Whether it blocks a thread or not is an implementation detail.
 
@Ell depends on whether other actors can progress in the meantime
 
Fucking iostreams
 
Not a good hobby
 
Ell
@sehe they could in this case. But yeah I guess its pointless if everything else will just block
Or keep returning
 
user1804599
Blocking API ≠ blocking threads.
 
10:09 AM
It's pointless to make it return early, if all the caller does is /wait/ until it does return results
 
Ell
Can coroutines be implemented portably in c++? Iirc boost uses a little bit of assembly
 
user1804599
No.
 
Ell
@sehe yeah
 
user1804599
Only weak attempts at coroutines can be implemented portably in C++.
 
user1804599
E.g. Boost.Coroutine's yield macro.
 
10:11 AM
Which is still plenty cool
 
user1804599
For proper coroutines you need to be able to load and store registers.
 
And switch stacks
 
user1804599
Or VM state, but no sane C++ implementation runs code in a VM.
 
user1804599
@sehe arguably that's loading a register. :P
 
Ell
I wonder if you could write CPS transform in templates
Doesn't really make sense does it
You'd need macros
 
user1804599
10:13 AM
You can't.
 
Ell
Actually you wouldn't need macros
 
user1804599
You cannot write a template t such that { a(); t(); b(); } is transformed into { a(); f([] { b(); }); }.
 
user1804599
Maybe you can overload some operator in a clever way, but I doubt it since C++ has no call-by-name.
 
Ell
Yeah
 
Ell
10:28 AM
@rightfold what do you mean about a blocking api? And implementation details
 
user1804599
I want to be able to write { …; io_operation(); /* now I am sure I/O operation has finished */ … }.
 
@FredOverflow that was the joke, yes
 
user1804599
That's the API.
 
user1804599
How it does scheduling and stuff is not my business, I just assume it does it well.
 
@Ell I think he means that in your program flow, individual steps depend on the result of the preceding steps. So, you can have non-blocking API all you want, but the subsequent step still depends on the result. Whether you use a non-blocking or a blocking API implementing this is the implementation detail
 
user1804599
10:32 AM
If you have promise-based APIs it becomes very hard to abstract them. I/O streams is one example.
 
Ell
@rightfold ah I see
If you want to process data as you receive it though
 
Where's the promise in iostreams?
 
Ell
Then you don't want to wait for it to finish
 
user1804599
ByteArrayStream would have to use promises to have the same API as FileStream if the latter used async I/O.
 
user1804599
And ByteArrayStream using promises is just silly.
 
10:33 AM
@Ell Yes. You just changed the definition of "it"
@rightføld Ok. Who was suggesting promises again?
 
user1804599
Promises, callbacks, w/e all the same shit.
 
Ell
@sehe did I? I meant you don't want to wait for the io operation to finish
 
user1804599
Of course you do.
 
user1804599
How else are you going to use its result?
 
user1804599
Async I/O is an optimisation and I don't want it to influence any APIs.
 
user1804599
10:38 AM
That's why stackful coroutines are great.
 
Ell
@rightfold I suppose seeing it as an optimization makes sense
 
The work "callback" originated in telephony where a request was sent followed by hangup. the reply would be delivered by "calling back" to the sender.
At least that's what I heard.
Maybe I should use that trick.
Just give my threads a phone number.
And I can call them from everywhere :D
 
user1804599
static_cast<std::thread::native_handle>(phone_number);
 
hello this is thread
 
threat
 
10:50 AM
throat
 
user1804599
HELO
 
user1804599
erlc +debug_info -o./ sudoku.erl
erlc +debug_info -o./ sudoku_board.erl
erlc +debug_info -o./ sudoku_game.erl
erlc +debug_info -o./ sudoku_gui.erl
 
user1804599
why erlang installer why
 
Slightly relevant:
The goal of your code is pretty unclear. I've pieced together a SSCCE that shows the deadlock in reader thread waiting for toDeblur to become null again: coliru.stacked-crooked.com/a/cc3a0ca399b8ecaasehe 13 secs ago
 
Not that deblur thing again..
 
user1804599
10:51 AM
I have never encountered a deadlock.
 
Ell
Nor I
I've never written code executing in parallel though
 
Several years ago I made my first attempts at writing a task queue with locks and condition variables. I struggled a lot with this before I got it right.
 
user1804599
The only locks and condition variables I use are those in the implementations of super high level abstractions provided by libraries.
 
Thready libs without a built-in producer-consumer queue class are not worthy of the name.
 

« first day (1463 days earlier)      last day (3471 days later) »