« first day (31 days earlier)      last day (4454 days later) » 

1:21 AM
If there's anybody around, I need some quick help...
 
 
2 hours later…
3:02 AM
I can always tell I'm on the right track when I start recognizing the names in the papers I'm reading. This time it was two references back.
 
3:40 AM
@MrWizard just read your post about a plot to deny Heike votes. She doesn't need the votes, just more answers and she will have the first tag badge.
 
@JM The question went wild here and it was the topmost question on the SE hot list all day... Having a title like "30 days of beta..." screams meta to everyone who doesn't take the time to read the question, so at a quick glance Robert saw that it was basically a fun question with a block of code that said "Here, improve this!", and so he moved it to meta. Can't say I entirely disagree with his assessment there...
After convincing him that there was a question buried and will be dug out improved, he agreed to undo the migration and leave it in a closed state for the community to reopen if it wishes
 
@yoda Ah well...
Anyway, if anyone comes across this, I have something I can't seem to find in the help file. Is there a syntax for Style[] to be able to do something like "this text is in bold, and this text is italicized."?
 
3:59 AM
@rcollyer Oh I know. I used to think I was one of the better players in Graphics but I know when I am well and truly beat. That last one I am still rather proud of though.
@yoda is that all in the other room?
@JM that has already been asked and answered. You can look at the underlying StyleBox form if it interests you.
 
@MrWizard Ah, right. But it can't be done within a single Style[] object, no?
 
@JM Let me put it this way regarding StyleBox: take a string, use the Format menu to get what you want, then use Ctrl+Shift+E to see the Box form. I think that's as close as you're going to get.
 
@MrWizard Okay; I'm making sure that there wasn't something in the help file that I missed. Thanks!
 
5:07 AM
@MrWizard yeah... it didn't go on for long after you left... just a couple more messages
 
 
2 hours later…
7:23 AM
Anyone here?
 
7:57 AM
@jm are you on-line?
 
@MrWizard Yes, but I must be off for a few minutes. Will ping when I get back.
 
8:24 AM
@MrWizard Okay, back.
 
I am trying to think of a solution to [this problem]. I am facing a lack of understanding of the capabilities available in KeyEventTranslations.tr and MenuSetup.tr. Do you have much experience with this?
 
@MrWizard It has been a long time ago since I mucked around with key bindings, that I've forgotten...
...but my understanding is that one just replaces names of keys as needed. Although, the names are apparently different on different OS's.
 
