Apple Magic Mouse Sleeping on Win7

My bluetooth Magic Mouse kept falling asleep. Here’s how to keep it away.

My Apple Magic Mouse was “falling asleep” on me in Windows 7.  Found this post that told how to resolve it.

1. Click on the “Bluetooth Devices” blue icon in the system tray (you’ll probably need to click that little UP arrow first) and choose “Open Settings” from the menu.
2. Under the “Hardware” tab of the resulting dialog, select the “Apple Built-in Bluetooth” device and click the “Properties” button on the lower right.
3. Under the “General” tab in the resulting dialog, click the “Change Settings” button on the lower left (it has a shield icon on it)
4. Under the “Power Management” tab in the resulting dialog untick the “Allow the computer to turn off this device to save power” checkbox.
5. Press OK, OK and OK.

But for me, the Hardware tab was located under “Dell Wireless 573 Bluetooth Module with AMP.”

Competitors?

An opinion piece: are Apple and Microsoft competitors? This line of reasoning says no.

Who made the spoon that you used to eat your breakfast cereal this morning?

Every once in a while I’ll hear people talking about how Microsoft and Apple are competitors. As someone who’s technology agnostic, I don’t see the world in such shades of black and white. Here’s my reasoning as an outsider comparing the two.

Apple is a hardware company, their goal is selling as many units of whatever as possible, whether it be computers or mp3 players. With a focus on design and user experience, backwards compatibility takes a back seat to form and functionality. They excel at elegance and minimalism. They aim sharply at the home user. Disposability is ok. The next big thing is the future.

Microsoft is an operating system and business application vendor, their goal is to put that software on to as many pieces of hardware as possible. They are an industry leader in office applications and software development environments. They aim sharply at business and government. Backwards compatibility is highly important. They’d run on toasters if they could.

Is there overlap between the two? Sure, some. Is it a make or break difference? Not really, much is a matter of preference and familiarity.

I twitch anytime I hear someone say OS X is more “intuitive” than Windows; the word they’re looking for is consistent. Coarse application design is more similar, meaning once you get over the learning curve, subsequent new challenges have a ring of familiarity.

But more importantly, are the two environments mutually exclusive? Not at all. That’s why platform agnostics run both systems. Some things are just easier to do in some environments than others.

The operating systems wars and the phone wars are about luring people toward purchasing something from that camp. But look closer. MS-Office runs on OS X, and quite nicely. Safari and QuickTime run on Windows, and quite nicely. Once you’ve made the purchase of their crown jewel, the fighting appears to stop.

Users, on the whole, don’t care (and often don’t understand) about the underlying system. They just have a problem they want to solve, learn how to do it once and without change, and any tool that gets the job done will do.

Just like my spoon.

NTFS on OS X

Trying to write to an NTFS volume on OS X, and all you find are third party packages and complicated config file manipulations asking you to reboot? Do this….

Every once in a while someone brings over an external NTFS formatted drive and plugs it into my Mac to exchange some large data sets. While the Mac can easily read NTFS, it doesn’t appear to have the capability to write to that file system.

Appears is the operative phrase.

If you search for a solution in the open, you’ll find companies selling commercial products, drivers, and mounters. Some people have posted complicated looking instructions telling instructing you to mess with low level system files, that may or may not exist, ending in a full system reboot that typically solves the problem for that lone drive.

NTFS on OSXHere’s the generic no-software required solution.

First connect your NTFS drive to the Mac, it’ll mount with some name like “My Disk.”

Open a Terminal window and enter the command:
$ mount

The mount command will tell you what drives are listed. Find the one that has your drive name listed in it and copy the device name:
/dev/disk1s2 on /Volumes/My Disk (hfs, local, nodev, nosuid, journaled, noowners, mounted by me)

Now eject the drive, but don’t disconnect it from the machine.

Go manually create the directory (shown in bold above); this is where the mount point will be:
$ cd /Volumes
$ mkdir My\ Disk

NOTE: The backslash escapes the next character, in this case allowing a space in the directory name.

Now, mount the drive as read-write using this command:
$ sudo mount -o rw -t ntfs /dev/disk2s1 /Volumes/My\ Disk

Make sure that you’ve used the same device location you copied down the the prior steps.

At this point your drive should appear on the desktop, and you ought to be able to read and write to it just fine. No rebooting necessary!

Note that you can get to it from the Terminal as well:
$ cd /Volumes/My\ Disk
$ ls

Note that sometimes Finder may act a little wonky with timing problems and a huge file. Apparently the underlying Unix system has no problem. You can copy a big file to the drive:
$ rsync –progress SuperBigFile.zip /Volumes/My\ Disk

Or a whole directory:
$ rsync -r –progress LargeDeepDirectory /Volumes/My\ Disk

When done, make sure you are not running any programs that are accessing the drive or have their current directory set to the drive:
$ cd /Volumes

Then, eject the drive normally, or unmount it from the command line — your choice.
$ sudo umount /Volumes/My\ Disk

Full disclosure and warnings: This was tested on OS X 10.6.5, though support has been around to do this for a while. And, any time you’re doing something that deals with questionable file system access, make sure there’s nothing on the drive you don’t mind losing. Have a backup. There’s always a slight risk, but it’s very close to zero — why state all this? Because I assume no responsibility if something goes wrong.

Reactive Framework conflict (SOLVED)

The type ‘System.IObservable exists in both ‘c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll’ and ‘c:\Program Files (x86)\Microsoft Reactive Extensions\Redist\DesktopV2\System.Observable.dll’ (SOLVED)

During an upgrade of a C# WPF application that was using Reactive Extensions, I ran into this compile error:

The type ‘System.IObservable exists in both ‘c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll’ and ‘c:\Program Files (x86)\Microsoft Reactive Extensions\Redist\DesktopV2\System.Observable.dll’

This is roughly the same kind of Defined in Multiple Assemblies problem as I faced before. (Solution provided.)

In this case, the System.Observable.dll was pinned to the 3.5 release of the Reactive Extensions.

The solution was to:

  1. Download the .NET 4.0 version of Reactive Extensions (Rx_Net4.msi).
  2. Install it.
  3. Remove System.Observable from the project.
  4. Re-add the System.Observable to the project, being super careful to select the latest version

Defined in Multiple Assemblies

The predefined type ‘System.Func’ is defined in multiple assemblies in the global alias … mscorlib.dll and System.Core.dll. SOLVED!

Today I migrated a C#/WPF project in Visual Studio 2010 from .NET 3.5 SP1 to .NET 4.0. Immediately the compile failed issuing this set of errors:

  • The predefined type ‘System.Func’ is defined in multiple assemblies in the global alias; using definition from ‘c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll’
  • The predefined type ‘System.Func’ is defined in multiple assemblies in the global alias; using definition from ‘c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Core.dll’

To resolve this error involved understanding a little bit more about C#, .NET, and the Common Language Runtime (CLR).

According to C# 4.0 In A Nutshell from O’Reilly Press, on page 181 it says:

Some of the .NET types are used directly by the CLR and are essential for the managed hosting environment. These types reside in an assembly called mscorlib.dll and include C#’s built in types, ….

At a level above this are additional types that “flesh out” the CLR-functionality, …. These reside in System.dll, System.Xml.dll, and System.Core.dll, and together with mscorlib the provide a rich programming environment….

So mscorlib and System.Core are both needed. This begs the question, why is Func declared in both and thus causing a conflict? Or is it?

Further on in C# 4.0 In A Nutshell from O’Reilly Press, on page 183 in a general note it says:

A notable exception is the following types, which Framework 4.0 have moved from System.Core to mscorlib.dll:

  • The Action and Func delegates

This suggests a case exists where mscorlib is from our current .NET (the later one has Func), and System.Core is coming from the old one (which is where Func lives for that version).

How is this possible? It’s our projects fault.

This question on StackOverflow provides some insight; check out Simon‘s answer.

  1. Right-click the project and select Unload Project
  2. Right-click the project again and select Edit Project
  3. Scroll down in the XML to find the ItemGroup element; it’ll have Reference elements insider of it.
  4. Locate the Reference element that has Include=”System.Core” as an attribute.
  5. If it has other qualifiers, remove them. If it has a TargetFrameworkVersion subelement remove it.
  6. Save the XML.
  7. Right-click the project and reload it; try a build now.

In my case, I had an entry that looked like this:

<ItemGroup>
  <Reference Include=”System.Core”>
    <TargetFrameworkVersion>3.5</TargetFrameworkVersion>
  </Reference>
</ItemGroup>

Removing the TargetFrameworkVersion, shown in red above, un-pinned the dll from the older .NET framework and things worked just fine.

Error 0x80070057 (SOLVED)

Copy File

An unexpected error is keeping you from copying the file. If you continue to receive this error, you can use the error code to search for help with this problem.

Error 0x80070057: The parameter is incorrect.

SOLVED!

Went to copy a directory on Windows 7 from one drive to another, something that I had done quite frequently, even earlier that day.

However, this time, and nothing had changed substantially with the source files, I got an Error 0x80070057 message stating “The parameter is incorrect.” At that point the copy dialog from my simple drag and drop would allow me to retry (useless) or abort mid-copy.

The error message was unusually cryptic and less that helpful:

Copy File

An unexpected error is keeping you from copying the file. If you continue to receive this error, you can use the error code to search for help with this problem.

Error 0x80070057: The parameter is incorrect.

The disk was not full and a check disk revealed no errors.

THE SOLUTION
The destination directory name that I was copying into was pretty long, I basically had used a descriptive prefix, a date stamp of YYMMDDHHMMSS, by a space dash space, and a short descriptive comment. All in all it was about ~55 characters in length.

The directory I was copying from was a fairly deep structure.

That made me wonder if the fully qualified name of some directory path wasn’t exceeding some limit. On Windows, it appears to be 256 characters. On a Mac it appears to be 1023 characters.

Tricks aside, I was limited to the file system limits.

So, on the same disk, with the same files, immediately after yet-another-failure to copy, I renamed the destination folder to something considerably shorter and tried again.

Quick experimentation showed that was indeed the problem: the resulting path name formed during the copy was too long.

Solution: shorten the destination folder name and/or tighten up the path.

WPF Responsiveness Problem

Ran into an interesting problem where a WPF application was acting really, really, really slow. So slow that moving the application window was jumpy. Selecting items in a grid would take several seconds. Scrolling a list box of simple items would grind the CPUs for a while. And even typing in a regular text box was so delayed that I could type a word, sit back, and every few seconds a character would appear.

The problem turned out to be with the input stack at the operating system. Seems that the Pen / Tablet Driver was bringing the system to its knees, but only affecting WPF applications.

Disabling the driver and restarting the WPF application instantly showed colossal speed improvements for response time; the application responded near instantly. Re-enabling the driver while the application was running reverted the system to the broken state, although turning the driver back off did not bring the WPF application out of it’s slow like crawl. Restarting the WPF application resolved the problem, but the driver had to be disabled.

(Test conducted with WPF 3.5 SP 1 and Windows 7.)

Drag’n’Drop Problems with Parallels 4

Since installing Snow Leopard, I can no longer Drag’n’Drop files from Windows to the hosting OS X environment, though the inverse works just fine. Is anyone else having this problem, because I’m not seeing much about it on the Parallel’s forums. I think the bug is real.

To say that I’m distrusting of Microsoft Windows’ security is putting things lightly. And when I’m in a situation where Microsoft’s anti-open standards force Microsoft as a necessity, I tend to use a virtual machine to sandbox its activities.

On Mac OS X, I use a wonderful product called Parallels, which has the added bonus of being able to drag’n’drop files and directories between the guest operating system (Windows) and the host operating system (OS X).

After installing the latest Snow Leopard (10.6), I found that while I could drag files into Windows from OS X, the reverse was no longer true. Dragging something from the Windows desktop out to the OS X desktop, which used to work in Leopard (10.5), simply results in nothing happening.

Parallels 4.x Shared Services Drag'n'Drop

Now, I’m aware that Apple did some pretty big changes under the hood in Snow Leopard. And, I’m aware that even the Finder got a fairly intensive overhaul. And, I’m even willing to accept that there might be bumps during the transition process, as the good folks at Parallels update their product to address little tidbits like this.

However, I’m kinda surprised that this kind of thing snuck past testing. Even more to my surprise is that I don’t hear many people talking about it. Such conclusions lead me to think that perhaps I have a local configuration issue.

But then I heard from another user of Parallels that updated to Snow Leopard. He ran into the same problem: Drag’n’Drop worked only in one direction now.

Most of the Snow Leopard fuss currently centers on the fact that Parallels 2.x and 3.x no longer work under Snow Leopard. Parallels made such a good and stable product that early users saw no need to update as it met their needs. However, Apple’s approach to operating systems is far more progressive than Microsoft’s, as they are willing to sacrifice backwards compatibility in software and hardware, if the technology is substantially old and the new benefits far outweigh the trouble. Thus, Apples tends to fix problems, rather than bandaid-ing workarounds; in the long haul everyone benefits with faster, smaller, more featured applications instead of bloatware.

However, I’m riding the Parallels 4.x wave on the bleeding edge. I’ve got the Parallels Tools installed. I’ve got the Enable Drag’n’Drop checked in the Shared Services config. Still, nothing.

I did a little digging around and found one user, Jamie Daniel, who was experiencing the same problem. As his question went unanswered, I tried myself.

I wrote an entry in the Parallels forum entitled Drag files from Guest to Host no longer working, detailing the problem.

And, while I was luckier than Jamie and got an answer, it was fairly clear someone gave a cursory glance and cut’n’pasted a response without reading what I was asking. In short that I did not want Windows to be able to read or write to any OS X drives. For, should Windows get a virus, I didn’t want it having free reign of the OS X filesystem to corrupt. Thus only I, via Drag’n’Drop, should be able to marshal content between the two environments.

Willing to accept the fact that I may have a configuration problem, despite being a power user of Parallels since day one, I am also willing to accept that this is simply a Snow Leopard compatibility issue that Parallels will soon be addressing. Problem is, I can’t seem to raise the issue to a level where someone can confirm or deny it.

Worse yet, I can’t seem to be able to login to Windows via the Finder anymore to mouse a Windows disk within OS X, where as I used to be able to do that as well. While workarounds, from using a USB disk (which mounts in both environments), DropBox, and using the Windows Guest account’s Parallel’s mount point, I’d really like the old capability back.

So, I ask, Parallels 4.x users that are using Snow Leopard, are you no longer able to drag from Windows to the OS X desktop?

If you can, how are you doing it?

If you can’t, please head over to the Parallels forum and let them know it’s broken for you as well. This is not an attack Parallels request, they’re good people — this is just to raise awareness to let them know the issue is real so they can look into it.

UPDATE 14-Sep-2009: Found a work around, but I’m not happy about it. What I don’t like about it is that it appears to expose Windows disks to OS X. While I trust OS X, the inverse does not appear to be necessary to perform a Drag’n’Drop from OS X to Windows. I’d expect the Enable Drag-and-Drop to be enough.

If you turn on the Share All Disks with OS X, then Drag’n’Drop from the Windows desktop to OS X Desktop works.

Parallels 4 Drag'n'Drop Hack

Clever Bulk Rename Trick in Windows

Stumbled into a clever way to rename a bunch of files to have the same prefix and a sequential numbered suffix… from the Windows GUI no less.

Ever want to rename a bunch of files to the same prefix, but have an incremental count after them?

From Explorer, select all the files that you want to bulk rename, right click, and select Rename.

While all of the files will be selected, only one is editable. Give the file a name, let’s pretend for the sake of discussion you typed ABC.jpg.

All of the rest of the files will be renamed ABC (1).jpg through ABC (n).jpg, where ‘n’ is the number of files minus one, since the first one doesn’t get a number.

Knowing this, you can do some clever stuff. Create one bogus file renamed to ZZZZZZZZ.TXT at the end of your list; select all the files, and bulk rename them as shown above. Then delete the bogus file, it should be the only one without a number, and you’ve just made a sequence of files.

Is AVG killing windows Remote Desktop?

Today terminal services stopped working, and I could no longer remote in to my Windows box. At the moment, speculation suggests it appears to be a false-positive by AVG.

This morning Anti-Virus Guard,AVG (not the free version), decided that TRMSRV.DLL in the System32 directory was threat and copied it out of the directory.

The result was that Terminal Service no longer works. That means that software like Remote Desktop Connection 2 (RDC), can’t connect, although the machine responds to pings and Samba requests.

Placing a exception in AVG to not check that directory (sounds bad, eh?), and restoring the file from another machine seems to have temporarily address the problem.

I wonder if AVG knows about this.

We’re also seeing that Cygwin and the System Restore Point is also among the collateral damage.

UPDATE 11-Nov-2008: Looks like AVG is now flagging Windows as a virus.