This repository has been archived by the owner on Oct 28, 2019. It is now read-only.
forked from pystar/pystar
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
some flesh on the badgey bones, for all of them.
- Loading branch information
Showing
7 changed files
with
135 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,93 @@ | ||
In the Beginning was the Command Line Badge | ||
.. badge_inthebeginning: | ||
In the Beginning was the Command Line | ||
=========================================== | ||
|
||
In the Beginning was the Command Line is a book by Neal Stephenson. Unlike many of his other works, it is short and available for free (legally) download on the internet. The first part of this badge is to do just that. Go here to complete this task: http://www.cryptonomicon.com/beginning.html | ||
History matters. At first glance, many of the commands and idioms of | ||
programming seem deliberately obscure. But they are the culmination of | ||
an evolutionary process, with twists and turns and dead-ends. Knowing | ||
some history, and in particular the history of the Unix operating system, | ||
sheds light on what is otherwise occult. | ||
|
||
*In the Beginning Was the Command Line* is a book by Neal Stephenson. | ||
Unlike many of his other works, it is short and available for (legal) free download on the internet. | ||
|
||
#. Go to: http://www.cryptonomicon.com/beginning.html | ||
#. Read the section entitled "THE HOLE HAWG OF OPERATING SYSTEMS." | ||
|
||
|
||
.. note:: | ||
|
||
this badge is a bit incomplete, and you will benefit from having a | ||
guide around to help you through it) | ||
|
||
|
||
Now that you have read the section, let's honor our shared history by using Unix | ||
commands to do the same work for us. | ||
|
||
:: | ||
|
||
curl -s 'http://www.cryptonomicon.com/command.zip' | gunzip | grep -i -A22 'pipe' | less | ||
# type 'q' to quit from 'less' when you are done. | ||
Let's break this down. | ||
|
||
#. The ``|`` takes the text **output** from one command and **pipes** it into | ||
the **input** of the next command. | ||
#. research curl: ``man curl``. What does curl do? What about the | ||
``-s`` option? | ||
|
||
.. container:: answer-hidden | ||
|
||
Curl is a command line client for hitting urls. We can use it | ||
to download the web page. ``-s`` makes it run 'silently'. | ||
|
||
#. ``gunzip``? What is does gunzip do? | ||
|
||
.. container:: answer-hidden | ||
|
||
it unzips the file :) Nothing magical there! | ||
|
||
#. What file is ``gunzip`` operating on? | ||
|
||
.. container:: answer-hidden | ||
|
||
None, really. Or rather it's operating on a special file called | ||
``stdin``, which is here attached to the ``stdout`` out of the curl | ||
command, via the **pipe**. | ||
|
||
#. ``grep -i -A22 'pipe'`` . ``grep`` is the *general regular expression | ||
parser*, that is used to find lines in a file matching an expression. | ||
Here, we have thrown on some special switches: | ||
|
||
* ``-i`` for *case insensitive* | ||
* ``-A22`` for 'show me the 22 lines *after* my match. Since each | ||
line in the original is a paragraph, this has the effect of getting us | ||
the whole section. | ||
* ``'pipe'`` is what to search on in the incoming stream. | ||
|
||
#. ``less`` is a **pager**, which is a program that takes a stream of text, | ||
and turns it in 'screen-size' 'pages' for easier viewing. | ||
|
||
|
||
Exercises: | ||
|
||
#. Look at all the lines including the word *pride* in *Pride and Prejudice* | ||
(downloadable at http://www.gutenberg.org/files/1342/1342-h/1342-h.htm) | ||
|
||
.. container:: answer-hidden | ||
|
||
:: | ||
|
||
curl 'http://www.gutenberg.org/files/1342/1342-h/1342-h.htm' | grep -i 'pride' | less | ||
|
||
#. Count those lines using the ``wc`` command. | ||
|
||
.. container:: answer-hidden | ||
|
||
The second part of this badge is to read the section entitled "THE HOLE HAWG OF OPERATING SYSTEMS." | ||
:: | ||
|
||
**Extra Credit**: If you want, you can complete the second part of the badge using only the commandline. Open a CLI and navigate to where the text is stored (and perhaps named something like command.txt) and run the following command:: | ||
curl 'http://www.gutenberg.org/files/1342/1342-h/1342-h.htm' | grep -i 'pride' | wc | ||
|
||
$ grep -A 22 "THE HOLE HAWG OF OPERATING SYSTEMS" command.txt | ||
|
||
What does this command return? What do you think ``grep`` does? After you've read the text, play around some with ``grep`` - it's pretty neat! | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,10 @@ | |
jQuery | ||
======== | ||
|
||
(get a guide to help out) | ||
|
||
#. edit an html page | ||
#. get jQuery | ||
#. go wild! | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.. badge_matplotlib | ||
Graphing with Matplotlib | ||
-------------------------------- | ||
|
||
.. note:: | ||
|
||
This badge is raw and incomplete. | ||
|
||
#. https://github.com/jesstess/BostonPythonWorkshop/tree/master/graphing_with_matplotlib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters