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
unit uDrawScreen; | |
{$mode objfpc}{$H+} | |
interface | |
uses | |
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls,LCLIntf, LCLType; | |
type |
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
# used to play in the typora application | |
import pyperclip as pc | |
import pyautogui as pa | |
# specify input file before running | |
srcFileName=r"C:\tmp\pyautogui-play\grok-determinant.md" | |
# srcFileName=r"C:\tmp\pyautogui-play\test.md" | |
srcFile = open(srcFileName,mode='r', encoding='utf-8') | |
allFileLines = srcFile.readlines() # note, the '\n' is kept in each line | |
allFileLines = [ line.strip() for line in allFileLines] |
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 <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <mysql/mysql.h> | |
/* | |
The program is a demonstration of using prepared statements to perform operations on the below table in mariadb. | |
The statements include: insert, select, delete, etc. | |
CREATE TABLE person ( |
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 julia | |
function usage_exit() | |
println("$PROGRAM_FILE <cpp-check-result-file-name>") | |
exit() | |
end | |
#if length(ARGS) != 1 | |
# usage_exit() | |
#end |
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
# a script to indent lines of text based on given start tag and end tag | |
import os | |
import os.path | |
src_file = r"<sourcefile>" | |
dst_file = r"<destination-file>" | |
with open(src_file,"rb") as srcfile: | |
content = srcfile.read() |
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
# a script to walk a dir, and filter each line of the files in that dir, and do something if the line fulfills some criteria | |
import os | |
import os.path | |
script_dir = r"<script-dir>" | |
dir_to_walk = r"<dir-to-walk>" | |
os.getcwd() | |
os.chdir(script_dir) | |
os.getcwd() | |
classes_file_name = os.path.join(script_dir, "<somefile.txt>" ) | |
with open(classes_file_name) as file: |
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
input_lines = [] | |
with open("account.yml",mode='r',encoding='utf-8') as f: | |
input_lines = f.readlines() | |
input_lines = [line.strip() for line in input_lines if line.strip() != ''] | |
entries = [] | |
entry = [] |
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
package main | |
import ( | |
"fmt" | |
"math/big" | |
"os" | |
) | |
var target int = 23813 | |
var totalNum int = 69 |
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 <stdio.h> | |
#include <signal.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
#include <unistd.h> | |
/* this program tries to generate a crash. A prove of concept program. */ | |
/* as per my test, crash may be created in other diectory, but not in my $HOME directory, I don't know why yet */ | |
void function1() { |
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 <stdio.h> | |
char hexstr[]="0123456789ABCDEF"; | |
void hexdump(char* buf, int len) { | |
int i; | |
for(i=0;i<len;++i) { | |
int hi=(buf[i] >> 4) & 0x0f; | |
int lo=(buf[i] & 0x0f); | |
printf("%c%c,",hexstr[hi],hexstr[lo]); | |
} |
NewerOlder