Saturday, November 27, 2010

Pretty Formatting for XML or HTML

Sometimes it's helpful to pretty up XML or HTML in order to more easily analyze it. Many tools create machine-readable XML or HTML, which is well-suited to being parsed by computers, but whose formatting can be painful for a human to wade through. 

You might think, why do humans need to be able to work with machine-readable text, anyway? Well, if you happen to be the new guy on the job and get stuck with having to debug some code that spits out some XML or HTML you've never dealt with before for some complex data transformation processing, you can see why it might be necessary, particularly if something changes between the sender and receiver and the XML, as produced, no longer does the job.

In Notepad++, one of my favorite text editors, I can utilize the TextFX plugin to take a given chunk of XML or HTML and clean it up, neatly indenting the nodes and attributes for easier examination. I paste the text into the editor and select TextFX => TextFX HTML Tidy => TiDy clean document - wrap. Finally I select Language => XML or HTML to enable syntax highlighting.

Prior to discovering Notepad++, I had discovered the freeware MoreMotion XML Editor a few years ago when I was having to dissect some XML being output by a tool whose XML output I needed to clean up. Provided the XML was well-formed, I could very quickly pretty it up by clicking XML => Pretty Format, or even more easily with a quick key combo, Shift-Ctrl-P.

BEFORE: Messy, messy XML!


AFTER: Ahhh, clean, legible, structured XML.

Unfortunately, the original download URL for MoreMotion XML Editor appears to be defunct, leading to a parked page rather than the actual file. You can download MoreMotion's more comprehensive XML application suite here, but if you just need relatively simple XML editing provided by the older (and much smaller, around 1.3 MB) freeware tool, this working download link fits the bill. The ZIP file contains the EXE, which can be copied to a convenient folder and run.

A few caveats, however. MoreMotion seems to have a few editing issues with extremely long lines of text; you may notice keypresses on such lines may take a long time to register. Also, whereas Notepad++ will do its best to deal with poorly-formed XML or HTML and log any errors it encounters, MoreMotion will not allow you to proceed until the errors are resolved, and in my experience some of these errors can be difficult to pin down.

Nevertheless, for relatively small chunks of well-formed XML or HTML, MoreMotion XML Editor makes cleaning up XML or HTML just a few steps quicker than Notepad++.


Friday, November 26, 2010

Dell Latitude E6410 Sound Problems

The time came a few months back at my workplace to replace my venerable Dell Latitude D800 with something newer, better, faster. That replacement arrived in the form of the Dell Latitude E6410.


Dell Latitude E6410


Featuring an Intel Core i5 64-bit CPU, 8 GB of RAM, and Windows 7 Pro, I expected great things, and in many respects, I got them. Performance was leaps and bounds ahead of my old D800; tasks that my D800 plodded through like building and debugging an ASP.NET / C# website or searching through thousands of files in my local source repository proceeded many times more quickly. 


Unfortunately, I was dismayed to discover that the sound provided by the onboard IDT HD92xxx device, utilized by the NVIDIA NVS3100M video hardware, stuttered frequently. Whereas my old D800 never missed a beat, literally, even through the most challenging tasks, this brand-new, supposedly state-of-the-art machine couldn't play MP3 audio without hiccuping many times throughout any given track!

Apparently this is not an isolated issue. One thread on Dell's support forums described many users' similar issues with erratic sound. Various other posts online that I found blamed the IDT hardware, such as the first review listed for this related IDT product, followed by a couple of other reviews for same which immediately reminded me of good old Baghdad Bob...

"good, and very nice"

I decided to take a reverse shotgun approach, meaning rather than pump a few satisfying rounds of buckshot into my employer's laptop out of sheer aggravation, I'd run through a short list of steps based on research I'd done into the problem so far.

To visualize the problem, I downloaded and ran the DPC Latency Checker, which represented the stuttering issue in the form of the big, ugly red lines representing relatively huge latency leading to stuttering audio.


If I were typing the way the audio stutters, it miiiight look liiiike ttttthhhis.

Dell Latitude E6410 driver download page
on Dell's support site was my first stop. I downloaded the latest available drivers and installed them, including those for audio, video, chipset, and even the touchpad. Following the experiences related by others in the Dell support forum, I also updated to the latest BIOS.


Updating the BIOS, as described in the Dell support forum thread, helped things somewhat, but the stutter was still recurring intermittently. I also completely uninstalled Dell ControlPoint System Manager, which I noticed made the stutter markedly worse when active.

I also tried using PowerMizer Manager, a free utility which lets you control and, if desired, prevent your video adapter from downshifting performance based on demand, which can cause undesired latency.

Most recently, though, after installing the latest drivers supporting the NVS 3100M from NVidia's driver download site, I've found that the stutter has improved significantly. Now, the DPC utility shows that latency is overall much improved, but still the stutter occasionally rears its ugly head.


Definitely better than before.




In summary, here are some suggestions if audio stutters on your Dell Latitude E6410:




Thursday, November 4, 2010

A Thousand Words Isn't Enough

They say that "a picture is worth a thousand words". Personally, I think the value of photos is overrated.

No photo, digital or otherwise, carries the essence of the memories in real life that photo captures. As we travel down the river of time, our motion through it is like watching a film with the afterimages remaining in our trail behind us, kind of like light painting.

These "pictures" are one with the space-time continuum, and only someone with the ability to encapsulate this and peer inside could see the entire span of all these images across all time, somewhat like looking into a peephole from outside our realm of existence.

It is truly mind-boggling to think of the data storage requirements for that kind of recording, for every moment of motion of every iota of matter all across the universe for all time. If I were some Q-like being that could freely travel across time and make such observations and manipulations as an outsider, I'd probably go back to my physical life like a universe-scale photo album or video and play it back, in all aspects.

Alas, I don't have that power, but it's not like snapping a photo will do any better than my brain's comparatively feeble but nevertheless serviceable chronicle of my life. Whether a photo, a video, or the final, frantic firings of the synapses of my brain at death, "All those moments will be lost in time... like tears in rain."