This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def recursiveListFiles(f: File): ArraySeq[File] = { | |
val these = f.listFiles | |
ArraySeq.from(these ++ these.filter(_.isDirectory).flatMap(recursiveListFiles)) | |
} | |
/// | |
import java.io.File | |
def getListOfFiles(dir: String): List[File] = { | |
def go(dir: File): List[File] = dir match { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _reduce(l: Seq[(String, Json)]): Json = l match { | |
case ::(x, xs) => | |
if (x._2.isNull) { | |
dropNull(Json.fromFields(xs)) | |
} else { | |
val jj = Json.fromJsonObject(JsonObject((x._1, dropNull(x._2)))) | |
xs match { | |
case Nil => jj | |
case _ => dropNull(Json.fromFields(xs)).deepMerge(jj) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <atomic> | |
using namespace std; | |
#ifdef _WIN32 | |
#include <intrin.h> | |
#pragma intrinsic(_InterlockedExchange) | |
#define LOCK_TEST_AND_SET(_lock) _InterlockedExchange(&_lock, 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include "../util/Singleton.h" | |
#include "../util/Time.h" | |
#include <iostream> | |
#include "../threadPool/Spinlock.h" | |
using namespace std; | |
namespace _logger { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package trackit.helper | |
import java.io.{File, FileInputStream, FileOutputStream} | |
import cats.effect.IO | |
import cats.effect.Resource.fromAutoCloseable | |
import org.apache.commons.compress.archivers.{ArchiveOutputStream, ArchiveStreamFactory} | |
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry | |
import org.apache.commons.compress.utils.IOUtils | |
object ZipHelper { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ -f .bumpversion.cfg ] || echo "Error file .bumpversion.cfg does not exist" | |
cp .bumpversion.cfg /tmp/.bumpversion.cfg | |
printf "choice: minor|major|patch ";read version | |
bumpversion --config-file /tmp/.bumpversion.cfg $version | |
NEXT_VERSION=$(grep current_version /tmp/.bumpversion.cfg |awk -F "= " '{print $2}') && echo "next version: $NEXT_VERSION" | |
git flow release start $NEXT_VERSION | |
cp /tmp/.bumpversion.cfg . | |
#update build.sbt | |
sed -r -i 's/^version := "(\b[0-9]{1,3}\.){2}[0-9]{1,3}\b"'/"version := \"$NEXT_VERSION\""/ build.sbt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Currying where | |
addF :: Integer -> Integer -> Integer | |
addF a b = a + b | |
res = addF 1 2 | |
main :: IO () | |
main = print res |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Cinnamon UCI chess engine | |
Copyright (C) Giuseppe Cannella | |
This program is free software: you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation, either version 3 of the License, or | |
(at your option) any later version. | |
This program is distributed in the hope that it will be useful, |