<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Ali Khudiyev</title>
    <description>It takes one&apos;s curiosity to try and one&apos;s sheer will to try again. — Ali Khudiyev</description>
    <link>/</link>
    <atom:link href="/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Sat, 06 Jun 2026 09:18:46 +0000</pubDate>
    <lastBuildDate>Sat, 06 Jun 2026 09:18:46 +0000</lastBuildDate>
    <generator>Jekyll v3.10.0</generator>
    
      <item>
        <title>Live Aquarium</title>
        <description>&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
	&lt;meta charset=&quot;utf-8&quot;&gt;
	&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, user-scalable-no, minimum-scale=1.0, maximum-scale=1.0&quot;&gt;
	&lt;title&gt;FishLive – Live Aquarium&lt;/title&gt;
	&lt;style&gt;
		* { margin: 0; padding: 0; box-sizing: border-box; }
		body { background: #000; overflow: hidden; }
		canvas { display: block; }
	&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
	&lt;div id=&quot;container&quot;&gt;&lt;/div&gt;
	&lt;script type=&quot;module&quot; src=&quot;/assets/js/live-aquarium/main.js&quot;&gt;&lt;/script&gt;
&lt;/body&gt;

&lt;/html&gt;
</description>
        <pubDate>Mon, 16 Mar 2026 14:37:00 +0000</pubDate>
        <link>/art/generated/2026/03/16/live-aquarium.html</link>
        <guid isPermaLink="true">/art/generated/2026/03/16/live-aquarium.html</guid>
        
        
        <category>art</category>
        
        <category>generated</category>
        
      </item>
    
      <item>
        <title>Set Theory</title>
        <description>&lt;h1 id=&quot;lemmas--theorems&quot;&gt;Lemmas &amp;amp; Theorems&lt;/h1&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Lemma 1 (Zorn’s lemma).&lt;/strong&gt; If $X$ is a partially ordered set such
that every chain in $X$ has an upper bound, then $X$ contains a
maximal element.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (Recursion).&lt;/strong&gt; If $a$ is an element of a set $X$, and if
$f$ is a function from $X$ to $X$, then there exists a function $u$
from $w$ to $X$ such that $u(0) = a$ and such that $u(n^+) = f(u(n))$
for all $n$ in $w$.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 2 (Well ordering).&lt;/strong&gt; Every set can be well ordered.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 3 (Transfinite recursion).&lt;/strong&gt; If $W$ is a well ordered set,
and if $f$ is a sequence function of type $W$ in a set $X$, then there
exists a unique function $U$ from $W$ into $X$ such that
$U(a) = f(U^a)$ for each $a$ in $W$.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 4 (Counting).&lt;/strong&gt; Each well ordered set is similar to a unique
ordinal number.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 5 (Schröder-Bernstein theorem).&lt;/strong&gt; If $X \precsim Y$ and
$Y \precsim Z$, then $X \sim Y$.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 6.&lt;/strong&gt; Every set is strictly dominated by its power set, or,
in other words,&lt;/p&gt;

\[X \prec \mathcal{P}(X)\]

  &lt;p&gt;for all $X$.&lt;/p&gt;
&lt;/blockquote&gt;
</description>
        <pubDate>Sun, 07 Dec 2025 19:00:00 +0000</pubDate>
        <link>/courses/self-study/mathematics/foundations/2025/12/07/set-theory-3.html</link>
        <guid isPermaLink="true">/courses/self-study/mathematics/foundations/2025/12/07/set-theory-3.html</guid>
        
        
        <category>courses</category>
        
        <category>self-study</category>
        
        <category>mathematics</category>
        
        <category>foundations</category>
        
      </item>
    
      <item>
        <title>Set Theory</title>
        <description>&lt;h1 id=&quot;axioms&quot;&gt;Axioms&lt;/h1&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Axiom 1 (Axiom of Extension).&lt;/strong&gt; Two sets are equal if and only if
they have the same elements.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Axiom 2 (Axiom of Specification).&lt;/strong&gt; To every set $A$ and to every
condition $S(x)$ there corresponds a set $B$ whose elements are
exactly those elements $x$ of $A$ for which $S(x)$ holds.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Axiom 3 (Axiom of Pairing).&lt;/strong&gt; For any two sets there exists a set
that they both belong to.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Axiom 4 (Axiom of Unions).&lt;/strong&gt; For every collection of sets there
exists a set that contains all the elements that belong to at least
one set of the given collection.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Axiom 5 (Axiom of Powers).&lt;/strong&gt; For each set there exists a collection
of sets that contains among its elements all the subsets of the given
set.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Axiom 6 (Axiom of Infinity).&lt;/strong&gt; There exists a set containing 0 and
containing the successor of each of its elements.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Axiom 7 (Axiom of Choice).&lt;/strong&gt; The Cartesian product of a non-empty
family of non-empty sets is non-empty.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Axiom 8 (Axiom of Substitution).&lt;/strong&gt; If $S(a, b)$ is a sentence such
that for each $a$ in a set $A$ the set ${b : S(a, b)}$ can be
formed, then there exists a function $F$ with domain $A$ such that
$F(a) = {b : S(a, b)}$ for each $a$ in $A$.&lt;/p&gt;
&lt;/blockquote&gt;
</description>
        <pubDate>Sun, 07 Dec 2025 19:00:00 +0000</pubDate>
        <link>/courses/self-study/mathematics/foundations/2025/12/07/set-theory-2.html</link>
        <guid isPermaLink="true">/courses/self-study/mathematics/foundations/2025/12/07/set-theory-2.html</guid>
        
        
        <category>courses</category>
        
        <category>self-study</category>
        
        <category>mathematics</category>
        
        <category>foundations</category>
        
      </item>
    
      <item>
        <title>Set Theory</title>
        <description>&lt;h1 id=&quot;basics&quot;&gt;Basics&lt;/h1&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Definition 1 (Set).&lt;/strong&gt; Set is a bucket that can hold objects or
elements.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;

\[\begin{aligned}
    &amp;amp;S = \{1, 2, 3, 4, 5\} \quad\text{(S is a set of some numbers)} \\
    &amp;amp;C = \{a, b, g, r, s\} \quad\text{(C is a set of some letters)}
\end{aligned}\]

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Remark 1 (Set Membership).&lt;/strong&gt; Given a set $S$ and an element $x$, $x$
can either be included in $S$ (denoted as $x \in S$), or excluded in
$S$ (denoted as $x \not\in S$).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;

\[\begin{aligned}
    &amp;amp;3 \in S, \text{but}\ 8 \not\in S \\
    &amp;amp;B \not\in C, \text{but}\ b \in S
\end{aligned}\]

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Remark 2 (Set Construction).&lt;/strong&gt; A set builder notation
${x : \text{&lt;some logical=&quot;&quot; condition=&quot;&quot; on=&quot;&quot; x=&quot;&quot;&gt;}\}$ can be used to
construct sets more conveniently.&lt;/some&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;

\[\begin{aligned}
    &amp;amp;N = \{x : x \in \mathbb{Z} \text{ and } 0 &amp;lt; x &amp;lt; 101\} \quad\text{$N$ is a set of all positive integers up to 101}\\
    &amp;amp;E = \{x : x \in \mathbb{N} \text{ and } x \mod 2 = 0\} \quad\text{$E$ is a set of all even natural numbers}\\
\end{aligned}\]

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Definition 2 (Union of Sets).&lt;/strong&gt; Union of sets
$A = {a_1, a_2, \cdots}$ and $B = {b_1, b_2, \cdots}$ is another
set containing all the elements of $A$ and $B$, i.e.,
$A \cup B = {a_1, a_2, a_3, \cdots, b_1, b_2, \cdots}$.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;

\[\begin{aligned}
    S \cup C = \{1, 2, 3, 4, 5, a, b, g, r, s\}
\end{aligned}\]

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Definition 3 (Intersection of Sets).&lt;/strong&gt; Intersection of sets $A$ and
$B$ is another set containing all the common elements that appear both
in $A$ and $B$, i.e., $A \cap B =$&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;

\[\begin{aligned}
    S \cap C = \{\}
\end{aligned}\]

&lt;h1 id=&quot;more-about-sets&quot;&gt;More About Sets&lt;/h1&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Definition 4 (Countability).&lt;/strong&gt; A set $X$ is called countable (or
denumerable) in case $X \precsim w$ and countably infinite in case
$X \sim w$.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Definition 5.&lt;/strong&gt; If $X$ and $Y$ are sets such that $X$ is equivalent
to a subset of $Y$, we say $Y$ dominates $X$ or \(X \precsim Y\)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Remark 3.&lt;/strong&gt; Strong domination vs weak domination&lt;/p&gt;
&lt;/blockquote&gt;
</description>
        <pubDate>Sun, 07 Dec 2025 19:00:00 +0000</pubDate>
        <link>/courses/self-study/mathematics/foundations/2025/12/07/set-theory-1.html</link>
        <guid isPermaLink="true">/courses/self-study/mathematics/foundations/2025/12/07/set-theory-1.html</guid>
        
        
        <category>courses</category>
        
        <category>self-study</category>
        
        <category>mathematics</category>
        
        <category>foundations</category>
        
      </item>
    
      <item>
        <title>PhD Defended</title>
        <description>&lt;p&gt;Today I defended my PhD thesis in front of four French jury members in
Strasbourg. My presentation took $\sim$45 minutes, and
then the back-and-forth Q&amp;amp;A with the jury members took
$\sim$60 minutes. Examiners and other jury members
asked good and relevant questions, some of which were very on point. I
felt like they were genuinely interested in my research work and what I
was about to say to answer their questions. I was very happy when I
observed this from the beginning of the Q&amp;amp;A part. They also seemed to
like my responses and, I guess, my way of thinking through problems,
which was good to hear, too. We seemed to disagree on a couple of things
with one jury member, but we both acknowledged that either of us could
be wrong. I didn’t know what to expect when I started my presentation,
but then I felt like the work and everything else were appreciated by
the jury. At the end of the defense, they discussed internally whether
or not I deserve to get a PhD and then decided to declare me a PhD
holder. I felt like the process went very smoothly and very well in
general. I got my PhD degree in AI. People cheered, I received some nice
gifts, then I left the lab to digest the things a little bit and have
some fun with some of my fellow PhD students in Strasbourg.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;My PhD Thesis: &lt;a target=&quot;_blank&quot; href=&quot;https://drive.google.com/file/d/1y50fqGA3UeJdahZq4IVDfrb4A3uDx-fG/view?usp=share_link&quot;&gt;&lt;i&gt;Scaling Intelligence: A Formal and Practical Framework for Computationally Unbounded AI&lt;/i&gt;&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a target=&quot;_blank&quot; href=&quot;https://drive.google.com/file/d/1hFb1uohubKAOpnVGRoJFlsKL6tAZb90p/view?usp=share_link&quot;&gt;My PhD Defense Presentation&lt;/a&gt;&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;figure style=&quot;text-align:center;&quot;&gt;
    &lt;img style=&quot;margin:auto;&quot; src=&quot;/assets/images/phd-defense-2025.jpg&quot; alt=&quot;Me in my PhD defense (28.11.2025)&quot; /&gt;
    &lt;figcaption&gt;Me in my PhD defense. 28.11.2025&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;At the final moments of the jury’s congratulations and others’ cheerings
for me for getting a PhD, something struck me lightly. I internally had
this very weird feeling about things. The whole thing seemed unreal
because many fragments from the past 3 years of my PhD were playing in
front of my eyes, and I couldn’t believe how, after this many years of
“struggle”, without anyone truly rooting for you, except very few
people, could end like this… people saying the nicest things and
congratulating you for what you have done silently for the past 3 years.
One of the people who supported me during this process was my director,
Anne Jeannin-Girardon. My mother’s support meant a lot, too. I am
thankful for this.&lt;/p&gt;

&lt;p&gt;It is not really about having a PhD degree or becoming a doctor… Well,
the world has made it this way, but keep an open mind, folks! We are who
we are when there is no one in the audience watching us.&lt;/p&gt;
</description>
        <pubDate>Fri, 28 Nov 2025 11:00:00 +0000</pubDate>
        <link>/blog/phd/academia/ai/2025/11/28/phd-defense-fr.html</link>
        <guid isPermaLink="true">/blog/phd/academia/ai/2025/11/28/phd-defense-fr.html</guid>
        
        
        <category>blog</category>
        
        <category>PhD</category>
        
        <category>academia</category>
        
        <category>AI</category>
        
      </item>
    
      <item>
        <title>Cool C Tricks</title>
        <description>&lt;figure&gt;
&lt;figcaption style=&quot;text-align: center; font-size: 12pt;&quot;&gt;
    &lt;i&gt;&lt;strong&gt;1.&lt;/strong&gt; Array initiliazation&lt;/i&gt;
&lt;/figcaption&gt;
&lt;pre&gt;
int arr[] = { 0, 1, [10]=3, 100, -1, [4]=4, 2};
printf(&quot;%zu&quot;, sizeof(arr)/sizeof(int)); // 13 ints
&lt;/pre&gt;
&lt;/figure&gt;

&lt;figure&gt;
&lt;figcaption style=&quot;text-align: center; font-size: 12pt;&quot;&gt;
    &lt;i&gt;&lt;strong&gt;2.&lt;/strong&gt; Struct initiliazation&lt;/i&gt;
&lt;/figcaption&gt;
&lt;pre&gt;
struct vertex {
    int i;
    enum {
        struct {
            uint8_t r;
            uint8_t g;
            uint8_t b;
        } data;
        uint8_t rgb[3];
    } color;
};

struct vertex p = { 
    .i=1, 
    .color = { 
        .data = { .r=255, .g=100, .b=40 }
    }
};

printf(&quot;%u %u %u&quot;, 
    p.color.rgb[0], 
    p.color.rgb[1], 
    p.color.rgb[2]
); // 255 100 40
&lt;/pre&gt;
&lt;/figure&gt;

&lt;figure&gt;
&lt;figcaption style=&quot;text-align: center; font-size: 12pt;&quot;&gt;
    &lt;i&gt;&lt;strong&gt;3.&lt;/strong&gt; Flexible array member&lt;/i&gt;
&lt;/figcaption&gt;
&lt;pre&gt;
struct vec {
    size_t len;
    int data[];
};

struct vec *vec_alloc(size_t n){
    struct vec *v = malloc(
        sizeof(struct vec) + n * sizeof(int)
    );
    if(v) v-&amp;gt;len = n;
    return v;
}
&lt;/pre&gt;
&lt;/figure&gt;

&lt;figure&gt;
&lt;figcaption style=&quot;text-align: center; font-size: 12pt;&quot;&gt;
    &lt;i&gt;&lt;strong&gt;4.&lt;/strong&gt; Type punning union&lt;/i&gt;
&lt;/figcaption&gt;
&lt;pre&gt;
union fbits {
    float f;
    uint32_t u;
};

union fbits fb = { .f = 3.14 };
printf(&quot;%u&quot;, fb.u);
&lt;/pre&gt;
&lt;/figure&gt;

&lt;figure&gt;
&lt;figcaption style=&quot;text-align: center; font-size: 12pt;&quot;&gt;
    &lt;i&gt;&lt;strong&gt;5.&lt;/strong&gt; Macro for container address&lt;/i&gt;
&lt;/figcaption&gt;
&lt;pre&gt;
#define container_of(ptr, type, member) \
    ((type*)((char*)ptr - offsetof(type, member)))

struct pck { char name; float val; int elems; };
struct pck p = { ... };
struct pck *ptr_p = container_of(&amp;amp;p.val, struct pack, val);
&lt;/pre&gt;
&lt;/figure&gt;

&lt;figure&gt;
&lt;figcaption style=&quot;text-align: center; font-size: 12pt;&quot;&gt;
    &lt;i&gt;&lt;strong&gt;6.&lt;/strong&gt; On-the-fly lambda&lt;/i&gt;
&lt;/figcaption&gt;
&lt;pre&gt;
int age = ({
    int born_in = 1999;
    2025 - born_in;	// last line is returned
});

printf(&quot;%d&quot;, age); // 26

#define lambda(ret_type, func_body) \
    ({ ret_type __func func_body; __func; })

int (*get_age)(int) = lambda(
    int, (int born_in){
        return 2025 - born_in; 
    }
);

get_age(1999);	// 26
&lt;/pre&gt;
&lt;/figure&gt;

&lt;figure&gt;
&lt;figcaption style=&quot;text-align: center; font-size: 12pt;&quot;&gt;
    &lt;i&gt;&lt;strong&gt;7.&lt;/strong&gt; Generic programming (C11)&lt;/i&gt;
&lt;/figcaption&gt;
&lt;pre&gt;
#define print(x) _Generic((x), \
    int: printf(&quot;%d&quot;, x), \
    float: printf(&quot;%f&quot;, x), \
    double: printf(&quot;%lf&quot;, x), \
    char: printf(&quot;%c&quot;, x), \
)
&lt;/pre&gt;
&lt;/figure&gt;

