Git Product home page Git Product logo

new-coder's Introduction

New Coder tutorials: 5 life jackets to throw the new coder

  • Data Visualization
  • Web Scraping
  • APIs
  • Networking
  • GUI

General directory layout:

├── <Project>/
│   ├── README.md
│   ├── requirements.txt
│   ├── lib/
│   ├── tests/  # only for more advanced tutorials

CONTRIBUTING

PLEASE – When editing tutorial or full source code, please edit the documentation to go along with it within the website folder (and vice-versa).

When writing documentation, please use smart quotes. :)

Documentation Build Instructions

Documentation is essentially the website itself. Simply install requirements, run the build command within website directory:

$ mkvirtualenv newcoder-website
(newcoder-website) $ cd website
(newcoder-website) $ pip install -r requirements.txt

To build the site:

(newcoder-website) $ mynt gen -f _site

To serve the site locally:

(newcoder-website) $ mynt serve _site

And navigate to localhost:5000.

I’ve included a simple script that combines the two above commands:

(newcoder-website) $ ./_local.sh

If you get a permission denied message, you may need to change the file mode in order to run the _local.sh with the ./ preceeding:

(newcoder-website) $ chmod +x _local.sh
(newcoder-website) $ ./_local.sh

new-coder's People

Contributors

abhikpal avatar alecxe avatar ashanan avatar bmwasaru avatar caynan avatar cheripai avatar chrisfox avatar chuntaolu avatar econchick avatar esacteksab avatar eyaylali avatar hynek avatar infraredgirl avatar ironfroggy avatar j-h-l avatar jessamynsmith avatar joeobrien avatar kmolo avatar lazar-t avatar maggie-m avatar merwok avatar mobattah avatar nihdez avatar nrrb avatar nyghtowl avatar talam avatar willingc avatar wraithan avatar zerocchi avatar zerok avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

new-coder's Issues

Link to awesome dataviz

NYT and Stamen do consistently great work. Linking to these might motivate the dataviz tutorial more:

http://www.nytimes.com/interactive/2009/11/06/business/economy/unemployment-lines.html

http://stamen.com/clients/mysociety

Some other highlights:
http://worrydream.com/#!/bartwidget

https://flowcharts.llnl.gov/content/energy/energy_archive/energy_flow_2011/LLNLUSEnergy2011.png

I can pick some different ones if you want to hit a particular subject area or motivation.

<3 me some dataviz.

license change

Would it be possible to replace the current Zlib License with a very similar, copyfree-certified license? The Zlib License has been rejected for copyfree certification because of what appears to be a bookkeeping clause:

Zlib License restriction 2 contains the requirement "Altered source versions must be plainly marked as such," which could reasonably be interpreted by the courts in a manner that violates Copyfree Standard Definition point 3. Free Modification and Derivation. Alternatively, it may be interpreted as merely requiring that a derivative or modified work be renamed, given the concluding clause, "must not be misrepresented as being the original software." Until such issues are clarified, particularly as to the intent of the license authors and the legal applicability of these terms as explained by relevant legal professionals, the Zlib License must be regarded as contrary in some respects to the requirements of the Copyfree Standard Definition.

The most similar copyfree-certified licenses appear to be the General Attribution License and the Software Attribution License. The two are almost identical, with the exception that the SAL very specifically mentions "software" and "source", while the GAL is . . . well, more general, and probably preferable overall.

