Skip to content

Instantly share code, notes, and snippets.

Avatar

George Mamaladze gmamaladze

View GitHub Profile
@gmamaladze
gmamaladze / index.html
Last active Aug 29, 2015
Lego Power Functions Remote Control UI
View index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Lego Power Functions Remote Control</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.11.0/themes/smoothness/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="http://code.jquery.com/ui/1.11.0/jquery-ui.js"></script>
</head>
<body>
@gmamaladze
gmamaladze / A_README.md
Last active Nov 6, 2021
HashSet that preserves insertion order or .NET implementation of LinkedHashSet
View A_README.md

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
gmamaladze / README.md
Last active Feb 4, 2021 — forked from mbostock/.block
Nodes snapping to colored clusters - d3.js sample
View README.md

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.