Thursday, October 19, 2023

How to Count and Convert Numbers

Regardless of how old you are, there is a chance you do not actually know how to count correctly. I decided I would post my guide to proper counting. The reason I say you might not know how to count is because counting in anything should be universal. Whether it is base 10, what we use on a day to day, base 8, base 2, or even base 16, it all works the same. So to prove it, here is my counting method. So, let's begin.

When you count, you probably go one, two, three, four, five, six, seven, eight, nine, ten. When working with real numbers, that works fine. However, this undermines what is actually happening. We use "decimal" counting. This means base 10. But what does that really mean? The base refers to the number of possible values. The values are zero through nine. The number ten is actually not a unique value. It is two values. That is a 1 in the second place and a 0 in the first. Each number you see individually is a value in a specific spot. To show this further, let us take the number 1234. You have a 1 in the fourth place, 2 in the third, 3 in the second, and 4 in the first. Using this same model and some math, we can draw this out to there you get a basic equation where the individual number can be represented relative to the base numbering and its place. It would look like base^place*value. We can then get the actual number by obtaining the sum. So let's expand this further for the number 1234. To do so, we first need to establish what the place value is. The place value starts at 0, because we will take advantage of some special math properties. Thus the number 1234 would be expanded with the base being a constant, in this case 10.

(10^3*1) + (10^2*2) + (10^1*3) + (10^0*4)

The special rule to remember is anything to the power of zero is always one. We have 4 places, starting at zero and ending in 3.

(1000*1) + (100*2) + (10*3) + (1*4)

Hopefully at this point, you can now see the relation of the place with the base. Now we put in the values.

1000 + 200 + 30 + 4

With that we get 1234 as our total value. It may seem super convoluted, but this is the realistic way numbers work. Understanding this, we can use the exact same method to convert any number from any base to a number we humans of base 10 calculations can understand. So let's show the relation to binary, or base 2. Picking an arbitrary binary value, 10011010, let us calculate what that is in a number we can understand. To start out with, we have 8 place values, and a base of two. That should let us drop in all the information nice and easy.

(2^7*1) + (2^6*0) + (2^5*0) + (2^4*1) + (2^3*1) + (2^2*0) + (2^1*1) + (2^0*0)

There are ways to shorten it, which if you can't see you should momentarily, but I will go through all the steps to actually show what it all looks like. So the next step is as follows:

(128 * 1) + (64 * 0) + (32 * 0) + (16 * 1) + (8 * 1) + (4 * 0) + (2 * 1) + (1 * 0)

Since anything times zero would be zero, you could have technically just thrown out those sections from the equation, but we will continue on with them in there.

128 + 0 + 0 + 16 + 8 + 0 + 2 + 0

This then means our binary value was the number 154. Just to show it works for any base number, let's do an octal number. Since it is octal, that means the numbers can be anything with values 0 to 7. Let's try 651.

(8^2*6) + (8^1*5) + (8^0*1)
(64*6) + (8*5) + (1*1)
384 + 40 + 1

While the math itself may be hard, getting the equation makes it easy to just figure it out with any old calculator. Working with hexadecimal works a little differently, as we need to do some extra translation. Hexadecimal is base 16, which means the values are 0 to 15. Since we have only ten numbers, 0 to 9, we need to create more numbers. For this, we use letters. The letter values are as follows.

With this extra bit, we can translate a hexadecimal number to an understandable number. Let's use the number 1C3A. The numbers here will be much larger, but as long as we have the equations down, it should be easy.

(16^3*1) + (16^2*C) + (16^1*3) + (16^0*A)

Now, let's substitute any letters and we should be able to roll on through it.
(16^3*1) + (16^2*12) + (16^1*3) + (16^0*10)
(4096*1) + (256*12) + (16*3) + (1 * 10)
4096 + 3072 + 48 + 10

As you can see, we can re-use the same pattern and adapt to anything we need. So long as we keep track of all the information necessary, it's easy enough. So to reiterate, the base is a constant for the whole equation. Each value number is actually two pieces of information, place and value. Common bases for number systems are binary (2), octal (8), decimal (10), and hexadecimal (16). Even so, you can pick any base you want, even lucky 13.

Now, how do we reverse it? The method is a little more obscure, however it is still doable. While the method mentioned before is not sensitive to the order since it is a sum, going backwards is. The good news is, we are worried about the same information of base, place, and value. So let's pick a number we did before, 154, and convert that back to binary. The way we do that is divide by the base and use remainder for the value and the quotient for the next step. We work our way through more or less as (total/base) -> 1 if remainder else 0 -> (quotient/base) ...

