Skip to content

Instantly share code, notes, and snippets.

Avatar

Patrick Scheibe halirutan

View GitHub Profile
View ExtendWordSelectionHandler.java
/*
* Copyright 2000-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
View motion.json
[
{
"pitch": -0.00275278276189006,
"roll": 0.0015076132005304999,
"speed": 0.0,
"time": 0.0,
"x": -0.023359131607296746,
"y": -0.007570947447817389,
"yaw": 0.00893027461175061,
"z": -0.002685727323409992
View similarity.py
from numba import float64, boolean, prange, guvectorize, njit, set_num_threads
import numpy as np
@guvectorize([(boolean[:], boolean[:], float64[:])], '(n),(n)->()', nopython=True)
def tanimoto(fp_1, fp_2, res):
bw_or = np.sum(np.bitwise_or(fp_1, fp_2))
if bw_or != 0.0:
res[0] = np.sum(np.bitwise_and(fp_1, fp_2)) / bw_or
else:
View threeSum.c
#include <stdlib.h>
/**
* Return an array of arrays of size *returnSize.
* The sizes of the arrays are returned as *returnColumnSizes array.
* Note: Both returned array and *columnSizes array must be malloced, assume caller calls free().
*/
int** threeSum(int* nums, int numsSize, int* returnSize, int** returnColumnSizes){
*returnSize = 1;
*returnColumnSizes = (int*) malloc(1* sizeof(int));
*returnColumnSizes[0] = 3;
View rotate-right.c
#include <stdio.h>
struct ListNode
{
int val;
struct ListNode *next;
};
int getSize(struct ListNode *head)
View std::array
// Flache Liste funktioniert
std::array<std::array<Vec3, 2>,3> test{
Vec3{1,1,1},
Vec3{2,1,1},
Vec3{1,2,1},
Vec3{2,2,1},
Vec3{1,3,1},
Vec3{2,3,1}
@halirutan
halirutan / CMakeLists.txt
Created May 30, 2020
Late Night Coding OpenGL Particles
View CMakeLists.txt
cmake_minimum_required(VERSION 3.16)
project(LateNightCodingOpenGL)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR})
find_package(OpenGL REQUIRED)
find_package(glfw3 REQUIRED)
find_package(GLEW REQUIRED)
set(CMAKE_CXX_STANDARD 17)
View peg-example.cpp
#include <string>
#include "peglib.h"
using namespace peg;
using namespace std;
int main(void)
{ // (2) Make a parser
parser parser(R"(
# Grammar for Calculator...
@halirutan
halirutan / verifier.gradle.kts
Created Mar 9, 2020
Gradle task for locally verifying an IntelliJ Plugin
View verifier.gradle.kts
import org.gradle.api.internal.ConventionTask
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("de.undercouch:gradle-download-task:4.0.2")
}
}
View WLCommenter.java
/*
* Copyright (c) 2018 Patrick Scheibe
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*