Since I cannot find an existing Token to do this, I would have to use a more elaborate function in one of those files. There are examples of both FrontEndExecute and (in MenuSetup) KernelExecute usage in the files. It seems hard to do simple things within FrontEndExecute because there is no FrontEnd`Part for example.
I was trying to use Notebooks[] and SetSelectedNotebook to accomplish this, but even from the Notebook interface I find the need for storage variables. I also tried SetSelection[SelectedNotebook[], Next, Notebook] but that changes what is selected (everything) within the Notebook. Can you think of any other way to approach this?
 
8:40 AM
@MrWizard Yes, it looks exceedingly tricky to co-opt that key binding...
@MrWizard Nothing readily comes to mind. You said what I'd have tried...
 
Okay, thanks. I'm going to move on to another problem.
 
9:27 AM
 
10:08 AM
has something gone wrong with stackmobile? I can't get into any sites that way.
 
@Verbeia It seems to work fine on my phone
 
@Heike weird - on both my desktop and my iPhone, I get the main page, but "error loading page" whenever I click on a site.
 
@Verbeia A few weeks ago I had a problem getting on any of the stack sites except for chat.SE because I couldn't reach sstatic.net
It sorted itself out after half a day or so.
 
@Heike strange - I can get the real sites but not the stackmobile versions. I find them useful for a quick check of sites I'm not a member of.
 
Have you tried clearing the cache/cookies?
 
10:15 AM
Does anyone (@yoda?) know if visits to stackmobile count as visits in the stackexchange site stats?
clearing the cache doesn't work
 
@JM Are you trying to port all colour schemes in Matlab to Mathematica?
 
10:47 AM
@Heike Except for hsv() (because we already have Hue[]), gray (GrayLevel[]), white (well...), colorcube, flag, lines, and prism, I've already done the lot... ;)
...though I'm tending to favor jet, bone, and hot for my uses...
 
@JM I noticed that ColorData["VisibleSpectrum"] is close to jet() (you have to rescale it a bit though)
 
What do bone and hot look like?
 
@MrWizard Do you remember rcollyer's plots the other day? One of which he temporarily turned into his Gravatar?
The color scheme he used is more or less like hot.
Let me give a sampling of one of my experiments with bone:
@Heike Yeah, though jet can't seem to produce RGBColor[0, 1, 0], while ColorData["VisibleSpectrum"] can.
 
11:04 AM
@JM This is the spectrum of "VisibleSpectrum"
And this for your version of jet.
The main difference is that there is a gap between the red and blue curve near x==.5 in the "VisibleSpectrum" map which is why it's greener in the middle.
 
Ah, right.
Also: Position[Rationalize[ColorData["VisibleSpectrum"] /@ Range[495, 570]], Green] // Flatten
which corresponds to the range here.
On the other hand, porting Mathematica 's gradients to MATLAB will apparently be tricky to do.
 
11:36 AM
According to the matlab documentation they expect you to use their colormapeditor to edit colour maps. Unless there is a programmatic way that's going to take a lot of time.
 
Well, the default setup in the M-files for the color schemes is to just generate a 64-by-three matrix, and then interpolate accordingly to expand for finer graduations. (At least, that's how I understood the code.) The color schemes I was able to port, except for pink, were all piecewise linear, so translation was a snap.
(though I had to ask yoda for help with jet because the code in the M-file was rather confusing to parse)
 
@Verbeia no. Stackmobile uses the API
 
(pink internally uses square roots to generate RGB values. Weird, eh?)
 
12:11 PM
Hey @MrW
I'm afraid I can't stay for very long, but please do ask the question! I'd be glad to get any feedback on inject
 
@Szabolcs it seems a bit complicated; I was just wondering about its application, and perhaps if every step you took is necessary. If you feel like giving a slightly longer description of its purpose I may be able to refine it (or not).
brb
Let me float a simple example without all the complication, then you can tell me why it breaks your application:
{b, 3} /. _[a__] :> Hold[{a, b}]
Hold[1 + 1] /. _[b__] -> %
 
12:30 PM
@MrWizard I was using it to generate code and compile the generated code. Here's an example function. It was going to be part of a solution for one of yesterday's questions, but it is incorrect.
call it with setsC[{{1,2,3,4},{3,4,5,6},{4,5,6,7}}]
@MrWizard The CompilationTarget should read target, but it's irrelevant anyway
@MrWizard I wanted to package it up into a function for ease of use. I wanted to have a simple to understand and simple to use function, and I didn't want to think about its internals at all while using it.
@MrWizard The usual way to inject expressions into other expressions is With: With[{a:=1+1, Hold[{a,a}]]. What's wrong with this here? Well, it conflicts sometimes with the localization mechanism of Compile and Function:
In[33]:= With[{expr:=x^2},Compile[{x},expr]]
Out[33]= CompiledFunction[{x$},x^2,-CompiledCode-]
Note that x$, which is different from x.
@MrW Next try: use withRules from here. It doesn't actually localize which is an advantage here. But it doesn't handle Sequence[] either.
 
Finished? (I guess not)
 
Next try: use your solution to my question to write a similar function. The property of this function that it applies replacements one by one (and therefore the result of one is visible to the other, as in inject[{a -> b, b -> 1}, a]) is an advantage sometimes. People have been asking for a With where previous constants can be used in subsequent ones many time. In some other occasions it's a disadvantage, but I think for this kind of use it would turn out to be useful
(even though I didn't reply on it when I used the function)
@MrWizard Done. I'd love to see a simplification. Some things were bolted onto inject after a previous version was written (notably the Hold mechanism). There's probably room for simplification.
When you pinged me first I was in the middle of a Skype call and chatting with Skype support at the same time. Skype gets more annoying and broken with each version ...
 
12:46 PM
(re: Skype lovely job Microsoft)
 
@Szabolcs Not to speak of the screwups who seem to be take pleasure in tormenting random Skype users... sheesh.
 
Okay, thanks for the explanation. Let me start with a point about syntax. I think setting HoldFirst on Rule is clever, but it seems potentially troublesome. If one tries to build rule lists and pass them to the function, the behavior changes. Further, using Rule seems to imply the general pattern matching usually available, whereas here one must use a symbol (or do a replacement beforehand). Perhaps using the inject[{a = 1, b = 2}, . . .] is clearer?
@JM I haven't been on Skype in a while; what are you referring to?
 
@MrWizard I haven't been either, precisely because of those random callers who apparently want to see a few choice body parts... yecch.
 
(Off topic: Am I the only one who sometimes seens a -> b as backwards? It looks like "a taking the place of b" to me. I'd pretty much gotten used to it, but my backwards-rule inject method reminded me that backward actually seems right.)
@JM oh my O_o
 
@JM I never got any of those fortunately. I used to get random people wanting to add me, but not anymore.
 
12:52 PM
@Szabolcs That's not nearly as annoying, I'd say. But, annoying nevertheless... :)
@MrWizard I've always read a -> b as "a is turned to b"...
(except in the case of Limit[], where it reads like the usual calculus way.)
 
@JM One thing I like about Skype is that it seems to have the best underlying technology for video and voice calling. The interface to access it is a different thing though ... but the video calling technology is just amazing. Especially when the connection is not great. I sometimes use MSN and sometimes QQ messenger, and both of those behave much worse than Skype.
I'll be back in 5 min MrW
 
Okay Szabolcs.
Heike just posted this nice answer.
 
@Szabolcs Oh sure, I don't dispute that it's technically awesome. It's the users who are ruining a good thing, essentially...
 
@MrWizard That's a good point about changing the behaviour of rules. It can break thing. Why I used rules and not =: it's just because I started from withRules which I was originally using with lists of rules that I passed to it (see this too). Why the HoldFirst in withRules? See my discussion with Leonid on that toolbag post.
@MrWizard but while these made sense for withRules, they don't any more for inject. I agree with you.
 
Let me find that discussion...
 
1:04 PM
@MrWizard somewhat arbitrarily, I started with withRules when writing this function. There's no logical reason why it ended up like this. I agree with everything you said. HoldFirst on Rule can cause trouble, and = instead of -> is more clear. Though maybe not more concise or more clear to implement.
withRules was made because I wanted to re-use parameter lists I had ({a->1, b->2}-like stuff). This function has a different purpose.
 
Okay, I found the discussion, I'll come back to it later. It appears to bear directly on my next question which is what parts of all of this are to be implicitly held unevaluated?
 
@MrWizard all of expr must stay unevaluated so I can use it with Compile. I originally didn't use HoldComplete and ReleaseHold, but tried to rely on attributes. This won't work. To see why, consider SetAttributes[f, HoldAll];, then f@f@f@f[1+1] or Nest[f, Unevaluated[1+1], 5]. The former will get evaluated from the outside (the outermost f first), the latter from the inside (the innermost f first). This might change the results (depending on the definition of f).
Neither of the two evaluation orders would work for this case
What I needed was something like f[expr_] := Replace[Unevaluated[expr], x->y], which would do the replacement without evaluating expr, then return the result without evaluating it again.
neither f@f@f[expr], nor Nest[f, Unevaluated[expr], n] achieves this
The only way is using an explicit Hold
 
An interesting point regarding evaluation order; I shall have to think about that.
 
then if I do a="error"; inject[{a->1}, a], it must return 1
the distinction between -> and :> must be kept
The right way is probably using Block[{a} ... ] to prevent evaluation of a to "error"
that'll change how inject[{a->a},...] behaves, but that doesn't matter anyway
 
This surely is more complicated than it first appeared. :-)
 
1:13 PM
it'll also change how a="error"; inject[{b->a, a->1}, b] behaves, which will be a good thing
but implementing this Block-localization seemed like too much work, so I didn't do it :-)
 
I am going to have to read this again when I am not sleep deprived, but for now this is what I put together. Perhaps we can refine it.
SetAttributes[inject, HoldAll]
inject[{}, expr_] := expr
Quiet[
 inject[{s_Symbol = Sequence[x__] | x_, more___Set}, expr_] :=
   inject[{more}, Hold[x] /. _[s__] :> expr]
]
inject[{a = Sequence[b, 3], b = foo}, Hold[{a, b}]]
 
OK, go sleep now :-) I'll need some time to take a look and figure it out :-) will talk when you get up
 
It doesn't work like that; I cannot sleep yet. :-/
 
@MrWizard Why, insomnia?
 
Something like that. Let's talk about inject that's more fun. ;-)
 
acl
1:28 PM
about that inject, I have been wondering whether all this is really any less clumsy and ugly than just using strings and then evaluating. I have a much harder time reading all this Hold stuff than just string replacements (since with Hold I have to mentally evaluate things to work out what will happen)
 
bastards.. all 3 of you.
 
@acl I suppose it depends on the source of the object into which you are injecting. If it is your own code then StringReplace is probably fine, but more generally Leonid has shown that ToExpression[ToString[...]] is not reliable.
@yoda what now?
 
@yoda which three?
 
acl
@MrWizard where?
 
@MrWizard Three new answer notifications... bah.
The close votes on this question will expire soon
 
1:35 PM
@yoda Closed.
 
This site is goood. :)
It's good that the mods hang out here often :) Now we just need 3 non-mod chatroom regulars above 4k for the quick deletes
 
@Szabolcs are you done with our discussion of inject for today?
 
@MrWizard I should really get some work done :S
Can we come back to it tomorrow? I am interested and want to fix your suggested version
 
1:51 PM
@Szabolcs of course. I'll probably break it a few dozen times between now and then. ;-)
@Szabolcs a teaser: I'm pretty sure I've got := and = working right.
 
@yoda quick deletes?
 
 
1 hour later…
3:11 PM
@Heike 4k+ users can vote to delete bad, closed questions immediately, whereas the rest have to wait 2 days
 
 
3 hours later…
5:46 PM
at mathematica.stackexchange.com/questions/1929/… Szabolcs ued the function Internal`InheritedBlock. Where can I go to learn about this InheritedBlock?
 
