How Could I Randomize A Dictionary?

Page 3 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

Red Squirrel

No Lifer
May 24, 2003
66,435
11,599
126
I was thinking I could pay someone $50 per letter in the alphabet to attach a number to every word and definition so I could just randomize the numbers and thus randomizing the dictionary.

Did you actually look at my code? That's basically what the genwordlist.cpp program does. You owe me $1,300. :p
 

Gizmo j

Senior member
Nov 9, 2013
844
229
116
I was also thinking about printing the random dictionary and have each dictionary have different order of random words and sell them.

What I mean is every dictionary will have a different pattern of words and definitions.
 
Jul 27, 2020
13,327
7,917
106
I was also thinking about printing the random dictionary and have each dictionary have different order of random words and sell them.
Wanna get sued into bankruptcy?

Why do you even think there's a market for dictionaries now? Everyone just uses Google.
 

Red Squirrel

No Lifer
May 24, 2003
66,435
11,599
126
Modify my app to generate commands for a ESC/POS printer in an infinite loop, and print to your heart's desire. Hack Walmart and have all the reciept printers just output random words. It will take a while for anyone to notice because nobody is ever at the cashes anyway. :p
 

lxskllr

No Lifer
Nov 30, 2004
57,055
7,085
126
bookshelf_sorting.png
 

nakedfrog

No Lifer
Apr 3, 2001
57,421
11,286
126
I was also thinking about printing the random dictionary and have each dictionary have different order of random words and sell them.

What I mean is every dictionary will have a different pattern of words and definitions.
Who exactly would you be selling these to? Who wants this besides you?
 
  • Like
Reactions: igor_kavinski
Jul 27, 2020
13,327
7,917
106
Who exactly would you be selling these to? Who wants this besides you?
Probably third world shopkeepers.

"Look, a random dictionary for the so-bored-they-wanna-kill-themselves-buyers! Just try finding the meaning of a word in this dictionary and see time fly!"
 
  • Haha
Reactions: nakedfrog

Gizmo j

Senior member
Nov 9, 2013
844
229
116
How about, instead of attaching a new number to each word and definitions like this:

1
2
3

I attach the words and definitions with only a "1" like this:

1
1
1

Could I randomize the words by just attaching the number 1 in front of it? Or does it have to be more then a single letter?
 

WelshBloke

Lifer
Jan 12, 2005
30,045
7,525
136
I was thinking I could pay someone $50 per letter in the alphabet to attach a number to every word and definition so I could just randomize the numbers and thus randomizing the dictionary.
Why though?

This is the first thread in ages I've been utterly baffled by.
Why would you want to remove the only point and purpose to a dictionary?

If you just want to come across random words and definitions you can just flip to a page at random, which you'd have to do with a random dictionary anyway unless you were going to read it like a novel!
 

Red Squirrel

No Lifer
May 24, 2003
66,435
11,599
126
Did you actually look at my program? It would be trivial to modify it to do what you want. The basis is there. You're lucky I was super bored that day. :p If you want the definitions too you may need to find a different word file that has them but otherwise it would not be too hard.
 

Gizmo j

Senior member
Nov 9, 2013
844
229
116
Did you actually look at my program? It would be trivial to modify it to do what you want. The basis is there. You're lucky I was super bored that day. :p If you want the definitions too you may need to find a different word file that has them but otherwise it would not be too hard.

I don't actually understand programming, I've been trying to learn c++ because it's the language most video games use, but it hasn't stuck with me yet.
 
Jul 27, 2020
13,327
7,917
106
I've been trying to learn c++
How? By watching Youtube videos?

It's a lot easier to start with C.

Your program would be done in about a month, including learning how to C.

You go down the C++ path, a month later, you will still be learning and breaking stuff. Actual real life stuff. In your room.
 

Red Squirrel

No Lifer
May 24, 2003
66,435
11,599
126
The best way to learn is to have a project goal, then start on it, and google stuff as you need. I went through a 40 hour python training course at work, but honestly if I have to write a python program from scratch I'd have to google stuff because I don't remember every single thing from the course.

I tend to learn better by doing something. I didn't do super great in school, but anything hands on, I aced.
 

