Fills a property mapping with default values.

@param props mapping where the default properties will be set.
761455
private static void fillDefaultProperties(final Properties props) {
        System.out.println("Setting default properties...");
        // parser
        props.put(ParserRunner.DATASET_FILE, "./data/ml-100k/ml-100k/u.data");
        props.put(ParserRunner.DATASET_PARSER, "net.recommenders.rival.split.parser.MovielensParser");
        // splits
        props.put(SplitterRunner.DATASET_SPLITTER, "net.recommenders.rival.split.splitter.RandomSplitter");
        props.put(SplitterRunner.SPLIT_CV_NFOLDS, "");
        props.put(SplitterRunner.SPLIT_PERITEMS, "false");
        props.put(SplitterRunner.SPLIT_PERUSER, "false");
        props.put(SplitterRunner.SPLIT_RANDOM_PERCENTAGE, "0.8");
        props.put(SplitterRunner.SPLIT_SEED, "2015");
        // recommender
        props.put(MultipleRecommendationRunner.LENSKIT_ITEMBASED_RECS, "org.grouplens.lenskit.knn.item.ItemItemScorer");
        props.put(MultipleRecommendationRunner.LENSKIT_SIMILARITIES,
                "org.grouplens.lenskit.vectors.similarity.CosineVectorSimilarity,org.grouplens.lenskit.vectors.similarity.PearsonCorrelation");
//        props.put(MultipleRecommendationRunner.LENSKIT_SVD_RECS, "org.grouplens.lenskit.mf.funksvd.FunkSVDItemScorer");
        props.put(MultipleRecommendationRunner.LENSKIT_SVD_RECS, "");
        props.put(MultipleRecommendationRunner.LENSKIT_USERBASED_RECS, "org.grouplens.lenskit.knn.user.UserUserItemScorer");
//        props.put(MultipleRecommendationRunner.LENSKIT_USERBASED_RECS, "");
//        props.put(MultipleRecommendationRunner.MAHOUT_ITEMBASED_RECS, "");
//        props.put(MultipleRecommendationRunner.MAHOUT_SIMILARITIES, "");
//        props.put(MultipleRecommendationRunner.MAHOUT_SVD_FACTORIZER, "");
//        props.put(MultipleRecommendationRunner.MAHOUT_SVD_RECS, "");
//        props.put(MultipleRecommendationRunner.MAHOUT_USERBASED_RECS, "");
        props.put(MultipleRecommendationRunner.N, "-1,10,50");
        props.put(MultipleRecommendationRunner.SVD_ITER, "50");
        // strategy
        props.put(MultipleStrategyRunner.STRATEGIES,
                "net.recommenders.rival.evaluation.strategy.RelPlusN,net.recommenders.rival.evaluation.strategy.TestItems,"
                + "net.recommenders.rival.evaluation.strategy.AllItems,net.recommenders.rival.evaluation.strategy.TrainItems,"
                + "net.recommenders.rival.evaluation.strategy.UserTest");
        props.put(MultipleStrategyRunner.RELEVANCE_THRESHOLDS, "5");
        props.put(MultipleStrategyRunner.RELPLUSN_N, "100");
        props.put(MultipleStrategyRunner.RELPLUSN_SEED, "2015");
        // evaluation
        props.put(MultipleEvaluationMetricRunner.METRICS,
                "net.recommenders.rival.evaluation.metric.error.MAE,"
                + "net.recommenders.rival.evaluation.metric.error.RMSE,"
                + "net.recommenders.rival.evaluation.metric.ranking.MAP,"
                + "net.recommenders.rival.evaluation.metric.ranking.NDCG,"
                + "net.recommenders.rival.evaluation.metric.ranking.Precision,"
                + "net.recommenders.rival.evaluation.metric.ranking.Recall");
        props.put(MultipleEvaluationMetricRunner.RELEVANCE_THRESHOLD, "5");
        props.put(MultipleEvaluationMetricRunner.RANKING_CUTOFFS, "1,5,10,50");
        props.put(MultipleEvaluationMetricRunner.NDCG_TYPE, "exp");
        props.put(MultipleEvaluationMetricRunner.ERROR_STRATEGY, "NOT_CONSIDER_NAN");
        // statistics
        props.put(StatisticsRunner.ALPHA, "0.05");
        props.put(StatisticsRunner.AVOID_USERS, "all");
        props.put(StatisticsRunner.STATISTICS,
                "confidence_interval,"
                + "effect_size_d,"
                + "effect_size_dLS,"
                + "effect_size_pairedT,"
                + "standard_error,"
                + "statistical_significance_t,"
                + "statistical_significance_pairedT,"
                + "statistical_significance_wilcoxon");
        props.put(StatisticsRunner.INPUT_FORMAT, "default");
        //              we use simple names instead of files
        props.put(StatisticsRunner.BASELINE_FILE, "/..lenskit.ItemItemScorer.CosineVectorSimilarity.tsv.stats");
        //
        System.out.println("Properties: " + props);
    }
