text:
package net.ssehub.easy.instantiation.rt.core.model.rtVil;

import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;

import net.ssehub.easy.basics.logger.EASyLoggerFactory;
import net.ssehub.easy.basics.logger.EASyLoggerFactory.EASyLogger;
import net.ssehub.easy.basics.progress.ProgressObserver;
import net.ssehub.easy.instantiation.core.model.buildlangModel.BuildlangExecution;
import net.ssehub.easy.instantiation.core.model.buildlangModel.IRuleElement;
import net.ssehub.easy.instantiation.core.model.buildlangModel.Resolver;
import net.ssehub.easy.instantiation.core.model.buildlangModel.Rule;
import net.ssehub.easy.instantiation.core.model.buildlangModel.RuleCallExpression;
import net.ssehub.easy.instantiation.core.model.buildlangModel.RuleDescriptor;
import net.ssehub.easy.instantiation.core.model.buildlangModel.RuleExecutionContext;
import net.ssehub.easy.instantiation.core.model.buildlangModel.RuleExecutionResult;
import net.ssehub.easy.instantiation.core.model.buildlangModel.RuntimeEnvironment;
import net.ssehub.easy.instantiation.core.model.buildlangModel.VariableDeclaration;
import net.ssehub.easy.instantiation.core.model.buildlangModel.RuleExecutionResult.Status;
import net.ssehub.easy.instantiation.core.model.common.VilException;
import net.ssehub.easy.instantiation.core.model.expressions.CallArgument;
import net.ssehub.easy.instantiation.core.model.expressions.Expression;
import net.ssehub.easy.instantiation.core.model.expressions.ExpressionParserRegistry.ILanguage;
import net.ssehub.easy.instantiation.core.model.vilTypes.IMetaType;
import net.ssehub.easy.instantiation.core.model.vilTypes.TypeDescriptor;
import net.ssehub.easy.instantiation.core.model.vilTypes.TypeRegistry;
import net.ssehub.easy.instantiation.core.model.vilTypes.configuration.Configuration;
import net.ssehub.easy.instantiation.core.model.vilTypes.configuration.DecisionVariable;
import net.ssehub.easy.instantiation.core.model.vilTypes.configuration.IChangeHistoryTracer;
import net.ssehub.easy.instantiation.core.model.vilTypes.configuration.IvmlTypes;
import net.ssehub.easy.instantiation.rt.core.model.rtVil.AbstractBreakdownCall.TupleField;
import net.ssehub.easy.instantiation.rt.core.model.rtVil.types.RtVilTypeRegistry;
import net.ssehub.easy.instantiation.rt.core.model.rtVil.types.TupleType;
import net.ssehub.easy.instantiation.rt.core.model.rtVil.types.TupleType.TupleInstance;
import net.ssehub.easy.reasoning.core.frontend.ReasonerAdapter;
import net.ssehub.easy.reasoning.core.reasoner.Message;
import net.ssehub.easy.reasoning.core.reasoner.ReasonerConfiguration;
import net.ssehub.easy.reasoning.core.reasoner.ReasoningResult;
import net.ssehub.easy.varModel.confModel.IDecisionVariable;
import net.ssehub.easy.varModel.model.Constraint;
import net.ssehub.easy.varModel.model.values.BooleanValue;
import net.ssehub.easy.varModel.persistency.StringProvider;

/**
 * Executes an rtVil adaptation script.
 *
 * @author Holger Eichelberger
 */
public class RtVilExecution extends BuildlangExecution implements IRtVilVisitor {

    public static final ILanguage<Resolver> LANGUAGE = new ILanguage<Resolver>() {

        @Override
        public String getName() {
            return "rt-VIL";
        }

    };

    public static final ReasonerConfiguration REASONER_CONFIGURATION = new ReasonerConfiguration();

    static {
        REASONER_CONFIGURATION.setRuntimeMode(true);
    }

    /**
     * Defines a fallback in case that a dynamic call cannot be resolved.
     *
     * @author Holger Eichelberger
     */
    private interface IDynamicCallFallback {

        /**
         * Implements the specific fallback call.
         *
         * @param evaluator the current evaluator instance
         * @param args the call arguments
         * @return the call result
         * @throws VilException in case that the call fails
         */
        public Object call(RtVilExecution evaluator, CallArgument... args) throws VilException;
    }

    /**
     * A fallback to IVML reasoning. The second argument is the current configuration
     * in terms of a VIL instance.
     */
    private static final IDynamicCallFallback VALIDATE_FALLBACK = new IDynamicCallFallback() {

        // checkstyle: stop exception type check

        @Override
        public Object call(RtVilExecution evaluator, CallArgument... args) throws VilException {
            IRtVilConcept concept = obtainConcept(evaluator, 0, args);
            Configuration cfg = obtainConfiguration(evaluator, 1, args);
            return evaluator.reason(cfg, concept, null);
        }

        // checkstyle: resume exception type check

    };

    /**
     * A fallback to no reasoning.
     */
    private static final IDynamicCallFallback VALIDATE_NO_REASONER_FALLBACK = new IDynamicCallFallback() {

        @Override
        public Object call(RtVilExecution evaluator, CallArgument... args) throws VilException {
            evaluator.getTracer().trace("Reasoner execution: " + true); // keep testing stable although disabled
            return true;
        }
    };

    /**
     * A fallback for the start VIL rule.
     */
    private static final IDynamicCallFallback START_FALLBACK = new IDynamicCallFallback() {

        @Override
        public Object call(RtVilExecution evaluator, CallArgument... args) throws VilException {
            Configuration cfg = obtainConfiguration(evaluator, 1, args);
            if (null != cfg) {
                cfg.getChangeHistory().start();
            }
            return null;
        }
    };

    /**
     * A fallback for the succeeded VIL rule.
     */
    private static final IDynamicCallFallback SUCCEEDED_FALLBACK = new IDynamicCallFallback() {

        @Override
        public Object call(RtVilExecution evaluator, CallArgument... args) throws VilException {
            Configuration cfg = obtainConfiguration(evaluator, 1, args);
            if (null != cfg) {
                cfg.getChangeHistory().commit();
            }
            return null;
        }
    };

    /**
     * A fallback for the update VIL rule.
     */
    private static final IDynamicCallFallback UPDATE_FALLBACK = new IDynamicCallFallback() {

        @Override
        public Object call(RtVilExecution evaluator, CallArgument... args) throws VilException {
            return null;
        }
    };

    /**
     * A fallback for the failed VIL rule.
     */
    private static final IDynamicCallFallback FAILED_FALLBACK = new IDynamicCallFallback() {

        @Override
        public Object call(RtVilExecution evaluator, CallArgument... args) throws VilException {
            Configuration cfg = obtainConfiguration(evaluator, 1, args);
            if (null != cfg) {
                cfg.getChangeHistory().rollback();
            }
            return null;
        }
    };

    /**
     * A fallback for the bind values VIL rule.
     */
    private static final IDynamicCallFallback BIND_VALUES_FALLBACK = new IDynamicCallFallback() {

        @Override
        public Object call(RtVilExecution evaluator, CallArgument... args) throws VilException {
            return null;
        }

    };

    /**
     * A fallback for the initialize VIL rule.
     */
    private static final IDynamicCallFallback INITIALIZE_FALLBACK = new IDynamicCallFallback() {

        @Override
        public Object call(RtVilExecution evaluator, CallArgument... args) throws VilException {
            return null;
        }

    };

    private static final EASyLogger LOGGER = EASyLoggerFactory.INSTANCE.getLogger(RtVilExecution.class, Bundle.ID);

    private List<IRtVilConcept> successful = new LinkedList<IRtVilConcept>();
    private boolean stopAfterBindValues = false;
    private boolean useReasoner = true;
    private boolean enableEnactment = true;
    private Script currentScript;
    private IRtValueAccess valueAccess;
    private IReasoningHook reasoningHook = DefaultReasoningHook.INSTANCE;
    private String lastFailReason;
    private Integer lastFailCode;
    private ITracer rtTracer;
    private IChangeHistoryTracer chgTracer;
    private int nestedStrategyCount;
    private ReasonerAdapter reasonerCache = new ReasonerAdapter();

    /**
     * Creates a new execution environment for evaluating local expressions.
     */
    public RtVilExecution() {
        super(new RuntimeEnvironment(RtVilTypeRegistry.INSTANCE));
    }

    /**
     * Creates a new execution environment.
     *
     * @param tracer the tracer
     * @param base the base directory for making files absolute
     * @param parameter the top-level parameter for the script to be executed
     */
    public RtVilExecution(net.ssehub.easy.instantiation.core.model.buildlangModel.ITracer tracer, File base,
        Map<String, Object> parameter) {
        super(tracer, base, parameter);
        this.valueAccess = new IRtValueAccess() {

            @Override
            public Object getValue(net.ssehub.easy.instantiation.core.model.common.
                VariableDeclaration var) throws VilException {
                return getRuntimeEnvironment().getValue(var);
            }
        };
        if (tracer instanceof ITracer) {
            rtTracer = (ITracer) tracer;
        }
    }

    /**
     * Defines whether execution shall stop after binding monitoring values (default: false).
     *
     * @param stopAfterBindValues whether the full script shall be executed or only values shall be bound to initialize
     *   the runtime configuration
     */
    public void setStopAfterBindValues(boolean stopAfterBindValues) {
        this.stopAfterBindValues = stopAfterBindValues;
    }

    /**
     * Defines whether the reasoner shall be used (default: true).
     *
     * @param useReasoner make use of the reasoner or default to consistent model
     */
    public void setUseReasoner(boolean useReasoner) {
        this.useReasoner = useReasoner;
    }

    /**
     * Enables or disables the enactment phase (default: enabled).
     *
     * @param enableEnactment enables the enactment
     */
    public void setEnableEnactment(boolean enableEnactment) {
        this.enableEnactment = enableEnactment;
    }

    /**
     * Defines the actual reasoning hook.
     *
     * @param reasoningHook the reasoning hook (ignored if null)
     */
    public void setReasoningHook(IReasoningHook reasoningHook) {
        if (null != reasoningHook) {
            this.reasoningHook = reasoningHook;
        }
    }

    /**
     * Sets the reasoner cache. No change happens if {@code reasonerCache} is null.
     *
     * @param reasonerCache the reasoner cache
     */
    public void setReasonerCache(ReasonerAdapter reasonerCache) {
        if (null != reasonerCache) {
            this.reasonerCache = reasonerCache;
        }
    }

