<?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 Joel Kunst on Medium]]></title>
        <description><![CDATA[Stories by Joel Kunst on Medium]]></description>
        <link>https://medium.com/@7sedam7?source=rss-d9da26071565------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*5oD3AHz8ht9SR52A0HQ2sg@2x.jpeg</url>
            <title>Stories by Joel Kunst on Medium</title>
            <link>https://medium.com/@7sedam7?source=rss-d9da26071565------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 18:06:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@7sedam7/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How I Indexed the Epstein Files in an Afternoon]]></title>
            <link>https://medium.com/@7sedam7/how-i-indexed-the-epstein-files-in-an-afternoon-9551e2105207?source=rss-d9da26071565------2</link>
            <guid isPermaLink="false">https://medium.com/p/9551e2105207</guid>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[epstein-files]]></category>
            <category><![CDATA[search-engines]]></category>
            <dc:creator><![CDATA[Joel Kunst]]></dc:creator>
            <pubDate>Fri, 13 Mar 2026 07:26:36 GMT</pubDate>
            <atom:updated>2026-03-13T07:26:36.839Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*XDJrgrfK3B2qt_d3uRMsdA.png" /></figure><p>I built a searchable index of the Epstein court documents using my local search engine. Here’s how it went.</p><p>I’ve been building <a href="https://lasearch.app/">LaSearch</a> — a local search engine built in Rust with a Svelte frontend. It runs on your machine, indexes your files, and lets you find things without uploading anything to the cloud.</p><p>When the Epstein files started making rounds online, I realized I can easily index them with LaSearch, put a simple page up, and showcase my engine on a topic people care about.</p><h3>Getting the files</h3><p>First step was downloading everything. Around 323GB of documents from the public court records. I grabbed them all before thinking about how to organize them.</p><p>Later I found a <a href="https://github.com/rhowardstone/Epstein-research-data">GitHub repo</a> with extra metadata and organized file listings, so I combined the two. The actual files are hosted on justice.gov.</p><h3>Indexing</h3><p>I pointed LaSearch at the full collection — roughly 1.4 million documents — on my Mac Mini M4 (base model). The whole thing indexed in about an hour. The entire time, my Mac was completely usable — browsing, coding, normal stuff. Indexing runs in the background without hogging resources.</p><p>The resulting index is about 1.4GB for 323GB of source files. It’s not fully loaded into RAM — LaSearch memory maps it and lets the OS handle loading only the parts that are actually needed. This is how it runs comfortably on a cheap VPS.</p><p>One deliberate choice: I indexed the files without their file names. The original names are things like EFTA0004829.pdf — not helpful for search. The content is what matters.</p><p>The collection includes images, audio, and video alongside the text documents. LaSearch doesn’t extract content from those formats natively yet — that’s where the GitHub repo came in. Their analysis provided transcriptions and descriptions for those files, which I indexed together with the text that LaSearch extracted from the documents. Eventually this kind of extraction will be built into LaSearch directly.</p><h3>Building the web app</h3><p>The web UI is simple. A search box, a list of results, and a document preview. The frontend is Svelte, the backend is a small Rust server wrapping the same search engine that powers the desktop app.</p><p>I constructed URLs that point directly to justice.gov — I’m not hosting the files myself.</p><p>The preview panel needed some extra work. The government site requires an age verification before serving files, so I implemented the same check — users confirm their age before any document is displayed. The files are then proxied through the server to enable inline preview in the browser.</p><p>Since search results and files never change, I put a CDN in front with maximum TTL caching. Once fetched, subsequent requests are served from the edge.</p><p>Search returns the top 200 results, not all matches. People rarely look past the first 10 anyway, and it keeps responses fast.</p><h3>Running it on a €3.80 VPS</h3><p>I deployed the whole thing to a small VPS in Europe — €3.80/month, where I run some other stuff too.</p><p>Without caching, the server handled around 100 concurrent requests while still feeling instant. The search index lives in memory and lookups are fast.</p><p>With the CDN in front, it handles significantly more since most requests never hit the origin after the first time.</p><h3>Wrapping up</h3><p>The whole thing was straightforward to put together. That’s what I was most happy about — from downloading the files to having a live searchable page, there wasn’t a single step that felt like a struggle.</p><p>The demo is live at <a href="https://epstein.lasearch.app/">epstein.lasearch.app</a>. If you want to do the same with your own files — that’s what <a href="https://lasearch.app/">LaSearch</a> is for.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9551e2105207" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beeing free]]></title>
            <link>https://medium.com/@7sedam7/beeing-free-91f7188bcfcb?source=rss-d9da26071565------2</link>
            <guid isPermaLink="false">https://medium.com/p/91f7188bcfcb</guid>
            <category><![CDATA[freedom]]></category>
            <category><![CDATA[self-awareness]]></category>
            <category><![CDATA[life-lessons]]></category>
            <category><![CDATA[self-improvement]]></category>
            <dc:creator><![CDATA[Joel Kunst]]></dc:creator>
            <pubDate>Sat, 31 Aug 2019 08:27:00 GMT</pubDate>
            <atom:updated>2019-08-31T10:34:09.178Z</atom:updated>
            <content:encoded><![CDATA[<h3>Being free</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*uAnfLAG3fJbLYV-fVzER4w.png" /></figure><p>A lot of us are lucky to live in an era and place where nobody puts a physical chain on you to prevent you from doing things. We do, however, put mental chains on ourselves. Those chains, even though not physical, are very much real. We are afraid of hurting someone, of being vulnerable, being judged, etc and we often don’t do and say what we want.</p><p>Try to follow the exercise below. It should illustrate that many things we do, on a deeper level, we don’t really understand, nor want to understand. I will then show the connection with freedom.</p><h3>Mental exercise</h3><p>As an exercise, imagine yourself in a situation where you feel like doing something. You don’t need to have a strong wish for it, but you do feel like doing it. Now imagine a person you know and hang out with (does not need to be really close) is coming towards you. You know that this person is against the thing that you are want to do. Now you get the strength and you go and do it. As you do it, the person we mentioned starts looking at you weirdly. Take a moment and think about how does it make you feel. It is probably not positive and happy. Let’s try to see what happened and analyze the situation.</p><p>The important thing is not to forget that your interpretation of the situation might be wrong. The person might not have judged you. He could have just looked at something next to you. He might also have that kind of face or it could be any kind of other reason.</p><p>You could look at it as black and white. The person has judged you, or you misinterpreted it and the person has not judged you. People in this situation don’t usually think about what has happened. They just turn away and go, or don’t do what they want, so they don’t get judged. As a thought exercise, let’s try to explore a different option. Let us gather more information. Get back to your imagination to that moment. Imagine yourself walking to that person and saying: “Hey, I’ve noticed a strange face expression on you. Is something wrong?”. We have several scenarios that can play out:</p><p>1. The person starts yelling: “Hey, yes, you are disgusting, how can you do that? That is so awful, you are an awful person. Horrible! I just can’t believe this.” The person turns away and leaves.</p><p>2. The person says: “No it’s nothing, sorry I have to go.” and leaves.</p><p>3. The person smiles and says: “Oh, I don’t know, I have no idea, sorry if that made you feel uncomfortable. :)”</p><p>Think about how you feel in case 1? How do you feel in case 2? And how do you feel in case 3? The examples might not have resonated with you, so I’ll say that the case 1 represents a person who judges you and does not accept you for who you are, case 3 represents a person who does. Let’s ignore the case 2 for now.</p><p>Now be honest with yourself and think for a moment. What reason do you have to maybe want a person from scenario 1 as your friend? Unless the reason is that you really enjoy that person’s company or admire them, you don’t really need them in your life. There are plenty of people out there that will accept you for who you are and will share enough of your values so that you enjoy spending time with them. Now, what to do in case 1? Regardless of your answer to why you want/need them, sometimes it might be useful to talk to them. Explain them the situation, see how it impacted you and ask them for their thoughts on it. You will get a few things out of this:</p><p>a) You will probably get out of your comfort zone (it’s usually not comfortable to go and say this to somebody), which helps you evolve (just don’t be a jerk when talking to them, be honest and sincere).</p><p>b) Depending on the answer and your reaction to it, you will learn how to deal with different outcomes.</p><p>c) You will get closure on what it actually is (not just your assumption in your mind).</p><p>Regardless of this, it is completely fine to just walk away from them and never speak to them again. But as long as you are ok with it, really ok with it, that you are not hiding the discomfort and questions under the rug. If you truly don’t care and just want to deal with different things, it is fine to ignore it.</p><p>Case 2 from the story above is similar to the above. If the answer 2 does not satisfy you, it is ok to push to get an honest answer and closure. Let’s imagine some really bad scenario. You ask the person “What do you mean it’s nothing, it certainly does not look like it, can you please be honest and say what’s up?”. Now let’s imagine the person answers: “I said it’s nothing, didn’t I? What the heck do you want bitch? Get the hell out of my sight and bug someone else.” This does not sound pleasant, especially after you went out of your way and opened up a bit. However, try to stop for a moment. Imagine yourself stepping outside, out of your body and watching the situation from the side. Just noticing what’s going on. How it looks, how it sounds, how it feels. From that perspective, if you are truly observing and not judging, you can notice that it’s not pleasant, but that person is frustrated and has his own problems. He won’t get far like that, and you may even feel sorry for him. It is clear though, that there is no space in your life for someone like that. So you gently say “Ok, I’m sorry you feel that way, I won’t bother you anymore, bye”. You smile and walk away.</p><p>People like to say “fake it till you make it”, and to a degree, it helps to put us in the state that we want to be in. Really stepping out and noticing what’s going on without judgment, is a big contribution to getting into the state you want to be in.</p><p>This all may sound like a fairytale, and “hell no” would anybody ever act like that. Just some holy Mary or whatever. However, to move on, to be clear of the worries (both, the ones we are aware of and the ones we are not) is to notice them, realize them and accepting them. A balance between dwelling on them and torturing yourself with thinking about all the bad stuff that happened and focusing on that bad feeling and hurt they bring, and the other side where you just put them under a rug and think about anything just so that you don’t get reminded of those bad things. Some of us are really good about really forgetting about the bad stuff, but if we haven’t organically passed through them, we are not really in peace with them and we can not evolve.</p><p>This also may sound simple to say, but yes, by no means, it is easy to execute in real life. However, it is possible, and it is good to see yourself in a “perfect” scenario, the best version of yourself. So that you have something to go towards. We always move somewhat to what we imagine. If the goal you see is just to not be bothered by idiots, you will move towards there. However, at the same time, you could be moving to a much better version of yourself which in a way transcends all of those “mundane” problems, and deals with them on a whole another level.</p><h3>What does that have to do with freedom</h3><p>From the start of the article, it seems we have gone far from the initial story. What they have to do with each other. And what does all of this have to do with freedom?</p><p>What is freedom?</p><p>Is it the fact that you can do whatever you want?</p><p>Every moment, react to your every thought?</p><p>Be able to buy what you want?</p><p>It is not so simple to define right?</p><p>And I do believe that all of you will have a different definition of freedom for you. However, I’ll share again a vision of “true” freedom on a quite higher level. Something to aspire to, and go towards, that should probably more than satisfy your version of freedom as well.</p><p>We always have many thoughts, often contradicting each other, changing faster than we can react. Would we really be free if we would act on any random thought that comes through our minds? We first need to “master” ourselves. Understand our thoughts, understand what we want, be able to be present in the moment, notice what’s going on around us, how we feel, how it impacts us and others. Just then, and only then, we can actually do what we really want. That is true freedom, and everything else is a facade, the things that help us cope with whatever we do. If we don’t really understand what we want and how our action is impacting the world around us, how can we really be ok with it? Only if we don’t really realize that we are not aware of what is actually going on.</p><h3>Next steps</h3><p>For many of you, this will sound like bullshit, for some like unachievable utopia. But if you do want to try to get there, as with everything else, there are small steps that we can take each day to move us closer. And if you really take them, I promise you, you’ll be surprised at the results.</p><p>Here, the simplest step you can do is take just a few minutes every day (~3) and sit in peace. Try to relax, close your eyes, notice the sounds, smells around you. Notice the way it feels to touch the floor, the chair. Focus on your breath. Whenever your mind wonders of, just notice it, don’t judge it and gently get back to whatever you were focusing on.</p><p>This can help you with a lot more in your life than you can imagine at the moment, but that is another story. If you want more help with that simple routine, you can download an app like <a href="https://www.headspace.com/">Headspace</a>, or anything similar(free version is more than enough).</p><p>P.S. Please let me know what you think, what you don’t agree with and why, it helps me learn and grow :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=91f7188bcfcb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[how-to-choose-an-exchange]]></title>
            <link>https://medium.com/@7sedam7/how-to-choose-an-exchange-c2e9d3f9082?source=rss-d9da26071565------2</link>
            <guid isPermaLink="false">https://medium.com/p/c2e9d3f9082</guid>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[exchange]]></category>
            <category><![CDATA[trading]]></category>
            <category><![CDATA[finance]]></category>
            <dc:creator><![CDATA[Joel Kunst]]></dc:creator>
            <pubDate>Wed, 10 Jul 2019 19:17:58 GMT</pubDate>
            <atom:updated>2019-07-10T19:17:58.858Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to choose an exchange</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cegAxrTIvNPll5i8oNN_KA.png" /></figure><p>Hey, all you (wanna-be) traders out there.</p><p>People often neglect the fundamentals, the basics. In this article, I will try to give some information about the fundamentals of exchanges.</p><p>To give a small background. I don’t consider myself a professional trader, however, I have been trading for many years now for fun. For the past 2 years, I have been working on trading tools (<a href="http://www.bytebot.cx/">www.bytebot.cx</a>) and in order to educate myself more about the trading, I joined <a href="https://fienta.com/et/summer-crypto-academy-2019">Delta Heroe’s Crypto Summer School</a>. They are really cool guys and know a lot about trading. I recommend coming to their course if you can. The information I will give here was to the large extent obtained from their first course and the whole article is influenced by the course.</p><p>When choosing an exchange there are many factors to consider. A good starting point is figuring out why do we need one and what we intend to do with it. I’ll try to mention which things might be important for which purpose. Let’s start with the obvious things.</p><h3>KYC</h3><p>On all of the exchanges, you need to upload your documents in order to comply with the regulations. Some exchanges offer very small trading limits without documents upload, however, you still have to provide some information about yourself. In case you want to be completely anonymous, an option you might want to consider are services like L<a href="https://localbitcoins.com/">ocalbitcoins</a>. They offer you to find a person who will buy or sell bitcoin and you can meet with them in person and you can even use cash. The downside is that it is less convenient and you will have a hard time finding people selling or buying coins besides Bitcoin and Ethereum. Depends heavily where you live.</p><h3>What coins you want to trade</h3><p>Almost everybody knows about Bitcoin, many know about Ethereum, and everything else is less known. For people inside the crypto world, there are way more coins known. In fact, there are thousands of coins if we disregard the ERC-20 tokens (we’ll get to them in a bit). Let’s clear up the distinction between coin and a token. Dictionary gives this kind of definitions:</p><p><em>Coin: a piece of metal stamped and issued by the authority of a government for use as money.</em></p><p><em>Token: something serving to represent or indicate some fact, event, feeling, etc.; sign:</em></p><p>This doesn’t directly talk about crypto, nor sound too much like something related to any of the cryptocurrencies we know about. Everybody has their own definitions on what is a coin and what is a token, but the thing that I noticed is that almost everybody agrees that coin is a direct currency of a blockchain, and a token is a “virtual” currency added on top of the blockchain. This might be hard to understand if you don’t know more about how these things work. Here, I will give just a simple explanation. Ethereum is the name of a 2nd most known blockchain which has a direct currency called ether. Ethereum blockchain offers anybody to develop “things” on top of that blockchain, and many have developed additional currencies that live on top of it and we call those tokens.</p><p>Depending on what you want to trade from the sea of the coins and tokens you might choose one exchange over the other. Some exchanges have tons of cryptocurrency pairs, while others are more conservative and offer the ones that they consider “the most relevant”.</p><h3>Do you need fiat</h3><p>Besides what cryptos you want to trade with, you probably want to consider the fact that not every exchange accepts fiat, in fact, most of them don’t. For those who don’t know, fiat is just a fancy word for all the regular currencies, like dollar, euro, British pound, etc. In case you want to use an exchange to buy crypto with your earned money, you will need an exchange to which you can transfer that money, and maybe also withdraw it later after completing your trading. The same is if you want to sell the crypto you got by mining or any other way.</p><p>Notice that you can always use a combination of exchanges. For example exchange A might support a fiat currency you want to have, but not support the cryptocurrencies you want to trade with. However, there is probably an exchange B that supports them but maybe does not support your fiat currency. In that case you can transfer your fiat to the exchange A, exchange it for the cryptocurrency that exchange B supports (Bitcoin is usually supported on every crypto exchange) and then you can transfer that crypto to the exchange B, trade there, and when you want your fiat back, transfer the crypto back to the exchange A, exchange it for the fiat and initiate the withdrawal.</p><h3>What jurisdiction is the exchange on</h3><p>Since cryptocurrency regulation is still far from solid, and some exchanges get closed, robbed, etc. You might want to consider where is the exchange located. Maybe you want to choose the country which has a better legal framework or the country that is out of reach from the legal entities that can close it or request the data about your funds. All depends on what your concerns are :)</p><h3>Can you trust them with your money</h3><p>This point relates a bit to the last one, but here I will talk about a different problem. Some of the exchanges/brokers, whatever you want to call them (the line is blurry), have internal traders and/or bots that trade against the successful traders, which puts you at a disadvantage in case you are doing good. Those who do it usually do their own market-making. I would say that this is not as present in crypto as in forex and other commodities and is mostly present with the brokers. This might sound like “wtf”, but unfortunately, yes this is legal and the brokers/exchanges don’t have to say that they are doing it. Because of that, you can not really know are they doing it or not, however, a good rule of thumb is to be alerted if you notice your trades start getting requotes, meaning that your order gets rejected and you get a less favorable price offered.</p><h3>How you trade (volume, liquidity, API, futures(margin(how big), shorting), fees)</h3><p>The last thing, which has many things in it, is what do you use your exchange for in terms of “trading”. If you are a very beginner who just wants to “get on a train”, buy some coins and HODL them, a simple service like Coinbase might be a good option. If you want to do some back and forth trading, Coinbase fees probably don’t pay off and you want to go on a “proper” exchange. The fees also usually change depending on your trading volume, so you might want to check what would your fee be considering the volume that you plan to have.</p><p>Another thing that might be important for you is liquidity. If you trade often and/or with bigger amounts of money your orders might not that easily get filled (matched with some other order) if there are no other orders. In simple terms, if you plan to do trades multiple times per day and/or trade with order sizes of 1000+ eur equivalent, make sure you are choosing an exchange that has a good volume. You can check how often trade happens on the exchange and in what amounts before even registering. Keep in mind that the values may be very different for different currency pairs.</p><p>Then we come to more advanced things, like trading with leverage where you need to check what kind of leverage do exchanges offer. I would not recommend trading with more than 10x leverage though.</p><p>In case you want to use it, you want to check which exchange supports shorting, what kind of API it has in case you want to write bots, but if you care about this, your knowledge is probably beyond this article anyway.</p><h3>Final thoughts</h3><p>This was a short overview of things to take into consideration. It was not intended to give many details about each of them, nor recommend any of the exchanges. In case you would like me to provide more detailed information and/or suggestions on this kind of articles, please let me know :)</p><p>And last but not least, not ANY of the content here is suppose to be taken as trading advice. I just gave some things to think about, and you should make YOUR own decision :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c2e9d3f9082" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Product school or not to Product School]]></title>
            <link>https://medium.com/@7sedam7/product-school-or-not-to-product-school-9158834717a6?source=rss-d9da26071565------2</link>
            <guid isPermaLink="false">https://medium.com/p/9158834717a6</guid>
            <category><![CDATA[growth]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[self-improvement]]></category>
            <category><![CDATA[product-management]]></category>
            <dc:creator><![CDATA[Joel Kunst]]></dc:creator>
            <pubDate>Sun, 26 May 2019 09:49:27 GMT</pubDate>
            <atom:updated>2019-05-26T09:49:27.008Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pCU6g7anwbtwYl1gKL-yGQ.jpeg" /></figure><p>In recent years I have had the privilege to try out Product Management and find out a bit more about what it is, how the role fits within a product team and why it is important. I really love the role so far myself, at least according to my understanding of what it is. It has a high degree of autonomy and has a variety of things to deal with in order to do it successfully. Aside from those, and most importantly, most of the things you do as a Product Manager allow for a lot of creative thinking, which I require to not get bored. <br>Ok, to get to the point: Since I’m very interested in the role and would love to grow and get better at it, besides learning for my own pleasure, I am considering a paid course at Product School. I would say that anybody even remotely interested in Product Management knows about Product School, but I’ll give you my opinion on what it is. It’s an organization that offers education for Product Management. They have a lot of free product talks and recordings on their YouTube channel. Often the speakers are experienced Product Managers from fancy world-known companies like Google, Facebook, Microsoft, etc. The talks are very informative and inspirational. I really enjoy watching their content. Besides the free material, Product School has a paid 8-week course for “breeding” Product Managers that costs about $3500. You can pay for it yourself or ask your employer to cover the expense. Regardless, it doesn’t hurt to ask if it is worth the money (depending on your situation).</p><p>I realize this introduction was a bit lengthy, but yeah, this article will try to explore why this course would (or wouldn’t) be worth your money. Disclaimer: I haven’t gone through the course myself, so I’ll provide my general belief on these kinds of courses. I would be thankful for anybody who can give a constructive comment/feedback/information based on what I’ve written in this article.</p><h3>Let’s break it down</h3><p>The majority of the article will focus on my belief in how we learn, how we process the information and my general experience with paid/free courses and tutorials of different kinds. Even though the majority of the information is heavily based on my personal experience, I would say that that experience includes working with others and seeing how they learn. I am aware that this might not represent the majority of people, but that is where I ask you, the reader, to educate me :)<br>On top of all the information I’ll present, I’ll try to explain the pros and cons and for whom the Product School paid course might be (again, based on the presented information).</p><h3>The way we learn</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gy3MWkPswXCp7sseDjclvw.png" /></figure><p>I will try to explain my observation based on the study of programming, because it’s one of the areas in vogue that almost everybody wants to learn something about, and I personally have a good background in it.<br>I have completed my masters in Computer Science, and besides just finishing it, I have a profound interest in the topic. As in, I like to understand the basics and the theory behind it. That said, in my experience, the way that I process the information and learn new programming languages and technologies as a skill is different than most. A lot of people, in general, don’t really like school and the theory that is taught there. Programming is learned by going through random tutorials and experience of doing things. That is generally a good way to learn.</p><h3>Paid courses vs free material</h3><p>For programming, in general, there is tons of content out there, from outstanding to dreadful. It is made by experts, amateurs, people who know how to present and explain, and, of course, those who do not. Being a beginner it can be very challenging to decide on what to learn and where to start and to discern what makes good material and what is chaff at best. Paid courses are usually structured and organized with a goal of endowing you with the knowledge and experience in a certain skill. This can be a very tempting offer, and I would agree is useful to a degree. Unfortunately, from what I have seen, many of the courses fail at one thing. As they focus on building certain skills, and they have a limited amount of time and students with different levels, the courses and schools/universities often don’t teach a higher level understanding of the topic. If you understand the concepts, you can more easily continue with your growth, and figure out what you don’t know. That is what in my opinion brings more value than very well learned shallow knowledge that is usually taught.</p><h3>The Basics</h3><p>I just want to quickly mention that in order to reach that “higher level understanding” one must have a very good understanding of the basics. A lot of courses neglect those, and a lot of people rush into things without understanding the basics. Especially for those with years of experience, it is super important to strip down the pride and learn the basics if they never learned them.</p><h3>A helping hand</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*swrhPUzD2MWlm6fUXAaVoA.jpeg" /></figure><p>For the aforementioned reasons, it can be very beneficial to have a helping hand to guide us through the mess of available resources. But all of us who have gained significant knowledge and experience in some field, especially if we did it on our own, remember the mistakes we did while learning. Some took quite some time to correct. It would have been useful to have a guide to keep us on the correct path. But what is the situation for a new Product Management learner, who has already achieved a solid level of knowledge and skill in a certain area before? I believe that the next thing that we decide to learn will have an easier path. <br>That is the process of going through that path of being a dimwit who barely understands what’s going on but is happy they can do something even with the small amount of knowledge they possess. Then they advance towards fighting with hardships of understanding, struggling to grasp how something functions, and opening the world of more and more questions. And then again getting towards a stable state where we are aware that there is a lot that we don’t know but have good enough knowledge and experience to confidently go towards tackling new challenges.<br>I believe that the later states described above require more than just a good understanding of the basics and fundamentals. They require a high level of personal development. Understanding one’s limits, the way of functioning, mental stability, perseverance and plenty more, is very important in order to accelerate our growth. Reaching those higher levels also requires the understanding of those higher level concepts that we mentioned earlier.</p><h3>Enough philosophy</h3><p>To condense the points, I believe that a person who has passed through a similar scenario (fully, and I’m not saying there is no more room to grow) and has the hunger to grow in a certain field has a very good predisposition to grow and learn on their own. Finding the resources, people and whatever they need to evolve. For them, a guided course is just a convenience and deciding whether it’s worth it, boils down to their budget and values. To those lost or afraid that you can’t do it alone, I’d advise to at least try on your own. If you don’t have the will or motivation to push for continuous improvement and learning even when it’s hard, you might not really want it. The benefits of trying on your own are:<br> — you’ll probably figure out is that what you want<br> — if you really try to push, you’ll get an understanding of what pushing is, so you can do it for something that will really matter to you<br> — you’ll save money</p><p>At the end of the day, I believe that proper guidance, can help accelerate your growth a lot, ultimately, you are the one who needs to put a significant amount of effort if you want to get far.</p><h3>The conclusion</h3><p>As I’m not a Product Manager expert, I definitely can’t know for sure if this field is an exception. So shout out you experts out there: prove me wrong! So far I am not really sure that Product School would benefit me personally, besides providing:<br> — convenience<br> — a cool experience<br> — potential connections to people at the Product Manager positions from the cool companies</p><p>P.S.<br>I know that this article will be confusing for many, but I believe this will resonate with a fair amount of you at least to a degree. I invite the confused ones who would want to understand more, to voice their opinion (publicly or privately on 7sedam7@gmail.com). And if this resonated with you, I’d love it if you could share your thoughts and provide feedback so that I can learn and grow.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9158834717a6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[New Zealand trip]]></title>
            <link>https://medium.com/@7sedam7/new-zealand-trip-69b9a644ef29?source=rss-d9da26071565------2</link>
            <guid isPermaLink="false">https://medium.com/p/69b9a644ef29</guid>
            <category><![CDATA[nature]]></category>
            <category><![CDATA[lord-of-the-rings]]></category>
            <category><![CDATA[travel]]></category>
            <category><![CDATA[new-zealand]]></category>
            <dc:creator><![CDATA[Joel Kunst]]></dc:creator>
            <pubDate>Tue, 30 Apr 2019 12:10:57 GMT</pubDate>
            <atom:updated>2019-04-30T12:10:57.641Z</atom:updated>
            <content:encoded><![CDATA[<p>To give a bit of background information, I work remotely so it does not matter where I am while I work, which allows me to travel.</p><p>I don’t want to travel just as a tourist. I want to experience the life and different cultures around the world in hope of finding the place where I’d want to settle in. Since my girlfriend is still in her studies, we have to plan for the trip a bit. To get a bit longer period for traveling, she applied for an exchange program in several places and in the end, we chose Singapore. It gives us the opportunity to easily visit many places in Asia and the university she got into is the NUS, which is one of the top universities. This January we landed in Singapore and have visited a lot of places around since then, but recently we have been to New Zealand (which this article is about).</p><p>I have been looking at New Zealand over the internet for a while and recently I had the privilege of visiting it. We stayed there for 2 weeks and planned a road trip around the North Island.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XSP7A0xATY9NECr1" /></figure><h3>Bureaucracy</h3><p>Let’s get the bureaucracy out of the way first. We bought a ticket to Auckland and a return ticket from Wellington. There was no big difference in price compared to just booking a return ticket to and from one destination. But to Auckland, we had a direct flight, while the flight from Wellington had a one stop. For the road trip, we booked a Toyota SUV from APEX and had good experience with them. The gas prices are similar to Europe, but US visitors will find them expensive. We did not book a place to sleep beside the first night in Auckland in advance. We wanted to have more freedom on when and where to stay during the trip.<br>By researching what places to see it was obvious that we will not get even close to fully exploring the North Island, but we wanted to go to Northland from Auckland and then later down towards Wellington while visiting some places on the way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i2-Fx_tbB2_r4slQM8JbHA.png" /></figure><h3>The trip</h3><p>When I started writing this article, I started writing it as a journal. That ended up being way too much text, so I decided to just mention some of the nice things we saw and my general opinion of New Zealand so far.</p><p>We landed in Auckland in the early afternoon. One pro tip here: before the immigration, you can buy a sim card with data package tax-free. The immigration process was quite fast. APEX has picked us up at the airport and took us to their nearby office to take over the car. So arrival was very simple and pleasant.<br>We had the rest of the day in Auckland because the next day we started driving through Northland. Auckland ended up being smaller than I imagined (at least the city center). The city gave me this US vibe from Hollywood movies. Some suburbs we passed through were really nice, but otherwise, we haven’t seen anything super amazing in Auckland.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/1*J_V_E6LIC6FiIIzZa70yBQ.png" /></figure><h3>The Northland</h3><p>During our trip, we often heard that people who do a similar trip go straight down from Auckland towards Wellington and usually skip Northland. Let me just say that we are very happy we did not skip it. <br>Navigating while driving is quite simple in New Zealand (at least from what we saw) because there is usually just one road. However, the road is far from boring. I had a hard time focusing on the road since the scenery around was so nice. So much greenery, and variety, you can just lose yourself dreaming while watching it. The plan was to drive to the Waipoua forest, Hokianga, Russell and then head back towards Auckland. On the way, we randomly stumbled upon an amazing and huge beach to which you can go to with a car.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*k2q4NZ-h3qp-fXn3" /></figure><p>We passed by a huge tree.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2uF8-g0N55nLeCFV" /><figcaption>we are a few meters away from the tree</figcaption></figure><p>The nature before Hokianga was amazing, but when we got to the Hokianga, we were amazed by the wonderful nature that took our breath away.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4mdw6S_f-MytjGFngrfsVQ.png" /></figure><p>On the way to RussellRussell, we stopped by Waiariki hot springs for some mud bathing.</p><h3>The Bay of Islands</h3><p>This place deserves its own section. All of New Zealand that we saw was amazing and felt like heaven on Earth, but The Bay of Islands is heaven in heaven.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6G84rpgCw6-RbibJapw3Lw.png" /></figure><p>Russell is a very small place, but it has shops, restaurants, post office, etc, and is just in front of the Bay. We took a day cruise of the Bay and this place is so magical. If you want to be in a place where there is something always going on, you need a “proper” city, but this place is great for chilling, relaxing, and enjoying life. One day, when I retire, this place will definitely rank very high on my list for settling down.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fPBAWRqq6SOlL2Q1L5iVoA.png" /></figure><h3>Coromandel</h3><p>After Russell, we drove towards the Coromandel, of course seeing many beautiful things along the way, but I’m trying to keep this as brief as possible :D<br>Coromandel is a place where we have heard that a lot of locals have their holiday homes. It’s close to Auckland, so it’s easy to have a weekend getaway. We, unfortunately, did not have that much time to visit all the advertised places there, but we had a pleasant walk through the mountain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SC9XFPOcdDSzn1luSmOWhA.png" /></figure><p>We took pictures next to the iconic hole in the rock.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bJCa1GE7iK3J2JmezsFpCw.png" /></figure><p>We had the best “raw” (no so raw after blending :D) vegan organic chocolate smoothie we have ever tasted (including the not vegan ones).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EcXh3xMkGnIehvaa" /></figure><h3>Matamata, Rotorua</h3><p>No New Zealand trip is complete without visiting the famous Hobbiton, a village of little hobbits from LOTR.</p><p>No New Zealand trip is complete without visiting the famous Hobbiton, a village of little hobbits from LOTR.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*khO8jpCfF7xUbzIF" /></figure><p>This place is simply amazing. I know I use the word “amazing” a lot, but there are no words to describe the wonders of New Zealand. Okay, back to Hobbiton. They have put so much attention to detail that you really get pulled into the story. Aside from all the structures being built with real materials, not just props, all the fruits, vegetables, flowers, plants are actually real.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*66UY-J5L5ZEIVyJ0" /></figure><p>You can even see the butterflies flapping their wings as they would in a commercial or a movie.</p><p>They bring wood into the Hobbit houses and use them in the fireplaces so that you can see the smoke going out of the chimneys, and you have that nice smell in the air. <br>In the nearby city of Rotorua, we visited the Maori village with world’s largest geyser eruptions (so they say).</p><p>They also have a University for various cultural craftwork.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yuEPjQUhyKGRqGQXZ2HY4A.png" /></figure><p>Another visit around Rotorua was to the Waimangu Volcanic Valley and there were some pretty nice sights to see.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yCjO_Q8bZctUdOuZI-3kbA.png" /></figure><h3>New Plymouth, Taupo lake</h3><p>Past Rotorua, we headed to New Plymouth and on the way we passed by Waitomo Glowworm Caves (photos aren’t allowed, so here the only thing you can see is the exit).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*J3Os0URcH1pVpxL7" /></figure><p>And we stopped by a so-called “petting farm” :D</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zxCK0TZvAub62pvLGPsGfQ.png" /></figure><p>In New Plymouth, we watched a triathlon competition where some Estonian girl was competing (my gf is an ex-triathlete, also from Estonia). Back to the fun part now :D Just next to New Plymouth there is a mountain with the “Goblin Forest” from (again) LOTR. The mountain is big and we are not sure whether we saw the “actual” goblin forest, but we enjoyed a couple of amazing hours of trekking.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SY6fVyBgnwANFBsfuiAJDA.png" /></figure><p>The road to Lake Taupo was an adventure, to say the least. The road’s name is the “Forgotten highway”, and I’m not surprised. A large segment of the road is unpaved and goes around the mountain where rockfalls are actually commonplace (though the rocks are small), and on random occasions, you can spot a cow casually standing along the edge of the road. The whole thing was even more adventurous because for some reason New Zealand has a very short day. It is completely dark already around 20:00. And on top of all that, we were almost running on fumes. The first gas station was about 100km away. We tried all the tricks that came to our mind and we luckily made it through with the gas we had.</p><p>The Taupo lake is again (you guessed it) amazing. One fun fact is that the lake is the size of Singapore. It was bigger than Singapore before Singaporeans expanded Singapore by adding some artificial land into the water.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*R6zxesZgCVJ2ng8u" /></figure><p>The views of the mountain are breathtaking, but unfortunately, we were not able to visit the famous Mount Doom, since it was closed because of the weather.</p><h3>Wellington</h3><p>Wellington is a nice city. It has this vacation beach house vibe with a lot of houses being on a hill-mountain overlooking the coastline, but the center of the city looks very European compared to Auckland. There was a constant wind, which I really like (some don’t :D). And some evenings were very cold, although to be fair, I did come in a short sleeve T-shirt, swimming shorts and flip-flops :D It feels really nice to live in a house at the beach and be 20min away by public transport to the city center which has all the bells and whistles of a modern city.</p><p>We visited the Papa Museum (free entrance).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tj7ERalev6ywIzgHlm_xFg.png" /></figure><h3>The LOTR</h3><p>Wellington has so many locations from the movie that I gave it a separate chapter.<br>Here I’ll just give some photos from exact spots where the movie was shot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*du3UVUlIw1eM6zRbPJAWCA.png" /></figure><p>And some cool movie-related ones :D</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rXHjndUXIvXSwv9iNopTxw.png" /></figure><h3>Final thoughts</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tH7P317sTFdiIwMU-Qb6qg.png" /></figure><p>This was a very brief overview of what we saw on the North Island. We saw way more things than described here, and we still haven’t seen half of North Island. So if you want to explore New Zealand and enjoy its wonders, take 2 months off :D or move there. The country has such a big variety of nature, many national parks, and people are not destroying it as much as elsewhere. However, lots of it is just a short drive away. For locals, it means that every weekend they can have a great holiday trip. Even though as it happens to all of us they probably get stuck in their day-to-day living routine so they don’t use the opportunity. But, when you move there as a foreigner you have a nice opportunity to enjoy all the wonders you can imagine. One more tip: install a “CamperMate” app. It has tons of locations of nice sightseeing places along the road.<br>Another thing that really stands out in New Zealand is people. They are all sooo nice, but really, it’s completely unbelievable. It’s not that I did not have any rude person talking to me, I cannot recall a single interaction with a person where that person was not extremely polite, cheerful and helpful. Another interesting thing: like people, animals are also so friendly. A couple of times we stumbled upon a kitty on the street. The cat did not try to run from us but instead scuttled towards us happily meowing and snuggling our legs. The cats were well fed and taken care of, the fur was really clean and had a nice feel to it, so clearly these were not just random street cats.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4xnxlYXOu9HrbiMN" /></figure><p>I really can’t wait to get back there and explore more.<br>Please share your experiences of New Zealand, suggest good places to visit, and reach out if you have any questions or need any tips for your visit. I’d be happy to help.</p><p>P.S. I got the shirt in Kuala Lumpur in a DC shop (really nice quality fabric).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=69b9a644ef29" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What can Product Managers and Entrepreneurs learn from Machine Learning]]></title>
            <link>https://medium.com/swlh/what-can-product-managers-and-entrepreneurs-learn-from-machine-learning-6ba9aafdcf56?source=rss-d9da26071565------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ba9aafdcf56</guid>
            <category><![CDATA[enterpreneurship]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[product-management]]></category>
            <dc:creator><![CDATA[Joel Kunst]]></dc:creator>
            <pubDate>Mon, 08 Apr 2019 14:06:00 GMT</pubDate>
            <atom:updated>2019-04-08T14:06:00.649Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NaaDFFAFyAeuqK5r3zNo9g.jpeg" /></figure><p>Let me start with a brief introduction. I’m am a big technology enthusiast and have been playing with Artificial Intelligence a lot. I worked as a Software Engineer for a while, but recently I have turned to product management. And while I am not yet an expert PM, in my recent random thinking had an interesting thought that I wanted to share.</p><p>When someone is working on a problem that they are trying to tackle with the use of machine learning, they don’t just come up with a solution and then let algorithm run and train itself. All the number of ways in which you can set up, arrange and mix different approaches is vast and one has to try out a lot of them out before settling with a satisfactory one. The key is not to waste too much time and get the answer and a feel of a certain approach ASAP to see whether it is worth it to dive into it more or try something different. Furthermore, once one has decided to dive in deeper with an approach, it also requires readjusting the meta parameters many times before settling for one. The key again is to get the results fast and to try something else if some meta parameters are not working out. Eventually, the algorithm goes through the process of training, whether it’s any kind of neural network, a genetic algorithm, genetic programming or something else, where it takes many epochs/generations/evolutions to at some point end up with a great result. On the way through it will often get a way worse solution than the one it had before that, but it does not matter. The only thing that does matter is that small chance that with every try it will improve and start or continue moving in the right direction.</p><p>I believe you already see where I’m going with this. As an entrepreneur or a product manager or almost anything you are doing in your life, as long as the goal is to achieve something and get better, it is also very important to iterate fast. Chances are that no matter what you are doing, especially early in your life/career, it has the potential to be way, way better. While you can learn a lot by focusing on something and making it “perfect”, by your understanding of “perfect” at that time, you will probably get it to a more “perfect” state if you get feedback about your progress and the direction earlier rather then later. There is this famous saying how the majority of startups fail and that their chances to succeed at very low. While it certainly is not easy, I would say that a majority of those failing startups closed themselves in a garage (or wherever :D) and worked on their perfect solution, only to find out that nobody wants/needs it and/or does not want pay for it.</p><p>Humans have a tendency to be “shy” about their work and be afraid to show it to others. But since humans did direct those ML algorithms to iterate and fail fast until they get a good solution, it seems we do have a logical understanding that it makes sense and if you try to apply it in your life you’ll be amazed at the results. Nobody laughs at the machine (or at least the machine does not care) in comparison to a human, but the constant thing that remains is that in a day/week/month/year/at some point, the past failures won’t matter; nobody will remember or care about them. And if you do learn something and improve from a mountain of failures you will be more satisfied then not trying in the first place.</p><p>I want to also touch upon a difference between the machines and humans. At least, for now, I believe that humans are still way better at understanding the context and can use the failures better/more effectively to move in the right direction. Even more, a human is capable of getting totally unexpected insights from his/her failures and adjust what is measured to get better insights. We could say that a human can meta-adjust him/her self. While yes, machines can adjust their own meta parameters, but I think you realize that a human can still get a better insight into and understanding of complex situations and their surroundings then a machine.</p><p>That said, think a bit about what you can learn from your everyday experience. Make every experience a learning experience and you’ll be amazed at how fast you will progress.</p><p>Ok, none of this is new. All of the self-development books talk about it, and all the experienced entrepreneurs and product managers tell you “fail fast” etc. I did not write this post to share new wisdom, but to share an interesting parallel between how machines learn and what seems to be a great way for a human to grow as well. This also probably isn’t new, but I haven’t seen someone making this comparison. I’m fairly new to writing, product management, and entrepreneurship, but I do want to improve, so please share your thoughts and comments to help me grow :)</p><figure><a href="https://medium.com/swlh"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YqDjlKFwScoQYQ62DWEdig.png" /></a></figure><h4>This story is published in <a href="https://medium.com/swlh">The Startup</a>, Medium’s largest entrepreneurship publication followed by +441,678 people.</h4><h4>Subscribe to receive <a href="https://growthsupply.com/the-startup-newsletter/">our top stories here</a>.</h4><figure><a href="https://medium.com/swlh"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ouK9XR4xuNWtCes-TIUNAw.png" /></a></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ba9aafdcf56" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/what-can-product-managers-and-entrepreneurs-learn-from-machine-learning-6ba9aafdcf56">What can Product Managers and Entrepreneurs learn from Machine Learning</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Algorithms practice with Crystal — AB]]></title>
            <link>https://medium.com/@7sedam7/algorithms-practice-with-crystal-ab-f59055ca7290?source=rss-d9da26071565------2</link>
            <guid isPermaLink="false">https://medium.com/p/f59055ca7290</guid>
            <category><![CDATA[competitive-programming]]></category>
            <category><![CDATA[crystal-lang]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[topcoder]]></category>
            <dc:creator><![CDATA[Joel Kunst]]></dc:creator>
            <pubDate>Fri, 22 Mar 2019 04:13:03 GMT</pubDate>
            <atom:updated>2019-03-22T04:13:03.231Z</atom:updated>
            <content:encoded><![CDATA[<h3>Algorithms practice with Crystal — AB</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*56Cc6k5BmhBe49oPB2q7VQ.png" /></figure><h3>Introduction</h3><p>This will be a series of algorithmic tasks for practice in Crystal programming language. I will start going through practice tasks from the <a href="https://arena.topcoder.com/">TopCoder</a> page, but in the future, I may put tasks from different sources. TopCoder, among other competitions, offers algorithmic competitions. The platform does not offer Crystal as the language of the submission and for that reason, I have first implemented the solution in C++ and validated that the platform accepts it.</p><p>The plan is to make a separate post for each of the tasks. For each task, I will first present the problem and then try to explain my reasoning and path by which I came to the solution I am presenting. The solution will be presented in the Crystal programming language.</p><p><a href="https://crystal-lang.org/">Crystal</a> is a relatively new and modern programming language. It heavily resembles ruby with a key difference in being type-safe and compiled. It’s worth mentioning that it compiles to very efficient machine code that can be comparable to C, depending on the task at hand.</p><p>I myself am not a Crystal master, but I really love the syntax of ruby and what the guys are doing with the Crystal language, so I want to give my contribution to the language by making this “tutorials” that might make you interested in the language besides (hopefully) helping you out with your algorithm preparations for tech job interviews or starting out competitive programming.</p><h3>The problem — AB</h3><p>The problem for which this post is going to try to explain the solution is called AB.</p><h4>Problem statement</h4><p><a href="https://arena.topcoder.com/#/u/practiceCode/16319/46378/13642/1/325040">https://arena.topcoder.com/#/u/practiceCode/16319/46378/13642/1/325040</a></p><p>You are given two integers: <strong>N</strong> and <strong>K</strong>. Lun the dog is interested in strings that satisfy the following conditions:</p><ul><li>The string has exactly <strong>N</strong> characters, each of which is either A or B.</li><li>The string <em>s</em> has exactly <strong>K</strong> pairs (<em>i</em>, <em>j</em>) (0 &lt;= <em>i</em> &lt; <em>j</em> &lt;= <strong>N</strong>-1) such that <em>s</em>[<em>i</em>] = A and <em>s</em>[<em>j</em>] = B.</li></ul><p>If there exists a string that satisfies the conditions, find and return any such string. Otherwise, return an empty string.</p><h4>Limits</h4><p>Time limit (s): 2.000</p><p>Memory limit (MB): 256</p><h4>Constraints</h4><ul><li><strong>N</strong> will be between 2 and 50, inclusive.</li><li><strong>K</strong> will be between 0 and <strong>N</strong>(<strong>N</strong>-1)/2, inclusive.</li></ul><h4>Examples</h4><p><strong>Example 1</strong></p><p>Input: 3, 2</p><p>Returns: “ABB”</p><p>This string has exactly two pairs (<em>i</em>, <em>j</em>) mentioned in the statement: (0, 1) and (0, 2).</p><p><strong>Example 2</strong></p><p>Input: 2, 0</p><p>Returns: &quot;BA&quot;</p><p>Please note that there are valid test cases with <strong>K</strong> = 0.</p><p><strong>Example 3</strong></p><p>Input: 5, 8</p><p>Returns: &quot;&quot;</p><p>Five characters are too short for this value of <strong>K</strong>.</p><p><strong>Example 4</strong></p><p>Input: 10, 12</p><p>Returns: &quot;BAABBABAAB&quot;</p><blockquote><em>Please note that this is an example of a solution; other valid solutions will also be accepted.</em></blockquote><h3>The problem explained</h3><p>For the solution, I want to try and explain my reasoning on how I got to the solution and not just give it right away. If I explain it well, I believe it can help one much more in solving problems in the future then just getting the code with lines explained.</p><p>That said, let’s first explore our problem. It is very important to really understand what the problem is, so I will spend some time explaining the examples in detail. Those who understand the issue can skip this section.</p><p>All that fancy formal math means is that we want strings that contain A and B characters such that those strings:</p><p>1. have the length of <strong>N</strong></p><p>2. have the number of each of the letters A in front of each of the letters B summed up to <strong>K</strong></p><p>1 is trivial, so let’s take a bit time to clear out 2. If we take each letter A in the string and count all the letters B that come after it in that some string and then sum all of those together we should get <strong>K</strong>.</p><p><strong>Example 1 explained</strong></p><p>String “ABB” has 1 letter A, and that letter A has 2 letters B after it, which makes <strong>K</strong> equal to 2. The string has 3 letters, which makes N equal to 3. This is exactly what was asked for, an example of a string that has a length of 3, and <strong>K</strong> equal to 2.</p><p><strong>Example 2 explained</strong></p><p>Here we are looking for a string with a length of 2 and <strong>K</strong> equals 0. The string BA has one letter A which has exactly 0 letters B that exist somewhere behind it in the string.</p><p><strong>Example 3 explained</strong></p><p>We are looking for a string with a length of 5 and <strong>K</strong> with a value of 8. There is no such a string with a length of 5 characters (letters) where <strong>K </strong>can be 8. We will explain why a bit later.</p><p><strong>Example 4 explained</strong></p><p>Here we are looking for a string with a length of 10 and <strong>K </strong>with a value of 12. Let’s calculate the value of <strong>K</strong> for the provided solution “BAABBABAAB”. The provided string has 5 letters A, let’s sum the letters B after each of them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XuJZTREA-5wqW38vQAJqgg.jpeg" /></figure><h3>The solution</h3><p>I hope that by now you understand the problem and how to calculate <strong>K</strong> from the string. Now we can start thinking of how to construct such a string when we are given <strong>K</strong>. Inexperienced people might freak out and ask themselves where to even start, so let’s try to answer that question. In the problems, when we don’t know how to solve it is good to try to start from a super simplified problem; try to answer much simpler questions and then build upon that.</p><p>So let’s explore. Let’s try to simplify the problem. What if we are allowed to have only one letter A. We still need to find a string that has <strong>K</strong> calculated in the same way and give back empty string &quot;” in case a string does not exist, but the string can have only one letter A. This problem will more often not have a solution, but that does not matter at this point. What is important is that this problem is similar and sounds much simpler. Even if we don’t know any other way, we can always just try out the strings with a letter A on each of the spaces and see what value of K we get. We will quickly notice that we don’t even need to count letters B behind the letter A since we know that all of the letters till the end of the string are B. If we then mark the position of A as i, the value of K for the string would be N-i.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/558/1*gcp09WwDJ8FpmIxa0Dv8kg.jpeg" /></figure><p>Cool, but what do we do now? Let’s see what happens when we try to add one more A and to stay as simple as possible let’s say that this second A must be next to the first one (no B’s between them).</p><p>Let’s take the above example and see how <strong>K</strong> changes when we add a letter A. It might depend on which side we add the new letter A, but since the end result will, in the end, be that we have two letters A next to each other, we get the same result regardless of which one has been added first. Using that knowledge lets simplify the problem a bit more without actually changing it. Let’s say that the second A can be added only from the right side of the current A, while it still has to be added next to it (We could have chosen any side). Let’s see now then what happens if we place the letter A on position 3 in the previous example instead of B.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/534/1*ppC82mBwfgnnimlFDOWmeg.jpeg" /></figure><p>Just as before the new A adds N-i to <strong>K</strong>. But the new A has impacted the old A since the place that was previously counted as B is no longer a B. Therefore, the new A that is added directly to the right of the already existing A contributes N-i-1 (-1 for crippling the old A). If we look further, we see that actually it does not really matter whether the new A is added directly next to the old one. As long as it is added from the right side its contribution will add up into <strong>K</strong> for all the B’s after and decrease the <strong>K</strong> for the letter A that is somewhere to the left.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*tqa29j-j-R-L0ZnJvxDsmA.jpeg" /></figure><p>If we look even further and try to add one more A but again adding it only to the right, we see that we get the same thing, except we now have to reduce the <strong>K</strong> for 2 A’s that are already present. It is clear that the general formula for the contribution of replacing B anywhere right from the rightmost A with A is N-i-Acount, where i is the position of the newly added A and Acount is the number of letters A already present in a string before the new one is added.</p><p>We already have a lot of insight, so let’s try to bring it all together with a few more conclusions. If we have a string with all characters B, it is obvious that we get the biggest contribution of replacing B with A if we replace the leftmost B. It is easy to see that the same is true for every subsequent replacement.</p><p>We can also see that, at some point, if we do a replacement, we will get less of a value from the B’s for the newly added A than what we lose for all the previous A’s losing one more B. Logically and by looking at our formula N-i-Acount, we see that this happens exactly when the replacement will make the total number of characters A larger than the total number of characters B. Which occurs exactly when there is an equal amount of characters A and B. Example: AABBB has the same <strong>K</strong> as AAABB, and AAAAB has a smaller <strong>K</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*1xKvX7pI-0Pmb104d3CgMg.jpeg" /></figure><p>Ok, so we can try to add characters A from the left side until we:<br> — get the string <strong>K</strong> that is larger than or equal to the <strong>K</strong> that we are looking for<br> — get to the half of the string and do not reach the <strong>K</strong> we are looking for</p><p>Since adding characters A from the left side gives the largest contribution towards the <strong>K</strong>, the largest possible <strong>K</strong> we can get is for the string that has all characters A on the left half, and characters B on the right half. Therefore, for the second case, it is clear that the string with the given <strong>K</strong> and length <strong>N</strong> does not exist.</p><p>For the first case, we need to replace the last (rightmost one) character A with the character B and replace some other character B with A. We know that the more we move to the right, the less of a contribution there is. If we replace the character B that is just next on the right to the place where we returned B, that new A has exactly one less character B on the right side, while all characters A from the left side have the same amount of characters B on their right. This means that moving the rightmost character A by 1 place to the right will lower its contribution by exactly 1. So we just move A by the number of places that are missing to get the given <strong>K</strong>.</p><p>The last thing we want to be sure of is whether we will always be able to move A for the wanted amount of spaces. Let’s look at the following case.</p><p>We have exactly 1 A too many, meaning that the current <strong>K</strong> is bigger than the <strong>K</strong> we are looking for and if we replaced the rightmost A with B we would get a <strong>K</strong> that is smaller than the <strong>K</strong> we are looking for. We want to know whether there is a place where we have enough places to move the rightmost A to the right to get the value of <strong>K</strong> we are looking for. The biggest contribution that this A can give is just next to the rightmost A and that contribution depends on the number of characters B to its right. Let’s mark the number of characters B with Bcount. As we know that by moving the rightmost A to the right, we can lower its contribution by 1 per move. If we have Bcount characters B, we have exactly Bcount spaces to move the character A. Adding one A to the right will always contribute less than Bcount because it also has a partly negative contribution for removing one character B to the characters A that are to its left.</p><p>With this we have our algorithm:</p><pre>Given that we replace B with A from the left:<br>Find the smallest amount of As that would form a string with its <strong>K</strong> value bigger or equel to the <strong>K </strong>we are looking for.</pre><pre>if there is no such a string<br>  return &quot;&quot;</pre><pre><strong>K&#39; </strong>= calculate <strong>K</strong> for the current string<br>diff = <strong>K&#39;</strong> - <strong>K</strong><br>move the rightmost A for diff spaces to the right</pre><h3>Here it is in crystal</h3><pre>class AB<br>  private def find_number_of_as(n : Int32, k : Int32) : Int32<br>    m = n / 2<br>    (1..m).each do |i|<br>      return i if (i * (n-i) &gt;= k)<br>    end<br>    -1<br>  end</pre><pre>  def create_string(n : Int32, k : Int32) : String<br>    a_count = find_number_of_as(n, k)<br>    return &quot;&quot; if a_count == -1</pre><pre>    k_ = a_count * (n - a_count)<br>    last_a_move = 0<br>    if k_ &gt; k<br>      last_a_move = k_ - k<br>      a_count -= 1<br>    end</pre><pre>    if last_a_move != 0<br>      return &quot;A&quot;*a_count + &quot;B&quot;*last_a_move + &quot;A&quot; + &quot;B&quot;*(n - a_count - last_a_move - 1)<br>    end<br>    return &quot;A&quot;*a_count + &quot;B&quot;*(n - a_count)<br>  end<br>end</pre><p>I have committed and pushed both cpp and Crystal version <a href="https://github.com/7sedam7/Algorithms">here</a>.</p><p>Note that we could have implemented a binary search for finding the initial number of As, but it would make the code a bit less readable, and for this problem would not make a visible contribution.</p><h3>The Conclusion</h3><p>Here it is, the first article. Please let me know what you think, has it been useful, was the way it was explained good, what can be better, and/or what tasks would you like explained next :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f59055ca7290" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The horror of cavity removal and tooth filling]]></title>
            <link>https://medium.com/@7sedam7/dentist-fear-cavity-toothfilling-fearofdentist-b084bb2f76f1?source=rss-d9da26071565------2</link>
            <guid isPermaLink="false">https://medium.com/p/b084bb2f76f1</guid>
            <category><![CDATA[hurt]]></category>
            <category><![CDATA[dentistry]]></category>
            <category><![CDATA[fear]]></category>
            <category><![CDATA[teeth]]></category>
            <category><![CDATA[pain]]></category>
            <dc:creator><![CDATA[Joel Kunst]]></dc:creator>
            <pubDate>Sun, 17 Mar 2019 05:50:44 GMT</pubDate>
            <atom:updated>2019-03-17T06:19:45.832Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MoeBN_QgnQW6NALQyxC_1Q.jpeg" /></figure><p>Let me give a brief background of fear and me. Generally, I’m not a person who is easily scared, but when I am it’s quite extreme. One example is my “fear” of needles. I’m not sure is “fear” the correct word, since I don’t think I’m scared, I just really dislike them (a debate about whether that’s the same thing is not the topic of this article). I have taken blood about 4 times in my life in total and one of those times I was paid 200 euro by my worried grandma to do so. One of those “extreme” cases with my “fears” is my recent visit to the dentist. This title might be misleading but is written like that to hopefully attract the appropriate audience. If you ask almost any random person about the procedure, they’ll say it’s nothing special. On the one hand, I would agree with that, but after reading my story one might not say it was nothing to me. The goal of this article is to provide a story of my experience and the point of view of a scared fellow who experiences and understands the fear you are experiencing. I hope to give you a bit more courage than those “it’s nothing special” comments. If this doesn’t resonate with you, you will find this ridiculous so maybe save yourself time and stop reading here. If you have time to waste though, you might find it amusing.</p><p>My story started a few weeks ago when I finally went for a general dental checkup “just in case”, even though I did not feel any problems. I wanted to go because I haven’t visited a dentist in almost 20 years. The reason for not visiting earlier was not fear, but laziness and the lack of understanding the potential problems. I did not want to go to a random dentist, but this one was highly recommended by a friend, so I decided to finally go. Upon checking my teeth, the dentist said that they are generally ok, but that I have a lot of tartar on my teeth and that it is destroying my gums. She mentioned that I need to clean that up about once a year and that she can do it right away. The process did not sound like much, just scrubbing the tartar from my teeth, but I definitely did not feel comfortable with letting someone put some tools in my mouth and scrub the teeth. My fear of the unknown kicked in, so I asked tons of questions but after a few minutes, I allowed the doctor to do the procedure. The process was not painful, but it was very uncomfortable. I usually always breathe through my nose, but somehow I was often feeling like I couldn’t breathe and we had to often stop for me to clean up my mouth and breathe in.</p><p>Having my teeth cleaned from the tartar felt great after it was done. I was able to feel the shape of my teeth with my tongue, at least way more than before the cleanup. My happiness after the end of the procedure, unfortunately, did not last. The dentist went to the screen to show me some dental x-rays. On the bottom right side, there was a tooth at the back that had two slightly darker spots. The dentist explained to me that these spots mean that there are cavities and she advised me to deal with it as soon as I could because the cavities would spread and I might have big problems. She said that she couldn’t do it right away, but that I could book an appointment, or do it in my country when I returned (more information about that in the end). My fear started to kick in, and I asked tons of questions about what exactly a “cavity” is and how to deal with them. She explained to me the mouth is full of bacteria that love to feed on glucose which is present in almost everything we eat. The problem is that during their feeding process, those bacteria shit out acid which destroys teeth and that’s how you get cavities. Very interesting, but how do I get rid of it? Well here’s where my horrors started. To get rid of them, one has to drill through the tooth, to remove the parts that have been “infected” and fill in the empty space with some compound that looks like a tooth in the end. In my case, this cavity was small and did not reach the root canals, but when it does, the procedure becomes much more complex and painful. Even though my case was described to me as a routine, simple and basically painless procedure I was freaking out about my tooth being drilled.</p><h3>The doomsday</h3><p>Over the next week, I was agonizing over what to do about my cavities. I googled the hell out if internet to find out as much as I can about it. The most reasonable option seemed to be to just go and do the procedure, especially while I was still around Kuala Lumpur where this dentist was. Since I did not have my dentist I have built some trust with this one, and I was satisfied with her first work. Also, a dentist in KL is quite cheaper than in Europe. After that week I was still not ready for it, but I wanted to make a step forward so I contacted the clinic and booked my appointment for the next week.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*59VnsvckrWERQBiDAqAAHQ.jpeg" /></figure><p>And the day came. I woke up early and was trying to mentally prepare myself, but by the time I reached the clinic I was quite freaked out. Those ~15min I was waiting to get called inside lasted for an eternity. When I finally came into the operatory and sat on the chair I was trembling from fear. I did not have any reasonable reason for my fear, but regardless I was scared. The dentist was assuring me that I should not feel anything while she was drilling through the surface of the tooth, and I have eventually opened my mouth. I indeed did not feel anything, but I was still feeling uneasy. After a while, the dentist showed me the closeup photos and explained that on one side of the tooth the cavity is actually quite deeper than originally thought. It was hiding behind the other tooth, just on the edge going down towards the gums. She said she had to clean it more, but that it should still not hurt. With my worry growing with every passing moment I let her continue. The more she drilled I started to feel pain, twitching every time. That has significantly slowed down the dentist and eventually, it got to the point that she said she’d give me anesthesia. You can imagine! I was already in the world of fear and now someone is mentioning sticking a needle in my mouth. The dentist had a phone call and I told her to take it, that I needed some time to prepare. Sitting there I started shaking from fear and was seriously considering going away. The dentist returned and I was not even close to ready, in fact, I was more scared than ever and my fear was just exponentially growing. The doctor mentioned that she could put a temporary filling and I could do it some other time when I was ready, but she wouldn’t advise it. After some more talking I laid back down on the chair and slowly opened my mouth questioning every single thing the dentist did. She first put some numbing gel, then placed some gummy thing and then came the needle time. After a bit of explaining what she would do and how it would feel I opened my mouth and closed my eyes. I barely felt the needle, and even though after the sting I literally did not feel anything for the next ~10seconds I was super uncomfortable and scared knowing that there is a needle in my mouth, pierced through my skin. After the needle went out, I felt a tiny bit relieved, but then the dentist told me she had to put one more needle on from the other side of the tooth. I was totally beside myself. It was too much, but I let her put it in. This one I felt a bit, but it was in for only about 2 seconds. I felt the numbness, but I was still able to use my mouth more or less normally. After a few minutes, the dentist said she would continue the drilling now and that we were almost done anyway. I let her continue and on occasion, I still felt a bit of pain. The drilling did not last much longer and I was not able to believe that it was done when she said it was. To my non-surprise, there was still time to pass before all would be done. The next thing was scraping the tooth with some iron tool. That did not hurt but was super uncomfortable. I can bet you that I feel the pain in my tooth now when I think about it. After the scraping, there was a lot of water and air and looking and stuff. The final thing was filling the tooth which did not hurt at all but was not comfortable and I was super impatient at that point already.</p><h3>Conclusion</h3><p>Woo-hoo! Finally, my cavity problem was gone, but I did not feel that way at all. I was definitely glad it was done, but I was still in shock. Anyway, after calming down and looking back, I’d say “yeah, it’s not that bad”, but for me, it was still super scary and I don’t want to do it again, ever. I will be more conscious about carefully washing my teeth and using floss on all the teeth at least once a day (In the past I have never used it).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*XfFCT9lIbV9U2F3i6l_bXQ.jpeg" /></figure><p>As mentioned, most of the people will find this post and my experience ridiculous, but those of you who relate, I hope it will help you out with going through your fears. I have survived and so can you :)</p><p>Please share your experiences, so that I know I’m not the only unreasonable one :D</p><p>P.S. If you happen to be in KL and need a dentist, I would definitely recommend this dentist. Her name is Belinda Dwee and at the time of this writing works at “Smileway” dental clinic. You can contact the clinic at +60 17–650 9817. I am not getting any referral bonus in case you go there.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b084bb2f76f1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Postgres ORMs in Go-lang]]></title>
            <link>https://medium.com/@7sedam7/postgres-orms-in-go-lang-d2feb5f7431b?source=rss-d9da26071565------2</link>
            <guid isPermaLink="false">https://medium.com/p/d2feb5f7431b</guid>
            <category><![CDATA[activerecord]]></category>
            <category><![CDATA[orm]]></category>
            <category><![CDATA[golang]]></category>
            <dc:creator><![CDATA[Joel Kunst]]></dc:creator>
            <pubDate>Thu, 07 Mar 2019 17:18:25 GMT</pubDate>
            <atom:updated>2019-03-12T15:17:34.559Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U1kQDwOJ5oKmteU6OzDAHw.jpeg" /></figure><p>(The article was written in March 2018)</p><p>Lots of people nowadays use ORM (object-relational mapping) for communicating with databases for various reasons. Whether you should use ORM depends on your situation at hand and is a topic best left for another time. Here, I can share my experience of available ORM options for those who do want to use it, and for those that might want to use it in the GO language.</p><p>I want to mention that this is not a tutorial on how to use ORM in go-lang, just an overview of 2 available ones. (there might be more, but this 2 seem the most popular ones)</p><p>I have been using Go-lang for about half a year now and I had a chance to try out 2 different ORMs for interacting with the Postgres database. In this post, I want to share my findings and give our readers an overview of what I tried.</p><p>The two “main” libraries that I found were <a href="https://github.com/go-pg/pg">go-pg</a> and <a href="https://github.com/jinzhu/gorm">gorm</a>.</p><p>At the start, we chose to use go-pg, but later on, I had a chance to play around with gorm. One important thing to mention here is that gorm is not a Postgres ORM. It is a general purpose ORM, which can be used with virtually any database as long as someone implements the interface for it, which in gorm is called a “dialect”. However, most of the major databases already come with pre-written dialects, including Postgres.</p><p><strong>Interface</strong></p><p>Go-pg is on a bit lower level then gorm. The methods are a bit less flexible and there are some unexpected things to keep in mind. Gorm provides CRUD operations while go-pg provides a bit higher level binding for SQL operations.</p><p>For example, to create a record in go-pg (a new row in a database), you have to call an Insert function to which you provide an entity you want to insert. In order to update the entity, you have to call the Update function.</p><pre>Example:</pre><pre>import &quot;github.com/go-pg/pg&quot;</pre><pre>// user struct<br>// sql in `` allows to specify sql database column options<br>// but normal structure can be used<br>type User struct {<br> ID    int64  `sql:&quot;,pk&quot;`<br> Email string `sql:&quot;,unique,notnull&quot;`<br>}<br>user := &amp;User{Email: &quot;email@email.com&quot;}</pre><pre>// init db connection<br>opt, err := pg.ParseURL(&quot;postgres://user@$host/$database?sslmode=disable&quot;)<br>if err != nil {<br>  panic(err)<br>}<br>db := pg.Connect(opt)</pre><pre>// insert a record<br>// record variable gets updated with ID value<br>err = db.Insert(user)<br>if err != nil {<br>  panic(err)<br>}</pre><pre>// update a record<br>err = db.Update(user)<br>if err != nil {<br>  panic(err)<br>}</pre><pre>// query all with condition<br>var arrayOfUsers []User<br>err = s.db.Model(arrayOfUsers).Where(&quot;column&quot;+&quot; = ?&quot;, &quot;value&quot;).Select()</pre><pre>// close the connection<br>db.Close()</pre><p>In gorm, if you know you are creating a new entity (inserting a new row) you can use the Create function, and there is a Save function both for new objects or for updating existing ones. So in this case gorm has a bit of abstraction on top of the standard insert and update operations from SQL. Similar functions are trivial to implement on top of go-pg, but that is not the only example.</p><pre>Example:</pre><pre>import (<br>  &quot;github.com/jinzhu/gorm&quot;<br>  _ &quot;github.com/jinzhu/gorm/dialects/postgres&quot;<br>)</pre><pre>// a User struct<br>// gorm.Model adds fields `ID`, `CreatedAt`, `UpdatedAt`, `DeletedAt`<br>// You can also define specifics in ``<br>type User struct {<br>  gorm.Model<br>  Email string `gorm:&quot;column:username&quot;` // sets the column name to username instead of default email<br>}</pre><pre>user := &amp;User{Email: &quot;email@email.com&quot;}</pre><pre>// Connect to database<br>db, err := gorm.Open(&quot;postgres&quot;, &quot;user=postgres dbname=database sslmode=disable&quot;)</pre><pre>if err != nil {<br>  panic(err)<br>}</pre><pre>// Create a record<br>db.Create(user)</pre><pre>// Update or create a record<br>db.Save(user)</pre><pre>// query all with condition<br>// NOTE: here we added query by age as well just to show how simple it is to add additional filter<br>// gorm returns a db &quot;object&quot; so that you can chain methods<br>var users []User<br>// there are many other methods besides `Find`<br>db.Where(&amp;User{Email: &quot;email@email.com&quot;, Age: 20}).Find(&amp;users)</pre><pre>// close the connection<br>db.Close()</pre><p><strong>Transactions</strong></p><p>Go-pg and gorm both have a similar approach to handling transactions. You have a function to start a transaction, and functions to commit and rollback. However, go-pg is a bit “less smart” in this regard, and I had some unexpected problems. We expect from the ‘ordinary’ SQL world (how RDBMs works) that a transaction will fail if some error happens during a transaction in any of the SQL queries. The exact same thing happens in go-pg without a manual call to Rollback on error. What is unexpected, however, is that in that case, the old connection to database stays opened and hangs, while go-pg adds a new one to the connection pool.</p><p>If your transactions are being rollbacked in this way, your connection limit towards the DB will deplete quickly, which is a problem. Here, one should take care to manually call Rollback on error within a transaction or use the RunInTransaction method, which takes a function that executes the whole transaction and checks for errors and calls the Rollback for you. While it is not a big problem to use either of the two methods, having to do manual rollbacks is definitely unexpected, which leads to problems.</p><p><strong>Migrations</strong></p><p>Here I have mixed feelings. Go-pg has a migration tool included as a part of the package. The tool is very nice, however, the functions for creating/deleting/altering tables are not as expressive as the ones in gorm.</p><p>Gorm also provides a feature called “auto-migration” which creates additional columns if the model changes. The feature does not alter column types, nor delete removed columns though. Even though Gorm does not provide a migration tool by default, there is a simple tool called <a href="https://github.com/go-gormigrate/gormigrate">gormigrate</a> has to be added separately but is quite good and easy to add.</p><pre>Examples:</pre><pre>// go-pg<br>err := db.CreateTable(&amp;user.User{}, &amp;orm.CreateTableOptions{<br>  IfNotExists: true,<br>})<br>query := `ALTER TABLE users ADD COLUMN IF NOT EXISTS age integer;`<br>_, err = db.Exec(query)</pre><pre>// gorm<br>db.CreateTable(&amp;User{})<br>db.AutoMigrate(&amp;User{})</pre><p><strong>Serialization</strong></p><p>While neither of the two is perfect when it comes to serialization, go-pg does by default support more (arrays). When go-pg does encounter types it doesn’t know what to do with, it successfully saves them as jsonb, which can create its own problems. While gorm by default supports only primitives, a simple library called <a href="https://github.com/lib/pq">pq</a> adds support for array types and it’s easy to add and use.</p><p><strong>Validation</strong></p><p>Neither have any great validation features by default and for both, there are additional options. Gorm seems to have a problem with specifying a not null constraint on the field (or at least I did not figure out how to use it, but the official example does not work for me). Go-pg did a good job here.</p><p><strong>Documentation</strong></p><p>Gorm has quite better documentation. Both have the GoDoc list of functions with some kind of a description, but gorm additionally has its own <a href="http://jinzhu.me/gorm/">official page</a> with a list of explanations and examples, and it is really easy to follow.</p><p><strong>Conclusion</strong></p><p>All in all, both options seem to be fine and can get the job done. A non-go-lang ORM that I really like is ActiveRecords from Ruby and gorm feels more like it. For that reason, my personal preference is with gorm. It did feel a bit strange that gorm by default did not support some things, so they have to be added on the side, especially since gorm as a library overall seems to be on a bit higher level.</p><p>I hope someone will find this short overview useful. Feel free to correct me if I’m wrong, I’ll try to keep an eye on your comments and help out with any potential questions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2feb5f7431b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Keto, Fasting and other cool stuff]]></title>
            <link>https://medium.com/@7sedam7/keto-fasting-and-other-cool-stuff-c3de7c79b7ef?source=rss-d9da26071565------2</link>
            <guid isPermaLink="false">https://medium.com/p/c3de7c79b7ef</guid>
            <category><![CDATA[wfpb]]></category>
            <category><![CDATA[health]]></category>
            <category><![CDATA[ketogenic-diet]]></category>
            <category><![CDATA[keto]]></category>
            <category><![CDATA[vegan]]></category>
            <dc:creator><![CDATA[Joel Kunst]]></dc:creator>
            <pubDate>Fri, 07 Dec 2018 09:01:19 GMT</pubDate>
            <atom:updated>2019-03-08T18:09:47.262Z</atom:updated>
            <content:encoded><![CDATA[<p>Even though I have seen people mentioning it before, but lately I see a lot of mentions of “Why I started eating once per day” and similar posts all around and I wanted to give my few cents on the topic.</p><p>I wanted to address a few things:</p><p>1) Weight loss &amp; muscle gain</p><p>2) Simplicity</p><p>3) Overall health and well-being</p><p>4) Magic and final thoughts</p><p>So you have heard about this cool thing called a keto diet and/or fasting where you eat only once a day. It’s super simple because you lose much less time and you lose weight so easily and you feel amazing, it works like magic.</p><p>I will point out that even though we as a human race have come far, we still know so little about how the human body works and individuals now even less. Our society is driven by marketing, health magazines have big banners over the whole pages filled with candy bars, ice-creams etc, and I think we can all agree that those are for sure not healthy.</p><p>When someone who does not have proper education about how a human body works (which most of us don’t) and general knowledge is so small, there is tons of confusion even among the Ph.D. fancy guys and girls, it is no surprise that anything can sound interesting if presented right.</p><p>I personally eat a whole food plant-based (WFPB) diet. No, it’s not a vegan, because for example a potato chip is vegan food, and vegan sausage is vegan, etc, I try to eat non-processed food as much as possible, striving for raw, but I’m not completely there yet.</p><p>This is not going to be a post written by a vegan fanatic and animal rights fighter. I do not like to kill animals, but I’m not really fighting much against killing them for food, nor does it matter for this post. I want to present my experience and “knowledge” of the way I eat and compare it with what I “know” about currently a quite popular keto and/or fasting diets.</p><p>From what I have heard and learned I believe that absolutely yes, you can burn fat and lose weight by doing keto and/or fasting without a problem. There are also people who claim they are building muscle and getting stronger while doing keto and/or fasting about which I can’t comment much, since I haven’t tried it my self, nor will I construct an argument that takes part of the store and ignore tons that nobody know about human body that supports whatever I want to claim, so if someone did it, let’s say you can do it. So, for now, keto and/or fasting looks good.</p><p>From my personal experience on a WFPB diet, I lost a shit load of fat quite easily as well. Within 4 months I went from ~19% fat to ~8% fat. I did train more than a little, but the first month, which I did not train much I have lost ~3.5%. My training is gymnastics and calisthenics where I care more about the strength and usability of my muscle than how big and beautiful it is. I’m not a pro, nor consider my self super strong, but I’d say that I have more functional strength than average guy/girl who trains some other random sport. That said I can say that you can definitely build up strength and with strength sometimes muscle has to grow somewhat, so the muscle can grow as well. There are also examples of WFPB diet bodybuilders.</p><p>P.S. I was and still am eating at least 3000 calories per day.</p><p>People claim that in today’s busy life having 1 meal per day saves time and mental effort on thinking what to eat on all of those many meals you usually eat. While on one side I would agree with that, I would say that staying in ketosis is definitely not trivial and is more complex than eating what an average person usually eats. Once you get used to it, it can be simple, but that is something we can claim for almost anything.</p><p>To be as objective as possible I will give my backstory which can show that WFPB diet is simple for my specific case and people who feel similar (so maybe it will be useful at least for those).</p><p>I was usually always hungry, no matter what I ate and how much I ate, maximum in 2hours I would want to eat something again. I also love to munch something in my mouth. In today’s busy life yes in addition to all other things that I need to think about and be on top of, thinking what to eat every time I’m hungry (which is always) makes me easily fall for eating something that’s close by and available. I absolutely have no problem with choosing a nice healthy meal instead of chocolate, but when I’m really hungry and want to eat as soon as possible, chocolate or similarly non-healthy thing finds it’s placed under my teeth.</p><p>Even though restrictive, for my case WFPB was actually a breath of fresh air regarding simplicity. I just ordered tons of different fruits and vegetables and I can munch them all day long. They are tasty and healthy and I can eat as much as I want, whenever I want. No preparation, no nothing, just take it and eat it, for me personally that is way simpler than anything I have seen around. Even if I would want to spend the money to order every single meal this would still be simpler for me. It is a bit less simple if you have to go to the shop to buy fruits and vegetables, but almost everybody can order it these days.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*-4qXT6SDRKJZjKuSJWTpCQ@2x.jpeg" /></figure><p>There is not enough research to claim that keto and/or fasting is healthy nor non-healthy. It might be the best thing in the world, however, some researches say that ketosis is a survival mode for the body. When the body can not get the energy normally then it goes in the ketosis and uses that stored fat. So healthy or not, ketosis is a hack.</p><p>As far as the fasting goes, the main argument against eating multiple times a day was that people then have to think and plan and can easily make a mistake (at least as far as I have heard, haven’t heard any reasonable argument besides that for fasting, not saying there is none), that does not make it healthy, but how moderation and step by step is usually good at everything I would rather bet on giving body food when it needs it, a bit by bit (does not need to be in the 3 meals per day framework), then on once per day fasting.</p><p>To stay in ketosis you have a big restriction on food that you can eat and have no way of getting all the vitamins, minerals, nutrients without supplements. Some researches show that looking at some vitamins in isolation is actually wrong, some vitamin on its own does not really provide much of a value, but rather the complex molecular structure of the whole food that contains that vitamin is what gives us the benefits. We still don’t exactly understand how and why, but there are some theories. B12 also seems to be an exception, but that is not really a vitamin nor is important for this post.</p><p>I think that for this there is also not enough research, to make definite claims, but there is a lot more research that goes in favor of WFPB. <a href="https://en.wikipedia.org/wiki/The_China_Study">The China study</a> was the biggest nutrition research done so far and there is the same name book which presents the findings. As every author is at least a bit subjective towards the points that he/she wants to make, the book author probably is at least a bit as well, but for a difference on all of that nutrition “professionals” and bloggers out there who present their claim as the best thing in the world, the author of this book has a shit loads of science papers behind it and if you have time and will you can go and read them, there is to many and some knowledge is required in order to understand them, but they exist and there is a lot of them.</p><p>Besides these fancy papers, let’s look at human and nature how it was (as we believe created). Everything in nature was created to work (more or less) in harmony with the rest. To be in ketosis thousands of years ago (as we imagine those times, or if you just go somewhere in the jungle without technology) is quite hard. Normal things that human found around him/her were different fruits and vegetables (ok animals as well), but 1 banana basically kicks you out of ketosis, that’s how much your body does not want to stay in that state.</p><p>To be sure I’m not damaging my self after switching to WFPB, (even though I really hate needles) I have done multiple blood tests, and my results are incredible (I only have a vitamin D deficiency, and that’s due to Estonia’s wonderful weather :D).</p><p>So even though keto and/or fasting just might be the healthiest thing ever, and I really am not a traditional guy, but I’d rather place my bet on plane fruits and vegetables.</p><p>When people try something new, especially if it’s something that they saw a hyped story about, they have great hyped stories how that change magically changed their life, how everything is now better, health, love, work, the sun is shining, it’s magical.</p><p>I believe that a small change can make a big impact, but I see overhyping of things everywhere and am very cautious when hearing those magical stories. Just like some Chung-slang tea (or whatever was it called) was promising wonders, these new hypes look like improved marketing and stories that make more sense. While I’m not claiming here that keto is like that, I’m inviting you to think about it and pay attention when hearing those kinds of stories regarding anything.</p><p>Things from those stories might actually be true, but with overhyping, there will be a lot of non-truths as well, I bet there many people who consume WFPB and tell magical stories about it. Take all the info with a grain of salt and test out your self what appeals to you and adjust according to your own needs. I know it’s easier to follow a magical recipe for success, but you’ll probably be better if you use your brain and form your own thoughts and opinions.</p><p>My story about WFPB is not magical, I feel well the same as I did before. I have some benefits, from which simplicity was explained already. I also do not agree with the killings of animals at least not me, since I would not be able to kill an animal my self to eat it. My wallet is also happier. Yes, you can eat cheaper than fresh fruits and vegetables, but I do less eating out and ordering from restaurants so I, in general, spend less. I still remember and like the taste of things I don’t eat anymore, but I don’t miss them, I haven’t had a single moment where I felt like “oh I would really love to eat that Burger factory Cesar burger”, but that, of course, might not be the same for everybody. Although the less hungry you are, the less you crave for any kind of food (at least it’s true for me), and as explained before, on WFPB the way I eat I’m never really hungry.</p><p>A final thought, I might be completely wrong, but I don’t like to hack what I don’t understand, and for health natural things seems more healthy to me, where plane fruits and vegetables definitely seem more natural. I tried it out and I like it, so far it works for me. For long-term health, I guess we will see in some 30 years from now if I continue to eat the same.</p><p><em>Originally published at </em><a href="https://medium.com/p/37def6af8fce"><em>medium.com</em></a><em> on December 7, 2018.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c3de7c79b7ef" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>