« first day (2550 days earlier)      last day (673 days later) » 

8:51 AM
Ugh, the new styling for vote buttons is ugly
 
Isn't that how it used to be a while ago?
It reminds me of geobits' avatar
ok not quite the same
 
9:48 AM
@AndrasDeak--СлаваУкраїні hahaha I would alctually really enjoy having one!
but also, my longest ever job contract was my PhD, so I can't really get one, because they will outlive me
 
 
8 hours later…
6:18 PM
@flawr Ah, it's true. Similar, yes
We'll all probably get used to the new one in a few weeks anyway
 
6:52 PM
company can't be arsed to tackle the actual, substantial problems with the platform, so they keep doing pointless bikeshed work to pretend they are engaged
 
 
1 hour later…
8:09 PM
Reading a paper about how to balance this particular form of binary tree, and everything is explained in terms of Haskell code...
https://yoichihirai.com/bst.pdf
I know the very basics of Haskell, but that's not enough to decipher this paper. Might as well have picked brainfuck...
 
@CrisLuengo Finally some people with common sense:P
@CrisLuengo Let me know if I can help in any way!
 
@flawr Wanna read the paper and translate it to a meaningful language for me? :D
 
You said something about brainfuck didn't you? :)
No but seriously, I'd be happy to do that if it's not for the whole paper! - I think there are just a few things you really need to know to understand everything in there. If you're stuck at a specific snippet I could try to break it down and you could see if it helps or not:)
I guess the types and signatures might be a source of confusion?
But don't feel like you have to, I'm just excited to see Haskell, and I'd be happy to if I could pay back even a little bit of all the help you've given me
 
I want to say "you're glad finally someone actually writes Haskell" but then I realised it's a math paper
 
hehe
well Haskell's usefulness is inherent, we don't need any practical examples to prove it:P
 
8:22 PM
@flawr I'm hoping that I can recreate the algorithms from the graphs and the English text. So far I think I grasp everything without reading the code.
 
@CrisLuengo sounds like a second-grade math paper
 
But thank you for offering!
@AndrasDeak--СлаваУкраїні It's obviously written by a computer scientist, not a mathematician. There's no lemmas and no proofs. There are actually no equations. And it's readable.
 
@CrisLuengo But they did mention having used Coq
 
I mean, they treat "\Delta >= 2" as a numbered equation...
 
hehe, not bad
It's been so long since I've seen a lemma. I don't miss them at all.
 
8:25 PM
Holy crap! The patterns in the bar plots...
 
Check page 305...
 
nevermind, you've linked it
PAGE WHAT?
 
I need an aspirin now. That hurts!!!
 
Oh, journal numbering. Phew.
 
8:26 PM
LOL
 
@CrisLuengo nooo no no no
 
But the patterns are so pretty!
 
although to be fair it's equally illegible to the colourblind, so...
 
The bars even have error-whiskers if you look closely
 
8:28 PM
at least some do
 
perhaps it's just some fondue on your screen
 
Indeed, the one on page 303 does have whiskers.
 
Oh, and the first one on 305 too! Didn't notice them at first, they're tiny.
 
maybe Cris likes fondue too, you know as a stress snack in front of the computer
 
8:29 PM
I'll have cheese in any form, including molten.
 
ah, I missed the whole first figure on page 305
 
But I do prefer well cured cheeses to the younger ones, usually.
 
forget the patterns, look at the xticklabels
inc 10^5
I bet those aren't XORs
@CrisLuengo cured from the illness of being palatable
>>> 10^5
15
 
@AndrasDeak--СлаваУкраїні "I couldn't get the graphing software to do proper exponentiation."
 
although between you, flawr and Ray here I'm in a very bad cheese minority
 
8:31 PM
@AndrasDeak--СлаваУкраїні Hey! This is the MATLAB chat room! 10^5=10000!
 
@CrisLuengo well to be fair it was published in... uh... 2011
 
@AndrasDeak--СлаваУкраїні What? Maybe you have a zero too many? Maybe it was the year 211?
 
everyone knows if you subtract zero you get the same number
 
9:06 PM
Fun fact: Haskell has three exponentiation operators by default
Prelude> 10^5
100000
Prelude> 10^^5
100000.0
Prelude> 10**5
100000.0
 
