« first day (1287 days earlier)      last day (3198 days later) » 

7:34 AM
@rcollyer What do you think about the above? Worth sending a bug report, or it's just designed like this?
For publication figures with plot markers I new went back to SciDraw's DataPlot instead of ListPlot ... SciDraw is cumbersome, but it does produce very good results.
@all, why was this question closed and why is it not considered a bug? Am I missing something?
 
8:18 AM
@Szabolcs The Details section of Subgraph doesn't say that it reproduces the weights ...
so perhaps considering it a bug is too harsh
 
8:38 AM
@belisarius Nor does it say that it doesn't preserve properties (which may include many other things than weights). Other systems that I tried to preserve weights, and it's what I would expect. Also, reimplementing Subgraph without properties is pretty trivial, but preserving properties is not.
As a workaround one might try to use VertexDelete to get rid of everything that is not in the subgraph. But I remember seeing several bugs related to VertexDelete and properties, so doing that is likely to open Pandora's box.
I am not happy at all with the quality of graph-related stuff and the responses given by WRI about graph-related bug reports.
It's just plain ridiculous to claim that this is not a bug, for example.
 
Hi everyone, I have (I think a simple problem), but I as a frequently user of mathematica can't solve it. Is there anyone with a free minute? =)
I have three matrices, and want to first interpolate the points in between. After that I want to take the mean of all three and plot ist in 3D.
e.g.
TestData1 = {{1, 1, 1}, {1, 2, 1}, {1, 3, 1}, {1, 4, 1}, {2, 1,
1}, {2, 2, 3}, {2, 3, 3}, {2, 4, 1}, {3, 1, 1}, {3, 2, 3}, {3, 3,
3}, {3, 4, 1}, {4, 1, 1}, {4, 2, 1}, {4, 3, 1}, {4, 4, 1}};
TestData2 = {{1, 1, 1}, {1, 2, 1}, {1, 3, 1}, {1, 4, 1}, {2, 1,
1}, {2, 2, 4}, {2, 3, 4}, {2, 4, 1}, {3, 1, 1}, {3, 2, 4}, {3, 3,
4}, {3, 4, 1}, {4, 1, 1}, {4, 2, 1}, {4, 3, 1}, {4, 4, 1}};
TestData3 = {{1, 1, 1}, {1, 2, 1}, {1, 3, 1}, {1, 4, 1}, {2, 1,
1}, {2, 2, 1}, {2, 3, 1}, {2, 4, 1}, {3, 1, 1}, {3, 2, 1}, {3, 3,
int1 = Interpolation[TestData1, InterpolationOrder -> All] ;
int2 = Interpolation[TestData2, InterpolationOrder -> All];
int3 = Interpolation[TestData3, InterpolationOrder -> All];
MeanTotal = Mean[{int1, int2, int3}];
Plot3D[MeanTotal[x, y], {x, 1, 4}, {y, 1, 4},
ColorFunction -> "DarkRainbow"]
The only thing I get is a blank plot =(
I meant I am an infrequently user of mathematica, sry^^
 
8:57 AM
@Szabolcs I don't mean I consider the current behavior as "satisfactory". It's clearly a deficient implementation, but I'm not quite sure we can call it a bug.
 
@Jacccy your meanTotal is not a function
try
MeanTotal = Mean[Through[{int1, int2, int3}[##]]] &
 
@Kuba Hi
 
@belisarius Hello :)
 
@Kuba What's that green thing?
 
@belisarius Milky way seen from Earth in H-alpha window.
If I remember correctly ;P
 
9:01 AM
@Kuba OMG. Do you have a selfie from Pluto too?
;D
 
@Kuba Thank you, works quite well =)
 
@Kuba Nice, indeed
 
@belisarius They haven't taken me so I don;'t have such selfie ;(
@belisarius p.s. according to interpolation documentation such interpolation of triplets should not work, right?
@belisarius but it's working...
 
@Kuba I was starting to read the question when you answered... so I didn't bother :P
 
@belisarius ok. and now? ;)
 
9:08 AM
@Kuba Damn
let me read it
@Kuba Isn't it documented ?? I use it all the time
Nope, it isn't
well... you know
 
@belisarius :) it seems those triplets should be converted to {{x,y},z} first
according to docs
 
@Kuba Yep. There are a few other surprising things with Interpolation ... like interpolating vectorial functions
 
@belisarius well I don't mind, at the end I prefer when docs are behind the kernel than the opposite ;P
 
@Kuba And when the number of bugs is behind the number of new functions :P
 
9:27 AM
@belisarius that's tricky, first you have to find those bugs. so by constantly adding new you function you may be able to have better ratio ;) the difference is you can only count found bugs :)
 
@Kuba He! I remember stupidly staring at some naïve textbook explaining why the objective of our perception is filtering reality and not the opposite.
 
9:44 AM
@Kuba, that's a Bonn projection in your Gravatar, right?
 
@Guesswhoitis. yep, Bonne
 
Heart gave it away… :) my favorite one, however, is Peirce's.
 
@Guesswhoitis. I saw that topic, I'm planning to use it for a wallpaper when I buy a flat or something.
 
The tileability is the best part of it! :D
 
@Guesswhoitis. Indeed :)
 
 
2 hours later…
11:52 AM
@Szabolcs that ordering of plotting is likely coming from the c-code, so not straight forward to address. I don't know if the developer thought about the ordering or not when it was implemented. Please file a suggestion with support, as I think you'll be more articulate about it than I will.
 
12:27 PM
@rcollyer Hi, do you have any idea how to solve this? :)
5
Q: Export XMLElements with MathML contents

