41,860 reputation
384178
bio website halirutan.de
location Leipzig, Germany
age
visits member for 2 years, 3 months
seen 1 hour ago

Although I'm quite familiar with Mathematica, I always try to keep an open mind and don't use it as golden hammer. I'm particularly good at things that are fun, for instance


19h
comment Measuring curve length on a binarized image
Unfortunately, the number of pixel is not comparable to the length of the curve. When you really have to measure something and you cannot be sure whether your measure is up to sqrt[2] off the correct length, then you shouldn't use it. The number of pixel is equal to the area of an object.
1d
comment ImageCapture on Windows 8.1
At least you get some effect. On my system Mathematica is telling me straight away "ImageCapture::notsupported: Image acquisition is not supported on Unix". I guess your best chance is to contact the support of Wolfram.
2d
comment Bizarre behavior of With, Compile and Break
+1 This issue is as awful as the type annotation with something like i=Most[{0}] inside Compile. Sometimes it would be better to cry difficulties out loud and document them instead of being silent and let users run onto ground.
2d
comment Bizarre behavior of With, Compile and Break
I guess this is even shorter but is the same basic problem of type inference.
Apr
15
comment Need to create a function to generate all permutations of Range[$n$]
@rasher Ah, sorry. I'm very bad with insider jokes when they are in a different language. You would have to explain this in detail to make me understand. I guess this is not worth the effort :-)
Apr
15
comment Need to create a function to generate all permutations of Range[$n$]
@rasher I'm not concerned about how quick you can create the list of permutations, but what he will actually do with it. If his algorithm working on each permutation is only a tiny bit non-trivial, the overall run-time will climb ridiculously fast.
Apr
11
comment What kind of check does DirectoryQ exactly perform?
I really like your detailed answers and extensive knowledge of low-level I/O. +1
Apr
11
comment Bresenham's line algorithm
@Kuba For me they are always equal when you switch p1 and p2 in either your or my implementation. Additionally, although the lines are not identical, but they are surely equivalent.
Apr
10
comment Bresenham's line algorithm
@Kuba OK, for the sake of brevity, I included an implementation of the original algorithm in my answer which satisfies your test-code:-)
Apr
10
comment Bresenham's line algorithm
@Kuba You are doing nothing wrong. For the Bresenham you need to ensure that you stay on the line and you have to do certain correction steps. It really was only a fun project where we recalculated everything by hand and for simplicity we took correction steps only in one direction. I will point out that this is not the original algorithm.
Apr
10
comment Converting truth tables to boolean expressions
It is not completely clear what your result should be. When you want to make a function out of your table, you could do it as follows: (func[#1] = #2) & @@@ table; and then you can easily call func[{1, 0, 1, 0}]. Does that help?
Apr
10
comment What kind of check does DirectoryQ exactly perform?
I don't have windows, but I like this question. I did some slight edits on your text to make it more conform with the site. What I can tell you from Linux, Unix and Mac is that disks or USB drives are always mounted to an existing directory (usually, some subfolder is created). Even my second (built-in) hard drive has a fixed mountpoint which is /home, a directory. It doesn't matter whether the hard disk is there or not.
Apr
10
comment How to protect functions in a Mathematica Package?
Which is unfortunately very bad if you actively developing and testing a package and need to really reload the complete code. Maybe you can add this information to your answer.
Apr
10
comment C Code generated from Mathematica not working?
You need to link the libWolframRTL during your compiling stage. I can create an executable from a slightly modified version of your source with this commandline. Remember that you don't need everything there, but you need to specify the position of the library and you need to tell -lWolframRTL. This can be different on Windows since I'm on Linux here!
Apr
9
comment How to make a recursive code from this iterative code? (drawing tree graph)
Can you elaborate more on what kind of graph you try to create? I thought I understood it but the output of {2,3,4} got me thinking.
Apr
8
comment Exporting graphics to PDF - huge file
@rogerl I (still) get exactly the same output as in my answer. I have tested it in M9.0.1 under OSX Mavericks.
Apr
4
comment Decomposing a large text file, with alternating headers and text, into an array of headers and an array of text segments
The OP wanted only the titles, but I hope he can adapt the example himself to his needs. In the current form it is always {title, body, title body,...} so a Partition[#,2] and a Transpose separates title and bodies easily.
Apr
4
comment Gray background in export pdf
Doesn't happen with M9.0.1 on OSX
Apr
4
comment Plotting 2D function and other 3D functions coincidently
@LePressentiment So you don't want a combined plot? Your 2d graphics can be obtained by ContourPlot[x^2 + (y - 1/2)^2 == 1, {x, -2, 2},{y, -1/2, 1}]]. The question remains, what do you want to do with this 2d graphic?
Apr
4
comment “Unflattening” a list
@LeonidShifrin I posted an alternative which hopefully doesn't leak any more. Thanks for pinging me on this!