Giter Club home page Giter Club logo

26thandcalifornia-v1.0's Introduction

26th and California

A Javascript app to browse and visualize data from the Supreme Chi-Town Coding Crew's Cook County Jail API (source).

Install and run server

Clone the repo:

git clone git://github.com/sc3/26thandcalifornia.git 

If you have Python, start a local server:

cd 26thandcalifornia/app
python -m SimpleHTTPServer

Now visit http://localhost:8000 in your web browser.

Development

Create Backbone views based on our special JailView extended view object and export them as AMD modules.

If you create a file called views/StatisticsandmeasurementsView.js, it will automatically be made available at #statisticsandmeasurements/.

Here's a very basic view:

define([
  'views/JailView',
],
function(JailView) {
  var StatisticsandmeasurementsView = JailView.extend({
    render: function() {
      this.$el.html('Hello world');
      return this;
    }
  });
  return StatisticsandmeasurementsView;
});

JailView objects can also accept a collection to load before rendering:

define([
  'views/JailView',
  'collections/InmateCollection',
],
function(JailView, InmateCollection) {
  var LoadcollectionView = JailView.extend({
    collection: new InmateCollection(),
    render: function() {
      this.$el.html('This renders once inmate data is retrieved.');
      return this;
    }
  });
  return LoadcollectionView;
});

Deployment

You'll need s3cmd. In OS X you can brew install s3cmd and in Ubuntu sudo apt-get install s3cmd should do the trick.

Configure s3cmd with your credentials: s3cmd --configure

Now run deploy.sh to sync files: ./deploy.sh

26thandcalifornia-v1.0's People

Contributors

andymboyle avatar aowola avatar bepetersn avatar derekeder avatar eads avatar jenlindner avatar jimglover avatar joegermuska avatar nwinklareth avatar sarahelizabeth avatar wilbertom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

26thandcalifornia-v1.0's Issues

possible java SCRIPT for changes html that dosen't work yet

see DROQUO - below- and ignore this. java script isn't my forte. I think it covers most of the not null charges but there are plenty of exceptions.

see http://jsfiddle.net/dogrdon/b73YE

a function to massage db string to http

ex: 720 ILCS 5 24-1.1(a) [1214500]
links to
http://www.ilga.gov/legislation/ilcs/documents/072000050K24-1.htm

function slice_charges(data) {
console.log("hi");
var _str=data.replace(" ILCS ","");
var str_str = data.slice(0,3);
var end_str = data.slice(4);
var num1 = endstr.slice(0,endstr.indexOf(' '))
var real_num1 = parsInt(num1)
if (real_num1<10){
var x = '000';
num1 = x.concat(num1);
end_str = end_str.slice(1,end_str.indexOf('('));
}
if (real_num1<100 and real_num1 >9 ){
var x = '00';
num1 = x.concat(num1);
end_str = end_str.slice(2,end_str.indexOf('('));
}
if (real_num1>100){
var x = '0';
num1 = x.concat(num1);
end_str = end_str.slice(3,end_str.indexOf('('));

}

return str_str.concat(num1,'0k',end_str);
}

console.log(slice_charges("720 ILCS 5 24-1.1(a) [1214500]"));

Make goForward() function more robust

The goForward function currently has the current condition:

if((this.paginateMarker + this.amountToDisplay) <= this.collection.length)

It works with cases where this.amountToDisplay + this.paginateMarker divide perfectly into this.collection.length. A perfect way to brake is to change this.collection to have different number of inmates where the numbers don't add up perfectly. In this case the user would have records completely unreachable.

Issues accessing the API and getting db

(cookcountyjail)Sarah-Murrays-MacBook-Pro:cookcountyjail Sarah$ python manage.py
Traceback (most recent call last):
File "manage.py", line 8, in
from django.core.management import execute_from_command_line
ImportError: No module named django.core.management
(cookcountyjail)Sarah-Murrays-MacBook-Pro:cookcountyjail Sarah$ pip install -r requirements.txt
Downloading/unpacking Django==1.4.2 (from -r requirements.txt (line 1))
Downloading Django-1.4.2.tar.gz (7.7MB): 7.7MB downloaded
Running setup.py egg_info for package Django

Downloading/unpacking South==0.7.4 (from -r requirements.txt (line 2))
Downloading South-0.7.4.tar.gz (88kB): 88kB downloaded
Running setup.py egg_info for package South

