« first day (174 days earlier)      last day (4319 days later) » 

12:00 AM
whoa
does adding a ; at the end of a multi line mathematica statement supress it's output?
I was trying to figure out why my BarChart[...]; was not producing a bar chart
 
CHM
@user1311390 yes
Command; suppresses output.
Try this:
 
Print["suppressing output"];
 
CHM
beat me to it
 
Kidding, don't try that
Haha
 
CHM
:)
Well then
Try this
plus1[var_] := Module[{a},
a = var + 1;
]
 
12:07 AM
Typical
 
CHM
If you evaluate plus1[1], you'll get nothing.
So watch out for ; in function definitions.
@Rojo I'm just pointing it out to the new user :)
 
acl
on the other hand,
1;
%
 
@CHM I know, it was a supporting "typical"
 
CHM
Hehe.
 
Beware not to suppress output twice
or you get a span
 
R.M
12:09 AM
@Rojo I'm stuck in fixing the es... I'm drawing a blank here. Can you point out why h_[x_[y__], x_[z__], a___] :> h[x[y, z], a] isn't a valid replacement rule at all levels?
Probably something very simple, but I'm not seeing it
 
CHM
Quick question of mine now. Here's what I want to evaluate:

Select[list[[2 ;; Length@list]], #[[22]] ==
"something" &]
How would I make it into a pure-only function?
I tried this:

