Friday, September 25, 2020

Internet Quote of the Day:

"I Fucking Hate My Fucking Life!"

Friday, September 4, 2020

Internet Quote of the day:

"Hope is what I need the most right now. I am tired of living in a proto cyberpunk dystopian near future."

Saturday, August 8, 2020

D&D 5E Interesting discussion about Bounded Accuracy

 One of the design philosophies I like the most about D&D 5E is the idea of Bounded Accuracy. The basic idea is, player characters (PC), non-player characters (NPC) and monsters all fall into a limited range of characteristics. The highest bonus that can be obtained for PC's and NPC's is +5 for attribute scores, this can be higher, but this is and should be rather rare. Monsters can go up to +10, again in theory, they can go higher, but this would be rare. Further, the highest bonus a PC or NPC can get from experience and skill is +6. Additionally, magic bonus's are now limited to +3. In practical terms, this means there is soft limit of +11 and a hard limit of +15 for PC's in game. The video linked below has a very nice discussion about Bounded Accuracy and the affects of rolling with advantage and disadvantage.

To make things easy, I have provided the tables he talks bout below. and can be downloaded here; https://imgur.com/gallery/Y1RA9yq


Tuesday, August 4, 2020

Review: Too Much and Never Enough: How My Family Created the World's Most Dangerous Man by Mary L. Trump

Too Much and Never Enough: How My Family Created the World's Most Dangerous ManToo Much and Never Enough: How My Family Created the World's Most Dangerous Man by Mary L. Trump
My rating: 3 of 5 stars

This book was somewhat disappointing. Anyone expecting a tell all expose' about the deep dark secrets of the Trump family are not going to get what they want. Most of what is written in the book was already publicly known. Certainly she added some insider insight to the events, but I don't think there was much here we did not already know. It seems to me, the lawsuit filed against this books publication was a waste of time, if anyone in the Trump family had actually read the book prior to publication, I am sure they would have done what I did, which was respond with a shoulder shrug and Well Okay then.

From a writing perspective, Mary Trump is a pretty good writer, she is use to writing academic works rather than works of entertainment and that does show through, however she does manage to capture the moments moods and her own emotional state as the book proceeds. She is also very clever in how she presented some of the information within the book. She is a clinical psychologist, she is very aware of the the various psychological maladies that inflict her family, but is very good at actually very good at avoiding actually providing a profession diagnosis to any any of them. For instance, when talking about Donald Trump himself, she asks the question "Is Donald a narcissist?" and answers the question with "I don't know, but he does exhibit the all 9 characteristics associated with Narcissistic Personalty Disorder.". This was a great dodge.

Overall, the writing is good and does provide some insight into the Trump family, although the first half of the book focus's more on her father than the rest of the family. If you are expecting any huge revelations about Donald Trump, that is just not going to happen.

View all my reviews

Friday, July 31, 2020

How to kill Tiamat in 48 minutes

Tonight I ran a one off D&D game for some friends. They took on Tiamat and destroyed her pretty decisively in less than 2 combat rounds. They each constructed two 20th Level characters, with a small pile of magic items each. The video is 48 minutes, if you want to see how D&D is being played in this modern age, check it out.



Friday, July 24, 2020

Simple Encryption with MMBasic

The program presented here is a very simple encryption program, one I have written several times over the years to relearn Basic. This program takes advantage of two built in functions, RND and XOR.

RND is a pseudo random number generator, I say pseudo because it is not a true random number generator. The function needs to be seeded with a number, which it then uses to generate other numbers. If you seed the function with the same number, it will generate the same numbers. To make this appear more random, Basic programmers often seed the function with the Timer function, which seeds RND with the number of seconds past midnight. In this program, I take the password entered, convert each letter to its ASCII number and add them all together and then seed the RND function with this number. The result of this is, each time you enter the same password, the RND function will use the same set of numbers to encrypt or decrypt the message.

