<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Matt Ellen-Tsivintzeli</title>
    <description>The latest articles on DEV Community by Matt Ellen-Tsivintzeli (@mellen).</description>
    <link>https://dev.to/mellen</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F17923%2F911fe024-62b5-4fd9-bb8c-6e7aa6008e67.jpeg</url>
      <title>DEV Community: Matt Ellen-Tsivintzeli</title>
      <link>https://dev.to/mellen</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mellen"/>
    <language>en</language>
    <item>
      <title>What does MLH stand for?</title>
      <dc:creator>Matt Ellen-Tsivintzeli</dc:creator>
      <pubDate>Fri, 20 Feb 2026 11:09:44 +0000</pubDate>
      <link>https://dev.to/mellen/what-does-mlh-stand-for-2cbg</link>
      <guid>https://dev.to/mellen/what-does-mlh-stand-for-2cbg</guid>
      <description>&lt;p&gt;With dev.to's news of &lt;a href="https://dev.to/devteam/a-new-chapter-dev-is-joining-forces-with-major-league-hacking-mlh-3kfd"&gt;joining with MLH&lt;/a&gt;, I want to know more about the community we're now a part of.&lt;/p&gt;

&lt;p&gt;I want to know what MLH stands for.&lt;/p&gt;

&lt;p&gt;I always thought it was the name of a game: Marry Lick Hug&lt;/p&gt;

&lt;p&gt;Is that right?&lt;/p&gt;

&lt;p&gt;Awful answers only!&lt;/p&gt;

</description>
      <category>jokes</category>
      <category>watercooler</category>
      <category>discuss</category>
      <category>mlh</category>
    </item>
    <item>
      <title>Alternative to H1 for website title</title>
      <dc:creator>Matt Ellen-Tsivintzeli</dc:creator>
      <pubDate>Sat, 15 Mar 2025 11:37:46 +0000</pubDate>
      <link>https://dev.to/mellen/alternative-to-h1-for-website-title-328b</link>
      <guid>https://dev.to/mellen/alternative-to-h1-for-website-title-328b</guid>
      <description>&lt;p&gt;I have a heading for my website and a heading for my blog articles on the came page.&lt;/p&gt;

&lt;p&gt;I know I should only use one &lt;code&gt;h1&lt;/code&gt; per page, and I want to use that for my blog article title.&lt;/p&gt;

&lt;p&gt;What is the element I should use for the heading of my website?&lt;/p&gt;

&lt;p&gt;My &lt;code&gt;header&lt;/code&gt; is currently this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;header&amp;gt;
      &amp;lt;h1&amp;gt;Matthew Ellen&amp;lt;/h1&amp;gt;
      &amp;lt;p&amp;gt;Software Developer&amp;lt;/p&amp;gt;
&amp;lt;/header&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Should I just use a &lt;code&gt;p&lt;/code&gt; and style it like the &lt;code&gt;h1&lt;/code&gt;? Is there a better element?&lt;/p&gt;

&lt;p&gt;Also, I've read &lt;a href="https://webdesign.tutsplus.com/the-truth-about-multiple-h1-tags-in-the-html5-era--webdesign-16824a" rel="noopener noreferrer"&gt;here&lt;/a&gt; that it is OK to have multiple &lt;code&gt;h1&lt;/code&gt; elements, if the document is structured correctly, e.g. &lt;code&gt;h1&lt;/code&gt; for the page and &lt;code&gt;h1&lt;/code&gt; for the article.&lt;/p&gt;

&lt;p&gt;Does that make sense? Is it accessible?&lt;/p&gt;

</description>
      <category>help</category>
      <category>programming</category>
      <category>html</category>
    </item>
    <item>
      <title>2025! What is it good for?</title>
      <dc:creator>Matt Ellen-Tsivintzeli</dc:creator>
      <pubDate>Sat, 04 Jan 2025 21:08:54 +0000</pubDate>
      <link>https://dev.to/mellen/2025-what-is-it-good-for-5flo</link>
      <guid>https://dev.to/mellen/2025-what-is-it-good-for-5flo</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/newyear"&gt;2025 New Year Writing challenge&lt;/a&gt;: Compiling 2025.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I haven't set goals for myself before. I expect either huge disappointment or inconsolable joy, nothing in between.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hobbies
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Finish the legendary relic in Guild Wars 2
&lt;/h3&gt;

