This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
die() { echo "$@" 1>&2 ; exit 1; } | |
[ $# -gt 2 ] && die "Max 2 arguments." | |
PROGRAM=$1 | |
[ -z "$PROGRAM" ] && die "No arguments passed." | |
[ ! -f "$PROGRAM" ] && die "Program does not exist." | |
ITER=${2:-1000} # default 1000 iterations | |
echo "Executing $ITER tests on $PROGRAM." | |
for i in `seq 1 $ITER`; do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
inline void swap(char * str, int a, int b) { | |
char * tmp = str[a]; | |
str[a] = str[b]; | |
str[b] = tmp; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef FOO_H | |
#define FOO_H | |
#ifdef __cplusplus | |
extern "C" { | |
#endif | |
int foo(); | |
#ifdef __cplusplus |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include "CoreMinimal.h" | |
#include "Layout/Margin.h" | |
#include "Widgets/DeclarativeSyntaxSupport.h" | |
#include "Widgets/SCompoundWidget.h" | |
#include "Widgets/SNullWidget.h" | |
#include "Widgets/SWidget.h" | |
#include "Widgets/Layout/SBox.h" | |
#include "Widgets/Text/STextBlock.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
scene = bpy.context.scene | |
def get_root_armature(collection): | |
for obj in collection.objects: | |
if obj.type == 'ARMATURE': | |
return obj | |
else: | |
return collection.objects['Root'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
import os | |
rig_file = bpy.data.filepath | |
model_file = rig_file.replace('.Rig.', '.Model.') | |
if not os.path.exists(model_file): | |
raise Exception("Model file does not exist.") | |
if bpy.data.collections['Model'] is not None: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<log4net> | |
<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender"> | |
<layout type="log4net.Layout.PatternLayout"> | |
<conversionPattern value="%message%newline" /> | |
</layout> | |
</appender> | |
<appender name="FileAppender" type="log4net.Appender.FileAppender"> | |
<file value="loader.log.txt" /> | |
<appendToFile value="true" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add in a BP function library: | |
/** | |
* Create a transient render target. This version exposes bForceLinearGamma. | |
*/ | |
UFUNCTION(BlueprintCallable, Category = "Liv", meta = (WorldContext = "WorldContextObject")) | |
static UTextureRenderTarget2D* CreateRenderTarget2D( | |
UObject* WorldContextObject, | |
int32 Width, | |
int32 Height, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <functional> | |
#include <streambuf> | |
#include <iostream> | |
/** | |
* \brief Hooks into any writes to the given ostream. | |
* \tparam Duplicate If duplicate is true then it will pass through to the original stream. | |
*/ | |
template<bool Duplicate> | |
class callback_streambuf final : public std::streambuf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<typename CallbackType> | |
struct callback_test final | |
{ | |
callback_test(CallbackType&& callback) | |
: callback(std::forward<CallbackType>(callback)) | |
{ | |
} | |
template<typename... U> |