Skip to content

Instantly share code, notes, and snippets.


Kashif Rasul kashif

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.*;
View libspatialite-2.3.1.ebuild
# 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."
View sqlite.ebuild
IUSE="debug doc load-extension soundex tcl +threadsafe"
src_configure() {
# Enable column metadata, bug #266651
# not available via configure and requested in bug #143794
use soundex && append-cppflags -DSQLITE_SOUNDEX
# Support R-trees, bug #257646
View spatialite.rb
#!/usr/bin/env ruby
require 'rubygems'
require 'sqlite3'
db = "test-2.3.sqlite" )
db.enable_load_extension( 1 )
db.load_extension( "" )
db.enable_load_extension( 0 )
:Function: scalarProd
:Pattern: ScalarProd[ a_List, b_List ]
:Arguments: { a, b }
:ArgumentTypes: { Manual }
:ReturnType: Manual
View scalarProd.c
#include ""
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;
View scalarProd.c
#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
View gist:180974
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]]
View FindM
# Try to find MathLink from Wolfram Mathematica package
# See
# Once run this will define:
# MathLink_FOUND
View gdal.rb
require 'formula'
class Gdal <Formula
url ''
homepage ''
md5 '05351f8cb61761ae579667e24a297fe6'
def options
['--with-pg', "Include PostgreSQL support."],