diff --git a/common-content/en/module/tools/bitwise-operators/index.md b/common-content/en/module/tools/bitwise-operators/index.md new file mode 100644 index 000000000..bb8a5bcd3 --- /dev/null +++ b/common-content/en/module/tools/bitwise-operators/index.md @@ -0,0 +1,43 @@ ++++ +title = "Bitwise operators" +headless = true +time = 120 +facilitation = false +emoji= "📖" +objectives=[ + "Describe the meaning of the &, |, ^, and ~ bitwise operators.", + "Manually perform the function of the &, |, ^, and ~ bitwise operators on two integers.", +] ++++ + +{{}} + +{{}} + +{{}} + +{{}} diff --git a/common-content/en/module/tools/comparing-programming-languages/index.md b/common-content/en/module/tools/comparing-programming-languages/index.md new file mode 100644 index 000000000..32a59fe69 --- /dev/null +++ b/common-content/en/module/tools/comparing-programming-languages/index.md @@ -0,0 +1,38 @@ ++++ +title = "Comparing programming languages" +headless = true +time = 20 +facilitation = false +emoji= "⚖️" +objectives=[ + "Identify whether variables have fixed types in C, Python, and JavaScript.", + "Identify and explain the differences between a function definition in C and Python.", + "Compare compiled and interpreted languages.", + "Explain one advantage of compiled languages, and one advantage of interpreted languages.", +] ++++ + +Variables are names for memory locations. What's inside the memory location can be changed. + +{{}} + +{{}} +Write the same function twice, once in C and once in Python. The function should take two numbers as parameters, and return the sum of those two numbers. + +Write down what's different about the two function definitions. +{{}} + +Some programming languages are compiled. Others are interpreted. + +{{}} +Write down an explanation of what it means to be compiled or interpreted. + +List all of the programming languages you know about - is each one compiled or interpreted? + +What are the advantages and disadvantages of being compiled or interpreted? Write them down. +{{}} diff --git a/common-content/en/module/tools/head-and-tail/index.md b/common-content/en/module/tools/head-and-tail/index.md index beeeacc38..7598c6f73 100644 --- a/common-content/en/module/tools/head-and-tail/index.md +++ b/common-content/en/module/tools/head-and-tail/index.md @@ -29,7 +29,7 @@ Imagine we have an input file which has 100 lines. {{}} diff --git a/common-content/en/module/tools/programming-language-concepts/index.md b/common-content/en/module/tools/programming-language-concepts/index.md index 8974eca9c..f97429246 100644 --- a/common-content/en/module/tools/programming-language-concepts/index.md +++ b/common-content/en/module/tools/programming-language-concepts/index.md @@ -4,27 +4,13 @@ headless = true time = 120 facilitation = false emoji= "📖" -[objectives] - 1="Describe what a variable is." - 2="Describe how a variable relates to a memory location." - 3="Identify whether variables have fixed types in C, Python, and JavaScript." - 4="Explain how the next memory location is found when declaring a local variable on the stack." - 5="Explain why some variables are allocated on the heap not the stack." - 6="Explain when memory used for a variable on the stack is released." - 7="Explain when memory used for a variable on the heap is released." - 8="Define an operator." - 9="Give examples of common operators." - 10="Explain the difference between integer division and floating point division." - 11="Describe the meaning of the &, |, ^, and ~ bitwise operators." - 12="Manually perform the function of the &, |, ^, and ~ bitwise operators on two integers." - 13="Describe the meaning of the && (and), || (or), and ! (not) operators." - 14="Explain when it's more appropriate to use a while loop or a for loop." - 15="Identify and explain the differences between a function definition in C and Python." - 16="Explain what happens when you call a function." - 17="Explain what a class is." - 18="Describe the relationship between an object and a class." - 19="Compare compiled and interpreted languages." - 20="Explain one advantage of compiled languages, and one advantage of interpreted languages." +objectives=[ + "Describe what a variable is.", + "Describe how a variable relates to a memory location.", + "Give examples of common operators.", + "Describe the meaning of the && (and), || (or), and ! (not) operators.", + "Explain what happens when you call a function.", +] +++ Read the learning objectives listed on this page: Bear in mind what you’re trying to achieve while reading this text. If a topic isn’t making much sense, and isn’t in the objectives, you can probably skip over it. If a topic is listed in the objectives, you should keep studying it until you are confident you’ve met the objective. @@ -32,9 +18,43 @@ Read the learning objectives listed on this page: Bear in mind what you’re try {{}} Read chapter 9 of How Computers Work. -Do every exercise listed in the chapters. +Do every exercise listed in the chapter. You can skip the projects (though you're welcome to try any of them if you have time!). {{}} Check you have achieved each learning objective listed on this page. + +{{}} +Write down an explanation of what a variable is. Make sure to use the term "memory location" in your explanation. +{{}} + +{{}} +Write down what operators you have used in a programming language. + +Next to each, write down whether it's a unary, binary, or ternary operator. + +Make sure you have at least one example of a unary operator, a binary operator, and a ternary operator. +{{}} + +{{}} +Write down what happens when you call a function. + +Make sure you include how the "next line of code to run" moves around, parameters/arguments, return values, and scope. +{{}} + +{{}} +Write down an explanation of what a class is, which could be understood by someone who's never written any code before. + +Include at least one real-world example of when a class is useful. + +Make sure you describe the relationship between a class and an instance of a class. +{{}} + +{{}} +Instances of classes are often called objects. + +This kind of "object" is similar to, but slightly different from what we call an "object" in JavaScript. + +Write down the differences between the two meanings of the word object. +{{}} diff --git a/common-content/en/module/tools/sort-and-uniq/index.md b/common-content/en/module/tools/sort-and-uniq/index.md index acc41029b..d60513278 100644 --- a/common-content/en/module/tools/sort-and-uniq/index.md +++ b/common-content/en/module/tools/sort-and-uniq/index.md @@ -5,7 +5,7 @@ time = 20 facilitation = false emoji= "💻" [objectives] - 1="Count the occurences of different lines within a file using sort and uniq" + 1="Count the occurrences of different lines within a file using sort and uniq" +++ `sort` sorts its input. `uniq` deduplicates adjacent matching lines. @@ -20,7 +20,7 @@ Often we pipe to `sort | uniq` not just `uniq` so that duplicate lines will be n For the following quizzes, consider the following input file: ```console -% cat input +% cat input.txt pigs 10 chickens 2 pigs 10 @@ -31,20 +31,20 @@ hamsters 300 {{}} {{}} {{}} diff --git a/org-cyf-sdc/content/tools/sprints/2/prep/index.md b/org-cyf-sdc/content/tools/sprints/2/prep/index.md index 85caca944..4a840b5f5 100644 --- a/org-cyf-sdc/content/tools/sprints/2/prep/index.md +++ b/org-cyf-sdc/content/tools/sprints/2/prep/index.md @@ -9,13 +9,19 @@ weight = 1 name="Programming language concepts" src="module/tools/programming-language-concepts" [[blocks]] +name="Bitwise operators" +src="module/tools/bitwise-operators" +[[blocks]] +name="Comparing programming languages" +src="module/tools/comparing-programming-languages" +[[blocks]] name = "Shell pipelines" src="module/tools/shell-pipelines" [[blocks]] name="Brian Kernighan on pipelines" src="https://www.youtube.com/watch?v=bKzonnwoR2I" [[blocks]] -name="grep" +name="grep in pipelines" src="module/tools/grep-in-pipelines" [[blocks]] name="sort and uniq"