A bit more confusing, but let me show how that goes.
154/2 = 77 -> 0

Now the quotient is 77.
77/2 = 38.4 -> 1

The quotient is 38, remainder is 4, so we have a 1.
38/2 = 19 -> 0
19/2 = 9.5 -> 1
9/2 = 4.5 -> 1
4/2 = 2 -> 0
2/2 = 1 -> 0
1/2 = 1.5 -> 1

Now we take all of what is at the end and reverse it to get 10011010, what we started with. Numbers other than binary are a little easier if you know the modulo operator. With an equation, it would be more along the lines of using modulo(%) and integer division for the quotient to look like (value % base) -> (quotient % base)... Making this a little easier with a calculator. However, the structure is the same. So let's use 425 and go back to octal.

425/8 = 53.125 -> 0.125 = 1/8 giving us a modulo 1
53/8 = 6.625 -> 0.625 = 5/8 giving us a modulo 5
6/8 = 0.75 -> 6/8 giving us a modulo of 6

We take that and reverse the order and you get the original we started with in octal, 651. Now let's tackle the one last number, 7224, and get it back to the original hexadecimal. As before it will require the extra step of substitution to get the letters in there. Let's roll through this.

7224/16 = 451.625 -> 0.625 = 10/16 gives us a modulo 10 which is A
451/16 = 28.1875 -> 0.1875 = 3/16 gives us a modulo of 3
26/16 = 1.75 -> 0.75 = 3/4 = 12/16 gives us a modulo 12 which is C
1/16 = 1 gives us a modulo 1

Now we take those values, run them backwards and we get 1C3A. With that, you can hopefully see that converting around different base numbers is actually a simple process and hopefully reveals enough information to truly understand what counting is really representative of.

I also want to talk about some bonus information. Number Order. So the way numbers get processed can be in relation to either the smallest to largest value, which is called little endian, or largest to smallest, called big endian. When you get deep into computer programming or number processing, this becomes very important as to preserving the significant figures we want to be concerned with. As I mentioned before, since converting numbers into decimal was a sum that the order did not matter. That means you can process the numbers in reverse order similar, just like when you convert them off into other bases.

That's all there is to it! With any old calculator you should now be able to do conversions of binary, hex, octal, or whatever else you fancy. Hope it helps someone.

Wednesday, June 28, 2023

Web Design: Make Duplicate Forms And Remove/Reset Them

 I don't know if anyone else would ever need or want something like this, but here we go. If you want to be able to create multiple forms on demand on the same page along with maintaining the ability to remove them or interact with them, then this is for you. First thing first, we need to make an HTML document.

<!DOCTYPE html>



<title>Some Stupid Form Thing</title>

Now let's get our Javascript on! I know I add some stuff that is not needed, but I'm weird.

<script type="application/javascript">//<[CDATA[

"use strict";

//I like to do a global storage object

