Discussion:
Wild anagramage
(too old to reply)
Apd
2025-01-19 17:31:03 UTC
Permalink
This was the original routine as taken from the code posted here:

<vm1o34$1frsf$***@fretwizzer.eternal-september.org>

It checks if a group of letters can make a word of the same length or
shorter. Input is a word from the dictionary to check (a string) and a
list of letters you provide with a count of each one (an object of
key/value pairs), e.g:

"banana", {"b":1, "a":3, "n":2}

Spacing adjusted for readability, and commented:

// - - -
const potentialWord = (word, inputCounts) => {

const wordCounts = letterCount(word) // Make list for dictionary word.

for (const char in wordCounts) { // Loop over each letter in word.

// If letter not in your input or word has more of that letter...

if (!inputCounts[char] || wordCounts[char] > inputCounts[char]) {

return false // Quit, word cannot be made.
}
}
return true // Loop completed, thus word can be made..
}
// - - -

My updated version allows for any number of wildcards ("?") which will
match any letter, e.g:

"bana?a", {"b":1, "a":3, "n":1, "?":1}

// - - -
const potentialWord = (word, inputCounts) => {

const wordCounts = letterCount(word) // Make list for dictionary word.

let wildCard = inputCounts["?"] ? inputCounts["?"] : 0 // Wildcard count

for (const char in wordCounts) { // Loop over each letter in word.

// If letter not in your input or word has more of that letter...

if (!inputCounts[char] || wordCounts[char] > inputCounts[char]) {

// Check for wildcards.

if (wildCard <= 0) { // If none present or none remaining.

return false // Quit, word cannot be made.
}

if (!inputCounts[char]) { // If word letter not in input

// and more of this letter in word than remaining wildcards:

if (wordCounts[char] > wildCard) {
return false // Quit, word cannot be made.
}

// Otherwise, use this wildcard for this letter and decrease
// remaining wildcards by count of that letter in word.

else wildCard -= wordCounts[char]
}

else { // If word letter found in input

// and more of this letter in word than input letter plus
// remaining wildcards:

if (wordCounts[char] > inputCounts[char] + wildCard) {
return false // Quit, word cannot be made.
}

// otherwise, use this wildcard for this letter and
// decrease remaining wildcards by one.

else wildCard --
}
}
}
return true // loop completed, thus word can be made..
}
// - - -

I don't know how easy that is to follow. It took me some time to work
out after being sidetracked by what I thought would be necessary but
turned out to be irrelevant. I think it's now bug-free.
Steve Carroll
2025-01-19 17:56:28 UTC
Permalink
I think I tweaked that from what I'm using here because my dict data
looks like this:

{
"a": 1,
"aa": 1,
"aaa": 1,
"aah": 1,
"aahed": 1,
"aahing": 1,
"aahs": 1,
"aal": 1,
"aalii": 1,
"aaliis": 1,
"aals": 1,
"zythia": 1,
"zythum": 1,
"zyzomys": 1,
"zyzzogeton": 1,
"zyzzyva": 1,
"zyzzyvas": 1
}

I was thinking about using the value slot to hold the key lengths at one
point (I didn't need that for what I originally created it for).
Post by Apd
It checks if a group of letters can make a word of the same length or
shorter. Input is a word from the dictionary to check (a string) and a
list of letters you provide with a count of each one (an object of
"banana", {"b":1, "a":3, "n":2}
// - - -
const potentialWord = (word, inputCounts) => {
const wordCounts = letterCount(word) // Make list for dictionary word.
for (const char in wordCounts) { // Loop over each letter in word.
// If letter not in your input or word has more of that letter...
if (!inputCounts[char] || wordCounts[char] > inputCounts[char]) {
return false // Quit, word cannot be made.
}
}
return true // Loop completed, thus word can be made..
}
// - - -
My updated version allows for any number of wildcards ("?") which will
"bana?a", {"b":1, "a":3, "n":1, "?":1}
// - - -
const potentialWord = (word, inputCounts) => {
const wordCounts = letterCount(word) // Make list for dictionary word.
let wildCard = inputCounts["?"] ? inputCounts["?"] : 0 // Wildcard count
for (const char in wordCounts) { // Loop over each letter in word.
// If letter not in your input or word has more of that letter...
if (!inputCounts[char] || wordCounts[char] > inputCounts[char]) {
// Check for wildcards.
if (wildCard <= 0) { // If none present or none remaining.
return false // Quit, word cannot be made.
}
if (!inputCounts[char]) { // If word letter not in input
if (wordCounts[char] > wildCard) {
return false // Quit, word cannot be made.
}
// Otherwise, use this wildcard for this letter and decrease
// remaining wildcards by count of that letter in word.
else wildCard -= wordCounts[char]
}
else { // If word letter found in input
// and more of this letter in word than input letter plus
if (wordCounts[char] > inputCounts[char] + wildCard) {
return false // Quit, word cannot be made.
}
// otherwise, use this wildcard for this letter and
// decrease remaining wildcards by one.
else wildCard --
}
}
}
return true // loop completed, thus word can be made..
}
// - - -
I don't know how easy that is to follow.
else wildCard --

I did a bit of a double take there ;)
Post by Apd
It took me some time to work out after being sidetracked by what I
thought would be necessary but turned out to be irrelevant. I think
it's now bug-free.
This is great and I hope it is bug-free!

What I'd like to see... being that I'm in a different 'mode' right
now... is for someone, other than me, to test it along with a truncated
dict and the rest of the code. I realize I'm the likely candidate but my
head is elsewhere for a bit. Maybe someone other than you or I would
like to give this a try? There'd be no coding, just assembling. Someone
might even learn something ;)
Apd
2025-01-19 18:46:23 UTC
Permalink
Post by Steve Carroll
I think I tweaked that from what I'm using here because my dict data
You changed potentialWord() in the one where you added primes but this
works on the original.

[...]
Post by Steve Carroll
"zyzzyvas": 1
}
I was thinking about using the value slot to hold the key lengths at one
point (I didn't need that for what I originally created it for).
They could hold the wordCounts object in a pre-calculation step to
avoid doing it for each run.

[...]
Post by Steve Carroll
Post by Apd
I don't know how easy that is to follow.
else wildCard --
I did a bit of a double take there ;)
else -- wildCard

There's no assignment of one variable to another here, so having it
postfix or prefix makes no difference.
Post by Steve Carroll
Post by Apd
I think it's now bug-free.
This is great and I hope it is bug-free!
What I'd like to see... being that I'm in a different 'mode' right
now... is for someone, other than me, to test it along with a truncated
dict and the rest of the code. I realize I'm the likely candidate but my
head is elsewhere for a bit.
Sure. I've already done a fair bit of testing with my truncated
dictionary and some with your full one. So far so good. I may
invesigate a bit more.
Post by Steve Carroll
Maybe someone other than you or I would like to give this a try?
There'd be no coding, just assembling. Someone might even learn
something ;)
Y' never know!
Steve Carroll
2025-01-19 21:40:30 UTC
Permalink
Post by Apd
Post by Steve Carroll
I was thinking about using the value slot to hold the key lengths at one
point (I didn't need that for what I originally created it for).
They could hold the wordCounts object in a pre-calculation step to
avoid doing it for each run.
Exactly.
Post by Apd
Post by Steve Carroll
I realize I'm the likely candidate but my head is elsewhere for a
bit.
Sure. I've already done a fair bit of testing with my truncated
dictionary and some with your full one. So far so good. I may
invesigate a bit more.
I forgot where I got it but I guess the dictionary I used is available
around the 'net.
Post by Apd
Post by Steve Carroll
Maybe someone other than you or I would like to give this a try?
There'd be no coding, just assembling. Someone might even learn
something ;)
Y' never know!
I don't what's up with this ng... the 'moderator' has whined about JS
and other languages for *years* but it was clearly all for a different
purpose. WTF? The 'IT Master/web dev' has virtually no apparent interest
in programming, which makes no sense to me at all. I'd assume to get a
*Masters* in IT you'd have to do a little programming or run across
scenarios when you saw *some* need. Given his hobby, Vegeman has a need
to learn, at least, a little bit... but he's perfectly fine leaving all
of it to others. ME has talked about wanting to learn at points along
the way but will apparently never make that leap. Even '%' is allegedly
a programmer, yet, all he wants to do is act like a trolling fool. FTR
and KP do read some of the things we discuss (even if done in stealth
mode) so that's something.
Apd
2025-01-20 18:35:32 UTC
Permalink
Post by Steve Carroll
Post by Apd
They could hold the wordCounts object in a pre-calculation step to
avoid doing it for each run.
Exactly.
I've implemented it and it's faster. I've also made a check on the max
length of word being sent to potentialWord() and it's practically
instantaneous for shorter words.
Post by Steve Carroll
Post by Apd
I've already done a fair bit of testing with my truncated
dictionary and some with your full one. So far so good. I may
invesigate a bit more.
I forgot where I got it but I guess the dictionary I used is available
around the 'net.
I forget where I found mine but it's closer to what jumblesolver.me
shows and doesn't have single letters or initialisms. Yours has 370101
words, mine 267751 which is 102350 fewer.
Post by Steve Carroll
Post by Apd
Post by Steve Carroll
Maybe someone other than you or I would like to give this a try?
There'd be no coding, just assembling. Someone might even learn
something ;)
Y' never know!
I don't what's up with this ng... [...]
No comment (I know) to minimise thread pollution by non-contributory
parties!
Steve Carroll
2025-01-20 18:59:34 UTC
Permalink
Post by Apd
Post by Steve Carroll
Post by Apd
They could hold the wordCounts object in a pre-calculation step to
avoid doing it for each run.
Exactly.
I've implemented it and it's faster. I've also made a check on the max
length of word being sent to potentialWord() and it's practically
instantaneous for shorter words.
Are you still using the anagram (primes) stuff... the display? I tossed
it when incorporating your revision. I'm using one display function now
and I'm not using your ul/li scheme (did you use flex or grid to deal
with block level elements?). While I didn't use a max-length I did the
things I forgot earlier, to trim and use lowercase.

FWIW, while slower than C, JS isn't a total dog at some things.
Post by Apd
Post by Steve Carroll
Post by Apd
I've already done a fair bit of testing with my truncated
dictionary and some with your full one. So far so good. I may
invesigate a bit more.
I forgot where I got it but I guess the dictionary I used is available
around the 'net.
I forget where I found mine but it's closer to what jumblesolver.me
shows and doesn't have single letters or initialisms. Yours has 370101
words, mine 267751 which is 102350 fewer.
Yours probably doesn't have names, either (like mine doesn't):

Tom Cruise = So I'm Cuter

Mel Gibson = Bong Smile (LOL!)

P.S. I see my 'hipster' habit has rubbed off on you ;)

(notice I didn't use it for the docs I've been writing)
Apd
2025-01-20 19:23:27 UTC
Permalink
Post by Steve Carroll
Post by Apd
I've implemented it and it's faster. I've also made a check on the max
length of word being sent to potentialWord() and it's practically
instantaneous for shorter words.
Are you still using the anagram (primes) stuff... the display? I tossed
it when incorporating your revision.
No primes. They're the best to use when wildcards aren't needed. Gives
instantaneous results, even in a slow FF.
Post by Steve Carroll
I'm using one display function now and I'm not using your ul/li scheme
(did you use flex or grid to deal with block level elements?).
I have no UI. It's all dev console input and log.
Post by Steve Carroll
Post by Apd
I forget where I found mine but it's closer to what jumblesolver.me
shows and doesn't have single letters or initialisms. Yours has 370101
words, mine 267751 which is 102350 fewer.
Right, no names.
Post by Steve Carroll
Tom Cruise = So I'm Cuter
Mel Gibson = Bong Smile (LOL!)
Heh!
Post by Steve Carroll
P.S. I see my 'hipster' habit has rubbed off on you ;)
(notice I didn't use it for the docs I've been writing)
Huh, what habit is that?
Steve Carroll
2025-01-20 19:46:37 UTC
Permalink
Post by Apd
Post by Steve Carroll
Post by Apd
I've implemented it and it's faster. I've also made a check on the max
length of word being sent to potentialWord() and it's practically
instantaneous for shorter words.
Are you still using the anagram (primes) stuff... the display? I tossed
it when incorporating your revision.
No primes. They're the best to use when wildcards aren't needed. Gives
instantaneous results, even in a slow FF.
Post by Steve Carroll
I'm using one display function now and I'm not using your ul/li scheme
(did you use flex or grid to deal with block level elements?).
I have no UI. It's all dev console input and log.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://fonts.googleapis.com/css2?family=Roboto+Mono&display=swap" rel="stylesheet">
<title>Faux Jumble Solver</title>
<style>
body {
background-color: #e1eed9;
}
h1 {
padding-top: 10px;
font-size: 2.2em;
font-family: fantasy;
text-align: center;
color: #e1eed9;
background-color: #60840f;
}
h2 {
font-size: 1.6rem;
margin: 0;
padding: 5px;
background: #f2f8ee;
}
input {
font-size: 1.5rem;
width: 250px;
height: 30px;
padding: 10px;
margin-left: 10px;
}
input::placeholder {
font-size: 1.2rem;
color: #888;
}
#wrapper {
background-color: #d5e6cb;
width: 1300px;
margin: auto;
padding: 30px;
}
#results {
background-color: #60840f;
width: 1260px;
font-size: 1.6em;
color: #60840f;
letter-spacing: .01em;
margin: auto;
}
.result {
font-family: 'Roboto Mono', monospace;
padding: 10px;
margin: 10px;
border: 2px solid #eff6eb;
line-height: 1.6em;
white-space: normal;
word-break: break-word;
overflow-wrap: anywhere;
hyphens: none;
word-spacing: 40px;
background: #fff;
}
.header {
word-spacing: none;
}
</style>
</head>
<body>
<div id="wrapper">
<h1>Faux Jumble Solver</h1>
<input type="text" id="inputWord" placeholder="Enter your letters (wildcard: ?)" />
<button id="search">Search</button>
<div id="results"></div>
</div>
<script>
// code...
</script>

</body>
</html>

It's not particularly well written and it won't address your code
perfectly... but after altering it (for those ul/li things) you should
get something.
Post by Apd
Post by Steve Carroll
Post by Apd
I forget where I found mine but it's closer to what jumblesolver.me
shows and doesn't have single letters or initialisms. Yours has 370101
words, mine 267751 which is 102350 fewer.
Right, no names.
But we can add 'em ;)
Post by Apd
Post by Steve Carroll
Tom Cruise = So I'm Cuter
Mel Gibson = Bong Smile (LOL!)
Heh!
Post by Steve Carroll
P.S. I see my 'hipster' habit has rubbed off on you ;)
(notice I didn't use it for the docs I've been writing)
Huh, what habit is that?
Relying ASI!

