Prime Minister | President |
---|---|
Head of government | Head of state |
Elected by the legislature | Elected by the people |
Appointed by the head of state | Elected by the people or by a special body |
Represents the country on the international stage | Has the power to veto laws passed by the legislature and to appoint judges to the supreme court |
May be removed from office by a vote of no confidence in the legislature | May be removed from office by impeachment or by the expiration of their term of office |
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
def Quadratic(): | |
option = int(input("Options: 1) Enter formula 2) Enter three terms")) | |
if option == 2: | |
terms = [None, None, None, None] | |
for i in range(1,4): | |
terms[i] = float(input(str("Enter term " + str(i) + ": "))) | |
diff1 = terms[2] - terms[1] | |
diff2 = terms[3] - terms[2] | |
quadiff = diff2 - diff1 | |
a = quadiff / 2 |
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
# Importing modules | |
from time import perf_counter | |
from hashlib import md5 | |
from random import randint | |
from multiprocessing import Pool | |
import sys | |
# Basic function to hash a string | |
def getMD5(plaintext): | |
m = md5() |
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
# Importing modules | |
from time import perf_counter | |
from hashlib import md5 | |
from random import randint | |
from multiprocessing import Queue, Process, Pool | |
import sys | |
# Global variables | |
q = Queue() |
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
# This program takes an excel documents and maps it to a sqlite database. | |
# It is designed to be used with the excel-to-sqlite.xlsx template. | |
# | |
import sqlite3 | |
import xlrd | |
import sys | |
import logging | |
import openpyxl | |
def useOPENPYXL(excelFile, sqliteFile): |
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
import argparse | |
import json | |
import ast | |
from ast import parse,walk | |
from astor import to_source | |
def extract_functions(node,is_class=False): | |
"""Recursively extract function names and code from an AST node.""" | |
functions = {} | |
for child in walk(node): |
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
#include <ApplicationServices/ApplicationServices.h> | |
#include <stdio.h> | |
__attribute__((constructor)) | |
void takeScreenshot() { | |
CGImageRef screenShot = CGDisplayCreateImage(kCGDirectMainDisplay); | |
CFURLRef fileURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, | |
CFSTR("screenshot.png"), | |
kCFURLPOSIXPathStyle, | |
false); | |
CGImageDestinationRef dest = CGImageDestinationCreateWithURL(fileURL, |
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
yes |
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
import os | |
import fnmatch | |
import sys | |
def delete_files(patterns, directory="."): | |
if len(patterns) == 0: | |
print("No patterns specified.") | |
sys.exit(1) | |
if not os.p |
Authentication:
- Set cookies from your browser
Step 1: GET https://beta.character.ai/chat/curated_categories/characters/
. It returns JSON. You are looking for external_id
of the character you want. This will be used for all following steps (external_id
or character_external_id
)
Step 2: POST https://beta.character.ai/chat/character/info/
with {"external_id":"..."}
as payload. Keep track of identifier
from the response as tgt
for step 4
Step 3: POST https://beta.character.ai/chat/history/create/
with the same payload as step 2. Keep track of external_id
in the response as history_external_id
.
OlderNewer