Reputation
11,121
Top tag
Next privilege 15,000 Rep.
Protect questions
Badges
20 47
Newest
 Nice Answer
Impact
~98k people reached

Apr
8
answered A too complicated lookup
Apr
8
comment How to manage list of list of rules?
I think halirutans solution is about the best you can have for what you asked for, but I have hardly seen cases where transforming between strings and expressions is the best solution to a given problem as that has many potential problems. If you can explain what you try to do in the first place (probably in a new question) you probably will get a much better overall solution than what you are now building on this...
Apr
8
answered How to make function accept list of rules as an argument?
Apr
8
comment mathematica use too much memory to Import large dat file
One correction to my comment above: the content of the file will be about 170MB as is (mixture of integer and floating point numbers) and about 50MB when turned into a packed array of all machine floating point numbers. So the absolute numbers for my approximation of what would be a reasonable amount of memory need to be corrected to something somewhat higher, probably in the order of 250MB...
Apr
8
comment mathematica use too much memory to Import large dat file
... AND you should have in mind that for many import formats extra processes are started or the import is done via Java, and these extra processes or the java runtime has a memory usage which isn't covered by MemoryInUse or MaxMemoryUsed which only show the kernel memory usage. I'm not sure, but for the given text file format that might not be relevant. Of course you are right that this is not a bug, but that is not something anyone has claimed, but I think we agree that the memory usage could/should be improved...
Apr
7
comment mathematica use too much memory to Import large dat file
I understand that you'd not need 24 GB to import that specific file :-). But why do you propose that the import issue is not related to Mathematica itself? I'd think Mathematica using more than 1GB to import a 38MB text file is an issue that is very much related to Mathematica...
Apr
7
comment mathematica use too much memory to Import large dat file
@penguin77: meeting WRIs recommendations is a valid point, but I think OP has 2GB which at least almost meets those. My point is that any program which needs more than about 150MB to import a 38MB text file whose content will be much less than that in memory once imported has room for optimization. Data files of a few 100MB are very common for any kind of measurements these days, and these can't be loaded even when meeting WRIs recommendations. Unfortunately many potential users will consider Mathematica not fit for their purposes when they can't even import their data...
Apr
7
comment mathematica use too much memory to Import large dat file
I think that should be 1.24 GB not 1.24MB, which is much less than a fresh kernel needs on my machine? Anyway I think it is might not be very convincing that one needs a 24 GB machine to load a 38MB file with Mathematica in 38 sec. ...
Apr
7
comment mathematica use too much memory to Import large dat file
unfortunatly I'd consider this a "known problem". Many of the import functions do work but use an unreasonable amount of memory when the files get "large" (where something like 38MB by todays standards is far from large IMHO). My impression is that the default Import functionality is too general and tries to be too smart (that is auto-detect almost everything) and never has been decently optimized. The usual workaround, especially for text formats, is to use one of the lower level functions to write something specialiced as others have suggested and shown...
Apr
7
answered Using WhenEvent
Apr
4
comment Declare type in InputField
yes, for exactly this problem it seems to be a good solution. Unfortunatly it isn't easy to generalize for more complicated cases...
Apr
4
answered Declare type in InputField
Apr
4
comment What does CreateDirectory[] return?
I think you can get what CreateDirectory will return with ExpandFileName without actually creating the directory. For your example I think ExpandFileName[folder]===data should return True when the CreateDirectory was successful...
Apr
4
comment Draw and Quantity
Yes, it doesn't make a difference in this example, but if one uses the same units everywhere, then the use of quantities only adds overhead :-)
Apr
4
comment What does CreateDirectory[] return?
there might also other changes be done, see e.g. what CreateDirectory["c:/ttt"] returns on windows, I'd probably formulate that as "does not return what was input, but a normalized full path to the directory created"...
Apr
4
comment Draw and Quantity
I think it would be better to extract numbers for an explicit unit, otherwise mixed units will give unexpected results. In v10 that would be something like QuantityMagnitude[x,"Meters"], for v9 you'd need an extra call to UnitConvert...
Apr
4
comment Draw and Quantity
Honestly I don't think that it is worth to spend too much effort to understand/explain something like this. It simply reflects what WRI's programmers did implement, I think it would be possible to have graphics primitives accept quantities as well. If they don't but ContourPlot does then this IMHO looks somewhat inconsistent, but probably for good reasons (e.g. performance, consistency, compatibility...) and most probably has to just be accepted "as is"...
Apr
2
comment Parallel calculation with SetOptions
I think you will just need to do the call to SetOptions on every parallel kernel. You could do this either in ParallelDo as you suggested or use ParallelEvaluate, which is made for exactly such cases. A third possibility is to use the corresponding option directly in the call to NIntegrate, which is what I'd do because it probably is better to only use that setting where you actually need it instead of globally changing options for NIntegrate...
Mar
31
comment Package Function Confusion
I actually also think it is best to let the user provide the symbols which are used for x and y. The only reasonable alternative I know would be to use the special "formal" cahracters which are reserved for such purposes since version 9, they create symbols which are in the System context and protected. One can create them with shortcuts like Esc-$x-Esc or the special characters palette, but it probably is something which as to be explained to potential users of your function...
Mar
28
awarded  Revival