KubaSetup Here's my mathML expression: mathML = ExportString[1/2, "MathML"] "<math xmlns='http://www.w3.org/1998/Math/MathML'> <mfrac> <mn>1</mn> <mn>2</mn> </mfrac> </math>" and an XMLElement: xml = XMLElement["tag", {}, {"data", mathML}] Task and the problem which I'd like to Expo...

 
@Kuba well, um, that's "interesting".
give me a moment to play with it. I don't have any idea how to do it off the top of my head.
 
@rcollyer sure, thanks :)
 
@Kuba Ok. This is a bit out there, but appears to work: bypass ExportString for <tag>. Use xml = XMLTemplate["<tag><wolfram:slot/></tag>"], then xml@ mathML gives you what you're looking for.
the only reason I even considered it, was I was working with TemplateObject yesterday, and got it to do things I hadn't before. :)
 
12:43 PM
@rcollyer and what is tag has attributes etc? If you mean that I have to redefine XMLElement locally for purpose of exporting then yes I know I can do this, I just wanted to do this if everything else fails :)
@rcollyer However, I'd probably start with different way, thanks for an example with XMLTemplate.
 
@Kuba tag can have any attributes you want. Unfortunately, XMLTemplate inserts the literal string, so it isn't as robust as it could be.
 
@rcollyer yep, I mean for something like

XMLElement["tag", {"attr" -> "value"}, {"data", mathMLstring, XMLElement["tag2", {}, {"data2", mathMLstring}]}]

I will need better template
 
yep. Wish I had a better way.
 
@rcollyer don't worry :) thanks for your time :)
 
wait, you could convert the mathml to the internal xml representation.
 
12:52 PM
@rcollyer How to do this?
and get mathML at the end?
 
you need to perform a "round trip", e.g.

ImportString[ExportString[expr, "MathML"], {"MathML", "XMLObject"}]
Then, you need the first element.
Not straightforward, but everything is in the same representation, then.
So, then
XMLElement["tag", {"attr" -> "value"}, {"data", mathMLstring, XMLElement["tag2", {}, {"data2", mathMLstring}]}]
makes sense with mathMLstring replaced with an XMLElement.
 
