Skip to content

Instantly share code, notes, and snippets.

View flyotlin's full-sized avatar

Po-Ru, Lin flyotlin

View GitHub Profile
#include <iostream>
using namespace std;
int main(){
int decN, binN=0, i=1;
cin >> decN;
while(decN != 0){
binN += (decN % 2) * i;
decN /= 2;
i *= 10;
#include <iostream>
using namespace std;
int main()
{
long long int k, n;
while(cin >> k && k != 0){
for(int i = 9; i >= 0; i--){
if((10*k-i)%9 == 0){ //先判斷是否整除 而非先直接除再判斷是否為整數
n = (10*k-i)/9.0;
#include <iostream>
using namespace std;
int three_n(int);
int main()
{
int a, b;
while(cin >> a >> b)
{
int temp, aa, bb;
@flyotlin
flyotlin / my-app-deployment.yaml
Created August 5, 2022 14:48
k8s deployment with image on private registry
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-app
spec:
selector:
matchLabels:
app: my-app
template:
metadata:
@flyotlin
flyotlin / config.json
Last active August 6, 2022 00:53
docker credential config
{
"auths": {
"registry.gitlab.com": {
"auth": "base64 encode `username:password`"
}
},
"credsStore": "desktop"
}
apiVersion: v1
kind: Secret
metadata:
name: regcred
type: kubernetes.io/dockerconfigjson
data:
.dockerconfigjson: <config.json in Base64 encoding>
@flyotlin
flyotlin / imagePullPolicy example
Last active August 6, 2022 03:52
k8s pull from private registry example
---
// config.json
{
"auths": {
"registry.gitlab.com": {
"auth": "YWRtaW46c2VjcmV0VG9rZW4K"
}
}
}
---
@flyotlin
flyotlin / env_setup.sh
Last active November 21, 2022 11:20
ONOS env setup
#!/bin/bash
YELLOW='\033[1;33m'
NC='\033[0m'
BAZEL=0.27.0
set -e
cd ~
sudo apt update -y
#include <stdio.h>
#include <msp430.h>
void ClearFRAM();
void GetLastProcessingCoordinate();
void MultiplyMatrix();
void WriteData(unsigned long, unsigned long, unsigned long);
void WriteLog(unsigned long, unsigned long);
unsigned long *log_write_ptr;