    /**
     * Compose the plain text of reasoner failures.
     *
     * @param msg the message to be turned into text
     * @return the description text
     */
    public static String toText(Message msg) {
        String result = msg.getDescription();
        List<Set<IDecisionVariable>> info = msg.getProblemVariables();
        if (null != info) {
            result += " problem vars: ";
            Iterator<Set<IDecisionVariable>> iter = info.iterator();
            while (iter.hasNext()) {
                Set<IDecisionVariable> set = iter.next();
                result += "{";
                Iterator<IDecisionVariable> iter2 = set.iterator();
                while (iter2.hasNext()) {
                    IDecisionVariable var = iter2.next();
                    result += net.ssehub.easy.varModel.confModel.Configuration.getInstanceName(var);
                    if (iter2.hasNext()) {
                        result += ", ";
                    }
                }
                result += "}";
                if (iter.hasNext()) {
                    result += ", ";
                }
            }
        }

        List<Constraint> cstr = msg.getProblemConstraints();
        if (null != cstr && cstr.size() > 0) {
            result += "problem constraints: ";
            for (int i = 0; i < cstr.size(); i++) {
                if (i > 0) {
                    result += ", ";
                }
                result += StringProvider.toIvmlString(cstr.get(i).getConsSyntax());
            }
        }
        return result;
    }

    // checkstyle: stop exception type check

    /**
     * Performs reasoning for rt-VIL based on the knowledge in this instance.
     *
     * @param cfg the configuration to reason on (may be a projected one, shall be compliant with the
     *     configuration the executor was called or one of its projections)
     * @param concept the language concept the reasoning was called for (as required by the reasoning hook, may
     *     be null)
     * @param listener an optional listener to be informed about the filtered reasoning results (may be null)
     * @return the execution result for rt-VIL
     */
    protected Object reason(Configuration cfg, IRtVilConcept concept, IReasoningResultListener listener) {
        Object result = null;
        if (null != cfg) {
            if (null == listener) {
                listener = DefaultReasoningResultListener.INSTANCE;
            }
            net.ssehub.easy.varModel.confModel.Configuration easyConfig = cfg.getConfiguration();
            EASyLogger logger = EASyLoggerFactory.INSTANCE.getLogger(RtVilExecution.class, Bundle.ID);
            reasoningHook.preReasoning(currentScript, concept, valueAccess, cfg);
            ReasoningResult rResult = null;
            try {
                rResult = reasonerCache.propagate(easyConfig, REASONER_CONFIGURATION, ProgressObserver.NO_OBSERVER);
                //rResult = ReasonerFrontend.getInstance().propagate(easyConfig.getProject(),
                //    easyConfig, REASONER_CONFIGURATION, ProgressObserver.NO_OBSERVER);
            } catch (Throwable t) {
                // pretend it is ok
                logger.error("Reasoning exception: " + t.getMessage() + " - going on");
            }
            reasoningHook.postReasoning(currentScript, concept, valueAccess, cfg, rResult);
            listener.notifyReasoningResult(rResult);
            int errorCount = 0;
            for (int m = 0; m < rResult.getMessageCount(); m++) {
                Message msg = rResult.getMessage(m);
                net.ssehub.easy.basics.messages.Status status = reasoningHook.analyze(
                    currentScript, concept, valueAccess, msg);
                if (null != status) {
                    switch (status) {
                    case UNSUPPORTED:
                    case ERROR:
                        errorCount++;
                        logger.error(toText(msg));
                        break;
                    case INFO:
                        logger.info(toText(msg));
                        break;
                    case WARNING:
                        logger.warn(toText(msg));
                        break;
                    default:
                        logger.info(toText(msg));
                        break;
                    }
                    listener.notifyMessage(msg, status);
                }
            }
            boolean ok = (0 == errorCount);
            getTracer().trace("Reasoner execution ok: " + ok);
            logger.warn("Reasoner execution ok: " + ok);
            if (!ok) {
                reasoningHook.reasoningFailed(cfg);
            }
            listener.notifyAssessmentResult(ok);
            result = ok;
        }
        return result;
    }

    // checkstyle: resume exception type check

    /**
     * Obtains a typed argument instance from the given dynamic call fallback argument. [helper]
     *
     * @param <T> the argument type
     * @param evaluator the evaluator
     * @param argument the 0-based argument index pointing to the argument in args to be returned
     * @param type the argument type class
     * @param args the actual arguments
     * @return the typed argument instance (may be null if it does not exist or it is of a different type)
     * @throws VilException in case that evaluating the specified argument in evaluator fails
     */
    private static <T> T obtainArgument(RtVilExecution evaluator, int argument, Class<T> type, CallArgument... args)
        throws VilException {
        T result;
        if (0 <= argument && argument < args.length) {
            Object tmp = args[argument].accept(evaluator);
            if (type.isInstance(tmp)) {
                result = type.cast(tmp);
            } else {
                result = null;
            }
        } else {
            result = null;
        }
        return result;
    }

    /**
     * Obtains a concept argument instance from the given dynamic call fallback argument. [helper]
     *
     * @param evaluator the evaluator
     * @param argument the 0-based argument index pointing to the concept argument in args to be returned
     * @param args the actual arguments
     * @return the concept instance (may be null if it does not exist or it is of a different type)
     * @throws VilException in case that evaluating the specified argument in evaluator fails
     */
    private static IRtVilConcept obtainConcept(RtVilExecution evaluator, int argument, CallArgument... args)
        throws VilException {
        return obtainArgument(evaluator, argument, IRtVilConcept.class, args);
    }

    /**
     * Obtains a configuration argument instance from the given dynamic call fallback argument. [helper]
     *
     * @param evaluator the evaluator
     * @param argument the 0-based argument index pointing to the configuration argument in args to
     *     be returned
     * @param args the actual arguments
     * @return the configuration instance (may be null if it does not exist or it is of a different type)
     * @throws VilException in case that evaluating the specified argument in evaluator fails
     */
    private static Configuration obtainConfiguration(RtVilExecution evaluator, int argument, CallArgument... args)
        throws VilException {
        return obtainArgument(evaluator, argument, Configuration.class, args);
    }

    @Override
    protected Object executeDefault(net.ssehub.easy.instantiation.core.model.buildlangModel.Script script)
        throws VilException {
        RuleExecutionResult result = null;
        if (!stopAfterBindValues) {
            if (null != rtTracer) {
                rtTracer.startStrategies();
                attachChangeHistoryTracer();
            }
            VilException exc = null;
            try {
                List<Strategy> strategies = determineStrategiesRanking((Script) script);
                for (int s = 0; (null == result || Status.SUCCESS != result.getStatus())
                    && s < strategies.size(); s++) {
                    Object tmp = strategies.get(s).accept(this);
                    if (tmp instanceof RuleExecutionResult) {
                        result = (RuleExecutionResult) tmp;
                    }
                }
                persistVariables(script);
            } catch (VilException e) {
                exc = e;
            }
            if (doSimulationRollback()) {
                // allow reuse of configuration - get rid of all changes
                for (int i = 0; i < script.getParameterCount(); i++) {
                    if (clearCfg(script.getParameter(i))) {
                        break;
                    }
                }
            }
            if (null != rtTracer) {
                detachChangeHistoryTracer();
            }
            if (null != exc) {
                throw exc;
            }
            if (null != rtTracer) {
                rtTracer.endStrategies();
            }
        } else {
            RuleDescriptor desc = new RuleDescriptor();
            Rule dummy = new Rule("dummy", true, null, desc, script);
            result = new RuleExecutionResult(Status.SUCCESS, new RuleExecutionContext(dummy, getRuntimeEnvironment()));
        }
        return result;
    }

    /**
     * Attaches the change history tracer to the change history.
     */
    private void attachChangeHistoryTracer() {
        try {
            if (rtTracer instanceof IChangeHistoryTracer) {
                Configuration cfg = getCurrentConfigurationIvml();
                if (null != cfg) {
                    chgTracer = cfg.getChangeHistory().setTracer((IChangeHistoryTracer) rtTracer);
                }
            }
        } catch (VilException e) {
            LOGGER.info(e.getMessage());
        }
    }

    /**
     * Detaches a previously attached change history tracer to the change history.
     * Call in pair with {@link #attachChangeHistoryTracer()} only.
     */
    private void detachChangeHistoryTracer() {
        try {
            Configuration cfg = getCurrentConfigurationIvml();
            if (null != cfg) {
                cfg.getChangeHistory().setTracer(chgTracer);
                chgTracer = null;
            }
        } catch (VilException e) {
            LOGGER.info(e.getMessage());
        }
    }

    /**
     * Returns whether we are in a simulation and shall roll back the configuration changes.
     *
     * @return true for roll back, false else
     */
    private boolean doSimulationRollback() {
        ISimulationNotifier notifier = RtVilStorage.getSimulationNotifier();
        return null != notifier ? notifier.doRollbackSimulation() : false;
    }

    /**
     * Clears the configuration of param is a configuration parameter.
     *
     * @param param the parameter
     * @return true if param is a configuration parameter, false else
     * @throws VilException in case of an evaluation problem
     */
    private boolean clearCfg(VariableDeclaration param) throws VilException {
        boolean found = false;
        if (IvmlTypes.configurationType().isAssignableFrom(param.getType())) {
            if (getRuntimeEnvironment().isDefined(param)) {
                Configuration cfg = (Configuration) getRuntimeEnvironment().getValue(param);
                if (null != cfg) {
                    cfg.getChangeHistory().rollbackSimulation(); // calls clear(true)
                }
            }
            found = true;
        }
        return found;
    }

    /**
     * Determines the active strategies an their ranking.
     *
     * @param script the script to rank the strategies for
     * @return the applicable and ranked strategies (may be empty)
     * @throws VilException in case of execution / evaluation problems
     */
    private List<Strategy> determineStrategiesRanking(Script script) throws VilException {
        List<Strategy> strategies = script.getTopLevelStrategies(true, false); // can be called on script level
        List<Strategy> result = new ArrayList<Strategy>();
        for (int s = 0; s < strategies.size(); s++) {
            Strategy strategy = strategies.get(s);
            if (doArgumentsMatch(strategy) && isApplicable(strategy)) {
                result.add(strategy);
            }
        }
        if (result.size() > 1) {
            Map<Object, Number> ranking = new HashMap<Object, Number>();
            for (int s = 0; s < result.size(); s++) {
                Strategy strategy = result.get(s);
                ranking.put(strategy, getRanking(script, strategy));
            }
            Collections.sort(result, new RankingComparator(ranking, false)); // stable sort required!
        }
        return result;
    }

    /**
     * Returns whether the arguments for a given strategy do match.
     *
     * @param strategy the strategy to check for
     * @return true if the arguments match, false else
     */
    private boolean doArgumentsMatch(Strategy strategy) {
        int maxParam = Math.min(strategy.getParameterCount(), getParameterCount());
        boolean matches = true;
        if (getParameterCount() >= 3 && strategy.getParameterCount() < 3) {
            // due to tests, in case of 3 default parameters require them
            matches = false;
        }
        TypeRegistry registry = getRuntimeEnvironment().getTypeRegistry();
        for (int p = 0; matches && p < maxParam; p++) {
            VariableDeclaration decl = strategy.getParameter(p);
            Object param = getParameter(decl.getName());
            if (null != param) {
                TypeDescriptor<?> type = registry.getType(param.getClass());
                matches &= (null != type && decl.getType().isAssignableFrom(type));
            } else {
                matches = true;
            }
        }
        return matches;
    }

