Skip to content

Instantly share code, notes, and snippets.

View JakubMifek's full-sized avatar
💭
I may be slow to respond.

Jakub Mifek JakubMifek

💭
I may be slow to respond.
View GitHub Profile
function [ delta, s ] = CrossVal(Name1,Name1L,Par1,Name2,Name2L,Par2,Pat,DOut,k,NoShuffle)
if nargin < 9
error("Wrong number of parameters. Expected at least 9.");
end
if nargin == 9
% Shuffle the input set
perm = randperm(size(Pat,2));
Pat = Pat(:,perm);
DOut = DOut(perm);
function [ Output ] = CrossVal(Name1,Name1L,Par1,Name2,Name2L,Par2,Pat,DOut,k,~)
if nargin < 9
error("Wrong number of parameters. Expected at least 9.");
end
if nargin == 9
% Shuffle the input set
perm = randperm(size(Pat,2));
Pat = Pat(:,perm);
DOut = DOut(perm);
@JakubMifek
JakubMifek / Cut.cs
Last active November 18, 2017 13:49
private static void Cut(FibTree<T> tree, FibNode node)
{
if (tree == null)
throw new ArgumentNullException(nameof(FibTree<T>));
while (node != null)
{
var parent = node.Parent;
if (parent == null)
return;
private const int BufferSize = 4096;
private static readonly char[] Buffer = new char[BufferSize];
static void ReadInput(StreamReader reader)
{
int count, read = 0;
while ((count = reader.ReadBlock(Buffer, read, BufferSize)) > 0)
{
var index = 0;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FibonacciHeap
{
public class StreamParser
@JakubMifek
JakubMifek / hashing.c
Created December 27, 2017 21:55
Homework assignment for Data Structures I course at Charles University
#include <stdio.h>
#include <limits.h>
#include <math.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <assert.h>
#include <stdio.h>
#include <limits.h>
#include <math.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <assert.h>
png("./third.png", width=1080, height=560, units="px", pointsize=10, antialias="default")
#table.ml = read.csv("modulFinalTime", header = F, sep = " ")
#table.dl = read.csv("multiFinalTime", header = F, sep = " ")
#table.tl = read.csv("tableFinalTime", header = F, sep = " ")
#table.du = read.csv("multiCuckooTime", header = F, sep = " ")
#table.tu = read.csv("tableCuckooTime", header = F, sep = " ")
plot(x=seq(7, 23, by=2), y = seq(1,200, length=9), type="n", xlab="k", ylab="#Steps", xaxt="n")
axis(1,at=seq(7,23, by=2),labels=seq(7,23,by=2))
cols = c("orange", "green", "red", "blue", "brown", "black")
#include <stdio.h>
#include <limits.h>
#include <math.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <assert.h>
@JakubMifek
JakubMifek / CreateNetwork.m
Created January 10, 2018 08:24
Matlab function for creating Hopfield network from an image containing the alphabet
function [input network] = CreateNetwork( path, width, height )
%CREATENETWORK Summary of this function goes here
% Detailed explanation goes here
img = imread(path);
img = 1-im2double(img(:,:,1));
img = img == 1;
colormap(gray);
img = 1-img;
imagesc(img);