This tag is intended for the review and improvement of style for already functioning code. It not meant to change the objective of the code.

learn more… | top users | synonyms

5
votes
2answers
728 views

How to create a simple interface to get file path and execute some code on it?

I need to create a simple user interface to choose one file in the notebook directory, import it and execute some functions on the imported data. For the first version I created this code: ...
14
votes
1answer
1k views

Poisson solver using Mathematica

I am looking for some help with a Poisson solver I am writing in Mathematica. The code is quite long with Arrays plugged in, so the full details can be found at http://pastebin.com/uSrSDcW6 I am ...
12
votes
3answers
668 views

Simpler way to fill date gaps with zero values

One basic problem when working with data like sales and dates is the case where you dont't have sales in all days, so you have to fill it to take information as average or to make a plot. See this toy ...
3
votes
1answer
322 views

How to improve this dynamic progress bar code

I created this progress bar to use in my codes: ...
26
votes
1answer
835 views

Fast Spherical Harmonics radiative transfer

This is a rather specific question and I apologize for spamming you with some lengthy code. But it could be interesting for some reader and maybe you can help out, so please bear with me. I am using ...
8
votes
2answers
774 views

Speed up Mathematica code involving Convolve

I'm trying to plot the averaged autocorrelation function of a random wire profile $\xi(x)$ which is build from unitsteps which are each L units long. To calculate the average I'm generating nMax ...
4
votes
1answer
246 views

Symbolic bit vectors

I'd like to see how addition and xoring bitvectors mix together. To do this, I implemented (a primitive) vec_add and vec_xor: ...
11
votes
2answers
600 views

What's the most “functional” way to do Cholesky decomposition?

I can do Cholesky in a procedural style, such as: ...
7
votes
4answers
607 views

Loop optimization

I wrote this to generate a 6D distribution of particles. ...
25
votes
7answers
1k views

Splitting words into specific fragments

I am looking into splitting words into a succession of chemical elements symbols, where possible. For example: Titanic = Ti Ta Ni C (titanium, tantalum, nickel, carbon) A word may or may not be ...