    /**
     * Returns the ranking of the given top level strategy in terms of its parameter
     * type compliance within script, i.e., with respect to the actual script parameters.
     *
     * @param script the script to be considered
     * @param strategy the top-level strategy within script to be considered
     * @return the ranking of the strategy
     */
    private int getRanking(Script script, Strategy strategy) {
        int maxCommonCount = Math.min(script.getParameterCount(), strategy.getParameterCount());
        int result = 0;
        for (int p = 0; p < maxCommonCount; p++) {
            IMetaType scriptType = script.getParameter(p).getType();
            IMetaType strategyType = strategy.getParameterType(p);
            if (scriptType.equals(strategyType)) {
                result += maxCommonCount;
            } else { // must be assignable
                result += 1; // 0 shall also be ok
            }
        }
        return result;
    }

    /**
     * Determines the ranking of the active breakdown calls in context using the weighting function of a
     * strategy if defined.
     *
     * @param context the context to take the active breakdown calls from
     * @return the ranking of the active breakdown calls (may be empty)
     * @throws VilException in case that ranking the strategies fails
     */
    private List<AbstractBreakdownCall> determineBreakdownRanking(StrategyExecutionContext context)
        throws VilException {

        List<AbstractBreakdownCall> result = new ArrayList<AbstractBreakdownCall>();
        for (int c = 0; c < context.getBreakdownCallCount(); c++) {
            result.add(context.getBreakdownCall(c)); // already active
        }
        WeightingFunction wf = context.getRule().getWeightingFunction();
        if (result.size() > 1 && wf != null) {
            Map<Object, Number> ranking = new HashMap<Object, Number>();
            RuntimeEnvironment env = getRuntimeEnvironment();
            env.pushLevel();
            VariableDeclaration wfVar = wf.getVariable();
            IMetaType wfVarType = wfVar.getType();
            TupleInstance wfVarInst = null;
            Object varVal;
            if (wfVarType instanceof TupleType) {
                wfVarInst = new TupleInstance((TupleType) wfVarType);
                varVal = wfVarInst;
            } else {
                varVal = null;
            }
            env.addValue(wfVar, varVal);
            for (int s = 0; s < result.size(); s++) {
                AbstractBreakdownCall call = result.get(s);
                if (wfVarInst != null) {
                    wfVarInst.clear();
                    for (int f = 0; f < wfVarType.getFieldCount(); f++) {
                        String fName = wfVarType.getField(f).getName();
                        TupleField field = call.getTupleField(fName);
                        if (null != field) {
                            wfVarInst.put(fName, field.getValueExpression().accept(this));
                        }
                    }
                    // already set in env
                } else {
                    env.setValue(wfVar, call.getResolved());
                }
                Object wValue = wf.getExpression().accept(this);
                if (wValue instanceof Number) {
                    ranking.put(call, (Number) wValue);
                }
            }
            env.popLevel();
            Collections.sort(result, new RankingComparator(ranking, true)); // maximize
        }
        return result;
    }

    /**
     * Implements a ranking comparator. The ranking is given as a map.
     *
     * @author Holger Eichelberger
     */
    private static class RankingComparator implements Comparator<Object> {

        private Map<Object, Number> ranking;
        private int factor;

        /**
         * Creates the ranking comparator.
         *
         * @param ranking the ranking - all objects in the collection to be sorted must be given
         * @param reverse reverse the ranking (false lowest first)
         */
        RankingComparator(Map<Object, Number> ranking, boolean reverse) {
            this.ranking = ranking;
            this.factor = reverse ? -1 : 1;
        }

        @Override
        public int compare(Object o1, Object o2) {
            Number r1 = ranking.get(o1);
            Number r2 = ranking.get(o2);
            return factor * Double.compare(r1.doubleValue(), r2.doubleValue()); // max first
        }

    }

    /**
     * Process the leading variables of a strategy.
     *
     * @param strategy the strategy to process the variables for
     * @throws VilException in case of problems during variable processing
     */
    private void processVariables(Strategy strategy) throws VilException {
        for (int v = 0; v < strategy.getVariableDeclarationCount(); v++) {
            strategy.getVariableDeclaration(v).accept(this);
        }
    }

    /**
     * Returns whether a strategy is applicable.
     *
     * @param strategy the strategy to be checked
     * @return true if strategy is applicable
     * @throws VilException in case of evaluation problems
     *
     * @see #isApplicable(Strategy, RuleExecutionContext)
     */
    private boolean isApplicable(Strategy strategy) throws VilException {
        RuleExecutionContext context = new RuleExecutionContext(strategy, getRuntimeEnvironment());
        boolean result = isApplicable(strategy, context);
        cleanupRuleExecution(context);
        return result;
    }

    /**
     * Returns whether a strategy is applicable, considering the applicability of the preconditions and the objective.
     *
     * @param strategy the strategy to consider
     * @param context the execution context of strategy
     * @return true if the strategy is applicable, false else
     * @throws VilException in case of execution / evaluation problems
     */
    private boolean isApplicable(Strategy strategy, RuleExecutionContext context) throws VilException {
        boolean applicable = prepareExecution(context);
        if (applicable && Status.SUCCESS == context.getStatus()) {
            Expression objective = strategy.getObjective();
            if (null != objective) {
                processVariables(strategy);
                Object objectiveResult = objective.accept(this);
                if (!Boolean.TRUE.equals(objectiveResult)) {
                    context.setStatus(Status.NOT_APPLICABLE);
                    applicable = false;
                }
            }
        }
        return applicable;
    }

    @Override
    public Object visitScript(Script script) throws VilException {
        Script tmp = currentScript;
        currentScript = script;
        ReasonerAdapter.registerInstance(reasonerCache);
        Object result = super.visitScript(script); // just pass through, handled in executeDefault
        script.markAsExecuted();
        ReasonerAdapter.unregisterInstance();
        currentScript = tmp;
        return result;
    }

    @Override
    protected void processProperties(
        net.ssehub.easy.instantiation.core.model.buildlangModel.Script script, File base)
        throws VilException {
        callInitialize();
        callBindValues();
        if (!stopAfterBindValues) {
            super.processProperties(script, base);
            RtVilStorage storage = RtVilStorage.getInstance();
            if (null != storage) { // check whether this position is correct
                String scriptName = script.getName();
                for (int v = 0; v < script.getVariableDeclarationCount(); v++) {
                    VariableDeclaration varDecl = script.getVariableDeclaration(v);
                    if (varDecl.hasModifier(VariableDeclarationModifier.PERSISTENT)) {
                        Object value = storage.getValue(scriptName, varDecl.getName());
                        if (null != value) {
                            getRuntimeEnvironment().setValue(varDecl, value);
                            getTracer().valueDefined(varDecl, null, value);
                        }
                    }
                }
            }
        }
    }

    /**
     * Persists persistable variables.
     *
     * @param script the script to store the variables for
     * @throws VilException in case that accessing a variable value fails
     */
    private void persistVariables(net.ssehub.easy.instantiation.core.model.buildlangModel.Script script)
        throws VilException {
        RtVilStorage storage = RtVilStorage.getInstance();
        if (null != storage) { // check whether this position is correct
            String scriptName = script.getName();
            for (int v = 0; v < script.getVariableDeclarationCount(); v++) {
                VariableDeclaration varDecl = script.getVariableDeclaration(v);
                if (varDecl.hasModifier(VariableDeclarationModifier.PERSISTENT)) {
                    Object value = getRuntimeEnvironment().getValue(varDecl);
                    storage.setValue(scriptName, varDecl.getName(), value);
                }
            }
        }
    }

    @Override
    public Object visitStrategy(Strategy strategy) throws VilException {
        nestedStrategyCount++;
        boolean visited = false;
        StrategyExecutionContext context = new StrategyExecutionContext(strategy, getRuntimeEnvironment());
        if (prepareExecution(context)) {
            getTracer().visitRule(strategy, getRuntimeEnvironment());
            visited = true;
            if (Status.SUCCESS == context.getStatus()) {
                callStart(strategy);
                processVariables(strategy);
                // builds up breakdown
                context.setStatus(applyRuleBody(strategy, context.getRhsValues(), context));
                List<AbstractBreakdownCall> calls = determineBreakdownRanking(context);
                RuleExecutionResult callResult = null;
                Status lastStatus = null;
                for (int c = 0; continueBreakdown(callResult) && c < calls.size(); c++) {
                    AbstractBreakdownCall call = calls.get(c);
                    Expression timeoutEx = call.getTimeoutExpression();
                    Object timeout = null;
                    if (null != timeoutEx) {
                        timeout = timeoutEx.accept(this);
                    }
                    long startTimeStamp = System.currentTimeMillis();
                    callResult = (RuleExecutionResult) visitModelCallExpression(call);
                    long endTimeStamp = System.currentTimeMillis();
                    lastStatus = null == callResult ? Status.NOT_APPLICABLE : callResult.getStatus();
                    if (Status.SUCCESS == lastStatus) {
                        setFailInfo(context, null);
                        if (!validateTimeout(timeout, startTimeStamp, endTimeStamp, callResult)) {
                            LOGGER.info("strategy '" + call.getResolved().getSignature() + "' failed in breakdown "
                                + "of '" + strategy.getSignature() + "' due to a timeout of " + timeout);
                        }
                    } else if (Status.FAIL == lastStatus) {
                        setFailInfo(context, callResult);
                    }
                }
                if (null == callResult) {
                    context.setStatus(Status.NOT_APPLICABLE);
                } else {
                    context.setStatus(callResult.getStatus());
                    if (Status.SUCCESS == callResult.getStatus()) {
                        context.setStatus(executeRuleBody(strategy.getPostprocessing(), context));
                    }
                    checkPostconditions(context);
                }
            }
        }
        cleanupRuleExecution(context);
        RuleExecutionResult result = new RuleExecutionResult(context.getStatus(), context);
        boolean failed = true;
        if (Status.SUCCESS == context.getStatus()) {
            if (Boolean.TRUE == callValidate(strategy)) {
                callSucceeded(strategy, result);
                successful.add(strategy);
                callUpdate();
                callEnact();
                failed = false;
            }
        }
        if (failed) {
            callFailed(strategy);
        }
        nestedStrategyCount--;
        return visitedRule(visited, strategy, result);
    }