Select[#1[[2;;Length@#1]],#2[[22]]=="something"&]

but is no works.
 
@RM Well I see two things
 
@Rojo, I believe the intended example is:
"supressing output";
 
@RM One isn't a problem if the input is sorted, but the same heads need not be at the beginning of the list, or without somethin gin the middle
 
acl
@user1311390 I think he was joking
 
12:13 AM
Also, once you do your first replacement, the head is no longer a list, right?
h_[b___, x_[y__], m___, x_[z__], a___] :> h[b, x[y, z], m, a]
 
I like how one can do:
arbitrary command // Timing
way too cool
 
R.M
@Rojo Oh crap!
 
@user1311390, you'll like this then:
 
R.M
//. h_[a___, x_[y__], b___, x_[z__], c___] :> h[x[y, z], a, b, c] works very well
 
@user1311390, go to the options inspector
 
12:15 AM
what is the difference between a_ a__ a___ ?
 
CHM
@user1311390 wait 'til you read some answers with infix notation...
 
@user1311390 choose Global Preferences, or some notebook like Selected Notebook
Then search for EvaluationCompletionAction
and tick "ShowTiming"
 
R.M
@Rojo so what was the second?
 
@RM nothing, one thing was the head, the second was the order
 
R.M
Oh, ok. I fixed the head with the h_, but missed the adjacent patterns... lol
ok, editing my answer
 
12:17 AM
@RM On my way to +1 you
@user1311390 Once you do that, you'll always see the timing of your calculations at the bottom of your notebook
 
@Rojo: very nice
 
R.M
sob... 15 minutes sooner and I would've capped yesterday
 
Hehe
@RM You missed the pattern on purpose
 
How did I exist on this planet for more than 2 decades without meeting Mathematica?
Actually, nearly 3 is more accurate.
This is the most amazing language.
 
R.M
@Rojo This is a pattern... I'm destined to end my day at 185≤rep<200 I now have about 20-30 days like that.
 
12:24 AM
@RM poor you, man, sorry about that
 
@RM how close are you? should we get a bunch of people to upvote your answers?
Is there a badge for "many das of almost capping" ?
 
R.M
@Rojo hehe, I don't really care... like to occasionally bitch about it :P
@user1311390 whoa, don't.
 
CHM
Good Night.
 
term rewriting is very cool
so basically, Mathematica is Lisp w/o Lisp syntax
(well, it's internal ast)
in terms of simplification, how does Mathematica decide taht Sqrt[3]/2 is more "minimal" than Sin[Pi/3] ?
 
R.M
Look up LeafCount in the docs... that's the default complexity function
 
12:38 AM
LeafCount[Sqrt[3]/2] and LeafCount[Sin[Pi/3]] both return 9
is LeafCount evaluating it's argument first, then applying LeafCount?
i.e. LeafCount[1 + 2 + 3] = 1; whereas I'm expecting sometihgn like 3 or 6
 
R.M
@user1311390 certainly, because it doesn't have any hold attribute
 
yeah, learned about Hold/HoldAll just a few pages ago
is it possible to construct expressions on which === time out?
so: a + b === b + a ; is kinda simple
but it seems like testing whether two things are equivalent can be like
state of this TM === halt
hmm, I think I just answered my own question
 
R.M
@user1311390 Nothing times out by default... I think it'll try forever till it runs out of memory or rules unless you explicitly tell it not to
 
are the internals of the === algorithm public or some mathematica secret?
 
R.M
Don't know if there are publicly known CAS algorithms in the implementation, but if not, the rest is probably proprietary
 
1:25 AM
@RM, that Leonid, not upvoting you based on performance, grr
It's as if he didn't want you to cap
 
 
2 hours later…
3:06 AM
Does mathematica have anything like macros?
 
 
3 hours later…
5:39 AM
@user1311390 What do you mean with macros?
 
 
3 hours later…
8:23 AM
@Heike I guess given the ability to Hold forms, one can basically delay evaluation, take the list, and reasemble it, which should eliminate the eneds of macros.
 
 
2 hours later…
acl
10:14 AM
is it OK for WRI employees to post answers without disclosing their affiliation? (just to be clear, I am asking for opinions, not trying to lead the discussion to a "no").
The main thing that would worry me is that one can end with messy situations (see the talk page on the wikipedia mathematica page). It's unlikely the way things are now here, and I certainly would not want us to alienate anybody, hence the question here.
 
10:39 AM
@acl IMO, yes, absolutely fine. If they want to remain unassociated with WRI as far as Mma.SE goes, or even post anonymously, I have no problem with it. It's not like most of the rest of us disclose our affiliations or even our real names so I don't see why WRI employees should be held to a different standard.
 
@IstvánZachar Unfortunately not any more ... I'm actually from Transylvania, and I just got back from there. It doesn't look like I'll get the chance to visit again until next summer. (I might go to some conferences to Budapest though---I'll let you know!)
@acl I think it's completely fine. Just imagine: what if one day WRI employs you? Your attitude won't suddenly change, and it would feel very bad if suddenly you couldn't post the same way ...
@user1311390 Unfotunately it doesn't, and I'm not sure they can be implemented cleanly and safely. Many of the things that are done with macros in other systems can be done in Mathematica.
 
10:56 AM
@Szabolcs I think it's worth noting though that definitions can be made on arbitrary patterns; we don't have the limitation from other languages that functions and other types of values are different from each other in any way. So the requirement for macros is greatly reduced in the first place.
 
@OleksandrR Yes, thanks for stating that more explicitly!
I hope I didn't sound like I was in a fighting mood here, I was just trying to explain my concerns. I don't have strong feelings about the issue.
@BrettChampion After we graduate, these may be worth putting into temporary community promotion ads If someone from WRI is willing to put together the correctly sized PNG image and post it, I'd vote for these. They're of general interest.
 
11:15 AM
@Szabolcs your answer seems quite moderate. Good points are made on both sides. Personally I'm ambivalent, but I haven't tried SystemModeler myself. It strikes me that these types of programs mainly solve systems of coupled differential equations, which can be done in Mma as well, if you have another method of setting up the calculation (be it manual or based on some intermediate definition). As such IMO the question which sparked this discussion is on-topic.
 
11:29 AM
@Szabolcs A lot of work has gone into Mathematica's NDSolve already, and we know a lot more work still is being done for version 9. It makes sense that WRI would want to make use of this for SystemModeler, so Leonid's perspective on future developments looks very plausible. On the other hand, if Modelica and Mathematica-the-language are completely unrelated, I agree that we ought to think twice before allowing questions that may not relate to Mathematica-the-product at all.
 
11:44 AM
@OleksandrR I did wonder how these modelling programs are different from ODE solvers. The first example in the SystemModeller tutorial just solves $y'(x) = -y(x)$. I put away SystemModeler for a while though and when I came back to it the trial was expired ... so I really only have very minimal experience.
@OleksandrR Maple has a competing product, MapleSim. The strong point of MapleSim compared to other Modelica systems is said to be that it can symbolically simplify the systems of ODEs before solving them, improving stability and speed (???). Or something like that ...
Can't wait for version 9 though!!
 
@Szabolcs yes, it makes sense. I was aware of MapleSim. MATLAB also obviously has Simulink. These two companies being WRI's biggest competitors, the appearance of SystemModeler is not too surprising.
 
I don't really hear much about Maple these days though .. I think it became less popular with physicists.
 
I really have no experience in this field either. In fact the only application of these applications that I'm at all familiar with is in post-Keynesian economics (specifically, the work of Steve Keen, an Australian economist whose approach in using these methods is quite radically different to other economists I'm aware of).
Keen however generates his differential equations from a table that looks like standard double-entry bookkeeping as used in accountancy. And rather than Maple, MATLAB, or Mathematica and their simulation packages, he uses Mathcad and a custom solver.
@Szabolcs Ironically the physics department in my university uses Maple rather than Mathematica. Our site licence for Maple is much broader: all staff and students get to use Maple for free. I wish that were true for Mathematica! Then I wouldn't be the only person using it...
(FWIW AFAICT nobody uses Maple either...)
 
