jQuery.fn.extend( { prop: function( name, value ) { return access( this, jQuery.prop, name, value, arguments.length > 1 ); }, removeProp: function( name ) { return this.each( function() { delete this[ jQuery.propFix[ name ] || name ]; } ); } } );
result.forEach(function (item, i) { var itemStr = item.toString().split(',').join('') if (!_.hash[itemStr]) { _.queue.push(item) _.hash[itemStr] = item _.prevVertx[itemStr] = currentNodeStr } })
describe('Split sentence', () => { test('Should split a sentence into tokens', () => { const input = "This isn't tokenized, maybe."; const tokenizer = new BertWordPieceTokenizer({ vocabContent: vocabEn }); const actual = tokenizer.splitSentence(input); expect(actual.length).toEqual(11); expect(actual[0].token).toEqual('This'); expect(actual[6].start).toEqual(11); expect(actual[6].end).toEqual(19); expect(actual[6].type).toEqual('word'); }); });
setInterval(function() { try { self.poll(); } catch (e) { // We can probably ignore errors here as far as broadcasting. // Disconnection issues will get handled below } }, interval).unref()
answersSet.tablePivot().map((item) => { dataAnswers['features'].push({ type: 'Feature', geometry: JSON.parse(item['Users.geometry']), }); });
function randomColor() { return `#${Math.random() .toString(16) .substr(-6)}` }
const nextId = () => { const currentId = parseInt(window.localStorage.getItem("customReportCounter"), 10) || 1; window.localStorage.setItem("customReportCounter", currentId + 1); return currentId.toString(); }
function FieldContext(parser, parent, invokingState) { if(parent===undefined) { parent = null; } if(invokingState===undefined || invokingState===null) { invokingState = -1; } antlr4.ParserRuleContext.call(this, parent, invokingState); this.parser = parser; this.ruleIndex = GenericSqlParser.RULE_field; return this; }
util.request({ url: 'http://resspeed.test.whistlejs.com/', body: util.getTextBySize(128 * 2 + 1), method: 'post' }, function(res, data) { now = Date.now() - now; now.should.above(2000); });
customValidator(value) { if (value && value.length) { const base64ImageLength = Buffer.byteLength(value.substring(value.indexOf(',') + 1), 'base64'); if (base64ImageLength > MAX_SIZE_PROFILE_PICTURE) { throw new Error('Profile picture too big'); } } }
const Title = props => ( <h2 css={{ fontSize: fontSizes.md, margin: 0, }} {...props} /> )
function guidFor(str) { const hash = fnv1a(str).toString(); let slug = slugify(sanitize(str)); // Max the slug at 100 char slug = slug.substring(0, 100 - hash.length - 1); return `${slug}_${hash}`; }
const Subtitle = ({ horizontalMargin, ...props }) => ( <div css={{ fontSize: fontSizes.md, fontWeight: 'bold', textTransform: 'uppercase', }} {...props} /> )
customValidator(value) { if (value && value.length) { const base64ImageLength = Buffer.byteLength(value.substring(value.indexOf(',') + 1), 'base64'); if (base64ImageLength > MAX_SIZE_PROFILE_PICTURE) { throw new Error('Profile picture too big'); } } }