Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

You scratch my tape, and I'll scratch yours.


computers / comp.os.linux.advocacy / Simple math/programming challenge for the "REAL programmer" Feeb

SubjectAuthor
* Simple math/programming challenge for the "REAL programmer" FeebDFS
+* Re: Simple math/programming challenge for the "REAL programmer" FeebYaxley Peaks
|`* Re: Simple math/programming challenge for the "REAL programmer" FeebDFS
| +- Re: Simple math/programming challenge for the "REAL programmer" FeebStéphane CARPENTIER
| +* Re: Simple math/programming challenge for the "REAL programmer" FeebTyrone
| |`* Re: Simple math/programming challenge for the "REAL programmer" FeebDFS
| | +* Re: Simple math/programming challenge for the "REAL programmer" Feebvallor
| | |`* Re: Simple math/programming challenge for the "REAL programmer" FeebDFS
| | | +* Re: Simple math/programming challenge for the "REAL programmer" Feebvallor
| | | |`- Re: Simple math/programming challenge for the "REAL programmer" FeebDFS
| | | `- Re: Simple math/programming challenge for the "REAL programmer" Feebvallor
| | `* Re: Simple math/programming challenge for the "REAL programmer" FeebTyrone
| |  `* Re: Simple math/programming challenge for the "REAL programmer" FeebDFS
| |   `* Re: Simple math/programming challenge for the "REAL programmer" FeebTyrone
| |    +- Re: Simple math/programming challenge for the "REAL programmer" FeebDFS
| |    `* Re: Simple math/programming challenge for the "REAL programmer" FeebPhysfitfreak
| |     `- Re: Simple math/programming challenge for the "REAL programmer" FeebDFS
| `* Re: Simple math/programming challenge for the "REAL programmer" FeebYaxley Peaks
|  `- Re: Simple math/programming challenge for the "REAL programmer" FeebDFS
`- Re: Simple math/programming challenge for the "REAL programmer" FeebDFS

1
Simple math/programming challenge for the "REAL programmer" Feeb

<usj06r$2jn18$3@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=11724&group=comp.os.linux.advocacy#11724

  copy link   Newsgroups: comp.os.linux.advocacy
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nospam@dfs.com (DFS)
Newsgroups: comp.os.linux.advocacy
Subject: Simple math/programming challenge for the "REAL programmer" Feeb
Date: Sat, 9 Mar 2024 19:51:39 -0500
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <usj06r$2jn18$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 10 Mar 2024 00:51:39 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ec05b6bf3a15acd02cf034c1d7a8084f";
logging-data="2743336"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18FrAA9ClqPP1ScJTkHwEkW"
User-Agent: Betterbird (Windows)
Cancel-Lock: sha1:cvFvvIDmtcHXSATPcfvNd9Ca8p8=
Content-Language: en-US
 by: DFS - Sun, 10 Mar 2024 00:51 UTC

Code of your own, in any language, to calculate and output all Kaprekar
numbers below 100,000,000.

https://mathworld.wolfram.com/KaprekarNumber.html

Not a ProjectEuler problem.

Break out the fingerpaint, Pedialyte and AppleScript - it's time for
some Piet Programming!

Re: Simple math/programming challenge for the "REAL programmer" Feeb

<87h6heilev.fsf@yaxley.in>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=11738&group=comp.os.linux.advocacy#11738

  copy link   Newsgroups: comp.os.linux.advocacy
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: yax@yaxley.in (Yaxley Peaks)
Newsgroups: comp.os.linux.advocacy
Subject: Re: Simple math/programming challenge for the "REAL programmer" Feeb
Date: Sun, 10 Mar 2024 13:11:12 +0530
Organization: Not a Noiseless Patient Spider
Lines: 23
Message-ID: <87h6heilev.fsf@yaxley.in>
References: <usj06r$2jn18$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="31aa803055a52cd57cfe794de9b3254d";
logging-data="3007191"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19NWRye0s6Cr2Je9Pnq2L44HV9tULzAkl0="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:QCRFX3VjYrw2jYynXI9tEJShNtQ=
sha1:ZuFIu0UB7hKKLnkQOQLs/p4t4WI=
 by: Yaxley Peaks - Sun, 10 Mar 2024 07:41 UTC

Does emacs lisp count?

;; ------------------
(defun kaprekarp (n)
(let* ((num (* n n))
(snum (number-to-string num))
(num-digits (length (number-to-string n)))
(num-list (string-split snum "" t))
(right-side (reverse (take num-digits (reverse num-list))))
(left-side (reverse (nthcdr num-digits (reverse num-list))))
(left-side-num (string-to-number (mapconcat 'identity left-side)))
(right-side-num (string-to-number (mapconcat 'identity right-side))))
(= n (+ right-side-num left-side-num))))
(defun solve-problem (low high)
(seq-keep (lambda (x)
(and (kaprekarp x) x))
(number-sequence low high)))
(solve-problem 1 100000000)
;; ------------------

A very naive solution, but I am sorry, I am very drunk right now lol
--
(yaxp me) => t

Re: Simple math/programming challenge for the "REAL programmer" Feeb

<uskh40$30qhq$2@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=11743&group=comp.os.linux.advocacy#11743

  copy link   Newsgroups: comp.os.linux.advocacy
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nospam@dfs.com (DFS)
Newsgroups: comp.os.linux.advocacy
Subject: Re: Simple math/programming challenge for the "REAL programmer" Feeb
Date: Sun, 10 Mar 2024 10:46:27 -0400
Organization: A noiseless patient Spider
Lines: 113
Message-ID: <uskh40$30qhq$2@dont-email.me>
References: <usj06r$2jn18$3@dont-email.me> <87h6heilev.fsf@yaxley.in>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 10 Mar 2024 14:46:24 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ec05b6bf3a15acd02cf034c1d7a8084f";
logging-data="3172922"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/fIehJo8soZ2L9k7YQLr2N"
User-Agent: Betterbird (Windows)
Cancel-Lock: sha1:hnNW1bxhltemh1ssW6YF9jMsla8=
In-Reply-To: <87h6heilev.fsf@yaxley.in>
Content-Language: en-US
 by: DFS - Sun, 10 Mar 2024 14:46 UTC

On 3/10/2024 3:41 AM, Yaxley Peaks wrote:
> Does emacs lisp count?
>
> ;; ------------------
> (defun kaprekarp (n)
> (let* ((num (* n n))
> (snum (number-to-string num))
> (num-digits (length (number-to-string n)))
> (num-list (string-split snum "" t))
> (right-side (reverse (take num-digits (reverse num-list))))
> (left-side (reverse (nthcdr num-digits (reverse num-list))))
> (left-side-num (string-to-number (mapconcat 'identity left-side)))
> (right-side-num (string-to-number (mapconcat 'identity right-side))))
> (= n (+ right-side-num left-side-num))))
> (defun solve-problem (low high)
> (seq-keep (lambda (x)
> (and (kaprekarp x) x))
> (number-sequence low high)))
> (solve-problem 1 100000000)
> ;; ------------------
>
> A very naive solution, but I am sorry, I am very drunk right now lol

ha! Were you drunk before you started writing the Lisp code?

I submitted it here:
https://rextester.com/l/common_lisp_online_compiler

And got:
Error(s), warning(s):
*** - EVAL: undefined function SEQ-KEEP

When you sober up:
------------------------------------------------------------------------
import sys, time
k=1
start = time.time()
for i in range(4,int(sys.argv[1].replace(',', ''))):
s, n = str(i**2), len(str(i))
if len(s) % 2 != 0: n-=1
p1, p2 = int(s[0:n]), int(s[n:])
if p1 + p2 == i:
print("%4d. %7d ^ 2 = %-16s %8s + %8s = %d" % (k, i, s, p1, p2,
p1+p2))
k+=1
print("%.1fs" % (time.time() - start))
------------------------------------------------------------------------

$ python Knums.py 10,000,000

1. 9 ^ 2 = 81 8 + 1 = 9
2. 45 ^ 2 = 2025 20 + 25 = 45
3. 55 ^ 2 = 3025 30 + 25 = 55
4. 99 ^ 2 = 9801 98 + 1 = 99
5. 297 ^ 2 = 88209 88 + 209 = 297
6. 703 ^ 2 = 494209 494 + 209 = 703
7. 999 ^ 2 = 998001 998 + 1 = 999
8. 2223 ^ 2 = 4941729 494 + 1729 = 2223
9. 2728 ^ 2 = 7441984 744 + 1984 = 2728
10. 4950 ^ 2 = 24502500 2450 + 2500 = 4950
11. 5050 ^ 2 = 25502500 2550 + 2500 = 5050
12. 7272 ^ 2 = 52881984 5288 + 1984 = 7272
13. 7777 ^ 2 = 60481729 6048 + 1729 = 7777
14. 9999 ^ 2 = 99980001 9998 + 1 = 9999
15. 17344 ^ 2 = 300814336 3008 + 14336 = 17344
16. 22222 ^ 2 = 493817284 4938 + 17284 = 22222
17. 77778 ^ 2 = 6049417284 60494 + 17284 = 77778
18. 82656 ^ 2 = 6832014336 68320 + 14336 = 82656
19. 95121 ^ 2 = 9048004641 90480 + 4641 = 95121
20. 99999 ^ 2 = 9999800001 99998 + 1 = 99999
21. 142857 ^ 2 = 20408122449 20408 + 122449 = 142857
22. 148149 ^ 2 = 21948126201 21948 + 126201 = 148149
23. 181819 ^ 2 = 33058148761 33058 + 148761 = 181819
24. 187110 ^ 2 = 35010152100 35010 + 152100 = 187110
25. 208495 ^ 2 = 43470165025 43470 + 165025 = 208495
26. 318682 ^ 2 = 101558217124 101558 + 217124 = 318682
27. 329967 ^ 2 = 108878221089 108878 + 221089 = 329967
28. 351352 ^ 2 = 123448227904 123448 + 227904 = 351352
29. 356643 ^ 2 = 127194229449 127194 + 229449 = 356643
30. 390313 ^ 2 = 152344237969 152344 + 237969 = 390313
31. 461539 ^ 2 = 213018248521 213018 + 248521 = 461539
32. 466830 ^ 2 = 217930248900 217930 + 248900 = 466830
33. 499500 ^ 2 = 249500250000 249500 + 250000 = 499500
34. 500500 ^ 2 = 250500250000 250500 + 250000 = 500500
35. 533170 ^ 2 = 284270248900 284270 + 248900 = 533170
36. 538461 ^ 2 = 289940248521 289940 + 248521 = 538461
37. 609687 ^ 2 = 371718237969 371718 + 237969 = 609687
38. 643357 ^ 2 = 413908229449 413908 + 229449 = 643357
39. 648648 ^ 2 = 420744227904 420744 + 227904 = 648648
40. 670033 ^ 2 = 448944221089 448944 + 221089 = 670033
41. 681318 ^ 2 = 464194217124 464194 + 217124 = 681318
42. 791505 ^ 2 = 626480165025 626480 + 165025 = 791505
43. 812890 ^ 2 = 660790152100 660790 + 152100 = 812890
44. 818181 ^ 2 = 669420148761 669420 + 148761 = 818181
45. 851851 ^ 2 = 725650126201 725650 + 126201 = 851851
46. 857143 ^ 2 = 734694122449 734694 + 122449 = 857143
47. 961038 ^ 2 = 923594037444 923594 + 37444 = 961038
48. 994708 ^ 2 = 989444005264 989444 + 5264 = 994708
49. 999999 ^ 2 = 999998000001 999998 + 1 = 999999
50. 4444444 ^ 2 = 19753082469136 1975308 + 2469136 = 4444444
51. 4927941 ^ 2 = 24284602499481 2428460 + 2499481 = 4927941
52. 5072059 ^ 2 = 25725782499481 2572578 + 2499481 = 5072059
53. 5555556 ^ 2 = 30864202469136 3086420 + 2469136 = 5555556
54. 9372385 ^ 2 = 87841600588225 8784160 + 588225 = 9372385
55. 9999999 ^ 2 = 99999980000001 9999998 + 1 = 9999999
6.2s

And 1 is somehow considered a Kaprekar number.

Re: Simple math/programming challenge for the "REAL programmer" Feeb

<65edce9e$0$8244$426a74cc@news.free.fr>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=11746&group=comp.os.linux.advocacy#11746

  copy link   Newsgroups: comp.os.linux.advocacy
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!cleanfeed1-a.proxad.net!nnrp4-1.free.fr!not-for-mail
Newsgroups: comp.os.linux.advocacy
From: sc@fiat-linux.fr (Stéphane CARPENTIER)
Subject: Re: Simple math/programming challenge for the "REAL programmer" Feeb
References: <usj06r$2jn18$3@dont-email.me> <87h6heilev.fsf@yaxley.in>
<uskh40$30qhq$2@dont-email.me>
Organization: Mulots' Killer
User-Agent: slrn/pre1.0.4-9 (Linux)
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Date: 10 Mar 2024 15:15:42 GMT
Lines: 13
Message-ID: <65edce9e$0$8244$426a74cc@news.free.fr>
NNTP-Posting-Date: 10 Mar 2024 16:15:42 CET
NNTP-Posting-Host: 78.201.248.7
X-Trace: 1710083742 news-2.free.fr 8244 78.201.248.7:42806
X-Complaints-To: abuse@proxad.net
 by: Stéphane CARPENTIER - Sun, 10 Mar 2024 15:15 UTC

Le 10-03-2024, DFS <nospam@dfs.com> a écrit :
> On 3/10/2024 3:41 AM, Yaxley Peaks wrote:
>> Does emacs lisp count?
>
> I submitted it here:
> https://rextester.com/l/common_lisp_online_compiler

Emacs Lisp is neither Common Lisp nor Scheme. You have to use Emacs (or
something compatible with Emacs) to be able to run it.

--
Si vous avez du temps à perdre :
https://scarpet42.gitlab.io

Re: Simple math/programming challenge for the "REAL programmer" Feeb

<09acnYe4UemsSnD4nZ2dnZfqnPidnZ2d@supernews.com>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=11748&group=comp.os.linux.advocacy#11748

  copy link   Newsgroups: comp.os.linux.advocacy
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!feeder.usenetexpress.com!tr1.iad1.usenetexpress.com!69.80.99.22.MISMATCH!Xl.tags.giganews.com!local-2.nntp.ord.giganews.com!nntp.supernews.com!news.supernews.com.POSTED!not-for-mail
NNTP-Posting-Date: Sun, 10 Mar 2024 15:52:17 +0000
From: none@none.none (Tyrone)
Newsgroups: comp.os.linux.advocacy
Subject: Re: Simple math/programming challenge for the "REAL programmer" Feeb
X-No-Archive: Yes
References: <usj06r$2jn18$3@dont-email.me> <87h6heilev.fsf@yaxley.in> <uskh40$30qhq$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=fixed
Content-Transfer-Encoding: 8bit
User-Agent: Usenapp for MacOS
X-Usenapp: v1.27.2/l - Full License
Message-ID: <09acnYe4UemsSnD4nZ2dnZfqnPidnZ2d@supernews.com>
Date: Sun, 10 Mar 2024 15:52:17 +0000
Lines: 133
X-Trace: sv3-ogjR72aV/KXGcUK7LgjPpLu9lVA+UKZ9q+SZY8HZehcVjGdAkkDM7kSaAiwneOxE2mMqk0miEJWdhcX!wTMEzwzYFfzZEJYAdrdif1wYpeLcuRbYhucTpjA8OP7yIyfvGK5rUsitGE61E5fk0rMCAA3dcDq5!yl4i6/pc
X-Complaints-To: www.supernews.com/docs/abuse.html
X-DMCA-Complaints-To: www.supernews.com/docs/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
 by: Tyrone - Sun, 10 Mar 2024 15:52 UTC

On Mar 10, 2024 at 10:46:27 AM EDT, "DFS" <nospam@dfs.com> wrote:

> On 3/10/2024 3:41 AM, Yaxley Peaks wrote:
>> Does emacs lisp count?
>>
>> ;; ------------------
>> (defun kaprekarp (n)
>> (let* ((num (* n n))
>> (snum (number-to-string num))
>> (num-digits (length (number-to-string n)))
>> (num-list (string-split snum "" t))
>> (right-side (reverse (take num-digits (reverse num-list))))
>> (left-side (reverse (nthcdr num-digits (reverse num-list))))
>> (left-side-num (string-to-number (mapconcat 'identity left-side)))
>> (right-side-num (string-to-number (mapconcat 'identity right-side))))
>> (= n (+ right-side-num left-side-num))))
>> (defun solve-problem (low high)
>> (seq-keep (lambda (x)
>> (and (kaprekarp x) x))
>> (number-sequence low high)))
>> (solve-problem 1 100000000)
>> ;; ------------------
>>
>> A very naive solution, but I am sorry, I am very drunk right now lol
>
>
> ha! Were you drunk before you started writing the Lisp code?
>
>
> I submitted it here:
> https://rextester.com/l/common_lisp_online_compiler
>
> And got:
> Error(s), warning(s):
> *** - EVAL: undefined function SEQ-KEEP
>
>
>
> When you sober up:
> ------------------------------------------------------------------------
> import sys, time
> k=1
> start = time.time()
> for i in range(4,int(sys.argv[1].replace(',', ''))):
> s, n = str(i**2), len(str(i))
> if len(s) % 2 != 0: n-=1
> p1, p2 = int(s[0:n]), int(s[n:])
> if p1 + p2 == i:
> print("%4d. %7d ^ 2 = %-16s %8s + %8s = %d" % (k, i, s, p1, p2,
> p1+p2))
> k+=1
> print("%.1fs" % (time.time() - start))
> ------------------------------------------------------------------------
>
> $ python Knums.py 10,000,000
>
>
> 1. 9 ^ 2 = 81 8 + 1 = 9
> 2. 45 ^ 2 = 2025 20 + 25 = 45
> 3. 55 ^ 2 = 3025 30 + 25 = 55
> 4. 99 ^ 2 = 9801 98 + 1 = 99
> 5. 297 ^ 2 = 88209 88 + 209 = 297
> 6. 703 ^ 2 = 494209 494 + 209 = 703
> 7. 999 ^ 2 = 998001 998 + 1 = 999
> 8. 2223 ^ 2 = 4941729 494 + 1729 = 2223
> 9. 2728 ^ 2 = 7441984 744 + 1984 = 2728
> 10. 4950 ^ 2 = 24502500 2450 + 2500 = 4950
> 11. 5050 ^ 2 = 25502500 2550 + 2500 = 5050
> 12. 7272 ^ 2 = 52881984 5288 + 1984 = 7272
> 13. 7777 ^ 2 = 60481729 6048 + 1729 = 7777
> 14. 9999 ^ 2 = 99980001 9998 + 1 = 9999
> 15. 17344 ^ 2 = 300814336 3008 + 14336 = 17344
> 16. 22222 ^ 2 = 493817284 4938 + 17284 = 22222
> 17. 77778 ^ 2 = 6049417284 60494 + 17284 = 77778
> 18. 82656 ^ 2 = 6832014336 68320 + 14336 = 82656
> 19. 95121 ^ 2 = 9048004641 90480 + 4641 = 95121
> 20. 99999 ^ 2 = 9999800001 99998 + 1 = 99999
> 21. 142857 ^ 2 = 20408122449 20408 + 122449 = 142857
> 22. 148149 ^ 2 = 21948126201 21948 + 126201 = 148149
> 23. 181819 ^ 2 = 33058148761 33058 + 148761 = 181819
> 24. 187110 ^ 2 = 35010152100 35010 + 152100 = 187110
> 25. 208495 ^ 2 = 43470165025 43470 + 165025 = 208495
> 26. 318682 ^ 2 = 101558217124 101558 + 217124 = 318682
> 27. 329967 ^ 2 = 108878221089 108878 + 221089 = 329967
> 28. 351352 ^ 2 = 123448227904 123448 + 227904 = 351352
> 29. 356643 ^ 2 = 127194229449 127194 + 229449 = 356643
> 30. 390313 ^ 2 = 152344237969 152344 + 237969 = 390313
> 31. 461539 ^ 2 = 213018248521 213018 + 248521 = 461539
> 32. 466830 ^ 2 = 217930248900 217930 + 248900 = 466830
> 33. 499500 ^ 2 = 249500250000 249500 + 250000 = 499500
> 34. 500500 ^ 2 = 250500250000 250500 + 250000 = 500500
> 35. 533170 ^ 2 = 284270248900 284270 + 248900 = 533170
> 36. 538461 ^ 2 = 289940248521 289940 + 248521 = 538461
> 37. 609687 ^ 2 = 371718237969 371718 + 237969 = 609687
> 38. 643357 ^ 2 = 413908229449 413908 + 229449 = 643357
> 39. 648648 ^ 2 = 420744227904 420744 + 227904 = 648648
> 40. 670033 ^ 2 = 448944221089 448944 + 221089 = 670033
> 41. 681318 ^ 2 = 464194217124 464194 + 217124 = 681318
> 42. 791505 ^ 2 = 626480165025 626480 + 165025 = 791505
> 43. 812890 ^ 2 = 660790152100 660790 + 152100 = 812890
> 44. 818181 ^ 2 = 669420148761 669420 + 148761 = 818181
> 45. 851851 ^ 2 = 725650126201 725650 + 126201 = 851851
> 46. 857143 ^ 2 = 734694122449 734694 + 122449 = 857143
> 47. 961038 ^ 2 = 923594037444 923594 + 37444 = 961038
> 48. 994708 ^ 2 = 989444005264 989444 + 5264 = 994708
> 49. 999999 ^ 2 = 999998000001 999998 + 1 = 999999
> 50. 4444444 ^ 2 = 19753082469136 1975308 + 2469136 = 4444444
> 51. 4927941 ^ 2 = 24284602499481 2428460 + 2499481 = 4927941
> 52. 5072059 ^ 2 = 25725782499481 2572578 + 2499481 = 5072059
> 53. 5555556 ^ 2 = 30864202469136 3086420 + 2469136 = 5555556
> 54. 9372385 ^ 2 = 87841600588225 8784160 + 588225 = 9372385
> 55. 9999999 ^ 2 = 99999980000001 9999998 + 1 = 9999999
> 6.2s
>
> And 1 is somehow considered a Kaprekar number.

1 IS a Kaprekar number.

Other than 1, your list above is missing at least 4 numbers: 4879, 5292, 38962
and 627615. The reason is you are not handling zeros correctly.

But seriously, these numbers are constants. There is no need to waste my time
and computer time calculating them. Put them in an array and do a search for
whatever number you want to check. "Is 123456 a Kaprekar number?" Not in the
array, so no it is not.

Done.

If I was writing a program that used PI (3.14159265) in many places, I would
define it as a CONST. I would not waste my time calculating it every time I
needed it. PI has already been calculated to one million digits.

Why waste time re-inventing the wheel?

Re: Simple math/programming challenge for the "REAL programmer" Feeb

<87y1aqaxij.fsf@yaxley.in>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=11749&group=comp.os.linux.advocacy#11749

  copy link   Newsgroups: comp.os.linux.advocacy
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: yax@yaxley.in (Yaxley Peaks)
Newsgroups: comp.os.linux.advocacy
Subject: Re: Simple math/programming challenge for the "REAL programmer" Feeb
Date: Sun, 10 Mar 2024 21:29:16 +0530
Organization: Not a Noiseless Patient Spider
Lines: 11
Message-ID: <87y1aqaxij.fsf@yaxley.in>
References: <usj06r$2jn18$3@dont-email.me> <87h6heilev.fsf@yaxley.in>
<uskh40$30qhq$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="31aa803055a52cd57cfe794de9b3254d";
logging-data="3201363"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18RLQlFxoHtfNTpGH0LTxCqUEaGyYRis5g="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:BLtM4oWNco8wtcNerIkZdnqM7j8=
sha1:cD2IHn5Ha1eU4m0uMLHZEIXHMZs=
 by: Yaxley Peaks - Sun, 10 Mar 2024 15:59 UTC

> And got:
> Error(s), warning(s):
> *** - EVAL: undefined function SEQ-KEEP

SEQ-KEEP was added in emacs 29, what version are you using?
https://www.gnu.org/software/emacs/manual/html_node/elisp/Sequence-Functions.html#index-seq_002dkeep

>Were you drunk before you started writing the Lisp code?
yeah :)
--
(yaxp me) => t

Re: Simple math/programming challenge for the "REAL programmer" Feeb

<uskvmv$341fu$8@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=11754&group=comp.os.linux.advocacy#11754

  copy link   Newsgroups: comp.os.linux.advocacy
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nospam@dfs.com (DFS)
Newsgroups: comp.os.linux.advocacy
Subject: Re: Simple math/programming challenge for the "REAL programmer" Feeb
Date: Sun, 10 Mar 2024 14:55:28 -0400
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <uskvmv$341fu$8@dont-email.me>
References: <usj06r$2jn18$3@dont-email.me> <87h6heilev.fsf@yaxley.in>
<uskh40$30qhq$2@dont-email.me> <87y1aqaxij.fsf@yaxley.in>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 10 Mar 2024 18:55:27 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ec05b6bf3a15acd02cf034c1d7a8084f";
logging-data="3278334"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18T2U8Xestn00aAhgo2TWtG"
User-Agent: Betterbird (Windows)
Cancel-Lock: sha1:xW3y89o+5AjhVSmCIlAKq2Yl1lI=
Content-Language: en-US
In-Reply-To: <87y1aqaxij.fsf@yaxley.in>
 by: DFS - Sun, 10 Mar 2024 18:55 UTC

On 3/10/2024 11:59 AM, Yaxley Peaks wrote:
>> And got:
>> Error(s), warning(s):
>> *** - EVAL: undefined function SEQ-KEEP
>
> SEQ-KEEP was added in emacs 29, what version are you using?
> https://www.gnu.org/software/emacs/manual/html_node/elisp/Sequence-Functions.html#index-seq_002dkeep

As I said, I submitted it here:
https://rextester.com/l/common_lisp_online_compiler

Just post the output of your lisp code.

(defun kaprekarp (n)
(let* ((num (* n n))
(snum (number-to-string num))
(num-digits (length (number-to-string n)))
(num-list (string-split snum "" t))
(right-side (reverse (take num-digits (reverse num-list))))
(left-side (reverse (nthcdr num-digits (reverse num-list))))
(left-side-num (string-to-number (mapconcat 'identity left-side)))
(right-side-num (string-to-number (mapconcat 'identity
right-side))))
(= n (+ right-side-num left-side-num))))
(defun solve-problem (low high)
(seq-keep (lambda (x)
(and (kaprekarp x) x))
(number-sequence low high)))
(solve-problem 1 100000000)

Re: Simple math/programming challenge for the "REAL programmer" Feeb

<usl2qu$34lr8$3@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=11761&group=comp.os.linux.advocacy#11761

  copy link   Newsgroups: comp.os.linux.advocacy
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nospam@dfs.com (DFS)
Newsgroups: comp.os.linux.advocacy
Subject: Re: Simple math/programming challenge for the "REAL programmer" Feeb
Date: Sun, 10 Mar 2024 15:48:47 -0400
Organization: A noiseless patient Spider
Lines: 50
Message-ID: <usl2qu$34lr8$3@dont-email.me>
References: <usj06r$2jn18$3@dont-email.me> <87h6heilev.fsf@yaxley.in>
<uskh40$30qhq$2@dont-email.me>
<09acnYe4UemsSnD4nZ2dnZfqnPidnZ2d@supernews.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 10 Mar 2024 19:48:47 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ec05b6bf3a15acd02cf034c1d7a8084f";
logging-data="3299176"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/JQ9oVSHjdDipFhGLklENf"
User-Agent: Betterbird (Windows)
Cancel-Lock: sha1:bIjAuIJhjpeq72z4FiLJjJBWrBs=
In-Reply-To: <09acnYe4UemsSnD4nZ2dnZfqnPidnZ2d@supernews.com>
Content-Language: en-US
 by: DFS - Sun, 10 Mar 2024 19:48 UTC

On 3/10/2024 11:52 AM, Tyrone wrote:
> On Mar 10, 2024 at 10:46:27 AM EDT, "DFS" <nospam@dfs.com> wrote:

> Other than 1, your list above is missing at least 4 numbers: 4879, 5292, 38962
> and 627615. The reason is you are not handling zeros correctly.

Depends on who you ask.

https://oeis.org/A053816
https://oeis.org/A006886

> But seriously, these numbers are constants. There is no need to waste my time
> and computer time calculating them.

You just wasted your time and computer time responding to this post.

> Put them in an array and do a search for
> whatever number you want to check. "Is 123456 a Kaprekar number?" Not in the
> array, so no it is not.
>
> Done.

There are infinite K numbers.

Better to use a few lines of code to calculate/check them on demand. And
then you can generalize the K code for powers > 2 (not shown here, but
easy to do).

def isKaprekar(val,exp):
s,n = str(val**exp), len(str(val))
if len(s) % exp != 0: n-=1
p1,p2 = int(s[0:n]), int(s[n:])
if p1 + p2 == val:
return True
else:
return False

> Why waste time re-inventing the wheel?

What if I want to call out that talentless "REAL programmer /
mathematician / extraordinaire" hack Feeb Russell, so I can watch him
squirm and flub a tiny math program?

Re: Simple math/programming challenge for the "REAL programmer" Feeb

<usl39t$347pu$4@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=11762&group=comp.os.linux.advocacy#11762

  copy link   Newsgroups: comp.os.linux.advocacy
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: vallor@cultnix.org (vallor)
Newsgroups: comp.os.linux.advocacy
Subject: Re: Simple math/programming challenge for the "REAL programmer" Feeb
Date: Sun, 10 Mar 2024 19:56:45 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 56
Message-ID: <usl39t$347pu$4@dont-email.me>
References: <usj06r$2jn18$3@dont-email.me> <87h6heilev.fsf@yaxley.in>
<uskh40$30qhq$2@dont-email.me>
<09acnYe4UemsSnD4nZ2dnZfqnPidnZ2d@supernews.com>
<usl2qu$34lr8$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 10 Mar 2024 19:56:45 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="81ad7be002f583b290569ed3788100ad";
logging-data="3284798"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19RcoaAX9jgzucNO4OppDID"
User-Agent: Pan/0.155 (Kherson; c0bf34e gitlab.gnome.org/GNOME/pan.git;
x86_64-pc-linux-gnu)
Cancel-Lock: sha1:Nri7HBVnSs0YGpz/baTxb0fDAro=
X-Face: \}2`P"_@pS86<'EM:'b.Ml}8IuMK"pV"?FReF$'c.S%u9<Q#U*4QO)$l81M`{Q/n
XL'`91kd%N::LG:=*\35JS0prp\VJN^<s"b#bff@fA7]5lJA.jn,x_d%Md$,{.EZ
 by: vallor - Sun, 10 Mar 2024 19:56 UTC