705713
private void addPluginConfigDefaultProperties() {
    for (ConfProp prop : ConfProp.values()) {
      if (conf.get(prop.name) == null)
        conf.set(prop.name, prop.defVal);
    }
  }
925275
public void createTaskFieldMap(Props props)
   {
      byte[] fieldMapData = null;
      for (Integer key : TASK_KEYS)
      {
         fieldMapData = props.getByteArray(key);
         if (fieldMapData != null)
         {
            break;
         }
      }

      if (fieldMapData == null)
      {
         populateDefaultData(getDefaultTaskData());
      }
      else
      {
         createFieldMap(fieldMapData);
      }
   }
775555
public static void set(String key, String value) {
        PROPS.get().setProperty(key, value);
    }
775307
protected Properties replacePlaceHolders(Properties props){
		if (replacePlaceHolders){
			Properties result = new Properties();
			for (Object keyObj: props.keySet()){
				String key = (String) keyObj;
				String value = props.getProperty(key);
				key = PlaceHolderReplacer.replaceWithProperties(key);
				value = PlaceHolderReplacer.replaceWithProperties(value);
				result.put(key, value);
			}
			return result;
		}else{
			return props;
		}
	}
1362578
@Override
	protected void loadDefaultProperties() {
		for (P property : propertyClass.getEnumConstants()) {
			try {
				setProperty(property, property.getPropertyCharacteristics().getDefaultValue(), true);
			} catch (PropertyException e) {
				e.printStackTrace();
			}    
		}
	}
847008
public static synchronized void setProperties(Properties props) {
        wordLimit = Integer.parseInt(
                props.getProperty(TOKEN_COUNT_LIMIT_PROPERTY, "0"));

        String filterProp = 
            props.getProperty(TOKEN_FILTER_PROPERTY);
        filter = (filterProp != null)
            ? TokenFilter.loadFromSpecification(filterProp, resourceFinder)
            : null;
        
        // NOTE: future implementations may interpret the value of this property
        // to decide which stemmer to use
        String stemmerProp = props.getProperty(STEMMER_PROPERTY);
        if (stemmerProp != null)
            stemmer = ReflectionUtil.<Stemmer>getObjectInstance(stemmerProp);

        String compoundTokensProp = 
            props.getProperty(COMPOUND_TOKENS_FILE_PROPERTY);
        if (compoundTokensProp != null) {
            // Load the tokens from file
            compoundTokens = new LinkedHashSet<String>();
            try {
                BufferedReader br = resourceFinder.open(compoundTokensProp);
                for (String line = null; (line = br.readLine()) != null; ) {
                    compoundTokens.add(line);
                }
                // For any currently processing threads, update their mapped
                // iterator with the new set of tokens
                for (Map.Entry<Thread,CompoundWordIterator> e
                     : compoundIterators.entrySet()) {
                    // Create an empy dummy BufferedReader, which will be
                    // discarded upon the next .reset() call to the iterator
                    BufferedReader dummyBuffer =
                        new BufferedReader(new StringReader(""));
                    e.setValue(new CompoundWordIterator(
                                dummyBuffer, compoundTokens));
                }
            } catch (IOException ioe) {
                // rethrow
                throw new IOError(ioe);
            }
        } else {
            // If the user did not specify a set of compound tokens, null out
            // the set, in the event that there was one previously
            compoundTokens = null;
        }

        String replacementProp = 
            props.getProperty(TOKEN_REPLACEMENT_FILE_PROPERTY);
        if (replacementProp != null) {
            try {
                BufferedReader br = resourceFinder.open(replacementProp);
                replacementMap = new HashMap<String, String>();
                String line = null;
                while ((line = br.readLine()) != null) {
                    String[] termReplacement = line.split("\\s+");
                    replacementMap.put(termReplacement[0], termReplacement[1]);
                }
            } catch (IOException ioe) {
                throw new IOError(ioe);
            }
        } else
            replacementMap = null;
    }
792289
def default_props(reset=False, **kwargs):
    
    global _DEFAULT_PROPS
    if _DEFAULT_PROPS is None or reset:
        reset_default_props(**kwargs)
    return _DEFAULT_PROPS
