Skip to content

Instantly share code, notes, and snippets.

@yc0
yc0 / without-auth_e-book_tutorial_免登入電子書教學.md
Created April 25, 2024 13:53 — forked from notlin4/without-auth_e-book_tutorial_免登入電子書教學.md
教學用電子書與相關工具免登入教學 | 本指令碼用於繞過臺灣電子書與教學工具的前端身分驗證,達成不需要教師帳號即可使用。支援 翰林、南一、康軒、何嘉仁 四大出版社 | 請勿將本指令碼作為抄答案、侵權等惡意用途,使用本指令碼,請自行承擔所有後果與風險

教學用電子書與相關工具免登入教學

使用本指令碼即代表你同意本免責聲明

免責聲明

請勿將本指令碼作為抄答案、侵權等惡意用途,使用本指令碼,請「自行承擔」所有後果與風險。

簡介

本指令碼用於繞過臺灣電子書與教學工具的前端驗證,達成不需要教師帳號即可使用。

@yc0
yc0 / without-auth_e-book_tutorial_免登入電子書教學.md
Last active November 9, 2023 14:21 — forked from aliyaliu368/without-auth_e-book_tutorial_免登入電子書教學.md
教學用電子書免登入破解教學 | 本腳本用於繞過台灣主要課本/習作出版社電子書的前端身份驗證,達成不需要教師帳號即可使用電子書。支援 翰林、南一、康軒 三大出版社 | 請勿將本腳本作為抄答案、侵權等惡意用途,使用本腳本者,請自行承擔所有後果與風險

Visits_Count

教學用電子書免登入破解教學

使用前請務必閱讀 免責聲明

免責聲明

請勿將本腳本作為抄答案、侵權等惡意用途,使用本腳本者,請自行承擔所有後果與風險。

簡介

@yc0
yc0 / cplusplus-leetcode-1044.cpp
Created June 20, 2020 14:19
Longest Duplicate Substring| CPP
class Solution {
static const int MODULAR = INT_MAX;
static const int BASE = 26;
vector<int> normalized;
vector<int> power;
public:
// O(n)
string find(string &s, int len) {
int hash = 0;
unordered_map<int, unordered_set<int>> mp;
@yc0
yc0 / parallel_accumulate.cpp
Last active September 11, 2019 08:08
Modern C++ Concurrency in Depth
/**
MacOS : clang++ -Wall -std=c++17 parallel_accumulate.cpp -O3 -o out
----------------------------
num of cores : (8) w/o task switching
1166029 (ns)
the anwser : 45000497
2564850 (ns)
the anwser : 45000497
----------------------------
**/
@yc0
yc0 / cplusplus-leetcode-230.cpp
Last active August 24, 2019 16:07
230. Kth Smallest Element in a BST Follow Up Solution (B+ Tree)
/**
Hence without any optimisation insert/delete + search of kth element has O(2H + k) complexity.
How do we optimise it ?
First, we need to make sure the balanced tree for sure. Here, we don't need to implement it (AVL, Red-Black Tree)
Secondly, we can mimic B+trees (https://en.wikipedia.org/wiki/B+ tree).
we can add a doubly linked list trait on the tree node. Then, as usual,
we insert node with time complexity O(H), but take time complexity O(1) to maintain doubly linked list.
On the other hand, we can get the same complexity on deletion.
**/
@yc0
yc0 / thread.cpp
Created March 22, 2019 07:01
multi-thread sample
/**
MacOS : clang++ -std=c++17 -stdlib=libc++ -O2 sample.cpp
GCC: g++ -std=c++17 -lpthread sample.cpp
constrains resource in docker : docker run -it --rm --name=thread --cpuset-cpus="3" gcc bash
**/
#include <iostream>
#include <sstream>
#include <vector>
#include <pthread.h> // POSIX
@yc0
yc0 / go-leetcode-342.go
Last active December 13, 2018 03:25
342. Power of Four in Leetcode
/**
342. Power of Four
A code is realy simple but hard to realize the concept.
There's a magic mask to handle it, and it is also the best solution in leetcode.
Besides, I don't want to mention a brutal force solution with loop neither.
Here I use simple concept to explain it, and can help you memorize when you interview.
The problem asks us solve problem w/o loops/recursion
Intuitively, 4^n is 2^n; on the contrary, 2^n is not alwasy 4^n only when
@yc0
yc0 / Dockerfile.app
Created December 9, 2018 14:49
Dockerfile for app
FROM ruby:2.3.1
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
# Set an environment variable where the Rails app is installed to inside of Docker image
ENV LC_ALL C.UTF-8
# Setup TZ
ENV TZ Asia/Taipei
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
ENV RAILS_ROOT /var/www/app
@yc0
yc0 / ops-summit-crawl.py
Created October 5, 2018 09:51
Crawl Information of Openstack Stack Summit
from datetime import datetime
from lxml import etree
import requests as req
import csv
import re
def handle_slide(slide):
@yc0
yc0 / client.py
Last active October 5, 2018 04:07
ping-pong tcp testing for network benchmark
import socket
import datetime
import sys
import time
def main():
message = "Ping"
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.settimeout(120)
if len(sys.argv) != 3:
print "Correct usage: script, IP address, port number"