« first day (584 days earlier)      last day (3906 days later) » 

3:43 AM
Is there a way to detect when an InputField gains focus?
I have been trying the following events mathematica.stackexchange.com/q/6207 with no luck
 
 
2 hours later…
5:21 AM
How to find all the permutation of Range[9] with a given order, for example, x[[1]]< x[[2]] .
 
 
2 hours later…
7:38 AM
@EdenHarder You mean like Select[Permutations[Range[9], {2}], #[[1]] < #[[2]] &]?
 
 
2 hours later…
9:47 AM
@Calle Yeah, thanks! But is there any efficient way to save memory?
 
10:28 AM
@EdenHarder Isn't it possible to create (for this specific example) the first two elements first which fulfill your condition and then append the rest of the permutation?
@EdenHarder So something along this lines
perms = Flatten[
   Function[start,
       Join[start, #] & /@
        Permutations[Complement[Range[9], start]]] /@
      Pick[#, Less @@@ #] &@Permutations[Range[9], {2}], 1];
If you want to see how it works, first look at
Permutations[Range[9], {2}], 1]
then
Pick[#, Less @@@ #] &@Permutations[Range[9], {2}], 1]
and then try
Permutations[Complement[Range[9], {1,2}]]
the rest is to build the result from the parts
 
10:44 AM
@EdenHarder Try searching the site for Permutations and memory. And perhaps memory and list generation in general. Problems with memory in this context should be fairly common. One quick search led me to a way of doing it procedurally with the Combinatorica package that might help: reference.wolfram.com/mathematica/Combinatorica/ref/…
 
 
1 hour later…
12:14 PM
@halirutan Thanks! But the order may be complict, for example, #[[1]] < #[[2]] < #[[3]] and #[[4]] < #[[5]] < #[[6]] and #[[7]] < #[[8]] < #[[9]] .
@Calle Thanks! It is helpful! But I do not find a proper function. Given the order , for example, #[[1]] < #[[2]] < #[[3]] and #[[4]] < #[[5]] < #[[6]] and #[[7]] < #[[8]] < #[[9]], there are only 1680 permutations but not 9!. So, we need a more efficient code.
 
 
1 hour later…
1:23 PM
@EdenHarder Length[Permutations[Range[9], {3}]] is only 504, not 1680 and certainly not 9! ?
I'm probably misunderstanding the problem.
 
 
2 hours later…
3:30 PM
@EdenHarder What Calle meant was going iteratively through all permutations and only store the ones you need
For instance like this
<< Combinatorica`;
test[{a_, _, c_, _, _}] := a > c;
n = 5;
Reap[Block[{perm = Range[n]},
   Do[
    If[test[perm], Sow[perm]];
    perm = NextPermutation[perm];
    , {n!}]
   ]
  ][[2, 1]]
 
3:52 PM
Alo
Was this bug around before 9.0.1?
"asd"~Style~Blue~Style~Red and then toggle the output cell from InputForm to StandardForm (ctrl+shift+i ctrl+shift+n etc on Windows)
It toggles from red to blue every time
 
@Rojo hmm, here it toogles from blue to red. This is mysterious...
:-)
(btw, OSX and Mathematica 8.0.4)
 
hehe
Thanks
 
 
2 hours later…
5:43 PM
@Mr.Wizard Do we have a canonical answer for injecting code into held expression? I'm really sure I read something from Leonid about this. It would probably good to give this link in this Q&A and/or close it as dup.
 
6:22 PM
@halirutan I believe this is the primary one:
19
Q: Replace inside Held expression

Alexey PopkovI wish to make functional replacement inside Held expression like this: f[x_Real] := x^2; Hold[{2., 3.}] /. n_Real :> f[n] => Hold[{4., 9.}] But I get Hold[{f[2.], f[3.]}] instead. What is the best way to make such replacement without evaluation of the Held expression?

 
Errr
 
@Rojo Yes?
 
6:38 PM
Hello.
 
6:54 PM
Hello @Kuba
 
@Mr.Wizard :)
 
@Kuba I know you appreciate a nice solution. I think you might like this one; I'm rather pleased with myself about it.
 
@Mr.Wizard I also appreciate nice solutions. Can I see it too?
 
@Rojo lol -- sure. I'm still trying to interpret "Errr" by the way.
 
@Mr.Wizard let me just read this question, I must admit I skipped it ;)
 
7:05 PM
@Mr.Wizard Hehe, don't try. I had just posted a comment on the question about the held derivative, and when I came back here I saw that my comment was about to get superseded
@Mr.Wizard Hey, about that question of substrings. You interpreted that a nice solution would allow you to style substrings that may be overlapping, such as "make all substrings matching "asdf" bold", and now "make all substrings matching "dfgh" red", so as to get some bold and red, some just red and some just bold, right?
 
@Rojo If I recall the question you are referring to, yes, I thought that would be both nice and complicated. Do you have a solution?
 
@Mr.Wizard No, but I thought it might be interesting to try :)
@Mr.Wizard There's also this other question, old question I hadn't seen. mathematica.stackexchange.com/q/16067/109. I don't know if that's what he's asking but it made me think of a version of "simplify" that returns something that reduces to the original expression
 
@Rojo It's obviously practical because word processors work this way, but I remember trying it and getting frustrated. I suppose on reflection one would have to insert markers (markup language) and then generate styling afterward.
 
Meaning, that it could also define new variables to minimize its complexity function, finding common subexpressions. Have you seen anything like that around?
 
@Rojo A warning: I'm sleep deprived this morning because I couldn't sleep last night. I may be even dumberer than usual.
 
7:13 PM
@Mr.Wizard No worries, I'm dumb today without excuses (overslept). I'll be back in some mins
 
@Rojo There's a group of questions that relate to what I think you're describing. IIRC if you search for OptimizeExpression you'll find some of them; also searching for Daniel Lichtblau's posts containing PolynomialReduce or GroebnerBasis should be fruitful.
It's a common question with many flavors; it would be great to have a canonical post but I'm not sure that is even possible.
 
How does one find stats on this group, to see if more users are coming to Mathematica forum over the time period it was started? it will interesting if someone can post some such stats...
are there on some stackexchange site somewhere? like how many questions are asked per month, how many are answered, etc... will be fun to see
 
@Nasser Just get all users and look at the creation_date: api.stackexchange.com/docs/users
 
7:29 PM
@Nasser There are statistics for the moderators to view. We are not supposed to disclose all of them to the public and at the moment I can't remember which ones we are allowed to share. I'm sure @rm-rf will remember. I do know I can summarize the results for you; give me a minute to look.
@Nasser Which of these interests you?: New Users, Total Page Views, Number of Visits, Number of New Visits.
 
@Mr.Wizard Thanks, I'll search for that
@Mr.Wizard I'm tempted to start trying with the string thing, but I will be leaving soon
 
@Rojo I hope "leaving" means for the evening, not taking a break from the site.
 
@Mr.Wizard Yeah, just the evening
:)
I haven't been overly active anyway lately
I fear looking at the ranking, I may be on the second page already
 
@Rojo That makes me nervous. We need you.
 
7:44 PM
@Mr.Wizard :), I'm not leaving, but as long as the legend is here, the site will be fine
 
Heh, thanks, but I just handle the pattern matching, list manipulation, and programming stuff. The site would be quite poor if there were only clones of me answering questions.
 
@Mr.Wizard Could I hire you for a few days to post 50 answers for me in ? I have the votes, but not enough answers for a badge :P
 
@rm-rf Everything is negotiable! :-D
(Hang on, I've got to attend to something.)
 
@Mr.Wizard :D And when you're done, don't forget to promptly suspend both of us... :P
 
@Mr.Wizard I'm sorry for the delay, I had to go out for a moment. I will parse this topic in a moment.
I think it is unacceptable! mathematica.stackexchange.com/a/31062/5478 :)
 
8:07 PM
@Mr.Wizard I was just wondering how popular the site is becoming really, that is all. not sure what is the correct measure for this now. may be rate of new users will do?
 
@Nasser There was a topic on SE meta about different measures
They were counting new users but cutting those with 1 or 101 rep etc
I just do not remember where it was and how to find it :)
 
20
Q: How are we doing? (Post your favorite stats!)

VerbeiaBy popular demand, here is a place for people to post regularly-updated metrics of traffic and other indicators of how Mathematica.SE is developing. Please post sets of analysis from different sources as (community wiki) separate answers.

 
@rm-rf that's it, thanks.
 
8:29 PM
@Mr.Wizard I think I do not understand it fully yet so let me ask you a question. Ordering needs information about whole sequence of elements from two lists. This seems to be unnecessary. why not just part1 - part2?
but I might miss something so don't judge me too harshly :P
 
8:48 PM
Hello
 
9:20 PM
@Mr.Wizard Thanks, I added the link in my answer.
@SimonWoods Hi Simon. We rarely see you around here in chat.
 
Hi @halirutan, I thought it was time to pop in and say hi
 
@SimonWoods So it's your first time?
 
Second or third I think
 
I would have guessed so, because I only see your regular answers but never saw you in chat.
You've chose a bad time though. I have the feeling that since a couple of weeks it's pretty quiet in here.
Usually, there is at least one interesting discussion about some deeper topic.
 
Perhaps everyone is enjoying the last of the summer instead of hanging about on SE?
 
9:30 PM
any one like to have a quick run on my new demo to check if it ok?
 
@SimonWoods Hehe, yes probably.
 
In general I often find the site fairly quiet when I'm around - I guess because most contributors are in other time zones.
 
@SimonWoods Hmm, Simon Woods sounds like US. Usually, it's me who has to be online at night to see the crowd.
I have the feeling many people are online from 23-06 hours my time.
which is UTC+1 I think
 
I'm in the UK - also UTC+1
There always seems to be a lot of activity while I'm asleep
@Nasser, I can have a look if you like
 
@SimonWoods here it is 12000.org/tmp/082213
the notebook is there. Please download and just run the GUI there inside it. I am just looking for some feedback if it is OK, clear to use, etc... so I can make any changes if needed before I submit it to WRI
the file is there, v4.nb
if nothing is clear to use, or find any issues, please let me know, on your time. not urgent.
 
9:50 PM
@Nasser, no problems with it. I tried my best to break it without success :-) It looks like a lot of work went into it - well done.
 
@SimonWoods thanks. I wrote it in 3 days. to learn finite difference for school.
it takes 2 days to do the formatting and the documentation. 1 day to do the coding of the actual algorithm itself :)
 
Of course...
Layout of controls in a Manipulate is seriously tedious work
 
@SimonWoods yes. I make heavy use of Grid, which helps alot.
The hardest part is this: Make sure nothing shifts while running. I hate to see any image or plot shake or any numbers moves from a fixed location. This takes the most time to do. I see so many demos on WRI where this is not taken care of. But this is the hardest part to do.
 
@Nasser, yes I know what you mean - slight changes of ImagePadding and so on. You've done a very neat job.
 
@SimonWoods yes. Making the plot fit the whole space around it. Changing aspect ratio can affect the title shaking, etc... I really do not have a fixed formula. it is lots of trial and errors until it comes out right.
 
10:06 PM
@Nasser, trial and error is my favourite coding style :-)
Are you using version 9?
 
@SimonWoods yes, 9.01 on windows
 
Have you ever come across the PlotTheme option?
 
Here is my updated demos page if you like to see 12000.org/my_notes/mma_demos/index.htm
 
I don't think it's documented anywhere
 
@SimonWoods no. Never heard of this option !
 
10:08 PM
Check this out:
VerticalGauge[55, {0, 100}, PlotTheme -> "BatteryDark"]
 
that is nice. What does this plotTheme supposed to do? just a general overall theme?
 
I assume it's something that will be coming in a future version. There are dozens of "themes" for gauges and plots
 
how to find more about it? I do not know if it can be used for demos...
cool
 
Probably not usable for demos as it's undocumented?
 
I think WRI should make CDF formating open, like PDF. THen it will take over. There is really like it out there. it is amazing technology, but not used much
Adobe made PDF format open, yet everyone still use adobe reader. So if WRI does the same with CDF, still everyone will use WRI reader. NO difference, except everyone will start using CDF and publishing CDF's
it will take 1000 lines of OpenGL code to do the same using few lines of mathematica 3D commands and options...and CDF's can run on the web as well.
 
10:14 PM
I guess the problem for WRI is how to make it more open but still make money from it
Some more:
HorizontalGauge[85, {0, 100}, PlotTheme -> "Bar"]
ClockGauge[PlotTheme -> "WallClock"]
AngularGauge[85, {0, 100}, PlotTheme -> "Amps"]
 
@SimonWoods very nice !
 
@Nasser That's not true, on OS X everyone uses Preview, for example. Often one uses the web browser. And as I understand it, the CDF is basically MMA so they can't make it "open" without revealing their technology for MMA to competitors.
 
@Calle You need Mathematica to run. But the format of the CDF itself can be open.
Why not? Like postscript, pdf, etc... all have known standard format. But you need a binary program to view them?
I am taking about the format of the CDF file. How to read it and run it is something else.
This allows many to publish CDF files.
 
@Nasser OK, what's the point; you want people to be able to create CDF files using other languages?
 
@Nasser, but the player is free. If anyone can freely create a CDF and anyone else can freely play it, doesn't that take Mathematica out of the loop?
 
10:20 PM
@Calle the point is that it will become open standard, and then there is more chance of people using it. it does not matter if the reader is free. There are many who will not touch closed technology. WRI will not be able to have CDF's used much more if the format of the CDF is closed.
any way. Just my opinion, that is all. WRI can do anything they want ;)
 
@Nasser But the player is a full Mathematica Kernel and everyone who wants to run a CDF still needs a Kernel to have all functionality. How do you want to make this open?
 
@Simon could you help me slightly change some of your code?
 
@Tyilo, which code?
 
@halirutan I am not talking about the payer., I am talking about the CDF file format.
 
@SimonWoods I just want your answer here: mathematica.stackexchange.com/questions/15338/… to accept CenterDot and replace it with Times
 
10:23 PM
Alright, maybe I'm just narrow-minded at the moment. To me, CDFs is a way of sharing MMA code. I don't see non-MMA people using CDF. Any other program created to make CDFs will only be able to implement a subset of MMA anyway.
 
... #2 /. {CenterDot -> Times} ... doesn't work for me
 
@Tyilo, that's a different Simon...
 
Or sharing the result of MMA code, rather.
 
Oh I'm sorry :)
 
@Nasser Let's say we are talking about the Adobe Illustrator format and assume it would be a simple XML file and all specs are given. Who would help this?
You still need the illustrator.
And unlike PDF, where it is just about displaying something CDF really needs all the fancy algorithms. So a alternative viewer would have to reimplement Mathematica
 
10:26 PM
@halirutan I know. So WRI player is still needed. Just like I need adobe PDF reader to read a pdf file. THe difference is that anyone can publish a PDF file. THis is the point.
 
@Nasser No, you don't. In Ubunut it's called Evince, not Adobe.
@Nasser Did you ever wrote a PDF file in the editor?
I mean in a text editor.
 
@halirutan I know. There are few. But that is also my point. Any one can implement a read if they want. but 99% of people still use adobe reader.
 
@Nasser But that's my point; anyone can not implement a read because that would amount to reimplementing the MMA kernel. And without the MMA kernel one cannot try one's CDF code, so it's practically impossible to build a CDF without MMA.
 
@Calle then, there is no harm of making CDF format open. If there is no way to build a reader for it. right?
 
@Nasser But there is no point in it either :)
 
10:31 PM
@Nasser The thing is twofold: First, it is very unlikely anyone would create more then the most simple CDF without Mathematica, so it would not have the same use as a PDF where you can create all fancy stuff with many programs like InkScape, LaTeX, ... So making it open would not really make a difference on how many people use it.
 
@Calle yes, there is a HUGE point. It will remove the view that CDF is closed format.
 
The thing here is, everyone who creates CDFs has Mathematica because without knowledge of the Mathematica language no one is able to do it.
 
@halirutan again. Let then call it a marketing point. Making CDF format open and standard, even though no one is able to implement a reader for it, will at least remove the main objection against using it now. That it is closed format. At least WRI can market is as open format and standard bla bla
 
The second thing is: By making it an open format, I'm pretty sure Wolfram has to think again about it's security issues. I would say if the format is open, one can easily hack around the restrictions which are currently implemented.
 
@halirutan I doubt hackers will make any closed format stop them. Look at windows, it is hacked all the time. but windows is closed source... any way, I think I said all what I can on this, just an opinion again ;)
 
10:37 PM
Do you know how I can replace CenterDot in RowBox[{"Meters","[CenterDot]","Seconds"}] with Times and still keep the RowBox ?
 
I wonder what is the logic behind accepting an answer but not upvoting it? It's kind of like saying "your answer is no good, though it did solve my problem"
 
@SimonWoods I see this regularly..
 
@SimonWoods Is it a new user? Those with <15 rep cannot upvote...
 
@rm-rf, oh I did not know that...yes it is a new user
In that case I hereby withdraw my exasperation
 
:)
 
10:42 PM
@rm-rf, have you come across PlotTheme ?
 
In Charting?
 
yes
There's loads of 'em
 
I vaguely remember seeing it, but never played with it
@SimonWoods Whoa!
 
@rm-rf, quite.
Yet more secret functionality from the people who brought you Graphics`Mesh (but didn't tell you about it)
There's a set of axis/frame options which you can get with
axisthemes = "Axis" /. Charting`$PlotThemes
There are more themes in Charting`$PlotThemes but it seems to be an incomplete list. I've used some code to extract theme options from the downvalues of Charting`ResolvePlotTheme
themes[f_] := Module[{dv, thm},
  dv = DownValues[Charting`ResolvePlotTheme][[All, 1]];
  thm = Cases[dv, _[_[t_String, s_ /; MatchQ[f, s]]] :> t];
  Complement[thm, {"Bare", "Test"}, axisthemes]]
use it like themes[Plot]
 
Saves a lot of option setting for quick and neat plots
Plot[{Cos[x], Sin[x]}, {x, 0, 2 π}, PlotTheme -> {"Frame", "GridAxis", "Vibrant"}]
Some of them also use non-standard colorfunctions
 
10:59 PM
@rm-rf, yeah, I can see myself using the plotting ones for quick formatting
Some of the themes for gauges are very pretty but I don't really use gauges that much
 
Yeah, me neither... While they certainly might be useful, I'm not entirely convinced why they chose to go with it as an important feature in v9
 
@rm-rf, indeed. It's bedtime for me, so I'll say goodnight and leave you with a little bit of hypnocode
a = DiskMatrix[10, 200];
Dynamic[Image[
  a = Rescale[a - GradientFilter[a, 2, Method -> "Sobel"]]]]
23
 
@SimonWoods Wow, beautiful!
 
11:14 PM
@SimonWoods that is nice. I should build a demo based on this now :)
 
11:40 PM
@SimonWoods I like how it eventually settles at some swirling form of this:
I wonder if there's a reason why...
 

« first day (584 days earlier)      last day (3906 days later) »