A thing that used to make you puke (C'mon, admit it, you know it did ;)
Apd
2025-01-20 20:25:17 UTC
Permalink
Post by Steve Carroll
Post by Apd
Post by Steve Carroll
I'm using one display function now and I'm not using your ul/li scheme
(did you use flex or grid to deal with block level elements?).
I have no UI. It's all dev console input and log.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link
href="https://fonts.googleapis.com/css2?family=Roboto+Mono&display=swap"
rel="stylesheet">
I don't generally allow remote fonts. Courier will do fine.
Post by Steve Carroll
It's not particularly well written and it won't address your code
perfectly... but after altering it (for those ul/li things) you should
get something.
I already have your earlier examples.
Post by Steve Carroll
Post by Apd
Right, no names.
But we can add 'em ;)
I'd rather not.
Post by Steve Carroll
Post by Apd
Post by Steve Carroll
P.S. I see my 'hipster' habit has rubbed off on you ;)
(notice I didn't use it for the docs I've been writing)
Huh, what habit is that?
Relying ASI!
A thing that used to make you puke (C'mon, admit it, you know it did ;)
I had to remind myself what that meant. I don't think it's an "Anal
Seepage Issue" so it must be "Automatic Semicolon Insertion". I'm
deliberately leaving them out now. It may trip me up at some point.
Steve Carroll
2025-01-20 22:49:37 UTC
Permalink
Post by Apd
Post by Steve Carroll
Post by Apd
Post by Steve Carroll
I'm using one display function now and I'm not using your ul/li scheme
(did you use flex or grid to deal with block level elements?).
I have no UI. It's all dev console input and log.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link
href="https://fonts.googleapis.com/css2?family=Roboto+Mono&display=swap"
rel="stylesheet">
I don't generally allow remote fonts. Courier will do fine.
Don't be a grump ;)
Post by Apd
Post by Steve Carroll
It's not particularly well written and it won't address your code
perfectly... but after altering it (for those ul/li things) you should
get something.
I already have your earlier examples.
I'd forgotten if any would still work.
Post by Apd
Post by Steve Carroll
Post by Apd
Right, no names.
But we can add 'em ;)
I'd rather not.
I've never actually played Jumble. I take it they never use people's
names?
Post by Apd
Post by Steve Carroll
Post by Apd
Post by Steve Carroll
P.S. I see my 'hipster' habit has rubbed off on you ;)
(notice I didn't use it for the docs I've been writing)
Huh, what habit is that?
Relying ASI!
A thing that used to make you puke (C'mon, admit it, you know it did ;)
I had to remind myself what that meant. I don't think it's an "Anal
Seepage Issue"
LOL!
Post by Apd
so it must be "Automatic Semicolon Insertion". I'm deliberately
leaving them out now. It may trip me up at some point.
Probably won't... but if it did I've no doubt an error msg would get you
back on track.
Apd
2025-01-20 23:33:26 UTC
Permalink
Post by Steve Carroll
Post by Apd
Post by Steve Carroll
href="https://fonts.googleapis.com/css2?family=Roboto+Mono&display=swap"
rel="stylesheet">
I don't generally allow remote fonts. Courier will do fine.
Don't be a grump ;)
I think my NoScript plugin blocks them by default. Someone else's
choice of font is not always to my liking. Perhaps I'll make an
exception. What's "display=swap" mean?
Post by Steve Carroll
Post by Apd
Post by Steve Carroll
But we can add 'em ;)
I'd rather not.
I've never actually played Jumble. I take it they never use people's
names?
I don't know but people can have all kinds of wacky and foreign names.
Depends how far you want to go with them.
Post by Steve Carroll
Post by Apd
so it must be "Automatic Semicolon Insertion". I'm deliberately
leaving them out now. It may trip me up at some point.
Probably won't... but if it did I've no doubt an error msg would get you
back on track.
I did see one on something I typed in at the console. Can't remember
what now.
Steve Carroll
2025-01-21 14:28:25 UTC
Permalink
Post by Apd
Post by Steve Carroll
Post by Apd
Post by Steve Carroll
href="https://fonts.googleapis.com/css2?family=Roboto+Mono&display=swap"
rel="stylesheet">
I don't generally allow remote fonts. Courier will do fine.
Don't be a grump ;)
I think my NoScript plugin blocks them by default. Someone else's
choice of font is not always to my liking. Perhaps I'll make an
exception. What's "display=swap" mean?
It's for fallback and/or to prevent the dreaded FOIT!
Post by Apd
Post by Steve Carroll
Post by Apd
Post by Steve Carroll
But we can add 'em ;)
I'd rather not.
I've never actually played Jumble. I take it they never use people's
names?
I don't know but people can have all kinds of wacky and foreign names.
Depends how far you want to go with them.
It depends on if it's in the dictionary... I haven't tried any names so
I have no idea if 'JumbleSolver' has them.
Post by Apd
Post by Steve Carroll
Post by Apd
so it must be "Automatic Semicolon Insertion". I'm deliberately
leaving them out now. It may trip me up at some point.
Probably won't... but if it did I've no doubt an error msg would get you
back on track.
I did see one on something I typed in at the console. Can't remember
what now.
See? You're already doing it ;)
Apd
2025-01-21 17:03:55 UTC
Permalink
Post by Steve Carroll
Post by Apd
Post by Steve Carroll
Post by Apd
I don't generally allow remote fonts. Courier will do fine.
Don't be a grump ;)
I think my NoScript plugin blocks them by default. Someone else's
choice of font is not always to my liking. Perhaps I'll make an
exception. What's "display=swap" mean?
It's for fallback and/or to prevent the dreaded FOIT!
Another acronym new to me. There's also FOUT. This is another reason
I block stuff from loading; it can be slow and wastes my time when I'm
not interested in fancy styling but only want to read the text. Some
pages can be so bad that I have to select the browser's "reader view"
where the text in a readable font is all you get.
Post by Steve Carroll
Post by Apd
Post by Steve Carroll
Post by Apd
so it must be "Automatic Semicolon Insertion". I'm deliberately
leaving them out now. It may trip me up at some point.
Probably won't... but if it did I've no doubt an error msg would get
you back on track.
I did see one on something I typed in at the console. Can't remember
what now.
See? You're already doing it ;)
Yes, but it was obvious from the message (which I don't recall) and
the code was very short. It may not always be so.
Steve Carroll
2025-01-21 18:34:29 UTC
Permalink
Post by Apd
Post by Steve Carroll
Post by Apd
Post by Steve Carroll
Post by Apd
I don't generally allow remote fonts. Courier will do fine.
Don't be a grump ;)
I think my NoScript plugin blocks them by default. Someone else's
choice of font is not always to my liking. Perhaps I'll make an
exception. What's "display=swap" mean?
It's for fallback and/or to prevent the dreaded FOIT!
Another acronym new to me. There's also FOUT. This is another reason
I block stuff from loading; it can be slow and wastes my time when I'm
not interested in fancy styling but only want to read the text.
I get it... we've all talked about the insane bloat seen now (and the
last 'so many' years).
Post by Apd
Some pages can be so bad that I have to select the browser's "reader
view" where the text in a readable font is all you get.
Is that even available in FF v.52 (I honestly can't recall)?
Post by Apd
Post by Steve Carroll
Post by Apd
Post by Steve Carroll
Post by Apd
so it must be "Automatic Semicolon Insertion". I'm deliberately
leaving them out now. It may trip me up at some point.
Probably won't... but if it did I've no doubt an error msg would get
you back on track.
I did see one on something I typed in at the console. Can't remember
what now.
See? You're already doing it ;)
Yes, but it was obvious from the message (which I don't recall) and
the code was very short. It may not always be so.
I've only seen a few over the years, once you understand the few rules
it's not an issue. One rule I might not have mentioned previously:

let a = 5;

(function() {
console.log(a)
})()


Prior to an IIFE... not sure why you'd do that but a semicolon is
required there (then again, maybe I did mention preceding one with a
semicolon at one point, minus the var). In any event, if you're not
aware of the issues, it's probably not a good idea to rely on ASI...
same goes for something like hoisting.
Apd
2025-01-21 20:56:07 UTC
Permalink
Post by Steve Carroll
Post by Apd
Another acronym new to me. There's also FOUT. This is another reason
I block stuff from loading; it can be slow and wastes my time when I'm
not interested in fancy styling but only want to read the text.
I get it... we've all talked about the insane bloat seen now (and the
last 'so many' years).
Post by Apd
Some pages can be so bad that I have to select the browser's "reader
view" where the text in a readable font is all you get.
Is that even available in FF v.52 (I honestly can't recall)?
Yes, but not with all pages. I haven't looked into what triggers the
option being available.

[ASI]
Post by Steve Carroll
Post by Apd
Yes, but it was obvious from the message (which I don't recall) and
the code was very short. It may not always be so.
I've only seen a few over the years, once you understand the few rules
let a = 5;
(function() {
console.log(a)
})()
Prior to an IIFE... not sure why you'd do that but a semicolon is
required there
Good example. "TypeError: 5 is not a function" without the ';'.
Post by Steve Carroll
(then again, maybe I did mention preceding one with a semicolon at
one point, minus the var).
I recall something about preceding whole scripts with one.
Post by Steve Carroll
In any event, if you're not aware of the issues, it's probably not a
good idea to rely on ASI...
I'll manage!
Post by Steve Carroll
same goes for something like hoisting.
So much to remember. I expected a function to be hoisted in what I've
been doing lately but it wasn't.
Steve Carroll
2025-01-22 16:31:08 UTC
Permalink
Post by Apd
Post by Steve Carroll
(then again, maybe I did mention preceding one with a semicolon at
one point, minus the var).
I recall something about preceding whole scripts with one.
Yes, I think that was the case.
Post by Apd
Post by Steve Carroll
In any event, if you're not aware of the issues, it's probably not a
good idea to rely on ASI...
I'll manage!
I meant that in a general sense.
Post by Apd
Post by Steve Carroll
same goes for something like hoisting.
So much to remember. I expected a function to be hoisted in what I've
been doing lately but it wasn't.
Was it a function expression or an arrow function?

You'll probably recall that we also discussed 'hoisting' and the fact
that nothing is actually 'hoisted', it's merely the first of two phases
(creation and execution, respectively) at work. I was going to cover
this on the 'Functions' doc I posted, but being it's mainly for people
who don't know JS (or any programming language), I decided against it
(and a number of other things). Someone, who is not on usenet, asked me
to create a 'TLDR' doc (create your own!) Attention spans are shot now
<shaking head in disappointment>.
Apd
2025-01-22 17:28:03 UTC
Permalink
Post by Steve Carroll
Post by Apd
So much to remember. I expected a function to be hoisted in what I've
been doing lately but it wasn't.
Was it a function expression or an arrow function?
Yes, both. That must be it.
Post by Steve Carroll
You'll probably recall that we also discussed 'hoisting' and the fact
that nothing is actually 'hoisted', it's merely the first of two phases
(creation and execution, respectively) at work. I was going to cover
this on the 'Functions' doc I posted, but being it's mainly for people
who don't know JS (or any programming language), I decided against it
(and a number of other things).
Wise choice.
Post by Steve Carroll
Someone, who is not on usenet, asked me to create a 'TLDR' doc (create
your own!) Attention spans are shot now <shaking head in disappointment>.
There's so much to cover, you might as well write a book! There should
be an O'Reilly or Dummies book already available.
Apd
2025-01-23 11:05:06 UTC
Permalink
Post by Steve Carroll
<div id="wrapper">
<h1>Faux Jumble Solver</h1>
<input type="text" id="inputWord" placeholder="Enter your letters (wildcard is ?)"/>
<button id="search">Search</button>
<div id="results"></div>
</div>
I've rewritten it using maps and it's much faster. It takes about
three seconds to setup a dictionary map with over 370K words, and
then under a second to find even long words on my old FF. On newer
systems it should be pretty much immediate. I tried a version using
forEach() callbacks on the maps but although faster than before, it
wasn't nearly as fast as this.

The code below is all the script and includes the two routines that
use the html above, as I've modified them. I removed the "const"s on
global stuff for ease of testing. The word list is now output in
descending order of word length and timings are logged to the console.

Note, the initial dictionary is an array, rather than an object, so
you may need to modify yours or the setup() function.

// - - -

dict = [
"a",
"aa",
// ...etc. (dictionary)
"zyzzyva",
"zyzzyvas"];

letterCount = (str) => {
const counts = new Map()
for (const char of str) {
counts.set(char, (counts.get(char) || 0) + 1)
}
return counts
}

potentialWord = (word, wordCounts, inputCounts) => {
let wildCard = inputCounts.get("?") || 0

for (const entry of wordCounts.entries()) {
const inChars = inputCounts.get(entry[0]) || 0
const wordChars = entry[1]

if (inChars < 1 || wordChars > inChars) {
if (wildCard <= 0) {
return false
}
if (inChars < 1) {
if (wordChars > wildCard) {
return false
}
else wildCard -= wordChars
}
else {
if (wordChars > inChars + wildCard) {
return false
}
else wildCard --
}
}
}
return true
}

findByLength = (inputWord, dictionary) => {
const start = Date.now()
const results = {}
const inLen = inputWord.length
const inputCounts = letterCount(inputWord)
console.log("inputWord, inputCounts:", inputWord, inputCounts)

for (const entry of dictionary.entries()) {
const len = entry[0].length
if (len <= inLen) {
if (potentialWord(entry[0], entry[1], inputCounts)) {
if (!results[len]) {
results[len] = []
}
results[len].push(entry[0])
}
}
}
const end = Date.now();
console.log(`Search completed in: ${(end - start)/1000} sec`);
return results
}

findWords = (input) => { // for use in dev console
if (!input) {
console.log('Provide a word and try again')
return
}
const result = findByLength(input, dictMap)
resultArr = Object.keys(result).reverse()

for (const len of resultArr) {
console.log(`${len}-letter words: %s`, result[len])
}
}

setup = () => {
const start = Date.now()
for (const word of dict) {
dictMap.set(word, letterCount(word))
}
const end = Date.now();
console.log(`Setup completed in: ${(end - start)/1000} sec`);
}

// - - - page elements - - -

displayVarLengths = (result, resultsElement) => {
resultArr = Object.keys(result).reverse()

for (const len of resultArr) {
if (len > 1) {
resultsElement.innerHTML +=
`<div class="result"><h2 class="header">${len}-letters:</h2> ${result[len].join(' ')}</div>`
}
}
}

document.querySelector('#search').addEventListener('click', () => {
const inputWord = document.querySelector('#inputWord').value.trim()
const resultsElement = document.querySelector('#results')
resultsElement.innerHTML = ''

if (inputWord) {
const result = findByLength(inputWord.toLowerCase(), dictMap)
displayVarLengths(result, resultsElement)
} else {
alert('Please enter a word and try again!')
}
})

dictMap = new Map()
setup()

// - - -
Steve Carroll
2025-01-23 13:49:19 UTC
Permalink
Post by Apd
Post by Steve Carroll
<div id="wrapper">
<h1>Faux Jumble Solver</h1>
<input type="text" id="inputWord" placeholder="Enter your letters (wildcard is ?)"/>
<button id="search">Search</button>
<div id="results"></div>
</div>
I've rewritten it using maps and it's much faster. It takes about
three seconds to setup a dictionary map with over 370K words, and
then under a second to find even long words on my old FF. On newer
systems it should be pretty much immediate. I tried a version using
forEach() callbacks on the maps but although faster than before, it
wasn't nearly as fast as this.
The code below is all the script and includes the two routines that
use the html above, as I've modified them. I removed the "const"s on
global stuff for ease of testing. The word list is now output in
descending order of word length and timings are logged to the console.
Note, the initial dictionary is an array, rather than an object, so
you may need to modify yours or the setup() function.
// - - -
dict = [
"a",
"aa",
// ...etc. (dictionary)
"zyzzyva",
"zyzzyvas"];
letterCount = (str) => {
const counts = new Map()
for (const char of str) {
counts.set(char, (counts.get(char) || 0) + 1)
}
return counts
}
potentialWord = (word, wordCounts, inputCounts) => {
let wildCard = inputCounts.get("?") || 0
for (const entry of wordCounts.entries()) {
const inChars = inputCounts.get(entry[0]) || 0
const wordChars = entry[1]
if (inChars < 1 || wordChars > inChars) {
if (wildCard <= 0) {
return false
}
if (inChars < 1) {
if (wordChars > wildCard) {
return false
}
else wildCard -= wordChars
}
else {
if (wordChars > inChars + wildCard) {
return false
}
else wildCard --
}
}
}
return true
}
findByLength = (inputWord, dictionary) => {
const start = Date.now()
const results = {}
const inLen = inputWord.length
const inputCounts = letterCount(inputWord)
console.log("inputWord, inputCounts:", inputWord, inputCounts)
for (const entry of dictionary.entries()) {
const len = entry[0].length
if (len <= inLen) {
if (potentialWord(entry[0], entry[1], inputCounts)) {
if (!results[len]) {
results[len] = []
}
results[len].push(entry[0])
}
}
}
const end = Date.now();
console.log(`Search completed in: ${(end - start)/1000} sec`);
return results
}
findWords = (input) => { // for use in dev console
if (!input) {
console.log('Provide a word and try again')
return
}
const result = findByLength(input, dictMap)
resultArr = Object.keys(result).reverse()
for (const len of resultArr) {
console.log(`${len}-letter words: %s`, result[len])
}
}
setup = () => {
const start = Date.now()
for (const word of dict) {
dictMap.set(word, letterCount(word))
}
const end = Date.now();
console.log(`Setup completed in: ${(end - start)/1000} sec`);
}
// - - - page elements - - -
displayVarLengths = (result, resultsElement) => {
resultArr = Object.keys(result).reverse()
for (const len of resultArr) {
if (len > 1) {
resultsElement.innerHTML +=
`<div class="result"><h2 class="header">${len}-letters:</h2> ${result[len].join(' ')}</div>`
}
}
}
document.querySelector('#search').addEventListener('click', () => {
const inputWord = document.querySelector('#inputWord').value.trim()
const resultsElement = document.querySelector('#results')
resultsElement.innerHTML = ''
if (inputWord) {
const result = findByLength(inputWord.toLowerCase(), dictMap)
displayVarLengths(result, resultsElement)
} else {
alert('Please enter a word and try again!')
}
})
dictMap = new Map()
setup()
// - - -
Nice! And that's probably the fastest way to do it. Now for the most
challenging thing of all:

Get someone in this ng, other than me, to try it!

If it's DB, you'll get an early bonus ;)

I think you'd need a dictionary and everything one doc to stand a
chance... pastebin hold a doc that big?
Apd
2025-01-23 19:55:05 UTC
Permalink
Post by Steve Carroll
Nice! And that's probably the fastest way to do it.
It was interesting to find that forEach() incurs a time penalty. Not
surprising really as there's the function call overhead for every
item. I thought it would be more efficient than using the map
entries() method but apparently not.
Post by Steve Carroll
Get someone in this ng, other than me, to try it!
I won't be doing that unless interest is shown.
Post by Steve Carroll
If it's DB, you'll get an early bonus ;)
I think you'd need a dictionary and everything one doc to stand a
chance... pastebin hold a doc that big?
Max is half a meg, so no good. It would have to be zipped to a
download site.
Steve Carroll
2025-01-23 20:59:04 UTC
Permalink
Post by Apd
Post by Steve Carroll
Nice! And that's probably the fastest way to do it.
It was interesting to find that forEach() incurs a time penalty. Not
surprising really as there's the function call overhead for every
item. I thought it would be more efficient than using the map
entries() method but apparently not.
Post by Steve Carroll
Get someone in this ng, other than me, to try it!
I won't be doing that unless interest is shown.
Dude, you can see how they're raving over my docs ;P

(I have a new one about... the DOM! Always a crowd pleaser ;)
Post by Apd
Post by Steve Carroll
If it's DB, you'll get an early bonus ;)
I think you'd need a dictionary and everything one doc to stand a
chance... pastebin hold a doc that big?
Max is half a meg, so no good. It would have to be zipped to a
download site.
I suspected it might be an issue. I'd normally figure ME would be the
one to try it here (being that he plays and he brought the idea up) but
as he's never expressed interest in code that's a 'no sale'.
%
2025-01-23 21:01:55 UTC
Permalink
Post by Steve Carroll
Post by Apd
Post by Steve Carroll
Nice! And that's probably the fastest way to do it.
It was interesting to find that forEach() incurs a time penalty. Not
surprising really as there's the function call overhead for every
item. I thought it would be more efficient than using the map
entries() method but apparently not.
Post by Steve Carroll
Get someone in this ng, other than me, to try it!
I won't be doing that unless interest is shown.
Dude, you can see how they're raving over my docs ;P
(I have a new one about... the DOM! Always a crowd pleaser ;)
Post by Apd
Post by Steve Carroll
If it's DB, you'll get an early bonus ;)
I think you'd need a dictionary and everything one doc to stand a
chance... pastebin hold a doc that big?
Max is half a meg, so no good. It would have to be zipped to a
download site.
I suspected it might be an issue. I'd normally figure ME would be the
one to try it here (being that he plays and he brought the idea up) but
as he's never expressed interest in code that's a 'no sale'.
but you only suspect this so it really doesn't count it's just you and
another paranoid suspicion
Apd
2025-01-25 12:54:13 UTC
Permalink
Post by Apd
setup = () => {
const start = Date.now()
for (const word of dict) {
dictMap.set(word, letterCount(word))
}
const end = Date.now();
console.log(`Setup completed in: ${(end - start)/1000} sec`);
}
To allow for dictionaries with capitalisation and be consistent with
what we already have, the loop should be changed to this:

