Note: you will need sudo access. Add the following to /etc/exports
/Users -alldirs -maproot=root:wheel -network 192.168.99.0 -mask 255.255.255.0
Restart NFS:
#!/usr/bin/env python | |
import pyexiv2 | |
import fractions | |
from PIL import Image | |
from PIL.ExifTags import TAGS | |
import sys | |
def to_deg(value, loc): | |
if value < 0: |
'''Example of a custom ReST directive in Python docutils''' | |
import docutils.core | |
from docutils.nodes import TextElement, Inline | |
from docutils.parsers.rst import Directive, directives | |
from docutils.writers.html4css1 import Writer, HTMLTranslator | |
class foo(Inline, TextElement): | |
'''This node class is a no-op -- just a fun way to define some parameters. | |
There are lots of base classes to choose from in `docutils.nodes`. |
import requests | |
class HoverException(Exception): | |
pass | |
class HoverAPI(object): | |
def __init__(self, username, password): | |
params = {"username": username, "password": password} | |
r = requests.post("https://www.hover.com/api/login", params=params) |
# Question - how best to handle model fields that are excluded from a form's | |
# fields. | |
# ------------------------------------------------------------ | |
# Option 1: assign fields to instance before passing into form | |
# ------------------------------------------------------------ | |
# views.py | |
instance = Vote(review=review, user=request.user) | |
form = VoteForm(data=request.POST, instance=instance) |
Maybe the closest analogue to this is the PHP "debate": | |
(http://www.codinghorror.com/blog/2012/06/the-php-singularity.html) | |
(http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/) | |
Basically, MySQL works and you can definitely use it to build and run successful applications. Facebook uses it. But the point is that Postgres..... is better. That's the point. How and why? There are numerous articles out there for you to google up but [here's one] (http://www.youtube.com/watch?v=1PoFIohBSM4) that gives you a resaonable breakdown, by example. | |
So if you're currently a still running MySQL why not give Postgres a go, especially if you're starting a new project. Hell, why not use it even on existing projects which are using MySQL? Maybe because you have existing MySQL databases full of data and tables that you'd need to convert over to PostgreSQL? True this is a barrier, but it's by no means insurmountable. Which is what this post is about: easy conversion of your existing MySQL databases (schema and dat |
==== SNIP ==== | |
class DistanceSerializer(serializers.Serializer): | |
km = serializers.FloatField() | |
m = serializers.FloatField() | |
mi = serializers.FloatField() | |
ft = serializers.FloatField() | |
class SearchResultSerializer(serializers.Serializer): |
from android.util import TypedValue | |
from android.view import ViewGroup | |
from android.view import Gravity | |
from android.widget import LinearLayout | |
from android.widget import TextView | |
from android.widget import EditText | |
from android.widget import Button | |
from android.widget import ScrollView | |
from android.util import Log |