Graph visualization library in JavaScript

I’ve just put together what you may be looking for: http://www.graphdracula.net It’s JavaScript with directed graph layouting, SVG and you can even drag the nodes around. Still needs some tweaking, but is totally usable. You create nodes and edges easily with JavaScript code like this: var g = new Graph(); g.addEdge(“strawberry”, “cherry”); g.addEdge(“cherry”, “apple”); g.addEdge(“id34”, … Read more

Simplest code for array intersection in javascript

Use a combination of Array.prototype.filter and Array.prototype.includes: const filteredArray = array1.filter(value => array2.includes(value)); For older browsers, with Array.prototype.indexOf and without an arrow function: var filteredArray = array1.filter(function(n) { return array2.indexOf(n) !== -1; }); NB! Both .includes and .indexOf internally compares elements in the array by using ===, so if the array contains objects it will … Read more

Ukkonen’s suffix tree algorithm in plain English

The following is an attempt to describe the Ukkonen algorithm by first showing what it does when the string is simple (i.e. does not contain any repeated characters), and then extending it to the full algorithm. First, a few preliminary statements. What we are building, is basically like a search trie. So there is a … Read more

Why is Dictionary preferred over Hashtable in C#?

For what it’s worth, a Dictionary is (conceptually) a hash table. If you meant “why do we use the Dictionary<TKey, TValue> class instead of the Hashtable class?”, then it’s an easy answer: Dictionary<TKey, TValue> is a generic type, Hashtable is not. That means you get type safety with Dictionary<TKey, TValue>, because you can’t insert any … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)