« first day (715 days earlier)      last day (3766 days later) » 

12:15 AM
@OleksandrR. Hm. For example I would need to get {{1, 3}, {{{1, 2}, {}}, {{1, 4}, {}}}} -> f[{{1, 3}, {f[{{1, 2}, {}}], f[{{1, 4}, {}}]}}] but I'm not sure how to accomplish this with rules. Mr. Wizard was able to find a pattern that matched just what he wanted in that example.
 
@Calle Replace[{{1, 3}, {{{1, 2}, {}}, {{1, 4}, {}}}}, p : {{_Integer, _Integer}, {___}} :> f[p], {0, Infinity}]
 
@OleksandrR. Thanks!
 
12:36 AM
@Calle might be better to give your item and data some unique heads rather than relying on identification of list elements by type
Even better, rather than using List for building the tree, use some other head. Then you can just Block[{head = f}, ...] and have the replacements proceed automatically
 
@OleksandrR. That's a very good idea, I'll almost definitely do that.
 
Hello, and happy new year Mathematica Enthusiasts!!
 
12:51 AM
@jmlopez happy new year!
 
Hope I'm not interrupting anything important but I have a question that I'm not so sure if I should post. Does anyone know if there is a way to make Mathematica read a file when it starts? Similar to a bashrc file in bash or setup.m in matlab.
 
init.m
 
Do I place this file in the working directory?
 
Ah, thank you @OleksandrR.
 
12:53 AM
No problem. Sometimes the only problem is knowing what to search for. :)
 
Indeed. Well, now its time to play with Mathematica once again. :)
 
 
2 hours later…
2:31 AM
I defined a function in a package "Myfunctions" to draw a graphic object, but the required parameters were contained in another package "RobotParameters". And I start the package "Myfunctions" with BeginPackage["Myfunctions`",{"RobotParameters`"}]; Is it legal?
 
2:44 AM
Why Mathematica doesn't return a graphic object but shows my function contains Private variables?
 
@novice "Legal"? Depends on whether you have a license to use the package. As for the problem, I think you might be running into some subtle difference in behaviour based on how you're calling the package. See this:
20
Q: What's the difference between these two ways of specifying dependent packages?

ProblemaniaWhat's the difference between these two ways of specifying dependent packages? Method 1: BeginPackage["foo`bar`", {"xxx`", "yyy`"}] Method 2: BeginPackage["foo`bar`"] Needs["xxx`"] Needs["yyy`"] Do they always have the same effect? Note that these packages may be used in a big collection ...

Of course, I haven't seen any of your code, so I assume that everything else is coded correctly...
 
