Skip to content

Instantly share code, notes, and snippets.

View fahmifan's full-sized avatar

fahmi irfan fahmifan

View GitHub Profile
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:orientation="vertical">
@fahmifan
fahmifan / TryEnumeration.java
Created November 21, 2018 00:20
example use of Enumeration type in java language
import java.util.Vector;
import java.util.Enumeration;
import java.util.ArrayList;
import java.util.List;
public class TryEnumeration {
public static void main(String args[]) {
// Enumeration accept Type T, it called Generics
Enumeration<String> days;
@fahmifan
fahmifan / TryIterator.java
Created November 21, 2018 00:23
example use of Iterator type in java language
import java.util.*;
// Try compile with `javac` & `javac -Xlint`
class TryIterator {
public static void main(String args[]) {
// create an array list
ArrayList<String> al = new ArrayList();
// add elements to the array list
@fahmifan
fahmifan / Test.java
Created December 10, 2018 14:18
Test 1 OOP 2018
class Test {
public static void main(String[] args) {
Buyer b1 = new Buyer("Miun", "Pasirlayung, Bandung");
Purchase p = new Purchase(b1);
Car t = new Truck("Hino Dutro", 120000.0, 5000.0);
p.addCar(t);
Car s = new SuperCar("Bugati", 800000.0, 300.0);
p.addCar(s);
/**
* Author: Muhammad Fahmi I.
* Github: github.com/miun173
* Year: 2018
*/
interface GeometriObject{
double getPerimeter();
double getArea();
@fahmifan
fahmifan / mhs_structs.cpp
Created March 4, 2019 15:51
Contoh Penggunaan Array of Record
/**
* Muhammad Fahmi
* 1401810160028
* Contoh Penggunaan Array of Record
* 11/03/2018
*
* Compile using : g++ -c arrayOfRecord.cpp && g++ -o arrayOfRecord.exe arrayOfRecord.o && arrayOfRecord.exe
*/
#include <iostream>
/**
* Author: miun173
* Doubly linked list
* @2019
* */
#include <iostream>
using namespace std;
struct Pembalap {
int nomor;
@fahmifan
fahmifan / Main.java
Created April 29, 2019 03:23
Kruskal code from GOG
// Java program for Kruskal's algorithm to find Minimum
// Spanning Tree of a given connected, undirected and
// weighted graph
import java.util.*;
import java.lang.*;
import java.io.*;
class Graph
{
// A class to represent a graph edge
@fahmifan
fahmifan / main.js
Created May 2, 2019 03:44
Mongodb connection nodejs
const express = require('express');
const path = require('path');
const mongoose = require('mongoose');
const router = require('./routes');
const bodyParser = require('body-parser');
const { loggerMiddleware } = require('./logger')
const app = express();
@fahmifan
fahmifan / queue.cpp
Last active May 8, 2019 04:15
Queue & Stack in cpp
#include <iostream>
using namespace std;
const int maxElmt = 10;
struct Queue {
int data[maxElmt];
int head;
int tail;
};