Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit 7e97930

Browse files
committed
fix overeager gitignore file again
1 parent 64df6f7 commit 7e97930

File tree

10 files changed

+1566
-2
lines changed

10 files changed

+1566
-2
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ var
1414
sdist
1515
develop-eggs
1616
.installed.cfg
17-
lib
18-
lib64
1917
__pycache__
2018
_deploy
2119

@@ -34,3 +32,4 @@ nosetests.xml
3432
.mr.developer.cfg
3533
.project
3634
.pydevproject
35+
.idea

common/ext/js-parsons/lib/jquery-ui.min.js

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

common/ext/js-parsons/lib/jquery.min.js

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
/**
2+
* jQuery sound plugin (no flash)
3+
*
4+
* port of script.aculo.us' sound.js (http://script.aculo.us), based on code by Jules Gravinese (http://www.webveteran.com/)
5+
*
6+
* Copyright (c) 2007 Jörn Zaefferer (http://bassistance.de)
7+
*
8+
* Licensed under the MIT license:
9+
* http://www.opensource.org/licenses/mit-license.php
10+
*
11+
* $Id: jquery.sound.js 5854 2008-10-04 10:22:25Z joern.zaefferer $
12+
*/
13+
14+
/**
15+
* API Documentation
16+
*
17+
* // play a sound from the url
18+
* $.sound.play(url)
19+
*
20+
* // play a sound from the url, on a track, stopping any sound already running on that track
21+
* $.sound.play(url, {
22+
* track: "track1"
23+
* });
24+
*
25+
* // increase the timeout to four seconds before removing the sound object from the dom for longer sounds
26+
* $.sound.play(url, {
27+
* timeout: 4000
28+
* });
29+
*
30+
* // stop a sound by removing the element returned by play
31+
* var sound = $.sound.play(url);
32+
* sound.remove();
33+
*
34+
* // disable playing sounds
35+
* $.sound.enabled = false;
36+
*
37+
* // enable playing sounds
38+
* $.sound.enabled = true
39+
*/
40+
41+
(function($) {
42+
43+
$.sound = {
44+
tracks: {},
45+
enabled: true,
46+
template: function(src) {
47+
// todo: move bgsound element and browser sniffing in here
48+
// todo: test wmv on windows: Builder.node('embed', {type:'application/x-mplayer2', pluginspage:'http://microsoft.com/windows/mediaplayer/en/download/', id:'mediaPlayer', name:'mediaPlayer', displaysize:'4', autosize:'-1', bgcolor:'darkblue', showcontrols:'false', showtracker:'-1', showdisplay:'0', showstatusbar:'-1', videoborder3d:'-1', width:'0', height:'0', src:audioFile, autostart:'true', designtimesp:'5311', loop:'false'});
49+
// is_win = (agt.indexOf("windows") != -1);
50+
return '<embed style="height:0" loop="false" src="' + src + '" autostart="true" hidden="true"/>';
51+
},
52+
play: function(url, options){
53+
if (!this.enabled)
54+
return;
55+
options = $.extend({
56+
url: url,
57+
timeout: 2000
58+
}, options);
59+
60+
if (options.track) {
61+
if (this.tracks[options.track]) {
62+
var current = this.tracks[options.track];
63+
// TODO check when Stop is avaiable, certainly not on a jQuery object
64+
current[0].Stop && current[0].Stop();
65+
current.remove();
66+
}
67+
}
68+
69+
var element = $.browser.msie
70+
? $('<bgsound/>').attr({
71+
src: options.url,
72+
loop: 1,
73+
autostart: true
74+
})
75+
: $(this.template(options.url));
76+
77+
element.appendTo("body");
78+
79+
if (options.track) {
80+
this.tracks[options.track] = element;
81+
}
82+
83+
setTimeout(function() {
84+
element.remove();
85+
}, options.timeout)
86+
87+
return element;
88+
}
89+
};
90+
91+
})(jQuery);

