Skip to content

Instantly share code, notes, and snippets.

find . -name "*.php" | while read line; do expand -t 4 $line > $line.new; mv $line.new $line; done
@geraldstanje
geraldstanje / gist:bf87d04781da60c91f63
Created July 31, 2014 20:17
common-gcc-cuda-4.0.mk
################################################################################
#
# Copyright 1993-2010 NVIDIA Corporation. All rights reserved.
#
# NVIDIA Corporation and its licensors retain all intellectual property and
# proprietary rights in and to this software and related documentation.
# Any use, reproduction, disclosure, or distribution of this software
# and related documentation without an express license agreement from
# NVIDIA Corporation is strictly prohibited.
#
@geraldstanje
geraldstanje / gist:6113322effcaa4f233c6
Created July 31, 2014 20:21
common-gcc-cuda-4.0.mk
################################################################################
#
# Copyright 1993-2010 NVIDIA Corporation. All rights reserved.
#
# NVIDIA Corporation and its licensors retain all intellectual property and
# proprietary rights in and to this software and related documentation.
# Any use, reproduction, disclosure, or distribution of this software
# and related documentation without an express license agreement from
# NVIDIA Corporation is strictly prohibited.
#
#! /usr/bin/python
from sklearn.feature_extraction.text import CountVectorizer
content = ["Bursting the Big Data bubble starts with appreciating certain nuances about its products and patterns","the real solutions that are useful in dealing with Big Data will be needed and in demand even if the notion of Big Data falls from the height of its hype into the trough of disappointment"]
X = vectorizer.fit_transform(content)
vectorizer = CountVectorizer(min_df=1)
print(vectorizer)
@geraldstanje
geraldstanje / Makefile
Created August 2, 2014 20:10
common-gcc-cuda-4.0.mk
MODELNAME := _ConvNet
INCLUDES := -DCUDA_6 -I$(PYTHON_INCLUDE_PATH) -I$(CUDA_HELPER_INCLUDE_PATH) -I$(ATLAS_INCLUDE_PATH) -I$(NUMPY_INCLUDE_PATH) -I$(CUDA_SDK_PATH) -I./include -I./include/common -I./include/cudaconv2 -I./include/nvmatrix -I./dummyinclude/
#INCLUDES := -I$(PYTHON_INCLUDE_PATH) -I$(ATLAS_INCLUDE_PATH) -I$(NUMPY_INCLUDE_PATH) -I./include -I./include/common -I./include/cudaconv2 -I./include/nvmatrix
LIB := -lpthread -L$(ATLAS_LIB_PATH) -L$(CUDA_INSTALL_PATH)/lib -lcblas
USECUBLAS := 1
PYTHON_VERSION=$(shell python -V 2>&1 | cut -d ' ' -f 2 | cut -d '.' -f 1,2)
LIB += -lpython$(PYTHON_VERSION)
import net.liftweb.json.Xml // converts XML to JSON
import com.mongodb.casbah.Imports._ // To put stuff in Mongo
import com.mongodb.casbah.MongoDB // To connect to Mongo
import com.mongodb.util.JSON // To parse JSON into a MongoDBObject
import net.liftweb.json._ // To output Lift JSON as actual JSON
import scala.xml.XML // To load XML
// load the XML
val xml = XML.load("http://www.w3schools.com/xml/note.xml")
// fire up mongo connection
package main
import "fmt"
import "go/parser"
import "go/ast"
const debug = true
// Define one of these for each translation you need.
type Translator func(node *ast.CallExpr) string
package main
import (
"log"
"os"
"text/template"
"regexp"
)
var reg = regexp.MustCompile(`(^[^/]+[\w]+)\(([\w]*)[,\s]*([\w]*)\);`)
@geraldstanje
geraldstanje / gist:cfaf6919ccae6fbf2744
Created October 5, 2014 17:07
golang json encoding
package main
import "encoding/json"
import "fmt"
import "bytes"
type tableEntry struct {
Name string
Age string
Gender string
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package heap provides heap operations for a type A and a comparison
// function Less. A heap is a tree with the property that each node
// is the minimum-valued node in its subtree.
//
// The minimum element in the tree is the root, at index 0.
//