Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Sam Bessalah samklr

🎯
Focusing
Block or report user

Report or block samklr

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View RedisGeo.java
public void geoadd(String objectId, BigDecimal latitude, BigDecimal longitude) {
log.info("geoadd(): {} {} {}", objectId, latitude, longitude);
try (Jedis jedis = jedisPool.getResource()) {
if (geoaddSha == null) {
String script = "return redis.call('geoadd','" + GEOSET + "', ARGV[1], ARGV[2], KEYS[1])";
geoaddSha = jedis.scriptLoad(script);
}
log.info("geoaddSha: {}", geoaddSha);
log.info(jedis.evalsha(geoaddSha, 1, objectId, latitude.toString(), longitude.toString()).toString());
}
@samklr
samklr / dnn.txt
Created Mar 19, 2014
Pointers Deep Learning intro materials
View dnn.txt
http://deeplearning.net/
http://deeplearning.net/tutorial/ (Good One ... )
http://deeplearning.net/reading-list/tutorials/
Geoffrey Hinton (God himself) Coursera Course
https://www.coursera.org/course/neuralnets
Geoffrey Hinton Academic page with great links
https://www.cs.toronto.edu/~hinton/
View tuning_storm_trident.asciidoc

Tuning Storm+Trident

Tuning a dataflow system is easy:

The First Rule of Dataflow Tuning:
* Ensure each stage is always ready to accept records, and
* Deliver each processed record promptly to its destination
@samklr
samklr / interviewitems.MD
Last active Aug 29, 2015 — forked from KWMalik/interviewitems.MD
Silly (or not ?) interview questions from tech companies
View interviewitems.MD

##Google Interview Questions: Product Marketing Manager

  • Why do you want to join Google? -- Because I want to create tools for others to learn, for free. I didn't have a lot of money when growing up so I didn't get access to the same books, computers and resources that others had which caused money, I want to help ensure that others can learn on the same playing field regardless of their families wealth status or location.
  • What do you know about Google’s product and technology? -- A lot actually, I am a beta tester for numerous products, I use most of the Google tools such as: Search, Gmaill, Drive, Reader, Calendar, G+, YouTube, Web Master Tools, Keyword tools, Analytics etc.
  • If you are Product Manager for Google’s Adwords, how do you plan to market this?
  • What would you say during an AdWords or AdSense product seminar?
  • Who are Google’s competitors, and how does Google compete with them? -- Google competes on numerous fields: --- Search: Baidu, Bing, Duck Duck Go
View GrasswireUrlShortener.scala
package com.grasswire.grasswireurlshortener
import akka.actor.ActorSystem
import com.typesafe.config.ConfigFactory
import org.apache.commons.validator.routines.UrlValidator
import spray.http.StatusCodes
import spray.routing._
import scala.util.Random
import scalaz.concurrent._
View ipython-notebook-ec2.py
#### Start IPython, generate SHA1 password to use for IPython Notebook server
$ ipython
Python 2.7.5 |Anaconda 1.8.0 (x86_64)| (default, Oct 24 2013, 07:02:20)
Type "copyright", "credits" or "license" for more information.
IPython 1.1.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
@samklr
samklr / install_scala.sh
Last active Aug 29, 2015
Install Java Scala and SBT on Debian (useless pain in the ass)
View install_scala.sh
#!/bin/sh
sudo apt-get -yqq git core
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | sudo tee /etc/apt/sources.list.d/webupd8team-java.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | sudo tee -a /etc/apt/sources.list.d/webupd8team-java.list
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886
sudo apt-get update
sudo apt-get install oracle-java8-installer
#exit
View Typesafe-activator-dockerfile
FROM ringo/scientific:6.5
RUN yum install -y wget unzip
RUN mkdir -p /home/src/ && cd /home/src && wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u5-b13/jdk-8u5-linux-x64.rpm && rpm -ivh jdk-8u5-linux-x64.rpm
RUN cd /home/src && wget http://downloads.typesafe.com/typesafe-activator/1.2.2/typesafe-activator-1.2.2.zip && unzip typesafe-activator-1.2.2.zip
RUN ln -s /home/src/activator-1.2.2 /usr/local/lib/activator && ln -s /usr/local/lib/activator/activator /usr/local/bin/activator
@samklr
samklr / mesos-master-debian.sh
Created Oct 15, 2014
Mesos Master Debian/Ubuntu
View mesos-master-debian.sh
### Good start for mesos. A great thanks to the guys from mesosphere https://mesosphere.com/docs/getting-started/debian-install/
#! /bin/bash
# Add Mesosphere Ubuntu 14.04 Repo
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv E56151BF
DISTRO=$(lsb_release -is | tr '[:upper:]' '[:lower:]')
CODENAME=$(lsb_release -cs)
@samklr
samklr / ALSRecommender.scala
Last active Aug 29, 2015
MovieRecommenderALS
View ALSRecommender.scala
//Download a 10 Millions movieLens file to test your data. http://grouplens.org/datasets/movielens/
// wget http://files.grouplens.org/datasets/movielens/ml-10m.zip
// unzip ml-10m.zip
import java.util.Random
import org.apache.log4j.Logger
import org.apache.log4j.Level
import scala.io.Source
You can’t perform that action at this time.