You are here

@*%#$!

Introduction

When working on modern web applications that use features that are recently supported by browsers such as SVG, you may find that images do not render correctly, or at all in the browser.

Background

When most of use develop and test web applications locally, we use the built-in web server, called ASP.NET Development Server/10.0.0.0. This works fine for testing, and most applications will eventually get deployed to a web server running IIS 7.0 or later.

The Problem

The ASP.NET Development Server is not aware that it should serve SVG with a MIME content-type of image/svg. Instead it uses the generic application/octet-stream. A modern web browser on the other hand will typically either request image/* or explicitly request image/svg+xml. If the response is application/octet-stream, it will ignore the response (tested in IE9, FF14).

The usual way of fixing this is to add this code block to web.config:

Unfortunately ASP.NET Development Server is unable to understand this directive.

To workaround this problem, install and use IIS 7.5 Express to serve the content locally. This will require instructing Visual Studio to use IIS instead.

A day or two ago I upgraded the ports in my jails. This stopped postfix from accepting mail. The problem was that postgrey, which listens for postfix on tcp/10023 stopped running. It produced an error about not being able to bind to ::1. I got it back running again by altering the flags in the startup script (/usr/local/etc/rc.d/postfix) from:

This has worked for years. After doing it yesterday I was unable to login to any of my jails and pretty much everything broke. For example logging in using ssh gave logged the error: /bin/sh permission denied

After spending the day on it I have discovered that the upgrade process changed permissions on /usr/jails/basejail to 700. Changing it to 755 fixed everything.

Introduction

My softball team thought it would be fun to play intro music for each person as they went up to bat, like some major-league teams. I welded together a portable sound system complete with pneumatic wheels, second-hand shelf speakers, an AGM battery, and a 40W head unit.

I recently purchased a refurbished iPhone 3GS from an online retailer. I needed one for testing an application that I've been hired to build. Since I had the iPhone anyway, I figured the touch interface would work well for our team's sound box.

The Problem

The first problem, I learned, is that the iPhone cannot play a single song, then stop. It always continues on to the next song unless it is the only song in a playlist. Luckily I wasn't the only person who found this extremely stupid, and before reaching for my compiler I checked the App Store and found Benjamin Pung'sOne track Mind app.

The next problem was that when I plugged in the cord from the headphone jack of the iPhone to the Line In jack of the head unit, there was an annoying beat, beat, beat sound.

For the benefit of those searching, it could also sound like: click, click click; thump, thump, thump; pop, pop, pop; beat, beat beat.

I considered loose connections, impediance mismatch, and EM interference, but I was able to rule those out. Oddly, rebooting the device would make it work normally until I fiddled with the jack (I still haven't figured this out).

It is noteworthy that this symptom is not present when listening with headphones (this is where, I believe, impediance plays a role).

The Solution

Many internet searches informed me that this was a very common problem without a solution.

I notice that pushing the plug into the jack forcefully and holding made the noise stop. I also noticed that when I did so, there was just a little end-play; maybe 0.2mm. I had a hunch.

I grabbed a toothpick and went digging. I scraped the tip of the toothpick against the bottom of the jack repeatedly, and was able to pull out several small pieces of what I'll call lint â€“ probably a mixture of dust, fibres and oil.

I plugged it in to the stereo and ta da! No more noises. No more end-play.

Moral

Once again, the simplest solution (though not necessarily the most obvious one) usually is the correct one.

I'm posting this tip because many people have this problem, and most keywords like click, beat, and pop result in pages of results completely unrelated information (thanks Dr. Dre).