Skip to content

Instantly share code, notes, and snippets.

View vberlier's full-sized avatar

Valentin Berlier vberlier

  • Paris, France
View GitHub Profile
@VictorTaelin
VictorTaelin / dps_sup_nodes.md
Last active November 17, 2024 14:30
Accelerating Discrete Program Search with SUP Nodes

Fast Discrete Program Search 2

I am investigating how to use Bend (a parallel language) to accelerate Symbolic AI; in special, Discrete Program Search. Basically, think of it as an alternative to LLMs, GPTs, NNs, that is also capable of generating code, but by entirely different means. This kind of approach was never scaled with mass compute before - it wasn't possible! - but Bend changes this. So, my idea was to do it, and see where it goes.

Now, while I was implementing some candidate algorithms on Bend, I realized that, rather than mass parallelism, I could use an entirely different mechanism to speed things up: SUP Nodes. Basically, it is a feature that Bend inherited from its underlying model ("Interaction Combinators") that, in simple terms, allows us to combine multiple functions into a single superposed one, and apply them all to an argument "at the same time". In short, it allows us to call N functions at a fraction of the expected cost. Or, in simple terms: why parallelize when we can share?

A

@dabeaz
dabeaz / lala.py
Last active August 20, 2024 07:20
Some lambdas
# Author: David Beazley (https://www.dabeaz.com)
# Twitter: @dabeaz
from functools import reduce
run = lambda s: reduce(lambda *_:..., iter(lambda s=[s]:
(_:=s.pop()(),s.append(_))[0], None))
const = lambda v,c : lambda: c(v)
add = lambda x,y,c : lambda: c(x+y)
mul = lambda x,y,c : lambda: c(x*y)
@raysan5
raysan5 / raylib_vs_sdl.md
Last active November 14, 2024 18:25
raylib vs SDL - A libraries comparison

raylib_vs_sdl

In the last years I've been asked multiple times about the comparison between raylib and SDL libraries. Unfortunately, my experience with SDL was quite limited so I couldn't provide a good comparison. In the last two years I've learned about SDL and used it to teach at University so I feel that now I can provide a good comparison between both.

Hope it helps future users to better understand this two libraries internals and functionality.

Table of Content

Custom data pack structures in 1.18.2

This guide will showcase how to create a data pack that adds a custom structure to the world. There is also a data pack download of this complete example.

Always leave the world and rejoin to apply the new changes!

⚠️ This guide has moved ⚠️

Updates for both 1.18.2 and 1.19 can be found at https://misode.github.io/guides/adding-custom-structures/

Pack.mcmeta

@MichalGniadek
MichalGniadek / autoreload.py
Created November 28, 2021 20:49
Beet plugin for autoreloading datapacks
from beet import Context, Function
import time
import os
import shutil
import datetime
def beet_default(ctx: Context):
if delete_from_link(ctx):
time.sleep(0.2)

⚡ = Advancement trigger
✨ = Enchantment effect
▶️ = Commands run

  • MinecraftServer::tickServer
    • 🕑 Update /tick rate manager
    • ServerFunctionManager::tick
      • ▶️ Run #load function tag if a reload happened
      • ▶️ Run #tick function tag
    • ServerLevel::tick (per dimension)
@williambl
williambl / AAAAAA.zip
Last active August 20, 2024 17:34
some shader packs for 21w10a
@tekin
tekin / .gitattributes
Last active July 9, 2024 20:31
An example .gitattributes file that will configure custom hunk header patterns for some common languages and file formats. See https://tekin.co.uk/2020/10/better-git-diff-output-for-ruby-python-elixir-and-more for more details.
# Stick this in your home directory and point your Global Git config at it by running:
#
# $ git config --global core.attributesfile ~/.gitattributes
#
# See https://tekin.co.uk/2020/10/better-git-diff-output-for-ruby-python-elixir-and-more for more details
*.c diff=cpp
*.h diff=cpp
*.c++ diff=cpp
*.h++ diff=cpp
@tomplex
tomplex / pydantic_redirecting_type.py
Created April 26, 2020 06:28
Use Pydantic to dynamically create specific implementations of an ABC based on input data
import abc
import typing
import pydantic
class File(pydantic.BaseModel, abc.ABC):
@classmethod
def __get_validators__(cls):
# one or more validators may be yielded which will be called in the
@Akryum
Akryum / List.vue
Created December 15, 2019 14:40
Vue - onScrollBottom composable function
<script>
import { ref } from '@vue/composition-api'
import { onScrollBottom } from '@/scroll'
export default {
setup () {
function loadMore () {
// ...
}