Week_04_typing_searching
Week_04_typing_searching
Introduction to
Data Management
Manipulating text
COMP 1238
Introduction to Data
Management
Starting at 1:05
Monday, Sept 23
◎ AtKlass: ????
◎ AtKlass reg: S8A0
COMP 1238 – Intro to Data
Management
4
WORKIN
G WITH
TEXT
Agenda
◎ Keyboards, touch-typing and keyboard shortcuts
◎ Text editors - notepad, vi, VSCode
◎ Searching in text - wildcards and the basics of regexp
◎ Lab prep – GitHub Pages
Objective:
Lay the foundation for mastery of tools used by IT practitioners day-to-day but often taken
for granted, focusing on keyboard and text editors.
6
Mastering
the
Keyboard
7
Why Master the Keyboard?
◎ Keyboard and mouse are the main ways of controlling
the the computer
◎ Mouse and touchpad/screen seem intuitive enough
◎ With keyboard we see way too many people struggling
with slow, frustrating and unhealthy habits.
Repetitive strain injury can be debilitating
8
Keyboards come in
many shapes and
sizes
9
IBM Model M
10
Standard 104 key
layout
11
Physical, visual, and functional
layouts
12
Layouts for non-latin scripts
13
QWERTY & country specific layouts
14
Dvorak layout & other exotics
15
Modifier keys
A modifier key temporarily modifies the normal action of another key
⇧ Shift
⌃ Ctrl – Control
⎇ Alt – Alternate – also labelled ⌥ Option on Apple keyboards.
⌘ Cmd – Command key, Apple keyboards
⊞ Win – Windows logo on Windows keyboards
Fn (Function) – used on small-layout keyboards, or keyboard where the top row of function
keys have multimedia functions like controlling audio volume
17
Inside the
keyboard
“Rubber dome” and “mechanical” switches
are the most common
18
Will you take the blue or the red switch?
19
Keyboard safety
◎ No keyboard is “best”, choose one you like
◎ Avoid keyboards that frustrate you - oddly or
inconsistently behaving keys, annoying sounds …
◎ Be attentive to how you feel, this is the key to prevent
injury –see Repetitive_strain_injury
◎ If something feels odd:
○ Change your own posture, raise or lower the chair
○ Change the location and angle of the keyboard. Try
moving it away from yourself
○ Take a break
20
What happens when you press
a key?
21
What goes over the wire – key
events
Pressing Control-V
# evtest /dev/evt4
Event: time 1717863909.946255, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e0
Event: time 1717863909.946255, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 1
Event: time 1717863909.946255, -------------- SYN_REPORT ------------
Event: time 1717863910.059252, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70019
Event: time 1717863910.059252, type 1 (EV_KEY), code 47 (KEY_V), value 1
Event: time 1717863910.059252, -------------- SYN_REPORT ------------
Event: time 1717863910.156245, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70019
Event: time 1717863910.156245, type 1 (EV_KEY), code 47 (KEY_V), value 0
Event: time 1717863910.156245, -------------- SYN_REPORT ------------
Event: time 1717863910.201254, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e0
Event: time 1717863910.201254, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 0
22
Programmable keyboards and small
layouts
Example of a “60% keyboard”
It lacks the F1-F12, Arrow keys and many more
Fn + something is used instead. For example Fn+1 = F1
This translation is done on the keyboard, not by the OS like for other
modifiers
23
Touch
Typing Mülheim, Germany c. 1910
A touch-typing class in a commercial school
Touch-typing
◎ Typing without looking at the keyboard, using
all fingers
◎ In 1888, Frank McGurrin, won a decisive victory
in a typing contest held in Cincinnati. The
results were displayed on the front pages of
many newspapers. McGurrin won $500 (about
$16k today) and popularized the new typing
method.
25
Touch-typing, why learn it?
◎ I feel like I can "drive" a computer now.
26
Touch-typing, how to learn
◎ Use ratatype.com or keybr.com to start
○ Optionally continue with entertrained.app
○ They free and work in the browser
◎ Practicing 'little and often' (15 -30 minutes a day)
works much better than an hour or more once a week.
If you practice regularly and don't give up, you should
be able to learn to touch type fluently in 2-3 months
◎ Typing subreddit - reddit.com/r/typing
27
Touch-typing
◎ Typing subreddit - reddit.com/r/typing
◎ Subreddit guide - Gary Internet's Typing Guide v12
28
ratatype.com
TEXT
EDITORS
>
What software do
you use to edit text?
Word Processors (MS Word) vs Text Editors
(Notepad)
32
33
IDEs vs Editors
◎ IDE = Integrated Development
Environment
◎ An IDE includes an editor + many
other tools integrated into it
WebStorm ⬆ ⬇ Turbo C++ (1990s)
◎ IDEs are often language specific
○ WebStorm for – HTML, CSS,
JavaScript
○ PyCharm for Python
○ Android Studio for Android apps
34
Text-mode editors
are still alive and
popular
◎ Vi vs. Emacs – a source of
flamewars since 1976
◎ Appeared long before the
mouse and had to rely on
keyboard only
◎ Vim is pre-installed on many
Linux and MacOS by default
35
Exiting Vim
If you do want to learn using
Vim:
◎ reddit.com/r/vim
◎ vim-adventures.com
37
◎ Microsoft VSCode ≠ Visual Studio
◎ By far the most popular editor/IDE lately
◎ First released in 2015 – one of the younger editors
◎ Lots of extensions created by other people
◎ Available online in multiplayer collaboration mode
◎ vscode.dev
38
39
Lab prep – GitHub pages
40
Searching
Ctrl-F, Ctrl-Shift-F, Ctrl-H
Let’s look the details of these dialogs. What do all the options
mean?
PowerPoint VS Code
How to look for approximate
pattern?
◎ Say we want to search for
◎ “Student ID” followed by some digits?
◎ Or “<h1>” to “<h6>” with any number
44
*.txt
◎ You might have seen search patterns like *.txt when
looking for files with a specific extension
◎ Demo
45
Wildcard characters
“Wild card” - a playing card that can
have any value in a game
COMPUTING
a character that will match any
character or sequence of characters
in a search
46
47
RegEx – regular expressions
48
What will the following regexps
match?
◎ <h1>
◎ <h.>
◎ <h[1-6]>
◎ p[io]ng
◎ CAD[0-9]+
◎ CAD\d+
◎ [a-z]+\.com
◎ 192\.168\.1\.\d{1,3}
49
Regex for an email address
50
Questions?
51
Links
• Subreddit about keyboard typing - reddit.com/r/typing
• Gary Internet's Typing Guide v12
• Fireship
• Fireship, 10 editors
• VS Code in 100 Seconds
• Regular Expressions (RegEx) in 100 Seconds
• Vim – article, video on how to start
• Frank_McGurrin – popularized touch-typing in 1880s
• Regular Expressions – Computerphile (alternative explanation)
52
DRAFTS
File organization – directory
tree