<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>emre şahin's digital garden 🍃 - til</title>
    <link>https://emresahin.net/series/til/</link>
    <description>The til series</description>
    <language>en</language>
    <managingEditor>contact@emresahin.net (Emre Şahin)</managingEditor>
    <lastBuildDate>Tue, 15 Sep 2026 19:46:32 +0000</lastBuildDate>
    <atom:link href="https://emresahin.net/series/til/rss.xml" rel="self" type="application/rss+xml"/>
    <item>
      <title>TIL 12: Modern C Features</title>
      <published>2025-01-04T12:58:23+00:00</published>
      <updated>2025-01-04T12:58:23+00:00</updated>
      <author>Emre Şahin</author>
      <pubDate>Sat, 04 Jan 2025 12:58:23 +0000</pubDate>
      <link>https://emresahin.net/til-12/</link>
      <guid isPermaLink="true">https://emresahin.net/til-12/</guid>
      <description>🐢 There are some new features in C since I learned it in the 90s. One is variable-length arrays (VLAs). You can now set the length of an array at runtime. This makes some uses of pointers moot, but Linus Torvalds is reported to have said that the Linux kernel does not contain any VLAs. 🐇 It may b...</description>
      <category>Software Development</category>
      <category>C</category>
      <category>arrays</category>
      <category>variable length arrays</category>
      <category>complex numbers</category>
      <category>initialization</category>
      <category>dialog</category>
      <category>TIL</category>
      <content:encoded><![CDATA[<p>🐢 There are some new features in C since I learned it in the 90s. One is variable-length arrays (VLAs). You can now set the length of an array at runtime. This makes some uses of pointers moot, but Linus Torvalds is reported to have said that the Linux kernel does not contain any VLAs.</p>
<p>🐇 It may be useful, though. It looks like syntactic sugar for a <code>const</code> pointer plus <code>malloc</code>, but implicitness is usually not ideal. It also appears to use the stack.</p>
<p>🐢 I haven’t looked into the details, but it may be useful in some cases. I don’t think it can replace pointer usage if it uses the stack, though. Stack sizes are usually small, and having arrays that can fill them up is not a good approach. Another feature is complex number support. It seems from the lecture that this is also a bit of a half-baked feature.</p>
<p>🐇 What is the difference between this and using a struct with two float fields?</p>
<p>🐢 There are operators (+, -, *, or ==) that support these. Since there is no operator overloading in C, having a separate complex number type may be useful.</p>
<p>🐇 The example looks like <code>double complex cx = 1.0 + 3.0*I</code>; and yes, this may be useful if you’re frequently using complex numbers in your code. But I think it’s unnecessary in most cases. There shouldn’t be such a frequent need for complex numbers, right?</p>
<p>🐢 A good complex number library will probably provide more than the built-in type, such as vectors for these numbers. A dedicated library will still be needed in most cases, I believe.</p>
<p>🐇 Another feature added to C is that struct members can now be initialized by name or index. You can initialize an array like <code>int a[6] = { [3] = 29, [2] = 14 };</code>, and it will initialize only those specific members.</p>
<p>🐢 Ah, this is much more useful than complex numbers for the general case.</p>
<p>🐇 There is also a span syntax: <code>int a[10] = {1, 2, [2 ... 4] = 3, [5] = 30};</code>.</p>
<p>🐢 That is really neat.</p>
<p>🐇 It’s also possible to omit the initial length, so the initializer values determine the size of the array. For example, <code>int a[] = {1, 3, [30] = 55, [9090] = 1010};</code> will result in an array of length 9091.</p>
<p>🐢 How is this used with structs?</p>
<p>🐇 Instead of <code>[]</code>, in struct initializers, we use the dot notation, like <code>struct Point p1 = { .x=0, .y=10 };</code>.</p>
<p>🐢 This is really useful and would keep much of the initialization code simpler.</p>
<p>🐇 There is also a way to initialize arrays of structs, like:</p>
<pre><code class="language-c">struct points pts[5] = { [0].x = 10, [0].y = 20, [3].x = 100 };
</code></pre>
<p>🐢 This feature is a nice addition to C; I really like it.</p>]]></content:encoded>
    </item>
    <item>
      <title>TIL 11: Unhide Markdown Code Block Types in LazyVim</title>
      <published>2024-02-26T10:22:29+00:00</published>
      <updated>2024-02-26T10:22:29+00:00</updated>
      <author>Emre Şahin</author>
      <pubDate>Mon, 26 Feb 2024 10:22:29 +0000</pubDate>
      <link>https://emresahin.net/til-11/</link>
      <guid isPermaLink="true">https://emresahin.net/til-11/</guid>
      <description>To unhide Markdown code block types in LazyVim, you can set the conceallevel to 0 . Add the following to your configuration: vim.opt.conceallevel = 0</description>
      <category>Software Development</category>
      <category>Vim</category>
      <category>LazyVim</category>
      <category>Markdown</category>
      <category>Lua</category>
      <category>Neovim</category>
      <content:encoded><![CDATA[<p>To unhide Markdown code block types in LazyVim, you can set the <code>conceallevel</code> to <code>0</code>.</p>
<p>Add the following to your configuration:</p>
<pre><code class="language-lua">vim.opt.conceallevel = 0
</code></pre>]]></content:encoded>
    </item>
    <item>
      <title>TIL: Get the Latest Git Commit SHA-1</title>
      <published>2024-02-13T09:58:12+00:00</published>
      <updated>2024-02-13T09:58:12+00:00</updated>
      <author>Emre Şahin</author>
      <pubDate>Tue, 13 Feb 2024 09:58:12 +0000</pubDate>
      <link>https://emresahin.net/til-6/</link>
      <guid isPermaLink="true">https://emresahin.net/til-6/</guid>
      <description>This command retrieves the SHA-1 hash of the latest commit: git rev-parse HEAD</description>
      <category>Shell</category>
      <category>Version Control</category>
      <category>Git</category>
      <category>CLI</category>
      <category>SHA-1</category>
      <content:encoded><![CDATA[<p>This command retrieves the SHA-1 hash of the latest commit:</p>
<pre><code class="language-bash">git rev-parse HEAD
</code></pre>]]></content:encoded>
    </item>
    <item>
      <title>TIL 10: Structs in Go</title>
      <published>2021-01-10T18:44:55+00:00</published>
      <updated>2021-01-10T18:44:55+00:00</updated>
      <author>Emre Şahin</author>
      <pubDate>Sun, 10 Jan 2021 18:44:55 +0000</pubDate>
      <link>https://emresahin.net/til-10/</link>
      <guid isPermaLink="true">https://emresahin.net/til-10/</guid>
      <description>Structs in Go In Go, it is possible to embed structs within other structs: type person struct { first string last string age int } type employee struct { person employee_id int salary int } We can instantiate the employee type as follows: e := employee{ person: person{ first: "Ali", last: "Yeşil"...</description>
      <category>Golang</category>
      <category>struct</category>
      <category>anonymous struct</category>
      <category>embedded struct</category>
      <category>Go</category>
      <category>programming</category>
      <content:encoded><![CDATA[<h2 id="structs-in-go">Structs in Go</h2>
<p>In Go, it is possible to embed structs within other structs:</p>
<pre><code class="language-go">type person struct {
    first string
    last string
    age   int
}

type employee struct {
    person
    employee_id int
    salary      int
}
</code></pre>
<p>We can instantiate the <code>employee</code> type as follows:</p>
<pre><code class="language-go">e := employee{
    person: person{
        first: "Ali",
        last:  "Yeşil",
        age:   33,
    },
    employee_id: 001,
    salary:      4500,
}
</code></pre>
<p>We can then access the fields of the embedded struct as if they were fields of the outer struct:</p>
<pre><code class="language-go">// e.first is a shorthand for e.person.first
fmt.Println(e.first) 
</code></pre>
<p>One can also use anonymous structs without explicitly defining a type:</p>
<pre><code class="language-go">z := struct {
    a string
    b int
}{
    a: "aaa",
    b: 123,
}
</code></pre>
<p>If these won’t be reused elsewhere, using anonymous structs can keep the code clean.</p>]]></content:encoded>
    </item>
    <item>
      <title>TIL: Recursive vs. Non-recursive Mappings in Vim</title>
      <published>2021-01-04T18:43:07+00:00</published>
      <updated>2021-01-04T18:43:07+00:00</updated>
      <author>Emre Şahin</author>
      <pubDate>Mon, 04 Jan 2021 18:43:07 +0000</pubDate>
      <link>https://emresahin.net/til-7/</link>
      <guid isPermaLink="true">https://emresahin.net/til-7/</guid>
      <description>The difference between imap / inoremap , vmap / vnoremap , and nmap / nnoremap is the recursive definition. When we map using nmap w dd , the original function of w is lost. We cannot remap nmap v w and expect the functionality of the original w . A Vim Guide for Intermediate Users</description>
      <category>Vim</category>
      <category>map</category>
      <category>noremap</category>
      <category>commands</category>
      <category>recursive</category>
      <category>CLI</category>
      <content:encoded><![CDATA[<p>The difference between <code>imap</code>/<code>inoremap</code>, <code>vmap</code>/<code>vnoremap</code>, and <code>nmap</code>/<code>nnoremap</code> is the recursive definition. When we map using <code>nmap w dd</code>, the original function of <code>w</code> is lost. We cannot remap <code>nmap v w</code> and expect the functionality of the original <code>w</code>.</p>
<p><a href="https://thevaluable.dev/vim-intermediate/">A Vim Guide for Intermediate Users</a></p>]]></content:encoded>
    </item>
    <item>
      <title>TIL: Password Hashing with Bcrypt in Go</title>
      <published>2020-12-29T20:55:06+00:00</published>
      <updated>2020-12-29T20:55:06+00:00</updated>
      <author>Emre Şahin</author>
      <pubDate>Tue, 29 Dec 2020 20:55:06 +0000</pubDate>
      <link>https://emresahin.net/til-9/</link>
      <guid isPermaLink="true">https://emresahin.net/til-9/</guid>
      <description>You can use the bcrypt package for hashing passwords in Go. It also includes a cost parameter to increase the difficulty of the hashing algorithm, making it more resistant to brute-force attacks.</description>
      <category>Golang</category>
      <category>Security</category>
      <category>Encryption</category>
      <category>Hashing</category>
      <category>Passwords</category>
      <category>Bcrypt</category>
      <content:encoded><![CDATA[<p>You can use the <code>bcrypt</code> package for hashing passwords in Go. It also includes a <em>cost</em> parameter to increase the difficulty of the hashing algorithm, making it more resistant to brute-force attacks.</p>]]></content:encoded>
    </item>
    <item>
      <title>TIL: Enabling Spell Checking in Vim</title>
      <published>2020-12-26T01:07:26+00:00</published>
      <updated>2020-12-26T01:07:26+00:00</updated>
      <author>Emre Şahin</author>
      <pubDate>Sat, 26 Dec 2020 01:07:26 +0000</pubDate>
      <link>https://emresahin.net/til-8/</link>
      <guid isPermaLink="true">https://emresahin.net/til-8/</guid>
      <description>This command enables spell checking: :setlocal spell spelllang=en_us This enables the spell option and configures it to check for US English. Unrecognized words are highlighted with one of the following: SpellBad word not recognized |hl-SpellBad| SpellCap word not capitalised |hl-SpellCap| SpellR...</description>
      <category>Vim</category>
      <category>Spell Check</category>
      <category>English</category>
      <category>CLI</category>
      <content:encoded><![CDATA[<p>This command enables spell checking:</p>
<pre><code>:setlocal spell spelllang=en_us
</code></pre>
<p>This enables the <code>spell</code> option and configures it to check for US English.</p>
<p>Unrecognized words are highlighted with one of the following:</p>
<pre><code class="language-text">	SpellBad	word not recognized			|hl-SpellBad|
	SpellCap	word not capitalised			|hl-SpellCap|
	SpellRare	rare word				|hl-SpellRare|
	SpellLocal	wrong spelling for selected region	|hl-SpellLocal|
</code></pre>
<p>Vim only checks for spelling; it does not perform grammar checks.</p>]]></content:encoded>
    </item>
  </channel>
</rss>
