diff --git a/reference/BasicAlgo/BasicAlgo.cpp b/reference/BasicAlgo/BasicAlgo.cpp index e00b8fe4d..c36968eb5 100644 --- a/reference/BasicAlgo/BasicAlgo.cpp +++ b/reference/BasicAlgo/BasicAlgo.cpp @@ -12,15 +12,21 @@ CONSOLE_APP_MAIN{ DUMP(min(6, 2, 7, 4)); DUMP(max(6, 2, 7, 4)); + DUMP(clamp(0, 1, 10)); + DUMP(clamp(1, 1, 10)); + DUMP(clamp(5, 1, 10)); + DUMP(clamp(10, 1, 10)); + DUMP(clamp(11, 1, 10)); + DUMP(findarg(3, 1, 7, 6, 3, 2)); DUMP(findarg(5, 1, 7, 6)); DUMP(decode(2, 1, "one", 2, "two", 3, "three", "?")); DUMP(decode(5, 1, "one", 2, "two", 3, "three", "?")); - Vector data, empty; - data << 10 << 5 << 11 << 9 << 2; - // 0 1 2 3 4 + Vector empty; + Vector data = { 10, 5, 11, 9, 2 }; + // 0 1 2 3 4 DUMP(FindMin(data)); DUMP(FindMin(data, 0, 4)); @@ -28,7 +34,12 @@ CONSOLE_APP_MAIN{ // DUMP(Min(empty)); // This is undefined (fails in ASSERT) DUMP(Min(empty, -99999)); + int mul = 1; + Accumulate(data, [&](int x) { mul *= x; }); + DUMP(mul); + DUMP(Sum(data)); + DUMP(FindMax(data)); DUMP(FindMax(SubRange(data, 3, 2))); DUMP(Max(data)); @@ -39,4 +50,13 @@ CONSOLE_APP_MAIN{ Vector s = Split("one;two;three", ';'); DUMP(Sum(s, "")); + + data = { 5, 7, 9, 9, 14, 20, 23, 50 }; + // 0 1 2 3 4 5 6 7 + DUMP(FindLowerBound(data, 9)); + DUMP(FindUpperBound(data, 9)); + DUMP(FindBinary(data, 9)); + DUMP(FindLowerBound(data, 10)); + DUMP(FindUpperBound(data, 10)); + DUMP(FindBinary(data, 10)); } diff --git a/reference/GuiWebCrawler/GuiWebCrawler.upp b/reference/GuiWebCrawler/GuiWebCrawler.upp index 35362d77c..7cdb25ced 100644 --- a/reference/GuiWebCrawler/GuiWebCrawler.upp +++ b/reference/GuiWebCrawler/GuiWebCrawler.upp @@ -1,7 +1,8 @@ description "SocketWaitEvent and asynchronous HttpRequest in GUI environment\377"; uses - CtrlLib; + CtrlLib, + Core/SSL; file GuiWebCrawler.cpp,