« first day (267 days earlier)      last day (4214 days later) » 
00:00 - 21:0021:00 - 00:00

acl
12:01 AM
(if you have something to suggest, I don't expect you to go and come up with something right now!)
 
12:29 AM
@acl I still enjoy gaming the site, at least a little. I'd like to get the Legendary badge even though I can't possible compete with R.M for badge count.
 
acl
@Mr.Wizard yes, I was half-joking. I can't devote as much time to this nowadays as some time ago, and even if I could, I can't compete with most of you. The grapes of disappointment are always sour :)
(well I thought of it in Greek, but I think this gets close to what I mean)
by the way, nice to see you did not get eaten by pigs
 
@acl (And he says he can't compete -- bloody show-off.) ;-)
Re: pigs, thanks; that's a strange one.
 
acl
@Mr.Wizard I guess that is why it ended up on international news sites!
@Mr.Wizard come on, greek is my mother tongue! hardly something to show off nowadays!
 
Have some pride in the heritage my man! (re: pigs, I would have expected that kind of a story to originate in a place which has a serious feral pig problem, not here.)
 
acl
@Mr.Wizard but these were his pigs! well all sorts of weird things happen if you have 6 billion people milling about I guess
 
12:43 AM
@acl "A pathologist was unable to identify a cause or manner of death, the newspaper reported. The remains will be examined by a forensic anthropologist at the University of Oregon"
 
The first story I read suggested perhaps a heart-attack; that seems likely, as while I've heard that pigs will eat most anything, I don't think the domesticated ones attack people.
 
acl
@Mr.Wizard yes that is what I read too. still, it's an impressive if ignominious end (I sure hope none of the poor man's relatives see this)
 
At least they found something
 
acl
@belisarius dentures and pieces apparently...
 
I've also heard of at least one murder case where the killer tried to use this to hide the evidence. As I recall he almost got away with it. I suppose this could be another.
 
12:44 AM
@Mr.Wizard yes, they do
 
acl
@belisarius on balance though I'd guess we eat more pigs than pigs eat humans
 
Really? I haven't been on a working farm I'll admit, but I thought that was bred out of them. That's one of the reasons the feral hog problem in the southern US is such a concern.
 
@acl That's a good point
@Mr.Wizard Well, there have been a few cases around here
 
Good to know; I'll keep my distance.
 
acl
@Mr.Wizard actually I did meet a pig family recently on a night walk to the beach. luckily it was before I read this story!
 
12:48 AM
 
acl
@Mr.Wizard wow!
 
One of the largest feral hogs shot. Razorbacks do kill people.
 
@acl Like I said, Lanczos. I could write my implementation of $\Gamma(z)$ later if you need it...
@belisarius That's all, folks!
 
acl
@J.M. from profiling my code, it appears that I will need to compile Gamma. I'll get to that tomorrow as it's late. If you have something that would be much appreciated as I am sure it'll be better than my attempt.
@J.M. also thanks for the refs on symplectic integrators (and to @belisarius too); we've implemented a symplectic integrator and managed to get much larger system sizes than have been done in this context before, and all in pure mathematica!
proves that a better algorithm beats optimization most of the time
 
1:02 AM
@acl Just to be sure: (modestly sized) nonnegative integers only, or are you expecting to evaluate real arguments as well? You don't need Lanczos if you just want to compute 10!.
 
acl
@J.M. nonegative integers, and eventually the results will end up in a large matrix the eigenvectors of which will be calculated. thus, everything should fit in floating point. (but not just 10!). the application is enumerating states of a quantum system and obtaining the full set of eigenvectors of a hamiltonian (thus the floating point constraint)
but no, evaluating Gamma for reals is not necessary
 
@acl How big are these integers?
 
acl
@J.M. less than 100, I think.
 
@acl Hmm, I see. Let me think about this...
 
acl
@J.M. it might make sense if I precalculate the factorials and use a lookup table, but I am not sure how to do that efficiently in a compiled module. if I was doing everything in C that's what I'd do
maybe I can ask a question on how to inject precalculated lookup tables in compiled functions in an efficient way. but I'll have to think about this a bit first
 
