Skip to content

Instantly share code, notes, and snippets.

View cristaloleg's full-sized avatar
🇺🇦
still I can't believe it's me

Oleg Kovalov cristaloleg

🇺🇦
still I can't believe it's me
View GitHub Profile
@cristaloleg
cristaloleg / fast_bogosort.c
Created December 6, 2012 12:20
maybe the fastest bogosort
#include <cstdio>
#include <cstdlib>
#include <windows.h>
#define N 10
int arr[N];
__forceinline bool correct()
{
int size = N;
#include <stdio.h>
#include <mpi.h>
#include <math.h>
#define PRECISION 0.000001
#define EPS 0.000000001
#define RANGESIZE 1
#define DATA 0
#define RESULT 1
#define FINISH 2
#include <stdio.h>
#include <mpi.h>
int main(int argc, char **argv)
{
double precision = 1000000000;
int myrank, proccount;
double pi, pi_final;
int mine, sign;
int i;
"""
Parallel & Distributed Algorithms - laboratory
Examples:
- Launch 8 workers with default parameter values:
> python arir.py 8
- Launch 12 workers with custom parameter values:
> python arir.py 12 --shared-memory-size 128 --delay-connect 2.0 --delay-transmit 0.5 --delay-process 0.75
@cristaloleg
cristaloleg / algo4
Created April 28, 2015 10:38
algo4
// http://enauczanie.pg.gda.pl/moodle/pluginfile.php/58545/mod_resource/content/6/IntelXeonPhi-manual-PCzarnul-v1.pdf
// http://enauczanie.pg.gda.pl/moodle/pluginfile.php/58773/mod_resource/content/1/lab_4_attachment.pdf
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <omp.h>
#include <sys/time.h>
#define PACKET_COUNT 1000
@cristaloleg
cristaloleg / find.py
Created October 14, 2016 15:01
bombom
# lel
def divs(n):
res = [1]
for i in range(2, 39):
if n % i == 0:
res.append(i)
return res
def isset(n, i):
### Keybase proof
I hereby claim:
* I am cristaloleg on github.
* I am olegkovalov (https://keybase.io/olegkovalov) on keybase.
* I have a public key ASDurR95hTDh9o0tKG-1rnYl5efgh3qxh8mi8giQOJdGxQo
To claim this, I am signing this object:
@janisz I did a small investigation today at morning.
We can create `AliasedHash` which implements `Hash` interface:
```
type AliasedHash struct {
aliases *sync.Map
}
func NewAliasedHash() AliasedHash {
return AliasedHash{
aliases: &sync.Map{},
➜ astify git:(master) ✗ ast-walker blah_test.go
0 *ast.File {
1 . Package: blah_test.go:1:1
2 . Name: *ast.Ident {
3 . . NamePos: blah_test.go:1:9
4 . . Name: "astify"
5 . }
6 . Decls: []ast.Decl (len = 2) {
7 . . 0: *ast.FuncDecl {
8 . . . Name: *ast.Ident {
@cristaloleg
cristaloleg / positive_tests.go
Created June 20, 2018 18:35
Positiv example
// cmd/gocritic/testdata/positive_tests.go
/// consider `in' name instead of `IN'
/// `X' should not be capitalized
/// `Y' should not be capitalized
/// `Z' should not be capitalized
func badFunc1(IN, X int) (Y, Z int) {
/// `V' should not be capitalized
V := 1
return V, 0
}