Memahami Blockchain

Beberapa tahun selepas Bitcoin menjadi cryptocurrency yang diguna orang ramai, teknologi blockchain menjadi satu topik yang hangat dikaji oleh para penyelidik. Blockchain terdapat pelbagai kegunaan antara nya pendaftaran nama dan smart contracts. Kaedah konsensus seperti proof-of-work (PoW) dan proof-of-stake (PoS) juga ada diterapkan dalam teknologi ini bagi membantu prinsip decentralization…

Replacing characters in filename

A very quick snippet pasal nak replace character dan append string dalam filename menggunakan batch script. Appending string @echo off for %%a in (*.png) do ren "%%a" "ic_%%a" Where ic_ in line 2 is the string we want to append. %%a is just a variable…

Android Debug Bridge (ADB) Shell

A simple plain ADB shell command for my every day debug routine. Check for devices: $ adb devices Connect to device: a) Single device $ adb shell b) Multiple device $ adb -s <device_name> shell Pulling from remote: $ adb -s <device_name> pull <source_file> <…

ActiveAndroid Schema Migration

Today I learned something. Something other people have already learned long time ago. While I was debugging MindFuel app, I noticed that I have missed a column in one of its database table. So I go around and do some research on how to do a schema migration to add…

OCR with Google Cloud Vision API

The first part of this guide is on PHP, whereas the second part is on how to implement it in Python. Requirements Enable Cloud Vision API Generate an API key from the API console PHP Script This is how you use Google Vision API in PHP. Simply change the type…

Android Image Multi-Part Upload

This tutorial will guide you through building an app component for uploading image to a server. I'm gonna use PHP as my server side script to receive the image from the client. tl;dr Github source Prerequisite OkHttp 3.2.0 Client side First, let's create a simple UI for…

Arduino - Negaraku 1-bit Rendition

Based on Project 7 of Arduino Starter Kit, I was able to create a Negaraku melody using predefined set of note pitches. Source code // Negaraku Melody int melody[] = { NOTE_D7, NOTE_D7, NOTE_F6, NOTE_A6, 0, NOTE_A6, NOTE_A6, NOTE_C6, NOTE_E6, NOTE_F6, NOTE_AS6, NOTE_…

Nested RecyclerViews

In this guide, we'll be looking at how to implement a nested RecyclerView. We'll be having two RecyclerViews, one of it being a parent of a child RecylerView. Although it is NOT encouraged to do this in practice, but it is good to know such complex layout can be done…

Implementing RecyclerView Click Listener

Implementing item click listener on RecyclerView using Interface method. Interface public interface CustomItemClickListener { void onItemClick(View v, int position); void onActionClick(View v, int position); } Fragment ObjectAdapter objectAdapter = new ObjectAdapter(itemsList, new CustomItemClickListener() { @Override public void onItemClick(View v, int position) { Toast.makeText(getActivity(), "Card Clicked: " + position, Toast.…

RQ - Linux vs UNIX

tl;dr Linux ialah FOSS UNIX ialah proprietary. Sejarah Directly translated from Albion Untuk menerangkan Unix, lagi bagus kalau kita tengok sejarah nya. Pada tahun 1969, bermulanya kerja pembinaan UNIX oleh Ken Thompson, Dennis Ritchie dan lain lain menggunakan minicomputer PDP-7 di AT&T Bell Labs. Selama 10 tahun,…