On Sun, 10 Mar 2024 15:48:47 -0400, DFS <nospam@dfs.com> wrote in
<usl2qu$34lr8$3@dont-email.me>:

> On 3/10/2024 11:52 AM, Tyrone wrote:
>> On Mar 10, 2024 at 10:46:27 AM EDT, "DFS" <nospam@dfs.com> wrote:
>
>
>> Other than 1, your list above is missing at least 4 numbers: 4879, 5292, 38962
>> and 627615. The reason is you are not handling zeros correctly.
>
> Depends on who you ask.
>
> https://oeis.org/A053816
> https://oeis.org/A006886
>
>
>> But seriously, these numbers are constants. There is no need to waste my time
>> and computer time calculating them.
>
> You just wasted your time and computer time responding to this post.
>
>
>
>> Put them in an array and do a search for
>> whatever number you want to check. "Is 123456 a Kaprekar number?" Not in the
>> array, so no it is not.
>>
>> Done.
>
> There are infinite K numbers.
>
> Better to use a few lines of code to calculate/check them on demand. And
> then you can generalize the K code for powers > 2 (not shown here, but
> easy to do).
>
> def isKaprekar(val,exp):
> s,n = str(val**exp), len(str(val))
> if len(s) % exp != 0: n-=1
> p1,p2 = int(s[0:n]), int(s[n:])
> if p1 + p2 == val:
> return True
> else:
> return False
>
>
>
> > Why waste time re-inventing the wheel?
>
> What if I want to call out that talentless "REAL programmer /
> mathematician / extraordinaire" hack Feeb Russell, so I can watch him
> squirm and flub a tiny math program?

