What does a geek do...

Two beginner level VC++ arcticles posted on CodeProject

There are so many programmers out there started with high level languages: VB/Java/Javascript/SQL/.NET/Python. Many of them have "decades" of coding experience but rarely touched C/C++ (if not never ever touched).

Is that "sad"? Not necessarily. It really depends on how you look at it and how much you know about it.

C/C++ is the parent of all those "high level" languages. It was invented for good reasons, is existing and evolving for good reasons, is evading and being replaced also for good reasons. Without knowing any of above, but blindly ignoring it, downplaying it, or being scared of it, is SAD for any self-esteemed programmer, because he/she missed A LOT.

Among all the excuses, scaring of the complexity of C/C++ syntax and IDE is probably the biggest hurdle of all. That drove me to write the two beginner level C++ articles. 

Me myself picking VC++ IDE is just personal preference because I started with Borland C/C++ IDE 2.5 decades ago and moved  to Visual Studio IDE naturally and gradually. 

Here are URLs:

A super easy DLL made in VC++ IDE, especially for the first time tasters

Cool dummy volume meter in "DOS mode", a fun starter project for anyone who wants to know a little more on VC++ IDE and Win32 Core APIs

The first article is really "super easy". I'm not bragging: I doubt there is any easier VC++/DLL example in the whole world ;-)

The second article is really fun and also showing you great stuff about Win32 and hardware. I even made a youtube video for the demo. Wish you enjoy them as I did:



A camera trick to get real sharp focus on remote object

The other day, I figured that I can use my old gadget toy to shoot photos as shooting from a real 1000 mm telephoto lens. Well not quite the same, but close enough.

A decent 1000 mm telephoto lens, you know the look: strong & thick tripod + super fat & long coned tube. It easily costs at above $10K.

My gadget toy is just an entry level astronomy telescope. I bought it years ago during the Christmas, $200 something, thought it's a good deal. This good deal has been collecting dust since right after the purchase...

Months ago, My inside geek pushed me to hook my DSLR to it and see what I can get. I did just that, shot some interesting long distance objects such as sunsets (so stunning beautiful by the way). I'm pleased with the results and like to share my methods. 

Lots tricks on how to shoot long distance objects, but the single most important one is how to get a sharp focus.

Let me explain it in more details here:

(1) What is long distance object (or far way object)? Super big sun/moon, a landscape detail (such as a building's window) 2+ kilometers away, a soccer player's face while the person on the other side of the field, a wild animal chasing another one, they all sure count as long distance objects.

(2) Attach camera body (without any camera lens) to a telescope (cheap) or telephoto lens (expensive). The whole set is quite heavy and you need a sturdy tripod. I'm lucky to have a one which came with that $200 gadget package. The connector/adaptor which connects the camera body and telescope is called "extension tube T-Ring" , priced at around $10-15 on Amazon. This connection setup is also called "prime focus" method. Basically, it's named because the camera is body only without any lens attached, but still has a focus called "prime focus" (The camera body has internal optics which can be seen as an abstract lens, my understandingļ¼‰. My Canon's prime focus is 22 mm. The whole setup has about 45X magnifying power (1000 mm / 22 mm----> object lens focus length divided by eyepiece lens focus length, some basic optics...).

(3) The expensive telephoto lens can give you very cool auto zooming focus features, but I'm talking about manual focus for cheap telescope-camera setup. So, just put our camera in manual mode like below:

(4) Aim at the long distance object, usually 2-3 Kilometers away. In my experience, 2 to 3 kilometers are still good for "sharp" focus. If it's further, the atmosphere condition kicks in (e.g. the thickness of the haze, hot/cool flow effects, air layer density differences), you won't get sharp focus no matter what. Once you point to the object, manually adjust the focus to an acceptable image. It's called "coarse tuning", "flat tuning" or just round-1 tuning if you prefer.

(5) After the "coarse tuning",  push the electronic zooming to "X10" or "10X". This means to make the viewfinder's view 10 times bigger than usual. This doesn't change the real optical zooming at all.

(6) In the 10 X "bigger" viewfinder view, It's very likely that you lose the previously pinpointed object in viewfinder. To find it again in viewfinder, you need to click the cursor arrows. Not tripod, not camera, but camera viewfinder cursor arrows. Usually these buttons are like below:

See red marked buttons? they might not appear as arrows because the camera uses the same physical button for different functions. In cursor moving function, they just mean up, down, left, right. If it's really hard for you to locate the target object in 10X view, do 5X view first, similar process, but easier to find the target, then go 10X.

(7) patiently press those cursor buttons until you see the detailed object again in the viewfinder. Once you see it, it's much bigger (10 times bigger) and blurred.  Now it's time to do your "fine tuning" under this 10X mode (by very slightly turning the telescope knob in my case). The goal is to satisfy yourself with maximum details you can get. In this example, I targeted the red flash light (although it looks more like a bottle of juice).

Once you have 10X focusing satisfied, you can click the zoom button again back to normal composing view. Now your photo should be "sharp focused", at least that's the best result your camera hardware and air condition can offer at that moment.


This is what I got as an example (3+ kilometers away) ļ¼š



(1) This method uses landscape/building object as the example. But it can still apply to normal lens and other shooting objects. I have tried this method to shoot milky way (by focusing on either long distance light tower or even Mars or Jupiter first).

Sunrise and Sunset are a little bit special. It turns out that as long as you have clear focus on any far away objects (similar size in viewfinder as the sun is), then you get clear shots. See my previously posted sunrise shot here.

(2) NOTE: don't directly point your tube/lens to the sun after the sunrise or before the sunset. It will damage your eyes badly. Please don't!


ExcelPic - Excel Pixelating Image Creator (source code also available)

This little app is mainly created for fun. All it does is to use Excel worksheet cells as pixels to render a real image.

Some experiments in programming here and there, maybe (.NET, C#, Interop, COM+ etc.) 

To run this app, you computer needs 

(1) .NET framework 4.5 installed (most reasonably patched/updated windows PC  should qualify)

(2) Office Excel properly installed (Office 2010 or above)

You can download the zipped EXE here: (9.42 kb) (NOTE: this URL is located at server)

To See its real action on YouTube:


Three screenshots also posted here:

- The source code....


 - Rendering in Excel....

 - Result here (recognize this young man?)


I also post my source code and detailed technical explanation on

 (You do recognize this is young Bill Gates right?)

A geek's taking on sun rising @ the Lake Ontario

(Click the image to view larger version on Flickr)

It's a pure nature magic!

If you keep staring at those blinking waving sun rays, you will soon fall into day dream mode, for sure!

The photo was taken via a cheap telephoto lens called Opteka 500mm f/6.3

It looks weird because it's not a glass lens. It's a mirror lens. It relies on concave mirror to collect lights and reflect them to camera CCD. Usually concave mirror is much easier to make than glass with similar power. However, since it's fixed mirror so it lacks of all those fancy automatic features (auto focus, anti shaking etc). You basically need to adjust everything manually. That's why the price is low, at around 100 CAD (comparing to those 1000+$ lens).

Since this is a geek blog, I'd like to throw more info on you;-)

In theory, this "mirror" lens is no difference than a typical Newtonian Reflector Telescope . 

I enjoy the whole immersive experience of this photo taking experience: 

- study the object and make a plan

- drop myself at certain point at certain moment

- set up the tripod and gears

- adjust the gears manually

- take shots

- post processing

Of course, To finally sharing the result is part of the fun, but as long as you enjoy the previous parts, it's already worthwhile.