Watch videos with subtitles in your language, upload your videos, create your own subtitles! Click here to learn more on "how to Dotsub"

03_SeniorDeveloper FeedbackQ&A

0 (0 Likes / 0 Dislikes)
Ok thanks, Allen, that was a great demonstration of how quickly you can deploy an app with the Programming Cloud and you can do it all in the browser—the development, the deployment is all in the browser. you need is a browser. So we’ve put together a panel of senior developers to comment on what you just saw. Sitting to the right is Joel Klein who is a kernel architect and joining us offsite is Bob Sandheinrich, who is a software engineer, and I’m Chris Carlson, a user interface developer. So, gentlemen, do you have any comments off the bat? Joel: Well, it’s a cool demonstration. One thing that I would love to see is just the names of the cities for the two bars of icons, which one is which? Allen: Yeah, true. I did not think of putting that in. I can actually put that in now and redeploy, if that could work. Chris: Yeah, sure. Allen: Let me just go ahead and type in “location1” and then down here, “location2”. And once again, if I go ahead and reevaluate this, then I’ll go ahead and reevaluate this cell as well. And I can redeploy it too. Hang on a second. Oh, there you go. So now it has labeled “Houston” and “Chicago” and once again if I want to redeploy this, we can go ahead and do that. And everything is pretty automatic, so if I want to say “Houston”, “Chicago” so that it can give it a little bit of time. Just evaluate everything. There you go. So now it has the labels for both cities on it. Joel: Nice. Allen: It was easy. Chris: Yeah, that’s one of the nice things about the Wolfram Language—the code is very malleable. It’s very easy to go in and make modifications and since it’s interpreted, you don’t have to go through a compile step you just have to evaluate and get the new output so you can very quickly go through iterations and develop things. I would like to just make a comment about the output that you get on the Cloud. Allen: Sure. Chris: So, by default what you get is not necessarily formatted really nicely. For example, when you deploy it as a PDF you get a really tight frame around the contents. So you can add a little white space, for example, by using “Pane”. Allen: “Pane”? OK. Chris: So if you just wrap your output with “Pane” and specify images margins of some value it’ll give you just a little more white space relief in there. Chris: You can also go beyond that. For example, there’s a construct called “Framed” if you just wrap it with “Framed” you also get a nice black frame around it. Allen: OK. Chris: There are a lot of features you can use to style what you see in the Cloud and you can make very nicely refined, professional, kinds of outputs. Allen: And even something immediately like that, so if we want to deploy, like I said here, “Deploy” the “FormFunction” with your “City1” “City2”, but then I specify the output to be a PNG and I know that I could change that output to be, I know even a PNG ended up rendering kind of tight but PDF might give it a little bit of extra wiggle room. It might just be marginal but if I try, let’s say if we do, output as a PDF— I just want to see what that looks like—because then you could choose PDF, PNG, JIF, etc. Just one more time. And these evaluations take a little bit of time but it’s all worth it at the end of the day, I guess. Chris: It seems to be running a little bit slower today. Allen: Yeah. So, PDF ends up rendering it a little bit clearer if I may say so myself. Chris: Why don’t you go back to your notebook and just try adding that additional format. Just wrap your TripPlanner there. Allen. Sure, so you’re saying this…? Chris: No, the definition. Or you can just put it right in the CloudDeploy if you want. Allen: Yeah, sure I can do that. Chris: So put it “Framed” of “pane”. Allen: Around where? Chris: Around “TripPlanner”. Allen: OK. So like that? Chris: Right. “Framed”, open bracket and then “pane” after frame. And then “frame”, “,” “ImageSize” or “ImageMargins” arrow like I don’t know, say, 20? Allen: And now “ImageMargins”, you’re saying, where would that go? Chris: So that would go after “TripPlanner”. Allen: OK. Chris: After the closing bracket for “TripPlanner”. Allen: OK. Chris: So “,”, “ImageMargins”, arrow “20”. Allen: 20? Chris: Right. So that should do it. Try that. Allen: OK, so let’s redeploy this again. But if this were a PDF it would still, “ImageMargins” would still be fine? Chris: Yeah. Allen: Oh wow, nice. Chris: OK, there you go. Allen: Perfect Chris: Yeah, so that gives you a little bit of white relief. The frame doesn’t come out so good because it’s on a black background but you get an idea of what you can do. Allen: Awesome. Chris: One other comment was—so what you’ve deployed with just the bare bones “CloudDeploy” is accessible only by you. Allen: Sure. Chris: So if you want the world to be able to look at what you’ve done then you need to specify within “CloudDeploy” “,” “permissions” arrow “public”… Allen: Or down here I can say set permissions and I can say “accessible by everybody”… Chris: Right you can do that as well. Allen: So I can do that. Perfect. And now it’s accessible by everybody? Chris: Now everybody who is listening to this event can type in that URL, you can actually go to what was just deployed and try it out. Allen: Perfect. Chris: Several people asked about the fact that you had two versions of “TripPlanner” there, which were actually different functions, and that is one feature of the Wolfram Language, which is polymorphism So you can define different functions that have the same name and it chooses the function according to the types of the arguments and the number of the arguments. Allen: Right. So then, I would then also say for those that might be familiar with a traditional-ish programming language, like JAVA, let’s say, that also supports polymorphism, that’s a familiar feature that’s available in the Wolfram Language. Chris: Right. It may have looked like a recursive call but it’s not actually recursive. Those are two different functions that just happen to have the same name. That’s a nice way of documenting that those are actually two aspects of the same function. You did some other things that were just nice programing practice in what you did. Like, for example, using “With” to factor out the size so that if you want to change the size you don’t have to change it in three different places in the code. And another nice thing is that you defined a function —the “TripPlanner” function—separate from the “CloudDeploy”. You could conceivably just do the whole documentation inside your “CloudDeploy” but it’s nice to sort of separate that, you can test it either in your desktop version if that’s where you’re working or in your Cloud and then when you’re satisfied that it’s working that way you want it to you can deploy it with the “CloudDeploy”. Allen: Sure. Joel: One thing that you could add to this is logging. You could, if you were interested in finding out what cities are popular, what trips are people planning, you know is there something I could optimize? You could always write the inputs to a file, keep appending to that, and go look at that later maybe make adjustments to that later on how you were doing things. Allen: Definitely, definitely. Joel: You could cash results of the same sets of cities are getting requested, you know, within a short period of time or something. Allen: Right, very cool. Chris: So this is just the tip of the iceberg of what you can do with “CloudDeploy”. And you used a number of our data functions like IconData, WeatherData… there are scads of those, there is just a ton of information in the Wolfram Language—CountryData, there’s CityData, there’s ElementData, there’s ElementaryParticleData, just all sorts of stuff. And you can use those here directly to expand your trip planner. For example, you can use CountryData to get at the electrical outlet type of the country, get an image of that. You can use the mapping functions to put a map of your destination in the output. There are just all sorts of possibilities Bob is the expert on a lot of those things, how the geographic functionality works in some of these data paclets but there’s a lot to draw on. Allen: Absolutely. And I was going to say even something like getting the two cities’ populations, just kind of compare quick side by side or something like that using CityData just extract a wealth of knowledge really that you can just compare and really expand on the trip planner here. Chris: Do we have any questions online? If you have any questions now you can go to the chat pod and type them in and we’ll try to answer what we can. Somebody had asked about whether this language, the Wolfram Language, is free, so anybody can go to the Cloud and get an account for free, which has a basic level of access. There are higher subscription levels for the Cloud if you’re going to do some serious development. The desktop version, which is Mathematica or Wolfram Desktop, is a commercial product, a paid product. Although, if you are a student, the student license is pretty reasonable and if you’re at a university, many universities have site licenses so you can get Mathematica essentially for free at the university. University of Illinois does, so students don’t pay for it there. Allen: And also you guys can look at this page right here, just give me two seconds, let me get it fired up here. You guys can see pretty much at every tier just the deploy to the Cloud whether it’s an instant API or a form, etc., there are different tiers to deploy to. For the most part you, for just kind of general, recreational Hackathon needs if you will, you won’t really need anything past the free tier. But, of course, if you are starting to scale whatever you build you can go ahead and do explorer, developer, producer —if you start to make a company out of it—team, etc. So yeah, there are different levels that are available within the Wolfram Programming Cloud for deploying. Chris: Let me just highlight a couple of other things that are online that might be useful to people. Ok, so if you go to www.wolfram.com/language there are resources for just getting familiar with the language. There’s an introductory video here from Stephen Wolfram and if you just are interested in examples there’s this code gallery here, which has a bunch of typical applications. Some of these also have Cloud deployments in them. So you can visit one of these, I think this was mentioned in the video, it’ll give you an example of how to do something with the Wolfram Language. Most of these are pretty simple, pretty basic. This one is doing face detection in images. Then you can click here, I guess this one is not yet live, you can click here usually to take this example into the Cloud and you can play with it yourself there For Hackathons, there’s a page here that collects a bunch of resources that would be interesting to people who are thinking about using Wolfram things in Hackathons. There’s information about the Programming Cloud, the Wolfram Language runs on Raspberry Pi, a lot of people are doing interesting device hardware oriented projects with the Wolfram Language, and so on. Let’s see. And there’s also this page here, www.wolfram.com/cloud, that will give you information in general about using the Wolfram Language in the Cloud and getting online. I’m looking here at questions that people have sent in. One person asked, so how does the city field in the input form handle misspellings? You can specify a type, like city, and there are lots of types —there’s cities, there’s countries, there’s web addresses, all sorts of things—that’s what we call a smart field and it will actually interpret what you type in, try to interpret it as a city. And it’s actually pretty robust with respect to misspellings. You can be pretty messy about it and it generally does a pretty good idea of guessing what you intend. That’s a nice feature of those fields—it doesn’t take any effort to get that functionality in your forms. Joel: I can take another question from the chat room—is the Wolfram Language intended to be an easier way to develop web apps and programs rather than using HTML, JAVA Script, PHP, etc.? This is an interesting question because there are a couple of answers. It’s definitely a easier way to develop things on the web. The nice thing is that you can choose—the power of it is kind of in the back end which would sort of be the replacement for a PHP type of thing, but for the front end you can use, as we’ve been showing here, you can use a lot of Wolfram Language stuff to make display artifacts or you can, like PHP, generate all of the HTML, CSS, JAVA Script for your front end from the Wolfram Language back end. A lot of the things that we see in the notebook, they’re driven by the Wolfram Language and showing up in our internal HTML, CSS, JAVA Script. Allen: And I was even going to say that there is built in the Wolfram Language connectivity to MYSQL databases too, right? Joel: Correct. Allen: For people who go to Hackathons, I work as a Hackathon intern so I go to Hackathons on Wolfram’s behalf. A popular thing that I’ve seen a lot of people use the Wolfram Language for is to actually deploy instant APIs. They’re instant restful APIs that you can then call from JAVA Script or Python or whatever their favorite language is. So that’s a really easy, quick way to integrate Wolfram Language with your favorite programming language if you will, while still harnessing a lot of the built in computations and knowledge that is built in to the Wolfram Language. So that’s kind of just a little side note I guess. But do we take any more questions? Chris: I think we have time for a few more, don’t we? Yeah. One person asked about the Wolfram Language on the Raspberry Pi. So there are two related questions. One person asked, what’s the relationship between Mathematica—which comes on the Raspberry Pi— and the Wolfram Language? So the Wolfram Language is the language itself. Mathematica is one implementation of that, another implementation is the Programming Cloud and so forth. Mathematica is the Wolfram Language in addition to a development environment and a programming interface. So you can think of them as actually being the same thing if you’re just thinking of the language aspect of it. About developing for the Pi, if you go to wolfram.com/community, there’s a large community of Wolfram technology users and I think on the right you’ll see a topics bar and there’s a Raspberry Pi thread or a Raspberry Pi group and there are many examples there of using Wolfram Language on the Pi to control cameras, implement a weather station, all sorts of things. So I think if you are interested in those that kind of thing, that’s a good resource for you. I’m sure there is also a web page online, I would guess, about that but I don’t know what that is off the top of my head. Allen: And even on the wolfram.com/hackathons page there is a little mention of Wolfram Language connectivity to the Raspberry Pi so you guys can definitely go check that out as well. Chris: I’m looking for more questions here. Joel: Is it possible to do an HTTP post in Wolfram Language? Yes, from two senses. You can use the “URLFetch” function to make any kind of web request, you can specify the method as post. You can also write your instant API to receive post methods or whatever. That kind of aspect to Wolfram Language is all there. Chris: There’s a question about using data input by the user in the Wolfram Cloud. There are lots of ways to do that. You can import data from a URL, you can input data that you have locally on your desktop or laptop. There’s a new thing that we just rolled out called “DataDrop”, which is a repository just generally for data online. You can very conveniently drop data into a data drop bin and then you can pull that in anywhere, whether it’s on the Cloud or on the desktop with the Wolfram Language. That’s one of the things that we’ve made—making connections to data sources, to other programs, to whatever it is, that Mathematica or the Wolfram Language might want to work with—one of our emphases and we work very hard to make it easy to pull in data from all sorts of sources. Let’s see, what other questions do we have? Who owns copyrights for apps deployed with the Wolfram Language? You do. We don’t have any claim at all on the things that you develop with the Wolfram Language. Allen: So I see a question here—I’m also new to programming and I’m mostly overwhelmed by it. Is the language you use, the Wolfram Language, applicable or the same as JAVA, Python and similar to MATLAB? So if you heard me earlier, I said more traditional languages, like JAVA and Python, I think syntactically Wolfram Language is very different from those two. It’s very function driven, a lot of the data and variables, etc. you get back are either entities or functions, whatever it may be. So I think in that aspect it is very different from something like JAVA or Python. Syntactically it looks a bit different as well. I think the best resources though for getting started about learning it and I know I am still learning it myself— I’ve only been learning it for a couple of months—is really just check out the reference page—reference.wolfram.com. There are tons of examples in there, whether it’s instant needs for just deploying web forms or webpages, what not, to actually writing full applications in Wolfram Language. It is sort intimating almost how much there is built in to the language but the docs are superb. There are tons of examples that you can go ahead and just play around with so I think those are kind of some ways to get started with the language. And once you start to get the hang of it you can see just how easy it is and how familiar the syntax can actually be. So I just wanted to address that. Chris: One question is asked about whether you can do something more graphically intensive. The thing is with the Wolfram Language including within “Manipulate” the graphics functionality within the Wolfram Language is very strong and you can do very sophisticated things. We haven’t even come close to addressing what you can do and anything that you can do within the Wolfram Language you can do within a “Manipulate”. Of course, you can always implement something which is going to take a long time to compute and your “Manipulate” won’t be very responsive. But generally you can do some very impressive interactive graphics with the Wolfram Language. I think I’m getting the signal that we are out of time so thank you, Allen, for a very nice demo and thank you panel and thank you for attending and we hope to see you at other Wolfram training events soon.

Video Details

Duration: 22 minutes and 50 seconds
Country:
Language: English
License: Dotsub - Standard License
Genre: None
Views: 9
Posted by: wolfram on Apr 14, 2015

03_SeniorDeveloper FeedbackQ&A

Caption and Translate

    Sign In/Register for Dotsub to translate this video.