Skip to content

Instantly share code, notes, and snippets.

View kashif's full-sized avatar

Kashif Rasul kashif

  • Berlin, Germany
  • 09:00 (UTC +01:00)
  • X @krasul
View GitHub Profile
import java.util.Date;
import java.text.SimpleDateFormat;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.List;
import java.util.regex.*;
import java.util.*;
import thinktank.twitter.*;
import org.json.*;
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header$
inherit autotools eutils versionator
KEYWORDS="~amd64 ~x86"
DESCRIPTION="SpatiaLite extension enables SQLite to support spatial data in a way conformant to OpenGis specifications."
HOMEPAGE="http://www.gaia-gis.it/spatialite"
IUSE="debug doc load-extension soundex tcl +threadsafe"
src_configure() {
# Enable column metadata, bug #266651
append-cppflags -DSQLITE_ENABLE_COLUMN_METADATA
# not available via configure and requested in bug #143794
use soundex && append-cppflags -DSQLITE_SOUNDEX
# Support R-trees, bug #257646
#!/usr/bin/env ruby
require 'rubygems'
require 'sqlite3'
db = SQLite3::Database.new( "test-2.3.sqlite" )
db.enable_load_extension( 1 )
db.load_extension( "libspatialite.so" )
db.enable_load_extension( 0 )
:Begin:
:Function: scalarProd
:Pattern: ScalarProd[ a_List, b_List ]
:Arguments: { a, b }
:ArgumentTypes: { Manual }
:ReturnType: Manual
:End:
#include "scalarProd_kernel.cu"
void scalarProd(void)
{
float *h_A, *h_B, *h_C_GPU;
float *d_A, *d_B, *d_C;
char **heads_A, **heads_B;
int *dims_A, *dims_B;
int rank_A, rank_B;
#include <stdio.h>
#include <cutil_inline.h>
#include <mathlink.h>
///////////////////////////////////////////////////////////////////////////////
// Main program
///////////////////////////////////////////////////////////////////////////////
int main(int argc, char **argv)
{
// use command-line specified CUDA device, otherwise use device with highest Gflops/s
In[1]:= Install["scalarProd"]
Out[1]= LinkObject[./scalarProd,8,7]
In[2]:= ScalarProd[{2.1,3.2},{4.3,5.4}]
Out[2]= 26.31
In[3]:= UnInstall[%1]
Out[3]= UnInstall[LinkObject[./scalarProd,8,7]]
@kashif
kashif / FindM
Created September 4, 2009 21:32
# Try to find MathLink from Wolfram Mathematica package
#
# See http://www.wolfram.com/solutions/mathlink/
#
# Once run this will define:
#
# MathLink_FOUND
# MathLink_INCLUDE_DIR
# MathLink_LIBRARIES
# MathLink_MPREP_BINARY
@kashif
kashif / gdal.rb
Created July 21, 2010 13:10 — forked from sabman/gdal.rb
require 'formula'
class Gdal <Formula
url 'http://download.osgeo.org/gdal/gdal-1.7.2.tar.gz'
homepage 'http://www.gdal.org/'
md5 '05351f8cb61761ae579667e24a297fe6'
def options
[
['--with-pg', "Include PostgreSQL support."],