42. def transcribe_file(speech_file):
from google.cloud import speech
from google.cloud.speech import enums
from google.cloud.speech import types
client = speech.SpeechClient()
with io.open(speech_file, 'rb') as audio_file:
content = audio_file.read()
audio = types.RecognitionAudio(content=content)
config = types.RecognitionConfig(
encoding=enums.RecognitionConfig.AudioEncoding.LINEAR16,
sample_rate_hertz=44100,
language_code='ko-KR')
response = client.recognize(config, audio)
for result in response.results:
for alternative in result.alternatives:
print(u'Transcript: {}'.format(alternative.transcript))
123. Programming isn’t a
“passion” or a “talent” but
a collection of acquired skills.
Jacob Kaplan-Moss, PyCon 2015
https://www.youtube.com/watch?v=hIJdFxYlEKE
126. “
What happens when you type google.com
into your browser and press enter?
”
127. • The "g" key is pressed
• The "enter" key bottoms out
• Interrupt fires [NOT for USB keyboards]
• (On Windows) A WM_KEYDOWN message is sent to the app
• (On OS X) A KeyDown NSEvent is sent to the app
• (On GNU/Linux) the Xorg server listens for keycodes
• Parse URL
• Is it a URL or a search term?
• Convert non-ASCII Unicode characters in hostname
• Check HSTS list
• DNS lookup
• ARP process
• Opening of a socket
• …
https://github.com/alex/what-happens-when
129. Image courtesy of MOTORTREND
http://www.motortrend.com/cars/bmw/m5/2013/2013-bmw-m5-test/
130. Image courtesy of Reuters
http://www.cbsnews.com/news/teslas-autopilot-lets-cars-drive-change-lanes-themselves/
143. Python 3.6.1 (v3.6.1:69c0db5050, Mar 21 2017, 01:21:04)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more
information.
>>>