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
<% | |
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : "" | |
rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}" | |
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} --strict --tags ~@wip" | |
%> | |
default: <%= std_opts %> features | |
wip: --tags @wip:3 --wip features | |
rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip |
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
require 'cucumber/rake/task' | |
require 'rspec/core/rake_task' | |
namespace :rcov do | |
Cucumber::Rake::Task.new(:cucumber) do |t| | |
t.rcov = true | |
t.rcov_opts = %w{--rails --exclude spec\/,features\/ --aggregate coverage.data} | |
t.rcov_opts << %[-o "coverage"] | |
end |
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
// | |
// AdManager.h | |
// | |
// Created by Samuel Ritchie on 10/11/10. | |
// Copyright 2010 Threadlock Design. All rights reserved. | |
// | |
#import <iAd/iAd.h> | |
@interface AdManager : NSObject <ADBannerViewDelegate> { |
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
cntryList = ['VNM', 'TWN', 'THA', 'PHL', 'MYS', 'MMR', 'LKA', 'LAO', 'KHM', 'IND', 'IDN', 'CHN', 'BGD'] | |
# new version, using list comprehensions and default values | |
def messageList(useRange=False, testRange=range(71,126)): | |
rangedFunc = (lambda country: ['%s %s' % (country, i) for i in testRange]) | |
identityFunc = (lambda country: country) | |
entryFunc = useRange and rangedFunc or identityFunc | |
return [entry for country in countryList for entry in entryFunc(country)] | |
# new version, with in-line lambdas |
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
package world; | |
import org.gdal.gdal.Band; | |
//import org.gdal.gdal.ColorTable; | |
import org.gdal.gdal.Dataset; | |
import org.gdal.gdal.Driver; | |
import org.gdal.gdal.GCP; | |
import org.gdal.gdal.gdal; | |
import org.gdal.gdalconst.gdalconstConstants; | |
import org.gdal.osr.CoordinateTransformation; |
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
def prep_hdf(f): | |
from osgeo import gdal | |
print "Loading %s" % os.path.split(f.local)[1] | |
hdf = gdal.Open(f.local) | |
sdsdict = hdf.GetMetadata('SUBDATASETS') | |
sdslist = [sdsdict[k] for k in sdsdict.keys() if '_NAME' in k] | |
f.sds = [gdal.Open(n) for n in sdslist] | |
return f |
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
(def gdal-bytes | |
(byte-array (* 1200 1200))) | |
(.ReadRaster band 0 0 1200 1200 gdal-bytes) |
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
(def *rho* 6371007.181) | |
(def pixels-at-res | |
{:250 4800 | |
:500 2400 | |
:1000 1200}) | |
(defn degs-by-rho | |
"Multiplies the argument by rho and converts the answer to radians." | |
[arg] |
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
(def | |
#^{:doc "Type object for a Java primitive float array."} | |
*float-array-type* (class (make-array Float/TYPE 0))) | |
(defmulti | |
#^{:doc "Converts argument into a Java float array. Argument may be | |
a File, or another byte array. If the argument is already | |
a float array, returns it." | |
:arglists '([arg])} | |
to-float-array type) |
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
(defn all-months | |
"Returns a seq of the months inside of a rain array." | |
[^HeapByteBuffer buf] | |
(map #(take (* 360 720) (float-seqs %)) | |
(for [i (range 12)] (extract-month i buf)))) |