This file contains hidden or 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
-- Following CCC's algorithm | |
-- @base + ( @top - @base ) / (1 + (max(0, solves -1)/ 11.92201) ** 1.206069) | |
CREATE EVENT IF NOT EXISTS `calc_challenges_new_score` | |
ON SCHEDULE | |
EVERY 3 SECOND | |
COMMENT 'Calculate points for challenges' | |
DO | |
UPDATE challenges AS c SET c.`point` = CONVERT(c.base_point + (c.top_point - c.base_point) / (1 + POW(GREATEST(c.solved_count - 1, 0) / 11.92201, 1.206069)), UNSIGNED); | |
This file contains hidden or 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 EVENT IF NOT EXISTS `calc_challenges_new_score` | |
ON SCHEDULE | |
EVERY 5 MINUTE | |
COMMENT 'Calculate points for challenges every 5 min' | |
DO | |
-- TBD |
This file contains hidden or 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
#include "cpp-httplib/httplib.h" | |
using namespace httplib; | |
int main() { | |
Server svr; | |
svr.Get("/1", [](const Request& req, Response& res) { | |
res.set_redirect("1\r\nSet-Cookie: a=1"); | |
}); | |
svr.Get("/2", [](const Request& req, Response& res) { | |
res.set_header("a", "1\r\nSet-Cookie: a=1"); | |
}); |
This file contains hidden or 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
#include <iostream> | |
#include <string> | |
#include <fstream> | |
using namespace std; | |
int main(int argc, char const *argv[]) | |
{ | |
if (argc == 1){ | |
cerr << "Usage: ./" << argv[0] << " filename" << endl; |
This file contains hidden or 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
import smtplib | |
from email.mime.text import MIMEText | |
from email.header import Header | |
sender = '[email protected]' | |
receivers = ['[email protected]'] | |
message = MIMEText(""" | |
To whom it may concern, | |
Checking in again: did you receive my last email? |
This file contains hidden or 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
# -*- coding:utf-8 -*- | |
############################################ | |
USERNAME = "YOUR_USERNAME" | |
PASSWORD = "YOUR_PASSWORD" | |
CHROME_DRIVER = "YOUR_PATH_TO_CHROME_DRIVER" | |
############################################ | |
from selenium.webdriver.common.keys import Keys | |
from selenium import webdriver | |
import time |
This file contains hidden or 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
import math | |
Cl2 = -914.539251 | |
Cl = -457.274191 | |
CH4 = -39.925088 | |
CH3 = -39.307514 | |
CH3Cl = -496.645171 | |
HCl = -457.859632 | |
CH2Cl2 = -953.354926 | |
CHCl3 = -1410.057976 | |
CCl4 = -1866.755609 |
NewerOlder