57,360 reputation
5139332
bio website
location ND
age 31
visits member for 2 years, 7 months
seen 22 mins ago

contact details

Visit Mathematica.SE


May
23
answered Is it possible to Import urls not type “”
May
23
comment Mapping multiple functions
The title is a bit misleading---here you are mapping a single function onto a list of functions.
May
23
comment String encoding issue with Pythonika
I wrote to the author once in the past but got no reply. If it will be the same this time, we should collect these fixes somewhere. I was also just playing with it and was planning to put it here (haven't pushed the changes yet).
May
23
comment String encoding issue with Pythonika
Excellent, thanks! (and +1 for the answer)
May
23
revised String encoding issue with Pythonika
edited title
May
23
reviewed Approve suggested edit on Is it possible to import data from Google Analytics?
May
23
comment String encoding issue with Pythonika
Anyway, can you please give a full but minimal example that reproduces the problem? Post the precise code that you used, but reduce it to the essentials (a few lines). I'll take a look then.
May
23
comment String encoding issue with Pythonika
It sounds like this is a Pythonika problem/bug in the C layer connecting Mathematica and Python. Have you contacted the author of Pythonika? I'd say the question is on the border of being off-topic ... Unfortunately Pythonika is a bit sloppily implemented. It is a useful package, but it's a quick and dirty implementation. It would take considerably more work to implement a proper link.
May
23
comment How can I conveniently call igraph through RLink?
Thanks to Leonid for showing me how to use an external R installation on Mac!
May
22
comment Why is StringExpression faster than RegularExpression?
I tried time pcregrep --buffer-size=100000000 '(?ms)(?:(?ms)\(ICD-9-CM (.+?)\))' test.txt >/dev/null with pcregrep 8.32. This doesn't replace, it only matches, so it may not be correct. It takes 0.09 s here.
May
22
comment Why is StringExpression faster than RegularExpression?
Do you know what the ?: means? (I don't.) Maybe this is something worth mentioning to support then?
May
22
comment Why is StringExpression faster than RegularExpression?
The answer might be in StringPattern`PatternConvert[re]... which is not the same as re.
May
22
comment Why is StringExpression faster than RegularExpression?
I think you have v7. Just mentioning that it's the same in 9 too.
May
22
comment Optimizing functions taking matrix arguments
Return is not needed here and you can also drop the ;. This is not just nitpicking: while in this particular example it does not make a difference if you use it or not, when used inside some functions, it will return from those functions and not from your function.
May
22
comment Telling mathematica to output * instead of space for multiplication, so I can copy as plain text
For MATLAB, use what rm said. For C, use CForm.
May
20
comment At what point should MLSetMessageHandler() be called?
@ToddGayley I noticed now that the output of mprep has MLMDEFN( void, MLDefaultHandler, ( MLINK mlp, int message, int n)) if MLINTERFACE >= 3, which seems to be the default for Mathematica 9. It has unsigned long otherwise.
May
20
comment At what point should MLSetMessageHandler() be called?
@ToddGayley I was not aware that I need to send Abort[] explicitly when the return type is Manual, thanks for pointing that out!
May
20
comment At what point should MLSetMessageHandler() be called?
@ToddGayley I got the msghandler prototype from this documentation page. It uses int types. I checked mathlink.h as well, and if I followed the definitions back correctly (it's easy to make a mistake with all the #ifdefs) then MessageHandlerObject is a MLHandlerUPP which is a MLHandlerProcPtr which is defined as MLMPROC( void, MLHandlerProcPtr, (MLINK mlp, int m, int n));. Are you sure that the arguments should be unsigned long?
May
20
comment At what point should MLSetMessageHandler() be called?
What I ended up with eventually was defining a function callable from Mathematica that set up the handler. I think I could also move calling this function into the template file.
May
20
comment At what point should MLSetMessageHandler() be called?
@ToddGayley and Leonid: Thanks! Otherwise does the handler look fine, calling stdhandler for everything except Interrupt and Abort? It was not clear to me which messages must be handled, and how.