for (const word of dict) {
const w = word.toLowerCase()
dictMap.set(w, letterCount(w))
}
Apd
2025-01-26 00:46:59 UTC
Permalink
Post by Apd
Post by Apd
setup = () => {
const start = Date.now()
for (const word of dict) {
dictMap.set(word, letterCount(word))
}
const end = Date.now();
console.log(`Setup completed in: ${(end - start)/1000} sec`);
}
To allow for dictionaries with capitalisation and be consistent with
for (const word of dict) {
const w = word.toLowerCase()
dictMap.set(w, letterCount(w))
}
Even better, this will display the dictionary word unchanged:

for (const word of dict) {
dictMap.set(word, letterCount(word.toLowerCase()))
}

All case variations are being saved, courtesy of the Map.set() method
but their letter counts will be the same.

<Loading Image...>
<Loading Image...>
Steve Carroll
2025-01-26 15:45:17 UTC
Permalink
Post by Apd
Post by Apd
Post by Apd
setup = () => {
const start = Date.now()
for (const word of dict) {
dictMap.set(word, letterCount(word))
}
const end = Date.now();
console.log(`Setup completed in: ${(end - start)/1000} sec`);
}
To allow for dictionaries with capitalisation and be consistent with
for (const word of dict) {
const w = word.toLowerCase()
dictMap.set(w, letterCount(w))
}
for (const word of dict) {
dictMap.set(word, letterCount(word.toLowerCase()))
}
All case variations are being saved, courtesy of the Map.set() method
but their letter counts will be the same.
I did it AGAIN! Used my 'myopic vision' when that was staring me in the
face ;) There's still an additional func call that's a little expensive
but I've heard LC is highly optimized. Easy to read, too. Nice!
Post by Apd
<https://i.ibb.co/svfTMtC/AntCaps.png>
<https://i.ibb.co/Jd4hJLG/camel-Case.png>
Steve Carroll
2025-01-26 16:22:22 UTC
Permalink
Post by Steve Carroll
Post by Apd
Post by Apd
Post by Apd
setup = () => {
const start = Date.now()
for (const word of dict) {
dictMap.set(word, letterCount(word))
}
const end = Date.now();
console.log(`Setup completed in: ${(end - start)/1000} sec`);
}
To allow for dictionaries with capitalisation and be consistent with
for (const word of dict) {
const w = word.toLowerCase()
dictMap.set(w, letterCount(w))
}
for (const word of dict) {
dictMap.set(word, letterCount(word.toLowerCase()))
}
All case variations are being saved, courtesy of the Map.set() method
but their letter counts will be the same.
I did it AGAIN! Used my 'myopic vision' when that was staring me in the
face ;) There's still an additional func call that's a little expensive
but I've heard LC is highly optimized. Easy to read, too. Nice!
This: elacmaseC

Doesn't work as an anagram, it just shows the word (and I even placed it
alphabetically correct ;)

It works here:

<https://anagram-solver.net/elacmaseC>

So it is really an 'anagram' finder (or a word finder)?
Steve Carroll
2025-01-26 16:27:10 UTC
Permalink
Post by Steve Carroll
This: elacmaseC
Doesn't work as an anagram, it just shows the word (and I even placed it
alphabetically correct ;)
<https://anagram-solver.net/elacmaseC>
So it is really an 'anagram' finder (or a word finder)?
LOL! Ignore this post, I put the word in, I didn't put "camelCase" in!

(yes, I removed "elacmaseC" from my dictionary ;)
Apd
2025-01-26 17:28:39 UTC
Permalink
Post by Steve Carroll
Post by Steve Carroll
Post by Apd
for (const word of dict) {
dictMap.set(word, letterCount(word.toLowerCase()))
}
All case variations are being saved, courtesy of the Map.set() method
but their letter counts will be the same.
I did it AGAIN! Used my 'myopic vision' when that was staring me in the
face ;)
I didn't see it until I checked the dictMap.
Post by Steve Carroll
Post by Steve Carroll
There's still an additional func call that's a little expensive
but I've heard LC is highly optimized. Easy to read, too. Nice!
It's in the setup so isn't an issue. I can't detect much difference.
Post by Steve Carroll
This: elacmaseC
Doesn't work as an anagram, it just shows the word (and I even placed it
alphabetically correct ;)
Camelcase or camel-case isn't in your dictionary or mine. I put the
two camelcased varieties in my test dictionary (I saw your followup).
Post by Steve Carroll
<https://anagram-solver.net/elacmaseC>
That puts ours in the shade with its millions of words.
Post by Steve Carroll
So it is really an 'anagram' finder (or a word finder)?
It's whatever you want it to be!
Steve Carroll
2025-01-26 17:56:39 UTC
Permalink
Post by Apd
Post by Steve Carroll
Post by Steve Carroll
Post by Apd
for (const word of dict) {
dictMap.set(word, letterCount(word.toLowerCase()))
}
All case variations are being saved, courtesy of the Map.set() method
but their letter counts will be the same.
I did it AGAIN! Used my 'myopic vision' when that was staring me in the
face ;)
I didn't see it until I checked the dictMap.
I once checked 'dict' *in* the loop just to see how long it'd take to
crash ;) I have 32MB on this machine now... I killed it before it
crashed and, oddly, the data came in when I created a new browser
window (IOW, it was *still* coming in), never saw that before!
Post by Apd
Post by Steve Carroll
Post by Steve Carroll
There's still an additional func call that's a little expensive
but I've heard LC is highly optimized. Easy to read, too. Nice!
It's in the setup so isn't an issue. I can't detect much difference.
I know, I was just pointing out it for "others".
Post by Apd
Post by Steve Carroll
This: elacmaseC
Doesn't work as an anagram, it just shows the word (and I even placed it
alphabetically correct ;)
Camelcase or camel-case isn't in your dictionary or mine. I put the
two camelcased varieties in my test dictionary (I saw your followup).
Post by Steve Carroll
<https://anagram-solver.net/elacmaseC>
That puts ours in the shade with its millions of words.
Post by Steve Carroll
So it is really an 'anagram' finder (or a word finder)?
It's whatever you want it to be!
I finally got a glimpse of the idea of Jumbler now, but I'm not sure
which one ME plays (that might be related to jumblesolver.me, or not).
Some of these gizmos show some letters in red. Is that for a series of
words for which those letters appear in a bonus phrase/term?
Apd
2025-01-26 19:18:26 UTC
Permalink
Post by Steve Carroll
Post by Apd
Post by Steve Carroll
Post by Steve Carroll
I did it AGAIN! Used my 'myopic vision' when that was staring me in the
face ;)
I didn't see it until I checked the dictMap.
I once checked 'dict' *in* the loop just to see how long it'd take to
crash ;) I have 32MB on this machine now... I killed it before it
crashed and, oddly, the data came in when I created a new browser
window (IOW, it was *still* coming in), never saw that before!
I don't know why a dictionary of a few megs would cause a problem but
I'm not sure what you did.
Post by Steve Carroll
Post by Apd
Post by Steve Carroll
So it is really an 'anagram' finder (or a word finder)?
It's whatever you want it to be!
I finally got a glimpse of the idea of Jumbler now, but I'm not sure
which one ME plays (that might be related to jumblesolver.me, or not).
Some of these gizmos show some letters in red. Is that for a series of
words for which those letters appear in a bonus phrase/term?
I can't remember now but I did post this once. Perhaps you can make
sense of it:

<Loading Image...>
FromTheRafters
2025-01-26 19:43:39 UTC
Permalink
Post by Steve Carroll
Post by Apd
Post by Steve Carroll
Post by Steve Carroll
Post by Apd
for (const word of dict) {
dictMap.set(word, letterCount(word.toLowerCase()))
}
All case variations are being saved, courtesy of the Map.set() method
but their letter counts will be the same.
I did it AGAIN! Used my 'myopic vision' when that was staring me in the
face ;)
I didn't see it until I checked the dictMap.
I once checked 'dict' *in* the loop just to see how long it'd take to
crash ;) I have 32MB on this machine now... I killed it before it
crashed and, oddly, the data came in when I created a new browser
window (IOW, it was *still* coming in), never saw that before!
Post by Apd
Post by Steve Carroll
Post by Steve Carroll
There's still an additional func call that's a little expensive
but I've heard LC is highly optimized. Easy to read, too. Nice!
It's in the setup so isn't an issue. I can't detect much difference.
I know, I was just pointing out it for "others".
Post by Apd
Post by Steve Carroll
This: elacmaseC
Doesn't work as an anagram, it just shows the word (and I even placed it
alphabetically correct ;)
Camelcase or camel-case isn't in your dictionary or mine. I put the
two camelcased varieties in my test dictionary (I saw your followup).
Post by Steve Carroll
<https://anagram-solver.net/elacmaseC>
That puts ours in the shade with its millions of words.
Post by Steve Carroll
So it is really an 'anagram' finder (or a word finder)?
It's whatever you want it to be!
I finally got a glimpse of the idea of Jumbler now, but I'm not sure
which one ME plays (that might be related to jumblesolver.me, or not).
Some of these gizmos show some letters in red. Is that for a series of
words for which those letters appear in a bonus phrase/term?
Likely like this one:

https://www.daytondailynews.com/dailyjumble/

Yes the initial anagram solutions have circled letters which can also
be solved as an anagrammical sentence usually a punchline for the
illustration.

Their having restrictions on just what is valid, makes it a perfect
candidate program for teaching JavaScript. If they accepted brand names
and case sensitivity it would be much harder.
Steve Carroll
2025-01-26 20:07:20 UTC
Permalink
Post by FromTheRafters
Post by Steve Carroll
I finally got a glimpse of the idea of Jumbler now, but I'm not sure
which one ME plays (that might be related to jumblesolver.me, or not).
Some of these gizmos show some letters in red. Is that for a series of
words for which those letters appear in a bonus phrase/term?
https://www.daytondailynews.com/dailyjumble/
Yes the initial anagram solutions have circled letters which can also
be solved as an anagrammical sentence usually a punchline for the
illustration.
Their having restrictions on just what is valid, makes it a perfect
candidate program for teaching JavaScript.
I think this stuff is a bit much for a beginner... I've already been
accused of 'trying to bite off more that I can teach' with the simple
stuff I've shown ;)
Post by FromTheRafters
If they accepted brand names
and case sensitivity it would be much harder.
FromTheRafters
2025-01-26 23:15:14 UTC
Permalink
Post by Steve Carroll
Post by FromTheRafters
Post by Steve Carroll
I finally got a glimpse of the idea of Jumbler now, but I'm not sure
which one ME plays (that might be related to jumblesolver.me, or not).
Some of these gizmos show some letters in red. Is that for a series of
words for which those letters appear in a bonus phrase/term?
https://www.daytondailynews.com/dailyjumble/
Yes the initial anagram solutions have circled letters which can also
be solved as an anagrammical sentence usually a punchline for the
illustration.
Their having restrictions on just what is valid, makes it a perfect
candidate program for teaching JavaScript.
I think this stuff is a bit much for a beginner... I've already been
accused of 'trying to bite off more that I can teach' with the simple
stuff I've shown ;)
A elHol oWlrd program in JavaScript.

Kelly Phillips
2025-01-20 18:43:12 UTC
Permalink
On Sun, 19 Jan 2025 21:40:30 -0000 (UTC), Steve Carroll <"Steve
Post by Steve Carroll
I don't what's up with this ng... the 'moderator' has whined about JS
and other languages for *years* but it was clearly all for a different
purpose. WTF? The 'IT Master/web dev' has virtually no apparent interest
in programming, which makes no sense to me at all. I'd assume to get a
*Masters* in IT you'd have to do a little programming or run across
scenarios when you saw *some* need. Given his hobby, Vegeman has a need
to learn, at least, a little bit... but he's perfectly fine leaving all
of it to others. ME has talked about wanting to learn at points along
the way but will apparently never make that leap. Even '%' is allegedly
a programmer, yet, all he wants to do is act like a trolling fool. FTR
and KP do read some of the things we discuss (even if done in stealth
mode) so that's something.
/me waves

That won't make much sense if you haven't used IRC, but I wanted to say
that I enjoy the basics of JS being discussed. I have zero experience
with that language and have no need for it in my work, but I enjoy
seeing the concepts, especially the aspects that are common across all
languages. I'm more familiar with VB6/VBA, but we don't 'do' that here.
I tell myself that I'll be able to play a bit more after I retire, but
that's still a ways off and people tell me you're never as busy as
you'll be in retirement and that they have no idea how they ever found
time for a full time job.

