Skip to content

Instantly share code, notes, and snippets.

View nikAizuddin's full-sized avatar
⚠️
s t a t i c

Nik Mohamad Aizuddin nikAizuddin

⚠️
s t a t i c
View GitHub Profile
@nikAizuddin
nikAizuddin / nestedStruct_linkedList.c
Created December 11, 2014 14:05
ANSI-C: Nested structure in Linked List.
/**
* ANSI-C: Nested structure in Linked List.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct subject_t {
char name[32];
} subject_t;
@nikAizuddin
nikAizuddin / compare_float.sh
Last active August 29, 2015 14:11
How to compare float numbers
#!/bin/bash
#=====================================================================
# FILE: compare_float.sh
#
# USAGE: bash compare_float.sh
#
# DESCRIPTION: This script shows how to compare float numbers.
#
# REQUIREMENTS: ---
# BUGS: ---
@nikAizuddin
nikAizuddin / oreilly-freebooks.sh
Last active October 20, 2020 03:34
This UNIX Shell script will download most O'Reilly free pdf books about Programming, Security, Business, Data, Design, IoT, WebDev, and WebOps from http://www.oreilly.com/programming/free/.
#!/bin/sh
################################################################################
## This UNIX Shell script will download most O'Reilly free pdf books
## about Programming, Security, Business, Data, Design, IoT, WebDev, and WebOps
## from http://www.oreilly.com/programming/free/.
## There are a few books that are non-free, so I don't list them here.
##
## --- How to RUN? ---
## $ sh -e oreilly-freebooks.sh
@nikAizuddin
nikAizuddin / bfgs_example_1.c
Created February 8, 2017 17:12
Minimize a quadratic function f(x) by using BFGS algorithm.
/* 1 2 3 4 5 6 7
345678901234567890123456789012345678901234567890123456789012345678901
+--------------------------------------------------------------------
| BFGS Example 1
+--------------------------------------------------------------------
| This example is based on Example 11.4 from
| "Introduction to Optimization" book written by Chong, Edwin K.P.,
| and Stanislaw H. Zak.
|
| We are going to minimize this quadratic function f(x) by using
@nikAizuddin
nikAizuddin / knuth_books.sh
Created May 23, 2017 03:36
UNIX Shell script to download four volumes of The Art of Computer Programming by Donald E. Knuth.
#!/bin/sh
################################################################################
## ##
## The Art of Computer Programming by Donald E. Knuth. ##
## ##
################################################################################
## Volume 1 - Fundamental Algorithms, 3rd Edition
#!/bin/sh
##==============================================================================
## PROBLEM STATEMENT
## -----------------
## Currently, transfering files between FreeBSD 10.3 computer and iPhone 6
## (IOS 10.3.3) causes Input/Output errors. The errors are randomly occured
## during the file transfering process. Whenever the error occured, the file
## transfering process will fail and the computer is required to re-mount the
## iPhone again before resuming the file transfering.
@nikAizuddin
nikAizuddin / kmeans-img_compression.m
Last active October 22, 2018 00:10
Image compression using KMeans
%% Global configurations.
SOURCE_IMAGE = 'lena.png';
N_CENTROIDS = 3;
%% Load source image and pre-processed for KMeans.
src = imread(SOURCE_IMAGE);
@nikAizuddin
nikAizuddin / main.py
Created October 28, 2019 14:39
[Tensorflow/Keras] Example how to measure average time taken per batch
# -*- coding: utf-8 -*-
"""Example how to measure average time taken per batch.
"""
import time
import numpy as np
import pandas as pd
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Input, Dense
"""Download Free Springer books.
Requirements:
* Make sure you have Python 3.7. It is recommended that you use Python from Anaconda.
* Download chromedriver https://chromedriver.chromium.org/downloads and extract it
into the same directory as this script.
How to Execute:
$ conda create --name springer-download
$ conda activate springer-download
@nikAizuddin
nikAizuddin / podman-installation-on-ubuntu-2004-wsl2.md
Last active January 26, 2025 20:59
Podman Installation on Ubuntu 20.04 WSL2

Podman Installation on Ubuntu 20.04 WSL2

Execute the following command to install Podman:

sudo apt update
sudo apt install ca-certificates
. /etc/os-release
echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/Release.key | sudo apt-key add -
sudo apt update