Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

local params = {
help = "This is a dynamic parameter test SEXP",
min_args = 1,
max_args = math.huge,
return_type = "void",
params = {
["..."] = {
description = "Some arguments",
type = "boolean"
},
template<typename TIter>
flagset<T>& set_multiple(TIter begin, TIter end) {
auto current = begin;
while(current != end)
{
set(*current, true);
current = std::next(current);
}
import numpy as np
import pylab as plot
import sys
averageTime = 0.5
MICROSECONDS_PER_SECOND = 1000000.
normalLabel = sys.argv[1]
changedLabel = sys.argv[2]
From c449900b08e1a06954d0120690bb3d0859ddedf6 Mon Sep 17 00:00:00 2001
From: asarium <asarium@gmail.com>
Date: Sun, 31 May 2015 16:10:09 +0200
Subject: [PATCH] Fix memory leak
---
code/network/stand_gui-unix.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/code/network/stand_gui-unix.cpp b/code/network/stand_gui-unix.cpp
diff --git a/code/globalincs/vmallocator.h b/code/globalincs/vmallocator.h
index 0079d04..2bd9254 100644
--- a/code/globalincs/vmallocator.h
+++ b/code/globalincs/vmallocator.h
@@ -54,9 +54,15 @@ public:
typedef const value_type& const_reference;
/* portej05 does not like this particular function. */
- void construct( pointer p, const T& value )
+ void construct(pointer p, const T& arg)
MACRO(SETUP_LOCATIONS CONFIGURATION)
string(TOUPPER ${CONFIGURATION} CONF_UPPER)
SET(WRAPPER_PATH)
IF (MSVC_VERSION EQUAL 1800)
SET(WRAPPER_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${CONFIGURATION}/MSVC12/libcef_dll_wrapper.lib")
ELSE(MSVC_VERSION EQUAL 1800)
MESSAGE("No prebuilt cef dll wrapper libraries are available for your compiler!")
ENDIF(MSVC_VERSION EQUAL 1800)
/*Flagset*/
template <class T,
typename size_type = typename std::underlying_type<T>::type,
size_type size = static_cast<size_type>(T::NUM_VALUES)>
class flagset {
SCP_bitset<size> values;
public:
bool& operator[](T idx) { return values[(static_cast<size_type>(idx)]; };
const bool& operator[](T idx) { return values[static_cast<size_type>(idx)]; } const;
Index: code/cmdline/cmdline.cpp
===================================================================
--- code/cmdline/cmdline.cpp (revision 10476)
+++ code/cmdline/cmdline.cpp (working copy)
@@ -190,7 +190,6 @@
{ "-save_render_target", "Save render targets to file", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-save_render_target", },
{ "-debug_window", "Display debug window", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-debug_window", },
{ "-verify_vps", "Spew VP CRCs to vp_crcs.txt", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-verify_vps", },
- { "-nograb", "Don't grab mouse/keyboard in a window", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-nograb", },
{ "-reparse_mainhall", "Reparse mainhall.tbl when loading halls", false, 0, EASY_DEFAUL
Index: code/io/mouse.cpp
===================================================================
--- code/io/mouse.cpp (revision 10476)
+++ code/io/mouse.cpp (working copy)
@@ -201,17 +201,21 @@
mouse_flags &= ~flags;
}
- LEAVE_CRITICAL_SECTION( mouse_lock );
+ LEAVE_CRITICAL_SECTION(mouse_lock);
@asarium
asarium / DataObjectSample.cs
Created March 11, 2013 09:02
Sample of how to use IDragInfo.DataObject to use custom instances of IDataObject in gong-wpf-dragdrop.
public class DataObjectSample : IDragSource
{
public virtual void StartDrag(IDragInfo dragInfo)
{
var itemCount = dragInfo.SourceItems.Cast<object>().Count();
if (itemCount == 1)
{
dragInfo.Data = dragInfo.SourceItems.Cast<object>().First();
}