Skip to content

Instantly share code, notes, and snippets.

View bambuchaAdm's full-sized avatar

Łukasz Dubiel bambuchaAdm

View GitHub Profile
@bambuchaAdm
bambuchaAdm / ApplicationModule.scala
Last active March 8, 2019 15:22
Schedule Jobs POC
import com.google.inject.AbstractModule
object ApplicationModule extends AbstractModule with JobSyntax {
override def configure(): Unit = {
install(job[MyJob].named("my"))
install(job[OtherJob].named("other"))
}
}
@bambuchaAdm
bambuchaAdm / example.scala
Last active February 27, 2019 08:54
Note about SSLEngine
package example
import java.net.InetSocketAddress
import java.nio.ByteBuffer
import java.nio.channels.SocketChannel
import java.nio.charset.Charset
import java.util
import com.mongodb.ServerAddress
import com.mongodb.connection.{AsyncCompletionHandler, SocketSettings, SslSettings, Stream, StreamFactory, StreamFactoryFactory}
@bambuchaAdm
bambuchaAdm / main.cpp
Created December 29, 2018 21:20
Suffix array creation in O(n log^{2} n)
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <array>
#include <algorithm>
struct Prefix {
std::string& source;
int offset;
@bambuchaAdm
bambuchaAdm / main.cpp
Last active November 27, 2018 22:17
with creation
#include <cstdio>
#include <string>
#include <tuple>
template <class T, class... Args>
class Deserializer {
};
template <>
@bambuchaAdm
bambuchaAdm / example.scala
Created January 27, 2017 06:11
Result is (A \ B, B \ A) => should be faster the solution based on collection combinators and for comprehension
private def setsDifferences[A](a: SortedSet[A], b: SortedSet[A]): (Iterable[A], Iterable[A]) = {
require(a.ordering == b.ordering, "Sets must use same ordering")
val ordering = a.ordering
@tailrec
def interLoop(accA: List[A], a: SortedSet[A], b: SortedSet[A], accB: List[A]): (List[A], List[A]) = {
(a.headOption, b.headOption) match {
case (Some(elemA), Some(elemB)) =>
ordering.compare(elemA, elemB) match {
case result if result == 0 => interLoop(accA, a.tail, b.tail, accB)
case result if result > 0 => interLoop(accA, a, b.tail, elemB::accB)
src/
├── main
│   ├── assets
│   │   ├── images
│   │   ├── javascripts
│   │   └── stylesheets
│   │   └── base.css
│   ├── resources
│   │   └── application.conf
│   ├── scala
@bambuchaAdm
bambuchaAdm / rail.scad
Created July 27, 2015 14:19
Simple rai
include <libstuff/bolt_commons.scad>
use <libstuff/imbus.scad>
module sbr16_rail(length){
echo("SRB16x" + length);
rotate([90,0,90]){
linear_extrude(length){
import("16-rail.dxf");
}
}
@bambuchaAdm
bambuchaAdm / rankings.feature
Created May 25, 2015 02:39
Kudosy gherkin description
Feature: Rankings
Ranking allow comunity to know who and how much working for comunity.
Background:
Given: User is logged in
Scenario: Rankings for week is default
When: User click rankings button
Then: There should be table in front
And: Time range should be one week
UMAR_W_BUTACH
.LIB L1DO5.LIB
*.MODEL MOS NMOS(LEVEL=2)
.PARAM Ugs 0
M1 2 1 0 0 LEVEL1 W=25u L=2u
V2 2 0 0
V1 1 0 {Ugs}
% m-plik skrytpowy: rozwiazanie_zadania_3.m
%
% Laboratorium: Cyfrowe Przetwarzanie Sygnałów;
% Katedra Elektroniki, WIEiT, AGH;
%
% Opracowanie: Przemyslaw Koerohoda,, 12/05/2015;
clc; clear; close all;
fp=11025; fg=1000;