Skip to content

Instantly share code, notes, and snippets.

@zouzias
zouzias / hilbert.py
Created January 30, 2025 07:50 — forked from jrzingel/hilbert.py
Pseudo (generalised?) hilbert curve generator. Maps ordered items from a list to a 2D array. Importantly it works for any specified size, not just powers of two or even numbers
# Pseudo-hilbert curve generator. Maps ordered items from an array (1D) to a rectangle (2D)
# in a way that best retains the distances between indexes of the initial array as euclidean distances in the rectangle
#
# Hilbert curves are only possible for powers of 2, so the gilbert() function instead tries to fit as many hilbert
# "blocks" together as possible. This is through a greedy approach and works well enough for my needs
#
# Free for any use, but let me know so I know someone found it useful :)
#
# AUTHOR : James Zingel (2022)
@zouzias
zouzias / kaggle-research-competitions.txt
Created September 7, 2021 12:46
Kaggle Competition Requirements
Similar to kaggle
That being said, let's dive in.
DrivenData.
CROWDANALYTIX.
Signate.
Zindi.
Alibaba Cloud Tianchi.
Analytics Vidhya.
CodaLab.
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive
ENV ISPC_VERSION="1.9.2"
ENV EMBREE2_VERSION="2.17.4"
ENV EMBREE3_VERSION="3.2.0"
RUN apt update
RUN apt -yq upgrade
RUN apt -yq install wget cmake g++ clang git libtbb-dev libglfw3-dev libopenmpi-dev alien unzip
@zouzias
zouzias / README.md
Created November 25, 2019 10:50
Logstash split by newline madness
@zouzias
zouzias / enum.go
Created July 25, 2019 12:26 — forked from lummie/enum.go
Golang Enum pattern that can be serialized to json
package enum_example
import (
"bytes"
"encoding/json"
)
// TaskState represents the state of task, moving through Created, Running then Finished or Errorred
type TaskState int
package main
import (
"fmt"
"reflect"
"strings"
)
type Foo struct {
A int
@zouzias
zouzias / gist:3eea4a9da16331921f823d1acee1cb71
Created May 7, 2019 21:02
DBLP XML to Parquet using Spark
bin/spark-shell --packages com.databricks:spark-xml_2.11:0.5.0
scala> import com.databricks.spark.xml._
val df = spark.read.option("rowTag", "article").xml("/Users/anastasios/test/dblp.xml")
val df = spark.read.option("rowTag", "article").xml("/Users/anastasios/test/dblp/dblp.xml")
@zouzias
zouzias / alert.sh
Created April 30, 2019 14:09 — forked from cherti/alert.sh
send a dummy alert to prometheus-alertmanager
#!/bin/bash
name=$RANDOM
url='http://localhost:9093/api/v1/alerts'
echo "firing up alert $name"
# change url o
curl -XPOST $url -d "[{
\"status\": \"firing\",
@zouzias
zouzias / gist:a76f7de9cbb5db3731a1ff00742ecfd2
Created March 2, 2019 07:54
Builds with boost and Python quay.io (from Apache Arrow mailing list)
For the record (in case someone needs to do it again), these are the steps :
1. Make the change in build_boost.sh
2. Setup an account on quay.io <http://quay.io/> and link to your GitHub account
3. In quay.io <http://quay.io/>, Add a new repository using :
A. Link to GitHub repository push
B. Trigger build on changes to a specific branch (eg. myquay) of the repo (eq. pravindra/arrow)
@zouzias
zouzias / gist:adeeb5d6bbd6bc7d37ec057c5ac11ebd
Created September 10, 2018 19:37
sqooba_scalastyle.xml
<!--
If you wish to turn off checking for a section of code, you can put a comment in the source
before and after the section, with the following syntax:
// scalastyle:off
... // stuff that breaks the styles
// scalastyle:on
You can also disable only one rule, by specifying its rule id, as specified in: