More efficient SortedArray.insert(contentsOf:)

Uses the equivalent of a single pass of a merge-sort to make the SortedArray.insert(contentsOf:) more efficient.
This allows the algorithm to go from O((a+b) log(a+b)) to O(a + b log (b)). Where a is the size of the current array, and b is the size of the new elements. If b is already sorted (i.e. another SortedArray) then an efficient sort function will mean this runs in O(a + b).
The new performance tests should demonstrate the improvements when compared, assuming the element count is suitably large:

testPerformanceOfSortedArrayInsertWithDuplicates()
testPerformanceOfSortedArrayInsertContentsOfWithDuplicates()

Note I needed to add -swift-version 3 to Other Swift Flags
Note Insertion times are negligible for a magnitude of less than 1000. Performance on my machine is actually slightly worse for a magnitude less than 1000. However it gets significantly better for values of magnitude higher than 1000. I suspect this is because of elements.append(contentsOf: newElements) and constant overheads.

Can you also post the perf results with and without your patch?

Before Patch
testPerformanceOfSortedArrayInsertWithDuplicates: 0.030 seconds
testPerformanceOfSortedArrayInsertContentsOfWithDuplicates: 0.033 seconds

After Patch
testPerformanceOfSortedArrayInsertWithDuplicates: 0.030 seconds
testPerformanceOfSortedArrayInsertContentsOfWithDuplicates: 0.026 seconds

So 0.788% of the original time.
Raw output Before
Test Suite 'BasicPerformanceTests.xctest' started at 2017-05-19 07:36:26.510
Test Suite 'SortedArrayPerfTests' started at 2017-05-19 07:36:26.510
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInAscendingOrder]' started.
<unknown>:0: Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInAscendingOrder]' measured [Time, seconds] average: 0.001, relative standard deviation: 22.328%, values: [0.001628, 0.001218, 0.000962, 0.000961, 0.000961, 0.000939, 0.000854, 0.000893, 0.000884, 0.000857], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInAscendingOrder]' passed (0.400 seconds).
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertContentsOfWithDuplicates]' started.
<unknown>:0: Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertContentsOfWithDuplicates]' measured [Time, seconds] average: 0.033, relative standard deviation: 13.649%, values: [0.039102, 0.029542, 0.026896, 0.028125, 0.031120, 0.037950, 0.040461, 0.034373, 0.035334, 0.030393], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertContentsOfWithDuplicates]' passed (0.590 seconds).
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertWithDuplicates]' started.
<unknown>:0: Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertWithDuplicates]' measured [Time, seconds] average: 0.030, relative standard deviation: 10.156%, values: [0.036232, 0.029010, 0.029690, 0.029673, 0.033373, 0.025381, 0.030920, 0.026916, 0.028370, 0.027521], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertWithDuplicates]' passed (0.550 seconds).
Test Suite 'SortedArrayPerfTests' passed at 2017-05-19 07:36:28.052.
	 Executed 3 tests, with 0 failures (0 unexpected) in 1.540 (1.541) seconds
Test Suite 'BasicPerformanceTests.xctest' passed at 2017-05-19 07:36:28.052.
	 Executed 3 tests, with 0 failures (0 unexpected) in 1.540 (1.542) seconds

Raw output After
Test Suite 'BasicPerformanceTests.xctest' started at 2017-05-19 07:28:24.253
Test Suite 'SortedArrayPerfTests' started at 2017-05-19 07:28:24.253
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInAscendingOrder]' started.
<unknown>:0: Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInAscendingOrder]' measured [Time, seconds] average: 0.001, relative standard deviation: 22.369%, values: [0.001597, 0.000966, 0.000927, 0.000856, 0.000856, 0.000856, 0.000905, 0.000860, 0.000902, 0.000881], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInAscendingOrder]' passed (0.409 seconds).
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertContentsOfWithDuplicates]' started.
<unknown>:0: Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertContentsOfWithDuplicates]' measured [Time, seconds] average: 0.026, relative standard deviation: 5.713%, values: [0.027127, 0.026573, 0.024120, 0.025614, 0.023618, 0.027691, 0.023619, 0.026337, 0.026330, 0.024002], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertContentsOfWithDuplicates]' passed (0.509 seconds).
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertWithDuplicates]' started.
<unknown>:0: Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertWithDuplicates]' measured [Time, seconds] average: 0.030, relative standard deviation: 6.425%, values: [0.031083, 0.028376, 0.028500, 0.030827, 0.028190, 0.031095, 0.030869, 0.032336, 0.027447, 0.033804], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertWithDuplicates]' passed (0.554 seconds).
Test Suite 'SortedArrayPerfTests' passed at 2017-05-19 07:28:25.727.
	 Executed 3 tests, with 0 failures (0 unexpected) in 1.472 (1.473) seconds
Test Suite 'BasicPerformanceTests.xctest' passed at 2017-05-19 07:28:25.727.
	 Executed 3 tests, with 0 failures (0 unexpected) in 1.472 (1.474) seconds

Worth noting, if magnitude is changed to 500, then the output is:
Before Patch
testPerformanceOfSortedArrayInsertWithDuplicates: 0.002 seconds
testPerformanceOfSortedArrayInsertContentsOfWithDuplicates: 0.003 seconds

After Patch
testPerformanceOfSortedArrayInsertWithDuplicates: 0.002 seconds
testPerformanceOfSortedArrayInsertContentsOfWithDuplicates: 0.004 seconds

If however we fall back to the old approach when elements is less than 1000 then this works fine (see 2266a40):
testPerformanceOfSortedArrayInsertWithDuplicates: 0.002 seconds
testPerformanceOfSortedArrayInsertContentsOfWithDuplicates: 0.002 seconds

However the derivation of 1000 is a little dodgy.
Note that this performs a little better than it used to, probably because:
- elements.append(contentsOf: newElements)
+ elements.append(contentsOf: newElements.sorted(by: areInIncreasingOrder))
  elements.sort(by: areInIncreasingOrder)

By moving the initialisation and starting data into the measure block we are also measuring the complexity of sorting that original data. So it goes from being O(a+b log(b)) to O(a log(a) + a + b log(b)), this may make it hard to see improvements if it's tweaked further.

Before Patch
testPerformanceOfSortedArrayInAscendingOrder: 0.003 seconds
testPerformanceOfSortedArrayInsertWithDuplicates: 0.063 seconds
testPerformanceOfSortedArrayInsertContentsOfWithDuplicates: 0.033 seconds

After Patch
testPerformanceOfSortedArrayInAscendingOrder: 0.004 seconds
testPerformanceOfSortedArrayInsertWithDuplicates: 0.067 seconds
testPerformanceOfSortedArrayInsertContentsOfWithDuplicates: 0.026 seconds

Raw output
Before
Test Suite 'BasicPerformanceTests.xctest' started at 2017-05-19 09:42:53.671
Test Suite 'SortedArrayPerfTests' started at 2017-05-19 09:42:53.672
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInAscendingOrder]' started.
<unknown>:0: Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInAscendingOrder]' measured [Time, seconds] average: 0.003, relative standard deviation: 20.383%, values: [0.003794, 0.002829, 0.002442, 0.002333, 0.002206, 0.002250, 0.002311, 0.003675, 0.003311, 0.002992], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInAscendingOrder]' passed (0.431 seconds).
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertContentsOfWithDuplicates]' started.
<unknown>:0: Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertContentsOfWithDuplicates]' measured [Time, seconds] average: 0.060, relative standard deviation: 43.386%, values: [0.022566, 0.030910, 0.038230, 0.046657, 0.053338, 0.057295, 0.069899, 0.078052, 0.088518, 0.109850], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertContentsOfWithDuplicates]' passed (0.863 seconds).
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertWithDuplicates]' started.
<unknown>:0: Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertWithDuplicates]' measured [Time, seconds] average: 0.063, relative standard deviation: 52.654%, values: [0.017970, 0.025242, 0.031361, 0.042096, 0.054360, 0.064290, 0.076851, 0.091277, 0.108693, 0.117150], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertWithDuplicates]' passed (0.896 seconds).
Test Suite 'SortedArrayPerfTests' passed at 2017-05-19 09:42:55.862.
	 Executed 3 tests, with 0 failures (0 unexpected) in 2.190 (2.191) seconds
Test Suite 'BasicPerformanceTests.xctest' passed at 2017-05-19 09:42:55.863.
	 Executed 3 tests, with 0 failures (0 unexpected) in 2.190 (2.191) seconds

Raw output After
Test Suite 'BasicPerformanceTests.xctest' started at 2017-05-19 09:45:47.595
Test Suite 'SortedArrayPerfTests' started at 2017-05-19 09:45:47.596
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInAscendingOrder]' started.
<unknown>:0: Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInAscendingOrder]' measured [Time, seconds] average: 0.004, relative standard deviation: 10.672%, values: [0.002943, 0.003683, 0.003919, 0.003859, 0.003769, 0.003439, 0.003296, 0.003545, 0.004154, 0.004366], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInAscendingOrder]' passed (0.431 seconds).
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertContentsOfWithDuplicates]' started.
<unknown>:0: Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertContentsOfWithDuplicates]' measured [Time, seconds] average: 0.026, relative standard deviation: 20.954%, values: [0.018356, 0.021547, 0.022442, 0.023262, 0.024341, 0.023504, 0.026759, 0.027805, 0.034292, 0.036708], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertContentsOfWithDuplicates]' passed (0.525 seconds).
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertWithDuplicates]' started.
<unknown>:0: Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertWithDuplicates]' measured [Time, seconds] average: 0.067, relative standard deviation: 49.136%, values: [0.023819, 0.028523, 0.033497, 0.044978, 0.058423, 0.071664, 0.079276, 0.098499, 0.110367, 0.118998], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertWithDuplicates]' passed (0.934 seconds).
Test Suite 'SortedArrayPerfTests' passed at 2017-05-19 09:45:49.486.
	 Executed 3 tests, with 0 failures (0 unexpected) in 1.890 (1.891) seconds
Test Suite 'BasicPerformanceTests.xctest' passed at 2017-05-19 09:45:49.487.
	 Executed 3 tests, with 0 failures (0 unexpected) in 1.890 (1.891) seconds

Before Patch
testPerformanceOfSortedArrayInAscendingOrder: 0.003 seconds
testPerformanceOfSortedArrayInsertWithDuplicates: 0.063 seconds
testPerformanceOfSortedArrayInsertContentsOfWithDuplicates: 0.033 seconds

After Patch
testPerformanceOfSortedArrayInAscendingOrder: 0.004 seconds
testPerformanceOfSortedArrayInsertWithDuplicates: 0.067 seconds
testPerformanceOfSortedArrayInsertContentsOfWithDuplicates: 0.026 seconds

Raw output
Before
Test Suite 'BasicPerformanceTests.xctest' started at 2017-05-19 09:42:53.671
Test Suite 'SortedArrayPerfTests' started at 2017-05-19 09:42:53.672
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInAscendingOrder]' started.
<unknown>:0: Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInAscendingOrder]' measured [Time, seconds] average: 0.003, relative standard deviation: 20.383%, values: [0.003794, 0.002829, 0.002442, 0.002333, 0.002206, 0.002250, 0.002311, 0.003675, 0.003311, 0.002992], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInAscendingOrder]' passed (0.431 seconds).
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertContentsOfWithDuplicates]' started.
<unknown>:0: Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertContentsOfWithDuplicates]' measured [Time, seconds] average: 0.060, relative standard deviation: 43.386%, values: [0.022566, 0.030910, 0.038230, 0.046657, 0.053338, 0.057295, 0.069899, 0.078052, 0.088518, 0.109850], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertContentsOfWithDuplicates]' passed (0.863 seconds).
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertWithDuplicates]' started.
<unknown>:0: Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertWithDuplicates]' measured [Time, seconds] average: 0.063, relative standard deviation: 52.654%, values: [0.017970, 0.025242, 0.031361, 0.042096, 0.054360, 0.064290, 0.076851, 0.091277, 0.108693, 0.117150], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertWithDuplicates]' passed (0.896 seconds).
Test Suite 'SortedArrayPerfTests' passed at 2017-05-19 09:42:55.862.
	 Executed 3 tests, with 0 failures (0 unexpected) in 2.190 (2.191) seconds
Test Suite 'BasicPerformanceTests.xctest' passed at 2017-05-19 09:42:55.863.
	 Executed 3 tests, with 0 failures (0 unexpected) in 2.190 (2.191) seconds

Raw output After
Test Suite 'BasicPerformanceTests.xctest' started at 2017-05-19 09:45:47.595
Test Suite 'SortedArrayPerfTests' started at 2017-05-19 09:45:47.596
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInAscendingOrder]' started.
<unknown>:0: Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInAscendingOrder]' measured [Time, seconds] average: 0.004, relative standard deviation: 10.672%, values: [0.002943, 0.003683, 0.003919, 0.003859, 0.003769, 0.003439, 0.003296, 0.003545, 0.004154, 0.004366], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInAscendingOrder]' passed (0.431 seconds).
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertContentsOfWithDuplicates]' started.
<unknown>:0: Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertContentsOfWithDuplicates]' measured [Time, seconds] average: 0.026, relative standard deviation: 20.954%, values: [0.018356, 0.021547, 0.022442, 0.023262, 0.024341, 0.023504, 0.026759, 0.027805, 0.034292, 0.036708], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertContentsOfWithDuplicates]' passed (0.525 seconds).
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertWithDuplicates]' started.
<unknown>:0: Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertWithDuplicates]' measured [Time, seconds] average: 0.067, relative standard deviation: 49.136%, values: [0.023819, 0.028523, 0.033497, 0.044978, 0.058423, 0.071664, 0.079276, 0.098499, 0.110367, 0.118998], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertWithDuplicates]' passed (0.934 seconds).
Test Suite 'SortedArrayPerfTests' passed at 2017-05-19 09:45:49.486.
	 Executed 3 tests, with 0 failures (0 unexpected) in 1.890 (1.891) seconds
Test Suite 'BasicPerformanceTests.xctest' passed at 2017-05-19 09:45:49.487.
	 Executed 3 tests, with 0 failures (0 unexpected) in 1.890 (1.891) seconds

Before Patch
testPerformanceOfSortedArrayInAscendingOrder: 0.177 seconds
testPerformanceOfSortedArrayInsertWithDuplicates: 0.173 seconds
testPerformanceOfSortedArrayInsertContentsOfWithDuplicates: 0.696 seconds

After Patch
testPerformanceOfSortedArrayInAscendingOrder: 0.168 seconds
testPerformanceOfSortedArrayInsertWithDuplicates: 0.190 seconds
testPerformanceOfSortedArrayInsertContentsOfWithDuplicates: 0.115 seconds

Approximately 6x faster when inserting 120k elements.

Raw output
MacBook Pro (15-inch, 2016)
Processor 2.9 GHz Intel Core i7
Memory 16 GB 2133 MHz LPDDR3
Before
Test Suite 'BasicPerformanceTests.xctest' started at 2017-05-20 15:59:18.617
Test Suite 'SortedArrayPerfTests' started at 2017-05-20 15:59:18.618
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInAscendingOrder]' started.
<unknown>:0: Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInAscendingOrder]' measured [Time, seconds] average: 0.177, relative standard deviation: 6.793%, values: [0.195258, 0.174077, 0.174679, 0.162672, 0.165435, 0.161480, 0.183101, 0.175643, 0.183564, 0.198078], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInAscendingOrder]' passed (2.185 seconds).
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertContentsOfWithDuplicates]' started.
<unknown>:0: Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertContentsOfWithDuplicates]' measured [Time, seconds] average: 0.697, relative standard deviation: 5.765%, values: [0.741566, 0.787225, 0.687312, 0.735242, 0.669538, 0.672430, 0.665429, 0.665560, 0.665474, 0.684869], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertContentsOfWithDuplicates]' passed (7.332 seconds).
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertWithDuplicates]' started.
<unknown>:0: Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertWithDuplicates]' measured [Time, seconds] average: 0.173, relative standard deviation: 3.063%, values: [0.183484, 0.177784, 0.169589, 0.170431, 0.171640, 0.178103, 0.175342, 0.168238, 0.166975, 0.166899], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertWithDuplicates]' passed (2.050 seconds).
Test Suite 'SortedArrayPerfTests' passed at 2017-05-20 15:59:30.185.
	 Executed 3 tests, with 0 failures (0 unexpected) in 11.567 (11.568) seconds
Test Suite 'BasicPerformanceTests.xctest' passed at 2017-05-20 15:59:30.186.
	 Executed 3 tests, with 0 failures (0 unexpected) in 11.567 (11.568) seconds

Raw output After
Test Suite 'BasicPerformanceTests.xctest' started at 2017-05-20 15:55:53.085
Test Suite 'SortedArrayPerfTests' started at 2017-05-20 15:55:53.085
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInAscendingOrder]' started.
<unknown>:0: Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInAscendingOrder]' measured [Time, seconds] average: 0.168, relative standard deviation: 5.091%, values: [0.189286, 0.165803, 0.164622, 0.161915, 0.164615, 0.161091, 0.173389, 0.175870, 0.161894, 0.161837], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInAscendingOrder]' passed (2.062 seconds).
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertContentsOfWithDuplicates]' started.
<unknown>:0: Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertContentsOfWithDuplicates]' measured [Time, seconds] average: 0.115, relative standard deviation: 6.308%, values: [0.128369, 0.111599, 0.107960, 0.107864, 0.112840, 0.112087, 0.108222, 0.119839, 0.119086, 0.126956], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertContentsOfWithDuplicates]' passed (1.514 seconds).
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertWithDuplicates]' started.
<unknown>:0: Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertWithDuplicates]' measured [Time, seconds] average: 0.190, relative standard deviation: 5.653%, values: [0.199465, 0.192225, 0.185505, 0.173062, 0.197758, 0.177118, 0.174371, 0.199465, 0.201251, 0.197967], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertWithDuplicates]' passed (2.225 seconds).
Test Suite 'SortedArrayPerfTests' passed at 2017-05-20 15:55:58.887.
	 Executed 3 tests, with 0 failures (0 unexpected) in 5.801 (5.802) seconds
Test Suite 'BasicPerformanceTests.xctest' passed at 2017-05-20 15:55:58.888.
	 Executed 3 tests, with 0 failures (0 unexpected) in 5.801 (5.803) seconds

Before Patch
testPerformanceOfSortedArrayInAscendingOrder: 0.177 seconds
testPerformanceOfSortedArrayInsertWithDuplicates: 0.173 seconds
testPerformanceOfSortedArrayInsertContentsOfWithDuplicates: 0.696 seconds

After Patch
testPerformanceOfSortedArrayInAscendingOrder: 0.168 seconds
testPerformanceOfSortedArrayInsertWithDuplicates: 0.190 seconds
testPerformanceOfSortedArrayInsertContentsOfWithDuplicates: 0.115 seconds

Approximately 6x faster when inserting 120k elements.