12
A: What is in your Mathematica tool bag?

Alexey PopkovInternal`InheritedBlock I have learned recently the existence of such useful function as Internal`InheritedBlock, from this message of Daniel Lichtblau in the official newsgroup. As I understand, Internal`InheritedBlock allows to pass a copy of an outbound function inside the Block scope: In[...

That answer has a brief explanation on Internal`InheritedBlock
 
6:03 PM
If I know of a neat trick that I want to share all of you, what is the right way to do that?
 
The best way to do it is Jeopardy style — ask a question that sets the stage for the neat trick and then answer it yourself. For example, see this question (and answer) by WReach just a few minutes ago
1
Q: Using .NET 4.0 from NETLink

WReachUsing Mathematica 8, I can check the version of the .NET framework used by NETLink as follows: Needs["NETLink`"] InstallNet[]; LoadNETType["System.Environment"]; System`Environment`Version@ToString[] "2.0.50727.5448" As you can see, it is the old 2.0 framework. However, my machine has ve...

If you want to spice it up and increase the fun, you could just post the question and wait for a day while the rest of us break our collective minds trying to figure out a neat way, and then post your solution when we fail
 
@yoda Given the speed at which questions get answered here, I wouldn't wait for more than 20 minutes before posting your solution.
 
:)
 
 
1 hour later…
7:10 PM
Offline for maintenance.
 
