public Parameters(String serializedString) throws IOException { this(parseParams(serializedString)); }
Parameters params = camera.getParameters(); params.set("flash-mode", "on"); camera.setParameters(params);
Parameters parameters = mCamera.getParameters(); List<Integer> zoom_list = parameters.getZoomRatios(); int val = 0; if(isSamsungS4Zoom){ //FOR S4 ZOOM mZoomVal = parameters.getInt("curr_zoom_level"); val = zoom_list.get(mZoomVal); }else{ val = zoom_list.get(mZoomVal); }
p.setPictureSize(IMAGE_WIDTH, IMAGE_HEIGHT); Camera.Size s = p.getSupportedPreviewSizes().get(0); p.setPreviewSize( s.width, s.height ); p.setPictureFormat(PixelFormat.JPEG); p.set("flash-mode", "auto"); camera.setParameters(p);
Parameters parameters = camera.getParameters(); parameters.set("jpeg-quality", 70); parameters.setPictureFormat(PixelFormat.JPEG); parameters.setPictureSize(2048, 1232); camera.setParameters(parameters);
@Override protected void setup(Context context) throws IOException, InterruptedException { super.setup(context); int i = 0; for (Pair<String,Long> e : PFPGrowth.readFList(context.getConfiguration())) { fMap.put(e.getFirst(), i++); } Parameters params = new Parameters(context.getConfiguration().get(PFPGrowth.PFP_PARAMETERS, "")); splitter = Pattern.compile(params.get(PFPGrowth.SPLIT_PATTERN, PFPGrowth.SPLITTER.toString())); maxPerGroup = params.getInt(PFPGrowth.MAX_PER_GROUP, 0); } }
Parameters params = new Parameters(); if(hasOption("tempDir")){ String tempDirPath = getOption("tempDir"); params.set("tempDir", tempDirPath); params.set("input", inputString); params.set("input", null); params.set("support", supportString); params.set("gamma", gammaString); params.set("lambda", lambdaString); params.set("execMode", modeString); params.set("type", modeString); params.set("indexing", indexingString); params.set("partitionSize", partitionString); params.set("split", "true"); params.set("split", "false"); params.set("keepFiles", keepFilesString);
Configuration conf = new Configuration(); conf.set("job.parameters", params.toString()); conf.set("io.serializations", "org.apache.hadoop.io.serializer.JavaSerialization," + "org.apache.hadoop.io.serializer.WritableSerialization"); String input = params.get("input"); Job job = new Job(conf, "Generating dataset based from input" + input); Path outPath = new Path(params.get("output")); FileOutputFormat.setOutputPath(job, outPath);
public static void main(String args[]) throws Exception { Parameters params = new Parameters(); params.set("splitPattern", "\t"); String inputDir = "tweets.txt"; String outputDir = "twitter_seqfiles"; params.set("input", inputDir); params.set("output", outputDir); params.set("selectedField", "1"); // tweet params.set("groupByField", "0"); // username ByKeyGroupingJob.startJob(params); DoubleMetaphone filter = new DoubleMetaphone(); // TODO: change these terms?! System.out.println(filter.encode("Loke")); System.out.println(filter.encode("companymancomic")); System.out.println(filter.encode("webcomics")); System.out.println(filter.encode("@comic")); } }
@Override protected void setup(Context context) throws IOException, InterruptedException { super.setup(context); Parameters params = new Parameters(context.getConfiguration().get(PFPGrowth.PFP_PARAMETERS, "")); splitter = Pattern.compile(params.get(PFPGrowth.SPLIT_PATTERN, PFPGrowth.SPLITTER.toString())); } }
/** * @param params params * @param conf Configuration * @throws ClassNotFoundException * @throws InterruptedException * @throws IOException * * */ public static void runPFPGrowth(Parameters params, Configuration conf) throws IOException, InterruptedException, ClassNotFoundException { conf.set("io.serializations", "org.apache.hadoop.io.serializer.JavaSerialization," + "org.apache.hadoop.io.serializer.WritableSerialization"); startParallelCounting(params, conf); // save feature list to dcache List<Pair<String,Long>> fList = readFList(params); saveFList(fList, params, conf); // set param to control group size in MR jobs int numGroups = params.getInt(NUM_GROUPS, NUM_GROUPS_DEFAULT); int maxPerGroup = fList.size() / numGroups; if (fList.size() % numGroups != 0) { maxPerGroup++; } params.set(MAX_PER_GROUP, Integer.toString(maxPerGroup)); startParallelFPGrowth(params, conf); startAggregating(params, conf); }
/** * Read the Frequent Patterns generated from Text * * @return List of TopK patterns for each string frequent feature */ public static List<Pair<String,TopKStringPatterns>> readFrequentPattern(Parameters params) throws IOException { Configuration conf = new Configuration(); Path frequentPatternsPath = new Path(params.get(OUTPUT), FREQUENT_PATTERNS); FileSystem fs = FileSystem.get(frequentPatternsPath.toUri(), conf); FileStatus[] outputFiles = fs.globStatus(new Path(frequentPatternsPath, FILE_PATTERN)); List<Pair<String,TopKStringPatterns>> ret = Lists.newArrayList(); for (FileStatus fileStatus : outputFiles) { ret.addAll(FPGrowth.readFrequentPattern(conf, fileStatus.getPath())); } return ret; }
List<Camera.Size> sizes = params.getSupportedPreviewSizes(); Camera.Size selected = sizes.get(0); params.set("orientation", "landscape"); mCamera.setParameters(params);
@Override protected void setup(Context context) throws IOException, InterruptedException { super.setup(context); Parameters params = new Parameters(context.getConfiguration().get(PFPGrowth.PFP_PARAMETERS, "")); for (Pair<String,Long> e : PFPGrowth.readFList(context.getConfiguration())) { featureReverseMap.add(e.getFirst()); freqList.add(e.getSecond()); } maxHeapSize = Integer.valueOf(params.get(PFPGrowth.MAX_HEAP_SIZE, "50")); minSupport = Integer.valueOf(params.get(PFPGrowth.MIN_SUPPORT, "3")); maxPerGroup = params.getInt(PFPGrowth.MAX_PER_GROUP, 0); numFeatures = featureReverseMap.size(); useFP2 = "true".equals(params.get(PFPGrowth.USE_FPG2)); } }
Parameters parameters = camera.getParameters(); parameters.set("jpeg-quality", 70); parameters.setPictureFormat(PixelFormat.JPEG); parameters.setPictureSize(2048, 1232); camera.setParameters(parameters);
conf.set(PFP_PARAMETERS, params.toString()); String input = params.get(INPUT); Job job = new Job(conf, "Parallel Counting Driver running over input: " + input); job.setJarByClass(PFPGrowth.class); Path outPath = new Path(params.get(OUTPUT), PARALLEL_COUNTING); FileOutputFormat.setOutputPath(job, outPath);
Parameters params = new Parameters(); params.set("minSupport", minSupportString); params.set("maxHeapSize", maxHeapSizeString); params.set("numGroups", numGroupsString); params.set("treeCacheSize", numTreeCacheString); params.set("splitPattern", patternString); encoding = getOption("encoding"); params.set("encoding", encoding); params.set(PFPGrowth.USE_FPG2, "true"); Path outputDir = getOutputPath(); params.set("input", inputDir.toString()); params.set("output", outputDir.toString());
@Override protected void setup(Context context) throws IOException, InterruptedException { super.setup(context); Parameters params = new Parameters(context.getConfiguration().get("pfp.parameters", "")); maxHeapSize = Integer.valueOf(params.get("maxHeapSize", "50")); } }
Parameters p=camera.getParameters(); p.set("orientation", "portrait"); camera.setParameters(p);