&lt;figure&gt;
&lt;figcaption style=&quot;text-align: center; font-size: 12pt;&quot;&gt;
    &lt;i&gt;&lt;strong&gt;8.&lt;/strong&gt; Good goto practice :)&lt;/i&gt;
&lt;/figcaption&gt;
&lt;pre&gt;
void *jump_table[] = { &amp;amp;&amp;amp;LBL_1, &amp;amp;&amp;amp;LBL_2, &amp;amp;&amp;amp;LBL_3 };
goto *jump_table[1];

LBL_1:
printf(&quot;lbl_1\n&quot;);	// will NOT print
LBL_2:
printf(&quot;lbl_2\n&quot;);	// will print
LBL_3:
printf(&quot;lbl_3\n&quot;);	// will print
&lt;/pre&gt;
&lt;/figure&gt;

&lt;figure&gt;
&lt;figcaption style=&quot;text-align: center; font-size: 12pt;&quot;&gt;
    &lt;i&gt;&lt;strong&gt;9.&lt;/strong&gt; Cursed memory access&lt;/i&gt;
&lt;/figcaption&gt;
&lt;pre&gt;
int i = 3;
float pi = 3.14;

int pi_without_p = *(int*)((char*)&amp;amp;pi - sizeof(int));
&amp;i; // optional: add this to tell compiler to put the damn variables in the stack
&lt;/pre&gt;
&lt;/figure&gt;

