├── .env ├── .gitignore ├── README.md ├── assignments └── url_utils │ ├── Makefile │ ├── am.py │ ├── cw.py │ ├── eb.py │ ├── fixture.py │ ├── gw.py │ ├── ks.py │ └── tests.py ├── autocompile.py ├── build.sh ├── img ├── 01_prog.png ├── 02_ide.png ├── 03_flow.png ├── 04_import.png ├── 05_methodchain.png ├── 06_devcurve.png ├── 07_lists.png ├── 08_listalter.png ├── 09_listconcat.png ├── 10_listslice.png ├── 11_listalias.png ├── 12_listnest.png ├── 13_truthtable.png ├── 15_debugger.png ├── 16_callstack.png ├── 17_sets.png ├── 18_dicts.png ├── 19_exhandling.png ├── 20_exheirarchy.png ├── 21_oo.png ├── 23_python.png ├── 24_slicing.png ├── Thumbs.db ├── babyturtles.png └── magicturtle.jpg ├── index.rst ├── monitor.sh ├── pygments.css ├── requirements.txt ├── rst-directive.py └── ui ├── scala_gfx ├── audio_link.png ├── audio_on.png ├── audio_over.png ├── auto_link.png ├── auto_on.png ├── auto_over.png ├── delay_link.png ├── exit_link.png ├── exit_over.png ├── fade_link.png ├── fade_on.png ├── fade_over.png ├── framing.css ├── last_link.png ├── last_over.png ├── list_link.png ├── loop_link.png ├── loop_on.png ├── loop_over.png ├── next_link.png ├── next_over.png ├── notes_link.png ├── notes_over.png ├── opera.css ├── outline.css ├── pause_link.png ├── pause_on.png ├── pause_over.png ├── pretty.css ├── prev_link.png ├── prev_over.png ├── print.css ├── s5-core.css ├── slides.css ├── slides.js ├── toggle_link.png ├── toggle_over.png ├── volume_link.png ├── zero_link.png └── zero_over.png └── small-black ├── blank.gif ├── framing.css ├── iepngfix.htc ├── opera.css ├── outline.css ├── pretty.css ├── print.css ├── s5-core.css ├── slides.css └── slides.js /.env: -------------------------------------------------------------------------------- 1 | use_env python-adv-slides 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | index.html 2 | .*.swp 3 | .*.un~ 4 | *.pyc 5 | nohup.out 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # python-adv-slides 2 | 3 | This is a set of slides for a 3-day course on Python intended for existing programmers who want to learn the joy that is the Zen of Python. 4 | 5 | It does not waste time teaching the basics of programming -- instead, it dives right into what makes Python special. The first day is spent exploring common Python idioms and ways of doing things. 6 | 7 | The second day is spent on advanced Python features and techniques that make the language such a joy to use. 8 | 9 | The final day is spent on learning the Python standard library and all its wonders. 10 | 11 | I have given this presentation at places like BarCamp, HackNY, and other smaller conferences and gatherings. 12 | 13 | ## View the slides online 14 | 15 | Slides can be viewed in compiled form at: 16 | 17 | http://pixelmonkey.org/pub/python-training/ 18 | 19 | Note that the slides can be controlled as follows: 20 | 21 | * Advance forward / back with the forward and back keys, or left click / right click of the mouse 22 | * Press `c` to get the "controls", which also allows you to skip slides and switch to outline mode 23 | * Outline mode includes some notes not included in the slidedeck, and also allows you to easily copy/paste examples into your own interpreter 24 | 25 | I suggest you run through the slides in slide mode, and then review them in outline mode, doing examples from your own interpreter. That's how I tended to do things when I physically gave the presentation. Of course, you can also contact me on Twitter at [@amontalenti](http://twitter.com/amontalenti) if you want to see if I might be giving the talk nearby you sometime soon :-) 26 | 27 | ## How this was built 28 | 29 | Using Python, of course. It's turtles all the way down. 30 | 31 | I wrote the slides using [reST](http://docutils.sourceforge.net/rst.html), and specifically Docutils [support for S5 export](http://docutils.sourceforge.net/docs/user/slide-shows.html). Scripts are included to compile the presentation from the index.rst file and also to allow development of new slides with live recompilation using pyinotify (Linux systems only). See `build.sh` and `monitor.sh` for more information. 32 | -------------------------------------------------------------------------------- /assignments/url_utils/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @echo "[nosetests] running..." 3 | nosetests cw.py 4 | nosetests gw.py 5 | nosetests ks.py 6 | nosetests am.py 7 | nosetests eb.py 8 | @echo "[nosetests] done." 9 | @echo 10 | @echo "[doctest] running..." 11 | python -m doctest am.py 12 | @echo "[doctest] done." 13 | -------------------------------------------------------------------------------- /assignments/url_utils/am.py: -------------------------------------------------------------------------------- 1 | 2 | def _make_dict(scheme, host, port, path, query, fragment): 3 | """Return a dict like `{"scheme": scheme, "port": port, ...}`.""" 4 | return dict(**vars()) 5 | 6 | 7 | def _default_port_for_scheme(scheme): 8 | if scheme.startswith("http:"): 9 | port = 80 10 | elif scheme.startswith("https:"): 11 | port = 443 12 | else: 13 | port = None 14 | return port 15 | 16 | 17 | def url_parse(url): 18 | """Parses a URL (e.g. "http://lnkd.in/amonta") into parts as dict. 19 | 20 | Example usage: 21 | 22 | >>> parsed = url_parse("http://lnkd.in/amonta") 23 | >>> parsed["path"] 24 | '/amonta' 25 | >>> parsed["port"] 26 | 80 27 | 28 | >>> parsed = url_parse("https://g.co/?a=b#hash") 29 | >>> parsed["query"] 30 | '?a=b' 31 | >>> parsed["fragment"] 32 | '#hash' 33 | >>> parsed["scheme"] 34 | 'https://' 35 | """ 36 | # split off the scheme 37 | scheme, rest = url.split(":", 1) 38 | # add back scheme character 39 | scheme = scheme + "://" 40 | # skip over "//" characters 41 | rest = rest[2:] 42 | # split off the path 43 | path_char = rest.find("/") 44 | if path_char == -1: 45 | # no path found; defaults 46 | host = rest 47 | path = None 48 | else: 49 | host = rest[0:path_char] 50 | path = rest[path_char:] 51 | # set the port, or pick a default 52 | if ":" in host: 53 | host, port = host.split(":", 1) 54 | else: 55 | port = _default_port_for_scheme(scheme) 56 | # break query and fragment from path 57 | query_char = rest.find("?") 58 | frag_char = rest.find("#") 59 | if query_char == -1: 60 | query = None 61 | else: 62 | # special cast: query should only be up until 63 | # fragment if both are included 64 | if frag_char != -1: 65 | query = rest[query_char:frag_char] 66 | else: 67 | # otherwise, if no fragment found, query is rest 68 | query = rest[query_char:] 69 | if frag_char == -1: 70 | # no fragment found 71 | fragment = None 72 | else: 73 | # fragment always comes last, so it gobbles up rest 74 | fragment = rest[frag_char:] 75 | return _make_dict(scheme, host, port, path, query, fragment) 76 | 77 | 78 | def _set_blank_if_none(d, keys): 79 | """Sets a given key's value to empty string ('') if its value is `None`.""" 80 | for key in keys: 81 | if d.get(key, None) is None: 82 | d[key] = "" 83 | 84 | 85 | def url_join(parsed_url): 86 | """Converts dict representing a URL into a string URL. 87 | 88 | Example usage: 89 | 90 | >>> url = dict( 91 | ... scheme="http://", 92 | ... host="linkedin.com", 93 | ... port=80, 94 | ... path="/amontalenti", 95 | ... query=None, 96 | ... fragment=None) 97 | >>> url_join(url) 98 | 'http://linkedin.com/amontalenti' 99 | 100 | >>> url = dict( 101 | ... scheme="https://", 102 | ... host="g.co", 103 | ... port=443, 104 | ... path="/", 105 | ... query="?a=b", 106 | ... fragment="#hash") 107 | >>> url_join(url) 108 | 'https://g.co/?a=b#hash' 109 | """ 110 | # scheme includes "://" already 111 | base_url = "{scheme}{host}{port}" 112 | # path leads with "/", query leads with "?", and 113 | # fragment leads with "#", but they are part of values 114 | path_part = "{path}{query}{fragment}" 115 | scheme = parsed_url["scheme"] 116 | port = parsed_url["port"] 117 | # handle special default ports (80/443) 118 | if port == _default_port_for_scheme(scheme): 119 | # it's the default port, so don't include it 120 | parsed_url["port"] = "" 121 | else: 122 | # it's not the default, so we should include it 123 | parsed_url["port"] = ":{}".format(port) 124 | # path, query, and fragment should be blank strings 125 | # if they are None 126 | _set_blank_if_none(parsed_url, 127 | ["path", "query", "fragment"]) 128 | full_url = base_url + path_part 129 | url = full_url.format(**parsed_url) 130 | return url 131 | 132 | 133 | # test lines 134 | import fixture 135 | fixture.url_parse = url_parse 136 | fixture.url_join = url_join 137 | from tests import * 138 | -------------------------------------------------------------------------------- /assignments/url_utils/cw.py: -------------------------------------------------------------------------------- 1 | def url_parse(*args): 2 | """Takes a string URL and returns a dictionary of its various parts.""" 3 | url = args[0] 4 | url_parts = { 5 | "scheme": None, 6 | "port": None, 7 | "host": None, 8 | "path": None, 9 | "query": None, 10 | "fragment": None 11 | } 12 | 13 | scheme, url_sans_scheme = url.split("://") 14 | url_parts["scheme"] = scheme + "://" # We stripped it off with the split, add it back 15 | host, request = url_sans_scheme.split("/",1) 16 | 17 | # Find out what host and port is 18 | if ":" in host: 19 | # We have a port in the host string 20 | url_parts["host"],url_parts["port"] = host.split(":") 21 | else: 22 | url_parts["host"] = host 23 | if url_parts["scheme"] == "https://": 24 | url_parts["port"] = 443 25 | else: 26 | url_parts["port"] = 80 27 | 28 | # Determine if query is made 29 | query_fragment = '' 30 | if "?" in request: 31 | path, query_fragment = request.split("?") 32 | url_parts["path"] = "/" + path # Again, split removed the / 33 | else: 34 | url_parts["path"] = "/" + request # Again, split removed the / 35 | 36 | # Determine query fragments 37 | if "#" in query_fragment: 38 | query,fragment = query_fragment.split("#") 39 | url_parts["fragment"] = "#" + fragment 40 | # Handle case where we have a # but no ? 41 | if query: 42 | url_parts["query"] = "?" + query 43 | else: 44 | # Ensure not empty string, because we'll return None in that case 45 | if query_fragment: 46 | url_parts["query"] = "?" + query_fragment 47 | 48 | return url_parts 49 | 50 | 51 | def url_join(*args): 52 | """Takes a dictionary of URL parts and returns a valid URL.""" 53 | url_parts = args[0] 54 | port = '' 55 | if not (url_parts["port"] == 80 or url_parts["port"] == 443): 56 | port = ":%i" % (url_parts["port"]) 57 | 58 | return url_parts["scheme"] + url_parts["host"] + port + url_parts["path"] + url_parts["query"] + url_parts["fragment"] 59 | 60 | # test lines 61 | import fixture 62 | fixture.url_parse = url_parse 63 | fixture.url_join = url_join 64 | from tests import * 65 | -------------------------------------------------------------------------------- /assignments/url_utils/eb.py: -------------------------------------------------------------------------------- 1 | # eb's impl 2 | 3 | class URLParseError(Exception): 4 | def __init__(self, message): 5 | self.message = message 6 | 7 | def __str__(self): 8 | return "URL parse error: {}".format(self.message) 9 | 10 | 11 | def url_parse(*args): 12 | """Takes a string URL and returns a dictionary of its various parts.""" 13 | ret = {"scheme": None, "host": None, "path": None, "port": None, "fragment": None, "query": None, "userinfo": None} 14 | 15 | if len(args) == 0: 16 | return ret 17 | url = args[0] 18 | 19 | if "://" not in url: 20 | raise URLParseError("Missing scheme") 21 | 22 | scheme_rest = url.split("://") 23 | # scheme, *rest = url.split("://") # py3 only 24 | ret["scheme"], rest = scheme_rest[0].lower(), scheme_rest[1] 25 | ret["port"] = 80 if ret["scheme"] == "http" else 443 if ret["scheme"] == "https" else None 26 | 27 | if "/" not in rest: 28 | raise URLParseError("Missing authority") 29 | 30 | authority_rest = rest.split("/", 1) 31 | authority, path_query_fragment = authority_rest[0], "/" + authority_rest[1] 32 | 33 | userinfo = authority.split("@")[0] if "@" in authority else None 34 | 35 | # avoid "if @ in authority" by using replace 36 | host_port = authority.replace("{}@".format(userinfo), "") 37 | 38 | port = host_port.split(":")[1] if ":" in host_port else None 39 | if port is not None: 40 | if not port.isdigit(): 41 | raise URLParseError("Invalid port: {}".format(port)) 42 | ret["port"] = int(port) 43 | 44 | ret["query"] = path_query_fragment.split("?")[1].split("#")[0] if "?" in path_query_fragment else None 45 | ret["fragment"] = path_query_fragment.split("#")[1] if "#" in path_query_fragment else None 46 | ret["host"] = host_port.split(":")[0] 47 | ret["userinfo"] = userinfo 48 | ret["path"] = path_query_fragment.split("?")[0].split("#")[0] 49 | 50 | return ret 51 | 52 | 53 | def url_join(*args): 54 | """Takes a dictionary of URL parts and returns a valid URL.""" 55 | in_dict = args[0] if len(args) >= 1 else None 56 | if not in_dict: 57 | return "" 58 | 59 | scheme = in_dict["scheme"] 60 | userinfo = port = query = fragment = "" 61 | 62 | _userinfo = in_dict.get("userinfo", None) 63 | userinfo = "{}@".format(_userinfo) if _userinfo else "" 64 | 65 | _query = in_dict.get("query", None) 66 | query = "?{}".format(_query) if _query else "" 67 | 68 | _fragment = in_dict.get("fragment", "") 69 | fragment = "#{}".format(_fragment) if _fragment else "" 70 | 71 | _port = in_dict.get("port", "") 72 | if _port: 73 | if (scheme == "https" and _port != 443) or (scheme == "http" and _port != 80): 74 | port = ":{}".format(_port) 75 | 76 | return "{scheme}://{userinfo}{host}{port}{path}{query}{fragment}".format( 77 | scheme=scheme, userinfo=userinfo, 78 | host=in_dict["host"], port=port, path=in_dict["path"], 79 | query=query, fragment=fragment 80 | ) 81 | 82 | # test lines 83 | import fixture 84 | fixture.url_parse = url_parse 85 | fixture.url_join = url_join 86 | from tests import * 87 | -------------------------------------------------------------------------------- /assignments/url_utils/fixture.py: -------------------------------------------------------------------------------- 1 | # will insert functions into this namespace to put them under test 2 | -------------------------------------------------------------------------------- /assignments/url_utils/gw.py: -------------------------------------------------------------------------------- 1 | 2 | def url_parse(url): 3 | """Takes a string URL and returns a dictionary of its various parts.""" 4 | result = {} 5 | one = url.split("://") 6 | result["scheme"] = one[0]+"://" 7 | two = one[1].split("/",1) 8 | fragment_index = one[1].find("#") 9 | result["fragment"] = None 10 | if fragment_index > 0: 11 | result["fragment"] = one[1][fragment_index:] 12 | query_index = one[1].find("?") 13 | result["query"] = None 14 | if query_index > 0: 15 | if fragment_index > 0: 16 | result["query"] = one[1][query_index:fragment_index] 17 | else: 18 | result["query"] = one[1][query_index:] 19 | path_start = one[1].find("/") 20 | path_end = -1 21 | if query_index > path_end: 22 | path_end = query_index 23 | elif fragment_index > path_end: 24 | path_end = fragment_index 25 | else: 26 | path_end = len(one[1]) 27 | result["port"] = 80 28 | port_start = one[1].find(":") 29 | if port_start > -1: 30 | port_end = one[1].find("/") 31 | result["port"] = one[1][port_start:port_end] 32 | result["host"] = two[0] 33 | result["path"] = one[1][path_start:path_end] 34 | print result 35 | return result 36 | 37 | 38 | def url_join(parsed_url): 39 | """Takes a dictionary of URL parts and returns a valid URL.""" 40 | port = "" 41 | if parsed_url["port"] != 80 and parsed_url["port"] != 443: 42 | port = ":{}".format(parsed_url["port"]) 43 | result = "{}{}{}{}{}{}".format(parsed_url["scheme"],parsed_url["host"],port,parsed_url["path"],parsed_url["query"],parsed_url["fragment"]) 44 | print result 45 | return result 46 | 47 | # test lines 48 | import fixture 49 | fixture.url_parse = url_parse 50 | fixture.url_join = url_join 51 | from tests import * 52 | -------------------------------------------------------------------------------- /assignments/url_utils/ks.py: -------------------------------------------------------------------------------- 1 | def url_parse(url): 2 | """Takes a string URL and returns a dictionary of its various parts.""" 3 | 4 | print "URL IN: " + url 5 | 6 | scheme = url.split("://")[0] + "://" 7 | remains = url.split("://")[1] 8 | 9 | if ":" in remains: 10 | host = remains.split(":")[0] 11 | remains = remains.split(":")[1] 12 | port = remains.split("/", 1)[0] 13 | else: 14 | host = remains.split("/", 1)[0] 15 | if scheme == "http://": 16 | port = 80 17 | elif scheme == "https://": 18 | port = 443 19 | else: port = None 20 | 21 | remains = remains.split("/", 1)[1] 22 | 23 | fragment = None 24 | if "#" in remains: 25 | fragment = "#" + remains.split("#")[1] 26 | remains = remains.split("#")[0] 27 | 28 | query = None 29 | if "?" in remains: 30 | query = "?" + remains.split("?")[1] 31 | remains = remains.split("?")[0] 32 | 33 | path = "/" + remains 34 | url_dict = {'scheme': scheme, 'host': host, 'port': port, 'path': path, 'query': query, 'fragment': fragment} 35 | return url_dict 36 | 37 | 38 | def url_join(parts): 39 | """Takes a dictionary of URL parts and returns a valid URL.""" 40 | if parts['port'] == 80 or parts['port'] == 443: 41 | combined_url = "{scheme}{host}{path}".format(**parts) 42 | else: 43 | combined_url = "{scheme}{host}:{port}{path}".format(**parts) 44 | 45 | if parts['query']: combined_url += parts['query'] 46 | if parts['fragment']: combined_url += parts['fragment'] 47 | #would be this clean if I could figure out how to return an empty string when value is None 48 | #combined_url = "{scheme}{host}{path}{query}{fragment}".format(**parts) 49 | 50 | print "URLOUT: " + combined_url 51 | return combined_url 52 | 53 | # test lines 54 | import fixture 55 | fixture.url_parse = url_parse 56 | fixture.url_join = url_join 57 | from tests import * 58 | -------------------------------------------------------------------------------- /assignments/url_utils/tests.py: -------------------------------------------------------------------------------- 1 | from fixture import url_parse, url_join 2 | 3 | def test_basic_url(): 4 | url = "http://www.linkedin.com/in/andrewmontalenti" 5 | parsed_url = url_parse(url) 6 | assert parsed_url["scheme"] == "http://" 7 | assert parsed_url["host"] == "www.linkedin.com" 8 | assert parsed_url["path"] == "/in/andrewmontalenti" 9 | assert parsed_url["port"] == 80 10 | assert parsed_url["fragment"] is None 11 | assert parsed_url["query"] is None 12 | 13 | 14 | def test_advanced_url(): 15 | url = "http://www.linkedin.com/profile/view?id=13836198&trk=ppro_viewmore#more-123" 16 | parsed_url = url_parse(url) 17 | assert parsed_url["fragment"] == "#more-123" 18 | assert parsed_url["query"] == "?id=13836198&trk=ppro_viewmore" 19 | 20 | 21 | def test_joining_url(): 22 | url_parts = { 23 | "scheme": "http://", 24 | "host": "www.linkedin.com", 25 | "path": "/profile/view", 26 | "fragment": "#more-123", 27 | "query": "?id=13836198&trk=ppro_viewmore", 28 | "port": 80 29 | } 30 | url = "http://www.linkedin.com/profile/view?id=13836198&trk=ppro_viewmore#more-123" 31 | assert url_join(url_parts) == url, url_join(url_parts) 32 | url_parts["port"] = 8080 33 | url = "http://www.linkedin.com:8080/profile/view?id=13836198&trk=ppro_viewmore#more-123" 34 | assert url_join(url_parts) == url, url_join(url_parts) 35 | url_parts["scheme"] = "https://" 36 | url_parts["port"] = 443 37 | url = "https://www.linkedin.com/profile/view?id=13836198&trk=ppro_viewmore#more-123" 38 | assert url_join(url_parts) == url 39 | -------------------------------------------------------------------------------- /autocompile.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Usage: 4 | # ./autocompile.py path ext1,ext2,extn cmd 5 | # 6 | # Blocks monitoring |path| and its subdirectories for modifications on 7 | # files ending with suffix |extk|. Run |cmd| each time a modification 8 | # is detected. |cmd| is optional and defaults to 'make'. 9 | # 10 | # Example: 11 | # ./autocompile.py /my-latex-document-dir .tex,.bib "make pdf" 12 | # 13 | # Dependancies: 14 | # Linux, Python 2.6, Pyinotify 15 | # 16 | import subprocess 17 | import sys 18 | import pyinotify 19 | 20 | class OnWriteHandler(pyinotify.ProcessEvent): 21 | def __init__(self, cwd, extension, cmd): 22 | self.cwd = cwd 23 | self.extensions = extension.split(',') 24 | self.cmd = cmd 25 | 26 | def _run_cmd(self): 27 | print '==> Modification detected' 28 | subprocess.call(self.cmd.split(' '), cwd=self.cwd) 29 | 30 | def _do_notify(self): 31 | subprocess.call(["notify-send", "doc updated"], cwd=self.cwd) 32 | 33 | def process_default(self, event): pass 34 | 35 | def process_IN_MODIFY(self, event): 36 | if all(not event.name.endswith(ext) for ext in self.extensions): 37 | return 38 | self._run_cmd() 39 | fname = event.name 40 | cmd = self.cmd 41 | self._do_notify() 42 | print '==> detected change in "%s", ran "%s" -- done!' % (fname, cmd) 43 | 44 | def auto_compile(path, extension, cmd): 45 | wm = pyinotify.WatchManager() 46 | handler = OnWriteHandler(cwd=path, extension=extension, cmd=cmd) 47 | notifier = pyinotify.Notifier(wm, default_proc_fun=handler) 48 | wm.add_watch(path, 4095, rec=True, auto_add=True) 49 | 50 | print '==> Started monitoring "%s" for changes (type ^C to exit)' % path 51 | while True: 52 | try: 53 | if notifier.check_events(): 54 | notifier.read_events() 55 | notifier.process_events() 56 | except KeyboardInterrupt: 57 | notifier.stop() 58 | break 59 | print '==> Stopped monitoring' 60 | 61 | if __name__ == '__main__': 62 | if len(sys.argv) < 3: 63 | print >> sys.stderr, "Command line error: missing argument(s)." 64 | sys.exit(1) 65 | 66 | # Required arguments 67 | path = sys.argv[1] 68 | extension = sys.argv[2] 69 | 70 | # Optional argument 71 | cmd = 'make' 72 | if len(sys.argv) == 4: 73 | cmd = sys.argv[3] 74 | 75 | # Blocks monitoring 76 | auto_compile(path, extension, cmd) 77 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | NAME=index 2 | python rst-directive.py \ 3 | --stylesheet=pygments.css \ 4 | --theme-url=ui/small-black \ 5 | ${NAME}.rst > ${NAME}.html 6 | -------------------------------------------------------------------------------- /img/01_prog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/img/01_prog.png -------------------------------------------------------------------------------- /img/02_ide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/img/02_ide.png -------------------------------------------------------------------------------- /img/03_flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/img/03_flow.png -------------------------------------------------------------------------------- /img/04_import.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/img/04_import.png -------------------------------------------------------------------------------- /img/05_methodchain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/img/05_methodchain.png -------------------------------------------------------------------------------- /img/06_devcurve.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/img/06_devcurve.png -------------------------------------------------------------------------------- /img/07_lists.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/img/07_lists.png -------------------------------------------------------------------------------- /img/08_listalter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/img/08_listalter.png -------------------------------------------------------------------------------- /img/09_listconcat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/img/09_listconcat.png -------------------------------------------------------------------------------- /img/10_listslice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/img/10_listslice.png -------------------------------------------------------------------------------- /img/11_listalias.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/img/11_listalias.png -------------------------------------------------------------------------------- /img/12_listnest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/img/12_listnest.png -------------------------------------------------------------------------------- /img/13_truthtable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/img/13_truthtable.png -------------------------------------------------------------------------------- /img/15_debugger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/img/15_debugger.png -------------------------------------------------------------------------------- /img/16_callstack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/img/16_callstack.png -------------------------------------------------------------------------------- /img/17_sets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/img/17_sets.png -------------------------------------------------------------------------------- /img/18_dicts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/img/18_dicts.png -------------------------------------------------------------------------------- /img/19_exhandling.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/img/19_exhandling.png -------------------------------------------------------------------------------- /img/20_exheirarchy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/img/20_exheirarchy.png -------------------------------------------------------------------------------- /img/21_oo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/img/21_oo.png -------------------------------------------------------------------------------- /img/23_python.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/img/23_python.png -------------------------------------------------------------------------------- /img/24_slicing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/img/24_slicing.png -------------------------------------------------------------------------------- /img/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/img/Thumbs.db -------------------------------------------------------------------------------- /img/babyturtles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/img/babyturtles.png -------------------------------------------------------------------------------- /img/magicturtle.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/img/magicturtle.jpg -------------------------------------------------------------------------------- /monitor.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | python -mSimpleHTTPServer & 3 | proc_pid="$!" 4 | trap "echo 'killing server' && kill $proc_pid" SIGINT 5 | ./autocompile.py . .rst "bash build.sh" 6 | -------------------------------------------------------------------------------- /pygments.css: -------------------------------------------------------------------------------- 1 | .highlight .hll { background-color: #333333 } 2 | .highlight { background: #111111; color: #ffffff } 3 | .highlight .c { color: #008800; font-style: italic; background-color: #0f140f } /* Comment */ 4 | .highlight .err { color: #ffffff } /* Error */ 5 | .highlight .g { color: #ffffff } /* Generic */ 6 | .highlight .k { color: #fb660a; font-weight: bold } /* Keyword */ 7 | .highlight .l { color: #ffffff } /* Literal */ 8 | .highlight .n { color: #ffffff } /* Name */ 9 | .highlight .o { color: #ffffff } /* Operator */ 10 | .highlight .x { color: #ffffff } /* Other */ 11 | .highlight .p { color: #ffffff } /* Punctuation */ 12 | .highlight .cm { color: #008800; font-style: italic; background-color: #0f140f } /* Comment.Multiline */ 13 | .highlight .cp { color: #ff0007; font-weight: bold; font-style: italic; background-color: #0f140f } /* Comment.Preproc */ 14 | .highlight .c1 { color: #008800; font-style: italic; background-color: #0f140f } /* Comment.Single */ 15 | .highlight .cs { color: #008800; font-style: italic; background-color: #0f140f } /* Comment.Special */ 16 | .highlight .gd { color: #ffffff } /* Generic.Deleted */ 17 | .highlight .ge { color: #ffffff } /* Generic.Emph */ 18 | .highlight .gr { color: #ffffff } /* Generic.Error */ 19 | .highlight .gh { color: #ffffff; font-weight: bold } /* Generic.Heading */ 20 | .highlight .gi { color: #ffffff } /* Generic.Inserted */ 21 | .highlight .go { color: #444444; background-color: #222222 } /* Generic.Output */ 22 | .highlight .gp { color: #ffffff } /* Generic.Prompt */ 23 | .highlight .gs { color: #ffffff } /* Generic.Strong */ 24 | .highlight .gu { color: #ffffff; font-weight: bold } /* Generic.Subheading */ 25 | .highlight .gt { color: #ffffff } /* Generic.Traceback */ 26 | .highlight .kc { color: #fb660a; font-weight: bold } /* Keyword.Constant */ 27 | .highlight .kd { color: #fb660a; font-weight: bold } /* Keyword.Declaration */ 28 | .highlight .kn { color: #fb660a; font-weight: bold } /* Keyword.Namespace */ 29 | .highlight .kp { color: #fb660a } /* Keyword.Pseudo */ 30 | .highlight .kr { color: #fb660a; font-weight: bold } /* Keyword.Reserved */ 31 | .highlight .kt { color: #cdcaa9; font-weight: bold } /* Keyword.Type */ 32 | .highlight .ld { color: #ffffff } /* Literal.Date */ 33 | .highlight .m { color: #0086f7; font-weight: bold } /* Literal.Number */ 34 | .highlight .s { color: #0086d2 } /* Literal.String */ 35 | .highlight .na { color: #ff0086; font-weight: bold } /* Name.Attribute */ 36 | .highlight .nb { color: #ffffff } /* Name.Builtin */ 37 | .highlight .nc { color: #ffffff } /* Name.Class */ 38 | .highlight .no { color: #0086d2 } /* Name.Constant */ 39 | .highlight .nd { color: #ffffff } /* Name.Decorator */ 40 | .highlight .ni { color: #ffffff } /* Name.Entity */ 41 | .highlight .ne { color: #ffffff } /* Name.Exception */ 42 | .highlight .nf { color: #ff0086; font-weight: bold } /* Name.Function */ 43 | .highlight .nl { color: #ffffff } /* Name.Label */ 44 | .highlight .nn { color: #ffffff } /* Name.Namespace */ 45 | .highlight .nx { color: #ffffff } /* Name.Other */ 46 | .highlight .py { color: #ffffff } /* Name.Property */ 47 | .highlight .nt { color: #fb660a; font-weight: bold } /* Name.Tag */ 48 | .highlight .nv { color: #fb660a } /* Name.Variable */ 49 | .highlight .ow { color: #ffffff } /* Operator.Word */ 50 | .highlight .w { color: #888888 } /* Text.Whitespace */ 51 | .highlight .mf { color: #0086f7; font-weight: bold } /* Literal.Number.Float */ 52 | .highlight .mh { color: #0086f7; font-weight: bold } /* Literal.Number.Hex */ 53 | .highlight .mi { color: #0086f7; font-weight: bold } /* Literal.Number.Integer */ 54 | .highlight .mo { color: #0086f7; font-weight: bold } /* Literal.Number.Oct */ 55 | .highlight .sb { color: #0086d2 } /* Literal.String.Backtick */ 56 | .highlight .sc { color: #0086d2 } /* Literal.String.Char */ 57 | .highlight .sd { color: #0086d2 } /* Literal.String.Doc */ 58 | .highlight .s2 { color: #0086d2 } /* Literal.String.Double */ 59 | .highlight .se { color: #0086d2 } /* Literal.String.Escape */ 60 | .highlight .sh { color: #0086d2 } /* Literal.String.Heredoc */ 61 | .highlight .si { color: #0086d2 } /* Literal.String.Interpol */ 62 | .highlight .sx { color: #0086d2 } /* Literal.String.Other */ 63 | .highlight .sr { color: #0086d2 } /* Literal.String.Regex */ 64 | .highlight .s1 { color: #0086d2 } /* Literal.String.Single */ 65 | .highlight .ss { color: #0086d2 } /* Literal.String.Symbol */ 66 | .highlight .bp { color: #ffffff } /* Name.Builtin.Pseudo */ 67 | .highlight .vc { color: #fb660a } /* Name.Variable.Class */ 68 | .highlight .vg { color: #fb660a } /* Name.Variable.Global */ 69 | .highlight .vi { color: #fb660a } /* Name.Variable.Instance */ 70 | .highlight .il { color: #0086f7; font-weight: bold } /* Literal.Number.Integer.Long */ 71 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | pygments 2 | docutils 3 | -------------------------------------------------------------------------------- /rst-directive.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | The Pygments reStructuredText directive 4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 | 6 | This fragment is a Docutils_ 0.5 directive that renders source code 7 | (to HTML only, currently) via Pygments. 8 | 9 | To use it, adjust the options below and copy the code into a module 10 | that you import on initialization. The code then automatically 11 | registers a ``sourcecode`` directive that you can use instead of 12 | normal code blocks like this:: 13 | 14 | .. sourcecode:: python 15 | 16 | My code goes here. 17 | 18 | If you want to have different code styles, e.g. one with line numbers 19 | and one without, add formatters with their names in the VARIANTS dict 20 | below. You can invoke them instead of the DEFAULT one by using a 21 | directive option:: 22 | 23 | .. sourcecode:: python 24 | :linenos: 25 | 26 | My code goes here. 27 | 28 | Look at the `directive documentation`_ to get all the gory details. 29 | 30 | .. _Docutils: http://docutils.sf.net/ 31 | .. _directive documentation: 32 | http://docutils.sourceforge.net/docs/howto/rst-directives.html 33 | 34 | :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS. 35 | :license: BSD, see LICENSE for details. 36 | """ 37 | 38 | # Options 39 | # ~~~~~~~ 40 | 41 | # Set to True if you want inline CSS styles instead of classes 42 | INLINESTYLES = False 43 | STYLE = "fruity" 44 | 45 | from pygments.formatters import HtmlFormatter 46 | 47 | # The default formatter 48 | DEFAULT = HtmlFormatter(noclasses=INLINESTYLES, style=STYLE) 49 | 50 | # Add name -> formatter pairs for every variant you want to use 51 | VARIANTS = { 52 | # 'linenos': HtmlFormatter(noclasses=INLINESTYLES, linenos=True), 53 | } 54 | 55 | 56 | from docutils import nodes 57 | from docutils.parsers.rst import directives, Directive 58 | 59 | from pygments import highlight 60 | from pygments.lexers import get_lexer_by_name, TextLexer 61 | 62 | class Pygments(Directive): 63 | """ Source code syntax hightlighting. 64 | """ 65 | required_arguments = 1 66 | optional_arguments = 0 67 | final_argument_whitespace = True 68 | option_spec = dict([(key, directives.flag) for key in VARIANTS]) 69 | has_content = True 70 | 71 | def run(self): 72 | self.assert_has_content() 73 | try: 74 | lexer = get_lexer_by_name(self.arguments[0]) 75 | except ValueError: 76 | # no lexer found - use the text one instead of an exception 77 | lexer = TextLexer() 78 | # take an arbitrary option if more than one is given 79 | formatter = self.options and VARIANTS[self.options.keys()[0]] or DEFAULT 80 | 81 | print >>open('pygments.css', 'w'), formatter.get_style_defs('.highlight') 82 | parsed = highlight(u'\n'.join(self.content), lexer, formatter) 83 | return [nodes.raw('', parsed, format='html')] 84 | 85 | directives.register_directive('sourcecode', Pygments) 86 | 87 | from docutils.core import publish_cmdline, default_description 88 | 89 | description = ('Generates S5 (X)HTML slideshow documents from standalone ' 90 | 'reStructuredText sources. ' + default_description) 91 | 92 | publish_cmdline(writer_name='s5', description=description) 93 | -------------------------------------------------------------------------------- /ui/scala_gfx/audio_link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/ui/scala_gfx/audio_link.png -------------------------------------------------------------------------------- /ui/scala_gfx/audio_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/ui/scala_gfx/audio_on.png -------------------------------------------------------------------------------- /ui/scala_gfx/audio_over.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/ui/scala_gfx/audio_over.png -------------------------------------------------------------------------------- /ui/scala_gfx/auto_link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/ui/scala_gfx/auto_link.png -------------------------------------------------------------------------------- /ui/scala_gfx/auto_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/ui/scala_gfx/auto_on.png -------------------------------------------------------------------------------- /ui/scala_gfx/auto_over.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/ui/scala_gfx/auto_over.png -------------------------------------------------------------------------------- /ui/scala_gfx/delay_link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/ui/scala_gfx/delay_link.png -------------------------------------------------------------------------------- /ui/scala_gfx/exit_link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/ui/scala_gfx/exit_link.png -------------------------------------------------------------------------------- /ui/scala_gfx/exit_over.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/ui/scala_gfx/exit_over.png -------------------------------------------------------------------------------- /ui/scala_gfx/fade_link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/ui/scala_gfx/fade_link.png -------------------------------------------------------------------------------- /ui/scala_gfx/fade_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/ui/scala_gfx/fade_on.png -------------------------------------------------------------------------------- /ui/scala_gfx/fade_over.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/ui/scala_gfx/fade_over.png -------------------------------------------------------------------------------- /ui/scala_gfx/framing.css: -------------------------------------------------------------------------------- 1 | /* The following styles size, place, and layer the slide components. 2 | Edit these if you want to change the overall slide layout. 3 | The commented lines can be uncommented (and modified, if necessary) 4 | to help you with the rearrangement process. */ 5 | 6 | /* target = 1024x768 */ 7 | 8 | div#header, div#footer, .slide {width: 100%; top: 0; left: 0;} 9 | div#header {top: 0; height: 3em; z-index: 1;} 10 | div#footer {top: auto; bottom: 0; height: 0.5em; z-index: 5;} 11 | .slide {top: 0; width: 92%; padding: 3.5em 4% 4%; z-index: 2; list-style: none;} 12 | div#controls {left: 50%; bottom: 0; width: 50%; z-index: 100;} 13 | div#controls form {text-align: right; width: 100%; margin: 0;} 14 | #currentSlide {position: absolute; width: 12%; left: 44%; bottom: 1em; z-index: 10;} 15 | html>body #currentSlide {position: fixed;} 16 | 17 | /* 18 | div#header {background: #FCC;} 19 | div#footer {background: #CCF;} 20 | div#controls {background: #BBD;} 21 | div#currentSlide {background: #FFC;} 22 | */ 23 | -------------------------------------------------------------------------------- /ui/scala_gfx/last_link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/ui/scala_gfx/last_link.png -------------------------------------------------------------------------------- /ui/scala_gfx/last_over.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/ui/scala_gfx/last_over.png -------------------------------------------------------------------------------- /ui/scala_gfx/list_link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/ui/scala_gfx/list_link.png -------------------------------------------------------------------------------- /ui/scala_gfx/loop_link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/ui/scala_gfx/loop_link.png -------------------------------------------------------------------------------- /ui/scala_gfx/loop_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/ui/scala_gfx/loop_on.png -------------------------------------------------------------------------------- /ui/scala_gfx/loop_over.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/ui/scala_gfx/loop_over.png -------------------------------------------------------------------------------- /ui/scala_gfx/next_link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/ui/scala_gfx/next_link.png -------------------------------------------------------------------------------- /ui/scala_gfx/next_over.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/ui/scala_gfx/next_over.png -------------------------------------------------------------------------------- /ui/scala_gfx/notes_link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/ui/scala_gfx/notes_link.png -------------------------------------------------------------------------------- /ui/scala_gfx/notes_over.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/ui/scala_gfx/notes_over.png -------------------------------------------------------------------------------- /ui/scala_gfx/opera.css: -------------------------------------------------------------------------------- 1 | /* DO NOT CHANGE THESE unless you really want to break Opera Show */ 2 | .slide { 3 | visibility: visible !important; 4 | position: static !important; 5 | page-break-before: always; 6 | } 7 | #slide0 {page-break-before: avoid;} 8 | -------------------------------------------------------------------------------- /ui/scala_gfx/outline.css: -------------------------------------------------------------------------------- 1 | /* don't change this unless you want the layout stuff to show up in the outline view! */ 2 | 3 | .hide, .layout div, #footer *, #controlForm * {display: none;} 4 | #footer, #controls, #controlForm, #navLinks, #sheet {display: block; visibility: visible; margin: 0; padding: 0;} 5 | #sheet {float: right; padding: 0.5em;} 6 | html>body #sheet {position: fixed; top: 0; right: 0;} 7 | 8 | 9 | /* making the outline look pretty-ish */ 10 | 11 | #slide0 h1, #slide0 h2, #slide0 h3, #slide0 h4 {border: none; margin: 0;} 12 | #slide0 h1 {padding-top: 1.5em;} 13 | .slide h1 {margin: 1.5em 0 0; padding-top: 0.25em; border-top: 1px solid #888; border-bottom: 1px solid #AAA;} 14 | #sheet {border: 1px solid; border-width: 0 0 1px 1px; background: #FFF;} 15 | -------------------------------------------------------------------------------- /ui/scala_gfx/pause_link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/ui/scala_gfx/pause_link.png -------------------------------------------------------------------------------- /ui/scala_gfx/pause_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/ui/scala_gfx/pause_on.png -------------------------------------------------------------------------------- /ui/scala_gfx/pause_over.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/ui/scala_gfx/pause_over.png -------------------------------------------------------------------------------- /ui/scala_gfx/pretty.css: -------------------------------------------------------------------------------- 1 | /* Following are the presentation styles -- edit away! */ 2 | 3 | body {background: #000; color: #fff; font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; font-size: 2.25em;} 4 | a:link, a:visited {text-decoration: none; color: #F93;} 5 | /* a:focus, a:hover {color: #f33 !important;} */ 6 | 7 | h1, h2, h3, h4 {font-size: 100%; margin: 0; padding: 0; font-weight: inherit;} 8 | h1 {background-color: transparent;} 9 | 10 | ul, pre {margin: 0; line-height: 1em;} 11 | html, body {margin: 0; padding: 0;} 12 | 13 | blockquote, q {font-style: italic;} 14 | blockquote {padding: 0 2em 0.5em; margin: 0 1.5em 0.5em; text-align: center; font-size: 1em;} 15 | blockquote p {margin: 0;} 16 | blockquote i {font-style: normal;} 17 | blockquote b {display: block; margin-top: 0.5em; font-weight: normal; font-size: smaller; font-style: normal;} 18 | blockquote b i {font-style: italic;} 19 | 20 | img {border: 0; } 21 | kbd {font-weight: bold; font-size: 1em;} 22 | sup {font-size: smaller; line-height: 1px;} 23 | 24 | .slide code {padding: 2px 0.25em; font-weight: bold; color: #f30;} 25 | .slide code.bad, code del {color: red;} 26 | .slide code.old {color: silver;} 27 | .slide pre {padding: 0; margin: 0.25em 0 0.5em 0.5em; color: #f30; font-size: 90%;} 28 | .slide pre code {display: block;} 29 | .slide ul {margin-left: 5%; margin-right: 7%; list-style: disc;} 30 | .slide li {margin-top: 0.75em; margin-right: 0;} 31 | .slide ul ul {line-height: 1;} 32 | .slide ul ul li {margin: .2em; font-size: 85%; list-style: square;} 33 | .slide img.leader {display: block; margin: 0 auto;} 34 | 35 | div#header, div#footer {color: #666; font-family: Verdana, Arial, Helvetica, sans-serif;} 36 | div#header {background-color: transparent; line-height: 1px;} 37 | div#footer {background-color: transparent; font-size: 0.5em; font-weight: bold; padding: 1em 0;} 38 | #footer h1, #footer h2 {border: none; display: block; padding: 0; position:absolute; bottom:0.5em;} 39 | #footer h1 {left:1em; color: #666;} 40 | #footer h2 {right:1em; color: #666; font-style: italic;} 41 | 42 | div.long {font-size: 0.75em;} 43 | .slide h1 {position: absolute; top: 0.9em; left: 1.25em; z-index: 1; margin: 0.35em 0 0 50px; padding: 0; white-space: nowrap; font: bold 150%/1em Tahoma, Verdana, Arial, Helvetica, sans-serif; text-transform: capitalize; color: #fff; border-bottom: solid 0.1em red; background-color: transparent;} 44 | .slide h3 {font-size: 130%;} 45 | h1 abbr {font-variant: small-caps;} 46 | 47 | div#controls {position: absolute; left: 0; bottom: 0; width: 100%; text-align: center; font: bold 1em Verdana, Arial, Helvetica, sans-serif;} 48 | html>body div#controls {background: transparent; position: fixed; padding: 0; top: auto; text-align: center;} 49 | #controls #sheet {display: none;} 50 | #controls #controlForm {height: 32px; width: 100%; text-align: center; vertical-align: middle;} 51 | #controls #navLinks {border-top: 1px solid #999; overflow: hidden; padding: 0; margin: 0; height: 32px; width: 100%; background-color: #808080; text-align: center; vertical-align: middle; white-space: nowrap;} 52 | #controls #navLinks ul {margin: 0 auto; padding: 0; height: 32px; width: 500px; white-space: nowrap; text-align: center;} 53 | #controls #navLinks ul li {list-style: none; display: inline; margin: 0; padding: 0; float: left; height: 32px; width: 32px; text-align: center; background-color: transparent;} 54 | #controls #navLinks ul li.vr {list-style: none; display: inline; margin: 0px 2px; padding: 0; float: left; height: 32px; width: 1px; text-align: center; background-color: #606060;} 55 | #controls #navLinks ul li a {margin: 0; padding: 0; float: left; height: 32px; width: 32px; background-color: transparent;} 56 | 57 | #controls #navLinks ul li#exit {background: url(exit_link.png) no-repeat top left;} 58 | #controls #navLinks ul li#exit a:hover {background: url(exit_over.png) no-repeat bottom left;} 59 | 60 | #controls #navLinks ul li#toggle {background: url(toggle_link.png) no-repeat top left;} 61 | #controls #navLinks ul li#toggle a:hover {background: url(toggle_over.png) no-repeat bottom left;} 62 | 63 | #controls #navLinks ul li#show-notes {background: url(notes_link.png) no-repeat top left;} 64 | #controls #navLinks ul li#show-notes a:hover {background: url(notes_over.png) no-repeat bottom left;} 65 | 66 | #controls #navLinks ul li#zero {background: url(zero_link.png) no-repeat top left;} 67 | #controls #navLinks ul li#zero a:hover {background: url(zero_over.png) no-repeat bottom left;} 68 | 69 | #controls #navLinks ul li#prev {background: url(prev_link.png) no-repeat top left;} 70 | #controls #navLinks ul li#prev a:hover {background: url(prev_over.png) no-repeat bottom left;} 71 | 72 | #controls #navLinks ul li#next {background: url(next_link.png) no-repeat top left;} 73 | #controls #navLinks ul li#next a:hover {background: url(next_over.png) no-repeat bottom left;} 74 | 75 | #controls #navLinks ul li#last {background: url(last_link.png) no-repeat top left;} 76 | #controls #navLinks ul li#last a:hover {background: url(last_over.png) no-repeat bottom left;} 77 | 78 | #controls #navLinks ul li#lst {background: url(list_link.png) no-repeat top left;} 79 | 80 | #controls #navLinks ul li#fade a.isoff {background: url(fade_link.png) no-repeat top left;} 81 | #controls #navLinks ul li#fade a.ison {background: url(fade_on.png) no-repeat top right;} 82 | #controls #navLinks ul li#fade a:hover {background: url(fade_over.png) no-repeat bottom left;} 83 | 84 | #controls #navLinks ul li#audio {background: url(audio_link.png) no-repeat top left;} 85 | #controls #navLinks ul li#audio a.isoff {background: url(audio_link.png) no-repeat top left;} 86 | #controls #navLinks ul li#audio a.ison {background: url(audio_on.png) no-repeat top right;} 87 | #controls #navLinks ul li#audio a:hover {background: url(audio_over.png) no-repeat bottom left;} 88 | 89 | #controls #navLinks ul li#vol {background: url(volume_link.png) no-repeat top left;} 90 | 91 | #controls #navLinks ul li#auto a.isoff {background: url(auto_link.png) no-repeat top left;} 92 | #controls #navLinks ul li#auto a.ison {background: url(auto_on.png) no-repeat top right;} 93 | #controls #navLinks ul li#auto a:hover {background: url(auto_over.png) no-repeat bottom left;} 94 | 95 | #controls #navLinks ul li#pause a.isoff {background: url(pause_link.png) no-repeat top left;} 96 | #controls #navLinks ul li#pause a.ison {background: url(pause_on.png) no-repeat top right;} 97 | #controls #navLinks ul li#pause a:hover {background: url(pause_over.png) no-repeat bottom left;} 98 | 99 | #controls #navLinks ul li#loop a.isoff {background: url(loop_link.png) no-repeat top left;} 100 | #controls #navLinks ul li#loop a.ison {background: url(loop_on.png) no-repeat top right;} 101 | #controls #navLinks ul li#loop a:hover {background: url(loop_over.png) no-repeat bottom left;} 102 | 103 | #controls #navLinks ul li#del {background: url(delay_link.png) no-repeat top left;} 104 | 105 | #jumplist, #volumelist, #delaylist {padding: 0; margin: 0; width: 32px; height: 32px; cursor: n-resize;} 106 | 107 | #currentSlide {white-space: nowrap; text-align: center; margin-bottom: -0.5em; font-size: 0.5em; background-color: transparent; color: #999;} 108 | 109 | #guru {position: absolute; visibility: visible; left: 0px; top: 0px; padding: 4px; width: 99%; height: auto; text-align: center; background-color: black; z-index: 10;} 110 | #guru div {border: solid 3px red; padding: 4px; font-family: monospace; font-size: 60%; width: auto; height: auto; color: red; text-align: center;} 111 | 112 | #slide0 {padding-top: 3.5em; font-size: 90%;} 113 | #slide0 h1 {position: static; margin: 1em 0 0; padding: 0; border: none; font: bold 3em Verdana, Arial, Helvetica, sans-serif; font-variant: small-caps; white-space: normal; color: #fff; background-color: transparent;} 114 | #slide0 h2 {font: bold italic 1em Arial, Helvetica, sans-serif; margin: 0.25em;} 115 | #slide0 h3 {margin-top: 1.5em; font-size: 1.5em;} 116 | #slide0 h4 {margin-top: 0; font-size: 1em;} 117 | 118 | ul.urls {list-style: none; display: inline; margin: 0;} 119 | .urls li {display: inline; margin: 0;} 120 | .note {display: none;} 121 | .external {border-bottom: 1px dotted gray;} 122 | html>body .external {border-bottom: none;} 123 | .external:after {content: " \274F"; font-size: smaller; color: #F93;} 124 | 125 | .incremental, .incremental *, .incremental *:after {color: #999; visibility: visible;} 126 | img.incremental, canvas.incremental {visibility: hidden;} 127 | .slide .current {color: #ff0;} 128 | 129 | /* diagnostics 130 | li:after {content: " [" attr(class) "]"; color: #F88;} 131 | */ 132 | 133 | table.piechart, table.barchart, table.linechart { border-spacing: 0.3em 0.15em; } 134 | table.piechart tr th, table.barchart tr th, table.linechart tr th { white-space: nowrap; } 135 | table.piechart tr td, table.barchart tr td, table.linechart tr td { vertical-align: top; white-space: nowrap; } 136 | table.piechart tr td.col, table.barchart tr td.col, table.linechart tr td.col { border-bottom: 1px solid #555; border-right: 1px solid #555; } 137 | table.fs90 tr td, table.fs90 tr th, div.fs90, pre.fs90, p.fs90 ,ul.fs90 {font-size: 0.9em; } 138 | table.fs75 tr td, table.fs75 tr th, div.fs75, pre.fs75, p.fs75 ,ul.fs75 {font-size: 0.75em; } 139 | table.fs66 tr td, table.fs66 tr th, div.fs66, pre.fs66, p.fs66 ,ul.fs66 {font-size: 0.66em; } 140 | table.fs50 tr td, table.fs50 tr th, div.fs50, pre.fs50, p.fs50 ,ul.fs50 {font-size: 0.5em; } 141 | 142 | #soundmanager-debug {position:fixed; top:0px; right:0px; width:30em; height:20em; overflow:auto; border:1px solid red; padding:1em; margin:2em; font-family:"sans serif"; font-size: 12px;color: black; background-color:#f6f6f6; z-index: 100;} 143 | #soundmanager-debug code {font-size: 11px;} -------------------------------------------------------------------------------- /ui/scala_gfx/prev_link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/ui/scala_gfx/prev_link.png -------------------------------------------------------------------------------- /ui/scala_gfx/prev_over.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Parsely/python-adv-slides/c8dab2eb5745e6e1c3572b902d0ab9ad3c465c77/ui/scala_gfx/prev_over.png -------------------------------------------------------------------------------- /ui/scala_gfx/print.css: -------------------------------------------------------------------------------- 1 | /* The following rule is necessary to have all slides appear in print! DO NOT REMOVE IT! */ .slide, ul, p {page-break-inside: avoid; visibility: visible !important;} h1 {page-break-after: avoid;} 2 | img {page-break-inside: avoid; page-break-after: avoid;} 3 | /*.slide {page-break-after: always;}*/ body {font-size: 12pt; background: white;} * {color: black;} #slide0 h1 {font-size: 200%; border: none; margin: 0.5em 0 0.25em;} #slide0 h3 {margin: 0; padding: 0;} #slide0 h4 {margin: 0 0 0.5em; padding: 0;} #slide0 {margin-bottom: 3em;} h1 {border-top: 2pt solid gray; border-bottom: 1px dotted silver;} .extra {background: transparent !important;} div.extra, pre.extra, .example {font-size: 10pt; color: #333;} ul.extra a {font-weight: bold;} p.example {display: none;} #header {display: none;} #footer h1 {margin: 0; border-bottom: 1px solid; color: gray; font-style: italic;} #footer h2, #controls {display: none;} /* The following rule keeps the layout stuff out of print. Remove at your own risk! */ .hide, .layout, .layout * {display: none !important;} -------------------------------------------------------------------------------- /ui/scala_gfx/s5-core.css: -------------------------------------------------------------------------------- 1 | /* Do not edit or override these styles! The system will likely break if you do. */ 2 | 3 | div#header, div#footer, div#controls, .slide {position: absolute;} 4 | html>body div#header, html>body div#footer, html>body div#controls, html>body .slide {position: fixed;} 5 | .handout, .notes, .hide {display: none;} 6 | .layout {display: block;} 7 | .slide, .hideme, .incremental {visibility: hidden;} 8 | #slide0 {visibility: visible;} 9 | -------------------------------------------------------------------------------- /ui/scala_gfx/slides.css: -------------------------------------------------------------------------------- 1 | @import url(s5-core.css); /* required to make the slide show run at all */ 2 | @import url(framing.css); /* sets basic placement and size of slide components */ 3 | @import url(pretty.css); /* stuff that makes the slides look better than blah */ -------------------------------------------------------------------------------- /ui/scala_gfx/slides.js: -------------------------------------------------------------------------------- 1 | // S5 1.3beta7 (18-Apr-2007) advanced version by C. Effenberger 2 | // Please see http://s5.netzgesta.de/ for more information 3 | // based on S5 v1.2a1 slides.js -- released into the Public Domain 4 | // Please see http://www.meyerweb.com/eric/tools/s5/credits.html for information 5 | // about all the wonderful and talented contributors to this code! 6 | // audio extension: soundmanager2 is NOT Public Domain 7 | // Please see http://www.schillmania.com/projects/soundmanager2/ for information 8 | 9 | var undef; 10 | var slideCSS = ''; 11 | var snum = 0; 12 | var smax = 1; 13 | var incpos = 0; 14 | var number = undef; 15 | var firstTime = 1; 16 | var s5mode = true; 17 | var helpmode = false; 18 | var defaultView = 'slideshow'; //outline 19 | var controlVis = 'visible'; 20 | 21 | // scalable images extension 22 | var empx = 0; 23 | var images = new Array(); 24 | var canvas = new Array(); 25 | var medias = new Array(); 26 | var piecharts = new Array(); 27 | var barcharts = new Array(); 28 | var linecharts = new Array(); 29 | // scalable images extension 30 | 31 | // transition extension 32 | var tranSitions = false; 33 | var fadeModus = false; 34 | var fadeDuration = 500; 35 | var incrDuration = 250; 36 | var opac = 1; 37 | var cid = ''; 38 | var nid = ''; 39 | var tid = ''; 40 | var jl = ''; 41 | // transition extension 42 | 43 | // autoplay extension 44 | var autoMatic = false; 45 | var playLoop = false; 46 | var playPause = false; 47 | var autoRun = false; 48 | var playDelay = 5000; 49 | var remainDer = 0; 50 | var incrDelay = 0; 51 | // autoplay extension 52 | 53 | // audio extension 54 | var sound = new Array(); 55 | var audioSupport = false; 56 | var audioVolume = 100; 57 | var audioError = false; 58 | var swfUnloaded = true; 59 | var bgSoundItem = 9999; 60 | var curSoundID = -1; 61 | // audio extension 62 | 63 | // panel extension 64 | var imgWidth = 32; 65 | var imgHeight = 32; 66 | // panel extension 67 | 68 | // canvas chart extension 69 | var canvasSupport = false; 70 | var ChartData = new Array(); 71 | var colorSlice = new Array(); 72 | var font = document.createElement("img"); 73 | font.setAttribute("src", "ui/graphic_support/numeric.png"); 74 | signs = { 75 | '0': {sx: 0, sy: 0, sw: 48, sh: 64}, 76 | '1': {sx: 48, sy: 0, sw: 48, sh: 64}, 77 | '2': {sx: 96, sy: 0, sw: 48, sh: 64}, 78 | '3': {sx: 144, sy: 0, sw: 48, sh: 64}, 79 | '4': {sx: 192, sy: 0, sw: 48, sh: 64}, 80 | '5': {sx: 240, sy: 0, sw: 48, sh: 64}, 81 | '6': {sx: 288, sy: 0, sw: 48, sh: 64}, 82 | '7': {sx: 336, sy: 0, sw: 48, sh: 64}, 83 | '8': {sx: 384, sy: 0, sw: 48, sh: 64}, 84 | '9': {sx: 432, sy: 0, sw: 48, sh: 64}, 85 | '%': {sx: 480, sy: 0, sw: 48, sh: 64}, 86 | '.': {sx: 528, sy: 0, sw: 24, sh: 64} 87 | }; 88 | var colorNames= new Array(); 89 | colorNames["black"]="#000000"; colorNames["maroon"]="#800000"; colorNames["green"]="#008000"; colorNames["olive"]="#808000"; colorNames["navy"]="#000080"; colorNames["purple"]="#800080"; colorNames["teal"]="#008080"; colorNames["gray"]="#808080"; colorNames["silver"]="#C0C0C0"; colorNames["red"]="#FF0000"; colorNames["lime"]="#00FF00"; colorNames["yellow"]="#FFFF00"; colorNames["blue"]="#0000FF"; colorNames["fuchsia"]="#FF00FF"; colorNames["aqua"]="#00FFFF"; colorNames["white"]="#FFFFFF"; colorNames["aliceblue"]="#F0F8FF"; colorNames["antiquewhite"]="#FAEBD7"; colorNames["aquamarine"]="#7FFFD4"; colorNames["azure"]="#F0FFFF"; colorNames["beige"]="#F5F5DC"; colorNames["blueviolet"]="#8A2BE2"; colorNames["brown"]="#A52A2A"; colorNames["burlywood"]="#DEB887"; colorNames["cadetblue"]="#5F9EA0"; colorNames["chartreuse"]="#7FFF00"; colorNames["chocolate"]="#D2691E"; colorNames["coral"]="#FF7F50"; colorNames["cornflowerblue"]="#6495ED"; colorNames["cornsilk"]="#FFF8DC"; colorNames["crimson"]="#DC143C"; colorNames["darkblue"]="#00008B"; colorNames["darkcyan"]="#008B8B"; colorNames["darkgoldenrod"]="#B8860B"; colorNames["darkgray"]="#A9A9A9"; colorNames["darkgreen"]="#006400"; colorNames["darkkhaki"]="#BDB76B"; colorNames["darkmagenta"]="#8B008B"; colorNames["darkolivegreen"]="#556B2F"; colorNames["darkorange"]="#FF8C00"; colorNames["darkorchid"]="#9932CC"; colorNames["darkred"]="#8B0000"; colorNames["darksalmon"]="#E9967A"; colorNames["darkseagreen"]="#8FBC8F"; colorNames["darkslateblue"]="#483D8B"; colorNames["darkslategray"]="#2F4F4F"; colorNames["darkturquoise"]="#00CED1"; colorNames["darkviolet"]="#9400D3"; colorNames["deeppink"]="#FF1493"; colorNames["deepskyblue"]="#00BFFF"; colorNames["dimgray"]="#696969"; colorNames["dodgerblue"]="#1E90FF"; colorNames["firebrick"]="#B22222"; colorNames["floralwhite"]="#FFFAF0"; colorNames["forestgreen"]="#228B22"; colorNames["gainsboro"]="#DCDCDC"; colorNames["ghostwhite"]="#F8F8FF"; colorNames["gold"]="#FFD700"; colorNames["goldenrod"]="#DAA520"; colorNames["greenyellow"]="#ADFF2F"; colorNames["honeydew"]="#F0FFF0"; colorNames["hotpink"]="#FF69B4"; colorNames["indianred"]="#CD5C5C"; colorNames["indigo"]="#4B0082"; colorNames["ivory"]="#FFFFF0"; colorNames["khaki"]="#F0E68C"; colorNames["lavender"]="#E6E6FA"; colorNames["lavenderblush"]="#FFF0F5"; colorNames["lawngreen"]="#7CFC00"; colorNames["lemonchiffon"]="#FFFACD"; colorNames["lightblue"]="#ADD8E6"; colorNames["lightcoral"]="#F08080"; colorNames["lightcyan"]="#E0FFFF"; colorNames["lightgoldenrodyellow"]="#FAFAD2"; colorNames["lightgreen"]="#90EE90"; colorNames["lightgrey"]="#D3D3D3"; colorNames["lightpink"]="#FFB6C1"; colorNames["lightsalmon"]="#FFA07A"; colorNames["lightseagreen"]="#20B2AA"; colorNames["lightskyblue"]="#87CEFA"; colorNames["lightslategray"]="#778899"; colorNames["lightsteelblue"]="#B0C4DE"; colorNames["lightyellow"]="#FFFFE0"; colorNames["limegreen"]="#32CD32"; colorNames["linen"]="#FAF0E6"; colorNames["mediumaquamarine"]="#66CDAA"; colorNames["mediumblue"]="#0000CD"; colorNames["mediumorchid"]="#BA55D3"; colorNames["ediumpurple"]="#9370D"; colorNames["mediumseagreen"]="#3CB371"; colorNames["mediumslateblue"]="#7B68EE"; colorNames["mediumspringgreen"]="#00FA9A"; colorNames["mediumturquoise"]="#48D1CC"; colorNames["mediumvioletred"]="#C71585"; colorNames["midnightblue"]="#191970"; colorNames["mintcream"]="#F5FFFA"; colorNames["mistyrose"]="#FFE4E1"; colorNames["moccasin"]="#FFE4B5"; colorNames["navajowhite"]="#FFDEAD"; colorNames["oldlace"]="#FDF5E6"; colorNames["olivedrab"]="#6B8E23"; colorNames["orange"]="#FFA500"; colorNames["orangered"]="#FF4500"; colorNames["orchid"]="#DA70D6"; colorNames["palegoldenrod"]="#EEE8AA"; colorNames["palegreen"]="#98FB98"; colorNames["paleturquoise"]="#AFEEEE"; colorNames["palevioletred"]="#DB7093"; colorNames["papayawhip"]="#FFEFD5"; colorNames["peachpuff"]="#FFDAB9"; colorNames["peru"]="#CD853F"; colorNames["pink"]="#FFC0CB"; colorNames["plum"]="#DDA0DD"; colorNames["powderblue"]="#B0E0E6"; colorNames["rosybrown"]="#BC8F8F"; colorNames["royalblue"]="#4169E1"; colorNames["saddlebrown"]="#8B4513"; colorNames["salmon"]="#FA8072"; colorNames["sandybrown"]="#F4A460"; colorNames["seagreen"]="#2E8B57"; colorNames["seashell"]="#FFF5EE"; colorNames["sienna"]="#A0522D"; colorNames["skyblue"]="#87CEEB"; colorNames["slateblue"]="#6A5ACD"; colorNames["slategray"]="#708090"; colorNames["snow"]="#FFFAFA"; colorNames["springgreen"]="#00FF7F"; colorNames["steelblue"]="#4682B4"; colorNames["tan"]="#D2B48C"; colorNames["thistle"]="#D8BFD8"; colorNames["tomato"]="#FF6347"; colorNames["turquoise"]="#40E0D0"; colorNames["violet"]="#EE82EE"; colorNames["wheat"]="#F5DEB3"; colorNames["whitesmoke"]="#F5F5F5"; colorNames["yellowgreen"]="#9ACD32"; 90 | var canvas_bgcolor = ""; 91 | var canvas_width = 200; 92 | var canvas_height = 200; 93 | var canvas_noshade = 0; 94 | var canvas_nofill = 0; 95 | var canvas_noshadow = 0; 96 | var canvas_htmltext = 0; 97 | var canvas_imgtext = 0; 98 | var canvas_notext = 0; 99 | // canvas chart extension 100 | 101 | var s5NotesWindow; 102 | var s5NotesWindowLoaded = false; 103 | var previousSlide = 0; 104 | var presentationStart = new Date(); 105 | var slideStart = new Date(); 106 | 107 | var countdown = { 108 | timer: 0, 109 | state: 'pause', 110 | start: new Date(), 111 | end: 0, 112 | remaining: 0 113 | }; 114 | 115 | var isIE = navigator.appName == 'Microsoft Internet Explorer' && navigator.userAgent.indexOf('Opera') < 1 ? 1 : 0; 116 | if(isIE) var notIE7 = parseInt(navigator.appVersion) < 7 ? 1 : 0; 117 | var isOp = navigator.userAgent.indexOf('Opera') > -1 ? 1 : 0; 118 | var isGe = navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('Safari') < 1 ? 1 : 0; 119 | var isS2 = navigator.userAgent.indexOf('Safari') >= 2 ? 1 : 0; 120 | 121 | function hasClass(object, className) { 122 | if (!object.className) return false; 123 | return (object.className.search('(^|\\s)' + className + '(\\s|$)') != -1); 124 | } 125 | 126 | function hasValue(object, value) { 127 | if (!object) return false; 128 | return (object.search('(^|\\s)' + value + '(\\s|$)') != -1); 129 | } 130 | 131 | function removeClass(object,className) { 132 | if (!object || !hasClass(object,className)) return; 133 | object.className = object.className.replace(new RegExp('(^|\\s)'+className+'(\\s|$)'), RegExp.$1+RegExp.$2); 134 | } 135 | 136 | function addClass(object,className) { 137 | if (!object || hasClass(object, className)) return; 138 | if (object.className) { 139 | object.className += ' '+className; 140 | } else { 141 | object.className = className; 142 | } 143 | } 144 | 145 | function changeClass(object,className) { 146 | if (!object) return; 147 | object.firstChild.className = className; 148 | } 149 | 150 | function GetElementsWithClassName(elementName,className) { 151 | var allElements = document.getElementsByTagName(elementName); 152 | var elemColl = new Array(); 153 | for (var i = 0; i< allElements.length; i++) { 154 | if (hasClass(allElements[i], className)) { 155 | elemColl[elemColl.length] = allElements[i]; 156 | } 157 | } 158 | return elemColl; 159 | } 160 | 161 | function isParentOrSelf(element, id) { 162 | if (element == null || element.nodeName=='BODY') return false; 163 | else if (element.id == id) return true; 164 | else return isParentOrSelf(element.parentNode, id); 165 | } 166 | 167 | function nodeValue(node) { 168 | var result = ""; 169 | if (node.nodeType == 1) { 170 | var children = node.childNodes; 171 | for (var i = 0; i < children.length; ++i) { 172 | result += nodeValue(children[i]); 173 | } 174 | } 175 | else if (node.nodeType == 3) { 176 | result = node.nodeValue; 177 | } 178 | return(result); 179 | } 180 | 181 | function slideLabel() { 182 | var slideColl = GetElementsWithClassName('*','slide'); 183 | var list = document.getElementById('jumplist'); 184 | smax = slideColl.length; 185 | for (var n = 0; n < smax; n++) { 186 | var obj = slideColl[n]; 187 | var did = 'slide' + n.toString(); 188 | obj.setAttribute('id',did); 189 | var otext = ''; 190 | var menu = obj.firstChild; 191 | if (!menu) continue; // to cope with empty slides 192 | while (menu && menu.nodeType == 3) { 193 | menu = menu.nextSibling; 194 | } 195 | if (!menu) continue; // to cope with slides with only text nodes 196 | var menunodes = menu.childNodes; 197 | for (var o = 0; o < menunodes.length; o++) { 198 | otext += nodeValue(menunodes[o]); 199 | } 200 | list.options[list.length] = new Option(n + ' : ' + otext, n); 201 | } 202 | } 203 | 204 | function currentSlide() { 205 | var cs, at, fd, ss; 206 | if (document.getElementById) { 207 | cs = document.getElementById('currentSlide'); 208 | } else { 209 | cs = document.currentSlide; 210 | } 211 | fd = fadeModus?"F":"–"; 212 | ss = audioSupport?"S":"–"; 213 | at = (autoMatic?(playPause?"||":(playLoop?">0":">|")):"––"); 214 | cs.innerHTML = '