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 / Disassemble Java z = ++x + ++x + ++x
Created November 12, 2014 10:14
How Java execute z = ++x + ++x + ++x
class test {
public static void main(String[] args) {
int x = 2;
int z = 0;
z = ++x + ++x + ++x;
System.out.printf("z = %d\n",z);
}
}
@nikAizuddin
nikAizuddin / Calculate age
Created November 12, 2014 16:06
Programming Technique 2014/2015 Semester 1 Labsheet 4
/*--------------------------------------------------------------------
| TITLE: Calculate age
+--------------------------------------------------------------------
| AUTHOR: Nik Mohamad Aizuddin b. Nik Azmi
| EMAIL: [email protected]
| DATE CREATED: 12/NOV/2014
| PURPOSE: My answer for the subject Programming Technique
| 2014/2015 Semester 1 Labsheet 4.
+--------------------------------------------------------------------
| LANGUAGE: C
@nikAizuddin
nikAizuddin / Lehmer's Algorithm
Last active April 12, 2019 02:46
Lehmer's Algorithm using matlab
% Lehmer's algorithm
function [] = random()
m = 13; % modulus value
x = 0:0:m-1; % will store a sequence of random number
a = 7; % multiplier
i = 0; % general-purpose counter
c = 0; % non-negative integer
p = 1; % full-period multiplier counter
temp = 0; % temporary variable
@nikAizuddin
nikAizuddin / OpenGL 2.1 Draw3D Cylinder
Last active May 16, 2023 06:39
This program will draw a 3D cylinder using OpenGL 2.1 API
/*------------------------------------------------------------------+
| |
| This program will draw a 3D cylinder using OpenGL 2.1 API |
| |
| Language: C89 strict |
| Compiler: GNU GCC 4.8.3 |
| |
| Tested on Fedora 19 64-bit and Windows 7 64-bit, |
| both works with no errors and no warnings :) |
| |
@nikAizuddin
nikAizuddin / veg.sh
Last active August 29, 2015 14:10
BCN2053 Operating System Lab Sheet 6 (BASH)
#!/bin/bash
# ==========================================================
# This script requires user to input the weight
# of the lettuce. The output of the script
# will display the total amount of price base
# on the weight (Assume that 1kg is RM2.50).
#
# Sample output will be:
#
@nikAizuddin
nikAizuddin / veg.rb
Created November 30, 2014 19:45
BCN2053 Operating System Lab Sheet 6 (RUBY)
#!/bin/ruby
# ==========================================================
# This script requires user to input the weight
# of the lettuce. The output of the script
# will display the total amount of price base
# on the weight (Assume that 1kg is RM2.50).
#
# Sample output will be:
#
@nikAizuddin
nikAizuddin / veg.pl
Created November 30, 2014 19:47
BCN2053 Operating System Lab Sheet 6 (PERL)
#!/bin/perl
# ==========================================================
# This script requires user to input the weight
# of the lettuce. The output of the script
# will display the total amount of price base
# on the weight (Assume that 1kg is RM2.50).
#
# Sample output will be:
#
@nikAizuddin
nikAizuddin / mycgpa.sh
Created November 30, 2014 19:49
BCN2053 Operating System Lab Sheet 6 (BASH)
#!/bin/bash
# ==========================================================
# This script requires user to input the name and last
# semester GPA. The output of the script will display your
# current CGPA (Assume that your current CGPA for 2 semester
# is 3.5).
#
# Sample output will be:
#
@nikAizuddin
nikAizuddin / mycgpa.rb
Created November 30, 2014 19:51
BCN2053 Operating System Lab Sheet 6 (RUBY)
#!/bin/ruby
# ==========================================================
# This script requires user to input the name and last
# semester GPA. The output of the script will display your
# current CGPA (Assume that your current CGPA for 2 semester
# is 3.5).
#
# Sample output will be:
#
@nikAizuddin
nikAizuddin / mycgpa.pl
Created November 30, 2014 19:52
BCN2053 Operating System Lab Sheet 6 (PERL)
#!/bin/perl
# ==========================================================
# This script requires user to input the name and last
# semester GPA. The output of the script will display your
# current CGPA (Assume that your current CGPA for 2 semester
# is 3.5).
#
# Sample output will be:
#