I Like Everything Redux

A friend points out the fact that no on would ever use something like I Like Everything on their real personal account. I have to concede the point that, well, the plugin just turns the Like button clicks into a huge shared web-history, and no one really wants all that Like spam anyways.

In any case, as a proof of concept plugin for Chrome, I’m happy with what I learned about the Chrome extensions system and happy the thing worked. I’ve got another idea that I code up at some point, so the groundwork will transfer.

I Like Everything

I’ve written a new Google Chrome extension called I Like Everything.

The purpose of this plugin is to click all of the Like buttons is detects on the webpages a user is browsing, theoretically making it more difficult to separate the things one Likes from the things one doesn’t. After all, if you Like everything, then really you don’t Like anything.

The extension code, with instructions on how to install it, is at: https://github.com/nuket/ile

Capturing Video / Converting Hi8 Using avconv With Conexant/Brooktree 878 Tuner Card

These are some notes I took while converting some old Hi8 tapes I had into H.264 format for archival.

The biggest problem I ran into was available CPU horsepower. Anything less than a Core2Quad is probably not going to cut it for realtime Main Profile encoding. It will simply drop huge numbers of frames. I had a Core2Duo at the time and had to swap in 2 more cores. Encoding a 720x480p stream using the Main Profile at 6 – 8 mbps caused three of the cores to saturate during the entire process.

The commands I used to set up the capture were as follows.

Setting to use Composite input

$ v4l2-ctl -i 2
Video input set to 2 (S-Video: no hsync lock.)

If you don’t select the correct input channel, the avconv call will usually see a blue “no signal” screen.

Setting to use NTSC standard

$ v4l2-ctl –set-standard ntsc
Standard set to 0000b000

If you don’t select the correct broadcast / line encoding standard, your images will look all messed up, aspect ratio could be affected as well.

Capturing 480p Using avconv With x264 And AAC

$ avconv -f alsa -i pulse -f video4linux2 -channel 2 -video_size 720×480 -i /dev/video0 -codec:a libfaac -b:a 192k -codec:v libx264 -b:v 6144k -vprofile main Output.mp4

The settings in play here are:

  • -f alsa -i pulse —

    Selects the audio input. On Ubuntu, PulseAudio needed to be the input device, or I would get a hang.

  • -f video4linux2 -channel 2 -video_size 720×480 -i /dev/video0 —

    Selects the video input and parameters. Channel 2 is the S-Video input of the card I was using, and is the same number used in the v4l2-ctl command above.

  • -codec:a libfaac -b:a 192k —

    192kbps AAC encoding

  • -codec:v libx264 -b:v 6144k -vprofile main —

    6144kbps Main Profile H.264 encoding

I have to say here that I’m very glad the avconv authors finally cleaned up the command-line syntax from the bad old days of the ffmpeg command-line parser. It’s a breath of fresh air to have options finally make sense and follow some pattern that is easier to remember and behaves consistently.

dmesg

[ 28.022337] bttv: driver version 0.9.19 loaded
[ 28.022340] bttv: using 8 buffers with 2080k (520 pages) each for capture
[ 28.022784] bttv: Bt8xx card found (0)
[ 28.022799] bttv 0000:05:02.0: PCI INT A -> GSI 23 (level, low) -> IRQ 23
[ 28.022813] bttv: 0: Bt878 (rev 17) at 0000:05:02.0, irq: 23, latency: 64, mmio: 0xf6ffe000
[ 28.023134] bttv: 0: detected: Leadtek WinFast TV 2000 [card=34], PCI subsystem ID is 107d:6606
[ 28.023137] bttv: 0: using: Leadtek WinFast 2000/ WinFast 2000 XP [card=34,autodetected]
[ 28.023246] bttv: 0: tuner type=5
[ 28.028205] i2c-core: driver [msp3400] using legacy suspend method
[ 28.028208] i2c-core: driver [msp3400] using legacy resume method
[ 28.048071] bttv: 0: audio absent, no audio device found!
[ 28.052130] i2c-core: driver [tuner] using legacy suspend method
[ 28.052133] i2c-core: driver [tuner] using legacy resume method
[ 28.061435] tuner 1-0061: Tuner -1 found with type(s) Radio TV.
[ 28.074112] tuner-simple 1-0061: creating new instance
[ 28.074115] tuner-simple 1-0061: type set to 5 (Philips PAL_BG (FI1216 and compatibles))
[ 28.075195] bttv: 0: registered device video0
[ 28.075265] bttv: 0: registered device vbi0
[ 28.075335] bttv: 0: registered device radio0
[ 28.075385] bttv: 0: Setting PLL: 28636363 => 35468950 (needs up to 100ms)
[ 28.077748] [drm] Supports vblank timestamp caching Rev 1 (10.10.2010).
[ 28.077751] [drm] No driver support for vblank timestamp query.
[ 28.090043] IR Sony protocol handler initialized
[ 28.104182] bttv: PLL set ok

