Skip to content

Instantly share code, notes, and snippets.

View visenger's full-sized avatar
❤️
Focusing

Dr. Larysa Visengeriyeva visenger

❤️
Focusing
View GitHub Profile
public class TestAcceptedMediaTypes {
private static final MediaType[] SUPPORTED_MEDIA_TYPES = new MediaType[] { MediaType.APPLICATION_JSON,
MediaType.APPLICATION_XML };
@TestFactory
Collection<DynamicTest> testAcceptedMediaTypes() throws Exception {
// Creating a classpath scanner to find all controller classes in project
ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner(new DefaultListableBeanFactory(),
@giannisp
giannisp / gist:ebaca117ac9e44231421f04e7796d5ca
Last active July 14, 2024 18:27
Upgrade PostgreSQL 9.6.5 to 10.0 using Homebrew (macOS)
After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work.
The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0."
Database files have to be updated before starting the server, here are the steps that had to be followed:
# need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default
brew unlink postgresql
brew install [email protected]
brew unlink [email protected]
brew link postgresql
#!/bin/sh
# Author: Nikita Kovalev, https://gist.github.com/maizy/c4d31c1f539694f721f6
# Based on: https://gist.github.com/visenger/5496675
# Use java7 dependency (openjdk) instead of java6.
# Tested in Ubuntu 12.04.5 (precise)
SCALA="2.11.2"
SBT="0.13.5"
@mhuelfen
mhuelfen / wm-cn-conversion.py
Created July 10, 2014 21:18
Converts a weltmodell tsv file into the plain conceptnet json format.
# encoding: utf-8
'''
Script to convert the weltmodell into the conceptnet.
@author: Michael A. Huelfenhaus
'''
import sys
import csv
import hashlib
@alaiacano
alaiacano / all_yzt.sql
Last active January 2, 2016 15:58
`p(x|z,y,t)`, untested
select numerator.x, numerator.num/denominator.denom, numerator.y, numerator.z, numerator.t
(select sum(x) as num, x, y, z, t from table group by x, y, z, t) numerator
join
(select sum(x) as denom, y, z, t from table group by y,z,t) denominator
on (numerator.y=denominator.y and numerator.z=denominator.z and numerator.t=denominator.t)
@debasishg
debasishg / gist:8172796
Last active November 11, 2024 07:10
A collection of links for streaming algorithms and data structures

General Background and Overview

  1. Probabilistic Data Structures for Web Analytics and Data Mining : A great overview of the space of probabilistic data structures and how they are used in approximation algorithm implementation.
  2. Models and Issues in Data Stream Systems
  3. Philippe Flajolet’s contribution to streaming algorithms : A presentation by Jérémie Lumbroso that visits some of the hostorical perspectives and how it all began with Flajolet
  4. Approximate Frequency Counts over Data Streams by Gurmeet Singh Manku & Rajeev Motwani : One of the early papers on the subject.
  5. [Methods for Finding Frequent Items in Data Streams](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.187.9800&amp;rep=rep1&amp;t
@ferodss
ferodss / install_scala_sbt_play.sh
Last active December 26, 2015 09:29 — forked from visenger/install_scala_sbt.sh
Install Scala Lang 2.10.3, Scala SBT 0.13.0 and Play Framework 2.2.0
#!/bin/sh
echo "Downloading and installing Scala 2.10.3..."
sudo /usr/local/src
sudo wget -c http://www.scala-lang.org/files/archive/scala-2.10.3.tgz
sudo tar zxf scala-2.10.3.tgz
sudo mv scala-2.10.3 /usr/share/scala
sudo ln -s /usr/share/scala/bin/scala /usr/bin/scala