Downloading/unpacking argparse==1.2.1 (from -r requirements.txt (line 3))
You are installing an externally hosted file. Future versions of pip will default to disallowing externally hosted files.
Downloading argparse-1.2.1.tar.gz (69kB): 69kB downloaded
Running setup.py egg_info for package argparse

warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.pyo' found anywhere in distribution
warning: no previously-included files matching '*.orig' found anywhere in distribution
warning: no previously-included files matching '*.rej' found anywhere in distribution
no previously-included directories found matching 'doc/_build'
no previously-included directories found matching 'env24'
no previously-included directories found matching 'env25'
no previously-included directories found matching 'env26'
no previously-included directories found matching 'env27'

Downloading/unpacking cssselect==0.7.1 (from -r requirements.txt (line 4))
Downloading cssselect-0.7.1.tar.gz
Running setup.py egg_info for package cssselect

no previously-included directories found matching 'docs/_build'

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

warning: no files found matching 'Makefile' under directory 'docs'
warning: no files found matching 'indexsidebar.html' under directory 'docs'

Downloading/unpacking django-tastypie==0.9.14 (from -r requirements.txt (line 6))
Downloading django-tastypie-0.9.14.tar.gz (718kB): 718kB downloaded
Running setup.py egg_info for package django-tastypie

Downloading/unpacking eventlet==0.12.1 (from -r requirements.txt (line 7))
Downloading eventlet-0.12.1.tar.gz (267kB): 267kB downloaded
Running setup.py egg_info for package eventlet

Downloading/unpacking greenlet==0.4.1 (from -r requirements.txt (line 8))
Downloading greenlet-0.4.1.zip (75kB): 75kB downloaded
Running setup.py egg_info for package greenlet

Downloading/unpacking gunicorn==0.17.2 (from -r requirements.txt (line 9))
Downloading gunicorn-0.17.2.tar.gz (360kB): 360kB downloaded
Running setup.py egg_info for package gunicorn

Downloading/unpacking lxml==3.0.1 (from -r requirements.txt (line 10))
Downloading lxml-3.0.1.tar.gz (3.2MB): 3.2MB downloaded
Running setup.py egg_info for package lxml
Building lxml version 3.0.1.
Building without Cython.
Using build configuration of libxslt 1.1.26

warning: no previously-included files found matching '*.py'
warning: no files found matching '*.txt' under directory 'src/lxml/tests'

Downloading/unpacking mimeparse==0.1.3 (from -r requirements.txt (line 11))
Downloading mimeparse-0.1.3.tar.gz
Running setup.py egg_info for package mimeparse

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

no previously-included directories found matching 'doc/src/_build'

Downloading/unpacking pyquery==1.2.2 (from -r requirements.txt (line 13))
Downloading pyquery-1.2.2.tar.gz
Running setup.py egg_info for package pyquery
/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'test_requires'
warnings.warn(msg)

Downloading/unpacking python-dateutil==1.5 (from -r requirements.txt (line 14))
Downloading python-dateutil-1.5.tar.gz (233kB): 233kB downloaded
Running setup.py egg_info for package python-dateutil

Downloading/unpacking requests==0.14.2 (from -r requirements.txt (line 15))
Downloading requests-0.14.2.tar.gz (361kB): 361kB downloaded
Running setup.py egg_info for package requests

warning: no files found matching 'tests/*.'

Requirement already satisfied (use --upgrade to upgrade): wsgiref==0.1.2 in /usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7 (from -r requirements.txt (line 16))
Installing collected packages: Django, South, argparse, cssselect, distribute, django-tastypie, eventlet, greenlet, gunicorn, lxml, mimeparse, psycopg2, pyquery, python-dateutil, requests
Running setup.py install for Django
changing mode of build/scripts-2.7/django-admin.py from 644 to 755

changing mode of /Users/Sarah/.virtualenvs/cookcountyjail/bin/django-admin.py to 755

Running setup.py install for South

Running setup.py install for argparse

warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.pyo' found anywhere in distribution
warning: no previously-included files matching '*.orig' found anywhere in distribution
warning: no previously-included files matching '*.rej' found anywhere in distribution
no previously-included directories found matching 'doc/_build'
no previously-included directories found matching 'env24'
no previously-included directories found matching 'env25'
no previously-included directories found matching 'env26'
no previously-included directories found matching 'env27'

Running setup.py install for cssselect

no previously-included directories found matching 'docs/_build'

Running setup.py install for distribute
Before install bootstrap.
Scanning installed packages
Setuptools installation detected at /Users/Sarah/.virtualenvs/cookcountyjail/lib/python2.7/site-packages
Non-egg installation
Removing elements out of the way...
Renaming /Users/Sarah/.virtualenvs/cookcountyjail/lib/python2.7/site-packages/setuptools-0.9.7-py2.7.egg-info into /Users/Sarah/.virtualenvs/cookcountyjail/lib/python2.7/site-packages/setuptools-0.9.7-py2.7.egg-info.OLD.1379795132.3
Renaming /Users/Sarah/.virtualenvs/cookcountyjail/lib/python2.7/site-packages/setuptools into /Users/Sarah/.virtualenvs/cookcountyjail/lib/python2.7/site-packages/setuptools.OLD.1379795132.3
Renaming /Users/Sarah/.virtualenvs/cookcountyjail/lib/python2.7/site-packages/pkg_resources.py into /Users/Sarah/.virtualenvs/cookcountyjail/lib/python2.7/site-packages/pkg_resources.py.OLD.1379795132.3
Could not find the /Users/Sarah/.virtualenvs/cookcountyjail/lib/python2.7/site-packages/site.py element of the Setuptools distribution
Patched done.
Relaunching...
Traceback (most recent call last):
File "", line 1, in
NameError: name 'install' is not defined
Complete output from command /Users/Sarah/.virtualenvs/cookcountyjail/bin/python -c "import setuptools;file='/Users/Sarah/.virtualenvs/cookcountyjail/build/distribute/setup.py';exec(compile(open(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /var/folders/p3/yn5gwfr5795f3qpdqnwlxqvr0000gp/T/pip-WynhjO-record/install-record.txt --single-version-externally-managed --install-headers /Users/Sarah/.virtualenvs/cookcountyjail/bin/../include/site/python2.7:
Before install bootstrap.

Scanning installed packages

Setuptools installation detected at /Users/Sarah/.virtualenvs/cookcountyjail/lib/python2.7/site-packages

Non-egg installation

Removing elements out of the way...

Renaming /Users/Sarah/.virtualenvs/cookcountyjail/lib/python2.7/site-packages/setuptools-0.9.7-py2.7.egg-info into /Users/Sarah/.virtualenvs/cookcountyjail/lib/python2.7/site-packages/setuptools-0.9.7-py2.7.egg-info.OLD.1379795132.3

Renaming /Users/Sarah/.virtualenvs/cookcountyjail/lib/python2.7/site-packages/setuptools into /Users/Sarah/.virtualenvs/cookcountyjail/lib/python2.7/site-packages/setuptools.OLD.1379795132.3

Renaming /Users/Sarah/.virtualenvs/cookcountyjail/lib/python2.7/site-packages/pkg_resources.py into /Users/Sarah/.virtualenvs/cookcountyjail/lib/python2.7/site-packages/pkg_resources.py.OLD.1379795132.3

Could not find the /Users/Sarah/.virtualenvs/cookcountyjail/lib/python2.7/site-packages/site.py element of the Setuptools distribution

Patched done.

Relaunching...

Traceback (most recent call last):

File "", line 1, in

NameError: name 'install' is not defined


Cleaning up...
Command /Users/Sarah/.virtualenvs/cookcountyjail/bin/python -c "import setuptools;file='/Users/Sarah/.virtualenvs/cookcountyjail/build/distribute/setup.py';exec(compile(open(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /var/folders/p3/yn5gwfr5795f3qpdqnwlxqvr0000gp/T/pip-WynhjO-record/install-record.txt --single-version-externally-managed --install-headers /Users/Sarah/.virtualenvs/cookcountyjail/bin/../include/site/python2.7 failed with error code 1 in /Users/Sarah/.virtualenvs/cookcountyjail/build/distribute
Storing complete log in /Users/Sarah/.pip/pip.log

Improve README.md

Add better instructions for running locally, diving into development.

Need new layout structure for Main Menu

I have just added 4 new views and there is not much room left on the main menu bar. The current layout will not support adding more than 1 or two views, so we need a different layout.

Perhaps in the meantime we could turn all of the statistics ones into a drop down menu with the General Stats as the top menu item, displayed on the main menu bar or we could do something else.

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.