Community RSS Feed
https://community.wolfram.com
RSS Feed for Wolfram Community showing any discussions in tag Recreation sorted by activeTwogether: A webapp listing all the films given two actors
https://community.wolfram.com/groups/-/m/t/1616053
Can you name all the movies that included...
Spencer Tracy and Katherine Hepburn?
Bill Murray and Dan Ackroyd?
Corey Haim and Corey Feldman?
I wrote a webapp with the Wolfram Language which takes two actors as input, and which lists back all the movies they were cast in together as output.
I call the app Twogether, and you can find it here:
https://www.wolframcloud.com/objects/mitchell/twogether
Please enjoy! Thanks.Mitchell Szczepanczyk2019-02-19T18:22:58ZIntegrate a W|A widget on a wordpress site?
https://community.wolfram.com/groups/-/m/t/1614086
Hi all,
I have a naive and simple question. Please, help, who knows anything.
Seems like I am doing something wrong.
I created a widget which would provide a calculation of calories during walking with a given speed (running etc. - wanted to extend it to swimming and other activities and use all power of WA). Basic request:
walking distance:4 km, speed:5 km/h,gender: female,
age:35yo, body weight:60kg, height:165 cm
It works perfectly at the WA site. It computes MET factor, which I need and provide all necessary info.
OK, I published widget, it works (if I am not mistaking).
https://www.wolframalpha.com/widgets/gallery/view.jsp?id=865048d119b92ff1c867699545c4ca48
Next, I took the code, put it into my wordpress site.
i) Now it provide empty screen!
ii) At mobile devices it does not work at all.
Initially it works (at desktop). Then stoped.
I understand that widgets are beta version (which year? tenth? :) ), and we can not expect more from the abandoned and useless for many people service. But maybe I am doing something wrong and everything works perfectly?
Any ideas, please.Alla Kislitsina2019-02-16T08:13:05ZThe Scoville scale of peppers (151st birth anniversary of W.L. Scoville)
https://community.wolfram.com/groups/-/m/t/777535
Today is the 151st birth anniversary of [Wilbur Lincoln Scoville][1], who is best known for his [Scoville Organoleptic Test][2] that is used to measure hotness of peppers.
Born in Bridgeport Connecticut on January 22nd, 1865, Wilbur Lincoln Scoville was a chemist, award-winning researcher, professor of pharmacology and the second vice-chairman of the American Pharmaceutical Association.
![enter image description here][3]
First, I generated a dataset of peppers from an excel file available at [Meadow view growers][4] website, the images were obtained using [BingSearch][5] which connect to the Bing Search API with the Wolfram Language.
bs = ServiceConnect["BingSearch"];
ServiceExecute["BingSearch","Search",{"Query"->" pepper","SearchType"->"Images","MaxItems"->1,"Elements"->"Thumbnails"}]
![pepper][6]
peppers =
Dataset[<|"variety" -> First[#],
"image" ->
ImageResize[First@ServiceExecute["BingSearch",
"Search", {"Query" -> First[#] <> " pepper",
"SearchType" -> "Images", "MaxItems" -> 3,
"Elements" -> "Thumbnails"}],100],
"days" ->
Quantity[
If[StringQ[Part[#, 2]], Last@StringSplit[Part[#, 2], "-"],
Part[#, 2]], "days"], "type" -> Part[#, 3],
"scoville" ->
Interpreter["Integer"][Last@Quiet@StringSplit[Part[#, 4], "-"]],
"comments" -> Last[#]|> & /@
Import["http://www.meadowview.com/wp-content/uploads/2012/08/\
PepperChart.xls"][[1, 3 ;; 35]]]
![enter image description here][7]
Finally, I visualize the Scoville scale of the peppers using a ListLogPlot:
ListLogPlot[
MapThread[
Tooltip[# + 1, TableForm[#2]] &, {Normal[peppers[All, "scoville"]],
MapThread[{Style[#1, Bold, 16, Red],
Style[#2 "Scoville Heat Units (SHU)", Bold], #3} &, {Normal[
peppers[All, "variety"]], Normal[peppers[All, "scoville"]],
Normal[peppers[All, "image"]]}]}], ImageSize -> 800,
PlotRange -> All, AxesLabel -> {None, "SHU"}, PlotMarkers -> Style["j", 34, Red, Bold],
PlotRange -> All,
PlotLabel ->
Style["The Scoville Scale", 32, RGBColor[1, 0.05, 0, 0.85], Bold],
Ticks -> {MapThread[{#1,
Rotate[Style[#2 , FontSize -> 12], 85 Degree]} &, {Range[33],
Normal[peppers[All, "variety"]]}], Automatic}]
Check out the notebook attached and the dataset peppers.m in order to explore the interactive visualization.
[1]: https://en.wikipedia.org/wiki/Wilbur_Scoville
[2]: https://en.wikipedia.org/wiki/Scoville_scale#Scoville_organoleptic_test
[3]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScovilleHeat.gif&userId=95400
[4]: http://meadowview.com/vegetables/
[5]: https://reference.wolfram.com/language/ref/service/BingSearch.html
[6]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScovilleHeatPost.png&userId=95400
[7]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScovilleHeatData.png&userId=95400Jofre Espigule2016-01-22T23:30:41ZFrustration Solitaire
https://community.wolfram.com/groups/-/m/t/1609558
## Frustration Solitaire ##
Frustration solitaire is a game that has roots stemming from the early 1700's. The rules of the game are simple: a dealer calls out the ranks of cards in order $\textit{Ace, Two, Three, . . .}$ and so on. At the same time the dealer draws a card from a sufficiently well shuffled deck. If the rank of the card drawn matches the rank of the card the dealer says you lose the game.
![cards][1]
The rank of the cards the dealer would have called out are $\textit{Ace, Two, Three, Four, Five}$. Since the fifth card has rank five we lose.
Let's programme a game of frustration solitaire.
We start by creating an array that corresponds to the ranks of the cards the dealer calls out.
dealer = Flatten[Table[Range[1, 13], 4]]
Next, we need to simulate a well shuffled deck of cards. Using the function `RandomSample[]` we can easily "shuffle" the deck of cards.
shuffle = RandomSample[Flatten[Table[Range[1, 13], 4]]]
Combine the lists using `Transpose[]` to get our very own game of frustration solitaire.
In[1]:= fs =
Transpose[{Flatten[Table[Range[1, 13], 4]],
RandomSample[Flatten[Table[Range[1, 13], 4]]]}]
Out[1]= {{1, 11}, {2, 9}, {3, 8}, {4, 9}, {5, 8}, {6, 5}, {7, 9}, {8,
6}, {9, 5}, {10, 2}, {11, 4}, {12, 13}, {13, 5}, {1, 10}, {2,
7}, {3, 12}, {4, 13}, {5, 1}, {6, 12}, {7, 4}, {8, 1}, {9, 2}, {10,
7}, {11, 10}, {12, 13}, {13, 10}, {1, 8}, {2, 3}, {3, 9}, {4,
11}, {5, 3}, {6, 3}, {7, 10}, {8, 8}, {9, 6}, {10, 5}, {11, 2}, {12,
7}, {13, 11}, {1, 12}, {2, 12}, {3, 6}, {4, 3}, {5, 1}, {6, 1}, {7,
7}, {8, 2}, {9, 13}, {10, 4}, {11, 6}, {12, 4}, {13, 11}}
Lets see if we have won:
In[2]:= w1 =
If[Part[fs[[#]], 1] == Part[fs[[#]], 2], 1, 0] & /@
Range[Length[fs]];
In[3]:= If[Length[DeleteCases[0]@w1] == 0,
"YOU WIN!", "YOU LOSE."]
Out[3]= "YOU LOSE"
Now we shouldn't feel *too* bad about losing. The name "frustration" solitaire stems from the fact that the percentage of winning is actually very low. In 2009, Doyle et. al. found out that the percentage of winning a game of frustration solitaire is approximately $1.62\%$. They worked this out by framing the question within the world of combinatorics. Finding the percentage of winning a game of frustration solitaire is equivalent to finding the number of rank derangements (i.e. how many permutations that have no rank-fixed points) divided by $52!$ (i.e. the total number of permutations of a deck of cards).
Let's generate 100,000 games of frustration solitaire and see how close we can get to the estimate Doyle et. al. produced.
In[4]:= trials =
Table[s =
Transpose[{Flatten[Table[Range[1, 13], 4]],
RandomSample[Flatten[Table[Range[1, 13], 4]]]}];
If[Length[
DeleteCases[
If[Part[s[[#]], 1] == Part[s[[#]], 2], 1, 0] & /@
Range[Length[s]], 0]] == 0, 0, 1], 100000];
In[5]:= winning = (1 - Total[trials]/100000)*100// N
Out[5]= 1.61
In our 100,000 games of frustration solitaire we won $1.61\%$ of the time, hence the title of "frustration" solitaire is very well deserved.
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=c.png&userId=1598258William Rudman2019-02-09T21:11:54Z