Rework part talking about *args/**kwargs in dataviz tuto

There is a section in dataviz/tutorial.md that talks about *args and **kwargs without really explaining them (i.e. you can pass rotation=90 even though the method does not take a rotation argument because it accepts varkwargs, i.e. arbitrary named parameters).

We could rephrase that part, or keep the mention of **kwargs (it’s useful) and link to the Python docs (where some effort has been put recently to distinguish the parameters definition style from the argument passing style (e.g. a parameter always has a name, even if you pass it as positional argument in one call)).

Fix up formating setup for dataviz part 0

There are line numbers, should just probably use <code> instead of <pre><code> or something like that. Also add numbered steps/check boxes to follow along easier.

Style sections that might be optional: "For The Curious"

Some sections seem to provide some useful extra explanation, that isn't strictly necessary. The heading suggests it could be skipped, and a separate style to set these sections aside might be a good idea to separate the primary and secondary content.

How to use psycogs2 in scrape tutorial on 10.9?

When trying to run pip install -r requirements.txtin the scrape tutorial on Mac OS X 10.9, the following error returns - and is obviously related to psycogs2:

Downloading/unpacking psycopg2==2.4.6 (from -r requirements.txt (line 5))
  Downloading psycopg2-2.4.6.tar.gz (667kB): 667kB downloaded
  Running setup.py egg_info for package psycopg2

    Error: pg_config executable not found.

    Please add the directory containing pg_config to the PATH
    or specify the full executable path with the option:

        python setup.py build_ext --pg-config /path/to/pg_config build ...

    or with the pg_config option in 'setup.cfg'.
    Complete output from command python setup.py egg_info:
    running egg_info

creating pip-egg-info/psycopg2.egg-info

writing pip-egg-info/psycopg2.egg-info/PKG-INFO

writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt

writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt

writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'

warning: manifest_maker: standard file '-c' not found



Error: pg_config executable not found.



Please add the directory containing pg_config to the PATH

or specify the full executable path with the option:



    python setup.py build_ext --pg-config /path/to/pg_config build ...



or with the pg_config option in 'setup.cfg'.

----------------------------------------
Cleaning up...

Note that I do have gcc installed to compile, as gcc --version returns the following:

$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix

Strange error when reproducing the code in API example

Traceback (most recent call last):
File "peadarapi.py", line 405, in
main()
File "peadarapi.py", line 385, in main
adjusted_price = cpi_data.get_adjusted_price(price, year)
File "peadarapi.py", line 131, in get_adjusted_price
current_cpi = self.year_cpi[current_year]

FOR INPUT: Thoughts on converting from static -> dynamic site?

I like static/mynt because it's simple HTML from Markdown. I use it for roguelynn.com and pyladies.com

But I want this project to grow, so I'm not sure how the best to "scale" when wanting to add more tutorials, offering more communications (e.g. forums for folks to ask questions publicly), perhaps more features (e.g. a voting system on the next new tutorial).

One reason I chose mynt is that it's Python, so I want to maintain being "pythonic" in terms of the tools used to generate site content.

I'm not really wanting to go through a WYSIWYG editor for posting new tutorials/content (although I can see how something like that would simplify maintenance in fixing typos/links/etc).

I want to see other people contributing to the production of this site (as opposed to the consumption), so I'm hoping to get some public thought on this as a maintainer point of view.

If the answer is 'stick with it' I'm fine with that.

Setup in windows

Virtualenvwrapper isn't prepared for windows you can use instead virtualenvwrapper-win. Also during the installation of the libraries which are based on c modules, a windows user can have problems if they doesn't have visual studio or at least its libraries. They can use instead precompiled modules from here http://www.lfd.uci.edu/~gohlke/pythonlibs/ however they won't have a virtual environment.

(scrape) Why PostgreSQL and not simply SQLite?

I like your tutorials, but I wonder why you chose PostgreSQL for the scraping tutorial.

From what I see a simple SQLite database would be sufficient for a local scraping script. PostgreSQL is a lot more complicated to set up and maintain.

But probably you have good reason for your choice. Let me know!

Expand contribution instructions

The README could have more details about where the content source files are located, where the template theme is (in case there are template fixes to do), etc.

provide info on how to start postgresql

On part 3 of the scraper tutorial, it says to enter psql -h localhost. I tried this and I was getting a connection refused. It turns out that you need to have postgresql running before giving that command. Maybe add a note about how to start postgres from the command line.

Getting pip on linux

Hi,
I was going through setting up machine on linux, and I have one question. There is python-pip package in both fedora and ubuntu. So to get pip on those systems it is enough to run:

sudo [yum|apt-get] install python-pip

But instruction says to install pip as on mac, where there is no (deb/rpm) packaging system.

Push updates to newcoder.io

In reading through Dataviz Part 1 - Parse, I noticed there were a number of typos and other problems that have been fixed in the Github repo, but never pushed to the static site. For example, the site still has:

with open(raw_file) as opened_file:

which doesn't match the final versions of the script. (That syntax can cause problems when playing on the CLI if the user doesn't put the rest of the csv.reader code in a block under the line, as it automatically closes the file and therefore the csv stream.) There are other examples as well:

def parse(raw_file, delimiter):
    """Parses a raw CSV file to a JSON-line object"""

    # Open CSV file
    open_file = open(raw_file)

    # Read the CSV data
    csv_data = csv.reader(opened_file, delimiter=delimiter)

There's a typo, with open_file and opened_file describing the same object.

There's also no lib directory in the Github repo. I imagine in the rest of the tutorials there may be similar problems solved by pushing the fixed markdown files to your site generator.

I like them very much, BTW!

Setup in linux - virtualenvwrapper

source /usr/local/bin/virtualenvwrapper.sh
on arch, virtualenvwrapper.sh doesn't seem to be located in /usr/local/bin, but rather both /usr/bin and /bin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.