Skip to content

Instantly share code, notes, and snippets.

View alexott's full-sized avatar
🏠
Working from home

Alex Ott alexott

🏠
Working from home
View GitHub Profile
@alexott
alexott / App.java
Last active March 10, 2018 18:31
UDT + Object mapper in DataStax Java Driver
package com.datastax.demos.alexott.product;
import com.datastax.driver.core.Cluster;
import com.datastax.driver.core.CodecRegistry;
import com.datastax.driver.core.Session;
import com.datastax.driver.mapping.Mapper;
import com.datastax.driver.mapping.MappingManager;
public class App {
cqlsh:test> DESCRIBE table log;
CREATE TABLE test.log (
module text,
yyyymmdd text,
created timeuuid,
logmessage text,
PRIMARY KEY ((module, yyyymmdd), created)
) WITH CLUSTERING ORDER BY (created ASC)
AND bloom_filter_fp_chance = 0.01
@alexott
alexott / ResultSetSerializer.java
Created February 3, 2018 15:29
JSON serialization of Java's ResultSet returned by DataStax Java Driver
package com.datastax.alexott.demos.jdtest1;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.datastax.driver.core.ColumnDefinitions;
import com.datastax.driver.core.DataType;
import com.datastax.driver.core.ResultSet;
import com.datastax.driver.core.Row;
@alexott
alexott / App.java
Created January 10, 2018 09:29
java.util.LocalDate mapping in Cassandra
package jdtest1;
import java.util.UUID;
import com.datastax.driver.core.Cluster;
import com.datastax.driver.core.Session;
import com.datastax.driver.mapping.Mapper;
import com.datastax.driver.mapping.MappingManager;
public class App {
@alexott
alexott / cld-stat.txt
Last active July 15, 2019 09:45
Data related to language detection evaluation
# language true-positive total accuracy
af 32 34 0.94
ar 200 201 0.99
az 161 161 1.00
be 157 157 1.00
bg 195 203 0.96
bn 198 198 1.00
ca 193 193 1.00
cs 195 196 0.99
da 198 200 0.99
@alexott
alexott / build-confluent-packages.sh
Last active September 1, 2017 14:28
Rebuild C/C++ packages provided by Confluent
#!/bin/bash
# By default, Confluent provides Debian versions of their packages via APT - as result, they are linked
# to other versions of the libraries than in Ubuntu, ...
# This small script rebuilds them on Ubuntu, or Debian versions different from provided by default.
MY_BUILD_DIR="build-$$"
mkdir $MY_BUILD_DIR
cd $MY_BUILD_DIR
apt-get source librdkafka libavro-cpp-dev libavro-c-dev confluent-libserdes-dev
@alexott
alexott / TestGenson.java
Created April 28, 2015 11:48
Minimal test case reproducing Genson error
package test;
import com.owlike.genson.Genson;
import com.owlike.genson.GensonBuilder;
import java.util.HashMap;
import java.util.Map;
public class TestGenson {
@alexott
alexott / keybase.md
Last active August 29, 2015 14:16
keybase.md

Keybase proof

I hereby claim:

  • I am alexott on github.
  • I am alexott (https://keybase.io/alexott) on keybase.
  • I have a public key whose fingerprint is F44D C864 AB51 8652 21E1 51C5 5828 4E39 1698 B501

To claim this, I am signing this object:

@alexott
alexott / cedet-1.1-startup.el
Created October 28, 2012 13:42
Working configuration for CEDET 1.1 & below (only separate releases, not included into GNU Emacs)
;;; cedet-1.1-startup.el --- Working configuration for CEDET 1.1 & below
;; Copyright (C) Alex Ott
;;
;; Author: Alex Ott <alexott@gmail.com>
;; Keywords: CEDET 1.1,
;; Requirements: CEDET 1.1 or below
(load-file "~/tmp/cedet-1.1/common/cedet.el")
(require 'semantic-decorate-include)
@alexott
alexott / minimial-cedet-config.el
Created October 22, 2012 07:30
Working configuration for CEDET from bzr & GNU Emacs (with working C++ & Java name completion)
;;; minimial-cedet-config.el --- Working configuration for CEDET from bzr
;; Copyright (C) Alex Ott
;;
;; Author: Alex Ott <alexott@gmail.com>
;; Keywords: cedet, C++, Java
;; Requirements: CEDET from bzr (http://cedet.sourceforge.net/bzr-repo.shtml)
;; Do checkout of fresh CEDET, and use this config (don't forget to change path below)