Rodion Efremov coderodde
- Espoo, Finland
- Sign in to view email
- www.cs.helsinki.fi/u/rodionef
View Arrays.java
package net.coderodde.util; | |
import java.util.Random; | |
/** | |
* This class contains static methods for sorting {@code byte} arrays. | |
* | |
* @author Rodion "rodde" Efremov | |
* @version 1.6 (Apr 24, 2019) | |
*/ |
View Long.java
package net.coderodde.util; | |
import java.util.Random; | |
/** | |
* This class contains a method for converting {@code long} values to strings. | |
* | |
* @author Rodion "rodde" Efremov | |
* @version 1.6 (May 13, 2019) | |
*/ |
View semaphore_impl.cpp
#include "semaphore_impl.h" | |
#include <windows.h> | |
static const char* CLASS = "net/coderodde/util/concurrent/WindowsSemaphoreImpl"; | |
static const char* FIELD = "semaphoreHandle"; | |
static HANDLE get_semaphore_handle(JNIEnv* env, jobject obj) | |
{ | |
jclass clazz = env->FindClass(CLASS); | |
jfieldID fid = env->GetFieldID(clazz, FIELD, "J"); |
View dt_tag_entry.cpp
#include "dt_tag_entry.hpp" | |
#include <string> | |
#include <utility> | |
namespace net { | |
namespace coderodde { | |
namespace dt2 { | |
TagEntry::TagEntry(std::string const& tag, | |
std::string const& directory) |
View war.py
import copy | |
import random | |
import time | |
from heapq import heappush, heappop | |
class Country: | |
def __init__(self, name, resources): | |
self.name = name |
View main.c
#include "parallel_for.h" | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#if defined(__APPLE__) || defined(__linux__) | |
#define POSIX | |
#endif | |
#if defined(POSIX) |
View main.c
#include "parallel_for.h" | |
#include <stdio.h> | |
#include <stdlib.h> | |
#if defined(__APPLE__) | |
#include <sys/time.h> | |
#elif defined(__linux__) | |
#include <sys/time.h> | |
#elif defined(_WIN32) | |
#include <windows.h> | |
#else |
View Benchmark.java
package net.coderodde.boundaries; | |
import java.util.ArrayList; | |
import java.util.Random; | |
/** | |
* This class implements a benchmark for the boundary algorithms. | |
* | |
* @author Rodion "rodde" Efremov | |
* @version 1.6 (Dec 1, 2017) |
View IntegerPatternMatching.java
package net.coderodde.util; | |
import java.util.Random; | |
public class IntegerPatternMatching { | |
public static int getSubArrayIndex(int[] parentArr, int[] subArr) { | |
boolean found = false; | |
for (int i = 0; i <= parentArr.length - subArr.length; i++) { | |
if (parentArr[i] == subArr[0]) { |
View TupleIterable.java
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.Iterator; | |
import java.util.List; | |
import java.util.NoSuchElementException; | |
import java.util.Objects; | |
public final class TupleIterable<T> implements Iterable<List<T>> { |
NewerOlder