Message Boards Message Boards

29
|
202815 Views
|
379 Replies
|
674 Total Likes
View groups...
Share
Share this post:

New Functions I would like to see in future Wolfram Language versions

Posted 11 years ago
I was wondering, it would be interesting to try to use the community as a way to request new functions that could be incorporated into new versions of Wolfram Language, in a colaborative way. Sometimes users simply don't have the whole/deeper system view, to understand that the requested function is or too specific, too broad or already implemented, but I believe that another times we can have a nice insights, that Wolfram Research people haven't yet, or that do not have received much attention  yet.  To the idea is:

Post your's requested Function as a answer to this question, and let's upvotes show the more interesting ones!

Some rules
1- One Post per function (or class of function), you can have more than one request.
2- Exemplify your function use.
POSTED BY: Rodrigo Murta
379 Replies
Posted 11 years ago
Functionality like C++ ostringstreams. Currently it's possible to treat a string as an input stream, but there's no straightforward way to send output to a stream and turn it into a string (you can always right to a temp file and read the file, but that's pretty yucky).
POSTED BY: Matt Pillsbury
Posted 11 years ago
Better support for functional programming. *Mathematica* is pretty good, but there's definitely room for improvement, especially if you need to, say, build a list in a recursive function. Things that would help include:

* Lists built out of cons cells, perhaps constructed using a function named LinkedList or ForwardList, which could be converted to a normal list using Normal. You can do this now, of course, but you either have to use some made-up head for your conses, or be very careful if you're using two-element Lists, and in either case there isn't direct support from functions like `Map`, `Fold`, `Select`, et c.
* Functional data structures for sets (and maybe maps). The obvious example would be red-black tree, but there's a universe of options out there. Again, a key advantage would be integration with existing set-oriented functions like `Union` and `Complement`. `Again`, Normal could be used to turn them back into a list

The key advantage I'm looking for is the ability to efficiently add or delete elements one at a time, which is really convenient in a lot of circumstances, but is really kind of clunky to do in *Mathematica* as it exists now in a way that's efficient. 

Also, `$IterationLimit` should default to `Infinity`; currently if you want to use (tail) recursive approaches, you have to wrap everything in a `Block` to keep from stopping prematurely on all but tiny problems.
POSTED BY: Matt Pillsbury
It would be great to have option to create Formated Excel files, with control over:
    1- Cell color
    2- Font Color
    3- Column size
    4- Border color
    5- Export ascreating Excel Tables Object.
    6- Cell comments
    and so on...

It would be nice to just create a formated Grid, and when export it using Export["myexcel.xlsx",Grid[myData, A lot of formated options]], that this data could come to excel already formated. I kwno I can use VBScript to do that, but I would like to do all from inside Mathematica, in a more clean/simple way.
I automate a lot of reports today using Mathematica, but they are very ugly, due to the lack of format capabilities.
I know about ExcelLink, but it's not a direct options to me because it needs Excel instaled, and works just for Windows. I would love to have this improved Export version.
If there are another options, please, let me know.
 
POSTED BY: Rodrigo Murta
Deselect

We have Cases[expr,pattern] and DeleteCases[expr,pattern]

Why not Deselect[expr,criterion]?

(* standard caveat, yes, easy to write your own... *)
POSTED BY: W. Craig Carter
http://www.dbaileyconsultancy.co.uk/debugtrace/debugtrace.html
POSTED BY: Frank Kampas
Maybe it's worth starting a separate thread about that.  It would be interesting and useful to figure out a good workflow.  I use it occasionally, but not often, and almost never with my own code.  But I don't try to use breakpoints any more---bad experiences with those.
POSTED BY: Szabolcs Horvát
I've been using Mathematica for 12 years or so, and I haven't figured the debugger out yet (for real!). It is just too damn confusing! I would love to see a good video about it, and try to use it ;)
POSTED BY: Sander Huisman
The built-in debugger has a very bad reputation, but in my experience it is quite usable except for one key area: breakpoints.  If I don't try to use breakpoints, then it's a very useful tool.  Instead of breakpoints it's possible to simply trigger a message or use Assert or similar.  (I don't mean that there isn't room for improvement, just pointing out the currently usable solutions.)
POSTED BY: Szabolcs Horvát
I think we all want break-points, and some simple command to go step-by-step, and hover over any variable and check their current value...
POSTED BY: Sander Huisman
@Szabolcs. This would be cool!
POSTED BY: Rodrigo Murta
I would like to see the Profiler and the MUnit unit test framework being moved from Workbench into the core Mathematica.  Neither of these are inherently tied to the Workbench.  In fact I already use MUnit separately from the Workbench sometimes because I prefer to do package development in other plain text editors (such as Vim), and MUnit can be used from within a notebook too.
POSTED BY: Szabolcs Horvát
That would indeed be awesome! Furthermore if you right-click on any function it could say 'show definition' either going to the built-in help or your own definition.
POSTED BY: Sander Huisman
Posted 11 years ago
I would love to see a gui change. I would most appreciate a sidebar, where all functions can be found, and by clicking on them being automatically transfered to that part of my code.
It would save me time from scrolling up and down .
POSTED BY: Tom Zinger
Or an option for BinLists, that you can specify a pure function as argument (or multiple) and that it bins over each of thse functions-answer. 

So something like:

BinLists[{{x1,y1,z1},{x2,y2,z2},{x3,y3,z3},{x4,y4,z4},{x5,y5,z5},......},{0,100,10},{0,200,10},BinFunctions ->{First, Part[#,2]&}]

I.e. this would bin the data x,y,z ....first over the x values in bins from 0 to 100 in steps of 10, and then over the y values in bins from 0 to 200 in steps of 10. Of course one could specify more difficult functions, let's say Total, or Mean.....With that you make very elaborate binning and would remove the need of BinIndices or so.
POSTED BY: Sander Huisman
I needed this functilonality last week. Not so easy to do from zero.
Relatad SE post: http://mathematica.stackexchange.com/questions/17734
POSTED BY: Rodrigo Murta
Relational algebra operations would be a good start.  Also, the query optimization done by SQL, such as Microsoft's, is very crude.  I'm sure the Wolfram Language could do a better job.  Given the goal of extending the usage of the Wolfram Language, relational database querying would be a big step in that direction.
POSTED BY: Frank Kampas
What kind of databases? Relational databases are kind of inherently stuck with SQL-like queries or things you'd find in relational algebra.

Are you looking for operations which are composition of relational algebra operations, like some kind of higher order SQL?

Or are you looking for functionality for non relational databases like graph databases
POSTED BY: Sean Clarke
I'd like to see functionality for querying databases, above and beyond what is provided by SQL.
POSTED BY: Frank Kampas
Also it would be great if
BinLists and BinCounts
where to be extended to:
BinIndices
(and that it returns in such a way that you can use e.g. extract on it)

A lot of times you want to bin your data X, and get the 'associated' data Y. i.e.:
{{-,-},{-,-},{-,-},{-,-},{-,-},{-,-},{-,-},{-,-},{-,-},{-,-},{-,-},{-,-},{-,-}} 
Say, you have these data-pairs. then you would like to bin on the first value, and get the second values for each bin. What I do now is to bin in 2D, and have the binsize in the second dimension very very large. But this will only work with numbers, if is it anything else it does not work.
POSTED BY: Sander Huisman
Access to the player’s kernel, from other interfaces (custom, Excel, etc), to call for functions programmed/prepared with the full Mathematica version.

No need to point out the “security risks” involved... But the need is huge from everyone that is forced to live in the Excel world. Also applicable for any kind of interaction with different local applications (CAD, etc), where server side computation or cloud computation is a no go: too “heavy” for common simple projects (small teams, etc), too open for confidential cases, too slow for thousands of individual requests (for instance, from Excel calculation update), local work where internet is still rare, etc.. Or where the project dimension doesn’t “cover” for multiple Mathematica licenses.

I go even further, and specify the difference between free player and player pro (to protect myself against the "only pro solution"). The free version pops up a pub message at the corner of the screen, every 30 min, while on use, saying “Wolfram Research, supporting your computations”, the pro version, or the enterprise "produced" version only does it once at the beginning of the session.

;-)

PS – the community interface still has some interesting bugs. This same post that you are reading was previously substituted by the first entry from Rodrigo
POSTED BY: Pedro Fonseca
The key thing is to use:
- ImageScaled[{0,0}] rather than {0,0}. 
- Use margins on the 'original' figures, and no sizes)
- Specify the sizes in the inset command.
- AspectRatio -> Full in the original figures.

But I think we all agree that there should be something 'builtin' like image-assemble: graph-assemble. Or that graphics-grid is fixed ;)
POSTED BY: Sander Huisman
Interesting use of Inset. Tks for share it!
POSTED BY: Rodrigo Murta
Rodrigo, here is the 'template': I minimized the code, hope you can decypher it:
 z=490;
 h=z;
 z1=z/3;
 z2=2z/3;
 h1=h/3;
 h2=2h/3;
 mleft=40
 mright=6
 mtop=33
mbottom=35
mtoptop=19
multimargins={{mleft,mright},{mbottom,mtop}};
topfigmargins={{mleft,mright},{mbottom,mtoptop}};