&lt;p&gt;This one is a gimmie, and should be complete in about 14 weeks, so long as I play enough.&lt;/p&gt;

&lt;h3&gt;
  
  
  Knit a patch with a name in it
&lt;/h3&gt;

&lt;p&gt;I've been learning to knit, on and off, during 2024. I want to be able to combine two different colours of yarn so that I can create a patch that has someone's name in it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Do something with a story I wrote
&lt;/h3&gt;

&lt;p&gt;In 2023 I finished NaNoWriMo with 50000 words that don't really make a coherent story, so I will analyse what I have and turn it into something readable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Side projects
&lt;/h2&gt;

&lt;h3&gt;
  
  
  QR code generator
&lt;/h3&gt;

&lt;p&gt;I want to create a python library for generating QR codes with arbitrary data, possibly making multiple codes if the data is too much for one.&lt;/p&gt;

&lt;h3&gt;
  
  
  Proof of concept turn based Android game
&lt;/h3&gt;

&lt;p&gt;I want to make a turn based game for Android. I don't know what the game is yet, but the gimmick is that the turns are transmitted over SMS or email or blue tooth, so no need for a server.&lt;/p&gt;

&lt;h3&gt;
  
  
  Fix up my website.
&lt;/h3&gt;

&lt;p&gt;My current website (&lt;a href="https://matthewellen.co.uk" rel="noopener noreferrer"&gt;matthewellen.co.uk&lt;/a&gt;) looks awful. I need to take some time to put it to better use.&lt;/p&gt;

&lt;h2&gt;
  
  
  Career goals
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Learn Rust
&lt;/h3&gt;

&lt;p&gt;Pretty self explanatory. I have written a fair amount of C, but I'm currently mostly writing python and I'd like to keep up with trends in lower level languages.&lt;/p&gt;

&lt;h3&gt;
  
  
  Learn about managing people
&lt;/h3&gt;

&lt;p&gt;I think it might be time to face my fears and learn how to be a team lead, so I can find a better paying rôle, hopefully in the same company.&lt;/p&gt;

&lt;p&gt;That's about it. If I manage the knitting one I'll consider this year a success.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>newyearchallenge</category>
      <category>career</category>
    </item>
    <item>
      <title>Explain like I'm your junior: why is ?. good?</title>
      <dc:creator>Matt Ellen-Tsivintzeli</dc:creator>
      <pubDate>Tue, 29 Oct 2024 19:41:52 +0000</pubDate>
      <link>https://dev.to/mellen/explain-like-im-your-junior-why-is-good-5940</link>
      <guid>https://dev.to/mellen/explain-like-im-your-junior-why-is-good-5940</guid>
      <description>&lt;p&gt;I've been writing JS almost two decades at this point, but I still can't see why &lt;code&gt;?.&lt;/code&gt; is not the beginning of an anti-pattern, especially for method calls.&lt;/p&gt;

&lt;p&gt;I saw the post&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/jagroop2001" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F842521%2Fd8f92227-f47b-446d-8752-56f7e73fd4b7.jpg" alt="jagroop2001"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/jagroop2001/20-javascript-tricks-every-developer-must-know-4pcj" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;20 JavaScript Tricks Every Developer Must Know 🚀&lt;/h2&gt;
      &lt;h3&gt;Jagroop Singh ・ Oct 28&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#webdev&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#javascript&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#discuss&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#beginners&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;And one that caught my eye was number 2 "Optional Chaining with Function Calls":&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="na"&gt;getName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Alice&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getName&lt;/span&gt;&lt;span class="p"&gt;?.());&lt;/span&gt;   &lt;span class="c1"&gt;// Alice&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getAge&lt;/span&gt;&lt;span class="p"&gt;?.());&lt;/span&gt;    &lt;span class="c1"&gt;// undefined&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Which screams "I don't know the interface to my objects, and I don't care."&lt;/p&gt;

