import datetime from dateutil.relativedelta import relativedelta def string_to_date(dt, format='%Y%m%d'): return datetime.datetime.strptime(dt, format) def date_to_string(date, format='%Y%m%d'): return datetime.datetime.strftime(date, format) def add_date(dt, d): date = string_to_date(dt) + datetime.timedelta(days=d) return date_to_string(date) def add_week(dt, d): date = string_to_date(dt) + da..
s=$(date +%s) # cmd ... result=$? e=$(date +%s) diff=`expr ${e} - ${s}` if [ ${diff} -lt 30 ]; then exit 1 fi exit $result https://m.blog.naver.com/PostView.nhn?blogId=darkpegasus&logNo=60196514107&proxyReferer=https:%2F%2Fwww.google.com%2F 유닉스,리눅스에서 $? 의 의미, 활용 https://coupa.ng/bLlrXA 이것이 리눅스다:with RedHat ... blog.naver.com
import datetime DAY_OF_WEEK = { "MONDAY": 0, "TUESDAY": 1, "WEDNESDAY": 2, "THURSDAY": 2, "FRIDAY": 2, "SATURDAY": 2, "SUNDAY": 6 } def string_to_date(dt, format='%Y%m%d'): return datetime.datetime.strptime(dt, format) def date_to_string(date, format='%Y%m%d'): return datetime.datetime.strftime(date, format) def day_of_week(dt): return string_to_date(dt).weekday() dt = '20210101' if day_of_week(..
https://michigusa-nlp.tistory.com/68 외부 서비스의 데이터를 python으로 slack에 통지하기 slacker 설치하기 먼저 slacker를 설치한다 $ python3 -m pip install slacker slacker의 공식 github 링크를 타고 들어가면 예시들을 볼 수 있다. slack에서 token과 webhook url 가져오기 token 취득 token 은.. michigusa-nlp.tistory.com
const chart = { type: 'bar', data: { labels: ['Week 1', 'Week 2', 'Week 3', 'Week 4'], datasets: [{ label: 'Retweets', data: [12, 5, 40, 5] }, { label: 'Likes', data: [80, 42, 215, 30] }] } } const encodedChart = encodeURIComponent(JSON.stringify(chart)); const chartUrl = `https://quickchart.io/chart?c=${encodedChart}`; console.log(chartUrl); https://quickchart.io/documentation/send-charts-with-..
from slacker import Slacker from PIL import Image import requests import os image = "{url}" slack = Slacker(token) file = Image.open(requests.get(image, stream=True).raw) filename = DateUtils.timestamp() + '.png' file.save(filename) slack.files.upload(filename, channels='#' + channel) os.remove(filename) https://pydole.tistory.com/entry/Slack-%ED%99%9C%EC%9A%A9-python%EC%9D%84-%EC%9D%B4%EC%9A%A9..
import time print(time.time()) https://inma.tistory.com/96 [Python] datetime, timestamp 변환 timestamp 만들기 timestamp = 초 * 분 * 시 * 일 timestamp = 60 * 60 * 24 * 30 print(timestamp) # 2592000 str 으로 변환 timestamp ➠ str import time timestamp = time.time() s = str(timestamp) print(s).. inma.tistory.com
implode ( string $separator , array $array ) : string explode ( string $separator , string $string , int $limit = PHP_INT_MAX ) : array https://www.php.net/manual/en/function.implode.php PHP: implode - Manual It's not obvious from the samples, if/how associative arrays are handled. The "implode" function acts on the array "values", disregarding any keys: 'four', 'five', '3rd' => 'six' );echo imp..
isinstance(s, str) https://stackoverflow.com/questions/4843173/how-to-check-if-type-of-a-variable-is-string How to check if type of a variable is string? Is there a way to check if the type of a variable in python is a string, like: isinstance(x,int); for integer values? stackoverflow.com
pip3 install requests pip3 install Pillow from PIL import Image import requests import time file = Image.open(requests.get(image, stream=True).raw) filename = time.time() + '.png' file.save(filename) https://stackoverflow.com/questions/7391945/how-do-i-read-image-data-from-a-url-in-python How do I read image data from a URL in Python? What I'm trying to do is fairly simple when we're dealing wit..
'EEEE': Day in Week,(Sunday-Saturday) 'EEE': Day in Week, (Sun-Sat) https://stackoverflow.com/questions/33092074/whats-the-meaning-eee What's the meaning 'EEE' Looking at date filter on angular.js, EEE is used on the spot of the day of the week part, What's the meaning EEE? stackoverflow.com
https://stackoverflow.com/questions/1060279/iterating-through-a-range-of-dates-in-python Iterating through a range of dates in Python I have the following code to do this, but how can I do it better? Right now I think it's better than nested loops, but it starts to get Perl-one-linerish when you have a generator in a list compreh... stackoverflow.com
start=20200101 end=20201231 date=$start while [ $date -le $end ] do date=`date -d "$date+1 days" +%Y%m%d` done https://www.cyberciti.biz/faq/how-to-add-days-to-date-and-get-new-date-on-linux/ How to add days to date and get new date on Linux - nixCraft Explains how to add or subtract days using date command calculation on Linux, Unix, and macOS/*BSD operating system command line. www.cyberciti.biz
cat * > merging mv merging merged https://unix.stackexchange.com/questions/3770/how-to-merge-all-text-files-in-a-directory-into-one/628212#628212 How to merge all (text) files in a directory into one? I've got 14 files all being parts of one text. I'd like to merge them into one. How to do that? unix.stackexchange.com
import pymysql connection = pymysql.connect(db="test") cursor = connection.cursor(pymysql.cursors.DictCursor) cursor.execute("SELECT ...") https://stackoverflow.com/questions/4940670/pymysql-fetchall-results-as-dictionary pymysql fetchall() results as dictionary? Is there any way to get the results from a fetchall() as a dictionary using pymysql? stackoverflow.com
git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git git pull upstream master https://json.postype.com/post/210431 [Git] Fork 한 repository 최신으로 동기화하기 Fork 한 repository 를 최신으로 동기화시켜야 할 때가 있다. Open Source 에 단발성이 아닌 지속적으로 contribution 하려 할 때수정해서 사용하기 위해 fork 해온 원본 repository 에서 업데이트된 부분을 받아 json.postype.com http://www.notforme.kr/archives/1631 [Tip] Fork한 Github 소스 원래 소..
pip uninstall pycurl pip install --compile --install-option="--with-openssl" pycurl brew reinstall openssl https://stackoverflow.com/questions/47888757/importerror-pycurl-libcurl-link-time-ssl-backend-openssl-is-different-from-c ImportError: pycurl: libcurl link-time ssl backend (openssl) is different from compile-time ssl backend (none/other) I wanted to run python file. But I could check this ..
# reverse queryset1 = reversed(Collection.objects.filter(pk__in = li)) queryset2 = Collection.objects.filter(pk__in = li).reverse() queryset3 = Collection.objects.filter(pk__in = li)[::-1] # desc queryset = Collection.objects.filter(pk__in = li).order_by('-id') # limit queryset = Collection.objects.filter(pk__in = li)[:10] https://stackoverflow.com/questions/31303327/reverse-queryset-order-in-dj..
import inspect import os import sys currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(currentdir) sys.path.insert(0, parentdir) https://stackoverflow.com/questions/714063/importing-modules-from-parent-folder Importing modules from parent folder I am running Python 2.5. This is my folder tree: ptdraft/ nib.py simulations/ life/ life..
path=hdfs://a/b/c hdfs dfs -test -e ${path} if [ $? -eq 0 ]; then echo "exists !!!" fi hdfs dfs -test -z ${path} if [ $? -eq 0 ]; then echo "zero !!!" fi size=`hdfs dfs -count ${path} | awk '{print $3}'` echo $size https://stackoverflow.com/questions/43900364/find-whether-file-exists-or-not-in-hdfs-using-shell-script/43903810 Find whether file exists or not in HDFS using shell script I have a sh..
- Total
- Today
- Yesterday
- 테슬라 추천
- COUNT
- 테슬라 리퍼럴 코드 생성
- wlw
- 김달
- 모델y
- 모델 Y 레퍼럴
- 팔로워 수 세기
- 어떻게 능력을 보여줄 것인가?
- follower
- Kluge
- 테슬라 크레딧 사용
- 테슬라 레퍼럴 적용 확인
- 레퍼럴
- 할인
- 유투브
- Bot
- 연애학개론
- 책그림
- 테슬라 리퍼럴 코드
- 테슬라 리퍼럴 코드 혜택
- 테슬라 레퍼럴
- 메디파크 내과 전문의 의학박사 김영수
- 개리마커스
- 테슬라 레퍼럴 코드 확인
- 인스타그램
- 테슬라
- 클루지
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |