This file contains hidden or 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
# Basic RAG | |
# | |
# This script implements a basic Retrieval-Augmented Generation tool to | |
# query about the content of PDF documents. It is based on modules | |
# provided by LangChain and is supported by an Ollama server that should | |
# available to process the queries. | |
# | |
# To use this script: | |
# | |
# 1. Create a folder './docs' from the point the script will run |
This file contains hidden or 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 typing import Optional | |
import numpy as np | |
from scipy import stats | |
import pandas as pd | |
class LeastSquares: | |
alpha: float | |
coefficients: np.ndarray | |
residuals: np.ndarray |
This file contains hidden or 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
/// A Priority Circular Queue Implementation | |
/// | |
/// (c) 2025, Jaime Lopez <https://github.com/jailop> | |
const std = @import("std"); | |
pub const QueueError = error { | |
Full, | |
Empty, | |
}; |
This file contains hidden or 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 numpy as np | |
# Rows are respondents | |
# Columns are survey items | |
data = np.array([ | |
[4.0, 4.0, 4.0, 5.0], | |
[3.0, 4.0, 3.0, 4.0], | |
[5.0, 4.0, 5.0, 5.0], | |
[2.0, 3.0, 2.0, 3.0], | |
[4.0, 4.0, 4.0, 4.0], |
This file contains hidden or 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
/** | |
* In a survey questionnaire, a set of items can be included | |
* referred to the same construct or concept. Therefore, | |
* it is expected that responses for those items are similar | |
* or highly correlated. To measure that, the Cronbach’s | |
* Alpha is frequently used. It estimates the reliability | |
* or the internal consistency for a set of survey items. | |
*/ | |
/** |
This file contains hidden or 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/sh | |
for i in *flac; do | |
ffmpeg -i "$i" -ab 320k -map_metadata 0 -id3v2_version 3 "${i%.*}.mp3" | |
done |
This file contains hidden or 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
/// Sieve of Eratosthenes Algorithm | |
/// Finding prime numbers less or equal than n | |
/// Implementation in Zig | |
/// Reference: | |
/// https://brilliant.org/wiki/sieve-of-eratosthenes/ | |
/// (2023) Jaime Lopez | |
const std = @import("std"); | |
/// Function implementing | |
/// Sieve of Eratosthenes Algorithm |
This file contains hidden or 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/sh | |
# | |
# This script converts pictures stored in CR2 format | |
# to jpg using the utility 'convert'. | |
# | |
# To use this script, make a copy of it in the | |
# corresponding folder and next, from de command line run: | |
# | |
# $ sh convert.sh | |
# |
This file contains hidden or 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
/* | |
* Gini Index implementation | |
* | |
* Gini Index is used to measure discrimanatory power of qualitative features in | |
* a dataset, as part of classification algorithms | |
* | |
* (2019) Jaime Lopez <jailop AT protonmail DOT com> | |
*/ | |
#include <iostream> |
This file contains hidden or 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
/* stress.c | |
* | |
* El propósito de este programa es causarle 'stress' al procesador. | |
* Es decir, obligarlo a trabajar en niveles próximos al 100%. | |
* Además, si el procesador es de varios núcleos, también se puede forzar | |
* a que los ocupe todos (o solo algunos de ellos). | |
* | |
* This program's aim is to cause streess to CPU, | |
* i.e. making it to work nearly 100% of load. | |
* If CPU is multicore, this program can force all of them to work. |