Design Inspiration

Where’s a good place to get inspiration for mobile and web design components?

You can see and play with tons of ideas from around the world from everything having to do with graphics to controls to websites . . . and you can interact with the designers . . . and even hire them!

Pretty cool site!

Resetting Bluetooth on a Mac

I just turned on my Mac and now my bluetooth keyboard and magic pad won’t sync.

Sometimes, when I bring my laptop back in after taking it home from work at night, my wireless keyboard and magic pad won’t sync. Instead of rebooting my computer, I just unload the bluetooth in a terminal session.

sudo kextunload -b

and then

sudo kextload -b

to load it back again.

?? Operator

If you use nullable types in C# (e.g., int?, double?, boolean?, etc.) you may be interested to know that C# has a special operator for handling what to do if a value is null. It is called the null-coalescing operator. It works like this . . .

int? x = null;
int y = x ?? -1;

If x is null, then the value on the right side of the ?? will be used; otherwise, it will use the value of x to assign to y in the example above.

So, you don’t need to do things like this anymore . . .

int y = (x == null) ? x : -1;

Neat huh?

Conflicting Assemblies

In Visual Studio, when compiling solutions, you may encounter the following error message:

Found conflicts between different versions of the same dependent assembly. Please set the “AutoGenerateBindingRedirects” property to true in the project file. For more information, see

Or you might see a similar version of this when trying to browse to an ASP.NET website that looks like:

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

To see exactly the path and the assemblies that are causing the problem, you’ll need to turn on logging for the .NET binding process. The information above in the error message is not sufficient to enable this though. Here’s the full information needed in order to see the assembly binding (from Stackoverflow):

DWORD ForceLog set value to 1
DWORD LogFailures set value to 1
DWORD LogResourceBinds set value to 1
String LogPath set value to folder for logs (e.g. C:\FusionLog\)

Make sure you have that trailing backslash in the log path.

Then, restart your application or build and inspect the details in the log file or the output from ASP.Net!

Autofocus in Angular.js

Add an autofocus attribute to your input like this:

<input autofocus>

Then, set the focus on the first visible input with autofocus when angular is ready like this:

angular.element(document).ready(function() {

Let me know if you have another, better way.

JavaScript Design Patterns

Where can I learn about JavaScript design patterns?

Here is a really good book by Addy Osmani title, “Learning JavaScript Design Patterns”.

Here’s a snapshot of the table of contents . . . good stuff . . .

What is a Pattern?
“Pattern”-ity Testing, Proto-Patterns & The Rule Of Three
The Structure Of A Design Pattern
Writing Design Patterns
Categories Of Design Pattern
Summary Table Of Design Pattern Categorization
JavaScript Design Patterns
  Constructor Pattern
  Module Pattern
  Revealing Module Pattern
  Singleton Pattern
  Observer Pattern
  Mediator Pattern
  Prototype Pattern
  Command Pattern
  Facade Pattern
  Factory Pattern
  Mixin Pattern
  Decorator Pattern
  Flyweight Pattern
JavaScript MV* Patterns
  MVC Pattern
  MVP Pattern
  MVVM Pattern
Modern Modular JavaScript Design Patterns
  ES Harmony
Design Patterns In jQuery
  Composite Pattern
  Adapter Pattern
  Facade Pattern
  Observer Pattern
  Iterator Pattern
  Lazy Initialization Pattern
  Proxy Pattern
  Builder Pattern
jQuery Plugin Design Patterns
JavaScript Namespacing Patterns