We recently participated in an exercise that asked us to describe what
retirement looks like, since it's different for everyone. I included
sitting in a rocking chair on the back patio, watching the birds and
squirrels, with a dog (that I don't have) at my feet, a beer nearby, and
a girlie magazine with a dog-eared corner to let me know where I had
stopped reading the articles. As you'd imagine, answers across the group
varied wildly.
Steve Carroll
2025-01-20 19:13:49 UTC
Permalink
Post by Kelly Phillips
/me waves
That won't make much sense if you haven't used IRC,
I was never an IRC'er but I get the idea.
Post by Kelly Phillips
but I wanted to say that I enjoy the basics of JS being discussed. I
have zero experience with that language and have no need for it in my
work, but I enjoy seeing the concepts, especially the aspects that are
common across all languages.
I may post up some 'JS gotchas' that you'll only "enjoy" from the
viewpoint of: 'Glad my favorite language doesn't do *that*!'

Here's one to chew on:

1 < 2 < 3

3 < 2 < 1

Open a browser to 'about:blank', right click on the blank screen and
select 'Inspect', then choose the 'Console' tab (terms may vary
slightly, depending on the browser). Copy and paste those, one at a
time, next to the cursor and hit return (do this for one, then the
other, so you should have two response). Get what you expected?
Post by Kelly Phillips
I'm more familiar with VB6/VBA, but we don't 'do' that here.
Apd does!
Post by Kelly Phillips
I tell myself that I'll be able to play a bit more after I retire, but
that's still a ways off and people tell me you're never as busy as
you'll be in retirement and that they have no idea how they ever found
time for a full time job.
We recently participated in an exercise that asked us to describe what
retirement looks like, since it's different for everyone. I included
sitting in a rocking chair on the back patio, watching the birds and
squirrels, with a dog (that I don't have) at my feet, a beer nearby, and
a girlie magazine with a dog-eared corner to let me know where I had
stopped reading the articles.
LOL! Good line ;)
Post by Kelly Phillips
As you'd imagine, answers across the group varied wildly.
Apd
2025-01-20 21:14:24 UTC
Permalink
Post by Steve Carroll
Post by Kelly Phillips
but I wanted to say that I enjoy the basics of JS being discussed. I
have zero experience with that language and have no need for it in my
work, but I enjoy seeing the concepts, especially the aspects that are
common across all languages.
I may post up some 'JS gotchas' that you'll only "enjoy" from the
viewpoint of: 'Glad my favorite language doesn't do *that*!'
1 < 2 < 3
3 < 2 < 1
false < true
Post by Steve Carroll
Post by Kelly Phillips
I'm more familiar with VB6/VBA, but we don't 'do' that here.
Apd does!
Yes, but it's Windows only. I'm up for talking about it if wanted.
Steve Carroll
2025-01-20 21:33:35 UTC
Permalink
Post by Apd
Post by Steve Carroll
1 < 2 < 3
3 < 2 < 1
false < true
They should both return true in dev tools (they do here... in relatively
*modern* browsers ;)
Post by Apd
Post by Steve Carroll
Post by Kelly Phillips
I'm more familiar with VB6/VBA, but we don't 'do' that here.
Apd does!
Yes, but it's Windows only. I'm up for talking about it if wanted.
You two can talk about (I'm fine with bystanding).
Apd
2025-01-20 22:26:17 UTC
Permalink
Post by Steve Carroll
Post by Apd
Post by Steve Carroll
1 < 2 < 3
3 < 2 < 1
false < true
They should both return true in dev tools (they do here... in relatively
*modern* browsers ;)
They do, even in this older one. Evaluating from left to right:

1 < 2 is true, true < 3 is true.
3 < 2 is false, false < 1 is true.

false < true is true.
true < false is false.

A numeric value of 1 and 0 can be inferred for true and false
respectively with other tests.
Steve Carroll
2025-01-20 22:44:24 UTC
Permalink
Post by Apd
Post by Steve Carroll
Post by Apd
Post by Steve Carroll
1 < 2 < 3
3 < 2 < 1
false < true
They should both return true in dev tools (they do here... in relatively
*modern* browsers ;)
1 < 2 is true, true < 3 is true.
3 < 2 is false, false < 1 is true.
false < true is true.
true < false is false.
A numeric value of 1 and 0 can be inferred for true and false
respectively with other tests.
You and I know what's going on, others may be wondering about 'under the
hood'... it's the type coercion that's hidden (it was the reason I
posted this example, that and the truthy/falsy aspect you alluded to).

You may recall (or not) we once discussed how pre ES6 JS dealt with a
default value like this:

function greet(name) {
name = name || 'Your name goes here'; // Set default if name is falsy
console.log('Hello, ' + name);
}

(that's 'coercion for the good')

Since then we have:

function greet(name = 'default') {
// code
}
David
2025-01-20 20:46:48 UTC
Permalink
Post by Kelly Phillips
I tell myself that I'll be able to play a bit more after I retire, but
that's still a ways off and people tell me you're never as busy as
you'll be in retirement and that they have no idea how they ever found
time for a full time job.
It's true! 🙂

FWIW, I retired in the last century!

Time flies like an arrow; Fruit flies like a banana.

https://alt.politics.scorched-earth.narkive.com/CwZ51F9n/ray-banana
Steve Carroll
2025-01-20 18:14:36 UTC
Permalink
Post by Apd
Post by Steve Carroll
Maybe someone other than you or I would like to give this a try?
There'd be no coding, just assembling. Someone might even learn
something ;)
Y' never know!
Being that you went to all the trouble... after 'assembling' it... I
gave it a try and it seems to work well. I'm sure I didn't do exhaustive
testing to the degree you may have but I tried at least a dozen or so.

(sorry I didn't get around to it earlier, 'stuff' was going on)

Thanks for doing this! Having "other" (non-personal) topics is always a
good thing in a computer based ng. It seems this one is going the way
that much of usenet has (the social media-ization of it has killed off
'tech talk') <shrug>.
Apd
2025-01-20 19:08:04 UTC
Permalink
Post by Steve Carroll
Being that you went to all the trouble... after 'assembling' it... I
gave it a try and it seems to work well. I'm sure I didn't do exhaustive
testing to the degree you may have but I tried at least a dozen or so.
Adding comments helped me understand what I wrote and with that clear,
removing them makes it easier in some respect to read the code. Odd.
Post by Steve Carroll
(sorry I didn't get around to it earlier, 'stuff' was going on)
I didn't expect you to.
Post by Steve Carroll
Thanks for doing this! Having "other" (non-personal) topics is always a
good thing in a computer based ng.
Shoud be the main topics.
Post by Steve Carroll
It seems this one is going the way that much of usenet has (the social
media-ization of it has killed off 'tech talk') <shrug>.
I think web forums did it. Remember, Usenet existed before the web.
However, alt groups for the latest Windows versions are very active
and also some UK groups. Big 8 groups of the comp.lang variety tend to
be inhabited by serious bores and know-it-alls (my opinion). In a
group like this we can discuss programming at any level without being
pedantic aresholes about theory. Same goes for any comp related or
other topics. It doesn't have to be too heavy.
Steve Carroll
2025-01-20 19:36:08 UTC
Permalink
Post by Apd
Post by Steve Carroll
Being that you went to all the trouble... after 'assembling' it... I
gave it a try and it seems to work well. I'm sure I didn't do exhaustive
testing to the degree you may have but I tried at least a dozen or so.
Adding comments helped me understand what I wrote and with that clear,
removing them makes it easier in some respect to read the code. Odd.
Not at all... I do the same, many do. Back in COLA we were once talking
about JS, at least, I *thought* it was about JS, and 'Relf' got on me
for suggesting a duplicate copy of code that had comments. I guess it's
a bigger deal in C <shrug>... doesn't seem like it should be, though.
Post by Apd
Post by Steve Carroll
(sorry I didn't get around to it earlier, 'stuff' was going on)
I didn't expect you to.
Post by Steve Carroll
Thanks for doing this! Having "other" (non-personal) topics is always a
good thing in a computer based ng.
Shoud be the main topics.
Here, it's essentially been a non-topic unless one of us discusses it.
Oddly, several here seem to 'float around' it, which makes no sense to
me given how accessible JS is. You have all the necessary languages
(HTML, CSS and JS), a GUI rendering engine and the ability to make
remote calls to the 'net (i.e. for API calls) built in to every
mainstream browser. The best part? There's almost no setup involved!
Where else can you get all that?! And not having to deal with things
like typing or memory management, the very basics aren't all *that*
difficult. Realistically, you don't need to read any of the highly
condensed docs (they actually are ;) I've posted to get started with
some basic stuff, just a will that's stronger than 'doing the usual
crap'. It seems attention spans are a thing of the past <shrug>.

My take: Even if you had a goal of learning Python, time spent doing the
very basics of JS isn't wasted due to certain base similarities WRT
concepts.
Post by Apd
Post by Steve Carroll
It seems this one is going the way that much of usenet has (the social
media-ization of it has killed off 'tech talk') <shrug>.
I think web forums did it. Remember, Usenet existed before the web.
However, alt groups for the latest Windows versions are very active
and also some UK groups. Big 8 groups of the comp.lang variety tend to
be inhabited by serious bores and know-it-alls (my opinion). In a
group like this we can discuss programming at any level without being
pedantic aresholes about theory. Same goes for any comp related or
other topics. It doesn't have to be too heavy.
That's one thing that was funky about COLA, always a different kind of
'pot pisser' doing their 'thing' (Feeb is a good example).
Apd
2025-01-20 20:52:49 UTC
Permalink
Post by Steve Carroll
Post by Apd
Adding comments helped me understand what I wrote and with that clear,
removing them makes it easier in some respect to read the code. Odd.
Not at all... I do the same, many do. Back in COLA we were once talking
about JS, at least, I *thought* it was about JS, and 'Relf' got on me
for suggesting a duplicate copy of code that had comments. I guess it's
a bigger deal in C <shrug>... doesn't seem like it should be, though.
I don't usually comment to that level of detail. This was an exception
in case the non-programmers were interested. BTW, despite Relf giving
"too much information" about his toilet and other personal habits, and
although I didn't really know him, I was sorry to hear of his passing.
Post by Steve Carroll
Post by Apd
Having "other" (non-personal) topics is always a good thing in a
computer based ng.
Shoud be the main topics.
Here, it's essentially been a non-topic unless one of us discusses it.
Oddly, several here seem to 'float around' it, which makes no sense to
me given how accessible JS is. You have all the necessary languages
(HTML, CSS and JS), a GUI rendering engine and the ability to make
remote calls to the 'net (i.e. for API calls) built in to every
mainstream browser. The best part? There's almost no setup involved!
Where else can you get all that?! And not having to deal with things
like typing or memory management, the very basics aren't all *that*
difficult.
These are all very good points.
Post by Steve Carroll
Realistically, you don't need to read any of the highly
condensed docs (they actually are ;) I've posted to get started with
some basic stuff, just a will that's stronger than 'doing the usual
crap'. It seems attention spans are a thing of the past <shrug>.
I've always been interested in making a computer do what I want, from
the days before they were available to the general public. Not eveyone
has that interest, though.
Post by Steve Carroll
My take: Even if you had a goal of learning Python, time spent doing the
very basics of JS isn't wasted due to certain base similarities WRT
concepts.
Sure, and gets you into the right frame of mind if you're so inclined.
Post by Steve Carroll
Post by Apd
In a group like this we can discuss programming at any level without
being pedantic arseholes about theory. Same goes for any comp related
or other topics. It doesn't have to be too heavy.
That's one thing that was funky about COLA, always a different kind of
'pot pisser' doing their 'thing' (Feeb is a good example).
He's like a madman shouting in the street.
Steve Carroll
2025-01-21 15:48:03 UTC
Permalink
Post by Apd
Post by Steve Carroll
Post by Apd
Adding comments helped me understand what I wrote and with that clear,
removing them makes it easier in some respect to read the code. Odd.
Not at all... I do the same, many do. Back in COLA we were once talking
about JS, at least, I *thought* it was about JS, and 'Relf' got on me
for suggesting a duplicate copy of code that had comments. I guess it's
a bigger deal in C <shrug>... doesn't seem like it should be, though.
I don't usually comment to that level of detail. This was an exception
in case the non-programmers were interested. BTW, despite Relf giving
"too much information" about his toilet and other personal habits,
You read about his "other" personal habits? ;)
Post by Apd
and although I didn't really know him, I was sorry to hear of his passing.
Same here.
Post by Apd
Post by Steve Carroll
Post by Apd
Having "other" (non-personal) topics is always a good thing in a
computer based ng.
Shoud be the main topics.
Here, it's essentially been a non-topic unless one of us discusses it.
Oddly, several here seem to 'float around' it, which makes no sense to
me given how accessible JS is. You have all the necessary languages
(HTML, CSS and JS), a GUI rendering engine and the ability to make
remote calls to the 'net (i.e. for API calls) built in to every
mainstream browser. The best part? There's almost no setup involved!
Where else can you get all that?! And not having to deal with things
like typing or memory management, the very basics aren't all *that*
difficult.
These are all very good points.
I guess it's like I said a long time ago, when I made the analogy with
guitar... I've heard lots of people say: 'I wish I played guitar'.

From my POV this ng is like a bunch of people 'talking about guitar' for
various reasons, or 'talking about playing guitar' but few of them (if
any) are going to do what it takes to actually learn to play... not even
a few very simple chords.
Post by Apd
Post by Steve Carroll
Realistically, you don't need to read any of the highly
condensed docs (they actually are ;) I've posted to get started with
some basic stuff, just a will that's stronger than 'doing the usual
crap'. It seems attention spans are a thing of the past <shrug>.
I've always been interested in making a computer do what I want, from
the days before they were available to the general public. Not eveyone
has that interest, though.
That's the thing, though... some here have it, they just prefer to let
"others" deal with the 'work' part of the equation. Granted, the 'net
facilitated this... ME has JumbleSolver to go to, Tim has forums to get
his questions answered (or someone like you), DB has people to endlessly
bother with his code related questions, etc., so there's no real need.

I look at it from the viewpoint of what the browser packages together
and the value I can get from that... but even I draw lines... I stopped
at wildcards, letting you do the work. BUT... there was some fun in the
exchange and that's the point! I guess I don't understand all the
'guitar-like' (so to speak) conversations... where there's no actual
'sharing and learning' <shrug>.

Yes, I know, you'll snip that and much more ;)
Post by Apd
Post by Steve Carroll
My take: Even if you had a goal of learning Python, time spent doing the
very basics of JS isn't wasted due to certain base similarities WRT
concepts.
Sure, and gets you into the right frame of mind if you're so inclined.
Outside of lame social media sites, I've never seen people talk *around*
things they're 'not so inclined to do' as I have in this ng.
Post by Apd
Post by Steve Carroll
Post by Apd
In a group like this we can discuss programming at any level without
being pedantic arseholes about theory. Same goes for any comp related
or other topics. It doesn't have to be too heavy.
That's one thing that was funky about COLA, always a different kind of
'pot pisser' doing their 'thing' (Feeb is a good example).
He's like a madman shouting in the street.
He's another one where I can't help but believe he purposefully 'plays
stupid' to get attention.
Apd
2025-01-21 17:06:50 UTC
Permalink
Post by Steve Carroll
BTW, despite Relf giving "too much information" about his toilet and
other personal habits,
You read about his "other" personal habits? ;)
Sometimes difficult to avoid when following a thread in GG.
Post by Steve Carroll
These are all very good points.
I guess it's like I said a long time ago, when I made the analogy with
guitar... I've heard lots of people say: 'I wish I played guitar'.
From my POV this ng is like a bunch of people 'talking about guitar' for
various reasons, or 'talking about playing guitar' but few of them (if
any) are going to do what it takes to actually learn to play... not even
a few very simple chords.
FTR plays. I learned the basics once and got hardened fingertips. I
tried, was crap, so didn't continue with it.
Post by Steve Carroll
I've always been interested in making a computer do what I want, from
the days before they were available to the general public. Not eveyone
has that interest, though.
That's the thing, though... some here have it, they just prefer to let
"others" deal with the 'work' part of the equation. Granted, the 'net
facilitated this... ME has JumbleSolver to go to, Tim has forums to get
his questions answered (or someone like you), DB has people to endlessly
bother with his code related questions, etc., so there's no real need.
But mainly not the interest or even aptitude. It's not everyone's
cup of tea.
Post by Steve Carroll
I look at it from the viewpoint of what the browser packages together
and the value I can get from that... but even I draw lines... I stopped
at wildcards, letting you do the work.
Which I wanted to do, and was very satisfying when it eventually
worked without the complications I thought it needed. It's like
solving a puzzle and it can be mind bending and frustrating when you
get stuck in a rut of thought.
Post by Steve Carroll
BUT... there was some fun in the exchange and that's the point!
Of course.
Post by Steve Carroll
I guess I don't understand all the 'guitar-like' (so to speak)
conversations... where there's no actual 'sharing and learning' <shrug>.
Yes, I know, you'll snip that and much more ;)
Well, I didn't but did the rest! Doesn't mean I haven't read it or
don't acknowledge/appreciate it.
Steve Carroll
2025-01-21 18:44:29 UTC
Permalink
Post by Apd
Post by Steve Carroll
From my POV this ng is like a bunch of people 'talking about guitar' for
various reasons, or 'talking about playing guitar' but few of them (if
any) are going to do what it takes to actually learn to play... not even
a few very simple chords.
FTR plays. I learned the basics once and got hardened fingertips. I
tried, was crap, so didn't continue with it.
I was just using it as an analogy... but I wasn't aware you got to that
point (or played at all). You should've 'kept your hand it in' (pun
intended), it takes awhile for that to happen.
Post by Apd
Post by Steve Carroll
Post by Apd
I've always been interested in making a computer do what I want, from
the days before they were available to the general public. Not eveyone
has that interest, though.
That's the thing, though... some here have it, they just prefer to let
"others" deal with the 'work' part of the equation. Granted, the 'net
facilitated this... ME has JumbleSolver to go to, Tim has forums to get
his questions answered (or someone like you), DB has people to endlessly
bother with his code related questions, etc., so there's no real need.
But mainly not the interest or even aptitude. It's not everyone's
cup of tea.
I know... but I've always had it in my mind that HTML is 'the new pen
and paper'. As such, it's crazy to not be at least somewhat familiar
with how to manipulate docs on a basic level via JS/CSS. The irony is,
so little knowledge is required to do 'the basics' (knowledge that
quickly opens the door to more advanced, things).
Post by Apd
Post by Steve Carroll
I look at it from the viewpoint of what the browser packages together
and the value I can get from that... but even I draw lines... I stopped
at wildcards, letting you do the work.
Which I wanted to do, and was very satisfying when it eventually
worked without the complications I thought it needed. It's like
solving a puzzle and it can be mind bending and frustrating when you
get stuck in a rut of thought.
It was actually ME's questioning of a 'coder thought process' that got
me thinking about this stuff again.
Post by Apd
Post by Steve Carroll
BUT... there was some fun in the exchange and that's the point!
Of course.
Post by Steve Carroll
I guess I don't understand all the 'guitar-like' (so to speak)
conversations... where there's no actual 'sharing and learning' <shrug>.
Yes, I know, you'll snip that and much more ;)
Well, I didn't but did the rest! Doesn't mean I haven't read it or
don't acknowledge/appreciate it.
You probably should've reversed things ;)
Apd
2025-01-21 20:57:51 UTC
Permalink
Post by Steve Carroll
Post by Apd
FTR plays. I learned the basics once and got hardened fingertips. I
tried, was crap, so didn't continue with it.
I was just using it as an analogy...
Yes, but pothead experienced the same (being crap) with programming
yet still kept an interest in technology.
Post by Steve Carroll
but I wasn't aware you got to that point (or played at all). You
should've 'kept your hand it in' (pun intended), it takes awhile
for that to happen.
I know you have to keep at it. I went through all that with piano
lessons as a child (I still can't play). Perhaps I had other
priorities or was ham fisted. I never got past playing guitar chord
sequences.
Post by Steve Carroll
Post by Apd
But mainly not the interest or even aptitude. It's not everyone's
cup of tea.
I know... but I've always had it in my mind that HTML is 'the new pen
and paper'. As such, it's crazy to not be at least somewhat familiar
with how to manipulate docs on a basic level via JS/CSS. The irony is,
so little knowledge is required to do 'the basics' (knowledge that
quickly opens the door to more advanced, things).
I suspect yer average person thinks MS Word in the new pen & paper.
Post by Steve Carroll
It was actually ME's questioning of a 'coder thought process' that got
me thinking about this stuff again.
If you hadn't started that discussion from his question, I would have.
Steve Carroll
2025-01-22 18:02:36 UTC
Permalink
Post by Apd
I know you have to keep at it. I went through all that with piano
lessons as a child (I still can't play). Perhaps I had other
priorities or was ham fisted. I never got past playing guitar chord
sequences.
Nothing wrong with that.
Yes, but they weren't many. My fingers aren't supple/flexible enough.
Post by Apd
I suspect yer average person thinks MS Word in the new pen & paper.
OK, it's the new printing press that virtually anyone can have.
It's more now that in-browser apps can be written with Java, JS, or
Wasm.
That's my argument!

OTOH, it *can* be simple enough for 'lay persons'. Look at the calc
thing I've posted... 'interested' ten year olds can grok it. For the
average, simple web page, you don't need to get that complex (not that
it's actually complex). It's a good bet everyone in this ng has created
an html doc at some point. No matter, people prefer to talk about OSes
they do nothing with ;) I've never understood that, either <shrug>
Post by Apd
If you hadn't started that discussion from his question, I would have.
I figured... but that's part of the issue, it's only you or I. When one
of us croaks... it's curtains... ;) I never expected this ng to be a
'programming' ng, but I never expected that people would talk 'all
around it' without learning at least a tiny bit.
It's what we make it. Seeing that it's high on the list of busy groups
??? You're kidding! Usenet must be worse off than I thought ;)
I reckon others check it out from time to time. If they see relevant
content they make take part.
Apd
2025-01-22 23:34:02 UTC
Permalink
<https://newsgrouper.org.uk/tops>
Thanks.
I've never been able to figure out how to locate this information myself.
Ray Banana has a listing too!
See: https://www.eternal-september.org/hierarchies.php?language=en
Also group posting stats from ES users in the last chart here:
<https://www.eternal-september.org/postingstats.php>

ACW is not too far from the top.
pothead
2025-01-23 01:04:46 UTC
Permalink
Post by Apd
<https://newsgrouper.org.uk/tops>
Thanks.
I've never been able to figure out how to locate this information myself.
Ray Banana has a listing too!
See: https://www.eternal-september.org/hierarchies.php?language=en
<https://www.eternal-september.org/postingstats.php>
ACW is not too far from the top.
Tks.
iw as approaching this from the wrong angle, ie: google groups when it was active.
--
pothead

"Give a man a fish and you turn him into a Democrat for life"
"Teach a man to fish and he might become a self-sufficient conservative Republican"
"Don't underestimate Joe's ability to fuck things up,"
--- Barack H. Obama
The Biden Crime Family Timeline here:
https://oversight.house.gov/the-bidens-influence-peddling-timeline/
David
2025-01-23 08:17:26 UTC
Permalink
Post by Apd
<https://newsgrouper.org.uk/tops>
Thanks.
I've never been able to figure out how to locate this information myself.
Ray Banana has a listing too!
See: https://www.eternal-september.org/hierarchies.php?language=en
<https://www.eternal-september.org/postingstats.php>
ACW is not too far from the top.
Thanks - I do believe you showed that once before.

You have much knowledge about a wide range of things. Please share
things /other/ than writing code.


Here's the same thing written in JavaScript:

```javascript
// Function to share knowledge on various topics other than coding
function shareKnowledge(topic) {
const knowledgeBase = {
history: "The Great Wall of China was built over several
dynasties to protect against invasions.",
science: "Did you know that water expands when it freezes?
That's why ice floats on water.",
art: "The Mona Lisa is one of the most famous paintings in the
world, created by Leonardo da Vinci.",
music: "The Beatles revolutionized pop music in the 1960s with
their innovative albums.",
philosophy: "Plato's allegory of the cave explores the concept
of perception versus reality."
};

return knowledgeBase[topic.toLowerCase()] ||
"I can share knowledge on history, science, art, music, and
philosophy!";
}

// Example usage
console.log(shareKnowledge("science"));
console.log(shareKnowledge("music"));
console.log(shareKnowledge("unknown"));
```

=

Do you read many books?
--
David
Apd
2025-01-23 10:51:28 UTC
Permalink
Post by David
You have much knowledge about a wide range of things.
I'm not sure about that.
Post by David
Please share things /other/ than writing code.
I do if something prompts me.
Post by David
```javascript
// Function to share knowledge on various topics other than coding
function shareKnowledge(topic) {
[...]

That could be expanded to give more than one answer for the same
topic. What did you tell AI to produce it?
Post by David
Do you read many books?
Not now, and I never really have other than technical literature.
Steve Carroll
2025-01-23 13:54:01 UTC
Permalink
Post by Apd
Post by David
You have much knowledge about a wide range of things.
I'm not sure about that.
Post by David
Please share things /other/ than writing code.
I do if something prompts me.
You do so all the time and always have. What's wrong with him now ;)
Post by Apd
Post by David
```javascript
// Function to share knowledge on various topics other than coding
function shareKnowledge(topic) {
[...]
That could be expanded to give more than one answer for the same
topic. What did you tell AI to produce it?
Post by David
Do you read many books?
Not now, and I never really have other than technical literature.
David
2025-01-23 14:00:05 UTC
Permalink
Post by Apd
Post by David
You have much knowledge about a wide range of things.
I'm not sure about that.
I'm not going to give you any kind of 'test'!
Post by Apd
Post by David
Please share things /other/ than writing code.
I do if something prompts me.
Please provide a few examples of what kind of things "prompt" you.
Post by Apd
Post by David
```javascript
// Function to share knowledge on various topics other than coding
function shareKnowledge(topic) {
[...]
That could be expanded to give more than one answer for the same
topic. What did you tell AI to produce it?
I simple asked AI to turn my sentence into code.
Post by Apd
Post by David
Do you read many books?
Not now, and I never really have other than technical literature.
That's something we have in common!
--
David
It's been VERY wet here this morning!
Apd
2025-01-23 19:55:40 UTC
Permalink
Post by David
Post by Apd
Post by David
Please share things /other/ than writing code.
I do if something prompts me.
Please provide a few examples of what kind of things "prompt" you.
Questions about computing, mainly. Otherwise, anything that takes my
fancy. You've seen what I post.
Post by David
Post by Apd
That could be expanded to give more than one answer for the same
topic. What did you tell AI to produce it?
I simple asked AI to turn my sentence into code.
And it chose JS?
David
2025-01-23 22:12:13 UTC
Permalink
Post by Apd
Post by David
Post by Apd
Post by David
Please share things /other/ than writing code.
I do if something prompts me.
Please provide a few examples of what kind of things "prompt" you.
Questions about computing, mainly. Otherwise, anything that takes my
fancy. You've seen what I post.
OK. Thanks.
Post by Apd
Post by David
Post by Apd
That could be expanded to give more than one answer for the same
topic. What did you tell AI to produce it?
I simple asked AI to turn my sentence into code.
And it chose JS?
No, not to start with. I prompted it for that.
(No, I can't recall the first one!! Sorry)
%
2025-01-23 12:52:54 UTC
Permalink
Post by David
Post by Apd
<https://newsgrouper.org.uk/tops>
Thanks.
I've never been able to figure out how to locate this information myself.
Ray Banana has a listing too!
See: https://www.eternal-september.org/hierarchies.php?language=en
<https://www.eternal-september.org/postingstats.php>
ACW is not too far from the top.
Thanks - I do believe you showed that once before.
You have much knowledge about a wide range of things. Please share
things /other/ than writing code.
```javascript
// Function to share knowledge on various topics other than coding
function shareKnowledge(topic) {
    const knowledgeBase = {
        history: "The Great Wall of China was built over several
dynasties to protect against invasions.",
        science: "Did you know that water expands when it freezes?
That's why ice floats on water.",
        art: "The Mona Lisa is one of the most famous paintings in the
world, created by Leonardo da Vinci.",
        music: "The Beatles revolutionized pop music in the 1960s with
their innovative albums.",
        philosophy: "Plato's allegory of the cave explores the concept
of perception versus reality."
    };
    return knowledgeBase[topic.toLowerCase()] ||
           "I can share knowledge on history, science, art, music, and
philosophy!";
}
// Example usage
console.log(shareKnowledge("science"));
console.log(shareKnowledge("music"));
console.log(shareKnowledge("unknown"));
```
=
Do you read many books?
i can't read
Steve Carroll
2025-01-23 13:51:36 UTC
Permalink
Post by David
Post by Apd
<https://newsgrouper.org.uk/tops>
Thanks.
I've never been able to figure out how to locate this information myself.
Ray Banana has a listing too!
See: https://www.eternal-september.org/hierarchies.php?language=en
<https://www.eternal-september.org/postingstats.php>
ACW is not too far from the top.
Thanks - I do believe you showed that once before.
You have much knowledge about a wide range of things. Please share
things /other/ than writing code.
```javascript
// Function to share knowledge on various topics other than coding
function shareKnowledge(topic) {
const knowledgeBase = {
history: "The Great Wall of China was built over several
dynasties to protect against invasions.",
science: "Did you know that water expands when it freezes?
That's why ice floats on water.",
art: "The Mona Lisa is one of the most famous paintings in the
world, created by Leonardo da Vinci.",
music: "The Beatles revolutionized pop music in the 1960s with
their innovative albums.",
philosophy: "Plato's allegory of the cave explores the concept
of perception versus reality."
};
return knowledgeBase[topic.toLowerCase()] ||
"I can share knowledge on history, science, art, music, and
philosophy!";
}
// Example usage
console.log(shareKnowledge("science"));
console.log(shareKnowledge("music"));
console.log(shareKnowledge("unknown"));
```
function dunce(thing){
const blah = `SSBjYW4gc2hhcmUgbmFobGlkZ2Ugb24gaGlzdHVyeSwgc2NpZW50cywgYXJ0LCBtdXNpY2ssIGFuZCBmaWxhaHNvZmVlIQ==`
const some = {
history: `VGhlIEdyZWF0IFdhbGwgb2YgQ2hpbmEgd2FzIGdyZWF0IGJlZm9yZSBpdCBmZWxsLg==`,
science: `RGlkIHlvdSBrbm93IHdhdGVyIGZyb3plPyBPbmNlLg==`,
art: `VGhlIE1vYW5hIExpc2Egd2FzIHdyaXR0ZW4gYnkgTG9ubnkgRGVlLg==`,
music: `VGhlIEJlZXRsZXMgaW52YWRlZCBwb3AgY3VsdHNodXIgd2l0aCB0aGVpciBpbnZlbnNodW4gb2YgUGVwc2Vl`,
philosophy: `UGxhdG8ncyBjYXZlOiBzaGFkb3cgcHVwcGV0cywgYnV0IG1ha2UgaXQgZXhpc3RlbnRpYWwu`
}

if(thing){
return atob(some[thing])
}

else {
return atob(blah)
}
}

// to run it...
dunce()
dunce('music')
Apd
2025-01-23 21:15:53 UTC
Permalink
Post by Steve Carroll
`UGxhdG8ncyBjYXZlOiBzaGFkb3cgcHVwcGV0cywgYnV0IG1ha2UgaXQgZXhpc3RlbnRpYWwu`
}
if(thing){
return atob(some[thing])
}
atob("QXJpc3RvdGxlLCBBcmlzdG90bGUgd2FzIGEgYnVnZ2VyIGZvciB0aGUgYm90dGxlLi4u")

I didn't know about that function (on the window object) and its
counterpart.
%
2025-01-23 21:20:01 UTC
Permalink
Post by Apd
Post by Steve Carroll
`UGxhdG8ncyBjYXZlOiBzaGFkb3cgcHVwcGV0cywgYnV0IG1ha2UgaXQgZXhpc3RlbnRpYWwu`
}
if(thing){
return atob(some[thing])
}
atob("QXJpc3RvdGxlLCBBcmlzdG90bGUgd2FzIGEgYnVnZ2VyIGZvciB0aGUgYm90dGxlLi4u")
I didn't know about that function (on the window object) and its
counterpart.
what
Steve Carroll
2025-01-23 21:39:59 UTC
Permalink
Post by Apd
Post by Steve Carroll
`UGxhdG8ncyBjYXZlOiBzaGFkb3cgcHVwcGV0cywgYnV0IG1ha2UgaXQgZXhpc3RlbnRpYWwu`
}
if(thing){
return atob(some[thing])
}
atob("QXJpc3RvdGxlLCBBcmlzdG90bGUgd2FzIGEgYnVnZ2VyIGZvciB0aGUgYm90dGxlLi4u")
I didn't know about that function (on the window object) and its
counterpart.
Comes in handy (even for stuff like this).

It seems DB isn't going to pursue what you suggested (multi-string
option) :-(

(I'd like to believe the younger version of him would've at least given
it a shot).
%
2025-01-23 21:49:34 UTC
Permalink
Post by Steve Carroll
Post by Apd
Post by Steve Carroll
`UGxhdG8ncyBjYXZlOiBzaGFkb3cgcHVwcGV0cywgYnV0IG1ha2UgaXQgZXhpc3RlbnRpYWwu`
}
if(thing){
return atob(some[thing])
}
atob("QXJpc3RvdGxlLCBBcmlzdG90bGUgd2FzIGEgYnVnZ2VyIGZvciB0aGUgYm90dGxlLi4u")
I didn't know about that function (on the window object) and its
counterpart.
Comes in handy (even for stuff like this).
It seems DB isn't going to pursue what you suggested (multi-string
option) :-(
(I'd like to believe the younger version of him would've at least given
it a shot).
and how many times does he ,
shake it when he's finished pissing ,
i'm sure you know
Kelly Phillips
2025-01-23 22:38:44 UTC
Permalink
Post by Apd
Post by Steve Carroll
`UGxhdG8ncyBjYXZlOiBzaGFkb3cgcHVwcGV0cywgYnV0IG1ha2UgaXQgZXhpc3RlbnRpYWwu`
}
if(thing){
return atob(some[thing])
}
atob("QXJpc3RvdGxlLCBBcmlzdG90bGUgd2FzIGEgYnVnZ2VyIGZvciB0aGUgYm90dGxlLi4u")
I didn't know about that function (on the window object) and its
counterpart.
I'm sure I'm wrong because I'm not of this JS world, but I thought that
atob and its counterpart btoa were considered 'legacy', replaced by the
Buffer class.
David
2025-01-23 22:52:34 UTC
Permalink
Post by Kelly Phillips
Post by Apd
Post by Steve Carroll
`UGxhdG8ncyBjYXZlOiBzaGFkb3cgcHVwcGV0cywgYnV0IG1ha2UgaXQgZXhpc3RlbnRpYWwu`
}
if(thing){
return atob(some[thing])
}
atob("QXJpc3RvdGxlLCBBcmlzdG90bGUgd2FzIGEgYnVnZ2VyIGZvciB0aGUgYm90dGxlLi4u")
I didn't know about that function (on the window object) and its
counterpart.
I'm sure I'm wrong because I'm not of this JS world, but I thought that
atob and its counterpart btoa were considered 'legacy', replaced by the
Buffer class.
You're not wrong at all in thinking that there’s been a shift in
JavaScript for handling binary data, but there’s a bit of nuance to it.
Let me explain!

### `atob` and `btoa`:
- **`atob`** (ASCII to binary) and **`btoa`** (binary to ASCII) are
indeed older methods for encoding and decoding base64 data. They're
built into the browser’s global scope and work well for client-side
JavaScript when you need to handle base64 data, often with strings that
are simple to encode/decode (e.g., text data).

- These methods, however, have some limitations. They're **strictly for
ASCII data**, meaning they can run into trouble with non-ASCII
characters (like UTF-8 encoded characters) because they assume the data
is just standard Latin-1 text.

### `Buffer` (Node.js):
- The **`Buffer`** class is part of Node.js and is designed to handle
binary data in a more flexible, modern way. It allows you to work with
raw binary data, and can also handle encoding/decoding with base64,
among other formats. It's generally more powerful and works seamlessly
with both binary data and UTF-8.

### The key difference:
- **`atob`/`btoa`**: These are simple, client-side methods and mostly
for browser environments, but not as robust as `Buffer` for dealing with
a variety of encodings or binary data beyond basic text.
- **`Buffer`**: This is more sophisticated and is often used server-side
(Node.js), though it can be used in the browser through libraries like
`buffer` if you need that kind of functionality.

### Are `atob`/`btoa` legacy?
- In modern JavaScript, especially when working on the server side or in
Node.js environments, **`Buffer`** is generally preferred for its
broader capabilities. But **`atob`/`btoa`** are still very much in use
for simple encoding and decoding in the browser.

In summary, if you're in a browser environment and need something simple
and lightweight, `atob` and `btoa` are still fine. But if you're in a
Node.js environment or dealing with more complex binary data, the
`Buffer` class is definitely the modern tool of choice.
David
2025-01-23 22:54:44 UTC
Permalink
Post by David
Post by Kelly Phillips
Post by Apd
Post by Steve Carroll
`UGxhdG8ncyBjYXZlOiBzaGFkb3cgcHVwcGV0cywgYnV0IG1ha2UgaXQgZXhpc3RlbnRpYWwu`
  }
  if(thing){
      return atob(some[thing])
  }
atob("QXJpc3RvdGxlLCBBcmlzdG90bGUgd2FzIGEgYnVnZ2VyIGZvciB0aGUgYm90dGxlLi4u")
I didn't know about that function (on the window object) and its
counterpart.
I'm sure I'm wrong because I'm not of this JS world, but I thought that
atob and its counterpart btoa were considered 'legacy', replaced by the
Buffer class.
You're not wrong at all in thinking that there’s been a shift in
JavaScript for handling binary data, but there’s a bit of nuance to it.
Let me explain!
- **`atob`** (ASCII to binary) and **`btoa`** (binary to ASCII) are
indeed older methods for encoding and decoding base64 data. They're
built into the browser’s global scope and work well for client-side
JavaScript when you need to handle base64 data, often with strings that
are simple to encode/decode (e.g., text data).
- These methods, however, have some limitations. They're **strictly for
ASCII data**, meaning they can run into trouble with non-ASCII
characters (like UTF-8 encoded characters) because they assume the data
is just standard Latin-1 text.
- The **`Buffer`** class is part of Node.js and is designed to handle
binary data in a more flexible, modern way. It allows you to work with
raw binary data, and can also handle encoding/decoding with base64,
among other formats. It's generally more powerful and works seamlessly
with both binary data and UTF-8.
- **`atob`/`btoa`**: These are simple, client-side methods and mostly
for browser environments, but not as robust as `Buffer` for dealing with
a variety of encodings or binary data beyond basic text.
- **`Buffer`**: This is more sophisticated and is often used server-side
(Node.js), though it can be used in the browser through libraries like
`buffer` if you need that kind of functionality.
### Are `atob`/`btoa` legacy?
- In modern JavaScript, especially when working on the server side or in
Node.js environments, **`Buffer`** is generally preferred for its
broader capabilities. But **`atob`/`btoa`** are still very much in use
for simple encoding and decoding in the browser.
In summary, if you're in a browser environment and need something simple
and lightweight, `atob` and `btoa` are still fine. But if you're in a
Node.js environment or dealing with more complex binary data, the
`Buffer` class is definitely the modern tool of choice.
For anyone in doubt, the answer was from ChatGPT!
--
David
FromTheRafters
2025-01-24 12:28:24 UTC
Permalink
Post by David
Post by Kelly Phillips
Post by Apd
Post by Steve Carroll
`UGxhdG8ncyBjYXZlOiBzaGFkb3cgcHVwcGV0cywgYnV0IG1ha2UgaXQgZXhpc3RlbnRpYWwu`
  }
  if(thing){
      return atob(some[thing])
  }
atob("QXJpc3RvdGxlLCBBcmlzdG90bGUgd2FzIGEgYnVnZ2VyIGZvciB0aGUgYm90dGxlLi4u")
I didn't know about that function (on the window object) and its
counterpart.
I'm sure I'm wrong because I'm not of this JS world, but I thought that
atob and its counterpart btoa were considered 'legacy', replaced by the
Buffer class.
You're not wrong at all in thinking that there’s been a shift in JavaScript
for handling binary data, but there’s a bit of nuance to it. Let me
explain!
- **`atob`** (ASCII to binary) and **`btoa`** (binary to ASCII) are indeed
older methods for encoding and decoding base64 data. They're built into the
browser’s global scope and work well for client-side JavaScript when you
need to handle base64 data, often with strings that are simple to
encode/decode (e.g., text data).
- These methods, however, have some limitations. They're **strictly for
ASCII data**, meaning they can run into trouble with non-ASCII characters
(like UTF-8 encoded characters) because they assume the data is just
standard Latin-1 text.
- The **`Buffer`** class is part of Node.js and is designed to handle
binary data in a more flexible, modern way. It allows you to work with raw
binary data, and can also handle encoding/decoding with base64, among other
formats. It's generally more powerful and works seamlessly with both binary
data and UTF-8.
- **`atob`/`btoa`**: These are simple, client-side methods and mostly for
browser environments, but not as robust as `Buffer` for dealing with a
variety of encodings or binary data beyond basic text.
- **`Buffer`**: This is more sophisticated and is often used server-side
(Node.js), though it can be used in the browser through libraries like
`buffer` if you need that kind of functionality.
### Are `atob`/`btoa` legacy?
- In modern JavaScript, especially when working on the server side or in
Node.js environments, **`Buffer`** is generally preferred for its broader
capabilities. But **`atob`/`btoa`** are still very much in use for simple
encoding and decoding in the browser.
In summary, if you're in a browser environment and need something simple
and lightweight, `atob` and `btoa` are still fine. But if you're in a
Node.js environment or dealing with more complex binary data, the `Buffer`
class is definitely the modern tool of choice.
For anyone in doubt, the answer was from ChatGPT!
Binary to ASCII doesn't sound right to me. B64 is a specific subset of
ASCII in fact a subset of 7 bit ASCII. I suppose if used just as
obfuscation we can ignore its use as a way to pass binary through 7 bit
ASCII systems.
Apd
2025-01-24 13:48:26 UTC
Permalink
Post by FromTheRafters
Binary to ASCII doesn't sound right to me. B64 is a specific subset of
ASCII in fact a subset of 7 bit ASCII. I suppose if used just as
obfuscation we can ignore its use as a way to pass binary through 7 bit
ASCII systems.
I also thought it was the wrong way round but they are approaching it
from that viewpoint. All ASCII chars are treated as a binary byte, so
control chars like CR, LF, FF and higher 8-bit ANSI bytes don't get
interpreted. They can be made transportable ASCII by encoding them as
such, hence "b to a". They just happened to use Base64.

Each character in an input string using btoa() is considered to be a
single byte. In JS, unicode chars in a string will fail because they
can have multiple bytes. This explains how to convert them:

<https://developer.mozilla.org/en-US/docs/Web/API/Window/btoa>
FromTheRafters
2025-01-24 15:01:36 UTC
Permalink
Post by Apd
Post by FromTheRafters
Binary to ASCII doesn't sound right to me. B64 is a specific subset of
ASCII in fact a subset of 7 bit ASCII. I suppose if used just as
obfuscation we can ignore its use as a way to pass binary through 7 bit
ASCII systems.
I also thought it was the wrong way round but they are approaching it
from that viewpoint. All ASCII chars are treated as a binary byte, so
control chars like CR, LF, FF and higher 8-bit ANSI bytes don't get
interpreted. They can be made transportable ASCII by encoding them as
such, hence "b to a". They just happened to use Base64.
I see, it is clearer in the docs.
Post by Apd
Each character in an input string using btoa() is considered to be a
single byte. In JS, unicode chars in a string will fail because they
<https://developer.mozilla.org/en-US/docs/Web/API/Window/btoa>
Yes, I see how the Base64 encoding is used simply as a means to an end
here.
Steve Carroll
2025-01-23 23:25:44 UTC
Permalink
Post by David
Post by Kelly Phillips
Post by Apd
Post by Steve Carroll
`UGxhdG8ncyBjYXZlOiBzaGFkb3cgcHVwcGV0cywgYnV0IG1ha2UgaXQgZXhpc3RlbnRpYWwu`
}
if(thing){
return atob(some[thing])
}
atob("QXJpc3RvdGxlLCBBcmlzdG90bGUgd2FzIGEgYnVnZ2VyIGZvciB0aGUgYm90dGxlLi4u")
I didn't know about that function (on the window object) and its
counterpart.
I'm sure I'm wrong because I'm not of this JS world, but I thought that
atob and its counterpart btoa were considered 'legacy', replaced by the
Buffer class.
You're not wrong at all in thinking that there’s been a shift in
JavaScript for handling binary data, but there’s a bit of nuance to it.
Let me explain!
- **`atob`** (ASCII to binary) and **`btoa`** (binary to ASCII) are
indeed older methods for encoding and decoding base64 data. They're
built into the browser’s global scope and work well for client-side
JavaScript when you need to handle base64 data, often with strings that
are simple to encode/decode (e.g., text data).
- These methods, however, have some limitations. They're **strictly for
ASCII data**, meaning they can run into trouble with non-ASCII
characters (like UTF-8 encoded characters) because they assume the data
is just standard Latin-1 text.
I assumed (mistakenly, apparently) he meant:

ArrayBuffer... but it's an object and he did say "class". Oops!

(node.js isn't applicable here)

Did you even run the code I gave you? No need to reply, that's a 'no' ;)
Steve Carroll
2025-01-23 23:21:38 UTC
Permalink
Post by Kelly Phillips
Post by Apd
Post by Steve Carroll
`UGxhdG8ncyBjYXZlOiBzaGFkb3cgcHVwcGV0cywgYnV0IG1ha2UgaXQgZXhpc3RlbnRpYWwu`
}
if(thing){
return atob(some[thing])
}
atob("QXJpc3RvdGxlLCBBcmlzdG90bGUgd2FzIGEgYnVnZ2VyIGZvciB0aGUgYm90dGxlLi4u")
I didn't know about that function (on the window object) and its
counterpart.
I'm sure I'm wrong because I'm not of this JS world, but I thought that
atob and its counterpart btoa were considered 'legacy', replaced by the
Buffer class.
They are dated... not being a person that uses them (you just saw what I
do with them :), I do know they're still used in the browser for certain
things, even though ArrayBuffer is more 'modern', flexible, whiter
teeth, etc. ;)

For what I just did, simple obfuscation, this is fine
(it's quick 'n dirty, easy to read and all base64).

It's nice to see someone 'else' reading this stuff!
Kelly Phillips
2025-01-24 00:13:56 UTC
Permalink
On Thu, 23 Jan 2025 23:21:38 -0000 (UTC), Steve Carroll <"Steve
Post by Steve Carroll
Post by Kelly Phillips
Post by Apd
Post by Steve Carroll
`UGxhdG8ncyBjYXZlOiBzaGFkb3cgcHVwcGV0cywgYnV0IG1ha2UgaXQgZXhpc3RlbnRpYWwu`
}
if(thing){
return atob(some[thing])
}
atob("QXJpc3RvdGxlLCBBcmlzdG90bGUgd2FzIGEgYnVnZ2VyIGZvciB0aGUgYm90dGxlLi4u")
I didn't know about that function (on the window object) and its
counterpart.
I'm sure I'm wrong because I'm not of this JS world, but I thought that
atob and its counterpart btoa were considered 'legacy', replaced by the
Buffer class.
They are dated... not being a person that uses them (you just saw what I
do with them :), I do know they're still used in the browser for certain
things, even though ArrayBuffer is more 'modern', flexible, whiter
teeth, etc. ;)
For what I just did, simple obfuscation, this is fine
(it's quick 'n dirty, easy to read and all base64).
It's nice to see someone 'else' reading this stuff!
I've been reading the entire thread! :)
I know it's not the engagement you were looking for but it's all I can
manage at the moment. I appreciate what you're doing.
FromTheRafters
2025-01-24 12:30:18 UTC
Permalink
Post by Kelly Phillips
On Thu, 23 Jan 2025 23:21:38 -0000 (UTC), Steve Carroll <"Steve
Post by Steve Carroll
Post by Kelly Phillips
Post by Apd
Post by Steve Carroll
`UGxhdG8ncyBjYXZlOiBzaGFkb3cgcHVwcGV0cywgYnV0IG1ha2UgaXQgZXhpc3RlbnRpYWwu`
}
if(thing){
return atob(some[thing])
}
atob("QXJpc3RvdGxlLCBBcmlzdG90bGUgd2FzIGEgYnVnZ2VyIGZvciB0aGUgYm90dGxlLi4u")
I didn't know about that function (on the window object) and its
counterpart.
I'm sure I'm wrong because I'm not of this JS world, but I thought that
atob and its counterpart btoa were considered 'legacy', replaced by the
Buffer class.
They are dated... not being a person that uses them (you just saw what I
do with them :), I do know they're still used in the browser for certain
things, even though ArrayBuffer is more 'modern', flexible, whiter
teeth, etc. ;)
For what I just did, simple obfuscation, this is fine
(it's quick 'n dirty, easy to read and all base64).
It's nice to see someone 'else' reading this stuff!
I've been reading the entire thread! :)
I know it's not the engagement you were looking for but it's all I can
manage at the moment. I appreciate what you're doing.
Same here, but I have been discouraged by going through the process
only to find I have outdated gear which doesn't work like modern
browsers.
Steve Carroll
2025-01-24 14:20:00 UTC
Permalink
Post by FromTheRafters
Post by Kelly Phillips
On Thu, 23 Jan 2025 23:21:38 -0000 (UTC), Steve Carroll <"Steve
Post by Steve Carroll
Post by Kelly Phillips
Post by Apd
Post by Steve Carroll
`UGxhdG8ncyBjYXZlOiBzaGFkb3cgcHVwcGV0cywgYnV0IG1ha2UgaXQgZXhpc3RlbnRpYWwu`
}
if(thing){
return atob(some[thing])
}
atob("QXJpc3RvdGxlLCBBcmlzdG90bGUgd2FzIGEgYnVnZ2VyIGZvciB0aGUgYm90dGxlLi4u")
I didn't know about that function (on the window object) and its
counterpart.
I'm sure I'm wrong because I'm not of this JS world, but I thought that
atob and its counterpart btoa were considered 'legacy', replaced by the
Buffer class.
They are dated... not being a person that uses them (you just saw what I
do with them :), I do know they're still used in the browser for certain
things, even though ArrayBuffer is more 'modern', flexible, whiter
teeth, etc. ;)
For what I just did, simple obfuscation, this is fine
(it's quick 'n dirty, easy to read and all base64).
It's nice to see someone 'else' reading this stuff!
I've been reading the entire thread! :)
I know it's not the engagement you were looking for but it's all I can
manage at the moment. I appreciate what you're doing.
Same here, but I have been discouraged by going through the process
only to find I have outdated gear which doesn't work like modern
browsers.
I think Apd is writing for FF v52. How much older are you going?! ;)
FromTheRafters
2025-01-24 15:06:02 UTC
Permalink
Post by Steve Carroll
Post by FromTheRafters
Post by Kelly Phillips
On Thu, 23 Jan 2025 23:21:38 -0000 (UTC), Steve Carroll <"Steve
Post by Steve Carroll
Post by Kelly Phillips
Post by Apd
Post by Steve Carroll
`UGxhdG8ncyBjYXZlOiBzaGFkb3cgcHVwcGV0cywgYnV0IG1ha2UgaXQgZXhpc3RlbnRpYWwu`
}
if(thing){
return atob(some[thing])
}
atob("QXJpc3RvdGxlLCBBcmlzdG90bGUgd2FzIGEgYnVnZ2VyIGZvciB0aGUgYm90dGxlLi4u")
I didn't know about that function (on the window object) and its
counterpart.
I'm sure I'm wrong because I'm not of this JS world, but I thought that
atob and its counterpart btoa were considered 'legacy', replaced by the
Buffer class.
They are dated... not being a person that uses them (you just saw what I
do with them :), I do know they're still used in the browser for certain
things, even though ArrayBuffer is more 'modern', flexible, whiter
teeth, etc. ;)
For what I just did, simple obfuscation, this is fine
(it's quick 'n dirty, easy to read and all base64).
It's nice to see someone 'else' reading this stuff!
I've been reading the entire thread! :)
I know it's not the engagement you were looking for but it's all I can
manage at the moment. I appreciate what you're doing.
Same here, but I have been discouraged by going through the process
only to find I have outdated gear which doesn't work like modern
browsers.
I think Apd is writing for FF v52. How much older are you going?! ;)
115.19.0esr (64-bit)
Steve Carroll
2025-01-24 15:37:11 UTC
Permalink
Post by FromTheRafters
Post by Steve Carroll
Post by FromTheRafters
Same here, but I have been discouraged by going through the process
only to find I have outdated gear which doesn't work like modern
browsers.
I think Apd is writing for FF v52. How much older are you going?! ;)
115.19.0esr (64-bit)
What wasn't working for you?

Apd might be interested in this (that I finally got around to testing):

<Loading Image...>

I knew it'd be fast but that was a nice surprise!
(best I got, '0.054, on a circa 2012 iMac, didn't try it on the Mini)

I'd been thinking to speed it up by pre-creating the map in a file and
using 'src=map.js' but I doubt you'd be able to tell the difference ;)


BTW, I changed 'Date.now()' to 'performance.now()'.
Apd
2025-01-24 16:25:46 UTC
Permalink
Post by Steve Carroll
Post by FromTheRafters
Post by Steve Carroll
Post by FromTheRafters
Same here, but I have been discouraged by going through the process
only to find I have outdated gear which doesn't work like modern
browsers.
I think Apd is writing for FF v52. How much older are you going?! ;)
Yes.
Post by Steve Carroll
Post by FromTheRafters
115.19.0esr (64-bit)
What wasn't working for you?
FTR shouldn't have any problems with that version.
Post by Steve Carroll
<https://i.postimg.cc/sV2zJgSs/yoda-lightspeed.gif>
I knew it'd be fast but that was a nice surprise!
(best I got, '0.054, on a circa 2012 iMac, didn't try it on the Mini)
Great setup time. Is it also finding the embedded shorter words?
Post by Steve Carroll
I'd been thinking to speed it up by pre-creating the map in a file and
using 'src=map.js' but I doubt you'd be able to tell the difference ;)
That would increase the dictionary size considerably and slow down
startup for some when loaded into a browser. I expect the jumble site
would have similar on the server.
Post by Steve Carroll
BTW, I changed 'Date.now()' to 'performance.now()'.
Another one I didn't know. Makes little to no difference here.
Steve Carroll
2025-01-24 16:51:07 UTC
Permalink
Post by Apd
Post by Steve Carroll
Post by FromTheRafters
Post by Steve Carroll
Post by FromTheRafters
Same here, but I have been discouraged by going through the process
only to find I have outdated gear which doesn't work like modern
browsers.
I think Apd is writing for FF v52. How much older are you going?! ;)
Yes.
Post by Steve Carroll
Post by FromTheRafters
115.19.0esr (64-bit)
What wasn't working for you?
FTR shouldn't have any problems with that version.
There's some hoop jumping to run it so I doubt anyone other than me has
done so. I'm not sure exactly what he's referring to, but I doubt he
plays Jumble so...

(the only person who'd actually use it has no interest, what a group ;)
Post by Apd
Post by Steve Carroll
<https://i.postimg.cc/sV2zJgSs/yoda-lightspeed.gif>
I knew it'd be fast but that was a nice surprise!
(best I got, '0.054, on a circa 2012 iMac, didn't try it on the Mini)
Great setup time. Is it also finding the embedded shorter words?
All of them, and there are a *lot* off of that word!

<Loading Image...>

Our words line up nicer than JumbleSolver!
(hey, it's a selling point ;)

(snip stuff I agree with)
FromTheRafters
2025-01-24 16:58:28 UTC
Permalink
Post by Steve Carroll
Post by Apd
Post by Steve Carroll
Post by FromTheRafters
Post by Steve Carroll
Post by FromTheRafters
Same here, but I have been discouraged by going through the process
only to find I have outdated gear which doesn't work like modern
browsers.
I think Apd is writing for FF v52. How much older are you going?! ;)
Yes.
Post by Steve Carroll
Post by FromTheRafters
115.19.0esr (64-bit)
What wasn't working for you?
FTR shouldn't have any problems with that version.
There's some hoop jumping to run it so I doubt anyone other than me has
done so. I'm not sure exactly what he's referring to, but I doubt he
plays Jumble so...
My mother used to solve them or partially solve them and get stuck. I
would often solve the riddle/pun part and work backwards.
Apd
2025-01-24 17:50:11 UTC
Permalink
Post by Steve Carroll
Post by Apd
Great setup time. Is it also finding the embedded shorter words?
All of them, and there are a *lot* off of that word!
I just noticed the "20-letters:" label on your first image. Doh!
Post by Steve Carroll
<https://i.postimg.cc/HdRsQ4cY/all-the-words.gif>
Our words line up nicer than JumbleSolver!
(hey, it's a selling point ;)
Yes, and you can plug in your own dictionary. I already made the array
a separate dict.js file.
Steve Carroll
2025-01-24 18:08:52 UTC
Permalink
Post by Apd
Post by Steve Carroll
Post by Apd
Great setup time. Is it also finding the embedded shorter words?
All of them, and there are a *lot* off of that word!
I just noticed the "20-letters:" label on your first image. Doh!
Post by Steve Carroll
<https://i.postimg.cc/HdRsQ4cY/all-the-words.gif>
Our words line up nicer than JumbleSolver!
(hey, it's a selling point ;)
Yes, and you can plug in your own dictionary.
It also works offline! And I now have a version that needs no server, it
loads via 'src', getting rid of the fetch() call. I got rid of all the
comments, logs and perf stuff, too... it's down to ~70 lines of JS. It
could be shortened with ternary but I left is as 'readable' for people
as possible (nested t's suck!). You've 'kinda, sorta' described how it
works piecemeal... maybe you'll do a full write-up ;)
Post by Apd
I already made the array
a separate dict.js file.
I'd like to create a thread describing how virtually anyone can test/use
this. You OK with a pastebin?


(I still have no idea about Jumble ;)
Apd
2025-01-24 18:59:42 UTC
Permalink
Post by Steve Carroll
Post by Apd
Post by Steve Carroll
Our words line up nicer than JumbleSolver!
(hey, it's a selling point ;)
Yes, and you can plug in your own dictionary.
It also works offline! And I now have a version that needs no server, it
loads via 'src', getting rid of the fetch() call.
That's what I used, "src", no fetch(). Initially, I thought a local
web server would be needed but it isn't.
Post by Steve Carroll
I got rid of all the comments, logs and perf stuff, too... it's down
to ~70 lines of JS.
Sounds about right. It's pretty short, anyway.
Post by Steve Carroll
It could be shortened with ternary but I left is as 'readable' for
people as possible (nested t's suck!).
No need to optimize where it ain't needed.
Post by Steve Carroll
You've 'kinda, sorta' described how it works piecemeal... maybe
you'll do a full write-up ;)
Groan!
Post by Steve Carroll
Post by Apd
I already made the array a separate dict.js file.
I'd like to create a thread describing how virtually anyone can test/use
this. You OK with a pastebin?
Of course.
Post by Steve Carroll
(I still have no idea about Jumble ;)
What, as in how it's coded? Jumble allows only two wild letters, ours
allows any number which could give too many results. Useful if you
want to list the entire dictionary!
Steve Carroll
2025-01-24 20:00:19 UTC
Permalink
Post by Apd
Post by Steve Carroll
Post by Apd
Post by Steve Carroll
Our words line up nicer than JumbleSolver!
(hey, it's a selling point ;)
Yes, and you can plug in your own dictionary.
It also works offline! And I now have a version that needs no server, it
loads via 'src', getting rid of the fetch() call.
That's what I used, "src", no fetch().
Sorry... I think I was working on a different version that I removed
that from and crossed the two in my mind.
Post by Apd
Initially, I thought a local web server would be needed but it isn't.
And because it isn't, anyone can easily run it, with a little help. But
like you said, this (and the pastebin) will be 'interest-based'.
Post by Apd
Post by Steve Carroll
I got rid of all the comments, logs and perf stuff, too... it's down
to ~70 lines of JS.
Sounds about right. It's pretty short, anyway.
True, I'll leave it as it was in your post (minus the 'dict' var).

I'll include the HTML and CSS in the pastebin, then all that's needed is
a post that explains how to create a dictionary (elsewhere, I asked
about an 'awk' command that Mac and Linux users might run to see if they
have one locally). Then just pop that into a folder along with the
pastebin and you're good to go.
Post by Apd
Post by Steve Carroll
It could be shortened with ternary but I left is as 'readable' for
people as possible (nested t's suck!).
No need to optimize where it ain't needed.
Post by Steve Carroll
You've 'kinda, sorta' described how it works piecemeal... maybe
you'll do a full write-up ;)
Groan!
There'll be the feeling of 'good will' ;)
Post by Apd
Post by Steve Carroll
Post by Apd
I already made the array a separate dict.js file.
I'd like to create a thread describing how virtually anyone can test/use
this. You OK with a pastebin?
Of course.
Post by Steve Carroll
(I still have no idea about Jumble ;)
What, as in how it's coded?
No, about how to play it.
Post by Apd
Jumble allows only two wild letters, ours allows any number which
could give too many results. Useful if you want to list the entire
dictionary!
"Hmmm..."


P.S. I found 'that thing' I mentioned earlier:

str = `I'm baby mukbang JOMO biodiesel brunch Brooklyn, 90's fit umami echo park pinterest. Disrupt blue bottle retro echo park listicle cray, jean shorts whatever craft beer small batch hammock pinterest. Big mood ethical tofu subway tile echo park pinterest, intelligentsia trust fund same taiyaki single-origin coffee XOXO glossier? Gochujang microdosing glossier mlkshk, woke neutra ramps tofu single-origin coffee tilde. Leggings ugh gastropub freegan cray selvage taxidermy bespoke, affogato occupy lumbersexual woke gentrify. You probably haven't heard of them VHS shoreditch, chicharrones vaporware yes plz photo booth!`

x = str.split('([\.| \? | !])').filter(Boolean)

x.forEach(i => console.log(i))

That 'unregex' actually works! At least, in my version of Chrome. It was
a goofy accident, I have no idea *why* it works ;)
Apd
2025-01-24 23:18:25 UTC
Permalink
Post by Steve Carroll
Post by Apd
Post by Steve Carroll
(I still have no idea about Jumble ;)
What, as in how it's coded?
No, about how to play it.
Right. I've played a couple of times.
Post by Steve Carroll
str = `I'm baby mukbang JOMO biodiesel brunch Brooklyn, 90's fit umami
echo park pinterest. Disrupt blue bottle retro echo park listicle cray,
[...]
Post by Steve Carroll
x = str.split('([\.| \? | !])').filter(Boolean)
x.forEach(i => console.log(i))
That 'unregex' actually works! At least, in my version of Chrome. It was
a goofy accident, I have no idea *why* it works ;)
Not in FF here but I found one that does. I'll post to other thread.
David
2025-01-24 16:12:08 UTC
Permalink
Post by FromTheRafters
Post by Steve Carroll
Post by FromTheRafters
Post by Kelly Phillips
On Thu, 23 Jan 2025 23:21:38 -0000 (UTC), Steve Carroll <"Steve
Post by Steve Carroll
Post by Kelly Phillips
Post by Apd
Post by Steve Carroll
`UGxhdG8ncyBjYXZlOiBzaGFkb3cgcHVwcGV0cywgYnV0IG1ha2UgaXQgZXhpc3RlbnRpYWwu`
 }
 if(thing){
     return atob(some[thing])
 }
atob("QXJpc3RvdGxlLCBBcmlzdG90bGUgd2FzIGEgYnVnZ2VyIGZvciB0aGUgYm90dGxlLi4u")
I didn't know about that function (on the window object) and its
counterpart.
I'm sure I'm wrong because I'm not of this JS world, but I thought that
atob and its counterpart btoa were considered 'legacy', replaced by the
Buffer class.
They are dated... not being a person that uses them (you just saw what I
do with them :), I do know they're still used in the browser for certain
things, even though ArrayBuffer is more 'modern', flexible, whiter
teeth, etc. ;)
For what I just did, simple obfuscation, this is fine (it's quick
'n dirty, easy to read and all base64).
It's nice to see someone 'else' reading this stuff!
I've been reading the entire thread! :)
I know it's not the engagement you were looking for but it's all I can
manage at the moment. I appreciate what you're doing.
Same here, but I have been discouraged by going through the process
only to find I have outdated gear which doesn't work like modern
browsers.
I think Apd is writing for FF v52. How much older are you going?! ;)
115.19.0esr (64-bit)
David is using FF 134.0.2 (64-bit)
--
Why use 'old stuff'?
Makes no sense to me!
Steve Carroll
2025-01-24 14:17:24 UTC
Permalink
Post by Kelly Phillips
On Thu, 23 Jan 2025 23:21:38 -0000 (UTC), Steve Carroll <"Steve
Post by Steve Carroll
Post by Kelly Phillips
Post by Apd
Post by Steve Carroll
`UGxhdG8ncyBjYXZlOiBzaGFkb3cgcHVwcGV0cywgYnV0IG1ha2UgaXQgZXhpc3RlbnRpYWwu`
}
if(thing){
return atob(some[thing])
}
atob("QXJpc3RvdGxlLCBBcmlzdG90bGUgd2FzIGEgYnVnZ2VyIGZvciB0aGUgYm90dGxlLi4u")
I didn't know about that function (on the window object) and its
counterpart.
I'm sure I'm wrong because I'm not of this JS world, but I thought that
atob and its counterpart btoa were considered 'legacy', replaced by the
Buffer class.
They are dated... not being a person that uses them (you just saw what I
do with them :), I do know they're still used in the browser for certain
things, even though ArrayBuffer is more 'modern', flexible, whiter
teeth, etc. ;)
For what I just did, simple obfuscation, this is fine
(it's quick 'n dirty, easy to read and all base64).
It's nice to see someone 'else' reading this stuff!
I've been reading the entire thread! :)
I know it's not the engagement you were looking for but it's all I can
manage at the moment. I appreciate what you're doing.
At the least it's something 'else' to talk about ;) Some of 'the basics'
of JS (if/else if/else, function construction, variables, data types,
many of the operators) are fairly easy to learn and, conceptually,
they're not all that different than Python (another 'famous scripting
languages'). In any language that has objects and methods, there are
things that get confusing, but not all of them are.
Apd
2025-01-23 23:28:20 UTC
Permalink
Post by Kelly Phillips
Post by Apd
atob("QXJpc3RvdGxlLCBBcmlzdG90bGUgd2FzIGEgYnVnZ2VyIGZvciB0aGUgYm90dGxlLi4u")
I didn't know about that function (on the window object) and its
counterpart.
I'm sure I'm wrong because I'm not of this JS world, but I thought that
atob and its counterpart btoa were considered 'legacy', replaced by the
Buffer class.
That's for node.js which you've likely seen in the server environment.
In browsers it's valid but MDM sugests other ways in cases where it
fails. New routines toBase64() and fromBase64() have been added to the
methods available on the Uint8Array object.
Kelly Phillips
2025-01-24 00:15:05 UTC
Permalink
Post by Apd
Post by Kelly Phillips
Post by Apd
atob("QXJpc3RvdGxlLCBBcmlzdG90bGUgd2FzIGEgYnVnZ2VyIGZvciB0aGUgYm90dGxlLi4u")
I didn't know about that function (on the window object) and its
counterpart.
I'm sure I'm wrong because I'm not of this JS world, but I thought that
atob and its counterpart btoa were considered 'legacy', replaced by the
Buffer class.
That's for node.js which you've likely seen in the server environment.
In browsers it's valid but MDM sugests other ways in cases where it
fails. New routines toBase64() and fromBase64() have been added to the
methods available on the Uint8Array object.
So many ways to skin a cat...
Brock McNuggets
2025-01-24 01:49:48 UTC
Permalink
Post by Kelly Phillips
Post by Apd
Post by Kelly Phillips
Post by Apd
atob("QXJpc3RvdGxlLCBBcmlzdG90bGUgd2FzIGEgYnVnZ2VyIGZvciB0aGUgYm90dGxlLi4u")
I didn't know about that function (on the window object) and its
counterpart.
I'm sure I'm wrong because I'm not of this JS world, but I thought that
atob and its counterpart btoa were considered 'legacy', replaced by the
Buffer class.
That's for node.js which you've likely seen in the server environment.
In browsers it's valid but MDM sugests other ways in cases where it
fails. New routines toBase64() and fromBase64() have been added to the
methods available on the Uint8Array object.
So many ways to skin a cat...
My favorite is Krazy Glue and a toothbrush.

(extra credit for anyone who knows where I got that)
--
Specialist in unnecessary details and overcomplicated solutions.
%
2025-01-24 02:30:15 UTC
Permalink
Post by Brock McNuggets
Post by Kelly Phillips
Post by Apd
Post by Kelly Phillips
Post by Apd
atob("QXJpc3RvdGxlLCBBcmlzdG90bGUgd2FzIGEgYnVnZ2VyIGZvciB0aGUgYm90dGxlLi4u")
I didn't know about that function (on the window object) and its
counterpart.
I'm sure I'm wrong because I'm not of this JS world, but I thought that
atob and its counterpart btoa were considered 'legacy', replaced by the
Buffer class.
That's for node.js which you've likely seen in the server environment.
In browsers it's valid but MDM sugests other ways in cases where it
fails. New routines toBase64() and fromBase64() have been added to the
methods available on the Uint8Array object.
So many ways to skin a cat...
My favorite is Krazy Glue and a toothbrush.
(extra credit for anyone who knows where I got that)
snit used to say it
Brock McNuggets
2025-01-24 16:13:25 UTC
Permalink
Post by %
Post by Brock McNuggets
Post by Kelly Phillips
Post by Apd
Post by Kelly Phillips
Post by Apd
atob("QXJpc3RvdGxlLCBBcmlzdG90bGUgd2FzIGEgYnVnZ2VyIGZvciB0aGUgYm90dGxlLi4u")
I didn't know about that function (on the window object) and its
counterpart.
I'm sure I'm wrong because I'm not of this JS world, but I thought that
atob and its counterpart btoa were considered 'legacy', replaced by the
Buffer class.
That's for node.js which you've likely seen in the server environment.
In browsers it's valid but MDM sugests other ways in cases where it
fails. New routines toBase64() and fromBase64() have been added to the
methods available on the Uint8Array object.
So many ways to skin a cat...
My favorite is Krazy Glue and a toothbrush.
(extra credit for anyone who knows where I got that)
snit used to say it
Forget that guy!
--
Specialist in unnecessary details and overcomplicated solutions.
FromTheRafters
2025-01-24 12:18:10 UTC
Permalink
Post by Apd
Post by Steve Carroll
`UGxhdG8ncyBjYXZlOiBzaGFkb3cgcHVwcGV0cywgYnV0IG1ha2UgaXQgZXhpc3RlbnRpYWwu`
}
if(thing){
return atob(some[thing])
}
atob("QXJpc3RvdGxlLCBBcmlzdG90bGUgd2FzIGEgYnVnZ2VyIGZvciB0aGUgYm90dGxlLi4u")
I didn't know about that function (on the window object) and its
counterpart.
Neither did I, but I recognized the b64 and have a converter utility.
Steve Carroll
2025-01-23 14:07:44 UTC
Permalink
Post by David
Post by Apd
<https://newsgrouper.org.uk/tops>
Thanks.
I've never been able to figure out how to locate this information myself.
Ray Banana has a listing too!
See: https://www.eternal-september.org/hierarchies.php?language=en
<https://www.eternal-september.org/postingstats.php>
ACW is not too far from the top.
Thanks - I do believe you showed that once before.
You have much knowledge about a wide range of things. Please share
things /other/ than writing code.
```javascript
// Function to share knowledge on various topics other than coding
function shareKnowledge(topic) {
const knowledgeBase = {
history: "The Great Wall of China was built over several
dynasties to protect against invasions.",
science: "Did you know that water expands when it freezes?
That's why ice floats on water.",
art: "The Mona Lisa is one of the most famous paintings in the
world, created by Leonardo da Vinci.",
music: "The Beatles revolutionized pop music in the 1960s with
their innovative albums.",
philosophy: "Plato's allegory of the cave explores the concept
of perception versus reality."
};
return knowledgeBase[topic.toLowerCase()] ||
"I can share knowledge on history, science, art, music, and
philosophy!";
}
// Example usage
console.log(shareKnowledge("science"));
console.log(shareKnowledge("music"));
console.log(shareKnowledge("unknown"));
```
BTW, have you tried copying and pasting what you wrote into dev tools?

After you figure out the issue, you can omit the console.log() as you're
already in the console, so you can just do this to run it:

shareKnowledge("science")

On modern browsers you'll probably see the reults before you hit return.
David
2025-01-23 14:33:09 UTC
Permalink
Post by Steve Carroll
Post by David
Post by Apd
<https://newsgrouper.org.uk/tops>
Thanks.
I've never been able to figure out how to locate this information myself.
Ray Banana has a listing too!
See: https://www.eternal-september.org/hierarchies.php?language=en
<https://www.eternal-september.org/postingstats.php>
ACW is not too far from the top.
Thanks - I do believe you showed that once before.
You have much knowledge about a wide range of things. Please share
things /other/ than writing code.
```javascript
// Function to share knowledge on various topics other than coding
function shareKnowledge(topic) {
const knowledgeBase = {
history: "The Great Wall of China was built over several
dynasties to protect against invasions.",
science: "Did you know that water expands when it freezes?
That's why ice floats on water.",
art: "The Mona Lisa is one of the most famous paintings in the
world, created by Leonardo da Vinci.",
music: "The Beatles revolutionized pop music in the 1960s with
their innovative albums.",
philosophy: "Plato's allegory of the cave explores the concept
of perception versus reality."
};
return knowledgeBase[topic.toLowerCase()] ||
"I can share knowledge on history, science, art, music, and
philosophy!";
}
// Example usage
console.log(shareKnowledge("science"));
console.log(shareKnowledge("music"));
console.log(shareKnowledge("unknown"));
```
BTW, have you tried copying and pasting what you wrote into dev tools?
After you figure out the issue, you can omit the console.log() as you're
shareKnowledge("science")
On modern browsers you'll probably see the reults before you hit return.
No, I've not done that.

www.ChatGPT.com appears off-line here right now. :-(
Steve Carroll
2025-01-23 15:04:51 UTC
Permalink
Post by David
Post by Steve Carroll
Post by David
Post by Apd
<https://newsgrouper.org.uk/tops>
Thanks.
I've never been able to figure out how to locate this information myself.
Ray Banana has a listing too!
See: https://www.eternal-september.org/hierarchies.php?language=en
<https://www.eternal-september.org/postingstats.php>
ACW is not too far from the top.
Thanks - I do believe you showed that once before.
You have much knowledge about a wide range of things. Please share
things /other/ than writing code.
```javascript
// Function to share knowledge on various topics other than coding
function shareKnowledge(topic) {
const knowledgeBase = {
history: "The Great Wall of China was built over several
dynasties to protect against invasions.",
science: "Did you know that water expands when it freezes?
That's why ice floats on water.",
art: "The Mona Lisa is one of the most famous paintings in the
world, created by Leonardo da Vinci.",
music: "The Beatles revolutionized pop music in the 1960s with
their innovative albums.",
philosophy: "Plato's allegory of the cave explores the concept
of perception versus reality."
};
return knowledgeBase[topic.toLowerCase()] ||
"I can share knowledge on history, science, art, music, and
philosophy!";
}
// Example usage
console.log(shareKnowledge("science"));
console.log(shareKnowledge("music"));
console.log(shareKnowledge("unknown"));
```
BTW, have you tried copying and pasting what you wrote into dev tools?
After you figure out the issue, you can omit the console.log() as you're
shareKnowledge("science")
On modern browsers you'll probably see the reults before you hit return.
No, I've not done that.
www.ChatGPT.com appears off-line here right now. :-(
It was here, too... but it's back now.

FYI, that toLowerCase() doesn't work there with the || operator. The
dunce code I gave you provides a way (but I left out lc) that you should
be able to understand. Did you see Apd's suggestion of multiple
statements on a given topic? You should work with him on it... good for
an aging brain ;)
Brock McNuggets
2025-01-23 15:50:26 UTC
Permalink
Post by David
Post by Steve Carroll
Post by David
Post by Apd
<https://newsgrouper.org.uk/tops>
Thanks.
I've never been able to figure out how to locate this information myself.
Ray Banana has a listing too!
See: https://www.eternal-september.org/hierarchies.php?language=en
<https://www.eternal-september.org/postingstats.php>
ACW is not too far from the top.
Thanks - I do believe you showed that once before.
You have much knowledge about a wide range of things. Please share
things /other/ than writing code.
```javascript
// Function to share knowledge on various topics other than coding
function shareKnowledge(topic) {
const knowledgeBase = {
history: "The Great Wall of China was built over several
dynasties to protect against invasions.",
science: "Did you know that water expands when it freezes?
That's why ice floats on water.",
art: "The Mona Lisa is one of the most famous paintings in the
world, created by Leonardo da Vinci.",
music: "The Beatles revolutionized pop music in the 1960s with
their innovative albums.",
philosophy: "Plato's allegory of the cave explores the concept
of perception versus reality."
};
return knowledgeBase[topic.toLowerCase()] ||
"I can share knowledge on history, science, art, music, and
philosophy!";
}
// Example usage
console.log(shareKnowledge("science"));
console.log(shareKnowledge("music"));
console.log(shareKnowledge("unknown"));
```
BTW, have you tried copying and pasting what you wrote into dev tools?
After you figure out the issue, you can omit the console.log() as you're
shareKnowledge("science")
On modern browsers you'll probably see the reults before you hit return.
No, I've not done that.
www.ChatGPT.com appears off-line here right now. :-(
Working for me, but I had some oddities yesterday.
--
Specialist in unnecessary details and overcomplicated solutions.
%
2025-01-23 20:48:09 UTC
Permalink
Post by Brock McNuggets
Post by David
Post by Steve Carroll
Post by David
Post by Apd
<https://newsgrouper.org.uk/tops>
Thanks.
I've never been able to figure out how to locate this information myself.
Ray Banana has a listing too!
See: https://www.eternal-september.org/hierarchies.php?language=en
<https://www.eternal-september.org/postingstats.php>
ACW is not too far from the top.
Thanks - I do believe you showed that once before.
You have much knowledge about a wide range of things. Please share
things /other/ than writing code.
```javascript
// Function to share knowledge on various topics other than coding
function shareKnowledge(topic) {
const knowledgeBase = {
history: "The Great Wall of China was built over several
dynasties to protect against invasions.",
science: "Did you know that water expands when it freezes?
That's why ice floats on water.",
art: "The Mona Lisa is one of the most famous paintings in the
world, created by Leonardo da Vinci.",
music: "The Beatles revolutionized pop music in the 1960s with
their innovative albums.",
philosophy: "Plato's allegory of the cave explores the concept
of perception versus reality."
};
return knowledgeBase[topic.toLowerCase()] ||
"I can share knowledge on history, science, art, music, and
philosophy!";
}
// Example usage
console.log(shareKnowledge("science"));
console.log(shareKnowledge("music"));
console.log(shareKnowledge("unknown"));
```
BTW, have you tried copying and pasting what you wrote into dev tools?
After you figure out the issue, you can omit the console.log() as you're
shareKnowledge("science")
On modern browsers you'll probably see the reults before you hit return.
No, I've not done that.
www.ChatGPT.com appears off-line here right now. :-(
Working for me, but I had some oddities yesterday.
do usenet marg , wait better just make it marg
Steve Carroll
2025-01-23 16:03:12 UTC
Permalink
Post by Steve Carroll
Post by David
Post by Apd
<https://newsgrouper.org.uk/tops>
Thanks.
I've never been able to figure out how to locate this information myself.
Ray Banana has a listing too!
See: https://www.eternal-september.org/hierarchies.php?language=en
<https://www.eternal-september.org/postingstats.php>
ACW is not too far from the top.
Thanks - I do believe you showed that once before.
You have much knowledge about a wide range of things. Please share
things /other/ than writing code.
```javascript
// Function to share knowledge on various topics other than coding
function shareKnowledge(topic) {
const knowledgeBase = {
history: "The Great Wall of China was built over several
dynasties to protect against invasions.",
science: "Did you know that water expands when it freezes?
That's why ice floats on water.",
art: "The Mona Lisa is one of the most famous paintings in the
world, created by Leonardo da Vinci.",
music: "The Beatles revolutionized pop music in the 1960s with
their innovative albums.",
philosophy: "Plato's allegory of the cave explores the concept
of perception versus reality."
};
return knowledgeBase[topic.toLowerCase()] ||
"I can share knowledge on history, science, art, music, and
philosophy!";
}
// Example usage
console.log(shareKnowledge("science"));
console.log(shareKnowledge("music"));
console.log(shareKnowledge("unknown"));
```
BTW, have you tried copying and pasting what you wrote into dev tools?
After you figure out the issue, you can omit the console.log() as you're
shareKnowledge("science")
On modern browsers you'll probably see the reults before you hit return.
For those who need constant entertainment (because code isn't 'enough'):

<Loading Image...>
pothead
2025-01-23 01:03:18 UTC
Permalink
Post by Steve Carroll
It's what we make it. Seeing that it's high on the list of busy groups
??? You're kidding! Usenet must be worse off than I thought ;)
<https://newsgrouper.org.uk/tops>
Thanks.
I've never been able to figure out how to locate this information myself.
Ray Banana has a listing too!
See: https://www.eternal-september.org/hierarchies.php?language=en
HTH
Thank you !
I had no idea.
--
pothead

"Give a man a fish and you turn him into a Democrat for life"
"Teach a man to fish and he might become a self-sufficient conservative Republican"
"Don't underestimate Joe's ability to fuck things up,"
--- Barack H. Obama
The Biden Crime Family Timeline here:
https://oversight.house.gov/the-bidens-influence-peddling-timeline/
David
2025-01-23 08:08:53 UTC
Permalink
Post by pothead
Post by Steve Carroll
It's what we make it. Seeing that it's high on the list of busy groups
??? You're kidding! Usenet must be worse off than I thought ;)
<https://newsgrouper.org.uk/tops>
Thanks.
I've never been able to figure out how to locate this information myself.
Ray Banana has a listing too!
See: https://www.eternal-september.org/hierarchies.php?language=en
HTH
Thank you !
I had no idea.
You are welcome. :-D
Loading...