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
<?php | |
function canonize($str) | |
{ | |
$str = slugify($str); | |
$str = stem($str); | |
return $str; | |
} | |
function stem($str) |
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
amigoSecreto = function (vet) { | |
r = []; | |
for(i = 0; i < vet.length - 1; i++) { | |
r.push([vet[i], vet[i + 1]]); | |
} | |
r.push([vet[i], vet[0]]); | |
return r; | |
}; |
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
<html> | |
<head> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" integrity="sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ==" crossorigin="anonymous"> <!-- Latest compiled and minified JavaScript --> | |
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js" integrity="sha512-K1qjQ+NcF2TYO/eI3M6v8EiNYZfA95pQumfvcVrTHtwQVDG+aHRqLi/ETn2uB+1JqwYqVG3LIvdm9lj6imS/pQ==" crossorigin="anonymous"></script> | |
<style type="text/css"> | |
.exemplo { | |
width: 200px; |
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
$httpProvider.interceptors.push(['$q', '$location', '$localStorage', function($q, $location, $localStorage) { | |
return { | |
'request': function (config) { | |
config.headers = config.headers || {}; | |
if ($localStorage.token) { | |
config.headers.Authorization = 'Portador ' + $localStorage.token; | |
} | |
return config; | |
}, | |
'responseError': function(response) { |
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
<?php | |
/** | |
* PHP item based filtering | |
* | |
* This library is distributed in the hope that it will be useful, | |
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
* Lesser General Public License for more details. | |
* |
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
/*************************************************************************** | |
* Copyright (C) 2014 by Edson Borin and Raul Baldin * | |
* [email protected] * | |
* * | |
* This program is free software; you can redistribute it and/or modify * | |
* it under the terms of the GNU General Public License as published by * | |
* the Free Software Foundation; either version 2 of the License, or * | |
* (at your option) any later version. * | |
* * | |
* This program is distributed in the hope that it will be useful, * |
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 <iostream> | |
#include <CL/cl.hpp> | |
int init(float* A, int n) { | |
int i,j; | |
for(i=0;i<n;i++){ | |
for(j=0;j<n;j++){ | |
A[i*n+j] = 1; | |
} | |
} |
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
import numpy | |
import pyopencl as cl | |
import os | |
#os.environ['PYOPENCL_COMPILER_OUTPUT'] = '1' | |
os.environ['PYOPENCL_CTX'] = '0:1' | |
N = 5 | |
# create host arrays |
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
# // Sample Command to Run Simulation | |
# // | |
# // ./waf --pyrun "scratch/gerencia.py --trafic=2 --nWifi=5 --verbose=False --seed=3" | |
# // | |
# // nWifi - Number of wifi STA devices | |
# // verbose - Tell echo applications to log if true | |
# // trafic - Tipo de trafico da simulacao: 1 - CBR, 2 - Rajada | |
# // duration - The duration of the simullation in seconds | |
# // seed - The seed to generate random values | |
# // |
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
#!/bin/bash | |
echo 'cpu,mem,args' >> ps.csv | |
while true; do | |
(ps -e -o pcpu,pmem,args --sort=-pmem,-pcpu --no-headers | sed 's/^[ \t]*//;s/[ \t]*$//' | sed -e 's/\s\+/,/' | sed -e 's/\s\+/,/' | sed -r -e 's/^([0-9\.]+),([0-9\.]+),([^ ]+)(.*)?/\1,\2,\3/g' | sed -r -e 's/^([0-9\.]+),([0-9\.]+),(.*\/)(.*)/\1,\2,\4/g') >> ps.csv; | |
sleep 10; | |
done |
OlderNewer