Skip to content

Instantly share code, notes, and snippets.

View IonianIronist's full-sized avatar

IonianIronist

View GitHub Profile
#!/bin/python
import sqlite3
import subprocess
from urllib.parse import urlparse
def get_netloc(url):
return urlparse(url).netloc
cmd = ["newsboat", "-x", "reload"]
@IonianIronist
IonianIronist / rss.ino
Created August 16, 2021 19:09
rss at command
uint8_t rss() {
uint8_t atCmd[] = {'D', 'B'}, respLen, *resp, dBm;
AtCommandRequest atCmdReq;
AtCommandResponse atResp;
atCmdReq = AtCommandRequest(atCmd);
xbee.send(atCmdReq);
if (xbee.readPacket(10)) {
// Simple (non-threaded) quicksort implementation
// compile with e.g. gcc -O2 -Wall quicksort-simple.c -o quicksort-simple -DN=10000000
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#define QUEUE_SIZE 1000
#define N 10000000
#define THREADS 2
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
// this is the plain version (pointer walking) of dot product of two NxN float matrices
// compile with:
// gcc -Wall -O2 matmul-float-simple2.c -o matmul-float-simple2 -DN=1000
// matrix dims N rows x N columns: use -DN=.. to define on compilation
#include <stdio.h>
#include <stdlib.h>
#include <sys/timeb.h>
#define N 1000
int main() {
double *a, *b, *c;
int i, j, k;
double mflop, sum;
#include <stdio.h>
#include <stdlib.h>
#include <sys/timeb.h>
#define N 1000
#define R 10
int main() {
double *a, *b;
int i,j;
@IonianIronist
IonianIronist / app.c
Last active February 23, 2021 16:36
paral
#include <stdio.h>
#include <stdlib.h>
#include <sys/timeb.h>
#define N 10000000
#define R 10
int main() {
int *a, *b, *c, *d;
"""
input :
123 8 0x7ff 45.
23.67 .89000
0x5A 6.2
output:
(venv) ionianironist@debian:~/PycharmProjects/untitled$ python lab.py
INT_TOKEN 123
"""
(venv) ionianironist@debian:~/PycharmProjects/untitled$ python lab.py
VAR_TOKEN a32
VAR_TOKEN b
VAR_TOKEN _67
VAR_TOKEN a_9
VAR_TOKEN DeF
VAR_TOKEN ifelse
VAR_TOKEN then
>>>import re
>>> rexp = re.compile(r'[\u0384\u00A8].')
>>> for m in rexp.finditer('Αθ΄ηνα Αχα¨ικ΄ες Εκδ΄οσεις'):
... print(m.group(0))
...
΄η
¨ι
΄ε
΄ο