<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Posts on Adhika Setya Pramudita</title><link>https://adhikasp.id/posts/</link><description>Recent content in Posts on Adhika Setya Pramudita</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Sun, 08 Nov 2026 12:00:00 +0800</lastBuildDate><atom:link href="https://adhikasp.id/posts/index.xml" rel="self" type="application/rss+xml"/><item><title>My personal software: bending tools instead of shopping for them</title><link>https://adhikasp.id/posts/my-personal-software/</link><pubDate>Sun, 08 Nov 2026 12:00:00 +0800</pubDate><guid>https://adhikasp.id/posts/my-personal-software/</guid><description>Coding agents made small changes cheap, so now I pick software I can bend: what makes it bendable, my base layer, and what I built on it.</description><content:encoded>&lt;p&gt;For most of my life, using software meant shopping. I have a need, I search for a tool, I find one that does 80% of it, and I live with the other 20%. Maybe there is a setting for it. Maybe there is a plugin. Usually there is a GitHub issue from 2019 with 300 thumbs up and no reply.&lt;/p&gt;&#10;&lt;p&gt;That changed for me over the last year. Now when something annoys me, I ask an agent to change the tool I already have.&lt;/p&gt;&#10;&lt;p&gt;That&amp;rsquo;s what I mean by personal software: software that fits one person. Me, and sometimes my wife. It doesn&amp;rsquo;t need to be a product. It doesn&amp;rsquo;t need docs, other people&amp;rsquo;s edge cases, or a launch on &lt;a href="https://news.ycombinator.com"&gt;Hacker News&lt;/a&gt;. It only needs to fit me.&lt;/p&gt;&#10;&lt;p&gt;This post covers what makes software bendable, the base layer I picked for it, and what I built on top.&lt;/p&gt;&#10;&lt;h2 id="why-now"&gt;Why now&lt;/h2&gt;&#10;&lt;p&gt;Making your own tool was always possible. I&amp;rsquo;m a software engineer, I could always fork something and patch it. But the cost was a weekend, plus maintaining the patch forever. With coding agents, a small change costs a prompt and a few minutes of waiting. That moves the bar a lot.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="https://adhikasp.id/images/personal-software-long-tail.svg" alt="Everything that annoys me as bars, biggest first, measured in how much time each one is worth. Only the two biggest clear the old cost, a weekend tinkering with the codebase. Almost all of the long tail of small stuff clears the new cost, a 1-minute prompt whenever the idea comes up: I used to live with it, now it gets fixed." class="svg" width="420" height="360" fetchpriority="high" decoding="async"&gt;&lt;/p&gt;&#10;&lt;p&gt;The &amp;ldquo;forever&amp;rdquo; part got cheaper too, which I didn&amp;rsquo;t expect. This month I moved from the terminal version of &lt;a href="https://herdr.dev"&gt;Herdr&lt;/a&gt;, the app I run my agents in, to its new desktop app. I had a pile of customization on the old one: plugins, hooks, and scripts that other scripts depended on. The old me would have stayed put because of that pile. Instead, the agent ported all of it on the same day. So lock-in is weak now, and I can pick the better tool instead of the one I already configured.&lt;/p&gt;&#10;&lt;h2 id="what-makes-software-bendable"&gt;What makes software bendable&lt;/h2&gt;&#10;&lt;p&gt;Not every piece of software can be bent. An agent works in text: it reads and writes files, runs commands, and reads their output. So software bends well when everything important about it is reachable that way. When I pick a tool now, I check:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;Config is text.&lt;/strong&gt; A file I can read, diff, and keep in git. Not a settings screen backed by some database.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;There is a CLI or an API.&lt;/strong&gt; If the agent can&amp;rsquo;t drive it, the agent can&amp;rsquo;t help me with it.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;The source is open.&lt;/strong&gt; When config is not enough, I can fork it.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Changes show up fast.&lt;/strong&gt; The agent edits a file, the app reloads, I see the result. Short loop.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;GUIs are not banned. But a GUI-only app is a dead end for this. The agent can&amp;rsquo;t look inside it and can&amp;rsquo;t change it, so I&amp;rsquo;m back to living with the 20%.&lt;/p&gt;&#10;&lt;h2 id="my-base-layer"&gt;My base layer&lt;/h2&gt;&#10;&lt;p&gt;Two agents do the bending, and everything else is there because it passes that checklist. Some of them are probably not the best in their category, and that&amp;rsquo;s fine.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="https://adhikasp.id/images/personal-software-bendability.svg" alt="A grid scoring each part of my base layer on the four checks. Omarchy, Herdr and my notes repo pass all four. Ghostty has only a partial CLI. Telegram is a closed app with my own forked bot on top, so it only partly passes on config and forking. A typical GUI-only app passes none." class="svg" width="480" height="372" loading="lazy" decoding="async"&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Two agents:&lt;/strong&gt; &lt;a href="https://www.claude.com/product/claude-code"&gt;Claude Code&lt;/a&gt; and &lt;a href="https://opencode.ai"&gt;OpenCode&lt;/a&gt;, about $40 a month for both. They read the same repo and the same instructions, so I can switch between them without losing anything. I don&amp;rsquo;t run local models. For hobby use, a subscription is much cheaper than a GPU and the weekends spent on it.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;&lt;a href="https://omarchy.org"&gt;Omarchy&lt;/a&gt; on the desktop.&lt;/strong&gt; It&amp;rsquo;s &lt;a href="https://archlinux.org"&gt;Arch Linux&lt;/a&gt; plus &lt;a href="https://hyprland.org"&gt;Hyprland&lt;/a&gt;, set up with good opinions. Two weeks ago I wiped Windows 11 off my mini PC for it.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;&lt;a href="https://ghostty.org"&gt;Ghostty&lt;/a&gt; as the terminal&lt;/strong&gt;, built from the &lt;a href="https://github.com/ghostty-org/ghostty"&gt;main branch&lt;/a&gt;. It only loses half a point, for not having much of a CLI.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Herdr to run the agents.&lt;/strong&gt; One window, a space per project, a tab per task, a pane per agent. I can see at a glance which agent is working and which one needs me. The agents can also write mods for it, so they extend their own workspace.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;A &lt;a href="https://git-scm.com"&gt;git&lt;/a&gt; repo as memory.&lt;/strong&gt; Plain markdown: a note per machine and service, a journal, a todo list, and an &lt;a href="https://agents.md"&gt;&lt;code&gt;AGENTS.md&lt;/code&gt;&lt;/a&gt; that tells any agent where things live. Agents forget everything between sessions, so the repo is where they remember things.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;&lt;a href="https://telegram.org"&gt;Telegram&lt;/a&gt; for when I&amp;rsquo;m away from the desk.&lt;/strong&gt; It gets its own section below.&lt;/p&gt;&#10;&lt;h2 id="what-i-bent"&gt;What I bent&lt;/h2&gt;&#10;&lt;p&gt;Some examples, from tiny to less tiny. Each one exists because the same small annoyance happened one too many times.&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;Tab titles.&lt;/strong&gt; A Herdr tab without a name just shows the program, which is useless when every tab runs &lt;code&gt;claude&lt;/code&gt;. Now a small &lt;a href="https://github.com/adhikasp/herdr-app-mods"&gt;mod&lt;/a&gt; names each tab after the agent&amp;rsquo;s own session title.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;A launcher for everything.&lt;/strong&gt; &lt;code&gt;SUPER+SPACE&lt;/code&gt; searches apps, windows, &lt;a href="https://www.google.com/chrome/"&gt;Chrome&lt;/a&gt; tabs and running agents, and does quick math, currency, and time zones. Typing &lt;code&gt;? something&lt;/code&gt; asks an agent right there, and &lt;code&gt;Ctrl+O&lt;/code&gt; continues the answer in a new Herdr tab. It started as a fork of &lt;a href="https://github.com/brianblakely/omarchy-everything"&gt;someone else&amp;rsquo;s Omarchy plugin&lt;/a&gt; and is now &lt;a href="https://github.com/adhikasp/omarchy-everything"&gt;its own repo&lt;/a&gt;.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Images in the terminal.&lt;/strong&gt; I wanted Claude Code to show me an image instead of a file path. That&amp;rsquo;s now a &lt;a href="https://github.com/adhikasp/claude-inline-image"&gt;small plugin&lt;/a&gt;.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;My phone&amp;rsquo;s launcher.&lt;/strong&gt; &lt;a href="https://www.mi.com/global/hyperos/"&gt;HyperOS&lt;/a&gt; turns off gesture navigation when you use a third-party launcher. I &lt;a href="https://github.com/adhikasp/KISS"&gt;forked&lt;/a&gt; the &lt;a href="https://kisslauncher.com"&gt;KISS&lt;/a&gt; launcher and added the edge gestures back.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Screen context.&lt;/strong&gt; When I say &amp;ldquo;this page&amp;rdquo; or &amp;ldquo;this video&amp;rdquo;, the agent runs a small tool that reads the focused window, plus the real URL and text of the Chrome tab I&amp;rsquo;m looking at. I stopped copy-pasting links into chats.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Phone context.&lt;/strong&gt; A small Android app lets the agent on my desktop read my phone&amp;rsquo;s battery, location and notifications, and, when I turn it on, tap and type on it. I can ask &amp;ldquo;what was that notification&amp;rdquo; from my desk.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Notes that check themselves.&lt;/strong&gt; Notes written mid-task are often a bit wrong. Every night an agent re-checks recent notes against git history and the live machine, and fixes the ones that drifted. Every morning another one reads my mail and calendar and pings me if something needs action.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;None of these are products. A few are public because why not, but they&amp;rsquo;re built for my machine, my phone and my habits. If one breaks, there is exactly one user to complain, and he knows who to blame.&lt;/p&gt;&#10;&lt;p&gt;My Telegram bot grew way bigger than all of these, so here it is in more detail.&lt;/p&gt;&#10;&lt;h2 id="the-bot-i-never-designed"&gt;The bot I never designed&lt;/h2&gt;&#10;&lt;p&gt;I wanted Claude Code and OpenCode on my phone.&lt;/p&gt;&#10;&lt;p&gt;I didn&amp;rsquo;t install &lt;a href="https://openclaw.ai"&gt;OpenClaw&lt;/a&gt;, the popular &amp;ldquo;agent you can text&amp;rdquo;. I already have two agents that know my repo, my instructions and my tools. OpenClaw would be a third one, with its own memory, its own plugins, and a pile of features I&amp;rsquo;d have to trust. I just want the agents I already have to be reachable from my phone.&lt;/p&gt;&#10;&lt;p&gt;I also skipped &lt;a href="https://openchamber.dev"&gt;OpenChamber&lt;/a&gt; and other apps that put a coding agent in a mobile web UI. I tried that already, with a web UI that mirrored my desktop sessions. On a phone it&amp;rsquo;s just a tiny desktop, and reading diffs and tool calls on a phone screen is not fun.&lt;/p&gt;&#10;&lt;p&gt;So I went with a chat app. I don&amp;rsquo;t need to watch every turn anymore. I send a task, put the phone away, and read the result later. For a real diff, I walk to the desk.&lt;/p&gt;&#10;&lt;p&gt;Claude Code already has an official &lt;a href="https://github.com/anthropics/claude-plugins-official/tree/main/external_plugins/telegram"&gt;Telegram plugin&lt;/a&gt; for its &lt;a href="https://code.claude.com/docs/en/channels"&gt;channels&lt;/a&gt; feature: one bot, one session. I set it up on a Saturday morning. By Sunday afternoon it looked like this, and I never planned any of it.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="https://adhikasp.id/images/personal-software-telegram-shape.svg" alt="A timeline of five messages over 29 hours, each next to the shape of the bot after it. Saturday 11:11, I ask for an always-on Claude session on Telegram: one bot, one session. 17:55, I send a screenshot and ask if it can handle topics: forked two minutes later, topics in, still one session. 18:27, I ask for an isolated session per topic: by 18:38 a router gives each topic its own session. Sunday 15:31, &amp;ldquo;Rewrite to rust if needed. I heard it high perf and safe&amp;rdquo;: by 15:51 each session&amp;rsquo;s link drops from 55 MB to 2 MB. 16:01, the agent says it would say no to rewriting the router and I say go ahead: by 16:09 the Rust router uses 6 MB instead of 60. The plugin goes from 475 MB across 10 Bun processes to about 19 MB." class="svg" width="420" height="945" loading="lazy" decoding="async"&gt;&lt;/p&gt;&#10;&lt;p&gt;Every step started as a message, most of them typed into the bot itself. &lt;a href="https://core.telegram.org/api/forum"&gt;Topics&lt;/a&gt; came from a screenshot I happened to see. The Rust rewrite came from idly asking how much memory my sessions used, and finding out each one ran its own copy of the plugin. Why Rust? Honestly, because I heard it&amp;rsquo;s fast and safe. That was the whole engineering decision.&lt;/p&gt;&#10;&lt;p&gt;The agent&amp;rsquo;s &amp;ldquo;no&amp;rdquo; was fair. The router was about 1,500 lines of TypeScript that already worked. It did the rewrite anyway, passed the same 20 end-to-end tests, and at some point killed its own Telegram connection by accident and went quiet for a minute. I never left the chat.&lt;/p&gt;&#10;&lt;p&gt;I never wrote a design for this bot. It grew out of a lot of &amp;ldquo;can it do this?&amp;rdquo; messages, some of them sent on a whim. It kept changing the same way after that weekend: either agent can answer a topic now, voice notes get transcribed, idle sessions close and come back on the next message, and my wife uses it from our family group chat.&lt;/p&gt;&#10;&lt;h2 id="what-it-costs"&gt;What it costs&lt;/h2&gt;&#10;&lt;p&gt;Of course this is not free. For the agents to bend my setup, I have to give them a lot of access: a shell on my machine, my mail and calendar, my screen, my phone. I need to trust that they do the right thing when I&amp;rsquo;m not watching. I also need to trust the company behind the model: that Anthropic actually follows its own &lt;a href="https://www.anthropic.com/legal/consumer-terms"&gt;terms&lt;/a&gt; about my data, and that it doesn&amp;rsquo;t get breached.&lt;/p&gt;&#10;&lt;p&gt;That sounds like a lot, until I remember I was already doing it.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="https://adhikasp.id/images/personal-software-trust.svg" alt="A grid of who I trust, with two columns: holds my stuff, and acts as me. Gmail has my email, Chrome my saved passwords, LastPass had my passwords until the breach, and Vaultwarden has them now, so that&amp;rsquo;s me. None of them act as me. The last row, Claude Code and OpenCode with a shell on my machine, does both." class="svg" width="420" height="344" loading="lazy" decoding="async"&gt;&lt;/p&gt;&#10;&lt;p&gt;LastPass &lt;a href="https://blog.lastpass.com/posts/notice-of-recent-security-incident"&gt;did get breached&lt;/a&gt;, so these days my passwords live in a &lt;a href="https://github.com/dani-garcia/vaultwarden"&gt;Vaultwarden&lt;/a&gt; I host myself. Which mostly means I now trust myself instead.&lt;/p&gt;&#10;&lt;p&gt;The only way to trust nothing is to live in the middle of a desert with no internet. But then you couldn&amp;rsquo;t read this. So, what did you trust to open this page? Your browser, your OS, your ISP, a DNS resolver, the certificate authority behind the padlock, Cloudflare sitting in front of this blog, and me, that this page only does what it looks like it does. (It also loads fonts from Google and one analytics script. You trusted those too.) You probably didn&amp;rsquo;t think about any of them.&lt;/p&gt;&#10;&lt;p&gt;So I will always end up trusting someone. What changes with agents is they can also act as me, and for that I&amp;rsquo;m trusting the people who build the model. Anthropic has whole teams on &lt;a href="https://www.anthropic.com/research/team/alignment"&gt;alignment&lt;/a&gt; and &lt;a href="https://www.anthropic.com/research/team/interpretability"&gt;interpretability&lt;/a&gt;, and I&amp;rsquo;m betting their work holds up, and that these models, in the end, stay aligned with human interests.&lt;/p&gt;&#10;&lt;p&gt;Some things do worry me. Anthropic&amp;rsquo;s own research found that as few as &lt;a href="https://www.anthropic.com/research/small-samples-poison"&gt;250 poisoned documents&lt;/a&gt; in the training data can plant a backdoor in a model, whatever its size. And with open-weight models, a technique called &lt;a href="https://huggingface.co/blog/mlabonne/abliteration"&gt;abliteration&lt;/a&gt; can strip out a model&amp;rsquo;s refusals without any retraining. Alignment is not exactly a solved problem.&lt;/p&gt;&#10;&lt;p&gt;But if it goes wrong at that level, humanity is doomed anyway. So honestly, I&amp;rsquo;d rather see it happen first in my own stack. At least I&amp;rsquo;d get a head start on survival prep.&lt;/p&gt;&#10;&lt;h2 id="if-you-want-to-try-this"&gt;If you want to try this&lt;/h2&gt;&#10;&lt;p&gt;You don&amp;rsquo;t need to copy my stack. Pick tools that pass the checklist, keep your notes in a git repo with an &lt;code&gt;AGENTS.md&lt;/code&gt;. Then the next time something annoys you, before searching for a new tool, ask the agent to change the one you have.&lt;/p&gt;&#10;&lt;p&gt;Start small. A tab title. A keybinding. A script that saves you three clicks. Then keep asking, the way I did with the bot. It adds up surprisingly fast.&lt;/p&gt;&#10;&lt;p&gt;I think personal software is the future. Most people won&amp;rsquo;t write code for it, they will just ask an agent. Fitting software to one person is finally cheap enough to do for the small things, and the small things are most of what I touch all day.&lt;/p&gt;&#10;&lt;h2 id="next"&gt;Next&lt;/h2&gt;&#10;&lt;p&gt;This is part 1 of a short series about my setup. Part 2 is the homelab under all of this: five machines, two countries, and only one public door. Part 3 is the desktop itself: a 55-inch TV as a monitor, a paper-and-ink theme, and that launcher.&lt;/p&gt;&#10;</content:encoded></item><item><title>The top Hacker News story of every day, 2007 to 2026</title><link>https://adhikasp.id/posts/top-hn-stories-2026/</link><pubDate>Fri, 06 Nov 2026 12:00:00 +0800</pubDate><guid>https://adhikasp.id/posts/top-hn-stories-2026/</guid><description>One highest-scored story per day, across 7,177 days of Hacker News. Top stories doubled in points over a decade, and a quarter of today's are about AI.</description><content:encoded>&lt;p&gt;Two years ago I made a small page called &lt;em&gt;Top HN Stories&lt;/em&gt;. It was a scatter plot: one dot per day, the day&amp;rsquo;s highest-scored Hacker News story, click a dot to open the thread. I liked it, and then the data behind it stopped in November 2024 and it just sat there.&lt;/p&gt;&#10;&lt;p&gt;This week I &lt;a href="https://adhikasp.id/posts/ai-shift-on-hacker-news/"&gt;revived my HN dataset&lt;/a&gt;, so I rebuilt the whole thing with fresh data. This post replaces the old page. Same idea, now from February 2007 to 4 November 2026, with some numbers I did not look at the first time.&lt;/p&gt;&#10;&lt;h2 id="all-7177-days-in-one-picture"&gt;All 7,177 days in one picture&lt;/h2&gt;&#10;&lt;p&gt;&lt;img src="https://adhikasp.id/images/top-hn-scatter.svg" alt="Score of the top HN story of each day, 2007 to 2026" class="svg" width="475" height="317" fetchpriority="high" decoding="async"&gt;&lt;/p&gt;&#10;&lt;p&gt;Each dot is one day. The height is how many points that day&amp;rsquo;s best story got. Orange dots are stories with AI in the title (more on that below), the black line is the median of each year.&lt;/p&gt;&#10;&lt;p&gt;Some things stand out:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;It grew fast, then went flat, then grew again.&lt;/strong&gt; The median top story had about 478 points in 2011 and 1,038 in 2021. Then it sat at roughly 920 to 960 for three years (2022 to 2024). In 2025 it went to 1,076 and in 2026 to 1,275, the highest ever.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Spikes are news, not tech.&lt;/strong&gt; The highest days are almost never a clever project. They are somebody dying or something breaking.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;The floor moved up too.&lt;/strong&gt; In 2008 the best day of the whole year had 532 points. In 2026 there were 40 days where the top story crossed 2,000 points. The previous record was 29, in 2020.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="the-biggest-days-ever"&gt;The biggest days ever&lt;/h2&gt;&#10;&lt;table&gt;&#10;&#9;&lt;thead&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th style="text-align: right"&gt;Points&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Date&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Story&lt;/th&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/thead&gt;&#10;&#9;&lt;tbody&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;6,015&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;2018-03-14&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;a href="https://news.ycombinator.com/item?id=16582136"&gt;Stephen Hawking has died&lt;/a&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;5,771&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;2016-02-17&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;a href="https://news.ycombinator.com/item?id=11116274"&gt;A Message to Our Customers&lt;/a&gt; (Apple vs the FBI)&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;5,710&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;2023-11-18&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;a href="https://news.ycombinator.com/item?id=38309611"&gt;OpenAI&amp;rsquo;s board has fired Sam Altman&lt;/a&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;4,549&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;2024-03-29&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;a href="https://news.ycombinator.com/item?id=39865810"&gt;Backdoor in upstream xz/liblzma leading to SSH server compromise&lt;/a&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;4,405&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;2024-07-19&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;a href="https://news.ycombinator.com/item?id=41002195"&gt;CrowdStrike Update: Windows Bluescreen and Boot Loops&lt;/a&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;4,338&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;2011-10-06&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;a href="https://news.ycombinator.com/item?id=3078128"&gt;Steve Jobs has passed away&lt;/a&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;4,310&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;2023-08-05&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;a href="https://news.ycombinator.com/item?id=37011324"&gt;Bram Moolenaar has died&lt;/a&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;4,298&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;2022-05-04&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;a href="https://news.ycombinator.com/item?id=31261533"&gt;Mechanical Watch&lt;/a&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;4,240&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;2020-10-24&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;a href="https://news.ycombinator.com/item?id=24872911"&gt;YouTube-dl has received a DMCA takedown from RIAA&lt;/a&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;4,229&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;2026-03-12&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;a href="https://news.ycombinator.com/item?id=47340079"&gt;Don&amp;rsquo;t post generated/AI-edited comments. HN is for conversation between humans&lt;/a&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;p&gt;Eight out of ten are deaths, outages, security incidents, legal fights or a company doing something drastic. Only one is a pure &amp;ldquo;look at this beautiful thing&amp;rdquo;, and it is &lt;a href="https://ciechanow.ski/"&gt;Bartosz Ciechanowski&lt;/a&gt;&amp;rsquo;s &lt;em&gt;Mechanical Watch&lt;/em&gt;. His &lt;em&gt;Moon&lt;/em&gt; was the best story of December 2024 (3,115 points). If you want to see what a top-tier explainer looks like, start there.&lt;/p&gt;&#10;&lt;p&gt;The 2026 entry is HN&amp;rsquo;s own guideline against AI-generated comments. The site that talks about AI the most spent its best day of the year on keeping AI out of its own comment section. I find that funny and a bit telling.&lt;/p&gt;&#10;&lt;h2 id="the-best-story-of-each-year"&gt;The best story of each year&lt;/h2&gt;&#10;&lt;p&gt;A year is a long time, so here is the winner of each one.&lt;/p&gt;&#10;&lt;table&gt;&#10;&#9;&lt;thead&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Year&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th style="text-align: right"&gt;Points&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Story&lt;/th&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/thead&gt;&#10;&#9;&lt;tbody&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;2011&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;4,338&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;a href="https://news.ycombinator.com/item?id=3078128"&gt;Steve Jobs has passed away&lt;/a&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;2012&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;3,531&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;a href="https://news.ycombinator.com/item?id=3742902"&gt;Show HN: This up votes itself&lt;/a&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;2013&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;2,744&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;a href="https://news.ycombinator.com/item?id=6258422"&gt;Don&amp;rsquo;t Fly During Ramadan&lt;/a&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;2014&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;3,086&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;a href="https://news.ycombinator.com/item?id=8532261"&gt;Tim Cook Speaks Up&lt;/a&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;2015&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;2,228&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;a href="https://news.ycombinator.com/item?id=10037157"&gt;G is for Google&lt;/a&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;2016&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;5,771&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;a href="https://news.ycombinator.com/item?id=11116274"&gt;A Message to Our Customers&lt;/a&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;2017&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;4,107&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;a href="https://news.ycombinator.com/item?id=13682022"&gt;Reflecting on one very, very strange year at Uber&lt;/a&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;2018&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;6,015&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;a href="https://news.ycombinator.com/item?id=16582136"&gt;Stephen Hawking has died&lt;/a&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;2019&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;3,287&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;a href="https://news.ycombinator.com/item?id=20052623"&gt;Switch from Chrome to Firefox&lt;/a&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;2020&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;4,240&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;a href="https://news.ycombinator.com/item?id=24872911"&gt;YouTube-dl has received a DMCA takedown from RIAA&lt;/a&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;2021&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;4,103&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;a href="https://news.ycombinator.com/item?id=26699106"&gt;Google&amp;rsquo;s copying of the Java SE API was fair use&lt;/a&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;2022&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;4,298&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;a href="https://news.ycombinator.com/item?id=31261533"&gt;Mechanical Watch&lt;/a&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;2023&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;5,710&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;a href="https://news.ycombinator.com/item?id=38309611"&gt;OpenAI&amp;rsquo;s board has fired Sam Altman&lt;/a&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;2024&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;4,549&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;a href="https://news.ycombinator.com/item?id=39865810"&gt;Backdoor in upstream xz/liblzma&lt;/a&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;2025&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;3,406&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;a href="https://news.ycombinator.com/item?id=45283887"&gt;Slack has raised our charges by $195k per year&lt;/a&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;2026&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;4,229&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;a href="https://news.ycombinator.com/item?id=47340079"&gt;Don&amp;rsquo;t post generated/AI-edited comments&lt;/a&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;p&gt;The 2012 one is a nice surprise. The link of &lt;em&gt;&amp;ldquo;This up votes itself&amp;rdquo;&lt;/em&gt; is the HN upvote URL of the story itself, so everyone who clicked it voted for it. It reached 3,531 points and is the best story of its year. A very HN joke: show the ranking can be played, and the crowd upvotes the demonstration.&lt;/p&gt;&#10;&lt;p&gt;Also in 2026 so far: &lt;em&gt;Ghostty is leaving GitHub&lt;/em&gt; (3,521, April), a Show HN about replacing a $120k bowling center system with $1,600 in ESP32s (2,935, July), and &lt;em&gt;Patrick Stewart has died&lt;/em&gt; (3,310, last week).&lt;/p&gt;&#10;&lt;h2 id="it-is-a-quarter-ai-now"&gt;It is a quarter AI now&lt;/h2&gt;&#10;&lt;p&gt;I use the same crude keyword match from the &lt;a href="https://adhikasp.id/posts/ai-shift-on-hacker-news/"&gt;AI post&lt;/a&gt; (AI, LLM, GPT, OpenAI, Anthropic, Claude, Gemini, agents, MCP, and some more, listed at the bottom). This time I only look at the top story of each day.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="https://adhikasp.id/images/top-hn-ai-share.svg" alt="Share of days where the top story is about AI" class="svg" width="475" height="245" loading="lazy" decoding="async"&gt;&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;2015 to 2021: 0.6% to 2.7%.&lt;/strong&gt; A few ML stories a year. The 2016 bump is machine learning and deep learning content (a TPU chip, a neural network you can tinker with in the browser, free courses), not chatbots.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;2022: 3.6%.&lt;/strong&gt; Image generators (Stable Diffusion, Imagen), Whisper, and the first ChatGPT weeks in December.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;2023: 13.5%.&lt;/strong&gt; The year the jump happened.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;2024: 11.8%.&lt;/strong&gt; A small cool-down, the only year that went down.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;2025: 17.3%.&lt;/strong&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;2026: 25.0%.&lt;/strong&gt; 77 of 308 days so far. One day in four, the best story on HN is about AI.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;This matches the all-stories number from my previous post (about one in four), which is reassuring. It is a different slice of the data: that was every story, this is only the winner of each day.&lt;/p&gt;&#10;&lt;h2 id="small-things-i-noticed"&gt;Small things I noticed&lt;/h2&gt;&#10;&lt;p&gt;&lt;strong&gt;Comments grew even more than points.&lt;/strong&gt; The median top story had 372 comments in 2024 and 610 in 2026. People do not only upvote now, they argue. The most-commented top story of any day is &lt;em&gt;Trump wins presidency for second time&lt;/em&gt; (2024-11-06, 9,053 comments), and the runner-up is the Zelensky White House meeting (5,034).&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Weekends are quieter.&lt;/strong&gt; Since 2023 the average top story gets about 1,300 points on a Thursday and about 960 on a Sunday. Fewer people are online, the competition is weaker, and the winner is smaller.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;GitHub is the number one source.&lt;/strong&gt; 239 days (3.3%) had a top story hosted on github.com. Next are twitter.com (136), techcrunch.com (114), nytimes.com (113), and paulgraham.com (88, the founder&amp;rsquo;s own essays).&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Show HN wins about one day in 20.&lt;/strong&gt; Around 4% of top stories since 2020 are a &amp;ldquo;Show HN&amp;rdquo;. It peaked in 2024 at 5.5%. In 2026 it dropped to 2.9%, so there are fewer &amp;ldquo;look what I built&amp;rdquo; winners in a year where agents can build almost anything. I do not have a good explanation, my guess is that when making things is cheap, a made thing is less impressive.&lt;/p&gt;&#10;&lt;h2 id="what-i-take-from-this"&gt;What I take from this&lt;/h2&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;&lt;strong&gt;The signal is where the crowd goes in a crisis.&lt;/strong&gt; On the biggest days HN works like a group chat for the tech world. Something is on fire, so everyone comes to read and argue.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Inflation is real but it is not just growth.&lt;/strong&gt; The median doubled from 2011 to 2021, flattened for three years, then rose again. The second rise lines up with AI taking a quarter of the top spots and with people commenting more.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Top story means something different now.&lt;/strong&gt; The old winners were things you could understand in one sentence. The 2026 list includes policy statements, model releases and platform rules. The community is the same size or bigger, but it is arguing about a different set of things.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;h2 id="how-i-did-this-and-what-is-wrong-with-it"&gt;How I did this, and what is wrong with it&lt;/h2&gt;&#10;&lt;p&gt;The data is the public dataset at &lt;code&gt;hacker-news.adhikasp.my.id&lt;/code&gt;. The core query is one &lt;code&gt;row_number()&lt;/code&gt;:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sql" data-lang="sql"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;score&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;descendants&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;cast&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;AS&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;date&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;AS&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;score&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;descendants&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;row_number&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;OVER&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;PARTITION&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;BY&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;cast&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;AS&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;date&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;ORDER&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;BY&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;score&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;DESC&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;AS&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;rn&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;read_parquet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;year=*/month=*/data.parquet&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;hive_partitioning&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;WHERE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;type&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;story&amp;#39;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;AND&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;score&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;IS&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;NOT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;AND&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;coalesce&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dead&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;AND&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;coalesce&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;deleted&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;AND&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;IS&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;NOT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;WHERE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;rn&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;ORDER&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;BY&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Caveats:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;&amp;ldquo;Day&amp;rdquo; is a UTC+7 day.&lt;/strong&gt; Timestamps in the dataset are naive UTC+7 (the 2025 files were created that way and I kept it), so a story posted at 18:00 UTC counts for the next calendar day. It does not matter for the trends, but a single story can land one day off.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Score is the score when the dataset fetched the item.&lt;/strong&gt; Points are the story&amp;rsquo;s total, not how high it ranked, and I did not check how long each one stayed on the front page.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;One story per day hides everything else.&lt;/strong&gt; A day with two giant stories only shows one. It also says nothing about the second-best story of a quiet week.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;The AI match is by title.&lt;/strong&gt; Same keywords as the earlier post, so &amp;ldquo;agent&amp;rdquo; or &amp;ldquo;transformer&amp;rdquo; can be a false hit. Before 2023 the match rate is about 1 in 100 days or less, which is the noise level. The AI list: &lt;code&gt;ai, llm(s), gpt, chatgpt, openai, anthropic, claude, gemini, copilot, agent(s), agentic, mcp, deepseek, qwen, mistral, llama, machine learning, neural, diffusion, transformer, large language, generative&lt;/code&gt;.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;2007 starts in February&lt;/strong&gt; (the dataset&amp;rsquo;s first month) and 2026 ends on 4 November, so those two years are partial. The old page also had 10 days from October 2006 that are not in this dataset.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;The old interactive page is no longer updated. If you want to click individual dots, the SQL above gives you the exact table; every row has the story id, so the thread is one &lt;code&gt;https://news.ycombinator.com/item?id=...&lt;/code&gt; away.&lt;/p&gt;&#10;&lt;p&gt;Next I want to look at the second layer: not who wins a day, but which stories are on the front page the longest. A story that holds the top 10 for 12 hours is not the same thing as one that spikes and falls.&lt;/p&gt;&#10;</content:encoded></item><item><title>From GPT to agents: how AI changed on Hacker News</title><link>https://adhikasp.id/posts/ai-shift-on-hacker-news/</link><pubDate>Thu, 05 Nov 2026 00:10:00 +0800</pubDate><guid>https://adhikasp.id/posts/ai-shift-on-hacker-news/</guid><description>I queried 50 million Hacker News items to see how the AI conversation shifted since ChatGPT: from the model to the tools, then to living with them.</description><content:encoded>&lt;p&gt;This week I revived my &lt;a href="https://adhikasp.id/notebook/hn-data-exploration/"&gt;Hacker News dataset&lt;/a&gt;. It is every story and comment from 2007 until this week, about 50 million rows, as monthly Parquet files that DuckDB can query directly. Having it fresh again, I wanted to ask one simple question.&lt;/p&gt;&#10;&lt;p&gt;How did the conversation about AI actually change?&lt;/p&gt;&#10;&lt;p&gt;Not &amp;ldquo;is AI big&amp;rdquo;, that one is obvious. I mean what people talk about, who they talk about, and how they feel about it. Hacker News is a decent microscope for this. It is a developer crowd, it is very online, and it reacts to everything within hours.&lt;/p&gt;&#10;&lt;p&gt;So here is what 7 years of story titles say.&lt;/p&gt;&#10;&lt;h2 id="it-is-one-in-four-stories-now"&gt;It is one in four stories now&lt;/h2&gt;&#10;&lt;p&gt;First the boring number. I counted a story as &amp;ldquo;about AI&amp;rdquo; if its title matches a list of keywords (AI, LLM, GPT, OpenAI, Anthropic, Claude, Gemini, agents, MCP, Llama, DeepSeek and some more, full list at the bottom).&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="https://adhikasp.id/images/ai-shift-share.svg" alt="Share of HN story titles that are about AI" class="svg" width="454" height="331" fetchpriority="high" decoding="async"&gt;&lt;/p&gt;&#10;&lt;p&gt;It is not one smooth wave. It looks like three steps:&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;&lt;strong&gt;2019 to late 2022: flat at ~2.5%.&lt;/strong&gt; Machine learning was a normal topic, like databases or Rust.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;ChatGPT, December 2022.&lt;/strong&gt; The share jumps from 4% to 15% in four months. After that it settles around 10-14% for the whole of 2023 and 2024. That is the first plateau.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;2025 and 2026: it never stops climbing.&lt;/strong&gt; Claude Code shows up in February 2025 and the line mostly goes up from there. Then in early 2026 it takes another jump, 21% in January to 28% in February. It has stayed at 25-27% since.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;If you only count the 30 most upvoted stories of each month, it is even more. That number was 0.8% in 2019, 14% in 2023, and &lt;strong&gt;29% on average in 2026&lt;/strong&gt;. In May 2026 it was 40%.&lt;/p&gt;&#10;&lt;p&gt;I did not expect the second jump. After ChatGPT I assumed the hype would cool down and the share would come back to a stable level. It did the opposite.&lt;/p&gt;&#10;&lt;h2 id="the-word-changed-gpt-then-llm-then-agent"&gt;The word changed: GPT, then LLM, then agent&lt;/h2&gt;&#10;&lt;p&gt;What I find more interesting than the size is the vocabulary. If I count a few specific words in titles, each one has its own era.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="https://adhikasp.id/images/ai-shift-vocab.svg" alt="Title keyword counts per 1,000 stories" class="svg" width="480" height="344" loading="lazy" decoding="async"&gt;&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;&amp;ldquo;GPT&amp;rdquo; / ChatGPT&lt;/strong&gt; peaked in March 2023, at 62 titles per 1,000 stories. About 1 in 16 stories had it. Today it is under 7.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;&amp;ldquo;LLM&amp;rdquo;&lt;/strong&gt; is the calmer, more technical word. It grew slowly through 2023 and 2024, and peaked in February 2026 (27 per 1,000). Now it is slowly declining.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;&amp;ldquo;Agent(s)&amp;rdquo;&lt;/strong&gt; was background noise until 2024. Then it grows through 2025 and explodes in early 2026. In March 2026 it was in &lt;strong&gt;80 of every 1,000 stories&lt;/strong&gt;, more than GPT&amp;rsquo;s peak. It is still around 69 today.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;&amp;ldquo;MCP&amp;rdquo;&lt;/strong&gt; is the little hump. It appears in early 2025, peaks in April 2025 (15 per 1,000) and then goes quiet. Protocols are quiet by nature, I guess. Once everyone just uses it, nobody writes a title about it.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;To me this reads like the focus moved up one layer each time. First people talked about &lt;em&gt;the model&lt;/em&gt; (what can GPT do). Then about &lt;em&gt;the model as a component&lt;/em&gt; (LLM, how do I use it). Now it is about &lt;em&gt;the thing built around the model&lt;/em&gt;: the loop, the tools, the permissions, the harness. The word &amp;ldquo;agent&amp;rdquo; really is about the system, not about the weights.&lt;/p&gt;&#10;&lt;p&gt;I see the same shift in my own habits, I spend more time comparing agents like Claude Code and OpenCode than comparing models. But I don&amp;rsquo;t think the model became unimportant. The harness is where the talk moved, the model is still half of the result (see the next section).&lt;/p&gt;&#10;&lt;p&gt;If you only look at coding tools (Claude Code, Cursor, Copilot, Codex, OpenCode and a few others), the matching titles went from ~900 in 2024 to ~3,200 in 2025 to &lt;strong&gt;8,400 in the first ten months of 2026&lt;/strong&gt;. And &amp;ldquo;vibe coding&amp;rdquo; came and went as a term: 946 titles in 2025, but it is already fading in 2026.&lt;/p&gt;&#10;&lt;h2 id="who-gets-talked-about"&gt;Who gets talked about&lt;/h2&gt;&#10;&lt;p&gt;The same count by company tells a pretty dramatic story.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="https://adhikasp.id/images/ai-shift-vendors.svg" alt="Quarterly mentions of OpenAI, Anthropic, Gemini and open-weight models" class="svg" width="512" height="331" loading="lazy" decoding="async"&gt;&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;In early 2023, OpenAI/GPT titles were the entire AI conversation. 50 per 1,000 stories. Anthropic was 0.5.&lt;/li&gt;&#10;&lt;li&gt;OpenAI fell fast, then settled into a band of roughly 14-22 per 1,000 from 2024 (the quarter of the Altman firing excepted).&lt;/li&gt;&#10;&lt;li&gt;Anthropic/Claude grew steadily through 2024 and 2025, caught up with OpenAI around December 2025, and then jumped in Q1 2026 to 35 per 1,000. That is more than twice OpenAI in the same quarter (14).&lt;/li&gt;&#10;&lt;li&gt;Open-weight models have a rhythm of spikes. The pink spike in Q1 2025 is DeepSeek.&lt;/li&gt;&#10;&lt;li&gt;Gemini is surprisingly flat. It is always there, never the main topic.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;This is also why I don&amp;rsquo;t buy &amp;ldquo;the model is a commodity&amp;rdquo;. If it were, nobody would argue about whose name is in the title.&lt;/p&gt;&#10;&lt;p&gt;Two caveats. HN is not &amp;ldquo;the market&amp;rdquo;, and a developer crowd will naturally love whatever is the best coding tool this quarter. Also &amp;ldquo;Claude&amp;rdquo; includes Claude Code, which is probably most of the 2026 jump. So read this chart as &amp;ldquo;mindshare among programmers&amp;rdquo;, not as market share.&lt;/p&gt;&#10;&lt;p&gt;But still, the leader changed within three years, and it was not slow. I wonder what this chart looks like next year.&lt;/p&gt;&#10;&lt;h2 id="ai-posts-get-a-little-less-love-per-post"&gt;AI posts get a little less love per post&lt;/h2&gt;&#10;&lt;p&gt;Here is something I did not expect.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="https://adhikasp.id/images/ai-shift-attention.svg" alt="AI share of stories, upvotes and comments" class="svg" width="437" height="331" loading="lazy" decoding="async"&gt;&lt;/p&gt;&#10;&lt;p&gt;For every year, AI is a bigger share of the &lt;em&gt;stories&lt;/em&gt; than of the &lt;em&gt;upvotes&lt;/em&gt;, and the comments sit in between. In 2026: 26% of stories, 21% of upvotes, 23% of comments.&lt;/p&gt;&#10;&lt;p&gt;The average AI-related story scores 15.7 points in 2026, while the average other story scores 20.2. That gap is not new, it was the same in 2019 (10.7 vs 15.8). So the readers did not get tired of AI specifically. It is more that AI is the topic everybody wants to submit. One hint: 19% of AI-titled stories in 2026 are &amp;ldquo;Show HN&amp;rdquo; (people showing what they built), against 12% of the other stories. Show HN posts also score a bit lower on average (13.9 vs 15.0 points since 2015).&lt;/p&gt;&#10;&lt;p&gt;The attention is not evenly spread though. A few threads take most of it. Here are the biggest AI stories in the dataset by score:&lt;/p&gt;&#10;&lt;table&gt;&#10;&#9;&lt;thead&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th style="text-align: right"&gt;Points&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Story&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Date&lt;/th&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/thead&gt;&#10;&#9;&lt;tbody&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;5,710&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;OpenAI&amp;rsquo;s board has fired Sam Altman&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Nov 2023&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;4,229&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Don&amp;rsquo;t post generated/AI-edited comments. HN is for conversation between humans&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Mar 2026&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;4,091&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;GPT-4&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Mar 2023&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;3,346&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Show HN: Gemini Pro 3 imagines the HN front page 10 years from now&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Dec 2025&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;3,138&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;GPT-4o&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;May 2024&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;2,932&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Astra can read and write weights to improve Qwen&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Nov 2026&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;2,905&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;GitHub Copilot&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Jun 2021&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;2,626&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Claude Fable 5&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Jun 2026&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;2,455&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Google &amp;ldquo;We have no moat, and neither does OpenAI&amp;rdquo;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;May 2023&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;2,445&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Claude Code is steganographically marking requests&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Jun 2026&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;p&gt;My favourite here is the second row. A rule about &lt;em&gt;not posting AI-generated comments&lt;/em&gt;, from the site itself, is the second most upvoted AI story in this dataset. And it is from this year.&lt;/p&gt;&#10;&lt;h2 id="the-mood-changed-too"&gt;The mood changed too&lt;/h2&gt;&#10;&lt;p&gt;The tone moved from &amp;ldquo;wow&amp;rdquo; to &amp;ldquo;how do I live with this&amp;rdquo;. A few words that show it:&lt;/p&gt;&#10;&lt;table&gt;&#10;&#9;&lt;thead&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Keyword in title&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th style="text-align: right"&gt;2023&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th style="text-align: right"&gt;2024&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th style="text-align: right"&gt;2025&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th style="text-align: right"&gt;2026 (to Oct)&lt;/th&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/thead&gt;&#10;&#9;&lt;tbody&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;slop&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;0&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;35&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;318&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;827&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;bubble&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;146&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;180&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;477&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;290&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;hallucinat*&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;188&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;221&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;281&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td style="text-align: right"&gt;341&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;p&gt;&amp;ldquo;Slop&amp;rdquo; went from nothing to 827 titles this year. The big stories of 2023 were mostly launches (&lt;em&gt;&amp;ldquo;GPT-4&amp;rdquo;&lt;/em&gt;, &lt;em&gt;&amp;ldquo;Llama 2&amp;rdquo;&lt;/em&gt;). The big ones of 2026 also include &amp;ldquo;An AI agent published a hit piece on me&amp;rdquo; (2,346 points), &amp;ldquo;I believe there are entire companies right now under AI psychosis&amp;rdquo; (2,105), and in 2025 &amp;ldquo;My AI skeptic friends are all nuts&amp;rdquo; (2,356).&lt;/p&gt;&#10;&lt;p&gt;And the last 3 months have a clear new theme: &lt;strong&gt;the tools themselves became the attack surface&lt;/strong&gt;.&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;A backdoor in a Claude Code extension on the Cursor marketplace&lt;/li&gt;&#10;&lt;li&gt;OpenCode user credentials leaked&lt;/li&gt;&#10;&lt;li&gt;Postman silently auto-installing AI plugins that try to share all your API data&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;That makes sense. When the thing is an agent that can run commands, read your files and has your credentials, the security question stops being theoretical. Everything I said about the focus moving to the harness has a flip side: the harness is where things break.&lt;/p&gt;&#10;&lt;p&gt;Meanwhile the money part is getting loud as well. In the last 3 months the big stories included Nvidia acquiring Hugging Face, an Anthropic S-1 filing (with 1,681 comments, and a counter thread arguing the SEC should block it), and a House resolution against an &amp;ldquo;AI bubble bailout&amp;rdquo;.&lt;/p&gt;&#10;&lt;h2 id="what-i-take-from-this"&gt;What I take from this&lt;/h2&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;&lt;strong&gt;The conversation moved to the harness, but the model still matters just as much.&lt;/strong&gt; The talk shifted to the loop around it: tools, context, permissions, review. Yet the vendor chart says people still care about &lt;em&gt;whose&lt;/em&gt; model it is. Each lab curates data and trains in its own flavour, and that shows in how an agent behaves, even with the same harness. The catch is distillation. Open-weight models are trained on outputs of the big ones, so the flavours blur, and the gap between a frontier model and an open one keeps getting harder to see from the outside. I treat the model and the harness as two halves of one product, and I would not judge either alone.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Mindshare is fickle.&lt;/strong&gt; OpenAI was 50 per 1,000 stories in 2023 and about 17 now. Anthropic went from 0.5 to a peak of 35. If the leader can change in three years, designing a system that can swap the model without drama is not over-engineering, it is basic hygiene.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Growth and fatigue happen at the same time.&lt;/strong&gt; AI is 25% of all stories and &amp;ldquo;slop&amp;rdquo; is also at an all-time high. Both are true. I think it means the easy part (impressive demo) is cheap now, and the hard part (trust, correctness, security) is what people start to care about.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;h2 id="how-i-did-this-and-what-is-wrong-with-it"&gt;How I did this, and what is wrong with it&lt;/h2&gt;&#10;&lt;p&gt;All the data is the public dataset at &lt;code&gt;hacker-news.adhikasp.my.id&lt;/code&gt;, and the query is a plain DuckDB regex over the title:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sql" data-lang="sql"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;strftime&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;%Y-%m&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;AS&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;month&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;count&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;AS&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;stories&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;regexp_matches&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;\bai\b|\bllms?\b|\bgpt|chatgpt|openai|anthropic|claude|gemini|copilot|&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;||&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;\bagents?\b|agentic|\bmcp\b|deepseek|qwen|mistral|llama|&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;||&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;machine learning|neural|diffusion|transformer|large language|generative&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;)::&lt;/span&gt;&lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;AS&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ai_stories&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;read_parquet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;year=*/month=*/data.parquet&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;hive_partitioning&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;WHERE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;type&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;story&amp;#39;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;AND&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;IS&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;NOT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;GROUP&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;BY&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;ORDER&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;BY&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Things to keep in mind when reading the charts:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;Keyword matching is crude.&lt;/strong&gt; &amp;ldquo;agent&amp;rdquo; also matches things like user agents or real estate agents, and &amp;ldquo;copilot&amp;rdquo;, &amp;ldquo;transformer&amp;rdquo; or &amp;ldquo;cursor&amp;rdquo; can be about something else. I checked the baseline: before 2023 these words appear about 1 in 1,000 titles, so the 2026 numbers are far above the noise, but the exact percentages are rough.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Only titles, only stories.&lt;/strong&gt; A comment about AI under a non-AI story does not count.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;HN is not the world.&lt;/strong&gt; It is a small developer crowd with strong opinions.&lt;/li&gt;&#10;&lt;li&gt;I dropped stories flagged as dead or deleted, and I left out November 2026 because it is not finished. The attention chart (stories vs upvotes vs comments) counts only the story&amp;rsquo;s own score and total comment count.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;It is a fun dataset. Next I want to try the comments, to see whether the tone toward AI (not just the topic) changes over time.&lt;/p&gt;&#10;</content:encoded></item><item><title>Using Nano Banana Pro as 'Browser Engine'</title><link>https://adhikasp.id/posts/2025/12/nano-banana-pro-browser-engine/</link><pubDate>Sat, 06 Dec 2025 12:00:00 +0700</pubDate><guid>https://adhikasp.id/posts/2025/12/nano-banana-pro-browser-engine/</guid><description>An experiment comparing Nano Banana Pro's rendering capabilities against a real browser using a convenience store web profile.</description><content:encoded>&lt;p&gt;Randomly I am thinking can we use the Google new &lt;a href="https://blog.google/technology/ai/nano-banana-pro/"&gt;&lt;strong&gt;Nano Banana Pro&lt;/strong&gt;&lt;/a&gt; model as a &amp;ldquo;browser engine&amp;rdquo;? The goal was to see how it handles rendering a standard HTML page compared to a modern web browser.&lt;/p&gt;&#10;&lt;h2 id="the-setup"&gt;The Setup&lt;/h2&gt;&#10;&lt;p&gt;I asked ChatGPT 5.1 Thinking to create it with this prompt&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;Create a html for a mock business profile landing page &#10;about independently owned convenience store. It should&#10;be 1 file contain all the html js css&#10;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;It happily produce 1700 line length HTML page for it. You can view the &lt;a href="https://adhikasp.id/demos/nano-banana-pro-mock-page.html"&gt;full page here&lt;/a&gt;.&lt;/p&gt;&#10;&lt;h2 id="the-comparison"&gt;The Comparison&lt;/h2&gt;&#10;&lt;p&gt;I rendered the same HTML script on both the Nano Banana Pro and a standard real browser. Here are the results.&lt;/p&gt;&#10;&lt;h3 id="1-nano-banana-pro-output"&gt;1. Nano Banana Pro Output&lt;/h3&gt;&#10;&lt;p&gt;This is how the page looks when rendered by the Nano Banana Pro:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="https://adhikasp.id/images/nano-banana-pro-render.png" alt="Figure 1: Rendered result on Nano Banana Pro" loading="lazy" decoding="async"&gt;&lt;/p&gt;&#10;&lt;h3 id="2-real-browser-output"&gt;2. Real Browser Output&lt;/h3&gt;&#10;&lt;p&gt;For comparison, here is the same page rendered in a real browser:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="https://adhikasp.id/images/real-browser-render.png" alt="Figure 2: Rendered result on a Real Browser" loading="lazy" decoding="async"&gt;&lt;/p&gt;&#10;&lt;h2 id="observations"&gt;Observations&lt;/h2&gt;&#10;&lt;p&gt;The result is pretty interesting.&lt;/p&gt;&#10;&lt;p&gt;It got the broad layout correctly. The navbar, hero section that split between the main message and cards. The header content is correct.&lt;/p&gt;&#10;&lt;p&gt;Though finer detail is wrong. The logo and branded store name is diffferent, albeit I think it is much nicer IMO. Finer detail in button like telephone icon and arrow is missing. The background color is just hallucinated (again though, much nicer).&lt;/p&gt;&#10;&lt;p&gt;I guess using language model as browser engine obviously not an accurate rendering method right now. And with ~0.25 USD per image, also way way very expensive. But it is interesting that the Nano Banana Pro can produce pretty accurate and in some case improve the original layout!&lt;/p&gt;&#10;</content:encoded></item><item><title>Path of Exile Phrecia event builds</title><link>https://adhikasp.id/posts/2025/03/poe-phrecia/</link><pubDate>Sat, 01 Mar 2025 18:39:00 +0700</pubDate><guid>https://adhikasp.id/posts/2025/03/poe-phrecia/</guid><description>Path of Exile Legacy of Phrecia introduces all-new ascendancies. Mining the subreddit discussions to see which builds stand out in the event.</description><content:encoded>&lt;p&gt;Path of Exile &lt;a href="https://www.poewiki.net/wiki/Legacy_of_Phrecia"&gt;Legacy of Phrecia&lt;/a&gt; has been going on for some time, it introduce all new ascendancies so let&amp;rsquo;s see if what new build stands out.&lt;/p&gt;&#10;&lt;h2 id="finding-op-build-in-the-event"&gt;Finding OP build in the event&lt;/h2&gt;&#10;&lt;p&gt;The subreddit &lt;a href="https://www.reddit.com/r/PathOfExileBuilds"&gt;r/PathOfExileBuilds&lt;/a&gt; is a good place to start mining out information.&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;Sumarize OP and bait build combining all the discussions.&#10;&#10;for each reddit thread get all 400 comment with 4 depth&#10;&#10;- https://www.reddit.com/r/PathOfExileBuilds/comments/1iwudz7/its_been_3_days_review_your_league_event_starter/&#10;- https://www.reddit.com/r/PathOfExileBuilds/comments/1j0jry0/league_been_out_for_a_bit_now_opinions_on_biggest&#10;- https://www.reddit.com/r/PathOfExileBuilds/comments/1j0pe3t/starting_the_phracia_event_today_what_are_some/ &#10;- https://www.reddit.com/r/PathOfExileBuilds/comments/1ixao8j/successfull_starter_builds/&#10;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Saving it as &lt;code&gt;poe-op-build.txt&lt;/code&gt; and we can run it with &lt;code&gt;cat poe-op-build.txt | llm&lt;/code&gt;.&lt;/p&gt;&#10;&lt;p&gt;Here&amp;rsquo;s a summary of the discussions from the Reddit threads regarding OP and bait builds in the current Path of Exile league event, along with insights on successful starter builds:&lt;/p&gt;&#10;&lt;h3 id="1-general-observations-on-builds"&gt;1. &lt;strong&gt;General Observations on Builds&lt;/strong&gt;&lt;/h3&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;Power Siphon Mines Whisperer&lt;/strong&gt;: Highly praised for its smooth leveling and strong performance. Players noted its ability to clear maps effectively while maintaining good survivability due to stealth mechanics.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Volcanic Fissure of Snaking Ancestral Commander&lt;/strong&gt;: Recommended for its tankiness and ease of leveling. Players reported minimal deaths and smooth transitions into red maps.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Lightning Strike Blind Prophet&lt;/strong&gt;: While it has great clear speed, players noted it can feel squishy before acquiring key gear like Svalinn. It requires careful positioning to maximize damage output.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h3 id="2-common-issues-with-builds"&gt;2. &lt;strong&gt;Common Issues with Builds&lt;/strong&gt;&lt;/h3&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;Mana Stacking Builds&lt;/strong&gt;: Builds like MFA (Mana Forged Arrows) are often seen as bait unless players have significant currency to invest early. Many players reported struggles with survivability and damage output without proper gear.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Bait Builds&lt;/strong&gt;: Builds that require high investment to perform well (like certain mana stacking or complex builds) are often labeled as bait, especially for new players who may not have the resources to make them work effectively.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h3 id="3-successful-starter-builds"&gt;3. &lt;strong&gt;Successful Starter Builds&lt;/strong&gt;&lt;/h3&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;Earthshatter Ancestral Commander&lt;/strong&gt;: Noted for its strong defensive capabilities and ease of use. Players reported good performance in both mapping and bossing.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Flicker Strike Wildspeaker&lt;/strong&gt;: Players found it to be a strong choice for fast mapping, with good survivability when built correctly.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Cobra Lash Surfcaster&lt;/strong&gt;: This build has been highlighted for its fun playstyle and effectiveness in clearing content, especially when combined with the right gear.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h3 id="4-player-experiences"&gt;4. &lt;strong&gt;Player Experiences&lt;/strong&gt;&lt;/h3&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Many players shared their experiences with various builds, emphasizing the importance of gearing and the impact of specific ascendancies on performance.&lt;/li&gt;&#10;&lt;li&gt;Players transitioning from one build to another often found success by switching to builds that required less investment or had more straightforward mechanics.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h3 id="5-recommendations-for-new-players"&gt;5. &lt;strong&gt;Recommendations for New Players&lt;/strong&gt;&lt;/h3&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;Avoid Complex Builds&lt;/strong&gt;: New players are advised to steer clear of builds that require extensive knowledge of mechanics or high investment to be effective.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Focus on Simplicity&lt;/strong&gt;: Builds that offer straightforward gameplay and good scaling with minimal investment (like Power Siphon Mines or Volcanic Fissure) are recommended for a smoother experience.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h3 id="conclusion"&gt;Conclusion&lt;/h3&gt;&#10;&lt;p&gt;Overall, the discussions highlight a mix of successful builds and cautionary tales about the pitfalls of more complex or high-investment builds. Players are encouraged to choose builds that align with their playstyle and investment capacity, especially in the early stages of the league&lt;/p&gt;&#10;&lt;h2 id="power-siphon-build"&gt;Power Siphon build&lt;/h2&gt;&#10;&lt;p&gt;Here&amp;rsquo;s a detailed summary of the discussions related to &lt;strong&gt;Power Siphon&lt;/strong&gt; builds from the Reddit threads you provided:&lt;/p&gt;&#10;&lt;h3 id="1-power-siphon-mines"&gt;1. &lt;strong&gt;Power Siphon Mines&lt;/strong&gt;&lt;/h3&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;General Consensus&lt;/strong&gt;: The Power Siphon (PS) Mines build is highly regarded for its smooth leveling and strong performance in maps. Players have noted that it allows for a very safe playstyle, especially in early content.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Strengths&lt;/strong&gt;:&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;Stealth Mechanic&lt;/strong&gt;: The build benefits from a stealth mechanic that allows players to avoid damage by remaining undetected, making it easier to clear content without taking hits.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Clear Speed&lt;/strong&gt;: The ability to clear maps quickly and efficiently is a major highlight, with players reporting that they can handle T16 maps comfortably.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Low Investment&lt;/strong&gt;: Many players have noted that the build can perform well with minimal investment, making it accessible for new players.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Weaknesses&lt;/strong&gt;:&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;Single Target Damage&lt;/strong&gt;: Some players have expressed concerns about the single-target damage, especially against tougher bosses. It may require additional investment to scale effectively for endgame content.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Mine Mechanics&lt;/strong&gt;: There are some frustrations with mine mechanics, particularly regarding positioning and detonation timing. Players need to be mindful of throwing mines at the right distance to ensure they detonate effectively.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h3 id="2-general-feedback-on-builds"&gt;2. &lt;strong&gt;General Feedback on Builds&lt;/strong&gt;&lt;/h3&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;Comparison with Other Builds&lt;/strong&gt;: Players have compared PS Mines to other builds like Lightning Strike (LS) and General&amp;rsquo;s Cry (GC). While PS Mines are praised for their clear speed, some players find LS to be more straightforward and less reliant on positioning.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Transitioning Builds&lt;/strong&gt;: Many players have discussed transitioning from PS Mines to other builds as they progress, often citing the need for better single-target damage or survivability in tougher content.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h3 id="3-specific-comments-and-experiences"&gt;3. &lt;strong&gt;Specific Comments and Experiences&lt;/strong&gt;&lt;/h3&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;Player Experiences&lt;/strong&gt;:&#10;&lt;ul&gt;&#10;&lt;li&gt;One player mentioned that they had a smooth experience leveling with PS Mines and found it to be a great choice for the event.&lt;/li&gt;&#10;&lt;li&gt;Another player noted that they struggled with single-target damage and had to adjust their build to improve survivability.&lt;/li&gt;&#10;&lt;li&gt;A few players highlighted the importance of gearing and the need for specific items to maximize the build&amp;rsquo;s potential.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h3 id="4-build-recommendations"&gt;4. &lt;strong&gt;Build Recommendations&lt;/strong&gt;&lt;/h3&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;Recommended Builds&lt;/strong&gt;:&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;Power Siphon Mines&lt;/strong&gt;: Highly recommended for its smooth gameplay and effectiveness in maps.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Lightning Strike Blind Prophet&lt;/strong&gt;: Suggested as a strong alternative for players looking for a more straightforward build.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;General&amp;rsquo;s Cry Tectonic Slam&lt;/strong&gt;: Mentioned as a solid choice for players who want a tanky build with good damage output.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h3 id="conclusion-1"&gt;Conclusion&lt;/h3&gt;&#10;&lt;p&gt;The &lt;strong&gt;Power Siphon Mines&lt;/strong&gt; build is well-received for its clear speed and safety, making it a popular choice among players starting the event. However, players should be aware of its limitations in single-target damage and the intricacies of mine mechanics. Transitioning to other builds for endgame content is common, and players are encouraged to explore various options based on their playstyle preferences.&lt;/p&gt;&#10;</content:encoded></item><item><title>Tailscale for Residential IP Forward Proxy in Cloud</title><link>https://adhikasp.id/posts/tailscale-for-residential-ip-forward-proxy-in-cloud/</link><pubDate>Sat, 08 Feb 2025 21:34:39 +0700</pubDate><guid>https://adhikasp.id/posts/tailscale-for-residential-ip-forward-proxy-in-cloud/</guid><description>YouTube blocks the cloud IPs my chatbot runs on. Instead of a residential proxy, I used a Tailscale app connector to route only YouTube calls home.</description><content:encoded>&lt;p&gt;One of the features in &lt;a href="https://tanyagpt.my.id/"&gt;TanyaGPT&lt;/a&gt; is to &amp;ldquo;watch&amp;rdquo; a YouTube video and answer questions about it. It works by pulling the video transcript as part of the LLM inference.&lt;/p&gt;&#10;&lt;p&gt;The problem is, YouTube puts IP blocking on their public API, making the code work in my dev machine but not in the deployed production server that I have in fly.io. This is a common issue when using cloud providers, as their IP ranges are often blocked by services to prevent abuse.&lt;/p&gt;&#10;&lt;p&gt;There were some potential solutions for this:&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;The Python library I use, &lt;a href="https://github.com/jdepoix/youtube-transcript-api"&gt;youtube-transcript-api&lt;/a&gt; can be used with cookies. But I don&amp;rsquo;t want to risk using my personal Google account cookies. And creating new account for this is a hassle.&lt;/li&gt;&#10;&lt;li&gt;Buy a residential IP from a proxy service. But I don&amp;rsquo;t want to pay for it, when I only need it for a hobby project.&lt;/li&gt;&#10;&lt;li&gt;Use Tailscale to create a local network between my dev machine and the production server.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;I chose the third option since it is free and sounds fun to explore. This solution leverages &lt;a href="https://tailscale.com/"&gt;Tailscale&lt;/a&gt;, a zero-config VPN that makes it easy to create secure networks between devices.&lt;/p&gt;&#10;&lt;h2 id="the-architecture"&gt;The Architecture&lt;/h2&gt;&#10;&lt;pre class="mermaid"&gt;sequenceDiagram&#10; participant User as TanyaGPT User&#10; participant Cloud as Cloud Server&amp;lt;br/&amp;gt;(fly.io)&#10; participant Home as Dev Machine&amp;lt;br/&amp;gt;(Home IP)&#10; participant YT as YouTube API&#10;&#10; User-&amp;gt;&amp;gt;Cloud: Ask question about YouTube video&#10; Note over Cloud: Need YouTube&amp;lt;br/&amp;gt;transcript&#10; Cloud-&amp;gt;&amp;gt;Home: YouTube API Call&amp;lt;br/&amp;gt;via Tailscale Proxy&#10; Home-&amp;gt;&amp;gt;YT: API Request&amp;lt;br/&amp;gt;(with residential IP)&#10; YT--&amp;gt;&amp;gt;Home: API Response&#10; Home--&amp;gt;&amp;gt;Cloud: Proxy Response&#10; Cloud--&amp;gt;&amp;gt;User: Chatbot answer&#10; &lt;/pre&gt;&#10;&#10;&lt;h2 id="configuring-tailscale"&gt;Configuring Tailscale&lt;/h2&gt;&#10;&lt;p&gt;On my dev machine that has residential IP, I run the tailscale node. While Tailscale can advertise it as an &amp;ldquo;Exit node&amp;rdquo; to route all traffic, I only wanted to proxy YouTube-specific traffic. This is where Tailscale&amp;rsquo;s &lt;a href="https://tailscale.com/kb/1281/app-connectors"&gt;app connector&lt;/a&gt; feature comes in handy.&lt;/p&gt;&#10;&lt;p&gt;First, I created a new Tailscale app connector for YouTube:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="https://adhikasp.id/images/tailscale-app-connector.png" alt="Tailscale app connector" loading="lazy" decoding="async"&gt;&lt;/p&gt;&#10;&lt;p&gt;I add the api.ipify.org to the connector to test if the proxy is working, so I can do quick curl check and see my residential IP.&lt;/p&gt;&#10;&lt;p&gt;Then on the Tailscale ACL configuration I used:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;#34;groups&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;group:youtube-admins&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;my-email&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;},&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;#34;tagOwners&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;tag:youtube-app-connector&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;autogroup:members&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;],&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;},&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;#34;autoApprovers&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;routes&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;0.0.0.0/0&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;tag:youtube-app-connector&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;::/0&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;tag:youtube-app-connector&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;},&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;},&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;#34;nodeAttrs&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;target&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;*&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;app&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;tailscale.com/app-connectors&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;name&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;youtube&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;connectors&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;tag:youtube-app-connector&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;domains&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;youtube.com&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;*.youtube.com&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;api.ipify.org&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;},&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;],&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;},&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;},&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;]&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="setting-up-the-cloud-server"&gt;Setting Up the Cloud Server&lt;/h2&gt;&#10;&lt;p&gt;For the cloud server setup, I followed the &lt;a href="https://tailscale.com/kb/1132/flydotio"&gt;Tailscale on Fly.io&lt;/a&gt; docs with some modifications. The key steps were:&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;Adding Tailscale to the Dockerfile&lt;/li&gt;&#10;&lt;li&gt;Configuring the necessary environment variables as Fly.io secrets&lt;/li&gt;&#10;&lt;li&gt;Implementing an auto-reconnect mechanism&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;The auto-reconnect was necessary because Fly.io suspends machines during idle periods. Since the node is ephemeral, the Tailscale coordinator delete the machine from the network, causing the machine to unable to reconnect. It was something like this:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nd"&gt;@tool&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_youtube_transcript&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;video_url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;ENVIRONMENT&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;production&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;run&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;tailscale&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;down&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;run&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;tailscale&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;up&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;...&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="performance-and-limitations"&gt;Performance and Limitations&lt;/h2&gt;&#10;&lt;p&gt;While this solution works well for my use case, there are some considerations:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;There&amp;rsquo;s added latency due to the traffic routing through the home machine&lt;/li&gt;&#10;&lt;li&gt;The solution depends on the home machine being online&lt;/li&gt;&#10;&lt;li&gt;Periodic reconnections might cause brief service interruptions&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;All in all, it works reliably for my small-scale needs while keeping costs at zero.&lt;/p&gt;&#10;</content:encoded></item><item><title>Indonesia Postal Code</title><link>https://adhikasp.id/posts/indonesia-postal-code/</link><pubDate>Sun, 02 Feb 2025 00:12:17 +0700</pubDate><guid>https://adhikasp.id/posts/indonesia-postal-code/</guid><description>Inspired by a CGP Grey video, I plotted 83,761 Indonesian postal-code points to see how far the five-digit hierarchy holds outside Jakarta.</description><content:encoded>&lt;p&gt;Today, I watch a video from CGP Grey on postal code patterns.&lt;/p&gt;&#10;&lt;div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"&gt;&#10;&#9;&#9;&#9;&lt;iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen" loading="eager" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/1K5oDtVAYzk?autoplay=0&amp;amp;controls=1&amp;amp;end=0&amp;amp;loop=0&amp;amp;mute=0&amp;amp;start=0" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="YouTube video"&gt;&lt;/iframe&gt;&#10;&#9;&#9;&lt;/div&gt;&#10;&#10;&lt;p&gt;I was curious about the postal code pattern in Indonesia, so I decided to visualize it in &lt;a href="https://kodepos.adhikasp.my.id/"&gt;Kodepos&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="https://adhikasp.id/images/kodepos-1.png" alt="kodepos-1" loading="lazy" decoding="async"&gt;&lt;/p&gt;&#10;&lt;p&gt;I built it with help of &lt;a href="https://www.cursor.com/"&gt;Cursor&lt;/a&gt;. Lately I found it making producing code and exploring new ideas much more fun. As I can focus on what I want to do instead of how to do it and figuring out how to use this random Python library or trying to understand how pandas dataframe works.&lt;/p&gt;&#10;&lt;p&gt;Some interesting observations I had while reading the data is the postal code do have pattern of hierarchy, but still have its exceptions. The Wikipedia article for &lt;a href="https://id.wikipedia.org/wiki/Daftar_kode_pos_di_Indonesia"&gt;Postal Code in Indonesia&lt;/a&gt; mentioned that the postal code is divided into 5 levels:&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;First digit represents the postal office region code&lt;/li&gt;&#10;&lt;li&gt;Second digit represents the regency/city code&lt;/li&gt;&#10;&lt;li&gt;Third digit (also) represents the regency/city code&lt;/li&gt;&#10;&lt;li&gt;Fourth digit represents the district code within the regency/city&lt;/li&gt;&#10;&lt;li&gt;Fifth digit represents the village/subdistrict code&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;But those rule doesn&amp;rsquo;t apply for Jakarta capital region and its Bodetabek area.&lt;/p&gt;&#10;&lt;p&gt;Another interesting things is the granualarity and coverage of area. More populated area like Java island have more unique code count and each code cover smaller area.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="https://adhikasp.id/images/kodepos-java.png" alt="kodepos-java" loading="lazy" decoding="async"&gt;&lt;/p&gt;&#10;&lt;p&gt;In more sparse area like Sulawesi, the density is concentrated in cities and inland region is more spares.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="https://adhikasp.id/images/kodepos-sulawesi.png" alt="kodepos-sulawesi" loading="lazy" decoding="async"&gt;&lt;/p&gt;&#10;&lt;p&gt;The dataset is taken from &lt;a href="https://github.com/sooluh/kodepos"&gt;sooluh/kodepos&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;In total it has 83761 data point and 10671 unique postal code in Indonesia.&lt;/p&gt;&#10;&lt;p&gt;On average, an area is sharing its postal code with 7 different place.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="https://adhikasp.id/images/kodepos-distribution.png" alt="kodepos-distribution" loading="lazy" decoding="async"&gt;&lt;/p&gt;&#10;&lt;p&gt;Few more things that I want to explore:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Learning up statistics. Can I quantify the correlation between postal code distribution and population density?&lt;/li&gt;&#10;&lt;li&gt;Data visualization. Current map plotting is very basic, building a convex hull. Can I make it map directly with the city area and have more seamless blending when transitioning between different hierarchy level?&lt;/li&gt;&#10;&lt;/ul&gt;&#10;</content:encoded></item><item><title>Reviving Blog 2025</title><link>https://adhikasp.id/posts/reviving-blog-2025/</link><pubDate>Sat, 01 Feb 2025 20:38:06 +0700</pubDate><guid>https://adhikasp.id/posts/reviving-blog-2025/</guid><description>Every blog of mine died with its host. This one came back on GitHub Pages in two commits, after the homelab that served it died in a brownout.</description><content:encoded>&lt;p&gt;Feels like writting, so I dig into my GitHub repostory and refound this old blog of mine.&lt;/p&gt;&#10;&lt;p&gt;I have few different iteration of my blog.&lt;/p&gt;&#10;&lt;p&gt;The first one is a WordPress blog that was part of high school IT subject.&lt;/p&gt;&#10;&lt;p&gt;Then I think I create an static nginx based website, hosted on VPS.&lt;/p&gt;&#10;&lt;p&gt;And this one, a Hugo site originally hosted on my &lt;a href="https://adhikasp.my.id/posts/self-hosting-my-website-with-cloudflare-tunnel/"&gt;homelab&lt;/a&gt;. But my homelab die a few month ago after a brownout in my apartement. And I haven&amp;rsquo;t been bothered to revive all of the services.taken down along it.&lt;/p&gt;&#10;&lt;p&gt;Fortunately it very easy to make this blog works again. I decided to move it to GitHub Pages.&lt;/p&gt;&#10;&lt;p&gt;It consist of 2 commits:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://github.com/adhikasp/adhikasp.my.id/commit/2589fcda582d5dad2852740a4028bc7901729a3f"&gt;Add Hugo GitHub CI&lt;/a&gt;. There was some preset GitHub Actions that I can directly pick. With some minor modification to the hostname config part to use my own domain instead of the default &lt;code&gt;adhikasp.github.io&lt;/code&gt;.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://github.com/adhikasp/adhikasp.my.id/commit/eb74b233df660ec8ac9d60ad194266ed468ef6e4"&gt;Remove Disqus integration&lt;/a&gt;. IDK why I put it in the first place or why it works in past. Too lazy to figure out so I just remove it.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Hopefully this one will last longer.&lt;/p&gt;&#10;</content:encoded></item><item><title>Self hosting my websites with Cloudflare Tunnel</title><link>https://adhikasp.id/posts/self-hosting-my-website-with-cloudflare-tunnel/</link><pubDate>Sat, 07 Jan 2023 18:22:58 +0700</pubDate><guid>https://adhikasp.id/posts/self-hosting-my-website-with-cloudflare-tunnel/</guid><description>This site is served not from a cloud provider but from a consumer desktop from 2008 in my living room, through a Cloudflare Tunnel.</description><content:encoded>&lt;p&gt;This site is served not from cloud or hosting service, but from a crappy consumer-grade desktop from 2008 that I store in my living room, with a Cloudflare Tunnel.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="https://adhikasp.id/images/home-server.jpg" alt="my server image" loading="lazy" decoding="async"&gt;&lt;/p&gt;&#10;&lt;h2 id="why"&gt;Why?&lt;/h2&gt;&#10;&lt;p&gt;Because it is fun learning exercise.&lt;/p&gt;&#10;&lt;h2 id="about-the-server"&gt;About the server&lt;/h2&gt;&#10;&lt;p&gt;This is a Fujitsu Mini PC, running a state-of-the art &lt;a href="https://ark.intel.com/content/www/id/id/ark/products/33910/intel-core2-duo-processor-e8400-6m-cache-3-00-ghz-1333-mhz-fsb.html"&gt;core 2 duo processor E8400&lt;/a&gt; released just in 2008. It have 4GB RAM. The OS of choice is Ubuntu LTS 22.04. I upgrade it with old 128GB SSD that used to be on my gaming PC, to make the OS more snappy. I swap the 500GB spinning disk with brand new 4TB Barracuda disk as I want it to serve as media server too.&lt;/p&gt;&#10;&lt;p&gt;It is a humbling experience. I bought this &amp;ldquo;server&amp;rdquo; &lt;a href="https://tokopedia.link/kJC7o7BLpwb"&gt;for 875.000 IDR (or about 56 USD) from Tokopedia&lt;/a&gt; (warning, affiliate link :)). The 4TB disk &lt;a href="https://tokopedia.link/M9dvoMxMpwb"&gt;cost 1.443.000 IDR (~93 USD) from Tokopedia&lt;/a&gt;. In contrast, a typical &lt;code&gt;$CLOUD&lt;/code&gt; offering this kind of compute will cost you 5-20 USD per month. And the cloud storage is whopping 480 USD per month! This server able to hosts tens of docker containers, and it runs just fine. Well to be fair, it doesn&amp;rsquo;t see much traffic with the main &amp;ldquo;user&amp;rdquo; traffic come just from me and my wife usage. Also of course it don&amp;rsquo;t have DR feature builtin like backup or HA. But nonetheless, it is very interesting on how much I can cram to it.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;adhikasp@arjuna:~$ docker ps &lt;span class="p"&gt;|&lt;/span&gt; wc -l&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="m"&gt;33&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Beside, it is cheaper as I don&amp;rsquo;t need to rent a VPS. My electricity budget surely increase, not really visible though as I believe it is dwarved by other electronics in my home like AC unit and fridge.&lt;/p&gt;&#10;&lt;h2 id="the-difficult-part"&gt;The difficult part&lt;/h2&gt;&#10;&lt;p&gt;Self hosting can be tricky if you have ISP that use &lt;a href="https://en.wikipedia.org/wiki/Carrier-grade_NAT"&gt;CGNAT&lt;/a&gt;. It means you don&amp;rsquo;t have public IP assigned and there is no way for public traffic from internet to initiate access to you. They can still reply to you if you initiate the connection, like when you browse the internet. You can&amp;rsquo;t use &lt;a href="https://en.wikipedia.org/wiki/Dynamic_DNS"&gt;DDNS&lt;/a&gt; as the IP that get registered doesn&amp;rsquo;t belong to you exclusively.&lt;/p&gt;&#10;&lt;p&gt;There is atleast 2 workaround for this:&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;Have a publicly addressable VPS like from AWS or &lt;a href="https://m.2do.co/c/b8a84c179d20"&gt;DigitalOcean&lt;/a&gt;. Connect it to your home server with VPN tunnel like &lt;a href="https://tailscale.com/"&gt;Tailscale&lt;/a&gt;. Then route your HTTP traffic from the VPS into home server via the tunnel.&lt;/li&gt;&#10;&lt;li&gt;Use 3rd party SaaS that do (1) for you. Service like &lt;a href="https://ngrok.com/"&gt;Ngrok&lt;/a&gt; and &lt;a href="https://www.cloudflare.com/products/tunnel/"&gt;Cloudflare Tunnel&lt;/a&gt;.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;Ngrok free tier don&amp;rsquo;t provide ability to setup custom domain, I will stuck with something like &lt;a href="https://randomstringandnumber.ngrok.io"&gt;https://randomstringandnumber.ngrok.io&lt;/a&gt; as my domain, which is undesirable. On the otherhands Cloudflare free tier provide this, which is nice as I already use them for proxying my domain.&lt;/p&gt;&#10;&lt;h2 id="how-cloudflare-tunnel-works"&gt;How CloudFlare Tunnel works&lt;/h2&gt;&#10;&lt;p&gt;&lt;img src="https://adhikasp.id/images/cloudflared-tunnel.svg" alt="cloudflared tunnel" class="svg" width="928" height="457" loading="lazy" decoding="async"&gt;&lt;/p&gt;&#10;&lt;p&gt;The tunnel works by&amp;hellip; well tunnelling your traffic from Cloudflare into your private server directly. There is a &lt;code&gt;cloudflared&lt;/code&gt; daemon that need to be installed on server side that will manage this tunnel for you.&lt;/p&gt;&#10;&lt;p&gt;The installation is straightforward:&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;Go to your Cloudflare dashboard &lt;a href="https://one.dash.cloudflare.com"&gt;https://one.dash.cloudflare.com&lt;/a&gt;.&lt;/li&gt;&#10;&lt;li&gt;Go to tunnels configuration &lt;a href="https://one.dash.cloudflare.com/youraccountnumber/access/tunnels"&gt;https://one.dash.cloudflare.com/youraccountnumber/access/tunnels&lt;/a&gt;.&lt;/li&gt;&#10;&lt;li&gt;Create new tunnels.&lt;/li&gt;&#10;&lt;li&gt;Install the cloudflared with the provided instructions, it already have one liner that includes some kind of authentication keys for your specific tunnel.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;You then can configure mapping between public hostname with port in your server, this function similarly like nginx reverse proxy where your web application may not necessarly serving in port 80 or 443.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="https://adhikasp.id/images/tunnel-public-hostname.png" alt="tunnel mapping" loading="lazy" decoding="async"&gt;&lt;/p&gt;&#10;&lt;p&gt;In my case, as I already have Traefik in port 443 serving all my sites, I tell cloudflare to just forward all traffic to the same https://127.0.0.1:443 location.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="https://adhikasp.id/images/tunnel-hostname-forwarding.png" alt="tunnel-hostname-forwarding" loading="lazy" decoding="async"&gt;&lt;/p&gt;&#10;&lt;p&gt;I also need to tell Cloudflare to set the HTTP host header so the Traefik instances can properly route it.&lt;/p&gt;&#10;&lt;h2 id="limitation"&gt;Limitation&lt;/h2&gt;&#10;&lt;p&gt;I like the overall setup and experience. As of now (Jan 2023) there is no pricing attached to Cloudflare Tunnel, yet? The most recent announcement is that it is provided for free &lt;a href="https://blog.cloudflare.com/tunnel-for-everyone"&gt;https://blog.cloudflare.com/tunnel-for-everyone&lt;/a&gt;.&lt;/p&gt;&#10;</content:encoded></item><item><title>Exploring TimescaleDB</title><link>https://adhikasp.id/posts/timescaledb-exploration/</link><pubDate>Sun, 20 Feb 2022 18:22:58 +0700</pubDate><guid>https://adhikasp.id/posts/timescaledb-exploration/</guid><description>TimescaleDB vs MySQL and ScyllaDB for time series: one aggregation ran 6m52s on MySQL, 27s on raw TimescaleDB, 35ms on a continuous aggregate.</description><content:encoded>&lt;p&gt;This is a simple exploration of &lt;a href="https://www.timescale.com/"&gt;TimescaleDB&lt;/a&gt;, a time-series database.&lt;/p&gt;&#10;&lt;p&gt;See the code in &lt;a href="https://github.com/adhikasp/timescaledb-exploration"&gt;adhikasp/timescaledb-exploration&lt;/a&gt;.&lt;/p&gt;&#10;&lt;h2 id="comparison-between-databases"&gt;Comparison between databases&lt;/h2&gt;&#10;&lt;table&gt;&#10;&#9;&lt;thead&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Features&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;MySQL 5.7&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;MySQL 8.x&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;TimeScaleDB&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;ScyllaDB&lt;/th&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/thead&gt;&#10;&#9;&lt;tbody&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Atomic transaction&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Yes&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Yes&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Yes&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;No&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Instant alter&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;No&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Yes&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Yes&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Yes&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Background indexing&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;No&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;No&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Yes&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Yes&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Parallel scan query&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;No&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;No&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Yes&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Yes&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Data compaction&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;No&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;No&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Yes&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Yes&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Data TTL&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;No&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;No&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Yes&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Yes&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Analytics-like query&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;No&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;No&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Yes, continuous aggregate&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Yes, realtime query&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Multi node sharding&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;No&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;No&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Yes, with master node&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Yes, fully peer-to-peer&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Multiple indexes&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Yes&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Yes&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Yes&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Kinda, use GSI / materialized view&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;h2 id="query-time"&gt;Query time&lt;/h2&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sql" data-lang="sql"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;total_fee&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;count&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;transactions&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;WHERE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;merchant_id&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;merchant-1&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;table&gt;&#10;&#9;&lt;thead&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Database&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Time&lt;/th&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/thead&gt;&#10;&#9;&lt;tbody&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Mysql 8.0&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;6 min 52.35 sec&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;TimescaleDB (raw table query)&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;0 min 27 sec&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;TimescaleDB (continuous aggregate)&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;35 ms&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;h1 id="setup"&gt;Setup&lt;/h1&gt;&#10;&lt;p&gt;You must have this installed before hand.&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;sudo apt-get install -y postgresql-client&#10;pip3 install progressbar2 faker&#10;go get github.com/timescale/timescaledb-parallel-copy/cmd/timescaledb-parallel-copy&#10;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Starting postgresql with timescaledb extension&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;docker-compose up -d&#10;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Create table and populate data&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;./command.sh&#10;&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="1-million-dataset"&gt;1 million dataset&lt;/h1&gt;&#10;&lt;p&gt;CSV data generation 2:17&lt;br&gt;&#10;Insert 3:52&lt;/p&gt;&#10;&lt;p&gt;Raw data size 314MB&lt;br&gt;&#10;DB size 1.0GB&lt;br&gt;&#10;postgresql total size 2.1GB&lt;/p&gt;&#10;&lt;h1 id="10-million-dataset"&gt;10 million dataset&lt;/h1&gt;&#10;&lt;p&gt;CSV data generation 21:53&lt;br&gt;&#10;DB insert 06:50:47&lt;/p&gt;&#10;&lt;p&gt;Raw data size 3.1G&lt;br&gt;&#10;DB size 8.95GB&lt;br&gt;&#10;postgresql total size 10GB&lt;/p&gt;&#10;&lt;h1 id="10-million-dataset-2nd-run"&gt;10 million dataset 2nd run&lt;/h1&gt;&#10;&lt;p&gt;CSV data generation 22:15&lt;br&gt;&#10;DB Insert 3:28:49&lt;/p&gt;&#10;&lt;p&gt;Raw data size 3.1G&lt;br&gt;&#10;DB size 10.8G&lt;br&gt;&#10;postgresql total size 12G&lt;/p&gt;&#10;&lt;p&gt;798 ingestion / second&lt;/p&gt;&#10;&lt;h1 id="10-million-dataset-3rd-run"&gt;10 million dataset 3rd run&lt;/h1&gt;&#10;&lt;p&gt;Using timescaledb-parallel-copy&lt;/p&gt;&#10;&lt;p&gt;CSV data 12:00&lt;br&gt;&#10;DB Insert 26:24&lt;/p&gt;&#10;&lt;p&gt;Raw data size 3.1G&lt;br&gt;&#10;DB size 10.8G&lt;br&gt;&#10;postgresql total size 12G&lt;/p&gt;&#10;&lt;p&gt;6243.59/sec (overall)&lt;/p&gt;&#10;&lt;h1 id="10-million-dataset-4th-run"&gt;10 million dataset 4th run&lt;/h1&gt;&#10;&lt;p&gt;Using timescale managed db&lt;/p&gt;&#10;&lt;p&gt;DB insert 12:28&lt;br&gt;&#10;row rate 13291.66/sec (overall)&lt;/p&gt;&#10;&lt;h1 id="30-million-dataset"&gt;30 million dataset&lt;/h1&gt;&#10;&lt;p&gt;DB size 33.8G&lt;br&gt;&#10;DB insert 1:33:0&lt;br&gt;&#10;row rate 5368.28/sec (overall)&lt;/p&gt;&#10;&lt;h1 id="query-direct-hypertables-vs-continous-aggregate"&gt;Query direct hypertables vs continous aggregate&lt;/h1&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;exploration=# SELECT sum(total_fee), count(*) from transactions WHERE merchant_id = &amp;#39;merchant-1&amp;#39;;&#10; sum | count&#10;------------+---------&#10; 3634888528 | 7997931&#10;(1 row)&#10;&#10;Time: 27095.767 ms (00:27.096)&#10;exploration=# SELECT sum(total_fee), sum(transaction_count) from transactions_daily WHERE merchant_id = &amp;#39;merchant-1&amp;#39;;&#10; sum | sum&#10;------------+---------&#10; 3634888528 | 7997931&#10;(1 row)&#10;&#10;Time: 35.236 ms&#10;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id="query-plan"&gt;Query plan&lt;/h2&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;&#10; QUERY PLAN&#10;&#10;----------------------------------------------------------------------------------------------------------------------------------------------------------------&#10; Finalize Aggregate (cost=576147.59..576147.60 rows=1 width=16) (actual time=25809.234..25890.886 rows=1 loops=1)&#10; -&amp;gt; Gather (cost=576147.47..576147.58 rows=1 width=16) (actual time=25807.713..25890.863 rows=2 loops=1)&#10; Workers Planned: 1&#10; Workers Launched: 1&#10; -&amp;gt; Partial Aggregate (cost=575147.47..575147.48 rows=1 width=16) (actual time=25647.979..25647.988 rows=1 loops=2)&#10; -&amp;gt; Parallel Append (cost=0.00..551612.94 rows=4706906 width=4) (actual time=3387.836..25328.005 rows=3998966 loops=2)&#10; -&amp;gt; Parallel Seq Scan on _hyper_1_6_chunk (cost=0.00..41138.08 rows=367138 width=4) (actual time=3432.692..7069.980 rows=623089 loops=1)&#10; Filter: (merchant_id = &amp;#39;merchant-1&amp;#39;::text)&#10; Rows Removed by Filter: 155930&#10; -&amp;gt; Parallel Seq Scan on _hyper_1_7_chunk (cost=0.00..41111.36 rows=366399 width=4) (actual time=2.823..4066.629 rows=622395 loops=1)&#10; Filter: (merchant_id = &amp;#39;merchant-1&amp;#39;::text)&#10; Rows Removed by Filter: 156118&#10; -&amp;gt; Parallel Seq Scan on _hyper_1_10_chunk (cost=0.00..41100.82 rows=366554 width=4) (actual time=3.176..3555.384 rows=623210 loops=1)&#10; Filter: (merchant_id = &amp;#39;merchant-1&amp;#39;::text)&#10; Rows Removed by Filter: 155094&#10; -&amp;gt; Parallel Seq Scan on _hyper_1_8_chunk (cost=0.00..41099.74 rows=366774 width=4) (actual time=4.211..3651.592 rows=622577 loops=1)&#10; Filter: (merchant_id = &amp;#39;merchant-1&amp;#39;::text)&#10; Rows Removed by Filter: 155716&#10; -&amp;gt; Parallel Seq Scan on _hyper_1_11_chunk (cost=0.00..41084.60 rows=365761 width=4) (actual time=2.423..3705.161 rows=621761 loops=1)&#10; Filter: (merchant_id = &amp;#39;merchant-1&amp;#39;::text)&#10; Rows Removed by Filter: 156240&#10; -&amp;gt; Parallel Seq Scan on _hyper_1_4_chunk (cost=0.00..41084.55 rows=366835 width=4) (actual time=4.753..1680.699 rows=311234 loops=2)&#10; Filter: (merchant_id = &amp;#39;merchant-1&amp;#39;::text)&#10; Rows Removed by Filter: 77764&#10; -&amp;gt; Parallel Seq Scan on _hyper_1_9_chunk (cost=0.00..41075.29 rows=365885 width=4) (actual time=1.641..3825.738 rows=622025 loops=1)&#10; Filter: (merchant_id = &amp;#39;merchant-1&amp;#39;::text)&#10; Rows Removed by Filter: 155798&#10; -&amp;gt; Parallel Seq Scan on _hyper_1_5_chunk (cost=0.00..41055.49 rows=365629 width=4) (actual time=1.191..3863.313 rows=621332 loops=1)&#10; Filter: (merchant_id = &amp;#39;merchant-1&amp;#39;::text)&#10; Rows Removed by Filter: 156110&#10; -&amp;gt; Parallel Seq Scan on _hyper_1_1_chunk (cost=0.00..41050.95 rows=365555 width=4) (actual time=0.046..3474.942 rows=621695 loops=1)&#10; Filter: (merchant_id = &amp;#39;merchant-1&amp;#39;::text)&#10; Rows Removed by Filter: 155674&#10; -&amp;gt; Parallel Seq Scan on _hyper_1_3_chunk (cost=0.00..41039.31 rows=365954 width=4) (actual time=1.335..3160.270 rows=621807 loops=1)&#10; Filter: (merchant_id = &amp;#39;merchant-1&amp;#39;::text)&#10; Rows Removed by Filter: 155339&#10; -&amp;gt; Parallel Seq Scan on _hyper_1_13_chunk (cost=0.00..41011.42 rows=365985 width=4) (actual time=1.372..3259.743 rows=621492 loops=1)&#10; Filter: (merchant_id = &amp;#39;merchant-1&amp;#39;::text)&#10; Rows Removed by Filter: 155125&#10; -&amp;gt; Parallel Seq Scan on _hyper_1_2_chunk (cost=0.00..41011.41 rows=364513 width=4) (actual time=0.708..3329.581 rows=620973 loops=1)&#10; Filter: (merchant_id = &amp;#39;merchant-1&amp;#39;::text)&#10; Rows Removed by Filter: 155643&#10; -&amp;gt; Parallel Seq Scan on _hyper_1_12_chunk (cost=0.00..23502.49 rows=209699 width=4) (actual time=0.040..133.619 rows=356103 loops=1)&#10; Filter: (merchant_id = &amp;#39;merchant-1&amp;#39;::text)&#10; Rows Removed by Filter: 88956&#10; -&amp;gt; Parallel Seq Scan on _hyper_1_14_chunk (cost=0.00..11712.90 rows=104225 width=4) (actual time=3342.976..3405.834 rows=177004 loops=1)&#10; Filter: (merchant_id = &amp;#39;merchant-1&amp;#39;::text)&#10; Rows Removed by Filter: 44799&#10; Planning Time: 2.068 ms&#10; JIT:&#10; Functions: 118&#10; Options: Inlining true, Optimization true, Expressions true, Deforming true&#10; Timing: Generation 55.473 ms, Inlining 145.139 ms, Optimization 4045.574 ms, Emission 2584.786 ms, Total 6830.972 ms&#10; Execution Time: 25919.706 ms&#10;(54 rows)&#10;&#10;&#10;&#10;&#10; QUERY PLAN&#10;&#10;--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------&#10; Aggregate (cost=395.86..395.87 rows=1 width=64) (actual time=3.981..3.984 rows=1 loops=1)&#10; -&amp;gt; Append (cost=86.96..393.86 rows=398 width=16) (actual time=3.064..3.917 rows=460 loops=1)&#10; -&amp;gt; Subquery Scan on &amp;#34;*SELECT* 1&amp;#34; (cost=86.96..91.96 rows=200 width=16) (actual time=3.063..3.388 rows=455 loops=1)&#10; -&amp;gt; HashAggregate (cost=86.96..89.96 rows=200 width=115) (actual time=3.062..3.309 rows=455 loops=1)&#10; Group Key: _materialized_hypertable_2.merchant_id, _materialized_hypertable_2.store_id, _materialized_hypertable_2.bucket&#10; Batches: 1 Memory Usage: 1581kB&#10; -&amp;gt; Custom Scan (ChunkAppend) on _materialized_hypertable_2 (cost=0.28..81.27 rows=455 width=45) (actual time=0.041..1.165 rows=455 loops=1)&#10; Chunks excluded during startup: 0&#10; -&amp;gt; Index Scan using _hyper_2_15_chunk__materialized_hypertable_2_merchant_id_bucket on _hyper_2_15_chunk (cost=0.28..23.53 rows=130 width=45) (actual time=0.041..0.244 rows=130 loops=1)&#10; Index Cond: ((merchant_id = &amp;#39;merchant-1&amp;#39;::text) AND (bucket &amp;lt; COALESCE(_timescaledb_internal.to_timestamp_without_timezone(_timescaledb_internal.cagg_watermark(2)), &amp;#39;-infinity&amp;#39;::timestamp without time zone)))&#10; -&amp;gt; Index Scan using _hyper_2_16_chunk__materialized_hypertable_2_merchant_id_bucket on _hyper_2_16_chunk (cost=0.29..57.74 rows=325 width=45) (actual time=0.044..0.839 rows=325 loops=1)&#10; Index Cond: ((merchant_id = &amp;#39;merchant-1&amp;#39;::text) AND (bucket &amp;lt; COALESCE(_timescaledb_internal.to_timestamp_without_timezone(_timescaledb_internal.cagg_watermark(2)), &amp;#39;-infinity&amp;#39;::timestamp without time zone)))&#10; -&amp;gt; Subquery Scan on &amp;#34;*SELECT* 2&amp;#34; (cost=295.46..299.92 rows=198 width=16) (actual time=0.464..0.469 rows=5 loops=1)&#10; -&amp;gt; HashAggregate (cost=295.46..297.94 rows=198 width=115) (actual time=0.463..0.467 rows=5 loops=1)&#10; Group Key: transactions.merchant_id, transactions.store_id, time_bucket(&amp;#39;1 day&amp;#39;::interval, transactions.transaction_updated_time)&#10; Batches: 1 Memory Usage: 40kB&#10; -&amp;gt; Custom Scan (ChunkAppend) on transactions (cost=0.43..292.99 rows=198 width=31) (actual time=0.041..0.385 rows=112 loops=1)&#10; Chunks excluded during startup: 13&#10; -&amp;gt; Index Scan using _hyper_1_14_chunk_transactions_transaction_updated_time_idx on _hyper_1_14_chunk (cost=0.42..258.04 rows=185 width=31) (actual time=0.039..0.355 rows=112 loops=1)&#10; Index Cond: (transaction_updated_time &amp;gt;= COALESCE(_timescaledb_internal.to_timestamp_without_timezone(_timescaledb_internal.cagg_watermark(2)), &amp;#39;-infinity&amp;#39;::timestamp without time zone))&#10; Filter: (merchant_id = &amp;#39;merchant-1&amp;#39;::text)&#10; Rows Removed by Filter: 30&#10; Planning Time: 9.761 ms&#10; Execution Time: 4.956 ms&#10;(24 rows)&#10;&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="alter-table"&gt;Alter table&lt;/h1&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt; exploration=# ALTER TABLE transactions ADD COLUMN fee_10 int NULL;&#10;ALTER TABLE&#10;Time: 29.147 ms&#10;&#10;&#10;exploration=# DROP MATERIALIZED VIEW transactions_daily;&#10;NOTICE: drop cascades to 2 other objects&#10;DETAIL: drop cascades to table _timescaledb_internal._hyper_2_15_chunk&#10;drop cascades to table _timescaledb_internal._hyper_2_16_chunk&#10;DROP MATERIALIZED VIEW&#10;Time: 75.336 ms&#10;&#10;exploration=# CREATE MATERIALIZED VIEW transactions_daily&#10;WITH (timescaledb.continuous)&#10;AS&#10;SELECT&#10; time_bucket(&amp;#39;1 day&amp;#39;, transaction_updated_time) as bucket,&#10; merchant_id,&#10; store_id,&#10;&#10; sum(fee_1) as fee_1,&#10; sum(fee_2) as fee_2,&#10; sum(fee_3) as fee_3,&#10; sum(fee_4) as fee_4,&#10; sum(fee_5) as fee_5,&#10; sum(fee_6) as fee_6,&#10; sum(fee_7) as fee_7,&#10; sum(fee_8) as fee_8,&#10; sum(fee_9) as fee_9,&#10; sum(fee_10) as fee_10,&#10; sum(total_fee) as total_fee,&#10;&#10; count(*) as transaction_count&#10;FROM&#10; transactions&#10;GROUP BY merchant_id, store_id, bucket&#10;WITH NO DATA;&#10;CREATE MATERIALIZED VIEW&#10;Time: 88.822 ms&#10;&#10;&#10;exploration=# CALL refresh_continuous_aggregate(&amp;#39;transactions_daily&amp;#39;, NULL, NULL);&#10;&#10;CALL&#10;Time: 71074.520 ms (01:11.075)&#10;&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="compare"&gt;Compare&lt;/h1&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;exploration=# select avg(total_fee) from transactions;&#10; avg&#10;----------------------&#10; 454.5304017000000000&#10;(1 row)&#10;Time: 38492.480 ms (00:38.492)&#10;&#10;exploration=# select sum(total_fee)/sum(transaction_count) from transactions_daily;&#10; ?column?&#10;----------------------&#10; 454.5304017000000000&#10;(1 row)&#10;Time: 169.747 ms&#10;&#10;exploration=# select count(*) from transactions;&#10; count&#10;----------&#10; 10000000&#10;(1 row)&#10;Time: 14364.812 ms (00:14.365)&#10;&#10;exploration=# select count(*) from transactions_daily;&#10; count&#10;-------&#10; 6368&#10;(1 row)&#10;Time: 88.880 ms&#10;&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="compression"&gt;Compression&lt;/h1&gt;&#10;&lt;p&gt;Before&#10;3 month uncompressed =&amp;gt; 10GB&lt;/p&gt;&#10;&lt;p&gt;After&#10;1 month uncompressed + 2 month compressed =&amp;gt; 5GB&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;exploration=# SELECT * FROM transactions WHERE transaction_id = &amp;#39;7757fd62-8bfe-11ec-ab4b-63d923f6a2a2&amp;#39; and transaction_updated_time &amp;gt; now() - interval &amp;#39;14 day&amp;#39;;&#10;&#10;exploration=# SELECT * FROM transactions WHERE transaction_id = &amp;#39;7757fd62-8bfe-11ec-ab4b-63d923f6a2a2&amp;#39;;&#10;Time: 513.461 ms&#10;&#10;exploration=# SELECT * FROM transactions WHERE transaction_id = &amp;#39;65cb27e0-8bfd-11ec-ab4b-63d923f6a2a2&amp;#39;;&#10;Time: 383.735 ms&#10;&#10;exploration=# SELECT sum(fee_1) FROM transactions WHERE transaction_updated_time &amp;lt; now() - interval &amp;#39;2 month&amp;#39;;&#10; sum&#10;-----------&#10; 158311810&#10;(1 row)&#10;&#10;Time: 877.993 ms&#10;exploration=# SELECT sum(fee_1) FROM transactions WHERE transaction_updated_time &amp;gt; now() - inte&#10;rval &amp;#39;1 month&amp;#39;;&#10; sum&#10;-----------&#10; 172811617&#10;(1 row)&#10;&#10;Time: 18492.094 ms (00:18.492)&#10;&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="analyze-visual"&gt;Analyze visual&lt;/h1&gt;&#10;&lt;p&gt;psql -U postgres -h localhost -p 5433 -d exploration -qAt -c &amp;ldquo;EXPLAIN (ANALYZE, COSTS, VERBOSE, BUFFERS, FORMAT JSON) SELECT store_id, sum(total_fee) FROM transactions WHERE merchant_id = &amp;lsquo;merchant-2&amp;rsquo; AND transaction_updated_time &amp;gt; NOW() - INTERVAL &amp;lsquo;1 month&amp;rsquo; GROUP BY store_id;&amp;rdquo;&lt;/p&gt;&#10;&lt;p&gt;psql -U postgres -h localhost -p 5433 -d exploration -qAt -c &amp;ldquo;EXPLAIN (ANALYZE, COSTS, VERBOSE, BUFFERS, FORMAT JSON) SELECT store_id, sum(total_fee) FROM transactions_daily WHERE merchant_id = &amp;lsquo;merchant-2&amp;rsquo; AND bucket &amp;gt; NOW() - INTERVAL &amp;lsquo;1 month&amp;rsquo; GROUP BY store_id;&amp;rdquo;&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="http://tatiyants.com/pev/#/plans/new"&gt;http://tatiyants.com/pev/#/plans/new&lt;/a&gt;&lt;/p&gt;&#10;&lt;h1 id="creating-new-aggregate"&gt;Creating new aggregate&lt;/h1&gt;&#10;&lt;p&gt;30 million data&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;exploration=# CREATE MATERIALIZED VIEW transactions_weekly_avg&#10;WITH (timescaledb.continuous)&#10;AS&#10;SELECT&#10; time_bucket(&amp;#39;7 day&amp;#39;, transaction_updated_time) as bucket,&#10; merchant_id,&#10; store_id,&#10;&#10; avg(total_fee) as total_fee&#10;FROM&#10; transactions&#10;GROUP BY merchant_id, store_id, bucket&#10;WITH DATA;&#10;NOTICE: refreshing continuous aggregate &amp;#34;transactions_weekly_avg&amp;#34;&#10;HINT: Use WITH NO DATA if you do not want to refresh the continuous aggregate on creation.&#10;CREATE MATERIALIZED VIEW&#10;Time: 261120.502 ms (04:21.121)&#10;&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="update-query"&gt;Update query&lt;/h1&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;exploration=# UPDATE transactions SET transaction_updated_time = now() WHERE transaction_id = &amp;#39;d7dd00ea-8c43-11ec-ab4b-63d923f6a2a2&amp;#39; AND transaction_updated_time &amp;gt; &amp;#39;2022-02-01&amp;#39;;&#10;ERROR: new row for relation &amp;#34;_hyper_1_16_chunk&amp;#34; violates check constraint &amp;#34;constraint_16&amp;#34;&#10;DETAIL: Failing row contains (2022-02-13 02:58:32.388652, 2022-02-20 19:02:57.249809, 25200, d7dd00ea-8c43-11ec-ab4b-63d923f6a2a2, d7dd00eb-8c43-11ec-ab4b-63d923f6a2a2, d7dd00ec-8c43-11ec-ab4b-63d923f6a2a2, d7dd00ed-8c43-11ec-ab4b-63d923f6a2a2, d7dd00ee-8c43-11ec-ab4b-63d923f6a2a2, d7dd00ef-8c43-11ec-ab4b-63d923f6a2a2, merchant-1, store-1, 1, 1, 1, 2, 1, 4, 62, 80, 41, 73, 100, 43, 84, 39, 526).&#10;Time: 26.056 ms&#10;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;a href="https://adhikasp.id/posts/timescaledb-exploration/"&gt;Read the rest →&lt;/a&gt;&lt;/p&gt;</content:encoded></item><item><title>Hello World</title><link>https://adhikasp.id/posts/hello-world/</link><pubDate>Sun, 26 Dec 2021 19:44:14 +0700</pubDate><guid>https://adhikasp.id/posts/hello-world/</guid><description>Just test driving this blog.</description><content:encoded>&lt;p&gt;Just test driving this blog.&lt;/p&gt;&#10;</content:encoded></item><item><title>GSOC Phase 3 - Polishing aspect feature</title><link>https://adhikasp.id/posts/gsoc/gsoc-phase-3-polishing-aspect-feature/</link><pubDate>Tue, 25 Jul 2017 00:00:00 +0700</pubDate><guid>https://adhikasp.id/posts/gsoc/gsoc-phase-3-polishing-aspect-feature/</guid><description>Polishing coala's aspect feature so it is sane to use: making the migration path easier for the bears that do not support aspects yet.</description><content:encoded>&lt;p&gt;This post is part of my GSOC journey in coala.&lt;/p&gt;&#10;&lt;p&gt;Because aspect is still new and experimental, many things around it is still&#10;untested. Also, not all bear in coala (read: none of them) support aspect.&#10;And it will be a long time before it happen. So I think it&amp;rsquo;s important&#10;to make the migration process became more easy.&lt;/p&gt;&#10;&lt;p&gt;In this phase, I try to polish up feature so hopefully it will became more&#10;sane to be used. Of course there are still many missing things that I don&amp;rsquo;t&#10;think of now, but hopefully I can catch them and add follow up patches. The&#10;polishing up could be separated to users perspective and developer perspective:&lt;/p&gt;&#10;&lt;h2 id="users-perspective"&gt;User&amp;rsquo;s perspective&lt;/h2&gt;&#10;&lt;h3 id="warn-unfulfilled-aspect"&gt;Warn unfulfilled aspect&lt;/h3&gt;&#10;&lt;p&gt;As mentioned before, aspect ready bear is still a rare species compared to&#10;number of aspect definition in coala. This make it very possible to request an&#10;aspect that doesn&amp;rsquo;t have any bear that support it. We need to warn user if this&#10;happen.&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://github.com/coala/coala/pull/4657"&gt;https://github.com/coala/coala/pull/4657&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;Funny fact I just learn that &lt;a href="http://book.pythontips.com/en/latest/for_-_else.html"&gt;&lt;code&gt;for...else&lt;/code&gt; syntax&lt;/a&gt;&#10;is a thing!&lt;/p&gt;&#10;&lt;h3 id="logs-various-message"&gt;Logs Various Message&lt;/h3&gt;&#10;&lt;p&gt;Make sure users is informed what happen (if something goes wrong). Cases like&#10;setting &lt;code&gt;bears&lt;/code&gt; and &lt;code&gt;aspects&lt;/code&gt; setting at the same time will ignore the &lt;code&gt;bears&lt;/code&gt;&#10;setting and missing or invalid &lt;code&gt;language&lt;/code&gt; setting should throw a warning logs.&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://github.com/coala/coala/pull/4582"&gt;https://github.com/coala/coala/pull/4582&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;I also use this opportunity to refactor the verification code into its own&#10;function instead of separated into various function in order to make it more&#10;easier to read (hopefully).&lt;/p&gt;&#10;&lt;h3 id="write-docs-on-configuring-coala-with-aspect"&gt;Write Docs on Configuring coala With Aspect&lt;/h3&gt;&#10;&lt;p&gt;I write a help page on how to configure aspect and list of required setting.&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://github.com/coala/documentation/pull/462"&gt;https://github.com/coala/documentation/pull/462&lt;/a&gt;&lt;/p&gt;&#10;&lt;h3 id="create-example-project-that-showcase-it-all"&gt;Create Example Project that Showcase it All&lt;/h3&gt;&#10;&lt;p&gt;Showcase aspect in progress, best tutorial is a live project!&lt;/p&gt;&#10;&lt;p&gt;WIP, should be possible after all PR is merged&lt;/p&gt;&#10;&lt;h2 id="developer-perspective"&gt;Developer perspective&lt;/h2&gt;&#10;&lt;h3 id="write-docs-on-bears-aspectization"&gt;Write Docs on Bear&amp;rsquo;s Aspectization&lt;/h3&gt;&#10;&lt;p&gt;A docs containing example of a aspectized bear&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://github.com/coala/coala/pull/4666"&gt;https://github.com/coala/coala/pull/4666&lt;/a&gt;&lt;/p&gt;&#10;&lt;h3 id="create-mapping-from-bears-setting-to-aspecttaste-equivalent"&gt;Create Mapping from Bear&amp;rsquo;s Setting to Aspect/Taste Equivalent&lt;/h3&gt;&#10;&lt;p&gt;This is a bit of quality-of-life feature but still pretty important to make&#10;sure bear got aspectized easily. This will map a bear setting with aspect.&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://github.com/coala/coala/pull/4662"&gt;https://github.com/coala/coala/pull/4662&lt;/a&gt;&lt;/p&gt;&#10;&lt;h3 id="integration-test"&gt;Integration Test&lt;/h3&gt;&#10;&lt;p&gt;In here I write a test that run &lt;code&gt;coala&lt;/code&gt; with aspect configuration to make sure&#10;everything work correctly.&lt;/p&gt;&#10;&lt;p&gt;In coala/coala itself, I write an end-to-end test that call &lt;code&gt;coala&lt;/code&gt; cli to run&#10;with aspect. The purpose is to make sure every component related to aspect&#10;atleast can run without error.&lt;/p&gt;&#10;&lt;p&gt;The second part is to create a showcase project like from the user perspective.&#10;Ideally it could automatically update along with coala.&lt;/p&gt;&#10;</content:encoded></item><item><title>GSOC Phase 2 - Working MVP Coala Aspect</title><link>https://adhikasp.id/posts/gsoc/gsoc-phase-2-working-minimal-coala-aspect/</link><pubDate>Fri, 21 Jul 2017 00:00:00 +0700</pubDate><guid>https://adhikasp.id/posts/gsoc/gsoc-phase-2-working-minimal-coala-aspect/</guid><description>In phase 2 my target is to make aspect-based configuration work: not its full power yet, but enough foundation in coala to prove that an aspect can run.</description><content:encoded>&lt;p&gt;This post is part of my GSOC journey in coala.&lt;/p&gt;&#10;&lt;p&gt;In phase 2, my target is to make aspect-based configuration &lt;em&gt;works&lt;/em&gt;. Maybe not&#10;with its full power and capabilities, but at least the core foundation must&#10;ready in coala codebase and prove that aspect could run.&lt;/p&gt;&#10;&lt;p&gt;Starting from my previous phase, I have 3 crucial milestone to reach, which&#10;is:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Intepret aspect-based configuration&lt;/li&gt;&#10;&lt;li&gt;Passing aspects into bear&lt;/li&gt;&#10;&lt;li&gt;Choosing bear based on aspects&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Even though the todo is short, I meet with miscellaneous supporting works,&#10;few surprising but interesting &amp;ldquo;bugs&amp;rdquo;, and design decisions. And for concrete&#10;proof, I make a repository that contain an example project that could be run&#10;with &lt;code&gt;.coafile&lt;/code&gt; with aspect based configuration. You can see it in&#10;&lt;a href="https://github.com/adhikasp/demo-aspect/"&gt;adhikasp/demo-aspect&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;Ok then&amp;hellip; let&amp;rsquo;s move to the code.&lt;/p&gt;&#10;&lt;h2 id="intepret-aspect-based-configuration"&gt;Intepret aspect-based configuration&lt;/h2&gt;&#10;&lt;p&gt;For coala to collect the right bears and pass meaningfull data into each bears,&#10;it need to correctly intepret aspect related configuration. Aspect configuration&#10;is special (and also give some headache too) because it is written in&#10;&lt;code&gt;.coafile&lt;/code&gt;, like other setting, but they must be preprocessed first before it is&#10;ready to be used/read.&lt;/p&gt;&#10;&lt;h3 id="aspectbase-recursively-instance-aspect-children"&gt;aspectbase: Recursively instance aspect children&lt;/h3&gt;&#10;&lt;p&gt;&lt;a href="https://github.com/coala/coala/pull/4427"&gt;https://github.com/coala/coala/pull/4427&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;First thing to do is to fix unintended behaviour in aspect instantiation.&#10;The old behaviour is when we instance some leaf aspects, the child is not&#10;instanced. This is problematic because in bears, we want to access leaf aspect&#10;and its taste but &lt;code&gt;.coafile&lt;/code&gt; configuration could define a arbitrary node&#10;aspects. The result is we can&amp;rsquo;t access leaf aspects that have custom taste&#10;because it was never instanced in the first place and the information from&#10;&lt;code&gt;.coafile&lt;/code&gt; doesn&amp;rsquo;t have place to be stored.&lt;/p&gt;&#10;&lt;p&gt;The solution is to recursively instance aspect and all of its children. Also,&#10;we pass the &lt;code&gt;**taste_values&lt;/code&gt; too so a single aspect instantiation could set&#10;taste for all of its hierarchy.&lt;/p&gt;&#10;&lt;p&gt;Here is the code&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;aspectbase&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="fm"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;language&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;taste_values&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;...&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# Recursively instance its subaspects too&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;instanced_child&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;child&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;subaspects&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;instanced_child&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;child&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;language&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;taste_values&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="vm"&gt;__dict__&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;subaspects&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;instanced_child&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Pretty straight forward. Every aspects will read &lt;code&gt;**taste_value&lt;/code&gt; dict and just&#10;take whatever value they need, so there is no harm to pass it down the tree.&#10;This make declaring aspects and then set a custom taste for one of its children&#10;aspects in &lt;code&gt;.coafile&lt;/code&gt; became possible. We overwrite the &lt;code&gt;.subaspects&lt;/code&gt; with dict&#10;full of instanced child so we can access them later.&lt;/p&gt;&#10;&lt;p&gt;There is a (positive) side effect of this change. The &lt;code&gt;get_subaspect()&lt;/code&gt;&#10;function which I wrote in&#10;&lt;a href="https://github.com/coala/coala/pull/4412"&gt;my previous PR&lt;/a&gt; could behave&#10;correctly :D&lt;/p&gt;&#10;&lt;h3 id="aspectlist-add-exclude-attribute"&gt;AspectList: Add &lt;code&gt;exclude&lt;/code&gt; attribute&lt;/h3&gt;&#10;&lt;p&gt;&lt;a href="https://github.com/coala/coala/pull/4439"&gt;https://github.com/coala/coala/pull/4439&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;Next step is extending AspectList have a &lt;code&gt;exclude&lt;/code&gt; property that hold a list&#10;of aspects that was &amp;ldquo;excluded&amp;rdquo; from the AspectList itself. The main idea is&#10;to make users could make exception on what aspects they want to run in&#10;&lt;code&gt;.coafile&lt;/code&gt;.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;AspectList&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="fm"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;seq&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;exclude&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;None&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;super&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="fm"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;item&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;isaspect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;coalib&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bearlib&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;aspects&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;seq&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;exclude&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;AspectList&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;exclude&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;exclude&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="fm"&gt;__contains__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;aspect&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;issubaspect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;aspect&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# Make sure it&amp;#39;s not excluded&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;aspect&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;exclude&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;False&lt;/span&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;aspect&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;...&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# Make sure it&amp;#39;s not excluded&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;aspect&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;exclude&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Again, not a complicated code, but this one is pretty tricky because it change&#10;how other function must behave, which is &lt;code&gt;__contains__()&lt;/code&gt; and &lt;code&gt;get()&lt;/code&gt; function.&#10;We must make sure treat anything that was listed in &lt;code&gt;exclude&lt;/code&gt; like it was not&#10;contained in AspectList at all.&lt;/p&gt;&#10;&lt;p&gt;With &lt;code&gt;exclude&lt;/code&gt;, we provide a nice API for coala to store list of excluded&#10;aspects in configuration.&lt;/p&gt;&#10;&lt;h3 id="extract-aspects-from-configuration"&gt;Extract aspects from configuration&lt;/h3&gt;&#10;&lt;p&gt;&lt;a href="https://github.com/coala/coala/pull/4397/commits/1ce4dd96a30c2acb913fb9a9f05cfc7dcac87c0f"&gt;https://github.com/coala/coala/pull/4397/commits/1ce4dd96a30c2acb913fb9a9f05cfc7dcac87c0f&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;Actually this is part of next section PR but with how I write this article it&#10;make more sense to write it in this section :/&lt;/p&gt;&#10;&lt;p&gt;So in this phase coala&amp;rsquo;s aspect have complete API to store aspects into&#10;AspectList. Now its time to extract the information from &lt;code&gt;.coafile&lt;/code&gt; into the&#10;AspectList itself.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;extract_aspects_from_section&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;section&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;&amp;#34;&amp;#34;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; Extracts aspects and their related settings from a section and create an&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; AspectList from it.&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; :param section: Section object.&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; :return: AspectList containing aspectclass instance with&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; user-defined tastes.&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; &amp;#34;&amp;#34;&amp;#34;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# Get section data from configuration&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;aspects&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;section&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;aspects&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;language&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;section&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;language&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# Skip aspects initialization if not configured in section&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;aspects&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;language&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="ne"&gt;AttributeError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Language was not found in configuration file. &amp;#39;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;Usage of aspect-based configuration must &amp;#39;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;include language information.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;aspect_instances&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;AspectList&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;exclude&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;section&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;excludes&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;aspect&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;AspectList&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;aspects&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# Search all related tastes in section.&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;tastes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;.&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;section&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;contents&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;startswith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;aspect&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="vm"&gt;__name__&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;())}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;aspect_instances&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;aspect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;language&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;tastes&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;aspect_instances&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;With &lt;code&gt;extract_aspects_from_sections()&lt;/code&gt; function, we can get data we need&#10;to choose the right bears and make aspectized bear do their work correctly :+1:&lt;/p&gt;&#10;&lt;h2 id="passing-aspects-into-bear"&gt;Passing aspects into bear&lt;/h2&gt;&#10;&lt;h3 id="passing-the-data"&gt;Passing the data&lt;/h3&gt;&#10;&lt;p&gt;&lt;a href="https://github.com/coala/coala/pull/4397/commits/1ce4dd96a30c2acb913fb9a9f05cfc7dcac87c0f"&gt;https://github.com/coala/coala/pull/4397/commits/1ce4dd96a30c2acb913fb9a9f05cfc7dcac87c0f&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;Still from the same commit as before. We want to pass all of those precious data&#10;extracted from section so it can be used by bears.&lt;/p&gt;&#10;&lt;p&gt;It was pretty complicated.&lt;/p&gt;&#10;&lt;p&gt;My first attempt is to call &lt;code&gt;extract_aspects_from_sections()&lt;/code&gt; in&#10;gather_configuration phase, and then change those function return value and&#10;other chained function until it was passed into function who responsible to&#10;instance and execute the bear.&lt;/p&gt;&#10;&lt;p&gt;Aaaand it was bad because it became to complicated and breaking API, which is&#10;&lt;em&gt;very bad&lt;/em&gt; because it will make coala-quickstart broke. The main cause of API&#10;breaking is because I change some key function return format, which mainly use&#10;tuple. So a function who return 2 tuples will return 3 now.&lt;/p&gt;&#10;&lt;p&gt;After discussion with my mentors, we decide to embed the aspects information&#10;into &lt;code&gt;Section&lt;/code&gt; class as a new instance attribute. This is a very simple&#10;approach and still have room for further improvement if needed.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;aspectize_sections&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sections&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;&amp;#34;&amp;#34;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; Search for aspects related setting in a section, initialize it, and then&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; embed the aspects information as AspectList object into the section itself.&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; :param sections: List of section that potentially contain aspects setting.&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; :return: The new sections.&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; &amp;#34;&amp;#34;&amp;#34;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;section&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;sections&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;section&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;aspects&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;extract_aspects_from_section&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;section&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;sections&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I was pretty amazed. What was originally a ~30 lines patch in many different&#10;functions and files became 11 lines function, which is a good news.&lt;/p&gt;&#10;&lt;p&gt;Now bears can access the aspects like this&lt;/p&gt;&#10;&lt;p&gt;&lt;code&gt;.coafile&lt;/code&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="https://adhikasp.id/posts/gsoc/gsoc-phase-2-working-minimal-coala-aspect/"&gt;Read the rest →&lt;/a&gt;&lt;/p&gt;</content:encoded></item><item><title>GSOC Phase 1 Mid - Automatic star import expanding on autoflake</title><link>https://adhikasp.id/posts/gsoc/gsoc-phase-1-mid-automatic-star-import-expanding-on-autoflake/</link><pubDate>Sun, 18 Jun 2017 00:00:00 +0700</pubDate><guid>https://adhikasp.id/posts/gsoc/gsoc-phase-1-mid-automatic-star-import-expanding-on-autoflake/</guid><description>A patch to autoflake that expands a wildcard import into the names the code actually uses, and what that buys coala's aspects.</description><content:encoded>&lt;p&gt;This post is part of my GSOC journey in coala.&lt;/p&gt;&#10;&lt;p&gt;In this week, I was &lt;a href="https://github.com/myint/autoflake/pull/18"&gt;writting a patch&lt;/a&gt;&#10;into &lt;a href="https://github.com/myint/autoflake"&gt;autoflake&lt;/a&gt; for a new feature that&#10;could expand a wildcard import to specify each name that really was used in the&#10;code.&lt;/p&gt;&#10;&lt;h2 id="autoflake-and-how-it-work"&gt;Autoflake and how it work&lt;/h2&gt;&#10;&lt;p&gt;Short introduction. Autoflake is a tool for automatically remove unused imports,&#10;unused variables, and useless pass statemant from Python code. It was mainly&#10;dependent on &lt;a href="http://pypi.python.org/pypi/pyflakes"&gt;pyflakes&lt;/a&gt;, a python code&#10;checker, which provide the analysis foundation to check for the faulty code.&#10;Autoflake itself just handle the code manipulation part based on pyflakes&#10;report and actually remove those.&lt;/p&gt;&#10;&lt;p&gt;For example, a code like this&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;math&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;re&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The &lt;code&gt;import re&lt;/code&gt; statement will be removed because it was detected as unused.&lt;/p&gt;&#10;&lt;p&gt;Here are a simplified version on the step autoflake take when examining a code:&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;Send the file content to be analyzed by pyflakes via its API.&lt;/li&gt;&#10;&lt;li&gt;Read the result and filter it according to message type. Pyflakes can detect&#10;many type of error, but autoflake only care about few specific error which&#10;is &lt;code&gt;pyflakes.messages.UnusedImport&lt;/code&gt; and &lt;code&gt;pyflakes.messages.UnusedVariable&lt;/code&gt;.&#10;We save the line number of each error finding for further usage.&lt;/li&gt;&#10;&lt;li&gt;Iterate the lines of file. For each line, we check if the line have any&#10;error that was found in step 2 before.&lt;/li&gt;&#10;&lt;li&gt;Each type of error (marked by its corresponding pyflakes message type in&#10;step 2) will be handled by different function that could fix it. Regex is&#10;used for the string manipulation. The function will return a modified line,&#10;empty line, or a &lt;code&gt;pass&lt;/code&gt; statement.&lt;/li&gt;&#10;&lt;li&gt;Repeat step 1-4 until pyflakes doesn&amp;rsquo;t find error. This iteration process&#10;is used because autoflake is not directly &amp;ldquo;remove&amp;rdquo; a variable or import,&#10;instead, it will swap it with &lt;code&gt;pass&lt;/code&gt; statement to avoid a case like empty&#10;block (&lt;code&gt;if&lt;/code&gt;, &lt;code&gt;class&lt;/code&gt; declaration, etc). The next iteration then will check&#10;if some of the useless &lt;code&gt;pass&lt;/code&gt; statement could be safely removed.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;Automatic code manipulation like autoflake is a sensitive thing and a mistake&#10;on its algorithm could result make a fine, albeit dirty code into a completly&#10;broken code. Which is why autoflake have few different test kit to make sure&#10;it was working correctly.&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://github.com/myint/autoflake/blob/master/test_autoflake.py"&gt;&lt;code&gt;test_autoflake.py&lt;/code&gt;&lt;/a&gt; -&#10;unit test that check each function in autoflake. This make sure that every&#10;function is working correctly.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://github.com/myint/autoflake/blob/master/test_fuzz.py"&gt;&lt;code&gt;test_fuzz.py&lt;/code&gt;&lt;/a&gt; -&#10;run autoflake against Python code that it find in system path (like loads of&#10;Python standard library) and make sure that it doesn&amp;rsquo;t broke any syntax nor&#10;introduce more pyflakes error.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://github.com/myint/autoflake/blob/master/test_fuzz_pypi.py"&gt;&lt;code&gt;test_fuzz_pypi.py&lt;/code&gt;&lt;/a&gt; -&#10;Same like &lt;code&gt;test_fuzz.py&lt;/code&gt; above, but instead of searching Python code in system&#10;path, it download a the most recently updated PyPi packages and try to fix it.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;&lt;code&gt;test_fuzz.py&lt;/code&gt; and &lt;code&gt;test_fuzz_pypi.py&lt;/code&gt; both really important to make sure&#10;autoflake doesn&amp;rsquo;t broke a real world Python program.&lt;/p&gt;&#10;&lt;h2 id="stop-about-autoflake-what-do-i-do-in-the-patch"&gt;Stop about autoflake, what do &lt;strong&gt;I&lt;/strong&gt; do in the patch?&lt;/h2&gt;&#10;&lt;p&gt;Here are the &lt;a href="https://github.com/myint/autoflake/issues/14"&gt;issue&lt;/a&gt; that propose&#10;the new feature.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="https://i.imgur.com/9AJoEdD.png" alt="issue screenshot" loading="lazy" decoding="async"&gt;&lt;/p&gt;&#10;&lt;p&gt;First, let us understand what is this feature about.&lt;/p&gt;&#10;&lt;p&gt;Essentially, autoflake should define implicitly list of name that was imported&#10;and used from a wildcard (&lt;code&gt;*&lt;/code&gt;) import. A wildcard import is something like&#10;&lt;code&gt;from &amp;lt;module&amp;gt; import *&lt;/code&gt;. Usage of wildcard import should be avoided according&#10;to &lt;a href="http://legacy.python.org/dev/peps/pep-0008"&gt;PEP8&lt;/a&gt; and general sentiment&#10;of my &lt;a href="https://stackoverflow.com/questions/3615125/should-wildcard-import-be-avoided"&gt;quick&lt;/a&gt;&#10;&lt;a href="https://stackoverflow.com/questions/22313924/why-how-does-named-vs-wildcard-import-affect-parameters"&gt;Google&lt;/a&gt;&#10;&lt;a href="http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html#importing"&gt;search&lt;/a&gt;,&#10;except in a few notable cases.&lt;/p&gt;&#10;&lt;p&gt;So, how exactly this feature will work? I think an example will make it easier&#10;to understand.&lt;/p&gt;&#10;&lt;p&gt;A code like this&amp;hellip;&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;math&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;sin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;cos&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;will have its wildcard import expanded to explicitly say what exactly list of&#10;names that was imported from &lt;strong&gt;other&lt;/strong&gt; module and is &lt;strong&gt;used&lt;/strong&gt; in this code. In&#10;this case, we use &lt;code&gt;cos&lt;/code&gt; and &lt;code&gt;sin&lt;/code&gt; function from &lt;code&gt;math&lt;/code&gt;. We do not use any other&#10;function from &lt;code&gt;math&lt;/code&gt; module and doesn&amp;rsquo;t want it to dirty our root namespace.&#10;Then it should became like this&amp;hellip;&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;math&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;cos&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sin&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;sin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;cos&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;But, how could we know what names is undefined? If we run that code into&#10;pyflakes, we will get the following report:&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;test.py:1: &amp;#39;from math import *&amp;#39; used; unable to detect undefined names&#13;&#10;test.py:2: &amp;#39;sin&amp;#39; may be undefined, or defined from star imports: math&#13;&#10;test.py:3: &amp;#39;cos&amp;#39; may be undefined, or defined from star imports: math&#10;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;As we see, pyflakes could point out which names was undefined and the possible&#10;origin of those.&lt;/p&gt;&#10;&lt;p&gt;However, there will be some limitation. Because of pyflake only parse the code&#10;without actually run/intepret it, they don&amp;rsquo;t really know from what moudle a name&#10;could possibly came if there exist more than single star import.&lt;/p&gt;&#10;&lt;p&gt;For example&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;math&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;re&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;sin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;cos&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Pyflakes will report&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;test.py:1: &amp;#39;from math import *&amp;#39; used; unable to detect undefined names&#13;&#10;test.py:2: &amp;#39;from re import *&amp;#39; used; unable to detect undefined names&#13;&#10;test.py:3: &amp;#39;sin&amp;#39; may be undefined, or defined from star imports: math, re&#13;&#10;test.py:4: &amp;#39;cos&amp;#39; may be undefined, or defined from star imports: math, re&#10;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now, the undefined name could possibly came from &lt;code&gt;math&lt;/code&gt; &lt;strong&gt;or&lt;/strong&gt; &lt;code&gt;re&lt;/code&gt;. We don&amp;rsquo;t&#10;exactly know which one and thus we can&amp;rsquo;t automatically expand those without&#10;risk of choose the wrong one. The feature limitation is the expanding only&#10;could be done when there was exactly one star import on the whole file.&lt;/p&gt;&#10;&lt;h2 id="the-patch-code-itself"&gt;The patch code itself&lt;/h2&gt;&#10;&lt;h3 id="filtering-the-pyflake-report-message"&gt;Filtering the pyflake report message&lt;/h3&gt;&#10;&lt;p&gt;As the first step, we need to make autoflake know about the new error type that&#10;relate to star import usage. This could be done by declaring new function&#10;that filter list of pyflakes message object to choose our specific error type.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;star_import_used_line_numbers&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;&amp;#34;&amp;#34;Yield line number of star import usage&amp;#34;&amp;#34;&amp;#34;&lt;/span&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;isinstance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pyflakes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ImportStarUsed&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;yield&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;lineno&lt;/span&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;star_import_usage_undefined_name&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;&amp;#34;&amp;#34;Yield line number, undefined name, and its possible origin module&amp;#34;&amp;#34;&amp;#34;&lt;/span&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;isinstance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pyflakes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ImportStarUsage&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;undefined_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;message_args&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;module_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;message_args&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;yield&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;lineno&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;undefined_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;module_name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I write 2 filtering function for this. &lt;code&gt;star_import_used_line_numbers()&lt;/code&gt; will&#10;find the line number where the import star syntax &lt;code&gt;from &amp;lt;module&amp;gt; import *&lt;/code&gt; was&#10;used. &lt;code&gt;star_import_usage_undefined_name()&lt;/code&gt; in the other hand will find the&#10;line number of undefined name that probably came from star import. It also&#10;outputing additional info like the name itself and the possible module origin&#10;which both was passed by pyflakes.&lt;/p&gt;&#10;&lt;p&gt;The content of the function itself was pretty standard and I think was self-&#10;explanatory.&lt;/p&gt;&#10;&lt;h3 id="filtering-the-errors-and-group-up-undefined-names"&gt;Filtering the errors and group up undefined names&lt;/h3&gt;&#10;&lt;p&gt;Next step is call the filtering function above to filter the pyflakes report.&#10;This was done &lt;code&gt;filter_code()&lt;/code&gt; function, which is one of the most crucial&#10;function in autoflake.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# On/off switch for the feature.&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;expand_star_import&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# Search the star import usage in code&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;marked_star_import_line_numbers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;frozenset&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;star_import_used_line_numbers&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;marked_star_import_line_numbers&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# Auto expanding only possible for single star import.&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# If we found more than 1, then just clear the finding and don&amp;#39;t&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# try to fix it.&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;marked_star_import_line_numbers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;frozenset&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# Actually this `else` block could be omitted.&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# List to hold undefined name that should be written in&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# import statement&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;undefined_names&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# Iterate through the undefined name that we find in code...&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;line_number&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;undefined_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; \&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;star_import_usage_undefined_name&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# and then append it to our list.&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;undefined_names&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;undefined_name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# If we doesn&amp;#39;t found any undefined name then don&amp;#39;t try to do anything.&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;undefined_names&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;marked_star_import_line_numbers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;frozenset&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Else block for off-ing this feature&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;marked_star_import_line_numbers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;frozenset&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then autoflake will iterate each line in code to try fix problem in each of it.&lt;/p&gt;&lt;p&gt;&lt;a href="https://adhikasp.id/posts/gsoc/gsoc-phase-1-mid-automatic-star-import-expanding-on-autoflake/"&gt;Read the rest →&lt;/a&gt;&lt;/p&gt;</content:encoded></item><item><title>GSOC Bonding - Understanding current coala's aspect code</title><link>https://adhikasp.id/posts/gsoc/gsoc-bonding-understanding-current-coalas-aspect-code/</link><pubDate>Wed, 31 May 2017 00:00:00 +0700</pubDate><guid>https://adhikasp.id/posts/gsoc/gsoc-bonding-understanding-current-coalas-aspect-code/</guid><description>coala's aspect project is still in its infancy, but a prototype already exists in the codebase. Diving into that code to analyse the core part about aspect.</description><content:encoded>&lt;p&gt;This post is part of my GSOC journey in coala.&lt;/p&gt;&#10;&lt;p&gt;Even though aspect project in coala still in its infancy, there are already&#10;exist a basic prototype of itself in coala codebase. Today, I&amp;rsquo;ll dive into&#10;these code and try to analyze the core part about aspect.&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;Seek First to Understand, then to be Understood&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;That is a quote from the &lt;a href="https://www.stephencovey.com/7habits/7habits-habit5.php"&gt;7 habbit of Stephen Covey&lt;/a&gt;.&#10;It is a habbit for social interaction, but idk, I&amp;rsquo;ll try to make some connection&#10;here because I feel like it. It is important that I understand how the aspect&#10;code work first, and then iI could improve it with confidence and get some idea&#10;on how to code, the style, and the design flow.&lt;/p&gt;&#10;&lt;h2 id="overview"&gt;Overview&lt;/h2&gt;&#10;&lt;p&gt;As of today, commit &lt;a href="https://github.com/coala/coala/tree/efa6727f61f7aa07b4cf38e4ddb34318a978bb62"&gt;&lt;code&gt;efa6727&lt;/code&gt;&lt;/a&gt;,&#10;coala have the the basic idea of what is an &amp;ldquo;aspect&amp;rdquo; is and a small aspect tree.&#10;All of this code can be found in &lt;code&gt;coalib.bearlib.aspects&lt;/code&gt; module. Beside this,&#10;there also a small aspect code usage in &lt;code&gt;coalib.bears&lt;/code&gt; class that used to bind&#10;a aspect into &lt;code&gt;Bear&lt;/code&gt; class. And also, according to coala strict 100% code&#10;coverage, we have plenty of test to make sure the aspect code is healthy and&#10;working.&lt;/p&gt;&#10;&lt;p&gt;Let&amp;rsquo;s start with the overviews of files under &lt;code&gt;coalib.bearlib.aspects&lt;/code&gt; module.&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;code&gt;__init.py__&lt;/code&gt; - &amp;ldquo;loaders&amp;rdquo; function to access all aspect class.&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;base.py&lt;/code&gt; - parent class of aspect that define what an aspect is&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;meta.py&lt;/code&gt; - aspect metaclass that has function to relate between aspects&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;taste.py&lt;/code&gt; - define taste class, kinda like an &amp;ldquo;attribute&amp;rdquo; of a class&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;collections.py&lt;/code&gt; - special collection object for aspect (I WROTE THIS :D)&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;docs.py&lt;/code&gt; - define documentation object (like metadata) that each aspect&#10;should have&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;root.py&lt;/code&gt;, &lt;code&gt;Metadata.py&lt;/code&gt;, &lt;code&gt;Redundacy.py&lt;/code&gt;, &lt;code&gt;Spelling.py&lt;/code&gt; - the definition of&#10;aspect&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h3 id="glossary"&gt;Glossary&lt;/h3&gt;&#10;&lt;p&gt;Before going further, I will explain some of few keyterm used.&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;aspect - the class itself&lt;/li&gt;&#10;&lt;li&gt;aspectinstance - instance object of a taste. Always have a language.&lt;/li&gt;&#10;&lt;li&gt;taste - a measurable properties that help define an aspect. A taste could&#10;have 1 or more language associated with it.&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;Language&lt;/code&gt; class - provide data structure for a (programming) language&#10;information.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h3 id="defining-aspect-in-basepy"&gt;Defining aspect in &lt;code&gt;base.py&lt;/code&gt;&lt;/h3&gt;&#10;&lt;p&gt;Next, let&amp;rsquo;s take a look first on &lt;em&gt;how aspect defined&lt;/em&gt; inside &lt;code&gt;base.py&lt;/code&gt;.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;aspectbase&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="fm"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;language&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;taste_values&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# bypass self.__setattr__&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="vm"&gt;__dict__&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;language&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Language&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;language&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;taste&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tastes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;taste&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;languages&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;language&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;taste&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;languages&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;taste_values&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="n"&gt;TasteError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s1"&gt;.&lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s1"&gt; is not available for &lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s1"&gt;.&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="vm"&gt;__qualname__&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;language&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;setattr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;taste_values&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;taste&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;default&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="fm"&gt;__eq__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;other&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;other&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tastes&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;other&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tastes&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nd"&gt;@property&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;tastes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="vm"&gt;__dict__&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tastes&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="vm"&gt;__dict__&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="fm"&gt;__setattr__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tastes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="ne"&gt;AttributeError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;can&amp;#39;t set attributes of aspectclass instances&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;super&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="fm"&gt;__setattr__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Class &lt;code&gt;aspectbase&lt;/code&gt; serve as the parent class of every aspect in coala. From&#10;reading the &lt;code&gt;__init__&lt;/code&gt; method, we know that aspect has 2 type of &amp;ldquo;attribute&amp;rdquo;,&#10;which is language and tastes. An aspect&amp;rsquo;s language attribute is a Language&#10;object taken from coalang (&lt;code&gt;coalib.bearlib.languages&lt;/code&gt;) modules.&lt;/p&gt;&#10;&lt;p&gt;After that, the taste attribute is initialized.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;taste&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tastes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;...&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# skipped&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;setattr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;taste_values&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;taste&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;default&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;First, in the else section, all the taste from an aspect definition will be&#10;initialized to the aspectinstance. If we define a custom value for a taste, that&#10;value will override the default one.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;taste&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;languages&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;language&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;taste&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;languages&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;taste_values&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="n"&gt;TasteError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s1"&gt;.&lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s1"&gt; is not available for &lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s1"&gt;.&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="vm"&gt;__qualname__&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;language&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The if part above is handling the case when an aspectinstance was initialized&#10;with a custom taste value under the language that the taste itself doesn&amp;rsquo;t&#10;support. In that case, the whole initialization will raise a &lt;code&gt;TasteError&lt;/code&gt;&#10;exception.&lt;/p&gt;&#10;&lt;p&gt;In short, we could instance an aspect like this:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;LineLength&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Python&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;lt;....&lt;/span&gt;&lt;span class="n"&gt;Root&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Formatting&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;LineLength&lt;/span&gt; &lt;span class="nb"&gt;object&lt;/span&gt; &lt;span class="n"&gt;at&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;...&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;LineLength&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Python&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tastes&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;max_line_length&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;LineLength&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Python&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;max_line_length&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tastes&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;max_line_length&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Let&amp;rsquo;s move on to the next function, shall we.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="fm"&gt;__eq__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;other&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;other&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tastes&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;other&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tastes&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Overriding the &lt;code&gt;===&lt;/code&gt; operator to compare the &lt;code&gt;type&lt;/code&gt; object, make sure it has&#10;the same metaclass &lt;code&gt;aspectclass&lt;/code&gt; (more on this metaclass later), and have the&#10;same tastes set.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nd"&gt;@property&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;tastes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="vm"&gt;__dict__&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tastes&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="vm"&gt;__dict__&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Binding all taste into a single callable dict object for convience. So the&#10;&lt;code&gt;LineLength('Python').tastes&lt;/code&gt; will be possible. The &lt;code&gt;@property&lt;/code&gt; decorator make&#10;the &lt;code&gt;tastes&lt;/code&gt; attribute kind of a readonly attribute of an aspect class.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="fm"&gt;__setattr__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tastes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="ne"&gt;AttributeError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;can&amp;#39;t set attributes of aspectclass instances&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;super&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="fm"&gt;__setattr__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Block any attempt to add another taste object into this after instatiation.&#10;The tastes list is kind of immutable.&lt;/p&gt;&#10;&lt;h3 id="inter-aspect-relation-in-metapy"&gt;Inter aspect relation in &lt;code&gt;meta.py&lt;/code&gt;&lt;/h3&gt;&#10;&lt;p&gt;Aspect is structured like a tree. Last month, I wrote a small script that&#10;traverse these tree and generate the tree diagram.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="https://raw.githubusercontent.com/adhikasp/aspect-tree-diagram/master/aspect_diagram.png" alt="aspect tree diagram" loading="lazy" decoding="async"&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="https://adhikasp.id/posts/gsoc/gsoc-bonding-understanding-current-coalas-aspect-code/"&gt;Read the rest →&lt;/a&gt;&lt;/p&gt;</content:encoded></item><item><title>Designing configuration for coala's aspect</title><link>https://adhikasp.id/posts/gsoc/designing-coalas-aspect-configuration/</link><pubDate>Tue, 30 May 2017 00:00:00 +0700</pubDate><guid>https://adhikasp.id/posts/gsoc/designing-coalas-aspect-configuration/</guid><description>With the aspect project in coala came the need to redefine how configuration works, and which new parameters should control how an aspect runs.</description><content:encoded>&lt;p&gt;This post is part of my GSOC journey in coala.&lt;/p&gt;&#10;&lt;p&gt;With the emerge of aspect project in coala, come the need to redefine how&#10;configuration works and define various new parameter that should control how&#10;the aspect should run.&lt;/p&gt;&#10;&lt;p&gt;Currently, the mockup for those configuration could be found on &lt;a href="https://github.com/coala/cEPs/blob/53720cc8d792bb73206e33977ee7e1f2fb1414a9/cEP-0005.md#mockup"&gt;cEP-0005&lt;/a&gt;&#10;and look like this&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;all&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Values can be added to inherited ones only, not within the section because&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# a configuration should describe a state and not involve operations.&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# A system wide coafile can define venv, .git, ... and we would recommend to&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# always use += for ignore even in the default section to inherit those values.&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# += always concatenates with a comma.&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ignore&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="o"&gt;./&lt;/span&gt;&lt;span class="n"&gt;vendor&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;max_line_length&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# This inherits all settings from the `all` section. There is no implicit&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# inheritance.&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;all&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;python&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;language&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Python&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;files&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;**.&lt;/span&gt;&lt;span class="n"&gt;py&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;aspects&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;smell&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;redundancy&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;clone&lt;/span&gt; &lt;span class="c1"&gt;# Inclusive&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;all&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;language&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;C&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;files&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;**.&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;ignore_aspects&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;redundancy&lt;/span&gt; &lt;span class="c1"&gt;# Exclusive&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This mockup provide basic example on how aspect configuration could work. Its&#10;key feature is:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;New parameter &lt;code&gt;aspect&lt;/code&gt; and &lt;code&gt;ignore_aspects&lt;/code&gt; to define list of aspect that&#10;coala should analyze.&lt;/li&gt;&#10;&lt;li&gt;New parameter &lt;code&gt;language&lt;/code&gt; to help coala choose the right bear that could&#10;analyze a specific language.&lt;/li&gt;&#10;&lt;li&gt;A taste could defined by writing its name directly (&lt;code&gt;max_line_length = 80&lt;/code&gt;).&lt;/li&gt;&#10;&lt;li&gt;Specifying &lt;code&gt;bears&lt;/code&gt; manually is still possible.&lt;/li&gt;&#10;&lt;li&gt;Explicit section inheritance (&lt;code&gt;[parent.child]&lt;/code&gt;).&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Again, this configuration is still a mockup. I think, there are still a few way&#10;to further enhance this configuration.&lt;/p&gt;&#10;&lt;h2 id="default-behaviour"&gt;Default behaviour&lt;/h2&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;One important aspect of coala and its usability is that the configuration&#10;of a new language is as easy as possible.&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;IMO, usability is a very crucial factor on making coala more widely used in&#10;open source project. People like to explore new tools, but if configuring these&#10;tools take too much time or too complex, they tend to pass it and get the next&#10;tools on the list. coala must shallow its learning curve.&lt;/p&gt;&#10;&lt;p&gt;In that regard, I want to make the configuration powerfull and compact, but&#10;still provide option to tweak it in detail. It&amp;rsquo;s should be possible for people&#10;to run coala with the most minimal line of configuration, or even with no&#10;explicit configuration nor initial setup beforehand.&lt;/p&gt;&#10;&lt;p&gt;For coala to analyze aspect properly, we need to know:&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;What aspect is choosen&lt;/li&gt;&#10;&lt;li&gt;Which files should analyzed&lt;/li&gt;&#10;&lt;li&gt;What languages it is written in, and&lt;/li&gt;&#10;&lt;li&gt;(optional) Defining aspect&amp;rsquo;s taste, how a correct aspect should look like&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;This could be detailed further&amp;hellip;&lt;/p&gt;&#10;&lt;h3 id="defining-aspect"&gt;Defining aspect&lt;/h3&gt;&#10;&lt;p&gt;An aspect could be written by its fully qualified name (&lt;code&gt;Root.Some.MyAspect&lt;/code&gt;) or&#10;partially qualified name (&lt;code&gt;MyAspect&lt;/code&gt; or &lt;code&gt;Some.MyAspect&lt;/code&gt;). Defining a parent node&#10;mean all of its children node will be included too.&lt;/p&gt;&#10;&lt;p&gt;Defining taste could be done with writing the taste name as the parameter name&#10;and assign a value to it. In case of multiple aspects have the same taste name,&#10;ambiguity must be resolved by prefixing the taste name with its aspect name.&#10;For example, &lt;code&gt;max_length&lt;/code&gt; is a taste of &lt;code&gt;Shortlog&lt;/code&gt; and &lt;code&gt;LineLength&lt;/code&gt;. Thus the&#10;&lt;code&gt;Shortlog&lt;/code&gt; taste would be defined like &lt;code&gt;Shortlog.max_length = 50&lt;/code&gt;.&lt;/p&gt;&#10;&lt;h3 id="defining-language"&gt;Defining language&lt;/h3&gt;&#10;&lt;p&gt;While defining language, we could use coalang (could be found in module&#10;&lt;code&gt;coalib.bearlib.languages.definitions&lt;/code&gt;) to provide flexibility on writting the&#10;language name. For example, &lt;code&gt;C++&lt;/code&gt; could also written by &lt;code&gt;CPP&lt;/code&gt;, &lt;code&gt;CXX&lt;/code&gt;, or even&#10;&lt;code&gt;CPlusPlus&lt;/code&gt; and they will still refer to the same progamming language.&lt;/p&gt;&#10;&lt;p&gt;Other advantadge is in the case of language that have multiple version (like&#10;python2 vs python3), coalang could provide a default version number or users&#10;could define it themself with keyword &lt;code&gt;version&lt;/code&gt;. Note that defining version for&#10;language is not mandatory. Its neccessary in case of project that should be&#10;analyzed under specific version, like python3 project that should analyzed&#10;by python3 only bear.&lt;/p&gt;&#10;&lt;h3 id="defining-files"&gt;Defining files&lt;/h3&gt;&#10;&lt;p&gt;IMO explicitly defining file in section is not always necessary because we can&#10;get list of file extension from coalang. By defining &lt;code&gt;language = CPP&lt;/code&gt;, then it&#10;also mean implicitly &lt;code&gt;files = **.c, **.cpp, **.h, **.hpp&lt;/code&gt;. Of course this could&#10;be overwritten by explicitly define &lt;code&gt;files&lt;/code&gt; parameter in configuration.&lt;/p&gt;&#10;&lt;h2 id="backward-compatibility-for-choosing-bear-by-its-name"&gt;Backward compatibility for choosing bear by its name&lt;/h2&gt;&#10;&lt;p&gt;There is some unresolved problem on defining bear. The problem is gathering the&#10;option configuration for those bear. In aspect based configuration, bear option&#10;will collected through taste, but in old configuration, option is given as a&#10;kind of &amp;ldquo;global&amp;rdquo; parameter in section. It will be a enormous task to write a&#10;mapping function from old parameter and its taste pair.&lt;/p&gt;&#10;&lt;p&gt;For the time being, I think the most easy approach is to make conditionally&#10;collection on each bear with something like this:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;LineLengthBear&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;LocalBear&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;aspects&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s1"&gt;&amp;#39;detect&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;LineLength&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;]):&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;filename&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;aspects&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;min_length&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;LineLength&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;aspects&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# Overwrite with the aspect&amp;#39;s taste if it exist&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;min_length&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;aspects&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;LineLength&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;min_length&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# do something with min_length&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="conclusion"&gt;Conclusion&lt;/h2&gt;&#10;&lt;p&gt;To write a aspect configuration, we at least need to know &lt;strong&gt;what aspect&lt;/strong&gt; we&#10;want to analyze and &lt;strong&gt;what language&lt;/strong&gt; it&amp;rsquo;s written in. We can configure it&#10;further by defining list of files and list of option (aspect&amp;rsquo;s taste) for each&#10;aspect.&lt;/p&gt;&#10;&lt;p&gt;This is my first time trying to write a configuration format and it will be far&#10;from perferct or have some unforseen edge case. Hopefully, all the bugs and&#10;weird edge cases could be tackled in the future while the the coding is in&#10;progress.&lt;/p&gt;&#10;</content:encoded></item><item><title>My Path into Open Source</title><link>https://adhikasp.id/posts/gsoc/first-introduction-to-open-source/</link><pubDate>Fri, 12 May 2017 00:00:00 +0700</pubDate><guid>https://adhikasp.id/posts/gsoc/first-introduction-to-open-source/</guid><description>How I got stuck on the open source community and loving it: from a college student reading Hacker News to starting a coala project for Google Summer of Code.</description><content:encoded>&lt;p&gt;This is just a rant on how I got stuck on Open Source community and loving it.&lt;/p&gt;&#10;&lt;p&gt;6 month ago, at about October 2016, I just a normal college student who love&#10;programming. I like reading about new, hottest framework or library on&#10;hacker news, exploring on Github, or just read some random blog post and&#10;articles.&lt;/p&gt;&#10;&lt;p&gt;I feel kind of frustrated though. I do nothing productive or creating&#10;something useful. Real practical programming I do is only on&#10;college assignment or some side freelancing job. College assignment is grim.&#10;We work in group and then have a goal too grand. The result is failure and&#10;just some &amp;ldquo;at least we should bring something in class presentation tomorrow&amp;rdquo;&#10;job. It is not very inspiring. And.. I don&amp;rsquo;t know, it not felt right. Maybe I&#10;have some irritated mindset that I don&amp;rsquo;t like to do anything that ordered by&#10;teacher, I feel so lazy to do college assignment in general.&lt;/p&gt;&#10;&lt;p&gt;Freelancing job? Sound great on paper. I get to do something that I like, and&#10;also&amp;hellip; money!! Money is always nice. But, there is always a but. Job that I&#10;got always have something to do with WordPress. Like creating company profile,&#10;some event website, school profile page, and the like. It&amp;rsquo;s boring and&#10;not really make me improved as programmer. Also I am not really a people person,&#10;and freelancing work kind of really need that for communicating with client.&#10;Luckily I have partner that gladly take responsibility of that. She was managing&#10;the client, doing design job, and take the frontend stuff. I, on the other side,&#10;mainly just take care of backend stuff like setup the server, installing&#10;WordPress, and make sure the site is not down. Maybe it&amp;rsquo;s a great path, maybe&#10;I just haven&amp;rsquo;t found the perfect job or client. But in the end of the day, I&#10;got other opportunity.&lt;/p&gt;&#10;&lt;h2 id="meet-besut-kode"&gt;Meet Besut Kode&lt;/h2&gt;&#10;&lt;p&gt;It was about beginning of October 2016. I notice a new poster on my campus&#10;notice board. It is a Besut Kode competition poster. I was interested at first&#10;glance because it have the word &amp;ldquo;Kode&amp;rdquo; (Indonesian for&amp;hellip; code) in it. In the&#10;sea of scientific paper conference, call of paper from lecturer, academic and&#10;other notices, it is really a fresh breeze. I immediately open the website and&#10;read further about it. I was surprised that it require a Github pull request in&#10;order to &amp;ldquo;register&amp;rdquo; to the competition, oh wow this will be a cool competition!&lt;/p&gt;&#10;&lt;p&gt;Of course, like a real college student, I am &lt;del&gt;procrastinating&lt;/del&gt; waiting for the&#10;most strategic and critical time to do all the registration stuff and creating&#10;the pull request. That was my first PR to other people that I never meet in&#10;real world (other PR was for my college assignment ofc).&lt;/p&gt;&#10;&lt;p&gt;The process is hard. We as participant was &lt;del&gt;forced&lt;/del&gt; encouraged to do various&#10;task in order to familiarize on how to contribute to open source. First it&#10;seems trivial, find any project that doesn&amp;rsquo;t have license yet and raise the&#10;issue in discussion. Then in the end of the month, for another task, we must&#10;collect various open data about a small island in Indonesia and compile it to&#10;a map.&lt;/p&gt;&#10;&lt;p&gt;In the end, I was lucky enough to became one of 2 grand finalist of the Besut&#10;Kode competition and got a free ride to FOSSASIA 2017 in Singapore. That was&#10;my first trip to foreign country, and a open source meeting on top of that!&#10;That was a wonderful experience and hopefully I will wrote about it too if&#10;I am not &lt;del&gt;procrastinating&lt;/del&gt; distracted by daily life.&lt;/p&gt;&#10;&lt;h2 id="hooked-up-into-coala-and-getting-into-gsoc"&gt;Hooked up into coala and getting into GSOC&lt;/h2&gt;&#10;&lt;p&gt;Through one of Besut Kode task, I find coala. I read around their code,&#10;silently lurking their chat channel on gitter, and other things. As far as I&#10;know, coala is the best open source community for me yet. They provide a&#10;welcoming community, interesting project goal, high contribution standard so I&#10;can keep improving, and non archaic tools for communication and collaboration&#10;(apparently I am still not in the phase of programmer who praise mailing list&#10;and some unique, random, bug tracking software).&lt;/p&gt;&#10;&lt;p&gt;Then come Google Summer of Code. This is another interesting challenge for me&#10;because it provide a chance to be &lt;del&gt;forced&lt;/del&gt; encouraged to create a productive&#10;and useful work in programming. Also money. Money is always nice. But mainly&#10;I was using it as motivation to create something that I would be proud of.&lt;/p&gt;&#10;&lt;p&gt;And the happy ending is I was accepted! Thus also part of reason why this blog&#10;got to life again.&lt;/p&gt;&#10;&lt;p&gt;In the end, I realize my old self question on why people want to &lt;del&gt;waste their&#10;time away&lt;/del&gt; provide help to open source project. It was rewarding. You got to&#10;work on whatever you like and however way you want (as long it doesn&amp;rsquo;t piss&#10;other people). Also, you know that your work was useful for people in the other&#10;side of the world.&lt;/p&gt;&#10;&lt;p&gt;Special thanks for John (@jayvdb) and Wikimedia Indonesia, as he is my mentor&#10;in Besut Kode and now in coala. Through Besut Kode he introduce me on how I can&#10;going to open source. Through coala I got the reason and feel why.&lt;/p&gt;&#10;&lt;p&gt;Hopefully my path into open source will keep going further and learn more&#10;things that keep me excited.&lt;/p&gt;&#10;</content:encoded></item></channel></rss>