Simple gc using integer vectors to simulate

Overview

gcint

Simple gc using integer vectors to simulate

Iterate primarily over what should be the shorter vector (readers) removing unused references in from versions vector

Changelog

  • v0.2: left-truncated versions slice on match to readers value to shorten range of next iteration

Run

go run main.go

Sample output:

Running: gcint v0.2
======================================
versions=[1 5 10 14]
readers=[7 11 12]
EVAL: reader[0]=7
EVAL: version[0]=1
EVAL: version[1]=5
EVAL: version[2]=10
  >> APPEND: version=[5]; reader=[7]
NEW: versions=[10 14]
EVAL: reader[1]=11
EVAL: version[0]=10
EVAL: version[1]=14
  >> APPEND: version=[10]; reader=[11]
NEW: versions=[14]
EVAL: reader[2]=12
EVAL: version[0]=14
preserve=[5 10 14]
expected=[5 10 14]; result=[5 10 14]

Test

Run all unit tests (i.e., main_test.go)

go test -v

Sample output:

=== RUN   TestSimple
versions=[1 5 10 14]
readers=[7 11]
EVAL: reader[0]=7
EVAL: version[0]=1
EVAL: version[1]=5
EVAL: version[2]=10
  >> APPEND: version=[5]; reader=[7]
NEW: versions=[10 14]
EVAL: reader[1]=11
EVAL: version[0]=10
EVAL: version[1]=14
  >> APPEND: version=[10]; reader=[11]
NEW: versions=[14]
preserve=[5 10 14]
expected=[5 10 14]; result=[5 10 14]
--- PASS: TestSimple (0.00s)

=== RUN   TestSimple2
versions=[1 5 10 14]
readers=[7 11 12]
EVAL: reader[0]=7
EVAL: version[0]=1
EVAL: version[1]=5
EVAL: version[2]=10
  >> APPEND: version=[5]; reader=[7]
NEW: versions=[10 14]
EVAL: reader[1]=11
EVAL: version[0]=10
EVAL: version[1]=14
  >> APPEND: version=[10]; reader=[11]
NEW: versions=[14]
EVAL: reader[2]=12
EVAL: version[0]=14
preserve=[5 10 14]
expected=[5 10 14]; result=[5 10 14]
--- PASS: TestSimple2 (0.00s)
PASS
ok  	github.com/mrutkows/gc	0.147s
Owner
Matt Rutkowski
STSM, Serverless Open Tech. he/him
Matt Rutkowski
Go package for OCR (Optical Character Recognition), by using Tesseract C++ library

gosseract OCR Golang OCR package, by using Tesseract C++ library. OCR Server Do you just want OCR server, or see the working example of this package?

Hiromu OCHIAI 1.6k Jan 11, 2022
Spice.ai is an open source, portable runtime for training and using deep learning on time series data.

Spice.ai Spice.ai is an open source, portable runtime for training and using deep learning on time series data. ⚠️ DEVELOPER PREVIEW ONLY Spice.ai is

Spice.ai 697 Jan 11, 2022
Incentivized AI Training Casino using ISCP for the Agri-D Hackaton!

Welcome to the Wasp repository! Wasp is a node software developed by the IOTA Foundation to run the IOTA Smart Contract Protocol (ISCP in short) on to

Zignar Technologies 1 Nov 12, 2021
Advent of Code 2016 in Go using only GitHub Copilot

Advent of Gopilot Solutions to Advent of Code 2016 in Go using only GitHub Copilot. "Rules" The idea is to have GitHub Copilot generate all the actual

Sarek Høverstad Skotåm 3 Nov 16, 2021
face detction/recognization golang lib using tensorflow facenet

Golang lib for detect/recognize by tensorflow facenet Prerequest libtensorfow 1.x Follow the instruction Install TensorFlow for C facenet tenorflow sa

Prof Syd Xu 0 Oct 15, 2021
Genetic algorithms using Golang Generics

Package genetic Package genetic implements genetic algorithms using Golang's Gen

Konnor Klashinsky 0 Dec 30, 2021
Fast, simple sklearn-like feature processing for Go

go-featureprocessing Fast, simple sklearn-like feature processing for Go Does not cross cgo boundary No memory allocation No reflection Convenient ser

Nikolay Dubina 68 Jan 6, 2022
A simple OCR API server, seriously easy to be deployed by Docker, on Heroku as well

ocrserver Simple OCR server, as a small working sample for gosseract. Try now here https://ocr-example.herokuapp.com/, and deploy your own now. Deploy

Hiromu OCHIAI 452 Jan 11, 2022
a simple & tiny scrapy clustering solution, considered a drop-in replacement for scrapyd

scrapyr a very simple scrapy orchestrator engine that could be distributed among multiple machines to build a scrapy cluster, under-the-hood it uses r

