Skip to content

Instantly share code, notes, and snippets.

View GertjanBrouwer's full-sized avatar

Gertjan Brouwer GertjanBrouwer

View GitHub Profile
PS C:\Users\gertj\Documents\Xamarin.Forms> ./build.ps1 -Target NugetPack
Tool 'cake.tool' (version '1.0.0') was restored. Available commands: dotnet-cake
Restore was successful.
The assembly 'Cake.Xamarin, Version=3.0.2.0, Culture=neutral, PublicKeyToken=null'
is referencing an older version of Cake.Core (0.33.0).
For best compatibility it should target Cake.Core version 1.0.0.
The assembly 'Cake.Android.Adb, Version=3.2.0.0, Culture=neutral, PublicKeyToken=null'
is referencing an older version of Cake.Core (0.33.0).
For best compatibility it should target Cake.Core version 1.0.0.
import Data.Char
iunwords :: [String] -> String
iunwords [] = ""
iunwords [x] = x
iunwords (x:y:ys) = x ++ " " ++ iunwords (y:ys)
junwords :: [String] -> String
junwords (x:xs) = foldr func "" (x:xs)
where
@GertjanBrouwer
GertjanBrouwer / write_sift_desc_to_fvecs.py
Last active August 7, 2019 13:29
write_sift_desc_to_fvecs.py
grayImg = cv2.imread('../my-images/' + row[1], 0)
keypoints, descriptors = sift.detectAndCompute(grayImg, None)
descriptors = np.insert(descriptors, 0, 128, 1)
vectorArray = np.concatenate((vectorArray, descriptors), axis = 0)
vectorArray.astype(np.int32).tofile('./my_sift_descriptors.fvecs')
#the above code is faulty and should first insert an int32 of with the dimension as value and subsequently float32 values of the vector itself
#the following code is correct:
package tspsim;
public class Product implements Cloneable{
private int id;
private int x;
private int y;
public Product(int id, int x, int y) {
this.id = id;
this.x = x;
@GertjanBrouwer
GertjanBrouwer / splittingdata.py
Created February 15, 2018 13:24
Split data into train and valid directories
import os
import glob
import numpy as np
#goal: when I have a directory structure that looks like this:
# -data
# -cats(contains all cat images)
# -dogs(contains all dog images)
# -elephants(contains all elephant images)
#
<html>
<head></head>
<body>
<p id="timer">
</p>
<style>
#timer{
font-size: 60px;
}
</style>