Illustration by Jinhwa Jang

Recently, I read a short story by Ted Chiang, who is a literary genius in hard science fiction. If you have an eye for scientific correctness in literature more than an average reader, the story is worth to give a try. Modern science has long been departed from philosophy, we don’t encounter modern scientists who explore the philosophical side of things which we encountered in works of medieval and ancient sources. Therefore, all our hopes lie on hidden gems in literature, which combines these two without significant frictions and compromises. The most fascinating thing about such works is, it is…

Source: Ali Abdaal

Everyone loves Notion. Writing in Notion is an ultimate pleasure if you have an eye for simple but elegant design. However, what you type in Notion stays in Notion, unless you make it as a public link.

In May 2021, Notion has released its first API with an SDK for Javascript. The use case is simple, one can fetch pages, databases and users with the new API without the need of a scraper. Now, this raises an inspiration : what if we can use Notion as a CMS for our websites without the need of creating an admin panel?


Photo by Chris Lawton on Unsplash

Implementing enum in Python is not that hard. But when you have a populated database and you want to change a type of column to enum, there are multiple things can go wrong. In this post I will go through steps how one can change a column of string type to enum without damaging current state.

Let’s say we have a form in the web page for user. The form is backed with table user_info with a column employment_type. The form should have 3 choices and user should choose one : Employed, Not employed, Entrepreneur.

What we did initially was…

Photo by Erika Fletcher on Unsplash

Democracy is acting like a double edged sword. Pluralism and the majority rule has been advertised as the modern paradise, however, democracy itself is a paradox: handling the destiny of an outcome to the hands of many has already proved its unethical consequences many times through history:public shaming or cyber bullying nowadays should not surprise anyone considering our ancestors’ enthusiasm to sentence the gladiator to death within a flip of a thumb.However, some pages in the history are still surprising in their level of brutality. For example, the rise of Nazi party in Germany.

If we ping a random German…

Photo by Mirah Curzer on Unsplash

One of the most used method used in opinion polls is dividing the sample for different stratums — can be done for different nationalities, age groups and etc. The reasoning is simple: when random polling is done within each group, experiments yield more accurate results with less number of observations(people) involved. Today, we will apply same technique to option pricing with Monte Carlo simulations in order to reduce computation time.

First, let’s start with a simple example : Calculate integral with Monte Carlo simulations (which is not a very appropriate usage of MC, but we will use it as an…

Photo by David Werbrouck on Unsplash

In this post I will discuss different variance reduction methods applied to option pricing theory with the help of Monte Carlo simulations.

There are different methods to improve efficiency of Monte Carlo simulations. One way is to increase the number of experiments, n. It is obvious that increasing n will lead to convergence of error size to 0, however, it comes with a tradeoff in computational time.

Let’s denote confidence level alpha as a constant in 0.05.

Photo by Priscilla Du Preez on Unsplash

For human beings IQ can be the measure of intelligence, but for chatbots it’s vice versa: the more friendly, humble, empathetic and social the chatbot gets, smarter it is considered.

Why so? What does smarter mean? What metrics do we use for smartness?

It seems like, the more engaging it is, it is better. However, people don’t like to engage in smart creatures, instead, they a looking for confirmation, affirmation and acceptance. People need to feel special and loved. Like dogs. That’s when out chatbot comes in.

Photo by Sam Carter on Unsplash

Rule based chatbot are kinda…not fun. Don’t get me wrong. I hate downloading apps to my phone if I can implement main functionalities from Messenger. But developing a rule-based chatbot is like a creating an application. The “fun” part is actually coming from NLP. What is the purpose of a chatbot if she cannot understand “Swear at the uncle?”

My goal in this series is exactly this. To train the bots like a homeschooled kid. To do it without any chatbot libraries. I hate schools.

In the previous post, we managed to print the POST request:

{‘object’: ‘page’, ‘entry’: [{‘id’…

Photo by Tomáš Malík on Unsplash

In this tutorial I will start implemet chatbot for messenger with Python (flask) and host it on Heroku.

I will try to keep it short and clean as possible.

In order to implement thechatbot we need :
1. Flask application running on server
2. Facebook application connected to a page

I assume you have already installed Python and have some experience with it, so I will skip the basics.

1. Create a Flask app

I begin creating my folder hotbot where I will keep all my project files. In order to have a clean experience with packages, we should create a virtual environment in this…

Photo by Roman Mager on Unsplash

Keçən dəfə kung-fu dərsində müəllim 5 dəqiqəlik ipdən (priqilka, skakalka) tullanma sessiyasına başlatdı, və onsuz da 30 dəqiqəlik qaçma, tullanma və başqa intensiv kardio hərəkətlərindən sonra 5 dəqiqə dayanmadan ipdən tullanma, hər nə qədər istirahət kimi gəlsə də, vaxt keçdikcə daha dözülməz olmağa başlayır. Sessiya bitəndən sonra tələbələrdən biri soruşdu ki, bəs bu ipdən tullanma bizim nəyimizə lazımdır, hərçənd elə bilməyin ki, sorğulayan tələbə digər idman hərəkətlərinin istifadə qaydalarına tamamilə aşina olub amma bu hərəkət qaranlıq qaldığı üçün dedi, yox, məsələ ondadır ki, ipdən tullanma tipli kiçik amma intensiv hərəkətləri qızlar daha yaxşı bacarır və bundan yaranan qıcıq da bizim…

Lala Rustamli

I talk to myself all the time.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store