text:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "lcd.h"
#include "basic.h"
#include "utils.h"
#include "interrupt.h"
#include "keys.h"
#include "variables.h"

// Pointer to the list of variables
variable *variables = NULL;

/**
 * Find the variable with the given name.
 * Returns NULL if the variable wasn't found.
 * Returns a pointer to the previous variable in prev if prev != NULL.
 */
variable * find_variable(unsigned int name, unsigned char type, variable **prev) {
  variable *v = variables;
  if (prev) {
    *prev = NULL;
  }
  while (v && (v->name != name ||
         (v->type & VAR_TYPE_MASK) != (type & VAR_TYPE_MASK))) {
    if (prev) {
      *prev = v;
    }
    v = v->next;
  }
  return v;
}

/**
 * Create a new variable with name name, type type and value value.
 * Override the variable if it is already defined.
 */
void create_variable(unsigned int name, unsigned char type, void *value) {
  variable *new_v;
  variable *prev_v;
  variable *v = find_variable(name, type, &prev_v);

  if (v && v->type & VAR_FLAG_BUILTIN) {
    syntax_error_msg("Cannot overwrite builtin!");
    return;
  }

  if (v) {
    if ((v->type & VAR_TYPE_MASK) == VAR_TYPE_STRING) {
      free(v->value.string);
    }
    new_v = v;
  } else {
    new_v = malloc(sizeof(variable));
    new_v->name = name;
    new_v->next = variables;
    variables = new_v;
  }

  new_v->type = type;
  switch (type & VAR_TYPE_MASK) {
    case VAR_TYPE_INTEGER: {
      if (type & VAR_FLAG_BUILTIN) {
        new_v->value.builtin_string = value;
      } else {
        new_v->value.integer = *((int *)value);
      }
      break;
    }
    case VAR_TYPE_STRING: {
      if (type & VAR_FLAG_BUILTIN) {
        new_v->value.builtin_string = value;
      } else {
        unsigned char len = strlen(value);
        new_v->value.string = malloc(len + 1);
        strcpy(new_v->value.string, value);
      }
      break;
    }
  }
}

/**
 * Delete the variable with the name 'name' and the type 'type'.
 */
void delete_variable(unsigned int name, unsigned char type) {
  variable *prev_v;
  variable *v = find_variable(name, type, &prev_v);

  if (v && v->type & VAR_FLAG_BUILTIN) {
    syntax_error_msg("Cannot delete builtin!");
    return;
  }

  if (v) {
    if ((v->type & VAR_TYPE_MASK) == VAR_TYPE_STRING) {
      free(v->value.string);
    }
    if (v == variables) {
      variables = v->next;
    } else {
      prev_v->next = v->next;
    }
    free(v);
  }
}

/**
 * Print the value of the variable v.
 * If mode == VAR_PRINT_VERBOSE, a verbose representation is printed
 * (e.g. "..." for strings).
 */
void print_variable(variable *v, unsigned char mode) {
  switch (v->type & VAR_TYPE_MASK) {
    case VAR_TYPE_INTEGER:
      if (v->type & VAR_FLAG_BUILTIN) {
        sprintf(print_buffer, "%d", v->value.builtin_integer());
      } else {
        sprintf(print_buffer, "%d", v->value.integer);
      }
      lcd_puts(print_buffer);
      break;
    case VAR_TYPE_STRING:
      if (mode == VAR_PRINT_VERBOSE) {
        lcd_putc('"');
      }
      if (v->type & VAR_FLAG_BUILTIN) {
        lcd_puts(v->value.builtin_string());
      } else {
        lcd_puts(v->value.string);
      }
      if (mode == VAR_PRINT_VERBOSE) {
        lcd_putc('"');
      }
      break;
  }
}

/**
 * Return the value of the builtin ti$ variable ("00:00:00").
 */
char *builtin_var_time_string() {
  static char builtin_var_time_buffer[9]; // "00:00:00"
  sprintf(builtin_var_time_buffer, "%02d:%02d:%02d", time_hours(), time_minutes(), time_seconds());
  return builtin_var_time_buffer;
}

/**
 * Return the value of the builtin ti variable (time in milliseconds).
 */
int builtin_var_time_integer() {
  return time_millis();
}

/**
 * Return the value of the builtin rn variable (random value).
 */
int builtin_var_random_integer() {
  return rand();
}

/**
 * Initialize all builtin varaibles.
 */
void init_builtin_variables() {
  create_variable(('t' << 8) | 'i', VAR_FLAG_BUILTIN | VAR_TYPE_INTEGER, builtin_var_time_integer);
  create_variable(('t' << 8) | 'i', VAR_FLAG_BUILTIN | VAR_TYPE_STRING, builtin_var_time_string);
  create_variable(('r' << 8) | 'n', VAR_FLAG_BUILTIN | VAR_TYPE_INTEGER, builtin_var_random_integer);
}

/**
 * Delete all variables except the builtin ones.
 */
void clear_variables() {
  variable *v = variables;
  variable *delete_v;
  while (v) {
    delete_v = v;
    v = v->next;
    if (delete_v->type == VAR_TYPE_STRING) {
      free(delete_v->value.string);
    }
    free(delete_v);
  }
  variables = NULL;
  init_builtin_variables();
}

/**
 * List all variables.
 */
void print_all_variables() {
  unsigned char first = 1;
  variable *v = variables;
  while (v) {
    if (first) {
      first = 0;
    } else {
      do {
        if (is_interrupted()) {
          lcd_puts("Interrupted.\n");
          return;
        }
        keys_update();
      } while (keys_get_code() == KEY_NONE);
    }

    if (v->name > 256) {
      lcd_putc(v->name >> 8);
    }
    lcd_putc(v->name & 0xff);
    if (v->type == VAR_TYPE_STRING) {
      lcd_putc('$');
    }

    lcd_puts(" = ");

    print_variable(v, VAR_PRINT_VERBOSE);
    lcd_put_newline();

    v = v->next;
  }
 }

/**
 * Return the value of a string variable.
 */
char * get_string_variable_value(variable *var) {
  if (var->type & VAR_FLAG_BUILTIN) {
    return var->value.builtin_string();
  } else {
    return var->value.string;
  }
}

/**
 * Return the value of a integer variable.
 */
int get_integer_variable_value(variable *var) {
  if (var->type & VAR_FLAG_BUILTIN) {
    return var->value.builtin_integer();
  } else {
    return var->value.integer;
  }
}


text:
package org.sablecc.sablecc.core.interfaces;

import org.sablecc.sablecc.syntax3.node.*;

public interface INameDeclaration {

    public Token getNameIdentifier();

    public String getName();

    public String getNameType();
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0"?>
<tool_dependency>
    <package name="scikit-learn" version="0.15">
        <repository toolshed="http://toolshed.g2.bx.psu.edu" name="package_numpy_1_7" owner="iuc" />
        <repository toolshed="http://toolshed.g2.bx.psu.edu" name="package_scipy_0_12" owner="iuc" />
        <repository toolshed="http://toolshed.g2.bx.psu.edu" name="package_scikit_learn_0_15" owner="saket-choudhary" />
        <repository toolshed="http://toolshed.g2.bx.psu.edu" name="package_fastcluster_1_1_13" owner="saket-choudhary" />
    </package>
</tool_dependency>


text:
* Supports both in-memory and file ql databases, with the URL schemes `ql+file://` and `ql+memory://`
    * In-memory driver is not of much use, since the database is destroyed once the migration operation finishes, but is included for completeness.
* Stores migration version details in automatically generated table ``schema_migrations``.

## Usage

```bash
migrate -url ql+file://./data.db -path ./migrations create add_field_to_table
migrate -url ql+file://./data.db -path ./db/migrations up
migrate help # for more info
```

## Authors

* Sam Willcocks, https://github.com/wlcx


text:
require 'google/apis/transcoder_v1/service.rb'
require 'google/apis/transcoder_v1/classes.rb'
require 'google/apis/transcoder_v1/representations.rb'
require 'google/apis/transcoder_v1/gem_version.rb'

module Google
  module Apis
    # Transcoder API
    #
    # This API converts video files into formats suitable for consumer distribution.
    # For more information, see the Transcoder API overview.
    #
    # @see https://cloud.google.com/transcoder/docs/
    module TranscoderV1
      # Version of the Transcoder API this client connects to.
      # This is NOT the gem version.
      VERSION = 'V1'

      # See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
      AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
    end
  end
end


text:
package org.slc.sli.bulk.extract.date;

import org.joda.time.DateTime;
import org.springframework.stereotype.Component;

import org.slc.sli.domain.Entity;

/**
 * Verifies whether or not an Attendance entity should be extracted.
 *
 * @author tke tshewchuk
 */
@Component
public class DatelessExtractVerifier implements ExtractVerifier {

    @Override
    public boolean shouldExtract(Entity entity, DateTime upToDate) {
        return true;
    }

}


text:
package org.kuali.kra.award.web.struts.action;

import org.apache.commons.lang.StringUtils;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.kuali.kra.award.AwardForm;
import org.kuali.kra.award.document.AwardDocument;
import org.kuali.kra.award.home.Award;
import org.kuali.kra.award.home.AwardAmountInfo;
import org.kuali.kra.award.home.keywords.AwardScienceKeyword;
import org.kuali.kra.award.specialreview.AwardSpecialReview;
import org.kuali.kra.bo.FundingSourceType;
import org.kuali.kra.bo.SpecialReviewType;
import org.kuali.kra.bo.versioning.VersionHistory;
import org.kuali.kra.bo.versioning.VersionStatus;
import org.kuali.kra.common.specialreview.rule.event.SaveSpecialReviewLinkEvent;
import org.kuali.kra.common.specialreview.service.SpecialReviewService;
import org.kuali.kra.infrastructure.Constants;
import org.kuali.kra.infrastructure.KeyConstants;
import org.kuali.kra.infrastructure.KraServiceLocator;
import org.kuali.kra.service.KeywordsService;
import org.kuali.rice.core.api.util.type.KualiDecimal;
import org.kuali.rice.coreservice.framework.parameter.ParameterConstants;
import org.kuali.rice.coreservice.framework.parameter.ParameterService;
import org.kuali.rice.kew.api.exception.WorkflowException;
import org.kuali.rice.kns.question.ConfirmationQuestion;
import org.kuali.rice.kns.util.KNSGlobalVariables;
import org.kuali.rice.krad.service.BusinessObjectService;
import org.kuali.rice.krad.util.GlobalVariables;
import org.kuali.rice.krad.util.KRADConstants;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 *
 * This class represents the Struts Action for Award page(AwardHome.jsp)
 */
public class AwardHomeAction extends AwardAction {

    private static final String AWARD_VERSION_EDITPENDING_PROMPT_KEY = "message.award.version.editpending.prompt";
    private static final String DOC_HANDLER_URL_PATTERN = "%s/DocHandler.do?command=displayDocSearchView&docId=%s";
    private ApprovedSubawardActionHelper approvedSubawardActionHelper;
    private ParameterService parameterService;

    public AwardHomeAction(){
        approvedSubawardActionHelper = new ApprovedSubawardActionHelper();
    }

    public ActionForward addFundingProposal(ActionMapping mapping, ActionForm form,
                                            HttpServletRequest request,
                                            HttpServletResponse response) throws Exception {
        ((AwardForm) form).getFundingProposalBean().addFundingProposal();
        return mapping.findForward(Constants.MAPPING_BASIC);
    }

