// Component const Loading = (props) => ( <View style={styles.container}> <ActivityIndicator size={props.size} color={secondary} /> <Text style={styles.text}>{ props.message }</Text> </View> )
/** * Initialize a new `Progress` indicator. */ function Progress() { this.percent = 0; this.size( 0 ); this.fontSize( 11 ); this.font( 'helvetica, arial, sans-serif' ); }
function weightedSumRelu(weights, biases, inputs) { let sum = biases[this.thread.x]; for (let k = 0; k < this.constants.size; k++) { sum += weights[this.thread.x][k] * inputs[k]; } // relu return sum < 0 ? 0 : sum; }
_remove(user) { if (this.partial) return; this.users.cache.delete(user.id); if (!this.me || user.id !== this.message.client.user.id) this.count--; if (user.id === this.message.client.user.id) this.me = false; if (this.count <= 0 && this.users.cache.size === 0) { this.message.reactions.cache.delete(this.emoji.id || this.emoji.name); } }
var setUnzipSize = function(body, obj) { var len = body ? body.length : -1; if (len >= 0 && len !== obj.size) { obj.unzipSize = len; } }
test('process webp image', async () => { const files = await process(['image.webp']) const { type, width, height } = imageSize.sync(files[0].buffer) const fromStats = await fs.stat(files[0].filePath) const toStats = await fs.stat(files[0].destPath) expect(type).toEqual('webp') expect(width).toEqual(550) expect(height).toEqual(368) expect(toStats.size).toBeLessThan(fromStats.size) })
/* * Helper to get dynamic service keys for stripping */ const getDynamicKeys = (answer, answers = {}) => _(answers) .map((value, key) => ({key, value})) .filter(data => data.value === answer) .map(data => data.key) .map(key => (_.size(key) === 1) ? `-${key}` : `--${key}`) .value()
toArray() { const { utils } = require('./utils'); const [w, h, d] = this.size; if (d) { return utils.erectMemoryOptimized3DFloat(this.value.subarray ? this.value : new Float32Array(this.value), w, h, d); } else if (h) { return utils.erectMemoryOptimized2DFloat(this.value.subarray ? this.value : new Float32Array(this.value), w, h); } else { return this.value; } }
const getSize = function (parentSize, itemPosition) { const position = normalizePosition(itemPosition.position); if (_.has(position, "size")) { return position.size; } // Prevent last growing view from overflowing screen const round = itemPosition.offset.grow + position.grow === itemPosition.summary.grow ? Math.floor : Math.ceil; return round( (parentSize - itemPosition.summary.size) * position.grow / itemPosition.summary.grow ); }
emotion(A.ActionIcon)({ ...size(12) }, ({favorite}) => ({ ...favorite && { color: 'gold', '&:hover':{ color: '#ff8d04', } } }))
util.readFile(file, function(data) { self.reading = false; self.localFileData = data; self.setState({ filename: file.name || 'unknown', fileData: data, fileSize: file.size, fileType: file.type }); });
get hasPending() { /* Although the pending map is bucketed by recordingId, the bucket will always be created with a single item in it so we can assume that if a bucket exists, then it has items in it. */ return this.pending.size > 0; }
test('process webp image', async () => { const files = await process(['image.webp']) const { type, width, height } = imageSize.sync(files[0].buffer) const fromStats = await fs.stat(files[0].filePath) const toStats = await fs.stat(files[0].destPath) expect(type).toEqual('webp') expect(width).toEqual(550) expect(height).toEqual(368) expect(toStats.size).toBeLessThan(fromStats.size) })