    /**
     * Determines whether the breakdown execution shall continue.
     *
     * @param callResult the call result
     * @return true for continue, false for stop
     * @throws VilException in case that the actual configuration cannot be found
     */
    private boolean continueBreakdown(RuleExecutionResult callResult) throws VilException {
        boolean cont;
        if (null == callResult) {
            cont = true;
        } else {
            if (Status.SUCCESS == callResult.getStatus()) {
                Configuration cfg = getCurrentConfigurationIvml();
                cont = (null == cfg || !callResult.hasChanges());
            } else {
                cont = true;
            }
        }
        return cont;
    }

    /**
     * Notifies the tracer if visited.
     *
     * @param visited whether strategy was visited
     * @param strategy the strategy
     * @param result the strategy execution result
     * @return result
     */
    private RuleExecutionResult visitedRule(boolean visited, Strategy strategy, RuleExecutionResult result) {
        if (visited) {
            getTracer().visitedRule(strategy, getRuntimeEnvironment(), result);
        }
        return result;
    }

    /**
     * Sets the fail code from callResult to context.
     *
     * @param context the context to modify as a side effect
     * @param callResult the call result to take the fail information from (may be null for null as
     *   fail code/reason)
     */
    private void setFailInfo(StrategyExecutionContext context, RuleExecutionResult callResult) {
        if (null == callResult) {
            context.setFailCode(null);
            context.setFailReason(null);
        } else {
            context.setFailCode(callResult.getFailCode());
            context.setFailReason(callResult.getFailReason());
        }
    }

    /**
     * Validates the timeout.
     *
     * @param timeout the timeout
     * @param startTimeStamp the start time stamp
     * @param endTimeStamp the end time stamp
     * @param callResult the call result
     * @return true if valid or not relevant, false if invalid (exceeded)
     */
    private boolean validateTimeout(Object timeout, long startTimeStamp, long endTimeStamp,
        RuleExecutionResult callResult) {
        boolean result = true;
        if (timeout instanceof Number) {
            long timeoutValue = ((Number) timeout).longValue();
            long expectedEndTimeStamp = startTimeStamp + ((Number) timeout).longValue();
            if (timeoutValue > 0 && endTimeStamp > expectedEndTimeStamp) {
                callResult.fail();
                result = false;
            }
        }
        return result;
    }

    @Override
    public Object visitTactic(Tactic tactic) throws VilException {
        boolean visited = false;
        RuleExecutionContext context = new RuleExecutionContext(tactic, getRuntimeEnvironment());
        if (prepareExecution(context)) {
            getTracer().visitRule(tactic, getRuntimeEnvironment());
            visited = true;
            if (Status.SUCCESS == context.getStatus()) {
                callStart(tactic);
                context.setStatus(applyRuleBody(tactic, context.getRhsValues(), context));
                checkPostconditions(context);
            }
        }
        cleanupRuleExecution(context);
        RuleExecutionResult result = new RuleExecutionResult(context.getStatus(), context);
        boolean failed = true;
        if (Status.SUCCESS == context.getStatus()) {
            if (Boolean.TRUE == callValidate(tactic)) {
                callSucceeded(tactic, result);
                // no callEnact();
                failed = false;
                successful.add(tactic);
            }
        }
        if (failed) {
            callFailed(tactic);
        }
        if (visited) {
            getTracer().visitedRule(tactic, getRuntimeEnvironment(), result);
        }
        return result;
    }

    /**
     * Evaluates the guard of a breakdown call.
     *
     * @param call the call
     * @return whether the call is active (due to the guard) or not
     * @throws VilException in case of evaluation problems
     */
    private boolean evaluateGuard(AbstractBreakdownCall call) throws VilException {
        boolean active = true;
        Expression guard = call.getGuardExpression();
        if (null != guard) {
            Object o = guard.accept(this);
            if (o instanceof DecisionVariable) {
                o = ((DecisionVariable) o).getValue();
            }
            if (o instanceof BooleanValue) {
                o = ((BooleanValue) o).getValue();
            }
            if (!Boolean.TRUE.equals(o)) {
                active = false;
            }
        }
        return active;
    }

    @Override
    public Object visitStrategyCall(StrategyCall call) throws VilException {
        // called in first execution of strategy breakdown part - collect
        RuleExecutionContext context = peekRuleStack();
        boolean isActive = evaluateGuard(call);
        if (isActive) {
            Strategy strategy = call.getResolved();
            if (isApplicable(strategy)) {
                ((StrategyExecutionContext) context).addBreakdownCall(call); // happens only in strategy execution
            }
        }
        return new RuleExecutionResult(Status.SUCCESS, context); // don't stop here
    }

    @Override
    public Object visitTacticCall(TacticCall call) throws VilException {
        // called in first execution of strategy breakdown part - collect
        RuleExecutionContext context = peekRuleStack();
        boolean isActive = evaluateGuard(call);
        if (isActive) {
            RuleExecutionContext tmpContext = new RuleExecutionContext(call.getResolved(), getRuntimeEnvironment());
            if (prepareExecution(context)) {
                ((StrategyExecutionContext) context).addBreakdownCall(call); // happens only in strategy execution
            }
            cleanupRuleExecution(tmpContext);
        }
        return new RuleExecutionResult(Status.SUCCESS, context); // don't stop here
    }

    /**
     * Returns the current script being executed.
     *
     * @return the current script
     */
    private Script getCurrentScript() {
        return (Script) getRuntimeEnvironment().getContextModel();
    }

    /**
     * Returns the current configuration as IVML instance.
     *
     * @return the current configuration
     * @throws VilException in case that accessing the configuration fails
     */
    private Configuration getCurrentConfigurationIvml() throws VilException {
        return (Configuration) getCurrentConfiguration().accept(this);
    }

    /**
     * Returns the configuration object used in script, i.e., the top-level configuration object.
     *
     * @return the configuration object
     * @throws VilException in case that accessing the configuration object fails
     */
    private CallArgument getCurrentConfiguration() throws VilException {
        Script script = getCurrentScript();
        TypeDescriptor<?> cfgType = IvmlTypes.configurationType();
        CallArgument result = new CallArgument(cfgType);
        for (int i = 0; i < script.getParameterCount(); i++) {
            VariableDeclaration decl = script.getParameter(i);
            if (cfgType.isAssignableFrom(decl.getType())) {
                result.fixValue(getRuntimeEnvironment().getValue(decl));
            }
        }
        return result;
    }

    /**
     * Calls the VTL failed rule if it exists or the IVML reasoner instead. Performs validation only if there are
     * direct changes.
     *
     * @param concept the concept to call on
     * @return the result of validation
     * @throws VilException in case that constructing, resolving or executing the corresponding VIL rule fails
     */
    private Object callValidate(IRtVilConcept concept) throws VilException {
        Configuration cfg = getCurrentConfigurationIvml();
        Object result = Boolean.TRUE;
        if (cfg.getChangeHistory().hasChanges()) {
            result = dfltRtVilConceptCall(concept, "validate",
                useReasoner ? VALIDATE_FALLBACK : VALIDATE_NO_REASONER_FALLBACK);
        }
        return result;
    }

    /**
     * Calls the VTL start rule if it exists.
     *
     * @param concept the concept to call on
     * @throws VilException in case that constructing, resolving or executing the corresponding VIL rule fails
     */
    private void callStart(IRtVilConcept concept) throws VilException {
        dfltRtVilConceptCall(concept, "start", START_FALLBACK);
    }

    /**
     * Calls the VTL succeeded rule if it exists.
     *
     * @param concept the concept to call on
     * @param result the execution result, to be modified as a side effect
     * @throws VilException in case that constructing, resolving or executing the corresponding VIL rule fails
     */
    private void callSucceeded(IRtVilConcept concept, RuleExecutionResult result) throws VilException {
        Configuration cfg = getCurrentConfigurationIvml();
        if (null != cfg) {
            result.setChanges(cfg.getChangeHistory().hasChanges());
        }
        dfltRtVilConceptCall(concept, "succeeded", SUCCEEDED_FALLBACK);
    }

    /**
     * Calls the VTL update rule if it exists.
     *
     * @param concept the concept to call on
     * @throws VilException in case that constructing, resolving or executing the corresponding VIL rule fails
     */
    private void callUpdate(IRtVilConcept concept) throws VilException {
        dfltRtVilConceptCall(concept, "update", UPDATE_FALLBACK);
    }

    /**
     * Calls the VTL failed rule if it exists.
     *
     * @param concept the concept to call on
     * @throws VilException in case that constructing, resolving or executing the corresponding VIL rule fails
     */
    private void callFailed(IRtVilConcept concept) throws VilException {
        dfltRtVilConceptCall(concept, "failed", FAILED_FALLBACK);
    }

    /**
     * Calls all successful strategies and tactics.
     *
     * @throws VilException in case that one of the calls fails
     */
    private void callUpdate() throws VilException {
        Set<IRtVilConcept> done = new HashSet<IRtVilConcept>();
        for (int s = 0; s < successful.size(); s++) {
            IRtVilConcept concept = successful.get(s);
            if (!done.contains(concept)) {
                callUpdate(concept);
                done.add(concept);
            }
        }
        successful.clear();
    }

    /**
     * Returns whether the given type is a map with the given two generics.
     *
     * @param type the type to check
     * @param gen1 the first generic type
     * @param gen2 the second generic type
     * @return true if type is the requested map type, false else
     */
    private boolean isMap(TypeDescriptor<?> type, TypeDescriptor<?> gen1, TypeDescriptor<?> gen2) {
        return type.isMap() && 2 == type.getGenericParameterCount()
            && gen1.isAssignableFrom(type.getGenericParameterType(0))
            && gen2.isAssignableFrom(type.getGenericParameterType(1));
    }

    /**
     * Calls the bind values rule if present or does nothing.
     *
     * @throws VilException in case that constructing, resolving or executing the corresponding VIL rule fails
     */
    private void callBindValues() throws VilException {
        Script script = getCurrentScript();
        CallArgument[] args = new CallArgument[2];
        int pos = 0;
        for (int i = 0; i < script.getParameterCount(); i++) {
            VariableDeclaration decl = script.getParameter(i);
            TypeDescriptor<?> type = decl.getType();
            if (IvmlTypes.configurationType().isAssignableFrom(type)
                || isMap(type, TypeRegistry.stringType(), TypeRegistry.realType())) {
                Object value = getRuntimeEnvironment().getValue(decl);
                args[pos++] = new CallArgument(decl.getType()).fixValue(value);
            }
        }
        if (2 == pos) { // only if both parameters are present
            if (null != rtTracer) {
                rtTracer.startBind();
            }
            boolean enabled = setEnableRuleElementFailed(false);
            dynamicCall("bindValues", BIND_VALUES_FALLBACK, args);
            // clear the change history
            ((Configuration) args[0].accept(this)).getChangeHistory().clear(true);
            setEnableRuleElementFailed(enabled);
            if (null != rtTracer) {
                rtTracer.endBind();
            }
        } else {
            LOGGER.info("bindValues not found - map declaration missing?");
        }
    }

