« first day (826 days earlier)      last day (3655 days later) » 

3:59 AM
Anyone up for making this in Mma? :-)
 
 
3 hours later…
6:31 AM
@Szabolcs Well... I think this is a starting point:
28
Q: Factorisation diagrams

talegariHere is a way to visualize the factorisation of natural numbers. How do we get this or a similar kind of output using Mathematica? See the list of images generated for number from 1 to 36:

 
 
2 hours later…
8:05 AM
@Szabolcs Oh well, I'd already started when I saw @kirma had found existing code. Here's an iterative version with colors.
GraphicsGrid[
 Partition[
  Table[Graphics[
    Riffle[Table[
      ColorData["BlueGreenYellow"]@Rescale[a, {1, i}], {a, i}],
     Disk /@ First@
       Fold[Module[{pts = #[[1]], r = #[[2]],
           n = #2}, {Join @@
            Table[# + n r Through@{Cos, Sin}[a 2 Pi/n + Pi/2] & /@
              RotationTransform[a 2 Pi/n + If[n == 2, Pi/2, 0]]@
               pts, {a, n}], n r}] &, {{{0, 0}}, 1},
        Join @@ ConstantArray @@@ FactorInteger@i]]], {i, 30}], 5],
 Frame -> All]
 
 
1 hour later…
9:23 AM
@Szabolcs There are a few ugly frame glitches at the beginning, but things are moving around some.
shapes[i_] :=
 Partition[
  Riffle[Table[
    ColorData["BlueGreenYellow"]@Rescale[a, {1, i}], {a, i}],
   Disk /@ First@
     Fold[Module[{pts = #[[1]], r = #[[2]],
         n = #2}, {Join @@
          Table[# + n r Through@{Cos, Sin}[a 2 Pi/n + Pi/2] & /@
            RotationTransform[a 2 Pi/n + If[n == 2, Pi/2, 0]]@pts, {a,
             n}], n r}] &, {{{0., 0.}}, 1},
      Join @@ ConstantArray @@@ FactorInteger@i]], 2]

t = 0;
a = 1;
next[] :=
  keyframes =
   Thread[{Prepend[#, #[[1]]], #2} & @@ (shapes /@ {a, a + 1})];
 
 
2 hours later…
11:17 AM
The point of Putting Community back in Wiki is that questions or answers will no longer be automatically converted to CW. It will make it easier to pitch in, we don't have to worry about inadvertently hurting the original author in the process.
 
11:33 AM
@MichaelHale Nice!!
 
11:44 AM
@Pickett good! About time too. I still don't really understand the justification for implementing arbitrary and inflexible edit limits in the first place, but glad that they're gone now.
 
@OleksandrR. It's good to here the news. But I don't understand why not make votes to CW go to every contributors' rep as a proportional allocation?
 
12:03 PM
@Silvia I think the problem is to determine what's proportionate. To divvy up the score equally among the contributors wouldn't be fair, and would encourage unwanted behavior.
 
12:19 PM
@Pickett Yes you are right. And asking people to vote for every edit is unpractical. Maybe at last we'll still need a powerful AI supervisor O_o
 
12:49 PM
Does Mathematica have any easy ways to generate all graphs of certain sort, in the way of geng in Nauty? Specifically, I want connected graphs without isomorphic duplicates.
 
@kirma What do you mean by "all graphs of certain sort"? Is there any example?
 
@Silvia In this specific case, stuff like geng -c 5: all connected (simple, undirected) graphs of vertex count 5.
 
Also determining whether two graphs is isomorphic or not is a very hard problem, so there might be no easy way. ref: en.wikipedia.org/wiki/Graph_isomorphism_problem
@kirma Sorry but I have no knowledge about Nauty or geng :(
 
@Silvia It is entirely unnecessary, though. There are efficient algorithms for generating such sets of graphs without isomorphisms...
 
@kirma If you want "all connected (simple, undirected) graphs of vertex count 5", I would try generating their adjust matrices first.
 
1:02 PM
Well, 5 is a number that would be solvable with brute force. Consider vertex count of 10; it already contains 11716571 graphs when duplicate isomorphisms are removed. I don't want to imagine what the number would be if all isomorphisms would matter.
 
Hi hello :)
 
@kirma And you want to generate them all? That would take a lot of disk space @_@
@Kuba Hi Kuba!
@Kuba Hmm.. Why I still see your old avatar? :)
 
@Silvia chat room is handled different way I think :) just like the pins that are delayed
 
@Kuba I didn't know pins are delayed here! I always thought it's my bad network..
 
1:09 PM
@Silvia unless you are in the room, the pin is always delayed, at leas in my case ;)
I like your approach to ternary plots :) +1ed
 
