<?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[idomongo - Medium]]></title>
        <description><![CDATA[Mostly on MongoDB - Medium]]></description>
        <link>https://medium.com/idomongodb?source=rss----702d5bc4851c---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>idomongo - Medium</title>
            <link>https://medium.com/idomongodb?source=rss----702d5bc4851c---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 26 May 2026 22:58:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/idomongodb" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[️Oracle SQL — Split Table Column into words as Records]]></title>
            <link>https://medium.com/idomongodb/%EF%B8%8Foracle-sql-split-table-column-into-words-as-records-33a6d174fae2?source=rss----702d5bc4851c---4</link>
            <guid isPermaLink="false">https://medium.com/p/33a6d174fae2</guid>
            <category><![CDATA[oracle]]></category>
            <category><![CDATA[oracle-database]]></category>
            <category><![CDATA[database-administration]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[Ido Montekyo]]></dc:creator>
            <pubDate>Sun, 24 Sep 2023 13:06:29 GMT</pubDate>
            <atom:updated>2023-09-24T13:06:29.382Z</atom:updated>
            <content:encoded><![CDATA[<h3>🌬️Oracle SQL — Split Table Column into words as Records</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lMPra7gtxMpSJvtJ" /><figcaption>Photo by <a href="https://unsplash.com/@glencarrie?utm_source=medium&amp;utm_medium=referral">Glen Carrie</a> on <a href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>So, I want to create a <a href="https://en.wikipedia.org/wiki/Tag_cloud">word cloud</a> to identify common and major words of my free text, which is split into a column spread over several records.</p><pre>select *<br>from alice_in_wonderland<br><br>1 So she was considering in her own mind (as well as she could, for the hot day made her feel very sleepy and stupid), whether the pleasure of making a daisy-chain would be worth the trouble of getting up and picking the daisies, when suddenly a White Rabbit with pink eyes ran close by her.<br>2 There was nothing so very remarkable in that; nor did Alice think it so very much out of the way to hear the Rabbit say to itself, “Oh dear! Oh dear! I shall be late!” (when she thought it over afterwards, it occurred to her that she ought to have wondered at this, but at the time it all seemed quite natural); but when the Rabbit actually took a watch out of its waistcoat-pocket, and looked at it, and then hurried on, Alice started to her feet, for it flashed across her mind that she had never before seen a rabbit with either a waistcoat-pocket, or a watch to take out of it, and burning with curiosity, she ran across the field after it, and fortunately was just in time to see it pop down a large rabbit-hole under the hedge.<br>3 In another moment down went Alice after it, never once considering how in the world she was to get out again.<br>4 The rabbit-hole went straight on like a tunnel for some way, and then dipped suddenly down, so suddenly that Alice had not a moment to think about stopping herself before she found herself falling down a very deep well.<br>...</pre><h4>Can I create a new table with this text split into words and have one record per word?</h4><p>Luckily, Lalit Kumar explains exactly how to do this <a href="https://lalitkumarb.wordpress.com/2015/03/04/split-comma-delimited-strings-in-a-table-in-oracle/#fromHistory#fromHistory">here</a>.</p><h4>Step #1</h4><ul><li>So, actually, a single whitespace “ “ can be used as the delimiter.</li><li>We can use Oracle’s <a href="https://docs.oracle.com/cd/B19306_01/B14251_01/adfns_regexp.htm">REGEX </a>along with <a href="https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/Hierarchical-Queries.html#GUID-0118DF1D-B9A9-41EB-8556-C6E7D6A5A84E">CONNECT BY</a> (Hierarchical Queries) to get the desired effect.</li></ul><pre>SELECT<br>    TRIM(regexp_substr(t.text, &#39;[^ ]+&#39;, 1, lines.column_value)) text<br>FROM<br>    alice_in_wonderland        t,<br>    TABLE ( CAST(MULTISET(<br>        SELECT<br>            level<br>        FROM<br>            dual<br>        CONNECT BY<br>            regexp_substr(t.text, &#39;[^ ]+&#39;, 1, level) IS NOT NULL<br>    ) AS sys.odcinumberlist) ) lines<br>ORDER BY<br>    lines.column_value<br><br><br>TEXT                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               <br>-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------<br>and<br>dry<br>leaves,<br>and<br>the<br>fall<br>was<br>over.<br><br>...</pre><h4>Step #2</h4><p>Now we can add <a href="https://docs.oracle.com/javadb/10.8.3.0/ref/rrefsqlj32654.html">GROUP BY</a> and <a href="https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/COUNT.html#GUID-AEF08B79-024D-4E3A-B362-9715FB011776">COUNT </a>statements using wrapper SQL statement.</p><pre>SELECT<br>    text,<br>    COUNT(1) word_count<br>FROM<br>    (<br>        SELECT<br>            TRIM(regexp_substr(t.text, &#39;[^ ]+&#39;, 1, lines.column_value)) text<br>        FROM<br>            alice_in_wonderland        t,<br>            TABLE ( CAST(MULTISET(<br>                SELECT<br>                    level<br>                FROM<br>                    dual<br>                CONNECT BY<br>                    regexp_substr(t.text, &#39;[^ ]+&#39;, 1, level) IS NOT NULL<br>            ) AS sys.odcinumberlist) ) lines<br>        ORDER BY<br>            lines.column_value<br>    ) x<br>GROUP BY<br>    text<br>ORDER BY<br>    2 DESC<br><br><br>the 61<br>to 48<br>she 47<br>and 41<br>was 40<br>a 39<br>it 31<br>of 30<br>I 18<br>in 18<br>very 17<br>that 16<br>...</pre><blockquote>Note the space used in the REGEXP satement: regexp_substr(t.text, ‘[^😊]+’, 1, level)</blockquote><p>We got this, Let’s go!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=33a6d174fae2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/idomongodb/%EF%B8%8Foracle-sql-split-table-column-into-words-as-records-33a6d174fae2">🌬️Oracle SQL — Split Table Column into words as Records</a> was originally published in <a href="https://medium.com/idomongodb">idomongo</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Linux — Check Disk Space Usage]]></title>
            <link>https://medium.com/idomongodb/linux-check-disk-space-usage-56d56d581700?source=rss----702d5bc4851c---4</link>
            <guid isPermaLink="false">https://medium.com/p/56d56d581700</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[oracle]]></category>
            <dc:creator><![CDATA[Ido Montekyo]]></dc:creator>
            <pubDate>Sat, 04 Jun 2022 12:09:05 GMT</pubDate>
            <atom:updated>2022-06-04T12:09:05.070Z</atom:updated>
            <content:encoded><![CDATA[<h3>🐧 Linux — Check Disk Space Usage</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*r4Es9tOOT0fAtFuI" /><figcaption>Photo by <a href="https://unsplash.com/@heapdump?utm_source=medium&amp;utm_medium=referral">Patrick Lindenberg</a> on <a href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I got an IO error in my application. Trying to figure out what had happened, I’ve noticed Linux shell commands are generating a<strong><em> “No Space Left on Device”</em></strong> error message. This means once again, my Linux server ran out of disk space.</p><p>Finding out what is consuming disk space is not an easy task and at this point, we cannot install any 3rd party utilities because there is no space left on the device.</p><p>Luckily, we can use the following methods.</p><h3>Method #1 — Using du Command</h3><p>We need to identify the specific directories consuming a large amount of disk space. For this, a directory traversing is required.</p><pre>du -ch --max-depth=2 .</pre><p>Output example:</p><pre>.0K    ./bin<br>0       ./public/images<br>0       ./public/javascripts<br>4.0K    ./public/stylesheets<br>4.0K    ./public<br>12K     ./views<br>8.0K    ./routes<br>8.0K    ./services<br>60K     .<br>60K     total</pre><blockquote>— max-depth=2 is the traversing subdirectory depth.</blockquote><h3>Method #2 — Using the Tree command</h3><p>I am using <a href="https://en.wikipedia.org/wiki/Oracle_Linux">Oracle Enterprise Linux</a> which has the <a href="https://linux.die.net/man/1/tree">Tree </a>command preinstalled.</p><pre>tree --du -h</pre><p>Output example:</p><pre>.<br>├── [ 1.8K]  app.js<br>├── [ 1.6K]  bin<br>│   └── [ 1.5K]  www<br>├── [  392]  package.json<br>├── [  204]  public<br>│   ├── [    6]  images<br>│   ├── [    6]  javascripts<br>│   └── [  134]  stylesheets<br>│       └── [  111]  style.css<br>├── [ 2.0K]  routes<br>│   ├── [ 1.8K]  index.js<br>│   └── [  203]  users.js<br>├── [ 4.9K]  services<br>│   ├── [ 2.5K]  MqttAqBridge.js<br>│   └── [ 2.4K]  QueueService.js<br>└── [  336]  views<br>    ├── [   84]  error.jade<br>    ├── [   66]  index.jade<br>    └── [  125]  layout.jade</pre><pre>11K used in 8 directories, 11 files</pre><h3>Method #3 — Using my own script</h3><p>Writing our own script would be slower and less efficient as we need to recursively traverse the directory tree, however, we can design the printed output as we see fit.</p><pre>#!/bin/bash</pre><pre>dir_recurse() {<br>    cd $1<br> <br> # Calculate depth<br> depth=`pwd | tr -d -c &#39;/&#39; | wc -m`<br>    <br> # Add spaces for tree print<br> empty_space=&quot;&quot;<br> for i in `seq 1 $depth` ; do<br>  empty_space=$empty_space&#39; &#39;<br> done<br> <br> # Calculate disk space used<br> x=`du -skh`<br> echo &quot;${empty_space} ${1} ${x}&quot;<br> <br> # Traverse directories<br>    for i in *;do<br>        if [ -d &quot;$i&quot; ];then<br>            # recurse<br>   dir_recurse &quot;$i&quot; <br>        fi<br>    done<br> cd ..<br>}</pre><pre>dir_recurse .</pre><p>Usage example:</p><pre>./mytree.sh</pre><p>Output example:</p><pre>. 60K       .<br>     bin 4.0K   .<br>     public 4.0K        .<br>      images 0  .<br>      javascripts 0     .<br>      stylesheets 4.0K  .<br>     routes 8.0K        .<br>     services 8.0K      .<br>     views 12K  .</pre><h3>Filtering the output</h3><p>So, three different methods generated a similar output showing the unit of measure e.g. K for Kilobytes, M for Megabytes, or G for Gigabytes. As a typical server holds millions of files, the output will most likely contain lots of small directories we can filter out by using the Linux redirection operator:</p><pre>| grep G</pre><p>For example:</p><pre>tree --du -h | grep G]</pre><p>This will show the directories with Gigabytes of files (or subdirectories).</p><p>There are more methods to check disk space usage. If you know some, feel free to drop a comment and share your thoughts.</p><p>🤝🏼</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=56d56d581700" width="1" height="1" alt=""><hr><p><a href="https://medium.com/idomongodb/linux-check-disk-space-usage-56d56d581700">🐧 Linux — Check Disk Space Usage</a> was originally published in <a href="https://medium.com/idomongodb">idomongo</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Oracle — Query Random Record]]></title>
            <link>https://medium.com/idomongodb/oracle-query-random-record-55c190cc48df?source=rss----702d5bc4851c---4</link>
            <guid isPermaLink="false">https://medium.com/p/55c190cc48df</guid>
            <category><![CDATA[oracle]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[oracle-cloud]]></category>
            <dc:creator><![CDATA[Ido Montekyo]]></dc:creator>
            <pubDate>Mon, 16 May 2022 14:21:22 GMT</pubDate>
            <atom:updated>2022-05-16T14:24:06.574Z</atom:updated>
            <content:encoded><![CDATA[<h3>🦆 Oracle Database— Query Random Record</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qaAX1AQ3KG2r4S44" /><figcaption>Photo by <a href="https://unsplash.com/@jessbaileydesigns?utm_source=medium&amp;utm_medium=referral">Jess Bailey</a> on <a href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I have an Oracle database table with <strong>101 Monday Motivation Quotes</strong> and I would like my app to randomly pick and display a quote on the homepage.</p><h3>What is the easiest way to select a random record from an Oracle database table?</h3><p>The following will result in one random record:</p><pre>SELECT q.text FROM quotes q ORDER BY DBMS_RANDOM.value FETCH NEXT 1 ROWS ONLY;</pre><pre>TEXT                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <br>-----<br>&quot;Start where you are. Use what you have. Do what you can.&quot; - Arthur Ashe</pre><p>The quotes can be found on the <a href="https://www.positivityblog.com/monday-motivation-quotes/"><strong>positivity blog</strong></a></p><p>“A ship is always safe at shore but that is not what it’s built for.”<br><strong>– Albert Einstein</strong></p><p>🍕</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=55c190cc48df" width="1" height="1" alt=""><hr><p><a href="https://medium.com/idomongodb/oracle-query-random-record-55c190cc48df">🦆 Oracle — Query Random Record</a> was originally published in <a href="https://medium.com/idomongodb">idomongo</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ VNC Viewer for macOS]]></title>
            <link>https://medium.com/idomongodb/vnc-viewer-for-macos-2fdc4858c213?source=rss----702d5bc4851c---4</link>
            <guid isPermaLink="false">https://medium.com/p/2fdc4858c213</guid>
            <category><![CDATA[macos]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[mac]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Ido Montekyo]]></dc:creator>
            <pubDate>Sun, 27 Mar 2022 15:12:35 GMT</pubDate>
            <atom:updated>2022-03-27T15:12:35.453Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/890/1*orw6gWUw_NifUU_ykJJn2Q.png" /><figcaption>TigerVNC</figcaption></figure><p><strong>Virtual Network Computing</strong> (<strong>VNC</strong>) is a graphical desktop sharing system that uses the <a href="https://en.wikipedia.org/wiki/RFB_protocol">Remote Frame Buffer protocol (RFB)</a> to remotely control another <a href="https://en.wikipedia.org/wiki/Computer">computer</a>. It transmits the <a href="https://en.wikipedia.org/wiki/Computer_keyboard">keyboard</a> and <a href="https://en.wikipedia.org/wiki/Computer_mouse">mouse</a> input from one computer to another, relaying the graphical-<a href="https://en.wikipedia.org/wiki/Computer_screen">screen</a> updates, over a <a href="https://en.wikipedia.org/wiki/Computer_network">network</a>.</p><h3>Which VNC viewer/client can I use on macOS?</h3><p>There are several VNC clients for macOS. Most of which are <strong>not</strong> free. However, TigerVNC is <strong>free </strong>and can be downloaded via their <a href="https://github.com/TigerVNC/tigervnc/releases">page on GitHub</a>. The current version can be <a href="https://sourceforge.net/projects/tigervnc/files/stable/1.12.0/TigerVNC-1.12.0.dmg/download">downloaded from here</a>.</p><p>TigerVNC was originally based on the (never-released) VNC 4 branch of <a href="http://www.tightvnc.com/"><strong>TightVNC</strong></a>. More information regarding the motivation for creating this project can be found in the <a href="http://mid.mail-archive.com/alpine.LFD.2.00.0902271116020.25749@maggie.lkpg.cendio.se"><strong>project announcement</strong></a>.</p><blockquote><strong>Important note: the version which is installed via </strong><a href="https://brew.sh/"><strong>homebrew</strong></a><strong> E.g. “brew install tiger-vnc” did not work well for me. So, I highly recommend installing manually and not via </strong><a href="https://brew.sh/"><strong>homebrew</strong></a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/220/0*246hzSK_Bmd_V_9p.png" /><figcaption>TigerVNC logo source: wikipedia</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2fdc4858c213" width="1" height="1" alt=""><hr><p><a href="https://medium.com/idomongodb/vnc-viewer-for-macos-2fdc4858c213">🖼 VNC Viewer for macOS</a> was originally published in <a href="https://medium.com/idomongodb">idomongo</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[‍♀️ MongoDB — SQL ROWNUM pseudo column]]></title>
            <link>https://medium.com/idomongodb/%EF%B8%8F-mongodb-sql-rownum-pseudo-column-e203a625e9f8?source=rss----702d5bc4851c---4</link>
            <guid isPermaLink="false">https://medium.com/p/e203a625e9f8</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[sql]]></category>
            <dc:creator><![CDATA[Ido Montekyo]]></dc:creator>
            <pubDate>Tue, 08 Mar 2022 09:21:31 GMT</pubDate>
            <atom:updated>2022-03-08T09:21:31.634Z</atom:updated>
            <content:encoded><![CDATA[<h3>🚣‍♀️ MongoDB — SQL ROWNUM pseudo column</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*u_tpnibadHmPYiBb" /><figcaption>Photo by <a href="https://unsplash.com/@0asa?utm_source=medium&amp;utm_medium=referral">Vincent Botta</a> on <a href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><strong>Oracle</strong> has a <a href="https://docs.oracle.com/cd/B19306_01/server.102/b14200/pseudocolumns009.htm"><strong>ROWNUM</strong></a> Pseudocolumn. For each row returned by a query, the ROWNUM pseudocolumn returns a number indicating the order in which Oracle selects the row from a table or set of joined rows. The first row selected has a ROWNUM of 1, the second has 2, and so on.</p><h3>Does MongoDB have something like Oracle SQL ROWNUM?</h3><p>As of MongoDB version 5.0, there is!</p><blockquote>Definition<br><a href="https://docs.mongodb.com/manual/reference/operator/aggregation/setWindowFields/"><strong>$setWindowFields</strong></a><br>New in version 5.0.</blockquote><blockquote>Performs operations on a specified span of documents in a collection, known as a window, and returns the results based on the chosen window operator.</blockquote><blockquote>Definition<br>New in version 5.0.</blockquote><blockquote><a href="https://docs.mongodb.com/manual/reference/operator/aggregation/documentNumber/"><strong>$documentNumber</strong></a><br>Returns the position of a document (known as the document number) in the $setWindowFields stage partition.</blockquote><h3>Example</h3><p>I have a dataset which is a list of the top largest articles (pages) in <a href="https://en.wikipedia.org/wiki/Wikipedia:Database_reports/Articles_by_size">Wikipedia</a> :</p><pre>{<br>  &quot;<strong>Article</strong>&quot;: &quot;2022 United States House of Representatives elections&quot;,<br>  &quot;<strong>Size</strong>&quot;: 534174<br>}</pre><pre>{<br>  &quot;<strong>Article</strong>&quot;: &quot;COVID-19 pandemic in New South Wales&quot;,<br>  &quot;<strong>Size</strong>&quot;: 526730<br>}</pre><pre>{<br>  &quot;<strong>Article</strong>&quot;: &quot;Ricky Martin&quot;,<br>  &quot;<strong>Size</strong>&quot;: 470596<br>}</pre><pre>...</pre><p>I would like to add a “ranking” by size field to each document that represents an index from the smallest to the largest.</p><p>For example, in the documents above:</p><ul><li>Rank #1 — 2022 United States House of Representatives elections <strong>with a size of 534174</strong></li><li>Rank #2 — COVID-19 pandemic in New South Wales <strong>with a size of 526730</strong></li><li>Rank #3 — Ricky Martin <strong>with</strong> <strong>a</strong> <strong>size of</strong> <strong>470596</strong></li></ul><p>Rank #1 is the largest article and Rank #3 is the smallest in this example.</p><blockquote>In Oracle <strong>SQL</strong> we would simply use <strong>ORDER BY</strong> Size and add the pseudo column <strong>ROWNUM</strong></blockquote><p>In MongoDB we can use an <a href="https://docs.mongodb.com/manual/core/aggregation-pipeline/"><strong>aggregation pipeline</strong></a> with <a href="https://docs.mongodb.com/manual/reference/operator/aggregation/setWindowFields/"><strong>$setWindowFields</strong></a><strong> </strong>and <a href="https://docs.mongodb.com/manual/reference/operator/aggregation/documentNumber/"><strong>$documentNumber</strong></a> in the following manner:</p><pre>[{<strong>$setWindowFields</strong>: {<br> sortBy: {<br>  Size: -1<br> },<br> output: {<br>  rank: {<br>   <strong>$documentNumber</strong>: {}<br>  }<br> }<br>}}]</pre><ul><li>The documents are sorted by size in descending order</li><li>a new field named “rank” is added to each document with the index value in the sorted document list</li></ul><p>So now the collection looks like this:</p><pre>{<br>  &quot;<strong>Article</strong>&quot;: &quot;COVID-19 pandemic in New South Wales&quot;,<br>  &quot;<strong>Size</strong>&quot;: 526730,<br>  &quot;<strong>rank</strong>&quot;: 2<br>}</pre><pre>{<br>  &quot;<strong>Article</strong>&quot;: &quot;List of Falcon 9 and Falcon Heavy launches&quot;,<br>  &quot;<strong>Size</strong>&quot;: 502423,<br>  &quot;<strong>rank</strong>&quot;: 4<br>}</pre><pre>{<br>  &quot;<strong>Article</strong>&quot;: &quot;Presidency of Donald Trump&quot;,<br>  &quot;<strong>Size</strong>&quot;: 491556,<br>  &quot;<strong>rank</strong>&quot;: 5<br>}</pre><pre>...</pre><p>This is a very useful feature that was added to MongoDB 5.0 and I’m utilizing it a lot when building charts in MongoDB Charts.</p><p>⚘</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e203a625e9f8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/idomongodb/%EF%B8%8F-mongodb-sql-rownum-pseudo-column-e203a625e9f8">🚣‍♀️ MongoDB — SQL ROWNUM pseudo column</a> was originally published in <a href="https://medium.com/idomongodb">idomongo</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Who is the Main Character on Friends?]]></title>
            <link>https://medium.com/idomongodb/who-is-the-main-character-on-friends-76cd4bda1b82?source=rss----702d5bc4851c---4</link>
            <guid isPermaLink="false">https://medium.com/p/76cd4bda1b82</guid>
            <category><![CDATA[visualization]]></category>
            <category><![CDATA[friends]]></category>
            <category><![CDATA[tv-series]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[mongodb]]></category>
            <dc:creator><![CDATA[Ido Montekyo]]></dc:creator>
            <pubDate>Tue, 25 Jan 2022 09:37:29 GMT</pubDate>
            <atom:updated>2022-01-25T09:37:29.245Z</atom:updated>
            <content:encoded><![CDATA[<p>According to <a href="https://www.imdb.com/poll/e_vnrDdBZZM/">IMDB</a>, <a href="https://www.imdb.com/title/tt0108778/">Friends</a> is ranked #1 in <a href="https://www.imdb.com/poll/e_vnrDdBZZM/">“the Best Sitcom”</a> poll.</p><p><a href="https://www.imdb.com/title/tt0108778/">Friends</a> aired between 1994–2004, Won 6 Primetime Emmys. However, one question remains unanswered …</p><h3>Who is the main character?</h3><p>Is it Joey, Rachel, Ross, Phoebe, Monica, or Chandler?</p><p>Using <a href="https://en.wikipedia.org/wiki/Quantitative_research"><strong>Quantitative Analysis</strong></a>,<strong> </strong>I tried finding an answer.</p><ul><li>Method #1 — Whoever has the most mentions in the episode title is the main character</li><li>Method #2 — whoever has the most mentions in the episode summary is the main character</li></ul><p>You can view the complete analysis <a href="https://charts.mongodb.com/charts-m220-lmmnj/public/dashboards/627b8ee7-39fa-4397-b6ce-4d9d26a080aa">here</a>.</p><h3>Method #1</h3><p>Each Friends episode is usually <a href="https://www.quora.com/Why-do-the-names-of-all-the-episodes-of-Friends-start-with-the-one-with#:~:text=No%20one%20actually%20remembers%20the,name%20the%20episodes%20that%20way.&amp;text=Not%20all%20episodes%20start%20with%20%E2%80%9CThe%20One%20with%22.">titled</a> either “The One Where” or “The One With,” followed by a character name.</p><p>Here are some examples:</p><ul><li>Season 2 Episode 16: “The One Where Joey Moves Out”</li><li>Season 3 Episode 15: “The One Where Ross and Rachel Take a Break”</li></ul><p>Therefore, the character who appears the most in an Episode’s title is the main character.</p><p>Using this <a href="https://www.kaggle.com/rezaghari/friends-series-dataset">dataset</a> from Kaggle, we can utilize the following information:</p><ul><li><strong>Year of prod</strong>: Year of production</li><li><strong>Season</strong>: Season of the TV Show (1 to 10)</li><li><strong>Episode Title</strong>: The title of the episode</li><li><strong>Duration</strong>: The duration of the episode</li><li><strong>Summary</strong>: A summary of the episode</li><li><strong>Director</strong>: The director of each episode</li><li><strong>Stars</strong>: Ranking on IMDB</li><li><strong>Votes</strong>: How many people voted on IMDB</li></ul><p>So I’ve loaded this dataset into MongoDB and used the following <a href="https://docs.mongodb.com/manual/core/aggregation-pipeline/">aggregation pipeline</a> to count each character mentioned in the episode title. For example, Monica:</p><pre>[{$match: {<br> <strong>Episode_Title</strong>: {<br>  $regex: &#39;<strong>Monica</strong>&#39;<br> }<br>}}, {$group: {<br> _id: 1,<br> myCount: {<br>  $sum: 1<br> }<br>}}, {$addFields: {<br> name: &#39;<strong>Monica</strong>&#39;<br>}}]</pre><p>Which produced the following result:</p><pre>_id: 1<br>myCount: <strong>9</strong><br>name: “<strong>Monica</strong>”</pre><p>Monica was mentioned only in 9 episodes. Then I moved on to the rest of the characters creating a union of all results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UGvzp-viD2KFdAYsBEdVAQ.png" /><figcaption>Number of Mentions in Episode Title</figcaption></figure><p>And so it seems <a href="https://friends.fandom.com/wiki/Rachel_Greene"><strong>Rachel Greene</strong></a> is the main character!</p><p>Followed by Ross, Joey, Chandler, Phoebe, and Monica.</p><h3>Method #2</h3><p>Each episode has a plot. The plot can be summarized.</p><p>Here are some examples:</p><ul><li>Season 1 Episode 19: “The gang frantically search for Ross’s monkey Marcel after Rachel loses him.”</li><li>Season 8 Episode 14: “Chandler’s very curious about a locked closet, but Monica won’t tell him what is inside.”</li></ul><p>Therefore, the character who appears the most in an Episode’s summary is the main character.</p><p>So I’ve utilized the same dataset loaded into MongoDB and revised the <a href="https://docs.mongodb.com/manual/core/aggregation-pipeline/">aggregation pipeline</a> referencing the summary field:</p><pre>[{$match: {<br> <strong>Summary</strong>: {<br>  $regex: &#39;<strong>Monica</strong>&#39;<br> }<br>}}, {$group: {<br> _id: 1,<br> myCount: {<br>  $sum: 1<br> }<br>}}, {$addFields: {<br> name: &#39;<strong>Monica</strong>&#39;<br>}}]</pre><p>Which produced the following result:</p><pre>_id: 1<br>myCount: <strong>152</strong><br>name: “<strong>Monica</strong>”</pre><p>Monica was one of the main characters in 152 episodes. Then I moved on to the rest of the characters creating a union of all results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iW9yH9yeZZXRn2Go2xYKyA.png" /><figcaption>Number of Mentions in Episode Summary</figcaption></figure><p>And so it seems <a href="https://friends.fandom.com/wiki/Rachel_Greene"><strong>Rachel Greene</strong></a> again is the main character!</p><p>Followed by Monica, Chandler, Ross, Joey, and Phoebe.</p><h3>Method #3</h3><p>What if a single method is not enough to determine who is the main character?</p><p>We can combine Method #1 + #2 to have a new type of score.</p><p>As it happens, Rachel is the winner in each Method, so it is safe to determine.</p><h4>🥇Rachel Greene is the winner and the main character in Freinds!🥇</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TReN3amPnS8RmImms_yN5w.png" /><figcaption>Top 100 Episodes</figcaption></figure><h3>Bonus: “The One Where” VS. “The One With”</h3><p>There were 163 episodes of “The One With” and 54 episodes of “The One Where”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ph0zaom_RFQIf_ObnEGLPA.png" /><figcaption>With VS. Where</figcaption></figure><h3>Final Thoughts</h3><p>The full analysis can be viewed <a href="https://charts.mongodb.com/charts-m220-lmmnj/public/dashboards/627b8ee7-39fa-4397-b6ce-4d9d26a080aa">here</a>.</p><p>Who is the most favorite character in Friends? 🤔</p><p>(mine is Ross)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=76cd4bda1b82" width="1" height="1" alt=""><hr><p><a href="https://medium.com/idomongodb/who-is-the-main-character-on-friends-76cd4bda1b82">Who is the Main Character on Friends?</a> was originally published in <a href="https://medium.com/idomongodb">idomongo</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MongoDB — Unions ]]></title>
            <link>https://medium.com/idomongodb/mongodb-unions-cb102d6d37ea?source=rss----702d5bc4851c---4</link>
            <guid isPermaLink="false">https://medium.com/p/cb102d6d37ea</guid>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[oracle]]></category>
            <dc:creator><![CDATA[Ido Montekyo]]></dc:creator>
            <pubDate>Sun, 23 Jan 2022 16:23:15 GMT</pubDate>
            <atom:updated>2022-01-23T16:23:15.512Z</atom:updated>
            <content:encoded><![CDATA[<h3>MongoDB — Unions 🇬🇧</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*IYLhJ0uCR5-RZABh.png" /><figcaption>Image from <a href="https://en.wikipedia.org/wiki/Union_(set_theory)">Wikipedia</a></figcaption></figure><p>In <a href="https://en.wikipedia.org/wiki/Set_theory">set theory</a>, the <strong>union</strong> (denoted by ∪) of a collection of <a href="https://en.wikipedia.org/wiki/Set_(mathematics)">sets</a> is the set of all <a href="https://en.wikipedia.org/wiki/Element_(set_theory)">elements</a> in the collection.</p><p>In <a href="https://en.wikipedia.org/wiki/SQL">SQL</a> the <strong>UNION</strong> clause combines the results of two SQL queries into a single <a href="https://en.wikipedia.org/wiki/Table_(database)">table</a> of all matching <a href="https://en.wikipedia.org/wiki/Row_(database)">rows</a>. The two queries must result in the same number of <a href="https://en.wikipedia.org/wiki/Column_(database)">columns</a> and compatible <a href="https://en.wikipedia.org/wiki/Data_type">data types</a> in order to unite. Any duplicate records are automatically removed unless UNION ALL is used.</p><h3>Can we do a UNION in MongoDB?</h3><p>We sure can! as of Version 4.4, we have <a href="https://docs.mongodb.com/manual/reference/operator/aggregation/unionWith/">$unionWith</a>.</p><p>Let’s take a closer look using this <a href="https://medium.com/p/cb102d6d37ea/edit"><strong>friends</strong></a> dataset:</p><pre>{<br> “Year_of_prod”: 1995,<br> “Season”: 2,<br> “Episode Number”: 9,<br> “Episode_Title”: “The One with Phoebe’s Dad”,<br> “Duration”: 22,<br> “Summary”: “Phoebe tracks down her father, but isn’t sure whether she should meet him. Ross asks Rachel to make a list of pros and cons about him.”,<br> “Director”: “Kevin Bright”,<br> “Stars”: 8,<br> “Votes”: 3444<br>}</pre><ul><li>This episodes collection has a document per episode in <a href="https://www.imdb.com/title/tt0108778/"><strong>Friends</strong></a></li><li>Each document has an <strong>Episode_Title</strong> field which is <a href="https://www.quora.com/Why-do-the-names-of-all-the-episodes-of-Friends-start-with-the-one-with#:~:text=No%20one%20actually%20remembers%20the,name%20the%20episodes%20that%20way.&amp;text=Not%20all%20episodes%20start%20with%20%E2%80%9CThe%20One%20with%22.">usually</a> something like: “The one where…” or “The one with…”</li></ul><h4>The One Where VS. The One With</h4><p>Now, Let’s query how many episodes there are of each type.</p><p>The following <a href="https://docs.mongodb.com/manual/core/aggregation-pipeline/">aggregation pipeline</a> counts how many episodes had the title “The One Where” using <strong>$regex</strong> and <strong>$group</strong>:</p><pre>[{$match: {<br> Episode_Title: {<br>  $regex: &#39;<strong>The One Where</strong>&#39;<br> }<br>}}, {$group: {<br> _id: &#39;<strong>where</strong>&#39;,<br> count: {<br>  $sum: 1<br> }<br>}}]</pre><p>The result:</p><pre>_id: “where”<br>count: 54</pre><p>Now, we can use <a href="https://docs.mongodb.com/manual/reference/operator/aggregation/unionWith/">$unionWith</a></p><blockquote><em>New in version 4.4</em>.</blockquote><blockquote>Performs a union of two collections; i.e. <a href="https://docs.mongodb.com/manual/reference/operator/aggregation/unionWith/#mongodb-pipeline-pipe.-unionWith">$unionWith</a> combines pipeline results from two collections into a single result set. The stage outputs the combined result set (including duplicates) to the next stage.</blockquote><p>I’ll duplicate the previous pipeline and change the strings to “The One with” accordingly:</p><pre>[{$match: {<br> Episode_Title: {<br>  $regex: &#39;<strong>The One with</strong>&#39;<br> }<br>}}, {$group: {<br> _id: &#39;<strong>with</strong>&#39;,<br> count: {<br>  $sum: 1<br> }<br>}}]</pre><p>Finally, we’ll paste into the $unionWith step in the pipeline statement:</p><pre>[{$match: {<br> Episode_Title: {<br>  $regex: &#39;The One Where&#39;<br> }<br>}}, {$group: {<br> _id: &#39;where&#39;,<br> count: {<br>  $sum: 1<br> }<br>}}, <strong>{$unionWith: {<br> coll: &#39;episodes&#39;,<br> pipeline: [<br>  {<br>   $match: {<br>    Episode_Title: {<br>     $regex: &#39;The One with&#39;<br>    }<br>   }<br>  },<br>  {<br>   $group: {<br>    _id: &#39;with&#39;,<br>    count: {<br>     $sum: 1<br>    }<br>   }<br>  }<br> ]<br>}</strong>}]</pre><p>The result is a union of both queries:</p><pre>_id: “where”<br>count: 54</pre><pre>_id: “with”<br>count: 163</pre><p>🍿</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb102d6d37ea" width="1" height="1" alt=""><hr><p><a href="https://medium.com/idomongodb/mongodb-unions-cb102d6d37ea">MongoDB — Unions 🇬🇧</a> was originally published in <a href="https://medium.com/idomongodb">idomongo</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Optimism Bias Illustration with Rocky Movie Franchise ]]></title>
            <link>https://medium.com/idomongodb/optimism-bias-illustration-with-rocky-movie-franchise-ac64af1e0bb?source=rss----702d5bc4851c---4</link>
            <guid isPermaLink="false">https://medium.com/p/ac64af1e0bb</guid>
            <category><![CDATA[self-improvement]]></category>
            <category><![CDATA[coaching]]></category>
            <category><![CDATA[life-lessons]]></category>
            <category><![CDATA[mental-health]]></category>
            <category><![CDATA[wellbeing]]></category>
            <dc:creator><![CDATA[Ido Montekyo]]></dc:creator>
            <pubDate>Sat, 15 Jan 2022 06:11:19 GMT</pubDate>
            <atom:updated>2022-01-15T06:11:19.552Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CXqo789LCVqxrQ0OC_ou7g.png" /></figure><p><a href="https://en.wikipedia.org/wiki/Optimism_bias">Optimism bias</a> is a tendency to overestimate the likelihood of positive events occurring in the future and underestimate the likelihood of negative life events. Such biased expectations are generated and maintained in the face of counter-evidence through a tendency to discount undesirable information. An optimism bias <strong>can alter risk perception and decision-making in many domains, ranging from finance to health.</strong></p><p><a href="https://en.wikipedia.org/wiki/Optimism_bias">Optimism bias</a> can be demonstrated using the <a href="https://en.wikipedia.org/wiki/Rocky_(franchise)">Rocky movie franchise</a>. In Rocky 3, Rocky’s decision to fight led to a series of life-altering events <strong>ranging from finance to health</strong>.</p><p>Let’s recap the movies starting Rocky 1 all the way up to Rocky 5 and examine what had actually happened in comparison to what could have happened if only Rocky had decided not to fight.</p><p>(In case you haven’t watched the movies, it is recommended to watch them before continuing to read this)</p><h4>ROCKY I</h4><ul><li>Rocky is poor</li><li>Rocky falls in love with Adrian (<a href="https://en.wikipedia.org/wiki/Talia_Shire">Talia Shire</a>)</li><li>Rocky fights Apollo (<a href="https://en.wikipedia.org/wiki/Carl_Weathers">Carl Weathers</a>) for the heavyweight championship</li></ul><h4>ROCKY II</h4><ul><li>Rocky is still poor</li><li>Rocky marries Adrian</li><li>Rocky wins against Apollo for the heavyweight championship</li></ul><p>Now, this is where we split into two timelines as Rocky’s life takes a turn in Rocky 3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p40FsBSjeEDlWbjwRIC2kA.png" /><figcaption>2 timelines</figcaption></figure><h3>What Actually Happened</h3><h4>ROCKY III</h4><ul><li>Rocky is now rich and doesn’t need to fight for a living</li><li>Rocky once publicly provoked, decides to fight against Clubber Lang (<a href="https://en.wikipedia.org/wiki/Mr._T">Mr. T</a>) after winning all his fights during the last 5 years</li><li>A few minutes before the fight, his beloved trainer (coach) Mik (<a href="https://en.wikipedia.org/wiki/Burgess_Meredith">Burgess Meredith</a>) collapses and dies</li><li>Rocky loses the championship belt to Clubber Lang</li><li>Rocky’s past opponent Apollo Creed decides to encourage and train Rocky for a rematch (<a href="https://www.youtube.com/watch?v=ERT_7u5L0dc">eye of the tiger</a>). They become friends</li><li>Rocky beats Clubber Lang in a rematch and regain the championship title</li></ul><p>All well ends well? not exactly. Mik’s premature death could have been avoided.</p><h4>ROCKY IV</h4><ul><li>Apollo decides to fight against a Russian champion named Drago (<a href="https://en.wikipedia.org/wiki/Dolph_Lundgren">Dolph Lundgren</a>) and asks Rocky to become his trainer</li><li>Apollo dies during an exhibition fight against Drago</li><li>Rocky fly to Russia to train before his fight against Drago</li><li>Rocky beats Drago (<a href="https://www.youtube.com/watch?v=Uc6tQH8yHF8">everybody can change</a>)</li></ul><p>All well ends well? not exactly. Apollo’s premature death could have been avoided.</p><h4>ROCKY V</h4><ul><li>Rocky is back in the USA only to discover his brother-in-law Paulie (<a href="https://en.wikipedia.org/wiki/Burt_Young">Burt Young</a>) lost all of Rocky’s money</li><li>Rocky is now poor</li><li>Due to his last match against Drago, Rocky now has neurological damage</li><li>Rocky is living in a bad neighborhood and his son is being bullied and having a hard time in school</li><li>Rocky takes a young and talented fighter under his wing training him for the heavyweight title</li><li>Rocky betrayed by his protege, ends up winning a street fight against him (<a href="https://www.youtube.com/watch?v=FEWiUkPThEw">only in America</a>)</li></ul><p>All well ends well? not exactly. Rocky is poor and his family is having a hard time.</p><h3>What Could Have Happened</h3><p>If only Rocky had stepped down in Rocky 3 and enjoyed a quiet retirement the following could have been avoided:</p><ol><li><strong>Mik would have lived longer </strong>(instead of dying a few minutes before the fight)</li><li><strong>Apollo wouldn’t have died</strong> (Rocky would have never become friends with Apollo and as a result wouldn’t have encouraged Apollo)</li><li><strong>Rocky wouldn’t have lost all his money </strong>(Rocky would have gone to Russia and left Paulie in charge only to lose all of his money)</li><li><strong>Rocky wouldn’t have neurological damage </strong>(Rocky would never fight Drago to avenge Apollo’s death)</li><li><strong>Rocky’s family wouldn’t have had a hard time being poor </strong>(Rocky would never become poor)</li></ol><p>But hey! we wouldn’t have 3 additional Rocky movies.</p><h3>Final Thoughts</h3><p>“Let me tell you something you already know. The world ain’t all sunshine and rainbows. It’s a very mean and nasty place and I don’t care how tough you are it will beat you to your knees and keep you there permanently if you let it. You, me, or nobody is gonna hit as hard as life. But it ain’t about how hard ya hit. It’s about how hard you can get hit and keep moving forward. How much you can take and keep moving forward. That’s how winning is done! Now if you know what you’re worth then go out and get what you’re worth. But ya gotta be willing to take the hits, and not pointing fingers saying you ain’t where you wanna be because of him, or her, or anybody! Cowards do that and that ain’t you! You’re better than that! I’m always gonna love you no matter what. No matter what happens. You’re my son and you’re my blood. You’re the best thing in my life. But until you start believing in yourself, ya ain’t gonna have a life.“</p><p>(<a href="https://www.youtube.com/watch?v=Pf77t-rUdAo">Rocky Balboa 2006</a>)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac64af1e0bb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/idomongodb/optimism-bias-illustration-with-rocky-movie-franchise-ac64af1e0bb">Optimism Bias Illustration with Rocky Movie Franchise 🥊</a> was originally published in <a href="https://medium.com/idomongodb">idomongo</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Companies Gone Public in 2021]]></title>
            <link>https://medium.com/idomongodb/companies-gone-public-in-2021-d2a664f52ab2?source=rss----702d5bc4851c---4</link>
            <guid isPermaLink="false">https://medium.com/p/d2a664f52ab2</guid>
            <category><![CDATA[stock-market]]></category>
            <category><![CDATA[stocks]]></category>
            <category><![CDATA[market-research-reports]]></category>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[marketing]]></category>
            <dc:creator><![CDATA[Ido Montekyo]]></dc:creator>
            <pubDate>Sun, 09 Jan 2022 18:55:05 GMT</pubDate>
            <atom:updated>2022-01-10T05:50:44.478Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZdoTTRllv6VxlVFYZmkdLw.png" /><figcaption>Stocks Performance</figcaption></figure><p><a href="https://charts.mongodb.com/charts-m220-lmmnj/public/dashboards/2d88aa05-8696-4ab0-9473-653cb9191616"><strong>68</strong> <strong>companies</strong></a> have gone public during 2021. 6 of which were <a href="https://en.wikipedia.org/wiki/Direct_public_offering"><strong>Direct Listing</strong></a>. 9 were <a href="https://en.wikipedia.org/wiki/Special-purpose_acquisition_company"><strong>SPAC</strong></a> and 53 were <a href="https://en.wikipedia.org/wiki/Initial_public_offering"><strong>IPO</strong></a>.</p><blockquote>A <strong>direct public offering</strong> (<strong>DPO</strong>) or <strong>direct listing</strong> is a method by which a company can offer an investment opportunity directly to the public.</blockquote><blockquote>A <strong>special purpose acquisition company</strong> (<strong>SPAC</strong>), is a <a href="https://en.wikipedia.org/wiki/Shell_corporation">shell corporation</a> listed on a <a href="https://en.wikipedia.org/wiki/Stock_exchange">stock exchange</a> with the purpose of acquiring a <a href="https://en.wikipedia.org/wiki/Private_company">private company</a>, thus making it <a href="https://en.wikipedia.org/wiki/Public_company">public</a> without going through the traditional <a href="https://en.wikipedia.org/wiki/Initial_public_offering">initial public offering</a> process.</blockquote><blockquote>An <strong>initial public offering</strong> (<strong>IPO</strong>) or <strong>stock launch</strong> is a <a href="https://en.wikipedia.org/wiki/Public_offering">public offering</a> in which shares of a company are sold to <a href="https://en.wikipedia.org/wiki/Institutional_investor">institutional investors</a> and usually also retail (individual) investors.</blockquote><p>Inspired by <a href="https://www.visualcapitalist.com/companies-gone-public-in-2021-visualizing-ipo-valuations/">this visualization</a> and <a href="https://news.crunchbase.com/news/heres-whos-gone-public-in-2021-so-far/">this article</a>, I tried to find out whether the method used for “going public” had any long-run effect on the stock price. By building <a href="https://charts.mongodb.com/charts-m220-lmmnj/public/dashboards/2d88aa05-8696-4ab0-9473-653cb9191616"><strong>this dashboard</strong></a>, I was able to perform some analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*esCCV92kAMQOkPaCwi1u7g.png" /><figcaption>Listing Types</figcaption></figure><p>By comparing the initial public offering price to today’s January 9th, 2022 price and checking if the stock went up or down, we can see that:</p><ol><li><strong>28%</strong> of companies gone public using IPO went up, while <strong>71%</strong> went down.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*rrsjcqf97b5XldGxfqt0cA.png" /><figcaption>IPO</figcaption></figure><p>2. <strong>100%</strong> of companies gone public using <strong>SPAC</strong> went down.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*PIcokGXGbA4tCnyTnZ4QBQ.png" /><figcaption>SPAC</figcaption></figure><p>3. <strong>50%</strong> of companies gone public using <strong>Direct Listing</strong> went up, while <strong>50%</strong> went down.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*sL36WWim5WrLcNOi6T5mrw.png" /><figcaption>Direct</figcaption></figure><p>We can also check the average stock performance per “Listing Type” and see that most stocks went down more than up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*x_qeUbbMWP0hFwOl4L8KeA.png" /><figcaption>Average Stock Performance</figcaption></figure><p>We can see that SPAC was used only during the first half of 2021.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*agHpYTVVFFfvUuoXedWJQw.png" /></figure><h3>Final Thoughts</h3><p>SPAC? hmm.</p><p><a href="https://charts.mongodb.com/charts-m220-lmmnj/public/dashboards/2d88aa05-8696-4ab0-9473-653cb9191616">The Dashboard</a> can be viewed <a href="https://charts.mongodb.com/charts-m220-lmmnj/public/dashboards/2d88aa05-8696-4ab0-9473-653cb9191616">here</a>. Any feedback is welcomed and appreciated 🙏🏻</p><p>I’ve also published the dataset used in <a href="https://www.kaggle.com/idomon/companies-gone-public-in2021">Kaggle</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2a664f52ab2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/idomongodb/companies-gone-public-in-2021-d2a664f52ab2">📈Companies Gone Public in 2021</a> was originally published in <a href="https://medium.com/idomongodb">idomongo</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Why isn’t “nohup” working on macOS?]]></title>
            <link>https://medium.com/idomongodb/why-isnt-nohup-working-on-macos-1e1a8df984?source=rss----702d5bc4851c---4</link>
            <guid isPermaLink="false">https://medium.com/p/1e1a8df984</guid>
            <category><![CDATA[macbook]]></category>
            <category><![CDATA[shell]]></category>
            <category><![CDATA[bash]]></category>
            <category><![CDATA[mac]]></category>
            <category><![CDATA[macos]]></category>
            <dc:creator><![CDATA[Ido Montekyo]]></dc:creator>
            <pubDate>Wed, 29 Sep 2021 18:30:17 GMT</pubDate>
            <atom:updated>2021-09-29T18:30:17.253Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0WNOymix1B7PhZUR" /><figcaption>Photo by <a href="https://unsplash.com/@patrikward?utm_source=medium&amp;utm_medium=referral">Patrick Ward</a> on <a href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>If you are working with Linux you are probably using the <a href="https://en.wikipedia.org/wiki/Nohup">nohup</a> command.</p><p><strong>nohup</strong> is a <a href="https://en.wikipedia.org/wiki/POSIX">POSIX</a> command which means “no hang-up”. Its purpose is to execute a command such that it ignores the <a href="https://en.wikipedia.org/wiki/SIGHUP">HUP</a> (hangup) signal and therefore does not stop when the user logs out.</p><p>nohup is how I am able to run commands/apps/jobs in a terminal session in the background so when I am closing the terminal session, the process remains running in the background.</p><p>However, for some reason, this is not working for me on macOS.</p><p>For example, I wrote the following script:</p><ol><li>Kill Microsoft Teams process</li><li>Delete Microsoft Teams local cache directory</li><li>Relaunch Microsoft Teams app</li></ol><pre>ps -ef | grep teams | cut -d &quot; &quot; -f2 | xargs kill -9</pre><pre>sleep 3</pre><pre>rm -rf &quot;/Users/me/Library/Application Support/Microsoft/Teams&quot;</pre><pre><strong>nohup &quot;/Applications/Microsoft Teams.app/Contents/MacOS/Teams&quot; &amp;</strong></pre><p>But each time this script finished executing and the terminal window is closed, the Microsoft Teams app is terminated as well.</p><p>Using the <a href="https://ss64.com/osx/screen.html">screen</a> command instead of nohup didn’t work as well and the only workaround I’ve found for this is using the <a href="https://ss64.com/osx/open.html">open</a> command:</p><pre>ps -ef | grep teams | cut -d &quot; &quot; -f2 | xargs kill -9</pre><pre>sleep 3</pre><pre>rm -rf &quot;/Users/me/Library/Application Support/Microsoft/Teams&quot;</pre><pre><strong>open -a</strong> &quot;/Applications/Microsoft Teams.app/Contents/MacOS/Teams&quot;</pre><p>Now the script finished executing yet the Teams app is still running in the background.</p><p>🐈‍⬛</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1e1a8df984" width="1" height="1" alt=""><hr><p><a href="https://medium.com/idomongodb/why-isnt-nohup-working-on-macos-1e1a8df984">🍎 Why isn’t “nohup” working on macOS?</a> was originally published in <a href="https://medium.com/idomongodb">idomongo</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>