Thursday, September 22, 2011

Brown polarized sunglasses are great!

I used to wonder why someone would want brown or amber sunglasses. Why add a colour cast to everything? Now I know. The colour:
  • decreases sky brightness, equalizing the overall brightness of the scene
  • removes glare, while still making the scene appear bright in a pleasant way
  • accentuates green foliage and various other colours
  • makes hazy days seem sunnier
  • helps decrease glare when driving toward the sun
(Blue-grey sunglasses are the opposite. They dim things relative to the sky, they make foliage look worse, and they aren't very effective at decreasing glare. I don't want those ever again.)

Polarization is also an important enhancement. It:
  • decreases the intensity of annoying bright reflections from non-metallic surfaces, such as reflections from the paint of cars or bodies of water
  • increases colour saturation by removing reflections (Foliage reflects a lot of light, and looks much greener when that reflection is blocked. Water surfaces also reflect light, and when that reflection is blocked, the colours of the water itself stand out.)
  • makes the sky darker and bluer in certain directions, making clouds stand out and helping equalize the overall brightness of the scene
The only downside of polarization is that the intensity of the effect depends on the orientation of the glasses.  It is most optimal when the sun is highest in the sky. Near sunset, the sunglasses need to be turned sideways to create a strong effect. Sometimes, I thought about creating electronically controlled polarized sunglasses using camera filters and a microcontroller.

When buying polarized sunglasses, it's important to check whether the effect works well. Turn the glasses and block some reflections. Cheap glasses may not be able to block reflections very much, or the blocked reflections may show a strong purple colour cast.

Monday, August 29, 2011

Stores selling cheap stuff from China

There are many online stores which sell a wide variety of cheap stuff from China, usually with free shipping. The prices can be impressively low, but the quality is sometimes questionable.

DealExtreme seems to be the most popular one. So far, I've ordered several items from there, and overall I've had a good experience. I'm using the 10W 500-Lumen Multi-Color RGB LED Emitter Metal Plate (140 degree) in my RGB lamp, and I'm happy with it. Their 5mm white LEDs are also good, with a nice colour and good brightness. I also got a nice 55mm lens cap.

So far, I've only had one problem with DealExtreme, and that was resolved in a good way. I ordered what was at the time advertised as a Massa circular polarizer for my camera. The packaging and item I received made no mention of Massa, and the item looked different. When I contacted DealExtreme, I got some store credit. The polarizer does provide decent photos as long as I don't zoom much, and I really like some photos I took using it. I also see that DealExtreme updated the item description and photos, showing what I got. As a result of all of this, I'm satisfied.

My favourite thing about DealExtreme is the reviews and forum posts. They seem genuine, and they provide useful information about the products. Yes, DealExtreme does sell some bad products, but the reviews and other information make it possible to avoid most of these.

The only real complaint I have is that some simple actions (such as redeeming store credit or DX points) require customer service interactions. These things would be easier and faster if automated. However, customer service always responded promptly, so this is not a major issue.

The main thing that motivated me to write this post is my first purchase from DinoDirect and what I saw when I spent more time on that site. It's a big contrast; DealExtreme is much better. For example, check out what other people have to say about DinoDirect, and look at the quality of item reviews on DinoDirect.


Monday, August 15, 2011

I'm still using Adobe Reader

Despite the bloat and all the people who hate it, I'm still using Adobe Reader to view PDFs in Windows. Recently, it was slow on one huge PDF on my laptop, so I decided to try out some alternatives.

Sumatra PDF was pretty good and a bit faster, but zooming wasn't as user-friendly. I didn't like Foxit Reader's user interface. It seemed like an old badly designed Linux application. PDF-XChange Viewer was pretty good, but it also had an inferior zooming user interface. The biggest problem was that all three had slow search in large PDFs, without acceleration via saved indexes like Adobe's Fast Find.

It would have been nice to switch to something leaner, but it's not really a problem. I found that disabling 2D graphics acceleration in Adobe Reader resolves the performance issues on my laptop.

Sunday, August 14, 2011

Bad capacitors and ESR testing

I have an old Soltek SL-65KVB motherboard. It was taken out of service due to AGP graphics instability which was probably due to bad capacitors. This diagnosis seemed pretty obvious because capacitors right by the AGP slot were bulging, but I didn't bother fixing the motherboard because it was a good time for an upgrade.

