git checkout -b forgottoswitch
All modified files are now available in the new branch forgottoswitch
from django.db import models | |
from django.contrib import admin | |
from django.contrib.admin import widgets | |
from django.forms import ModelForm | |
from django import forms | |
import datetime | |
TITLE_CHOICES = ( | |
('Dhr', 'Dhr.'), | |
('Mw', 'Mw.'), |
class Points(models.Model): | |
routes = models.ForeignKey(Routes) | |
categories = models.ForeignKey(Categories) | |
attribution = models.CharField(max_length=255) | |
title = models.CharField(max_length=65) | |
lat = models.FloatField() | |
lon = models.FloatField() | |
imageURL = models.URLField(verify_exists=True) | |
line2 = models.CharField(max_length=40) | |
line3 = models.CharField(max_length=40, blank=True, null=True) |
import urllib2, simplejson | |
# Hier de respons van de website als je de query opent. | |
response = simplejson.dumps(urllib2.urlopen("http://search.twitter.com/search.json?geocode=51.985263,5.663259,5km&q=forum").readline()) | |
# Format de website zo dat python het kan lezen als python objecten ipv JSON | |
# de 5 en de 1 slaan op de indexing van de response. Het 5e item zijn de tweets zelf in deze request, kan misschien verschillen per search. | |
loadaspy = simplejson.loads(simplejson.loads(response)).items()[4][1] |
from waterqmap.maps.models import Map,MapDate | |
from django.contrib import admin | |
class MapDateInline(admin.TabularInline): | |
#this is the foreignkey | |
model = MapDate | |
class MapAdmin(admin.ModelAdmin): | |
prepopulated_field = {"slug": ("title",)} | |
inlines = [MapDateInline] |
def cokriging_in_r(self, x, y, z): | |
''' | |
Cokriging (and ordinary kriging) is quite fast in R. | |
This would anyway be more pragmatic than rewriting/porting it to Python. | |
For the moment this will be the 'best' way as R makes it very easy to | |
use kriging without fitting a variogram model, but using a standard | |
variogram. | |
''' | |
import rpy2 | |
import rpy2.robjects as robj |
#Edzer Pebesma | |
#> Institute for Geoinformatics (ifgi), University of Münster | |
#> Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251 | |
#> 8333081, Fax: +49 251 8339763 http://ifgi.uni-muenster.de | |
#> http://www.52north.org/geostatistics e.pebesma at wwu.de | |
################################################# | |
#krige wil alleen als er geen NA waarden in de data.frame zitten. Heel onhandig | |
#data(meuse.grid) # only the non-missing valued cells |
MAP | |
NAME "whatever" | |
WEB | |
IMAGEPATH "/www/" | |
IMAGEURL "/www/" | |
METADATA | |
"wms_title" "whatever" | |
"wms_enable_request" "*" | |
"wms_onlineresource" "http://localhost/cgi-bin/mapserv?mapfile=/var/www/thisfile.map&" |
Lizard.App.Home = {}; | |
Lizard.App.Home.DefaultView = Backbone.Marionette.ItemView.extend({ | |
template: '#home-template', | |
className: 'home', | |
onShow: function() { | |
console.log('onShow()'); | |
$('.search-query').focus(); | |
}, | |
onDomRefresh: function() { |
<jq-schlider ng-enabled="state.master" at="time.at" max="time.max_timestep"></jq-schlider> | |
<script> | |
angular | |
.module('Components', []) | |
.directive('jqSchlider', function () { | |
return { | |
restrict: 'E', | |
replace: true, | |
template: '<div id="schlider"></div>', |