2010/03/10

Spotify global hotkeys - AutoHotkey script

My script is based on one I found here.

Hotkeys:

Previous trackWin+1
Play/pauseWin+2
Next trackWin+3
Volume downWin+Q
Volume upWin+W

Script:
#1::
; Previous track
ControlSend, ahk_parent, ^{Left}, ahk_class SpotifyMainWindow
return

#2::
; Play/pause
ControlSend, ahk_parent, {Space}, ahk_class SpotifyMainWindow
return

#3::
; Next track
ControlSend, ahk_parent, ^{Right}, ahk_class SpotifyMainWindow
return

#q::
; Volume down
ControlSend, ahk_parent, ^{Down}, ahk_class SpotifyMainWindow
return

#w::
; Volume up
ControlSend, ahk_parent, ^{Up}, ahk_class SpotifyMainWindow
return
How does it work:

It's very simple - I just mapped my favourite audio player hotkeys to default Spotify keyboard shortcuts, e.g. #1 means Win+1 in AutoHotkey syntax and pressing this hotkey sends ^{Left} (i.e. Crtl+Left) to main window of Spotify application.

2010/01/12

Web Parts Maintenance Page - fixing a SharePoint page with faulty Web Parts configuration

If you ever use Site Aggregator Web Part on the default.aspx page of a site and configure it in a way that redirects users to some other website (specified when adding Site Aggregator) every time they try to open the SharePoint site (I have no idea how I managed to do it), you can use the Web Parts Maintenance Page to resolve this problem. Of course, you can use this page to troubleshoot all other kinds of problems caused by Web Parts misconfiguration.


The URL of the Web Parts Maintenance Page is:

http://SITE-URL/_layouts/spcontnt.aspx?&url=%2fPAGE-WITH-WEB-PARTS.aspx

2010/01/02

BSoD when installing Windows XP on ASUS K61IC notebook

If a bluescreen (Blue Screen of Death) occurs during Windows XP installation and the error message contains the 0x0000007B code, try to do the following:
  1. restart the notebook,
  2. press F2 to enter the BIOS setup,
  3. go to Advanced and then IDE Configuration,
  4. change the SATA Operation Mode setting to Compatible (the default setting is Enhanced).
Some information about the STOP: 0x0000007B error can be found here.

2009/10/21

Error "The remote debugger is not an acceptable version"

If you try to debug an ASP.NET application remotely using Remote Debugging Monitor (msvsmon.exe) and you get the following error:
The remote debugger is not an acceptable version
it means that the versions of Visual Studio and Msvsmon are different (e.g. Visual Studio 2005 + Msvsmon 2008).

2009/05/15

Missing auto-generated Resources.Designer.cs file

If the Resources.Designer.cs file is missing and there is no Run Custom Tool option in the context menu for the Resources.cs file (or, of course, any other resources file), it probably means that the Custom Tool property of the Resources.cs file is empty:


This is what MSDN says about the Custom Tool property:
Custom tools are components that can be used to transform files from one type to another at design time. For example, a custom tool might be a dataset code generator that reads in an XML Schema (.xsd) file and generates classes in a code file that programmatically exposes its tables and columns. There is a predefined list of custom tools available in the product; this property enables you to see which custom tool is applied to a file. In rare circumstances, you might have to change the value of this property. The value of this property must be either blank or one of the built-in custom tools.
In case of Visual Studio 2008 the default tool generating the *.Designer.cs files is ResXFileCodeGenerator - type it in the property and the problem should be solved:


UPDATE:

I found an easier way to do it:

2009/01/25

furl2delicious - a tool to import bookmarks from Furl to Delicious (with tags!)

I decided to switch from Furl to Delicious. Furl is a good bookmarking service, it has a unique feature that I think is very useful - it saves a copy of every bookmarked page. But recently it's been very slow, sometimes I couldn't even log in. Moreover, I like new Delicious design and Firefox integration so much better!

So I decided to switch. But I didn't want to lose more than 500 bookmarks. I tried to use the Delicious import feature - everything went smoothly but all my tags were lost. I looked for a solution on the Internet but I didn't find a working one, so I wrote my own tool.


It imports the following data:
  • the URL,
  • the title,
  • the comments (if there were any),
  • the tags (!),
  • the date when the bookmark was created (!).
I imported my bookmarks - it took about 20 minutes; out of 515 bookmarks that left Furl 501 arrived at Delicious, I didn't investigate why 14 bookmarks were lost.

I used the Delicious.Net library and Visual C# 2005 Express Edition.

Downloads:
furl2delicious - executables
furl2delicious - source code (.NET, C#)

2008/06/14

Last.fm event shoutbox feed - my first Greasemonkey script

I've just uploaded my first Greasemonkey script to userscripts.org. It is called Last.fm event shoutbox feed and can be downloaded from here.

It allows to follow the conversations in Last.fm event shoutboxes easily by subscribing to feeds created for them ('out of the box' Last.fm does not provide feeds for shoutboxes, my script uses hAtom to Atom/RSS transcoder).

Below you can see how it works.



UPDATE:

The script does not work with the new Last.fm, because the microformats were dropped during the re-design.

2008/05/01

Calling a .NET library from a VB6 application

Calling a .NET library from a VB6 application is pretty easy. There are many resources explaining how to do it (e.g. 1, 2, 3, 4). However, all of the (or at least the ones that I have read) forget to mention that, if you are using C#, there is a catch - the assemblies created in C# have a ComVisible attribute set to false by default. This simply means that they cannot be called from a VB6 application.

To change it open the AssemblyInfo.cs file, find the following line:
[assembly: ComVisible(false)]
and change it to:
[assembly: ComVisible(true)]

2008/04/29

Error "Unable to connect to SQL Server '(local)'. The step failed."

If you are using SQL Server 2000 and you have a job with a step that fails with the following error message:

Unable to connect to SQL Server '(local)'. The step failed.

it may mean that this step is configured to use a database that existed when the step was created but has later been dropped.

Moreover, if you don't remember what database this step should use, checking the step definition in Enterprise Manager won't reveal the cause of the problem, because there will be some database selected in the Database combo box (it cannot be empty) but it won't be the same database that the step is really configured to use (this database does not exist so it is not in the combo box).

To fix the problem select a new database for each failing step and save the changes.