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
Set-PSReadlineOption -BellStyle None | |
Set-PSReadLineOption -PredictionSource None | |
Set-PSReadlineOption -EditMode vi | |
function OnViModeChange { | |
$esc = [char]27 | |
if ($args[0] -eq 'Command') { | |
Write-Host -NoNewLine "$esc[2 q" | |
} else { | |
Write-Host -NoNewLine "$esc[6 q" | |
} |
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 <math.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
typedef struct Vector { | |
double x; | |
double y; | |
double z; | |
} Vector; |
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
# Introduction to Chemical Engineering Thermodynamics, 8E | |
# Example 13.1 | |
import math | |
def gamma(t, x1): | |
x2 = 1 - x1 | |
A = 2.771 - 0.00523 * t | |
return (math.exp(A * x2**2), math.exp(A * x1**2)) |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#define TABLE_SIZE 10000 | |
typedef struct Node | |
{ | |
char *key; | |
int value; | |
struct Node *next; |
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
crc_16_table = [0x0000, 0xCC01, 0xD801, 0x1400, 0xF001, 0x3C00, 0x2800, | |
0xE401, 0xA001, 0x6C00, 0x7800, 0xB401, 0x5000, 0x9C01, 0x8801, 0x4400] | |
def get_crc_16(p: bytes, n: int) -> bytes: | |
crc = 0x55AA | |
index = 0 | |
while (index < n): | |
r = crc_16_table[crc & 0xF] |
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
@echo off | |
set PYTHON=%localappdata%\Programs\Python\Python310\python.exe | |
set GIT= | |
set VENV_DIR= | |
set COMMANDLINE_ARGS=--listen --xformers | |
call webui.bat |
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 <stdio.h> | |
#include <stdlib.h> | |
unsigned int crc_16_table[16] = { | |
0x0000, 0xCC01, 0xD801, 0x1400, 0xF001, 0x3C00, 0x2800, 0xE401, | |
0xA001, 0x6C00, 0x7800, 0xB401, 0x5000, 0x9C01, 0x8801, 0x4400}; | |
unsigned short int get_crc_16(char *p, int n) | |
{ | |
unsigned short int crc = 0x55AA; |
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 <stdio.h> | |
#include <stdlib.h> | |
unsigned int crc_16_table[16] = { | |
0x0000, 0xCC01, 0xD801, 0x1400, 0xF001, 0x3C00, 0x2800, 0xE401, | |
0xA001, 0x6C00, 0x7800, 0xB401, 0x5000, 0x9C01, 0x8801, 0x4400}; | |
unsigned short int get_crc_16(char *p, int n) | |
{ | |
unsigned short int crc = 0x55AA; |