Raw output
MacBook Pro (15-inch, 2016)
Processor 2.9 GHz Intel Core i7
Memory 16 GB 2133 MHz LPDDR3
Before
Test Suite 'BasicPerformanceTests.xctest' started at 2017-05-20 15:59:18.617
Test Suite 'SortedArrayPerfTests' started at 2017-05-20 15:59:18.618
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInAscendingOrder]' started.
<unknown>:0: Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInAscendingOrder]' measured [Time, seconds] average: 0.177, relative standard deviation: 6.793%, values: [0.195258, 0.174077, 0.174679, 0.162672, 0.165435, 0.161480, 0.183101, 0.175643, 0.183564, 0.198078], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInAscendingOrder]' passed (2.185 seconds).
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertContentsOfWithDuplicates]' started.
<unknown>:0: Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertContentsOfWithDuplicates]' measured [Time, seconds] average: 0.697, relative standard deviation: 5.765%, values: [0.741566, 0.787225, 0.687312, 0.735242, 0.669538, 0.672430, 0.665429, 0.665560, 0.665474, 0.684869], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertContentsOfWithDuplicates]' passed (7.332 seconds).
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertWithDuplicates]' started.
<unknown>:0: Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertWithDuplicates]' measured [Time, seconds] average: 0.173, relative standard deviation: 3.063%, values: [0.183484, 0.177784, 0.169589, 0.170431, 0.171640, 0.178103, 0.175342, 0.168238, 0.166975, 0.166899], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertWithDuplicates]' passed (2.050 seconds).
Test Suite 'SortedArrayPerfTests' passed at 2017-05-20 15:59:30.185.
	 Executed 3 tests, with 0 failures (0 unexpected) in 11.567 (11.568) seconds
Test Suite 'BasicPerformanceTests.xctest' passed at 2017-05-20 15:59:30.186.
	 Executed 3 tests, with 0 failures (0 unexpected) in 11.567 (11.568) seconds

Raw output After
Test Suite 'BasicPerformanceTests.xctest' started at 2017-05-20 15:55:53.085
Test Suite 'SortedArrayPerfTests' started at 2017-05-20 15:55:53.085
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInAscendingOrder]' started.
<unknown>:0: Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInAscendingOrder]' measured [Time, seconds] average: 0.168, relative standard deviation: 5.091%, values: [0.189286, 0.165803, 0.164622, 0.161915, 0.164615, 0.161091, 0.173389, 0.175870, 0.161894, 0.161837], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInAscendingOrder]' passed (2.062 seconds).
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertContentsOfWithDuplicates]' started.
<unknown>:0: Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertContentsOfWithDuplicates]' measured [Time, seconds] average: 0.115, relative standard deviation: 6.308%, values: [0.128369, 0.111599, 0.107960, 0.107864, 0.112840, 0.112087, 0.108222, 0.119839, 0.119086, 0.126956], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertContentsOfWithDuplicates]' passed (1.514 seconds).
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertWithDuplicates]' started.
<unknown>:0: Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertWithDuplicates]' measured [Time, seconds] average: 0.190, relative standard deviation: 5.653%, values: [0.199465, 0.192225, 0.185505, 0.173062, 0.197758, 0.177118, 0.174371, 0.199465, 0.201251, 0.197967], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSortedArrayInsertWithDuplicates]' passed (2.225 seconds).
Test Suite 'SortedArrayPerfTests' passed at 2017-05-20 15:55:58.887.
	 Executed 3 tests, with 0 failures (0 unexpected) in 5.801 (5.802) seconds
Test Suite 'BasicPerformanceTests.xctest' passed at 2017-05-20 15:55:58.888.
	 Executed 3 tests, with 0 failures (0 unexpected) in 5.801 (5.803) seconds

The last of your feedback should be addressed by 2f9d9fc, sorry to have iterated beyond your suggestions 😬. Thank you very much for your review!

@aciidb0mb3r The last of your feedback should be addressed by 2f9d9fc, sorry to have iterated beyond your suggestions 😬. Thank you very much for your review!

@therealbnut Thanks a lot! This looks good.
@ddunbar can you also take a look?

testPerformanceOfSmallSortedArrayInsertContentsOfWithDuplicates: 0.143 seconds

Raw output
MacBook Pro (15-inch, 2016)
Processor 2.9 GHz Intel Core i7
Memory 16 GB 2133 MHz LPDDR3
Test Suite 'BasicPerformanceTests.xctest' started at 2017-05-20 16:24:35.969
Test Suite 'SortedArrayPerfTests' started at 2017-05-20 16:24:35.969
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSmallSortedArrayInsertContentsOfWithDuplicates]' started.
<unknown>:0: Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSmallSortedArrayInsertContentsOfWithDuplicates]' measured [Time, seconds] average: 0.143, relative standard deviation: 6.344%, values: [0.158023, 0.156586, 0.140530, 0.129020, 0.132913, 0.142247, 0.133893, 0.146911, 0.143887, 0.146193], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[BasicPerformanceTests.SortedArrayPerfTests testPerformanceOfSmallSortedArrayInsertContentsOfWithDuplicates]' passed (1.797 seconds).
Test Suite 'SortedArrayPerfTests' passed at 2017-05-20 16:24:37.766.
	 Executed 1 test, with 0 failures (0 unexpected) in 1.797 (1.797) seconds
Test Suite 'BasicPerformanceTests.xctest' passed at 2017-05-20 16:24:37.767.
	 Executed 1 test, with 0 failures (0 unexpected) in 1.797 (1.798) seconds

@aciidb0mb3r I've removed the guard (see my comments inline), I'm not sure if you still want to summon @ddunbar, or if unsummoning is a thing...
Thanks again 🙂

Thanks! I still want @ddunbar to take a look. I heard he likes perf improvements.

@ddunbar fixed in 3eb1c81, I ran it with fatalError() instead of break and both are triggered.

@therealbnut what I meant was to add a test which does an append using something where startIndex != 0 (for example an ArraySlice), which should cause the sort to be wrong w/o the change.

@ddunbar sorry, it may have been confusing because newElements is shadowed. It's a new Array, regardless of the type of the input argument. I considered doing an in-place implementation, but I still need working memory, and it ends up being about the same.

@therealbnut ah, right didn't think about that. It's probably still worth having test coverage of an ArraySlice, but ya I see its not a correctness issue.

@ddunbar I've added a test for ArraySlice, it should guard against a similar correctness issue being introduced in future.

@swift-ci please smoke test

@swift-ci please smoke test

@aciidb0mb3r @ddunbar thank you very much for your reviews :)

@aciidb0mb3r I notice you didn't squash the commits before merging, am I meant to have done anything differently there? Most other commits on master appear to be singular.
I've pushed one last commit to this branch, it's not really necessary, but if you want it I can put it up for PR: e87bb696d33d4edf13c50a51fc4d383f9aeb30e7 (or you can cherry-pick it)

I made a mistake and didn't realize the commits were not squashed before merging.
At my work we have GitHub settings to enforce squash, fast-forward, CI, and no separate merge commits. It works really well for us. Let me know if you want me to relay our settings :)

I was concerned with my ill-thought out commit messages making it to master for all time, lol

I don't want to enforce github's squash option because it'll force you to squash when you actually want to push multiple commits. I just need to be more careful when merging PRs :)

@aciidb0mb3r ah ok, that's a valid concern. You can actually choose which option you want on the "close/merge" button, there's a drop-down where you can choose not to squash. I'm not sure if you need the other GitHub settings to get that or not.

Yeah, thats what I meant to say, I forgot to squash while merging this PR.

Yeah, sorry, I meant that I think you can make squash the default.


Specify encoding to UTF-8 when opening source file

Hi there, new user here.
I am just a normal user using this tool to update hosts file. In my Windows machine, I have trouble updating hosts file running updateHostsWindows.bat.
... (All the Updating sorce data\xxx messages)
Updating source data\malwaredomainlist.com from https://www.malwaredomainlist.com/hostslist/hosts.txt
Updating source data\mvps.org from http://winhelp2002.mvps.org/hosts.txt
Traceback (most recent call last):
  File "updateHostsFile.py", line 1525, in <module>
    main()
  File "updateHostsFile.py", line 164, in main
    update_all_sources(source_data_filename, settings["hostfilename"])
  File "updateHostsFile.py", line 590, in update_all_sources
    update_data = json.load(update_file)
  File "C:\Program Files\Python37\lib\json\__init__.py", line 293, in load
    return loads(fp.read(),
UnicodeDecodeError: 'cp932' codec can't decode byte 0x93 in position 29: illegal multibyte sequence
        1 file(s) copied.

I guess this happens since I am using CJKV language options in Windows and Python follows it.
My fix to the issue is specifying encoding to UTF-8. Please see if the 'fix' is acceptable or not.

Updated utf8 to UTF-8 as requested.
But I am not really sure about how does it avoid confusion - do you mean you would prefer git grep -i utf8 would find nothing while git grep -i UTF-8 find all related codes to encoding?

@ghostduck, let's say that it is a good practice to unify such things as it can be confusing.
I'm not talking about experienced developer (even if it can also happen) but new developer who try to learn or understand with our source code.
I'm not against taking the time to answer questions per issues but with our scale I'm more concerned about escalation as some issues can escalate really fast. And it is really bad the kind of escalation we have here sometimes.


conditional return work in browser, but not on Android phone

Description
Working on a React Native app in Expo, I am encountering a strange problem: everything is fine in browser preview, but on the phone, the conditional return does not happen.

### Version

0.69.5

### Output of `npx react-native info`

info Fetching system and libraries information...
System:
    OS: Linux 5.15 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish)
    CPU: (4) x64 Intel(R) Core(TM) i5-4300M CPU @ 2.60GHz
    Memory: 3.67 GB / 7.66 GB
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 17.8.0 - ~/.nvm/versions/node/v17.8.0/bin/node
    Yarn: Not Found
    npm: 8.5.5 - ~/.nvm/versions/node/v17.8.0/bin/npm
    Watchman: Not Found
  SDKs:
    Android SDK: Not Found
  IDEs:
    Android Studio: Not Found
  Languages:
    Java: 11.0.16 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.0.0 => 18.0.0
    react-native: 0.69.5 => 0.69.5
  npmGlobalPackages:
    *react-native*: Not Found

### Steps to reproduce

1. clone the repository
2. run nvm use --lts && expo start
3. open the app on an android phone Expo app
4. click 'next' on the first page (count 0)
5. type in 'August' and click on 'submit' on the second page (count 1)

### Snack, code example, screenshot, or link to a repository

https://github.com/ydrea/rnthegame.git

AGame.js

