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

StudentIntroWolframLanguagProgrammingCloud

0 (0 Likes / 0 Dislikes)
What’s going on everybody? My name is Allen Kleiner. I’m currently Hackathon intern Cloud developer intern here at Wolfram Research, just recently hired on not too long ago and I wanted to talk to you all about Wolfram technologies, specifically Wolfram Language and the Wolfram Programming Cloud, which is the interface to program in the Wolfram Language. So for those of you who might not be aware, Wolfram Language is pretty powerful. It is essentially a very comprehensive language that can do honestly anything. And since I am a new hired on intern, I was kind of tasked with learning the language and like learning any new language I thought it would be daunting and I am by no means am I am expert but there are so many great resources —foreign language—in the programming Cloud and I kind of wanted to show off some of those so that you all are aware of them. A little bit about me—so I study computer science right now in school and I’ve been big into to the kind of hackathon scene for some time, probably for the past year or so, and I’ve been hacking all over the country, from Michigan to Indiana to Pennsylvania to Illinois—you name it, I’ve been there and done that. My primary focus is web development, which made learning the Wolfram Language very interesting, especially as a hacker, which I always consider myself. I had to figure out and use cases to see exactly—oh you know Wolfram Alpha, it does math homework for you—but it does a lot more than that. So that’s kind of just a little bit about me and hopefully I’ll show you guys some examples of what exactly it can do. Like I said, I am by no means an expert at the language, I’m kind of learning it and I’m still learning it, always learning new things about it but I just kind of wanted to show exactly what is out there and what are some of the things that it can do. So to get started I have here pulled up the actual main Wolfram Programming Cloud page and what you’ll notice is that there are a lot of buzz words here and for good reason too. So when you talk about absurdly fast development and deployment, the Wolfram Language can do that very quickly. You can develop very robust and powerful applications and deploy them on literally a few lines of code. There’s a lot of talk about symbolic programming. What is that? I can get into that later but the idea is that you can do a lot with the Wolfram Language and so everything is built into it, which makes it super powerful and super cool. Honestly, anything from machine learning—so if you want to build a classifier function and train it on a dataset you can do that in one line of code; if you wan to do any sort of visualization you can do that in one or two lines of code; if you want to do geomapping or weather data, which I’ll show you guys in a little bit, you can do that in one or two lines of code. The point being is that the Wolfram Language can do a lot and some of the things that are especially cool about it are actually Cloud functions. So a lot of the things that you can develop in the Wolfram Language, you can eventually deploy to the Cloud and I’ll show you guys some of what you can do with that later. One of the coolest parts about it too is that you can create instant, restful API based off of some sort of Wolfram Language input or function in one line of code and you then use those APIs in JAVA Script or whatever language you want to use to call those APIs. In essence, this language is super powerful. There’s a lot going on with it and please bear with me if I do mess as I kind of show you guys around but there is a lot of cool stuff going on. So I guess enough of me talking about what’s cool about it— let’s see exactly what you can do with it. Let’s go into here—into the Wolfram Programming Cloud. So this is the main interface. Obviously I’ve signed in already. If you go to programming. wolframcloud.com you can go ahead and sign in there, if you don’t have an account create an account and sign in and it’ll get you started with some free credits so you can get started writing code deploying it to the Cloud just fine. A little about the interface really quick— it’s really a comprehensive file system as well so primarily you’ll work in what is called “notebooks” and those notebooks are the main interfaces for writing code and then you can have those saved here in your file system, I guess. You have folders here, you have deployments whether they’re web forms, web computations, APIs, embeddable code, etc. There’s a lot going on here. There’s a lot you can do graphically as well. And there is some cool stuff going on here as well in the example gallery, which I can show you guys in a little bit as well. But first let’s just get started really quickly. Let’s create a new notebook —click on that and as it loads— like I was just talking about this is the primary notebook interface for the Programming Cloud. You will write Wolfram Language code in here. So for starters, just to see how it works, if you type in “2+2” and hold down “Shift” and hit “Enter” that it’ll evaluate for you. So that’s just one example of an expression. If you want to do 1,000 factorial hold down “Shift”, hit “Enter”—it can do that for you as well You can also assign these to variables so you can hit “ x = 2! * 5” and it’ll go ahead and save that and if you type in “x” back it should give you 10. So now you can see here that you do all of your computations in what are called cells. Let’s see if I can scroll down here—yes. You can like a Wolfram Language input, which is the default You can free form input and all these have built-in shortcuts here for you to go ahead and do that. So now you can also look at prime factorization. So FactorInteger[10]. Bam, it gives you that back. We’re just getting started here, which is pretty cool. So now let’s see here examples of how to use the Cloud. So the main function that you can start to use is “CloudDeploy” and then here you can also see examples that there’s built-in documentation too to this. So if you just hit “Enter” on that and then you see that down arrow here, can actually hit the down key or you can click on it and you can go ahead and take a look here at that You can hit “CloudDeploy[expr]”. And we can actually take a look at the documentation to see what are some examples of expressions in a little bit. But let’s say we just want to deploy “HelloWorld” to the Cloud, “Shift” and “Enter”, now it gives you back what is called a Cloud object and if you click on it that’s pretty easy. In one line of code you can do that. Let’s say we want to build a form that does the following let’s see here again built-in documentation, let’s take a look here. OK, so “FormFunction”, let’s do this. So let’s say we want to go back and actually build a form that factors integers and then try to deploy that to the Cloud. So let’s take a look here. So name, let’s call this “num”. Type—so type would be “integer’”— so you can see how it fills for you, super nice and easy. And now this “…” stands for optional parameters, so if you have additional parameters don’t worry about it too much, you can keep going if you want. Now here we can just do here then “FactorInteger” of “num” and hopefully this is fine. Let’s actually go ahead and say, let’s call this “webform =” that. So evaluate that. Argument “num” is not an exact number. Cool. So in this case then we can go ahead and pull up the documentation. Let’s hit “enter” here and go to “FormFunction”. We can take a look at this. So here we have some examples here, which are really nice. OK, perfect. So, it’s actually “numbers” then is what is called not “integers”, so if we go back here and let’s say that it’s a “number”. Let’s try doing that instead. Let’s see what it says now. “ “Number” is incomplete—needs more input, oops. Is not an exact number. Hmm. Let’s try deploying it regardless. Let’s CloudDeploy to actually say “webform” and see what happens here. Let’s try hitting 10. ActiveInteger num 10. Let’s take a look again. Oh I see—wait a second. No, that’s right. Num integer. Huh. Let’s see here. I mean, either way we can take a look at examples here so let’s say we’ll find some new examples or applications. There, that works too. So we can go ahead and copy and paste this, if it let’s us. Let’s do this example just kind of for kicks and giggles. So let’s go in here and actually do this. Ok so let’s try doing this and it should give us back a Cloud object. Perfect. Ok so then the example would be like let’s say JFK to Chicago O’Hare and so what these mean—these are smart fields—you can kind of just type in an airport name, kind of a typical name for what’s it’s known by and then here you go, it gives you back an image, a PNG, specifically, of a line between Chicago and New York. That’s pretty cool. You can a little more than that too, which I don’t know if I’ll have all the time to show you guys, just want to kind of give you a quick example of what you can do. But let’s say that we wanted to look up classifiers here, so go back to the Language reference, which is here, and then let’s look up something like “classify”. Bam. So in here you can actually build a classifier function, literally from scratch, all with this “Classify” function. If you provided a training set and then you tell it, it’ll figure out what exactly is the best way to classify it, whether it’s logistic regression or whether its forest trees and forest or what not, it’ll go ahead and classify things for you, which is kind of cool. So here, “Classify” function, again, so there’s a lot going on here and that’s just machine learning stuff. I mentioned that we can deploy in some APIs and this API function call —let me give you an example here. Bam right there. So if you specify that func = APIFunction of x to an integer of x—see there you go— that’s what I had wrong, missing before, is I wanted to do “#x”, which signifies that I want to do FactorInteger of the variable. That’s a part of the API function. See, that’s what I messed up. So you can go ahead and do that and this “&” I believe signifies the end of the function for what you want to do. And bam, yup, there you go and you can go ahead and deploy that API and it tells you here that the deployed API function can be invoked by accessing the Cloud object in a web browser and appending this query string to the end of it. And it’ll give you back that and you can go ahead and parse it in whatever language you want. So, that’s sort of just scratching the surface of what’s available in the Wolfram Language. Hopefully you guys found that interesting. Obviously there’s plenty more going on than what I showed you. For example there’s weather data built in —you can literally say, “WeatherData” and let’s say we want to find out the temperature in Houston. So we go ahead and type “Houston”, “temperature”, evaluate that and there you go—it’s 12 degrees Celsius. And then if you want to be able to deploy that as an API you can go ahead and say, “APIFunciton” of that and obviously all of the syntax, etc., that is given here on the documentation is fantastic and if you want to deploy that API function you can do that as well. Like I said, I am just starting to scratch the surface a little bit. The main things are obviously CloudDeploy, APIFunction, machine learning seems to be a really popular one for hackers everywhere. I definitely recommend playing around with it. And like I said, if you are someone who is interested in kind of learning more about our Hackathon resources we actually have a website dedicated to all them—it’s wolfram.com/hackathons. And there you go. So we have the winners of MHacks. There’s a lot of cool stuff going on that is really exciting. You can see somebody made 2048 using Wolfram Language. There’s a lot going on here. So take a look at examples, take a look at documentation, and see what’s out there. And hopefully you’ll see, actually I know you’ll see, the value that’s in the language. So I think that’s all I got for now so enjoy and happy hacking.

Video Details

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

StudentIntroWolframLanguagProgrammingCloud

Caption and Translate

    Sign In/Register for Dotsub to translate this video.