&lt;p&gt;You definitely should care about the interface to your objects.&lt;/p&gt;

&lt;p&gt;I can almost see an argument for robustness if a library API changes, but no, if you're using a library, you know the interface to the objects, fix your code.&lt;/p&gt;

&lt;p&gt;It just seems like a massive bug attractor.&lt;/p&gt;

&lt;p&gt;You never want something to be &lt;code&gt;undefined&lt;/code&gt;. Or have I missed a memo about that?&lt;/p&gt;

&lt;p&gt;And that goes double for methods. If two objects don't have the same behaviours, they need to be treated as different types, not just shrugging and saying "it'll be alright".&lt;/p&gt;

&lt;p&gt;Is testing for &lt;code&gt;null&lt;/code&gt; illegal these days? I know &lt;code&gt;null&lt;/code&gt; has been called a billion dollar mistake, but that is solved by an option type (like &lt;code&gt;Maybe&lt;/code&gt; in Haskell), not what looks like the inverse.&lt;/p&gt;

&lt;p&gt;An option type lets you know that this is something that could be null, so proceed with caution. It doesn't hide the fact, like &lt;code&gt;?.&lt;/code&gt; does.&lt;/p&gt;

&lt;p&gt;With all that said, I'm happy to be disabused of the notion that &lt;code&gt;?.&lt;/code&gt; is just kicking the can down the road when it comes to checking for &lt;code&gt;null&lt;/code&gt;, or is just bad design when it comes to &lt;code&gt;undefined&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;What is a good pattern, i.e. one that reduces bugs, that you can get using &lt;code&gt;?.&lt;/code&gt;?&lt;/p&gt;

</description>
      <category>programming</category>
      <category>help</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Free freecell</title>
      <dc:creator>Matt Ellen-Tsivintzeli</dc:creator>
      <pubDate>Sat, 07 Sep 2024 10:39:55 +0000</pubDate>
      <link>https://dev.to/mellen/free-freecell-4kb2</link>
      <guid>https://dev.to/mellen/free-freecell-4kb2</guid>
      <description>&lt;p&gt;A long time ago in exactly the same galaxy I started to try to make Freecell, as a way to learn Angular 1.3.&lt;/p&gt;

&lt;p&gt;I got so far and then I got distracted by other things, as is the way of side projects.&lt;/p&gt;