    /**
     * This method is used to add a new Award Cost Share
     *
     * @param mapping
     * @param form
     * @param request
     * @param response
     * @return mapping forward
     * @throws Exception
     */
    public ActionForward addApprovedSubaward(ActionMapping mapping, ActionForm form,
                                                HttpServletRequest request,
                                                    HttpServletResponse response) throws Exception {
        approvedSubawardActionHelper.addApprovedSubaward(((AwardForm) form).getApprovedSubawardFormHelper());
        return mapping.findForward(Constants.MAPPING_BASIC);
    }

    /**
     * This method is used to delete an Award Cost Share
     *
     * @param mapping
     * @param form
     * @param request
     * @param response
     * @return mapping forward
     * @throws Exception
     */
    public ActionForward deleteApprovedSubaward(ActionMapping mapping, ActionForm form,
                                                    HttpServletRequest request,
                                                         HttpServletResponse response) throws Exception {
        AwardForm awardForm = (AwardForm) form;
        AwardDocument awardDocument = awardForm.getAwardDocument();
        int delApprovedSubaward = getLineToDelete(request);
        awardDocument.getAward().getAwardApprovedSubawards().remove(delApprovedSubaward);

        return mapping.findForward(Constants.MAPPING_BASIC);

    }

    /**
     *
     * This method opens a document in read-only mode
     * @param mapping
     * @param form
     * @param request
     * @param response
     * @return
     * @throws Exception
     */
    public ActionForward open(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
        ActionForward actionForward = super.execute(mapping, form, request, response);
        AwardForm awardForm = (AwardForm) form;
        String commandParam = request.getParameter(KRADConstants.PARAMETER_COMMAND);
        if (StringUtils.isNotBlank(commandParam) && commandParam.equals("initiate")
            && StringUtils.isNotBlank(request.getParameter(AWARD_ID_PARAMETER_NAME))) {
            Award award = findSelectedAward(request.getParameter(AWARD_ID_PARAMETER_NAME));
            initializeFormWithAward(awardForm, award);
        }

        return actionForward;
    }

    /**
     * This method is used to recalculate the Total Subaward amount in the Subaward panel.
     *
     * @param mapping
     * @param form
     * @param request
     * @param response
     * @return mapping forward
     * @throws Exception
     */
    public ActionForward recalculateSubawardTotal(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) throws Exception {

        approvedSubawardActionHelper.recalculateSubawardTotal(((AwardForm) form).getApprovedSubawardFormHelper());
        return mapping.findForward(Constants.MAPPING_BASIC);
    }

    /**
     *
     * @see org.kuali.kra.award.web.struts.action.AwardAction#execute(org.apache.struts.action.ActionMapping,
     *                                                                 org.apache.struts.action.ActionForm,
     *                                                                 javax.servlet.http.HttpServletRequest,
     *                                                                 javax.servlet.http.HttpServletResponse)
     */
    @Override
    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        ActionForward actionForward = super.execute(mapping, form, request, response);
        AwardForm awardForm = (AwardForm) form;
        String commandParam = request.getParameter(KRADConstants.PARAMETER_COMMAND);
        if (StringUtils.isNotBlank(commandParam) && commandParam.equals("initiate")
            && StringUtils.isNotBlank(request.getParameter(AWARD_ID_PARAMETER_NAME))) {
            Award award = findSelectedAward(request.getParameter(AWARD_ID_PARAMETER_NAME));
            initializeFormWithAward(awardForm, award);
        }
        if (StringUtils.isNotBlank(commandParam) && "redirectAwardHistoryFullViewForPopup".equals(commandParam)) {
            String awardDocumentNumber = request.getParameter("awardDocumentNumber");
            String awardNumber = request.getParameter("awardNumber");
            actionForward = redirectAwardHistoryFullViewForPopup(mapping, form, request, response, awardDocumentNumber, awardNumber);
        }

        return actionForward;
    }

    /**
     * This takes care of populating the ScienceKeywords in keywords list after the selected Keywords returns from multilookup
     * @see org.kuali.core.web.struts.action.KualiDocumentActionBase#refresh(org.apache.struts.action.ActionMapping,
     *                                                                          org.apache.struts.action.ActionForm,
     *                                                                          javax.servlet.http.HttpServletRequest,
     *                                                                          javax.servlet.http.HttpServletResponse)
     */
    @SuppressWarnings("unchecked")
    @Override
    public ActionForward refresh(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        super.refresh(mapping, form, request, response);
        GlobalVariables.getUserSession().removeObject(Constants.LINKED_FUNDING_PROPOSALS_KEY);
        AwardForm awardMultiLookupForm = (AwardForm) form;
        String lookupResultsBOClassName = request.getParameter(KRADConstants.LOOKUP_RESULTS_BO_CLASS_NAME);
        String lookupResultsSequenceNumber = request.getParameter(KRADConstants.LOOKUP_RESULTS_SEQUENCE_NUMBER);
        awardMultiLookupForm.setLookupResultsBOClassName(lookupResultsBOClassName);
        awardMultiLookupForm.setLookupResultsSequenceNumber(lookupResultsSequenceNumber);
        Award awardDocument = awardMultiLookupForm.getAwardDocument().getAward();
        getKeywordService().addKeywords(awardDocument, awardMultiLookupForm);

        awardDocument.refreshReferenceObject("sponsor");

        return mapping.findForward(Constants.MAPPING_BASIC);
    }

    /**
     * Override to update funding proposal status as needed
     * @param mapping
     * @param form
     * @param request
     * @param response
     * @return
     * @throws Exception
     */
    @Override
    public ActionForward save(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
        ActionForward forward = mapping.findForward(Constants.MAPPING_BASIC);

        AwardForm awardForm = (AwardForm) form;
        AwardDocument awardDocument = awardForm.getAwardDocument();

        //if award is a root Award and direct/indirect view is enabled, then we need to sum the obligated and anticipated totals until we create
        //initial T&M doc.
        if(awardDocument.getAward().getAwardNumber().endsWith("-00000")) {
            awardDocument.getAward().getLastAwardAmountInfo().resetChangeValues();
            // ### Vivantech Fix : #151 / [#90223952] added char to the end of award number
        } else if(awardDocument.getAward().getAwardNumber().endsWith("-00001A")) {
            if (isDirectIndirectViewEnabled()) {
                setTotalsOnAward(awardDocument.getAward());
            }
            Award oldAward = getAwardVersionService().getActiveAwardVersion(awardDocument.getAward().getAwardNumber());
            AwardAmountInfo aaiNew = awardDocument.getAward().getLastAwardAmountInfo();
            if (oldAward != null) {
                AwardAmountInfo aaiOld = oldAward.getLastAwardAmountInfo();
                aaiNew.setObligatedChange(aaiNew.getAmountObligatedToDate().subtract(aaiOld.getAmountObligatedToDate()));
                aaiNew.setObligatedChangeDirect(aaiNew.getObligatedTotalDirect().subtract(aaiOld.getObligatedTotalDirect()));
                aaiNew.setObligatedChangeIndirect(aaiNew.getObligatedTotalIndirect().subtract(aaiOld.getObligatedTotalIndirect()));
                aaiNew.setAnticipatedChange(aaiNew.getAnticipatedTotalAmount().subtract(aaiOld.getAnticipatedTotalAmount()));
                aaiNew.setAnticipatedChangeDirect(aaiNew.getAnticipatedTotalDirect().subtract(aaiOld.getAnticipatedTotalDirect()));
                aaiNew.setAnticipatedChangeIndirect(aaiNew.getAnticipatedTotalIndirect().subtract(aaiOld.getAnticipatedTotalIndirect()));
            } else {
                aaiNew.resetChangeValues();
            }
        }

        /**
         * the following two null overrides are per KCAWD-1001
         */
        if (awardDocument.getAward().getAwardAmountInfos().get(0).getAnticipatedTotalAmount() == null) {
            awardDocument.getAward().getAwardAmountInfos().get(0).setAnticipatedTotalAmount(new KualiDecimal(0));
        }
        if (awardDocument.getAward().getAwardAmountInfos().get(0).getAmountObligatedToDate() == null) {
            awardDocument.getAward().getAwardAmountInfos().get(0).setAmountObligatedToDate(new KualiDecimal(0));
        }

        awardForm.getProjectPersonnelBean().updateLeadUnit();
        if (this.getReportTrackingService().shouldAlertReportTrackingDetailChange(awardForm.getAwardDocument().getAward())) {
            GlobalVariables.getMessageMap().putWarning("document.awardList[0].awardExecutionDate",
                    KeyConstants.REPORT_TRACKING_WARNING_UPDATE_FROM_DATE_CHANGE, "");
        }

        boolean isAwardProtocolLinkingEnabled = getParameterService().getParameterValueAsBoolean(
                "KC-PROTOCOL", "Document", "irb.protocol.award.linking.enabled");
        List<AwardSpecialReview> specialReviews = awardDocument.getAward().getSpecialReviews();
        if (!isAwardProtocolLinkingEnabled || applyRules(new SaveSpecialReviewLinkEvent<AwardSpecialReview>(awardDocument, specialReviews))) {
            forward = super.save(mapping, form, request, response);

            awardDocument.getAward().refreshReferenceObject("sponsor");
            Award award = awardDocument.getAward();
            award.setSponsorNihMultiplePi(getSponsorService().isSponsorNihMultiplePi(award));

            persistSpecialReviewProtocolFundingSourceLink(award, isAwardProtocolLinkingEnabled);
        }

        return forward;
    }

    private void setTotalsOnAward(Award award) {
        AwardAmountInfo aai = award.getLastAwardAmountInfo();
        aai.setAmountObligatedToDate(aai.getObligatedTotalDirect().add(aai.getObligatedTotalIndirect()));
        aai.setAnticipatedTotalAmount(aai.getAnticipatedTotalDirect().add(aai.getAnticipatedTotalIndirect()));
    }

    private void persistSpecialReviewProtocolFundingSourceLink(Award award, boolean isAwardProtocolLinkingEnabled) {
        if (isAwardProtocolLinkingEnabled) {
            SpecialReviewService specialReviewService = KraServiceLocator.getService(SpecialReviewService.class);

            for (AwardSpecialReview specialReview : award.getSpecialReviews()) {
                if (SpecialReviewType.HUMAN_SUBJECTS.equals(specialReview.getSpecialReviewTypeCode())) {
                    String protocolNumber = specialReview.getProtocolNumber();
                    String fundingSourceNumber = award.getAwardNumber();
                    String fundingSourceTypeCode = FundingSourceType.AWARD;
                    String fundingSourceName = award.getSponsorName();
                    String fundingSourceTitle = award.getTitle();

                    if (!specialReviewService.isLinkedToProtocolFundingSource(protocolNumber, fundingSourceNumber, fundingSourceTypeCode)) {
                        specialReviewService.addProtocolFundingSourceForSpecialReview(
                            protocolNumber, fundingSourceNumber, fundingSourceTypeCode, fundingSourceName, fundingSourceTitle);
                    }
                }
            }
        }
    }

    /**
     * Looks up and returns the ParameterService.
     * @return the parameter service.
     */
    protected ParameterService getParameterService() {
        if (this.parameterService == null) {
            this.parameterService = KraServiceLocator.getService(ParameterService.class);
        }
        return this.parameterService;
    }

