Andrew Que Sites list Photos
Projects Contact
Main

No articles for week of January 20, 2019

Falling back to closest date.

The Iron Horse in the Trainer

The Iron Horse in the Trainer

   Today I finished up implementing tabs on the CRC site.  I think this is slightly easier to use than my previous method.
   Over the weekend my new bicycle trainer arrived and today I had time to set it up.  I was pretty happy to see this trainer was able to hold my 29" wheels without bottoming out.  I decided to try something I had been planning to do for over a year.  I put on an episode of Star Trek and started peddling.
   The trainer only has a single resistance.  However, you can increase torque by changing gears on the bike.  I found a spot to put my heart rate between 155 and 165 BPM and spun away.  This trainer is a fluid device which is supposed to be quieter than other resistance devices.  I would hate to hear one of those other devices as it was still pretty loud and I had to put in headphones in order to watch my show.  Since I can no longer tolerate shows and movies at normal speed I watched two episodes at 1.5x speed and cycled for one hour. 
   I like riding the trainer a lot better than the recumbent exercise bike.  I was able to keep my heart rate at normal riding levels.  Not sure why I couldn't do this on the recumbent, but I never did.  I will have to come up with a solution for removing waste heat.  I made a pool under the bike, and drenched my shirt and shorts even with a fan blowing on me.  But I think I have an indoor riding solution in case winter decides to be winter.

January 07, 2019

64-bit CRC support to A.Q. CRC

This weekend I completed the major changes needed for the CRC site to support 64-bit CRC generation. The reason this could not happen right away has to do with how Javascript handles numbers. In Javascript, all numbers are 64-bit (double-precision) floating-point. You can do bit manipulation, but it is done on floating-point values. An IEEE double-precision float has 1 sign bit, 11-bits of exponent and 52-bits of mantissa. In theory one could store 52-bits in a double without loss of precision. That means Javascript cannot directly hold a 64-bit CRC in a single word, and that makes implementation more difficult.

We cannot use a single word to hold results, but we can use multiple words. So the first step in generating larger CRCs inside Javascript is to create an arbitrary length word. Although we technically can use 52-bits/word, it is easier to work with 32-bit words. I created a unit that can do bit manipulation on words of arbitrary length. In reality I only need 64-bit words, but it was about as easy to use make this size arbitrary. The unit needed to support basic bit operations: AND, OR, XOR, shifts, bit reversal, etc., and converting to/from strings.

After a large word unit was implemented I needed to make the CRC class use it. The large words are significantly slower than small, so I kept the original class and simply duplicated the functionality with a large class.

It took a few passes but I worked out all the bugs and now have a functional CRC class that can generate 64-bit CRCs. The system can do the 82-bit CRC, but the C implementation system only supports up to 64-bit word sizes.

   Temperatures today hit 52°F/11°C.  That is close to a record high for this time of year.  The temperatures were so warm I finished the last bit of painting I had to abandon this fall.  The painter finished before all wood repairs were made, and the cold wet weather of October kept the repairs from happening for some weeks.  When they did finish, so had days above 50°F/10°C which is the minimum temperature for applying latex paint.  November was colder than usual and we never did get another warm day.  December got close a couple of days, but I had pretty much abandon hope of painting until spring.  Then today I saw how warm it was and decided to knock out this paint job.  Zach helped and it didn't take long as there was not much to paint.  I may have to go over it again in the spring, but this item is checked off the list for now.

January 04, 2019

Verifying Javascript Output

My CRC website creates C source code using Javascript and I needed a method to verify the generated code. As an engineer I am pretty lazy and I didn’t want anything manual so I went in search of a tool that could help. I found system called PhantomJS which seems to be designed to test Javascript rich websites, and it seems to be exactly what I was looking for. I was able to use it to run a test script that generated C code for every possible CRC output combination, along with test C code. The code is then saved to disk where it can be compiled and verified. The results: all good. CRC code for each combination generates the correct CRC for the test vector.

Temp were above 40°F/4°C this afternoon and made for a very pleasant ride home.  Temperatures are forecast to stay warm through the weekend and I have a feeling the snowman I'm standing with will not be around on my next ride.

January 02, 2019

A.Q. CRC Goes Live

   For several weeks now I have been working on a project for generating CRC calculating source code.  Today I finished enough of the foundation to make it live.  There is still work to be done, especially rigorous testing.  But the basics are online and ready to go.
Elmwood Park in the Snow

Elmwood Park in the Snow

   Last day of 2018, and Wisconsin remember that it is, in fact, winter.  Snow started this afternoon and was pretty heavy at times.  Roads were terrible and the crew at Elmwood Park wondered how many people would brave the weather for the evening.  Turns out a lot of people would and we gave the new year a loud, happy welcome.