&lt;p&gt;I had some free time recently (I know, I wasn't expecting it either) and so I thought I'd give it another shot.&lt;/p&gt;

&lt;p&gt;I essentially started from scratch, because I'm no longer interested in Angular 1.3, and I tend to use VueJS for my web stuff if I need a framework.&lt;/p&gt;

&lt;p&gt;To see the results, it's on github.io: &lt;a href="https://mellen.github.io/freecell" class="ltag_cta ltag_cta--branded" rel="noopener noreferrer"&gt;click here to play freecell!&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;Ever since I learnt &lt;a href="https://learn.microsoft.com/en-us/dotnet/desktop/wpf/overview/?view=netdesktop-8.0" rel="noopener noreferrer"&gt;WPF&lt;/a&gt; a decade and a half ago, I have really liked the &lt;a href="https://learn.microsoft.com/en-us/dotnet/architecture/maui/mvvm" rel="noopener noreferrer"&gt;MVVM&lt;/a&gt; style of programming. VueJS allows for that style very easily, and even improves upon it, without the need for explicit events to update the UI.&lt;/p&gt;

&lt;p&gt;This means the game logic is completely separate from the view logic, which made writing this game a breeze.&lt;/p&gt;

&lt;p&gt;It wasn't all plane sailing, as I, for some reason, decided that I would store the cards in a 2D jagged array. Not a terrible idea, but each internal array is a column, and so when I was trying to get the cards to layout correctly in a CSS grid I couldn't just iterate over the outer then the inner one like&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;template v-for="cardCol in game.table"&amp;gt;
    &amp;lt;template v-for="card in cardCol"&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Because that would lay the columns out as rows. So I had to use indices (why doesn't VueJS start from 0???) rather than objects and loop over the external array on the inside loop:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;template v-for="rowi in game.getLargestColumnCount()"&amp;gt;
  &amp;lt;template v-for="coli in game.table.length"&amp;gt;
    &amp;lt;div v-if="game.table[coli-1].length == 0 &amp;amp;&amp;amp; rowi == 1" :class="'card column'+coli+' freecell'"&amp;gt;
      &amp;lt;img src="cards/blank.png" @click="game.selectDropClear(coli-1, rowi-1)" &amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;div v-else-if="game.getCard(coli-1, rowi-1) != ''" :class="'card '+cardClass(coli-1, rowi-1)"&amp;gt;
      &amp;lt;img :alt="cardToCardName(game.getCard(coli-1, rowi-1))" :src="'cards/'+game.getCard(coli-1, rowi-1)+'.png'" @click="game.selectDropClear(coli-1, rowi-1)"&amp;gt;
    &amp;lt;/div&amp;gt;
  &amp;lt;/template&amp;gt;
&amp;lt;/template&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;I think the other two bad design decision I've made are implementing autocomplete and having the click handlers just be one function in the game (i.e. the model), rather than in the view and have the view figure out which course of action to take.&lt;/p&gt;

&lt;p&gt;Having the game decide which action the player means (i.e. select a card (or stack of cards), place cards on another stack or deselect cards) has led to some spaghetti code that I might want to refactor at a later date.&lt;/p&gt;

&lt;p&gt;Initially I didn't want to implement autocomplete because I didn't want to think about the logic. But after playing a few games without it I got so bored tapping each card into the home row that I felt compelled to implement it.&lt;/p&gt;

&lt;p&gt;I should have stuck to my guns because it is just bad. It's a huge chunk of code that initially caused a bunch of bugs and head scratching. It's not even fully automatic. On the other hand, now I don't have to do nearly as much tapping.&lt;/p&gt;

&lt;p&gt;I did stick to my guns about not making the cards drag and dropable, because I made this mostly to play on my phone and my tablet, so tapping into place is just a lot easier UX-wise (at least my UX, ymmv).&lt;/p&gt;

&lt;p&gt;Over all I'm happy with the outcome, even if there are a few bugs lingering just out of sight.&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/Mellen" rel="noopener noreferrer"&gt;
        Mellen
      &lt;/a&gt; / &lt;a href="https://github.com/Mellen/freecell" rel="noopener noreferrer"&gt;
        freecell
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      An implementation of the card game Free Cell
    &lt;/h3&gt;
  &lt;/div&gt;
&lt;/div&gt;



</description>
      <category>showdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>games</category>
    </item>
    <item>
      <title>I got 84 followers and a reader isn't 1</title>
      <dc:creator>Matt Ellen-Tsivintzeli</dc:creator>
      <pubDate>Wed, 19 Jun 2024 07:46:58 +0000</pubDate>
      <link>https://dev.to/mellen/i-got-84-followers-and-a-reader-isnt-1-g7f</link>
      <guid>https://dev.to/mellen/i-got-84-followers-and-a-reader-isnt-1-g7f</guid>
      <description>&lt;p&gt;Is this a common occurrence?&lt;/p&gt;

&lt;p&gt;Yesterday I published a post. It didn't get many views (7 at time of writing). That's fine. Par for the course. I would like more people to read my posts, but I'm not eye catching or interesting enough, I get it.&lt;/p&gt;

&lt;p&gt;However, I gained 84 followers. My daily average follower increase is 0, so I'm pretty sure the reason is that I posted.&lt;/p&gt;

&lt;p&gt;So I make a post, 84 people see I made a post and followed me, but didn't read my post? (Or bookmark it for later)&lt;/p&gt;

&lt;p&gt;Why are you following me if you don't want to read my posts? What do you get out of this?&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>meta</category>
    </item>
    <item>
      <title>One Byte Explainer: Regular Expressions</title>
      <dc:creator>Matt Ellen-Tsivintzeli</dc:creator>
      <pubDate>Tue, 18 Jun 2024 09:33:50 +0000</pubDate>
      <link>https://dev.to/mellen/one-byte-explainer-regular-expressions-na3</link>
      <guid>https://dev.to/mellen/one-byte-explainer-regular-expressions-na3</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for &lt;a href="https://dev.to/challenges/cs"&gt;DEV Computer Science Challenge v24.06.12: One Byte Explainer&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Explainer
&lt;/h2&gt;

&lt;p&gt;A regular expression (regex) finds patterns in strings with one character of memory. It has an alphabet &amp;amp; defines a language. The alphabet can be any set of characters, including the empty string. Regexes can be joined, joining the alphabets and languages.&lt;/p&gt;

&lt;h2&gt;
  
  
  Additional Context
&lt;/h2&gt;

&lt;p&gt;Because original regular expressions only allowed for one character of memory, there were no look aheads or look behinds.&lt;/p&gt;

&lt;p&gt;A language that is defined by a regular expression is called a regular language.&lt;/p&gt;

&lt;p&gt;Regular expressions have notations to allow succinct ways of defining them. These notations vary depending on the implementation, but usually have the following forms:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;*&lt;/code&gt; - the character or group preceding this must appear at least 0 times.
e.g. &lt;code&gt;abc*&lt;/code&gt; would match &lt;code&gt;ab&lt;/code&gt;, &lt;code&gt;abc&lt;/code&gt;, &lt;code&gt;abcc&lt;/code&gt;, etc.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;+&lt;/code&gt; - the character or group preceding this must appear at least once.
e.g. &lt;code&gt;abc+&lt;/code&gt; would match &lt;code&gt;abc&lt;/code&gt;, &lt;code&gt;abcc&lt;/code&gt;, etc.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;?&lt;/code&gt; - the character or group preceding this must appear at most once.
e.g. &lt;code&gt;abc?&lt;/code&gt; would match &lt;code&gt;ab&lt;/code&gt; or &lt;code&gt;abc&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.&lt;/code&gt; - this matches any character.
e.g. &lt;code&gt;.&lt;/code&gt; would match &lt;code&gt;a&lt;/code&gt;, &lt;code&gt;b&lt;/code&gt;, &lt;code&gt;c&lt;/code&gt;, etc.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;[]&lt;/code&gt; - only match the characters inside the square brackets.
e.g. &lt;code&gt;[hjk]&lt;/code&gt; would match &lt;code&gt;h&lt;/code&gt;, &lt;code&gt;j&lt;/code&gt;, or &lt;code&gt;k&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;[^]&lt;/code&gt; - only match the characters not inside the square brackets.
e.g. &lt;code&gt;[^abc]&lt;/code&gt; would not match &lt;code&gt;a&lt;/code&gt;, &lt;code&gt;b&lt;/code&gt;, or &lt;code&gt;c&lt;/code&gt;, but would match anything else.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;()&lt;/code&gt; - the string inside the parentheses is a group
e.g. &lt;code&gt;(abc)&lt;/code&gt; would match &lt;code&gt;abc&lt;/code&gt; and the regular expression engine would assign that result a group.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;(|)&lt;/code&gt; - the group can be either what's on the left or what's on the right of the &lt;code&gt;|&lt;/code&gt;.
e.g. &lt;code&gt;(abc|def)&lt;/code&gt; would match &lt;code&gt;abc&lt;/code&gt; or &lt;code&gt;def&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>devchallenge</category>
      <category>cschallenge</category>
      <category>computerscience</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Use your own neural net to generate images</title>
      <dc:creator>Matt Ellen-Tsivintzeli</dc:creator>
      <pubDate>Mon, 01 Apr 2024 21:09:48 +0000</pubDate>
      <link>https://dev.to/mellen/use-your-own-neural-net-to-generate-images-41i4</link>
      <guid>https://dev.to/mellen/use-your-own-neural-net-to-generate-images-41i4</guid>
      <description>&lt;p&gt;As we all know, the most important thing in art is having an idea. Just an idea. A prompt is more important than years of expertise. It's OK to take all that expertise from someone else, put it though an algorithm and sell it off as your own, no recompense, no credit.&lt;/p&gt;

&lt;p&gt;So I give you generative art where you just have to hold that prompt in your head and select pictures that most evoke that idea in you and then, the master work will appear before your eyes. No artistic talent necessary. Also, this won't take half as much power as anything like midjourney or Dall-e.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://mellen.github.io/picturechoice/index.html" rel="noopener noreferrer"&gt;http://mellen.github.io/picturechoice/index.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I want 10 anime babes and 13 fantasy landscapes on my desk by 12am.&lt;/p&gt;

</description>
      <category>generativeart</category>
      <category>javascript</category>
      <category>images</category>
    </item>
    <item>
      <title>What is Black Friday?</title>
      <dc:creator>Matt Ellen-Tsivintzeli</dc:creator>
      <pubDate>Mon, 08 Jan 2024 10:24:50 +0000</pubDate>
      <link>https://dev.to/mellen/what-is-black-friday-i61</link>
      <guid>https://dev.to/mellen/what-is-black-friday-i61</guid>
      <description>&lt;p&gt;I'm British, so maybe I am missing something, but I thought I had an understanding about Black Friday.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It's a day.&lt;/li&gt;
&lt;li&gt;On that day consumers treat retail staff and each other badly.&lt;/li&gt;
&lt;li&gt;On that day corporations treat retail staff and consumers badly.&lt;/li&gt;
&lt;li&gt;It's the Friday after Thanks Giving in the USA.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If all of that is true, this advert from OVHcloud is worrying and confusing, because&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Black Friday for developers seems like I'm going to have a bad time, as a developer.&lt;/li&gt;
&lt;li&gt;Isn't USA Thanks Giving in October? It's January when I am seeing the ad.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1y2x1o8qbqyiapt097yx.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1y2x1o8qbqyiapt097yx.PNG" alt="An advert on dev.to from OVHcloud offering Black Friday deals to developers" width="359" height="630"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>watercooler</category>
      <category>discuss</category>
      <category>jokes</category>
    </item>
    <item>
      <title>How constant is const in C?</title>
      <dc:creator>Matt Ellen-Tsivintzeli</dc:creator>
      <pubDate>Wed, 15 Nov 2023 19:17:00 +0000</pubDate>
      <link>https://dev.to/mellen/how-constant-is-const-in-c-1f15</link>
      <guid>https://dev.to/mellen/how-constant-is-const-in-c-1f15</guid>
      <description>&lt;p&gt;Let's look at the simple statement&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const int a = 2;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you come from a C# perspective, you expect the keyword &lt;code&gt;const&lt;/code&gt; to mean that the value in &lt;code&gt;a&lt;/code&gt; will never change. It's a way to help the compiler optimise the code.&lt;/p&gt;

&lt;p&gt;In C, however, &lt;code&gt;const&lt;/code&gt; is not exactly what you would expect.&lt;br&gt;
For sure if you later wrote&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a = 4;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;then the compiler will throw an error, something along the lines of:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;error: assignment of read-only variable ‘a’&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;But the thing is, this is C, so if you want to shoot yourself in the foot, you can quite easily do it.&lt;/p&gt;

&lt;p&gt;(In C# it is possible to change the value of a &lt;code&gt;const&lt;/code&gt; with reflection, or unsafe code. It's a fair amount of code, but it &lt;em&gt;can&lt;/em&gt; be done.)&lt;/p&gt;

&lt;p&gt;This is all the work it takes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#include &amp;lt;stdio.h&amp;gt;
int main()
{
  const int a = 2;
  printf("a: %d\n", a);
  int* x = &amp;amp;a;
  *x = 4;
  printf("a: %d\n", a);
  return 0;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Just like that. Create a pointer, give it the address of your constant and set the value via the pointer.&lt;/p&gt;

&lt;p&gt;Now, depending on the compiler, and your compiler options, you will likely get a warning, something like:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;warning: initialization discards ‘const’ qualifier from pointer target type&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So, it doesn't go by unnoticed, but it compiles and the code will run just fine.&lt;/p&gt;

&lt;p&gt;This is part of the reason I use &lt;code&gt;#define&lt;/code&gt; for constants. The other is it's just what I've always done.&lt;/p&gt;

&lt;p&gt;I think, for C, it's helpful to think of &lt;code&gt;const&lt;/code&gt; as only referring to the variable name, and not the data behind the variable. It's akin to a promise that the variable won't be used to change the value, and not that the value will never change.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>c</category>
      <category>pointers</category>
      <category>tips</category>
    </item>
    <item>
      <title>It's a pointer to a type, not a variable with an asterisk in its name</title>
      <dc:creator>Matt Ellen-Tsivintzeli</dc:creator>
      <pubDate>Thu, 16 Mar 2023 11:08:48 +0000</pubDate>
      <link>https://dev.to/mellen/its-a-pointer-to-a-type-not-a-variable-with-an-asterisk-in-its-name-2h17</link>
      <guid>https://dev.to/mellen/its-a-pointer-to-a-type-not-a-variable-with-an-asterisk-in-its-name-2h17</guid>
      <description>&lt;p&gt;It's something that I've seen in C and C++ code. It doesn't make sense. I'm going to have a little rant about it.&lt;/p&gt;

&lt;p&gt;When you are declaring a pointer, put the asterisk next to the type, because you are modifying the type.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;int* x&lt;/code&gt; ✔ Yes very good.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;int *x&lt;/code&gt; ❌ No very bad.&lt;/p&gt;

&lt;p&gt;That's it.&lt;/p&gt;

&lt;p&gt;The following is my reasoning in more detail for people who need more convincing because they're too stuck in their ways.&lt;/p&gt;

&lt;p&gt;If I write &lt;code&gt;int* x&lt;/code&gt; I am writing "x is of type 'pointer to int'".&lt;/p&gt;

&lt;p&gt;If I write &lt;code&gt;int *x&lt;/code&gt; I am writing "*x is of type int" which makes no sense.&lt;/p&gt;

&lt;p&gt;I know the compiler doesn't care. I could write &lt;code&gt;int*x&lt;/code&gt; and the compiler would eat it up like a good doggy. &lt;strong&gt;I&lt;/strong&gt; care, because I'm reading the code.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;*&lt;/code&gt; is not part of the variable name.&lt;/p&gt;

&lt;p&gt;If I write &lt;code&gt;x = &amp;amp;intvariable&lt;/code&gt; that is different to writing &lt;code&gt;*x = &amp;amp;intvariable&lt;/code&gt;. The &lt;code&gt;*&lt;/code&gt; &lt;strong&gt;is not part of the variable name&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If I have done &lt;code&gt;typedef int* intptr;&lt;/code&gt; and then write &lt;code&gt;intptr *x&lt;/code&gt; I have created a pointer to a pointer to an int, NOT a pointer to an int called &lt;code&gt;*x&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;THE &lt;code&gt;*&lt;/code&gt; IS NOT PART OF THE VARIABLE NAME.&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;So don't make it look like it is.&lt;/p&gt;

&lt;p&gt;Thank you for your time.&lt;/p&gt;

</description>
      <category>c</category>
      <category>programming</category>
      <category>justmycorrectopinion</category>
    </item>
    <item>
      <title>Sleeps until Christmas: awful answers only</title>
      <dc:creator>Matt Ellen-Tsivintzeli</dc:creator>
      <pubDate>Thu, 22 Dec 2022 11:40:27 +0000</pubDate>
      <link>https://dev.to/mellen/sleeps-until-christmas-awful-answers-only-3oa</link>
      <guid>https://dev.to/mellen/sleeps-until-christmas-awful-answers-only-3oa</guid>
      <description>&lt;p&gt;It's &lt;em&gt;that&lt;/em&gt; time of year. Some people are counting down sleeps until Christmas day.&lt;/p&gt;

&lt;p&gt;I think it would be great if we could help them out with a function or programme of some kind that can help them keep count.&lt;/p&gt;

&lt;p&gt;Something that will accept a date and output the number of sleeps until Christmas from that date, or if you don't want to do Christmas, some other date you find important.&lt;/p&gt;

&lt;p&gt;One caveat is that the code should, for some reason, get you on Santa's naughty list.&lt;/p&gt;

&lt;p&gt;The function should work like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;sleepsTillChristmas&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;date&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;//e.g. 2022-04-15&lt;/span&gt;
&lt;span class="c1"&gt;//output for the example is 264&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>challenge</category>
      <category>jokes</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