    public boolean isDirectIndirectViewEnabled() {
        boolean returnValue = false;
        String directIndirectEnabledValue = getParameterService().getParameterValueAsString(Constants.PARAMETER_MODULE_AWARD, ParameterConstants.DOCUMENT_COMPONENT, "ENABLE_AWD_ANT_OBL_DIRECT_INDIRECT_COST");
        if(directIndirectEnabledValue.equals("1")) {
            returnValue = true;
        }
        return returnValue;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public ActionForward close(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
        // The user is prompted to save when the document is closed.  If they say yes, it will save the document but won't call back to the Action.save.
        // Therefore we need to ensure the Award number is populated or else it will just save the default Award number.
        AwardForm awardForm = (AwardForm) form;
        checkAwardNumber(awardForm.getAwardDocument().getAward());
        return super.close(mapping, awardForm, request, response);
    }

    /**
     * Override to add lookup helper params to global variables
     * @param mapping
     * @param form
     * @param request
     * @param response
     * @return
     * @throws Exception
     */
    @Override
    public ActionForward performLookup(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
        String parameterName = (String) request.getAttribute(KRADConstants.METHOD_TO_CALL_ATTRIBUTE);
        if (StringUtils.isNotBlank(parameterName) && parameterName.indexOf(".performLookup") != -1 && parameterName.contains("InstitutionalProposal")) {
            GlobalVariables.getUserSession().addObject(Constants.LINKED_FUNDING_PROPOSALS_KEY, ((AwardForm) form).getLinkedProposals());
        }

        return super.performLookup(mapping, form, request, response);
    }

    /**
     *
     * This method...
     * @return
     */
    @SuppressWarnings("unchecked")
    protected KeywordsService getKeywordService(){
        return KraServiceLocator.getService(KeywordsService.class);
    }
    /**
     *
     * This method is for selecting all keywords if javascript is disabled on a browser.
     * @param mapping
     * @param form
     * @param request
     * @param response
     * @return Basic ActionForward
     * @throws Exception
     */
    public ActionForward selectAllScienceKeyword(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) throws Exception {

        AwardForm awardForm = (AwardForm) form;
        AwardDocument awardDocument = awardForm.getAwardDocument();
        List<AwardScienceKeyword> keywords = awardDocument.getAward().getKeywords();
        for (AwardScienceKeyword awardScienceKeyword : keywords) {
            awardScienceKeyword.setSelectKeyword(true);
        }
        return mapping.findForward(Constants.MAPPING_BASIC);
    }

    /**
     *
     * This method is to delete selected keywords from the keywords list.
     * It uses {@link KeywordsService} to process the request
     * @param mapping
     * @param form
     * @param request
     * @param response
     * @return
     * @throws Exception
     */
    @SuppressWarnings("unchecked")
    public ActionForward deleteSelectedScienceKeyword(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) throws Exception {
        AwardForm awardForm = (AwardForm) form;
        AwardDocument awardDocument = awardForm.getAwardDocument();
        KeywordsService keywordsService = KraServiceLocator.getService(KeywordsService.class);
        keywordsService.deleteKeyword(awardDocument.getAward());
        return mapping.findForward(Constants.MAPPING_BASIC);
    }

    /**
     * This method is used to handle the edit button action on an ACTIVE Award. If no Pending version exists for the same
     * awardNumber, a new Award version is created. If a Pending version exists, the user is prompted as to whether she would
     * like to edit the Pending version. Answering Yes results in that Pending version AwardDocument to be opened. Answering No
     * simply returns the user to the ACTIVE document screen
     *
     * @param mapping
     * @param form
     * @param request
     * @param response
     * @return
     * @throws Exception
     */
    public ActionForward editOrVersion(ActionMapping mapping, ActionForm form, HttpServletRequest request,
                                        HttpServletResponse response) throws Exception {

        AwardForm awardForm = ((AwardForm)form);
        AwardDocument awardDocument = awardForm.getAwardDocument();
        Award award = awardDocument.getAward();
        ActionForward forward;

        AwardDocument parentSyncAward = getAwardSyncService().getAwardLockingHierarchyForSync(awardDocument, GlobalVariables.getUserSession().getPrincipalId());
        if (parentSyncAward != null) {
            KNSGlobalVariables.getMessageList().add("error.award.awardhierarchy.sync.locked", parentSyncAward.getDocumentNumber());
            return mapping.findForward(Constants.MAPPING_AWARD_BASIC);
        }

        if(getTimeAndMoneyExistenceService().validateTimeAndMoneyRule(award, awardForm.getAwardHierarchyBean().getRootNode().getAwardNumber())) {
            VersionHistory foundPending = findPendingVersion(award);
            cleanUpUserSession();
            if(foundPending != null) {
                Object question = request.getParameter(KRADConstants.QUESTION_CLICKED_BUTTON);
                forward = question == null ? showPromptForEditingPendingVersion(mapping, form, request, response) :
                                             processPromptForEditingPendingVersionResponse(mapping, request, response, awardForm, foundPending);
            } else {
                forward = createAndSaveNewAwardVersion(response, awardForm, awardDocument, award);
            }
        }else{
            getTimeAndMoneyExistenceService().addAwardVersionErrorMessage();
            forward = mapping.findForward(Constants.MAPPING_AWARD_BASIC);
        }
        return forward;
    }

    private ActionForward createAndSaveNewAwardVersion(HttpServletResponse response, AwardForm awardForm,
                                                        AwardDocument awardDocument, Award award) throws Exception {
        awardForm.getAwardDocument().getAward().setNewVersion(true);
        AwardDocument newAwardDocument = getAwardService().createNewAwardVersion(awardForm.getAwardDocument());
        getDocumentService().saveDocument(newAwardDocument);
        getAwardService().updateAwardSequenceStatus(newAwardDocument.getAward(), VersionStatus.PENDING);
        getVersionHistoryService().updateVersionHistory(newAwardDocument.getAward(), VersionStatus.PENDING,
                GlobalVariables.getUserSession().getPrincipalName());
        reinitializeAwardForm(awardForm, newAwardDocument);
        return new ActionForward(makeDocumentOpenUrl(newAwardDocument), true);
    }

    /**
     *
     * This method adds a new AwardTransferringSponsor to the list.
     * It uses {@link KeywordsService} to process the request
     * @param mapping
     * @param form
     * @param request
     * @param response
     * @return
     * @throws Exception
     */
    public ActionForward addAwardTransferringSponsor(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) throws Exception {
        ((AwardForm) form).getDetailsAndDatesFormHelper().addAwardTransferringSponsor();
        return mapping.findForward(Constants.MAPPING_BASIC);
    }

    /**
     * This method removes an AwardTransferringSponsor from the list.
     * It uses {@link KeywordsService} to process the request
     * @param mapping
     * @param form
     * @param request
     * @param response
     * @return
     * @throws Exception
     */
    public ActionForward deleteAwardTransferringSponsor(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) throws Exception {
        ((AwardForm) form).getDetailsAndDatesFormHelper().deleteAwardTransferringSponsor(getLineToDelete(request));
        return mapping.findForward(Constants.MAPPING_BASIC);
    }

    /**
     * This method deletes a Funding proposal
     * @param mapping
     * @param form
     * @param request
     * @param response
     * @return
     * @throws Exception
     */
    public ActionForward deleteAwardFundingProposal(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
        ((AwardForm) form).getFundingProposalBean().deleteAwardFundingProposal(getLineToDelete(request));
        return mapping.findForward(Constants.MAPPING_BASIC);
    }

    protected BusinessObjectService getBusinessObjectService() {
        return KraServiceLocator.getService(BusinessObjectService.class);
    }

    /**
     * This method locates an award for the specified awardId
     * @param awardId
     * @return
     */
    @SuppressWarnings("unchecked")
    protected Award findSelectedAward(String awardId) {
        Map<String, Object> fieldMap = new HashMap<String, Object>();
        fieldMap.put(AWARD_ID_PARAMETER_NAME, awardId);
        List<Award> awards = (List<Award>) getBusinessObjectService().findMatching(Award.class, fieldMap);
        return (Award) awards.get(0);
    }

    private void initializeFormWithAward(AwardForm awardForm, Award award) throws WorkflowException {
        reinitializeAwardForm(awardForm, findDocumentForAward(award));
    }

    private AwardDocument findDocumentForAward(Award award) throws WorkflowException {
        AwardDocument document = (AwardDocument) getDocumentService().getByDocumentHeaderId(award.getAwardDocument().getDocumentNumber());
        document.setAward(award);
        return document;
    }

    /**
     * This method prepares the AwardForm with the document found via the Award lookup
     * Because the helper beans may have preserved a different AwardForm, we need to reset these too
     * @param awardForm
     * @param document
     */
    private void reinitializeAwardForm(AwardForm awardForm, AwardDocument document) throws WorkflowException {
        awardForm.populateHeaderFields(document.getDocumentHeader().getWorkflowDocument());
        awardForm.setDocument(document);
        document.setDocumentSaveAfterAwardLookupEditOrVersion(true);
        awardForm.initialize();
    }

    private String makeDocumentOpenUrl(AwardDocument newAwardDocument) {
        String workflowUrl = getKualiConfigurationService().getPropertyValueAsString(KRADConstants.WORKFLOW_URL_KEY);
        return String.format(DOC_HANDLER_URL_PATTERN, workflowUrl, newAwardDocument.getDocumentNumber());
    }

    private VersionHistory findPendingVersion(Award award) {
        List<VersionHistory> histories = getVersionHistoryService().loadVersionHistory(Award.class, award.getAwardNumber());
        VersionHistory foundPending = null;
        for(VersionHistory history: histories) {
            if (history.getStatus() == VersionStatus.PENDING && award.getSequenceNumber() < history.getSequenceOwnerSequenceNumber()) {
                foundPending = history;
                break;
            }
        }
        return foundPending;
    }

    private ActionForward showPromptForEditingPendingVersion(ActionMapping mapping, ActionForm form, HttpServletRequest request,
                                                                HttpServletResponse response) throws Exception {
        return this.performQuestionWithoutInput(mapping, form, request, response, "EDIT_OR_VERSION_QUESTION_ID",
                                                getResources(request).getMessage(AWARD_VERSION_EDITPENDING_PROMPT_KEY),
                                                KRADConstants.CONFIRMATION_QUESTION,
                                                KRADConstants.MAPPING_CANCEL, "");
    }

    private ActionForward processPromptForEditingPendingVersionResponse(ActionMapping mapping, HttpServletRequest request,
            HttpServletResponse response, AwardForm awardForm,
            VersionHistory foundPending) throws WorkflowException,
                                                IOException {
        ActionForward forward;
        Object buttonClicked = request.getParameter(KRADConstants.QUESTION_CLICKED_BUTTON);
        if (ConfirmationQuestion.NO.equals(buttonClicked)) {
            forward = mapping.findForward(Constants.MAPPING_BASIC);
        } else {
            initializeFormWithAward(awardForm, (Award) foundPending.getSequenceOwner());
            response.sendRedirect(makeDocumentOpenUrl(awardForm.getAwardDocument()));
            forward = null;
        }
        return forward;
    }

    public ActionForward applySponsorTemplate(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) throws Exception {
        AwardForm awardForm = (AwardForm) form;
        ActionForward result = fullSyncToAwardTemplate(mapping, form, request, response);

        awardForm.buildReportTrackingBeans();

        return result;
    }

    private ActionForward redirectAwardHistoryFullViewForPopup(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response, String awardDocumentNumber, String awardNumber) throws Exception {
        //super.populateAwardHierarchy(form);
        AwardForm awardForm = (AwardForm)form;
        response.sendRedirect("awardHistory.do?methodToCall=openWindow&awardDocumentNumber=" + awardDocumentNumber + "&awardNumber=" + awardNumber + "&docTypeName=" + awardForm.getDocTypeName());

        return null;
    }

}


text:
package events

import (
	"fmt"
	"time"
)

type doneTranitioningFunc func() (bool, error)

func waitForTransition(waitFunc doneTranitioningFunc) error {
	timeoutAt := time.Now().Add(MaxWait)
	ticker := time.NewTicker(time.Millisecond * 250)
	defer ticker.Stop()
	for tick := range ticker.C {
		done, err := waitFunc()
		if err != nil {
			return err
		}
		if done {
			return nil
		}
		if tick.After(timeoutAt) {
			return fmt.Errorf("Timed out waiting for transtion")
		}
	}
	return fmt.Errorf("Timed out waiting for transtion")
}


text:
package tsdb

import (
	"bytes"
	"container/heap"
)

// Direction represents a cursor navigation direction.
type Direction bool

const (
	// Forward indicates that a cursor will move forward over its values.
	Forward Direction = true
	// Reverse indicates that a cursor will move backwards over its values.
	Reverse Direction = false
)

func (d Direction) String() string {
	if d.Forward() {
		return "forward"
	}
	return "reverse"
}

// Forward returns true if direction is forward
func (d Direction) Forward() bool {
	return d == Forward
}

// Forward returns true if direction is reverse
func (d Direction) Reverse() bool {
	return d == Reverse
}

// MultiCursor returns a single cursor that combines the results of all cursors in order.
//
// If the same key is returned from multiple cursors then the first cursor
// specified will take precendence. A key will only be returned once from the
// returned cursor.
func MultiCursor(d Direction, cursors ...Cursor) Cursor {
	return &multiCursor{cursors: cursors, direction: d}
}

// multiCursor represents a cursor that combines multiple cursors into one.
type multiCursor struct {
	cursors   []Cursor
	heap      cursorHeap
	prev      []byte
	direction Direction
}

// Seek moves the cursor to a given key.
func (mc *multiCursor) Seek(seek []byte) (key, value []byte) {
	// Initialize heap.
	h := make(cursorHeap, 0, len(mc.cursors))
	for i, c := range mc.cursors {
		// Move cursor to position. Skip if it's empty.
		k, v := c.Seek(seek)
		if k == nil {
			continue
		}

		// Append cursor to heap.
		h = append(h, &cursorHeapItem{
			key:      k,
			value:    v,
			cursor:   c,
			priority: len(mc.cursors) - i,
		})
	}

	heap.Init(&h)
	mc.heap = h
	mc.prev = nil

	return mc.pop()
}

func (mc *multiCursor) Direction() Direction { return mc.direction }

// Next returns the next key/value from the cursor.
func (mc *multiCursor) Next() (key, value []byte) { return mc.pop() }

// pop returns the next item from the heap.
// Reads the next key/value from item's cursor and puts it back on the heap.
func (mc *multiCursor) pop() (key, value []byte) {
	// Read items until we have a key that doesn't match the previously read one.
	// This is to perform deduplication when there's multiple items with the same key.
	// The highest priority cursor will be read first and then remaining keys will be dropped.
	for {
		// Return nil if there are no more items left.
		if len(mc.heap) == 0 {
			return nil, nil
		}

		// Read the next item from the heap.
		item := heap.Pop(&mc.heap).(*cursorHeapItem)

		// Save the key/value for return.
		key, value = item.key, item.value

		// Read the next item from the cursor. Push back to heap if one exists.
		if item.key, item.value = item.cursor.Next(); item.key != nil {
			heap.Push(&mc.heap, item)
		}

		// Skip if this key matches the previously returned one.
		if bytes.Equal(mc.prev, key) {
			continue
		}

		mc.prev = key
		return
	}
}

// cursorHeap represents a heap of cursorHeapItems.
type cursorHeap []*cursorHeapItem

func (h cursorHeap) Len() int      { return len(h) }
func (h cursorHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }
func (h cursorHeap) Less(i, j int) bool {
	dir := -1
	if !h[i].cursor.Direction() {
		dir = 1
	}

	if cmp := bytes.Compare(h[i].key, h[j].key); cmp == dir {
		return true
	} else if cmp == 0 {
		return h[i].priority > h[j].priority
	}
	return false
}

func (h *cursorHeap) Push(x interface{}) {
	*h = append(*h, x.(*cursorHeapItem))
}

func (h *cursorHeap) Pop() interface{} {
	old := *h
	n := len(old)
	item := old[n-1]
	*h = old[0 : n-1]
	return item
}

// cursorHeapItem is something we manage in a priority queue.
type cursorHeapItem struct {
	key      []byte
	value    []byte
	cursor   Cursor
	priority int
}


text:
using Newtonsoft.Json;
using Stormancer.Management.Cmd.Models;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;

namespace Stormancer.Management.Cmd.Commands.Accounts
{
    class AddAccount : Command
    {
        public string Id { get; set; }

