diff options
| author | Mohammad S Anwar <mohammad.anwar@yahoo.com> | 2021-07-03 10:46:42 +0100 |
|---|---|---|
| committer | Mohammad S Anwar <mohammad.anwar@yahoo.com> | 2021-07-03 10:46:42 +0100 |
| commit | 233a2f92e9aecb070b0eab82a5f9c15d0007d673 (patch) | |
| tree | 2597f15581a9ec1be2c4e7600f05dde4d86d9cf1 | |
| parent | a2dcdf9b2ad8b815961325a5651478f7d3b2e1db (diff) | |
| download | perlweeklychallenge-club-233a2f92e9aecb070b0eab82a5f9c15d0007d673.tar.gz perlweeklychallenge-club-233a2f92e9aecb070b0eab82a5f9c15d0007d673.tar.bz2 perlweeklychallenge-club-233a2f92e9aecb070b0eab82a5f9c15d0007d673.zip | |
- Added solutions by Jan Krnavek.
| -rw-r--r-- | challenge-119/eric-cheung/excel-vba/ch-1.bas | 30 | ||||
| -rw-r--r-- | challenge-119/eric-cheung/excel-vba/ch-2.bas | 69 | ||||
| -rw-r--r-- | stats/pwc-current.json | 413 | ||||
| -rw-r--r-- | stats/pwc-language-breakdown-summary.json | 44 | ||||
| -rw-r--r-- | stats/pwc-language-breakdown.json | 830 | ||||
| -rw-r--r-- | stats/pwc-leaders.json | 360 | ||||
| -rw-r--r-- | stats/pwc-summary-1-30.json | 34 | ||||
| -rw-r--r-- | stats/pwc-summary-121-150.json | 112 | ||||
| -rw-r--r-- | stats/pwc-summary-151-180.json | 98 | ||||
| -rw-r--r-- | stats/pwc-summary-181-210.json | 114 | ||||
| -rw-r--r-- | stats/pwc-summary-211-240.json | 94 | ||||
| -rw-r--r-- | stats/pwc-summary-31-60.json | 94 | ||||
| -rw-r--r-- | stats/pwc-summary-61-90.json | 96 | ||||
| -rw-r--r-- | stats/pwc-summary-91-120.json | 30 | ||||
| -rw-r--r-- | stats/pwc-summary.json | 508 |
15 files changed, 1520 insertions, 1406 deletions
diff --git a/challenge-119/eric-cheung/excel-vba/ch-1.bas b/challenge-119/eric-cheung/excel-vba/ch-1.bas new file mode 100644 index 0000000000..b8f3b6e77f --- /dev/null +++ b/challenge-119/eric-cheung/excel-vba/ch-1.bas @@ -0,0 +1,30 @@ +Attribute VB_Name = "ModTask_01"
+Option Explicit
+Public Const strMyTitle As String = "Eric Cheung"
+
+Function GetSwapNibble(nNumToSwap) As Integer
+
+ If nNumToSwap < 0 Or nNumToSwap > 255 Then
+ GetSwapNibble = 0
+ Exit Function
+ End If
+
+ Dim strOrigBin As String, strBin_01 As String, strBin_02 As String, strSwapBin As String
+ strOrigBin = Application.WorksheetFunction.Dec2Bin(nNumToSwap)
+ strBin_01 = Right(strOrigBin, 4)
+ strBin_02 = Format(Val(Left(strOrigBin, Len(strOrigBin) - 4)), "0000")
+ strSwapBin = strBin_01 & strBin_02
+ GetSwapNibble = Application.WorksheetFunction.Bin2Dec(strSwapBin)
+
+End Function
+
+Sub Task_01()
+ Dim varInputNum
+
+ Do
+ varInputNum = InputBox("Please enter a number between 1 to 255", strMyTitle, 101)
+ If varInputNum = "" Then Exit Sub
+ Loop Until varInputNum > 0 And varInputNum < 256
+
+ MsgBox "The answer for swapped nibble of " & varInputNum & " is: " & GetSwapNibble(varInputNum)
+End Sub
diff --git a/challenge-119/eric-cheung/excel-vba/ch-2.bas b/challenge-119/eric-cheung/excel-vba/ch-2.bas new file mode 100644 index 0000000000..797b71e466 --- /dev/null +++ b/challenge-119/eric-cheung/excel-vba/ch-2.bas @@ -0,0 +1,69 @@ +Attribute VB_Name = "ModTask_02"
+Option Explicit
+Option Base 1
+
+Function GetSeqNum(nTerm) As Long
+ Dim nLoop As Long, nSubLoop As Long, nCntItem As Long, nArrItemCnt As Long
+ Dim nNumArr As Variant
+ Dim nTmpArr() As Long, nNuTmpArr() As Long
+ Dim bFlag As Boolean
+
+ If nTerm < 1 Then
+ GetSeqNum = 0
+ Exit Function
+ ElseIf nTerm <= 3 Then
+ GetSeqNum = nTerm
+ Exit Function
+ End If
+
+ nCntItem = 3
+ nNumArr = Array(1, 2, 3)
+
+ ReDim nTmpArr(1 To 3)
+ For nLoop = 1 To 3
+ nTmpArr(nLoop) = nLoop
+ Next nLoop
+
+ Do While True
+ Erase nNuTmpArr
+ bFlag = True
+
+ For nLoop = LBound(nNumArr) To UBound(nNumArr)
+ For nSubLoop = LBound(nTmpArr) To UBound(nTmpArr)
+ If nNumArr(nLoop) > 1 Or Int(Left(nTmpArr(nSubLoop), 1)) > 1 Then
+ If bFlag Then
+ nArrItemCnt = 0
+ bFlag = False
+ Else
+ nArrItemCnt = UBound(nNuTmpArr) - LBound(nNuTmpArr) + 1
+ End If
+
+ ReDim Preserve nNuTmpArr(1 To nArrItemCnt + 1)
+ nNuTmpArr(nArrItemCnt + 1) = Val(Str(nNumArr(nLoop)) & Str(nTmpArr(nSubLoop)))
+ nCntItem = nCntItem + 1
+ If nTerm = nCntItem Then
+ GetSeqNum = nNuTmpArr(nArrItemCnt + 1)
+ Exit Function
+ End If
+ End If
+ Next nSubLoop
+ Next nLoop
+
+ Erase nTmpArr
+ nTmpArr = nNuTmpArr
+ Loop
+
+End Function
+
+Sub Task_02()
+
+ Dim varInputNum
+
+ Do
+ varInputNum = InputBox("Please enter a positive number for the term of the sequence", strMyTitle, 60)
+ If varInputNum = "" Then Exit Sub
+ Loop Until varInputNum > 0
+
+ MsgBox "The answer for the " & varInputNum & "th term of the sequence is: " & GetSeqNum(varInputNum)
+
+End Sub
diff --git a/stats/pwc-current.json b/stats/pwc-current.json index b03e1e962c..05571510a7 100644 --- a/stats/pwc-current.json +++ b/stats/pwc-current.json @@ -1,40 +1,191 @@ { - "tooltip" : { - "followPointer" : 1, - "pointFormat" : "<span style='color:{point.color}'>{point.name}</span>: <b>{point.y:f}</b><br/>", - "headerFormat" : "<span style='font-size:11px'>{series.name}</span><br/>" - }, "chart" : { "type" : "column" }, "xAxis" : { "type" : "category" }, + "plotOptions" : { + "series" : { + "borderWidth" : 0, + "dataLabels" : { + "format" : "{point.y}", + "enabled" : 1 + } + } + }, + "yAxis" : { + "title" : { + "text" : "Total Solutions" + } + }, + "legend" : { + "enabled" : 0 + }, + "title" : { + "text" : "Perl Weekly Challenge - 119" + }, + "tooltip" : { + "headerFormat" : "<span style='font-size:11px'>{series.name}</span><br/>", + "pointFormat" : "<span style='color:{point.color}'>{point.name}</span>: <b>{point.y:f}</b><br/>", + "followPointer" : 1 + }, + "series" : [ + { + "name" : "Perl Weekly Challenge - 119", + "colorByPoint" : 1, + "data" : [ + { + "drilldown" : "Abigail", + "y" : 2, + "name" : "Abigail" + }, + { + "drilldown" : "Adam Herzog", + "name" : "Adam Herzog", + "y" : 2 + }, + { + "y" : 4, + "name" : "Athanasius", + "drilldown" : "Athanasius" + }, + { + "y" : 1, + "name" : "Colin Crain", + "drilldown" : "Colin Crain" + }, + { + "drilldown" : "Dave Cross", + "y" : 2, + "name" : "Dave Cross" + }, + { + "drilldown" : "Dave Jacoby", + "y" : 3, + "name" : "Dave Jacoby" + }, + { + "y" : 2, + "name" : "Duane Powell", + "drilldown" : "Duane Powell" + }, + { + "drilldown" : "E. Choroba", + "y" : 2, + "name" : "E. Choroba" + }, + { + "name" : "Flavio Poletti", + "y" : 6, + "drilldown" : "Flavio Poletti" + }, + { + "drilldown" : "James Smith", + "name" : "James Smith", + "y" : 3 + }, + { + "y" : 2, + "name" : "Jan Krnavek", + "drilldown" : "Jan Krnavek" + }, + { + "name" : "Jorg Sommrey", + "y" : 2, + "drilldown" : "Jorg Sommrey" + }, + { + "drilldown" : "Laurent Rosenfeld", + "name" : "Laurent Rosenfeld", + "y" : 5 + }, + { + "y" : 4, + "name" : "Luca Ferrari", + "drilldown" : "Luca Ferrari" + }, + { + "drilldown" : "Mark Anderson", + "name" : "Mark Anderson", + "y" : 2 + }, + { + "y" : 1, + "name" : "Olivier Delouya", + "drilldown" : "Olivier Delouya" + }, + { + "drilldown" : "Paulo Custodio", + "y" : 2, + "name" : "Paulo Custodio" + }, + { + "drilldown" : "Roger Bell_West", + "y" : 5, + "name" : "Roger Bell_West" + }, + { + "drilldown" : "Simon Green", + "name" : "Simon Green", + "y" : 3 + }, + { + "drilldown" : "Simon Proctor", + "y" : 2, + "name" : "Simon Proctor" + }, + { + "drilldown" : "Steven Wilson", + "name" : "Steven Wilson", + "y" : 2 + }, + { + "drilldown" : "Stuart Little", + "y" : 4, + "name" : "Stuart Little" + }, + { + "name" : "Ulrich Rieke", + "y" : 4, + "drilldown" : "Ulrich Rieke" + }, + { + "drilldown" : "Vinod Kumar K", + "y" : 1, + "name" : "Vinod Kumar K" + }, + { + "drilldown" : "W. Luis Mochan", + "name" : "W. Luis Mochan", + "y" : 3 + } + ] + } + ], "drilldown" : { "series" : [ { - "name" : "Abigail", "data" : [ [ "Perl", 2 ] ], - "id" : "Abigail" + "id" : "Abigail", + "name" : "Abigail" }, { "id" : "Adam Herzog", - "name" : "Adam Herzog", "data" : [ [ "Perl", 2 ] - ] + ], + "name" : "Adam Herzog" }, { - "id" : "Athanasius", - "name" : "Athanasius", "data" : [ [ "Perl", @@ -44,30 +195,33 @@ "Raku", 2 ] - ] + ], + "id" : "Athanasius", + "name" : "Athanasius" }, { - "id" : "Colin Crain", "name" : "Colin Crain", "data" : [ [ "Blog", 1 ] - ] + ], + "id" : "Colin Crain" }, { "name" : "Dave Cross", + "id" : "Dave Cross", "data" : [ [ "Perl", 2 ] - ], - "id" : "Dave Cross" + ] }, { "name" : "Dave Jacoby", + "id" : "Dave Jacoby", "data" : [ [ "Perl", @@ -77,31 +231,29 @@ "Blog", 1 ] - ], - "id" : "Dave Jacoby" + ] }, { "id" : "Duane Powell", - "name" : "Duane Powell", "data" : [ [ "Perl", 2 ] - ] + ], + "name" : "Duane Powell" }, { + "name" : "E. Choroba", + "id" : "E. Choroba", "data" : [ [ "Perl", 2 ] - ], - "name" : "E. Choroba", - "id" : "E. Choroba" + ] }, { - "name" : "Flavio Poletti", "data" : [ [ "Perl", @@ -116,10 +268,11 @@ 2 ] ], - "id" : "Flavio Poletti" + "id" : "Flavio Poletti", + "name" : "Flavio Poletti" }, { - "id" : "James Smith", + "name" : "James Smith", "data" : [ [ "Perl", @@ -130,16 +283,26 @@ 1 ] ], - "name" : "James Smith" + "id" : "James Smith" }, { + "id" : "Jan Krnavek", "data" : [ [ - "Perl", + "Raku", 2 ] ], + "name" : "Jan Krnavek" + }, + { "name" : "Jorg Sommrey", + "data" : [ + [ + "Perl", + 2 + ] + ], "id" : "Jorg Sommrey" }, { @@ -171,41 +334,40 @@ 2 ] ], - "name" : "Luca Ferrari", - "id" : "Luca Ferrari" + "id" : "Luca Ferrari", + "name" : "Luca Ferrari" }, { - "name" : "Mark Anderson", "data" : [ [ "Raku", 2 ] ], - "id" : "Mark Anderson" + "id" : "Mark Anderson", + "name" : "Mark Anderson" }, { + "id" : "Olivier Delouya", "data" : [ [ "Perl", 1 ] ], - "name" : "Olivier Delouya", - "id" : "Olivier Delouya" + "name" : "Olivier Delouya" }, { - "name" : "Paulo Custodio", + "id" : "Paulo Custodio", "data" : [ [ "Perl", 2 ] ], - "id" : "Paulo Custodio" + "name" : "Paulo Custodio" }, { - "id" : "Roger Bell_West", "data" : [ [ "Perl", @@ -220,6 +382,7 @@ 1 ] ], + "id" : "Roger Bell_West", "name" : "Roger Bell_West" }, { @@ -233,8 +396,8 @@ 1 ] ], - "name" : "Simon Green", - "id" : "Simon Green" + "id" : "Simon Green", + "name" : "Simon Green" }, { "data" : [ @@ -243,18 +406,18 @@ 2 ] ], - "name" : "Simon Proctor", - "id" : "Simon Proctor" + "id" : "Simon Proctor", + "name" : "Simon Proctor" }, { + "name" : "Steven Wilson", "id" : "Steven Wilson", "data" : [ [ "Perl", 2 ] - ], - "name" : "Steven Wilson" + ] }, { "data" : [ @@ -267,11 +430,12 @@ 2 ] ], - "name" : "Stuart Little", - "id" : "Stuart Little" + "id" : "Stuart Little", + "name" : "Stuart Little" }, { "name" : "Ulrich Rieke", + "id" : "Ulrich Rieke", "data" : [ [ "Perl", @@ -281,21 +445,19 @@ "Raku", 2 ] - ], - "id" : "Ulrich Rieke" + ] }, { - "name" : "Vinod Kumar K", + "id" : "Vinod Kumar K", "data" : [ [ "Perl", 1 ] ], - "id" : "Vinod Kumar K" + "name" : "Vinod Kumar K" }, { - "id" : "W. Luis Mochan", "data" : [ [ "Perl", @@ -306,159 +468,12 @@ 1 ] ], + "id" : "W. Luis Mochan", "name" : "W. Luis Mochan" } ] }, - "plotOptions" : { - "series" : { - "dataLabels" : { - "enabled" : 1, - "format" : "{point.y}" - }, - "borderWidth" : 0 - } - }, - "yAxis" : { - "title" : { - "text" : "Total Solutions" - } - }, "subtitle" : { - "text" : "[Champions: 24] Last updated at 2021-07-03 09:35:16 GMT" - }, - "series" : [ - { - "data" : [ - { - "drilldown" : "Abigail", - "y" : 2, - "name" : "Abigail" - }, - { - "name" : "Adam Herzog", - "drilldown" : "Adam Herzog", - "y" : 2 - }, - { - "y" : 4, - "drilldown" : "Athanasius", - "name" : "Athanasius" - }, - { - "drilldown" : "Colin Crain", - "y" : 1, - "name" : "Colin Crain" - }, - { - "y" : 2, - "drilldown" : "Dave Cross", - "name" : "Dave Cross" - }, - { - "drilldown" : "Dave Jacoby", - "y" : 3, - "name" : "Dave Jacoby" - }, - { - "y" : 2, - "drilldown" : "Duane Powell", - "name" : "Duane Powell" - }, - { - "drilldown" : "E. Choroba", - "y" : 2, - "name" : "E. Choroba" - }, - { - "name" : "Flavio Poletti", - "y" : 6, - "drilldown" : "Flavio Poletti" - }, - { - "drilldown" : "James Smith", - "y" : 3, - "name" : "James Smith" - }, - { - "y" : 2, - "drilldown" : "Jorg Sommrey", - "name" : "Jorg Sommrey" - }, - { - "drilldown" : "Laurent Rosenfeld", - "y" : 5, - "name" : "Laurent Rosenfeld" - }, - { - "y" : 4, - "drilldown" : "Luca Ferrari", - "name" : "Luca Ferrari" - }, - { - "name" : "Mark Anderson", - "y" : 2, - "drilldown" : "Mark Anderson" - }, - { - "y" : 1, - "drilldown" : "Olivier Delouya", - "name" : "Olivier Delouya" - }, - { - "name" : "Paulo Custodio", - "drilldown" : "Paulo Custodio", - "y" : 2 - }, - { - "name" : "Roger Bell_West", - "y" : 5, - "drilldown" : "Roger Bell_West" - }, - { - "name" : "Simon Green", - "y" : 3, - "drilldown" : "Simon Green" - }, - { - "y" : 2, - "drilldown" : "Simon Proctor", - "name" : "Simon Proctor" - }, - { - "y" : 2, - "drilldown" : "Steven Wilson", - "name" : "Steven Wilson" - }, - { - "drilldown" : "Stuart Little", - "y" : 4, - "name" : "Stuart Little" - }, - { - "y" : 4, - "drilldown" : "Ulrich Rieke", - "name" : "Ulrich Rieke" - }, - { - "name" : "Vinod Kumar K", - "drilldown" : "Vinod Kumar K", - "y" : 1 - }, - { - "name" : "W. Luis Mochan", - "drilldown" : "W. Luis Mochan", - "y" : 3 - } - ], - "name" : "Perl Weekly Challenge - 119", - "colorByPoint" : 1 - } - ], - "legend" : { - "enabled" : 0 - }, - "title" : { - "text" : "Perl Weekly Challenge - 119" + "text" : "[Champions: 25] Last updated at 2021-07-03 09:46:25 GMT" } } diff --git a/stats/pwc-language-breakdown-summary.json b/stats/pwc-language-breakdown-summary.json index 006e3be35c..61bf08e97d 100644 --- a/stats/pwc-language-breakdown-summary.json +++ b/stats/pwc-language-breakdown-summary.json @@ -1,22 +1,12 @@ { - "subtitle" : { - "text" : "Last updated at 2021-07-03 09:35:16 GMT" - }, - "yAxis" : { - "title" : { - "text" : null - }, - "min" : 0 + "legend" : { + "enabled" : "false" }, "title" : { "text" : "Perl Weekly Challenge Contributions [2019 - 2020]" }, - "legend" : { - "enabled" : "false" - }, "series" : [ { - "name" : "Contributions", "data" : [ [ "Blog", @@ -28,23 +18,27 @@ ], [ "Raku", - 3557 + 3559 ] ], "dataLabels" : { + "align" : "right", + "format" : "{point.y:.0f}", "rotation" : -90, - "color" : "#FFFFFF", "style" : { - "fontSize" : "13px", - "fontFamily" : "Verdana, sans-serif" + "fontFamily" : "Verdana, sans-serif", + "fontSize" : "13px" }, - "y" : 10, + "color" : "#FFFFFF", "enabled" : "true", - "align" : "right", - "format" : "{point.y:.0f}" - } + "y" : 10 + }, + "name" : "Contributions" } ], + "subtitle" : { + "text" : "Last updated at 2021-07-03 09:46:25 GMT" + }, "tooltip" : { "pointFormat" : "<b>{point.y:.0f}</b>" }, @@ -52,11 +46,17 @@ "type" : "category", "labels" : { "style" : { - "fontSize" : "13px", - "fontFamily" : "Verdana, sans-serif" + "fontFamily" : "Verdana, sans-serif", + "fontSize" : "13px" } } }, + "yAxis" : { + "title" : { + "text" : null + }, + "min" : 0 + }, "chart" : { "type" : "column" } diff --git a/stats/pwc-language-breakdown.json b/stats/pwc-language-breakdown.json index 93807fc8f0..7d2d68c5de 100644 --- a/stats/pwc-language-breakdown.json +++ b/stats/pwc-language-breakdown.json @@ -1,9 +1,38 @@ { + "chart" : { + "type" : "column" + }, + "xAxis" : { + "type" : "category" + }, + "plotOptions" : { + "series" : { + "dataLabels" : { + "enabled" : 1, + "format" : "{point.y}" + }, + "borderWidth" : 0 + } + }, + "yAxis" : { + "title" : { + "text" : "Total Solutions" + } + }, + "legend" : { + "enabled" : "false" + }, + "title" : { + "text" : "Perl Weekly Challenge Language" + }, + "tooltip" : { + "followPointer" : "true", + "pointFormat" : "<span style=\"color:{point.color}\">Challenge {point.name}</span>: <b>{point.y:f}</b><br/>", + "headerFormat" : "<span style=\"font-size:11px\"></span>" + }, "drilldown" : { "series" : [ { - "id" : "001", - "name" : "001", "data" : [ [ "Perl", @@ -17,9 +46,12 @@ "Blog", 11 ] - ] + ], + "id" : "001", + "name" : "001" }, { + "name" : "002", "data" : [ [ "Perl", @@ -34,11 +66,11 @@ 10 ] ], - "name" : "002", "id" : "002" }, { "name" : "003", + "id" : "003", "data" : [ [ "Perl", @@ -52,10 +84,10 @@ "Blog", 9 ] - ], - "id" : "003" + ] }, { + "name" : "004", "id" : "004", "data" : [ [ @@ -70,8 +102,7 @@ "Blog", 10 ] - ], - "name" : "004" + ] }, { "id" : "005", @@ -92,6 +123,8 @@ "name" : "005" }, { + "name" : "006", + "id" : "006", "data" : [ [ "Perl", @@ -105,12 +138,10 @@ "Blog", 7 ] - ], - "name" : "006", - "id" : "006" + ] }, { - "name" : "007", + "id" : "007", "data" : [ [ "Perl", @@ -125,11 +156,9 @@ 10 ] ], - "id" : "007" + "name" : "007" }, { - "id" : "008", - "name" : "008", "data" : [ [ "Perl", @@ -143,9 +172,12 @@ "Blog", 12 ] - ] + ], + "id" : "008", + "name" : "008" }, { + "id" : "009", "data" : [ [ "Perl", @@ -160,11 +192,10 @@ 13 ] ], - "name" : "009", - "id" : "009" + "name" : "009" }, { - "id" : "010", + "name" : "010", "data" : [ [ "Perl", @@ -179,9 +210,10 @@ 11 ] ], - "name" : "010" + "id" : "010" }, { + "id" : "011", "data" : [ [ "Perl", @@ -196,10 +228,10 @@ 10 ] ], - "name" : "011", - "id" : "011" + "name" : "011" }, { + "name" : "012", "data" : [ [ "Perl", @@ -214,11 +246,9 @@ 11 ] ], - "name" : "012", "id" : "012" }, { - "id" : "013", "name" : "013", "data" : [ [ @@ -233,7 +263,8 @@ "Blog", 13 ] - ] + ], + "id" : "013" }, { "data" : [ @@ -250,8 +281,8 @@ 15 ] ], - "name" : "014", - "id" : "014" + "id" : "014", + "name" : "014" }, { "name" : "015", @@ -272,7 +303,7 @@ "id" : "015" }, { - "id" : "016", + "name" : "016", "data" : [ [ "Perl", @@ -287,10 +318,9 @@ 12 ] ], - "name" : "016" + "id" : "016" }, { - "name" : "017", "data" : [ [ "Perl", @@ -305,10 +335,11 @@ 12 ] ], - "id" : "017" + "id" : "017", + "name" : "017" }, { - "id" : "018", + "name" : "018", "data" : [ [ "Perl", @@ -323,10 +354,9 @@ 14 ] ], - "name" : "018" + "id" : "018" }, { - "id" : "019", "data" : [ [ "Perl", @@ -341,10 +371,11 @@ 13 |
