« first day (1594 days earlier)      last day (1618 days later) » 

5:12 AM
posted on November 07, 2019 by Loren Shure

For those Monty Python fans reading this post, check out the Argument Clinic. Recently both Sean and Jiro, twice! posted about the new arguments capability available for input argument checking. I wanted to show you some more about this great feature! I've also discussed argument checking over the years, including this post.... read more >>

 
 
5 hours later…
10:24 AM
> The magnetometer system has only one operational mode, “ON.”
Those are the best operational modes
 
:D
like one of those scifi perpetual motion machines that you can't unplug
 
10:46 AM
@AndrasDeak does that mean that these perpetual motion machines require power? :D
 
I mean physically impossible to unplug D:
or at least they don't stop when you do ;)
 
> The term partially processed data is intentionally vague in the PDS data dictionary so that it can be used to describe many different data sets with differing degrees of data processing.
Another beauty from the same document
 
they should write ikea item descriptions
 
11:02 AM
"The term chair is intentionally vague in the IKEA catalogue, so that it can be used to describe the many different pieces of furniture one can sit on from various product ranges."
2
 
 
1 hour later…
12:47 PM
@LuisMendo installed octave 5.1 just now, if the problem is still open
octave:1> vpa([4 5], 20)
warning: the 'vpa' function belongs to the symbolic package from Octave Forge
which you have installed but not loaded.  To load the package, run 'pkg
load symbolic' from the Octave prompt.

Please read <https://www.octave.org/missing.html> to learn how you can
contribute missing functionality.
error: 'vpa' undefined near line 1 column 1
octave:1> pkg load symbolic
octave:2> vpa([4 5], 20)
OctSymPy v2.2.4: this is free software without warranty, see source.
Initializing communication with SymPy using a popen2() pipe.
not very helpful :D
 
 
1 hour later…
2:01 PM
0
Q: Is there any way to define a variable from a formula depending on what variables are given?

bernabobImagine you have the following formula: a=4*b*c^2 Is there any way in Matlab to program this is in a way that the if 2 of 3 variables are provided, Matlab will solve and provide the missing one? Because the only alternative I am seeing is using switch-case and solving the equation myself. i...

Interesting
Is there an easily extendable way of doing this for N-variables? I see a host of problems, such as non-separable equations
 
I guess if you reduce the equation to 0 and pass equations defining some of the parameters you can try sym to solve it...
 
so always do something to go to 0 = f(a,b,c,...,z), then a solve/symsolve and numerically evaluate the thing?
 
only symbolically, I suspect you'd have to parse it to get a numerical expression
sym might be smart enough to do that on its own
Oh, I misread. Yeah.
you can try if it works with OP's example, if you pass in their reduced equation and two more equations for any two parameters, see what happens
 
2:52 PM
posted on November 10, 2019 by Jiro Doke

Jiro‘s Pick this week is Plot Gui 2d by Silas Henderson.This entry is one of many interactive apps that Silas has created, and I had been quite intrigued by many of his entries. I chose to... read more >>

 
 
