Help
RSS
API
Feed
Maltego
Contact
Domain > aaronchall.github.io
×
More information on this domain is in
AlienVault OTX
Is this malicious?
Yes
No
DNS Resolutions
Date
IP Address
2016-10-24
151.101.44.133
(
ClassC
)
2018-03-06
151.101.45.147
(
ClassC
)
2024-08-24
185.199.108.153
(
ClassC
)
Port 80
HTTP/1.1 200 OKConnection: keep-aliveContent-Length: 49094Server: GitHub.comContent-Type: text/html; charsetutf-8permissions-policy: interest-cohort()Last-Modified: Sun, 23 Oct 2016 20:43:26 GMTAccess-Control-Allow-Origin: *ETag: 580d20ee-bfc6expires: Sat, 24 Aug 2024 08:36:56 GMTCache-Control: max-age600x-proxy-cache: MISSX-GitHub-Request-Id: 1BC9:1109:13DA4CA:1459A36:66C9994FAccept-Ranges: bytesAge: 0Date: Sat, 24 Aug 2024 08:26:56 GMTVia: 1.1 varnishX-Served-By: cache-bfi-krnt7300080-BFIX-Cache: MISSX-Cache-Hits: 0X-Timer: S1724488016.057400,VS0,VE84Vary: Accept-EncodingX-Fastly-Request-ID: 5013d5504a034ad60a0892713fc4e441f418b186 !DOCTYPE html>html>head>title>Aaron Hall/title>!-- 2016-10-23 Sun 16:42 -->meta charsetutf-8>meta namegenerator contentOrg-mode>meta nameauthor contentAaron Hall>meta namekeywords contentlearning Python programming language Linux StackOverflow Stack Overflow GNU>style typetext/css> !--/*-->!CDATA/*>!--*/ .title { text-align: center; } .todo { font-family: monospace; color: red; } .done { color: green; } .tag { background-color: #eee; font-family: monospace; padding: 2px; font-size: 80%; font-weight: normal; } .timestamp { color: #bebebe; } .timestamp-kwd { color: #5f9ea0; } .right { margin-left: auto; margin-right: 0px; text-align: right; } .left { margin-left: 0px; margin-right: auto; text-align: left; } .center { margin-left: auto; margin-right: auto; text-align: center; } .underline { text-decoration: underline; } #postamble p, #preamble p { font-size: 90%; margin: .2em; } p.verse { margin-left: 3%; } pre { border: 1px solid #ccc; box-shadow: 3px 3px 3px #eee; padding: 8pt; font-family: monospace; overflow: auto; margin: 1.2em; } pre.src { position: relative; overflow: visible; padding-top: 1.2em; } pre.src:before { display: none; position: absolute; background-color: white; top: -10px; right: 10px; padding: 3px; border: 1px solid black; } pre.src:hover:before { display: inline;} pre.src-sh:before { content: sh; } pre.src-bash:before { content: sh; } pre.src-emacs-lisp:before { content: Emacs Lisp; } pre.src-R:before { content: R; } pre.src-perl:before { content: Perl; } pre.src-java:before { content: Java; } pre.src-sql:before { content: SQL; } table { border-collapse:collapse; } caption.t-above { caption-side: top; } caption.t-bottom { caption-side: bottom; } td, th { vertical-align:top; } th.right { text-align: center; } th.left { text-align: center; } th.center { text-align: center; } td.right { text-align: right; } td.left { text-align: left; } td.center { text-align: center; } dt { font-weight: bold; } .footpara:nth-child(2) { display: inline; } .footpara { display: block; } .footdef { margin-bottom: 1em; } .figure { padding: 1em; } .figure p { text-align: center; } .inlinetask { padding: 10px; border: 2px solid gray; margin: 10px; background: #ffffcc; } #org-div-home-and-up { text-align: right; font-size: 70%; white-space: nowrap; } textarea { overflow-x: auto; } .linenr { font-size: smaller } .code-highlighted { background-color: #ffff00; } .org-info-js_info-navigation { border-style: none; } #org-info-js_console-label { font-size: 10px; font-weight: bold; white-space: nowrap; } .org-info-js_search-highlight { background-color: #ffff00; color: #000000; font-weight: bold; } /*>*/-->/style>script typetext/javascript srchttp://orgmode.org/org-info.js>/** * * @source: http://orgmode.org/org-info.js * * @licstart The following is the entire license notice for the * JavaScript code in http://orgmode.org/org-info.js. * * Copyright (C) 2012-2013 Free Software Foundation, Inc. * * * The JavaScript code in this tag is free software: you can * redistribute it and/or modify it under the terms of the GNU * General Public License (GNU GPL) as published by the Free Software * Foundation, either version 3 of the License, or (at your option) * any later version. The code is distributed WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU GPL for more details. * * As additional permission under GNU GPL version 3 section 7, you * may distribute non-source (e.g., minimized or compacted) forms of * that code without the copy of the GNU GPL normally required by * section 4, provided you include this license notice and a URL * through which recipients can access the Corresponding Source. * * @licend The above is the entire license notice * for the JavaScript code in http://orgmode.org/org-info.js. * *//script>script typetext/javascript>/*@licstart The following is the entire license notice for theJavaScript code in this tag.Copyright (C) 2012-2013 Free Software Foundation, Inc.The JavaScript code in this tag is free software: you canredistribute it and/or modify it under the terms of the GNUGeneral Public License (GNU GPL) as published by the Free SoftwareFoundation, either version 3 of the License, or (at your option)any later version. The code is distributed WITHOUT ANY WARRANTY;without even the implied warranty of MERCHANTABILITY or FITNESSFOR A PARTICULAR PURPOSE. See the GNU GPL for more details.As additional permission under GNU GPL version 3 section 7, youmay distribute non-source (e.g., minimized or compacted) forms ofthat code without the copy of the GNU GPL normally required bysection 4, provided you include this license notice and a URLthrough which recipients can access the Corresponding Source.@licend The above is the entire license noticefor the JavaScript code in this tag.*/!--/*-->!CDATA/*>!--*/org_html_manager.set(TOC_DEPTH, 3);org_html_manager.set(LINK_HOME, );org_html_manager.set(LINK_UP, );org_html_manager.set(LOCAL_TOC, 1);org_html_manager.set(VIEW_BUTTONS, 0);org_html_manager.set(MOUSE_HINT, underline);org_html_manager.set(FIXED_TOC, 0);org_html_manager.set(TOC, 1);org_html_manager.set(VIEW, overview);org_html_manager.setup(); // activate after the parameters are set/*>*///-->/script>script typetext/javascript>/*@licstart The following is the entire license notice for theJavaScript code in this tag.Copyright (C) 2012-2013 Free Software Foundation, Inc.The JavaScript code in this tag is free software: you canredistribute it and/or modify it under the terms of the GNUGeneral Public License (GNU GPL) as published by the Free SoftwareFoundation, either version 3 of the License, or (at your option)any later version. The code is distributed WITHOUT ANY WARRANTY;without even the implied warranty of MERCHANTABILITY or FITNESSFOR A PARTICULAR PURPOSE. See the GNU GPL for more details.As additional permission under GNU GPL version 3 section 7, youmay distribute non-source (e.g., minimized or compacted) forms ofthat code without the copy of the GNU GPL normally required bysection 4, provided you include this license notice and a URLthrough which recipients can access the Corresponding Source.@licend The above is the entire license noticefor the JavaScript code in this tag.*/!--/*-->!CDATA/*>!--*/ function CodeHighlightOn(elem, id) { var target document.getElementById(id); if(null ! target) { elem.cacheClassElem elem.className; elem.cacheClassTarget target.className; target.className code-highlighted; elem.className code-highlighted; } } function CodeHighlightOff(elem, id) { var target document.getElementById(id); if(elem.cacheClassElem) elem.className elem.cacheClassElem; if(elem.cacheClassTarget) target.className elem.cacheClassTarget; }/*>*///-->/script>/head>body>div idcontent>h1 classtitle>Aaron Hall/h1>nav idtable-of-contents>h2>Table of Contents/h2>div idtext-table-of-contents>ul>li>a href#sec-1>About Me/a>/li>li>a href#sec-2>My story/a>/li>li>a href#sec-3>Talks/a>/li>li>a href#sec-4>Stack Overflow/a>ul>li>a href#sec-4-1>The Best Answers/a>/li>li>a href#sec-4-2>My Best Answers/a>/li>li>a href#sec-4-3>Data types and their methods/a>/li>li>a href#sec-4-4>Procedural Programming & Modules/a>/li>li>a href#sec-4-5>Functional Programming/a>/li>li>a href#sec-4-6>Object Oriented Programming (OOP)/a>/li>li>a href#sec-4-7>Putting it all together/a>/li>/ul>/li>li>a href#sec-5>How to contribute on Stack Overflow/a>ul>li>a href#sec-5-1>Improving others posts/a>/li>li>a href#sec-5-2>Answering Questions/a>/li>li>a href#sec-5-3>Asking Questions/a>/li>li>a href#sec-5-4>Moderation activities/a>/li>/ul>/li>li>a href#sec-6>Linux/a>ul>li>a href#sec-6-1>My Linux Story/a>/li>li>a href#sec-6-2>To install Linux/a>/li>/ul>/li>li>a href#sec-7>How to get started with Python/a>ul>li>a href#sec-7-1>Some Python best practices/a>/li>li>a href#sec-7-2>python.org and pip/a>/li>li>a href#sec-7-3>Anaconda/a>/li>/ul>/li>li>a href#sec-8>How to learn Python/a>ul>li>a href#sec-8-1>Do the official tutorial/a>/li>li>a href#sec-8-2>Read the Library Reference/a>/li>li>a href#sec-8-3>Read the Language Reference/a>/li>li>a href#sec-8-4>Read the PEPs and the Source code/a>/li>/ul>/li>li>a href#sec-9>Emacs - Spacemacs & Orgmode/a>ul>li>a href#sec-9-1>Which Emacs version to use/a>/li>li>a href#sec-9-2>Emacs on Android/a>/li>li>a href#sec-9-3>Spacemacs/a>/li>li>a href#sec-9-4>Orgmode/a>/li>/ul>/li>li>a href#sec-10>Web Development/a>ul>li>a href#sec-10-1>HTML Specific/a>/li>li>a href#sec-10-2>CSS/a>/li>li>a href#sec-10-3>Javascript/a>/li>/ul>/li>/ul>/div>/nav>style>body { background-color: black; color: lightgrey; width: 50em; margin:0px auto auto auto;}a { color: lightblue;}h2, h3 { padding-left: 10px; margin-left: auto; margin-right: auto;}.outline-text-2, .outline-text-3 { margin-left: auto; margin-right: auto; width: 40em; padding-left: 16px;}/style> article idoutline-container-sec-1 classoutline-2>h2 idsec-1>About Me/h2>div classoutline-text-2 idtext-1>p>This page is about stuff Im interested in and that I think you might beinterested in if you know me, want to learn more about me, or are interestedin the same types of things that Im interested in. /p>p>Im interested in:/p>ul classorg-ul>li>Programming with Python and Linux/li>li>Emacs and Orgmode/li>li>Computer Science, Economics, and Business/li>/ul>p>Its intended to be a high-level overview. Please search Google orfollow the links I give if you want to learn more./p>/div>/article>article idoutline-container-sec-2 classoutline-2>h2 idsec-2>My story/h2>div classoutline-text-2 idtext-2>ul classorg-ul>li>National Merit Scholar/li>li>Graduated with 169 credit hours, BS Political Science & Real Estate/li>li>Financial Advisor with Ameriprise and Merrill Lynch/li>li>Spent a year in a Finance PhD program, but did an MBA instead/li>li>Moved to NYC, got involved in the local tech meetup scene/li>li>Assistant Director of a non-profit, Business Professor, IT guy /li>li>Got hired to write Python at a bank/li>li>Started answering Python questions on Stack Overflow - now in top 1% of users./li>li>Teaching Python at a few Universities now./li>/ul>/div>/article>article idoutline-container-sec-3 classoutline-2>h2 idsec-3>Talks/h2>div classoutline-text-2 idtext-3>p>Ive given a number of talks on Python at Meetups and Conventions - Ill try to link to their material here as much as I can. /p>ul classorg-ul>li>Learning Python with Best Practices (given at NYC Python)/li>li>Python Best Practices (NYC Python)/li>li>Linear Models with Python (PyGotham 2014)/li>li>The Python Data Model, when and how to write Objects (PyGotham 2015 - available on a hrefhttps://www.youtube.com/watch?viGfggZqXmB0>Youtube/a>)/li>li>Functional Programming with Python (NYC Python)/li>li>Python by Aaron Hall (N Languages Meetup (video pending review!)/li>li>Best Practices for Reusable Python (PyGotham 2016 (video coming soon))/li>li>OOP Panel TODO complete/li>/ul>/div>/article>article idoutline-container-sec-4 classoutline-2>h2 idsec-4>Stack Overflow/h2>div classoutline-text-2 idtext-4>p>Dont learn Python by reading answers on Stack Overflow. /p>p>Ok, you can learn some things, but you may find you need to later unlearn things. /p>p>However, it is probably safe to read answers written by yours truly./p>p>I have written a lot of answers to questions on StackOverflow. Mymotivation is usually my dissatisfaction with the accepted answerand other top answers on the question. I try to write what I consider to be outstanding answers to the questions./p>p>What makes an outstanding answer? To me, answers that are technically precise,demonstrably correct, and directly communicate the important points are great answers./p>/div>div idoutline-container-sec-4-1 classoutline-3>h3 idsec-4-1>The Best Answers/h3>div classoutline-text-3 idtext-4-1>p>On Stack Overflow, they advertise that the best answers rise to the top.This condition does not always hold. New great answers are still ranked (by default) way below answers that have been there for years,and yet have only gathered a few votes. This issue could be addressed by allowing users to sort by recent votes, but this featuremay never appear./p>/div>/div>div idoutline-container-sec-4-2 classoutline-3>h3 idsec-4-2>My Best Answers/h3>div classoutline-text-3 idtext-4-2>aside>p>Im in the top .5% of all time (actually top .36% as of this writing,but whos keeping score?) on Stack Overflow./p>a hrefhttp://stackoverflow.com/users/541136/aaron-hall?tabprofile> img srchttp://stackoverflow.com/users/flair/541136.png?themedark width208 height58 altprofile for Aaron Hall at Stack Overflow, for professional and enthusiast programmers > /img>/a>/aside>p>My top a hrefhttp://stackoverflow.com/users/541136/aaron-hall?tabanswers&sortvotes>100 or so answers/a> are probably worth reading. Ive kinda organized my answers with over 8 upvotes here./p>p>Note that Im linking to the questions,not specifically my answers, so use Ctrl-f and search for my name to find my answers. /p>p>Also note that the stated ethos of the site is that the best answers rise to the top. /p>p>It can actually take years for new best answers to rise to the top./p>p>We can improve the speed of the sorting algorithm by voting up good answersand voting down poor ones. So while youre reading content on Stack Overflow, remember to b>vote early and often/b>./p>/div>/div>div idoutline-container-sec-4-3 classoutline-3>h3 idsec-4-3>Data types and their methods/h3>div classoutline-text-3 idtext-4-3>p>These are some of my answers on how to use Pythons builtin data-types./p>p>Dictionaries are mappings of keys to values (implemented as hash tables). So the keys must be hashable./p>p>Lists and tuples are essentially arrays of pointers to objects. Lists are mutable, they can be changed - but tuples are not./p>p>Since lists are mutable, you cant use them in keys for dicts. But you can use tuples. /p>ul classorg-ul>li>a hrefhttp://stackoverflow.com/q/1024847/541136>Add a key to a Python dictionary/a>/li>li>a hrefhttp://stackoverflow.com/q/38987/541136>How to merge two Python dictionaries in a single expression?/a>/li>li>a hrefhttp://stackoverflow.com/q/252703/541136>Difference between the list methods append and extend/a>/li>li>a hrefhttp://stackoverflow.com/q/2612802/541136>Clone or copy a list/a>/li>li>a hrefhttp://stackoverflow.com/q/1712227/541136>How to get the size of a list/a>/li>li>a hrefhttp://stackoverflow.com/q/22741068/541136>Remove identical items from a list and sort it/a>/li>li>a hrefhttp://stackoverflow.com/q/8537916/541136>Prepend to a list/a>/li>li>a hrefhttp://stackoverflow.com/q/509211/541136>Explain slice notation/a> - essentially list, string, and tuple code>__getitem__/code> method usage./li>li>a hrefhttp://stackoverflow.com/q/646644/541136>Get the last items of a list/a>/li>li>a hrefhttp://stackoverflow.com/q/2970608/541136>What are named tuples?/a>/li>li>a hrefhttp://stackoverflow.com/q/931092/541136>Reverse a string/a>/li>li>a hrefhttp://stackoverflow.com/q/6797984/541136>Convert a string to lowercase/a>/li>li>a hrefhttp://stackoverflow.com/q/3437059/541136>Does Python have a string contains method?/a>/li>li>a hrefhttp://stackoverflow.com/q/21718345/541136>Determine if a list of words exists in a string/a>/li>li>a hrefhttp://stackoverflow.com/q/493819/541136>Why is it str.join(list) instead of list.join(str)?/a>/li>li>a hrefhttp://stackoverflow.com/q/37903317/541136>Is there a constant for Unicode whitespace?/a>/li>li>a hrefhttp://stackoverflow.com/q/21542694/541136>Difference between using commas, concatenation, and string formatters/a> - printing options (note that there is a really good example of how not to answer on Stack Overflowhere. The advice given is perfectly correct, but its barely a single complete sentence,its written in a very informal style, and as a result, it has 0 upvotes. The usersits at 1 reputation point as well.)/li>li>a hrefhttp://stackoverflow.com/q/230751/541136>Flush the output of code>print/code>/a>/li>li>a hrefhttp://stackoverflow.com/q/4760215/541136>Run a shell command from Python/a>/li>li>a hrefhttp://stackoverflow.com/q/415511/541136>Getting the current time/a>/li>li>a hrefhttp://stackoverflow.com/q/82831/541136>Check whether a file exists/a>/li>li>a hrefhttp://stackoverflow.com/q/4510640/541136>Check if directory exists and create it if necessary/a>/li>li>a hrefhttp://stackoverflow.com/q/1267869/541136>Force division to be floating point/a>/li>/ul>/div>/div>div idoutline-container-sec-4-4 classoutline-3>h3 idsec-4-4>Procedural Programming & Modules/h3>div classoutline-text-3 idtext-4-4>p>The answers I have on these questions cover importantidiomatic statements and control flow in Python./p>ul classorg-ul>li>a hrefhttp://stackoverflow.com/q/44834/541136%20>Modules code>__all__/code>/a>/li>li>a hrefhttp://stackoverflow.com/q/419163/541136>What does code>if __name__ “__main__”:/code> do?/a>/li>li>a hrefhttp://stackoverflow.com/q/394809/541136>Ternary conditional operator/a>/li>li>a hrefhttp://stackoverflow.com/q/522563/541136>Accessing the index in Python for loops/a>/li>li>a hrefhttp://stackoverflow.com/q/36106712/541136>Limit iterations of an enumerated loop/a>/li>li>a hrefhttp://stackoverflow.com/q/2052390/541136>Manually raising (throwing) an exception in Python/a>/li>li>a hrefhttp://stackoverflow.com/q/21553327/541136>Why is “except: pass” a bad programming practice?/a>/li>li>a hrefhttp://stackoverflow.com/q/730764/541136>How do you properly ignore exceptions/a>/li>li>a hrefhttp://stackoverflow.com/q/6470428/541136>Catch multiple exceptions in one line/a>/li>li>a hrefhttp://stackoverflow.com/q/3702675/541136>Print the full traceback without halting the program/a>/li>li>a hrefhttp://stackoverflow.com/q/855759/541136>Intended use of the optional code>else/code> clause of the code>try/code> statement?/a>/li>li>a hrefhttp://stackoverflow.com/q/16138232/541136>Good practice to use try-except-else(-finally)?/a>/li>/ul>/div>/div>div idoutline-container-sec-4-5 classoutline-3>h3 idsec-4-5>Functional Programming/h3>div classoutline-text-3 idtext-4-5>p>These answers will cover creation and usage of functions./p>p>In Python, everything is an object. Functions are also objects.That makes it easy to make functions first class citizens./p>p>Functions are instantiated by function definitions and lambda statements.I recommend function definitions over lambdas in Python. Lambdas are basically severely limited functions - they dont know their name or have a docstring, and you can only give them a simple statementto return./p>p>Note also that list comps and generator expressions have subsumedmap and filter in Python./p>ul classorg-ul>li>a hrefhttp://stackoverflow.com/q/22439752/541136>Local versus global variables/a>/li>li>a hrefhttp://stackoverflow.com/q/423379/541136>Using global variables in a function other than the one that created them/a>/li>li>a hrefhttp://stackoverflow.com/q/2776829/541136>Difference between Generators and Iterators/a>/li>li>a hrefhttp://stackoverflow.com/q/3459098/541136>Create List of Single Item Repeated n Times/a>/li>li>a hrefhttp://stackoverflow.com/q/209840/541136>Map two lists into a dictionary/a>/li>li>a hrefhttp://stackoverflow.com/q/36901/541136>Arguments, code>*args/code> and code>**kwargs/code> for parameters/a>/li>li>a hrefhttp://stackoverflow.com/q/492519/541136>Timeout on a function call/a>/li>li>a hrefhttp://stackoverflow.com/q/31822190/541136>How does the @timeout(timelimit) decorator work?/a>/li>li>a hrefhttp://stackoverflow.com/q/36917042/541136>Pairwise circular for loop/a>/li>li>a hrefhttp://stackoverflow.com/q/231767/541136>What does the code>yield/code> keyword do?/a>/li>li>a hrefhttp://stackoverflow.com/q/494594/541136>How to write the Fibonacci sequence/a>/li>/ul>/div>/div>div idoutline-container-sec-4-6 classoutline-3>h3 idsec-4-6>Object Oriented Programming (OOP)/h3>div classoutline-text-3 idtext-4-6>p>These Q&As relate to the fact that in Python,everything is an object. That includes integers./p>p>Most all objects have methods that you as a user are intended to use. They all have special methodsthat start with double beginning and ending underscores.These are sometimes called dunder methods becauseof that./p>ul classorg-ul>li>a hrefhttp://stackoverflow.com/q/306313/541136>“is” operator behaves unexpectedly with integers/a>/li>li>a hrefhttp://stackoverflow.com/q/1606436/541136>Adding docstrings to namedtuples/a>/li>li>a hrefhttp://stackoverflow.com/q/735975/541136>Static methods/a>/li>li>a hrefhttp://stackoverflow.com/q/136097/541136>What is the difference between @staticmethod and @classmethod/a>/li>li>a hrefhttp://stackoverflow.com/q/24253761/541136>Call an instance of an object/a> /li>li>a href//stackoverflow.com/q/635483/541136>Best way to implement nested dictionaries/a> - demonstrates allowinginheritance (subclassers) to elegantly change behavior./li>li>a hrefhttp://stackoverflow.com/q/860245/541136>Difference between a mixin and inheritance/a>/li>li>a hrefhttp://stackoverflow.com/q/21361106/541136>Implement a dict with Abstract Base Classes/a>/li>li>a hrefhttp://stackoverflow.com/q/222877/541136>How to use code>super/code>/a> - dependency injection, /li>li>a hrefhttp://stackoverflow.com/q/576169/541136>Understanding Python code>super()/code> with code>__init__()/code> methods/a>/li>li>a hrefhttp://stackoverflow.com/q/472000/541136>When and how to use code>__slots__/code>/a>(Note that this is a huge example, in my mind, of where Stack Overflow fails to meet its promise that the best answers rise to the top. The accepted answerer actually says he wants my answer to be accepted.)/li>li>a hrefhttp://stackoverflow.com/q/449560/541136>How do I determine the size of an object in Python/a>/li>li>a hrefhttp://stackoverflow.com/q/5626193/541136>What is a monkey-patch?/a> /li>li>a hrefhttp://stackoverflow.com/q/37601644/541136>Whats the Enum type good for?/a>/li>li>a hrefhttp://stackoverflow.com/q/1436703/541136>Difference between code>__str__/code> and code>__repr__/code>/a>/li>li>a hrefhttp://stackoverflow.com/q/4352244/541136>Implement code>__ne__/code> in terms of code>__eq__/code>?/a>/li>li>a hrefhttp://stackoverflow.com/q/372042/541136>Difference between Abstract Class and Interface/a> - (there is none!)/li>li>a hrefhttp://stackoverflow.com/q/3798835/541136>Understanding code>__get__/code> and code>__set__/code> and Python descriptors/a>/li>/ul>/div>/div>div idoutline-container-sec-4-7 classoutline-3>h3 idsec-4-7>Putting it all together/h3>div classoutline-text-3 idtext-4-7>p>These Q&As combine multiple elements from the above categories.They dont fit very neatly in the prior sections./p>p>These are also a bit advanced./p>ul classorg-ul>li>a hrefhttp://stackoverflow.com/q/972/541136>Adding a method to an existing object instance/a> (Do not usually do this, but how is instructive.)/li>li>a hrefhttp://stackoverflow.com/q/449560/541136>Determine the size of an object/a> /li>li>a hrefhttp://stackoverflow.com/q/1319615/541136>Proper way to declare custom exceptions/a>/li>li>a hrefhttp://stackoverflow.com/q/129507/541136>Test that a function throws an exception/a>/li>li>a hrefhttp://stackoverflow.com/q/32770762/541136>Optimization break-even point/a>/li>li>a hrefhttp://stackoverflow.com/q/23663231/541136>Does enumerate produce a generator object?/a>/li>/ul>/div>/div>/article>article idoutline-container-sec-5 classoutline-2>h2 idsec-5>How to contribute on Stack Overflow/h2>div classoutline-text-2 idtext-5>p>It can be hard. Its competitive. Theyve gamified answering questions. They have a b>lot/b> of new people all the time and to limit damage a new account can cause, you get privileges (like commenting on others posts) incrementally as you earn reputation points (rep)./p>p>You do start off being able to ask and answer questions, and being able to submitedits for review. If edits are approved, you get 2 rep. If your questionis upvoted, you get 5 rep. If your answer is upvoted, you get 10 rep.If your answer is accepted by the asker, you get 15 rep. Sometimes bounties are offered on questions.Theres a rep cap of 200 per day, but accepts and bounties dont count toward the cap./p>/div>div idoutline-container-sec-5-1 classoutline-3>h3 idsec-5-1>Improving others posts/h3>div classoutline-text-3 idtext-5-1>p>Edits are an easy way to get over the early participation hurdles. So pull out Strunk and White,and get to fixing spelling and grammar errors, and removing cruft like sign-offs and apologies. Do i>not/i> change code (except to fix formatting), or change the meaning of answers,(unless its i>your/i> answer)./p>/div>/div>div idoutline-container-sec-5-2 classoutline-3>h3 idsec-5-2>Answering Questions/h3>div classoutline-text-3 idtext-5-2>p>Next, answer questions. Its easier than asking. Almost all the good questions have been asked./p>p>Not all of the good answers have been given. /p>p>You can try to earn rep fast by answering new questions that are liable to be closed as dupes and see maybe 100 views over the next decade. Or you can try to write really good canonical answers to canonicalquestions, like me./p>p>To get upvotes, consider Socrates on persuasion - you need ethos, pathos, and logos./p>ul classorg-ul>li>Logos: This is logic and evidence. Better communication of logic and evidence willgreatly help you succeed on the site, especially when youre starting with nothing.With code, its usually easy to demonstrate you have something that works, butyou still need to back up your recommendations with strong and readily acceptable reasoning. /li>li>Pathos: This is how you say what you say. For a speaker, its the emotion conveyedby the words. A disconnect can hurt you. If you have a strong tone (and youre right), youll usually get more upvotes. I have a personal bias against tone. Thisprobably hurts me, when I say dont do this instead of saying i>I mean really never ever do this/i>./li>li>Ethos: This the credibility of the speaker/author. The major source of credibility on Stack Overflow is your reputation point count.(Unless perhaps you have widespread recognition as an expert on the topic at hand.)For better or worse, you can get away with less of logos and pathos if you have ethos.Im sure I have some material that now benefits from my higher reputation count,but in the beginning, everything I posted was greeted with scepticism and requiredmy appeals to logos to carry it./li>/ul>p>a hrefhttp://stackoverflow.com/q/21542694/541136>The last answer here/a> is a really good example of how not to answer on Stack Overflow. The advice given is perfectly correct, but its barely a single complete sentence,its written in a very informal style, and as a result, it has 0 upvotes. The usersits at 1 reputation point as well. No ethos, pathos, or logos./p>/div>/div>div idoutline-container-sec-5-3 classoutline-3>h3 idsec-5-3>Asking Questions/h3>div classoutline-text-3 idtext-5-3>p>Some people have had a lot of success in asking good questions. Not me. If you manage to create a formula for demonstrable success in asking questions, let me know how. /p>p>Top answerers have written long explanations about how to ask good questions. But they dont ask questions. I dont find their advice to be particularly helpful./p>p>The community is frequently capricious, unhelpful, and rude - especially to newcomers, but also even to me when Ive asked questions./p>p>However, heres some guidelines to help improve your odds./p>ul classorg-ul>li>Dont give them an excuse to close your question.Read the help and the rules for the site carefully. If any portionof your question is off-topic (like asking for resources), they will likely vote to close/delete your question.Dont mention wanting a resource. Just dont do it./li>li>Dont apologize, explain why you dont know something,go on about how new you are, thank them in advance (its implied anyways), orsign-off your question (your name is on your post).That stuff is considered noise. All that matters is the question itself./li>li>Dont write a wall of text. Write so that you are understandable at a 3rd grade level (or below if you can). Separate each sentence, one per paragraph. Bold the actual question. Phrase it as a question.Use a question mark. Use a grammar and a spell check on your English.The less you make the answerers think and think critical things about your question, the better./li>li>Be super nice. Show some research effort. Use code to demonstrate what youre talking about. Make your example as small as possible. Show what you haveto work with, and what you expect the output to be.Dont ask them to code for you./li>/ul>p>I dont know what else to tell you. If you make a good-faitheffort to follow the guidelines Ive given in submitting a question, you may still have incompetent people try to shutyour question down. Just stay positive, keep looking for theanswer yourself, and if you can find it, feel free to answer your own question. /p>/div>/div>div idoutline-container-sec-5-4 classoutline-3>h3 idsec-5-4>Moderation activities/h3>div classoutline-text-3 idtext-5-4>p>Stack Overflow also tracks your moderating activities, and awards you with badges at certain points. The moderationtools become more available to you as you earn reputation.(See privileges.)/p>p>When you earn access to these tools, remember how you were treated, and try to raise the bar in your treatment of others./p>p>The easiest way to improve others experiences on the siteis to fix obvious and fixable problems with their questions.(See the prior section on asking questions.) Again,that gives you +2 rep for accepted edits. If youre conscientious,you will likely have some edits rejected that should have beenaccepted - just remain conscientious and continue improving content, and you will be rewarded over the long run./p>p>You can also participate (as you earn the privilege)in reviewing posts. Be conscientious if you do./p>p>If the community, a moderator,or the system tells you youre wrong, then youre (99.9%of the time) wrong by definition. Happily accept your wrongness, try to learn from it, and continue helping as you can. If you get temporarily banned from the review queue from time to time, take a break and come back when your ban is up./p>p>Remember, its all just internet points, which probably wontbe worth anything ever. Maybe something when the singularityhits and AI takes over, but I dont see that happening any timesoon, so you have plenty of time until then. (I would thinkthat StackOverflows internet points would be the most valuable,at that point.)/p>/div>/div>/article>article idoutline-container-sec-6 classoutline-2>h2 idsec-6>Linux/h2>div classoutline-text-2 idtext-6>p>If you like to have as much control of your operating system as possible,I highly recommend installing a distribution of Linux, like Ubuntu,Debian, or Fedora./p>/div>div idoutline-container-sec-6-1 classoutline-3>h3 idsec-6-1>My Linux Story/h3>div classoutline-text-3 idtext-6-1>p>Although I always used their software, Ive always been very frustrated with Microsofts opacity and lack of documentation./p>p>I have been aware of Linux since the early 90s,(with all the computer magazines in the computer software stores, whocould miss the penguin and inquire about him)./p>p>I was told, Use Windows if you want to learn how Windows works.If you want to learn how computers work, use Linux./p>p>After much study, ensuring I had the software I needed (office and developmentsoftware, basically everything but games) I decided to install Linux. /p>p>I started by dual booting Linux and Windows, and when I found that I was only rarely using Windows at all, I began to only access Windowsfrom a virtual machine./p>/div>/div>div idoutline-container-sec-6-2 classoutline-3>h3 idsec-6-2>To install Linux/h3>div classoutline-text-3 idtext-6-2>p>Installing Linux is fairly simple./p>ol classorg-ol>li>Create a bootable thumbdrive or CD (google for code>unetbootin/code>)./li>li>Boot the computer you want to install it on from that./li>li>Follow the instructions to install it./li>/ol>p>Note that if youre not careful, or even if you are and something goes wrong, you could wipe any other operating systemsyou may have installed (like Windows). So backup your data./p>p>If you want to dual boot, its a little more complicated,but Ubuntus current installer seems to handle it well../p>p>I much prefer to run Windows in a virtual machine (which is really easy)./p>/div>/div>/article>article idoutline-container-sec-7 classoutline-2>h2 idsec-7>How to get started with Python/h2>div classoutline-text-2 idtext-7>p>If this topic interests you, youre either new to Python,helping others new to Python, or second guessing your current setup./p>p>There are a couple of ways to do this. If youre just beginning with PythonId recommend you download and use the Anaconda distribution./p>p>If youre doing this for work, do what your boss says. If yourethe boss, and youre checking this out, your people should probablybe using pip with virtual environments - unless theyve worked out somethingfar more sophisticated./p>/div>div idoutline-container-sec-7-1 classoutline-3>h3 idsec-7-1>Some Python best practices/h3>div classoutline-text-3 idtext-7-1>p>Read a hrefhttps://www.python.org/dev/peps/pep-0008/>PEP 8/a> and the a hrefhttps://google.github.io/styleguide/pyguide.html>Google Python Style Guide/a>. /p>p>Heres some thoughts of how to write good Python./p>p>When writing a script, give it a docstring, and put the mainstuffin a code>main()/code> function. Do the future imports for Python 2 and 3 compatibility, (code>unicode_literals/code> if its a hrefhttp://python-future.org/unicode_literals.html>new code/a>)./p>p>e.g. in script.py:/p>div classorg-src-container>pre classsrc src-python>span classlinenr> 1: /span>Explain purpose for script.py herespan classlinenr> 2: /span>from __future__ import print_function, division, absolute_import, unicode_literalsspan classlinenr> 3: /span>span classlinenr> 4: /span>from something import main_stuff # dont import * span classlinenr> 5: /span># if following a tutorial, import the module and do dotted lookups.span classlinenr> 6: /span>span classlinenr> 7: /span>def main():span classlinenr> 8: /span> main_stuff()span classlinenr> 9: /span>span classlinenr>10: /span>if __name__ __main__:span classlinenr>11: /span> main()/pre>/div>p>The main could then be imported into other /p>/div>/div>div idoutline-container-sec-7-2 classoutline-3>h3 idsec-7-2>python.org and pip/h3>div classoutline-text-3 idtext-7-2>p>You can also get Python from the a hrefhttps://www.python.org>official site/a>.If you go that route, youll want to use pip to install packages. /p>p>People used to have trouble installing libraries withcompiled C extensions with pip, but I understand that thisis now improved./p>p>You should be careful toonly use it to install to your user area. I understand Ubuntudoes this for pip by default, but other operating systems might not be so thoughtful./p>p>You should probably use pip with virtual environments. There are lots of great tutorials on how to do that./p>/div>/div>div idoutline-container-sec-7-3 classoutline-3>h3 idsec-7-3>Anaconda/h3>div classoutline-text-3 idtext-7-3>p>a hrefhttps://www.continuum.io/downloads>Anaconda/a> installs a new Python in your user area, along withmany other commonly used libraries. I like it for teaching andfor beginners because its a one-shot install of most things you want, and a one-shot remove if you dont like it./p>p>It comes with /p>ul classorg-ul>li>lots of packages not already in the standard library, for example: numpy, pandas, requests, and flask./li>li>a package manager that can install other things: conda - it can even install R too. /li>li>an IDE: SPyDEr (should work out of the box without configuration, too.)/li>li>Jupyter Notebook - a local app that lets you run Python (andother interactive languages) in your browser./li>/ul>/div>/div>/article>article idoutline-container-sec-8 classoutline-2>h2 idsec-8>How to learn Python/h2>div classoutline-text-2 idtext-8>p>As a best practice, I recommend using a hrefhttp://docs.python.org>the official docs/a>.If youre just learning, I think starting with Python 3 is just fineunless you expect to be working somewhere that is on Python 2 for the near future./p>p>Its easy to learn the difference, at which point youll know both./p>p>If you b>really/b> study the commonly used stuff, and at least become awareof the things you dont know, youll be a capable Python programmer before you know it./p>p>Consider the below items only slightly ordered, and dont let being blocked on anyone item prevent you from going on to the next./p>p>Alternatively, you could pre-order the book I intend to write. Nothing like impatient customersto drive me to write about Python./p>/div>div idoutline-container-sec-8-1 classoutline-3>h3 idsec-8-1>Do the official tutorial/h3>div classoutline-text-3 idtext-8-1>p>Start at a hrefhttp://docs.python.org/tutorial/introduction>Chapter 3, The Introduction/a>. The first chapter is trivial, and the second chapter is probably gobbledygook to anyone new to programming./p>p>Keep going through the chapters and youll get exposed to some of the builtin standard library./p>/div>/div>div idoutline-container-sec-8-2 classoutline-3>h3 idsec-8-2>Read the Library Reference/h3>div classoutline-text-3 idtext-8-2>p>Start with the a hrefhttp://docs.python.org/library/functions>builtins/a> (chapter 2 of the Library Reference). Chapter one is trivial./p>p>Learn the builtin functions. If youre ambitious, memorize theirsignatures (that is, the arguments that they take.) /p>p>Many of the builtin functions are actually types that can be used to type check and can be subclassed, in addition to instantiation./p>p>code>__import__/code> is mostly kept around for backwards compatibility.Dont bother using it./p>/div>/div>div idoutline-container-sec-8-3 classoutline-3>h3 idsec-8-3>Read the Language Reference/h3>div classoutline-text-3 idtext-8-3>p>This doc includes comprehensive overviews of expressions, and statements for control flow, importing, etc. /p>p>I like to point beginners directly at the a hrefhttp://docs.python.org/reference/grammar.html>grammar file/a>./p>/div>/div>div idoutline-container-sec-8-4 classoutline-3>h3 idsec-8-4>Read the PEPs and the Source code/h3>div classoutline-text-3 idtext-8-4>p>The a hrefhttp://www.python.org/dev/peps/>PEPs/a> are Python Enhancement Proposals (like Requests For Change, but we dont like breakingchanges in Python.)/p>p>I highly recommend beginners to Python read a hrefhttp://www.python.org/dev/peps/pep-0008/>PEP 8/a> early. Others can come later./p>p>The source code is viewable on a hrefhttps://github.com/python/cpython>github/a>. Start by reading the Python in the Lib directory.Then move on to the C code in other directories (Python, Objects, Modules, Include) /p>/div>/div>/article>article idoutline-container-sec-9 classoutline-2>h2 idsec-9>Emacs - Spacemacs & Orgmode/h2>div classoutline-text-2 idtext-9>p>Here I describe my personal (not usually for work) development environment./p>p>For me, its highly experimental, and very configuration heavy./p>p>Its not super sophisticated - its just for home use - butI invest in learning it now so that Ill always be able to leverageit in the future./p>aside>p>(At work I have a custom built IDE that uses Python to tie together UI elements built in C++ and integrates version control and reviews. Id like my emacs setup to reflect that kind of efficiency one day.)/p>/aside>/div>div idoutline-container-sec-9-1 classoutline-3>h3 idsec-9-1>Which Emacs version to use/h3>div classoutline-text-3 idtext-9-1>p>You can get a a hrefhttps://www.gnu.org/software/emacs/download.html>recent version of emacs here/a>./p>p>I have been using Emacs 24.5, but Emacs 25 also works. Ive been building 25, and its what Ive used to putthe finishing touches on this page with.I want to try to keep my Emacs up-to-date./p>/div>/div>div idoutline-container-sec-9-2 classoutline-3>h3 idsec-9-2>Emacs on Android/h3>div classoutline-text-3 idtext-9-2>p>I have drafted nearly 75% of this page on my Android tablet,using a bluetooth keyboard. The app that I used to get it is calledTermux./p>p>Its not perfect - Android seems to inelegantly kill processeswhen it uses too much memory./p>/div>/div>div idoutline-container-sec-9-3 classoutline-3>h3 idsec-9-3>Spacemacs/h3>div classoutline-text-3 idtext-9-3>p>Spacemacs allows you to quickly install a layer of packages with a single entry in the code>.spacemacs/code> file, a dotfile (a dotfile is a hidden config file in your home directory, Linux/Unix will hide it.)/p>p>Its super easy to install (assuming you have git and are in your home directory),if you already have a code>.emacs.d/code> directory, you should move it first:/p>div classorg-src-container>pre classsrc src-bash>git clone https://github.com/syl20bnr/spacemacs ~/.emacs.d/pre>/div>p>This gets you the latest spacemacs version and drops it right where your code>.emacs.d/code>directory should be (move your old one first, if you have one)./p>p>An example of a layer is code>python/code>. Adding that to your code>.spacemacs/code> dotfile causes emacs to ensure that you have over 20 packages installed that arerelevant to programming in Python, and that shouldnt conflict with each other./p>p>Troubleshooting Spacemacs: Sometimes things go wrong. Im not always sure why. The issue has usually been something to do with compiled emacs lisp (elisp)files becoming incompatible with each other. The fix has been pretty easy so far.Ive alternately uninstalled and reinstalled emacs, and deleted the elpa directoryfrom my .emacs.d directory, and when I relaunched emacs, then (almost) everythingreinstalled properly and works. /p>p>I was putting up with the UX issues to learn it better and expand my horizons.Ive gone back to regular emacs to learn more about emacs./p>/div>/div>div idoutline-container-sec-9-4 classoutline-3>h3 idsec-9-4>Orgmode/h3>div classoutline-text-3 idtext-9-4>p>Orgmode is a (now builtin) mode in Emacs that uses a hierarchical outlineformat to organize information in files. /p>p>Its a type of markdown, but its quite sophisticated as well. It can be used for writing material for publication or presentations, via pdf or web format./p>p>In fact, Im building this page with Orgmode./p>p>To use Orgmode, just open a file in Emacs with .org as the suffix, and start writing./p>/div>/div>/article>article idoutline-container-sec-10 classoutline-2>h2 idsec-10>Web Development/h2>div classoutline-text-2 idtext-10>p>Maybe blind leading the blind here, but theres a few directions I would point you at. /p>p>You can do web development with Python in several ways,there a couple of static site generators written in Python.To use these, youd write in a form of markdown (markdown looks like mostly plain text), thenthe generator would turn that into HTML with perhaps CSSand JS. Thats similar to what Ive done to create thispage, only Im using emacs instead of Python. /p>p>There are also more dynamic things you can do, like usingFlask and Django to provide APIs and interactive web-basedGUIs (Graphical User Interfaces)./p>p>However, to intelligently use these tools, you need to at least start learning about HTML, CSS, and Javascript./p>p>a hrefhttps://developer.mozilla.org/en-US/docs/Learn>Mozilla Developer Network has a great learning portal/a>with tutorials on all of these./p>p>a hrefhttp://www.w3schools.com/html/default.asp>W3 Schools/a> is typically in the top of the first Google resultson these topics, and they have fairly good tutorials as well./p>/div>div idoutline-container-sec-10-1 classoutline-3>h3 idsec-10-1>HTML Specific/h3>div classoutline-text-3 idtext-10-1>p>Its always good to learn good style early on./p>p>I would definitely pay an early visit to the a hrefhttps://google.github.io/styleguide/htmlcssguide.xml>Google HTML/CSS style guide/a>./p>p>If youre a pedant, like me, youll want to at least scan and know how to read a hrefhttps://developers.whatwg.org/>the developer HTML specification/a>./p>/div>/div>div idoutline-container-sec-10-2 classoutline-3>h3 idsec-10-2>CSS/h3>div classoutline-text-3 idtext-10-2>p>There are pretty good CSS references. W3 style/p>/div>/div>div idoutline-container-sec-10-3 classoutline-3>h3 idsec-10-3>Javascript/h3>div classoutline-text-3 idtext-10-3>p>The a hrefhttps://google.github.io/styleguide/javascriptguide.xml>Google Javascript Style Guide/a> is another resource./p>/div>/div>/article>/div>div idpostamble classstatus>p classauthor>Author: Aaron Hall/p>p classdate>Created: 2016-10-23 Sun 16:42/p>p classcreator>a hrefhttp://www.gnu.org/software/emacs/>Emacs/a> 25.1.50.1 (a hrefhttp://orgmode.org>Org/a> mode 8.2.10)/p>p classvalidation>a hrefhttp://validator.w3.org/check?urireferer>Validate/a>/p>/div>/body>/html>
Port 443
HTTP/1.1 200 OKConnection: keep-aliveContent-Length: 49094Server: GitHub.comContent-Type: text/html; charsetutf-8permissions-policy: interest-cohort()Last-Modified: Sun, 23 Oct 2016 20:43:26 GMTAccess-Control-Allow-Origin: *ETag: 580d20ee-bfc6expires: Sat, 24 Aug 2024 08:36:56 GMTCache-Control: max-age600x-proxy-cache: MISSX-GitHub-Request-Id: 5754:16BEC4:4E00324:501B95C:66C9994CAccept-Ranges: bytesAge: 0Date: Sat, 24 Aug 2024 08:26:56 GMTVia: 1.1 varnishX-Served-By: cache-bfi-krnt7300056-BFIX-Cache: MISSX-Cache-Hits: 0X-Timer: S1724488016.199911,VS0,VE72Vary: Accept-EncodingX-Fastly-Request-ID: 2e04a2618739f4d14421863ad39793d31b583362 !DOCTYPE html>html>head>title>Aaron Hall/title>!-- 2016-10-23 Sun 16:42 -->meta charsetutf-8>meta namegenerator contentOrg-mode>meta nameauthor contentAaron Hall>meta namekeywords contentlearning Python programming language Linux StackOverflow Stack Overflow GNU>style typetext/css> !--/*-->!CDATA/*>!--*/ .title { text-align: center; } .todo { font-family: monospace; color: red; } .done { color: green; } .tag { background-color: #eee; font-family: monospace; padding: 2px; font-size: 80%; font-weight: normal; } .timestamp { color: #bebebe; } .timestamp-kwd { color: #5f9ea0; } .right { margin-left: auto; margin-right: 0px; text-align: right; } .left { margin-left: 0px; margin-right: auto; text-align: left; } .center { margin-left: auto; margin-right: auto; text-align: center; } .underline { text-decoration: underline; } #postamble p, #preamble p { font-size: 90%; margin: .2em; } p.verse { margin-left: 3%; } pre { border: 1px solid #ccc; box-shadow: 3px 3px 3px #eee; padding: 8pt; font-family: monospace; overflow: auto; margin: 1.2em; } pre.src { position: relative; overflow: visible; padding-top: 1.2em; } pre.src:before { display: none; position: absolute; background-color: white; top: -10px; right: 10px; padding: 3px; border: 1px solid black; } pre.src:hover:before { display: inline;} pre.src-sh:before { content: sh; } pre.src-bash:before { content: sh; } pre.src-emacs-lisp:before { content: Emacs Lisp; } pre.src-R:before { content: R; } pre.src-perl:before { content: Perl; } pre.src-java:before { content: Java; } pre.src-sql:before { content: SQL; } table { border-collapse:collapse; } caption.t-above { caption-side: top; } caption.t-bottom { caption-side: bottom; } td, th { vertical-align:top; } th.right { text-align: center; } th.left { text-align: center; } th.center { text-align: center; } td.right { text-align: right; } td.left { text-align: left; } td.center { text-align: center; } dt { font-weight: bold; } .footpara:nth-child(2) { display: inline; } .footpara { display: block; } .footdef { margin-bottom: 1em; } .figure { padding: 1em; } .figure p { text-align: center; } .inlinetask { padding: 10px; border: 2px solid gray; margin: 10px; background: #ffffcc; } #org-div-home-and-up { text-align: right; font-size: 70%; white-space: nowrap; } textarea { overflow-x: auto; } .linenr { font-size: smaller } .code-highlighted { background-color: #ffff00; } .org-info-js_info-navigation { border-style: none; } #org-info-js_console-label { font-size: 10px; font-weight: bold; white-space: nowrap; } .org-info-js_search-highlight { background-color: #ffff00; color: #000000; font-weight: bold; } /*>*/-->/style>script typetext/javascript srchttp://orgmode.org/org-info.js>/** * * @source: http://orgmode.org/org-info.js * * @licstart The following is the entire license notice for the * JavaScript code in http://orgmode.org/org-info.js. * * Copyright (C) 2012-2013 Free Software Foundation, Inc. * * * The JavaScript code in this tag is free software: you can * redistribute it and/or modify it under the terms of the GNU * General Public License (GNU GPL) as published by the Free Software * Foundation, either version 3 of the License, or (at your option) * any later version. The code is distributed WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU GPL for more details. * * As additional permission under GNU GPL version 3 section 7, you * may distribute non-source (e.g., minimized or compacted) forms of * that code without the copy of the GNU GPL normally required by * section 4, provided you include this license notice and a URL * through which recipients can access the Corresponding Source. * * @licend The above is the entire license notice * for the JavaScript code in http://orgmode.org/org-info.js. * *//script>script typetext/javascript>/*@licstart The following is the entire license notice for theJavaScript code in this tag.Copyright (C) 2012-2013 Free Software Foundation, Inc.The JavaScript code in this tag is free software: you canredistribute it and/or modify it under the terms of the GNUGeneral Public License (GNU GPL) as published by the Free SoftwareFoundation, either version 3 of the License, or (at your option)any later version. The code is distributed WITHOUT ANY WARRANTY;without even the implied warranty of MERCHANTABILITY or FITNESSFOR A PARTICULAR PURPOSE. See the GNU GPL for more details.As additional permission under GNU GPL version 3 section 7, youmay distribute non-source (e.g., minimized or compacted) forms ofthat code without the copy of the GNU GPL normally required bysection 4, provided you include this license notice and a URLthrough which recipients can access the Corresponding Source.@licend The above is the entire license noticefor the JavaScript code in this tag.*/!--/*-->!CDATA/*>!--*/org_html_manager.set(TOC_DEPTH, 3);org_html_manager.set(LINK_HOME, );org_html_manager.set(LINK_UP, );org_html_manager.set(LOCAL_TOC, 1);org_html_manager.set(VIEW_BUTTONS, 0);org_html_manager.set(MOUSE_HINT, underline);org_html_manager.set(FIXED_TOC, 0);org_html_manager.set(TOC, 1);org_html_manager.set(VIEW, overview);org_html_manager.setup(); // activate after the parameters are set/*>*///-->/script>script typetext/javascript>/*@licstart The following is the entire license notice for theJavaScript code in this tag.Copyright (C) 2012-2013 Free Software Foundation, Inc.The JavaScript code in this tag is free software: you canredistribute it and/or modify it under the terms of the GNUGeneral Public License (GNU GPL) as published by the Free SoftwareFoundation, either version 3 of the License, or (at your option)any later version. The code is distributed WITHOUT ANY WARRANTY;without even the implied warranty of MERCHANTABILITY or FITNESSFOR A PARTICULAR PURPOSE. See the GNU GPL for more details.As additional permission under GNU GPL version 3 section 7, youmay distribute non-source (e.g., minimized or compacted) forms ofthat code without the copy of the GNU GPL normally required bysection 4, provided you include this license notice and a URLthrough which recipients can access the Corresponding Source.@licend The above is the entire license noticefor the JavaScript code in this tag.*/!--/*-->!CDATA/*>!--*/ function CodeHighlightOn(elem, id) { var target document.getElementById(id); if(null ! target) { elem.cacheClassElem elem.className; elem.cacheClassTarget target.className; target.className code-highlighted; elem.className code-highlighted; } } function CodeHighlightOff(elem, id) { var target document.getElementById(id); if(elem.cacheClassElem) elem.className elem.cacheClassElem; if(elem.cacheClassTarget) target.className elem.cacheClassTarget; }/*>*///-->/script>/head>body>div idcontent>h1 classtitle>Aaron Hall/h1>nav idtable-of-contents>h2>Table of Contents/h2>div idtext-table-of-contents>ul>li>a href#sec-1>About Me/a>/li>li>a href#sec-2>My story/a>/li>li>a href#sec-3>Talks/a>/li>li>a href#sec-4>Stack Overflow/a>ul>li>a href#sec-4-1>The Best Answers/a>/li>li>a href#sec-4-2>My Best Answers/a>/li>li>a href#sec-4-3>Data types and their methods/a>/li>li>a href#sec-4-4>Procedural Programming & Modules/a>/li>li>a href#sec-4-5>Functional Programming/a>/li>li>a href#sec-4-6>Object Oriented Programming (OOP)/a>/li>li>a href#sec-4-7>Putting it all together/a>/li>/ul>/li>li>a href#sec-5>How to contribute on Stack Overflow/a>ul>li>a href#sec-5-1>Improving others posts/a>/li>li>a href#sec-5-2>Answering Questions/a>/li>li>a href#sec-5-3>Asking Questions/a>/li>li>a href#sec-5-4>Moderation activities/a>/li>/ul>/li>li>a href#sec-6>Linux/a>ul>li>a href#sec-6-1>My Linux Story/a>/li>li>a href#sec-6-2>To install Linux/a>/li>/ul>/li>li>a href#sec-7>How to get started with Python/a>ul>li>a href#sec-7-1>Some Python best practices/a>/li>li>a href#sec-7-2>python.org and pip/a>/li>li>a href#sec-7-3>Anaconda/a>/li>/ul>/li>li>a href#sec-8>How to learn Python/a>ul>li>a href#sec-8-1>Do the official tutorial/a>/li>li>a href#sec-8-2>Read the Library Reference/a>/li>li>a href#sec-8-3>Read the Language Reference/a>/li>li>a href#sec-8-4>Read the PEPs and the Source code/a>/li>/ul>/li>li>a href#sec-9>Emacs - Spacemacs & Orgmode/a>ul>li>a href#sec-9-1>Which Emacs version to use/a>/li>li>a href#sec-9-2>Emacs on Android/a>/li>li>a href#sec-9-3>Spacemacs/a>/li>li>a href#sec-9-4>Orgmode/a>/li>/ul>/li>li>a href#sec-10>Web Development/a>ul>li>a href#sec-10-1>HTML Specific/a>/li>li>a href#sec-10-2>CSS/a>/li>li>a href#sec-10-3>Javascript/a>/li>/ul>/li>/ul>/div>/nav>style>body { background-color: black; color: lightgrey; width: 50em; margin:0px auto auto auto;}a { color: lightblue;}h2, h3 { padding-left: 10px; margin-left: auto; margin-right: auto;}.outline-text-2, .outline-text-3 { margin-left: auto; margin-right: auto; width: 40em; padding-left: 16px;}/style> article idoutline-container-sec-1 classoutline-2>h2 idsec-1>About Me/h2>div classoutline-text-2 idtext-1>p>This page is about stuff Im interested in and that I think you might beinterested in if you know me, want to learn more about me, or are interestedin the same types of things that Im interested in. /p>p>Im interested in:/p>ul classorg-ul>li>Programming with Python and Linux/li>li>Emacs and Orgmode/li>li>Computer Science, Economics, and Business/li>/ul>p>Its intended to be a high-level overview. Please search Google orfollow the links I give if you want to learn more./p>/div>/article>article idoutline-container-sec-2 classoutline-2>h2 idsec-2>My story/h2>div classoutline-text-2 idtext-2>ul classorg-ul>li>National Merit Scholar/li>li>Graduated with 169 credit hours, BS Political Science & Real Estate/li>li>Financial Advisor with Ameriprise and Merrill Lynch/li>li>Spent a year in a Finance PhD program, but did an MBA instead/li>li>Moved to NYC, got involved in the local tech meetup scene/li>li>Assistant Director of a non-profit, Business Professor, IT guy /li>li>Got hired to write Python at a bank/li>li>Started answering Python questions on Stack Overflow - now in top 1% of users./li>li>Teaching Python at a few Universities now./li>/ul>/div>/article>article idoutline-container-sec-3 classoutline-2>h2 idsec-3>Talks/h2>div classoutline-text-2 idtext-3>p>Ive given a number of talks on Python at Meetups and Conventions - Ill try to link to their material here as much as I can. /p>ul classorg-ul>li>Learning Python with Best Practices (given at NYC Python)/li>li>Python Best Practices (NYC Python)/li>li>Linear Models with Python (PyGotham 2014)/li>li>The Python Data Model, when and how to write Objects (PyGotham 2015 - available on a hrefhttps://www.youtube.com/watch?viGfggZqXmB0>Youtube/a>)/li>li>Functional Programming with Python (NYC Python)/li>li>Python by Aaron Hall (N Languages Meetup (video pending review!)/li>li>Best Practices for Reusable Python (PyGotham 2016 (video coming soon))/li>li>OOP Panel TODO complete/li>/ul>/div>/article>article idoutline-container-sec-4 classoutline-2>h2 idsec-4>Stack Overflow/h2>div classoutline-text-2 idtext-4>p>Dont learn Python by reading answers on Stack Overflow. /p>p>Ok, you can learn some things, but you may find you need to later unlearn things. /p>p>However, it is probably safe to read answers written by yours truly./p>p>I have written a lot of answers to questions on StackOverflow. Mymotivation is usually my dissatisfaction with the accepted answerand other top answers on the question. I try to write what I consider to be outstanding answers to the questions./p>p>What makes an outstanding answer? To me, answers that are technically precise,demonstrably correct, and directly communicate the important points are great answers./p>/div>div idoutline-container-sec-4-1 classoutline-3>h3 idsec-4-1>The Best Answers/h3>div classoutline-text-3 idtext-4-1>p>On Stack Overflow, they advertise that the best answers rise to the top.This condition does not always hold. New great answers are still ranked (by default) way below answers that have been there for years,and yet have only gathered a few votes. This issue could be addressed by allowing users to sort by recent votes, but this featuremay never appear./p>/div>/div>div idoutline-container-sec-4-2 classoutline-3>h3 idsec-4-2>My Best Answers/h3>div classoutline-text-3 idtext-4-2>aside>p>Im in the top .5% of all time (actually top .36% as of this writing,but whos keeping score?) on Stack Overflow./p>a hrefhttp://stackoverflow.com/users/541136/aaron-hall?tabprofile> img srchttp://stackoverflow.com/users/flair/541136.png?themedark width208 height58 altprofile for Aaron Hall at Stack Overflow, for professional and enthusiast programmers > /img>/a>/aside>p>My top a hrefhttp://stackoverflow.com/users/541136/aaron-hall?tabanswers&sortvotes>100 or so answers/a> are probably worth reading. Ive kinda organized my answers with over 8 upvotes here./p>p>Note that Im linking to the questions,not specifically my answers, so use Ctrl-f and search for my name to find my answers. /p>p>Also note that the stated ethos of the site is that the best answers rise to the top. /p>p>It can actually take years for new best answers to rise to the top./p>p>We can improve the speed of the sorting algorithm by voting up good answersand voting down poor ones. So while youre reading content on Stack Overflow, remember to b>vote early and often/b>./p>/div>/div>div idoutline-container-sec-4-3 classoutline-3>h3 idsec-4-3>Data types and their methods/h3>div classoutline-text-3 idtext-4-3>p>These are some of my answers on how to use Pythons builtin data-types./p>p>Dictionaries are mappings of keys to values (implemented as hash tables). So the keys must be hashable./p>p>Lists and tuples are essentially arrays of pointers to objects. Lists are mutable, they can be changed - but tuples are not./p>p>Since lists are mutable, you cant use them in keys for dicts. But you can use tuples. /p>ul classorg-ul>li>a hrefhttp://stackoverflow.com/q/1024847/541136>Add a key to a Python dictionary/a>/li>li>a hrefhttp://stackoverflow.com/q/38987/541136>How to merge two Python dictionaries in a single expression?/a>/li>li>a hrefhttp://stackoverflow.com/q/252703/541136>Difference between the list methods append and extend/a>/li>li>a hrefhttp://stackoverflow.com/q/2612802/541136>Clone or copy a list/a>/li>li>a hrefhttp://stackoverflow.com/q/1712227/541136>How to get the size of a list/a>/li>li>a hrefhttp://stackoverflow.com/q/22741068/541136>Remove identical items from a list and sort it/a>/li>li>a hrefhttp://stackoverflow.com/q/8537916/541136>Prepend to a list/a>/li>li>a hrefhttp://stackoverflow.com/q/509211/541136>Explain slice notation/a> - essentially list, string, and tuple code>__getitem__/code> method usage./li>li>a hrefhttp://stackoverflow.com/q/646644/541136>Get the last items of a list/a>/li>li>a hrefhttp://stackoverflow.com/q/2970608/541136>What are named tuples?/a>/li>li>a hrefhttp://stackoverflow.com/q/931092/541136>Reverse a string/a>/li>li>a hrefhttp://stackoverflow.com/q/6797984/541136>Convert a string to lowercase/a>/li>li>a hrefhttp://stackoverflow.com/q/3437059/541136>Does Python have a string contains method?/a>/li>li>a hrefhttp://stackoverflow.com/q/21718345/541136>Determine if a list of words exists in a string/a>/li>li>a hrefhttp://stackoverflow.com/q/493819/541136>Why is it str.join(list) instead of list.join(str)?/a>/li>li>a hrefhttp://stackoverflow.com/q/37903317/541136>Is there a constant for Unicode whitespace?/a>/li>li>a hrefhttp://stackoverflow.com/q/21542694/541136>Difference between using commas, concatenation, and string formatters/a> - printing options (note that there is a really good example of how not to answer on Stack Overflowhere. The advice given is perfectly correct, but its barely a single complete sentence,its written in a very informal style, and as a result, it has 0 upvotes. The usersits at 1 reputation point as well.)/li>li>a hrefhttp://stackoverflow.com/q/230751/541136>Flush the output of code>print/code>/a>/li>li>a hrefhttp://stackoverflow.com/q/4760215/541136>Run a shell command from Python/a>/li>li>a hrefhttp://stackoverflow.com/q/415511/541136>Getting the current time/a>/li>li>a hrefhttp://stackoverflow.com/q/82831/541136>Check whether a file exists/a>/li>li>a hrefhttp://stackoverflow.com/q/4510640/541136>Check if directory exists and create it if necessary/a>/li>li>a hrefhttp://stackoverflow.com/q/1267869/541136>Force division to be floating point/a>/li>/ul>/div>/div>div idoutline-container-sec-4-4 classoutline-3>h3 idsec-4-4>Procedural Programming & Modules/h3>div classoutline-text-3 idtext-4-4>p>The answers I have on these questions cover importantidiomatic statements and control flow in Python./p>ul classorg-ul>li>a hrefhttp://stackoverflow.com/q/44834/541136%20>Modules code>__all__/code>/a>/li>li>a hrefhttp://stackoverflow.com/q/419163/541136>What does code>if __name__ “__main__”:/code> do?/a>/li>li>a hrefhttp://stackoverflow.com/q/394809/541136>Ternary conditional operator/a>/li>li>a hrefhttp://stackoverflow.com/q/522563/541136>Accessing the index in Python for loops/a>/li>li>a hrefhttp://stackoverflow.com/q/36106712/541136>Limit iterations of an enumerated loop/a>/li>li>a hrefhttp://stackoverflow.com/q/2052390/541136>Manually raising (throwing) an exception in Python/a>/li>li>a hrefhttp://stackoverflow.com/q/21553327/541136>Why is “except: pass” a bad programming practice?/a>/li>li>a hrefhttp://stackoverflow.com/q/730764/541136>How do you properly ignore exceptions/a>/li>li>a hrefhttp://stackoverflow.com/q/6470428/541136>Catch multiple exceptions in one line/a>/li>li>a hrefhttp://stackoverflow.com/q/3702675/541136>Print the full traceback without halting the program/a>/li>li>a hrefhttp://stackoverflow.com/q/855759/541136>Intended use of the optional code>else/code> clause of the code>try/code> statement?/a>/li>li>a hrefhttp://stackoverflow.com/q/16138232/541136>Good practice to use try-except-else(-finally)?/a>/li>/ul>/div>/div>div idoutline-container-sec-4-5 classoutline-3>h3 idsec-4-5>Functional Programming/h3>div classoutline-text-3 idtext-4-5>p>These answers will cover creation and usage of functions./p>p>In Python, everything is an object. Functions are also objects.That makes it easy to make functions first class citizens./p>p>Functions are instantiated by function definitions and lambda statements.I recommend function definitions over lambdas in Python. Lambdas are basically severely limited functions - they dont know their name or have a docstring, and you can only give them a simple statementto return./p>p>Note also that list comps and generator expressions have subsumedmap and filter in Python./p>ul classorg-ul>li>a hrefhttp://stackoverflow.com/q/22439752/541136>Local versus global variables/a>/li>li>a hrefhttp://stackoverflow.com/q/423379/541136>Using global variables in a function other than the one that created them/a>/li>li>a hrefhttp://stackoverflow.com/q/2776829/541136>Difference between Generators and Iterators/a>/li>li>a hrefhttp://stackoverflow.com/q/3459098/541136>Create List of Single Item Repeated n Times/a>/li>li>a hrefhttp://stackoverflow.com/q/209840/541136>Map two lists into a dictionary/a>/li>li>a hrefhttp://stackoverflow.com/q/36901/541136>Arguments, code>*args/code> and code>**kwargs/code> for parameters/a>/li>li>a hrefhttp://stackoverflow.com/q/492519/541136>Timeout on a function call/a>/li>li>a hrefhttp://stackoverflow.com/q/31822190/541136>How does the @timeout(timelimit) decorator work?/a>/li>li>a hrefhttp://stackoverflow.com/q/36917042/541136>Pairwise circular for loop/a>/li>li>a hrefhttp://stackoverflow.com/q/231767/541136>What does the code>yield/code> keyword do?/a>/li>li>a hrefhttp://stackoverflow.com/q/494594/541136>How to write the Fibonacci sequence/a>/li>/ul>/div>/div>div idoutline-container-sec-4-6 classoutline-3>h3 idsec-4-6>Object Oriented Programming (OOP)/h3>div classoutline-text-3 idtext-4-6>p>These Q&As relate to the fact that in Python,everything is an object. That includes integers./p>p>Most all objects have methods that you as a user are intended to use. They all have special methodsthat start with double beginning and ending underscores.These are sometimes called dunder methods becauseof that./p>ul classorg-ul>li>a hrefhttp://stackoverflow.com/q/306313/541136>“is” operator behaves unexpectedly with integers/a>/li>li>a hrefhttp://stackoverflow.com/q/1606436/541136>Adding docstrings to namedtuples/a>/li>li>a hrefhttp://stackoverflow.com/q/735975/541136>Static methods/a>/li>li>a hrefhttp://stackoverflow.com/q/136097/541136>What is the difference between @staticmethod and @classmethod/a>/li>li>a hrefhttp://stackoverflow.com/q/24253761/541136>Call an instance of an object/a> /li>li>a href//stackoverflow.com/q/635483/541136>Best way to implement nested dictionaries/a> - demonstrates allowinginheritance (subclassers) to elegantly change behavior./li>li>a hrefhttp://stackoverflow.com/q/860245/541136>Difference between a mixin and inheritance/a>/li>li>a hrefhttp://stackoverflow.com/q/21361106/541136>Implement a dict with Abstract Base Classes/a>/li>li>a hrefhttp://stackoverflow.com/q/222877/541136>How to use code>super/code>/a> - dependency injection, /li>li>a hrefhttp://stackoverflow.com/q/576169/541136>Understanding Python code>super()/code> with code>__init__()/code> methods/a>/li>li>a hrefhttp://stackoverflow.com/q/472000/541136>When and how to use code>__slots__/code>/a>(Note that this is a huge example, in my mind, of where Stack Overflow fails to meet its promise that the best answers rise to the top. The accepted answerer actually says he wants my answer to be accepted.)/li>li>a hrefhttp://stackoverflow.com/q/449560/541136>How do I determine the size of an object in Python/a>/li>li>a hrefhttp://stackoverflow.com/q/5626193/541136>What is a monkey-patch?/a> /li>li>a hrefhttp://stackoverflow.com/q/37601644/541136>Whats the Enum type good for?/a>/li>li>a hrefhttp://stackoverflow.com/q/1436703/541136>Difference between code>__str__/code> and code>__repr__/code>/a>/li>li>a hrefhttp://stackoverflow.com/q/4352244/541136>Implement code>__ne__/code> in terms of code>__eq__/code>?/a>/li>li>a hrefhttp://stackoverflow.com/q/372042/541136>Difference between Abstract Class and Interface/a> - (there is none!)/li>li>a hrefhttp://stackoverflow.com/q/3798835/541136>Understanding code>__get__/code> and code>__set__/code> and Python descriptors/a>/li>/ul>/div>/div>div idoutline-container-sec-4-7 classoutline-3>h3 idsec-4-7>Putting it all together/h3>div classoutline-text-3 idtext-4-7>p>These Q&As combine multiple elements from the above categories.They dont fit very neatly in the prior sections./p>p>These are also a bit advanced./p>ul classorg-ul>li>a hrefhttp://stackoverflow.com/q/972/541136>Adding a method to an existing object instance/a> (Do not usually do this, but how is instructive.)/li>li>a hrefhttp://stackoverflow.com/q/449560/541136>Determine the size of an object/a> /li>li>a hrefhttp://stackoverflow.com/q/1319615/541136>Proper way to declare custom exceptions/a>/li>li>a hrefhttp://stackoverflow.com/q/129507/541136>Test that a function throws an exception/a>/li>li>a hrefhttp://stackoverflow.com/q/32770762/541136>Optimization break-even point/a>/li>li>a hrefhttp://stackoverflow.com/q/23663231/541136>Does enumerate produce a generator object?/a>/li>/ul>/div>/div>/article>article idoutline-container-sec-5 classoutline-2>h2 idsec-5>How to contribute on Stack Overflow/h2>div classoutline-text-2 idtext-5>p>It can be hard. Its competitive. Theyve gamified answering questions. They have a b>lot/b> of new people all the time and to limit damage a new account can cause, you get privileges (like commenting on others posts) incrementally as you earn reputation points (rep)./p>p>You do start off being able to ask and answer questions, and being able to submitedits for review. If edits are approved, you get 2 rep. If your questionis upvoted, you get 5 rep. If your answer is upvoted, you get 10 rep.If your answer is accepted by the asker, you get 15 rep. Sometimes bounties are offered on questions.Theres a rep cap of 200 per day, but accepts and bounties dont count toward the cap./p>/div>div idoutline-container-sec-5-1 classoutline-3>h3 idsec-5-1>Improving others posts/h3>div classoutline-text-3 idtext-5-1>p>Edits are an easy way to get over the early participation hurdles. So pull out Strunk and White,and get to fixing spelling and grammar errors, and removing cruft like sign-offs and apologies. Do i>not/i> change code (except to fix formatting), or change the meaning of answers,(unless its i>your/i> answer)./p>/div>/div>div idoutline-container-sec-5-2 classoutline-3>h3 idsec-5-2>Answering Questions/h3>div classoutline-text-3 idtext-5-2>p>Next, answer questions. Its easier than asking. Almost all the good questions have been asked./p>p>Not all of the good answers have been given. /p>p>You can try to earn rep fast by answering new questions that are liable to be closed as dupes and see maybe 100 views over the next decade. Or you can try to write really good canonical answers to canonicalquestions, like me./p>p>To get upvotes, consider Socrates on persuasion - you need ethos, pathos, and logos./p>ul classorg-ul>li>Logos: This is logic and evidence. Better communication of logic and evidence willgreatly help you succeed on the site, especially when youre starting with nothing.With code, its usually easy to demonstrate you have something that works, butyou still need to back up your recommendations with strong and readily acceptable reasoning. /li>li>Pathos: This is how you say what you say. For a speaker, its the emotion conveyedby the words. A disconnect can hurt you. If you have a strong tone (and youre right), youll usually get more upvotes. I have a personal bias against tone. Thisprobably hurts me, when I say dont do this instead of saying i>I mean really never ever do this/i>./li>li>Ethos: This the credibility of the speaker/author. The major source of credibility on Stack Overflow is your reputation point count.(Unless perhaps you have widespread recognition as an expert on the topic at hand.)For better or worse, you can get away with less of logos and pathos if you have ethos.Im sure I have some material that now benefits from my higher reputation count,but in the beginning, everything I posted was greeted with scepticism and requiredmy appeals to logos to carry it./li>/ul>p>a hrefhttp://stackoverflow.com/q/21542694/541136>The last answer here/a> is a really good example of how not to answer on Stack Overflow. The advice given is perfectly correct, but its barely a single complete sentence,its written in a very informal style, and as a result, it has 0 upvotes. The usersits at 1 reputation point as well. No ethos, pathos, or logos./p>/div>/div>div idoutline-container-sec-5-3 classoutline-3>h3 idsec-5-3>Asking Questions/h3>div classoutline-text-3 idtext-5-3>p>Some people have had a lot of success in asking good questions. Not me. If you manage to create a formula for demonstrable success in asking questions, let me know how. /p>p>Top answerers have written long explanations about how to ask good questions. But they dont ask questions. I dont find their advice to be particularly helpful./p>p>The community is frequently capricious, unhelpful, and rude - especially to newcomers, but also even to me when Ive asked questions./p>p>However, heres some guidelines to help improve your odds./p>ul classorg-ul>li>Dont give them an excuse to close your question.Read the help and the rules for the site carefully. If any portionof your question is off-topic (like asking for resources), they will likely vote to close/delete your question.Dont mention wanting a resource. Just dont do it./li>li>Dont apologize, explain why you dont know something,go on about how new you are, thank them in advance (its implied anyways), orsign-off your question (your name is on your post).That stuff is considered noise. All that matters is the question itself./li>li>Dont write a wall of text. Write so that you are understandable at a 3rd grade level (or below if you can). Separate each sentence, one per paragraph. Bold the actual question. Phrase it as a question.Use a question mark. Use a grammar and a spell check on your English.The less you make the answerers think and think critical things about your question, the better./li>li>Be super nice. Show some research effort. Use code to demonstrate what youre talking about. Make your example as small as possible. Show what you haveto work with, and what you expect the output to be.Dont ask them to code for you./li>/ul>p>I dont know what else to tell you. If you make a good-faitheffort to follow the guidelines Ive given in submitting a question, you may still have incompetent people try to shutyour question down. Just stay positive, keep looking for theanswer yourself, and if you can find it, feel free to answer your own question. /p>/div>/div>div idoutline-container-sec-5-4 classoutline-3>h3 idsec-5-4>Moderation activities/h3>div classoutline-text-3 idtext-5-4>p>Stack Overflow also tracks your moderating activities, and awards you with badges at certain points. The moderationtools become more available to you as you earn reputation.(See privileges.)/p>p>When you earn access to these tools, remember how you were treated, and try to raise the bar in your treatment of others./p>p>The easiest way to improve others experiences on the siteis to fix obvious and fixable problems with their questions.(See the prior section on asking questions.) Again,that gives you +2 rep for accepted edits. If youre conscientious,you will likely have some edits rejected that should have beenaccepted - just remain conscientious and continue improving content, and you will be rewarded over the long run./p>p>You can also participate (as you earn the privilege)in reviewing posts. Be conscientious if you do./p>p>If the community, a moderator,or the system tells you youre wrong, then youre (99.9%of the time) wrong by definition. Happily accept your wrongness, try to learn from it, and continue helping as you can. If you get temporarily banned from the review queue from time to time, take a break and come back when your ban is up./p>p>Remember, its all just internet points, which probably wontbe worth anything ever. Maybe something when the singularityhits and AI takes over, but I dont see that happening any timesoon, so you have plenty of time until then. (I would thinkthat StackOverflows internet points would be the most valuable,at that point.)/p>/div>/div>/article>article idoutline-container-sec-6 classoutline-2>h2 idsec-6>Linux/h2>div classoutline-text-2 idtext-6>p>If you like to have as much control of your operating system as possible,I highly recommend installing a distribution of Linux, like Ubuntu,Debian, or Fedora./p>/div>div idoutline-container-sec-6-1 classoutline-3>h3 idsec-6-1>My Linux Story/h3>div classoutline-text-3 idtext-6-1>p>Although I always used their software, Ive always been very frustrated with Microsofts opacity and lack of documentation./p>p>I have been aware of Linux since the early 90s,(with all the computer magazines in the computer software stores, whocould miss the penguin and inquire about him)./p>p>I was told, Use Windows if you want to learn how Windows works.If you want to learn how computers work, use Linux./p>p>After much study, ensuring I had the software I needed (office and developmentsoftware, basically everything but games) I decided to install Linux. /p>p>I started by dual booting Linux and Windows, and when I found that I was only rarely using Windows at all, I began to only access Windowsfrom a virtual machine./p>/div>/div>div idoutline-container-sec-6-2 classoutline-3>h3 idsec-6-2>To install Linux/h3>div classoutline-text-3 idtext-6-2>p>Installing Linux is fairly simple./p>ol classorg-ol>li>Create a bootable thumbdrive or CD (google for code>unetbootin/code>)./li>li>Boot the computer you want to install it on from that./li>li>Follow the instructions to install it./li>/ol>p>Note that if youre not careful, or even if you are and something goes wrong, you could wipe any other operating systemsyou may have installed (like Windows). So backup your data./p>p>If you want to dual boot, its a little more complicated,but Ubuntus current installer seems to handle it well../p>p>I much prefer to run Windows in a virtual machine (which is really easy)./p>/div>/div>/article>article idoutline-container-sec-7 classoutline-2>h2 idsec-7>How to get started with Python/h2>div classoutline-text-2 idtext-7>p>If this topic interests you, youre either new to Python,helping others new to Python, or second guessing your current setup./p>p>There are a couple of ways to do this. If youre just beginning with PythonId recommend you download and use the Anaconda distribution./p>p>If youre doing this for work, do what your boss says. If yourethe boss, and youre checking this out, your people should probablybe using pip with virtual environments - unless theyve worked out somethingfar more sophisticated./p>/div>div idoutline-container-sec-7-1 classoutline-3>h3 idsec-7-1>Some Python best practices/h3>div classoutline-text-3 idtext-7-1>p>Read a hrefhttps://www.python.org/dev/peps/pep-0008/>PEP 8/a> and the a hrefhttps://google.github.io/styleguide/pyguide.html>Google Python Style Guide/a>. /p>p>Heres some thoughts of how to write good Python./p>p>When writing a script, give it a docstring, and put the mainstuffin a code>main()/code> function. Do the future imports for Python 2 and 3 compatibility, (code>unicode_literals/code> if its a hrefhttp://python-future.org/unicode_literals.html>new code/a>)./p>p>e.g. in script.py:/p>div classorg-src-container>pre classsrc src-python>span classlinenr> 1: /span>Explain purpose for script.py herespan classlinenr> 2: /span>from __future__ import print_function, division, absolute_import, unicode_literalsspan classlinenr> 3: /span>span classlinenr> 4: /span>from something import main_stuff # dont import * span classlinenr> 5: /span># if following a tutorial, import the module and do dotted lookups.span classlinenr> 6: /span>span classlinenr> 7: /span>def main():span classlinenr> 8: /span> main_stuff()span classlinenr> 9: /span>span classlinenr>10: /span>if __name__ __main__:span classlinenr>11: /span> main()/pre>/div>p>The main could then be imported into other /p>/div>/div>div idoutline-container-sec-7-2 classoutline-3>h3 idsec-7-2>python.org and pip/h3>div classoutline-text-3 idtext-7-2>p>You can also get Python from the a hrefhttps://www.python.org>official site/a>.If you go that route, youll want to use pip to install packages. /p>p>People used to have trouble installing libraries withcompiled C extensions with pip, but I understand that thisis now improved./p>p>You should be careful toonly use it to install to your user area. I understand Ubuntudoes this for pip by default, but other operating systems might not be so thoughtful./p>p>You should probably use pip with virtual environments. There are lots of great tutorials on how to do that./p>/div>/div>div idoutline-container-sec-7-3 classoutline-3>h3 idsec-7-3>Anaconda/h3>div classoutline-text-3 idtext-7-3>p>a hrefhttps://www.continuum.io/downloads>Anaconda/a> installs a new Python in your user area, along withmany other commonly used libraries. I like it for teaching andfor beginners because its a one-shot install of most things you want, and a one-shot remove if you dont like it./p>p>It comes with /p>ul classorg-ul>li>lots of packages not already in the standard library, for example: numpy, pandas, requests, and flask./li>li>a package manager that can install other things: conda - it can even install R too. /li>li>an IDE: SPyDEr (should work out of the box without configuration, too.)/li>li>Jupyter Notebook - a local app that lets you run Python (andother interactive languages) in your browser./li>/ul>/div>/div>/article>article idoutline-container-sec-8 classoutline-2>h2 idsec-8>How to learn Python/h2>div classoutline-text-2 idtext-8>p>As a best practice, I recommend using a hrefhttp://docs.python.org>the official docs/a>.If youre just learning, I think starting with Python 3 is just fineunless you expect to be working somewhere that is on Python 2 for the near future./p>p>Its easy to learn the difference, at which point youll know both./p>p>If you b>really/b> study the commonly used stuff, and at least become awareof the things you dont know, youll be a capable Python programmer before you know it./p>p>Consider the below items only slightly ordered, and dont let being blocked on anyone item prevent you from going on to the next./p>p>Alternatively, you could pre-order the book I intend to write. Nothing like impatient customersto drive me to write about Python./p>/div>div idoutline-container-sec-8-1 classoutline-3>h3 idsec-8-1>Do the official tutorial/h3>div classoutline-text-3 idtext-8-1>p>Start at a hrefhttp://docs.python.org/tutorial/introduction>Chapter 3, The Introduction/a>. The first chapter is trivial, and the second chapter is probably gobbledygook to anyone new to programming./p>p>Keep going through the chapters and youll get exposed to some of the builtin standard library./p>/div>/div>div idoutline-container-sec-8-2 classoutline-3>h3 idsec-8-2>Read the Library Reference/h3>div classoutline-text-3 idtext-8-2>p>Start with the a hrefhttp://docs.python.org/library/functions>builtins/a> (chapter 2 of the Library Reference). Chapter one is trivial./p>p>Learn the builtin functions. If youre ambitious, memorize theirsignatures (that is, the arguments that they take.) /p>p>Many of the builtin functions are actually types that can be used to type check and can be subclassed, in addition to instantiation./p>p>code>__import__/code> is mostly kept around for backwards compatibility.Dont bother using it./p>/div>/div>div idoutline-container-sec-8-3 classoutline-3>h3 idsec-8-3>Read the Language Reference/h3>div classoutline-text-3 idtext-8-3>p>This doc includes comprehensive overviews of expressions, and statements for control flow, importing, etc. /p>p>I like to point beginners directly at the a hrefhttp://docs.python.org/reference/grammar.html>grammar file/a>./p>/div>/div>div idoutline-container-sec-8-4 classoutline-3>h3 idsec-8-4>Read the PEPs and the Source code/h3>div classoutline-text-3 idtext-8-4>p>The a hrefhttp://www.python.org/dev/peps/>PEPs/a> are Python Enhancement Proposals (like Requests For Change, but we dont like breakingchanges in Python.)/p>p>I highly recommend beginners to Python read a hrefhttp://www.python.org/dev/peps/pep-0008/>PEP 8/a> early. Others can come later./p>p>The source code is viewable on a hrefhttps://github.com/python/cpython>github/a>. Start by reading the Python in the Lib directory.Then move on to the C code in other directories (Python, Objects, Modules, Include) /p>/div>/div>/article>article idoutline-container-sec-9 classoutline-2>h2 idsec-9>Emacs - Spacemacs & Orgmode/h2>div classoutline-text-2 idtext-9>p>Here I describe my personal (not usually for work) development environment./p>p>For me, its highly experimental, and very configuration heavy./p>p>Its not super sophisticated - its just for home use - butI invest in learning it now so that Ill always be able to leverageit in the future./p>aside>p>(At work I have a custom built IDE that uses Python to tie together UI elements built in C++ and integrates version control and reviews. Id like my emacs setup to reflect that kind of efficiency one day.)/p>/aside>/div>div idoutline-container-sec-9-1 classoutline-3>h3 idsec-9-1>Which Emacs version to use/h3>div classoutline-text-3 idtext-9-1>p>You can get a a hrefhttps://www.gnu.org/software/emacs/download.html>recent version of emacs here/a>./p>p>I have been using Emacs 24.5, but Emacs 25 also works. Ive been building 25, and its what Ive used to putthe finishing touches on this page with.I want to try to keep my Emacs up-to-date./p>/div>/div>div idoutline-container-sec-9-2 classoutline-3>h3 idsec-9-2>Emacs on Android/h3>div classoutline-text-3 idtext-9-2>p>I have drafted nearly 75% of this page on my Android tablet,using a bluetooth keyboard. The app that I used to get it is calledTermux./p>p>Its not perfect - Android seems to inelegantly kill processeswhen it uses too much memory./p>/div>/div>div idoutline-container-sec-9-3 classoutline-3>h3 idsec-9-3>Spacemacs/h3>div classoutline-text-3 idtext-9-3>p>Spacemacs allows you to quickly install a layer of packages with a single entry in the code>.spacemacs/code> file, a dotfile (a dotfile is a hidden config file in your home directory, Linux/Unix will hide it.)/p>p>Its super easy to install (assuming you have git and are in your home directory),if you already have a code>.emacs.d/code> directory, you should move it first:/p>div classorg-src-container>pre classsrc src-bash>git clone https://github.com/syl20bnr/spacemacs ~/.emacs.d/pre>/div>p>This gets you the latest spacemacs version and drops it right where your code>.emacs.d/code>directory should be (move your old one first, if you have one)./p>p>An example of a layer is code>python/code>. Adding that to your code>.spacemacs/code> dotfile causes emacs to ensure that you have over 20 packages installed that arerelevant to programming in Python, and that shouldnt conflict with each other./p>p>Troubleshooting Spacemacs: Sometimes things go wrong. Im not always sure why. The issue has usually been something to do with compiled emacs lisp (elisp)files becoming incompatible with each other. The fix has been pretty easy so far.Ive alternately uninstalled and reinstalled emacs, and deleted the elpa directoryfrom my .emacs.d directory, and when I relaunched emacs, then (almost) everythingreinstalled properly and works. /p>p>I was putting up with the UX issues to learn it better and expand my horizons.Ive gone back to regular emacs to learn more about emacs./p>/div>/div>div idoutline-container-sec-9-4 classoutline-3>h3 idsec-9-4>Orgmode/h3>div classoutline-text-3 idtext-9-4>p>Orgmode is a (now builtin) mode in Emacs that uses a hierarchical outlineformat to organize information in files. /p>p>Its a type of markdown, but its quite sophisticated as well. It can be used for writing material for publication or presentations, via pdf or web format./p>p>In fact, Im building this page with Orgmode./p>p>To use Orgmode, just open a file in Emacs with .org as the suffix, and start writing./p>/div>/div>/article>article idoutline-container-sec-10 classoutline-2>h2 idsec-10>Web Development/h2>div classoutline-text-2 idtext-10>p>Maybe blind leading the blind here, but theres a few directions I would point you at. /p>p>You can do web development with Python in several ways,there a couple of static site generators written in Python.To use these, youd write in a form of markdown (markdown looks like mostly plain text), thenthe generator would turn that into HTML with perhaps CSSand JS. Thats similar to what Ive done to create thispage, only Im using emacs instead of Python. /p>p>There are also more dynamic things you can do, like usingFlask and Django to provide APIs and interactive web-basedGUIs (Graphical User Interfaces)./p>p>However, to intelligently use these tools, you need to at least start learning about HTML, CSS, and Javascript./p>p>a hrefhttps://developer.mozilla.org/en-US/docs/Learn>Mozilla Developer Network has a great learning portal/a>with tutorials on all of these./p>p>a hrefhttp://www.w3schools.com/html/default.asp>W3 Schools/a> is typically in the top of the first Google resultson these topics, and they have fairly good tutorials as well./p>/div>div idoutline-container-sec-10-1 classoutline-3>h3 idsec-10-1>HTML Specific/h3>div classoutline-text-3 idtext-10-1>p>Its always good to learn good style early on./p>p>I would definitely pay an early visit to the a hrefhttps://google.github.io/styleguide/htmlcssguide.xml>Google HTML/CSS style guide/a>./p>p>If youre a pedant, like me, youll want to at least scan and know how to read a hrefhttps://developers.whatwg.org/>the developer HTML specification/a>./p>/div>/div>div idoutline-container-sec-10-2 classoutline-3>h3 idsec-10-2>CSS/h3>div classoutline-text-3 idtext-10-2>p>There are pretty good CSS references. W3 style/p>/div>/div>div idoutline-container-sec-10-3 classoutline-3>h3 idsec-10-3>Javascript/h3>div classoutline-text-3 idtext-10-3>p>The a hrefhttps://google.github.io/styleguide/javascriptguide.xml>Google Javascript Style Guide/a> is another resource./p>/div>/div>/article>/div>div idpostamble classstatus>p classauthor>Author: Aaron Hall/p>p classdate>Created: 2016-10-23 Sun 16:42/p>p classcreator>a hrefhttp://www.gnu.org/software/emacs/>Emacs/a> 25.1.50.1 (a hrefhttp://orgmode.org>Org/a> mode 8.2.10)/p>p classvalidation>a hrefhttp://validator.w3.org/check?urireferer>Validate/a>/p>/div>/body>/html>
View on OTX
|
View on ThreatMiner
Please enable JavaScript to view the
comments powered by Disqus.
Data with thanks to
AlienVault OTX
,
VirusTotal
,
Malwr
and
others
. [
Sitemap
]