Reputation
1,091
Next privilege 2,000 Rep.
Edit questions and answers
Badges
6 24
Impact
~20k people reached

  • 0 posts edited
  • 0 helpful flags
  • 50 votes cast
Mar
31
comment Matching x,y,z,2
@rasher Oh, I see. It's totally the way you'd expect it to work for functions.
Mar
31
comment Matching x,y,z,2
@rasher I meant for the list to be grown to the left; sorry, I thought that was clear. As for overlaps, it turns out in my application that they don't matter --- that is, whether they are done sequentially or simultaneously you will eventually get the same result (I am intending to use ReplaceAll once I get this working).
Mar
31
comment Matching x,y,z,2
I understand your point about functions being represented as rules. But is there a reason other than "we chose to do it that way" for filling from right to left, which is to me counterintuitive? I thought about using multiple rules, but figured there had to be a better way.
Mar
30
revised Matching x,y,z,2
added 82 characters in body
Mar
30
asked Matching x,y,z,2
Mar
25
awarded  Popular Question
Mar
20
awarded  Yearling
Mar
11
awarded  Notable Question
Mar
4
comment Determine if all the zeros in a list occur at the end
Accepting this answer because a) it was first, and b) Kuba showed extraordinary perseverance.
Mar
4
accepted Determine if all the zeros in a list occur at the end
Mar
3
comment Determine if all the zeros in a list occur at the end
Sorry, you are correct; I was forgetting about the inversion of the test. Do you have any comments on the discussion we are having in the other answer?
Mar
3
comment Determine if all the zeros in a list occur at the end
So do you understand why one returns False and the other True?
Mar
3
comment Determine if all the zeros in a list occur at the end
Try MatchQ[{1, 1, 0, 0}, {x__ /; x != 0, y__ /; y == 0}] versus MatchQ[{2,3,17, 0, 0}, {x__ /; x != 0, y__ /; y == 0}]. What's up with that? That's why I assumed that pattern didn't work.
Mar
3
comment Determine if all the zeros in a list occur at the end
Also (see edit above) I think this fails in the case where there are no zeros.
Mar
3
revised Determine if all the zeros in a list occur at the end
added 73 characters in body
Mar
3
comment Determine if all the zeros in a list occur at the end
I tried for a while to build the appropriate pattern, but just couldn't get it right. Thanks. Can you educate me --- this is clearly useful, but why doesn't something like {x__/;x!=0,y__/;y==0} work?
Mar
3
comment Determine if all the zeros in a list occur at the end
In that case the list should be acceptable.
Mar
3
asked Determine if all the zeros in a list occur at the end
Feb
20
comment How to change the font color and size of tick labels by default
Thanks. Now, how was I supposed to know that? There is no page for GraphicsBoxOptions in the online help. And even if there were, how would I know what I could add as options? The documentation leads you in the direction of SetOptions, but SetOptions[GraphicsBox, DefaultTicksStyle -> Directive[FontSize -> 14, FontColor -> RGBColor[1, 0, 0]]]' gets Improperly formatted directive'. Am I missing something?
Feb
19
comment How to change the font color and size of tick labels by default
Thanks. I will try that. What I was ideally looking for, however, was a way to have such an option with less than global scope (for example, in a stylesheet), so that it could apply in some notebooks but not others. It looks like you haven't found a way to do that either.