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
trigger UpdateRelatedObjects on Contact (after update) { | |
// this is meant for reproducing an issue where after the Household lookup on a Contact changes, | |
// empty Households are deleted, and then a Contact's workflow rule evaluation will fail due to | |
// the Household being deleted (despite the fact that it now points to a different Household) | |
// in this experiment TestRelatedObject takes the place of Household, as I have installed the NPSP | |
// in my dev org, and already had TestRelatedObject from a previous experiment | |
// follow code from NPSP (taken off Github): | |
list<id> blankHHDeletes = new list<id>(); | |
List<id> oldHouseholds = new list<id>(); |
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
// experiments for varying class member function behavior with | |
// class template args, member template args, and member function overloads | |
// Jeff Trull 2012-08-23 | |
#include <string> | |
#include <iostream> | |
template<typename T> | |
struct Foo { |
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 <iostream> | |
#include <memory> | |
#include <boost/thread.hpp> | |
#include <thread> | |
#include <map> | |
#include <vector> | |
typedef std::map<std::size_t, boost::thread> ThreadContainer; | |
// this one produces the same error: | |
// typedef std::vector<std::pair<std::size_t, boost::thread> > ThreadContainer; |
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
.title NGSpice coupling simulation circuit for comparison with odeint | |
* by Jeff Trull <[email protected]> 2012-05-25 | |
*** passive subcircuit module representing the driver impedances, traces, and receiver loads | |
*** (leaves input voltages to caller) | |
.subckt coupling_testcase aggdrv vicdrv aggrcv vicrcv gnd | |
+ raggdrv=100 ragg1=1k cagg1=100f ragg2=1k cagg2=100f caggl=20f | |
+ rvicdrv=100 rvic1=1k cvic1=100f rvic2=1k cvic2=100f cvicl=20f | |
+ ccoup=100f |
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
// Test of odeint using intersignal coupling | |
// Jeff Trull <[email protected]> 2012-05-16 | |
#include <vector> | |
using namespace std; | |
#include <boost/numeric/odeint.hpp> | |
using namespace boost::numeric; | |
typedef vector<double> state_type; |
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
// Attempt at making a Boost grammar that successfully parses Jason Shankel's predicate logic language | |
// #define BOOST_SPIRIT_DEBUG | |
#include <boost/spirit/include/qi.hpp> | |
#include <boost/variant/recursive_variant.hpp> | |
#include <boost/fusion/include/adapt_struct.hpp> | |
#include <boost/spirit/include/phoenix.hpp> | |
#include <boost/optional.hpp> | |
// start with the AST |
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 <sstream> | |
#include <iostream> | |
#include <boost/spirit/include/lex_lexertl.hpp> | |
#include <boost/spirit/include/lex_lexertl_position_token.hpp> | |
#include <boost/spirit/include/support_istream_iterator.hpp> | |
// if this gets defined, my parse passes and all input is consumed | |
// #define BOOST_SPIRIT_DEBUG | |
// if it is not defined, my parse passes but not all input is consumed |
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
// Example of running Ruby in a separate thread | |
// 2012-01-08 by Jeff Trull <[email protected]> | |
#include <iostream> | |
#include <queue> | |
#include <string> | |
#include <set> | |
#include <boost/thread.hpp> | |
#include <boost/thread/mutex.hpp> |
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
// testcase for nice error messages in lexer-based parser | |
#define BOOST_SPIRIT_USE_PHOENIX_V3 | |
#include <iostream> | |
#include <sstream> | |
#include <boost/spirit/include/phoenix.hpp> | |
#include <boost/spirit/include/lex_lexertl.hpp> | |
#include <boost/spirit/include/lex_lexertl_position_token.hpp> | |
#include <boost/spirit/include/qi.hpp> | |
#include <boost/spirit/include/support_istream_iterator.hpp> |
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
// very basic embedded Ruby interpreter for C++ programs | |
// thrown together by Jeff Trull <[email protected]> based on googling and asking questions on #ruby-lang | |
#include <ruby.h> | |
// access to C variables | |
static VALUE getter(VALUE ns, VALUE var) { | |
return Qfalse; | |
} | |
VALUE setter(VALUE ns, VALUE var, VALUE val) { |