cat /proc/asound/cards

0 [Intel ]: HDA-Intel – HDA Intel
HDA Intel at 0xf7ffc000 irq 46
1 [Bt878 ]: Bt87x – Brooktree Bt878
Brooktree Bt878 at 0xf6fff000, irq 23

cat /proc/asound/devices

1: : sequencer
2: [ 1- 1]: digital audio capture
3: [ 1- 0]: digital audio capture
4: [ 1] : control
5: [ 0- 1]: digital audio playback
6: [ 0- 1]: digital audio capture
7: [ 0- 0]: digital audio playback
8: [ 0- 0]: digital audio capture
9: [ 0- 0]: hardware dependent
10: [ 0] : control
11: [ 2- 9]: digital audio playback
12: [ 2- 8]: digital audio playback
13: [ 2- 7]: digital audio playback
14: [ 2- 3]: digital audio playback
15: [ 2- 3]: hardware dependent
16: [ 2- 2]: hardware dependent
17: [ 2- 1]: hardware dependent
18: [ 2- 0]: hardware dependent
19: [ 2] : control
33: : timer

lspci

05:02.0 Multimedia video controller: Brooktree Corporation Bt878 Video Capture (rev 11)
05:02.1 Multimedia controller: Brooktree Corporation Bt878 Audio Capture (rev 11)

Installing v4l2-ctl

$ sudo apt-get install v4l-utils
[sudo] password for max:
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
libv4l-0 libv4lconvert0
The following NEW packages will be installed:
v4l-utils
The following packages will be upgraded:
libv4l-0 libv4lconvert0
2 upgraded, 1 newly installed, 0 to remove and 323 not upgraded.
Need to get 240 kB of archives.
After this operation, 342 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://de.archive.ubuntu.com/ubuntu/ precise-updates/main libv4l-0 amd64 0.8.6-1ubuntu2 [41.7 kB]
Get:2 http://de.archive.ubuntu.com/ubuntu/ precise-updates/main libv4lconvert0 amd64 0.8.6-1ubuntu2 [81.5 kB]
Get:3 http://de.archive.ubuntu.com/ubuntu/ precise-updates/universe v4l-utils amd64 0.8.6-1ubuntu2 [117 kB]
Fetched 240 kB in 0s (377 kB/s)

v4l2-ctl -n

ioctl: VIDIOC_ENUMINPUT
Input : 0
Name : Television
Type : 0x00000001
Audioset : 0x00000001
Tuner : 0x00000000
Standard : 0x0000000000FFBFFF (PAL-B/B1/G/H/I/D/D1/K/M/N/Nc/60 NTSC-M/M-JP/M-KR SECAM-B/D/G/H/K/K1/L/Lc)
Status : 0x00000100 (no hsync lock.)
Capabilities: 0x00000004 (SD presets)

Input : 1
Name : Composite1
Type : 0x00000002
Audioset : 0x00000001
Tuner : 0x00000000
Standard : 0x0000000000FFBFFF (PAL-B/B1/G/H/I/D/D1/K/M/N/Nc/60 NTSC-M/M-JP/M-KR SECAM-B/D/G/H/K/K1/L/Lc)
Status : 0x00000000 (ok)
Capabilities: 0x00000004 (SD presets)

Input : 2
Name : S-Video
Type : 0x00000002
Audioset : 0x00000001
Tuner : 0x00000000
Standard : 0x0000000000FFBFFF (PAL-B/B1/G/H/I/D/D1/K/M/N/Nc/60 NTSC-M/M-JP/M-KR SECAM-B/D/G/H/K/K1/L/Lc)
Status : 0x00000000 (ok)
Capabilities: 0x00000004 (SD presets)

Input : 3
Name : Composite3
Type : 0x00000002
Audioset : 0x00000001
Tuner : 0x00000000
Standard : 0x0000000000FFBFFF (PAL-B/B1/G/H/I/D/D1/K/M/N/Nc/60 NTSC-M/M-JP/M-KR SECAM-B/D/G/H/K/K1/L/Lc)
Status : 0x00000000 (ok)
Capabilities: 0x00000004 (SD presets)

v4l2-ctl –all

