Skip to content

Instantly share code, notes, and snippets.

@PiotrWegrzyn
PiotrWegrzyn / pthreadLinuxThreads.cpp
Last active June 6, 2018 11:48
This program generates a table filled with random numbers in a thread, then counts the sum and avarage of each row in a separate thread and then counts the avarage of sums of all rows in a thread.
//compile with: g++ name.cpp -o name -lpthread
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <iostream>
#include <assert.h>
using namespace std;
@PiotrWegrzyn
PiotrWegrzyn / PointInPolygonGrahamJarvisAndNaiveMethods.cs
Last active June 6, 2018 11:48
Computational geometry - Point inside a polygon problem and finding the Convex Hull with Graham, Jarvis and Naive methods (c#)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
@PiotrWegrzyn
PiotrWegrzyn / monteCarloAndTrapezoidIntegration.cpp
Created May 5, 2018 13:29
Calculating errors of both montecarlo and trapezoid integration based on precalculated real value.
#include <iostream>
#include <cstdlib>
#include <time.h>
double f(double x) {
return x*x;
}
/*Filename: MN03_Newton
Author: Peter_Wegrzyn
Date: 20.03.18
Kod jest dostosowany do danych z przykladu ze strony http://galaxy.agh.edu.pl/~mhojny/repozytoria/mn/InterpolacjaN.pdf
Jeżeli chce Ci sie wpisywać swoje dane to należy jedynie odkomentować zakomentowane linie oraz zakomentowac tworzenie tabeli.
*/
#include <iostream>
using namespace std;
@PiotrWegrzyn
PiotrWegrzyn / LaborkiAiSD.cpp
Last active June 6, 2018 11:49
Listy Sortowania Drzewka
#include <iostream>
#include <stdlib.h>
#include <time.h>
using namespace std;
int n = 0;
struct node {
int val;
node * next;
};
@rdelassus
rdelassus / spacenet_segnet.py
Last active July 23, 2023 12:21
a segnet-like architecture for building detection in the spacenet dataset
#from __future__ import absolute_import
from keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_array, load_img
from keras.callbacks import ModelCheckpoint
from keras.models import Sequential
from keras.layers import Convolution2D, MaxPooling2D
from keras.layers import Layer, Dense, Dropout, Activation, Flatten, Reshape, Merge, Permute
from keras.layers import ZeroPadding2D, UpSampling2D
from keras.layers.normalization import BatchNormalization
import sys