Skip to content

Instantly share code, notes, and snippets.

View Andrei-Pozolotin's full-sized avatar

Andrei Pozolotin Andrei-Pozolotin

View GitHub Profile
@Andrei-Pozolotin
Andrei-Pozolotin / 1-INCR-scala-native-build.log
Last active March 25, 2018 22:58
sample scala-native build timings in Scala IDE with scalor-maven-plugin: FULL vs INCREMENTAL
//
// Sample incremental buld times for minimal Main.scala
// * after warm up
// * cached away: discovery, nativelib compile/unpack, etc.
//
[INFO] Incremental build request.
[INFO] Linking binary mode=debug.
[INFO] Linking NIR
[INFO] [time] 0 s 801 ms
@Andrei-Pozolotin
Andrei-Pozolotin / 0-error.log
Last active March 26, 2018 00:55
undefined reference to `localtime_s'
[INFO] [scala-native-link-test] Linking output runtime binary
[ERROR] [scala-native-link-test] /home/work/source/git/scala-ns/target/scalor/native/workdir/test/debug/build/com.carrotgarden.ns.util.ll.o: In function `com.carrotgarden.ns.util.Logging$Formatter$$anonfun$timeStamp$1::apply_scala.scalanative.native.Zone_java.lang.String':
[ERROR] [scala-native-link-test] /home/work/source/git/scala-ns/target/scalor/native/workdir/test/debug/build/com.carrotgarden.ns.util.ll:(.text+0x69): undefined reference to `localtime_s'
[ERROR] [scala-native-link-test] clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
[ERROR] /home/work/source/git/scala-ns/pom.xml [1:1]: Execution failure
java.lang.RuntimeException: Failed to invoke command: /usr/bin/clang++ -o /home/work/source/git/scala-ns/target/scalor/native/output/test/debug -lrt -lunwind -lunwind-x86_64 -lgc -L/usr/local/lib -L/usr/lib -target x86_64-unknown-linux-gnu -lpthread /home/work/source/git/scala-ns/target/scalor/native/workdir/
1. say I have 3 packages wihich contribute 3 folders into the same base
pkg1
```
/base/dir1
```
pkg2
```
package com.carrotgarden.base.osgi_aj;
import java.util.ArrayList;
import java.util.List;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
import org.osgi.framework.hooks.weaving.WeavingHook;
import org.slf4j.Logger;
@Andrei-Pozolotin
Andrei-Pozolotin / Atom.scala
Created June 22, 2018 16:50 — forked from kirked/Atom.scala
Clojure atoms, in Scala
/*------------------------------------------------------------------------------
* MIT License
*
* Copyright (c) 2017 Doug Kirk
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@Andrei-Pozolotin
Andrei-Pozolotin / hash_fnv1a.h
Created April 10, 2019 20:01 — forked from ruby0x1/hash_fnv1a.h
FNV1a c++11 constexpr compile time hash functions, 32 and 64 bit
#pragma once
#include <stdint.h>
//fnv1a 32 and 64 bit hash functions
// key is the data to hash, len is the size of the data (or how much of it to hash against)
// code license: public domain or equivalent
// post: https://notes.underscorediscovery.com/constexpr-fnv1a/
inline const uint32_t hash_32_fnv1a(const void* key, const uint32_t len) {
@Andrei-Pozolotin
Andrei-Pozolotin / build.sh
Created April 15, 2019 14:33
kicad build script
#!/bin/bash
# kicad build script
# place this file in kicad/build folder
# kicad/build
here_dir=$(pwd $(dirname "$0"))
echo "here_dir=$here_dir"
# kicad/.
@Andrei-Pozolotin
Andrei-Pozolotin / main.setup
Last active April 21, 2019 19:55
oomph: Basic setup composability
<?xml version="1.0" encoding="UTF-8"?>
<setup:Product xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:setup="http://www.eclipse.org/oomph/setup/1.0"
xmlns:setup.p2="http://www.eclipse.org/oomph/setup/p2/1.0"
name="main" label="">
<version name="2019-03" label="Eclipse 2019-03"
requiredJavaVersion="1.8">
<setupTask xsi:type="setup.p2:P2Task" label="oomph">
@Andrei-Pozolotin
Andrei-Pozolotin / progress.py
Created May 9, 2019 23:15 — forked from NateEag/progress.py
A way to DRY wxPython progress dialogs for background threads.
#! /usr/bin/env python
"""Tools for running threads behind a wx.ProgressDialog."""
# Standard library imports.
import sys
import threading
import time
# Third party imports.
@Andrei-Pozolotin
Andrei-Pozolotin / a-brython-1182.txt
Last active August 10, 2019 11:21
brython #1182
https://github.com/brython-dev/brython/issues/1182