Skip to content

Instantly share code, notes, and snippets.

View guilhermeleobas's full-sized avatar

Guilherme Leobas guilhermeleobas

View GitHub Profile
taken from here:
http://stackoverflow.com/questions/4963171/mysql-server-startup-error-the-server-quit-without-updating-pid-file
1. kill all instances of mysql
2. check ownership for (/usr/local/var/mysql/):
ls -laF /usr/local/var/mysql/
3. give permissions to mysql
sudo chown -R mysql /usr/local/var/mysql/
@guilhermeleobas
guilhermeleobas / steeef.zsh-theme
Created October 3, 2017 02:01
steeef theme for zsh without git/svn infos
# prompt style and colors based on Steve Losh's Prose theme:
# http://github.com/sjl/oh-my-zsh/blob/master/themes/prose.zsh-theme
#
# vcs_info modifications from Bart Trojanowski's zsh prompt:
# http://www.jukie.net/bart/blog/pimping-out-zsh-prompt
#
# git untracked files modification from Brian Carper:
# http://briancarper.net/blog/570/git-info-in-your-zsh-prompt
export VIRTUAL_ENV_DISABLE_PROMPT=1
{
"machines": {
"1a5ef689c8a64626b3f37561cbee5fbf": {
"extra_data": {
"box": {
"name": "generic/alpine37",
"provider": "virtualbox",
"version": "1.6.0"
}
},
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd"
]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@guilhermeleobas
guilhermeleobas / gist:f3229c5a8308dee615677667631a0bb7
Created November 19, 2018 22:23
Bootstrap clang with -fLTO support
Assuming one has clang at /usr/lib/llvm-x.y/bin. Clang with LTO support can be compiled using the commands below:
cmake .. -GNinja \
-DCMAKE_BUILD_TYPE=Debug \
-DLLVM_TARGETS_TO_BUILD="X86" \
-DLLVM_ENABLE_LTO="Thin" \
-DLLVM_USE_LINKER="lld" \
-DCMAKE_C_COMPILER="/usr/lib/llvm-6.0/bin/clang" \
-DCMAKE_CXX_COMPILER="/usr/lib/llvm-6.0/bin/clang++" \
-DCMAKE_RANLIB="/usr/lib/llvm-6.0/bin/llvm-ranlib" \
// Inter Optimization
void matrix_mul(float *restrict a, float *restrict b, float *restrict c, int n){
bool sampling_result = sampling(a, b, c, n);
if (sampling_result){
// code with load elimination
for (int i=0; i<n; i++){
for (int j=0; j<n; j++){
for (int k=0; k<n; k++){
float t0 = a[i][k];
if (t0){
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@guilhermeleobas
guilhermeleobas / rtlinker.diff
Created February 13, 2020 19:40
disable numba runtime linker
diff --git a/numba/core/codegen.py b/numba/core/codegen.py
index 41721ea21..07531de1b 100644
--- a/numba/core/codegen.py
+++ b/numba/core/codegen.py
@@ -495,6 +495,25 @@ class JITCodeLibrary(CodeLibrary):
self._codegen._scan_and_fix_unresolved_refs(self._final_module)
self._codegen._engine.finalize_object()
+class DummyRuntimeLinker(object):
+ """
from __future__ import print_function
from ctypes import *
import numpy as np
import struct
import llvmlite.binding as llvm
# All these initializations are required for code generation!