There are many different types of Machine Learning systems base on each criterion.

I. Criterion 1: Trained with or without human supervision.

This criterion has 4 main types: supervised, unsupervised, semi-supervised, and reinforcement learning.

  1. Supervised Learning

As the name indicates, supervised learning has the presence of a supervisor as a teacher. We train our program using data that is “well labeled” — data is tagged with the correct answer.

Classification is a typical supervised learning task. One example is the spam filter. In the training set, every email was tagged with its class (spam or not). …

I. Introduction

After few years of hearing about Machine Learning, today, I decided to start the first baby step to learn about Machine Learning. It is not because of the hot trend of machine learning at the moment when everyone talks about it. The main reason is one of my side projects may need to apply some data science in the future. And I also curious about Machine Learning for a while. So why not start?

Fortunately, I found good resources to start, and I really enjoy them. What I found below is taken from the books and courses that I follow.

I. Livedata

In 2017, Android Architecture Components was released by Google, helps Android Developer build robust, maintain, stable app. Livedata is a part in the collections of libraries introduced in Android Architecture Components.

According to Android Document:
LiveData is an observable data holder class. Unlike a regular observable, LiveData is lifecycle-aware, meaning it respects the lifecycle of other app components, such as activities, fragments, or services. This awareness ensures LiveData only updates app component observers that are in an active lifecycle state.

If you have worked with RxJava/RxKotlin before, you will find it easy to understand LiveData.

One typical case to use…

I. Problem

Pattern Searching is very popular and important problem in computer science. We usually use it every day, like search a text in a browser, or in an editor. We can simply define the problem as:

Given two string txt and pattern. Find the first occurrence of pattern in txt.

There are some algorithms can resolve this problem. Knuth-Morris-Pratt algorithm (Aka KMP Algorithm) is one of these algorithms. …

I. Asynchronize task

Fetching data from IO and then display it on the screen is a very very common task in creating software. In the Android world, there are many ways we can use to archive this task. We can use RxJava, Asyntask, etc. But, have you ever consider how these things work under the hood, how background thread in Android can make a change in the view which is only updated in the main thread?

The answer is Android using its component mainly include Looper, MessageQueue, Handler, Runnable to manage workload in each Thread. …

I. The basic of Java Thread

According to Java docs, here is the definition of Thread

A thread is a thread of execution in a program. The Java Virtual Machine allows an application to have multiple threads of execution running concurrently.

Actually, there is a direct mapping between a JVM thread and an OS thread. Every thread has its own priority. The more prioritized, the earlier thread’s execution be performed. We also can set priority to the thread by using thread.setPriority(priority) note that priority is in [1, 10]

Thread mainly have 5 state

  • Created: The thread’s instance is created
  • Runnable: Thread ready for running
  • Running: Thread…

I. Problem

In our project, we are normally using a SingleActivity for the huge scope. That activity contains sequence custom view which represents for each screen. In some screen that owns very big scope, we break it as multiples custom views.

There is so much benefit of using SingleActivity in your huge scope. But belong with the benefit we also get some problem need to be solved. One of them is how can we handle the onActivityResult when onActivityResult is only triggered in the Activity (we don’t use Fragment).

II. Thinking about solution

There was a couple of solution come up to us when we think…


Activity is an application component which provides UI for user and the users can interactive with it. Each activity has a lifecycle. Activity’s lifecycle is controlled by mainly 7 callback methods. And after each method, the activity’s state will be changed.

Activity’s State

Depend on how activity interactive with the user, it can be in one of 4 states listed below.

  1. Running: Activity is visible, in foreground and user can interacts with the activity.
  2. Paused: Activity is visible, but on in foreground and user can not interacts with the activity. …

Pi Vincii

Writing for remembering

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