<?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 Bartłomiej Tadych on Medium]]></title>
        <description><![CDATA[Stories by Bartłomiej Tadych on Medium]]></description>
        <link>https://medium.com/@b4rtaz?source=rss-33cf087fdaba------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*prZWSL6v9iku6hjux204kw.jpeg</url>
            <title>Stories by Bartłomiej Tadych on Medium</title>
            <link>https://medium.com/@b4rtaz?source=rss-33cf087fdaba------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 17:00:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@b4rtaz/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[How I Built PadlessBox in 3 Weeks Using Vibe Coding - And Why 100% AI Failed]]></title>
            <link>https://b4rtaz.medium.com/how-i-built-padlessbox-in-3-weeks-using-vibe-coding-and-why-100-ai-failed-7ce24df60bba?source=rss-33cf087fdaba------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ce24df60bba</guid>
            <category><![CDATA[games]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[board-games]]></category>
            <category><![CDATA[vibe-coding]]></category>
            <dc:creator><![CDATA[Bartłomiej Tadych]]></dc:creator>
            <pubDate>Fri, 06 Feb 2026 12:17:27 GMT</pubDate>
            <atom:updated>2026-02-06T12:17:27.595Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QsAqPiCUfRwpGdmo.jpg" /><figcaption>PadlessBox - Party Games Using Phones as Controllers</figcaption></figure><p>Three weeks ago, I set out to build <a href="https://padlessbox.com/"><strong>PadlessBox</strong></a>, a browser-based platform for party games using phones as controllers. The goal was simple: open a game on a TV or laptop, let players join with their smartphones, and enable real-time multiplayer without downloads or dedicated hardware.</p><p>I decided to build it using Vibe Coding - relying heavily on AI to generate most of the code.</p><p>That approach did not work.</p><h3>🤖 Phase 1: 100% AI</h3><p>Initially, I used AI to generate:</p><ul><li>The WebSocket layer</li><li>Multiplayer synchronization</li><li>Room lifecycle management</li><li>Game structure</li></ul><p>Progress was fast. Rooms worked. Players connected. Inputs were transmitted.</p><p>But once I tested real multiplayer scenarios, instability appeared:</p><ul><li>State desynchronization</li><li>Non-deterministic behavior</li><li>Hidden coupling between modules</li><li>Difficult edge cases</li></ul><p>When I asked AI to fix issues, it often introduced new ones. The system became fragile.</p><p>The problem was architectural. Real-time multiplayer systems built on WebSockets require careful design around shared state and synchronization. Without deliberate structure, technical debt accumulates quickly.</p><p>At that point, it was clear that 100% AI-driven development was not sustainable.</p><h3>👨‍🏭 Phase 2: Manual Core, AI Inside Boundaries</h3><p>I rebuilt the foundation manually:</p><ul><li>A structured WebSocket communication layer</li><li>Explicit room lifecycle management</li><li>Deterministic state synchronization</li><li>A standardized game interface</li></ul><p>Instead of building a full game, I created a minimal prototype to validate one thing: phones acting as reliable real-time controllers for a shared screen.</p><p>This defined clear boundaries.</p><p>Once the architecture was stable, I reintroduced AI - but only within predefined interfaces.</p><p>AI did not modify core networking or synchronization. It was used to:</p><ul><li>Implement individual games</li><li>Translate mechanics into the existing structure</li><li>Accelerate repetitive patterns</li></ul><p>For some games, descriptions were enough. For others, AI analyzed open-source repositories under MIT licenses to understand mechanics before adapting them.</p><p>The difference was significant. AI extended the system instead of shaping it.</p><h3>🎮 The Result: PadlessBox</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*J9YxvRJeMawssKgq.jpg" /><figcaption>PadlessBox on TV</figcaption></figure><p>PadlessBox is now a browser-based multiplayer platform for party games using phones as controllers.</p><p>Players open it on a TV or laptop, create a room, and join with their smartphones. All communication runs in real time over WebSockets.</p><p>The MVP includes eight games built on the same framework, including Snake, Rock Paper Scissors, Quiz, Memory, 2048, Brickfall, Sliding Puzzle, and Block Puzzle.</p><p>Because the core architecture is stable, each game is modular and isolated.</p><p>The MVP was built and deployed in three weeks.</p><h3>🎓 What I Learned</h3><ul><li>AI accelerates feature development but struggles with system architecture.</li><li>Real-time multiplayer systems require deliberate structural planning.</li><li>Technical debt compounds when core layers are generated without constraints.</li><li>AI performs best inside clearly defined boundaries.</li></ul><p>Vibe Coding is powerful, but it is not a substitute for engineering fundamentals.</p><p>The key lesson from building PadlessBox is simple:</p><p><strong>Architecture first. Acceleration second.</strong></p><p>You can see the project <a href="https://padlessbox.com/">here</a>. 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ce24df60bba" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create Flow Builder with Multiple Triggers Using Sequential Workflow Designer]]></title>
            <link>https://b4rtaz.medium.com/create-a-flow-builder-with-multiple-triggers-using-sequential-workflow-designer-7cfd0c539f0d?source=rss-33cf087fdaba------2</link>
            <guid isPermaLink="false">https://medium.com/p/7cfd0c539f0d</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[flow-builder]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[visual-programming]]></category>
            <dc:creator><![CDATA[Bartłomiej Tadych]]></dc:creator>
            <pubDate>Thu, 26 Jun 2025 12:33:47 GMT</pubDate>
            <atom:updated>2025-06-26T14:56:14.114Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eQYRPPuBCJJzBBgzYX-kRA.png" /></figure><p>Starting with version 0.30.0, Sequential Workflow Designer makes it easy to build flow builders that support multiple triggers to start a flow. This enables rapid development of <strong>visual programming</strong> applications, empowering users — without any coding skills — to define clear, deterministic logic, often enhanced by AI.</p><p>How to start? At the start you need to install the Sequential Workflow Designer using NPM:</p><pre>npm install sequential-workflow-designer</pre><p>Now you need to import the designer to your code:</p><pre>import { Designer, Uid } from &#39;sequential-workflow-designer&#39;;<br><br>// css<br>import &#39;sequential-workflow-designer/css/designer.css&#39;;<br>import &#39;sequential-workflow-designer/css/designer-light.css&#39;;</pre><p>Before we continue, we need to define the task types that our flow builder will support. In this article, I’ll introduce three example task types: “Save file”, “Send email”, and “Loop”. However, you’re free to define as many task types as your use case requires. For example, each integration with an external system could be represented as a separate task type.</p><p>Next, we want the flow builder to let users define when a flow should start. We refer to these starting points as triggers. Triggers are special blocks that users can drag and drop into the start section of the flow, then configure accordingly. In this article, we’ll define three example triggers that will be available in the designer: “On email received”, “On file created”, and “On file modified”.</p><p>The goal is to create a flow builder that enables users to build flows starting from an event and then define a predictable sequence of logic. This logic will eventually be executed by a state machine, although we won’t focus on that part in this article.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*1nJbolXVfwTeRviROj9enw.gif" /><figcaption>Sequential Workflow Designer with Triggers</figcaption></figure><p>Now, I’ll create two functions: one to generate a task and one to generate a trigger.</p><pre>function createSaveFileStep() {<br>  return {<br>    id: Uid.next(),<br>    componentType: &#39;task&#39;,<br>    type: &#39;save-file&#39;,<br>    name: &#39;Save file&#39;,<br>    properties: {}<br>  };<br>}<br><br>function createOnEmailReceivedStep() {<br>  return {<br>    id: Uid.next(),<br>    componentType: &#39;task&#39;,<br>    type: &#39;trigger-on-email-received&#39;,<br>    name: &#39;On email received&#39;,<br>    properties: {}<br>  };<br>}</pre><p>These functions are needed to complete the toolbox configuration. Now we’re ready to initialize the designer for the first time.</p><pre>const emptyDefinition = {<br>  sequence: [],<br>  properties: {}<br>};<br><br>const configuration = {<br>  steps: {},<br>  toolbox: {<br>    groups: [<br>      {<br>        name: &#39;Triggers&#39;,<br>        steps: [ createOnEmailReceivedStep() ]<br>      },<br>      {<br>        name: &#39;Tasks&#39;,<br>        steps: [ createSaveFileStep() ]<br>      }<br>    ]<br>  },<br>  controlBar: true,<br>  editors: false,<br>  placeholder: {},<br>  validator: {},<br>  extensions: []<br>};<br><br>const designer = Designer.create(<br>  document.getElementById(&#39;placeholder&#39;),<br>  emptyDefinition,<br>  configuration<br>);</pre><p>At this point, you should see the designer with an empty flow — no tasks added yet. Now, I’ll focus on creating a special section at the beginning of the flow where users can drag and drop only trigger blocks. It’s important that this section accepts only triggers, not tasks. Likewise, triggers should not be allowed outside of this section. We can enforce these restrictions through the designer configuration.</p><p>Before we start, we need to add a special sequential step at the beginning of the flow definition. This step will act as a container for triggers. I’ll use the <strong>launchPad</strong> step component type to render it. This launch pad step component displays all nested steps aligned vertically and visually connected to the end of the container, creating the impression that any of the steps can trigger the flow.</p><p>While this component type can also be used for other use cases, such as parallel sections, it was primarily designed to handle triggers.</p><pre>const emptyDefinition = {<br>  sequence: [<br>    {<br>      id: &#39;launchPad&#39;,<br>      name: &#39;Launch Pad&#39;,<br>      componentType: &#39;launchPad&#39;,<br>      type: &#39;launchPad&#39;,<br>      properties: {},<br>      sequence: []<br>    }<br>  ],<br>  properties: {}<br>};</pre><p>Now, when you refresh the page, you should see a flow with a small container inside. At this point, you can drag and drop any step from the toolbox into this section — but that’s not what we want. We only want to allow triggers in this section. To achieve this, we need to implement a custom placeholder controller and pass it to the designer by extending the configuration.</p><pre>placeholder: {<br>  canCreate(sequence, index) {<br>    const definition = designer.getDefinition();<br>    const isRoot = sequence === definition.sequence;<br>    if (isRoot) {<br>      return index !== 0;<br>    }<br>    return true;<br>  },<br>  canShow(sequence, _, __, draggingStepType) {<br>    const definition = designer.getDefinition();<br>    const isTriggerStep = draggingStepType.startsWith(&#39;trigger-&#39;);<br>    const isLaunchPadSequence = sequence === definition.sequence[0].sequence;<br>    return (isLaunchPadSequence &amp;&amp; isTriggerStep) || (!isLaunchPadSequence &amp;&amp; !isTriggerStep);<br>  }<br>},</pre><p>In the code above, I disabled the placeholder that appears before the launch pad step component, as I don’t want users to insert any steps before it. Then, in the <strong>canShow</strong> callback, I implemented a simple logic that hides placeholders if the dragged step type isn’t allowed in the target sequence.</p><p>After refreshing the page, you’ll notice one issue: while drag-and-drop works as expected and the restrictions are in place, it’s still possible to delete or move the launch pad step — which is not the intended behavior. To prevent this, I need to implement custom callbacks that restrict these actions.</p><pre>steps: {<br>  isDuplicable(step) {<br>    return step.componentType !== &#39;launchPad&#39;;<br>  },<br>  isDeletable(step) {<br>    return step.componentType !== &#39;launchPad&#39;;<br>  },<br>  isDraggable(step) {<br>    return step.componentType !== &#39;launchPad&#39;;<br>  },<br>  isSelectable(step) {<br>    return step.componentType !== &#39;launchPad&#39;;<br>  }<br>},</pre><p>Finally, everything is working as expected. We have created a flow designer that allows placing one or more triggers at the start of the flow, with various tasks arranged below.</p><p>To read the definition prepared by a user you need to call the <strong>getDefinition</strong> method on the designer instance. This will return a JSON object that represents the flow definition, including all steps and their properties.</p><pre>const definition = designer.getDefinition();</pre><p>Of course, this is just the beginning. Next, we need to implement editors for configuring all supported steps. Another important part is how to execute the designed flow, but that won’t be covered in this article. For more examples and detailed documentation, I recommend visiting the nocode-js.com website.</p><p>Check out the final online example 👉 <a href="https://nocode-js.github.io/sequential-workflow-designer/examples/triggers.html">here</a>. You can also find the <a href="https://github.com/nocode-js/sequential-workflow-designer/tree/main/examples">source code</a> for this example and more on GitHub.</p><p>Links:</p><ul><li><a href="https://github.com/nocode-js/sequential-workflow-designer">Sequential Workflow Designer on GitHub</a></li><li><a href="https://nocode-js.com/sequential-workflow-designer-examples">Sequential Workflow Designer Examples</a></li><li><a href="https://nocode-js.com/">NoCode JS Website</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7cfd0c539f0d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Run Llama 3.1 405B on Home Devices? Build AI Cluster!]]></title>
            <link>https://b4rtaz.medium.com/how-to-run-llama-3-405b-on-home-devices-build-ai-cluster-ad0d5ad3473b?source=rss-33cf087fdaba------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad0d5ad3473b</guid>
            <category><![CDATA[ai-cluster]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[llama-3]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[inference-engine]]></category>
            <dc:creator><![CDATA[Bartłomiej Tadych]]></dc:creator>
            <pubDate>Sun, 28 Jul 2024 11:49:48 GMT</pubDate>
            <atom:updated>2024-07-31T20:03:31.366Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*b4xoYe7UfKb6-KmE" /><figcaption>Distributed Llama</figcaption></figure><p>In the race between open LLM models and closed LLM models, the biggest advantage of the open models is that you can run them locally. You don’t need to rely on external providers or pay anything extra beyond electricity and hardware costs. However, this advantage starts to wane as the size of the model increases. It’s not easy to run huge models that require large amounts of memory. Fortunately, the tensor paralism and the distributed inference are something that may help.</p><h3>Tensor Parallism</h3><p>Most computations in LLMs involve matrix multiplication, which accounts for around 97–98% of all computations. The matrix multiplication is quite easy to parallelize accross multiple CPU/GPU cores. The same we can do accross multiple devices. Devices may be splited in this way that each device calculates only a slice of the matrix multiplication. If a single device can compute the matrix multiplication in n seconds, then two devices should calculate it in n / 2 seconds! This is the tensor parallism.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uXUMQLgqK2ClxPfA3-MI3A.png" /><figcaption>Tensor parallelism, computation time</figcaption></figure><p>This sounds very promising, but the main bottleneck here is synchronization. We can speed up the multiplication, but at some point, we need to synchronize the state of the neural network. This takes time. Professional AI clusters use advanced links to communicate between GPUs (like NVLink) that achieve very high transfer speeds. Home devices, however, have slow Ethernet. But what is surprising is that the amount of data required to synchronize LLMs can be very low if the architecture of the model executor is designed to reduce transfer size. For example, a quantized Llama 3 8B to Q40 format (6.3 GB) requires <a href="https://github.com/b4rtaz/distributed-llama/discussions/33">only 1 MB</a> of data to synchronize per token if the cluster consists of 2 devices. This is very, very low.</p><p>Here we are. Tensor parallelism speeds up inference, but synchronization slows it down. The combination of these two factors will determine the final performance. If you have 8 devices and can connect them with a fast link, you will observe a significant speedup (<a href="https://fangpenlin.com/posts/2024/01/14/high-speed-usb4-mesh-network/">synchronization over USB4</a> seems very promising here, you can achieve from 10 to <a href="https://chrisbergeron.com/2021/07/25/ultra-fast-thunderbolt-nas-with-apple-m1-and-linux/">20 Gbps</a>).</p><p>So, how can we run a large model at home? You need a project that implements these ideas. Let me introduce the <a href="https://github.com/b4rtaz/distributed-llama">Distributed Llama</a> project.</p><h3>Distributed Llama</h3><p>Distributed Llama is a project that allows you to run an LLM model across multiple devices. It uses tensor parallelism and is optimized for the low amount of data required for synchronization. Distributed Llama distinguishes between two types of nodes that you can run on your devices:</p><ul><li>Root Node — the application that acts as the root node of your cluster, coordinating the cluster.</li><li>Worker Node — the application that functions as a worker, executing instructions from the root node.</li></ul><p>Currently, Distributed Llama supports only CPU inference, but this will change in the future.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BzRi_k4l93S9cK5VhX120A.png" /><figcaption>AI cluster topology, 4 devices, total 256 GB RAM</figcaption></figure><p>So, if your home cluster consists of 4 devices, you should run the root node on the first device and 3 worker nodes on the remaining devices. Distributed Llama splits RAM usage across all devices. For example, if an LLM model requires 238 GB of RAM, each node should have 238 GB /n of RAM. The exception is the root node, which requires a few percent more RAM than 238 GB /n because it needs to keep a few additional layers in memory.</p><h3>Run 405B Model</h3><p>To run Llama 3.1 405B, we need to clone the Distributed Llama repository and build the dllama application on all the devices you want to use for inference. A compiler like G++ or a similar one is required.</p><pre>git clone https://github.com/b4rtaz/distributed-llama.git<br>make dllama</pre><p>Then, you need to connect all devices to the same local network. You can use any Ethernet switch for that. As I mentioned earlier, synchronization time is a significant factor, so you should use the fastest switch possible. Gigabit Ethernet is the minimum requirement. You can also consider connecting devices via USB4 and creating a USB4 mesh network. Next, you need to run worker nodes on the worker devices:</p><pre>./dllama worker --port 9998 --nthreads 4</pre><p>The --nthreads argument defines how many CPU cores should be used for processing. You should set this to the number of CPU cores in your device. As you can see, the worker does not need the model files. These files are only required for the root node. At the beginning, the root node distributes all slices of the model to the worker nodes.</p><p>Before we run the root node, we need to download the Llama 3 405B model to the root device and convert it to Distributed Llama format. You can do it manually or just download the pre-converted weights from <a href="https://huggingface.co/b4rtaz/Llama-3_1-405B-Q40-Instruct-Distributed-Llama">Huggingface</a>. With the launch.py script from Distributed Llama repository you can download the model and the tokenizer by execution a single command. All files will be placed into the models folder.</p><pre>launch.py llama3_1_405b_instruct_q40</pre><p>Ensure that you have accepted the <a href="http://launch.py llama3_1_405b_instruct_q40">Llama 3.1 license</a> on Huggingface. Make sure you have approximately 240GB of free space on your disk.</p><p>Now you can run the inference on the root node.</p><pre>./dllama inference \<br>   --model models/llama3_1_405b_instruct_q40/dllama_model_llama3_1_405b_instruct_q40.m \<br>   --tokenizer models/llama3_1_405b_instruct_q40/dllama_tokenizer_llama3_1_405b_instruct_q40.t \<br>   --buffer-float-type q80 \<br>   --prompt &quot;Hello world&quot; \<br>   --steps 64 \<br>   --nthreads 4 \<br>   --workers 10.0.0.1:9998 10.0.0.2:9998 10.0.0.3:9998</pre><p>Please note that the--workers argument accepts IP addresses with the port of worker nodes. Addresses are separated by spaces. Additionally, you can define how many word predictions you expect by setting the --steps N argument.</p><p>If you want to run the API service that supports the /v1/chat/completions endpoint, you should build the dllama-api application and run it on the root device instead dllama inference .</p><pre>./dllama-api \<br>  --model models/llama3_1_405b_instruct_q40/dllama_model_llama3_1_405b_instruct_q40.m \<br>  --tokenizer models/llama3_1_405b_instruct_q40/dllama_tokenizer_llama3_1_405b_instruct_q40.t \<br>  --buffer-float-type q80 \<br>  --max-seq-len 2048 \<br>  --nthreads 4</pre><p>Distributed Llama also supports the--kv-cache-storage disk argument, which reduces RAM usage by moving the KV cache to the disk. Llama 3.1 models require ~34 GB of RAM to store the full context (F32) in memory (131k tokens). By setting this argument, you can reduce RAM usage, but you will need additional disk space. Please note that the KV cache is split across all nodes, so you need to set this option for each node.</p><p>The second option to reduce RAM usage is to use the --max-seq-len 2048 argument. If you don’t need the full context size, you can reduce it, which will simultaneously reduce memory consumption.</p><p>That’s it! Don’t forget to share you results on <a href="https://github.com/b4rtaz/distributed-llama/discussions">GitHub</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad0d5ad3473b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Upload Your Mind to AI]]></title>
            <link>https://b4rtaz.medium.com/upload-your-mind-to-ai-abca6f2a548d?source=rss-33cf087fdaba------2</link>
            <guid isPermaLink="false">https://medium.com/p/abca6f2a548d</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[chatgpt]]></category>
            <dc:creator><![CDATA[Bartłomiej Tadych]]></dc:creator>
            <pubDate>Sat, 15 Apr 2023 17:57:24 GMT</pubDate>
            <atom:updated>2023-04-15T17:57:24.104Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9bcYc0DIIkdjx-tn" /></figure><p>Sam Altman, the CEO of OpenAI, was asked about what is inside the ChatGPT neural network and he answered, “let’s say, human knowledge”. But what if we were to train the model using only answers from a single person? What would be inside? Would it be you?</p><p>Today, AI models are trained using huge datasets that are compiled from data contributed by thousands of individuals such as writers, scientists, and internet users. Interestingly, at times, it can be observed that the resulting neural network exhibits biases in certain subjects. Why does this happen? It’s because the dataset itself may be biased.</p><p>That means the neural network takes over opinions, points of view or sens of humor from datasets. This is exactly that what makes people different.</p><h3>Size of Dataset</h3><p>Let’s think how much data we need to train the AI model. The Stanford Alpaca fine-tuning dataset has 52 002 questions and answers. The average number of characters for a single question is 82.7, for an answer is 270.3. So the single data record contains 353 characters (353 bytes).</p><p>In the <a href="https://arxiv.org/abs/2302.13971v1">paper</a> describes the LlaMa model, we can find the information about the size of the dataset used to train the network, it was 4749 GB. Let’s divide this size by the average record size of the Alpaca dataset to get some approximation of the data volume.</p><pre>4749 GB / 353 bytes = 13 453 257 790 records (questions and answers)</pre><h3>Dataset Preparation</h3><p>That looks almost impossible to get that volume from a single person. For example, the transcription of <a href="https://www.youtube.com/watch?v=L_Guz73e6fw">the interview with Sam Altman</a> (mentioned at the beginning) has ~130 000 characters. The interview lasts 143 minutes, so we can calculate how long the interview should be to create the training dataset similar to the dataset used in the LlaMa paper.</p><pre>130 000 bytes / 143 minutes = 909 [bytes / minute]<br>4749 GB / 909 [bytes / minute] = 5224422442 minutes = 10191 years</pre><p>10 191 years is a bit too long. However, any living person doesn’t have the all human knowledge. Most people are specialists in only several areas. Everything else is either unknown to us or we have just had only guesses. If I would ask a question to a person from all fields, the most common answer would be “I don’t know”. That means the dataset can be much smaller.</p><p>There is no doubt that the data preparation process will take years. So the process should be designed to be ergonomic and neutral in everyday life. Additionally, we can use that what we have now, e-mails, chat conversations and voice calls. These sources after some adjustments should be a great source of our mind.</p><h3>What is Inside</h3><p>What would be inside the neural network? Of course, that won’t be you. But that would be something very similar to you. That would have the same views, the same concerns, the same worries… That will be a copy of you, perhaps an inaccurate copy. But this copy can live eternally. Next generations can get a point of view people from today’s century. Your point of view.</p><p>Maybe we can bring back Einstein to alive?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=abca6f2a548d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Simplest I18n JS Framework is here! Meet Ultimate I18n JS]]></title>
            <link>https://b4rtaz.medium.com/the-simplest-i18n-js-framework-is-here-meet-ultimate-i18n-js-84cef7c9b6eb?source=rss-33cf087fdaba------2</link>
            <guid isPermaLink="false">https://medium.com/p/84cef7c9b6eb</guid>
            <category><![CDATA[i18n]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[framework]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[typescript]]></category>
            <dc:creator><![CDATA[Bartłomiej Tadych]]></dc:creator>
            <pubDate>Mon, 31 Oct 2022 14:09:08 GMT</pubDate>
            <atom:updated>2022-11-01T12:17:19.089Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g0Yhe0iFn-XMw5z_NSXzDg.png" /></figure><p>The internationalization for web apps was a nightmare until now. Say hello to the <a href="https://github.com/b4rtaz/ultimate-i18n-js">Ultimate I18n JS</a>!</p><h3>🚀 Three Steps</h3><p><strong>First step</strong>. Add the Ultimate I18n JS to your &lt;head&gt; section as the first script on your page.</p><pre>&lt;script src=&quot;https://cdn.jsdelivr.net/npm/ultimate-i18n-js@0.0.3/lib/index.min.js&quot;&gt;&lt;/script&gt;</pre><p><strong>Second step</strong>. Set your default language code in the &lt;html&gt; tag.</p><pre>&lt;html lang=&quot;en&quot;&gt;</pre><p><strong>Third step</strong>. Add translations by setting the i18n-[LANG_CODE]=&quot;&quot; attribute to any element on your page.</p><pre>&lt;h1<br>  i18n-pl=&quot;Witaj świecie&quot;<br>  i18n-es=&quot;Hola Mundo&quot;&gt;<br>  Hello World &lt;!-- Your default language (en) --&gt;<br>&lt;/h1&gt;</pre><p>That’s it! 🤯 Your page is multilingual now!</p><p>The library will automatically detect a user’s language and display a right translation.</p><p>To manually change the language call the set method on the UltimateI18n object.</p><pre>&lt;button onclick=&quot;UltimateI18n.set(&#39;en&#39;);&quot;&gt;EN&lt;/button&gt;<br>&lt;button onclick=&quot;UltimateI18n.set(&#39;es&#39;);&quot;&gt;ES&lt;/button&gt;<br>&lt;button onclick=&quot;UltimateI18n.set(&#39;pl&#39;);&quot;&gt;PL&lt;/button&gt;</pre><p>The library remembers that choice. After the page is reloaded a user still sees a chosen language.</p><h3>⚒ Module Bundlers</h3><p>You may use the Ultimate I18n JS with Webpack or a similar bundler. To install the package execute the below command.</p><p>npm install ultimate-i18n-js</p><p>Now you need to call the setup method before render your app.</p><pre>import * as UltimateI18n from &#39;ultimate-i18n-js&#39;;</pre><pre>UltimateI18n.setup();</pre><pre>document.addEventListener(&#39;DOMContentLoaded&#39;, () =&gt; {<br>  document.getElementById(&#39;placeholder&#39;).innerHTML = `<br>    &lt;span<br>      i18n-pl=&quot;Kocham czerwony&quot;<br>      i18n-es=&quot;Amo el rojo&quot;&gt;<br>      I love red<br>    &lt;/span&gt;<br>  `;<br>});</pre><p>That’s it! 🤯</p><h3>🤩 Demos</h3><p>Check these online demos:</p><ul><li><a href="https://b4rtaz.github.io/ultimate-i18n-js/examples/static-web-app/basic.html">Basic</a></li><li><a href="https://b4rtaz.github.io/ultimate-i18n-js/examples/static-web-app/create-element.html">Create Element</a></li><li><a href="https://b4rtaz.github.io/ultimate-i18n-js/examples/static-web-app/document-write.html">Document Write</a></li><li><a href="https://b4rtaz.github.io/ultimate-i18n-js/examples/static-web-app/dynamic-text.html">Dynamic Text</a></li><li><a href="https://b4rtaz.github.io/ultimate-i18n-js/examples/static-web-app/late-setup.html">Late Setup</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=84cef7c9b6eb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create Simple No-Code App with Workflow Designer]]></title>
            <link>https://b4rtaz.medium.com/create-simple-no-code-app-with-workflow-designer-6492562f1be7?source=rss-33cf087fdaba------2</link>
            <guid isPermaLink="false">https://medium.com/p/6492562f1be7</guid>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[no-code-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[no-code]]></category>
            <dc:creator><![CDATA[Bartłomiej Tadych]]></dc:creator>
            <pubDate>Thu, 25 Aug 2022 14:17:20 GMT</pubDate>
            <atom:updated>2022-12-25T23:45:26.899Z</atom:updated>
            <content:encoded><![CDATA[<p>In this tutorial I’ll show you how to create a simple No-Code app. We will try to create an app, where a user can design some business logic by a graphical user interface and try to run it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*GVYslLoYIwJrTym7.gif" /></figure><h3>🎯 What is No-Code?</h3><p>No-Code apps allow non-technical users to create an app. How it is possible? No-Codes provide a simple user interface, much simpler then an interface of programming tools. No-Codes are often adjusted for some industry and are prepared to do some specific job.</p><p>Basically, in the No-Codes we can separate two layers:</p><ul><li><strong>Model</strong> — it contains a definition of a program, made by some graphical user interface. It’s prepared mainly by a non technical user and it can be stored in a database or a hard drive.</li><li><strong>Execution</strong> — this layer executes a model. The model can be processed into anything: a graphical interface, a command line app, a website, etc…</li></ul><p>In this tutorial we will focus on workflows. The workflow is a wide concept, but in this case we want to use it to define our no-code application. We want to give a final user possibility to create some logical flow like “read some value”, “do something if the value is equal 1” etc. We need a simple graphical user interface to define that kind flow. For that we will use the <a href="https://github.com/nocode-js/sequential-workflow-designer">Sequential Workflow Designer</a> package.</p><p>The package contains a generic designer. This generic designer allows us to create a designer for specific use-cases. The execution layer is not a part of this component.</p><p>Let’s back to the workflow concept. The workflow contains a definition of flow. One thing here is important, the flow doesn’t have to be linear. It could contain some conditional statements or loops. The smallest part here we called a step. The step represents a one instruction or one task to do. Of course conditions or loops are steps too.</p><p>Here we will prepare two simple steps and we will create a simple executor of the workflow.</p><ul><li><strong>readUserInput</strong> — read a user input to a buffer.</li><li><strong>sendEmail</strong> — sends an email if the buffer equals some value.</li></ul><h3>👓 Sequential Workflow Designer</h3><p>To add the package to your project, you can add the below code to your &lt;head&gt; section.</p><pre>&lt;link href=&quot;https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.2.3/css/designer.css&quot; rel=&quot;stylesheet&quot;&gt;<br>&lt;link href=&quot;https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.2.3/css/designer-light.css&quot; rel=&quot;stylesheet&quot;&gt;<br>&lt;link href=&quot;https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.2.3/css/designer-dark.css&quot; rel=&quot;stylesheet&quot;&gt;<br>&lt;script src=&quot;https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.2.3/lib/designer.js&quot;&gt;&lt;/script&gt;</pre><p>If you use npm in your project you can add the package by npm:</p><pre>npm i sequential-workflow-designer</pre><h3>🐾 Steps</h3><p>Steps in the designer are defined in JSON format. Why JSON? Because it is easy to store anywhere (a database, a file, etc.).</p><p>In this tutorial we will use only task steps. But the designer supports more types (container, switch). The task component displays as a single rectangle. It doesn&#39;t contain children. It has a name, some icon, one input and one output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/527/0*lBYtsNs3cU6bH_zK.png" /></figure><p>Look at the below JSON, this is a definition of the task step.</p><pre>{<br>    &quot;id&quot;: &quot;unique_id&quot;,<br>    &quot;componentType&quot;: &quot;task&quot;,<br>    &quot;type&quot;: &quot;my_type&quot;,<br>    &quot;name&quot;: &quot;my_name&quot;,<br>    &quot;properties&quot;: {<br>        &quot;setting1&quot;: &quot;value1&quot;,<br>        &quot;setting2&quot;: &quot;value2&quot;<br>    }<br>}</pre><ul><li><strong>id</strong> — a unique id of a step. This id refers to placed steps in the designer. If we have 2 steps placed, we have two unique ids.</li><li><strong>type</strong> — a type of task, in this tutorial we have two types: readUserInput and sendEmail,</li><li><strong>name</strong> — it displays on the rectangle,</li><li><strong>properties</strong> — here we have all step settings, this list depends on the step type.</li></ul><p>As I mentioned above, we want to create 2 simple steps.</p><p>The first one is the readUserInput step. We want to allow a user to change a message of a question. So we will define one property question.</p><pre>{<br>    &quot;componentType&quot;: &quot;task&quot;,<br>    &quot;type&quot;: &quot;readUserInput&quot;,<br>    &quot;name&quot;: &quot;Read User Input&quot;,<br>    &quot;properties&quot;: {<br>        &quot;question&quot;: &quot;Ask me&quot;<br>    }<br>}</pre><p>Next one is the sendEmail step. Here we want to allow a user to define an email and add a condition ifReqisterEquals, that enables an e-mail shipping if a user in the last readUserInput step entered specific value. Basically, I introduce a simple condition here.</p><pre>{<br>    &quot;componentType&quot;: &quot;task&quot;,<br>    &quot;type&quot;: &quot;sendEmail&quot;,<br>    &quot;name&quot;: &quot;Send E-mail&quot;,<br>    &quot;properties&quot;: {<br>        &quot;ifReqisterEquals&quot;: &quot;1&quot;,<br>        &quot;email&quot;: &quot;x@example.com&quot;<br>    }<br>}</pre><h3>🔨 Toolbox</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/260/0*mWk30BFHAjPFVP63.png" /></figure><p>The toolbox is an element of the designer that allows drag-and-drop steps to the designing flow. Now we prepare a definition that the toolbox will use to render steps.</p><pre>const toolboxConfig = {<br>    groups: [<br>        {<br>            name: &#39;Steps&#39;,<br>            steps: [<br>                {<br>                    componentType: &#39;task&#39;,<br>                    type: &#39;readUserInput&#39;,<br>                    name: &#39;Read User Input&#39;,<br>                    properties: {<br>                        question: &#39;Ask me&#39;<br>                    }<br>                },<br>                {<br>                    componentType: &#39;task&#39;,<br>                    type: &#39;sendEmail&#39;,<br>                    name: &#39;Send E-mail&#39;,<br>                    properties: {<br>                        ifReqisterEquals: &#39;1&#39;,<br>                        email: &#39;x@example.com&#39;<br>                    }<br>                }<br>            ]<br>        }<br>    ]<br>};</pre><p>The configuration is divided into groups. Each group contains steps. Steps have the same structure as I introduced above with one exception. Here we don’t provide the id field. This field will be added with a unique ID after a drop.</p><h3>🐝 Icons</h3><p>We can configure an icon for specific componentType and type of a step. To do this we need to create a configuration.</p><pre>const stepsConfig = {<br>    iconUrlProvider: (componentType, type) =&gt; {<br>        return `./assets/icon-task.svg`<br>    },<br><br>    validator: (step) =&gt; true<br>};</pre><p>In this tutorial we use only one icon for all step types. But you can use a componentType and type arguments to provide specific icons.</p><p>What is a validator? It verifies that the step is configured correctly. In this tutorial we won’t use this feature.</p><h3>📇 Editors</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/0*VB9CCOV517cP2BMs.png" /></figure><p>As I mentioned above, each step contains unique settings. After we drop a step, we need an editor to edit those settings. The designer provides a configuration, that allows us to pass a generator of the editor.</p><pre>const editorConfig = {<br>    globalEditorProvider: (definition) =&gt; {<br>        const editor = document.createElement(&#39;div&#39;);<br>        editor.innerText = &#39;Select a step.&#39;;<br>        return editor;<br>    },<br>    stepEditorProvider: (step) =&gt; {<br>        // create a step&#39;s editor here and return it<br>    }<br>}</pre><p>The main problem here is that, we could have many step types (in this tutorial we have 2). So that means, each step requires own editor because each step contains different settings.</p><p>Here we have a basic editor of the readUserInput step.</p><pre>function createEditorForReadUserInput(step) {<br>    const editor = document.createElement(&#39;div&#39;);<br>    const label = document.createElement(&#39;label&#39;);<br>    label.innerText = &#39;Question&#39;;<br>    const input = document.createElement(&#39;input&#39;);<br>    input.setAttribute(&#39;type&#39;, &#39;text&#39;);<br>    input.value = step.properties[&#39;question&#39;];<br>    input.addEventListener(&#39;input&#39;, () =&gt; {<br>        step.properties[&#39;question&#39;] = input.value;<br>    });<br><br>    editor.appendChild(label);<br>    editor.appendChild(input);<br>    return editor;<br>}</pre><p>And here an editor of the sendEmail step.</p><pre>function createEditorForSendEmail(step) {<br>    const editor = document.createElement(&#39;div&#39;);<br>    const propNames = [&#39;ifReqisterEquals&#39;, &#39;email&#39;];<br>    for (let propName of propNames) {<br>        const label = document.createElement(&#39;label&#39;);<br>        label.innerText = propName;<br>        const input = document.createElement(&#39;input&#39;);<br>        input.setAttribute(&#39;type&#39;, &#39;text&#39;);<br>        input.value = step.properties[propName];<br>        input.addEventListener(&#39;input&#39;, () =&gt; {<br>            step.properties[propName] = input.value;<br>        });<br><br>        editor.appendChild(label);<br>        editor.appendChild(input);<br>    }<br>    return editor;<br>}</pre><p>As you can see, these editors update step.properties after a user&#39;s change.</p><p>We have two generators, but we need to put all together into the stepEditorProvider property.</p><pre>stepEditorProvider: (step) =&gt; {<br>  if (step.type === &#39;readUserInput&#39;)<br>    return createEditorForReadUserInput(step);<br>  if (step.type === &#39;sendEmail&#39;)<br>    return createEditorForSendEmail(step);<br>  throw new Error(&#39;Not supported&#39;);<br>}</pre><h3>📐 Create Designer</h3><p>Now we can create a designer.</p><pre>const config = {<br>    toolbox: toolboxConfig,<br>    steps: stepsConfig,<br>    editors: editorConfig<br>};</pre><p>We can provide a start definition of the workflow. But in this tutorial we won’t do this.</p><pre>const startDefinition = {<br>    properties: {},<br>    sequence: []<br>};</pre><p>That’s all. Let’s create a designer.</p><pre>const placeholder = document.getElementById(&#39;designer&#39;);<br>const designer = sequentialWorkflowDesigner.create(<br>    placeholder, <br>    startDefinition, <br>    config);</pre><p>Now we should see the designer on the screen.</p><h3>🚀 Execution</h3><p>The last part is an execution. Here we want to execute a designed flow.</p><p>We need to prepare a code for the readUserInput step. This step is very simple. We ask a user and save a response. The question is defined in the question property.</p><pre>let register = null;<br><br>if (step.type === &#39;readUserInput&#39;) {<br>   register = prompt(step.properties[&#39;question&#39;]);<br>}</pre><p>The sendEmail step is little more complicated. Here we send an e-mail if a previously picked value from a user is equal some value. The value is defined in the ifReqisterEquals property.</p><pre>if (step.type === &#39;sendEmail&#39;) {<br>  if (step.properties[&#39;ifReqisterEquals&#39;] === register) {<br>     alert(`E-mail sent to ${step.properties[&#39;email&#39;]}`);<br>  }<br>}</pre><p>But how we can read a definition of the workflow? It’s easy.</p><pre>const definition = designer.getDefinition();</pre><p>You can check the final state here.</p><pre>function runWorkflow() {<br>    const definition = designer.getDefinition();    <br>    let register = null;<br>    <br>    for (let step of definition.sequence) {<br>        if (step.type === &#39;readUserInput&#39;) {<br>            register = prompt(step[&#39;question&#39;]);<br>        }<br>        else if (step.type === &#39;sendEmail&#39;) {<br>            if (step.properties[&#39;ifReqisterEquals&#39;] === register) {<br>                alert(`E-mail sent to ${step.properties[&#39;email&#39;]}`);<br>            }<br>        }<br>    }<br>}</pre><p>Now we need to call runWorkflow function.</p><h3>📦 Examples</h3><p>You can test the final project <a href="https://nocode-js.github.io/sequential-workflow-designer/examples/simple-flow.html">here</a>.</p><p>By the way you can check the below online demos of the Sequential Workflow Designer component.</p><ul><li><a href="https://nocode-js.github.io/sequential-workflow-designer/examples/fullscreen.html">❎ Fullscreen</a></li><li><a href="https://nocode-js.github.io/sequential-workflow-designer/examples/image-filter.html">🌅 Image Filter</a></li><li><a href="https://nocode-js.github.io/sequential-workflow-designer/examples/light-dark.html">⛅ Light Dark</a></li><li><a href="https://nocode-js.github.io/sequential-workflow-designer/examples/live-testing.html">⏩ Live Testing</a></li><li><a href="https://nocode-js.github.io/sequential-workflow-designer/examples/particles.html">🔴 Particles</a></li><li><a href="https://nocode-js.github.io/sequential-workflow-designer/examples/code-generator.html">🤖 Code Generator</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6492562f1be7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I converted RSS to Instagram stories]]></title>
            <link>https://b4rtaz.medium.com/how-i-converted-rss-to-instagram-stories-e6d6f6304a72?source=rss-33cf087fdaba------2</link>
            <guid isPermaLink="false">https://medium.com/p/e6d6f6304a72</guid>
            <category><![CDATA[instastories]]></category>
            <category><![CDATA[rss-feeds]]></category>
            <category><![CDATA[instagram]]></category>
            <category><![CDATA[rss]]></category>
            <dc:creator><![CDATA[Bartłomiej Tadych]]></dc:creator>
            <pubDate>Sun, 28 Mar 2021 19:24:47 GMT</pubDate>
            <atom:updated>2021-03-28T19:31:00.609Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*I4Htu-GMIpT-jH2-yKVq5A.png" /></figure><p>RSS is quite old technology, but still many people use it. I like RSS, but RSS apps are old fashioned and uncomfortable for me. There are much better designs to read a content than boring news list. The one of them are stories. You may know this from Instagram or Snapchat. So, I decided to create a converter.</p><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?&gt;<br>&lt;rss version=&quot;2.0&quot;&gt;<br>&lt;channel&gt;<br>    ...<br>    &lt;item&gt;<br>        &lt;title&gt;Title&lt;/title&gt;<br>        &lt;link&gt;link.html&lt;/link&gt;<br>        &lt;description&gt;Description&lt;/description&gt;<br>        &lt;pubDate&gt;Fri, 12 Mar 2021 12:00:00 GMT&lt;/pubDate&gt;<br>        &lt;!-- But, where is an image? 😣 --&gt;<br>    &lt;/item&gt;<br>    ...</pre><p>I wanted to put a title and a short description in each story. Almost all RSS channels deliver this data. But the main problem is with pictures of articles. Some channels delivers pictures, but most don’t. I think, the most important in the stories are images. The picture passes quicker information than the text, and I think this is the heart of stories. So what do with feeds witch don’t provide images?</p><pre>&lt;!DOCTYPE HTML&gt;<br>&lt;html&gt;<br>    &lt;head&gt;<br>        ...<br>        &lt;meta property=&quot;og:title&quot; content=&quot;Title&quot; /&gt;<br>        &lt;meta property=&quot;og:image&quot; content=&quot;image.jpg&quot; /&gt;<br>        &lt;!-- Ok, I see an image now! 😍 --&gt;<br>        ...</pre><p>We can find the cover image in… HTML social tags of the article. I noticed that, almost every news website has social tags. So I created RSS reader with scraping feature. The result is awesome. I have thousands RSS feeds with nice cover images now.</p><p><strong>This is a short story how I created Stories Now.</strong> 🚀 Modern RSS Reader. It’s available for Android and iOS for free. You may download it from:</p><ul><li>💿 <a href="http://play.google.com/store/apps/details?id=com.n4no.storiesNow">Google Play</a> for Android, or</li><li>📀 <a href="http://apps.apple.com/pl/app/stories-now/id1557096867">App Store</a> for iPhone, or</li><li><a href="https://n4no.com/projects/storiesNow/">App Website</a>.</li></ul><p>Check <a href="https://twitter.com/b4rtaz">my 🐦 Twitter</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e6d6f6304a72" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>