This file contains 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
############################################################################ | |
# Muscial Composition Features Classification - Part 1 # | |
############################################################################ | |
###### General Notice ###### | |
+ Author : Nuttapong Punpipat (NP-chaonay) | |
+ Updated On : 2020_05_16 16:03 (UTC) | |
+ General Updating Frequency : Weekly | |
+ Code Snippet Completeness : about 30% | |
+ Stability : <Beta |
This file contains 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
#!/usr/bin/python3 | |
import glob,os,time,sys | |
import pandas as pd | |
# Program parameters | |
CHECKING_DELAY_TIME=20 | |
LOW_MEM_ENSURE_DELAY_TIME=10 | |
SIGTERM_DELAY_TIME=20 | |
SYS_UNDERLOADING_DELAY_TIME=10 | |
LOW_MEM_THRESHOLD_KIB=100000 |
This file contains 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
### [NOTICE:CODE_MOVING] This module will be merged into package "np_chaonay". | |
# This Gist will be deleted after 1 month of "np_chaonay.pymusicnote" release, | |
# AND after 1 years of this annoucement's publishing. | |
# However, this Gist is continue receiving updates, then it will be stopped | |
# after "np_chaonay.pymusicnote" is released. | |
""" | |
Musical Notation implementation on Pythons. | |
Constant : |
This file contains 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
#!/usr/bin/env python3 | |
# Name : Thailand Government Lottery's Prize Checker Program | |
# Description : Checking Thailand government lottery's prize by the processing of host server and get the data for processing using this program. | |
# Author : Nuttapong Punpipat (NP-chaonay) | |
# License : MIT License | |
# Language : Thai | |
# Version / Last Programmed : V.1.0 12/03/20 16:30 (UTC) | |
import http.client,sys | |
try: |
This file contains 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
#!/usr/bin/python3 | |
import time | |
start=time.time() | |
end=time.time() | |
latency=end-start | |
import signal,subprocess,sys,threading,os,random | |
def is_str_is_integer(string): | |
if string[0]=='-': | |
n=1 | |
else: n=0 |
This file contains 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
#!/usr/bin/env python3 | |
import os,glob,random,subprocess,signal,threading,time,sys,curses | |
IsProcessRunning=True | |
Is_cli_win_display_Active=False | |
Has_cli_win_display_Active=False | |
play_no=0 | |
args=['<Not playing>','<Not playing>'] | |
os.chdir('/home/np-chaonay/') | |
songs=[] | |
def curses_print(msg,scr): |
This file contains 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
### Program/Data Initialization ### | |
import urllib.request | |
import pandas as pd | |
import itertools | |
def pandas_series_full_display(series): | |
print('-'*64) | |
for property_i in range(series.count()): | |
print(str(series.index[property_i])+': '+str(series[property_i])) |
This file contains 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
# (General Properties's Description) | |
# - Type : Available as {Program,Script,Snippet,Module,Project,Library,Docs} | |
# (WARNING) Script and Program Difference: Script is like a Program it is scripting AND it (recommended OR must) be confingured inside the script first. | |
# - Implemented_Language : If more than 1 coding language is used, specify as Multi or specify them | |
# (Python-related Properties's Description) | |
# - PythonInteractive_CopyPaste_Guaranteed : | |
# (Note) For shorten the sentence, define this sentence "executed by copy the whole portion and paste to Python Interactive Console" as the word "that action" | |
# If, all code-contained sections are able to be done that action | |
# Or if, | |
# there're at least 1 code-contained sections that are able to be done that action |
This file contains 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
# Name : NP-chaonay main module | |
# Description : My module that contains general object for using. | |
# Author : Nuttapong Punpipat (NP-chaonay) | |
# License : MIT License | |
# Language : English | |
# Version / Last Programmed : V.1.0 09/06/20 14:33 (UTC) | |
### TODO ### | |
# - Update this script : Added print_err | |
# - Improve print_err | |
# - Improve another object |
This file contains 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 sine wave and write to disk ### | |
import math | |
import numpy as np | |
import scipy.io.wavfile as scp_io_wav | |
rate=44100 | |
freq=440 | |
sample_num=rate*5 | |
# Note: round to 15 due to inaccurate of resulted value when input values "pi" and "2pi" | |
# Note: Using modulus (When at least 1 cycle of circle sine is reached, reset to 0) to prevent bigger value cause the inaccurate of resulted value. (Using lower rounding decimal point may decrease precision when inputted value goes higher.) |
OlderNewer