size12={z2/2,h1-(mtop-mtoptop)};
size45={z1,h2/2};
sizeb={z2,h2};
size3={z1,h1-(mtop-mtoptop)};
pb=Plot[Sin[x],{x,0,2\[Pi]},Frame->True,AspectRatio->Full,ImagePadding->multimargins,PlotRange->{{0,2\[Pi]},{-1,1}}];
{p1,p2,p3,p4,p5}=Plot[Cos[# x],{x,0,2\[Pi]},Frame->True,AspectRatio->Full,ImagePadding->multimargins,PlotRange->{{0,2\[Pi]},{-1,1}},Epilog->Text[Style[#,16,Red],{\[Pi],0.5}]]&/@Range[5];


multistrucplot=Graphics[{
(*Red,Line[{{z1,0},{z1,h1+h2}}],
Line[{{0,h2},{z1+z2,h2}}],
Line[{{0,h2/2},{z1,h2/2}}],
Line[{{z1+z2/2,h2},{z1+z2/2,h2+h1}}],*)
Inset[pb,{z1,0},ImageScaled[{0,0}],sizeb],
Inset[p5,{0,0},ImageScaled[{0,0}],size45],
Inset[p4,{0,h2/2},ImageScaled[{0,0}],size45],
Inset[p3,{0,h2},ImageScaled[{0,0}],size3],
Inset[p2,{z1,h2},ImageScaled[{0,0}],size12],
Inset[p1,{z1+z2/2,h2},ImageScaled[{0,0}],size12]
},
ImageSize->(size3+sizeb),
PlotRange->{{0,z1+z2},{0,h1+h2-(mtop-mtoptop)}}
];
Show[multistrucplot,PlotRangePadding->Scaled[0.01]]
Should give something like:
POSTED BY: Sander Huisman
An option for Interpolate to not extrapolate

Interpolate returns extrapolated values when it arguments are out of the range. However, there are cases where I would prefer that an Interpolation function would automatically clip.

Consider this "mistake":
data = Table[{x, Sin[x + RandomReal[{-0.1, 0.1}] + x]}, {x, -Pi, Pi, Pi/64}];

intF = Interpolation[data]

Plot[intF[x], {x, -1.5 Pi, 1.5 Pi}]

It would be nice if there were an option to have an InterpolationFunction to either clip its arguments or to return Null. 

It is fairly simple to find a work-around:
clipMyInterpolation[f_, x_] := Module[
  {bounds = Flatten@First[f]},
  f[Clip[x, bounds]]
  ]

clipMyInterpolation[intF, 24]
But, it would be nice to have an option such as:
intF = Interpolation[data,Extrapolation->ClipBounds]
or
intF = Interpolation[data,Extrapolation->Null]
POSTED BY: W. Craig Carter
@Sander nice plot. Can you share your notebook with these alignments using Inset? I normaly use Panel inside Grid.
There is some way to share Notebooks in the forum? Let's test it...
Update:
Do not work using "Add file to this post" buttom.
POSTED BY: Rodrigo Murta
@Sander I know that it's possible to do it, but it's awfully inconvenient and it takes a lot of manual work.  It's much easier to do it using most other plotting packages.  There are packages that automate much of this manual work, such as SciDraw,  but they have to reimplement a lot of stuf to be able to do this in a general and reliable way (e.g. all of frame and tick drawing) and they still force me to do more manual work, e.g. specify plot ranges manually for every subfigure.

(I can't see your figure because Community's image hosting is broken at this moment.)
POSTED BY: Szabolcs Horvát
There is an add-on program to Matlab called CVX which optimizes convex problems very efficiently.  Python has something similar called CVXOPT.  It would be good to have an equivalent in Mathematica.
POSTED BY: Frank Kampas
Generating plots in grids is indeed a hassle: though it can be achieved by using Inset with the right arguments. Making a figure e.g. 10cm wide is a matter of converting it to printer-points, and setting that as a width (for EPS and PDF output). It might appear small in Mathematica, but the output wil be correct. Stay away from Grid and GraphicsGrid would be my advice once you want to make complicated arrays of figures with specified dimensions/paddings. 
By using inset you make the figures precise, e.g.:


This figure was used in a journal where the overall size was important but also the font-sizes were important.
POSTED BY: Sander Huisman
I would like to see graphics handling improved to make it easier to prepare high quality figures.  In particular, I would like to have easy solutions to the following problems:
  • Make it easy to generate a grid of figures which are properly aligned with each other, e.g. like this. Currently this is a huge pain in Mathematica and it's extremely difficult to make the frames line up without a lot of manual work.
  • It should be possible, and relatively easy, to prepare figures to size.  For example, if a column in the journal is 10 cm wide, I want to prepare the figures precisely to 10 cm, while keeping the font sizes consistent (e.g. 10 pt precisely).  This means I can't first make the figure to arbitrary size then rescale it outside of Mathematica because then the fonts will be rescaled too.  This is possible currently if I only use Graphics[] objects.  As soon as I try to make a Grid[] or GraphicsGrid[], or as soon as I use legends (which do not produce Graphics[], again showing the existing limitations!), it becomes very difficult to do it.
I think all these related problems stem from one thing: ImagePadding (and related measures) are unrepditable and not even knowable by the kernel.  They are only known by the front end.  For example, if I want to line up frames in a grid, I need to make sure that all frames have the same ImagePadding.  However, if I set the ImagePadding manually, I need to make sure that it's not too small that it cuts off labels and it's not unnecessarily large.  This involves a lot of manual work and it's difficult to automate because it's not possible to retrieve the automatic ImagePadding without resorting to ugly hacks such as rasterizing the graphic first.
POSTED BY: Szabolcs Horvát
Access to the guts of ListContourPlot and ListContourPlot3D

It would be very nice to have direct access to the meshes created from contour plots of data as in ListContourPlot.  I've extracted the data from the GraphicsComplex that is created by the graphics function, but this seems like a duplication of effort.

Perhaps, such a function could return sets of closed and non-closed surfaces represented by vertex-edge-face data structures.

POSTED BY: W. Craig Carter
@Szabolcs

(great... this is now what I want to use... thanks a lot for spoiling...)

Very interesting package (that I was not aware of...)!

Unfortunately, when putted in perspective with my needs, the price is a "little" out of my league :-(
POSTED BY: Pedro Fonseca
@PedroFonseca

What you describe is similar to symbolic regression.  Symbolic regression means automatically finding a formula that describes the data (by various methods suc as genetic programming, hopefully in a smarter way than brute-force trying a large number of formulae).  I'm aware of one commercial Mathematica package for it (see the link).

Here are two real world applications of the technique, in case anyone is interested (and to show that it's not as crazy as it sounds): (1)(2)
POSTED BY: Szabolcs Horvát
I would like to have a (huge) stack of functions available to the model fit functions, so that, with a simple command, one could search on all this stack for the one that best fitted a given data. And then, to be able to sort and filter then accordingly to a fitting criteria, a function family classification, etc..

Functions would be available for at least 2D and 3D data.

I know many critics would say that if one is fitting data to a function, it is for certainly because the function has a given known theoretical relation to the phenomenon, which means that there should be no reason for a blind search (I've heard this one too many times...). In my business (and a lot of other ones...), this is not necessarily the case in a lot of situations, and we just need a function that describes a given variation so to integrate the variation in a more complex model. This can be done with the Interpolation function, but as soon as things become a little more complex, there's nothing like a mathematical object that we can see, analyze, etc.

This should be relatively easy to start by WR since there's already the Wolfram Functions Site. Also, the functions don't necessarily need to be available on the install, and can be loaded when requested, which means that the framework can start with very little effort, since it can grow along time.

I think that there's no need to say that it could also be a very interesting functionality to have available on W|A (just trying to find a budget ;-) )
POSTED BY: Pedro Fonseca
NearestGradients as a first cousin to Nearest

I wonder if it is possible to include a "Nearest-like" function that returns points that have the largest magnitudes of gradients respect to a set of fixed data points

For example:
distanceFunction[v1:{x_, y_, z_}, v2:{x2_, y2_,z2_}]= EuclidianDistance[v1,v2]
scalarPotential[v1:{x_, y_, z_}, v2:{x2_, y2_,z2_}] := Exp[-distanceFunction[v1,v2]^2]

data = RandomReal[{0, 1}, {10000, 3}];

nearestGrad = NearestDistanceAndGradient[data, ScalarPotential->scalarPotential[#1,#2]&, InterpolationOrder->2]
and nearestGrad[pt,2]  would return a list:
{
{pt1, distanceFunction[pt,pt1], Grad[scalarPotential[pt,p1]]},
{pt2, distanceFunction[pt,pt2], Grad[scalarPotential[pt,p2]]},
}

where pti ={xi,yi,zi} are the points for which Abs[Grad[scalarPotential[pt,pti]] is ordered.

I suppose that this would only work for differentiable DistanceFunctions.
POSTED BY: W. Craig Carter
Fast Modifications or Updates to Nearest 

I wonder if it is possible to modify nearest with minimal computation if only one or two points are changed.

For example, this might be a typical use of Nearest:
data = RandomReal[{0, 1}, {10000, 2}];
nearestFunc = Nearest[data -> Automatic]
location = nearestFunc[{0.5, 0.5}]
EuclideanDistance[{0.5, 0.5}, First[data[[location]]]]

newdata = ReplacePart[data, location -> {0.5, 0.5}];
Now suppose that I only want to change one element of data:Now, I would need to recompute the NearestFunction using all the data.
I would guess that it would be faster to update the NearestFunction with information stored in the previous NearestFunction.
newNearestFunc = Nearest[newdata]
For example, usage of the function might be:
newNearestFunction = ReplaceElementNearestFunction[nearestFunc, {i->{x,y,z},j->{x,y,z}}]
POSTED BY: W. Craig Carter
ISO WEEK YEAR NUMBER & WEEK DAY NUMBER
In DateString and DateList, an old request that I still miss in version 10, very common in financial marketing and another business, is ISO Week Number Date related functions (standard in Oracle and SQLServer).
- Given a date, what is It ISO Week number and iso week year.
Another functions to do the inverse operation would be nice too. For example, Week 04/2014 -> {{2014, 1, 20}, {2014, 1, 26}}
A week day number options ((1, 2, 3, 4, 5, 6,7) for (sun mon tue wed thu fri sat)) would be also welcome. Today we have "DayName", "DayNameShort", "DayNameInitial" but not some "DayNumber", very usefull for calculations.
POSTED BY: Rodrigo Murta
Again, this is not about adding new functions but improving existing functionality.

I would like to see RLink improved!  In particular, I would like to see it (better) support external R installations and support this more seamlessly.  It should be possible to set it up to always use a particular external R installation by default (currently this is rather difficult to achieve), external R should be officially supported on all three platforms and it should support the latest R version (R 3.0).

Why Would a Mathematica User Care about R?

Quoting from this blog entry,
... with RLink I now have immediate access to the work of the R community through the add-on libraries that they have created to extend R into their field. A great zoo of these free libraries fill out thousands of niches–sometimes popular, sometimes obscure–but lots of them. There are over 4,000 right here and more elsewhere.

The only problem is that this was not really so at the release of v9, as on OS X and Linux neither external R installations were officially supported, nor package installation (!!).  And there's not that much in the base R distribution that I'm interested in as a Mathematica user, all the advantages would come from installing third party packages.

The result is that not many people seem to be using RLink despite its huge potential.  Later it turned out that there are ways to get it working on OS X and Linux but it's not in the documentation how to do it and it doesn't always work.

RLink is an excellent system, it has great potential and clearly a huge amount of work went into it.  It is a great pity that it misses that tiny little last step that could make it usable and useful for everyone.  I'm really hoping that WRI is not going to abandon it and the necessary improvements (which are really just the few little things I mentioned above!) will be made for the v10 release.

Every time I recommend IGraphR to someone, their biggest barrier to using it is getting RLink working on their system with an external package first, then the extra setup needed each time before loading IGraphR.
POSTED BY: Szabolcs Horvát
Matt, I agree that we need a reliable means of cleanup.  I've been wanting this for a while and here's a related thread.  There's a helpful undocumented function called Internal`WithLocalSettings, but it's said to be not 100% reliable.  I use it sometimes.  This undocumented function is an essential element for implementing something like JavaBlock[].

This is also related to my earlier suggestion (above) for a hook into object destruction. There I wrote that the best solution that's currently possible is an analogue of JavaBlock.  But JavaBlock also relies on the undocumented WithLocalSettings.  So I'd say that this functionality is very important for package developers (even if end users would rarely use it).
POSTED BY: Szabolcs Horvát
Posted 11 years ago
@Sander:

Yes, you can obviously make it work, but the results tend to be verbose and clunky. One of the things I like about Mathematica's regex functionality is that it supports both traditional regex syntax (which for simple cases is compact and clear) and also a more verbose, but abstract Mathematica DSL that expresses the same thing using familiar Mathematica syntax. I'd love to see the same sort of flexibility in string formating.

@Szabolcs:

That looks like a step in the right direction, but misses the easy number formatting of printf. 
POSTED BY: Matt Pillsbury
Matt, there's the new StringTemplate in v10, which, unlike StringForm, actually returns a string, and accepts named palceholders.
POSTED BY: Szabolcs Horvát
@Szabolcs
True, for such things it behaves very differently. But I think for most cases people use With, Block and Module almost interchangeably...
POSTED BY: Sander Huisman
@Matt:

Why not use ToString[ , ] incombination with ScientificForm, NumberForm, EngineeringForm, PaddedForm, AccountingForm, BaseForm ? That should solve most cases right?
POSTED BY: Sander Huisman
Posted 11 years ago
I also would like a Printf which uses C-style printf strings for formatting and returns actual strings. StringForm returns wrapped objects, which isn't a big deal, but is much more limited than Printf in key respects (there's no real way to control how numbers are displayed). Right now, you have to do something like use J/Link, which is slow and not terribly pleasant.
POSTED BY: Matt Pillsbury
Posted 11 years ago
I'd like a function that provides reliable clean-up functionality in the face of non-local transfers of control. Something that like finally blocks in Java, or UNWIND-PROTECT in Common Lisp, or like destructors implicitly do in C++. An example would be:
With[{stream = OpenWrite[]},
    Cleanup[
        (* some stuff *),

        Close[stream]]];
Whatever (* some stuff *) might be, including if it has Return[], or Throw[], or if someone uses an Abort[] in the middle of it, I want to be sure that Close is run, to the extent possible within Mathematica's semantics. 
POSTED BY: Matt Pillsbury
Sander and Terrence, it's not about performance.  With[] and Module[] serve different purposes.  Consider With[{a=1}, Hold] and Module[{a=1}, Hold].  With[] is a good way to inject something into a held expression.  Suppose you're building a Function object dynamically.
POSTED BY: Szabolcs Horvát
Is there a big performance-gap between Block / Module and With? I never noticed that this is major. Maybe if you have many many small tasks it will make a difference?!
POSTED BY: Sander Huisman
Hi Terrence Honan, meanwhile you can use this implementation by Leonid, that do exactaly what you wants.
POSTED BY: Rodrigo Murta
What I have wanted for a long time is new functionality for the With command. Using With one can't define a constant in terms of another constant in the same With.  I end up with many levels of embedded With commands.  I would like to see a generalized form of With like this:

With[ {blah1,..}, {blah2,...}, {blah3,...}, expr ] = With[ {blah1,..}, WIth[ {blah2,...}, With[ {blah3,...}, expr ]]]

It should be defined for any number of levels.  A recursive definition: With[ {blah1__} , {blah2__}, expr__ ] := With[ {blah1}, With[ {blah2}, expr]

Clearly, one can avoid such embedding with Block and Module, but it is wasteful to define a variable when a constant will suffice. 
POSTED BY: Terrence Honan
I'd like to see something like UnitStep that returns 0 for 0, while being just as fast as UnitStep and not unpacking arrays. (Right now UnitStep[0] == 1.)  Maybe this could be an option to UnitStep.

Motivation:

Vectorization and always using packed arrays is a  good way to speed up computations.  I'm talking about this style of programming: (1)(2).

When programming like this, it's often necessary to transcribe inequalities in terms of UnitStep.  For example, the sum of all numbers greater than or equal to 5 in 'list' can be computed as 
Total[list UnitStep[list - 5]]

This is typically much faster than Total@Select[list, # >= 5 &], depending on the distribution of the numbers in list.  While this is a very simple example, generally, the techinique is useful.  Unfortunately it is also very cumbersome.  Suppose we're looking for the number strictly greater than 5.  What then?  We will need to use 
(1 - UnitStep[5-list])
instead, which is still simple, but just too much of a mental effort to think up without making a mistake.  This is the problem I'd like to see a solution to, or in general, make it more convenient to vectorize calculations.

Of course I do realize that it's trivial to define one's own function for this, or create a package.  It would be nice to have it built-in nevertheless.
POSTED BY: Szabolcs Horvát
Another suggestion is a function to get function information. I have wrote about this in some place in the community that I can't find.
Something like, FunctionData[funcionName_], and it could retrive: Mathematica version of implementation, Attributes (that are sometime protected).
This should be a simple way to work with version compatibility and select all new implemented functions of some version.
POSTED BY: Rodrigo Murta
Pedro Fonseca, very nice requests.
POSTED BY: Rodrigo Murta
- official function to pick up, from an existing/generated Graphic, its different internal components, avoiding things like: Plot[...][[1]]
(including a function to illustrate its structure in a kind of graph view of its contents/definition)
POSTED BY: Pedro Fonseca
This is of minor importance but being able to plot from  0  to  Infinity  (via a  Tan  transformation or something similar) would be occasionally convenient.  For instance, given
Integrate[f[x], {x, a, Infinity}]
copy it and change Integrate to  Plot  just to get a quick visualization:
Plot[f[x], {x, a, Infinity}]

It would be more or less equivalent to
Plot[f[a + Tan[Pi t/2]], {t, 0, 1}]
with  Ticks  automatically set.

Similar it could be extended to plotting from  -Infinity  to  Infinity.  There could be issues with determining how fast to approach  Infinity  (e.g. what value of  x  corresponds to  t = 0.5).
POSTED BY: Michael Rogers
- be able to name and give order to input fields and other interface objects, so to jump between them in the desired order, or to go directly to a given object
- easy way to avoid shift+return or enter to mess up interfaces like input fields (so that I don't need to say " You're pressing it wrong")
POSTED BY: Pedro Fonseca
- raytracing (or better/more automatic integration with pov ray or other)
- bump mapping
- natural management of subscripted variables (already mentioned, but I insist)
- drag and drop dynamic objects (to build interfaces like system modeler)
- persistent data and "interface" tabular object (meaning excel like object)
POSTED BY: Pedro Fonseca
Yes another suggestion, which is not strictly about adding new functins, but about improving existing functionality:

Mathematica's philosophy is that the user should be able to input a simple request and be able to get a result automatically, without needing to either care about how that result is obtained or needing to fuss with details.  This can indeed be quite useful when getting familiar with a functionality area or doing quick calculations.  Many functions, such as NIntegrate, will automatically choose a good method to use internally, and will just work and give a result.

However, sometimes the heuristics used for automatic method selection will intevitably fail, and it will be necessary to better understand the available methods and fine tune them.  Some functions make this possible, and NIntegrate is a very good example: it even provides a framework for extending it with ne methods.

What I would like to suggest is three things:
  1. Make it more transparent what happens when methods are chosen automatically.  Make it possible to find out which method was chosen by the system.  Make all the values of the relevant suboptions accessible.
  2. In general, document Method options better!  Some functions/functionality, such as numerical integration or unconstrained optimization are quite well documented in "advanced tutorials" (though I wish that subsections of these tutorials were more thoroughly references from the doc pages of the actual funcions).  But some other areas of complex functionality, such as graph drawing, are not nearly as well documented.  It is typically difficult to find out what are all the available Method options and suboptions for many different functions.
  3. Provide more fine control!  I would like to see more optional fine control, e.g. for graph drawing, accompanied by more advanced documentation.  Keep the default on Automatic, but let is fine tune the layout methods better.
POSTED BY: Szabolcs Horvát
I Agree with Szabolcs. De Graphs are so important in alot of areas that we should have more stabilty there. Don't want to start a me to thread but just want to give a little support.
POSTED BY: l van Veen
Posted 11 years ago
Two improvements in help messages.

In Dsolve and NDSolve it is not uncommon to see the following misunderstanding
DSolve[y'[x]==3*y,y,x]
where users seem to usually get the notation correct for derivatives, but then use the function without the [ x ], probably because of textbook notation.

If the help system would do a scan for "bare" function names and print out a very explicit help message with exactly the name that needed to be modified and how then this would keep the system from knowing exactly what was wrong, but not explaining it to the user.

Similarly, in NDSolve, and other N* functions, it is not uncommon to see the following misunderstanding
NDSolve[y'[x]==q*y[x],y,{x,1,2}]
where the symbol q has not been assigned a constant numeric value.

If the help system would do a scan for symbols which did not have assigned constant numeric values and print out a very explicit help saying exactly what symbol name needed to be assigned a value then this would again keep the system from knowing exactly what was wrong and printing some unrelated message about some non-numeric value at some meaningless numeric value.

The system should have all the needed information already evaluated to be able to do a quick scan for both of these just before it wades off into trying to find the real solution.

Both these problems are seen again and again.
POSTED BY: Bill Simpson
One improvement I would really like to see is fixing up the Graph-related functions, especially the property API.  It's rather unpredictable and there are lots of serious usability functions, which mostly come up when one would use SetProperty and related functions.  I'm not going to hijack this thread by describing examples, but I'm sure people who've used these functions have encountered them ...
POSTED BY: Szabolcs Horvát
I think that OrderingBy is not necessary.  It it were to be analogous to SortBy then OrderingBy[list, f] would give exactly the same output as Ordering[f /@ list], which can even be changed to
Ordering[f[list]]
for better performance is f[] is one of the optimized listable functions.

(Sorry about the code block, the editor mangles what I wrote otherwise.)
POSTED BY: Szabolcs Horvát
<s>Completely agree with the delaunay triangulation and convex hull; it is VERY slow compared to other packages. Rendering it useless for practical things!</s> huge improvements since version 10.

<s>OrderingBy: Like the entire family: Sort/SortBy, Gather/GatherBy, Split/SplitBy</s> not so useful indeed...

AxesScaling:  An option for ALL the plotting-functions (Plot,ListPlot,ContourPlot, DensityPlot, ParametricPlot et cetera and their 3D variants) that specifies the Axes to be Linear/Log/Date/Custom: AxesScaling -> {"Linear","Log","Log"} would result in a 3D plot with lin-log-log scales. Now you have to do everything manually by renaming ticks and rescaling coordinates (total mess).

<s>Please fix the logarithmic ticks: if it spans many orders of magnitude it will do 10^0,10^2, 10^4 et cetera. That is not too bad; the worst is is that it creates 8 subticks between them! They really have no meaning then!</s> fixed since version 10.

Local unit recognition; over the internet is just too slow. Just put it as a paclet like many components, so it is updatable.
POSTED BY: Sander Huisman
Posted 11 years ago
Unit were a welcome addition to mathematica, but a pain to use.
Please add a "Units Palette" as part of the standard distribution.
POSTED BY: David Keith
Posted 11 years ago
S M Blinder, I saw this attempt at LogSlider. It only produces one-way behavior though (dragging the slider changes the value, but changing the value doesn't move the slider). Here is a simple start for LogSlider that produces the two-way behavior we'd expect. I'll put it as a stub for "Slider (computing)" on Wikicode tomorrow, so it can be collaboratively expanded.
LogSlider[Dynamic[x_], max_] :=
Slider[Dynamic[Log[max, x], (x = max^#) &]]

{LogSlider[Dynamic@x, 10^6], Dynamic@x}
POSTED BY: Michael Hale
Parallel as an option to some functions?

After posting this, I remembered that there are the ParallelTry, Paralellize  functions. However, I wonder if some functions might have internal parts that could be paralellized, but for which Parallelize[_] might not work.

I don't know if this is true, but I imagine there are cases in which some functions may be parallelized.  For example,
FindClusters[__, TryParallel->True] 
or
NDSolve`FiniteDifferenceDerivativeADerivative[__,TryParallel->True] 
would launch kernels if possible and speed up computation.

I also wonder if TryGPU might be an option for some functions as well?
POSTED BY: W. Craig Carter
Posted 11 years ago
Make Solve and other similar functions "MatrixForm", and perhaps even "*Form" where it makes sense, aware so that people who cannot resist the compulsion to desktop publish their inputs only to then post asking why they then cannot get useful and correct answers out of Solve and other similar functions. If the function gets a *Form input then just strip off the *Form and see if it can the produce a correct answer. This should be a very small programming task.
 In[1]:= Solve[MatrixForm[{{1, 2}, {3, 4}}].MatrixForm[{x, y}] == MatrixForm[{7, 9}]]
 
 Out[1]= {{\!\(\*TagBox[RowBox[{"(", "", GridBox[{{"1", "2"},{"3", "4"}},GridBoxAlignment->{"Columns" -> {{Center}},
  "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}},GridBoxSpacings->{"Columns"->{Offset[0.27999999999999997`],
  {Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {Offset[0.2], {Offset[0.4]}, Offset[0.2]},
  "RowsIndexed" -> {}}], "", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]]\).\!\(\*TagBox[RowBox[{"(", "",
  TagBox[GridBox[{{"x"},{"y"}}, GridBoxAlignment->{"Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}},
  "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> {Offset[0.27999999999999997`], {Offset[0.5599999999999999]},
  Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {Offset[0.2], {Offset[0.4]}, Offset[0.2]},
"RowsIndexed" -> {}}],Column], "", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]]\) -> \!\(\*TagBox[RowBox[{"(", "",
TagBox[GridBox[{{"7"},{"9"}}, GridBoxAlignment->{"Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}},
"RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> {Offset[0.27999999999999997`], {Offset[0.5599999999999999]},
Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {Offset[0.2], {Offset[0.4]}, Offset[0.2]},
"RowsIndexed" -> {}}],Column], "", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]]\)}}

In[2]:= Solve[{{1, 2}, {3, 4}}.{x, y} == {7, 9}]

Out[2]= {{x -> -5, y -> 6}}

There is no need to complicate the task by keeping track of whether *Form has been removed and try to restore that after the calculation, the user can easily add a //*Form to the end of their calculation if they wish. All that is needed is to list every function in Mathematica that would be broken if they are given a *Form and strip that before they begin. This would only try to begin to fill one gap between desktop publishing and the rest of Mathematica.
POSTED BY: Bill Simpson
Sliders with a logarithmic scale.
POSTED BY: S M Blinder
DataArray and DataStore functions as described by Wolfrm back in 2011-2012 please.
POSTED BY: Carl Lemp
I'd like a function analagous to Array that creates subscripted variables rather than indexed variables.
POSTED BY: Frank Kampas
I agree completely with the prior comment about improving ease of use with Graphics.  I know this isn't a single function (as the thread indicates), but I use Mathematica mainly to write interactive demonstrations and documents for my classes, and I find great difficulty in getting graphics to look the way I want without a surprisingly large amount of work, compared with the relative efficiency of much of the rest of the system.  Also, on more than one occasion, the program has crashed while I have been adding text boxes to graphics, etc.
POSTED BY: Rob Holman
Posted 11 years ago
Export of 3D primitives and their boolean combinations to STEP and SAT would be nice. These are universal agnostic formats for transfer between CAD environments.
POSTED BY: David Keith
Some very basic integration between CDF Manipulate controls e.g. Buttons and the hosting html page.
POSTED BY: William Stewart
Export of unmeshed BSplineSurface and graphics primitives such as Sphere to a CAD file format such as Rhino's .3dm 
POSTED BY: W. Craig Carter
A convex hull function that works in dimensions>= 2 and doesn't always triangulate (e.g., the same functionality as qhull)
POSTED BY: W. Craig Carter
Posted 11 years ago
Improve the support for keyboard input! CurrentValue should be able to read more than just the modifier keys. The current support for only KeyDown events makes it very hard to make keyboard based controls for games. Sharing games with CDF is one of the best ways to get new people interested in Mathematica. I spent the first several years of teaching myself how to program by making two-player keyboard input games. Friends in my high school classes loved playing them. My school didn't offer any programming classes, and when I started an after school club for programming all people wanted to do was learn how to make games.

Mathematica is the only language I've ever used to make a result to show to someone else that doesn't support this functionality. Don't get me wrong. I love that I'll be able to read input from a DIY mass spectrometer in WL, but if you write your code on a keyboard, you need to fully support getting input from it. I don't have any data, but every second of my life tells me that for every student that wants to build a home weather station, we could gain ten users from students sharing games they make with their classmates.

Yesterday, I saw one of my friends from internships and the college programming team was making a game with Elm to practice reactive functional programming. I thought, "Hey, I'm making a Spacewar clone in Mathematica right now. I can probably sell him on Dynamic as opposed to Elm's lift and get him to install the CDF player, but I can't make a natural feeling input scheme for the Spacewar clone!"

I say this needs to be fixed or Elm or whatever the latest open-source startup language with a non-mainstream idea and a small library will eat Mathematica's lunch. I've got a boat to catch. I'll get caught up in a week. Here's the start of the Spacewar code if you want to try to make turning controls that don't jitter.
 t0 = AbsoluteTime[]; dt = 0; {width, height} = {600,
   400}; stars = {White, PointSize@Tiny,
     Point@Transpose@{RandomReal[#, #3],
        RandomReal[#2, #3]}} & @@ {width, height, 30}; ship1 := {White,
    Line[4 {{{0, -3}, {1, -1}, {1, 1}, {0, 3}, {-1,
        1}, {-1, -1}, {0, -3}}, {{1, -1}, {2, -2}, {2, -3}, {1/
        2, -2}}, {{-1, -1}, {-2, -2}, {-2, -3}, {-(1/2), -2}},
      If[CurrentValue[
        "ShiftKey"], {{1/
        2, -2}, {0, -4}, {-(1/2), -2}}, {}]}]}; {position1, velocity1,
   angle1} = {2./3 {width, height}, {0, 0}, 0}; EventHandler[
Dynamic[(dt = # - t0; t0 = #) &@AbsoluteTime[];
  If[CurrentValue["ShiftKey"],
   velocity1 += 20 {-Sin@angle1, Cos@angle1} dt];
  velocity1 += (10^5 Normalize@#/(Norm@#)^2 dt &)[{width, height}/2 -
     position1];
  Graphics[{stars, {White,
     Translate[Line[{#, -#}], {width, height}/2] & /@
      RandomReal[{-10, 10}, {2, 2}]},
    Translate[Rotate[ship1, angle1, {0, 0}],
     position1 = {Mod[#, width], Mod[#2, height]} & @@ (position1 +
         velocity1 dt)]}, PlotRange -> {{0, width}, {0, height}},
   ImageSize -> {width, height},
   Background -> Black]], {"LeftArrowKeyDown" :> (angle1 += 10 dt),
  "RightArrowKeyDown" :> (angle1 -= 10 dt)}]
POSTED BY: Michael Hale
I would like a built-in function which verifies is a degree sequence is graphical, i.e. the same as Combinatorica`GraphicQ without the $RecursionLimit problems that Combinatorica function has.  This functionality must already be present in the kernel in some form for use by DegreeGraphDistribution, but it is not publicly accessible.
POSTED BY: Szabolcs Horvát
This is not a suggestion for a new function, but for some new functionality:  a hook into object destruction.

It's possible to extend Mathematica using C through MathLink or LibraryLink.  Sometimes it's necessary to have some data structure on the C side and make it accessible in Mathematica.  In this case it is necessary to have an explicit function for destroying these data structures on the other side, just like in low level languages that don't have automatic memory management or garbage collection.  This is somewhat inconvenient.

Examples are TetGenDelete (from TetGenLink) and ReleaseJavaObject/ReleaseNETObject (from JLink/NETLink).  Java does have garbage collection but the moment Java objects are made accessible from Mathematica it can't work automatically and it becomes necessary to destroy objects explicitly.

The best idiom I know for handling this situation is JavaBlock.  (One can implement something similar for any library that has its own data structures.)  It's much nicer to use than explicit free functions, but it's still not awfully convenient.

I wish Mathematica has a hook for expression destruction to make it possible for  the free functions to be called automatically.  I'm not sure how this would work, or if it's even feasible, but it would be very useful.  The fact that even the JLink developers decided on using JavaBlock instead of adding this hook into the kernel makes me suspect that it is not at all a trivial matter.
POSTED BY: Szabolcs Horvát
DropWhile is easy to implement as Drop[#, LengthWhile[#, ...]]&.  Generally I'm against having too many basic functions, as Mathematica already has plenty.  But in this case I agree that DropWhile[] would be very nice to have.  Since we already have TakeWhile and LengthWhile, DropWhile would be a very natural addition, and I'm sure many people have looked for in the docs just because they new about the other *While functions.
POSTED BY: Szabolcs Horvát
Hi Luc,
Maybe StringMatchQ["teste", "t*"] can be used in place of StringStartsWithQ ?
How would this works?
POSTED BY: Rodrigo Murta
Posted 11 years ago
- DropWhile
- StringTake with argument that do not generate an error if the string is too short
- StringStartsWithQ

some version of Row and Column that have the same syntax and options, or an tutorial explaining why they don't

 
POSTED BY: Luc Barthelet
Posted 11 years ago
I'd like to see CompilationTarget->"C" with Compile, which means actually CCodeGenerator to be available on ARM
or Raspberry-Pi...however.

I don't see what complications it involves to support the package on this platform, but there might be
a deeper reason why. If someone can enlight me I'd be rather thankful.
POSTED BY: Stefan Schwarz
Functions dedicated to elliptic curve cryptography especially curves of the form y^2 = x^3 + a x + b for several pairs {a,b}

e.g. Objects Secp[256k1] could be equivalent to EllipticCurve[0,7] and represent the locus of points on y^2 = x^3 + 7

e.g. Char[Secp[256k1]] = 2^256 - 2^32 - 977
Then you could do a lot with tables or plots...without really checking my syntax...here's an example

ListPlot[ Flatten[
                Table[Table[  
                                Base58[
Char[  EllipticCurve[i, k] , {k,1,10}] {i,-10,40}] ] ]] ]

• PubKey -> PrivKey complexity order estimations, and other functions

e.g. CrackTime[pubkey, curve, speed...] = 10^897 years (ok, safe key...)

e.g. ValidKey[pubkey, privkey, Secp[256k1]] = True would verify a keypair

• emulate parts of keypair exchanges to examing faults

e.g. SignMessage[<message>, <type...]

e.g. SharedKey[EllipticCurve[0,7], <secret>, <modulus>]

• Hash pre-image time complexity computations

e.g. CrackTime[SHA512, <string>, ...]

• String Entropy
Complexity[<correcthorsebatterystaple>] = ...

• Rainbow tables

• Base58 encoding support and in general greater fluency in integer representations

So, so, so much could be done.  I just rattled this list off the cuff. If there is interest I will put more thought into exactly what would be excellent and write it up formally.
POSTED BY: Allen Majewski
A very simple addition to ExampleData: icon images.

open, close, process, new, add, remove, delete, warning, attention, error, etc
POSTED BY: Pedro Fonseca
Posted 11 years ago
I agree with the need for better control of ticks in graphics. But the need goes much further. While our ability to produce good graphics has improved with the recent releases, producing publication quality graphics for scientific journals is still a nightmare. Of course, you can do it, but only by generating an entire page of complicated scripting of graphics primitives.

I would like to see Wolfram take this issue seriously. A good start would be to look at available tools such as Igor Pro 6, SigmaPlot, and Origin -- and commit to producing a competetive capability within Mathematica. These tools also provide data analysis capabilities, but Mathematica already excels at this. All it lacks is the ability to make good presentation graphics.
POSTED BY: David Keith
Posted 11 years ago
What I really need almost every day and what is missing in Mathematica for many years is built-in user-friendly ticks generation function. The CustomTicks` package is not sufficiently flexible and easy to use. And why we even have no such functions as LinTicks and LogTicks built-in?! Also we still have no way to control the distance between the ticks and tick labels and between tick labels and frame labels (this distances often are too large by default). All this functionality is crucially important for creation of aesthetically pleasing graphics for publication purposes but up to this time a user must spend a lot of time fighting with extremely user-unfriendly Ticks option and finally anyway cannot achieve the desired appearance.
POSTED BY: Alexey Popkov
I would like to see a high quality and fast Delaunay triangulation algorithm included as a built-in function.  Constrained Delaunay triangulation should be supported.  Something akin to TetGenLink, but for 2D, would be very nice.

The function from the Computational Geometry package is implemented in Mathematica and is much too slow for many real-world applications.
POSTED BY: Szabolcs Horvát
Posted 11 years ago
A pointer in various, perhaps new, warning messages returned by Solve and relatives to a concise tutorial that explains how to decide what function other than Solve might be more appropriate for the problem that was just given to Solve.
POSTED BY: Bill Simpson
Posted 11 years ago
A pointer in the various error messages returned by DSolve and and similar functions to a tutorial that explains how to provide all the various forms of initial and boundary conditions to obtain satisfactory solutions. 
POSTED BY: Bill Simpson
Posted 11 years ago
Novice mode, possibly even on by default, but easily able to be turned off by those who cannot accept having their likely typos pointed out, which would provide help messages to explain, especially to novice users, how Mathematica's expectations differ from their expectations. This would give clear specific help messages, as opposed to the current messages, which would explain what a novice almost certainly needs to change in their input. This would include help for users who have become convinced they must desktop publish their input to Mathematica.
Highlight the "offending characters" in red, perhaps even blinking red, to direct attention to exactly where something needs to be changed. While most new users don't seem to write long lines, having the attention focussed on one or a few characters would greatly help. I can recall years ago writing some longer and more complicated expressions and staring at them trying to understand exactly where in that line the message I was supposed to focus my attention.
If it could be possible that this be driven by a user readable and possibly even editable, by advanced users, database of rules then this might open up opportunities to experiment with enhancing this. Initially covering really really well the top few dozen most common misunderstandings by new users might help new users scale the learning curve much more rapidly.
POSTED BY: Bill Simpson
Posted 11 years ago
Unify[ notebookfile, notebookfile] which does a Prolog style, but Mathematica aware, unify of two notebooks, showing the minimal changes needed to make the two identical.
Diff[ notebookfile, notebookfile] which does a Unix style, but Mathematica aware, diff of two notebooks, showing the minimal differences between two notebooks.

Both of these would be very useful in trying to expose the changes that have been made over time to a sequence of notebooks.
POSTED BY: Bill Simpson
You can do the calc just like this:
Scan[If[#[[1]] > 0.8, Return[#[[2]]]] &, MapIndexed[{#, #2} &, list]]

But for a big list, this is a waste of memory too, to apply MapIndexed to it, just to create a index.
You can of couse use a For with Return, but I don't feel it's a nice WL code approach.
POSTED BY: Rodrigo Murta
Rodrigo, what are your comments on MapIndexed versus ScanIndexed - any great advantages there?
POSTED BY: Sam Carrettie
Posted 11 years ago
David, thank you so much emoticon.
POSTED BY: Jacob Akkerboom
Posted 11 years ago
Hi Jacob,
Union[] will give a sorted list of the unique elements in its argument.
Best, David
POSTED BY: David Keith
I'd like to see ParameticFindMinimum which would enable running the same optimization problem with different starting points over and over again without setting up the problem each time.  There already is ParametricNDSolve, which enables repeated solutions of the same differential equation with different parameters values.
POSTED BY: Frank Kampas
Posted 11 years ago
I would like to see an option DeleteDuplicates for Sort.

I have made my own library that implements a function that does the same as DeleteDuplicates, for sorted lists (as it is, it only works for integers). See this. For the case I tested it on it was about twice as fast as DeleteDuplicates.

But having the option to delete duplicates while sorting would be even nicer and it would make that library much less "needed".
POSTED BY: Jacob Akkerboom
Posted 11 years ago
I've been working on a list of potential library extensions that would not go in the System namespace as part of Wikicode.
Wikicode to-do list


I was going through implementing stub packages for various articles, but I figured I could get a handle more quickly on larger design issues if I just started making a big to-do list. I'm browsing through articles by how close they are to root categories and how popular they are. I'm looking for data visualizations, models, tables, etc that aren't currently in Wolfram Alpha and that could currently be implemented in a page of code or less. Over time, the sophistication of what can be implemented in a page of code will increase and we can build more complex models.

The code for each will go in the Wikicode package with the same name as the associated Wikipedia article. Packages can dynamically load other packages. Contexts are typically be based on the article title, but can be nested when necessary to prevent clutter. (e.g. "Economy of the United States" data might go under UnitedStates`Economy if UnitedStates gets too cluttered)

I've been asked what an item like "Aluminum: visual attributes as solid" means. For now, it would be convenient just to have named sets of graphics directives for color, transparency, specularity, etc. for common materials. So if I had a model of a soda can I could just put Aluminum`Material[] before it to quickly get something metallic looking. There are plenty of cool opportunities for using parametrized 3D color textures. For example, cutaway views of a simple strawberry model with adjustable size and randomized shape can be supported.
POSTED BY: Michael Hale
A class of functions that I would like to suggest is not a new one, but a extension of Scan function. Here are the function:
    ScanOuter
    ScanThread
    ScanInner
    ScanIndexed
Each one would have the same syntax use of their equivalent (Outer, Thread, ...), but with the same behavior as Scan, with much less memory consumption, due the fact that Scan don't have to "Save" all it results. Other advantage would be to use of Return inside, that opens the possibility to break computation at some moment.As an application example, sometimes I need to apply a function into all combination of to big groups, to take just some specific itens.
Let's simulate the lists using a RandomInteger, and Outer to simulate ScanOuter.
list1 = RandomInteger[1000, {10000, 2}];
list2 = RandomInteger[1000, {10000, 2}];
Reap[Outer[If[N@Norm@{##} > 1700, Sow[{#1, #2}]] &, list1, list2, 1]][[2]]
I believe that this kind of calculation would use much lass memory with the equivalent Scan function, that do not need to store each result.
The calculation above simple don't run in my computer (in less then 5 minutes), and should be almost instantly in ScanOuter.

Another nice application is ScanIndexed.
Imagine you want to know the position of the element, when it's > 0.8 in this list.
list={0.0314503,0.168573,0.291282,0.319608,0.426414,0.430967,0.626601,0.897033,0.923966,0.944242}
pos=ScanIndexed[If[# > 0.8, Return[First@#2]] &, list]
To to things like this today, you have to create a index variable, or use a While loop, what makes me very incomfortable inside WL paradigm.
ScanIndexed could some this in a more elegant way.
POSTED BY: Rodrigo Murta
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract