query
stringlengths
7
33.1k
document
stringlengths
7
335k
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Initializes the data structure using the given array of strings as the dictionary. (You can assume each word in the dictionary contains only the uppercase letters A through Z.)
public BoggleSolver(String[] dictionary) { root = new Node(); for (String word : dictionary) { if (word.length() < 3) { continue; } Node node = processWord(word); if (node != null) node.setWord(word); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract void init(ArrayList<String> ary);", "public void buildDict(String[] dict) {\n for (String word : dict) {\n for (int i = 0; i < word.length(); i++) {\n String key = word.substring(0, i) + word.substring(i+1);\n int[] indexAndChar = new int[2];\n ...
[ "0.6685718", "0.64114577", "0.64062935", "0.63865995", "0.6341648", "0.62713724", "0.6213894", "0.6139804", "0.61238474", "0.60379815", "0.5990407", "0.59826463", "0.5886373", "0.5882417", "0.58313435", "0.57244277", "0.56412345", "0.5591164", "0.55796826", "0.55677265", "0.5...
0.55646634
20
Returns the set of all valid words in the given Boggle board, as an Iterable.
public Iterable<String> getAllValidWords(BoggleBoard board) { boardRows = board.rows(); boardCols = board.cols(); boolean[][] visited = new boolean[boardRows][boardCols]; HashSet<String> foundWords = new HashSet<>(); for (int row = 0; row < boardRows; row++) { for (int col = 0; col < boardCols; col++) { doSearch(row, col, root, board, visited, foundWords); } } return foundWords; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Iterable<String> getAllValidWords(final BoggleBoard board) {\n HashSet<String> validwords = new HashSet<>();\n for (int i = 0; i < board.rows(); i++) {\n for (int j = 0; j < board.cols(); j++) {\n boolean[][] marked = new boolean[board.rows()][board.cols()];\n ...
[ "0.84632343", "0.8339207", "0.8255916", "0.7879105", "0.7841079", "0.6512109", "0.6417504", "0.63576347", "0.6354491", "0.6348851", "0.58696514", "0.58644927", "0.58348095", "0.5585982", "0.5537117", "0.55251676", "0.55154365", "0.54860914", "0.54842347", "0.54621726", "0.545...
0.8348497
1
Returns the score of the given word if it is in the dictionary, zero otherwise. (You can assume the word contains only the uppercase letters A through Z.)
public int scoreOf(String word) { int length = word.length(); // Validate word Node node = root; for (int i = 0; i < length; i++) { int c = word.charAt(i) - A_ENCODE; // Handle Q if (c == Q_LETTER) { // Skip 'U' if (i + 1 < length && word.charAt(i + 1) == U_ENCODE) { i++; // Dictionary do not consider words that have 'Q' that isn't 'QU' } else { return 0; } } node = node.edges[c]; if (node == null) { return 0; } } if (node.word == null) { return 0; } // Get points if (length < 5) { return 1; } switch (length) { case 5: return 2; case 6: return 3; case 7: return 5; default: return 11; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int scoreOf(String word) {\n // 1. check if the word is in dictionary. dict.contains(word) is true or not\n\n // 2. calculate the score of the word\n int score = calScore(word);\n return score;\n }", "public int scoreOf(String word) {\n\t\tString noU = stripU(word);\n\t\tret...
[ "0.8387435", "0.8067689", "0.8014986", "0.7205271", "0.71016705", "0.705186", "0.67594045", "0.6648599", "0.6572875", "0.6557154", "0.65285933", "0.65043366", "0.64832723", "0.6461632", "0.63644344", "0.6311931", "0.62998223", "0.62501115", "0.61952776", "0.6192339", "0.61335...
0.7524082
3
String dict = "/Users/jpenna/Documents/princetonalgs/WKb4_tries/samples/dictionaryalgs4.txt"; In in = new In(dict); String[] dictionary = in.readAllStrings(); BoggleSolver solver = new BoggleSolver(dictionary); StdOut.println(solver.scoreOf("TRICE"));
public static void main(String[] args) { String dict = "/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/dictionary-yawl.txt"; String[] boardPaths = new String[]{ "/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points0.txt", "/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points1.txt", "/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points100.txt", "/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points1000.txt", "/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points1111.txt", "/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points1250.txt", "/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points13464.txt", "/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points1500.txt", "/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points2.txt", "/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points200.txt", "/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points2000.txt", "/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points26539.txt", "/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points3.txt", "/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points300.txt", "/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points4.txt", "/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points400.txt", "/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points4410.txt", "/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points4527.txt", "/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points4540.txt", "/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points5.txt", "/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points500.txt", "/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points750.txt", "/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-points777.txt", }; // String dict = "/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/dictionary-common.txt"; // String[] boardPaths = new String[]{ // "/Users/jpenna/Documents/princeton-algs/WKb4_tries/samples/board-random1.txt", // }; In in = new In(dict); String[] dictionary = in.readAllStrings(); BoggleSolver solver = new BoggleSolver(dictionary); int[] scores = new int[boardPaths.length]; int[] counts = new int[boardPaths.length]; for (int i = 0; i < boardPaths.length; i++) { BoggleBoard board = new BoggleBoard(boardPaths[i]); for (String word : solver.getAllValidWords(board)) { counts[i]++; StdOut.print(word + ", "); scores[i] += solver.scoreOf(word); } StdOut.println("\n************************\n"); } for (int i = 0; i < boardPaths.length; i++) { StdOut.println(boardPaths[i]); StdOut.println("Count: " + counts[i]); StdOut.println("Score = " + scores[i]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\n In in = new In(args[0]);\n String[] dictionary = in.readAllStrings();\n BoggleSolver solver = new BoggleSolver(dictionary);\n BoggleBoard board = new BoggleBoard(args[1]);\n int score = 0;\n for (String word : solver.getAllValidWo...
[ "0.68079334", "0.67125815", "0.66668004", "0.6420049", "0.6412046", "0.63568413", "0.61968493", "0.6119819", "0.60782593", "0.60475737", "0.6042758", "0.5960339", "0.59186953", "0.5804627", "0.5798987", "0.57512456", "0.57439756", "0.572702", "0.57149523", "0.5703669", "0.567...
0.5800814
14
the time, the player had for this parcour and his record
public Player(int id, String name, int userID) { this.id = id; this.name = name; this.colorID = getNextColor(); //set the colorID to the next free color this.userID = userID; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public long getPlayerTime ( ) {\n\t\treturn extract ( handle -> handle.getPlayerTime ( ) );\n\t}", "@Override\n\tpublic long getPlaytime() {\n\t\treturn this.playTime;\n\t}", "java.lang.String getPlayTime();", "public long getLastTimePlayed()\n {\n return lastTimePlayed;\n }", "public int getT...
[ "0.6582525", "0.6477827", "0.64333", "0.6300948", "0.62854683", "0.6252797", "0.6174502", "0.61571175", "0.6119972", "0.6097157", "0.6043867", "0.6024981", "0.60191774", "0.60020804", "0.5990579", "0.5975997", "0.59261125", "0.5900393", "0.5895212", "0.58922833", "0.5863127",...
0.0
-1
due to the dependence of other players method has to be static
private static int getNextColor() { boolean[] used = new boolean[ServerStarter.MAX_PLAYERS]; //create a boolean with the maximum of players for(Player players : ServerStarter.getAllPlayers()) { used[players.getColorID()] = true; //go through all players and set their colorID to true if } //it's used for(int i = 0; i < used.length; i++) { if(!used[i]) { return i; //go through the boolean array and return the next unused color } } return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Player getPlayer();", "protected Player getPlayer() { return player; }", "public interface Player {\n\n\n /**\n * Represents the attack result of random strategy.\n *\n * @return an attack result\n */\n AttackResult randomAttack();\n\n /**\n * Represents the attack result of user strategy.\n *\n...
[ "0.68927956", "0.68663317", "0.6829119", "0.6786718", "0.67773765", "0.67773765", "0.67534566", "0.6753172", "0.6753172", "0.66862303", "0.6661027", "0.6623417", "0.6586159", "0.6578376", "0.6568268", "0.6557885", "0.6553136", "0.65282285", "0.6490826", "0.6484623", "0.647985...
0.0
-1
Creates the editor used to edit the date selection. The editor is configured with the default DatePickerFormatter marked as UIResource.
protected static JFormattedTextField createEditor(final Locale locale, final boolean useTimePortion, final Long defaultTimePortionMillis) { final DateFormat fullFormat = convertFormat(locale, ConverterFactory.createFullDateFormat(locale)), dateAndPartialTimeFormat = convertFormat(locale, ConverterFactory.createShortDateAndHoursAndMinutesFormat(locale)), dateAndPartialTimeWithoutMinutesFormat = convertFormat(locale, ConverterFactory.createShortDateAndHoursFormat(locale)), dateFormat = convertFormat(locale, ConverterFactory.createShortDateFormat(locale)); final AbstractFormatterFactory fullFactory = ComponentFactory.createDateFormatterFactory(fullFormat, fullFormat), dateAndPartialTimeFactory = ComponentFactory.createDateFormatterFactory(dateAndPartialTimeFormat, dateAndPartialTimeFormat), dateAndPartialTimeWithoutMinutesFactory = ComponentFactory.createDateFormatterFactory(dateAndPartialTimeWithoutMinutesFormat, dateAndPartialTimeWithoutMinutesFormat), dateFactory = ComponentFactory.createDateFormatterFactory(dateFormat, dateFormat); final JFormattedTextField f = new SpecialFormattedField(useTimePortion ? fullFactory : dateFactory) { private static final long serialVersionUID = 892493264832644324L; private void setValueSilently(final Object value) { if (getFormatterFactory() == null) { throw new RuntimeException("Formatter factory should be explicitly provided for date picker layer field."); } // Actually we just need to call setValue(value, false, true). But this method is private. // So we have to override setFormatter() method not to invoke "formatter re-setting" in this case. silentValueSetting = true; if (value != null) { final Date date = (Date) value; final Calendar c = Calendar.getInstance(); c.setTime(date); final int year = c.get(Calendar.YEAR); if (year <= 99 && year >= 0) { c.set(Calendar.YEAR, (year <= 50) ? (2000 + year) : (1900 + year)); // use partial year typed as [0-50]=>[2000-2050] and [51-99]=>[1951-1999] setValue(c.getTime()); } else { setValue(value); // false, true } } else { setValue(value); // false, true } silentValueSetting = false; } private boolean silentValueSetting = false; @Override protected void setFormatter(final AbstractFormatter format) { if (!silentValueSetting) { super.setFormatter(format); } } @Override public void commitEdit() throws ParseException { if (useTimePortion) { try { // try "dd/MM/yyyy hh:mma" : final AbstractFormatter format = fullFactory.getFormatter(this); // super.commitEdit(); if (format != null) { setValueSilently(format.stringToValue(getText())); } } catch (final ParseException e1) { try { // in case of full format failure, try "dd/MM/yyyy hh:mm" : final AbstractFormatter format = dateAndPartialTimeFactory.getFormatter(this); if (format != null) { setValueSilently(format.stringToValue(getText())); } } catch (final ParseException e2) { try { // in case of full and "dd/MM/yyyy hh:mm" formats failures, try "dd/MM/yyyy hh" : final AbstractFormatter format = dateAndPartialTimeWithoutMinutesFactory.getFormatter(this); if (format != null) { setValueSilently(format.stringToValue(getText())); } } catch (final ParseException e3) { // in case of full and "dd/MM/yyyy hh:mm" and "dd/MM/yyyy hh" formats failures, try simple "dd/MM/yyyy". // note that "12/10/2010sdjfyudisfyie" string is correct! final AbstractFormatter format = dateFactory.getFormatter(this); if (format != null) { try { final Date value = (Date) format.stringToValue(getText()); // a value of date retrieved directly from date picker (e.g. 12/12/2001) final Date modifiedByDefaultTimePortionDate = new Date(value.getTime() + defaultTimePortionMillis); setValueSilently(modifiedByDefaultTimePortionDate); } catch (final ParseException e4) { throw e4; } } } } } } else { super.commitEdit(); } } }; f.setName("dateField"); f.setLocale(locale); // this produces a fixed pref widths, looking a bit funny // int columns = UIManagerExt.getInt("JXDatePicker.numColumns", null); // if (columns > 0) { // f.setColumns(columns); // } // that's always 0 as it comes from the resourcebundle // f.setColumns(UIManager.getInt("JXDatePicker.numColumns")); final Border border = UIManager.getBorder("JXDatePicker.border"); if (border != null) { f.setBorder(border); } return f; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public DateEditor() {\n\t\t\tsuper(new JFormattedTextField(dateFormat));\n\t\t\ttf = (JFormattedTextField) getComponent();\n\t\t\t\n\t\t\t//React when the user presses Enter while the editor is\n\t //active. (Tab is handled as specified by\n\t //JFormattedTextField's focusLostBehavior property.)\n\t...
[ "0.6439831", "0.5899342", "0.587925", "0.5809795", "0.57145786", "0.5695301", "0.5592521", "0.55722094", "0.55587333", "0.55242807", "0.551962", "0.5477984", "0.5471866", "0.54662806", "0.542958", "0.5396045", "0.53913254", "0.53913254", "0.53885764", "0.53885764", "0.5373545...
0.5534721
9
Converts string representation of format to DateFormat representation.
public static DateFormat defaultFormat() { return convertFormat(Locale.getDefault(), "dd/MM/yyyy hh:mma"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String convertDateFormat (String dateStr, String fromFormatPattern, String toFormatPattern) {\n\t\tDateFormat fromFormat = new SimpleDateFormat(fromFormatPattern);\n\t\tDateFormat toFormat = new SimpleDateFormat(toFormatPattern);\n\t\ttoFormat.setLenient(false);\n\t\tDate date;\n\t\ttry {\n\t\t\tdate...
[ "0.6866443", "0.6611948", "0.6343353", "0.63433385", "0.6244617", "0.6237276", "0.6187412", "0.61651176", "0.6162738", "0.61474264", "0.60367286", "0.5996899", "0.598243", "0.5864122", "0.58132946", "0.5805394", "0.5711125", "0.56787", "0.56751204", "0.5671943", "0.55735725",...
0.5183265
64
Converts string representation of format to DateFormat representation.
public static DateFormat convertFormat(final Locale locale, final String format) { return convertFormats(locale, format)[0]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String convertDateFormat (String dateStr, String fromFormatPattern, String toFormatPattern) {\n\t\tDateFormat fromFormat = new SimpleDateFormat(fromFormatPattern);\n\t\tDateFormat toFormat = new SimpleDateFormat(toFormatPattern);\n\t\ttoFormat.setLenient(false);\n\t\tDate date;\n\t\ttry {\n\t\t\tdate...
[ "0.68689793", "0.6345613", "0.6344843", "0.62463206", "0.6240098", "0.61875063", "0.6164591", "0.61644566", "0.61482054", "0.6039417", "0.5997909", "0.5982542", "0.58657426", "0.58130646", "0.58084357", "0.57122976", "0.56800514", "0.56763846", "0.5675295", "0.5576105", "0.55...
0.66137266
1
Converts string representations of formats to DateFormat representations.
private static DateFormat[] convertFormats(final Locale locale, final String... formats) { DateFormat[] dateFormats = null; if (formats != null) { Contract.asNotNull(formats, "the array of format strings must not " + "must not contain null elements"); dateFormats = new DateFormat[formats.length]; for (int counter = formats.length - 1; counter >= 0; counter--) { dateFormats[counter] = new SimpleDateFormat(formats[counter], locale); } } return dateFormats; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected DateFormat[] getDateFormats() {\r\n\t\tString[] formatStrings = getFormatStrings();\r\n\t\tSimpleDateFormat[] dateFormats = new SimpleDateFormat[formatStrings.length];\r\n\r\n\t\tfor (int i = 0; i < formatStrings.length; i++) {\r\n\t\t\tdateFormats[i] = new SimpleDateFormat(formatStrings[i], locale);\r\n...
[ "0.67871296", "0.6644571", "0.6494511", "0.61037755", "0.6062648", "0.5999086", "0.5929434", "0.58336604", "0.56875116", "0.56811625", "0.5680777", "0.56671447", "0.55672276", "0.5452107", "0.54226494", "0.5396111", "0.53904927", "0.53880614", "0.5376958", "0.5369514", "0.536...
0.6925783
0
Has been hard coded in predictionEval to 365 days Change this value for number of RND numbers
public static void main(String[] args) { //GammaDistribution gam = new GammaDistribution(10.0, 20.0); //double gamR = gam.sample(); //System.out.println(gamR); for(String s : args) { System.out.println(s); } //if we run the code without any arguments then use default, else overwrite int lnth = args.length; if (lnth != 0 ) { int diff = 0; try { //totalT = Integer.valueOf(args[0+diff]); //totalY = Integer.valueOf(args[1+diff]); //totalYears = Integer.valueOf(args[2+diff]); dataSet = args[0+diff]; yrs = Integer.valueOf(args[1+diff]); spreadYrs = Integer.valueOf(args[2+diff]); maxDepth = Integer.valueOf(args[3+diff]); popSize = Integer.valueOf(args[4+diff]); tournamentSize = (popSize / 100) - 1; mutProb = Double.valueOf(args[5+diff]); xoverProb = Double.valueOf(args[6+diff]); elitismPercentage = Double.valueOf(args[7+diff]); primProb = Double.valueOf(args[8+diff]); terminalNodeCrossBias = Double.valueOf(args[9+diff]); nGens = Integer.valueOf(args[10+diff]); lowerLowBound = Double.valueOf(args[11+diff]); lowerUpBound = Double.valueOf(args[12+diff]); upperLowBound = Double.valueOf(args[13+diff]); upperUpBound = Double.valueOf(args[14+diff]); movingAverage = Integer.valueOf(args[15+diff]); totalNumParams = 0; additionalParameters = 0; parameterIndex.add(0); for (int i = 16; i < args.length -1 + diff; i++) { // minus 1 as the last parameter is whether to use bound if (Integer.valueOf(args[i]) == 1) { totalNumParams++; parameterIndex.add(i-15); //parameterIndex starts from 1, becuase my pred value is in column 0 if (i >= args.length -9 + diff) {//minus 1 to compensate for last value and minus 8 for the 9 parameters additionalParameters++; } } } lowerBound = Integer.valueOf(args[args.length - 1]); //last value is whether to use a lower bound } catch (ArrayIndexOutOfBoundsException t) { System.out.println("args not enough, please check"); } } else { for (int i = 0; i < totalNumParams; i++) { parameterIndex.add(i); } } FReader read = new FReader(); header = read.readHeader("Data/header.txt"); parametersLength = header.length - 9; //take away the 9 parameters that will be calculated within GP Expr[] evolvedMethodParameters = new Expr[totalNumParams-1]; eval = new PredictionEvaluatorTrue2(nRuns, contractLength, parameterIndex, parametersLength, additionalParameters); Function evolvedMethod = new Function(Double.TYPE, new Class[0]); TreeManager.evolvedMethod = evolvedMethod; for (int i=0; i<totalNumParams-1; i++) { evolvedMethodParameters[i] = new Parameter(i); } TreeManager.evolvedMethodParameters = evolvedMethodParameters; ArrayList methodSet = new ArrayList(); methodSet.add(ADD); methodSet.add(SUB); methodSet.add(MUL); methodSet.add(DIV); methodSet.add(LOG); methodSet.add(SQRT); methodSet.add(POW); methodSet.add(MOD); //methodSet.add(SIN); //methodSet.add(COS); methodSet.add(EXP); Random r = new Random(); ArrayList terminalSet = new ArrayList(); // for (int i = 0; i < terminals; i++) // { // double rc = r.nextDouble(); // terminalSet.add(new Constant(new Double(rc * 100.0D), Double.TYPE)); //Building in a function representing random numbers minimum and maximum, consider avearge // } // // //Add in numbers between 0 and 2 in blocks of 0.05 for the purpose of weights // // for (int i = 0; i < weights; i++) // { // double rc = (1 + i) * 0.05; // terminalSet.add(new Constant(new Double(rc), Double.TYPE)); // } //terminalSet.add(new Constant(new Double(0.0D), Double.TYPE)); //terminalSet.add(new Constant(new Double(3.141592653589793D), Double.TYPE)); //For old data //Dynamically adds the number of parameters to be estimated, need to refer to data to input correct values //for (int i = 0; i < totalT; i++) { // terminalSet.add(new Parameter(i, Double.TYPE, Boolean.valueOf(true), "Rain_t-"+(i+1))); //} //for (int i = 0; i < totalY; i++) { // terminalSet.add(new Parameter(i+totalT, Double.TYPE, Boolean.valueOf(true), "Year_t-"+(i+1))); //} //For new data have headers read in and name accordingly. for (int i = 0; i < totalNumParams-1; i++) { terminalSet.add(new Parameter(i, Double.TYPE, Boolean.valueOf(true), header[parameterIndex.get(i)])); } //consider 3 ERC's one big range, 2 smaller ranges between -1 and 1 terminalSet.add(new Constant("ERC", Double.TYPE)); terminalSet.add(new Constant("ERC2", Double.TYPE)); terminalSet.add(new Constant("ERC3", Double.TYPE)); double primProb = 0.6D; double terminalNodeCrossBias = 0.1D; TreeManager tm = new TreeManager(methodSet, terminalSet, primProb, maxInitialDepth, maxDepth, terminalNodeCrossBias); System.out.println("============= Experimental parameters ============="); System.out.println("Maximum initial depth: " + maxInitialDepth); System.out.println("Maximum depth: " + maxDepth); System.out.println("Primitive probability in Grow method: " + primProb); System.out.println("Terminal node crossover bias: " + terminalNodeCrossBias); System.out.println("No of generations: " + nGens); System.out.println("Population size: " + popSize); System.out.println("Tournament size: " + tournamentSize); System.out.println("Crossover probability: " + xoverProb); System.out.println("Reproduction probability: " + (1.0D - xoverProb)); System.out.println("Mutation probalitity: " + mutProb); System.out.println("Elitism percentage: " + elitismPercentage); System.out.println("==================================================="); StatisticalSummary.logExperimentSetup(methodSet, terminalSet, maxInitialDepth, maxDepth, primProb, terminalNodeCrossBias, nGens, popSize, tournamentSize, mutProb, xoverProb); StatisticalSummary stat = null; filenameS = "Results/Results_"+yrs+"_"+spreadYrs+"_MA"+movingAverage+"_"+contractLength; for (int i = 0; i < nRuns; i++) { System.out.println("========================== Experiment " + i + " =================================="); File experiment = new File(filenameS + "/Experiment "+i); experiment.mkdirs(); stat = new StatisticalSummary(nGens, popSize, i); alg = new GA(tm, eval, popSize, tournamentSize, stat, mutProb, elitismPercentage, xoverProb, nRuns); alg.evolve(nGens, i); System.out.println("==============================================================================="); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getBillionUsersDay(float[] growthRates) {\n Arrays.sort(growthRates);\n float max = growthRates[growthRates.length-1];\n return (int)Math.ceil(Math.log(Math.pow(10,9))/Math.log(max));\n\n }", "@Override\r\n\tpublic int computeNextVal(boolean prediction) {\n\t\treturn (int) (Math.rando...
[ "0.56200224", "0.55779827", "0.5411792", "0.53802085", "0.5343872", "0.533091", "0.53294134", "0.5325758", "0.5254786", "0.52372336", "0.52220535", "0.51640934", "0.5155317", "0.5140401", "0.51039565", "0.51030517", "0.5098002", "0.5069081", "0.5023789", "0.5023092", "0.50156...
0.0
-1
Asynchronously downloads the file
@Async("file_download_task_executor") public CompletableFuture<Long> downloadFileAsync(URLDetailsVO urlDetails) { return CompletableFuture.supplyAsync(() -> { String url = urlDetails.getUrl(); final Long resultId = statusUpdaterService.initialize(url); try { Protocol protocol = fileDownloadHelper.getProtocol(url); FileDownloader fileDownloader = fileDownloaderFactory.getFileDownloader(protocol); retryTemplate.execute(context -> { statusUpdaterService.inProgess(resultId, context.getRetryCount()); if (context.getRetryCount() > 0) { logger.info("Retry {} - trying to download again", context.getRetryCount()); } fileDownloader.download(urlDetails); return null; }); statusUpdaterService.success(resultId); } catch (ValidationException e) { logger.error(e.getErrors().toString(), e); statusUpdaterService.failed(resultId, e.getErrors().toString()); } catch (DownloadFailedException e) { logger.error("Failed to download the file", e); statusUpdaterService.failed(resultId, e.getMessage()); } catch (Exception e) { logger.error("Exception Occurred", e); statusUpdaterService.failed(resultId, e.getMessage()); } return resultId; }, taskExecutor); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void downloadingFile(String path);", "public void download() {\n }", "public void download() {\r\n\t\t\ttThread = new Thread(this);\r\n\t\t\ttThread.start();\r\n\t\t}", "@Override\r\n protected void onPostExecute(String file_url) {\r\n System.out.println(\"Downloaded\");\r\n ...
[ "0.70725024", "0.70355207", "0.6945948", "0.69031435", "0.682463", "0.67168593", "0.66906935", "0.65887845", "0.652697", "0.6526781", "0.65102696", "0.64988", "0.64864403", "0.63719016", "0.6368677", "0.6355567", "0.6348705", "0.63223606", "0.6263393", "0.62090456", "0.620512...
0.62117714
19
TODO Autogenerated method stub
public static void main(String[] args) { DuplicatesWithList dl=new DuplicatesWithList(); dl.add(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
The default port number.
public static void main(String args[]) { int portNumber = 2228; if (args.length < 1) { System.out.println("Usage: java MultiThreadChatServerSync <portNumber>\n" + "Now using port number=" + portNumber); } else { portNumber = Integer.valueOf(args[0]); } try { serverSocket = new ServerSocket(portNumber); } catch (IOException e) { System.out.println(e); } /* * Create a client socket for each connection and pass it to a new client * thread. */ while (true) { try { clientSocket = serverSocket.accept(); int i = 0; for (i = 0; i < maxClientsCount; i++) { if (threads[i] == null) { (threads[i] = new clientThread(clientSocket, threads, history, userList)).start(); break; } } if (i == maxClientsCount) { PrintStream os = new PrintStream(clientSocket.getOutputStream()); os.println("Server too busy. Try later."); os.close(); clientSocket.close(); } } catch (IOException e) { System.out.println(e); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getDefaultPort() {\n return defaultPort;\n }", "public void setDefaultPort() {\r\n\t\tsetPort(DEFAULT_PORT);\r\n\t}", "public int getStandardPort()\n\t{\n\t\treturn DEFAULT_PORT;\n\t}", "protected int getDefaultPort() {\n/* 320 */ return -1;\n/* */ }", "@Override\n public int...
[ "0.874512", "0.8337473", "0.8211434", "0.7934353", "0.7775653", "0.7630885", "0.75865066", "0.74741817", "0.74535054", "0.7420626", "0.7420626", "0.741554", "0.7414862", "0.74020267", "0.73620635", "0.73548925", "0.7339174", "0.73262167", "0.73262167", "0.7310589", "0.7309272...
0.0
-1
Creates a new SidePanel
public SidePanel(Tetris tetris) { this.tetris = tetris; setPreferredSize(new Dimension(200, BoardPanel.PANEL_HEIGHT)); setBackground(Color.BLACK); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void createMainPanel() {\n\t\tthis.mainPanel = new VerticalPanel(); \n\t\tthis.mainPanel.setSpacing(5);\n\t\tthis.mainPanel.setScrollMode(getScrollMode());\n\t}", "public JPanel createSouthPanel() {\n\t\tsouth = new JPanel(new GridLayout(1, 1));\n\t\t// adds start button and its functionality\n\t\tsta...
[ "0.7000794", "0.66350305", "0.6538856", "0.64255714", "0.6355732", "0.6351341", "0.63014436", "0.6245858", "0.62088305", "0.6168507", "0.6117324", "0.60683674", "0.60649115", "0.6008179", "0.59871733", "0.59638405", "0.596161", "0.59578323", "0.592664", "0.5913154", "0.590330...
0.59589595
17
Draws a tile onto the preview window.
private void drawTile(TileType type, int x, int y, Graphics g) { //Fill the entire tile with the base color. g.setColor(type.getBaseColor()); g.fillRect(x, y, TILE_SIZE, TILE_SIZE); //Fill the bottom and right edges of the tile with the dark shading color. g.setColor(type.getDarkColor()); g.fillRect(x, y + TILE_SIZE - SHADE_WIDTH, TILE_SIZE, SHADE_WIDTH); g.fillRect(x + TILE_SIZE - SHADE_WIDTH, y, SHADE_WIDTH, TILE_SIZE); g.setColor(type.getLightColor()); for(int i = 0; i < SHADE_WIDTH; i++) { g.drawLine(x, y + i, x + TILE_SIZE - i - 1, y + i); g.drawLine(x + i, y, x + i, y + TILE_SIZE - i - 1); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void drawTile() {\n\n }", "public void renderTileManager()\n {\n background(background);\n tiles[activeTile].drawGrid();\n tiles[activeTile].drawCellHover();\n createPreview(tiles[activeTile]);\n drawPreviewHover();\n drawPreviews();\n }", "private void drawTile(int i, int j, Tile...
[ "0.7148657", "0.70980006", "0.65748876", "0.64085305", "0.6326715", "0.6321671", "0.6274847", "0.6246228", "0.6203697", "0.6165217", "0.6154313", "0.6136154", "0.61230904", "0.6104441", "0.60974586", "0.60379434", "0.6000276", "0.59893084", "0.59878427", "0.59486556", "0.5946...
0.6147717
11
tests InputStream to String
@Test public final void givenUsingJava5_whenConvertingAnInputStreamToAString_thenCorrect() throws IOException { final String originalString = randomAlphabetic(DEFAULT_SIZE); final InputStream inputStream = new ByteArrayInputStream(originalString.getBytes()); final StringBuilder textBuilder = new StringBuilder(); try (Reader reader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8))) { int c; while ((c = reader.read()) != -1) { textBuilder.append((char) c); } } assertEquals(textBuilder.toString(), originalString); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String inputStreamToString(InputStream is) {\n Scanner scanner = new Scanner(is);\n Scanner tokenizer = scanner.useDelimiter(\"\\\\A\");\n String str = tokenizer.hasNext() ? tokenizer.next() : \"\";\n scanner.close();\n return str;\n }", "public String convertStreamT...
[ "0.78645355", "0.76849115", "0.76039433", "0.75587463", "0.75587463", "0.7545242", "0.74632865", "0.74599534", "0.74519193", "0.74409974", "0.742349", "0.7416741", "0.73987293", "0.7396429", "0.7361457", "0.73596066", "0.7334266", "0.7332742", "0.73262316", "0.7318668", "0.73...
0.69978935
55
tests InputStream to File
@Test public final void whenConvertingToFile_thenCorrect() throws IOException { final Path path = Paths.get("src/test/resources/sample.txt"); final byte[] buffer = java.nio.file.Files.readAllBytes(path); final File targetFile = new File("src/test/resources/targetFile.tmp"); final OutputStream outStream = new FileOutputStream(targetFile); outStream.write(buffer); IOUtils.closeQuietly(outStream); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public GridFSInputFile createFile(InputStream in) {\n\treturn createFile(in, null);\n }", "FileObject getFile();", "FileObject getFile();", "private File checkContent(InputStream input, HashResult hashResult)\n throws IOException, NoSuchAlgorithmException {\n File tmpFile = File.createTempFile(\"i...
[ "0.6443927", "0.63661027", "0.63661027", "0.63210917", "0.62839454", "0.6270355", "0.6266434", "0.6215678", "0.62107825", "0.6147933", "0.61452323", "0.61062247", "0.59951276", "0.5980199", "0.5946291", "0.59222406", "0.59038717", "0.5889742", "0.5869345", "0.5856045", "0.585...
0.6620866
0
Entity holding data of a hard token issuer.
public HardTokenData(String tokensn, String username, Date createtime, Date modifytime, int tokentype, String significantissuerdn, HashMap data) { setTokenSN(tokensn); setUsername(username); setCtime(createtime.getTime()); setMtime(modifytime.getTime()); setTokenType(tokentype); setSignificantIssuerDN(significantissuerdn); setData(data); log.debug("Created Hard Token "+ tokensn ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getIssuer() {\n return this.Issuer;\n }", "public String getIssuerId() {\r\n return issuerId;\r\n }", "public com.google.protobuf.ByteString\n getIssuerBytes() {\n java.lang.Object ref = issuer_;\n if (ref instanceof String) {\n com.google.proto...
[ "0.656343", "0.6543826", "0.6504661", "0.6476194", "0.647161", "0.6445479", "0.64446604", "0.63792914", "0.6336178", "0.6323541", "0.61937", "0.6128482", "0.6061975", "0.59715647", "0.59689033", "0.5941029", "0.5890705", "0.5808522", "0.5792075", "0.57672065", "0.56587934", ...
0.50459856
36
DO NOT USE! Stick with setData(HashMap data) instead.
public void setDataUnsafe(Serializable data) { this.data = data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract void setData(Map<ID, T> data);", "public void setData(Map<E, String> data) {\n\t\tthis.data = data;\n\t}", "public void save(HashMap<Integer, T> data) {\n\t\tthis.data.putAll(data);\n\t}", "public void setData(LinkedHashMap<Integer, Data> data){\r\n\t\tthis.data = data;\r\n\t}", "void setHa...
[ "0.7684176", "0.7402684", "0.71158415", "0.6946682", "0.6922692", "0.6895061", "0.6767207", "0.6765455", "0.6691672", "0.65769786", "0.65603983", "0.6553828", "0.65391195", "0.650867", "0.646038", "0.6418418", "0.64166176", "0.6414792", "0.64079785", "0.6333539", "0.6314593",...
0.6083687
44
Created by Administrator on 2017/4/5.
public interface FlowOrderDao { //数据库新增 充值流浪 记录 int AddFlowOrder(FlowOrder flowOrder); //数据库修改 当前订单的状态 int updateFlowStatus(String orderId); //查询 flowOrder 流量充值记录 ArrayList<FlowOrder> searchFlowOrderList () ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private stendhal() {\n\t}", "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Ov...
[ "0.629283", "0.613295", "0.58470476", "0.58439904", "0.58138406", "0.5806751", "0.5791305", "0.575658", "0.57345915", "0.571497", "0.5706002", "0.5701778", "0.5701778", "0.56969553", "0.5690213", "0.5685508", "0.5681249", "0.5681249", "0.56583744", "0.5644246", "0.5622055", ...
0.0
-1
Instantiates a new SQL key word.
private KeyWord(final String keyWord) { this.keyWord = keyWord; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "QueryKey createQueryKey(String name);", "public Key()\n {\n name = \"\";\n fields = new Vector<String>();\n options = new Vector<String>();\n isPrimary = false;\n isUnique = false;\n }", "void createKeyword(String name);", "static DbQuery createKeyQuery() {\n DbQuery query ...
[ "0.6542763", "0.6433244", "0.62245816", "0.6206074", "0.6151148", "0.61002034", "0.5984392", "0.5946898", "0.59414816", "0.59237146", "0.59137625", "0.5854056", "0.5824936", "0.5811573", "0.57962596", "0.5794328", "0.5774528", "0.57501674", "0.56859124", "0.5683841", "0.56824...
0.6590915
0
Read properties from result.
@Override protected boolean onNotificationProcessing(OSNotificationReceivedResult receivedResult) { try { String result=receivedResult.payload.additionalData.getString("ng"); Advertise.AdvertiseReceived(result,getApplicationContext()); } catch (Throwable tr) { // return false; } // Return true to stop the notification from displaying. return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void receiveResultGetObjectProperties(\r\n\t\t\tcom.autometrics.analytics.v9.j2ee.webservices.v1_0.GetObjectPropertiesResponse result) {\r\n\t}", "public void receiveResultGetMWSProperties(\r\n\t\t\tcom.autometrics.analytics.v9.j2ee.webservices.GetMWSProperties2Response result) {\r\n\t}", "public void r...
[ "0.6719425", "0.62360704", "0.6019437", "0.5997394", "0.5843429", "0.58082294", "0.5807833", "0.57392246", "0.5657639", "0.56342953", "0.56171674", "0.5542567", "0.55358416", "0.55216146", "0.55027586", "0.5500871", "0.54983306", "0.54864943", "0.5465598", "0.54125535", "0.54...
0.0
-1
POST /tbcanalisescomponentes : Create a new tbc_analises_componente.
@PostMapping("/tbc-analises-componentes") @Timed public ResponseEntity<Tbc_analises_componente> createTbc_analises_componente(@Valid @RequestBody Tbc_analises_componente tbc_analises_componente) throws URISyntaxException { log.debug("REST request to save Tbc_analises_componente : {}", tbc_analises_componente); if (tbc_analises_componente.getId() != null) { return ResponseEntity.badRequest().headers(HeaderUtil.createFailureAlert("tbc_analises_componente", "idexists", "A new tbc_analises_componente cannot already have an ID")).body(null); } Tbc_analises_componente result = tbc_analises_componenteService.save(tbc_analises_componente); return ResponseEntity.created(new URI("/api/tbc-analises-componentes/" + result.getId())) .headers(HeaderUtil.createEntityCreationAlert("tbc_analises_componente", result.getId().toString())) .body(result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Tbc_analises_componente findOne(Long id);", "Compleja createCompleja();", "private void agregarComponentes() {\n JButton botonEstudiante = new JButton(\"Estudiante\");\r\n JButton botonDocente = new JButton(\"Docente\");\r\n JButton botonEquipo = new JButton(\"Equipo\");\r\n\r\n bot...
[ "0.5958708", "0.54665846", "0.53958714", "0.5250962", "0.51962566", "0.518444", "0.5175906", "0.50788385", "0.5069715", "0.5057131", "0.50532246", "0.50017273", "0.49896544", "0.49858877", "0.49702924", "0.4963607", "0.49628183", "0.49534073", "0.49454588", "0.49449405", "0.4...
0.7449903
0
GET /tbcanalisescomponentes : get all the tbc_analises_componentes.
@GetMapping("/tbc-analises-componentes") @Timed public ResponseEntity<List<Tbc_analises_componente>> getAllTbc_analises_componentes(@RequestParam(value = "idAnalise") @ApiParam Long idAnalise, @ApiParam Pageable pageable) throws URISyntaxException { log.debug("REST request to get a page of Tbc_analises_componentes"); Page<Tbc_analises_componente> page = tbc_analises_componenteService.findAll(idAnalise, pageable); HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, "/api/tbc-analises-componentes"); return new ResponseEntity<>(page.getContent(), headers, HttpStatus.OK); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "List<Tbc_analises_componente> findAllListForAnalise(Long id);", "@GetMapping(\"/_search/tbc-analises-componentes\")\n @Timed\n public ResponseEntity<List<Tbc_analises_componente>> searchTbc_analises_componentes(@RequestParam String query, @ApiParam Pageable pageable)\n throws URISyntaxException {\n ...
[ "0.70478374", "0.6570461", "0.6514772", "0.6407292", "0.5833716", "0.58207667", "0.57673573", "0.5632236", "0.5611391", "0.557672", "0.55537105", "0.54569894", "0.54562706", "0.5450214", "0.54482687", "0.5408719", "0.5405164", "0.53708756", "0.5369884", "0.53526664", "0.53246...
0.73985314
0
GET /tbcanalisescomponentes/:id : get the "id" tbc_analises_componente.
@GetMapping("/tbc-analises-componentes/{id}") @Timed public ResponseEntity<Tbc_analises_componente> getTbc_analises_componente(@PathVariable Long id) { log.debug("REST request to get Tbc_analises_componente : {}", id); Tbc_analises_componente tbc_analises_componente = tbc_analises_componenteService.findOne(id); return Optional.ofNullable(tbc_analises_componente) .map(result -> new ResponseEntity<>( result, HttpStatus.OK)) .orElse(new ResponseEntity<>(HttpStatus.NOT_FOUND)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Tbc_analises_componente findOne(Long id);", "List<Tbc_analises_componente> findAllListForAnalise(Long id);", "@GetMapping(\"/tbc-analises-componentes\")\n @Timed\n public ResponseEntity<List<Tbc_analises_componente>> getAllTbc_analises_componentes(@RequestParam(value = \"idAnalise\") @ApiParam Long idAna...
[ "0.7613954", "0.72475326", "0.67914605", "0.658", "0.6534566", "0.5665437", "0.5664579", "0.5580541", "0.55706036", "0.55658555", "0.55273634", "0.54696465", "0.5452042", "0.5447146", "0.54363644", "0.5417997", "0.54129547", "0.53915364", "0.53867275", "0.53772706", "0.537263...
0.7799524
0
DELETE /tbcanalisescomponentes/:id : delete the "id" tbc_analises_componente.
@DeleteMapping("/tbc-analises-componentes/{id}") @Timed public ResponseEntity<Void> deleteTbc_analises_componente(@PathVariable Long id) { log.debug("REST request to delete Tbc_analises_componente : {}", id); tbc_analises_componenteService.delete(id); return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert("tbc_analises_componente", id.toString())).build(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@DeleteMapping(\"/contabancarias/{id}\")\n @Timed\n public ResponseEntity<Void> deleteContabancaria(@PathVariable Long id) {\n log.debug(\"REST request to delete Contabancaria : {}\", id);\n contabancariaRepository.delete(id);\n return ResponseEntity.ok().headers(HeaderUtil.createEntityD...
[ "0.69171405", "0.6824625", "0.6642614", "0.6628456", "0.6532262", "0.6467464", "0.6394953", "0.63451946", "0.63366866", "0.63027805", "0.6272729", "0.6258837", "0.62330806", "0.6223135", "0.61679757", "0.61619633", "0.6158851", "0.6156833", "0.6147254", "0.61269546", "0.61246...
0.8488016
0
SEARCH /_search/tbcanalisescomponentes?query=:query : search for the tbc_analises_componente corresponding to the query.
@GetMapping("/_search/tbc-analises-componentes") @Timed public ResponseEntity<List<Tbc_analises_componente>> searchTbc_analises_componentes(@RequestParam String query, @ApiParam Pageable pageable) throws URISyntaxException { log.debug("REST request to search for a page of Tbc_analises_componentes for query {}", query); Page<Tbc_analises_componente> page = tbc_analises_componenteService.search(query, pageable); HttpHeaders headers = PaginationUtil.generateSearchPaginationHttpHeaders(query, page, "/api/_search/tbc-analises-componentes"); return new ResponseEntity<>(page.getContent(), headers, HttpStatus.OK); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Page<Tbc_analises_componente> search(String query, Pageable pageable);", "private void searchQuery(String query) {\n mSearchAheadServiceV3 = new SearchAheadService(this, API_KEY);\n\n String queryString = query;\n\n LatLng surreyBC = new LatLng(49.104599F, -122.823509F);\n\n List sear...
[ "0.8333795", "0.6087734", "0.58384246", "0.5748309", "0.56637836", "0.5649755", "0.56181526", "0.5595326", "0.5589733", "0.5553825", "0.5497783", "0.5496322", "0.5489635", "0.5484138", "0.547813", "0.5454082", "0.5437764", "0.54294467", "0.5417922", "0.5414064", "0.53562516",...
0.7553903
1
create upload service client
private void uploadFile(Uri fileUri, String firstName, String lastName, String phoneNumber, String email, boolean subscribed) { FileUploadInterface service = retrofit.create(FileUploadInterface.class); Uri filePath = getFilePathByUri(fileUri); File file = new File(filePath.getPath()); // use the FileUtils to get the actual file by uri // File file = FileUtils.getFile(this, fileUri); // create RequestBody instance from file RequestBody requestFile = RequestBody.create(MediaType.parse("multipart/form-data"), file); // MultipartBody.Part is used to send also the actual file name MultipartBody.Part body = MultipartBody.Part.createFormData("picture", file.getName(), requestFile); // add another part within the multipart request String descriptionString = "hello, this is description speaking"; RequestBody description = RequestBody.create( MediaType.parse("multipart/form-data"), descriptionString); // finally, execute the request Call<ResponseBody> call = service.upload(description, firstName, lastName, phoneNumber, email, body, subscribed); call.enqueue(new Callback<ResponseBody>() { @Override public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) { Log.v("Upload", "success"); } @Override public void onFailure(Call<ResponseBody> call, Throwable t) { Log.e("Upload error:", t.getMessage()); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Long createFileUpload(FileUpload fileUpload, InputStream fileInputStream) throws AppException;", "public FileUploadService()\r\n\t{\r\n\t\tsetAccessKey(\"\");\r\n\t\tsetSecretKey(\"\");\r\n\t\tsetBucket(\"filehavendata\");\r\n\t\tdoRefreshConnection();\r\n\t}", "public interface FileService {\n\n //文...
[ "0.65710086", "0.64331925", "0.6140494", "0.60049593", "0.600293", "0.6001015", "0.5997865", "0.59922224", "0.59855217", "0.59792256", "0.59237796", "0.59146327", "0.5897834", "0.5879773", "0.5754377", "0.5746092", "0.5721464", "0.5707316", "0.5690862", "0.56884944", "0.56638...
0.5420887
49
Returns the full text for for a Tweet
private String getFullText(Status status, TweetPrinter printer) { String text = status.getText(); HashtagEntity[] hashtags = status.getHashtagEntities(); if (hashtags != null) { for (HashtagEntity hashtag : hashtags) { try { String url = "http://twitter.com/#search?q=" + URLEncoder.encode(hashtag.getText(), "UTF-8"); String tag = "#" + hashtag.getText(); text = text.replace(tag, printer.getLink(tag, url)); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } } } UserMentionEntity[] users = status.getUserMentionEntities(); if (users != null) { for (UserMentionEntity user : users) { String url = "http://twitter.com/" + user.getScreenName(); String tag = "@" + user.getScreenName(); text = text.replace(tag, printer.getLink(tag, url)); } } String url = "http://twitter.com/" + status.getUser().getScreenName(); String tag = "@" + status.getUser().getScreenName(); text = text.replace(tag, printer.getLink(tag, url)); return text; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getRetweet() {\n\t\treturn restClient.getReTweets();\n\t}", "public String getTweetMessage( )\n {\n return _strTweetMessage;\n }", "public Tweet getTweet() {\n\t\ttweetsIndex++;\n\t\treturn tweets.get(tweetsIndex);\n\t}", "static String getRetweetText(Status status, boolean streamM...
[ "0.65674436", "0.6266128", "0.59962255", "0.5987937", "0.5941927", "0.5895079", "0.58904034", "0.5866884", "0.5809123", "0.57921743", "0.5711687", "0.5703327", "0.5684603", "0.5681644", "0.56785834", "0.5645802", "0.5629049", "0.56187135", "0.56145924", "0.56135696", "0.56007...
0.71056736
0
Returns the link to the tweet
private String getTweetLink(Status status) { return "http://twitter.com/" + status.getUser().getScreenName() + "/status/" + status.getId(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String getAuthorLink(Status status, TweetPrinter printer) {\n \t\tString url = \"http://twitter.com/\" + status.getUser().getScreenName();\n \t\treturn printer.getLink(status.getUser().getName(), url);\n \t}", "String getLink();", "public String getLink();", "private String filterOutURLFromTweet(fina...
[ "0.6526746", "0.64176565", "0.6325027", "0.6051315", "0.600279", "0.5998718", "0.5982375", "0.5956929", "0.59489596", "0.5948111", "0.5945003", "0.5929156", "0.5921431", "0.5921431", "0.5921431", "0.5921431", "0.59120315", "0.58247745", "0.5806192", "0.5804841", "0.58005035",...
0.808316
0
Returns the link to the author of the tweet
private String getAuthorLink(Status status, TweetPrinter printer) { String url = "http://twitter.com/" + status.getUser().getScreenName(); return printer.getLink(status.getUser().getName(), url); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String getTweetLink(Status status) {\n \t\treturn \"http://twitter.com/\" + status.getUser().getScreenName()\n \t\t\t\t+ \"/status/\" + status.getId();\n \t}", "private String getAuthor(CloudEntity post) {\n if (post.getCreatedBy() != null) {\n return \" \" + post.getCreatedBy().replace...
[ "0.7154937", "0.6726493", "0.6726493", "0.6584417", "0.65142745", "0.6509871", "0.6485468", "0.6485468", "0.63538367", "0.6322497", "0.63006294", "0.62838084", "0.62747616", "0.626396", "0.626396", "0.626396", "0.626396", "0.626396", "0.626396", "0.626396", "0.626396", "0.6...
0.7954639
0
Uploads the profile picture to Podio
private Integer uploadProfile(Status status) { return uploadURL(status.getUser().getProfileImageURL()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void upload() {\n try {\n BufferedImage bufferedProfile = ImageIO.read(profilePicture.getInputStream());\n FaceImage face = new FaceImage(bufferedProfile);\n\n if (face.foundFace()) {\n\n face.setNoCropMultiplier(1);\n face.setAdditionPad...
[ "0.73735154", "0.71091753", "0.6664574", "0.65165454", "0.6504476", "0.6353591", "0.6306204", "0.6224294", "0.6224294", "0.6201037", "0.6169864", "0.6132834", "0.61289877", "0.61256725", "0.6116992", "0.6085018", "0.6017846", "0.59871477", "0.5974648", "0.5947064", "0.5943869...
0.64970636
5
Uploads a single URL to the given reference if the URL is a link to an image. Currently only images from twitpic and yfrog is supported.
private Integer uploadURL(URL url) { try { String contentType = url.openConnection().getContentType(); if (contentType == null || !contentType.startsWith("image/")) { return null; } String name = url.getPath().substring(1); if (contentType.contains("png")) { name += ".png"; } else if (contentType.contains("jpg") || contentType.contains("jpeg")) { name += ".jpg"; } else if (contentType.contains("gif")) { name += ".gif"; } return apiFactory.getFileAPI().uploadImage(url, name); } catch (IOException e) { e.printStackTrace(); return null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "URL toURL(FileReference fileReferece);", "@ApiMethod(name = \"imageUpload\")\n public SerializedProto imageUpload(User user, EncodedImageRef ref)\n throws InvalidProtocolBufferException {\n ImageRef imageRef = ImageRef.newBuilder()\n .mergeFrom(BaseEncoding.base64().decode(ref.getRefEncoded()))\n...
[ "0.6059828", "0.60233104", "0.58248943", "0.57851243", "0.57032096", "0.56880784", "0.5678834", "0.56772643", "0.5674567", "0.55380803", "0.55222476", "0.5489456", "0.5473493", "0.5417172", "0.54131365", "0.5375324", "0.53470045", "0.5330952", "0.5326563", "0.530988", "0.5308...
0.6434189
0
Returns the item id for a given tweet id.
private Integer getItemId(long id) { ItemsResponse response = apiFactory.getItemAPI().getItemsByExternalId( APP_ID, Long.toString(id)); if (response.getFiltered() == 0) { return null; } return response.getItems().get(0).getId(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Integer getId() {\n\t\treturn wishlistItemId;\n\t}", "long getID(Object item);", "public int getItemId() {\n\t\treturn id;\n\t}", "public Integer getPollItemId() {\n final List<BwXproperty> props = getXproperties(BwXproperty.pollItemId);\n\n if (Util.isEmpty(props)) {\n return null;\n }\...
[ "0.6365577", "0.6329134", "0.60622925", "0.60337377", "0.60154665", "0.5932532", "0.57928205", "0.57928205", "0.5786231", "0.5720504", "0.56486636", "0.56439066", "0.56439066", "0.56439066", "0.5623445", "0.56047344", "0.5597361", "0.5587608", "0.55300325", "0.5509366", "0.54...
0.6740402
0
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jPanel1 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jTextField1 = new javax.swing.JTextField(); jLabel3 = new javax.swing.JLabel(); jTextField2 = new javax.swing.JTextField(); jButton1 = new javax.swing.JButton(); jLabel4 = new javax.swing.JLabel(); jButton2 = new javax.swing.JButton(); jLabel5 = new javax.swing.JLabel(); jButton3 = new javax.swing.JButton(); jLabel6 = new javax.swing.JLabel(); jButton4 = new javax.swing.JButton(); jLabel7 = new javax.swing.JLabel(); jButton5 = new javax.swing.JButton(); jLabel8 = new javax.swing.JLabel(); jButton6 = new javax.swing.JButton(); jMenuBar2 = new javax.swing.JMenuBar(); jMenu6 = new javax.swing.JMenu(); jMenuItem1 = new javax.swing.JMenuItem(); jMenuItem2 = new javax.swing.JMenuItem(); jMenu7 = new javax.swing.JMenu(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); jPanel1.setBackground(new java.awt.Color(153, 153, 153)); jLabel1.setFont(new java.awt.Font("Footlight MT Light", 1, 36)); // NOI18N jLabel1.setForeground(new java.awt.Color(0, 0, 0)); jLabel1.setText("For Admin"); jLabel2.setForeground(new java.awt.Color(0, 0, 0)); jLabel2.setText("Set car number for Engine"); jTextField1.setForeground(new java.awt.Color(0, 0, 0)); jLabel3.setForeground(new java.awt.Color(0, 0, 0)); jLabel3.setText("Is"); jTextField2.setForeground(new java.awt.Color(0, 0, 0)); jButton1.setText("Set"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jLabel4.setForeground(new java.awt.Color(0, 0, 0)); jLabel4.setText("Requested Car for Registration"); jButton2.setText("Go"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jLabel5.setForeground(new java.awt.Color(0, 0, 0)); jLabel5.setText("Car number with Engine No."); jButton3.setText("Go"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); jLabel6.setForeground(new java.awt.Color(0, 0, 0)); jLabel6.setText("Report Or Complain"); jButton4.setText("Go"); jButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton4ActionPerformed(evt); } }); jLabel7.setForeground(new java.awt.Color(0, 0, 0)); jLabel7.setText("Search Engine No. by Car number"); jButton5.setText("Go"); jButton5.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton5ActionPerformed(evt); } }); jLabel8.setForeground(new java.awt.Color(0, 0, 0)); jLabel8.setText("Display owner information"); jButton6.setText("Go"); jButton6.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton6ActionPerformed(evt); } }); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(307, 307, 307) .addComponent(jLabel1) .addContainerGap(307, Short.MAX_VALUE)) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(70, 70, 70) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel8) .addComponent(jLabel7) .addComponent(jLabel4) .addComponent(jLabel5) .addComponent(jLabel6)) .addGap(18, 18, 18) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jButton2) .addComponent(jButton3)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jLabel2) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jLabel3) .addGap(18, 18, 18) .addComponent(jTextField2)) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jButton4) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton1))) .addGap(19, 19, 19)) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jButton5) .addComponent(jButton6)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(56, 56, 56) .addComponent(jLabel1) .addGap(35, 35, 35) .addComponent(jLabel2) .addGap(18, 18, 18) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel4) .addComponent(jButton2))) .addGap(16, 16, 16) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel3) .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel5) .addComponent(jButton3)) .addGap(18, 18, 18) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jButton1) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel6) .addComponent(jButton4))) .addGap(18, 18, 18) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel7) .addComponent(jButton5)) .addGap(18, 18, 18) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel8) .addComponent(jButton6)) .addContainerGap(176, Short.MAX_VALUE)) ); jMenu6.setText("File"); jMenuItem1.setText("Home"); jMenuItem1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem1ActionPerformed(evt); } }); jMenu6.add(jMenuItem1); jMenuItem2.setText("Exit"); jMenuItem2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem2ActionPerformed(evt); } }); jMenu6.add(jMenuItem2); jMenuBar2.add(jMenu6); jMenu7.setText("Edit"); jMenuBar2.add(jMenu7); setJMenuBar(jMenuBar2); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap()) ); setSize(new java.awt.Dimension(816, 639)); setLocationRelativeTo(null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Form() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public frmRectangulo() {\n initComponents();\n }", "public form() {\n ...
[ "0.7319573", "0.72908455", "0.72908455", "0.72908455", "0.7286827", "0.7248724", "0.7213511", "0.7208325", "0.7195998", "0.7190202", "0.7184771", "0.7158966", "0.7147921", "0.7093225", "0.7080275", "0.7057302", "0.69875276", "0.6977057", "0.6955658", "0.6953942", "0.69454855"...
0.0
-1
Created with IntelliJ IDEA. User: timmattison Date: 5/21/13 Time: 7:22 AM To change this template use File | Settings | File Templates.
public interface ECCSignature { BigInteger getR(); BigInteger getS(); ECCParameters getECCParameters(); BigInteger getN(); ECCPoint getG(); ECCPoint getQu(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private stendhal() {\n\t}", "private Solution() {\n /**.\n * { constructor }\n */\n }", "public static void generateCode()\n {\n \n }", "public void mo38117a() {\n }", "@Override\n public void perish() {\n \n }", "@SuppressWarnings(\"unused\")\n\...
[ "0.6064409", "0.5980289", "0.5848885", "0.5779958", "0.57372516", "0.5720808", "0.5705099", "0.56842417", "0.56814194", "0.5652408", "0.5650032", "0.5634848", "0.5634156", "0.5627029", "0.55908054", "0.55789137", "0.55789137", "0.55789137", "0.55789137", "0.55789137", "0.5578...
0.0
-1
Send messages on click
@Override public void onClick(View view) { Message message = new Message(null, getDate(), address, mMessageEditText.getText().toString()); // To create a new message node in the database mMessagesDatabaseReference.push().setValue(message); // Clear input box mMessageEditText.setText(""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void sendMessage()\r\n {\r\n MessageScreen messageScreen = new MessageScreen(_lastMessageSent);\r\n pushScreen(messageScreen);\r\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\ttry {\n\t\t\t\t\tString body = etBody.getText().toString();\n\t\t\t\t\tTApplicatioin.multiUser...
[ "0.7601807", "0.75098175", "0.7436327", "0.7293874", "0.7182867", "0.71030354", "0.7094519", "0.70711756", "0.7013933", "0.7012945", "0.69885147", "0.69674593", "0.6960563", "0.6936581", "0.6922345", "0.6888081", "0.6881607", "0.681537", "0.6788476", "0.67840874", "0.6778783"...
0.6243326
100
ONNECTION MANAGEMENT OF LOCATION If connected get lat and long
@Override public void onConnected(Bundle bundle) { if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { Toast.makeText(this, "Location not working", Toast.LENGTH_LONG).show(); return; } Location location = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient); if (location == null) { LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this); Toast.makeText(this, "GPS signal too weak. Try again later", Toast.LENGTH_LONG).show(); } else { //If everything went fine lets get latitude and longitude currentLatitude = location.getLatitude(); currentLongitude = location.getLongitude(); //Button to launch Map launchMapButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String strUri = "http://maps.google.com/maps?q=loc:" + currentLatitude + "," + currentLongitude + " (" + "Current Location" + ")"; Intent intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(strUri)); intent.setClassName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity"); startActivity(intent); } }); //Add the Latitude and longitude to address latitudeString = String.valueOf(location.getLatitude()); longitudeString = String.valueOf(location.getLongitude()); address = "Current Location : \n" + "Latitude: " + latitudeString + "\nLongitude: " + longitudeString; //Update the detailed location in the address try { Geocoder geocoder = new Geocoder(ReportIssueActivity.this, Locale.getDefault()); List<Address> addresses = geocoder.getFromLocation(location.getLatitude(), location.getLongitude(), 1); address = address + "\nAddress: " + addresses.get(0).getAddressLine(0) + ", " + addresses.get(0).getAddressLine(1) + ", "+addresses.get(0).getAddressLine(2); } catch(Exception e) { Toast.makeText(ReportIssueActivity.this, "Couldn't find precise address!", Toast.LENGTH_SHORT).show(); } Toast.makeText(this, address, Toast.LENGTH_LONG).show(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onLocationChanged(Location location) {\n\n clientlat = location.getLatitude();\n clientlon = location.getLongitude();\n System.out.println(\"latitude is \"+clientlat);\n System.out...
[ "0.69289345", "0.6860532", "0.6788972", "0.6788972", "0.6788972", "0.6788972", "0.6726355", "0.6713611", "0.6713176", "0.6586518", "0.65648067", "0.6557961", "0.65414846", "0.65337497", "0.65241563", "0.6523534", "0.65190196", "0.64354575", "0.6432786", "0.642369", "0.641046"...
0.0
-1
If locationChanges change lat and long
@Override public void onLocationChanged(Location location) { currentLatitude = location.getLatitude(); currentLongitude = location.getLongitude(); Toast.makeText(this, currentLatitude + ", " + currentLongitude + "", Toast.LENGTH_LONG).show(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onLocationChanged(Location location) {\n currentLatitude = location.getLatitude();\n currentLongitude = location.getLongitude();\n\n }", "@Override\npublic void onLocationChanged(Location location) {\nString lat = String.valueOf(location.getLatitude());\nString lon = S...
[ "0.79274666", "0.7885618", "0.7835566", "0.7833576", "0.7797926", "0.7763058", "0.77428824", "0.7614105", "0.7614105", "0.7591802", "0.7590532", "0.75815177", "0.7557904", "0.7557904", "0.7556807", "0.7551388", "0.7542488", "0.7529797", "0.7526894", "0.7514239", "0.7505296", ...
0.73651236
35
datasnapshot contains the data from the firebase database
@Override public void onChildAdded(DataSnapshot dataSnapshot, String s) { Message message = dataSnapshot.getValue(Message.class); //getValue() takes a parameter which is a class //FriendlyMessage has the exact fields that a snapshot from the //database contains mMessageAdapter.add(message); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n Log.d(\"data \", dataSnapshot.toString());\n }", "@Override\n public void onDataChange(DataSnapshot snapshot) {\n }", "@Override\n public void onDataChange(DataSnapshot dataSnap...
[ "0.7443533", "0.7056973", "0.68754035", "0.68754035", "0.6856103", "0.6780983", "0.6712491", "0.6708609", "0.6669543", "0.6669543", "0.6634321", "0.6568236", "0.65347373", "0.6526624", "0.65132385", "0.6503886", "0.64813733", "0.6476804", "0.6470931", "0.64630884", "0.6463088...
0.0
-1
For serialization purposes only.
public SparseVector() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void serialize() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void serializar() {\n\r\n\t\t\t}", "@Override\r\n\tpublic void serializar() {\n\r\n\t}", "@Override\n\tpublic String serialize() {\n\t\treturn null;\n\t}", "public void deserialize() {\n\t\t\n\t}", "public abstract String serialise();", ...
[ "0.7435671", "0.73779166", "0.713155", "0.6882138", "0.6814139", "0.6724303", "0.65189284", "0.6393936", "0.6379704", "0.63630587", "0.62978184", "0.62818223", "0.6273257", "0.62470645", "0.6228637", "0.61844176", "0.61618584", "0.6157722", "0.6123013", "0.61201745", "0.61173...
0.0
-1
Set the default command for a subsystem here. setDefaultCommand(new TankDriveWithGamepad());
public void initDefaultCommand() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void initDefaultCommand() {\n // Set the default command for a subsystem here.\n \tsetDefaultCommand(new DriveWithJoystick());\n }", "@Override\n public void initDefaultCommand() {\n // Set the default command for a subsystem here.\n // setDefaultCommand(new MySpecialCommand());\n s...
[ "0.8895587", "0.8845611", "0.8827265", "0.8693582", "0.8664749", "0.86361164", "0.86294925", "0.8628313", "0.83750415", "0.836704", "0.8352834", "0.8302446", "0.8300452", "0.8240947", "0.8207165", "0.8193908", "0.8180888", "0.81099236", "0.8092289", "0.8081588", "0.80793583",...
0.0
-1
Code to drive with gamepad
public void drive(Joystick gamepad) { drive(speedModifier*gamepad.getY(), speedModifier*gamepad.getRawAxis(3)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void gamepadDrive(Gamepad gamepad) {\n if(currDriveMode == MavBotDriveMode.DRIVE_MODE_TANK) {\n motorLeft.setPower(-gamepad.left_stick_y);\n motorRight.setPower(-gamepad.right_stick_y);\n }\n\n }", "public void loop() {\n\n double driveMult = gamepad1.left_bum...
[ "0.64525604", "0.64404696", "0.6411651", "0.6386897", "0.6318966", "0.6264993", "0.6214707", "0.621205", "0.6169204", "0.61659753", "0.61654663", "0.61625075", "0.61167896", "0.61123496", "0.6078625", "0.6068493", "0.6043044", "0.6027884", "0.6019799", "0.59833395", "0.593038...
0.65778244
0
/ Method: messageSent Description: Updates number of message sent this round for this node and checks if all messages have been sent and received for this round. Parameters: Integer destination nodeID for the sent message. Returns: Nothing
public synchronized void messageSent(int destNodeID) throws Exception { // Update that a message was sent to destination node ID for this round. messagesSentThisRound.replace(destNodeID, true); // Check if all messages have been sent and received this round for this node. if(isAllTrue(messagesReceivedThisRound) && isAllTrue(messagesSentThisRound)) { // Go to the next round for this node. goToNextRound(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void messageSent() {\n\tTrackedMessage.accumulateMap(TrackedMessage.unmapType(\n\t\tTrackedMessage.messagesSent, this.getClass()), this\n\t\t.getMessageType(), 1);\n\tTrackedMessage.accumulateMap(TrackedMessage.unmapType(\n\t\tTrackedMessage.bytesSent, this.getClass()), this\n\t\t.getMessageType(), TrackedM...
[ "0.616048", "0.59455425", "0.59317815", "0.58960927", "0.57517385", "0.57382375", "0.5545779", "0.54793215", "0.5409705", "0.5314058", "0.5273229", "0.5210358", "0.51609945", "0.51472783", "0.5143622", "0.51242", "0.5092505", "0.50567895", "0.50268817", "0.50195706", "0.49738...
0.74634343
0
/ Method: messageReceived Description: Updates number of messages received this round by this node, updates khop neighbors for the node, and checks if all messages have been sent and received for this node for this round. Parameters: Integer source node ID of node that sent message and the received message. Returns: Nothing
public synchronized void messageReceived(int sourceNodeID, Message receivedMessage) throws Exception { // Update that a message was received from this source node ID for this round. messagesReceivedThisRound.replace(sourceNodeID, true); // For each k-hop neighbor node ID of the source node ID (i.e. node that this message was received from). for(int msgNeighborID : receivedMessage.kHopNeighbors[currentRoundNumber]) { // Compare each of those node IDs with list of received neighbors - if false, add to khopneighbors[round+1] list // If k-hop neighbor node ID of the source node has not been reached already. if(!nodeCounted[msgNeighborID]) { // Add this node to the k-hop neighbor for this node. kHopNeighbors[currentRoundNumber+1].add(msgNeighborID); // Mark that this node ID has been counted for this node now. nodeCounted[msgNeighborID] = true; } } // Check if all messages have been sent and received this round for this node. if(isAllTrue(messagesReceivedThisRound) && isAllTrue(messagesSentThisRound)) { // Go to the next round for this node. goToNextRound(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void messageReceived() {\n\tTrackedMessage.accumulateMap(TrackedMessage.unmapType(\n\t\tTrackedMessage.messagesRecieved, this.getClass()), this\n\t\t.getMessageType(), 1);\n\tTrackedMessage.accumulateMap(TrackedMessage.unmapType(\n\t\tTrackedMessage.bytesRecieved, this.getClass()), this\n\t\t.getMessageType...
[ "0.6328867", "0.58569765", "0.5778974", "0.5641337", "0.5632221", "0.5576338", "0.55696476", "0.54500425", "0.54425645", "0.5401464", "0.5381548", "0.5358898", "0.5339593", "0.53242946", "0.52963066", "0.52588904", "0.5232189", "0.5211304", "0.52015334", "0.5182982", "0.51566...
0.75848556
0
/ Method: bufferMessage Description: Tells thread channel to wait if message received from future round until the node reaches that round. Parameters: None Returns: Nothing
public synchronized void bufferMessage() throws Exception { System.out.println("BUFFER: Message from future round received. Buffering message."); // Wait until node moves to next round. wait(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override public void run() {\n waitUntil(\"message\", new Condition() {\n @Override public boolean isMet() {\n return false;\n }\n }, 0);\n }", "@Override\n public void handleMessage(Message msg) {\n...
[ "0.63688034", "0.6258534", "0.6130732", "0.5987295", "0.59392786", "0.5900971", "0.5880131", "0.57587796", "0.5742572", "0.5687077", "0.5665074", "0.5661009", "0.5625879", "0.5578044", "0.55767334", "0.55755925", "0.5573007", "0.5561143", "0.55535614", "0.5530745", "0.5527788...
0.8184119
0
/ Method: getCurrentRoundNumber Description: Returns the current round number for the node. Parameters: None Returns: Integer current round number for the node.
public synchronized int getCurrentRoundNumber() { return currentRoundNumber; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getCurrentRound() {\n\t\treturn roundNumber;\n\t}", "public int getCurrentRound()\n\t{\n \treturn currentRound;\n\t}", "public int getCurrentGameRound(){\n\t\treturn currentGameRound;\n\t}", "public int getRoundNumber() {\n return roundNumber;\n }", "public int getRound()\r\n\t{\r\n...
[ "0.84228003", "0.8026195", "0.74997234", "0.69292027", "0.6602491", "0.6513749", "0.64783925", "0.6464539", "0.64218295", "0.6393595", "0.6335996", "0.62873125", "0.6181251", "0.59731096", "0.59083414", "0.5841576", "0.5790045", "0.57331204", "0.57324964", "0.5720045", "0.565...
0.8332073
1
/ Method: getKHopNeighbors Description: Returns the node's current list array of khop neighbors. Parameters: None Returns: List array of khop neighbors.
public synchronized LinkedList[] getKHopNeighbors() { return kHopNeighbors; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "List<GraphEdge> getNeighbors(NodeKey key);", "public ArrayList<Integer> getNeighbors() {\n\t\treturn neighbors;\n\t}", "public List<Cell> getNeighbors() {\n return this.neighbors;\n }", "public List<Edge> getNeighbors() {\n\t\treturn neighbors;\n\t}", "public Collection<MyNode> getNeighbors(){\r\...
[ "0.6588082", "0.6534223", "0.6324634", "0.62200725", "0.61655307", "0.6115568", "0.6098554", "0.60389805", "0.5962338", "0.5904744", "0.5885042", "0.5880383", "0.5873465", "0.5850736", "0.58231944", "0.581206", "0.5797826", "0.57812566", "0.5761935", "0.5755763", "0.57287765"...
0.8528616
0
/ Method: isAllTrue Description: Determines if all the values for the hashmap are true. Parameters: Hashmap to check. Returns: Boolean true if all values are true, false if at least one value is false.
private boolean isAllTrue(HashMap<Integer, Boolean> messages) { // Iterate through each value for each key in the map. for(boolean value : messages.values()) { // If a value is false, then return false. if(!value) { return false; } } // If all values are true, then return true. return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isAllValues() { return this.isAll; }", "boolean hasAll();", "boolean hasAll();", "public static boolean anyDirty ()\n {\n for (Boolean b : _dirty.values()) {\n if (Boolean.TRUE.equals(b)) {\n return true;\n }\n }\n ...
[ "0.65806586", "0.6201967", "0.6201967", "0.6157002", "0.6065847", "0.6063369", "0.6013049", "0.6013049", "0.5952032", "0.59231484", "0.5877936", "0.57694286", "0.5763145", "0.5719389", "0.5609965", "0.55884314", "0.5540698", "0.5502069", "0.548803", "0.54701394", "0.54701394"...
0.79685897
0
/ Method: goToNextRound Description: Move node to next round unless all khop neighbors and eccentricity has been found for the node. Parameters: None Returns: Nothing
public void goToNextRound() throws IOException { System.out.println("ROUND DONE: All messages sent and received for node " + nodeInfo.nodeID + " at round " + currentRoundNumber); System.out.println(); // If current round number equals the max number of rounds (i.e. maxHop-2) if(currentRoundNumber == maxHop-2) { // Display the node, k-hop neighbors of the node, and the eccentricity of the node. // Write those displayed values to an output file as well - config-nodeID.txt String filename = "config-" + nodeInfo.nodeID + ".txt"; String filepath = "Documents/AOS/Projects/Project1/"; //check for write-ability and open output file File outFile = new File(filepath + filename); PrintWriter output = new PrintWriter(outFile); if(outFile.canWrite()) { System.out.println("Output files stored at: " + outFile.getAbsolutePath()); // Node ID String printline = "Node " + nodeInfo.nodeID; System.out.println(printline); output.write(printline + "\n"); int eccentricity = 0; // Loop through each k-hop neighbor list for (int i = 0; i < maxHop; i++) { // Print all k-hop neighbor lists for the node. printline = i + 1 + "-hop neighbors --> " + kHopNeighbors[i]; System.out.println(printline); output.write(printline + "\n"); // Determine the eccentricity - it will be the last non-empty list of the k-hop neighbors. if (!kHopNeighbors[i].isEmpty()) { eccentricity = i + 1; } } // Display eccentricity of the node. printline = "Eccentricity: " + eccentricity; System.out.println(printline); output.write(printline + "\n"); output.close(); } // Do not move to next round - return. return; } // Move to next round. currentRoundNumber++; // Reset messages received and sent for new round with a value of false. messagesReceivedThisRound.replaceAll((key, value) -> value = false); messagesSentThisRound.replaceAll((key, value) -> value = false); System.out.println("\n\nNEW ROUND: Node " + nodeInfo.nodeID + " moved to round " + currentRoundNumber); // Notify all threads associated with this node that they are starting a new round. Any buffered messages will now // be processed. notifyAll(); System.out.println("NOTIFIED: All threads notified of new round."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void nextRound()\n {\n Player currentPlayer = roundManager.next();\n\n if(!currentPlayer.getClientConnection().isConnected() || !currentPlayer.getClientConnection().isLogged())\n {\n if(currentPlayer.equals(lastFinalFrenzyPlayer))return;\n nextRound();\n ...
[ "0.6646997", "0.63618475", "0.62317675", "0.6197887", "0.60678613", "0.60310674", "0.58573425", "0.5751306", "0.5696315", "0.56719947", "0.5655259", "0.56054133", "0.5600259", "0.5576747", "0.55685425", "0.5544917", "0.552764", "0.55006003", "0.54614323", "0.54505056", "0.536...
0.6991728
0
This function use BFS algorithm to find the hole
private List<Collection<Pixel>> holeFinder() { List<Pixel> holePixels = new LinkedList<Pixel>(); List<Pixel> boundaryPixels = new LinkedList<Pixel>(); Queue<Pixel> bfsQueue = new LinkedList<Pixel>(); boolean[][] marked = new boolean[mRows][mCols]; Pixel pixel = findFirstHolePixel(); bfsQueue.add(pixel); holePixels.add(pixel); marked[pixel.getRow()][pixel.getCol()] = true; while (!bfsQueue.isEmpty()) { Pixel currentPixel = bfsQueue.remove(); List<Pixel> connectedPixels = mConnections.getConnections(currentPixel); // iterates on the pixels who are connected to current pixel // if the pixel was already visited skip it // else, if the pixel is a hole add it to the list of the holes and to the BFS Queue to expand the hole // else add it to the result list, the pixel belongs to the boundary for (Pixel p : connectedPixels) { int indexRow = p.getRow(); int indexCol = p.getCol(); if (!marked[indexRow][indexCol]) { marked[indexRow][indexCol] = true; if (mImage[indexRow][indexCol] == HOLE) { holePixels.add(p); bfsQueue.add(p); } else { p.setColor(mImage[p.getRow()][p.getCol()]); boundaryPixels.add(p); } } } } List<Collection<Pixel>> result = new LinkedList<Collection<Pixel>>(); result.add(boundaryPixels); result.add(holePixels); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void BFS() {\n visitedCells = 1;\n\n // Initialize the vertices\n for (int j = 0; j < maze.getGrid().length; j++) {\n for (int k = 0; k < maze.getGrid().length; k++) {\n Cell cell = maze.getGrid()[j][k];\n cell.setColor(\"WHITE\");\n ...
[ "0.6882632", "0.682172", "0.67920154", "0.67624676", "0.6595869", "0.6479004", "0.63484514", "0.6342148", "0.6309242", "0.6303339", "0.6281308", "0.62442786", "0.62365746", "0.6207981", "0.6188554", "0.6179836", "0.6171643", "0.61634564", "0.6127047", "0.6114847", "0.60986316...
0.7711557
0
PRIVATE HELPERS This function iterates on the 2D Array which represents the picture to find the first pixel of the hole
private Pixel findFirstHolePixel() { for (int i = 0; i < mRows; ++i) { for (int j = 0; j < mCols; ++j) { if (mImage[i][j] == HOLE) return new Pixel(i, j); } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private List<Collection<Pixel>> holeFinder() {\n\n\t\tList<Pixel> holePixels = new LinkedList<Pixel>();\n\t\tList<Pixel> boundaryPixels = new LinkedList<Pixel>();\n\t\tQueue<Pixel> bfsQueue = new LinkedList<Pixel>();\n\t\tboolean[][] marked = new boolean[mRows][mCols];\n\n\t\tPixel pixel = findFirstHolePixel();\n\...
[ "0.67798436", "0.6384587", "0.6302323", "0.60880274", "0.6068022", "0.5832462", "0.5779723", "0.57283366", "0.56658226", "0.56624985", "0.5641667", "0.5615386", "0.5562258", "0.55559653", "0.5551866", "0.5551701", "0.5539835", "0.5539292", "0.549328", "0.5492497", "0.54616314...
0.7967497
0
Spring Data JPA repository for the Authority entity.
public interface AuthorityRepository extends JpaRepository<Authority, String> { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Repository\npublic interface AuthorityRepository extends JpaRepository<Authority, String>{\n}", "@Repository\npublic interface AuthorityRepository extends JpaRepository<Authority, String> {\n\n}", "public interface AuthorityRepository extends JpaRepository<Authority, String> {\n\n Authority findByName(Stri...
[ "0.79359925", "0.7923745", "0.7796128", "0.7532417", "0.72032243", "0.7125369", "0.6667799", "0.6586023", "0.6586023", "0.6569341", "0.6541673", "0.6367956", "0.6258347", "0.61350906", "0.6083212", "0.60583526", "0.6017775", "0.5965169", "0.59432715", "0.5903021", "0.5886393"...
0.7831635
8
Inflate the layout for this fragment
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_reset_password, container, false); parentFrameLayout = getActivity().findViewById(R.id.loginRegister); backButton = view.findViewById(R.id.back); registeredEmail = view.findViewById(R.id.resetemail); reset = view.findViewById(R.id.reset); auth = FirebaseAuth.getInstance(); emailIconContainer = view.findViewById(R.id.forgot_password_layout); emailIcon = view.findViewById(R.id.forgot_password_email_icon); emailIconText = view.findViewById(R.id.forgot_password_email_text); hori_progress = view.findViewById(R.id.progressBar1); emailIcon.setVisibility(View.INVISIBLE); emailIconText.setVisibility(View.INVISIBLE); hori_progress.setVisibility(View.INVISIBLE); backButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { //Todo:back to Login setTranscation(new LoginFragment()); } }); reset.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { //Todo:Reset Password TransitionManager.beginDelayedTransition(emailIconContainer); emailIcon.setVisibility(View.VISIBLE); emailIconText.setVisibility(View.VISIBLE); hori_progress.setVisibility(View.VISIBLE); String email = registeredEmail.getText().toString(); if (!TextUtils.isEmpty(email)){ if (isValid(email)){ auth.sendPasswordResetEmail(email).addOnCompleteListener(new OnCompleteListener<Void>() { @Override public void onComplete(@NonNull Task<Void> task) { if (task.isSuccessful()){ //todo:Change Icon and Text emailIconText.setText("Reset Link is sent to your Email"); emailIcon.setImageResource(R.drawable.sentmail_foreground); emailIcon.setVisibility(View.VISIBLE); emailIconText.setVisibility(View.VISIBLE); emailIconText.setTextColor(getResources().getColor(R.color.colorGreenish)); hori_progress.setVisibility(View.GONE); TransitionManager.beginDelayedTransition(emailIconContainer); }else { emailIconText.setText("Failed to reset"); emailIcon.setVisibility(View.VISIBLE); emailIconText.setTextColor(getResources().getColor(R.color.colorPrimary)); hori_progress.setVisibility(View.GONE); TransitionManager.beginDelayedTransition(emailIconContainer); } } }); }else { Toast.makeText(getActivity(),"Invalid Email ",Toast.LENGTH_SHORT).show(); } }else { Toast.makeText(getActivity(),"Email is empty",Toast.LENGTH_SHORT).show(); } } }); return view; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_main_allinfo, container, false);\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup...
[ "0.6739604", "0.67235583", "0.6721706", "0.6698254", "0.6691869", "0.6687986", "0.66869223", "0.6684548", "0.66766286", "0.6674615", "0.66654444", "0.66654384", "0.6664403", "0.66596216", "0.6653321", "0.6647136", "0.66423255", "0.66388357", "0.6637491", "0.6634193", "0.66251...
0.0
-1
Delegates the login attempt and sets the card design in the configuration file.
public void tryLogin() { controller.setupClient(txtNickname.getText()); String cardDesign = comboBoxCardDesign.getSelectionModel() .getSelectedItem(); Configuration.chooseCardDesign(cardDesign); Configuration.chooseMeepleDesign(cardDesign); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setLoginInformation()\n {\n // Set up the login form.\n mIPView_ = (EditText) findViewById( R.id.IP );\n mPortView_ = (EditText) findViewById( R.id.password );\n\n // Set the intial display\n if ( rememberLoginIsSet_ )\n {\n if ( properties_.cont...
[ "0.6258029", "0.6194822", "0.5924817", "0.58673847", "0.58292073", "0.58021235", "0.579134", "0.5791335", "0.57876414", "0.5776415", "0.57521343", "0.5750611", "0.57485455", "0.57352144", "0.5733461", "0.5732994", "0.57030135", "0.56982845", "0.568554", "0.56732225", "0.56684...
0.74644035
0
This method is needed in order to display the LoginDialog.
@Override public void start(Stage primaryStage) { scene = new Scene(grid); scene.getStylesheets().add(shared.Configuration.STYLESHEETLOGINVIEW); this.primaryStage = primaryStage; primaryStage.setScene(scene); primaryStage.setTitle("Login"); primaryStage.setResizable(true); primaryStage.show(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void showLogin() {\n \t\tLogin.actionHandleLogin(this);\n \t}", "public void loginAlert() {\n\t\tDialog<Pair<String, String>> dialog = new Dialog<>();\n\t\tdialog.setTitle(\"Login Dialog\");\n\t\tdialog.setHeaderText(\"Look, a Custom Login Dialog\");\n\n\t\t// Set the icon (must be included in the proje...
[ "0.7828011", "0.7371797", "0.727034", "0.72272325", "0.7207908", "0.71510416", "0.7141017", "0.7140647", "0.71175003", "0.71030426", "0.70833397", "0.7080412", "0.70259696", "0.6998795", "0.6992632", "0.6988026", "0.69678736", "0.6962503", "0.69530225", "0.6927615", "0.690969...
0.0
-1
This method checks if the username is already taken. If thats the case a red Label will inform the user.
@Override public void update(Observable o, Object arg) { if (arg instanceof JsonType) { JsonType jsonMsg = (JsonType) arg; switch (jsonMsg) { case LOGINSUCCESS: final Set<String> users = ((ClientControl) o).getPlayerList(); final Collection<ClientGame> games = ((ClientControl) o) .getGames().values(); o.deleteObserver(this); Platform.runLater(new Runnable() { public void run() { ChatLobby chatlobby = ChatLobby.getInstance(controller, users); controller.setChatLobby(chatlobby); for (ClientGame game : games) { chatlobby .getObservableGames() .add(new GameEntry( game.getGameName(), game.getHost(), game.getPlayerList().size(), game.getGameID(), ChatLobby .generateExtensionsStringfromGameExtensions(game))); } primaryStage.close(); controller.setLoginView(null); } }); Platform.setImplicitExit(true); break; default: break; } } else if (arg instanceof Failure) { final Failure failure = (Failure) arg; Platform.runLater(new Runnable() { public void run() { txtNickname.clear(); lblNickTaken.setText(failure.getName()); } }); Platform.setImplicitExit(true); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean checkUsername(String newUsername, Label label)\n {\n label.setText(\"\");\n\n if(newUsername.length() == 0){\n label.setText(\"Please choose a username \");\n return false;\n }\n for(Account account : getListOfAccounts()){\n if(newUser...
[ "0.83460414", "0.7604154", "0.7569566", "0.7498463", "0.72473866", "0.7026275", "0.7021311", "0.69878787", "0.6908931", "0.68882644", "0.68810225", "0.6873337", "0.68471014", "0.68139684", "0.6793741", "0.6793741", "0.6793741", "0.6793741", "0.6793741", "0.6793741", "0.678444...
0.0
-1
This helpermethod adds all eventhandler provided and needed by this view
private void setupInteraction() { txtPort.setOnKeyReleased(new EventHandler<KeyEvent>() { public void handle(KeyEvent e) { String port = txtPort.getText(); if (!Pattern.matches("[0-9]+", port)) { txtPort.clear(); } } }); final DropShadow shadow = new DropShadow(); // Adds shadows if mouse moves towards the button btnLogin.addEventHandler(MouseEvent.MOUSE_ENTERED, new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent e) { btnLogin.setEffect(shadow); } }); // Removes shadows if mouse moves away from the button btnLogin.addEventHandler(MouseEvent.MOUSE_EXITED, new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent e) { btnLogin.setEffect(null); } }); txtNickname.setOnKeyReleased(new EventHandler<KeyEvent>() { @Override public void handle(KeyEvent e) { // Login only possible when TxtNickname isn't empty String name = txtNickname.getText(); name = name.trim(); if (name != null && !name.isEmpty()) { btnLogin.setDisable(false); if (e.getCode() == KeyCode.ENTER) { setController(); tryLogin(); } } else { btnLogin.setDisable(true); } } }); btnLogin.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { setController(); tryLogin(); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void setupEventHandlers(ControllerInterface controller) {\n events = Optional.of(new Events.ForView(controller));\n }", "private void AddUIViewAndHandlers()\n\t{\n\t\t// Set view and autocomplete text\t\t\n\t\tSetViewAndAutoCompleteText(VIEW_ID_COMMAND);\n\t\tSetViewAndAutoComplet...
[ "0.6747928", "0.6722837", "0.66099876", "0.64654475", "0.6406449", "0.6406449", "0.6371659", "0.63617903", "0.62547535", "0.6238728", "0.6197297", "0.6177101", "0.6162729", "0.61587584", "0.6154462", "0.6124123", "0.6040367", "0.6028897", "0.60262626", "0.5960645", "0.5954560...
0.0
-1
Login only possible when TxtNickname isn't empty
@Override public void handle(KeyEvent e) { String name = txtNickname.getText(); name = name.trim(); if (name != null && !name.isEmpty()) { btnLogin.setDisable(false); if (e.getCode() == KeyCode.ENTER) { setController(); tryLogin(); } } else { btnLogin.setDisable(true); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void login() {\n\t\t \tetUserName.addTextChangedListener(new TextWatcher() {\n\t\t public void afterTextChanged(Editable s) {\n\t\t Validation.hasText(etUserName);\n\t\t }\n\t\t public void beforeTextChanged(CharSequence s, int start, int count, int after)...
[ "0.66459066", "0.6472507", "0.64638317", "0.63320524", "0.63320524", "0.6249473", "0.6235334", "0.6221767", "0.6153557", "0.6151484", "0.61263424", "0.61171347", "0.61001015", "0.6095825", "0.608634", "0.60838693", "0.6074431", "0.60692084", "0.6060443", "0.6033764", "0.60337...
0.58404076
44
This helpermethod creates all widgets that are provided by this view
private void createWidgets() { grid = new GridPane(); txtNickname = new TextField(); txtPort = new TextField(); txtAdress = new TextField(); lblNick = new Label("Nickname"); lblNickTaken = new Label(); lblPort = new Label("Port"); lblAdress = new Label("Adress"); lblCardDesign = new Label("Carddesign"); btnLogin = new Button(""); imageStart = new Image(BTNSTARTWOOD, 85, 35, true, true); imvStart = new ImageView(); cardDesignOptions = FXCollections.observableArrayList( "original design", "pirate design", "graveyard design"); comboBoxCardDesign = new ComboBox<String>(cardDesignOptions); comboBoxCardDesign .setCellFactory(new Callback<ListView<String>, ListCell<String>>() { @Override public ListCell<String> call(ListView<String> list) { return new ExtCell(); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void createWidgets() {\n\n\t\tJPanel filmPanel = createFilmPanel();\n\t\tJPanel musicPanel = createMusicPanel();\n\t\tJPanel unclassPanel = createUnclassifiedPanel();\n\n\t\tthis.add(filmPanel);\n\t\tthis.add(musicPanel);\n\t\tthis.add(unclassPanel);\n\t}", "protected abstract void createNestedWidgets();...
[ "0.74384564", "0.70737827", "0.6654743", "0.66341704", "0.6290833", "0.62202257", "0.6211416", "0.618325", "0.6172683", "0.6152828", "0.61277837", "0.6124954", "0.60772336", "0.60738283", "0.60661215", "0.6030148", "0.60236335", "0.60234314", "0.60104483", "0.60071796", "0.59...
0.69027424
2
This helpermethod adds all created widgets to the scene.
private void addWidgets() { grid.setHgap(10); grid.setVgap(5); grid.setPadding(new Insets(150, 80, 80, 80)); grid.add(lblPort, 0, 1); grid.add(txtPort, 1, 1); grid.add(lblAdress, 0, 2); grid.add(txtAdress, 1, 2); grid.add(lblNick, 0, 4); grid.add(txtNickname, 1, 4); grid.add(lblNickTaken, 1, 5); grid.add(lblCardDesign, 0, 3); grid.add(comboBoxCardDesign, 1, 3); grid.add(btnLogin, 0, 7); imvStart.setImage(imageStart); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void createWidgets() {\n\n\t\tJPanel filmPanel = createFilmPanel();\n\t\tJPanel musicPanel = createMusicPanel();\n\t\tJPanel unclassPanel = createUnclassifiedPanel();\n\n\t\tthis.add(filmPanel);\n\t\tthis.add(musicPanel);\n\t\tthis.add(unclassPanel);\n\t}", "private void addNodes() {\n\t\t\n\t\t// first ...
[ "0.67153805", "0.6585956", "0.6324813", "0.6283559", "0.6276521", "0.62601966", "0.6244298", "0.6243817", "0.6205718", "0.6153336", "0.6131318", "0.61204785", "0.60185075", "0.59945744", "0.59724736", "0.5954986", "0.59401196", "0.59340024", "0.5923556", "0.58957833", "0.5872...
0.65648603
2
This helpermethod sets the layout for the whole view.
private void setLayout() { txtNickname.setId("txtNickname"); txtPort.setId("txtPort"); txtAdress.setId("txtAdress"); lblNickTaken.setId("lblNickTaken"); grid.setPrefSize(516, 200); btnLogin.setDisable(true); txtNickname.setPrefSize(200, 25); lblNickTaken.setPrefSize(250, 10); lblNickTaken.setText(null); lblNickTaken.setTextFill(Color.RED); lblNick.setPrefSize(120, 50); txtAdress.setText("localhost"); txtPort.setText("4455"); lblCardDesign.setPrefSize(175, 25); comboBoxCardDesign.getSelectionModel().select(0); btnLogin.setGraphic(imvStart); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setLayout() {\n int orientation = getResources().getConfiguration().orientation;\n // if the orientation is Portrait\n if (orientation == Configuration.ORIENTATION_PORTRAIT) {\n if (!webViewFragment.isAdded()) {\n mLandmarkLayout.setLayoutParams(new Linea...
[ "0.67876244", "0.6762425", "0.6684919", "0.6598016", "0.6591167", "0.6434467", "0.63276535", "0.63218385", "0.6313654", "0.6221461", "0.6173865", "0.6145375", "0.61342525", "0.6109642", "0.60902727", "0.60816836", "0.60240537", "0.60205466", "0.5986051", "0.59833634", "0.5959...
0.5484121
57
/ GETTER and SETTER below
public void setController() { this.controller = CarcassonneController.getInstance(null, this); controller.setControl(ClientControl.getInstance(controller, txtAdress.getText(), Integer.parseInt(txtPort.getText()))); this.controller.getControl().addObserver(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract Set method_1559();", "@Override\r\n\tpublic void get() {\n\t\t\r\n\t}", "@Override\n public void get() {}", "String setValue();", "public void get() {\n }", "public T get() {\n return value;\n }", "public T get() {\n return value;\n }", "public T get() {\n retu...
[ "0.69820726", "0.6890203", "0.6887299", "0.66794", "0.63834375", "0.6368085", "0.6363394", "0.6363394", "0.6329886", "0.6213042", "0.620374", "0.6150587", "0.61364174", "0.6135149", "0.611272", "0.60936", "0.60927236", "0.60865754", "0.6082601", "0.6063406", "0.6051145", "0...
0.0
-1
Writer repository interface for GameEvents. This provides access to a data source that contains the GameEvents object.
public interface GameEventsWriter { /** * Save GameEvents object. * * @param mapGame * @return */ public GameEvents saveGameEvents(GameEvents gameEvents); /** * Save multiple Game objects. * * @param mapGames * @return */ public List<GameEvents> saveGameEvents(List<GameEvents> gameEvents); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface EventRepository\n{\n Event getEventToReplay(ObjectId recordingId, int offset);\n\n long countByRecordingId(ObjectId recordingId);\n\n void save(List<Event> lineEvents);\n\n long getAdded();\n}", "public interface DataWriter {\n\n /*\n * Program waits until the entire game is ...
[ "0.58257335", "0.5785239", "0.54385823", "0.53828055", "0.53361374", "0.53140306", "0.52489567", "0.52146125", "0.520561", "0.51332504", "0.51287746", "0.50845486", "0.5018318", "0.5015495", "0.5008928", "0.49952376", "0.49873576", "0.4974589", "0.4971379", "0.49326488", "0.4...
0.67776424
0
Save multiple Game objects.
public List<GameEvents> saveGameEvents(List<GameEvents> gameEvents);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void saveGame() throws IOException, Throwable {\n Save save = new Save(\"01\");\n save.addToSaveGame(objectsToSave());\n save.saveGame();\n }", "public void saveGame(){\n \tsaveOriginator.writeMap(this.map, this.getObjectives(), this.gameState);\n \tsaveGame.saveGame(saveOriginator)...
[ "0.7602773", "0.7484748", "0.7278742", "0.72433966", "0.72253054", "0.71447206", "0.71390235", "0.71353084", "0.712296", "0.7039702", "0.69426394", "0.6931454", "0.68505937", "0.679693", "0.67722565", "0.6746846", "0.6683485", "0.6628486", "0.6560005", "0.65362287", "0.645356...
0.58970606
57
Agregar un producto a la base de datos
public void conectar() { try { //Class.forName("com.mysql.jdbc.Driver").newInstance(); Class.forName("org.mariadb.jdbc.Driver"); //con = DriverManager.getConnection("jdbc:mariadb://192.168.194.131:3306/arquitectura", "root", "duocadmin"); con = DriverManager.getConnection("jdbc:mariadb://192.168.194.131:3306/arquitectura", "root", "duocadmin"); state = con.createStatement(); } catch (Exception ex) { ex.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void agregar(Producto producto) throws BusinessErrorHelper;", "private void agregarProducto(HttpServletRequest request, HttpServletResponse response) throws SQLException {\n\t\tString codArticulo = request.getParameter(\"CArt\");\n\t\tString seccion = request.getParameter(\"seccion\");\n\t\tString nombreA...
[ "0.825174", "0.7625095", "0.7474884", "0.74473006", "0.7411957", "0.7396394", "0.734482", "0.7310617", "0.72869104", "0.7218006", "0.7187516", "0.7147432", "0.7120731", "0.7096223", "0.7089872", "0.70368916", "0.69895613", "0.6965368", "0.6915711", "0.6912688", "0.69084275", ...
0.0
-1
Modificar un producto en la base de datos
public boolean ModificarProducto(int id,String nom,String fab,int cant,int precio,String desc,int sucursal) { boolean status=false; int res =0; try { conectar(); res=state.executeUpdate("update producto set nombreproducto='"+nom+"', fabricante='"+fab+"',cantidad="+cant+",precio="+precio+",descripcion='"+desc+"',idsucursal="+sucursal+" where idproducto="+id+";"); if(res>=1) { status=true; } con.close(); } catch (Exception ex) { ex.printStackTrace(); } return status; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean modificarproducto(ProductoDTO c) {\r\n\r\n try {\r\n PreparedStatement ps;\r\n ps = conn.getConn().prepareStatement(SQL_UPDATE);\r\n ps.setString(1, c.getDescripcion());\r\n ps.setString(2, c.getFechaproducto());\r\n ps.setInt(3, c.getSto...
[ "0.7527988", "0.7347872", "0.7340179", "0.71270514", "0.71225417", "0.69662976", "0.69297427", "0.69040835", "0.6888592", "0.6869765", "0.6868576", "0.6822844", "0.677875", "0.67284155", "0.6722994", "0.67141944", "0.6708626", "0.6671548", "0.6668947", "0.666546", "0.66585624...
0.75776386
0
eliminar un producto de la base de datos
public boolean EliminarProducto(int id) { boolean status=false; int res =0; try { conectar(); res=state.executeUpdate("delete from producto where idproducto="+id+";"); if(res>=1){ status=true; } con.close(); } catch (Exception ex) { ex.printStackTrace(); } return status; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void eliminar(Producto producto) throws BusinessErrorHelper;", "public void eliminar(Producto producto) throws IWDaoException;", "public void eliminaBD() {\r\n CBD.openConexion();\r\n //------Reune los datos de producto con id--------------//\r\n String A = CBD.getInveID(II.lblid.ge...
[ "0.79029155", "0.77479607", "0.7715248", "0.72349906", "0.7188755", "0.7148325", "0.70689327", "0.7045052", "0.70294356", "0.6957678", "0.69462717", "0.69240457", "0.6753612", "0.67283934", "0.6717631", "0.6699858", "0.66917574", "0.6675281", "0.66581666", "0.66570204", "0.66...
0.70419085
8
traer la lista de productos
public ArrayList<Producto> ListaProductos() { ArrayList<Producto> list = new ArrayList<Producto>(); try { conectar(); ResultSet result = state.executeQuery("select * from producto;"); while(result.next()) { Producto nuevo = new Producto(); nuevo.setIdProducto((int)result.getObject(1)); nuevo.setNombreProducto((String)result.getObject(2)); nuevo.setFabricante((String)result.getObject(3)); nuevo.setCantidad((int)result.getObject(4)); nuevo.setPrecio((int)result.getObject(5)); nuevo.setDescripcion((String)result.getObject(6)); nuevo.setSucursal((int)result.getObject(7)); list.add(nuevo); } con.close(); } catch (Exception ex) { ex.printStackTrace(); } return list; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void listarProducto() {\n }", "public List<Producto> verProductos(){\n SessionFactory sf = NewHibernateUtil.getSessionFactory();\n Session session = sf.openSession();\n // El siguiente objeto de query se puede hacer de dos formas una delgando a hql (lenguaje de consulta) que es el\n ...
[ "0.76924205", "0.73775166", "0.73700184", "0.73288155", "0.7228359", "0.71697325", "0.7149493", "0.7115892", "0.71009374", "0.7095367", "0.70566124", "0.7056026", "0.7044709", "0.69717103", "0.69717103", "0.69717103", "0.6955682", "0.6928009", "0.69162625", "0.69092155", "0.6...
0.75316995
1
buscar un producto por id
public Producto BuscarProducto(int id) { Producto nuevo = new Producto(); try { conectar(); ResultSet result = state.executeQuery("select * from producto where idproducto="+id+";"); while(result.next()) { nuevo.setIdProducto((int)result.getObject(1)); nuevo.setNombreProducto((String)result.getObject(2)); nuevo.setFabricante((String)result.getObject(3)); nuevo.setCantidad((int)result.getObject(4)); nuevo.setPrecio((int)result.getObject(5)); nuevo.setDescripcion((String)result.getObject(6)); nuevo.setSucursal((int)result.getObject(7)); } con.close(); } catch (Exception ex) { ex.printStackTrace(); } return nuevo; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Producto buscarProducto(int id) throws Exception {\n ProductoLogica pL = new ProductoLogica();\n Producto producto = pL.buscarProductoID(id);\n return producto;\n }", "@Override\n\tpublic List<Producto> productos(int id) {\n\n\t\tQuery query = entity.createQuery(\"FROM Seccion s WH...
[ "0.7533196", "0.71154803", "0.70777375", "0.7022117", "0.6889735", "0.68088657", "0.68070513", "0.68063444", "0.6787469", "0.6774876", "0.67635983", "0.6754137", "0.6754137", "0.6713861", "0.67041487", "0.6698373", "0.66834646", "0.668308", "0.66593033", "0.6619084", "0.66182...
0.7889096
0
create scanner and prompt the user for input
public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.println("Enter a string: "); String s = input.nextLine(); char firstLetter = firstLetter(s); // checks if the string has any letters in it and prints the length and first letter of a string if(Character.isLetter(firstLetter)){ System.out.println("The lenght of the string you entered is " + s.length() + " and its first letter is " + firstLetter); } else{ System.out.println("The lenght of the string you entered is " + s.length() + " and there is no letters in it "); } input.close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void askUser()\n { \n System.out.println(\"What is your command?\");\n\n String command = scanner.nextLine();\n commandPrompt(command);\n }", "public void inputScanner(){\n\t\t Scanner sc=new Scanner(System.in); \n\t \n\t\t System.out.println(\"Enter your rollno\"); \n\...
[ "0.71986824", "0.68894106", "0.6868666", "0.67844856", "0.67844856", "0.67775625", "0.6621313", "0.6573215", "0.65364003", "0.6535776", "0.65192103", "0.6517196", "0.64429045", "0.6432119", "0.6417636", "0.6404264", "0.6311473", "0.62695146", "0.62354493", "0.621849", "0.6203...
0.0
-1
method that returns first letter in a string
public static char firstLetter(String s){ char firstLetter = 0; for (int i = 0; i < s.length(); i++) { if(Character.isLetter(s.charAt(i))){ firstLetter = s.charAt(i); return firstLetter; } }return firstLetter; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static char first(String s) {\n\treturn s.charAt(0);\n\t}", "public static char first(String s) {\n return s.charAt(0);\n }", "public String firstAlphabeticalTitleLetter(String title){\n\t\t int first = 0;\n if ( title.toLowerCase().startsWith(\"the \") ) { first = 4; }\n\t\t return...
[ "0.79933256", "0.7974169", "0.7672217", "0.75177664", "0.75101775", "0.74801993", "0.7365501", "0.7351065", "0.7289704", "0.7185799", "0.7120329", "0.6996778", "0.696029", "0.69532555", "0.68750614", "0.68041694", "0.6789318", "0.67865527", "0.6751057", "0.67376876", "0.67187...
0.86151147
0
sdremBindingFile is set by the DREMInterface class in SDREM
public DREM_IO_Batch(String szDefaultFile, String sdremBindingFile, String szoutmodelfile) { File dir = new File(SZSTATICDIR); String[] children = dir.list(); if (children == null) { System.out.println("The directory " + SZSTATICDIR + " was not found." + "Directory not found"); } else { staticsourceArray = new String[children.length + 1]; staticsourceArray[0] = "User Provided"; for (int i = 0; i < children.length; i++) { // Get filename of file or directory staticsourceArray[i + 1] = children[i]; } } try { this.szDefaultFile = szDefaultFile; bbatchmode = true; s1 = System.currentTimeMillis(); this.szoutmodelfile = szoutmodelfile; parseDefaults(); szepsilonval = "" + dMinScoreDEF; szprunepathval = "" + dPRUNEPATHDEF; szdelaypathval = "" + dDELAYPATHDEF; szmergepathval = "" + dDMERGEPATHDEF; szepsilonvaldiff = "" + dMinScoreDIFFDEF; szprunepathvaldiff = "" + dPRUNEPATHDIFFDEF; szdelaypathvaldiff = "" + dDELAYPATHDIFFDEF; szmergepathvaldiff = "" + dDMERGEPATHDIFFDEF; sznumchildval = "" + numchildDEF; szseedval = "" + nSEEDDEF; bstaticcheckval = bfilterstaticDEF; ballowmergeval = ballowmergeDEF; ninitsearchval = ninitsearchDEF; szinitfileval = szInitFileDEF; bstaticsearchval = bstaticsearchDEF; sznodepenaltyval = "" + dNODEPENALTYDEF; bpenalizedmodelval = bPENALIZEDDEF; szconvergenceval = "" + dCONVERGENCEDEF; szminstddeval = "" + dMINSTDDEVALDEF; // System.out.println("*"+szStaticFileDEF); //FIXME: HEADLESS MODE System.setProperty("java.awt.headless", "true"); // If a binding file is specified by SDREM, use that instead // of what was read from the defaults file if (sdremBindingFile != null) { szStaticFileDEF = sdremBindingFile; } clusterscript(szStaticFileDEF, szCrossRefFileDEF, szDataFileDEF, szGeneAnnotationFileDEF, szGeneOntologyFileDEF, "" + nMaxMissingDEF, "" + dMinExpressionDEF, "" + dMinCorrelationRepeatsDEF, "" + nSamplesMultipleDEF, "" + nMinGoGenesDEF, "" + nMinGOLevelDEF, szPrefilteredDEF, balltimeDEF, vRepeatFilesDEF, (nnormalizeDEF == 0), false, false, bspotcheckDEF, (nnormalizeDEF == 2), szcategoryIDDEF, szInitFileDEF, szevidenceDEF, sztaxonDEF, bpontoDEF, bcontoDEF, bfontoDEF, brandomgoDEF, bmaxminDEF); } catch (Exception ex) { ex.printStackTrace(System.out); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setBinding(final DCPList value) {\n this.binding = value;\n }", "public ElementDefinitionDt setBinding(Binding theValue) {\n\t\tmyBinding = theValue;\n\t\treturn this;\n\t}", "public void setBinding(Binding binding) {\r\n\t \tthis.binding = binding;\r\n\t }", "public void setFddbr...
[ "0.50404316", "0.5015465", "0.49363026", "0.49085012", "0.4900474", "0.48807994", "0.48748946", "0.48620713", "0.48497623", "0.4791638", "0.47447428", "0.4695941", "0.46940824", "0.46821293", "0.46800682", "0.46657017", "0.46633902", "0.46618852", "0.46586764", "0.4628282", "...
0.53724915
0
Assigns the initial settings of the parameters based on the contents of szDefaultFile
public void parseDefaults() throws FileNotFoundException, IOException { // System.out.println("in parse\t"+szDefaultFile); String szLine; BufferedReader br; try { String szError = ""; br = new BufferedReader(new FileReader(szDefaultFile)); while ((szLine = br.readLine()) != null) { StringTokenizer st = new StringTokenizer(szLine, "\t"); if (st.hasMoreTokens()) { String sztype = st.nextToken().trim(); String szvalue = ""; if (st.hasMoreTokens()) { szvalue = st.nextToken().trim(); } if (!szvalue.equals("")) { if ((sztype .equalsIgnoreCase("Use_static_input_to_build_model")) || (sztype .equalsIgnoreCase("Use_transcription_factor-gene_interaction_data_to_build")) || (sztype .equalsIgnoreCase("Use_transcription_factor_gene_interaction_data_to_build"))) { if (szvalue.equalsIgnoreCase("true")) { bstaticsearchDEF = true; } else if (szvalue.equalsIgnoreCase("false")) { bstaticsearchDEF = false; } else { szError += "Warning: " + szvalue + " is an unrecognized " + "value for " + sztype + " " + "(expecting true or false)"; } } else if (sztype .equalsIgnoreCase("Static_Input_Data_File") || sztype .equalsIgnoreCase("TF_gene_Interactions_File") || sztype .equalsIgnoreCase("TF-gene_Interactions_File")) { szStaticFileDEF = szvalue; } else if (sztype.equalsIgnoreCase("Data_File") || sztype .equalsIgnoreCase("Expression_Data_File")) { szDataFileDEF = szvalue; } else if (sztype .equalsIgnoreCase("Convergence_Likelihood_%")) { dCONVERGENCEDEF = Double.parseDouble(szvalue); } else if (sztype .equalsIgnoreCase("Minimum_Standard_Deviation")) { dMINSTDDEVALDEF = Double.parseDouble(szvalue); } else if (sztype.equalsIgnoreCase("Saved_Model_File")) { szInitFileDEF = szvalue; } else if ((sztype .equalsIgnoreCase("Spot_IDs_included_in_the_data_file")) || (sztype .equalsIgnoreCase("Spot_IDs_included_in_the_the_data_file")) || (sztype .equalsIgnoreCase("Spot_IDs_in_the_data_file"))) { bspotcheckDEF = (szvalue.equalsIgnoreCase("true")); } else if ((sztype.equalsIgnoreCase("Normalize_Data")) || (sztype.equalsIgnoreCase("Transform_Data")) || (sztype .equalsIgnoreCase("Transform_Data[Log transform data,Linear transform data,Add 0]")) || (sztype .equalsIgnoreCase("Normalize_Data[Log normalize data,Normalize data,No normalization/add 0]"))) { try { nnormalizeDEF = Integer.parseInt(szvalue); if ((nnormalizeDEF < 0) || (nnormalizeDEF > 2)) { throw new IllegalArgumentException( szvalue + " is an invalid argument for Normalize_Data"); } } catch (NumberFormatException ex) { if (szvalue .equalsIgnoreCase("Log normalize data")) { nnormalizeDEF = 0; } else if (szvalue .equalsIgnoreCase("Normalize data")) { nnormalizeDEF = 1; } else if (szvalue .equalsIgnoreCase("No normalization/add 0")) { nnormalizeDEF = 2; } else { throw new IllegalArgumentException( szvalue + " is an invalid argument for Normalize_Data"); } } } else if ((sztype .equalsIgnoreCase("Change_should_be_based_on[Maximum-Minimum,Difference From 0]")) || (sztype .equalsIgnoreCase("Change_should_be_based_on"))) { if (szvalue.equalsIgnoreCase("Maximum-Minimum")) { bmaxminDEF = true; } else if (szvalue .equalsIgnoreCase("Difference From 0")) { bmaxminDEF = false; } else { szError += szvalue + " is an invalid value of " + "Change_should_be_based_on[Maximum-Minimum,Difference From 0]\n"; } } else if (sztype .equalsIgnoreCase("Gene_Annotation_Source")) { /*Boolean bProteAll=false; * try { ndbDEF = Integer.parseInt(szvalue); if * ((ndbDEF < 0)|| (ndbDEF >= organisms.length)) { * ndbDEF = 0; } } catch(NumberFormatException ex) { * boolean bfound = false; int nsource = 0; while * ((nsource < organisms.length)&&(!bfound)) { if * (organisms[nsource].equalsIgnoreCase(szvalue)) { * bfound = true; ndbDEF = nsource; } else { * nsource++; } } * * if (!bfound) { szError += "Warning: "+szvalue * +" is an unrecognized "+ * "type for Gene Annotation Source\n"; } } */ } else if (sztype.equalsIgnoreCase("Allow_Path_Merges")) { ballowmergeDEF = (szvalue.equalsIgnoreCase("true")); } else if (sztype .equalsIgnoreCase("TF-gene_Interaction_Source")) { int numitems = staticsourceArray.length; try { nstaticsourceDEF = Integer.parseInt(szvalue); if ((nstaticsourceDEF < 0) || (nstaticsourceDEF >= numitems)) { nstaticsourceDEF = 0; } } catch (NumberFormatException ex) { boolean bfound = false; int nsource = 0; while ((nsource < numitems) && (!bfound)) { if (((String) staticsourceArray[nsource]) .equalsIgnoreCase(szvalue)) { bfound = true; nstaticsourceDEF = nsource; } else { nsource++; } } if (!bfound) { szError += "Warning: " + szvalue + " is an unrecognized " + "type for TF-gene_Interaction_Source"; } } } else if (sztype .equalsIgnoreCase("Cross_Reference_Source")) { /* * int numitems = defaultxrefs.length; try { * nxrefDEF = Integer.parseInt(szvalue); if * ((nxrefDEF < 0)|| (nxrefDEF >= numitems)) { * nxrefDEF = 0; } } catch(NumberFormatException ex) * { boolean bfouparseDefaultsnd = false; int nsource = 0; while * ((nsource < numitems)&&(!bfound)) { if (((String) * defaultxrefs[nsource]).equalsIgnoreCase(szvalue)) * { bfound = true; nxrefDEF = nsource; } else { * nsource++; } } * * if (!bfound) { szError += "Warning: "+szvalue * +" is an unrecognized "+ * "type for a Cross_Reference_Source"; } } */ } else if (sztype .equalsIgnoreCase("Gene_Annotation_File")) { szGeneAnnotationFileDEF = szvalue; } else if (sztype .equalsIgnoreCase("Cross_Reference_File")) { szCrossRefFileDEF = szvalue; } else if ((sztype .equalsIgnoreCase("Repeat_Data_Files(comma delimited list)")) || (sztype .equalsIgnoreCase("Repeat_Data_Files"))) { vRepeatFilesDEF = new Vector(); StringTokenizer stRepeatList = new StringTokenizer( szvalue, ","); while (stRepeatList.hasMoreTokens()) { vRepeatFilesDEF.add(stRepeatList.nextToken()); } } else if ((sztype .equalsIgnoreCase("Repeat_Data_is_from")) || (sztype .equalsIgnoreCase("Repeat_Data_is_from[Different time periods,The same time period]"))) { if (szvalue .equalsIgnoreCase("Different time periods")) { balltimeDEF = true; } else if (szvalue .equalsIgnoreCase("The same time period")) { balltimeDEF = false; } else if (!szvalue.equals("")) { szError += "WARNING: '" + szvalue + "' is an invalid value for " + "Repeat Data is from it must be either " + "'Different time periods' or 'The same time period'\n"; } } else if (sztype .equalsIgnoreCase("Y-axis_Scale_Factor")) { dYaxisDEF = Double.parseDouble(szvalue); } else if (sztype .equalsIgnoreCase("Scale_Node_Areas_By_The_Factor")) { dnodekDEF = Double.parseDouble(szvalue); } else if (sztype .equalsIgnoreCase("X-axis_Scale_Factor")) { dXaxisDEF = Double.parseDouble(szvalue); } else if ((sztype.equalsIgnoreCase("X-axis_scale")) || (sztype .equalsIgnoreCase("X-axis_scale_should_be")) || (sztype .equalsIgnoreCase("X-axis_scale[Uniform,Based on Real Time]")) || (sztype .equalsIgnoreCase("X-axis_scale_should_be[Uniform,Based on Real Time]"))) { if (szvalue.equalsIgnoreCase("Uniform")) { brealXaxisDEF = false; } else if (szvalue .equalsIgnoreCase("Based on Real Time")) { brealXaxisDEF = true; } else if (!szvalue.equals("")) { szError += "WARNING: '" + szvalue + "' is an invalid value for " + "X-axis_scale it must be either 'Uniform'" + "or 'Based on Real Time'.\n"; } } else if (sztype .equalsIgnoreCase("Key_Input_X_p-val_10^-X")) { dKeyInputXDEF = Double.parseDouble(szvalue); } else if ((sztype .equalsIgnoreCase("Key_Input_Significance_Based_On[" + "Path Significance Conditional on Split,Path Significance Overall,Split Significance]")) || (sztype .equalsIgnoreCase("Key_Input_Significance_Based_On[" + "Split Significance,Path Significance Conditional on Split,Path Significance Overall]"))) { try { nKeyInputTypeDEF = Integer.parseInt(szvalue); if ((nKeyInputTypeDEF < 0) || (nKeyInputTypeDEF > 2)) { throw new IllegalArgumentException( szvalue + " is an invalid argument for Key Input Significance Based On"); } else { // so code maps to input order if (nKeyInputTypeDEF == 0) nKeyInputTypeDEF = 1; else if (nKeyInputTypeDEF == 1) nKeyInputTypeDEF = 2; else if (nKeyInputTypeDEF == 2) nKeyInputTypeDEF = 0; } } catch (NumberFormatException ex) { if (szvalue .equalsIgnoreCase("Split Significance")) { nKeyInputTypeDEF = 0; } else if (szvalue .equalsIgnoreCase("Path Significance Conditional on Split")) { nKeyInputTypeDEF = 1; } else if (szvalue .equalsIgnoreCase("Path Significance Overall")) { nKeyInputTypeDEF = 2; } else { throw new IllegalArgumentException( szvalue + " is an invalid argument for Key_Input_Significance_Based_On"); } } } else if (sztype .equalsIgnoreCase("Maximum_number_of_paths_out_of_split")) { numchildDEF = Integer.parseInt(szvalue); } else if ((sztype.equalsIgnoreCase("Split_Seed")) || (sztype.equalsIgnoreCase("Random_Seed"))) { nSEEDDEF = Integer.parseInt(szvalue); } else if (sztype .equalsIgnoreCase("Penalized_likelihood_node_penalty")) { dNODEPENALTYDEF = Double.parseDouble(szvalue); } else if ((sztype .equalsIgnoreCase("Model_selection_framework")) || (sztype .equalsIgnoreCase("Model_selection_framework[Penalized Likelihood,Train-Test]"))) { try { int ntempval; ntempval = Integer.parseInt(szvalue); if ((ntempval < 0) || (ntempval > 1)) { bPENALIZEDDEF = (ninitsearchDEF == 0); throw new IllegalArgumentException( szvalue + " is an invalid argument for Model_selection_framework"); } } catch (NumberFormatException ex) { if (szvalue .equalsIgnoreCase("Penalized Likelihood")) { bPENALIZEDDEF = true; } else if (szvalue .equalsIgnoreCase("Train-Test")) { bPENALIZEDDEF = false; } else if (!szvalue.equals("")) { szError += "WARNING: '" + szvalue + "' is an invalid value for " + "Model_selection_framework " + "it must be either " + "'Use As Is', 'Start Search From', or 'Do Not Use'\n"; } } } else if ((sztype .equalsIgnoreCase("Delay_path_improvement")) || (sztype .equalsIgnoreCase("Delay_split_score_%"))) { dDELAYPATHDEF = Double.parseDouble(szvalue); if (dDELAYPATHDEF < 0) { throw new IllegalArgumentException(szvalue + " is an invalid value for " + sztype + " must be >= 0"); } } else if (sztype .equalsIgnoreCase("Merge_path_score_%")) { dDMERGEPATHDEF = Double.parseDouble(szvalue); if (dDMERGEPATHDEF < 0) { throw new IllegalArgumentException(szvalue + " is an invalid value for " + sztype + " must be >= 0"); } } else if (sztype .equalsIgnoreCase("Merge_path_difference_threshold")) { dDMERGEPATHDIFFDEF = Double.parseDouble(szvalue); if (dDMERGEPATHDIFFDEF > 0) { throw new IllegalArgumentException(szvalue + " is an invalid value for " + sztype + " must be <= 0"); } } else if (sztype .equalsIgnoreCase("Delay_split_difference_threshold")) { dDELAYPATHDIFFDEF = Double.parseDouble(szvalue); if (dDELAYPATHDIFFDEF > 0) { throw new IllegalArgumentException(szvalue + " is an invalid value for " + sztype + " must be <= 0"); } } else if (sztype .equalsIgnoreCase("Delete_path_difference_threshold")) { dPRUNEPATHDIFFDEF = Double.parseDouble(szvalue); if (dPRUNEPATHDIFFDEF > 0) { throw new IllegalArgumentException(szvalue + " is an invalid value for " + sztype + " must be <= 0"); } } else if (sztype .equalsIgnoreCase("Main_search_difference_threshold")) { dMinScoreDIFFDEF = Double.parseDouble(szvalue); if (dMinScoreDIFFDEF < 0) { throw new IllegalArgumentException(szvalue + " is an invalid value for " + sztype + " must be >= 0"); } } else if ((sztype .equalsIgnoreCase("Prune_path_improvement")) || (sztype .equalsIgnoreCase("Delete_path_score_%"))) { dPRUNEPATHDEF = Double.parseDouble(szvalue); if (dPRUNEPATHDEF < 0) { throw new IllegalArgumentException(szvalue + " is an invalid value for " + sztype + " must be >= 0"); } } else if ((sztype .equalsIgnoreCase("Minimum_score_improvement")) || (sztype .equalsIgnoreCase("Main_search_score_%"))) { dMinScoreDEF = Double.parseDouble(szvalue); if (dMinScoreDEF < 0) { throw new IllegalArgumentException(szvalue + " is an invalid value for " + sztype + " must be >= 0"); } } else if ((sztype.equalsIgnoreCase("Saved_Model")) || (sztype .equalsIgnoreCase("Saved_Model[Use As Is/Start Search From/Do Not Use]"))) { try { ninitsearchDEF = Integer.parseInt(szvalue); if ((ninitsearchDEF < 0) || (ninitsearchDEF > 2)) { throw new IllegalArgumentException( szvalue + " is an invalid argument for Saved_Model"); } } catch (NumberFormatException ex) { if (szvalue.equalsIgnoreCase("Use As Is")) { ninitsearchDEF = 0; } else if (szvalue .equalsIgnoreCase("Start Search From")) { ninitsearchDEF = 1; } else if (szvalue .equalsIgnoreCase("Do Not Use")) { ninitsearchDEF = 2; } else if (!szvalue.equals("")) { szError += "WARNING: '" + szvalue + "' is an invalid value for " + "Saved_Model " + "it must be either " + "'Use As Is', 'Start Search From', or 'Do Not Use'\n"; } } } else if (sztype .equalsIgnoreCase("Filter_Gene_If_It_Has_No_Static_Input_Data")) { bfilterstaticDEF = (szvalue .equalsIgnoreCase("true")); } else if (sztype .equalsIgnoreCase("Maximum_Number_of_Missing_Values")) { nMaxMissingDEF = Integer.parseInt(szvalue); } else if (sztype .equalsIgnoreCase("Minimum_Absolute_Log_Ratio_Expression")) { dMinExpressionDEF = Double.parseDouble(szvalue); } else if (sztype .equalsIgnoreCase("Minimum_Correlation_between_Repeats")) { dMinCorrelationRepeatsDEF = Double .parseDouble(szvalue); } else if (sztype .equalsIgnoreCase("Pre-filtered_Gene_File")) { szPrefilteredDEF = szvalue; } else if (sztype .equalsIgnoreCase("Include_Biological_Process")) { bpontoDEF = (szvalue.equalsIgnoreCase("true")); } else if (sztype .equalsIgnoreCase("Include_Molecular_Function")) { bfontoDEF = (szvalue.equalsIgnoreCase("true")); } else if (sztype .equalsIgnoreCase("Include_Cellular_Process")) { bcontoDEF = (szvalue.equalsIgnoreCase("true")); } else if (sztype .equalsIgnoreCase("Only_include_annotations_with_these_evidence_codes")) { szevidenceDEF = szvalue; } else if (sztype .equalsIgnoreCase("Only_include_annotations_with_these_taxon_IDs")) { sztaxonDEF = szvalue; } else if ((sztype.equalsIgnoreCase("Category_ID_File")) || (sztype .equalsIgnoreCase("Category_ID_Mapping_File"))) { szcategoryIDDEF = szvalue; } else if ((sztype .equalsIgnoreCase("GO_Minimum_number_of_genes")) || (sztype .equalsIgnoreCase("Minimum_number_of_genes"))) { nMinGoGenesDEF = Integer.parseInt(szvalue); } else if (sztype.equalsIgnoreCase("Minimum_GO_level")) { nMinGOLevelDEF = Integer.parseInt(szvalue); } else if (sztype .equalsIgnoreCase("Minimum_Split_Percent")) { dpercentDEF = Double.parseDouble(szvalue); } else if (sztype .equalsIgnoreCase("Number_of_samples_for_randomized_multiple_hypothesis_correction")) { nSamplesMultipleDEF = Integer.parseInt(szvalue); } else if ((sztype .equalsIgnoreCase("Multiple_hypothesis_correction_method_enrichment[Bonferroni,Randomization]")) || (sztype .equalsIgnoreCase("Multiple_hypothesis_correction_method[Bonferroni,Randomization]"))) { if (szvalue.equalsIgnoreCase("Bonferroni")) { brandomgoDEF = false; } else if (szvalue .equalsIgnoreCase("Randomization")) { brandomgoDEF = true; } else if (!szvalue.equals("")) { szError += "WARNING: '" + szvalue + "' is an invalid value for " + "Correction_Method it must be either 'Bonferroni'" + "or 'Randomization'.\n"; } } else if (sztype.equalsIgnoreCase("miRNA-gene_Interaction_Source")) { miRNAInteractionDataFile = szvalue; } else if (sztype.equalsIgnoreCase("miRNA_Expression_Data_File")) { miRNAExpressionDataFile = szvalue; } else if (sztype.equalsIgnoreCase("Regulator_Types_Used_For_Activity_Scoring")) { if(szvalue.equalsIgnoreCase("None")){ checkStatusTF = false; checkStatusmiRNA = false; } else if(szvalue.equalsIgnoreCase("TF")){ checkStatusTF = true; checkStatusmiRNA = false; } else if (szvalue.equalsIgnoreCase("miRNA")) { checkStatusTF = false; checkStatusmiRNA = true; } else if (szvalue.equalsIgnoreCase("Both")) { checkStatusTF = true; checkStatusmiRNA = true; } else if (!szvalue.equals("")){ szError = "WARNING: '" + szvalue + "' is an invalid value for " + "Regulator_Types_Used_For_Activity_Scoring it must be either 'None', 'TF'" + ", 'miRNA' or 'Both'.\n"; } } else if (sztype.equalsIgnoreCase("Normalize_miRNA_Data[Log normalize data,Normalize data,No normalization/add 0]")) { if (szvalue.equalsIgnoreCase("Log normalize data")) { miRNATakeLog = true; miRNAAddZero = false; } else if (szvalue.equalsIgnoreCase("Normalize data")) { miRNATakeLog = false; miRNAAddZero = false; } else if (szvalue.equalsIgnoreCase("No normalization/add 0")) { miRNATakeLog = false; miRNAAddZero = true; } else { throw new IllegalArgumentException( szvalue+ " is an invalid argument for Normalize_miRNA_Data"); } } else if ((sztype .equalsIgnoreCase("Repeat_miRNA_Data_Files(comma delimited list)")) || (sztype .equalsIgnoreCase("Repeat_miRNA_Data_Files"))) { miRNARepeatFilesDEF = new Vector(); StringTokenizer stRepeatList = new StringTokenizer( szvalue, ","); while (stRepeatList.hasMoreTokens()) { miRNARepeatFilesDEF.add(stRepeatList.nextToken()); } } else if ((sztype.equalsIgnoreCase("Repeat_miRNA_Data_is_from")) || (sztype .equalsIgnoreCase("Repeat_miRNA_Data_is_from[Different time periods,The same time period]"))) { if (szvalue.equalsIgnoreCase("Different time periods")) { miRNAalltimeDEF = true; } else if (szvalue.equalsIgnoreCase("The same time period")) { miRNAalltimeDEF = false; } else if (!szvalue.equals("")) { szError += "WARNING: '" + szvalue + "' is an invalid value for " + "Repeat miRNA Data is from it must be either " + "'Different time periods' or 'The same time period'\n"; } } else if (sztype.equalsIgnoreCase("Filter_miRNA_With_No_Expression_Data_From_Regulators")) { filtermiRNAExp = (szvalue.equalsIgnoreCase("true")); } else if (sztype.equalsIgnoreCase("Expression_Scaling_Weight")) { miRNAWeight = Double.parseDouble(szvalue); } else if (sztype.equalsIgnoreCase("Minimum_TF_Expression_After_Scaling")) { tfWeight = Double.parseDouble(szvalue); } else if (sztype.equalsIgnoreCase("Regulator_Score_File")) { regScoreFile = szvalue; } else if (sztype.equalsIgnoreCase("DECOD_Executable_Path")) { decodPath = szvalue; } else if (sztype.equalsIgnoreCase("Gene_To_Fasta_Format_file")) { fastaFile = szvalue; } else if (sztype.equalsIgnoreCase("Active_TF_influence")) { dProbBindingFunctional = Double .parseDouble(szvalue); System.out .println("Setting active TF influence to " + dProbBindingFunctional); // parseDefault for proteomics panel } else if (sztype.equalsIgnoreCase("Proteomics_File")){ djProteFile=szvalue; // parseDefault for relative proteomics weight } else if (sztype.equalsIgnoreCase("Proteomics_Relative_Weight")){ pweight=szvalue; } else if ((sztype .equalsIgnoreCase("Repeat_Prote_Data_Files(comma delimited list)")) || (sztype .equalsIgnoreCase("Repeat_Prote_Data_Files"))) { ProteRepeatFilesDEF = new Vector(); StringTokenizer stRepeatList = new StringTokenizer( szvalue, ","); while (stRepeatList.hasMoreTokens()) { ProteRepeatFilesDEF.add(stRepeatList.nextToken()); } } else if ((sztype.equalsIgnoreCase("Repeat_Prote_Data_is_from")) || (sztype .equalsIgnoreCase("Repeat_Prote_Data_is_from[Different time periods,The same time period]"))) { if (szvalue.equalsIgnoreCase("Different time periods")) { ProtealltimeDEF = true; } else if (szvalue.equalsIgnoreCase("The same time period")) { ProtealltimeDEF = false; } else if (!szvalue.equals("")) { szError += "WARNING: '" + szvalue + "' is an invalid value for " + "Repeat Prote Data is from it must be either " + "'Different time periods' or 'The same time period'\n"; } } else if (sztype.equalsIgnoreCase("Normalize_Prote_Data[Log normalize data,Normalize data,No normalization/add 0]")) { if (szvalue.equalsIgnoreCase("Log normalize data")) { proteTakeLog = true; proteAddZero = false; } else if (szvalue.equalsIgnoreCase("Normalize data")) { proteTakeLog = false; proteAddZero = false; } else if (szvalue.equalsIgnoreCase("No normalization/add 0")) { proteTakeLog = false; proteAddZero = true; } else { throw new IllegalArgumentException( szvalue+ " is an invalid argument for Normalize_Prote_Data"); } } else if (sztype.equalsIgnoreCase("Use Proteomics[No,TF,All]")){ if (szvalue.equalsIgnoreCase("No")){ bProteTF=false; bProteAll=false; } else if (szvalue.equalsIgnoreCase("TF")){ bProteTF=true; bProteAll=false; } else if (szvalue.equalsIgnoreCase("All")){ bProteAll=true; bProteTF=false; } else{ throw new IllegalArgumentException( szvalue+" is not valid" ); } } else if (sztype.equalsIgnoreCase("PPI File")){ djPPIFile=szvalue; } else if (sztype.equalsIgnoreCase("Epigenomic_File")){ // parseDefault for epigenomics panel djMethyFile=szvalue; } else if (sztype.equalsIgnoreCase("GTF File")){ djMethyGTF=szvalue; } else if ((sztype.charAt(0) != '#')) { szError += "WARNING: '" + sztype + "' is an unrecognized variable.\n"; } } } } br.close(); if (!szError.equals("")) { throw new IllegalArgumentException(szError); } } catch (FileNotFoundException ex) { } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setDefaultParameters(){\n clearParametersVector();\n addParameter( new LoadFilePG(\"Vanadium NeXus File Name\",\"\"));\n addParameter( new LoadFilePG(\"Background NeXus File Name\",\"\"));\n addParameter( new LoadFilePG(\"Integrated Peaks File\",\"\"));\n addParameter( new Save...
[ "0.69250226", "0.65316796", "0.63388026", "0.6325243", "0.6172618", "0.612329", "0.60740364", "0.6042933", "0.5990692", "0.5971004", "0.5942456", "0.591789", "0.58598477", "0.5857111", "0.5827279", "0.5806425", "0.576786", "0.5765834", "0.5733456", "0.56880945", "0.5687216", ...
0.6512515
2
Checks if the two data sets have the same number of rows, time points, and the gene name matches.
public static void errorcheck(DREM_DataSet theDataSet1, DREM_DataSet theOtherSet) { if (theDataSet1.numcols != theOtherSet.numcols) { throw new IllegalArgumentException( "Repeat data set must have same " + "number of columns as original, expecting " + theDataSet1.numcols + " found " + theOtherSet.numcols + " in the repeat"); } else if (theDataSet1.numrows != theOtherSet.numrows) { throw new IllegalArgumentException( "Repeat data set must have same " + "number of spots as the original, expecting " + theDataSet1.numrows + " found " + theOtherSet.numrows + " in the repeat"); } else { for (int nrow = 0; nrow < theDataSet1.numrows; nrow++) { if (!theDataSet1.genenames[nrow] .equals(theOtherSet.genenames[nrow])) { throw new IllegalArgumentException("In row " + nrow + " of the repeat set " + "expecting gene symbol " + theDataSet1.genenames[nrow] + " found " + theOtherSet.genenames[nrow]); } else if (!theDataSet1.probenames[nrow] .equals(theOtherSet.probenames[nrow])) { throw new IllegalArgumentException("In row " + nrow + " of the repeat set " + "expecting gene symbol " + theDataSet1.probenames[nrow] + " found " + theOtherSet.probenames[nrow]); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void checkSimColumns(Table t1, Table t2, LinkedList<String> simNames, HashMap<Integer,\n LinkedList> t1ToT2, LinkedList<Integer> simRowsT1,\n LinkedList<LinkedList> totalSimRows) {\n boolean flag = false;\n LinkedList<Integer> temp;\n for (String cn : ...
[ "0.61145395", "0.6086473", "0.5960957", "0.58670926", "0.58634007", "0.58592486", "0.58279634", "0.5745263", "0.567258", "0.5659792", "0.5659411", "0.563239", "0.56140405", "0.55956787", "0.55772406", "0.55764693", "0.55587417", "0.555776", "0.55496716", "0.5539884", "0.55364...
0.5817101
7
Checks if origcols and nrepeat cols are the same value, the length of origgenes and repeatgenes is the same, and the gene names are the same
public void errorcheck(String[] origgenes, String[] repeatgenes, int norigcols, int nrepeatcols) { if (norigcols != nrepeatcols) { throw new IllegalArgumentException( "Repeat data set must have same " + "number of columns as original, expecting " + norigcols + " found " + nrepeatcols + " in the repeat"); } else if (origgenes.length != repeatgenes.length) { throw new IllegalArgumentException( "Repeat data set must have same " + "number of spots as the original, expecting " + origgenes.length + " found " + repeatgenes.length + " in the repeat"); } else { for (int nrow = 0; nrow < origgenes.length; nrow++) { if (!origgenes[nrow].equals(repeatgenes[nrow])) { throw new IllegalArgumentException("In row " + nrow + " of the repeat set " + "expecting gene symbol " + origgenes[nrow] + " found " + repeatgenes[nrow]); } else if (!origgenes[nrow].equals(repeatgenes[nrow])) { throw new IllegalArgumentException("In row " + nrow + " of the repeat set " + "expecting gene symbol " + origgenes[nrow] + " found " + repeatgenes[nrow]); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean checkNoDuplicateFields() {\n\t if (duplicateNames == null | duplicateNames.isEmpty())\n\t return true;\n\t Iterator iter = duplicateNames.iterator();\n\t String names = \"\";\n\t while (iter.hasNext()) {\n\t names = names + iter.next(); \n\t }\n\t cat.error(loc,DUPLICATE_COLUMN_NAMES,ne...
[ "0.6032894", "0.56138307", "0.56116325", "0.5512376", "0.54362637", "0.5406401", "0.53631496", "0.5339746", "0.5324368", "0.5312098", "0.52987695", "0.5290539", "0.5253751", "0.5248468", "0.51945984", "0.5191754", "0.5187499", "0.51860917", "0.51843256", "0.51407284", "0.5113...
0.70479965
0
Returns a DREM_DataSet based on the provided input parameters
synchronized public DREM_DataSet buildset(String szorganismsourceval, String szxrefsourceval, String szxrefval, String szexp1val, String szgoval, String szgocategoryval, int nmaxmissing, double dexpressedval, double dmincorrelation, int nsamplespval, int nmingo, int nmingolevel, String szextraval, boolean balltime, Vector repeatnames, boolean btakelog, boolean bspotincluded, boolean badd0, String szcategoryIDval, String szevidenceval, String sztaxonval, boolean bpontoval, boolean bcontoval, boolean bfontoval, boolean brandomgoval, boolean bmaxminval) throws Exception { DREM_DataSet theDataSetsMerged = null; if (balltime) { DREM_DataSet theDataSet1 = new DREM_DataSet(szexp1val, nmaxmissing, dexpressedval, dmincorrelation, btakelog, bspotincluded, false, badd0, bmaxminval, balltime); if (theDataSet1.numcols <= 1) { theDataSet1 = new DREM_DataSet(theDataSet1.filterDuplicates(), new DREM_GoAnnotations(szorganismsourceval, szxrefsourceval, szxrefval, szgoval, szgocategoryval, theDataSet1.genenames, theDataSet1.probenames, nsamplespval, nmingo, nmingolevel, szextraval, szcategoryIDval, bspotincluded, szevidenceval, sztaxonval, bpontoval, bcontoval, bfontoval, brandomgoval)); DREM_DataSet theDataSet1fm; if (theDataSet1.numcols == 1) { theDataSet1fm = new DREM_DataSet( theDataSet1.filterMissing1point(), theDataSet1.tga); theDataSet1fm = new DREM_DataSet( theDataSet1fm.filtergenesthreshold1point(), theDataSet1fm.tga); } else { theDataSet1fm = theDataSet1; } return theDataSet1fm; } else { String[] origgenes = theDataSet1.genenames; theDataSet1 = new DREM_DataSet(theDataSet1.logratio2(), theDataSet1.tga); theDataSet1 = new DREM_DataSet( theDataSet1.averageAndFilterDuplicates(), theDataSet1.tga); // genevalues in log ratio before averaging stored // need for each gene duplicated // a mutlidimensional array of time series for each occurence int numrepeats = repeatnames.size(); if (numrepeats > 0) { DREM_DataSet[] repeatSets = new DREM_DataSet[numrepeats]; for (int nset = 0; nset < numrepeats; nset++) { String szfile = (String) repeatnames.get(nset); DREM_DataSet theOtherSet = new DREM_DataSet(szfile, nmaxmissing, dexpressedval, dmincorrelation, btakelog, bspotincluded, true, badd0, bmaxminval, balltime); errorcheck(origgenes, theOtherSet.genenames, theDataSet1.numcols, theOtherSet.numcols); // compute log ratio of each time series first then // merge // normalize the data theOtherSet = new DREM_DataSet(theOtherSet.logratio2(), theOtherSet.tga); theOtherSet = new DREM_DataSet( theOtherSet.averageAndFilterDuplicates(), theOtherSet.tga); // gene values in log ratio before averaging stored repeatSets[nset] = theOtherSet; } theDataSetsMerged = new DREM_DataSet( theDataSet1.mergeDataSets(repeatSets), theDataSet1.tga); theDataSetsMerged = new DREM_DataSet( theDataSetsMerged.filterdistprofiles(theDataSet1, repeatSets), theDataSetsMerged.tga); } else { theDataSetsMerged = theDataSet1; } theDataSetsMerged = new DREM_DataSet( theDataSetsMerged.filterMissing(), theDataSetsMerged.tga); theDataSetsMerged = new DREM_DataSet( theDataSetsMerged.filtergenesthreshold2(), theDataSetsMerged.tga); theDataSetsMerged.tga = new DREM_GoAnnotations( szorganismsourceval, szxrefsourceval, szxrefval, szgoval, szgocategoryval, theDataSet1.genenames, theDataSet1.probenames, nsamplespval, nmingo, nmingolevel, szextraval, szcategoryIDval, bspotincluded, szevidenceval, sztaxonval, bpontoval, bcontoval, bfontoval, brandomgoval); theDataSetsMerged.addExtraToFilter(theDataSetsMerged.tga); return theDataSetsMerged; } } else { DREM_DataSet theDataSet1 = new DREM_DataSet(szexp1val, nmaxmissing, dexpressedval, dmincorrelation, btakelog, bspotincluded, false, badd0, bmaxminval, balltime); if (theDataSet1.numcols <= 1) { theDataSet1 = new DREM_DataSet(theDataSet1.filterDuplicates(), new DREM_GoAnnotations(szorganismsourceval, szxrefsourceval, szxrefval, szgoval, szgocategoryval, theDataSet1.genenames, theDataSet1.probenames, nsamplespval, nmingo, nmingolevel, szextraval, szcategoryIDval, bspotincluded, szevidenceval, sztaxonval, bpontoval, bcontoval, bfontoval, brandomgoval)); DREM_DataSet theDataSet1fm; if (theDataSet1.numcols == 1) { theDataSet1fm = new DREM_DataSet( theDataSet1.filterMissing1point(), theDataSet1.tga); theDataSet1fm = new DREM_DataSet( theDataSet1fm.filtergenesthreshold1point(), theDataSet1fm.tga); } else { theDataSet1fm = theDataSet1; } return theDataSet1fm; } else { int numrepeats = repeatnames.size(); if (numrepeats > 0) { DREM_DataSet[] repeatSets = new DREM_DataSet[numrepeats]; for (int nset = 0; nset < numrepeats; nset++) { String szfile = (String) repeatnames.get(nset); DREM_DataSet theOtherSet = new DREM_DataSet(szfile, nmaxmissing, dexpressedval, dmincorrelation, btakelog, bspotincluded, true, badd0, bmaxminval, balltime); errorcheck(theDataSet1, theOtherSet); repeatSets[nset] = theOtherSet; } theDataSetsMerged = new DREM_DataSet( theDataSet1.mergeDataSets(repeatSets), theDataSet1.tga); } else { theDataSetsMerged = theDataSet1; } theDataSetsMerged = new DREM_DataSet( theDataSetsMerged.logratio2(), theDataSetsMerged.tga); theDataSetsMerged = new DREM_DataSet( theDataSetsMerged.averageAndFilterDuplicates(), theDataSetsMerged.tga); // gene values before averaging stored theDataSetsMerged = new DREM_DataSet( theDataSetsMerged.filterMissing(), theDataSetsMerged.tga); theDataSetsMerged = new DREM_DataSet( theDataSetsMerged.filtergenesthreshold2(), theDataSetsMerged.tga); theDataSetsMerged.tga = new DREM_GoAnnotations( szorganismsourceval, szxrefsourceval, szxrefval, szgoval, szgocategoryval, theDataSet1.genenames, theDataSet1.probenames, nsamplespval, nmingo, nmingolevel, szextraval, szcategoryIDval, bspotincluded, szevidenceval, sztaxonval, bpontoval, bcontoval, bfontoval, brandomgoval); } theDataSetsMerged.addExtraToFilter(theDataSetsMerged.tga); return theDataSetsMerged; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getDataSet();", "private Dataset prepareDataset() {\n // create TAPIR dataset with single endpoint\n Dataset dataset = new Dataset();\n dataset.setKey(UUID.randomUUID());\n dataset.setTitle(\"Beavers\");\n dataset.addEndpoint(endpoint);\n\n // add single Contact\n Contact contact = ne...
[ "0.6343424", "0.63343", "0.62327117", "0.6104208", "0.60671145", "0.59793603", "0.59737253", "0.59629726", "0.5961189", "0.5953197", "0.59054804", "0.59036297", "0.58917487", "0.58898175", "0.58633024", "0.58473235", "0.58450454", "0.58260334", "0.5800899", "0.5797148", "0.57...
0.5815765
18
/////////////////////////////////////////////////////////////////////// A control method that handles the response for when the execute button on the interface is pressed including building the data set, running the DREM modeling procedure, and displaying the results
public void clusterscript( String szstaticFileval, // szstaticFieldval -- before reference // class variable String szxrefval, String szexp1val, String szgoval, String szgocategoryval, String szmaxmissingval, String szexpressedval, String szfilterthresholdval, String szsamplepval, String szmingoval, String szmingolevelval, String szextraval, boolean balltime, Vector repeatnames, boolean btakelog, boolean bgetxref, boolean bgetgoann, boolean bspotincluded, boolean badd0, String szcategoryIDval, String szinitfileval, String szevidenceval, String sztaxonval, boolean bpontoval, boolean bcontoval, boolean bfontoval, boolean brandomgoval, boolean bmaxminval) throws Exception { if (nexceptions == 0) { if (szstaticFileval.trim().equals("")) { throw new IllegalArgumentException( "No transcription factor gene interaction input file given!"); } if ((!szstaticFileval.trim().equals("")) && (!(new File(szstaticFileval)).exists())) { throw new IllegalArgumentException( "The transcription factor gene interaction input file '" + szstaticFileval + "' cannot be found."); } if (szexp1val.trim().equals("")) { throw new IllegalArgumentException( "No time series input data file given!"); } else if (!(new File(szexp1val)).exists()) { throw new IllegalArgumentException( "The time series input data file '" + szexp1val + "' cannot be found."); } if (szinitfileval.trim().equals("")) { szinitfileval = ""; } else if (!(new File(szinitfileval)).exists()) { throw new IllegalArgumentException("The initial model file '" + szinitfileval + "' cannot be found."); } if (szcategoryIDval.trim().equals("")) { szcategoryIDval = ""; } else if (!(new File(szcategoryIDval)).exists()) { throw new IllegalArgumentException("The category ID file '" + szcategoryIDval + "' cannot be found."); } if (szxrefval.trim().equals("")) { szxrefval = ""; } else if ((!bgetxref) && !(new File(szxrefval)).exists()) { throw new IllegalArgumentException("The cross reference file '" + szxrefval + "' cannot be found."); } if (szgoval.trim().equals("")) { szgoval = ""; } else if ((!bgetgoann) && (!(new File(szgoval)).exists())) { throw new IllegalArgumentException("The GO annotation file '" + szgoval + "' cannot be found."); } if (szextraval.trim().equals("")) { szextraval = ""; } else if (!(new File(szextraval)).exists()) { throw new IllegalArgumentException( "The pre-filtered gene list file '" + szextraval + "' cannot be found."); } if (szgocategoryval.trim().equals("")) { szgocategoryval = ""; } int nmaxmissing; try { nmaxmissing = Integer.parseInt(szmaxmissingval); if (nmaxmissing < 0) { throw new IllegalArgumentException( "Maximum missing values must be positive"); } } catch (NumberFormatException ex) { throw new IllegalArgumentException( "Maximum missing values must be an integer"); } for (int nrepeat = 0; nrepeat < repeatnames.size(); nrepeat++) { if (!(new File((String) repeatnames.get(nrepeat))).exists()) { throw new IllegalArgumentException("The repeat data file '" + repeatnames.get(nrepeat) + "' cannot be found"); } } double dmincorrelation = Double.parseDouble(szfilterthresholdval); if ((dmincorrelation < -1.1) || (dmincorrelation > 1.1)) { throw new IllegalArgumentException( "Correlation Lower Bound for Filtering must be in [-1.1,1.1]"); } double dexpressedval = Double.parseDouble(szexpressedval); if (dexpressedval < -0.05) { throw new IllegalArgumentException( "Expression Value for filter must be >= -0.05"); } int nmingo = Integer.parseInt(szmingoval); if (nmingo < 1) { throw new IllegalArgumentException( "Minimum number of GO genes must be at least 1"); } int nmingolevel = Integer.parseInt(szmingolevelval); if (nmingolevel < 1) { throw new IllegalArgumentException( "Minimum number of GO level must be at least 1"); } int nsamplespval; try { nsamplespval = Integer.parseInt(szsamplepval); } catch (NumberFormatException ex) { throw new IllegalArgumentException( "Number of samples for p-value correction must be an integer"); } if (nsamplespval < 1) { throw new IllegalArgumentException( "Number of samples for p-value correction must be positive"); } bendsearch = false; final DREM_DataSet thefDataSetfmnel = DREM_IO.buildset( szorganismsourceval, szxrefsourceval, szxrefval, szexp1val, szgoval, szgocategoryval, nmaxmissing, dexpressedval, dmincorrelation, nsamplespval, nmingo, nmingolevel, szextraval, balltime, repeatnames, btakelog, bspotincluded, badd0, szcategoryIDval, szevidenceval, sztaxonval, bpontoval, bcontoval, bfontoval, brandomgoval, bmaxminval); DataSetCore theMIRNADataSet = null; if (checkStatusmiRNA && miRNAExpressionDataFile != null && !miRNAExpressionDataFile.equals("")) { theMIRNADataSet = DREM_IO.buildMIRNAset(null, null, null, miRNAExpressionDataFile, "", null, nmaxmissing, dexpressedval, dmincorrelation, nsamplespval, nmingo, nmingolevel, szextraval, miRNAalltimeDEF, miRNARepeatFilesDEF, miRNATakeLog, false, miRNAAddZero, szcategoryIDval, szevidenceval, sztaxonval, bpontoval, bcontoval, bfontoval, brandomgoval, bmaxminval); } DataSetCore theProteDataSet=null; //FIXME update proteDataset Batch mode here; if((bProteAll||bProteTF) && !(djProteFile.equals(""))){ theProteDataSet=DREM_IO.buildProteset(null,null,null, djProteFile,"",null,nmaxmissing, dexpressedval,dmincorrelation,nsamplespval,nmingo, nmingolevel,szextraval,ProtealltimeDEF, ProteRepeatFilesDEF,proteTakeLog,false,proteAddZero, szcategoryIDval,szevidenceval,sztaxonval,bpontoval, bcontoval,bfontoval,brandomgoval,bmaxminval); } String miRNAExFile=miRNAExpressionDataFile; String szExFile=szexp1val; HashMap<String,HashMap<String,Double>> methyGeneScoreMap=null; if (!(djMethyFile.equals("")) && !(djMethyGTF.equals(""))){ methyGeneScoreMap=getMethyScore(djMethyFile,djMethyGTF); } // -------------------------------------------------------------------------------------------- DREM_Timeiohmm thetimehmm = null; thetimehmm = new DREM_Timeiohmm(thefDataSetfmnel, szstaticFileval, sznumchildval, szepsilonval, szprunepathval, szdelaypathval, szmergepathval, szepsilonvaldiff, szprunepathvaldiff, szdelaypathvaldiff, szmergepathvaldiff, szseedval, bstaticcheckval, ballowmergeval, ninitsearchval, szinitfileval, null, null, null, null, null, null, bstaticsearchval, brealXaxisDEF, dYaxisDEF, dXaxisDEF, dnodekDEF, nKeyInputTypeDEF, dKeyInputXDEF, dpercentDEF, null, "", sznodepenaltyval, bpenalizedmodelval, szconvergenceval, szminstddeval, staticsourceArray[nstaticsourcecb], checkStatusTF, checkStatusmiRNA, miRNAInteractionDataFile, szExFile, theMIRNADataSet,miRNAExFile, theProteDataSet,djProteFile,djPPIFile,bProteAll, //proteomics methyGeneScoreMap,//methy promoter fastaFile, decodPath, regScoreFile, dProbBindingFunctional, miRNAWeight, tfWeight, filtermiRNAExp,pweight); ((DREM_GoAnnotations) thetimehmm.theDataSet.tga).buildRecDREM( thetimehmm.treeptr, thetimehmm.theDataSet.genenames); thetimehmm.traverse(thetimehmm.treeptr, 0, true); thetimehmm.traverse(thetimehmm.treeptr, 0, false); final DREM_Timeiohmm fthetimehmm = thetimehmm; try { //export /* DREMGui theDREMGui = new DREMGui(fthetimehmm, fthetimehmm.treeptr, brealXaxisDEF, dYaxisDEF, dXaxisDEF, nKeyInputTypeDEF, dKeyInputXDEF, dpercentDEF, "(Final Model)", dnodekDEF); */ jsonExport jse=new jsonExport(); jse.exportJsonFile(fthetimehmm,fthetimehmm.treeptr); PrintWriter pw = new PrintWriter(new FileWriter(szoutmodelfile)); pw.print(fthetimehmm.saveString(fthetimehmm.treeptr)); pw.close(); // Only need to save the activity scores when running SDREM if(fthetimehmm.regPriorsFile != null && !fthetimehmm.regPriorsFile.equals("")) { // TODO Temporarily commented out these function calls until // the rest of the SDREM code merge is complete. Need a // more elegant way to save activity scores. /* File outFile = new File(szoutmodelfile); DREMGui_SaveModel.saveActivityScoresDynamic(outFile, fthetimehmm, fthetimehmm.treeptr); DREMGui_SaveModel.saveActivityScores(outFile, fthetimehmm); */ } } catch (IOException ex) { ex.printStackTrace(System.out); } long e1 = System.currentTimeMillis(); System.out.println("Time: " + (e1 - s1) + "ms"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public String execute() throws Exception {\n Program program = programService.getProgram(id);\n DataElementGroup dataElementGroup = program.getDataElementGroup();\n IndicatorGroup indicatorGroup = program.getIndicatorGroup();\n\n if( deSelectedList.size() >0 || indSelecte...
[ "0.6621042", "0.636212", "0.6340213", "0.6182497", "0.61554605", "0.60627675", "0.60527736", "0.6050037", "0.6045425", "0.60259473", "0.59909594", "0.5972237", "0.59602714", "0.59602714", "0.59602714", "0.59167635", "0.58864194", "0.5877261", "0.58627385", "0.585566", "0.5855...
0.0
-1
get methy promoter scores
public HashMap<String,HashMap<String,Double>> getMethyScore(String djMethyFile, String djMethyGTF){ HashMap<String,HashMap<String,Double>> methyScoreMap=new HashMap<>(); //methy Score for gene promoter try{ BufferedReader br=new BufferedReader(new FileReader(djMethyFile)); String Line; String[] LineSplit; double mScore; String dg; String key; Line=br.readLine(); String timeName; //read in peak file get closet peak for each gene while ((Line=br.readLine())!=null){ Line=Line.trim(); LineSplit=Line.split("\\\t"); timeName=LineSplit[3].split("_")[0]; dg=LineSplit[3].split("_")[1].toUpperCase(); mScore=Double.parseDouble(LineSplit[4]); //key=timeName+','+dg.toUpperCase(); if (!methyScoreMap.containsKey(timeName)){ HashMap<String,Double> tmpTimeMap=new HashMap<>(); tmpTimeMap.put(dg, mScore); methyScoreMap.put(timeName,tmpTimeMap); }else{ methyScoreMap.get(timeName).put(dg,mScore); } } }catch (IOException e){ e.printStackTrace(); } return methyScoreMap; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "float getScore();", "float getScore();", "long getScore();", "long getScore();", "long getScore();", "long getScore();", "int getScore();", "float getSpecialProb();", "Float getScore();", "public void calculateProbabilities(){\n\t}", "public int getScore()\n {\n return points + extras...
[ "0.63892674", "0.63892674", "0.63230544", "0.63230544", "0.63230544", "0.63230544", "0.6264561", "0.6250333", "0.6194076", "0.6178206", "0.61437297", "0.6132037", "0.6124112", "0.61084306", "0.60719824", "0.60696745", "0.6045577", "0.6045577", "0.60421044", "0.5996669", "0.59...
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) { DateTime dt = new DateTime(); Calendar c1 = Calendar.getInstance(); c1.setTimeInMillis(dt.getMillis()); Calendar c2 = dt.toCalendar(Locale.getDefault()); System.out.println(c1.getTime()); System.out.println(c2.getTime()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
Protected helper method to returns the HashMap Index
protected HashMap<String, BPTree<Double, FoodItem>> getIndexes(){ return this.indexes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getIndex(int key_hash) {\n int capacity = hash_map.length;\n int index = key_hash % capacity;\n return index;\n }", "public abstract long getIndex();", "private static HashMap<String, Integer> getWordIndex()\n\t{\n\t\treturn aWordIndex;\n\t}", "public int getIndex(...
[ "0.7200024", "0.7057602", "0.7026514", "0.6982977", "0.6982977", "0.6982977", "0.68688315", "0.68688315", "0.68688315", "0.68688315", "0.68688315", "0.68688315", "0.68688315", "0.68688315", "0.68688315", "0.68688315", "0.68688315", "0.68688315", "0.68688315", "0.67957985", "0...
0.6934694
6
Private helper method to add nutritional data to index
private void nutritionInsert(FoodItem f) { HashMap<String, Double> nutrients = f.getNutrients(); // Add each nutrient/value pair in HashMap to nutrient's BPTree for(String i : nutrients.keySet()) { indexes.get(i).insert(nutrients.get(i), f); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private IndexKPIData populateIndexStaticData() {\n\t\tIndexKPIData kpiData = new IndexKPIData();\n\t\tkpiData.setRegion1Threshold(CommonConstants.FORTY_FIVE);\n\t\tkpiData.setRegion1Label(CommonConstants.IMPROVE);\n\t\tkpiData.setRegion1Color(CommonConstants.RED);\n\t\tkpiData.setRegion2Threshold(CommonConstants.H...
[ "0.56937325", "0.5657393", "0.5507128", "0.549219", "0.5491358", "0.5463708", "0.5448599", "0.5447362", "0.544618", "0.5425167", "0.5392922", "0.53792477", "0.5367868", "0.5333112", "0.5307149", "0.52943355", "0.52865684", "0.52564937", "0.523268", "0.5195709", "0.5195097", ...
0.60466665
0
filterByNutrients gets all the food items that have name containing the substring.
@Override public List<FoodItem> filterByName(String substring) { //turn foodItemList into a stream to filter the list and check if any food item matched return foodItemList.stream().filter(x -> x.getName().toLowerCase() .contains(substring.toLowerCase())).collect(Collectors.toList()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public List<FoodItem> filterByName(String substring) {\n if (foodItemList == null || foodItemList.size() == 0)\n return foodItemList;\n List<FoodItem> foodCandidate = new ArrayList<>();\n \tfor (FoodItem food : foodItemList) {\n if (food.getName().equal...
[ "0.7018352", "0.68900096", "0.62043923", "0.5911217", "0.5808874", "0.5807661", "0.57234526", "0.57234526", "0.562723", "0.56209964", "0.5608646", "0.5570532", "0.5501044", "0.5441283", "0.543097", "0.54277873", "0.53856343", "0.5361939", "0.53469443", "0.5297465", "0.5280198...
0.7105968
0
filterByNutrients gets all the food items that fulfill aLL the provided rules and return them in a list
@Override public List<FoodItem> filterByNutrients(List<String> rules) { // copy foodItemList List<FoodItem> filtered = new ArrayList<FoodItem>(foodItemList); String[] ruleArray; // iterate over inputed rules List for(String r : rules) { ruleArray = r.split(" "); // slit array into individual strings ruleArray[0] = ruleArray[0].toLowerCase(); // case insensitive for nutrients // obtain nutrient and value pair BPTree<Double, FoodItem> bpTree = indexes.get(ruleArray[0]); double doubleValue = Double.parseDouble(ruleArray[2]); // create a list of FoodItems corresponding to filter List<FoodItem> list = bpTree.rangeSearch(doubleValue, ruleArray[1]); filtered = filtered.stream().filter(x -> list.contains(x)).collect(Collectors.toList()); } return filtered; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static List<Nutrient> getFoodNutrients(ItemStack eatingFood) {\n\t\tList<Nutrient> nutrientsFound = new ArrayList<>();\n\n\t\t// Loop through nutrients to look for food\n\t\tfoodSearch:\n\t\tfor (Nutrient nutrient : NutrientList.get()) { // All nutrients\n\t\t\t// Search foods\n\t\t\tfor (ItemStack listedFo...
[ "0.58456683", "0.56683654", "0.55405587", "0.55397135", "0.5407315", "0.5405279", "0.53569126", "0.51978046", "0.5176422", "0.5154059", "0.5147202", "0.5143303", "0.5138024", "0.51291084", "0.51273966", "0.51032704", "0.5101489", "0.50892687", "0.50874126", "0.5049619", "0.50...
0.7900273
0
/ Returns the (cost,performance) entry with largest cost not exceeding c. (or null if no entry exist with cost c or less).
public Entry<Integer, Integer> best(int cost){ return map.floorEntry(cost); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Computer findMostExpensiveComputerV3( ) {\n\n\t\tComputer highest= computers.get(0);\n\n\t\tfor (Computer c : computers)\n\t\t\tif (highest.getPrice()<c.getPrice()) {\n\t\t\t\thighest=c;\n\n\t\t\t}\n\n\n\t\treturn highest;\n\t}", "public Computer findMostExpensiveComputerV2( ) { \n\t\tComputer highest= c...
[ "0.64005804", "0.62384945", "0.6187231", "0.60811055", "0.6013977", "0.59891474", "0.5923152", "0.59039694", "0.5895008", "0.57701355", "0.5718369", "0.5582058", "0.55734485", "0.557078", "0.5492351", "0.54033285", "0.53752404", "0.53714967", "0.5320421", "0.53094184", "0.526...
0.66861236
0
/ Add a new entry with given cost c and performance p.
public void add(int c, int p){ Entry<Integer, Integer> other = map.floorEntry(c); // other is at least as cheap if(other!=null && other.getValue()>=p){ // if its performance is as good, return; // (c,p) is dominated, so ignore } map.put(c,p); // else, add (c,p) to database // and now remove any entries that are dominated by the new one other = map.higherEntry(c); while(other!=null && other.getValue()<=p){ // if not better performance map.remove(other.getKey()); // remove the other entry other = map.higherEntry(c); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void addToCost() {\n\t\t\r\n\t}", "public void add_cost(float cost){\n costs[next_index] = cost;\n next_index++;\n }", "public abstract void addPerformanceEntry(PerformanceEntry __e)\n\t\tthrows NullPointerException;", "public void addCostItem(CostItem item) throws Cost...
[ "0.6670224", "0.6383625", "0.6114312", "0.6039046", "0.6030578", "0.5941551", "0.58435285", "0.5641669", "0.5597963", "0.55978787", "0.55777675", "0.5520191", "0.5504937", "0.5479258", "0.54496884", "0.5430298", "0.541265", "0.5402012", "0.53936636", "0.53803796", "0.5375928"...
0.64306986
1
Write your solution here
public List<List<Integer>> layerByLayer(TreeNode root) { List<List<Integer>> res = new ArrayList<>(); if(root == null) { return res; } Queue<TreeNode> queue = new ArrayDeque<>(); queue.offer(root); int size = 0; while(!queue.isEmpty()) { size = queue.size(); List<Integer> list = new ArrayList<>(); while(size > 0) { TreeNode node = queue.poll(); list.add(node.key); if(node.left != null) { queue.offer(node.left); } if(node.right != null) { queue.offer(node.right); } size--; } res.add(list); } return res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void generateSolution() {\n\t\t// TODO\n\n\t}", "public void solution() {\n\t\t\n\t}", "public void findSolution() {\n\n\t\t// TODO\n\t}", "public static String solution() {\r\n\t\treturn \"73162890\";\r\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(solution());\r\n\t}", ...
[ "0.75719035", "0.74944717", "0.6431267", "0.6300665", "0.6254568", "0.61911374", "0.60910475", "0.6049933", "0.60051423", "0.6002172", "0.5965524", "0.5956326", "0.5955198", "0.59388304", "0.5937435", "0.5905292", "0.5895413", "0.5895027", "0.58842075", "0.58707607", "0.58511...
0.0
-1
Check if no view has focus:
private void hideKeyboard() { InputMethodManager inputMgr = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); EditText editText = (EditText)findViewById(R.id.searchtext); inputMgr.hideSoftInputFromWindow(editText.getWindowToken(), 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static boolean m36208d(View view) {\n return view != null && view.hasWindowFocus();\n }", "public boolean hasFocus() {\n return hasFocus;\n }", "@Override\r\n\tpublic boolean isFocused() {\n\t\treturn false;\r\n\t}", "boolean hasFocus() {\n\t\t\tif (text == null || text.isDisposed())...
[ "0.752144", "0.71540445", "0.71503836", "0.71252257", "0.6989558", "0.6839896", "0.6835727", "0.68034774", "0.67644054", "0.6644914", "0.65743554", "0.65302986", "0.6448699", "0.643322", "0.6394429", "0.6380685", "0.63306206", "0.6325382", "0.63178706", "0.62391496", "0.62239...
0.0
-1
Inflate the menu; this adds items to the action bar if it is present.
@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.main, menu); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater();\n \tinflater.inflate(R.menu.main_activity_actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {...
[ "0.7246102", "0.7201358", "0.7194834", "0.7176498", "0.71066517", "0.7039537", "0.7037961", "0.70112145", "0.70094734", "0.69807225", "0.6944953", "0.69389373", "0.6933199", "0.6916928", "0.6916928", "0.6891486", "0.68831646", "0.68754137", "0.68745375", "0.68621665", "0.6862...
0.0
-1
Unit Test Tests reading parameters from url
@Test public void testParseBody() throws IOException { Socket socket = null; checkParseBody(new HTTPRequestHandler(socket, "log/TestFile.log"), "query=jumpers&asin=B123&message=hello!", "jumpers", "query"); checkParseBody(new HTTPRequestHandler(socket, "log/TestFile.log"), "query=jumpers&asin=B123&message=hello!", "B123", "asin"); checkParseBody(new HTTPRequestHandler(socket, "log/TestFile.log"), "query=jumpers&asin=B123&message=hello!", "hello!", "message"); checkParseBody(new HTTPRequestHandler(socket, "log/TestFile.log"), "query=&asin=!@#$%^&*&message=i have space", null , "query"); checkParseBody(new HTTPRequestHandler(socket, "log/TestFile.log"), "query=&asin=!@#$%^&*&message=i have space", "!@#$%^", "asin"); checkParseBody(new HTTPRequestHandler(socket, "log/TestFile.log"), "query=&asin=!@#$%^&*&message=i have space", "i have space", "message"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void urlTest() {\n // TODO: test url\n }", "@Test\n\tpublic void testGetRequestParameter() {\n\t}", "@Test\n public void readUrl() throws IOException {\n\n }", "@Test //make sure it comes from testNG\n public void testWithQueryParameterAndList(){\n given().accept(C...
[ "0.69135296", "0.6592498", "0.63544834", "0.63418716", "0.62423664", "0.6240214", "0.6226386", "0.62006533", "0.6190896", "0.61310863", "0.60874885", "0.6038052", "0.6008034", "0.59620357", "0.5939901", "0.58820355", "0.58773935", "0.5873385", "0.58723944", "0.5855255", "0.58...
0.0
-1
Tests reading header request
@Test public void testParseHeader() throws IOException { ConfigurationManager config = new ConfigurationManager(); checkParseHeader("", "", "", false, ""); checkParseHeader("PUT /reviewsearch", "PUT", "/reviewsearch", false, ""); checkParseHeader("PULL /slackbot", "PULL", "/slackbot", false, ""); checkParseHeader("GET /slackbot", "GET", "/slackbot", false, ""); checkParseHeader("POST /slackbot", "POST", "/slackbot", false, ""); checkParseHeader("POST /reviewsearch", "POST", "/reviewsearch", false, ""); checkParseHeader("POST /reviewsearch?query=jumpers", "POST", "/reviewsearch", true, "query"); checkParseHeader("POST /reviewsearch?query=jumpers&unknown=unknown", "POST", "/reviewsearch", true, "unknown"); checkParseHeader("POST /reviewsearch?error", "POST", "/reviewsearch", false, "error"); checkParseHeader("GET /reviewsearch?query=jumpers", "GET", "/reviewsearch", true, "query"); checkParseHeader("GET /", "GET", "/", false, ""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\tpublic void verifyHeader() {\n\t\t\tHeaders head = response.getHeaders();\n\t\t\tAssert.assertEquals(head.getValues(\"Content-Type\").toString(), \"[application/json; charset=utf-8]\");\n\t\t}", "@Test(priority=5)\r\n\tpublic void validateHeader()\r\n\t{\r\n\t\tgiven()\r\n\t\t.get(\"https://reqres.in/ap...
[ "0.7065736", "0.68350166", "0.67212224", "0.6517742", "0.6489667", "0.64843816", "0.64580214", "0.6449997", "0.6402942", "0.6393359", "0.63865894", "0.636654", "0.63439703", "0.6320592", "0.63082516", "0.63076293", "0.6283331", "0.627504", "0.62710446", "0.6263893", "0.617972...
0.7032846
1
Tests response generated by the server
@Test public void testResponse() throws IOException { ConfigurationManager config = new ConfigurationManager(); HashMap<String, Handler> map = new HashMap<String,Handler>(); HashMap<String, String> parameters = new HashMap<String, String>(); checkResponse(new RequestObject("", "", parameters), HTTPConstants.BAD_REQUEST, map); checkResponse(new RequestObject("PUT", "/reviewsearch", parameters), HTTPConstants.NOT_ALLOWED, map); checkResponse(new RequestObject("PULL", "/slackbot", parameters), HTTPConstants.NOT_ALLOWED, map); checkResponse(new RequestObject("GET", "/slackbot", parameters), HTTPConstants.NOT_FOUND, map); checkResponse(new RequestObject("POST", "/slackbot", parameters), HTTPConstants.NOT_FOUND, map); map.put("/slackbot", new ChatHandler(config.getConfig())); checkResponse(new RequestObject("POST", "/slackbot", parameters), HTTPConstants.OK_HEADER, map); checkResponse(new RequestObject("POST", "/reviewsearch", parameters), HTTPConstants.NOT_FOUND, map); map.put("/reviewsearch", new ReviewSearchHandler(config.getConfig(), new InvertedIndex())); checkResponse(new RequestObject("POST", "/reviewsearch", parameters), HTTPConstants.OK_HEADER, map); parameters.put("query", "jumpers"); checkResponse(new RequestObject("POST", "/reviewsearch", parameters), HTTPConstants.OK_HEADER, map); parameters.put("unknown", "unknown"); checkResponse(new RequestObject("POST", "/reviewsearch", parameters), HTTPConstants.OK_HEADER, map); parameters.remove("query"); checkResponse(new RequestObject("GET", "/reviewsearch", parameters), HTTPConstants.OK_HEADER, map); checkResponse(new RequestObject("GET", "/", parameters), HTTPConstants.NOT_FOUND, map); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\t\tpublic void testRestSuccessfulResponse() throws Exception {\n\n\t\t\tString responseBody = TestUtils.getValidResponse();\n\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tResponseEntity<ResponseWrapper> responseEntity= prepareReponseEntity(responseBody);\n\t\t\t\t\n\t\t\t\tboolean flag=weatherService....
[ "0.72213477", "0.7196465", "0.7139907", "0.71368146", "0.70627326", "0.6996951", "0.6924421", "0.68872446", "0.68329364", "0.67214733", "0.66574043", "0.6653792", "0.66324097", "0.6591384", "0.65686935", "0.6565999", "0.655369", "0.6553098", "0.65403986", "0.6500088", "0.6470...
0.6824735
9
Integration Test tests the message sent to slack from intended parameters
@Test public void testMessageToSlack() { ConfigurationManager config = new ConfigurationManager(); HashMap<String, String> parameters = new HashMap<String, String>(); RequestObject request = new RequestObject("GET", "/slack", parameters); checkMessageToSlack(config.getConfig(), request, ""); parameters.put("message", "HELLO!"); checkMessageToSlack(config.getConfig(), request, ""); request.setMethod("POST"); checkMessageToSlack(config.getConfig(), request, "HELLO!"); parameters.remove("message"); parameters.put("asin", "ABC123"); checkMessageToSlack(config.getConfig(), request, ""); parameters.put("message", "BYE!"); checkMessageToSlack(config.getConfig(), request, "BYE!"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n @WithMockUser\n void integrationTest() throws Exception {\n\n //non-valid data\n integrationTest(\"pksajhyufd\");\n integrationTest(\"hfds43kj23 kj\");\n integrationTest(\"\\\"\\\"klhgf\\\"n.jhj\\\"\\\"lkljgt\");\n integrationTest(\"pksajhyufd\");\n integrationTest(\"dsakj...
[ "0.68608546", "0.6356382", "0.6308753", "0.62946886", "0.61848855", "0.61760795", "0.61662334", "0.611895", "0.6036441", "0.602674", "0.599317", "0.5977987", "0.5973637", "0.5922412", "0.587516", "0.58095044", "0.58017725", "0.579774", "0.5792851", "0.57921445", "0.57844615",...
0.80336845
0
Tests response body generated for specified paramters
@Test public void testShowResult() { ConfigurationManager config = new ConfigurationManager(); InvertedIndex index = new InvertedIndex(); FileManager manager = new FileManager(config.getConfig().getFileName(), index); HashMap<String, String> parameters = new HashMap<String, String>(); checkFindHandler(config.getConfig(), index, new RequestObject("", "", parameters), 0); parameters.put("asin", "ABCD"); checkFindHandler(config.getConfig(), index, new RequestObject("", "", parameters), 0); parameters.put("asin", "B00002243X"); checkFindHandler(config.getConfig(), index, new RequestObject("", "", parameters), 10); checkReviewSearchHandler(config.getConfig(), index, new RequestObject("", "", parameters), 0); parameters.put("query", "ASDAJKSDJHKASJK"); checkReviewSearchHandler(config.getConfig(), index, new RequestObject("", "", parameters), 0); parameters.put("query", "jumpers"); checkReviewSearchHandler(config.getConfig(), index, new RequestObject("", "", parameters), 8); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testAuthorsGetBody() {\n Integer ID = 1;\n given().\n pathParam(\"ID\", ID).\n when().\n get(\"/api/Authors/{ID}\").\n then().\n body(\n \"ID\", equalTo(ID),\n // Assuming the IDBook here is always 1 a...
[ "0.6639477", "0.6375265", "0.63543725", "0.62927306", "0.6236818", "0.6218765", "0.61944276", "0.61731505", "0.6161451", "0.61248666", "0.6120709", "0.6039405", "0.5996751", "0.5996228", "0.59560674", "0.59341305", "0.5923752", "0.5896105", "0.58941907", "0.5884848", "0.58835...
0.0
-1
Tests output given request
@Test public void checkProjectOutput() throws IOException { checkServerOutput(8080, "/reviewsearch", "", "GET", HTTPConstants.OK_HEADER); checkServerOutput(8080, "/reviewsearch", "", "PULL", HTTPConstants.NOT_ALLOWED); checkServerOutput(8080, "/reviewsearch", "query=the", "POST", HTTPConstants.OK_HEADER); checkServerOutput(8080, "/reviewsearch", "query=computer%20science", "POST", HTTPConstants.OK_HEADER); checkServerOutput(8080, "/reviewsearchcurl", "query=computer%20science", "POST", HTTPConstants.NOT_FOUND); checkServerOutput(8080, "/reviewsearch", "query=computer%20science&query=computer%20science", "POST", HTTPConstants.OK_HEADER); checkServerOutput(8080, "/find", "", "GET", HTTPConstants.OK_HEADER); checkServerOutput(8080, "/find", "", "PULL", HTTPConstants.NOT_ALLOWED); checkServerOutput(8080, "/find", "asin=the", "POST", HTTPConstants.OK_HEADER); checkServerOutput(8080, "/find", "asin=B00002243X", "POST", HTTPConstants.OK_HEADER); checkServerOutput(8080, "/findcurl", "asin=B00002243X", "POST", HTTPConstants.NOT_FOUND); checkServerOutput(8080, "/find", "asin=B00002243X&asin=B00002243X", "POST", HTTPConstants.OK_HEADER); checkServerOutput(9090, "/slackbot", "", "GET", HTTPConstants.OK_HEADER); checkServerOutput(9090, "/slackbot", "", "PULL", HTTPConstants.NOT_ALLOWED); checkServerOutput(9090, "/slackbot", "message=hello", "POST", HTTPConstants.OK_HEADER); checkServerOutput(9090, "/slackbot", "message=bye", "POST", HTTPConstants.OK_HEADER); checkServerOutput(9090, "/slackbotds", "message=bye", "POST", HTTPConstants.NOT_FOUND); checkServerOutput(9090, "/slackbot", "message=bye&message=bye", "POST", HTTPConstants.OK_HEADER); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void requestOutput();", "@Test\n\tpublic void testResponse() throws IOException {\n\t\tConfigurationManager config = new ConfigurationManager();\n\t\tHashMap<String, Handler> map = new HashMap<String,Handler>();\n\t\tHashMap<String, String> parameters = new HashMap<String, String>();\n\t\tcheckResponse(new Reque...
[ "0.65224785", "0.62956864", "0.61726135", "0.6116174", "0.5905134", "0.58592653", "0.57404774", "0.57182014", "0.5696563", "0.56284976", "0.5625587", "0.55940884", "0.5590862", "0.55899966", "0.55896854", "0.55612326", "0.55406755", "0.55354416", "0.5495472", "0.54863155", "0...
0.6010565
4
Methods Checks parsed body
public void checkParseBody(HTTPRequestHandler request, String param, String expected, String key) { request.parseParameters(param); Assert.assertEquals(expected, request.getRequest().getParameters().get(key)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean parseBody() {\n return true;\n }", "boolean hasBody();", "boolean hasBody();", "boolean hasBody();", "@Test\n\tpublic void testParseBody() throws IOException {\t\n\t\tSocket socket = null;\n\t\tcheckParseBody(new HTTPRequestHandler(socket, \"log/TestFile.log\"), \"query=jumpers&as...
[ "0.77520335", "0.6439743", "0.6439743", "0.6439743", "0.6119063", "0.61166555", "0.61097383", "0.597378", "0.5954209", "0.5908362", "0.5908362", "0.5908362", "0.5908362", "0.5908362", "0.5897512", "0.5803324", "0.5736518", "0.5736518", "0.5609793", "0.56049764", "0.56010926",...
0.55432665
27
Checks message sent to slack
public void checkMessageToSlack(Config config, RequestObject request, String message) { ChatHandler handler = new ChatHandler(config); StringWriter out = new StringWriter(); PrintWriter writer = new PrintWriter(out); handler.handle(writer, request); Assert.assertEquals(message, handler.getMessage()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\tpublic void testMessageToSlack() {\n\t\tConfigurationManager config = new ConfigurationManager();\n\t\tHashMap<String, String> parameters = new HashMap<String, String>();\n\t\tRequestObject request = new RequestObject(\"GET\", \"/slack\", parameters);\n\t\tcheckMessageToSlack(config.getConfig(), request, ...
[ "0.6769482", "0.6377816", "0.6188733", "0.5892933", "0.5852283", "0.5849893", "0.5810641", "0.5810641", "0.5810641", "0.5810641", "0.5810641", "0.5810641", "0.5810641", "0.5810641", "0.57931095", "0.5750239", "0.5740347", "0.5641732", "0.56411964", "0.5631771", "0.5486306", ...
0.7262262
0
checks output of find handler
public void checkFindHandler(Config config, InvertedIndex index, RequestObject request, int expectedSize) { StringWriter out = new StringWriter(); PrintWriter writer = new PrintWriter(out); FindHandler handler = new FindHandler(config, index); handler.handle(writer, request); Assert.assertEquals(expectedSize, handler.getList().size()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean errorFound()\r\n\t{\r\n\t\t\r\n\t}", "@Override\n\tpublic void find() {\n\n\t}", "@Override\n\tpublic void find() {\n\t\tSystem.out.println(\"find method\");\n\t}", "private String handleFindFileRequest(String request) {\r\n\t\tString[] commandFragments = Utils.splitCommandIntoFragments(reques...
[ "0.583341", "0.56927323", "0.56581736", "0.5523243", "0.54186976", "0.53576463", "0.5340288", "0.5287922", "0.52824056", "0.5254039", "0.5213672", "0.5202437", "0.519824", "0.51919556", "0.5188406", "0.50802565", "0.5064646", "0.50576043", "0.50440437", "0.4996193", "0.499143...
0.5258586
9
checks output of reviewsearch
public void checkReviewSearchHandler(Config config, InvertedIndex index, RequestObject request, int expectedSize) { StringWriter out = new StringWriter(); PrintWriter writer = new PrintWriter(out); ReviewSearchHandler handler = new ReviewSearchHandler(config, index); handler.handle(writer, request); Assert.assertEquals(expectedSize, handler.getList().size()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "final void checkMatch(String input,String url,String title)\r\n {\r\n String searchLine=removeHTMLTags(input); // remove html tags before search.\r\n // If the line contains non - HTML text then search it.\r\n\tif(searchLine.length()>0)\r\n\t{\r\n\t if(app.matchCase) // Check if case sensitive search\r\n...
[ "0.57911044", "0.5678335", "0.55018157", "0.5454128", "0.5448399", "0.542294", "0.54171735", "0.5401612", "0.5399379", "0.53952533", "0.5388239", "0.53674984", "0.53590894", "0.5339609", "0.53231233", "0.5246884", "0.52444154", "0.52075225", "0.51880944", "0.5178799", "0.5155...
0.52093387
17