<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="https://kamilborys.com/feed_style.xsl" type="text/xsl"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <tabi:metadata xmlns:tabi="https://github.com/welpo/tabi">
        <tabi:base_url>https:&#x2F;&#x2F;kamilborys.com</tabi:base_url>
        <tabi:separator>
            •
        </tabi:separator>
        <tabi:about_feeds>This is a web feed, also known as an Atom feed. Subscribe by copying the URL from the address bar into your newsreader. Visit About Feeds to learn more and get started. It&#x27;s free.</tabi:about_feeds>
        <tabi:visit_the_site>Visit website</tabi:visit_the_site>
        <tabi:recent_posts>Recent posts</tabi:recent_posts>
        <tabi:last_updated_on>Updated on $DATE</tabi:last_updated_on>
        <tabi:default_theme>dark</tabi:default_theme>
        <tabi:post_listing_date>date</tabi:post_listing_date>
        <tabi:current_section>KamilCase</tabi:current_section>
    </tabi:metadata><link rel="extra-stylesheet" href="https://kamilborys.com/skins/amber.css?h=f8925a89cfb5bc099f43" /><title>KamilCase</title>
    <link href="https://kamilborys.com/atom.xml" rel="self" type="application/atom+xml"/>
    <link href="https://kamilborys.com" rel="alternate" type="text/html"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2026-01-24T00:00:00+00:00</updated>
    <id>https://kamilborys.com/atom.xml</id><entry xml:lang="en">
        <title>Tell me a Tiny Story: LLM Inference on a PowerMac G3</title>
        <published>2026-01-24T00:00:00+00:00</published>
        <updated>2026-01-24T00:00:00+00:00</updated>
        <author>
            <name>Kamil Borys</name>
        </author>
        <link rel="alternate" href="https://kamilborys.com/blog/tell-me-a-tiny-story/" type="text/html"/>
        <id>https://kamilborys.com/blog/tell-me-a-tiny-story/</id>
        <summary type="html">AI-generated content is everywhere now.
Your morning Instagram doom-scrolling routine,
those 47 unread emails in your inbox that arrived overnight,
the friendly assistant that tells you that you are absolutely right -
I'm sure at least some of that was powered by large language models.
These are usually run on powerful hardware,
in large fancy data centers consuming ridiculous amounts of power.
But what if I told you it's possible to run AI
from the comfort of your own home, right on your PowerMac G3 workstation?
~/src/llama2.c % uname -srm
NetBSD 10.1 macppc

~/src/llama2.c % ./run sw-stories15M.bin \
  -z sw-tokenizer.bin \
  -i &#39;Mary had a little lamb.&#39;
Mary had a little lamb.
She was very gentle and kind.
One day she was walking in the forest
when she saw something very strange.
There was a dragon
and it was making a loud roar.
(...)
achieved tok/s: 2.702613
…</summary>
        </entry><entry xml:lang="en">
        <title>Let the music play</title>
        <published>2021-09-06T00:00:00+00:00</published>
        <updated>2021-09-06T00:00:00+00:00</updated>
        <author>
            <name>Kamil Borys</name>
        </author>
        <link rel="alternate" href="https://kamilborys.com/blog/let-the-music-play/" type="text/html"/>
        <id>https://kamilborys.com/blog/let-the-music-play/</id>
        <summary type="html">char a;float b,c;main(d){for(;d&gt;2e3*c?c=1,scanf(&quot; %c%f&quot;,&amp;a,&amp;c),d=55-a%32*9/5,
b=d&gt;9,d=d%13-a/32*12:1;a=2)++d&lt;24?b*=89/84.:putchar(a=b*d);}

Good news for all International Obfuscated C Code Contest fans -- here's another winning piece from 2013 written by Yusuke Endoh, who is no stranger to the Contest. It is dubbed the Most Tweetable 1-Liner, because is small enough to fit in a tweet (137 characters only), yet can "tweet out a tune", that is, will play some music for your entertainment…</summary>
        </entry><entry xml:lang="en">
        <title>Dots and Dashes</title>
        <published>2018-08-15T11:08:11+00:00</published>
        <updated>2018-08-15T11:08:11+00:00</updated>
        <author>
            <name>Kamil Borys</name>
        </author>
        <link rel="alternate" href="https://kamilborys.com/blog/dots-and-dashes/" type="text/html"/>
        <id>https://kamilborys.com/blog/dots-and-dashes/</id>
        <summary type="html">#!perl -p
y/.-/01/;s#\d+/?#substr&#39;01etianmsurwdkgohvf,l.pjbxcyzq&#39;,31&amp;oct b1.$&amp;,1#ge