common/ext/js-parsons/lib/lis.js

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
/* FEEDBACK:
2+
- peräkkäiset rivit yhdistetään blokeiksi
3+
- etsitään LIS jossa eniten peräkkäisiä rivejä
4+
- värjätään LIS:n inverse punaiseksi, blokeista ehkä vain tausta
5+
- sisennyspalaute kuten nykyisin alusta asti oikealla paikalla olevista riveistä (värjätäänkö vihreiksi?)
6+
*/
7+
8+
// Takes an iterable sequence and returns the decks given by
9+
// patience sorting as a list of lists
10+
// http://wordaligned.org/articles/patience-sort
11+
// http://en.wikipedia.org/wiki/Longest_increasing_subsequence
12+
13+
var LIS = {};
14+
15+
(function($, _) { // wrap in anonymous function to allow overriding of _ and $
16+
17+
LIS.patience_sort = function(list) {
18+
var arr = _.toArray(list),
19+
decks = [[arr[0]]],
20+
deckPos = 0;
21+
for (var i = 1; i < arr.length; i++) {
22+
var x = arr[i],
23+
currDeck = decks[deckPos];
24+
if (x < _.last(currDeck)) {
25+
// append to the last created deck
26+
currDeck.push(x);
27+
} else {
28+
// create a new deck
29+
decks.push([x]);
30+
deckPos++;
31+
}
32+
}
33+
return decks;
34+
};
35+
36+
// Takes an iterable sequence of iterables that represent decks
37+
// that are the result of patience sorting a sequence
38+
LIS.find_lises = function(decks) {
39+
decks = _.toArray(decks);
40+
if (decks.length < 1) {
41+
return decks;
42+
}
43+
var lises = [],
44+
new_lises,
45+
deck,
46+
partial_lis,
47+
partial_lis_extended,
48+
x, i, j, k;
49+
for (i = 0; i < decks.length; i++) {
50+
new_lises = [];
51+
deck = decks[i];
52+
for (j = 0; j < lises.length; j++) {
53+
partial_lis = lises[j];
54+
for (k = 0; k < deck.length; k++) {
55+
x = deck[k];
56+
if (x > _.last(partial_lis)) {
57+
new_partial_lis = partial_lis.slice(0); // dummy copy
58+
new_partial_lis.push(x);
59+
new_lises.push(new_partial_lis);
60+
}
61+
}
62+
new_lises.push(partial_lis);
63+
}
64+
for (k = 0; k < deck.length; k++) {
65+
new_lises.push([deck[k]]);
66+
}
67+
lises = new_lises;
68+
}
69+
lis_length = _.max(_.map(lises, function(item) { return item.length; }));
70+
lises = _.select(lises, function(item) { return item.length >= lis_length; });
71+
return lises;
72+
};
73+
74+
LIS.best_lise = function(lises) {
75+
var lis_scores = _.map(lises, function(item, index) {
76+
if (item.length <= 1) {
77+
return {score: 0, index: index};
78+
}
79+
var score = 0;
80+
for (var i = 1; i < item.length; i++) {
81+
if (item[i-1] == item[i] - 1) {
82+
score++;
83+
}
84+
}
85+
return {score: score, index: index};
86+
});
87+
var best = _.max(lis_scores, function(item) { return item.score; });
88+
return lises[best.index];
89+
};
90+
91+
LIS.best_lise_inverse = function(list) {
92+
var decks = this.patience_sort(_.toArray(list)),
93+
lises = this.find_lises(decks),
94+
best = this.best_lise(lises);
95+
return _.difference(list, best);
96+
};
97+
98+
// Takes an iterable sequence and returns a list of the inverses of
99+
// all the longest increasing subsequences of this sequence
100+
/*
101+
function lis_inverses(list) {
102+
var inverse_list = [],
103+
decks = patience_sort(_.toArray(list)),
104+
lises = find_lises(decks);
105+
return _.map(lises, function(item) { return _.difference(list, item); });
106+
}
107+
108+
function in_all_lis_inverses(list) {
109+
var inverse_list = lis_inverses(list);
110+
return _.intersection.apply(null, inverse_list);
111+
}
112+
113+
function inverse_indices(list) {
114+
var in_all = in_all_lis_inverses(list);
115+
return _.map(in_all, function(item) { return list.indexOf(item); });
116+
};*/
117+
118+
//This allows the current version of _ and $ to be used, even if it is later reverted
119+
//with noConflict
120+
})($, _);

0 commit comments

Comments
 (0)