        public override string Name
        {
            get { return "register account"; }
        }

        public override void Validate()
        {

        }

        public override void ParseParameters(Mono.Options.OptionSet p)
        {
            p.Add("id=", v =>
                {
                    Id = v;
                });

        }

        public override Task Run()
        {
            ////This implementation is synchronous. We use return Task.FromResult(true) to fulfil the overriden method signature.

            //Contract.Requires<ArgumentNullException>(Id != null, "-id parameter required.");
            ////Contract.Requires<ArgumentNullException>(KeyName != null,"-name parameter required.");

            //var secret = GetSecret(Id);

            //if (secret == null)
            //{
            //    Console.WriteLine("Couldn't get a management key.");

            //    return Task.FromResult(true);
            //}
            //var accounts = Host.GetData<AccountInfos>(AccountInfos.AccountsStoreKey) ?? new AccountInfos();

            //var account = accounts.Accounts.FirstOrDefault(a => a.AccountId == Id);
            //if (account == null)
            //{
            //    account = new AccountInfo { AccountId = Id };
            //    accounts.Accounts.Add(account);

            //}
            //account.Secret = secret.Secret;
            //account.KeyName = secret.FriendlyName;

            //accounts.SelectedAccount = account;

            //Host.SaveData(AccountInfos.AccountsStoreKey, accounts);
            //Console.WriteLine("Account registered and selected.");

            return Task.FromResult(true);
        }

        public class SecretDto
        {
            public string FriendlyName { get; set; }
            public string Secret { get; set; }
        };

        //private SecretDto GetSecret(string accountId)
        //{
        //    var url = Config.PortalEndpoint + "/key/" + accountId;

        //    var app = new Application();
        //    var window = new Window();
        //    var browser = new WebBrowser();
        //    SecretDto secret = null;

        //    browser.Navigating += (sender, args) =>
        //    {
        //        var query = System.Web.HttpUtility.ParseQueryString(args.Uri.Query);
        //        var data = query["secret"];
        //        if (data != null)
        //        {
        //            secret = JsonConvert.DeserializeObject<SecretDto>(System.Text.Encoding.UTF8.GetString(System.Convert.FromBase64String(data)));

        //            app.Shutdown();
        //        }
        //    };

        //    window.Content = browser;
        //    app.Startup += (sender, args) =>
        //    {
        //        browser.Navigate(new Uri(url));
        //    };
        //    app.Run(window);

        //    if (secret != null)
        //    {
        //        return secret;
        //    }
        //    else
        //    {
        //        return null;
        //    }
        //}
    }
}


text:
class LostPasswordForm < FormInput

  # Note that we intentionally don't impose any format of the email,
  # as we don't want to assume what they have registered with.
  # We will let them know in case we don't find it anyway.
  # We merely check if it looks like an email at all.

  param! :email, "Email", match: /@/

end

# EOF #


text:
package com.google.security.zynamics.binnavi.ZyGraph.Builders;

import java.util.HashMap;
import java.util.Map;

import com.google.common.base.Preconditions;
import com.google.security.zynamics.binnavi.CUtilityFunctions;
import com.google.security.zynamics.binnavi.Exceptions.MaybeNullException;
import com.google.security.zynamics.binnavi.disassembly.views.INaviView;
import com.google.security.zynamics.binnavi.yfileswrap.zygraph.Builders.ZyGraphBuilder;
import com.google.security.zynamics.zylib.general.ListenerProvider;

/**
 * Class that keeps track of what ZyGraph builder objects are currently building graphs.
 */
public final class ZyGraphBuilderManager {
  /**
   * The only valid instance of this class.
   */
  private static final ZyGraphBuilderManager m_instance = new ZyGraphBuilderManager();

  /**
   * Currently active builders.
   */
  private final Map<INaviView, ZyGraphBuilder> m_builders =
      new HashMap<INaviView, ZyGraphBuilder>();

  /**
   * Listeners that are notified about changes in the managed builders.
   */
  private final ListenerProvider<IGraphBuilderManagerListener> m_listeners =
      new ListenerProvider<IGraphBuilderManagerListener>();

  /**
   * Private constructor => Singleton.
   */
  private ZyGraphBuilderManager() {
  }

  /**
   * Returns the only valid instance of this class.
   *
   * @return The only valid instance of this class.
   */
  public static ZyGraphBuilderManager instance() {
    return m_instance;
  }

  /**
   * Adds a listener object that is notified about changes in the managed builders.
   *
   * @param listener The listener object to add.
   */
  public void addListener(final IGraphBuilderManagerListener listener) {
    m_listeners.addListener(listener);
  }

  /**
   * Returns the builder associated with the given view.
   *
   * @param view The view whose builder is returned.
   *
   * @return The builder for the view.
   *
   * @throws MaybeNullException Thrown if the view is not currently built.
   */
  public ZyGraphBuilder getBuilder(final INaviView view) throws MaybeNullException {
    final ZyGraphBuilder builder = m_builders.get(view);

    if (builder == null) {
      throw new MaybeNullException();
    }

    return builder;
  }

  /**
   * Removes a builder from the manager.
   *
   * @param view The view whose builder is removed.
   */
  public void removeBuilder(final INaviView view) {
    final ZyGraphBuilder builder = m_builders.get(view);

    Preconditions.checkNotNull(builder, "IE00704: View was not managed");

    m_builders.remove(view);

    for (final IGraphBuilderManagerListener listener : m_listeners) {
      try {
        listener.removedBuilder(view, builder);
      } catch (final Exception exception) {
        CUtilityFunctions.logException(exception);
      }
    }
  }

  /**
   * Removes a previously listening listener.
   *
   * @param listener The listener to remove.
   */
  public void removeListener(final IGraphBuilderManagerListener listener) {
    m_listeners.removeListener(listener);
  }

