CODEX

And other introductory classes

Image for post
Image for post
Maybe if coding was taught in the 60s, this would’ve been an accurate depiction.

Like many fields of engineering, there are two aspects every programmer works with. There is the problem solving, which tests your knowledge and skills, and then there is the technical know-how, which tests your patience.

Many programmers enjoy difficult problems utilizing creative endeavors. They often take a considerable amount of time to solve, yet they go through it with sheer focus and joy. And when they’ve got it, they feel like absolute geniuses. They are engineers proud of their work. It puts a tear in my eye.

Many programmers also talk about how often they want to torch their computer…


Codex

And Why We Need Them

Image for post
Image for post

I highly recommend you as the reader to write the code shown here. Don’t copy and paste. Write everything word for word. You’re encouraged to experiment.

The idea behind classes should be intuitive, as they simply allow us to group related data together. However, to prove their usefulness through example, let me introduce to you a program. The program is simple. It adds points.

Running this, we get the result:

(2.00, 3.00) + (5.00, 0.00) = (7.00, 3.00)

The code works fine, however, the issues that exist are not regarding the functionality of the code. Rather, it regards the…


Image for post
Image for post

The debt collector was here. He stood outside the door, waiting and waiting. His shadow was engrained beneath him, and remained static, as it stood waiting.

He could not be seen, but his tales were apparent in the shadow cast. He wore a trenchcoat, with his hands deep in his pockets. His height could not be told, as his shadow stretched across the floor. It did not move. It was waiting.

His head tilted occasionally, but it was not out of impatience. He was talking to me; he knew I was listening. He did not need to utter a single…


CODEX

A simple explanation of Recursion

Image for post
Image for post

To explain the idea behind recursion, let’s look at a simple problem. That is, calculating the nth Fibonacci number within the sequence. The mathematical definition of Fibonacci is as follows:

f(0) = 0
f(1) = 1
f(n) = f(n - 1) + f(n - 2)

The Fibonacci sequence is infinite, generating each number by adding the two directly preceding numbers. So, the first few elements, starting from 0, are: 0, 1, 1, 2, 3, 5, 8, 13… which can be rewritten as: 0, 1, (0 + 1), (1 + 1), (2 + 1), (3 + 2), (5 + 3)…

Before…


Tuesday and Monday are only 24 hours apart!

Image for post
Image for post
Blog cover

Wow, what a busy week! Unfortunately, I couldn’t spend much time developing the bot. However, that doesn’t mean nothing got done! Here’s the changelog:

  • Fixed some formatting and messages.
  • Dead players can no longer speak.
  • Doctor’s ability works.
  • Parties automatically end when everyone leaves.
  • The bot will now leave when the server is transferred.
  • More documentation was added, view them here.

Currently, the priorities are squashing bugs and adding documentation. Not an exciting week, but it’ll pay well when y’all can play it without having to worry about game stability.

Since the changelog isn’t enticing, let’s explore the format used…


See what’s upcoming!

Image for post
Image for post
Blog Cover

Welcome to MDF #2! This week is very exciting, as the bot has now reached a relatively stable build. This means that more visual and exciting stuff can start rolling up next week, as all the boring refactoring stuff has been tidied up.

I’m tired, and you must also be tired of waiting. Here’s the stuff upcoming next release, version 0.2.5:

  • Documentation
  • The Arsonist role
  • More customization options
  • A much more intuitive help command

Considering my current workload, it’s unlikely that all these features will be done by next week, which is why documenting the source will be the priority…


Learn what Dingly’s developing!

Image for post
Image for post
Blog Cover

Welcome to Monday Development Facts! As usual, it’s a horrible acronym but it perfectly describes what this blog will be about. It’ll specifically pertain to my developments, and you can appreciate the fact that I didn’t call it Dingly’s Monday Development Facts! (Though you’re always free to call it DMDF)

Skip the intro, tell me the facts!!!

I like your energy!


(originally published on October 28, 2020)

Yes, I’m aware. It’s been one month since I’ve posted a blog. However, I’ve got some good stuff coming up!

Discord Deception Games (DDG)

Been a long while since I’ve used that name, but it’s coming back. Over the past few weeks, I’ve been working on refactoring the bot, essentially making it usable again. It’s almost done, and progress is becoming visible!

Image for post
Image for post
Here’s the server that gets created by the bot!

Now you must be begging me, what’s coming up with this hot new bot? I’ve updated the Readme on the Github with a new Trello board link: https://trello.com/b/E537wPgg/discord-deception-games

There you’ll see upcoming additions such as a…


Image for post
Image for post

There is a misunderstanding that occurs much too often between developers. Is a kilobit 1024 or 1000 bits?

Officially, a kilobit is a thousand bits. A thousand bits, that was the number that most if not all committees agree on, including the IEC and IEEE. So question settled, right?

Not really. That’s because for a very long time, a kilobit has been referred to as 1024 bits. Long enough for it cause confusion, but not long enough for it to become an old trivia fact.

Maybe one day, more developers will start using kibibits (Kib), which is the technical way…


Image for post
Image for post
Dividing an area into unit squares

Dimensional Analysis is about converting units using ratios. Let’s keep this short and jump straight into how that works.

Say that you have 2 kilograms and you want to know how much that is in grams. Well, if one kilogram is a thousand grams, then two kilograms must be two thousand grams. Easy.

But what about something more complicated such as converting inches to cm? 50 inches are equivalent to 127 cm. How do we convert 40 inches to cm? Well, we use ratios.

Let’s work with a simpler example. Say you have a 100 inches, how do you convert…

Amr Ojjeh

Hello! All “art” covers are made by me. Marvel at them!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store