    /**
     * Calls the initialization of the actual script.
     *
     * @throws VilException in case that constructing, resolving or executing the corresponding VIL rule fails
     */
    private void callInitialize() throws VilException {
        Script script = getCurrentScript();
        if (!script.wasExecuted()) {
            if (null != rtTracer) {
                rtTracer.startInitialize();
            }
            CallArgument[] args = new CallArgument[1];
            args[0] = getCurrentConfiguration();
            dynamicCall("initialize", INITIALIZE_FALLBACK, args);
            if (null != rtTracer) {
                rtTracer.endInitialize();
            }
        }
    }

    /**
     * Calls the enactment and complains if no top-level enactment function can be found.
     *
     * @throws VilException in case that constructing, resolving or executing the corresponding VIL rule fails
     */
    private void callEnact() throws VilException {
        if (enableEnactment && 1 == nestedStrategyCount) { // do not repeate enact calls
            if (null != rtTracer) {
                rtTracer.startEnact();
            }
            Script script = getCurrentScript();
            CallArgument[] args = new CallArgument[3];
            for (int i = 0; i < Math.min(3,  script.getParameterCount()); i++) {
                VariableDeclaration decl = script.getParameter(i);
                Object value = getRuntimeEnvironment().getValue(decl);
                args[i] = new CallArgument(decl.getType()).fixValue(value);
            }
            dynamicCall("enact", null, args);
            if (null != rtTracer) {
                rtTracer.endEnact();
            }
        }
    }

    /**
     * A default rt-VIL concept call.
     *
     * @param concept the concept to call on
     * @param name the name of the call
     * @param fallback the optional fallback instance in case that the corresponding VIL rule cannot be found
     * @return the execution result
     * @throws VilException in case that constructing, resolving or executing the VIL rule fails
     */
    private Object dfltRtVilConceptCall(IRtVilConcept concept, String name, IDynamicCallFallback fallback)
        throws VilException {
        CallArgument conceptArg = new CallArgument(RtVilTypeRegistry.INSTANCE.findType(concept.getClass()))
            .fixValue(concept);
        return dynamicCall(name, fallback, conceptArg, getCurrentConfiguration());
    }

    /**
     * Executes a dynamic rule call, i.e., a call that is composed and resolved at runtime.
     *
     * @param name the name of the rule to be called
     * @param fallback an optional fallback instance in case that the call cannot be resolved
     * @param args the rule arguments
     * @return the rule execution result
     * @throws VilException in case that constructing, resolving or executing the VIL rule fails
     */
    private Object dynamicCall(String name, IDynamicCallFallback fallback, CallArgument... args) throws VilException {
        Object result;
        try {
            result = dynamicCall(getCurrentScript(), name, args);
        } catch (VilException e) {
            if (null != fallback && VilException.ID_CANNOT_RESOLVE == e.getId()) {
                result = fallback.call(this, args);
            } else {
                throw e;
            }
        }
        return result;
    }

    /**
     * Executes a dynamic rule call on script or its (transitively) imported scripts, i.e.,
     * a call that is composed and resolved at runtime.
     *
     * @param script the script to resolve the call on
     * @param name the name of the rule to be called
     * @param args the rule arguments
     * @return the rule execution result
     * @throws VilException in case that constructing, resolving or executing the VIL rule fails
     */
    private Object dynamicCall(net.ssehub.easy.instantiation.core.model.buildlangModel.Script script,
        String name, CallArgument... args) throws VilException {
        Object result = null;
        VilException failure = null;
        try {
            RuleCallExpression expr = new RuleCallExpression(script, false, name, args);
            expr.inferType();
            result = expr.accept(this);
        } catch (VilException e) {
            if (VilException.ID_CANNOT_RESOLVE == e.getId()) {
                failure = e; // go on trying
            } else {
                throw e;
            }
        }
        if (failure != null) {
            boolean succeeded = false;
            for (int i = 0; !succeeded && i < script.getImportsCount(); i++) {
                net.ssehub.easy.instantiation.core.model.buildlangModel.Script tmp
                    = script.getImport(i).getResolved();
                if (null != tmp) {
                    try {
                        result = dynamicCall(tmp, name, args);
                        succeeded = true;
                    } catch (VilException e) {
                        if (VilException.ID_CANNOT_RESOLVE != e.getId()) {
                            throw e;
                        } // else: ignore, we have already and information in failure
                    }
                }
            }
            if (!succeeded) {
                throw failure;
            }
        }
        return result;
    }

    @Override
    public Object visitFailStatement(FailStatement statement) throws VilException {
        return null; // go on in ruleElementFailed
    }

    @Override
    protected boolean ruleElementFailed(IRuleElement elt, RuleExecutionContext context) throws VilException {
        boolean fail = true;
        if (elt instanceof FailStatement) {
            FailStatement fStmt = (FailStatement) elt;
            String msg;
            if (fStmt.isRefail()) {
                if (null != lastFailCode || null != lastFailReason) {
                    context.setFailCode(lastFailCode);
                    context.setFailReason(lastFailReason);
                    msg = "refail";
                } else {
                    msg = null;
                    fail = false;
                }
            } else {
                msg = "explicit fail";
                if (null != fStmt.getReasonEx()) {
                    Object value = fStmt.getReasonEx().accept(this);
                    if (value instanceof String) {
                        context.setFailReason((String) value);
                    }
                }
                if (null != fStmt.getCodeEx()) {
                    Object value = fStmt.getCodeEx().accept(this);
                    if (value instanceof Integer) {
                        context.setFailCode((Integer) value);
                    }
                }
                if (null == context.getFailCode() && null == context.getFailReason()) {
                    context.setFailCode(-1);
                }
                lastFailReason = context.getFailReason();
                lastFailCode = context.getFailCode();
            }

            if (null != msg) {
                if (null != context.getFailReason()) {
                    msg += " message \"" + context.getFailReason() + "\"";
                }
                if (null != context.getFailCode()) {
                    msg += " with code " + context.getFailCode();
                }
                context.setStatus(Status.FAIL);
                getTracer().trace(msg);
            }
        }
        return fail;
    }

    @Override
    protected boolean mayFail(Object elt) {
        boolean result;
        if (elt instanceof FailStatement) {
            result = true;
        } else {
            result = super.mayFail(elt);
        }
        return result;
    }

    /*
public Object visitRule(Rule rule) throws VilException {
    System.out.println(">> " + rule.getName());
    Object result = super.visitRule(rule);
    System.out.println("<< " + rule.getName());
    return result;
}
*/

}


For those of you who know my "style" of healthy & delicious food, you know I LOVE ME SOME LAMB! The quality of Aussie Lamb is unparalleled and easy to find at your local grocer (FIND LAMB). For more #simplyspring Aussie Lamb recipes visit Simply Spring at True Aussie Beef and Lamb.
Not sure how we got to the chocolate Easter bunnies, but love those things – especially the solid ones! Mama mia!!
This year I've decided to take my culinary prowess up a notch to make a WHOLE LEG of lamb. Woot! It's so good, and perfect for the big day. Oh, and I kept it kosher (no dairy) for my Jewish friends on Passover. So please share the #loveandyum and enjoy!
Mama's Favorite Spring Dish: Grilled & Braised Mediterranean Leg of Aussie Lamb with Roasted Potatoes, Blistered Tomatoes and a Coconut Avocado Tzatziki.
Feeds 6 – 8 people.
Use ½ of marinade to rub on lamb (score thick fat areas first). Leave out at room temp for 1 hour with marinade/rub.
Grill lamb on high heat to sear – 5 mins per side.
Preheat oven to 300 degrees. Heat roasting pan over stove. Drizzle with olive oil. Toast cumin seeds until they pop. Add in garlic, 2 cinnamon sticks and move to outer edges. Place lamb, fat side up in roasting pan. Pour in braising liquid, add sprigs of rosemary, and bring to a boil. Remove from heat, cover tightly with parchment lined aluminum foil. Place in oven for 4 hours.
Wash tomatoes and leave whole. Rise potatoes and cut in half. In a large bowl toss with oil and salt and pepper.
At 4 hour mark, flip lamb leg, remove any burnt rosemary, and add potatoes and tomatoes to the pan. Cover and cook for 45 – 60 more minutes until tomatoes are blistered and potatoes are cooked.
Transfer lamb to platter, then surround with potatoes and tomatoes to platter using slotted spoon. Strain juice from pan into a small pot and simmer over low heat until reduced 6 – 7 minutes. Spoon reduced sauce over lamb. Garnish platter with dill. Slice/pull lamb and serve over tomatoes & potatoes, with tzatziki sauce.


Are you ready to get the carpet you've always wanted? Brockville Carpet One will help make it happen. Relax with brand new carpeting from Brockville Carpet One and redesign your home with a luxurious look and total comfort. Carpet One is home to a wide variety of both major and exclusive carpet brands and is connected with all the major brands, mills, and manufacturers. This is why we can offer you quality carpet at a great price at your Brockville Carpet One. Aiming for a formal atmosphere? Try Plush and Saxony carpeting styles. For flexibility in casual rooms, try Textured Saxony, Frieze, or Berber carpeting to satisfy your needs. For high-traffic areas like living rooms, consider the plush but durable texture of Cable carpet. No matter your need, Brockville Carpet One has the carpeting solution.
We also know that keeping your carpet looking beautiful over time is important to you. As a result, we've created a variety of warranties from which you can choose. Just pick the carpet warranty that best fits your needs. With a great range of carpet warranty selections to choose from for your Brockville carpet, you'll easily be able to find one that's right for you. If you're not completely happy with your Brockville carpet, we'll replace it for you for free. It's our Beautiful Guarantee™. But, we go beyond helping you choose the perfect carpet for your home. We can help you transform your home completely with our carpet installation services.
And remember, Carpet One does more than carpeting. With quality selections from the top brands of carpeting, hardwood flooring, ceramic tile, and much more, Brockville Carpet One meets all your home's flooring needs. Just start by browsing our carpet inventory online, contact a sales professional at your nearest Carpet One store or visit us at our Brockville Carpet One store and see what a difference our flooring can make in your home.


Chandelier, Beaded Clear 24" x 60"
Chandelier, Beaded Hoop 60" x 72"
Includes basic installation. Various colors to choose from. Light for paper lantern rents separately.
Chandelier, Empress 25" X 24"
LED Light for Paper Lantern. Remote Controller rents separately.
Chandelier, Beaded Clear 10" x 24"
Basic wash lighting for stage.


You are currently browsing the VanHulsen blog archives for November, 2010.
Isaac, originally uploaded by Aiko, Thomas & Juliette.
I have the feeling that he's going to pester Juliette a lot in the coming years.
Apparantly some people didn't want us to mourn Thomas too long and sent us this wonderful creature.
J and I are deeply impressed and speechless with this precious gift of life.


