<?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 Ahmed Ibrahim on Medium]]></title>
        <description><![CDATA[Stories by Ahmed Ibrahim on Medium]]></description>
        <link>https://medium.com/@ahmedibrahhim?source=rss-29ef55eb2e9e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*OhW0DvvwWdnfjKCk8mL4qA.png</url>
            <title>Stories by Ahmed Ibrahim on Medium</title>
            <link>https://medium.com/@ahmedibrahhim?source=rss-29ef55eb2e9e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 09:07:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ahmedibrahhim/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[The power of Node.js streams.]]></title>
            <link>https://medium.com/@ahmedibrahhim/the-power-of-node-js-streams-451fcb0134eb?source=rss-29ef55eb2e9e------2</link>
            <guid isPermaLink="false">https://medium.com/p/451fcb0134eb</guid>
            <category><![CDATA[stream]]></category>
            <category><![CDATA[buffer]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Ahmed Ibrahim]]></dc:creator>
            <pubDate>Sat, 25 Apr 2020 23:11:02 GMT</pubDate>
            <atom:updated>2020-04-25T23:11:02.687Z</atom:updated>
            <content:encoded><![CDATA[<h4>Streams are one of the most powerful features of Node.js</h4><p><strong>What are Node.js streams?</strong></p><p>Streams are collections of data (Sequence of data) just like arrays or strings. The difference is that streams might not be available all at once, and they don’t have to fit in memory. This makes streams really powerful when working with large amounts of data, or data that’s coming from an external source one <em>chunk</em> at a time. The opposite of streams is buffering which means to receive the data and send It once a time.</p><p>Very Common example of streams and buffers:</p><p>— Watching Live Video ( Stream )</p><p>— Download a Video ( Buffer )</p><p><strong>Buffering versus streaming</strong></p><p>If we write a simple program that takes a simple input from the user i.e ( Hello Node.js ) and sends it a certain consumer for the buffer modal It will wait to receive<em> all the inputs</em> from the user then send the complete buffer to the consumer</p><p>The following diagram shows a visual example of this paradigm:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*On0DNxruUhPcpcwYJvtDOQ.png" /></figure><p>We can notice that, at the time t1, some data is received from the<br>resource and saved into the buffer. At the time t2, another data chunk is received. The final one that completes the read operation and causes the entire buffer to be sent to the consumer.</p><p>On the other side, streams allow you to process the data as soon as it arrives from the resource. This is shown in the following diagram:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/866/1*Hysp3M6dBKezQXZzjmhbUQ.png" /></figure><p>The diagram shows you how each new chunk of data is received from the<br>resource and is immediately provided to the consumer, who now has the chance to process it straight away without waiting for all the data to be collected in the buffer.</p><p>But what are the differences between the two approaches? We can summarize them into two major categories:</p><ul><li>Spatial efficiency</li><li>Time efficiency</li></ul><h3>Spatial efficiency</h3><p>streams allow us to do things that would not be possible, by buffering data and processing it all at once. Imagine reading a few of these big files concurrently; our application will easily run out of memory. Besides that, buffers in V8 cannot be bigger than 0x3FFFFFFF bytes (a little bit less than 1GB).</p><h3>Time efficiency</h3><p>Let’s now consider an application that compresses a file and uploads it to a remote HTTP server, which in turn decompresses it and saves it on the filesystem. If our client was implemented using a buffered API, the upload would start only when the entire file has been read and compressed. On the other hand, the decompression will start on the server only when all the data has been received. A better solution to achieve the same result<br>involves the use of streams. On the client machine, streams allow you to compress and send the data chunks as soon as they are read from the filesystem, whereas on the server, it allows you to decompress every chunk as soon as it is received from the remote peer. The following diagram should give us a hint</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/851/1*vzjCmd2LtM6XNPDMtzkEMg.png" /></figure><p>I hope this gives you a quick intro about Streams / Buffer with node.js</p><p>— Note: Some parts quoted from Node.js-Design-Patterns-2nd-Edition-by-Mario-Casciaro-Luciano-Mammino</p><p>Thank you,,</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=451fcb0134eb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[BloodBot — Messenger bot allows people to request blood donation from nearby donors .]]></title>
            <link>https://medium.com/bottutorials/bloodbot-messenger-bot-allows-people-to-request-blood-donation-from-nearby-donors-5c2f3298c1d7?source=rss-29ef55eb2e9e------2</link>
            <guid isPermaLink="false">https://medium.com/p/5c2f3298c1d7</guid>
            <category><![CDATA[social-good]]></category>
            <category><![CDATA[bots]]></category>
            <category><![CDATA[new-bots]]></category>
            <category><![CDATA[messenger-bots]]></category>
            <category><![CDATA[chatbots]]></category>
            <dc:creator><![CDATA[Ahmed Ibrahim]]></dc:creator>
            <pubDate>Thu, 08 Jun 2017 22:18:32 GMT</pubDate>
            <atom:updated>2017-06-11T06:06:28.930Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X4Ss3MfR3i2U0m-iBleljw.png" /></figure><h3>What is blood bot ?</h3><p><a href="http://m.me/savealifebot?ref=md">Blood bot</a> is the first messenger bot that allows people to request blood donation from nearby donors and also give the ability to everyone to be a blood donor at the nearby area if his age is 18 or older and he did the blood examination test .</p><h3>How it works ?</h3><p>when you came to the bot for the first time , you ‘ll have a brief introduction about how it works and the pre-requirements from donor and receiver ,</p><ul><li>Donor : will be asked to choose his blood type ,age,location ( user can send his location by writing it or using messenger location button ) and optional enter his phone number</li><li>Receiver : When you request a blood donation you’ll be asked to send your location , and choose the needed blood type, write a case description about why he/she need the blood and also the phone number is optional step .</li><li>Algorithm : Bot listen to new request every 5 seconds , whenever it found a new request and it get it is location and match it with the users location to get donors nearby this location with the same blood type <strong>then broadcast a message to everyone around this user asking him to donate blood for someone nearby .</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*RRURQEcmnKFNDpf_iCHxCA.png" /></figure><ul><li>When user choose ‘i’m ready’ he’ll have a various ways of communication between the two sides , he can talk directly trough <strong>chat </strong>that created through the bot</li><li>Get the second side information i.e phone number , name ) if he did not skip the phone number step .</li><li>send the 2nd side his information ( i.e phone number , name ) if he did not skip the phone number step .</li></ul><h3>Then ? what is going to happen ?</h3><p>Blood bot will get back to the user who accept to donate after few hours asking him if he completed his donation properly ?</p><ul><li>if the user reply with ‘yes , i’v completed the donation ‘ the bot gets back to the receiver and asking him , if he received the donation from (i.e Ahmed ) as he mentioned ? if both sides confirm the process .. the request state change to be completed ,and donors will not be receiving any new requests till 3 months .</li></ul><h3><strong>Something else ?</strong></h3><p>yes , blood bot has many future to be describe</p><ul><li>if user does not know his blood type and reply to the bot ‘ how do i know ‘ blood bot will guide to the steps he should take to know his blood type .</li><li>Real-time statistics ( how many donor we have , how many country we’re in , how many request is being preformed )</li><li>Nearby hospitals :You’ll get an access to know all nearby hospitals ( it is rate , and how to reach it from your location ) .</li><li>….</li></ul><p>Interested ? try it : <a href="http://m.me/SavealifeBot?ref=md">http://m.me/SavealifeBot?ref=md</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y3z5VLBgV0MXTtE-Q-r88w.jpeg" /></figure><blockquote>Click❤ to recommend this to other Medium readers interested in AI, chatbots and development.</blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2F833420-2%3Fas_embed%3Dtrue&amp;dntp=1&amp;url=https%3A%2F%2Fupscri.be%2F833420-2%2F&amp;image=https%3A%2F%2Fe.enpose.co%2F%3Fkey%3DdRXnS9Gplk%26w%3D700%26h%3D425%26url%3Dhttps%253A%252F%252Fupscri.be%252F833420-2%252F%253Fenpose&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/243670c9ffaa9e93541d1cf07faa2b05/href">https://medium.com/media/243670c9ffaa9e93541d1cf07faa2b05/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5c2f3298c1d7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bottutorials/bloodbot-messenger-bot-allows-people-to-request-blood-donation-from-nearby-donors-5c2f3298c1d7">BloodBot — Messenger bot allows people to request blood donation from nearby donors .</a> was originally published in <a href="https://medium.com/bottutorials">Dev Stash</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>