Skip to content

Instantly share code, notes, and snippets.

View tawanchaiii's full-sized avatar

Champ Tawanchai tawanchaiii

View GitHub Profile

Keybase proof

I hereby claim:

  • I am tawanchaiii on github.
  • I am tawanchai (https://keybase.io/tawanchai) on keybase.
  • I have a public key whose fingerprint is F20F C1C6 FDC1 F582 1CAC 9053 9120 F40B 7E6F 30FD

To claim this, I am signing this object:

@tawanchaiii
tawanchaiii / README.md
Last active March 10, 2024 08:59
Shorten URL API Testing 101
@tawanchaiii
tawanchaiii / regex.cpp
Created October 15, 2022 15:43
for POSN camp
#include <bits/stdc++.h>
using namespace std;
bool chk(string str,int i){
if (i >= 0 && i < str.size())
return true;
return false;
}
int main() {
string pat;
@tawanchaiii
tawanchaiii / Chapter_7.md
Last active December 5, 2021 13:14
Chapter 7 : Permission

ตอนที่ 7: สิทธิ์ในการเข้าถึงของไฟล์

บทนำ

จากบทที่ผ่านมา เราได้เรียนรู้การใช้คำสั่ง ls -al กันมาแล้ว โดยในหัวข้อนี้เราจะมาเจาะลึกถึงรายละเอียดของสัญลักษณ์ในการบอกถึงสิทธิ์ของไฟล์ๆ นั้น และคำสั่งการเปลี่ยนแปลงสิทธิ์ของไฟล์

Permission

คือค่าของความมีสิทธิ์ในการเข้าถึง และใช้งาน File หรือ Directory นั้น ๆ โดยสิทธิ์ต่างๆ ที่ ผู้ใช้งานสามารถทำกับไฟล์ได้ มีดังนี้

  • สิทธิ์ในการได้อ่านไฟล์ แทนด้วยตัวอักษร r
  • สิทธิ์ในการได้เขียนไฟล์ แทนด้วยตัวอักษร w
  • สิทธิ์ในการสั่งให้ไฟล์ทำงานได้ แทนด้วยตัวอักษร x
#include<bits/stdc++.h>
using namespace std;
bool paren(string test,int open,int ind){
if (test[ind] == ')'){
if (open==1 && ind+1==test.size()) return true;
else if (open>0) return paren(test,open-1,ind+1);
else return false;
}
else if (test[ind] == '(')
return paren(test,open+1,ind+1);
@tawanchaiii
tawanchaiii / queueO1.c
Last active August 10, 2021 03:49
implement queue enque and deque O(1)
#include<stdio.h>
#include<stdlib.h>
typedef struct node{
int data;
struct node* next;
}node_t;
typedef struct queue{
node_t* front;
node_t* rear;
}queue_t;
@tawanchaiii
tawanchaiii / uaena.md
Last active September 19, 2021 08:10
Helper for L11 (L03) UAENA

FYI

เนื่องจากโจทย์ข้อนี้ วางแผนไว้ว่าจะให้ทำตั้งแต่สัปดาห์ที่ 3 แต่คิดว่าอาจยากไป เพราะมีเนื้อหาที่ยังไม่ได้สอนในเวลานั้น

แต่ตอนนี้เนื้อหาทั้งหมด ทุกคนได้เรียนหมดแล้ว ดังนั้นบทความนี้อาจไม่จำเป็นต้องอ่านแล้วก็ได้

Table of contents

def plot_3D_polycrystal(system,label): # plot bottom 2 layers in 2D
global n_of_metal
plt.figure()
start_time = datetime.datetime.now()
x_solute = []
y_solute = []
z_solute = []
for i in range(n_of_metal):
x_solute.append([])
y_solute.append([])
sky = int(input("Sky : "))
hanabi = int(input("Hanabi : "))
C = [[0]*sky for _ in range(sky)]
for i in range(hanabi):
str = input().split()
str = [int(i) for i in str ]
A = [[0]*sky for _ in range(sky)]
B = [[0]*sky for _ in range(sky)]