Skip to content

Commit

Permalink
markdown source builds
Browse files Browse the repository at this point in the history
Auto-generated via `{sandpaper}`
Source  : bb0b9ac
Branch  : main
Author  : github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Time    : 2024-11-15 11:36:24 +0000
Message : [create-pull-request] automated change (#106)

Co-authored-by: Federico Marotta <[email protected]>
  • Loading branch information
actions-user and fmarotta committed Nov 15, 2024
1 parent 3e15fae commit 459bbd7
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 22 deletions.
86 changes: 85 additions & 1 deletion 02_Getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,28 @@ help?> ∂
Great! This way she can easily look up the names she needs.
She gets back to normal mode by pressing <kbd>backspace</kbd>.

:::::: challenge

## Exploring Julia's Help Mode

Help mode can also be used to look up the documentation for Julia functions.
Use Julia's help mode to read the documentation for the `varinfo()` function.

:::::: solution

## Solution


::::::

If you are not already in help mode, type `?` to enter it. Then write `varinfo` and press enter.

```julia
?varinfo
```

::::::

Another useful mode is the *shell mode* that can be
entered by pressing <kbd>;</kbd>. The prompt has now changed:

Expand All @@ -167,7 +189,69 @@ Like before, hit <kbd>backspace</kbd> to get back to the Julia prompt.

:::::: challenge

## Hello, `shell>` !
## Hello, `shell>` (`pwd` and `cd`) !

Two commonly used shell commands are `pwd` (**p**rint **w**orking **d**irectory) and `cd` (**c**hange **d**irectory).

1. Use `pwd` to find out what is your current working directory.
2. Type the command `cd` in shell mode, which by default will bring you to your "home directory".
3. Use `pwd` again. Did you get a different result from before? Why or why not?

:::::: solution

## Solution

```julia
shell> pwd
```

```julia
shell> cd
```

```julia
shell> pwd
```

::::::

The working directory is the location from which you launched Julia.
To navigate to a different directory, you can use the `cd` command by entering: `cd <directory>`. By default, this command will return you to your home directory if a specific directory is not given.
If you initially launched Julia from your home directory, the working directory remains unchanged, so the output of the second `pwd` command will be identical to the first.
Conversely, if you were in a different directory when you started Julia, the results of the two `pwd` commands will differ.
You can use `cd -` to go back to your previous location.

::::::

:::::: challenge

## Hello, `shell>` (`ls`)!

Another useful shell command is `ls` (*list files*).
Use it to show the contents of your home directory.

:::::: solution

## Solution

```julia
shell> cd
```

```julia
shell> ls
```

::::::

The first `cd` command will bring you to your home directory.
`ls` will print a list of the files and directorys in your current location.

::::::

:::::: challenge

## Hello, `shell>` (`nano` and `cat`)!

Use the shell mode to create a file called `hello.jl` with the nano terminal text editor.
Inside that file write the simple hello world program `print("Hello World!")`.
Expand Down
2 changes: 1 addition & 1 deletion 04_Using_the_package_manager.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ environment.
````
Status `~/projects/trebuchet/Project.toml`
[f6369f11] ForwardDiff v0.10.38
[295af30f] Revise v3.6.2
[295af30f] Revise v3.6.3
[98b73d46] Trebuchet v0.2.2
````
Expand Down
30 changes: 15 additions & 15 deletions 07_Loops.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ Trebuchet( rand() * 500, rand() * pi/2 )

````output
2-element Trebuchet:
301.45863866265444
0.5147801124901857
228.38576259167743
1.0428133782844782
````

will give her a Trebuchet with a weight between 0 and 500 and a release angle between 0 and pi/2 radians at random.
Expand All @@ -121,9 +121,9 @@ distances = [shoot_distance(Trebuchet(rand() * 500, rand() * pi / 2), env) for _

````output
3-element Vector{Float64}:
107.31486215571258
116.5961233156913
3.006112235174449
75.81435701587722
83.01842049268829
67.14411448705451
````

This is called an _array comprehension_.
Expand All @@ -138,16 +138,16 @@ distances = [(w,a) => shoot_distance(Trebuchet(w, a), env) for (w, a) in zip(wei

````output
10-element Vector{Pair{Tuple{Float64, Float64}, Float64}}:
(316.3006668666567, 0.2763285950708336) => 101.94306047739477
(184.81067380921974, 0.21663020097625554) => 87.01600131363767
(118.28342636599143, 0.16251023948500737) => 71.41041926553547
(495.4627412106457, 0.2337213045007839) => 100.84254397856022
(121.54718006057836, 1.2933538749770221) => 44.31450096256152
(50.49083319279707, 1.3999293689100087) => 18.58057814648708
(463.0506320312314, 0.32643937336190937) => 108.22484752113716
(296.1556297915833, 0.035353940515857406) => 62.1859221237384
(134.340007097649, 1.2511802453356395) => 51.71612933008983
(493.7526856775179, 0.5068383250394274) => 118.81200975980546
(3.3334597480246253, 0.7838682352298685) => 0.6815707596179541
(210.78228935379622, 1.381946534840864) => 35.85286633327975
(401.5993709331619, 0.2185755446723246) => 96.9029165112703
(174.8500444474639, 1.3802675063026215) => 34.83498096430634
(459.5195474131575, 0.6388081196321991) => 117.62925382680423
(325.9792258612826, 1.4742042308383514) => 23.118879918525415
(424.04535348026496, 0.13367159006587603) => 84.32898973441384
(367.203106692998, 0.6088354356429886) => 117.46105246416498
(12.984772128024124, 1.5235451260228559) => 0.6815707596179541
(10.485349585032166, 0.6353974863672037) => 0.6815707596179541
````

### Gradient descent
Expand Down
2 changes: 1 addition & 1 deletion 10_Adding_tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ end
````

````output
Test.DefaultTestSet("Test arithmetic equalities", Any[], 1, false, false, true, 1.731584626736792e9, 1.731584626767338e9, false)
Test.DefaultTestSet("Test arithmetic equalities", Any[], 1, false, false, true, 1.731669987513481e9, 1.731669987543832e9, false)
````

With this Melissa can run her test using the pkg mode of the REPL:
Expand Down
8 changes: 4 additions & 4 deletions md5sum.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
"config.yaml" "6699b2abd84b5fba0babff7b1b377bf0" "site/built/config.yaml" "2023-08-09"
"index.md" "5b8e95a0b3b4d13e7ff0b24124996cca" "site/built/index.md" "2023-08-11"
"episodes/01_Introduction.md" "be6000ec05fac6b6d3a91844d6f0813c" "site/built/01_Introduction.md" "2023-10-28"
"episodes/02_Getting_started.md" "495e9cfb66b976f3eda5f5c63f86ec43" "site/built/02_Getting_started.md" "2023-08-11"
"episodes/02_Getting_started.md" "2f9d50bfd81d5d1346e101ea55a54600" "site/built/02_Getting_started.md" "2024-11-15"
"episodes/03_Julia_type_system.md" "b6171687acb673693aa4426ea7c0a457" "site/built/03_Julia_type_system.md" "2023-08-29"
"episodes/04_Using_the_package_manager.md" "d97ac6f24dcd9c5e251bf717458a3314" "site/built/04_Using_the_package_manager.md" "2024-11-14"
"episodes/04_Using_the_package_manager.md" "e963d948d3de1b85b0e511ade117b238" "site/built/04_Using_the_package_manager.md" "2024-11-15"
"episodes/05_Write_functions.md" "dcdde2a24c4c063dab0bcf1b479b90b0" "site/built/05_Write_functions.md" "2024-11-14"
"episodes/06_Interfacing_conditions.md" "863dd936d48211fce940b6acad106396" "site/built/06_Interfacing_conditions.md" "2023-09-15"
"episodes/07_Loops.md" "db757440bf2f672e7f6f67974cee4932" "site/built/07_Loops.md" "2024-11-14"
"episodes/07_Loops.md" "41dd4ecd4a93e93382b0590e61fa89bd" "site/built/07_Loops.md" "2024-11-15"
"episodes/08_Using_Modules.md" "da6022154b3eb62695cc439360f5f33d" "site/built/08_Using_Modules.md" "2023-09-15"
"episodes/09_Creating_Packages.md" "df0405efb3ed34a352703867ec70f55f" "site/built/09_Creating_Packages.md" "2023-09-15"
"episodes/10_Adding_tests.md" "f6d9ef6fe467ff3e21019c35c3a9f9b0" "site/built/10_Adding_tests.md" "2024-11-14"
"episodes/10_Adding_tests.md" "0d7236a5d7ff051b9b6102ff31ed6137" "site/built/10_Adding_tests.md" "2024-11-15"
"episodes/11_Wrapping_Up.md" "d8ff57c6e35d1501e5b9f366b725a2f4" "site/built/11_Wrapping_Up.md" "2023-09-15"
"instructors/instructor-notes.md" "8b08ba04400ac3c93f0d2481e4a307a2" "site/built/instructor-notes.md" "2024-11-14"
"learners/discuss.md" "2758e2e5abd231d82d25c6453d8abbc6" "site/built/discuss.md" "2023-08-09"
Expand Down

0 comments on commit 459bbd7

Please sign in to comment.