You are here

dev

'Provide value on 'System.Windows.Baml2006.TypeConverterMarkupExtension' threw an exception.' when using an ImageBrush as an opacity mask in WPF

You wouldn't know from the error message, but the problem was that the image file was set to be Content. It should be Resource.

Tags: 

java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams

I spent a few hours debugging this exception in an Android app. When you create a new View you usually set its LayoutParams. The trick is that you need you use the Type of LayoutParams that is from the parent view's class. So if you're adding a LinearLayout to a FrameLayout, you need to set LayoutParams to an instance of FrameLayout.LayoutParams.

Tags: 

No resource found that matches the given name (at 'property' with value '@drawable/your-filename') or aart.exe exited with error code 1

This occurs when the filename uses characters that aren't valid in C#.

Use underscores instead.

Tags: 

The .ws TLD for web services... pass it on.

Does anyone disagree that the availability of .ws domains is pointless?

Perhaps in an attempt to generate revenues like Italy (.it), Tuvalu (.tv), Montenegro (.md), and Tonga (.to) did, Samoa (formerly Western Samoa) made available this ccTLD for general registration (that is, residency is not a requirement). Global Domains International Ltd. represents the TLD on behalf of Samoa and markets it as Your Internet Address for Life, essentially an all-purpose alternative to .com.

I'm of the opinion that the last thing the world needs is another one-TLD-for-all-your-needs. However, for the last five years I have been registering .ws domains for the purpose of web services. It's a nice way to distinguish websites-for-people from webservices-for-computers. You can even create subdomains for types of services, such as schema.example.ws, soap.example.ws, wsdl.example.ws, rest.example.ws, etc.

All the cool kids are doing it. Pass it on... it might even help out a country where the GDP per capita is about 1/10th of Canada or the U.S.A.

MonoTouch: NSUnknownKeyException - This class is not key value coding-compliant for the key

This error can occur in the constructor of AppDelegate (when it calls base.ctor()).

This occured to me when I have specified the application's entry point in Info.plist in the Main Interface setting.

A similar error will occur any time an outlet exists for a control that no longer exists in Interface Builder.

Viewing SVG and other HTML5 content when debugging in Visual Studio

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.

Tags: 

jQueryMobile: Keeping the header and footer in nested listviews

When I used a nested listview for the first time, I was a bit surprised to find that it created new a new header dynamically instead of just keeping the header and footer of the parent. For my current project this is really important, so I searched around and found many people with the same expectation.

I've modified $.mobile.listview._createSubPages to support this functionality by setting data-dynamic to true or false on the  

        . Ideally this could be implemented as an event or callback so that the coder could override the

    _createSubPage

      behaviour.
    Tags: 

    Pages

    Simple Copyright Policy: If you want to reproduce anything on this site, get my permission first.