return (

{search === sculpture.name ? (

) : (

{count}

)}

);

solved it in a roundabout manner...
  //submit query to search
  const handleSubmit = () => {
    searchSet(query);
    //flip the switches
    checkSet(true);
    querySet("");
  };
  //a bit of...
  useEffect(() => {
    //...cleanup for the next one
    checkSet(false);
  }, [count]);
  //
  return (...
<View>
          {!check ? (
            <Text>{count}</Text>
          ) : (
            <View>
              <RCard sculpture={sculpture} />
            </View>
          )}
        </View>


new Blob not working in Safari.

I have used new Blob to save file in angular.
var textData='test';
var data = new Blob([textData], { type: 'application/xhtml+xml;charset=utf-8' });.
I get below error.
[object BlobConstructor]' is not a constructor (evaluating 'new Blob([creativeHtml], { type: 'application/xhtml+xml;charset=utf-8' })')

inject "Blob.js"

make sure you use angular-file-saver.bundle.js to include the extra libraries and polyfills and then as Wug said, inject Blob in your controller

FYI, I tried the library but was not able to make it work on Chrome.
Error: Blob is not a constructor
I'm bundling angular-file-saver.bundle.js and injecting FileSaver and Blob as dependencies inside my controller.
Anyway, removing the Blob dependency works, but I get Cannot read property 'saveAs' of undefined, on the FileSaver object.
Looks like this library is broken.


Level 4 not working as expected in Ubuntu 18.04

The solution for level4 should be just committing the README file that is already in the staging area. I did committed the staging area and git log shows that the commit is successful but the githug play is not accepting it as solution. I am attaching the screenshot of the issue.

I found that it is due to name of the branch. It works only when branch name is master. So change it to support any branch name.

In the level 16 also same problem.

I had the exact same issue. Worked after creating a new branch with the name 'master'.

我发现这是由于分支的名称。仅当分支名称为 master 时，它才有效。因此，请更改它以支持任何分支名称。

为什么我在master分支也无法解决这个问题

I found that it is due to name of the branch. It works only when branch name is master. So change it to support any branch name.
Why can't I solve this problem on branch master?


Question about serial port

Hi.  Can I directly use the serial port of my pc (db9), rather than using the USB ttl converter?

I don't know.
But probably you need db9 ttl converter.

Thank you for your reply.


Experimental: sparser asteroids and benevolent nebula

Addresses #8:

spread asteroids sparsely instead of one large block, makes starting pos being blocked much less likely, and imo looks much better, additionally the pathfinding problem seems more interesting here
remove static maps where asteroids / nebula never move, these can cause unplayable maps with bad spawns (and the slowest move speed is fairly static)
make nebula benevolent, it recharges ships - right now nebular is just like asteroids in many cases as entering it costs too much energy, this makes starting positions covered in nebula unplayable

Making nebula a positive thing is probably good game design-wise too: units have a reason to enter it and stay there to gain energy. Inside, however, they are sitting ducks that can be attacked and sapped without them seeing it coming. Risk-reward, while currently it is always just bad to be in it.
Example for seed==1:
Before

After

thanks, I will take a look, our team will make some decisions over map generation soon, but this seems better.

with respect to the nebula stuff, im not sure yet. I'd be okay with saying 80% of the time it doesn't affect energy and 20% it is negative or positive maybe. On some games it should be treated as an obstacle and on others perhaps not as an obstacle.

It's a good point, I removed the nebula effect on energy (always 0 now).

Our team is still unsure about whether we should change nebula. We are happy about the map gen change and no static maps changes for now though. Could you remove the change for the nebula energy?

Done, set it back to [0, 10, 100]. :+1:


Handle arguments in the $EDITOR or $VISUAL env variable

On OSX, users will typically use subl -w to use sublime tet on
blocking mode, though this will be passed ass it to subprocess.call
leading to the subl -w command not found.
See ipython/ipython#9929
this should fix that. It would affect users with actual space on the
path of their editor executable, but I'm unsure how to handle both case.
It seem to me like passing flags would be the most common use case.
Workaround is to tell users to create an shim executable which pass the
options.

Merged in: https://github.com/jonathanslenders/python-prompt-toolkit/commit/8b7d360f4f8c9dc47b87c339e05129b1333e12d0
Thank you @Carreau!


[stable/phpbb] fix upgrading existing deployments

What this PR does / why we need it:
In https://github.com/helm/charts/pull/17307 the apiVersion of the deployment resource was
updated to apps/v1 in tune with the api's deprecated in k8s 1.16. This change however breaks
upgradability of existing phpbb deployments with helm v3 (rc) as described in
https://github.com/helm/helm/issues/6646.
To fix this, we have defined a phpbb.deployment.apiVersion helper that returns the new
apiVersion only when k8s 1.16 or higher is in use.
Checklist
[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]

[x] DCO signed
[x] Chart Version bumped
[x] Variables are documented in the README.md
[x] Title of the PR starts with chart name (e.g. [stable/mychartname])

On hold until https://github.com/helm/charts/pull/18704 is merged, after which dependencies will be updated in this PR.
/hold


free print progress

print_progress on the progress bars is a private function but if one desires to implement their own multi progress bar it's not easy without forking the project (as one can't externally declare a friend).
Is it really necessary for the function to be private?
I think there are legitimate use-cases not covered by the multi-progress implementations.

print_progress is now public.


unresponsive height / distorted prompt outputs

Dear @mgeier,
this package is amazing and has been very handy in auto-converting my notebooks.
Until version 0.3.5, prompt output figures had a fixed shape. After 0.4.0 it got a responsive width. However, the height is yet unresponsive, such that my figures here get quite distorted once they don't fit to the screen width anymore.
Would very much appreciate any help on that.
Best
Volker

I don't quite know what you mean, can you please clarify?
Probably some screenshots would help?

Thanks for the quick response. The documentation is hosted here. On the full-screen browser the converted notebook is displayed correctly here, while on a smaller screen or mobile it looks like this:
.
Widths of images change dynamically with screen size, while heights stay fixed.

Was spending quite some time trying to figure out how to fix that, unsuccessfully. It works perfectly with thumbnail galleries. So that should be easily solvable, I just can't figure out how.

Thanks for the screenshot, now I know what's going on!
The problem occurs when the images in code cell outputs have width and height metadata.
For example, this happens when using png2x/retina as print option.
The nbsphinx docs show the same problem in the last plot example: https://nbsphinx.readthedocs.io/en/0.7.0/code-cells.html#Plots.
One work-around would be to avoid this metadata, e.g. by using SVG plots.
The problem can be easily reproduced in a RST file, without the involvement of nbsphinx:
.. image:: https://www.python.org/static/img/python-logo-large.png
   :width: 844
   :height: 1048

I think this is actually a bug in the Sphinx HTML theme.
I don't know what a reasonable solution would be, any ideas?

Awesome, running with svg solves it! Thanks, should have asked you before spending hours on this.