Now I would like to repair the motherboard, mainly because the combination of a Pentium 3, 640MB of RAM and an ISA slot could provide a nice way to use old hardware. By now, even more capacitors are obviously bad. However, only the GSC 1000µF and 1500µF 6.3V capacitors with gold/brown lettering have obvious problems and more numerous smaller GSC capacitors with silver/white lettering seem fine.

I didn't feel like unnecessarily replacing the smaller capacitors, so I quickly built a very simple capacitor ESR tester. The basic idea is the same as various other ESR measuring devices documented online: a stepdown transformer outputs low voltage and low impedance pulses which are used to measure capacitor ESR. I built the stepdown transformer from an inductor with a short secondary wrapped around it, and I used a 555 chip to supply low duty cycle pulses at high frequency. The 555 can supply enough current that it's possible to directly drive the transformer with a resistor in series with the primary.

My first attempt with a secondary of just a few turns worked pretty well when capacitors were plugged into the breadboard. However, test leads had enough impedance to make the circuit useless. Reducing the oscillation frequency to around 100 kHz and adding more turns to the secondary improved performance, making the bad capacitors very obvious. Test leads were still a problem however. Adding a 1Ω resistor in series with the secondary improved the situation significantly, so I proceeded to test the small capacitors on the motherboard via test leads.

It seems the small capacitors are all ok. However, among the large capacitors, even most that weren't bulging are bad. Only two of the ten 1000µF capacitors have a low ESR. Of course, considering the other failures, these shouldn't be used for anything either.

Wednesday, August 03, 2011

g++ dyamic linking fail

I have a DLL which works when built, but stops working later. Simply rebuilding it creates another copy which again works and stops working later. LoadLibrary returns error 998, which mean "invalid access to memory location". In other words, a crash occurs in the DLL being loaded. The crash occurs when calling _initterm from code at the DLL entry point. At __imp__initterm there should be a pointer to _initterm in msvcrt.dll, but the location instead still contains the value that's in the file on disk. As a result, if msvcrt.dll is located at a different location, the program jumps to the wrong location. I guess this happens because msvcrt.dll is imported two times. The first import just uses _write, which is properly dynamically linked. The second import lists all the other functions that are used, and dynamic linking wasn't done for any of those. The _write from the first import is just used to print "pure virtual method called\n".http://www2.blogger.com/img/blank.gif

I suspect that g++ is to blame, but I'm still not sure. The problem is now happening with g++ 4.5.3 from the 32-bit MinGW-w64 Cygwin package, but the same symptoms occurred when using the old Cygwin compiler that is based on GCC 3.

Update: The problem seems to be related to statically linking libstdc++. The duplicate msvcrt.dll exists when using -static or -static-libstdc++ (new in GCC 4.5).

Update 2: Packing the DLL with UPX 3.07 seems to fix the problem. When a packer compresses the IAT, it needs to handle dynamic linking. Apparently UPX is able to properly handle the defective IAT.

Wednesday, July 20, 2011

No, I can't trust Windows with very rare operations.

While my computer was writing to a 3½" floppy disk via the floppy controller on my motherboard, I pushed the sleep key, requesting S3 sleep. Right after that, I remembered how Windows cannot really be trusted when doing unusual things. I started to wonder if I'll see a bluescreen, but all I saw was sleep being delayed by lengthy floppy activity. When I came back, I was not too surprised to see a bluescreen. The source of the crash was a bit surprising however: usbser.sys had submitted an IRP that was already pending in the USB bus driver. I guess delays from the floppy driver triggered a bug in usbser.sys. This was failure bucket 0xFE_usbser!RestartNotifyRead+73. It was usbser.sys 6.1.7601.17514 (win7sp1_rtm.101119-1850), so this really is a component of Windows, and not a 3rd party driver.

Tuesday, May 31, 2011

Review of battery and AC adapter from LaptopCharge.com

About a year ago, I got a new LDE203X battery and AC19V90K1 AC adapter for my Inspiron 6400. I ordered from LaptopCharge.com, and I'm satisfied with that choice, the site and the items.

