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
An attribute ID to pull a "name" from for logging purposes.
public void setLoggedAttributeId(@Nullable @NotEmpty final String id) { checkSetterPreconditions(); loggedAttributeId = StringSupport.trimOrNull(id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getAttributeName(Object attr);", "public String getATTR_ID() {\n return ATTR_ID;\n }", "java.lang.String getAttribute();", "private String loadAttributeName() {\n return parseMapField().getKey();\n }", "@Override\n\tpublic String getName() {\n\t\treturn (String) attributes.get(\"name\"...
[ "0.67279834", "0.66573644", "0.6562426", "0.649175", "0.64615583", "0.6377213", "0.63657475", "0.6350647", "0.6350647", "0.6336073", "0.633213", "0.6289641", "0.6259762", "0.62133265", "0.6163584", "0.61328036", "0.6122796", "0.6120198", "0.61157346", "0.6103992", "0.6069174"...
0.6234422
13
Log a successful authentication based on a designated attribute ID or the NameID value.
protected void logSuccess() { String nameToLog = null; if (loggedAttributeId != null && attributeContext != null) { final IdPAttribute attrToLog = attributeContext.getIdPAttributes().get(loggedAttributeId); if (attrToLog != null && !attrToLog.getValues().isEmpty()) { nameToLog = attrToLog.getValues().get(0).getDisplayValue(); } } if (nameToLog == null && samlAuthnContext.getSubject() != null && samlAuthnContext.getSubject().getNameID() != null) { nameToLog = samlAuthnContext.getSubject().getNameID().getValue(); } log.info("{} SAML authentication succeeded for '{}'", getLogPrefix(), nameToLog); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void logincredentials() {\n\t\tutil.entertext(prop.getValue(\"locators.text.uname\"), \"admin\");\n\t\tutil.entertext(prop.getValue(\"locators.text.password\"), \"Admin123\");\n\t\tutil.ClickElement(prop.getValue(\"locators.button.regdesk\"));\n\t\tutil.ClickElement(prop.getValue(\"locators.button.login\"))...
[ "0.5593151", "0.5519122", "0.53453964", "0.53433627", "0.53376305", "0.52337", "0.5233567", "0.52141756", "0.5213086", "0.51554483", "0.5144095", "0.5126779", "0.5103719", "0.50917894", "0.50894374", "0.508378", "0.50439346", "0.49769622", "0.49720293", "0.49609956", "0.49565...
0.73848784
0
Process the inbound SAML Attributes.
private void processAttributes(@Nonnull final ProfileRequestContext profileRequestContext) { log.debug("{} Decoding incoming SAML Attributes", getLogPrefix()); final Multimap<String,IdPAttribute> mapped = HashMultimap.create(); try (final ServiceableComponent<AttributeTranscoderRegistry> component = transcoderRegistry.getServiceableComponent()) { final Response response = (Response) profileRequestContext.getInboundMessageContext().getMessage(); for (final Assertion assertion : response.getAssertions()) { for (final AttributeStatement statement : assertion.getAttributeStatements()) { for (final Attribute designator : statement.getAttributes()) { try { decodeAttribute(component.getComponent(), profileRequestContext, designator, mapped); } catch (final AttributeDecodingException e) { log.error("{} Error decoding inbound Attribute", getLogPrefix(), e); } } } } } catch (final ServiceException e) { log.error("Attribute transcoder service unavailable", e); return; } log.debug("{} Incoming SAML Attributes mapped to attribute IDs: {}", getLogPrefix(), mapped.keySet()); if (!mapped.isEmpty()) { attributeContext = profileRequestContext .getSubcontext(RelyingPartyContext.class) .getSubcontext(AttributeContext.class, true); attributeContext.setUnfilteredIdPAttributes(mapped.values()); attributeContext.setIdPAttributes(null); filterAttributes(profileRequestContext); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\npublic void processAttributes() {\n\t\n}", "Map getPassThroughAttributes();", "private void filterAttributes(@Nonnull final ProfileRequestContext profileRequestContext) {\n if (attributeFilterService == null) {\n log.warn(\"{} No AttributeFilter service provided\", getLogPrefix());...
[ "0.5926175", "0.55139595", "0.545148", "0.5410625", "0.5408983", "0.5296861", "0.5246535", "0.51956743", "0.51105314", "0.5100094", "0.5043476", "0.50347567", "0.4986177", "0.48950934", "0.4860184", "0.484934", "0.48075056", "0.4799294", "0.47666758", "0.4719757", "0.46767992...
0.7205726
0
Check for inbound attributes and apply filtering.
private void filterAttributes(@Nonnull final ProfileRequestContext profileRequestContext) { if (attributeFilterService == null) { log.warn("{} No AttributeFilter service provided", getLogPrefix()); return; } final AttributeFilterContext filterContext = profileRequestContext.getSubcontext(AttributeFilterContext.class, true); populateFilterContext(profileRequestContext, filterContext); try (final ServiceableComponent<AttributeFilter> component = attributeFilterService.getServiceableComponent()) { final AttributeFilter filter = component.getComponent(); filter.filterAttributes(filterContext); filterContext.getParent().removeSubcontext(filterContext); attributeContext.setIdPAttributes(filterContext.getFilteredIdPAttributes().values()); } catch (final AttributeFilterException e) { log.error("{} Error while filtering inbound attributes", getLogPrefix(), e); } catch (final ServiceException e) { log.error("{} Invalid AttributeFilter configuration", getLogPrefix(), e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addBusinessFilterToAttributes(ViewerFilter filter);", "private static Map<String, String> filterAttributes(Map<String, String> attributes, List<String> forbidden){\n Map<String, String> filtered = new HashMap<>();\n for(String key : attributes.keySet()){\n boolean forb = fals...
[ "0.5863504", "0.58064663", "0.5732489", "0.5679931", "0.5413499", "0.53748727", "0.5374869", "0.537463", "0.5325114", "0.5288847", "0.52845466", "0.52634543", "0.5251454", "0.52384025", "0.5151072", "0.51194036", "0.51107454", "0.5105731", "0.5105731", "0.5082357", "0.5072371...
0.6372682
0
Fill in the filter context data.
private void populateFilterContext(@Nonnull final ProfileRequestContext profileRequestContext, @Nonnull final AttributeFilterContext filterContext) { filterContext.setDirection(Direction.INBOUND) .setPrefilteredIdPAttributes(attributeContext.getUnfilteredIdPAttributes().values()) .setMetadataResolver(metadataResolver) .setRequesterMetadataContextLookupStrategy(null) .setIssuerMetadataContextLookupStrategy( new SAMLMetadataContextLookupFunction().compose( new RecursiveTypedParentContextLookup<>(ProfileRequestContext.class))) .setProxiedRequesterContextLookupStrategy(null) .setAttributeIssuerID(getResponderLookupStrategy().apply(profileRequestContext)) .setAttributeRecipientID(getRequesterLookupStrategy().apply(profileRequestContext)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setUpFilter() {\n List<Department> departmentsList = departmentService.getAll(0, 10000);\n departments.setItems(departmentsList);\n departments.setItemLabelGenerator(Department::getDepartment_name);\n departments.setValue(departmentsList.get(0));\n category.setItems(...
[ "0.6300605", "0.620794", "0.6002797", "0.5981324", "0.5957143", "0.59493095", "0.5806722", "0.5801845", "0.579412", "0.5793605", "0.57767254", "0.5747273", "0.57273644", "0.5702771", "0.56931806", "0.56822675", "0.5675494", "0.56695396", "0.5660952", "0.5626978", "0.5566707",...
0.68695277
0
se solicitar a quantidade tem que validar se nao utrapassou da necessidade gerenciadorPerifericos.getCmos().ler(CMOS.QUANTIDADE_ITEM_NECESSARIO_PARA_SEPARACAO)
public int exec(GerenciadorPerifericos gerenciadorPerifericos, ParametroMacroOperacao param){ BigDecimal quantidadeNecessaria = (BigDecimal)gerenciadorPerifericos.getCmos().ler(CMOS.QUANTIDADE_ITEM_NECESSARIO_PARA_SEPARACAO); TelaAVInicial tela = (TelaAVInicial) ServiceLocator.getInstancia().getTela(ConstantesTela.TELA_AV_INICIAL); tela.setCampoQuantidade(""); tela.setCampoDesconto(""); gerenciadorPerifericos.atualizaTela(tela); Produto produto = (Produto)gerenciadorPerifericos.getCmos().ler(CMOS.PRODUTO_ATUAL); BigDecimal quantidade = BigDecimal.ZERO; if (produto.getTipo().getId().equals(TipoProduto.UNIDADE_VARIAVEL)) { gerenciadorPerifericos.getCmos().gravar(CMOS.QUANTIDADE_ITEM, quantidadeNecessaria); } else { try { EntradaDisplay entrada = gerenciadorPerifericos.lerDados( new int[] { Tecla.CODIGO_ENTER}, Display.MASCARA_NUMERICA, 8); while (entrada.getTeclaFinalizadora() == Tecla.CODIGO_ENTER) { quantidade = new BigDecimal(entrada.getDado()); if (quantidade.doubleValue() == BigDecimal.ZERO.doubleValue()) { gerenciadorPerifericos.getDisplay().setMensagem(MensagensAV.getMensagem(this, "Quantidade Invalida [ESC]")); gerenciadorPerifericos.esperaVolta(); gerenciadorPerifericos.getDisplay().setMensagem(MensagensAV.getMensagem(this, "Digite a Quantidade")); entrada = gerenciadorPerifericos.lerDados( new int[] { Tecla.CODIGO_ENTER}, Display.MASCARA_NUMERICA, 8); } else if (quantidadeNecessaria.doubleValue() < quantidade.doubleValue()) { gerenciadorPerifericos.getDisplay().setMensagem(MensagensAV.getMensagem(this, "Quantidade Superior [ESC]")); gerenciadorPerifericos.esperaVolta(); gerenciadorPerifericos.getDisplay().setMensagem(MensagensAV.getMensagem(this, "Digite a Quantidade")); entrada = gerenciadorPerifericos.lerDados( new int[] { Tecla.CODIGO_ENTER}, Display.MASCARA_NUMERICA, 8); } else { break; } } } catch (AppException e) { return ALTERNATIVA_2; } } gerenciadorPerifericos.getCmos().gravar(CMOS.QUANTIDADE_ITEM, BigDecimal.ONE); return ALTERNATIVA_1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void validateQuantity() {\n if (numQuantity.isEmpty()) {\n numQuantity.setErrorMessage(\"This field cannot be left blank.\");\n numQuantity.setInvalid(true);\n removeValidity();\n }\n // Check that quantity is in acceptable range (range check)\n ...
[ "0.5755166", "0.55893207", "0.556941", "0.55090207", "0.54974437", "0.54652387", "0.54562324", "0.54421663", "0.53681064", "0.53493994", "0.5348549", "0.5323791", "0.5297526", "0.52798116", "0.52782387", "0.5277023", "0.5275661", "0.5253007", "0.5234831", "0.5221564", "0.5195...
0.5129702
24
Created by vinsfran on 20/07/17.
public interface MVP { interface ModelImpl{ public void retrievePersonas(); public void updateEsFavoritoPersona(Persona persona); } interface PresenterImpl{ public void retrievePersona(Bundle savedInstanceState); public void updateEsFavoritoPersona(Persona persona); public void showToast(String mensaje); public void showProgressBar(boolean status); public void setView(MVP.ViewImpl view); public Context getContext(); public void updateListaRecycler(ArrayList<Persona> personas); public void updateItemRecycler(Persona persona); public ArrayList<Persona> getPersonas(); } interface ViewImpl{ final String PERSONAS_KEY = "personas"; public void showToast(String mensaje); public void showProgressBar(int visibilidad); public void updateListaRecycler(); public void updateItemRecycler(int posicion); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "private stendhal() {\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", ...
[ "0.5895135", "0.58274347", "0.5752709", "0.5685863", "0.56731004", "0.5670563", "0.5670563", "0.5645399", "0.5635149", "0.5610693", "0.5577987", "0.557766", "0.55656046", "0.5563552", "0.55621743", "0.5546622", "0.5546622", "0.5546622", "0.5546622", "0.5546622", "0.5521701", ...
0.0
-1
gives a search result containing the parents of an array of INodePOs
protected List<SearchResultElement> getResultElementsFromNodes( IProgressMonitor monitor, INodePO[] reuse) { final List<SearchResultElement> reuseLoc = new ArrayList<SearchResultElement>(reuse.length); for (INodePO node : reuse) { INodePO parent = node.getSpecAncestor(); if (parent == null) { parent = node.getParentNode(); } if (parent != null) { Long id = node.getId(); String nodeName = GeneralLabelProvider.getTextImpl(node); reuseLoc.add(new SearchResultElement<Long>(NLS.bind( Messages.SearchResultPageElementLabel, new Object[] { parent.getName(), nodeName }), id, GeneralLabelProvider.getImageImpl(node), new NodeSearchResultElementAction(), node .getComment())); } monitor.worked(1); } return reuseLoc; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.util.List<java.lang.String>\n getParentIdList();", "public List getParents()\n {\n \tList result = new ArrayList();\n \tModelFacade instance = ModelFacade.getInstance(this.refOutermostPackage().refMofId());\n\n \tif (instance != null)\n \t{\n \t if (instance.isRepresentative(this.r...
[ "0.6278476", "0.6136853", "0.613341", "0.60267866", "0.586464", "0.58461666", "0.57650733", "0.57285714", "0.5694021", "0.56536967", "0.56471723", "0.5627704", "0.5611327", "0.55871457", "0.55523026", "0.5544639", "0.5529085", "0.5527041", "0.54991686", "0.5499068", "0.546910...
0.0
-1
Created by Dipak Malla Date: 6/30/14
public interface Sql { public java.sql.Connection InitConnection() throws RmodelException.CommonException, RmodelException.SqlException; public void setConnection(Connection connection); public void CloseConnection() throws RmodelException.SqlException; public java.sql.Connection getSqlConnection() throws RmodelException.SqlException; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final void mo51373a() {\n }", "public void mo38117a() {\n }", "public void mo4359a() {\n }", "private stendhal() {\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "protected boolean func_70814_o() { return tr...
[ "0.5643428", "0.54957974", "0.5493655", "0.5473036", "0.54227304", "0.5403032", "0.537292", "0.5367162", "0.536577", "0.5364682", "0.53543943", "0.53467906", "0.53467906", "0.53467906", "0.53467906", "0.53467906", "0.53467906", "0.53467906", "0.53438276", "0.5339794", "0.5328...
0.0
-1
Build a BooleanType object that contains a boolean object.
public BooleanType(final Boolean val) { this.b = val; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "BooleanValue createBooleanValue();", "BooleanValue createBooleanValue();", "BooleanValue createBooleanValue();", "BooleanValue createBooleanValue();", "@Override\n\t\tpublic BooleanType toBooleanType() {\n\t\t\treturn new BooleanType(false);\n\t\t}", "@Override\n\t\tpublic BooleanType toBooleanType() {\n...
[ "0.7647791", "0.7647791", "0.7647791", "0.7647791", "0.7441528", "0.7441528", "0.7110249", "0.7073544", "0.6990476", "0.6942106", "0.69376165", "0.69376165", "0.6913365", "0.6901858", "0.68445736", "0.68022275", "0.6723154", "0.671497", "0.67073303", "0.67031825", "0.66609025...
0.702368
8
Build a BooleanType object that contains a boolean object.
public BooleanType(final boolean val) { this.b = new Boolean(val); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "BooleanValue createBooleanValue();", "BooleanValue createBooleanValue();", "BooleanValue createBooleanValue();", "BooleanValue createBooleanValue();", "@Override\n\t\tpublic BooleanType toBooleanType() {\n\t\t\treturn new BooleanType(false);\n\t\t}", "@Override\n\t\tpublic BooleanType toBooleanType() {\n...
[ "0.7647791", "0.7647791", "0.7647791", "0.7647791", "0.7441528", "0.7441528", "0.7073544", "0.702368", "0.6990476", "0.6942106", "0.69376165", "0.69376165", "0.6913365", "0.6901858", "0.68445736", "0.68022275", "0.6723154", "0.671497", "0.67073303", "0.67031825", "0.66609025"...
0.7110249
6
Build a BooleanType object by taking the string that follows the ":" delimiter of the flattened data object and making a Boolean out of it.
public BooleanType(final String flatData) throws InvalidFlatDataException { TypeUtils.check(this, flatData); this.b = new Boolean(flatData.substring(flatData.indexOf(':') + 1)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static Value<Boolean> parseBoolean(String value) {\n try {\n if (value == null || value.isEmpty()) return empty();\n return of(Boolean.parseBoolean(value));\n } catch (NumberFormatException error) {\n return empty();\n }\n }", "boolean deserialize(String i...
[ "0.59814847", "0.5738209", "0.5626426", "0.5619841", "0.55792063", "0.55388224", "0.5514876", "0.55041635", "0.5462654", "0.54490495", "0.5415539", "0.5406642", "0.5404201", "0.54036796", "0.53757304", "0.5324668", "0.5323223", "0.53148973", "0.52390254", "0.5222074", "0.5203...
0.7609682
0
Returns the a text string "true" or "false" depending on the value in the boolean encapsulated in this instance.
public String toString() { return b.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String toString() { return this.booleanValue; }", "public static String toString(boolean value) {\n return value ? \"true\" : \"false\";\n }", "public String getBooleanTrueValue() {\n\t\treturn ( _sBooleanTrueValue != null ? _sBooleanTrueValue : \"\" );\n\t}", "private String booleanToString(fi...
[ "0.8383678", "0.80573934", "0.7943778", "0.78509605", "0.78355056", "0.78005147", "0.77335685", "0.73432475", "0.7273429", "0.7273429", "0.7260975", "0.7249813", "0.71453124", "0.71327347", "0.69719964", "0.6971708", "0.69635797", "0.6963428", "0.69050014", "0.69050014", "0.6...
0.0
-1
Returns the boolean primitive encapsulated in this instance.
public Boolean getValue() { return b; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public boolean getAsBoolean();", "public boolean getBoolean();", "boolean getBoolean();", "boolean getBoolean();", "public RubyBoolean getTrue() {\n return trueObject;\n }", "public Boolean asBoolean();", "boolean getBoolValue();", "boolean getBoolValue();", "public boolean get...
[ "0.8388188", "0.83022684", "0.8181924", "0.8181924", "0.81051004", "0.8084918", "0.8038853", "0.8038853", "0.79604954", "0.7937408", "0.79299086", "0.7879203", "0.78330034", "0.7822847", "0.7786047", "0.7771349", "0.7701003", "0.7643797", "0.7611793", "0.7589444", "0.7544753"...
0.76348716
18
Generates a flattened version of the data, of the type BooleanType:trueorfalse where content is the boolean encapsulated in the object.
public String flatten() { String data; // We use simple name, because the fleshed out version of this class is // in the default package for data types: de.nec.nle.siafu.data String fullClassName = this.getClass().getName(); String className = fullClassName.substring(fullClassName .lastIndexOf(".") + 1); data = className + ":"; data += b; return data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Parameters\n\tpublic static Iterable<Object> data() {\n\t\treturn Arrays.asList(true, false);\n\t}", "@Parameters\n\tpublic static List<Object[]> data() {\n\t\tfinal Object[][] data = new Object[][] {\n\t\t\t\t{ true, new Operator[] { TRUE } },\n\t\t\t\t{ true, new Operator[] { FALSE } },\n\t\t\t\t{ true, new O...
[ "0.59832644", "0.559702", "0.55466866", "0.55296195", "0.5463952", "0.54613006", "0.54613006", "0.54491097", "0.5391625", "0.53295493", "0.53219205", "0.5279257", "0.52634764", "0.5238206", "0.5195386", "0.51855046", "0.51670897", "0.51665705", "0.5163459", "0.515882", "0.512...
0.0
-1
Cambiar las palabaras a las que el escuchador responde
public void changeTracker(String[] tracks) { twitterStream.cleanUp(); FilterQuery filterQuery = new FilterQuery(); filterQuery.track(tracks); twitterStream.filter(filterQuery); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\n \n String palabaras[], palabraSelected=\"\";\n char juego[];\n char letra; \n char seguir; \n \n \n //puede volver a jugar.\n //con las palabras que no ha salido. Gastando palabras\n //en caso de no e...
[ "0.5472347", "0.54667664", "0.54414415", "0.53765273", "0.5362552", "0.5344893", "0.53401977", "0.5324387", "0.53067756", "0.5297884", "0.52152777", "0.52044886", "0.5188319", "0.51763535", "0.5175916", "0.51681954", "0.51453114", "0.5127615", "0.51236725", "0.5116999", "0.51...
0.0
-1
Finalizar el escuchador de mensajes de twitter
public void stopTrack() { twitterStream.shutdown(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void run() {\n String finalString = \"\";\n String str;\n while (true) {\n try {\n str = tweets.pop();\n finalString += (str + \"\\n\");\n ...
[ "0.61438197", "0.61277246", "0.6100454", "0.59996164", "0.5989075", "0.5790742", "0.57756", "0.57515895", "0.57514346", "0.5727656", "0.5724666", "0.56934947", "0.566958", "0.5642709", "0.5629476", "0.56273055", "0.56201535", "0.56048954", "0.56013143", "0.55800045", "0.55791...
0.0
-1
Main menu that will be called by the ToScreen Class
public static void main(){ int option = getUserOption(); /** switch case option start below */ switch (option){ case 1 : ToScreen.listEmployee(employee.getAllEmployee(), true); main(); break; case 2 : listStaffByCategory(); break; case 3 : ToScreen.listAdminStaffTask(employee.getAllAdminStaff(), true);main(); break; case 4 : searchStaffByName(); break; case 5 : ToScreen.listAnimal(animals.getAllAnimals(), true); main(); break; case 6 : ListAnimalByType(); break; case 7 : searchAnimalByName(); break; case 8 : MenuReception.main(); break; case 9 : System.exit(0); break; default: main(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void goToMenu() {\n game.setScreen(new MainMenuScreen(game));\n\n }", "private void goToMenu() {\n\t\tgame.setScreen(new MainMenuScreen(game));\n\n\t}", "public void menu(){\n super.goToMenuScreen();\n }", "private void mainMenu() {\r\n System.out.println(\"Canteen Management S...
[ "0.8148863", "0.807947", "0.8003046", "0.779581", "0.7775808", "0.77577513", "0.7747973", "0.7659292", "0.7502895", "0.7497632", "0.7435208", "0.7417633", "0.7400336", "0.7362945", "0.73477244", "0.73282707", "0.73166627", "0.72435033", "0.72346365", "0.7233945", "0.72006905"...
0.0
-1
Main menu options that will appear to the user.
public static void listMainMenuOptions(){ System.out.println("\nWelcome to Vet Clinic Program. Please choose an option from the list below.\n"); System.out.println("1: List all staff."); System.out.println("2: List staff by category."); System.out.println("3: List admin Staff performing a task."); System.out.println("4: Search for a specific member of staff by name."); System.out.println("5: List all animals."); System.out.println("6: List animals by type."); System.out.println("7: Search for a specific animal by name."); System.out.println("8: See the Queue to the Veterinary"); System.out.println("9: Exit"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void displayMenuOptions()\n {\n // display user options menu\n System.out.println(\"\");\n System.out.println(\"----------------------------------------------------\");\n System.out.println(\"\");\n System.out.println(\"COMMAND OPTIONS:\");\n System.out.println(...
[ "0.7697112", "0.7542785", "0.74884963", "0.74731165", "0.74664223", "0.7423666", "0.73931247", "0.7391315", "0.7390316", "0.7381809", "0.7363264", "0.7357404", "0.73300266", "0.73254865", "0.7304499", "0.7292009", "0.7288038", "0.72255003", "0.72229344", "0.72028214", "0.7198...
0.79812056
0
Option 2 of the main Menu. Method to print a list of Staff by category.
private static void listStaffByCategory(){ showMessage("Choose one category to list:\n"); showMessage("1 - Surgeon"); showMessage("2 - Nurse"); showMessage("3 - Vet"); showMessage("4 - Accountant"); showMessage("5 - ItSupport"); showMessage("6 - Secretary"); showMessage("7 - Back to previous menu."); int option = getUserStaffByCategory(); /** switch case option start below */ switch (option){ case 1 : ToScreen.listEmployee(employee.getSurgeonList(), true); listStaffByCategory(); break; case 2 : ToScreen.listEmployee(employee.getNurseList(), true); listStaffByCategory(); break; case 3 : ToScreen.listEmployee(employee.getVetList(), true); listStaffByCategory(); break; case 4 : ToScreen.listEmployee(employee.getAccountantList(), true); listStaffByCategory(); break; case 5 : ToScreen.listEmployee(employee.getItSupportList(), true); listStaffByCategory(); break; case 6 : ToScreen.listEmployee(employee.getSecretaryList(), true); listStaffByCategory(); break; case 7 : main(); break; default: listStaffByCategory(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void showMemberCategoryMenu() {\n System.out.println(\"Visa lista med: \");\n System.out.println(\"\\t1. Barnmedlemmar\");\n System.out.println(\"\\t2. Ungdomsmedlemmar\");\n System.out.println(\"\\t3. Vuxenmedlemmar\");\n System.out.println(\"\\t4. Seniormedlemmar\");\n ...
[ "0.65683013", "0.65576863", "0.6471369", "0.63960415", "0.60802996", "0.60568964", "0.602073", "0.5863194", "0.5755154", "0.5701935", "0.5695022", "0.5655973", "0.560649", "0.5602955", "0.55248016", "0.5519182", "0.54955935", "0.54855394", "0.54062474", "0.5373726", "0.535436...
0.77295107
0
Option 4 of the Main menu. Method to List a specific searched name of the Staff list. The user will type in the name he would like to search for and if it's matches a list with all staff with the name typed will appear otherwise no records will be showed
private static void searchStaffByName(){ showMessage("type the name you are looking for: \n"); String name = getUserTextTyped(); ToScreen.listEmployee(EmployeeSearch.employee(employee.getAllEmployee(),name), true); //condition to do another search by name or go back to the main menu //if the user decide for doing another search the method is called again, otherwise it will go back to the main menu int tryAgain = askForGoMainMenu("Would you like to search for another name or go back to main menu?\n Type 1 to search someone else \n Type 0 to go to menu. \n Choice: "); if(tryAgain == 1){ searchStaffByName(); } else { main(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void listStaffByCategory(){\n\t\t\n\t\tshowMessage(\"Choose one category to list:\\n\");\n\t\tshowMessage(\"1 - Surgeon\");\n showMessage(\"2 - Nurse\");\n showMessage(\"3 - Vet\");\n showMessage(\"4 - Accountant\");\n showMessage(\"5 - ItSupport\");\n showMessage(...
[ "0.6749939", "0.67187226", "0.6603954", "0.64136654", "0.63997924", "0.6387974", "0.625074", "0.612568", "0.610626", "0.6071516", "0.6053532", "0.60499036", "0.6035041", "0.6026132", "0.6011551", "0.5989311", "0.5982915", "0.5962357", "0.5933873", "0.59210056", "0.58884907", ...
0.7871892
0
Option 6 of the Main menu. Method to List animal by type
private static void ListAnimalByType() { showMessage("Choose one type to list:\n"); showMessage("1 - Dog"); showMessage("2 - Cat"); showMessage("3 - Bird"); showMessage("4 - Hamster"); showMessage("5 - Rabbit"); showMessage("6 - Back to previous menu."); int option = getUserAnimalByType(); /** switch case option start below */ switch (option){ case 1 : ToScreen.listAnimal(animals.getDogList(), true); ListAnimalByType(); break; case 2 : ToScreen.listAnimal(animals.getCatList(), true); ListAnimalByType(); break; case 3 : ToScreen.listAnimal(animals.getBirdList(), true); ListAnimalByType(); break; case 4 : ToScreen.listAnimal(animals.getHamsterList(), true); ListAnimalByType(); break; case 5 : ToScreen.listAnimal(animals.getRabbitList(), true); ListAnimalByType(); break; case 6 : main(); break; default: ListAnimalByType(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void showAnimalList() {\n\t\tshowAnimalList(Calendar.getInstance().getTime());\n\t}", "public void menuOptions(String type) {\n System.out.println(\"\\n\" + \"To select an option, type what's inside the parenthesis.\");\n System.out.println(\"While in a sub-menu -> (0) Back out of a sub-menu...
[ "0.6413172", "0.6358492", "0.6142717", "0.61263627", "0.6085633", "0.6051805", "0.5943571", "0.59435207", "0.58857316", "0.5875706", "0.58636177", "0.58623105", "0.58539647", "0.5804547", "0.57618344", "0.5760324", "0.5755722", "0.5711987", "0.57103676", "0.56964827", "0.5692...
0.8491248
0
Option 7 of the Main menu. Method to print a specific name of the animal list. The user will type in the name he would like to search for and if it's matches a list with all animals with the name typed will appear otherwise no records will be showed
private static void searchAnimalByName() { showMessage("type in the animal's name: \n"); String name = getUserTextTyped(); ToScreen.listAnimal(AnimalSearch.byName(name), true); //condition to do another search by name or go back to the main menu //if the user decide for doing another search the method is called again, otherwise it will go back to the main menu int tryAgain = askForGoMainMenu("Would you like to search for another name or go back to main menu?\n Type 1 to search someone else \n Type 0 to go to menu. \n Choice: "); if(tryAgain == 1){ searchAnimalByName(); } else { main(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void searchDisplay()\r\n {\r\n System.out.println();\r\n System.out.println(\"------------ Search Menu ----------------\");\r\n System.out.println(\"(1) By Registration Number\");\r\n System.out.println(\"(2) By Car Make and Car Model\");\r\n System.out.println(\"(3) B...
[ "0.6672788", "0.6486835", "0.64546245", "0.641961", "0.63907427", "0.6339918", "0.6325288", "0.63082874", "0.6303754", "0.61219865", "0.61207587", "0.60915405", "0.60327345", "0.6028509", "0.60146886", "0.6002805", "0.5980188", "0.597892", "0.59664375", "0.59413475", "0.59130...
0.76183325
0
Method to get the input from the user on the methods searchAnimalByName and searchStaffByName. It will give the option to do a new search by name or go back to the main menu.
private static int askForGoMainMenu(String message){ showMessage(message); BufferedReader myReader = new BufferedReader(new InputStreamReader(System.in)); int input; do { try { input = Integer.parseInt(myReader.readLine()); if ((input < 0) || (input>1)) { System.out.println("Please type 1 or 2.\n"); } }catch (Exception e) { System.out.println("Character invalid. Choose 1 or 2.\n"); input = 0; } } while ((input < 0) || (input>1)); return input; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void searchAnimalByName() {\n\t\tshowMessage(\"type in the animal's name: \\n\");\n\t\t\n\t\tString name = getUserTextTyped();\n\t\tToScreen.listAnimal(AnimalSearch.byName(name), true);\n\t\t\n\t\t//condition to do another search by name or go back to the main menu\n\t\t//if the user decide for doin...
[ "0.8144154", "0.7865828", "0.67403966", "0.6540235", "0.6312842", "0.6302419", "0.6299136", "0.62821263", "0.6253407", "0.62179613", "0.6189298", "0.6173357", "0.61598027", "0.61208487", "0.6069281", "0.60582346", "0.60415775", "0.60243744", "0.6021104", "0.60075885", "0.6006...
0.0
-1
Method to get the user input for Main menu
private static int getUserOption () { BufferedReader myReader = new BufferedReader(new InputStreamReader(System.in)); int input; do { listMainMenuOptions(); try { input = Integer.parseInt(myReader.readLine()); if ((input < 1) || (input>9)) { System.out.println("Please type in a number between 1-9 according to your choice"); } }catch (Exception e) { System.out.println("Character invalid. Please enter a number from 1-9 according to your choice"); input = 0; } }while ((input < 1) || (input>9)); return input; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static String mainMenu(){\n\t\tSystem.out.println(\"==================================\");\n\t\tSystem.out.println(\"Main Menu\");\n\t\tSystem.out.println(\"Please select from the following:\");\n\t\tSystem.out.println(\"1. Display all available courses and add course\");\n\t\tSystem.out.println(\"2. Displ...
[ "0.7776625", "0.77609104", "0.75564295", "0.753961", "0.7489911", "0.74814665", "0.7450357", "0.74361384", "0.74073577", "0.7400867", "0.7377877", "0.7346933", "0.7337927", "0.72630256", "0.72084075", "0.7184919", "0.71391547", "0.70981777", "0.70961493", "0.7047886", "0.7039...
0.63621885
84
Method to get the user input in the method ListStaffByCategory
private static int getUserStaffByCategory () { BufferedReader myReader = new BufferedReader(new InputStreamReader(System.in)); int input; do { try { input = Integer.parseInt(myReader.readLine()); if ((input < 1) || (input > 7)) { System.out.println("please type in a number between 1-7."); } }catch (Exception e) { System.out.println("Character invalid. Please enter a number between 1-7."); input = 0; } }while((input < 1) || (input > 7)); return input; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void listStaffByCategory(){\n\t\t\n\t\tshowMessage(\"Choose one category to list:\\n\");\n\t\tshowMessage(\"1 - Surgeon\");\n showMessage(\"2 - Nurse\");\n showMessage(\"3 - Vet\");\n showMessage(\"4 - Accountant\");\n showMessage(\"5 - ItSupport\");\n showMessage(...
[ "0.75325745", "0.6198277", "0.58742714", "0.5697243", "0.5518651", "0.5518651", "0.549119", "0.54704297", "0.5429432", "0.54270935", "0.5365048", "0.5338418", "0.5298383", "0.5258286", "0.5258286", "0.5243031", "0.52430016", "0.5228162", "0.5216454", "0.5192327", "0.5190146",...
0.7177477
1
Method to get the user input in the method ListAnimalByType
private static int getUserAnimalByType() { BufferedReader myReader = new BufferedReader(new InputStreamReader(System.in)); int input; do { try { input = Integer.parseInt(myReader.readLine()); if ((input < 1) || (input > 6)) { System.out.println("please type in a number between 1-6."); } }catch (Exception e) { System.out.println("Character invalid. Please enter a number between 1-6."); input = 0; } }while((input < 1) || (input > 6)); return input; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void ListAnimalByType() {\n\t\t\n\t\tshowMessage(\"Choose one type to list:\\n\");\n showMessage(\"1 - Dog\");\n showMessage(\"2 - Cat\");\n showMessage(\"3 - Bird\");\n showMessage(\"4 - Hamster\");\n showMessage(\"5 - Rabbit\");\n showMessage(\"6 - Back to...
[ "0.77497154", "0.62474775", "0.6154096", "0.6029328", "0.58186793", "0.5786908", "0.57795703", "0.573482", "0.5705912", "0.57013553", "0.5628115", "0.5614374", "0.55742824", "0.5529301", "0.54902136", "0.5461472", "0.5425226", "0.54051167", "0.53971595", "0.5365165", "0.53559...
0.7145789
1
Method to get the name typed by the user on the methods to search a specific staff or animal by name.
private static String getUserTextTyped () { BufferedReader myReader = new BufferedReader(new InputStreamReader(System.in)); Boolean loop = true; String text = ""; do { try { text = myReader.readLine(); if ((text.length() < 3)) { showMessage("Please type a minimum of 3 characters: \n"); } else { return text; } }catch (Exception e) { System.out.println("Character invalid."); } } while (loop); return text; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void searchStaffByName(){\n\t\tshowMessage(\"type the name you are looking for: \\n\");\n\t\tString name = getUserTextTyped();\n\t\tToScreen.listEmployee(EmployeeSearch.employee(employee.getAllEmployee(),name), true);\n\t\t\n\t\t//condition to do another search by name or go back to the main menu\n ...
[ "0.72722745", "0.7257384", "0.6570163", "0.6542084", "0.65397054", "0.6536232", "0.64627695", "0.643167", "0.6418719", "0.63470453", "0.6333543", "0.63008523", "0.6257944", "0.62536734", "0.6247303", "0.6232111", "0.6227078", "0.6195231", "0.6189114", "0.61684936", "0.6162625...
0.0
-1
Add comment if it's not persist and update else
@Override public Long saveOrUpdate(Comment comment) throws ServiceException { Long id = 0L; try { if (null == comment.getId()) { id = commentDao.add(comment); } else { commentDao.update(comment); } } catch (DaoException e) { logger.error("Can't save comment: " + e.getMessage(), e); throw new ServiceException("Can't save comment: " + e.getMessage(), e); } return id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void update(Comment comment);", "@Override\n public void update(Comment comment) {\n Session session = sessionFactory.getCurrentSession();\n session.saveOrUpdate(comment);\n }", "public void addComment(Comment comment){\n commentRepository.createComments(comment);\n }", "void s...
[ "0.6776861", "0.6671229", "0.6530623", "0.64735484", "0.64677376", "0.64666355", "0.62658054", "0.62652445", "0.6250447", "0.62193346", "0.6211906", "0.6203578", "0.61810035", "0.6165934", "0.61592364", "0.60973907", "0.6096214", "0.60532355", "0.6042353", "0.59937525", "0.59...
0.59587455
23
Creates new instance of ToNewPrepoc just prevent the user to do it.
private CanonizeSource() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "P createP();", "Compuesta createCompuesta();", "@Override\n \t\t\t\tpublic void doNew() {\n \n \t\t\t\t}", "public String actionCreateNew() {\r\n \t\tsetBook(new Book());\r\n \t\treturn \"new\";\r\n \t}", "Negacion createNegacion();", "Reproducible newInstance();", "private static PDP getPDPNewInstance...
[ "0.6127318", "0.59350747", "0.59111637", "0.57124084", "0.5703123", "0.5689008", "0.5659531", "0.5620623", "0.561046", "0.5607034", "0.5596059", "0.55775374", "0.55574024", "0.55526733", "0.55422735", "0.5512803", "0.55013204", "0.5492157", "0.5473651", "0.54726046", "0.54571...
0.0
-1
Read and canonize all lines form the file. The result of the file is in the StringBuffer _sb.
private boolean readLines(final File file) throws IOException { _lastCommentStart = -1; _lastCommentEnd = -1; _lastCommentLine = -1; _firstCommentStart = -1; _firstCommentEnd = -1; _linePos = -1; BufferedReader in = _charset == null ? new BufferedReader(new InputStreamReader( new FileInputStream(file))) : new BufferedReader(new InputStreamReader( new FileInputStream(file), _charset)); String line; boolean modified = false; while ((line = in.readLine()) != null) { _lines++; //cut final white spaces int len = line.length(); int i = len; int k; while((len > 0) && line.charAt(len - 1) <= ' ') { len--; } _linePos = _sb.length(); if (len == 0) { if (_linePos == 0) { //ignore leading empty lines modified = true; } else { modified |= i != len; if (_genCR) { _sb.append('\r'); //add CR } _sb.append('\n'); //add LF } continue; } if (_spacesToTab) { //makeTabsFromSpaces //replace leading spaces by tabs for (i = 0, k = 0; i < len; i++ ) { char ch = line.charAt(i); if (ch == '\t') { k = (((k + _indentSize - 1)/_indentSize) + 1) *_indentSize; } else if (ch == ' ') { k++; } else { break; } } if (i < len) { //not empty line for (int j = 0; j < (k / _indentSize); j++) { _sb.append('\t'); } if ((k = k % _indentSize) > 0) { _sb.append(_indentSpaces.substring(0, k)); } _sb.append(line.substring(i,len)); } } else { //makeSpacesFromTabs //replace leading tabs by spaces for (i = 0, k = 0; i < len; i++ ) { char ch = line.charAt(i); if (ch == '\t') { k = (((k+_oldIndent-1)/_oldIndent)+1)*_oldIndent; } else if (ch == ' ') { k++; } else { break; } } if (i < len) { //not empty line for (int j = 0; j < (k / _oldIndent); j++) { _sb.append(_indentSpaces); } if ((k = k % _oldIndent) > 0) { _sb.append(_indentSpaces.substring(0, k)); } _sb.append(line.substring(i,len)); } } modified |= !line.equals(_sb.substring(_linePos)); if (_lastCommentStart >= 0) { if (line.indexOf("*/") >= 0) { if (line.endsWith("*/")) { //only comment lines blocks _lastCommentLine = _linePos; _lastCommentEnd = _sb.length(); if (_firstCommentEnd == -1) { _firstCommentEnd = _lastCommentEnd; } } else { if (_firstCommentStart == _lastCommentStart) { _firstCommentStart = -1; } _lastCommentStart = -1; _lastCommentEnd = -1; _lastCommentLine = -1; } } } if (line.trim().startsWith("/*")) { if (line.indexOf("*/") < 0) { //only more lines blocks _lastCommentStart = _linePos; _lastCommentLine = -1; _lastCommentEnd = -1; if (_firstCommentStart == -1) { _firstCommentStart = _linePos; } } } if (_genCR) { _sb.append('\r'); //add CR } _sb.append('\n'); //add LF } in.close(); return modified; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String readLines() {\n\n String fileAsString;\n fileAsString = read();\n StringBuilder newString = new StringBuilder();\n if (fileAsString != null) {\n if (fromLine == toLine) {\n\n newString = new StringBuilder(fileAsString.split(\"\\n\")[fromLine - 1])...
[ "0.59136015", "0.5758188", "0.57529885", "0.5710477", "0.5669792", "0.5559478", "0.5556947", "0.5543457", "0.5536681", "0.5534768", "0.5528175", "0.55137414", "0.55037546", "0.5473463", "0.54651034", "0.54610574", "0.5393789", "0.53671753", "0.53410876", "0.5293302", "0.52876...
0.62969184
0
Get array of existing files represented by given argument. The argument can either represent one concrete file or it can represent a set of files with wildcards '' and/or '?'.
private File[] getWildCardFiles(final String wildName) { if (wildName.indexOf('*') < 0 && wildName.indexOf('?') < 0) { File f = new File(wildName); return f.exists() ? new File[]{f} : new File[0]; } String wn = wildName.replace('\\','/'); File dir; int i; if ((i = wn.lastIndexOf('/')) >= 0) { dir = new File(wn.substring(0,i)); wn = wn.substring(i + 1); } else { try { File f = new File("."); if (f.isDirectory()) { dir = new File(f.getCanonicalPath()); } else { throw new RuntimeException("Actual path isn't accessable"); } } catch (Exception ex) { throw new RuntimeException("Actual path isn't accessable"); } } return dir.listFiles(new NameWildCardFilter(wn, false)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "List<String> getFiles(String path, String searchPattern, String searchOption) throws IOException;", "List<String> getFiles(String path, String searchPattern) throws IOException;", "public abstract List<String> getFiles( );", "List<String> getFiles(String path) throws IOException;", "List<Path> getFiles();"...
[ "0.7223113", "0.6856415", "0.66592187", "0.6551603", "0.6444658", "0.63981974", "0.6372078", "0.6361486", "0.63323426", "0.63009673", "0.6250309", "0.62209904", "0.6207952", "0.6188583", "0.6169052", "0.6127211", "0.6099022", "0.6091276", "0.6086783", "0.6050882", "0.60467553...
0.5983225
24
Call CanonizeSource from program.
public static String canonize(final String input, final String outDir, final boolean dirTree, final PrintStream out, final PrintStream err, final boolean verbose, final boolean genCR, final boolean spacesToTab, final int indentSize, final int newIndent, final String header, final boolean headerKeep, final String tail, final boolean tailKeep, final String charset) { CanonizeSource cs = new CanonizeSource(); cs._charset = charset; File f; String s = outDir; if (s == null || (s = s.trim()).length() == 0) { s = null; } else { f = new File(s); if (!f.exists() || !f.isDirectory()) { return "Incorrect output directory."; } s = f.getAbsolutePath() + File.separatorChar; } Date datetime = new Date(); String user = System.getProperties().getProperty("user.name"); try { //read header template file cs._header = updateInfo(header, datetime, user, "header", charset); if (cs._header != null && cs._header.length() > 0) { if (genCR) { cs._header += "\r\n\r\n"; } else { cs._header += "\n\n"; } } cs._headerKeep = headerKeep; //read tail template file cs._tail = updateInfo(tail, datetime, user, "tail", charset); if (cs._tail != null && cs._tail.length() > 0) { cs._tail = (genCR ? "\r\n\r\n" :"\n\n") + cs._tail; } cs._tailKeep = tailKeep; } catch (Exception ex) { return ex.toString(); } cs._out = out; cs._err = err; cs._processedCount = cs._modifyCount = 0; cs._verbose = verbose; cs._spacesToTab = spacesToTab; if (indentSize < 0 || indentSize >= 20) { return "Incorrect value of indenting size: " + indentSize; } if (newIndent <= 0) { cs._oldIndent = cs._indentSize = indentSize; } else { if (newIndent < 0 || newIndent >= 20) { return "Incorrect value of new indenting size: " + indentSize; } cs._oldIndent = indentSize; cs._indentSize = newIndent; } cs._indentSpaces = ""; for (int i = 0; i < cs._indentSize; i++) { cs._indentSpaces += " "; } String inp = input.replace('\\', '/'); cs._genCR = genCR; File dir = null; if (dirTree) { int i = inp.lastIndexOf('/'); if (i >= 0) { cs._mask = inp.substring(i + 1); dir = new File(inp.substring(0,i)); } else { cs._mask = inp; try { f = new File("."); if (f.isDirectory()) { dir = f; } } catch (Exception ex) {} } } if (dir != null) { cs.processFiles(dir, s, false); } else { File[] files = cs.getWildCardFiles(inp); if (files == null || files.length == 0) { return null; } for (int i = 0; i < files.length; i++) { cs.processFile(files[i], s, false); } } if (err != null) { err.flush(); } if (verbose && out != null && cs._processedCount > 0) { out.println("Inspected " + cs._processedCount + " file(s), changed " + cs._modifyCount + "."); out.flush(); } System.out.println("Processed " + cs._lines + " lines."); return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private CanonizeSource() {}", "public static void main(String[] args) {\n Sourceable sourceable1 = new SourceSub1();\n Sourceable sourceable2 = new SourceSub2();\n\n sourceable1.method1();\n sourceable1.method2();\n sourceable2.method1();\n sourceable2.method2();\n }"...
[ "0.696556", "0.5357553", "0.50346124", "0.5008851", "0.5002372", "0.49716693", "0.4963299", "0.49042225", "0.48707098", "0.48594058", "0.4854447", "0.48311535", "0.4795893", "0.47750536", "0.47692734", "0.47667834", "0.47666964", "0.47605968", "0.47571364", "0.47355866", "0.4...
0.0
-1
Canonize sources according to arguments. and print results.
public static void canonize(final String sources, final boolean dirTree, final boolean tabs, final int n, final String header, final String tail, final String charset, final boolean crlf) { try { int len = 3; if (dirTree) { len++; } if (n >= 0) { len += 2; } if (header != null) { len += 2; } if (tail != null) { len += 2; } if (charset != null && !charset.trim().isEmpty()) { len += 2; } String[] myArgs = new String[len]; myArgs[0] = "-i"; myArgs[1] = sources; myArgs[2] = "-v"; int ndx = 3; if (dirTree) { myArgs[ndx++] = "-r"; } if (n >= 0) { if (tabs) { myArgs[ndx++] = "-t"; myArgs[ndx++] = String.valueOf(n); } else { myArgs[ndx++] = "-s"; myArgs[ndx++] = String.valueOf(n); } } if (header != null) { myArgs[ndx++] = "-c"; if (header.length() == 0) { myArgs[ndx++] = "nul"; } else { myArgs[ndx++] = header; } } if (tail != null) { myArgs[ndx++] = "-e"; if (tail.length() == 0) { myArgs[ndx++] = "nul"; } else { myArgs[ndx++] = tail; } } if (charset != null && !charset.trim().isEmpty()) { myArgs[ndx++] = "-encoding"; myArgs[ndx++] = charset; } String errMsg = canonize(myArgs, System.out, System.err); if (errMsg != null) { System.err.println("[ERROR] " + errMsg); } } catch (Exception ex) { ex.printStackTrace(System.err); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static public void main(String argv[]) {\n for (String s : argv) {\n if (s.equals(\"-a\")) {\n SHOW_TREE = true;\n }\n else if (s.equals(\"-s\")) {\n SHOW_SYM_TABLES = true;\n }\n else if (s.equals(\"-c\")) {\n GENERATE_CODE = true;\n }\n //Check if the st...
[ "0.6004504", "0.5939478", "0.5708194", "0.5691807", "0.56355006", "0.56288755", "0.555558", "0.554051", "0.5489101", "0.53709793", "0.53541225", "0.53479487", "0.53432566", "0.5343216", "0.53405786", "0.5338655", "0.5335675", "0.5330087", "0.5305503", "0.5299184", "0.52676183...
0.49883783
59
Print message and cancel program with exit code.
private static void cancel(final int exitCode, final String msg) { System.out.flush(); System.err.flush(); System.err.println((msg == null ? "CanonizeSource.\n" +"All lines of the source data are checked for leading and trailing white spaces.\n" +"Trailing spaces and tabs are removed and leading spaces are replaced by\n" +"tabs or by spaces according to the value of switches -t or -s.If the\n" +"switch -n n is defined it is used as number of indenting positions for\n" +"tabs. If -c switch is set on then the header (copyright) information is\n" +"inserted (or the old one is replaced) as a comment on the top of source data.\n" +"If -e switch is set on then the final information is added to the end of source\n" +"data. If the switch is -cc or -ee the existing information is not replaced.\n" : "[ERROR] " + msg + "\n" ) +"usage: -i input [-r] [-o outDir] [(-t|-s) [n]] [-n n] [-h] [-c hdr] [-e tail]\n" +"where\n" +"-i input The input may be specified as a file or as the group of files\n" +" specified by wildcards '*' or '?'. The parameter is obligatory.\n" +"-r process directory tree. The parameter is optional.\n" +"-o outDir The directory where the output files are stored. The switch\n" +" is optional. If it is missing the source files are overwritten.\n" +"-t [n] n is the number of spaces which are replaced by tab key codes.\n" +" The switch is optional. If n is missing the value '4' is set as default.\n" +"-s [n] n is the number of spaces replacing tab key codes. The parameter\n" +" is optional. If it is missing the value '4' is set as default. \n" +"-n n n is the new number of spaces replacing tab key. The parameter\n" +" is optional. If it is missing the value or -t or -s is set as default.\n" +"-cr lines are separated by the couple of CR LF. The parameter is optional.\n" +"-c hdr the file with the header information (existing one will be replaced)\n" +"-cc hdr the file with the header information (existing one is not replaced)\n" +"-e end the file with the final information (existing one will be replaced)\n" +"-ee end the file with the final information (existing one is not replaced)\n" +"-encoding charset name of character setof data, if it is not specified then\n" +" the system character set is used. The parameter is optional.\n" +"-l if specified the end of lines are generated as CR LF, otherwise only LF.\n" +"-h: displays the help text.\n" +"The switches -t and -s are exclusive. If none of them is specified the\n" +"the default value is set to '-s 4'.\n" +"The switches -c, -cc and -e, -ee are exclusive.\n" +"\n" +"Both header an final information may contain following tags which will\n" +"be replaced by adequate information:\n" +"&{USER} ........ user login name\n" +"&{DATE} ........ actual date and time in localized Java format\n" +"&{ISODATE} ..... actual date and time in ISO 8601 format\n" +"&{DATE mask} ... actual date and/or time in format given by Java mask\n" +"&{FILENAME} .... The name of file\n" +"&{PATHNAME} .... The absolute path and name of file\n"); System.err.flush(); if (exitCode >= 0) { System.exit(exitCode); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t\t\tpublic void cancel() {\n\t\t\t\tSystem.exit(0);\n\t\t\t}", "final private static void abort (final String message) {\n\t\tSystem.out.println(message) ;\n\t\tSystem.exit (1) ;\n }", "public void quit(){\n this.println(\"Bad news!!! The library has been cancelled!\");\n System.ex...
[ "0.74662113", "0.73048234", "0.7134426", "0.6963974", "0.6833705", "0.6682587", "0.6666717", "0.6597784", "0.6566036", "0.6533495", "0.652184", "0.6513841", "0.6458793", "0.6393396", "0.6339707", "0.63247454", "0.63127756", "0.62695223", "0.62652117", "0.62451404", "0.6212119...
0.61587083
28
vai ser garantido que a musica em questao sera removida de todas as playlists
public void removeAll(Musica musica)throws Exception{ for( String chave : this.getPlaylists().keySet() ){ Playlist playlistAtual = this.getPlaylists().get(chave); //aqui vai ser lancada uma exception caso a musica seja null playlistAtual.removeMusica(musica); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@FXML\n\t\t \tprivate void BorrarSongfromPlylist() {\n\t\t \t\tList_Song a = new List_Song();\n\t\t \t\tPlaylist select= tablaPlayList.getSelectionModel().getSelectedItem();\n\t\t \t\tSong selected=tablaCancionesPlaylist.getSelectionModel().getSelectedItem();\n\t\t \t\tif ( selected != null && select!=null) {\n\t\...
[ "0.6130282", "0.61127186", "0.6076129", "0.60205853", "0.59649533", "0.59103173", "0.590509", "0.58856326", "0.57808244", "0.576242", "0.5760263", "0.57417744", "0.5727873", "0.570189", "0.5680917", "0.5680905", "0.56799006", "0.5659785", "0.565205", "0.5629548", "0.562564", ...
0.6253839
0
metodos de funcionamento interno
private void valida(String str)throws Exception{ if(str == null || str.trim().isEmpty()){ throw new Exception("Nao eh possivel trabalhar com valores vazios ou null."); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void operacao();", "Funcionario(){\n }", "@Override\n protected void adicionar(Funcionario funcionario) {\n\n }", "public FuncionesSemanticas(){\r\n\t}", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}", "void pas...
[ "0.7274245", "0.7095497", "0.6971111", "0.6866685", "0.65649027", "0.65216637", "0.65157753", "0.6490673", "0.6471234", "0.6471234", "0.6463641", "0.64064914", "0.6369421", "0.6360939", "0.6360939", "0.63295287", "0.6304683", "0.6299758", "0.62133783", "0.62123746", "0.619938...
0.0
-1
parse request information to instatiate corresponding Review Object
private Review parseReview(HttpServletRequest req) { String name = req.getParameter("name"); String reviewer = req.getParameter("reviewer"); String date = (String) req.getParameter("date") + " " + req.getParameter("time"); String promotion = req.getParameter("promotion"); String description = req.getParameter("description"); return new Review(name, date, promotion, description, reviewer); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected Review() {}", "private PredictRequest() {\n\t}", "public ReviewInfo()\n {\n m_nReviewValue = REVIEW_VALUE_POSITIVE;\n m_nID = 1;\n m_type = EntityType.kPolices;\n m_strReviewText = \"\";\n }", "public Review() {\n this.review_id = \"\";\n this.user_id...
[ "0.61644775", "0.59855056", "0.59841526", "0.5914251", "0.5838569", "0.5796671", "0.57658356", "0.5731013", "0.5679111", "0.5646494", "0.5610039", "0.5452599", "0.5395403", "0.53573316", "0.5293012", "0.5287728", "0.52827114", "0.52448446", "0.5232915", "0.52254766", "0.52031...
0.81297225
0
The AccessManager can be queried to determines whether permission is granted to perform a specific action on a specific item.
public interface AccessManager { /** * predefined action constants */ public String READ_ACTION = javax.jcr.Session.ACTION_READ; public String REMOVE_ACTION = javax.jcr.Session.ACTION_REMOVE; public String ADD_NODE_ACTION = javax.jcr.Session.ACTION_ADD_NODE; public String SET_PROPERTY_ACTION = javax.jcr.Session.ACTION_SET_PROPERTY; public String[] READ = new String[] {READ_ACTION}; public String[] REMOVE = new String[] {REMOVE_ACTION}; /** * Determines whether the specified <code>permissions</code> are granted * on the item with the specified path. * * @param parentState The node state of the next existing ancestor. * @param relPath The relative path pointing to the non-existing target item. * @param actions An array of actions that need to be checked. * @return <code>true</code> if the actions are granted; otherwise <code>false</code> * @throws ItemNotFoundException if the target item does not exist * @throws RepositoryException if another error occurs */ boolean isGranted(NodeState parentState, Path relPath, String[] actions) throws ItemNotFoundException, RepositoryException; /** * Determines whether the specified <code>permissions</code> are granted * on the item with the specified path. * * @param itemState * @param actions An array of actions that need to be checked. * @return <code>true</code> if the actions are granted; otherwise <code>false</code> * @throws ItemNotFoundException if the target item does not exist * @throws RepositoryException if another error occurs */ boolean isGranted(ItemState itemState, String[] actions) throws ItemNotFoundException, RepositoryException; /** * Returns true if the existing item with the given <code>ItemId</code> can * be read. * * @param itemState * @return * @throws ItemNotFoundException * @throws RepositoryException */ boolean canRead(ItemState itemState) throws ItemNotFoundException, RepositoryException; /** * Returns true if the existing item state can be removed. * * @param itemState * @return * @throws ItemNotFoundException * @throws RepositoryException */ boolean canRemove(ItemState itemState) throws ItemNotFoundException, RepositoryException; /** * Determines whether the subject of the current context is granted access * to the given workspace. * * @param workspaceName name of workspace * @return <code>true</code> if the subject of the current context is * granted access to the given workspace; otherwise <code>false</code>. * @throws NoSuchWorkspaceException if a workspace with the given name does not exist. * @throws RepositoryException if another error occurs */ boolean canAccess(String workspaceName) throws NoSuchWorkspaceException, RepositoryException; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean isGranted(ItemState itemState, String[] actions) throws ItemNotFoundException, RepositoryException;", "public boolean isAccessGranted() {\n try {\n PackageManager packageManager = getPackageManager();\n ApplicationInfo applicationInfo = packageManager.getApplicationInfo(getPa...
[ "0.70624536", "0.6976626", "0.6523884", "0.62202865", "0.62156415", "0.6200405", "0.6190153", "0.6146055", "0.6141432", "0.6107005", "0.6105886", "0.6062491", "0.6057574", "0.59659016", "0.59405136", "0.5929619", "0.5906286", "0.59026223", "0.5895445", "0.5879637", "0.5871132...
0.66723233
2
Determines whether the specified permissions are granted on the item with the specified path.
boolean isGranted(NodeState parentState, Path relPath, String[] actions) throws ItemNotFoundException, RepositoryException;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean isHasPermissions();", "public boolean checkPerm(String tenantId, String username, String systemId, String path, Permission perm)\n throws ServiceException\n {\n try {\n // 99% of the time, a user will have access to the root of the storage system, so lets\n // just check that first...
[ "0.68536615", "0.67252344", "0.6613239", "0.65991426", "0.6597197", "0.63177294", "0.6297846", "0.62509185", "0.6207261", "0.6113578", "0.6111236", "0.60436636", "0.5971872", "0.596768", "0.59577876", "0.59490055", "0.59421617", "0.5941175", "0.5939144", "0.59289575", "0.5902...
0.58365965
30
Determines whether the specified permissions are granted on the item with the specified path.
boolean isGranted(ItemState itemState, String[] actions) throws ItemNotFoundException, RepositoryException;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean isHasPermissions();", "public boolean checkPerm(String tenantId, String username, String systemId, String path, Permission perm)\n throws ServiceException\n {\n try {\n // 99% of the time, a user will have access to the root of the storage system, so lets\n // just check that first...
[ "0.68536615", "0.67252344", "0.6613239", "0.65991426", "0.6597197", "0.63177294", "0.6297846", "0.62509185", "0.6207261", "0.6113578", "0.6111236", "0.60436636", "0.5971872", "0.596768", "0.59577876", "0.59490055", "0.59421617", "0.5941175", "0.5939144", "0.59289575", "0.5902...
0.56852424
50
Returns true if the existing item with the given ItemId can be read.
boolean canRead(ItemState itemState) throws ItemNotFoundException, RepositoryException;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasItemId();", "boolean hasItemId();", "boolean hasItemId();", "boolean hasItemId();", "boolean hasItemId();", "boolean hasItemId();", "boolean hasItemId();", "public boolean isItem(int itemId) {\n return getKey().equals(itemId);\n }", "public boolean itemIsAllowed(int itemId) {\n...
[ "0.7056494", "0.7056494", "0.7056494", "0.7056494", "0.7056494", "0.7056494", "0.7056494", "0.6966728", "0.6529751", "0.63647455", "0.5906245", "0.5873541", "0.58583176", "0.58155036", "0.5809561", "0.56860626", "0.56860626", "0.56860626", "0.56778646", "0.56691885", "0.56311...
0.74133146
0
Returns true if the existing item state can be removed.
boolean canRemove(ItemState itemState) throws ItemNotFoundException, RepositoryException;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract boolean canRemoveItem(Player player, Item item, int slot);", "boolean canRemove();", "boolean removAble(InputItem item);", "public abstract boolean depleteItem();", "public boolean removeItem(Item item) {\r\n\t\treturn items.remove(item);\r\n\t}", "public boolean removeItem(Item item){\r\...
[ "0.67211646", "0.6694309", "0.65330046", "0.6408187", "0.64040756", "0.6388395", "0.6332387", "0.6295913", "0.6293653", "0.62877214", "0.62732756", "0.6244419", "0.6212348", "0.6193446", "0.61731243", "0.6167904", "0.6161537", "0.61544025", "0.61391914", "0.6138928", "0.61319...
0.8113046
0
Determines whether the subject of the current context is granted access to the given workspace.
boolean canAccess(String workspaceName) throws NoSuchWorkspaceException, RepositoryException;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean granted(){\n\t\treturn this.granted;\n\t}", "public boolean isAccessGranted() {\n try {\n PackageManager packageManager = getPackageManager();\n ApplicationInfo applicationInfo = packageManager.getApplicationInfo(getPackageName(), 0);\n AppOpsManager appOpsM...
[ "0.57583195", "0.56172913", "0.5614577", "0.5557914", "0.55129135", "0.55101776", "0.5424611", "0.5423009", "0.54178387", "0.5406403", "0.5388753", "0.53678304", "0.53553647", "0.53437924", "0.5326584", "0.52969664", "0.52959025", "0.52549183", "0.51825774", "0.5163788", "0.5...
0.7172054
0
Handles the HTTP POST method.
@Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); response.sendRedirect("/viewSearch.jsp"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void doPost(Request request, Response response) {\n\n\t}", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) {\n }", "public void doPost( )\n {\n \n }", "@Override\n public String getMethod() {\n return \"POST\";\n ...
[ "0.73289514", "0.71383566", "0.7116213", "0.7105215", "0.7100045", "0.70236707", "0.7016248", "0.6964149", "0.6889435", "0.6784954", "0.67733276", "0.67482096", "0.66677034", "0.6558593", "0.65582114", "0.6525548", "0.652552", "0.652552", "0.652552", "0.65229493", "0.6520197"...
0.0
-1
Returns a short description of the servlet.
@Override public String getServletInfo() { return "Short description"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getServletInfo()\n {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short d...
[ "0.87634975", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8699131", "0.8699131", "0.8699131", "0.8699131", "0.8699131", "0.8699131", "0.8531295", "0.8531295", "0.85282224", "0.85282224", ...
0.0
-1
TODO Autogenerated constructor stub
@Override public void init(FilterConfig filterConfig) throws ServletException { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "public Constructor(){\n\t\t\n\t}", "@Override\n public void init() {}", "@Override\n\t\tpublic void init() {\n\t\t}", "@Override\r\n\tpublic void init() {}", "@Override\n public void init() {\n }", "@Ov...
[ "0.7658869", "0.71549827", "0.70363975", "0.6936954", "0.6918867", "0.6918655", "0.68630713", "0.68442994", "0.6838973", "0.68234706", "0.6819426", "0.6792848", "0.6792581", "0.6792581", "0.6792581", "0.6792581", "0.6792581", "0.6792581", "0.67713094", "0.67713094", "0.677130...
0.0
-1
TODO Autogenerated constructor stub
@Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest req = (HttpServletRequest) request; HttpServletResponse resp = (HttpServletResponse) response; Cookie[] cookies = req.getCookies(); if (cookies != null) { for (Cookie cookie : cookies) { if (cookie.getName().equals("gyyxLogin")) { chain.doFilter(request, response); return; } } } req.getRequestDispatcher("login.do").forward(request, response); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "public Constructor(){\n\t\t\n\t}", "@Override\n public void init() {}", "@Override\n\t\tpublic void init() {\n\t\t}", "@Override\r\n\tpublic void init() {}", "@Override\n public void init() {\n }", "@Ov...
[ "0.7658869", "0.71549827", "0.70363975", "0.6936954", "0.6918867", "0.6918655", "0.68630713", "0.68442994", "0.6838973", "0.68234706", "0.6819426", "0.6792848", "0.6792581", "0.6792581", "0.6792581", "0.6792581", "0.6792581", "0.6792581", "0.67713094", "0.67713094", "0.677130...
0.0
-1
TODO Autogenerated constructor stub
@Override public void destroy() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "public Constructor(){\n\t\t\n\t}", "@Override\n public void init() {}", "@Override\n\t\tpublic void init() {\n\t\t}", "@Override\r\n\tpublic void init() {}", "@Override\n public void init() {\n }", "@Ov...
[ "0.7658869", "0.71549827", "0.70363975", "0.6936954", "0.6918867", "0.6918655", "0.68630713", "0.68442994", "0.6838973", "0.68234706", "0.6819426", "0.6792848", "0.6792581", "0.6792581", "0.6792581", "0.6792581", "0.6792581", "0.6792581", "0.67713094", "0.67713094", "0.677130...
0.0
-1
Taking a Scanner as input (Main will sort out the nittygritty of dealing with the files), the constructor for a Parser will create a Parser and deal with stuff. Note: The input must have LF line endings. Hope Main deals with that.
public Parser(Scanner fileStream) { // Save fileStream for later this.fileStream = fileStream; // Set the delimiter so that actual instructions are read, instead of the whitespace this.fileStream.useDelimiter(Pattern.compile(whitespace, Pattern.MULTILINE)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Parser( File inFile ) throws FileNotFoundException\r\n {\r\n if( inFile.isDirectory() )\r\n throw new FileNotFoundException( \"Excepted a file but found a directory\" );\r\n \r\n feed = new Scanner( inFile );\r\n lineNum = 1;\r\n }", "public parser(Scanner s) {...
[ "0.71441185", "0.69426775", "0.6676356", "0.6676356", "0.6676356", "0.6676356", "0.6676356", "0.6676356", "0.6676356", "0.6676356", "0.6600458", "0.6572992", "0.6572992", "0.6572992", "0.6572992", "0.6572992", "0.6572992", "0.65220195", "0.65212256", "0.64587337", "0.64266515...
0.6523282
17
Gets rid of all whitespace, leaving only the pure VM code. Whitespace includes comments (Starts with "//") and space characters.
private void removeWhitespace() { /* * Get rid of comments. * Regex breakdown: * //.* : Some string that starts with "//" */ instruction = instruction.replaceAll("//.*", ""); /* * Now replace all whitespace with a single space * Regex breakdown: * \s+ : Find all whitespace that appear in a chunk */ instruction = instruction.replaceAll("\\s+", " "); // Get rid of leading/trailing whitespace (if there is any whitespace at // the start/end of a line, it will be converted into one space character // as a result of the previous line) /* * Regex breakdown: * ^ : At the start of the line... * \s+ : Match whitespace that occurs in a glob */ instruction = instruction.replaceAll("^\\s+", ""); /* * Regex breakdown: * \s+ : Match whitespace that occurs in a glob * $ : At the end of the line */ instruction = instruction.replaceAll("\\s+$", ""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void stripComments() {\r\n if (command.contains(\"//\")) {\r\n command = command.substring(0, command.indexOf(\"//\"));\r\n }\r\n command = command.replace(\"\\n\", \"\");\r\n command = command.replace(\"\\t\", \"\");\r\n }", "private StringBuilder stripWhitespace...
[ "0.6242459", "0.57649666", "0.5723326", "0.55750036", "0.5550359", "0.5527696", "0.5445754", "0.54324317", "0.5401636", "0.53339714", "0.53197235", "0.5234728", "0.52315146", "0.5231171", "0.5188477", "0.5173437", "0.5157641", "0.51497114", "0.5144582", "0.51264346", "0.51063...
0.7085696
0
Whether we've wrung this VM file dry. If so, I guess we have to pick on something else.
public boolean hasMoreCommands() { return fileStream.hasNext(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isNoisyDryRunMode();", "public boolean isDryRunMode();", "public boolean isDryRun() {\n return dryRun;\n }", "private boolean acceptAsExpected()\n {\n return saveExpectedDir_ != null;\n }", "public boolean willNotBeResurrected() {\n return state == State.FRESH || state == St...
[ "0.6712302", "0.6637019", "0.644611", "0.6259207", "0.6054672", "0.5983307", "0.5951956", "0.57530504", "0.57370424", "0.56128913", "0.56105566", "0.5547776", "0.5541779", "0.5536736", "0.55320793", "0.5530749", "0.54907525", "0.54851294", "0.5479134", "0.5474876", "0.5468893...
0.0
-1
Advances the Parser. Basically skips over to the next actual instruction.
public void advance() { // Get the next instruction instruction = fileStream.next(); removeWhitespace(); // Split instruction apart instructionChunks = instruction.split(" "); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n void advance() {\n }", "public void advance(){\n\n if (hasMoreTokens()) {\n currentToken = tokens.get(pointer);\n pointer++;\n }else {\n throw new IllegalStateException(\"No more tokens\");\n }\n\n //System.out.println(currentToken);\...
[ "0.6580506", "0.64647895", "0.625766", "0.6236819", "0.6031942", "0.60297114", "0.60147434", "0.6008433", "0.6004877", "0.5999804", "0.5980127", "0.59795946", "0.59418243", "0.59017193", "0.5836573", "0.582769", "0.5760815", "0.5752439", "0.57515997", "0.57403547", "0.5678762...
0.7433711
0
Gets the current command type for this current instruction
public CommandType commandType() { // Logik: Deal with the specific types first, then assume that whatever's left is arithmetic // Default case CommandType type = CommandType.C_ARITHMETIC; // Deal with instruction switch (instructionChunks[0]) { case "push": type = CommandType.C_PUSH; break; case "pop": type = CommandType.C_POP; } return type; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Command commandType() {\r\n if (command.startsWith(\"push\")) {\r\n return Command.C_PUSH;\r\n } else if (command.startsWith(\"pop\")) {\r\n return Command.C_POP;\r\n } else if (isArithmeticCmd()) {\r\n return Command.C_ARITHMETIC;\r\n } else if (...
[ "0.78841764", "0.72145665", "0.6867335", "0.6785627", "0.67529655", "0.6750784", "0.6649216", "0.6642783", "0.66061056", "0.65911806", "0.65459394", "0.65459394", "0.65432554", "0.65336704", "0.64768267", "0.64760697", "0.6474557", "0.6472918", "0.6457592", "0.6436254", "0.64...
0.780399
1
Returns the first argument of the current command. In the case of C_ARITHMETIC, the command itself is returned.
public String arg1() { CommandType type = this.commandType(); if (type == CommandType.C_ARITHMETIC) { return instructionChunks[0]; } return instructionChunks[1]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String arg1() {\r\n return command.split(\"\\\\s+\")[1];\r\n }", "java.lang.String getArg();", "public String nextArgument() {\n\t\tif (tok == null || !tok.hasMoreElements())\n\t\t\treturn null;\n\n\t\tString arg = tok.nextToken();\n\t\tif (arg.startsWith(\"\\\"\")) { //$NON-NLS-1$\n\t\t\tif (...
[ "0.7091498", "0.62106985", "0.61892503", "0.6042596", "0.59791464", "0.5918584", "0.59056526", "0.5823186", "0.5788368", "0.5774891", "0.5768213", "0.5768123", "0.5740063", "0.5736568", "0.57213545", "0.5699344", "0.5699334", "0.5690343", "0.5687305", "0.5665051", "0.56638545...
0.76461315
0
Returns the second argument of the current command. Should be called only if the current command is C_PUSH, C_POP, C_FUNCTON, or C_CALL.
public int arg2() { return Integer.parseInt(instructionChunks[2]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String arg2() {\r\n return command.split(\"\\\\s+\")[2];\r\n }", "public String arg1() {\n CommandType type = this.commandType();\n if (type == CommandType.C_ARITHMETIC) {\n return instructionChunks[0];\n }\n return instructionChunks[1];\n }", "@Override\r\n\tpublic int getSe...
[ "0.7274734", "0.6234459", "0.62134975", "0.62112665", "0.5914403", "0.58709466", "0.5669103", "0.557431", "0.5541639", "0.54984015", "0.5471273", "0.5434283", "0.53787524", "0.5360882", "0.5351964", "0.53457487", "0.5295965", "0.5279122", "0.52711743", "0.5263866", "0.5247689...
0.62734056
1
Interface for symmetric encryption algorithms
@Component public interface Crypto { // returns a new secret key String newKey(); // encrypts a plain text byte[] encrypt(String plaintext); // decrypts a cipher byte[] decrypt(byte[] encryptedData, short keyIx); // gets the index of the encryption key to use - 0 = no key, 1 or 2 for the two available keys short getKeyIx(); // gets the index of the default key short getDefaultKeyIx(); // gets the date after which the default key is no longer valid String getDefaultKeyExpiry(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Encryption encryption();", "public interface EncryptionAlgorithm {\n\n public String encrypt(String plaintext);\n\n}", "public interface ICryptoEngine \n{\n\t/**\n\t * Initialize the \n\t * \n\t * @param forEncryption should the engine be initialized for encryption (true) or decryption (false)\n\t * @param ...
[ "0.7437331", "0.6927149", "0.68138665", "0.6697894", "0.65634847", "0.65140086", "0.6460054", "0.64346683", "0.6345305", "0.6329705", "0.62949055", "0.6226344", "0.6224829", "0.61937904", "0.61745656", "0.6045517", "0.60436696", "0.59753805", "0.59730965", "0.5918655", "0.591...
0.54808116
67
returns a new secret key
String newKey();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String key() {\n return \"secret\";\n }", "private static Key generateKey() {\n return new SecretKeySpec(keyValue, ALGO);\n }", "String getSecretByKey(String key);", "public String getSecretKey();", "java.lang.String getSecret();", "public SecretKey getSecretKey() {\n retur...
[ "0.7508239", "0.7307095", "0.7261638", "0.7192", "0.69849026", "0.69059664", "0.69026816", "0.6830494", "0.6773752", "0.67301077", "0.66915166", "0.6646097", "0.66097087", "0.65911275", "0.6539468", "0.64971966", "0.6493038", "0.64348006", "0.64313734", "0.6424537", "0.641402...
0.70106024
4
encrypts a plain text
byte[] encrypt(String plaintext);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String encrypt(String plainText);", "public String encrypt(String text) {\n return content.encrypt(text);\n }", "public synchronized void encryptText() {\n setSalt(ContentCrypto.generateSalt());\n try {\n mText = ContentCrypto.encrypt(mText, getSalt(), Passphrase.INSTA...
[ "0.89458007", "0.79582655", "0.7954113", "0.78267354", "0.76715076", "0.7496753", "0.72254455", "0.7209428", "0.72081584", "0.71520853", "0.7140583", "0.7051445", "0.69662154", "0.69626445", "0.69117075", "0.68547225", "0.6817091", "0.6793155", "0.67877847", "0.6787427", "0.6...
0.7203214
9
gets the index of the encryption key to use 0 = no key, 1 or 2 for the two available keys
short getKeyIx();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static int getKey(String encrypted) {\n //count letters in msg\n int[] counts = countLetters(encrypted);\n //find intex of highest count\n int indOfMax = maxIndex(counts);\n //find&return shift\n final int IND_E = 4;\n int key = indOfMax - IND_E;\n if...
[ "0.7453192", "0.66567034", "0.6652324", "0.6488362", "0.640558", "0.640558", "0.616192", "0.6107426", "0.60959774", "0.6086636", "0.60715014", "0.6029361", "0.6028105", "0.6025157", "0.5996899", "0.59962183", "0.59668475", "0.596042", "0.5958794", "0.5932401", "0.5900544", ...
0.62744266
6
gets the index of the default key
short getDefaultKeyIx();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getKey(int i);", "short getKeyIx();", "protected String getKey(int index)\n/* */ {\n/* 1425 */ return null;\n/* */ }", "public int getKey() {\n\t\treturn 0;\n\t}", "String getKey(int index);", "int getKey();", "int getKey();", "private int getIndex(int key) {\n\t\treturn key % M...
[ "0.71714664", "0.7124174", "0.7091506", "0.7080137", "0.68808293", "0.6876931", "0.6876931", "0.6874881", "0.68543303", "0.6594426", "0.65439725", "0.6537947", "0.6527519", "0.650493", "0.6468613", "0.645154", "0.64409155", "0.64165276", "0.64121664", "0.6386703", "0.638347",...
0.84013224
0
gets the date after which the default key is no longer valid
String getDefaultKeyExpiry();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public java.util.Date getNotAfter() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.getNotAfter():java.util.Date, dex: \n */\n throw new UnsupportedOperationException(\"Method not decomp...
[ "0.6204611", "0.6150577", "0.61165977", "0.6111783", "0.6090986", "0.6090079", "0.6048918", "0.5996687", "0.5822298", "0.5768483", "0.57094806", "0.56959856", "0.56483656", "0.5645066", "0.5621081", "0.5611945", "0.5579785", "0.5529988", "0.55058175", "0.54508483", "0.5438452...
0.70393515
0
Initialise a main macro. A main macro has no name: getName() == null
public MacroDefinition(int lineno, ExpansionManager manager) throws AbnormalTerminationException { this._lines = new ArrayList(); this._manager = manager; this._labels = new HashMap(); this._formalParameters = new ArrayList(); this._lineno = lineno; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n protected void initializeMacroCommand() {\n \n addSubCommand(new PrepareControllerCommand());\n addSubCommand(new PrepareModelCommand());\n addSubCommand(new PrepareViewCommand());\n \n // Remove the command because it never be called more than once\n /...
[ "0.60694957", "0.5995843", "0.59494376", "0.56915534", "0.5638433", "0.5600201", "0.5559885", "0.55301553", "0.550888", "0.5490566", "0.5469501", "0.54590416", "0.54457426", "0.54174906", "0.53505874", "0.53505874", "0.5327014", "0.5320276", "0.5300512", "0.5300512", "0.52765...
0.0
-1
Initialise a normal macro.
public MacroDefinition(int lineno, ExpansionManager manager, String header) throws AbnormalTerminationException { this(lineno, manager); this.setHeaderInfo(header); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n protected void initializeMacroCommand() {\n \n addSubCommand(new PrepareControllerCommand());\n addSubCommand(new PrepareModelCommand());\n addSubCommand(new PrepareViewCommand());\n \n // Remove the command because it never be called more than once\n /...
[ "0.6625785", "0.6293167", "0.5823164", "0.56469744", "0.5643061", "0.5637628", "0.5614351", "0.5605957", "0.5597276", "0.5578328", "0.553964", "0.55318826", "0.5527856", "0.5522049", "0.5522049", "0.55187696", "0.5508501", "0.5493881", "0.5456935", "0.5417237", "0.5407166", ...
0.5774887
3
set the name of this macro definition
protected void setName(String name) { this._name = name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void setName(String name_);", "public final void setName(final GenericName name) {\n this.value = name.toString();\n final NameSpace scope = name.scope();\n if (scope != null && !scope.isGlobal()) {\n codeSpace = scope.name().toString();\n }\n }", "public void setName(...
[ "0.7162067", "0.71109915", "0.68889785", "0.6872212", "0.6831594", "0.6813072", "0.6808867", "0.6788329", "0.67652667", "0.6735464", "0.67212737", "0.67212737", "0.67212737", "0.67212737", "0.67212737", "0.67212737", "0.6721184", "0.67162186", "0.6716105", "0.6692706", "0.669...
0.0
-1
parse the given line to set the name and the formal parameters
protected void setHeaderInfo(String header) throws AbnormalTerminationException { // strip comment and unnecessary spaces String actualLine = StringUtils.trimSpaces(Comment.stripComment(header)); // split off the name int nameEnd = 0; while (nameEnd < actualLine.length() && ! StringUtils.isSpace(actualLine.charAt(nameEnd))) { nameEnd += 1; } String name = actualLine.substring(0, nameEnd); String params = actualLine.substring(nameEnd); if (! Name.isName(name)) { throw new AbnormalTerminationException("Ongeldige macronaam: " + name); } this.setName(name); // parse the formal parameters StringTokenizer tokenizer = new StringTokenizer(params, ","); List formalParams = new ArrayList(); while (tokenizer.hasMoreTokens()) { String param = StringUtils.trimSpaces(tokenizer.nextToken()); if (! Name.isName(param)) { throw new AbnormalTerminationException("Geen aanvaardbare naam voor een " + "formele parameter: " + param); } formalParams.add(param); } this.setFormalParameters(formalParams); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void parseLine(String line) throws ParsingException {\n if (line.startsWith(COMMENT_PREFIX)) //Ignore comments\n return;\n String parts[] = line.split(SEPARATOR_PARAMETER);\n if (parts.length == 2) { //PARAMETER=VALUE\n if (isValidParameter(parts[0])) //If the par...
[ "0.7097646", "0.6804671", "0.6543645", "0.6319598", "0.6241442", "0.61518145", "0.6137645", "0.6136601", "0.5939268", "0.59338915", "0.58979666", "0.58604646", "0.5789758", "0.57683605", "0.57574916", "0.5754211", "0.57330865", "0.5710014", "0.56104016", "0.56087136", "0.5600...
0.5937149
9
set the formal parameters
protected void setFormalParameters(List params) { this._formalParameters = params; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void setParameters() {\n\t\t\n\t}", "public void setParameters(String parameters);", "@Override\n\t\tpublic void setParameters(Object[] parameters) {\n\t\t\t\n\t\t}", "@Override\r\n public void setParameter(String parameters) {\r\n // dummy\r\n }", "void setParameters(IParameterCollection para...
[ "0.7735568", "0.71405876", "0.70742136", "0.70349485", "0.6886673", "0.6764324", "0.6733817", "0.6647747", "0.66163695", "0.657221", "0.657221", "0.6538695", "0.6467338", "0.6465404", "0.6460276", "0.64474195", "0.643179", "0.63900197", "0.6376281", "0.6360816", "0.6325069", ...
0.76211387
1
add a line to this macro definition
public void addLine(int lineno, String line) throws AbnormalTerminationException { this._lines.add(new MacroLineFactory().parseLine(line, lineno, this)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addLine(String line) {\n if (methodMode) {\n methodCode.add(new AsmLine(line));\n } else {\n program.add(new AsmLine(line));\n }\n }", "private void addLine()\n\t{\n\t\tlines.add(printerFormatter.markEOL());\n\t}", "private void addLine (String line) {\...
[ "0.7105468", "0.67752475", "0.65580773", "0.6273677", "0.6270199", "0.6261958", "0.62308085", "0.6227481", "0.62206465", "0.6164333", "0.6135848", "0.60296905", "0.60030615", "0.5920918", "0.5906896", "0.588966", "0.5888117", "0.58547366", "0.5851369", "0.5837754", "0.5831281...
0.6764736
2
Expand this macro into the given PrintWriter.
public int expand(PrintWriter out, List actualParameters, int lineno) throws AbnormalTerminationException { this.checkParameters(actualParameters); VariableTable localVariableTable = new VariableTable(this._formalParameters, actualParameters, this._manager.getGlobalVariableTable()); MacroExpander m = new MacroExpander(this._manager); m.expand(localVariableTable, this._lines, out, lineno); return m.getLineNo(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private PrintWriterUtil() {}", "public BootstrapInstrumentor(PrintWriter w) {\n this.w = w;\n }", "void setOpp(PrintWriter out_opp){ this.out_opp = out_opp; }", "@Override\n\t\t\tpublic void performAction(PrintWriter pw) {\n\t\t\t\t\n\t\t\t\tString hello = \"helloworld\";\n\t\t\t\t\n\t\t\t\tpw.println(he...
[ "0.51433295", "0.48755708", "0.4826358", "0.47999918", "0.47297397", "0.47172806", "0.47097927", "0.46095577", "0.45951092", "0.45910382", "0.45228735", "0.4501878", "0.44995028", "0.4487091", "0.4475008", "0.44551948", "0.44484442", "0.44166383", "0.44081688", "0.44071707", ...
0.5537826
0
Because the main program is looked at as a special macro (a macro with a special name), we need a way to descriminate between normal macro's and the main progam.
public boolean isMainProgram() { return this.getName() == null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void mainSubDef()\n\t{\n\t\ttext(\"public static void main(String[] args) {\");\n\t\tsuper.mainSubDef();\n\t}", "public static void main(String[] args) throws Exception {\n\t\ttestMacro();\r\n\t}", "private boolean macro(Macro m, Token orig)\r\n throws IOException,\r\n LexerExce...
[ "0.59475553", "0.58068013", "0.5372352", "0.5368649", "0.53427047", "0.53120184", "0.5279052", "0.5238507", "0.5208306", "0.51652163", "0.51615983", "0.51327854", "0.5129062", "0.5116198", "0.5112393", "0.51084495", "0.5098044", "0.50785285", "0.50754815", "0.50313103", "0.50...
0.514659
11
Checks wether the correct number of parameters is supplied.
private void checkParameters(List actualParameters) throws AbnormalTerminationException { if (actualParameters.size() != this._formalParameters.size()) { throw new AbnormalTerminationException("Ongeldig aantal parameters in " + this.getName() + "!"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n protected boolean hasValidNumberOfArguments(int numberOfParametersEntered) {\n return numberOfParametersEntered == 3;\n }", "protected static boolean ensureNumArgs( String param[], int n ) {\n\t\tif ( n >= 0 && param.length != n || n < 0 && param.length < -n ) {\n\t\t\tSystem.err.println...
[ "0.8126037", "0.79397917", "0.7804925", "0.7737863", "0.7450155", "0.73614365", "0.718253", "0.71767366", "0.71737796", "0.71467245", "0.7141033", "0.689268", "0.68590736", "0.67823714", "0.6724793", "0.67069006", "0.6679533", "0.66585064", "0.66374916", "0.6622486", "0.66136...
0.66904795
16
Created by Hiro on 2018/9/21. Function |UnaryFunction |Minus |ExponentialFunction |NaturalLogarithm |TrigonometricFunction |BinaryFunction |Division |Power |Logarithm |MvFunction |CommutableFunction |Sum |Product
public interface Function extends Expression { int nVar(); Expression var(int i); //boolean containsUnknown(Unknown u); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public MathObject evaluate(Function input);", "public static BinaryExpression power(Expression expression0, Expression expression1, Method method) { throw Extensions.todo(); }", "public TravellingSalesmanFunctions() {\n\t\tregisterFunctions(\n\t\t\t\tnew SquareRoot(),\n\t\t\t\tnew Square(),\n\t\t\t\tnew Cube()...
[ "0.60220003", "0.5667921", "0.56415904", "0.5620478", "0.56153756", "0.553582", "0.5529254", "0.5484796", "0.54561263", "0.54319906", "0.54095787", "0.5371819", "0.53656167", "0.534753", "0.53093183", "0.5306881", "0.5293216", "0.52842766", "0.5281311", "0.52803296", "0.52631...
0.0
-1
File chunkFile = SVNFileUtil.createUniqueFile(myCurrentFile.myBaseFile.getParentFile(), SVNPathUtil.tail(myCurrentFile.myPath), ".chunk");
public OutputStream textDeltaChunk(String commitPath, SVNDiffWindow diffWindow) throws SVNException { return myDeltaProcessor.textDeltaChunk(diffWindow); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static File getChunkFile(GChunk chunk)\n\t{\n\t\treturn new File(new File(Worlds.getWorld(chunk.getWorld()).getWorldFolder(), \"nest\"), \"n.\" + chunk.getX() + \".\" + chunk.getZ() + \".n\");\n\t}", "public static File getChunkAuxFile(GChunk chunk)\n\t{\n\t\treturn new File(new File(Worlds.getWorld(chunk...
[ "0.59005564", "0.5831661", "0.53735137", "0.5355392", "0.52235436", "0.5208629", "0.5185701", "0.5156992", "0.51423293", "0.51357347", "0.5132451", "0.5129371", "0.5125696", "0.51250815", "0.50941616", "0.50941616", "0.50941616", "0.50941616", "0.50941616", "0.50941616", "0.5...
0.0
-1
File baseTmpFile = myCurrentFile.myBaseFile; File targetFile = myCurrentFile.myFile;
public void textDeltaEnd(String commitPath) throws SVNException { myDeltaProcessor.textDeltaEnd(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "File getFile() { return user_file; }", "private static void copyFile(File scrFile, File file) {\n\t\r\n}", "public File getTmpFile() {\n return tmpFile;\n }", "FileObject getFile();", "FileObject getFile();", "public String getFile() {\n \n // return it\...
[ "0.64410776", "0.64199615", "0.6360952", "0.62544787", "0.62544787", "0.62537503", "0.623211", "0.6214475", "0.6182829", "0.6136227", "0.61319405", "0.6126434", "0.6118838", "0.6013966", "0.60038316", "0.60012543", "0.59878564", "0.59878564", "0.5987641", "0.5980121", "0.5978...
0.0
-1
$FF: Couldn't be decompiled
final void delete(int param1) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void method_2247() {\r\n // $FF: Couldn't be decompiled\r\n }", "protected void method_2145() {\r\n // $FF: Couldn't be decompiled\r\n }", "static void method_6338() {\r\n // $FF: Couldn't be decompiled\r\n }", "protected void method_2241() {\r\n // $FF: Couldn't be decomp...
[ "0.88761103", "0.8875886", "0.8832501", "0.8821476", "0.88194513", "0.87842625", "0.87842625", "0.87562454", "0.87253726", "0.8724465", "0.87224555", "0.8722066", "0.8619874", "0.8571958", "0.8504731", "0.843185", "0.84148365", "0.8235883", "0.8002379", "0.77434903", "0.76716...
0.0
-1
$FF: Couldn't be decompiled
final void set(int param1, Scriptable param2, Object param3) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void method_2247() {\r\n // $FF: Couldn't be decompiled\r\n }", "protected void method_2145() {\r\n // $FF: Couldn't be decompiled\r\n }", "static void method_6338() {\r\n // $FF: Couldn't be decompiled\r\n }", "protected void method_2241() {\r\n // $FF: Couldn't be decomp...
[ "0.88761103", "0.8875886", "0.8832501", "0.8821476", "0.88194513", "0.87842625", "0.87842625", "0.87562454", "0.87253726", "0.8724465", "0.87224555", "0.8722066", "0.8619874", "0.8571958", "0.8504731", "0.843185", "0.84148365", "0.8235883", "0.8002379", "0.77434903", "0.76716...
0.0
-1
$FF: Couldn't be decompiled
final void setAttributes(int param1, int param2) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void method_2247() {\r\n // $FF: Couldn't be decompiled\r\n }", "protected void method_2145() {\r\n // $FF: Couldn't be decompiled\r\n }", "static void method_6338() {\r\n // $FF: Couldn't be decompiled\r\n }", "protected void method_2241() {\r\n // $FF: Couldn't be decomp...
[ "0.88761103", "0.8875886", "0.8832501", "0.8821476", "0.88194513", "0.87842625", "0.87842625", "0.87562454", "0.87253726", "0.8724465", "0.87224555", "0.8722066", "0.8619874", "0.8571958", "0.8504731", "0.843185", "0.84148365", "0.8235883", "0.8002379", "0.77434903", "0.76716...
0.0
-1
list of words user didn't get right in quiz constructor for panel, sets up paramaters of panel and various fields
public Quiz(Voxspell parent, PanelID type){ setSize(1366,745); setLayout(null); setBackground(new Color(235, 235, 235)); parent_frame = parent; quiz_type = type; initialiseWordsToSpell(); if (words_to_spell.size()!=0){ setupTitle(); setupProgressBar(); setupFeedbackDisplayTextArea(); setupSpellHereLabel(); setupSpellHereField(); setupSubmitButton(); setupSayAgainButton(); setupChangeVoice(); setupChangeSpeed(); setupAddToReviewButton(); setupHelpButton(); setupBackButton(); current_attempt_number = 1; current_word_number = 0; words_to_add_to_review=new ArrayList<>(); words_mastered = new ArrayList<String>(); words_faulted = new ArrayList<String>(); words_failed = new ArrayList<String>(); startQuiz(); //begins quiz logic } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initialiseWordsToSpell(){\n\t\t//normal quiz\n\t\tif(quiz_type==PanelID.Quiz){\n\t\t\twords_to_spell = parent_frame.getPreQuizHandler().getWordsForSpellingQuiz(parent_frame.getDataHandler().getNumWordsInQuiz(), PanelID.Quiz);\n\t\t} else { //review quiz\n\t\t\twords_to_spell = parent_frame.getPreQuizH...
[ "0.6162754", "0.61552966", "0.60622585", "0.59418416", "0.5822705", "0.5799394", "0.5778714", "0.5747445", "0.5742948", "0.572109", "0.56959635", "0.56624454", "0.5654507", "0.5637266", "0.5612671", "0.5583725", "0.5563386", "0.5554155", "0.5553571", "0.55435604", "0.5512058"...
0.6091568
2
Method that determines what will be tested in quiz based on type of quiz
private void initialiseWordsToSpell(){ //normal quiz if(quiz_type==PanelID.Quiz){ words_to_spell = parent_frame.getPreQuizHandler().getWordsForSpellingQuiz(parent_frame.getDataHandler().getNumWordsInQuiz(), PanelID.Quiz); } else { //review quiz words_to_spell = parent_frame.getPreQuizHandler().getWordsForSpellingQuiz(parent_frame.getDataHandler().getNumWordsInQuiz(), PanelID.Review); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean checkType() {\r\n if (CorrectAnswer.getText().equals(\"\") || typeQuestion.getValue() == null) {\r\n if (typeQuestion.getValue() == null)\r\n errorMsg += \"Which type of question do you want?\\n\";\r\n\r\n if (CorrectAnswer.getText().equals(\"\"))\r\n ...
[ "0.65036476", "0.6350941", "0.62516993", "0.6251038", "0.6231594", "0.6160795", "0.611207", "0.5940576", "0.5907316", "0.59049004", "0.58015454", "0.577505", "0.5754297", "0.57424664", "0.57238936", "0.5713155", "0.57097894", "0.56869555", "0.5650166", "0.56493634", "0.564503...
0.0
-1
sets up title at top of panel
private void setupTitle(){ JLabel title = new JLabel(quiz_type.toString()+": "+parent_frame.getDataHandler().getLevelNames().get(parent_frame.getDataHandler().getCurrentLevel())); title.setFont(new Font("Arial Rounded MT Bold", Font.BOLD, 65)); title.setForeground(new Color(254, 157, 79)); title.setHorizontalAlignment(SwingConstants.CENTER); add(title); title.setBounds(32, 24, 1136, 119); title.setOpaque(false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setTitlePanel() {\n\t\ttitleview = new TitlePanelView();\n\t\ttitleview.createView();\n\t\tnorthpanel.add(titleview.getView());\n\t\n\t}", "public void Title ()\n {\n\tTitle = new Panel ();\n\tTitle.setBackground (Color.white);\n\tchessboard (Title);\n\tp_screen.add (\"1\", Title);\n }", "pri...
[ "0.8354937", "0.8000996", "0.77138674", "0.76508", "0.74849874", "0.7267593", "0.7216314", "0.7163364", "0.714424", "0.7024915", "0.7001601", "0.69747555", "0.69669646", "0.69545144", "0.6942141", "0.69399863", "0.69399863", "0.69399863", "0.69399863", "0.69399863", "0.69253"...
0.7753258
2
Shows progress through words in this quiz
private void setupProgressBar() { progress_bar = new JProgressBar(0,words_to_spell.size()); progress_bar.setBounds(32, 170, 1284, 34); progress_bar.setBorderPainted(false); progress_bar.setBackground(Color.WHITE); progress_bar.setStringPainted(true); progress_bar.setString(""); add(progress_bar); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void startQuiz(){\t\n\t\tparent_frame.getFestival().speak(\"Please spell... \"+words_to_spell.get(current_word_number),false);\n\n\t\tfeedback_display.append(\"Word: \"+(current_word_number+1)+\" out of \"+words_to_spell.size()+\"\\nAttempt: \"+current_attempt_number+\" out of 2\\n\");\n\t\tprogress_bar.se...
[ "0.6990159", "0.65396655", "0.6263854", "0.6190478", "0.6107802", "0.6066043", "0.6051146", "0.6017259", "0.5981309", "0.5962185", "0.5948452", "0.593684", "0.59357065", "0.5929362", "0.5920969", "0.5901107", "0.5898578", "0.5874146", "0.58713067", "0.5853007", "0.5843457", ...
0.54199636
68
Sets up text area that shows feedback and user attempts for the current word
private void setupFeedbackDisplayTextArea(){ feedback_display = new JTextArea(); feedback_display.setFont(new Font("Calibri Light", Font.PLAIN, 25)); feedback_display.setEditable(false); feedback_display.setLineWrap(true); feedback_display.setWrapStyleWord(true); feedback_display.setOpaque(true); JScrollPane scrolling_pane = new JScrollPane(feedback_display); add(scrolling_pane); scrolling_pane.setBounds(32, 222, 1284, 252); scrolling_pane.setBackground(Color.WHITE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void updateTextBox(){\n\t\tString tmpWord = game.getTempAnswer().toString();\n\t\tString toTextBox = \"\";\n\t\tStringBuilder sb = new StringBuilder(tmpWord);\n\n\t\t//if a letter is blank in the temp answer make it an underscore. Goes for as long as the word length\n\t\tfor (int i = 0; i<tmpWord.length();...
[ "0.6822033", "0.6380272", "0.63454205", "0.63080776", "0.6282996", "0.6279816", "0.6107116", "0.60425264", "0.60023904", "0.5988599", "0.59358764", "0.5931006", "0.5913306", "0.58929574", "0.588306", "0.58808213", "0.586731", "0.5841014", "0.5835532", "0.58328307", "0.5832733...
0.57087
37
Adds label next to field where user types
private void setupSpellHereLabel(){ JLabel spell_here_text = new JLabel("SPELL HERE"); spell_here_text.setFont(new Font("Arial", Font.BOLD, 45)); spell_here_text.setForeground(new Color(254, 157, 79)); add(spell_here_text); spell_here_text.setBounds(32, 484, 332, 74); spell_here_text.setOpaque(false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Field label(String label);", "public void addField (String label, String field) {\n addField (label, field, \"\");\n }", "public void addTextFieldsAndLabels(){\n this.add(this.firstLabel);\n this.add(firstNameField);\n this.add(this.secondLabel);\n this.add(lastNameField)...
[ "0.70635194", "0.68318224", "0.66413546", "0.6511243", "0.63988364", "0.6185956", "0.6176027", "0.6117524", "0.611634", "0.6060109", "0.6028351", "0.59824914", "0.59685683", "0.5962688", "0.5940089", "0.5930391", "0.5884968", "0.5861703", "0.584849", "0.5846492", "0.5828625",...
0.0
-1
Adds the field in which user types word "Enter" key also submits attempt
private void setupSpellHereField(){ input_from_user = new JTextField(); input_from_user.setFont(new Font("Calibri Light", Font.PLAIN, 45)); input_from_user.setEditable(true); input_from_user.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { //only enable submitting if festival has finished to avoid delayed voice prompts if(parent_frame.getFestival().isLocked()){ feedback_display.append("\tPlease submit after voice prompt has finished.\n"); } else { processAttempt(input_from_user.getText()); input_from_user.requestFocusInWindow(); //gets focus back on the field } } }); add(input_from_user); input_from_user.setBounds(374, 484, 942, 74); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void enterPressed()\n\t{\n\t\t// Call the enter method if the enter key was pressed\n\t\tif (showCaret)\n\t\t\tonSubmit(text.getText().substring(0, text.getText().length() - 1));\n\t\telse onSubmit(text.getText());\n\t}", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent arg0) {\r\n\t\t\t\tif (arg0.g...
[ "0.6757963", "0.6706793", "0.6463658", "0.63978326", "0.6366961", "0.63475776", "0.62718177", "0.6271029", "0.626531", "0.6211842", "0.6206179", "0.62013394", "0.61778724", "0.6174458", "0.617203", "0.6141626", "0.61351514", "0.6059545", "0.6055333", "0.6033702", "0.6017064",...
0.0
-1
only enable submitting if festival has finished to avoid delayed voice prompts
@Override public void actionPerformed(ActionEvent e) { if(parent_frame.getFestival().isLocked()){ feedback_display.append("\tPlease submit after voice prompt has finished.\n"); } else { processAttempt(input_from_user.getText()); input_from_user.requestFocusInWindow(); //gets focus back on the field } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void submit() {\r\n\t\tassignTracked();\r\n\t\tBkitPoma.startLoading(constants.BkitPoma_startLoading_wating());\r\n\t\tpostSubmit();\r\n\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tif(parent_frame.getFestival().isLocked()){\n\t\t\t\t\tfeedback_display.append(\"\\tPlease s...
[ "0.6770942", "0.667284", "0.64859444", "0.63355494", "0.6289227", "0.62773794", "0.6239923", "0.60944283", "0.6050163", "0.6042064", "0.6020542", "0.5951757", "0.59446824", "0.5934323", "0.59014934", "0.58906615", "0.58193195", "0.58104885", "0.5781525", "0.57720286", "0.5733...
0.6963258
0
sets up button that user presses to submit their spelling attempt
private void setupSubmitButton() { ImageIcon submit_button_image = new ImageIcon(parent_frame.getResourceFileLocation() + "submit.png"); JButton submit_button = new JButton("", submit_button_image); submit_button.setBorderPainted(false); submit_button.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { //only enable submitting if festival has finished to avoid delayed voice prompts if(parent_frame.getFestival().isLocked()){ feedback_display.append("\tPlease submit after voice prompt has finished.\n"); } else { processAttempt(input_from_user.getText()); } input_from_user.requestFocusInWindow();//gets focus back to the spell here field } }); submit_button.addMouseListener(new VoxMouseAdapter(submit_button,null)); add(submit_button); submit_button.setBounds(32, 598, 177, 100); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n public void actionPerformed(ActionEvent arg0) {\r\n UserDictionaryProvider provider = SpellChecker.getUserDictionaryProvider();\r\n if (provider != null) {\r\n provider.addWord(word);\r\n }\r\n Dictionary dictionary = SpellChecker.getCurrentDictionary();\r\n ...
[ "0.7132982", "0.67910814", "0.6723569", "0.66626686", "0.6618253", "0.66154176", "0.64977765", "0.64570665", "0.6310004", "0.6307076", "0.62912184", "0.621768", "0.61479217", "0.6136203", "0.60427624", "0.599559", "0.59940565", "0.59885263", "0.5980296", "0.59542406", "0.5950...
0.58452874
25
only enable submitting if festival has finished to avoid delayed voice prompts
@Override public void actionPerformed(ActionEvent e) { if(parent_frame.getFestival().isLocked()){ feedback_display.append("\tPlease submit after voice prompt has finished.\n"); } else { processAttempt(input_from_user.getText()); } input_from_user.requestFocusInWindow();//gets focus back to the spell here field }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tif(parent_frame.getFestival().isLocked()){\n\t\t\t\t\tfeedback_display.append(\"\\tPlease submit after voice prompt has finished.\\n\");\n\t\t\t\t} else {\n\t\t\t\t\tprocessAttempt(input_from_user.getText());\n\t\t\t\t\tinput_from_user.requestF...
[ "0.6963258", "0.6770942", "0.64859444", "0.63355494", "0.6289227", "0.62773794", "0.6239923", "0.60944283", "0.6050163", "0.6042064", "0.6020542", "0.5951757", "0.59446824", "0.5934323", "0.59014934", "0.58906615", "0.58193195", "0.58104885", "0.5781525", "0.57720286", "0.573...
0.667284
2
adds button that lets user rehear word to spell without penalty will speak the word using slow speed, then the sample sentence (if there is one) at user's preferred speed
private void setupSayAgainButton() { ImageIcon sayagain_button_image = new ImageIcon(parent_frame.getResourceFileLocation() + "sayagain.png"); JButton sayagain_button = new JButton("", sayagain_button_image); sayagain_button.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { input_from_user.requestFocusInWindow();//gets focus back to the spell here field //says the word slowly parent_frame.getFestival().speak(words_to_spell.get(current_word_number),true); //says the sample sentence at user's preferred speed there is one @author Abby S if(parent_frame.getDataHandler().hasSampleSentences()){ int index=parent_frame.getDataHandler().getWordlistWords().get(parent_frame.getDataHandler().getCurrentLevel()).indexOf(words_to_spell.get(current_word_number)); String sentence=parent_frame.getDataHandler().getSampleSentences().get(parent_frame.getDataHandler().getCurrentLevel()).get(index); if (!sentence.trim().isEmpty()){ parent_frame.getFestival().speak(sentence,false); } } } }); sayagain_button.addMouseListener(new VoxMouseAdapter(sayagain_button,null)); add(sayagain_button); sayagain_button.setBounds(667, 598, 177, 100); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)\n private void speakWords(String speech) {\n myTTS.speak (speech, TextToSpeech.QUEUE_FLUSH, null,\"1\");\n\n }", "public void highLightWords(){\n }", "void playSpeech(String rawText);", "@Override\n public void onClick(View v) {\n ...
[ "0.6576642", "0.64288247", "0.6266053", "0.6264207", "0.625871", "0.62584865", "0.62198436", "0.60772824", "0.6041342", "0.6031864", "0.60278106", "0.6025793", "0.5992917", "0.59546185", "0.59543544", "0.59520215", "0.59487766", "0.5947685", "0.59326273", "0.59205866", "0.586...
0.72072726
0
Drop down to change preferred voice (will be saved)
private void setupChangeVoice() { FestivalVoice[] voices={FestivalVoice.Kiwi, FestivalVoice.British, FestivalVoice.American}; final JComboBox voice_chooser = new JComboBox(voices); voice_chooser.setFont(new Font("Arial", Font.PLAIN, 20)); voice_chooser.setForeground(Color.BLACK); voice_chooser.setBackground(Color.WHITE); //set shown item to be the current voice voice_chooser.setSelectedItem(parent_frame.getFestival().getFestivalVoice()); voice_chooser.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { input_from_user.requestFocusInWindow();//gets focus back to the spell here field if((FestivalVoice)voice_chooser.getSelectedItem()!=null){ parent_frame.getFestival().setFestivalVoice((FestivalVoice)voice_chooser.getSelectedItem()); } } }); voice_chooser.setBounds(919, 600, 154, 40); add(voice_chooser); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void changeVoice(String voice) throws IOException{\r\n\t\tFile failed = new File(\".festivalrc\");\r\n\t\t//If file does not exist, create new file\r\n\t\tif(!failed.exists()) {\r\n\t\t\tfailed.createNewFile();\r\n\t\t} \r\n\r\n\t\t//Appending the word to the file\r\n\t\tWriter output;\r\n\t\toutput = new ...
[ "0.72565293", "0.6257648", "0.6089251", "0.608827", "0.592683", "0.5897708", "0.58722734", "0.5843046", "0.58185434", "0.5763406", "0.5704603", "0.56961435", "0.56841886", "0.56326747", "0.5615897", "0.5608871", "0.558489", "0.55656874", "0.55531144", "0.55520594", "0.5536988...
0.73612773
0
Drop down change preferred speed (will be saved)
private void setupChangeSpeed() { FestivalSpeed[] speeds={FestivalSpeed.slow, FestivalSpeed.normal, FestivalSpeed.fast}; final JComboBox speed_chooser = new JComboBox(speeds); speed_chooser.setFont(new Font("Arial", Font.PLAIN, 20)); speed_chooser.setForeground(Color.BLACK); speed_chooser.setBackground(Color.WHITE); //set shown item to be the current speed speed_chooser.setSelectedItem(parent_frame.getFestival().getFestivalSpeed()); speed_chooser.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { input_from_user.requestFocusInWindow();//gets focus back to the spell here field if((FestivalSpeed)speed_chooser.getSelectedItem()!=null){ parent_frame.getFestival().setFestivalSpeed((FestivalSpeed)speed_chooser.getSelectedItem()); } } }); speed_chooser.setBounds(919, 658, 154, 40); add(speed_chooser); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void changeUpdateSpeed();", "private void changeSpeed() {\n\t\tint t = ((JSlider)components.get(\"speedSlider\")).getValue();\n\t\tsim.setRunSpeed(t);\n\t}", "public void setSpeed(int newSpeed){\n\t\tmyVaisseau=Isep.getListeVaisseau();\n\t\tspeed=newSpeed;\t\t\n\t}", "public void setCurrentSpeed (double spee...
[ "0.67034197", "0.63739806", "0.63716686", "0.6263493", "0.6254505", "0.6045139", "0.60341984", "0.5977759", "0.59744686", "0.5924995", "0.59012264", "0.5876433", "0.5874216", "0.585602", "0.5853203", "0.584625", "0.5827606", "0.5809191", "0.5767418", "0.5763812", "0.57637876"...
0.70882887
0
Adds to word to review list if user decides they want to practice that word more Doesn't affect stats
private void setupAddToReviewButton() { ImageIcon addreview_button_image = new ImageIcon(parent_frame.getResourceFileLocation() + "addtoreview.png"); JButton add_to_review = new JButton("", addreview_button_image); add_to_review.setBounds(374, 598, 177, 100); add_to_review.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { words_to_add_to_review.add(words_to_spell.get(current_word_number)); input_from_user.requestFocusInWindow();//gets focus back to the spell here field } }); add_to_review.addMouseListener(new VoxMouseAdapter(add_to_review,null)); add(add_to_review); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void addIntoPracticedWords(Word word) {\n word.setFavorited(true);\n favWords.add(word);\n // Set the word favourite status to true in dictionary after adding the word to practice list\n if (Dictionary.getDictionary().contains(word)) {\n Dictionary.getWord(word).setFavorit...
[ "0.7068333", "0.6433444", "0.5970843", "0.59405565", "0.58730376", "0.5866307", "0.58361244", "0.5807045", "0.5801183", "0.5795705", "0.5739842", "0.57166535", "0.5705898", "0.56978333", "0.56890166", "0.5685805", "0.5682159", "0.5678335", "0.5620407", "0.5604371", "0.5589015...
0.0
-1
Displays pop up help frame
private void setupHelpButton() { ImageIcon help_button_image = new ImageIcon(parent_frame.getResourceFileLocation() + "help.png"); JButton help_button = new JButton("",help_button_image); help_button.setBorderPainted(false); help_button.setBounds(1216, 24, 100, 100); help_button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { Help help_frame=new Help(PanelID.Quiz); help_frame.setVisible(true); input_from_user.requestFocusInWindow();//gets focus back to the spell here field } }); help_button.addMouseListener(new VoxMouseAdapter(help_button,null)); add(help_button); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void showHelp();", "private void helpAbout() {\n JOptionPane.showMessageDialog(this, new ConsoleWindow_AboutBoxPanel1(), \"About\", JOptionPane.PLAIN_MESSAGE);\n }", "private void showHelpDialog() {\n\n view.helpDialog();\n }", "private void showHelp() {\n\t\tJOptionPane.showMessageDialo...
[ "0.80223864", "0.7889471", "0.7858361", "0.7734763", "0.7677584", "0.766612", "0.7651054", "0.76154447", "0.7540759", "0.7456425", "0.7429518", "0.7420991", "0.74030507", "0.7334678", "0.7249318", "0.7240817", "0.72364235", "0.7221342", "0.7218413", "0.72167665", "0.72152", ...
0.68056774
50
Back button to return to previous panel (user prompted before actually doing so)
private void setupBackButton(){ ImageIcon back_button_image = new ImageIcon(parent_frame.getResourceFileLocation() + "back.png"); JButton back_button = new JButton("", back_button_image); back_button.setBorderPainted(false); back_button.setContentAreaFilled(false); back_button.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { boolean leave_result = askToLeave(); if (leave_result){ //no point speaking any more words if exiting parent_frame.getFestival().emptyWorkerQueue(); parent_frame.changePanel(PanelID.MainMenu); } } }); back_button.addMouseListener(new VoxMouseAdapter(back_button,null)); add(back_button); back_button.setBounds(1216, 598, 100, 100); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void back()\n\t{\n\t\tdriver.findElementById(OR.getProperty(\"BackButton\")).click();\n\t}", "private void backButton() {\n navigate.goPrev(this.getClass(), stage);\n }", "public void back() {\n Views.goBack();\n }", "public void goBack() {\n goBackBtn();\n }", "public ...
[ "0.8168362", "0.8142454", "0.78433514", "0.77784455", "0.77403283", "0.77327734", "0.772799", "0.76497656", "0.764223", "0.7569558", "0.75667435", "0.75649023", "0.75189483", "0.7504938", "0.749808", "0.7488992", "0.74781686", "0.74777734", "0.74632007", "0.7457959", "0.74576...
0.0
-1
Prompt that asks user if they want to return to main menu
private boolean askToLeave(){ int ask_leave_prompt = JOptionPane.YES_NO_OPTION; int ask_leave_result = JOptionPane.showConfirmDialog(this, "Would you like to return to main menu?\nYou will lose all progress", "Return To Main Menu", ask_leave_prompt); if (ask_leave_result == JOptionPane.YES_OPTION){ return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static boolean backToMenu() {\n boolean exit = false;\n System.out.println(\"Return to Main Menu? Type Yes / No\");\n Scanner sc2 = new Scanner(System.in);\n if (sc2.next().equalsIgnoreCase(\"no\"))\n exit = true;\n return exit;\n }", "public void main_men...
[ "0.80439484", "0.72562104", "0.7248419", "0.72409", "0.711738", "0.7060406", "0.6976528", "0.69683564", "0.6940016", "0.693024", "0.6896423", "0.67617726", "0.67467815", "0.67436266", "0.6705423", "0.6696505", "0.6688514", "0.66757643", "0.6644298", "0.66131824", "0.66001105"...
0.72225153
4
Begins quiz based on current word and current attempt fields of object Says word to spell, sample sentence (if there is one) and updates text progress area
private void startQuiz(){ parent_frame.getFestival().speak("Please spell... "+words_to_spell.get(current_word_number),false); feedback_display.append("Word: "+(current_word_number+1)+" out of "+words_to_spell.size()+"\nAttempt: "+current_attempt_number+" out of 2\n"); progress_bar.setValue(current_word_number); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void processAttempt(String attempt){\n\t\tinput_from_user.setText(\"\");//clear input field\t\n\n\t\tif(!attempt.matches(\".*[a-zA-Z]+.*\")){ \n\t\t\t//user doesn't enters any alphabetical characters\n\t\t\tfeedback_display.append(\"Feedback: Word includes alphabet characters, try again\\n\\n\");\n\t\t} el...
[ "0.69393474", "0.67436135", "0.6444417", "0.62883997", "0.62130207", "0.61519665", "0.61087304", "0.6089754", "0.60675687", "0.6036496", "0.60303754", "0.6006629", "0.6006145", "0.5994524", "0.5981685", "0.5951812", "0.5931601", "0.5907866", "0.5884952", "0.5856918", "0.58434...
0.83387816
0
Spelling checked when user pressed submit button
private void processAttempt(String attempt){ input_from_user.setText("");//clear input field if(!attempt.matches(".*[a-zA-Z]+.*")){ //user doesn't enters any alphabetical characters feedback_display.append("Feedback: Word includes alphabet characters, try again\n\n"); } else if(!attempt.equals(words_to_spell.get(current_word_number))&&(attempt.toLowerCase()).equals(words_to_spell.get(current_word_number).toLowerCase())){ //differs only by capitalisation feedback_display.append("Feedback: \""+attempt+"\" is spelt correctly but incorrect capitalisation, try again\n\n"); } else{ feedback_display.append("Feedback: \""+attempt+"\" is ");//updates progress area with user guess if(attempt.equals(words_to_spell.get(current_word_number))){ correctSpelling(); } else{ incorrectSpelling(); } } //When words to spell array exhausted, asks DataHandler to process results if (current_word_number == words_to_spell.size()){ //no point speaking any more things if quiz has already completed parent_frame.getFestival().emptyWorkerQueue(); parent_frame.getPostQuizHandler().processQuizResults(words_mastered,words_faulted,words_failed,quiz_type,words_to_spell.size()); //after processing results, so if got word correct after clicking Add To Review, word is still added parent_frame.getPostQuizHandler().addToReviewList(words_to_add_to_review); parent_frame.changePanel(PanelID.QuizComplete); } else{ //Otherwise keep going with quiz startQuiz(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String submitText();", "@Override\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\tString word=v.getInput().getText();\n\t\t\tlong t1=System.nanoTime();\n\t\t\tif(m.wordExists(word)){\n\t\t\t\tv.getCheck().setText(word+\" exists.\");\n\t\t\t}else{\n\t\t\t\tv.getCheck().setText(word + \" does not e...
[ "0.6221618", "0.59839165", "0.5868724", "0.58508176", "0.58383507", "0.58316934", "0.58060896", "0.5691582", "0.5678638", "0.5639513", "0.56289625", "0.562264", "0.5618004", "0.5616834", "0.5602504", "0.55890465", "0.5588506", "0.55860806", "0.55832905", "0.55591124", "0.5547...
0.0
-1
If correct spelling (casesensitive)
private void correctSpelling() { parent_frame.getFestival().speak("Correct", false); //adds to respective arraylist based on which attempt they get it right if (current_attempt_number==1){ words_mastered.add(words_to_spell.get(current_word_number)); } else {//words is faulted words_faulted.add(words_to_spell.get(current_word_number)); } current_word_number+=1; current_attempt_number=1; progress_bar.setForeground(Color.GREEN); progress_bar.setString("word "+current_word_number +" was CORRECT"); feedback_display.setText("");//clear display }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String spellcheck(String word) {\n // Check if the world is already in lcDictionary.\n String lcdictionaryLookup = lcDictionary.get(word.toLowerCase());\n if(lcdictionaryLookup != null) {\n return lcdictionaryLookup;\n }\n String reducedWord = reducedWord(word);\n String rwdictionaryL...
[ "0.7091778", "0.670951", "0.63873583", "0.6264053", "0.6228318", "0.61987185", "0.610693", "0.6063946", "0.5988446", "0.59780633", "0.59254354", "0.5887813", "0.5869131", "0.58522576", "0.5816272", "0.5806387", "0.5805401", "0.57904893", "0.57901406", "0.57898444", "0.5785588...
0.64358133
2
trait / interface for Value Objects / Case Classes / Algebraic Data Types unapply uses Reflection by default, but clients can override it if neccessary
public interface Decomposable{ default <T> T unwrap(){ return (T)this; } /** * @return Values of the fields of this Decomposable instance */ @SuppressWarnings("unchecked") default <I extends Iterable<?>> I unapply(){ if(unwrap() instanceof Iterable) return (I)unwrap(); try { return (I)ReflectionCache.getFields(unwrap().getClass()).stream().map(f ->{ try { return f.get(unwrap()); } catch (Exception e) { throw ExceptionSoftener.throwSoftenedException(e); } }).collect(Collectors.toList()); } catch (Exception e) { throw ExceptionSoftener.throwSoftenedException(e); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface ScalaReflection {\n public class Schema implements scala.Product, scala.Serializable {\n public org.apache.spark.sql.catalyst.types.DataType dataType () { throw new RuntimeException(); }\n public boolean nullable () { throw new RuntimeException(); }\n // not preceding\n public S...
[ "0.64439934", "0.63621014", "0.6173791", "0.59720314", "0.58128685", "0.57294524", "0.5723991", "0.57059234", "0.55362475", "0.5534922", "0.5525322", "0.5515754", "0.55011934", "0.54710114", "0.5453805", "0.53947276", "0.53852487", "0.535995", "0.53433317", "0.53409284", "0.5...
0.54873234
13
Checks that the size of the represented aggregation conforms to the expected value.
void assertSizeEquals(int expected);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void enforceSize(org.opensearch.search.aggregations.AggregationBuilder agg, int size) {\n if (size > 0) {\n if (TermsAggregationBuilder.class.isAssignableFrom(agg.getClass())) {\n ((TermsAggregationBuilder) agg).size(size);\n return;\n }\n ...
[ "0.6538981", "0.62865615", "0.6119432", "0.60481846", "0.6004403", "0.5999243", "0.59638244", "0.59433347", "0.5880772", "0.58470255", "0.58470255", "0.58470255", "0.58470255", "0.5780834", "0.5775852", "0.5769068", "0.57380027", "0.5729869", "0.572078", "0.57153785", "0.5692...
0.65995383
0
Checks that the self count of the item with the specified aggregation key in the represented aggregation conforms to the expected value.
void assertSelfCntEquals(T key, int expected);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void assertSelfCntPctEquals(T key, double expected);", "void assertTotalCntEquals(T key, int expected);", "void assertTotalCntPctEquals(T key, double expected);", "void assertSelfTimePctEquals(T key, double expected);", "void assertSelfTimeEquals(T key, long expected);", "private static boolean allowAddC...
[ "0.61930233", "0.59839976", "0.57859725", "0.5759875", "0.54355437", "0.52912074", "0.527222", "0.51772475", "0.508657", "0.502674", "0.49056762", "0.48370722", "0.4812564", "0.4694438", "0.468577", "0.46750158", "0.46435207", "0.46288916", "0.4613212", "0.46049297", "0.45895...
0.62383723
0