  /**
   * Sets the builder for a view.
   *
   * @param view The view to be built.
   * @param builder The builder of the view.
   */
  public void setBuilder(final INaviView view, final ZyGraphBuilder builder) {
    m_builders.put(view, builder);

    for (final IGraphBuilderManagerListener listener : m_listeners) {
      try {
        listener.addedBuilder(view, builder);
      } catch (final Exception exception) {
        CUtilityFunctions.logException(exception);
      }
    }
  }
}


text:
package org.apache.camel.impl;

import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.function.Function;

import org.apache.camel.AsyncProcessor;
import org.apache.camel.CatalogCamelContext;
import org.apache.camel.Processor;
import org.apache.camel.health.HealthCheckRegistry;
import org.apache.camel.impl.engine.AbstractCamelContext;
import org.apache.camel.impl.engine.BaseRouteService;
import org.apache.camel.impl.engine.DefaultTransformerRegistry;
import org.apache.camel.impl.engine.DefaultValidatorRegistry;
import org.apache.camel.impl.transformer.TransformerKey;
import org.apache.camel.impl.validator.ValidatorKey;
import org.apache.camel.model.DataFormatDefinition;
import org.apache.camel.model.HystrixConfigurationDefinition;
import org.apache.camel.model.Model;
import org.apache.camel.model.ModelCamelContext;
import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.model.Resilience4jConfigurationDefinition;
import org.apache.camel.model.RouteDefinition;
import org.apache.camel.model.cloud.ServiceCallConfigurationDefinition;
import org.apache.camel.model.rest.RestDefinition;
import org.apache.camel.model.transformer.TransformerDefinition;
import org.apache.camel.model.validator.ValidatorDefinition;
import org.apache.camel.processor.MulticastProcessor;
import org.apache.camel.reifier.dataformat.DataFormatReifier;
import org.apache.camel.reifier.transformer.TransformerReifier;
import org.apache.camel.reifier.validator.ValidatorReifier;
import org.apache.camel.runtimecatalog.RuntimeCamelCatalog;
import org.apache.camel.spi.DataFormat;
import org.apache.camel.spi.DataType;
import org.apache.camel.spi.Registry;
import org.apache.camel.spi.Transformer;
import org.apache.camel.spi.TransformerRegistry;
import org.apache.camel.spi.Validator;
import org.apache.camel.spi.ValidatorRegistry;
import org.apache.camel.support.CamelContextHelper;
import org.apache.camel.util.ObjectHelper;

/**
 * Represents the context used to configure routes and the policies to use.
 */
public abstract class AbstractModelCamelContext extends AbstractCamelContext implements ModelCamelContext, CatalogCamelContext {

    private final Model model = new DefaultModel(this);

    /**
     * Creates the {@link ModelCamelContext} using
     * {@link org.apache.camel.support.DefaultRegistry} as registry.
     * <p/>
     * Use one of the other constructors to force use an explicit registry.
     */
    public AbstractModelCamelContext() {
        this(true);
    }

    /**
     * Creates the {@link ModelCamelContext} using the given registry
     *
     * @param registry the registry
     */
    public AbstractModelCamelContext(Registry registry) {
        this();
        setRegistry(registry);
    }

    public AbstractModelCamelContext(boolean init) {
        super(false);

        setDefaultExtension(HealthCheckRegistry.class, this::createHealthCheckRegistry);
        setDefaultExtension(RuntimeCamelCatalog.class, this::createRuntimeCamelCatalog);

        if (init) {
            init();
        }
    }

    @Override
    public List<RouteDefinition> getRouteDefinitions() {
        return model.getRouteDefinitions();
    }

    @Override
    public RouteDefinition getRouteDefinition(String id) {
        return model.getRouteDefinition(id);
    }

    @Override
    public void addRouteDefinitions(Collection<RouteDefinition> routeDefinitions) throws Exception {
        model.addRouteDefinitions(routeDefinitions);
    }

    @Override
    public void addRouteDefinition(RouteDefinition routeDefinition) throws Exception {
        model.addRouteDefinition(routeDefinition);
    }

    @Override
    public void removeRouteDefinitions(Collection<RouteDefinition> routeDefinitions) throws Exception {
        model.removeRouteDefinitions(routeDefinitions);
    }

    @Override
    public void removeRouteDefinition(RouteDefinition routeDefinition) throws Exception {
        model.removeRouteDefinition(routeDefinition);
    }

    @Override
    public List<RestDefinition> getRestDefinitions() {
        return model.getRestDefinitions();
    }

    @Override
    public void addRestDefinitions(Collection<RestDefinition> restDefinitions, boolean addToRoutes) throws Exception {
        model.addRestDefinitions(restDefinitions, addToRoutes);
    }

    @Override
    public void setDataFormats(Map<String, DataFormatDefinition> dataFormats) {
        model.setDataFormats(dataFormats);
    }

    @Override
    public Map<String, DataFormatDefinition> getDataFormats() {
        return model.getDataFormats();
    }

    @Override
    public DataFormatDefinition resolveDataFormatDefinition(String name) {
        return model.resolveDataFormatDefinition(name);
    }

    @Override
    public ProcessorDefinition getProcessorDefinition(String id) {
        return model.getProcessorDefinition(id);
    }

    @Override
    public <T extends ProcessorDefinition> T getProcessorDefinition(String id, Class<T> type) {
        return model.getProcessorDefinition(id, type);
    }

    @Override
    public void setValidators(List<ValidatorDefinition> validators) {
        model.setValidators(validators);
    }

    @Override
    public HystrixConfigurationDefinition getHystrixConfiguration(String id) {
        return model.getHystrixConfiguration(id);
    }

    @Override
    public void setHystrixConfiguration(HystrixConfigurationDefinition configuration) {
        model.setHystrixConfiguration(configuration);
    }

    @Override
    public void setHystrixConfigurations(List<HystrixConfigurationDefinition> configurations) {
        model.setHystrixConfigurations(configurations);
    }

    @Override
    public void addHystrixConfiguration(String id, HystrixConfigurationDefinition configuration) {
        model.addHystrixConfiguration(id, configuration);
    }

    @Override
    public Resilience4jConfigurationDefinition getResilience4jConfiguration(String id) {
        return model.getResilience4jConfiguration(id);
    }

    @Override
    public void setResilience4jConfiguration(Resilience4jConfigurationDefinition configuration) {
        model.setResilience4jConfiguration(configuration);
    }

    @Override
    public void setResilience4jConfigurations(List<Resilience4jConfigurationDefinition> configurations) {
        model.setResilience4jConfigurations(configurations);
    }

    @Override
    public void addResilience4jConfiguration(String id, Resilience4jConfigurationDefinition configuration) {
        model.addResilience4jConfiguration(id, configuration);
    }

    @Override
    public List<ValidatorDefinition> getValidators() {
        return model.getValidators();
    }

    @Override
    public void setTransformers(List<TransformerDefinition> transformers) {
        model.setTransformers(transformers);
    }

    @Override
    public List<TransformerDefinition> getTransformers() {
        return model.getTransformers();
    }

    @Override
    public ServiceCallConfigurationDefinition getServiceCallConfiguration(String serviceName) {
        return model.getServiceCallConfiguration(serviceName);
    }

    @Override
    public void setServiceCallConfiguration(ServiceCallConfigurationDefinition configuration) {
        model.setServiceCallConfiguration(configuration);
    }

    @Override
    public void setServiceCallConfigurations(List<ServiceCallConfigurationDefinition> configurations) {
        model.setServiceCallConfigurations(configurations);
    }

    @Override
    public void addServiceCallConfiguration(String serviceName, ServiceCallConfigurationDefinition configuration) {
        model.addServiceCallConfiguration(serviceName, configuration);
    }

    @Override
    public void setRouteFilterPattern(String include, String exclude) {
        model.setRouteFilterPattern(include, exclude);
    }

    @Override
    public void setRouteFilter(Function<RouteDefinition, Boolean> filter) {
        model.setRouteFilter(filter);
    }

    @Override
    public Function<RouteDefinition, Boolean> getRouteFilter() {
        return model.getRouteFilter();
    }

    @Override
    protected ValidatorRegistry<ValidatorKey> createValidatorRegistry() throws Exception {
        DefaultValidatorRegistry registry = new DefaultValidatorRegistry(this);
        for (ValidatorDefinition def : getValidators()) {
            Validator validator = ValidatorReifier.reifier(def).createValidator(this);
            registry.put(createKey(def), doAddService(validator));
        }
        return registry;
    }

    private ValidatorKey createKey(ValidatorDefinition def) {
        return new ValidatorKey(new DataType(def.getType()));
    }

    @Override
    protected TransformerRegistry<TransformerKey> createTransformerRegistry() throws Exception {
        DefaultTransformerRegistry registry = new DefaultTransformerRegistry(this);
        for (TransformerDefinition def : getTransformers()) {
            Transformer transformer = TransformerReifier.reifier(def).createTransformer(this);
            registry.put(createKey(def), doAddService(transformer));
        }
        return registry;
    }

    private TransformerKey createKey(TransformerDefinition def) {
        return ObjectHelper.isNotEmpty(def.getScheme()) ? new TransformerKey(def.getScheme()) : new TransformerKey(new DataType(def.getFromType()), new DataType(def.getToType()));
    }

    protected abstract HealthCheckRegistry createHealthCheckRegistry();

    protected abstract RuntimeCamelCatalog createRuntimeCamelCatalog();

    @Override
    protected void doStartStandardServices() {
        super.doStartStandardServices();
        getExtension(RuntimeCamelCatalog.class);
    }

    @Override
    protected void doStartEagerServices() {
        getExtension(HealthCheckRegistry.class);
        super.doStartEagerServices();
    }

    @Override
    protected void bindDataFormats() throws Exception {
        // eager lookup data formats and bind to registry so the dataformats can
        // be looked up and used
        for (Map.Entry<String, DataFormatDefinition> e : model.getDataFormats().entrySet()) {
            String id = e.getKey();
            DataFormatDefinition def = e.getValue();
            log.debug("Creating Dataformat with id: {} and definition: {}", id, def);
            DataFormat df = DataFormatReifier.reifier(def).createDataFormat(this);
            addService(df, true);
            getRegistry().bind(id, df);
        }
    }

    @Override
    protected synchronized void shutdownRouteService(BaseRouteService routeService) throws Exception {
        if (routeService instanceof RouteService) {
            model.getRouteDefinitions().remove(((RouteService)routeService).getRouteDefinition());
        }
        super.shutdownRouteService(routeService);
    }

    @Override
    protected boolean isStreamCachingInUse() throws Exception {
        boolean streamCachingInUse = super.isStreamCachingInUse();
        if (!streamCachingInUse) {
            for (RouteDefinition route : model.getRouteDefinitions()) {
                Boolean routeCache = CamelContextHelper.parseBoolean(this, route.getStreamCache());
                if (routeCache != null && routeCache) {
                    streamCachingInUse = true;
                    break;
                }
            }
        }
        return streamCachingInUse;
    }

    @Override
    public void startRouteDefinitions() throws Exception {
        model.startRouteDefinitions();
    }

    @Override
    public AsyncProcessor createMulticast(Collection<Processor> processors, ExecutorService executor, boolean shutdownExecutorService) {
        return new MulticastProcessor(this, processors, null, true, executor, shutdownExecutorService, false, false, 0, null, false, false);
    }

}


text:
module Azure::Synapse::Mgmt::V2019_06_01_preview
  module Models
    #
    # Integration runtime resource type.
    #
    class IntegrationRuntimeResource < SubResource

      include MsRestAzure

      # @return [IntegrationRuntime] Integration runtime properties.
      attr_accessor :properties

      #
      # Mapper for IntegrationRuntimeResource class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'IntegrationRuntimeResource',
          type: {
            name: 'Composite',
            class_name: 'IntegrationRuntimeResource',
            model_properties: {
              id: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'id',
                type: {
                  name: 'String'
                }
              },
              name: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'name',
                type: {
                  name: 'String'
                }
              },
              type: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'type',
                type: {
                  name: 'String'
                }
              },
              etag: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'etag',
                type: {
                  name: 'String'
                }
              },
              properties: {
                client_side_validation: true,
                required: true,
                serialized_name: 'properties',
                type: {
                  name: 'Composite',
                  polymorphic_discriminator: 'type',
                  uber_parent: 'IntegrationRuntime',
                  class_name: 'IntegrationRuntime'
                }
              }
            }
          }
        }
      end
    end
  end
end


text:
Phonegap App SRC
================

The actual phonegap src will be found in its own branch called MobileApp

A copy of src will go here but will not be what is built as the final
mobil app


text:
<resources>
    <string name="app_name">Calendário</string>

    <string name="hello_world">Hello world!</string>
    <string name="action_settings">Integrantes do grupo</string>
    <string name="title_activity_sobre_nos">Sobre Nós</string>
    <string name="title_activity_eventos">Eventos do dia 6</string>
    <string name="title_activity_itabiranos_em_cena">Itabiranos Em Cena</string>
    <string name="title_activity_dia8">Eventos do dia 8</string>
    <string name="title_activity_banana">As aventuras de Potássio e Magrela</string>
    <string name="title_activity_genin">Genin, o Cometa e o Anjo Torto</string>
    <string name="title_activity_dia9">Eventos do dia 9</string>
    <string name="title_activity_banana2">Potássio</string>
</resources>


text:
.class public Landroid/test/InstrumentationTestSuite;
.super Ljunit/framework/TestSuite;
.source "InstrumentationTestSuite.java"

# instance fields
.field private final mInstrumentation:Landroid/app/Instrumentation;

# direct methods
.method public constructor <init>(Landroid/app/Instrumentation;)V
    .locals 0
    .parameter "instr"

    .prologue
    .line 37
    invoke-direct {p0}, Ljunit/framework/TestSuite;-><init>()V

    .line 38
    iput-object p1, p0, Landroid/test/InstrumentationTestSuite;->mInstrumentation:Landroid/app/Instrumentation;

    .line 39
    return-void
.end method

.method public constructor <init>(Ljava/lang/Class;Landroid/app/Instrumentation;)V
    .locals 0
    .parameter "theClass"
    .parameter "instr"

    .prologue
    .line 53
    invoke-direct {p0, p1}, Ljunit/framework/TestSuite;-><init>(Ljava/lang/Class;)V

    .line 54
    iput-object p2, p0, Landroid/test/InstrumentationTestSuite;->mInstrumentation:Landroid/app/Instrumentation;

    .line 55
    return-void
.end method

.method public constructor <init>(Ljava/lang/String;Landroid/app/Instrumentation;)V
    .locals 0
    .parameter "name"
    .parameter "instr"

    .prologue
    .line 43
    invoke-direct {p0, p1}, Ljunit/framework/TestSuite;-><init>(Ljava/lang/String;)V

    .line 44
    iput-object p2, p0, Landroid/test/InstrumentationTestSuite;->mInstrumentation:Landroid/app/Instrumentation;

    .line 45
    return-void
.end method

# virtual methods
.method public addTestSuite(Ljava/lang/Class;)V
    .locals 2
    .parameter "testClass"

    .prologue
    .line 60
    new-instance v0, Landroid/test/InstrumentationTestSuite;

    iget-object v1, p0, Landroid/test/InstrumentationTestSuite;->mInstrumentation:Landroid/app/Instrumentation;

    invoke-direct {v0, p1, v1}, Landroid/test/InstrumentationTestSuite;-><init>(Ljava/lang/Class;Landroid/app/Instrumentation;)V

    invoke-virtual {p0, v0}, Landroid/test/InstrumentationTestSuite;->addTest(Ljunit/framework/Test;)V

    .line 61
    return-void
.end method

.method public runTest(Ljunit/framework/Test;Ljunit/framework/TestResult;)V
    .locals 2
    .parameter "test"
    .parameter "result"

    .prologue
    .line 67
    instance-of v0, p1, Landroid/test/InstrumentationTestCase;

    if-eqz v0, :cond_0

    move-object v0, p1

    .line 68
    check-cast v0, Landroid/test/InstrumentationTestCase;

    iget-object v1, p0, Landroid/test/InstrumentationTestSuite;->mInstrumentation:Landroid/app/Instrumentation;

    invoke-virtual {v0, v1}, Landroid/test/InstrumentationTestCase;->injectInstrumentation(Landroid/app/Instrumentation;)V

    .line 72
    :cond_0
    invoke-super {p0, p1, p2}, Ljunit/framework/TestSuite;->runTest(Ljunit/framework/Test;Ljunit/framework/TestResult;)V

    .line 73
    return-void
.end method


text:
package org.codehaus.xfire.castor;

import net.webservicex.GetWeatherByPlaceName;
import net.webservicex.GetWeatherByPlaceNameResponse;
import net.webservicex.GetWeatherByZipCode;
import net.webservicex.GetWeatherByZipCodeResponse;
import net.webservicex.GetWeatherByZipCodeResult;

public class WeatherServiceImpl
{

    public GetWeatherByPlaceNameResponse DontCallThisMethod(GetWeatherByPlaceName body)
    {
        throw new RuntimeException("Dont call me!");
    }

    public GetWeatherByZipCodeResponse GetWeatherByZipCode(GetWeatherByZipCode body)
    {
        GetWeatherByZipCodeResponse res = new GetWeatherByZipCodeResponse();
        String zipCode = body.getZipCode();
        if (!zipCode.equals("1050"))
            throw new RuntimeException("Parameter isnt passed correctly. expected: 1050, got "
                    + zipCode);
        GetWeatherByZipCodeResult weather = new GetWeatherByZipCodeResult();

        weather.setLatitude(1);
        weather.setLongitude(1);
        weather.setPlaceName("Vienna, AT");
        weather.setAllocationFactor(1);

        res.setGetWeatherByZipCodeResult(weather);

        return res;
    }

}


text:
It's 3 AM. Do you know where your cron jobs are?

![](https://github.com/federatedmedia/cronviz/raw/master/assets/screenshot.png)

## Use case

You have a problem: something's causing performance issues on the application server between 1 and 4 AM, and the cron jobs seem a likely culprit.

Naturally, you eyeball your crontab to find out what's running during those hours.

Now you have two problems.

Over time, cron jobs accrete into an impenetrable, opaque mass of text. Trying to get a comprehensive sense of all the various run times, and finding patterns therein, can be exceedingly difficult. Crontabs are written for computers to interpret -- not humans.

Cronviz can help, by producing this...

![](https://github.com/federatedmedia/cronviz/raw/master/assets/screenshot.png)

out of this...

````
* * * * * /usr/bin/foo
*/10 * * * * /usr/bin/bar
*/15 * * * * /usr/bin/baz
*/30 * * * * /usr/bin/qux
8 */8 * * * /usr/bin/quux
* * * * * /usr/bin/corge
*/30 23,0,1 * * * /usr/bin/grault
*/5 * * * * /usr/bin/garply
0 * * * * /usr/bin/waldo
0 0 4,22 * * /usr/bin/fred
0 1 * * * /usr/bin/plugh
0 13 * * * /usr/bin/xyzzy
0 2 * * * /usr/bin/thud
30 6 * * 1,2,3,4,5 /usr/bin/wibble
30 7 * * * /usr/bin/wobble
30 8 * * * /usr/bin/wubble
33 */2 * * * /usr/bin/flob
35 1 * * * /usr/bin/whatever
45 * * * * /usr/bin/whoever
45 1 * * * /usr/bin/whomever
* * * * * /usr/bin/whenever
````

## RUNNING

Requires haml and json gems.

````
gem install haml json
````

Requires a crontab file named "crontab" in the current directory. You can also use a filepath, as outlined below.

Look to run.rb for an example that renders a HAML template to ./output.html, by passing cronviz' JSON output to the SIMILE timeline widget to produce a graph as seen in the screenshot above.

You'll need to pass the filepath to a crontab file, or accept the default of "crontab" in the current directory.

You'll also need to pass two dates to act as book-ends for the period of time we're interested in graphing. cronviz will graph all matching datetimes from the crontab contents...

````
earliest_time = "2011-12-08 00:00" # Zeroth minute on Dec 8.
latest_time   = "2011-12-08 23:59" # Final minute on Dec 8.
````

Using strings lets us compare dates faster than casting to DateTime or int objects.

## ROLLUPS

Events that occur every minute and every five minutes will swamp the display, so these are rolled up into single events which get displayed as a continuous line, one per rolled-up job.

With a bit of cron-style math, you can define custom rollups targeting whatever interval you like.

Let's say you've got an event that occurs every 21 minutes and you'd like to roll it up. Cron defines "*/21" as occurrences on the following minutes of each hour: :0, :21, :42. This results in three executions per hour, for as many hours are between your earliest_time and latest_time. So 72 occurrences.

Crontab math caveat: if your earliest_time starts at, say, :01 instead of :00, that hour's first execution on :00 won't happen. Thus, given the following...

````
earliest_time = "2011-12-08 00:01"
latest_time   = "2011-12-09 00:00"
````

then a job defined as ````"*/21 * * * *"```` will occur 71 times. You'd define a new hash in ````EVENT_DATA```` with your desired rollup interval as an integer, as follows...

````
71 => {
    "color"         => "#f00",
    "class"         => "noisy_event",
    "title_prefix"  => "Every 21 minutes: ",
    "durationEvent" => true},
````

durationEvent must equal true. title_prefix can be defined as any string. Color and class are optional.

## Shortcomings

- Unfortunately there's no simple way to know what time a job *finishes* short of 1) altering the crontab command or the job it fires, and 2) getting that information into cronviz. Minus that, cronviz can only tell you what time a job has *started*.

- Date generation should be faster.

## Next steps

- Timezone is currently hardcoded and, all things remaining static, is effectively transparent as long as the server's timezone is yours. It would be nice to allow an offset parameter so that someone in Pacific could view an Eastern server's crontab translated to their local time.

- Exceedingly lengthy cron commands such as ````"/usr/bin/bash /full/path/to/script.sh >> /some/output/path.log 2>> /some/error/path.log"```` can uglify the resulting graph display. It might be possible to find a simple way to allow specifying which bits of the cron command are used as the resulting title... possibly via comments in the crontab file?


text:
package com.microsoft.azure.management.avs.v2020_03_20.implementation;

import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl;
import com.microsoft.azure.management.avs.v2020_03_20.PrivateCloud;
import rx.Observable;
import com.microsoft.azure.management.avs.v2020_03_20.PrivateCloudUpdate;
import java.util.List;
import com.microsoft.azure.management.avs.v2020_03_20.Sku;
import com.microsoft.azure.management.avs.v2020_03_20.ManagementCluster;
import com.microsoft.azure.management.avs.v2020_03_20.InternetEnum;
import com.microsoft.azure.management.avs.v2020_03_20.IdentitySource;
import com.microsoft.azure.management.avs.v2020_03_20.PrivateCloudProvisioningState;
import com.microsoft.azure.management.avs.v2020_03_20.Circuit;
import com.microsoft.azure.management.avs.v2020_03_20.Endpoints;
import rx.functions.Func1;

class PrivateCloudImpl extends GroupableResourceCoreImpl<PrivateCloud, PrivateCloudInner, PrivateCloudImpl, AVSManager> implements PrivateCloud, PrivateCloud.Definition, PrivateCloud.Update {
    private PrivateCloudUpdate updateParameter;
    PrivateCloudImpl(String name, PrivateCloudInner inner, AVSManager manager) {
        super(name, inner, manager);
        this.updateParameter = new PrivateCloudUpdate();
    }

    @Override
    public Observable<PrivateCloud> createResourceAsync() {
        PrivateCloudsInner client = this.manager().inner().privateClouds();
        return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner())
            .map(new Func1<PrivateCloudInner, PrivateCloudInner>() {
               @Override
               public PrivateCloudInner call(PrivateCloudInner resource) {
                   resetCreateUpdateParameters();
                   return resource;
               }
            })
            .map(innerToFluentMap(this));
    }

    @Override
    public Observable<PrivateCloud> updateResourceAsync() {
        PrivateCloudsInner client = this.manager().inner().privateClouds();
        return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter)
            .map(new Func1<PrivateCloudInner, PrivateCloudInner>() {
               @Override
               public PrivateCloudInner call(PrivateCloudInner resource) {
                   resetCreateUpdateParameters();
                   return resource;
               }
            })
            .map(innerToFluentMap(this));
    }

    @Override
    protected Observable<PrivateCloudInner> getInnerAsync() {
        PrivateCloudsInner client = this.manager().inner().privateClouds();
        return client.getByResourceGroupAsync(this.resourceGroupName(), this.name());
    }

    @Override
    public boolean isInCreateMode() {
        return this.inner().id() == null;
    }

    private void resetCreateUpdateParameters() {
        this.updateParameter = new PrivateCloudUpdate();
    }

    @Override
    public Circuit circuit() {
        return this.inner().circuit();
    }

    @Override
    public Endpoints endpoints() {
        return this.inner().endpoints();
    }

    @Override
    public List<IdentitySource> identitySources() {
        return this.inner().identitySources();
    }

    @Override
    public InternetEnum internet() {
        return this.inner().internet();
    }

    @Override
    public ManagementCluster managementCluster() {
        return this.inner().managementCluster();
    }

    @Override
    public String managementNetwork() {
        return this.inner().managementNetwork();
    }

    @Override
    public String networkBlock() {
        return this.inner().networkBlock();
    }

    @Override
    public String nsxtCertificateThumbprint() {
        return this.inner().nsxtCertificateThumbprint();
    }

    @Override
    public String nsxtPassword() {
        return this.inner().nsxtPassword();
    }

    @Override
    public String provisioningNetwork() {
        return this.inner().provisioningNetwork();
    }

    @Override
    public PrivateCloudProvisioningState provisioningState() {
        return this.inner().provisioningState();
    }

    @Override
    public Sku sku() {
        return this.inner().sku();
    }

    @Override
    public String vcenterCertificateThumbprint() {
        return this.inner().vcenterCertificateThumbprint();
    }

    @Override
    public String vcenterPassword() {
        return this.inner().vcenterPassword();
    }

    @Override
    public String vmotionNetwork() {
        return this.inner().vmotionNetwork();
    }

    @Override
    public PrivateCloudImpl withNetworkBlock(String networkBlock) {
        this.inner().withNetworkBlock(networkBlock);
        return this;
    }

    @Override
    public PrivateCloudImpl withSku(Sku sku) {
        this.inner().withSku(sku);
        return this;
    }

    @Override
    public PrivateCloudImpl withCircuit(Circuit circuit) {
        this.inner().withCircuit(circuit);
        return this;
    }

    @Override
    public PrivateCloudImpl withNsxtPassword(String nsxtPassword) {
        this.inner().withNsxtPassword(nsxtPassword);
        return this;
    }

    @Override
    public PrivateCloudImpl withVcenterPassword(String vcenterPassword) {
        this.inner().withVcenterPassword(vcenterPassword);
        return this;
    }

    @Override
    public PrivateCloudImpl withIdentitySources(List<IdentitySource> identitySources) {
        if (isInCreateMode()) {
            this.inner().withIdentitySources(identitySources);
        } else {
            this.updateParameter.withIdentitySources(identitySources);
        }
        return this;
    }

    @Override
    public PrivateCloudImpl withInternet(InternetEnum internet) {
        if (isInCreateMode()) {
            this.inner().withInternet(internet);
        } else {
            this.updateParameter.withInternet(internet);
        }
        return this;
    }

    @Override
    public PrivateCloudImpl withManagementCluster(ManagementCluster managementCluster) {
        if (isInCreateMode()) {
            this.inner().withManagementCluster(managementCluster);
        } else {
            this.updateParameter.withManagementCluster(managementCluster);
        }
        return this;
    }

}


text:
A mobile starter app showcasing an enhanced version of an Ionic Framework list element with dynamic controls.
- Interchangeable  edit and delete buttons on the left side of list elements.
- Reorder button on the right side of list elements.
- Hidden option buttons on the right side of list elements accessible  by swiping each list element from right to left.

## Installation
This starter app requires Node.js, Cordova and Ionic. Download the project folder to your machine and run:
```bash
cd /APP_PATH
ionic serve
```
To test on a device, run:
```bash
ionic platform add android
ionic platform add ios

ionic run android
ionic run ios
```

## Screenshots
![Screenshot 1](/images/image_1.png?raw=true)

![Screenshot 2](/images/image_2.png?raw=true)

![Screenshot 3](/images/image_3.png?raw=true)


text:
package org.apache.shardingsphere.proxy.backend.text.admin.executor;

import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResultMetaData;
import org.apache.shardingsphere.infra.merge.result.MergedResult;

import java.sql.SQLException;

/**
 * Database admin query executor.
 */
public interface DatabaseAdminQueryExecutor extends DatabaseAdminExecutor {

    /**
     * Get query result meta data.
     *
     * @return query result meta data
     */
    QueryResultMetaData getQueryResultMetaData();

    /**
     * Get merged result.
     *
     * @return  merged result
     * @throws SQLException SQL exception
     */
    MergedResult getMergedResult() throws SQLException;
}


text:
<!DOCTYPE html>

    <title>Google Maps JavaScript API v3 Example: Styled MapTypes</title>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
    <meta charset="utf-8">
    <link href="default.css" rel="stylesheet">


text:
/**
 * @fileoverview Generating Lua for math blocks.
 * @author rodrigoq@google.com (Rodrigo Queiro)
 */
'use strict';

goog.provide('Blockly.Lua.math');

goog.require('Blockly.Lua');

Blockly.Lua['math_number'] = function(block) {
  // Numeric value.
  var code = parseFloat(block.getFieldValue('NUM'));
  var order = code < 0 ? Blockly.Lua.ORDER_UNARY :
              Blockly.Lua.ORDER_ATOMIC;
  return [code, order];
};

Blockly.Lua['math_arithmetic'] = function(block) {
  // Basic arithmetic operators, and power.
  var OPERATORS = {
    ADD: [' + ', Blockly.Lua.ORDER_ADDITIVE],
    MINUS: [' - ', Blockly.Lua.ORDER_ADDITIVE],
    MULTIPLY: [' * ', Blockly.Lua.ORDER_MULTIPLICATIVE],
    DIVIDE: [' / ', Blockly.Lua.ORDER_MULTIPLICATIVE],
    POWER: [' ^ ', Blockly.Lua.ORDER_EXPONENTIATION]
  };
  var tuple = OPERATORS[block.getFieldValue('OP')];
  var operator = tuple[0];
  var order = tuple[1];
  var argument0 = Blockly.Lua.valueToCode(block, 'A', order) || '0';
  var argument1 = Blockly.Lua.valueToCode(block, 'B', order) || '0';
  var code = argument0 + operator + argument1;
  return [code, order];
};

Blockly.Lua['math_single'] = function(block) {
  // Math operators with single operand.
  var operator = block.getFieldValue('OP');
  var code;
  var arg;
  if (operator == 'NEG') {
    // Negation is a special case given its different operator precedence.
    arg = Blockly.Lua.valueToCode(block, 'NUM',
        Blockly.Lua.ORDER_UNARY) || '0';
    return ['-' + arg, Blockly.Lua.ORDER_UNARY];
  }
  if (operator == 'POW10') {
    arg = Blockly.Lua.valueToCode(block, 'NUM',
        Blockly.Lua.ORDER_EXPONENTIATION) || '0';
    return ['10 ^ ' + arg, Blockly.Lua.ORDER_EXPONENTIATION];
  }
  if (operator == 'ROUND') {
    arg = Blockly.Lua.valueToCode(block, 'NUM',
        Blockly.Lua.ORDER_ADDITIVE) || '0';
  } else {
    arg = Blockly.Lua.valueToCode(block, 'NUM',
        Blockly.Lua.ORDER_NONE) || '0';
  }
  switch (operator) {
    case 'ABS':
      code = 'math.abs(' + arg + ')';
      break;
    case 'ROOT':
      code = 'math.sqrt(' + arg + ')';
      break;
    case 'LN':
      code = 'math.log(' + arg + ')';
      break;
    case 'LOG10':
      code = 'math.log(' + arg + ', 10)';
      break;
    case 'EXP':
      code = 'math.exp(' + arg + ')';
      break;
    case 'ROUND':
      // This rounds up.  Blockly does not specify rounding direction.
      code = 'math.floor(' + arg + ' + .5)';
      break;
    case 'ROUNDUP':
      code = 'math.ceil(' + arg + ')';
      break;
    case 'ROUNDDOWN':
      code = 'math.floor(' + arg + ')';
      break;
    case 'SIN':
      code = 'math.sin(math.rad(' + arg + '))';
      break;
    case 'COS':
      code = 'math.cos(math.rad(' + arg + '))';
      break;
    case 'TAN':
      code = 'math.tan(math.rad(' + arg + '))';
      break;
    case 'ASIN':
      code = 'math.deg(math.asin(' + arg + '))';
      break;
    case 'ACOS':
      code = 'math.deg(math.acos(' + arg + '))';
      break;
    case 'ATAN':
      code = 'math.deg(math.atan(' + arg + '))';
      break;
    default:
      throw Error('Unknown math operator: ' + operator);
  }
  return [code, Blockly.Lua.ORDER_HIGH];
};

Blockly.Lua['math_constant'] = function(block) {
  // Constants: PI, E, the Golden Ratio, sqrt(2), 1/sqrt(2), INFINITY.
  var CONSTANTS = {
    PI: ['math.pi', Blockly.Lua.ORDER_HIGH],
    E: ['math.exp(1)', Blockly.Lua.ORDER_HIGH],
    GOLDEN_RATIO: ['(1 + math.sqrt(5)) / 2', Blockly.Lua.ORDER_MULTIPLICATIVE],
    SQRT2: ['math.sqrt(2)', Blockly.Lua.ORDER_HIGH],
    SQRT1_2: ['math.sqrt(1 / 2)', Blockly.Lua.ORDER_HIGH],
    INFINITY: ['math.huge', Blockly.Lua.ORDER_HIGH]
  };
  return CONSTANTS[block.getFieldValue('CONSTANT')];
};