Driver Info (not using libv4l2):
Driver name : bttv
Card type : BT878 video (Leadtek WinFast 20
Bus info : PCI:0000:05:02.0
Driver version: 3.2.14
Capabilities : 0x05010015
Video Capture
Video Overlay
VBI Capture
Tuner
Read/Write
Streaming
Format Video Capture:
Width/Height : 320/240
Pixel Format : ‘YU12’
Field : Interlaced
Bytes per Line: 320
Size Image : 115200
Colorspace : Unknown (00000000)
Format Video Overlay:
Left/Top : 0/0
Width/Height: 320/240
Field : Any
Chroma Key : 0x00000000
Global Alpha: 0x00
Clip Count : 0
Clip Bitmap : No
Format VBI Capture:
Sampling Rate : 35468950 Hz
Offset : 244 samples (6.87926e-06 secs after leading edge)
Samples per Line: 2048
Sample Format : GREY
Start 1st Field : 7
Count 1st Field : 16
Start 2nd Field : 320
Count 2nd Field : 16
Framebuffer Format:
Capability : Clipping List
Flags :
Width : 0
Height : 0
Pixel Format : ”
Bytes per Line: 0
Size image : 0
Colorspace : Unknown (00000000)
Crop Capability Invalid:
Bounds : Left 68, Top 16, Width 1063, Height 608
Default : Left 186, Top 46, Width 924, Height 576
Pixel Aspect: 1135/944
Crop: Left 186, Top 46, Width 924, Height 576
Video input : 0 (Television: no hsync lock.)
Audio input : 0 (audio)
Frequency: 0 (0.000000 MHz)
Video Standard = 0x000000ff
PAL-B/B1/G/H/I/D/D1/K
Streaming Parameters Video Capture:
Frames per second: 25.000 (25/1)
Read buffers : 0
Tuner:
Name : Television
Capabilities : 62.5 kHz multi-standard
Frequency range : 44.0 MHz – 958.0 MHz
Signal strength/AFC : 0%/0
Current audio mode : lang1
Available subchannels: mono
Priority: 2

Racing Towards The Bottom, or, How Not To Handle Customers

Sunday, 2 September 2012

I’m currently in the process of buying an airplane ticket to visit my family for the holidays. So, like everyone else, I first turned to the aggregation searching sites. Once I’d narrowed down my ticket choice, I was redirected to the airline’s website (in this case, American Airlines), where I was ostensibly supposed to finish the transaction.

After entering all the billing information, I submit it and receive a notification from the airline company that the seat is now booked, and that final confirmation will arrive once the credit card transaction is finished.

No confirmation comes.

Six hours later(!), a message arrives stating that the transaction was declined by the credit card company (because my credit card company is stupid).

Monday, 3 September 2012

I send the credit card company a secure electronic message via their website and somebody calls me on Monday. We do the security question song and dance (which was way too easy) and I get the card unblocked.

I then call the American Airlines customer service number to clear up the billing issue. Here’s where it gets really stupid: Basically, their customer rep and I spend 20 minutes, in which I fork over all the details of my credit card again, including expiration date and CVV2, including the billing address, etc., and what do I hear, only at the end of the conversation?

“Thank you sir, I’ve submitted this billing information into the queue, it should be processed within 24 – 48 hours.”

“What the fuck?” I think. “Wait, say that again?” I ask.

“Yes, the ticket isn’t yet confirmed, I’ve submitted the billing information for processing, and it will take 24 – 48 hours to do this.”

“Wait, why does it take so long?” I ask.

“That’s just the amount of time it takes.”

So let me get this straight, my full credit card details are going to be floating around in someone’s slow-ass batch-processing system for 1 – 2 full days just waiting to be poached? And, I have no confirmation that yes, I have the ticket. Way to go, guys. Do you even have control of your own systems? What year is this?

If American Airline’s systems are the speedy equivalent of a 386/DX sitting under a desk somewhere, I wonder how vulnerable they are to getting hacked. I mean, how long does that batch-processing queue have to be?

I keep my eye on my e-mail, but receive no confirmation that the billing is even being attempted a second time. That’s stupid. I’d like to be kept in the loop if the ball is moving at all.

Tuesday, 4 September 2012

Watching my e-mail. No confirmation has arrived in the first 24 hours after I called customer service. Wow, their system is really, really slow.

The worst part about all this is the limbo into which American Airlines places their customers. I can’t go and book a flight online because their dumbass batch processing system could trigger at any minute and bill my credit card. And I don’t trust their systems enough to want to call customer service and ask them to cancel the whole order, since who knows if the cancellation would screw up a different reservation I would make or if it would remove the transaction from the queue in time. (Are their systems ACID?) So I am stuck waiting, until either the booking succeeds or ultimately fails. Then I can proceed with my flight planning.

In this case, it is a codeshare flight with British Airways, so my thought would be to try booking via their website, since they’re the eventual carrier I’d be flying anyways. But all I can think is that something, somewhere, would screw up, and I’d get to the airport without a flight at some point.

But no, American Airlines, this is not how you handle customers. You do not put them in limbo and prevent them from getting on with their planning. You do not scrimp on Online Transaction Processing systems: it’s just penny wise and pound foolish to have people who are willing to pay you good money stand in line for 1 – 2 days.

They, like I, will just be very, very angry with you. And they will not want to do business with you again.

It’s close to 27 hours since I called customer services, and there’s still no confirmation or failure message in my e-mail. I’ll update if/when I finally get it.

Wednesday, 5 September 2012

51 hours after the initial call to customer service, I finally received the confirmation.

Suggestions

Suggestion: You need to make it possible for customers with initially denied credit card transactions to rerun the transaction via the website once they’ve cleared up any issues with their credit card company. There’s already a way to check the status of a booking, there just needs to be a button added to let people settle the bill if it’s unpaid. I’m thoroughly disappointed at having to fork over all of my credit card information to a human in Fiji. (I asked where the guy was sitting, and he seemed honest…)

I will probably never call customer service again, as it’s less secure than just canceling the ticket and rebooking over the internet with humans out of the loop.

Then again, I haven’t seen a security audit of AA’s systems, so who knows how bad things are over there?

Suggestion: You need to inform customers at every stage of the booking, paying, possible rebooking, and confirming processes. We don’t like being kept in the dark when a services company is doing things that involve our money and our time.

Addendum

Reading this isn’t encouraging:

CIO Magazine –
“Your successor is Maya Leibman, who has worked at American for 17 years, most recently as president of the AAdvantage customer loyalty program. What are you and she talking about these days?”

Outgoing CIO Monte Ford –
“I got Maya out [of IT, where she helped launch curbside check-in and self-service kiosks] into the business units. She’s a very smart and very talented individual with a great personality. Maya has a different style than I do but philosophically, we agree.”

Microsoft Visual C++ 2010 Express Always Generating Exceptions

For whatever reason, I was always having problems with Microsoft’s Express edition C++ environment. It would generate an exception immediately after I started to edit any C or C++ source file, or seemingly randomly. Also, the Intellisense seemed like it was flaky, it would start highlighting random crap in comments, as though it was parsing them, and highlighting half-words, and other weird stuff. For a while, I was just sticking to the 2008 Express editions, as this was the path of least frustration.

Immediately after you start typing, an error dialog pops up:

“Visual Studio has encountered an exception. This may be caused by an extension. You can get more information by running the application together with the /log parameter on the command line, and then examining the file ‘[…]ActivityLog.xml’.”

Looking at this, there are two error records:

“System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.VisualStudio.TextManager.Interop.IVsTextReplaceEvents'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{CF9928D9-65AE-4319-A446-94ED5C45ECDE}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)). at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, IntPtr& ppTarget, Boolean& pfNeedsRelease) at Microsoft.VisualStudio.TextManager.Interop.IVsTextReplaceEvents.OnReplace(ChangeInput[] pCI) at Microsoft.VisualStudio.Editor.Implementation.VsTextBufferAdapter.OnTextBufferChangedHighPriority(Object sender, TextContentChangedEventArgs e) at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.RaiseEvent[TArgs](Object sender, EventHandler`1 eventHandlers, TArgs args)”

“System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.VisualStudio.Editor.Implementation.IVsTextStreamEvents_Private'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{96FC7D44-BCDD-4F00-AE4D-07E26B2C0E52}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)). at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, IntPtr& ppTarget, Boolean& pfNeedsRelease) at Microsoft.VisualStudio.Editor.Implementation.IVsTextStreamEvents_Private.OnChangeStreamText(Int32 iPos, Int32 iOldLen, Int32 iNewLen, Int32 fLast) at Microsoft.VisualStudio.Editor.Implementation.VsTextBufferAdapter.OnTextBufferChanged(Object sender, TextContentChangedEventArgs e) at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.RaiseEvent[TArgs](Object sender, EventHandler`1 eventHandlers, TArgs args)”

In any case, there’s a solid fix for this issue:

Microsoft Connect Issue Report

But the summary is this:

On 32-bit Windows:
Go to:
[HKEY_CLASSES_ROOTCLSID{73B7DC00-F498-4ABD-AB79-D07AFD52F395}InProcServer32]
Set (Default) to:
"C:Program FilesCommon FilesMicrosoft SharedMSEnvTextMgrP.dll"

On 64-Bit Windows:
Go to:
[HKEY_CLASSES_ROOTWow6432NodeCLSID{73B7DC00-F498-4ABD-AB79-D07AFD52F395}InProcServer32]
Set (Default) to:
"C:Program Files (x86)Common FilesMicrosoft SharedMSEnvTextMgrP.dll"

Seems that a single registry key defining a critical COM component was missing, for whatever reason. Sigh. Once that’s done, things work fine.