Maybe you can do some magic with Mathematica to convince them :-) Just let them watch while you're building something quick and dirty---they'll be amazed :)
 
The problem is, they're all casual users, most with no programming experience. I'm an experimentalist. The only others who use Mathematica here are theoreticians, and even then, only because one of the professors uses it. His students just use it for doing integrals AFAIK. People here use Origin or Excel for data analysis. I can hardly get over how awkward that is.
 
12:08 PM
Szalbocs?
I have a small program in Mathematica. It works perfect in mathematica.
When I deploy it to CDF Player, it shows these errors:
AppendTo::rvalue: l is not a variable with a value, so its value cannot be changed. >>

AppendTo::rvalue: m is not a variable with a value, so its value cannot be changed. >>

Total::normal: Nonatomic expression expected at position 1 in Total[l]. >>

AppendTo::rvalue: t is not a variable with a value, so its value cannot be changed. >>

General::stop: Further output of AppendTo::rvalue will be suppressed during this calculation.

Total::normal: Nonatomic expression expected at position 1 in Total[e1]. >>
 
@OleksandrR Do you know this one?
@GustavoBandeira Post your AppendTo
 
@belisarius haven't heard of that one. The only data mining program I was really aware of is the one produced by the company set up by the ex-CEO of Thinking Machines. But I forget her name and the name of the product, so "aware" might be overstating it. :)
 
@OleksandrR nutonian works nice (for some problems :) )
and is free
 
This is one of the buttons from the program: ` Button["0", AppendTo[l, 0]; AppendTo[m, Mean[l]];
AppendTo[t, Mean[l]*Total[l]]; AppendTo[e1, 9];
AppendTo[e1m, Mean[e1]]; AppendTo[e1t, Mean[e1]*Total[e1]];
AppendTo[m1, 5]; AppendTo[m1m, Mean[m1]];
AppendTo[m1t, Mean[m1]*Total[m1]]; AppendTo[p1, 2];
AppendTo[p1m, Mean[p1]]; AppendTo[p1t, Mean[p1]*Total[p1]]] `
 
@GustavoBandeira Did you set up m={} or something like that?
 
12:18 PM
@belisarius oh, I completely missed the fact it was free. That's worth suggesting to people then. Usually I suggest either Mathematica or (if they don't want a commercial product) Python + NumPy. For myself, I'm satisfied with Mathematica.
 
All the variables from the project:
l = {0}; m = {0}; s = 300; t = {0}; e1 = {0}; e1m = {0}; e1t = {0}; \
m1 = {0}; m1m = {0}; m1t = {0}; p1 = {0}; p1m = {0}; p1t = {0};
Wiat...
 
@OleksandrR nutonian is just for fitting data. But it "guesses" the functional dependencies
 
MINITAB, Statistica, SPSS, etc. are all used here too. But not in my department!
@belisarius that's interesting. Currently I am fitting some data in Mathematica and guessing the functional dependencies myself. :)
 
@belisarius Strange... the \ does not exist in the original code.
 
@GustavoBandeira the \ is just a line breaker. You can ignore it.
 
12:20 PM
@OleksandrR Try it. You only need 5 minutes to install and run
 
@belisarius OK, I will. Thanks!
 
@OleksandrR Do you have a small dataset? Do you want me to try it on your data?
 
@OleksandrR I'm aware that using m={} may result in some problems.
 
@GustavoBandeira Are you sure you are initializing the vars before using them?
 
Yes.
The vars and the code are in the same cell.
In this order:
Vars
Code
 
