@David, and any others, for future reference when writing up a question like the confetti question to celebrate a milestone on the site, use the birthday question from TeX - LaTeX as an example to both write it up and smack any over exuberant mods around with.
For the curious (which is mostly me, I admit), as we're approaching 50 days old, I thought it interesting to find out how close our top rep people are to getting the Epic badge (50 times hitting 200). Here's the data:
@rcollyer At the bottom it says "This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here"
@rcollyer Thanks for the info, but the retarded mods really showed me that it was a mistake of coming here without my usual goofball 4chan attitutde. Maybe send that link to others trying to do something similar to the confetti thread, but I am done with things like these for sure.
A preview
Before I show any code, a preview of what is possible:
First try
I don't have time to finish this, but here's a go at implementing the idea from cormullion's link.
First, let's generate the word data (this is pretty arbitrary):
punctuation = ",/.<>?;':\"()-_!&"
(* bori...
I'm looking for a good reference/book on programming neural networks in mathematica. I've been working through Freeman's "Simulating Neural Networks with Mathematica," but it is from 1994 so is quite dated. Is anyone familiar with a more recent book on the subject?
For background, I'm very com...
How can this code be improved, for example, by including shadows, raytracing or the effects of gravity to make it more realistic?
I felt that this question deserved an answer. The one I describe here is to create a set of confetti "agents" that respond in quasi-physical ways to external for...
Nothing really spectacular other than questions and answers :-)
very nice work on the word cloud @Szabolcs. I overcomplicated by jumping straight for an r-tree (which is way overkill) and kept running around in circles trying to implement it (and failed)
I was working a bit in this, as I also needed something similar, but I had delayed the algorithm development. You helped me to get some impulse :D
I also needed the source code, so here it is. I worked it out in Mathematica, but as I haven't used heavily the functional features, I guess it'll...
although, the intent here is to just move the rectangles enough so they don't overlap. Closeness of packing/min area, etc were not a concern, although could be added as a constraint
@rcollyer I reduced the step size to 0.3 for tighter packing (x += 0.3) Ideally it should be even less, but it's very slow. I mapped Rotate[#, RandomReal[{-Pi/2, Pi/2}]]& onto styledwords to rotate them. I reduced the dilation parameter to 1, but I think 2 or 3 is still better. Then before rendering I applied some ColorData indexed function for the colours. I also needed to ExportString/ImportString to/from PDF to force it to antialias small fonts.
@rcollyer The algorithm is described i cormullion's link: 1. Place words one by one from largest to smallest 2. try to place each one on a random point first, and if it doesn't fit there, try move it around
The "moving around" part is done on an outward winding archimedean spiral path
We could use another path to search for spaces where it fits, e.g. trace along a square grid
the bottleneck is deciding if it fits of not: I do this using image processing: I check if there's an overlap (with a rather stupid method)
Stupid? Not really. Effective, very. Slow, most likely. And, it automatically gives you the tightest bounding region around each letter.
I could see a combination of an r-tree style test first to see if the words bounding box overlaps, and then moving to this method if they do as it would reduce the overall number of pixel level tests occurring.
Of course one can create a Mathematica package and run its commands interactively from the Mathematica front-end. But...
Can Mathematica be used to make a console (a.k.a. terminal-based) application? What about an interactive "full console" application like Vim or htop?
Can Mathematica be used ...
I don't think it should be converted to a comment at all, but that's up to the moderators
I'm surprised how it attracted a 1 rep new user within 5 mins of the question... usually this happens only when it hits the SE hot question list or at least, after a reasonable time
I think you will be pleased with what you find. The format of the site is atypical however. The message you posted was deleted (by me) because it was not an answer, which is needed to be to be posted there.
Until you get a feel for the site I suggest you make liberal use of this chat room. There is almost someone here willing to point you in the right direction.
This question just popped up here, but there is an identical question over on SO. Since the original is a dupe, it probably should be closed. However, I don't mind the new question here. Although, it needs some TLC.
@Gustavo It does not work for all kinds of POST requests and since I know next to nothing about HTTP, I can't give any explanations. If it won't work for this one, you may need to resort to using J/Link
I want to build a bot to automate web browsing, this mean something like:
filling forms
press "submit" buttons
find certain text inside pages
and so on...
How can I do this with Mathematica?
The Import function just make you download a single web page but it doesn't support cookies and simil...
@GustavoBandeira That question is quite broad. If you ask a specific one (e.g. you link to a website), you might get an answer. But do try Import with the POST method first.
I don't think it's necessary to use all the apparatus of Solve or Reduce here.
When you think about it, at one o'clock, the hour hand is on the 1, which corresponds to five minutes. So the hands meet a little after five past one. The solution is therefore that $m = 60 (\frac{h}{11})$. Someone e...
@David I just realised - the definition of the badge is "Highest scoring answer that outscored an accepted answer with score of more than 10 by more than 2x " so I need one more vote and you need two. But surely we can celebrate first gold badge on the site today :)
@GustavoBandeira people should only upvote things they think are useful, informative, interesting. @David 's post got lots of upvotes because it showed many useful techniques while still being hilarious. My answer is the accepted one because it most concisely answers the question.
@GustavoBandeira I don't know what you are referring to. What question was thrown on the ground? I am a pro tempore moderator on this site but I am not the only one. Also, major users can vote to close or reopen questions without or in spite of me.
The community at this site has a reasonable tolerance for showing off Mathematica's capabilities with "fun" problems. Often you can learn a lot from them.
@Heike I have an urge to put our major report through your algorithm. But first I have to finish editing it! so ta-ta for now!
Here's what I came up with
How I did it
First we need a list of words. Here, I've taken the original list ordered by size.
tally = Tally@
Cases[StringSplit[ExampleData[{"Text", "AliceInWonderland"}],
Except@LetterCharacter], _?(StringLength@# > 4 \[And] # =!=
"Alice" &a...
@Heike With the same program that I posted. But first I Rotateed the Styled words, and I decreased the step size in the x += ... line to about 0.3 (don't remember the value, but it has to be different from 0.3 for the points to fill the plane uniformly. Then in the very end I applied colours to the words.
Your code won't run here, trying to figure out if I did somethign wrong or a definition is missing?