Skip to content

Instantly share code, notes, and snippets.

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
public class ThreadPool implements IThreadPool {
private List<PoolThread> threads;
private BlockingQueue<ITask> tasks;
private volatile boolean isStopped = false;
import java.util.concurrent.BlockingQueue;
public class PoolThread extends Thread {
private BlockingQueue<ITask> tasks;
private boolean isStopped = false;
public PoolThread(BlockingQueue<ITask> tasks) {
this.tasks = tasks;
}
public class Summator implements ITask {
private byte endRange;
private long result;
public Summator(byte endRange) {
this.endRange = endRange;
this.result = 0;
}
@maudzekod4000
maudzekod4000 / main.cpp
Created February 6, 2020 14:40
A short program that receives two integers from the command line input and sorts them to standart output
//
// main.cpp
// hellocpp
//
// Created by Valeri Hristov on 6.02.20.
// Copyright © 2020 Valeri Hristov. All rights reserved.
//
#include <iostream>
@maudzekod4000
maudzekod4000 / main.cpp
Created February 6, 2020 14:49
Outputs to standart output the sign of the multiplication of 3 numbers without actually doing the calculation (*).
//
// main.cpp
// hellocpp
//
// Outputs to standart output the sign of the multiplication of 3 numbers without actually doing the calculation (*).
//
// Created by Valeri Hristov on 6.02.20.
// Copyright © 2020 Valeri Hristov. All rights reserved.
//
@maudzekod4000
maudzekod4000 / main.cpp
Created February 6, 2020 15:15
Calculates the roots of a quadratic equation.
//
// main.cpp
// hellocpp
//
// Calculates the roots of a quadratic equation.
//
// Created by Valeri Hristov on 6.02.20.
// Copyright © 2020 Valeri Hristov. All rights reserved.
//
//
// main.cpp
// hellocpp
//
// Finds min and max of the numbers incoming from standart in.
//
// Created by Valeri Hristov on 6.02.20.
// Copyright © 2020 Valeri Hristov. All rights reserved.
//
@maudzekod4000
maudzekod4000 / gcd.cpp
Created February 7, 2020 09:11
Intuitive algorithm
//
// main.cpp
// hellocpp
//
// Finds GCD, intuitive algorithm
//
// Created by Valeri Hristov on 6.02.20.
// Copyright © 2020 Valeri Hristov. All rights reserved.
//
@maudzekod4000
maudzekod4000 / factorial_trailing.cpp
Created February 7, 2020 09:26
Finds number of trailing zeroes in factorial.
//
// main.cpp
// hellocpp
//
// Finds number of trailing zeroes in factorial problem.
//
// Created by Valeri Hristov on 6.02.20.
// Copyright © 2020 Valeri Hristov. All rights reserved.
//
@maudzekod4000
maudzekod4000 / compare_arrays.cpp
Created February 7, 2020 09:48
Compares arrays, non templatearized
//
// main.cpp
// hellocpp
//
// Compare arrays.
//
// Created by Valeri Hristov on 6.02.20.
// Copyright © 2020 Valeri Hristov. All rights reserved.
//