Skip to content

Instantly share code, notes, and snippets.

View jkdeveyra's full-sized avatar

JK de Veyra jkdeveyra

  • Pocketmath
  • Singapore
View GitHub Profile
package app
import ij.ImagePlus
import imagescience.image.Image
import harrislaplace.HarrisLaplace
import imagescience.shape.Point
import ij.process.ImageProcessor
import scalaj.collection.Imports._
object HarrisLaplaceApp extends App {
@jkdeveyra
jkdeveyra / Sample.scala
Created January 7, 2012 17:46
Extreme Learning Machine Draft Implementation
import scala.Array.canBuildFrom
import scala.collection.mutable.ListBuffer
import scala.math.random
import scalala.library.LinearAlgebra.pinv
import scalala.tensor.dense.DenseMatrix
import scalala.tensor.dense.DenseVector
import scalala.tensor.mutable.Matrix
import scalala.tensor.mutable.Vector
import scalala.tensor.::
@jkdeveyra
jkdeveyra / Sample.scala
Created January 7, 2012 17:46
Extreme Learning Machine Draft Implementation
import scala.Array.canBuildFrom
import scala.collection.mutable.ListBuffer
import scala.math.random
import scalala.library.LinearAlgebra.pinv
import scalala.tensor.dense.DenseMatrix
import scalala.tensor.dense.DenseVector
import scalala.tensor.mutable.Matrix
import scalala.tensor.mutable.Vector
import scalala.tensor.::
@jkdeveyra
jkdeveyra / Laplacian.java
Created February 29, 2012 14:16
ImageScience Laplacian Implementation
package imagescience.feature;
import imagescience.image.Aspects;
import imagescience.image.Axes;
import imagescience.image.Coordinates;
import imagescience.image.Dimensions;
import imagescience.image.FloatImage;
import imagescience.image.Image;
import imagescience.utility.ImageScience;
import imagescience.utility.Messenger;
#Models
#equipment_specs.rb
class EquipmentSpec
include Mongoid::Document
field :specification, type: String
validates :specification, presence: true
field :price, type: BigDecimal
/**
* This program shows how to store tabular data in a 2D array.
*
* @version 1.40 2004-02-10
* @author Cay Horstmann
*/
public class CompoundInterest {
public static void main(String[] args) {
final double STARTRATE = 10;
final int NRATES = 6;
def sentenceAnagrams(sentence: Sentence): List[Sentence] = {
def subSentence(occ: Occurrences): List[Sentence] = {
if (occ.isEmpty) List(List())
else
for {
x <- combinations(occ)
y <- dictionaryByOccurrences(x)
z <- subSentence(subtract(occ, x))
} yield y :: z
import sbt._
import Keys._
import play.Project._
object ApplicationBuild extends Build {
val appName = "SubProjectExample"
val appVersion = "1.0-SNAPSHOT"
val core = Project("core", file("core"))
int ans, i;
for (i = 1; i < 6; i++) {
ans = i % 2;
if (ans == 1)
System.out.print(i + 1)
}
int x = 7 + 3 * 6 / 2 - 1;
System.out.println(x);
@jkdeveyra
jkdeveyra / ERCForest.scala
Last active August 29, 2015 13:57
ERC Forest
case class ERCForestConf(nbTrees: Int = 8, treeConf: ERCTreeConf = ERCTreeConf())
case class ERCForest(trees: IndexedSeq[ERCTree]) {
def assignIndexSeq(pt: Seq[Seq[Float]]): Seq[Int] = {
trees.map(_.query(pt)).flatten
}
def numClusters = trees.map(_.leavesSize).sum
}