📜 ⬆️ ⬇️

A detailed review of the Wolfram Programming Cloud (Wolfram Programming Clouds)



On June 23, 2014, less than a week ago, after a long development, a new product from Wolfram Research, called the Wolfram Programming Cloud (Wolfram Cloud Programming), was released. About this blog wrote Stephen Wolfram and his post was transferred to Habrahabr.

Wolfram Programming Cloud allows you to program in the Wolfram language in any browser and from any device, and also create ready-made applications (web input forms and soon mobile applications), work with direct API, create automatically generated reports, delayed tasks, web pages, CDF and more. In this case, everyone has the opportunity to try and use Wolfram Programming Cloud for free .
')
I would like to share with you the first detailed video review in Russian of this product, as well as its implementation for a regular desktop - Wolfram Desktop.



From the review you will learn how to work with Wolfram Programming Cloud, create input forms and APIs, use Wolfram Desktop, etc.

The video describes specific examples of working in the Cloud with geographic data, the VK API, sending messages to e-mail from the Cloud, processing and uploading images (both from user devices and the Internet), using built-in Wolfram Language functions, etc.

The main Wolfram codes used in the video review:

Relief plot
CloudDeploy@FormFunction[ {"city" -> "ComputedCity"}, Module[{data}, data = GeoElevationData[GeoBoundingBox[GeoDisk[#city, Quantity[10, "Kilometers"]]]]; Grid[{{#city}, {ListPlot3D[data, MeshFunctions -> {#3 &}, Mesh -> {{1, 0}}, MeshStyle -> Thick, ColorFunction -> ColorData["HypsometricTints"], ColorFunctionScaling -> False,ImageSize -> 600]}}, Alignment -> {Center,Center}]]&, "HTML"] 

Image processing application
 im1=Import["    -"]; im2=Import["    -"]; images =RemoveAlphaChannel[ColorConvert[#, "RGB"] ,White]&/@{im1, im2}; webString[str_]:=StringReplace[ExportString[Cell[str], "HTML", "FullDocument" -> False],"<span>"|"</span>" -> ""] CloudDeploy[ FormFunction[ {{"im1"," "} -> "Image", {"im2",webString@" "} -> "Image"}, Module[{images,imDims,minX,minY,image,head}, images = RemoveAlphaChannel[ColorConvert[#, "RGB"] ,White]&/@{#im1, #im2}; imDims = ImageDimensions /@ images; minX = Min[imDims[[;; , 1]]]; images = ImageResize[#, minX] & /@ images; imDims = ImageDimensions /@ images; minY = Min[imDims[[;; , 2]]]; Table[image[i] = ImageData[ImageCrop[images[[i]], {minX, minY}]], {i, 1, Length[images]}]; head = 1; Image@Table[head = Replace[head, {1 -> 2, 2 -> 1}];image[head][[i, j]], {i, 1, minY}, {j, 1, minX}]]&, "PNG", AppearanceRules -> <|"Title" -> webString@" ", "Description" -> webString@ "  ,     .", "SubmitLabel" -> webString@""|>]] 

Work with the VK API
 $VkAPIAccessToken =" accesstoken"; VkAPIMethod[method_, {options___}] := Module[{response}, "response" /.ImportString[URLFetch["https://api.vk.com/method/" <> method, "Parameters" -> {"access_token" -> $VkAPIAccessToken, options}], "JSON"]]; message := Module[{fromId, date, text, Body, Subject,password}, {currentId, fromId, date,text} = {"id", "from_id", "date", "text"} /.VkAPIMethod["wall.get", {"owner_id" -> "-1172233", "offset" -> "0","count" -> "1"}][[2]]; Body = ToString[TableForm@{Row[{" : ","http://vk.com/id" <> ToString@fromId}], DateString[AbsoluteTime[{1970, 1, 1, 0, 0, 0}] + date, {"Hour", ":","Minute", ":", "Second", " ", "Day", ".", "Month", ".","Year"}], text}]; Subject ="      Wolfram Mathematica "; password = CloudSymbol["pass"]; If[currentId === lastId, Null, SendMail["To" -> "raosipov@gmail.com", "Subject" -> Subject,"Body" -> Body, "Password" -> password]; lastId = currentId]] message; 


I hope that this video review will interest you and allow you to quickly start working with Wolfram Programming Cloud!

Source: https://habr.com/ru/post/227971/


All Articles