Skip to content

Instantly share code, notes, and snippets.

@morfismo
morfismo / settings.json
Created September 3, 2025 18:30
vscode + miktex
"latex-workshop.latex.tools": [
{
"name": "texify",
"command": "texify",
"args": [
"--synctex",
"--pdf",
"--interaction=nonstopmode",
"--file-line-error",
"%DOC_EXT%"
@morfismo
morfismo / why-tcl.md
Created June 20, 2023 18:52 — forked from nat-418/why-tcl.md
Why Tcl?

Why Tcl?

Introduction

I use [Tcl] as my scripting language of choice, and recently someone asked me why. This article is an attempt to answer that question.

Ousterhout's dichotomy claims that there are two general categories of programming languages:

How to Shrink a WSL2 Virtual Disk

Before you begin

Before shrinking a WSL2 virtual disk, you need to ensure that WSL2 is not running.

You can check if it’s running with the command wsl.exe --list --verbose in PowerShell:

PS C:\Users\valorin> wsl.exe --list --verbose
 NAME STATE VERSION

Intro

Description: Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").

Author: Chris Jacob @_chrisjacob

Tutorial (Gist): https://gist.github.com/833223

The Result

for k in 1:1000000
isprime(k)
end
const ConjuntoPrimos=Set(2, 3, 5, 7, 11, 13, 17, 19,
23, 29, 31, 37, 41, 43, 47, 53,
59, 61, 67, 71, 73, 79, 83, 89,
97, 101, 103, 107, 109, 113, 127, 131,
137, 139, 149, 151, 157, 163, 167, 173,
179, 181, 191, 193, 197, 199, 211, 223,
227, 229, 233, 239, 241, 251, 257, 263,
269, 271, 277, 281, 283, 293, 307, 311,
313, 317, 331, 337, 347, 349, 353, 359,
367, 373, 379, 383, 389, 397, 401, 409,
ConjuntoPrimos={\
2, 3, 5, 7, 11, 13, 17, 19,\
23, 29, 31, 37, 41, 43, 47, 53,\
59, 61, 67, 71, 73, 79, 83, 89,\
97, 101, 103, 107, 109, 113, 127, 131,\
137, 139, 149, 151, 157, 163, 167, 173,\
179, 181, 191, 193, 197, 199, 211, 223,\
227, 229, 233, 239, 241, 251, 257, 263,\
269, 271, 277, 281, 283, 293, 307, 311,\
313, 317, 331, 337, 347, 349, 353, 359,\
@morfismo
morfismo / primos2.jl
Last active August 29, 2015 14:01
primos2.jl
const ListaPrimos=[2, 3, 5, 7, 11, 13, 17, 19,
23, 29, 31, 37, 41, 43, 47, 53,
59, 61, 67, 71, 73, 79, 83, 89,
97, 101, 103, 107, 109, 113, 127, 131,
137, 139, 149, 151, 157, 163, 167, 173,
179, 181, 191, 193, 197, 199, 211, 223,
227, 229, 233, 239, 241, 251, 257, 263,
269, 271, 277, 281, 283, 293, 307, 311,
313, 317, 331, 337, 347, 349, 353, 359,
367, 373, 379, 383, 389, 397, 401, 409,
@morfismo
morfismo / primos2.py
Created May 3, 2014 23:52
primos2.py
# Ahora procedemos con una criba basada en una tabla precalculada
# (Por ejemplo, una tabla precalculada hasta 10000 serviría para
# cribar más eficientemente hasta cien millones)
# Obsérvese que esta criba permite encontrar todos los primos
# hasta un millón en unos cuantos segundos. Si el resultado se almacena
# y se usa como nueva tabla, se puede decidir la primalidad
# de cualquer número hasta 1000000000000 (un billón).
from itertools import *
@morfismo
morfismo / primes.py
Created May 3, 2014 22:31
primes.py
import math
def EsPrimo(n):
if n<2: return False
if n==2 or n==3 : return True
sq=math.ceil(math.sqrt(n))
for k in range(2,sq+1):
if n%k ==0: return False