MrSquished

Lifer
Jan 14, 2013
19,887
18,337
136
The best way to learn is to have a project goal, then start on it, and google stuff as you need. I went through a 40 hour python training course at work, but honestly if I have to write a python program from scratch I'd have to google stuff because I don't remember every single thing from the course.

I tend to learn better by doing something. I didn't do super great in school, but anything hands on, I aced.
Maybe hands-on, well except clearing land, and installing stoves, and other things, but you definitely didn't ace many things that were brain-on.
 
Jul 27, 2020
13,327
7,917
106
Here's a quick taste of programming for OP:


Click after the brace { and press Enter.

Type printf("hello");

Run it with the button at the top.

1701229286579.png

See? It says hello.

Now type this:

for(int i=0;i<10;i++)
printf("hello");

1701229416233.png

It printed hello 10 times coz you told it to start with variable i from zero to less than (the < symbol) 10.

Put a \n after hello.

for(int i=0;i<10;i++)
printf("hello\n");

1701229566625.png

It will print each hello on its own line.

Now this:

for(int i=0;i<10;i++)
printf("hello %d\n",i);

1701229678424.png

Observe how the output changes by introducing new things to the existing code. Experiment and learn. It can be fun as you start to figure out what you need to type to get exactly the output you desire. Once you have that lightbulb moment and predict what your code will do to the output, that's when you know that the computer will do whatever you tell it to, as long as it's described as valid code. It takes a lot of thinking and reading to figure out what you should type to get the results you want. But it's all worth it in the end. It's never time wasted. Even if you never write a fantastic program in your life, you can look at something like Windows or an app on your phone and realize, hey, that's just a bunch of code someone wrote! Nothing magical about it at all (but the hardware and the physics of the bits and bytes IS magic. You don't wanna get into that. Trust me :p)
 
  • Like
Reactions: lxskllr

lxskllr

No Lifer
Nov 30, 2004
57,055
7,085
126
That's a good idea from igor. Pick something you want to do, then pick a small part of that, and make it work. Keep iterating off of that to get your program closer to your final vision.
 

Red Squirrel

No Lifer
May 24, 2003
66,435
11,599
126
Yeah the key is to break it down into smaller components. Figure out what steps are needed, then focus on one at a time. Ideally each step should work stand alone with test data that you can feed it.

A real world example I'm working on right now is automating Letsencrypt wildcard cert renewal using acme.sh which is an alternative to Certbot. There is not much info online on how to do this as they all assume you're using a 3rd party DNS provider and tell you to use an API or tell you to use Certbot. The documentation says that it must be manually done and can't be automated. Challenge accepted.

So I broke it down in steps.

1: Get the validation key from Let's Encrypt using acme.sh

2: Put that key in a TXT DNS record

3: Run the 2nd part of the validation process, where Letsencrypt looks for that key in my DNS record and validates, and then generates the cert.

#1 can be broken down in further steps. 1A: Run the appropriate acme.sh command. The key ends up in the log file in addition to being displayed on screen. Normally you're suppose to just manually copy and paste it and update DNS manually. Once I have that log file, #1B is to extract it which involves parsing it out from the log file. I made this a separate script so it's easier to work out of and can call it stand alone, easier to test that way too. Let's Encrypt or acme.sh is not even involved in this step throughout code/testing phase.

#2 then involves setting up DNS to be dynamic which was a separate step I only had to do once. I then wrote a script so I can update the record using a single line. The way that script work is irrelevant to everything else going on, as long as it works stand alone.

#3 involves running the 2nd part of the validation process, which is just an acme.sh command again.


So once I put it all together, the auto renew script runs the acme.sh command to get the validation key, runs the script I made to extract the key from the log, runs the DNS updater script and passes the key to the script, then runs the 2nd part of validation process.
 

nakedfrog

No Lifer
Apr 3, 2001
57,421
11,286
126
Don't start with C++ just because that's what a lot of games are written in. Start with something that's friendly for beginners, write a beginner project while you're working on understanding the concepts of programming. Don't just watch a YouTube video, write code, and figure out why it isn't doing what you want it to do.