Basically, there were three choices for getting a battery and AC adapter: Dell, eBay, and other stores like LaptopCharge.com. Dell ridiculously overprices these things, so I didn't want to buy from them. However, I noticed that some people didn't trust third party batteries, and many people said third party batteries wear out more quickly. I also noticed that most eBay sellers didn't list a brand or part number for their batteries, which seems shady. I chose LaptopCharge.com because is a store that has been around of some time, and they sell Dr. Battery brand products. The price wasn't much higher than the best prices on eBay.

After placing my order, it arrived promptly and in good condition. Everything was packaged well inside, and the battery and AC adapter were in their own boxes. I was however unsure about whether the Dr. Battery brand meant anything. The logo only appeared on hologram stickers which were haphazardly stuck onto the battery and adapter.

The battery is a good, though not perfect fit. It takes slightly more force to engage the latches, and the thicker side sticks out a fraction of millimetre. This is totally inconsequential.

The battery charges properly and only gets very slightly warm. When it's done charging, the battery light keeps flashing occasionally, like during the topping up part of a charge. Also, if the battery is discharged to 98% or 99% and power is plugged in, Windows reports that the battery is charging but the level doesn't increase. In both of these situations, BattStat shows about 11 mW of power input, and a voltage which is well below 4.2V per cell. This seems like a very slight miscalibration of the current gauge. None of these things are a problem. (It is normal for lithium-ion batteries to require more than a few percent discharge to trigger charging.)

Just like the original battery, the replacement battery has a LED bar graph for checking battery level. It works, although the button that activates it requires more pressure and doesn't have a nice clicky feel. This is a bit of a disappointment, but certainly not a big problem.

Low battery shutdown works perfectly. The capacity decreases smoothly, and hibernation is triggered appropriately. I did not test discharge to the point of power cutoff.

During the last year, I was careful with the battery. I took it out when using my laptop on AC power for extended periods, and whenever I stored the battery, I kept it at around 40%. I still don't see any capacity degradation.

The charger looks very similar to the Dell charger, but it is bigger. This may be because it is 90W, while my Dell charger is 65W. It has a longer AC power cord, but a shorter DC cord. This is less convenient than the Dell charger. The AC cord doesn't bend where it exits the charger, which is nice, considering that I don't want to wrap the cords on the charger because of the stress that it causes.

I don't like the original Dell charger because it is noisy. It makes chaotic buzzing and beeping noises when the laptop is running and especially while the battery is charging. When in sleep mode, it produces a chirping sound as the power LED pulses. When I'm going to sleep in a quiet place, this sounds kind of like night crickets, except it's kind of annoying. The Dr. Battery charger is much quieter. I need to be closer to hear the sounds it produces, and there are no bothersome sounds in sleep mode.

Even though the Inspiron 6400 shipped with a 65W charger, it properly recognizes the new 90W charger and makes use of the additional power. With the original charger, charging slows down when the laptop is on and doing demanding tasks, and with 90W available, charging does not slow down. (BattStat can show these things.) However when charging and doing ordinary non-demanding things, the charger gets so hot that it is on the verge of causing 1st degree burns. Because of this, I wouldn't like to do constantly demanding things while charging or use the charger with a laptop which is designed to require 90W.

When I was wondering about the bar graph on the battery, I contacted Dr. Battery and LaptopCharge.com and got prompt replies. Based on this, it seems that the technical support and warranty can be trusted.

Saturday, May 14, 2011

A quick OS comparison

Windows is the de-facto standard OS. Over time, it has been enhanced to the point where it's stable and it contains practically all the features one might want. Its main advantages and disadvantages relate to its popularity. It has the greatest selection of software and support for a very wide variety of hardware, but it also has the greatest variety of malicious and deceptive software that users have to watch out for.

Mac OS X is pretty and it provides a pleasant user experience. However, it has various limitations, some of which can force one to use Windows for some tasks. It's also tied to expensive Apple computers, and it has worse hardware support. It's a good choice for those who don't do stuff that runs into the limitations and don't mind paying extra for computers.

Linux is free and there is a large selection of free software that can run on it. Some of that software is incomplete, buggy and/or ugly, but there is high quality free software. Linux has some limitations due to not being the de-facto standard, but the situation is better than with Mac OS. The main disadvantage is that a lot of GUI software is kind of awkward and not pretty, as if it was designed by programmers rather than skilled user interface designers and graphic designers.