That would be an off-charter post, like this one.

--
-v

Re: Simple math/programming challenge for the "REAL programmer" Feeb

<usl3gj$34lr8$4@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=11764&group=comp.os.linux.advocacy#11764

  copy link   Newsgroups: comp.os.linux.advocacy
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nospam@dfs.com (DFS)
Newsgroups: comp.os.linux.advocacy
Subject: Re: Simple math/programming challenge for the "REAL programmer" Feeb
Date: Sun, 10 Mar 2024 16:00:19 -0400
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <usl3gj$34lr8$4@dont-email.me>
References: <usj06r$2jn18$3@dont-email.me> <87h6heilev.fsf@yaxley.in>
<uskh40$30qhq$2@dont-email.me>
<09acnYe4UemsSnD4nZ2dnZfqnPidnZ2d@supernews.com>
<usl2qu$34lr8$3@dont-email.me> <usl39t$347pu$4@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 10 Mar 2024 20:00:19 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ec05b6bf3a15acd02cf034c1d7a8084f";
logging-data="3299176"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Y4+u+1LVflP7BFArUhyZk"
User-Agent: Betterbird (Windows)
Cancel-Lock: sha1:LvB/3+xZUcw1ZNKYLAQF46qJLsI=
In-Reply-To: <usl39t$347pu$4@dont-email.me>
Content-Language: en-US
 by: DFS - Sun, 10 Mar 2024 20:00 UTC

