anchor stringlengths 10 14.3k | positive stringlengths 10 14.9k |
|---|---|
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... |
The DOM updates done when an operation finishes are batched so that the minimum number of relayouts are required. | function endOperations(group) {
var ops = group.ops;
for (var i = 0; i < ops.length; i++) // Read DOM
{ endOperation_R1(ops[i]); }
for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)
{ endOperation_W1(ops[i$1]); }
for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM
{ end... |
Used only with promisify. Transform callback to promise result. | function translateError(err, result) {
if (!err) {
return this.resolve(result);
}
if (typeof err === 'object') {
if (err instanceof Error) {
return this.reject(ret);
}
return this.reject(Object.assign(new Error(err.message), { errCode: err.errCode }));
} else ... |
creates conservation at x, y with type x, y are given in coordinates from 0 to 1 | constructor(x, y) {
this.x = x;
this.y = y;
} |
NEW build layers function | function drawLayer(destinationTexture, layer) {
// if isColor = true
if(layer.isColor){
drawColorOnMask(destinationTexture, layer);
texture.needsUpdate = true;
}
// if isColor = false
else if (!layer.isColor) {
drawGraphicOnMask(destinationText... |
NOTE: we should probably more this routine to the synthetic shadow folder and get the allocation to be cached by in the elm instead of in the VM | function allocateInSlot$1(vm, children) {
{
assert$1.invariant(isObject$1$1(vm.cmpSlots), `When doing manual allocation, there must be a cmpSlots object available.`);
}
const {
cmpSlots: oldSlots
} = vm;
const cmpSlots = vm.cmpSlots = create$3(null);
for (let i = 0, len = children.... |
when component mounts, first thing it does is fetch all existing data in our db then we incorporate a polling logic so that we can easily see if our db has changed and implement those changes into our UI | componentDidMount() {
this.getDataFromDb();
if (!this.state.intervalIsSet) {
let interval = setInterval(this.getDataFromDb, 1000);
this.setState({ intervalIsSet: interval });
}
} |
Update the machine recipe URL | updateMachineRecipeLocation(recipeURL) {
if (!this.copyOriginFactory) {
return;
}
let machineConfig = this.copyOriginFactory.workspace.environments[0].machines[0];
machineConfig.source.type = 'recipe';
machineConfig.source.location = recipeURL;
this.updateFactory();
} |
Delete the true_false using id and update the table | function deletetrue_false(id) {
let f = confirm("Are you Sure");
if (f == true) {
firebase
.database()
.ref("Types")
.child(_typeId)
.child(id)
.remove();
firebase
.database()
.ref("Test")
.child(_courseID)
.child("Levels")
.child(_levelID)
.... |
Imposes additional restrictions for `canGoToStep` in current navigation mode. The base implementation allows transition iff the given step is navigable from the navigation bar (see `isNavigable`). However, in some navigation modes `canTransitionToStep` can be more relaxed to allow navigation to certain steps by previou... | canTransitionToStep(wizard, destinationIndex) {
return this.isNavigable(wizard, destinationIndex);
} |
date from iso format | function configFromISO(config) {
var i, l,
string = config._i,
match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
allowTime, dateFormat, timeFormat, tzFormat;
if (match) {
getParsingFlags(config).iso = true;
for (i = 0, l = ... |
o is the this | function Obj() { //函数有自己的this
const f = ()=>console.log(this);
f();
} |
Renders the AWS CloudFormation properties of an `AWS::SSM::PatchBaseline` resource | function cfnPatchBaselinePropsToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnPatchBaselinePropsValidator(properties).assertSuccess();
return {
Name: cdk.stringToCloudFormation(properties.name),
ApprovalRules: cfnPatchBaselineRuleGroupPro... |
POST the photo name and data to /queue_photos route via an AJAX request | function queuePhotos(file, index, length) {
$.ajax({
url: "/queue_photos",
type: 'POST',
data: {filename: file.filename, data: file.data},
success: function(data, status, xhr) {},
complete: function(data, status, xhr) {
if (index + 1 ==... |
get the list of all players excluding current player | getOtherPlayerList() {
let observable = new rxjs__WEBPACK_IMPORTED_MODULE_2__["Observable"](observer => {
this.socket.on('serverUpdatePlayerList', (msg) => {
var output = this.getAllOtherPlayersList(msg);
observer.next(output);
});
return () =>... |
Safely install SIGINT listener. NOTE: this will only work on OSX and Linux. | function _safely_install_sigint_listener() {
const listeners = process.listeners(SIGINT);
const existingListeners = [];
for (let i = 0, length = listeners.length; i < length; i++) {
const lstnr = listeners[i];
/* istanbul ignore else */
if (lstnr.name === '_tmp$sigint_listener') {
existingListe... |
Function to change display property to none. | function hide(Id){
document.getElementById(Id).style.display = "none";
} |
cargar el calendario atraves de un clase jquery para funciones tienen que estar cargada la clase | function Calendar_Class(ClassCSS){
jq( "."+ClassCSS ).datepicker();
} |
exam search by exam name | practTableSearch(event) {
event.preventDefault();
var searchText = event.currentTarget.value;
var filter = searchText.toUpperCase();
var table = document.getElementById("ExamListTable");
var tr = table.getElementsByTagName("tr");
// Loop through all table rows, and hide those who don't m... |
Helper function to rotate the bird depending on their vertical velocity | function rotateAndPaintImage ( context, image, angleInRad , bird ) {
var TO_RADIANS = Math.PI/180;
var yAdjuster = angleInRad < 0 ? (-angleInRad/5) : (-angleInRad/3);
var xAdjuster = angleInRad > angleInRad/2.5 ? angleInRad/3 : 0
var middleX = bird.aabb.x + xAdjuster;
var middle... |
Building the list of items | function start() {
connection.query("SELECT * FROM products", function(err, res) {
if (err) throw err;
console.log(
"--------------------------------------------------------------------------------"
);
for (var i = 0; i < res.length; i++) {
console.log(
"ID: " +
res[i].it... |
You are going to be given an array of integers. Your job is to take that array and find an index N where the sum of the integers to the left of N is equal to the sum of the integers to the right of N. If there is no index that would make this happen, return 1. | function findEvenIndex(arr) {
if (arr.length < 1 || !arr) {
return -1;
}
for (let i = 0; i < arr.length; i++) {
if (
arr.slice(0, i).reduce((x, y) => x + y, 0) ===
arr.slice(i + 1).reduce((x, y) => x + y, 0)
) {
return i;
}
}
return... |
$asyncbind has multiple uses, depending on the parameter list. It is in Function.prototype, so 'this' is always a function 1) If called with a single argument (this), it is used when defining an async function to ensure when it is invoked, the correct 'this' is present, just like "bind". For legacy reasons, 'this' is g... | function processIncludes(includes,input) {
var src = input.toString() ;
var t = "return "+src ;
var args = src.match(/.*\(([^)]*)\)/)[1] ;
var re = /['"]!!!([^'"]*)['"]/g ;
var m = [] ;
while (1) {
var mx = re.exec(t) ;
if (mx)
m.push(mx) ;
else break ;
}
... |
Copies a specified amount of characters from the list of buffered data chunks. This function is designed to be inlinable, so please take care when making changes to the function body. | function copyFromBufferString(n, list) {
var p = list.head;
var c = 1;
var ret = p.data;
n -= ret.length;
while (p = p.next) {
var str = p.data;
var nb = n > str.length ? str.length : n;
if (nb === str.length) ret += str;else ret += str.slice(0, n);
n -= nb;
if (n === 0) {
... |
This should be overriden. | _equal(a, b) {
return a === b;
} |
Get a record by id | getById (url, id) {
url = `${url}/${id}?f=json`;
return this.request(url, {method: 'GET'});
} |
sec_exponent = hash(passphrase) XOR hash(random_seed) | function genCalcHash() {
//document.write("<br>random_seed "+random_seed); //test random_seed value in this function.
if(random_seed == false){//if random_seed not active
//using original brainwallet function
var hash = Crypto.SHA256($('#pass').val());
}else{
//using brainwallet with specifie... |
Jump the skier, but do nothing if already jumping | jump() {
if (this.isJumping()) {
return;
}
this.verticalVelocity = Constants.SKIER_JUMP_VELOCITY;
} |
Buat generasi population = generate_population(5) fitness_values = calculate_population_fitness(population) mating_probability = 0.7 mutation_probability = 0.001 console.log(create_generation(population, fitness_values, mating_probability, mutation_probability)) | function create_generation(population, fitnesses, mating_probability, mutation_probability) {
mating_population = sample_population(population, fitnesses, mating_probability)
parents = crossover(mating_population)
preserved_population = preserve_top(population, fitnesses, (1 - mating_probability).toFixed(1))
//... |
draws a circle around a designated point to show locations needed to get to | function createCircle(map, center, place) {
let circle = new google.maps.Circle({
map: map,
center: {lat: center.placeLat, lng: center.placeLng},
strokeColor: '#FF0000',
strokeOpacity: 0.8,
strokeWeight: 2,
fillColor: '#FF0000',
fillOpacity: 0.35,
radi... |
closes the connection, this is used once you leave the page/closes the tab/closes the browser | function closeConnection() {
//alert("closing");
if (socket != null) {
socket.close();
}
} |
global, used for tooltips | function displayLoadGraph(node_id) {
if (! (node_id in nodes)) {
consoleWarn("Cannot display load graph for unknown node:", node_id);
return;
}
load_redraw = false;
var node_name = node_id;
var low_threshold = 0;
var high_threshold = 100;
var max_tps = 4.999;
if ("state" ... |
================================================================================ Create Pokemon Card ================================================================================ | function CreatePokemonCard (pkmn) {
var output = "";
// create the output string
if (pkmn.party) {
output += "<div class='characterSheetPartyFormatter'>";
} else {
output += "<div class='characterSheetFormatter'>";
}
// pokemon name, type, and gender
output += "<div cla... |
appending options in to and from | function appendCurrency(input) {
var curr = input.currencies;
for (key in curr) {
$("#from").append(
"<option value = " + key + ">" + key + " " + curr[key] + "</option>"
);
}
for (key in curr) {
$("#to").append(
"<option value = " + key + ">" + key + " " + curr[key] + "</option>"
);
... |
run start(true) to initiate a call | function initiateCall() {
prepareCall();
navigator.getUserMedia({
"audio": false,
"video": {
mediaSource: "screen",
width: 800,
height: 600
}
}, function(stream) {
localVideoStream = stream;
peerConn.addStream(localVideoStream);
... |
Convert a raw string to a hex string | function rstr2hex(input) {
var hex_tab = '0123456789abcdef',
output = '',
x,
i;
for (i = 0; i < input.length; i += 1) {
x = input.charCodeAt(i);
output += hex_tab.charAt((x >>> 4) & 0x0F) +
hex_tab.charAt(x & 0x0F);
... |
the router components to navigate through the pages | render() {
return (
<Router>
<div className="app">
<Switch>
<Route path="/" exact render={() => <Home user={this.state.user} />} />
<Route path="/login" exact component={Login} />
<Route path="/register" exact component={Register} />
</Switch>
</div>
</Router>
);
} |
Define o que acontece quando se deixa de pressionar certas teclas | function onKeyUp(value) {
'use strict';
switch(value.keyCode) {
case 81: // q
objV1.userData.rotClockwise = false;
break;
case 69: // e
objV1.userData.rotAntiClockwise = false;
break;
case 65: // a
objV2.userData.rotClock... |
Reorder objects attributes so that that the table works. Should put this as a service/factory. | function convertObjects(objects, list){
blank = []
for(var i=0; i<objects.length; i++)
{
obj = []
object = objects[i]
obj['pk'] = object.pk
for (var j=0; j<list.length; j ++)
{
obj.pu... |
loads the full page content | function loadPage() {
getRandomVideo(false);
setTimeout(function() {
loadSidebar();
stopLogo();
loadScreen();
}, 500);
} |
add listeners for escape key press | handleHidesOnOutsideEsc(show) {
if (show) {
this._escKeyHandler = ev => ev.key === 'Escape' && this.hide();
document.addEventListener('keyup', this._escKeyHandler);
} else {
document.removeEventListener('keyup', this._escKeyHandler);
}... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.