This file contains 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
# at config time, it tells me it sees configuration to allow 'test1': | |
06/05/12 14:46:08 IPVERIFY: allow WRITE: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected] (from config value ALLOW_WRITE) | |
# I'm interested in what this means: | |
06/05/12 14:46:08 Authorizations yet to be resolved: | |
06/05/12 14:46:08 allow WRITE: [email protected]/* [email protected]/* [email protected]/* [email protected]/* [email protected]/* [email protected]/* | |
# When the rubber hits the road, it resolves as 'deny': | |
06/05/12 14:46:55 Adding to resolved authorization table: test1/192.168.1.2: DENY_ADMINISTRATOR |
This file contains 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
# spoof some cores | |
NUM_CPUS = 20 | |
# declare an extensible resource for a 'claim-based' consumption policy | |
MACHINE_RESOURCE_tokens = 3 | |
# startd-wide consumption policy config | |
# defaults for cpus/memory/disk consumption | |
CONSUMPTION_POLICY = True | |
SLOT_WEIGHT = Cpus |
This file contains 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
/******* | |
edit_distance: STL and Boost compatible edit distance functions for C++ | |
Copyright (c) 2013 Erik Erlandson | |
Author: Erik Erlandson <[email protected]> | |
Distributed under the Boost Software License, Version 1.0. | |
See accompanying file LICENSE or copy at | |
http://www.boost.org/LICENSE_1_0.txt |
This file contains 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
/******* | |
Demonstrate a Boost/MPL style macro to create predicate templates for class member checking | |
Copyright (c) 2013 Erik Erlandson | |
Author: Erik Erlandson <[email protected]> | |
Distributed under the Boost Software License, Version 1.0. | |
See accompanying file LICENSE or copy at | |
http://www.boost.org/LICENSE_1_0.txt |
This file contains 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 <boost/utility/enable_if.hpp> | |
#include <boost/typeof/std/utility.hpp> | |
using boost::false_type; | |
using boost::true_type; | |
using boost::enable_if; | |
// always evaluates to true, as long as expression that generated 'X' compiled | |
template <typename X> struct invoke : public true_type {}; |
This file contains 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 <boost/parameter/name.hpp> | |
#include <boost/parameter/preprocessor.hpp> | |
BOOST_PARAMETER_NAME(b) | |
BOOST_PARAMETER_NAME(c) | |
BOOST_PARAMETER_FUNCTION( | |
// Deduce return type from an argument type | |
// This is not documented, but seems like it could be officially supported: | |
(typename boost::parameter::value_type<Args, tag::c, int>::type), |
This file contains 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 <iostream> | |
#include <boost/parameter/name.hpp> | |
#include <boost/parameter/preprocessor.hpp> | |
#include <boost/type_traits/is_arithmetic.hpp> | |
#include <boost/utility/enable_if.hpp> | |
using boost::is_same; | |
using boost::false_type; | |
using boost::true_type; |
This file contains 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
# This macro is designed to work with the GNU toolchain, | |
# where the linker is called indirectly via 'gcc' | |
# You can invoke it as in this example: | |
# check_gnu_linker_flag("-pie", cxx_linker_pie) | |
# to test if the linker supports '-pie', and store the result in | |
# variable 'cxx_linker_pie', in the same fashion as check_cxx_compiler_flag() | |
# Note, some versions of gnu linker will accept some unknown arguments | |
# for example -z <arg> may succeed whether <arg> is supported or not, | |
# although I've found this to work in newer GNU versions. |
This file contains 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
// initialize this with the maximum possible distance: | |
Dbest = M+N; | |
P = 0; | |
while (true) { | |
// the minimum possible distance for the current P value | |
Dmin = 2*(P-1) + delta; | |
// if the minimum possible distance is >= our best-known distance, we can halt | |
if (Dmin >= Dbest) return Dbest; |
This file contains 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 <iostream> | |
using namespace std; | |
#define showsize(tname) cout << #tname << ": " << sizeof(tname) << endl | |
int main(int argv, char** argc) { | |
showsize(char); | |
showsize(short); | |
showsize(int); |
OlderNewer