Welcome Chris Adams!

October 27, 2007 on 1:42 pm | In Personal, Programming | By QBasicer | No Comments

A friend and fellow programmer, Chris Adams, has recently taken up space on the Vectec.Net. You can visit his website at his new address, lithium.vectec.net. Chris and I have competed against one another in a couple programming competitions. He does some pretty interesting programming, and I encourage you to check it out.

Xorg Memory Usage

October 20, 2007 on 4:09 pm | In Personal | By QBasicer | 4 Comments

I was just doing some distance calculations in Firefox, and it caused Xorg to use 60% of my free memory. That is, over 700MB of memory. My swap space usage went to 100%, and I had 12MB of 1024MB free physical memory. High memory usage seems to be quite common, but using Google Maps seems to cause Xorg to use lots of memory. I tried a Ctrl+Alt+Backspace, but my drive kept swapping. I eventually went to the Magic Sysreq combo to reboot. Xorg seems to use increasing amounts of memory. I’m not exactly sure the fix, but I’ve noted this problem for a while. I’ve noticed Firefox eats a lot of memory too (using 30% of my resources at the time of the reboot).

I want your feedback!

October 18, 2007 on 7:43 pm | In Programming, ZDLSharp | By QBasicer | No Comments

If you’re a ZDLSharp user, please take a look at this page, and tell me what you think! Feel free to write directly into the wiki in a way that isn’t destructive. Alternatively, you can leave your comments on the blog.

Edit: ZDLSharp has had over 310 downloads to date! There’s over 30 installations of 3.0.5.2 to date as well. For more information on ZDLSharp, please visit the ZDLSharp wiki.

32bit to 24bit

October 14, 2007 on 2:30 pm | In Personal, Programming | By QBasicer | No Comments

We all know that using 32bit formats can be a bit cumbersome sometimes. I devised a little experiment. First I took a 32bit .TGA file, and created a gradient with some transparency (partial and full), and then wrote two algorithms to convert 32bits to 24bits without loose alpha information. I attemped to use a JPG as a carrier format, but more on that later. Note that I had to use PNGs due to image restrictions. Mouse over/hover to add a blue background strip/background to see the transparency.
Original
Original Image

Algorithm 1
By taking each 8bit channel, I convert it to a 6 bit representation. I then pack four 6 bit channels right after each other into an interger, creating a 24 bit representation. I then extract three 8 bit numbers from this, RGB. This creates quite a bit colour distortion.
Resultant JPG
Algorithm 1 JPG
I then did the reverse, to try and get the original 32 bit file.:
Resultant File
Algorithm 1 Resultant

Algorithm 2
I was noticeable dissatisfied with the scrambled output of algorithm 1. I had planned that this would happen, but then I realized that it would create hard edges, where JPG would do more lossy compression and trash the original even more. I then devised a way to save the original file as much as possible, while keeping alpha. In my new algorithm, I shrink each channel down to 6 bits from 8, and left align it in each 8bit colour channel. I then took the top 3 bits of the alpha channel, and stored it in bit 2 of the RGB, and then the lower 6 bits of the alpha in the 1st bit of the RGB channels. As the top 3 bits were the most important, storing them in a higher position would probably make them safer. Storing the alpha in the bottom two bits of each channel allowed the original image to appear as if I just removed the transparency. The 6 bits I use for alpha almost unnoticed. Here’s the JPG of algorithm 2:
Resultant JPG
Algorithm 2 JPG
Here you can see that the jpg looks pretty decent.
Resultant File
Algorithm 2 Resultant
While you can see the original colours better, the JPG algorithm decided that the last two bits of each channel were completely unimportant, and got rid of them completely, or randomized them.

Conclusion
This just shows how much JPG throws away lossesly even on maximum compression. It’s interesting to note that if I use a lossess intermediate file format other than JPG, that the algorithms (both) work flawlessly. It may be worth trying to store the alpha channel information (or at least one bit of it) further up inside the original image in attempt not to have it trashed so much. Perhaps I’ll look into an algorithm 3.
Resultant when a Lossless Intermediary File Format is Used (Algorithm 2)
Algorithm 2 Resultant using Lossless Intermediary

Unified Update Service

October 8, 2007 on 9:47 pm | In Programming | By QBasicer | 1 Comment

I currently add some update-checking abilities to my programs. It’s very hacked together and not very central. To overcome that, I think the best solution is the run a background application/service/daemon that handles the update information from across the internet, and then provide that information to applications.

Daemon Goals:

  • Be very stable
  • Quick
  • Low memory usage

I intend on achieving a small memory footprint by using dlls (and .so’s on linux) that get loaded when an operation is needed. Such operations will be divided up into 3 segments. Client connections, database operations, and information retrieval from a central server. When any operation isn’t being use for a small amount of time (2 minutes lets say), free that memory and unload the modules therefore using a very small amount of memory (barring no leaks).

Client Goals:

  • Be very stable
  • Quick
  • Don’t interfere with normal program usage
  • Be able to use an alternate means of updating

I think providing a plugable means to run updates is a must. If plugin x isn’t available, don’t connect to the daemon, if y isn’t available, don’t use a more comprehensive HTTP method, and if nothing is present, fall back on a very simple TCP connection.

Here’s a sample (and simple) diagram:
VUS Client/Server Model

On the Other Hand

Many It related exams like 1z0-147 are very popular among IT people. They want to seek help regarding their preparations that can be obtained by various websites. To explore microsoft certification can be explored through books and after getting command on it, the chances of good employment increase. The exam 70-122 is quite an effective option if you are looking to upgrade your IT skills. The exam code FN0-125 represents the examination of Foundry Networks Certified Network Engineer (FNCNE). The exam code NO0-002 Nokia Security Administrator can be booked online in many countries using major credit cards. The exam HH0-120 guide kit can be purchased online which contain testing practice software and manual, other than this the exam 9L0-207 Apple Portable Service Exam is considered a must since the popularity of Apple portable products.

Powered by WordPress with Pool theme design by Borja Fernandez. I rewrote the CSS because I'm cool like that.
Entries and comments feeds. Valid XHTML and CSS. ^Top^