Skip to content

Commit

Permalink
FIX: code blocks weren't rendering correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
sqqueak committed Apr 27, 2023
1 parent 9a9f8eb commit 8509c48
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 64 deletions.
1 change: 1 addition & 0 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ enableGitInfo = true
ordered = true
startLevel = 1
[markup.highlight]
noClasses = false
anchorLineNos = false
codeFences = true
guessSyntax = true
Expand Down
8 changes: 2 additions & 6 deletions content/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ I like meeting interesting people! If you want to say hi or grab lunch with me,
- [Motion canvas](https://motioncanvas.io/) for math animations

# pages
[courses & academics](/academics) -- classes I've taken and academic projects I'm involved in
[network analysis](/ece537) -- reflecting on some reports I wrote
[courses & academics](/academics) -- classes and other things I've been involved in
[network analysis](/ece537) -- summary + reflection about a project on computer networks
[project archive](/projects) -- writing about stuff I'm working on
<!-- [coding shortcuts](/coding-shortcuts) -- basic stuff I keep looking up -->

<!-- # writing
[a tribute to "*squeak*"]() -->
57 changes: 0 additions & 57 deletions content/coding-shortcuts.md

This file was deleted.

2 changes: 1 addition & 1 deletion content/ece537.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "ECE 537"
enableToc: false
---
(please refresh the page if the pdf doesn't load!)
(please refresh the page if the pdf doesn't load!)
[Project 2](http://emilyyao.me/report2.pdf): Analyzing TCP and UDP traffic behavior over wireless networks
[Project 3](http://emilyyao.me/report3.pdf): Estimating VBR/CBR based on packet capture

Expand Down
65 changes: 65 additions & 0 deletions content/shortcuts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
title: "coding shortcuts"
enableToc: false
---

```python {title="list comprehensions are the bane of my existence", linenos=false}
nums = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

# operation on each item
[x+1 for x in nums]
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]

# using IF
[x for x in nums if x%2==0]
[0, 2, 4, 6, 8, 10]

# using IF + ELSE
[x if x%2==0 else ":(" for x in nums]
[0, ':(', 2, ':(', 4, ':(', 6, ':(', 8, ':(', 10]

# stacking IFs?
[x for x in nums if x if x%2==0 if x%3==0]
[6]
[x for x in nums if x if x%2==0 and x%3==0]
[6]

```
&nbsp;

```python {title="zipped lists", linenos=false}
for (a, b) in zip(list_a, list_b)
```
&nbsp;

```python {title="Series: max min", linenos=false}
s = Series

s.idxmin() # index of the min value
s.idxmax() # index of the max value
s.min() # min value
s.max() # max value
```
&nbsp;

```python {title="Series: iloc, index, name", linenos=false}
###
Argentina 690.784168
Name: Chile, dtype: object
###

df.iloc[0] # returns 690.784168 -- "integer location 0"
df.index[0] # returns Argentina -- index(key) at location 0
df.name # returns Chile
```
&nbsp;

```python {title="copy + modify every leaf in a tree", linenos=false}
if is_leaf(t):
# return new leaf
else:
new_branches = []
for branch in branches(t):
new_branches.append(<recursive call>)
return tree(label(t), new_branches)
```

0 comments on commit 8509c48

Please sign in to comment.