(answering anyway: depending on whether you have an Integral, Fractional or Floating point exponent)
(^) :: (Integral b, Num a) => a -> b -> a
(^^) :: (Fractional a, Integral b) => a -> b -> a
(**) :: Floating a => a -> a -> a
 
@AndrasDeak--СлаваУкраїні Wow. And some teacher picked that book for their students...
BTW: I totally nailed that binary tree balancing algorithm. Got it right the first time! And it speeds up my code so much! I'm a happy boy today!
 
Also, the name of the journal (it just says "JFP" in the PDF) turns out to be "Journal of Functional Programming". That explains the Haskell code in it.
 
hehe
it was probably added in during review
 
Ha!
 
9:41 PM
"nice work but we'll need some haskell in there, kthxbye"
 
I wonder if the authors are pissed off that I implemented their method in C++.
 
as long as you used templated metaprogramming...
 
@CrisLuengo nice!
 
Not a whole lot of meta programming, but it certainly is a template, because I need to process images of any data type. It's only the value stored in the tree that uses a templated type, the rest is plain old imperative programming. Oh, the tree is a class, can't get around that one...
 
@CrisLuengo What are you actually using these trees for?
 
9:51 PM
I hope it's some quadtree or compression shenanigans
 
@flawr To speed up the median filter (and the percentile and rank filters, they’re all the same thing).
 
oh neat:)
 
There’s a fast algorithm for 8-bit images where you make a histogram of the pixel values within the window, as a quick way to find the median, and then as you move the window, you update the histogram (remove some pixels, add some pixels).
But that is not generic, it doesn’t work well for 16-bit images any more. So I’m using a binary tree to hold these values. Each node also holds the size of the subtree, which makes finding any percentile quick (log(n)).
So now this is fast for any data type, including floating-point.
 
I’ll have to steal that one.
 
10:00 PM
good job with the speedup, by the way
 
@CrisLuengo that's clever!
 
Not my idea, but haven’t it seen described with this particular tree before.
3
Q: Fast 7x7 2D Median Filter in C / C++

GiladI'm trying to convert the following code from matlab to c++ function data = process(data) data = medfilt2(data, [7 7], 'symmetric'); mask = fspecial('gaussian', [35 35], 12); data = imfilter(data, mask, 'replicate', 'same'); maximum = max(data(:)); data = 1 ./ ( data/maximum ...

The answer there uses a plain old binary search tree. Finding the median is n log(n) in the tree, same as sorting. So it doesn’t really help…
 
So when you have a kernel/structuring element and move it from one position to the next, there are the "front facing" pixels that get added, and the "rear facing" pixels that get removed, right? Does that mean you analyze the shape of the kernels first?
 
Yes!
 
neat
I've seen advent of code challenges where something similar was necessary in order to be able to do part 2.
 
10:03 PM
The kernel gets decomposed into lines along the direction where you move the kernel. For each line I just encode the offset (start point) and the length.
 
Is there some ratio of boundary pixels to interior pixels where you just build that tree from scratch?
 
@AndrasDeak--СлаваУкраїні advent of code is neat, but I get bored quickly because it’s a toy problem, not an actual problem whose solution will make something in my life better. :)
 
For instance I imagine if you have a checkerboard-pattern as a kernel
 
@CrisLuengo clearly we have different motivators :)
 
@flawr ouch.
I usually deal with compact kernels.
 
10:04 PM
@flawr a.k.a. the "I Hate Cris Kernel"
 
@CrisLuengo so not even any infinite kernels? D:
 
But right now I’m collecting timing data for number of pixels vs number of lines in the kernel, and whether the direct or the tree-based method is more efficient.
 
I'm disappointed
@CrisLuengo ok then you probably don't need any crappy heuristic :)
 
I’ll add some selector, if the ratio of lines to pixels is above something, just do the brain dead algorithm.
@flawr oh, it’ll be a crappy heuristic. Based on data for one particular architecture. What can I do???
@flawr lol. I don’t use a functional language.
 
Offer public beta where both are tried and timed. When the beta is over, choose, and everyone will be happy with the more than 2x speedup.
 