1:10 AM
A lookup might in fact be faster, since you're limited to integer arguments. {1, 1, 2, 6, 24, 120, 720, ...}[[n + 1]] looks pretty tidy.
 
acl
@J.M. it does, but I'd need to work out how to efficiently inject that into compiled code. maybe it's small enough to literally inject it. I'll play with it (tomorrow, coding anything now is a recipe for disaster)
 
:)
@VitaliyKaurov Nope, didn't come through. Oh well...
It's clear none of them read Simon's answer explaining why he opted not to use the xkcd-ish font.
 
@rm-rf As I once said, your username and Gravatar are a danger to the society at large... ;)
 
:D
 
2:14 AM
@J.M. How do you choose the View* functions so that when a 3D object is rotated, the view is fixed?
I thought there was a question on it, but I couldn't find it
 
@rm-rf I think the question was on SO, not here. Now if only I could remember the title...
 
3:20 AM
@J.M. Sorry, @J.M. i am not sure why it did not pass through. I would be happy to read it if you post it again. Maybe something just malfunctioned. Let me know what alias you posting under and when - and I will try to check right away.
 
4:09 AM
@VitaliyKaurov Nah, it's okay. I had wanted to mention that Simon explained his use of that dreaded font in his answer here, but it seems another one of the more recent comments has taken care of it.
 
 
3 hours later…
7:09 AM
@J.M. I have quick question regarding MultinormalDistribution versus NormalDistribution. I seems to me mathematica is partially inconsistent because NormalDistribution expects as a second argument the standard deviation while MultinormalDistribution expects the matrix of variance covariances.
@J.M. as a consequence (I am not 100% sure this is the cause but I have strong suspicion) my code (mathematica.stackexchange.com/questions/10220/…) fails when the conditionnal probability only involves one variable.
@J.M. your thoughts?
@J.M. for instance, given `\[Mu] = Table[i, {i, 5}]; S =
Table[i + j, {i, 5}, {j, 5}]/20 + DiagonalMatrix[Table[1, {5}]];
Clear[pdf]; pdf = MultinormalDistribution[\[Mu], S];` the command `cpdf = ConditionnalMultinormalDistribution[
pdf, {x2, x3, x4, x5}, {2, 3, 4, 5}];
PDF[pdf, {x1, x2, x3, x4, x5}]/PDF[cpdf, x1]/
PDF[MarginalDistribution[pdf, {2, 3, 4, 5}], {x2, x3, x4,
x5}] // Simplify` should return 1
(since joint pdf should be equal to conditionnal times marginal) and it does not!
 
7:43 AM
as a simpler formal example, this fails to `Clear[pdf]; pdf =
MultinormalDistribution[{Subscript[\[Mu], a], Subscript[\[Mu],
b]}, {{Subscript[s, a], Subscript[s, c]}, {Subscript[s, c],
Subscript[s, b]}}]

cpdf = ConditionnalMultinormalDistribution[
pdf, {Subscript[x, a]}, {1}];
PDF[pdf, {Subscript[x, a], Subscript[x, b]}]/
PDF[cpdf, Subscript[x, b]]/
PDF[MarginalDistribution[pdf, {1}], Subscript[x, a]] // Simplify`
@J.M. uhm... it seems adding the Sqrt in `If[Length[\[Mu]2] == 1,
NormalDistribution[\[Mu]2 // First, Sqrt[S2 // First // First]],
MultinormalDistribution[\[Mu]2, S2]]` does the trick!
 
 
2 hours later…
10:00 AM
I have a text file with little endian UTF16 encoding (Windows, Scite). How on earth do I import this thing into Mathematica? I am about to look for Java code to do it, or does anybody have a better idea?
So what I do now is to manually save a copy of the text file from Scite to UTF8, and then things work fine (I only have russian characters, so right now there is no need for true UTF16), but why does Mathematica not have UTF16? I mean, there is MLGetUTF16String etc. in MathLink, so it seems to be used internally, or?
 
 
1 hour later…
11:05 AM
0
Q: On animations with mathematica.se logo

