<?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 Lior Katz on Medium]]></title>
        <description><![CDATA[Stories by Lior Katz on Medium]]></description>
        <link>https://medium.com/@liorkatz?source=rss-9649ff8ec140------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*L4KgsNBuCQX1hFUQE2fZYA.jpeg</url>
            <title>Stories by Lior Katz on Medium</title>
            <link>https://medium.com/@liorkatz?source=rss-9649ff8ec140------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 23 May 2026 16:25:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@liorkatz/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 Winners Of The Last Decade]]></title>
            <link>https://medium.com/@liorkatz/the-winners-of-the-last-decade-a30dd55aed96?source=rss-9649ff8ec140------2</link>
            <guid isPermaLink="false">https://medium.com/p/a30dd55aed96</guid>
            <category><![CDATA[evaluation]]></category>
            <category><![CDATA[unicorns]]></category>
            <category><![CDATA[venture-capital]]></category>
            <category><![CDATA[business]]></category>
            <category><![CDATA[private-equity]]></category>
            <dc:creator><![CDATA[Lior Katz]]></dc:creator>
            <pubDate>Sat, 18 May 2019 14:12:27 GMT</pubDate>
            <atom:updated>2019-05-26T08:37:22.399Z</atom:updated>
            <content:encoded><![CDATA[<p>Let&#39;s think for a few seconds, who are the winners of the last decade? I’m talking about the people who had built the largest wealth since 2009.</p><p>Maybe the question that needs to be asked is: <strong>who </strong>made money in the past ten years, and <strong>how</strong>? What we have seen is people building wealth not by developing margins (profits), but by the rising valuations of their holdings. It’s not a secret that we have seen money flowing to the economies in amounts that have never seen before, and the interest rates are in the lowest levels that they have ever been for so long. That scenario caused assets prices to go up, in almost every class, and returns on these assets to go down accordingly.</p><p>So the money was made by holding assets, rather it is real assets, stocks or what not. But let’s focus on the people who actually built companies during this period, and not just owned real estate and such. When looking into those companies, we can spot a strange trend: valuations are going up while profitability is going down, and in most cases, it doesn’t even exist. How did it happen?</p><p>Valuation of a company is <strong>largely </strong>based on two things: its assets and income vs expenses (profits), i.e. the present, and growth, i.e. the future. For companies, money can flow from two places, one is from the bottom, i.e. from the consumers, and the other is from the top, the investors. What we have seen is a tsunami of capital coming from the top, and not enough money coming from the bottom. There are people who never made a profit in their lifetime and yet, they are billionaires. You don’t have to have an MBA from an Ivy league school to sense that there is something wrong, just a bit of common sense.</p><p>Well, these companies and investors, as expected, have one response to this: growth. Some add economies of scale. There are cases where it is true, but is it true for all of them? A dream may come true, and it may not. And these companies are priced mainly based on a dream. At some point, and we see this happening right now with the recent IPOs, the private market capital is not going to be sufficient for the growth needs and private equity investors will want to cash out, so these companies are going to have to go public. When this happens, the real price is eventually going to unfold. And then we‘ll see who can create a profit and who doesn’t.</p><p>lkform@gmail.com</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a30dd55aed96" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Simple Way to Understand Decorators]]></title>
            <link>https://medium.com/@liorkatz/the-simple-way-to-understand-decorators-80d8bb1f229a?source=rss-9649ff8ec140------2</link>
            <guid isPermaLink="false">https://medium.com/p/80d8bb1f229a</guid>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Lior Katz]]></dc:creator>
            <pubDate>Tue, 26 Mar 2019 20:50:57 GMT</pubDate>
            <atom:updated>2019-06-28T17:51:12.383Z</atom:updated>
            <content:encoded><![CDATA[<p>A decorator is a super important concept in Python, and everyone who wants to become a Python developer must understand decorators. I’m going to split the article to questions and answers so it will be more organized for the eye and mind, and also will allow you to skip parts you may already know.</p><h3>So what is a decorator?</h3><p>Essentially, a decorator is a design pattern, a tool if you like, that let you add functionality to a given function or a class without writing extra code.</p><h3>Why do we need it?</h3><p>Let’s start with a true story: you’re building an app, and you have 30 classes that in each of them there’s a post() function (you’re planning on sending requests to a server). All of a sudden the devops guy, who you thought of as your friend, tells you that there’s a change in the architecture, and you need to make sure that for each post request the person who sends the request has a valid access token, i.e. he’s allowed to send the request, in order to protect the end point. What? am I actually going to modify 30 functions? I was planning to go home in a reasonable hour today.. oh wait, there’s a thing called a decorator. If I’ll be able to write a function that adds this validation functionality, I will just need to write it once and add its signature before each post function and I’ll be home before dark.</p><h3>How does the magic happen?</h3><p>Well, in Python functions can be passed as parameters (yes, they’re first class objects) and this gives us the ability to build a function that can wrap and modify another function. How? let’s take a look:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/403/1*KUsqWZMMspFkklb1wOhxiQ.png" /></figure><p>we defined a function called <em>make_me_pretty </em>that receives a<em> </em>function as a parameter and defines an inner function where it calls the parameter function not before it adds its own functionality. Then, it <strong>returns this inner function, </strong>ready to be called<strong>. </strong>Since the decorator is implemented with a function that returns a function, we need the inner function, because this is the function that is being returned.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*9MkI3Ge4f44E9qzWo9IU9Q.png" /></figure><p>What we did here is assigning the value that was returned from <em>make_me_pretty </em>function, which is the function that combined that functionality of the original function and the wrapping one. We can see the output from this call.</p><h3>Is there a nicer way to do it?</h3><p>of course, Python has a much nicer and more pythonic way to do it using syntactic sugar that we all like. Let’s see an example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*Tv92-I5rJOYq88oA7ko2Xw.png" /></figure><p>What we see here is that instead of defining a new variable, we just used @ and the signature of the wrapper above the function we want to modify, and wallah!</p><h3>Handling Parameters</h3><p>Sometimes, not surprisingly, the function we want to modify would have arguments, and the wrapper function needs to be ready for it. We can handle this by using Python’s <a href="https://www.geeksforgeeks.org/args-kwargs-python/">*args **kwargs</a> and it looks like this:</p><pre>def always_works(func):<br>    def inner(*args, **kwargs):<br>        print(&quot;I will decorate in all time&quot;)<br>        return func(*args, **kwargs)<br>    return inner</pre><h3>Chaining Decorators in Python</h3><p>Here is an example of how chaining, i.e. using more than one decorator, works:</p><pre>def first(func):<br>    def inner(*args, **kw):<br>        print(&quot;THIS IS THE FIRST FUNCTION&quot;)<br>        func(*args, **kwargs)<br>        print(&quot;THIS IS STILL THE FIRST FUNCTION&quot;)<br>    return inner</pre><pre>def second(func):<br>    def inner(*args, **kwargs):<br>        print(&quot;THIS IS THE SECOND FUNCTION&quot;)<br>        func(*args, **kwargs)<br>        print(&quot;THIS IS STILL THE SECOND FUNCTION&quot;)<br>    return inner</pre><pre><a href="http://twitter.com/star">@</a>first<br><a href="http://twitter.com/percent">@</a>second<br>def say_something(msg):<br>    print(msg)<br>say_something(&quot;Hello&quot;)</pre><pre># The output will be:<br>THIS IS THE FIRST FUNCTION<br>THIS IS THE SECOND FUNCTION<br>Hello<br>THIS IS STILL THE SECOND FUNCTION<br>THIS IS THE FIRST FUNCTION</pre><p>This is equivalent to:</p><pre>first(second(say_something(&quot;hello&quot;)))</pre><p>Like we can see, the order matters!</p><p>Lkform@gmail.com</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=80d8bb1f229a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Let’s maId(), hash(), == and is]]></title>
            <link>https://medium.com/@liorkatz/lets-maid-hash-and-is-8c08186fc5e1?source=rss-9649ff8ec140------2</link>
            <guid isPermaLink="false">https://medium.com/p/8c08186fc5e1</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Lior Katz]]></dc:creator>
            <pubDate>Fri, 22 Mar 2019 16:18:03 GMT</pubDate>
            <atom:updated>2019-06-16T11:28:09.924Z</atom:updated>
            <content:encoded><![CDATA[<h3>==, is, id() and hash() Explained!</h3><p>There’s a lot of confusion about the usage of <em>is</em> operator, and how is it differ from the <em>== </em>operator. Also, why do we need a hash value for some of the objects, and why not all objects have hash? This post will try to answer these questions.</p><p>All objects have an identity, which we can get by using <strong><em>id()</em></strong> function. In Python, it’s the memory address of the object. If two variables have the same id they are actually referring to the same object.</p><p>The <strong><em>is</em></strong> operator compares objects by their identity. It is only true when two variables point to the same object. So <em>a is b</em> if and only if <em>id(a) == id(b)</em>.</p><p>Now, an object also has a value. The <strong><em>==</em></strong> operator compares values. Container objects (like lists) have a value that is defined by their contents, while there are objects that their values are defined by their attributes.</p><p>If a class doesn’t define an __eq__ method (to implement the <em>==</em> operator) it will inherit the default version from <em>object </em>and their instances will be compared only by their identities.</p><p>Immutable objects (i.e. objects that cannot be modified) have hash value, which means they can be used as keys. The function hash() returns the hash value of an object, an integer <strong>based on the object’s value.</strong> The hash value must remain the same for the lifetime of the object, hence it only applies to an immutable object. It helps us compare values of immutable objects in an efficient way, since <em>==</em> operation compares hash values and not the actual values, as long as we did not redefine the __eq__ function.</p><p>Tell me what you think: Lkform@gmail.com</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8c08186fc5e1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pythonian Lessons]]></title>
            <link>https://medium.com/@liorkatz/pythonian-lessons-282c1d1c8fb0?source=rss-9649ff8ec140------2</link>
            <guid isPermaLink="false">https://medium.com/p/282c1d1c8fb0</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[software-developer]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Lior Katz]]></dc:creator>
            <pubDate>Fri, 11 Jan 2019 15:20:26 GMT</pubDate>
            <atom:updated>2019-06-19T13:03:48.570Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*wigcg2cOMdiqq3y2Qrgk2w.png" /></figure><p>As part of my job as a Python developer for Nibi.ai, I have a habit of writing down things I learn and I decided to share some it here. I hope you’ll find it useful:</p><ul><li><strong>Try to avoid more than one level of nesting, i.e. list inside a list or a dict inside a dict</strong>. It’s tempting because of the easy implementation, but it will cause your code to be hard to read by others, or by one month older you. Plus, it’s much harder to maintain. When it happens, consider breaking into classes.</li><li><strong>Almost every time you start a new project you should work in a virtual environment</strong>. The main purpose of virtual environment is to be isolated from what ever is going on in your computer. For example, packages that are installed in your venv is not going to be in contact with anything else but the venv. Run this command: py -m virtualenv venv, make sure the project interpreter is set on the python.exe of your current project, and after that in order to activate run: venv\Scripts\activate</li><li><strong>Try to avoid getters and setters. @property decorator gives you all the functionality you need</strong>. With @property you can avoid writing setters getters that will cause all the attribute calls to be modified. And it’s much more pythonic. For example, if you have a numeric attribute and you want to limit it only to positive integers when being called, do it with using @property and not writing a function for it.</li><li><strong>Try to use OrderedSet() instead of set() object in order for your code to be deterministic</strong>. One of Set() main “side effects” is that it’s unordered. It can mess things up when the order is important. When I tested my code with unittest, and had set() in my code for removing dups, the order of the result (a string) became random, so when using assert equal (comparing if two objects are the same) there were times it failed, and it was such a headache to debug it. Surprisingly, also the standard dict is unordered. Try to use orderdict() built-in data structure for having predictable behavior.</li><li><strong>When working with mutable objects, Use copy() instead of assignments</strong>. In Python the memory works with objects and pointers, meaning that <em>a</em> points to a list [1, 2, 3], and if you assign <em>a</em> to <em>b</em>, i.e. <em>b=a</em>, <em>b</em> also points to the same list object. So let’s say you want to change <em>a, b</em> will be changed as well, and vice versa. This obviously can bring very unwanted results. copy() solves it, creating a different object, but with the same value. So what we should do is <em>b = copy.copy(a)</em>. For more than one level of nesting, i.e. list inside a list or similar, use deepcopy().</li><li>Python has GIL (Global interpreter lock) that makes sure only one thread is being executed at a time (has its reason, especially because how Python memory was designed). That means that <strong>if you use threads to speed up computation time you will be disappointed</strong>. Nevertheless, it is wise to use it when you have processes that involve some waiting, such as calls to external API, so one thread can go while other is waiting.</li><li><strong>When creating a list, try to use a list </strong><a href="https://www.pythonforbeginners.com/basics/list-comprehensions-in-python"><strong>comprehension </strong></a><strong>method</strong>. Why? First of all, it takes fewer lines of code (only one). Second, it’s faster since Python allocates memory for it in advance, instead of resizing on run time. Also, there’s no need for append calls.</li><li><strong>Use a lock when more than one thread can have access to the same data structure</strong>. With Python methodology, a thread can be suspended in every time even halfway an atomic operation. By using a lock (and Python have built-in modules for that) we can protect ourselves from simultaneous access and data corruption.</li><li><strong>Consider using cache when doing something that is time-consuming and is done repeatedly</strong>. For example, we used a remote service to analyze certain words. These API calls made our service very slow, so we used cache and repeated words were pulled out of the cache instead of sending a request to the API again. But it doesn’t come without a cost. The disadvantages in cache are 1) uses expansive memory and 2) for cases when the requested value is being changed very frequently, for example, a stock price, the data we would have in the cache for a certain stock might not be the current price anymore. Pay attention to the context and remember that coding, like life, is about finding the right trade-offs :)</li><li><strong>If you use mutable default argument, this argument is evaluated only ONCE, meaning that for every future call, you are going to mutate that same object</strong> and not a new one. Example:</li></ul><pre><em>def append_me(element, to=[]): <br>  to.append(element)</em></pre><pre>my_list = append_me(3)<br># my_list == [3]<br>my_list = append_me(5)<br># my_list == [3, 5]</pre><pre># To avoid that in case you want a new list in every call you should use None as the default value:</pre><pre><em>def append_me(element, to=None):<br>  if to is None:<br>    to = []<br>  to.append(element)</em></pre><pre># Now we’ll see what happens:</pre><pre>my_list = append_me(3)<br># my_list == [3]<br>my_list = append_me(5)<br># my_list == [5]</pre><ul><li><strong>When initializing a class that takes data from an external source that might be changed over time, try to use a loop</strong>. Python, like other scripting languages, saves its class info in a dictionary, so we can access and change it accordingly. For example, we had a JSON file that was a vocabulary of synonyms words for all kinds of words. We also had a Python class called language_store that used this vocabulary. So for an instance of this class named lang_store: lang_store.max = [“max”, “maximum”, “the most”, “highest”]. This is a classic case for using the fact that the attributes are held as key values: what we did is writing a for loop in the __init__ function using local(). What is the benefit of doing it instead of writing manually each row? Besides the answer that was in the question (write as less code as you can), every time we add or reduce something from the JSON, or any other source, we will not have to change anything in the __init__ function of the object. The local() is a built-in method that returns the dictionary of the local scope, in this case, the class dictionary. For more, read about it <a href="https://www.programiz.com/python-programming/methods/built-in/locals">here</a>. This section is dedicated to Doron Avram.</li></ul><pre>for key in vocabulary.keys():<br>    locals()[key.lower()] = self.lang_store[key]</pre><ul><li><strong>Use <em>is</em> operator (versus <em>==</em> operator) only when you want to check if variables refer to the same object. </strong>The difference between the two operations is that <em>==</em> checks if two operands have the same<strong> </strong>value even if they are not referring to the same object (e.g. two empty different lists), and <em>is</em> operator checks if they point to the same object. Remember that in Python variables are names that point to objects in the heap memory.</li></ul><p>lkform@gmail.com</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=282c1d1c8fb0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mr Zell, Here Are Countries You May Like]]></title>
            <link>https://medium.com/@liorkatz/mr-zell-here-are-countries-you-may-like-86a22c61d0b5?source=rss-9649ff8ec140------2</link>
            <guid isPermaLink="false">https://medium.com/p/86a22c61d0b5</guid>
            <category><![CDATA[real-estate-investments]]></category>
            <category><![CDATA[investing]]></category>
            <category><![CDATA[real-estate]]></category>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[business]]></category>
            <dc:creator><![CDATA[Lior Katz]]></dc:creator>
            <pubDate>Sun, 10 Jun 2018 12:23:29 GMT</pubDate>
            <atom:updated>2018-06-10T12:30:36.868Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Mr Zell, Here Are Countries You May Like</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/340/0*6Bbf3KKE8ogVlb_r." /></figure><blockquote>“I believed that fundamentals of real estate were universal. That is, issues of supply and demand, demographics, capital flows, and so on were as relevant overseas as they were here at home”. Sam Zell.</blockquote><p>After Reading Sam’s book, and especially after reading the chapter about international investing and the attributes that guide Sam and his team where to look for opportunities around the globe, I thought that building a system that returns attractive countries for real investment, based on those attributes, might be a good idea. What I did was collecting data for each country based on the attributes that Sam cares about, attributes he wrote about in his book and talked about in different talks, especially interviews and panels he participated in.</p><p>I tried several models. My clue was the countries I already know he likes, countries that he already investing in or he is optimistic about: Mexico, Colombia, Brazil, Argentina (“It’s been starved for capital”) and countries he views as a potential such as India and Israel (“Very competitive environment but It’s a positive”) and I will present them in the third section of this article.</p><p>One notable rule of Sam that I did not put in the database is that the time when a country is on the verge of an investment grade is the time when a country is most financially disciplined.</p><p>In addition it’s not just supply and demand or demographics, it’s also issues that are <a href="https://www.youtube.com/watch?v=UPq3852G220&amp;t=799s">going on around a country</a>.</p><h4><strong>Building the database — The Attributes</strong></h4><blockquote><strong>Population and GDP growth</strong>: “To me, international investing is largely a story of demography. Just look at the population growth. Most of the developed countries have aging populations and are ending each year with flat or negative population growth rates. For instance we don’t spend much time looking at western Europe … In contrast, most of the emerging markets (India, Mexico, Colombia, South Africa, Brazil) have younger population and higher growth rates. That means more built-in demand.” (Am I Being Too Subtle).</blockquote><p>What Sam is saying is that population and gdp growth are big indicators for demand. We cannot calculate the exact demand in a country but we can assess it, and the population and gdp growth is a good a assessment. I took the data from the International Monetary Fund and the World Bank.</p><blockquote><strong>National stability: </strong>“In addition to demographics we look at national stability. Political leadership is particularly important in the rapidly changing environment of emerging markets.” (Am I Being To Subtle).</blockquote><p>I collected this data from an index called “Fragile State Index” made by “Fund For Peace” together with “Foreign Policy” Magazine. What I did is taking the inverse for each country and by that creating a stability index instead of a fragility one.</p><blockquote><strong>Rule of law: </strong>“<a href="http://www.milkeninstitute.org/videos/view/sam-zell-on-the-rule-of-law-in-bric-countries-2012-milken-institute-global-conference">It’s very simple</a>, when you go across the borders you basically trade growth with the rule of law. Your protection is who is your local partner. You better off with a very strong partner and a modestly good project than a weak partner and a great project.”</blockquote><p>Well, great partners data is out of my reach but level of rule of law of each country is, and I put it in based on the index of the “World Justice Project”.</p><p><strong>Ease of doing business: </strong>That is an attribute added by me. I think that it’s a crime to leave aside the great work the World Bank has done consisted of attributes such as ease of starting a business, getting electricity, protecting minor investors and enforcing contracts among other.</p><p><strong>Quality of education: </strong>Sam <a href="https://www.youtube.com/watch?v=xp3_ot3dJKU&amp;t=2394s">mentioned </a>educated workforce as a positive factor. The data is from Human Development Report 2016.</p><blockquote><strong>Invested capital: </strong>“I love a market or a deal that is starved for investors. It creates an environment where sellers and partners are bending over backward for you. I discovered that over and over in my career and I’m always on the lookout for that dynamic.” (Am I Being To Subtle)</blockquote><blockquote>“There is no investment opportunities where capital is not short”. (<a href="https://youtu.be/KV1WA1lbtV4">Global real estate outlook panel</a>)</blockquote><p>I collected data of capital investment as percent of GDP for each country from TheGlobalEconomy.com.</p><p>An interesting observation is The UK. Its Invested capital as a percent of GDP is 16% which is very low. Their Invested capital in US dollars is in downturn since 2015.</p><blockquote><strong>Population size (scale): </strong>“The missing one ingredient that enables you to monetize your investment: scale. Without scale you don’t have liquidity and no optionality. Chile is an example: it has institutions and leadership, but only 17 million people — no scale” (Am I Being To Subtle).</blockquote><p>I took this data from United Nations Department of Economic and Social Affairs.</p><p><strong>Finding The Nearest Neighbors</strong></p><p>One approach I took was collecting the countries that receive love from Sam and returning the “nearest” countries to them, using euclidean distance based on the attributes (not physical distance). KKN algorithms works when we have a labeled data and given a new instance, we choose what it is based on his k nearest neighbors. What I did is the opposite, Given one country with a known label (good to invest or not), I tried to learn about the countries closest to it. I played with the values of some of the attributes before I put them in the algorithm. I magnified attributes that I found more important than others in order to make them more significant in the euclidean distance function, and I mapped all negative population growth rates to a very negative number in order to make sure they won’t get near the countries with positive growth rate. These are the results when the first row is the country we try to learn from:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*aRT-gvGmK9z5_2obYmzWTA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*mfnWv83Ot4jSblfAMGPj0Q.jpeg" /></figure><p><strong>The “3%” club</strong></p><blockquote>“<a href="https://www.youtube.com/watch?v=Ql3zSFa9pVU&amp;t=2618s">In</a> a world perspective, tell me where the demand is. Can you identify a country of scale in the world that’s growing in more than 3%?”</blockquote><p>Well mr Zell, I do. Here I simply took the countries with above 3% GDP growth and population size above 70 millions. These are the returned countries:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*9fnN_OIUstXfXCQs9dD8TA.jpeg" /></figure><p><strong>Other Countries to Look At</strong></p><p><strong>Romania </strong>is special. The population growth is flat to negative but the GDP growth is strong. Are the Romanians really shrinking? No, and as proof we can look at the massive growth in Romania’s diaspora population. While the western countries the Romanians are flowing into are shrinking, the Romanian economy is growing and it will not be surprising to see massive amount of Romanians coming back home. After years of economic struggle Romania might be on the rise.</p><p><strong>Malaysia. </strong>With population growth of 1.5, GDP growth of 5.9, solid 32 million people, more or less average stability score and education level, great rank in ease of doing business and a very interesting Capital city - Kuala Lumpur, Malaysia looks like another country to look at. As these words are written a old/new prime minister was elected, so of course this is a big deal as well.</p><p><strong>Final Thought</strong></p><p>Sam once said that real estate is not a commodity and every asset is unique, and yet, when he thinks about investing in a place he certainly looks at the macro characteristics of that place. It would be interesting to know what is the proportion of macro thinking and what is the proportion of micro thinking in his decision making process on where to invest around the globe.</p><p>Another question that I have is about scale. He said that Chile is not interesting because it has only 17 million people. As big as you are, as an individual or as a company, you buy only some number of assets. Lets say you bought 10 buildings. Is it so hard to find buyers for 10 buildings in a 17 millions people country than in a 50 million people country? And although Israel is half of that, he said he would like to invest in Israel. Confusing.</p><p>I will be happy to read comments and notes, and listen to more ideas on things that can be done with the database: <a href="mailto:lkform@gmail.com">lkform@gmail.com</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=86a22c61d0b5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Selfish Giants]]></title>
            <link>https://medium.com/@liorkatz/the-selfish-giants-4a3e7ae5bd74?source=rss-9649ff8ec140------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a3e7ae5bd74</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[business]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[digital-economy]]></category>
            <dc:creator><![CDATA[Lior Katz]]></dc:creator>
            <pubDate>Fri, 16 Mar 2018 14:45:53 GMT</pubDate>
            <atom:updated>2018-09-10T10:19:14.936Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*HdPgyBu358nmHSRSIFEjbA.png" /></figure><p>The world has changed. The economy is becoming more and more digital in an exponential pace. This digital revolution is not less significant than the industrial one. And just like in the last revolution where major forces emerged such as Rockefeller’s Standard Oil and Carnegie’s U.S. Steel so do few companies in our time, especially the big five (Apple, Amazon, Facebook, Google and Microsoft). In this article I’ll try to answer why so few enjoy so much and why it is so hard, once you’re a giant, to be moved or even to be poked. The short explanation is the characteristics of the this digital economy that cause very few companies to take over the resource called data. This article tries to shed a dim light on this process.</p><p><strong>The next big thing</strong></p><p>One of Peter Thiel’s most famous <a href="https://www.youtube.com/watch?v=pHBdLCeOpts">quotes </a>is: “The next Bill Gates will not start an operating system. The next Larry Page won’t start a search engine. The next Mark Zuckerberg won’t start a social network company”. He did not say that because he thinks social networks or search engines are going to be irrelevant in the future, he said that because these fields are already taken by winners that took it all and are here to stay.</p><p>There is a wrong sense that because technology moves fast also the replacement rate of companies at the top moves at the same fast rate. But this is a fundamental mistake. It is true that tech companies can grow to a gigantic sizes relatively fast and that is why Mark Zuckerberg was able to build such a big company in so little time, But that does not mean he replaced anyone at the top, he just joined the club.</p><p>The following graphs show what happened to the stock price of Microsoft, Apple and Facebook when a new “competition” came to town:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*R3mjH3ZzxpPlD8vhmVBjuA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*hI49tU_kHZToq9NcfJKnLQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*PY6KyjZRDzlrKZ7qDNPpvw.png" /></figure><p>(from google finance)</p><p>From these graphs we learn that the entrance of a new competition, even if potentially it might take market share, does not really affect the already established company’s growth. Take Microsoft as an example. It seems that Bill Gates’s <a href="https://atkinsbookshelf.wordpress.com/tag/bill-gates-quotes/">fear </a>back in 1998 from “someone in a garage who is devising something completely new” was redundant because although two people in a garage did in fact devised a truly great company called google (and they are not the only ones) Microsoft stock after 20 years is in an all time high.</p><p><strong>THE WINNER TAKES IT ALL WHEN EVERYTHING IS A CLICK AWAY</strong></p><p><em>Homer who lived in 8th century BC use to tell great stories in the town squares of ancient greek but could earn no more in a night than couple of dozens of people might pay. Shakespeare in the 17th century did a little better since the theater could hold 3000 people. His words were leveraged. J.R.R. Tolekien’s words in the 20th century were leveraged further by printed books. J.K. Rolling is already the world’s first billionaire. (Alex Tabarrok with extension of </em>Andrew Mcafee and Erik Brynjolfsson).</p><p>In their great book <em>THE SECOND MACHINE AGE</em> Andrew Mcafee and Erik Brynjolfsson mentioned a work of the economist Sherwin Rosen from 1981 about the economics of superstars. In many markets, they wrote, buyers with the choice among products or services will prefer the one with the best quality. If there are significant transformation costs or capacity constraints the best seller will only be able to satisfy a limited amount of the market. For example, in the 16th century the best Romanian writer was not worried that Shakespeare would come to town with his play because the costs of doing so were too great. Fast forward to today, as technology arises and lets sellers cheaply replicate their products or services, and deliver them globally with almost no cost, the best seller with the best product captures the whole market, and takes it all. When a person had to walk ten blocks for the best groceries store and only a block for the second best, he usually went for the second best. But when everything is a click-away the decision is easy. And as the <a href="https://a16z.com/2016/08/20/why-software-is-eating-the-world/">markets become more digital</a> the economy becomes more and more a winner-take-all economy.</p><p>Another side, the demand side, is also important. The <a href="https://en.wikipedia.org/wiki/Network_effect">network effect</a> that most of the tech companies have is huge. The more users Facebook signs up, the more attractive signing up becomes for others. That creates scale on the demand side.</p><p>If we got used to an economy where the worker that is 10 percent less skilled than the best worker gets 10 percent less income, now the programmer who writes a slightly better piece of software than the second best will take the market. In this world, consumer care about relative performance. Small difference in performance cause to a million-fold difference in income.</p><p>And it’s not that this one winner absorbs all the workforce. Because of automation these companies need historically small number of people. Brynjolfsson and McAfee brought the great example of <a href="https://www.intuit.com/">Intuit</a>, who built a tax preparation software, allowing the machine to do the job of hundreds of thousands of human tax preparers. Another example is JP Morgan who uses a software called Contract Intelligence or COIN that can review in seconds what would have take 360,000 hours to legal aids. Whatsapp had 55 employees at the time Facebook bought it. That means that a company with only 55 employees produced 19 billion dollars of value. Here are two graphs, one represents the traditional economy and the other represents the new digital one:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*mm-kF4E2xUVs-UDghJue9A.png" /></figure><p>Our world looks less and less like the right side graph, where very small portion of the population are doing exceptionally good or bad and the majority is doing fine, and more and more like the left side graph, where the majority is doing bad and a very small portion is doing exceptionally well.</p><p>If we take the total number of employees in the last few years and divide is with the annual revenues (as an indicator for growth) we can get a glimpse into this trend, and as the three following graphs for JPMorgan, Alibaba and Alphabet show, the trend is clear: the revenue (growth) increases more strongly than the number of employees:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*oDh40MH4YdDYDlNL1Mod-w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*MoDGXVqZ-YuPNknl-eQZOA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*-85x8Tx8M2aW9FmOioNDpg.png" /></figure><p><em>(Data from statista.com, Ycharts.com and annual reports)</em></p><p>And the winners that take it all primarily take the data.</p><p><strong>All Happy Families are Alike</strong></p><p><em>““All happy families are alike; each unhappy family is unhappy in its own way.” Leo Tolstoy</em></p><p>Peter Thiel claimed in his book <em>ZERO TO ONE</em> that this quote is the opposite to business in terms of competition. I thinks that this Leo Tolstoy’s famous line from Anna Karenina actually accurately depicts the digital economy of the 21th century. All of the tech giants, i.e. the “happy” companies, share the same virtuous/vicious cycle: Once a company takes a significant market and crosses a certain threshold regarding the quantity of data it holds, or in other words, scale to a certain level, and after unexpectedly rejects aggressive purchase offers from the existing tech giants along the way and then attacks by them (Snap is being attacked by Facebook as these words are written), it enters the cycle.</p><p>After a company holds a substantial amount of data, it monetizes it. With the data and cash in hand the company attract more talent and then the growth continues. All three components: data, cash and talent affect one another, and eventually they are the input for more great technology and products/services that lead to the more expansion and growth. In the digital economy there isn’t a substantial income without mountains of data, and with enough money and data the talent will come.</p><p>Let’s take Amazon as an example. As they collect and analyze data from millions of orders and deliveries, they know better what products we like and get us those products faster and cheaper, i.e. give us a better service. And as their service is getting better we use Amazon more, and more data is getting into the system and so on, and so on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*KVlYO53zi09xKBhF1Zrmhg.png" /></figure><p><strong>The Most Valuable Resource</strong></p><p>In this digital era the most valuable resource is data. Data is the the 21th century’s black gold. How valuable? Like we know, most of the tech giants don’t charge money for many of their services. Let’s imagine a scenario which such a company does charge money for its service. X will be the number of paying users, M is the money paid by each user and D is the data that each company produce from each user. From that we calculate that the total value a company will get is X*D+X*M. Now let’s assume that the same company doesn’t charge for its service and as a result there are Y more users. Now the total value would be (X+Y)*D, which is X*D+Y*D, since there are X+Y users and the company “charges” only data. When a company chooses to give its service for free, the inequation must be X*D+Y*D&gt;X*D+X*M since it chooses the more profitable option. If we subtract X*D from both sides we will end up with Y*D &gt; X*M. That means that the value from the additional users data (Y*D) is greater than the income of all the paying users combined (X*M). Network effect is something to consider here since it increases the Y but yet, we get a sense of how valuable the data is. Let’s run some numbers: from Facebook’s 2017 <a href="https://investor.fb.com/investor-news/press-release-details/2018/Facebook-Reports-Fourth-Quarter-and-Full-Year-2017-Results/default.aspx">report</a> we see that the company’s revenue for 2017 is 40.65B, and number of monthly active users was 2.13B. That means each user produces 19.1$ (D = 19.1$).</p><p>Now, when more and more information is carried by bits, it is not surprising that the big information technologies companies hold bigger and bigger proportion out of the world’s data since they are the main crossroads in this world of bits. History shows that even if companies don’t know what to do with this precious treasure at the beginning, eventually they figure it out. Google built its ads system after they already sat on mountains of data and did not know what to do with it until they approach the Israeli tech legend Yossi Vardi that gave them the <a href="https://www.vosizneias.com/16615/2008/06/01/israel-how-israeli-hi-tech-guru-inspired-google-magic-formula/">idea for the ads</a>. Another known israeli tech entrepreneur and investor turned Waze down several times because he, in his words, “did not see where the income is going to come from”. This was probably a very profound lack of understanding of how valuable the data Waze produced from its users. Eventually Google bought Waze for 1 billion dollars.</p><p>Each company has a different way to monetize the data since they all have different platforms, but everything they sell is mainly powered by data or just data. Without data google’s ads will not be worth a lot, and <a href="https://www.youtube.com/watch?v=ncwsr1Of6Cw">amazon will sell much less</a>, and that is before implementing its <a href="https://www.bloomberg.com/news/articles/2018-01-18/amazon-has-a-plan-tobecome-profitable-it-s-called-advertising">advertising plan</a>. Alibaba is now giving to its users a credit rate based on the data they produce on them, and hand out loans based on this rate. With <a href="http://www.businessinsider.com/why-facebook-buying-whatsapp-2014-2">revenue of roughly 20 million dollars</a> per year was not enough to justify a 19 billion evaluation for Whatsapp. So what is? At the time Facebook bought Whatsapp the messaging app had 315 million active daily users and a million new users each day (!). The revenue was irrelevant. As an app that pulls huge streams of data from its users in the form of text, photos, videos and voice messages, Whatsapp is one of the biggest “wells” in the world, and the “refinement” will be done afterwards.</p><p><strong>The New Stars</strong></p><p>In a world that few companies “take it all”, these companies also take almost all the major talents of technology, business, academia and many other fields. Beside of superstars CEOS that became no less than a culture heros, the big story is the top employees that earn sums of money and glory no less than rockstars and super athletes. Yann LeCun, head of facebook’s AI research facility, Tony Fadell, the engineer of the ipod, and Ray Kurzweil of google are just part of the very short list that could have work or teach everywhere they want, but chose to work for the giants. Why? Is it money? No. There is much more than that. So what is it? It is the infrastructure, the talent and most importantly, the data. Most of the stars are machine learning — AI experts and researchers. In the information technology world, information is the king. The giants hold more data to work with than all of the universities will ever dream of. For these people, these companies are like an endless candy stores where they can fulfill their wildest dreams. Resources to try things without fear of failing, cooperate with the most talented people and the ability to play with so much data and computing power.</p><p><strong>What a Time To Be a Shareholder</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*e3dS93cgxrfNTrpqCYwoSA.png" /></figure><p>If we look at it as value investors, that seek to invest in companies with potential for growth, there’s probably no business like tech business. The explanation is in this article, essentially. Some people look at these giants and ask themselves: how much can Amazon still grow? And I say, more than we can imagine. Much more likely that Amazon will eat other’s lunch than a relatively small one will eat hers. In addition to almost non-existent distribution costs, the brightest people in the world with endless resources will find more and more ways to automate processes and jobs, which means better productivity with lower cost of labor, which means much stronger bottom line, which means a shareholders heaven.</p><p>Some very known and bright people are skeptical about the tech stocks and even call it a bubble. It reminds them the party of 1999. They claim that the price is not proportional to the earnings. Indeed, The earnings multipliers are very high. That is because the expectation for growth is built into the price. I will not say that such a scenario is not possible, and maybe some of the these stock are overpriced. But if we look at these companies products, the impact they have on our everyday lives, the fact that they are monopolies in their industries and that more and more <a href="https://a16z.com/2016/08/20/why-software-is-eating-the-world/">industries are being eaten by software</a>, and in this process they posses more and more of the most valuable resource, are the expectations for growth really out of proportions?</p><p><strong>The Nokia Case</strong></p><p>When <a href="https://www.youtube.com/watch?v=dEeyaAUCyZs">Steve Jobs was asked</a> if Apple is more of a software company or a hardware company He said: “if you look at the ipod or imac or iphone, although they’re in a beautiful box, it’s all about the software. Apple views itself as a software company”. The main reason for Nokia’s exit from the cycle was not Apple or Google or any other competitor, it was Nokia itself. And the problem was that Nokia failed to see that the world is being eaten by software and the cellphone business is already being devoured. In other words, Nokia saw itself as a hardware company instead of a software one. That wrong vision cause her to focus on the wrong products and the wrong user experience. The top engineers were top of the line hardware people, instead of software people. Nokia had the chance to change and to adjust, She had the resources for that. And when Nokia finally woke up she bet on the wrong horse: the windows phone. Eventually it’s the software. The software brings the scale, the data and the possibilities. The winners are those that possess the most valuable resource, and it’s not the hardware, although important, that does the heavy lifting in this “drilling” process. It’s the software. A beautiful box is nice to have, but what wins wars is the software.</p><p><strong>Final Words</strong></p><p>This article is not about criticize the situation. I am a believer in brains fertilize one another, and huge clusters of brilliant minds can be much more effective than each on its own and the giants create these clusters. In addition, big and bold ideas that create real progress for this world need great funding and brain power and that can be achieved mostly by very already strong companies. But, they must have social responsibility. I see most of the leaders of these companies and frankly think that if somebody needs to hold this kind of power we are lucky that they are the ones to hold it. Beside being very smart and capable, I truly believe, despite running a for-profit organizations, that their heart is in the right place and their mind is set on the right things. We just need to look at the richness they brought into our lives. If we pay with our data, let it be, it just needs to be done safely and in a transparent manner. Nevertheless, the only way I see these companies being stopped is by regulation. Many voices are being heard about the similarity to Rockafeller’s Standard Oil and the need to break them up. The problem is that regulators are yet to adjust to this digital economy. First, a weird thing happens. Instead of suffer from these monopolies, we enjoy from substantially better products and services with lower(!) prices, which is antithesis of what we usually get from monopolies. Amazon, the strongest store in the world, brings us the richest catalog in history with the lowest prices and with the convenience of receiving it at our doorsteps. Although there are dangers, such as future price rises or mass unemployment (to name a few), for now, the regulator is confused. Second, This is not the industrial era anymore, when they used size to decide when to intervene. Now, they need to consider data assets. Whatsapp with its few employees and relatively low revenue did not seem like a deal for intervention, but the price tag should have raised a red flag. The regulators need to think over about how tech markets work. The key is to understand the role data plays in it. There’s only left for us to hope that they will succeed to eliminate the dangers without hurting the progress and richness we get as a result of their enormous size.</p><p>lkform@gmail.com</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a3e7ae5bd74" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>