@kirma I'm sorry but I'm not that familiar with graph theory. Maybe you can get answers by posting it on main site.
@Kuba Thanks! It's faster than I thought!
 
@Silvia Probably I'll just read output from external program to get my thing done, it's OK.
Quick glance on documentation didn't point be towards obvious way to do it directly on Mma, although it supposedly includes at least isomorphism detection functionality directly from nauty package.
 
@kirma If I remember correctly, mma has an isomorphismQ function since version 5, but it's not very efficient.
 
@Silvia Yep.
 
ok, I have to go, have a good night @Silvia and a nice afternoon @kirma :)
 
1:19 PM
@Kuba Good night! :)
 
@Kuba or afternoon :)
 
I'm having a weird little problem with formatting. Can anybody tell me why in the enormous list in the answer below, the last entry is indented? I know the problem looks like problems I encountered before, but I don't see what's wrong
13
A: What is the complete list of valid Front End Tokens?

belisariusI got a request to post here the undocumented tokens I already posted in an old answer on SO. For completion, I merged my list (which is also in the link provided by @Chris) with @Rojo's list. Later, the list was merged with Vladimir's list below and two more tokens were included, so as to have ...

 
Does anybody have any good examples of card games built with Mathematica? Or failing that, where I could find some resources for how to programmatically build card games in general?
Thank you
 
1:40 PM
@Aron Check out this answer. It has a link to a fully functioning card game in Mathematica. Another question related to card games is this.
I don't think the hard part is the logic connected to card games, but rather just how to build a large application in Mathematica.
 
Looking very nice! Though I would like to say something about using Riffle and Partition together. I hope that doesn't make me sound negative. Anyway, personally I have used a Partition+Riffle "idiom" for a long time, to the point that I quite happy with myself that I knew it. However, I think it is something that should probably be avoided, in view of the following suggestive code

transpose[{a_List, b_List}] := Partition[Riffle[a, b], 2]
betterish[a_List, const_] :=
Transpose[{a, ConstantArray[const, Length@a]}]
observations are backed up by timings :P
A librarylink function should be even faster than betterish here
 
@JacobAkkerboom I guess it's SE's bug about $.
 
@Silvia ah, I think you are right, thanks!
 
@JacobAkkerboom You're welcome :)
@JacobAkkerboom I guess it's mainly because ConstantArray returns a packed array?
@xslittlegrass Hi xs! Nice to see another chinese here :D
 
2:01 PM
@Silvia well, I think not. Riffle also works nicely with PackedArrays (the difference in timings is only a factor 2, not the biggest deal)

nn = 1*^6;
a = RandomInteger[100, nn]; ;
b = RandomInteger[200, nn]; ;
Riffle[a, 2] // PackedArrayQ (*True*)
Riffle[a, b] // PackedArrayQ (*True*)
 
The timing is not that different on my system.
 
@Silvia huh, for me there was a much bigger gap
 
@JacobAkkerboom Might because my PC is very old :)
 
@Silvia ah, for larger values of nn it seems closer
 
@JacobAkkerboom 2*10^7 is the largest nn I can try with my limited RAM..
 
2:13 PM
@Silvia I stopped at nn=1*^7. But I repeated mm=100 times.

Do[betterish[a, 1], {mm}] // Timing // First
19.942520
Do[worseish[a, 1], {mm}] // Timing // First
33.047694
memory use seemed to be the same (MaxMemoryUsed was 400,008,744, much larger than a, which has 80,000,144 as ByteCount and MemoryInUse[] with only a defined was 102,405,480)
 
@JacobAkkerboom It's 25.265625 and 40.531250 respectively here. The ratio is roughly the same as yours.
 
@Silvia yay, so I didn't lie :)
Maybe I will make the librarylink function that beats them both :P
 
@JacobAkkerboom Please do share your librarylink function when it done :)
 
2:33 PM
Could we get some reopen votes here please? It clearly not a duplicate of this, as asserted, and has an answer (that I put a bit of effort into) that is very different from any of those to the alleged duplicate.
 
2:53 PM
posted on April 23, 2014 by Wolfram Blog Team

Mathematica and Wolfram|Alpha are powerful technologies for deepening students’ and researchers’ understanding of complex topics in math and science. These recently published books incorporate engaging Mathematica and Wolfram|Alpha examples and code into texts written for undergraduates, graduate students, and researchers. Composite Materials in Piping Applications: Design

 
3:26 PM
@Silvia Hi :P
 
