In my previous post I discussed what a compiler does. In this post I will cover Interpreted code, Bytecode and Just-in-Time compilation. One thing to note at this point is that while a compiler is able to create a standalone executable application (e.g an .exe file in Windows) which does not depend on any other application in order to run, the same is not true for the three methods.
Installing Git on Windows is very similar to installing it on Linux. That might not come as a surprise though because the tools we’ll be using in this post are specifically designed to allow Windows users to utilise Linux packages without needing to install a VM.
The first thing you’ll need to do is download Git for Windows. Once you have done that, install it using all of the default settings. After completing the installation, you will find that you’ve now got three Git applications:
- Git Bash
- Git CMD
- Git GUI
If you’ve used Linux before and/or have coded using a language such as C, you will have come across a compiler. Though because they’re so easy to use, you might not have actually understood what it is they do.
In a nutshell, compilers simply (I say simply because what they do is actually very complex under the hood) check for syntax correctness, convert source code from “high level” languages to a low level (native) language which your CPU understands and perform optimisation among other things. Due to the conversion and optimisation of code, compiled applications run much faster than when other methods are used. The result of a compilation is a standalone executable application (e.g an .exe file in Windows) which does not depend on any other application in order to run.
You’ve probably already heard that Python is a strong, dynamically typed language. But what does that actually mean? Let’s jump in and take a look.
Dynamically vs Statically Typed Languages
This StackOverflow Q&A gives us an idea on the difference between Statically and Dynamically Typed languages:
A language is statically typed if the type of a variable is known at compile time. For some languages this means that you as the programmer must specify what type each variable is (e.g.: Java, C, C++)
In Learning Python (a must read for anyone interested in Python!), author Mark Lutz refers to statements and expressions frequently, but give a clear explanation of the two.
Rather than reinventing the wheel by providing my own definition and examples of the two, I found this Quora Q&A does that perfectly:
A statement is a complete line of code that performs some action, while an expression is any section of the code that evaluates to a value. Expressions can be combined “horizontally” into larger expressions using operators, while statements can only be combined “vertically” by writing one after another, or with block constructs. Every expression can be used as a statement (whose effect is to evaluate the expression and ignore the resulting value), but most statements cannot be used as expressions. Here’s a.
A common misconception is that the only difference between Lists and Tuples is that the former is mutable while the latter is immutable. While this is true, it is only one of the differences between them as per the Q&As quoted below.
… This gives rise to differences in how they can or can’t be used (enforced a priori by syntax) and differences in how people choose to use them (encouraged as ‘best practices,’ a posteriori, this is what smart programers do). The main difference a posteriori in differentiating when tuples are used versus when lists are used lies in what meaning people give to the order of elements.
In Part 2 of this series we made our first API call and received over 200 lines of XML as a result. The reason why we received so much output is because we didn’t remove any desired-attributes and therefore the call retrieved about 90 pieces of information. When you multiply that by the number of queries we ran (2), you get 180 pieces of information being requested.
This post will discuss why you should limit your queries to only the pieces of information you’re interested in. It will also cover how you can use ZExplore to convert its XML configuration to languages such as Python, Perl and Ruby.
Picking up where I left off in Part 1 of this series, let’s continue our exploration of ZExplore :)
In part 1 I touched on the fact that the API documentation can be a little confusing when it comes to mandatory fields. Unfortunately the same is true for ZExplore. However, NetApp’s documentation explains it well:
Red colored arrows indicate mandatory parameters whereas Blue colored arrows indicate optional parameters.
Note: In some APIs when either one of the two input parameters is required, both these input parameters are marked by “Blue” color arrow and not “Red”.
As I mentioned in my previous post, by doing this NetApp avoids confusing users who might otherwise try to set both parameters if they were both marked as required.
If you’re a regular reader of this blog, you’ll see that I’ve been posting about automation and Python quite a lot recently. The reason being that it’s not only fun, but I feel it’s the way of the future. But I digress…
The reason for this post is to discuss my recent experience with NetApp’s APIs. As I got off to a pretty slow start (which I feel was due to lack of documentation), I’ll also provide setup and usage guidance in the hopes that you can get up and running sooner than I did.
In my Why Automate? post I discussed how important I feel automation skills will be for engineers in the near future. I even went as far as to say that those who don’t learn to use automation will one day be left behind. Not only do I still stand by that statement, but I’d like to extend it to cover coding as well for the exact same reasons as the ones which were covered in my automation post.
With this in mind, I plan to write a series of posts covering Python. The reason I’ve chosen Python is because it’s great for those who are new to coding, it’s extremely powerful, it has a great community behind it and a countless number of useful modules available.