Home
Fractals
Tutorials
Books
My blog
My LinkedIn Profile

BOOKS i'm reading

Napoleon Hill Keys to Success: The 17 Principles of Personal Achievement, Napoleon Hill, ISBN: 978-0452272811
The 4-Hour Workweek: Escape 9-5, Live Anywhere, and Join the New Rich (Expanded and Updated), Timothy Ferriss, ISBN: 978-0307465351
The Fountainhead, Ayn Rand, ISBN: 0452273331
Web Hosting Canada

mailto:olivier@olivierlanglois.net

My new C++ source code to HTML converter

05/24/10

Permalink 12:56:55 pm, by lano1106, 240 words, 3690 views   English (CA)
Categories: General

My new C++ source code to HTML converter

While I was integrating a fix to a bug that has been reported to me by Daniel Quadros in my primality testing C++ module and also adding gcc asm support to it. I used that opportunity to rework my C++ source code to HTML converter. The 2 things that I added to the converter are:

  • replace the usage of the <font> tags with <span> tags in combination of CSS classes
  • size optimization of the converted document

The size optimization came from the very simple observation that my converter was stateless and was not recognizing when multiple consecutive sections sharing the same colors were processed. I just added a small FSM to my converter to keep track of the current state and the converter now close the current tag only if there is a transition to a new color. The most impressive result came from my DCEL C++ file with a 25% file size reduction!

Also, I am just starting to appreciate to power of CSS. I will now be able to change the code snippet colors across my whole website by just updating a small CSS file. As a side bonus by having switched from the <font> tags to <span>, I can now use my C++ highlight feature in the code snippets contained in this blog as the blog engine was forbiding using <font> tags on posts but allows <span>.

Comments, Pingbacks:

No Comments/Pingbacks for this post yet...

This post has 4 feedbacks awaiting moderation...

Comments are closed for this post.

Olivier Langlois's blog

I want you to find in this blog informations about C++ programming that I had a hard time to find in the first place on the web.

April 2024
Sun Mon Tue Wed Thu Fri Sat
 << <   > >>
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30        

Search

Custom Search

Misc

XML Feeds

What is RSS?

Who's Online?

  • Guest Users: 1

powered by
b2evolution