Based on the character of Conan as originally created by Robert E. Howard, a boy born on the battlefield grows into a hulking warrior hell-bent on avenging his father's death. But Conan's personal vendetta soon escalates into an epic battle of impossible odds, facing the fiercest of rivals and the most horrific of monsters.
Conan the Barbarian is an origin story, which sees Jason Momoa wipe the Schwarzenegger slate of yesteryear clean and starts fresh in Hyboria, rebooting Robert E. Howard's classic Cimmerian warrior. I'm sure that some people will disagree but, I was happy with their choice to forego a literal adaptation of one Howard book, opting to pull from various stories instead. I think that decision enabled it to become its own Conan, rather than suffer endless comparisons to previous films and specific literature.
I'm not always a fan of violence for violence-sake, but the Conan story is one of savage warriors, and without graphic violence it simply wouldn't measure up. Thankfully, there's no shortage of justifiable violence and action in Conan the Barbarian. Where the film falls short is in the character development and plot arena, or at least that's how it seems. I think one of the biggest problems with this movie is the editing. The film is cut together so frenetically at some points that, it seems to speed through story to get to the next action scene.
As a film, I think Conan the Barbarian is good and it's painfully obvious that it could have been a much, much better film with very little effort.
Now, on to the list of everything that's included in the combo pack and my overall star rating for the Conan the Barbarian Two-Disc Blu-ray Combo Pack.
Video Quality: The 2D Blu-ray version of the movie is crisp and clear in 1080p. The CG elements of the film look fantastic and the landscapes in this movie are breathtaking.
Audio: The DTS 7.1 sound is great, although the mix did seem a bit uneven during some of the battle scenes, with the clash of weapons drowning everthing out (including dialogue).
Audio Commentaries: Director Marcus Nispel drops some stories about the making of the movie, the actors and the location. Jason Momoa and Rose McGowan speak at length about how much they care for the material and how imporant the project was to them. Both commentaries were good, although Momoa and McGowan's was much more entertaining to me.
The additional special features were done very well, and I was particularly interested in the Robert E. Howard featurette, which as an all-around primer on both he, and the universe of Conan. The Battle Royal and Staging the Fights featurettes were very cool and a must watch for fans of behind the scenes stuff on fight choreography and the like.
I think this combo pack is definitely worth the price of admission. Although Conan the Barbarian misses the mark in some places, it is a good film overall, and most definitely a fun film to watch.
I give Conan the Barbarian Two-Disc Blu-ray Combo Pack Three out of Five Stars.
Conan the Barbarian (Two-Disc Blu-ray 3D + Blu-ray + DVD + Digital Copy) is available now. You can order your copy at Amazon using the link below!


This is a placeholder page for Carlene Thompson, which means this person is not currently on this site. We do suggest using the tools below to find Carlene Thompson.
You are visiting the placeholder page for Carlene Thompson. This page is here because someone used our placeholder utility to look for Carlene Thompson. We created this page automatically in hopes Carlene Thompson would find it. If you are not Carlene Thompson, but are an alumni of Messick High School, register on this site for free now.


JewishWorldReview.com | Long gone are the days when all fats were "bad." Now we know that what's important are the types of fat we eat, and how much. For instance, oils--full of unsaturated fatty acids--generally fall into the "healthy" camp.
When you choose oil over a solid fat, such as shortening or butter, you're helping to cut back your consumption of saturated fats, one of the nutritional bad guys. Similarly, when you choose nuts over crackers you may be limiting your intake of trans fats, another type of unhealthy fats.
Fats 101: All food sources that we think of as "fats"--we're talking butter, shortening, oils--are made up of a combination of fatty acids: monounsaturated, polyunsaturated and saturated. All fats contain all three types but are classified by the type of fatty acid that makes up most of the fat.
For example, olive oil is about 78 percent monounsaturated fat, so it's considered a monounsaturated fat. Trans fats are man-made fats used in processed foods to increase their shelf life.
How to spot them: They're liquid at room temperature but become semi-solid (or cloudy) in the refrigerator.
Health effects: When substituted for saturated fats, research suggests that monounsaturated fats may help keep "bad" LDL cholesterol low and boost levels of "good" HDL cholesterol and, in that way, reduce risk for heart disease.
How to spot them: They're always liquid, even if you put them in the fridge.
Health notes: Like monounsaturated fats, polyunsaturated fats may help improve blood cholesterol levels, thereby reducing risk for heart disease. Although both omega-6 and omega-3 fats (two specific types of polyunsaturated fats) are essential for good health, omega-3s may have additional heart-health and anti-inflammatory benefits.
How to spot them: They're solid at room temperature.
Health notes: A diet high in saturated fat has been linked with elevated cholesterol levels and increased risk for heart disease, so it's best to limit your intake. The American Heart Association suggests limiting your intake of saturated fat to 7 percent of total calories--that's 16 grams for a 2,000-calorie-a-day diet.
Common sources: Many packaged snacks, commercially prepared baked goods, salad dressings, deep-fried fast food and some margarines.
How to spot them: Check ingredient lists for the terms "hydrogenated" or "partially hydrogenated" fats. Food manufacturers don't have to report the trans-fat content if it's less than 0.5 gram per serving, so a product may include trans fats even if the label reports 0 grams.
Health notes: Trans fats are the unhealthiest of all: they increase ("bad") LDL and decrease ("good") HDL. Aim to limit trans fats to less than 1 percent of total calories per day. Some experts recommend trying to avoid them all together.


