« first day (2108 days earlier)      last day (1123 days later) » 

5:01 PM
@flawr I want that! And I know how to implement it, which is a rather dangerous situation because I might put time into developing this... :(
 
 
2 hours later…
6:43 PM
@CrisLuengo yes very dangerous:) I was thinking a little bit more about that too, cause sometimes it could be useful. You'd only need an object that pretends to be an array, but doesn't actually allocate the memory, but just saves the size, and then adapt the rest of the methdos to basically ignore the content of these arrays.
@CrisLuengo were you thinking about this for DIPLIB?
 
7:03 PM
@flawr No, in MATLAB. I don't even know if I'd use it. I just love the idea!
I would probably only use it in answers on Stack Overflow to confuse the hell out of people... :)
[zeros(50,50), sink(50,5)] becomes an array of zeros of size 50x45. This is really just overloading the concatenation operator.
 
@CrisLuengo I think I'd prefer [zeros(50,50), sink(50, -5)] :)
 
But it's a 50x5 array that you subtract.
This is what I was thinking:
`[zeros(50,50), sink(50, -5)]` vs `[zeros(50,50); sink(-5, 50)]` is a bit awkward.
 
7:19 PM
well maybe then we'd use ordinary types: [zeros(50,50), nan(50, -5)]
 
Or better example: [zeros(50,50), sink(50, -50)] vs [zeros(50,50); sink(-50, 50)] (to produce an empty matrix).
Though I do like the idea of whos showing negative sizes...
 
I think using positive numbers to subtract if you have a function named sink makes sense:)
 
Can we make whos show negative number of bytes too?
 
but if you'd use the ordinary zeros, ones, nan, inf I'd prefer negative numbers
@CrisLuengo only if it respects the numel(x) == prod(size(x)) "rule":)
 
Yes, I agree there. Not sure I like overriding those functions, but it would certainly look nice. So ones(50,-5) creates a sink(50,5) object that then does its thing when concatenating.
Hummm... how to distinguish ones(50,-5) from ones(-50,5) then? This proposal needs a bit more thinking. But I like where it's going!
Also, overriding ones and zeros will make the SO answers way more confusing.
 
7:27 PM
How can you tell whether the sink(50, 5) is a (-50, 5)-like or a (50, -5)-like pseudoarray?
And what about multidimensional sinks?
I find the signed sizes a lot more intuitive. (Well, and even that's not too intuitive to me, but that comes with the turf ;)
 
I was thinking the sink just deletes rows or columns depending on how it is concatenated: vertical concatenation removes rows, horizontal concatenation removes columns. Extends to arbitrary dimensions.
~I also just discovered that zeros(5,6,'sink') calls the sink constructor. So there's no need to override those functions!~
(can't cross out stuff?) I was wrong about that one, it doesn't call the sink constructor.
 
@CrisLuengo hmm, that would probably tie my brain in a knot for multidim arrays
@CrisLuengo triple hyphens
 
foo
Ah, cool, that works. Thanks!
But I'm too late to edit that comment now.
 
No problem. Chat FAQ from link in bottom right corner.
 
I get it. RTFM.
Too lazy for that...
 
7:34 PM
at least I can say I tried :D
 
@AndrasDeak ah that's a good point!
 
But Cris' context-based explanation might be consistent
I'm not in a mental state to try and assess that
 
OK, I'm learning new things here. zeros(5,6,'sink') calls sink.zeros(5,6).
 
That's really weird but might be very practical
 
But you must construct a sink object first. If you have never constructed such an object (in the current session), then zeros does not know about it.
 
7:42 PM
extra weird
 
This is why I got confused earlier.
Yeah, weird.
 
there's a whole volume of discussions for numpy, trying to create machinery that lets things like zeros dispatch for third-party array libraries
 
Maybe it's because I'm using a local sink class, rather than having its M-file on the path.
 
Hmm, maybe. I know very little MATLAB OOP, and most of the little I know is "avoid it"
 
Ha! That's a good philosophy.
MATLAB OOP is super-duper-weird.
Yes, that was it. With the M-file in a directory on the path it works normally. There's something with a classdef in the current directory that does weird things.
Anyway, I gotta stop this. I might look more into it in the evening, when I'm not expected to be doing actual work. :)
 
7:46 PM
hehe
I have no idea what that might be like <.<
 
@AndrasDeak actually yes! when concatenation you always have to define the axis of concatenation, and that would also be where you'd have the "negative" dimension
@CrisLuengo it's already evening here, you can stop working:P
 
@flawr I want to live in a time zone where it's always 11pm.
 
@CrisLuengo YES, PLEASE
 
 
1 hour later…
8:52 PM
another advantage of 0-based indexing: it plays nicely with modulo
li0 = modulo(li-1, nbulkl) + 1  ! in [1, nbulk]
 
9:28 PM
Yes, that is the reason I taught my son to start counting at 0.
 

« first day (2108 days earlier)      last day (1123 days later) »