Mohammed Al Ashaal 50 Nov 24, 2021
A simple utility, written in Go, for interacting with Salesforce.

Salesforce CLI A simple utility, written in Go, for interacting with Salesforce. Currently only specific functionality is implemented, and the output

Darren Parkinson 0 Dec 14, 2021
A simple yet customisable program written in go to make hackerman-like terminal effects.

stuntman a simple program written in go to make you look like a hackerman Demo stuntman -binar -width 90 -color cyan stuntman -text -width 90 -vertgap

Solaris 13 Dec 23, 2021
Read and use word2vec vectors in Go

Introduction This is a package for reading word2vec vectors in Go and finding similar words and analogies. Installation This package can be installed

Daniël de Kok 43 Dec 24, 2021
A simple evaluator for arithmetic integer expressions.

The expr package provides a simple evaluator for arithmetic integer expressions. The syntax and operations are the same as in Go. Operands are the nat

Rob Pike 73 Dec 4, 2021
Simple go package which converts roman strings to integer

romanparse Simple go package which converts roman strings

Caio Ribeiro Pereira 2 Oct 6, 2021
This is a comprehensive system that simulate multiple servers’ consensus behavior at local machine using multi-process deployment.

Raft simulator with Golang This project is a simulator for the Raft consensus protocol. It uses HTTP for inter-server communication, and a job schedul

Yujie Zhang 0 Dec 22, 2021
godesim Simulate complex systems with a simple API.

godesim Simulate complex systems with a simple API. Wrangle non-linear differential equations while writing maintainable, simple code. Why Godesim?

Patricio Whittingslow 17 Nov 30, 2021
📡 mock is a simple, cross-platform, cli app to simulate HTTP-based APIs.

mock ?? mock is a simple, cross-platform, cli app to simulate HTTP-based APIs. About mock Mock allows you to spin up a local http server based of a .m

Bruno Schaatsbergen 5 Jan 9, 2022
Integer Compression Libraries for Go

Encoding This is a set of integer compression algorithms implemented in Go. It is an (incomplete) port of the JavaFastPFOR by Dr. Daniel Lemire. For m

null 110 Nov 28, 2021
fast integer log base 10

Package log10 calculates log base 10 of an integer, fast. It is inspired by Daniel Lemire's blog post on this topic. TODO: Add implementations for oth

Josh Bleecher Snyder 11 Aug 13, 2021
Unsigned Integer 32 Byte Packing Compression

dbp32 Unsigned Integer 32 Byte Packing Compression. Inspired by lemire/FastPFor. Package bp32 is an implementation of the binary packing integer compr

Ali Josie 2 Sep 6, 2021
Fast integer map for uint32-to-uint32

Uint32-to-Uint32 Map This repository contains an implementation of uint32-to-uint32 map which is ~20-50% faster than Go standard map for the same type

Roman Atachiants 2 Dec 7, 2021
Algorithms for various integer sequences from the OEIS site.

OEIS The ongoing quest to program every sequence in the OEIS database (in Golang) Content sequences -- The folder containing the seq package, which co

null 0 Dec 23, 2021
Program that counts the bits in an unsigned integer

popcountloop This is an exercise of the book The Go Programming Language, by Ala

Santiago Rodriguez 0 Dec 18, 2021
Guess-number-game - Computer thoughts of some integer number, you must guess it with limited number of attempts

Guess number game Rules Computer has thought of some integer number. You must guess it, you have numberOfAttempts attempts. How to run Just type in co

Nikita Shamaev 0 Dec 31, 2021
Simulate network link speed

linkio linkio provides an io.Reader and io.Writer that simulate a network connection of a certain speed, e.g. to simulate a mobile connection. Quick s

Ian Kent 49 Apr 20, 2021
:alarm_clock: :fire: A TCP proxy to simulate network and system conditions for chaos and resiliency testing

Toxiproxy Toxiproxy is a framework for simulating network conditions. It's made specifically to work in testing, CI and development environments, supp

Shopify 7.7k Jan 6, 2022
Go package to simulate bandwidth, latency and packet loss for net.PacketConn and net.Conn interfaces

lossy Go package to simulate bandwidth, latency and packet loss for net.PacketConn and net.Conn interfaces. Its main usage is to test robustness of ap

Cevat Barış Yılmaz 301 Jan 3, 2022
simulate linkstate algorithm for routing

for final project of computer-network course in SBU university (spring 2021) we implemented a Link-state simulation in go.

Roozbeh Sharifnasab 5 Nov 22, 2021
edotool: simulate keyboard input and mouse activity

edotool Simulate keystrokes. Like xdotool (well, kind of), with support for both X11 and Wayland. edotool Screengrab Using edotool keystrokes can be s

null 8 Jan 1, 2022