Skip to content

Instantly share code, notes, and snippets.

View Naalunth's full-sized avatar

Lilith Schier Naalunth

  • Germany
View GitHub Profile
@Naalunth
Naalunth / Chocolatey update.xml
Last active February 13, 2019 11:36
My Chocolatey Init Script
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2017-09-02T06:06:26.4127851</Date>
<Author>DESKTOP-IHM8F2V\Kevin</Author>
<URI>\Chocolatey update</URI>
</RegistrationInfo>
<Triggers>
<CalendarTrigger>
<Repetition>
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
public class RadixSort {
private int key(Integer element, int digit) throws IllegalArgumentException {
if (element < 0) throw new IllegalArgumentException("element was negative");
@Naalunth
Naalunth / EliteTrackerPlugin.cs
Last active April 4, 2017 05:13
EliteTrackerPlugin
using System;
using System.Collections.Generic;
using System.Linq;
using System.Diagnostics;
using SharpDX.DirectWrite;
using Turbo.Plugins.Default;
namespace Turbo.Plugins.Naalunth
{
public class EliteTrackerPlugin : BasePlugin, IInGameWorldPainter, IMonsterKilledHandler, IInGameTopPainter, ICustomizer, INewAreaHandler
/*
Current implemenetation (v4):
Based on version 3:
- combines the equal calculations between parameters into a single calculation and therefore has to calculate a lot less
- Computational time: O(k*N) (loop -> ( std::partial_sum, loop ) ) ( + sort O(k*log(k)), k is usually a lot smaller than N so that doesn't matter)
- Memory: O(N+k) (a lot of data can be ignored while going on)
- boils down to adding a lot of numbers repeatedly together
- code becomes totally unclear and unintuitive, but works extremely quickly
- slightly optimized for sorted input (see constructor)
- two container optimization removed, it wasn't doing anything anymore, other than adding complexity
@Naalunth
Naalunth / disjoint_set.hpp
Last active October 12, 2019 12:42
Disjoint-set implementation in C++
#pragma once
#include <map>
/*
This is an implementation of the disjoint-set data structure according to https://en.wikipedia.org/wiki/Disjoint-set_data_structure.
T must be equal-comparable and copy-constructible.
*/
template<typename T>
class disjoint_set