989320
public void createAssignmentFieldMap(Props props)
   {
      //System.out.println("ASSIGN");
      byte[] fieldMapData = null;
      for (Integer key : ASSIGNMENT_KEYS)
      {
         fieldMapData = props.getByteArray(key);
         if (fieldMapData != null)
         {
            break;
         }
      }

      if (fieldMapData == null)
      {
         populateDefaultData(getDefaultAssignmentData());
      }
      else
      {
         createFieldMap(fieldMapData);
      }
   }
930150
static void setBeanProperties(Object object, Properties props)
            throws SQLException {

        if (props != null) {
            Enumeration<?> enumeration = props.keys();
            while (enumeration.hasMoreElements()) {
                String name = (String) enumeration.nextElement();
                setProperty(object, name, props.getProperty(name));
            }
        }
    }
1065986
public void storeProperties(Map<String, String> properties) throws IOException {
        Properties props = new Properties();
        properties.forEach(props::setProperty);
        try (FileOutputStream out = new FileOutputStream(getPropertiesFile())) {
            props.store(out, "");
        }
    }
352417
public void putProperties(Map<String, String> properties) {
		for (Map.Entry<String, String> property : properties.entrySet()) {
			put(property.getKey(), property.getValue());
		}
	}
1268904
public Data set(Iterable<Property> props) {
        return !Iterables.isEmpty(props)
               ? new Data(props)
               : this;
    }
579865
static void registerDefaultValues(AnnotationClassValue<?> annotation, Map<String, Object> defaultValues) {
        if (defaultValues != null) {
            registerDefaultValues(annotation.getName(), defaultValues);
        }
        registerAnnotationType(annotation);
    }
16614
public static void setProperties(SystemStoreClient<String, String> versionStore,
                                     Versioned<Properties> props) {
        if(props == null || props.getValue() == null) {
            logger.info("Ignoring set for empty properties");
            return;
        }

        try {
            String versionString = getPropertiesString(props.getValue());
            Versioned<String> versionedString = new Versioned<String>(versionString,
                                                                      props.getVersion());
            versionStore.putSysStore(SystemStoreConstants.VERSIONS_METADATA_KEY, versionedString);
        } catch(Exception e) {
            logger.info("Got exception in setting properties : ", e);
        }
    }
609380
@VisibleForTesting
    void setAdditionalProperties(Map<String, String> props) {
        props.put(SonarProperties.INCLUDE_FILES, StringUtils.join(files, ", "));
        props.put(SonarProperties.SCM_ENABLED, "false");
        props.put(SonarProperties.SCM_STAT_ENABLED, "false");
        props.put(SonarProperties.ISSUEASSIGN_PLUGIN, "false");
        props.put(SonarProperties.EXPORT_PATH, OUTPUT_FILE);
        props.put(SonarProperties.VERBOSE, configuration.getProperty(GeneralOption.SONAR_VERBOSE));
        props.put(SonarProperties.WORKDIR, OUTPUT_DIR);
        props.put(SonarProperties.PROJECT_BASEDIR, ".");
        props.put(SonarProperties.SOURCES, ".");
    }
1275571
@SuppressWarnings("unchecked")
    public static boolean addPropertyDefault(PropertiesImpl props, PropertyDefinition<?> propDef) {

        if ((props == null) || (props.getProperties() == null)) {
            throw new IllegalArgumentException("Props must not be null!");
        }

        if (propDef == null) {
            return false;
        }

        List<?> defaultValue = propDef.getDefaultValue();
        if ((defaultValue != null) && (!defaultValue.isEmpty())) {
            switch (propDef.getPropertyType()) {
                case BOOLEAN:
                    props.addProperty(new PropertyBooleanImpl(propDef.getId(), (List<Boolean>)defaultValue));
                    break;
                case DATETIME:
                    props.addProperty(new PropertyDateTimeImpl(propDef.getId(), (List<GregorianCalendar>)defaultValue));
                    break;
                case DECIMAL:
                    props.addProperty(new PropertyDecimalImpl(propDef.getId(), (List<BigDecimal>)defaultValue));
                    break;
                case HTML:
                    props.addProperty(new PropertyHtmlImpl(propDef.getId(), (List<String>)defaultValue));
                    break;
                case ID:
                    props.addProperty(new PropertyIdImpl(propDef.getId(), (List<String>)defaultValue));
                    break;
                case INTEGER:
                    props.addProperty(new PropertyIntegerImpl(propDef.getId(), (List<BigInteger>)defaultValue));
                    break;
                case STRING:
                    props.addProperty(new PropertyStringImpl(propDef.getId(), (List<String>)defaultValue));
                    break;
                case URI:
                    props.addProperty(new PropertyUriImpl(propDef.getId(), (List<String>)defaultValue));
                    break;
                default:
                    throw new RuntimeException("Unknown datatype! Spec change?");
            }

            return true;
        }

        return false;
    }