Monday, May 6, 2013

Brazilian progressive music

Well-made progressive music is just amazing. There’s not much to write about this one – lyrics (see here and here), arrangements, actual playing, mixing – there are no flaws I can spot. I’ll just leave this here and appreciate:



Unfortunately the other songs of the band are not good as this one – not even close, actually. But this very one song is so exceptionally good that the guys can die in peace.

Sunday, April 21, 2013

jQuery facepunches old IE versions

The jQuery team announced that they dropped support for Internet Explorer 6, 7 and 8 on the v2.0.0 of the library. That’s one huge and important move. First, because jQuery is widely used worldwide, and even endorsed by some big companies like Microsoft and Google. Second, because these versions of Internet Explorer still have a considerable percentage of the market share as of today. The jQuery guys announced that v1.9.x will still support these old IE versions, but who knows for how long.

This made me think the primary reason that jQuery was conceived for: a thin layer of cross-browser compatibility. If the library is not so widely compatible anymore, isn’t it losing its main reason to exist? Or maybe it’s heading towards becoming a framework like many others, just providing some useful and funny tricks.

I’m not against this decision, but given the wide adoption of jQuery in the wild, maybe it’s too early to force the migration to the latest IE version. Although when I think of the real pain that is to develop to those terrible browsers, I just raise my hands and scream hallelujah, they finally did it!

Friday, March 15, 2013

The best SRT editor for subtitles

After a couple months of work, it has just been published on CNet’s Download.com my newest program: SRTEd, a visual and portable editor to SRT files for Windows.

Basically, I decided to write this program because I had to edit some subtitles a while ago, in SRT format, and the available editors were quite tedious and painful to use. I somewhat got this insight of a more visual editor, and some time later I began writing it. The most important thing to “get the feel” is the use of the keyboard arrow keys to sync the subs. Left/right arrows move them, and when holding Shift key, change the duration. This makes the sync incredibly easy to do, visual.



Technically, the program is pure C-like C++ (that’s how I define my own C++ style) and native Win32, so it’s really light and fast. To video playback, it uses DirectX infrastructure. Moreover, SRTEd uses my own Win32 object-oriented library, which I plan to release as open source some day.

Here’s a getting started video:



CNet download link: SRTEd - SRT Subtitles Editor.

Update: I just received an e-mail from Softpedia, they published SRTEd on their site too.

Wednesday, February 20, 2013

KRK VXT frequency charts

As looking for a pair of studio monitors, I wanted to have a comparison between the three KRK VXT series models: VXT4, VXT6 and VXT8 – cones being respectively 4, 6 and 8 inches. I got the individual charts from KRK website, and I just made a collage with the three. This is what I ended up with:



It’s easy to spot how the low end increases with the cone size. Many people recommend a subwoofer, but not everyone has an appropriated room to fit everything. Indeed, in my case, I can hardly fit anything larger than the VXT4 on my desk, so I’ll probably have to stick with the VXT4 or other monitor with similar size, like the Yamaha HS50M – although I found these too bright and lacking in lows, rather unpleasant.

And the quest for my new home studio monitors goes on.

Update: after a lot of research and some listenings, I ended up picking up the KRK VXT4, which not only sounds really good, but also fits my desk. I’ve got a new pair for a good price, and I’m pretty satisfied so far.

Thursday, February 14, 2013

Reading version from EXE and DLL files

Here’s a C++ and Win32 class to read version information from the resource section within EXE and DLL Windows binaries. The key functions are GetFileVersionInfo and VerQueryValue. The object will provide public pointers to the strings; these pointers should not be deleted, since they point straight into the allocated data block. If version information can’t be read – for example, if it’s a file with no version information – the load method will simply return false.

There’s room for more improvements, like tighter error checking, but it’s pretty usable:
#include <Windows.h>
#pragma comment(lib, "Version.lib")

class VersionInfo {
public:
	const wchar_t *pComments, *pCompanyName, *pLegalCopyright, *pProductVersion;

	VersionInfo() : _data(NULL),
		pComments(NULL), pCompanyName(NULL),
		pLegalCopyright(NULL), pProductVersion(NULL) { }

	~VersionInfo() {
		if(_data) free(_data);
	}

	bool load(const wchar_t *path) {
		DWORD szVer = 0;
		if(!(szVer = GetFileVersionInfoSize(path, &szVer)))
			return false;
		_data = (BYTE*)malloc(sizeof(BYTE) * szVer);
		if(!GetFileVersionInfo(path, 0, szVer, _data))
			return false;

		UINT len = 0;
		VerQueryValue(_data, L"\\StringFileInfo\\040904b0\\Comments",
			(void**)&pComments, &len);
		VerQueryValue(_data, L"\\StringFileInfo\\040904b0\\CompanyName",
			(void**)&pCompanyName, &len);
		VerQueryValue(_data, L"\\StringFileInfo\\040904b0\\LegalCopyright",
			(void**)&pLegalCopyright, &len);
		VerQueryValue(_data, L"\\StringFileInfo\\040904b0\\ProductVersion",
			(void**)&pProductVersion, &len);
		return true;
	}

private:
	BYTE *_data;
};
Usage example:
{
	VersionInfo vi;
	if(vi.load(L"C:\\Program.exe")) {
		OutputDebugString(vi.pProductVersion);
		OutputDebugString(vi.pComments);
	}
}
Can’t be simpler than that.

Like Firefox? Try Pale Moon

When it comes to internet browsers, overall, I prefer Firefox behavior over Chrome’s. But when using Firefox 18.0.2 on Windows 7 x64, I started to become increasingly angry with its memory usage. Even with only 4 tabs opened, Firefox peaked 800 MB of RAM easily, like not releasing memory at all. This was making Firefox really slow, a pain to use.

Searching around, I found Pale Moon. Basically it’s Firefox compiled specifically for Windows, letting out compatibility with older processors, all compiler optimization switches on, and also some minor changes done by the Pale Moon mantainer, which follows Firefox with some gap, waiting for the bugs to be fixed. Pale Moon seems to release memory faster, and on my tests, the RAM usage floats around 300 MB, compared to 800 MB on Firefox. On the use, it’s noticeably faster, a joy.

I’m testing a portable version of Pale Moon 15.4.1, and so far I’m very pleased. All my add-ons worked fine. I totally recommend it as an alternative to Firefox itself.

Sunday, January 20, 2013

Adobe Source Code Pro font

I’ve just downloaded the new open source monospaced font from Adobe: Source Code Pro. I’m using it at 9pt size on Windows, and it has the same vertical and horizontal size of Microsoft's acclaimed Consolas font at 10pt – it means each character occupies the exact same square of pixels. Coincidence? Maybe not. Consolas is a great coding font praised by thousands of programmers around the world, so it’s natural that it could have been used as parameter.

My impression so far is that Source Code Pro looks lighter than Consolas, with less cluttering. It looks like a crossover between Consolas and Inconsolata, a font which looks absolutely great on Linux, but bad on Windows.

On Linux, Source Code Pro at 9pt renders as good as in Windows. It occupies the same horizontal spacing of Inconsolata at 10pt, but more vertical spacing. Too much vertical space, in my opinion; at 8pt, the font is too small if compared to the line height it has. It would be a lot better if this vertical space could be cut down. And the bold is too bold.

Source Code Pro can be downloaded at SourceForge, and the project is hosted on GitHub, which is a great initiative.

I’m really picky about the font I code with – in fact, I’m absolutely paranoid about it, I often change the font I use –, and I consider Source Code Pro worth trying on Windows, I can stare at it for hours without getting tired. Definitely added to my monospaced fonts collection, and from now on, the default monospaced font on this blog!