Skip to content

Instantly share code, notes, and snippets.

View ADCDS's full-sized avatar
🥒
afiando a mandioca

Adriel Santos ADCDS

🥒
afiando a mandioca
View GitHub Profile
Limitações MYSQL em relação ao paralismo de query{
https://dba.stackexchange.com/questions/15146/using-multiple-cores-for-single-mysql-queries-on-debian
https://dba.stackexchange.com/questions/5666/possible-to-make-mysql-use-more-than-one-core
https://dba.stackexchange.com/questions/2918/about-single-threaded-versus-multithreaded-databases-performance/2948#2948
https://dba.stackexchange.com/questions/2918/about-single-threaded-versus-multithreaded-databases-performance/2948#2948
https://dba.stackexchange.com/questions/142416/mysql-to-use-all-cores-20-cores-i-have
}
Possiveis soluções para a limitação do MYSQL{
@ADCDS
ADCDS / lexico.L
Created October 3, 2017 20:54
lexico.L
%{
int nLinha = 1;
%}
identificador [a-zA-Z]([a-zA-Z0-9])*
numero [0-9]+
espaco [ \t]+
novalinha [\n]
%x comentario
@ADCDS
ADCDS / boost_integer_sort_example.cpp
Created August 28, 2017 16:01
Simple example of usage of integer_sort
#include <string>
#include <iostream>
#include <boost/sort/spreadsort/spreadsort.hpp>
struct user
{
uint32_t id;
char* name;
};
@ADCDS
ADCDS / data.php
Created August 2, 2017 23:17 — forked from jjb3rd/data.php
An updated server-side processing script for DataTables
<?php
/*
* Script: DataTables server-side script for PHP and MySQL
* Copyright: 2012 - John Becker, Beckersoft, Inc.
* Copyright: 2010 - Allan Jardine
* License: GPL v2 or BSD (3-point)
*/
class TableData {
@ADCDS
ADCDS / index.html
Created July 10, 2017 15:13
Simple client
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Login</title>
</head>
<body>
<button id="login">Login</button>
<div id="fb-root"></div>
<script type="text/javascript" src="main.js"></script>
@ADCDS
ADCDS / kmeans.py
Created May 29, 2017 14:17 — forked from mblondel/kmeans.py
Fuzzy K-means and K-medians
# Copyright Mathieu Blondel December 2011
# License: BSD 3 clause
import numpy as np
import pylab as pl
from sklearn.base import BaseEstimator
from sklearn.utils import check_random_state
from sklearn.cluster import MiniBatchKMeans
from sklearn.cluster import KMeans as KMeansGood
@ADCDS
ADCDS / kmeansExample.py
Created May 29, 2017 14:17 — forked from iandanforth/kmeansExample.py
A pure python implementation of K-Means clustering. Optional cluster visualization using plot.ly.
#############################################################################
# Full Imports
import math
import random
"""
This is a pure Python implementation of the K-Means Clustering algorithmn. The
original can be found here:
http://pandoricweb.tumblr.com/post/8646701677/python-implementation-of-the-k-means-clustering
@ADCDS
ADCDS / convert_to_string_map.cpp
Created April 26, 2017 17:19
Generic Map to String Map (convert_to_string_map) c++
#include <stdio.h>
#include <stdlib.h>
#include <map>
#include <functional>
#include <string>
#include <iostream>
template <typename T1, typename T2>
static std::map<std::string, std::string> convert_to_string_map(std::map<T1, T2> _map_in,
std::function<std::pair<std::string, std::string>(T1, T2) > converter) {
@ADCDS
ADCDS / multiProcessingGraph.py
Last active April 25, 2017 12:56
Dijkstar python package: Shared memory graph
# https://pypi.python.org/pypi/Dijkstar
from dijkstar import Graph, find_path
from multiprocessing import Process, Manager
import collections
manager = Manager()
class GraphProxy(Graph):
def __init__(self, data=None):
# replaces default _data and _incoming attributes to a equivalent object (dict), but in shared memory
@ADCDS
ADCDS / jquery-datatables-webpack
Created March 25, 2017 17:28 — forked from obonyojimmy/jquery-datatables-webpack
DataTables.net with webpack
Here's how to make jQuery DataTables work with npm and webpack. This is the simplest way I found to do it.
See the previous revision of this gist for a way to do it with forcing AMD to be disabled if you need that.
Install DT core: npm install datatables.net
Install a DT style: npm install datatables.net-dt
Then to initialize DT in your app, do this in your main entry point:
// you can use import or require
import dt from 'datatables.net';