A lot of you werent happy with the current state of structure modals. They were simply too small. All modals now adapt to the screen size and if the window gets too small, modals become scrollable, avoiding any usability issues.
This example pulls together various examples of work with trees in D3.js.
The panning functionality can certainly be improved in my opinion and I would be thrilled to see better solutions contributed.
One can do all manner of housekeeping or server related calls on the drop event to manage a remote tree dataset for example.
Dragging can be performed on any node other than root (flare). Dropping can be done on any node.
Panning can either be done by dragging an empty part of the SVG around or dragging a node towards an edge.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* `Ember.MergedArray` is an array that observes multiple other arrays (called source arrays) for changes and includes | |
* all items from all source arrays in an efficient way. | |
* | |
* Usage: | |
* | |
* ```javascript | |
* var obj = Ember.Object.create({ | |
* people: [ | |
* { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Complexity - O(n^2), Space Complexity - O(n^2) | |
private int[] findTriple_3(int[] A) { | |
Map<Integer, int[]> map = new HashMap<Integer, int[]>(); | |
for (int i = 0, l = A.length; i < l; i++) { | |
map.clear(); | |
for (int j = i + 1; j < l; j++) { | |
if (map.containsKey(A[j])) { | |
int[] pair = map.get(A[j]); | |
return new int[]{pair[0], pair[1], A[j]}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Select box utilizing Select2 functionality that overrides Ember.Select; | |
// Define view in the same way that you would an Ember.Select view. | |
// Additional attributes supported are: width, allowClear, and closeOnSelect; | |
// Example view: | |
// {{ view App.Select2 | |
// viewName="fieldValueSelect2" | |
// prompt="Please select a value list" | |
// contentBinding="controller.fieldValuesLists" | |
// optionLabelPath="content.name" | |
// optionValuePath="content.id" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gifify() { | |
if [[ -n "$1" ]]; then | |
if [[ $2 == '--good' ]]; then | |
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png | |
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif | |
rm out-static*.png | |
else | |
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif | |
fi | |
else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <pthread.h> | |
#include <unistd.h> | |
#include <semaphore.h> | |
sem_t semaphore; | |
void threadfunc() { |