&lt;figure&gt;
&lt;figcaption style=&quot;text-align: center; font-size: 12pt;&quot;&gt;
    &lt;i&gt;&lt;strong&gt;10.&lt;/strong&gt; Memory alignment in struct&lt;/i&gt;
&lt;/figcaption&gt;
&lt;pre&gt;
struct __attribute__((packed)) packed {
    int8_t vals[8];
    char c;
};

struct __attribute__((aligned(32))) aligned {
    int8_t vals[8];
    char c;
};

printf(&quot;%zu %zu&quot;, 
    sizeof(struct packed),	// 33
    sizeof(struct aligned)	// 64
);
&lt;/pre&gt;
&lt;/figure&gt;

&lt;figure&gt;
&lt;figcaption style=&quot;text-align: center; font-size: 12pt;&quot;&gt;
    &lt;i&gt;&lt;strong&gt;11.&lt;/strong&gt; Fast table/list generation&lt;/i&gt;
&lt;/figcaption&gt;
&lt;pre&gt;
#define LIST 			\
    X(RED, &quot;red&quot;) 		\
    X(GREEN, &quot;green&quot;)	\
    X(BLUE, &quot;blue&quot;)		\

#define X(name, str) name,
enum Color { LIST };
#undef X

#define X(name, str) str,
const char *color_names[] = { LIST };
#undef X
&lt;/pre&gt;
&lt;/figure&gt;

