Skip to content

Instantly share code, notes, and snippets.

View ArturoBL's full-sized avatar

Arturo Beristain López ArturoBL

View GitHub Profile
@ArturoBL
ArturoBL / FlaskHello.py
Created May 16, 2025 02:31
Minimum Flask service
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return 'Hello, World!'
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000, debug=True)
@ArturoBL
ArturoBL / CudaDevInfo.py
Created November 28, 2022 05:35
Print CUDA device info
import cv2
from cv2 import cuda
cuda.printCudaDeviceInfo(0)
@ArturoBL
ArturoBL / CudaCount.py
Created November 28, 2022 05:14
Check cuda enabled devices
import cv2
count = cv2.cuda.getCudaEnabledDeviceCount()
print(count)
//Función que devuelve el índice de una cadena dentro de otra
// es equivalente a la función de strutils: position := AnsiIndexStr(source, ['BRIAN', 'JIM', 'HENRY']);
function StrIdx(str:string;StrArr:array of string):integer;
var n,i:integer;
begin
result:=-1;
n:=high(strarr);
if length(str)<1 then exit;
for i:=0 to n do
function token(var cad:string;sep:string):string;
var p,n:integer;
begin
p:=pos(sep,cad);
if p>0 then
n:=p-1
else
n:=length(cad);
result:=copy(cad,1,n);
delete(cad,1,n+length(sep));
@ArturoBL
ArturoBL / gist:f5a64dd212c03ab936adb3ced4f8f6a0
Created August 30, 2022 15:59
Transformación lineal simple
Procedure transli(min,max,mip,map:real;var a,b:real);
begin
a:=(mip-map)/(min-max);
b:=(min*map-mip*max)/(min-max);
end;