Skip to content

Instantly share code, notes, and snippets.

View pietroppeter's full-sized avatar
🐳
chasing the whale

Pietro Peterlongo pietroppeter

🐳
chasing the whale
View GitHub Profile
@pietroppeter
pietroppeter / proposal.md
Last active October 30, 2026 10:54
talk proposal - regex is ai change my mind

title: regex is AI change my mind

abstract

Personal anthology of historical and technical anecdotes about Regexes and AI, with reflections on how the work of data people is changing (or not).

Did you know that regular expressions are (history AI Paper)? and that there are two different flavours of implementations and only one of them is O(N) with respect to the input? and that regexes are still an essential part of the LLM stack?

In this opinionated and lively talk we will give Data people of all sorts (junior or experienced, scientists or engineers) essential information about Regular Expressions, both technical and historical, suggestions on how to learn about them (should we learn about them?) weaving them with a theme of how modern AI impacts the way we work.

I want to research deeply a couple of use cases of clustering where I want to use affprop.
1) clustering of emojis.
I need some kind of dataset of emoji usage in a relevant context
(a dump of social posts on a microblogging site like twitter),
I need to define in some way similarity based on sharing context. Then I can produce a cluster of emojis!
2) clustering of colors.
Given an image I can cluster colors
(maybe using a sophisticated distance like CIEDE that I implemented in a coloring package by terraform).
import markdown
import std / strutils
echo markdown("""
```nim
echo "hello"
```*
""".replace('*', ' '), config=initGfmConfig())
#[
<pre><code class="language-nim">echo &quot;hello&quot;
# minib (a mini nimib)
import strformat, macros
import tempfile
proc dup*(oldfd: FileHandle): FileHandle {.importc, header: "unistd.h".}
proc dup2*(oldfd: FileHandle, newfd: FileHandle): cint {.importc, header: "unistd.h".}
macro toStr*(body: untyped): string =
(body.toStrLit)
@pietroppeter
pietroppeter / languages-and-vms.md
Created November 11, 2022 13:13 — forked from haxscramper/languages-and-vms.md
languages-and-vms
@pietroppeter
pietroppeter / add.nim
Created September 8, 2022 12:45
dll analysis in nim
# compile with: nim c --app:lib -d:release add.nim
# examine with: peni info -a add.dll
# see https://forum.nim-lang.org/t/9446
proc add*(num1, num2: int): int {.stdcall, exportc, dynlib.} =
num1 + num2
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
sudo apt-get update
sudo apt-get install libpangocairo-1.0-0
sudo apt-get install libblas-dev liblapack-dev
@pietroppeter
pietroppeter / cairo_deps.md
Last active February 15, 2021 15:46
Cairo dependencies for Windows (to use ggplotnim on Windows)

A common issue while trying to use https://github.com/Vindaar/ggplotnim on Windows is the fact that it is not easy to satisfy the full list of dll for Cairo.

In an issue (Vindaar/ggplotnim#57) and related gist (https://gist.github.com/Vindaar/6cb4e93baff3e1ab88a7ab7ed1ae5686) one of the best options seems to be to install emacs and add its bin folder to the path.

Using a dll dependency analyzer (https://github.com/lucasg/Dependencies, found through SO: https://stackoverflow.com/questions/7378959/how-to-check-for-dll-dependency), I was able to list all the dlls required, which are the following 17 files (including libcairo-2.dll, total around 9MB).

So another solution instead of installing emacs is to download the dlls (see link to libcairo-deps.rar in comment) and copy them in ~\.nimble\bin.

List of all recursive dependencies for libcairo-2.dll:

  • libbz2-1.dll
@pietroppeter
pietroppeter / hello_world.html
Created October 22, 2020 19:51
nimib preview
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="content-type">
<title>world.nim</title>
<meta content="width=device-width, initial-scale=1" name="viewport">
<link rel='stylesheet' href='https://unpkg.com/normalize.css/' type='text/css'>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/kognise/water.css@latest/dist/light.min.css">
</head>
<body>