12:23 PM
@belisarius The datasets I work with are 4-dimensional image data and are about ~70MB in size. I sum over slices and blocks and fit them using NonlinearModelFit with Daniel Lichtblau's (Daniel Glosemeyer's) trick for simultaneous fitting of multiple datasets.
 
@GustavoBandeira Try m=Append[m, whatever]
@OleksandrR Hehe I remove my offer :D
 
acl
:5298602, @Szabolcs I agree that the rest of us do not have to so it seems unfair. Note that I am absolutely not claiming that they have anybody has shown a bias or anything like that (which seems to be how Szabolcs interpreted my question). Now, I had a specific worry, which neither of you have addressed. Perhaps it is trivial and that's why but could you please discuss that? Saying "what you say is stupid" is fine if that's your opinion :)
What I'm trying to say is, there's a specific thing I'm worried about. What do you think about it?
 
@GustavoBandeira Does it work?
 
@acl Are you worried that sooner or later someone is going to cry foul because too many of the posters are WRI employees (and some don't mention it)?
 
acl
@Szabolcs essentially, yes.
 
12:31 PM
It did happen before, and it's probably going to happen again. There were accusations on A51 before the site was launched and there was that reddit thread and the comments about the "planted question". But none of these people could explain what is wrong with being a WRI employee and posting answers (perhaps without explicitly pointing out their affiliation). I think it's going to be fine, no need to make a big deal about it. Just don't feed the trolls when they appear :-)
 
@acl Why? Nobody is promoting sales here.
 
Fortunately this site is practical enough that it won't be as big an issue as on Wikipedia.
 
Supporting a product (in any way) was considered a good practice ...
 
@belisarius Wait, im testing it now
 
I think I saw a thread about this on Meta.SO once. There was a guy who was giving (good) answers about how to solve problems with his product.
 
acl
12:34 PM
@belisarius did you see that wikipedia talk page I mentioned? it only takes a couple of combative people to make the whole thing a mess. I am, yet again, not accusing any employee of WRI of anything. Can the discussion continue without defending the WRI employees here?
 
@Szabolcs In SO you can't suggest using your product without disclosure, but here we are all using it already
 
That is a much more extreme case than WRI employees posting here, and people agreed that there was nothing wrong with it (his answers were helpful). He at least did has a personal interest to post those answers. That's not the case here.
 
@acl please post the link
 
acl
Look. I have no objection to them participating. I am worried about what I will refer to as trolls taking the opportunity to mess things up. It hasn't yet happened, but more and more people are taking part.
 
The comment on Steven Jobs suggestion is one of the most stupid things you could add to this article. — Preceding comment added by (talk) 02:18, 10 November 2011 (UTC) :Agreed. The placement is kind of insulting as well. It suggests to me, a Mathematica+Maple user, that the Wiki community thinks that Steve Jobs having suggested the name for the software is of first paragraph importance. I don't find that assertion to be notable. Maybe move it to a new section, we could call it "Things people who use maths software don't care about but which are of utmost importance to Steve Jobs fan...
That page has been a mess for many years, unfortunately.
 
acl
12:36 PM
The comment on Steven Jobs suggestion is one of the most stupid things you could add to this article. — Preceding comment added by (talk) 02:18, 10 November 2011 (UTC) :Agreed. The placement is kind of insulting as well. It suggests to me, a Mathematica+Maple user, that the Wiki community thinks that Steve Jobs having suggested the name for the software is of first paragraph importance. I don't find that assertion to be notable. Maybe move it to a new section, we could call it "Things people who use maths software don't care about but which are of utmost importance to Steve Jobs fan...
@Szabolcs OK, perhaps I am worried for no reason.
 
There's that period in young men's lives when they can get excessively combative, and if they have nothing better to do this can turn into aggressively attacking anything non-open source online :)
It's pretty common in IRC channels ...
 
Same thing:
AppendTo::rvalue: l is not a variable with a value, so its value cannot be changed. >>

AppendTo::rvalue: m is not a variable with a value, so its value cannot be changed. >>

Total::normal: Nonatomic expression expected at position 1 in Total[l]. >>

AppendTo::rvalue: t is not a variable with a value, so its value cannot be changed. >>

General::stop: Further output of AppendTo::rvalue will be suppressed during this calculation.

Total::normal: Nonatomic expression expected at position 1 in Total[e1]. >>
 
acl
@Szabolcs I don't see it being combative. And I don't get Leonid's argument at all. I understood it to be: allow questions on X because it may be integrated into mma in the future. I don't really understand this reasoning. Could be misreading it though.
 