3:00 AM
I find the problem is not about the variables, but the usage of graphcs. Can I use graphic object like GraphicsGroup in my Package?
I find the problem is not about the variables, but the usage of graphcs. Can I use graphic object like GraphicsGroup in my Package?
I know where it is wrong. Thanks
 
 
5 hours later…
7:55 AM
<< Notation`;
Symbolize[
ParsedBoxWrapper[
SubscriptBox["_", "_"]]];
a = Subscript[q, ToExpression[#]] &["t"];
a
q\[UnderBracket]Subscript\[UnderBracket]t = 5;
N[a^2]
Why cann' t I get 25 out of N[a^2]?
 
 
9 hours later…
5:25 PM
@novice It seems you misjudge how the notation package symbolizes things with subscript.
This Subscript[q, ToExpression[#]] &["t"] is not the q_t you defined!
Try a = q\[UnderBracket]Subscript\[UnderBracket]t;
 
 
5 hours later…
9:58 PM
does any one knows, if with Mathematica on-line (not yet released) if one can run dynamic content from the cloud directly without them having to install a browser plugin? I am not able to find an answer to this. wolfram.com/mathematica-online it just says Deploy your dynamic content in a web page or document but what does this mean? HOw is that different than what we have now with CDF's ?
 
10:11 PM
@Nasser Nasser, I'm not sure someone is allowed to talk about this, because it's a private beta.
 
@halirutan yes, I know it is private beta, but it will be useful to at least know such a basic fact about it. Would a plugin be needed on the user end or not. But I guess we have to wait to find out.
 
@Nasser I didn't had to install anything, no.
 
@halirutan nice. that is all what I needed to know. I am looking forward for this to be released to learn more about it.
 
@Nasser I'm one of the unlucky ones who haven't got access, but we can speculate a bit from the docs: reference.wolfram.com/language/guide/CloudFunctions.html
For example it CloudDeploy sounds promising, with its APIFunction: "create a RESTful API to access from the web" -- if we can create a RESTful API, why then, we can create the interface using Javascript and Ajax.
Like I said I don't really know anything about this except for the docs, but the cloud functionality as I understand it looks very promising.
(I just hope they charge for usage -- I can't afford to pay corporate prices...)
 
@Calle thanks for the link. Over my head all of these calls :). I was thinking it will work this: One makes a CDF, post it on some cloud service on the net, and sends a link to others. The other person will simply click on the link to run the app directly from browser. No plugin needed. (javascript ok). if it is any more complicated than this for the end user, that might be a problem.
One of the reasons CDF's are not becoming more popular than they should, is because many do not want to install plugins, and plugins in browsers are issue these days. Not all PC's at school allow one to install plugins. Anythting that can get away from using a plugin is a plus.
 
10:24 PM
@Nasser Yes, that would be ideal. From what I can see EmbedCode is the relevant function for this, it just depends on what kind of HTML it generates. If it's just the HTML to include a CDF or if it's something that works natively in the browser. To me it doesn't matter because as long as it's easy to do computations in the cloud and communicate through an API, I would prefer writing the interface using HTML/CSS/jQuery any day. Those technologies are much better for interfaces in my opinion.
(Of course, learning Javascript libraries to do advanced plotting and stuff like that takes time... I don't know any of those, like D3, yet. But for simple interfaces.)
(Complex plots could also be generated in the cloud and sent as an image to the browser, if necessary.)
 
@Calle I have hoped actually webMathematica will take off. It seems like the ideal solution. I post a CDF on a sever, and the user runs it. No plugin. But I do not see webMathematica used much when I looked into it.
three.js is the current most popular 3D javascript library. It uses webGL. Not hard to learn actually. I can make simple 3D rotating objects with it after one day learning it. Still M is much simpler I find for this sort of thing.
 
@Nasser I would love to use webMMA, but the kind of license that let's you use it for something worthwhile costs too much, at least that's what I remember from when I looked it up. JS libraries are generally very easy to use, but there isn't a graphics framework that is as broad as MMA. And even with MMA it takes time to learn the options that exist and so on. Now imagine having to use five different libraries to cover all the things MMA can do, each having their own names for options.
I agree with you that MMA is much easier for plotting.
But let's say I wanted to write an app where users could input some data and have the app do some calculations, I would much prefer to create that interface using HTML. Plus, I could use a backend built with PHP, which is really great for server backends, and just use MMA for what MMA is really good at. Mixing technologies like that would be awesome.
 
@Calle I am not much fan of mixed technologies. It sounds good on paper but in practice it brings more problems. I prefer to use one platform for everything. Much simpler. Javascript is what everyone these days seems to be into for web stuff. But I do not like Javascript much as a language... we'll just have to wait to see what WL brings to use this year...
 
@Nasser, I'm working with some tests with WebMathematica. It's a nice place to use CDF, but I find the same problem in the company (you mentioned Schools). It's a problem to install the CDF Player in the computers of the company.
 
@Murta but with WebM you do not need a plugin to use it? right?
 
10:39 PM
Another problem, it that it don't works on iPad and iPhones.
The native Manipulate from WebMathematica needs flash
do not works on iOS devices.
 
@Nasser Javascript is the only language supported by the browser. So it's the only choice. Now people are starting to say what you're saying, that hey why not use one language for everything? And they learn node.JS to use JS on the server side. But what it comes down to is what kind of open source exists. There is no Wordpress or Codeigniter built with MMA. So if you want to have a user system you have to write one from scratch if you use MMA for everything.
 
@Murta are you saying one needs to install flash on their browser to use webM based CDF's ? That is not good.
 
Perhaps I want to make an app where users log in and then seamlessly in the same interface can do stuff powered by MMA, that's a good example because PHP is not good at computation.
 
@Nasser, if you try to execute this in some iPhone or iPad, it will not work. wolfram.com/products/webmathematica
It's flash based. I wrote to support this week asking then if they have plans to make it HTML5 compatible or something like that. But get a generic answer.
I was in WTC 2013. The cloud sounds to be interesting.
 
@Murta I do not have an iphone nor an ipad, I do not even have a smart phone. I am old fashioned :) but I believe you. That is what I am talking about. CDF's are not used much on the web from what I see, even though one can do cool things with them in short time. It is all about deployment these days.
I used to visit a java applet web site many years ago, with the most amazing scientific applets you can ever see. Now applets are dead on the web. Too bad. I do not visit that site any more, worried about java applet viruses.
 
10:48 PM
Here is the support answer to my question about HTML5.
"As of now we do not have any information on HTML5 implementation in particular. However, we are working on making future versions of Mathematica compatible with the latest web technologies."
No smartphone!.. I can't live without one!.. :)
 
WR could have initiated a project to generate javascript from Mathematica. This what google did with GWT (write in java, compile to javascript, deploy in browser). I do not know if it is possible to do the same with M. Compile Mathematica to Javascript might be impossible thing to do. But it would be interesting to consider.
@Murta never owned smart phone. I do not even know how to text message. Do not even know if my phone does it. my phone just has a clock on it.
 
@Nasser It's great to hear that. I rarely find someone remotely close to my situation, which is that I do not have phone :)
 

« first day (715 days earlier)      last day (3766 days later) »