diff options
-rw-r--r-- | asymptotic-notation.html.markdown | 62 | ||||
-rw-r--r-- | c.html.markdown | 10 | ||||
-rw-r--r-- | cmake.html.markdown | 49 | ||||
-rw-r--r-- | de-de/c-de.html.markdown | 7 | ||||
-rw-r--r-- | go.html.markdown | 8 | ||||
-rw-r--r-- | pascal.html.markdown | 2 | ||||
-rw-r--r-- | processing.html.markdown | 2 |
7 files changed, 76 insertions, 64 deletions
diff --git a/asymptotic-notation.html.markdown b/asymptotic-notation.html.markdown index 7a7989d3..a6acf54e 100644 --- a/asymptotic-notation.html.markdown +++ b/asymptotic-notation.html.markdown @@ -31,24 +31,24 @@ specifications, processing power, etc. ## Types of Asymptotic Notation -In the first section of this doc we described how an Asymptotic Notation +In the first section of this doc, we described how an Asymptotic Notation identifies the behavior of an algorithm as the input size changes. Let us imagine an algorithm as a function f, n as the input size, and f(n) being the running time. So for a given algorithm f, with input size n you get -some resultant run time f(n). This results in a graph where the Y axis is the -runtime, X axis is the input size, and plot points are the resultants of the -amount of time for a given input size. +some resultant run time f(n). This results in a graph where the Y-axis is +the runtime, the X-axis is the input size, and plot points are the resultants +of the amount of time for a given input size. You can label a function, or algorithm, with an Asymptotic Notation in many different ways. Some examples are, you can describe an algorithm by its best -case, worse case, or equivalent case. The most common is to analyze an -algorithm by its worst case. You typically don't evaluate by best case because -those conditions aren't what you're planning for. A very good example of this -is sorting algorithms; specifically, adding elements to a tree structure. Best -case for most algorithms could be as low as a single operation. However, in -most cases, the element you're adding will need to be sorted appropriately -through the tree, which could mean examining an entire branch. This is the -worst case, and this is what we plan for. +case, worst case, or average case. The most common is to analyze an algorithm +by its worst case. You typically don’t evaluate by best case because those +conditions aren’t what you’re planning for. An excellent example of this is +sorting algorithms; particularly, adding elements to a tree structure. The +best case for most algorithms could be as low as a single operation. However, +in most cases, the element you’re adding needs to be sorted appropriately +through the tree, which could mean examining an entire branch. This is +the worst case, and this is what we plan for. ### Types of functions, limits, and simplification @@ -61,20 +61,22 @@ constant Exponential Function - a^n, where a is some constant ``` -These are some basic function growth classifications used in various -notations. The list starts at the slowest growing function (logarithmic, -fastest execution time) and goes on to the fastest growing (exponential, -slowest execution time). Notice that as 'n', or the input, increases in each -of those functions, the result clearly increases much quicker in quadratic, -polynomial, and exponential, compared to logarithmic and linear. - -One extremely important note is that for the notations about to be discussed -you should do your best to use simplest terms. This means to disregard -constants, and lower order terms, because as the input size (or n in our f(n) -example) increases to infinity (mathematical limits), the lower order terms -and constants are of little to no importance. That being said, if you have -constants that are 2^9001, or some other ridiculous, unimaginable amount, -realize that simplifying will skew your notation accuracy. +These are some fundamental function growth classifications used in +various notations. The list starts at the slowest growing function +(logarithmic, fastest execution time) and goes on to the fastest +growing (exponential, slowest execution time). Notice that as ‘n’ +or the input, increases in each of those functions, the result +increases much quicker in quadratic, polynomial, and exponential, +compared to logarithmic and linear. + +It is worth noting that for the notations about to be discussed, +you should do your best to use the simplest terms. This means to +disregard constants, and lower order terms, because as the input +size (or n in our f(n) example) increases to infinity (mathematical +limits), the lower order terms and constants are of little to no +importance. That being said, if you have constants that are 2^9001, +or some other ridiculous, unimaginable amount, realize that +simplifying skew your notation accuracy. Since we want simplest form, lets modify our table a bit... @@ -89,7 +91,7 @@ Exponential - a^n, where a is some constant ### Big-O Big-O, commonly written as **O**, is an Asymptotic Notation for the worst case, or ceiling of growth for a given function. It provides us with an -_**asymptotic upper bound**_ for the growth rate of runtime of an algorithm. +_**asymptotic upper bound**_ for the growth rate of the runtime of an algorithm. Say `f(n)` is your algorithm runtime, and `g(n)` is an arbitrary time complexity you are trying to relate to your algorithm. `f(n)` is O(g(n)), if for some real constants c (c > 0) and n<sub>0</sub>, `f(n)` <= `c g(n)` for every input size @@ -139,7 +141,7 @@ No, there isn't. `f(n)` is NOT O(g(n)). ### Big-Omega Big-Omega, commonly written as **Ω**, is an Asymptotic Notation for the best case, or a floor growth rate for a given function. It provides us with an -_**asymptotic lower bound**_ for the growth rate of runtime of an algorithm. +_**asymptotic lower bound**_ for the growth rate of the runtime of an algorithm. `f(n)` is Ω(g(n)), if for some real constants c (c > 0) and n<sub>0</sub> (n<sub>0</sub> > 0), `f(n)` is >= `c g(n)` for every input size n (n > n<sub>0</sub>). @@ -188,8 +190,8 @@ _**asymptotically tight bound**_ on the growth rate of runtime of an algorithm. Feel free to head over to additional resources for examples on this. Big-O is the primary notation use for general algorithm time complexity. -### Ending Notes -It's hard to keep this kind of topic short, and you should definitely go +### Endnotes +It's hard to keep this kind of topic short, and you should go through the books and online resources listed. They go into much greater depth with definitions and examples. More where x='Algorithms & Data Structures' is on its way; we'll have a doc up on analyzing actual code examples soon. diff --git a/c.html.markdown b/c.html.markdown index e5ffc379..a57be1dc 100644 --- a/c.html.markdown +++ b/c.html.markdown @@ -89,10 +89,12 @@ int main (int argc, char** argv) // Types /////////////////////////////////////// - // All variables MUST be declared at the top of the current block scope - // we declare them dynamically along the code for the sake of the tutorial - // (however, C99-compliant compilers allow declarations near the point where - // the value is used) + // Compilers that are not C99-compliant require that variables MUST be + // declared at the top of the current block scope. + // Compilers that ARE C99-compliant allow declarations near the point where + // the value is used. + // For the sake of the tutorial, variables are declared dynamically under + // C99-compliant standards. // ints are usually 4 bytes int x_int = 0; diff --git a/cmake.html.markdown b/cmake.html.markdown index 32a7b758..9ea68a42 100644 --- a/cmake.html.markdown +++ b/cmake.html.markdown @@ -6,25 +6,25 @@ contributors: filename: CMake --- -CMake is a cross-platform, open-source build system. This tool will allow you -to test, compile and create packages of your source code. +CMake is a cross-platform, open-source build system. This tool allows you to test, +compile, and create packages of your source code. -The problem that CMake tries to solve is the problem of Makefiles and -Autoconfigure on cross-platforms (different make interpreters have different -command) and the ease-of-use on linking 3rd party libraries. +The problem that CMake tries to solve is the problem of Makefiles and +Autoconfigure on cross-platforms (different make interpreters have different +commands) and the ease-of-use on linking 3rd party libraries. -CMake is an extensible, open-source system that manages the build process in -an operating system and compiler-independent manner. Unlike many -cross-platform systems, CMake is designed to be used in conjunction with the +CMake is an extensible, open-source system that manages the build process in +an operating system and compiler-agnostic manner. Unlike many +cross-platform systems, CMake is designed to be used in conjunction with the native build environment. Simple configuration files placed in each source -directory (called CMakeLists.txt files) are used to generate standard build -files (e.g., makefiles on Unix and projects/workspaces in Windows MSVC) which +directory (called CMakeLists.txt files) are used to generate standard build +files (e.g., makefiles on Unix and projects/workspaces in Windows MSVC) which are used in the usual way. ```cmake # In CMake, this is a comment -# To run our code, we will use these steps: +# To run our code, please perform the following commands: # - mkdir build && cd build # - cmake .. # - make @@ -45,22 +45,22 @@ cmake_minimum_required (VERSION 2.8) # Raises a FATAL_ERROR if version < 2.8 cmake_minimum_required (VERSION 2.8 FATAL_ERROR) -# We setup the name for our project. After we do that, this will change some -# directories naming convention generated by CMake. We can send the LANG of -# code as second param +# We define the name of our project, and this changes some directories +# naming convention generated by CMake. We can send the LANG of code +# as the second param project (learncmake C) # Set the project source dir (just convention) set( LEARN_CMAKE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} ) set( LEARN_CMAKE_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR} ) -# It's useful to setup the current version of our code in the build system +# It's useful to set up the current version of our code in the build system # using a `semver` style set (LEARN_CMAKE_VERSION_MAJOR 1) set (LEARN_CMAKE_VERSION_MINOR 0) set (LEARN_CMAKE_VERSION_PATCH 0) -# Send the variables (version number) to source code header +# Send the variables (version number) to the source code header configure_file ( "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in" "${PROJECT_BINARY_DIR}/TutorialConfig.h" @@ -127,14 +127,14 @@ if(FALSE AND (FALSE OR TRUE)) message("Don't display!") endif() -# Set a normal, cache, or environment variable to a given value. -# If the PARENT_SCOPE option is given the variable will be set in the scope +# Set a regular, cache, or environment variable to a given value. +# If the PARENT_SCOPE option is given, the variable will be set in the scope # above the current scope. # `set(<variable> <value>... [PARENT_SCOPE])` -# How to reference variables inside quoted and unquoted arguments -# A variable reference is replaced by the value of the variable, or by the -# empty string if the variable is not set +# How to reference variables inside quoted and unquoted arguments? +# A variable reference is replaced by either the variable value or by the +# empty string if the variable is not set. ${variable_name} # Lists @@ -172,6 +172,7 @@ endif() ### More Resources -+ [cmake tutorial](https://cmake.org/cmake-tutorial/) -+ [cmake documentation](https://cmake.org/documentation/) -+ [mastering cmake](http://amzn.com/1930934319/) ++ [CMake tutorial](https://cmake.org/cmake-tutorial/) ++ [CMake documentation](https://cmake.org/documentation/) ++ [Mastering CMake](http://amzn.com/1930934319/) ++ [An Introduction to Modern CMake](https://cliutils.gitlab.io/modern-cmake/) diff --git a/de-de/c-de.html.markdown b/de-de/c-de.html.markdown index 9a938b22..f9090518 100644 --- a/de-de/c-de.html.markdown +++ b/de-de/c-de.html.markdown @@ -180,11 +180,12 @@ int main (int argc, char** argv) { // Typen //////////////////////////////////////////////// - // Alle Variablen müssen am Anfang des jetzigen Blocks deklariert werden. - // Wir deklarieren die Variablen dynamisch im Code um die Lesbarkeit im - // Tutorial zu verbessern. + // Compiler, welche nicht C99-kompatibel sind, verlangen, dass sämtliche + // Variablen zu Beginn des Blocks deklariert werden. // C99-Konforme Compiler erlauben die Variablendeklaration an dem Punkt, an // welchem die Variable verwendet wird. + // Wir deklarieren die Variablen dynamisch im Code um die Lesbarkeit im + // Tutorial zu verbessern. // integer sind normalerweise 4 Bytes groß int x_int = 0; diff --git a/go.html.markdown b/go.html.markdown index 739ec05d..b727e59d 100644 --- a/go.html.markdown +++ b/go.html.markdown @@ -13,6 +13,7 @@ contributors: - ["Clayton Walker", "https://github.com/cwalk"] - ["Leonid Shevtsov", "https://github.com/leonid-shevtsov"] - ["Michael Graf", "https://github.com/maerf0x0"] + - ["John Arundel", "https://github.com/bitfield"] --- Go was created out of the need to get work done. It's not the latest trend @@ -459,7 +460,7 @@ There you can follow the tutorial, play interactively, and read lots. Aside from a tour, [the docs](https://golang.org/doc/) contain information on how to write clean and effective Go code, package and command docs, and release history. -The language definition itself is highly recommended. It's easy to read +The [Go language specification](https://golang.org/ref/spec) itself is highly recommended. It's easy to read and amazingly short (as language definitions go these days.) You can play around with the code on [Go playground](https://play.golang.org/p/tnWMjr16Mm). Try to change it and run it from your browser! Note that you can use [https://play.golang.org](https://play.golang.org) as a [REPL](https://en.wikipedia.org/wiki/Read-eval-print_loop) to test things and code in your browser, without even installing Go. @@ -472,4 +473,9 @@ documentation](http://golang.org/pkg/) and the source code comes up! Another great resource to learn Go is [Go by example](https://gobyexample.com/). +There are many excellent conference talks and video tutorials on Go available on YouTube, and here are three playlists of the very best, tailored for beginners, intermediate, and advanced Gophers respectively: +* [Golang University 101](https://www.youtube.com/playlist?list=PLEcwzBXTPUE9V1o8mZdC9tNnRZaTgI-1P) introduces fundamental Go concepts and shows you how to use the Go tools to create and manage Go code +* [Golang University 201](https://www.youtube.com/playlist?list=PLEcwzBXTPUE_5m_JaMXmGEFgduH8EsuTs) steps it up a notch, explaining important techniques like testing, web services, and APIs +* [Golang University 301](https://www.youtube.com/watch?v=YHRO5WQGh0k&list=PLEcwzBXTPUE8KvXRFmmfPEUmKoy9LfmAf) dives into more advanced topics like the Go scheduler, implementation of maps and channels, and optimisation techniques + Go Mobile adds support for mobile platforms (Android and iOS). You can write all-Go native mobile apps or write a library that contains bindings from a Go package, which can be invoked via Java (Android) and Objective-C (iOS). Check out the [Go Mobile page](https://github.com/golang/go/wiki/Mobile) for more information. diff --git a/pascal.html.markdown b/pascal.html.markdown index 9fb51c3b..a505a38f 100644 --- a/pascal.html.markdown +++ b/pascal.html.markdown @@ -15,7 +15,7 @@ source : [wikipedia](https://en.wikipedia.org/wiki/Pascal_(programming_language) to compile and run a pascal program you could use a free pascal compiler. [Download Here](https://www.freepascal.org/) ```pascal -//Anathomy of a Pascal Program +//Anatomy of a Pascal Program //this is a comment { this is a diff --git a/processing.html.markdown b/processing.html.markdown index e437ee95..d99912e7 100644 --- a/processing.html.markdown +++ b/processing.html.markdown @@ -140,7 +140,7 @@ SomeRandomClass myObjectInstantiated = new SomeRandomClass(); // Arithmetic 1 + 1 // 2 -2 - 1 // 0 +2 - 1 // 1 2 * 3 // 6 3 / 2 // 1 3.0 / 2 // 1.5 |