Skip to content

Instantly share code, notes, and snippets.

// From http://code.google.com/p/android-native-egl-example/
#include <stdint.h>
#include <unistd.h>
#include <pthread.h>
#include <android/native_window.h> // requires ndk r5 or newer
#include <EGL/egl.h> // requires ndk r5 or newer
#include <GLES2/gl2.h>
#include "logger.h"
[info] Set current project to bar (in build file:/Users/ngoc/tmp/x/)
[info] Generating Scala API documentation for main sources to /Users/ngoc/tmp/x/target/scala-2.10/api...
model contains 4 documentable templates
java.lang.AssertionError: assertion failed:
while compiling: /Users/ngoc/tmp/x/src/main/scala/foo/B.scala
during phase: global=terminal, atPhase=typer
library version: version 2.10.1
compiler version: version 2.10.1
reconstructed args: -Yno-self-type-checks -d /Users/ngoc/tmp/x/target/scala-2.10/api -classpath dummy_82279db5 -bootclasspath /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jsfd.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/classes.jar:/System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/Resources/Java/JavaRuntimeSupport.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/ui.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/laf.jar:/System/Libra
C:\Users\tanaka\Downloads\xitrum-demos-2.10\target\xitrum>java -Xmx1024m -Xms256m -XX:MaxPermSize=128m -XX:+HeapDumpOnOutOfMemoryError -XX:+Aggressive
Opts -XX:+OptimizeStringConcat -XX:+UseFastAccessorMethods -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+CMSClassUnloadi
ngEnabled -XX:SurvivorRatio=8 -XX:MaxTenuringThreshold=1 -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -Djava.awt.headless=
true -server -Dxitrum.mode=production -cp "C:\Users\tanaka\Downloads\xitrum-demos-2.10\target\xitrum\bin\..\lib\*;config" demos.Boot
[INFO] Slf4jLogger started
[INFO] Using configuration file at C:\Users\tanaka\Downloads\xitrum-demos-2.10\target\xitrum\config\hazelcast_cluster_member.xml
[INFO] Using configuration file at C:\Users\tanaka\Downloads\xitrum-demos-2.10\target\xitrum\config\hazelcast_cluster_member.xml
[INFO] Prefer IPv4 stack is true.
[INFO] Picked Address[192.168.1.12]:5701, using socket ServerSocket[addr=/0.0.0.0,localport=5701], bind any local is tr
@ngocdaothanh
ngocdaothanh / gist:7315180
Last active December 27, 2015 10:59
Hazelcast Topic 2.5.1 vs 3.1
// https://docs.google.com/file/d/0B4nP_B5KDxyPdnFySDJhVDI2Ujg/edit?usp=sharing
// https://groups.google.com/forum/#!searchin/hazelcast/ngoc/hazelcast/aeSPHp82Dcs/R5ZzkIfvCukJ
package test
import com.hazelcast.core.Hazelcast
object TestManyTopic {
def main(args: Array[String]): Unit = {
val c = null//new Config
#!/bin/bash
###########################################################################
# Choose your ffmpeg version and your currently-installed iOS SDK version:
#
VERSION="2.1.1"
SDKVERSION="7.0"
#
#
###########################################################################
@ngocdaothanh
ngocdaothanh / rtsp_to_file.sh
Created December 8, 2013 02:46
Use ffmpeg to save NVC1000 & IPE300M video streams to files
ffmpeg -i rtsp://211.241.204.87/ch0_unicast_firststream -vcodec msmpeg4v2 -an output.avi
ffmpeg -i rtsp://211.241.204.87/ch0_unicast_secondstream -vcodec msmpeg4v2 -an output.avi
@ngocdaothanh
ngocdaothanh / Build.scala
Created June 15, 2011 01:37
dependsOn packageBin
import sbt._
import Keys._
object MyBuild extends Build {
val mySettings = Defaults.defaultSettings ++ Seq(
organization := "tv.cntt",
name := "comy",
version := "1.3-SNAPSHOT",
scalaVersion := "2.9.0-1"
)
<%--
Document : one
Created on : 24/03/2017, 3:37:22 PM
Author : Tyler
--%>
<html>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<head>
@ngocdaothanh
ngocdaothanh / introrx.md
Last active December 28, 2017 20:16 — forked from staltz/introrx.md

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called Reactive Programming, particularly its variant comprising of Rx, Bacon.js, RAC, and others.

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

@ngocdaothanh
ngocdaothanh / Benchmark.scala
Created December 17, 2011 14:00
ByteBuffer.allocateDirect vs Unsafe
object Benchmark {
private val LOOP_COUNT = 1000000
private val ARRAY_SIZE = 1024
def main(args: Array[String]) {
val t1 = System.currentTimeMillis
var i = 0
while (i < LOOP_COUNT) {
testDirectByteBuffer