svg is not satisfactory, unfortunately, because the html page loads very slowly.
Do you know of any possibility to remove the metadata? And do you have any clue, why it used to work perfectly with nbsphinx v0.3.5 (which is the only version where it adjusted png's correctly).

svg is not satisfactory, unfortunately, because the html page loads very slowly.

You could try using the "rasterization" feature of Matplotlib: https://matplotlib.org/3.2.1/api/_as_gen/matplotlib.artist.Artist.set_rasterized.html
I'm not sure if this would work in your case (and if it would look nice), but it might reduce the size of the SVG.

Do you know of any other possibility to remove the metadata?

The metadata is there for a reason, you shouldn't simply remove it.
But, as you noticed, using png instead of png2x doesn't need re-scaling the images, so no metadata is necessary in that case.
There is another option, though: you could try to fix the HTML theme by using some custom CSS (https://nbsphinx.readthedocs.io/en/0.7.0/custom-css.html):
img {
    max-width: unset;
}

And do you have any clue, why it used to work perfectly with nbsphinx v0.3.5 (which is the only version where it adjusted png's correctly).

I doubt it worked "correctly" or "perfectly" with version 0.3.5.
I guess the figures were displayed in their "native" size instead of the intended size given by the metadata. Which was wrong.
I fixed this in 274e68b4595a0748beda5100594b03ddc69298b7.
If you think it's still not right, please let me know!

Really appreciate your detailed comment on this. Rasterization didn't help, neither did custom_css. However, using png works totally fine for me. Thanks a lot for you help!

It's great that png works for you.
I'm still curious why the CSS solution didn't work, can you please explain?
I'm working on my own Sphinx theme and I'd like to avoid the problem there.

@mgeier @VolkerBergen
The CSS solution worked for me, after some modifications - using png2x is therefore possible:
.rst-content .image-reference img {
   max-width: unset;
   width: 100% !important;
   height: auto !important;


Multiple copies of moment function

Is there a way to create multiple, independently-configured copies of the moment() function?
What I would like to do is enforce strict-mode parsing across my entire codebase (disable the fallback to the native Date function). The method I would like to use to do this is covered here - override createFromInputFallback to always return an invalid Date. The only snag in my situation is that I'm developing a widget library that depends on moment and I can't modify the global moment object that my users depend on. If I could configure my own copy of the moment function separately from the global one it would solve that problem neatly.
I can theoretically update all of my moment(string) calls to be moment(string, format, true) and that will give the strict-parsing behavior I would like. The catch is that we would then have to implement a human rule across our team that says "always remember to pass format and true to moment()" but human rules are easy to forget. If it's possible to enforce this behavior in code that seems like a cleaner solution to me.

Why do you need to change moment in order to enforce this?  Just write a function in your code.
function createMoment(s, f) {
    return moment(s,f,true);
}

The sticking point with that one is the format parameter f. I'm working on an old codebase that relies on the flexibility of a single-parameter moment(something) call. Many of our functions look something like this:
/**
* Sets the timeframe
*
* @param {object} start Native JS Date object, Moment.JS date object, or ISO 8601 string to set as new start date
* @param {object} end Native JS Date object, Moment.JS date object, or ISO 8601 string to set as new end date
*/
var setTimeframe = function( start, end ) {
    start = moment(start);
    end = moment(end);
    /* do some stuff */
};

These functions are then called from all corners of the codebase and they rely on moment to normalize their inputs whether they're passed Dates, Strings, or other moment objects. Refactoring this to use a fixed format would require a rewrite of a regrettable amount of code. Often, even when the input is a String the format is not explicitly known except that it's supposed to be some form of ISO 8601 (and when it isn't weird things happen).
It would be great to have something like the moment(String, true) signature proposed in #2469 where you keep all of the standard ISO parsing methods and if they fail you simply return Invalid Date instead of delegating to the Date function. To the best of my Googling ability this has not been implemented, though.
Since I first posted this I've managed to come up with a wrapper along the same lines as the one you suggested that acts more like moment(String, true). This is the gist of it:
function momentStrict() {
    var prevFallback = moment.createFromInputFallback;
    moment.createFromInputFallback = function (config) {
        config._d = new Date(NaN);
    };
    var result = moment.apply(null, arguments);
    moment.createFromInputFallback = prevFallback;
    return result;
}

// Usage: API is the same as the moment() function. These all work like usual:
momentStrict(“1970-01-01”);
momentStrict(new Date());
momentStrict(“01/01/1970”, “DD/MM/YYYY”, true);
// … etc.

// This is the main difference:
momentStrict(“01/01/1970”).isValid(); // will always be false
moment(“01/01/1970”).isValid(); // will usually be true, browser-dependent

The wrapper itself feels a little hacky though (modifying global state but not really) - if there is a better way to go about this I would love to improve my code.
Thanks for you time, I appreciate the response.

@bkputnam I think you didn't get @mj1856 suggestion. He just said to not use moment directly, but instead your own function that does all the crazy stuff you want. Just do a search-and-replace on all your code base for the word moment and replace it with myCrazyMoment, then implement myCrazyMoment to handle all your weird cases and stuff.
You can also bundle moment directly in your library and modify it, but that would mean bigger size of your library. In any case if a plugin is changing the default settings (like falling back to Date) this can have very subtle to find issues in the client's app code, if they happen to be using moment.
So what you suggest is something like
var myMoment = moment.createConstructor({fancy: [options, here]});
myMoment(str); // in rest of code

But that is the same as:
var myMoment = function () {
  // do some crazy stuff, really up to you
  return fancyMomentObjectCreatedInAWeirdWay;
}
myMoment(str);  // in rest of code

Thanks @ichernev, I think we all wound up saying the same thing in the end: @mj1856's createMoment(), your myMoment() and my momentStrict() are all variations on the same theme. At any rate I now have a function like you suggest that does what I need. Thanks again for the responses and the great library.


Update article to include Azure Key Vault Managed HSM

The article needs to be updated to reflect the new Azure Key Vault Managed HSM service.
For example, this section says:
"Microsoft’s multi-tenant Azure Key Vault service currently only provides FIPS 140-2 Level-2 certification"
and further down in the same article:
"Whether Azure Dedicated HSM will work for you depends on a potentially complex mix of requirements and compromises that you can or cannot make. An example is the FIPS 140-2 Level 3 requirement. This requirement is common, and Dedicated HSM is currently the only option for meeting it."
This will help customers make better decisions between the three options: Azure Key Vault, Azure Key Vault Managed HSM and Azure Dedicated HSM.

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: aa6c4d29-c1ef-187e-d630-627d0821f965
Version Independent ID: 910fc85f-be24-a4df-c59f-d221b6d2df85
Content: What is Dedicated HSM? - Azure Dedicated HSM
Content Source: articles/dedicated-hsm/overview.md
Service: key-vault
GitHub Login: @msmbaldwin
Microsoft Alias: mbaldwin

@richardspitz
Thanks for your feedback! I've assigned this issue to the author who will investigate and update as appropriate.

@richardspitz
Thanks for your feedback! I've assigned this issue to the author who will investigate and update as appropriate.


Is it possible to declare the repeated exlusions in a single place (main pom.xml) ?

Is it possible to declare the repeated exlusions in a single place (main pom.xml) ?
Originally posted by @benyoka in https://github.com/hortonworks/registry/pull/712#issuecomment-613874474

We moved to Gradle


Fixed check for missing script

Description

There was a check for tag, but it should have been for asset. The plugin crashed the first time I used it and it looks like a simple logic error.
How has this been tested?

I ran your tests and they passed
Types of changes

[ ] New feature - feat
[x] Bug fix - fix
[ ] Refactor - refactor
[ ] Test cases - test
[ ] Other(s):

Remarks

N/A

Hi, @kmalakoff. Thanks for submitting this PR 😊 This really is a careless mistake that I couldn't have spot it out for over an year! I guess my test case isn't really covering the whole scenario, however I didn't manage to find a webpack configuration that can reproduce the error. I would be grateful if you could share me your webpack configuration, so that I can enhance my tests.

No worries!
There's an example here, but it is is complicated to extract into a nice little test case.
Thank you for the merge and re-publish. I appreciate your efforts

Thanks for sharing the information. I will take a look and see how I can reproduce the issue.


Fix outbound link to Cilium K8s Installation Guide

hi @Arhell, thank you for the update. It looks like the check for CLA was successful. I also checked The Linux Foundation and the site is saying I'm "authorized to contribute code to this project through your membership with CNCF - IBM". 🤔

/retest

hi @Arhell, thank you for the update. It looks like the check for CLA was successful. I also checked The Linux Foundation and the site is saying I'm "authorized to contribute code to this project through your membership with CNCF - IBM". 🤔

Interesting.. it shows both cla yes and no label. Allowing retest to see if that updates anything.

/ok-to-test

/check-cla

/check-cla

Thanks @fejta and @bradtopol

/assign

New link works and renders properly. Great job!
/lgtm
/approve


[Event Request] Table 38 "Purchase Header" – New Event “OnRecreatePurchLinesOnBeforePurchLineFindSet”

[Event Request] Table 38 "Purchase Header" – New Event “OnRecreatePurchLinesOnBeforePurchLineFindSet”
Could we please have an new publisher OnRecreatePurchLinesOnBeforePurchLineFindSet in Table 38 "Purchase Header" in Function "RecreatePurchLines"?
PurchLine.Reset();
PurchLine.SetRange("Document Type", "Document Type");
PurchLine.SetRange("Document No.", "No.");
New Event Begin
OnRecreatePurchLinesOnBeforePurchLineFindSet(PurchLine);
New Event End
if PurchLine.FindSet then begin
repeat
PurchLine.TestField("Quantity Received", 0);
 ...
[IntegrationEvent(false, false)]
local procedure OnRecreatePurchLinesOnBeforePurchLineFindSet(var PurchaseLine: Record "Purchase Line")
begin
end;

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. We will update this issue with information about availability.


Corrupt captured audio quality

Occasionally the sound capture feature may produce artifacts. This must be investigated.
https://user-images.githubusercontent.com/77337235/121354410-85cb2780-c937-11eb-8097-18efeef02d4c.mp4

Could not find a stable way of reproducing the issue. Nevertheless, several improvements have been made:

moved to third-party audio converter (https://github.com/lincollincol/PCM-Decoder)
fixed releasing resources used for audio playback

If the issue persists, another possible solution could be to create MediaPlayer objects on-demand, separately for each particular playback. The dev docs are rather vague about this:

It is also recommended that once a MediaPlayer object is no longer being used, call release() immediately so that resources used by the internal player engine associated with the MediaPlayer object can be released immediately.

Tested 2021-07-26
Seems that issue with audio corrupting is still reproduced.
@lwp-ygavrilenko Check please, audio during capturing differs from the audio while playing it.

Tested 2021-07-28
For audio capturing Perfect Ear was used:

while capturing from MI2A some noises were present
while capturing from another app some noises were present

For audio capturing another app Real Piano was used

while capturing from MI2A noises were absent
while capturing from another app noises were absent

Seems that it is an issue connected with capturing audio from the perfect ear app


[event-hubs, eventhubs-checkpointstore-blob] Fixing samples and readme

We had a few spots where we had sample usage of eventhubs-checkpointstore-blob. Made them all syntactically correct and handle an empty array of events, which can happen when the wait timeout expires.
Fixes #11007

The docs on the Microsoft website still show up with the outdated version of this code:
https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-node-get-started-send


Keep DaoPath and DoPath the same as the document.

Keep DaoPath and DoPath the same as the document.

Codecov Report

Merging #1891 (8f5f2a1) into master (0639bec) will decrease coverage by 0.10%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #1891      +/-   ##
==========================================
- Coverage   73.77%   73.66%   -0.11%
==========================================
  Files         509      508       -1
  Lines       46013    45778     -235
==========================================
- Hits        33946    33724     -222
+ Misses      10019    10012       -7
+ Partials     2048     2042       -6

Flag
Coverage Δ

go-1.15-386
?

go-1.15-amd64
73.66% <ø> (ø)

go-1.16-386
?

go-1.16-amd64
?

go-1.17-386
?

go-1.17-amd64
?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files
Coverage Δ

os/gfile/gfile_scan.go
82.22% <0.00%> (-7.78%)
:arrow_down:

os/gspath/gspath_cache.go
87.71% <0.00%> (-7.02%)
:arrow_down:

net/gtcp/gtcp_pool.go
68.18% <0.00%> (-6.82%)
:arrow_down:

os/gmutex/gmutex.go
94.73% <0.00%> (-2.64%)
:arrow_down:

os/glog/glog_logger_rotate.go
65.85% <0.00%> (-1.47%)
:arrow_down:

os/gcmd/gcmd_parser.go
92.19% <0.00%> (-0.71%)
:arrow_down:

container/gtree/gtree_avltree.go
95.40% <0.00%> (-0.58%)
:arrow_down:

contrib/drivers/oracle/oracle.go

container/gmap/gmap_hash_str_any_map.go
92.59% <0.00%> (+1.01%)
:arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0639bec...8f5f2a1. Read the comment docs.

@rocna It is changed in version from v2.1

NIce


ArgumentException overshadows ArgumentNullException in reporting

ArgumentException overshadows ArgumentNullException in reporting, causing ArgumentNullException not to be reported. This is likely due to ArgumentNullException extending ArgumentException.
This is a quirk of the framework and its legacy that those exceptions happen to coincide.
In this case it was about Dictionary<TKey, TValue>.Add(TKey key, TValue value) declaring both for different reasons.
You don't have this problem when nullable is active. Since ArgumentNullException is not relevant there.

This is probably nothing we can do about. But this is a known problem. Designers of APIs should note this.

Not a bug per se. We close this for now.


Print out PYTHONPATH if excessively long for debuging purposes.

Pull Request Description
What issue does this change request address?
Closes #1358
What are the significant changes in functionality due to this change request?
Prints out really long PYTHONPATH's.

For Change Control Board: Change Request Review
The following review must be completed by an authorized member of the Change Control Board.

[x] 1. Review all computer code.
[x] 2. If any changes occur to the input syntax, there must be an accompanying change to the user manual and xsd schema. If the input syntax change deprecates existing input files, a conversion script needs to be added (see Conversion Scripts).
[x] 3. Make sure the Python code and commenting standards are respected (camelBack, etc.) - See on the wiki for details.
[x] 4. Automated Tests should pass, including run_tests, pylint, manual building and xsd tests. If there are changes to Simulation.py or JobHandler.py the qsub tests must pass.
[x] 5. If significant functionality is added, there must  be tests added to check this. Tests should cover all possible options.  Multiple short tests are preferred over one large test. If new development on the internal JobHandler parallel system is performed, a cluster test must be added setting, in  XML block, the node <internalParallel> to True.
[x] 6. If the change modifies or adds a requirement or a requirement based test case, the Change Control Board's Chair or designee also needs to approve the change.  The requirements and the requirements test shall be in sync.
[x] 7. The merge request must reference an issue.  If the issue is closed, the issue close checklist shall be done.
[x] 8. If an analytic test is changed/added is the the analytic documentation updated/added?
[x] 9. If any test used as a basis for documentation examples (currently found in raven/tests/framework/user_guide and raven/docs/workshop) have been changed, the associated documentation must be reviewed and assured the text matches the example.

Checklist passed (once the tests pass).
Merging one all the tests pass.

Tests passed...
Merging....


Framebuffer region dependencies

Allow defining subpass dependencies as framebuffer local. It's offering weaker ordering guarentees than global framebuffer dependencies, therefore we should be able to fallback for APIs not supporting it (e.g dx12).

Is there anything left to do here after #1858 ?

I think vulkan doesn't handle it so far, right?

we just pass it through, transmuting the flags


BasicChaosMonkey.doMonkeyBusiness() method exit without finishing its job

Hi all,
I've observed that during BasicChaosMonkey.doMonkeyBusiness(), the method suddenly returned without finishing rest of it's happy-path. There's no exception nor error messages.
The jettyRun output is as follow:
2016-09-08 16:31:16.328 - INFO  BasicChaosInstanceSelector - [BasicChaosInstanceSelector.java:65] Randomly selecting 1 from 3 instances, excluding null
2016-09-08 16:31:16.563 - INFO  Monkey - [Monkey.java:138] Reporting what I did...

I've set up the debugger to trace this. The code end up into org.jclouds.ContextBuilde.
The stack dump is:
"pool-1-thread-1@9515" prio=5 tid=0x1d nid=NA runnable
  java.lang.Thread.State: RUNNABLE
    at org.jclouds.ContextBuilder.buildView(ContextBuilder.java:588)
    at com.netflix.simianarmy.client.aws.AWSClient.getJcloudsComputeService(AWSClient.java:818)
    - locked <0x2989> (a com.netflix.simianarmy.client.aws.AWSClient)
    at com.netflix.simianarmy.client.aws.AWSClient.connectSsh(AWSClient.java:834)
    at com.netflix.simianarmy.chaos.ChaosInstance.connectSsh(ChaosInstance.java:123)
    at com.netflix.simianarmy.chaos.ChaosInstance.canConnectSsh(ChaosInstance.java:101)
    at com.netflix.simianarmy.chaos.ScriptChaosType.canApply(ScriptChaosType.java:60)
    at com.netflix.simianarmy.basic.chaos.BasicChaosMonkey.pickChaosType(BasicChaosMonkey.java:141)
    at com.netflix.simianarmy.basic.chaos.BasicChaosMonkey.doMonkeyBusiness(BasicChaosMonkey.java:121)
    at com.netflix.simianarmy.Monkey.run(Monkey.java:134)
    at com.netflix.simianarmy.Monkey$1.run(Monkey.java:155)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

I've observed the issue on master branch and tag v2.5.1.
Tag v2.5.0 is fine though and I was using it well. So i am suspecting it's because some dependency changes in between that is causing this. However a diff between build.gradle of different tags shows me that jcloud is not upgraded during these two tags. So i am confused as where to go next.
$ diff master_branch/build.gradle tag_v2.5.0/build.gradle
1,6d0
< buildscript {
<     repositories {
<         jcenter()
<     }
< }
<
8c2
<     id 'nebula.netflixoss' version '3.2.3'
---
>     id 'nebula.netflixoss' version '2.2.9'
18c12
< repositories {
---
> repositories {
26,28d19
< sourceCompatibility = 1.7
< targetCompatibility = 1.7
<
36c27,28
<     compile 'com.sun.jersey:jersey-servlet:1.19'
---
>     compile 'com.sun.jersey:jersey-core:1.11'
>     compile 'com.sun.jersey:jersey-servlet:1.11'
40c32,34
<     compile 'com.netflix.eureka:eureka-client:1.4.1'
---
>     compile('com.netflix.eureka:eureka-client:1.1.22') {
>         exclude group: 'com.sun.jersey', module: 'jersey-bundle'
>     }
49a44
>     compile 'ch.qos.logback:logback-classic:1.0.13'
51,52d45
<     compile 'org.springframework:spring-jdbc:4.2.5.RELEASE'
<     compile 'com.zaxxer:HikariCP:2.4.7'

I might dig deeper into this. Has anyone got this issue before?

I ran into something very similar with Janitor: it died in an AWS API call
with no log message.  To trace it, I created a one-off JSP that invoked the
same API call so I could get a full stack trace.  In my case it was a
version mismatch between the AWS client library in open source SimianArmy
and a different AWS client jar that was being pulled in by our non-open
source version.
I upgraded the AWS client to 1.11.9 and it resolved the issue for me.  I
have an open PR to introduce this to the main code line.
On Thu, Sep 8, 2016 at 6:03 PM, Yufeng<EMAIL_ADDRESS>wrote:

Hi all,
I've observed that during BasicChaosMonkey.doMonkeyBusiness(), the method
suddenly returned without finishing rest of it's happy-path. There's no
exception nor error messages.
The jettyRun output is as follow:
2016-09-08 16:31:16.328 - INFO  BasicChaosInstanceSelector - [BasicChaosInstanceSelector.java:65] Randomly selecting 1 from 3 instances, excluding null
2016-09-08 16:31:16.563 - INFO  Monkey - [Monkey.java:138] Reporting what I did...
I've set up the debugger to trace this. The code end up into
org.jclouds.ContextBuilde.
The stack dump is:
"pool-1-thread-1@9515" prio=5 tid=0x1d nid=NA runnable
java.lang.Thread.State: RUNNABLE
at org.jclouds.ContextBuilder.buildView(ContextBuilder.java:588)
at com.netflix.simianarmy.client.aws.AWSClient.getJcloudsComputeService(AWSClient.java:818)
- locked <0x2989> (a com.netflix.simianarmy.client.aws.AWSClient)
at com.netflix.simianarmy.client.aws.AWSClient.connectSsh(AWSClient.java:834)
at com.netflix.simianarmy.chaos.ChaosInstance.connectSsh(ChaosInstance.java:123)
at com.netflix.simianarmy.chaos.ChaosInstance.canConnectSsh(ChaosInstance.java:101)
at com.netflix.simianarmy.chaos.ScriptChaosType.canApply(ScriptChaosType.java:60)
at com.netflix.simianarmy.basic.chaos.BasicChaosMonkey.pickChaosType(BasicChaosMonkey.java:141)
at com.netflix.simianarmy.basic.chaos.BasicChaosMonkey.doMonkeyBusiness(BasicChaosMonkey.java:121)
at com.netflix.simianarmy.Monkey.run(Monkey.java:134)
at com.netflix.simianarmy.Monkey$1.run(Monkey.java:155)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
I've observed the issue on master branch and tag v2.5.1.
Tag v2.5.0 is fine though and I was using it well. So i am suspecting it's
because some dependency changes in between that is causing this. However a
diff between build.gradle of different tags shows me that jcloud is not
upgraded during these two tags.  Has anyone got this issue before?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/Netflix/SimianArmy/issues/274, or mute the thread
https://github.com/notifications/unsubscribe-auth/AKXxgfImWXScybt-Yx2W8lvb6gm0po5Pks5qoLBbgaJpZM4J4mfs
.

Thanks for suggestions!
It turned out it's the same issue as https://github.com/Netflix/SimianArmy/issues/259.
Problem was fixed by fixing the dependency
compile ('com.netflix.eureka:eureka-client:1.4.1') {
        exclude group: 'com.google.inject'
}

Nice! I ran into this just recently and the dependency exclusion also solved the issue for me
Thanks!


Reduce emails going to spam box by improving spamassassin score by including plain text version along with html version.

When setting up pH7, I found that sometimes the notification emails
went to my spam box. Partly it was due to me not having properly
configured DKIM and SPF records on my DNS records. Actually I'm
thankful I had those improperly set because otherwise I may not have
noticed that the spam score was also affected by lacking a plain text
section. See https://gist.github.com/tylermakin/d820f65eb3c9dd98d58721c7fb1939a8
for more details including a section for smart watches (which I did
not attempt to implement since I don't have one and it does not
currently adversely affect spam score).
My first thought (wrong) was to make many changes throughout many
files to create the text version. Then it dawned on me to just convert
the html body into plain text and use that to put into the multipart
mime email. In looking for some way to convert to text I found various
examples and some that were security risks or that just didn't work
well. I am not qualified to state that the html2text code I opted to
use in my patch is secure but it does appear to do a good job at
making spamassassin  happy. I used the service at http://isnotspam.com
to check the spam score as I made changes. The emails still receive a
bad score for "BAYES_99 BODY: Bayes spam probability is 99 to 100%"
and just a tiny bit bad score for "BAYES_999 BODY: Bayes spam
probability is 99.9 to 100%" before my patch a bad score was also
received for "MPART_ALT_DIFF BODY: HTML and text parts are different"
and the suggestion I found was to Include a plain-text part to your
HTML message. There is a possibility for further improvement to the
score by verifying that the html part of the message validates with
validator.w3.org. I have not yet tested the spam score of emails that
are being sent if a person lacks swiftmailer.
On 9/29/20, request-info[bot]<EMAIL_ADDRESS>via 33Mail
<EMAIL_ADDRESS>wrote:

This email was sent to the alias<EMAIL_ADDRESS>by
<EMAIL_ADDRESS>and
33Mail forwarded it to you. To block all further emails to this alias follow
this link :
http://www.33mail.com/alias/unsub/bb47278801ec39a1fa7c19dd7f69bcc3
Refer 2 friends to 33Mail and get a Free Premium Upgrade. Go to this url to
get your referral link http://www.33mail.com/dashboard.
Hi there, thanks very much for taking the time to open this issue! However,
could you give more information about it? Please be as much as specific.
Thank you! Pierre-Henry 🤖
--
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
https://github.com/pH7Software/pH7-Social-Dating-CMS/pull/821#issuecomment-700994329

"before my patch a..." should start a new sentence "Before my patch a..."
On 9/29/20, Robert Yaklin<EMAIL_ADDRESS>wrote:

When setting up pH7, I found that sometimes the notification emails
went to my spam box. Partly it was due to me not having properly
configured DKIM and SPF records on my DNS records. Actually I'm
thankful I had those improperly set because otherwise I may not have
noticed that the spam score was also affected by lacking a plain text
section. See
https://gist.github.com/tylermakin/d820f65eb3c9dd98d58721c7fb1939a8
for more details including a section for smart watches (which I did
not attempt to implement since I don't have one and it does not
currently adversely affect spam score).
My first thought (wrong) was to make many changes throughout many
files to create the text version. Then it dawned on me to just convert
the html body into plain text and use that to put into the multipart
mime email. In looking for some way to convert to text I found various
examples and some that were security risks or that just didn't work
well. I am not qualified to state that the html2text code I opted to
use in my patch is secure but it does appear to do a good job at
making spamassassin  happy. I used the service at http://isnotspam.com
to check the spam score as I made changes. The emails still receive a
bad score for "BAYES_99 BODY: Bayes spam probability is 99 to 100%"
and just a tiny bit bad score for "BAYES_999 BODY: Bayes spam
probability is 99.9 to 100%" before my patch a bad score was also
received for "MPART_ALT_DIFF BODY: HTML and text parts are different"
and the suggestion I found was to Include a plain-text part to your
HTML message. There is a possibility for further improvement to the
score by verifying that the html part of the message validates with
validator.w3.org. I have not yet tested the spam score of emails that
are being sent if a person lacks swiftmailer.
On 9/29/20, request-info[bot]<EMAIL_ADDRESS>via 33Mail
<EMAIL_ADDRESS>wrote:

This email was sent to the alias<EMAIL_ADDRESS>by
<EMAIL_ADDRESS>and
33Mail forwarded it to you. To block all further emails to this alias
follow
this link :
http://www.33mail.com/alias/unsub/bb47278801ec39a1fa7c19dd7f69bcc3
Refer 2 friends to 33Mail and get a Free Premium Upgrade. Go to this url
to
get your referral link http://www.33mail.com/dashboard.
Hi there, thanks very much for taking the time to open this issue!
However,
could you give more information about it? Please be as much as specific.
Thank you! Pierre-Henry 🤖
--
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
https://github.com/pH7Software/pH7-Social-Dating-CMS/pull/821#issuecomment-700994329

@Jilt6502 Not to break much of your joy. Maybe this ain't the best software if your expectation are ending up with something "top notch". If you read thru some of the closed issue, many of them never got fixed.
This look much more like a "one man" project than anything else. I gave it a try about two years ago and went on to something else. However, I continued to get the emails regarding new issues and I often take the time trying to help people with the knowledge I have.
I'll give you a example, not so long ago (less than 6 month), the software had a "feature" that made it back link (that is show publicity of another site, in this case, the one of the author) thru your own website. This impact of your Google score and is simply a bad practice. What it does is also trying to make the author website look like more popular in Google Ranks because many other site relate to it. This wasn't in any of the documentation but many people who tried the software themselves removed it but just no one had ever took the time to make a little bit of a public trial on the matter. Another example would be that if you look at your Web pages (thru the browser), you'll see copyright before the HTML code, this again make your website being refused on AdSense because of improper language coding. And I could give you plenty more on this...
Yeah, look good on the outside but it's more of a "catch" for people who want a quick solution helping build a dating website (in a over crowded market) and get rich instaniously without much work... But you'll soon discover that there's more than a handful of bugs....

https://github.com/pH7Software/pH7-Social-Dating-CMS/issues/781#issue-627967333

@pH-7 Thanks for nicely integrating others contribution. You are the best !


How To Add Data into Waltz

I was able to get up and running with Waltz, but how to load data
e.g. add applications etc via GUI is there option in GUI itself to add applications?

Hi @mrudangit
This is the part of Waltz which requires some engineering effort as every organisation has different sources and schemas for data.  In other organisations we have utilised a custom framework to ingest data into Waltz.
Aside from applications, what other entities are you wanting to ingest?  What are the sources of the data?
thanks
Kamran

Hi Kamran, Thanks for getting back.
In general we want to setup ORG unites, business units etc and then application and their dependencies
On Tuesday, April 9, 2024 at 12:28:36 PM EDT, Kamran Saleem<EMAIL_ADDRESS>wrote:

Hi @mrudangit
This is the part of Waltz which requires some engineering effort as every organisation has different sources and schemas for data. In other organisations we have utilised a custom framework to ingest data into Waltz.
Aside from applications, what other entities are you wanting to ingest? What are the sources of the data?
thanks
Kamran
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: @.***>

Ok, an intro to the type of data that you need to ingest into the database can be found in the LoadAll sample data generator:
https://github.com/finos/waltz/blob/master/waltz-jobs/src/main/java/org/finos/waltz/jobs/generators/LoadAll.java
If you need more guidance perhaps we can setup a call and discuss your specific organisations requirements.
thanks


Dashboard loading indicator

The dashboard loads data pretty quickly, but there is still a brief moment of time when it displays a message that no data is available. For example, if you visit the resources page then it shows "No resources found" for a brief amount of time before displaying resources. In cloud environments, there might be a longer delay for the resource service to return values.
We don't want to display "No resources found" while people wait. That's confusing. Instead, there should be a loading indicator and the text "Loading" until either data is returned, or it's confirmed no data is available, at which point it's correct to show a "No resources found" message.
Loading indicator (spinning circle + "Loading" text) should be added to a number of pages:

Resources
Structured logs
Traces
Metrics (maybe, after a resource is selected but before meters and instruments are available)

See images at https://github.com/dotnet/aspire/pull/2556 as an example.

FluentDataGrid has a loading flag and template - https://www.fluentui-blazor.net/DataGrid

In my testing we need to wait for this fix: https://github.com/microsoft/fluentui-blazor/pull/1512 before this will work properly for us. I'm not quite ready to move to a build that has that yet, so will hold off briefly.

I'm not quite ready to move to a build that has that yet, so will hold off briefly.

What do you mean? I created a PR to update to a preview version with some fixes that I requested: https://github.com/dotnet/aspire/pull/2691

I'm not quite ready to move to a build that has that yet, so will hold off briefly.

What do you mean? I created a PR to update to a preview version with some fixes that I requested: https://github.com/dotnet/aspire/pull/2691

Primarily was #2683 which already merged. Also I remember what happened last time we tried to update and I wanted to take a moment to use it before updating and didn't have time right then.

I think it'd help to define where in the data flow for each of these pages we want the loading indicator to be displayed. For instance here's a stab at it for resources page:

The page starts with Loading = true
The loading indicator will be displayed while things are getting setup and while the call to SubscriberResourcesAsync is awaited and the snapshot results are parsed
Loading is set to false
If there were no resources at that point, No resources found will be displayed, otherwise the actual resources will be displayed
Its possible that no resources are found initially and then eventually some appear.

I think 5 is a little weird, but we have no way to confirm that no resources will ever show up as far as I'm aware. So it seems reasonable that we'd say no resources if the initial load didn't contain any and then adjust in the future accordingly. But I can see the argument that that'd still be confusing in particularly slow environments.
I've got the above working fine now that we have the fix I mentioned in a prior comment.
But for the other pages, its less clear to me how we do that because of how the underlying repositories are (generally) already populated and ready by the time the page loads. The view model just provides the requested span of data from the underlying shared telemetry repository. It doesn't seem like there's much, if any, delay between page load and the first render of (possibly empty) data where we should show the loading indicator. But I'm happy to be pointed to something that we could use as an indicator of readiness.
@JamesNK since you probably have the most thoughts on Structured Logs, Traces and Metrics.


Feature: set response headers for mocks

Allow setting headers for the response of the mocks

More detail is required

More detail is required

will add. thank you!


OCPCLOUD-2642: OpenShift-specific changes

Use 4.18 build image
Override docker make targets
Override dockerignore file with our own that respects vendoring directories
Correct owners subcomponent
Invoke unit tests without CRD tests
Add openshift readme

Needs https://github.com/openshift/release/pull/55371, but the make docker-build command will create an image.

/lgtm

Also could you add a description in the PR to what we are doing for quick glancing? TY

/approve
/hold in case you want to resolve @damdo's outstanding questions

Discussed with Nolan, need to green button merge this one to be able to then get CI up as it depends on this


powerdns: 4.0.3 -> 4.0.4

Motivation for this change
cc @nhooyr for testing
Things done

[x] Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
Built on platform(s)

[x] NixOS
[ ] macOS
[ ] other Linux distributions

[ ] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
[ ] Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
[ ] Tested execution of all binary files (usually in ./result/bin/)
[x] Fits CONTRIBUTING.md.

Then I suppose you'd better be removed prom meta.maintainers.

@grahamcofborg powerdns


How to remove extra files?

I mean the library takes a lot of time to compile but:
1)I don't need to compile all the sources on each change - library and projects except of the current one I work
2)For example I have 9250 then I don't need sources for other controllers (even if they are just included into the library
So how to remove these files?

Delete the files and then remove references so the compiler errors stop - the compiler will tell you where they are. Or just search the files.
If you are using a multicore processor, don't forget that you can do "make -j4" or something similar.


Json_rpc backward compat release 1.4

Motivation
Fix-Broken-Jobs - json-rpc-backward-compat-test (release-1.4)
Test Plan
CI/CD tests are covered.

/canary

:boom: Tests timed-out

/canary

:broken_heart: Test Failed - ci-test

/canary

:sunny: Canary successful


Please add a license file and explain what it does in the readme

I'd like to add this to awesome-zsh-plugins, but it doesn't have a license file.
Please add a license file - if you don't have one in mind,  I recommend using choosealicense.com to help choose an appropriate one.
Also, it's unclear exactly what it does - please add an explanation in the readme.
Thanks!

Done


Implement MongoDBArtifactStore

This PR provides a MongoDBArtifactStore implementation to enable using MongoDB for storing subjects, whisks and activation in MongoDB， and mostly comes from old PR: https://github.com/apache/openwhisk/pull/3570.
Since lots of codes are inspired by https://github.com/chetanmeh/openwhisk-mongo, so I added @chetanmeh as co-author
Description
Some users may want to use other database backends instead of CouchDB to store entities, this PR provides MongoDB as an alternative choice for these users
A simple document here: https://cwiki.apache.org/confluence/display/OPENWHISK/MongoDB+Artifact+Store
MongoDB driver
MongoDB provides official drivers for many languages, in this case, we pick the mongo-scala-driver, this driver provides an idiomatic Scala API that is built on top of the MongoDB Async Java driver.
Design Considerations
Data Model
The data scheme in MongoDB is just like CouchDB except that MongoDB doesn't have a _rev field, below is the data of whisk.system/invokerHealthTestAction0 in CouchDB and MongoDB:

CouchDB
MongoDB

{
  "_id": "whisk.system/invokerHealthTestAction0",
  "_rev": "68-e72440f911c64ab11441c09e730e5ab8",
  "name": "invokerHealthTestAction0",
  "publish": false,
  "annotations": [],
  "version": "0.0.1",
  "updated":<PHONE_NUMBER>182,
  "entityType": "action",
  "exec": {
    "kind": "nodejs:6",
    "code": "function main(params) { return params; }",
    "binary": false
  },
  "parameters": [],
  "limits": {
    "timeout": 60000,
    "memory": 256,
    "logs": 10
  },
  "namespace": "whisk.system"
}

{
  "_id" : "whisk.system/invokerHealthTestAction0",
  "name" : "invokerHealthTestAction0",
  "publish" : false,
  "annotations" : "[ ]",
  "version" : "0.0.1",
  "updated" : NumberLong("1524473794826"),
  "entityType" : "action",
  "exec" : {
    "kind" : "nodejs:6",
    "code" : "function main(params) { return params; }",
    "binary" : false
  },
  "parameters" : "[ ]",
  "limits" : {
    "timeout" : 60000,
    "memory" : 256,
    "logs" : 10
  },
  "namespace" : "whisk.system"
}

Since the annotations and parameters fields may using arbitrary strcut and MongoDB doesn't support $ as the first char for field name, so it will convert these two fields to string, and convert it back when get them via openwhisk, this is transparent to users
_rev field will not be generated automatically in MongoDB, so it is calculted and inserted in code explicitly

Attachment
MongoDB use GridFS to store and retrieve files that exceed the BSON-document size limit of 16 MB.
Attachment in MongoDB is stored in a separate collection with a independent _id, this PR use the doc._id + doc.file_name as the attachment's _id field, then we can find the relative attachment easily.
Progress
Finished Work

[x] Basic Usage(create、update、query、delete)
[x] Attachment Support
[x] Automated deployment of MongoDB using Ansible
[x] CI Integration
[x] Documents

FurtherWork

[ ] Add MongoDB support for wskadmin
[ ] Support batch insert

My changes affect the following components

[x] Data stores (e.g., CouchDB)
[x] Tests
[x] Deployment
[ ] CLI
[x] Documentation

Types of changes

[x] Enhancement or new feature (adds new functionality).

Checklist:

[x] I signed an Apache CLA.
[x] I reviewed the style guides and followed the recommendations (Travis CI will check :).
[x] I added tests to cover my changes.
[ ] My changes require further changes to the documentation.
[x] I updated the documentation where necessary.

This is great!

Will go through this sometime this week! Thanks!

I think we should go ahead with merging this to provide a total alternative to couchdb for people. Are you all using this in production?

@bdoyle0182 We are not yet using this but to use it at some point as we can't keep up with CouchDB.

Yea that's why I suggested. We also can't keep up with couchdb. I think we should offer it, but it does seem weird to advertise it without any production cases. We could potentially attempt to try it, but will need to either have dual write / reads or a safe way to migrate the data

Codecov Report

Merging #4963 (747de8f) into master (59b67fe) will decrease coverage by 12.87%.
The diff coverage is 34.21%.

@@             Coverage Diff             @@
##           master    #4963       +/-   ##
===========================================
- Coverage   81.46%   68.59%   -12.88%
===========================================
  Files         209      223       +14
  Lines       10344    11115      +771
  Branches      450      467       +17
===========================================
- Hits         8427     7624      -803
- Misses       1917     3491     +1574

Impacted Files
Coverage Δ

...k/core/database/mongodb/MongoDBArtifactStore.scala
0.00% <0.00%> (ø)

...atabase/mongodb/MongoDBArtifactStoreProvider.scala
0.00% <0.00%> (ø)

...core/database/mongodb/MongoDBAsyncStreamSink.scala
93.54% <93.54%> (ø)

...re/database/mongodb/MongoDBAsyncStreamSource.scala
95.83% <95.83%> (ø)

...hisk/core/database/mongodb/MongoDBViewMapper.scala
98.88% <98.88%> (ø)

.../scala/org/apache/openwhisk/core/WhiskConfig.scala
93.58% <100.00%> (-1.90%)
:arrow_down:

...che/openwhisk/core/invoker/LogStoreCollector.scala
0.00% <0.00%> (-100.00%)
:arrow_down:

...core/database/cosmosdb/RxObservableImplicits.scala
0.00% <0.00%> (-100.00%)
:arrow_down:

...ore/database/cosmosdb/cache/CacheInvalidator.scala
0.00% <0.00%> (-100.00%)
:arrow_down:

...e/database/cosmosdb/cache/ChangeFeedConsumer.scala
0.00% <0.00%> (-100.00%)
:arrow_down:

... and 68 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 59b67fe...747de8f. Read the comment docs.

Codecov Report

Merging #4963 (747de8f) into master (59b67fe) will decrease coverage by 7.94%.
The diff coverage is 34.21%.

@@            Coverage Diff             @@
##           master    #4963      +/-   ##
==========================================
- Coverage   81.46%   73.52%   -7.95%
==========================================
  Files         209      223      +14
  Lines       10344    11115     +771
  Branches      450      467      +17
==========================================
- Hits         8427     8172     -255
- Misses       1917     2943    +1026

Impacted Files
Coverage Δ

...k/core/database/mongodb/MongoDBArtifactStore.scala
0.00% <0.00%> (ø)

...atabase/mongodb/MongoDBArtifactStoreProvider.scala
0.00% <0.00%> (ø)

...core/database/mongodb/MongoDBAsyncStreamSink.scala
93.54% <93.54%> (ø)

...re/database/mongodb/MongoDBAsyncStreamSource.scala
95.83% <95.83%> (ø)

...hisk/core/database/mongodb/MongoDBViewMapper.scala
98.88% <98.88%> (ø)

.../scala/org/apache/openwhisk/core/WhiskConfig.scala
95.51% <100.00%> (+0.02%)
:arrow_up:

...core/database/cosmosdb/RxObservableImplicits.scala
0.00% <0.00%> (-100.00%)
:arrow_down:

...ore/database/cosmosdb/cache/CacheInvalidator.scala
0.00% <0.00%> (-100.00%)
:arrow_down:

...e/database/cosmosdb/cache/ChangeFeedConsumer.scala
0.00% <0.00%> (-100.00%)
:arrow_down:

...core/database/cosmosdb/CosmosDBArtifactStore.scala
0.00% <0.00%> (-95.85%)
:arrow_down:

... and 35 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 59b67fe...747de8f. Read the comment docs.

🎉 👏 nice to finally merge this capability! Great work.

Playing around with this and got it working on a test deployment, but the one thing I haven't figured out is updating the limits for a namespace. Combing through the code and I think that may have been missed having support for since the limits doc lookup in couchdb was done through the identities view, unless I'm missing something. @style95 wondering if you have any idea or we need to take a work item for full compatibility