Skip to content

Instantly share code, notes, and snippets.

View LB--'s full-sized avatar

LB--

  • Clickteam
View GitHub Profile
@LB--
LB-- / Lacewing Handler Wrapper Classes
Created March 17, 2012 04:59
Lacewing Handler Wrapper Classes
http://www.LB-Stuff.com/C++/LacewingHandlerHeaven.png
[17:31] <Looki> http://img217.imageshack.us/img217/9412/screenshot2012090300303.jpg (disclaimer: I didn't use imageshack, ZScreen did)
[17:31] <Looki> nifflas showing his game to some reporter... it was so funny, he just breezed through the entire game
[17:31] <Looki> like some kind of japanese speedrunner
@LB--
LB-- / avaJ
Created November 10, 2012 00:06
wip
package avaj;
public final class reterpretnI
{
private reterpretnI
(
) throws java.lang.UnsupportedOperationException
{
throw new java.lang.UnsupportedOperationException
(
@LB--
LB-- / LiveScript.java
Created November 10, 2012 00:12
Java Reflection Interactive
import java.util.*;
import java.lang.reflect.*;
public class LiveScript
{
private LiveScript() throws UnsupportedOperationException
{
throw new UnsupportedOperationException();
}
import java.math.BigInteger;
import java.io.File;
import java.io.FileOutputStream;
public class BaseConvert
{
public static void main(String[] args) throws Throwable
{
if(args.length < 3)
{
SAMPLERATE = 44100
function sin(x)
return math.sin(2*math.pi*x/SAMPLERATE)
end
function pcm(i)
f = 1000
return (2/math.pi)*(
sin( 2*f*i*param)/2 -
@LB--
LB-- / gist:5428290
Created April 21, 2013 02:59
This doesn't work like I wanted it to, but it's too cool to just delete.
template<typename T>
operator typename std::enable_if<std::is_arithmetic<T>::value && !std::is_floating_point<T>::value && !std::is_same<T, bool>::value, T>::type() const noexcept
{
return static_cast<T>(static_cast<json_int_t>(value));
}
prog.cpp:15:68: error: could not convert ‘std::unordered_map<const std::basic_string<char>, int , <lambda(const string&)> , std::equal_to<const std::basic_string<char> >, std::allocator<std::pair<const std::basic_string<char>, int > > >(bucketCount, (* & hf), (*(const key_equal*)(& std::unordered_map<const std::basic_string<char>, int, <lambda(const string&)>, std::equal_to<const std::basic_string<char> >, std::allocator<std::pair<const std::basic_string<char>, int> > >::key_equal())), (*(const allocator_type*)(& std::allocator<std::pair<const std::basic_string<char>, int> >())))’
from ‘std::unordered_map<const std::basic_string<char>, int , <lambda(const string&)> , std::equal_to<const std::basic_string<char> >, std::allocator<std::pair<const std::basic_string<char>, int > > >’
to ‘std::unordered_map<const std::basic_string<c
@LB--
LB-- / enable_execute_stack.c
Created June 6, 2013 19:24
I had to modify this file when compiling LLVM & CLang on Windows via MinGW 64, hope this helps others.
/* ===-- enable_execute_stack.c - Implement __enable_execute_stack ---------===
*
* The LLVM Compiler Infrastructure
*
* This file is dual licensed under the MIT and the University of Illinois Open
* Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*/
@LB--
LB-- / gist:5727166
Created June 7, 2013 05:04
Trying to build llvm and clang, running into this at 82%
C:\Users\Nicholas>cd /d C:\Users\Nicholas\Desktop\llvm-build\tools\clang\lib\AST
Matchers\Dynamic && C:\MinGW64\bin\x86_64-w64-mingw32-g++.exe -DCLANG_ENABLE_A
RCMT -DCLANG_ENABLE_REWRITER -DCLANG_ENABLE_STATIC_ANALYZER -D_GNU_SOURCE -D__S
TDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Wall -W -Wno-u
nused-parameter -Wwrite-strings -Wno-missing-field-initializers -pedantic -Wno-l
ong-long -Wno-maybe-uninitialized -Wnon-virtual-dtor -fno-common -Woverloaded-vi
rtual -Wcast-qual -fno-strict-aliasing -fno-rtti @CMakeFiles/clangDynamicASTMatc
hers.dir/includes_CXX.rsp -fno-exceptions -o CMakeFiles\clangDynamicASTMatcher
s.dir\Registry.cpp.obj -c C:\Users\Nicholas\Desktop\llvm\tools\clang\lib\ASTMatc