Skip to content

Instantly share code, notes, and snippets.


George Mamaladze gmamaladze

View GitHub Profile
gmamaladze / index.html
Last active Aug 29, 2015
Lego Power Functions Remote Control UI
View index.html
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>Lego Power Functions Remote Control</title>
<link rel="stylesheet" href="">
<script src=""></script>
<script src=""></script>
gmamaladze /
Last active Nov 6, 2021
HashSet that preserves insertion order or .NET implementation of LinkedHashSet

HashSet that preserves insertion order or .NET implementation of LinkedHashSet

Many people naively assume an ordinary .NET HashSet preserves insertion order. Indeed HashSet accidentally preserves insertion order until you remove and re-add some elements. There is such a data structure in Java - LinkedHashSet which respects order and has O(1) RW times.

No, I did not find a (working) corresponding implementation in .NET. That's I wrote this one.

The implementation uses linked list in combination with dictionary to define the iteration, ordering and at the same time allow O(1) removal.

The order is not affected if an element is re-inserted into the set it retains it's old position.

gmamaladze /
Last active Feb 4, 2021 — forked from mbostock/.block
Nodes snapping to colored clusters - d3.js sample

Drag gray nodes into one of the colored clusters. They will snap to the group. You can also move nodes out of groups to regroup them.

Created using D3's force layout. Forekd from Multi-Foci Force Layout.

This code is distributed under MIT license. Copyright (c) 2013 George Mamaladze. See MIT license.