This file contains 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
import numpy as np | |
rawpoints = np.array( | |
[[2500, 0.15, 12], | |
[1200, 0.65, 20], | |
[6200, 0.35, 19]] | |
) | |
# Scale the rawpoints array so that each "column" is | |
# normalized to the same scale |
This file contains 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
def dunn(c, distances): | |
""" | |
Dunn index for cluster validation (the bigger, the better) | |
.. math:: D = \\min_{i = 1 \\ldots n_c; j = i + 1\ldots n_c} \\left\\lbrace \\frac{d \\left( c_i,c_j \\right)}{\\max_{k = 1 \\ldots n_c} \\left(diam \\left(c_k \\right) \\right)} \\right\\rbrace | |
where :math:`d(c_i,c_j)` represents the distance between | |
clusters :math:`c_i` and :math:`c_j`, given by the distances between its | |
two closest data points, and :math:`diam(c_k)` is the diameter of cluster | |
:math:`c_k`, given by the distance between its two farthest data points. |
This file contains 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
int qtd_elementos; | |
scanf("%d", &qtd_elementos); | |
while (qtd_elementos >= 1) { | |
dimInicLista(&lista_dinamica); | |
estInicLista(&lista_estatica); | |
int i = 0; | |
int elemento; | |
for (i = 0; i < qtd_elementos; i++) { | |
scanf("%d", &elemento); |
This file contains 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
/** | |
* Backbone localStorage Adapter | |
* https://github.com/jeromegn/Backbone.localStorage | |
*/ | |
(function(_, Backbone) { | |
// A simple module to replace `Backbone.sync` with *localStorage*-based | |
// persistence. Models are given GUIDS, and saved into a JSON object. Simple | |
// as that. |
This file contains 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
{ | |
"vars": { | |
"@gray-base": "#000", | |
"@gray-darker": "lighten(@gray-base, 13.5%)", | |
"@gray-dark": "lighten(@gray-base, 20%)", | |
"@gray": "lighten(@gray-base, 33.5%)", | |
"@gray-light": "lighten(@gray-base, 46.7%)", | |
"@gray-lighter": "lighten(@gray-base, 93.5%)", | |
"@brand-primary": "darken(#428bca, 6.5%)", | |
"@brand-success": "#5cb85c", |
This file contains 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
$(document).ready(function() { | |
var gameStartDiff = Math.abs(new Date() - new Date('2014/07/08 17:00:00')); | |
var minuteInMileseconds = 60 * 1000; | |
var update = function () { | |
var brazilGoals = Math.round(gameStartDiff / (90 * minuteInMileseconds)); | |
var germanGoals = Math.round(gameStartDiff / (12 * minuteInMileseconds)); | |
$('#brazil-goals').html(brazilGoals); | |
$('#german-goals').html(germanGoals); | |
} | |
setTimeout(function(){ update(); }, 60000); |
This file contains 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
## Configure eth0 | |
# | |
# vi /etc/sysconfig/network-scripts/ifcfg-eth0 | |
DEVICE="eth0" | |
NM_CONTROLLED="yes" | |
ONBOOT=yes | |
HWADDR=A4:BA:DB:37:F1:04 | |
TYPE=Ethernet | |
BOOTPROTO=static |