text:
Home » Events » 2018-2019, 2014-2015 » From Res Nullius to Terra Nullius:
From Res Nullius to Terra Nullius:
Revisiting Indigenous Histories, Legal Systems and Land Rights in the Naqab
Panelists: Bashir Abu Manneh, Nadia Ben Youssef, Debby Farber
Moderator: Nadia Abu El-Haj
Respondent: Audra Simpson
Chair: Brian Boyd
The Center for Palestine Studies, in partnership with the NGO Zochrot, and Forensic Architecture, will be holding a scholarly panel within the framework of the exhibition, Ground Truth: Testimonies of Destruction and Return in Al-Araqib, to expand the discourse on the origins of the dispossession, expulsion, and displacement of the Palestinian Bedouins in the Negev/Al-Naqab, and in particular its historical background and legal aspects. The panelists are scholars and activists involved in historical research, legal geography, and human rights with the aim of situating the case of the Naqab Bedouins within key international debates, such as the territorial dispossession of indigenous peoples, indivisibility, and interrelationship of socioeconomic, cultural, civil, and political rights.
Nadia Abu El-Haj, Professor of Anthropology, Barnard College, and Co-Director of the Center for Palestine Studies
Nadia is the author of Facts on the Ground: Archaeological Practice and Territorial Self-Fashioning in Israeli Society (University of Chicago Press, 2001), which won the Albert Hourani Award of the Middle East Studies Association, and The Genealogical Science: The Search for Jewish Origins and the Politics of Epistemology (University of Chicago Press, 2012). She has held fellowships at Harvard University's Academy for International and Area Studies and the Institute for Advanced Study at Princeton. In addition, she is a former Fulbright Fellow and a recipient of awards from the SSRC-MacArthur Grant in International Peace and Security, the Wenner-Gren Foundation for Anthropological Research, and the National Endowment for the Humanities among others. Nadia has served on the Editorial Board of the Journal of Palestine Studies since 2002.
Bashir Abu-Manneh, Director of the Centre for Postcolonial Studies, Kent University
Bashir Abu-Manneh is Reader in Postcolonial Literature and Director of the Centre for Postcolonial Studies at the University of Kent in the UK, and author of The Palestinian Novel: From 1948 to the Present (2016) and Fiction of the New Statesman, 1913-1939 (2011). His edited book on Edward Said as critic and theorist, After Said: Postcolonial Literary Studies in the Twenty-First Century, is out at the end of the year.
Nadia Ben-Youssef, Co-Founder and Director Adalah Justice Project
Nadia Ben-Youssef is the co-founder and director of Adalah Justice Project (AJP), and works at the intersection of law, advocacy, and art to advance human rights. Prior to leading AJP, she worked with Adalah - The Legal Center for Arab Minority Rights in Israel (Adalah) both in Israel/Palestine and in the US. She coordinated Adalah's international advocacy on behalf of the indigenous Palestinian Bedouin community in the Naqab, and most recently served as the organization's first USA Representative. As an outgrowth of her work in the US, AJP was launched in February 2017 to influence American policy and practice in Israel/Palestine. Much of the work of AJP has focused on building a transnational movement against supremacy and state-sanctioned violence together with cause lawyers, community organizers, and artists across diverse movements for social justice. Nadia is a member of the New York State Bar, and holds a BA in Sociology from Princeton University, and a J.D. from Boston College Law School.
Debby Farber, curator Zochrot NGO
Debby Farber is the curator of Zochrot NGO ("Remembering" in Hebrew), an Israeli organization working to promote acknowledgement and accountability for the ongoing injustices of the Nakba, the Palestinian catastrophe of 1948. From 2012 to 2014 she served as the Civil Transitional Justice program director in Zochrot where she established the first Unofficial Truth Commission in Israel for the events of 1948 in the Negev. Debby is a former AHDA fellow of the Institute for the Study for Human Rights at Columbia University and is currently also a PhD Candidate in the Politics and Government Department in Ben Gurion University where she explores the linkages between Visual Culture, History and Political Geography within the visual historiography of Israel/Palestine.
Brian Boyd, Director of Museum Anthropology, Columbia University
Brian Boyd (M.A.(Hons.) Glasgow 1991, Ph.D. Cambridge 1996) is currently Co-Chair of the Center for Palestine Studies. He is Program Director of the Columbia Center for Archaeology, Director of Museum Anthropology, and Co-Chair of the Columbia University Seminar on Human-Animal Studies. He is also Chair Emeritus of the New York Academy of Sciences Anthropology Division.
He has been carrying out archaeological research in Southwest Asia for almost thirty years, and currently co-directs the Columbia-Birzeit University project "Building Community Anthropology Across the Jordan Valley", based in the town of Shuqba in the West Bank, Palestinian Territories (partially funded by the Columbia University President's Global Initiative Fund). His research focuses on the prehistory of southwest Asia, the politics of archaeology in Israel/Palestine, and human-animal studies.
Audra Simpson, Department of Anthropology, Columbia University
My primary research is energized by the problem of recognition, by its passage beyond (and below) the aegis of the state into the grounded field of political self-designation, self-description and subjectivity. This work is motivated by the struggle of Kahnawake Mohawks to find the proper way to afford political recognition to each other, their struggle to do this in different places and spaces and the challenges of formulating membership against a history of colonial impositions. As a result of this ethnographic engagement I am interested especially in those formations of citizenship and nationhood that occur in spite of state power and imposition and in particular, I am interested in declarative and practice-oriented acts of independence. In order to stay faithful to the words of my interlocutors I am interested as well in the use of narrative as data, in alternative forms of ethnographic writing and in critical forms of history. In order to stay faithful to my own wishes, I work at every turn to enter the fields of anthropology and Native American Studies into a critical and constructive dialogue with each other.
My second research project examines the borders of time, history and bodies across and within what is now understood to be the United States and Canada.
Photo: A kite equipped with camera over the cistern of Muhammad Ibn Salame Al-Uqbi, Negev Desert. November 2016. Forensic Architecture (Ariel Caine) / Public Lab (Hagit Keysar) / Al-Araqib village / Zochrot
Thu, Oct 11, 2018, 2:00 pm to 4:00 pm
REGISTER HERE FOR THE EXHIBITION-OPENING &/OR THE SYMPOSIUM
The Italian Academy
1161 Amsterdam Avenue,
(Just south of 118th Street)

redpajama_set_name: RedPajamaCommonCrawl


text:
Andrei Tinu () este un jurist și politician român. Începând cu data de 8 martie 2017 ocupă funcția de președinte cu rang de Secretar de Stat al Autorității Naționale pentru Cetățenie.

Biografie
Andrei este fiul jurnalistului Dumitru Tinu, fost director al cotidianului Adevărul și fost președinte al Clubului Român de Presă, și al Emiliei Iucinu. S-a căsătorit, în 2014, cu medicul stomatolog Alberta Simona Tinu și au împreună doi copii.

Procesul de paternitate
În ianuarie 2003, imediat dupa moartea tatălui sau, Andrei Tinu (la acea vreme Andrei Iucinu) a introdus, la Judecătoria Sectorului 1, o acțiune judecătorească prin care a cerut recunoașterea paternității față de Dumitru Tinu. La începutul anului 2004, instanța a hotărât că Andrei este fiul Emiliei Iucinu și al regretatului jurnalist. Sentința a fost atacată de către moștenitorii lui Dumitru Tinu. Tribunalul București și, ulterior, Curtea de Apel București, au confirmat soluția primei instanțe. Procesul a avut un puternic impact emoțional la nivelul opiniei publice din România și a dus chiar la schimbarea legislației în vigoare, în sensul eliminării termenului de 1 an, pe care copilul îl avea pentru a acționa în justiție pentru a i se recunoaște filiația față de tată.

Moștenirea lui Dumitru Tinu
După zece ani de procese, Andrei (Iucinu) Tinu a ajuns la o înțelegere cu Tamara și Anna-Maria Tinu. Lui Andrei Tinu i-a revenit apartamentul tatălui său din Herăstrău, o casă de vacanță în localitatea Breaza și autoturismul Volvo, mașina în care și-a pierdut viața cunoscutul ziarist. Pe lângă acestea, Andrei Tinu a mai primit două terenuri în Coteana, Olt, comuna natală a lui Dumitru Tinu. Acțiunile de la ziarul Adevărul și banii din conturile lui Dumitru Tinu au rămas la Tamara și Anna-Maria.

Carieră politică
Andrei Tinu este membru al Biroului Permanent al Organizației Sectorului 1 a Partidului Social Democrat și cadru didactic universitar.
Andrei Tinu și-a început activitatea politică în 2006, când a fost ales liderul național al Mișcării Studențești România Mare, structură subordonată Partidului România Mare, din care a fost exclus la 25 ianuarie 2008. Ulterior, Andrei (Iucinu) Tinu a devenit membru al Partidului Social Democrat, activând în cadrul organizației de tineret a partidului (TSD). A fost purtător de cuvânt al TSD, vicepreședinte al Organizației Județene Arad a Partidului Social Democrat (2009-2010), secretar executiv al TSD (2010-2013) și vicepreședinte al TSD între 19 octombrie 2013 și 12 decembrie 2015.

Timp de peste doi ani (2014-2016), Andrei Tinu a fost vicepreședinte al Autorității Naționale pentru Cetățenie.

În paralel cu activitatea politică, Andrei a colaborat, în calitate de editorialist, cu mai multe publicații (România Mare, Q-magazine, Ghimpele, ziare.com).

Activitate didactică

Andrei Tinu este Doctor în Istorie al Universității din București. Este autor al cărții Scînteia de la Praga. Este cadru didactic titular la Facultatea de Drept a Universității "Titu Maiorescu" din București, susținând seminariile de Istoria Statului și Dreptului Românesc (ISDR) și Drept constituțional și instituții politice. De asemenea, Tinu susține seminariile disciplinelor Organizații europene și euroatlantice și Drept social european la Facultatea de Științe Sociale, Politice și Umaniste din cadrul aceleiași universități.

Cărți publicate
 Scînteia de la Praga, Editura Cetatea de Scaun, Târgoviște, 2015, 450 p., ISBN 978-606-537-297-9.
 Dezbateri universitare: culegere de discursuri, Ediția I, (coordonator), Editura Universității "Titu Maiorescu", București, 2013, 192 p., ISBN 978-606-8002-91-0.
 Otrava de aur: ferma de vipere de la 0 la profit, (coordonator), publicată în regie proprie, București, 2012, 192 p., ISBN 978-973-0-12796-6.
 Moștenirea, Editura Nouă, București, 2010, 176 p., ISBN 978-606-8082-38-7.

Recunoaștere

Pe 11 noiembrie 2014 a fost decorat de către ÎPS Petru, Arhiepiscop al Chișinăului, Mitropolit al Basarabiei și Exarh al Plaiurilor, cu Crucea Mitropoliei Basarabiei pentru Mireni, în semn de recunoaștere a meritelor "pe care Domnia Sa le are față de Mitropolia Basarabiei, în promovarea creștinismului românesc și idealurilor naționale".

Bibliografie
 Cristina Herea, România de culise, RCR Editorial, București, 2012;
 Nora Noapte, Anul 2014 - Anul victoriilor pentru Andrei Tinu, în "Q-magazine", 29.05.2014, ediție electronică;
 Eva Marin, Andrei Tinu: Cetățenia română, o carte de vizită, în "Mesager de Constanța", 13.08.2014, ediție electronică;
 ***ÎPS Petru l-a decorat pe Andrei Tinu cu Crucea Mitropoliei Basarabiei, www.mitropoliabasarabiei.md.
 Șerban Cionoff, O viziune românească asupra "Primăverii de la Praga", în "Jurnalul Național", 20.09.2015, ediție electronică;
 ***Andrei Tinu și-a lansat volumul "Scânteia de la Praga", Agenția Națională de Presă AGERPRES, 21.08.2015;
 ***Alexandru Giboi, director general al AGERPRES, a participat la evenimentul de lansarea volumului "Scânteia de la Praga", scris de Andrei Tinu, Antena 3, 21.08.2015;
 ***Andrei Tinu launches book on Prague Spring witnessed by his father, Romanian National News Agency AGERPRES, English Version, 21.08.2015;
 ***Andrei Tinu vine cu propuneri inovatoare vizând locurile de muncă: comunicat de presă Andrei Tinu (TSD), Agenția Națională de Presă AGERPRES, 03.09.2015;
 Răzvan Mateo Mateescu, Vlahii, la un pas de cetățenia română. Modificarea legii deschide porțile comunităților românești din țările vecine, nu numai din R. Moldova, în "Puterea", nr. 1341, 14.09. 2015, p. 4. Vezi și ediția electronică!;

Note

Legături externe

 http://www.radioromaniacultural.ro/andrei_tinu_lanseaza_vineri_volumul_scanteia_de_la_praga-36113
 http://www.nineoclock.ro/andrei-tinu-launches-book-on-prague-spring-witnessed-by-his-father/
 http://www.palo.ro/a/comunicat-de-pres%C4%83-andrei-tinu-tsd-51140http://www.ziuaveche.ro/actualitate-interna/politica-interna/batalia-pentru-tsd-andrei-tinu-vrea-sa-fie-presedintele-tinerilor-social-democrati-166495.html/
 http://www.jurnaluldearges.ro/index.php/culise-2/8158-mario-paun-studentul-lui-andrei-tinu
 http://www.evz.ro/andrei-tinu-numit-subsecretar-de-stat-la-justitie-1081065.html
 http://adevarul.ro/news/politica/fiul-dumitru-tinu-andrei-intra-guvernare-1_52f3bb68c7b855ff5620d960/index.html
 http://www.ziare.com/invitati/andrei-tinu/

Nașteri pe 21 noiembrie
Nașteri în 1985
Politicieni români din secolul al XXI-lea
Juriști români în viață
Bucureșteni

redpajama_set_name: RedPajamaWikipedia


Bengaluru — Tesla shares sank 9% on Wednesday after the electric-vehicle maker delivered fewer-than-expected Model 3 sedans in the fourth quarter and cut prices for all its vehicles in the US in response to the loss of a green tax credit.
The company said it delivered 63,150 Model 3s in the quarter, falling short of FactSet estimates of 64,900.
Tesla shares were down 8.4% at $304.91 in pre-market trade.
Overall, total production rose 8% to 86,555 vehicles. The company produced 61,394 Model 3s, up from a total of 53,239 Model 3s in the third quarter, but showed no improvement on the 5,000 per week rate it finally achieved at the end of the third quarter.
Tesla has been struggling to ramp up production of its Model 3 sedan, which is crucial to the company's long-term profitability.
The company said in its third quarter results that it would focus in the fourth quarter on further increasing its production rate, and there were indications that Wall Street had been expecting higher numbers.
Starting on Wednesday, the company said it will be reducing the price of Model S, Model X and Model 3 vehicles in the US by $2,000.
Tesla has been urging buyers to make use of the federal tax credit, with CEO Elon Musk reminding them on Twitter on Saturday that the benefit would drop to half from the start of 2019.


Innosilicon, one of the lead ASIC manufacturers for most of the modern popular cryptos announced few days a go, January 25, that they are working on their first ASIC for GRIN.
According to the manufacturer, the new ASIC will be launched early summer this year.
Innosilicon is a China-based giant that is known for being one of the most important Bitmain competitors. The company is one of those who take part in the chip dice reduction race in ASICs and we could speculate that the new GRIN ASICs will be based on the newest (10nm or even 7nm) technology.
GRIN is a cryptocurrency that solves some of the main Bitcoin scalability and anonymity issues. Based on the innovative MimbleWimble protocol, GRIN is an open-source, community developed and funded project.
While minable by GPUs, GRIN developers clearly said from the beginning that the coin is aimed to be mined with ASICs and that GPU mining is only allowed in the beginning. For now, only 10% of the blocks are being generated by Cuckatoo31+, which is the ASIC-friendly algo. In the span of the next two years, that percentage will slowly increase to 100%, making GRIN an ASIC-only coin.
AMD New 7nm Graphic Cards – Next Top-End Miners?


text:
16/07 The Importance of Mentorship In Our Communities.
February 12, 2016 March 15, 2018 Self Discovery Orchard of Wisdom Podcast Community
The Wellness Journey with Lynnis Woods-Mullins with guest Ronald M. Barnes, aired February 16th/16
February is Black History Month and in commemoration of Black History month we will be talking to Ron Barnes about the importance of membership in the African American communities as well as all communities for boys and girls.
Ronald M. Barnes is the author of Principles of Manhood as well as the book, Guide To Understanding The Principles of Manhood. The principles cited in these writings have served as the foundation of mentoring programs all over the country. The Boys and Girls Club of America "Menformation" mentoring program in Los Angeles has redirected the lives of hundreds of inner-city youth using the Principles of Manhood. These mentor-ship programs have changed and are changing the lives of both males and females all over the country.
Join me and Ron Barnes as we discuss the importance of mentor-ship and why it is an important part of our communities and overall wellness.
TUNE IN HERE FOR INSTANT LISTENING OF SHOW NOW
For mobile/tablets you can download free apps here: soundcloud.com/mobile
Ron Barnes received both his undergraduate and master's degrees at universities in the north-eastern region of the United States. His initial inspiration to write the Principles of Manhood grew out of his desire to give his children and the next generation a foundation from which to grow. Ronald Barnes has been involved with numerous mentoring programs all over the United States. He has lectured and served as keynote speaker for many youth and manhood training programs. The first edition of Guide to Understanding the Principles of Manhood has been used as the foundation for curriculums in several religious youth ministries and mentoring programs. This book has also served as a training tool for women in the Substance Abuse Treatment Unit Program for the Connecticut Mental Health Department at Yale University
www.ctri2009.com
More on your host Lynnis and her shows got to new-wellness-journey-show and Magazine wellness-woman-40-and-beyond-magazine
An Author's Kiss shows, The Wellness Journey Past Shows, What's NewLynnis Woods Mullins, Ronald M. Barnes, self discovery radio, The Importance of Mentorship In Our Communities.
← C16/08b V.I.S.I.B.L.E Freeing your voice
My Mama Jo I love You →


text:
Home » Pennsylvania Bands
Pennsylvania Bands
(kaj)
Location (Select closest city): 0-9 & characters, Pennsylvania Bands
Swooping down on the earth like a mystical bird of flame, (kāj) provides a rebirth of rock from the ashes of it's predecessors. Driven by a strong vocal presence and melodic guitar riffs and brought together with intense bass undertones and driving rhythmic patterns producing a sound that you aren't likely to forget.
(kāj) was a four member high-energy, modern rock band hailing from the Alle-Kiski Valley of Western Pennsylvania.
Website: cdbaby
13 Saints
13 Saints is a four-piece band from Pittsburgh that play surly rock and roll songs infused with elements of power pop and punk. A true Hoi Polloi toy. These musical veterans are at home on big stages or small, but prefer the intimacy of any dive bar. They are committed to giving the audience a memorable show and, like 'em or not, they can't be ignored. Their debut album, Crushing Copper, is available now featuring 11 tracks of gritty, passionate music. If rock and roll is part of your DNA, then put 13 Saints on your must-see list.
30 Days of Pain
30 Days of Pain are a band based out of Pittsburgh, PA. They just want to have fun & tear it up!
Website: https://www.reverbnation.com/30daysofpain
9 Stitch Method
Progressive alternative metal from Pittsburgh, PA.
Website: https://www.facebook.com/9stitchmethod/
A Common Crown
Location (Select closest city): A-I, Pennsylvania Bands
Vocals. J. Heymers
Drums. M. Ferrante
Bass. S. Craven
Guitar. Z. Shepard
Guitar. D. Mammano
A Lovely Crisis
A Lovely Crisis is flipping the proverbial finger to the manufactured "pop band" image. Formed in Pittsburgh, Pa in 2010, brought together by a mutual love of old school punk and post-punk artists, A Lovely Crisis is a 4-piece punk rock band that looks to find the beauty that comes out of turmoil. Having spent a large percentage of their lives during war time and financial crisis, their songs give voice to their frustration, touching on corrupt politicians and human rights.
Their new full length, "Where Do You Stand?" is a challenge to the listener to question where they stand on issues that affect all of us. Produced and recorded by Anti-Flag's Chris(#2)Barker, "Where Do You Stand?" is due out June 3rd on A-F Records with extensive East Coast and Midwest touring to follow.
A Moment in Pompeii
After meeting in college in 2013, Antonio DiBiasio (drums) and David Pinkerton (guitar) began jamming their favorite songs together. They eventually began writing original songs and the band grew, gaining the talents of Doug Boylan on lead guitar and Sam Allison with vocal duties. Josh Mauro later joined the band, jumping onto bass after performing vocals in his previous musical efforts. The band began recording in the summer of 2017, releasing their first single that fall.
A Moment in Pompeii's name reflects the temporary nature of life in a broken and unforgiving world: do what you can, while you can. Make your moment matter, because life is fleeting.
Website: https://amomentinpompeii.com/
Across the Dawn
Across the Dawn is a band from the Pittsburgh, Pennsylvania region that blends rock and electronic music together to form a sound that is powerful and atmospheric. The band has a diverse catalog of songs that reach your imagination and emotions with lyrical and musical imagery that can be described like a photograph developing in the listener's mind. It is a sound you can get lost in that is not only heard but felt. The band consists of Josh Morris, Shawn Minerd, Justin Smith, and Micahel Meucci. Across the Dawn's self-titled debut album is out now!
Website: https://www.acrossthedawn.com/
After the Fall is a 4 piece, original hard rock band from Pittsburgh, Pennsylvania. Originally formed back in 2004, they've undergone several lineup changes over the years, and although met with success soon after their formation, it's their current incarnation that has the city of Pittsburgh, and cities throughout the country, abuzz. With Matt Ferrante on drums, Steve Craven on bass, Zac Sheppard on guitar, and Doug Carnahan on vocals/guitar, they've made a bang in Pittsburgh and surrounding regions. They've shared the stage with such national acts as Hurt, Sevendust, The Sin City Sinners, Corrosion of Conformity, Nonpoint, Primer 55, and more. They have played in cities across the country, turning heads and recruiting new fans as if they're lives depended on it.
All My Monsters
All my monsters is a very dynamic high energy rock band. Playing classic and modern alternative rock. From songs you've heard for years, to the deep tracks you wont hear on the radio.
Mikey Riot
We the Unwilling


With some of the evil we see in this world it sometimes begs the question "Are people inherently good or inherently evil?" What do you think?
I think people are inherently human, they have the potential for great good, AND great evil. This raises the age old nature vs nurture argument, and for me, the answer to that is A GOOD MIX OF THE TWO.
We make choices every day. I strive to make good choices, and I am striving to raise children who will make good choices. However I'm sure I've made some rotten choices somewhere along the way. Nothing evil as such, but the point is that, as a human, both are possible.
I may just get slammed for this answer, but you asked it...and I will give MY Opinion.
In all my years of study on this Very Topic.....I found an answer.
I have over the years found young children when playing with other young children say age 2 and up, doing something quite strange.
If they were not happy, and wanted something another child had, they would take it...with may I say a fair amount of force.
If said child did not get what it wanted, as tiny and sweet as they are, that child would hit the other child.
No parent would have taught the child to do such a thing, and the child would not really be able to retain any kind of info for 'how to get what they wanted'.
The action comes from 'instinct'.
It has happened for a long long time.
Evil is too strong a word when talking about early childhood actions, and that's where we need to look when viewing, are people inherently good or bad.
The view I share, and a great deal of my colleagues is we are born with a mean streak.Some will say (Bad).
How that person deals with it, as they get older is up to them.
For the last 14 years I have worked with men inside maximum security jails.
I have asked psychologists who have had to deal with very high profile killers....'Why'? do they do what they do.
It comes back to the human being being born 'short' of perfection.
It also comes down to a need to want power over others.
Hence why we see the most dreadful actions on other people who were going about their daily life, and never saw it coming.
This is a tricky question. I think that humans are inherently bad. We have to be taught to do the right thing.
DEFINE EVIL, I would rather say there are only 2 types of people in this world -GIVERS or TAKERS and then look upon them as bigger or little takers in what ever category they fit. For example Big TAKERS or Little TAKERS.
Is your dollar buying less these days?
Is there anything or anyone that will get you to turn your head or stare as you commute?
Have you seen the show Sydney ER?


Custom metal ceiling systems, made possible through Zahner Design Assist.
Custom ceiling systems can be made in a variety of metals and techniques. Zahner works with designers to create custom overhead systems, including interior ceiling design as well as exterior canopy and soffit systems.
Custom perforated metal ceiling systems can be developed to include acoustic sound deadening. Such acoustic panel systems benefit can be made with custom imagery and graphics embedded in the metal surface using ImageWall software for perforated metal.
Custom perforated metal ceiling system for NCX 6060 Photo © Annie Devine.
Cast aluminum ceiling for the American Medical Association in Chicago. Photo © A. Zahner Company.


Detergent designed to eliminate signs and traces of rust from metal surfaces, steel and magnesium parts. Touchless and Automatic Car Wash Line.
Detergent designed to eliminate signs and traces of rust from metal surfaces, steel and magnesium parts.
Its dynamic, wide-ranging action makes it indispensable for cleaning tank trucks and trailer-trucks, aluminium tail boards, stainless steel tanks, trucks and containers, especially after long periods of inactivity on railway tracks.
It removes the black dots created by brake pads present on car rims and it is also perfect for the cleaning of trucks chassis and washing equipment tracks.
It gives brightness to treated parts.


One example of an Intersystem bonding termination as required by the National Electrical Code.
Dear Mr. Electrician: How do I ground my telephone and cable TV demarcation terminal blocks?
Answer: Your telephone and cable TV service each needs to be bonded to a ground rod or water pipe ground, or both if available. This is for lightning protection. If Lightning were to strike the outside cable TV wire and your home has good ground connections, the lightning energy would be channeled directly to earth. With a poor or non-existent earth ground connection, the lightning will find a way to earth, but that could be a path through your TV, computer, major appliance, even the metal ducts in your house. That is how things get damaged or fires start. Click here for photos of one example of a TV and Telephone bonding and grounding on an older house.
The grounding electrode conductor (Green wire) passes through the Intersystem Bonding Termination and continues to one ground rod and then terminates on a second ground rod several feet away. The conduit poking out of the ground is the electric utility company's underground service feed for the electric meter.
The Photo above depicts an Intersystem Bonding Termination which is required by the National Electrical Code. This simple terminal block makes it easy for telephone and cable TV installers to connect their grounding electrode conductor wire to a good earth ground connection. It takes one large grounding electrode conductor and up to four smaller grounding conductors for cable TV and telephone services. It is important to have this for lightning protection. The Intersystem Bonding Termination is required as per article 250.94 in the National Electrical Code. You should also read NFPA 780 on lightning protection.
Something else to consider is the installation of a surge protector. Read my post on that subject here.