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 xmlrpc.client | |
import requests, json, os, time | |
## Octadesk API: https://api-docs.octadesk.services/docs/ | |
payload = {'username': 'support@company.com', 'password': 'password'} | |
headers = {'subDomain': 'company', 'content-type': 'application/json', 'accept': 'application/json'} | |
r = requests.post('https://api.octadesk.services/login', data=json.dumps(payload), headers=headers) | |
token = r.json()['token'] | |
headers['Authorization'] = 'Bearer ' + token |
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
from keras.layers.core import Dense, Activation | |
from keras.layers import Flatten, Dropout | |
from keras.layers.embeddings import Embedding | |
from keras.models import Sequential | |
embedding_layer = Embedding(embedding_weights.shape[0], | |
embedding_weights.shape[1], | |
weights=[embedding_weights], | |
input_length=max_length) |
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 networkx as nx | |
import pandas as pd | |
X = frequency[['dose','freq']].values.astype(float) | |
medication_graph = nx.from_numpy_matrix(self.sim_matrix) | |
pr = nx.pagerank(medication_graph, alpha=0.9, max_iter=1000, personalization=dict(sfrequency['count'])) |
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
#!/bin/bash | |
rm -rf ./fleetany-web | |
svn checkout https://github.com/alientronics/fleetany-web.git/trunk fleetany-web/ | |
cp configDir/php.ini fleetany-web/ | |
cp configDir/tpms-bkp/.htaccess fleetany-web/ | |
cp configDir/tpms-bkp/.htaccess-public fleetany-web/public/.htaccess | |
cp configDir/tpms-bkp/.env fleetany-web/ | |
cd fleetany-web | |
curl -sS https://getcomposer.org/installer | php7 -c php.ini |
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
<?php include('_header.php'); ?> | |
<?php /* ### Connection ### */ | |
$m = new Mongo("mongodb://guest:guest@host:10047/blogdb"); | |
$db = $m->selectDB("blogdb"); | |
$posts = $db->selectCollection('posts'); | |
?> | |
<?php /* ### Query ### */ | |
$query = array("title" => "Spoilers Monster High"); |
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
map = function() { | |
this.textContent.split(' ').forEach( | |
function(word){ emit(word,1); } | |
); | |
}; | |
reduce = function(key, values) { | |
var count = 0; | |
values.forEach( |
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
<?php | |
$link = mysql_connect("mysql07.host.org", "user", "pwd") | |
or die("Nao foi possivel conectar"); | |
mysql_select_db("gemeos16",$link) or die("Nao foi possivel selecionar o banco de dados"); | |
mysql_query("set wait_timeout = 7200"); | |
$addr = "http://www.icarros.com.br/volkswagen/gol/ficha-tecnica?versao="; | |
for($i=15000;$i<17000;$i++){ |
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_logs.py --url=localhost/piwik 20120827_access.log --idsite=1 --force-lowercase-path --log-format-regex="(?P<ip>\S+) \S+ \S+ \[(?P<date>.*?) (?P<timezone>.*?)\] \"\S+ (?P<path>.*?) \S+\" \"\S+ (?P<user_agent>.*?) \S+\" \"\S+ .* \S+\" (?P<status>\S+) (?P<length>\S+) (?P<generation_time_micro>\S+)" |
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
wget http://henrique.gemeos.org/download/trec_eval.8.1.tar.gz | |
wget http://henrique.gemeos.org/download/qrels.zip | |
unzip qrels.zip | |
tar -xvf trec_eval.8.1.tar.gz | |
cd trec_eval.8.1 | |
make | |
cp trec_eval ../ | |
./trec_eval -c -q qrels.txt result_henrique_manuela_SOLR.txt |
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
<?php | |
$topicoStr = file_get_contents("Topicos.txt"); | |
preg_match_all("/title\>([^\<]+)</", $topicoStr, $topicos); | |
$contRow = 0; | |
foreach ($topicos[1] as $topic) { | |
if (strlen(trim($topic))>0) { | |
$contRow++; $contDoc=0; |
NewerOlder