Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
asynchronously loads custom evaluation tags that the teacher might have saved on firebase and update the state once loaded.
async getTeacherCustomImprovementAreas() { const teacher = await FirebaseFunctions.getTeacherByID( this.props.navigation.state.params.userID ); //if teacher has customized areas, let's load theirs. if ( teacher.evaluationImprovementTags && teacher.evaluationImprovementTags.length > 0 ) { let improvementAreas = teacher.evaluationImprovementTags; this.setState({ improvementAreas }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "loadCurrentSavedTag() {\n getValue(\"tag\")\n .then(value => {\n if (!!value)\n this.setState({ saved_tag: value })\n })\n }", "function loadTags() {\n\t\tlet tags = new wp.api.collections.Tags()\n\n\t\ttags.fetch().done( () => {\n\t\t\tconsole.log(tags);\n\t\t\t\t//clearCategories();\n\t\t...
[ "0.5603177", "0.55710864", "0.54379797", "0.5346783", "0.53278285", "0.52758", "0.52592653", "0.51713204", "0.5167734", "0.5154372", "0.51451504", "0.51197773", "0.5031678", "0.501171", "0.49979848", "0.49923262", "0.49743995", "0.49698848", "0.49520707", "0.49500576", "0.488...
0.59527785
0
Updates state to reflect a change in a category rating Saves the evaluation as a new assignment
async doSubmitRating() { let { rating, notes, selectedImprovementAreas, assignmentName, classID, studentID, assignmentLength, assignmentType, assignmentLocation, evaluationID, highlightedWords, highlightedAyahs } = this.state; notes = notes.trim(); const submission = this.state.submission ? { submission: this.state.submission } : {}; let evaluationDetails = { ID: evaluationID, name: assignmentName, assignmentLength, assignmentType: assignmentType, location: assignmentLocation, completionDate: new Date().toLocaleDateString("en-US", { year: "numeric", month: "2-digit", day: "2-digit" }), evaluation: { rating, notes, highlightedWords, highlightedAyahs, improvementAreas: selectedImprovementAreas, }, ...submission }; try { await FirebaseFunctions.completeCurrentAssignment( classID, studentID, evaluationDetails ); const currentClass = await FirebaseFunctions.getClassByID( this.state.classID ); this.setState({ currentPosition: "0:00", audioFile: -1 }); this.props.navigation.push("TeacherStudentProfile", { studentID: this.state.studentID, currentClass, userID: this.props.navigation.state.params.userID, classID: this.state.classID }); } catch (err) { Alert.alert(strings.SomethingWentWrong, strings.SomethingWentWrongDesc); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "changeRating(newRating) {\n var badgeColor = colorAt(newRating);\n\n var surveyData = this.state.surveyData;\n surveyData[\"rating\"] = newRating;\n surveyData[\"color\"] = badgeColor;\n this.setState({ surveyData });\n }", "function modifyOverallRatingSubmission()\n{\n\t// Hide \"Did the candida...
[ "0.6210639", "0.6076197", "0.6028207", "0.5942839", "0.57916754", "0.57270336", "0.5700214", "0.56769586", "0.5638897", "0.5638897", "0.55733585", "0.54768836", "0.5470916", "0.5450127", "0.5423766", "0.54129136", "0.5392594", "0.53596616", "0.5278805", "0.5273262", "0.526407...
0.0
-1
Overwrites a previously saved assignment with the new data
async overwriteOldEvaluation() { const { classID, studentID, evaluationID, notes, rating, selectedImprovementAreas, highlightedAyahs, highlightedWords } = this.state; this.setState({ isLoading: true }); let evaluationDetails = { rating, notes, highlightedWords, highlightedAyahs, improvementAreas: selectedImprovementAreas, }; await FirebaseFunctions.overwriteOldEvaluation( classID, studentID, evaluationID, evaluationDetails ); const currentClass = await FirebaseFunctions.getClassByID( this.state.classID ); this.props.navigation.push("TeacherStudentProfile", { studentID: this.state.studentID, currentClass, userID: this.props.navigation.state.params.userID, classID: this.state.classID }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveOldData() {\n oldData = newData;\n newData = null\n} // saveOldData", "async save_assign(assign) {\n //const {location_id, table_id, date_from, first_name, last_name, phone, email} = assign;\n try {\n /* NOTE: assign contains all key-value pairs to pass it as values-objec...
[ "0.6717452", "0.5806337", "0.56792283", "0.56267625", "0.55997545", "0.5585929", "0.5539014", "0.552649", "0.5477935", "0.54568726", "0.54324114", "0.5413249", "0.5409316", "0.5384512", "0.5361604", "0.5323818", "0.53165394", "0.53124917", "0.5311528", "0.5283935", "0.5279235...
0.0
-1
Ensures a rating is inputted before submitting it
submitRating() { if (this.state.rating === 0) { Alert.alert("No Rating", strings.AreYouSureYouWantToProceed, [ { text: "Yes", style: "cancel", onPress: () => { if (this.props.navigation.state.params.newAssignment === true) { this.setState({ isLoading: true }); this.doSubmitRating(); } else { this.overwriteOldEvaluation(); } } }, { text: "No", style: "cancel" } ]); } else { this.setState({ isLoading: true }); if (this.props.navigation.state.params.newAssignment === true) { this.doSubmitRating(); } else { this.overwriteOldEvaluation(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleRating(rating) {\n this.setState(prevState => {\n return { form: { ...prevState.form, invalid: false, rating } }\n })\n\n // anticipate the need for a dispute per Josh\n if (rating < 3) {\n this.setState({ problemInferred: true })\n\n this.toggleModal('confirmation')\n }\n }", ...
[ "0.6870484", "0.6824826", "0.66302794", "0.639286", "0.6386344", "0.63446975", "0.6289959", "0.62447697", "0.62378657", "0.62015134", "0.61152303", "0.61014295", "0.6062152", "0.60508615", "0.6050153", "0.6008189", "0.5990314", "0.59827167", "0.59203637", "0.5888692", "0.5880...
0.6334964
6
remove the highlight and its corresponding evaluation notes from the given word.
unhighlightWord(word, ayah) { if (word.char_type === "word") { let highlightedWords = this.state.highlightedWords; delete highlightedWords[word.id]; this.setState({ highlightedWords }); } else if (word.char_type === "end") { //if user presses on an end of ayah, we highlight that entire ayah let highlightedAyahs = this.state.highlightedAyahs; let ayahKey = toNumberString(ayah); delete highlightedAyahs[ayahKey]; this.setState({ highlightedAyahs }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleBrokenWordUnselect() {\n $(self.util.svgRoot).find('.wordpart').removeClass('wordpart');\n }", "function unhighlight(){\n insertWords();\n //added to reset value variable -- alec;\n //value=\"\";\n //userWord=\"\";\n}", "function removeContextHighlights () {\n $('.moderati...
[ "0.6502792", "0.62419283", "0.61501455", "0.6088625", "0.60879046", "0.6055429", "0.6054556", "0.5972656", "0.5962439", "0.5947594", "0.5904569", "0.5898729", "0.5796435", "0.5780125", "0.57516414", "0.5705371", "0.5691678", "0.566514", "0.56323665", "0.56138027", "0.56009203...
0.6616735
0
this function is called when users
onSelectAyah(selectedAyah, selectedWord, evalNotes) { if (this.state.readOnly) { // don't change highlighted words/ayahs on read-only mode. return; } //if users press on a word, we highlight that word if (selectedWord.char_type === "word") { let highlightedWords = this.state.highlightedWords; let wordEval = _.get(highlightedWords, selectedWord.id, {}); //merge the new notes with the old notes.. Object.assign(wordEval, evalNotes); highlightedWords = { ...highlightedWords, [selectedWord.id]: wordEval }; this.setState({ highlightedWords }); } else if (selectedWord.char_type === "end") { //if user presses on an end of ayah, we highlight that entire ayah let highlightedAyahs = this.state.highlightedAyahs; let ayahKey = toNumberString(selectedAyah); let ayahEval = _.get(highlightedAyahs, ayahKey, {}); highlightedAyahs = { ...highlightedAyahs, [ayahKey]: { ...ayahEval, ...evalNotes } }; this.setState({ highlightedAyahs }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function user()\n {\n\n }", "function onRendered() {\n identifyUser();\n}", "function userinfo_requester_routines() {\n\n}", "function userinfo_dispatcher_routines() {\n\n\n}", "function HttpUserEvent() { }", "function HttpUserEvent() { }", "function HttpUserEvent() { }", "init() {\n ...
[ "0.6996582", "0.67647934", "0.6661413", "0.65854686", "0.63520765", "0.63520765", "0.63520765", "0.61020464", "0.61006784", "0.6053417", "0.6039701", "0.59929734", "0.5990063", "0.59647006", "0.59647006", "0.5961672", "0.5948359", "0.5934144", "0.59000444", "0.58736306", "0.5...
0.0
-1
handles when teacher enters a note durig tasmee3 evaluation
onSaveNotes(notes, word, ayah) { if (word === undefined) { this.setState({ notes }); } else { this.onSelectAyah(ayah, word, { notes }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function main() {\n var m_temp = readLine().split(' ');\n var m = parseInt(m_temp[0]);\n var n = parseInt(m_temp[1]);\n magazine = readLine().split(' ');\n ransom = readLine().split(' ');\n if (canCreateNote(ransom, magazine)) {\n console.log('Yes');\n } else {\n console.log('No');\n }\n}",...
[ "0.62702304", "0.60719585", "0.5800763", "0.578722", "0.5752094", "0.5613822", "0.5610951", "0.5563169", "0.55351526", "0.55065984", "0.55020505", "0.5483793", "0.54834193", "0.54390305", "0.5419827", "0.54090244", "0.5386201", "0.53801924", "0.5379006", "0.53762174", "0.5333...
0.523041
29
Renders Evaluation scree UI
render() { const { improvementAreas, readOnly, rating, classStudent, assignmentName, isLoading, studentObject, studentID, classID, assignmentType, showMushaf, highlightedAyahs, highlightedWords } = this.state; if (isLoading === true) { return ( <View style={{ flex: 1, justifyContent: "center", alignItems: "center" }} > <LoadingSpinner isVisible={true} /> </View> ); } const { profileImageID } = studentObject; const headerTitle = readOnly ? strings.Completed + ": " + this.props.navigation.state.params.completionDate : strings.HowWas + classStudent.name + strings.sTasmee3; return ( //----- outer view, gray background ------------------------ //Makes it so keyboard is dismissed when clicked somewhere else <View style={{ flex: 1 }} > {this.props.navigation.state.params.newAssignment === true ? ( <Header title={assignmentType} subtitle={assignmentName} avatarName={classStudent.name} avatarImage={studentImages.images[profileImageID]} onClose={this.closeScreen.bind(this)} /> ) : readOnly === true && !this.props.navigation.state.params.isStudentSide ? ( <TopBanner LeftIconName="angle-left" LeftOnPress={this.closeScreen.bind(this)} Title={strings.Evaluation} RightIconName="edit" RightOnPress={() => { this.setState({ readOnly: false, selectedImprovementAreas: this.state.improvementAreas }); this.getTeacherCustomImprovementAreas(); }} /> ) : ( <Header title={assignmentType} avatarName={classStudent.name} subtitle={assignmentName} avatarImage={studentImages.images[profileImageID]} onClose={this.closeScreen.bind(this)} /> )} <KeyboardAvoidingView behavior={isAndroid ? undefined : "padding"} style={ showMushaf ? styles.evaluationContainer : { justifyContent: "center", alignItems: "center" } } > <ScrollView> {showMushaf && ( <View style={{ bottom: 5, left: screenWidth * 0.9, zIndex: 1, position: "absolute" // add if dont work with above }} > <TouchableOpacity onPress={() => this.setState({ evaluationCollapsed: !this.state.evaluationCollapsed }) } > <Icon name={ this.state.evaluationCollapsed ? "angle-double-down" : "angle-double-up" } type="font-awesome" color={colors.primaryDark} /> </TouchableOpacity> </View> )} {this.state.audioFile !== -1 ? ( <View style={{ justifyContent: "center", alignItems: "center", margin: 10 }} > <View style={styles.playAudio}> <AudioPlayer visible={true} compensateForVerticalMove={false} image={studentImages.images[profileImageID]} reciter={classStudent.name} audioFilePath={this.state.audioFile} hideCancel={true} sent={ this.state.audioSentDateTime ? this.state.audioSentDateTime : "" } /> </View> </View> ) : ( <View /> )} <View style={styles.section}> <Text style={fontStyles.mainTextStyleDarkGrey}> {headerTitle} </Text> <View style={{ paddingVertical: 15 }}> <AirbnbRating defaultRating={rating} size={30} showRating={false} onFinishRating={value => this.setState({ rating: value }) } isDisabled={readOnly} /> </View> {this.state.evaluationCollapsed === false && ( <EvaluationNotes improvementAreas={improvementAreas} readOnly={readOnly} onImprovementAreasSelectionChanged={this.onImprovementAreasSelectionChanged.bind( this )} onImprovementsCustomized={this.onImprovementsCustomized.bind( this )} saveNotes={evalNotes => this.onSaveNotes(evalNotes)} notes={this.state.notes} selectedImprovementAreas={this.state.selectedImprovementAreas} userID={this.props.navigation.state.params.userID} /> )} </View> </ScrollView> </KeyboardAvoidingView> <View style={{ flex: 1 }}> {showMushaf && ( <View style={{ height: screenHeight - headerHeight }} > <KeepAwake /> <MushafScreen assignToID={studentID} hideHeader={true} readOnly={readOnly} showSelectedLinesOnly={false} classID={classID} showTooltipOnPress={readOnly ? "whenHighlighted" : "true"} profileImage={studentImages.images[profileImageID]} showLoadingOnHighlightedAyah={ this.state.isAudioLoading === true && (this.state.highlightedAyahs !== undefined || _.isEqual(this.state.highlightedAyahs, {})) } selection={this.state.selection} highlightedWords={_.cloneDeep(highlightedWords)} highlightedAyahs={_.cloneDeep(highlightedAyahs)} highlightedColor={colors.darkRed} assignmentName={assignmentName} assignmentType={assignmentType} topRightIconName="close" onClose={this.closeScreen.bind(this)} currentClass={classStudent} onSelectAyah={this.onSelectAyah.bind(this)} disableChangingUser={true} removeHighlight={this.unhighlightWord.bind(this)} evalNotesComponent={(word, ayah) => { let wordOrAyahImprovements = []; let wordOrAyahNotes = ""; let wordHasFeedback = false; try { //if user taps on a word, and teacher has put feedback specific to that word, show it if (word.char_type !== "end") { wordOrAyahImprovements = _.get( highlightedWords[word.id], "improvementAreas", [] ); wordOrAyahNotes = _.get( highlightedWords[word.id], "notes", [] ); if ( wordOrAyahImprovements.length > 0 || wordOrAyahNotes.length > 0 ) { wordHasFeedback = true; } } //show ayah feedback if: // 1: user taps on an ayah number of an ayah that has feedback associated with it // 2: user taps on a word that belongs to an ayah with feedback items AND there is no other // feedback specific to tha word if (word.char_type === "end" || wordHasFeedback === false) { let ayahNumber = toNumberString(ayah); wordOrAyahImprovements = _.get( highlightedAyahs[ayahNumber], "improvementAreas", [] ); wordOrAyahNotes = _.get( highlightedAyahs[ayahNumber], "notes", [] ); } } catch (error) { console.trace(); console.log( "ERROR_GET_WRD_AYAH_IMPROVEMENTS" + JSON.stringify(error) ); FirebaseFunctions.logEvent( "ERROR_GET_WRD_AYAH_IMPROVEMENTS", { error } ); } return ( <EvaluationNotes //TODO: This logic needs cleaning // for now: if the teacher is evaluating, then we pass the full set of improvement ares for her to choose from // if this is readonly (ie: student or teacher are seeing a past assignment), // then we show only imp. areas entered for ths word. improvementAreas={ readOnly ? wordOrAyahImprovements : improvementAreas } notes={wordOrAyahNotes} selectedImprovementAreas={wordOrAyahImprovements} readOnly={readOnly} userID={this.props.navigation.state.params.userID} onImprovementAreasSelectionChanged={selectedImprovementAreas => this.onImprovementAreasSelectionChanged( selectedImprovementAreas, word, ayah ) } onImprovementsCustomized={newAreas => { this.setState({ improvementAreas: newAreas }); FirebaseFunctions.saveTeacherCustomImprovementTags( this.props.navigation.state.params.userID, newAreas ); }} saveNotes={wordNotes => this.onSaveNotes(wordNotes, word, ayah) } /> ); }} /> </View> )} {!readOnly && ( <ActionButton buttonColor={colors.darkGreen} onPress={() => { this.submitRating(); }} renderIcon={() => ( <Icon name="check-bold" color="#fff" type="material-community" style={styles.actionButtonIcon} /> )} /> )} </View> </View> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function render() {\n let html = '';\n\n if (STORE.quizStarted === false) {\n $('main').html(displayStartScreen());\n return;\n }\n else if (STORE.questionNumber >= 0 && STORE.questionNumber < STORE.questions.length) {\n html = displayQuestNumAndScore();\n html += displayQuestion();...
[ "0.6383839", "0.6190383", "0.6176528", "0.6128449", "0.60487026", "0.6046704", "0.602431", "0.5948815", "0.5840887", "0.5837687", "0.58325773", "0.5830766", "0.5809856", "0.5793779", "0.5771437", "0.576579", "0.5740257", "0.5732045", "0.5717729", "0.57110393", "0.5671824", ...
0.0
-1
I have some usecases where this details pane changes itself as the animation continues, TODO: I should probably remove this local state and move this up the chain with redux actions
constructor(props) { super(props); this.state = { ...props }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function transitionDetailsMiniToMini() {\n this.rePopulateMiniDetailsTitleWithAnimation();\n\n //Do the right thing with the next and previous arrows\n var element = document.getElementById(\"ONEUPGRID_details_content_mini_previous_div\");\n if (this.selectedEventId == this.currentViewF...
[ "0.627069", "0.62153673", "0.59161925", "0.5885372", "0.58744067", "0.5857169", "0.58353156", "0.57286674", "0.5712948", "0.57061726", "0.570514", "0.5670081", "0.5662614", "0.5643484", "0.5627786", "0.56256914", "0.5615325", "0.56130856", "0.55983734", "0.55826616", "0.55765...
0.0
-1
import Dashboard from './components/Dashboard';
function PrivateRoute({ component: RouteComponent, authed, ...rest }) { console.log(authed); return ( <Route {...rest} render={props => authed === false ? ( <RouteComponent {...props} /> ) : ( <Redirect to={'/dash/main'} /> ) } /> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function App() {\n return (\n <div className=\"App\">\n <Router>\n <Switch>\n <Route path=\"/\">\n <AuthDashboard />\n </Route>\n </Switch>\n </Router>\n </div>\n );\n}", "function LoginRoutes() {\n return (\n <Switch>\n <Route pat...
[ "0.68579805", "0.6487618", "0.63905984", "0.63713104", "0.63658607", "0.6292143", "0.62123334", "0.6210654", "0.6181105", "0.61140823", "0.6110992", "0.6073694", "0.60248464", "0.59878796", "0.5964491", "0.59467715", "0.59441316", "0.5943454", "0.59359527", "0.5923643", "0.59...
0.0
-1
Check which submission types have been marked as available, and disable required checkboxes as necessary.
function submissionTypeChanged() { checkAvailability(submissionTypes.file, submissionTypes.text); checkAvailability(submissionTypes.text, submissionTypes.file); if (submissionTypes.text.available.prop('checked') && submissionTypes.file.available.prop('checked')) { enableRequired(submissionTypes.text); enableRequired(submissionTypes.file); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateAllOptionsToAllowSubmit() {\r\n // if suitable array and criteria conditions align ...\r\n\r\n /*\r\n selectionIndexes: {\r\n ethnicities: [],\r\n ageBands: [],\r\n genders: [],\r\n nationalities: [],\r\n religions: [],\r\n health: [],\r\n qualifications: [],\r\n },\r\n ...
[ "0.618118", "0.61580664", "0.60174406", "0.60135734", "0.60098475", "0.59267527", "0.5898249", "0.5875279", "0.5862465", "0.585994", "0.5839352", "0.5807672", "0.57830715", "0.56888014", "0.5684944", "0.56291264", "0.560085", "0.5600042", "0.5574975", "0.55575174", "0.5553916...
0.7203984
0
questions 1 to 5
function firstToFifthQuestion(questionNum) { var userResponse; var userAnswer = prompt('Guess if Laboni ' + questionArray[questionNum], 'Type yes or no').toLocaleLowerCase(); console.log('The user guessed' + userAnswer + 'for ' + questionNum + '.'); if(userAnswer === 'yes') { userResponse = true; } else if (userAnswer === 'no') { userResponse = false; } else {} if(responseArray[questionNum] === userResponse) { alert(correctAnswerArray[questionNum]); userPoints++; } else { alert('Sorry ' + user + ', you didn\'t get the correct answer. Better luck next time!'); } question++; alert('You currently have ' + userPoints + ' points and you have answered ' + question + ' questions!'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function questions(number) {\n if (number < quiz.length) {\n $(\"#question\").html(quiz[number].question);\n var choicesArr = quiz[number].choices;\n $(\"#choices\").removeClass(\"textStyle\");\n $(\"#choices\").text(\"\");\n for (var i = 0; i < choices...
[ "0.6871267", "0.6706954", "0.66714334", "0.6667242", "0.6599888", "0.65858513", "0.658443", "0.65774673", "0.65694326", "0.65512866", "0.6536591", "0.6510275", "0.64973545", "0.6485486", "0.6452612", "0.6437645", "0.64375615", "0.64278245", "0.6426504", "0.6415988", "0.641232...
0.0
-1
! The buffer module from node.js, for the browser.
function n(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function typedBuffer() {\n}", "function typedBuffer() {\n}", "function typedBuffer() {\n}", "function typedBuffer() {\n}", "function typedBuffer() {\n}", "function typedBuffer() {\n}", "function createBuffer() {\n var ptr = exports.hb_buffer_create();\n return {\n ptr: ptr,\n /**\n ...
[ "0.7284428", "0.7284428", "0.7284428", "0.7284428", "0.7284428", "0.7284428", "0.7242275", "0.72009933", "0.71086955", "0.7015804", "0.68968946", "0.68760246", "0.6799534", "0.67715156", "0.67568755", "0.67568755", "0.67568755", "0.67568755", "0.67568755", "0.67568755", "0.67...
0.0
-1
! Copyright (c) 20152019 Cisco Systems, Inc. See LICENSE file.
function s(t){var r=t;return e.isBuffer(r)||(r=e.from(r)),o.default.encode(r)}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "private internal function m248() {}", "function test_crosshair_op_host_vsphere65() {}", "function test_host_tagged_crosshair_op_vsphere65() {}", "static final private internal function m106() {}", "function WSAPI() {\n }", "static get tag(){return\"hal-9000\"}", "...
[ "0.6103753", "0.6020775", "0.5490901", "0.5483451", "0.5433593", "0.54231304", "0.53348273", "0.5305822", "0.52803075", "0.526343", "0.526343", "0.52513844", "0.5251022", "0.5234475", "0.52090615", "0.52019906", "0.5190295", "0.5179984", "0.51776373", "0.5133519", "0.5129299"...
0.0
-1
! Copyright (c) 20152019 Cisco Systems, Inc. See LICENSE file.
function c(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];if(e.add)e.add.apply(e,r);else if(e.set)e.set.apply(e,r);else{if(!e.push)throw new TypeError("Could not determine how to insert into the specified container");e.push.apply(e,r)}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "private internal function m248() {}", "function test_crosshair_op_host_vsphere65() {}", "function test_host_tagged_crosshair_op_vsphere65() {}", "static final private internal function m106() {}", "function WSAPI() {\n }", "static get tag(){return\"hal-9000\"}", "...
[ "0.61048126", "0.6021762", "0.54909676", "0.5483541", "0.54344064", "0.54226637", "0.5334779", "0.53060097", "0.52813524", "0.52649856", "0.52649856", "0.52509665", "0.52495617", "0.52337855", "0.52084035", "0.5202822", "0.5191053", "0.5180246", "0.5178851", "0.51328206", "0....
0.0
-1
! Copyright (c) 20152019 Cisco Systems, Inc. See LICENSE file.
function s(e){return new n.default(function(t){t(c(e))})}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "private internal function m248() {}", "function test_crosshair_op_host_vsphere65() {}", "function test_host_tagged_crosshair_op_vsphere65() {}", "static final private internal function m106() {}", "function WSAPI() {\n }", "static get tag(){return\"hal-9000\"}", "...
[ "0.61022836", "0.6019248", "0.549201", "0.5484461", "0.5432154", "0.5421906", "0.5335171", "0.5306816", "0.52785707", "0.5263736", "0.5263736", "0.5251904", "0.52512866", "0.52353966", "0.52072793", "0.5203911", "0.5190287", "0.51809", "0.51764977", "0.51338243", "0.5129332",...
0.0
-1
! util/algconfig.js Functions for managing algorithm set options Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
function n(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getOptions()\n{\n\n var mode = getVal(\"mode\")\n var normalizeX1 = getVal(\"normalizeX1\")\n var normalizeX2 = getVal(\"normalizeX2\")\n var normalizeX3 = getVal(\"normalizeX3\")\n var xRes = getVal(\"xRes\")\n var zRes = getVal(\"zRes\")\n var barchartPadding = getVal(\"barchartPadd...
[ "0.54408854", "0.53299993", "0.5329629", "0.5300134", "0.52983457", "0.52874106", "0.52522326", "0.5251918", "0.5209468", "0.5181975", "0.5160038", "0.51437545", "0.5133435", "0.51314694", "0.5067105", "0.50483507", "0.50251657", "0.50098217", "0.5003025", "0.49795043", "0.49...
0.0
-1
! Copyright (c) 20152019 Cisco Systems, Inc. See LICENSE file.
function p(e,t,r){(e._derived[t]={fn:(0,s.default)(r)?r:r.fn,cache:!1!==r.cache,depList:r.deps||[]}).depList.forEach(function(r){e._deps[r]=(0,o.default)(e._deps[r]||[],[t])}),(0,n.default)(e,t,{get:function(){return this._getDerivedProperty(t)},set:function(){throw new TypeError("`"+t+"` is a derived property, it can't be set directly.")}})}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "private internal function m248() {}", "function test_crosshair_op_host_vsphere65() {}", "function test_host_tagged_crosshair_op_vsphere65() {}", "static final private internal function m106() {}", "function WSAPI() {\n }", "static get tag(){return\"hal-9000\"}", "...
[ "0.6103753", "0.6020775", "0.5490901", "0.5483451", "0.5433593", "0.54231304", "0.53348273", "0.5305822", "0.52803075", "0.526343", "0.526343", "0.52513844", "0.5251022", "0.5234475", "0.52090615", "0.52019906", "0.5190295", "0.5179984", "0.51776373", "0.5133519", "0.5129299"...
0.0
-1
! Copyright (c) 20152019 Cisco Systems, Inc. See LICENSE file.
function o(e){var t=i[e];if(t)for(t=t.slice();!console[e];)e=t.pop();return function(){for(var t,r=arguments.length,n=Array(r),i=0;i<r;i++)n[i]=arguments[i];(t=console)[e].apply(t,n)}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "private internal function m248() {}", "function test_crosshair_op_host_vsphere65() {}", "function test_host_tagged_crosshair_op_vsphere65() {}", "static final private internal function m106() {}", "function WSAPI() {\n }", "static get tag(){return\"hal-9000\"}", "...
[ "0.61048126", "0.6021762", "0.54909676", "0.5483541", "0.54344064", "0.54226637", "0.5334779", "0.53060097", "0.52813524", "0.52649856", "0.52649856", "0.52509665", "0.52495617", "0.52337855", "0.52084035", "0.5202822", "0.5191053", "0.5180246", "0.5178851", "0.51328206", "0....
0.0
-1
! Copyright (c) 20152019 Cisco Systems, Inc. See LICENSE file.
function u(e){return Boolean(e.self&&d(e.self))}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "private internal function m248() {}", "function test_crosshair_op_host_vsphere65() {}", "function test_host_tagged_crosshair_op_vsphere65() {}", "static final private internal function m106() {}", "function WSAPI() {\n }", "static get tag(){return\"hal-9000\"}", "...
[ "0.61022836", "0.6019248", "0.549201", "0.5484461", "0.5432154", "0.5421906", "0.5335171", "0.5306816", "0.52785707", "0.5263736", "0.5263736", "0.5251904", "0.52512866", "0.52353966", "0.52072793", "0.5203911", "0.5190287", "0.51809", "0.51764977", "0.51338243", "0.5129332",...
0.0
-1
! Copyright (c) 20152019 Cisco Systems, Inc. See LICENSE file.
function h(e,t){return"jwk"===e?this[e].toJSON(!0):t}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "private internal function m248() {}", "function test_crosshair_op_host_vsphere65() {}", "function test_host_tagged_crosshair_op_vsphere65() {}", "static final private internal function m106() {}", "function WSAPI() {\n }", "static get tag(){return\"hal-9000\"}", "...
[ "0.61020565", "0.60196084", "0.54914206", "0.5484528", "0.5431986", "0.54224306", "0.5334338", "0.5306336", "0.52790064", "0.52642965", "0.52642965", "0.5251283", "0.5249794", "0.52337575", "0.5207978", "0.52028906", "0.51893944", "0.518021", "0.51770973", "0.5132539", "0.513...
0.0
-1
Helper function to make paths for the filtered images, i.e. assets/filtered/somefilename_blur.jpg
function getDest(img, file, name) { return path.resolve(folder + file.filename + "_" + name + ".jpg"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function filterImgs (dir) {\n return function (data) {\n // src=\"not_starting_with/slash\"\n return data.replace(/src=\"([^\\/][^\"]+)\"/g, 'src=\"' + dir + '$1\"')\n }\n}", "function buildFilterPaths() {\n var filterPaths = new Array();\n $.each(bwFilters, function (i,filterSet) {\n filterPaths[i]...
[ "0.6730763", "0.6037273", "0.58344835", "0.5813276", "0.57666874", "0.5759075", "0.57370013", "0.5726617", "0.56767464", "0.56692827", "0.56686956", "0.5633601", "0.5627656", "0.5601868", "0.55855197", "0.5569785", "0.5566589", "0.55639243", "0.5550271", "0.5550271", "0.55502...
0.0
-1
Get an existing LicenseConfiguration resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
static get(name, id, state, opts) { return new LicenseConfiguration(name, state, Object.assign(Object.assign({}, opts), { id: id })); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static get(name, id, state, opts) {\n return new OrganizationCustomRule(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "static get(name, id, state, opts) {\n return new EndpointConfiguration(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "st...
[ "0.5462729", "0.5331217", "0.5175364", "0.49766272", "0.49317893", "0.49193063", "0.48327905", "0.48200026", "0.48028737", "0.47987625", "0.47682795", "0.4690875", "0.46703625", "0.4618402", "0.45837927", "0.45715383", "0.45570007", "0.45533463", "0.4515399", "0.44961601", "0...
0.72163385
0
Returns true if the given object is an instance of LicenseConfiguration. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === LicenseConfiguration.__pulumiType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === EndpointConfiguration.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n...
[ "0.5830645", "0.57363594", "0.5683929", "0.56581485", "0.56484395", "0.5611632", "0.5608325", "0.5596872", "0.5554613", "0.5515753", "0.5514106", "0.5498812", "0.5479654", "0.54355407", "0.543149", "0.5406607", "0.54058933", "0.53994495", "0.53994495", "0.53926283", "0.535311...
0.6906615
0
Input: array = [3, 5, 4, 8, 11, 1, 1, 6], targetSum = 10 Output: [1, 11] Time: O(n^2) Space: O(1)
function twoNumberSum(array, targetSum) { var result = []; for (var i = 0; i < array.length; i++) { for (var j = i+1; j < array.length; j++) { if (array[i] + array[j] === targetSum) { result.push(array[i], array[j]); break; } } } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function targetSum(arr, sumTarget){\n \n}", "_sumToTarget(arr, target) { console.log(\"_sumToTarget reducing for target \", target);\r\n let sum = 0, x = 0, l = arr.length;\r\n while(x<l) {\r\n sum += arr[x++].value;\r\n if (sum >= target) {\r\n if (this.config.debug) console.log(\"_sum...
[ "0.78843", "0.7630242", "0.75881845", "0.75753736", "0.7533976", "0.7524009", "0.7515013", "0.7473134", "0.7455652", "0.74376756", "0.740176", "0.7380903", "0.73694026", "0.73657644", "0.732809", "0.72773683", "0.727665", "0.7271092", "0.7263421", "0.72571373", "0.722507", ...
0.72779304
15
Time: O(n) Space: O(n)
function twoNumberSum(array, targetSum) { var obj = {}; var result = []; for (var i = 0; i < array.length; i++) { if (obj[array[i]]) { result.push(array[i], obj[array[i]]); break; } else { obj[targetSum - array[i]] = array[i]; } } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findUniqueValues(arr){ //O(n) // You wrote this\r\n let uniqueVal = []; \r\n let left = 0; \r\n let right = arr.length - 1;\r\n while(left < right){ // O(n)\r\n if(!(uniqueVal.includes(arr[left]))){\r\n uniqueVal.push(arr[left])...
[ "0.6217154", "0.60882884", "0.6038923", "0.59644866", "0.59581846", "0.58900684", "0.58017", "0.57941055", "0.57906604", "0.5735336", "0.5717701", "0.56998587", "0.567274", "0.56725353", "0.56725353", "0.5671861", "0.56398463", "0.5604066", "0.5593462", "0.5549539", "0.554345...
0.0
-1
this runs as soon as App is loaded, once
componentDidMount() { this.interval = setInterval( () => { let totalSeconds = this.state.stopWatchOn ? this.state.totalElapsedTime + 1 - this.state.startTime : this.state.sessionElapsedTime; let hours = parseInt(totalSeconds / 3600); let minutes = parseInt((totalSeconds-(hours*3600)) / 60); let seconds = parseInt((totalSeconds-(hours*3600)-(minutes*60))); this.setState({ totalElapsedTime: this.state.totalElapsedTime + 1, sessionElapsedTime: totalSeconds, hours:hours, minutes:minutes, seconds:seconds }); } , 1000) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "init() {\n // Action to execute on load of the app\n }", "function onInit() {}", "function alwaysRunOnload () {\n\t\t// Placeholder/Future use.\n\t}", "function onPreappinit() {\n kony.print(\"LOG : onPreappinit - START\");\n gAppData = new initAppData();\n}", "onInit() {}", "onReady() {}", "...
[ "0.69864327", "0.689511", "0.6877751", "0.68767834", "0.6875059", "0.6828623", "0.68220377", "0.6821662", "0.67836714", "0.6782671", "0.67372614", "0.6724256", "0.67047405", "0.6696758", "0.6679615", "0.6673208", "0.6667785", "0.66432136", "0.65653366", "0.6565152", "0.655581...
0.0
-1
i added this just to keep the memory clean...but we don't ever unmount this...
componentWillUnmount() { clearInterval(this.interval); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function memoryCleanUp(){\n /*to be implemented*/\n}", "function _clearMemory () {\n memory = 0;\n }", "function flushMounts() {\n\tvar c;\n\twhile (c = mounts.pop()) {\n\t\tif (options.afterMount) options.afterMount(c);\n\t\tif (c.componentDidMount) c.componentDidMount();\n\t}\n}", "function flushMount...
[ "0.6672292", "0.6343759", "0.6338927", "0.6338927", "0.6338927", "0.6338927", "0.6338927", "0.6338927", "0.6337327", "0.61775225", "0.61758065", "0.61758065", "0.61758065", "0.61758065", "0.61758065", "0.61758065", "0.61758065", "0.61758065", "0.61554027", "0.61039567", "0.60...
0.0
-1
Tests the node and sets up a test UI for a contract (voting contract in this case);
function testNode() { // Retrieve the ABI from the local json file fetch("./contracts/voting.sol").then(response => { return response.text(); }).then((code) => { $.ajax({ type: "POST", url: "http://localhost:8080/toAbi", dataType: "json", contentType: "application/json", data: code, success: (abi) => { if (abi.error) { console.log(abi.error); } else { nodeUrl = $(".node-url").val(); console.log("Node url: " + nodeUrl); // Instantiate the web3 object if (typeof web3 !== 'undefined') { web3 = new Web3(web3.currentProvider); } else { web3 = new Web3(new Web3.providers.HttpProvider(nodeUrl)); // web3.setProvider(new Web3.providers.WebsocketProvider('ws://localhost:8545')); } // Get the available accounts web3.eth.getAccounts().then(accounts => { // Create a voting contract instance var votingInstance = new web3.eth.Contract(abi.abiDefinition); $(".compat-contract-abi").html(syntaxHighlight(JSON.stringify(abi.abiDefinition, null, 4))); $(".compat-contract-code").html(code); // Just take the first one web3.eth.defaultAccount = accounts[0]; // Same as the default account votingInstance.options.from = web3.eth.defaultAccount; if (web3.utils.isAddress(address)) { web3.eth.getCode(address).then(data => { if (data === "0x0") { $(".compat-deploy-new").text("true"); deployContract(votingInstance, abi, accounts, nodeUrl); } else { $(".compat-deploy-new").text("false"); votingInstance.options.address = address; $(".compat-deploy-address").text(address); setupExampleUI(votingInstance); testRpcCalls(abi.abiDefinition, accounts, abi.byteCode, votingInstance); $(".contract-address").html("(" + nodeUrl + ")"); $(".spinner").hide(); $(".compat-content").show(); } }); } else { $(".compat-deploy-new").text("true"); deployContract(votingInstance, abi, accounts, nodeUrl); } }).catch(data => { console.error(data); $(".contract-address").html("(" + nodeUrl + ")"); $(".no-ganache-cli-info").show(); $(".spinner").hide(); }); } } }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setUIBasedOnNodeType(){\n // Unlock Account - Check the node type\n\n if(nodeType === 'metamask' || nodeType == 'testrpc'){\n setData('lock_unlock_result','Unlock / lock ( ) not supported for '+nodeType,true);\n } else {\n setData('lock_unlock_result','--',false);\n }\n // ...
[ "0.55639166", "0.55222607", "0.5474251", "0.5219257", "0.5201662", "0.5141886", "0.51216584", "0.5106375", "0.5084308", "0.50826627", "0.50687337", "0.50371957", "0.5016623", "0.5006504", "0.50060964", "0.50055546", "0.5003383", "0.4991688", "0.49864882", "0.49852166", "0.497...
0.6286333
0
Return true if the apply button of the detail workflow panel should be disabled at this point of time. If the implementation registers dependencies with the dependency tracker, for example by reading a bean or a value expression, the method is called again when the dependencies are invalidated. By default, this method returns false, indicating that a process can always be started.
function isApplyButtonDisabled()/*:Boolean*/ { return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "canPerform() {\n return false;\n }", "function isEnabled() {\n return (tracker.currentWidget !== null &&\n tracker.currentWidget === app.shell.currentWidget);\n }", "_checkEnabled() {\n\t\tthis.isEnabled = !!this._getFirstEnabledCommand();\n\t}", "_showToggle() {\n retur...
[ "0.5844518", "0.5784208", "0.56630975", "0.55631924", "0.54433846", "0.5440499", "0.54193777", "0.53673446", "0.5348268", "0.5309957", "0.53071034", "0.52815115", "0.5280016", "0.5273651", "0.5242544", "0.5241958", "0.5202494", "0.5189242", "0.5183466", "0.51752055", "0.51520...
0.6118231
0
var elem = document.getElementById('some_div');
function countdown() { if (timeLeft === -1) { clearTimeout(timerId); } else { timer.innerHTML = timeLeft + ' seconds remaining'; timeLeft--; console.log(timeLeft); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function el(id) {\n return document.getElementById(id);\n}", "function getEl(id) {\n return document.getElementById(id)\n}", "function $( element )\n{\n return document.getElementById( element ); \n}", "function getEl(id){\n\treturn document.getElementById(id);\n}", "function elem(id) {\n r...
[ "0.7561145", "0.75596064", "0.74907", "0.74786055", "0.7432419", "0.74189806", "0.73773074", "0.7354568", "0.7347279", "0.73307425", "0.7287947", "0.72592455", "0.72278136", "0.7226286", "0.7213981", "0.71975815", "0.71760577", "0.71760577", "0.71755373", "0.71644795", "0.712...
0.0
-1
Does the given string have any repeated characters in it? Examples repeatedChars("abcd") === [] repeatedChars("abcccccccd") === ['c'] repeatedChars("aapple 1231111") === ['a', '1']
function repeatedChars(str) { const charMap = {}; // Go through each char in the string for (let char of str) { // If char exists in charMap, add 1 to it, // otherwise set it to 1. charMap[char] = charMap[char] + 1 || 1; } // Determine the repeated chars const repeated = Object.keys(charMap).reduce( (rep, key) => (charMap[key] > 1 ? [key, ...rep] : rep), [] ); // Return the repeated return repeated; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function repeatedChar(string) {\n var memo = {};\n var repeated = false;\n\n string.forEach(function(letter) {\n if (memo[letter]) {\n repeated = true;\n }\n memo[letter] = true;\n });\n return repeated;\n}", "function hasRepeatingChars() {\n //\n}", "function ch...
[ "0.79082435", "0.75011957", "0.7384266", "0.7303107", "0.72579616", "0.7198893", "0.71885884", "0.71400213", "0.70810854", "0.70702726", "0.7047062", "0.7017877", "0.70103997", "0.698779", "0.6954114", "0.6948797", "0.69455945", "0.68819547", "0.68647456", "0.6854588", "0.684...
0.80008787
0
console.log(apiURL); console.log(' get comic character data from the Marvel API using XMLHttpRequest object
function getMarvelData(callBack) { var xhr = new XMLHttpRequest(); xhr.onreadystatechange = function() { if(this.readyState == 4 && this.status == 200) { console.log("success!", this.readyState, this.status, this.statusText, this.responseText); callBack(JSON.parse(this.responseText)); // callBack(this.responseText); } else { console.log("error!", this.readyState, this.status, this.statusText); } }; xhr.open("GET", apiURL, true); xhr.send(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBomData() {\n\n // Create the AJAX request object\n let lBomRequest = new XMLHttpRequest();\n\n // Tell the request object what to do\n lBomRequest.onreadystatechange = function() {\n \n if (this.readyState == 4 && this.status == 200) {\n // Display the data ...
[ "0.68716997", "0.6770742", "0.67243963", "0.67118037", "0.6620791", "0.66099674", "0.6593366", "0.65704346", "0.65567404", "0.64133406", "0.64079404", "0.6313315", "0.6306508", "0.63015556", "0.6296382", "0.62742263", "0.6250477", "0.62473", "0.6246151", "0.6217022", "0.62064...
0.6547172
9
callback function that retrieves comic character data from getMarvelData function and adds to index.html using page section functions
function showMarvelData(data) { marvelData(data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setPage ( data ) {\n document.title = data.title;\n $('#logo').html('<img src=\"images/' + data.logo + '\"/>');\n $('h3').css('color', data.mainColor);\n $('#sectOne').css('background-image', data.headerBkg);\n $('#headerText').html( data.header );\n setTwoColumn( data.about );\n $('#...
[ "0.6030265", "0.59306175", "0.58503073", "0.5833472", "0.57689327", "0.5762538", "0.5739426", "0.57318944", "0.5671519", "0.5648023", "0.5646728", "0.56364447", "0.5626266", "0.5613706", "0.5609907", "0.5597157", "0.5591554", "0.558113", "0.5580748", "0.5574665", "0.5569236",...
0.5214001
99
problems with this hash function: 1. Not constant time 2. Works only with strings 3. Not unique for unique inputs at all times A slightly better hash function is as below Still the same example, but this time we are using prime numbers as th array length Prime numbers are proven to have a drastic affect on the number of collisions while storing a value in a hash map
function betterHash(str, len) { let total = 0; let value; const somePrime = 11; console.log(str.length); // limits iterations for extremely long strings for (let i = 0; i < Math.min(str.length, 100); i++) { value = str.charCodeAt(i) - 96; console.log(value); total = (total * somePrime + value) % len; } return total; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "hash(key){\n let hashedSum = 0;\n for(let i=0; i<key.length; i++){\n let hashedChar = i*(key[i].charCodeAt());\n hashedSum = hashedSum + hashedChar;\n }\n let primeHash = hashedSum*599;\n\n return primeHash%(this.size);\n }", "_hash(key) { //O(1)\n let hash = 0;\n for (let...
[ "0.7722281", "0.746798", "0.7450668", "0.73486227", "0.732734", "0.7316222", "0.73004067", "0.728886", "0.7284191", "0.7274457", "0.72444737", "0.72107726", "0.72003573", "0.7200201", "0.7192746", "0.7192402", "0.7178286", "0.7143936", "0.7111605", "0.708699", "0.7075466", ...
0.73297846
4
inicializacion.js es un script de Controlador destinado a inicializar variables a las que se tiene que dar un valor inicial en un momento concreto y no al cargar. Esto ocurre principalmente al entrar en la escena de juego. / VISTA
function InicializarSeleccionDificultad() { const spanSingle = document.getElementById("span_single"); var btnsDif = document.getElementsByClassName("boton_dificultad"); spanSingle.innerHTML = "1 JUGADOR"; spanSingle.style.backgroundColor = "#a2feff"; spanSingle.style.color = "black"; document.getElementById("span_jugar").innerHTML = "2 JUGADORES"; document.getElementById("nombre").readOnly = false; for (var i = 0 ; i < btnsDif.length ; i++) { var lunares = btnsDif[i].getElementsByClassName("lunares")[0].getElementsByClassName("lunar"); for (var j = 0 ; j < lunares.length ; j++) { lunares[j].style.backgroundColor = "#03c4d0"; } btnsDif[i].style.backgroundColor = "#a2feff"; btnsDif[i].style.color = "black"; btnsDif[i].classList.add("clickable"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inicializar() {\n // Chequeo si en el localStorage hay token guardado.\n tokenGuardado = window.localStorage.getItem(\"AppUsuarioToken\");\n // Al chequeo de la sesión, le paso como parámetro una función anónima que dice qué hacer después.\n chequearSesion(function () {\n // Muestro lo ...
[ "0.6893023", "0.68603694", "0.65422606", "0.64586025", "0.6449264", "0.6417552", "0.6379779", "0.63297594", "0.6292718", "0.6234378", "0.62272525", "0.61775774", "0.6168989", "0.6151381", "0.60886246", "0.6079902", "0.6068331", "0.60492724", "0.59986264", "0.59958535", "0.598...
0.0
-1
/ CONTROLADOR InicializarControlador() reinicia los valores del Controlador al comienzo del juego para evitar errores cuando haya partidas consecutivas.
function InicializarControlador() { idPalabraActual = 0; // Id de la palabra que tiene que escribir el jugador. idCharActual = 0; // Id a nivel de texto del primer caracter de la palabra que tiene que escribir el jugador. tIni = new Date(); // Momento de inicio del juego. errores = 0; // Número de errores que ha tenido el jugador hasta ahora. subIptAnterior = ""; // Lo que el usuario tenía escrito antes del último refresco del input. palabras = libreria[IndexarTextoAleatorio()].match(/\S+/gi); // Elijo un texto al azar de la librería y lo divido en un array buscando cualquier bloque de texto que no sea un " ". largoTexto = CalcularLargoDelTexto(); // Número de caracteres del texto, incluyendo espacios. texto = ConstruirTextoRevisado(palabras); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "limpiar() {\n this.nuevoRegistro = null;\n this.completado = false;\n this.registroAnterior = null;\n this.limites = [], [];\n this.consumo_correcto = null;\n this.lectura_actual = null;\n this.initMedidor();\n this.initRegistro();\n this.encontrado = ...
[ "0.66760385", "0.64826405", "0.63222337", "0.60635513", "0.60360783", "0.60349274", "0.60219884", "0.6016846", "0.6011117", "0.60095567", "0.58734006", "0.58419883", "0.58302593", "0.580676", "0.5778656", "0.5744", "0.57327557", "0.57308525", "0.5728416", "0.57138455", "0.569...
0.6801298
0
/ HOT ZONE InicializarHotZone() reinicia los valores de la tormenta al comienzo del juego para evitar errores cuando haya partidas consecutivas.
function InicializarHotZone() { faseActual = 0; cargando = true; idCharCarga = 0; idCharDescarga = 0; charsPorFase = Math.round(largoTexto / 4); charsUltimaFase = largoTexto - (charsPorFase * 3); tLoop = (dificultad.fases[faseActual].carga * 1000) / charsPorFase; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addQuietZone() {\n let quietZone = QuietZone.All;\n let w = this.mNoOfModules + 2 * quietZone;\n let h = this.mNoOfModules + 2 * quietZone;\n let tempValue1 = [];\n let tempValue2 = [];\n for (let i = 0; i < w; i++) {\n // tslint:disable-next-line:no-any\n ...
[ "0.58225214", "0.55095285", "0.54532754", "0.54475945", "0.5429833", "0.53908575", "0.5372989", "0.5352312", "0.5348509", "0.5329354", "0.5328913", "0.529499", "0.52425516", "0.5231468", "0.52233416", "0.5192849", "0.5179097", "0.51694113", "0.51685107", "0.51322806", "0.5130...
0.6449129
0
Created on : Oct 28, 2015, 4:22:48 PM Author : Sreenath Koyyam Eros:category get
function alertit() { alert(123); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCategory()\n{\n\tvar category = new Array([111,'server'], [222,'switcher'], [333,'storage'], [444,'workstation']);\n\treturn category;\n}", "function getCategory(c){\n return getCategoryObject(c.definition); \n}", "getcategory(state){\n return state.category\n }", "function getC...
[ "0.7986381", "0.756013", "0.73747176", "0.7294691", "0.724049", "0.72260135", "0.71835387", "0.71835387", "0.71835387", "0.71835387", "0.7133661", "0.70948476", "0.69894356", "0.69886595", "0.6977929", "0.6946505", "0.6924409", "0.6919577", "0.6910602", "0.6892076", "0.686293...
0.0
-1
Returns a configuration used to subscribe to an SNS topic.
bind(_topic) { return { subscriberId: this.phoneNumber, endpoint: this.phoneNumber, protocol: sns.SubscriptionProtocol.SMS, filterPolicy: this.props.filterPolicy, }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getConfig() {\n if (arguments.length <= 1 && typeof (arguments.length <= 0 ? undefined : arguments[0]) !== 'function') {\n var option = arguments.length <= 0 ? undefined : arguments[0];\n return option ? utils.deepAccess(_getConfig(), option) : _getConfig();\n }\n\n return subscribe.app...
[ "0.56542504", "0.5565252", "0.55441356", "0.5511009", "0.5509086", "0.54455256", "0.5404455", "0.5395602", "0.534267", "0.5295037", "0.52103776", "0.5074877", "0.49914277", "0.49867672", "0.49727187", "0.49520382", "0.490879", "0.49014488", "0.4886454", "0.4886454", "0.488113...
0.550591
5
trick: account for multiple letters and remember that arrays are defined by reference
function main() { const a = readLine(); const b = readLine(); // log deletions from strings A to B and from B to A console.log((countDeletions(a, b) + countDeletions(b, a))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_addToWordLetterArray(thisKey){\n let startIndex = 0;\n let i;\n while((i = this._word.indexOf(thisKey,startIndex))> -1 ){\n this._wordLetter[i] = thisKey;\n startIndex = i+1;\n }\n }", "function sameStart(arr, letter) {\n\n}", "function mutation(arr) {\n ...
[ "0.6582856", "0.65238327", "0.6431768", "0.61395293", "0.613267", "0.6088074", "0.6081125", "0.6080631", "0.6046739", "0.6046739", "0.6046739", "0.6022575", "0.59699434", "0.5954992", "0.59540033", "0.5939402", "0.5933453", "0.59323674", "0.5899911", "0.58680457", "0.58635396...
0.0
-1
strings are passed in so that actual values of array are not altered
function countDeletions(firstString, secondString) { var firstArray = firstString.split(''); var secondArray = secondString.split(''); // begin deletions counter var deletions = 0; // for every letter in first array for (let i = 0; i < firstArray.length; i++) { // is the letter in first array also in second array? Default: no var common = false; // for every letter in the second array for (let j = 0; j < secondArray.length; j++) { if (firstArray[i] === secondArray[j]) { common = true; // to account for multiple letters secondArray[j] = null; // if a common letter is found, effectively break this for loop j = secondArray.length } } // if letter is not in common, increase the deletions counter if (common === false) { deletions++ } } // return total number of deletions return deletions; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SwapStringForArrayNegativeVals(arr){\n}", "function modifyStrings(strings, modify) {\n // YOUR CODE BELOW HERE //\n var newArr = [];\n for (var i = 0; i < strings.length; i++) {\n newArr.push(modify(strings[i]));\n} return newArr;\n\n\n \n // YOUR CODE ABOVE HERE //\n}", "function mo...
[ "0.6432839", "0.6400642", "0.6294013", "0.6254479", "0.621948", "0.6153452", "0.6110674", "0.60218585", "0.5952823", "0.59509456", "0.5939075", "0.5938604", "0.5885659", "0.5879565", "0.58561414", "0.5838446", "0.5830814", "0.582712", "0.5809896", "0.5808138", "0.57652324", ...
0.0
-1
Calculate a for _myutma
function _myuFixA (c, s, t) { if (!c || c === '' || !s || s === '' || !t || t === '') return '-' let a = _myuGC(c, '__myutma=' + _myudh, s) let lt = 0 let i = 0 if ((i = a.lastIndexOf('.')) > 9) { _myuns = a.substring(i + 1, a.length) _myuns = (_myuns * 1) + 1 a = a.substring(0, i) if ((i = a.lastIndexOf('.')) > 7) { lt = a.substring(i + 1, a.length) a = a.substring(0, i) } if ((i = a.lastIndexOf('.')) > 5) { a = a.substring(0, i) } a += '.' + lt + '.' + t + '.' + _myuns } return a }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculTva(montantht,tva){\n var ht = montantht * tva;\n return ht;\n}", "function skaiciuotiVidurki(mas) {\n var suma = 0;\n for (var i = 0; i < mas.length; i++) {\n suma += mas[i];\n }\n // return Math.round(suma / mas.length);\n var ats = suma / mas.length;\n ats = Math....
[ "0.61534286", "0.6019287", "0.5916586", "0.58771396", "0.58476245", "0.58014196", "0.57877976", "0.5761055", "0.57284516", "0.56890976", "0.5659006", "0.56566423", "0.56298584", "0.55815643", "0.5559714", "0.5543781", "0.5538673", "0.5538644", "0.5516472", "0.551638", "0.5509...
0.0
-1
Normalize a port into a number, string, or false.
function normalizePort(val) { var port = parseInt(val, 10); if (isNaN(port)) { // named pipe return val; } if (port >= 0) { // port number return port; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "normalizePort(val){\n /**\n * Normalize a port into a number, string, or false.\n */\n var port = parseInt(val, 10);\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n if (port >= 0) {\n // port number\n return port...
[ "0.84491074", "0.8435193", "0.84256953", "0.84031266", "0.83957297", "0.83951354", "0.8388859", "0.83850676", "0.837168", "0.837168", "0.837168", "0.837168", "0.837168", "0.837168", "0.8370838", "0.8368659", "0.8360887", "0.8359801", "0.8358664", "0.83564407", "0.83535725", ...
0.83797497
9
Event listener for HTTP server "error" event.
function onError(error) { if (error.syscall !== 'listen') { throw error; } var bind = typeof port === 'string' ? 'Pipe ' + port : 'Port ' + port; // handle specific listen errors with friendly messages switch (error.code) { case 'EACCES': console.error(bind + ' requires elevated privileges'); process.exit(1); break; case 'EADDRINUSE': console.error(bind + ' is already in use'); process.exit(1); break; default: throw error; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function httpOnError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n var bind = typeof port === 'string'\n ? 'Pipe ' + port\n : 'Port ' + port;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(bind + '...
[ "0.71193427", "0.705736", "0.703456", "0.7025231", "0.6965633", "0.68818927", "0.68552595", "0.6830455", "0.6821154", "0.68110627", "0.678838", "0.67825073", "0.6781351", "0.67704874", "0.67664015", "0.6751079", "0.67061967", "0.6701468", "0.66606706", "0.66564983", "0.664516...
0.0
-1
Event listener for HTTP server "listening" event.
function onListening() { var addr = io.address(); var bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port; debug('Listening on ' + bind); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onListeningHTTP () {\n var addr = server.address()\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port\n debug('HTTP - Listening on ' + bind)\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' +...
[ "0.78543603", "0.7739916", "0.76332736", "0.75365347", "0.7531618", "0.7341063", "0.733379", "0.73028886", "0.7302802", "0.7282679", "0.7272048", "0.72311646", "0.72267777", "0.71615416", "0.71260625", "0.7120054", "0.7105148", "0.70975953", "0.7081919", "0.70732343", "0.7071...
0.0
-1
TODO move this overflow to steroids?
componentDidMount() { html.addClass(document.body, 'overflow-hidden'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "protected internal function m252() {}", "get _physicalEnd(){return(this._physicalStart+this._physicalCount-1)%this._physicalCount;}", "static get SIZE() { return 2000000; }", "transient final private internal function m170() {}",...
[ "0.62269926", "0.5951167", "0.5701363", "0.560616", "0.55644083", "0.5560616", "0.54985994", "0.5494242", "0.54607505", "0.54049695", "0.5374627", "0.53283453", "0.53270745", "0.5299159", "0.5292567", "0.5291579", "0.5278496", "0.5221677", "0.5215693", "0.5212055", "0.5210057...
0.0
-1
On render, we want to add the navigation
onRender () { let Navigation = new NavigationView(); App.navigationRegion.show(Navigation); Navigation.setItemAsActive("home"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderNavigationMenu() {\n\n }", "function _addNavigation() {}", "createNavigation() {\n var nav = super.createNavigation();\n nav.right.push(new NavButton('Continue', this.next, true, true));\n this.navigation = nav;\n }",...
[ "0.7938753", "0.78489083", "0.7383111", "0.7350041", "0.72935796", "0.7271455", "0.7252207", "0.71440786", "0.68863344", "0.66939944", "0.66918534", "0.6647934", "0.66293293", "0.6626447", "0.6612093", "0.65801877", "0.648965", "0.6448731", "0.6408896", "0.6405626", "0.640304...
0.75566185
2
Add Items To Basket
function addToBasket() { counter++; $("#counter").html(counter).animate({ 'opacity': '0' }, 300, function () { $("#counter").delay(300).animate({ 'opacity': '1' }) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function AddItem(item){\n console.log(\"Adding \" + item.Name + \" to the basket!\");\n basket.push(item);\n}", "function addItem(item) {\n basket.push(item);\n return true;\n}", "function addBasket() {\n if (basket.length === 0 || (basket.find(x => x.name === item.name)) === undefined) {\n ...
[ "0.7838967", "0.77334374", "0.76741815", "0.75713176", "0.75713176", "0.75122786", "0.7508432", "0.7376564", "0.7300375", "0.7285014", "0.7016026", "0.70135903", "0.6987162", "0.69486344", "0.6901546", "0.688844", "0.68761504", "0.6863176", "0.68565804", "0.68457323", "0.6844...
0.0
-1
drawCards makes the cards appear on the page and passes values to the score arrays
function drawCards(data) { getJSON(drawApi + data.deck_id + "/?count=4", function (cardData) { console.log(cardData); console.log(cardData.cards[0]); //creating score arrays // but parses NaN if a face card... playerScore = playerScore.concat(parseInt(cardData.cards[0].value)); playerScore = playerScore.concat(parseInt(cardData.cards[1].value)); houseScore = houseScore.concat(parseInt(cardData.cards[2].value)); houseScore = houseScore.concat(parseInt(cardData.cards[3].value)); //totals the score arrays playerScoreTotal = playerScore.reduce(function(prev, curr){ return prev + curr; }); houseScoreTotal = houseScore.reduce(function(prev, curr){ return prev + curr; }); //Lucas inspired code below for dealing with face values. Doesnt quite work right now. Just makes playerScoreTotal === 20 //if(cardData.cards[0].value === "King" || "Queen" || "Jack") { //playerScoreTotal += 10; //} //if(cardData.cards[1].value === "King" || "Queen" || "Jack") { //playerScoreTotal += 10; //} ////End Lucas inspiration appendPlayerCard(cardData); appendDealerCard(cardData); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compDraw() {\n compHand.push(getCard());\n compHand.push(getCard());\n compScore = getCompScore();\n while (compScore < 15) {\n compHand.push(getCard());\n compScore = getCompScore();\n }\n updatePage();\n compareScore();\n updatePage();\n}", "function playerCards()...
[ "0.766761", "0.7229308", "0.72034293", "0.7196926", "0.7116544", "0.7034283", "0.69938654", "0.69877", "0.6843904", "0.6836858", "0.68336296", "0.68256485", "0.6782215", "0.6779211", "0.6725816", "0.6724083", "0.66940165", "0.6660893", "0.66430736", "0.6641876", "0.66317105",...
0.7484573
1
working on drawing 2 cards per player on the start game click
function appendPlayerCard(cardData){ draw.on("click", function() { var $table=$("table"); $table.append("<tr></tr>"); var $target=$("tr:last"); $target.append("<td>" + "<img src=" + cardData.cards[0].image + "></img>" + "</td>"); $target.append("<td>" + "<img src=" + cardData.cards[1].image + "></img>" + "</td>"); $target.append("<td>" + playerScoreTotal + "</td>"); if(cardData.cards[0].value + cardData.cards[1].value <= 21){ alert("Blackjack! Player Wins!"); } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function firstDraw () {\n // each player starts with 4 cards\n // so draw 4 cards for the player\n }", "drawStage () {\n for (let i = 0; i < 2; i++) {\n const card = this.game.decks.player.draw()\n if (card.type === 'epidemic') {\n this.game.epidemic()\n }\n this....
[ "0.81398606", "0.7585327", "0.7387898", "0.7329736", "0.7280708", "0.7217901", "0.71504796", "0.71504796", "0.71462345", "0.71050453", "0.71044344", "0.7079055", "0.7078316", "0.7043312", "0.7030819", "0.7026582", "0.7023886", "0.7023472", "0.7014926", "0.6997523", "0.6987462...
0.0
-1
1. Create a simple function that can reverse the contents of a sentence, word, phrase.
function reverse(string) { let splitString = string.split(''); let reverseArray = splitString.reverse(); let joinArray = reverseArray.join(''); console.log(joinArray); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reverse(phrase){\n \"use strict\";\n\n return phrase.split('').reverse().join('');\n}", "function reverse(phrase){\n \"use strict\";\n\n return phrase.split('').reverse().join('');\n }", "function reverse(phrase){\n var newPhrase = '';\n for (i= phrase.length-1; i >= 0; i--) {\n newP...
[ "0.77850044", "0.7782319", "0.73398787", "0.7311283", "0.72222805", "0.7190132", "0.7182453", "0.71159583", "0.7037326", "0.70348555", "0.7025179", "0.7022026", "0.7004029", "0.6989658", "0.695644", "0.69525635", "0.6944668", "0.6938717", "0.6934415", "0.692512", "0.69035023"...
0.0
-1
2. Create a function that will accept a date or year and calculate if it falls on a Leap Year.
function leapYear(year) { //leap year --> divisible by 4 but not 100 or is divisible by 400 console.log((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function detectleapyear(year){\n if (year % 4 !== 0) {\n return false;\n } else if (year % 100 !== 0) {\n return true;\n } else if (year % 400 !== 0) {\n return false;\n } else {\n return true;\n }\n }", "function checkLeapYear(year){\n //(year % 4 == 0) && (( year % 100 != 0) ||...
[ "0.8105666", "0.8043165", "0.80352247", "0.79319185", "0.79062885", "0.78988314", "0.78467315", "0.78442097", "0.7812159", "0.78047854", "0.7772833", "0.7762213", "0.7752126", "0.7731435", "0.7725717", "0.7717177", "0.7712448", "0.77115804", "0.7685194", "0.7665907", "0.7665"...
0.7546553
27
3. Create a function that can perform a word count, given a block of text. Punctuations or special characters are not to be included.
function countWords(text) { let punctuationRemove = text.replace(/[\.,-\/#!$%\^&\*;:{}=\-_`~()@\+\?><\[\]\+]/g, ''); let splitText = punctuationRemove.split(' '); console.log(splitText); let count = splitText.length; console.log(count); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getWordCounts(text) {\n\n}", "function wordcount(text) {\n text = text.replace(/<\\/?(?!\\!)[^>]*>/gi, '');\n // Replace underscores (which are classed as word characters) with spaces.\n text = text.replace(/_/gi, \" \");\n // Remove any characters that shouldn't be treated a...
[ "0.7897133", "0.75909203", "0.7514788", "0.748212", "0.73726386", "0.73344356", "0.7242633", "0.7146962", "0.7118191", "0.70546764", "0.6928537", "0.6917344", "0.6874407", "0.6750008", "0.67400545", "0.6727978", "0.6727978", "0.67111254", "0.67111254", "0.67111254", "0.670628...
0.6925955
11
4. Create a function that checks a string or sentence and returns true if that parameter is a palindrome, (the string is the same forward as it is backward).
function palindrome(string) { let splitString = string.split(''); let reverseArray = splitString.reverse(); let joinArray = reverseArray.join(''); if (string == joinArray) { console.log(true); } else { console.log(false); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isPalindrome(str) {\n\n}", "function palindromeCheck(sentence){\n if (typeof sentence === 'string'){\n const reverseSentence = sentence.split('').reverse().join('').toLowerCase().replace(/[^a-z]/g, '')\n const noSpacesString = sentence.toLowerCase().replace(/[^a-z]/g, '')\n if (noSpacesString ...
[ "0.85693794", "0.85097224", "0.84500337", "0.8435969", "0.84339464", "0.8399982", "0.8393444", "0.83907735", "0.8363172", "0.8344747", "0.8327029", "0.83268255", "0.8324368", "0.82945514", "0.8291161", "0.82678", "0.8252127", "0.82511175", "0.8219813", "0.82078207", "0.818641...
0.0
-1
6. create a table and paint alternative colors:
function getTableCells(elem) { let cells = [] let table = document.getElementById(elem); for (let r = 0; r < table.rows.length; r++) { for (let c = 0; c < table.rows[r].cells.length; c++) { cells.push(table.rows[r].cells[c]); } } alternateColors(cells); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initTable() {\r\nvar color = [\r\n '#FFFF00', // Bright yellow\r\n '#00FF00', // Bright green\r\n '#00FFFF', // Bright cyan\r\n '#FF00FF', // Bright pink\r\n '#FF0000', // Bright red\r\n '#AA00FF', // Bright purple\r\n '#FFAA00', // Bright orange\r\n '#00FFAA', // Bright blue-green...
[ "0.79159707", "0.79053813", "0.74255663", "0.7110601", "0.69467086", "0.67430735", "0.6679923", "0.66681814", "0.6650535", "0.6645183", "0.6643966", "0.66277987", "0.6620158", "0.65676934", "0.6532415", "0.6520607", "0.65086704", "0.6494173", "0.6461298", "0.6430681", "0.6415...
0.0
-1
7. Write a script that, on click of a button, can randomly select an image from a list and insert it inside the section tag in the html. eg.
function insertImage() { let img = document.createElement("img"); let section = document.getElementById("imageSection"); img.src = "https://source.unsplash.com/random"; img.style.height = "300px"; img.style.width = "auto"; section.appendChild(img); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function chooseFruit(){\n // access id and get the attr with attr();\n //to get random image in second parameter\n //we will create array above. fruits[0] is apple\n /*\n want number to be randomly chosen between 0-8\n use Math.random() which gives a number betwwen\n 0 and 1 and multiply ...
[ "0.6935787", "0.6859484", "0.67021376", "0.664194", "0.6633752", "0.66218", "0.6585556", "0.6583496", "0.65834415", "0.6540964", "0.6519542", "0.6516514", "0.65159434", "0.6489359", "0.6477023", "0.64638716", "0.6452845", "0.6432863", "0.6427705", "0.64170784", "0.6414186", ...
0.0
-1
La function si occupa di rispondere al client.
function rispondi(result,cb){ if(result!="err"){ cb(result); } else{ cb("0"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getClientCalls() {\n\n }", "function ElstrServerRpcCallsAdmin (){}", "function executeClient() {\n\t\trequest('BrixApi.newPlayer', [], function(response) {\n\t\t\tplayer = new Player(response.value, 400, 400, randomColor());\n\t\t\tmap.addPlayer(player, function() {\n\t\t\t\tplayer.takeControl(map);\n\t\t\t...
[ "0.59425795", "0.5847604", "0.58139616", "0.5701569", "0.5701569", "0.5701569", "0.5701569", "0.5701569", "0.5701569", "0.56467503", "0.5638129", "0.56301713", "0.5621787", "0.5612145", "0.55654985", "0.552803", "0.55232894", "0.55148935", "0.5502826", "0.5502411", "0.5499859...
0.0
-1
get currentuser transactions and set to this.userTransactions property
getUserTransactions() { this.userTransactions = this.appConfig.transactions.filter((transaction) => { if (transaction.userId === this.loggedInUserDetails.id) { return true; } }); // filter current user transactions from this.appConfig.transactions array // console.log(this.userTransactions); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getUserTransactions(id) {\n return Api().get(`/transactions/user/${id}`);\n }", "function transact(){\n const tid = transactions.length;\n const transaction = {\n tid: tid,\n timestamp: new Date(),\n user: 0\n };\n\n transactions.push(transac...
[ "0.6856593", "0.6219605", "0.6203921", "0.61412543", "0.59827733", "0.5883101", "0.5790193", "0.56914294", "0.5688507", "0.56723285", "0.5647265", "0.56311315", "0.56117254", "0.5531228", "0.54710543", "0.54460144", "0.54356796", "0.5427972", "0.5424224", "0.541708", "0.54130...
0.7917257
0
Active Threads Over Time
function refreshActiveThreadsOverTime(fixTimestamps) { var infos = activeThreadsOverTimeInfos; prepareSeries(infos.data); if(fixTimestamps) { fixTimeStamps(infos.data.result.series, 28800000); } if(isGraph($("#flotActiveThreadsOverTime"))) { infos.createGraph(); }else{ var choiceContainer = $("#choicesActiveThreadsOverTime"); createLegend(choiceContainer, infos); infos.createGraph(); setGraphZoomable("#flotActiveThreadsOverTime", "#overviewActiveThreadsOverTime"); $('#footerActiveThreadsOverTime .legendColorBox > div').each(function(i){ $(this).clone().prependTo(choiceContainer.find("li").eq(i)); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "sendActiveThreadCountRes() {\n \n }", "function inc_busy()\n{\n background_jobs++;\n update_busy_indicator();\n}", "get threads() {\r\n return new Threads(this);\r\n }", "scheduler() {\n const {busyApps, appPriorities, ticks} = this;\n this.__apps.map((app, appId) => {\n return...
[ "0.6576497", "0.59847337", "0.58223873", "0.5718862", "0.55958724", "0.5595724", "0.55418223", "0.55237967", "0.5521639", "0.5500782", "0.54795545", "0.54381746", "0.54291314", "0.5426496", "0.54111665", "0.5372322", "0.53668267", "0.5361897", "0.53617936", "0.5358493", "0.53...
0.0
-1
Bytes throughput Over Time
function refreshBytesThroughputOverTime(fixTimestamps) { var infos = bytesThroughputOverTimeInfos; prepareSeries(infos.data); if(fixTimestamps) { fixTimeStamps(infos.data.result.series, 28800000); } if(isGraph($("#flotBytesThroughputOverTime"))){ infos.createGraph(); }else{ var choiceContainer = $("#choicesBytesThroughputOverTime"); createLegend(choiceContainer, infos); infos.createGraph(); setGraphZoomable("#flotBytesThroughputOverTime", "#overviewBytesThroughputOverTime"); $('#footerBytesThroughputOverTime .legendColorBox > div').each(function(i){ $(this).clone().prependTo(choiceContainer.find("li").eq(i)); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _calculateDownloadTime(sizeInBytes) {\n return Math$floor(sizeInBytes / _throughput); \n }", "_measureSpeed() {\n\t\tif(!this._socket) return;\n\t\tif(!this._connected) {\n\t\t\tthis._upspeed = 0;\n\t\t\tthis._downspeed = 0;\n\t\t}\n\t\tconst dt = new Date();\n\t\tconst dtime = (dt - this._mea...
[ "0.6508586", "0.6091145", "0.5925868", "0.591433", "0.5827529", "0.5751863", "0.57444245", "0.57324314", "0.56583023", "0.56513727", "0.5635747", "0.5610187", "0.56025785", "0.5594923", "0.55727565", "0.5547173", "0.5543636", "0.55419546", "0.5533669", "0.5532342", "0.5529149...
0.0
-1
Response Times Over Time
function refreshResponseTimeOverTime(fixTimestamps) { var infos = responseTimesOverTimeInfos; prepareSeries(infos.data); if(infos.data.result.series.length == 0) { setEmptyGraph("#bodyResponseTimeOverTime"); return; } if(fixTimestamps) { fixTimeStamps(infos.data.result.series, 28800000); } if(isGraph($("#flotResponseTimesOverTime"))){ infos.createGraph(); }else{ var choiceContainer = $("#choicesResponseTimesOverTime"); createLegend(choiceContainer, infos); infos.createGraph(); setGraphZoomable("#flotResponseTimesOverTime", "#overviewResponseTimesOverTime"); $('#footerResponseTimesOverTime .legendColorBox > div').each(function(i){ $(this).clone().prependTo(choiceContainer.find("li").eq(i)); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function responseTime (req, res) {\n if (!res._header || !req._startAt) {\n return ''\n }\n\n var tdiff = process.hrtime(req._startAt)\n , ms = tdiff[0] * 1e3 + tdiff[1] * 1e-6\n\n return ms.toFixed(3)\n}", "function getServerTime(request, response) {\r\n\tvar time = new Date();\r\n\t\r\n\tvar result =...
[ "0.7092822", "0.6836103", "0.639537", "0.63374466", "0.6251988", "0.61462384", "0.6100139", "0.6068924", "0.6020777", "0.60106874", "0.60009605", "0.59932894", "0.59754544", "0.597369", "0.59192896", "0.5914399", "0.5872192", "0.5872192", "0.5872192", "0.5850241", "0.5811009"...
0.0
-1
Connect Time Over Time
function refreshConnectTimeOverTime(fixTimestamps) { var infos = connectTimeOverTimeInfos; prepareSeries(infos.data); if(infos.data.result.series.length == 0) { setEmptyGraph("#bodyConnectTimeOverTime"); return; } if(fixTimestamps) { fixTimeStamps(infos.data.result.series, 28800000); } if(isGraph($("#flotConnectTimeOverTime"))) { infos.createGraph(); }else { var choiceContainer = $("#choicesConnectTimeOverTime"); createLegend(choiceContainer, infos); infos.createGraph(); setGraphZoomable("#flotConnectTimeOverTime", "#overviewConnectTimeOverTime"); $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){ $(this).clone().prependTo(choiceContainer.find("li").eq(i)); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "connectTimeout() {\n var worker = cluster.workers[this.worker_key]\n if ( worker !== undefined ) {\n if ( !(worker.isConnected()) ) {\n var onset = this.trackingStartTime\n var diff = Date.now() - onset\n //\n //if ( diff > MAX_CONNECT_FAIL_TIME ) writeConsoleLog('log',{com...
[ "0.57900476", "0.5770421", "0.5753667", "0.5660272", "0.55595124", "0.553363", "0.5530261", "0.5530261", "0.5530261", "0.5530261", "0.5530261", "0.5530261", "0.5530261", "0.5530261", "0.5528221", "0.55238473", "0.55238473", "0.55238473", "0.55238473", "0.55238473", "0.5523847...
0.5523547
36
Response Time Percentiles Over Time
function refreshResponseTimePercentilesOverTime(fixTimestamps) { var infos = responseTimePercentilesOverTimeInfos; prepareSeries(infos.data); if(fixTimestamps) { fixTimeStamps(infos.data.result.series, 28800000); } if(isGraph($("#flotResponseTimePercentilesOverTime"))) { infos.createGraph(); }else { var choiceContainer = $("#choicesResponseTimePercentilesOverTime"); createLegend(choiceContainer, infos); infos.createGraph(); setGraphZoomable("#flotResponseTimePercentilesOverTime", "#overviewResponseTimePercentilesOverTime"); $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){ $(this).clone().prependTo(choiceContainer.find("li").eq(i)); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getReqPerTime() {\n let sum_time = 0.0\n let dif = 0.0\n for (let d = 0; d < this.state.data.length; d++) {\n dif = new Date(this.state.data[d].dt_end_log).getTime() - new Date(this.state.data[d].dt_Start_Log).getTime()\n sum_time += dif / 1000\n }\n \n return (sum_time / this.state.data....
[ "0.6469232", "0.59043026", "0.57266444", "0.55641556", "0.55416846", "0.55416846", "0.55416846", "0.55416846", "0.55416846", "0.5537933", "0.5534539", "0.55343693", "0.55343693", "0.55343693", "0.55343693", "0.55343693", "0.55343693", "0.55343693", "0.55343693", "0.55343693", ...
0.55089223
100
Response Time vs Request
function refreshResponseTimeVsRequest() { var infos = responseTimeVsRequestInfos; prepareSeries(infos.data); if (isGraph($("#flotResponseTimeVsRequest"))){ infos.createGraph(); }else{ var choiceContainer = $("#choicesResponseTimeVsRequest"); createLegend(choiceContainer, infos); infos.createGraph(); setGraphZoomable("#flotResponseTimeVsRequest", "#overviewResponseTimeVsRequest"); $('#footerResponseRimeVsRequest .legendColorBox > div').each(function(i){ $(this).clone().prependTo(choiceContainer.find("li").eq(i)); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function responseTime (req, res) {\n if (!res._header || !req._startAt) {\n return ''\n }\n\n var tdiff = process.hrtime(req._startAt)\n , ms = tdiff[0] * 1e3 + tdiff[1] * 1e-6\n\n return ms.toFixed(3)\n}", "function getServerTime(request, response) {\r\n\tvar time = new Date();\r\n\t\r\n\tvar result =...
[ "0.75744617", "0.7416566", "0.6893877", "0.68084794", "0.6781717", "0.6561443", "0.652187", "0.65142745", "0.6462254", "0.6462254", "0.6462254", "0.6245028", "0.6245028", "0.62287295", "0.6191165", "0.61851764", "0.61500037", "0.61434627", "0.6104452", "0.60714453", "0.594592...
0.0
-1
Total Transactions per second
function refreshTotalTPS(fixTimestamps) { var infos = totalTPSInfos; // We want to ignore seriesFilter prepareSeries(infos.data, false, true); if(fixTimestamps) { fixTimeStamps(infos.data.result.series, 28800000); } if(isGraph($("#flotTotalTPS"))){ infos.createGraph(); }else{ var choiceContainer = $("#choicesTotalTPS"); createLegend(choiceContainer, infos); infos.createGraph(); setGraphZoomable("#flotTotalTPS", "#overviewTotalTPS"); $('#footerTotalTPS .legendColorBox > div').each(function(i){ $(this).clone().prependTo(choiceContainer.find("li").eq(i)); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "totalTime() {\n let time = 0\n this.measures.forEach(m => time += m.totalTime())\n return time\n }", "function updateValues() {\n\tconst amounts = transactions.map((transaction) => transaction.time);\n\n\tconst total = amounts.reduce((acc, item) => (acc += item), 0);\n\t//console.log(time...
[ "0.65046084", "0.6479991", "0.6461238", "0.6340553", "0.63175285", "0.62999165", "0.6285214", "0.6285214", "0.6269029", "0.62109965", "0.6122031", "0.611619", "0.5952385", "0.587621", "0.5870545", "0.584586", "0.58369875", "0.58181375", "0.5804055", "0.5803499", "0.579104", ...
0.0
-1
Collapse the graph matching the specified DOM element depending the collapsed status
function collapse(elem, collapsed){ if(collapsed){ $(elem).parent().find(".fa-chevron-up").removeClass("fa-chevron-up").addClass("fa-chevron-down"); } else { $(elem).parent().find(".fa-chevron-down").removeClass("fa-chevron-down").addClass("fa-chevron-up"); if (elem.id == "bodyBytesThroughputOverTime") { if (isGraph($(elem).find('.flot-chart-content')) == false) { refreshBytesThroughputOverTime(true); } document.location.href="#bytesThroughputOverTime"; } else if (elem.id == "bodyLatenciesOverTime") { if (isGraph($(elem).find('.flot-chart-content')) == false) { refreshLatenciesOverTime(true); } document.location.href="#latenciesOverTime"; } else if (elem.id == "bodyCustomGraph") { if (isGraph($(elem).find('.flot-chart-content')) == false) { refreshCustomGraph(true); } document.location.href="#responseCustomGraph"; } else if (elem.id == "bodyConnectTimeOverTime") { if (isGraph($(elem).find('.flot-chart-content')) == false) { refreshConnectTimeOverTime(true); } document.location.href="#connectTimeOverTime"; } else if (elem.id == "bodyResponseTimePercentilesOverTime") { if (isGraph($(elem).find('.flot-chart-content')) == false) { refreshResponseTimePercentilesOverTime(true); } document.location.href="#responseTimePercentilesOverTime"; } else if (elem.id == "bodyResponseTimeDistribution") { if (isGraph($(elem).find('.flot-chart-content')) == false) { refreshResponseTimeDistribution(); } document.location.href="#responseTimeDistribution" ; } else if (elem.id == "bodySyntheticResponseTimeDistribution") { if (isGraph($(elem).find('.flot-chart-content')) == false) { refreshSyntheticResponseTimeDistribution(); } document.location.href="#syntheticResponseTimeDistribution" ; } else if (elem.id == "bodyActiveThreadsOverTime") { if (isGraph($(elem).find('.flot-chart-content')) == false) { refreshActiveThreadsOverTime(true); } document.location.href="#activeThreadsOverTime"; } else if (elem.id == "bodyTimeVsThreads") { if (isGraph($(elem).find('.flot-chart-content')) == false) { refreshTimeVsThreads(); } document.location.href="#timeVsThreads" ; } else if (elem.id == "bodyCodesPerSecond") { if (isGraph($(elem).find('.flot-chart-content')) == false) { refreshCodesPerSecond(true); } document.location.href="#codesPerSecond"; } else if (elem.id == "bodyTransactionsPerSecond") { if (isGraph($(elem).find('.flot-chart-content')) == false) { refreshTransactionsPerSecond(true); } document.location.href="#transactionsPerSecond"; } else if (elem.id == "bodyTotalTPS") { if (isGraph($(elem).find('.flot-chart-content')) == false) { refreshTotalTPS(true); } document.location.href="#totalTPS"; } else if (elem.id == "bodyResponseTimeVsRequest") { if (isGraph($(elem).find('.flot-chart-content')) == false) { refreshResponseTimeVsRequest(); } document.location.href="#responseTimeVsRequest"; } else if (elem.id == "bodyLatenciesVsRequest") { if (isGraph($(elem).find('.flot-chart-content')) == false) { refreshLatenciesVsRequest(); } document.location.href="#latencyVsRequest"; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function collapse_unload(d,svg_dom)\n\t\t{\n\n\t\t\t//get all nodes\n\t\t\tvar nodes = d3.select(svg_dom).selectAll(\"g.node\").data();\n\t\t\tvar idx = nodes.findIndex( //find node that is already opened\n\t\t\t\t\tfunction(element)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn ( element.depth === d.depth && element.children ...
[ "0.6733574", "0.66582936", "0.6610769", "0.6518608" ]
0.0
-1
Activates or deactivates all series of the specified graph (represented by id parameter) depending on checked argument.
function toggleAll(id, checked){ var placeholder = document.getElementById(id); var cases = $(placeholder).find(':checkbox'); cases.prop('checked', checked); $(cases).parent().children().children().toggleClass("legend-disabled", !checked); var choiceContainer; if ( id == "choicesBytesThroughputOverTime"){ choiceContainer = $("#choicesBytesThroughputOverTime"); refreshBytesThroughputOverTime(false); } else if(id == "choicesResponseTimesOverTime"){ choiceContainer = $("#choicesResponseTimesOverTime"); refreshResponseTimeOverTime(false); }else if(id == "choicesResponseCustomGraph"){ choiceContainer = $("#choicesResponseCustomGraph"); refreshCustomGraph(false); } else if ( id == "choicesLatenciesOverTime"){ choiceContainer = $("#choicesLatenciesOverTime"); refreshLatenciesOverTime(false); } else if ( id == "choicesConnectTimeOverTime"){ choiceContainer = $("#choicesConnectTimeOverTime"); refreshConnectTimeOverTime(false); } else if ( id == "choicesResponseTimePercentilesOverTime"){ choiceContainer = $("#choicesResponseTimePercentilesOverTime"); refreshResponseTimePercentilesOverTime(false); } else if ( id == "choicesResponseTimePercentiles"){ choiceContainer = $("#choicesResponseTimePercentiles"); refreshResponseTimePercentiles(); } else if(id == "choicesActiveThreadsOverTime"){ choiceContainer = $("#choicesActiveThreadsOverTime"); refreshActiveThreadsOverTime(false); } else if ( id == "choicesTimeVsThreads"){ choiceContainer = $("#choicesTimeVsThreads"); refreshTimeVsThreads(); } else if ( id == "choicesSyntheticResponseTimeDistribution"){ choiceContainer = $("#choicesSyntheticResponseTimeDistribution"); refreshSyntheticResponseTimeDistribution(); } else if ( id == "choicesResponseTimeDistribution"){ choiceContainer = $("#choicesResponseTimeDistribution"); refreshResponseTimeDistribution(); } else if ( id == "choicesHitsPerSecond"){ choiceContainer = $("#choicesHitsPerSecond"); refreshHitsPerSecond(false); } else if(id == "choicesCodesPerSecond"){ choiceContainer = $("#choicesCodesPerSecond"); refreshCodesPerSecond(false); } else if ( id == "choicesTransactionsPerSecond"){ choiceContainer = $("#choicesTransactionsPerSecond"); refreshTransactionsPerSecond(false); } else if ( id == "choicesTotalTPS"){ choiceContainer = $("#choicesTotalTPS"); refreshTotalTPS(false); } else if ( id == "choicesResponseTimeVsRequest"){ choiceContainer = $("#choicesResponseTimeVsRequest"); refreshResponseTimeVsRequest(); } else if ( id == "choicesLatencyVsRequest"){ choiceContainer = $("#choicesLatencyVsRequest"); refreshLatenciesVsRequest(); } var color = checked ? "black" : "#818181"; if(choiceContainer != null) { choiceContainer.find("label").each(function(){ this.style.color = color; }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function switchAllGraphItems(flag) {\n\t$$('.graphCheckBox').each(function(checkbox) {\n\t\tif (!checkbox.disabled) {\n\t\t\tcheckbox.checked = flag;\n\t\t}\n\t});\n}", "function checkAll(id){\r\n toggleAll(id, true);\r\n}", "function checkAll(id){\r\n toggleAll(id, true);\r\n}", "function checkAll(id)...
[ "0.53520834", "0.5350999", "0.5350999", "0.5350999", "0.5350999", "0.5350999", "0.5350999", "0.5350999", "0.5350999", "0.5350999", "0.53087956", "0.53087956", "0.53087956", "0.53087956", "0.53087956", "0.53087956", "0.53087956", "0.53087956", "0.53087956", "0.53087956", "0.53...
0.0
-1
displays the applicable team's logo if the user wins
function displayTeamLogo() { var teamLogoImgElement = document.createElement('img'); teamLogoImgElement.setAttribute('src', game.imgUrl); teamLogoElement.appendChild(teamLogoImgElement); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setTeamLogo(team){\n var logo = document.getElementById('logo');\n\n if (team){\n logo.src = '/static/img/'+team+'.svg';\n }\n else {\n logo.src = '/static/img/NFL.svg';\n }\n}", "displayWinner() {\n var winningPiece = game.isXTurn ? 'x' : 'o'\n if(game.singlep...
[ "0.66348463", "0.6508447", "0.6492891", "0.6305778", "0.6291713", "0.6288001", "0.62786627", "0.6266288", "0.6236114", "0.6235135", "0.61864746", "0.6158112", "0.6156759", "0.612372", "0.61211056", "0.6102502", "0.60912615", "0.6085351", "0.6070993", "0.6053503", "0.60490084"...
0.73233277
0
Initialize map from google API
function initMap(lat, lng) { // The location of user var currentPos = { lat: lat, lng: lng }; // The map, centered at Athens var map = new google.maps.Map(document.getElementById("googleMap"), { zoom: 15, center: currentPos }); // The marker, positioned at Athens var marker = new google.maps.Marker({ position: currentPos, map: map }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gmap_initialize() {\n var gmap_options = {\n center: new google.maps.LatLng(40, -80),\n zoom: 2,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\n gmap = new google.maps.Map(document.getElementById(\"hud_gca_api_gmap_canvas\"), gmap_options);\n }", ...
[ "0.78562695", "0.77401686", "0.77093166", "0.77093166", "0.7649136", "0.76373667", "0.7629684", "0.761697", "0.76127934", "0.7611841", "0.7599866", "0.7599786", "0.75382257", "0.75365853", "0.7534764", "0.7527984", "0.75078046", "0.75060475", "0.7505698", "0.74972254", "0.749...
0.0
-1
Normalize a port into a number, string, or false.
function normalizePort(val) { var port = parseInt(val, 10); if (isNaN(port)) { // named pipe return val; } if (port >= 0) { // port number return port; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "normalizePort(val){\n /**\n * Normalize a port into a number, string, or false.\n */\n var port = parseInt(val, 10);\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n if (port >= 0) {\n // port number\n return port...
[ "0.844777", "0.84337467", "0.8424202", "0.8402083", "0.83947915", "0.8393728", "0.83874613", "0.8383658", "0.8378447", "0.8378447", "0.83705056", "0.83705056", "0.83705056", "0.83705056", "0.83705056", "0.83705056", "0.83700824", "0.8367369", "0.83595544", "0.83580923", "0.83...
0.0
-1
Event listener for HTTP server "error" event.
function onError(error) { if (error.syscall !== 'listen') { throw error; } var bind = 'Port ' + _config2.default.port; // handle specific listen errors with friendly messages switch (error.code) { case 'EACCES': console.error(bind + ' requires elevated privileges'); process.exit(1); break; case 'EADDRINUSE': console.error(bind + ' is already in use'); process.exit(1); break; default: throw error; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function httpOnError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n var bind = typeof port === 'string'\n ? 'Pipe ' + port\n : 'Port ' + port;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(bind + '...
[ "0.7118962", "0.70567393", "0.70339364", "0.70246124", "0.6965733", "0.6882446", "0.68554044", "0.68311316", "0.6821094", "0.68109226", "0.6788116", "0.6782291", "0.6781704", "0.67701316", "0.6766919", "0.6750681", "0.6706457", "0.67013055", "0.66602784", "0.66561115", "0.664...
0.6252459
96
Event listener for HTTP server "listening" event.
function onListening() { _logs('访问地址: ' + _config2.default.secheme + '://ip:' + port + '/'); _logs('APIDoc: ' + _config2.default.secheme + '://ip:' + apiPort + '/'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onListeningHTTP () {\n var addr = server.address()\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port\n debug('HTTP - Listening on ' + bind)\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' +...
[ "0.78544015", "0.7739864", "0.7633661", "0.7536681", "0.75315416", "0.73415786", "0.7334293", "0.7303103", "0.7302585", "0.7283272", "0.7272347", "0.72310024", "0.7227042", "0.7161825", "0.7126399", "0.7120529", "0.7105088", "0.7097603", "0.70819986", "0.7073328", "0.70719254...
0.0
-1
Insert New Task in tasksList.
function insertNewTask() { let newTask = document.getElementById("input_new_task").value; let obj = {}; obj['id'] = taskCount; obj['task'] = newTask; obj['complete'] = false; tasksList.push(obj); taskCount += 1; const finalData = generateTasksList(); document.getElementById("divTasksList").innerHTML = finalData; document.getElementById("input_new_task").value = ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addNewTask() {\n let task = new Task(this.newTaskName);\n task.id = new Date().getMilliseconds();\n this.tasks.push(task);\n }", "addTask() {\n const input = qs('#addTask');\n saveTask(input.value, this.key);\n this.showList();\n }", "addTasks(newTask)\n {\n ...
[ "0.77697766", "0.7426801", "0.728805", "0.7199783", "0.71790403", "0.7094858", "0.7071875", "0.7058259", "0.7021646", "0.70001817", "0.6999043", "0.6934997", "0.6866519", "0.68363464", "0.68361723", "0.6806032", "0.67924535", "0.67410225", "0.6737746", "0.67236584", "0.667380...
0.72836643
3
On Enter Key Press insert New Task in tasksList.
function addTaskOnEnterKey(event) { if (event.keyCode === 13) { insertNewTask(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addListKeyPress(event) {\n if (inputlength() > 0 && event.which === 13) {\n addTask();\n }\n}", "function handAddTask(event) {\n\t\tif (event.keyCode == 13 && task !== \"\") {\n\t\t\t//&& task !== \"\" que no suceda cuando este vacio\n\t\t\tsetListarray([...listarray, task]);\n\t\t\tsetTask(\"\"); ...
[ "0.7899116", "0.7895434", "0.78518033", "0.75416124", "0.74918026", "0.7310466", "0.7134301", "0.7114583", "0.70830345", "0.70828706", "0.70443434", "0.69933313", "0.6978122", "0.6973019", "0.6920375", "0.69105357", "0.6903763", "0.68780893", "0.68568623", "0.6845173", "0.679...
0.844476
0
On Task Checkox click update status of task in taskList.
function onClickTaskComplete(object) { var task_index = object.getAttribute('task_index'); if (object.checked) { tasksList[Math.abs((tasksList.length - 1) - task_index)].complete = true; document.getElementById("task_label_" + task_index).setAttribute('class', 'submited_task'); } else { tasksList[Math.abs((tasksList.length - 1) - task_index)].complete = false; document.getElementById("task_label_" + task_index).classList.remove('submited_task'); } console.log(tasksList); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateTask(event) {\n //obtengo el li que contiene el checkbox correspondiente, para ello tengo que subir en el arbol de nodos al label -> div -> li (tres parentNode)\n const taskUpdate = event.target.parentNode.parentNode.parentNode;\n taskUpdate.classList.toggle('completed');\n\n const taskL...
[ "0.7744968", "0.76197976", "0.75789", "0.7467579", "0.73939073", "0.7386255", "0.7238165", "0.71934867", "0.71898896", "0.71831065", "0.71822727", "0.7014042", "0.6979668", "0.69684696", "0.6965662", "0.69301486", "0.69209826", "0.6884836", "0.68731713", "0.6864766", "0.68099...
0.6825553
20
On Delete Task remove entry from taskList
function removeTask(object) { var task_index = Number(object.getAttribute('task_index')); let id = Math.abs((tasksList.length - 1) - task_index); tasksList = tasksList.filter((val, index) => index != id); const finalData = generateTasksList(); document.getElementById("divTasksList").innerHTML = finalData; console.log(tasksList); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeTask () {\n\t\tthis.deleter.addEventListener('click', (e) => {\n\t\t\tfetch('/items/'+e.target.parentNode.parentNode.parentNode.childNodes[0].getAttribute('data-task'), {\n\t\t\t\tmethod: 'DELETE',\n\t\t\t\theaders: {\n\t\t\t\t'Accept': 'application/json',\n\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\...
[ "0.7976981", "0.7909987", "0.788778", "0.7825424", "0.78162783", "0.77812", "0.7768622", "0.77619195", "0.7731133", "0.7730132", "0.772569", "0.7709987", "0.76829433", "0.76593316", "0.76538503", "0.7620478", "0.75577915", "0.7534472", "0.75315106", "0.7492437", "0.74846405",...
0.7057204
52
Dynamically generate(Reverse Order) Todo Tasks List using todoList.
function generateTasksList() { var finalData = ""; if (tasksList.length === 0) { finalData += "<span class='item_list_empty'>No Data Found</span>"; } else { tasksList.slice(0).reverse().map((val, index) => { finalData += "<div class='item_container'>"; finalData += (val.complete) ? ("<input type='checkbox' task_index = '" + index + "' onclick = 'onClickTaskComplete(this);' checked></input>") : ("<input type='checkbox' task_index = '" + index + "' onclick = 'onClickTaskComplete(this);'></input>"); finalData += "<div class='item'>"; finalData += (val.complete) ? ("<label id ='task_label_" + index + "' class=' submited_task item_task' task_index = '" + index + "' >" + val.task + "</label>") : ("<label id ='task_label_" + index + "' class='item_task' task_index = '" + index + "' >" + val.task + "</label>"); finalData += "</div><button id='btn_delete_" + index + "' task_index = '" + index + "' class='btn btn-danger btn_circle' onclick='removeTask(this);'><i class='fa fa-remove'></i></button></div><br/>"; }) } return finalData; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderToDoList() {\n\tif (!data.openTasks.length && !data.doneTasks.length) return; \n\n\tfor (var i=0; i < data.openTasks.length; i++) {\n\t\tvar value = data.openTasks[i]; \n\t\tcreateListElement(value); \n\t}\n\n\tfor (var j=0; j < data.doneTasks.length; j++) {\n\t\tvar value = data.doneTasks[j]; \n\t\...
[ "0.64874065", "0.64248204", "0.6282865", "0.62588745", "0.6252901", "0.6214843", "0.6179592", "0.61689544", "0.6135963", "0.61323", "0.61239034", "0.61134326", "0.60962015", "0.60582924", "0.60382116", "0.6036122", "0.60303396", "0.6019807", "0.6004692", "0.59897643", "0.5988...
0.70149136
0
On Button(Add New Task) click add new task in taskList.
function onclick_add_new_task() { insertNewTask(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addTask() {\n const input = qs('#addTask');\n saveTask(input.value, this.key);\n this.showList();\n }", "function addNewTask() {\n buttonAdd.onclick = function () {\n if (!newText.value || !newText.value.trim()) return alert('Please, input your text')\n newCon...
[ "0.8337535", "0.79939234", "0.7958698", "0.7857301", "0.78377897", "0.7768781", "0.7712337", "0.77026224", "0.7657753", "0.7639688", "0.7626981", "0.7617909", "0.75667524", "0.7559644", "0.75445503", "0.752365", "0.7522109", "0.75170773", "0.7467777", "0.74600327", "0.7394873...
0.8252214
1
importamos el modulo math de Node Funcion registro de usuario
function crearUsuario(req, res){ // Instanciar el objeto Usuario var usuario = new Usuario(); // Guardar el cuerpo de la petición para mejor acceso de los datos que el usuario esta enviando // parametros = {"nombre": "", "apellido": "", "correo": "", "contraseña": ""} var parametros = req.body; // usuario.nombre = parametros.nombre; usuario.apellido = parametros.apellido; usuario.correo = parametros.correo; usuario.contrasena = parametros.contrasena; usuario.rol = "usuario"; usuario.imagen = null; // Guardar y validar los datos // db.coleccion.insert() usuario.save((err, usuarioNuevo)=>{ if(err){ // El primner error a validar sera a nivel de servidor e infraestructura // para esto existen states o estados. res.status(500).send({ message: "Error en el servidor"}); } else { if(!usuarioNuevo){ // 404 -> Pagina no encontrada // 200 -> Ok pero con una alerta indicando que los datos invalidos res.status(200).send({message: "No fue posible realizar el registro"}); } else { res.status(200).send({usuario: usuarioNuevo}); } } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function miFuncion(x) {\n\n return this.numero + x;\n\n}", "function calcularModificador(atributoDoPersonagem) {\n switch(atributoDoPersonagem) {\n case 1:\n return -5;\n case 2:\n case 3:\n return -4;\n case 4:\n case 5:\n return -3;\n ...
[ "0.5832369", "0.56464946", "0.5642811", "0.5607719", "0.5607719", "0.5573431", "0.5510408", "0.54982203", "0.54923147", "0.54798037", "0.54572386", "0.5440211", "0.54348415", "0.5391405", "0.5386858", "0.5377617", "0.53672373", "0.5365382", "0.53635323", "0.5362833", "0.53578...
0.0
-1
QUERY HOOKS ============== Handle EINs entered in searchbox with a hyphen
function checkForEIN(query) { // Base Regex: /^[0-9]{2}\-\d{7}$/g; // Assume query is an EIN as soon as 2 digits entered after hyphen const regexEIN = /^[0-9]{2}\-\d{2}/g; const isEIN = regexEIN.test(query); if (query.includes('-') && isEIN) { // TODO Will remove hyphen if query ALSO includes prohibit string (e.g. -foo 12-3456789) // TODO Add toast - will assist with any confusion caused by routing:true setting... // ...which autoupdates the url withOUT the hyphen return query.replace('-', ''); } else { return query; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function find() {\n\t\tvar query = $(\"#search-query\").val();\n\n\t\t// check to see if the query contains special commands/characters\n\t\tconvert(query);\n\t\t\n\n\t\tfindSimilar(query);\n\t}", "function onclickForSearchButton(event)\n{\n //console.log(event);\n \n var q = document.getElementById('s...
[ "0.6322071", "0.621991", "0.6169624", "0.6051427", "0.6011501", "0.6002951", "0.5973564", "0.5969841", "0.59556997", "0.5943398", "0.5936501", "0.5934831", "0.5934831", "0.5934475", "0.593071", "0.59167784", "0.5892831", "0.5891771", "0.587088", "0.58456606", "0.5842515", "...
0.76369286
0
Scroll to top of results upon input change
function readyToSearchScrollPosition() { window.scrollTo({ 'top': scrollAnchor.offsetTop, 'left': 0, 'behavior': 'auto', }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "prev(){\n // if is something in search input use search items array\n if (this.searchInput.select) {\n this.page.curSearch--\n this.searchItems()\n // else use discover items array\n } else {\n this.page.cur--\n ...
[ "0.7245843", "0.6939738", "0.69197553", "0.68943894", "0.6888375", "0.6706393", "0.66839665", "0.6676499", "0.66613805", "0.66533077", "0.66514295", "0.6613817", "0.6611374", "0.6609914", "0.6606437", "0.6604138", "0.6599643", "0.6581915", "0.6562748", "0.6522661", "0.6520139...
0.66537535
9
MISC HELPER FUNCTIONS ==============
function addOrRemoveSearchableAttributes(array, value) { const tmpArr = array; let index = array.indexOf(value); if (index === -1) { array.push(value); } else { array.splice(index, 1); } // Ensure at least one item is checked if (array.length < 2) { // grantee_state will always be there return tmpArr; } else { return array; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Utils() {}", "function Utils() {}", "function Utils(){}", "function DWRUtil() { }", "function Helper() {}", "function Util() {}", "function _____SHARED_functions_____(){}", "function AeUtil() {}", "private public function m246() {}", "function Utils() {\n}", "private internal function ...
[ "0.66913146", "0.66913146", "0.664309", "0.65058887", "0.6456344", "0.6429516", "0.6410632", "0.6331179", "0.6216189", "0.61430305", "0.61326295", "0.61154604", "0.6034693", "0.6007874", "0.59845966", "0.5828076", "0.58019143", "0.5797007", "0.5756064", "0.5749839", "0.573796...
0.0
-1
Lazy Load Iubenda script =======================================================
function createIubendaObserver() { let observer; let anchor = document.querySelector('footer'); let config = { 'rootMargin': '0px 0px', 'threshold': 0.01, }; // Initiate observer using Footer as anchor observer = new IntersectionObserver(enableIubenda, config); observer.observe(anchor); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initScripts() {\n breakpoint();\n lazyload();\n heroSlider();\n categoriesMobile();\n asideLeftMobile();\n scrollRevealInit();\n seoSpoiler();\n mobileMenuOverflowScroll();\n}", "function main() {\r\n\t// Init the myGM functions.\r\n\tmyGM.init();\r\n\r\n\t// If the script was already executed, ...
[ "0.66469276", "0.6499904", "0.6403356", "0.6391777", "0.63895315", "0.6373584", "0.6310782", "0.62787026", "0.62380725", "0.6224486", "0.61772996", "0.61707455", "0.6166367", "0.60873365", "0.607238", "0.6067699", "0.6046247", "0.6029225", "0.60228837", "0.60069245", "0.60013...
0.0
-1
Score Variable shuffle cards array and set shuffled array
function shuffle() { shuffleCards = cards.sort(function(a,b){return 0.5 - Math.random()}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "shuffleCards() {\n let random = 0;\n let temp = 0;\n for (i = 1; i < game.cards.length; i++) {\n random = Math.round(Math.random() * i);\n temp = game.cards[i];\n game.cards[i] = game.cards[random];\n game.cards[random] = temp;\n }\n game.assignData();\n \n }", "function shu...
[ "0.781474", "0.7580647", "0.7545311", "0.7463803", "0.74239177", "0.73819745", "0.7297277", "0.7278385", "0.72592473", "0.72563887", "0.72246885", "0.721764", "0.7212266", "0.7189208", "0.7169882", "0.7162499", "0.7146707", "0.70534694", "0.7052814", "0.704237", "0.7040915", ...
0.73780113
6
function that checks for a match and adds to score
function checkForMatch() { if (cardsInPlay.length === 2) { if (cardsInPlay[0] === cardsInPlay[1]) { alert("You found a Match!"); score++; document.getElementById('score').textContent = score; } else { alert("Sorry, try again."); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function match(known_value, search_term) {\r\n\t// reset a few important variables to zero\r\n\traw_spedis_score = 0; spedis_score = 0; lev_score = 1;\r\n\tsxscore1 = \"\"; sxscore2 = \"\"; sxmatch = 0; matchscore = 0;\r\n\t// check if they exactly match, in which case skip the calculations!\r\n\tif (known_value =...
[ "0.72660726", "0.687104", "0.6863067", "0.6853576", "0.676838", "0.6693016", "0.6663896", "0.661513", "0.65731484", "0.6540277", "0.6520258", "0.6513545", "0.6493525", "0.649186", "0.64914566", "0.64897853", "0.6485571", "0.6471018", "0.6463342", "0.64352846", "0.64035124", ...
0.6810238
4
function that relates the cardId to an index in the shuffled array, sets the image and funs the match check
function flipCard() { var cardId = this.getAttribute('data-id'); /* Debug -------- console.log("You flipped " + shuffleCards[cardId].rank + "."); console.log(shuffleCards[cardId].suit); console.log(shuffleCards[cardId].cardImage); */ cardsInPlay.push(shuffleCards[cardId].rank); this.setAttribute('src', shuffleCards[cardId].cardImage); checkForMatch(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cardFlip () {\n //this.classList.add('flipped') //give class to keep CSS\n const cardId = this.getAttribute('Id') //get id # to set bottom card/match\n console.log(cardId)\n //need id of getId to find matching id from array (element position)\n this.setAttribute('src', `./images/card${cardI...
[ "0.7384254", "0.73086804", "0.6935616", "0.6923473", "0.6801952", "0.679077", "0.67337126", "0.6687502", "0.6679658", "0.6656756", "0.6655947", "0.66548336", "0.6612141", "0.66083765", "0.6573074", "0.6568477", "0.65608865", "0.65406847", "0.6534259", "0.6519824", "0.6516414"...
0.6367538
30
function that creates the gameboard elements referencing the length of the cards array, adds the id and click event listener
function createBoard() { for (i = 0; i < cards.length; i++) { var cardElement = document.createElement('img'); cardElement.setAttribute('src', 'images/back.png'); cardElement.setAttribute('data-id', i); cardElement.addEventListener('click', flipCard); document.getElementById('game-board').appendChild(cardElement); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createBoard() {\n for(let i = 0; i < cardArray.length; i++){\n var card = document.createElement('img')\n\n card.setAttribute('src', 'images/pokeball.png') // giving a \"style\" and its value - black is the back of the card\n card.setAttribute('data-id', i)\n\n ...
[ "0.7777658", "0.77560633", "0.77040654", "0.77017087", "0.76292866", "0.7617252", "0.7609963", "0.75762135", "0.755554", "0.7528606", "0.74824196", "0.7481658", "0.7479096", "0.74525815", "0.7433708", "0.74336857", "0.73769796", "0.7287076", "0.7268543", "0.72262454", "0.7178...
0.75315344
9
reset function, changes img to backs, and wipes the cards in play
function resetFunc() { var cardArray = document.getElementsByTagName('img'); for (i = 0; i < cardArray.length; i++) { cardArray[i].setAttribute('src', 'images/back.png'); } cardsInPlay = []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetCards(){\n\t\t\t\tselectedOdd.src = \"bearback.jpg\"\n\t\t\t\tselectedEven.src = \"bearback.jpg\"\n\t\t\t\tselectedOdd = null;\n selectedEven = null; \n timerOn = false; \n //Will remove timer, then user can resume the game. \n window.clearI...
[ "0.8342347", "0.82801455", "0.80494064", "0.79560626", "0.7934626", "0.78431875", "0.781149", "0.77682674", "0.77416027", "0.7710266", "0.76985663", "0.7653253", "0.7624593", "0.7603284", "0.7527799", "0.7518257", "0.7495085", "0.7489263", "0.7466037", "0.74349135", "0.742644...
0.8445453
0
Shuffle function does the same as reset with shuffle involved as well
function shuffleFunc() { resetFunc(); shuffle(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "shuffle() {\n // TODO\n }", "shuffle() {\n for (var i = this._deck.length - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * (i + 1));\n var temp = this._deck[i];\n this._deck[i] = this._deck[j];\n this._deck [j] = temp;\n }\n }", "shuffle()\n\t{\n\t\tlet temp;\n\t\tle...
[ "0.801566", "0.77262646", "0.76398546", "0.7610369", "0.7523084", "0.74649537", "0.7463079", "0.7451059", "0.7438878", "0.74300104", "0.74195415", "0.7409581", "0.73898494", "0.7378674", "0.73700774", "0.7367741", "0.7349255", "0.7308936", "0.7299316", "0.72966886", "0.728294...
0.80238956
0
static API_ADDRESS = '
function HttpApiService(http) { this.http = http; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static get API_URL() {\r\n const port = 1337; // Change this to your server port\r\n return `http://localhost:${port}/`;\r\n }", "static get API_URL(){\n\t\tconst port = 8081;\n\t\treturn `http://localhost:${port}`\n\t}", "static get API_URL() {\n const port = 1337; // Change this to yo...
[ "0.7679229", "0.76224905", "0.76219505", "0.7297923", "0.7104186", "0.6986184", "0.6906008", "0.69051623", "0.6865523", "0.6758331", "0.6725578", "0.67111385", "0.6624466", "0.66036487", "0.6599575", "0.6584151", "0.6576798", "0.6576798", "0.6573657", "0.65618455", "0.6556057...
0.0
-1
Adds border of color depending on each alert's status on left side of each list item
function getListItemStatus(s) { switch (s) { case 'StatusAcknowledged': return 'warn' case 'StatusUnacknowledged': return 'err' case 'StatusClosed': return 'ok' } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayStatusColor ($group) {\n $group.find('.cmb-group-title').each(function () {\n var $this = $(this);\n var status = $this.next().find('[id$=\"status\"] option:selected').text();\n if (status) {\n var $parent = $this.parents('.cmb2-wrap.form-table...
[ "0.56633437", "0.56244004", "0.55653024", "0.5555771", "0.5451087", "0.54466873", "0.5383758", "0.5317974", "0.52989113", "0.52874887", "0.52812505", "0.52554566", "0.5181292", "0.51353246", "0.5130881", "0.5121103", "0.51172745", "0.5106437", "0.5091735", "0.50798875", "0.50...
0.5363318
7
Gets the header to display above the list to give a quick overview on if they are viewing alerts for all services or only their favorited services. Possibilities: Home page, showing alerts for all services Home page, showing alerts for any favorited services and notified alerts Services page, alerts for that service
function getHeaderNote() { const { favoritesOnly, includeNotified } = variables.input if (includeNotified && favoritesOnly) { return `Showing ${filter} alerts you are on-call for and from any services you have favorited.` } if (allServices) { return `Showing ${filter} alerts for all services.` } if (props.serviceID && serviceNameQuery.data?.service?.name) { return `Showing ${filter} alerts for the service ${serviceNameQuery.data.service.name}.` } return null }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getHeader() {\n return This.headerTpl({\n date: date,\n teams: teams\n });\n }", "viewHeader() {\n\t\tif (this.state.page === \"Info\") {\n\t\t\tif (this.state.page === \"Info\") {\n\t\t\t\treturn (\n\t\t\t\t\t<div>Getting Started</div>\n\t\t\t\...
[ "0.584325", "0.5758501", "0.56495047", "0.5590754", "0.55593395", "0.55400544", "0.5511161", "0.5413188", "0.541224", "0.5384257", "0.5368736", "0.5340161", "0.53301626", "0.52918506", "0.5262265", "0.5225106", "0.5218821", "0.52079785", "0.52040243", "0.5198885", "0.51890826...
0.6235454
0
Passes the proper actions to ListControls depending on which tab is currently filtering the alerts list
function getActions() { const actions = [] if (filter !== 'closed' && filter !== 'acknowledged') { actions.push({ icon: <AcknowledgeIcon />, label: 'Acknowledge', onClick: makeUpdateAlerts('StatusAcknowledged'), }) } if (filter !== 'closed') { actions.push( { icon: <CloseIcon />, label: 'Close', onClick: makeUpdateAlerts('StatusClosed'), }, { icon: <EscalateIcon />, label: 'Escalate', onClick: makeUpdateAlerts('StatusUnacknowledged'), }, ) } return actions }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onListBoxAction (data) {\n if (data.index < 0) return;\n\n switch (data.action) {\n case 'navigate':\n if (debug) console.log(`navigate: ${data.index}`);\n updateButton(false);\n break;\n case 'activate':\n if (debug) console.log(`activate: ${data.index}`)\n sendButtonActi...
[ "0.59621215", "0.5920585", "0.58055854", "0.5698286", "0.5674853", "0.55854994", "0.5548058", "0.5524902", "0.55244935", "0.552068", "0.5477944", "0.5459252", "0.54030263", "0.54017365", "0.5384792", "0.53840965", "0.5382668", "0.5337101", "0.53353786", "0.5330947", "0.532730...
0.0
-1
can't use beforeEach b/c some tests include multiple requests, in between each of which we need to call this.
function reset() { resSpy.status.reset(); unauthenticatedHandler.reset(); unauthorizedHandler.reset(); routeHandler.reset(); firewallAdapter.reset(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "beforeAll() {}", "beforeEach() {}", "function commonBeforeSteps() {\n cy.stubAuth();\n cy.login({ isStubbed: true });\n cy.stubRequest({\n url: `api/v1/billing/subscription`,\n fixture: 'billing/subscription/200.get.json',\n requestAlias: 'billingReq',\n });\n cy.stubRequest({\n url: 'api/v1/a...
[ "0.731295", "0.71643686", "0.685737", "0.6684625", "0.6493349", "0.64181364", "0.6324952", "0.63198364", "0.6247152", "0.6150687", "0.6052109", "0.604136", "0.5993027", "0.5988895", "0.5986733", "0.5959852", "0.5921636", "0.59150916", "0.58547735", "0.58437544", "0.5820899", ...
0.0
-1
The express router doesn't let us register a callback to run when the last middleware is done. So, instead, we have our final handlers trigger events, which we listen to in the fns below. Note: the Router will let you provide a callback that's run if next() is called from the last middleware ( but some of our final functions (i.e. the unauthenticated/unauthorizedHandlers) are inten tionally called without next as an argument, to make sure the user doesn't accidentally let the request through the firewall. Hence our EventEmitter test pattern.
function expectStatusPromise(req, status, additionalExpectations) { return Q.promise(function(resolve, reject) { reset(); emitter.once('done', function() { try { expect(routeHandler.callCount).to.equal(status === 200 ? 1 : 0); expect(unauthenticatedHandler.callCount).to.equal(status === 401 ? 1 : 0); expect(unauthorizedHandler.callCount).to.equal(status === 403 ? 1 : 0); if(status !== 200) { expect(resSpy.status.calledWith(status)).to.be.true; } if(typeof additionalExpectations == 'function') { additionalExpectations(); } resolve(); } catch(e) { reject(e); } }); //dispatch the request mainRouter(req, resSpy); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addRoutes(app) {\n\n app.all('*', (req, res, next) => {\n console.log(req.method + ' ' + req.url);\n next();\n });\n\n //register users\n /*\n param 1: api endpong\n param 2: middleware that uses a controller function \n */\n app.post('/api/register', authCont...
[ "0.6111899", "0.6021228", "0.59849405", "0.594324", "0.5840282", "0.5802005", "0.5753676", "0.5717004", "0.5644498", "0.5612919", "0.55918926", "0.5570199", "0.5565379", "0.555367", "0.5545879", "0.5545879", "0.5544523", "0.5480617", "0.54683644", "0.5458201", "0.54506254", ...
0.0
-1
==== Button Events : Main ====
function click_lyrMenu_업로드(ui) { var args = { targetid: "lyrServer", control: { by: "DX", id: ctlUpload } }; gw_com_module.uploadFile(args); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleButton() {}", "_buttonClickHandler() { }", "function onButton(){\n input();\n output();\n\n}", "function addButtonEvent() {\n\t\t\tbtnList.begin.click(API.begin);\n\t\t\tbtnList.fastBackward.click(function () {API.backward(FAST_STEP_NUM); });\n\t\t\tbtnList.backward.click(function () {API.backwar...
[ "0.7730056", "0.7438477", "0.72790486", "0.7250599", "0.7226155", "0.7060203", "0.70438385", "0.7027095", "0.694591", "0.6932067", "0.6881592", "0.6870841", "0.6844013", "0.6800175", "0.67989445", "0.67986614", "0.67956746", "0.6793432", "0.6785744", "0.6775591", "0.67663187"...
0.0
-1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ custom function. (program section) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function processRetrieve(param) { var args = { source: { type: "INLINE", argument: [ { name: "arg_file_id", value: param.key } ] }, target: [ { type: "GRID", id: "grdData_List", focus: true, select: true } ], key: param.key, handler_complete: processRetrieveEnd }; gw_com_module.objRetrieve(args); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Main()\n {\n \n }", "setupProgram(program) {\n }", "function main(){\n\n\n}", "function main(){\n\t\n}", "function main(){\r\n}", "function main() {\n\n}", "enterProgram(ctx) { console.log(\" %s: %s\", __function, ctx.getText()); }", "function ma...
[ "0.6757153", "0.6700883", "0.6666861", "0.65191114", "0.639497", "0.6344665", "0.628618", "0.6256723", "0.618383", "0.6167291", "0.6058424", "0.59891564", "0.592637", "0.5900733", "0.57633436", "0.5745933", "0.57458955", "0.5701986", "0.56928945", "0.56871843", "0.5686595", ...
0.0
-1
=========================== GESTION ADMIN ===========================
function showDashboard(){ //Cache la div create film $("#divFormFilm").hide(); $.ajax({ method: "POST", url:"template/dashboard.php", }).done((template)=>{ //Attache le contenu dans la div avec l'ID (contenu) $("#contenu").html(template); //rendreInvisible(contenu); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showAdmin(){\n addTemplate(\"admin\");\n userAdmin();\n}", "function getAdminStuff(){\n FactoryFactory.getAdminBlanks();\n FactoryFactory.getAdminThreads();\n }", "function GivenIAmAnAdmin() {}", "check_admin_status() {}", "_handleButtonAddAdmin()\n {\n Radio.channel('rodan').re...
[ "0.6848675", "0.6670162", "0.6404349", "0.6396092", "0.6357295", "0.6251403", "0.6251403", "0.623631", "0.6082457", "0.6002477", "0.6002477", "0.5930422", "0.59232694", "0.59164846", "0.58865255", "0.5866203", "0.5841901", "0.5838665", "0.5818297", "0.5786009", "0.576557", ...
0.0
-1
=========================== GESTION FILM ===========================
function listerFilms() { var action = 'action=select'; //console.log(action); $.ajax({ method: "POST", url:"../../controller/filmController.php", data: action }).done((jsonString)=>{ //Va creer le template $.ajax({ method: "POST", url:"../admin/template/table-films.php", data:{ data: jsonString } //Recoit le template }).done((template)=>{ $("#contenu").html(template); }) }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadGCI() {\n return fs.readFileSync('gci.txt','utf8')\n }", "function gd(){}", "function gfg() {}", "function GCodeImporter() {}", "toGist() {\n let files = {}\n const pages = this.pages.filter(p => p.content) // gist does not accept empty files, TODO: consider giving feedback...
[ "0.6001151", "0.59604645", "0.5841547", "0.5629736", "0.5512383", "0.55115086", "0.545925", "0.545925", "0.54518276", "0.54190916", "0.54000306", "0.53849006", "0.5359195", "0.53281635", "0.53125703", "0.5287873", "0.5277028", "0.52446914", "0.5232487", "0.523168", "0.5220214...
0.0
-1