Categories
Coding

HEX Code

Hex is abbreviated from Hexadecimal. It’s widely used by programmers and computer system engineers. To laypeople, Hex code is considered as an untouchable issue that is as much complicated as Quantum Mechanics.

In fact, Hex code already has a very popular and practical application in our life for many years.

IT’S COLOR PICKER.

You definitely used a similar function by your phone, computer or other electronic device. The color you picked is represented by 3 individual 2-digit Hex codes for the setting value of RGB ( abbreviated from Red, Green and Blue).

Hex is simply a new way to count!

Don’t be scared! It’s simply a new way to count.

If you can count 1 to 10, you definitely can count 1 to 16. The concept of Hex code is to collect and group things by 16. We gotta use A, B, C, D, E and F instead of 10, 11, 12, 13, 14 and 15, because a digit can only be represented by a character.

Try to count 1 to 16 by HEX way, it would like: 
1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F and 10(a carry here)

Notice that there's a carry when we count to 16. 
So the number becomes 2 digits to 10.

11 is NOT Eleven

Let's count 1 to 17 by Hex way this time, it would like:
1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F and 10(a carry here), 11

There’s still one thing that I haven’t told you. ‘0x’ is a mark MUST be put in front of a number to represent Hex code. As the example, you have ONE group (0x1, 0x2, 0x3, ….0xD, 0xE, 0xF and 0x10) with one left (0x11), so we can say you totally count 0x11. That’s 16 + 1 = 17.

Dose it make sense to you now ?

Let’s take a challenge to count more, like 44.

It would like:
1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, 10 
(First group is done),  

11, 12, 13, 14, 15, 16 ,17, 18, 19, 1A, 1B, 1C, 1D, 1E, 1F, 20
(Now we have 2 groups, it's 16+16=32) 

21, 22, 23, 24, 25, 26, 27, 28, 29, 2A, 2B, 2C
(We finally count to 44, it's 16+16+12 = 44). 

As above, we know 44 is 0x2C in Hex.

If you are interested in this topic, please take a look at Wikipedia. There’s much detailed information there! https://en.wikipedia.org/wiki/Hexadecimal

Try more counting, and enjoy the new way to count!

Categories
Coding

Program Variable

Variables are drum BAGs!

Drum bag is important to drummers keep their drums safe, especially during a gig tour. But if you have a 22″ bass drum, there’ll be no way to fit in a 18″ drum bag! On other hand, if we put all 10″ and 12″ Toms into 20″ or 22″ bags which are original for bass drum, that does not only waste money but also your room space.

Drum bags
Variables are drum bags

time flies!

Decades ago, the hardware of computer, such as CPU, RAM, Hard Disc, Main board …etc., is extremely high cost. The constraint of hardware also extremely affected the development of software.

At the time, as a software engineer we had to consider not only the run-time efficient of programs but the compiled size of codes. So, choosing suitable size of variables during programming was a fundamental task.

Now a days, ‘Giga’ is already the basic unit of memory space and the speed of CPU frequency. For this reason, software engineers are more comfortable to deal with the annoying stuff, like the efficient, the size and the scalability. But they probably omit the details of programming at the same time.

Be aware of the size

Even the project of Moon-Travel is going to be reality in the near future, I still believe that being aware of the size of variables is basic and a good habit to software developer.

Devil is in the detail. In my engineer career, I encountered a lot of strange and wired bugs. Most of the bugs were the causes of overlooking the details. If we can spend time in studying something we don’t know, not skip it and pretend it’s not important, we’ll obtain something in return in the future. All efforts will pay off!

Categories
Drumming

The fingers of drum grip

I love sports. When I was a student, I tried golf, baseball, tennis and badminton. Baseball is the game of using a bat to hit a ball. Similar to Tennis and badminton, which are using racket to hit a ball. Not to mention golf, there’re different ‘clubs’ that you can choose before you hit a ball. Based-on the experiences I found there’s a big common to the kinds of sports.

That is the GRIP.

Sonor Martin Kit
Sonor Martini Kit & Sabain Cymbal

The sport players all need to hold something to play the game. So, the way of holding things (bat, racket ..etc.) are so important that are able to affect the performance of a player. That’s why a coach or a teacher spends time teaching beginners how to make a correct grip, and even keeping adjusting the grip all the time.

Once I started playing drum, I found the way of holding drumstick is much similar to holding a racket and golf club. Furthermore I found the little finger plays a key role of the control and stability of the grips.

The Little Finger

When you make a stroke, the wrist is like a starter of the whole motion. The littler finger is a controller in charge of restraining the stroke. Here’s a way I use to teach my student (for match grip) to feel the control of the little finger.

Holding you drumstick with 3 fingers ONLY

Relax your shoulders, arms and wrists first. then holding you drumstick ONLY with :

  • Little finger
  • Ring finger
  • Middle finger

At the time your hand just shows a ‘7’ by the index finger and thumb.

Starting to play single stroke on you practice pad, and keeping adjust the strength the 3 fingers to just right NOT to dropping drumsticks.

Then closing your index finger and thumb SLOWLY.
Be aware of how tie your LITTLE finger holds the sticks.

Remember your index finger and thumb are simply in charge of keeping the sticks NOT ‘free running’, so NOT to convey too much strength on drumsticks to make you grip looks tie.

Repeat the process over and over again. You’ll find the way you feel comfortable.

Categories
Drumming

Holding Drumsticks

How to be relaxing and comfortable to hold drumsticks?

It’s a time-consuming issue!

When you hold drumsticks to make a stroke, you provide an energy to your drum to produce sound. The batter head is hit and vibrate to deliver sound to drum shell to resonate. The bottom head accepts all energy from the top to keep resonating and sustaining.

It’s a big chain of how sound was produced. So if you can’t provide a quality energy in the beginning. Your drum can’t produce a lovely sound for you either.

Vic Firth Drumsticks
Vic Firth Drumsticks

Holding eggs to sprint

When I was a kid, my mom asked me to barrow an egg from a neighbor. I was watching my favorite cartoon, so I run back home as fast as I could once I got the egg. I gotta not only keep the strength of my hands to ensure the egg is safe, but also keep the running speed fast!

At the moment, the strength I held the eggs is the perfect strength to hold drumsticks as well!

I’m not sure if the story above is appropriate. How about having a try later and figure out your own story.