Skip to content

Instantly share code, notes, and snippets.

View Teino1978-Corp's full-sized avatar

Teino Boswell Teino1978-Corp

  • Ocho Rios, Jamaica
View GitHub Profile
<div id="state" />
<script type="text/javascript" src="https://app.yax.io/yax.min.js"></script>
<script type="text/javascript">
// pass your api key
var talk = new Talk("9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08", function() {
talk.connect();
}, function(state) {
$("#state").html(state);
});
@Teino1978-Corp
Teino1978-Corp / gist:43d6eb472ca558bac0b8
Created November 9, 2015 05:12
2015 New Year Resolution-Capstone peroject
#####################################################################
# STEP 1: INSTALL REQUIRED PACKAGES AND CONNECT TO ALL LIBRARIES
#####################################################################
library("NLP")
library("tm")
library("RCurl")
library("slam")
def update(td: TaggingDistribution, ad: AlignmentDistribution) = {
/*
* Setup: Create an empty set of records
*/
var TPrime = List[Record]()
for (i <- 0 until _T.size) {
val r = new Record(i, _schema)
r.setThetaRewrite(_T(i).thetaRewrite)
TPrime = TPrime :+ r
}
@Teino1978-Corp
Teino1978-Corp / README.md
Created November 9, 2015 01:08
DBpedia Classes Radial Node Link Diagram 2 (Strahler Number).

This experiment is an evolution of the previous one. The links are shown as outcoming links (red) and incoming links (blue). Moreover, the size of the nodes describes the number of entities for a certain DBpedia Class.

@Teino1978-Corp
Teino1978-Corp / DoubleTerm.scala
Created November 8, 2015 22:18
Scalar O doubling
package https://www.facebook.com/photo.php?fbid=10207696314588414&set=p.10207696314588414&type=3&theater
import booleans.BooleanTerm
import functions._
import vectors.{VectorTerm, VectorScalarApp}
/**
* @author Teino Boswell
*/
@Teino1978-Corp
Teino1978-Corp / mvn archetype
Last active November 8, 2015 21:44
mvn archetype:generate/mvn clean verify -X -e -pl trace -am -Papache-release -debug
Apache Maven 3.0.4 (r1232337; 2012-01-17 00:44:56-0800)
Maven home: /usr/local/apache-maven/apache-maven-3.0.4
Java version: 1.6.0_32, vendor: Sun Microsystems Inc.
Java home: /usr/java/jdk1.6.0_32/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-220.el6.x86_64", arch: "amd64", family: "unix"
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from /usr/local/apache-maven/apache-maven-3.0.4/conf/settings.xml
[DEBUG] Reading user settings from /home/cloudera/.m2/settings.xml
[DEBUG] Using local repository at /home/cloudera/.m2/repository
@Teino1978-Corp
Teino1978-Corp / ubuntu
Created November 8, 2015 21:08
Ubuntu
#Ubuntu
0. [Set up ssh keys](https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys--2)
cat ~/.ssh/vedyakov.robodrom.pub | ssh [email protected] "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"
0. Install base utils
sudo apt-get install gcc g++ git make
@Teino1978-Corp
Teino1978-Corp / Apache jclouds
Last active November 8, 2015 21:02
The Java Multi-Cloud Toolkit Apache jclouds® is an open source multi-cloud toolkit for the Java platform that gives you the freedom to create applications that are portable across clouds while giving you full control to use cloud-specific features. - https://jclouds.apache.org/
ComputeService compute = ContextBuilder.newBuilder("aws-ec2")
.credentials("identity", "credential")
.buildView(ComputeServiceContext.class)
.getComputeService();
Template template = compute.templateBuilder()
.osFamily(OsFamily.UBUNTU)
.minRam(2048)
.options(inboundPorts(22, 80))
.build();
@Teino1978-Corp
Teino1978-Corp / StreamingDNF.scala
Created November 8, 2015 20:10
Lazy DNF construction using streams
sealed trait Formula[A]
case class Var[A](a: A) extends Formula[A]
case class Not[A](fm: Formula[A]) extends Formula[A]
case class And[A](left: Formula[A], right: Formula[A]) extends Formula[A]
case class Or[A](left: Formula[A], right: Formula[A]) extends Formula[A]
type DNFSTREAM[A] = Stream[List[Formula[A]]]
def distribute[A](left: DNFSTREAM[A], right: DNFSTREAM[A]): DNFSTREAM[A] =
for (leftTerm <- left; rightTerm <- right) yield leftTerm ++ rightTerm
@Teino1978-Corp
Teino1978-Corp / net_server.py
Created November 8, 2015 03:35
Basic socket communication in Python
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
host = socket.gethostname()
port = 4560
# Binds the server to address and port.
s.bind((host, port))
# Listens for a max of 5 clients.