On 3/10/2024 3:56 PM, vallor wrote:
> On Sun, 10 Mar 2024 15:48:47 -0400, DFS <nospam@dfs.com> wrote in

Telling me my post is off-charter is off-charter.

Get on-charter! Now!

Re: Simple math/programming challenge for the "REAL programmer" Feeb

<usl3qs$347pu$7@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=11766&group=comp.os.linux.advocacy#11766

  copy link   Newsgroups: comp.os.linux.advocacy
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: vallor@cultnix.org (vallor)
Newsgroups: comp.os.linux.advocacy
Subject: Re: Simple math/programming challenge for the "REAL programmer" Feeb
Date: Sun, 10 Mar 2024 20:05:48 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <usl3qs$347pu$7@dont-email.me>
References: <usj06r$2jn18$3@dont-email.me> <87h6heilev.fsf@yaxley.in>
<uskh40$30qhq$2@dont-email.me>
<09acnYe4UemsSnD4nZ2dnZfqnPidnZ2d@supernews.com>
<usl2qu$34lr8$3@dont-email.me> <usl39t$347pu$4@dont-email.me>
<usl3gj$34lr8$4@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 10 Mar 2024 20:05:48 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="81ad7be002f583b290569ed3788100ad";
logging-data="3284798"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/KerB0MfxBZy4T2Om8Eb33"
User-Agent: Pan/0.155 (Kherson; c0bf34e gitlab.gnome.org/GNOME/pan.git;
x86_64-pc-linux-gnu)
Cancel-Lock: sha1:3vhTUxiWiVMOevsqa14ifthsgik=
X-Face: \}2`P"_@pS86<'EM:'b.Ml}8IuMK"pV"?FReF$'c.S%u9<Q#U*4QO)$l81M`{Q/n
XL'`91kd%N::LG:=*\35JS0prp\VJN^<s"b#bff@fA7]5lJA.jn,x_d%Md$,{.EZ
 by: vallor - Sun, 10 Mar 2024 20:05 UTC

On Sun, 10 Mar 2024 16:00:19 -0400, DFS <nospam@dfs.com> wrote in
<usl3gj$34lr8$4@dont-email.me>:

> On 3/10/2024 3:56 PM, vallor wrote:
>> On Sun, 10 Mar 2024 15:48:47 -0400, DFS <nospam@dfs.com> wrote in
>
>
> Telling me my post is off-charter is off-charter.
>
>
> Get on-charter! Now!

Are you threatened by the prospect of not being on charter?

ObLinux:
COMPFACE(1) General Commands Manual COMPFACE(1)

NAME
compface, uncompface - compress and expand 48x48x1 face image
files

SYNOPSIS
compface [ infile [ outfile ] ] ...

uncompface [-X] [ infile [ outfile ] ] ...
_ _ _ _ _ _ _

Does Windows have compface(1)?

--
-v

Re: Simple math/programming challenge for the "REAL programmer" Feeb

<usl41p$347pu$8@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=11767&group=comp.os.linux.advocacy#11767

  copy link   Newsgroups: comp.os.linux.advocacy
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: vallor@cultnix.org (vallor)
Newsgroups: comp.os.linux.advocacy
Subject: Re: Simple math/programming challenge for the "REAL programmer" Feeb
Date: Sun, 10 Mar 2024 20:09:30 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <usl41p$347pu$8@dont-email.me>
References: <usj06r$2jn18$3@dont-email.me> <87h6heilev.fsf@yaxley.in>
<uskh40$30qhq$2@dont-email.me>
<09acnYe4UemsSnD4nZ2dnZfqnPidnZ2d@supernews.com>
<usl2qu$34lr8$3@dont-email.me> <usl39t$347pu$4@dont-email.me>
<usl3gj$34lr8$4@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 10 Mar 2024 20:09:30 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="81ad7be002f583b290569ed3788100ad";
logging-data="3284798"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX186Si9EqXkA7iIljN0cI4CR"
User-Agent: Pan/0.155 (Kherson; c0bf34e gitlab.gnome.org/GNOME/pan.git;
x86_64-pc-linux-gnu)
Cancel-Lock: sha1:2Kw3DPPgp5kVrg2H5ySf5S1DcgY=
X-Face: \}2`P"_@pS86<'EM:'b.Ml}8IuMK"pV"?FReF$'c.S%u9<Q#U*4QO)$l81M`{Q/n
XL'`91kd%N::LG:=*\35JS0prp\VJN^<s"b#bff@fA7]5lJA.jn,x_d%Md$,{.EZ
 by: vallor - Sun, 10 Mar 2024 20:09 UTC

On Sun, 10 Mar 2024 16:00:19 -0400, DFS <nospam@dfs.com> wrote in
<usl3gj$34lr8$4@dont-email.me>:

> On 3/10/2024 3:56 PM, vallor wrote:
>> On Sun, 10 Mar 2024 15:48:47 -0400, DFS <nospam@dfs.com> wrote in
>
>
> Telling me my post is off-charter is off-charter.
>
>
> Get on-charter! Now!

I did, and I even asked you a question about Windows
vs. Linux.

ObLinux:
Windows has Linux as an installable component now.
Womp-womp.

--
-v

Re: Simple math/programming challenge for the "REAL programmer" Feeb

<LmidnXKcc4PChHP4nZ2dnZfqn_udnZ2d@supernews.com>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=11770&group=comp.os.linux.advocacy#11770

  copy link   Newsgroups: comp.os.linux.advocacy
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!Xl.tags.giganews.com!local-1.nntp.ord.giganews.com!nntp.supernews.com!news.supernews.com.POSTED!not-for-mail
NNTP-Posting-Date: Sun, 10 Mar 2024 20:34:39 +0000
From: none@none.none (Tyrone)
Newsgroups: comp.os.linux.advocacy
Subject: Re: Simple math/programming challenge for the "REAL programmer" Feeb
X-No-Archive: Yes
References: <usj06r$2jn18$3@dont-email.me> <87h6heilev.fsf@yaxley.in> <uskh40$30qhq$2@dont-email.me> <09acnYe4UemsSnD4nZ2dnZfqnPidnZ2d@supernews.com> <usl2qu$34lr8$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=fixed
Content-Transfer-Encoding: 8bit
User-Agent: Usenapp for MacOS
X-Usenapp: v1.27.2/l - Full License
Message-ID: <LmidnXKcc4PChHP4nZ2dnZfqn_udnZ2d@supernews.com>
Date: Sun, 10 Mar 2024 20:34:39 +0000
Lines: 42
X-Trace: sv3-KyzmA80ey231YoWgzwpr3i/APC7ZEcyEzUBDP0QU1LRM7ekUVASBmyVUzsnjKrNg28ftH5KHmNrl4X0!1uD6NaV9v3LORxWnYzuO1gfkETPloEUxM4Ks9Xs8ToYDnvg2R2pJS6wiXB3K71S/O9RAAiegCmsm!QXP9mArA
X-Complaints-To: www.supernews.com/docs/abuse.html
X-DMCA-Complaints-To: www.supernews.com/docs/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Received-Bytes: 2632
 by: Tyrone - Sun, 10 Mar 2024 20:34 UTC

On Mar 10, 2024 at 3:48:47 PM EDT, "DFS" <nospam@dfs.com> wrote:

> What if I want to call out that talentless "REAL programmer /
> mathematician / extraordinaire" hack Feeb Russell, so I can watch him
> squirm and flub a tiny math program?

This is a ridiculous way to attempt to "call out" anyone. This code is already
available in every language you have heard of, and some you have never heard
of. For example:

<https://rosettacode.org/wiki/Kaprekar_numbers>

Here it is in Ursala:

==========
Ursala
First we define a function kd parameterized by a pair of functions p and r for
printing and reading natural numbers, which takes a natural number to its
Kaprekar decomposition if any.

#import std
#import nat

kd("p","r") = ~&ihB+ (~&rr&& ^|E/~& sum)~|^/~& "r"~~*hNCtXS+ cuts\1+ "p"+
product@iiX

#cast %nLnX

t = ^|(~&,length) (iota; :/1+ ~&rFlS+ * ^/~& kd\%np ~&h+ %nP)~~/10000 1000000
==========

Now THAT is some obscure code!

There are dozens more, from Ada to zkl. Even IBM 360 Assembly. Pick your
language and run the code.

AGAIN, there is way more to programming than just trivial math problems.
Particularly, trivial math problems that have already been solved in every
language, many years ago.

This is not a "programming challenge". It is a simple internet search
challenge.

Re: Simple math/programming challenge for the "REAL programmer" Feeb

<usl6c3$35de0$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=11774&group=comp.os.linux.advocacy#11774

  copy link   Newsgroups: comp.os.linux.advocacy
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nospam@dfs.com (DFS)
Newsgroups: comp.os.linux.advocacy
Subject: Re: Simple math/programming challenge for the "REAL programmer" Feeb
Date: Sun, 10 Mar 2024 16:49:07 -0400
Organization: A noiseless patient Spider
Lines: 47
Message-ID: <usl6c3$35de0$1@dont-email.me>
References: <usj06r$2jn18$3@dont-email.me> <87h6heilev.fsf@yaxley.in>
<uskh40$30qhq$2@dont-email.me>
<09acnYe4UemsSnD4nZ2dnZfqnPidnZ2d@supernews.com>
<usl2qu$34lr8$3@dont-email.me>
<LmidnXKcc4PChHP4nZ2dnZfqn_udnZ2d@supernews.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 10 Mar 2024 20:49:07 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ec05b6bf3a15acd02cf034c1d7a8084f";
logging-data="3323328"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+361nZhATqkbaCZl9rS9Zg"
User-Agent: Betterbird (Windows)
Cancel-Lock: sha1:9hQRGNNaWf8o6oUl34CL09RE6DY=
In-Reply-To: <LmidnXKcc4PChHP4nZ2dnZfqn_udnZ2d@supernews.com>
Content-Language: en-US
 by: DFS - Sun, 10 Mar 2024 20:49 UTC

On 3/10/2024 4:34 PM, Tyrone wrote:
> On Mar 10, 2024 at 3:48:47 PM EDT, "DFS" <nospam@dfs.com> wrote:
>
>> What if I want to call out that talentless "REAL programmer /
>> mathematician / extraordinaire" hack Feeb Russell, so I can watch him
>> squirm and flub a tiny math program?
>
> This is a ridiculous way to attempt to "call out" anyone. This code is already
> available in every language you have heard of, and some you have never heard
> of.

I didn't ask for previously-written code.

> There are dozens more, from Ada to zkl. Even IBM 360 Assembly. Pick your
> language and run the code.

I don't care.

I wrote my own python first, based on the Wolfram page, then asked Feeb
for his version in any language.

> AGAIN, there is way more to programming than just trivial math problems.

I never said there wasn't.

> Particularly, trivial math problems that have already been solved in every
> language, many years ago.

Not by Feeb.

> This is not a "programming challenge".

Of course it is.

Read the first 4 words of the original post.

> It is a simple internet search challenge.

Even though I clearly explained, you still don't get it.

Re: Simple math/programming challenge for the "REAL programmer" Feeb

<uslekm$3765n$3@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=11781&group=comp.os.linux.advocacy#11781

  copy link   Newsgroups: comp.os.linux.advocacy
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nospam@dfs.com (DFS)
Newsgroups: comp.os.linux.advocacy
Subject: Re: Simple math/programming challenge for the "REAL programmer" Feeb
Date: Sun, 10 Mar 2024 19:10:15 -0400
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <uslekm$3765n$3@dont-email.me>
References: <usj06r$2jn18$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 10 Mar 2024 23:10:14 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="4d56b3b9a7621a72403d9315d9b19811";
logging-data="3381431"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18eyFufeuNqqRfZWO5reXEL"
User-Agent: Betterbird (Windows)
Cancel-Lock: sha1:FcEf1GFx31DgmwLajzK4va3IOE0=
In-Reply-To: <usj06r$2jn18$3@dont-email.me>
Content-Language: en-US
 by: DFS - Sun, 10 Mar 2024 23:10 UTC

On 3/9/2024 7:51 PM, DFS wrote:
> Code of your own, in any language, to calculate and output all Kaprekar
> numbers below 100,000,000.
>
> https://mathworld.wolfram.com/KaprekarNumber.html
>
> Not a ProjectEuler problem.
>
>
> Break out the fingerpaint, Pedialyte and AppleScript  -  it's time for
> some Piet Programming!

21 hours of crickets (DST adjustment made)

Re: Simple math/programming challenge for the "REAL programmer" Feeb

<pZSdnevlw_ZS3HP4nZ2dnZfqn_WdnZ2d@supernews.com>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=11783&group=comp.os.linux.advocacy#11783

  copy link   Newsgroups: comp.os.linux.advocacy
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!feeder.usenetexpress.com!tr1.iad1.usenetexpress.com!69.80.99.22.MISMATCH!Xl.tags.giganews.com!local-2.nntp.ord.giganews.com!nntp.supernews.com!news.supernews.com.POSTED!not-for-mail
NNTP-Posting-Date: Sun, 10 Mar 2024 23:27:11 +0000
From: none@none.none (Tyrone)
Newsgroups: comp.os.linux.advocacy
Subject: Re: Simple math/programming challenge for the "REAL programmer" Feeb
X-No-Archive: Yes
References: <usj06r$2jn18$3@dont-email.me> <usl2qu$34lr8$3@dont-email.me> <LmidnXKcc4PChHP4nZ2dnZfqn_udnZ2d@supernews.com> <usl6c3$35de0$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=fixed
Content-Transfer-Encoding: 8bit
User-Agent: Usenapp for MacOS
X-Usenapp: v1.27.2/l - Full License
Message-ID: <pZSdnevlw_ZS3HP4nZ2dnZfqn_WdnZ2d@supernews.com>
Date: Sun, 10 Mar 2024 23:27:11 +0000
Lines: 41
X-Trace: sv3-gN9+dxTHbCzCJ4wutfSh9oE1vrjlqRr+MwfXgVd/4AhETLFYXZmE+p1n+IjFfDxwiKsXlLQeDfgimbr!FR+1Kq4ijbhgXqe+IbuxQlNQGCelm0Vk/hgbwcDlgTPDDM83vRkF5PKWluqITDqUob0gnGIY6jWr!nhJjjorY
X-Complaints-To: www.supernews.com/docs/abuse.html
X-DMCA-Complaints-To: www.supernews.com/docs/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
 by: Tyrone - Sun, 10 Mar 2024 23:27 UTC

On Mar 10, 2024 at 4:49:07 PM EDT, "DFS" <nospam@dfs.com> wrote:

> On 3/10/2024 4:34 PM, Tyrone wrote:
>> This is not a "programming challenge".
>
> Of course it is.
>
> Read the first 4 words of the original post.

So? Is that some command that must be obeyed? I can take any code that I
find, change the functions/variables/modules/whatever names, re-arrange it and
present it as "my code".

If for some bizarre reason I needed to display Kaprekar Numbers at work, I
would certainly look first for "off-the-shelf" code that already works. I
would not waste my time writing my own.

For example. 25 years ago I was a new hire at my current job. Someone else was
working on a project that needed to export data in EBCDIC (IBM mainframe
character set) instead of ASCII (PC character set). She was not excited at the
prospect of writing an EBCDIC/ASCII conversion function. As luck would have
it, I already had written one about 5 years earlier in my previous job. I gave
her the code, she plugged it into her project and it all was working in a
short period of time. I even had utilities to view the EBCDIC data on a PC,
converting it all back into ASCII for viewing.

The point is this. When tested, production-ready code already exists you don't
waste time rolling your own. That code still exists and is still working in
that product today.

>> It is a simple internet search challenge.
>
> Even though I clearly explained, you still don't get it.

Even though I have clearly explained it, YOU still don't get it. If you really
want to challenge someone, come up with a unique problem that has not been
solved already by millions of people over the last 40 years. REAL problem
solving happens when YOU have to actually code/test/verify that YOU have
solved the problem.

What's next? "Challenge" people to print out Prime Numbers?

Re: Simple math/programming challenge for the "REAL programmer" Feeb

<uslfv2$37b7n$2@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=11785&group=comp.os.linux.advocacy#11785

  copy link   Newsgroups: comp.os.linux.advocacy
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nospam@dfs.com (DFS)
Newsgroups: comp.os.linux.advocacy
Subject: Re: Simple math/programming challenge for the "REAL programmer" Feeb
Date: Sun, 10 Mar 2024 19:32:51 -0400
Organization: A noiseless patient Spider
Lines: 10
Message-ID: <uslfv2$37b7n$2@dont-email.me>
References: <usj06r$2jn18$3@dont-email.me> <usl2qu$34lr8$3@dont-email.me>
<LmidnXKcc4PChHP4nZ2dnZfqn_udnZ2d@supernews.com>
<usl6c3$35de0$1@dont-email.me>
<pZSdnevlw_ZS3HP4nZ2dnZfqn_WdnZ2d@supernews.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 10 Mar 2024 23:32:50 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="4d56b3b9a7621a72403d9315d9b19811";
logging-data="3386615"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19XCk23BnTXouqsheud/sz4"
User-Agent: Betterbird (Windows)
Cancel-Lock: sha1:Z8ewhD/2uzI/fw4d/Pd9W5o0ttQ=
Content-Language: en-US
In-Reply-To: <pZSdnevlw_ZS3HP4nZ2dnZfqn_WdnZ2d@supernews.com>
 by: DFS - Sun, 10 Mar 2024 23:32 UTC

On 3/10/2024 7:27 PM, Tyrone wrote:
> On Mar 10, 2024 at 4:49:07 PM EDT, "DFS" <nospam@dfs.com> wrote:

> What's next? "Challenge" people to print out Prime Numbers?

It's funny that you think Feeb is a person.

Re: Simple math/programming challenge for the "REAL programmer" Feeb

<uslgm2$37b7n$3@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=11788&group=comp.os.linux.advocacy#11788

  copy link   Newsgroups: comp.os.linux.advocacy
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nospam@dfs.com (DFS)
Newsgroups: comp.os.linux.advocacy
Subject: Re: Simple math/programming challenge for the "REAL programmer" Feeb
Date: Sun, 10 Mar 2024 19:45:07 -0400
Organization: A noiseless patient Spider
Lines: 40
Message-ID: <uslgm2$37b7n$3@dont-email.me>
References: <usj06r$2jn18$3@dont-email.me> <87h6heilev.fsf@yaxley.in>
<uskh40$30qhq$2@dont-email.me>
<09acnYe4UemsSnD4nZ2dnZfqnPidnZ2d@supernews.com>
<usl2qu$34lr8$3@dont-email.me> <usl39t$347pu$4@dont-email.me>
<usl3gj$34lr8$4@dont-email.me> <usl3qs$347pu$7@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 10 Mar 2024 23:45:06 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="4d56b3b9a7621a72403d9315d9b19811";
logging-data="3386615"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX193eOawx7ZI0dGmzAHazEs+"
User-Agent: Betterbird (Windows)
Cancel-Lock: sha1:xI3vrRg7AXtjonwq44N588T0/+g=
In-Reply-To: <usl3qs$347pu$7@dont-email.me>
Content-Language: en-US
 by: DFS - Sun, 10 Mar 2024 23:45 UTC

On 3/10/2024 4:05 PM, vallor wrote:
> On Sun, 10 Mar 2024 16:00:19 -0400, DFS <nospam@dfs.com> wrote in
> <usl3gj$34lr8$4@dont-email.me>:
>
>> On 3/10/2024 3:56 PM, vallor wrote:
>>> On Sun, 10 Mar 2024 15:48:47 -0400, DFS <nospam@dfs.com> wrote in
>>
>>
>> Telling me my post is off-charter is off-charter.
>>
>>
>> Get on-charter! Now!
>
> Are you threatened by the prospect of not being on charter?

It consumes me.

> ObLinux:
> COMPFACE(1) General Commands Manual COMPFACE(1)
>
> NAME
> compface, uncompface - compress and expand 48x48x1 face image
> files
>
> SYNOPSIS
> compface [ infile [ outfile ] ] ...
>
> uncompface [-X] [ infile [ outfile ] ] ...
> _ _ _ _ _ _ _
>
> Does Windows have compface(1)?

Yeah, but it's an 18.5 year old version

https://gnuwin32.sourceforge.net/packages/compface.htm

Re: Simple math/programming challenge for the "REAL programmer" Feeb

<usliaa$16kan$1@solani.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=11790&group=comp.os.linux.advocacy#11790

  copy link   Newsgroups: comp.os.linux.advocacy
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: Physfitfreak@gmail.com (Physfitfreak)
Newsgroups: comp.os.linux.advocacy
Subject: Re: Simple math/programming challenge for the "REAL programmer" Feeb
Date: Sun, 10 Mar 2024 19:12:58 -0500
Message-ID: <usliaa$16kan$1@solani.org>
References: <usj06r$2jn18$3@dont-email.me> <usl2qu$34lr8$3@dont-email.me>
<LmidnXKcc4PChHP4nZ2dnZfqn_udnZ2d@supernews.com>
<usl6c3$35de0$1@dont-email.me>
<pZSdnevlw_ZS3HP4nZ2dnZfqn_WdnZ2d@supernews.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 11 Mar 2024 00:12:58 -0000 (UTC)
Injection-Info: solani.org;
logging-data="1266007"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:CoAtWWa4eLmNjRSeRWRC7MiAyrY=
X-Antivirus: Avast (VPS 240310-6, 3/10/2024), Outbound message
Content-Language: en-US
X-Antivirus-Status: Clean
In-Reply-To: <pZSdnevlw_ZS3HP4nZ2dnZfqn_WdnZ2d@supernews.com>
X-User-ID: eJwFwYkBgDAIA8CVoHxxHBvJ/iN4V9HenOzqLJWCMAYeWo2/hOZemPU1pHbg5qSfsx8wocjR9Oq8y9bd+AFEKxWa
 by: Physfitfreak - Mon, 11 Mar 2024 00:12 UTC

On 3/10/2024 6:27 PM, Tyrone wrote:
> Even though I have clearly explained it, YOU still don't get it. If you really
> want to challenge someone, come up with a unique problem that has not been
> solved already by millions of people over the last 40 years. REAL problem
> solving happens when YOU have to actually code/test/verify that YOU have
> solved the problem.
>
> What's next? "Challenge" people to print out Prime Numbers?

I asked you to do the base conversion into e as challenge and you
weaseled your way silently out.

Why don't you do that and show your code here. Preferably in C, but even
BASIC would do. Just don't use some funky language to smear it for me to
run, and visually check your code.

--
This email has been checked for viruses by Avast antivirus software.
www.avast.com

Re: Simple math/programming challenge for the "REAL programmer" Feeb

<usllis$38f7t$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=11791&group=comp.os.linux.advocacy#11791

  copy link   Newsgroups: comp.os.linux.advocacy
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nospam@dfs.com (DFS)
Newsgroups: comp.os.linux.advocacy
Subject: Re: Simple math/programming challenge for the "REAL programmer" Feeb
Date: Sun, 10 Mar 2024 21:08:45 -0400
Organization: A noiseless patient Spider
Lines: 170
Message-ID: <usllis$38f7t$1@dont-email.me>
References: <usj06r$2jn18$3@dont-email.me> <usl2qu$34lr8$3@dont-email.me>
<LmidnXKcc4PChHP4nZ2dnZfqn_udnZ2d@supernews.com>
<usl6c3$35de0$1@dont-email.me>
<pZSdnevlw_ZS3HP4nZ2dnZfqn_WdnZ2d@supernews.com> <usliaa$16kan$1@solani.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 11 Mar 2024 01:08:44 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="4d56b3b9a7621a72403d9315d9b19811";
logging-data="3423485"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18l3i1HlkU9UkoBMTHcPywn"
User-Agent: Betterbird (Windows)
Cancel-Lock: sha1:wJZbJHCTI7hTThRsLnjdNlVlbWY=
Content-Language: en-US
In-Reply-To: <usliaa$16kan$1@solani.org>
 by: DFS - Mon, 11 Mar 2024 01:08 UTC

On 3/10/2024 8:12 PM, Physfitfreak wrote:
> On 3/10/2024 6:27 PM, Tyrone wrote:
>> Even though I have clearly explained it, YOU still don't get it. If
>> you really
>> want to challenge someone, come up with a unique problem that has not
>> been
>> solved already by millions of people over the last 40 years. REAL problem
>> solving happens when YOU have to actually code/test/verify that YOU have
>> solved the problem.
>>
>> What's next?  "Challenge" people to print out Prime Numbers?
>
>
> I asked you to do the base conversion into e as challenge and you
> weaseled your way silently out.
>
> Why don't you do that and show your code here. Preferably in C, but even
> BASIC would do. Just don't use some funky language to smear it for me to
> run, and visually check your code.

Sandy,

wtf is it with you and Feeb insisting others do your challenges, but
running away when you're asked to do them?

I asked you weeks ago to write a little C to do matrix multiplication
using [i][j] addressing, and I've seen no response. Why?

Don't be afraid you won't get it exactly right. I'm not gonna laugh at
it, or criticize it. If I can suggest improvements I will. If I see
innovation I'll say so. We're here to learn and be entertained, right?

The only code I savage is from that lying, blustering, nasty asshole
Feeb. He used to make lie-excuses that he was too busy, or the code
would contain "subtleties" (meaning too difficult to get right). Now
the wimp just out and out ignores them.

---------------------------------------------------------------------------
matrix creation/fill/multiply/print using only [i][j] addressing
---------------------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>

double elapsedtime(clock_t start) {
return (clock() - (double)start)/CLOCKS_PER_SEC;
}

int main(void) {

clock_t start;
//2^11 = 1024 (~3 seconds)
//2^12 = 2048 (~30 seconds), after that code gets very slow
int max = 12;
srand(time(NULL));
//run for powers of 2
for (int i = 2; i < max; i++) {

//size of matrices
int N = pow(2,i);

//allocate memory for matrices A,B,C
int (*A) [N] = malloc(sizeof(int[N][N]));
int (*B) [N] = malloc(sizeof(int[N][N]));
int (*C) [N] = malloc(sizeof(int[N][N]));

//fill matrices A,B with random values
for (int i=0; i < N; i++) {
for (int j=0; j < N; j++) {
A[i][j] = rand() % N;
B[i][j] = rand() % N;
}
}

//print 4x4 or 8x8 random data
if (N==4) {
printf("\n 4x4 Random Data \n");
printf(" Matrix A Matrix B\n");
printf(" ------------- -------------\n");
}

if (N==8) {
printf("\n 8x8 Random Data \n");
printf(" Matrix A Matrix B\n");
printf(" -----------------------------
-----------------------------\n");
}

if (N==4 || N==8) {
for (int p=0; p < N; p++) {
for (int j=0; j < N; j++) {printf("%3d ",A[p][j]);}
for (int j=0; j < N; j++) {printf("%3d ",B[p][j]);}
printf("\n");
}
}

//standard matrix multiply using nested loops
start = clock();
for (int i=0; i < N; i++) {
for (int j=0; j < N; j++) {
C[i][j] = 0;
for (int k=0; k < N; k++) {
C[i][j] += A[i][k] * B[k][j];
}
}
}

//print 4x4 or 8x8 data
if (N==4 || N==8) {
printf("\nMatrix C: multiply A * B\n------------------------\n");
for (int p=0; p < N; p++) {
for (int j=0; j < N; j++) {printf("%3d ",C[p][j]);}
printf("\n");
}
printf("\n");
}

//timing results
printf("N=%4d: multiplication in %.4fs\n",N,elapsedtime(start));

//release memory
free(A);
free(B);
free(C);

}

return(0);

}
---------------------------------------------------------------------------

for max speed, compile it like this:
$ gcc -O3 codefile.c -o progname -lm

run it:
$ ./progname

Feeb posted a link

https://johnnysswlab.com/make-your-programs-run-faster-by-better-using-the-data-cache/

that showed a slightly different matrix multiplication technique they
called 'loop interchange'. It really does make a difference.

for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
C[i][j] = 0;
}
for (int k = 0; k < N; k++) {
for (int j = 0; j < N; j++) {
C[i][j] += A[i][k] * B[k][j];
}
}
}

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor