This is a quick summary of tweaks to make development on a Mac easier for Ubuntu users. These all worked on my Macbook Air with OSX 10.7 Lion.
If you have something to add here, please let me know! http://twitter.com/craigds
| GEOSGeometry.wkt 'POINT (1 2)' | |
| FAIL - expected: 'POINT (1 2 3)' | |
| GEOSGeometry.ewkt 'POINT (1 2)' | |
| FAIL - expected: 'POINT (1 2 3)' | |
| GEOSGeometry.hex 'POINT (1 2)' | |
| FAIL - expected: 'POINT (1 2 3)' | |
| GEOSGeometry.wkb 'POINT (1 2)' | |
| FAIL - expected: 'POINT (1 2 3)' | |
| GEOSGeometry.ewkb 'POINT (1 2 3)' |
| #!/usr/bin/env python | |
| import binascii | |
| import json | |
| import re | |
| from osgeo import ogr | |
| from django.contrib.gis.geos import Point | |
| p = Point(1, 2, 3) | |
| wkt = "POINT (1 2 3)" |
This is a quick summary of tweaks to make development on a Mac easier for Ubuntu users. These all worked on my Macbook Air with OSX 10.7 Lion.
If you have something to add here, please let me know! http://twitter.com/craigds
| Index: gdal/apps/gdal_translate.cpp | |
| =================================================================== | |
| --- gdal/apps/gdal_translate.cpp (revision 21963) | |
| +++ gdal/apps/gdal_translate.cpp (working copy) | |
| @@ -991,7 +991,14 @@ | |
| pfnProgress, NULL ); | |
| if( hOutDS != NULL ) | |
| { | |
| + int bHasGotErr = FALSE; | |
| + CPLErrorReset(); |
| === modified file 'mptt/managers.py' | |
| --- mptt/managers.py 2008-12-05 01:37:34 +0000 | |
| +++ mptt/managers.py 2008-12-05 19:08:24 +0000 | |
| @@ -11,15 +11,11 @@ | |
| qn = connection.ops.quote_name | |
| COUNT_SUBQUERY = """( | |
| - SELECT COUNT(*) | |
| - FROM %(rel_table)s | |
| - WHERE %(mptt_fk)s = %(mptt_table)s.%(mptt_pk)s |
| #!/usr/bin/env python | |
| """ | |
| Gets search results from Google Maps for the given string. | |
| Usage: | |
| mapsearch.py "address" [region] | |
| Regions are two-character ccTLDs: http://en.wikipedia.org/wiki/CcTLD | |
| They're not validated by this script | |
| """ |
| # sample code as a suggestion for https://convore.com/django-community/how-to-make-an-automatic-status-change/ | |
| from datetime import datetime | |
| class MyManager(models.Manager): | |
| def active(self): | |
| return self.get_query_set().filter(expires_at__gt=datetime.now()) | |
| class MyClass(models.Model): | |
| created_at = models.DateTimeField(auto_now_add=True, db_index=True) |
| #!/usr/bin/env python | |
| """ | |
| Calculate and displays all possible N-ominoes for a given N. | |
| (c) 2010 Craig de Stigter | |
| [email protected] | |
| http://flavors.me/craigds | |
| """ |
| Index: alg/gdalwarper.cpp | |
| =================================================================== | |
| --- alg/gdalwarper.cpp (revision 21094) | |
| +++ alg/gdalwarper.cpp (working copy) | |
| @@ -32,6 +32,7 @@ | |
| #include "cpl_minixml.h" | |
| #include "ogr_api.h" | |
| #include "gdal_priv.h" | |
| +#include <iostream> | |
| diff --git a/mptt/managers.py b/mptt/managers.py | |
| index e7893af..8290443 100644 | |
| --- a/mptt/managers.py | |
| +++ b/mptt/managers.py | |
| @@ -2,7 +2,7 @@ | |
| A custom manager for working with trees of objects. | |
| """ | |
| from django.db import connection, models, transaction | |
| -from django.db.models import F, Max | |
| +from django.db.models import F, Max, Q |