4:09 PM
Thank you!
 
@MichaelHale Looks great! Maybe we should make a Q/A out of it :-)
 
4:26 PM
@Silvia hm, I am making the function (in SymbolicC even :O). There is probably some segmentation fault now :P
 
4:38 PM
Hi, can somebody check if this command returns some data on your Mathematica FinancialData["^DJI", "Members"] ?
Although this example is in the help it doesn't work
 
@FaysalAberkane I get Missing["NotAvailable"]
 
8
Q: Problem with Financial Data

user1602I'm following http://reference.wolfram.com/mathematica/ref/FinancialData.html I get the following: In[6]:= DateListLogPlot[FinancialData["^DJI", All]] During evaluation of In[6]:= DateListLogPlot::ntdt: The first argument to DateListLogPlot should be a list of pairs of dates and real value...

See the answer below Vitaliy's (and Searke's comment)
 
Thank you this is helpful
 
@leonidshifrin If you feel like being merciful perhaps you could resurrect this answer (deleted) using your Java Reloader. If you care to let me know and I shall undelete it.
Hello @rm-rf , @Faysal
Oh, and @Jacob !
 
Hi @Mr.Wizard
 
4:47 PM
Hello hello :)
@Mr.Wizard hm, I realise now that you asked for the complete list of front end tokens (I commented on that Q&A). Of course we have no reason to assume the list is complete now, so I guess makes sense that there is no accept.
 
@JacobAkkerboom I believe that is indeed why I did not Accept an answer. By the way I just voted for your utility post; thanks.
By the way, although it's sadly buried under a subbu question, rasher posted an answer that deserves attention:
1
A: Efficiently finding the positions of a large list of targets in another, even larger list