@GustavoBandeira No idea. Post a Q :D
 
@acl I'm not talking about Leonid's answer!!! I'm talking about your worry about people attacking WRI folk who post here.
Sorry about the misunderstanding.
 
acl
12:39 PM
@Szabolcs You most definitely were, in the chat comment I linked to...
 
@acl I am belisarius. Steven Wolfram in disguise ... and then what? What am I doing wrong?
 
@belisarius thanks anyway! For me the problem is not so much finding a functional form that fits the data, but rather extracting what I want from the larger dataset and then fitting it in a physically reasonable way. I'll definitely install Nutonian and see what it can do.
 
@acl Getting lost in the web of replies :) I was confused about what was a reply to what.
 
@OleksandrR It's at least a very nice toy
 
Sorry about that.
 
12:41 PM
sorry guys, gotta go!
 
acl
@belisarius Look. We are going in circles. I could not care less if you are Stephen Wolfram or anybody else. I am not saying X or Y are right or wrong in that discussion. I OFFER IT AS AN EXAMPLE OF WHAT I DO NOT WANT TO SEE HERE. Sorry for the caps.
 
@belisarius Ok. Thanks for the help anyway
 
@acl Yes, you're right. It should definitely be avoided. I've seen that talk page many years ago, and I lost all desire to ever click it again (or to edit the main page)... I think something similar has happened twice. Once someone was arguing on A51 that SE, a free platform, must not "support" a proprietary product, and of course he was pointing out that several of the committers are WRI employees. Then there was that reddit thread where someone (who later apologized) accused
@acl the poster of "planting" a question, implying they may be working for WRI and advertising Mma. Both were ugly, but both were resolved, and most traces are gone. Fortunately neither happened right here on this site (even if they were about this site). Based on this experience, and the staleness of the arguments brought up there, I'm not really worried. Also, most do disclose their affiliation. So personally I don't think there will be problems---but it's good to bring this topic up,
we should make sure if there's trouble, it's handled well, and doesn't grow out of control like on Wikipedia.
 
