Skip to content

Instantly share code, notes, and snippets.

@rupey
rupey / mandelbrot.sql
Last active December 7, 2020 05:38
Mandelbrot plot in postgres
WITH RECURSIVE
x(i) AS ( VALUES (0)
UNION ALL SELECT i + 1
FROM x
WHERE i < 101),
Z(Ix, Iy, Cx, Cy, X, Y, I) AS (
SELECT
Ix,
Iy,
X :: FLOAT,
@francoishill
francoishill / loop_files_folders_recursively.go
Created August 1, 2014 16:52
Loop through files and folders recursively in golang
package main
import (
"fmt"
"os"
"path/filepath"
)
func main() ([]string, error) {
searchDir := "c:/path/to/dir"
PLT_NAME=.projectname_dialyzer.plt
$(PLT_NAME):
@ERL_LIBS=../erllib/deps dialyzer --build_plt --output_plt $(PLT_NAME) \
--apps erts kernel stdlib sasl crypto lager jiffy \
amqp_client rabbit_common || true
dialyze: $(PLT_NAME)
@dialyzer apps/projectname/ebin --plt $(PLT_NAME) --no_native \
-Werror_handling -Wunderspecs -Wrace_conditions
@jcraane
jcraane / logback.xml
Created July 3, 2013 18:26
Sample logback.xml file with console and rolling file appender. The rollover is time based (daily) and size based, 5MB.
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true">
<appender name="consoleAppender" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<charset>UTF-8</charset>
<Pattern>%d %-4relative [%thread] %-5level %logger{35} - %msg%n</Pattern>
</encoder>
</appender>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
@mblondel
mblondel / svm.py
Last active April 21, 2024 13:41
Support Vector Machines
# Mathieu Blondel, September 2010
# License: BSD 3 clause
import numpy as np
from numpy import linalg
import cvxopt
import cvxopt.solvers
def linear_kernel(x1, x2):
return np.dot(x1, x2)