Live coding discussion

I was just catching up on the recordings. Seems like the resolution maxes out at 720p, perhaps something that can be bumped up at 1080p or so for the next ep. ? Hopefully possible with the Zoom → YT integration.

2 Likes

Hi @jeremy
Is there any special setup needed to run headless jupyter notebooks on Paperspace or does paperspace allow running notebooks /jupyter-lab directly

Its been a while I used paperspace :slight_smile: I am assuming my local 1080-Ti setup should still work fine but paperspace will be backup
Thanks

Do you see place for pipx for ML workflow. I used pipx for installing python packages as system wide tools. For example i can install black with pipx in similar way as i install with brew on mac. So then black is available also if I’m not in conda env.

HI Alok, you can get a free account on paperspace ,when I created my free account with $10 GPU credit, I was able to create a gradient notebook and it can be run as jupyter-lab (not paperspace own notbook) over the internet. I’m not sure if this is your question, but paperspace has a support team and a very extensive documentation/help section as well if you need to do something fancy with their platform.

How would this be different than installing “globally needed” packages in a base conda env?

The only reason I want to use conda/mamba is to separate all the conflicting package dependency issues because disk is cheap and life is short :smiley:

If you have multiple conda envs, then you have to install the same package in multiple envs. with pipx you only do it once and it’s available from all envs. but I agree that it can get messy to figure out later which package was installed where, conda env or pipx.

edit: just to clarify pipx is more for cli tools install I think, it’s similar to brew on mac, brew installs from it’s repository of packages, pipx installs from pypi.

1 Like

In my experience, these are some of the useful command-line (readline) keybindings. I usually remap CAPSLOCK key to CONTROL key as it’s easier to reach and I never used CAPSLOCK key i think.
This list includes things Jeremy mentioned in the video. These may be too much if you just starting, so pick the ones Jeremy said only.

Ctrl-a Move to the start of the current line.
Ctrl-e Move to the end of the line.
Ctrl-f Move forward a character.
Ctrl-b Move back a character.
Alt-f Move forward to the end of the next word. Words are alphanumeric.
Alt-b Move back to the start of the current or previous word. Words are alphanumeric.
Ctrl-l Clear the screen.

Ctrl-p Fetch the previous command from the history list (same as up but easier to reach).
Ctrl-n Fetch the next command from the history list (same as down).
Ctrl-r Search backward through history.

Ctrl-d Delete the character under the cursor.

Ctrl-k Kill (cut) forwards to the end of the line.
Ctrl-u Kill (cut) backwards to the start of the line.
Alt-d Kill (cut) forwards to the end of the current word.
Ctrl-w Kill (cut) backwards to the start of the current word.

Tab Autocomplete.

14 Likes

I really found it useful to remap my CAPSLOCK key to CTRL on macOS especially when using Emacs. Speaking of which, I’d also like to point out that these bindings above are “Emacs bindings” and if someone wanted to use vi/vim type commands to edit their bash command line (hjkl as arrow keys, x to delete, dd to remove the whole line etc,) you’d need to do ‘set -o vi’ or equivalent for your shell. But I wouldn’t do that as a beginner to shell commandline, stick with the stuff Jeremy is teaching for now and you can play with it after getting comfortable with the shell.

1 Like

I can’t recommend this enough, you will be amazed at how much time you can win by knowing your terminal shortcuts to move around your terminal commands. I do a good share of pair-programming on a weekly basis and most of people out there will just keep pressing arrow keys to move around, so I always suggest colleagues to look into this kind of shortcuts. Practice this deliberately, it is a good investment :).

6 Likes

Quick question for WSL/Ubuntu combination setup. How do you back up your code/documents then please? Are we going to back up everything to private repos in GitHub?

Just to confirm I understood the bash/terminal difference correctly, would they be considered bash key bonds or are they part of the terminal functionality please?

Great session. Waiting for the next one!

Those are bash bindings. They should be the same for zsh. They’re actually borrowed from an editor called emacs, and are used for most command-line programs on Linux and Mac nowadays. For instance, they should work fine in ipython too.

4 Likes

I’ve posted the walkthru-1 HD recording, link to session chat thread, and link to next session Zoom in the top post of this topic.

6 Likes

Thanks for sharing these shortcuts. Just thought of adding some useful WSL shortcuts too:

Ctrl+Shift+1 - Open shell set for default profile

Ctrl+Shift+3 - Open shell listed as number 3 in WSL

Alt+Enter - Enter terminal in full screen

Alt Shift + - Open a new vertical pane

Alt Shift - - Open a new horizontal pane

Ctrl Shift w - Closing a Pane

5 Likes

Two fun and useful things I have encountered today while working associated with what we covered in the walk-thru that we might want to consider covering in the next session are

  • how do you “reload” bash after making changes to .bashrc
  • how do you create an “alias” that can take a parameter? for instance, with docker one might want to be able to specify an image one wants to run which needs to precede the command one wants to be run in the container when it starts

EDIT: it also seems to be very useful to be able to pass default value for the parameter if it is not specified

4 Likes

The recording link is linked back to the post not the video.

The ‘this playlist’ link is working well, not the ‘Recording’ link.

Yeah, I suspect Jeremy might have accidentally placed the wrong link, but I edited and fixed it. :slight_smile:

3 Likes

What is your current Windows backup regime? Do you see the penguin in the bottom of Windows Explorer? Maybe you can take files from there into your current backup?