# Method 1: md5 Hash
echo $RANDOM | md5sum | head -c 20; echo;
996e405cb0cdd2e10299
# Method 2: UUID
cat /proc/sys/kernel/random/uuid | sed 's/[-]//g' | head -c 20; echo;
c23174ce6fa149498fc7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Valid Reason to Start Structural Analysis Software Project Using Fortran | |
| 1. Trivial | |
| - It has nice printing formatting by default | |
| - Less keywords to memorize | |
| - Long life since 1966 and will be keep alive by using modern standard | |
| - Compiled and fast | |
| 2. Numerical Reason | |
| - Supports matrix operation in simple terms compared to C/C++ |
Runtime error is when you see the error in the browser development (web) console.
Cannot read properties of undefined (reading 'length')
TypeError: Cannot read properties of undefined (reading 'length')
at Module.each (/node_modules/svelte/internal/index.mjs:1735:31)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Code untuk soal BMG | |
| # Tes Logika | |
| # By Duken Marga | |
| LIMIT = 50 | |
| for i in range(LIMIT+1): | |
| # Ignore 0 | |
| if i == 0: | |
| continue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Create network | |
| $ docker network create redis | |
| Run a docker and connect to specific network exposed in Port 16379 | |
| $ docker run --name redis-docker --network redis --detach --publish 16379:6379 redis:latest redis-server | |
| Run interactive | |
| $ docker run -it --network redis --rm redis:latest redis-cli -h redis-docker | |
| Build an image |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # in search of pi=3.14... | |
| # by using random of total dots generated outside or inside a circle | |
| import numpy as np | |
| import math | |
| # number of iteration | |
| n = 10000000 | |
| inside = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| int main(){ | |
| char c[5] = "23452"; | |
| char d[5] = "23452"; | |
| int result=0, factor=3; | |
| int numeric; | |
| // take and convert 1 character from an array | |
| numeric = c[2] - '0'; // --> 4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ git commit ... (1) | |
| $ git reset --soft HEAD~1 (2) | |
| $ edit (3) | |
| $ git add .... (4) | |
| $ git commit -c ORIG_HEAD (5) | |
| Undoing a commit is a little scary if you don't know how it works. But it's actually amazingly easy if you do understand. | |
| Say you have this, where C is your HEAD and (F) is the state of your files. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # modified from https://gist.github.com/tebeka/5426211 | |
| # updated to work with Python 3 | |
| import matplotlib | |
| matplotlib.use('Agg') | |
| from matplotlib import pyplot | |
| import numpy | |
| import cherrypy | |
| from io import BytesIO | |
| import base64 |