code
stringlengths 122
4.99k
| label
int64 0
14
|
---|---|
diff --git a/package.json b/package.json "dist/electron/**/*"
],
"dmg": {
- "contents": [
- {
+ "contents": [{
"x": 410,
"y": 150,
"type": "link",
"target": "nsis"
},
"nsis": {
- "perMachine": true
+ "perMachine": true,
+ "oneClick": false,
+ "allowToChangeInstallationDirectory": true
},
"linux": {
"icon": "build/icons"
| 11 |
diff --git a/components/test-info.js b/components/test-info.js @@ -11,37 +11,38 @@ import {
NettestGroupMiddleBoxes,
NettestGroupPerformance
} from 'ooni-components/dist/icons'
+import { FormattedMessage } from 'react-intl'
export const testGroups = {
'websites': {
'color': theme.colors.indigo5,
- 'name': 'Websites',
+ 'name': <FormattedMessage id='Tests.Groups.Webistes.Name' />,
'icon': <NettestGroupWebsites />
},
'im': {
'color': theme.colors.cyan6,
- 'name': 'Instant Messagging',
+ 'name': <FormattedMessage id='Tests.Groups.Instant Messagging.Name' />,
'icon': <NettestGroupInstantMessaging />
},
'middlebox': {
'color': theme.colors.violet8,
- 'name': 'Middlebox',
+ 'name': <FormattedMessage id='Tests.Groups.Middlebox.Name' />,
'icon': <NettestGroupMiddleBoxes />
},
'performance': {
'color': theme.colors.fuschia6,
- 'name': 'Performance',
+ 'name': <FormattedMessage id='Tests.Groups.Performance.Name' />,
'icon': <NettestGroupPerformance />
},
'circumvention': {
'color': '',
- 'name': 'Circumvention',
+ 'name': <FormattedMessage id='Tests.Groups.Circumvention.Name' />,
'icon': <FaBeer />
},
'legacy': {
'color': theme.colors.gray5,
- 'name': 'Legacy',
+ 'name': <FormattedMessage id='Tests.Groups.Legacy.Name' />,
'icon': <FaBeer />
},
'default': {
@@ -55,78 +56,78 @@ export const testNames = {
/* Websites */
'web_connectivity': {
group: 'websites',
- name: 'Web Connectivity',
+ name: <FormattedMessage id='Tests.WebConnectivity.Name' />,
info: 'https://ooni.io/nettest/web-connectivity/'
},
/* Middlebox tests */
'http_invalid_request_line': {
group: 'middlebox',
- name: 'HTTP Invalid Request Line',
+ name: <FormattedMessage id='Tests.HTTPInvalidReqLine.Name' />,
info: 'https://ooni.io/nettest/http-invalid-request-line/'
},
'http_header_field_manipulation': {
group: 'middlebox',
- name: 'HTTP Header Field Manipulation',
+ name: <FormattedMessage id='Tests.HTTPHeaderManipulation.Name' />,
info: 'https://ooni.io/nettest/http-header-field-manipulation/'
},
/* IM Tests */
'facebook_messenger': {
group: 'im',
- name: 'Facebook Messenger',
+ name: <FormattedMessage id='Tests.Facebook.Name' />,
info: 'https://ooni.io/nettest/facebook-messenger/'
},
'telegram': {
group: 'im',
- name: 'Telegram',
+ name: <FormattedMessage id='Tests.Telegram.Name' />,
info: 'https://ooni.io/nettest/telegram/'
},
'whatsapp': {
group: 'im',
- name: 'WhatsApp',
+ name: <FormattedMessage id='Tests.WhatsApp.Name' />,
info: 'https://ooni.io/nettest/whatsapp/'
},
/* Performance */
'ndt': {
group: 'performance',
- name: 'NDT Speed Test',
+ name: <FormattedMessage id='Tests.NDT.Name' />,
info: 'https://ooni.io/nettest/ndt/'
},
'dash': {
group: 'performance',
- name: 'Dash video streaming',
+ name: <FormattedMessage id='Tests.Dash.Name' />,
info: 'https://ooni.io/nettest/dash/'
},
/* Censorship circumvention */
'vanilla_tor': {
group: 'circumvention',
- name: 'Tor (Vanilla)',
+ name: <FormattedMessage id='Tests.TorVanilla.Name' />,
info: 'https://ooni.io/nettest/vanilla-tor/'
},
'bridge_reachability': {
group: 'circumvention',
- name: 'Tor Bridge Reachability',
+ name: <FormattedMessage id='Tests.BridgeReachability.Name' />,
info: 'https://ooni.io/nettest/tor-bridge-reachability/'
},
/* Legacy tests */
'tcp_connect': {
group: 'legacy',
- name: 'TCP Connect',
+ name: <FormattedMessage id='Tests.TCPConnect.Name' />,
// FIXME: Use a more relevant link
info: 'https://ooni.io/nettest/'
},
'dns_consistency': {
group: 'legacy',
- name: 'DNS Consistency',
+ name: <FormattedMessage id='Tests.DNSConsistency.Name' />,
info: 'https://ooni.io/nettest/dns-consistency/'
},
'http_requests': {
group: 'legacy',
- name: 'HTTP Requests',
+ name: <FormattedMessage id='Tests.HTTPRequests.Name' />,
info: 'https://ooni.io/nettest/http-requests/'
},
}
| 14 |
diff --git a/vis/js/list.js b/vis/js/list.js @@ -1044,13 +1044,13 @@ list.attachClickHandlerAbstract = function(enlarged) {
let list_holder = d3.selectAll("#list_holder");
if(enlarged) {
- list_holder.select(".list_subentry_show_statistics").on("click", function(d) {
+ list_holder[0].forEach(function (element) {
+ let current_list_holder = d3.select(element);
+ let d = current_list_holder.datum();
- let parent_div = list_holder.filter(function (x) {
- return x.id === d.id;
- })
-
- let click_div = parent_div.select(".list_subentry_show_statistics");
+ current_list_holder.selectAll(".list_subentry_show_statistics").on("click", function() {
+ let click_div = d3.select(d3.event.currentTarget);
+ let parent_div = d3.select(d3.event.currentTarget.parentElement);
let statistics_div = parent_div.select(".list_subentry_statistics")
if(statistics_div.style("display") === "none") {
statistics_div.style("display", "block")
@@ -1066,6 +1066,7 @@ list.attachClickHandlerAbstract = function(enlarged) {
.text(config.localization[config.language].show_verb_label)
}
})
+ })
} else {
list_holder.select(".list_subentry_showmore").on("click", function(d) {
| 1 |
diff --git a/package.json b/package.json {
"name": "minimap",
"main": "./lib/main",
- "version": "4.29.6",
+ "version": "4.29.7",
"private": true,
"description": "A preview of the full source code.",
"author": "Fangdun Cai <[email protected]>",
| 6 |
diff --git a/README.md b/README.md - [Assets](#assets)
- [Actions](#actions)
- [Details](#details)
+ - [Job States](#job-states)
- [Programmatic](#programmatic)
+ - [Information](#information)
- [Template rendering](#template-rendering)
- [Footage items](#footage-items)
- [Fields](#fields)
- [Example](#example)
- - [Data items](#data-items)
+ - [Static assets](#static-assets)
+ - [Data Assets](#data-assets)
- [Fields](#fields-1)
- [Example](#example-1)
- - [Script items](#script-items)
+ - [Script Asset](#script-asset)
- [Fields](#fields-2)
- - [Example with no dynamic parameters.](#example-with-no-dynamic-parameters)
- - [Dynamic variables](#dynamic-variables)
- - [Supported parameter types](#supported-parameter-types)
- - [Example JSON asset declaration:](#example-json-asset-declaration)
+ - [Dynamic Parameters](#dynamic-parameters)
+ - [Supported Parameter Types](#supported-parameter-types)
+ - [Parameter Types examples](#parameter-types-examples)
+ - [String](#string)
+ - [Number](#number)
+ - [Array](#array)
+ - [Object](#object)
+ - [Null](#null)
+ - [Functions](#functions)
+ - [Warnings](#warnings)
+ - [Self-Invoking Functions Example](#self-invoking-functions-example)
+ - [Named Functions](#named-functions)
+ - [Anonymous Functions](#anonymous-functions)
+ - [Complete functions example](#complete-functions-example)
+ - [Examples](#examples)
+ - [No dynamic parameters.](#no-dynamic-parameters)
+ - [Dynamic variable - Array type parameter](#dynamic-variable---array-type-parameter)
+ - [Default Dynamic Variable Keyword Parameter](#default-dynamic-variable-keyword-parameter)
- [Example JSX Script with defaults:](#example-jsx-script-with-defaults)
- [Example JSX Script without defaults:](#example-jsx-script-without-defaults)
- - [Example compiled script](#example-compiled-script)
- [Network rendering](#network-rendering)
- [Using binaries](#using-binaries)
- [`nexrender-server`](#nexrender-server)
- [Tested with](#tested-with)
- [Additional Information](#additional-information)
- [Protocols](#protocols)
- - [Examples](#examples)
+ - [Examples](#examples-1)
- [Development](#development)
- [Project Values](#project-values)
- [Awesome External Packages](#awesome-external-packages)
@@ -489,6 +505,12 @@ This way you (if you are using network rendering) you can not only deliver asset
}
```
+## Static assets
+
+There is also a plain asset type that allows you to simply provide an `src`, and that file will be downloaded in the folder with the project.
+No additional automated actions will happen with that asset, unless you manually use scripting to do something with those.
+Might be useful for some static data-based injections, or some other use cases.
+
## Data Assets
The second important point for the dynamic data-driven video generation is the ability to replace/change/modify non-footage data in the project.
@@ -589,7 +611,7 @@ and from the nexrender side everything is quite simple. You only need to provide
* `parameters`: (optional) **object**, object where all the dynamically injected parameters are defined. Variables not defined here but used in the script are null by default.
* `globalDefaultValue` (optional) **any**, The default value of any found unknown or undefined value for any given `keyword` child object `key`is `null`. However this can be changed by setting this parameter to something. You should be careful on which default to set, it is suggested to leave it as it is and check for `null` values in your JSX code.
-## Dynamic Parameters
+### Dynamic Parameters
With dynamic parameters you can set a parameter in your Job declaration to be used on a JSX Script!
@@ -668,11 +690,6 @@ This is the default value for parameters used on any given JSX script that are n
`NX.get("carDetails")` will be equal to `null`.
-## Static assets
-
-There is also a plain asset type that allows you to simply provide an `src`, and that file will be downloaded in the folder with the project.
-No additional automated actions will happen with that asset, unless you manually use scripting to do something with those.
-Might be useful for some static data-based injections, or some other use cases.
#### Functions
| 3 |
diff --git a/packages/bitcore-node/test/verification/db-verify.ts b/packages/bitcore-node/test/verification/db-verify.ts @@ -94,6 +94,7 @@ export async function validateDataForBlock(blockNum: number, log = false) {
//blocks with same height
const blocksForHeight = await BlockStorage.collection.countDocuments({ chain, network, height: blockNum });
if (blocksForHeight === 0) {
+ success = false;
const error = {
model: 'block',
err: true,
| 12 |
diff --git a/src/utils/ledger-bridge-provider/BitcoinLedgerBridgeProvider.js b/src/utils/ledger-bridge-provider/BitcoinLedgerBridgeProvider.js import { BitcoinLedgerProvider } from '@liquality/bitcoin-ledger-provider'
import { fromBase58 } from 'bip32'
+// import { bitcoin } from '@liquality/types'
+// import { address } from 'bitcoinjs-lib'
export class BitcoinLedgerBridgeProvider extends BitcoinLedgerProvider {
_ledgerApp
@@ -25,8 +27,12 @@ export class BitcoinLedgerBridgeProvider extends BitcoinLedgerProvider {
}
async _getBaseDerivationNode () {
- if (this._baseDerivationNode) return this._baseDerivationNode
- this._baseDerivationNode = fromBase58(this._xPub, this._network)
+ if (!this._baseDerivationNode) {
+ this._baseDerivationNode = fromBase58(
+ this._xPub, this._network
+ ).derivePath(this.baseDerivationPath)
+ }
+
return this._baseDerivationNode
}
| 3 |
diff --git a/src/lib/wallet/GoodWalletClass.js b/src/lib/wallet/GoodWalletClass.js @@ -670,7 +670,8 @@ export class GoodWallet {
return Number(wallet.utils.fromWei(price))
} catch (e) {
- log.error('getReservePriceDAI failed:', e.message, e)
+ log.warn('getReservePriceDAI failed:', e.message, e)
+ throw e
}
}
| 0 |
diff --git a/sirepo/simulation_db.py b/sirepo/simulation_db.py @@ -1033,9 +1033,9 @@ def _validate_name(data):
{'simulation.folder': s.folder},
):
n2 = d.models.simulation.name
- if n2.startswith(n):
+ if n2.startswith(n) and d.models.simulation.simulationId != s.simulationId:
starts_with[n2] = d.models.simulation.simulationId
- if n in starts_with and starts_with[n] != s.simulationId:
+ if n in starts_with:
_validate_name_uniquify(data, starts_with)
| 1 |
diff --git a/sox.common.js b/sox.common.js if (sox.site.type == sox.site.types.chat) {
return Chat.RoomUsers.current().name;
} else {
- return Stack && this.loggedIn ? decodeURI(Stack.options.user.profileUrl.split('/')[5]) : undefined;
+ var $uname = $('body > div.topbar > div > div.topbar-links > a > div.gravatar-wrapper-24');
+ return ($uname.length ? $uname.attr('title') : false);
}
},
get loggedIn() {
| 4 |
diff --git a/test/versioned/node-mysql2/mysql-pooling.tap.js b/test/versioned/node-mysql2/mysql-pooling.tap.js @@ -189,11 +189,16 @@ test('MySQL instrumentation with a connection pool and node-mysql 2.0+',
t.equals(selectSegment.children.length, 1, 'should only have a callback segment')
t.equals(selectSegment.children[0].name, 'Callback: <anonymous>')
- t.deepEqual(
- selectSegment.children[0].children,
- [],
- 'callback should not have children'
+ var grandChildren = selectSegment.children[0].children
+ if (grandChildren.length === 1) {
+ t.match(
+ grandChildren[0].name,
+ /timers\.setTimeout$/, // May be Truncated, hence matching the end of it.
+ 'callback may have a timer as a child'
)
+ } else {
+ t.equal(grandChildren.length, 0, 'callback should not have children')
+ }
t.end()
}
}.bind(this))
| 11 |
diff --git a/README.md b/README.md @@ -17,7 +17,7 @@ Instead, if you want to run the source code (which is completely open) or develo
1. Download the binary [here](https://github.com/nttgin/BGPalerter/releases) (be sure to select the one for your OS)
-2. Execute the binary (e.g. `chmod 700 bgpalerter-linux-x64 && ./bgpalerter-linux-x64`)
+2. Execute the binary (e.g. `chmod +x bgpalerter-linux-x64 && ./bgpalerter-linux-x64`)
The first time you run it, the auto-configuration will start.
| 7 |
diff --git a/articles/architecture-scenarios/implementations/mobile-api/mobile-implementation-android.md b/articles/architecture-scenarios/implementations/mobile-api/mobile-implementation-android.md @@ -8,10 +8,6 @@ toc: true
This document is part of the [Mobile + API Architecture Scenario](/architecture-scenarios/application/mobile-api) and it explains how to implement the mobile application in Android. Please refer to the scenario for information on the implemented solution.
-::: note
-The full source code for the Node.js API implementation can be found in [this GitHub repository](https://github.com/auth0-samples/auth0-pnp-abc-timesheets/tree/master/timesheets-mobile/android).
-:::
-
## 1. Set Up the Application
<%= include('../../../_includes/_package', {
| 2 |
diff --git a/docs/providers/aws/guide/credentials.md b/docs/providers/aws/guide/credentials.md @@ -81,7 +81,7 @@ Here's an example how you can configure the `default` AWS profile:
serverless config credentials --provider aws --key AKIAIOSFODNN7EXAMPLE --secret wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
```
-Take a look at the [`config` CLI reference](../cli-reference/config.md) for more information about credential configuration.
+Take a look at the [`config` CLI reference](../cli-reference/config-credentials) for more information about credential configuration.
##### Setup with the `aws-cli`
| 1 |
diff --git a/src/sdk/conference/conference.js b/src/sdk/conference/conference.js safeCall(onFailure, err || 'connection_error');
});
- self.socket.on('connection_failed', function() {
- L.Logger.info("ICE Connection Failed");
+ self.socket.on('connection_failed', function(args) {
+ L.Logger.error("MCU reports connection failed for stream: " + args.streamId);
+ if (self.localStreams[args.streamId] !== undefined) {
+ var stream = self.localStreams[args.streamId];
+ self.unpublish(stream);
+ // It is deleted if MCU ack "success" for unpublish. But I'm not
+ // sure if MCU will ack "success" if the original access agent is
+ // down.
+ delete self.localStreams[args.streamId];
+ } else {
+ self.unsubscribe(self.remoteStreams[args.streamId]);
+ }
+
if (self.state !== DISCONNECTED) {
var disconnectEvt = new Woogeen.StreamEvent({
type: 'stream-failed'
}
});
+ // Seems MCU no longer emits this event.
self.socket.on('stream-publish', function(spec) {
var myStream = self.localStreams[spec.id];
if (myStream) {
| 9 |
diff --git a/ci/config.yaml b/ci/config.yaml @@ -18,4 +18,5 @@ checks:
audit:
npm:
cwe_ignore:
- - CWE-400
+ - CWE-400 # Uncontrolled Resource Consumption
+ - CWE-22 # Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
| 8 |
diff --git a/edit.js b/edit.js @@ -217,6 +217,7 @@ const _buildMeshEquals = (a, b) => {
}
};
const itemMeshes = [];
+const npcMeshes = [];
const _decorateMeshForRaycast = mesh => {
mesh.traverse(o => {
if (o.isMesh) {
@@ -755,13 +756,52 @@ _setCurrentChunkMesh(chunkMesh);
o.isBuildMesh = true;
}
});
+ let animation = null;
npcMesh.hit = () => {
- console.log('hit!');
+ if (animation) {
+ animation.end();
+ animation = null;
+ }
+ const startTime = Date.now();
+ const endTime = startTime + 300;
+ const originalPosition = npcMesh.position.clone();
+ animation = {
+ /* startTime,
+ endTime, */
+ update() {
+ const now = Date.now();
+ const factor = (now - startTime) / (endTime - startTime);
+ if (factor < 1) {
+ npcMesh.position.copy(originalPosition)
+ .add(localVector2.set(-1+Math.random()*2, -1+Math.random()*2, -1+Math.random()*2).multiplyScalar((1-factor)*0.2/2));
+ } else {
+ animation.end();
+ animation = null;
+ }
+ },
+ end() {
+ npcMesh.position.copy(originalPosition);
+ npcMesh.traverse(o => {
+ if (o.isMesh) {
+ o.material.color.setHex(0xFFFFFF);
+ }
+ });
+ },
+ };
+ npcMesh.traverse(o => {
+ if (o.isMesh) {
+ o.material.color.setHex(0xef5350);
+ }
+ });
+ };
+ npcMesh.update = () => {
+ animation && animation.update();
};
npcMesh.updateMatrixWorld();
npcMesh.matrix.premultiply(localMatrix2.getInverse(currentChunkMesh.matrixWorld))
.decompose(npcMesh.position, npcMesh.quaternion, npcMesh.scale);
currentChunkMesh.add(npcMesh);
+ npcMeshes.push(npcMesh);
let geometry = new CapsuleGeometry(0.5, 0.5, 16)
.applyMatrix4(new THREE.Matrix4().makeRotationFromQuaternion(new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(1, 0, 0), Math.PI/2)))
@@ -2328,6 +2368,10 @@ function animate(timestamp, frame) {
}
cometFireMesh.material.uniforms.uAnimation.value = (Date.now() % 2000) / 2000;
+ for (let i = 0; i < npcMeshes.length; i++) {
+ npcMeshes[i].update();
+ }
+
const session = renderer.xr.getSession();
if (session) {
const inputSource = session.inputSources[1];
| 0 |
diff --git a/assets/js/modules/analytics/components/settings/GA4SettingsControls.js b/assets/js/modules/analytics/components/settings/GA4SettingsControls.js @@ -265,9 +265,9 @@ export default function GA4SettingsControls( {
'google-site-kit'
),
matchedProperty.displayName,
- measurementIDs?.[
+ measurementIDs[
matchedProperty._id
- ] || ''
+ ]
)
: matchedProperty.displayName ) }
</Option>
| 2 |
diff --git a/src/shapes/rectangle.js b/src/shapes/rectangle.js this.pos = new me.Vector2d();
- // pre-allocate the vector array
- this.points = [
- new me.Vector2d(), new me.Vector2d(),
- new me.Vector2d(), new me.Vector2d()
- ];
-
this.shapeType = "Rectangle";
- this.setShape(x, y, w, h);
+
+ this.setShape(x, y, [
+ new me.Vector2d(0, 0), // 0, 0
+ new me.Vector2d(w, 0), // 1, 0
+ new me.Vector2d(w, h), // 1, 1
+ new me.Vector2d(0, h) // 0, 1
+ ]);
},
/**
* @function
* @param {Number} x position of the Rectangle
* @param {Number} y position of the Rectangle
- * @param {Number} w width of the rectangle
- * @param {Number} h height of the rectangle
+ * @param {Number|Array} w|points width of the rectangle, or an array of vector defining the rectangle
+ * @param {Number} [h] height of the rectangle, if a numeral width parameter is specified
* @return {me.Rect} this rectangle
*/
setShape : function (x, y, w, h) {
+ var points = w; // assume w is an array by default
+
+ if (arguments.length === 4) {
+ points = this.points;
+ points[0].set(0, 0); // 0, 0
+ points[1].set(w, 0); // 1, 0
+ points[2].set(w, h); // 1, 1
+ points[3].set(0, h); // 0, 1
+ }
- this.points[0].set(0, 0); // 0, 0
- this.points[1].set(w, 0); // 1, 0
- this.points[2].set(w, h); // 1, 1
- this.points[3].set(0, h); // 0, 1
-
- this._super(me.Polygon, "setShape", [x, y, this.points]);
+ this._super(me.Polygon, "setShape", [x, y, points]);
- // private properties to cache w & h
- this._width = w;
- this._height = h;
+ // private properties to cache width & height
+ this._width = this.points[2].x; // w
+ this._height = this.points[2].y; // h
return this;
},
| 11 |
diff --git a/components/menu-picklist/index.jsx b/components/menu-picklist/index.jsx @@ -116,14 +116,14 @@ const MenuPicklist = React.createClass({
window.addEventListener('click', this.closeOnClick, false);
this.setState({
- selectedIndex: this.getIndexByValue(this.props.value)
+ selectedIndex: this.getIndexByValue(this.props)
});
},
componentWillReceiveProps (nextProps) {
- if (this.props.value !== nextProps.value) {
+ if (this.props.value !== nextProps.value || this.props.options.length !== nextProps.length) {
this.setState({
- selectedIndex: this.getIndexByValue(nextProps.value)
+ selectedIndex: this.getIndexByValue(nextProps)
});
}
},
@@ -142,11 +142,11 @@ const MenuPicklist = React.createClass({
return `SLDS${this.getId()}ClickEvent`;
},
- getIndexByValue (value) {
+ getIndexByValue ({ value, options } = this.props) {
let foundIndex = -1;
- if (this.props.options && this.props.options.length) {
- this.props.options.some((element, index) => {
+ if (options && options.length) {
+ options.some((element, index) => {
if (element && element.value === value) {
foundIndex = index;
return true;
| 4 |
diff --git a/avatars/avatars.js b/avatars/avatars.js @@ -764,6 +764,77 @@ const _clearXZ = (dst, isPosition) => {
}
};
+class Blinker {
+ constructor() {
+ this.mode = 'ready';
+ this.waitTime = 0;
+ this.lastTimestamp = 0;
+ }
+ update(now) {
+ const _setOpen = () => {
+ this.mode = 'open';
+ this.waitTime = (0.5 + 0.5 * Math.random()) * 3000;
+ this.lastTimestamp = now;
+ };
+
+ // console.log('got mode', this.mode, now - this.lastTimestamp, this.waitTime);
+
+ switch (this.mode) {
+ case 'ready': {
+ _setOpen();
+ return 0;
+ }
+ case 'open': {
+ const timeDiff = now - this.lastTimestamp;
+ if (timeDiff > this.waitTime) {
+ this.mode = 'closing';
+ this.waitTime = 100;
+ this.lastTimestamp = now;
+ }
+ return 0;
+ }
+ case 'closing': {
+ const f = Math.min(Math.max((now - this.lastTimestamp) / this.waitTime, 0), 1);
+ if (f < 1) {
+ return f;
+ } else {
+ this.mode = 'opening';
+ this.waitTime = 100;
+ this.lastTimestamp = now;
+ return 1;
+ }
+ }
+ case 'opening': {
+ const f = Math.min(Math.max((now - this.lastTimestamp) / this.waitTime, 0), 1);
+ if (f < 1) {
+ return 1 - f;
+ } else {
+ _setOpen();
+ return 0;
+ }
+ }
+ }
+ }
+}
+class Nodder {
+ constructor() {
+
+ }
+ update() {
+
+ }
+}
+class Looker {
+ update() {
+
+ }
+}
+class Emoter {
+ update() {
+
+ }
+}
+
class Avatar {
constructor(object, options = {}) {
if (!object) {
@@ -1306,6 +1377,11 @@ class Avatar {
return animationMapping;
});
+ this.blinker = new Blinker();
+ this.nodder = new Nodder();
+ this.looker = new Looker();
+ this.emoter = new Emoter();
+
// shared state
this.direction = new THREE.Vector3();
this.jumpState = false;
@@ -2818,19 +2894,15 @@ class Avatar {
this.decapitate();
} */
+ // XXX
+ this.nodder.update();
+ this.looker.update();
+ this.emoter.update();
+
const _updateVisemes = () => {
const volumeValue = this.volume !== -1 ? Math.min(this.volume * 12, 1) : -1;
// console.log('got volume value', this.volume, volumeValue);
- const blinkValue = (() => {
- const nowWindow = now % 2000;
- if (nowWindow >= 0 && nowWindow < 100) {
- return nowWindow/100;
- } else if (nowWindow >= 100 && nowWindow < 200) {
- return 1 - (nowWindow-100)/100;
- } else {
- return 0;
- }
- })();
+ const blinkValue = this.blinker.update(now);
for (const visemeMapping of this.skinnedMeshesVisemeMappings) {
if (visemeMapping) {
const [
| 0 |
diff --git a/packages/bitcore-node/test/benchmark/benchmark.ts b/packages/bitcore-node/test/benchmark/benchmark.ts @@ -7,7 +7,11 @@ import { Storage } from '../../src/services/storage';
import { BlockModel } from '../../src/models/block';
import { BitcoinBlockType } from '../../src/types/namespaces/Bitcoin/Block';
import { resetDatabase } from "../helpers/index.js";
+import * as crypto from 'crypto';
+function randomBytes() {
+return crypto.randomBytes(32).toString('hex')
+}
function * generateBlocks(blockCount: number, blockSizeMb: number) {
let prevBlock: BitcoinBlockType | undefined = undefined;
for (let i = 0; i < blockCount; i++) {
@@ -21,7 +25,7 @@ function generateBlock(blockSizeMb: number, previousBlock?: BitcoinBlockType): B
const txAmount = 100000;
const prevHash = previousBlock ? previousBlock.hash : '';
let block: BitcoinBlockType = {
- hash: Buffer.from((Math.random() * 10000).toString()).toString('hex'),
+ hash: randomBytes(),
transactions: [],
toBuffer: () => {
return { length: 264 } as Buffer;
@@ -29,7 +33,7 @@ function generateBlock(blockSizeMb: number, previousBlock?: BitcoinBlockType): B
header: {
toObject: () => {
return {
- hash: Buffer.from((Math.random() * 10000).toString()).toString('hex'),
+ hash: randomBytes(),
confirmations: 1,
strippedsize: 228,
size: 264,
@@ -37,8 +41,8 @@ function generateBlock(blockSizeMb: number, previousBlock?: BitcoinBlockType): B
height: 1355,
version: '536870912',
versionHex: '20000000',
- merkleRoot: '08e23107e8449f02568d37d37aa76e840e55bbb5f100ed8ad257af303db88c08',
- tx: ['08e23107e8449f02568d37d37aa76e840e55bbb5f100ed8ad257af303db88c08'],
+ merkleRoot: randomBytes(),
+ tx: [randomBytes()],
time: 1526756523,
mediantime: 1526066375,
nonce: '2',
@@ -53,6 +57,7 @@ function generateBlock(blockSizeMb: number, previousBlock?: BitcoinBlockType): B
let transactions = new Array<any>();
if (previousBlock) {
for (let transaction of previousBlock.transactions) {
+ // each transaction should have one input and one output
const utxos = transaction.outputs.map((output) => {
return new UnspentOutput({
txid: transaction.hash,
| 4 |
diff --git a/app/controllers/carto/api/user_presenter.rb b/app/controllers/carto/api/user_presenter.rb @@ -190,7 +190,13 @@ module Carto
avatar_url: @user.avatar,
feature_flags: @user.feature_flag_names,
base_url: @user.public_url,
- needs_password_confirmation: @user.needs_password_confirmation?
+ needs_password_confirmation: @user.needs_password_confirmation?,
+ description: @user.description,
+ website: @user.website,
+ twitter_username: @user.twitter_username,
+ disqus_shortname: @user.disqus_shortname,
+ available_for_hire: @user.available_for_hire,
+ location: @user.location
}
if @user.organization.present?
| 3 |
diff --git a/README.md b/README.md # Netlify CLI
-[![npm version][npm-img]][npm] [![build status][travis-img]][travis] [![windows build status][av-img]][av]
-[![coverage][coverage-img]][coverage] [![dependencies][david-img]][david] [![downloads][dl-img]][dl]
+[![npm version][npm-img]][npm] [![build status][azure-img]][azure] [![coverage][coverage-img]][coverage] [![dependencies][david-img]][david] [![downloads][dl-img]][dl]
Welcome to the Netlify CLI! The new 2.0 version was rebuilt from the ground up to help improve the site building experience.
@@ -123,6 +122,8 @@ MIT. See [LICENSE](LICENSE) for more details.
[npm-img]: https://img.shields.io/npm/v/netlify-cli.svg
[npm]: https://npmjs.org/package/netlify-cli
+[azure-img]: https://dev.azure.com/netlify/Netlify%20CLI/_apis/build/status/netlify.cli?branchName=master
+[azure]: https://dev.azure.com/netlify/Netlify%20CLI/_build?definitionId=3
[travis-img]: https://img.shields.io/travis/netlify/cli/master.svg
[travis]: https://travis-ci.org/netlify/cli
[av-img]: https://ci.appveyor.com/api/projects/status/imk2qjc34ly7x11b/branch/master?svg=true
| 1 |
diff --git a/src/commands/list.js b/src/commands/list.js @@ -21,11 +21,6 @@ class ListCommand extends Command {
quiet: flags.quiet
});
- if (!items) {
- this.error(`unable to parse input: ${argv.join(",")}`);
- this.exit(1);
- }
-
const listed = flatten(items.map(item => list(item)));
if (flags.json) {
| 9 |
diff --git a/editor/uploadImage.php b/editor/uploadImage.php @@ -50,8 +50,9 @@ function return_bytes($val) {
return $val;
}
-if (!isset($_SESSION['toolkits_logon_username']))
+if (!isset($_SESSION['toolkits_logon_username']) && !is_user_admin())
{
+ _debug("Session is invalid or expired");
die("Session is invalid or expired");
}
| 11 |
diff --git a/generators/entity-server/templates/src/main/java/package/domain/Entity.java.ejs b/generators/entity-server/templates/src/main/java/package/domain/Entity.java.ejs @@ -647,7 +647,7 @@ relationships.forEach((relationship, idx) => {
<%_ if (fluentMethods) { _%>
public <%= asEntity(entityClass) %> <%= relationshipFieldName %>(<%= asEntity(otherEntityNameCapitalized) %> <%= otherEntityName %>) {
- this.<%= relationshipFieldName %> = <%= otherEntityName %>;
+ this.set<%= relationshipNameCapitalized %>(<%= otherEntityName %>);
<%_ if ((databaseType === 'couchbase' && !otherEntityIsEmbedded) || reactiveRelationshipWithId) { _%>
this.<%= relationshipFieldName %>Id = <%= otherEntityName %> != null ? <%= otherEntityName %>.getId() : null;
<%_ } _%>
@@ -656,6 +656,22 @@ relationships.forEach((relationship, idx) => {
<%_ } _%>
public void set<%= relationshipNameCapitalized %>(<%= asEntity(otherEntityNameCapitalized) %> <%= otherEntityName %>) {
+ <%_ if (relationship.otherRelationship) { _%>
+ if (this.<%= relationshipFieldName %> != null) {
+ <%_ if (relationship.otherRelationship.reference.collection) { _%>
+ this.<%= relationshipFieldName %>.remove<%= otherEntityRelationshipNameCapitalized %>(this));
+ <%_ } else { _%>
+ this.<%= relationshipFieldName %>.set<%= otherEntityRelationshipNameCapitalized %>(null));
+ <%_ } _%>
+ }
+ if (<%= relationshipFieldName %> != null) {
+ <%_ if (relationship.otherRelationship.reference.collection) { _%>
+ <%= relationshipFieldName %>.add<%= otherEntityRelationshipNameCapitalized %>(this));
+ <%_ } else { _%>
+ <%= relationshipFieldName %>.set<%= otherEntityRelationshipNameCapitalized %>(this));
+ <%_ } _%>
+ }
+ <%_ } _%>
this.<%= relationshipFieldName %> = <%= otherEntityName %>;
<%_ if ((databaseType === 'couchbase' && !otherEntityIsEmbedded) || reactiveRelationshipWithId) { _%>
this.<%= relationshipFieldName %>Id = <%= otherEntityName %> != null ? <%= otherEntityName %>.getId() : null;
| 12 |
diff --git a/librb/engine.rb b/librb/engine.rb @@ -1083,7 +1083,7 @@ module Engine
timer = Timers::Group.new
- thread_lambda = -> c {
+ thread_lambda = -> c, _t {
if @ruleset_list.empty?
timer.after 0.5, &thread_lambda
else
@@ -1116,7 +1116,7 @@ module Engine
timer = Timers::Group.new
- thread_lambda = -> c {
+ thread_lambda = -> c, _t {
if @ruleset_list.empty?
timer.after 0.5, &thread_lambda
else
| 0 |
diff --git a/src/puppeteer.js b/src/puppeteer.js @@ -61,9 +61,13 @@ const LAUNCH_PUPPETEER_DEFAULT_VIEWPORT = {
* will use the same target proxy server (i.e. the same IP address).
* The identifier can only contain the following characters: `0-9`, `a-z`, `A-Z`, `"."`, `"_"` and `"~"`.
* Only applied if the `useApifyProxy` option is `true`.
- * @property {String} [puppeteerModule]
- * Require path to a module to be used instead of default `puppeteer`. This enables usage
- * of various Puppeteer wrappers such as `puppeteer-extra`.
+ * @property {string|Object} [puppeteerModule]
+ * Either a require path (`string`) to a package to be used instead of default `puppeteer`,
+ * or an already required module (`Object`). This enables usage of various Puppeteer
+ * wrappers such as `puppeteer-extra`.
+ *
+ * Take caution, because it can cause all kinds of unexpected errors and weird behavior.
+ * Apify SDK is not tested with any other library besides `puppeteer` itself.
*/
/**
@@ -101,13 +105,14 @@ const launchPuppeteerWithProxy = async (puppeteer, opts) => {
};
/**
- * Requires `puppeteer` package or throws meaningful error if not installed.
+ * Requires `puppeteer` package, uses a replacement or throws meaningful error if not installed.
*
* @param {string} puppeteerModule
* @ignore
*/
const getPuppeteerOrThrow = (puppeteerModule = 'puppeteer') => {
- checkParamOrThrow(puppeteerModule, 'puppeteerModule', 'String');
+ checkParamOrThrow(puppeteerModule, 'puppeteerModule', 'String|Object');
+ if (typeof puppeteerModule === 'object') return puppeteerModule;
try {
// This is an optional dependency because it is quite large, only require it when used (ie. image with Chrome)
return require(puppeteerModule); // eslint-disable-line
| 11 |
diff --git a/source/themes/simple/SimpleCheckbox.scss b/source/themes/simple/SimpleCheckbox.scss @@ -10,9 +10,11 @@ $checkbox-check-height: var(--rp-checkbox-check-height, calc(23 / 2 * 1px)) !def
$checkbox-check-thickness: var(--rp-checkbox-check-thickness, 2px) !default;
$checkbox-check-vertical-offset: var(--rp-checkbox-check-vertical-offset, -4px) !default;
$checkbox-check-width: var(--rp-checkbox-check-width, calc(23 / 5 * 1px)) !default;
-$checkbox-label-color: var(--rp-checkbox-label-color, #5e6066) !default;
-$checkbox-label-color-disabled: var(--rp-checkbox-label-color-disabled, $theme-color-light-grey) !default;
-$checkbox-label-size: var(--rp-checkbox-label-size, 16px) !default;
+$checkbox-label-font-family: var(--rp-checkbox-label-font-family, $theme-font-light, sans-serif) !default;
+$checkbox-label-font-size: var(--rp-checkbox-label-font-size, 16px) !default;
+$checkbox-label-margin: var(--rp-checkbox-label-margin, 0 0 0 20px) !default;
+$checkbox-label-text-color: var(--rp-checkbox-label-text-color, #5e6066) !default;
+$checkbox-label-text-color-disabled: var(--rp-checkbox-label-text-color-disabled, $theme-color-light-grey) !default;
$checkbox-size: var(--rp-checkbox-size, 23px) !default;
@@ -44,11 +46,11 @@ $checkbox-size: var(--rp-checkbox-size, 23px) !default;
}
.label {
- color: $checkbox-label-color;
- font-family: $theme-font-light;
- font-size: $checkbox-label-size;
+ color: $checkbox-label-text-color;
+ font-family: $checkbox-label-font-family;
+ font-size: $checkbox-label-font-size;
line-height: $checkbox-size;
- margin-left: 20px;
+ margin: $checkbox-label-margin;
white-space: normal;
&:hover {
cursor: pointer;
@@ -73,7 +75,7 @@ $checkbox-size: var(--rp-checkbox-size, 23px) !default;
}
.label {
- color: $checkbox-label-color-disabled;
+ color: $checkbox-label-text-color-disabled;
}
}
| 7 |
diff --git a/website/js/lib/store/user/mutations.js b/website/js/lib/store/user/mutations.js @@ -27,8 +27,9 @@ module.exports={
token:function(state,rootState){
try {
var id_token=window.sessionStorage.getItem('id_token')
+ console.log(typeof id_token)
- if(id_token){
+ if(id_token && id_token!=="undefined"){
var token=jwt.decode(id_token)
}else{
var params=query.parse(state.hash)
| 1 |
diff --git a/scenes/street.scn b/scenes/street.scn "position": [-2, 1, 2],
"quaternion": [0, 0.7071067811865475, 0, 0.7071067811865476],
"start_url": "https://webaverse.github.io/helm/"
- },
- {
- "position": [0, 0, 0],
- "quaternion": [0, 0, 0, 1],
- "start_url": "../metaverse_modules/barrier/",
- "components": [
- {
- "key": "bounds",
- "value": [
- [-150, -150, -450],
- [150, 150, -150]
- ]
- }
- ]
}
]
}
| 2 |
diff --git a/src/components/RegionTable/RegionTable.js b/src/components/RegionTable/RegionTable.js @@ -138,11 +138,11 @@ const RegionTable: ComponentType<Props> = ({
},
{
id: 'local-authorities',
- label: 'Local authorities',
+ label: 'Upper tier local authorities',
panel: {
children: [
<Table
- head={[{ children: ['Local authority'] }, { children: ['Total cases'], format: 'numeric' }]}
+ head={[{ children: ['UTLA'] }, { children: ['Total cases'], format: 'numeric' }]}
rows={localAuthorityKeys.sort(sortFunc(localAuthorityData)).map(r => [
{ children: [<Styles.Link id={`table-link-${r}`} onClick={handleOnLocalAuthorityClick(r)} active={localAuthority === r} to={href(r, 'local-authority')} className="govuk-link">{localAuthorityData[r].name.value}</Styles.Link>] },
{ children: [localAuthorityData[r].totalCases.value], format: 'numeric' },
| 10 |
diff --git a/OurUmbraco/Project/uVersion/uVersion.cs b/OurUmbraco/Project/uVersion/uVersion.cs @@ -18,7 +18,7 @@ namespace OurUmbraco.Project.uVersion
var releasesService = new ReleasesService();
var releases = releasesService.GetReleasesCache()
.Where(x => x.FullVersion.Build == 0 && x.FullVersion.Major >= 9
- || (x.FullVersion.Major == 8 && x.FullVersion.Minor >= 10 && x.FullVersion.Build == 0))
+ || (x.FullVersion.Major == 8 && x.FullVersion.Minor >= 18 && x.FullVersion.Build == 0))
.OrderByDescending(x => x.FullVersion).ToList();
var versions = new List<UVersion>();
| 4 |
diff --git a/sparta_test.go b/sparta_test.go @@ -269,3 +269,41 @@ func TestUserDefinedOverlappingLambdaNames(t *testing.T) {
t.Logf("Rejected overlapping user supplied names")
}
}
+
+func invalidFuncSignature(ctx context.Context) string {
+ return "Hello World!"
+}
+
+func TestInvalidFunctionSignature(t *testing.T) {
+ logger, _ := NewLogger("info")
+
+ var lambdaFunctions []*LambdaAWSInfo
+ invalidSigHandler := HandleAWSLambda("InvalidSignature",
+ invalidFuncSignature,
+ IAMRoleDefinition{})
+ lambdaFunctions = append(lambdaFunctions, invalidSigHandler)
+
+ var templateWriter bytes.Buffer
+ err := Provision(true,
+ "TestInvalidFunctionSignatuure",
+ "",
+ lambdaFunctions,
+ nil,
+ nil,
+ os.Getenv("S3_BUCKET"),
+ false,
+ false,
+ "testBuildID",
+ "",
+ "",
+ "",
+ &templateWriter,
+ nil,
+ logger)
+
+ if err == nil {
+ t.Fatal("Failed to reject invalid lambda function signature")
+ } else {
+ t.Log("Properly rejected invalid function signature")
+ }
+}
| 0 |
diff --git a/src/pages/ReimbursementAccount/ReimbursementAccountPage.js b/src/pages/ReimbursementAccount/ReimbursementAccountPage.js @@ -243,7 +243,7 @@ class ReimbursementAccountPage extends React.Component {
title={this.props.translate('companyStep.confirmModalTitle')} // TODO: Update translation key
onConfirm={hideBankAccountErrorModal}
prompt={this.props.reimbursementAccount.errorModalMessage || this.props.translate('companyStep.confirmModalPrompt')}
- isVisible={Boolean(this.props.reimbursementAccount.isErrorModalVisible)}
+ isVisible={lodashGet(this.props, 'reimbursementAccount.isErrorModalVisible', false)}
confirmText={this.props.translate('companyStep.confirmModalConfirmText')}
shouldShowCancelButton={false}
/>
| 9 |
diff --git a/server/preprocessing/other-scripts/streamgraph.R b/server/preprocessing/other-scripts/streamgraph.R @@ -77,8 +77,12 @@ sg_data = list()
if (service == 'linkedcat' || service == 'linkedcat_authorview') {
stream_range = list(min=min(metadata$year), max=max(metadata$year), range=max(metadata$year)-min(metadata$year))
n_breaks = min(stream_range$range, 10)
+ if (n_breaks > 10) {
metadata <- mutate(metadata, boundary_label=cut(metadata$year, n_breaks, include.lowest = TRUE, right=FALSE))
levels(metadata$boundary_label) <- rename_xaxis(metadata$boundary_label)
+ } else {
+ metadata$boundary_label <- as.factor(metadata$year)
+ }
sg_data$x <- levels(metadata$boundary_label)
sg_data$subject <- (metadata
%>% separate_rows(subject, sep="; ")
| 7 |
diff --git a/pages/countries.js b/pages/countries.js import React from 'react'
import Head from 'next/head'
import NLink from 'next/link'
-
+import axios from 'axios'
import styled from 'styled-components'
+import { FormattedMessage, FormattedNumber } from 'react-intl'
import {
Flex, Box,
Container,
Link,
Heading,
- Text
} from 'ooni-components'
+import { Text } from 'rebass'
import Flag from '../components/flag'
import Layout from '../components/Layout'
@@ -21,38 +22,56 @@ import countryUtil from 'country-util'
const CountryLink = styled(Link)`
color: ${props => props.theme.colors.black};
text-decoration: none;
- text-align: center;
&:hover {
color: ${props => props.theme.colors.blue5};
}
`
-const CountryBlock = ({countryCode}) => {
+const CountryBlock = ({countryCode, msmtCount}) => {
const href = `/country/${countryCode}`
return (
- <Box width={1/6} pb={3}>
+ <Box width={[1/2, 1/4]} my={5}>
<NLink href={href}>
<CountryLink href={href}>
- <Flex justifyContent='center'>
- <Flag center border countryCode={countryCode} />
+ <Flex flexDirection='column'>
+ <Flag center border countryCode={countryCode} size={48} />
+ <Text py={2} fontSize={24} style={{height: '80px'}}>{countryUtil.territoryNames[countryCode]}</Text>
+ <Flex alignItems='center'>
+ <Text mr={2} fontSize={20} fontWeight={600} color='blue9'><FormattedNumber value={msmtCount} /></Text>
+ <Text>Measurments</Text>
+ </Flex>
</Flex>
- <Text pt={2}>{countryUtil.territoryNames[countryCode]}</Text>
</CountryLink>
</NLink>
</Box>
)
}
-const RegionBlock = ({regionCode}) => {
+
+const RegionBlock = ({regionCode, countries}) => {
const regionName = countryUtil.territoryNames[regionCode]
- return <div>
- <Heading h={1} id={regionName} center pb={2}>{regionName}</Heading>
+ // Select countries in the region where we have measuremennts from
+ const measuredCountriesInRegion = countryUtil.regions[regionCode].countries.filter((countryCode) => (
+ countries.find((item) => item.alpha_2 === countryCode)
+ ))
+
+ // When there are no measurements from the region
+ // if (measuredCountriesInRegion.length === 0) {
+ // }
- <Flex flexWrap='wrap' pb={5}>
- {countryUtil.regions[regionCode].countries.map((countryCode) =>
- <CountryBlock key={countryCode} countryCode={countryCode} />
- )}
+ return (
+ <Box my={3}>
+ <Heading h={1} id={regionName} center py={2}>{regionName}</Heading>
+
+ <Flex flexWrap='wrap' py={4}>
+ {countries
+ .filter((c => ( measuredCountriesInRegion.indexOf(c.alpha_2) > 0 )))
+ .map((country, index) => (
+ <CountryBlock key={index} countryCode={country.alpha_2} msmtCount={country.count} />
+ ))
+ }
</Flex>
- </div>
+ </Box>
+ )
}
const JumpToContainer = styled.div`
@@ -68,7 +87,18 @@ const JumpToLink = styled.a`
`
export default class Countries extends React.Component {
+ static async getInitialProps () {
+ const client = axios.create({baseURL: process.env.MEASUREMENTS_URL}) // eslint-disable-line
+ const result = await client.get('/api/_/countries')
+ return {
+ countries: result.data.countries
+ }
+ }
+
render () {
+ const { countries } = this.props
+ // Africa Americas Asia Europe Oceania Antarctica
+ const regions = ['002', '019', '142', '150', '009', 'AQ']
return (
<Layout>
@@ -80,7 +110,7 @@ export default class Countries extends React.Component {
<JumpToContainer>
<Container>
- <Text color='gray6' pb={2}>Jump to continent:</Text>
+ <Text fontWeight='bold' pb={2}><FormattedMessage id='Countries.Heading.JumpToContinent' />:</Text>
<JumpToLink href="#Africa">Africa</JumpToLink>
<JumpToLink href="#Americas">Americas</JumpToLink>
<JumpToLink href="#Asia">Asia</JumpToLink>
@@ -90,18 +120,11 @@ export default class Countries extends React.Component {
</JumpToContainer>
<Container>
- {/* Africa */}
- <RegionBlock regionCode='002' />
- {/* Americas */}
- <RegionBlock regionCode='019' />
- {/* Asia */}
- <RegionBlock regionCode='142' />
- {/* Europe */}
- <RegionBlock regionCode='150' />
- {/* Oceania */}
- <RegionBlock regionCode='009' />
- {/* Antarctica */}
- <RegionBlock regionCode='AQ' />
+ {
+ regions.map((regionCode, index) => (
+ <RegionBlock key={index} regionCode={regionCode} countries={countries} />
+ ))
+ }
</Container>
</Layout>
)
| 7 |
diff --git a/source/registry/test/unit.js b/source/registry/test/unit.js @@ -250,6 +250,45 @@ describe('Registry Unit', () => {
).to.be.revertedWith('TOKEN_DOES_NOT_EXIST')
})
})
+ describe('Test Zero Amount Transfer', async () => {
+ it('zero transfer amount', async () => {
+ let zero_amount = '0'
+ deployRegistry = await registryFactory.deploy(
+ stakingToken.address,
+ zero_amount,
+ zero_amount
+ )
+ await deployRegistry.deployed()
+ await deployRegistry.connect(account1).addTokens([token1.address])
+ await stakingToken.mock.transferFrom.returns(true)
+ })
+ it('zero transfer amount when removing token', async () => {
+ let zero_amount = '0'
+ deployRegistry = await registryFactory.deploy(
+ stakingToken.address,
+ zero_amount,
+ zero_amount
+ )
+ await deployRegistry.deployed()
+ await deployRegistry.connect(account1).addTokens([token1.address])
+ await deployRegistry.connect(account1).removeTokens([token1.address])
+ await stakingToken.mock.transferFrom.returns(true)
+ })
+ it('zero transfer amount when removing all tokens', async () => {
+ let zero_amount = '0'
+ deployRegistry = await registryFactory.deploy(
+ stakingToken.address,
+ zero_amount,
+ zero_amount
+ )
+ await deployRegistry.deployed()
+ await deployRegistry
+ .connect(account1)
+ .addTokens([token1.address, token2.address, token3.address])
+ await deployRegistry.connect(account1).removeAllTokens()
+ await stakingToken.mock.transferFrom.returns(true)
+ })
+ })
describe('Set URL', async () => {
it('successful setting of url', async () => {
| 7 |
diff --git a/app/assets/javascripts/jquery/plugins/inat/taxonmap.js.erb b/app/assets/javascripts/jquery/plugins/inat/taxonmap.js.erb @@ -34,7 +34,7 @@ inatTaxonMap.setup = function ( elt, options ) {
options.placeLayers = options.placeLayers || $(elt).data('place-layers');
options.taxonLayers = options.taxonLayers || $(elt).data('taxon-layers');
options.mapTypeControl = (options.mapTypeControl !== false && $(elt).data('map-type-control') !== true);
- options.taxonLayers = options.mapTypeControlOptions || $(elt).data('map-type-control-options');
+ options.mapTypeControlOptions = options.mapTypeControlOptions || $(elt).data('map-type-control-options');
options.zoomControl = (options.zoomControl !== false && $(elt).data('zoom-control') !== false);
options.scrollwheel = (options.scrollwheel !== false && $(elt).data('scrollwheel') !== false);
options.overlayMenu = (options.overlayMenu !== false && $(elt).data('overlay-menu') !== false);
| 1 |
diff --git a/lib/index.js b/lib/index.js @@ -167,9 +167,8 @@ var Embark = (function () {
});
}
- function initTests (options) {
- var Test = require('./core/test.js');
- return new Test(options);
+ function initTests () {
+ return require('./core/test.js');
}
// TODO: should deploy if it hasn't already
| 3 |
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml @@ -86,6 +86,7 @@ buildtest:intTestA:
- "*/target"
- "*/project/target"
- "$CI_PROJECT_DIR/pip-cache"
+ policy: pull-push
services:
- docker:dind
variables:
@@ -148,6 +149,7 @@ buildtest:intTestB:
- "*/target"
- "*/project/target"
- "$CI_PROJECT_DIR/pip-cache"
+ policy: pull
services:
- docker:dind
variables:
@@ -209,6 +211,7 @@ buildtest:intTestC:
- "*/target"
- "*/project/target"
- "$CI_PROJECT_DIR/pip-cache"
+ policy: pull
services:
- docker:dind
variables:
@@ -270,6 +273,7 @@ buildtest:intTestD:
- "*/target"
- "*/project/target"
- "$CI_PROJECT_DIR/pip-cache"
+ policy: pull
services:
- postgres:9.6
- docker:dind
| 12 |
diff --git a/android/Anyplace/src/com/dmsl/anyplace/utils/AndroidUtils.java b/android/Anyplace/src/com/dmsl/anyplace/utils/AndroidUtils.java @@ -150,32 +150,36 @@ public class AndroidUtils {
Enumeration<? extends ZipEntry> e = zipFile.entries();
while (e.hasMoreElements()) {
- ZipEntry entry = (ZipEntry) e.nextElement();
- File destinationFilePath = new File(zipPath, entry.getName());
+ ZipEntry ze = (ZipEntry) e.nextElement();
+ File f = new File(zipPath, ze.getName());
+ String canonicalPath = f.getCanonicalPath();
+ if (!canonicalPath.startsWith(zipPath)) {
+ throw new SecurityException("Zip Path Traversal Vulnerability");
+ }
// create directories if required.
- destinationFilePath.getParentFile().mkdirs();
+ f.getParentFile().mkdirs();
- // if the entry is directory, leave it. Otherwise extract it.
- if (entry.isDirectory()) {
+ // if the ze is directory, leave it. Otherwise extract it.
+ if (ze.isDirectory()) {
continue;
} else {
- // System.out.println("Extracting " + destinationFilePath);
+ // System.out.println("Extracting " + f);
/*
- * Get the InputStream for current entry of the zip file using
+ * Get the InputStream for current ze of the zip file using
*
- * InputStream getInputStream(Entry entry) method.
+ * InputStream getInputStream(Entry ze) method.
*/
- BufferedInputStream bis = new BufferedInputStream(zipFile.getInputStream(entry));
+ BufferedInputStream bis = new BufferedInputStream(zipFile.getInputStream(ze));
int b;
byte buffer[] = new byte[1024];
/*
- * read the current entry from the zip file, extract it and write the extracted file.
+ * read the current ze from the zip file, extract it and write the extracted file.
*/
- FileOutputStream fos = new FileOutputStream(destinationFilePath);
+ FileOutputStream fos = new FileOutputStream(f);
BufferedOutputStream bos = new BufferedOutputStream(fos, 1024);
while ((b = bis.read(buffer, 0, 1024)) != -1) {
| 1 |
diff --git a/packages/app/src/components/NotFoundPage.tsx b/packages/app/src/components/NotFoundPage.tsx import React, { useMemo } from 'react';
+
import { useTranslation } from 'react-i18next';
-import PageListIcon from './Icons/PageListIcon';
-import TimeLineIcon from './Icons/TimeLineIcon';
+import { useCurrentPageId, useCurrentPagePath } from '~/stores/context';
+
import CustomNavAndContents from './CustomNavigation/CustomNavAndContents';
import { DescendantsPageListForCurrentPath } from './DescendantsPageList';
+import PageListIcon from './Icons/PageListIcon';
+import TimeLineIcon from './Icons/TimeLineIcon';
import PageTimeline from './PageTimeline';
const NotFoundPage = (): JSX.Element => {
const { t } = useTranslation();
+ const { data: pageId } = useCurrentPageId();
+ const { data: path } = useCurrentPagePath();
+
+ if (pageId != null) {
+ window.history.replaceState(null, '', path);
+ }
const navTabMapping = useMemo(() => {
return {
| 14 |
diff --git a/lib/hls/hls_parser.js b/lib/hls/hls_parser.js @@ -1337,7 +1337,9 @@ shaka.hls.HlsParser.prototype.fetchPartialSegment_ = function(segmentRef) {
'support Range requests and CORS preflights.',
request.uris[0]);
request.headers = fullSegmentHeaders;
- return networkingEngine.request(requestType, request);
+ let operation = networkingEngine.request(requestType, request);
+ this.operationManager_.manage(operation);
+ return operation.promise;
});
};
| 4 |
diff --git a/packages/analytics-plugin-fullstory/src/browser.js b/packages/analytics-plugin-fullstory/src/browser.js @@ -53,6 +53,7 @@ function fullStoryPlugin(pluginConfig = {}) {
}, 0)
}
+ window._fs_debug = config.debug
window._fs_host = 'fullstory.com';
window._fs_script = 'edge.fullstory.com/s/fs.js';
window._fs_org = config.org;
| 1 |
diff --git a/ci-scripts/run_tests.sh b/ci-scripts/run_tests.sh @@ -17,6 +17,7 @@ setup_python() {
#@--- Install and activate virtualenv ---@#
install_activate_virtualenv() {
+ cp activity/settings/local-sample.py activity/settings/local.py
pip3 install pipenv
pipenv install
source $(python3 -m pipenv --venv)/bin/activate
| 0 |
diff --git a/index.d.ts b/index.d.ts @@ -494,6 +494,8 @@ declare module 'thinkjs' {
Logic: Logic;
Service: Service;
+ service(name: string): any;
+ service(name: string, ...args: any[]): any;
service(name: string, m: any, ...args: any[]): any;
beforeStartServer(fn: Function): Promise<any>;
}
| 3 |
diff --git a/contributors.json b/contributors.json "linkedin": "www.linkedin.com/in/mohammed-shakir-26256717b",
"name": "Mohammed Shakir"
},
+ "raptor-dev": {
+ "country": "India",
+ "name": "Raptosh DEB"
+ },
"WickedInvi": {
"country": "United Kingdom",
"name": "Deyan Petrov"
| 3 |
diff --git a/magda-registry-api/src/main/scala/au/csiro/data61/magda/registry/AspectQuery.scala b/magda-registry-api/src/main/scala/au/csiro/data61/magda/registry/AspectQuery.scala @@ -80,16 +80,24 @@ object AspectQuery {
* Example URL with aspectQuery: dcat-dataset-strings.title:?%rating% (Search keyword `rating` in `dcat-dataset-strings` aspect `title` field)
* /v0/records?limit=100&optionalAspect=source&aspect=dcat-dataset-strings&aspectQuery=dcat-dataset-strings.title:?%2525rating%2525
*/
- val operatorValueRegex = raw"^(:[!><=?]*)(.+)".r
+ val operatorValueRegex = raw"^(.+)(:[!><=?]*)(.+)$$".r
val numericValueRegex = raw"[-0-9.]+".r
def parse(string: String): AspectQuery = {
- val Array(path, value) =
- string.split(":").map(URLDecoder.decode(_, "utf-8"))
+ val List(path, opStr, valueStr) = string match {
+ case operatorValueRegex(pathStr, opStr, valueStr) =>
+ List(
+ URLDecoder.decode(pathStr, "utf-8"),
+ opStr,
+ URLDecoder.decode(valueStr, "utf-8")
+ )
+ case _ => throw new Error("Invalid Aspect Query Format.")
+ }
+
val pathParts = path.split("\\.").toList
- if (value.isEmpty) {
+ if (valueStr.isEmpty) {
throw new Exception("Value for aspect query is not present.")
}
@@ -97,8 +105,6 @@ object AspectQuery {
throw new Exception("Path for aspect query was empty")
}
- (":" + value) match {
- case operatorValueRegex(opStr, valueStr) =>
if (opStr == ":!") {
AspectQueryNotEqualValue(
pathParts.head,
@@ -159,7 +165,6 @@ object AspectQuery {
sqlOp
)
}
- }
}
}
| 7 |
diff --git a/services/StockService.php b/services/StockService.php @@ -78,6 +78,10 @@ class StockService extends BaseService
$product = $this->Database->products($productId);
$productStockAmount = $this->Database->stock()->where('product_id', $productId)->sum('amount');
+ if ($productStockAmount == null)
+ {
+ $productStockAmount = 0;
+ }
$productStockAmountOpened = $this->Database->stock()->where('product_id = :1 AND open = 1', $productId)->sum('amount');
$productLastPurchased = $this->Database->stock_log()->where('product_id', $productId)->where('transaction_type', self::TRANSACTION_TYPE_PURCHASE)->where('undone', 0)->max('purchased_date');
$productLastUsed = $this->Database->stock_log()->where('product_id', $productId)->where('transaction_type', self::TRANSACTION_TYPE_CONSUME)->where('undone', 0)->max('used_date');
| 12 |
diff --git a/nerdamer.core.js b/nerdamer.core.js @@ -1255,6 +1255,11 @@ var nerdamer = (function(imports) {
mod: function(x, y) {
return x % y;
},
+ //http://mathworld.wolfram.com/IntegerPart.html
+ integer_part: function(x) {
+ var sign = Math.sign(x);
+ return sign*Math.floor(Math.abs(x));
+ },
/**
* https://github.com/scijs/integrate-adaptive-simpson
* @param {Function} f - the function being integrated
@@ -4508,6 +4513,7 @@ var nerdamer = (function(imports) {
'polarform' : [ polarform, 1],
'rectform' : [ rectform, 1],
'sort' : [ sort, [1, 2]],
+ 'integer_part' : [, 1]
};
//error handler
this.error = err;
| 0 |
diff --git a/src/sections/Home/Proud-maintainers/proudMaintainers.style.js b/src/sections/Home/Proud-maintainers/proudMaintainers.style.js @@ -94,7 +94,7 @@ const ProjectItemWrapper = styled.section`
@media screen and (max-width: 460px){
h4 {
- margin-left: -25px;
+ margin-left: 0px;
}
}
}
| 1 |
diff --git a/packages/@uppy/file-input/package.json b/packages/@uppy/file-input/package.json "url": "git+https://github.com/transloadit/uppy.git"
},
"dependencies": {
- "@uppy/utils": "^0.25.5"
+ "@uppy/utils": "^0.25.5",
+ "preact": "^8.2.9"
},
"peerDependencies": {
"@uppy/core": "^0.25.5"
| 0 |
diff --git a/src/schema/util.js b/src/schema/util.js @@ -53,8 +53,12 @@ exports.anyOneOf = function (schema, value, exception, map, action, isSerialize,
return util.merge(value, highs[0].result);
}
} else if (matches.length === 0) {
+ if (exceptions.length > 0) {
const child = exception.nest('No matching schemas');
exceptions.forEach(childException => child.push(childException));
+ } else {
+ exception.message('No matching schemas')
+ }
} else {
return util.merge(value, matches[0].result);
}
| 9 |
diff --git a/README.md b/README.md @@ -58,7 +58,7 @@ If you run Sugarizer this way often, you should create an alias for this command
[Try it now! (try.sugarizer.org)](http://try.sugarizer.org/)
-Sugarizer Web App is a web application that runs on any device with a recent Chrome version and has also been tested successfully on Firefox, Safari, EDGE and IE.
+Sugarizer Web App is a web application that runs on any device with a recent Chrome version and has also been tested successfully on Firefox, Safari and EDGE.
As a web application, it does not run offline and requires a permanent network connection to a **Sugarizer Server**.
@@ -263,7 +263,11 @@ Note that this translation is for Sugarizer only. Each activity could provide it
As all Open Source software, contributions to this software are welcome.
-The **master** branch of the repository is for released/stable version, the **dev** branch is for development. So to contribute:
+The best way to start is to do the whole [tutorial](docs/tutorial.md). It will give you a good understanding of Sugarizer internal.
+
+Then, you could start to contribute by trying to fix some existing issues [here](https://github.com/llaske/Sugarizer/issues).
+
+Note than the **master** branch of the repository is for released/stable version, the **dev** branch is for development. So to contribute:
* Fork the **dev** branch of the repository,
* Update it with your contribution,
| 7 |
diff --git a/test/tests/ReactiveMixin.tests.js b/test/tests/ReactiveMixin.tests.js @@ -30,6 +30,27 @@ class ReactiveTest extends ReactiveMixin(HTMLElement) {
ReactiveTest.defaults = undefined;
customElements.define("reactive-test", ReactiveTest);
+// Simple class, copies state member `a` to `b`.
+class ReactiveStateTest1 extends ReactiveMixin(HTMLElement) {
+ get [internal.defaultState]() {
+ const state = super[internal.defaultState];
+ state.onChange("a", state => ({ b: state.a }));
+ return state;
+ }
+}
+customElements.define("reactive-state-test-1", ReactiveStateTest1);
+
+// Simple class, copies state member `a` to `b`, a has initial value.
+class ReactiveStateTest2 extends ReactiveMixin(HTMLElement) {
+ get [internal.defaultState]() {
+ const state = super[internal.defaultState];
+ state.a = 1;
+ state.onChange("a", state => ({ b: state.a }));
+ return state;
+ }
+}
+customElements.define("reactive-state-test-2", ReactiveStateTest2);
+
describe("ReactiveMixin", function() {
let container;
@@ -154,15 +175,7 @@ describe("ReactiveMixin", function() {
});
it("runs state change handlers when state changes", () => {
- // Simple class, copies state member `a` to `b`.
- class Fixture extends ReactiveMixin(HTMLElement) {
- get [internal.defaultState]() {
- const state = super[internal.defaultState];
- state.onChange("a", state => ({ b: state.a }));
- return state;
- }
- }
- const fixture = new Fixture();
+ const fixture = new ReactiveStateTest1();
fixture[internal.setState]({ a: 1 });
assert(fixture[internal.state].b === 1);
fixture[internal.setState]({ b: 2 }); // Shouldn't have any effect on `a`
@@ -172,15 +185,7 @@ describe("ReactiveMixin", function() {
});
it("runs state change handlers on initial state", () => {
- class Fixture extends ReactiveMixin(HTMLElement) {
- get [internal.defaultState]() {
- const state = super[internal.defaultState];
- state.a = 1;
- state.onChange("a", state => ({ b: state.a }));
- return state;
- }
- }
- const fixture = new Fixture();
+ const fixture = new ReactiveStateTest2();
assert(fixture[internal.state].a === 1);
assert(fixture[internal.state].b === 1);
fixture[internal.setState]({ a: 2 });
| 1 |
diff --git a/userscript.user.js b/userscript.user.js @@ -43990,6 +43990,13 @@ var $$IMU_EXPORT$$;
//return src.replace(/\/i\/[0-9]+x[0-9]+\//, "/i/99999999999x99999999999/");
}
+ if (domain_nosub === "cgames.de" && /^[0-9]*images\./.test(domain)) {
+ // https://10images.cgames.de/images/gamestar/204/highlightbild-der-erste-pc-trailer-von-red-dead-redemption-2-verspricht-fantastische-grafik_6081579.jpg
+ // https://10images.cgames.de/images/gamestar/4/highlightbild-der-erste-pc-trailer-von-red-dead-redemption-2-verspricht-fantastische-grafik_6081579.jpg
+ // https://7images.cgames.de/images/gamestar/4/conan-exiles_6028086.jpg -- 6160x3530
+ return src.replace(/(\/images\/+gamestar\/+)[0-9]+\/+/, "$14/");
+ }
+
@@ -49185,9 +49192,11 @@ var $$IMU_EXPORT$$;
sizes = el.sizes.split(",");
}
+ // https://www.gamestar.de/artikel/red-dead-redemption-2-pc-vorabversion-mit-limit-bei-120-fps-directx-12-und-vulkan,3350718.html
+ // sidebar articles: //8images.cgames.de/images/gamestar/256/red-dead-redemption-2_6062507.jpg, //8images.cgames.de/images/gamestar/210/red-dead-redemption-2_6062507.jpg 2x
for (var i = 0; i < ssources.length; i++) {
- var src = norm(ssources[i].replace(/ .*/, ""));
- var desc = ssources[i].replace(/.* /, "");
+ var src = norm(ssources[i].replace(/(?:, *| +) .*/, ""));
+ var desc = ssources[i].replace(/.*(?:, *| +)/, "");
if (!addImage(src, el, {layer:layer}))
continue;
| 7 |
diff --git a/lib/shared/addon/components/form-share-member/template.hbs b/lib/shared/addon/components/form-share-member/template.hbs @pagingLabel="pagination.cluster"
@headers={{membersHeaders}}
@stickyHeader={{false}}
+ @search={{false}}
as |sortable kind member dt|
>
{{#if (eq kind "row")}}
| 2 |
diff --git a/detox/test/package.json b/detox/test/package.json "e2e:ios": "detox test --configuration ios.sim.release --debug-synchronization",
"e2e:jest-circus:ios": "detox test --configuration ios.sim.release --debug-synchronization -o e2e/config-circus.js",
"e2e:jest-circus-timeout:ios": "node scripts/assert_timeout.js npm run e2e:jest-circus:ios -- --take-screenshots failing e2e/26.timeout.test.js",
- "e2e:ios-ci": "detox test --configuration ios.sim.release --workers 3 --loglevel verbose --debug-synchronization --take-screenshots all --record-logs all --record-videos all --record-timeline all -- --coverage",
+ "e2e:ios-ci": "detox test --configuration ios.sim.release --workers 3 --loglevel verbose --debug-synchronization --take-screenshots all --record-logs all --record-timeline all -- --coverage",
"e2e:ios-timeout-ci": "node scripts/assert_timeout.js npm run e2e:ios-ci -- e2e/26.timeout.test.js",
"e2e:android": "detox test --configuration android.emu.release",
"e2e:jest-circus:android": "detox test --configuration android.emu.release -o e2e/config-circus.js",
| 2 |
diff --git a/magda-web-client/package.json b/magda-web-client/package.json "dev": "pancake && yarn run start",
"prepare": "pancake",
"start": "craco start --react-scripts ../node_modules/react-scripts",
- "build": "pancake && GENERATE_SOURCEMAP=false craco build --react-scripts ../node_modules/react-scripts --max-old-space-size=4000",
+ "build": "pancake && CI=false GENERATE_SOURCEMAP=false craco build --react-scripts ../node_modules/react-scripts --max-old-space-size=4000",
"test": "craco test --react-scripts ../node_modules/react-scripts",
"eject": "react-scripts eject",
"analyze": "source-map-explorer 'build/static/js/*.js'"
| 8 |
diff --git a/edit.js b/edit.js @@ -399,6 +399,11 @@ const _makeHeightfieldShader = land => ({
value: new THREE.Vector3(),
needsUpdate: true,
},
+ uSelectRange: {
+ type: 'v4',
+ value: new THREE.Vector4().setScalar(NaN),
+ needsUpdate: true,
+ },
// "parallaxScale": { value: 0.5 },
// "parallaxMinLayers": { value: 25 },
// "parallaxMaxLayers": { value: 30 },
@@ -407,6 +412,8 @@ const _makeHeightfieldShader = land => ({
precision highp float;
precision highp int;
+ uniform vec4 uSelectRange;
+
// attribute vec3 barycentric;
attribute float ao;
attribute float skyLight;
@@ -418,6 +425,7 @@ const _makeHeightfieldShader = land => ({
varying float vAo;
varying float vSkyLight;
varying float vTorchLight;
+ varying vec3 vSelectColor;
${land ? '' : `\
varying vec3 ts_view_pos;
@@ -465,6 +473,16 @@ const _makeHeightfieldShader = land => ({
vSkyLight = skyLight/8.0;
vTorchLight = torchLight/8.0;
+ vSelectColor = vec3(0.);
+ if (
+ position.x >= uSelectRange.x &&
+ position.z >= uSelectRange.y &&
+ position.x < uSelectRange.z &&
+ position.z < uSelectRange.w
+ ) {
+ vSelectColor = vec3(${new THREE.Color(0x4fc3f7).toArray().join(', ')});
+ }
+
vec3 vert_tang;
vec3 vert_bitang;
if (abs(normal.y) < 0.05) {
@@ -506,6 +524,8 @@ const _makeHeightfieldShader = land => ({
uniform float sunIntensity;
uniform sampler2D tex;
+ uniform float uTime;
+ uniform vec3 sunDirection;
float parallaxScale = 0.3;
float parallaxMinLayers = 50.;
float parallaxMaxLayers = 50.;
@@ -516,8 +536,7 @@ const _makeHeightfieldShader = land => ({
varying float vAo;
varying float vSkyLight;
varying float vTorchLight;
- uniform float uTime;
- uniform vec3 sunDirection;
+ varying vec3 vSelectColor;
${land ? '' : `\
varying vec3 ts_view_pos;
@@ -715,6 +734,7 @@ ${land ? '' : `\
diffuseColor = mix(diffuseColor, vec3(1.0), max(1.0 - abs(pow(length(vViewPosition) - mod(uTime*60., 1.)*5.0, 3.0)), 0.0)*0.5);
diffuseColor *= (0.9 + 0.1*min(gl_FragCoord.z/gl_FragCoord.w/10.0, 1.0));
}
+ diffuseColor += vSelectColor;
float worldFactor = floor((sunIntensity * vSkyLight + vTorchLight) * 4.0 + 1.9) / 4.0 * vAo;
float cameraFactor = floor(8.0 - length(vViewPosition))/8.;
diffuseColor *= max(max(worldFactor, cameraFactor), 0.1);
@@ -5327,14 +5347,28 @@ function animate(timestamp, frame) {
if (!buildMode) {
switch (selectedWeapon) {
case 'select': {
+ for (const material of currentChunkMesh.material) {
+ material.uniforms.uSelectRange.value.set(NaN, NaN, NaN, NaN);
+ material.uniforms.uSelectRange.needsUpdate = true;
+ }
+ currentVegetationMesh.material[0].uniforms.uSelectId.value = -1;
+ currentVegetationMesh.material[0].uniforms.uSelectId.needsUpdate = true;
for (const thingMesh of meshDrawer.thingMeshes) {
thingMesh.material.uniforms.uSelectColor.value.setHex(0xFFFFFF);
thingMesh.material.uniforms.uSelectColor.needsUpdate = true;
}
- currentVegetationMesh.material[0].uniforms.uSelectId.value = -1;
- currentVegetationMesh.material[0].uniforms.uSelectId.needsUpdate = true;
- if (raycastChunkSpec && raycastChunkSpec.objectId !== 0) {
+ if (raycastChunkSpec) {
+ if (raycastChunkSpec.objectId === 0) {
+ for (const material of currentChunkMesh.material) {
+ const minX = Math.floor(raycastChunkSpec.point.x/SUBPARCEL_SIZE);
+ const minY = Math.floor(raycastChunkSpec.point.z/SUBPARCEL_SIZE);
+ const maxX = minX+1;
+ const maxY = minY+1;
+ material.uniforms.uSelectRange.value.set(minX, minY, maxX, maxY).multiplyScalar(SUBPARCEL_SIZE);
+ material.uniforms.uSelectRange.needsUpdate = true;
+ }
+ } else {
currentVegetationMesh.material[0].uniforms.uSelectId.value = raycastChunkSpec.objectId;
currentVegetationMesh.material[0].uniforms.uSelectId.needsUpdate = true;
@@ -5345,6 +5379,7 @@ function animate(timestamp, frame) {
thingMesh.material.uniforms.uSelectColor.needsUpdate = true;
}
}
+ }
break;
}
}
| 0 |
diff --git a/RobotNAO/src/main/java/de/fhg/iais/roberta/syntax/codegen/Ast2NaoPythonVisitor.java b/RobotNAO/src/main/java/de/fhg/iais/roberta/syntax/codegen/Ast2NaoPythonVisitor.java @@ -25,12 +25,9 @@ import de.fhg.iais.roberta.mode.action.nao.Resolution;
import de.fhg.iais.roberta.mode.action.nao.TurnDirection;
import de.fhg.iais.roberta.mode.action.nao.WalkDirection;
import de.fhg.iais.roberta.mode.general.IndexLocation;
-import de.fhg.iais.roberta.mode.sensor.nao.ColorSensorMode;
import de.fhg.iais.roberta.mode.sensor.nao.Coordinates;
-import de.fhg.iais.roberta.mode.sensor.nao.MotorTachoMode;
import de.fhg.iais.roberta.mode.sensor.nao.Sensor;
import de.fhg.iais.roberta.mode.sensor.nao.Side;
-import de.fhg.iais.roberta.syntax.MotorDuration;
import de.fhg.iais.roberta.syntax.Phrase;
import de.fhg.iais.roberta.syntax.action.generic.BluetoothCheckConnectAction;
import de.fhg.iais.roberta.syntax.action.generic.BluetoothConnectAction;
@@ -163,7 +160,6 @@ import de.fhg.iais.roberta.syntax.stmt.StmtList;
import de.fhg.iais.roberta.syntax.stmt.WaitStmt;
import de.fhg.iais.roberta.syntax.stmt.WaitTimeStmt;
import de.fhg.iais.roberta.util.dbc.Assert;
-import de.fhg.iais.roberta.util.dbc.DbcException;
import de.fhg.iais.roberta.visitor.AstVisitor;
import de.fhg.iais.roberta.visitor.NaoAstVisitor;
@@ -615,14 +611,14 @@ public class Ast2NaoPythonVisitor implements NaoAstVisitor<Void> {
incrIndentation();
visitStmtList(waitStmt.getStatements());
nlIndent();
- this.sb.append("hal.waitFor(15)");
+ this.sb.append("time.sleep(15)");
decrIndentation();
return null;
}
@Override
public Void visitWaitTimeStmt(WaitTimeStmt<Void> waitTimeStmt) {
- this.sb.append("hal.waitFor(");
+ this.sb.append("time.sleep(");
waitTimeStmt.getTime().visit(this);
this.sb.append(")");
return null;
@@ -1695,6 +1691,8 @@ public class Ast2NaoPythonVisitor implements NaoAstVisitor<Void> {
this.sb.append(")");
return null;
}
+
+ @Override
public Void visitDetectFace(DetectFace<Void> detectFace) {
this.sb.append("h.detectFace()");
return null;
@@ -1881,8 +1879,7 @@ public class Ast2NaoPythonVisitor implements NaoAstVisitor<Void> {
}
@Override
- public Void visitBluetoothWaitForConnectionAction(
- BluetoothWaitForConnectionAction<Void> bluetoothWaitForConnection) {
+ public Void visitBluetoothWaitForConnectionAction(BluetoothWaitForConnectionAction<Void> bluetoothWaitForConnection) {
// TODO Auto-generated method stub
return null;
}
| 1 |
diff --git a/articles/extensions/sumologic.md b/articles/extensions/sumologic.md @@ -67,6 +67,10 @@ To help us (and our customers) visualize these logs, we spent some time creating

-If you're a Sumo Logic customer and are interested in trying out this dashboard, just let us know via [Support Center](${env.DOMAIN_URL_SUPPORT}) and we will gladly share it with you. Make sure to include your Sumo Logic account name in your request. Once it's available through your account, you're free to customize it, add to it, create alerts based on the searches, or really anything else that you find useful.
+If you're a Sumo Logic customer and are interested in trying out this dashboard, you can find details on installing the Auth0 App for the Sumo Logic extension here:
+
+[Install the Auth0 App](https://help.sumologic.com/Send_Data/Data_Types/Auth0/02Install_the_Auth0_App)
+
+Once it's available through your account, you're free to customize it, add to it, create alerts based on the searches, or really anything else that you find useful.
Have fun analyzing and visualizing those logs!
\ No newline at end of file
| 0 |
diff --git a/src/DevChatter.Bot.Core/Automation/OneTimeCallBackAction.cs b/src/DevChatter.Bot.Core/Automation/OneTimeCallBackAction.cs @@ -13,7 +13,7 @@ public OneTimeCallBackAction(int delayInSeconds, Action actionToCall)
_timeOfNextRun = DateTime.UtcNow.AddSeconds(delayInSeconds);
}
- public bool IsTimeToRun() => DateTime.Now > _timeOfNextRun;
+ public bool IsTimeToRun() => DateTime.UtcNow > _timeOfNextRun;
public void Invoke()
{
| 1 |
diff --git a/website/javascript/templates/HackathonPortal.vue b/website/javascript/templates/HackathonPortal.vue <p class="t2 c-wht font-headline">FEATURED HACKATHONS AND EVENTS</p>
</div>
<div class="row hackathon-progress-cards">
+ <!-- For new events just copy paste the below div and customize,
+ you also need to modify the function to point to the righ link -->
<div class="col-md-3" @click="jumpToHackathon(2)">
<div class="hackathon-progress-card">
<img class="hackathon-card-img" src="https://storage.googleapis.com/halite-2-hackathon-thumbnails/hackathon-image.png" alt="hackathon"/>
<div class="hackathon-card-text">
- <p class="t3 c-wht">Hackathon #1</p>
+ <p class="t3 c-wht">TBD</p>
<ul class="hackathon-info">
<li>
<img :src="`${baseUrl}/assets/images/halite-pin.svg`"/>
</li>
<li>
<img :src="`${baseUrl}/assets/images/halite-time.svg`"/>
- <p class="hackathon-card-item-text">August 3-5</p>
+ <p class="hackathon-card-item-text">TBD</p>
</li>
<li>
<img :src="`${baseUrl}/assets/images/halite-group.svg`"/>
- <p class="hackathon-card-item-text">Open to all</p>
- </li>
- </ul>
- </div>
- </div>
- </div>
- <div class="col-md-3" @click="jumpToHackathon(2)">
- <div class="hackathon-progress-card">
- <img class="hackathon-card-img" src="https://storage.googleapis.com/halite-2-hackathon-thumbnails/hackathon-image.png" alt="hackathon"/>
- <div class="hackathon-card-text">
- <p class="t3 c-wht">Hackathon #1</p>
- <ul class="hackathon-info">
- <li>
- <img :src="`${baseUrl}/assets/images/halite-pin.svg`"/>
- <p class="hackathon-card-item-text">New York</p>
- </li>
- <li>
- <img :src="`${baseUrl}/assets/images/halite-time.svg`"/>
- <p class="hackathon-card-item-text">August 3-5</p>
- </li>
- <li>
- <img :src="`${baseUrl}/assets/images/halite-group.svg`"/>
- <p class="hackathon-card-item-text">Open to all</p>
- </li>
- </ul>
- </div>
- </div>
- </div>
- <div class="col-md-3" @click="jumpToHackathon(2)">
- <div class="hackathon-progress-card">
- <img class="hackathon-card-img" src="https://storage.googleapis.com/halite-2-hackathon-thumbnails/hackathon-image.png" alt="hackathon"/>
- <div class="hackathon-card-text">
- <p class="t3 c-wht">Hackathon #2</p>
- <ul class="hackathon-info">
- <li>
- <img :src="`${baseUrl}/assets/images/halite-pin.svg`"/>
- <p class="hackathon-card-item-text">New York</p>
- </li>
- <li>
- <img :src="`${baseUrl}/assets/images/halite-time.svg`"/>
- <p class="hackathon-card-item-text">August 3-5</p>
- </li>
- <li>
- <img :src="`${baseUrl}/assets/images/halite-group.svg`"/>
- <p class="hackathon-card-item-text">Open to all</p>
- </li>
- </ul>
- </div>
- </div>
- </div>
- <div class="col-md-3" @click="jumpToHackathon(2)">
- <div class="hackathon-progress-card">
- <img class="hackathon-card-img" src="https://storage.googleapis.com/halite-2-hackathon-thumbnails/hackathon-image.png" alt="hackathon"/>
- <div class="hackathon-card-text">
- <p class="t3 c-wht">Hackathon #2</p>
- <ul class="hackathon-info">
- <li>
- <img :src="`${baseUrl}/assets/images/halite-pin.svg`"/>
- <p class="hackathon-card-item-text">New York</p>
- </li>
- <li>
- <img :src="`${baseUrl}/assets/images/halite-time.svg`"/>
- <p class="hackathon-card-item-text">August 3-5</p>
- </li>
- <li>
- <img :src="`${baseUrl}/assets/images/halite-group.svg`"/>
- <p class="hackathon-card-item-text">Open to all</p>
+ <p class="hackathon-card-item-text">TBD</p>
</li>
</ul>
</div>
| 1 |
diff --git a/notebooks/Aggregating an array.ipynb b/notebooks/Aggregating an array.ipynb },
{
"cell_type": "code",
- "execution_count": 205,
+ "execution_count": 215,
"metadata": {},
"outputs": [
{
"# and it will be stored under the resolutions['1']\n",
"# dataset\n",
"f['resolutions'].create_dataset(str(curr_resolution), (array_length,))\n",
- "f['resolutions']['1'][:] = array_data # see above section\n",
+ "f['resolutions'][str(curr_resolution)][:] = array_data # see above section\n",
"\n",
"# the tile size that we want higlass to use\n",
"# unless this needs to be drastically different, there's no\n",
{
"cell_type": "code",
"execution_count": 206,
- "metadata": {},
+ "metadata": {
+ "collapsed": true
+ },
"outputs": [],
"source": [
"def get_tileset_info(f):\n",
| 3 |
diff --git a/components/footer.js b/components/footer.js @@ -12,7 +12,7 @@ const Footer = () => (
<li><a href='https://twitter.com/AdresseDataGouv'><img src='/images/medias/twitter.svg' alt='Twitter' /></a></li>
<li><a href='https://github.com/etalab/adresse.data.gouv.fr'><img src='/images/medias/github.svg' alt='Github' /></a></li>
<li><a href='https://blog.geo.data.gouv.fr'><img src='/images/medias/medium.svg' alt='Medium' /></a></li>
- <li><a href='mailto:[email protected]'><img src='/images/medias/envelop.svg' alt='Nous contacter' /></a></li>
+ <li><Link href='/nous-contacter'><a><img src='/images/medias/envelop.svg' alt='Nous contacter' /></a></Link></li>
</ul>
</div>
<ul className='footer__links'>
| 14 |
diff --git a/articles/extensions/authorization-extension/v2/index.md b/articles/extensions/authorization-extension/v2/index.md @@ -9,13 +9,14 @@ description: Control user authorization behavior during runtime with the Authori
<div data-name="example" class="topic-page-badge"></div>
<h1>Authorization Extension</h1>
<p>
- The Authorization Extension provides support for user authorization via Groups, Roles, and Permissions. You can define the expected behavior during the login process, and your configuration settings will be captured in a <a href="/rules">rule</a> that's executed during runtime.
- </p>
- <p>
- You can store authorization data like groups, roles, or permissions in the outgoing token issued by Auth0. Your application can then consume this information by inspecting the token and take appropriate actions based on the user's current authorization context.
+ How to configure user authorization in your application using the Authorization Extension.
</p>
</div>
+The Authorization Extension provides support for user authorization via Groups, Roles, and Permissions. You can define the expected behavior during the login process, and your configuration settings will be captured in a [rule](/rules) that's executed during runtime.
+
+You can store authorization data like groups, roles, or permissions in the outgoing token issued by Auth0. Your application can then consume this information by inspecting the token and take appropriate actions based on the user's current authorization context.
+
## Get Started
Before you can use the extension, you'll need to install it, configure the rule controlling its behavior during login, and set up your user management.
@@ -23,12 +24,15 @@ Before you can use the extension, you'll need to install it, configure the rule
<ul class="topic-links">
<li>
<i class="icon icon-budicon-715"></i><a href="/extensions/authorization-extension/v2/implementation/installation">Install the Extension</a>
+ <p>Walk through the process of installing the Authorization Extension.</p>
</li>
<li>
<i class="icon icon-budicon-715"></i><a href="/extensions/authorization-extension/v2/implementation/setup">Set Up the Extension</a>
+ <p>Learn the basics of users, groups, roles, and permissions, and how to configure them.</p>
</li>
<li>
<i class="icon icon-budicon-715"></i><a href="/extensions/authorization-extension/v2/implementation/configuration">Configure the Extension</a>
+ <p>Configure how the extension will behave during the login transaction.</p>
</li>
</ul>
@@ -39,6 +43,7 @@ You can easily move data into or out of the Extension.
<ul class="topic-links">
<li>
<i class="icon icon-budicon-715"></i><a href="/extensions/authorization-extension/v2/import-export-data">Importing Existing Data into/Exporting Data from the Extension</a>
+ <p>Learn how you can import or export authorization data using a JSON file.</p>
</li>
</ul>
@@ -49,9 +54,11 @@ Once your extension is up and running, you can add additional functionality to i
<ul class="topic-links">
<li>
<i class="icon icon-budicon-715"></i><a href="/extensions/authorization-extension/v2/api-access">Enable API Access to the Extension</a>
+ <p>Learn how you can automate provisioning and query the authorization context of your users in real-time, using the extension's API.</p>
</li>
<li>
<i class="icon icon-budicon-715"></i><a href="/extensions/authorization-extension/v2/rules">Use the Authorization Extension's Data in Rules</a>
+ <p>Learn how you can use rules to configure extra logic to your logins.</p>
</li>
</ul>
@@ -62,5 +69,6 @@ Review our tips for troubleshooting commonly-seen issues.
<ul class="topic-links">
<li>
<i class="icon icon-budicon-715"></i><a href="/extensions/authorization-extension/v2/troubleshooting">Troubleshoot Errors</a>
+ <p>Common problems and tips to help you identify their cause.</p>
</li>
</ul>
| 0 |
diff --git a/lib/waterline/utils/query/help-find.js b/lib/waterline/utils/query/help-find.js @@ -493,6 +493,10 @@ module.exports = function helpFind(WLModel, s2q, omen, done) {
//
// Besides acting as an optimization, this avoids errors for adapters that don't tolerate
// undefined values in `where` clauses (see https://github.com/balderdashy/waterline/issues/1501)
+ //
+ // Note that an adapter should never need to deal with an undefined value in a "where" clause. No constraint in a where clause
+ // should ever be undefined (because the adapter always receives a fully-formed S3Q)
+ // (https://github.com/balderdashy/waterline/commit/1aebb9eecb24efbccfc996ec881f9dc497dbb0e0#commitcomment-23776777)
if (_.isUndefined(parentRecord[singleJoin.parentKey])) {
if (singleJoin.collection === true) {
parentRecord[alias] = [];
| 0 |
diff --git a/src/network/requestQueue/index.js b/src/network/requestQueue/index.js @@ -58,8 +58,10 @@ module.exports = class RequestQueue {
const { correlationId } = pushedRequest.entry
const defaultRequestTimeout = this.requestTimeout
const customRequestTimeout = pushedRequest.requestTimeout
- const requestTimeout =
- customRequestTimeout == null ? defaultRequestTimeout : customRequestTimeout
+
+ // Some protocol requests have custom request timeouts (e.g JoinGroup, Fetch, etc). The custom
+ // timeouts are influenced by user configurations, which can be lower than the default requestTimeout
+ const requestTimeout = Math.max(defaultRequestTimeout, customRequestTimeout || 0)
const socketRequest = new SocketRequest({
entry: pushedRequest.entry,
| 4 |
diff --git a/articles/libraries/auth0js/v8/migration-guide.md b/articles/libraries/auth0js/v8/migration-guide.md @@ -21,6 +21,17 @@ The first question to answer before getting into the changes is why to migrate y
* v8 was rewritten from scratch, improving its cohesion and performance and coming with more tests to be utilized.
* Long term support - As is often the case with new iterations of projects, it is likely that v8 will be supported for quite a bit longer than v7.
+### Use of API Auth and Metadata
+
+If you need to use [API Auth](/docs/api-auth) features, we recommend that you upgrade to [auth0.js v8](/docs/libraries/auth0js/v8).
+
+If, however, your application is relying on being able to request metadata via [scopes](/docs/scopes), you have two choices:
+
+* Continue to use v7 until it is no longer an option
+* Use v8 without using API Auth. Do not mark your client as OIDC Conformant, do not pass the `audience` parameter. For example, if using [authorize()](http://auth0.github.io/auth0.js/global.html#authorize), [loginWithResourceOwner()](http://auth0.github.io/auth0.js/global.html#loginWithResourceOwner), [loginWithCredentials()](http://auth0.github.io/auth0.js/global.html#loginWithCredentials), or [signupAndLogin()](http://auth0.github.io/auth0.js/global.html#signupAndLogin) (_Note that some of the methods mentioned here use the legacy Resource Owner grant in order to be used and are unavailable to some customers._).
+
+Alternatively, you could also simply request the metadata in a different way, for example with a rule to add custom claims to either the returned `id_token` or `access_token` as described in the [custom claims](https://auth0.com/docs/scopes/current#custom-claims) section of the scopes documentation.
+
## Initialization of auth0.js
Initialization of auth0.js in your application will now use `auth0.WebAuth` instead of `Auth0`
| 0 |
diff --git a/app-template/bitcoincom/appConfig.json b/app-template/bitcoincom/appConfig.json "windowsAppId": "804636ee-b017-4cad-8719-e58ac97ffa5c",
"pushSenderId": "1036948132229",
"description": "A Secure Bitcoin Wallet",
- "version": "3.5.8",
- "androidVersion": "350803",
+ "version": "4.0.0",
+ "androidVersion": "400000",
"_extraCSS": "",
"_enabledExtensions": {
"coinbase": false,
| 3 |
diff --git a/app/components/agent/Show.js b/app/components/agent/Show.js @@ -19,7 +19,7 @@ class AgentShow extends React.Component {
static propTypes = {
agent: React.PropTypes.shape({
id: React.PropTypes.string,
- name: React.PropTypes.string.isRequired,
+ name: React.PropTypes.string,
connectionState: React.PropTypes.string,
permissions: React.PropTypes.shape({
agentStop: React.PropTypes.shape({
@@ -35,6 +35,9 @@ class AgentShow extends React.Component {
};
componentDidMount() {
+ // Only bother setting up the delayed load and refresher if we've got an
+ // actual agent to play with.
+ if(this.props.agent && this.props.agent.id) {
this._agentRefreshInterval = setInterval(this.fetchUpdatedData, 5::seconds);
// Once the agent's show page has mounted in DOM, switch `isMounted` to
@@ -42,10 +45,13 @@ class AgentShow extends React.Component {
// to show this page.
this.props.relay.setVariables({ isMounted: true });
}
+ }
componentWillUnmount() {
+ if(this._agentRefreshInterval) {
clearInterval(this._agentRefreshInterval);
}
+ }
fetchUpdatedData = () => {
this.props.relay.forceFetch(true);
@@ -163,6 +169,19 @@ class AgentShow extends React.Component {
};
render() {
+ // If we don't have an agent object, or we do but it doesn't have an id
+ // (perhaps Relay gave us an object but it's empty) then we can safely
+ // assume that it's a 404.
+ if(!this.props.agent || !this.props.agent.id) {
+ return (
+ <DocumentTitle title={`Agents / No Agent Found`}>
+ <PageWithContainer>
+ <p>No agent could be found!</p>
+ </PageWithContainer>
+ </DocumentTitle>
+ );
+ }
+
let contents;
if (this.props.relay.variables.isMounted) {
contents = this.renderContents();
@@ -282,6 +301,7 @@ export default Relay.createContainer(AgentShow, {
agent: () => Relay.QL`
fragment on Agent {
${AgentStopMutation.getFragment('agent')}
+ id
name
organization {
name
| 9 |
diff --git a/articles/libraries/auth0js/v9/migration-angular.md b/articles/libraries/auth0js/v9/migration-angular.md section: libraries
title: Migrating Angular applications to Auth0.js 9
description: How to migrate Angular applications to Auth0.js 9
-toc: true
---
-
# Migrating Angular Applications to Auth0.js v9
-Angular applications can use Lock.js directly without any kind of wrapper library.
-
-All Angular applications will be using Auth0.js v8, so you can follow the [Migrating from Auth0.js v8](migration-v8-v9.md) guide.
+Angular applications can use Lock directly without any kind of wrapper library.
+All Angular applications will be using Auth0.js v8, so you can follow the [Migrating from Auth0.js v8](/libraries/auth0js/v9/migration-v8-v9) guide.
| 14 |
diff --git a/src/botPage/bot/Interpreter.js b/src/botPage/bot/Interpreter.js @@ -205,7 +205,8 @@ export default class Interpreter {
// TODO: This is a workaround, create issue on original repo, once fixed
// remove this. We don't know how many args are going to be passed, so we
// assume a max of 100.
- Object.defineProperty(asyncFunc, 'length', { value: 100 });
+ const MAX_ACCEPTABLE_FUNC_ARGS = 100;
+ Object.defineProperty(asyncFunc, 'length', { value: MAX_ACCEPTABLE_FUNC_ARGS + 1 });
return interpreter.createAsyncFunction(asyncFunc);
}
hasStarted() {
| 12 |
diff --git a/docker/rootfs/etc/nginx/nginx.conf b/docker/rootfs/etc/nginx/nginx.conf @@ -26,12 +26,15 @@ http {
tcp_nopush on;
tcp_nodelay on;
client_body_temp_path /tmp/nginx/body 1 2;
- keepalive_timeout 65;
+ keepalive_timeout 90s;
+ proxy_connect_timeout 90s;
+ proxy_send_timeout 90s;
+ proxy_read_timeout 90s;
ssl_prefer_server_ciphers on;
gzip on;
proxy_ignore_client_abort off;
client_max_body_size 2000m;
- server_names_hash_bucket_size 64;
+ server_names_hash_bucket_size 1024;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-Scheme $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
| 12 |
diff --git a/src/Store.js b/src/Store.js import thunkMiddleware from 'redux-thunk'
-import { createStore, applyMiddleware, combineReducers } from 'redux'
+import { createStore, applyMiddleware, combineReducers, compose } from 'redux'
import listings from './reducers/Listings'
import profile from './reducers/Profile'
@@ -14,6 +14,7 @@ if (process.env.NODE_ENV !== 'production') {
middlewares.push(logger)
}
+const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
const store = createStore(
combineReducers({
listings,
@@ -22,7 +23,9 @@ const store = createStore(
alert,
users,
}),
+ composeEnhancers(
applyMiddleware(...middlewares)
+ ),
)
export default store
| 9 |
diff --git a/src/components/Modal.tsx b/src/components/Modal.tsx @@ -79,7 +79,7 @@ const Overlay: React.FC<IPropsOverlay> = ({ isActive }) => (
)
export interface IProps {
- className: string
+ className?: string
isOpen: boolean
setIsOpen: (boolean: boolean) => void
}
| 12 |
diff --git a/server.js b/server.js @@ -11,6 +11,7 @@ const WebcamStream = require('./server/processes/WebcamStream');
const Counter = require('./server/counter/Counter');
const request = require('request');
const fs = require('fs');
+const cloneDeep = require('lodash.clonedeep');
const SIMULATION_MODE = process.env.NODE_ENV !== 'production'; // When not running on the Jetson
@@ -97,7 +98,9 @@ app.prepare()
});
express.get('/counter/export', function(req, res) {
- res.csv(Counter.getCounterHistory(), false ,{'Content-disposition': 'attachment; filename=counterData.csv'});
+ var dataToExport = cloneDeep(Counter.getCounterHistory());
+ // console.log(dataToExport);
+ res.csv(dataToExport, false ,{'Content-disposition': 'attachment; filename=counterData.csv'});
});
| 1 |
diff --git a/server/views/topics/stories.py b/server/views/topics/stories.py @@ -214,6 +214,7 @@ def stream_story_list_csv(user_mc_key, filename, topics_id, **kwargs):
'''
as_attachment = kwargs['as_attachment'] if 'as_attachment' in kwargs else True
fb_data = kwargs['fb_data'] if 'fb_data' in kwargs else False
+ q_data = request.args['q'] if 'q' in request.args and request.args['q'] not in [None, '', 'null', 'undefined'] else None
all_stories = []
more_stories = True
params = kwargs
@@ -230,7 +231,7 @@ def stream_story_list_csv(user_mc_key, filename, topics_id, **kwargs):
user_mc = user_mediacloud_client()
try:
while more_stories:
- page = topic_story_list(user_mc_key, topics_id, **params)
+ page = topic_story_list(user_mc_key, topics_id, q=q_data, **params)
# need to make another call to fetch the tags :-(
story_ids = [str(s['stories_id']) for s in page['stories']]
stories_with_tags = user_mc.storyList('stories_id:('+" ".join(story_ids)+")", rows=kwargs['limit'])
| 9 |
diff --git a/spec/models/table/relator_spec.rb b/spec/models/table/relator_spec.rb @@ -72,7 +72,7 @@ describe CartoDB::TableRelator do
before :each do
bypass_named_maps
- CartoDB::Visualization::Member.any_instance.stubs(:dependent?).returns(true, false, true)
+ CartoDB::Visualization::Member.any_instance.stubs(:fully_dependent?).returns(true, false, true)
@dependents = @table_relator.serialize_dependent_visualizations
end
@@ -128,7 +128,7 @@ describe CartoDB::TableRelator do
before :each do
bypass_named_maps
- CartoDB::Visualization::Member.any_instance.stubs(:non_dependent?).returns(true, false, false)
+ CartoDB::Visualization::Member.any_instance.stubs(:partially_dependent?).returns(true, false, false)
@non_dependents = @table_relator.serialize_non_dependent_visualizations
end
| 1 |
diff --git a/articles/client-auth/v2/mobile-desktop.md b/articles/client-auth/v2/mobile-desktop.md @@ -106,6 +106,64 @@ NSString *verifier = [[[[data base64EncodedStringWithOptions:0]
</div>
</div>
+To create the `code_challenge` that accompanies the `code_verifier`, embed the following into your code:
+
+<div class="code-picker">
+ <div class="languages-bar">
+ <ul>
+ <li class="active"><a href="#challenge-javascript" data-toggle="tab">Node.js</a></li>
+ <li><a href="#challenge-java" data-toggle="tab">Java</a></li>
+ <li><a href="#challenge-swift" data-toggle="tab">Swift 3</a></li>
+ <li><a href="#challenge-objc" data-toggle="tab">Objective-C</a></li>
+ </ul>
+ </div>
+ <div class="tab-content">
+ <div id="challenge-javascript" class="tab-pane active">
+ <pre>
+<code class="javascript hljs">function sha256(buffer) {
+ return crypto.createHash('sha256').update(buffer).digest();
+}
+
+var challenge = base64URLEncode(sha256(verifier));</code></pre>
+ </div>
+ <div id="challenge-java" class="tab-pane">
+ <pre>
+<code class="java hljs">byte[] bytes = verifier.getBytes("US-ASCII");
+MessageDigest md = MessageDigest.getInstance("SHA-256");
+md.update(input, 0, input.length);
+byte[] digest = md.digest();
+String challenge = Base64.encodeToString(digest, Base64.URL_SAFE | Base64.NO_WRAP | Base64.NO_PADDING);</code></pre>
+ </div>
+ <div id="challenge-swift" class="tab-pane">
+ <pre>
+<code class="swift hljs"> // You need to import CommonCrypto
+guard let data = verifier.data(using: .utf8) else { return nil }
+var buffer = [UInt8](repeating: 0, count: Int(CC_SHA256_DIGEST_LENGTH))
+data.withUnsafeBytes {
+ _ = CC_SHA256($0, CC_LONG(data.count), &buffer)
+}
+let hash = Data(bytes: buffer)
+let challenge = hash.base64EncodedString()
+ .replacingOccurrences(of: "+", with: "-")
+ .replacingOccurrences(of: "/", with: "_")
+ .trimmingCharacters(in: .whitespaces)</code></pre>
+ </div>
+ <div id="challenge-objc" class="tab-pane">
+ <pre>
+<code class="objc hljs"> // You need to import CommonCrypto
+u_int8_t buffer[CC_SHA256_DIGEST_LENGTH * sizeof(u_int8_t)];
+memset(buffer, 0x0, CC_SHA256_DIGEST_LENGTH);
+NSData *data = [verifier dataUsingEncoding:NSUTF8StringEncoding];
+CC_SHA256([data bytes], (CC_LONG)[data length], buffer);
+NSData *hash = [NSData dataWithBytes:buffer length:CC_SHA256_DIGEST_LENGTH];
+NSString *challenge = [[[[hash base64EncodedStringWithOptions:0]
+ stringByReplacingOccurrencesOfString:@"+" withString:@"-"]
+ stringByReplacingOccurrencesOfString:@"/" withString:@"_"]
+ stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"="]];</code></pre>
+ </div>
+ </div>
+</div>
+
Step 2: Authorize the User
Once you've created the `code_verifier` and the `code_challenge` that you include in the authorization request, you'll need to obtain the user's authorization. This is technically the beginning of the authorization flow, and this step may include one or more of the following processes:
| 0 |
diff --git a/components/core/Upload/Popup.js b/components/core/Upload/Popup.js @@ -14,6 +14,7 @@ import { useHover } from "~/common/hooks";
import DataMeter from "~/components/core/DataMeter";
import BlobObjectPreview from "~/components/core/BlobObjectPreview";
+import { clamp } from "lodash";
/* -------------------------------------------------------------------------------------------------
* Popup
* -----------------------------------------------------------------------------------------------*/
@@ -237,7 +238,7 @@ const STYLES_RESET_BORDER_TOP = css`
function Header({ totalFilesSummary, popupState, expandUploadSummary, collapseUploadSummary }) {
const [{ isFinished, totalBytesUploaded, totalBytes }, { retryAll }] = useUploadContext();
- const uploadProgress = Math.floor((totalBytesUploaded / totalBytes) * 100);
+ const uploadProgress = clamp(Math.floor((totalBytesUploaded / totalBytes) * 100), 0, 100);
if (isFinished && totalFilesSummary.failed > 0) {
return (
| 3 |
diff --git a/articles/tutorials/generic-oauth2-connection-examples.md b/articles/tutorials/generic-oauth2-connection-examples.md @@ -178,20 +178,24 @@ After the call completes successfully, you will be able to login using these new
* [Create an application](https://developer.vimeo.com/apps/new)
* Copy `Client Identifier` and `Client Secrets` to config file below
-```
+```har
{
- "name": "vimeo",
- "strategy": "oauth2",
- "options": {
- "client_id": "YOUR-VIMEO-CLIENT-IDENTIFIER",
- "client_secret": "YOUR-VIMEO-CLIENT-SECRET",
- "authorizationURL": "https://api.vimeo.com/oauth/authorize",
- "tokenURL": "https://api.vimeo.com/oauth/access_token",
- "scope": ["public"],
- "scripts": {
- "fetchUserProfile": "function(accessToken, ctx, cb) { request.get('https://api.vimeo.com/me', { headers: { 'Authorization': 'Bearer ' + accessToken } }, function(e, r, b) { if (e) return cb(e); if (r.statusCode !== 200 ) return cb(new Error('StatusCode: ' + r.statusCode)); var profile = JSON.parse(b); profile.user_id = profile.uri; cb(null, profile); });}"
- }
- }
+ "method": "POST",
+ "url": "https://YOURACCOUNT.auth0.com/api/v2/connections",
+ "httpVersion": "HTTP/1.1",
+ "cookies": [],
+ "headers": [{
+ "name": "Authorization",
+ "value": "Bearer ABCD"
+ }],
+ "queryString": [],
+ "postData": {
+ "mimeType": "application/json",
+ "text": "{ \"name\": \"vimeo\", \"strategy\": \"oauth2\", \"options\": { \"client_id\", \"YOUR_VIMEO_CLIENT_ID\", \"client_secret\": \"YOUR_VIMEO_CLIENT_SECRET\", \"authorizationURL\": \"https://api.vimeo.com/oauth/authorize\", \"tokenURL\": \"https://api.vimeo.com/oauth/access_token\", \"scope\": [\"public\"], \"scripts\": { \"fetchUserProfile\": \"function(accessToken, ctx, cb) { request.get('https://api.vimeo.com/me', { headers: { 'Authorization': 'Bearer ' + accessToken } }, function(e, r, b) { if (e) return cb(e); if (r.statusCode !== 200 ) return cb(new Error('StatusCode: ' + r.statusCode)); var profile = JSON.parse(b); profile.user_id = profile.uri; cb(null, profile); });}"
+ },
+ "headersSize": -1,
+ "bodySize": -1,
+ "comment": ""
}
```
| 0 |
diff --git a/js/coreweb/bisweb_webparser.js b/js/coreweb/bisweb_webparser.js @@ -322,7 +322,6 @@ let parseDescriptionAndCreateGUI = function(frame, buttonFrame,description, numV
let gui = new dat.GUI( { autoPlace: false } );
webutil.removeallchildren(frame);
- console.log('gui width', gui.width, frame);
if (opts.width) { gui.width = opts.width; }
let dict= { };
| 2 |
diff --git a/test/Server.test.js b/test/Server.test.js @@ -45,7 +45,7 @@ describe("Server", function() {
it("GET request to bundle file", function(done) {
request(app).get("/public/bundle.js")
.expect("Content-Type", "application/javascript; charset=UTF-8")
- .expect("Content-Length", "2859")
+ .expect("Content-Length", "2985")
.expect("Access-Control-Allow-Origin", "*")
.expect(200, /console\.log\("Hey\."\)/, done);
});
@@ -120,7 +120,7 @@ describe("Server", function() {
it("GET request to bundle file", function(done) {
request(app).get("/bundle.js")
- .expect("Content-Length", "2859")
+ .expect("Content-Length", "2985")
.expect(200, /console\.log\("Hey\."\)/, done);
});
});
| 1 |
diff --git a/app/components/AirgrabForm/index.js b/app/components/AirgrabForm/index.js @@ -45,6 +45,7 @@ const AirgrabForm = props => {
contract.
</p>
<AirgrabTable handleSubmit={handleSubmit} />
+ <p>Have an Airgrab you want here? Email us: <a href="mailto:[email protected]">[email protected]</a></p>
</CardBody>
</Card>
</GridItem>
| 0 |
diff --git a/Apps/Sandcastle/gallery/CZML Model - Node Transformations.html b/Apps/Sandcastle/gallery/CZML Model - Node Transformations.html @@ -57,7 +57,7 @@ var czml = [{
"Skeleton_arm_joint_R__2_": {
"rotation": {
"unitQuaternion": [
- 0.31933321618140015, 0.5055578277509731, -0.5903490075872426, 0.5421490838170975
+ -0.2840422631464792, -0.40211904424847345, 0.25175867757399086, 0.7063888981321548
]
}
}
| 3 |
diff --git a/bin/data-migrations/v6/migration.js b/bin/data-migrations/v6/migration.js @@ -58,19 +58,19 @@ var migrationType = process.env.MIGRATION_TYPE;
var oldFormatProcessors;
switch (migrationType) {
- case 'drawio':
+ case 'v6-drawio':
oldFormatProcessors = [drawioProcessor];
break;
- case 'plantuml':
+ case 'v6-plantuml':
oldFormatProcessors = [plantumlProcessor];
break;
- case 'tsv':
+ case 'v6-tsv':
oldFormatProcessors = [tsvProcessor];
break;
- case 'csv':
+ case 'v6-csv':
oldFormatProcessors = [csvProcessor];
break;
- case 'bracketlink':
+ case 'v6-bracketlink':
oldFormatProcessors = [bracketlinkProcessor];
break;
case 'v6':
| 10 |
diff --git a/src/components/MTableGroupbar/index.js b/src/components/MTableGroupbar/index.js @@ -32,7 +32,7 @@ function MTableGroupbar(props) {
background: '#0000000a',
display: 'flex',
width: '100%',
- padding: 8,
+ padding: 1,
overflow: 'auto',
border: '1px solid #ccc',
borderStyle: 'dashed'
@@ -83,7 +83,7 @@ function MTableGroupbar(props) {
return (
<Toolbar
className={props.className}
- sx={{ padding: 0, minHeight: 'unset' }}
+ disableGutters={true}
ref={props.forwardedRef}
>
<Droppable
| 7 |
diff --git a/content/questions/Array-Method-findIndex/index.md b/content/questions/Array-Method-findIndex/index.md @@ -9,7 +9,9 @@ answers:
- 'False // correct'
---
-When using array.findIndex it will return 0 indicating that no element passed the test.
+True or False: when using `array.findIndex` it will return 0 indicating that no element passed the test.
<!-- explanation -->
-findIndex will actually return a -1. This array method executes a callback function for each index until a truthy value is returned. If the array length is 0 or if the callback never returns a truthy value then findIndex will return -1.
+`findIndex` will actually return a `-1` since `0` would be a legitimate array index!
+
+Under the hood, this array method executes a callback function for each index until a truthy value is returned. If the array length is 0 or if the callback never returns a truthy value then findIndex will return -1.
| 0 |
diff --git a/ui/src/dialogs/CollectionAccessDialog/CollectionAccessDialog.jsx b/ui/src/dialogs/CollectionAccessDialog/CollectionAccessDialog.jsx @@ -157,6 +157,7 @@ class CollectionAccessDialog extends Component {
isOpen={this.props.isOpen}
onClose={this.props.toggleDialog}
title={intl.formatMessage(messages.title)}
+ enforceFocus={false}
>
<div className="bp3-dialog-body">
<div className="CollectionPermissions">
| 12 |
diff --git a/src/backends/backend.js b/src/backends/backend.js @@ -26,7 +26,24 @@ class LocalStorageAuthStore {
const slugFormatter = (template = "{{slug}}", entryData) => {
const date = new Date();
- const identifier = entryData.get("title", entryData.get("path"));
+
+ const getIdentifier = (entryData) => {
+ const validIdentifierFields = ["title", "path"];
+ const identifiers = validIdentifierFields.map((field) => {
+ return entryData.find((_, key) => {
+ return key.toLowerCase() === field;
+ });
+ });
+
+ const identifier = identifiers.find(i => typeof i !== 'undefined');
+
+ if (typeof identifier === 'undefined') {
+ throw new Error("Collection must have a field name that is a valid entry identifier");
+ } else {
+ return identifier;
+ }
+ };
+
return template.replace(/\{\{([^\}]+)\}\}/g, (_, field) => {
switch (field) {
case "year":
@@ -36,7 +53,7 @@ const slugFormatter = (template = "{{slug}}", entryData) => {
case "day":
return (`0${ date.getDate() }`).slice(-2);
case "slug":
- return slug(identifier.trim(), {lower: true});
+ return slug(getIdentifier(entryData).trim(), {lower: true});
default:
return slug(entryData.get(field, "").trim(), {lower: true});
}
| 2 |
diff --git a/.circleci/config.yml b/.circleci/config.yml version: 2
jobs:
- build:
+ build_backend:
working_directory: ~/kamu
docker:
- image: python:3.6.0
@@ -21,26 +21,30 @@ jobs:
command: |
. venv/bin/activate
DISABLE_SAML2=true python manage.py test
- # nodejs-workflow:
- # jobs:
- # build:
- # working_directory: ~/kamu
- # docker:
- # - image: circleci/node:7
- # steps:
- # - checkout
- # - run:
- # name: update-yarn
- # command: 'sudo npm install -g yarn@latest'
- # - restore_cache:
- # key: dependency-cache-{{ checksum "package.json" }}
- # - run:
- # name: install-nodejs-dependencies
- # command: yarn install
- # - save_cache:
- # key: dependency-cache-{{ checksum "package.json" }}
- # paths:
- # - ./node_modules
+ build_frontend:
+ working_directory: ~/kamu
+ docker:
+ - image: circleci/node:7
+ steps:
+ - checkout
+ - run:
+ command: 'sudo npm install -g yarn@latest'
+ - restore_cache:
+ key: dependency-cache-{{ checksum "package.json" }}
+ - run:
+ command: yarn install
+ - save_cache:
+ key: dependency-cache-{{ checksum "package.json" }}
+ paths:
+ - ./node_modules
+ - run:
+ command: yarn test
+workflows:
+ version: 2
+ build_and_test:
+ jobs:
+ - build_backend
+ - build_frontend
notify:
webhooks:
- url: https://webhooks.gitter.im/e/032e112573c8a1eafc93
| 0 |
diff --git a/assets/js/components/PostSearcher.js b/assets/js/components/PostSearcher.js @@ -51,12 +51,10 @@ function PostSearcher() {
const {
ID: id,
permalink: permaLink,
- post_title: pageTitle,
} = match;
args.id = id;
args.permaLink = permaLink;
- args.pageTitle = pageTitle;
}
return select( CORE_SITE ).getAdminURL( 'googlesitekit-dashboard', args );
| 2 |
diff --git a/angular/projects/spark-angular/src/lib/components/sprk-card/sprk-card.component.ts b/angular/projects/spark-angular/src/lib/components/sprk-card/sprk-card.component.ts @@ -195,7 +195,8 @@ export class SprkCardComponent {
@Input()
imgHref: string;
/**
- * Determines what icon `sprk-icon` renders next to the Call to Action.
+ * Determines what icon `sprk-icon` renders
+ * next to the call-to-action link.
*/
@Input()
ctaIcon: string;
| 3 |
diff --git a/.travis.yml b/.travis.yml @@ -51,7 +51,6 @@ before_install:
before_script:
- npm install || exit 1
- - composer global require humbug/php-scoper
- composer install
- |
if [[ "$PHP" == "1" ]] || [[ "$JS" == "1" ]] || [[ "$SNIFF" == "1" ]]; then
| 2 |
diff --git a/articles/quickstart/spa/_includes/_getting_started.md b/articles/quickstart/spa/_includes/_getting_started.md @@ -14,10 +14,6 @@ If you are following along with the sample project you downloaded from the top o
<%= include('../../../_includes/_logout_url') %>
<% } %>
-::: note
-If you are following along with the sample project you downloaded from the top of this page, you should set the **Allowed Logout URL** to `${callback}`.
-:::
-
<% if (typeof showWebOriginInfo !== 'undefined' && showWebOriginInfo === true) { %>
<%= include('../../../_includes/_web_origins') %>
<% } %>
| 2 |
diff --git a/token-metadata/0x6D6506E6F438edE269877a0A720026559110B7d5/metadata.json b/token-metadata/0x6D6506E6F438edE269877a0A720026559110B7d5/metadata.json "symbol": "BONK",
"address": "0x6D6506E6F438edE269877a0A720026559110B7d5",
"decimals": 18,
- "dharmaVerificationStatus": {
"dharmaVerificationStatus": "VERIFIED"
}
\ No newline at end of file
-}
\ No newline at end of file
| 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.