53,217 reputation
5148243
bio website mathprogramming-intro.org
location St. Petersburg, Russia
age 37
visits member for 2 years, 3 months
seen 4 hours ago

Ok, an obligatory note: opinions expressed here are mine and not those of my employer.


Apr
15
comment RLink Java(TM) platform has stop working
@WReach Thanks, I did not see the comment indeed.
Apr
15
comment Why are my recursive functions running so slowly? And how do I fix them?
+1. This reminds me of this one. Might even be considered a dupe.
Apr
14
comment Why are my recursive functions running so slowly? And how do I fix them?
In addition to @rasher's answer: I tried to compile some information on memoization here - you might find it useful.
Apr
14
revised Counting the number of instances of one sub-string within a given string within a lower- and upper-bound gap of a second sub-string
added 616 characters in body
Apr
14
revised Counting the number of instances of one sub-string within a given string within a lower- and upper-bound gap of a second sub-string
deleted 6 characters in body
Apr
14
answered Counting the number of instances of one sub-string within a given string within a lower- and upper-bound gap of a second sub-string
Apr
14
comment Counting the number of instances of one sub-string within a given string within a lower- and upper-bound gap of a second sub-string
In other words, it is not clear why you don't count the [2] and [3] as 2 counts in your first example (same instance of string2), but do count "11110001221" and "11110001221001221" as two separate counts later (same instance of string1). This looks inconsistent to me.
Apr
14
comment Counting the number of instances of one sub-string within a given string within a lower- and upper-bound gap of a second sub-string
Please provide a small specific self-contained test case, like "these are my input strings, and this is what I want to get". Without it, you make us construct such a case, and most folks here just don't have the time for that. Make sure your test case is small enough to be easily grasped, and non-trivial enough to catch the cases of interest to you. This will significantly increase your chances to get good answers.
Apr
13
comment Evaluating an expression assuming a value for a variable only in the local context
Use Block - that's exactly what it is for: Block[{q = x}, NIntegrate[x^2*q, {x, 0, 100}]].
Apr
13
comment RLink Java(TM) platform has stop working
But, this should clearly be considered a bug (I mean the crash), even if not an easy-to-fix one, since the end user could not care less which part of RLink is faulty. I will file it. This will probably not be the highest priority one, but if I ever get the time to deal with all RLink bugs wholesale, I'll see what can be done for it. Perhaps, if the problem is localized enough, it can be fixed by JRI maintainers. Or, I'll have to learn R's C bindings properly, which might not be a bad thing either.
Apr
13
comment RLink Java(TM) platform has stop working
+1. Thanks for this, your answer puts me to shame. I should've figured that out! A small excuse is that I didn't have the R installed on my current machine, and was running out of time at the moment. I was also thinking about JRI, but again, didn't have the time to check. JRI was useful as a short-cut to get cross-platformness for free, when implementing RLink, but it has its price.
Apr
13
comment Programming paradigm change
This is just great! A big +1. A truly beautiful post, and code. This is a must read for all Java (and C, C++, Python, etc) programmers coming to this site or otherwise getting interested in Mathematica.
Apr
13
comment Understanding Transpose
I think the OP had in mind the syntax with the second argument of Transpose, which allows complex array reshuffles for arrays of higher dimensions, rather than the (trivial) single-arg Transpose.
Apr
12
comment Equivalence under common permutations
@celtschk Welcome :). I noticed you're back after a long time, so I thought you should get an answer for this such as to not be disappointed. And I liked the problem, it's quite interesting. Actually, I think your question deserved way more votes, it's a really good problem to showcase Mathematica's capabilities for rapid prototyping and algorithm development.
Apr
11
comment What is the most efficient way to map a linked list?
Pretty cool of you to include the CPS version. No time now, but will study later (would up vote again if I could). I once posted something probably along the similar lines, here
Apr
11
answered Equivalence under common permutations
Apr
11
comment Creating a parallelizable DiscretePlot
@Mr.Wizard Very likely, V7 issue. Can't check, don't have V7 handy.
Apr
11
comment Solving a nonlinear, second order d.e. in Mathematica
@drN Sorry, but not really. This is not actually my field, I just toy with this every now and then (very rarely, in fact). I am mostly a programmer now. Most of the things I was doing in the past had explicit analytical representations. The numerical problems I was dealing with did not include stiff DEs, so I can only use some very general common sense here, but I don't possess any detailed knowledge of this area. Consider this a drive-by post :)
Apr
11
comment RLink Java(TM) platform has stop working
You have an interesting problem, and it seems to expose some problems with RLink which I don't yet understand. I'll look at it again later, probably tomorrow.
Apr
11
comment RLink Java(TM) platform has stop working
I am looking at it, and I do reproduce the problem, although I am doing this a bit differently. Will look more into this tomorrow, and see if I can think of something, unless someone else here does this first.