&lt;figure&gt;
&lt;figcaption style=&quot;text-align: center; font-size: 12pt;&quot;&gt;
    &lt;i&gt;&lt;strong&gt;12.&lt;/strong&gt; Duff&apos;s device&lt;/i&gt;
&lt;/figcaption&gt;
&lt;pre&gt;
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 &amp;gt; 0);
    }
}
&lt;/pre&gt;
&lt;/figure&gt;

&lt;figure&gt;
&lt;figcaption style=&quot;text-align: center; font-size: 12pt;&quot;&gt;
    &lt;i&gt;&lt;strong&gt;13.&lt;/strong&gt; Implementation hiding&lt;/i&gt;
&lt;/figcaption&gt;
&lt;pre&gt;
typedef struct vec* vec_t;

static inline vec_t *vec_alloc(size_t n){
    vec_t { size_t len; int data[]; } *v = NULL;
    v = malloc(sizeof(vec_t) + n * sizeof(int));
    if(v) v-&amp;gt;len = n;
    return v;
}
&lt;/pre&gt;
&lt;/figure&gt;

&lt;figure&gt;
&lt;figcaption style=&quot;text-align: center; font-size: 12pt;&quot;&gt;
    &lt;i&gt;&lt;strong&gt;14.&lt;/strong&gt; Double-pointer cast trick&lt;/i&gt;
