code
stringlengths 122
4.99k
| label
int64 0
14
|
---|---|
diff --git a/src/components/Button.js b/src/components/Button.js @@ -46,8 +46,15 @@ const Button = React.createClass({
style={Object.assign({}, styles.component, styles[this.props.type], this.props.style)}
>
<div style={styles.children}>
- {(this.props.icon && !this.props.isActive) ? <Icon size={20} style={styles.icon} type={this.props.icon} /> : null}
- {this.props.isActive ? (
+ {(this.props.icon && !this.props.isActive) && (
+ <Icon
+ elementProps={{ 'aria-hidden': true }}
+ size={20}
+ style={styles.icon}
+ type={this.props.icon}
+ />
+ )}
+ {this.props.isActive && (
<Spin direction='counterclockwise'>
<Icon elementProps={{ 'aria-hidden': true }} size={20} type='spinner' />
</Spin>
| 12 |
diff --git a/samples/chat/js/login.js b/samples/chat/js/login.js @@ -108,8 +108,7 @@ Login.prototype.renderLoginPage = function(){
helpers.clearView(app.page);
app.page.innerHTML = helpers.fillTemplate('tpl_login', {
- version: QB.version,
- buildNumber: QB.buildNumber
+ version: QB.version + ':' + QB.buildNumber
});
this.isLoginPageRendered = true;
this.setListeners();
| 3 |
diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/keyboard.js b/packages/node_modules/@node-red/editor-client/src/js/ui/keyboard.js @@ -625,7 +625,7 @@ RED.keyboard = (function() {
pane.find("#red-ui-settings-tab-keyboard-filter").searchBox({
delay: 100,
change: function() {
- var filterValue = $(this).val().trim();
+ var filterValue = $(this).val().trim().toLowerCase();
if (filterValue === "") {
shortcutList.editableList('filter', null);
} else {
| 9 |
diff --git a/test/spec/util/tile-error-collection.spec.js b/test/spec/util/tile-error-collection.spec.js @@ -10,9 +10,9 @@ describe('util/tile-error-collection', function () {
this.error = { type: 'limit', message: 'Some message' };
this.tiles = [
- new Backbone.Model({ url: 'some_url/0/0/0/1.png', node: new Image() }),
- new Backbone.Model({ url: 'some_url/0/0/0/2.png', node: new Image() }),
- new Backbone.Model({ url: 'some_url/0/0/0/3.png', node: new Image(), error: this.error })
+ new Backbone.Model({ url: 'some_url/0/0/0/1.png', node: {} }),
+ new Backbone.Model({ url: 'some_url/0/0/0/2.png', node: {} }),
+ new Backbone.Model({ url: 'some_url/0/0/0/3.png', node: {}, error: this.error })
];
this.collection = new TileErrorCollection(this.tiles);
@@ -39,10 +39,11 @@ describe('util/tile-error-collection', function () {
describe('on add event', function () {
var tile = {
url: 'some_url/0/0/0/4.png',
- node: new Image()
+ node: {}
};
it('should set the error tile overlay when a new model is added', function () {
+ spyOn(document.body, 'contains').and.returnValue(true);
this.collection.add(tile);
var model = _.last(this.collection.models);
expect(model.get('node').src.indexOf('data:image/svg+xml;base64,')).not.toBe(-1);
@@ -97,7 +98,7 @@ describe('util/tile-error-collection', function () {
expect(this.collection.running).toBe(false);
this.collection.running = true;
- this.collection.queue.add({ url: 'somethig.png', tile: new Image(), checked: true });
+ this.collection.queue.add({ url: 'somethig.png', tile: {}, checked: true });
this.collection._getTileErrors();
expect(this.collection.running).toBe(false);
@@ -115,7 +116,7 @@ describe('util/tile-error-collection', function () {
});
it('should remove the model from the queue', function () {
- this.collection.queue.add({ url: 'somethig.png', tile: new Image() });
+ this.collection.queue.add({ url: 'somethig.png', tile: {} });
this.collection._getTileErrors();
expect(this.collection.queue.length).toEqual(0);
@@ -124,7 +125,7 @@ describe('util/tile-error-collection', function () {
it('should call ._getTileErrors()', function () {
spyOn(this.collection, '_getTileErrors').and.callThrough();
- this.collection.queue.add({ url: 'somethig.png', tile: new Image() });
+ this.collection.queue.add({ url: 'somethig.png', tile: {} });
this.collection._getTileErrors();
expect(this.collection._getTileErrors.calls.count()).toEqual(2);
@@ -140,7 +141,7 @@ describe('util/tile-error-collection', function () {
};
spyOn(this.collection, '_deletedNode').and.returnValue(false);
spyOn(this.collection, '_getTileErrors').and.callThrough();
- this.model = this.collection.queue.add({ url: 'http://localhost:9001/test/some_url/0/0/0/5.png', node: new Image() });
+ this.model = this.collection.queue.add({ url: 'http://localhost:9001/test/some_url/0/0/0/5.png', node: {} });
});
it('should set the model as checked', function () {
@@ -163,7 +164,7 @@ describe('util/tile-error-collection', function () {
});
it('should set the model url as the model node src', function () {
- expect(this.model.get('node').src).toEqual('');
+ expect(this.model.get('node').src).toEqual(undefined);
this.collection._getTileErrors();
expect(this.model.get('node').src).toEqual(this.model.get('url'));
});
| 14 |
diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/subflow.js b/packages/node_modules/@node-red/editor-client/src/js/ui/subflow.js @@ -1365,11 +1365,6 @@ RED.subflow = (function() {
ui.type = "input";
ui.opts = {types:['str','num','bool','json','bin','env']}
} else {
- var typeOptions = {
- 'input': {types:['str','num','bool','json','bin','env']},
- 'select': {opts:[]},
- 'spinner': {}
- };
if (!ui.opts) {
ui.opts = (ui.type === "select") ? {opts:[]} : {};
}
| 2 |
diff --git a/admin-base/ui.apps/src/main/content/jcr_root/apps/admin/components/tenants/template.vue b/admin-base/ui.apps/src/main/content/jcr_root/apps/admin/components/tenants/template.vue <div class="row" style="border: solid silver 2px; box-shadow: 3px 3px 4px lightgray; margin-right: 10px;">
<div class="col s12 m6 l4 icon-action" v-for="child in children" v-bind:key="child.name">
<div class="card blue-grey darken-3">
- <div class="card-content white-text">
+ <div class="card-content white-text tenant-link" @click="selectTenant(child.name)">
<span class="card-title">{{child.title ? child.title : child.name}}</span>
<p>{{child.description}}</p>
</div>
<div class="card-action">
- <admin-components-action
- v-bind:model="{
- target: child.name,
- command: 'selectTenant',
- tooltipTitle: `${$i18n('edit')} '${child.title || child.name}'`
- }">{{`${$i18n('edit')} '${child.title || child.name}'`}}
- </admin-components-action>
-
<admin-components-action
v-bind:model="{
target: { path: '/content', name: child.name },
</template>
<script>
- import {set} from '../../../../../../js/utils';
export default {
props: ['model'],
data(){
created() {
},
methods: {
- selectTenant(me, target) {
- $perAdminApp.stateAction('setTenant', { name: target}).then( () => {
- $perAdminApp.loadContent('/content/admin/pages/welcome.html');
+ selectTenant(name) {
+ $perAdminApp.stateAction('setTenant', { name }).then( () => {
+ $perAdminApp.loadContent('/content/admin/pages/welcome.html')
});
},
fieldset {
border: none;
}
+
+ .tenant-link:hover {
+ background-color: rgba(255, 255, 255, .05);
+ cursor: pointer;
+ }
+
+ .card-action {
+ display: flex;
+ justify-content: space-between;
+ }
</style>
\ No newline at end of file
| 7 |
diff --git a/packages/app/src/server/routes/apiv3/bookmarks.js b/packages/app/src/server/routes/apiv3/bookmarks.js @@ -258,6 +258,11 @@ module.exports = (crowi) => {
*/
router.put('/', accessTokenParser, loginRequiredStrictly, csrf, validator.bookmarks, apiV3FormValidator, async(req, res) => {
const { pageId, bool } = req.body;
+ const userId = req.user?._id;
+
+ if (userId == null) {
+ return res.apiv3Err('A logged in user is required.');
+ }
let bookmark;
try {
@@ -265,6 +270,10 @@ module.exports = (crowi) => {
if (page == null) {
return res.apiv3Err(`Page '${pageId}' is not found or forbidden`);
}
+
+ bookmark = await Bookmark.findByPageIdAndUserId(page._id, req.user._id);
+
+ if (bookmark == null) {
if (bool) {
bookmark = await Bookmark.add(page, req.user);
@@ -272,17 +281,29 @@ module.exports = (crowi) => {
// in-app notification
pageEvent.emit('bookmark', page, req.user);
}
+ else {
+ logger.warn(`Removing the bookmark for ${page._id} by ${req.user._id} failed because the bookmark does not exist.`);
+ }
+ }
+ else {
+ // eslint-disable-next-line no-lonely-if
+ if (bool) {
+ logger.warn(`Adding the bookmark for ${page._id} by ${req.user._id} failed because the bookmark has already exist.`);
+ }
else {
bookmark = await Bookmark.removeBookmark(page, req.user);
}
}
+ }
catch (err) {
logger.error('update-bookmark-failed', err);
return res.apiv3Err(err, 500);
}
+ if (bookmark != null) {
bookmark.depopulate('page');
bookmark.depopulate('user');
+ }
return res.apiv3({ bookmark });
});
| 7 |
diff --git a/server/game/cards/04.1-BotK/ShiotomeEncampment.js b/server/game/cards/04.1-BotK/ShiotomeEncampment.js @@ -4,7 +4,6 @@ class ShiotomeEncampment extends DrawCard {
setupCardAbilities(ability) {
this.action({
title: 'Ready a Cavalry character',
- effect: 'ready a Cavalry character',
condition: context =>
Object.values(this.game.rings).some(
ring =>
| 4 |
diff --git a/tests/phpunit/integration/Core/Util/REST_Entity_Search_ControllerTest.php b/tests/phpunit/integration/Core/Util/REST_Entity_Search_ControllerTest.php @@ -59,7 +59,7 @@ class REST_Entity_Search_ControllerTest extends TestCase {
);
$response = rest_get_server()->dispatch( $request );
- $this->assertEquals( 401, $response->get_status() );
+ $this->assertNotEquals( 200, $response->get_status() );
$this->assertArrayHasKey( 'code', $response->get_data() );
$this->assertEquals( 'rest_forbidden', $response->get_data()['code'] );
}
| 1 |
diff --git a/userscript.user.js b/userscript.user.js @@ -23392,13 +23392,18 @@ var $$IMU_EXPORT$$;
if ((host_domain_nowww === "yandex.ru" ||
host_domain_nowww === "yandex.com")
&& options && options.element) {
- if (options.element.parentElement && options.element.parentElement.tagName === "A") {
- match = options.element.parentElement.href.match(/^[a-z]+:\/\/[^/]+\/+images\/+search\?(?:.*&)?img_url=([^&]+)/);
+ var current = options.element;
+ while ((current = current.parentElement)) {
+ if (current.tagName === "A") {
+ match = current.href.match(/^[a-z]+:\/\/[^/]+\/+images\/+search\?(?:.*&)?img_url=([^&]+)/);
if (match) {
newsrc = decodeuri_ifneeded(match[1]);
if (newsrc !== src)
return newsrc;
}
+
+ break;
+ }
}
}
| 7 |
diff --git a/CHANGELOG.md b/CHANGELOG.md All notable changes to this project are documented in this file.
-## Head
+## 13.3.1
- Fixed: babel configuration conflict when using TypeScript ([postcss-css-in-js/#2](https://github.com/stylelint/postcss-css-in-js/pull/2)).
- Fixed: autofix for nested tagged template literals ([#4119](https://github.com/stylelint/stylelint/pull/4119)).
| 6 |
diff --git a/configs/buf.json b/configs/buf.json {
"index_name": "buf",
"start_urls": [
- "https://buf.build/docs/"
+ "https://docs.buf.build/"
],
"sitemap_urls": [
- "https://buf.build/sitemap.xml"
+ "https://docs.buf.build/sitemap.xml"
],
"sitemap_alternate_links": true,
"stop_urls": [],
| 5 |
diff --git a/.circleci/config.yml b/.circleci/config.yml @@ -10,11 +10,11 @@ jobs:
name: fail if the branch name does not start with a valid prefix
command: |
branch=$CIRCLE_BRANCH
- if [[ "$branch" =~ ^(fix|feature|breaking)/ ]]
+ if [[ "$branch" =~ ^(fix|feature|breaking)/ || "$branch" == 'master' ]]
then
echo $branch is a valid name
else
- echo $branch is not valid because the branch name must match '^(fix|feature|breaking)/'
+ echo $branch is not valid because the branch name must match '^(fix|feature|breaking)/' or be master
exit 1
fi
deploy_test_environment:
| 11 |
diff --git a/source/staking/test/Staking-unit.js b/source/staking/test/Staking-unit.js @@ -14,8 +14,8 @@ describe('Staking Unit', () => {
let locker
const CLIFF = 10 //blocks
const PERIOD_LENGTH = 1 //blocks
- const PERCENT_PER_PERIOD = 1 //percent
- // every 1 block 1% is vested, user can only claim starting afater 10 blocks, or 10% vested
+ const PERCENT_PER_PERIOD = 100 //percent
+ // every 1 block 1.00% is vested, user can only claim starting afater 10 blocks, or 10% vested
beforeEach(async () => {
const snapshot = await timeMachine.takeSnapshot()
| 3 |
diff --git a/docs/index.html b/docs/index.html <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="description" content="A graphics system born for visualization.">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
- <link rel="stylesheet" href="https://lib.baomitu.com/docsify/4.10.2/themes/vue.css">
+ <link rel="stylesheet" href="https://s5.ssl.qhres.com/static/14f3e44c81d81666.css">
<style>
nav a {
margin: 0 10px;
| 14 |
diff --git a/src/og/Globe.js b/src/og/Globe.js @@ -17,6 +17,8 @@ import { Planet } from "./scene/Planet.js";
import { EmptyTerrain } from "./terrain/EmptyTerrain.js";
import { isEmpty } from "./utils/shared.js";
import { Handler } from "./webgl/Handler.js";
+import { createColorRGB } from "./utils/shared.js";
+import { Vec3 } from "./math/Vec3.js";
/** @const {string} */
const CANVAS_ID_PREFIX = "globus_viewport_";
@@ -136,9 +138,9 @@ class Globe {
antialias: false,
powerPreference: "high-performance"
}
- }),
- {
- autoActivate: false
+ }), {
+ autoActivate: false,
+ backgroundColor: createColorRGB(options.backgroundColor, new Vec3(115 / 255, 203 / 255, 249 / 255))
}
);
this.renderer.initialize();
| 0 |
diff --git a/SSAOPass.js b/SSAOPass.js @@ -29,7 +29,8 @@ import { SSAOBlurShader } from 'three/examples/jsm/shaders/SSAOShader.js';
import { SSAODepthShader } from 'three/examples/jsm/shaders/SSAOShader.js';
import { CopyShader } from 'three/examples/jsm/shaders/CopyShader.js';
-const _nop = () => {};
+const oldParentCache = new WeakMap();
+const oldMaterialCache = new WeakMap();
class SSAOPass extends Pass {
@@ -331,8 +332,9 @@ class SSAOPass extends Pass {
const _recurse = o => {
if (o.isMesh && o.customPostMaterial) {
- o.originalParent = o.parent;
- o.originalMaterial = o.material;
+ oldParentCache.set(o, o.parent);
+ oldMaterialCache.set(o, o.material);
+
o.material = o.customPostMaterial;
this.customScene.add(o);
}
@@ -343,8 +345,11 @@ class SSAOPass extends Pass {
_recurse(this.scene);
renderer.render( this.customScene, this.camera );
for (const child of this.customScene.children) {
- child.originalParent.add(child);
- child.material = child.originalMaterial;
+ oldParentCache.get(child).add(child);
+ child.material = oldMaterialCache.get(child);
+
+ oldParentCache.delete(child);
+ oldMaterialCache.delete(child);
}
this.scene.overrideMaterial = overrideMaterial;
| 0 |
diff --git a/articles/compliance/gdpr/features-aiding-compliance/user-consent/index.md b/articles/compliance/gdpr/features-aiding-compliance/user-consent/index.md @@ -45,8 +45,6 @@ For a tutorial on how to implement any of these scenarios, see the [Track Consen
If you need to ask for consent from existing users and you decide to migrate your users from an existing database to Auth0, you can use our [Automatic User Migration](/users/migrations/automatic) feature. By activating this, each time a user logs in for the first time (since this was activated), they will be created in Auth0 without having to reset their password.
----
-
:::panel What else do I have to do?
- You must write up the notification users will see around how users' data is being used, how long data will be used, users' rights, etc. as well as customize the UI sign-up box
- You must determine if re-consent is required for your users, depending on your old terms and conditions and previous privacy certifications
@@ -62,7 +60,7 @@ With Auth0 you can save the user's consent information as part of the `user_meta
To access the Management API you will need an Access Token, for information on how to get one refer to the [Auth0 Management API token](/api/management/v2/tokens).
:::
-The Management API offers several offers several options when it comes to user search (search by email, ID, or other fields) and endpoints to update `user_metadata` or batch export users.
+The Management API offers several offers several options when it comes to user search and endpoints to update `user_metadata` or batch export users.
### Search for a user using their email address
@@ -151,16 +149,6 @@ Sample response:
}
```
-### Search for a set of users
-
-To search for a set of users, use [the List or search users endpoint](/users/search#users).
-
-This endpoint is eventually consistent (that is, the response might not reflect the results of a recently-complete write operation) and [only specific fields are available for search](/api/management/v2/user-search#searchable-fields).
-
-Information regarding consent that is saved to `user_metadata` are not searchable.
-
-For a sample request and response see [Search Users](/users/search#users). For more examples, see [Example Queries](/api/management/v2/user-search#example-queries).
-
### Update consent information
To update a user's `user_metadata`, use [the Update a user endpoint](/api/management/v2#!/Users/patch_users_by_id).
@@ -267,8 +255,6 @@ This endpoint creates a job that exports all users associated with a connection.
Once you have the connection ID and a [Management API token](/api/management/v2/tokens), you are ready to start exporting users. For a sample request and response see [User Export](/users/search#user-export).
----
-
:::panel What else do I have to do?
- Determine how you want to track consent. We recommend including information on not just the date the user consented, but the version of terms and conditions to which the user agreed. We also recommend including an array to hold information about users that withdraw their permission (remember that the user can consent and withdraw multiple times)
- Choose where you want to store consent: in Auth0's database or elsewhere
@@ -353,8 +339,6 @@ The script:
Give a name to your rule and save your changes.
----
-
:::panel What else do I have to do?
- Ensure the consent withdrawal piece is granular enough
- Configure into the app the area where customers will withdraw consent
| 2 |
diff --git a/token-metadata/0x445f51299Ef3307dBD75036dd896565F5B4BF7A5/metadata.json b/token-metadata/0x445f51299Ef3307dBD75036dd896565F5B4BF7A5/metadata.json "symbol": "VIDT",
"address": "0x445f51299Ef3307dBD75036dd896565F5B4BF7A5",
"decimals": 18,
- "dharmaVerificationStatus": {
"dharmaVerificationStatus": "VERIFIED"
}
\ No newline at end of file
-}
\ No newline at end of file
| 3 |
diff --git a/src/commands/test/lib/run-tests-command.ts b/src/commands/test/lib/run-tests-command.ts @@ -218,7 +218,7 @@ export abstract class RunTestsCommand extends AppCommand {
protected async cleanupArtifactsDir(artifactsDir: string): Promise<void> {
await pfs.rmDir(artifactsDir, true).catch(function(err){
- console.warn(`Error ${err} while cleaning up artifacts directory ${artifactsDir}. Continuing without cleanup.`);
+ console.warn(`Error ${err} while cleaning up artifacts directory ${artifactsDir}. This is often due to files being locked or in use. Please check your virus scan settings and any local security policies you might have in place for this directory. Continuing without cleanup.`);
});
}
| 7 |
diff --git a/src/collection/dimensions.js b/src/collection/dimensions.js @@ -269,23 +269,20 @@ fn = elesfn = ({
function computePaddingValues( width, height, paddingObject, relativeTo ) {
// Assuming percentage is number from 0 to 1
if(paddingObject.units === '%') {
- return {
- 'width': function(){
+ switch(relativeTo) {
+ case 'width':
return width > 0 ? paddingObject.pfValue * width : 0;
- },
- 'height': function(){
+ case 'height':
return height > 0 ? paddingObject.pfValue * height : 0;
- },
- 'whAverage': function(){
+ case 'average':
return ( width > 0 ) && ( height > 0 ) ? paddingObject.pfValue * ( width + height ) / 2 : 0;
- },
- 'whMin': function(){
+ case 'min':
return ( width > 0 ) && ( height > 0 ) ? ( ( width > height ) ? paddingObject.pfValue * height : paddingObject.pfValue * width ) : 0;
- },
- 'whMax': function(){
+ case 'max':
return ( width > 0 ) && ( height > 0 ) ? ( ( width > height ) ? paddingObject.pfValue * width : paddingObject.pfValue * height ) : 0;
+ default:
+ return 0;
}
- }[relativeTo || 'width']();
} else if(paddingObject.units === 'px') {
return paddingObject.pfValue;
} else {
| 14 |
diff --git a/token-metadata/0x00D1793D7C3aAE506257Ba985b34C76AaF642557/metadata.json b/token-metadata/0x00D1793D7C3aAE506257Ba985b34C76AaF642557/metadata.json "symbol": "TACO",
"address": "0x00D1793D7C3aAE506257Ba985b34C76AaF642557",
"decimals": 18,
- "dharmaVerificationStatus": {
"dharmaVerificationStatus": "VERIFIED"
}
\ No newline at end of file
-}
\ No newline at end of file
| 3 |
diff --git a/runtime/opensbp/commands/leveler.js b/runtime/opensbp/commands/leveler.js -/*jslint todo: true, browser: true, continue: true, white: true*/
-/*global define*/
-
var log = require("../../../log").logger("sbp");
var fs = require("fs");
var triangulate = require("delaunay-triangulate");
| 2 |
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml @@ -33,8 +33,6 @@ jobs:
${{ runner.os }}-composer-
- name: Composer Install
run: composer install --no-interaction --no-progress
- - name: Add Composer paths to $PATH
- run: echo "PATH=$CWD/vendor/bin:$(composer global config bin-dir --absolute):$PATH" >> $GITHUB_ENV
- name: PHP Lint
run: composer lint
js-css-lint:
| 2 |
diff --git a/apps/poikkipuinen/app.js b/apps/poikkipuinen/app.js @@ -74,9 +74,10 @@ function draw() {
// draw hour meter
g.drawLine(watch.x - facew, watch.y - faceh, watch.x - facew, watch.y + faceh);
var lines = 13;
+ var lineh = faceh * 2 / (lines - 2);
for (var i = 1; i < lines; i++) {
var w = 2;
- var y = -faceh * 2 / (lines-2) * (i-1) + faceh;
+ var y = faceh - lineh * (i - 1);
if (i % 3 == 0) {
// longer line and numbers every 3
@@ -94,9 +95,10 @@ function draw() {
g.drawLine(watch.x + facew, watch.y - faceh, watch.x + facew, watch.y + faceh);
g.setFontAlign(-1,-1);
lines = 60;
+ lineh = faceh * 2 / (lines - 1);
for (i = 0; i < lines; i++) {
var mw = 2;
- var my = -faceh * 2 / (lines-1) * (i) + faceh;
+ var my = faceh - lineh * i;
if (i % 15 == 0 && i != 0) {
// longer line and numbers every 3
@@ -104,6 +106,7 @@ function draw() {
g.drawString(i, watch.x + facew + 4, my + watch.y);
}
+ //if (i % 2 == 0 || i == 15 || i == 45)
g.drawLine(watch.x + facew, my + watch.y, watch.x + facew - mw, my + watch.y);
// get minute y position
| 1 |
diff --git a/mods/etc/gen_jwt_token.js b/mods/etc/gen_jwt_token.js -const jwt = require('njwt')
+const jwt = require('jsonwebtoken')
const fs = require('fs')
const path = require('path')
+const pathToCerts = process.env.CERTS_PATH || path.join(__dirname, 'certs')
+const accessKeyId = process.env.ACCESS_KEY_ID || 'yaps'
+
// Getting SALT
-const pathToSalt = path.join(process.env.CERTS_PATH, 'jwt.salt')
-const result = fs.readFileSync(pathToSalt).toString().trim()
+const pathToSalt = path.join(pathToCerts, 'jwt.salt')
+const privateKey = fs.readFileSync(pathToSalt).toString().trim()
+
+const claims = {
+ iss: 'yaps',
+ sub: accessKeyId,
+ exp: Math.floor(Date.now('2030-01-01') / 1000)
+}
-const claims = { iss: 'yaps', sub: process.env.ACCESS_KEY_ID }
-const token = jwt.create(claims, result)
-// token.setExpiration(new Date().getTime() + 3600*1000)
-console.log(`${process.env.ACCESS_KEY_ID}:${token.compact()}`)
+console.log(`${accessKeyId}:${jwt.sign(claims, privateKey)}`)
| 7 |
diff --git a/src/components/DisplayInput.js b/src/components/DisplayInput.js const React = require('react');
const Radium = require('radium');
+const _uniqueId = require('lodash/uniqueId');
const StyleConstants = require('../constants/Style');
@@ -34,6 +35,11 @@ const DisplayInput = React.createClass({
};
},
+ componentWillMount () {
+ this._labelId = _uniqueId('DI');
+ this._inputId = _uniqueId('DI');
+ },
+
_isLargeOrMediumWindowSize () {
const windowSize = StyleConstants.getWindowSize();
@@ -64,11 +70,9 @@ const DisplayInput = React.createClass({
<Row>
{this.props.label ? (
<Column span={labelColumn}>
- <div>
- <div style={Object.assign({}, styles.labelText, this.props.labelStyle)}>
+ <label htmlFor={this._inputId} id={this._labelId} style={Object.assign({}, styles.labelText, this.props.labelStyle)}>
{this.props.label}
- </div>
- </div>
+ </label>
</Column>
) : null }
@@ -81,8 +85,9 @@ const DisplayInput = React.createClass({
<div style={styles.inputWrapper}>
<input
{...elementProps}
+ aria-labelledby={this.props.label ? this._labelId : null}
+ id={this._inputId}
key='input'
- label={this.props.label}
style={styles.input}
type='text'
/>
| 4 |
diff --git a/core/field_bound_variable.js b/core/field_bound_variable.js @@ -37,7 +37,7 @@ Blockly.FieldBoundVariable = function() {
* The reference of this field's variable. Would be initialized in init().
* @type {Blockly.TypedVariableValueReference}
*/
- this.value_ = null;
+ this.reference_ = null;
};
goog.inherits(Blockly.FieldBoundVariable, Blockly.FieldDropdown);
@@ -63,8 +63,8 @@ Blockly.FieldBoundVariable.prototype.init = function() {
// Dropdown has already been initialized once.
return;
}
- if (!this.value_) {
- this.value_ = Blockly.TypedVariableValueReference(this.sourceBlock_);
+ if (!this.reference_) {
+ this.reference_ = Blockly.TypedVariableValueReference(this.sourceBlock_);
}
Blockly.FieldBoundVariable.superClass_.init.call(this);
};
@@ -94,8 +94,8 @@ Blockly.FieldBoundVariable.prototype.setSourceBlock = function(block) {
* @param {!Blockly.TypedVariableValueReference}
*/
Blockly.FieldBoundVariable.prototype.setBoundValue = function(value) {
- if (this.value_) {
- this.value_.setBoundValue(value);
+ if (this.reference_) {
+ this.reference_.setBoundValue(value);
}
};
@@ -104,7 +104,7 @@ Blockly.FieldBoundVariable.prototype.setBoundValue = function(value) {
* @return {Blockly.TypedVariableValue}
*/
Blockly.FieldBoundVariable.prototype.getBoundValue = function() {
- return this.value_ ? this.value_.getBoundValue() : null;
+ return this.reference_ ? this.reference_.getBoundValue() : null;
};
/**
@@ -121,10 +121,10 @@ Blockly.FieldBoundVariable.prototype.getValue = function() {
* variable is selected.
*/
Blockly.FieldBoundVariable.prototype.getText = function() {
- if (!this.value_) {
+ if (!this.reference_) {
throw 'The value is not initialized.';
}
- return this.value_.getDisplayName();
+ return this.reference_.getDisplayName();
};
/**
| 10 |
diff --git a/airesources/Java/hlt/GameMap.java b/airesources/Java/hlt/GameMap.java @@ -13,7 +13,7 @@ public class GameMap {
private final short playerId;
private final List<Player> players;
private final Map<Long, Planet> planets;
- private List<Ship> ships;
+ private List<Ship> allShips;
public GameMap(final short width, final short height, final short playerId) {
this.width = width;
@@ -21,6 +21,7 @@ public class GameMap {
this.playerId = playerId;
players = new ArrayList<>(Constants.MAXIMUM_NUMBER_OF_PLAYERS);
planets = new TreeMap<>();
+ allShips = new LinkedList<>();
}
public short getHeight() {
@@ -56,14 +57,14 @@ public class GameMap {
}
public List<Ship> getAllShips(){
- return Collections.unmodifiableList(ships);
+ return Collections.unmodifiableList(allShips);
}
public ArrayList<Entity> objectsBetween(Position start, Position target) {
final ArrayList<Entity> entitiesFound = new ArrayList<>();
addEntitiesBetween(entitiesFound, start, target, planets.values());
- addEntitiesBetween(entitiesFound, start, target, ships);
+ addEntitiesBetween(entitiesFound, start, target, allShips);
return entitiesFound;
}
@@ -92,7 +93,7 @@ public class GameMap {
entityByDistance.put(entity.getDistanceTo(planet), planet);
}
- for (final Ship ship : ships) {
+ for (final Ship ship : allShips) {
if (ship.equals(entity)) {
continue;
}
@@ -107,13 +108,16 @@ public class GameMap {
final short numberOfPlayers = MetadataParser.parsePlayerNum(mapMetadata);
players.clear();
+ planets.clear();
+ allShips.clear();
// update players info
for (short i = 0; i < numberOfPlayers; i++) {
final short playerId = MetadataParser.parsePlayerId(mapMetadata);
final Player currentPlayer = new Player(playerId);
- ships = MetadataParser.getShipList(playerId, mapMetadata);
+ final List<Ship> ships = MetadataParser.getShipList(playerId, mapMetadata);
+ allShips.addAll(ships);
for (final Ship ship : ships) {
currentPlayer.addShip(ship.getId(), ship);
@@ -127,6 +131,11 @@ public class GameMap {
final Planet planet = MetadataParser.newPlanetFromMetadata(mapMetadata);
planets.put(planet.getId(), planet);
}
+
+ if (!mapMetadata.isEmpty()) {
+ throw new IllegalStateException("Failed to parse data from Halite game engine. Please contact maintainers.");
+ }
+
return this;
}
}
| 1 |
diff --git a/packages/jaeger-ui/src/components/common/GraphSearch.test.js b/packages/jaeger-ui/src/components/common/GraphSearch.test.js @@ -149,10 +149,9 @@ describe('GraphSearch', () => {
it('focuses input', () => {
// Mount is necessary for refs to be registered
wrapper = mount(<UnconnectedGraphSearch {...props} />);
- const focusMock = jest.spyOn(wrapper.instance().inputRef, 'focus');
- expect(focusMock).toHaveBeenCalledTimes(0);
+ const focusSpy = jest.spyOn(wrapper.instance().inputRef, 'focus');
wrapper.find(Icon).simulate('click');
- expect(focusMock).toHaveBeenCalledTimes(1);
+ expect(focusSpy).toHaveBeenCalledTimes(1);
});
it('triggers pending queryParameter updates', () => {
| 7 |
diff --git a/src/lib/date.js b/src/lib/date.js import { DateTime, Interval } from "luxon";
import DfFormat from "date-fns/format";
-import DFParse from "date-fns/parse";
const contentfulISOFormatOptions = {
suppressMilliseconds: true,
@@ -26,7 +25,7 @@ export const isSameDay = (d1: string, d2: string) =>
export const toFormat = (date: string | Date, format: string) =>
DfFormat(date, format);
-export const parse = (date: string | Date) => DFParse(date);
+export const parse = (date: string) => DateTime.fromISO(date).toJSDate();
export const compareAsc = (d1: string, d2: string) => {
const coercedD1 = +DateTime.fromISO(d1);
| 14 |
diff --git a/javascript_nodejs/21.custom-dialogs/README.md b/javascript_nodejs/21.custom-dialogs/README.md -This sample shows how to use the prompt classes included in `botbuilder-dialogs`.
-This bot will ask for multiple pieces of information from the user, each using a
-different type of prompt, each with its own validation rules. This sample also
-demonstrates using the `ComponentDialog` class to encapsulate related sub-dialogs.
+This sample demonstrates how to sub-class the Dialog class to create
+different bot control mechanism, such as a slot filling.
# To try this sample
- Clone the repository
```bash
git clone https://github.com/microsoft/botbuilder-samples.git
```
-- In a terminal, navigate to javascript_nodejs/10.prompt-validations
+- In a terminal, navigate to javascript_nodejs/21.custom-dialogs
```bash
- cd javascript_nodejs/10.prompt-validations
+ cd javascript_nodejs/21.custom-dialogs
```
- Point to the MyGet feed
```bash
@@ -34,20 +32,22 @@ or running remotely through a tunnel.
## Connect to bot using Bot Framework Emulator V4
- Launch Bot Framework Emulator
-- File -> Open Bot Configuration and navigate to javascript_nodejs/10.prompt-validations
-- Select prompt-validations-bot.bot file
+- File -> Open Bot Configuration and navigate to javascript_nodejs/21.custom-dialogs
+- Select custom-dialogs.bot file
-# Prompts
-A conversation between a bot and a user often involves asking (prompting) the user for information,
-parsing the user's response, and then acting on that information. This sample demonstrates how to
-prompt users for information and validate the incoming responses using the different prompt types included in the
-[botbuilder-dialogs](https://github.com/Microsoft/botbuilder-js/tree/master/libraries/botbuilder-dialogs)
-library.
+# Custom Dialogs
-The `botbuilder-dialogs` library includes a variety of pre-built prompt classes, including text, number,
-and datetime types. In this sample, each prompt is wrapped in a custom class that includes a validation
-function. These prompts are chained together into a `WaterfallDialog`, and the final results are stored
-using the state manager.
+Botbuilder provides a built-in base class called `Dialog`. By subclassing Dialog, developers
+can create new ways to define and control dialog flows used by the bot. By adhering to the
+features of this class, developers create custom dialog types that can be used side-by-side
+with other dialog types, as well as built-in or custom prompts.
+
+This example demonstrates a custom Dialog class called `SlotFillingDialog`, which takes a
+series of "slots" which define a value the bot needs to collect from the user, as well
+as the prompt it should use. The bot will iterate through all of the slots until they are
+all full, at which point the dialog completes.
# Further reading
-- [Prompt types](https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-prompts?view=azure-bot-service-4.0&tabs=javascript)
+- [Dialog class reference](https://docs.microsoft.com/en-us/javascript/api/botbuilder-dialogs/dialog)
+- [WaterfallDialog class reference](https://docs.microsoft.com/en-us/javascript/api/botbuilder-dialogs/waterfall)
+- [Manage complex conversation flows with dialogs](https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-dialog-manage-complex-conversation-flow?view=azure-bot-service-4.0&tabs=javascript)
\ No newline at end of file
| 3 |
diff --git a/server/static/plaid-polo.html b/server/static/plaid-polo.html @@ -67,6 +67,7 @@ firebase.js:370 Uncaught Error: Firebase.set failed: First argument contains an
<a-scene networked-scene="
room: basic; debug: true;
updateRate: 30; useLerp: false; compressSyncPackets: true; useShare: true;
+ collisionOwnership: false;
webrtc: true;
">
<!--
| 12 |
diff --git a/libs/aws/cloudwatchlogs.js b/libs/aws/cloudwatchlogs.js @@ -24,6 +24,8 @@ export default (aws) => {
};
if (logs.length === 0) params.startFromHead = true;
if (nextToken) params.nextToken = nextToken;
+ // cloudwatch log events requires knowing jobId and taskArn(s)
+ // taskArns are available on job which we can access with a describeJobs call to batch
this.sdk.getLogEvents(params, (err, data)=> {
if(err) {return callback(err);}
//Cloudwatch returns a token even if there are no events. That is why checking events length
@@ -53,11 +55,7 @@ export default (aws) => {
}
return streams;
}, {});
- //cloudwatch log events requires knowing jobId and taskArn(s)
- // taskArns are available on job which we can access with a describeJobs call to batch
mapValuesLimit(logStreams, 10, (params, logStreamName, cb) => {
- // this currently works to grab the latest logs for a job. Need to update to get all logs for a job using next tokens
- // however there is a bug that will require a little more work to make this happen. https://forums.aws.amazon.com/thread.jspa?threadID=251240&tstart=0
this.getLogs(logStreamName, [], null, this._includeJobParams(params, cb));
}, (err, logs) => {
callback(err, logs);
| 1 |
diff --git a/packages/app/src/components/PageDeleteModal.tsx b/packages/app/src/components/PageDeleteModal.tsx @@ -40,8 +40,7 @@ const PageDeleteModal: FC<Props> = (props: Props) => {
const { data: deleteModalData, close: closeDeleteModal } = usePageDeleteModal();
- const isOpened = deleteModalData?.isOpened != null ? deleteModalData.isOpened : false;
- const onDeleted = deleteModalData?.onDeleted != null ? deleteModalData.onDeleted : null;
+ const isOpened = deleteModalData?.isOpened ?? false;
const [isDeleteRecursively, setIsDeleteRecursively] = useState(true);
const [isDeleteCompletely, setIsDeleteCompletely] = useState(isDeleteCompletelyModal && isAbleToDeleteCompletely);
@@ -83,8 +82,8 @@ const PageDeleteModal: FC<Props> = (props: Props) => {
isCompletely,
});
- if (onDeleted != null) {
- onDeleted(data.paths, data.isRecursively, data.isCompletely);
+ if (deleteModalData.onDeleted != null) {
+ deleteModalData.onDeleted(data.paths, data.isRecursively, data.isCompletely);
}
}
catch (err) {
@@ -108,8 +107,8 @@ const PageDeleteModal: FC<Props> = (props: Props) => {
completely,
}) as IDeleteSinglePageApiv1Result;
- if (onDeleted != null) {
- onDeleted(path, isRecursively, isCompletely);
+ if (deleteModalData.onDeleted != null) {
+ deleteModalData.onDeleted(path, isRecursively, isCompletely);
}
}
catch (err) {
| 7 |
diff --git a/src/transit.js b/src/transit.js @@ -169,11 +169,9 @@ class Transit {
case TOPIC_REQ: {
this.logger.debug(`Request from ${msg.nodeID}.`, msg.action, msg.params);
- this.broker.call(msg.action, msg.params)
+ return this.broker.call(msg.action, msg.params)
.then(res => this.sendResponse(msg.nodeID, msg.requestID, res))
.catch(err => this.sendResponse(msg.nodeID, msg.requestID, null, err));
-
- return;
}
// Response
@@ -181,7 +179,7 @@ class Transit {
let req = this.pendingRequests.get(msg.requestID);
// If not exists (timed out), we skip to process the response
- if (!req) return;
+ if (!req) return Promise.resolve();
// Remove pending request
this.pendingRequests.delete(msg.requestID);
| 13 |
diff --git a/addon/-private/system/model/internal-model.js b/addon/-private/system/model/internal-model.js @@ -881,8 +881,8 @@ export default class InternalModel {
It will remove this record from any associated relationships.
- It will completely reset all relationships to an empty state and remove
- the record from any associated inverses as well.
+ If `isNew` is true (default false), it will completely reset all relationships
+ to an empty state as well.
@method removeFromInverseRelationships
@param {Boolean} isNew whether to unload from the `isNew` perspective
| 7 |
diff --git a/contracts/Havven.sol b/contracts/Havven.sol @@ -467,20 +467,20 @@ contract Havven is DestructibleExternStateToken {
internal
{
/* update the total balances first */
- totalIssuanceData = rolloverBalances(lastTotalSupply, totalIssuanceData);
+ totalIssuanceData = updatedIssuanceData(lastTotalSupply, totalIssuanceData);
if (issuanceData[account].lastModified < feePeriodStartTime) {
hasWithdrawnFees[account] = false;
}
- issuanceData[account] = rolloverBalances(preBalance, issuanceData[account]);
+ issuanceData[account] = updatedIssuanceData(preBalance, issuanceData[account]);
}
/**
* @notice Compute the new IssuanceData on the old balance
*/
- function rolloverBalances(uint preBalance, IssuanceData preIssuance)
+ function updatedIssuanceData(uint preBalance, IssuanceData preIssuance)
internal
view
returns (IssuanceData)
| 10 |
diff --git a/lib/meal/total.js b/lib/meal/total.js @@ -58,6 +58,8 @@ function diaCarbs(opts, time) {
// calculate the current deviation and steepest deviation downslope over the last hour
COB_inputs.ciTime = time.getTime();
+ // set mealTime to 6h ago for Deviation calculations
+ COB_inputs.mealTime = time.getTime() - 6 * 60 * 60 * 1000;
var c = calcMealCOB(COB_inputs);
//console.error(c.currentDeviation, c.minDeviationSlope);
| 12 |
diff --git a/src/patterns/components/inputs/angular/code/select.hbs b/src/patterns/components/inputs/angular/code/select.hbs <sprk-input-container>
- <label sprkLabel>Select Box Label</label>
<select
class="sprk-b-Select"
id="select-normal"
aria-describedby="select-normal--error-container"
data-id="select-1"
- sprkInput>
+ sprkInput
+ >
<option value="none">Please choose...</option>
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="g3">Grouped Option 3</option>
</optgroup>
</select>
+ <sprk-icon
+ iconType="chevron-down"
+ additionalClasses="sprk-c-Icon--stroke-current-color sprk-b-SelectContainer__icon"
+ sprk-select-icon
+ ></sprk-icon>
+ <label sprkLabel>Select Box Label</label>
</sprk-input-container>
\ No newline at end of file
| 3 |
diff --git a/userscript.user.js b/userscript.user.js @@ -12423,8 +12423,8 @@ var $$IMU_EXPORT$$;
subcategory: "open_behavior"
},
mouseover_matching_media_types: {
- name: "Don't popup video for image",
- description: "This option prevents the popup from loading a video when the source was an image. Vice-versa is also applied",
+ name: "Don't popup different media type",
+ description: "This option prevents the popup from loading a video when the source was an image or vice-versa",
requires: {
mouseover: true,
mouseover_allow_video: true
| 10 |
diff --git a/xrrtc.js b/xrrtc.js @@ -137,6 +137,14 @@ class XRChannelConnection extends EventTarget {
peerConnection.dispatchEvent(new MessageEvent('addtrack', {
data: _track,
}));
+ _track.stop = (stop => function () {
+ const {readyState} = _track;
+ const result = stop.apply(this, arguments);
+ if (readyState === 'live') {
+ this.dispatchEvent(new MessageEvent('ended'));
+ }
+ return result;
+ })(_track.stop);
_track.addEventListener('ended', e => {
console.warn('receive stream ended', e);
| 0 |
diff --git a/components/dashboard/Charts.js b/components/dashboard/Charts.js @@ -48,7 +48,7 @@ const Chart = ({ testName }) => {
return qs
}, [derivedQuery])
- const { data, error, isValidating } = useSWR(
+ const { data, error } = useSWR(
apiQuery,
fetcher,
swrOptions
@@ -66,17 +66,22 @@ const Chart = ({ testName }) => {
return null
}, [data, query.probe_cc])
-
return (
- <Flex flexDirection='column' my={2}>
- <Box><Heading h={2}>{testNames[testName].name}</Heading></Box>
+ <Flex flexDirection='column' mt={3}>
+ <Box><Heading h={3}>{testNames[testName].name}</Heading></Box>
<Box sx={{ height: `${250}px` }}>
- {chartData &&
+ {(!chartData && !error) ? (
+ <div> Loading ...</div>
+ ) : (
+ chartData === null || chartData.length === 0 ? (
+ <Heading h={5}>No Data</Heading>
+ ) : (
<GridChart
data={chartData}
query={derivedQuery}
/>
- }
+ )
+ )}
</Box>
</Flex>
)
| 9 |
diff --git a/js/kiri.js b/js/kiri.js @@ -566,6 +566,7 @@ self.kiri.license = exports.LICENSE;
ajax : ajax,
help : showHelp,
load : loadWidget,
+ alert: alert2,
focus : takeFocus,
stats : STATS,
import : loadFile,
@@ -607,6 +608,9 @@ self.kiri.license = exports.LICENSE;
}
function alert2(message, time) {
+ if (message === undefined) {
+ return updateAlerts(true);
+ }
alerts.push([message, Date.now(), time]);
updateAlerts();
}
| 4 |
diff --git a/token-metadata/0xfa91f4177476633f100C59D336C0f2FfAd414CBA/metadata.json b/token-metadata/0xfa91f4177476633f100C59D336C0f2FfAd414CBA/metadata.json "symbol": "XYS",
"address": "0xfa91f4177476633f100C59D336C0f2FfAd414CBA",
"decimals": 6,
- "dharmaVerificationStatus": {
"dharmaVerificationStatus": "VERIFIED"
}
\ No newline at end of file
-}
\ No newline at end of file
| 3 |
diff --git a/src/commands/sites/create.js b/src/commands/sites/create.js @@ -2,6 +2,7 @@ const { flags } = require('@oclif/command')
const inquirer = require('inquirer')
const isEmpty = require('lodash.isempty')
const prettyjson = require('prettyjson')
+const chalk = require('chalk')
const Command = require('../../base')
const renderShortDesc = require('../../utils/renderShortDescription')
@@ -36,7 +37,9 @@ class SitesCreateCommand extends Command {
delete results.accountSlug
const site = await this.netlify.createSiteInTeam({ accountSlug, body: results })
- this.log(`Site created`)
+ this.log()
+ this.log(chalk.greenBright.bold.underline(`Site Created`))
+ this.log()
this.log(
prettyjson.render({
'Admin URL': site.admin_url,
@@ -55,26 +58,6 @@ SitesCreateCommand.flags = {
name: flags.string({
char: 'n',
description: 'name of site'
- }),
- password: flags.string({
- char: 'p',
- description: 'password protect the site'
- }),
- 'force-tls': flags.boolean({
- char: 's',
- description: 'force TLS connections'
- }),
- 'session-id': flags.string({
- char: 'i',
- description: 'session ID for later site transfers'
- }),
- 'account-slug': flags.string({
- char: 'a',
- description: 'account slug to create the site under'
- }),
- 'custom-domain': flags.string({
- char: 'c',
- description: 'custom domain to use with the site'
})
}
| 3 |
diff --git a/src/mavoscript.js b/src/mavoscript.js @@ -211,7 +211,9 @@ var _ = Mavo.Script = {
},
"eq": {
logical: true,
- scalar: (a, b) => a == b,
+ scalar: (a, b) => {
+ return a == b || Mavo.safeToJSON(a) === Mavo.safeToJSON(b);
+ },
symbol: ["=", "=="],
identity: true,
precedence: 6
| 1 |
diff --git a/test-complete/nodejs-graphs-merge.js b/test-complete/nodejs-graphs-merge.js @@ -116,6 +116,45 @@ describe('merge graph test', function(){
}, done);
});
+ it('should run a combined SPARQL query', function(done){
+ this.timeout(20000);
+ var docQuery = q.where(q.term('person1'));
+ var myQuery = "PREFIX foaf: <http://xmlns.com/foaf/0.1/>" +
+ "PREFIX ppl: <http://people.org/>" +
+ "SELECT *" +
+ "WHERE { ppl:person1 foaf:knows ?o }"
+ db.graphs.sparql({
+ contentType: 'application/sparql-results+json',
+ query: myQuery,
+ docQuery: docQuery
+ }).
+ result(function(response){
+ //console.log(JSON.stringify(response, null, 2))
+ response.results.bindings.length.should.equal(1);
+ response.results.bindings[0].o.value.should.equal('http://people.org/person2');
+ done();
+ }, done);
+ });
+
+ it('should run a combined SPARQL query with invalid docQuery', function(done){
+ this.timeout(20000);
+ var docQuery = q.where(q.term('foo'));
+ var myQuery = "PREFIX foaf: <http://xmlns.com/foaf/0.1/>" +
+ "PREFIX ppl: <http://people.org/>" +
+ "SELECT *" +
+ "WHERE { ppl:person1 foaf:knows ?o }"
+ db.graphs.sparql({
+ contentType: 'application/sparql-results+json',
+ query: myQuery,
+ docQuery: docQuery
+ }).
+ result(function(response){
+ //console.log(JSON.stringify(response, null, 2))
+ response.results.bindings.length.should.equal(0);
+ done();
+ }, done);
+ });
+
it('should delete the merged graph', function(done){
this.timeout(10000);
db.graphs.remove(graphUri).
| 0 |
diff --git a/Sources/web3swift/Web3/Web3.swift b/Sources/web3swift/Web3/Web3.swift @@ -76,4 +76,10 @@ public struct Web3 {
return web3(provider: infura)
}
+ /// Initialized Web3 instance bound to Infura's kovan provider.
+ public static func InfuraKovanWeb3(accessToken: String? = nil) -> web3 {
+ let infura = InfuraProvider(Networks.Kovan, accessToken: accessToken)!
+ return web3(provider: infura)
+ }
+
}
| 3 |
diff --git a/src/struct/ClientUtil.js b/src/struct/ClientUtil.js @@ -379,7 +379,7 @@ class ClientUtil {
* @param {boolean} cache - Whether or not to add to cache.
* @returns {Promise<GuildMember>}
*/
- fetchMemberFrom(guild, id, cache) {
+ fetchMemberIn(guild, id, cache) {
return this.client.fetchUser(id, cache).then(fetched => {
return guild.fetchMember(fetched, cache);
});
| 10 |
diff --git a/src/pages/start/index.js b/src/pages/start/index.js @@ -56,7 +56,7 @@ function Start(props) {
/>
</Helmet>,
<div
- className="display-wrapper start-wrapper"
+ className="display-wrapper page-wrapper start-wrapper"
key = {'display-wrapper'}
>
<div
| 7 |
diff --git a/articles/connections/social/oauth2.md b/articles/connections/social/oauth2.md @@ -12,6 +12,10 @@ The most common [identity providers](/identityproviders) are readily available o

+::: note
+For details on how to install and configure the extension, refer to [Auth0 Extension: Custom Social Connections](/extensions/custom-social-extensions).
+:::
+
## The `fetchUserProfile` script
A custom `fetchUserProfile` script will be called after the user has logged in with the OAuth2 provider. Auth0 will execute this script to call the OAuth2 provider API and get the user profile:
| 0 |
diff --git a/test/jasmine/tests/updatemenus_test.js b/test/jasmine/tests/updatemenus_test.js @@ -651,7 +651,7 @@ describe('update menus interactions', function() {
return Plotly.relayout(gd, 'updatemenus[1].buttons[1].label', 'a looooooooooooong<br>label');
}).then(function() {
- assertItemDims(selectHeader(1), 179, 35);
+ assertItemDims(selectHeader(1), 165, 35);
return click(selectHeader(1));
}).then(function() {
| 3 |
diff --git a/src/reducers/account/index.js b/src/reducers/account/index.js @@ -14,7 +14,8 @@ import {
checkCanEnableTwoFactor,
get2faMethod,
getLedgerKey,
- getProfileBalance
+ updateStakingAccount,
+ updateStakingLockup
} from '../../actions/account'
import { LOCKUP_MIN_BALANCE } from '../../utils/account-with-lockup'
@@ -124,10 +125,16 @@ const account = handleActions({
account: payload
}
}),
- ...payload
- }
- }
+ [updateStakingLockup]: (state, { error, meta, payload, ready }) =>
+ (!ready || error)
+ ? state
+ : ({
+ ...state,
+ balance: {
+ ...state.balance,
+ lockupAccount: payload
}
+ })
}, initialState)
export default reduceReducers(
| 9 |
diff --git a/packages/react-router-dom/docs/guides/scroll-restoration.md b/packages/react-router-dom/docs/guides/scroll-restoration.md @@ -26,6 +26,20 @@ class ScrollToTop extends Component {
export default withRouter(ScrollToTop);
```
+Or if you are running React 16.8 and above, you can use hooks:
+
+```jsx
+const ScrollToTop = ({ children, location: { pathname } }) => {
+ useEffect(() => {
+ window.scrollTo(0, 0);
+ }, [pathname]);
+
+ return children;
+};
+
+export default withRouter(ScrollToTop);
+```
+
Then render it at the top of your app, but below Router
```jsx
| 0 |
diff --git a/server/preprocessing/other-scripts/openaire.R b/server/preprocessing/other-scripts/openaire.R @@ -150,7 +150,8 @@ fill_dois <- function(df) {
dois <- mapply(check_distance, titles, candidates, USE.NAMES=FALSE)
} else if (length(titles) == 1) {
response <- cr_works(flq=c('query.title'=titles))$data
- dois <- check_distance(titles, response[1,])
+ candidate_response = response[1,]
+ dois <- check_distance(titles, candidate_response)
} else {
dois <- ""
}
@@ -160,7 +161,7 @@ fill_dois <- function(df) {
check_distance <- function(title, candidate) {
lv_ratio <- levenshtein_ratio(tolower(title), tolower(candidate$title))
- if (lv_ratio <= 1/15.83){
+ if (!is.na(lv_ratio) && lv_ratio <= 1/15.83){
doi <- candidate$doi
} else {
doi <- ""
| 1 |
diff --git a/src/gameClasses/components/ui/ItemUiComponent.js b/src/gameClasses/components/ui/ItemUiComponent.js @@ -351,7 +351,8 @@ var ItemUiComponent = IgeEntity.extend({
value = ige.game.secondsToHms(attribute.value);
}
else {
- value = parseInt(attribute.value);
+ var decimalPlace = parseInt(attribute.decimalPlaces) || 0;
+ value = parseFloat(attribute.value).toFixed(decimalPlace);
}
info += '<b>' + attribute.name + ': </b>' + (value || 0);
info += '</p>';
| 11 |
diff --git a/src/common/quiz/mastery_mode.js b/src/common/quiz/mastery_mode.js -'use strict'
const reload = require('require-reload')(require);
const globals = require('./../globals.js');
const SettingsOverride = reload('./settings_override.js');
-const TIMES_CORRECT_BASE_REINSERTION_INDEX_MODIFIER = 12;
-const PERCENT_CORRECT_FOR_MASTERY = .75;
-
-const IndexTopForTimesCorrect = {
- 0: 12,
- 1: 24,
- 2: 36,
- 3: 48,
- 4: 60,
- 5: 90,
- 6: 130,
+const PERCENT_CORRECT_FOR_MASTERY = .76;
+
+const indexTopForStreakLength = {
+ 0: 15,
+ 1: 25,
+ 2: 60,
+ 3: 120,
+ 4: 240,
+ 5: 360,
+ 6: 480,
+ length: 7,
};
function overrideDeckTitle(originalTitle) {
@@ -26,32 +25,39 @@ function calculatePercentCorrect(card) {
return percentCorrect;
}
-function recycleCard(card, upcomingCardsIndexArray, numDecks) {
- if (calculatePercentCorrect(card) >= PERCENT_CORRECT_FOR_MASTERY) {
- return false;
- }
-
- let numberOfLastXCorrect = 0;
- for (let i = card.answerHistory.length - 1; i > card.answerHistory.length - 6; --i) {
+function calculateStreakLength(card) {
+ let streakLength = 0;
+ for (let i = card.answerHistory.length - 1; i >= 0; i -= 1) {
if (card.answerHistory[i]) {
- ++numberOfLastXCorrect;
+ ++streakLength;
} else {
break;
}
}
- let indexTop = IndexTopForTimesCorrect[numberOfLastXCorrect];
- if (!indexTop) {
- indexTop = IndexTopForTimesCorrect[6] * (numberOfLastXCorrect - 5)
+ return streakLength;
+}
+
+function calculateIndexTop(streakLength) {
+ return indexTopForStreakLength[streakLength]
+ || indexTopForStreakLength[indexTopForStreakLength.length - 1] * (streakLength - indexTopForStreakLength.length + 2);
}
- let arraySize = upcomingCardsIndexArray.length;
- let randomFactor = Math.random() * .70 + .30;
- let newDistanceFromFront = Math.floor(indexTop * (numberOfLastXCorrect + 1) * randomFactor * 1 / numDecks);
+function recycleCard(card, upcomingCardsIndexArray, numDecks) {
+ if (calculatePercentCorrect(card) >= PERCENT_CORRECT_FOR_MASTERY) {
+ return false;
+ }
+
+ const streakLength = calculateStreakLength(card);
+ const indexTop = calculateIndexTop(streakLength);
+
+ const arraySize = upcomingCardsIndexArray.length;
+ const randomFactor = Math.random() * .40 + .60;
+ const newDistanceFromFront = Math.floor(indexTop * randomFactor / numDecks);
let index = arraySize - 1 - newDistanceFromFront;
if (index < 0) {
- index = arraySize - 1 - (newDistanceFromFront / 2);
+ index = arraySize - 1 - Math.floor(newDistanceFromFront / 2);
if (index < 0) {
if (card.answerHistory[card.answerHistory.length - 1]) {
return false;
| 7 |
diff --git a/lib/node_modules/@stdlib/_tools/pkgs/namespace-deps/lib/deps.js b/lib/node_modules/@stdlib/_tools/pkgs/namespace-deps/lib/deps.js @@ -28,7 +28,7 @@ var startsWith = require( '@stdlib/string/starts-with' );
var replace = require( '@stdlib/string/replace' );
var contains = require( '@stdlib/assert/contains' );
var pkgDeps = require( '@stdlib/_tools/pkgs/deps' ).sync;
-var libraryManifest = require( '@stdlib/tools/library-manifest' );
+var readJSON = require( '@stdlib/fs/read-json' ).sync;
var standalonePackage = require( './standalone_package.js' );
var prunePackage = require( './prune_package.js' );
var unique = require( './unique.js' );
@@ -57,12 +57,15 @@ function namespaceDeps( ns, level, dev ) {
var fileDeps;
var manifest;
var entry;
+ var conf;
var deps;
var name;
+ var task;
var def;
var pkg;
var i;
var j;
+
namespacePkgs = pkgDeps( [ ns ], {
'dev': dev,
'dir': getRoot( '' )
@@ -72,24 +75,37 @@ function namespaceDeps( ns, level, dev ) {
try {
entry = path.dirname( require.resolve( ns ) );
def = readFileSync( path.join( entry, '..', 'docs', 'types', 'index.d.ts' ), 'utf-8' );
- if ( contains( def, STDLIB_TYPES ) ) {
+ if ( contains( def, STDLIB_TYPES ) && !dev ) {
deps.push( '@stdlib/types' );
}
} catch ( err ) {
debug( 'Encountered an error while reading `index.d.ts` file: '+err.message );
}
- if ( !dev ) {
try {
- manifest = libraryManifest( path.join( entry, '..', 'manifest.json' ), {} );
- for ( i = 0; i < manifest.dependencies.length; i++ ) {
- if ( !startsWith( manifest.dependencies[ i ], ns ) ) {
- deps.push( manifest.dependencies[ i ] );
+ manifest = readJSON( path.join( entry, '..', 'manifest.json' ) );
+ if ( !dev ) {
+ deps.push( '@stdlib/tools/library-manifest' );
+ }
+ task = manifest.options.task;
+ for ( i = 0; i < manifest.confs.length; i++ ) {
+ conf = manifest.confs[ i ];
+ if ( !dev && conf.task === task ) {
+ for ( j = 0; j < conf.dependencies.length; j++ ) {
+ if ( !startsWith( conf.dependencies[ j ], ns ) ) {
+ deps.push( conf.dependencies[ j ] );
+ }
+ }
+ } else if ( dev ) {
+ for ( j = 0; j < conf.dependencies.length; j++ ) {
+ if ( !startsWith( conf.dependencies[ j ], ns ) ) {
+ deps.push( conf.dependencies[ j ] );
+ }
+ }
}
}
} catch ( err ) {
debug( 'No manifest.json file present for '+ns+'. Error: '+err.message );
}
- }
for ( i = 0; i < namespacePkgs.length; i++ ) {
pkg = namespacePkgs[ i ];
if ( startsWith( pkg, ns ) ) {
| 9 |
diff --git a/lib/modules/contracts_manager/index.js b/lib/modules/contracts_manager/index.js @@ -41,9 +41,6 @@ class ContractsManager {
});
self.events.setCommandHandler("contracts:reset:dependencies", (cb) => {
- for (let className in self.contracts) {
- self.contracts[className].dependencyCount = null;
- }
self.contractDependencies = {};
cb();
});
@@ -286,43 +283,6 @@ class ContractsManager {
}
}
callback();
- },
- function setDependencyCount(callback) {
- let className;
-
- function getDependencyCount(contractName, cycleDetector) {
- if (!self.contracts[contractName]) {
- return 0;
- }
- if (self.contracts[contractName].dependencyCount || self.contracts[contractName].dependencyCount === 0) {
- // Already have that count
- return self.contracts[contractName].dependencyCount;
- }
- if (!self.contractDependencies[contractName] || !self.contractDependencies[contractName].length) {
- self.contracts[contractName].dependencyCount = 0;
- return 0;
- }
- let total = self.contractDependencies[contractName].length;
- self.contractDependencies[contractName].some(dependencyName => {
- if (cycleDetector.indexOf(dependencyName) > -1) {
- // We are in a cycle because of the dependency, set both to Infinity
- self.contracts[dependencyName].dependencyCount = Infinity;
- total = Infinity;
- return true;
- }
- cycleDetector.push(dependencyName);
- total += getDependencyCount(dependencyName, cycleDetector);
- });
- self.contracts[contractName].dependencyCount = total;
- return total;
- }
-
- let cycleDetector;
- for (className in self.contracts) {
- cycleDetector = [];
- getDependencyCount(className, cycleDetector);
- }
- callback();
}
], function (err) {
if (err) {
| 2 |
diff --git a/src/graphql/queries/__tests__/__snapshots__/ListArticles.js.snap b/src/graphql/queries/__tests__/__snapshots__/ListArticles.js.snap @@ -149,6 +149,12 @@ Object {
"data": Object {
"ListArticles": Object {
"edges": Array [
+ Object {
+ "cursor": "WyJkb2MjbGlzdEFydGljbGVUZXN0NCJd",
+ "node": Object {
+ "id": "listArticleTest4",
+ },
+ },
Object {
"cursor": "WyJkb2MjbGlzdEFydGljbGVUZXN0MyJd",
"node": Object {
@@ -169,10 +175,10 @@ Object {
},
],
"pageInfo": Object {
- "firstCursor": "WyJkb2MjbGlzdEFydGljbGVUZXN0MyJd",
+ "firstCursor": "WyJkb2MjbGlzdEFydGljbGVUZXN0NCJd",
"lastCursor": "WyJkb2MjbGlzdEFydGljbGVUZXN0MSJd",
},
- "totalCount": 3,
+ "totalCount": 4,
},
},
}
@@ -183,6 +189,11 @@ Object {
"data": Object {
"ListArticles": Object {
"edges": Array [
+ Object {
+ "node": Object {
+ "id": "listArticleTest4",
+ },
+ },
Object {
"node": Object {
"id": "listArticleTest3",
@@ -200,10 +211,10 @@ Object {
},
],
"pageInfo": Object {
- "firstCursor": "WzMsImRvYyNsaXN0QXJ0aWNsZVRlc3QzIl0=",
+ "firstCursor": "WzQsImRvYyNsaXN0QXJ0aWNsZVRlc3Q0Il0=",
"lastCursor": "WzEsImRvYyNsaXN0QXJ0aWNsZVRlc3QxIl0=",
},
- "totalCount": 3,
+ "totalCount": 4,
},
},
}
@@ -224,6 +235,11 @@ Object {
"id": "listArticleTest2",
},
},
+ Object {
+ "node": Object {
+ "id": "listArticleTest4",
+ },
+ },
Object {
"node": Object {
"id": "listArticleTest3",
@@ -234,7 +250,7 @@ Object {
"firstCursor": "WzIsImRvYyNsaXN0QXJ0aWNsZVRlc3QxIl0=",
"lastCursor": "WzAsImRvYyNsaXN0QXJ0aWNsZVRlc3QzIl0=",
},
- "totalCount": 3,
+ "totalCount": 4,
},
},
}
@@ -252,10 +268,10 @@ Object {
},
],
"pageInfo": Object {
- "firstCursor": "WyJkb2MjbGlzdEFydGljbGVUZXN0MyJd",
+ "firstCursor": "WyJkb2MjbGlzdEFydGljbGVUZXN0NCJd",
"lastCursor": "WyJkb2MjbGlzdEFydGljbGVUZXN0MSJd",
},
- "totalCount": 3,
+ "totalCount": 4,
},
},
}
@@ -266,6 +282,11 @@ Object {
"data": Object {
"ListArticles": Object {
"edges": Array [
+ Object {
+ "node": Object {
+ "id": "listArticleTest4",
+ },
+ },
Object {
"node": Object {
"id": "listArticleTest3",
@@ -273,10 +294,10 @@ Object {
},
],
"pageInfo": Object {
- "firstCursor": "WyJkb2MjbGlzdEFydGljbGVUZXN0MyJd",
+ "firstCursor": "WyJkb2MjbGlzdEFydGljbGVUZXN0NCJd",
"lastCursor": "WyJkb2MjbGlzdEFydGljbGVUZXN0MSJd",
},
- "totalCount": 3,
+ "totalCount": 4,
},
},
}
| 3 |
diff --git a/app_web/src/ui/sass.scss b/app_web/src/ui/sass.scss @@ -11,7 +11,6 @@ $primary-dark: findDarkColor($primary);
$primary-invert: findColorInvert($primary);
$border: #f5f5f5;
$text: #f5f5f5;
-$text-invert: #7cff92;
// this changes the color of labels, etc. (i dont know why either...)
$text-strong: #f5f5f5;
$dark: #f5f5f5;
| 2 |
diff --git a/core/server/api/v3/pages.js b/core/server/api/v3/pages.js const models = require('../../models');
-const i18n = require('../../../shared/i18n');
+const tpl = require('@tryghost/tpl');
const errors = require('@tryghost/errors');
const getPostServiceInstance = require('../../services/posts/posts-service');
const ALLOWED_INCLUDES = ['tags', 'authors', 'authors.roles'];
const UNSAFE_ATTRS = ['status', 'authors', 'visibility'];
+const messages = {
+ pageNotFound: 'Page not found'
+};
const postsService = getPostServiceInstance('v3');
@@ -75,7 +78,7 @@ module.exports = {
.then((model) => {
if (!model) {
throw new errors.NotFoundError({
- message: i18n.t('errors.api.pages.pageNotFound')
+ message: tpl(messages.pageNotFound)
});
}
@@ -188,7 +191,7 @@ module.exports = {
.then(() => null)
.catch(models.Post.NotFoundError, () => {
return Promise.reject(new errors.NotFoundError({
- message: i18n.t('errors.api.pages.pageNotFound')
+ message: tpl(messages.pageNotFound)
}));
});
}
| 14 |
diff --git a/packages/design-tools/src/__stories__/DataFlow.stories.js b/packages/design-tools/src/__stories__/DataFlow.stories.js @@ -28,6 +28,10 @@ export default {
const dataStore = createStore((set) => ({
height: 0,
+ width: 0,
+ x: 0,
+ y: 0,
+ z: 0,
}));
const AppContext = React.createContext({ dataStore });
@@ -37,12 +41,8 @@ const useSubState = (fn) => {
return React.useRef(createStore(fn)).current;
};
-const TextControl = ({
- onChange = noop,
- onUpdate = noop,
- validate,
- value: initialValue,
-}) => {
+const TextControl = React.memo(
+ ({ onChange = noop, onUpdate = noop, validate, value: initialValue }) => {
const textControl = useTextControl({
onChange,
validate,
@@ -50,8 +50,11 @@ const TextControl = ({
value: initialValue,
});
- return <TextInput {...textControl} autoComplete="off" spellCheck={false} />;
-};
+ return (
+ <TextInput {...textControl} autoComplete="off" spellCheck={false} />
+ );
+ },
+);
function useTextControl({
onBlur = noop,
@@ -166,9 +169,16 @@ const RenderedValues = () => {
);
};
-const DataControl = ({ label = 'Label', prop, validate, onUpdate = noop }) => {
+const useDataStoreValue = ({ prop }) => {
const { dataStore } = useAppContext();
- const data = dataStore();
+ const value = dataStore(React.useCallback((state) => state[prop], [prop]));
+
+ return [value, dataStore];
+};
+
+const DataControl = React.memo(
+ ({ label = 'Label', prop, validate, onUpdate = noop }) => {
+ const [value, dataStore] = useDataStoreValue({ prop });
const handleOnChange = React.useCallback(
(next) => {
@@ -184,14 +194,15 @@ const DataControl = ({ label = 'Label', prop, validate, onUpdate = noop }) => {
onChange={handleOnChange}
onUpdate={onUpdate}
validate={validate}
- value={data[prop]}
+ value={value}
/>
</Grid>
</FormGroup>
);
-};
+ },
+);
-const ChangeNotification = ({ store }) => {
+const ChangeNotification = React.memo(({ store }) => {
const { count, visible } = store();
const timeoutRef = React.useRef();
@@ -223,7 +234,7 @@ const ChangeNotification = ({ store }) => {
Incoming Change
</Badge>
);
-};
+});
const useChangeStore = () => {
return useSubState((set) => ({
@@ -235,9 +246,9 @@ const useChangeStore = () => {
}));
};
-const DataStoreLayer = () => {
+const DataStoreLayer = React.memo(() => {
const store = useChangeStore();
- const { increment } = store();
+ const increment = store(React.useCallback((state) => state.increment, []));
return (
<VStack>
@@ -252,16 +263,40 @@ const DataStoreLayer = () => {
prop="height"
validate={/^[0-9]*$/gi}
/>
+ <DataControl
+ label="Width"
+ onUpdate={increment}
+ prop="width"
+ validate={/^[0-9]*$/gi}
+ />
+ <DataControl
+ label="X"
+ onUpdate={increment}
+ prop="x"
+ validate={/^[0-9]*$/gi}
+ />
+ <DataControl
+ label="Y"
+ onUpdate={increment}
+ prop="y"
+ validate={/^[0-9]*$/gi}
+ />
+ <DataControl
+ label="Z"
+ onUpdate={increment}
+ prop="z"
+ validate={/^[0-9]*$/gi}
+ />
</ListGroup>
</CardBody>
</Card>
</VStack>
);
-};
+});
-const ControlsLayer = () => {
+const ControlsLayer = React.memo(() => {
const store = useChangeStore();
- const { increment } = store();
+ const increment = store(React.useCallback((state) => state.increment, []));
return (
<VStack>
@@ -278,14 +313,38 @@ const ControlsLayer = () => {
prop="height"
validate={/^[0-9]*$/gi}
/>
+ <DataControl
+ label="Width"
+ onUpdate={increment}
+ prop="width"
+ validate={/^[0-9]*$/gi}
+ />
+ <DataControl
+ label="X"
+ onUpdate={increment}
+ prop="x"
+ validate={/^[0-9]*$/gi}
+ />
+ <DataControl
+ label="Y"
+ onUpdate={increment}
+ prop="y"
+ validate={/^[0-9]*$/gi}
+ />
+ <DataControl
+ label="Z"
+ onUpdate={increment}
+ prop="z"
+ validate={/^[0-9]*$/gi}
+ />
</ListGroup>
</CardBody>
</Card>
</VStack>
);
-};
+});
-const RenderedLayer = () => {
+const RenderedLayer = React.memo(() => {
const { dataStore } = useAppContext();
const store = useChangeStore();
@@ -308,7 +367,7 @@ const RenderedLayer = () => {
</Card>
</VStack>
);
-};
+});
const Example = () => {
return (
| 7 |
diff --git a/token-metadata/0x685aea4F02E39E5a5BB7f7117E88DB1151F38364/metadata.json b/token-metadata/0x685aea4F02E39E5a5BB7f7117E88DB1151F38364/metadata.json "symbol": "POSH",
"address": "0x685aea4F02E39E5a5BB7f7117E88DB1151F38364",
"decimals": 18,
- "dharmaVerificationStatus": {
"dharmaVerificationStatus": "VERIFIED"
}
\ No newline at end of file
-}
\ No newline at end of file
| 3 |
diff --git a/test/Message.test.js b/test/Message.test.js const expect = require("chai").expect;
-const {WebMidi, Message} = require("../dist/webmidi.cjs.js");
+const {Message} = require("../dist/webmidi.cjs.js");
describe("Message Object", function() {
@@ -29,36 +29,37 @@ describe("Message Object", function() {
items.forEach(item => {
data[0] = item.status;
const message = new Message(data);
- expect(message.systemMessage).to.be.true;
+ expect(message.isSystemMessage).to.be.true;
expect(message.type).to.equal(item.type);
});
});
- it("should correctly set the type of message for channel voice messages", function() {
-
- // Arrange
- let data = new Uint8Array(3);
-
- const items = [
- {noteoff: 0x8},
- {noteon: 0x9},
- {keyaftertouch: 0xA},
- {controlchange: 0xB},
- {programchange: 0xC},
- {channelaftertouch: 0xD},
- {pitchbend: 0xE},
- ];
+ it("should correctly set the type of message for channel messages");
+ // it("should correctly set the type of message for channel messages", function() {
+ //
+ // // Arrange
+ // let data = new Uint8Array(3);
+ //
+ // const items = [
+ // {noteoff: 0x8},
+ // {noteon: 0x9},
+ // {keyaftertouch: 0xA},
+ // {controlchange: 0xB},
+ // {programchange: 0xC},
+ // {channelaftertouch: 0xD},
+ // {pitchbend: 0xE},
+ // ];
//
// // Act
// items.forEach(item => {
// data[0] = item.status;
// const message = new Message(data);
- // expect(message.systemMessage).to.be.true;
+ // expect(message.isSystemMessage).to.be.true;
// expect(message.type).to.equal(item.type);
// });
-
- });
+ //
+ // });
});
| 12 |
diff --git a/articles/api-auth/grant/password.md b/articles/api-auth/grant/password.md @@ -54,5 +54,5 @@ For details on how to implement multifactor authentication, refer to [Multifacto
## Tutorials
- - [Configuring your tenant for API Authorization](/api-auth/tutorials/configuring-tenant-for-api-auth)
- - [Executing a Resource Owner Password Grant](/api-auth/tutorials/password-grant)
+ - [How to Execute a Resource Owner Password Grant](/api-auth/tutorials/password-grant)
+ - [How to use MFA with Resource Owner Password Grant](/api-auth/tutorials/multifactor-resource-owner-password)
| 0 |
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
+ <!-- Accepts URIs that begin with "https://*.coopcycle.org/register/confirm -->
+ <intent-filter>
+ <action android:name="android.intent.action.VIEW" />
+ <category android:name="android.intent.category.DEFAULT" />
+ <category android:name="android.intent.category.BROWSABLE" />
+ <data
+ android:scheme="https"
+ android:host="*.coopcycle.org"
+ android:pathPrefix="/register/confirm" />
+ </intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
| 9 |
diff --git a/runtime.js b/runtime.js @@ -30,6 +30,7 @@ const _importMapUrl = u => new URL(u, location.protocol + '//' + location.host).
const importMap = {
three: _importMapUrl('./three.module.js'),
app: _importMapUrl('./app-object.js'),
+ world: _importMapUrl('./world.js'),
runtime: _importMapUrl('./runtime.js'),
physicsManager: _importMapUrl('./physics-manager.js'),
BufferGeometryUtils: _importMapUrl('./BufferGeometryUtils.js'),
@@ -274,6 +275,24 @@ const _loadImg = async file => {
mesh.frustumCulled = false;
return mesh;
};
+const _makeAppUrl = appId => {
+ const s = `\
+ import {renderer as _renderer, scene, camera, orbitControls, appManager} from ${JSON.stringify(importMap.app)};
+ import runtime from ${JSON.stringify(importMap.runtime)};
+ import {world} from ${JSON.stringify(importMap.world)};
+ import physics from ${JSON.stringify(importMap.physicsManager)};
+ const renderer = Object.create(_renderer);
+ renderer.setAnimationLoop = function(fn) {
+ appManager.setAnimationLoop(${appId}, fn);
+ };
+ const app = appManager.getApp(${appId});
+ export {renderer, scene, camera, orbitControls, runtime, world, physics, app, appManager};
+ `;
+ const b = new Blob([s], {
+ type: 'application/javascript',
+ });
+ return URL.createObjectURL(b);
+};
const _loadScript = async file => {
const appId = ++appIds;
const mesh = makeIconMesh();
@@ -302,23 +321,7 @@ const _loadScript = async file => {
const app = appManager.createApp(appId);
app.object = mesh;
const localImportMap = _clone(importMap);
- localImportMap.app = (() => {
- const s = `\
- import {renderer as _renderer, scene, camera, orbitControls, appManager} from ${JSON.stringify(importMap.app)};
- import runtime from ${JSON.stringify(importMap.runtime)};
- import physics from ${JSON.stringify(importMap.physicsManager)};
- const renderer = Object.create(_renderer);
- renderer.setAnimationLoop = function(fn) {
- appManager.setAnimationLoop(${appId}, fn);
- };
- const app = appManager.getApp(${appId});
- export {renderer, scene, camera, orbitControls, runtime, physics, app, appManager};
- `;
- const b = new Blob([s], {
- type: 'application/javascript',
- });
- return URL.createObjectURL(b);
- })();
+ localImportMap.app = _makeAppUrl(appId);
app.files = new Proxy({}, {
get(target, p) {
return new URL(p, srcUrl).href;
@@ -418,23 +421,7 @@ const _loadWebBundle = async file => {
const app = appManager.createApp(appId);
app.object = mesh;
const localImportMap = _clone(importMap);
- localImportMap.app = (() => {
- const s = `\
- import {renderer as _renderer, scene, camera, orbitControls, appManager} from ${JSON.stringify(importMap.app)};
- import runtime from ${JSON.stringify(importMap.runtime)};
- import physics from ${JSON.stringify(importMap.physicsManager)};
- const renderer = Object.create(_renderer);
- renderer.setAnimationLoop = function(fn) {
- appManager.setAnimationLoop(${appId}, fn);
- };
- const app = appManager.getApp(${appId});
- export {renderer, scene, camera, orbitControls, runtime, physics, app, appManager};
- `;
- const b = new Blob([s], {
- type: 'application/javascript',
- });
- return URL.createObjectURL(b);
- })();
+ localImportMap.app = _makeAppUrl(appId);
const cachedUrls = [];
const _getUrl = u => {
| 0 |
diff --git a/src/createServer.js b/src/createServer.js @@ -17,12 +17,15 @@ function createServer (options = {}) {
'server-port': serverPort,
port = serverPort || 25565,
motd = 'A Minecraft server',
- 'max-players': maxPlayers = 20,
+ 'max-players': maxPlayersOld = 20,
+ maxPlayers: maxPlayersNew = 20,
version,
favicon,
customPackets
} = options
+ const maxPlayers = options['max-players'] !== undefined ? maxPlayersOld : maxPlayersNew
+
const optVersion = version === undefined || version === false ? require('./version').defaultVersion : version
const mcData = require('minecraft-data')(optVersion)
| 9 |
diff --git a/js/jquery.terminal.d.ts b/js/jquery.terminal.d.ts @@ -87,7 +87,7 @@ declare namespace JQueryTerminal {
type commandsCmdFunction = (command: string) => any;
type setStringFunction = (value: string) => void;
- type greetingsArg = ((setPrompt: setStringFunction) => void) | string;
+ type greetingsArg = ((this: JQueryTerminal, setPrompt: setStringFunction) => void) | string;
type cmdPrompt = ((setPrompt: setStringFunction) => void) | string;
type ExtendedPrompt = ((this: JQueryTerminal, setPrompt: setStringFunction) => (void | PromiseLike<string>)) | string;
| 4 |
diff --git a/src/dot.js b/src/dot.js @@ -22,7 +22,7 @@ export function initViz() {
this._worker.onmessage = function(event) {
graphvizInstance._dispatch.call("initEnd", this);
};
- if (vizURL[0] == '.') {
+ if (!vizURL.match(/^https?:\/\/|^\/\//i)) {
// Local URL. Prepend with local domain to be usable in web worker
vizURL = document.location.protocol + '//' + document.location.host + '/' + vizURL;
}
| 9 |
diff --git a/token-metadata/0xC4cB5793BD58BaD06bF51FB37717b86B02CBe8A4/metadata.json b/token-metadata/0xC4cB5793BD58BaD06bF51FB37717b86B02CBe8A4/metadata.json "symbol": "CREDIT",
"address": "0xC4cB5793BD58BaD06bF51FB37717b86B02CBe8A4",
"decimals": 18,
- "dharmaVerificationStatus": {
"dharmaVerificationStatus": "VERIFIED"
}
\ No newline at end of file
-}
\ No newline at end of file
| 3 |
diff --git a/conf/evolutions/default/98.sql b/conf/evolutions/default/98.sql @@ -4,7 +4,11 @@ SET computation_method = 'approximation2',
geom = ST_Project(
ST_SetSRID(ST_Point(panorama_lng, panorama_lat), 4326),
GREATEST(0.0, 20.8794248 + 0.0184087 * sv_image_y + 0.0022135 * canvas_y),
- radians(heading -27.5267447 + 0.0784357 * canvas_x)
+ CASE
+ WHEN heading -27.5267447 + 0.0784357 * canvas_x < -360 THEN radians(360 + heading -27.5267447 + 0.0784357 * canvas_x)
+ WHEN heading -27.5267447 + 0.0784357 * canvas_x > 360 THEN radians(-360 + heading -27.5267447 + 0.0784357 * canvas_x)
+ ELSE radians(heading -27.5267447 + 0.0784357 * canvas_x)
+ END
)::geometry
FROM label
WHERE label_point.label_id = label.label_id
| 1 |
diff --git a/README.md b/README.md @@ -54,8 +54,8 @@ npm install jquery.tabulator --save
### CDNJS
To access Tabulator directly from the CDNJS CDN servers, include the following two lines at the start of your project, instead of the localy hosted versions:
```html
-<link href="https://cdnjs.cloudflare.com/ajax/libs/tabulator/3.4.3/css/tabulator.min.css" rel="stylesheet">
-<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/tabulator/3.4.3/js/tabulator.min.js"></script>
+<link href="https://cdnjs.cloudflare.com/ajax/libs/tabulator/3.4.5/css/tabulator.min.css" rel="stylesheet">
+<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/tabulator/3.4.5/js/tabulator.min.js"></script>
```
Coming Soon
| 3 |
diff --git a/appjs/logicjavascript.js b/appjs/logicjavascript.js @@ -18608,65 +18608,6 @@ function oddsCalc() {
}
}
-//Coefficient of Variation Calculator
-function covcal()
-{
- var num1=document.getElementById("setx").value;
- var num2=document.getElementById("sety").value;
- valid=/^([-]{0,1}\d{1,}[\.]{0,1}\d{0,}[ ]?)*$/;
- var s="";
- if(num1==""||num2=="")
- {
- s= "Please enter number";
- }
- else if(!valid.test(num1&&num2))
- {
- s= "Enter space separated numbers. Use of alphabets and special character is not allowed for calculation purpose";
- }
- else{
- num1=num1.trim();
- num1 = num1.split(" ");
- var len1=parseInt(num1.length);
-
- var number1=[], sum1=0, sum2=0;
- for (i = 0; i < len1; i++)
- {
-
- number1[i] = parseFloat(num1[i].trim());
- sum1+=number1[i];
- }
- sum1=sum1/len1;
-
- num2=num2.trim();
- num2 = num2.split(" ");
- var len2=parseInt(num2.length);
- if(len1!=len2)
- {
- s="Your datasets X and Y contain different numbers of element";
- }
- else{
- var number2=[];
- for (i = 0; i < len2; i++) {
- number2[i] = parseFloat(num2[i].trim());
- sum2+=number2[i];
- }
-
- sum2=sum2/len2;
-
- var covsum=0;
- for (i = 0; i < len2; i++)
- {
- var d=number2[i]-sum2;
- var f=number1[i]-sum1;
- covsum+=(d*f);
- }
- var cov=(covsum)/(len2-1);
- s="The calculated covariance is: "+cov;
-}
-}
-
-document.getElementById("covans").innerHTML=s;
-}
//LINEAR REGRESSION CALCULATOR
function lrccal()
{
| 1 |
diff --git a/lib/views/widget/logo.html b/lib/views/widget/logo.html -<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 226.44 196.11">
+<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" viewBox="0 0 226.44 196.11">
<polygon class="group2" points="56.61 196.11 169.83 196.11 226.44 98.06 188.7 98.06 150.96 163.43 75.48 163.43 56.61 196.11" />
<polygon class="group1" points="75.48 98.05 94.35 65.37 150.96 65.38 207.57 65.37 207.57 65.38 226.44 98.06 169.83 98.06 113.22 98.06 94.39 130.66 94.3 130.66 84.92 114.4 75.48 98.05" />
<polygon class="group1" points="0 98.06 56.6 0 113.22 0.01 169.83 0.01 169.83 0.01 188.69 32.68 132.09 32.69 75.47 32.69 18.86 130.74 0 98.06" />
| 12 |
diff --git a/packages/mermaid/src/mermaidAPI.ts b/packages/mermaid/src/mermaidAPI.ts @@ -529,8 +529,8 @@ const render = function (
// This is the d3 node for the svg element
const svgNode = root.select(`${enclosingDivID_selector} svg`);
setA11yDiagramInfo(svgNode, graphType);
- const a11yTitle = diag.db.getAccTitle !== undefined ? diag.db.getAccTitle() : null;
- const a11yDescr = diag.db.getAccDescription !== undefined ? diag.db.getAccDescription() : null;
+ const a11yTitle = diag.db.getAccTitle?.();
+ const a11yDescr = diag.db.getAccDescription?.();
addSVGa11yTitleDescription(svgNode, a11yTitle, a11yDescr, svgNode.attr('id'));
// -------------------------------------------------------------------------------
| 4 |
diff --git a/articles/connections/enterprise/google-apps.md b/articles/connections/enterprise/google-apps.md @@ -43,6 +43,10 @@ This doc refers to the client steps to connect your client. If you are looking t
9. Click **Save**.
+::: note
+Google may show an "unverified app" screen before displaying the consent screen for your app. To remove the unverified app screen, complete the [OAuth Developer Verification](https://support.google.com/code/contact/oauth_app_verification) process.
+:::
+
10. At this point, you will be prompted to provide additional information about your newly-created app.

| 0 |
diff --git a/src/feats.js b/src/feats.js @@ -301,7 +301,8 @@ const Feats = {
id: 'secondwind',
name: 'Second Wind',
description: 'Reinvigorate yourself in an instant.',
- activate: (player, args, rooms, npcs, players) => {
+
+ activate(player, args, rooms, npcs, players) {
const cooldownNotOver = player.getEffects('secondwind');
if (cooldownNotOver) {
@@ -326,12 +327,15 @@ const Feats = {
activate() {
player.say('<magenta>You feel a fell energy coursing through your veins.</magenta>')
},
+
deactivate() {
player.combat.removeSpeedMod('secondwind');
+
player.addEffect('secondwind hangover', {
duration: duration * 4,
name: 'Recovering from second wind',
type: 'slow',
+
activate() {
player.combat.addSpeedMod({
name: 'secondwind hangover',
@@ -344,9 +348,11 @@ const Feats = {
player.combat.removeSpeedMod('secondwind hangover');
player.say('<magenta>You feel normal again.</magenta>');
},
- })
+ });
},
+
});
+
},
},
@@ -363,7 +369,7 @@ const Feats = {
id: 'regeneration',
name: 'Regeneration',
description: 'Restore your own broken tissues.',
- activate: (player, args, rooms, npcs, players) => {
+ activate(player, args, rooms, npcs, players) {
const cooldownNotOver = player.getEffects('regeneration cooldown') || player.getEffects('regeneration');
if (cooldownNotOver) {
| 7 |
diff --git a/userscript.user.js b/userscript.user.js @@ -3653,7 +3653,8 @@ var $$IMU_EXPORT$$;
// http://blogfiles.pstatic.net/20140302_211/ttlyoung333_1393761808293P7TKj_JPEG/17.jpg -- cropped and upscaled (same as type=w1 and type=w2)
// http://blogfiles.naver.net/20140302_211/ttlyoung333_1393761808293P7TKj_JPEG/17.jpg -- works
// https for naver.net doesn't work (invalid certificate)
- .replace(/^https?(:\/\/blogfiles\.)pstatic\.net\/+/, "http$1naver.net/");
+ .replace(/(:\/\/blogfiles\.)pstatic\.net\/+/, "$1naver.net/")
+ .replace(/^https?(:\/\/[^/.]*(?:phinf|files)\.naver\.net\/)/, "http$1");
if (newsrc !== src)
return newsrc;
| 7 |
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb @@ -98,7 +98,7 @@ class ApplicationController < ActionController::Base
if user.present?
user.invalidate_all_sessions!
elsif opts[:scope]
- scope_user = ::User.where(username: opts[:scope]).first
+ scope_user = Carto::User.find_by(username: opts[:scope])
scope_user&.invalidate_all_sessions!
end
auth.cookies.delete(ME_ENDPOINT_COOKIE, domain: Cartodb.config[:session_domain])
| 4 |
diff --git a/packages/adapter/addon/rest.js b/packages/adapter/addon/rest.js @@ -302,7 +302,7 @@ let RESTAdapter = Adapter.extend(BuildURLMixin, {
// Avoid computed property override deprecation in fastboot as suggested by:
// https://deprecations.emberjs.com/v3.x/#toc_computed-property-override
get() {
- if (this._fastboot) {
+ if (this._fastboot !== undefined) {
return this._fastboot;
}
return (this._fastboot = getOwner(this).lookup('service:fastboot'));
@@ -326,7 +326,7 @@ let RESTAdapter = Adapter.extend(BuildURLMixin, {
} else if (hasNajax || hasJQuery) {
return false;
} else {
- return true;
+ return (this._useFetch = true);
}
},
set(key, value) {
| 12 |
diff --git a/src/components/common/composers/SampleSize.js b/src/components/common/composers/SampleSize.js import PropTypes from 'prop-types';
import React from 'react';
+import { connect } from 'react-redux';
import { VIEW_1K } from '../../../lib/topicFilterUtil';
/**
* Wrap any component that wants to display an EditableWordCloud. This passes
* a `fetchData` helper to the child component,.
*/
-const withSampleSize = (ChildComponent) => {
+const withSampleSize = (ChildComponent, onSampleSizeChange) => {
class SampleSize extends React.Component {
state = {
sampleSize: VIEW_1K,
};
setSampleSize = (nextSize) => {
- const { fetchData, filters } = this.props;
+ const { fetchData, filters, dispatch } = this.props;
this.setState({ sampleSize: nextSize });
+ if (onSampleSizeChange) {
+ onSampleSizeChange(dispatch, this.props, nextSize);
+ } else {
fetchData({ filters, sample_size: nextSize });
}
+ }
render() {
const { sampleSize } = this.state; // must instantiate here and pass as props to child component - this.state.sampleSize doesn't work
@@ -33,10 +38,11 @@ const withSampleSize = (ChildComponent) => {
}
SampleSize.propTypes = {
// from compositional chain
- fetchData: PropTypes.func.isRequired,
+ fetchData: PropTypes.func,
filters: PropTypes.object,
+ dispatch: PropTypes.func.isRequired,
};
- return SampleSize;
+ return connect()(SampleSize);
};
export default withSampleSize;
| 11 |
diff --git a/packages/insight-previous/src/components/transaction/transaction.html b/packages/insight-previous/src/components/transaction/transaction.html <ion-row align-items-end class="small" *ngIf="!showCoins">
<ion-col col-12 text-right text-uppercase>
- <button ion-button small item-end color="danger" *ngIf="tx.confirmations === 0">
+ <ion-chip item-end color="danger" *ngIf="tx.confirmations === 0">
+ <ion-label>
Unconfirmed
- </button>
- <button ion-button small item-end color="warning" *ngIf="tx.confirmations === 1">
+ </ion-label>
+ </ion-chip>
+ <ion-chip item-end color="warning" *ngIf="tx.confirmations === 1">
+ <ion-label>
1 Confirmation
- </button>
- <button ion-button small item-end color="primary" *ngIf="tx.confirmations > 1">
+ </ion-label>
+ </ion-chip>
+ <ion-chip item-end color="primary" *ngIf="tx.confirmations > 1">
+ <ion-label>
{{ tx.confirmations | number }} Confirmations
- </button>
- <button ion-button small item-end color="brand">
+ </ion-label>
+ </ion-chip>
+ <ion-chip item-end color="brand">
+ <ion-label>
{{ currency.getConvertedNumber(tx.valueOut) | number:'1.0-8' }} {{ currency.currencySymbol }}
- </button>
+ </ion-label>
+ </ion-chip>
</ion-col>
</ion-row>
| 14 |
diff --git a/admin-base/ui.apps/src/main/content/jcr_root/apps/admin/components/workspace/template.vue b/admin-base/ui.apps/src/main/content/jcr_root/apps/admin/components/workspace/template.vue }"><i class="material-icons">keyboard_arrow_left</i>
</admin-components-action>
- <div v-bind:class="`right-panel ${isFullscreen ? 'fullscreen' : 'narrow'}`">
+ <aside v-bind:class="`right-panel ${isFullscreen ? 'fullscreen' : 'narrow'}`">
<admin-components-action v-if="!state.editorVisible" v-bind:model="{
classes: 'hide-right-panel',
target: 'rightPanelVisible',
type="button"
class="toggle-fullscreen"
v-on:click.prevent="onEditorNarrow">
- <i class="material-icons">highlight_off</i>
+ <i class="material-icons">fullscreen_exit</i>
</button>
<button
v-if="state.editorVisible && !isFullscreen"
v-bind:is = "getChildByPath('components').component"
v-bind:model = "getChildByPath('components')">
</component>
- </div>
+ </aside>
</div>
</template>
| 4 |
diff --git a/test/jasmine/tests/mapbox_test.js b/test/jasmine/tests/mapbox_test.js @@ -1551,45 +1551,6 @@ describe('@noCI, mapbox plots', function() {
});
});
- function getMapInfo(gd) {
- var subplot = gd._fullLayout.mapbox._subplot;
- var map = subplot.map;
-
- var sources = map.style.sourceCaches;
- var layers = map.style._layers;
- var uid = subplot.uid;
-
- var traceSources = Object.keys(sources).filter(function(k) {
- return k.indexOf('source-') === 0;
- });
-
- var traceLayers = Object.keys(layers).filter(function(k) {
- return k.indexOf('plotly-trace-layer-') === 0;
- });
-
- var layoutSources = Object.keys(sources).filter(function(k) {
- return k.indexOf(uid) !== -1;
- });
-
- var layoutLayers = Object.keys(layers).filter(function(k) {
- return k.indexOf(uid) !== -1;
- });
-
- return {
- map: map,
- div: subplot.div,
- sources: sources,
- layers: layers,
- traceSources: traceSources,
- traceLayers: traceLayers,
- layoutSources: layoutSources,
- layoutLayers: layoutLayers,
- center: map.getCenter(),
- zoom: map.getZoom(),
- style: map.getStyle()
- };
- }
-
function countVisibleTraces(gd, modes) {
var mapInfo = getMapInfo(gd);
var cnts = [];
@@ -1683,6 +1644,83 @@ describe('@noCI, mapbox plots', function() {
}
});
+describe('@noCI, mapbox react', function() {
+ var gd;
+
+ beforeEach(function() {
+ gd = createGraphDiv();
+ });
+
+ afterEach(function() {
+ Plotly.purge(gd);
+ destroyGraphDiv();
+ });
+
+ it('@gl should be able to react to new tiles', function(done) {
+ function assertTile(link) {
+ var mapInfo = getMapInfo(gd);
+ expect(mapInfo.style.sources.REF.tiles[0]).toEqual(link);
+ }
+
+ var firstLink = 'https://a.tile.openstreetmap.org/{z}/{x}/{y}.png';
+ var secondLink = 'https://a.tile.stamen.com/watercolor/{z}/{x}/{y}.jpg';
+
+ var fig = {
+ data: [
+ {
+ type: 'scattermapbox',
+ lon: [10, 20],
+ lat: [20, 10]
+ }
+ ],
+ layout: {
+ mapbox: {
+ style: {
+ version: 8,
+ sources: {
+ REF: {
+ type: 'raster',
+ tileSize: 256,
+ tiles: [firstLink]
+ }
+ },
+ layers: [{
+ id: 'REF',
+ source: 'REF',
+ type: 'raster'
+ }],
+ }
+ }
+ }
+ };
+
+ Plotly.newPlot(gd, fig)
+ .then(function() {
+ assertTile(firstLink);
+
+ // copy figure
+ var newFig = JSON.parse(JSON.stringify(fig));
+
+ // new figure
+ newFig.layout.mapbox.style.sources = {
+ REF: {
+ type: 'raster',
+ tileSize: 256,
+ tiles: [secondLink]
+ }
+ };
+
+ // update
+ Plotly.react(gd, newFig);
+ })
+ .then(function() {
+ assertTile(secondLink);
+ })
+ .catch(failTest)
+ .then(done);
+ }, LONG_TIMEOUT_INTERVAL);
+});
+
describe('@noCI test mapbox trace/layout *below* interactions', function() {
var gd;
@@ -2088,3 +2126,42 @@ describe('@noCI, mapbox toImage', function() {
.then(done);
}, LONG_TIMEOUT_INTERVAL);
});
+
+function getMapInfo(gd) {
+ var subplot = gd._fullLayout.mapbox._subplot;
+ var map = subplot.map;
+
+ var sources = map.style.sourceCaches;
+ var layers = map.style._layers;
+ var uid = subplot.uid;
+
+ var traceSources = Object.keys(sources).filter(function(k) {
+ return k.indexOf('source-') === 0;
+ });
+
+ var traceLayers = Object.keys(layers).filter(function(k) {
+ return k.indexOf('plotly-trace-layer-') === 0;
+ });
+
+ var layoutSources = Object.keys(sources).filter(function(k) {
+ return k.indexOf(uid) !== -1;
+ });
+
+ var layoutLayers = Object.keys(layers).filter(function(k) {
+ return k.indexOf(uid) !== -1;
+ });
+
+ return {
+ map: map,
+ div: subplot.div,
+ sources: sources,
+ layers: layers,
+ traceSources: traceSources,
+ traceLayers: traceLayers,
+ layoutSources: layoutSources,
+ layoutLayers: layoutLayers,
+ center: map.getCenter(),
+ zoom: map.getZoom(),
+ style: map.getStyle()
+ };
+}
| 0 |
diff --git a/constants.js b/constants.js @@ -69,6 +69,7 @@ export const crouchMaxTime = 200;
export const activateMaxTime = 750;
export const useMaxTime = 750;
export const aimMaxTime = 1000;
+export const throwReleaseTime = 750;
export const minFov = 60;
export const maxFov = 120;
export const initialPosY = 1.5;
| 0 |
diff --git a/src/commands/test/lib/included-files-parser.ts b/src/commands/test/lib/included-files-parser.ts @@ -3,6 +3,7 @@ import * as path from "path";
import * as pfs from "../../../util/misc/promisfied-fs";
import { validateXmlFile } from "./xml-util";
import { out } from "../../../util/interaction";
+import _ = require("lodash");
const invalidCharactersRegexp = /['"!#$%&+^<=>`|]/;
@@ -17,7 +18,7 @@ export async function copyIncludedFiles(manifest: ITestCloudManifestJson, includ
const includedFile = includedFiles[i];
const copyTarget = path.join(path.dirname(rootDir), includedFile.targetPath);
- if (copyTarget.indexOf(".dll.config") !== -1 && !validateXmlFile(copyTarget)) {
+ if (_.endsWith(".dll.config") && !validateXmlFile(copyTarget)) {
out.text(`Warning: The XML config file ${copyTarget} was not a valid XML file. This file will not be uploaded.`);
continue;
}
| 14 |
diff --git a/src/components/core/modular.js b/src/components/core/modular.js @@ -19,17 +19,7 @@ export default {
Object.keys(instance.modules).forEach((moduleName) => {
const module = instance.modules[moduleName];
const moduleParams = modulesParams[moduleName] || {};
- // Extend instance methods and props
- if (module.instance) {
- Object.keys(module.instance).forEach((modulePropName) => {
- const moduleProp = module.instance[modulePropName];
- if (typeof moduleProp === 'function') {
- instance[modulePropName] = moduleProp.bind(instance);
- } else {
- instance[modulePropName] = moduleProp;
- }
- });
- }
+
// Add event listeners
if (module.on && instance.on) {
Object.keys(module.on).forEach((moduleEventName) => {
| 2 |
diff --git a/generators/client/templates/angularjs/src/main/webapp/app/admin/user-management/_user-management.controller.js b/generators/client/templates/angularjs/src/main/webapp/app/admin/user-management/_user-management.controller.js }
function onSuccess(data, headers) {
- //hide anonymous user from user management: it's a required user for Spring Security
- var hiddenUsersSize = 0;
- for (var i in data) {
- if (data[i]['login'] === 'anonymoususer') {
- data.splice(i, 1);
- hiddenUsersSize++;
- }
- }
<% if (databaseType !== 'cassandra') { %>vm.links = ParseLinks.parse(headers('link'));
- vm.totalItems = headers('X-Total-Count') - hiddenUsersSize;
+ vm.totalItems = headers('X-Total-Count');
vm.queryCount = vm.totalItems;
vm.page = pagingParams.page;<% } %>
vm.users = data;
| 2 |
diff --git a/src/assets/drizzle/styles/utility/_toolkit-overrides.scss b/src/assets/drizzle/styles/utility/_toolkit-overrides.scss .#{$app-namespace}-c-Logo-placeholder {
background-color: #ccc;
- height: 75px;
- width: 175px;
+ height: 55px;
+ width: 262px;
}
.#{$app-namespace}-c-Logo-placeholder--small {
| 3 |
diff --git a/src/PanelTraits/Fields.php b/src/PanelTraits/Fields.php @@ -156,6 +156,33 @@ trait Fields
}
}
+ /**
+ * Update value of a given key for a current field.
+ *
+ * @param string $field The field
+ * @param array $modifications An array of changes to be made.
+ * @param string $form update/create/both
+ */
+ public function modifyField($field, $modifications, $form = 'both')
+ {
+ foreach($modifications as $key => $newValue) {
+ switch (strtolower($form)) {
+ case 'create':
+ $this->create_fields[$field][$key] = $newValue;
+ break;
+
+ case 'update':
+ $this->update_fields[$field][$key] = $newValue;
+ break;
+
+ default:
+ $this->create_fields[$field][$key] = $newValue;
+ $this->update_fields[$field][$key] = $newValue;
+ break;
+ }
+ }
+ }
+
/**
* Set label for a specific field.
*
| 11 |
diff --git a/base/interactable_objects/InteractableObjects.ts b/base/interactable_objects/InteractableObjects.ts @@ -283,12 +283,18 @@ export class InteractableObjects {
}
/** Gets the x position in px. */
get x(): number {
+ if (this.sprite) {
return this.sprite.body ? this.sprite.body.x : this.sprite.x;
}
+ return null;
+ }
/** Gets the y position in px. */
get y(): number {
+ if (this.sprite) {
return this.sprite.body ? this.sprite.body.y : this.sprite.y;
}
+ return null;
+ }
/** The unique label that identifies this Interactable Object. */
get label() {
return this._label;
| 1 |
diff --git a/apps.json b/apps.json ]
},
{ "id": "miclock",
- "name": "A mix of analog and digital Clock",
+ "name": "Mixed Clock",
"icon": "clock-mixed.png",
- "description": "Mixed AD Clock",
+ "description": "A mix of analog and digital Clock",
"tags": "miclock",
"type":"clock",
"storage": [
| 3 |
diff --git a/edit.js b/edit.js @@ -1670,6 +1670,39 @@ const cometFireMesh = (() => {
})();
scene.add(cometFireMesh);
+const hpMesh = (() => {
+ const geometry = BufferGeometryUtils.mergeBufferGeometries([
+ new THREE.PlaneBufferGeometry(1, 0.02).applyMatrix4(new THREE.Matrix4().makeTranslation(0, 0.02, 0)),
+ new THREE.PlaneBufferGeometry(1, 0.02).applyMatrix4(new THREE.Matrix4().makeTranslation(0, -0.02, 0)),
+ new THREE.PlaneBufferGeometry(0.02, 0.04).applyMatrix4(new THREE.Matrix4().makeTranslation(-1/2, 0, 0)),
+ new THREE.PlaneBufferGeometry(0.02, 0.04).applyMatrix4(new THREE.Matrix4().makeTranslation(1/2, 0, 0)),
+ ]);
+ const material = new THREE.MeshBasicMaterial({
+ color: 0x000000,
+ });
+ const mesh = new THREE.Mesh(geometry, material);
+ mesh.frustumCulled = false;
+
+ const geometry2 = new THREE.PlaneBufferGeometry(1, 0.02).applyMatrix4(new THREE.Matrix4().makeTranslation(1/2, 0, 0))
+ const material2 = new THREE.MeshBasicMaterial({
+ color: 0x81c784,
+ });
+ const barMesh = new THREE.Mesh(geometry2, material2);
+ barMesh.position.x = -1/2;
+ barMesh.position.z = -0.001;
+ barMesh.scale.x = 37/100;
+ barMesh.frustumCulled = false;
+ mesh.add(barMesh);
+
+ const textMesh = makeTextMesh('HP 37/100', './Bangers-Regular.ttf', 0.05, 'left', 'bottom');
+ textMesh.position.x = -1/2;
+ textMesh.position.y = 0.05;
+ mesh.add(textMesh);
+
+ return mesh;
+})();
+scene.add(hpMesh);
+
const _applyVelocity = (position, timeDiff) => {
position.add(localVector4.copy(velocity).multiplyScalar(timeDiff));
};
| 0 |
diff --git a/packages/vulcan-users/lib/modules/permissions.js b/packages/vulcan-users/lib/modules/permissions.js @@ -153,11 +153,14 @@ Users.canDo = (user, actionOrActions) => {
Users.owns = function(user, document) {
try {
if (!!document.userId) {
- // case 1: document is a post or a comment, use userId to check
+ // case 1: use userId to check
return user._id === document.userId;
+ } else if (document.user) {
+ // case 2: use user._id to check
+ return user._id === document.user._id;
}else {
- // case 2: document is a user, use _id or slug to check
- return document.slug ? user.slug === document.slug : user._id === document._id;
+ // case 3: document is a user, use _id to check
+ return user._id === document._id;
}
} catch (e) {
return false; // user not logged in
| 7 |
diff --git a/avatars/avatars.js b/avatars/avatars.js @@ -14,12 +14,29 @@ import easing from '../easing.js';
import CBOR from '../cbor.js';
import Simplex from '../simplex-noise.js';
-/* VRMSpringBoneImporter.prototype._createSpringBone = (_createSpringBone => function(a, b) {
- b.gravityPower *= 0.1;
- b.stiffnessForce *= 0.1;
- // b.dragForce *= 0.1;
- return _createSpringBone.apply(this, arguments);
-})(VRMSpringBoneImporter.prototype._createSpringBone); */
+VRMSpringBoneImporter.prototype._createSpringBone = (_createSpringBone => function(a, b) {
+ const bone = _createSpringBone.apply(this, arguments);
+ const initialDragForce = bone.dragForce;
+ const initialStiffnessForce = bone.stiffnessForce;
+ // const initialGravityPower = bone.gravityPower;
+
+ Object.defineProperty(bone, 'stiffnessForce', {
+ get() {
+ localVector.set(physicsManager.velocity.x, 0, physicsManager.velocity.z);
+ const f = Math.pow(Math.min(Math.max(localVector.length()*2 - Math.abs(physicsManager.velocity.y)*0.5, 0), 4), 2);
+ return initialStiffnessForce * (0.05 + 0.1*f);
+ },
+ set(v) {},
+ });
+ Object.defineProperty(bone, 'dragForce', {
+ get() {
+ return initialDragForce * 0.75;
+ },
+ set(v) {},
+ });
+
+ return bone;
+})(VRMSpringBoneImporter.prototype._createSpringBone);
const _makeSimplexes = numSimplexes => {
const result = Array(numSimplexes);
| 0 |
diff --git a/components/mapbox/styles/vector.json b/components/mapbox/styles/vector.json "openmaptiles": {
"type": "vector",
"url": "https://openmaptiles.geo.data.gouv.fr/data/france-vector.json"
- },
- "base-adresse-nationale": {
- "type": "vector",
- "url": "https://openmaptiles.geo.data.gouv.fr/data/adresses.json"
}
},
"sprite": "https://openmaptiles.github.io/osm-bright-gl-style/sprite",
| 2 |
diff --git a/src/lib/AsComponent.coffee b/src/lib/AsComponent.coffee @@ -88,7 +88,9 @@ exports.asComponent = (func, options) ->
if hasCallback
# Handle Node.js style async functions
values.push (err, res) ->
- return output.done err if err
+ if err
+ output.done err
+ return
output.sendDone res
res = func.apply null, values
return
| 6 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.