« first day (2590 days earlier)      last day (1891 days later) » 

2:04 AM
Hello. Is there anybody here helping me with Tables and how to check whether a value is positive?
 
@MonireJalili Positive will test if something is positive
 
Let me try it. Thanks
I have been struggling with applying functions on elements of a table
This helped.
 
@MonireJalili try looking up Map
 
Damn, I want Positive[0]=True!
 
You can also use Table to apply a function to elements of a list
try this then myPositive = #>=0&
 
2:13 AM
How do you apply a boole[x>0] on elements of a 3-d table?
Let me try it
I have tables.
 
@MonireJalili UnitStep will probably do that fastest
Assuming by boole you mean you want 0 or 1
 
I have two tables. I want a third table with values of 1 for when table 1 values >= table 2 values and 0 otherwise
yes 0 or 1
 
Try this then: UnitStep[table1 - table2]
 
Boole[Positive[Table1 - Table2]]
 
UnitStep[table1 - table2] won't quite work in the table1[[...]] == table2[[...]] case but you could apply some kind of shift to make that work
Like table1 + $MachineEpsilon or something
 
2:17 AM
It is actually working
 
Oh you're right. UnitStep[0]==1.
Cool. That's all you need, then.
 
You saved my day
Could you show me some videos or workshops on how to work more efficiently with tables/lists?
My main use of Mathematica is "optimization" of not well-defined problems
I used linear and non-linear methods
and I barely can get help from built-in optimization functions
For examples, I am now searching over a three dimensional space for my optimal solution
 
@MonireJalili I'm afraid I'm no expert in that. On the other hand, there is a wealth of questions dealing with how to do list operations fast here. Here's one I asked:
12
Q: Most efficient numerical selectBetween

b3m2a1Often when I'm working with numerical data I want to select those points within a given range. To do this I generally do something like: Select[samp, min < # < max &] or if I'm feeling lazy: Select[samp, Between[ {min, max} ]] But today I was thinking about how inefficient this is and deci...

Here's one that links from that:
30
Q: Finding all elements within a certain range in a sorted list

SzabolcsSuppose we have a sorted list of values. Let's use list = Sort@RandomReal[1, 1000000]; for this example. I need a fast function window[list, {xmin, xmax}] which will return all list elements $x$ for which $x_\textrm{min} \le x \le x_\textrm{max}$. How can this be implemented in Mathematica? I...

Here's one off that:
92
Q: What best practices or performance considerations are there for choosing between Cases, Position, Pick and Select?

VerbeiaCases, Select,Pick and Position each have different syntaxes and purposes, but there are times when you can express the same calculation equivalently using either of them. So with this input: test = RandomInteger[{-25, 25}, {20, 2}] {{-15, 13}, {-8, 16}, {-8, -19}, {7, 6}, {-21, 9}, {-3, -25}, ...

And building off those you should have a good sense of what operations are efficient/not
Also read the obligatory note about packed arrays:
108
Q: What is a Mathematica packed array?

nixeagleA simple sounding question with a few sub questions: What is the difference between unpacked vs packed array? Are packed arrays more space efficent, how much so? Are packed arrays more time efficient for certain types of access over the unpacked form? Bonus: Is it ever undesirable to make u...

 
thanks. I'll look into this
One quick question
What is the function that returns 1 for when the difference of two values are zero?
 
2:37 AM
@MonireJalili not sure if there's any built-in one but here's an option that'll be fast:
UnitStep[-Unitize[table1 - table2]]
 
Great! Thanks
 
Only the equivalent positions will be 1 everything else will be 0
 
 
6 hours later…
8:50 AM
I've been trying to convince myself to write documentation all day. Instead I created a palette to work with SimpleDocs...
On the plus side I now have a partial palette for working with SimpleDocs
I'm gonna do a video showing how it works, I think, and then write a stub blog post about it
 
9:19 AM
@b3m2a1 looking forward to seeing it
 
 
1 hour later…
10:41 AM
@MonireJalili Check out BoolEval bitbucket.org/szhorvat/booleval/src/default
BoolEval[a==b] returns an array that contains 1 where the elements of the arryas a and b are the same.
 
11:16 AM
@Szabolcs SW would say that's a good candidate for the function repository :)
 
12:15 PM
CreateDocument[
 Graphics@Disk[],
 WindowFloating -> True
 ]
Can't evaluate enything in the original notebook when the created document is viisble
Can you reproduce it?
 
@CarlLange I don't like the idea of the function repository. This kind of functionality should go in a package, not a single function. The BoolEval package has multiple functions.
3
All that effort that went into the function repository would have better been spent on a package repository.
They just ended up having to solve multiple problems that are created by rejecting the package concept. Such as dealing with namespaces.
Those solutions then create additional problems. Why do we have to wrap everything in ResourceFunction instead of having a proper symbol? Then things like messages don't work as they should anymore. Then additional workarounds have to be implemented, which no doubt will come with their own compromises and drawbacks.
Any non-trivial functionality will involve multiple functions, not just a single one.
Even when the functionality can be packaged into a single function, it would typically benefit from being broken down into pieces, or at least exposing some of the sub-functions it uses internally.
 
12:38 PM
@Szabolcs I am surprised you gave it a try. I consider it a slap in a face of everyone who was asking for more attention for serious developers.

I don't claim it is useless though, probably fine for interactive use/quick prototyping etc. Otoh maybe not, have not tried it at all.
 
 
6 hours later…
7:03 PM
@Szabolcs I've been brining that up to WRI people whenever they talk about the function repository, but based on the paclets live stream I think many parts of the company (okay just SW) didn't realize to what degree the current package stuff is in use.
2
@Kuba Can't reproduce on my end (macOS)
 
 
2 hours later…
8:45 PM
What slightly concerns me about the function repo is the idea that it will be a warehouse for functions that people just don't know about. I worry that it'll just be where functions SW doesn't think are important will go to die, even if they could be used by everybody and might as well be a part of the core language.
But then there are a few things I've written where I think, OK, this WKT parser is literally a single function and is useful to more than just me, maybe it should be published...
But then again, I also think that a WKT parser should be an Import format or similar, there's no reason for it to not be a part of the core language (or at worst, a GIS` function)
 
9:09 PM
@CarlLange you can write a paclet that supplies that WKT parser as a direct Import format
That's really the way it should go. You have a useful function/set of functions and so you expose them through the standard paclet mechanism, not the WRI ad-hoc FunctionResource framework.
Also gives you much better control over what goes on. If you want an example of where this is used, take a look at this: github.com/c3m-labs/ImportMesh/blob/…
(excuse the formatting on that, tab-based as opposed to space based)
But basically you write a paclet, then you register the format inside the paclet
 
9:41 PM
Well, it's a bit weird for that specific example because you don't get WKT as raw files, you get it as strings inside other data (like the result of a database query or in a CSV or so on), so maybe an Import format doesn't necessarily make sense. I dunno. I suppose I'm just bemused that it's not already supported within the language
 
@CarlLange ImportString :)
 
In any case, yeah. I dunno. I think there are some cases where the function repo makes sense - I often see functions on the SE that are pretty much exactly right for that type of thing.
@b3m2a1 I suppose so :)
 
@CarlLange sure, but those could also just be cooked into a proper paclet (something like SETools). In fact, one could write an SE scraper that finds highly-upvoted functions and automatically packages them up (minor cleaning would be required) and provides the links to the answers in the usage message.
 
@b3m2a1 Ha, that's a nice idea
 
It's one of those things I've had on my mind for a while but never got around to
 
9:47 PM
Is the little orange widget thing new for the function repo? resources.wolframcloud.com/FunctionRepository/resources/FileQ
Is that what it'll look like in 12?
 
The little circle? Yep
You can see it already live in the cloud
 
Huh
I'm not completely sure if that's great, since it's not typeable, right?
well, maybe it's semi-typeable, like Quantitys
 
It definitely is not. But Richard Henninagan (?) devised a typeable template box for it that he demoed here a month or so ago.
Sometime after the Function Repository live stream I think
 
Oh, it's in 11.3 as well apparently.
Hmm, would be nice.
 
Oh?
How do you get it?
 
9:50 PM
 
Oh by updating the "ResourceSystemClient"
 
And I definitively do not have 12 :)
Hm, InputForm of it is
 
This is definitely another nice feature of using paclets as a distribution mechanism. WRI can back-patch stuff.
 
ResourceFunction[ResourceObject[<|"Name" -> "BirdSay",
   "UUID" -> "a24858c8-45c5-4020-a8c2-c23bd5d26f04", "ResourceType" -> "Function",
   "Version" -> "1.0.0", "Description" -> "Have a bird say an expression",
   "RepositoryLocation" ->
    URL["https://www.wolframcloud.com/objects/resourcesystem/api/1.0"],
   "WolframLanguageVersionRequired" -> "10.0", "SymbolName" ->
    "FunctionRepository`$0945b71887c34426994f0d8340e95064`BirdSay",
   "FunctionLocation" -> CloudObject[
     "https://www.wolframcloud.com/objects/5e407f09-81ca-4549-a06c-2c4c982bb88d"],
That's pretty cool.
Yeah, I like that stuff gets quietly updated behind the scenes.
(Provided nothing breaks, but in fairness I've never seen that happen)
(Except in the livestreams, but none of that is released anyways :) )
 
@CarlLange there was a disaster once where every Mathematica crashed on startup because of a bad paclet update
 
9:54 PM
Haha
Oh dear
 
But that's the kind of thing WRI should just catch
Like the fact that they did not catch it makes you wonder what QA was doing
 
It's mildly surprising that they don't do a tiered rollout of these things
🤷‍♀️I think I'm basically fine with the function repo. It's nearly as useful as the neural net repo, but I suppose it's pretty easy access to some goofy functions resources.wolframcloud.com/FunctionRepository/resources/…
 
@CarlLange I like to read the definitions of these things
You occasionally find useful stuff that you'd only know about if you spelunked a lot or worked at WRI
 
@b3m2a1 "Download definition notebook", at the bottom of the page
 
@CarlLange that's exactly where I find the defs
 
10:07 PM
Ah, sorry, I thought you meant you would like to
Yes, seems very useful
Hmm, interesting stuff. I hope they've upped their timeline for the paclet repo though.
 
11:07 PM
@CarlLange considering that 12 is like 50/50 never going to come out it's hard to be optimistic on that
 
continue waiting
 
Continue waiting never works
That dialog is the symbol of doom
 
Not as bad as the "Formatting Notebook Contents" one.
 
It's basically saying "abandon hope all ye who see me here"
 
Anyway, what I'm trying to say is WRI are conditioning us to be patient :D
 
11:09 PM
L o l
Or you get impatient and just implement it yourself ¯\_(ツ)_/¯
Lol SE thinks the \ in the shrugging emoji is an escape character so you have to format it as code to get it to show
 
ah, I never thought to format it, I just decided the arm was implied
 
11:41 PM
Ah the beauty of the incomprehensible FE crash. I love how finnicky it is! :) So quirky! :) So fun! :) I love having to restart what I've been working on for the past few hours because I pressed a button and the FE freaked out :)
 

« first day (2590 days earlier)      last day (1891 days later) »