Skip to content

Commit

Permalink
merging
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Edgy Edgecombe committed Jul 27, 2014
2 parents cccf4d7 + 67f3dd6 commit 775885e
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 18 deletions.
2 changes: 0 additions & 2 deletions authentication_authorization/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,5 +162,3 @@ Thats it! If you followed all of the above until this point (and did the homewor
- need a username and password to log in,
- need to be logged in to add/edit/publish(/delete) posts
- and can log out again

Treat yourself to a drink now because now your page is both great and secured!
46 changes: 30 additions & 16 deletions intro_to_command_line/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@


## Introduction
Hey girls, the following steps will show you how to use the black window. This window is also called the "command line", "cmd", "prompt" and "terminal".
Hey girls, the following steps will show you how to use the black window all hackers use. It might look a bit scary at first, but really, it is just a prompt, waiting for commands from you.

Each operating system has a set of commands for the command line.
Here is a summary of some useful commands:
The window is usually called the *command line*, but you can also hear the following names: *cmd*, *prompt*, *console* or *terminal*.

Each operating system has a slightly different set of commands for the command line. Here is a summary of some useful commands:

| Command (Windows) | Command (Mac OS / Linux) | Description | Example|
| ------------- |-----------|-------------| -----|
Expand All @@ -16,46 +17,59 @@ Here is a summary of some useful commands:
| move | mv | move file | **move c:\test\test.txt c:\windows\test.txt** |
| mkdir | mkdir | create a new directory | **mkdir testdirectory** |
|del | rm | delete a directory/file | **del c:\test\test.txt**
For more about the above commands, check out the Further Information section below.
To learn more about the above commands, check out the Further Information section below.

These are just a very few of the possible black window commands.
[ss64.com](http://ss64.com) contains a complete reference of commands for all operating systems.

## Useful shortcuts

* Up arrow - rerun previous commands. You can avoid typing the same commands again by using the up arrow key to rerun recently used commands.
* **Up arrow** - rerun previous commands. You can avoid typing the same commands again by using the up arrow key to rerun recently used commands.


<<<<<<< HEAD
* Tab key - the tab key will autocomplete directory and file names. For example, typing **dir t ** + Tab will autocomplete to all directories starting with t in the current directory (such as task, test, tutorial).
=======
* **Tab key** - the tab key will autocomplete directory and file names. For example, typing `dir t` + `Tab` will autocomplete to all directories starting with `t` in the current directory (such as task, test, tutorial).
>>>>>>> upstream/master

## Further information about the commands above

* The **exit** commmand - this will cause the window to close; it makes sense, right? No need to explain too much ...
* **exit** - it closes the black window; it makes sense, right? No need to explain too much...


* **cd** - it allows you to change your current directory. To use it type `cd [directoryname]` and press enter.

**For example:** let's say you are in a directory called `c:\test` with three sub-directories: `documents`, `photos`, and `music`.

c
└───test
documents
photos
music

* The **cd** command - this command allows you to change your current directory. To use the cd command you type cd directoryname and press enter.
For example if you are in a directory called c:\test, and there were three directories in that the test directory called A, B, and C, you could just type **cd A** and press enter. You would then be in the c:\test\A.
To go to the `documents` directory, simply type `cd documents` and press enter. You are now in `c:\test\A`. To move back to the `c:\test` directory, type `cd ..`.


* The **cd ..** command - this will take you to the next directory up.
* **dir** (Windows) / **ls** (others) - it lists files and directories located in your current directory. If you type `dir \test` or `ls test`, you will see the content of the `c:\test` directory.
Note that for many commands you can use the `*` symbol which stands for *all* or *wildcard*. With this in mind, try typing `dir *.txt` for Windows or `ls *.txt` for other OS. It will list only files that end with `.txt`.


* The **dir** (Windows) and **ls** (others) command - this will list the files and directories contained in your current directory. If I typed **dir \test** or **ls test** I would see the contents of the c:\test directory.
Also note for many commands you can use the \* symbol which stands for wildcard. With this in mind, typing **dir *.txt** on WIN or **ls *.txt** on other OS will only list those files that end with .txt.
* **copy** (Windows) / **cp** (others) - it allows you to copy files from one location to another. To use this command, type `copy [sourcefile] [targetfile]`.

**For example**: if you have the file `c:\test\test.txt` and you would like to copy it to `c:\windows\test.txt`, type:

* The **copy** (Windows) or **cp** (others) command - this allows you to copy files from one location to another. To use this command you would type **copy *sourcefile targetfile***. For example if you have the file c:\test\test.txt and would like to copy it to c:\windows\test.txt you would type
**copy c:\test\test.txt c:\windows\test.txt** and press enter.
copy c:\test\test.txt c:\windows\test.txt


* The **move** (Windows) or **mv** (others) command - this allows you to move files from one location to another. The syntax you use is the same as for the **copy** command.
* **move** (Windows) / **mv** (others) - it allows you to move files from one location to another. The syntax you use is the same as for the `copy` command.


* The **mkdir** command - this allows you to create a new directory. For example **mkdir temp** creates a new directory called temp in the current directory.
* **mkdir** - it allows you to create a new directory. For example, `mkdir temp` creates a new directory called `temp` in the current directory.


* The **del** (Windows) or **rm** command (others) - this allows you to delete the specified file. For example, **del test.txt** deletes the test.txt file from the current directory.
* **del** (Windows) / **rm** (others) - it allows you to delete the specified file. For example, `del test.txt` deletes the `test.txt` file from the current directory.



Expand Down
44 changes: 44 additions & 0 deletions python_introduction/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,50 @@ As you can see, you can access different objects in your list by using the list'

You can find a list of all available list methods in this chapter of the Python documentation: https://docs.python.org/3/tutorial/datastructures.html

## Dictionaries

A dictionary is similar to a list, but you access values by looking up a key instead of an index. A key can be any string or number. The syntax to define a dictionary is:
>>> {}
{}

This shows that you just created an empty dictionary. Hurray!

Now, try writing the following command:
>>> django_dolls = {'Dottie' : 15, 'Lottie' : 305, 'EmmyLou' : 17}

Don't be surprised with the weird names. Go to the link: http://hubpages.com/hub/50-Doll-Names to look for more cute doll names. :P Just Kidding (You should do this if and only if you have a lot of time).

Above, you just created a variable named django_dolls with three key-value pairs. The key Dottie points to the value 15, Lottie points to the value 305, EmmyLou points to the value 17.

When to use a dictionary or a list? Well, a good point to ponder on. Just have a soltuion in mind before looking at the answer in the next line.

- Do you just need an ordered sequence of items? Go for a list.
- Do you need to associate values with keys, so you can look them up efficiently (by key) later on? Use a dictionary.

Dictionaries are mutable like "lists" meaning that they can be changed after they are created. You can add new key/value pairs to the dictionary after it is created, like:
>>> django_dolls['Jilly'] = 67

Like the lists, using len() method on the dictionaries, returns the number of key-value pairs in the dictionary. Go ahead and type in the command:
>>> len(django_dolls)
4

I hope it makes sense uptil now. :) Ready for some more fun with Dictionaries? Hop on the next line for some amazing things.

You can use del() command to delete an item in the dictionary which has particular. Say, if you want to delete the entry corresponding to the key Dottie, just type in the following command:

>>> del django_dolls['Dottie']
>>> django_dolls
{'Jilly': 67, 'EmmyLou': 17, 'Lottie': 305}

As you can see from the output, the key-value pair corresponding to 'Dottie' key has been deleted.

Apart from this, you can also change a value associated with an already created key in the dictionary. Type:
>>> django_dolls['Jilly'] = 100
>>> django_dolls
{'Jilly': 100, 'EmmyLou': 17, 'Lottie': 305}

As you can see, the value of the key 'Jilly' has been altered from 67 to 100. :) Exciting? Hurrah! You just learnt another amazing thing.

### Summary

Awesome! You know a lot about programming now. In this last part you learned about:
Expand Down

0 comments on commit 775885e

Please sign in to comment.