query
stringlengths
8
1.54M
document
stringlengths
9
312k
negatives
listlengths
19
20
metadata
dict
Sets the value of the itHasFreeShipping property.
public void setItHasFreeShipping(int value) { this.itHasFreeShipping = value; }
[ "public void setIsFreeShipping(Boolean isFreeShipping) {\n this.isFreeShipping = isFreeShipping;\n }", "public Boolean getIsFreeShipping() {\n return isFreeShipping;\n }", "public int getItHasFreeShipping() {\n return itHasFreeShipping;\n }", "public void setShipping(Address ship...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Use AvatarOptionMsg.newBuilder() to construct.
private AvatarOptionMsg(com.google.protobuf.GeneratedMessage.Builder<?> builder) { super(builder); this.unknownFields = builder.getUnknownFields(); }
[ "private PlayerAvatar(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n super(builder);\n this.unknownFields = builder.getUnknownFields();\n }", "private iAvatarInfo(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "private Avatar(Builder build...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Implementation of the abstract method that builds the grid column model for InternationalString.
@Override protected ColumnModel<InternationalString> buildColumnModel() { List<ColumnConfig<InternationalString, ?>> columnsConfigs = new ArrayList<ColumnConfig<InternationalString, ?>>(); languageCodeColumnConfig = new ColumnConfig<InternationalString, LanguageCode>( IS_PROPS.langCode(), 15, "Language Code"); titleColumnConfig = new ColumnConfig<InternationalString, String>( IS_PROPS.value(), 85, "Title"); columnsConfigs.add(languageCodeColumnConfig); columnsConfigs.add(titleColumnConfig); return new ColumnModel<InternationalString>( columnsConfigs); }
[ "public InternationalStringEditableGrid(String gridTitle) {\r\n super(gridTitle, new ListStore<InternationalString>(IS_PROPS.key())/*, buildColumnModel()*/);\r\n// setCheckBoxSelectionModel();\r\n }", "private void setupColumns() {\n \t\n\t\tcountryColumn = new TextColumn<Measurement>() {\n\t\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a new animation timer and calls act on the actors stored in the list
public void createTimer() { timer = new AnimationTimer() { @Override public void handle(long now) { act(now); List<Actor> actors = getObjects(Actor.class); for (Actor anActor: actors) { anActor.act(now); } } }; }
[ "private void animate() {\n Timer spinTimer = new Timer();\n spinTimer.schedule(new TimerTask() {\n \n @Override\n public void run() {\n if(isAlive()) {\n switch (animationCounter) {\n case 5:\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
theme color app label
public String getColorAppLabel() { return colorAppLabel;}
[ "public String getColorAppText() { return colorAppText;}", "public String _buildtheme() throws Exception{\n_theme.Initialize(\"pagetheme\");\r\n //BA.debugLineNum = 91;BA.debugLine=\"theme.AddABMTheme(ABMShared.MyTheme)\";\r\n_theme.AddABMTheme(_abmshared._mytheme);\r\n //BA.debugLineNum = 94;BA.debugLine=\"them...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Play Selected Song Convert selected index in Jlist (listSong) to Arraylist index (listSong in class action)
public void play(int idx) { try { if (action.statusPlay == 1) { action.stopMusic(); timer.cancel(); timespend = 0; } index = idx; arl = getList(); int lastIndex = arl.size(); if (index > lastIndex){ index = 0; } else if (index < 0) { index = lastIndex; } timer.cancel(); listSong.setSelectedIndex(index); action.playMusic(index); btnVolume.setEnabled(true); vlmSlide.setEnabled(true); seekBar.setEnabled(true); lblSong.setText("Now Playing : " + action.getTitle()); second = 1; startCount(); } catch (Exception e) { } }
[ "public void playSong(int songIndex);", "@Override\n public void onClick(View v) {\n\n\n\n List<AudioModel> l = new ArrayList<>();\n for (int i = 0; i < aList.size(); i++) {\n if (aList.get(i) insta...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the name of the cookie for the player id.
public void setIdCookieName(String idCookieName) { this.idCookieName = idCookieName; }
[ "public void setPlayerCookieName(String playerCookieName)\r\n {\r\n this.playerCookieName = playerCookieName;\r\n }", "abstract public void setCookie(String name, String value);", "public void setCookie(String cookie);", "@Updatable\n public String getCookieName() {\n return cookieName;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this method gets all the reference numbers of the arraylist choices
public ArrayList<Integer> getChoices() { return choices; }
[ "private List<Integer> getSelectedIndexes() {\n\t\tList<Integer> result = new LinkedList<Integer>();\n\t\tfor (int i = 0; i < this.checked.size(); i++) {\n\t\t\tif (this.checked.get(i))\n\t\t\t\tresult.add(i);\n\t\t}\n\t\treturn result;\n\t}", "private ArrayList<BasicCheckBox> getChooseIndices(String sheet) {\r\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get one jeu by id.
@Override @Transactional(readOnly = true) public JeuDTO findOne(Long id) { log.debug("Request to get Jeu : {}", id); Jeu jeu = jeuRepository.findOne(id); return jeuMapper.toDto(jeu); }
[ "public Usinas findOne(String id) {\n log.debug(\"Request to get Usinas : {}\", id);\n return usinasRepository.findOne(id);\n }", "Amigo getById( int id );", "Foodie getById(String id);", "public Jugador getJugador(int id_jugador){\n \n boolean encontrado = false;\n int i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This is the main method which reads in a users radius and height of a cylinder, computes the volume and surface area and outputs the values to 4 decimal places.
public static void main(String[] args) { //The radius and height of the cylinder. double radius; double height; //The area and volume of the cylinder. double area; double volume; DecimalFormat df = new DecimalFormat(); df.setMaximumFractionDigits(4); Scanner scan = new Scanner(System.in); System.out.println("Please enter in the radius and height " + "of a cylinder (radius first): "); radius = scan.nextDouble(); height = scan.nextDouble(); scan.close(); volume = Math.PI * Math.pow(radius, 2) * height; area = 2 * Math.PI * radius * (radius + height); System.out.println("The surface area of your cylinder is: " + df.format(area)); System.out.println("The volume of your cylinder is: " + df.format(volume)); System.out.println("Question two was called and ran sucessfully."); }
[ "public static void main(String[] args) {\r\n // Parameters for the cylinder.\r\n double radius;\r\n double height;\r\n double volume;\r\n \r\n // Create scanner instance to read user input.\r\n Scanner scan = new Scanner(System.in);\r\n \r\n // Get the...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "rule__XFeatureCall__Group_2__2" $ANTLR start "rule__XFeatureCall__Group_2__2__Impl" ../org.xtext.lwc.instances.ui/srcgen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:9026:1: rule__XFeatureCall__Group_2__2__Impl : ( ( rule__XFeatureCall__Group_2_2__0 ) ) ;
public final void rule__XFeatureCall__Group_2__2__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:9030:1: ( ( ( rule__XFeatureCall__Group_2_2__0 )* ) ) // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:9031:1: ( ( rule__XFeatureCall__Group_2_2__0 )* ) { // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:9031:1: ( ( rule__XFeatureCall__Group_2_2__0 )* ) // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:9032:1: ( rule__XFeatureCall__Group_2_2__0 )* { if ( state.backtracking==0 ) { before(grammarAccess.getXFeatureCallAccess().getGroup_2_2()); } // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:9033:1: ( rule__XFeatureCall__Group_2_2__0 )* loop58: do { int alt58=2; int LA58_0 = input.LA(1); if ( (LA58_0==39) ) { alt58=1; } switch (alt58) { case 1 : // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:9033:2: rule__XFeatureCall__Group_2_2__0 { pushFollow(FOLLOW_rule__XFeatureCall__Group_2_2__0_in_rule__XFeatureCall__Group_2__2__Impl18231); rule__XFeatureCall__Group_2_2__0(); state._fsp--; if (state.failed) return ; } break; default : break loop58; } } while (true); if ( state.backtracking==0 ) { after(grammarAccess.getXFeatureCallAccess().getGroup_2_2()); } } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; }
[ "public final void rule__XFeatureCall__Group_2_2__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:9116:1: ( rule__XFeatureC...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
converts a longitude/latitude long value in DDMMSS/DDDMMSS format to just seconds.
private long toSeconds(long x) { boolean neg = false; if (x < 0) { neg = true; } x = Math.abs(x); long sec = x % 100;// get first two digits x = x / 100;// move over two places long min = x % 100;// get next two digits x = x / 100;// move to places long answer = (x * 3600 + min * 60 + sec);// conversion equation if (neg) { // check if negative needs to be applied. return answer * -1; } return answer; }
[ "public String date2SecondsString(long time);", "public static double convertFromMillisToSec(long time) {\n return ((double) time / 1000);\n }", "private static long convertToSeconds(String time) {\n String[] timeArgs = time.trim().split(\":\");\n long hours = Long.parseLong(timeArgs[0])...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
An algorithm for computing clusters (community structure) in graphs based on edge betweenness. [Note: The betweenness of an edge measures the extent to which that edge lies along shortest paths between all pairs of nodes.] Edges which are least central to communities are progressively removed until the communities have been adequately separated.
public Set<Set<Entity>> getEdgeBetweennessClusters(double ratioEdgesToRemove) { int numEdgesToRemove = (int) (getNumberOfEdges() * ratioEdgesToRemove); EdgeBetweennessClusterer<Entity, EntityGraphEdge> betweenClusterer = new EdgeBetweennessClusterer<Entity, EntityGraphEdge>( numEdgesToRemove); List<Set<Entity>> clusters = new ArrayList<Set<Entity>>( betweenClusterer.transform(directedGraph)); logger.info("Number of edge-betweenness clusters: " + clusters.size()); Collections.sort(clusters, sortListBySizeDescending); Iterator<Set<Entity>> clusterIter = clusters.iterator(); Set<Set<Entity>> clusterSet = new HashSet<Set<Entity>>(); while (clusterIter.hasNext()) { Set<Entity> nodeCluster = clusterIter.next(); Set<Entity> entCluster = new HashSet<Entity>(); for (Entity node : nodeCluster) { entCluster.add(node); } logger.info("Cluster's size: " + entCluster.size()); clusterSet.add(entCluster); } return clusterSet; }
[ "static double clusterVerticesOneStep(Mesh mesh) {\n\t\t\n\t\t// for each pair of the vertices\n\t\tdouble mindis = 1.0e+30;\n\t\tfor(int i = 0; i < mesh.getNumVertices(); i++) {\n\t\t\tVertex v1 = mesh.getVertex(i);\n\t\t\tfor(int j = (i + 1); j < mesh.getNumVertices(); j++) {\n\t\t\t\tVertex v2 = mesh.getVertex(j...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Verify ads in mobile article.
public void verifyAdsInMobileArticle() { try { scrollBy(0, 500); boolean ads=elementPresent("Ad Placeholder#xpath=//div[@class='article-mobile-ad ng-scope ng-isolate-scope']"); if(ads==true) { String adPlaceHolder = "Ad Placeholder#xpath=//div[@class='article-mobile-ad ng-scope ng-isolate-scope']"; int adCount = getElementCount(adPlaceHolder); testStepPassed("Verifing (" + adCount + ") Ads in the Aritcle Page"); int adsNum=1; for (adsNum = 1; adsNum <= adCount; adsNum++) { adCount = getElementCount(adPlaceHolder); verifyAd(adsNum); } } else { getCurrentPageURL(); testStepFailed("Ads are not displayed in Article page"); } } catch (Exception e) { // TODO Auto-generated catch block writeToLogFile("ERROR", "Exception: " + e.toString()); } }
[ "public void verifyRealTimeAds() {\r\n\t\ttestStepInfo(\"************************************* Ads**********************************************\");\r\n\t\t\r\n\t\tvalidateTopAds();\r\n\t\tvalidateRecAds();\r\n\t\tvalidateRailRecAds();\r\n\t\tvalidateTextAds();\r\n\t\tvalidateLogeAds();\r\n\t\t\r\n\t\t\r\n\r\n\t}",...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Builds the SQLite WHERE clause that matches all matchColumns to two different queries.
private static String buildTwoWordWhereClause(String[] matchColumns) { StringBuilder sb = new StringBuilder(" ("); final int count = matchColumns.length; for (int n = 0; n < count; n++) { sb.append(matchColumns[n]); sb.append(" like ? OR "); sb.append(matchColumns[n]); sb.append(" like ?"); if (n < count - 1) { sb.append(" OR "); } } sb.append(") AND enabled = 1"); return sb.toString(); }
[ "private static String buildSingleWordWhereClause(String[] matchColumns) {\n StringBuilder sb = new StringBuilder(\" (\");\n final int count = matchColumns.length;\n for (int n = 0; n < count; n++) {\n sb.append(matchColumns[n]);\n sb.append(\" like ? \");\n if ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns current value of the signal
public float getSignalValue(int index);
[ "public double getSignal() {return _signal;}", "public double getSignal() {\r\n return signals.lastEntry().getValue();\r\n }", "public double getSignal(){\n\t\t\treturn SIGNAL; //a constant for olfactory\n\t\t}", "void computeCurrentValue();", "@Override\n public double getOutputCurr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Renders an "access denied" message and stops the execution of the script. The mode parameters controls the layout of the message: ACCESS_DENY_OBJECT render the message when denying access to a specific object ACCESS_DENY_PAGE render a complete access denied page
public static void access_deny(int mode){ throw new ExitException(mode); }
[ "public void denyAccess() {\r\n\t\tGraphene.waitAjax().until().element(approveAccessButton).is().present();\r\n\t\tdenyAccessButton.click();\r\n\t}", "@GetMapping(\"/access-denied\")\n\tpublic String displayAccessDeniedPage() {\n\t\treturn \"error/access-denied\";\n\t}", "public void setDenied() {\r\n\t\tstatus...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Ataca con un decepticon a un accionable cualquiera. Parametros: tablero: tablero del juego. atacante: decepticon que ataca. atacado: accionable que es atacado. potencia: potencia del atacante.
public void atacar(Tablero tablero, Decepticon atacante, Accionable atacado,Potencia potencia);
[ "public void atacar(Tablero tablero, Autobot atacante, Accionable atacado, Potencia potencia);", "public void reabrirContrato() {\n int i;\n if (hospedesCadastrados.isEmpty()) {\n System.err.println(\"Nao existe hospedes cadastrados\\n\");\n } else {\n listarHospedes();\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Invokes a httpmethod and takes care of some error handling.
private void invokeTheMethod(HttpMethodBase method, HttpClient httpClient) throws Exception { log.debug("method=" + method.getURI()); //create the connection manager and add it to the client HttpConnectionManager man = new SimpleHttpConnectionManager(); man.setParams(new HttpConnectionParam()); httpClient.setHttpConnectionManager(man); log.trace("Outgoing request headers: " + Arrays.toString(method.getRequestHeaders())); //make the call int statusCode = httpClient.executeMethod(method); if (statusCode != HttpStatus.SC_OK) { log.error(method.getStatusLine()); //if its unavailable then throw updateCSWRecords connection exception if (statusCode == HttpStatus.SC_SERVICE_UNAVAILABLE) throw new ConnectException(); //if the response is not OK then throw an error throw new Exception("Returned status line: " + method.getStatusLine()); } }
[ "public static HttpResponseMessage executeHttpMethod(HttpMethod method) {\n\n HttpResponseMessage responseMessage = null;\n\n try {\n System.out.println(\"Method invocation on URI: \\n\");\n System.out.println(method.getURI().toString());\n // Execute Request\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Multiplies a double variable by the value of a UnitP one. Eventual errors will be managed as defined by the double type.
public static UnitP Multiplication(double first, UnitP second) { return OperationsPublic.PerformUnitOperation ( first, second, Operations.Multiplication, OperationsOther.GetOperationString(first, second, Operations.Multiplication) ); }
[ "void multiply(double value);", "public static UnitP Multiplication(UnitP first, double second)\n {\n return OperationsPublic.PerformUnitOperation\n (\n first, second, Operations.Multiplication, \n OperationsOther.GetOperationString(first, second, Operations.Multiplication)\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Unsets the "SearchRecurrenceStart" element
void unsetSearchRecurrenceStart();
[ "void unsetSearchRecurrenceRule();", "void setNilSearchRecurrenceStart();", "void unsetRecurrenceDuration();", "void xsetSearchRecurrenceStart(org.apache.xmlbeans.XmlDateTime searchRecurrenceStart);", "void setSearchRecurrenceStart(java.util.Calendar searchRecurrenceStart);", "public void resetSearchSelec...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Perform validation, set defaults, and deliver built instance of AgentPolicy.
AgentPolicy build();
[ "public Builder( Policy policy ) {\n\t\t\tthis.policy = policy;\n\t\t}", "AgentPolicyBuilder setJobPriority(JobPriority jobPriority);", "public Policy(gw.pl.persistence.core.BundleProvider bundleProvider) {\n this((java.lang.Void)null);\n com.guidewire.pl.system.entity.proxy.BeanProxy.initNewBeanInstance...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the file name for a chunk nest
public static File getChunkFile(GChunk chunk) { return new File(new File(Worlds.getWorld(chunk.getWorld()).getWorldFolder(), "nest"), "n." + chunk.getX() + "." + chunk.getZ() + ".n"); }
[ "private String getChunkName(ScriptContext context) {\n\t\tif (context != null) {\n\t\t\tObject fileName = context.getAttribute(FILENAME);\n\t\t\tif (fileName != null) {\n\t\t\t\treturn fileName.toString();\n\t\t\t}\n\t\t}\n\t\treturn \"null\";\n\t}", "public String getChunkFileName() {\n return chunkFileN...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a message wrapper for the given object and message type
public static String createWrapper(Object o, MessageType type) { WrapperMessage message = new WrapperMessage(); message.setMessageType(type); message.setMessageBody(serializeObject(o)); Gson gson = new Gson(); return gson.toJson(message); }
[ "public <T extends GeneratedMessage> Wrapper wrap(T message, Type type);", "ObjectMessage createObjectMessage();", "protected abstract Message createMessage(Object object, MessageProperties messageProperties);", "MessagesType createMessagesType();", "public abstract Message createMessage(Navajo tb, String n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a subscription and a tab for it.
public void createSubscription(final Color color, final boolean subscribe, final TabbedSubscriptionDetails subscriptionDetails, final MqttAsyncConnection connection, final ConnectionController connectionController, final Object parent) { logger.info("Creating subscription for " + subscriptionDetails.getTopic()); final MqttSubscription subscription = new MqttSubscription(subscriptionDetails.getTopic(), subscriptionDetails.getQos(), color, connection.getProperties().getConfiguredProperties().getMinMessagesStoredPerTopic(), connection.getPreferredStoreSize(), uiEventQueue, eventBus, connection.getStore().getFormattingManager(), UiProperties.getSummaryMaxPayloadLength(configurationManager.getUiPropertyFile())); subscription.setConnection(connection); subscription.setDetails(subscriptionDetails); // Add a new tab final SubscriptionController subscriptionController = createSubscriptionTab( false, subscription.getStore(), subscription, connection, connectionController); subscriptionController.getTab().setContextMenu(ContextMenuUtils.createSubscriptionTabContextMenu( connection, subscription, eventBus, this, configurationManager, subscriptionController)); subscriptionController.setConnectionController(connectionController); subscriptionController.setFormatting(configurationManager.getConfiguration().getFormatting()); subscriptionController.setTabStatus(new TabStatus()); subscriptionController.getTabStatus().setVisibility(PaneVisibilityStatus.NOT_VISIBLE); subscriptionController.init(); subscriptionController.onSubscriptionStatusChanged(new SubscriptionStatusChangeEvent(subscription)); subscription.setSubscriptionController(subscriptionController); final SpyPerspective perspective = viewManager.getPerspective(); subscriptionController.setViewVisibility(ViewManager.getDetailedViewStatus(perspective), ViewManager.getBasicViewStatus(perspective)); subscriptionController.getTabStatus().setVisibility(PaneVisibilityStatus.ATTACHED); subscriptionController.getTabStatus().setParent(connectionController.getSubscriptionTabs()); final TabPane subscriptionTabs = connectionController.getSubscriptionTabs(); subscriptionTabs.getTabs().add(subscriptionController.getTab()); subscriptionTabs.getTabs().get(ALL_SUBSCRIPTIONS_TAB_INDEX).setDisable(false); if (subscribe) { logger.debug("Trying to subscribe {}", subscription.getTopic()); connection.subscribe(subscription); } else { connection.addSubscription(subscription); subscription.setActive(false); } }
[ "public void createSubscription(Subscription sub);", "public void createSubscription(SubscriptionData subscription, List<EntitlementEvent> initialEvents, InternalCallContext context);", "void addNewSubscription(Subscription newSubscription);", "protected SubscriptionController createSubscriptionTab(final bool...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper to create properties form one more key value pairs formatted as "[key]=[Value]".
public Properties props(String... propStrs) { Properties props = new Properties(); for (String propStr : propStrs) { String[] split = propStr.split("="); if (split.length == 2) { props.put(split[0].trim(), split[1].trim()); } else { log.warn(propStr + " is not a key value pair"); } } return props; }
[ "private static Map<String, String> createPropertiesAttrib() {\r\n Map<String, String> map = new HashMap<String, String>();\r\n map.put(\"Property1\", \"Value1SA\");\r\n map.put(\"Property3\", \"Value3SA\");\r\n return map;\r\n }", "public static Properties createProperty(Vector key...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "rule__Number__Group_1__0" $ANTLR start "rule__Number__Group_1__0__Impl" ../de.nie.fin.ui/srcgen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:15601:1: rule__Number__Group_1__0__Impl : ( ( rule__Number__Alternatives_1_0 ) ) ;
public final void rule__Number__Group_1__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:15605:1: ( ( ( rule__Number__Alternatives_1_0 ) ) ) // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:15606:1: ( ( rule__Number__Alternatives_1_0 ) ) { // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:15606:1: ( ( rule__Number__Alternatives_1_0 ) ) // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:15607:1: ( rule__Number__Alternatives_1_0 ) { if ( state.backtracking==0 ) { before(grammarAccess.getNumberAccess().getAlternatives_1_0()); } // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:15608:1: ( rule__Number__Alternatives_1_0 ) // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:15608:2: rule__Number__Alternatives_1_0 { pushFollow(FOLLOW_rule__Number__Alternatives_1_0_in_rule__Number__Group_1__0__Impl31548); rule__Number__Alternatives_1_0(); state._fsp--; if (state.failed) return ; } if ( state.backtracking==0 ) { after(grammarAccess.getNumberAccess().getAlternatives_1_0()); } } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; }
[ "public final void rule__Number__Group_1__0__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.guicemodules.ui/src-gen/org/xtext/guicemodules/ui/contentassist/antlr/internal/InternalGuiceModules.g:15133:1: ( ( ( rule__Numbe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returning all the details of credit card having given cardNo and customerId.
@GetMapping(path="/customers/{customerId}/creditcard/{cardNo}", produces= {"application/json"}) public CreditCardDetails getDetails(@PathVariable("customerId") String customerId,@PathVariable("cardNo")String cardNo){ return creditCardServices.getCreditCardDetails(cardNo,customerId); }
[ "@Override\r\n\tpublic CustomerCard getCustomerCard(Long cardId,String cardNumber) {\r\n\t\tQuery query=getSessionFactory().getCurrentSession().createQuery(\"from CustomerCard as cc where cc.cardId!=:cardId and cc.cardNumber=:cardNumber and cc.status!=:status\");\r\n\t\tquery.setParameter(\"cardId\", cardId);\r\n\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
HMV node stroke width will be interpolated between a source and a destination value depending on its probability value.
public double getNodeStrokeDestinationWidth() { return (_nodeStrokeDestinationWidth); }
[ "public void setNodeStrokeDestinationWidth(double value) {\n _nodeStrokeDestinationWidth = value;\n }", "public void setEdgeStrokeDestinationWidth(double value) {\n _edgeStrokeDestinationWidth = value;\n }", "public void setEdgeStrokeSourceWidth(double value) {\n _edgeStrokeSourceWidth = value;\n }"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initialises the segment parameters that are not directly defined during creation or reinitialisation of this ExposureSegment
protected void initSegment() { ((AtmosphericPressure)ambientPressureAtStart).setHeight(heightAtStart); ((AtmosphericPressure)ambientPressureAtEnd).setHeight(heightAtEnd); }
[ "protected void initSupportedIntensityMeasureParams() {\n\n // Create saParam:\n DoubleDiscreteConstraint periodConstraint = new DoubleDiscreteConstraint();\n for (int i = 0; i < period.length; i++) {\n periodConstraint.addDouble(new Double(period[i]));\n }\n periodConstraint.setNonEditable();\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a new instance of UnivariateGaussian using a weighted Maximum Likelihood estimate based on the given data
@Override public StudentTDistribution.PDF learn( final Collection<? extends WeightedValue<? extends Double>> data ) { return WeightedMaximumLikelihoodEstimator.learn( data, this.defaultVariance ); }
[ "public MultivariateGaussian createWeightDistribution();", "public UnivariateGaussian evaluateAsGaussian(\n final Vectorizable input);", "GaussianType createGaussianType();", "public static WeightedMA getBackwardGaussianWeightedInstance(\n final int windowsize) {\n double sigma = (wi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
POST /aurestobills : Create a new auRestoBill.
@PostMapping("/au-resto-bills") @Timed public ResponseEntity<AuRestoBill> createAuRestoBill(@RequestBody AuRestoBill auRestoBill) throws URISyntaxException { log.debug("REST request to save AuRestoBill : {}", auRestoBill); if (auRestoBill.getId() != null) { return ResponseEntity.badRequest().headers(HeaderUtil.createFailureAlert(ENTITY_NAME, "idexists", "A new auRestoBill cannot already have an ID")).body(null); } AuRestoBill result = auRestoBillRepository.save(auRestoBill); auRestoBillSearchRepository.save(result); return ResponseEntity.created(new URI("/api/au-resto-bills/" + result.getId())) .headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString())) .body(result); }
[ "@PostMapping(\"/getBill\")\n\tpublic Bill createBill(@RequestBody Bill bill) {\n\t\treturn billController.calculateBill(bill);\n\t}", "Bill createBill();", "public static void createBillSummary() {\n \t\tSystem.out.println(\"\\n_______________ Bill Sumary INSERT _______________\");\n\n \t\tString uri = b...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
play(Hand hand1, Hand hand2) FLUSH VS
@Test public void play_FlushVsFlush() throws Exception { Hand hand1 = new Hand(); hand1.addCard(new Card(Card.SUIT_HEARTS, Card.CARD_3)); hand1.addCard(new Card(Card.SUIT_HEARTS, Card.CARD_4)); hand1.addCard(new Card(Card.SUIT_HEARTS, Card.CARD_8)); hand1.addCard(new Card(Card.SUIT_HEARTS, Card.CARD_9)); hand1.addCard(new Card(Card.SUIT_HEARTS, Card.CARD_KING)); Hand hand2 = new Hand(); hand2.addCard(new Card(Card.SUIT_CLUBS, Card.CARD_5)); hand2.addCard(new Card(Card.SUIT_CLUBS, Card.CARD_7)); hand2.addCard(new Card(Card.SUIT_CLUBS, Card.CARD_8)); hand2.addCard(new Card(Card.SUIT_CLUBS, Card.CARD_JACK)); hand2.addCard(new Card(Card.SUIT_CLUBS, Card.CARD_ACE)); assertEquals(hand2, FiveCardDraw.play(hand1, hand2)); }
[ "@Test\n public void play_RoyalFlushVsStraightFlush() throws Exception {\n Hand hand1 = new Hand();\n hand1.addCard(new Card(Card.SUIT_DIAMONDS, Card.CARD_10));\n hand1.addCard(new Card(Card.SUIT_DIAMONDS, Card.CARD_JACK));\n hand1.addCard(new Card(Card.SUIT_DIAMONDS, Card.CARD_QUEEN)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Use SCChatMessageResult.newBuilder() to construct.
private SCChatMessageResult(com.google.protobuf.GeneratedMessage.Builder<?> builder) { super(builder); this.unknownFields = builder.getUnknownFields(); }
[ "private SCLobbyChatMessageResult(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n super(builder);\n this.unknownFields = builder.getUnknownFields();\n }", "private SCInteractionResult(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n super(builder);\n this.unknownFie...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "rulescheduleType" $ANTLR start "entryRulegenerateStatement" InternalMASL.g:4314:1: entryRulegenerateStatement returns [EObject current=null] : iv_rulegenerateStatement= rulegenerateStatement EOF ;
public final EObject entryRulegenerateStatement() throws RecognitionException { EObject current = null; EObject iv_rulegenerateStatement = null; try { // InternalMASL.g:4314:58: (iv_rulegenerateStatement= rulegenerateStatement EOF ) // InternalMASL.g:4315:2: iv_rulegenerateStatement= rulegenerateStatement EOF { if ( state.backtracking==0 ) { newCompositeNode(grammarAccess.getGenerateStatementRule()); } pushFollow(FOLLOW_1); iv_rulegenerateStatement=rulegenerateStatement(); state._fsp--; if (state.failed) return current; if ( state.backtracking==0 ) { current =iv_rulegenerateStatement; } match(input,EOF,FOLLOW_2); if (state.failed) return current; } } catch (RecognitionException re) { recover(input,re); appendSkippedTokens(); } finally { } return current; }
[ "public final EObject rulescheduleStatement() throws RecognitionException {\n EObject current = null;\n\n Token this_SCHEDULE_0=null;\n Token this_DELTA_5=null;\n EObject this_expression_1 = null;\n\n EObject lv_g_2_0 = null;\n\n EObject lv_e_4_0 = null;\n\n EObject ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test of addAnalysis method, of class AnalysisDB.
@Test public void testAddAnalysis() { ConnectionDB.requestInsert("insert into category values('Truc')"); ConnectionDB.requestInsert("insert into specie values('Lala','Truc')"); //Analysis priseSang = new Analysis(); //boolean resultat = AnalysisDB.addAnalysis(priseSang); }
[ "@Test\r\n public void testAddAnalysis() {\r\n System.out.println(\"addAnalysis\");\r\n Analysis a = new Analysis(BigDecimal.ONE, BigDecimal.ONE, BigDecimal.ONE, null, 1, null, null, 1);\r\n assertEquals(0, w.analysies.size());\r\n w.addAnalysis(a);\r\n assertEquals(1, w.analys...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
copy z (m), the successor of x, and put it instead of z, put z instead of x, delete m
private WAVLNode swap (WAVLNode x, WAVLNode z) { WAVLNode ret = EXT_NODE; WAVLNode m = new WAVLNode(); // create a copy of z m.right=z.right; m.left=z.left; m.rank=z.rank; m.parent=z.parent; m.sizen=z.sizen; m.info=z.info; m.key=z.key; WAVLNode aba = x.parent; String side=null; if (x.parent!=null) { //if x is not the root side = parentside(x.parent, x); // keep the side of x related to x's parent } if(parentside(z.parent, z).equals("left")) { // put the copy of z in the correct side of z's parent z.parent.left=m; } else { z.parent.right=m; } // replace x with z x.left.parent=z; x.right.parent=z; z.right=x.right; z.left=x.left; z.sizen=x.sizen; z.rank=x.rank; z.parent=x.parent; if(aba!=null) { // if x is not the root if(side.equals("left")) {// put z in the correct size of x's parent aba.left=z; } else { aba.right=z; } } else { // x is the root, change root pointer to z this.root=z; } return m; }
[ "Position<Pair<K, V>> restructure(Position<Pair<K, V>> x) {\r\n Position<Pair<K, V>> y = parent(x);\r\n Position<Pair<K, V>> z = parent(y);\r\n if ((x == right(y)) == (y == right(z))) {\r\n rotate(y);\r\n return y;\r\n } else {\r\n rotate(x);\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
GET /marketboxes/:id : get the "id" marketBox.
@GetMapping("/market-boxes/{id}") @Timed public ResponseEntity<MarketBox> getMarketBox(@PathVariable Long id) { log.debug("REST request to get MarketBox : {}", id); MarketBox marketBox = marketBoxService.findOne(id); return ResponseUtil.wrapOrNotFound(Optional.ofNullable(marketBox)); }
[ "@GetMapping(\"/market-boxes\")\n @Timed\n public List<MarketBox> getAllMarketBoxes() {\n log.debug(\"REST request to get all MarketBoxes\");\n return marketBoxService.findAll();\n }", "@GetMapping(\"/stock-in-boxes/{id}\")\n @Timed\n public ResponseEntity<StockInBoxDTO> getStockInBox...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A class that implements this interface can tell if a given element should strip whitespace nodes from it's children.
public interface WhitespaceStrippingElementMatcher { /** * Get information about whether or not an element should strip whitespace. * @see <a href="http://www.w3.org/TR/xslt#strip">strip in XSLT Specification</a> * * @param support The XPath runtime state. * @param targetElement Element to check * * @return true if the whitespace should be stripped. * * @throws TransformerException */ public boolean shouldStripWhiteSpace( XPathContext support, Element targetElement) throws TransformerException; /** * Get information about whether or not whitespace can be stripped. * @see <a href="http://www.w3.org/TR/xslt#strip">strip in XSLT Specification</a> * * @return true if the whitespace can be stripped. */ public boolean canStripWhiteSpace(); }
[ "public boolean isIgnoreElementContentWhitespace() {\n return ignoreElementContentWhitespace;\n }", "public boolean canStripWhiteSpace();", "private boolean stripElement(JCTree element, JCModifiers modifiers) {\n for (JCAnnotation a : modifiers.getAnnotations()) {\n String annotationName = a.g...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Find out if this URLWatcher is watching a given URL.
public boolean isWatching(URL u) { URLItem ui=getURLItem(u); return(ui != null); }
[ "boolean hasWatchUrl();", "public synchronized boolean wasURLCrawled(String url) {\r\n return crawledURLs.contains(url);\r\n }", "public boolean shouldScheduleURL(URLInfo url);", "boolean isInScope(java.net.URL url);", "private static boolean isWebserverReachable ( final URL _url ) {\r\n if ( !is...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Clears the value of the 'BRAND_KEY' field.
public org.LNDCDC_ADS_PRPSL.PROPOSAL_LINE.apache.nifi.LNDCDC_ADS_PRPSL_PROPOSAL_LINE.Builder clearBRANDKEY() { BRAND_KEY = null; fieldSetFlags()[9] = false; return this; }
[ "public void unsetBrandID()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(BRANDID$4, 0);\n }\n }", "void unsetBrandCode();", "public void clearDebitKeyCode() {\n genClient.clear(CacheKey.debitKeyCode);\n }", "void unset...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method returns the Footer value.
@Fields({ @Field(offset = 66, length = 5, paddingChar = '\'') }) public final String getFooter() { return this.Footer; }
[ "protected Footer getFooter() {\n return footer;\n }", "String getPresentationFooter();", "@Override\n public java.lang.String getFooter() {\n return _contestEmailTemplate.getFooter();\n }", "protected String getPageFooter()\n {\n if (this.pageFooter == null) {\n St...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a new instance of ListMetricEnrichmentStatusOptions.
public ListMetricEnrichmentStatusOptions(OffsetDateTime startTime, OffsetDateTime endTime) { this.startTime = startTime; this.endTime = endTime; }
[ "@Nonnull\n public com.microsoft.graph.requests.ManagedAppStatusCollectionRequestBuilder managedAppStatuses() {\n return new com.microsoft.graph.requests.ManagedAppStatusCollectionRequestBuilder(getRequestUrlWithAdditionalSegment(\"managedAppStatuses\"), getClient(), null);\n }", "private void initEl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the value of the 'Inter contestable' attribute.
String getInter_contestable();
[ "public String getcInterest() {\n return cInterest;\n }", "@Override\n\tpublic int getContest_val() {\n\t\treturn _cholaContest.getContest_val();\n\t}", "public java.lang.String getContraIndication() {\n\t\treturn contraIndication;\n\t}", "public String getInscEstadual() {\n return inscEstadu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "rule__Implementation__NameAssignment_1" $ANTLR start "rule__Implementation__ContextAssignment_2" ../com.avaloq.tools.dslsdk.check.ui/srcgen/com/avaloq/tools/dslsdk/check/ui/contentassist/antlr/internal/InternalCheck.g:17961:1: rule__Implementation__ContextAssignment_2 : ( ruleContext ) ;
public final void rule__Implementation__ContextAssignment_2() throws RecognitionException { int stackSize = keepStackSize(); try { // ../com.avaloq.tools.dslsdk.check.ui/src-gen/com/avaloq/tools/dslsdk/check/ui/contentassist/antlr/internal/InternalCheck.g:17965:1: ( ( ruleContext ) ) // ../com.avaloq.tools.dslsdk.check.ui/src-gen/com/avaloq/tools/dslsdk/check/ui/contentassist/antlr/internal/InternalCheck.g:17966:1: ( ruleContext ) { // ../com.avaloq.tools.dslsdk.check.ui/src-gen/com/avaloq/tools/dslsdk/check/ui/contentassist/antlr/internal/InternalCheck.g:17966:1: ( ruleContext ) // ../com.avaloq.tools.dslsdk.check.ui/src-gen/com/avaloq/tools/dslsdk/check/ui/contentassist/antlr/internal/InternalCheck.g:17967:1: ruleContext { if ( state.backtracking==0 ) { before(grammarAccess.getImplementationAccess().getContextContextParserRuleCall_2_0()); } pushFollow(FOLLOW_ruleContext_in_rule__Implementation__ContextAssignment_236102); ruleContext(); state._fsp--; if (state.failed) return ; if ( state.backtracking==0 ) { after(grammarAccess.getImplementationAccess().getContextContextParserRuleCall_2_0()); } } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; }
[ "public final void rule__Implementation__Group__2__Impl() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \r\n try {\r\n // ../com.avaloq.tools.dslsdk.check.ui/src-gen/com/avaloq/tools/dslsdk/check/ui/contentassist/antlr/internal/InternalCheck.g:509...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Save an existing ProjectAppMajor entity
@RequestMapping("/saveProjectAppMajor") public String saveProjectAppMajor(@ModelAttribute ProjectAppMajor projectappmajor) { projectAppMajorService.saveProjectAppMajor(projectappmajor); return "forward:/indexProjectAppMajor"; }
[ "@RequestMapping(\"/saveProjectAppMajorSchoolMajor\")\n\tpublic ModelAndView saveProjectAppMajorSchoolMajor(@RequestParam Integer projectappmajor_id, @ModelAttribute SchoolMajor schoolmajor) {\n\t\tProjectAppMajor parent_projectappmajor = projectAppMajorService.saveProjectAppMajorSchoolMajor(projectappmajor_id, sch...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Shows the leveleditor for selected level.
public void showLevelEditor(LevelProp level) { try { FXMLLoader loader = new FXMLLoader(); loader.setLocation(MainApp.class.getResource("view/LevelEditor.fxml")); AnchorPane pane = (AnchorPane) loader.load(); Scene scene = new Scene(pane); LevelEditorController controller = loader.getController(); controller.setLevel(level); controller.setMainApp(this); controller.initCanvases(); primaryStage.setScene(scene); } catch (IOException e) { e.printStackTrace(); } }
[ "public void showLevelSelect() {\n selectUI.updateStatus();\n showUI(selectUI);\n }", "public void DisplayCustomLevel()\n\t{// resets perspective to custom level\n\t\tmView.mlevel = levelSelect;\n\t\tmView.customLevelSelected = true;\n\t\tmView.mCurState = 0;\n\t}", "public void showLevel(int l...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This should test whether a collection is new or not. It should account for renamed collections and all the rules that are mentioned in the wiki page.
@Ignore @Test public void testIsCollectionNew() { }
[ "@Override\n\tpublic boolean verifierCollection(String nomCollection) {\n\t\tMongoIterable<String> names = db.listCollectionNames();\n\t\tMongoCursor<String> cursor = names.cursor(); \n\t\twhile(cursor.hasNext()) {\n\t\t\tif (cursor.next().equals(nomCollection))\n\t\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Recalculates the candidates of a Cell.
private BitSet calculateCandidates(final Cell cell) { // Start by assuming that every available value is a candidate. BitSet candidates = new BitSet(gridSize + 1); candidates.set(1, gridSize + 1, true); // If any of the cell's buddies have the value, remove that value from the candidates. Iterator iterator = puzzleModel.getBuddies(cell).iterator(); while (iterator.hasNext()) { Cell buddy = (Cell) iterator.next(); if (buddy.getState() == CellState.GIVEN) { candidates.clear(buddy.getValue()); } } return candidates; }
[ "void updateCellNumbers() {\n cells.stream().forEach(row -> row.stream().filter(cell -> !cell.isMine()).forEach(cell -> {\n int numNeighbouringMines =\n (int) getNeighboursOf(cell).stream().filter(neighbour -> neighbour.isMine()).count();\n cell.setNumber(numNeighbouringMines);\n }));\n }"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Picks a random pivot element between l and r and partitions
public static int randomPartition(double arr[], int l, int r) { int pivot = (int) Math.round(l + Math.random() * (r - l)); swap(arr, pivot, r); return partition(arr, l, r); }
[ "private int pivotIndex(int left, int right){\n\t\treturn left+ (int)(Math.random()*(right - left + 1));\n\t}", "private int random_partition(Object arr[], int left, int right) {\n\t\t\n\t\tint n = right - left + 1, i = left;\n\t\tint pivot_index = ThreadLocalRandom.current().nextInt(n);\n\t\tswap(arr, left + piv...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
add random pointers for new nodes
private void addRandomPointers(RandomListNode head) { RandomListNode cur = head; while (cur != null) { RandomListNode newNode = cur.next; if (cur.random == null) { newNode.random = null; } else { newNode.random = cur.random.next; } cur = newNode.next; } }
[ "public void fill() {\n Random rand=new Random(2);\n \n for(int i=0;i<size;i++){\n if(current==null){\n current=new VecNode(i, rand.nextDouble());\n first=current;\n }\n else{\n VecNode last=new VecNode(i, rand.nextDouble());\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Utility method for creating a SmartServiceException that can be passed back to the Appian framework
private SmartServiceException createException(Throwable t, String key, Object... args) { return new SmartServiceException.Builder(getClass(), t).userMessage(key, args).build(); }
[ "RestLiServiceException getServiceException();", "public interface ServiceException {}", "public ServiceException()\n {\n super();\n\n this.serviceError = new ServiceError(this);\n }", "public DataAccessorServiceException() {\n }", "public HarvServiceException()\n\t{}", "Exception createExcepti...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove Added Join Relationships
@Override public void undo() { if (!businessView.getJoinRelationships().isEmpty()){ businessView.getJoinRelationships().removeAll(addedJoinRelationships); businessModel.getJoinRelationships().removeAll(addedJoinRelationships); } //Add Removed Join Relationships businessView.getJoinRelationships().addAll(removedJoinRelationships); businessModel.getJoinRelationships().addAll(removedJoinRelationships); int i = 0; //Edited Join Relationships for (BusinessViewInnerJoinRelationship modifiedJoinRelationship: modifiedJoinRelationships){ modifiedJoinRelationship.getSourceColumns().clear(); modifiedJoinRelationship.getSourceColumns().addAll(modifiedSourceColumns.get(i)); modifiedJoinRelationship.getDestinationColumns().clear(); modifiedJoinRelationship.getDestinationColumns().addAll(modifiedDestinationColumns.get(i)); i++; } }
[ "void unsetFurtherRelations();", "void unsetRelations();", "public void delIncomingRelations();", "public void delRelations();", "public void removeAllRelations() {\n\t\tfor (Relation rel: this.relations) {\n\t\t\tKey otherKey = rel.getOtherKey(this);\n\t\t\totherKey.getRelations().remove(rel);\n\t\t}\n\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
setActivityLog1 =getting all the returns and orders of the member
public Msg setActivityLog1(Msg msg, Connection con) { Statement stmt; int returns=0,orders=0; try { Member member=(Member) msg.dataToServer.get(0); String newQuery="select returns.issueDate,returns.returnDate,returns.actualReturnDate,books.bookname,returns.statusReturn FROM returns INNER JOIN books on returns.idbook = books.idbook where returns.MemberID='"+member.getMemberID() +"';"; stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery(newQuery); ResultSetMetaData rsmd = (ResultSetMetaData) rs.getMetaData(); msg.result=false; while(rs.next()) { msg.result=true; Object obj = createObject_ReturnsForActivityLog(rs); returns++; System.out.println(obj.toString()); msg.dataFromServer.add(obj); } if(!(msg.result)) { Return nullReturn =new Return(); msg.dataFromServer.add(nullReturn); } newQuery="select orders.memberID,orders.idbook,orders.positionInLine,books.bookname FROM orders INNER JOIN books on orders.idbook = books.idbook where orders.MemberID='"+member.getMemberID() +"';"; stmt = conn.createStatement(); rs = stmt.executeQuery(newQuery); rsmd = (ResultSetMetaData) rs.getMetaData(); msg.result=false; while(rs.next()) { msg.result=true; Object obj = createObject_ordersForActivityLog(rs); orders++; System.out.println(obj.toString()); msg.dataFromServer.add(obj); } if(!(msg.result)) { orders nullorders=new orders(); msg.dataFromServer.add(nullorders); } rs.close(); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } msg.dataFromServer.add(returns); msg.dataFromServer.add(orders); return msg; }
[ "public void setUserLogs() {\n ResultSet rs = Business.getInstance().getData().getCaseLog();\n try{\n while (rs.next()) {\n userLog.add(new UserLog(rs.getInt(\"userID\"),\n rs.getInt(2),\n rs.getString(\"date\"),\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds a given angle to the current angle
public void addAngle(double angle) { this.angle += angle; int rotations = (int) (this.angle / (2 * Math.PI)); this.angle -= 2 * Math.PI * rotations; }
[ "public Angle add(Angle angleToAdd)\n {\n\treturn new Angle(this.getValue() + angleToAdd.getValue());\n }", "public void incrementAngle() {\n\t\tif (angle < 360) {\n\t\t\tangle += increment;\n\t\t} else {\n\t\t\tangle = 0;\n\t\t}\n\t}", "public void setAngle(double angle);", "void setAngle(double angle)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the result of interpreting the object as an instance of 'Additive Operation Call Exp CS'. This implementation returns null; returning a nonnull result will terminate the switch.
public T caseAdditiveOperationCallExpCS(AdditiveOperationCallExpCS object) { return null; }
[ "public T caseOperationCallBinaryExpCS(OperationCallBinaryExpCS object) {\r\n return null;\r\n }", "public T caseUnaryOperationCallExpCS(UnaryOperationCallExpCS object) {\r\n return null;\r\n }", "public T caseOperationCallExpCS(OperationCallExpCS object) {\r\n return null;\r\n }", "public T caseL...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Finds the scheduled task with the specified id.
PSScheduledTask findScheduledTaskById(IPSGuid id) throws PSSchedulingException;
[ "Task findTask(String id);", "Task getTask(String id);", "public void getTask(String id);", "PSScheduledTaskLog findTaskLogById(IPSGuid id);", "public static TaskDefinition getTaskInVector (String id){\r\n\t\tfor (int i = 0 ; i < TasksList.size() ; i++){\r\n\t\t\tif (TasksList.get(i).getId().equals(id)){\r\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the base address for the given target address to be as indicated.
public void setBaseAddress(int targetAddress, int baseAddress);
[ "public void setBase(LocatorIF base_address) {\n this.base_address = base_address;\n }", "public void setBaseAddress(String baseAddress) {\n\t\tthis.baseAddress = baseAddress;\n\t}", "public void setBaseAddress(String base_address) {\n try {\n this.base_address = new URILocator(base_address);\n }...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns all the fase postulacions.
public static java.util.List<com.hitss.layer.model.FasePostulacion> findAll() throws com.liferay.portal.kernel.exception.SystemException { return getPersistence().findAll(); }
[ "public double[][] getFEPosteriors(SentencePair sp) {\n double[][] posts = sp.getKeyedAlignment(posteriorKeyPrefix+\".fe\").getForeignByEnglishPosteriors();\n return posts;\n }", "public double[][] getEFPosteriors(SentencePair sp) {\n double[][] posts = sp.getKeyedAlignment(posteriorKeyPrefix+\".ef\").g...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method was generated by MyBatis Generator. This method returns the value of the database column house_order.pay_time
public Date getPayTime() { return payTime; }
[ "public Long getPayTime() {\n return payTime;\n }", "public Time getTimeToPay() {\n return timeToPay;\n }", "public Date getPayTime() {\n return payTime;\n }", "public Date getUserpayTime() {\n return userpayTime;\n }", "public Date getPaymentTime() {\r\n retur...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The display name of the step.
public String getStepDisplayName() { return this.stepDisplayName; }
[ "public String getStepDisplayName()\r\n\t{\r\n\t\treturn stepDisplayName;\r\n\t}", "String getCurrentStepName();", "public String stepName() {\n return this.stepName;\n }", "public String getStepName()\r\n\t{\r\n\t\treturn stepName;\r\n\t}", "public String getStepName() {\n return this.step...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
overriding the echo method of the RmiInterface Method gets the input from the user and sends the response back
@Override public String echo(Session session, String input) throws RemoteException { System.out.println("Echo Method called"); System.out.println("Response sent to the client is: "+input); return input; }
[ "public String recieveInput() {\n\t\ttry {\n\t\t\treturn socketIn.readLine().replace('_', '\\n');\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tSystem.exit(1);\n\t\treturn \"error!\";\n\t}", "private String getResponse(String input) {\n try {\n CommandResult result = log...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Displays a dialog asking the user to input the pin number.
private void showDialogPin() { final ArrayList<AccountDetails> accountDetails = tinyDB.getListObject(getString(R.string.pref_wallet_accounts), AccountDetails.class); pinDialog = new Dialog(this); pinDialog.setTitle(R.string.txt_6_digits_pin); pinDialog.setContentView(R.layout.activity_alert_pin_dialog); Button btnDone = (Button) pinDialog.findViewById(R.id.btnDone); final EditText etPin = (EditText) pinDialog.findViewById(R.id.etPin); btnDone.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { for (int i = 0; i < accountDetails.size(); i++) { if (accountDetails.get(i).isSelected) { if (etPin.getText().toString().equals(accountDetails.get(i).pinCode)) { Log.d(TAG, "pin code matches"); pinDialog.cancel(); if(mLockListener != null){ mLockListener.onLockReleased(); } break; }else{ Toast.makeText(LockableActivity.this, getResources().getString(R.string.invalid_pin), Toast.LENGTH_SHORT).show(); } } } } }); pinDialog.setCancelable(false); /* No pin dialog in Blockpay for now */ // pinDialog.show(); }
[ "protected void dialog() {\n TextInputDialog textInput = new TextInputDialog(\"\");\n textInput.setTitle(\"Text Input Dialog\");\n textInput.getDialogPane().setContentText(\"Nyt bord nr: \");\n textInput.showAndWait()\n .ifPresent(response -> {\n if (!re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The method will search a given List, listToSearch, sequentially. It will search for the numberToFind, and return true, if it is present. If it is not found, it will return false.
@Override public boolean search(List<Integer> listToSearch, int numberToFind) throws NullPointerException { // Check to see if listToSearch is null or is empty // Will throw an appropriate exception if (listToSearch == null) throw new NullPointerException("listToSearch is null"); else if(listToSearch.contains(null)) throw new NullPointerException("listToSearch contains a null element"); else if (listToSearch.isEmpty()) throw new IllegalArgumentException("listToSearch has no entries in it"); // If the list has only one element // Return if the first element of listToSearch is the same as the // numberToFind if (listToSearch.size() == 1) { return listToSearch.get(0).equals(numberToFind); } // Loop through the listToSearch sequentially for (int entry : listToSearch) { // If the entry is equal to the numberToFind if (entry == numberToFind) { return true; } } return false; }
[ "public abstract boolean searchNumber(int[] numbers, int numberToSearch);", "public boolean foundIntTwice(List<Integer> integerList, int intToFind) {\n\t\tint count = 0;\n\t\tfor (Integer element : integerList) {\n\t\t\tif(element == intToFind) {\n\t\t\t\tcount++;\n\t\t\t\tif (count >=2) {\n\t\t\t\t\treturn true;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Getter method for the treasureClass of the Monster object
public String getTreasureClass() { return this.treasureClass; }
[ "public Treasure getTreasure()\n {\n return m_treasure;\n }", "public Long getsClass() {\n return sClass;\n }", "public Entity getTreasure() {\n return treasure;\n }", "public static Mood getMood() { return moodClass; }", "private final ClassType getVillageMasterTeachType()\n\t{\n\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constructs a new From test case with the given name.
public FromTest(String name) { super(name); }
[ "public ForTest(String name) {\r\n\t\tsuper(name);\r\n\t}", "public GenModelTest(String name) {\n\t\tsuper(name);\n\t}", "public QueryImportTest ( String name )\n {\n super ( name );\n }", "public AxiomTest(String name) {\n\t\tsuper(name);\n\t}", "public ProinsoObjectTest(String name) {\r\n\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a SURF descriptor. SURF descriptors are invariant to illumination, orientation, and scale. BoofCV provides two variants. Creates a variant which is designed for stability. Different descriptors are created for color and grayscale images. [1] Add tech report when its finished. See SURF performance web page for now.
public static <T extends ImageSingleBand, II extends ImageSingleBand> DetectDescribePoint<T,SurfFeature> surfStable( ConfigFastHessian configDetector, ConfigSurfDescribe.Stablility configDescribe, ConfigSlidingIntegral configOrientation, Class<T> imageType ) { Class<II> integralType = GIntegralImageOps.getIntegralType(imageType); FastHessianFeatureDetector<II> detector = FactoryInterestPointAlgs.fastHessian(configDetector); DescribePointSurfMod<II> describe = FactoryDescribePointAlgs.surfStability(configDescribe, integralType); OrientationIntegral<II> orientation = FactoryOrientationAlgs.sliding_ii(configOrientation, integralType); return new WrapDetectDescribeSurf( detector, orientation, describe ); }
[ "public static void easy( ImageFloat32 image ) {\n\t\t// create the detector and descriptors\n\t\tInterestPointDetector<ImageFloat32> detector = FactoryInterestPoint.fastHessian(0, 2, 200, 2, 9, 4, 4);\n\t\t// BoofCV has two SURF implementations.\n\t\t// surfm() = slower, but more accurate. surf() = faster and les...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Instantiates a new plant UML class diagram analyzer and mapper.
public ClassAnalyzer(PlantUMLClassDiagramConfig paramPlantUMLConfig) { plantUMLConfig = paramPlantUMLConfig; }
[ "private SCTuiTuSettlePlant() {}", "private CSTuiTuSettlePlant() {}", "private CSSettlePlant() {}", "ClassDiagram createClassDiagram();", "private PBPlantInfo() {}", "private PBHotelPlant() {}", "public PlantillaController() {\n }", "private CSQuickBornPlant() {}", "private Mapper() {\n\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets a menu with the given name from the menu bar. Returns null if menu item does not exist.
public JMenu getMenuItem(String menuName) { menuName = menuName.trim(); JMenu menu = null; for(int i = 0; i<menuBar.getMenuCount(); i++) { JMenu next = menuBar.getMenu(i); if(next.getText().equals(menuName)) { menu = next; break; } } return menu; }
[ "public MenuItem getMenuItem(String name) {\n return menuItems.stream().filter(i -> i.getName().equalsIgnoreCase(name)).findFirst().orElse(null);\n }", "public MenuItem getMenuItemByName(String name){\n for (MenuItem item: menuItems){\n if (item.getFoodName().equals(name)){\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Highlight the set of planets by drawing them into the given GC as specified by the Universe.
void drawHighlight(Graphics gc, Universe u, PlanetSet set) { PlanetIter Pptr; // Draw each existing planet. for (Pptr = set.first(); !Pptr.isPastEnd(); Pptr.advance()) { Planet p = Pptr.element(); highlightPlanet(gc,p,u); } }
[ "void draw(Graphics gc, Universe u) {\n\tPlanetIter Pptr;\n\n\t// Draw each existing planet.\n\tfor (Pptr = _planets.first(); !Pptr.isPastEnd(); Pptr.advance()) {\n\n\t Planet p = Pptr.element();\n\n\t // Set the color of planet and draw it\n\t gc.setColor(p.color);\n\t drawPlanet(gc,p,u);\n\t}\n }",...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the left processed value for the specific data source and consumer.
protected final Object getProcessedLeftValue(Object currentResultSetElement, Queryable.DataSource dataSource, Queryable.Consumer consumer) { Object result; if(getLeftValue() instanceof QueryParameter) { result = getProcessedValue(currentResultSetElement, getLeftValue(), dataSource, consumer); } else { Map<Evaluator, Object> cache = getLeftCache(); if(cache != null) { result = cache.get(this); if (result == null) { result = getProcessedValue(currentResultSetElement, getLeftValue(), dataSource, consumer); cache.put(this, result); } } else { result = getProcessedValue(currentResultSetElement, getLeftValue(), dataSource, consumer); } } return result; }
[ "public int getLeftmostData( )\r\n {\r\n if (left == null)\r\n return data;\r\n else\r\n return left.getLeftmostData( );\r\n }", "public Data getLeftData() {\n\t\treturn data[LEFT];\n\t}", "public Counter getLeft() {\n \n if(this.left == null)\n {\n ret...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
optional string buseo_name2 = 11;
public Builder setBuseoName2( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000400; buseoName2_ = value; onChanged(); return this; }
[ "java.lang.String getBuseoName1();", "java.lang.String getBuseoName2();", "java.lang.String getBuseoName();", "public Builder setBuseoName1(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000100;\n buseoName1_ = value;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The customers belonging to a reseller or distributor. repeated .google.cloud.channel.v1.Customer customers = 1;
java.util.List<com.google.cloud.channel.v1.Customer> getCustomersList();
[ "com.google.cloud.channel.v1.Customer getCustomers(int index);", "com.google.ads.googleads.v6.resources.Customer getCustomer();", "com.google.ads.googleads.v1.resources.Customer getCustomer();", "public String getCustomersName()\r\n {\r\n return customersName;\r\n }", "public String getCustomer...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Since we mapped the IDefault provider to the PropertyFileConfigurationService we should get that instance back.
@Test public void testIDefaultProviderIsConfigurationService() { IDefaultProvider defaultProvider = injector .getInstance(IDefaultProvider.class); assert defaultProvider instanceof PropertyFileConfigurationService; // Further validation that the Configuration Service Implementation is a // singleton. IConfigurationService secondConfigService = injector .getInstance(IConfigurationService.class); assert defaultProvider == secondConfigService; }
[ "protected ConfigurationService getConfigurationService() {\r\n\t\treturn configurationService;\r\n\t}", "protected Configuration loadProperties() {\n return ConfigFactory.createConfig();\n }", "public IUserInterfaceSettingsProvider getSettingsProvider()\n {\n return this.settingsProvider;\n }...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
configFwdLimitSwitchNormallyOpen This method configures the reverse limit switch to be normally open (i.e. active when close).
public void configRevLimitSwitchNormallyOpen(boolean normalOpen) { final String funcName = "configRevLimitSwitchNormallyOpen"; if (debugEnabled) { dbgTrace.traceEnter(funcName, TrcDbgTrace.TraceLevel.API, "normalOpen=%s", normalOpen); dbgTrace.traceExit(funcName, TrcDbgTrace.TraceLevel.API); } revLimitSwitch = motor.getReverseLimitSwitch( normalOpen ? LimitSwitchPolarity.kNormallyOpen : LimitSwitchPolarity.kNormallyClosed); }
[ "public void configFwdLimitSwitchNormallyOpen(boolean normalOpen)\n {\n final String funcName = \"configFwdLimitSwitchNormallyOpen\";\n\n if (debugEnabled)\n {\n dbgTrace.traceEnter(funcName, TrcDbgTrace.TraceLevel.API, \"normalOpen=%s\", normalOpen);\n dbgTrace.traceEx...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Use OpenFileResponse.newBuilder() to construct.
private OpenFileResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); }
[ "private RetrieveFileResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "private OpenFileRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "private CreateFileResponse() {\n initFields();\n }", "privat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the task diagnostics for a given attempt id
String[] getTaskDiagnostics( Object taskAttemptId ) throws IOException;
[ "String getTaskLog (int queryId, int taskId, int offset, int len) throws IOException;", "long getTraceTaskId();", "public String getErrorDataCollectorId();", "private void listApplicationAttempts(String applicationId) throws YarnException,\n IOException {\n PrintWriter writer = new PrintWriter(\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Convert a string into regex
public static String toRegex(String str) { str = str.replace("[", "\\[").replace("]", "\\]").replace("(", "\\(").replace(")", "\\)").replace(".", "\\.") .replace("*", "\\*").replace(" ", "\\s*").replace("_", "\\_"); /* * Add bound of word at the beginning */ if (str.toCharArray()[0] >= 'A' && str.toCharArray()[0] <= 'Z' || str.toCharArray()[0] >= 'a' && str.toCharArray()[0] <= 'z') { str = "\\b" + str; } /* * Add bound of word at the end */ int last = str.toCharArray().length - 1; if (str.toCharArray()[last] >= 'A' && str.toCharArray()[last] <= 'Z' || str.toCharArray()[last] >= 'a' && str.toCharArray()[last] <= 'z') { str += "\\b"; } return str; }
[ "java.lang.String getRegex();", "public Pattern regexPattern(String regex) {\n return Pattern.compile(regex);\n }", "private static String createRegex(String s) {\n\t\tStringBuilder b = new StringBuilder();\n\t\tfor(int i=0; i<s.length(); ++i) {\n\t\t\tchar ch = s.charAt(i);\n\t\t\tif (\"\\\\.^$|?*+...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the points to display the given text as an animation.
public Point[] getPoints(String text) { FAName fn = getFAName(text); if (fn != null) { return fn.points; } ArrayList<Point> points = new ArrayList<Point>(); int x = 0; for (int i=0; i<text.length(); i++) { FALetter fl = getLetter(text.charAt(i)); for (int j=0; j<fl.points.length; j++) { Point p = fl.points[j]; points.add(new Point(p.x + x, p.y)); } x += fl.advance; } return points.toArray(new Point[0]); }
[ "List<NavigationPoint> getNavigationPoints(String sourceText);", "public static List<TimePoint> extractTimePoints(String text) {\n\t\tfinal List<TimePoint> timePoints = new ArrayList<TimePoint>();\n\t\t\n\t\tfinal Matcher matcher = RE_YOUTUBE_DEEPLINK.matcher(text);\n\t\t\n\t\twhile (matcher.find()) {\n\t\t\tTime...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds instances to the instance lookup.
private void addInstances (Object... instances) { for (int i = 0; i < instances.length; i++) { ic.add(instances[i]); } }
[ "private void addToClassPool(List<Class> classes) {\n classes.stream()\n .filter(c -> c.getAnnotation(Provided.class) != null)\n .forEach(c -> classPool.put(c, new Instance()));\n\n classPool.keySet().forEach(this::resolveInstance);\n }", "public Lookup createInstanc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
process an end of execution notification for a request r previously submitted. Contract prer != null posttrue// no postcondition.
@Override public void acceptRequestTerminationNotification(RequestI r) throws Exception { assert r != null ; if (RequestGenerator.DEBUG_LEVEL == 2) { this.logMessage("Request generator " + this.rgURI + " is notified that request "+ r.getRequestURI() + " has ended.") ; } }
[ "public boolean postExecute() throws Exception{\n if (!commitResponsePhase.getAndSet(true)){\n processorTask.postResponse();\n processorTask.postProcess();\n processorTask.terminateProcess();\n\n // De-reference so under stress we don't have a simili leak.\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if all the component of a CartesianQuantity are greater or equal than the given value.
public boolean isCartesianQuantityGreaterEqualThan(iiwa_msgs.CartesianQuantity quantity, int value) { return (quantity.getX() >= value && quantity.getY() >= value && quantity.getZ() >= value && quantity.getA() >= value && quantity.getB() >= value && quantity.getC() >= value); }
[ "public boolean isCartesianQuantityGreaterThan(iiwa_msgs.CartesianQuantity quantity, int value) {\n return (quantity.getX() > value && quantity.getY() > value && quantity.getZ() > value && quantity.getA() > value && quantity.getB() > value && quantity.getC() > value);\n }", "public boolean isJointQuantityGrea...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Are subselects supported as the lefthandside (LHS) of INpredicates. In other words, is syntax like "... IN (1, 2, 3) ..." supported?
public boolean supportsSubselectAsInPredicateLHS();
[ "Expr getExpr_in();", "Subquery some();", "private AbstractExpression optimizeInExpressions(AbstractExpression expr) {\n ExpressionType exprType = expr.getExpressionType();\n if (ExpressionType.CONJUNCTION_AND == exprType || ExpressionType.CONJUNCTION_OR == exprType) {\n AbstractExpress...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Use Availability.newBuilder() to construct.
private Availability(Builder builder) { super(builder); }
[ "Builder addAvailability(String value);", "private ItemAvailability(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "Builder addAvailability(ItemAvailability value);", "public void setAvailability(java.lang.String availability) {\r\n this.availability = avai...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the format to use for formatting a thread id element.
protected static final Format getThreadIdFormat () { return new FixLengthFormat( THREADID_LENGTH, FixLengthFormat.LEFT_PADDING); }
[ "public static String stringRepresentationOfThreadID(long threadID){\n return String.format(\"%08X\", threadID);\n }", "short getFormatId();", "protected static final Format getThreadNameFormat ()\r\n {\r\n return new FixLengthFormat(\r\n CATEGORY_LENGTH, FixLengthFormat.LEFT_CUT_RI...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the values of each attribute as an array of doubles.
public double[] toDoubleArray() { double[] newValues = new double[m_AttValues.length]; System.arraycopy(m_AttValues, 0, newValues, 0, m_AttValues.length); return newValues; }
[ "public double[] getAttrDoubleArray(String name)\n{\n\treturn (double[])getAttr(name);\n}", "public double[] getDoubles()\r\n {\r\n return resultDoubles;\r\n }", "public double[] getAsDoubles() {\n return (double[])data;\n }", "public double [] getAttributes(){\n return attributes;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Logger for SAML messages and events
@Bean public SAMLDefaultLogger samlLogger() { return new SAMLDefaultLogger(); }
[ "protected void logSuccess() {\n String nameToLog = null;\n if (loggedAttributeId != null && attributeContext != null) {\n final IdPAttribute attrToLog = attributeContext.getIdPAttributes().get(loggedAttributeId);\n if (attrToLog != null && !attrToLog.getValues().isEmpty()) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Starts a new sale. This method must be called before any action is registered in the sale.
public void startSale() { sale = new Sale(); }
[ "public void startNewSale() {\n sale = new Sale(cashRegister);\n }", "public void startSale()\n {\n if(!currentSale.getSaleState())\n {\n currentSale = null;\n currentSale.startSale();\n }\n }", "public void beginSale() {\r\n\t\tif (!activeSale) {\r\n\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets ith "measurement" element
public noNamespace.HostdashletDocument.Hostdashlet.Host.Charts.Chart.Nic.Series.Measurement getMeasurementArray(int i) { synchronized (monitor()) { check_orphaned(); noNamespace.HostdashletDocument.Hostdashlet.Host.Charts.Chart.Nic.Series.Measurement target = null; target = (noNamespace.HostdashletDocument.Hostdashlet.Host.Charts.Chart.Nic.Series.Measurement)get_store().find_element_user(MEASUREMENT$0, i); if (target == null) { throw new IndexOutOfBoundsException(); } return target; } }
[ "public noNamespace.HostdashletDocument.Hostdashlet.Host.Charts.Chart.Disks.Series.Measurement getMeasurementArray(int i)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
set bind view id
public void setBindViewId(int id) { mBindViewId = id; }
[ "public void setBindViewId(int id){\n mBindViewId = id;\n }", "void showBindViewId(int id) {\n bindId.setText(id + \"\");\n }", "public int getBindViewId() {\n return mBindViewId;\n }", "public void setViewId(String viewId) {\n \n this.viewId = viewId;\n \n }", "pub...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method was generated by MyBatis Generator. This method returns the value of the database column CTSCARDS_MGT_HST.DATE_ACTIVATED
public Date getDATE_ACTIVATED() { return DATE_ACTIVATED; }
[ "public Date getDATE_ACTIVATED_INIT() {\r\n return DATE_ACTIVATED_INIT;\r\n }", "public void setDATE_ACTIVATED(Date DATE_ACTIVATED) {\r\n this.DATE_ACTIVATED = DATE_ACTIVATED;\r\n }", "public Date getActivateDate() {\r\n return activateDate;\r\n }", "@gw.internal.gosu.parser.Exte...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Exports all projects into separate xml files and adds them to a zip archive.
public String exportAllProjectsToZip(){ List<PlanProperties> ppList = em.createQuery("select p from PlanProperties p").getResultList(); if (!ppList.isEmpty()){ log.debug("number of plans to export: "+ppList.size()); String filename = "allprojects.zip"; String exportPath = OS.getTmpPath() + "export" + System.currentTimeMillis()+"/"; new File(exportPath).mkdirs(); String binarydataTempPath = exportPath + "binarydata/"; File binarydataTempDir = new File(binarydataTempPath); binarydataTempDir.mkdirs(); try { OutputStream out = new BufferedOutputStream(new FileOutputStream(exportPath + filename)); ZipOutputStream zipOut = new ZipOutputStream(out); for (PlanProperties pp: ppList) { log.debug("EXPORTING: " + pp.getName()); ZipEntry zipAdd = new ZipEntry(String.format("%1$03d", pp.getId())+"-"+ FileUtils.makeFilename(pp.getName())+".xml"); zipOut.putNextEntry(zipAdd); // export the complete project, including binary data exportComplete(pp.getId(), zipOut, binarydataTempPath); zipOut.closeEntry(); } zipOut.close(); out.close(); new File(exportPath + "finished.info").createNewFile(); FacesMessages.instance().add(FacesMessage.SEVERITY_INFO, "Export was written to: " + exportPath); log.info("Export was written to: " + exportPath); } catch (IOException e) { FacesMessages.instance().add(FacesMessage.SEVERITY_ERROR, "An error occured while generating the export file."); log.error("An error occured while generating the export file.", e); File errorInfo = new File(exportPath + "error.info"); try { Writer w = new FileWriter(errorInfo); w.write("An error occured while generating the export file:"); w.write(e.getMessage()); w.close(); } catch (IOException e1) { log.error("Could not write error file."); } } finally { // remove all binary temp files OS.deleteDirectory(binarydataTempDir); } } else { FacesMessages.instance().add("No Projects found!"); } return null; }
[ "ProjectSourceZip exportAllProjectsSourceZip(String userId, String zipName) throws IOException;", "ProjectSourceZip exportSelectedProjectsSourceZip(String userId, String zipName, List<Long> projectIds) throws IOException;", "public void actionExportToZip() {\n FileChooser fileChooser = new FileChooser();...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if this e s f tournament is is single match.
@Override public boolean isIsSingleMatch() { return _esfTournament.isIsSingleMatch(); }
[ "@Override\n\tpublic boolean getIsSingleMatch() {\n\t\treturn _esfTournament.getIsSingleMatch();\n\t}", "@Override\n\tpublic boolean isIsTeamMatch() {\n\t\treturn _esfTournament.isIsTeamMatch();\n\t}", "@Override\n\tpublic boolean isIsIndividualMatch() {\n\t\treturn _esfTournament.isIsIndividualMatch();\n\t}", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Instantiates a new admin service impl using DaoImpl Singleton
public AdminServiceImpl() { userDao = DaoImpl.getDaoImpl(); employeeDao = DaoImpl.getDaoImpl(); }
[ "public AdminImpl() {}", "IAdminService getAdminService();", "public AdminService() {\n }", "public AdministratorDAO() {\n super();\n DAOClassType = Administrator.class;\n }", "public static AdminDAOOperation getInstance(){\n\t\t\n\t\tif(instance == null){\n\t\t\tsynchronized(AdminDAOOpe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ QueryInfo Filter Column Operator Operand Column is OB column Operator is > >= <= = like Operand is Value
@Test public void test_query_04_81_where_LessEqual_ColumnValue_IntType() { Result<List<RowData>> result; QueryInfo queryInfo = new QueryInfo(); RKey start_rowkey = new RKey(new CollectInfoKeyRule(2, (byte) '0', 1)); RKey end_rowkey = new RKey(new CollectInfoKeyRule(2, (byte) '0', 7)); prepare_ob_data();//prepare date // prepare QueryInfo prepareInfo(queryInfo, start_rowkey, end_rowkey); addColumns(queryInfo); Value val=new Value(); val.setNumber(lOwnerId[0]); ObSimpleCond obSimpleCond = new ObSimpleCond("gm_create", ObSimpleCond.ObLogicOperator.LE,val); ObSimpleFilter filter = new ObSimpleFilter(); filter.addCondition(obSimpleCond); queryInfo.setFilter(filter); // query operate result = obClient.query(collectInfoTable.getTableName(), queryInfo); Assert.assertEquals(ResultCode.OB_INVALID_ARGUMENT, result.getCode()); Assert.assertEquals(0, result.getResult().size()); }
[ "@Test\n\t\tpublic void test_query_04_76_where_LessEqual_ColumnValue_IntType()\n\t\t{\n\t\t\tResult<List<RowData>> result;\n\t\t QueryInfo queryInfo = new QueryInfo();\n\t\t RKey start_rowkey = new RKey(new CollectInfoKeyRule(2, (byte) '0', 1));\n\t\t RKey end_rowkey = new RKey(new CollectInfoKeyRule(2, (b...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true iff the argument indicates the same algorithm with the same parameters.
public boolean equals(AlgorithmId other) { boolean paramsEqual = (params == null ? other.params == null : params.equals(other.params)); return (algid.equals(other.algid) && paramsEqual); }
[ "public boolean isMultipleAlgorithms() {\n return inputMap.size() > 1;\n }", "public boolean isEquals() {\n long len = -1L;\n\n //1. check the lengths of the words\n for(S left : slp.getAxioms()) {\n if(len == -1L) {\n len = slp.length(left);\n }...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Parse out type in schema json and convert to field name and type pairs for CREATE TABLE statement.
private String parseColumnNameAndTypesInSchemaJson(String schema) { JSONObject json = (JSONObject) new JSONObject(schema).query("/mappings/properties"); return json.keySet().stream(). map(colName -> colName + " " + mapToJDBCType(json.getJSONObject(colName).getString("type"))) .collect(joining(",")); }
[ "SchemaType createSchemaType();", "public TypeData getTypeData(MigrationType type);", "static public org.apache.spark.sql.avro.SchemaConverters.SchemaType toSqlType (org.apache.avro.Schema avroSchema) { throw new RuntimeException(); }", "public String createHiveSchema(String json) throws JSONException {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "entryRuleCompVarDefination" $ANTLR start "ruleCompVarDefination" InternalDsl.g:2213:1: ruleCompVarDefination : ( ( rule__CompVarDefination__Group__0 ) ) ;
public final void ruleCompVarDefination() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalDsl.g:2217:2: ( ( ( rule__CompVarDefination__Group__0 ) ) ) // InternalDsl.g:2218:2: ( ( rule__CompVarDefination__Group__0 ) ) { // InternalDsl.g:2218:2: ( ( rule__CompVarDefination__Group__0 ) ) // InternalDsl.g:2219:3: ( rule__CompVarDefination__Group__0 ) { if ( state.backtracking==0 ) { before(grammarAccess.getCompVarDefinationAccess().getGroup()); } // InternalDsl.g:2220:3: ( rule__CompVarDefination__Group__0 ) // InternalDsl.g:2220:4: rule__CompVarDefination__Group__0 { pushFollow(FOLLOW_2); rule__CompVarDefination__Group__0(); state._fsp--; if (state.failed) return ; } if ( state.backtracking==0 ) { after(grammarAccess.getCompVarDefinationAccess().getGroup()); } } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; }
[ "public final void entryRuleCompVarDefination() throws RecognitionException {\n try {\n // InternalDsl.g:2205:1: ( ruleCompVarDefination EOF )\n // InternalDsl.g:2206:1: ruleCompVarDefination EOF\n {\n if ( state.backtracking==0 ) {\n before(grammarAc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Executes a query based on the given filter and returns the index of the only one result returned by the query. The query must return exectly one element, otherwise this method throws a RuntimeException.
public long querySingletonKey(Filter filter) { return entityDB.querySingletonKey(filter); }
[ "public long queryFirstKey(Filter filter) {\n\t\treturn entityDB.queryFirstKey(filter);\n\t}", "public Entity queryFirst(Filter filter) {\n\t\treturn entityDB.queryFirst(filter);\n\t}", "IQuery<R> first(int i);", "public int getFilteredIndex()\n\t{\n\t\treturn this.filteredIndex;\n\t}", "public E queryFirst...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests the creation of a DefaultFlowTable using an AppId constructor.
@Test public void testCreationWithAppId() { final FlowTable rule = DefaultFlowTable.builder() .forDevice(did("1")) .forTable(1) .withFlowTable(ofFlowTable((byte) 1)) .withCookie((long) 1) .fromApp(APP_ID) .build(); assertThat(rule.deviceId(), is(did("1"))); }
[ "@Test\n public void testCreationFromFlowTable() {\n assertThat(defaultFlowTable1.deviceId(), is(flowTable1.deviceId()));\n assertThat(defaultFlowTable1.appId(), is(flowTable1.appId()));\n assertThat(defaultFlowTable1.id(), is(flowTable1.id()));\n\n }", "@Test\n public void testCreat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }