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
@JakubMifek
JakubMifek / alfabeta.java
Last active September 2, 2018 20:56
Alfa-Beta algoritmus pro Walight UI I HW
package conquest.bot.playground;
import conquest.bot.state.*;
import conquest.game.Player;
import conquest.game.world.Continent;
import conquest.game.world.Region;
import java.util.*;
interface IApplicable {
find . -type f -name '*.*' | sed 's|.*\.|.|' | sort -u
private static void Main()
{
Config.Instance.Load("config.config");
AppDomain.CurrentDomain.ProcessExit += (sender, args) =>
{
Config.Instance.Save("config.config");
Config.Instance["exit"] = true;
};
MainLogger.Instance.Log("Program", Priority.Info, "Program has started.");
<?xml version="1.0" encoding="windows-1250" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml"/>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="panovnici">
<kings>
<xsl:apply-templates/>
@JakubMifek
JakubMifek / GetOutputError.m
Created January 10, 2018 08:27
Function for computing error of two logical vectors
function error = GetOutputError( A, B )
%GETOUTPUTERROR Summary of this function goes here
% Detailed explanation goes here
error = sum(abs(A - B));
end
@JakubMifek
JakubMifek / Program.m
Created January 10, 2018 08:26
Matlab code for creating ascii art
[input net] = CreateNetwork('alphabet2.png', 17, 6);
characterLength = size(net.LW{1,1}, 1);
output = [' ', '1', 'B', 'S', 'd', 'u', '!', '2', 'C', 'T', 'e', 'v', '"', '3', 'D', 'U', 'f', 'w', '#', '4', 'E', 'V', 'g', 'x', '$', '5', 'F', 'W', 'h', 'y', '%', '6', 'G', 'X', 'i', 'z', '&', '7', 'H', 'Y', 'j', '{', "'", '8', 'I', 'Z', 'k', '|', '(', '9', 'J', '[', 'l', '}', ')', ':', 'K', '\', 'm', '~', '*', ';', 'L', ']', 'n', '+', '<', 'M', '^', 'o', ',', '=', 'N', '_', 'p', '-', '>', 'O', '`', 'q', '.', '?', 'P', 'a', 'r', '/', '@', 'Q', 'b', 's', '0', 'A', 'R', 'c', 't'];
%output = [' ', '1', 'u', '!', '2', 'v', '"', '3', 'w', '#', '4', 'x', '$', '5', '{', '%', '6', '|', '&', '7', '}', "'", '8', '~', '(', '9', '[', ')', ':', '\', '*', ';', ']', '+', '<', '^', ',', '=', '_', '-', '>', '`', '.', '?', 'a', '/', '@', 'b', '0', 'A', 'c'];
%output = [' ', '|', '!', '}', '"', '~', '#', '[', '$', '\', '%', ']', '&', '^', "'", '_', '(', '`', ')', ':', '*', ';', '+', '<', ',', '=', '-', '>', '.', '?','/', '@', '0', '
@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);
#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>