@rcollyer Nice! Let's go with XMLElement instead of Object and it is even better:
Composition[
  ExportString[#, "XML"] &,
  XMLElement["tag", {}, {"data", #}] &
  ]@ImportString[
  ExportString[1/2, "MathML"], {"MathML", "XMLElement"}]
 
It yelled at me when I used XMLElement, but if you get it to work, great!
 
@rcollyer any idea how to not loose indenting and newlines in a preocess?
 
@Kuba no, unfortunately.
I think it has to do with "data", actually, as it isn't an XML element, itself.
 
1:03 PM
@rcollyer feel free to post an answer anyway
 
sure.
Generally, text cannot be next to XML, the text needs to be contained in an element.
 
@rcollyer well, the contents of children in MathML expression are also not XMLElements on -1 level
@rcollyer you mean only the very -1 level may contain strings?
 
yep.
more specifically, the leaves, as level is poorly mapped to a hiearchy
 
@rcollyer That's a little bit unfortunate but I can live with this :)
@rcollyer Thanks again :)
 
in other words, a string can only have strings as siblings.
@Kuba not an issue.
was fun to look into
 
1:07 PM
:)
@rcollyer It;s always fun if it's not you who needs the solution asap :P
 
@Kuba yes, yes it is.
I finally got templates to do what I want yesterday, so maybe I can finish a project I was working on. :P
 
 
2 hours later…
2:40 PM
I just wanted MissingQ while typing, but kept 10.1 and just added MissingQ[expr_] := Head@expr === Missing to the top of the file. I'm wondering which feature will end up pushing me over the edge to download 10.2.
 
2:52 PM
I do tend to prefer the predicate naming conventions from more mainstream languages like IsInteger(value) as opposed to Wolfram's IntegerQ[value].
With Wolfram's flexible syntax you could have great readability for things like If[value // IsMissing, ...].
 
Hello! would anyone know why this fails? `Needs["NDSolve`FEM`"]
disk = ToElementMesh[Disk[]]
NMinimize[x^2 + y^2, {x, y} \[Element] disk]`
whereas this works `NMinimize[x^2 + y^2, {x, y} [Element] Disk[]]
 
3:07 PM
@Michael, MatchQ[expr, _Missing]
 
@Guesswhoitis. That was my first instinct, but I'd guess there would be a slight performance gain with Head@# === Missing for millions of items.
Parsing large Wikipedia log files
 
Ah, okay…
 
@Guesswhoitis should I make a question of my question? :-)
 
Which question, the one you already asked on main, @chris? :P
 
well uhm… i can remove it really quickly if its too stupid :-)
I have made it effort of stripping my problem to a simple one. :P
@Guesswhoitis illian had the solution. Thanks anyway for the humor :-)
 
3:25 PM
Unexpected. A 23 million item association (string->int) dumped as an 881 MB .mx file. Adding an extra int (string->{int, int}) dumps as an 877 MB .mx file.
 
@chris Try NMinimize[x^2 + y^2, {x, y} \[Element] MeshRegion@disk]. I guess NMinimize does not handle ElementMesh objects directly.
@chris Just saw that you asked & ilian answer on main site.... Cheers!
 
3:42 PM
@MichaelE2 thanks! Sorry for the double query.
 
@chris No problem.
 
3:57 PM
@MichaelHale The naming convention for predicates in Scheme and probably other Lisp dialects is to place a question mark at the end like so: real? They got a lot of inspiration from Lisp in the early days I think, so that's probably where it comes from.
 
@Pickett Ah, makes sense.
Added some new stuff to Wikipedia category browser:
 
Are there any version 10.2 users here who would like to help me?
@Michael @Pickett
 
4:16 PM
@Mr.Wizard I'm still only 10.1.
 
@MichaelHale Okay, thanks for responding. :-)
 
Created tag wiki, mathematica.stackexchange.com/tags/mesh/info -- Feel free to review, edit, or respond with suggestions.
@Mr.Wizard I got 10.2 a couple of days ago. I'll be making lunch soon, but I'll do what I can.
 
@MichaelE2 Do you have a few minutes now or should I wait until later?
 
@Mr.Wizard I can spare a few now
 
@Guesswhoitis.

rudinShapiro[n_] := 1 - 2 ThueMorse[BitAnd[n, Quotient[n, 2]]]
thueMorse[n_] := Mod[hammingWeight[n], 2]

mm = 10^(10^4);
reps = 1000;
(Do[RudinShapiro[mm], {reps}] // AbsoluteTiming // First)/reps
reps = 10000;
(Do[rudinShapiro[mm], {reps}] // AbsoluteTiming // First)/reps
(Do[ThueMorse[mm], {reps}] // AbsoluteTiming // First)/reps
reps = 100000;
(Do[thueMorse[mm], {reps}] // AbsoluteTiming // First)/reps
RudinShapiro -> 0.0013862

rudinShapiro -> 0.000157332

ThueMorse -> 0.000142774

thueMorse -> 5.16651*10^-6
 
4:27 PM
@MichaelE2 Sorry, I am disorganized; one minute.
@MichaelE2 I am curious about the performance of SequenceFold and SequenceFoldList. Would you time
fib[n_] := SequenceFoldList[Plus, {0, 1}, ConstantArray[0, n - 1]];

NestAccumulateAlt[f_, start_, n_Integer?Positive, m_Integer?Positive | All] :=
 With[{x = Internal`Bag@start, spec = -m ;; /. -1 ;; All :> All},
  Do[Internal`StuffBag[x, Internal`BagPart[x, spec, f]], {n}];
  Internal`BagPart[x, All]]

myfib[n_] := NestAccumulateAlt[Plus, {0, 1}, n - 1, 2]

fib[50000]; // RepeatedTiming
myfib[50000]; // RepeatedTiming
 
@Mr.Wizard fib -> 0.38 and myfib -> 0.18. (Macbook Pro, 2.7GHz)
 
Not an exact comparison but it seems my code is faster than the new built-ins, yet again. :-(
I suppose SequenceFoldPlus is just another top-level definition, right?
 
@Mr.Wizard I recompiled the Hamming weight thing using Visual C++. Hopefully it works this time? ge.tt/api/1/files/2eveVFL2/0/blob?download
 
@OleksandrR. Thanks; I'll test it shortly.
 
@Mr.Wizard I couldn't get OpenMP to work in my version of VC++. But it seems essentially just as fast anyway, so it shouldn't matter very much.
 
4:34 PM
@Mr.Wizard Yes. One can even PrintDefinition it. It ultimately calls FoldList.
 
@MichaelE2 Yuck. Don't introduce new functions until they are fast.
3
 
@Mr.Wizard I think it's what they call "syntactic sugar," although these CS terms tend to float vaguely in my mind.
 
Actually I have wanted a fast implementation of a multi-argument Nest and Fold for a while, which is why I had an old implementation of "NestAccumulateAlt" floating around and also why I asked this question some while back. It would be very nice to have these functions in a fast, low-level implementation and not simply "sugar" as you say.
@MichaelE2 Enjoy your lunch. I think I'll also move on to something that won't make me unhappy now. :^)
 
@Mr.Wizard Wolfram mentioned something at WTC about wrapping "idioms" up in a top-level function. I took it he was talking about this sort of thing. But I agree. It seems bad in way not to think about the implementation. -- OK, thanks. I hope you find something enjoyable.
 
4:58 PM
@Oleksandr, ah… :) Now, replace the ThueMorse[] in rudinShapiro[] with the one using hammingWeight[]. :)
 
@Guesswhoitis. wow, how did I miss that! Of course I should have done it from the beginning. Hold on...
@Guesswhoitis. down from 0.000157332 to 0.0000105848 seconds (15-fold reduction)
 
Now that's both amusing and infuriating…
Thanks, @Oleksandr!
 
@Guesswhoitis. thanks to you! Actually, I had to install 10.2 to test this. Still not using 10 for everyday purposes but with all the fixes I might start.
 
I think the goal with these was the lowly "just works" instead of the usual "works reasonably efficiently". :)
Oh wow, I appreciate you indulging me despite the hassle… :)
 
@Guesswhoitis. still, being ~130 times slower for the Rudin-Shapiro or 30 times for the Thue-Morse sequences than a user can do for themselves, seems like they are somewhat failing to harvest the low-hanging fruit
 
5:10 PM
So, my question again… why are these developers being rushed to release functions that are at times half-baked? *sigh*
3
 
Still, at least all this is free for the taking on SE, if anyone needs it. Want to write up a question/answer about it?
 
I still haven't had the opportunity to use version 10, to be honest, so it feels like cheating to ask about a version 10 function. :D
 
Analyzing a Dataset of Game Releases
http://community.wolfram.com/groups/-/m/t/537484
 
@Mr.Wizard Sorry, I had to go. Ping me next time you have something you need to try.
 
It was my curiosity about how these performed in version 10 that led me to roping Jacob, and now you, @Oleksandr, into these proceedings. (They are easily done with bit twiddling, so I had assumed they'd be speedy. Oh well.)
 
5:17 PM
@Guesswhoitis. HAHAHA oh wow you'll love this
The builtin Rudin-Shapiro is defined as (-1)^StringCount[IntegerString[n,2],11,Overlaps->True] !!
 
…ah, that's the "obvious" definition. Oh dear… :)
 
Thue-Morse has a more mathematical definition: Mod[DigitCount[n,2,1],2]. Basic problem is that DigitCount isn't too fast, but the approach seems fair enough.
 
But, the kicker: why is it in top-level code when this is supposedly done at bit level? :o
Ah, so with Thue-Morse, it's just the same as Wizard's problem. Okay.
 
No idea. If you ask the question and tag it as a performance bug, maybe Arnoud will be able to get a paclet out? ;)
 
Alright, I'll ask, but it'll feel dirty. :D
 
5:24 PM
@Guesswhoitis. :)
 
@Guesswhoitis. by the way, RepeatedTiming does seem to give the same result (more or less) as the manual approach that I used above. I did not trust it since it didn't seem to be taking long enough especially for the Thue-Morse sequence.
 
Here goes nothing:
0
Q: Speeding up the built-in Rudin-Shapiro and Thue-Morse sequence functions

Guess who it is.Version 10.2 introduced two well-studied sequences as functions: the (Golay-)Rudin-Shapiro sequence (RudinShapiro[]) and the (Prouhet-)Thue-Morse sequence (ThueMorse[]). Since these functions are defined in terms of the bits of an integer, one would expect these functions to evaluate very fast th...

(Ah, I still hate writing questions on a phone… if I misformatted anything, could any of you edit it?)
 
@Guesswhoitis. it seems good. But if you need me to edit anything in, just say so.
 
Thanks, @Oleksandr. Time for you to show off! ;)
 
@Guesswhoitis. I thought you would want to take credit for the answer? You provided the Hamming weight-based definitions (I wouldn't have known them; I never heard of these sequences before today...)
@Guesswhoitis. But, if you find it too inconvenient to answer on a phone, I can certainly write one. However, as I see it, all I contributed to it was providing the real-life timings!
 
5:40 PM
Please write an answer for me; this phone sucks. :o
Besides, the Hamming weight function is your baby; I just roped it to a different use. :)
 
Is there anyone around here interested in language design, compiler design, and/or code golf? I've been working on a little project that has a bit to do with all of these, in the form of a mini-version of MMA
 
(The only thing nice about this phone is that it has a Greek keyboard, so putting in things like π is a bit convenient.)
 
The way I have it imagined right now is almost a complete gloss of the basic bits of the language with some minor syntax changes. I could write up a spec sheet of what I have (something like version -3*10^4), if anyone is interested in collab.
 
5:56 PM
@hYPotenuser I would be interested in seeing the spec sheet at least, probably can't contribute towards a compiler though.
 
At least in the near future, it wouldn't actually "compile," so much as translate into Wolfram Language code. I'm working on a little pattern-based parser right now that just takes in a string in the mini-language and spits out its equivalent in verbose MMA.
 
@hYPotenuser ok, I would call that an "interpreter". That's easier.
 
Yeah that's the word. I've just found (at least on the Internet -- I have no formal CS training) that people tend to use the term "compiler design" to refer to a whole range of activities.
 
6:29 PM
@Mr.Wizard did the DLL work?
 
6:54 PM
@hYPotenuser What exactly should be the goal of this exercise? Do you plan to do in the Wolfram language or do you plan to write the parser/interpreter in another language?
You might be interested in the Mathematica plugin for IntelliJ because it contains a parser.
@hYPotenuser It is written in Java and last night, I extracted the parser, so that one can read in Mathematica code and work on the abstract syntax tree or do evaluations like you plan. See here.
Or ping me if you like to discuss specific questions. I might be interested and I probably have answers to some questions.
 
I'm already working on an interpreter in the Wolfram Language, and having no experience in that department things are going awfully slow. (Not to mention that I'm trying to interpret a moving target; my idea of the language is very vague still.) Insofar as there's a "goal," it's to share my disjointed imaginings with others in hopes that they find value in them -- and maybe come up with goals of their own.
Looks exciting @halirutan ! I'll take a look when I have a sec.
Here's a start, @Pickett
 
7:09 PM
@hYPotenuser In you language spec, let's say you have a nested function call like
Times[Plus[a,b], Sqrt[c], d]
how do you plan to write this in your syntax with no bracket?
 
It's not bracketless. I guess I didn't make that clear. I'll add the sentence: "The syntax lessens the number of brackets you'll be typing, but to avoid ambiguities some will be necessary.
In this particular case, it looks like Times (Plus a b) (Sqrt a) d
ooh I should actually make a note about infix operators
 
@hYPotenuser Yes, let's assume we need functions that don't have infix operators.
@hYPotenuser The problem is that you save exactly 2 brackets, not more :)
For nested lists, that are pretty common, the situation is similar.
 
This is true, for sure. How can we get that down? All the (completely) bracketless notations I've found seem difficult to use with any-ary operators..
 
@hYPotenuser The only solution are operators that have precedences like they are used in Mathematica. I just wanted to point out, that you don't really save typing because in real live you need nested calls of function always.
 
I guess the prefix notation as is only saves the outermost two brackets of a given expression
 
7:25 PM
@hYPotenuser Yes. All the short nice code snippets in Mathematica always contain operators that make it possible to shorten the notation.
 
@halirutan The upshot of this is that "terseness" in terms of short, simple-looking code and "terseness" in terms of actual length are not necessarily the same thing as design goals. I have been guilty of conflating them as I sketch this out, and I'm inclined to favor the former. But if there's serious interest in using this idea for code golf, maybe it can be steered toward the latter.
codegolf.stackexchange.com/a/47360 is a sample of what Mathematica becomes when golfed down.
 
@hYPotenuser It would be interesting to see some sample problems solved with your syntax, I think it would be easier to judge it then.
I've done some code golfing with Mathematica, and I find that it is pretty good as is. The main problem is the long function names.
 
Maybe my design goals are closer to rebmu.hostilefork.com
@Pickett I rather agree. There's a lot of overhead in those function names.
 
7:42 PM
@hYPotenuser If you want to hear more about WL's shortcomings as a code golfing language you could head over to the codegolf.SE chat and ask the moderator there, Martin Buttner, about it. He has (1) designed his own code golfing language (2) answered a ton of Code Golf questions with Mathematica and (3) knows several code golf languages.
He would probably have interesting opinions about it.
 
@Pickett good tip. I'll get in touch.
 
8:00 PM
@Pickett The long function names are crucial. But anyway you can't compete with golf-designed languages for standard golfing problems. They are an arranged marriage. You can when the challenge isn't "golf standard" (ie, part of the marriage contract). Like here:
18
Q: "Sorry, young man, but it's Turtles all the way down!"

luser droogExecute a Lindenmayer System A Lindenmayer System (or L-system) is related to Thue and Post systems, and is used in botanical modeling and fractal generation. An L-system is described by string-rewriting where a symbol from the symbol-alphabet is mapped to a replacement sequence of symbols. A c...

 
"Golf-designed languages." That's not a design paradigm I would want to deal with at work.
 
@Guesswhoitis. I take it you didn't manage to get your computer back from the shop yet, then? We should think seriously about doing a collection, as it was for Mr. Wizard to get an update from version 7. People seemed keen when I mentioned this before but I simply don't know the logistics of it. If you can set up a GoFundMe (or some other site) account for yourself, it would probably be more straightforward than if it were done by a third party, although I could do it if need be.
6
(Since I'm UK-based, the card processing fee is less than in some other countries.) But, in that case I don't know the practicalities of transferring the money elsewhere.
 
8:16 PM
@kirma There are quite a lot of them!
 
@belisarius Yes, I agree. As I recall you also answered another Code Golf question with CellularAutomaton which caused some people to fall off their chairs, which shows MMA's other strength for code golfing: a big API.
 
@Pickett Yup.after some "fighting" they started to post restrictions and I leaved the site. They want to live up to that marriage and it is they prerrogative, of course
 
:)
 
 
1 hour later…
9:36 PM
they should make code basketball: longest code which accomplishes the task in the shortest amount of time
of course whitespaces would have to be controlled
 

« first day (1287 days earlier)      last day (3198 days later) »