This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
set OSGEO4W_ROOT=C:\OSGeo4W | |
set GISBASE=%OSGEO4W_ROOT%\apps\grass\grass-6.4.2 | |
rem set GISBASE=%OSGEO4W_ROOT%\apps\grass\grass-7.0.svn | |
rem set GRASS_SH=%OSGEO4W_ROOT%\apps\msys\bin\sh.exe | |
SET PATH=%GISBASE%\bin;%GISBASE%\lib;%OSGEO4W_ROOT%\bin;%OSGEO4W_ROOT%\apps\msys\bin;%PATH% | |
SET GISRC=.grassrc | |
md grassdata\default\PERMANENT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# *************************************************************************** | |
# PersistentDialog | |
# --------------------- | |
# Date : November 2013 | |
# Copyright : (C) 2013 by Mikhail Titov | |
# Email : mlt at gmx dot us | |
# *************************************************************************** | |
# * * | |
# * This program is free software; you can redistribute it and/or modify * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
table.shingle<-function(..., as.data.frame=F) { | |
dots<-list(...) | |
stopifnot(all(sapply(dots, class) %in% c("shingle","factor"))) | |
stopifnot(length(unique(sapply(dots, length)))==1) | |
dims<-sapply(dots, nlevels) | |
varnames<-tail(lapply(match.call(), deparse),-1) | |
varnames["as.data.frame"] <- NULL | |
res<-array(0, dims, `names<-`(lapply(dots, function(x) as.vector(sapply(levels(x), paste, collapse=":"))), varnames)) | |
isinlevel<-function(z, ints) { | |
if(is.factor(z)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; crbasic-mode.el --- CR1 editing mode | |
;; Copyright (C) 2014 Mikhail Titov | |
;; Author: Mikhail Titov <[email protected]> | |
;; URL: https:// | |
;; Keywords: crbasic, cr1 | |
;; Version: 1.0.0 | |
;; This program is free software; you can redistribute it and/or modify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from __future__ import print_function | |
from datetime import timedelta | |
import argparse, os, sys | |
import logging | |
from serial import Serial, SerialException | |
from binascii import hexlify | |
import struct | |
import re | |
from chirp.bitwise import bcd_to_int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2015 Mikhail Titov <[email protected]> | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 2 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## this script extracts soil component(s) data from SSURGO DB for use | |
## in DrainMod model. Rosetta should be used to derive VGM parameters | |
library(RODBC) | |
## library(RPostgreSQL) | |
library(plyr) | |
file <- 'ssurgo2rosetta.txt' # output file name to import into Rosetta | |
con <- odbcConnectAccess("C:/webdata/soils/soil_mn061/soildb_MN_2003.mdb") | |
## con <- odbcDriverConnect("Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=C:/webdata/soils/soil_mn061/soildb_MN_2003.mdb") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, sys, glob, arcpy, string, zipfile, time, urllib, json | |
import shutil, urllib2 | |
from contextlib import closing | |
def printMessage(messageString): | |
#print messageString | |
arcpy.AddMessage(messageString) | |
def duration_human(seconds): | |
seconds = long(round(seconds)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
headers['X-Accel-Buffering'] = 'no' | |
headers['Cache-Control'] = 'no-cache' | |
headers['Content-Type'] = 'text/csv; charset=utf-8' | |
headers['Content-Disposition'] = 'inline; filename="data.csv"' | |
headers['Content-Encoding'] = 'gzip' | |
sql = "select * from something;" | |
self.response_body = SqlToCsvStreamer.new(sql) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE FUNCTION excel_column(col integer) | |
RETURNS text AS | |
$BODY$ | |
WITH RECURSIVE t(n, out) AS ( | |
SELECT col/26-(col%26=0)::int, chr((col-1)%26 + 65) | |
UNION ALL | |
SELECT n/26-(n%26=0)::int, chr((n-1)%26 + 65) || out FROM t | |
where n>0 | |
) | |
SELECT out FROM t where n=0; |
OlderNewer