faleichikYesterday I posted this question which, as Mr.Wizard noted, lacks constructivity. I have to agree with this, and when I started to think on editing I realized that there are actually three options which are of interest for me at least. Animated process of construction from scratch, as it is des...

 
@chris It seems there's nothing for me to do, then... :)
 
 
2 hours later…
1:11 PM
Any native English speaker around?
 
 
1 hour later…
2:19 PM
@belisarius Yes?
 
@J.M. "Answerers"?
 
@belisarius That's a word, yes. :)
 
@J.M. Ok! thanks!
 
 
2 hours later…
4:42 PM
"[Mathematica is] by far the most algorithmically sophisticated computer language that exists" - Stephen Wolfram
 
5:27 PM
@belisarius Do you remember if there was a question on differentiating a list of {x,y} data points?
 
@rm-rf I don't understand "differentiating a list".
sorry
where is the function to differentiate?
 
@belisarius baah... I meant numerical derivative using finite differences
 
@rm-rf yep, there was one
hmmm where?
it mentioned a non-equispaced grid
Because if the grid is equispaced, it's trivial :)
... btw Is your grid equispaced? :D
 
@belisarius I just needed the link to send to someone
@belisarius I don't think so... equispaced in log domain, not linearly
 
@rm-rf Seems that is for an equispaced grid ... at least the question
 
6:02 PM
Quick question: Let's assume the following string which is no correct Mma syntax but that doesn't matter because I only want to style it:
"\!\(\*FractionBox[Superscrip\
tBox[\(\[PartialD]\), \(2\)], \
\(\[PartialD]\*SuperscriptBox[\(x\), \
\(2\)]\)]\)(exp[-\!\(\*Fracti\
onBox[\(1\), \
\(2\)]\)\!\(\*SuperscriptBox[\
\(x\), \(2\)]\)])"
When evaluated I get
The braces and brackets are not of appropriate size!
When I input this piece as usual input-cell then the braces are re-sized properly.
How can I get a correct layout even with a string? I need to do this:
Style["expr", opts..]
 
6:31 PM
@rm-rf Sorry, I can't find a better one
 
7:18 PM
Hi folk, may I bother you??
 
@DanieleRicci Depends on what you want..
 
Hi want to ask you if there is anyone that is a good programmer in Mathematica
 
Yes, everyone which is currently in the chat is kind of good in Mathematica.
2
But that was really your question?
I mean, what do you expect when you enter the Mathematica-chat?? :-)
 
Nope :)
ahaha
I need that someone help me/try to correct a code that I have generated: Cellular Automata bi-dimensional
here the link
4
Q: Implementation of a new Game of Life Rule

Daniele RicciI need to implement a new "game of life" in Mathematica: I have three states — black, red and white. Black means go forward, red go back and white take no action. I would like to implement the outcomes in this Excel file: http://cl.ly/0s2B2M3h3M2N The code I have used is the following: input13...

 
@DanieleRicci Ahh, you are the guy/girl with the CA..
 
7:23 PM
why??
 
I read the headline of your question.
Does the answer you got not help?
 
I mean, I started from the Game of Life code
And I have changed the rule inside
but running the code
i have a wrong result
 
Can you spot, where exactly it goes wrong?
 
also using a 4x4 grid with just 9 cell
for example
the central one is black
4 are blacks and 4 are grey
following my code, the resulting cell should be black
while is another color
 
And you following your code you mean the changed If code block in your question?
 
7:29 PM
or if a have a central cell that is white, my code say that if the central cell is white and the black neighbors are equal to the grey one, the result should be a white cell
while is grey
yes, that one
 
give me a sec.
 
ok thanks
 
And black is 0, gray is 1 and white is 2?
 
no, white is 0, grey is 1 and black is 2
 
ok
@DanieleRicci What the heck is this??
If[i == 1 || j == 1 || i == Length[A] || j == Length[A[[1]]], Return[0]];
 
