Skip to content

Instantly share code, notes, and snippets.

View AvramPop's full-sized avatar

Dani Pop AvramPop

View GitHub Profile
import ro.ubb.domain.exceptions.ClassReflectionException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.StreamSupport;
public class Sort {
private List<Map.Entry<Direction, String>> sortingChain;
--create database TestSeminar
--go
use TestSeminar
go
if object_id('RoutesStations', 'U') is not null
drop table RoutesStations
if object_id('Stations', 'U') is not null
@AvramPop
AvramPop / Main.java
Created November 6, 2019 18:36
lica
package avram.pop;
import javax.sound.midi.Soundbank;
import java.util.ArrayList;
import java.util.List;
public class Main {
public static void main(String[] args) {
// Man dani = new Man(5, 9, "Dani");
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/types.h>
#include <string.h>
#include <stdio.h>
int main (){
struct sockaddr_in soc;
int sfd;
import socket
soc = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
soc.bind(("0.0.0.0", 5555))
while True:
buff, addr = soc.recvfrom(100)
message = buff.decode("utf-8")
if message == "close":
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <stdio.h>
#include <string.h>
int main(int argc, char const *argv[]) {
int socketDescriptor = socket(AF_INET, SOCK_STREAM, 0);
char message[100], receivedMessage[100];
import socket
from threading import Thread
def clientCommunication(currentSocket, i):
print("opened communication to client #" + str(i))
while True:
receivedBuffer = currentSocket.recv(1024)
message = receivedBuffer.decode("utf-8")
if message == "close":
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h> /* close */
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
class ClientFileRepository(ClientRepo):
def __init__(self, fileName) -> None:
super().__init__()
self.__fileName = fileName
self.__file = None
def hasClientWithId(self, clientId):
self.__loadRepo()
hasClientWithId = super().hasClientWithId(clientId)