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
func MatrixLUDecomposition(matrix Matrix) Matrix { | |
columns := matrix.cols() | |
rows := matrix.rows() | |
for i := 0; i < columns-1; i++ { | |
val, pivot_index := PivotIndex(matrix, i, i) | |
MatrixExchangeRows(matrix, i, pivot_index) | |
for j := i + 1; j < rows; j++ { | |
multiplier := -matrix.at(j, i) / val |
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 | |
$attributes_str = "small_image"; | |
function IsNullOrEmptyString($value){ | |
return (!isset($value) || trim($value)===''); | |
} | |
foreach (explode(",", $attributes_str) as $attr) { | |
$meta_tag = '<meta name="product:%s" content="%s" />'; | |
$value = $product->getData(); |
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
{ | |
"id": 1, | |
"reports": [ | |
{ | |
"longrepr": null, | |
"when": "call", | |
"nodeid": "tests/test_domain.py::test_test_report_repository__init", | |
"duration": 0.0006470680236816406, | |
"location": [ | |
"tests/test_domain.py", |
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
{ | |
'longrepr':{ | |
'sections':[ | |
], | |
'reprcrash':{ | |
'path':'/Users/felipecruz/Projects/loogica/neurotic/tests/test_report_plugin.py', | |
'message':'assert 0 == 1', | |
'lineno':9 | |
}, |
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
# errado - identação de "if not imposto" | |
salario = int(input('Salario? ')) | |
imposto = 27. | |
while imposto > 0.: | |
imposto = input('Imposto ou (0) para sair: ') | |
if not imposto: | |
imposto = 27. | |
else: | |
imposto = float(imposto) | |
print("Valor real: {0}".format(salario - (salario * (imposto * 0.01)))) |
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
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.sqlite3', | |
'NAME': '/home/meuusuario/projeto/jamboree.db', | |
'USER': '', | |
'PASSWORD': '', | |
'HOST': '', | |
'PORT': '', | |
} | |
} |
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 timeit | |
pickle_code = ''' | |
import pickle | |
data = {"test": "value"} | |
with open('out.pickle', 'wb') as out: | |
for i in range(10000): | |
out.write(pickle.dumps(data, pickle.HIGHEST_PROTOCOL)) |
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
Verifying that +felipecruz is my blockchain ID. https://onename.com/felipecruz |
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
#include <stdint.h> | |
uint8_t next (uint8_t *data) { | |
static int running = 0; | |
static uint8_t *current; | |
switch (running) { | |
case 0: goto L0; | |
case 1: goto L1; | |
} |
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 re | |
''' | |
pip install flask | |
pip install coopy | |
''' | |
from coopy.base import init_persistent_system | |
from flask import Flask, request, redirect, jsonify |