"There is absolutely no cause for alarm"
 
@Ted I learned about most undocumented functions like that here and on StackOverflow. After a while it becomes unavoidable. You'll see many more if you browse the site. We have a culture of system spelunking :-)
can feel the withdrawal symptoms ...
 
 
2 hours later…
9:15 PM
...and we're back
 
 
2 hours later…
acl
10:59 PM
the hottest question on SE is apparently this
11
Q: Save interpolated function

partial81Is it possible to save a function which was created via Interpolation of some data in such a way that I can use this function in a new mathematica session without repeated interpolation of the data? For example, I have some data which I interpolate in the following way: exampleData={{1,1},{2,3}...

discuss
 
11:13 PM
@acl At least it's better than What makes a champion squishy? or Why Does Samwise Gamgee Call Frodo Baggins 'Mr. Frodo'? which were the hottest questions yesterday (after the confetti question moved/closed) and the day before.
 
@JM Did you just edit a space in mah minimal Latex code? i^mJ_m is perfectly fine! Stop wasting bandwidth!
 
@David Talking about bandwidth, you just spent a whole sentence complaining about one space.
 
That thread will pile up enough visitors to make up for this, and much more!
nyway i hve to sav lettrs nw
 
acl
@Heike yes...
 
@Heike Don't mention the confetti indicent.
Sad story.
 
11:20 PM
@David confetti-gate
It's too bad avatars can't be moving gifs
 
Also they would move your account and then close it
Hurr we do everything with votes here. Except for when some moderator comes by who doesn't know jack and thinks "oh I'm going to use my tools now"
 
I think the moderators are voted for
 
Not by Mathematica.SE
We have our own moderators and they're perfectly reasonable
Also they are actually following this site
 
acl
11:38 PM
OK, for this question
0
Q: Keeping Text Size the Same Throughout Entire Notebook File

night owlIs there a way in which when you choose to format the size of the font within your notebook, for a particular cell, when you go into another cell, the default size font (12pt) will not be re-activated. I want the font size to stay constant throughout the entire notebook, until I go back and need ...

I posted a basic answer with links to the docs. I don't feel up to explaining in detail how to set up, use and modify stylesheets; if someone else does, please do so and I'll remove my answer
 
@acl To be honest, I don't really understand what the OP means.
 
acl
I interpreted the question to be such that the answer is "set the default text cell to have a font of X pt rather than 12pt"
ie, it seems to me that he wants all text cells to have the same eg font, and the one he wants is not the default. could be wrong though
 
@acl After having read the question for the third time I think you're right.
 
have to change the style sheet
 
acl
@Heike not relevant to this site, but what do you think of landau-lifshitz's "fluid mechanics" (if you've ever used it)?
 
11:46 PM
problem is that when increasing front size from the format menu, it only has a local effect
not on the entire notebook
 
acl
@Szabolcs yes that is what I answered. if you have the energy to explain in mode detail, please do that.
 
@acl I've heard of it but I've never used it.
 
acl
@Heike OK, I was simply curious how a mathematician would view it
 
Judging from the table of contents they go through the subjects quite fast.
I've just discovered that DensityPlot has a LightingAngle option.
2
 
acl
@Heike their books tend to be denser than average.
eg the Cole-Hopf transformation is not explained; it is given as the answer to a question. in total, 2 paragraphs
 
11:56 PM
That's what I gathered from the few pages I could see on amazon.
 
acl
(both question and answer)
in vol 1 (mechanics), the first section (2.5 pages, I think) introduces the concept of the action and calculous of variations. most of the rest of the 10 vol series use this heavily, but that's it for an explanation.
 

« first day (31 days earlier)      last day (4454 days later) »