anchor
stringlengths
10
14.3k
positive
stringlengths
10
14.9k
public JournalEntryLine(String alias) { this(DSL.name(alias), JOURNAL_ENTRY_LINE); }
Create an aliased JOURNAL_ENTRY_LINE table reference
String getIdNode2();
Returns the value of the 'Id Node2' attribute. If the meaning of the 'Id Node2' attribute isn't clear, there really should be more of a description here...
@Override public boolean dispatchTouchEvent(MotionEvent event) { Log.i(TAG, "MyLinearLayout() dispatchTouchEvent event = " + event.getAction()); return super.dispatchTouchEvent(event); }
TODO Autogenerated method stub
@Bean public StandardServletMultipartResolver multipartResolver() { return new StandardServletMultipartResolver(); }
TODO switch to commons multipart
@Test public void bitfieldOperations() throws Exception { assumeThat(getEnv().serverVersion[0], is(greaterThanOrEqualTo(3))); awaitIndefinitely(commandClient.del(key("bf"))); List<Long> results = awaitIndefinitely(commandClient.bitfield(key("bf"), asList(new Incrby(I05, 100L, 1L), new Get(...
Disable these tests for Redis 2 and below
public void act() { if(Greenfoot.mouseClicked(this)){ storeMenu.getLastPressed(this,item,cost); changeImage(); } }
Act do whatever the StoreItem wants to do. This method is called whenever the 'Act' or 'Run' button gets pressed in the environment.
@java.lang.Override public java.util.List<com.google.protobuf.ByteString> getCertificateList() { return certificate_; }
DERencoded X.509 certificate chain repeated bytes certificate = 1;
@Override public void createShoeFromFile(String fileName) { File file = new File(fileName); Scanner myReader = null; try { myReader = new Scanner(file); } catch (FileNotFoundException e) { e.printStackTrace(); } while (myReader.hasNextLine())...
Creates the shoe from file
boolean hasUnReceived();
required .cn.mxz.protocols.user.PropsPro unReceived = 1112331;
String attack();
gives a character object ability (behavior) to attack with a weapon and deal damage to opponent's health
@Override public Fragment getItem(int position) { switch (position) { case 0: FragmentAboutUs aboutFragment = new FragmentAboutUs(); return aboutFragment; case 1: FragmentContactUs contactUsFragment = new FragmentContactUs(); ...
this is for fragment tabs
public void getCosts() { }
beginusercode TODO Autogenerated method stub endusercode
public PaxosExecution(PaxosInstance a_instance, String a_initiator, Vector a_roundLeaders) { this.m_initiator = a_initiator; this.m_paxosInstance = a_instance; m_roundLeaders = a_roundLeaders; createRound(); }
Creates a new PaxosExecution within the given PaxosInstance for the given initiator. A PaxosRound with round number 0 is also created and its timeout is started
@Before public void setUp() { player1 = new Player("Test", 5, "@"); player2 = new Player("Opponent", 2, "#"); ArrayList<Player> players = new ArrayList<>(); players.add(player1); players.add(player2); model = new Model(players, 2); player1.setWorkers(GodName.H...
sets the game with 2 players and their workers, creates instance of model then set the current player
private Tuple<PatternCoordinates, Mat> pair(){ mCamera.takePicture(null, null, jpegCallBack); Tuple<PatternCoordinates, Mat> patternAndImagePair = null; switch(GlobalResources.getInstance().getImageSettings().getBackgroundMode()){ case ImageSettings.BACKGROUND_MODE_RGB: ...
Take a picture with the camera, this also handles the Mat objects
public StructuredQName getVariableQName();
Get the name of the variable
public CallableStatement execute(String query) throws RtpException { /* Create a Callable statement. */ CallableStatement stmt = Connector.createCallableStatement(conn, query); /* Execute the statement */ if (stmt != null) { try { boolean check = stmt.execut...
Executes a SELECT statement. By default this method will print the output to the console as a CSV. The output manager can be set explicitly by using the setOutputManager method. If the query is successful a CallableStatement is returned. Otherwise null is returned.
public double notional ( final int iDate1, final int iDate2) throws java.lang.Exception { org.drip.analytics.cashflow.CompositePeriod cp = containingPeriod (iDate1); if (null == cp || !cp.contains (iDate2)) throw new java.lang.Exception ("Stream::notional => Invalid Inputs"); org.drip.quant.common.Arr...
Retrieve the Notional aggregated over the Date Pairs
public E getElement(int position){ // Position is larger than the current size. if(checkPosition(position)){ return null; } return getDoubleNodeAt(position).element; }
Returns the Element at the position in the DoubleNodeList.
public synchronized final void setQueued(boolean qd) { setFlag(RequestQueued, qd); }
Set/clear the request queued flag
public static String toStringFormat_2(Date date) { return dateToString(date, DATE_FORMAT_2); }
toString for format 2
public String getViptype() { return viptype; }
This method was generated by MyBatis Generator. This method returns the value of the database column t_mp_num.vipType
private HowMe(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); }
Use HowMe.newBuilder() to construct.
private void markOnline(boolean b) { usersRef.child(userMe.getId()).child("online").setValue(b); }
Mark online boolean as b in firebase
@Override public void onClick(View v) { RegisterActivity.this.finish(); }
TODO Autogenerated method stub
public void ClickLogout(View view ){ logout(); intent = new Intent(context,LoginActivity.class); //remove all previous stack activities intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(intent); finish(); }
Close app Redirect back to login page
private static int parseTotalAttempts(String score) throws NumberFormatException { String[] splitString = score.split("/"); if (splitString.length != 2) { throw new NumberFormatException("Score is not formatted correctly."); } return Integer.parseInt(splitString[1]); }
Returns number of total attempts as integer from score string.
public boolean isSetLegID() { return EncodingUtils.testBit(__isset_bitfield, __LEGID_ISSET_ID); }
Returns true if field legID is set (has been assigned a value) and false otherwise
public static void updateTpsLatHistory(final int envId, int componentId, float tpsVaule, float latencyValue, String platform){ final java.sql.Date todayDate = new java.sql.Date(Calendar.getInstance().getTimeInMillis()); String queryStr = null; if(platform.equals("K8s")){ queryStr = HQLConstants.UPDATE_K8S_T...
Update the tps_latency_history/k8s_tps_latency_history table with tps & Latency values.
public String getFileExtension(File objFile) { String sFileName = null; String sExtension = null; try { if (!objFile.exists()) { throw new Exception("File does not exists"); } sFileName = objFile.getName(); int i = sFileName.las...
end READINI method to get file extension of a file
protected TspSolutionInstance(int amountOfCities) { List<Integer> list = new ArrayList<Integer>(); for (int i = 0; i < amountOfCities;i++) { list.add(i); } java.util.Collections.shuffle(list); this.path = list; }
Constructor creating a random path for the TspSOlutionInstance
public boolean isCommandValid(Character character, String command) { if(command.length() > 4 && isKill(command)) { HandleKill(character, command); return true; } if(isPossess(command)) { HandlePossess(character); retu...
Is this a possible path?
public void set(int i, long v) { data[i] = newValue(v); }
Sets value at index i. 1. Convert target value to marked value. 2. Store into internal array.
public boolean contains(T item) { synchronized(this) { return _treeSet.contains(item); } }
Check if there's an instance of the given item already in the set
public void updateCouponwithBoughtCoupon(String ID, boolean isgetCoupon) { helper.updatePoolLocationTable(PooltableName, ID, convertToString(isgetCoupon)); }
update coupon after users users use the coupon
String getTag();
Returns the value of the 'Tag' attribute. If the meaning of the 'Tag' attribute isn't clear, there really should be more of a description here...
public QuantDataHashTable() { quantData = new Hashtable<String, Double>(); }
constructor it initialize the hash table
@Override public void handle(final HttpServerRequest req) { String startTime = "1355620946302"; //--separate-comp Iterator<EventInfo> iter = dataService.events() .find("{timestamp:{$gt:"+startTime+"}}") .sort("{timestamp:1}") .as(EventInfo.class).iterator(); EventCounte...
2 VM by 2 hosts separate component
@Override public Object string(Object node) { return ((Node<E>) node).element.toString(); }
how to print the node
@Override public void onStopOrder(StopOrder StopOrder) throws Exception { }
TODO Autogenerated method stub
private <T> T findActual(T matchingObject, List<? extends T> list) { T actual = null; for (T check : list) { if (check.equals(matchingObject)) { actual = check; } } return actual; }
Find the element in the list which matches the object
private void ensureCapacity() { int newSize = elements.length * 2; Object[] newElements = new Object[newSize]; for (int i = 0; i < elements.length; i++) { newElements[i] = elements[i]; } elements = newElements; }
method ensureCapacity() double the capacity of the Dynamic Array it creates new array with increased length, then copies all elements of current array in this array and then assigns current array to new one Time Complexity is O(n) linear
public String getHeading() { return heading; }
This method was generated by MyBatis Generator. This method returns the value of the database column AD_WSLOG.HEADING
public boolean hasReplicateRequest() { return replicateRequestBuilder_ != null || replicateRequest_ != null; }
.ReplicateRequest replicateRequest = 8;
public void setCount(Integer count) { this.count = count; }
This method was generated by MyBatis Generator. This method sets the value of the database column T_LOG_BASERECORD.COUNT
public Long getUserId() { return userId; }
This method was generated by MyBatis Generator. This method returns the value of the database column bjwg_withdrawals.user_id
public void recursiveBubbleSort(int[] numbers) { boolean sorted = false; int posA; int posB; for(int i = 0; i < numbers.length - 1; i++) { if(numbers[i] > numbers[i + 1] && numbers[i] != numbers.length) { posA = numbers[i]; posB = numbers[i + ...
Recursive "Bruteforce" metode BubbleSort O(n^2)
protected String getFileETag(File file) { FileInputStream is = null; try { is = new FileInputStream(file); return "\"" + DigestUtils.md5Hex(is) + "\""; } catch (IOException e) { return ""; } finally { closeQuietly(is); } }
Generate the Etag hash string that is returned by the assets location.
java.lang.String getName();
optional string name = 1;
public void executeQuery(BufferedOutputStream bos, String xmlMessage, int[] npercentdone,int nstatusfield, Object lockpd) throws IOException { URL biomartServer = new URL(SZBIOMARTURL); URLConnection conn = biomartServer.openConnection(); // use POST method conn.setDoOutput(true);...
ExecuteQuery. xmlMessage is the string containing the BioMart query to execute. bos is the the output stream where the results of xmlMessage is written Updates npercentdone[nstatusfield] after obtaining lock on lockpd
public void updateMenus() { System.out.println("BarGraphDisplayer.updateMenus"); CommandRegistrar.gRegistrar.checkAction("barGraph"); CommandRegistrar.gRegistrar.enableAction("viewOptions"); }
Be sure the menus are current
@Override public void onDrawerSlide(View drawerView, float slideOffset) { super.onDrawerSlide(drawerView, slideOffset); //SlideOffset comes in on a scale of 0-1. //40% looks roughly about right to swap out if (slideOffset > 0.4) { ...
Called as the drawer slides by percentage
public void onClick(View v) { Intent i=new Intent(TimeOutActivity.this,Playlevel10Activity.class);finish(); startActivity(i); //buttonSound.start(); }
TODO Autogenerated method stub
public void validate_the_Telephone_Work_in_Contact_Details_of_Customer_Tab(String TelephoneWork)throws Exception { VerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_TelephoneWork.replaceAll("M_Header", "Contact Details").replaceAll("M_Category", "Telephone - Work").replaceAll("M_InnerText", TelephoneWork), "Tel...
Validation Functions Description : To validate the Telephone Work in Contact Details of Customer Tab Coded by :Raja Created Data:05 Oct 2016 Last Modified Date:05 Oct 2016 Modified By:Raja Parameter:TelephoneWork
@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu, menu); return true; }
Inflate the menu; this adds items to the action bar if it is present.
@GET @Path("getCustomerByUser") public Customer getCustomerByUser(@QueryParam("user")int user) { return ManagerHelper.getCustomerManager().getCustomerByUser(user); }
function that get customers by userId
private boolean replaceSecretWith(String user, String newSecret) { // System.out.println(); System.out.println(); System.out.println(); System.out.println("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); System.out.println("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); System.out.println...
Writes to file, replacing user's existing secret with newSecret Returns true if new file was created properly with appropriate contents
public int encodedSize(ZABEMobileNetwork jVar) { return jVar.unknownFields().mo132944h(); }
/ renamed from: a
java.util.List<kr.pik.message.Profile.ProfileMessage.ContactAddress> getContactAddressList();
repeated .ProfileMessage.ContactAddress contactAddress = 4;
public S<T> bg(String color){ try{ int c = Color.parseColor(color); bg(c); }catch(IllegalArgumentException ex){ ex.printStackTrace(); } return this; }
Sets the background color of a view
void loadOriginalGameState(String saveName, int level) throws IOException;
Load the detailed state of a game for a particular level, including highlevel information and elements present.
public String getName() { return name; }
The name of the column.
public String getPrefixCode() { return sharedPreferences.getString(PREFIX_CODE, ""); }
Set / Get Prefix Code
public void mo38281a(short s) { this.f27039b = s; }
/ renamed from: a
public List<CustomerModel> readDatabase() throws Exception{ List<CustomerModel> list = new ArrayList<CustomerModel>(); try{ log.info("Loading MySql driver"); Class.forName("com.mysql.jdbc.Driver"); log.info("Setting up connection with db"); connect= DriverManager.getConnection("jdbc:mysql://localhost:3306/apidft","r...
Get list of customers
private void sendSms(String strPhoneNumber, String strSms) { if (ActivityCompat.checkSelfPermission(this, Manifest.permission.SEND_SMS) == PackageManager.PERMISSION_GRANTED) {// checking runtime permission for Sending SMS try { SmsManager smsManager = SmsManager.getDefault(); ...
Send SMS Method Body
public boolean satisfiesMinimumDoneCommandLength(String[] command) { return (command.length > 1); }
Checks if this is capable of being a valid done command based on the criteria of length being more than 1.
static int[] findFirstTwoPositiveNumbersInARow(int... sourceNumbers) { return IntStream.of(sourceNumbers) .filter(x -> x > 0) .peek(x -> System.out.format("%d, ", x)) .limit(2).toArray(); }
additional method for method findPeriodForTwoFirstPositiveNumbersInARow
@Override public boolean prepareOp() { Iterator<Server> iter = this.serverList.iterator(); Server current = null; /* * the first replicaNumber servers received the label 0. * then the label of other servers is calculated by sql.getNewLabel() */ int groupId = 0; long label = Constants.maxLabel; ...
scegliere groupId e label per ogni server
public cosmos.base.query.v1beta1.Pagination.PageRequestOrBuilder getPaginationOrBuilder() { return getPagination(); }
.cosmos.base.query.v1beta1.PageRequest pagination = 1;
public XFormsErrorIndication(String message, Exception cause, EventTarget target, Object info) { super(message, cause); this.target = target; this.info = info; }
Creates a new xforms error indication.
int getFeatureOffset(int feat) { throw new UIMARuntimeException(UIMARuntimeException.NOT_SUPPORTED_NO_HEAP_IN_UIMA_V3); }
Feature Code to Offset Offset has no clear meaning in V3
private void _writeName(final Name name) throws IOException { _out.startObject(); _writeReifier(name); _writeItemIdentifiers(name); if (!name.getType().equals(_defaultNameType)) { _writeType(name); } _writeScope(name); _writeKeyValue("value", name.getV...
Serializes the specified name.
public java.lang.String getRegex() { java.lang.Object ref = regex_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8...
string regex = 1;
public ExecServiceMethodDescription queryResult(String name, String description) { if (resultAdded) { throw new IllegalArgumentException("The query can only have one result"); } resultAdded = true; addResult(name, description, VType.class); return this; }
Adds a result for the script; cannot have multiple query results.
public void createWishlist(Customer customer, Product product) { wishlistService.createWishlist(customerRepository.findByID(customer.getAccountID()), product); }
Creates a wishlist when one product is added to the list when created
void load(Request req);
load the first page of results
private void messageRecv(M msg) { if (LOG.isTraceEnabled()) { LOG.trace("messageRecv = {}", msg); } else if (LOG.isDebugEnabled()) { LOG.debug("messageRecv = {}", msg.getClass().getName()); } synchronized (_subscribers) { for (SubscriberImpl subscribe...
This is a callback from the PublisherLink
public Builder setSubnetResponse(entities.Torrent.SubnetResponse value) { if (subnetResponseBuilder_ == null) { if (value == null) { throw new NullPointerException(); } subnetResponse_ = value; onChan...
.SubnetResponse subnetResponse = 17;
@Override public void start(final Stage primaryStage) { loadDemoData(demoDataFile); ProcessingProfiler.setVerboseOutputState(true); ProcessingProfiler.setLoggerOutputState(true); ProcessingProfiler.setDebugState(false); DefaultErrorDataSet bubbleDataSet1a = new DefaultError...
initialises Map based on data
public boolean isUpdateDateInitialized() { return updateDate_is_initialized; }
Determines if the updateDate has been initialized. It is useful to determine if a field is null on purpose or just because it has not been initialized.
@PostConstruct public void init() { if (vehicles == null) { try { vehicles = getVehicles(); } catch (Exception e) { // } } }
Method is used to call the getAllVehicles() method from the service object to populate on create of the managed bean Used so that the List vehicles contains data when vehicles.xhtml renders
public Flight(String flightNumber, String airline, int passengerCapacity, String destination){ this.flightNumber = flightNumber; this.airline = airline; this.passengerCapacity = passengerCapacity; this.destination = destination; passengerManifest = new ArrayList<Passenger>(); ...
Is this a Priority Flight
void endNegotiation(String reason);
Overwrites the rest of the protocol and sets the protocol state to finish
@Test public void testIsEmptyError() throws ConfigurationException { assertTrue(setUpErrorConfig().isEmpty()); checkErrorListener(ConfigurationErrorEvent.READ, ConfigurationErrorEvent.READ, null, null); }
Tests handling of errors in isEmpty().
public void clearTextFields() { firstNameTextField.setText(""); lastNameTextField.setText(""); roomNoTextField.setText(""); phoneTextField.setText(""); studentIDTextField.setText(""); createPasswordTextField.setText(""); confirmPasswordTextField.setText(""); }
clear all the text fields
private Column processCreateColumn(HsqlName hsqlName) throws HsqlException { boolean isIdentity = false; long identityStart = database.firstIdentity; long identityIncrement = 1; boolean isPrimaryKey = false; String typeName; int ...
Responsible for handling the creation of table columns during the process of executing CREATE TABLE DDL statements.
to make score 6 zeros
zeros(number, size) { var stringNumber = String(number); while(stringNumber.length < (size || 2)) { stringNumber = '0' + stringNumber; } return stringNumber; }
Esta funcion se usa para ver la nota recibida en la consulta de notas recibida
function verNotaRecibida(nroNotaRec, nameArchivo) { var URL = getUrlApp() + "/DownloadServlet?tipo=VER_NOTA_REC&nroNotaRec=" + nroNotaRec + "&nameArchivo=" + nameArchivo + TAB_ID_REQUEST; /* window.status = URL; var w = window.open(URL,"Memo","width=" + ancho + ",height=" + alto + ",top=" + posX + ",le...
Update the known topics.
function updateTopics(topics) { topics.forEach(function(d, i) { d.r = Math.max(12, r(d.count)); }); // min. collision force.nodes(data.topics = topics).start(); updateNodes(); updateLabels(); }
play sound of swing
function PlaySfx() { if (blockSfx) return; blockSfx = true; audio.PlayOneShot(swingSfx,1.0); yield WaitForSeconds(swingSfx.length); blockSfx = false; }
Remove movable space promts from each square
function ResetBoard() { var allSquares = $(".square"); for (var i = 0; i < allSquares.length; i++) { $(".square:eq(" + i + ")").removeClass('movable'); } }
This function is called when a training gesture is saved and when a gesture is recognized. It depends on the LeapTrainer Controller providing a renderableGesture array.
function renderGesture() { if (!webGl) { return; } // Gesture renders are entirely disabled for canvas renderers (it's just too slow at the moment!) /* * Only one gesture is rendered at a time, so first the current gesture - if any - is removed. */ clearGesture(); /* * The LeapTrainer controller s...
will use base class constructor by default
constructor(id, admins) { super(id, 'IT'); // calls the constructor of the base class // must call super before using the 'this' keyword this.admins = admins; }
Deletes a burger from the table
deleteOne(condition, cb) { orm.deleteOne( 'burgers', condition, (res) => cb(res) ); }
Breadthfirst node tree walk. Doesn't recurse into child when the callback fn returns false
function walk(node, fn) { const queue = [node] while (queue.length) { const next = queue.shift() if (fn(next) !== false) { Array.from(next.children, (c) => queue.push(c)) } } }
Way to get a static property without explicitly specifying the class
get id() { return this.constructor.id; }
migration to version 2 unfortunately "deletedOrLocal" is a misnomer now that we no longer store local docs in the main docstore, but whaddyagonnado
function addDeletedOrLocalIndex(txn, callback) { var docStore = txn.objectStore(DOC_STORE); docStore.createIndex('deletedOrLocal', 'deletedOrLocal', {unique : false}); docStore.openCursor().onsuccess = function (event) { var cursor = event.target.result; if (cursor) { var metadata = cur...
view update complete handle changes
function updatesHandler() { let apiKey = localStorage.getItem("apiKey"); // include @bookId let title = document.getElementById(titleFieldId).value; let author = document.getElementById(authorFieldId).value; let category = document.getElementById(categoryFieldId).value; let file = document.getEl...
BRENDAN MOD: NEW FUNCTION
function TimeoutNextClickCheck(tot) { if(IsRadioClick==false) { // BMOD: use confirm instead of alert // alert("You did not click on an answer"); // return false; if(!confirm("Proceed without answer?")) { return false; } } // alert("new func"); var checked = 0; for(nn = 0; nn < tot; nn++) { if(document.Q...