Showing page 7 of 38.


 

Error installing "Windows 7 service pack 1", code 80200053

Microsoft recently released the Service Pack 1 for Windows 7. When installing this through Windows Update it would keep failing and give me “code 80200053.” After looking around for a bit I found a solution that fixed this.

  1. Go to the Start menu and type “services.msc” and press enter.
  2. Find “Windows Update” service, right click on it and click “Restart.”
  3. Go to the Start menu and type “Windows Update” and try installing the service pack.
Read more

Compiling what...?!!

Lol, I saw this earlier while compiling Samba4. It says “Compiling torture...” I wonder what it does :)

Compiling what!?!

Read more

New plumbing is in place

I finally got some time to move my site to the jQuery Javascript library from Prototype. Why? Because lately most of my projects have been using jquery so I have been using and learning it a lot more than Prototype, and I am starting to understand it very well. You might also notice the LavaLamp jQuery plugin that I am using for the navigation menu above. Initially my intention was to create that functionality myself, but later decided to just that library to save some time for other projects.

Read more

Preventing namespaces from showing up in XSLT output

I recently had the need to output a SELECT HTML element with a list of states. My initial approach was simple where I used <xsl:copy>

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:custom="com.thebitguru" exclude-result-prefixes="custom">
	<xsl:output method="html" omit-xml-declaration="yes"/>
	<xsl:strip-space elements="*" />

	<custom:states>
		<option value="AL">Alabama</option>
		<!-- ... -->
		<option value="WI">Wisconsin</option>
		<option value="WY">Wyoming</option>
	</custom:states>

	<xsl:template match="option">
		<xsl:copy>
			<xsl:if test="@value = $val">
				<xsl:attribute name="selected">selected</xsl:attribute>
			</xsl:if>
			<xsl:attribute name="value"><xsl:value-of select="@value" /></xsl:attribute>
			<xsl:value-of select="." />
		</xsl:copy>
	</xsl:template>

	<xsl:template match="*">
		<label for="state">* State:</label>
		<select name="state" id="state">
			<xsl:apply-templates select="document('')/*/custom:states/option" />
		</select>
	</xsl:template>
</xsl:stylesheet>

The problem with this approach was that the option tags were printing the xml namespaces, even with the exclude-result-prefixes="custom" specified (because that attribute does not apply to <xsl:copy>).

1
2
3
4
<option value="AL" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:custom="com.thebitguru">Alabama</option>
...
<option value="WI" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:custom="com.thebitguru">Wisconsin</option>
<option value="WY" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:custom="com.thebitguru">Wyoming</option>

I didn’t want these namespaces in the output so after some searching and reading through the docs I decided to create new elements using the <xsl:element> tags instead, especially since the tag that I was copying was very small.

1
2
3
4
5
6
7
8
9
<xsl:template match="option">
	<xsl:element name="option">
		<xsl:if test="@value = $val">
			<xsl:attribute name="selected">selected</xsl:attribute>
		</xsl:if>
		<xsl:attribute name="value"><xsl:value-of select="@value" /></xsl:attribute>
		<xsl:value-of select="." />
	</xsl:element>
</xsl:template>

There are other ways to accomplish the same thing, e.g. copy-namespaces in XSLT 2.0, but in my case I was stuck with XSLT 1.0.

Read more

Quick vim tip: Copying matching lines to the end of file

I recently had the need to cleanup a long diff file and move certain lines to the end of the file for further analysis. The diff file that I got was something like the following, only much longer (produced using diff -qr xxx yyy).

Files xxx/abc1 and yyy/abc1 differ
Only in xxx: cde1
Files xxx/abc3 and yyy/abc3 differ
Files xxx/abc4 and yyy/abc4 differ
Only in xxx: cde2
Only in xxx: cde5
Files xxx/abc5 and yyy/abc5 differ
Only in xxx: cde3

I didn’t care as much about the “Only…” lines, but the files that differed needed more attention. To accomplish this I wanted to get this file in the following format.

Only in xxx: cde1
Only in xxx: cde2
Only in xxx: cde5
Only in xxx: cde3
Files xxx/abc1 and yyy/abc1 differ
Files xxx/abc3 and yyy/abc3 differ
Files xxx/abc4 and yyy/abc4 differ
Files xxx/abc5 and yyy/abc5 differ

I could go in and copy and paste all the lines that matched, but that would be a lot of manual work. So, I looked around for a minute and came up with the following command.

:%g/^Files/m$

Vim is awesome!

Read more

Play Button iTunes Patch updated

My original patch possibly worked only with OS X 10.6.5. Last night I figured out a better way to apply the patch without relying on a pre-supplied diff. What this means is that starting with version 0.7 the patch should work with pretty much all versions.

If you are interested, check it out on the project page.

Read more

New Patch: Play Button iTunes Patch

I just published a new patch for OS X, below is a description of the patch. Check it out.

This is a patch for removing the default OS X behavior of always starting iTunes when the play button on the keyboard is pressed. This feature can be useful for a lot of users, but it can also be annoying if you are using VLC or other similar programs that support the media keys.

The Patch script will patch the Remote Control Daemon to prevent it from starting iTunes whenever you press the play button on the keyboard or an external remote control. This will only prevent iTunes from starting, all other functions (like play/pause while iTunes is running) will continue to work as before.

Lastly, this program will backup the original file in case if you would like to restore the original functionality.

For more information please visit the Play Button iTunes Patch page.

Read more

New Songbird Extension: Delete from Disk

One thing I have missed in OS X is a powerful media player like MediaMonkey. iTunes gets a good part of the job done, but doesn’t have everything that I need. Plus, I hate the fact that it doesn’t display the ratings that I have on the files from my Windows machine. So, I have been exploring my options and one possibility is Songbird. It it better, but still lacks in some places (once again, ratings). I am still playing around with Songbird because, compared to iTunes, it is a lot easier to create add-ins for Songbird.

The first thing that I noticed missing from Songbird was the ability to delete songs that are not “managed” by Songbird. This is pretty much how iTunes behaves as well. I did not like this because I like control. If I added a file to a playlist then I would also like to have the ability to delete it from both the playlist and the file system.

So, instead of using the prescribed “1-start rating” to denote deletions I decided to explore Songbird extension development. I am glad to report that I was able to figure out the framework and actually just published an extension in the official repository to do just that: Delete from Disk. If you are a Songbird user looking for this functionality then you don’t need to look any further. Browse to the extensions page in Songbird and search for Delete from Disk.

This is the new menu entry that the extension adds.

Now let’s figure out what we can do about the ratings…! I also wish that someone will fix the Apple media key support extension.

Read more