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': '[email protected]', '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'); ?> | |
<div class="jumbotron"> | |
<h1>Candidatos Stats</h1> | |
<p class="lead">Estatísticas dos Candidatos</br></p> | |
</div> | |
<?php | |
class Connect{ | |
protected $url_acesso = 'http://api.transparencia.org.br/api/v1/'; | |
protected $app_token = 'TzTnQhwxCWmY'; |
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
> db.users.findOne(); | |
{ | |
"__v" : 0, | |
"_id" : ObjectId("53e10cc175dd421727dfc821"), | |
"ace" : { | |
"pdfViewer" : "pdfjs", | |
"spellCheckLanguage" : "en", | |
"autoComplete" : true, | |
"fontSize" : 12, | |
"theme" : "textmate", |
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
> db.docHistory.findOne(); | |
{ | |
"doc_id" : ObjectId("53e10cd475dd421727dfc825"), | |
"project_id" : ObjectId("53e10cd275dd421727dfc823"), | |
"op" : [ | |
{ | |
"p" : 36, | |
"d" : "The Hitchhiker's Guide to the Galaxy" | |
} | |
], |
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
# db.projects.findOne(); | |
{ | |
"__v" : 0, | |
"_id" : ObjectId("53e10cd275dd421727dfc823"), | |
"collaberator_refs" : [ ], | |
"compiler" : "pdflatex", | |
"deletedByExternalDataSource" : false, | |
"deletedDocs" : [ ], | |
"description" : "", | |
"lastUpdated" : ISODate("2014-08-06T17:53:46.578Z"), |
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
db.i2.aggregate( | |
{ $sort: { _id : 1} }, | |
{ $group: { _id: "$c" , | |
i : { $first : "$i" }, | |
m : { $first : "$m" }, | |
r : { $first : "$r" }, | |
j : { $first : "$j" }, | |
} }, | |
{ $out: 'i2_group' } | |
); |
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
//Speed up MongoDB Map Reduce, http://edgystuff.tumblr.com/post/54709368492 | |
//MongoDB as a pure in-memory, http://edgystuff.tumblr.com/post/49304254688 | |
db.notas.ensureIndex({c:1}); | |
//db.notas.ensureIndex({p:-1}); //6786ms | |
db.notas.ensureIndex({a:1}); | |
db.alunos.find().forEach(function(a){ db.notas.update({c:a._id,p:{$gte:a.p}},{$set:{v1:1}},{multi:true}) }); | |
db.grade.find().forEach(function(g){ db.notas.update({a:g.ca},{$set:{v2:1}},{multi:true}) }); |
NewerOlder