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"]
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@""|>]]
$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;
Source: https://habr.com/ru/post/227971/
All Articles