var storage = {

    "formdata": "",

    "fid": 1


// function to store original form setup

function getformdata() {

    storage["formdata"] = document.getElementById("form0").innerHTML;


//Creating new forms

function addform() {

    var newform = document.createElement("form"); = "form" + storage["fid"]++;

    newform.innerHTML = storage["formdata"];



// Removing forms, or reset the last form

function removeform(b) {


    if (document.getElementById("formlist").children.length < 1) {

        storage["fid"] = 0;






Now that all the delicious code is out of the way, we need to create the body that this will interact with. It's actually fairly simple.

<body onload="getformdata()">

<div id="formlist">

<form id="form0" action="#">

Employee ID: <input type="text" value="" class="eid" /><button type="button">Do a thing</button><br />

<button type="button" onclick="removeform(this)">Remove</button>



<button onclick="addform()">Add Form</button>



Summary time. I am using a div as a container to create and remove forms in. Using the DOM we can isolate what we need inside of whatever container and use that to modify whatever with minimal navigation, no extra overhead of frameworks needed. I don't know why anyone would need this, other than the reason I made it that I'm not going to say. But there you go.

Comparing IT Jobs (Dedicated vs MSP)

 It's been a long and busy I don't even know how long. In a short while, I will be starting my new role as a Network Engineer, which sounds so intimidating that I am looking forward to the idea of being a newbie even on a technical skill level. I won't claim to be the smartest person in the IT room, but I will say I know my stuff well enough that even doing a new job at an MSP I received comments about how little help I needed and how few questions I asked. The job at the MSP did not last very long, almost got to 6 months. Either way, I had 7 years and 10 months as an in house IT Specialist and 5 months as a Field Specialist at an MSP. I would now like to take the time to compare those two jobs in hopes of helping people decide what route they want to go and maybe also help remove any rumors you might have heard with more solid experience.

To begin with, what is the difference? Well, in house IT Specialists are people who work for the company they are hired on. An MSP, or Managed Service Provider, is a third party company hired on to manage IT tasks for companies who either lack the resources or size to be able to hire on dedicated people. There are varying levels of hybridizing that can occur. My job as an IT Specialist also had used a third party company for network engineering and even for cyber security after a cyber incident. This means that just because a place has dedicated IT people does not mean they fill all roles in house, and also that an MSP may have to work with in house IT people.

Now to clarify my roles. As an IT Specialist, I worked for a local Board of Education. As a Field Tech, I worked for various car dealerships, as that is what the MSP I worked for specialized in. For transparency even further, I will say it was Effingham County Board of Education in Georgia and Proton Dealership IT (owned by Reynolds and Reynolds). With that, let's talk about the jobs.

Let's compare and contrast the two. As in house IT, I was more a part of the team. People were closer and more forgiving so long as they recognized you making the effort you needed to. Getting to know people is so much easier. As an MSP, I was an outsider. Anything went wrong with my company, being the face of the company it became my fault. Anything went wrong, it was easy to blame the "other guy." As an MSP, you really need to schmooze with people. This also means when you come across incompatible personalities, it can become a big problem very quickly. I know from my own experience of having one place absolutely hate me being there, while having another site where I got constant compliments about the effort I was putting forth. So as an MSP tech, you can do well with the gift of gab and some skill, whereas in house it is better to be skilled and let people come to appreciate that.

As in house IT, you will have better familiarity with your site(s). When there is one solution to dictate how things go, there will be some level of consistency, even if it's "layered" by different times, budgets, and ideas. Regardless, the original thought should be somewhere in there. This means once you learn the bulk of things, you can really drill into it all. As an MSP, you will have little consistency and a lot of variation. Great for learning but horrible for long term solutions. Most of the time it is either band-aid it or overhaul. Overhauling can be great because then you are going to know everything from the ground up. If you want a broad range of exposure without as much time to get into the deeper details, MSP's are strong. If you are more concerned with getting deeper, in house is the way to go.

As in house IT, I was more than just the "IT guy." I mounted TV's, put up projectors and screens, ran and terminated cables, installed cameras, drove moving trucks, loaded and unloaded trucks, spotted people on a scissor lift, sat down with people who were having mental break downs, moved furniture, and so much more I can't even remember. In house IT is used and abused to do everything and anything because you are there. It was often justified to me as "you know how real IT is." With the perspective of an MSP, I can now say yes I do. At an MSP if someone asks me to do a service they are not paying for, the answer is no. At my MSP I don't run cables, or mount TV's, or do anything really not essential to the job they pay me to do unless I'm trying to schmooze. And even then, there are some things I was told to say no to so they can't sue us because we are the "other guy." In house IT is the mentality of "it needs to be done and the manpower is here." You are extra manpower. MSP is the mentality of "pay me to do it or I don't do it." I have to tip my hat in the favor of an MSP and will take the time to say that if my bosses from my IT Specialist job read this that yes, I do know what an IT job consists of and you guys were the ones that didn't seem to know or understand where IT ends. Yes, I am still a little angry about all the extra I was asked to do at my IT Specialist job. I can say my job in an MSP was very clearly defined.

Skill sets are going to be a weird one to cover. As an in house IT Specialist, I needed technical knowledge. It seemed like every day I needed to know something deeper into our systems. I was not worried about what equipment was bought or who or how we contracted some stuff out. I was purely a worker with a job to do. I can say that I didn't "manage" much; maybe a project here or there. At the MSP, I needed to do things like work for getting orders of equipment ready, managing my stock of equipment, finding and contacting contractors, coordinating things with managers, etc. You have to actually work at some capacity as a "manager" or "lead," not so much for other people but for you, equipment, and time. At the MSP, I got more comfortable calling up support numbers, finding equipment, and making purchase requests, than I ever did as just an in house IT. It wasn't something hard to learn, but the level of comfort with it increases as you do it more.

Now time to talk about coworkers. In house IT had coworkers I worked more closely with. The skills seemed pretty set as to you could tell who had been there longer. We actually had someone hired on with virtually no IT experience who learned it all on the job and you could tell that most of what you got there was learned over time as experience. In house IT can have way more flexibility in skills because you need to learn there way. An MSP is different. Everyone there did have a varying level of skills, however everyone seemed to have a better grasp on a wide variety of technical knowledge. If it wasn't for the at times very surface level knowledge, most of the people at the MSP would be able to be higher up techs elsewhere. Some coworkers are very knowledgeable, but I can say that all of them are usually able to keep up in technical talk of so many different things. It's really like being surrounded by a lot of hobbyists.

Now let's get down to the part everyone is interested in. Pay and benefits. I have heard that at an MSP you get paid less than in house. Going to an MSP, I made more, however that was leaving a local government job which is already expected to pay less. The MSP job was also salary while the in house job was hourly. Both jobs offered health insurance and the government job was slightly cheaper if you don't count the option to get screened and not pay anything. Both jobs offered retirement, one as a teacher retirement (TRS) and the other as a 401k with matching. The bottom line is it's not so much dedicated IT versus MSP, but company vs company or type. Private pays more than public, usually.

Finally, let's talk about working as in house with an MSP versus an MSP working with in house IT. When I had to work with an MSP, we had meetings and lengthy. There is also a very good chance that something will be miscommunicated. In my experience, I had to help communicate basically the same information repeatedly to get the actual information across. It is nice for something to be "not my problem." As an MSP communicating with in house IT, it was actually nice for me. I had the information I needed sent to me. There were also points were I just needed to wait for the in house IT to do stuff. Both sides have issues, both sides have the advantage of each side having separate duties. Basically, it's nice to not be entirely responsible but it sucks to have to communicate across parties when communication does not go as expected.

Now, for the conclusion. Which is better, in house or MSP. It really depends on your personality. If you like going to lots of places, seeing lots of variety, and relying a lot on people skills, you will probably do well at an MSP. If you are the kind of person to get the job done first and foremost, a dedicated IT job would probably work better. If you clash personalities, you can fail pretty hard at an MSP.. If you want a strict job description, in house IT may disappoint or overwhelm you. To become well-rounded, I would recommend a hand at each at some point in your IT career to gain a variety of experiences.

Thursday, April 6, 2023

Web Design: Copy To Clipboard with an SVG Graphic!

 Been a long time since I've had time to post. Now, let's get into the meat of this. It's easy enough to copy to a clipboard in Javascript. I did that. Let's also talk using a graphical icon to make it not look like garbage. The Javascript code to copy to a clipboard looks something simple like this:


Easy enough. Now, let's talk a dead simple icon that takes up little to no room and is easy enough to copy and alter.

<svg width="20px" height="20px">

<rect x="3" y="3" height="12px" width="12px" rx="3" ry="3" style="stroke-width:1;stroke:black;fill:white"/>

<rect x="7" y="7" height="12px" width="12px" rx="3" ry="3" style="stroke-width:1;stroke:black;fill:white"/>


Easy enough, just a little black and white icon that looks close enough to the double paper thing to do a thing. All together it might look something like this:

<input type="text" id="kopimi">Something useful</input><button type="button" onclick="navigator.clipboard.writeText(document.getElementById('kopimi').value)" style="padding0;margin0"><svg width="20px" height="20px">

<rect x="3" y="3" height="12px" width="12px" rx="3" ry="3" style="stroke-width:1;stroke:black;fill:white"/>

<rect x="7" y="7" height="12px" width="12px" rx="3" ry="3" style="stroke-width:1;stroke:black;fill:white"/>


And there you have it, a stupid little input box with a copy icon button. Enjoy, copy whatever.

Tag Cloud

.NET (2) A+ (5) ad ds (1) addon (4) Android (4) anonymous functions (1) application (9) arduino (1) artificial intelligence (1) backup (1) bash (6) camera (2) certifications (3) comptia (5) css (2) customize (11) encryption (3) error (13) exploit (5) ftp (1) funny (4) gadget (4) games (3) GUI (5) hardware (16) haskell (6) help (14) HTML (3) imaging (2) irc (1) it (1) java (2) javascript (13) jobs (1) Linux (19) lua (1) Mac (4) malware (1) math (6) msp (1) network (13) perl (2) php (3) plugin (2) powershell (8) privacy (2) programming (24) python (10) radio (2) regex (3) repair (2) security (16) sound (2) speakers (2) ssh (1) story (5) Techs from the Crypt (5) telnet (1) tools (13) troubleshooting (11) tutorial (9) Ubuntu (4) Unix (2) virtualization (2) web design (6) Windows (16) world of warcraft (1) wow (1) wx (1)