&lt;/figcaption&gt;
&lt;pre&gt;
#define READ_ONCE(x) (*(volatile typeof(x)*)&amp;amp;(x))
#define WRITE_ONCE(x, val) (*(typeof(x)*)&amp;amp;(x) = (val))

// forces the compiler to actually read/write memory every time
// (bypass optimizer removing &quot;redundant&quot; loads/stores)
&lt;/pre&gt;
&lt;/figure&gt;

&lt;figure&gt;
&lt;figcaption style=&quot;text-align: center; font-size: 12pt;&quot;&gt;
    &lt;i&gt;&lt;strong&gt;15.&lt;/strong&gt; Inline assembly&lt;/i&gt;
&lt;/figcaption&gt;
&lt;pre&gt;&lt;code&gt;
static inline uint32_t fast_div10(uint32_t n) {
    uint32_t q;
    asm volatile (
    &quot;movl $0xcccccccd, %%ecx\n&quot;	        // magic number
        &quot;mull %%ecx\n&quot;			// EDX:EAX = EAX * 0xCCCCCCCD
        &quot;shrl $3, %%edx\n&quot;		// q = EDX &amp;gt;&amp;gt; 3
        : &quot;=d&quot; (q)			// output: EDX &amp;rarr; q
        : &quot;a&quot; (n)			// input:  EAX &amp;larr; n
        : &quot;cc&quot;				// clobbers flags
    );
    return q;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;

&lt;figure&gt;
&lt;figcaption style=&quot;text-align: center; font-size: 12pt;&quot;&gt;
    &lt;i&gt;&lt;strong&gt;16.&lt;/strong&gt; Wicked arrays&lt;/i&gt;
&lt;/figcaption&gt;
&lt;pre&gt;
int arr[] = { 1, 2, 3 };
int *ptr = arr + 1;

printf(&quot;%d, %d, %d&quot;, ptr[-1], arr[1], 2[arr]); 
// prints 1, 2, 3
&lt;/pre&gt;
&lt;/figure&gt;

&lt;figure&gt;
&lt;figcaption style=&quot;text-align: center; font-size: 12pt;&quot;&gt;
    &lt;i&gt;&lt;strong&gt;17.&lt;/strong&gt; Raw pointer wizardry&lt;/i&gt;
&lt;/figcaption&gt;
&lt;pre&gt;
/* 
| func is a 2D array of functions (pointers) that 
| take a float number as an input and 
| return 2D array of functions (pointers), which 
| | take a float as their input and 
| | return a function (pointer) 
| | | taking an int as an input and 
| | | returning int*
*/
int *(*(*func[2][5])(float))(int *(*(*[2][5])(float))(int));

// ptr_func is the pointer holding the address of func
int *(*(*(*ptr_func)[2][5])(float))(int *(*(*[2][5])(float))(int)) = &amp;func;
&lt;/pre&gt;
&lt;/figure&gt;
</description>
        <pubDate>Thu, 20 Nov 2025 11:41:00 +0000</pubDate>
        <link>/blog/c/programming/2025/11/20/cool-c-tricks.html</link>
        <guid isPermaLink="true">/blog/c/programming/2025/11/20/cool-c-tricks.html</guid>
        
        
        <category>blog</category>
        
        <category>C</category>
        
        <category>programming</category>
        
      </item>
    
      <item>
        <title>Mazes</title>
        <description>&lt;p&gt;&lt;a target=&quot;_blank&quot; href=&quot;https://github.com/AliKhudiyev/alikhudiyev.github.io/blob/aaa84b9b602c177700509c376350f3e7df188e79/assets/code/grid_maze.c&quot;&gt;
    &lt;img width=&quot;60%&quot; src=&quot;/assets/code/grid_maze.gif&quot; alt=&quot;grid maze&quot; /&gt;
&lt;/a&gt;&lt;/p&gt;
&lt;hr style=&quot;opacity:20%;&quot; /&gt;

</description>
        <pubDate>Mon, 17 Nov 2025 10:00:00 +0000</pubDate>
        <link>/art/generated/2025/11/17/mazes.html</link>
        <guid isPermaLink="true">/art/generated/2025/11/17/mazes.html</guid>
        
        
        <category>art</category>
        
        <category>generated</category>
        
      </item>
    
      <item>
        <title>Dynamic Harmony</title>
        <description>&lt;p&gt;&lt;a target=&quot;_blank&quot; href=&quot;https://github.com/AliKhudiyev/alikhudiyev.github.io/blob/aaa84b9b602c177700509c376350f3e7df188e79/assets/code/dynamic_harmony.c&quot;&gt;
    &lt;img width=&quot;60%&quot; src=&quot;/assets/code/dynamic_harmony.gif&quot; alt=&quot;dynamic harmony&quot; /&gt;
&lt;/a&gt;&lt;/p&gt;
&lt;hr style=&quot;opacity:20%;&quot; /&gt;

&lt;p&gt;&lt;a target=&quot;_blank&quot; href=&quot;/assets/code/dynamic_harmony2.c&quot;&gt;
    &lt;img width=&quot;60%&quot; src=&quot;/assets/code/dynamic_harmony2.gif&quot; alt=&quot;dynamic harmony 2&quot; /&gt;
&lt;/a&gt;&lt;/p&gt;
&lt;hr style=&quot;opacity:20%;&quot; /&gt;

</description>
        <pubDate>Mon, 17 Nov 2025 10:00:00 +0000</pubDate>
        <link>/art/generated/2025/11/17/harmony.html</link>
        <guid isPermaLink="true">/art/generated/2025/11/17/harmony.html</guid>
        
        
        <category>art</category>
        
        <category>generated</category>
        
      </item>
    
      <item>
        <title>Survival of the Scalable</title>
        <description>&lt;blockquote&gt;
  &lt;p&gt;Scaling AI won’t work, but Scalable AI will.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;What do I mean by this? Well, you can’t keep pouring human labor to
scale AI systems manually whenever there is a new challenge that is even
more complex than what was represented by the previous training set used
to train the network. In this sense, we shouldn’t bet on scaling AI by
ourselves as a lasting strategy for true intelligence, also known as
AGI.&lt;/p&gt;

&lt;p&gt;In the game of evolution, the fittest is the survivor. In the evolution
of AI, I suspect, the fittest is the scalable. Scalable doesn’t need
(manual) scaling (by humans), because it scales autnomously, by itself.&lt;/p&gt;

&lt;p&gt;To determine whether your architecture/algorithm is scalable or it needs
(manual) scaling, you should ask this question to find out the answer:
What would the scaled up version of any instantiation of my
architecture/algorithm look like and is the transitioning to that bigger
version encoded within the architecture/algorithm? If the transitioning
to arbitrarily different scales is not encoded within your framework,
then it’ll require manual work to solve more computationally complex
tasks at some point in the future, almost surely.&lt;/p&gt;

&lt;p&gt;In my opinion, you don’t have to invent the most advanced AI system, so
advanced that no one can figure out how it could even possibly scale.
Instead, you should probably aim for the most dumb systems that can
scale very easily in a thousand different ways. Simplicity in
architecture design may have a downside of not being able to address
many cognitive challenges simultaneously, however, it has an advantage
over a complicated architecture in flexibility and (efficient
large-scale) operability.&lt;/p&gt;

&lt;p&gt;Simplicity requires making assumptions and having assumptions usually
implies compression. This is usually true because each new
assumption/rule carries a potential to be combined with other
assumptions/rules, giving us more implied facts. Since these new set of
facts do not need to be stored explicityly (because they are implied
already, and therefore, they could be derived by using the
assumptions/rules at any moment), we save up memory by not storing these
new facts explicityly; they are rather stored implictly by the means of
computational consequences of the (physically) stored assumptions/rules.&lt;/p&gt;
</description>
        <pubDate>Mon, 10 Nov 2025 21:28:00 +0000</pubDate>
        <link>/blog/ai/evolution/2025/11/10/survival-of-scalable.html</link>
        <guid isPermaLink="true">/blog/ai/evolution/2025/11/10/survival-of-scalable.html</guid>
        
        
        <category>blog</category>
        
        <category>AI</category>
        
        <category>evolution</category>
        
      </item>
    
      <item>
        <title>Broktor</title>
        <description>&lt;h3 style=&quot;text-align: center;&quot;&gt;Broke Doctor&lt;/h3&gt;
&lt;p&gt;&lt;a target=&quot;_blank&quot; href=&quot;/assets/comics/hello-world.svg&quot;&gt;
    &lt;img src=&quot;/assets/comics/hello-world.svg&quot; alt=&quot;nice to meet you&quot; /&gt;
&lt;/a&gt;&lt;/p&gt;
&lt;hr style=&quot;opacity:20%;&quot; /&gt;

&lt;h3 style=&quot;text-align: center;&quot;&gt;Paper Submission&lt;/h3&gt;
&lt;p&gt;&lt;a target=&quot;_blank&quot; href=&quot;/assets/comics/paper-submission.svg&quot;&gt;
    &lt;img src=&quot;/assets/comics/paper-submission.svg&quot; alt=&quot;paper submission&quot; /&gt;
&lt;/a&gt;&lt;/p&gt;
&lt;hr style=&quot;opacity:20%;&quot; /&gt;

&lt;h3 style=&quot;text-align: center;&quot;&gt;Academia&lt;/h3&gt;
&lt;p&gt;&lt;a target=&quot;_blank&quot; href=&quot;/assets/comics/academia-sinful-publish-or-perish.svg&quot;&gt;
    &lt;img src=&quot;/assets/comics/academia-sinful-publish-or-perish.svg&quot; alt=&quot;publish or perish&quot; /&gt;
&lt;/a&gt;&lt;/p&gt;
&lt;hr style=&quot;opacity:20%;&quot; /&gt;

&lt;p&gt;&lt;a target=&quot;_blank&quot; href=&quot;/assets/comics/academia-sinful-publish-or-perish-2.svg&quot;&gt;
    &lt;img src=&quot;/assets/comics/academia-sinful-publish-or-perish-2.svg&quot; alt=&quot;publish or perish (2)&quot; /&gt;
&lt;/a&gt;&lt;/p&gt;
&lt;hr style=&quot;opacity:20%;&quot; /&gt;

&lt;h3 style=&quot;text-align: center;&quot;&gt;Thesis-Minded&lt;/h3&gt;
&lt;p&gt;&lt;a target=&quot;_blank&quot; href=&quot;/assets/comics/thesis-minded.svg&quot;&gt;
    &lt;img src=&quot;/assets/comics/thesis-minded.svg&quot; alt=&quot;thesis-minded&quot; /&gt;
&lt;/a&gt;&lt;/p&gt;
&lt;hr style=&quot;opacity:20%;&quot; /&gt;

&lt;p&gt;&lt;a target=&quot;_blank&quot; href=&quot;/assets/comics/i-should-work.svg&quot;&gt;
    &lt;img src=&quot;/assets/comics/i-should-work.svg&quot; alt=&quot;i should work&quot; /&gt;
&lt;/a&gt;&lt;/p&gt;
&lt;hr style=&quot;opacity:20%;&quot; /&gt;

&lt;h3 style=&quot;text-align: center;&quot;&gt;But, Professor...&lt;/h3&gt;
&lt;p&gt;&lt;a target=&quot;_blank&quot; href=&quot;/assets/comics/but-professor-shannon-entropy.svg&quot;&gt;
    &lt;img src=&quot;/assets/comics/but-professor-shannon-entropy.svg&quot; alt=&quot;shannon entropy&quot; /&gt;
&lt;/a&gt;&lt;/p&gt;
&lt;hr style=&quot;opacity:20%;&quot; /&gt;

&lt;h3 style=&quot;text-align: center;&quot;&gt;Seminars&lt;/h3&gt;
&lt;p&gt;&lt;a target=&quot;_blank&quot; href=&quot;/assets/comics/seminars-no-paper-crappy-paper.svg&quot;&gt;
    &lt;img src=&quot;/assets/comics/seminars-no-paper-crappy-paper.svg&quot; alt=&quot;paper quality in publishing&quot; /&gt;
&lt;/a&gt;&lt;/p&gt;
&lt;hr style=&quot;opacity:20%;&quot; /&gt;

&lt;p&gt;&lt;img src=&quot;/assets/comics/seminars-expander-graph.svg&quot; /&gt;&lt;/p&gt;
&lt;hr style=&quot;opacity:20%;&quot; /&gt;

&lt;p&gt;&lt;a target=&quot;_blank&quot; href=&quot;/assets/comics/seminars-perfect-number.svg&quot;&gt;
    &lt;img src=&quot;/assets/comics/seminars-perfect-number.svg&quot; alt=&quot;number theory&quot; /&gt;
&lt;/a&gt;&lt;/p&gt;
&lt;hr style=&quot;opacity:20%;&quot; /&gt;

</description>
        <pubDate>Fri, 07 Nov 2025 10:05:00 +0000</pubDate>
        <link>/art/phd/comics/2025/11/07/broktor.html</link>
        <guid isPermaLink="true">/art/phd/comics/2025/11/07/broktor.html</guid>
        
        
        <category>art</category>
        
        <category>phd</category>
        
        <category>comics</category>
        
      </item>
    
  </channel>
</rss>