XOR is a simple formula that always produces the same 3 numbers. For instance, 1 XOR 2 = 3, 2 XOR 3 = 1, 3 XOR 1 = 2. In this program, I am generating a number using the RND function, then I am taking the letters from the file I want to encrypt, one at a time and converting it to its ASCII number. I am then XOR'ing the two numbers, converting that number into text and writing it to a file. For instance say the RND function generates 35 and the letter from my file a small case "a". The ASCII values of small case "a" is 97. 35 XOR 97 = 33, I then convert 33 to its ASCII text equivalent, which is "!" and I write that to the encrypted file. Re-running the program, this time using the encrypted file as the file you want to encrypt, the process reverses itself. The RND function will produce the same number, 35, and it will read the "!", convert it to its ASCII value of 33, then XOR the two numbers (35 XOR 33 = 97), to produce 97 and convert this number to its ASCII text value of small case "a" and writes that to the decrypted file.



' encrypt.bas
' Uses the RND and XOR functions to encrypt text files
Input "Password: ", Password$
Print

For Count = 1 To Len(Password$)
  MyNumber = MyNumber + Asc(Left$(Password$,Count))
Next

Randomize MyNumber
Input "Enter File to be encrypted: ", FileName$
Print
Open FileName$ For Input As #1
Input "Enter the name to save the encryted file as: ", EncryptedFile$
Print
Open EncryptedFile$ For OutPut As #2
Print "Encrypting the file, please wait..."
Print
 
For Count = 1 To Lof(#1)
  Print ".";
  RealPassword = Int(Rnd * 126) + 1
  Temp$ = Input$(1,#1)
  Encrypt = RealPassword Xor Asc(Temp$)
  If Encrypt < 1 Then Encrypt = Encrypt + 126
  If Encrypt > 126 Then Encrypt = Encrypt - 126
  Encrypt$ = Chr$(Encrypt)
  Print #2, Encrypt$;
Next Count

Close #1
Close #2
Print "Done"
Print
End

Okay, let me make this very clear, this is not a strong encryption by any means, in fact by today's standards, it is barely encryption at all. A low level NSA mook could break this on his coffee break, and even a scrub hacker could break this in an hour using his grandma's computer. The only person this will protect you from is your 12 year old sister, and I would not even bet on that.

The point of this program is simply to teach the basics of encryption, using functions readily available in the Basic programming language. The security can be increased by building your own equivalent functions to RND and XOR using more mathematically complex and security sound formulas. You could also use the RND function to find a location within a key file, say a jpeg image, and use the bit at that location to XOR with the letters needing encrypting and save the file as a binary file rather than a text file. The point of course is, this is just a starting point.

_______________________________________________________________
Edit:
The reason this is not considered secure encryption is because the possible combination of numbers is low by the standards of modern computing. We have three numbers, the psuedo random number generated by RND, the ASCII number of the letter to be encrypted and the ASCII number of the encrypted letter. In theory, this gives us 126x126x126=2,000,376 possible combinations, this is a pretty big number, but not a huge number when you consider that an old 1.8Ghz desktop computer can execute 1,800,000,000 computations per second, that means it takes about .001 seconds to go through all of them for a single letter, that is not much. Now, the reality is, we already know 1 of the three numbers, the encrypted letter, so all we have to do is find the other two, now we are only looking at 128x128=15,876 combinations, now we are talking .000009 seconds for each letter. So the file you are trying to protect would have to be gargantuan to take any significant amount of time to break.

Tuesday, July 21, 2020

Colour Maximite Thoughts

Recently at the Backshed forums, which is the primary community for the Maximite system, a user suggested a database library which could then be used to develop database applications. There was a minor discussion about it, but ultimately there was simply not enough interest in the project and the original poster ended the discussion with some snark, saying

"It doesn't look like very many people see a need for it and are interested in using it. I certainly am not going to bother writing it if nobody wants or needs it. No matter, the CMM2 will do a great job of teaching youngsters how to fire bazookas at boogymen and androids."

While I cannot fault him for the statement,  I think the real problem is the OP's fundamental misunderstanding of what the Colour Maximite series of machines are really being used for. The Maximite is not a desktop computer, it is not the type of machine you use to surf the web, check your email and create documents. Even the newest version is based on a 400Mhz ARM processor and has only a few megabytes of RAM. On top of that, MMBasic is not a true operating system, it is a programing language that serves some of the functions of an operating system.

What the Maximite is, is a development platform that falls somewhere between an Arduino and a Rasperry Pi. The end goal for these things is to provide an environment similar to that of a Commodore 64 and other computers of its era.Additionally, a set of GPIO pins have been provided so the hardware can be extended with relative ease. It is far more flexible than an Arduino, as well as easier to use. It is also far less daunting than a Raspberry Pi for small projects and does not have the overhead of a full blown Linux operating system.

If you go back and look at what people were using those Commodore 64's for, it was not writing letters, doing homework or tracking receipts, although I suspect many parents were convinced to buy them for these purposes. No, the primary use for those machines was to play games. Almost every kid who had one of these machines, also learned to do at least a little bit of coding in Basic, because you pretty much had to to use the bloody thing.

The Maximite is no different, no one is going to develop productivity applications for the Maximite, not even a simple text editor. It is not because it cannot be done, it can be. The problem is, there is no point, in this day and age, virtually everyone has a desktop computer at home. Don't give me any bullshit about some people cannot afford computers, which is true, but if you cannot afford a computer, then you sure as shit cannot afford a Maximite and you should be using that money for food and rent. But seriously, what is the point of developing a database library for the Maximite, when I have several good options available to me on my desktop computer. I don't need the Maximite for productivity applications, I already have a computer for that stuff. Those wheels have already been invented and they are running on hardware that is superior to the Maximite by several magnitudes.

The last thing I have to say about this is, if the OP wants to develop a database library for the Maximite, he should go a head and do it. However, he should do it because he has a use for it and because he wants to do it and because he will enjoy doing it. Ultimately basing his decision to do it or not on whether or not other people needed it, tells me even he did not think it was a great idea, otherwise he would have just done it.

Sunday, July 19, 2020

Tiananmen Square of our Time

Last night during protests in Portland, where federal forces have been deployed to quell the rebellion, a woman who has been dubbed "Naked Athena" stood completely nude in front of federal agents who were blocking a street to keep protestors from advancing. After attempting to warn her off for several minutes, the federal agents withdrew.


This showdown reminded me somewhat of the Tiananmen Square protests in China in 1989, that produced this bit of history.


This just goes to show, what one brave person can do in the face of tyranny.

Saturday, July 11, 2020

My Basic Programs for the Maximite


I have started placing all the basic programs I write for this website on my Google drive and made it public. This is for those of you who do not want to type them in by had. Personally, I think you should type them in by hand, especially if you are just learning to program in MMBasic. Typing in the programs is a good way to start learning and retaining computer programing. Besides that, most of these programs are fairly short. So if you have been following my tutorials and such, the programs are here;

Google Drive Link

As I progress, I will add more to the drive.

The Practical Maximite Part 3

In this tutorial we are going to learn how to take advantage of the Arduino compatibility of the Maximite. All of the Colour Maximites have the headers, but not al of them have the sockets soldered in. Mine came with the sockets, if yours did not, you will have to stop here.

When I was making the choice as to what Arduino hat I wanted for my Maximite, it was actually a pretty easy choice. An LCD hat gives you another readable output, which is good for a number of things like error capturing when debugging programs and providing secondary information. These also provide you with a set of buttons that you can use to trigger events. The hat I got can be found here; 16x2 LCD Keypad Shield 1602. These hats are made by many companies, are readily available and are cheap, since you can generally get them for under $10. Make sure if you are buying one of these from a different manufacturer, that is is built on a HD44780 LCD chip, MMBasic has built in support for this chipset.



There are a couple of caveats with these hats, first, there is a reset button, this is handy for resetting your Maximite if, like me, you do not have a power switch. The downside is, if you accidentally press it, you will loose any unsaved programs you have in memory, so be careful and save often. Second, there is a select button, this does not work, it is hooked up to the 5 volt rail, but I have no idea what Pin it is connected to. Lastly, if at first you cannot get anything to display, the contrast is probably set way too low. The contrast is controlled by a screw on top of the blue plastic thing in the upper left corner of the hat. Give the screw 10 complete turns clockwise, and that should make your text become visible and you can adjust to taste from there.

 Now, lets get on with doing useful things with this hat. I am sure the first thing you want to know is how do you get text on the screen. The first thing you must do is initialize the LCD by telling your program which pins it will be using to communicate, 99% of the time, this is d4,d5,d6,d7,d8,d9 and this is done by simply adding "LCD INIT d4,d5,d6,d7,d8,d9" to the top of the program. Next we issue the LCD command, the first number tells the Maximite which line to print the text on (1 or 2), the second number tells the Maximite what position in the line to put the text (1 - 16), this is then followed by the text you want displayed. The following program displays "Hello World" followed by the date.

'lcdtxt.bas
LCD INIT d4,d5,d6,d7,d8,d9
LCD 1,1,"Hello World"
LCD 2,1, Date$

That is the easy part. The next thing we want to do is make the buttons do something useful. All of the buttons are connected to Pin 35, when in use, Pin 35 will constantly output 3.3 volts, when one of the buttons is pressed, that voltage is reduced and the button can be determined by the voltage. Unfortunately, the voltage differs from board to board, which means you need to determine what these voltages are. The following program configures Pin 35 for Analog Input, this is so we can read the voltage being put out by the pin. The program then starts polling the pin, if no button is pressed and the voltage is 3.3, it does nothing, because no button is being pressed. If the voltage drops, meaning a button is pressed, it prints the voltage on your monitor. Press each button and make a note of the the output for each button.

'bttnvolt.bas
SetPin 35,AIN

Main:

  Volt = Pin(35)
  If Volt <> 3.3 Then Print Volt

GoTo Main

My results were Left=2.01, Right=0, Up=0.49 and Down=1.26, the numbers actually went out 5 decimal places, but don't worry about that. The Right button is easy, Voltage is 0. Left and Down are both fairly close to 2 and 1 respectively, so by using the Int() function, I can round those values down, without worrying about minor variations in the voltage. Up is a bit more complicated, for this, I need to check to see is the voltage is less than 1 and greater than 0, not tough, but something you have to pay attention to. Putting this altogether, the following program configures Pin 35, initializes the LCD, and displays "LCD Button Test" on the first line. The program then polls Pin 35 for a button press and the displays on the second line which button was pressed. The trailing "*" are there simply to make each string the same length, and no characters are left over from the last button press.

'bttntest.bas
SetPin 35,1
LCD INIT d4,d5,d6,d7,d8,d9
LCD 1,1,"LCD Button Test"

Main:
  Volt = Pin(35)
  If Volt = 0 Then LCD 2,1, "*Right"
  If Int(Volt) = 2 Then LCD 2,1, "*Left*"
  If Int(Volt) = 1 Then LCD 2,1, "*Down*"
  If Volt < 1 And Volt > 0 Then LCD 2,1, "*Up***"
GoTo Main

If you have the LED's from the previous tutorial still connected, you can use the buttons to blink the LED's.

'bblink.bas
SetPin 12, DOUT
SetPin 13, DOUT
SetPin 14, DOUT
SetPin 15, DOUT
SetPin 35, AIN
LCD INIT d4,d5,d6,d7,d8,d9
LCD 1,1,"LCD Button Test"

Main:
 Volt = Pin(35)

If Volt = 0 Then
    LCD 2,1, "*Right"
    Pin(15) = 1
      Else
        Pin(15) = 0
  EndIf

  If Int(Volt) = 2 Then
    LCD 2,1, "*Left*"
    Pin(12) = 1
      Else
        Pin(12) = 0
  EndIf

  If Int(Volt) = 1 Then
    LCD 2,1, "*Down*"
    Pin(14) = 1
      Else
        Pin(14) = 0
  EndIf

  If Volt < 1 And Volt > 0 Then
    LCD 2,1, "*Up***"
    Pin(13) = 1
      Else
        Pin(13) = 0
  EndIf

GoTo Main

________________________________________________________

Here are some useful programs for handling the LCD Hat.

'bloff.bas
' This turns the backlight off
SetPin31,DOUT
Pin(31) = 0

'blon.bas
'This turns the backlight on
SetPin31,DOUT
Pin(31) =1

'lcdcls.bas
'This clears all text from the LCD
LCD INIT d4,d5,d6,d7,d8,d9
LCD Clear