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
#!/bin/python | |
import sqlite3 | |
import subprocess | |
from urllib.parse import urlparse | |
def get_netloc(url): | |
return urlparse(url).netloc | |
cmd = ["newsboat", "-x", "reload"] |
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
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)) { |
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
// 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 |
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 <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 |
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 <stdlib.h> | |
#include <sys/timeb.h> | |
#define N 1000 | |
int main() { | |
double *a, *b, *c; | |
int i, j, k; | |
double mflop, sum; |
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 <stdlib.h> | |
#include <sys/timeb.h> | |
#define N 1000 | |
#define R 10 | |
int main() { | |
double *a, *b; | |
int i,j; |
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 <stdlib.h> | |
#include <sys/timeb.h> | |
#define N 10000000 | |
#define R 10 | |
int main() { | |
int *a, *b, *c, *d; |
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 : | |
123 8 0x7ff 45. | |
23.67 .89000 | |
0x5A 6.2 | |
output: | |
(venv) ionianironist@debian:~/PycharmProjects/untitled$ python lab.py | |
INT_TOKEN 123 |
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
""" | |
(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 |
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 re | |
>>> rexp = re.compile(r'[\u0384\u00A8].') | |
>>> for m in rexp.finditer('Αθ΄ηνα Αχα¨ικ΄ες Εκδ΄οσεις'): | |
... print(m.group(0)) | |
... | |
΄η | |
¨ι | |
΄ε | |
΄ο |
NewerOlder