Skip to content

Instantly share code, notes, and snippets.

View tuxdna's full-sized avatar

Saleem Ansari tuxdna

View GitHub Profile
@tuxdna
tuxdna / irislr.scala
Last active August 29, 2015 13:58
OnlineLogisticRegression on IRIS dataset using Mahout 0.9 and Scala
package classification
import scala.io.Source
import scala.util.Random
import org.apache.mahout.math.DenseVector
import org.apache.mahout.math.{ Vector => MahoutVector }
import scala.collection.mutable.ArrayBuffer
import org.apache.mahout.vectorizer.encoders.Dictionary
import org.apache.mahout.classifier.sgd.OnlineLogisticRegression
import org.apache.mahout.classifier.sgd.L2
@tuxdna
tuxdna / mahout-website-howto.txt
Created April 22, 2014 12:54
Mahout Website generation on local machine
Below are the instructions to generate Mahout Website from source on your own machine.
Steps to folow:
* Checkout Mahout Website source
* Setup CMS build tool
* Run markdown daemon
* Generate and veiw the site
This has been checked with Ubuntu 12.04. Other distribution shall work just fine as well.
@tuxdna
tuxdna / mahout-website.sh
Last active August 29, 2015 14:00
This script can be used to assist in documenting the Mahout Website source code on a developer's local machine.
######################################################################
#
# Author: Saleem Ansari <tuxdna@gmail.com>
# License: Apache License 2.0
#
# This script can be used to assist in documenting the Mahout Website
# source code on a developer's local machine.
#
#
# You need following dependencies to run this script:
@tuxdna
tuxdna / .emacs
Last active August 29, 2015 14:02
Emacs Configuration File
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(package-initialize)
(unless (package-installed-p 'scala-mode2)
(package-refresh-contents) (package-install 'scala-mode2))
(autoload 'markdown-mode "markdown-mode"
"Major mode for editing Markdown files" t)

Android SDK

Very old Android Android SDK Tutorial

@tuxdna
tuxdna / cc.sc
Created July 7, 2014 22:51
Covariant and Contravariant in Scala
object cc {
class Person(val name: String) {
override def toString = name
}
class Employee(override val name: String) extends Person(name)
val e1 = new Employee("Joao") //> e1 : cc.Employee = Joao
@tuxdna
tuxdna / updates.sh
Created July 24, 2014 11:44
update installation
23 apt-get install rubygen
24 apt-get install rubygem
25 apt-get install rubygems
26 aptitude
27 apt-get install aptitude
28 apt-get install aptitude ruby ruby-gem
29 apt-get install -y aptitude ruby ruby-gem
30 apt-get install aptitude
31 aptitude install ruby ruby-gem
32 aptitude search gem
@tuxdna
tuxdna / BigTable.scala
Created October 28, 2014 12:27
This is a Slick ORM sample for table defintion with more than 22 columns
import play.api.db.slick.Config.driver.simple._
import scala.slick.lifted.Tag
import java.sql.Timestamp
import scala.slick.collection.heterogenous._
/*
* This is a sample for table schema with more than 22 columns
*/
class BigTable(
@tuxdna
tuxdna / memory.c
Created November 14, 2014 14:57
Check upper limit on memory that can be allocated on a machine
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char* argv[]) {
const int KB = 1024; /* bytes */
const int MB = 1024 * KB; /* bytes */
const int GB = 1024 * MB; /* bytes */
long size = 0;
void *p = NULL;