Skip to content

Instantly share code, notes, and snippets.

View antonioalmeidab's full-sized avatar

Antonio Almeida antonioalmeidab

View GitHub Profile

Java

Writing a Test program

  1. Launch Terminator
  2. Make a new directory for your Java project
    1. Type mkdir new_project && cd new_project
    2. Type touch Test.java.
    3. Type osub Test.java and paste this code.
      public class Test {
      

public static void main(String[] args) {

@antonioalmeidab
antonioalmeidab / main.c
Created October 13, 2019 17:10
Memory allocation algorithm
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define BUFFER_LENGTH 20
void slice(char *dest, char *str, int begin, int num_of_chars);
void handle_request(char* command, short (*array)[]);
void insert_process(char* command, short (*array)[], short process);
int parse_process(char* token);
/**
* Implementation of thread pool.
*/
#include <pthread.h>
#include <stdlib.h>
#include <stdio.h>
#include <semaphore.h>
#include "threadpool.h"