10:10 PM
Lol! That’s the trick! Put a bunch of pauses in the code in one release, then remove them and tell the users you “optimized the code”.
 
Asking about infinite structures is always entertaining when talking to computer scientists - I remember sitting in a (cs) graph theory course with another math student which was the first course of said lecturer, and I think he didn't enjoy our questions about graphs with an uncountable amount of nodes as much as we did.
 
But yes, it would be cool to include some program that does various timing exercises and tunes all these heuristics to pick optimal algorithms.
 
@flawr oh yeah, smartasses are the worst (<.< >.>)
 
it actually started with genuine questions!
 
@CrisLuengo Python has optional performance-guided optimisation when you build it from source
 
10:12 PM
@flawr oh, you’re one of those students!
No, I actually liked students with weird questions, at least they are paying attention and learning stuff.
 
I never had students like that. I was students like that :D
but I've only taught practical courses with smaller groups (few dozen students at most)
 
@AndrasDeak--СлаваУкраїні it is an interesting concept. It would be expensive, running those tests, but might be worth it.
 
Of course you'd have to tell people to pull and build locally instead of pip installing. For most users that might be a no-go.
 
I’ve had students staring at their laptop screen or phone screen. I don’t get it, you don’t need to be in the class if you don’t like it.
 
@CrisLuengo we have mandatory attendance in practical courses...
So I don't hold that against them. I just tell them to keep quiet.
But I don't normally have students with laptops, come to think of it.
 
10:29 PM
 
@CrisLuengo so that's for a rectangle kernel?
 
That's an easy heuristic! Times are almost independent of the length of the lines in the kernel, just the number of lines. Nice!
Decomposed into more than 12 lines? Use the tree algorithm.
 
What system is that, and how large is the image? I can run on my laptop, debian with intel CPU.
 
@flawr Yes, to keep it simple.
 
10:31 PM
no MKL (I think)
 
@AndrasDeak--СлаваУкраїні I ran the timing on Python, then copy-pasted the values into MATLAB to make the plot. It's just faster for me that way. One day I'll learn to do plots in Python.
 
although I bet that's a MATLAB run
@CrisLuengo yeah, I just realised that matplotlib would screw that plot up
 
@AndrasDeak--СлаваУкраїні Yeah, no. It's all in DIPlib.
 
it would be super easy to plot it, but the overlap would break the 2d renderer
@CrisLuengo no BLAS? LAPACK? MAGMA? The shame ;)
 
@AndrasDeak--СлаваУкраїні I do use Eigen for some things (a C++ linear algebra library). But I don't think Eigen uses BLAS or LAPACK. Maybe optionally? No idea!
Also, I totally swapped the two axis labels... :(
 
10:37 PM
@CrisLuengo one day you'll learn to do plots in MATLAB :P
@CrisLuengo yeah, I'm familiar with Eigen. Don't know if it uses anything like that under the hood.
 
So, like I said, if you'd find it useful to run your benchmark on other systems I can run stuff for you
 
@AndrasDeak--СлаваУкраїні Thanks! You'd have to build the library first, it might be a bit involved. I don't want to put you though that.
 
If there's no rush I can give it a shot. Then again if it's not that important then I don't insist either :D
 
It's not difficult, but you need the tooling. Especially on Windows that kinda sucks. If you're on Linux it'd be quite easy though.
 
10:41 PM
if it's helpful to you it's not an issue for me to try
just let me know
 
I'm happy with the plot I've got. Even if it's not identical for other systems, it'll be close enough. It's not that important to squeeze 100% out of everything. Picking the wrong algorithm near the threshold is not going to make a whole lot of difference. It's the 3x or 4x difference for very small or very large kernels where it matters.
But I appreciate your willingness!
 
10:58 PM
@AndrasDeak--СлаваУкраїні I just realized you could put whole expressions into decorators in python!
from functools import partial, reduce

@lambda f: partial(reduce, f)
def binary_plus(x, y): # not actually binary with the decorator
   return x + y

print(binary_plus([12, 14, 3, 15, 7]))
This let's you write a whole lot of new confusing stuff!
 

« first day (2550 days earlier)      last day (673 days later) »