rasherPrompted by comments conversation with Mr. Wizard, a routine I use: findMultiPosXX[list_, find_, allowBits_: False, skipCands_: True] := Module[{f = DeleteDuplicates[find], o, l, oo, bitmax = 20, cands, dims}, If[allowBits && Length@f <= bitmax, With[{r = If[Length@(dims = Dimensions@lis...

He's answered several questions using a related Ordering method but I haven't had time to really dig into the rest of them.
 
Hi @Mr.Wizard
 
5:10 PM
Hi @Mr.Wizard. Given that the answerer put a lot of effort into that, this is relevant to the problem / question, and the code does work just fine (I just checked with the reloader), it might make sense to undelete it. But, OTOH, that solution is obviously much harder to extend (than solutions based on pure Mathematica), while the OP was asking about some extensible scheme, and gave that particular pattern just as an example. So, this case is not totally clear to me.
 
Is there a simple way to recreate the coordinate tool used in Wolfram|Alpha queries such as the crosshair/tooltip that shows up with this call: WolframAlpha["Sin[x]", {{"Plot", 1}, "Content"}]?
 
@LeonidShifrin Hello Leonid. Unless @rm-rf strongly disagrees I'd like undelete it and let you work your magic. The poster must of course be made to understand that any new contributions must specifically target Mathematica, but I'd like his effort not to be lost.
 
Hi everyone -- I've got a quick question that may not merit posting on the main site. Given the known problems with securing a package using Encoding, does some way exist that would delete or destroy a package if someone attempted to break the encoding?
 
@Mr.Wizard I tend to agree for this case. That was a lot of effort directly addressing the problem, so it would be a pity to waste it. Perhaps we could wait for @rm-rf's opinion too, to have a full consensus.
 
@LeonidShifrin He appears to have left room, and is presently spending less time on the site so I'm not sure when he'll return. I think that we proceed anyway, and debate it if necessary at a later time.
@LeonidShifrin I forget: as a 20K user can you edit this deleted post?
 
5:18 PM
@Mr.Wizard It appears I can
 
@LeonidShifrin OK, let me know when it's ready.
 
@Mr.Wizard All right.
 
@Silvia Thank you.
@JacobAkkerboom I just threw the Partition on when I realized I needed it for the animating.
For the first version with just images for a given number I just had the Riffle.
 
@MichaelHale :) alright, it was just supposed to be a minor note, but it turned into quite a story :P
 
I agree I should update it to just use Thread or Transpose instead of Partition@Riffle though, but fixing frame glitch is higher priority.
@Szabolcs Maybe. I went to bed hoping I could just wake up and add FinishDynamic to fix the frame sync problem, but no such luck. Maybe Refresh?
 
5:24 PM
Again, it is really really pretty :)
 
@Mr.Wizard Ok, done.
 
@LeonidShifrin Thank you.
 
@Mr.Wizard No problem. I think it's beneficial for all of us.
@Mr.Wizard All right, gtg now. See you later!
 
@LeonidShifrin Goodbye!
 
5:50 PM
@bobthechemist Ctrl+D, then "." opens the drawing pallette and the cursor tool?
 
@YvesKlett Right - I'm aware of the cursor tool - I'd like to incorporate this functionality into the plot itself since the drawing palette isn't available in deployed CDFs.
 
@bobthechemist I knew that was too obvious ;-)
 
May be worthy of a real question but I figured I'd ask here first to limit the RTFM noise on the site.
 
6:18 PM
Maybe I will write a Q&A about it. It is better than expected!

with

nn = 1*^7; ;
mm = 10;
timeTotal = Function[Null, Do[#, {mm}] // Timing // First, HoldFirst];

The timings are

timeTotal@(resW = worseish[a, 1]) (*3.462369*)
timeTotal@(resB = betterish[a, 1]) (*2.180011*)
timeTotal@(resLL = parifLL[a, 1]) (*0.880568*)
and, as we should, we have resW === resB === resLL
 
Hello guys, I have a quick question which might been already asked but I can't seem to find: Is there a quick way to find the shortest path between to points in a data set? I've seen FindShortestPath but I don't know if (and how) it can be used for a data set.
I've been using Nearest and NearestFunction in a rather tricky way.
 
6:37 PM
@JacobAkkerboom check your mail :P
 
@Pragabhava How many points are in the data set? You can just turn them into a Graph where the edge weights are the distances between the pairs of points.
 
@MichaelHale There are around 4600 points. I should calculate all distances then and turn the data into a graph?
 
@Kuba okido!
 
@MichaelHale I've been using NestList in combination with Nearest and NearestFunction, but I cant seem to prevent the path from going backwards. I'm a bit confused on how to enforce this condition.
 
@Pragabhava I'm confused about your input. The shortest path between two points is a line connecting them.
 
6:49 PM
Hey guys some update to orthogonal edge layout here:
http://community.wolfram.com/groups/-/m/t/241376
 
@MichaelHale You are rigth! I haven't been clear enough. I guess in terms of graphs, one vertex can only be connected to it's nearest neighbor (speaking in euclidean distance terms)
 
@JacobAkkerboom What are you doing with Riffle? :)
 
@Kuba here it is:
0
Q: Riffle and Partition

Jacob AkkerboomAt some point I noticed that I was using Riffle and Partition together a lot. I would do things like Partition[Riffle[{1,2,3},{4,5,6}],2] or Partition[Riffle[{1,2,3}, 6 , {2, -1, 2}], 2] The question is: are better alternatives, in terms of memory and speed?

 
@MichaelHale I need to build a path in the data set that connects one point to the other.
Classic XY question, ja.
 
7:05 PM
@Pragabhava Ok, but many times a path won't exist if the points are random. Consider:
Solution exists there, but not here.
Here's the code though.
pts = RandomReal[1, {10, 2}];
nf = Nearest@pts;
edges = Union[UndirectedEdge @@@ (Sort[{#, Last@nf[#, 2]}] & /@ pts)];
graph = Graph[edges, EdgeWeight -> EuclideanDistance @@@ edges];
path = FindShortestPath[graph, First@pts, Last@pts];
Graphics@{Point@pts, Red, Line@path, PointSize@Large, Blue,
  Point@First@pts, Point@Last@pts}
 
@MichaelHale I see. Let me see if I folow:
1. First you build the distance function of the data set,
2. Next you build the edges using `UnidirectedEdge`, which as far as I can tell means that no direction is given to the edge.
3. Build the graph with weighted edges using their euclidean distance.
4. Find the shortest path.
That's very nice!
 
@MichaelHale I just skimmed over your messages, but isn't that what you want simply to solve the travelling salesman problem??
 
@halirutan I don't need to visit all the points in the set :)
 
@Pragabhava In your message here:
> Is there a quick way to find the shortest path between to points in a data set?
Should to points be two points?
 
@halirutan No, I'm trying to get a Graphics to hold off on updating until the previous code in the Dynamic finishes. At least, I think that's what the problem is.
 
7:15 PM
@halirutan Indeed
@MichaelHale Thank you very much!
 
@Pragabhava I still don't get it: The shortest distance between two points is always the straight line. Why going through more points?
@Pragabhava OK, never mind if you have solved it already.
 
@halirutan The constraint was that each point only has an edge connecting it to its nearest neighbor.
@Pragabhava No problem.
 
@MichaelHale Ok, that makes sense
 
@halirutan I'm not allowed to go outside the data set. Think of it as some sort of irregular latice. The actual problem is this
 
@Jagra @halirutan maybe you can also help Jagra (see the comment I am replying to)
 
7:25 PM
@JacobAkkerboom Unfortunately, there is no help. Most of the discussions we had about the security of packages is deleted now and we all have agreed on leaving Leonids answer as only information.
@JacobAkkerboom This is (to my knowledge) one of the few occasions where we decided not to publish certain information because it is hopefully for a greater good.
@Jagra (See my comment and the link above)
 
@halirutan well, long live open source I suppose :)
 
@Szabolcs I just tweaked the keyframe interpolation to be based on t-a instead of Mod[t,1].
 
7:43 PM
@JacobAkkerboom Yes, and since M is not open-source and we cannot make it better/more secure ourselves, we have to go with security though obscurity.
 
DynamicModule[{shapes, t, a, next, keyframes},
 shapes[i_] :=
  Thread@{Table[
     ColorData["BlueGreenYellow"]@Rescale[a, {1, i}], {a, i}],
    Disk /@ First@
      Fold[Module[{pts = #[[1]], r = #[[2]],
          n = #2}, {Join @@
           Table[# + n r Through@{Cos, Sin}[a 2 Pi/n + Pi/2] & /@
             RotationTransform[a 2 Pi/n + If[n == 2, Pi/2, 0]]@
              pts, {a, n}], n r}] &, {{{0., 0.}}, 1},
       Join @@ ConstantArray @@@ FactorInteger@i]};

 t = 1;
 a = 1;
 next[] :=
  keyframes =
 
@MichaelHale This is great. Create a thread with it!
 
Ok, I'll add it as an answer to the question here and start an "idea" thread on Community about it.
 
8:10 PM
@MichaelHale Let me make a small suggestion concerning the plot-range:
This version is faster and has fixed image size, but the important part is that whole graphics does not jump around
 
@halirutan Ah, very nice.
The JavaScript code is about 5500 characters vs about 600 in Mathematica.
 
@MichaelHale But as counter-argument, the animation quality in JavaScript is really awesome and in Mathematica it still feels like it needs many resources to move the things.
@MichaelHale I would really like to know whether there is a preferred way to create such animations.
 
@halirutan what do you mean by such?
 
If we hosted it as a CDF I think a general person who doesn't know about JavaScript or Mathematica would think they seem similar.
 
@MichaelHale Unless you prerender them, MMA animation will make your fan lauder for more complicated animations
:)
 
8:24 PM
@Kuba I'm not sure. Michael applies a function over all keyframes in each frame of the animation. Maybe there are other ways which perform better.
 
We could put Dynamics around the coordinates of the Graphics primitives.
Then the list of primitives would only need to be recreated on keyframes.
 
@MichaelHale yes, something like this.
 
That's the whole philosophy though, right? Get something working as fast as possible, then if it is important enough you will invest the time to keep making it faster.
 
9:25 PM
@MichaelHale Can you answer before the question gets shot down (because I didn't show any effort)? :-)
I don't know if it was the right thing to post this as a question. Pros: it's cool, people like it, improves morale on the site and attracts more users. Cons: sets a bad examples, questions like this tend to be closed because judging whether they're interesting enough is too subjective.
@MichaelHale Oops, sorry, I didn't notice that you already posted it as an answer. Deleted my question now.
 
10:07 PM
@Kuba It's actually a feature of Mathematica... When the heater breaks down in winter, I just whip up a badly constructed dynamic (i.e. a normal dynamic :D) with graphics for warmth :)
 
@rm-rf It's great, right? Turn up the values slightly and you can easily terminate MMA too, without bothering of inconvenient "x" in top right corner.
 
10:30 PM
The World of Mass Development model that they are using for Project CARS is pretty interesting.
CARS for Community Assisted Racing Simulator. You can pay for insider access, contribute, and then get a share of the profits.
 
10:54 PM
Is anyone joining
?
(Even when Mathematica is not officially allowed.. which is completely ridiculous, since they allowed MATLAB for its free Octave version.. we have RPi and Mathics)
 

« first day (826 days earlier)      last day (3655 days later) »