<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Neo on Medium]]></title>
        <description><![CDATA[Stories by Neo on Medium]]></description>
        <link>https://medium.com/@imneo?source=rss-423ab8aa9c60------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ze1Fds5KVCUjF1Sg661DKQ.jpeg</url>
            <title>Stories by Neo on Medium</title>
            <link>https://medium.com/@imneo?source=rss-423ab8aa9c60------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 03:39:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@imneo/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Integrating tldraw with Angular]]></title>
            <link>https://javascript.plainenglish.io/integrating-tldraw-with-angular-0410d841dc51?source=rss-423ab8aa9c60------2</link>
            <guid isPermaLink="false">https://medium.com/p/0410d841dc51</guid>
            <category><![CDATA[tldraw-angular]]></category>
            <category><![CDATA[tldraw]]></category>
            <category><![CDATA[tldraw-web-component]]></category>
            <category><![CDATA[whiteboard-angular]]></category>
            <category><![CDATA[angular]]></category>
            <dc:creator><![CDATA[Neo]]></dc:creator>
            <pubDate>Sat, 22 Mar 2025 13:06:48 GMT</pubDate>
            <atom:updated>2025-03-24T00:45:01.187Z</atom:updated>
            <content:encoded><![CDATA[<p>I recently worked on adding tldraw to a massive Angular codebase, and it was super easy, thanks to tldraw-web-component</p><p>tldraw is an awesome whiteboard app that lets you… draw stuff. It is heavily customisable as well. Integrating it with Angular can be pain. However, this link should help you get started:</p><p><a href="https://github.com/neosh11/tldraw-web-component">GitHub - neosh11/tldraw-web-component: Library enabling the use of tldraw on multiple frameworks.</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*C-UU5al1AHXG1mt7" /><figcaption>tldraw in an Angular app</figcaption></figure><p>To start using tldraw in Angular, just install `tldraw-web-component`</p><pre>npm i tldraw-web-component<br>yarn add tldraw-web-component</pre><p>Once it is installed, you can create the Angular wrapper around the web-component.</p><pre>import { Component, CUSTOM_ELEMENTS_SCHEMA, ElementRef, OnDestroy, OnInit, ViewChild, ViewEncapsulation } from &#39;@angular/core&#39;;<br>import { CommonModule } from &#39;@angular/common&#39;;<br>import { RouterOutlet } from &#39;@angular/router&#39;;<br>import { TldrawWebcomponentGetPropsFunc } from &#39;tldraw-web-component&#39;;<br>@Component({<br>  selector: &#39;app-root&#39;,<br>  standalone: true,<br>  imports: [CommonModule, RouterOutlet],<br>  templateUrl: &#39;./app.component.html&#39;,<br>  schemas: [CUSTOM_ELEMENTS_SCHEMA],<br>  styleUrls: [<br>    &#39;./app.component.css&#39;,<br>  ],<br>  encapsulation: ViewEncapsulation.None<br>})<br><br>export class AppComponent implements OnInit, OnDestroy {<br>  @ViewChild(&#39;tldraw&#39;) tldraw!: ElementRef;<br>  /**<br>   * This function name is attached to the global scope,<br>   * required due to the nature of web-components.<br>   */<br>  globalGetPropsFuncName = `__SECRET_DOM_DO_NOT_USE_GET_PROPS_FUNC_${this.generateRandomString()}`;<br><br>  async ngOnInit(): Promise&lt;void&gt; {<br>    await import(&#39;tldraw-web-component&#39;);<br>    const container = document.querySelector(&#39;#tldraw&#39;);<br>    if (!container) {<br>      console.log(&#39;No container found&#39;);<br>      return;<br>    }<br><br>    const tldrawElement = document.createElement(&#39;tldraw-sync-web-component&#39;);<br>    (window as any)[this.globalGetPropsFuncName] = this.getPropsFunc.bind(this);<br>    tldrawElement.setAttribute(&#39;get-props-func&#39;, this.globalGetPropsFuncName);<br>    container.appendChild(tldrawElement);<br>  }<br><br>  ngOnDestroy(): void {<br>    delete (window as any)[this.globalGetPropsFuncName];<br>  }<br><br>  public getPropsFunc: TldrawWebcomponentGetPropsFunc = () =&gt; {<br>    return {<br>      serverUri: &#39;http://localhost:5172/connect/hello&#39;,<br>      tldrawUserPreferences: {<br>        id: &quot;Math.random()&quot;,<br>        name: &quot;John Doe&quot;,<br>      },<br>      assets: {<br>        upload: async () =&gt; ({<br>          src: &quot;url&quot;,<br>        }),<br>        resolve: async () =&gt; &quot;url&quot;,<br>      },<br>      tldrawProps: {}<br>    }<br>  }<br><br>  private generateRandomString(): string {<br>    return Math.random().toString(36).replace(/[^a-z]+/g, &#39;&#39;) + Date.now().toString();<br>  }<br>}</pre><p>And that’s it!</p><p>You can find a more complete example on <a href="https://github.com/neosh11/tldraw-web-component">https://github.com/neosh11/tldraw-web-component</a></p><p>If you run into issues, feel free to create an issue here:</p><p><a href="https://github.com/neosh11/tldraw-web-component/issues">https://github.com/neosh11/tldraw-web-component/issues</a></p><h3>Thank you for being a part of the community</h3><p><em>Before you go:</em></p><ul><li>Be sure to <strong>clap</strong> and <strong>follow</strong> the writer ️👏<strong>️️</strong></li><li>Follow us: <a href="https://x.com/inPlainEngHQ"><strong>X</strong></a> | <a href="https://www.linkedin.com/company/inplainenglish/"><strong>LinkedIn</strong></a> | <a href="https://www.youtube.com/@InPlainEnglish"><strong>YouTube</strong></a> | <a href="https://newsletter.plainenglish.io/"><strong>Newsletter</strong></a> | <a href="https://open.spotify.com/show/7qxylRWKhvZwMz2WuEoua0"><strong>Podcast</strong></a> | <a href="https://differ.blog/inplainenglish"><strong>Differ</strong></a> | <a href="https://twitch.tv/inplainenglish"><strong>Twitch</strong></a></li><li><a href="https://cofeed.app/"><strong>Check out CoFeed, the smart way to stay up-to-date with the latest in tech</strong></a> <strong>🧪</strong></li><li><a href="https://differ.blog/"><strong>Start your own free AI-powered blog on Differ</strong></a> 🚀</li><li><a href="https://discord.gg/in-plain-english-709094664682340443"><strong>Join our content creators community on Discord</strong></a> 🧑🏻‍💻</li><li>For more content, visit <a href="https://plainenglish.io/"><strong>plainenglish.io</strong></a> + <a href="https://stackademic.com/"><strong>stackademic.com</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0410d841dc51" width="1" height="1" alt=""><hr><p><a href="https://javascript.plainenglish.io/integrating-tldraw-with-angular-0410d841dc51">Integrating tldraw with Angular</a> was originally published in <a href="https://javascript.plainenglish.io/">JavaScript in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Supporting multiple LLMs — How to make code written for ChatGPT work with Claude.]]></title>
            <link>https://towardsdev.com/supporting-multiple-llms-how-to-make-code-written-for-chatgpt-work-with-claude-a963b6813b64?source=rss-423ab8aa9c60------2</link>
            <guid isPermaLink="false">https://medium.com/p/a963b6813b64</guid>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[migration]]></category>
            <category><![CDATA[claude]]></category>
            <dc:creator><![CDATA[Neo]]></dc:creator>
            <pubDate>Mon, 26 Aug 2024 18:23:26 GMT</pubDate>
            <atom:updated>2024-08-26T18:23:26.359Z</atom:updated>
            <content:encoded><![CDATA[<h3>Supporting multiple LLMs — How to make code written for ChatGPT work with Claude.</h3><p>Migrating from ChatGPT to Anthropic isn’t as easy as it seems. This post is for you if you are seeing “Conversation blocks and tool result blocks cannot be provided in the same turn”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Mxmu-onVXkn9okGGSvinQ.png" /></figure><p>I’ve been working with ChatGPT for a while now — their API is extremely developer friendly — and they allow developers to make mistakes. However, Claude seems to be a bit different and feels very restrictive.</p><p>This post is for people who have already built their codebase around ChatGPT, not for those just starting or working on hobby projects.</p><p>If you’re just working on hobby projects, I would recommend just using something like <a href="https://sdk.vercel.ai/">Vercel AI SDK</a> (previously <a href="https://github.com/vercel/modelfusion">ModelFusion</a>)</p><p>The 3 major issues I had to deal with were:</p><ol><li>Messages have to begin with a user message</li><li>Messages must alternate between user and assistant.</li><li>Tool calls are also user/assistant and must alternate.</li></ol><p>Ofcourse, depending on your language, you would have to write your own data transformers — which is a more tedious process.</p><h4>Issue 1: Messages have to begin with a user message.</h4><p>Claude has 2 types of roles — assistant/user.</p><p>If you are using ChatGPT to generate messages based on system prompts, you will need to alter your code — Why? — Claude doesn’t support conversations that begin with nothing like below :(</p><pre>response = client.messages.create(<br>    model=&quot;claude-3-5-sonnet-20240620&quot;,<br>    max_tokens=2048,<br>    system=&quot;You are a seasoned data scientist at a Fortune 500 company. Begin the conversation introducing yourself.&quot;, <br>    # BAD!<br>    messages=[]<br>)</pre><p>To get around this, you can do the following:</p><pre>response = client.messages.create(<br>    model=&quot;claude-3-5-sonnet-20240620&quot;,<br>    max_tokens=2048,<br>    system=&quot;You are a seasoned data scientist at a Fortune 500 company. Begin the conversation introducing yourself.&quot;, <br>    messages=[<br>      {&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: &quot;Start.&quot;}     <br>    ]<br>)</pre><p>Saying Start. seems to make Claude respond to the system prompt.</p><h4>Issue 2: Messages must alternate between user and assistant</h4><p>ChatGPT lets you send multiple messages from a single role in a row. Claude for some reason does not like this. So the below is illegal :(</p><pre>response = client.messages.create(<br>    model=&quot;claude-3-5-sonnet-20240620&quot;,<br>    max_tokens=2048,<br>    system=&quot;You are a seasoned data scientist at a Fortune 500 company. Begin the conversation introducing yourself.&quot;, <br>    messages=[<br>      {&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: &quot;Start.&quot;},<br>      {&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: &quot;How are you?&quot;} <br>    ]<br>)</pre><p>To get around this, you can do the following</p><pre>response = client.messages.create(<br>    model=&quot;claude-3-5-sonnet-20240620&quot;,<br>    max_tokens=2048,<br>    system=&quot;You are a seasoned data scientist at a Fortune 500 company. Begin the conversation introducing yourself.&quot;, <br>    messages=[{&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: [<br>      {<br>       &quot;type&quot;: &quot;text&quot;,<br>       &quot;text&quot;: &quot;Start.&quot;<br>       },{<br>       &quot;type&quot;: &quot;text&quot;,<br>       &quot;text&quot;: &quot;How are you?&quot;<br>       }<br>    ]}]<br>)</pre><p>If you have multiple messages in a row, you can merge their content into a single conversation block.</p><h4>Issue 3: Tool Calls alternate between user / assistant</h4><p>A tool call has 2 parts:</p><p><strong>tool_use</strong> : assistant message</p><p><strong>tool_result</strong> : user message</p><p>What is super annoying is that <strong>tool_result</strong> and <strong>user messages</strong> cannot be in the same block.</p><p><a href="https://github.com/langchain-ai/langchain-aws/issues/141">Converse operation: messages.2.content: Conversation blocks and tool result blocks cannot be provided in the same turn. · Issue #141 · langchain-ai/langchain-aws</a></p><p>This means that if a user sends messages right after the tool result — it can break your conversation.</p><p>To get around this you can do something sneaky — Inject the user messages into the content block of the tool result</p><pre>{<br>  &quot;role&quot;: &quot;user&quot;,<br>  &quot;content&quot;: [<br>    {<br>      &quot;type&quot;: &quot;tool_result&quot;,<br>      &quot;tool_use_id&quot;: &quot;toolu_01A09q90qw90lq917835lq9&quot;,<br>      &quot;content&quot;: [<br>       {&quot;type&quot;: &quot;text&quot;, &quot;text&quot;: &quot;15 degrees&quot;},<br>       # Continue conversation here<br>       {&quot;type&quot;: &quot;text&quot;, &quot;text&quot;: &quot;Let me know when you get this!&quot;},<br>      ]<br>    }<br>  ]<br>}</pre><p>Note, the above is a hack and may create a vulnerability where the user can influence the tool result if they understand it — This should not be a huge issue however.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a963b6813b64" width="1" height="1" alt=""><hr><p><a href="https://towardsdev.com/supporting-multiple-llms-how-to-make-code-written-for-chatgpt-work-with-claude-a963b6813b64">Supporting multiple LLMs — How to make code written for ChatGPT work with Claude.</a> was originally published in <a href="https://towardsdev.com/">Towards Dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Rise of Chinese Universities in the Shanghai Ranking of World Universities.]]></title>
            <link>https://imneo.medium.com/the-rise-of-chinese-universities-in-the-shanghai-ranking-of-world-universities-cc57d65dae78?source=rss-423ab8aa9c60------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc57d65dae78</guid>
            <category><![CDATA[top-universities]]></category>
            <category><![CDATA[kaggle]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[university]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[Neo]]></dc:creator>
            <pubDate>Sun, 25 Aug 2024 09:46:57 GMT</pubDate>
            <atom:updated>2024-08-25T10:05:06.779Z</atom:updated>
            <content:encoded><![CDATA[<p>What Is Driving the Steep Rise of Chinese Universities in the ARWU Rankings?</p><p>I have made my data available publicly if someone can come up with better insights — <a href="https://www.kaggle.com/datasets/neosh11/academic-ranking-of-world-universities-2003-2024">https://www.kaggle.com/datasets/neosh11/academic-ranking-of-world-universities-2003-2024</a></p><p>This morning, I downloaded data on university rankings and the factors influencing these rankings from the Academic Ranking of World Universities (ARWU). The ARWU, developed by the Center for World-Class Universities (CWCU) at Shanghai Jiao Tong University, is a globally recognized ranking system. Notably, it is also one of the ranking systems used by the UK government for assessing eligibility under their High Potential Individual Visa program (more details can be found here: <a href="https://www.gov.uk/high-potential-individual-visa/eligibility">https://www.gov.uk/high-potential-individual-visa/eligibility</a>.</p><p><a href="https://immigrationbarrister.co.uk/high-potential-individual-visa-global-universities-list-2023-revealed/">https://immigrationbarrister.co.uk/high-potential-individual-visa-global-universities-list-2023-revealed/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OadGF_5Dku2-rbKHI-eOqA.png" /><figcaption>ARWU — one of the lists for the UK HPI visa</figcaption></figure><p>Given that these rankings can have a significant real-world impact — such as influencing immigration decisions — it is crucial to understand what factors contribute to a university’s standing in these rankings</p><h3>China</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mxrWCxH_YVKV_jfmB3EOWA.png" /><figcaption>There is something strange here.</figcaption></figure><p>When looking at the graph, we notice that Chinese universities have experienced quite a lot of growth in the last 10 years — with 6 universities now sitting in the top 50 in <a href="https://www.shanghairanking.com/news/arwu/2024">2024</a> :</p><ul><li>#22 — Tsinghua University</li><li>#24 — Peking University</li><li>#27 — Zhejiang University</li><li>#38 — Shanghai Jiao Tong University</li><li>#42 — Univ Sci &amp; Tech China</li><li>#50 — Fudan Unviersity</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IoK_a2GRe1AsG-J8PO40Vg.png" /></figure><p>To break this down, we will explore the underlying <a href="https://www.shanghairanking.com/methodology/arwu/2023">metrics</a> that apparently make up this rank:</p><ul><li><strong>Award</strong>: Number of the staff of an institution winning Nobel Prizes in Physics, Chemistry, Medicine and Economics and Fields Medal in Mathematics. Staff is defined as those who work at an institution at the time of winning the prize.</li><li><strong>Alumni</strong>: Number of the alumni of an institution winning Nobel Prizes and Fields Medals. Alumni are defined as those who obtain bachelor’s, master’s or doctoral degrees from the institution.</li><li><strong>HiCi</strong>: Number of Highly Cited Researchers selected by Clarivate. The Highly Cited Researchers list issued in January 2024 was used for the calculation of HiCi indicator in ARWU 2024.</li><li><strong>N&amp;S</strong>: Number of research articles published in Nature and Science in the last 5 years (between 2019 and 2023 for 2024)</li><li><strong>PUB</strong>: Number of papers indexed in Science Citation Index-Expanded™ and Social Science Citation Index™ (Web of Science) in 2023. Only publications of ‘Article’ type are considered.</li><li><strong>PCP: </strong>Weighted scores of the above five indicators divided by the number of full-time equivalent academic staff.</li></ul><p>Now we will look at the 6 universities of China.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*yYi1_p7lsRw5uBqnEvA3IQ.png" /></figure><h4>Award</h4><p>We notice that the value for award is 0 for all universities — no other chinese university has an award value of 0 in the top 50. I was shocked when I saw this. So I checked the website to make sure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OH4-PfEPCXfDbVk4_Zvn-w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rmIcLFSZRhJEs6NlRhvnBw.png" /></figure><h4>Alumni</h4><p>Once again — mostly 0 except Tsinghua University and Peking University.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AJsxGvAQV2K9kQAo6Aq-rg.png" /></figure><p>The only other non CN university with this value in the top 50 is — ETH Zurich.</p><h4><strong>HiCi / N&amp;S / PUB / PCB</strong></h4><p>We have seen that alumni values aren’t contributing — so the main contributors to the ranks are:</p><ul><li>HiCi</li><li>N&amp;S</li><li>PUB</li><li>PCB</li></ul><p>Here we note that PUB for a lot of these universities is extremely high → <strong>&gt;50 </strong>Number of papers indexed in Science Citation Index-Expanded.</p><p>What does this mean? I am not sure — but maybe that the ranks are being carried purely because of the number of papers these universities are publishing?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ajq_XoBEGyooBZUrA1MvGA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eIWAoXRY1NSncw5-VCcTeA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8M2uRPdy4NCEepI512ZP1w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pi9j8Ce2wM6c3Lvp9Oa1Fw.png" /></figure><h4>Conclusion</h4><p>My conclusion from this data is that the steep rise of Chinese university ranks has been due to: <strong>HiCi, N&amp;S, PUB — </strong>where perhaps PUB is the greatest contributor.</p><p>I have made my data available publicly if someone can come up with better insights — <a href="https://www.kaggle.com/datasets/neosh11/academic-ranking-of-world-universities-2003-2024">https://www.kaggle.com/datasets/neosh11/academic-ranking-of-world-universities-2003-2024</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc57d65dae78" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learn Golang by building Redis from scratch.]]></title>
            <link>https://imneo.medium.com/learn-golang-by-building-redis-from-scratch-39a0ef446bb8?source=rss-423ab8aa9c60------2</link>
            <guid isPermaLink="false">https://medium.com/p/39a0ef446bb8</guid>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[learning-to-code]]></category>
            <dc:creator><![CDATA[Neo]]></dc:creator>
            <pubDate>Fri, 02 Aug 2024 12:12:45 GMT</pubDate>
            <atom:updated>2024-08-04T03:04:08.563Z</atom:updated>
            <content:encoded><![CDATA[<h3>CS96: Learn Golang</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*tAe-iDJcszpz-jcmMqJViA.png" /></figure><pre>+This is still work in progress</pre><p>Follow the youtube course:</p><p><a href="https://youtube.com/playlist?list=PL00bxK04ZnkihJ3XK985lwoBF5VGnn-_7&amp;si=xRldeRzGvBuo8mZb">https://youtube.com/playlist?list=PL00bxK04ZnkihJ3XK985lwoBF5VGnn-_7&amp;si=xRldeRzGvBuo8mZb</a></p><p><strong>TOC</strong></p><p>· <a href="#34a7">W1: Introduction</a><br>· <a href="#301c">W1: Setting up your environment</a><br> ∘ <a href="#1507">IDE</a><br> ∘ <a href="#c02b">Go</a><br>· <a href="#61be">W1: Fundamentals of programming</a><br>· <a href="#ac08">W1: Handling Network Connections</a><br> ∘ <a href="#04bb">Setup</a><br>· <a href="#2b27">W1: TCP/IP</a><br> ∘ <a href="#4a15">TCP</a><br>· <a href="#88e9">W1: Concurrency</a><br> ∘ <a href="#aa80">What is a program</a><br> ∘ <a href="#7591">Goroutines</a><br> ∘ <a href="#c6fd">Channels</a></p><h3>W1: Introduction</h3><p>Welcome to CS96. This is a small 10 week course designed to teach people how to write Golang.</p><ul><li>You will learn golang and build redis from scratch.</li><li>etc.</li></ul><p>Assumptions:</p><ul><li>You have already studied another programming language before.</li></ul><p>Learning outcomes:</p><ul><li>Understand the structure of Golang programs.</li><li>Write simple Golang programs.</li><li>Understand concurrency vs asynchrony.</li><li>Understand the fundamentals: know the 25 keywords, passing by reference vs passing by value, functions, variables, standard packages etc.</li><li>Write tests to ensure that your program works.</li></ul><p>Week 1:</p><pre>+------+------------------------------------------------------+<br>| Week |                       Learning                       |<br>+------+------------------------------------------------------+<br>|    1 | Setting up your environment; Fundamentals of Golang; |<br>|    2 | Handling network connections; TCP/IP; Concurrency;   |<br>+------+------------------------------------------------------+</pre><h3>W1: Setting up your environment</h3><p>There are only 2 things that you will need:</p><ol><li>Text Editor / IDE</li><li>Golang</li></ol><h4>IDE</h4><p>You can use quite a few IDEs, the ones I recommend</p><ul><li>GoLand <a href="https://www.jetbrains.com/go/">https://www.jetbrains.com/go/</a></li><li>VSCode <a href="https://code.visualstudio.com/">https://code.visualstudio.com/</a></li></ul><p>It doesn’t matter what you use, they are just text editors.</p><h4>Go</h4><p>I’m using 1.22, you should be able to install any version of golang <a href="https://go.dev/doc/install">https://go.dev/doc/install</a></p><h3>W1: Fundamentals of programming</h3><p>Before you start this module, you should have an understading of golang.</p><p>Go through the following:</p><ul><li><a href="https://go.dev/tour/basics/2">https://go.dev/tour/basics</a></li><li><a href="https://go.dev/tour/flowcontrol/1">https://go.dev/tour/flowcontrol</a></li><li><a href="https://go.dev/tour/moretypes/1">https://go.dev/tour/moretypes</a></li><li><a href="https://go.dev/tour/methods/1">https://go.dev/tour/methods</a></li><li><a href="https://go.dev/tour/generics/1">https://go.dev/tour/generics</a></li></ul><h3>W1: Handling Network Connections</h3><h4>Setup</h4><pre>mkdir repo<br>cd repo<br>go mod init github.com/neosh11/Learn-Go-Redis</pre><p>Note that this will create a go.mod file which declares the module path.</p><p><strong>Package</strong> := Source files in the same directory. Functions, types, variables, and constants defined in one source file are visible to all other source files within the same package.</p><p><strong>Repository := </strong>Set of <strong>modules</strong>.</p><p><strong>Module </strong>:= A module is a collection of related Go packages that are released together.</p><p>server.go</p><pre>package main<br><br>import (<br> &quot;fmt&quot;<br> &quot;net&quot;<br>)<br><br>func main() {<br> // create a TCP connection - Redis 6379<br> listener, err := net.Listen(&quot;tcp&quot;, &quot;0.0.0.0:6379&quot;)<br><br> fmt.Println(&quot;Listening on port 6379&quot;)<br> if err != nil {<br>  panic(err)<br> }<br><br> // accept incoming connections<br> for {<br>  conn, err := listener.Accept()<br>  if err != nil {<br>   panic(err)<br>  }<br>  // handle the connection<br>  go handleConnection(conn)<br> }<br>}</pre><p>hander.go</p><pre>package main<br><br>import (<br>    &quot;bufio&quot;<br>    &quot;fmt&quot;<br>    &quot;net&quot;<br>)<br><br>func handleConnection(conn net.Conn) {<br>    reader := bufio.NewReader(conn)<br>    defer func() {<br>       err := conn.Close()<br>       if err != nil {<br>          panic(err)<br>       }<br>    }()<br>    for {<br>       line, _, err := reader.ReadLine()<br>       if err != nil {<br>          return<br>       }<br>       fmt.Println(string(line))<br>    }<br>}</pre><p>Extension:</p><p>What is the point of using bufio?</p><p><a href="https://www.kelche.co/blog/go/golang-bufio/">Golang Bufio (A Complete Guide)</a></p><h3>W1: TCP/IP</h3><p>So we just managed to handle network connections. That’s cool. But what just happened?</p><p><a href="https://www.cloudflare.com/en-au/learning/ddos/glossary/tcp-ip/">https://www.cloudflare.com/en-au/learning/ddos/glossary/tcp-ip/</a></p><p>IP := Address system of the internet. it helps to deliver packets from source to destination.</p><p>TCP := Handles packet ordering / error-checking.</p><h4>TCP</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FQZCupGa_BHA%3Fstart%3D15%26feature%3Doembed%26start%3D15&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DQZCupGa_BHA&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FQZCupGa_BHA%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/11f0dd466867514ef88a812f1597e849/href">https://medium.com/media/11f0dd466867514ef88a812f1597e849/href</a></iframe><p>TCP is used in conjunction with IP in order to maintain a connection between the sender and the target and to ensure packet order. This is done by a 3-way-handshake.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vhYk7xvQZi5hi1BRlqQ79w.png" /><figcaption>3-way-handshake</figcaption></figure><blockquote>The client SYNs, the server will ACK this and also start it’s own SYN, the client will then ACK the server’s SYN</blockquote><p><strong>SYN</strong></p><ul><li><strong>Sets the Sequence Number</strong>: For the packets sent, everything that is sent will be tracked as an offset from this initial sequence number.</li><li><strong>Sets the TCP flag</strong>: SYN = TRUE — This flag indicates that the sender wants to establish a connection and synchronize sequence numbers.</li><li><strong>Sets the window size</strong>: Specifies the amount of data (in bytes) that the sender can accept, primarily managed by the OS.</li></ul><p><strong>SYN-ACK</strong></p><ul><li><strong>Acknowledges the SYN request</strong>: The receiver acknowledges the SYN request by sending back a packet with both SYN and ACK flags set.</li><li><strong>Sets the Acknowledgment Number</strong>: The receiver sends an acknowledgment number, which is the initial sequence number received plus one.</li><li><strong>Sets its own Sequence Number</strong>: The receiver sets its own initial sequence number for its packets.</li><li><strong>Sets the TCP flags</strong>: SYN = TRUE, ACK = TRUE — This combination indicates acknowledgment of the connection request and synchronization of sequence numbers.</li><li><strong>Sets the window size</strong>: Specifies the amount of data (in bytes) that the receiver can accept.</li></ul><p><strong>ACK</strong></p><ul><li><strong>Acknowledges the SYN-ACK</strong>: The sender acknowledges the SYN-ACK packet by sending back a packet with the ACK flag set.</li><li><strong>Sets the Acknowledgment Number</strong>: The sender sends an acknowledgment number, which is the sequence number received in the SYN-ACK plus one.</li><li><strong>Continues with the original Sequence Number</strong>: The sender continues with its initial sequence number and increments it as data is sent.</li><li><strong>Sets the TCP flag</strong>: ACK = TRUE — This flag indicates that the sender acknowledges the connection establishment.</li><li><strong>Sets the window size</strong>: Specifies the amount of data (in bytes) that the sender can accept.</li></ul><p>Once the connection is established, we can send packets!</p><p>The protocol will help to order all the packets, deal with error handling etc.</p><h3>W1: Concurrency</h3><ul><li><a href="https://go.dev/tour/concurrency/1">https://go.dev/tour/concurrency</a></li></ul><h4>What is a program</h4><p>A program is a set of instructions stored in the the disk.</p><p>When the program is loaded into memory and executed by the processor — it becomes a process.</p><p>A process is built up of threads and other information about the process.</p><p>The number of threads that a CPU can run at any given time is equal to the number of “<strong>cores</strong>”</p><p>A 4 core CPU can only run 4 threads at a time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*468aolcWLXMj4Viz6hsSeA.png" /><figcaption>A process</figcaption></figure><p>The CPU schedulers uses <strong>context-switching</strong> to switch between <strong>threads while executing</strong>. Context-switching is very costly.</p><blockquote>Even node.js — which people might call `single-threaded` still needs multiple threads.</blockquote><blockquote>* 4 threads for LIBUV(fs, zlib, crypto) -&gt; either to execute cpu intensive job(crypto) or File I/O job(because underlying OS does not support async for it)</blockquote><blockquote>* 1 thread for javascript execution</blockquote><blockquote>* 1 thread for garbage collector</blockquote><blockquote>* 1 thread for event loop -&gt; which is mainly used, so nodejs is usually regarded as 1 thread(event loop) per 1 process runtime.</blockquote><h4>Goroutines</h4><p><strong>Initialize with<br></strong>go func(){}()</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FqcGaM87zWwU%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DqcGaM87zWwU&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FqcGaM87zWwU%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/105b8dd9df21c90b34353761b260eef8/href">https://medium.com/media/105b8dd9df21c90b34353761b260eef8/href</a></iframe><p>Goroutines are not threads!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F5LfqrEGwDmE%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D5LfqrEGwDmE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F5LfqrEGwDmE%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/4e51379b008714805ba94a46d2a33714/href">https://medium.com/media/4e51379b008714805ba94a46d2a33714/href</a></iframe><p>They are not as expensive as threads.</p><p>Goroutines aim to maximize thread usage on a computer. If a computer has 4 cores, goroutines will be managed in the background in local queues to maximize core usage. So goroutines run on a shared set of threads.</p><p>You can set the number of threads available by setting <strong>GOMAXPROCS.</strong></p><p>Goroutines run in the same address space, so access to shared memory must be synchronized.</p><h4>Channels</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F3Qn6Sn9j6GY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D3Qn6Sn9j6GY&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/dac622e0635f6da6c9541238fd2e53dd/href">https://medium.com/media/dac622e0635f6da6c9541238fd2e53dd/href</a></iframe><p><strong>Initialize with<br></strong>make(chan T)</p><p><a href="https://go.dev/tour/concurrency/2">A Tour of Go</a></p><p>When working with Go routines you can often run into issues with accessing shared data, communicating between Go routines etc.</p><p>Act a pub-sub system to use between go routines.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=39a0ef446bb8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Next.js with Any Serverless Backend]]></title>
            <link>https://javascript.plainenglish.io/next-js-with-any-serverless-backend-394cbcbb22da?source=rss-423ab8aa9c60------2</link>
            <guid isPermaLink="false">https://medium.com/p/394cbcbb22da</guid>
            <category><![CDATA[go]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[nextjs-with-python]]></category>
            <category><![CDATA[nextjs-with-go]]></category>
            <dc:creator><![CDATA[Neo]]></dc:creator>
            <pubDate>Tue, 01 Aug 2023 10:37:48 GMT</pubDate>
            <atom:updated>2023-08-02T08:57:32.255Z</atom:updated>
            <content:encoded><![CDATA[<h4>Next.js with Python, Next.js with Go, Next.js with Node.js, Next.js with Ruby, the possibilities are endless.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8PkJa2EWR_qNDAYg" /><figcaption>Photo by <a href="https://unsplash.com/@artturijalli?utm_source=medium&amp;utm_medium=referral">Artturi Jalli</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I recently discovered the fact that the serverless functions on Vercel are heavily customisable.</p><p>I had been using the default style APIs for a while until I came across the need for a Python backend — due to the fancy mathematical libraries you can install on Python.</p><h3>Step 1</h3><p>Install the vercel CLI</p><p><a href="https://vercel.com/docs/concepts/functions/serverless-functions/quickstart">https://vercel.com/docs/concepts/functions/serverless-functions/quickstart</a></p><h3>Step 2</h3><p>All you need to do is:</p><ol><li>Create a folder called <strong>/api</strong> in the root of the Next.js app</li><li>Create a route as <strong>/api/name/index.py</strong></li></ol><pre>from http.server import BaseHTTPRequestHandler<br> <br>class handler(BaseHTTPRequestHandler):<br> <br>    def do_GET(self):<br>        self.send_response(200)<br>        self.send_header(&#39;Content-type&#39;,&#39;text/plain&#39;)<br>        self.end_headers()<br>        self.wfile.write(&#39;This is being served by python!&#39;.encode(&#39;utf-8&#39;))<br>        return</pre><p>If you like Go,</p><pre>package handler<br><br>import (<br> &quot;fmt&quot;<br> &quot;net/http&quot;<br>)<br><br>func GET(w http.ResponseWriter, r *http.Request) {<br> fmt.Fprintf(w, &quot;&lt;h1&gt;Hello from Go!&lt;/h1&gt;&quot;)<br>}</pre><p>That’s it, to test it, you need to use:</p><pre>vercel dev</pre><p>You can now use any language of your choice!</p><p>Go: <a href="https://personal-blog-henna-chi.vercel.app/api/go">https://personal-blog-henna-chi.vercel.app/api/go</a></p><p>Python: <a href="https://personal-blog-henna-chi.vercel.app/api/python">https://personal-blog-henna-chi.vercel.app/api/python</a></p><p><em>More content at </em><a href="https://plainenglish.io/"><strong><em>PlainEnglish.io</em></strong></a><em>.</em></p><p><em>Sign up for our </em><a href="http://newsletter.plainenglish.io/"><strong><em>free weekly newsletter</em></strong></a><em>. Follow us on </em><a href="https://twitter.com/inPlainEngHQ"><strong><em>Twitter</em></strong></a>, <a href="https://www.linkedin.com/company/inplainenglish/"><strong><em>LinkedIn</em></strong></a><em>, </em><a href="https://www.youtube.com/channel/UCtipWUghju290NWcn8jhyAw"><strong><em>YouTube</em></strong></a><em>, and </em><a href="https://discord.gg/GtDtUAvyhW"><strong><em>Discord</em></strong></a><strong><em>.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=394cbcbb22da" width="1" height="1" alt=""><hr><p><a href="https://javascript.plainenglish.io/next-js-with-any-serverless-backend-394cbcbb22da">Next.js with Any Serverless Backend</a> was originally published in <a href="https://javascript.plainenglish.io/">JavaScript in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[Beginner] [2023] How to easily set up S3 for serving images in a secure manner.]]></title>
            <link>https://imneo.medium.com/beginner-2023-how-to-easily-set-up-s3-for-serving-images-in-a-secure-manner-89b82707a662?source=rss-423ab8aa9c60------2</link>
            <guid isPermaLink="false">https://medium.com/p/89b82707a662</guid>
            <category><![CDATA[s3]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Neo]]></dc:creator>
            <pubDate>Wed, 19 Jul 2023 08:48:05 GMT</pubDate>
            <atom:updated>2023-07-19T08:48:05.471Z</atom:updated>
            <content:encoded><![CDATA[<p>AWS is complicated, there are a lot of services to consider.</p><p>However in order to build a simple image sharing site you need to consider a few important things.</p><p>I’ll be covering some basics here.</p><ol><li>S3 Bucket</li><li>CloudFront</li><li>Permissions / IAM / Policies</li><li>CORS</li></ol><h3>S3 (Simple Storage Service)</h3><p>What makes AWS cool is the ability to store any type of object. I have not explored AWS streaming in detail but that is possible too!</p><p>But let’s just create a simple bucket.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Te2LESQ21B_vmEO46HQgdg.png" /></figure><p>Pick your <strong>region</strong>, and a <strong>Bucket name</strong> — which must be <strong>unique</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-z6kCUhONGjxrnwo8jksYw.png" /></figure><p>For now, we will not change anything. We don’t want to give public access to the bucket just yet!</p><p>Upload an object, and see that you can’t access it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9UcvY2YGcKtXfUK6vkkaPw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kVo3_ASQoHYKLuLha4MlWg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bbHcacb6Ycothnp2X5vR3w.png" /></figure><p>Note when you try to access it, you may get permission denied. <strong>We haven’t made it public yet!</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*upEJ8NjSKvAXT2zqsVzY6w.png" /></figure><h3>CloudFront</h3><p>Now we will create a CF instance, this allows us to add protection and also cache data. CF also automatically serve smaller sized images if requested!</p><p>Choose the bucket, make sure you select <strong>Origin Access Control</strong>, and create a control setting with the defaults.</p><p>NOTE: IF YOU <strong>DON’T HAVE</strong> AN <strong>ORIGIN ACCESS CONTROL</strong>, <strong>CREATE ONE</strong> WITH THE <strong>DEFAULT VALUES</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lhxYaFkvBzDpWkgwvU9f7Q.png" /></figure><p>Careful of enabling other products because they can add up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aNUlUnErfhl0lOdF7qYE6w.png" /></figure><p>You can leave the defaults on and continue.</p><p>NOTE: You might want to pay $8 a month for WAF — this will prevent DDOS Attacks, for the time being you could just monitor your costs and set up alarms — if you’re not getting attacked.</p><h3>Permissions</h3><p>Open CF, select origins, click edit</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4tLIzMWcKOPDTcUY9Pes4w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ln9OpNCQC7zOOrORCdA7Rw.png" /></figure><p><strong>copy policy</strong> and click on <strong>go to s3 bucket permissions</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*laxuk5IC9H3A91RbuUlAvQ.png" /></figure><p>Edit the bucket policy and paste your policy</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C4uWYDpqw30eTdiqQpSE5g.png" /></figure><p>You can now make your objects public! Yay!</p><p>Now, in order to allow your other services and users to upload images, you <strong>may need to explicitly grant them permissions.</strong></p><h3>CORS</h3><p>Under <strong>permissions </strong>in your bucket.</p><p>Modify your CORS Settings — you may want to select allowed headers, methods and origin to further secure your app!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dZ9pVZdPoBsdE0qVUK2uGg.png" /></figure><h3>Conclusion</h3><p>Following this should allow you to get objects from your cloudfront distribution and prevent access to the bucket directly. This will prevent someone from perfroming a DDOS on your bucket, or accessing items in your buckets.</p><p>However, if you now want the ability to upload objects, you will need to explicitly allow your services in the bucket policy.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=89b82707a662" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a d3js dashboard with React in 2024.]]></title>
            <link>https://imneo.medium.com/building-a-d3js-dashboard-with-react-in-2023-93a0324c7469?source=rss-423ab8aa9c60------2</link>
            <guid isPermaLink="false">https://medium.com/p/93a0324c7469</guid>
            <category><![CDATA[visualization]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[d3js]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Neo]]></dc:creator>
            <pubDate>Mon, 29 May 2023 06:04:48 GMT</pubDate>
            <atom:updated>2024-07-22T12:58:43.545Z</atom:updated>
            <content:encoded><![CDATA[<p>Lately I’ve been experimenting with data visualisation and somehow, there was not a lot of information on building d3js dashboards with react! Most of the documentation was outdated or did not have basic features like how to deal with responsiveness.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VszF1FQWx2mi4MwJ0__y1A.png" /><figcaption>A cute little dashboard I build with reactjs and d3js. You can see how different car companies tend to evolve their cars!</figcaption></figure><p><strong>You can base everything off the repo I have provided :) Just fork it or build off it — </strong><a href="https://github.com/neosh11/VA2">https://github.com/neosh11/VA2</a></p><p>Note, I have used <strong>pure javascript here to keep it beginner friendly</strong>, but feel free to use typescript (I actually prefer this)</p><p>However the overarching principles are as follows:</p><ul><li>Define a <strong>parent container with a useRef</strong> in order get it’s <strong>width and height</strong>.</li><li>Define you <strong>svg</strong>.</li><li>Use <strong>d3js to add to your svg</strong> and ensure you use a <strong>hook to update it whenever the parent container’s values change</strong>.</li><li>Remember to <strong>cache all your data — </strong>I would recommend <strong>dexie.js</strong> + <strong>context</strong> to handle the data inside the app for simplicity.</li></ul><h3>Specs</h3><p><strong>Live Demo</strong>: <a href="https://va-2.vercel.app/">https://va-2.vercel.app/</a></p><p><strong>Code</strong>: <a href="https://github.com/neosh11/VA2">https://github.com/neosh11/VA2</a></p><p><strong>Dataset</strong>: <a href="https://www.kaggle.com/datasets/jahaidulislam/car-specification-dataset-1945-2020">https://www.kaggle.com/datasets/jahaidulislam/car-specification-dataset-1945-2020</a></p><p><strong>Tools</strong>:</p><ul><li>Nextjs</li><li>Tailwindcss</li><li>dexie js to cache the 28mb file in the browser</li><li>d3 for visualizations</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93a0324c7469" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Magic of Transformers (And the bad) + Discussion on how to use ChatGPT]]></title>
            <link>https://imneo.medium.com/the-magic-of-transformers-and-the-bad-discussion-on-how-to-use-chatgpt-36e78f5f279f?source=rss-423ab8aa9c60------2</link>
            <guid isPermaLink="false">https://medium.com/p/36e78f5f279f</guid>
            <category><![CDATA[transformers]]></category>
            <category><![CDATA[chatgpt]]></category>
            <dc:creator><![CDATA[Neo]]></dc:creator>
            <pubDate>Thu, 25 May 2023 03:27:29 GMT</pubDate>
            <atom:updated>2023-05-29T13:27:40.109Z</atom:updated>
            <content:encoded><![CDATA[<p>I have spent a good 150+ hours on training transformers for the task of multimodal classification in the past few months. It helped me understand the strengths and weaknesses and the direction AI is taking.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/329/1*VPex11-9Ogl5CTcdjcGQOA.jpeg" /><figcaption>My cute model — it figured out how to understand images with labels and text!</figcaption></figure><p>If you’ve heard of chatGPT, you’re not new to transformers, this model is based on the transformer model — which has been described in the paper “Attention Is All You Need”.</p><h4>The Pros:</h4><ul><li>Transformers are great at <strong>long range dependencies</strong> — they can understand the relationships between things even if they are really “far” from eachother — unlike the old fashioned RNNs which have the best understanding of just the last few tokens.</li><li><strong>Attention and querying</strong> — allows you to apply self-attention and focus on specific parts and see how it makes the whole. As an add on, I managed to use the text to query the image model itself and teach my models some contextual understanding between vision and text. This in the future could mean a transformer can figure out dependecies between significantly different modalities.</li></ul><h4>The Cons:</h4><ul><li>For simple tasks with completely new data, LSTMs perform better at NLP tasks.</li><li>It has <strong>no “short-term” memory</strong>. LSTMs and RNNs can store information in a hidden layer and process things one token at a time. A transformer is more like a genius savant.</li><li>No ability to “learn” from new information</li></ul><h3>Do transformers really have intelligence?</h3><p>This might be a hot take but from my understanding so far, they do not. The issue with systems like ChatGPT (including 4) is that it has no short term memory, nor long term memory. It’s closer to a genius with dementia.</p><p>These issues come to light when you get it to do something that requires more than X number of tokens — something akin to deep thinking or rumination.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g2NgbjQmS3bMwzDSc36DHg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UlXpZGMPHa8QZd6YvstFmw.png" /><figcaption>@lyevercrimson ??</figcaption></figure><p>In the above image you can see, <strong>ChatGPT 3.5</strong> literally forgot what the question was after printing out enough tokens. It decided to leak some random information too!</p><p>This also explains why it may be<strong> bad at writing code that may be novel</strong> or <strong>requires critical thinking</strong>.</p><p>Now, I’m no genius, but I would argue that having a <strong>short term memory</strong> and having the <strong>ability to learn</strong> or <strong>self correct</strong> is necessary for a system to be somewhat intelligent.</p><p>Even if that is achieved, it would be a long way to AGI — as these systems have no inherent understanding of time and space — Everything is stateless.</p><h3>Using ChatGPT correctly</h3><ul><li>Only use it for simple tasks which are stateless and don’t require deep thinking. It will go off the rails and forget the question after a certain number of tokens.</li><li>Treat it like a genius savant that remembers a lot of things but cannot actually use them or come up with insights — an add on to google.</li><li>The public version is stuck in 2021. Universities haven’t picked up on this, but I see my peers doing assignments using outdated or deprecated functions and it’s clear where they got the code from.</li><li>If you’re a researcher, keep in mind the cut off date. You will only be looking at stuff pre-2021. In today’s world that’s generations away.</li><li>Keep responses short.</li><li>Don’t use it to perform logic or arithmetic — it has no short term memory. It may work for a bit then go off the rails.</li></ul><p>To be continued…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36e78f5f279f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What I learnt from competing in my first Kaggle Competition.]]></title>
            <link>https://imneo.medium.com/what-i-learnt-from-competing-in-my-first-kaggle-competition-fe68fa3ccfcf?source=rss-423ab8aa9c60------2</link>
            <guid isPermaLink="false">https://medium.com/p/fe68fa3ccfcf</guid>
            <category><![CDATA[kaggle-competition]]></category>
            <category><![CDATA[kaggle]]></category>
            <dc:creator><![CDATA[Neo]]></dc:creator>
            <pubDate>Tue, 02 May 2023 02:39:02 GMT</pubDate>
            <atom:updated>2023-05-02T02:39:02.998Z</atom:updated>
            <content:encoded><![CDATA[<p>I just placed #35 in a competition with 934 teams.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7eELY3TgKaVmN103QQZJ2g.png" /><figcaption>Help! I’m trying to learn</figcaption></figure><h3>OVERFITTING!</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0tvY9G4gBuzsdFG4Oes6kA.png" /></figure><p>The public leaderboard can throw off your intuition as it contains only a few samples! <strong>Trust your CV and methodology</strong>.</p><p>There were a lot of concerns over score probing in the discussion, however, it seems that the cheaters all ended up overfitting to the x% of the total test set.</p><h3>You can learn a lot!</h3><p>I learnt so much from this competition</p><ul><li>learnt there is such a thing as CatBoost</li><li>I learnt about hyper parameter optimisation using optimise your optimisation libraries :)</li><li>I learnt about LDA from <a href="https://www.kaggle.com/oscarm524">@oscarm524</a></li><li>I learnt about feature engineering from <a href="https://www.kaggle.com/belati">@belati</a></li><li>I learnt about feature selection</li></ul><p><strong>It’s a lengthy but highly rewarding process</strong></p><h3>Community</h3><p>The community over at Kaggle is super helpful! You can learn from discussion boards, other people’s notebooks, etc.</p><p>Every few clicks I end up seeing super unique ideas that completely blow me away!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fe68fa3ccfcf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Zero Pull-ups to Muscle-ups and One-arm Pull-ups in Just One Year.]]></title>
            <link>https://imneo.medium.com/from-zero-pull-ups-to-muscle-ups-and-one-arm-pull-ups-in-just-one-year-b59f90d8171?source=rss-423ab8aa9c60------2</link>
            <guid isPermaLink="false">https://medium.com/p/b59f90d8171</guid>
            <category><![CDATA[fitness]]></category>
            <dc:creator><![CDATA[Neo]]></dc:creator>
            <pubDate>Wed, 26 Apr 2023 17:31:31 GMT</pubDate>
            <atom:updated>2023-05-29T13:30:38.651Z</atom:updated>
            <content:encoded><![CDATA[<p>Well 16 consecutive muscle ups. I need to document that someday, for now you’ll have to trust me :D</p><ul><li><a href="https://youtube.com/shorts/WOy_RdsjcFQ?feature=share">First 1 Arm Pull Up</a></li><li><a href="https://youtube.com/shorts/dsljOs6v6Q8?feature=share">Muscle Ups</a></li></ul><p>You might have noticed from the videos above that I don’t exactly resemble a “jacked” fitness model. But to appreciate my progress, you need to know where I began.</p><p>Growing up, I was never encouraged to pursue sports, just academics. Lagging behind my peers physically, I eventually convinced myself that I was simply incapable of anything athletic (I could barely run 500m).</p><p>However, committing to working out for 30 minutes a day for an entire year radically transformed what I thought I was capable of. I didn’t rely on supplements or fancy protein shakes, but I did increase my protein intake.</p><h3>1 year — Before and After</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KQ1d95h5uvPI7QLnQdxJAQ.png" /></figure><h3>Help I had</h3><p>I didn’t have a personal trainer or any fancy assistance, but I did have loads of support along the way. You could say I made it this far by standing on the shoulders of giants — from books, interviews, and movies 😛</p><h3>Discipline vs Motivation</h3><p>To be honest, if given a choice, I’d rather not work out. Motivation can be fickle; it comes and goes, and it just isn’t enough to fuel me. I’ve learned that merely doing things for the sake of doing them gets me nowhere. Without a clear vision and goal, I’d simply flounder and achieve nothing!</p><p>So, I asked myself where I wanted to be a year from now and set my goal: <strong>one pull-up</strong>. I threw myself into achieving that pull-up. Growth takes time, so I was gentle with myself, but never lazy. Even when I felt tired, I’d still show up for the 30 minutes I promised myself — maybe lighten the load, but always keep going.</p><h3>The Workout Plan</h3><p>There wasn’t any set workout plan or program. My mission was that single pull-up. So, I broke down the technique, practiced with light weights, and after a month of persistent daily attempts, I finally conquered my first pull-up!</p><p>From there, I stretched my goals, aiming for a muscle-up within a year. Three months later, after trying EVERY SINGLE DAY, I achieved my first muscle-up.</p><p>Excited and slightly terrified, I pushed further — setting my sights on five muscle-ups, then ten, and finally, a one-arm pull-up.</p><h3><strong>Other achievements along the way</strong></h3><p>I also mastered handstands by watching YouTube videos and am sooo close to a handstand push-up. I learned to ignore the pain and run for kilometers without tiring. I went from barely performing a bodyweight squat to nailing one-leg squats.</p><p><a href="https://youtube.com/shorts/5KUkSAi5px0?feature=share">Handstand Pushup</a></p><h3>What I learnt on this journey</h3><p>The human body is incredibly adaptable, and with consistency and clear goals, anyone can unlock their athletic potential, despite their initial doubts about their capabilities.</p><p>By learning to accept and care for my body, I realized that it may not be perfect, but it is undeniably cool and capable.</p><p>Taking that first step in any direction can lead you to achieve feats you never thought possible.</p><h3>Next Steps</h3><p>My next goal is crystal clear: aim for the muscle-up world record 😛! It may sound like a pipe-dream, but remember, a year ago, even one pull-up seemed unattainable. I’ll keep pushing myself, stay humble, and always keep it simple.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b59f90d8171" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>