GET /api/v1/writings/
HTTP 200 OK
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

[
    {
        "title": "How to Read Books for Free",
        "date": "2019-07-17T09:00:27-04:00",
        "category": "Reading",
        "description": "",
        "body": "## Introduction\r\n\r\nThis post will provide a step-by-step tutorial on how to download books for free (not the crappy books, but the good staff). This means that the money stays in your pocket and does not go to the publisher and hence does not go to the author and that is bad! Authors put a lot of hours, a lot of work in the final product and it is unfair to leave them without any financial reward for their work.\r\n\r\nOn the other hand, how many times did it happen to you that you have purchased a book and it turned out to be a total waste of time and money.\r\n_Note: Don't know about you, but it happened a lot to me._\r\n\r\nSo, what I propose, is that you use my guide to download a book for free and once you read it decide whether the author has provided any value to you and I mean any. Even if the book has provided you with 1-2 good thoughts while you read, consider it great value! If you decide that value has been provided and the book was good, buy the book! Please, buy the book! Or at least donate some money to the author, he/she deserved it.\r\n\r\n### Apology to Authors\r\n**Thank you so much for your thoughts, your research, your work and your wisdom, we really appreciate it! **\r\n\r\n## Instructions\r\nIf you are more or less sufficient with computer use, here is just a list of super-duper-mega cool resources that you can use to download books for free. You don’t need to read the rest of this guide.\r\n\r\n\r\n* Libgen [1](http://libgen.is){:target=\"_blank\"} [2](http://libgen.io){:target=\"_blank\"}\r\n* [Gen Lib](http://gen.lib.rus.ec/){:target=\"_blank\"}\r\n* [B-Ok](https://b-ok.org/){:target=\"_blank\"}\r\n* [Sci-Hub](http://sci-hub.io/){:target=\"_blank\"}\r\nNote: Great for reading scientific publications for free\r\n* [Bookfi](http://en.bookfi.net/){:target=\"_blank\"}\r\n* [ScanLibs](http://scanlibs.com/){:target=\"_blank\"}\r\n\r\nIf you run into a problem while on one of this sites please read the steps below.\r\n\r\nLibgen.io is my favourite website! I can find almost any book here. I prefer to read books in epub format (convert to azw3 and import to my Kindle), but you can download them in any format you prefer (PDF, mobi, etc.)\r\n\r\n1. Go to [libgen.is](http://libgen.is){:target=\"_blank\"}\r\n2. In the search bar, type in the book you are looking for.\r\n_Note: I suggest first finding the book on amazon, to copy the exact title (or the first couple of words from the title)._\r\n3. Press Search.\r\n_Note: after I’ve got my results (assuming that I did) I like to sort by year (by pressing on the year button), so that I can see the latest edition available._\r\n4. Now you just need to find the file with the extension that you need. (Extension column).\r\n_Note: There you can see PDFs, EPUBs, MOBI, AZW3. You will most likely need a PDF or an EPUB. Even if you are looking to import your book to a KINDLE, you can easily convert EPUB to AZW3, which KINDLE uses._\r\n5. Once you found the book you’ve been looking for you can just press on on of the numbers in the square brackets [ ] (mirrors - fancy word for links). Or you can press the link of the book (the name itself), which will lead you to a page where you can choose the mirror in more detail.\r\n6. Usually the only thing left to do is to press “Get” or “Download”. Sometimes, certain mirrors will require some additional step (nothing serious).\r\n\r\nThat’s it. Now you a have a book file on your computer (or phone) and you can read it. For free! Just don’t forget to buy the book if you liked it. Chances are you’ll want to read it again.\r\n\r\nIf there is something you don’t understand, just shoot me an [email](mailto:kireevr1996@gmail.com)  and I’ll try to give you some more information.",
        "word_count": 628,
        "day_of_the_week": "Wednesday"
    },
    {
        "title": "Why Reading is so Good",
        "date": "2019-07-17T09:25:17-04:00",
        "category": "Reading",
        "description": "",
        "body": "I stumbled upon [this article](https://andymatuschak.org/books/){:target=\"_blank\"} recently and am still reading it. Even though I am still reading, I wanted to share a thought that came to my mind after reading the first sentence.\r\n\r\nAndy’s (author of the article) argument was that when you read a non-fiction book, like \"The Selfish Gene\", \"Thinking, Fast and Slow\", \"Guns, Germs, and Steel\" you don’t actually end up remembering the contents of the book. While you read it, you think “Yeah, that’s cool, I’ll remember that”, however, in reality you really absorbed only a couple of things max.\r\n\r\nDeep inside, I agreed with his statement. (Actually, I agreed even on the surface.). That made me think, “Why the hell we read books, if we don’t remember the contents?”. The question did not torture me for long, the answer came almost instantaneously.\r\n\r\nWhen you read a non-fiction book (or fiction sometimes) and see something interesting you make a little change in your life. This change could be psychological or physical, it could be done in your conscious or subconscious mind, but nonetheless it makes a change (usually positive). When you read often, those little changes add up. The compound effect of those changes is HUGE! Just think about it, if you make a small positive change to your behavior or actions, whatever they are, every day, what will happen in a year (365 days)... You will be a different person!\r\nThis is a recurring theme in many books, articles and posts about good habits, success and all other positive life goals. One good example is a book, [“Atomic Habits” by James Clear.](https://amzn.to/2Z1DWHO){:target=\"_blank\"} \r\n\r\nSo, if you ever think that there is no point in reading books, just because you don’t remember every word of it, that’s not true. The point of reading is to improve, to become smarter and make better decisions. This can be any non-fiction (and sometimes fiction). For example, if you ever decide to read an autobiography of a great person (let’s say Benjamin Franklin), it doesn’t matter that you don’t remember the whole story of his life or each of his habits, it really doesn’t. No one can remember everything (only [Joshua Foer](https://joshuafoer.com/){:target=\"_blank\"} can, he can remember everything). What matters is that while you read you pick up those little things that automatically get infused into your life and ultimately make you a better person.\r\n\r\nRead. Improve. Make your life better.\r\n\r\nP.S. This can count as a silly reason for reading books, but I don't care. Reading is fun. When you acquire the habit of reading, you do actually start to enjoy it.\r\n\r\nCheck out my [post](https://rasulkireev.com/writings/how-to-read-books-for-free) on how to get books for free, that might make it easier to acquire the habit.",
        "word_count": 451,
        "day_of_the_week": "Wednesday"
    },
    {
        "title": "Naruto's Influence on my Life",
        "date": "2019-07-17T20:00:00-04:00",
        "category": "Personal",
        "description": "",
        "body": "Iruka taught me not to judge people by their reputations, but their personalities.\r\n\r\nHaku taught me that there is no good or evil when you're protecting the ones you love.\r\n\r\nNeji taught me that if you leave your pride behind, you can always change your destiny.\r\n\r\nRock Lee taught me that hard work beats talent.\r\n\r\nKakashi taught me that teamwork and friendship stand above the rules.\r\n\r\nHinata taught me that love is worth fighting for.\r\n\r\nSai taught me that a life without feelings isn't worthwhile.\r\n\r\nSakura taught me that weakness is a choice.\r\n\r\nGaara taught me how painful loneliness can be and how love can change someone.\r\n\r\nNagato taught me that revenge and hatred can lead to more revenge and hatred.\r\n\r\nAsuma taught me how important it is to take care of the next generation.\r\n\r\nShikamaru taught me that sometimes you even have to do the things that bother you.\r\n\r\nMaito Dai taught me that it doesn't really matter what people think about you.\r\n\r\nKushina and Minato taught me that a parent's love never ends.\r\n\r\nMaito Guy taught me that no matter what , you always have to believe in yourself.\r\n\r\nSarutobi taught me that problems should be solved with kindness rather than violence.\r\n\r\nSasuke taught me that you shouldn't only dream about things but actually achieve them.\r\n\r\nItachi taught me that sometimes you have to make sacrifices for the greater good.\r\n\r\nJiraiya taught me that you must never give up your faith in humanity and your hope of peace.\r\n\r\nTsunade taught me to never abandon the living for the dead.\r\n\r\nObito taught me that it is never too late to revert the right way.\r\n\r\nMadara taught me that peace is no peace with freedom.\r\n\r\nAnd Naruto taught me to NEVER GIVE UP!",
        "word_count": 293,
        "day_of_the_week": "Thursday"
    },
    {
        "title": "Fear and Blogging",
        "date": "2019-08-06T09:00:30-04:00",
        "category": "Personal",
        "description": "",
        "body": "Fear. I hate it so much! I think I have spent a better part of my life in a constant fear of something. When I was a kid a fear was something more real, like being screamed at by parents or spiders, something that is entirely possible. As an adult, I am scared of such stupid things that I am now embarrassed to talk about them, but here I am.\r\n\r\nI am currently in the process of becoming. I have recently graduated, decided to switch career path and am still unsure where will life lead me. I am still trying to find things I enjoy doing the most. The biggest issue for me now is how much I earn, I do not think it is enough to support 2 people. My point here is that I am still very early in my journey of life and the world is an exciting place to be right now. There are so many opportunities, so many things and places to see and experience, but I spend a large amount of time worrying (I have a feeling that I am not alone in this).\r\n\r\nI want to give a quick example that has been on my mind for a while. Since I have started my internship as an Actuary I decided to switch careers, since I am not doing a good job of passing the exams. During the last months of my undergraduate degree I have been trying to find a good job and I failed miserably! I realized that sending resumes online is not enough, which is why I have spent the last couple of months, making my own website, updating the resume, cold messaging people on LinkedIn and learning a wide variety of topics, all to increase the chance of success. The thing I have not been doing is the most important one.\r\n\r\nI need to showcase my work and tell people about it. The best way to do this is by writing about it. In essence, I am talking about blogging. I know I have to make something and talk about it to show potential employers that I am knowledgeable and can be trusted with the work. I knew this for a while, but fear stopped me from blogging, it stopped me from writing. Coming back to stupid fears, one of the biggest ones for me is to be laughed at by people reading this. I have been also putting this writing thing aside, because I wanted to write about different topics and was worried people will be confused about the variety of topics and will just laugh at me (I guess being laughed at is one of my biggest fears, especially if the thing that I am laughed at is something I am passionate about or tried really hard to do). I want to write about different things, I want to tell people what I am up too. I want to seem knowledgeable and trustworthy. Fear is stopping me from achieving this (as well as [Resistance](https://amzn.to/2yIpCJu), which is a whole different topic).\r\n\r\nThis is my attempt to break the chain of fear and star the journey of a fearful man, who will do as his heart desire, without worrying about other people and their desire to laugh at me. Only by doing things will I learn to do them better. I expect this to be considered poorly written, which is fine, I promise to continue on this journey and improve. These are just my thoughts, they might be poorly structured or all over the place, but it is how I currently think and currently write (honestly, I am not entirely sure, all of this makes any sense).\r\n\r\nIf you have any thoughts or comments about this, please contact me via one of the social network on left. I would love to hear some feedback, negative and positive, as long as it is constructive",
        "word_count": 653,
        "day_of_the_week": "Tuesday"
    },
    {
        "title": "My Own Personal Space",
        "date": "2019-08-06T09:24:13-04:00",
        "category": "Personal",
        "description": "",
        "body": "That is so cool! I just published a short post about [Fear and Blogging](https://www.rasulkireev.com/writings/fear-and-blogging){:target=\"_blank\"} and checked it out straight away. It feels unreal. I just posted something for the entire world to look at. The best thing is that it is my personal space, I can write anything I want and no one will be able to tell me to take it down, no matter what.\r\n\r\nI can write here anything I want. I can write and structure it anyway I want. I won't lie to you, this feels amazing! Try it. Use [Blogger](https://www.blogger.com){:target=\"_blank\"}, [Wordpress](https://wordpress.com/){:target=\"_blank\"}, [Medium](https://medium.com/){:target=\"_blank\"} or something else you already now or is easy to use. Once you feel more confident with what you write, make your own website with [Django](https://www.djangoproject.com/) or [Jekyll](https://jekyllrb.com/){:target=\"_blank\"} to fully claim your personal space on the World Wide Web! </p><p>I am still only in the beginning of all this and decided to begin with a website, because I was scared to publish my thoughts, but here I am, happy to get started. Hope you will too!",
        "word_count": 172,
        "day_of_the_week": "Tuesday"
    },
    {
        "title": "Open Source",
        "date": "2019-08-16T14:42:04-04:00",
        "category": "Personal",
        "description": "",
        "body": "I have discovered the Open Source community very recently and I am in love with, not as much as I am in love with my wife though!\r\n\r\nI have recently started learning Web Development, the biggest discovery for me was the open-source community, where people share their ideas, thoughts, experiences and projects. It is beautiful. Thanks to a github repository called [Awesome Self-Hosted](https://github.com/Kickball/awesome-selfhosted){:target=\"_blank\"} I got to learn the basics of back-end development (PHP and Django), front-end development (HTML, CSS and JS), linux command line (I am no longer scared of the \"Terminal\"), web server maintenance (NGINX & Gunicorn), VCS (Git) and many other wonderful things. \r\n\r\nThanks to Open Source I now self-host a [Monica](https://www.monicahq.com){:target=\"_blank\"} Personal CRM database, that helps me track people I meet. Actually, before I installed it, I didn't meet many people. Now, I try to meet someone new at least once every week. I know this is going to be a deal breaker later in life.\r\n\r\nI am now learning a lot of new and exciting skills, and can't wait to contribute to the Open Source community. I'll be honest, I am a little scared that I will not be of any help at all, but I slowly startig to gain confidence and will absolutely do my best to help people with products of my own and contributing to someone else's projects.\r\n\r\nThanks to all the cool people out there!",
        "word_count": 233,
        "day_of_the_week": "Friday"
    },
    {
        "title": "Making your First Open Source Contribution",
        "date": "2019-08-19T12:40:38-04:00",
        "category": "Open Source",
        "description": "",
        "body": "I have been working with Git and GitHub for a while now, mostly to push (a.k.a \"upload\") my projects to my repository, then pull (a.k.a \"download\") on the Virtual Private Server. Basically I am using GitHub like Dropbox or Google Drive. I am ashamed to say that I have not done any contribution to the open-source projects, mainly because I am scared of screwing the project up (even though I know that the Git Workflow makes it impossible to do). Additionally, learning new terminology like \"Fork\" and \"Checkout\".\r\n\r\n**All of that changed today and if you have been fillind similar fears will change for you too.**\r\n\r\nAll you need to do is to head out the [first-contribution repository](https://github.com/firstcontributions/first-contributions){:target=\"_blank\"} on GitHub and follow the direction. This will be sufficient enough. For the sake of learning the material further and additionally learning to explain myself clearly I will write a short instruction here. You are welcome to follow it and if you have any comments please let me know at on of the Social Networks under the site title. Thanks, enjoy!\r\n\r\n1. Go to the [first-contribution repository](https://github.com/firstcontributions/first-contributions){:target=\"_blank\"} on GitHub.\r\n\r\n2. Fork the Github by pressing the \"Fork\" button on the top right corner.\r\nThis will copy over the repository to your account. That way you can make any changes you want. \r\n_Apologies for the lack of images. I have yet to resolve the issue with image uploads on Markdown editor for Django._\r\n\r\n3. Head over to the repository on you account and press the `Clone or Download` button (It is loacted in the top rights and is filled in with Green).\r\nYou will be provided with the link to clone the repository to your computer. Copy that link.\r\n\r\n4. Go to the \"Terminal\" (on Mac) or the Promt Shell (on Windows, search for \"cmd\" and press enter), navigate to the folder you want to keep your GitHub repositories, by using `cd` command. I suggest making a GitHub folder by runnning `mkdir GitHub` command on the Mac machine and `md GitHub` on Windows.\r\n\r\n5. Run `git clone <link you copied earlier>`.\r\nIf you do not yet have git installed on your machine, head over to the [Git Install tutorial page](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git){:target=\"_blank\"} and then to the [GitHub setup page](https://help.github.com/en/articles/setting-your-username-in-git){:target=\"_blank\"}.\r\nThis will download the repository to your computer. There is one more thing you need to do before you can change the contents.\r\n\r\n6. Navigate to the downloaded folder with `cd first-contributions` and create a new branch with `git checkout -b <add-your-new-branch-name>`\r\nBranch will spearate your corrections fomr the original repository, which you can later submit. The owner of the original repository will decide if your additions should be \"pulled\". \r\n\r\n7. Add your name to the \"Contributors.MD\" in text-editor of your choosing. [Atom](https://atom.io/){:target=\"_blank\"} for me.\r\n\r\n8. Commit the changes you made with the following commands:\r\n```\r\ngit add contributors.md\r\ngit commit -m \"{write your message}\"\r\ngit push origin <add-your-new-branch-name>\r\n```\r\n\r\n9. Head over to your account on github to the \"first-contributions\" repository. Click on the `Compare & pull request` button. Then press on `Create Pull Request`.\r\n\r\n**Congratulations, you just submitted your first contribution to an open-source project.**\r\n\r\nIf you run into any issues or have any questions please do not hesitate to contact me at any of the Social Links located under the website title.\r\nAlso, if you have any suggestions for the website layout/design, please let me know. I'm always happy to hear any suggestions.",
        "word_count": 570,
        "day_of_the_week": "Monday"
    },
    {
        "title": "Analyzing FIFA 19 data. (Part 1: Data Cleaning with Pandas and Numpy)",
        "date": "2019-08-19T17:06:31-04:00",
        "category": "Data Analysis",
        "description": "",
        "body": "You can find all the code to this project [here](https://github.com/rasulkireev/fifa19-data-analysis){:target=\"_blank\"}. You can review the code in this post in [1.0-preparing-data-for-ml.ipynb](https://github.com/rasulkireev/fifa19-data-analysis/blob/master/1.0-preparing-data-for-ml.ipynb){:target=\"_blank\"}.\r\n\r\nData comes from [Kaggle FIFA19 Dataset](https://www.kaggle.com/karangadiya/fifa19). Thanks to [Karan Gadiya](https://www.kaggle.com/karangadiya){:target=\"_blank\"}.\r\n\r\nAll the exploratory analysis is done with [Jupyter Notebook](https://jupyter.org/){:target=\"_blank\"}.\r\n\r\n## Goal\r\nMy goal with this project is to learn/improve essential data science/analysis skills as well as gain a better understanding of FIFA rating and ranking rules. I am using this dataset as a proxy to the real world data to see if it would make sense to spend considerable amount of time and effort to acquire real world data.\r\n\r\nThe first thing we need to do with a big and messy table of players' data is to \"clean\" and make it usable for further analysis.\r\n\r\n\r\n## Cleaning\r\nLet's start with package import, basic settings and actual data import, that's pretty standard.\r\n```python\r\nimport pandas as pd\r\nimport numpy as np\r\n\r\n# Display all floats with 2 decimals\r\npd.options.display.float_format = '{:.2f}'.format\r\n\r\ndf = pd.read_csv('data.csv', index_col=0)\r\n```\r\nThe reason I added `index_col=0` is because the dataset already had an index column, no need to create another one.\r\n\r\n### Exploring\r\nRun `df.sample(5)` to view 5 random rows from the dataset to get the feel for how it look and what might be wrong with it. Additionally, we want to run `df.info()` to see what types of data we are working with as well as counts, which are useful for spotting any columns with missing values.\r\n\r\n#### Positions\r\nI see that there are Postitions that are not necesssary for my application. For example, I don't need LS ('Left Striker'), since it is almost the same as ST (\"Striker\"). Grouping players in similar Positions will increase number of dat points, which hypothetically should make the results more [confident](https://towardsdatascience.com/a-very-friendly-introduction-to-confidence-intervals-9add126e714){:target=\"_blank\"}. \r\nRun `df.Position.unique()`to see all positions.\r\n\r\n```python\r\ndf['Position'] = df['Position'].map({'GK': 'GK', 'CAM': 'CAM','CB': 'CB', 'CDM': 'CDM',\r\n                                      'CM': 'CM','LB': 'LB','LM': 'LM','LW': 'LW',\r\n                                      'RB': 'RB','RM': 'RM','RW': 'RW','ST': 'ST',\r\n                                      'CF': 'ST','LAM': 'CAM','LCB': 'CB','LCM': 'CM',\r\n                                      'LDM': 'CDM','LF': 'LW','LS': 'ST', 'LWB': 'LB',\r\n                                      'RAM': 'CAM', 'RCB': 'CB','RCM': 'CM', 'RDM': 'CDM',\r\n                                      'RF': 'RW', 'RS': 'ST','RWB': 'RB'})\r\n                                      \r\n# Remove rows with Position = NaN\r\ndf.dropna(subset=['Position'], inplace=True)\r\n```\r\nCode above will map existing positions to the ones we want. (i.e. LF -> LW)\r\n_Note: we also need to map \"good\" positions._\r\n\r\n#### Value, Wage & Release Clause\r\n```python\r\n# Function that turn a string variable \"€100M\" to 100,000,000\r\ndef money_string_replace(variable_name):\r\n    df[variable_name] = (df[variable_name].str[1:].replace(r'[KM]+$', '', regex=True).astype(float) *\r\n                 df[variable_name].str.extract(r'[\\d\\.]+([KM]+)', expand=False)\r\n                 .fillna(1)\r\n                 .replace(['K','M'], [10**3, 10**6]).astype(int))\r\n\r\nmoney_string_replace('Value')\r\nmoney_string_replace('Wage')\r\nmoney_string_replace('Release Clause')\r\n```\r\n\r\n#### Preferred Foot\r\n\r\n```python\r\n# Creating a dummy variable to identify if a player is left footed or not\r\ndf.loc[df['Preferred Foot'] == \"Left\", 'Preferred Foot = Left'] = 1\r\ndf.loc[df['Preferred Foot'] == \"Right\", 'Preferred Foot = Left'] = 0\r\n```\r\n\r\n#### Work Rates\r\nCurrent work rates are in the format of \"High/Low\", where the first word refers to Attacking Work Rate and the second refers to Defensive Work Rate. I want to split the value into two values and create column for each attacking work rate and defensive work rate.\r\n\r\n```python\r\n# Splitting the work rate column into attacking and defensive rates.\r\ndf['Work Rates'] = df['Work Rate'].str.split('/')\r\n\r\n# Allocating each list item into the according work type\r\ndf['Attacking Rate'] = df['Work Rates'].str.get(0)\r\n\r\n# Removing any whitespace\r\ndf['Attacking Rate'] = df['Attacking Rate'].str.strip()\r\n\r\n# Creating a numeric variable for each work type\r\ndf.loc[df['Attacking Rate'] == \"Low\", 'Attacking Rate'] = 1\r\ndf.loc[df['Attacking Rate'] == \"Medium\", 'Attacking Rate'] = 2\r\ndf.loc[df['Attacking Rate'] == \"High\", 'Attacking Rate'] = 3\r\n\r\ndf['Defensive Rate'] = df['Work Rates'].str.get(1)\r\ndf['Defensive Rate'] = df['Defensive Rate'].str.strip()\r\ndf.loc[df['Defensive Rate'] == \"Low\", 'Defensive Rate'] = 1\r\ndf.loc[df['Defensive Rate'] == \"Medium\", 'Defensive Rate'] = 2\r\ndf.loc[df['Defensive Rate'] == \"High\", 'Defensive Rate'] = 3\r\n```\r\n\r\n#### Height and Weight\r\nKilograms and Centimeteres are a little more intuitive for me and slightly easier to use, so I am going to convert values. \r\n\r\n```python\r\n# Converting pounds to kg\r\ndf[\"Weight\"] = df[\"Weight\"].str[:3].astype(float) /2.205\r\n\r\n## Converting Feet and Inches string to a CM value\r\n# Splitting Feet from Inches\r\ndf['HeightCM'] = df['Height'].str.split(\"'\")\r\n\r\n# Further split of feet and inches\r\ndf['feet'] = df['HeightCM'].str.get(0).astype(float)\r\ndf['inch'] = df['HeightCM'].str.get(1).astype(float)\r\n\r\n# Replcaing Old string with new CM value\r\ndf['Height'] = (df['feet']*12+df['inch'])*2.54\r\n```\r\n\r\n#### Body Type\r\nThere are generally 3 body type: Lean, Normal and Stocky. There are exceptions, however. More specifically, several players have bosy type of their own, for example Messi, Cristiano Ronaldo and Akinfenwa. Those are outliers and I have decided to use my own judgement when assigning new values to them. Since ther was a row with Body Weight of an unknown type we will simply remove it from data, that shouldn't affect results.\r\n\r\n```python\r\ndf.loc[df['Body Type'] == \"Lean\", 'Body Type'] = 1\r\ndf.loc[df['Body Type'] == \"Normal\", 'Body Type'] = 2\r\ndf.loc[df['Body Type'] == \"Stocky\", 'Body Type'] = 3\r\ndf.loc[df['Body Type'] == \"Messi\", 'Body Type'] = 2\r\ndf.loc[df['Body Type'] == \"C. Ronaldo\", 'Body Type'] = 2\r\ndf.loc[df['Body Type'] == \"Neymar\", 'Body Type'] = 1\r\ndf.loc[df['Body Type'] == \"Courtois\", 'Body Type'] = 2\r\ndf.loc[df['Body Type'] == \"Shaqiri\", 'Body Type'] = 3\r\ndf.loc[df['Body Type'] == \"Akinfenwa\", 'Body Type'] = 3\r\n\r\ndf.loc[df['Body Type'] == \"PLAYER_BODY_TYPE_25\", 'Body Type'] = np.nan\r\ndf.dropna(subset=['Body Type'], inplace=True)\r\ndf['Body Type'].astype('int64')\r\n```\r\n\r\n#### Droping unnecessary columns\r\n\r\nNow for the final step, let's remove the unnecessary columns, anything non-integer, except for the position column which we will certainly need.\r\n\r\n```python\r\n# Dropping unneccesary columns\r\ndf.drop([\"Name\",\"Nationality\",'Club','Joined','Contract Valid Until','Release Clause',\r\n        \"Photo\",\"Flag\",\"Club Logo\",\"Special\",\"ID\",'Preferred Foot','Real Face',\r\n        'Jersey Number','Loaned From','LS','ST','RS','LW','LF','CF',\r\n        'RF','RW','LAM','CAM','RAM','LM', 'LB','LCB','CB','RCB',\r\n        'RB','LCM','CM','RCM','RM','LWB','LDM','CDM','RDM','RWB',\r\n        'Work Rate','Work Rates', 'HeightCM', 'feet', 'inch'],\r\n        axis=1, inplace=True)\r\n```\r\n\r\n## Export to CSV\r\n\r\nLet's make varibale names lower case so it is a little easier to work with in the future.\r\n```python\r\ndf.columns = map(str.lower, df.columns)\r\n```\r\n\r\nFinally, run the following code to export this dataset to csv. We are going to use it in the next part:\r\n```python\r\ndf.to_csv('data/processed/reduced_clean_data.csv')`\r\n```",
        "word_count": 957,
        "day_of_the_week": "Monday"
    },
    {
        "title": "Using custom virtual environment with Jupyter Notebook",
        "date": "2019-08-26T13:02:46-04:00",
        "category": "Jupyter",
        "description": "",
        "body": "I decided to try replacing the [Anaconda distribution](https://www.anaconda.com/distribution/){:target=\"_blank\"} with a custom virtual environemnt, just for the purposes of learning, keeping the environemnts more lightweight and removing the unnecessary libraries.\r\n\r\n## That is how I started:\r\n\r\n```python\r\n# Create a directory where Virtual Environments will reside\r\nmkdir venvs\r\ncd venvs\r\n\r\n# Create a virtual environent\r\n# DS stands for Data Science\r\npython3 -m venv DS\r\n\r\n# Activate in Mac (& Linux)\r\nsource DS/bin/activate\r\n\r\n# Activate in Windows \r\n.\\DS\\Scripts\\actvate.bat\r\n```\r\n\r\nNow our virtual environment is active and we can install any libraries that we want to. One of the libraries is [**jupyterlab**](https://jupyterlab.readthedocs.io/en/stable/){:target=\"_blank\"}. Actually, I always install it outside any virtaul environment (globally).\r\n\r\nFor the display purposes let's install a couple of libraries\r\n```python\r\npip install jupyterlab numpy pandas scikit-learn plotly\r\n```\r\n\r\nAfter the installation is complete lets fire up the jupyterlab from the desktop directory\r\n```\r\n# To go back to the home direcotry\r\ncd \r\n\r\n#Now to the Desktop\r\ncd Desktop\r\n\r\njupyter lab\r\n```\r\n\r\nHopefully the Jupyterlab is launched and ready go. Let's create a new notebook by pressing `Python 3` button under `Notebook` section. \r\n\r\nOnce that is done, let's import a couple of packages in the first cell.\r\n```python\r\nimport pandas as pd\r\nimport numpy as np\r\n```\r\n ![Import Error. Oops!](https://i.imgur.com/a0PBMyp.png)\r\n\r\nAlright, jupyterlab is not seeing the pandas library, probably because it is not working with the environment. Let's exit the JupyterLab in Terminal by pressing Cmd+C (Ctrl+C). \r\n\r\nNow we need to install a package that will help us deal with the error we got earlier.\r\n```\r\npip install ipykernel\r\n\r\n#replace project name with the name of your virtual environment\r\nipython kernel install --user --name=projectname\r\n```\r\n\r\n ![Import is successful!](https://i.imgur.com/2tSJzjM.png)\r\nNice!\r\n\r\nNow you can use Jupyter Lab with a specific environment of your choosing.\r\n\r\nIf you have any questions, do not hesitate to [email me](mailto:kireevr1996@gmail.com){:target=\"_blank\"} about it.",
        "word_count": 305,
        "day_of_the_week": "Monday"
    },
    {
        "title": "First \"real\" experience with JavaScript",
        "date": "2019-08-28T13:27:40-04:00",
        "category": "JavaScript",
        "description": "",
        "body": "I have been reading a [JavaScript book](https://amzn.to/2KPIsoQ){:target=\"_blank\"} for a couple of months now... I didn't learn much, unfortunately. I know this is becasue all reading need to be supplemented with some sorts of exercise, preferrably real world projects. Luckily, I have an idea for a project that will require some JavaSript.\r\n\r\nSo, instead of reading a book, I will start by formulating an idea and Googling it (or rather StackOverflowing it). In this post I will go over my first (baby) steps in JavaScript.\r\n\r\nAs far as I understand you can either write some JavaScrip (JS) directly in the html code, like so (the example is from [W3Schoools](https://www.w3schools.com/js/default.asp):\r\n```\r\n<h2>My First JavaScript</h2>\r\n\r\n<button type=\"button\"\r\nonclick=\"document.getElementById('demo').innerHTML = Date()\">\r\nClick me to display Date and Time.</button>\r\n\r\n<p id=\"demo\"></p>\r\n```\r\nThis will display the current time, after you click the button.\r\n\r\nAnother way is to create a separate javascript file and reference it in the html code, like so:\r\n```\r\n<script type=\"text/javascript\" src=\"path-to-javascript-file.js\"></script>\r\n```\r\nUsually, links scripts are referenced in the end of the `<head>` tag.\r\n\r\nI am going to resort to the second option, since I feel like this is much cleaner and minimal.\r\n\r\nSo, what do I need? What is the first thing I am going to ateempt first?\r\n\r\n## Creating a form/input field with a press of a button\r\n\r\nAfter googling for a bit I found that the way to create new html using javascript is with the function `createElement`. So this is what I am going to write in my main.js:\r\n\r\n```javascript\r\nfunction inputJournal() {\r\n  var z = document.createElement(\"FORM\");\r\n  z.setAttribute(\"id\", \"myForm\");\r\n  document.getElementById(\"new-journal\").appendChild(z);\r\n\r\n  var x = document.createElement(\"INPUT\");\r\n  x.setAttribute(\"type\", \"text\");\r\n  x.setAttribute(\"value\", \"Hello World!\");\r\n  x.setAttribute(\"id\", \"new-journal-name\");\r\n  document.getElementById(\"myForm\").appendChild(x);\r\n\r\n  var y = document.createElement(\"A\");\r\n  y.setAttribute(\"id\", \"add-button\");\r\n  var t = document.createTextNode(\"Add\");\r\n  y.appendChild(t);\r\n  document.getElementById(\"myForm\").appendChild(y);\r\n}\r\n```\r\nLet's go over what happened here:\r\n\r\n* I called my function \"inputJournal\"\r\n* created a variable z, which is a `<form>` with `id=myForm`\r\n* attached the form tag to the existing div with `id=new-journal`\r\n* Repeated the process for the `<input>` field and `<a>` field\r\n* Attached those 2 to the previously created form using `document.getElementById(\"myForm\").appendChild(y);`\r\n\r\nIn my html file in the `<head>` section I will add:\r\n```\r\n<script type=\"text/javascript\" src=\"main.js\"></script>\r\n```\r\nAnd will create a \"button\" with an `onClick tag to load the javascript function noce the button pressed:\r\n\r\n```\r\n<p onclick=\"inputJournal(); this.onclick=null;\">Press Here!</p>\r\n\r\n<div id=\"new-journal\"></div>\r\n```\r\nI've also added `this.onclick=null` to make sure that the code is only run once, otherwise we will create a ton of forms by pressing the button multiple number of times.\r\n\r\nFinally, the `div` block is there, because we told the javascript code to `getElementId(\"new-journal\")` and everything that is vreated with our coe wil be contained within this `div`, so that we can style it with CSS.\r\n\r\nI think this covers it all. Everything is working for me. If you followed along, I hope it is working for you too.\r\n\r\nIf you have any questinos please let me know at any of the social lin ks on the top left.\r\n\r\nThanks for reading.",
        "word_count": 499,
        "day_of_the_week": "Wednesday"
    },
    {
        "title": "Setting up a virtual  environment (for Django Project)",
        "date": "2019-08-29T10:31:01-04:00",
        "category": "Django",
        "description": "",
        "body": "For this tutorial I will assume you have a little experience working with the command line tools like \"Terminal\". If you don't I promise to make a post or two about that, meanwhile you can check those two out:\r\n\r\n* [Mac](https://www.dummies.com/computers/macs/mac-operating-systems/how-to-use-basic-unix-commands-to-work-in-terminal-on-your-mac/){:target=\"_blank\"} \r\n* [Windows](https://www.cs.princeton.edu/courses/archive/spr05/cos126/cmd-prompt.html){:target=\"_blank\"}\r\n\r\n\r\n## Setting up the environment\r\n\r\n_The first steps is here for people who don't yet have a folder where they keep all their projects._\r\n\r\n### 1. In the Terminal or Command Prompt (cmd) create a directory (folder) where you will keep your projects and websites.\r\n```\r\nmkdir sites\r\ncd sites\r\n```\r\n`mkdir` will create a new directory and `cd` will move into into that directory. You can call your folder whatever you want.\r\n\r\n### 2. Creating a project folder\r\nOnce in the `sites` directory you will need run `mkdir` again to make a folder specifically for your project\r\n```\r\nmkdir {projectname}\r\ncd {projectname}\r\n```\r\n\r\n### 3. Setting up the environment\r\nBefore we initiate a django project we need to setup a python virtual environment. This will make sure that whatever machine we are working with (Mac vs. Windows, for example) the website will work by setting up the same packages and libraries. \r\n\r\n_Generally, having a virtual environment for each one of your projects, whether Web Dev, Data Science or General Programming, is now a standard. For one, this allows other people to help you with you projects and generally makes eveything easier in the future._\r\n\r\nFor this step you need to have Python installed. I am not going to go over the installation process and will assume you have a working version of Python 3.6 or above. To create a virtual environment python has a built-in package `venv`.\r\n```python\r\n# If you have multiple python versions on you computer\r\npython3 -m venv venv\r\n\r\n# If you have python 3.6+ installed only\r\npython -m venv venv\r\n```\r\nHere the first `venv` refers to the program we are running. The second `venv` is referring to the name I gave my virtual environment. So, instead of a second `venv` you can type in whatever you want. I find the word venv pretty easy to rememeber and to type up, so that's how I usually call my virtual environments.\r\n\r\nLet the prgoram run. Congrats you now have created a virtual environment! You can check that everything worked by checking the contents of the folder. You can do that by navigating in `Finder` or `Windows Explorer` or even better just by typing `ls` to the command prompt, this will list out all the directories in your project folder.\r\n\r\nAll there is left to do is to activate the environment to start the working process.\r\n\r\nOn Mac to activate and deactivate the virtual environment you would use the following command:\r\n```\r\n# to activate\r\nsource venv/bin/activate\r\n\r\n# to deactivate\r\ndeactivate\r\n```\r\n\r\nOn Windows:\r\n```\r\n# to activate\r\n.\\venv\\scripts\\activate.bat\r\n\r\n# to deactivate\r\ndeactivate\r\n```\r\n\r\nWhen your virtual environemnt is active you will see the name of the virtual environment within bracket to the left of the command line. Like so:\r\n ![](https://i.imgur.com/mN0w7WA.png)\r\n\r\n### 4. Create a Django project\r\nFinally, we can create the project. Once you make sure your venv is activated, all you have to do is:\r\n```python\r\n# to install django within your virtual environment \r\npip install django\r\n\r\n# to actually create a project\r\ndjango-admin startproject {name of your peroject} . \r\n```\r\nNote the **dot** in the end of the command. You actually need to add it too. This will make sure that the project is created within the directory you have already created.\r\n\r\nOne last step:\r\n```python\r\npython manage.py runserver\r\n```\r\nThis will start server with your Django project, If you go to [http://127.0.0.1:8000](http://127.0.0.1:8000) in your browser, you will see a welcome to Django screen.\r\n\r\n\r\n**Congrats!** You can now develop your site with Django freely, which is a whole another topic of discussion. \r\n\r\nIf you have any questions please let me know at one of the social links on the top left.",
        "word_count": 660,
        "day_of_the_week": "Thursday"
    },
    {
        "title": "Analyzing FIFA 19 data. (Part 2: Data Exploration and Visualization)",
        "date": "2019-09-26T14:39:09-04:00",
        "category": "Data Analysis",
        "description": "",
        "body": "You can find all the code to this project [here](https://github.com/rasulkireev/fifa19-data-analysis){:target=\"_blank\"}. You can review the code in this post in [2.0-plotting-and-exploration.ipynb](https://github.com/rasulkireev/fifa19-data-analysis/blob/master/2.0-plotting-and-exploration.ipynb){:target=\"_blank\"}.\r\n\r\nIn this post I will go through the process of data exploration. In [part 1](https://rasulkireev.com/writings/analyzing-fifa-19-data-part-1-data-cleaning){:target=\"_blank\"} we already did some \"exploration and are now much more familiar with the dataset. In this part I will mostly focus on visualizations. To be more specific, I will focus on visalizing our data set with a python library - [\"Plotly\"](https://plot.ly/python/){:target=\"_blank\"}. \r\n\r\nBefore we continue I just wanted to quickly explain why I will be using Plotly, instead of matplotlib or seaborn. \r\n\r\n1. Plotly graphs and charts look really good, even without a lot of customization. \r\n2. There are some useful features taht will allow me to explore the dataset (for example, I can zoom in on the chart interactively). \r\n3. We can later make a ['Dash'](https://plot.ly/dash/){:taget\"\\_blank\"} dashboard, which uses plotly for all its graphs.\r\n\r\n\r\n## Installation\r\nIf you are using anaconda, you have it pre installed. If you are using your own virtual environment then install simply with \r\n\r\n```python\r\npip install plotly\r\n```\r\n\r\nI strongly suggest you use [jupyter notebook](https://jupyter.org/){:target=\"_blank\"} for all the analysis and exploration. Again if you are using Anaconda environemnt, you have it pre-installed and simply need to launch jupyter notebooks from the Anaconda Navigator, which is a programm you can run on your computer. If you decided not to use Anaconda than you can easily install jupyter notebooks simply following the official [installation guide](https://jupyter.org/install){:target=\"_blank\"}. \r\n\r\nPlotly should be working fine with Jupyter Notebooks, right out of the box, but if you are running into some errors, try installing ipywidgets using pip, and generaly going throught the plotly jupiter lab [integration guide](https://plot.ly/python/getting-started/){:target=\"_blank\"}. \r\n\r\n## Importing packages\r\n\r\nSince we are not working with matplotlib or seaborn, we only need to import a couple packages:\r\n\r\n``` python\r\nimport pandas as pd\r\nimport plotly.graph_objects as go\r\nimport plotly.express as px\r\n```\r\n\r\n* we need pandas beacuse we are wroking with a dataframe\r\n* plotly.express is good for quick plots that don't require any customization\r\n* plotly.graph_objects allow for full customization\r\n\r\nFinally, before we begin let's import the dataset we made in the previous post. Please make sure you are wokring in the same directory as you csv file.\r\n```python\r\ncombined_columns_data = pd.read_csv('reduced_clean_data.csv', index_col=0)\r\n```\r\n\r\n## Correlations using `scatter matrix`\r\n### Basic Player Info (Height, Weight, Overall, Value, Wage)\r\n\r\nOne of the first things we want to look at is something called a scatter matrix. This chart will allow us to compare a bunch of variables (columns) to each other to see if there are any interesting relationships going on in our data. With plotly express it is pretty simple to do. \r\n\r\n``` python\r\nfig = px.scatter_matrix(combined_columns_data,\r\n                        dimensions=['height','weight','age','value','overall','wage'],\r\n                        color=\"position\")\r\nfig.show()\r\n```\r\nAs you can see in the code above, we called plotly express graph called `scatter_matrix`, told it what data we want to use (`combined_columns_data` dataframe), specified which variables we are interested in and I also decided to add a color distinction for each positionm so that we could see if there are any clusters.\r\n\r\nHere is the output:\r\n ![Plotly Scatter Matrix - Comparing Player Statistics](https://i.imgur.com/mImRDCc.png)\r\n \r\n Nice. Now let's see if there is anything interesting to note.\r\n \r\n Here are my observtions (if you see something I missed, please [let me know](mailto:kkireevr1996@gmail.com)):\r\n \r\n 1. _(column 2, row 3)_ The value of the player is roughly the same when the Overall Rating is between 0-80. Once the rating passes the 80 mark, the value starts to climb up quickly.\r\n 2. _(column 2, row 4)_ Same thing happens to wage.\r\n 3. _(columns 5 & 6, row 4)_ These resemble normal distribution plots. This makes sense, since height and weight tend to be normally distributed across any population. what is interesting is that Most valuable or highly paid players tend to be closer to the mean.\r\n 4. Finally, as we can expect there is a correlation betweem height and weight. The tallker the playeer, the more he  weighs.\r\n \r\nLet's continue.\r\n\r\n### Detailed PLayer Statistics - (Speed, Passing, Physical, Control, Defending, Skill, Shooting)\r\nNow let's look at the variables we prepared in the previous part. I want to see id there is any correlation between skills. \r\n\r\nCurrently I expect that there is in fact strong correlation between most skills like, control, shooting, passing, generally because better player will have all detailed stats higher than p[layers that are worse overall. However, specific skills like Defending and Goalkeeping will not be correlated with the rest, since they are very specific. For example, any Goalkeeper will have much higher \"Goalkeeping\" rating than any other position, conversly he will have much lower Speed or Control compared to other positions.  \r\n\r\nAs in the previous example we first create a graph using the express tool. Then we ask to display it with `.show()`:\r\n```python\r\nfig_two = px.scatter_matrix(combined_columns_data,\r\n                        dimensions=['speed','passing','physical','control','defending','skill', 'shooting'],\r\n                        color=\"position\")\r\nfig_two.show()\r\n```\r\nHere is the result:\r\n![Plotly Scatter Matrix - Comparing Player Stats](https://i.imgur.com/sS7YZEq.png)\r\n\r\nAs expected, Goalkeepers (the purple color) are a separate group in all GK graphs. Additionally, LB, RB, and CB all form a cluster on the \"Defending\" graphs. \r\n\r\nThese detailed variables will be useful to differentiate between the group pf people whos overall is around 70 (mean), which is the most dense area.\r\n\r\n\r\n## Visualizing key metrics\r\n\r\nThe main features of our data is the value and skill. Let's see how one affects the other a little closer.\r\n\r\nAgain, plotly let's us do that pretty simply:\r\n```python\r\nfig = px.scatter(combined_columns_data, y=\"value\", x=\"overall\", color=\"age\")\r\nfig.show()\r\n```\r\n\r\n![Player Value vs Overall Skills](https://i.imgur.com/jMuKG3N.png)\r\nInterestingly, the relationship is exponential and we will probably have to use a polynomial model in the Machine Learning part of the project.\r\n\r\n> Note:\r\nI should have separated the dataset into test set and training set before starting the exploration. You should too. We will see how to split your data in the next part. \r\n\r\nIn the chart above we are displaying 3 metrics: Player Value, Overall Skill Level and Age (color). This is great, we can see that the bottom corner is more of a yellow color which tells us that player of the same level but different skill level have different value, with older being less value, which makes sense. We can try to add another metric: size, by adding a `size` method.\r\n\r\n```python\r\nfig = px.scatter(combined_columns_data, y=\"value\", x=\"overall\", color=\"age\", size=\"skill moves\")\r\nfig.show()\r\n```\r\n\r\nThis does not add any value to the graph as it becomes overloaded with information. Keeping charts simple and easy to read is very important.\r\n\r\n\r\n## Bonus: Working with separate \"Positions\"\r\n\r\nNow that we looked at the dataset from a high level, let's take a closer look. My experience with FIFA tells me that each position has its own strengths and weaknesses when it comes to skills, which is why I decided to break down our data into chunks for each position (GK, CB, ST, etc.). \r\n\r\nOne way to do that would be to import all the different csv files we made and make a dataframe for each of them. This is too much writing and too costly for the computer, memore-wise. Instead I will make a function that will create a dataframe on the fly, depending on the position we want. \r\n\r\nHere are the steps I have in mind:\r\n1. Create a list of unique names.\r\n2. Create a DataFrame dictionary to store key:value pair of future dataframes, i.e. {\"GK\":pd.Dataframe})\r\n3. Iterate over the keys in the dictionary to create dataframes with a name DataFrameDict[key], i.e. DataFrameDict[\"GK\"]\r\n\r\n```python\r\n#create unique list of names\r\nUniqueNames = combined_columns_data.position.unique()\r\n\r\n#create a data frame dictionary to store your data frames\r\nDataFrameDict = {elem : pd.DataFrame for elem in UniqueNames}\r\n\r\nfor key in DataFrameDict.keys():\r\n    DataFrameDict[key] = combined_columns_data[:][combined_columns_data.position == key]\r\n```\r\n\r\nWith this in place you can perform all of the above visualizations, but only for a position you want. For example, instead of doing\r\n```python\r\nfig = px.scatter(combined_columns_data, y=\"value\", x=\"overall\", color=\"age\")\r\nfig.show()\r\n```\r\n\r\nyou will now do\r\n```python\r\nfig = px.scatter(DataFrameDict[\"GK\"], y=\"value\", x=\"overall\", color=\"age\")\r\nfig.show()\r\n```\r\n\r\nThis will output a graph with only Goalkeepers as data points.\r\n\r\n## Conclusion\r\nIn this post we explored the data exploration with Plotly. Plotly is great and powerful tool making some of visualizations very quick and easy.\r\n\r\nLet me be clear, I do not discard other tools like Matplotlib, the father/mother of all visualizations in Python, Bokeh and others. They do have some advantageous and disadvantageous. Plotly takes care of a lot of functionality for you which might be useful for you data exploration project. \r\n\r\nWe only looked at plotly express package, which is extremely easy to use, but doesn't offer much customization. If you do require some more formatting [plotly go](https://plot.ly/python/){:target=\"_blank\"} should be used.\r\n\r\nIn the next post we will look into Scikit-learn and will build a model to predict the value of the player.\r\n\r\nIf you have any questions or comments, please email me at [me@rasulkireev.com](mailto:me@rasulkireev.com){:target=\"_blank\"}.",
        "word_count": 1469,
        "day_of_the_week": "Thursday"
    },
    {
        "title": "PyGotham 2019: Day 1",
        "date": "2019-10-05T14:30:17-04:00",
        "category": "Conferences",
        "description": "",
        "body": "This is a first conference I have ever attended. If I had to describe it in one word, it would be 'great'. Here is why:\r\n\r\n* I've met a lot of people with similar interest personality types, which is hard to do in regular setting.\r\n* I've made a number of \"useful\" contacts that might help me find a good job. \r\n* I've seen a lot of interesting presentations that have sparked my interest in programming (in Python) even more.\r\n\r\nDuring the event I took notes with [Joplin](https://joplinapp.org/){:target=\"_blank\"} , which is a great open-source note-taking app. I strongly recommended to everyone. **Not a sponsor**.\r\n\r\nThe general structure of the notes you are about to read is the same:\r\n\r\n# Name of the talk\r\n## Author\r\n* Notes are going to be bullet points.\r\n`If i have any notes above the bullet point above, I will leave them in this grey {code} block`\r\n* I will try to leave find as links as possible, so you don't have to google everything.\r\n\r\n\r\nSo, without further ado, here are the notes I've taken during the first day of the event. \r\n***\r\n\r\n# Python use spectrum\r\n## Kojo Idrissa\r\n* More speakers always needed.\r\n`This makes me want to make a talk to present at one of the conferences, seems totally doable and great for portfolio.`\r\n* Volunteers always needed\r\n`Certainly feel I should have been volunteering at this event. Will try to consider volunteering much more often`\r\n* [Defna.org](http://Defna.org){:target=\"_blank\"} - Django organization \r\n\r\n***\r\n# Eita! Why internalization and localization matter\r\n## Nicolle Cysneiros [@Labcodes](https://labcodes.com.br/){:target=\"_blank\"} - (Web Design Agency whos tech stack is python, django and js)\r\n### Differences in formats across countries\r\n* Date Formats (mm/dd/yyy vs. dd/mm/yyyy, etc)\r\n* Number Formats (123,123 vs 123.123)\r\n* Currency, [Bidirectional Text](https://en.wikipedia.org/wiki/Bidirectional_Text){:target=\"_blank\"}  & [Unicode Characters](https://www.rapidtables.com/code/text/unicode-characters.html){:target=\"_blank\"} differ from country to country.\r\n### Python library to deal with that\r\n* GNU [`gettext`](https://www.gnu.org/software/gettext/){:target=\"_blank\"} \r\n  * This piece of software essentially is helping you to create a 'list' of text blocks that will need to be translated.\r\n* [`locale`](https://docs.python.org/3.7/library/locale.html){:target=\"_blank\"} module.\r\n  * This module helps change the formats of the above mentioned differences.\r\n* Apparently Django makes it super easy.\r\n\r\n***\r\n# Can you keep a secret?\r\n## [Aaron Bassett](https://www.gitshowcase.com/aaronbassett){:target=\"_blank\"} @[Nexmo](https://www.nexmo.com/){:target=\"_blank\"}\r\n* [Git-Secret](https://git-secret.io/){:target=\"_blank\"}\r\n  * Uses [pgp](https://en.wikipedia.org/wiki/Pretty_Good_Privacy){:target=\"_blank\"} \r\n\r\n***\r\n# Absolutely Awesome Automated APIs\r\n## [Timothy Allen](https://www.linkedin.com/in/flipperpa/){:target=\"_blank\"} - @[WRDS](https://wrds-web.wharton.upenn.edu/wrds/index.cfm?){:target=\"_blank\"} (uses Django)\r\n### -@flipperpa -djangonaut -hockey_fan_flyers -guitarist -loves_icecream \r\n* WRDS developed and open sourced [Automagic-Rest](https://pypi.org/project/automagic-rest/){:target=\"_blank\"} \r\n* [Drf renderer xlsx](https://github.com/wharton/drf-renderer-xlsx){:target=\"_blank\"} - open source library to convert API endpoint to excel file\r\n\r\n***\r\n# Recreating \"The Clock\" with Machine Learning and Web Scraping\r\n## [Kirk Kaiser](https://www.linkedin.com/in/k-p-kaiser-94500124/){:target=\"_blank\"} @[datadog](https://www.datadoghq.com/product/){:target=\"_blank\"}  \r\n* [Tate modern - the clock](https://www.tate.org.uk/whats-on/tate-modern/exhibition/christian-marclay-clock){:target=\"_blank\"}\r\n* To start, simplify: try kubernetes locally - Ubuntu + Nvidia, [ngc.nvidia.com](ngc.nvidia.com){:target=\"_blank\"}\r\n* [Dab & t-pose controlling light](https://github.com/burningion/dab-and-tpose-controlled-lights){:target=\"_blank\"}\r\n* [Jetson nano gpu accelerated machine 99$](https://amzn.to/2oyUSsS){:target=\"_blank\"}\r\n* Datadog is hiring\r\n\r\n***\r\n# To comment or not? A data-driven look at attitudes toward code comments\r\n## [Veronica Hanus](https://www.linkedin.com/in/veronicahanus/){:target=\"_blank\"}\r\n* Funny, good presenter\r\n* The general consensus is that comments are good and you should leave them\r\n \r\n***\r\n# Learning with Limited Labeled Data\r\n## Shioulin Sam @cloudera\r\n* Very clear and great presenter \r\n* **Active learning** has been here for a while, but only now got integrated with ...\r\n![](:/52b94e63a3644bd5a9c48a46dc9d5a3f)\r\n* Random sample data points to label (good, but not optimal)\r\n* [Margin Sampling](https://link.springer.com/chapter/10.1007/978-3-662-45646-0_13){:target=\"_blank\"}\r\n* [activelearner.fastforwardlabs.com](activelearner.fastforwardlabs.com){:target=\"_blank\"} \r\n* [Twiml and Ai podcast](https://twimlai.com/){:target=\"_blank\"}\r\n\r\n***\r\n# Introduction to Generative Adversarial Networks (GANs): hands-on to making new data (and some pretty pictures)\r\n## [Nabeel Seedat](http://nabeelseedat.com/){:target=\"_blank\"}\r\n* [Dirpfakes](https://twitter.com/realderpfakes?lang=en){:target=\"_blank\"}\r\n* [Deep Convolutional GAN](https://medium.com/@jonathan_hui/gan-dcgan-deep-convolutional-generative-adversarial-networks-df855c438f){:target=\"_blank\"}\r\n* [Fashion Mnist](https://github.com/zalandoresearch/fashion-mnist){:target=\"_blank\"}\r\n* [Gan Zoo](https://github.com/hindupuravinash/the-gan-zoo){:target=\"_blank\"}\r\n\r\n***\r\n# What physics can teach us about learning\r\n## [Marianne Hoogeveen](https://www.linkedin.com/in/marianne-hoogeveen/){:target=\"_blank\"}\r\n* Neutral network can approximate any smooth function - [Universal approximation function](https://en.wikipedia.org/wiki/Universal_approximation_theorem){:target=\"_blank\"}\r\n* Scales matter when it comes to identifying patterns (neural networks) - [renormalization group](https://en.wikipedia.org/wiki/Renormalization_group){:target=\"_blank\"} i.e. compression \r\n\r\n***\r\n# Django + ElasticSearch without invalidation logic\r\n## [Flávio Juvenal](https://twitter.com/flaviojuvenal?lang=en){:target=\"_blank\"} @[vinta](https://www.vinta.com.br/){:target=\"_blank\"}\r\n* Most popular search engine\r\n* Why use search engine \r\n  * Tokenization\r\n  * Fuzzy similarity\r\n  * Cleaning\r\n* Elastic search built ins\r\n* Less than million rows of Data can be searched with postgres built-in capabilities (check Django postgres search ) if more than 1m than implement elastic search\r\n* [Haystack library](Haystack library){:target=\"_blank\"} for search in Django\r\n* [Zombodb](https://github.com/zombodb/zombodb){:target=\"_blank\"} works with postgres (via access method API) (Django-zombodb)\r\n  * will Soon work with postgres 11\r\n\r\n***\r\n# Static Typing in Python\r\n## [Dustin Ingram](https://dustingram.com/){:target=\"_blank\"} @Google @di_codes\r\n* type errors happen \r\n  * When Python expects a list received a string and converts that to a list , ugly list \r\n* Python originally is dynamically typed, but can also be static. Which is a great strength \r\n* Pep 3107 fucntions\r\n  * Def Foo() <- max(2,9)\r\n  * Foo.__annotations\r\n* [Mypy](http://www.mypy-lang.org/){:target=\"_blank\"} from PhD introduced on pycon us 2013\r\n  * Experimental variant of Python that is statically typed \r\n  * After talking to Guido decided to implement to pure Python \r\n* pep 483 theory of type hints\r\n  * Optional typing (+gradual typing)\r\n  * Variable annotation \r\n* Check data science from scratch again, it has some static type instructions\r\n* Pep 484 type hints\r\n* `Pip install mypy`\r\n* When not to use : never\r\n* When to use : as much as possible (Start early)\r\n  * When code is confusing \r\n  * When for public consumption\r\n  * Before big migrations and refactoring \r\n* Start early \r\n* Note : not a replacement for unit test\r\n\r\n***\r\n# Convincing an entire engineering org to use (and like) mypy\r\n## [Annie Cook](https://www.linkedin.com/in/annielcook/){:target=\"_blank\"} @[nylas](https://www.nylas.com/){:target=\"_blank\"} - hiring\r\n* [Mypy](http://www.mypy-lang.org/){:target=\"_blank\"} is a static typechecker , type of documention (self documenting )\r\n```python\r\n#pep 484type hints\r\nDef Foo(type: str)  -> str\r\n  Return \r\n```\r\n* With mypy linters work better \r\n* Captures a large category of errors\r\n* Union is a multiple type\r\n* _learn x in y minutes_ . Saw some guy in the talk use this website, seemed interesting \r\n\r\n\r\n***\r\n# ministry of silly talks \r\n\r\n## [in-toto](https://www.In-toto.io){:target=\"_blank\"} - securing the whole software supply chain \r\n### nyu , njit, Santiago Torres Aria's, Hammad Afzali, etc.\r\n* Not rely clear, probably hard to implement \r\n* Sounds scary where people can attack software, need to check if that actually happens\r\n\r\n\r\n## Test your failures with xfail\r\n### [Paul Ganssle](https://ganssle.io/){:target=\"_blank\"}\r\n* Decorate a test that you expect to fail with \r\n`@pytest.mark.xtest`\r\n\r\n## Experimental features in [Scikit-Learn](https://scikit-learn.org/){:target=\"_blank\"}\r\n### [Thomas J Fan](https://www.linkedin.com/in/thomasjpfan/){:target=\"_blank\"} - scikit learn core devoler \r\n* Deprecations?\r\n* Use columntrasformer to transformer some of the dataframe\r\n\r\n## Why your tech company from recruit from philosophy department \r\n### [Katherine Hartling](http://www.katbelle.com/){:target=\"_blank\"} - @KatOnceSaid\r\n* [Jackpocket.com](https://jackpocket.com/){:target=\"_blank\"}\r\n* [Plato's concept of classes](https://oregonstate.edu/instruct/phl201/modules/Philosophers/Plato/plato_on_women_in_the_ideal_state_part_I_the_context.html){:target=\"_blank\"} \r\n\r\n## Greed an homage\r\n### Julian, @[julian](https://github.com/Julian){:target=\"_blank\"} - GitHub, @[julianwastaken](https://twitter.com/julianwastaken?lang=en){:target=\"_blank\"} on Twitter\r\n* Algortim of change in supermarket, greedy algorithm \r\n* when does it work \r\n  * When you can take Independent choices within each step\r\n  * [Matroids](https://en.wikipedia.org/wiki/Matroid){:target=\"_blank\"}\r\n\r\n## Change just one thing \r\n### Timothy Allen , same guy as WRDS talk in API \r\n* Dealed with alcohol addiction problem! \r\n* Ask help, people are willing to help, especially the Python and Django communities \r\n\r\n\r\n## Structured logging in Python\r\n### [Jonathan Meier](https://jonathanmeier.io/){:target=\"_blank\"} software engineer @[openslate](https://www.openslate.com/){:target=\"_blank\"}\r\n* Structured logging is writing consistent logs that are easy for computers to read (JSON)\r\n* [Python-json-logger](https://github.com/madzak/python-json-logger){:target=\"_blank\"} or structlog \r\n\r\n## Restructuring Data in Python \r\n### Mahmoud Hashemi @ sedimental.org\r\n* Flat is good vs namespaces are good. Tim Peters - Pep20\r\n* Nested data is bad. Tim Peters\r\n* [Glom library](https://glom.readthedocs.io/en/latest/){:target=\"_blank\"} - Python data nester \r\n* Good presenter. \r\n\r\n## Ministry of silly runtime: Vintage Python on cloud run \r\n### Dustin Ingram @Google @di_codes\r\n* Run stateless http container \r\n* Docker images as a service \r\n* Installed old Python (1.0.1) on  cloud run \r\n* Good presenter",
        "word_count": 1258,
        "day_of_the_week": "Saturday"
    },
    {
        "title": "PyGotham 2019: Day 2",
        "date": "2019-10-15T16:17:36-04:00",
        "category": "Conferences",
        "description": "",
        "body": "Day 2 of the PyGotham conference was on Saturday. I expected there to be way more people, but surprisingly, the opposite has happened. Day 2 count was twice as small, or at least that is how it felt. Below are the note from Day 2.\r\n\r\nYou can see Day 1 notes [here](pygotham-2019-day-1){:target=\"_blank\"}\r\n\r\n_Please note: I took some pictures, but am not able to upload that as of this second. As soon as I can, I will update the post._\r\n\r\n***\r\n# 1000x faster data manipulation: vectorizing with Pandas and Numpy\r\n## Nathan Cheever @AdvancedMD Ds\r\n* For loop vs vectorization\r\n* Vectorization working with array or series without for loops, rather all at once.\r\n  * You are probably already doing that to some degree \r\n![](:/b23a07d5afaf400ba0fd737f5d3635d9)\r\n* To perform conditional vectorization do: **numpy.where()**\r\n* Numpy.vectorize()\r\n* Numpy.select() for multiple ifs / elifs\r\n* Pd.shift() to create anoer plumn with values shofted\r\n* talked about Dask \r\n![](:/03c78c4c72d2410580e3d76971dbe31b)\r\n* Kubernetes shirt\r\n\r\n***\r\n# Using Dash to Create Interactive Web Apps for Non Technical Audience\r\n## [Joseph Willi](https://www.linkedin.com/in/joseph-willi-38b7883b/){:target=\"_blank\"}, @[underwriters labarotory](https://www.ul.com/){:target=\"_blank\"} \r\n### AZV Dashboard (Arizona Vortex)\r\n* Great company, mission oriented \r\n* Their job is to fire staff and gather data \r\n* Somehow connected physical devices such that the plotly days gathers data from the device and inputs it to the dashboard \r\n\r\n***\r\n# Distributed Machine Learning with Python\r\n## [Brad Miro](http://https://www.linkedin.com/in/brad-miro/){:target=\"_blank\"} @google \r\n* Latest ml updates,: Gpu, Tensorflow unit \r\n* Kubeflow, marries Tensorflow and Kubernetes \r\n\r\n***\r\n# Pull Requests: Merging good practices into your project\r\n## [Luca Bezerra](mailto:lucabezerra@gmail.com){:target=\"_blank\"} - vinta \r\n* Code review , even if unwanted adds greatly to the project \r\n* Best practices:\r\n  * Pull request template.md on github\r\n  * Status checks prevent branches merging without checks \r\n  * Contributing .md for collaboration \r\n  * Enforce approval/merge rules : codeowners.nd \r\n  * Using **gitflow** makes sure your branches are always up to date \r\n    * Branches are cheap and great flexibility \r\n  * Keep pr size as small as possible \r\n  * More clear commit messages (talk about what and how ),\r\n  * Use linters when possible\r\n* Tips & tools \r\n  * Refined GitHub \r\n  * Deploy Previews (Netlify)\r\n* Check Vinta checklist \r\n\r\n***\r\n# Jane Doe will help you improve your project\r\n## Rebecca Sarai - Vinta \r\n* Netflix prizes - challenge \r\n* Talk is about anonimization \r\n* Psedonymization - is personal data , but you hide the data in a particular manner , includes \r\n  * Tokenization, etc.\r\n* Anonimization no data that considered personal and can be sued to identify a person \r\n  * Static \r\n  * Dynamic \r\n  * Synthetic \r\n\r\n***\r\n# The Cat's Alive! Add Some Weirdness To Your Code With Quantum Computing\r\n## Jorn Mossel, Marianne Hoogeveen\r\n* Classical computer works with 0 and 1 \r\n* Qubit can be a bit of both (circular form)\r\n\r\n***\r\n# Oh, the Humanities! Interdisciplinary Thinking in Python\r\n## [Lisa Tagliaferri](https://lisatagliaferri.org){:target=\"_blank\"} - wrote tutorials for Digital Ocean\r\n* Research on how women men are described in certain ages.\r\n* Text from Gutenberg projects were analyzed \r\n![](:/bf1b9b19636b4093b3cee8581abb9675)\r\n![](:/d49648d23fae4ef7bb43287f268300c2)\r\n* Very interesting \r\n* Text analysis might not be that scary after all. It never was , bit now it is certainly interesting enough to give it a try \r\n* Gender novels project \r\n* [Caterina.io](https://Caterina.io){:target=\"_blank\"} \r\n* [Hacktober fest](https://hacktoberfest.digitalocean.com/){:target=\"_blank\"} \r\n![](:/e4f283ac93024fd7905b719db3445646)\r\n![](:/2002af42ab4d4562a092fb0005dcd8d4)\r\n\r\n***\r\n# Serverless Deep Learning with Python\r\n## [Alizishaan Khatri](https://www.linkedin.com/in/alizishaan-khatri-32a20637/){:target=\"_blank\"} @Kony Machine Learning Engineer \r\n* Kony builds applications for banks \r\n* Unfortunately I do not follow at all\r\n\r\n***\r\n# Airflow in Practice: How I Learned to Stop Worrying and Love DAGs\r\n## [Sarah Schattschneider](https://www.linkedin.com/in/sarahschattschneider/){:target=\"_blank\"} - software engineer @[blue apron](https://www.blueapron.com/){:target=\"_blank\"} - hiring\r\n* One of advantages is the more advanced alerting system\r\n* Good cli and UI \r\n* Open Sourced by Airbnb",
        "word_count": 608,
        "day_of_the_week": "Tuesday"
    },
    {
        "title": "I just launched a Web App!",
        "date": "2019-10-29T12:56:00-04:00",
        "category": "Projects",
        "description": "",
        "body": "This is a big thing for me. I have been learning Django for several months now (around 4). I built a website with it, thanks to all the great tutorials out there. Building a Web App is a whole different thing though. \r\n\r\nI have struggled to find time and courage to actually build this thing. It took many different forms and ideas while I was building it.\r\n\r\n## Gratitude\r\nI want to give a quick shout-out to people/resources that helped me achieve this. I'd like to thank:\r\n\r\n* my wife for putting up with me during this long and hard process!\r\n* the StackOverflow community (especially to [Daniel Roseman](https://stackoverflow.com/users/104349/daniel-roseman?tab=profile){:target = \"_blank\"} who answers a ton of questions and very quickly I have to say). \r\n* [William Vincent](https://wsvincent.com/){:target = \"_blank\"} for writing a lot of good tutorials.\r\n* [IndieHackers Community](https://www.indiehackers.com/){:target = \"_blank\"} for constant inspiration.\r\n* [Coutland Allen](https://www.indiehackers.com/csallen){:target = \"_blank\"} for building Indiehackers and for the podcast, which is extremely inspirational.\r\n* ...\r\n\r\nThis list can drag along pretty far. The point is I am thankful to all the people who helped me with this. Funny enough, none of those people know they have helped me.\r\n\r\n\r\n## The Process \r\nI wanted to build something. Anything, not necessarily a web app. \r\n\r\n```\r\nNote: While writing this I feel so shitty for some reason... \"Who are you to be writing about this?\", \"No one cares...\" are the thought that comes to my head...\r\n```\r\n\r\nI needed some extra money to live off, since my current wage is not enough. This leads me to try a bunch of things.\r\n* I tried to build a t-shirt shop with Shopify, that failed.\r\n* I tried to build a website with Wordpress to sell some written work. That failed too.\r\n* I tried to record myself cooking to make a Youtube channel, I didn't follow through. \r\n* I made a business newsletter for Russian Entrepreneurs. No, signups.\r\n* I made an online journal so that students can post their work for the world to see. No submissions...\r\n\r\nI was kind of sad and decided to do something that will at least help me get a better job. The first thing was to make a website. I tried, Wix.com, Jekyll, plain HTML, it was all shiiiiiiiit. Really, really bad... **This is turning into my life story, which it is not supposed to be. I will stop now and will continue this story sometime in the future, promise.** Long story short, I decided to learn Django and after making the website I was happy about I decided to build some kind of SaaS product that people would pay for. \r\n\r\nOne of the ideas was inspired by Derek Sivers. More specifically, by hist post on [Journaling](https://sivers.org/dj){:target=\"_blank\"}. There he talked about the benefits of journaling. \r\n\r\n> If you care about your thoughts, keep them. \r\n\r\nOne of the ideas was to also have \"Thought On\" Journals, for all the different thought you might have. For example, Derek has Journals about Airports, Sex, Travel and a bunch of others.\r\n\r\nI thought that was a great idea for a web app. Allow people to create journals for any thought that they have. That's it. That was the premise of the app and I have now built it. Now you can do that.\r\n\r\nBuilding it was not very hard with the knowledge I gathered in roughly 3 months of building my personal website. The hardest thing was to actually start building it, finding time to continue building it and to have the balls to follow through and finish building it. Somehow, I managed to do all that and am still pleasantly surprised that I did. \r\n\r\nJust as a remark I want to add that it wasn't super easy all the time, I ran into errors all the time. All. The. Time. You just need to be an adult and seek help. StackOverflow is a great place to ask for help.\r\n\r\n## Pricing and Next Steps\r\nI thought that this is not enough to ask people for money and so I decided to make it free until I build the next feature. The next feature will be akin to a Personal CRM like [MonicaHQ](https://www.monicahq.com/){:target=\"_blank\"}. \r\n\r\nI think the price I will be asking for is around 4.99 a month. I won't be expecting much excitement or registration at that price point. If someone signs up I will be super happy, otherwise, I will be happy just using it myself.\r\n\r\n\r\n## Final Thought\r\nJust because this is the first post about me building something, I wanted to tell a lot more, but it is very easy to go down the rabbit hole of telling you each small detail about my thought process and all the vents that happened to me before I actually published. Life is a hard and complicated thing. It is very hard to isolate specific events that lead to other events. Nothing happens in a vacuum. Hopefully, if I continue to work and write about it, I won't have to talk about the details so much and a lot of things will start to become self-evident.",
        "word_count": 852,
        "day_of_the_week": "Tuesday"
    },
    {
        "title": "Analyzing FIFA 19 data. (Part 3: Machine Learning and Prediction)",
        "date": "2019-12-06T13:26:35-05:00",
        "category": "Machine Learning",
        "description": "",
        "body": "## Source code\r\nThe project source code is in [this](https://github.com/rasulkireev/fifa19-data-analysis) Github repo. You can review the code in this post in 3.1-machine-learning-by-the-book.\r\n\r\n##Overview\r\nIn this post, we go through the process of building a machine learning algorithm. I am not making it from scratch. Scikit-learn has done all the work for us. We need to think about the \"business\" logic and best practices of using this library. \r\n\r\nPlease note, this is part 3 of our project. Please follow the links to review Part 1 and Part 2, where we talked about Data Cleaning and Exploration.\r\n\r\n## Initial Importing\r\n\r\nLet's begin. First, we need to import the standard packages and a \"clean\" dataset (from the previous post).\r\n\r\n```python\r\n%matplotlib inline\r\n\r\n# Standard Libraries to import\r\nimport pandas as pd\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\n\r\ndataset = pd.read_csv('data/processed/clean_dataset.csv', index_col=0)\r\n```\r\n\r\nThis should get us going.\r\n\r\n## Creating a test set. \r\nBefore we begin any further exploration or analysis, we need to create a test set and set it aside. After you have your data, the first thing you should do is to set aside some test data. This ensures a safe and unbiased process. \r\n\r\n### Categorizing Overall Skills into bins.\r\n\r\nThis step helps us get the correct proportions of data from each Overall skill bin when we are splitting the dataset.\r\n\r\n```pyhton\r\n# Create a column that categorizes Overall Skills level into bins. \r\n\r\ncustom_bins = [i for i in range(45,100,5)]\r\n\r\ndataset['overall_bins'] = pd.cut(dataset['overall'],\r\n                                bins=custom_bins,\r\n                                labels=[i for i in range(len(custom_bins)-1)])\r\n\r\ndataset['overall_bins'].hist()\r\n```\r\n\r\nIf everything works correctly, you should get a histogram that shows an uneven distribution of players that belongs to each \"group.\"\r\n\r\n![Histogram](https://i.imgur.com/9Ge8gfU.png)\r\n\r\nLet's now split the dataset into the test set and training set. Thanks to Scikit-learn, it is straightforward. We are using the train_test_split function.\r\n\r\n```python\r\nfrom sklearn.model_selection import train_test_split\r\n\r\nstrat_train_set, strat_test_set = train_test_split(\r\n    dataset, test_size=0.2, random_state=42, stratify=dataset[\"overall_bins\"])\r\n```\r\n\r\nHere, we set the test size to 20%, which is the standard proportion to pick. If you have a large data set, with millions of rows, then you can choose a smaller percentage. The random state helps us replicate the result in the future. You can use any integer, but 42 is a geeky standard.\r\n\r\n> I have procrastinated on this post for a long \r\nTime. I think this is just because it seems like there is too much work ahead. I have this subconscious desire to make it perfect, just because all the data science related posts I read seem to be that way. No more. I am at the beginning of my career, and putting this out in the world is way more important than making it perfect. So I try to keep this short, sweet, and simple (the new S3). In the future, when I have more time and experience, you can certainly expect much more detail, depth, and sass in my posts. Now, let's continue.\r\n\r\n\r\nIf you want to see the distribution of data along with the bins, you can run the following code.\r\n\r\n```python\r\nprint(strat_test_set[\"overall_bins\"].value_counts()/len(strat_test_set))\r\nprint(len(strat_test_set.overall))\r\n```\r\n\r\n![Testing Distribution](https://i.imgur.com/5npYGWp.png)\r\n\r\n## Prepare the Data for Machine Learning Algorithm\r\n\r\n### Separating dependent and independent variables\r\n\r\nThe first thing we are going to do is to separate the dependent and independent variables. Since we are trying to predict the value of the player, it is going to be our dependent variable. Other columns are the independent variables. This is the code to achieve that separation:\r\n\r\n```python\r\ndataset = strat_train_set.drop(\"value\", axis=1)\r\ndataset_labels = strat_train_set[\"value\"].copy()\r\n```\r\n\r\n### Converting categorical variable to numerical \r\n\r\nWe are using Scikit-learn built-in method called OneHotEncoder. This is great and simple to use the feature. \r\n\r\n_**I have to give Scikit-learn dev team a huge shoutout, they are doing a great job overall.**_\r\n\r\nThe only categorical variable that we have is 'Position.' I think it is useful to consider player positions because they need different skills and attribute to be better or worse and will, therefore, affect the overall value of the player.\r\n\r\n```python\r\n# One hot Encoding\r\nfrom sklearn.preprocessing import OneHotEncoder\r\n\r\ndataset_categorical = dataset[['position']] \r\n\r\ncat_encoder = OneHotEncoder()\r\ndataset_categorical_1hot = cat_encoder.fit_transform(dataset_categorical)\r\n```\r\n\r\n### Scaling your features\r\n\r\nScaling is important when it comes to Machine Learning. Having values that vary in the range can through your algorithm off. So keeping everything on the same scale is very important. One way to do this is Scikit Learn's built-in method called StandardScaler. This method applies the [Min-Max feature scaling](https://en.wikipedia.org/wiki/Feature_scaling#Rescaling_(min-max_normalization))\r\n, which essentially yields values from 0 to 1.\r\n\r\nI use a Pipeline method to apply the scaling. This helps us automate the process in the future by creating a pipeline. This is how the code looks like:\r\n\r\n```python\r\nfrom sklearn.pipeline import Pipeline\r\nfrom sklearn.preprocessing import StandardScaler\r\n\r\nnum_pipeline = Pipeline([\r\n        ('std_scaler', StandardScaler()),\r\n    ])\r\n``` \r\n\r\n### Creating a Full Pipeline\r\n\r\nThe final step in preparing the data is to create a Full Pipeline that we can use to feed the unprocessed information. In our case, it is the test data that we have prepared in the beginning. \r\n\r\nTo create the full pipeline, once again, you need to use Sciki-learn built-in method called `ColumnTransformer`. It is a relatively new feature. It is very efficient. We are also going to leverage the Pipelines we have created earlier. This is how we do this:\r\n\r\n```python\r\nfrom sklearn.compose import ColumnTransformer\r\n\r\n# Make a dataset with nums only\r\ndataset_num = dataset.drop(\"position\", axis=1)\r\n\r\nnum_attribs = list(dataset_num)\r\ncat_attribs = [\"position\"]\r\n\r\nfull_pipeline = ColumnTransformer([\r\n        (\"num\", num_pipeline, num_attribs),\r\n        (\"cat\", OneHotEncoder(), cat_attribs),\r\n    ])\r\n```\r\n\r\nPlease note: the third parameter for both functions within ColumnTransfomer are lists of columns that this function applies to.\r\n\r\nThen we will perform a fit_transform on the dataset:\r\n\r\n```python\r\ndataset_prepared = full_pipeline.fit_transform(dataset)\r\ndataset_prepared.shape\r\n```\r\n\r\n`.shape` is here to check the dimensions of the final dataset. This is the result for me `(14516, 59)`\r\n\r\n## Applying the Machine Learning Algorithm\r\n\r\nThere is a plethora of different Machine Learning Algorithms that was pre-built by Scikit learn. We are going to use the Random Forest Regressor. It is a robust algorithm. \r\n\r\nI am not going to go into the details of how it works. There are some excellent resources out there that talk about this in detail.\r\n\r\nIf you followed along and did everything successfully, the following code looks extremely simple to you!\r\n\r\n```python\r\nfrom sklearn.ensemble import RandomForestRegressor\r\n\r\nforest_reg = RandomForestRegressor()\r\nforest_reg.fit(dataset_prepared, dataset_labels)\r\n```\r\n\r\nThat's it. We now need to test the algorithm. One of the simplest ways to do this is to check the Root Mean Squared Error. The following code does not.\r\n\r\n```python\r\ndataset_predictions = forest_reg.predict(dataset_prepared)\r\nforest_mse = mean_squared_error(dataset_labels, dataset_predictions)\r\nforest_rmse = np.sqrt(forest_mse)\r\n\r\nf'RMSE is ${forest_rmse:,.0f}'\r\n```\r\n\r\nI get `'RMSE is $374,525`. This means that, on average, the algorithm is only roughly off by $400k, which is not a lot compared to the actual values. We are talking millions here.\r\n\r\n\r\n### Saving the model\r\n\r\nSuppose we are happy with our model. Now the right thing to do would be to save it. The easiest way to do this is by using joblib function. It is easily accessible from sklearn.externals. This is how you save the model:\r\n\r\n```python\r\nfrom sklearn.externals import joblib\r\n\r\njoblib.dump(forest_reg, \"models/best_model.pkl\")\r\n```\r\n\r\nHere the forest_reg is the model we want to save and the second parameter `\"models/best_model.pkl\"` is the path and the name of our new file. \r\n\r\nYou can check the directory to make sure everything saved correctly.\r\n\r\n## Evaluating on the test set\r\n\r\nNow that we have a working algorithm we want to use, it is time to finally test it on the test set to see if it works correctly.\r\n\r\nWe are going to take our test_set and feed it through the pipeline we created earlier. After that, we are going to feed it through the model we have trained. Excuse my \"feed-through\" language. This is the first thing that comes to mind.\r\n\r\n```python\r\nfinal_model = best_model\r\n\r\nX_test = strat_test_set.drop(\"value\", axis=1)\r\ny_test = strat_test_set[\"value\"].copy()\r\n\r\nX_test_prepared = full_pipeline.transform(X_test)\r\n```\r\n\r\nThe code above makes the final \"prepared file.\"\r\n\r\n```python\r\nfinal_predictions = final_model.predict(X_test_prepared)\r\n\r\nfinal_mse = mean_squared_error(y_test, final_predictions)\r\nfinal_rmse = np.sqrt(final_mse)\r\n```\r\n\r\nNow we successfully \"fed\" or dataset thought he model. The last thing to do is to evaluate the error.\r\n\r\n```python\r\nf'RMSE is ${forest_rmse:,.0f}'\r\n```\r\n`'RMSE is $359,161'`\r\n\r\nAll right! The model performs better on the test set, rather than the training set. This is a little surprising to me. The difference is tiny, so no worries about underfitting.\r\n\r\n## Final Thoughts\r\n\r\nI can't believe this is \"over.\" \r\n\r\nWe have gone through the process of Data Analysis from Data cleaning to Building a Model. There are so many things I have left out, even things I did for this dataset. It is impossible to cover everything in one go. I hope this was at least a little tiny bit useful.\r\n\r\nThere are fantastic books written on these topics. The books that helped me write this post is 'Hands-on Machine Learning with Scikit-Learn, Keras & TensorFlow' by Aurelion Geron.\r\n\r\n\r\n## Final, final thoughts\r\n\r\nThese are my first baby steps in the world of Machine Learning. These are the first baby steps in the world of Data Science blogging or any blogging for that matter. So, please do not be too harsh. \r\n\r\nYou know what, actually forget it. Please, be harsh. I don't have too much free time, and I want to improve as quickly as possible. So, some constructive criticism would be great.\r\n\r\nThis post took me waaay to long to write. Also, I had big blocks of time in between those writing, so I am afraid of small inconsistencies.\r\n\r\nIn the future, I will try to break it up into a much smaller code block. I guess it was a little too ambitious to write a \"form start to finish\" post as my first post. Well, I am happy I wrote. I am so glad it is now behind me, and I can move on with some other things.\r\n\r\nI promise to try to be more consistent and more frequent with posts.\r\n\r\nIf you have any questions, please let me know. Email is the best way to reach me. Maybe Twitter. \r\n\r\nAlso, if I have a comment section by the time you read this, please don't be a stranger and leave a comment. Positive or negative, doesn't matter.",
        "word_count": 1692,
        "day_of_the_week": "Friday"
    },
    {
        "title": "Started a new project: \"Built with Django\"",
        "date": "2019-12-12T12:48:57-05:00",
        "category": "Projects",
        "description": "I have started a new project called Built with Django. Essentially, it is a curated list of projects built with Django.",
        "body": "Last week, I purchased [Ryan Kulp](https://www.ryanckulp.com/){:target=\"_blank\"}'s course on buying, improving, and selling microbusinesses [(affiliate link)](https://www.microacquisitions.com/how-to-buy-small-companies/8ayt5){:target=\"_blank\"}. One of the reasons I bought this course was to learn another skill (bseides, data analysis and web developemnt) that could potentially become financially stable. The other reason is that I desperately wanted to see how one would purchase a business without having a ton of cash upfront. Finally, I have been following Ryan for a while now, and he is just a cool dude, with [a lot to share](https://www.ryanckulp.com/projects/){:target=\"_blank\"}. \r\n\r\nThis is not a post about this course, though. I will write a short review of the course once I finish it. For now, I want to share a new project I am working on and how I came up with it. \r\n\r\nThe reason I mentioned How to Buy, Grow, and Sell Small Companies is that it helped me to get the idea. In one of the videos, Ryan said that at [Fork Equity](https://www.forkequity.com/){:target=\"_blank\"}(Ryan's Investment firm), they care about the tech stack that the company uses. They have experience with [Ruby on Rails](https://rubyonrails.org/){:target=\"_blank\"} and will be able to navigate in the projects once they acquire it quickly. I am a big fan of [Django](https://www.djangoproject.com/){:target=\"_blank\"} and its [community](https://www.djangoproject.com/community/){:target=\"_blank\"}. If I am ever going to buy a business, I do not want to spend a ton of time learning the tech stack behind it. So I thought it would be cool to have a collection of websites built with Django. Hence my project \"[Built with Django](https://builtwithdjango.com/){:target=\"_blank\"}.\"\r\n\r\nThis seemed like an excellent idea for several reasons:\r\n1. I get to practice and improve my Django & Design skills\r\n2. I get to create a community of like-minded people. More specifically, people who like to create things and like to create them with Django.\r\n3. I have a list of great projects that I could potentially help with or even take under my wing and improve upon.\r\n4. Highlight the brightest mind in the community that I love.\r\n5. In case of success, potentially monetize, by creating a job board and other non-intrusive to users way.\r\n\r\nThe project is now up and running. I published it a week ago. I will not go into more detail about how I was making right now. I will write a post on it later.\r\n\r\nHere I just want to state that it took me about a week to go from 0 to [MVP](https://en.wikipedia.org/wiki/Minimum_viable_product){:target=\"_blank\"}. The hardest part was the front end, it is my weakness. Otherwise, Django makes it pretty easy to build the backend logic. Love Django.\r\n\r\nI think this is going to be relatively low maintenance, yet useful project. I hope we get some people sharing their work. Hopefully, this will help grow the awesome community of Django makers.",
        "word_count": 458,
        "day_of_the_week": "Thursday"
    },
    {
        "title": "Creating a Maker Widget with TailwindCSS",
        "date": "2019-12-17T10:46:11-05:00",
        "category": "Design",
        "description": "I made a simple Maker Widget with TailwindCSS",
        "body": "I recently built a [Built with Django](https://builtwithdjango.com){:target=\"_blank\"} website to highlight projects that were built with Django. [Made with Vue](https://madewithvuejs.com/){:target=\"_blank\"} has been a great inspiration for me. One of the cool features on this website is the Maker widget. You can see that [Armin](https://twitter.com/arminulrich){:target=\"_blank\"} and [Melanie](https://twitter.com/_feloidea){:target=\"_blank\"} built this website.\r\n\r\n![MakerWidget](https://i.imgur.com/MlifcG7.png)\r\n\r\nYou can also see all their social links.\r\n\r\n![MakerWidget Extended](https://i.imgur.com/JtDzXQs.png)\r\n\r\nThis is actually another project [they made](https://makerwidget.com){:target=\"_blank\"}. They make it easy to create your own widget. Kudos.\r\n\r\nThen I stumbled upon [Makerrank](https://makerrank.co/){:target=\"_blank\"} built by [Pieter Levels](https://levels.io/){:target=\"_blank\"}, where he made a similar widget with plain HTML & CSS.\r\n\r\n![Pieter Widget](https://i.imgur.com/xdHLq8U.png)\r\n\r\nI decided to go for simplicity and used Pieter's \"widget\" as a template/inspiration and rebuilt it with TailwindCSS.\r\n\r\n## Building the Widget\r\n\r\n```html\r\n<a class=\"fixed bottom-0 right-0 z-10 px-2 py-1 font-semibold text-gray-900 no-underline bg-yellow-300 border-t border-l border-white border-solid rounded-tl-lg\" href=\"#\">\r\n    <img class=\"inline w-4 align-middle rounded\" src=\"{ link to your image }\" alt=\"\">\r\n    <p class=\"inline m-0 ml-1 font-bold align-middle\">by Rasul</p>\r\n</a>\r\n```\r\n\r\n![Widget by Rasul](https://i.imgur.com/yHqj19F.png) \r\n\r\nYou can use this on any website you have built. You can direct users to any link you would like. The cool think about this is that it can also be used as a Feedback button. This is useful because it is always there, users can always see it. Yet, it is not right in your face. You would simply need to change the link and the text. For the link, you can make a TypeForm to collect feedback.\r\n\r\n## Final Notes\r\n\r\nYou could combine the two widgets on one page. It will look something like this.\r\n\r\n![Double Widget by Rasul](https://i.imgur.com/tmo7Gbu.png)\r\n\r\nYou are a judge on this one. For me, this looks alright. Not great, just alright. Here is the code that will get you those:\r\n\r\n```html\r\n <a class=\"fixed bottom-0 right-0 z-10 px-2 py-1 font-semibold text-gray-900 no-underline bg-yellow-300 border-t border-l border-white border-solid rounded-tl-lg\" href=\"#\">\r\n        <img class=\"inline w-4 align-middle rounded\" src=\"{ link to your image }\" alt=\"\">\r\n        <p class=\"inline m-0 ml-1 font-bold align-middle\">by Rasul</p>\r\n      </a>\r\n\r\n      <a class=\"fixed bottom-0 left-0 z-10 px-2 py-1 font-semibold text-gray-900 no-underline bg-yellow-300 border-t border-r border-white border-solid rounded-tr-lg\" href=\"#\">\r\n        <img class=\"inline w-4 align-middle rounded\" src=\"{ link to your image }\" alt=\"\">\r\n        <p class=\"inline m-0 ml-1 font-bold align-middle\">Feedback</p>\r\n      </a>\r\n```\r\n\r\nI hope that is useful.",
        "word_count": 368,
        "day_of_the_week": "Tuesday"
    },
    {
        "title": "2019 in Review",
        "date": "2019-12-30T10:56:17-05:00",
        "category": "Personal",
        "description": "This is my attempt to review everything that I made happen, and that happened to me in 2019. It is crucial to remind yourself of the things you regularly did. Writing this post was very gratifying.",
        "body": "I have seen a few \"2019 Year in Review\" posts on Twitter and that it would be cool to write one too.\r\n\r\nWhere should I start? This is the question I'm thinking about right now. That's a good sign. Without going in deep into my thoughts, I can see that there are at least a few things I can talk about. \r\n\r\nI am now excited to write this post to remind myself that I have been doing good and can expect a lot more from 2020. \r\n\r\n## Table of Contents {#start}\r\n\r\n* [Highlights](#highlights)\r\n* [Early 2019](#early-2019)\r\n* [Starting the hustle](#hustling)\r\n* [Learning Web Dev](#learning-web-dev)\r\n* [Networking](#networking)\r\n* [Career Switch](#career-switch)\r\n* [Starting to Data Science](#data-science)\r\n* [Indiehackers](#indiehackers)\r\n* [Web Development / SaaS](#building-saas)\r\n* [Open Source Community](#open-source)\r\n* [Family](#family)\r\n* [Stoicism](#stoicism)\r\n* [Overall](#overall)\r\n\r\n## Highlights {#highlights}\r\n\r\n* It was stressful.\r\n* I learned a ton of web-related technologies.\r\n* Wow... So much happened, it is crazy.\r\n* This year was about discovering various communities and opening myself to them.\r\n* There are a ton of cool and exciting things in the world. We have a whole life to discover them. In fact, there are too many, and making sure to only focus on the best and most important is crucial. Only do and learn things that make you say Hell yes.\r\n\r\n\r\n## [##](#early-2019) Early 2019  [\\[↑\\]](#start) {#early-2019}\r\n\r\nThe beginning of 2019 started off with my wife and me celebrating New Year's in our little room in 5BR in Cambridge, Massachusetts. It was scary because I graduated without any job offers. Our lease was running out in mid-January. We generally did not know what is next. At that time, I was hoping to receive an internship opportunity with my previous employer. So, it was a little scary and somewhat stressful.\r\n\r\nThankfully I received that offer. The office is located in NYC, so we started packing up for a move to NY. We spend a month going from one Airbnb to another in search of an apartment where it would be just the two of us. Long story short, we found a great apartment in Newark, NJ. It felt great to stop moving from place to place, moving a lot of our stuff. Sadly, due to the moving, my wife's birthday was a little disappointing to her. Hopefully, this year we can make up for that.\r\n\r\nThe only disadvantage to all that is the fact that I didn't receive my EAD card, which would allow me to start my employment. Because of that, we had to take a loan to make payments for our new apartment. Still paying out that loan, with hopes to end that nightmare mid-2020. Huge thanks to my father, who could support us during that time also.\r\n\r\n## [##](#hustling) Starting the hustle [\\[↑\\]](#start) {#hustling}\r\n\r\nWhile not being employed, I thought it would be cool to start something that could bring us an alternative income. My salary was not going to cover everything. Unfortunately, it still does not. \r\n\r\nI remember clearly that the only reason I got an idea to do that was thanks to Tim Ferriss. I am forever grateful to this man. I have been reading his \"4 Hour\" series while in my last semester in college. \r\n\r\nWithout going into too much detail, this is what I have done during March of 2019. Bought two domains:\r\n\r\n* [osarjournal.com](https://osarjournal.com){target=\"_blank\"} \r\n* [yourguidestolife.com](https://yourguidestolife.com){target=\"_blank\"}\r\n\r\nBought \"BlueHost\" hosting plan. I started working on two of my ideas. A service that will allow students to show their work to the world (Open Source Analytics Journal) and a list of useful guides that you get for paying a subscription fee. Needless to say, both of these failed, but they did give me a valuable lesson. I didn't like [WordPress](https://wordpress.org){target=\"_blank\"}. More specifically, I did not like the fact that I can't customize it very well, and all the useful packages I needed were paid. \r\n\r\n> Why in the world would I pay for simple forms?!?\r\n\r\n> Interestingly, I remember stumbling upon \"Make paid subscriptions with Django\" class on Lynda.com, which was perfect at the time. But after going through a few videos, I dropped it. It did not stick. It is interesting because right now, Django is the only framework that I understand well. \r\n\r\nMy next venture was Fermentline. I heard a lot of great things about Shopify and wanted to give it a try. For a person who does not earn any money, $79 bucks might seem like a bit much. Nonetheless, I decided to try it. I have recently picked up a passion for fermentation. \r\n\r\n> I have been making Kombucha at home. I was making fermented garlic, pickles, and other foods. I even tried to become a food YouTuber.\r\n\r\nI can't remember why, but I thought that it would be cool to sell fermentation related apparel. No one else was making it (it still seems like a relatively good idea). Long Story short, that failed, with me paying from three months of Shopify. \r\n\r\nStill, this was a rewarding experience. I got to work with freelance designers. This was my first attempt to build a web page. It is effortless with Shopify. \r\n\r\n> One thing that makes me laugh now is the number of motivational videos I watched. Motivational is probably the wrong word there. A better description is \"How to earn a shit load of many dropshipping on Shopify\" kind of videos. \r\n\r\nI stopped this project around the time I received my EAD card and started my internship, ones again. \r\n\r\n\r\n## [##](#learning-web-dev) Learning Web Dev [\\[↑\\]](#start) {#learning-web-dev}\r\n\r\nMid-March I started working for Guy Carpenter. At first, I was extremely excited. Finally, a real job. I was extremely excited about the commute even. I read on my beloved kindle while I was on NJ Transit, then listening to podcasts while walking to work. The same deal on the way back home. \r\n\r\nThe podcast I was listening to mostly was \"The Tim Ferriss podcast.\" I have only recently discovered it, and God, there was a lot of things I had to catch up. So many great interviews. Interviews with [Jason Fried](https://tim.blog/2018/07/23/jason-fried/), [Derek Sivers](https://tim.blog/2015/12/14/derek-sivers-on-developing-confidence-finding-happiness-and-saying-no-to-millions/), and [Naval Ravikant](https://tim.blog/2015/08/18/the-evolutionary-angel-naval-ravikant/) are one of my favorites. The one podcast that changed a lot for me was featuring [Ramit Sethi](https://tim.blog/2014/10/09/ramit-sethi-on-persuasion-and-turning-a-blog-into-a-multi-million-dollar-business/). To be honest, I don't remember what it was, but in general, the accessibleness of gathering wealth. One of the key things I remember was sin writing guest posts.\r\n\r\nWhile I was doing Google research, I have stumbled upon a couple of personal websites. One that comes to mind is [Tom Critchlow website](https://tomcritchlow.com/). I thought, \"Wow, that was cool, I need to make a personal Website and start doing consulting work to increase my revenue.\" Tom's website was done with [Jekyll](https://jekyllrb.com/). I started googling and ended up choosing to make a website with [Jekyll](https://jekyllrb.com/) and host it on [GitHub Pages](https://pages.github.com/)... That was a slow process. I remember I was actually writing code in GitHub, committing changes, and waiting for the website to change. I remember trying to a \"resume\" format website. After thinking I was done, I tried opening on my phone, and... it was shit🤣. I remember using tachyons for my CSS, without actually not knowing how CSS works properly (again, thanks to Tim for inspiration).\r\n\r\nI don't want to go into too much detail. This is not an autobiography, although there are undoubtedly a lot of things I would love to put on paper. This is how my journey to web development started. \r\n\r\nActually, funny I should mention autobiography. Around the same time, I read The Bullet Journal book. I have been trying to journal, on and off, but this book helped me make it a more stable habit. I'm still working on doing regular entries, but it was a fantastic start, and I can't recommend it more. The BuJo method actually inspired me to build a project I'm working on right now - Kushim.\r\n\r\n## [##](#networking) Networking [\\[↑\\]](#start) {#networking}\r\n\r\nAround the same time, I decided to make an effort to meet more people, a.k.a Networking. I do mean professional networking. I struggled to get a single interview while in my last semester at Northeastern. I started contacting people on LinkedIn, asking for advice. I focused on people who work in the Data Science sphere, as it is what I was very interested in. Surprisingly, people are nicer in real life. I got a lot of responses and a lot of meetings.\r\n\r\nI am thankful for this act of courage from my side. I have wasted my college years watching TV shows and other things like that, not meeting people, not trying new things. \r\n\r\nI have recently started to prefer stey at work and code my own projects rather than meet new people during lunch. I think this is something I need to return to my schedule. Connections are everything.\r\n\r\n## [##](#career-switch) Career Switch [\\[↑\\]](#start) {#career-switch}\r\n\r\nI started my employment as an Actuarial intern. I've tried to pass the Actuarial exams several times but failed each time miserably. This is why I decided to meet more people, to find a new job in 6 months, while I was there. I failed in that too. Can you fucking imagine? In six months of job applications and networking, I did not get a single fucking on-site interview. Not one!\r\n\r\nThankfully, my boss at the time offered to extend my internship. So I had another six months to network and applied for jobs. At the same time, my boss asked me whether I want to keep trying to pass exams. While it was scary to say no, as there was a chance I might get fired, not extended. I am grateful that he didn't take it personally and offered to help find a new position within the company. I'm so thankful for that.\r\n\r\n## [##](#data-science) Starting to Data Science [\\[↑\\]](#start) {#data-science}\r\n\r\nI found an exciting position within GC at a Data Strategy Department. I contacted the hiring manager, Alan Anders, and we talked a little on the phone, even though his calendar had not one single spot. I'm thankful he took the time to speak with me and tell me about the position. I got so excited. The journey of transition started.\r\n\r\nI'm now helping him with various data-related tasks. Or rather trying to help. Even though I was interested in Data Analysis for a while now, there were so many new things that I got quickly overwhelmed. Receiving so many errors, and being able to advance during the day is very discouraging. I really like working with Alan. Even if I only work part-time.\r\n\r\n## [##](#indiehackers) Indiehackers [\\[↑\\]](#start) {#indiehackers}\r\n\r\n[Indiehackers](https://pages.github.com/) is a fantastic community of people who want to start their own business without venture capital, bootstrapped. Mostly that would mean people who can code and want to build something like a web app. \r\n\r\nI can't remember how I found that community, I tried really hard but just can't remember. To be honest, though, it doesn't matter. What matters is that I did find it. At the time I found Indiehackers, I just started to build my own website and did not know how to do \"professional\" coding.\r\n\r\nI got extremely excited about building a web app, a SaaS business to support myself and my family. So I have added another goal to my list - learning to build web apps. \r\n\r\n## [##](#building-saas) Web Development / SaaS [\\[↑\\]](#start) {#building-saas}\r\n\r\nI started researching what I would need to build a web app, and the list was just too overwhelming... Php, Node.js, JavaScript, Laravel, Ruby on Rails, Django. That was a lot. Since I didn't know anything, I had to pick, that pick would probably be crucial since I would have to stick to it for some time. Just because I learned Python before (for Data Analysis purposes), I decided to teach myself Django. \r\n\r\nFirst, I decided to rebuild my website. That was a long process. [William Vincent](https://wsvincent.com/) tutorials were a huge help. Huge! Thanks, William.\r\n\r\nAgain, I don't want to go into too many details, but the rebuild was somewhat successful. I now had a blog, a \"now\" page, and \"What I learned this week\" page. Since my website was hosted on Digital Ocean Ubuntu droplet, I got to learn Nginx, Gunicorn, and to use the command line. Knowing that a lot of things are possible with Django, I started recording my ideas for potential future projects. The list is now very long. I am excited to try those in the future when I am very good at Django 😁.\r\n\r\nNow, I am building [Kushim](https://kushim.io) . It is my attempt to create a life management system for myself. The main features are Journaling, Digital Garden, and Network database to help you manage your relationships. I am almost done building a robust V1. The only thing left to do is to set up a billing process for pro accounts. And to set up automated emails for network app. I really hope to finish those soon and move onto the next project.\r\n\r\n## [##](#open-source) Open Source Community [\\[↑\\]](#start) {#open-source}\r\n\r\nLearning to code involved using GitHub a lot. On GitHub, people share their code. This encourages sharing and helping. The open-source community is all about sharing helping and doing things together. \r\n\r\n[Derek Sivers](https://sivers.org) was the main reason discovered Open Source (OS) community. In one of his posts (about database building), he suggested people use [MonicaHQ](https://monicahq.com). Monica is an OS project. Although you can pay for it, I decided to attempt to install it on my own server. That was challenging. Very challenging. This is the first time I've run into that many errors. \r\n\r\n> This is actually happening to me at work right now. Errors. Errors everywhere.\r\n\r\nThe only reason I pushed through that is pure excitement and enthusiasm. I really wanted it to work. A website only I can access, which hosts all my contacts and reminds me to contact them. This project was built with PHP, which wasn't my favorite thing to deal with. Thankfully, I had a lot of time in the evenings at that point and finally made it work. \r\n\r\nAt that point, I was obsessed with OS projects. Not very proud, but I started to get a little greedy. I was thinking, \"what else can I use for free.\" Then the novelty wore off, I got better at removing things I didn't need, I changed. Now, I thought, \"what projects can I help.\" Since I knew a little Python and Django, I couldn't contribute to many projects.\r\n\r\nI started contributing to some instructions and other less important things. I even took part in Hacktoberfest winning a t-shirt for contributing to 5 projects. Very proud of that.\r\n\r\n\r\n## [##](#family) Family [\\[↑\\]](#start) {#family}\r\n\r\nIn the summer, my wife went back home to Russia for a month. I remember that saying goodbye was very, very hard! We promised never to do that again. So when we get in a fight or argue, I try to remember that moment. It helps me remind myself how much I care about her and love her. \r\n\r\nSometimes it is indeed hard, very hard. But going through all the hard things together is essential. Knowing that there is always someone by your side is very comforting and helpful. \r\n\r\nGenerally, we have had a lot of ups and downs. We are a young couple, a young family. We have a whole life ahead of us to learn about each other and make a great family. I am thankful for all the good and bad moments. Each one second I spend with her is a great second.\r\n\r\n\r\n## [##](#stoicism) Stoicism [\\[↑\\]](#start) {#stoicism}\r\n\r\nDiscovering Stoicism was a big help. I feel that attempting to practice Stoicism makes me a better human being. It makes me better at appreciating what I have, makes me better I controlling my emotions. Sometimes they get out of control. I get too angry very quickly, offloading it onto my wife, which is unacceptable. \r\n\r\nPlease note, I said, \"attempting to practice.\" Becoming a stoic is hard, and I will spend the rest of my life, improving myself. But I think the hardest think of discovering and choosing a philosophy of life is done. Now to applications.\r\n\r\nAlong with Stoicism, I try to exercise and meditate every morning. I try to do this also to keep my brain under control for many things. Keeping emotions under control, being disciplined in my professional life, not allowing myself to distract easily. \r\n\r\n## [##](#overall) Overall [\\[↑\\]](#start) {#overall}\r\n\r\nI am very happy I decided and took the time to write this post. I realized that a lot was accomplished in the last year, or even last half a year. This makes me very excited about 2020. A lot of things to do, a lot to learn. \r\n\r\nI'm forever grateful for everything life throws at me. Especially because most of what it throws is good. Thankful for all the people I get to interact with every day. Grateful for all the new people I met. \r\n\r\nLooking back on this year, I know that our future is bright. It is crucial never to forget that. \r\n\r\nI know that not many people will read this, and that is fine. But if you somehow read the whole thing or at least scrolled all the way here, know this: \r\n\r\nYou can make anything happen. You just need to start doing things one step at a time. Don't try to make everything happen at once. That won't happen. But if you do a little every day, it is inane what you can achieve in a year.\r\n\r\nThanks to 2019 for everything that happened in 2019. Good luck to everyone in 2020.\r\n\r\n✌️",
        "word_count": 2943,
        "day_of_the_week": "Monday"
    },
    {
        "title": "2020 Goals",
        "date": "2019-12-31T12:15:11-05:00",
        "category": "Personal",
        "description": "These are my goals for 2020.",
        "body": "I just finished writing the \"[2019 in Review](https://rasulkireev.com/writings/2019-in-review) \" post, where I went over the things that I made happen in 2019. It felt great, I recommend everyone do it. \r\n\r\nWhile writing the post, I kept thinking, \"ok, I need to do this in 2020\". I think it is a good idea to write down some goals for 2020. Not to always look at them to make sure you accomplish them. Instead, to give you some point of comparison at the end of next year. When I'm writing 2020 in Review, I will be able to see what was important to me at the end of 2019 and what changed during the next year. \r\n\r\nSo, without further ado, here are a few small goals I have for 2020.\r\n\r\n## TL;DR {#start}\r\n\r\n1. [Build two web apps](#build)\r\n2. [Become a better Data Analyst](#data-analyst)\r\n3. [Learn and become way more proficient with Web Technology](#web-tech)\r\n4. [Become the master of my mind and life](#life-master)\r\n5. [Earn some from a side hustle](#side-hustle)\r\n6. [Become more sociable](#social)\r\n7. [Become a more loving husband](#family)\r\n8. [Write more often](#write)\r\n9. [Start a podcast](#podcast)\r\n10. [Get out of debt](#debt)\r\n11. [Buy an existing company](#invest)\r\n12. [If 1, 10, and 11 are successful, set up an LLC.](#llc)\r\n\r\n## 1. Build two web apps [↑](#start) {#build}\r\n\r\nI think financial success lies in both quantity and quality. When it comes to building a SaaS product, one doesn't come without the other. If you look at prolific makers like [Josh Pigford](https://joshpigford.com/), [Pieter Levels](https://levels.io/), [Mubashar Iqbal](https://mubs.me/), [Tyler Tringas](https://tylertringas.com/), [Justin Jackson](https://justinjackson.ca/), and others, you will see that they have been building for years. That is a huge reason for their current success.\r\n\r\nI understand that success doesn't come without Grit, i.e., working and trying without giving up. No matter what, I want to keep building and learning to build better products. Two SaaS projects seem like a doable goal. \r\n\r\n## 2. Become a better Data Analyst [↑](#start) {#data-analyst}\r\n\r\nI thought becoming a data science is my dream for a long time. Now that I have worked with the new department within Guy Carpenter, I understand I am very far from that. Instead, I want to improve a lot in my position as a Data Analyst.\r\nTo be more specific, I want to get more accustomed to working with large datasets via Spark. My goal is not to receive a ton of error every time I try to do anything, and not Google every single idea I have. I need to improve my speed and efficiency drastically.\r\n\r\nI also want to become a much better Data storyteller. This is a vital skill not only in a professional setting but very useful in life and personal projects.\r\n\r\n## 3. Learn and become way more proficient with Web Technologies [↑](#start) {#web-tech}\r\n\r\nLearn to Stripe. This would mean to learn to integrate Stripe API and Stripe.js into my current and future Django projects. Currently, I just can't figure that out. This doesn't mean I have to become an expert in each APIs and JavaScript, but dealing with Stripe flow will certainly greatly improved my understanding of both. \r\n\r\nActually, I have a list of things I'd like to learn and write posts about. There are a bunch of them actually. Here is a small sample: \r\n\r\n* [D3.js](https://d3js.org/) \r\n* [Webmentions](https://indieweb.org/webmention)  \r\n* [GraphQl](http://https://graphql.org/) \r\n* [Vue.js](https://vuejs.org/) ([Gridsome](https://gridsome.org/), [JavaScript](https://www.javascript.com/))\r\n* [LaTeX](https://www.latex-project.org/)\r\n* [regex](https://en.wikipedia.org/wiki/Regular_expression) \r\n* [ArcGIS](https://www.arcgis.com/index.html), [PostGIS](https://postgis.net/), and [GIS in general](https://www.esri.com/en-us/what-is-gis/overview) \r\n* [Serverless Computing](https://en.wikipedia.org/wiki/Serverless_computing) \r\n\r\nNext on the list are webmentions and D3.js. I am going to experiment with both through my personal Website. It should be an interesting and rewarding process. \r\n\r\n## 4. Become the master of my mind and life [↑](#start) {#life-master}\r\n\r\nThis is a broad goal, as well. It includes meditation, diet, emotion control, and spending habits.\r\nIn an attempt to make this more accountable, I would like to make a goal of:\r\n* Do morning exercise, meditation, and journaling on 70% of mornings in 2020.\r\n* 70% of my weekdays must be sweetless.\r\n\r\nI think achieving this will make a massive difference in my life.\r\n\r\n## 5. Earn some from a side hustle [↑](#start) {#side-hustle}\r\n\r\nIt doesn't matter if it just 1 dollar. It is crucial to start. It could be through some consulting, or from a photo shoot, or from one of my web apps. As long as it makes some money.\r\n\r\n## 6. Become more sociable [↑](#start) {#social}\r\n\r\nMeet 50 new people. Meeting fellow Indiehackers is the first thing that comes to mind. However, there are a plethora of other people to meet. Django developers, Data Analysts, and Scientists. \r\n\r\nWith Tanya, we could meet people at board game meetups or photographers meetups, perhaps.\r\n\r\nConnections and relationships are everything.\r\n\r\n## 7. Become a more loving husband [↑](#start) {#family}\r\n\r\nShow my love to my wife more often. Show her signs of affection and gratitude. Surprise her more often. \r\n\r\nCertainly need to try to argue less and do less shouting. \r\n\r\n## 8. Write more often [↑](#start) {#write}\r\n\r\nShare my learnings, my explorations, and anything else that could be useful to people. Make at least 50 blog posts in 2020.\r\n\r\n## 9. Start a podcast [↑](#start) {#podcast}\r\n\r\nStart a podcast for Built with Django.\r\n\r\n\r\n## 10. Get out of Debt [↑](#start) {#debt}\r\n\r\nOne of the biggest causes of my stress in 2019 is due to shaky finances. We are spending way more than I earn. And I fucking myself for that. That lack of discipline and control very upsetting. So this is a big goal for 2020. \r\n\r\nReducing costs to reflect my income. More importantly, payout all of my debts and loans. Get to zero money owned by April. This is, by far, one of the most important goals for 2020. The only reason it is not #1 is that I somehow thought about it right before posting.\r\n\r\n## 11. Buy an existing company [↑](#start) {#invest}\r\n\r\nUsing learning from Ryan Kulp's microacqusitions class, buy an existing business. Start growing it.\r\n\r\n## 12. If 1, 10 and 11 are successful set up an LLC [↑](#start) {#llc}\r\n\r\n## Conclusion [↑](#start)\r\n\r\nI have been thinking about those for a while now. I am pretty sure this is a good and exhaustive list. As I said in the beginning, I don't have the goal of following this list closely. For me, 2020 will be about building good habits.\r\n\r\nAchieving those habits will help me get these goals done, and in turn, these goals will help me reinforce my habits. Thus, creating a beautiful circle (of life 😉)\r\n\r\nTo whoever is reading this, have a Happy New Year. I wish you all the luck and all the strength you can have! May the next year, be the best of your life.",
        "word_count": 1113,
        "day_of_the_week": "Tuesday"
    },
    {
        "title": "Conference Volunteering",
        "date": "2020-01-09T16:46:47-05:00",
        "category": "Personal",
        "description": "This is a reflection on my first volunteering experience at PyData 2019",
        "body": "Recently, I have attended the PyData 2019 conference in NYC. When I visited the website, all the tickets were sold, so I applied for the waitlist. A couple of hours later, as I was thinking about my PyGotham experience from a month earlier. I remembered one of the talkers mentioning that they desperately need more volunteers. I decided to apply for a volunteeriship to help the community, and as a bonus, get a free ticket. This was a big bonus. A couple days later, I received the email notifying me that I got the part! Usually, I don't get \"You are accepted\" type of email, which, come to think of it, makes me a little sad. That felt good.\r\n\r\nI asked my employer if I can work remotely for a couple of days. Prepared the list of talks I want to attend and went through the volunteer training. Finally, I was ready to go. This was my second conference ever. More than that, it was on Python and Data, two things that I am very excited about.\r\n\r\nIn this post, I wanted to share the experience and my learnings from this experience.\r\n\r\n## Experience\r\nMy experience overall was delightful. Tasks were not dull, people were friendly. There were enough volunteers to have regular breaks to attend different talks and to relax.\r\n\r\nI got to talk to a lot of people and to listen to a lot of good talks, but I was still disappointed by myself. I did not use this wonderful opportunity to its fullest. After the conference ended, I realized that I was too \"private.\" I avoided conversations with fellow volunteers, with attendees and with the speakers. To be clear, I was not acting like a total stranger, avoiding any communication at any cost. I did talk to people, but generally, they were the ones to initiate the conversation. Half of the people I spoke to were recruiters, which is just silly.\r\n\r\n## Learnings\r\n\r\nAfter the conference, I stumbled upon two conference-related resources. One is the podcast episode from the Full Stack Radio - [17: Adam Culp - Maximizing Your Conference Experience](http://www.fullstackradio.com/17). The other was a blog post by Al Sweigart - [How to Do PyCon (or any tech conference)](https://automatetheboringstuff.com/how-to-do-pycon.html).\r\n\r\nBoth were very relatable. Both resources talked about the fact that conferences are made for networking, or rather, for meeting new people. I couldn't agree more. Going forward, I will not pursue the same goals as I did at PyData2019.\r\n\r\nThe key learning for me is that meeting new people is crucial for future career and personal success. But the important thing is not to have an agenda when you are talking to people. You should not be expecting to use them as a contact for future jobs or for anything else of sorts. The point must be to have fun and to find good people to surround yourself with. Conferences are fantastic for that. There you will get a chance to interact with a selective group of people who all have a similar hobby to yours.\r\n\r\n## Conclusion\r\n\r\nTo make this useful both for me and for anyone reading this, I will try to boil this down to several points:\r\n\r\n* Prioritize meeting people over the talks\r\n* For the people you've hit it off with, exchange contacts and follow up after the conference\r\n* Use any possibility to meet new people (breakfast, breaks, lunch, maybe not bathroom breaks)",
        "word_count": 572,
        "day_of_the_week": "Thursday"
    },
    {
        "title": "Joplin: open-source note-taking at its best",
        "date": "2020-02-05T15:11:08-05:00",
        "category": "Productivity",
        "description": "I use Joplin to take note. I use it for my personal life and for my projects. This post explains why you should use it too.",
        "body": "Note taking apps are everywhere. Just to seem more credible I have to list a few:\r\n\r\n* [Apple Notes](https://www.onenote.com)\r\n* [Notion](https://notion.so)\r\n* [Things](https://culturedcode.com/things/)\r\n* [Todoist](https://todoist.com/)\r\n* [Evernote](https://evernote.com)\r\n* [OneNote](https://www.onenote.com)\r\n* [Trello](https://trello.com)\r\n\r\nBy no means this is a comprehensive list, there are a ton of other similar apps, each offering some little difference from one another.\r\n\r\nMy argument is that you, as a user, don't need, or shouldn't care about those small differences. There is a list of core requirements for a note-taking application that will be good enough for the majority of people.\r\n\r\nSome people will argue with that statement, and that's fine. As long as some people agree with me on this, I consider the point valid.\r\n\r\nThese are the features are think would count to a core requirement of a note-taking app:\r\n\r\n* Available offline\r\n* Sync across all major devices (macOS, Linux, Windows, Android, iOS)\r\n* Has the basic structuring functionality:\r\n  * Folders\r\n  * Subfolders\r\n  * Tagging\r\n* Can import/export notes (folders)\r\n* Web clipper\r\n* Free (or at least not expensive)\r\n\r\nThat's about it. Not too much to ask. Usually, you would expect that one would begin listing all the negatives of most projects and why they don't fit the criteria. I don't want to do that, or at least I don't want to start with that. Instead, I want to focus on why I think Joplin is the tool that you should use, or at least give a try.\r\n\r\n## Structure\r\n\r\nJoplin has its basics in a solid-state. You are free to create a structure that suits you best. This is mine:\r\n\r\n![4965ab17cbd441739616b97391b0fe04.png](https://dj-pw-static.s3.amazonaws.com/media/images/uploads/2020/02/05/ed13ecad2f-4965ab17cbd441739616b97391b0fe04.png) \r\n\r\n* Create **folders, sub-folders, sub-sub-folder**, and so on.\r\n* If you are a fan of **tagging**, that is pretty simple to do in Joplin. \r\n\r\n> Personally, I don't do tags. I just don't understand them. \r\n\r\n* There is a **Web clipper** plugin for most browsers. \r\n* If you are migrating from/to Joplin, it has robust features for that. You can quickly **export** your notes, folder, subfolders, or the whole account to Markdown, JSON, CSV, and other formats. You can similarly **import** those formats into Joplin. \r\n\r\n## Open Source \r\n\r\nOne of the most significant advantages, in my opinion, is that this piece of software is [open source](https://github.com/laurent22/joplin). This means:\r\n\r\n* It is **free**\r\n* It **belongs to the public**, no one is sharing your data\r\n* If it is popular, then you get a lot of different people working on it, continually improving the product. (It currently has 12.4k stars on Github)\r\n* If you know how to code you can easily add functionality that you need\r\n* If you run into a bug or some sort of error, there will be someone who can help you. There are a [ton of forums](https://discourse.joplinapp.org/)and issue trackers.\r\n\r\nOne of the recent news from the Joplin core team was that they will participate in [Google's Summer of Code 2020](https://joplinapp.org/gsoc2020/). To me, this indicates further improvement. This means long term sustainability. \r\n\r\n## Data Ownership\r\n\r\nThe way Joplin works is simple. You install an app and start taking notes. Notes are saved in your computer. No servers. If you need to access through a different device, you simply connect to Dropbox. You own the data!\r\n\r\nActually, there are a lot of sync options, besides Dropbox. Additionally, adding more options is in the roadmap.\r\n\r\nIf you don't need to sync between devices, you can simply host it on your computer. All the contents are stored in a folder. It is extremely easy to setup.\r\n \r\n## Multi-device\r\n\r\nWe already covered the fact that you can sync via Dropbox and other similar solutions. The cool thing is that there is a functioning app for every major platform.\r\n\r\nThe only platform that Joplin is not on is the Web. \r\n\r\n## Custom, yet simple\r\n\r\nEach entry can be a \"Note\" or a \"Todo.\" These are very similar, but the Todo allows you to check the entry off to be hidden but saved.\r\n\r\nYou can easily convert between the two modes without fear of losing data or breaking anything.\r\n\r\n## CLI\r\n\r\nIf you are a fan of doing everything in your command line, Joplin has integration for that too. I realize that this is not for the general public. However, if you are an enthusiast and love using computers through a Terminal, then this could undoubtedly be a feature you enjoy. \r\n\r\n## Use cases\r\n\r\n### Writing\r\n\r\nI personally find Joplin perfect for writing blog posts. Recently, I have been exploring various tools to build up a writing habit.\r\n\r\nI tried services that let you write, draft, and post in the same interface as [Ghost](https://ghost.org/). I tried online tools like [Notion](https://notion.so), [Coda](https://coda.io/welcome), and [DraftIn](https://draftin.com/). But currently, I've stopped my searches. I'm using Joplin full time. I like it for its simplicity and reliability.\r\n\r\nI can simply weep out my phone whenever I have a thought. It doesn't matter if I have internet access, it's just ways going to work.\r\n\r\nI am actually writing this post in Joplin.\r\n\r\n![0d0d25a6a4ae4868aebb2441ebb15473.png](https://dj-pw-static.s3.amazonaws.com/media/images/uploads/2020/02/05/5fc2a3b6d8-0d0d25a6a4ae4868aebb2441ebb15473.png) \r\n\r\n### Project Management\r\n\r\nIf you work in a big team, tools like [Basecamp](https://basecamp.com/) and [Asana](https://asana.com) are probably the way to go. However, if you are a single maker, like me, Joplin is going to be perfect for you. \r\n\r\nThis is my current setup for projects:\r\n![d51dae93b9a74727a314ab52434a723a.png](https://dj-pw-static.s3.amazonaws.com/media/images/uploads/2020/02/05/a91d8b1e5e-d51dae93b9a74727a314ab52434a723a.png) \r\n\r\nAs you can see, I have a separate folder for the project, which has a bunch of subfolders for each specific project. After a couple of iterations, I ended up with 3 more subfolders for each project (it might change a little in the future). \r\n\r\nOne folder is to note all the ideas I might have for a given project. The other two folders are for short-term and long-term tasks. Essentially this is a simple separation between tasks that will take a while and tasks that are quick to complete.\r\n\r\nI find that there is no need for a kanban style of management. This is super simple yet effective. \r\n\r\nYou might prefer to work with a tool like Trello, and that would be perfectly fine. In my case, for the sake of keeping everything under one roof and for the purpose of simplicity, I keep everything in Joplin.\r\n\r\n\r\n### To-do lists\r\n\r\nYou can have to-do lists that are set up in two ways.\r\n\r\n1. Have a folder where you keep to-do style notes only. Like so:\r\n\r\n    ![4c1c2027665a42c48e92d01dfaaf3fc3.png](https://dj-pw-static.s3.amazonaws.com/media/images/uploads/2020/02/05/741ec53ef2-4c1c2027665a42c48e92d01dfaaf3fc3.png) \r\n\r\n    Check them off once you are done, and that's it, they will disappear (of you tell the program to do that).\r\n\r\n2. Within a note use Markdown syntax for checkboxes, `\"- [ ]\"`. \r\n\r\n![60b5d255afbc494a8b75773bee7f81a2.png](https://dj-pw-static.s3.amazonaws.com/media/images/uploads/2020/02/05/52f494d835-60b5d255afbc494a8b75773bee7f81a2.png) \r\n\r\n> I don't use method two. I find it time-consuming.\r\n\r\n\r\n## Conclusion\r\n\r\nThat's it. That is all there is to Joplin. \r\n\r\nIf you are still in search of an excellent and straightforward note-taking application, I encourage you to check out Joplin. If I have convinced you that will make me very happy. If you are a developer, I highly encourage you to join the ranks of people who help develop this tool. If you are not a developer, you can also help. Let people know (on the [forum](https://discourse.joplinapp.org/) or on [github issues](https://github.com/laurent22/joplin/issues))\r\n\r\nThere are a ton more features I have yet to explore. Whenever I find anything else useful, I will update this post and will send you an update if you are subscribed.\r\n\r\nThanks for taking the time to read this. I really appreciate your time. If you have any comments or suggestions, please [email me](mailto:me@rasulkireev.com) or comment on [twitter](https://twitter.com/rasulkireev/status/1225152107487137792).\r\n\r\nHave a great day.",
        "word_count": 1245,
        "day_of_the_week": "Wednesday"
    },
    {
        "title": "Adding a dictionary to a list of dictionaries",
        "date": "2020-02-13T17:20:15-05:00",
        "category": "Python",
        "description": "I have encountered a problem where I was not able to append a dictionary to a list. In this post, I will explore this issue and show how to bypass that.",
        "body": "In my most recent project, I have encountered a problem where I was not able to append a dictionary to a list using `list_data.append(data_dict).` The result was a list of the same dictionaries.\r\n\r\nIn this post, I will explore this issue and show how to bypass that.\r\n\r\n## Setup\r\n\r\nJust so that we are on the same page, this is my setup.\r\n\r\nI am parsing a page that has an entry for each day of each month.\r\n\r\n```\r\n<div id=\"january\">\r\n    <h2>January</h2>\r\n    <p class=\"subtitle\">1</p>\r\n    <p>blah</p>\r\n    \r\n    <p class=\"subtitle\">2</p>\r\n    <p>blah blah</p>\r\n    \r\n    <p class=\"subtitle\">3</p>\r\n    <p>blah blah blah</p>\r\n    etc...\r\n</div>\r\n\r\n<div id=\"february\">\r\n    <h2>February</h2>\r\n    <p class=\"subtitle\">1</p>\r\n    <p>blah</p>\r\n    \r\n    <p class=\"subtitle\">2</p>\r\n    <p>blah blah</p>\r\n    \r\n    <p class=\"subtitle\">3</p>\r\n    <p>blah blah blah</p>\r\n    etc...\r\n</div>\r\n\r\n```\r\n\r\nI want to parse this info into a dictionary that will look like that:\r\n\r\n```\r\n[{'month': 'January', 'day': '1'},\r\n {'month': 'January', 'day': '2'},\r\n {'month': 'January', 'day': '3'}]\r\n```\r\n\r\nThe code below was my first attempt to get this:\r\n\r\n```python\r\nfrom bs4 import BeautifulSoup\r\n\r\ndata = []\r\nday_dict = {}\r\nmonths = ['january', 'february','march',...]\r\n\r\n# go through each month in the month list\r\nfor month in months:\r\n    month_block = soup.find(id=month)\r\n    month_name = month_block.find('h2').string\r\n    \r\n    days = []\r\n    # going through each day in a month\r\n    for i in month_block.find_all(class_=\"subtitle\"):\r\n        \r\n        day = i.string.strip()\r\n       \r\n        # adding info about current day to a dictionary\r\n        day_dict['month'] = month_name \r\n        day_dict['day'] = day\r\n        \r\n        # adding the dicitonary to a list\r\n        data.append(day_dict)\r\n```\r\n\r\nThis resulted in the `data` list to look like that:\r\n```\r\n[{'month': 'December', 'day': '31'},\r\n {'month': 'December', 'day': '31'},\r\n {'month': 'December', 'day': '31'}]\r\n```\r\n\r\nIt was essentially saving the last dictionary over end over. \r\n\r\n\r\n## Solution\r\n\r\nThis is going to be pretty straightforward, actually.\r\n\r\nYou will need to save a \"copy\" of the current dictionary, rather than a reference to an original dictionary. The way to do that is to use `.copy()` method.\r\n\r\n```python\r\n    data.append(day_dict) # Replace this line with the next one\r\n    data.append(day_dict.copy())\r\n```\r\n\r\nIf need any help, have any question or comments please let me know at my [email](mailto:me@rasulkireev.com) or on [this twitter post](https://twitter.com/rasulkireev/status/1228083171092238337). Hope this was helpful. Thanks for reading.",
        "word_count": 340,
        "day_of_the_week": "Thursday"
    },
    {
        "title": "Get data to your home page with Django",
        "date": "2020-02-20T12:37:05-05:00",
        "category": "Django",
        "description": "In this post I show how to use get_context_data(). You might need it to display \"latest posts\" on your \"home page\".",
        "body": "When I was first learning Django, I decided to build a personal website first. I took [sivers.org](https://sivers.org) as an example. I loved its simplicity and directness. \r\n\r\nI first created a blog app within my project. Then created the URL structure. `/writings/` listed all my posts and `/writings/<slug>` was for a specific post. Everything was working correctly. The next challenge was to get the latest n posts to my home page. That took me at least a week to figure out. The worst thing was that the way I did it was way too complicated. I used custom template tags to achieve that. \r\n\r\nI wanted to write a post about it back then. Thank God I didn't. Last week I figured out a much simpler way to do that. This is what this post is about. \r\n\r\n## Setup\r\n\r\n### Blog app\r\n\r\nLet's say you have a simple project setup with two apps, `pages` for static pages, and a blog for all the posts that you write.\r\n\r\nYou blog app contains a simple post model, with the following variables:\r\n\r\n```python\r\nclass Post(MentionableMixin, models.Model):\r\n    title = models.CharField(max_length=200)\r\n    body = models.TextField()\r\n    date = models.DateTimeField()\r\n    category = models.CharField(max_length=100)\r\n\r\n    # if you are not sure what the code below does, don't worry about it.\r\n    def __str__(self):\r\n        return \"(Draft = \" + str(self.draft) + \") \" + self.category + ': ' + self.title\r\n\r\n    def get_absolute_url(self) -> str:\r\n        return reverse('post', kwargs={'slug': self.slug})\r\n```\r\n\r\nNext, you have two views, one for a list of posts and one for the post itself.\r\n\r\n```python\r\nclass PostListView(ListView):\r\n    model = Post\r\n    template_name = 'writings/posts/all-posts.html'\r\n    ordering = '-date'\r\n\r\nclass PostDetailView(DetailView):\r\n    model = Post\r\n    template_name = 'writings/posts/post.html'\r\n```\r\n\r\nYou have those views attached to specific URLs like so:\r\n\r\n```python\r\nurlpatterns = [\r\n    path('posts', PostListView.as_view(), name='all_posts'),\r\n    path('posts/<int:pk>', PostDetailView.as_view(), name='post'),\r\n]\r\n```\r\n\r\nThis is your blog app. The very plane, almost identical to other \"Make your blog tutorials\":\r\n\r\n* by [skysilk](https://www.skysilk.com/blog/2017/how-to-make-a-blog-with-django/)\r\n* by [djanorocks](https://www.djangorocks.com/tutorials/how-to-create-a-basic-blog-in-django/)\r\n* by [codespeedy](https://www.codespeedy.com/how-to-create-a-basic-blog-website-in-django/)\r\n\r\nIf you are starting out I strongly recommend going through [DjangoGirls](https://djangogirls.org/) [tutorial](https://tutorial.djangogirls.org/) and [Will Vincent's tutorials](https://wsvincent.com/) and [books](https://learndjango.com/books/).\r\n\r\n### Pages app\r\n\r\nIf you have read basic tutorials by [William Vincent](https://wsvincent.com/), then this will be familiar. If you haven't, I strongly suggest it. He has a lot of posts on his [website](https://wsvincent.com). Even better are his [books on Django](https://learndjango.com/books/). Those have been a priceless resource for me when I was learning Django (I still am). \r\n\r\nIn any case, for the static pages, William suggests to set up a 'pages' app. No need to write models. You will have views and URL routing. \r\n\r\nYour project urls.py will route to the pages app like so:\r\n\r\n```python\r\nurlpatterns = [\r\n    path('', HomePageView.as_view(), name='home'),\r\n    path('about/', AboutPageView.as_view(), name='about'),\r\n]\r\n```\r\n\r\nAnd your pages app views.py will look like the so:\r\n\r\n```python\r\nclass HomePageView(TemplateView):\r\n    template_name = 'home.html'\r\n\r\nclass AboutPageView(TemplateView):\r\n    template_name = 'about.html'\r\n```\r\n\r\n## Getting context\r\n\r\nAt last, we can actually work on the problem at hand. \r\n\r\nAll you have to do is:\r\n1) import the Post model from the blog app \r\n2) add get_context method to your homepage TemplateView\r\n\r\nThat's it. Now your views.py looks like this:\r\n\r\n```python\r\nclass HomePageView(TemplateView):\r\n    template_name = 'home.html'\r\n\r\n    # new \r\n    def get_context_data(self, **kwargs):\r\n        context = super().get_context_data(**kwargs)\r\n        context['posts'] = Post.objects.filter(draft=False).order_by('-date')[0:5]\r\n\r\n        return context\r\n```\r\n\r\nWhat you can do now is use the name you've given to the new context in the templates. In you home.html all you have to do is to add a for loop like so:\r\n\r\n```python\r\n{% for post in posts %}\r\n  <a href=\"{% url 'post' post.pk %}\">\r\n      <p>{\\{ post.title }\\}</p>\r\n  </a>\r\n{% endfor %}\r\n```\r\n\r\nYou will now get the list of all the posts. \r\n\r\n## Conclusion\r\n\r\nBefore I used a very complicated method to achieve the same result, I honestly don't even want to tell anyone about it. This is a much more straight forward, much more elegant solution. It requires much less additional code written.\r\n\r\nOne thing I felt when I was writing this post is a worry that people are reading this need more context. I think I will end writing a \"Definitive guide to start a Django project.\" That way, in the future, I can always refer to the structure that already exists, as opposed to starting fresh every single time. \r\n\r\nIf you agree, please let me [know](https://twitter.com/rasulkireev/status/1230974745644060678). If you disagree, still, please let me know. If you have any questions, please let me know.\r\n\r\nI hope this was helpful. Thanks for reading.",
        "word_count": 728,
        "day_of_the_week": "Thursday"
    },
    {
        "title": "Stop telling me to exercise: dealing with a mild short-term depression",
        "date": "2020-03-10T07:58:45-04:00",
        "category": "Personal",
        "description": "In this post, I wanted to share some of my reflections on the depressive state that I went through. I'd like to share some of my thoughts that were running through my head and what helped me get over",
        "body": "The beginning of 2020 was not perfect for me. Right at the start of 2020 (literally, first hour), I started feeling a little sick. On the next day, I woke up with a high fever. Around the 10th of January, with a lot of help from my wife, I was able to fight the disease. \r\n\r\n> I think that my boss got sick because of that and was not able to spend time with his newborn child. I feel terrible because of that. So, Alan, if you are reading this, I am sorry. \r\n\r\nThen, the rest of the month I spent in a mild depression. It was the worst mood and the hardest time I've had in my life, psychologically. To be honest with you, I still don't fully understand why. I have been under mild stress due to a whole bunch of reasons, the main one is financial instability, of course. I have a feeling this might be one of the most popular reasons for sadness. This has been going on for a while, but mostly my mood has been fine, more or less. I guess something happened that sent me to the rock bottom, psychologically speaking.\r\n\r\nI am okay now. In fact, I am better than before. Much better. I now wake up super early, which I was never able to do. I exercise almost every morning. I work on my personal projects before I go to work. I eat healthy foods. I have a great relationship with my wife. Everything seems to be going fine now.\r\n\r\nIn this post, I wanted to share some of my reflections on the depressive state that I went through. I'd like to share some of my thoughts that were running through my head and what helped me get over the sadness. I hope this is useful.\r\n\r\n## Common Advice\r\nI want to start with a brief list of things that one might find when searching the web for \"How to deal with Depression.\"\r\n\r\n\r\n### Exercise\r\nIt can be very annoying to search online for a solution and get the same advice over and over. Exercise, exercise, exercise.\r\n\r\nWill you stop, please? Look, I know exercise is good. In fact, I like to exercise, it makes me feel good. But, when you are depressed, you don't want to exercise. You really don't. If, during my depressive state, I do have a glimpse of hope and light, I will exercise. Will it make me feel better? Probably. Will it solve my bigger problem? It won't! It won't because solutions like exercise work only when done regularly. You can't expect a person dealing with mood swings to exercise regularly. It just does not work that way.\r\nWhat will happen to a depressed person who was told to exercise, but failed to do that? It will only lead to a worse condition.\r\n\r\nExercise is great. Everyone knows exercise is great for your body and mind. However, it is only great for a person who is not struggling with too many things at ones. Please, stop recommending people exercise when they are depressed. It is not a solution to the problem. \r\n\r\n### Meditate\r\n\r\nThe problem here is the same. I know it is good for me. In my case, I actually enjoy it. But in times of great sadness, I can't make myself do it.\r\n\r\n\r\n## Fighting the battle\r\n\r\nEvery single fucking day, I had to battle myself, my mood. Most of the time, I win the battle, but many times I don't. The only solution to this is not to have one at all. If you think about it, no human can win each time they fight something. It is impossible, you won't have the stamina to do that, and eventually, you give up. So, the only solution that comes to mind is not to have the battle at all. \r\n\r\nThe only problem with that is that it is easy to say that, but hard to do. When you are depressed, it doesn't feel like you have much control over your body, over your thoughts. So what should you do?\r\n\r\n### Go easy on yourself\r\n\r\nLook, I'm no doctor, I don't know what the cause for your sadness/depression is. For me, it was that I took on too many projects, too many responsibilities. \r\n\r\nOne thing that helped me was going easy on myself. After a couple of days of beating myself up, I decided to drop half of my projects, half of my attempt to build good habits, it was too much.\r\n\r\nI made sure to enjoy junk food, even after finishing it. I tried really hard not to worry about watching too much television. I stopped worrying about missing exercise for a week. I decided to drop all my worries and enjoy whatever it is I was doing. In a lot of cases, it was nothing, just sitting on a sofa eating junk food.\r\n\r\nThat helped me a lot. Now, I'm back on track to build some good habits, but this time I'm making sure not to overdo it. Taking a step at a time.\r\n\r\n### Other people\r\n\r\nAnother useful tool that helped me get my mood, my desire to do things back was listening to other people. In my case, those people were Jordan Peterson and DHH. \r\n\r\nJordan Peterson has some incredibly useful and insightful thoughts on leaving a good life and on depression specifically. A couple of videos of his lectures I found on YouTube have been crucial in my recovery.\r\n\r\nDHH is one of my role models. I find that most of his thoughts and beliefs that he shares align with mine. Whenever I lose track of who I am and what is important for me, I will listen to one of his podcasts, and it will almost certainly make me feel better and more strong.\r\n\r\nI recommend that you find people that inspire you, and that makes you remember who you are and what it means to be a good person.\r\n\r\n## Some resources that helped me\r\n\r\n### Jordan Peterson - [How To Deal With Depression | Powerful Motivational Speech](https://www.youtube.com/watch?v=Xm_2zmX6Akc)\r\n\r\n#### 5:00 - 7:00\r\n* You want to constraint the negative event to the smallest domain possible.\r\n\r\n> It is going to be hard, no question about that. But it is crucial to try your best to limit the damage a negative event has. For example, when your recent side project had no traction, it does not mean you are a failure. It only means that this idea is not the one to bring you success.\r\n\r\n> Another example of this is talking to your partner. When you argue, try your best to limit the exposure to a minimum. Instead of saying, \"you always do this,\" say, \"can you please try doing this next time.\" If you are nice about it, they might listen. Whatever the outcome is, it is a ton better than blaming them for everything.\r\n\r\n#### 14:00 - 18:00\r\n* Have a routine.\r\n* Eat breakfast, eat well, enough.\r\n* Have family (parents, partner, kids) in good standing. \r\n  * Listen to your partner, they will tell what they want.\r\n \r\n  \r\n### Jordan Peterson - [Advice For People With Depression](https://www.youtube.com/watch?v=6c9Uu5eILZ8)\r\n\r\n#### 01:00 - 03:00\r\n* Having a job (a necessary repetitive task) is helpful. It will get you in a routine. If you don't have that, you don't have a good reason to go to bed. You don't have a good reason to wake up. That is big to cause depression in a lot of people. \r\n\r\n> Not having a set schedule for sleep and other things mess up your Circadian rhythms.\r\n\r\n* Positive emotions are not that secret. Having a calling, accomplishing small things will make you happy. Experience makes people happy, much more than purchases do.\r\n\r\n#### 03:00 - 05:00\r\n\r\n> Having many problems at once makes you almost impossible to help. For example, if you have no job, friends, and relationship. Dealing with one problem is not helpful, because others pull you down. \r\n\r\n* Get a job, even if not a dream job.\r\n* Get out there and talk to people.\r\n* Become more intimate with someone.\r\n\r\n#### 4:00\r\n* Learn to negotiate with yourself. \"What are you willing to do?\" What you should be willing to do is something small. Assuming you want to do better, there is always something small you can do to get closer to your final goal. If you repeat that often enough, those small going compound into something incredible.\r\n\r\n\r\n### DHH  - [Developer on Fire Interview](https://developeronfire.com/podcast/episode-030-david-heinemeier-hansson-the-pareto-principle-and-stoic-philosophy)",
        "word_count": 1426,
        "day_of_the_week": "Tuesday"
    },
    {
        "title": "Designing your first personal website",
        "date": "2020-03-18T13:32:50-04:00",
        "category": "Design",
        "description": "When I started developing my personal website I've had some difficulties. In this post I try to share what you should do to avoid those.",
        "body": "Ever since I decided to make my own personal website, I have been struggling with the design a lot. \r\n\r\nAt first, it was about a lack of knowledge. I didn't understand what is meant by mobile-first and how you achieve that. The concept of padding vs. margin was weird to me. Basically, I knew nothing about designing a website. It is a shame I don't have an image of my first website, it looked so bad, it was funny.\r\n\r\nWhat helped me the most is looking at other websites. To be more precise, looking at the HTML/CSS code of their website using \"Element Inspector.\" I strongly recommend anyone interested in building websites do this. Just inspect websites you like and try to implement some cool features on yours.\r\n\r\nOne problem with this approach is mimicking too much. When I liked a website, I liked both the design and the content. So when I was making mine, I always thought, \"Ooh, that's cool; I need that feature too.\" I ended up doing too many things, and the website became bloated. I made a bunch of features I did not use. \r\n\r\nIf you are starting in the world of web development by building your personal website, here is my recommendation. Have four types of pages (that way you don't have to worry about design too much):\r\n\r\n* Home \r\n* About\r\n* Blog (all writings)\r\n  * Actual post\r\n\r\nThat's it, you don't need more to begin, it will make your life easier and more manageable. When you are happy, add another page, for example, \"What am I up to Now\" page or book notes, or whatever else your heart desires. \r\n\r\nThen in the future, when you realize that you need more features on your website, you can easily add them. The difference is that by then, you are much more experienced.\r\n\r\nFinally, however experienced you are, don't add too many things that will require regular maintenance unless you are 100% you are committed to it. For example, when I created my first Django website, I added the following:\r\n\r\n  * a Blog\r\n  * What am I up to Now (Derek Sivers movement)\r\n  * What I learned This Week\r\n  * Book Reviews \r\n  * Projects\r\n  * Photography\r\n\r\nThese are only the ones I can remember. I just loved the idea of having that space to fill, but pretty quickly, it became overwhelming, and I ended up not doing anything. Only once I've started removing things, I began to use other features. \r\n\r\n> I think this is a good approach to life also. Don't try to take on too many things at once.\r\n\r\nOnly add more things when you already have something to show for, and only if you know, you will keep it going. Right now, I only have the Blog and the Now page, where the latter is updated once a month. This way, I'm not pressured to do other things and can focus on something more substantial.\r\n\r\nIn the future, I want to add a photography page, because it is something I want to become better at, and am currently learning. However, unless I am consistent with it, I won't \"burden\" myself by adding it to my website.\r\n\r\n## Conclusion\r\n\r\nIf you are just starting on a Web Development path and are starting with your website, congratulations, you have a fantastic road ahead of you. Not to get discouraged pretty quickly, stick to simple things.\r\n\r\n#### 1. Keep content to a minimum:\r\n\r\n  * Have a welcome page (home)\r\n  * Have a page where you talk about yourself (about)\r\n  * Create a blog with a list of all the posts and a detailed view for each post (blog)\r\n\r\n#### 2. Keep your design simple.\r\n\r\n  * Start with pure and simple CSS. Make sure it looks good on the phone first.\r\n  * Move one step at a time.\r\n\r\n#### 3. Add new things as a means of learning something new.\r\n\r\n  * Learning new things won't become any easier (in a good way), but the base things you did before will become a breeze.\r\n\r\nI hope this was at least a little bit useful. Actually, I hope this made at least a little bit of sense.\r\n\r\nIf you have any questions or comments, feel free to shoot me a message at one of the links on the about page. \r\n\r\nThanks for reading. If you have any comments please let me know on [Twitter](https://twitter.com/rasulkireev/status/1240339394319527936)",
        "word_count": 736,
        "day_of_the_week": "Wednesday"
    },
    {
        "title": "My Pocket Workflow",
        "date": "2020-03-22T17:32:26-04:00",
        "category": "Productivity",
        "description": "I wanted to discuss how I use Pocket and how it integrates into the BASB flow.",
        "body": "I have been slowly implementing \"[Building a Second Brain](https://www.buildingasecondbrain.com/)\" (BASB) technique into my personal life. I'm doing this slowly, step-by-step. For me, any past attempts to make my life more productive, with Evernote, Pocket, or other tools, have been a failure because they have been too overwhelming. More than that, I did not have a great starting point, I had to design my flow from scratch. \r\n\r\nThis time around, I have [Tiago Forte](https://fortelabs.co/) and [David Perell](https://www.perell.com/), their learnings and writings have been an enormous inspiration. They both have courses that seem great and totally worth it. For me, the price point is a little out of my range (for know). Luckily, they have been putting a lot of content out there. That content is so valuable, it makes me wonder what do they offer during their course. I am preparing a consolidated list of links, articles, videos, and other types of resources that those two have put out there. Stay tuned. \r\n\r\nToday, I wanted to discuss how I use Pocket and how it integrates into the BASB flow.\r\n\r\n## Method\r\n\r\nIt is actually pretty simple. After I finish the article, I assign it a tag, \"read.\" This allows me to see all the articles that I have finished.\r\n\r\n![Read articles in Joplin](https://dj-pw-static.s3.amazonaws.com/media/images/uploads/2020/03/20/ca7f84dab9-pocket-read.png) \r\n\r\nI then transfer all the notes and summarizations to Joplin.\r\n\r\n> Joplin is very simple to Evernote, but with a few differences. Most importantly, it is open-source, which means it is free and is being developed and improved by a lot of people. I go into more detail on Joplin in [my post](https://rasulkireev.com/writings/joplin).\r\n\r\nAfter I am done transferring highlights, I assign that post a \"Joplined\" tag (totally made-up word).\r\n\r\n![Joplined articles](https://dj-pw-static.s3.amazonaws.com/media/images/uploads/2020/03/20/df8a969074-pocket-joplined.png)\r\n\r\n\r\n## Conclusion\r\n\r\nThis is not some sort of revolutionary method of note-taking. This is a simple flow I ended up using to make sure that my Pocket articles are not mixed together, and it is easy to navigate. \r\n\r\nI think this is the best way of using tags. I never found the use of assigning tasks like \"productivity,\" \"writing,\" or something like that. There is a search button for that.\r\n\r\nI hope this was useful. If you have any thoughts or comments, please let me know [here](https://twitter.com/rasulkireev/status/1241842478564749314) :) Thanks in advance.",
        "word_count": 374,
        "day_of_the_week": "Sunday"
    }
]