12:56 PM
@acl I'm sorry, I completely missed that part of your question. My perspective on this is, Mma.SE will graduate soon, and then we're autonomous enough that we don't have to care about this possibility any more. If trolls appear, we can just moderate them away again. None of those who fought so valiantly for the beta and not that many (as a proportion) of the active users currently are WRI-affiliated, so it will be hard to cry foul in that sense.
@Szabolcs SE is not a free platform. The software is proprietary and they will want to monetize the network eventually (when and how they will do that I don't know). I get the impression they chose CC-BY-SA to protect their own interests as much as anyone else's. So I think the scope even to push the tired old "free-as-in-freedom vs. proprietary" argument will diminish in future.
 
acl
@Szabolcs Yes, you're right that so far this was kept in control.
@OleksandrR yes that is an excellent point.
I guess I am worried for no reason
 
@acl I think your worries are sensible. But ultimately this site and the SE model is not based on egalitarian democracy like Reddit or Wikipedia. Instead it's a technocracy with some democratic elements. Thus there is a lot less scope for small elements and unpopular viewpoints to cause trouble here than elsewhere.
 
R.M
I missed most of this and couldn't figure it out from the transcript — was there something that triggered this? Most people here have so much pent up frustration from former well-intentioned but annoying SO users and other not-so-well-intentioned trolls on area51 (this was a very nasty episode) that any new trolls will be put down pretty quickly
 
acl
@RM nope, no trigger
 
1:15 PM
@OleksandrR I don't particularly want to get into it, but the reason Steve Keen's methods are unusual is that he came late to economics, as a mature age student. I can't remember what he did before but it influenced his methodological choices. There is a lot to dislike about mainstream economics and its methodologies but he has chosen to start again from a blank sheet of paper. No building on the shoulders of giants for him.
 
@Verbeia he cites Schumpeter, Marx, Minsky, and Keynes as his influences. An eclectic mix, to be sure, but I think there's a lot to like about his approach.
 
 
1 hour later…
2:34 PM
This guy seems to have screwed up his inputs:
0
Q: Mathematica NonlinearModelFit strange output

Jake GearhartI am trying to run NonlinearModelFit in mathematica on some data for a project. It is a fairly complicated model having 9 coefficients, and 5 independent variables. I created the data the way that the model needs, and I think I called the function correctly. Here is a sample of the data: {{16.58...

The sample he gives does not give the problem he reports. I would say so but I don't have an SO account.
 
 
5 hours later…
7:07 PM
@RM I was tempted to use your Composition@@ to build linked lists, but I bumped into a bug I think. You think it's a bug I should report? MMA8.0.4, W7x64, (Composition@@Range[80000])[EndOfString] makes my session die. Up to 50000 for example works great
 
R.M
7:21 PM
I get MaxFormatDepthExceeded for 768 and upwards
(Composition @@ Range[768])[foo]
 
7:32 PM
@RM That's a display thing, you don't get it if you suppress the output
 
R.M
@Rojo kills mine for 30k onwards
 
7:44 PM
@RM Interesting. I don't know what's causing this, if a bug of Composition or what. It works if I split the composition in smaller compositions
 
CHM
8:08 PM
So we can't buy and download Mathematica anymore ;) I'm told that "This item is not currently available for purchase on the web. Please contact Wolfram Research Customer Service for assistance in ordering this product."
That's from the Canadian store.
The student edition is still available, though.
 
 
1 hour later…
9:33 PM
in lisp, I can declare an in palce function with (lambda (x y) (+ x y))
in matheamtica, how do I define an anoymous function "in place" ?
(the answer is not "+" or "Plus")
I want a generic way to define anonymous functions on the fly
 
@acl @szabolcs @belisarius I don't think it's a problem as long as the PR department is left out of the loop. Personally, I would prefer full disclosure but I can imagine there are reasons for some not to do that. The list of users with links to WRI is probably longer than you imagine. I'm aware of 34 users, some who I think are interns trying to learn something here.
 
What's WRI?
 
Wolfram Research Inc
 
Thank you.
 
@user1311390 You show up as user1311390, and not under your mathematica.se name. Why is that?
 
9:39 PM
I have no idea.
How do we fix this?
 
logout/login?
Hi @Heike
How you're doing?
 
Hi Sjoerd
 
Is this better?
Apparently not.
 
Perhaps it's a cache issue
 
I logged out
 
9:42 PM
@SjoerdCdeVries I'm fine. I've started my new job this week
 
I also did chrome -> clear all
 
@Heike O wow, didn't know that. Where are you working now?
 
R.M
@user1311390 @SjoerdCdeVries Your account is associated with Stack Overflow, where you don't have a name set. If you change your chat association to Mathematica, then it'll automatically refresh in 30mins-1hr, or Sjoerd can force it manually
 
@SjoerdCdeVries I'm working for a company that does consultancy for glass manufacturers. They used to be part of TNO but became independent recently.
 
How do I change my chat association go Mathematica?
test
oh wait
I think it works now
victory.
 
9:46 PM
I played with some tools. It was rather hidden that
 
wait ... did I fix this, or did you fix this?
 
@termrewritica I have no idea. I had the option to load your profile from a given site and did that... twice
 
so I'm learning about Listable functions: let me check if this is right: Listable is NOT something the evaluator/kernel evaluator automatically does. It's something that the Funcions do. I.e. they provide a Function[x_] option and a Function[ list of crap ] option .... ?
i.e., for functions wehre Attribute[Fn] does NOT include Listable, the kernel does not autoamtically listable-it
 
@termrewritica yes that's right.
If a function f is Listable f[{a, b, ...}] will be transformed to {f[a], f[b], ...} automatically.
 
@Heike Eindhoven?
 
9:50 PM
ah, that's what SetAttributes can be used for
 
@SjoerdCdeVries Yes
 
@Heike SO, what does a nice mathematician like you in a place like that?
@CHM That would be an indication v9 is coming out, but I seem to be able to order a v8copy.
 
acl
@termrewritica Plus[#1, #2] &
 
someone needs to build a mathematica bot here
 
acl
@SjoerdCdeVries I wasn't worried about them but about trolls (for lack of a better word) using that to create a mess. however I now think it won't be a problem (see comments by @szabolcs and @oleks
 
9:57 PM
@SjoerdCdeVries Mathematics hopefully. They want me to work on model reduction for their numerical models.
 
acl
@Heike congratulations on the new job! what is model reduction in this context? reducing the number of degrees of freedom?
 
@Heike Didn't know they did stuff like that. Glass sounded more like chemistry to me.
 
@acl: I'm trying to follow this thread -- what is the fear? That trolls can cause the mathematica beta to get shut down on SE?
 
@Heike Important question of course is: do they use Mathematica?
 
acl
@termrewritica just that they make it unpleasant. I'm thin-skinned
@termrewritica (did you see my answer on how to define lambda funs?)
 
10:01 PM
no, I ended up just using Function [x, x^2]
oh hmm, that's interesting
Plus [#1, #2 ] &
it reminds me of Clojure's anonymous notatation of #( %1 %2 %3) where %1, %2, %3 are the args
 
acl
@termrewritica yes that too
@termrewritica I don't know Clojure but that's how it works yes
 
Clojure is basically Scheme for people who wants to get shit done, and are willing to give up continuations, tail cail recursion, and embrace the infinite libraries of the JVM
I do find Mathematica, in some sense, more terse than Clojure, perhaps due to the ideas lifted from APL.
 
@acl Thanks. They want to reduce the number of equations in the discretised system by using something called proper orthogonal decomposition.
 
In[416]:= createPoly [coeff_] := x^{Range[Length[coeff]] - 1} . coeff

In[417]:= createPoly[{2, 3, 5, 7, 11}]

Out[417]= {2 + 3 x + 5 x^2 + 7 x^3 + 11 x^4}

Is there a shorter way to implement: transform a list of coefficients to a polynomial?
 
acl
@Heike I see that sounds cool actually
 
10:07 PM
@SjoerdCdeVries They do chemistry as well.
 
acl
@termrewritica FromDigits[coeff, x]
 
@SjoerdCdeVries I'm afraid not, but maybe I can change that over time.
 
acl
@SjoerdCdeVries have fun
 
@acl: nice
 
@Heike I feel your pain
 
R.M
10:10 PM
@acl Reverse@coeff is needed
 
@acl Thanks. Iceland/NY/Cape Cod
 
R.M
@SjoerdCdeVries cape cod is nice... I was there for a while. You'll be there in the peak of tourist time (of course, you're one too :))
 
acl
@RM right, the way it's defined you need FromDigits[Reverse@coeff, x]
 
The average temperature will be comfortable. I'm a bit worried about the extremes
 
R.M
When will you be in NY?
 
10:12 PM
Iceland = 10 degC NY = 35
 
MatrixQ[ lst, <0? ] ... what is the shortest way to express <0? I currently have: Function[x, x < 0]
(exercise 3.5.3 of matheamtica power programming)
 
R.M
@termrewritica what are you trying to do?
Get True/False if x<0?
 
"Write a one-line expression taht tests a list ot see if it is a matrix of negative numbers."
allNeg[mat_] := MatrixQ[mat, Function[x, x < 0]]
 
acl
@termrewritica #<0&
 
is ther a way to shorter then Function[x, x<0] ?
ah
 
R.M
10:14 PM
@termrewritica FreeQ[m, _?Negative]
or _?Positive if you want to check if it is free of positive numbers
m here is your matrix
 
_?Negative = three parts
? = binary operator
_ = represents place holer
Negative = actual function
Is that correct?
 
10:31 PM
ClearAll ends up clearing value + attributes on a single varaible
is there somethign that just nukes the entire workspace?
something like Nuke, Annihilate
 
R.M
Quit
 
In[492]:= Clear[a1, a2, a3, b1, b2, b3, c1, c2, d1, d2]
ReplacePart[{{a1, a2, a3}, {b1, b2, b3}},
{{c1, c2}, {d1, d2}}, {{1}, {2, 2}}, {1, 2}]

Out[493]= {c2, {b1, c2, b3}}
I understand how the b2 -> c2. I am confused how the {a1, a2, a3} -> c2, instead of {a1, a2, a3} -> {c1, c2}
 
R.M
Why are you using 4 arguments for ReplacePart?
 
because it's old matrix, matrix to replace from, old matrix index, new matrix index
hmm
looks like ReplacePart has changed somewhat from Mathematica 3.0
 
R.M
Hmm... it has. The current documentation has no mention of it, yet it works — probably for backwards compatibility
 
10:39 PM
why does it work in that particular way? I don't understand why the first entry is c2 instead of {c1, c2}
I think I get it now
old[[{1}]] -> new [[1, 2]]
 
R.M
Looks correct to me
 
old[[2,2] --> new[[2,2]]
is that the correct way to understand that entire statement?
no no that is wrong
the correct interpreattion is that the 4th argument gets Listable-ed into
ReplacePart[{{a1, a2, a3}, {b1, b2, b3}},
{{c1, c2}, {d1, d2}}, {{1}, {2, 2}}, {{1, 2}, {1, 2}}]
 
R.M
old[[{1}]] -> new[[1, 1]]
old[[2, 2]] -> new[[1, 2]]
 
no no, tis' old[[{1}]] -> new [[1, 2]]
the output is c2
 
R.M
Oh, yeah. Both to [[1, 2]]
 
10:45 PM
Woot, me: 1 point, rest of channel: 9999 points
 
10:56 PM
does matheamtica support function concatenation? I.e. to grab the second element of a list, I want to say first * rest
 
acl
@termrewritica Composition[First, Rest][{1, 2, 3}]
 
nice; I tried ?Concat, but not Composition
 
R.M
@termrewritica first * rest or first[rest[...]]?
 
first[rest[...]]
Map has a shorthand, /@. I'm looking at ? Composotion. Is there no short hand?
Haskell woudl ahve somethign like first . rest
and the "." would be composition
 
acl
@termrewritica First@Rest@# &
 
10:59 PM
the @ says stuff everything after this into a expr hmm
nice; thanks :-)
 
R.M
@termrewritica not everything after... you'll have to follow precedence rules (you'll remember them mostly after a while)
Example: f@x + y
 
@R.M. : are you the author of atleast 4 mathematica books?
 
R.M
Lol! Maeder? Me?
 
The initials match
Roman Maeder
 
Huh, I haven't noticed that coincidence before... :)
 
R.M
11:08 PM
@termrewritica so does it with a particular James Bond actor...
 
anyway, the question has not been answered
RM == Roman Maeder?
 
R.M
sorry, I'm still on the floor
I'm just J. M.'s evil twin
 
enc[msg_] := FromCharacterCode[ToCharacterCode[msg] + 13];
dec[msg_] := FromCharacterCode[ToCharacterCode[msg] - 13];
woot, rot13
(exercise 3.6.2)
 
@RM You should show term your goatee to convince him properly.
 
acl
@JM hi, John Milnor
ok guys, off to bed
 
11:12 PM
@acl thanks for help
with the anonymous functions
 
@termrewritica Well... StringReplace["testing", Thread[CharacterRange["a", "z"] -> RotateRight[CharacterRange["a", "z"], 13]]]
 
J.M.: my Rot13 scheme, by being non-standard compliant, has an additional layer of security by obscurity
 
R.M
@termrewritica what obscurity?
 
Great. Now, try doing Atbash...
 
11:15 PM
it doesn't just rotate the chars by 13; it adds 13 to the ascii value
was that generated by mathematica? does mathematica have a 3d renderer with soft shadows?
 
@RM By Jove, it is unsettling to see an Ouroboros with a goatee... :D
@termrewritica Most of my Gravatars are Mathematica-generated. My current one certainly is.
 
@JM: can you recommend any books/tutorials on the graphical aspects of mathematica?
everything I've read so far is more on the kernel/core of matheamtica
 
CHM
@termrewritica Gimme a minute.
I haven't read them, but I know they exist: mathematicaguidebooks.org/index.shtml
Apparently good.
@termrewritica You should also read this
@SjoerdCdeVries Maybe it's just the Canadian site.
 
11:48 PM
@CHM: it's amazing how humble and helpful the mathematica community is
(looking at the stackexchange response links)
 
CHM
@termrewritica I can't say this site's community hasn't played part in my adoption of Mathematica as my main programming language :)
 
@CHM: what's your occupation that allows you play with mathematica all day?
 
CHM
@termrewritica undergrad, currently doing an internship in chemistry.
And I am writing an unrelated program for a small group of people. Which means I spend a lot of time reading/writing code.
Which is a bit annoying tbh, because I'd like to focus on the chemistry/physics, but meh.
 
which part of chemistry is more symbolic math than matlab?
 
CHM
@termrewritica Mathematica is not only about symbolic math.
The reason I use it is that one of the guys in the group wrote his thesis in Mathematica/FORTRAN, and I'm picking up where he left off.
 
11:58 PM
ha, fortran -> mathematica
that's got to be like writing web apps in assembly -> ruby on rails
 
CHM
Oh, no.
They can talk.
It's just... not my level yet
 

« first day (174 days earlier)      last day (4319 days later) »