7:37 PM
this is the rule for the (* no man's land edge strategy *)
 
yes, I see
Ok...
Here the resulting cell is black
 
here where??
 
Wait again:
Your getNbhd
should this function not only return the neighbourhood?
example:
a = {{1, 1, 1}, {1, 2, 0}, {0, 0, 0}};
getNbhd[A_, i_Integer?Positive, j_Integer?Positive] :=
  A[[i - 1 ;; i + 1, j - 1 ;; j + 1]];

getNbhd[a, 2, 2]
This gives {{1, 1, 1}, {1, 2, 0}, {0, 0, 0}} which is the neighborhood and the central cell.
 
isn't it correct?
 
I don't know. You tell me. I thought you maybe only want to extract the neighborhood of the central cell which is
{1,1,1,1,0,0,0,0}
without the central cell itself. Not?
Ah, ok, now I see. You subtract everytime in the If the cell itself:
 
7:44 PM
I think I need of the central cell because depending of the central cell, the resulting cell will be different
 
Yes, but didn't you store the central cell in a variable cell??
Why don't you use it?
 
I don't know
I'm not a good developer
that's way i need of your help
I started from the game of life code
and I have just replaced the rule in the center
 
Ok, let's leave your code as it is for now.
 
with the above sample of a = {{1, 1, 1}, {1, 2, 0}, {0, 0, 0}}
it is exactly what you wanted right? Center is black, 4 are gray and 4 are white..
And it should give black which is 2
yes?
 
7:48 PM
no, it should give me white cell
sorry sorry sorry
you're right
the result should be black
the theory is:
 
@DanieleRicci Look what you wrote..
Click on the small arrow infront of the above message.
 
the white cell are neutral, so are the space where the black and grey cell interact
so
 
This is what happens in your code:
cell is equal to 2 because the center of a is 2
numNeighbors is equal to 6 because
Apply[Plus, Flatten[{{1, 1, 1}, {1, 2, 0}, {0, 0, 0}}]]
is 6
then you come to your first If condition in evaluateCell which is:
If[cell == 2 && numNeighbors - 2 >= 4
this evaluates to True and therefore you Return[2]
Ok?
 
@halirutan why does it get only 6 neighbors?
 
What did you expect?
 
7:56 PM
does the rule get 8 neighbors? why only 6??
sorry if i bother you
anyways
 
Because you implemented it like this in getNbhd! Can you tell me step by step how you would calculated numNeighbors?
take {{1, 1, 1}, {1, 2, 0}, {0, 0, 0}} as input and explain to me how you would extract numNeighbors of the position {2,2}
 
so
i know i will look as a stupid, but what is the position {2,2}??
 
You call your function getNbhd[A, i, j] with a matrix A, and two integers i and j. I meant i=2 and j=2.
@DanieleRicci Ok? And don't bother to look stupid. Everyone does on all kinds of occations, especially me.
 
if i=2 and j=2, then A[[1;;3;;1;;3]] right?
 
Yes
 
8:08 PM
ok
now I don't know how to go on
i mean, i'm telling to mathematica: from the matrix A, get me what?
 
You could just try it by writing it down {{1, 1, 1}, {1, 2, 0}, {0, 0, 0}}[[1 ;; 3, 1;;3]]
the ;; operator says basically take row/col from ... to ...
 
ah ok
 
Therefore, if you want to take in the 3rd row the colums 1 to 2 you write:
{{1, 1, 1}, {1, 2, 0}, {0, 0, 0}}[[3, 1 ;; 2]]
 
ah ok
with [[1;;3,1;;3]]
i'm telling to mathematica to get me from matrix A
row 1 2 and 3
and column 1 2 and 3
so all the matrix
that means all matrix A
 
In the case of a 3x3 matrix yes
 
8:15 PM
so this is what I need
to get from the matrix A all the neighbors, that means 9 neighbors
so also the central cell
no?
 
Which is in my opinion no neighbor but if you implement it right, than extracting the central point too is not wrong.
Question: Red is Gray in your question, right?
 
In your excel file where is the situation you discribed? Center black, 4 red and 4 white..
 
g163,i165
the meaning of my rule is the following: cell red(grey) interact with cell black. if the number of the cell in one color(black/red) is bigger than the cell of the other color (red/black), then the resulting cell will be the one that has the biggest number
for example if you look at a123:c125 you will see:
center cell black (2), one cell black (2), two red (1) and 5 white --> the result will be white
 
@DanieleRicci wait, I'm looking..
 
8:26 PM
because the two red cell interact with the two black cell and they die, leaving one cell white
if you see A127:C129, there i have one black cell in the center, one black, three red and 4 white --> the two black cell interact with two of the red cell (so they die), and the only cell that doesn't interact is the red cell --> so the result will be the red cell
 
@DanieleRicci And which of your 6 if conditions should match the a123 case??
I assume this one
 
is the FALSE Result --> IF[Condition, TRUE, FALSE]
 
@DanieleRicci I don't understand the question
Wait!!
 
If[cell == 2 && numNeighbors - 2 == numNeighbors - 1, Return[0],
Return[1]]];
maybe i made here the mistake
because I need to make like in excel a concatenate function
 
This does mean: if your condition evaluates to True then 0 is returned, if it is false 1 is returned.
The rule a123 evaluates to black, because the code never reaches the second if
it stops here:
If[cell == 2 && numNeighbors - 2 >= 4
 
8:38 PM
IF[(all the conditions to have as result 2 are correct; then Return[2]); if false the find all the conditions to have as result 0; then return [0];otherwise Return[1];Return[1]]
ah ok
so how can I adjust this problem?
 
Let me tell you what I think your problem is:
 
Where is the rule for {{2,2,2},{2,2,0},{0,0,0}}?
 
If[cell == 2 && numNeighbors - 2 >= 4
 
I mean the rule in your Excel file?
You find it faster than me.
 
8:41 PM
A43:C45
 
and where is the rule for
{{1,1,1},{1,2,1},{1,1,1}}?
 
A179:C181
 
Now, following:
The first example evaluates to black (2) yes?
The second example evaluates to red (1), yes?
 
yes
both correct
 
In your code you only use numNeighbors and cell to decide where to go, yes?
 
8:47 PM
yes
 
In both cases cell==2, yes?
 
And now look, what you get for numNeighbors
Apply[Plus, Flatten[{{2, 2, 2}, {2, 2, 0}, {0, 0, 0}}]]
and
Apply[Plus, Flatten[{{1, 1, 1}, {1, 2, 1}, {1, 1, 1}}]]
Returns both 10
So your code must be wrong, because it has no chance to differentiate between these two examples..
Ok?
 
ok
right
 
Did you see, where your error is?
(I chose two obvious examples so that you see it easily)
 
8:52 PM
do you in the code that I wrote?
the error is in the
fact that I don't have create a rule, when cell==2, that give me as result 1
should I put the comma between
If[cell == 2 && numNeighbors - 2 >= 4 ||
numNeighbors - 2 == 3 && numNeighbors - 1 <= 3 ||
numNeighbors - 2 == 2 && numNeighbors - 1 <= 2 ||
numNeighbors - 2 == 1 && numNeighbors - 1 <= 1 ||
numNeighbors - 2 == 0 && numNeighbors - 0 == 8, Return[2]
and If[cell == 2 && numNeighbors - 2 == numNeighbors - 1, Return[0],
Return[1]]];
??
because in my code I put the ;
 
No. The question is, why is {{2, 2, 2}, {2, 2, 0}, {0, 0, 0}} and {{1, 1, 1}, {1, 2, 1}, {1, 1, 1}} handled equally?
It's because you sum up your neighbors
 
i don't know
 
You want to count the numbers of red and black cells in your neighborhood, but you don't do it.
 
so it's because i have tried to put all the rule together instead of specifying all the rules?
 
You use Apply[Plus,... to sum your neighbors up
 
8:57 PM
ahhhhhhh
 
You want to ask how many red cells do I have or something like that.
 
yep
so the problem is in Apply[PLUS....???
 
00:00 - 21:0021:00 - 00:00

« first day (267 days earlier)      last day (4214 days later) »