« first day (2281 days earlier)      last day (940 days later) » 

1:21 AM
One can tell from the questions that it’s September again.
 
 
5 hours later…
6:17 AM
posted on September 28, 2021 by Cris Luengo

DIPlib 3.1.0 was released last week (see the change log). One of the changes in this release is a very significant speed improvement in the morphological reconstruction (dip::MorphologicalReconstruction). This is quite an interesting story, so I decided to write it down. The morphological reconstruction algorithm can be …

 
 
2 hours later…
8:15 AM
> Timings from 15 years ago are likely no longer relevant.
:D
@CrisLuengo I'm expecting your next post to be about monads!
 
 
2 hours later…
9:48 AM
@flawr the non-colonialist US
 
 
2 hours later…
11:27 AM
Butterfly testicle powder is the strangest ingridient for a potion I've seen so far... — Ver Nick yesterday
 
also very expensive
 
Just thought I should share this out-of-context comment
 
11:40 AM
@flawr I tried glyphing for your polyhedron thing but it won't work, because you also have to orient the polygons correctly around the respective normals
 
@AndrasDeak what is glyphing?
 
replicating a given geometry (mesh) at each point of another mesh docs.pyvista.org/examples/01-filter/glyphs.html
that's how you plot vector fields
it's typically a lot more efficient than plotting arrows yourself
with your earlier polygon and my Platonic solid PR it looks like this:
    surf.rotate_y(90)

    mesh = pv.Dodecahedron(1.75)
    mesh.compute_normals(inplace=True)
    mesh.point_data.clear()
    face_centers = mesh.cell_centers()
    poly = face_centers.glyph(geom=surf, orient='Normals', scale=False)
    poly.plot()
it would also be hard to get the size of the base solid right
 
11:56 AM
I see
so the issue now is that it is hard to rotate the polygon to a consisten direction across all faces?
 
The fundamental problem, yes. Figuring out the correct oriantation for it and the size of the solid would be another issue, but that could probably be solved.
if you plot what I showed, rotating it around you can see that polygons align differently on different sides
otherwise we could call surf.rotate_z on your polygon before the first line to align them
 
 
2 hours later…
1:44 PM
@flawr if I write about Haskell, it would have to be Haskell used in image processing. And I honest don’t yet see how one could possibly do that. Maybe as I learn more I’ll see how it’s possible?
I mean, you have to return a new priority queue every time you push or pop an element? That’s expensive!
 
@CrisLuengo I haven't ever done any image processing in haskell, not sure if there are any good libraries.
 
I'm told there's magic, so try first and see if it's slow
then again you can't make much use of laziness when you're going to process every pixel anyway :P
 
@CrisLuengo you have to keep in mind that almost everything is lazy, so even without any optimizations during compilation you rarely actualy make a copy of the data
 
2:16 PM
@flawr I’ll have to port DIPlib to Haskell. I only spent 4 years porting from C to C++. How hard could it be to rewrite in a completely different language?
@AndrasDeak “lazy” is only a positive attitude in programming.
 
2:55 PM
@CrisLuengo There's only one way to find out:)
 
3:15 PM
@CrisLuengo But I'm curious, how far did you get with your Haskell experiments?
 
3:35 PM
I've been reading the tutorial you sent me, I'm knee-deep in types now. I'm hoping it'll get more exciting later, but I don't want to skip the basics.
It doesn't say anything about types with an explicit number of bits -- it's either machine `int` or a limitless integer. I'm more interested in 8 and 16 bit integers, do those exist?
 
Oh cool! I think for Int only a minimum size is defined by the language specs, the actual size is defined by the implementation. If you need specific bit detph there is Data.Int.
 
4:01 PM
@flawr Neat! And this package for the unsigned integer types: hackage.haskell.org/package/base-4.15.0.0/docs/Data-Word.html
And there's complex numbers too. hackage.haskell.org/package/base-4.15.0.0/docs/…
I'm surprised these things are addons, but somehow it makes sense to keep the language itself as simple as possible, since all these other things you can build up from the more basic stuff.
Except the integer types. I don't understand how you could possibly build that from what's in the basic language. Some trickery must be going on in that package...
 
They are addons in the sense that you have to import them, but they are part of the base packages.
these are the packages that are automatically included in GHC
I guess they focus a more on combinators and general structures. It is very common to write your own types on the fly!
 
I still have a lot to learn. But it's interesting, you get to think about a program from a different perspective.
 
4:16 PM
I mean what language has a Category type as part of their basic packages? :)
 
It's similar to C++ Concepts. They're more complicated, and also arrived way too late. Many people had implemented their own version of concepts, and the C++ committee has been talking about them for ages. I guess it took them all that time to agree on an implementation.
...but then again the core of C++ has ballooned beyond recognition. It's a HUUUUGE language. There's something nice about a language like APL that has about 30 keywords (key characters) and nothing more.
 
I never heard about the C++ Concepts, that looks really interesting. But yes for the short time I had to use C++ the only lasting impression was that it was indeed huge:)
@CrisLuengo You must like javascript as you only need 6 characters.
Ah I've shown you before.
 
LOL!
There's a balance between providing functionality and being expressive on one side, and being simple on the other. jsfuck is on one extreme end of that.
 
4:33 PM
But for things that are actually used, I heard that there are quite tiny interpreters for Lisp languages.
 
5:03 PM
@CrisLuengo key somethings
2
 
 
5 hours later…
10:04 PM
@CrisLuengo mat2str is supposed to do exactly what you want Or is it? The doc says "with up to 15 digits of precision."
Of course it's debatable, as you commented, why 15. But the function does what the doc says it does. So I wouldn't consider that a bug
 
10:28 PM
@LuisMendo Didn't notice that. :(
@LuisMendo Your answer works, but it's way too complex. Why not just str=mat2str(x,17) and x=str2double(str)? Your answer only works for doubles, so might as well do the simple thing that only works with doubles.
 
10:52 PM
OK, I added my answer too.
 
11:13 PM
@CrisLuengo I wasn’t sure how many digits were enough, so I thought I’d use the bytes in the internal representation. How do you know 17 are enough?
That base64encode is nice!
 
@LuisMendo I bet it's because of the machine epsilon
 
11:36 PM
@LuisMendo I read it on Wikipedia. Must be true!
The mantissa is 2^53, which is a 17-digit number.
 

« first day (2281 days earlier)      last day (940 days later) »