Blockly.Lua['math_number_property'] = function(block) {
  // Check if a number is even, odd, prime, whole, positive, or negative
  // or if it is divisible by certain number. Returns true or false.
  var number_to_check = Blockly.Lua.valueToCode(block, 'NUMBER_TO_CHECK',
      Blockly.Lua.ORDER_MULTIPLICATIVE) || '0';
  var dropdown_property = block.getFieldValue('PROPERTY');
  var code;
  if (dropdown_property == 'PRIME') {
    // Prime is a special case as it is not a one-liner test.
    var functionName = Blockly.Lua.provideFunction_(
        'math_isPrime',
        ['function ' + Blockly.Lua.FUNCTION_NAME_PLACEHOLDER_ + '(n)',
         '  -- https://en.wikipedia.org/wiki/Primality_test#Naive_methods',
         '  if n == 2 or n == 3 then',
         '    return true',
         '  end',
         '  -- False if n is NaN, negative, is 1, or not whole.',
         '  -- And false if n is divisible by 2 or 3.',
         '  if not(n > 1) or n % 1 ~= 0 or n % 2 == 0 or n % 3 == 0 then',
         '    return false',
         '  end',
         '  -- Check all the numbers of form 6k +/- 1, up to sqrt(n).',
         '  for x = 6, math.sqrt(n) + 1.5, 6 do',
         '    if n % (x - 1) == 0 or n % (x + 1) == 0 then',
         '      return false',
         '    end',
         '  end',
         '  return true',
         'end']);
    code = functionName + '(' + number_to_check + ')';
    return [code, Blockly.Lua.ORDER_HIGH];
  }
  switch (dropdown_property) {
    case 'EVEN':
      code = number_to_check + ' % 2 == 0';
      break;
    case 'ODD':
      code = number_to_check + ' % 2 == 1';
      break;
    case 'WHOLE':
      code = number_to_check + ' % 1 == 0';
      break;
    case 'POSITIVE':
      code = number_to_check + ' > 0';
      break;
    case 'NEGATIVE':
      code = number_to_check + ' < 0';
      break;
    case 'DIVISIBLE_BY':
      var divisor = Blockly.Lua.valueToCode(block, 'DIVISOR',
          Blockly.Lua.ORDER_MULTIPLICATIVE);
      // If 'divisor' is some code that evals to 0, Lua will produce a nan.
      // Let's produce nil if we can determine this at compile-time.
      if (!divisor || divisor == '0') {
        return ['nil', Blockly.Lua.ORDER_ATOMIC];
      }
      // The normal trick to implement ?: with and/or doesn't work here:
      //   divisor == 0 and nil or number_to_check % divisor == 0
      // because nil is false, so allow a runtime failure. :-(
      code = number_to_check + ' % ' + divisor + ' == 0';
      break;
  }
  return [code, Blockly.Lua.ORDER_RELATIONAL];
};

Blockly.Lua['math_change'] = function(block) {
  // Add to a variable in place.
  var argument0 = Blockly.Lua.valueToCode(block, 'DELTA',
      Blockly.Lua.ORDER_ADDITIVE) || '0';
  var varName = Blockly.Lua.variableDB_.getName(
      block.getFieldValue('VAR'), Blockly.Variables.NAME_TYPE);
  return varName + ' = ' + varName + ' + ' + argument0 + '\n';
};

// Rounding functions have a single operand.
Blockly.Lua['math_round'] = Blockly.Lua['math_single'];
// Trigonometry functions have a single operand.
Blockly.Lua['math_trig'] = Blockly.Lua['math_single'];

Blockly.Lua['math_on_list'] = function(block) {
  // Math functions for lists.
  var func = block.getFieldValue('OP');
  var list = Blockly.Lua.valueToCode(block, 'LIST',
      Blockly.Lua.ORDER_NONE) || '{}';
  var functionName;

  // Functions needed in more than one case.
  function provideSum() {
    return Blockly.Lua.provideFunction_(
        'math_sum',
        ['function ' + Blockly.Lua.FUNCTION_NAME_PLACEHOLDER_ + '(t)',
         '  local result = 0',
         '  for _, v in ipairs(t) do',
         '    result = result + v',
         '  end',
         '  return result',
         'end']);
  }

  switch (func) {
    case 'SUM':
      functionName = provideSum();
      break;

    case 'MIN':
      // Returns 0 for the empty list.
      functionName = Blockly.Lua.provideFunction_(
          'math_min',
          ['function ' + Blockly.Lua.FUNCTION_NAME_PLACEHOLDER_ + '(t)',
           '  if #t == 0 then',
           '    return 0',
           '  end',
           '  local result = math.huge',
           '  for _, v in ipairs(t) do',
           '    if v < result then',
           '      result = v',
           '    end',
           '  end',
           '  return result',
           'end']);
      break;

    case 'AVERAGE':
      // Returns 0 for the empty list.
      functionName = Blockly.Lua.provideFunction_(
          'math_average',
          ['function ' + Blockly.Lua.FUNCTION_NAME_PLACEHOLDER_ + '(t)',
           '  if #t == 0 then',
           '    return 0',
           '  end',
           '  return ' + provideSum() + '(t) / #t',
           'end']);
      break;

    case 'MAX':
      // Returns 0 for the empty list.
      functionName = Blockly.Lua.provideFunction_(
          'math_max',
          ['function ' + Blockly.Lua.FUNCTION_NAME_PLACEHOLDER_ + '(t)',
           '  if #t == 0 then',
           '    return 0',
           '  end',
           '  local result = -math.huge',
           '  for _, v in ipairs(t) do',
           '    if v > result then',
           '      result = v',
           '    end',
           '  end',
           '  return result',
           'end']);
      break;

    case 'MEDIAN':
      functionName = Blockly.Lua.provideFunction_(
          'math_median',
          // This operation excludes non-numbers.
          ['function ' + Blockly.Lua.FUNCTION_NAME_PLACEHOLDER_ + '(t)',
           '  -- Source: http://lua-users.org/wiki/SimpleStats',
           '  if #t == 0 then',
           '    return 0',
           '  end',
           '  local temp={}',
           '  for _, v in ipairs(t) do',
           '    if type(v) == "number" then',
           '      table.insert(temp, v)',
           '    end',
           '  end',
           '  table.sort(temp)',
           '  if #temp % 2 == 0 then',
           '    return (temp[#temp/2] + temp[(#temp/2)+1]) / 2',
           '  else',
           '    return temp[math.ceil(#temp/2)]',
           '  end',
           'end']);
      break;

    case 'MODE':
      functionName = Blockly.Lua.provideFunction_(
          'math_modes',
          // As a list of numbers can contain more than one mode,
          // the returned result is provided as an array.
          // The Lua version includes non-numbers.
          ['function ' + Blockly.Lua.FUNCTION_NAME_PLACEHOLDER_ + '(t)',
           '  -- Source: http://lua-users.org/wiki/SimpleStats',
           '  local counts={}',
           '  for _, v in ipairs(t) do',
           '    if counts[v] == nil then',
           '      counts[v] = 1',
           '    else',
           '      counts[v] = counts[v] + 1',
           '    end',
           '  end',
           '  local biggestCount = 0',
           '  for _, v  in pairs(counts) do',
           '    if v > biggestCount then',
           '      biggestCount = v',
           '    end',
           '  end',
           '  local temp={}',
           '  for k, v in pairs(counts) do',
           '    if v == biggestCount then',
           '      table.insert(temp, k)',
           '    end',
           '  end',
           '  return temp',
           'end']);
      break;

    case 'STD_DEV':
      functionName = Blockly.Lua.provideFunction_(
          'math_standard_deviation',
          ['function ' + Blockly.Lua.FUNCTION_NAME_PLACEHOLDER_ + '(t)',
           '  local m',
           '  local vm',
           '  local total = 0',
           '  local count = 0',
           '  local result',
           '  m = #t == 0 and 0 or ' + provideSum() + '(t) / #t',
           '  for _, v in ipairs(t) do',
           "    if type(v) == 'number' then",
           '      vm = v - m',
           '      total = total + (vm * vm)',
           '      count = count + 1',
           '    end',
           '  end',
           '  result = math.sqrt(total / (count-1))',
           '  return result',
           'end']);
      break;

    case 'RANDOM':
      functionName = Blockly.Lua.provideFunction_(
          'math_random_list',
          ['function ' + Blockly.Lua.FUNCTION_NAME_PLACEHOLDER_ + '(t)',
           '  if #t == 0 then',
           '    return nil',
           '  end',
           '  return t[math.random(#t)]',
           'end']);
      break;

    default:
      throw Error('Unknown operator: ' + func);
  }
  return [functionName + '(' + list + ')', Blockly.Lua.ORDER_HIGH];
};

Blockly.Lua['math_modulo'] = function(block) {
  // Remainder computation.
  var argument0 = Blockly.Lua.valueToCode(block, 'DIVIDEND',
      Blockly.Lua.ORDER_MULTIPLICATIVE) || '0';
  var argument1 = Blockly.Lua.valueToCode(block, 'DIVISOR',
      Blockly.Lua.ORDER_MULTIPLICATIVE) || '0';
  var code = argument0 + ' % ' + argument1;
  return [code, Blockly.Lua.ORDER_MULTIPLICATIVE];
};

Blockly.Lua['math_constrain'] = function(block) {
  // Constrain a number between two limits.
  var argument0 = Blockly.Lua.valueToCode(block, 'VALUE',
      Blockly.Lua.ORDER_NONE) || '0';
  var argument1 = Blockly.Lua.valueToCode(block, 'LOW',
      Blockly.Lua.ORDER_NONE) || '-math.huge';
  var argument2 = Blockly.Lua.valueToCode(block, 'HIGH',
      Blockly.Lua.ORDER_NONE) || 'math.huge';
  var code = 'math.min(math.max(' + argument0 + ', ' + argument1 + '), ' +
      argument2 + ')';
  return [code, Blockly.Lua.ORDER_HIGH];
};

Blockly.Lua['math_random_int'] = function(block) {
  // Random integer between [X] and [Y].
  var argument0 = Blockly.Lua.valueToCode(block, 'FROM',
      Blockly.Lua.ORDER_NONE) || '0';
  var argument1 = Blockly.Lua.valueToCode(block, 'TO',
      Blockly.Lua.ORDER_NONE) || '0';
  var code = 'math.random(' + argument0 + ', ' + argument1 + ')';
  return [code, Blockly.Lua.ORDER_HIGH];
};

Blockly.Lua['math_random_float'] = function(block) {
  // Random fraction between 0 and 1.
  return ['math.random()', Blockly.Lua.ORDER_HIGH];
};


text:
<?php

namespace Mcwork\Service\Cache;

use Contentinum\Service\ContentinumServiceFactory;

/**
 * Register cache keys to administrate in backend
 *
 * @author Michael Jochum, michael.jochum@jochum-mediaservices.de
 */
class RegisterServiceFactory extends ContentinumServiceFactory
{

    /**
     * Cache key cache register
     *
     * @var string
     */
    const CONTENTINUM_CFG_FILE = 'mcwork_cache_register';

    /**
     * Name cache factory
     *
     * @var string
     */
    const CONTENTINUM_CACHE = 'mcwork_cache_data';
}