1 hour later…
3:58 PM
so in numpy ``a[(a>0) & (a<0)]=1` works, but a[a>0 & a<0]=1 fails. why
 
-1
Q: Why is Matlab so much faster than Python in computing harmonic numbers?

DimIn short, computing H_n = sum_k=1^n 1/k for large n (and other simple sums) seems to be much faster in Matlab than in Python. Why is Matlab so much faster in these situations and is there any way to make Python's performance comparable? Computing H_10^9 in Matlab took seconds, I don't have enoug...

Another "Why is MATLAB faster than Python" post. As what do we close this again?
 
4:09 PM
@flawr because a>0 & a<0 is a > (0 & a) < 0 which is (a > 0&a) and (0&a < 0) but you can't use A and B if A and B are numpy arrays, because this would call bool(A) and bool(B) which would be ambiguous so numpy refuses to implement these for non-single-length arrays
 
4:19 PM
@AndrasDeak thanks:)
well I noticed that but I thought it was really strange that & has a higher precedence than >
 
it's exclusively binary and, so it makes sense
a > b will be a bool using native python types, and & among bools is not very useful (if you have and/or etc.)
 
now I'm wondering, why wouldn't they just implement the usual and for np arrays instead?
I just feel like if you're doing bitwise stuff in a high level language like python you're doing something wrong
 
@flawr because what should it be? Native python types are truthy if they are not empty. But having bool(np.array([0, 0])) be True would be confusing
the half-serious Zen of Python says "in the face of ambiguity refuse the temptation to guess", which is a great guideline
OK, I see the issue. So: the thing is you can't implement and, x and y will always rely on bool(x) and bool(y), and the issue is implementing ndarray.bool
 
I thought you could redefine and?
ah no you can only redefine the bitwise and
kinda strange that .__and__ refers to the bitwise &, and not to the normal and
@AndrasDeak well in this case they probably say you should guess wrong=P
too bad you cannot even redefine the precedence or associativity:/
 
Interesting problem, I feel like there must be a neater solution than what I've provided: stackoverflow.com/q/58802626/3978545
 
4:37 PM
@Wolfie anonymous functions ftw:P
 
@flawr you can do a lot of weird things abusing the existing protocols, so I don't mind much
 
anyway, thanks for the explanation!
 
correspondingly "bool(x) calls x.__bool__() which returns a bool" is a rare example in python (the last part about guaranteeing a bool return value)
@flawr anytime :)
 
 
1 hour later…
5:47 PM
@AndrasDeak Have the spoiled vpa in 5.1? :-D
That reminded me of
Jan 25 '16 at 0:34, by Andras Deak
BWAHAHAHAHAHA
 
:D
it's not impossible that my octave is somehow borked, although I'm using debian packaging. Python 2 support is getting sketchy, which might be related.
 
You should move to windows 10
with MSword
 
>:(
 
it has good python support!
 
And draw in Paint
 
5:49 PM
@LuisMendo colon is a built-in now :(
 
@LuisMendo the best scientific tool for graphs
the newer Paint3D is even greater
 
Greater as in more bytes?
 
you can do the same crappy drawings, BUT IN 3D
IMAGE HOW COOL YOUR FFTs LOOK in 3D
 
:-D
Do they like bikes in Amsterdam? They do like bikes in Amsterdam
 
Octave comes in a 31MB tar. MATLAB should take notes...
 
5:56 PM
 
@LuisMendo there are at least 5
@AndrasDeak They tried, but typoed the M for a G
 
:D
MATLAB has much more functionality than octave, but not 500x...
ooh, octave is written in C
 
peppers.png, 25Gb
 
DEFUN (colon, args, ,
       doc: /* -*- texinfo -*-
@deftypefn  {} {@var{r} =} colon (@var{base}, @var{limit})
@deftypefnx {} {@var{r} =} colon (@var{base}, @var{increment}, @var{limit})
Return the result of the colon expression corresponding to @var{base},
@var{limit}, and optionally, @var{increment}.

This function is equivalent to the operator syntax
@w{@code{@var{base} : @var{limit}}} or
@w{@code{@var{base} : @var{increment} : @var{limit}}}.
@seealso{linspace}
@end deftypefn */)
{
  int nargin = args.length ();
no more funky comments
 
@AndrasDeak Write in c, write in C, write in C, write in C / Java's not the answer / Write in C
 
5:59 PM
colon(3,4) works now :P
Jan 25 '16 at 0:30, by Andras Deak
I've just realized: we've only tested vpa on my octave.
Jan 25 '16 at 0:30, by Andras Deak
IT HAS NEVER WORKED ARGH:D
listen to that guy, he seems to know what he's talking about ^
 
I do not trust him
 
@AndrasDeak that octave-like whitespace use in function calls creeps me out...
 
@AndrasDeak What about colon('A':'C')? Does it still error?
 
yup
error: Invalid call to colon.  Correct usage is:

 -- R = colon (BASE, LIMIT)
 -- R = colon (BASE, INCREMENT, LIMIT)
 
I assume diff('abc')too
 
6:05 PM
yup, "X must be numeric or logical"
 

« first day (1594 days earlier)      last day (1618 days later) »