Perl is (in)famous for the ability to write programs that look like line noise, and today I will take apart this beautiful piece of code.  Written by tybalt89, it can decode sequences of dots and dashes to Latin letters in just 73 characters of code…</summary>
        </entry><entry xml:lang="en">
        <title>Anatomy of the heart</title>
        <published>2018-03-13T08:01:46+00:00</published>
        <updated>2018-03-13T08:01:46+00:00</updated>
        <author>
            <name>Kamil Borys</name>
        </author>
        <link rel="alternate" href="https://kamilborys.com/blog/anatomy-of-the-heart/" type="text/html"/>
        <id>https://kamilborys.com/blog/anatomy-of-the-heart/</id>
        <summary type="html">#!/usr/bin/perl -w
use strict;

     my$f=           $[;my
   $ch=0;sub       l{length}
 sub r{join&quot;&quot;,   reverse split
(&quot;&quot;,$_[$[])}sub ss{substr($_[0]
,$_[1],$_[2])}sub be{$_=$_[0];p
 (ss($_,$f,1));$f+=l()/2;$f%=l 
  ();$f++if$ch%2;$ch++}my$q=r
   (&quot;\ntfgpfdfal,thg?bngbj&quot;.    
    &quot;naxfcixz&quot;);$_=$q; $q=~
      tr/f[a-z]/ [l-za-k] 
        /;my@ever=1..&amp;l
          ;my$mine=$q
            ;sub p{
             print
              @_;
               }
                         
       be $mine for @ever 

This heart-shaped program is written in the language of choice for producing unreadable and obfuscated code: Perl 5. It also serves an unusual purpose of a proposal…</summary>
        </entry><entry xml:lang="en">
        <title>Have fun with Unix</title>
        <published>2018-03-01T08:09:54+00:00</published>
        <updated>2018-03-01T08:09:54+00:00</updated>
        <author>
            <name>Kamil Borys</name>
        </author>
        <link rel="alternate" href="https://kamilborys.com/blog/have-fun-with-unix/" type="text/html"/>
        <id>https://kamilborys.com/blog/have-fun-with-unix/</id>
        <summary type="html">main() { printf(&amp;unix[&quot;\021%six\012\0&quot;],(unix)[&quot;have&quot;]+&quot;fun&quot;-0x60);}

Just one line of code, but lots of confusion.  What does this program do?…</summary>
        </entry><entry xml:lang="en">
        <title>Some are more equal than others</title>
        <published>2018-02-18T19:15:03+00:00</published>
        <updated>2018-02-18T19:15:03+00:00</updated>
        <author>
            <name>Kamil Borys</name>
        </author>
        <link rel="alternate" href="https://kamilborys.com/blog/some-are-more-equal-than-others/" type="text/html"/>
        <id>https://kamilborys.com/blog/some-are-more-equal-than-others/</id>
        <summary type="html">
"And to avoid the tedious repetition of these words: is equal to: I will set as I do often in work use, a pair of parallels, or Gemowe lines of one length, thus: =, because no 2 things, can be more equal."
-- Robert Recorde, The Whetstone of Witte (1557)

public class Equality {
	public Equality() {
		Integer a1 = 100, a2 = 100;
		Integer b1 = 200, b2 = 200;
		if (a1 == a2) System.out.println(&quot;a1 == a2&quot;);
		if (b1 == b2) System.out.println(&quot;b1 == b2&quot;);
	}
	public static void main(String[] args) {new Equality(); }
}
…</summary>
        </entry><entry xml:lang="en">
        <title>How to dismantle a compiler bomb</title>
        <published>2018-01-20T16:52:25+00:00</published>
        <updated>2018-01-20T16:52:25+00:00</updated>
        <author>
            <name>Kamil Borys</name>
        </author>
        <link rel="alternate" href="https://kamilborys.com/blog/how-dismantle-compiler-bomb/" type="text/html"/>
        <id>https://kamilborys.com/blog/how-dismantle-compiler-bomb/</id>
        <summary type="html">main[-1u]={1};

You have heard of "zip bombs" (a tiny ZIP file that decompresses to multiple gigabytes) and "XML bombs" (small XML file abusing the entities to consume lots of memory), and now there is a "compiler bomb" to follow suit.  The idea is quite similar -- the source code is only 14 bytes, but the generated executable will be over 16 GB in size…</summary>
        </entry><entry xml:lang="en">
        <title>Namaste India</title>
        <published>2017-10-25T20:10:09+00:00</published>
        <updated>2017-10-25T20:10:09+00:00</updated>
        <author>
            <name>Kamil Borys</name>
        </author>
        <link rel="alternate" href="https://kamilborys.com/blog/namaste-india/" type="text/html"/>
        <id>https://kamilborys.com/blog/namaste-india/</id>
        <summary type="html">This obfuscated piece of C code prints the map of India to the standard output.
#include &lt;stdio.h&gt;
main()
{
    int a,b,c;
    int count = 1;
    for (b=c=10;a=&quot;- FIGURE?, UMKC,XYZHello Folks,\
    TFy!QJu ROo TNn(ROo)SLq SLq ULo+\
    UHs UJq TNn*RPn/QPbEWS_JSWQAIJO^\
    NBELPeHBFHT}TnALVlBLOFAkHFOuFETp\
    HCStHAUFAgcEAelclcn^r^r\\tZvYxXy\
    T|S~Pn SPm SOn TNn ULo0ULo#ULo-W\
    Hq!WFs XDt!&quot; [b+++21]; )
    for(; a-- &gt; 64 ; )
    putchar ( ++c==&#39;Z&#39; ? c = c/ 9:33^b&amp;1);
    return 0;
}
…</summary>
        </entry><entry xml:lang="en">
        <title>Regex prime checker</title>
        <published>2017-10-07T13:26:38+00:00</published>
        <updated>2017-10-07T13:26:38+00:00</updated>
        <author>
            <name>Kamil Borys</name>
        </author>
        <link rel="alternate" href="https://kamilborys.com/blog/regex-prime-checker/" type="text/html"/>
        <id>https://kamilborys.com/blog/regex-prime-checker/</id>
        <summary type="html">This Java snippet uses a regular expression for something way different than they were designed for: a primality check.
public static boolean prime(int n) {
    return !new String(new char[n]).matches(&quot;.?|(..+?)\\1+&quot;);
}
…</summary>
        </entry><entry xml:lang="en">
        <title>Quine - a self-replicating program</title>
        <published>2017-09-11T17:37:39+00:00</published>
        <updated>2017-09-11T17:37:39+00:00</updated>
        <author>
            <name>Kamil Borys</name>
        </author>
        <link rel="alternate" href="https://kamilborys.com/blog/quine-a-self-replicating-program/" type="text/html"/>
        <id>https://kamilborys.com/blog/quine-a-self-replicating-program/</id>
        <summary type="html">Quines are computer programs that accept no input and write its own source code on the standard output.  This entry was taken from the Jargon File, the author is unknown.
char*f=&quot;char*f=%c%s%c;main()
{printf(f,34,f,34,10);}%c&quot;;
main(){printf(f,34,f,34,10);}
…</summary>
        </entry><entry xml:lang="en">
        <title>Underscore Pi</title>
        <published>2017-08-27T12:19:38+00:00</published>
        <updated>2017-08-27T12:19:38+00:00</updated>
        <author>
            <name>Kamil Borys</name>
        </author>
        <link rel="alternate" href="https://kamilborys.com/blog/underscore-pi/" type="text/html"/>
        <id>https://kamilborys.com/blog/underscore-pi/</id>
        <summary type="html">This clever program written by Brian Westley calculates π by looking at its own area.  It is one of the winning entries of IOCCC in 1988.
#define _ -F&lt;00||--F-OO--;
int F=00,OO=00;main(){F_OO();printf(&quot;%1.3f\n&quot;,4.*-F/OO/OO);}F_OO()
{
            _-_-_-_
       _-_-_-_-_-_-_-_-_
    _-_-_-_-_-_-_-_-_-_-_-_
  _-_-_-_-_-_-_-_-_-_-_-_-_-_
 _-_-_-_-_-_-_-_-_-_-_-_-_-_-_
 _-_-_-_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
 _-_-_-_-_-_-_-_-_-_-_-_-_-_-_
 _-_-_-_-_-_-_-_-_-_-_-_-_-_-_
  _-_-_-_-_-_-_-_-_-_-_-_-_-_
    _-_-_-_-_-_-_-_-_-_-_-_
        _-_-_-_-_-_-_-_
            _-_-_-_
}

…</summary>
        </entry><entry xml:lang="en">
        <title>Duff&#x27;s device</title>
        <published>2017-08-24T18:14:43+00:00</published>
        <updated>2017-08-24T18:14:43+00:00</updated>
        <author>
            <name>Kamil Borys</name>
        </author>
        <link rel="alternate" href="https://kamilborys.com/blog/duffs-device/" type="text/html"/>
        <id>https://kamilborys.com/blog/duffs-device/</id>
        <summary type="html">
"This code forms some sort of argument (...), but I'm not sure whether it's for or against."

send(to, from, count)
register short *to, *from;
register count;
{
	register n = (count + 7) / 8;
	switch (count % 8) {
	case 0: do { *to = *from++;
	case 7:      *to = *from++;
	case 6:      *to = *from++;
	case 5:      *to = *from++;
	case 4:      *to = *from++;
	case 3:      *to = *from++;
	case 2:      *to = *from++;
	case 1:      *to = *from++;
			} while (--n &gt; 0);
	}
}
…</summary>
        </entry>
</feed>
