python

Back Open Paginator
05.12.2025 07:50
jeff (@jeff@phpc.social)

I just completed "Cafeteria" - Day 5 - Advent of Code 2025

We had one like this back in 2022, so I ported a function from my old PHP solution to Python. Both parts in <10ms with a couple lines of code.

github.com/jstanden/advent-of-

#AdventOfCode #Python #Programming




Show Original Post


05.12.2025 07:39
gkay_dev (@gkay_dev@mastodon.social)

Day 05 - "Cafeteria" ✅
Easiest one.
Looking forward to tomorrow's challenge.

My solutions - github.com/GKay-Dev/Advent-of-
Advent of Code 2025 - adventofcode.com/2025/day/5




Show Original Post


05.12.2025 07:28
jamesthebard (@jamesthebard@social.linux.pizza)

Content warning:Advent of Code - Day 5 (Python)


I stayed up far too long tonight for this one, but it was fun. Saw that we were dealing with an absolute metric ton of ranges at the very beginning so my initial thought was to reduce/merge those ranges and that's what I spent most of my time on before even tackling part 1.

It paid off tremendously and made solving everything very, very easy. There's still the Nim version to write, but I'll handle that after I get some sleep.

Solution: git.jamesthebard.net/jweatherl

#aoc #aoc2025 #adventofcode #adventofcode2025 #python #programming




Show Original Post


05.12.2025 07:25
CuratedHackerNews (@CuratedHackerNews@mastodon.social)

Show HN: Tacopy – Tail Call Optimization for Python

github.com/raaidrt/tacopy




Show Original Post


05.12.2025 07:12
habr (@habr@zhub.link)

Неопределённость как часть модели

Привет, Хабр! Сегодня рассмотрим тему неопределённости в моделях . Классические ML-модели детерминированы: на вход получили – на выход выдали одно число или метку. Но жизнь полна неопределённости , и игнорировать её плохая идея. Представьте, у вас мало данных, модель предсказывает конверсию 15%. Но насколько она уверена? Может, разброс от 5% до 30%. Обычная модель этого не скажет, а вот вероятностная модель скажет. В этой статье в коротком формате разберём, как с помощью байесовского подхода и фреймворка Pyro моделировать такую неопределённость на примере A/B-теста конверсии и заставить модель честно признавать свою неуверенность.

habr.com/ru/companies/otus/art

#python #ml #байесовская_статистика #вероятностное_программирование #неопределённость_модели #биномиальное_распределение #Pyro




Show Original Post


05.12.2025 06:32
treyhunner (@treyhunner@mastodon.social)

Content warning:Advent of Code - Day 5


I just completed "Cafeteria" - Day 5 - Advent of Code 2025

This is the first day where I crashed Python by running against the full input.

Part 1 was the problem. I should have taken a look at the input numbers before trying to make an enormous set.

Part 2 was made easier by the fact that it's pretty much the Python Morsels parse_ranges exercise (sorting is the trick).

github.com/treyhunner/advent-o




Show Original Post


05.12.2025 06:24
ros (@ros@techhub.social)

Vector Stores for RAG Comparison:
glukhov.org/post/2025/12/vecto
#LLM #AI #RAG #Python #Cloud #SelfHosting #Dev




Show Original Post


05.12.2025 05:14
developers (@developers@rss-mstdn.studiofreesia.com)

Tombi で便利な Python/Rust のワークスペース管理
developers.cyberagent.co.jp/bl

#developers #エンジニア #python #TOML




Show Original Post


05.12.2025 04:43
umplay77 (@umplay77@mastodon.social)

Testing a 1M-line file —
Legacy, but still alive.

Jollpi (2010, Python2+GTK2) still runs on modern Arch-based systems, btw 😎
Syntax highlighting, tabs, find/replace .all still working in 2025.
.
OS: Manjaro Linux (GNOME)
• Python2, PyGTK2,GtkSourceView2 → installed from AUR
• GTK2 → still in the repo
• PyGtkSourceView2 → not in AUR, manually built from archived GNOME sources

If you're on Arch, you can try it yourself.
📦 Code:
gitlab.com/zulfian1732/jo…

Jollpi 3 coming soon...





Show Original Post


05.12.2025 03:48
ahasty (@ahasty@techhub.social)

Spent the day writing scripts to pull various threat intel feed info from our vendors and sync them with various firewall and WAF technology.Python made this a breeze and it will hopefully result in a reduced ticket count coming out of the SOC.

#cybersecurity #threatIntel #python #securityautomation




Show Original Post


05.12.2025 02:55
AdamOnza (@AdamOnza@mastodon.online)

I made a convoluted little #Python function that computes binomial coefficients, apparently:
def bc(v,i):
z = [i,v-i]
if 0 in z:
return 1
z.sort()
m,n = z
n += 1
v = m
p = n
for i in range(1,m):
p *= (n+i)
v *= i
return p//v
#math




Show Original Post


05.12.2025 02:47
SnoopJ (@SnoopJ@hachyderm.io)

excuse me, what?

```
>>> td = timedelta(minutes=-5)
>>> td
datetime.timedelta(days=-1, seconds=86100)
>>> td.total_seconds()
-300.0
```

#Python




Show Original Post


1 ...875 876 877 878 879 880 881 882 883 884 885 ...1571
UP