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
{ | |
greeting: '5', | |
superlative: 'nice' | |
} |
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
int main(int argv, char *argc[]) { | |
if (argv != 2) return 3; | |
filepath = argc[1]; | |
if(mkfifo(filepath, 0666)){ | |
printf("Oh dear, something went wrong with read()! %s\n", strerror(errno)); | |
return 4; | |
} |
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
%%%------------------------------------------------------------------- | |
%%% @author Aleksander Mikucki | |
%%% Created : 19. kwi 2018 17:02 | |
%%%------------------------------------------------------------------- | |
-module(task1). | |
-author("Aleksander Mikucki"). | |
-export([get_special_difference/2]). | |
get_special_difference(A, B) -> PrimeMap = filter_occurring_prime_times(list_to_occurrence_count(B)), | |
lists:filter(fun(X) -> not maps:is_key(X, PrimeMap) end, A). |
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
from datetime import datetime,timedelta | |
def shouldAskForOpinion(log): | |
sessions=list(map(lambda x: datetime.strptime(x,"%Y-%m-%d %H:%M:%S"),log)) | |
visitedPastThreeDays=set([times[-1].date()-timedelta(days=i) for i in range(0,3)]).issubset(map(lambda x:x.date(),sessions)) | |
uniqueVisits=[] | |
for visit in sessions: | |
if(not list(filter(lambda alreadyStoredVisit:(visit-alreadyStoredVisit).total_seconds()//60<30,uniqueVisits))): | |
uniqueVisits.append(visit) | |
return len(uniqueVisits)>=6 and visitedPastThreeDays |
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
from datetime import datetime,timedelta | |
def shouldAskForOpinion(log): | |
sessions=list(map(lambda x: datetime.strptime(x, "%Y-%m-%d %H:%M:%S" ),log)) | |
visitedPastThreeDays=set([sessions[-1].date()-timedelta(days=i) for i in range(0,3)]).issubset(map(lambda x:x.date(),sessions)) | |
uniqueVisits=[] | |
for (i,currentSession) in enumerate(sessions): | |
if(i<1 or (currentSession-sessions[i-1]).total_seconds()//60>30): | |
uniqueVisits.append(currentSession) | |
return len(uniqueVisits)>=6 and visitedPastThreeDays |
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
while (serverRunning) { | |
CHECK_IS_POSITIVE(msgrcv(publicServerQueueID, &readMessage, MESSAGE_SIZE, 0, 0)); | |
runCommand(&readMessage); | |
} | |
struct msqid_ds queueState; | |
CHECK_IS_POSITIVE_ERROR(msgctl(publicServerQueueID, IPC_STAT, &queueState),"er0"); | |
while (queueState.msg_qnum) { | |
CHECK_IS_POSITIVE_ERROR(msgctl(publicServerQueueID, IPC_STAT, &queueState),"ER1"); | |
CHECK_FALSE(msgrcv(publicServerQueueID, &readMessage, MESSAGE_SIZE, 0, 0)<0,"Failed to read remaining commands"); | |
runCommand(&readMessage); |
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
#ifndef COMMON_H | |
#define COMMON_H | |
#define MAX_MSG_SIZE 128 | |
#define MAX_CLIENTS 100 | |
#define PROJ_ID 12 | |
enum messageType{ |
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
%%%------------------------------------------------------------------- | |
%%% @author Aleksander | |
%%% @copyright (C) 2018, <COMPANY> | |
%%% @doc | |
%%% | |
%%% @end | |
%%% Created : 24. kwi 2018 11:27 | |
%%%------------------------------------------------------------------- | |
-module(processes). | |
-author("Aleksander"). |
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
#!/usr/bin/env python | |
# coding: utf-8 | |
import os | |
import re | |
importPattern = re.compile('from (.*?);') | |
def stripSpecial(text): | |
return ''.join(ch for ch in text if ch.isalnum()) |
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
package pl.edu.agh.ki.bd2; | |
import java.io.File; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.stream.Collectors; | |
import org.neo4j.driver.v1.*; | |
import static org.neo4j.driver.v1.Values.parameters; |
OlderNewer