9,800 reputation
22149
bio website
location Munich, Germany
age 36
visits member for 2 years, 5 months
seen 32 mins ago

I work at a small mechanical engineering company, where I develop software and image processing algorithms for camera-based inspection machines.


Jul
15
comment How to get the indices of an Image3D that have a value of interest
Do you want indices or coordinates? PixelValuePositions[image, .5] returns coordinates. It's a lot faster than Position, tool
Jul
15
comment Is it possible to calculate with declarations only?
Any program can be expressed as a Turing machine, without functions or variables, only states and a (potentially) infinite tape. I'm not sure if that's what you want, though.
Jul
13
comment Optimization Algorithm: ideas wanted
If you want to improve your question, show us a function that would "grade" different solutions, i.e. that would add up some distances, values, whatever, and the solution that gets the highest (or lowest) grade is the optimum.
Jul
13
comment Optimization Algorithm: ideas wanted
As it's stated, I think the optimal solution is to move the max in each row to the middle of the row. That way, no value is more than 2 rows away from the maximum.
Jul
13
comment Dynamic with RegionNearest keeps one CPU core at 100% - Is this a bug?
I reported this as a bug to WRI. I also found a reproducible way to crash the kernel using Dynamic, reported that too
Jul
12
comment Swap elements in list without copy
Did you try playing with the numbers? I find it hard to believe that Mathematica can copy a 8 GB list 100.000 times in less than 2 seconds. With a GHz CPU, it should take about a second (order of magnitude) to copy it once.
Jul
12
comment Swap elements in list without copy
But would it also copy the list if no other symbol referenced it? Otherwise, how do you explain @eldo's timing results?
Jul
12
comment Swap elements in list without copy
You could even get rid of the temp write: swap[list_, a_, b_] := {list[[a]], list[[b]]} = {list[[b]], list[[a]]}
Jul
12
comment How can I find out where a key binding is coming from?
@mfvonh: I just realized that my question was only half true: I did find another KeyEvent["9", in the same file, mapped to CreateInlineCell. I commented that out already - but it still seems to be active. Sadly, these EventTranslations seem to be completely undocumented.
Jul
12
comment Can you make the new “Choose color scheme” helper larger?
@Öskå: I thought questions regarding the current version don't get a version tag? That's how it was handled e.g. on this question: mathematica.stackexchange.com/q/15338/242 (version tag for version-9 was removed by rcollyer)
Jul
12
comment Can you make the new “Choose color scheme” helper larger?
Great! I can make the list longer by replacing ImageSize -> {Full, {200}} with ImageSize -> {Full, {600}} in 3 places (for gradient, indexed and physical). But I can't simply make it multi-column, because ListPicker doesn't support that.
Jul
12
comment Dynamic with RegionNearest keeps one CPU core at 100% - Is this a bug?
@Nasser: It crashed my kernel a few times, too. But every time I restarted the kernel and executed the same code, it worked. So I have no code to reproduce that problem.
Jul
12
comment Dynamic with RegionNearest keeps one CPU core at 100% - Is this a bug?
@Nasser: My original code had a LocatorPane to move pt around, containing a Graphics that showed a line from pt to the nearest point, and a RegionPlot of the intersection. I've simplified it to find the root problem, and only posted that. You can imagine a Locator moving pt around somewhere else in the notebook, but it doesn't really change anything.
Jul
11
comment Can StringTemplate be extended to offer printf-like formatting capabilities?
@m_goldberg: Maybe that sentence was a bit snarky ;-) Anyway, I can see the reasoning of offering no string template functionality, at least for a compiled language. (I'm not sure how you would write a large-scale application that can be localized to a dozen languages, but that's not the point here.) But MMA has string templates. It's just missing formatting options. As far as I can see, that doesn't make it safer, only harder to use.
Jul
7
comment Can I use symbolic tensors for simple linear algebra and calculus?
@Szabolcs: I've noticed that Dt[f.g, x] is f.Dt[g, x] + Dt[f, x].g: MMA seems to apply the product rule to Dot, so I'd say the 1 in 1 . x should be the Jacobian D[x,x], i.e. IdentityMatrix. (Did that make sense?). So I could probably safely replace Dot[x_,1] -> x. But I can't get the transpositions right, because D doesn't seem to work with Transpose, Transpose doesn't distribute over sums and so on.
Jul
4
comment Why are functions called first-class objects in Mathematica?
@Eric: You can use Attributes[Set] to find out which arguments are evaluated: It has the HoldFirst attribute, so the first argument isn't evaluated. You could write Evaluate[{g, h, j}[[1]]] = 6, though.
Jul
4
comment Why are functions called first-class objects in Mathematica?
@Eric: I've added a new paragraph about how "variables" and "functions" are basically treated the same way.
Jul
4
comment Why are functions called first-class objects in Mathematica?
@Eric: I didn't doubt that you can parse the expression tree. A C programmer can parse expression trees, too. The point is: The C programmer will rarely handle expression trees at runtime, unless she's writing a compiler. In Mathematica, you handle expression trees all the time.
Jul
4
comment Why are functions called first-class objects in Mathematica?
@acl: The documentation is great once you get the computational model. But I must admit that I had a lot of trouble understanding it at first, when I started with all the (mis)conceptions about what expressions, functions and values are, coming from C++.
Jul
4
comment Why are functions called first-class objects in Mathematica?
Try to parse the expression x=(Sin + Cos)[a] - are Sin/Cos values or functions here? They're added like values, after all. Is Plus a function? Since it is "called" with [a]. Now call Through[x], and you'll get a perfectly sensible mathematical expression. Being able to manipulate expression trees like that is extremely useful.