code
stringlengths
122
4.99k
label
int64
0
14
diff --git a/connectors/amazon-alexa.js b/connectors/amazon-alexa.js @@ -36,10 +36,10 @@ Connector.isPlaying = () => { return false; } - return $('#d-primary-control .play').size() === 0; + return $('#d-primary-control .play').length === 0; }; function isPlayingLiveRadio() { - return $('#d-secondary-control-left .disabled').size() === 1 && - $('#d-secondary-control-right .disabled').size() === 1; + return $('#d-secondary-control-left .disabled').length === 1 && + $('#d-secondary-control-right .disabled').length === 1; }
14
diff --git a/Makefile b/Makefile @@ -59,7 +59,7 @@ nyc-includes: NYC_INCLUDES='lib/**' .PHONY: coverage -coverage: nyc-includes test-sources +coverage: nyc-includes @./node_modules/.bin/nyc --include $(NYC_INCLUDES) --reporter=lcov --reporter=text --all -- mocha --config $(MOCHA_CONFIG) $(TEST_SOURCES) @echo google-chrome coverage/lcov-report/index.html
2
diff --git a/.circleci/config.yml b/.circleci/config.yml @@ -255,7 +255,7 @@ jobs: - attach_workspace: at: ~/ - run: - name: Test plot-schema.json diff + name: Test plot-schema.json diff - If failed, after (npm start) you could run (npm run schema && git add test/plot-schema.json && git commit -m "update plot-schema diff") command: diff --unified --color dist/plot-schema.json test/plot-schema.json - run: name: Test plotly.min.js import using requirejs
0
diff --git a/test/www/jxcore/bv_tests/testThaliMobileNativeiOS.js b/test/www/jxcore/bv_tests/testThaliMobileNativeiOS.js @@ -145,7 +145,6 @@ test('multiConnect properly fails on legal but non-existent peerID', test('cannot call multiConnect with invalid syncValue', function (t) { - var connectReturned = false; var invalidSyncValue = /I am not a string/; Mobile('startListeningForAdvertisements').callNative(function (err) { t.notOk(err, 'No error on starting'); @@ -157,21 +156,13 @@ test('cannot call multiConnect with invalid syncValue', }); }); }); -//TODO - fix failing test. The disconnect method should not throw badParameters exception -test('disconnect doesn\'t fail on bad peer id', function () { return true }, function (t) { - Mobile('disconnect').callNative('foo', function(err) { - t.notOk(err, 'No error'); - // Giving failure callback a chance to mess things up - setImmediate(function () { + +test('cannot call disconnect with invalid peer id', function (t) { + Mobile('disconnect').callNative('foo', function (error) { + t.equal(error, 'Bad parameters', 'Got right error'); t.end(); }); }); - thaliMobileNativeTestUtils.multiConnectEmitter - .on('multiConnectConnectionFailure', function (peerIdentifier, error) { - t.fail('We shouldn\'t get a failure callback - peerID: ' + - peerIdentifier + ', error: ' + error); - }); -}); test('disconnect doesn\'t fail on plausible but bogus peer ID', function (t) { var peerId = nodeUuid.v4();
3
diff --git a/src/kiri-mode/cam/client.js b/src/kiri-mode/cam/client.js @@ -81,11 +81,6 @@ CAM.init = function(kiri, api) { UI.func.animate.style.display = isCamMode ? '' : 'none'; if (!isCamMode) { func.clearPops(); - UI.label.slice.innerText = LANG.slice; - UI.label.preview.innerText = LANG.preview; - UI.label.export.innerText = LANG.export; - } else { - UI.label.slice.innerText = LANG.start; } $('camops').style.display = isCamMode && isArrange ? 'flex' : ''; // do not persist traces across page reloads
2
diff --git a/devices/yale.js b/devices/yale.js @@ -85,7 +85,7 @@ module.exports = [ }, { zigbeeModel: ['iZBModule01', '0700000001'], - model: 'YMF40/YDM4109+', + model: 'YMF40/YDM4109+/YDF40', vendor: 'Yale', description: 'Real living lock / Intelligent biometric digital lock', // Increased timeout needed: https://github.com/Koenkk/zigbee2mqtt/issues/3290 for YDM4109+
10
diff --git a/assets/js/components/setup/CompatibilityChecks/index.js b/assets/js/components/setup/CompatibilityChecks/index.js @@ -68,7 +68,7 @@ export default function CompatibilityChecks( { children, ...props } ) { { __( 'Your site may not be ready for Site Kit', 'google-site-kit' ) } </div> </div> - { error && <CompatibilityErrorNotice error={ error } /> } + <CompatibilityErrorNotice error={ error } /> </div> ); }
2
diff --git a/server/game/chatcommands.js b/server/game/chatcommands.js @@ -34,7 +34,6 @@ class ChatCommands { '/stop-clocks': this.stopClocks, '/start-clocks': this.startClocks, '/modify-clock': this.modifyClock, - '/chess-clocks': this.chessClocks, '/disconnectme': this.disconnectMe, '/manual': this.manual }; @@ -67,23 +66,6 @@ class ChatCommands { player.clock.modify(num); } - chessClocks(player, args) { - let num = this.getNumberOrDefault(args[1], 30); - if(player.chessClockLeft > 0) { - this.game.addMessage('{0} switches off chess clocks for both players', player); - player.chessClockLeft = 0; - if(player.opponent) { - player.opponent.chessClockLeft = 0; - } - } else { - this.game.addMessage('{0} switches on chess clocks for both players set at {1} minutes', player, num); - player.chessClockLeft = 60 * num; - if(player.opponent) { - player.opponent.chessClockLeft = 60 * num; - } - } - } - draw(player, args) { var num = this.getNumberOrDefault(args[1], 1);
2
diff --git a/tools/protocols/src/Delegate.ts b/tools/protocols/src/Delegate.ts */ import { ethers } from 'ethers' +import { bigNumberify } from 'ethers/utils' import { chainIds, chainNames, MIN_CONFIRMATIONS } from '@airswap/constants' import { Quote, SignedOrder } from '@airswap/types' import { ERC20 } from './ERC20' @@ -49,41 +50,16 @@ export class Delegate { } async getMaxQuote(signerToken: string, senderToken: string): Promise<Quote> { - const { signerAmount, senderAmount } = await this.contract.getMaxQuote( - signerToken, - senderToken + const { senderAmount, signerAmount } = await this.contract.getMaxQuote( + senderToken, + signerToken ) - const balance = await new ERC20(senderToken, this.chainId).balanceOf( - this.address + return this.getQuotedOrMaxAvailable( + senderToken, + senderAmount, + signerToken, + signerAmount ) - - if (balance.lt(senderAmount)) { - return { - signer: { - token: signerToken, - amount: senderAmount - .div(signerAmount) - .mul(balance) - .floor() - .toString(), - }, - sender: { - token: senderToken, - amount: balance.toString(), - }, - } - } - - return { - signer: { - token: signerToken, - amount: signerAmount.toString(), - }, - sender: { - token: senderToken, - amount: senderAmount.toString(), - }, - } } async getSignerSideQuote( @@ -97,18 +73,37 @@ export class Delegate { signerToken ) if (signerAmount.isZero()) { - throw new Error('Not quoting for the requested pair') + throw new Error('Not quoting for requested amount or token pair') } - return { - signer: { - token: signerToken, - amount: signerAmount.toString(), - }, - sender: { - token: senderToken, - amount: senderAmount, - }, + + return this.getQuotedOrMaxAvailable( + senderToken, + senderAmount, + signerToken, + signerAmount + ) } + + async getSenderSideQuote( + signerAmount: string, + signerToken: string, + senderToken: string + ): Promise<Quote> { + const senderAmount = await this.contract.getSenderSideQuote( + signerAmount, + signerToken, + senderToken + ) + if (senderAmount.isZero()) { + throw new Error('Not quoting for requested amount or token pair') + } + + return this.getQuotedOrMaxAvailable( + senderToken, + senderAmount, + signerToken, + signerAmount + ) } async provideOrder( @@ -127,4 +122,33 @@ export class Delegate { await tx.wait(MIN_CONFIRMATIONS) return tx.hash } + + async getQuotedOrMaxAvailable( + senderToken, + senderAmount, + signerToken, + signerAmount + ) { + const balance = await new ERC20(senderToken, this.chainId).balanceOf( + this.address + ) + let finalSenderAmount = bigNumberify(senderAmount) + let finalSignerAmount = bigNumberify(signerAmount) + if (balance.lt(senderAmount)) { + finalSenderAmount = balance + finalSignerAmount = bigNumberify(senderAmount) + .div(signerAmount) + .mul(balance) + } + return { + signer: { + token: signerToken, + amount: finalSignerAmount.toString(), + }, + sender: { + token: senderToken, + amount: finalSenderAmount.toString(), + }, + } + } }
3
diff --git a/packages/app/src/components/PageEditor/CodeMirrorEditor.jsx b/packages/app/src/components/PageEditor/CodeMirrorEditor.jsx @@ -154,7 +154,7 @@ export default class CodeMirrorEditor extends AbstractEditor { this.foldDrawioSection = this.foldDrawioSection.bind(this); this.onSaveForDrawio = this.onSaveForDrawio.bind(this); - this.emojiPickerHandler = this.emojiPickerHandler.bind(this); + this.checkWhetherEmojiPickerShouldBeShown = this.checkWhetherEmojiPickerShouldBeShown.bind(this); } @@ -571,7 +571,7 @@ export default class CodeMirrorEditor extends AbstractEditor { keyUpHandler(editor, event) { if (event.key !== 'Backspace') { - this.emojiPickerHandler(); + this.checkWhetherEmojiPickerShouldBeShown(); } } @@ -600,10 +600,10 @@ export default class CodeMirrorEditor extends AbstractEditor { * Show emoji picker component when emoji pattern (`:` + searchWord ) found * eg `:a`, `:ap` */ - emojiPickerHandler() { + checkWhetherEmojiPickerShouldBeShown() { const searchWord = this.emojiPickerHelper.getEmoji(); - if (searchWord != null) { + if (searchWord == null) { this.setState({ isEmojiPickerShown: false }); this.setState({ emojiSearchText: null }); }
10
diff --git a/userscript.user.js b/userscript.user.js @@ -48737,6 +48737,15 @@ var $$IMU_EXPORT$$; return newsrc; } + if (domain_nowww === "vk.com") { + // https://vk.com/images/icons/video_play_small.png?1 + if (/^[a-z]+:\/\/[^/]+\/+images\/+icons\/+/.test(src)) + return { + url: src, + bad: "mask" + }; + } + if (domain_nosub === "userapi.com" && host_domain_nosub === "vk.com" && options.element && options.do_request && options.cb) {
8
diff --git a/scripts/deployment.js b/scripts/deployment.js -var TestToken = artifacts.require("./TestToken.sol"); -var Reserve = artifacts.require("./KyberReserve.sol"); -var Network = artifacts.require("./KyberNetwork.sol"); -var ConversionRates = artifacts.require("./ConversionRates.sol"); -var Bank = artifacts.require("./MockCentralBank.sol"); -var Whitelist = artifacts.require("./WhiteList.sol"); -var FeeBurner = artifacts.require("./FeeBurner.sol"); -var ExpectedRate = artifacts.require("./ExpectedRate.sol"); -var Wrapper = artifacts.require("./Wrapper.sol"); -var CentralizedExchange = artifacts.require("./MockExchange.sol"); -var BigNumber = require('bignumber.js'); +const TestToken = artifacts.require("./TestToken.sol"); +const Reserve = artifacts.require("./KyberReserve.sol"); +const Network = artifacts.require("./KyberNetwork.sol"); +const NetworkProxy = artifacts.require("./KyberNetworkProxy.sol"); +const ConversionRates = artifacts.require("./ConversionRates.sol"); +const Bank = artifacts.require("./MockCentralBank.sol"); +const Whitelist = artifacts.require("./WhiteList.sol"); +const FeeBurner = artifacts.require("./FeeBurner.sol"); +const ExpectedRate = artifacts.require("./ExpectedRate.sol"); +const Wrapper = artifacts.require("./Wrapper.sol"); +const CentralizedExchange = artifacts.require("./MockExchange.sol"); +const BigNumber = require('bignumber.js'); var tokenSymbol = [];//["OMG", "DGD", "CVC", "FUN", "MCO", "GNT", "ADX", "PAY", //"BAT", "KNC", "EOS", "LINK"]; @@ -41,6 +42,9 @@ const maxGas = 4612388; var tokenOwner; +var networkProxy; +var networkProxyOwner; + var network; var networkOwner; @@ -429,13 +433,8 @@ var listTokens = function( owner, reserve, network, expBlock, rate, convRate ) { }).then(function(){ return network.listPairForReserve(reserve.address, tokenAddress, - ethAddress, true, - {from:networkOwner}); - }).then(function(){ - return network.listPairForReserve(reserve.address, - ethAddress, - tokenAddress, + true, true, {from:networkOwner}); }); @@ -552,6 +551,14 @@ contract('Deployment', function(accounts) { }); }); + it("create network proxy", function() { + this.timeout(31000000); + networkProxyOwner = accounts[0]; + return NetworkProxy.new(networkProxyOwner,{gas:maxGas}).then(function(instance){ + networkProxy = instance; + }); + }); + it("create conversionRates", function() { this.timeout(31000000); return ConversionRates.new(accounts[0],{gas:maxGas}).then(function(instance){ @@ -653,10 +660,25 @@ contract('Deployment', function(accounts) { }); }); + it("set network proxy params", function() { + this.timeout(31000000); + // set contracts and enable network + return networkProxy.setKyberNetworkContract(network.address); + }); + it("set network params", function() { this.timeout(31000000); // set contracts and enable network - return network.setParams(whitelist.address,expectedRate.address,feeBurner.address,50*10**9,15).then( function() { + + return network.setWhiteList(whitelist.address).then(function(){ + return network.setExpectedRate(expectedRate.address); + }).then(function(){ + return network.setFeeBurner(feeBurner.address); + }).then(function(){ + return network.setKyberProxy(networkProxy.address); + }).then(function(){ + return network.setParams(50*10**9, 15); //50 gwei, 15 negligible diff + }).then( function() { return network.setEnable(true); }); }); @@ -774,7 +796,7 @@ it("set eth to dgd rate", function() { var expectedDgd = (ethAmount * rate / 10**18) / (10**18 / 10**tokenDecimals[1]); var destAddress = "0x001adbc838ede392b5b054a47f8b8c28f2fa9f3c"; - return network.trade(ethAddress, + return networkProxy.trade(ethAddress, ethAmount, dgdAddress, destAddress, @@ -806,8 +828,8 @@ it("set eth to dgd rate", function() { var rate = conversionRate; var destAddress = "0x001adbc838ede392b5b054a47f8b8c28f2fa9f3c"; - return tokenInstance[1].approve(network.address,dgdAmount).then(function(){ - return network.trade(dgdAddress, + return tokenInstance[1].approve(networkProxy.address,dgdAmount).then(function(){ + return networkProxy.trade(dgdAddress, dgdAmount, ethAddress, destAddress, @@ -859,7 +881,8 @@ it("set eth to dgd rate", function() { dict["bank"] = bank.address; dict["reserve"] = reserve.address; dict["pricing"] = conversionRates.address; - dict["network"] = network.address; + dict["network"] = networkProxy.address; + dict["internal network"] = network.address; dict["wrapper"] = wrapper.address; dict["feeburner"] = feeBurner.address; dict["KGT address"] = kgtInstance.address;
6
diff --git a/DEPS b/DEPS @@ -1585,6 +1585,11 @@ deps = { 'src/tools/swarming_client': Var('chromium_git') + '/infra/luci/client-py.git' + '@' + Var('swarming_revision'), + 'src/v8': + Var('nwjs_git') + '/v8.git' + '@' + Var('nw_v8_revision'), + + 'src/third_party/node-nw': + Var('nwjs_git') + '/node.git' + '@' + Var('nw_node_revision'), #'src/v8': # Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'),
1
diff --git a/packages/frontend/src/components/send/components/views/SelectToken.js b/packages/frontend/src/components/send/components/views/SelectToken.js @@ -2,6 +2,7 @@ import throttle from 'lodash.throttle'; import React, { useCallback, useEffect, useState } from 'react'; import { Translate } from 'react-localize-redux'; import styled from 'styled-components'; +import getCurrentLanguage from '../../../../hooks/getCurrentLanguage'; import BackArrowButton from '../../../common/BackArrowButton'; import Tokens from '../../../wallet/Tokens'; @@ -48,6 +49,7 @@ function filterTokens(tokens, searchSubstring) { const SelectToken = ({ onClickGoBack, fungibleTokens, onSelectToken, isMobile }) => { const [searchValue, setSearchValue] = useState(''); const [filteredFungibleTokens, setFilteredFungibleTokens] = useState(() => filterTokens(fungibleTokens)); + const currentLanguage = getCurrentLanguage(); const throttledSetFilteredTokens = useCallback(throttle( (tokens, searchSubstring) => { @@ -82,7 +84,7 @@ const SelectToken = ({ onClickGoBack, fungibleTokens, onSelectToken, isMobile }) <span><Translate id='sendV2.selectAsset.assetListNameTitle'/></span> <span><Translate id='sendV2.selectAsset.asssetListBalanceTitle'/></span> </div> - <Tokens tokens={filteredFungibleTokens} onClick={onSelectToken}/> + <Tokens tokens={filteredFungibleTokens} onClick={onSelectToken} currentLanguage={currentLanguage}/> </StyledContainer> ); };
1
diff --git a/templates/customdashboard/program_list.html b/templates/customdashboard/program_list.html {% for item in get_program %} {% if item.name %} <tr> <td> - <a href="/workflow/level1/edit/{{item.id}}/">{{ item.name }}</a></td> + <a href="/workflow/level1/edit/{{ item.id }}/">{{ item.name }}</a> + </td> <td> {% if item.public_dashboard %}<a href="/customdashboard/program_dashboard/{{ item.id }}/1/" class="progress-bar progress-bar-warning" style="width: {{ item.indicator_data_percent }}%" > - <font color="black" - >Data {{ item.indicator_data_percent }} %</font + <span color="black" + >Data {{ item.indicator_data_percent }} %</span > </div> <div class="progress-bar progress-bar-success" style="width: {{ item.indicator_percent }}%" > - <font color="black">No Data {{ item.indicator_percent }} %</font> + <span color="black">No Data {{ item.indicator_percent }} %</span> </div> </div> <strong class="progress-bar progress-bar-warning" style="width: {{ item.project_percent }}%" > - <font color="black">Tracking {{ item.project_percent }} %</font> + <span color="black">Tracking {{ item.project_percent }} %</span> </div> <div class="progress-bar progress-bar-info" style="width: {{ item.project_agreement_percent }}%" > - <font color="black" - >Initiation {{ item.project_agreement_percent }} %</font + <span color="black" + >Initiation {{ item.project_agreement_percent }} %</span > </div> </div> <td>{{ item.create_date }}</td> <td class="text-right"> - <a class="btn btn-default btn-sm" href="/customdashboard/program_dashboard/{{ item.id }}/0/" + <a + class="btn btn-default btn-sm" + href="/customdashboard/program_dashboard/{{ item.id }}/0/" >Internal</a > </td>
7
diff --git a/lib/modules/ens/index.js b/lib/modules/ens/index.js @@ -286,7 +286,6 @@ class ENS { if (this.registration && this.registration.rootDomain) { // Register root domain if it is defined - if (this.isDev || this.env === 'privatenet' || this.env === 'development') { const rootNode = namehash.hash(this.registration.rootDomain); config.default.contracts['FIFSRegistrar'] = { "deploy": true, @@ -303,7 +302,6 @@ class ENS { ] }; } - } config.privatenet = config.development; this.embark.registerContractConfiguration(config);
13
diff --git a/core/ui/block_space/flyout.js b/core/ui/block_space/flyout.js @@ -833,6 +833,21 @@ Blockly.Flyout.prototype.createBlockFunc_ = function(originBlock) { var xyNew = Blockly.getSvgXY_(svgRootNew, block.blockSpace.blockSpaceEditor.svg_); block.moveBy(xyOld.x - xyNew.x, xyOld.y - xyNew.y); + + if (block.blockToShadow_) { + let src = ""; + if (originBlock.inputList[0] && originBlock.inputList[0].titleRow[1]) { + src = originBlock.inputList[0].titleRow[1].src_; + } + if (src != "") { + block.inputList[0].titleRow[1].setText(originBlock.inputList[0].titleRow[1].src_); + block.inputList[0].titleRow[1].updateDimensions_(block.thumbnailSize, block.thumbnailSize); + } else { + block.inputList[0].titleRow[0].setText(block.longString); + block.inputList[0].titleRow[1].updateDimensions_(1, block.thumbnailSize); + } + } + if (flyout.autoClose) { /** * We need to avoid destroying the currently dragged block
12
diff --git a/articles/libraries/lock-android/v2/keystore.md b/articles/libraries/lock-android/v2/keystore.md section: libraries toc_title: Android Development Keystores and Key Hashes title: Android Development Keystores and Key Hashes -url: /libraries/lock-android/keystore description: Instructions on acquiring development keystores/key hashes during Android app development. ---
2
diff --git a/utils/eventtracking.js b/utils/eventtracking.js -const MIXPANEL_TOKEN = '9aa8926fbcb03eb5d6ce787b5e8fa6eb'; +const MIXPANEL_TOKEN = 'e98aa9d6d259d9d78f20cb05cb54f5cb'; const mixpanel = require('mixpanel').init(MIXPANEL_TOKEN); const uuid = require('uuid');
4
diff --git a/core/type_expr.js b/core/type_expr.js @@ -79,7 +79,7 @@ Blockly.TypeExpr.generateColor = function() { */ Blockly.TypeExpr.prototype.isTypeVar = function() { var t = this.deref(); - return t.label == Blockly.TypeExpr.prototype.TVAR; + return t.label == Blockly.TypeExpr.prototype.TVAR_; } /** @@ -88,7 +88,7 @@ Blockly.TypeExpr.prototype.isTypeVar = function() { * @return {Blockly.TypeExpr} */ Blockly.TypeExpr.INT = function() { - Blockly.TypeExpr.call(this, Blockly.TypeExpr.prototype.INT); + Blockly.TypeExpr.call(this, Blockly.TypeExpr.prototype.INT_); } goog.inherits(Blockly.TypeExpr.INT, Blockly.TypeExpr); @@ -115,7 +115,7 @@ Blockly.TypeExpr.INT.prototype.getTypeName = function() { * @return {Blockly.TypeExpr} */ Blockly.TypeExpr.BOOL = function() { - Blockly.TypeExpr.call(this, Blockly.TypeExpr.prototype.BOOL); + Blockly.TypeExpr.call(this, Blockly.TypeExpr.prototype.BOOL_); } goog.inherits(Blockly.TypeExpr.BOOL, Blockly.TypeExpr); @@ -148,7 +148,7 @@ Blockly.TypeExpr.FUN = function(arg_type, return_type) { this.arg_type = arg_type; /** @type {Blockly.TypeExpr} */ this.return_type = return_type; - Blockly.TypeExpr.call(this, Blockly.TypeExpr.prototype.FUN); + Blockly.TypeExpr.call(this, Blockly.TypeExpr.prototype.FUN_); } goog.inherits(Blockly.TypeExpr.FUN, Blockly.TypeExpr); @@ -187,7 +187,7 @@ Blockly.TypeExpr.TVAR = function(name, val, opt_color) { this.type = type; /** @type {string} */ this.color = opt_color ? opt_color : Blockly.TypeExpr.generateColor(); - Blockly.TypeExpr.call(this, Blockly.TypeExpr.prototype.TVAR); + Blockly.TypeExpr.call(this, Blockly.TypeExpr.prototype.TVAR_); } goog.inherits(Blockly.TypeExpr.TVAR, Blockly.TypeExpr); @@ -198,7 +198,7 @@ goog.inherits(Blockly.TypeExpr.TVAR, Blockly.TypeExpr); */ Blockly.TypeExpr.TVAR.prototype.toString = function(opt_deref) { var inst = opt_deref ? this.deref() : this; - if (inst.label == Blockly.TypeExpr.prototype.TVAR) { + if (inst.label == Blockly.TypeExpr.prototype.TVAR_) { var val_str = inst.val ? inst.val.toString(opt_deref) : "null"; return "<" + inst.name + "=" + val_str + ">"; } else { @@ -219,7 +219,7 @@ Blockly.TypeExpr.TVAR.prototype.getTypeName = function() { */ Blockly.TypeExpr.prototype.deref = function() { var t = this; - while (t.label == Blockly.TypeExpr.prototype.TVAR && t.val != null) + while (t.label == Blockly.TypeExpr.prototype.TVAR_ && t.val != null) t = t.val; return t; } @@ -267,12 +267,12 @@ Blockly.TypeExpr.prototype.unify = function(other) { var pair = staq.pop(); var t1 = pair[0]; var t2 = pair[1]; - if (t1.label == Blockly.TypeExpr.prototype.TVAR || - t2.label == Blockly.TypeExpr.prototype.TVAR) { + if (t1.label == Blockly.TypeExpr.prototype.TVAR_ || + t2.label == Blockly.TypeExpr.prototype.TVAR_) { var tvar, othr; - tvar = t1.label == Blockly.TypeExpr.prototype.TVAR ? t1 : t2; - othr = t1.label == Blockly.TypeExpr.prototype.TVAR ? t2 : t1; - if (othr.label == Blockly.TypeExpr.prototype.TVAR && + tvar = t1.label == Blockly.TypeExpr.prototype.TVAR_ ? t1 : t2; + othr = t1.label == Blockly.TypeExpr.prototype.TVAR_ ? t2 : t1; + if (othr.label == Blockly.TypeExpr.prototype.TVAR_ && tvar.name == othr.name) continue; if (tvar.val != null) { @@ -283,7 +283,7 @@ Blockly.TypeExpr.prototype.unify = function(other) { } } else { goog.assert(t1.label == t2.label, 'Unify error: Cannot unify'); - if (t1.label == Blockly.TypeExpr.prototype.FUN) { + if (t1.label == Blockly.TypeExpr.prototype.FUN_) { staq.push([t1.arg_type, t2.arg_type]); staq.push([t1.return_type, t2.return_type]); } @@ -300,14 +300,14 @@ Blockly.TypeExpr.prototype.occur = function(name) { while (staq.length != 0) { var t = staq.pop(); switch (t.label) { - case Blockly.TypeExpr.prototype.INT: - case Blockly.TypeExpr.prototype.BOOL: + case Blockly.TypeExpr.prototype.INT_: + case Blockly.TypeExpr.prototype.BOOL_: break; - case Blockly.TypeExpr.prototype.FUN: + case Blockly.TypeExpr.prototype.FUN_: staq.push(t.arg_type); staq.push(t.return_type); break; - case Blockly.TypeExpr.prototype.TVAR: + case Blockly.TypeExpr.prototype.TVAR_: if (t.name == name) return true; if (t.val)
1
diff --git a/packages/react-dev-utils/getProcessForPort.js b/packages/react-dev-utils/getProcessForPort.js @@ -43,7 +43,7 @@ function getProcessCommand(processId, processDirectory) { } function getDirectoryOfProcessById(processId) { - return execSync('lsof -p '+ processId + ' | grep cwd | awk \'{print $9}\'', execOptions).trim(); + return execSync('lsof -p '+ processId + ' | awk \'$4=="cwd" {print $9}\'', execOptions).trim(); } function getProcessForPort(port) {
7
diff --git a/src/components/tabbedPosts/view/tabContent.tsx b/src/components/tabbedPosts/view/tabContent.tsx @@ -6,7 +6,7 @@ import {useSelector, useDispatch } from 'react-redux'; import TabEmptyView from './listEmptyView'; import { setInitPosts } from '../../../redux/actions/postsAction'; import { calculateTimeLeftForPostCheck } from '../services/tabbedPostsHelpers'; -import { AppState, ScrollResponderEvent } from 'react-native'; +import { AppState, NativeScrollEvent, NativeSyntheticEvent } from 'react-native'; import { PostsListRef } from '../../postsList/container/postsListContainer'; import ScrollTopPopup from './scrollTopPopup'; import { debounce } from 'lodash'; @@ -19,6 +19,8 @@ const DEFAULT_TAB_META = { } as TabMeta; var scrollOffset = 0; +var blockPopup = false; +const SCROLL_POPUP_THRESHOLD = 5000; const TabContent = ({ filterKey, @@ -249,16 +251,14 @@ const TabContent = ({ setLatestPosts([]); } - const _debouncedScrollTop = (value:boolean) => { - setEnableScrollTop(value); - // debounce(()=>{ - // setEnableScrollTop(value); - // }, 500) - } - const _scrollToTop = () => { postsListRef.current.scrollToTop(); - _debouncedScrollTop(false); + setEnableScrollTop(false); + scrollPopupDebouce.cancel(); + blockPopup = true; + setTimeout(()=>{ + blockPopup = false; + }, 1000) }; @@ -273,18 +273,20 @@ const TabContent = ({ return <TabEmptyView filterKey={filterKey} isNoPost={tabMeta.isNoPost}/> } - const _onScroll = debounce((event:ScrollResponderEvent)=>{ + + const scrollPopupDebouce = debounce((value)=>{ + setEnableScrollTop(value); + }, 500, {leading:true}) + + const _onScroll = (event:NativeSyntheticEvent<NativeScrollEvent>)=>{ var currentOffset = event.nativeEvent.contentOffset.y; var scrollUp = currentOffset < scrollOffset; scrollOffset = currentOffset; - if(!enableScrollTop && scrollUp){ - // _debouncedScrollTop(scrollUp) - setEnableScrollTop(true); - }else{ - setEnableScrollTop(false); + if(scrollUp && !blockPopup && currentOffset > SCROLL_POPUP_THRESHOLD){ + scrollPopupDebouce(true) } - }, 500); + }; return ( @@ -314,7 +316,7 @@ const TabContent = ({ onPress={_onPostsPopupPress} onClose={()=>{ setLatestPosts([]) - _debouncedScrollTop(false); + setEnableScrollTop(false); }} /> </>
7
diff --git a/lib/rest/RequestHandler.js b/lib/rest/RequestHandler.js @@ -38,9 +38,9 @@ class RequestHandler { } routefy(url) { - return url.replace(/\/([a-z-]+)\/(?:[0-9]{17,})+?/g, function(match, p) { - return p === "channels" || p === "guilds" ? match : `/${p}/:id`; - }).replace(/\/reactions\/.+/g, "/reactions/:id"); + var route = url.replace(/\/([a-z-]+)\/(?:[0-9]{17,19})/g, function(match, p) { + return p === "channels" || p === "guilds" || p === "webhooks" ? match : `/${p}/:id`; + }).replace(/\/reactions\/[^/]+/g, "/reactions/:id").replace(/^\/webhooks\/(\d+)\/[A-Za-z0-9-_]{64,}/, "/webhooks/$1/:token"); } /**
7
diff --git a/src/components/accounts/SetupImplicit.js b/src/components/accounts/SetupImplicit.js @@ -278,7 +278,7 @@ class SetupImplicit extends Component { !!balance && <> <p style={{marginTop: 16}}> - Once funded, click "Continue". You will be redirected to a page titled "Restore Account". Click "Continue" again. + Click "Continue". You will be redirected to a page titled "Restore Account". Click "Continue" again. </p> <FormButton onClick={() => this.handleContinue()}
3
diff --git a/src/views/search/search.jsx b/src/views/search/search.jsx @@ -29,6 +29,7 @@ class Search extends React.Component { this.state = this.getSearchState(); this.state.loaded = []; this.state.loadNumber = 16; + this.state.offset = 0; } componentDidMount () { const query = window.location.search; @@ -48,7 +49,7 @@ class Search extends React.Component { } componentDidUpdate (prevProps) { if (this.props.searchTerm !== prevProps.searchTerm) { - this.getSearchMore(); + this.handleGetSearchMore(); } } getSearchState () { @@ -69,12 +70,12 @@ class Search extends React.Component { termText = `&q=${encodeURIComponent(this.props.searchTerm.split(' ').join('+'))}`; } const locale = this.props.intl.locale; - const loadNumber = this.props.loadNumber; + const loadNumber = this.state.loadNumber; const offset = this.state.offset; const queryString = `limit=${loadNumber}&offset=${offset}&language=${locale}&mode=popular${termText}`; api({ - uri: `/search/${this.props.tab}?${queryString}` + uri: `/search/${this.state.tab}?${queryString}` }, (err, body) => { const loadedSoFar = this.state.loaded; Array.prototype.push.apply(loadedSoFar, body);
9
diff --git a/util.js b/util.js @@ -543,8 +543,15 @@ export const unFrustumCull = o => { o.traverse(o => { if (o.isMesh) { o.frustumCulled = false; - // o.castShadow = true; - // o.receiveShadow = true; + } + }); +}; + +export const enableShadows = o => { + o.traverse(o => { + if (o.isMesh) { + o.castShadow = true; + o.receiveShadow = true; } }); };
0
diff --git a/src/shaders/metallic-roughness.frag b/src/shaders/metallic-roughness.frag @@ -101,20 +101,6 @@ struct MaterialInfo vec3 normal; }; -// Lambert lighting -// see https://seblagarde.wordpress.com/2012/01/08/pi-or-not-to-pi-in-game-lighting-equation/ -vec3 diffuse(MaterialInfo materialInfo) -{ - return materialInfo.diffuseColor / M_PI; -} - -// The following equation models the Fresnel reflectance term of the spec equation (aka F()) -// Implementation of fresnel from [4], Equation 15 -vec3 fresnelReflection(vec3 f0, vec3 f90, float VdotH) -{ - return f0 + (f90 - f0) * pow(clamp(1.0 - VdotH, 0.0, 1.0), 5.0); -} - // Calculation of the lighting contribution from an optional Image Based Light source. // Precomputed Environment Maps are required uniform inputs and are computed as outlined in [1]. // See our README.md on Environment Maps [3] for additional discussion. @@ -147,16 +133,28 @@ vec3 getIBLContribution(MaterialInfo materialInfo, vec3 v) return diffuse + specular; } +// Lambert lighting +// see https://seblagarde.wordpress.com/2012/01/08/pi-or-not-to-pi-in-game-lighting-equation/ +vec3 lambertian(vec3 diffuseColor) +{ + return diffuseColor / M_PI; +} + +// The following equation models the Fresnel reflectance term of the spec equation (aka F()) +// Implementation of fresnel from [4], Equation 15 +vec3 fresnelReflection(vec3 f0, vec3 f90, float VdotH) +{ + return f0 + (f90 - f0) * pow(clamp(1.0 - VdotH, 0.0, 1.0), 5.0); +} + // Smith Joint GGX // Note: Vis = G / (4 * NdotL * NdotV) // see Eric Heitz. 2014. Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs. Journal of Computer Graphics Techniques, 3 // see Real-Time Rendering. Page 331 to 336. // see https://google.github.io/filament/Filament.md.html#materialsystem/specularbrdf/geometricshadowing(specularg) -float visibilityOcclusion(MaterialInfo materialInfo, AngularInfo angularInfo) +float visibility(float NdotL, float NdotV, float alphaRoughness) { - float NdotL = angularInfo.NdotL; - float NdotV = angularInfo.NdotV; - float alphaRoughnessSq = materialInfo.alphaRoughness * materialInfo.alphaRoughness; + float alphaRoughnessSq = alphaRoughness * alphaRoughness; float GGXV = NdotL * sqrt(NdotV * NdotV * (1.0 - alphaRoughnessSq) + alphaRoughnessSq); float GGXL = NdotV * sqrt(NdotL * NdotL * (1.0 - alphaRoughnessSq) + alphaRoughnessSq); @@ -172,10 +170,10 @@ float visibilityOcclusion(MaterialInfo materialInfo, AngularInfo angularInfo) // The following equation(s) model the distribution of microfacet normals across the area being drawn (aka D()) // Implementation from "Average Irregularity Representation of a Roughened Surface for Ray Reflection" by T. S. Trowbridge, and K. P. Reitz // Follows the distribution function recommended in the SIGGRAPH 2013 course notes from EPIC Games [1], Equation 3. -float microfacetDistribution(MaterialInfo materialInfo, AngularInfo angularInfo) +float microfacetDistribution(float NdotH, float alphaRoughness) { - float alphaRoughnessSq = materialInfo.alphaRoughness * materialInfo.alphaRoughness; - float f = (angularInfo.NdotH * alphaRoughnessSq - angularInfo.NdotH) * angularInfo.NdotH + 1.0; + float alphaRoughnessSq = alphaRoughness * alphaRoughness; + float f = (NdotH * alphaRoughnessSq - NdotH) * NdotH + 1.0; return alphaRoughnessSq / (M_PI * f * f); } @@ -187,11 +185,11 @@ vec3 getPointShade(vec3 pointToLight, MaterialInfo materialInfo, vec3 view) { // Calculate the shading terms for the microfacet specular shading model vec3 F = fresnelReflection(materialInfo.f0, materialInfo.f90, angularInfo.VdotH); - float Vis = visibilityOcclusion(materialInfo, angularInfo); - float D = microfacetDistribution(materialInfo, angularInfo); + float Vis = visibility(angularInfo.NdotL, angularInfo.NdotV, materialInfo.alphaRoughness); + float D = microfacetDistribution(angularInfo.NdotH, materialInfo.alphaRoughness); // Calculation of analytical lighting contribution - vec3 diffuseContrib = (1.0 - F) * diffuse(materialInfo); + vec3 diffuseContrib = (1.0 - F) * lambertian(materialInfo.diffuseColor); vec3 specContrib = F * Vis * D; // Obtain final intensity as reflectance (BRDF) scaled by the energy of the light (cosine law)
10
diff --git a/apps/setting/settings.js b/apps/setting/settings.js @@ -252,22 +252,28 @@ function showThemeMenu() { } upd(th); } - let rgb = { - black: "#000", white: "#fff", - red: "#f00", green: "#0f0", blue: "#00f", - cyan: "#0ff", magenta: "#f0f", yellow: "#ff0", - }; - if (!BANGLEJS2) Object.assign(rgb, { + let rgb = {}; + rgb[/*LANG*/'black'] = "#000"; + rgb[/*LANG*/'white'] = "#fff"; + rgb[/*LANG*/'red'] = "#f00"; + rgb[/*LANG*/'green'] = "#0f0"; + rgb[/*LANG*/'blue'] = "#00f"; + rgb[/*LANG*/'cyan'] = "#0ff"; + rgb[/*LANG*/'magenta'] = "#f0f"; + rgb[/*LANG*/'yellow'] = "#ff0"; + if (!BANGLEJS2) { // these would cause dithering, which is not great for e.g. text - orange: "#ff7f00", purple: "#7f00ff", grey: "#7f7f7f", - }); + rgb[/*LANG*/'orange'] = "#ff7f00"; + rgb[/*LANG*/'purple'] = "#7f00ff"; + rgb[/*LANG*/'grey'] = "#7f7f7f"; + } let colors = [], names = []; for(const c in rgb) { names.push(c); colors.push(cl(rgb[c])); } let menu = { - '':{title:'Custom Theme'}, + '':{title:/*LANG*/'Custom Theme'}, "< Back": () => showThemeMenu() }; const labels = {
7
diff --git a/core/ui/fields/field_image_dropdown.js b/core/ui/fields/field_image_dropdown.js @@ -93,7 +93,7 @@ Blockly.FieldImageDropdown.prototype.createDropdownPreviewElement_ = function(im Blockly.FieldImageDropdown.prototype.createAutoSizedDropdownPreviewElement_ = function(imagePath, width, height) { var dropdownPreviewElement = document.createElement('div'); dropdownPreviewElement.style.backgroundImage = "url('" + imagePath + "')"; - dropdownPreviewElement.style.backgroundSize = "cover"; + dropdownPreviewElement.style.backgroundSize = "contain"; dropdownPreviewElement.style.backgroundRepeat = "no-repeat"; dropdownPreviewElement.style.backgroundPosition = "50% 50%"; dropdownPreviewElement.style.width = width + 'px';
11
diff --git a/assets/css/maptalks-control.css b/assets/css/maptalks-control.css } .maptalks-layer-switcher ul { - padding-left: 1em; list-style: none; } +.maptalks-layer-switcher .panel > ul { + padding-left: 1em; +} +.maptalks-layer-switcher .group > ul { + padding-left: 10px; +} .maptalks-layer-switcher .group + .group { padding-top: 1em; } .maptalks-layer-switcher label { text-overflow: ellipsis; overflow: hidden; - width : 90%; display: inline-block; font-size : 14px; white-space: nowrap; + color: #bbb; +} +.maptalks-layer-switcher .group > label { + font-weight: bold; + color: #ddd; + width: 100%; +} +.maptalks-layer-switcher .layer label { + padding-top: 5px; + width: 92%; } .maptalks-layer-switcher input { margin: 0 5px; min-width: 120px; max-width: 400px; max-height: 600px; - color: #fff; } .maptalks-layer-switcher li { - overflow:hidden; - margin-right: 1em; white-space:nowrap; } +.maptalks-layer-switcher li.group { + margin-right: 1em; +} .maptalks-layer-switcher.shown .panel { display: block; }
3
diff --git a/package.json b/package.json "file-type": "^10.7.0", "fs-extra": "7.0.0", "git-diff": "2.0.6", - "js-yaml": "^3.12.0", + "ignore": "^5.0.4", + "js-yaml": "^3.12.1", "jsforce": "1.9.1", "json-stable-stringify": "1.0.1", "mustache": "^3.0.0",
8
diff --git a/layouts/partials/helpers/config.html b/layouts/partials/helpers/config.html -{{- if in (slice "meta" "icon" "css" "icon" "link" "js") .type -}} +{{- if in (slice "meta" "icon" "css" "js") .type -}} {{- if .data.html -}} {{- if and (eq .type "meta") (eq .head true) }} {{ print .data.html | safeHTML }}
2
diff --git a/runtime/helpers.js b/runtime/helpers.js @@ -54,11 +54,11 @@ export const leftover = { }, } -export const makeUrlHelper = (ctx, route, routes) => function url(path, params, preserveIndex) { +export const makeUrlHelper = (ctx, route, routes) => function url(path, params, strict) { const { component } = ctx path = path || './' - if (!preserveIndex) path = path.replace(/index$/, '') + if (!strict) path = path.replace(/index$/, '') if (path.match(/^\.\.?\//)) { //RELATIVE PATH
10
diff --git a/src/js/modules/responsive_layout.js b/src/js/modules/responsive_layout.js @@ -54,11 +54,13 @@ ResponsiveLayout.prototype.initialize = function(){ } } + if(this.collapseHandleColumn){ if(this.hiddenColumns.length){ this.collapseHandleColumn.show(); }else{ this.collapseHandleColumn.hide(); } + } }; //define layout information
1
diff --git a/.travis.yml b/.travis.yml @@ -78,7 +78,7 @@ before_install: ln -s /usr/bin/gcc-5 $HOME/bin/gcc; ln -s /usr/bin/g++-5 $HOME/bin/g++; ln -s /usr/bin/gfortran-5 $HOME/bin/gfortran; - elif [[ $(uname) = "Darwin" ]]; then + else echo ''; fi
14
diff --git a/src/ServerlessOffline.js b/src/ServerlessOffline.js @@ -141,9 +141,11 @@ module.exports = class ServerlessOffline { } async _buildServer() { - // Methods - this._setOptions(); // Will create meaningful options from cli options - this._storeOriginalEnvironment(); // stores the original process.env for assigning upon invoking the handlers + // Will create meaningful options from cli options + this._setOptions(); + + // stores the original process.env for assigning upon invoking the handlers + this.originalEnvironment = { ...process.env }; this.apiGateway = new ApiGateway( this.serverless, @@ -164,10 +166,6 @@ module.exports = class ServerlessOffline { this.apiGateway._create404Route(); // Not found handling } - _storeOriginalEnvironment() { - this.originalEnvironment = { ...process.env }; - } - _setOptions() { // In the constructor, stage and regions are set to undefined if (this.options.region === undefined) delete this.options.region;
2
diff --git a/src/webroutes/deployer/actions.js b/src/webroutes/deployer/actions.js @@ -10,6 +10,9 @@ const helpers = require('../../extras/helpers'); //Helper functions const isUndefined = (x) => { return (typeof x === 'undefined') }; +//FIXME: temporary fix for the yarn issue requiring fxchild.stdin writes +let yarnInputFix, yarnInputFixCounter; + /** * Handle all the server control actions @@ -169,6 +172,20 @@ async function handleSaveConfig(ctx) { globals.fxRunner.refreshConfig(); ctx.utils.logAction(`Completed and committed server deploy.`); + //FIXME: temporary fix for the yarn issue requiring fxchild.stdin writes + yarnInputFixCounter = 0; + clearInterval(yarnInputFix); + yarnInputFix = setInterval(() => { + if(yarnInputFixCounter > 6){ + if(GlobalData.verbose) log('Clearing yarnInputFix setInterval'); + clearInterval(yarnInputFix); + } + yarnInputFixCounter++; + try { + globals.fxRunner.srvCmd(`txaPing temporary_yarn_workaround_please_ignore#${yarnInputFixCounter}`); + } catch (error) {} + }, 30*1000); + //Starting server const spawnMsg = await globals.fxRunner.spawnServer(false); if(spawnMsg !== null){
0
diff --git a/generators/upgrade/index.js b/generators/upgrade/index.js @@ -79,7 +79,7 @@ module.exports = UpgradeGenerator.extend({ this.log(`Regenerating application with JHipster ${version}...`); let generatorCommand = 'yo jhipster'; if (semver.gte(version, FIRST_CLI_SUPPORTED_VERSION)) { - const generatorDir = this.clientPackageManager === 'yarn' ? shelljs.exec('yarn bin', { silent: true }).stdout : shelljs.exec('npm bin', { silent: true }).stdout; + const generatorDir = this.clientPackageManager === 'yarn' ? shelljs.exec('yarn bin', { silent: this.silent }).stdout : shelljs.exec('npm bin', { silent: this.silent }).stdout; generatorCommand = `${generatorDir.replace('\n', '')}/jhipster`; } shelljs.exec(`${generatorCommand} --with-entities --force --skip-install`, { silent: this.silent }, (code, msg, err) => {
4
diff --git a/samples/samples.js b/samples/samples.js path: 'scales/time/line.html' }, { title: 'Line (point data)', - path: 'scales/time/line.html' + path: 'scales/time/line-point-data.html' }, { title: 'Combo', path: 'scales/time/combo.html'
1
diff --git a/app/server/locales/nl.json b/app/server/locales/nl.json "account_title": "Account", "account_undertitle": "Algemene informatie", "account_name": "Naam", - "account_signout": "Log uit na (h)", + "account_signout": "Log uit na (uur)", "password_title": "Wachtwoord", "password_undertitle": "Wijzig uw wachtwoord", "password_old": "Oud wachtwoord", "themes_darkmode": "Donkere modus", "themes_themes": "Thema's", "rooms_title": "Kamers", - "rooms_name": "Kamer naam", + "rooms_name": "Naam van kamer", "rooms_name_standard": "Standaard", "nothing_selected": "Niets geselecteerd" }, "dashboard": { "title": "Dashboard", "title_cameras": "Camera's", - "timer": "Afbeelding ververstijd (s)", + "timer": "Afbeelding ververstijd (seconden)", "timer_info": "Tijd in seconden om een nieuwe Snapshot te maken van een camera (als livestream uitgeschakeld is)", "favourite": "Favoriet", - "favourite_info": "Wanneer ingeschakeld, zal deze camera worden weergegeven in het dashboard.", + "favourite_info": "Wanneer ingeschakeld zal deze camera worden weergegeven in het dashboard.", "livestream": "Livestream", - "livestream_info": "Indien ingeschakeld, zal deze camera een livestream laten zien. Indien uitgeschakeld, zal er een Snapshot worden weergegeven, gegenereerd na een specifieke ververstijd (zie Afbeelding ververstijd)." + "livestream_info": "Indien ingeschakeld zal deze camera een livestream laten zien. Indien uitgeschakeld, zal er een Snapshot worden weergegeven, gegenereerd na een specifieke ververstijd (zie Afbeelding ververstijd)." }, "cameras": { "title": "Camera's", "recordings": { "title": "Opnames", "active": "Actief", - "active_info": "Indien ingeschakeld, zullen opnames ingeschakeld worden voor alle camera's. Opnames zullen gemaakt worden op basis van beweging.", + "active_info": "Indien ingeschakeld zullen opnames ingeschakeld worden voor alle camera's. Opnames zullen gemaakt worden op basis van beweging.", "type": "Opname type", - "type_info": "Kies tussen Snapshot and Video. Snapshot verandert de opname in JPEG-bestanden en Video verandert de opname in MP4-bestanden.", + "type_info": "Kies tussen Snapshot of Video. Bij Snapshot worden opnames opgeslagen als afbeelding met het JPEG-bestandstype. Bij Video worden opnames opgeslagen als video met het MP4-bestandstype.", "type_snapshot": "Snapshot", "type_video": "Video", - "timer": "Opnametimer (s)", + "timer": "Opnametimer (seconden)", "timer_info": "Timer in seconden voor video opnames (indien opname type video is).", "store": "Opslag pad", "store_info": "Pad om opgenomen bestanden op te slaan", - "remove": "Verwijder na (d)", + "remove": "Verwijder na (dagen)", "remove_info": "Timer in dagen om automatisch opgenomen bestanden te verwijderen." }, "notifications": { "title": "Notificaties", - "remove": "Verwijder na (h)", + "remove": "Verwijder na (uur)", "remove_info": "Timer in uren om automatisch notificaties te verwijderen uit de cache en interface.", - "remove_banner": "Verwijder banner na (s)", + "remove_banner": "Verwijder banner na (seconden)", "remove_banner_info": "Timer in seconden om inkomende notificatie banners te sluiten." }, "telegram": { "title": "Telegram", "active": "Actief", - "active_info": "Enbales telegram notification for motion alerts.", + "active_info": "Schakelt het versturen van Telegram-notificaties in bij een bewegingsmelding.", "token": "Token", "token_info": "De token gegeven door @BotFather bij het maken van de Telegram-bot.", "chatid": "Chat ID", - "chatid_info": "The chat ID given by the bot after sending '/start' to it.", + "chatid_info": "Het chat ID gegeven door de bot nadat er '/start' naartoe verstuurd is.", "motion_text": "Tekst bij beweging", "motion_text_info": "Aangepate tekst in Telegram voor bewegingsmeldingen. (@ zal vervangen worden door de cameranaam).", "type_snapshot": "Snapshot", "camviews": { "title": "CamViews", "title_cameras": "Camera's", - "timer": "Afbeelding ververs timer (s)", + "timer": "Afbeelding ververs timer (seconden)", "timer_info": "Timer in seconden om een nieuwe Snapshot te genereren voor een camera (indien livestream is uitgeschakeld)", "favourite": "Favoriet", "favourite_info": "Indien ingeschakeld, zal de camera weergegeven worden in het dashboard.",
1
diff --git a/src/core/operations/FileType.js b/src/core/operations/FileType.js @@ -225,8 +225,8 @@ const FileType = { if (buf[0] === 0x78 && buf[1] === 0x01) { return { - ext: "dmg", - mime: "application/x-apple-diskimage" + ext: "dmg, zlib", + mime: "application/x-apple-diskimage, application/x-deflate" }; } @@ -434,8 +434,11 @@ const FileType = { }; } - // Added by n1474335 [[email protected]] from here on - // ################################################################## // + /** + * + * Added by n1474335 [[email protected]] from here on + * + */ if ((buf[0] === 0x1F && buf[1] === 0x9D) || (buf[0] === 0x1F && buf[1] === 0xA0)) { return { ext: "z, tar.z", @@ -524,6 +527,13 @@ const FileType = { }; } + if (buf[0] === 0x78 && (buf[1] === 0x01 || buf[1] === 0x9C || buf[1] === 0xDA || buf[1] === 0x5e)) { + return { + ext: "zlib", + mime: "application/x-deflate" + }; + } + return null; },
0
diff --git a/assets/js/modules/search-console/index.js b/assets/js/modules/search-console/index.js @@ -76,9 +76,12 @@ addFilter( 'googlesitekit.DashboardSearchFunnel', addFilter( 'googlesitekit.DashboardDetailsModule', 'googlesitekit.SearchConsole', addDashboardDetailsSearchFunnel ); + +if ( ! googlesitekit.permaLink ) { addFilter( 'googlesitekit.DashboardDetailsModule', 'googlesitekit.SearchConsole', addDashboardDetailsKeywords, 40 ); +} addFilter( 'googlesitekit.DashboardPopularity', 'googlesitekit.SearchConsoleDashboardPopularity',
2
diff --git a/edit.js b/edit.js @@ -1064,6 +1064,111 @@ geometryManager.waitForLoad().then(e => { }); }); +import Simplex from './simplex-noise.js'; +class MultiSimplex { + constructor(seed, octaves) { + const simplexes = Array(octaves); + for (let i = 0; i < octaves; i++) { + simplexes[i] = new Simplex(seed + i); + } + this.simplexes = simplexes; + } + noise2D(x, z) { + let result = 0; + for (let i = 0; i < this.simplexes.length; i++) { + const simplex = this.simplexes[i]; + result += simplex.noise2D(x * (2**i), z * (2**i)); + } + return result; + } +} +{ + const simplex = new MultiSimplex('lol', 6); + + let geometry = new THREE.PlaneBufferGeometry(32, 32, 32, 32); + geometry.applyMatrix4(new THREE.Matrix4().makeRotationFromQuaternion(new THREE.Quaternion().setFromUnitVectors(new THREE.Vector3(0, 0, 1), new THREE.Vector3(0, 1, 0)))); + for (let i = 0; i < geometry.attributes.position.array.length; i += 3) { + let x = geometry.attributes.position.array[i]; + let z = geometry.attributes.position.array[i+2]; + x /= 100; + z /= 100; + const y = simplex.noise2D(x, z) * 0.5; + geometry.attributes.position.array[i+1] = y; + } + geometry = geometry.toNonIndexed(); + const barycentrics = new Float32Array(geometry.attributes.position.array.length); + let barycentricIndex = 0; + for (let i = 0; i < geometry.attributes.position.array.length; i += 9) { + barycentrics[barycentricIndex++] = 1; + barycentrics[barycentricIndex++] = 0; + barycentrics[barycentricIndex++] = 0; + barycentrics[barycentricIndex++] = 0; + barycentrics[barycentricIndex++] = 1; + barycentrics[barycentricIndex++] = 0; + barycentrics[barycentricIndex++] = 0; + barycentrics[barycentricIndex++] = 0; + barycentrics[barycentricIndex++] = 1; + } + geometry.setAttribute('barycentric', new THREE.BufferAttribute(barycentrics, 3)); + const material = new THREE.ShaderMaterial({ + uniforms: { + /* uTime: { + type: 'f', + value: 0, + }, */ + }, + vertexShader: `\ + #define PI 3.1415926535897932384626433832795 + + attribute float y; + attribute vec3 barycentric; + varying float vUv; + varying vec3 vBarycentric; + varying vec3 vPosition; + void main() { + vUv = uv.x; + vBarycentric = barycentric; + vPosition = position; + gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); + } + `, + fragmentShader: `\ + varying vec3 vBarycentric; + varying vec3 vPosition; + + // const float lineWidth = 1.0; + const vec3 lineColor1 = vec3(${new THREE.Color(0xef5350).toArray().join(', ')}); + const vec3 lineColor2 = vec3(${new THREE.Color(0xff7043).toArray().join(', ')}); + + /* float edgeFactor() { + vec3 d = fwidth(vBarycentric); + vec3 f = step(d * lineWidth, vBarycentric); + return min(min(f.x, f.y), f.z); + } */ + float gridFactor (vec3 bary, float width, float feather) { + float w1 = width - feather * 0.5; + // vec3 bary = vec3(vBC.x, vBC.y, 1.0 - vBC.x - vBC.y); + vec3 d = fwidth(bary); + vec3 a3 = smoothstep(d * w1, d * (w1 + feather), bary); + return min(min(a3.x, a3.y), a3.z); + } + float gridFactor (vec3 bary, float width) { + // vec3 bary = vec3(vBC.x, vBC.y, 1.0 - vBC.x - vBC.y); + vec3 d = fwidth(bary); + vec3 a3 = smoothstep(d * (width - 0.5), d * (width + 0.5), bary); + return min(min(a3.x, a3.y), a3.z); + } + + void main() { + vec3 c = mix(lineColor1, lineColor2, 2. + vPosition.y); + gl_FragColor = vec4(c * (gridFactor(vBarycentric, 0.5) < 0.5 ? 0.9 : 1.0), 1.0); + } + `, + }); + const gridMesh = new THREE.Mesh(geometry, material); + scene.add(gridMesh); +} + /* const loadVsh = ` #define M_PI 3.1415926535897932384626433832795 uniform float uTime;
0
diff --git a/docs/api/useFilters.md b/docs/api/useFilters.md @@ -68,8 +68,10 @@ The following values are provided to the table `instance`: - Among many other use-cases, these rows are directly useful for building option lists in filters, since the resulting filtered `rows` do not contain every possible option. - `setFilter: Function(columnId, filterValue) => void` - An instance-level function used to update the filter value for a specific column. -- `setAllFilters: Function(filtersObject) => void` +- `setAllFilters: Function(filtersObjectArray) => void` - An instance-level function used to update the values for **all** filters on the table, all at once. + - filtersObjectArray is an array of objects with id and value keys. Example: `[{ id: 'columnAccessor', value: 'valueToFilter' }]` + - Note: You must call setAllFilters with an array, even if that array is empty. eg: `setAllFilters([])`. ### Column Properties
7
diff --git a/src/loggers/console.js b/src/loggers/console.js @@ -20,12 +20,15 @@ const createLevel = (label, level, currentLevel, loggerFunction) => (message, ex loggerFunction(JSON.stringify(logData)) } -const createLogger = ({ level = parseInt(process.env.LOG_LEVEL, 10) || LEVELS.INFO } = {}) => ({ - info: createLevel('INFO', LEVELS.INFO, level, console.info), - error: createLevel('ERROR', LEVELS.ERROR, level, console.error), - warn: createLevel('WARN', LEVELS.WARN, level, console.warn), - debug: createLevel('DEBUG', LEVELS.DEBUG, level, console.log), -}) +const createLogger = ({ level = LEVELS.INFO } = {}) => { + const logLevel = parseInt(process.env.LOG_LEVEL, 10) || level + return { + info: createLevel('INFO', LEVELS.INFO, logLevel, console.info), + error: createLevel('ERROR', LEVELS.ERROR, logLevel, console.error), + warn: createLevel('WARN', LEVELS.WARN, logLevel, console.warn), + debug: createLevel('DEBUG', LEVELS.DEBUG, logLevel, console.log), + } +} module.exports = { LEVELS,
11
diff --git a/build/transpile.js b/build/transpile.js @@ -222,7 +222,6 @@ class Transpiler { [ /else\s*[\n]/g, "else:\n" ], [ /for\s+\(([a-zA-Z0-9_]+)\s*=\s*([^\;\s]+\s*)\;[^\<\>\=]+(?:\<=|\>=|<|>)\s*(.*)\.length\s*\;[^\)]+\)\s*{/g, 'for $1 in range($2, len($3)):'], [ /for\s+\(([a-zA-Z0-9_]+)\s*=\s*([^\;\s]+\s*)\;[^\<\>\=]+(?:\<=|\>=|<|>)\s*(.*)\s*\;[^\)]+\)\s*{/g, 'for $1 in range($2, $3):'], - [ /while\s+\(([\s\S]+)\)\s*{/g, 'while $1:'], [ /\s\|\|\s/g, ' or ' ], [ /\s\&\&\s/g, ' and ' ], [ /\!([^\='"])/g, 'not $1'], @@ -263,7 +262,7 @@ class Transpiler { [ / = new /g, ' = ' ], // python does not have a 'new' keyword [ /console\.log\s/g, 'print' ], [ /process\.exit\s+/g, 'sys.exit' ], - [ /([^:+=\/\*\s-]+)(?<!while) \(/g, '$1(' ], // PEP8 E225 remove whitespaces before left ( round bracket + [ /([^:+=\/\*\s-]+) \(/g, '$1(' ], // PEP8 E225 remove whitespaces before left ( round bracket [ /\sand\(/g, ' and (' ], [ /\sor\(/g, ' or (' ], [ /\snot\(/g, ' not (' ],
13
diff --git a/assets/js/googlesitekit-idea-hub-post-list-notice.js b/assets/js/googlesitekit-idea-hub-post-list-notice.js @@ -36,14 +36,11 @@ domReady( () => { return; } const type = notice.id.replace( 'googlesitekit-notice-idea-hub_', '' ); + const expiresInSeconds = type === 'new-ideas' ? WEEK_IN_SECONDS : 0; - // Button pops up only after the timeout passes - setTimeout( () => { - const button = notice.querySelector( '.notice-dismiss' ); - if ( ! button ) { - return; + notice.addEventListener( 'click', ( event ) => { + if ( 'notice-dismiss' === event.target.className ) { + dispatch( CORE_USER ).dismissItem( type, { expiresInSeconds } ); } - const expiresInSeconds = type === 'new-ideas' ? WEEK_IN_SECONDS : 0; - button.addEventListener( 'click', () => dispatch( CORE_USER ).dismissItem( type, { expiresInSeconds } ) ); - }, 1 ); + } ); } );
2
diff --git a/lib/connection/process/basic2.js b/lib/connection/process/basic2.js @@ -25,6 +25,8 @@ export function get_ (path, args) { process.env.JULIA_NUM_THREADS = confntInt } + process.env.TERM = 'xterm' + if (process.platform == 'win32') { return getWindows(path, args, process.env) } else {
12
diff --git a/bin/data-type-formats.js b/bin/data-type-formats.js @@ -43,7 +43,7 @@ exports.binary = { return Buffer.from(array); }, - serialize: function ({ coerce, exception, value }) { + serialize: function ({ exception, value }) { if (value instanceof Buffer) { let binary = ''; for (let i = 0; i < value.length; i++) { @@ -95,13 +95,11 @@ exports.byte = { return Buffer.from(array); }, - serialize: function ({ coerce, exception, value }) { - const originalValue = value; - if (coerce) value = coerceToBuffer(exception, value); + serialize: function ({ exception, value }) { if (value instanceof Buffer) { return value.toString('base64'); } else { - exception.message('Expected a Buffer instance. Received: ' + util.smart(originalValue)); + exception.message('Expected a Buffer instance. Received: ' + util.smart(value)); } }, @@ -149,11 +147,10 @@ exports.date = { return new Date(value); }, - serialize: function ({ coerce, exception, value }) { + serialize: function ({ exception, value }) { const originalValue = value; const type = typeof value; if (type === 'string' && (rx.date.test(value) || rx.dateTime.test(value))) value = new Date(value); - if (coerce && type === 'number' && !isNaN(value)) value = new Date(Number(value)); if (util.isDate(value)) { return value.toISOString().substr(0, 10); } else { @@ -205,11 +202,10 @@ exports.dateTime = { return new Date(value); }, - serialize: function ({ coerce, exception, value }) { + serialize: function ({ exception, value }) { const originalValue = value; const type = typeof value; - if (type === 'string' && (coerce || rx.date.test(value) || rx.dateTime.test(value))) value = new Date(value); - if (coerce && type === 'number' && !isNaN(value)) value = new Date(Number(value)); + if (type === 'string' && (rx.date.test(value) || rx.dateTime.test(value))) value = new Date(value); if (util.isDate(value)) { return value.toISOString(); } else { @@ -235,27 +231,3 @@ exports.dateTime = { } } }; \ No newline at end of file - -function coerceToBuffer(exception, value) { - const type = typeof value; - if (type === 'number' || type === 'boolean') { - value = Number(value); - if (!isNaN(value) && value >= 0) { - let hex = value.toString(16); - if (hex.length % 2) hex = '0' + hex; - - const array = []; - const length = hex.length; - for (let i = 0; i < length; i += 2) { - array.push(hex.substr(i, 2)); - } - - value = Buffer.from(array.join(''), 'hex'); - } else { - exception.message('Unable to coerce value'); - } - } else if (type === 'string') { - value = value ? Buffer.from(value) : Buffer.from([0]); - } - return value; -} \ No newline at end of file
2
diff --git a/immer-es5.js b/immer-es5.js @@ -32,7 +32,7 @@ function immer(baseState, thunk) { function assertUnfinished() { if (finished) throw new Error( - "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process?", + "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process?" ) } @@ -48,7 +48,7 @@ function immer(baseState, thunk) { enumerable: true, writable: true, configurable: true, - value: value, + value: value }) } @@ -81,13 +81,13 @@ function immer(baseState, thunk) { }, set(value) { proxySet(this, prop, value) - }, + } }) return proxy }, set(value) { proxySet(this, prop, value) - }, + } }) ) } @@ -97,7 +97,7 @@ function immer(baseState, thunk) { createHiddenProperty(proxy, PROXY_TARGET, base) createHiddenProperty(proxy, CHANGED_STATE, false) Object.keys(base).forEach(prop => - Object.defineProperty(proxy, prop, createPropertyProxy(prop)), + Object.defineProperty(proxy, prop, createPropertyProxy(prop)) ) return proxy } @@ -167,7 +167,7 @@ function immer(baseState, thunk) { //values either than undefined will trigger warning; !Object.is(maybeVoidReturn, undefined) && console.warn( - `Immer callback expects no return value. However ${typeof maybeVoidReturn} was returned`, + `Immer callback expects no return value. However ${typeof maybeVoidReturn} was returned` ) // and finalize the modified proxy finalizing = true @@ -198,11 +198,12 @@ function createHiddenProperty(target, prop, value) { Object.defineProperty(target, prop, { value: value, enumerable: false, - writable: true, + writable: true }) } function shallowEqual(objA, objB) { + //From: https://github.com/facebook/fbjs/blob/c69904a511b900266935168223063dd8772dfc40/packages/fbjs/src/core/shallowEqual.js if (Object.is(objA, objB)) return true if ( typeof objA !== "object" ||
0
diff --git a/Makefile b/Makefile @@ -190,7 +190,6 @@ WORKING_SPECS_5 = \ spec/models/organization_spec.rb \ spec/models/user_organization_spec.rb \ spec/models/synchronization/synchronization_oauth_spec.rb \ - spec/models/permission_spec.rb \ spec/models/carto/permission_spec.rb \ spec/lib/carto/ghost_tables_manager_spec.rb \ spec/lib/carto/bolt_spec.rb \
2
diff --git a/gulpfile.js b/gulpfile.js @@ -229,7 +229,7 @@ gulp.task('release:zip', ['release:tag', 'default'], function() { }); gulp.task('release:publish', ['release:zip'], function() { - gulp.src('./brouter-web.'+nextVersion+'.zip') + gulp.src('./brouter-web-'+nextVersion+'.zip') .pipe(release({ tag: nextVersion, token: ghToken,
10
diff --git a/src/modules/dex/directives/dexMyOrders/DexMyOrders.js b/src/modules/dex/directives/dexMyOrders/DexMyOrders.js const pair = `${assetPair.amountAsset.displayName} / ${assetPair.priceAsset.displayName}`; const isNew = DexMyOrders._isNewOrder(order.timestamp.getTime()); const percent = new BigNumber(order.progress * 100).toFixed(2); - const feeAsset = order.feeAsset || 'WAVES'; + const feeAsset = order.feeAsset || order.matcherFeeAssetId || 'WAVES'; + const matcherFee = order.fee || order.matcherFee; + if (matcherFee) { + if (matcherFee instanceof Money) { + return Promise.resolve({ ...order, isNew, percent, pair, fee: matcherFee }); + } - if (order.fee) { return ds.api.assets.get(feeAsset).then(asset => { - const fee = new Money(order.fee, asset); + const fee = new Money(matcherFee, asset); return { ...order, isNew, percent, pair, fee }; }); }
1
diff --git a/ui/component/commentMenuList/view.jsx b/ui/component/commentMenuList/view.jsx @@ -10,7 +10,6 @@ type Props = { clearPlayingUri: () => void, authorUri: string, // full LBRY Channel URI: lbry://@channel#123... commentId: string, // sha256 digest identifying the comment - claimIsMine: boolean, // if you control the claim which this comment was posted on commentIsMine: boolean, // if this comment was signed by an owned channel deleteComment: (string, ?string) => void, linkedComment?: any, @@ -21,7 +20,6 @@ type Props = { handleEditComment: () => void, contentChannelPermanentUrl: any, activeChannelClaim: ?ChannelClaim, - claimIsMine: boolean, isTopLevel: boolean, commentModBlock: (string) => void, playingUri: ?PlayingUri, @@ -36,7 +34,6 @@ function CommentMenuList(props: Props) { deleteComment, blockChannel, pinComment, - claimIsMine, clearPlayingUri, activeChannelClaim, contentChannelPermanentUrl, @@ -61,10 +58,8 @@ function CommentMenuList(props: Props) { } function handleCommentBlock() { - if (claimIsMine) { commentModBlock(authorUri); } - } function handleCommentMute() { blockChannel(authorUri);
11
diff --git a/components/Frame/LoadingBar.js b/components/Frame/LoadingBar.js @@ -26,8 +26,7 @@ class LoadingBar extends Component { progress: 0 } } - componentDidMount () { - Router.onRouteChangeStart = (url) => { + onRouteChangeStart = (url) => { clearTimeout(this.timeout) this.setState({ loading: true, progress: 0.02 }) @@ -36,20 +35,24 @@ class LoadingBar extends Component { onRouteChangeStart(url) } } - Router.onRouteChangeComplete = url => { + onRouteChangeComplete = url => { clearTimeout(this.timeout) this.setState({ loading: false }) } - Router.onRouteChangeError = () => { + onRouteChangeError = () => { clearTimeout(this.timeout) this.setState({ loading: false }) } + componentDidMount () { + Router.events.on('routeChangeStart', this.onRouteChangeStart) + Router.events.on('routeChangeComplete', this.onRouteChangeComplete) + Router.events.on('routeChangeError', this.onRouteChangeError) } componentWillUnmount () { clearTimeout(this.timeout) - Router.onRouteChangeStart = null - Router.onRouteChangeComplete = null - Router.onRouteChangeError = null + Router.events.off('routeChangeStart', this.onRouteChangeStart) + Router.events.off('routeChangeComplete', this.onRouteChangeComplete) + Router.events.off('routeChangeError', this.onRouteChangeError) } componentDidUpdate () { if (this.state.loading) {
4
diff --git a/packages/bitcore-node/src/services/p2p.ts b/packages/bitcore-node/src/services/p2p.ts @@ -76,6 +76,7 @@ export class P2pWorker { private lastHeartBeat: string; private queuedRegistrations: Array<NodeJS.Timer>; public isSyncing: boolean; + public isSyncingNode = false; constructor({ chain, network, chainConfig, blockModel = BlockStorage }) { this.blockModel = blockModel; this.chain = chain; @@ -371,8 +372,10 @@ export class P2pWorker { const { chain, network } = this; let currentHeight = Math.max(1, from); const originalSyncValue = this.isSyncing; + const originalSyncNodeValue = this.isSyncingNode; while (currentHeight < to) { this.isSyncing = true; + this.isSyncingNode = true; const locatorHashes = await ChainStateProvider.getLocatorHashes({ chain, network, @@ -405,9 +408,10 @@ export class P2pWorker { } } this.isSyncing = originalSyncValue; + this.isSyncingNode = originalSyncNodeValue; } - get isSyncingNode(): boolean { + getIsSyncingNode(): boolean { if (!this.lastHeartBeat) { return false; } @@ -421,9 +425,10 @@ export class P2pWorker { async refreshSyncingNode() { while (!this.stopping) { - const wasSyncingNode = this.isSyncingNode; + const wasSyncingNode = this.getIsSyncingNode(); this.lastHeartBeat = await StateStorage.getSyncingNode({ chain: this.chain, network: this.network }); - const nowSyncingNode = this.isSyncingNode; + const nowSyncingNode = this.getIsSyncingNode(); + this.isSyncingNode = nowSyncingNode; if (wasSyncingNode && !nowSyncingNode) { throw new Error('Syncing Node Renewal Failure'); } @@ -431,7 +436,7 @@ export class P2pWorker { logger.info(`This worker is now the syncing node for ${this.chain} ${this.network}`); this.sync(); } - if (!this.lastHeartBeat || this.isSyncingNode) { + if (!this.lastHeartBeat || this.getIsSyncingNode()) { this.registerSyncingNode({ primary: true }); } else { this.registerSyncingNode({ primary: false }); @@ -458,7 +463,7 @@ export class P2pWorker { async unregisterSyncingNode() { await wait(1000); this.lastHeartBeat = await StateStorage.getSyncingNode({ chain: this.chain, network: this.network }); - if (this.isSyncingNode) { + if (this.getIsSyncingNode()) { await StateStorage.selfResignSyncingNode({ chain: this.chain, network: this.network,
3
diff --git a/package.json b/package.json { "name": "nativescript", "preferGlobal": true, - "version": "3.4.1", + "version": "3.4.2", "author": "Telerik <[email protected]>", "description": "Command-line interface for building NativeScript projects", "bin": {
12
diff --git a/site/federated-exchanges.md b/site/federated-exchanges.md @@ -109,14 +109,14 @@ The following example configures an upstream named "source" which can be contact <pre class="lang-bash"> # Adds a federation upstream named "origin" -rabbitmqctl set_parameter federation-upstream origin '{"uri":"amqp://localhost:5673"}' +rabbitmqctl set_parameter federation-upstream origin '{"uri":"amqp://localhost:5672"}' </pre> On Windows, use `rabbitmqctl.bat` and suitable PowerShell quoting: <pre class="lang-powershell"> # Adds a federation upstream named "origin" -rabbitmqctl.bat set_parameter federation-upstream origin "{""uri"":""amqp://localhost:5673""}" +rabbitmqctl.bat set_parameter federation-upstream origin "{""uri"":""amqp://localhost:5672""}" </pre> More upstream definition parameters are covered in the [Federation Reference guide](/federation-reference.html).
4
diff --git a/spec/controllers/taxa_controller_api_spec.rb b/spec/controllers/taxa_controller_api_spec.rb @@ -2,6 +2,8 @@ require File.dirname(__FILE__) + '/../spec_helper' shared_examples_for "a TaxaController" do describe "index" do + before(:each) { enable_elastic_indexing( Observation ) } + after(:each) { disable_elastic_indexing( Observation ) } it "should filter by place_id" do t = Taxon.make! p = Place.make! @@ -37,8 +39,8 @@ shared_examples_for "a TaxaController" do end describe "search" do - before(:each) { enable_elastic_indexing([ Taxon, Place ]) } - after(:each) { disable_elastic_indexing([ Taxon, Place ]) } + before(:each) { enable_elastic_indexing( Observation, Taxon, Place ) } + after(:each) { disable_elastic_indexing( Observation, Taxon, Place ) } it "should filter by place_id" do taxon_not_in_place = Taxon.make! @@ -178,6 +180,8 @@ shared_examples_for "a TaxaController" do end describe "with default photo" do + before(:each) { enable_elastic_indexing( Observation ) } + after(:each) { disable_elastic_indexing( Observation ) } let(:photo) { Photo.make!( "id" => 1576,
1
diff --git a/articles/connections/social/google.md b/articles/connections/social/google.md @@ -9,24 +9,22 @@ alias: - google-oauth - google-oauth2 seo_alias: google +toc: true --- # Connect Your App to Google -::: note -This doc only shows you how to connect your client to Google. To manage your app's authentication, see [Next Steps](#next-steps) for links to the appropriate docs. -::: - To connect your Auth0 client to Google, you will need to: -* Generate a *Client ID* and *Client Secret* in a Google project -* Copy these keys into your Auth0 settings -* Enable the Connection +1. Generate a *Client ID* and *Client Secret* in a Google project +2. Enable the Google Admin SDK Service +3. Copy your Google *Client ID* and *Client Secret* keys into your Auth0 settings +4. Enable the Connection ::: warning Google OAuth clients requesting sensitive OAuth scopes may be [subject to review](https://developers.google.com/apps-script/guides/client-verification) by Google. ::: -## Generate the Google Client ID and Client Secret +## 1. Generate the Google Client ID and Client Secret 1. Log in to your Google account and go to the [APIs & services](https://console.developers.google.com/projectselector/apis/credentials). @@ -56,7 +54,7 @@ Google OAuth clients requesting sensitive OAuth scopes may be [subject to review Save your `Client Id` and `Client Secret` to enter into the Connection settings in Auth0. -### Enable the Admin SDK Service +### 2. Enable the Admin SDK Service If you are planning to connect to Google Apps enterprise domains, you will need to enable the **Admin SDK** service. @@ -70,7 +68,7 @@ If you are planning to connect to Google Apps enterprise domains, you will need ![API Manager Dashboard for Admin SDK](/media/articles/connections/social/google/enable-admin-sdk.png) -## Enable the Connection in Auth0 +## 3. Enable the Connection in Auth0 1. Log in to the [Auth0 Dashboard](${manage_url}) and select **Connections > Social** in the left navigation. @@ -88,7 +86,7 @@ If you are planning to connect to Google Apps enterprise domains, you will need 5. Select the **Permissions** for each of the features you want to allow your app to access. Click **Save** when you're done. -## Test Your Connection +### Test Your Connection 1. Go back to the [Connections > Social](${manage_url}/#/connections/social) section of the Auth0 dashboard. If you have configured your connection correctly, you will see a **Try** icon next to the Google logo: @@ -104,16 +102,20 @@ If you have configured everything correctly, you will see the **It works!!!** pa ![](/media/articles/connections/social/google/goog-api-works.png) -## Obtaining the Access Token and Refresh Token +## 4. Obtaining the Access Token and Refresh Token -The `access_token` returned by Google can be obtained after the user has logged in by making an HTTP GET request to the `/api/v2/user/{user-id}` endpoint containing an Auth0 API token generated with `read:user_idp_tokens` scope. The `access_token` for the IdP will be available in the `identities` array, under the element for the particular connection. +The `access_token` returned by Google can be obtained after the user has logged in by making an HTTP GET request to the [`/api/v2/user/{user-id}` endpoint](/api/management/v2#!/Users/get_users_by_id) containing an [Auth0 API access token](https://auth0.com/docs/api/management/v2/tokens#get-a-token-manually) generated with `read:user_idp_tokens` scope. The [`access_token` for the IdP](https://auth0.com/docs/tokens/idp) will be available in the `identities` array, under the element for the particular connection. ::: note - For more information, please refer to the [Management API documentation](/api/management/v2#!/Users/get_users_by_id) +Please see [Call an Identity Provider API](https://auth0.com/docs/tutorials/calling-an-external-idp-api) for additional details. ::: -You can also request a `refresh_token` from Google by passing along the `access_type=offline` parameter when calling the Auth0 `/authorize` endpoint (or passing it in `auth.params` when using [Lock](https://auth0.com/docs/libraries/lock/v10)). +You can also request a `refresh_token` from Google by passing along the `access_type=offline` parameter when calling the [Auth0 `/authorize` endpoint](https://auth0.com/docs/api/authentication#implicit-grant) (or passing it in `auth.params` when using [Lock](https://auth0.com/docs/libraries/lock/v10)). + +If you need a refresh token, only the following OAuth 2.0 flows can retrieve them: -The `refresh_token` can be retrieved in the same manner as described for the `access_token` above. +* [Authorization Code](https://auth0.com/docs/api-auth/grant/authorization-code) +* [Authorization Code with PKCE](https://auth0.com/docs/api-auth/grant/authorization-code-pkce) +* [Resource Owner Password](https://auth0.com/docs/api-auth/grant/password) <%= include('../_quickstart-links.md') %>
0
diff --git a/karma.conf.js b/karma.conf.js @@ -19,6 +19,11 @@ module.exports = function (config) { base: 'SauceLabs', browserName: 'firefox', version: 'latest' + }, + sl_safari_latest: { + base: 'SauceLabs', + browserName: 'safari', + version: 'latest' } };
0
diff --git a/vault/templates.cli.md b/vault/templates.cli.md id: 39menlcx30lpo1ci4px7aew title: CLI desc: '' -updated: 1655414733603 +updated: 1655631320910 created: 1654385553923 templateId: "39menlcx30lpo1ci4px7aew" --- @@ -20,17 +20,11 @@ Options: ... ``` -### Options -<!-- Key value list for any non-obvious options, with sub lists as need for allowed values and definitions of them e.g. - - `--output`: controls how note is formatted - - values: `json|md_gfm|md_dendron` - - `json`: JSON output - - `md_dendron`: dendron markdown - - `md_gfm`: github flavored markdown ---> +### Commands +<!-- Remove if not required: Use level 4 headers per command, describing the purpose of each command --> -### Actions -<!-- Use level 4 headers per action, describing the purpose of each action --> +### Options +<!-- Use level 4 headers per option, describing the purpose of each option, then any values and their meaning in a list if required--> ## Examples <!-- Bullet description of the example followed by the code, e.g.
10
diff --git a/js/coinegg.js b/js/coinegg.js @@ -42,18 +42,18 @@ module.exports = class coinegg extends Exchange { }, 'public': { 'get': [ - 'ticker/{quote}', - 'depth/{quote}', - 'orders/{quote}', + 'ticker/region/{quote}', + 'depth/region/{quote}', + 'orders/region/{quote}', ], }, 'private': { 'post': [ 'balance', - 'trade_add/{quote}', - 'trade_cancel/{quote}', - 'trade_view/{quote}', - 'trade_list/{quote}', + 'trade_add/region/{quote}', + 'trade_cancel/region/{quote}', + 'trade_view/region/{quote}', + 'trade_list/region/{quote}', ], }, }, @@ -247,7 +247,7 @@ module.exports = class coinegg extends Exchange { async fetchTicker (symbol, params = {}) { await this.loadMarkets (); let market = this.market (symbol); - let ticker = await this.publicGetTickerQuote (this.extend ({ + let ticker = await this.publicGetTickerRegionQuote (this.extend ({ 'coin': market['baseId'], 'quote': market['quoteId'], }, params)); @@ -293,7 +293,7 @@ module.exports = class coinegg extends Exchange { async fetchOrderBook (symbol, limit = undefined, params = {}) { await this.loadMarkets (); let market = this.market (symbol); - let orderbook = await this.publicGetDepthQuote (this.extend ({ + let orderbook = await this.publicGetDepthRegionQuote (this.extend ({ 'coin': market['baseId'], 'quote': market['quoteId'], }, params)); @@ -325,7 +325,7 @@ module.exports = class coinegg extends Exchange { async fetchTrades (symbol, since = undefined, limit = undefined, params = {}) { await this.loadMarkets (); let market = this.market (symbol); - let trades = await this.publicGetOrdersQuote (this.extend ({ + let trades = await this.publicGetOrdersRegionQuote (this.extend ({ 'coin': market['baseId'], 'quote': market['quoteId'], }, params)); @@ -400,7 +400,7 @@ module.exports = class coinegg extends Exchange { async createOrder (symbol, type, side, amount, price = undefined, params = {}) { await this.loadMarkets (); let market = this.market (symbol); - let response = await this.privatePostTradeAddQuote (this.extend ({ + let response = await this.privatePostTradeAddRegionQuote (this.extend ({ 'coin': market['baseId'], 'quote': market['quoteId'], 'type': side, @@ -424,7 +424,7 @@ module.exports = class coinegg extends Exchange { async cancelOrder (id, symbol = undefined, params = {}) { await this.loadMarkets (); let market = this.market (symbol); - let response = await this.privatePostTradeCancelQuote (this.extend ({ + let response = await this.privatePostTradeCancelRegionQuote (this.extend ({ 'id': id, 'coin': market['baseId'], 'quote': market['quoteId'], @@ -435,7 +435,7 @@ module.exports = class coinegg extends Exchange { async fetchOrder (id, symbol = undefined, params = {}) { await this.loadMarkets (); let market = this.market (symbol); - let response = await this.privatePostTradeViewQuote (this.extend ({ + let response = await this.privatePostTradeViewRegionQuote (this.extend ({ 'id': id, 'coin': market['baseId'], 'quote': market['quoteId'], @@ -452,7 +452,7 @@ module.exports = class coinegg extends Exchange { }; if (typeof since !== 'undefined') request['since'] = since / 1000; - let orders = await this.privatePostTradeListQuote (this.extend (request, params)); + let orders = await this.privatePostTradeListRegionQuote (this.extend (request, params)); return this.parseOrders (orders['data'], market, since, limit); }
11
diff --git a/closure/goog/string/const.js b/closure/goog/string/const.js @@ -134,7 +134,7 @@ goog.string.Const.unwrap = function(stringConst) { * Creates a Const object from a compile-time constant string. * * It is illegal to invoke this function on an expression whose - * compile-time-contant value cannot be determined by the Closure compiler. + * compile-time-constant value cannot be determined by the Closure compiler. * * Correct invocations include, * <pre>
1
diff --git a/src/renderer/layer/tilelayer/TileLayerGLRenderer.js b/src/renderer/layer/tilelayer/TileLayerGLRenderer.js @@ -124,8 +124,8 @@ class TileLayerGLRenderer extends TileLayerCanvasRenderer { } getViewMatrix() { - const m = mat4.copy(new Float64Array(16), this.getMap().projMatrix); - mat4.scale(m, m, [1, -1, 1]); + const m = new Float64Array(16); + mat4.scale(m, this.getMap().projMatrix, [1, -1, 1]); return m; }
3
diff --git a/backend/lib/endpoints/schema/organizations.js b/backend/lib/endpoints/schema/organizations.js @@ -2,6 +2,7 @@ const S = require("fluent-schema"); const createOrganizationSchema = { body: S.object() + .additionalProperties(false) .prop("email", S.string().required()) .prop("global", S.boolean()) .prop("industry", S.string().required()) @@ -25,6 +26,7 @@ const getOrganizationsSchema = { const updateOrganizationSchema = { body: S.object() + .additionalProperties(false) .prop("address", S.string()) .prop("androidUrl", S.string()) .prop("description", S.string())
12
diff --git a/.gitignore b/.gitignore .DS_Store - +/.direnv /coverage /dist /node_modules - yarn-error.log - -# TypeScript test run output -# TODO: Is there a way to avoid this file from being written and instead "just typecheck"? -src/__tests__/typescript-tests.js +__pycache__/
8
diff --git a/src/js/core/createTooltips.js b/src/js/core/createTooltips.js @@ -57,7 +57,7 @@ export default function createTooltips(els) { reference._tippy = this // Allow easy access to the popper's reference element - popper.tippyReferenceElement = reference + popper._reference = reference idCounter++
10
diff --git a/webpack.config.js b/webpack.config.js const path = require("path"); +const fs = require("fs"); const { DefinePlugin, NormalModuleReplacementPlugin } = require("webpack"); const CopyWebpackPlugin = require("copy-webpack-plugin"); const HtmlWebpackPlugin = require("html-webpack-plugin"); const { devDependencies, version } = require("./package.json"); +const manifest = require("./resources/manifest.json"); const CHANGELOG = path.resolve(__dirname, "./CHANGELOG.md"); const DIST = path.resolve(__dirname, "./dist"); const ICONS_PATH = path.join(path.dirname(require.resolve("@buttercup/ui")), "icons"); const INDEX_TEMPLATE = path.resolve(__dirname, "./resources/template.pug"); -const MANIFEST = path.resolve(__dirname, "./resources/manifest.json"); const REACT_PACKAGES = Object.keys(devDependencies).filter(name => /^react(-|$)/.test(name)); const REDUX_PACKAGES = Object.keys(devDependencies).filter(name => /^redux(-|$)/.test(name)); const SOURCE = path.resolve(__dirname, "./source"); @@ -20,6 +21,22 @@ const __configDefines = Object.keys(process.env).reduce((output, key) => { return output; }, {}); +function buildManifest(assetNames) { + const newManifest = JSON.parse(JSON.stringify(manifest)); + newManifest.version = version; + assetNames.forEach(assetFilename => { + if (/\.js$/.test(assetFilename) && /^vendors-/.test(assetFilename)) { + if (/\bbackground\b/.test(assetFilename)) { + newManifest.background.scripts.unshift(assetFilename); + } + if (/\btab\b/.test(assetFilename)) { + newManifest.content_scripts[0].js.unshift(assetFilename); + } + } + }); + fs.writeFileSync(path.join(DIST, "./manifest.json"), JSON.stringify(newManifest, undefined, 2)); +} + module.exports = { devtool: false, @@ -29,12 +46,6 @@ module.exports = { popup: path.join(SOURCE, "./popup/index.js"), setup: path.join(SOURCE, "./setup/index.js"), tab: path.join(SOURCE, "./tab/index.js") - // vendor: - // react: [...REACT_PACKAGES, ...REDUX_PACKAGES], - // blueprint: ["@blueprintjs/core", "@blueprintjs/icons"], - // core: ["buttercup/web"], - // buttercup: ["@buttercup/ui", "@buttercup/channel-queue", "@buttercup/locust", "@buttercup/config"], - // connection: ["@buttercup/dropbox-client", "@buttercup/google-oauth2-client", "@buttercup/googledrive-client", "dropbox"] }, module: { @@ -60,14 +71,12 @@ module.exports = { loader: "file-loader", options: { name: "[path][name].[hash].[ext]" - // name: "[path][name].[ext]" } } ] }, node: { - // global: false, Buffer: false, child_process: "empty", dns: "empty", @@ -76,12 +85,14 @@ module.exports = { tls: "empty" }, - // optimization: { - // splitChunks: { - // chunks: "all", - // maxSize: 0 - // } - // }, + optimization: { + splitChunks: { + automaticNameDelimiter: "-", + chunks: "all", + maxSize: 0, + minSize: 30000 + } + }, output: { filename: "[name].js", @@ -89,15 +100,14 @@ module.exports = { }, plugins: [ - new CopyWebpackPlugin([ { - from: MANIFEST, - transform: contents => { - const manifest = JSON.parse(contents.toString()); - manifest.version = version; - return JSON.stringify(manifest, undefined, 4); + apply: compiler => { + compiler.hooks.afterEmit.tap("AfterEmitPlugin", compilation => { + buildManifest(Object.keys(compilation.getStats().compilation.assets)); + }); } }, + new CopyWebpackPlugin([ { from: CHANGELOG },
7
diff --git a/src/muncher/utils.js b/src/muncher/utils.js @@ -76,8 +76,8 @@ export function getCompendium(label, fail = true) { } else { if (fail) { logger.error(`Unable to find compendium ${label}`); - ui.notifications.error(`Unable to open the Compendium ${label}`); - throw new Error(`Unable to open the Compendium ${label}`); + ui.notifications.error(`Unable to open the Compendium ${label}. Check the compendium exists and is set in "Module Settings > DDB Importer > Compendiums"`); + throw new Error(`Unable to open the Compendium ${label}. Check the compendium exists and is set in "Module Settings > DDB Importer > Compendiums".`); } return undefined; } @@ -91,9 +91,9 @@ export function getCompendiumType(type, fail = true) { return compendium; } else { logger.error(`Unable to find compendium ${compendiumLabel} for ${type} documents`); - ui.notifications.error(`Unable to open the Compendium ${compendiumLabel}`); + ui.notifications.error(`Unable to open the Compendium ${compendiumLabel}. Check the compendium exists and is set in "Module Settings > DDB Importer > Compendiums"`); if (fail) { - throw new Error(`Unable to open the Compendium ${compendiumLabel}`); + throw new Error(`Unable to open the Compendium ${compendiumLabel}. Check the compendium exists and is set in "Module Settings > DDB Importer > Compendiums"`); } return undefined; }
7
diff --git a/src/math/matrix2.js b/src/math/matrix2.js this.setTransform.apply(this, arguments); } else { - this.onResetEvent(); - } - }, - - /** @ignore */ - onResetEvent : function() { this.identity(); + } }, /** * @return {me.Matrix2d} */ clone : function () { - return me.pool.pull("me.Matrix2d").copy(this); + return me.pool.pull("me.Matrix2d", this); }, /**
1
diff --git a/src/kiri-mode/cam/driver.js b/src/kiri-mode/cam/driver.js @@ -81,7 +81,7 @@ kiri.load(api => { CAM.surface_prep = function(widget) { if (!widget.tool) { let tool = widget.tool = new mesh.tool(); - tool.generateFaceMap(widget.getVertices().array); + tool.index(widget.getVertices().array); } };
3
diff --git a/OpenRobertaServer/staticResources/js/app/simulation/robertaLogic/program.eval.js b/OpenRobertaServer/staticResources/js/app/simulation/robertaLogic/program.eval.js @@ -719,8 +719,8 @@ define(['robertaLogic.actors', 'robertaLogic.memory', 'robertaLogic.program', 'r if (value) { obj.program.prepend([obj.repeatStmtExpr]); obj.program.prepend(stmt.stmtList); - obj.repeatStmtExpr = {}; } + obj.repeatStmtExpr = {}; } } };
1
diff --git a/server/models/user.js b/server/models/user.js @@ -50,16 +50,10 @@ const getUsersBySearchString = (string: string): Promise<Array<Object>> => { // space. This function is only invoked for signups when checking // for an existing user on the previous Firebase stack. const getUserByProviderId = (providerId: string): Promise<Object> => { - return db - .table('users') - .filter({ providerId }) - .run() - .then( - result => - (result && result.length > 0 - ? result[0] - : new UserError('No user found with this providerId')) - ); + return db.table('users').filter({ providerId }).run().then(result => { + if (result && result.length > 0) return result[0]; + throw new new UserError('No user found with this providerId')(); + }); }; const storeUser = (user: Object): Promise<Object> => { @@ -81,6 +75,9 @@ const createOrFindUser = (user: Object): Promise<Object> => { return storeUser(user); }) .catch(err => { + if (user.id) { + throw new UserError(`No user found for id ${user.id}.`); + } return storeUser(user); }); };
1
diff --git a/src/algorithms/math/complex-number/__test__/ComplexNumber.test.js b/src/algorithms/math/complex-number/__test__/ComplexNumber.test.js @@ -33,12 +33,16 @@ describe('ComplexNumber', () => { const complexNumber3 = complexNumber.add(realNumber); const complexNumber4 = realNumber.add(complexNumber); + const complexNumber5 = complexNumber.add(3); expect(complexNumber3.re).toBe(1 + 3); expect(complexNumber3.im).toBe(2); expect(complexNumber4.re).toBe(1 + 3); expect(complexNumber4.im).toBe(2); + + expect(complexNumber5.re).toBe(1 + 3); + expect(complexNumber5.im).toBe(2); }); it('should subtract complex numbers', () => { @@ -61,12 +65,16 @@ describe('ComplexNumber', () => { const complexNumber3 = complexNumber.subtract(realNumber); const complexNumber4 = realNumber.subtract(complexNumber); + const complexNumber5 = complexNumber.subtract(3); expect(complexNumber3.re).toBe(1 - 3); expect(complexNumber3.im).toBe(2); expect(complexNumber4.re).toBe(3 - 1); expect(complexNumber4.im).toBe(-2); + + expect(complexNumber5.re).toBe(1 - 3); + expect(complexNumber5.im).toBe(2); }); it('should multiply complex numbers', () => { @@ -75,12 +83,16 @@ describe('ComplexNumber', () => { const complexNumber3 = complexNumber1.multiply(complexNumber2); const complexNumber4 = complexNumber2.multiply(complexNumber1); + const complexNumber5 = complexNumber1.multiply(5); expect(complexNumber3.re).toBe(-11); expect(complexNumber3.im).toBe(23); expect(complexNumber4.re).toBe(-11); expect(complexNumber4.im).toBe(23); + + expect(complexNumber5.re).toBe(15); + expect(complexNumber5.im).toBe(10); }); it('should multiply complex numbers by themselves', () => { @@ -106,9 +118,13 @@ describe('ComplexNumber', () => { const complexNumber2 = new ComplexNumber({ re: 4, im: -5 }); const complexNumber3 = complexNumber1.divide(complexNumber2); + const complexNumber4 = complexNumber1.divide(2); expect(complexNumber3.re).toBe(-7 / 41); expect(complexNumber3.im).toBe(22 / 41); + + expect(complexNumber4.re).toBe(1); + expect(complexNumber4.im).toBe(1.5); }); it('should return complex number in polar form', () => { @@ -136,5 +152,30 @@ describe('ComplexNumber', () => { expect(complexNumber5.getPolarForm().radius).toBeCloseTo(8.60); expect(complexNumber5.getPolarForm().phase).toBeCloseTo(0.95); expect(complexNumber5.getPolarForm(false).phase).toBeCloseTo(54.46); + + const complexNumber6 = new ComplexNumber({ re: 0, im: 0.25 }); + expect(complexNumber6.getPolarForm().radius).toBeCloseTo(0.25); + expect(complexNumber6.getPolarForm().phase).toBeCloseTo(1.57); + expect(complexNumber6.getPolarForm(false).phase).toBeCloseTo(90); + + const complexNumber7 = new ComplexNumber({ re: 0, im: -0.25 }); + expect(complexNumber7.getPolarForm().radius).toBeCloseTo(0.25); + expect(complexNumber7.getPolarForm().phase).toBeCloseTo(-1.57); + expect(complexNumber7.getPolarForm(false).phase).toBeCloseTo(-90); + + const complexNumber8 = new ComplexNumber(); + expect(complexNumber8.getPolarForm().radius).toBeCloseTo(0); + expect(complexNumber8.getPolarForm().phase).toBeCloseTo(0); + expect(complexNumber8.getPolarForm(false).phase).toBeCloseTo(0); + + const complexNumber9 = new ComplexNumber({ re: -0.25, im: 0 }); + expect(complexNumber9.getPolarForm().radius).toBeCloseTo(0.25); + expect(complexNumber9.getPolarForm().phase).toBeCloseTo(Math.PI); + expect(complexNumber9.getPolarForm(false).phase).toBeCloseTo(180); + + const complexNumber10 = new ComplexNumber({ re: 0.25, im: 0 }); + expect(complexNumber10.getPolarForm().radius).toBeCloseTo(0.25); + expect(complexNumber10.getPolarForm().phase).toBeCloseTo(0); + expect(complexNumber10.getPolarForm(false).phase).toBeCloseTo(0); }); });
1
diff --git a/front/src/components/boxs/device-in-room/device-features/ColorDeviceFeature.jsx b/front/src/components/boxs/device-in-room/device-features/ColorDeviceFeature.jsx @@ -78,7 +78,7 @@ class ColorDeviceType extends Component { render({ device, deviceFeature }, { open }) { const deviceLastValue = deviceFeature.last_value; - const color = deviceLastValue === null ? undefined : `#${intToHex(deviceLastValue)}`; + const color = !deviceLastValue ? undefined : `#${intToHex(deviceLastValue)}`; return ( <Fragment>
1
diff --git a/docs/api/README.md b/docs/api/README.md * [`call(fn, ...args)`](#callfn-args) * [`call([context, fn], ...args)`](#callcontext-fn-args) * [`call([context, fnName], ...args)`](#callcontext-fnname-args) + * [`call({context, fn}, ...args)`](#callcontext-fn-args-1) * [`apply(context, fn, args)`](#applycontext-fn-args) * [`cps(fn, ...args)`](#cpsfn-args) * [`cps([context, fn], ...args)`](#cpscontext-fn-args) + * [`cps({context, fn}, ...args)`](#cpscontext-fn-args-1) * [`fork(fn, ...args)`](#forkfn-args) * [`fork([context, fn], ...args)`](#forkcontext-fn-args) + * [`fork({context, fn}, ...args)`](#forkcontext-fn-args-1) * [`spawn(fn, ...args)`](#spawnfn-args) * [`spawn([context, fn], ...args)`](#spawncontext-fn-args) * [`join(task)`](#jointask) @@ -474,6 +477,10 @@ invoke object methods. Same as `call([context, fn], ...args)` but supports passing a `fn` as string. Useful for invoking object's methods, i.e. `yield call([localStorage, 'getItem'], 'redux-saga')` +### `call({context, fn}, ...args)` + +Same as `call([context, fn], ...args)` but supports passing `context` and `fn` as properties of an object, i.e. `yield call({context: localStorage, fn: localStorage.getItem}, 'redux-saga')`. `fn` can be a string or a function. + ### `apply(context, fn, [args])` Alias for `call([context, fn], ...args)`. @@ -501,6 +508,10 @@ The middleware remains suspended until `fn` terminates. Supports passing a `this` context to `fn` (object method invocation) +### `cps({context, fn}, ...args)` + +Same as `cps([context, fn], ...args)` but supports passing `context` and `fn` as properties of an object. `fn` can be a string or a function. + ### `fork(fn, ...args)` Creates an Effect description that instructs the middleware to perform a *non-blocking call* on `fn` @@ -543,6 +554,10 @@ To create *detached* forks, use `spawn` instead. Supports invoking forked functions with a `this` context +### `fork({context, fn}, ...args)` + +Same as `fork([context, fn], ...args)` but supports passing `context` and `fn` as properties of an object. `fn` can be a string or a function. + ### `spawn(fn, ...args)` Same as `fork(fn, ...args)` but creates a *detached* task. A detached task remains independent from its parent and acts like
3
diff --git a/src/components/core/slide/slideTo.js b/src/components/core/slide/slideTo.js @@ -63,12 +63,12 @@ export default function (index = 0, speed = this.params.speed, runCallbacks = tr swiper.transitionStart(runCallbacks); if (speed === 0 || Browser.lteIE9) { - swiper.setTranslate(translate); swiper.setTransition(0); + swiper.setTranslate(translate); swiper.transitionEnd(runCallbacks); } else { - swiper.setTranslate(translate); swiper.setTransition(speed); + swiper.setTranslate(translate); if (!swiper.animating) { swiper.animating = true; $wrapperEl.transitionEnd(() => {
12
diff --git a/views/device/index.ejs b/views/device/index.ejs </div> </form> <!-- If the deviceType is not a sensor and is a binary, display on/off button --> - <button ng-show="!type.sensor && type.type == 'binary'" ng-click="vm.changeValue(type, !type.lastValue);" + <!--<button ng-show="!type.sensor && type.type == 'binary'" ng-click="vm.changeValue(type, !type.lastValue);" class="btn {{ type.lastValue && 'btn-danger' || 'btn-success' }} btn-sm"> {{type.lastValue && '<%= __('devices-types-off') %>' || '<%= __('devices-types-on') %>' }} - </button> + </button>--> + <div class="onoffswitch" ng-click="vm.changeValue(type, !type.lastValue);"> + <input type="checkbox" ng-show="!type.sensor && type.type == 'binary'" ng-model="type.lastValue" ng-true-value="1" ng-false-value="0" class="onoffswitch-checkbox" /> + <label class="onoffswitch-label" for="myonoffswitch" ng-show="!type.sensor && type.type == 'binary'"></label> + </div> </td> </tr> </tbody>
14
diff --git a/config/initializers/carto_db.rb b/config/initializers/carto_db.rb @@ -78,7 +78,12 @@ module CartoDB # Raw subdomain extraction from request def self.subdomain_from_request(request) - self.subdomainless_urls? ? '' : request.host.to_s.gsub(self.session_domain, '') + if subdomainless_urls? + '' + else + host = request.host.to_s + host.end_with?(session_domain) ? host.gsub(self.session_domain, '') : '' + end end # Flexible subdomain extraction: If /u/xxx or /user/xxxx present uses it, else uses request host (xxx.carto.com)
7
diff --git a/src/structs/MenuUtils.js b/src/structs/MenuUtils.js @@ -169,7 +169,7 @@ class Menu { addOption (title, desc, inline) { this._embedExists() if (this._curPage && this._curPage.fields.length >= this.maxPerPage) this.addPage() - if (!title && !desc) this._curPage.addBlankField(inline) + if (!title && !desc) this._curPage.addField('\u200b', '\u200b') else { if (title === undefined) throw new Error('Menu Title must be defined') if (desc === undefined) throw new Error('Menu Description must be defined')
1
diff --git a/src/actions/account.js b/src/actions/account.js @@ -519,6 +519,8 @@ export const { signAndSendTransactions, setSignTransactionStatus, sendMoney, tra export const refreshAccount = (basicData = false) => async (dispatch, getState) => { const { flowLimitation } = getState() + + dispatch(setAccountFound(!!wallet.accountId)) await dispatch(refreshAccountOwner(flowLimitation.accountData)) if (!basicData && !flowLimitation.accountBalance) {
12
diff --git a/token-metadata/0x2604FA406Be957E542BEb89E6754fCdE6815e83f/metadata.json b/token-metadata/0x2604FA406Be957E542BEb89E6754fCdE6815e83f/metadata.json "symbol": "PKT", "address": "0x2604FA406Be957E542BEb89E6754fCdE6815e83f", "decimals": 18, - "dharmaVerificationStatus": { "dharmaVerificationStatus": "VERIFIED" } \ No newline at end of file -} \ No newline at end of file
3
diff --git a/character-controller.js b/character-controller.js @@ -1164,12 +1164,9 @@ class LocalPlayer extends UninterpolatedPlayer { /* if (isNaN(this.position.x) || isNaN(this.position.y) || isNaN(this.position.z)) { debugger; } */ - if(!this.lastMatrix.equals(this.matrixWorld)) { self.position.toArray(self.transform); self.quaternion.toArray(self.transform, 3); self.playerMap.set('transform', self.transform); - this.lastMatrix.copy(this.matrixWorld); - } }, 'push'); this.appManager.updatePhysics();
13
diff --git a/python/scripts/indivParc.py b/python/scripts/indivParc.py import os import sys +import numpy as np my_path=os.path.dirname(os.path.realpath(__file__)); sys.path.append(os.path.abspath(my_path+'/../../build/native')); @@ -25,6 +26,7 @@ sys.path.append(os.path.abspath(my_path+'/../../python')); import biswrapper as libbiswasm; import bis_objects as bis + a=len(sys.argv); if a<3 : @@ -42,9 +44,22 @@ fmri=bis.bisImage().load(imagename1); print('++++ \t fmri loaded from',imagename group=bis.bisImage().load(imagename2); print('++++ \t group loaded from',imagename2,' dims=',group.dimensions); print('++++\n calling C++ code\n'); -paramobj= { 'numberofexemplars' : 268 }; +resl_paramobj = { + "interpolation" : 0, + "dimensions" : fmri.dimensions, + "spacing" : fmri.spacing, + "datatype" : "short", + "backgroundValue" : 0.0, +}; + +matr=np.eye(4,dtype=np.float32); +resl_group=libbiswasm.resliceImageWASM(group,matr,resl_paramobj,2); +print('++++ \t group resliced dims=',resl_group.dimensions); + + +paramobj= { 'numberofexemplars' : 368 }; -out_img=libbiswasm.individualizeParcellationWASM(fmri,group,paramobj,2); +out_img=libbiswasm.individualizeParcellationWASM(fmri,resl_group,paramobj,2); out_img.save(output); print('++++\n output saved in ',output);
3
diff --git a/src/js/controllers/buy-bitcoin/payment-methods.controller.js b/src/js/controllers/buy-bitcoin/payment-methods.controller.js @@ -19,6 +19,7 @@ angular // Variables vm.paymentMethod = null; vm.paymentMethods = []; + vm.paymentMethodsAreLoading = true; var initialPaymentMethod = null; @@ -31,7 +32,6 @@ angular // Get the default payment from moon pay service // Here // Update the default payment somewhere else by watching the defaultPayment variable. - vm.paymentMethodsAreLoading = true; moonPayService.getCards().then( function onGetCardsSuccess(cards) {
5
diff --git a/packages/insomnia-app/app/ui/components/wrapper.js b/packages/insomnia-app/app/ui/components/wrapper.js @@ -337,7 +337,7 @@ class Wrapper extends React.PureComponent<Props, State> { message: 'Since you deleted your only workspace, a new one has been created for you.', }); - models.workspace.create({ name: 'Insomnia' }); + await models.workspace.create({ name: 'Insomnia' }); } await models.workspace.remove(activeWorkspace);
1
diff --git a/packages/yoroi-extension/package-lock.json b/packages/yoroi-extension/package-lock.json "dev": true }, "chromedriver": { - "version": "103.0.0", - "resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-103.0.0.tgz", - "integrity": "sha512-7BHf6HWt0PeOHCzWO8qlnD13sARzr5AKTtG8Csn+czsuAsajwPxdLNtry5GPh8HYFyl+i0M+yg3bT43AGfgU9w==", + "version": "100.0.0", + "resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-100.0.0.tgz", + "integrity": "sha512-oLfB0IgFEGY9qYpFQO/BNSXbPw7bgfJUN5VX8Okps9W2qNT4IqKh5hDwKWtpUIQNI6K3ToWe2/J5NdpurTY02g==", "dev": true, "requires": { "@testim/chrome-version": "^1.1.2", - "axios": "^0.27.2", + "axios": "^0.24.0", "del": "^6.0.0", "extract-zip": "^2.0.1", "https-proxy-agent": "^5.0.0", }, "dependencies": { "axios": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", - "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.24.0.tgz", + "integrity": "sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA==", "dev": true, "requires": { - "follow-redirects": "^1.14.9", - "form-data": "^4.0.0" - } - }, - "follow-redirects": { - "version": "1.15.1", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz", - "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==", - "dev": true - }, - "form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" + "follow-redirects": "^1.14.4" } } } } }, "del": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/del/-/del-6.1.1.tgz", - "integrity": "sha512-ua8BhapfP0JUJKC/zV9yHHDW/rDoDxP4Zhn3AkA6/xT6gY7jYXJiaeyBZznYVujhZZET+UgcbZiQ7sN3WqcImg==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/del/-/del-6.0.0.tgz", + "integrity": "sha512-1shh9DQ23L16oXSZKB2JxpL7iMy2E0S9d517ptA1P8iw0alkPtQcrKH7ru31rYtKwF499HkTu+DRzq3TCKDFRQ==", "dev": true, "requires": { "globby": "^11.0.1",
13
diff --git a/app/bg/web-apis/bg/hyperdrive.js b/app/bg/web-apis/bg/hyperdrive.js @@ -507,7 +507,8 @@ export default { var urlp = parseDriveUrl(url) var url = urlp.origin var filepath = normalizeFilepath(urlp.pathname || '') - if (mount.includes('.cap')) throw new Error('Unable to mount capability URLs') + var mountKey = typeof mount === "object" ? mount.key : mount + if (mountKey.includes('.cap')) throw new Error('Unable to mount capability URLs') return auditLog.record(this.sender.getURL(), 'mount', {url, filepath, opts}, undefined, () => ( timer(to(opts), async (checkin, pause, resume) => { checkin('searching for drive')
11
diff --git a/lib/ParserHelpers.js b/lib/ParserHelpers.js @@ -25,8 +25,8 @@ ParserHelpers.addParsedVariableToModule = function(parser, name, expression) { return true; }; -ParserHelpers.toConstantDependency = function toConstantDependency(value) { - return function(expr) { +ParserHelpers.toConstantDependency = function(value) { + return function constDependency(expr) { var dep = new ConstDependency(value, expr.range); dep.loc = expr.loc; this.state.current.addDependency(dep); @@ -34,19 +34,19 @@ ParserHelpers.toConstantDependency = function toConstantDependency(value) { }; }; -ParserHelpers.evaluateToString = function setTypeof(value) { - return function(expr) { +ParserHelpers.evaluateToString = function(value) { + return function stringExpression(expr) { return new BasicEvaluatedExpression().setString(value).setRange(expr.range); }; }; -ParserHelpers.evaluateToBoolean = function setTypeof(value) { - return function(expr) { +ParserHelpers.evaluateToBoolean = function(value) { + return function booleanExpression(expr) { return new BasicEvaluatedExpression().setBoolean(value).setRange(expr.range); }; }; -ParserHelpers.expressionIsUnsupported = function expressionIsUnsupported(message) { +ParserHelpers.expressionIsUnsupported = function(message) { return function unsupportedExpression(expr) { var dep = new ConstDependency("(void 0)", expr.range); dep.loc = expr.loc;
7
diff --git a/package.json b/package.json "scripts": { "lint": "eslint .", "list-contributors": "echo 'clone https://github.com/mgechev/github-contributors-list.git first, then run npm install' && cd ../github-contributors-list && node bin/githubcontrib --owner dherault --repo serverless-offline --sortBy contributions --showlogin true --sortOrder desc > contributors.md", + "prepublishOnly": "npm run lint && npm test", "test": "jest --verbose --silent --runInBand", "test:cov": "jest --coverage --silent --runInBand", "test:log": "jest --verbose"
0
diff --git a/aleph/views/util.py b/aleph/views/util.py @@ -151,11 +151,16 @@ def normalize_href(href, base_url): def jsonify(obj, status=200, headers=None, encoder=JSONEncoder): """Serialize to JSON and also dump from the given schema.""" data = encoder().encode(obj) + mimetype = 'application/json' if 'callback' in request.args: cb = request.args.get('callback') data = '%s && %s(%s)' % (cb, cb, data) - return Response(data, headers=headers, status=status, - mimetype='application/json') + # mime cf. https://stackoverflow.com/questions/24528211/ + mimetype = 'application/javascript' + return Response(data, + headers=headers, + status=status, + mimetype=mimetype) def stream_ijson(iterable, encoder=JSONEncoder):
12
diff --git a/lod.js b/lod.js @@ -7,6 +7,8 @@ const localVector3 = new THREE.Vector3(); const onesLodsArray = new Array(8).fill(1); +const nop = () => {}; + /* note: the nunber of lods at each level can be computed with this function: @@ -80,7 +82,6 @@ export class LodChunkTracker extends EventTarget { this.chunks = []; this.lastUpdateCoord = new THREE.Vector3(NaN, NaN, NaN); - // this.updated = false; if (range) { this.#setRange(range); @@ -102,6 +103,11 @@ export class LodChunkTracker extends EventTarget { async #setRange(range) { await Promise.resolve(); // wait for next tick to emit chunk events + const waitPromises = []; + const waitUntil = p => { + waitPromises.push(p); + }; + /* const _removeOldChunks = () => { for (const chunk of this.chunks) { this.dispatchEvent(new MessageEvent('chunkremove', { @@ -120,6 +126,7 @@ export class LodChunkTracker extends EventTarget { this.dispatchEvent(new MessageEvent('coordupdate', { data: { coord, + waitUntil, }, })); }; @@ -141,6 +148,7 @@ export class LodChunkTracker extends EventTarget { this.dispatchEvent(new MessageEvent('chunkadd', { data: { chunk, + waitUntil, }, })); this.chunks.push(chunk); @@ -150,9 +158,10 @@ export class LodChunkTracker extends EventTarget { }; _addRangeChunks(); - /* if (!this.updated) { - this.updated = true; - } */ + (async () => { + await Promise.all(waitPromises); + this.dispatchEvent(new MessageEvent('update')); + })(); } #getCurrentCoord(position, target) { const cx = Math.floor(position.x / this.chunkSize); @@ -163,6 +172,11 @@ export class LodChunkTracker extends EventTarget { update(position) { if (this.range) throw new Error('lod tracker has range and cannot be updated manually'); + const waitPromises = []; + const waitUntil = p => { + waitPromises.push(p); + }; + const currentCoord = this.#getCurrentCoord(position, localVector); // if we moved across a chunk boundary, update needed chunks @@ -203,6 +217,7 @@ export class LodChunkTracker extends EventTarget { this.dispatchEvent(new MessageEvent('coordupdate', { data: { coord: min2xMin, + waitUntil, }, })); @@ -266,6 +281,7 @@ export class LodChunkTracker extends EventTarget { this.dispatchEvent(new MessageEvent('chunkremove', { data: { chunk: removedChunk, + waitUntil, }, })); this.chunks.splice(this.chunks.indexOf(removedChunk), 1); @@ -274,6 +290,7 @@ export class LodChunkTracker extends EventTarget { this.dispatchEvent(new MessageEvent('chunkadd', { data: { chunk: addedChunk, + waitUntil, }, })); this.chunks.push(addedChunk); @@ -285,6 +302,7 @@ export class LodChunkTracker extends EventTarget { data: { oldChunk, newChunk, + waitUntil, }, })); this.chunks.splice(this.chunks.indexOf(oldChunk), 1); @@ -293,9 +311,11 @@ export class LodChunkTracker extends EventTarget { } this.lastUpdateCoord.copy(currentCoord); - /* if (!this.updated) { - this.updated = true; - } */ + + (async () => { + await Promise.all(waitPromises); + this.dispatchEvent(new MessageEvent('update')); + })(); } } destroy() { @@ -303,6 +323,7 @@ export class LodChunkTracker extends EventTarget { this.dispatchEvent(new MessageEvent('chunkremove', { data: { chunk, + waitUntil: nop, }, })); }
0
diff --git a/templates/examples/extensions/ui_imports/content/CanvasLMSIntegration.json b/templates/examples/extensions/ui_imports/content/CanvasLMSIntegration.json { "qid": "CanvasLMS.enrollments", "a": "Here are the courses you are enrolled in:", + "enableQidIntent": true, "l": "QNA:EXTCanvasLMSHook", "args": [ "{\"Query\": \"CourseEnrollments\"}" { "qid": "CanvasLMS.announcements", "a": "Here are your announcements:", + "enableQidIntent": true, "l": "QNA:EXTCanvasLMSHook", "args": [ "{\"Query\": \"AnnouncementsForStudent\"}"
3
diff --git a/projects/ngx-extended-pdf-viewer/src/lib/sidebar/pdf-sidebar/pdf-sidebar.component.ts b/projects/ngx-extended-pdf-viewer/src/lib/sidebar/pdf-sidebar/pdf-sidebar.component.ts @@ -33,11 +33,13 @@ export class PdfSidebarComponent { const element = this.elementRef.nativeElement as HTMLElement; const buttons = element.querySelectorAll('button'); let visible = 0; - buttons.forEach((b) => { + for (let index = 0; index < buttons.length; index++) { + const b = buttons.item(index); if (!b.hidden) { visible++; } - }); + index++; + } this.hideSidebarToolbar = visible <= 1; this.ref.markForCheck(); }
7
diff --git a/buildScripts/createClass.mjs b/buildScripts/createClass.mjs @@ -94,7 +94,7 @@ if (programOpts.info) { type : 'input', name : 'className', message: 'Please choose the namespace for your class:', - default: 'Covid.view.HeaderContainerModel' + default: 'Covid.view.MyContainer' }); } @@ -104,7 +104,7 @@ if (programOpts.info) { name : 'baseClass', message: 'Please pick the base class, which you want to extend:', choices: ['component.Base', 'container.Base', 'controller.Component', 'core.Base', 'model.Component'], - default: 'model.Component' + default: 'container.Base' }); }
12
diff --git a/local_modules/Exchange/Views/Body.html b/local_modules/Exchange/Views/Body.html <span class="field_title form-field-title" style="margin-top: 17px;">DESTINATION BITCOIN ADDRESS </span> <div class="contactPicker" style="position: relative; width: 100%; user-select: none;"> - <input id="btcAddress" class="full-width longTextInput" type="text" placeholder="Destination BTC Address" autocomplete="off" autocapitalize="none" spellcheck="false" value="3E6iM3nAY2sAyTqx5gF6nnCvqAUtMyRGEm"> + <input id="btcAddress" class="full-width longTextInput" type="text" placeholder="Destination BTC Address" autocomplete="off" autocapitalize="none" spellcheck="false" value=""> </div> </div> - <div class="message-label exchangeRate">Please note that values on this page are <b>estimates only.</b><br> - <br>You will be shown the exact amounts once you create an order. - </div> - <div id="validation-messages"></div> <div id="address-messages"></div> + <div id="server-messages"></div> </div> </div>
2
diff --git a/package.json b/package.json ], "scripts": { "copy-file": "cp dist/CookieMonster.js CookieMonster.js", - "eslint-src": "eslint src", + "eslint-src": "eslint src test", "build": "run-s eslint-src pack-prod remove-comment copy-file test", "build-test": "run-s pack-dev", "pack-prod": "webpack --env production",
0
diff --git a/package.json b/package.json "lint": "vue-cli-service lint --no-fix", "lint-fix": "vue-cli-service lint", "test": "cypress open", - "test-ci": "vue-cli-service test:e2e --headless --browser chrome" + "test-ci": "vue-cli-service test:e2e --mode test --headless --browser chrome" }, "main": "./dist/modeler.common.js", "files": [
12
diff --git a/ui/src/components/time/QTime.json b/ui/src/components/time/QTime.json "examples": [ 15 ] }, "min": { - "type": "Number", + "type": [ "Number", "null" ], "desc": "Minutes", "examples": [ 38 ] }, "sec": { - "type": "Number", + "type": [ "Number", "null" ], "desc": "Seconds", "examples": [ 12 ] }
1