Tag Archives: mac

Remote Desktop on Mac failes to connect with 0x207 error

I am setting up a new Mac and got this annoying error from the Microsoft Remote Desktop client.

Worse, a number of people have complained about this error but there is a lot of useless advice out there, and also the bad advice to disable NLA (Network Level Authentication) on the Windows PC. Don’t do that, it is bad for security.

One of the few helpful threads on the topic is this one which point to this article on the subject of how to enable integrated authentication on Mac and Linux using Kerberos. I followed the advice here and it worked though I’m not sure if the ALL CAPS is necessary for the domain, but I used it and it worked – as long as I entered user@ALLCAPS in the RDP username as well.

The two key things I do with a new Mac

My Windows laptop is ancient (2015) and my company decided to replace it with a MacBook Pro especially since we need to develop software compatible with Apple Silicon. The new Mac works well  and I have been busy putting the essentials (for me) on it: Xcode, Visual Studio Code, .NET 6.0 SDK, Microsoft Office and so on.

Tip for .NET developers: when you put .NET and VS Code on an M1 Mac, you might get a CPU not supported error from Mono, at one time a dependency of the OmniSharp language server. You can fix this either by installing rosetta 2, the x86 translator for Apple silicon, or by setting omnisharp.useModernNet – see here for details.

There are two things I always have to do with a new Mac. The first is to go to  System preferences – Trackpad  – Scroll & Zoom and uncheck the mischievously worded option Scroll direction: Natural. This seems to set this for the mouse too. The reason is that as far as I can tell the Apple preference is no more or less natural than the older approach and having it different depending which operating system you are using is confusing. My suspicion is that Apple introduced this in order to make it harder to switch between Mac and Windows.

image

The second thing is a bit trickier which is to install my password manager. I use Password Safe which does not offer an up to date Mac download, nor an Apple Silicon version. There is a commercial version in the App Store, but since it is open source my solution is to build from source. I recall doing some tweaking the last time I did this, a couple of years back for an Intel Mac, but the process seems to be smooth now as a few fixes have been added for Xcode and arm64 support. I used the latest development release of wxWidgets, 3.1.6, which has to be built first. My build declares itself to be v 0.01 OSX.

image

Without the password manager a laptop is almost unusable for me since I don’t know many of the passwords I use and generally prefer not to save them in the  browser.

My desktop PC which I use for the majority of my work remains Windows and I am a fan of WSL (Windows Subsystem for Linux) which from my perspective is the best new feature of Windows since the release of Windows  7. I miss WSL on the Mac though it is less necessary because macOS is a Unix-like operating system.

In general I do not have a strong preference between Mac and Windows, though I feel that Microsoft and its OEM partners have some work to do to get Windows on Arm working as well as M1 Macs. I was also disappointed by Windows 11, particularly by its lack of support for slightly older CPUs, and the new Start menu and taskbar which is a step backwards from Windows 10. The appearance of ads in the user interface is a concern too, though it is minimal if carefully configured.

Time for another look at “pure .NET”

Back in the Nineties there was a lot of fuss about “pure Java”. This meant Java code without any native code invocations that tie the application to a specific operating system.

It is possible to write cross-platform Java code that invokes native code, but it adds to the complexity. If it is an operating system API you need conditional code so that the write API is called on each platform. If it is a custom library it will have to be compiled separately for each platform.

Over on the Microsoft .NET site, developers have tended to have a more casual approach. After all, in the great majority of cases the code would only ever run on Windows. Further, Microsoft tended to steer developers towards Windows-only dependencies like SQL Server. After all, that is the value of owning a developer platform.

Times change. Microsoft has got the cross-platform bug, with its business strategy based on attracting businesses to its cloud properties (Office 365 and Azure) rather than Windows. The .NET Framework has been forked to create .NET Core, which runs on Mac and Linux as well as Windows. SQL Server is coming to Linux.

Another issue is porting applications from 32-bit to 64-bit, as I was reminded recently when migrating some ASP.NET applications to a new site. If your .NET code avoids P/Invoke (Platform Invoke) then you can compile for “Any CPU” and 64-bit will just work. If you used P-invoke and want to support both 32-bit and 64-bit it requires more care. IntPtr, used frequently in P/Invoke calls, is a different size. If you have custom native libraries, you need to compile them separately for each platform. The lazy solution is always to run as 32-bit but that is a shame.

What this means is that P/Invoke should only be used as a last resort. Arguably this has always been true, but the reasons are stronger today.

This is also an issue for libraries and components intended for general use, whether open source or commercial. It is early days for .NET Core support, but any native code dependencies will be a problem.

Breaking the P/Invoke habit will not be easy but “Pure .NET” is the way to go whenever possible.

RemObjects previews native Apple Mac IDE for C#, .NET, Oxygene

RemObjects is previewing a new native Mac IDE for its Oxygene and C# compilers. Oxygene is a Delphi-like language (in other words, a variant of Object Pascal) which targets iOS, Mac, Android, Windows Phone and Windows. RemObjects C# shares the same targets. Both can compile to .NET assemblies for Windows, or to Mono for cross-platform .NET, or to a Mac or iOS executable (using the LLVM compiler), or to Java bytecode for the Android Dalvik runtime. You can get both Oxygene and RemObjects  C# bundled in a product called Elements.

In the past, RemObjects has used Visual Studio as its IDE. While this is a natural choice for Windows users, much development today is done on the Mac. Requiring Mac users to develop in a Windows Virtual Machine adds friction, so RemObjects is now working on a native IDE for the Mac codenamed Fire.

image

I gave Fire the briefest of looks. Here are some of the options for a new .NET application:

image

Note the appearance of ASP.NET MVC 4, and even Silverlight.

Here are the options for a new Cocoa application:

image

If you are developing for Cocoa, you can edit the resource file in Apple’s Xcode and use it in your application. I started a new C# Cocoa app, made a few changes and and then ran it from the IDE:

image

I imagine Microsoft will be keeping an eye on tools like this – if it is not, it should – since they fit with the strategy of supporting Microsoft services on multiple devices. Visual Studio is a fine tool but if Microsoft is serious about cross-platform, it needs strong Mac-native development tools. Xamarin came up with Xamarin Studio, which is cross-platform for Windows and Mac, but the RemObjects approach also looks worth investigating.

PS The first release of RemObjects C# lacked full generic support, for which failing Xamarin and Mono founder Miguel de Icaza took RemObjects to task on Twitter. I was amused to see this in the changelog for April 2014:

 image

65764 Full support for Generics on Cocoa, as requested by Miguel

For more details on Fire, see here.

Review: Nuance Dragon Dictate 4 for the Mac

There is something liberating about working without a keyboard – and I do not mean stabbing hopefully at a touch screen. Voice control means you can sit back, easily refer to books or papers,  and input text more quickly and naturally than is possible using a keyboard. Some conditions including RSI (Repetitive Strain Injury) may make dictation a necessity. I use dictation for transcribing interviews and for rapid text input generally. I do not often use dictation for controlling a computer, as opposed to entering and editing text, but this is also a key feature.

image

Nuance has the best voice recognition system available as far as I can tell, though my experience is mainly with Nuance Dragon NaturallySpeaking on Windows. But what about Mac users? For them, Nuance provides Dragon Dictate, which has recently been updated to version 4. It is not a port of Dragon NaturallySpeaking, but rather has its own distinctive features, though it is less comprehensive, and a glance at the Nuance forums suggests that Mac users feel a bit neglected.

Does Dragon Dictate 4 change that? The good news is that the voice recognition engine in Dragon Dictate appears to be just as good as the one in Dragon naturally speaking. The accuracy is superb though you still have to be realistic. Some recognition problems are just very difficult and the software is bound to make mistakes especially in specialist fields – mine is programming and a specialist phrase like “JIT compiler” is bound to cause an error (Dragon thinks I want “Jet compiler”). Similarly, “pull request” became “full request”. Over time you can build up a custom vocabulary, but recognition will never be 100%, so a dictation system has to handle corrections as well as original input.

Setting up Dragon Dictate involves installing the software and then letting it create a profile and doing some training so that Dragon can learn the characteristics of your voice. I highly recommend using a good quality headset since without it we cannot expect accurate recognition. I found the setup process quick and painless and was soon up and running.

Dragon Dictate has five modes:

  • Dictation Mode is what you use most of the time.
  • Spelling Mode is for spelling out problematic words. You can speak the letters naturally or use the International Radio Alphabet (Alpha Bravo Charlie etc). It is a nice feature since if you know Dragon is likely to get something wrong, you can switch to Spelling Mode, enter the difficult word, and then go back to Dictation Mode.
  • Numbers Mode is for typing numbers.
  • Command Mode is for non-dictation commands. However, commands also work in Dictation Mode. The advantage of Command Mode is that Dragon will not misinterpret your commands as text input; but there is no way to configure Dictation Mode to prevent it interpreting speech intended as text as commands. The manual suggests that you use unnatural pauses for this. For example, if you are reviewing Dragon Dictate and want to type “Command Mode”, you can say “Command [pause] Mode” and get what you want.
  • Sleep Mode puts Dragon in a resting state, so for example you can take a telephone call without Dragon trying to transcribe it.

Switching mode is easy: just speak the mode you want. If Dragon is in Sleep Mode, you can say “Wake up”.

My initial experience with Dragon Dictate 4 was not too good. The problems were not with recognition but rather with navigating and correcting existing text, which I found harder than in Dragon NaturallySpeaking on Windows. In fact my attempts to make corrections all too often ended up with more and more errors as a correction went wrong and I would be trying to correct the correction, getting increasingly frustrated.

Using Microsoft Word 2011, I experienced unexpected behaviour. For example, if I put the cursor in between two words and dictated a word to insert, sometimes the word appeared elsewhere in the text.

Another odd thing: I dictated "for example", and Dragon recognised it as "one example”. No problem: Dragon has a Recognition Window which lists alternatives when you say “correct” followed by the word you want to amend. I said "correct one” and the recognition window appeared offering "for example" as one of the choices. I selected it, but Dragon then entered “for example example” in the text. I was not offered the word “for” on its own.

Dragon Dictate 4 was rescued from a terrible review when I studied the manual. Towards the end is a section entitled “The Cache and the Golden Rule”. This explains that you should not combine the use of keyboard and mouse with dictation when editing a document. If you do, Dragon gets confused about the contents of the document and you see unexpected results. You can fix this with a special command, “Cache Document”, which tells the software to clear and rebuild the cache for the entire document.

If you are not aware of this issue, then you are likely to make increasing use of keyboard and mouse as Dragon gets it wrong, making the issue worse. That is exactly what had happened to me.

Another key point is the difference between training and correcting. If you use the Recognition Window to make a change that is not in fact a recognition fault – such as changing “good” to “excellent” – then you will confuse the voice training. Rather, you should say “Select good”, to select the word you want to change, and then say “excellent” to overtype it.

After studying the manual, I got much better results, though Dragon Dictate still occasionally seems to have a mind of its own.

Nevertheless, this fussiness is a weakness in the software. The best software works the way you want it to, rather than making the user do things a certain way. Why cannot Dragon do its cache repairs automatically in the background?

Still, what Dragon offers is of high value, and in this case if you want the best results you have to do the homework.

There are a few others things to mention. Nuance offers a free app for the iPhone that lets you use it as a remote microphone. Personally I find a headset more convenient but I guess there are scenarios where this is useful.

There are also features in Dragon Dictate aimed at general system control. I tried the MouseGrid, which overlays a grid over the entire screen and lets you zoom into the area of interest for accurate mouse control. You can also move the mouse using Up, Down and so on under voice control, and perform single, double or triple clicks.

Conclusion? The software does not feel as complete or as polished as Dragon NaturallySpeaking, but the excellent voice recognition means that this is the best available for the Mac. Recommended, but with reservations.

Thirty years of mainly not the Mac

It’s Mac anniversary time: 30 years since the first Macintosh (with 128K RAM) in 1984 – January 24th according to Wikipedia; Apple’s beautiful timeline is rather sketchy when it comes to details like actual dates or specs.

My first personal computer though was a hand-me-down Commodore PET 4032 with only 32K of RAM, which pre-dated the Mac by about 4 years (though not by the time I got hold of it).

image

The PET was fun because it was small enough that you could learn almost everything there was to know about it though a book called The PET Revealed that listed every address and what it did. I had a word processor called Wordcraft that was excellent, provided you could live with only having one page in memory at a time; a spreadsheet called VisiCalc that was even better; and a database that was so bad that I forget its name. You could also play Space Invaders using a character-based screen; the missiles were double-dagger (ǂ)characters.

The small company that I was a little involved with at the time migrated to Macs almost as soon as they were available so I had some contact with them early on. The defining moment in my personal computer history though was when I needed to buy a new machine for a college course. What would it be?

If all the choices had cost the same, I would have purchased a Mac. My second choice, since this was a machine for work, would have been a PC clone. Both were expensive enough that I did not seriously consider them.

Instead, I bought a Jackintosh, sorry an Atari ST, with a mono 640 x 200 monitor and a second disk drive. It had the GEM graphical user interface, 512K RAM, a Motorola 68000 CPU, and built-in MIDI ports making it popular with musicians.

The ST exceeded expectations. Despite being mainly perceived as a games machine, there were some excellent applications. I settled on Protext and later That’s Write for word processing, Signum for desktop publishing, Logistix for spreadsheets, Superbase for database, the wonderful Notator for messing around with MIDI and music notation, and did some programming with GFA Basic and HiSoft C.

If I had had a Mac or PC, I would have benefited from a wider choice of business applications, but lost out on the gaming side (which I could not entirely resist). The ST had some quirks but most things could be achieved, and the effort was illuminating in the sense of learning how computers and software tick.

Despite the Mac-like UI of the Atari ST, my sense was that most Atari owners migrated to the PC, partly perhaps for cost reasons, and partly because of the PC’s culture of “do anything you want” which was more like that of the ST. The PC’s strength in business also made it a better choice in some areas, like database work.

I was also doing increasing amounts of IT journalism, and moving from ST Format to PC Format to Personal Computer World kept me mainly in the PC camp.

For many years though I have found it important to keep up with the Mac, as well as using it for testing, and have had a series of machines. I now have my desktop set up so I can switch easily between PC and Mac. I enjoy visiting it from time to time but I am not tempted to live there. It is no more productive for me than a PC, and Microsoft Office works better on a PC in my experience (no surprise) which is a factor. I miss some favourite utilities like Live Writer, dBpoweramp, and Foobar 2000.

That said, I recognise the advantages of the Mac for many users, in terms of usability, design, and fewer annoyances than Windows. Developers benefit from a UNIX-like operating system that works better with open source tools. There is still a price premium, but not to the extent there was when I picked an Atari ST instead.

Happy Anniversary Apple.

Hands on Cross-Platform Windows and Mac development with C++ Builder XE3

I have been writing about Embarcadero’s RAD Studio XE3, which includes Delphi and C++ Builder, and as part of the research I set this up for cross-platform development on a Mac.

My setup uses a Parallels Virtual Machine to run Windows 7, on which RAD Studio XE3 is installed. This is convenient for Mac development, since the IDE itself is Windows only. That said, if I were doing this in earnest I would use multiple displays or perhaps separate physical machines, since it is no fun debugging in a VM with the application running in another operating system behind it.

Is it straightforward to configure? Not too bad. You have to install Xcode on the Mac, and in addition, you have to install the Xcode command line tools, which you can do from Xcode itself, in Preferences – Downloads – Components, or as a separate download.

image

Then you need to find the Platform Assistant (paserver), an agent which runs on the Mac to support remote debugging. I was annoyed to find that this has a dependency on Java SE6, which to be fair it downloaded and installed automatically. Actually I find this amusing, after hearing from an Embarcadero VP how native code is all the rage and nobody uses managed code any more. Except Embarcadero for the paserver.

Once that is all up and running you are done on the Mac side. On Windows, you then need to sort out a remote profile, after having installed RAD Studio of course. The way to do this is first to start a new cross-platform project, which means using the FireMonkey framework. Then right-click TargetPlatforms in the project manager and add a platform. If you add OSX but no remote profile exists, you will be prompted to create one.

image

This is where something went slightly wrong. I created a profile and could connect OK. However, when I tried to build the project, I got an error: Unable to open include file ‘CoreFoundation/CoreFoundation.h’. You get this if for some reason the required library files have not been pulled over from the Mac. The fix is to edit the profile and click Update Local File Cache.

image

After that I was away. Set breakpoints if needed, build and debug.

image

Cross-platform is not new in RAD Studio; it was in XE2, and in some ways better, since you could target iOS as well as OSX. C++ Builder XE3 is actually a new generation though. In the 64-bit update 1, it is the first release to use Clang and LLVM, and from what I understand this represents the future for Embarcadero’s tools.

Updates are promised in 2013 for both Delphi and C++Builder – this roadmap is most of what we have to go on – which will add first iOS and later Android support, at what the company calls a “low cost”. Unlike the iOS support in XE2, the coming update will not use the Free Pascal compiler, but the new architecture based on LLVM. This also suggests that the add-on will replace some of the guts of Delphi when it arrives, so it will be significant and somewhat risky.

The cross-platform capabilities look good, though I am somewhat wary of FireMonkey which is less complete and mature than the Windows-only VCL. For example no Webbrowser component is supplied, which is a significant limitation, though I am sure there are ways of hacking this, perhaps through ChromiumEmbedded for which a Delphi FireMonkey exists.

It is worth a bit of effort, since Delphi and C++Builder are productive tools, and the output is true native code which still had advantages.

More information on RAD Studio XE3 is here.

Xamarin brings C# to development of apps for the Mac App Store

Xamarin has released Xamarin Mac which adds Mac support to the existing iOS and Android compilers from the company:

  • MonoTouch: apps for iPhone and iPad using the MonoDevelop IDE on the Mac
  • Mono for Android: apps for Android using either Visual Studio or MonoDevelop
  • Xamarin.Mac: apps for Mac OS X using MonoDevelop on the Mac

The major platforms missing from the above are Windows and Linux (unless you count Android), even though Mono began as a Linux implementation of Microsoft’s .NET platform.

Xamarin says that a Windows version is not necessary since you can use Microsoft’s tools to code in C# for Windows desktop and Windows phone.

You can also get Mono for Windows, Mac and Linux from the old Mono project site.

Why would you bother with paid-for Xamarin.Mac when you can get Mono for Mac as a free download? There is even a Mac packager which lets you create a standalone package for your Mono app. A good question, but I guess the answer is the benefit of Xamarin-specific libraries and support from the company. Xamarin has also done the work to ensure that you can distribute your app via the Mac App Store.

Xamarin.Mac costs $399 for personal use, or $999 for an enterprise license which allows internal as well as app store distribution. A one year, one seat license with priority support costs $2,499.

Xamarin knows how to charge then, and in the end that may be a key reason why the project is working, whereas Mono struggled as an open source project that never had the resources it deserved.

The Mono Project site now says that it is “sponsored by Xamarin” so open source developers are getting some benefit from the commercial offshoot.

Xamarin is important for the C# language, since it represents a viable implementation which is independent of Microsoft.

Which online storage service? SkyDrive is best value but lacks cool factor

This week both Microsoft and Google got their act together and released Dropbox-like applications for their online storage services, SkyDrive and Google Drive respectively.

Why has Dropbox been winning in this space? Fantastic convenience. Just save a file into the Dropbox folder on your PC or Mac, and it syncs everywhere, including iOS and Android mobiles. No official Windows Phone 7 client yet; but nothing is perfect.

Now both SkyDrive and the new Google Drive are equally convenient, though with variations in platform support. Apple iCloud is also worth a mention, since it syncs across iOS and Mac devices. So too is Box, though I doubt either Box or Dropbox enjoyed the recent launches from the big guys.

How do they compare? Here is a quick look at the pros and cons. First, pricing per month:

  Free 25GB 50GB
Apple iCloud 5GB $3.33 $8.33
Box 5GB $9.99 $19.99
Dropbox 2GB   $9.99
Google Drive 5GB $2.49 $4.99 (100GB)
Microsoft SkyDrive 7GB $0.83
(27GB)
$2.08
(52GB)

and then platform support:

  Web Android Black
berry
iOS Linux Mac Windows Windows
Phone
Apple iCloud X X X Limited X
Box X X
Dropbox X
Google Drive X X X
Microsoft SkyDrive X X X

Before you say it though, this is not really about price and it is hard to compare like with like – though it is obvious that SkyDrive wins on cost. Note also that existing SkyDrive users have a free upgrade to 25GB if they move quickly.

A few quick notes on the differences between these services:

Apple iCloud is not exposed as cloud storage as such. Rather, this is an API built into iOS and the latest OS X. Well behaved applications are expected to use storage in a way that supports the iCloud service. Apple’s service takes care of synchronisation across devices. Apple’s own apps such as iWork support iCloud. The advantage is that users barely need to think about it; synchronisation just happens – too much so for some tastes, since you may end up spraying your documents all over and trusting them to iCloud without realising it. As you might expect from Apple, cross-platform support is poor.

Box is the most expensive service, though it has a corporate focus that will appeal to businesses. For example, you can set expiration dates for shared content. Enterprise plans include Active Directory and LDAP support. There are numerous additional apps which use the Box service. With Box, as with Dropbox, there is an argument that since you are using a company dedicated to cross-platform online storage, you are less vulnerable to major changes in your service caused by a change of policy by one of the giants. Then again, will these specialists survive now that the big guns are all in?

Dropbox deserves credit for showing the others how to do it, Apple iCloud aside. Excellent integration on Mac and Windows, and excellent apps on the supported mobile platforms. It has attracted huge numbers of free users though, raising questions about its business model, and its security record is not the best. One of the problems for all these services is that even 2GB of data is actually a lot, unless you get into space-devouring things like multimedia files or system backups. This means that many will never pay to upgrade.

Google Drive presents as a folder in Windows and on the Mac, but it is as much an extension of Google Apps, the online office suite, as it is a storage service. This can introduce friction. Documents in Google Apps appear there, with extensions like .gdoc and .gsheet, and if you double-click them they open in your web browser. Offline editing is not supported. Still, you do not have to use Google Apps with Google Drive. Another issue is that Google may trawl your data to personalise your advertising and so on, which is uncomfortable – though when it comes to paid-for or educational services, Google says:

Note that there is no ad-related scanning or processing in Google Apps for Education or Business with ads disabled

Google Drive can be upgraded to 16TB, which is a factor if you want huge capacity online; but by this stage you should be looking at specialist services like Amazon S3 and others.

Microsoft SkyDrive is also to some extent an adjunct to its online applications. Save an Office 2010 document in SkyDrive, and you can edit it online using Office Web Apps. Office Web Apps have frustrations, but the advantage is that the document format is the same on the web as it is on the desktop, so you can also edit it freely offline. A snag with SkyDrive is lack of an Android client, other than the browser.

Conclusions

There are many more differences between these services than I have described. Simply though, if you use a particular platform or application such as Apple, Google Apps or Microsoft Office, it makes sense to choose the service that aligns with it. If you want generic storage and do not care who provides it, SkyDrive is best value and I am surprised this has not been more widely observed in reports on the new launches.

One of Microsoft’s problems is that is perceived as an old-model company wedded to the desktop, and lacks the cool factor associated with Apple, Google and more recent arrivals like Dropbox.

Cross-platform Windows and Mac lifts Delphi sales by 54%

Embarcadero has announced 54% growth in sales of Delphi and C++ Builder, its rapid application development tools, in 2011 vs 2010. These tools primarily target Windows, but in the 2011 XE2 edition also support Mac and iOS applications. XE2 also added a 64-bit compiler, making this the most significant Delphi release for years. The company says that the 2011 figures come on top of 15% year on year growth in the previous three years.

This is encouraging for Delphi developers, and well deserved in that Delphi still offers the most productive environment for native code development on Windows. The cross platform aspect is also interesting, though the FireMonkey framework which enables it is less mature than the old VCL, and there are many other options out there for cross-platform apps. FireMonkey does not yet support Android or other mobile platforms apart from Apple iOS.

2012 is also the year of Windows 8, raising the question of whether Delphi and C++ Builder will support the new Windows Runtime (WinRT) in future, and if it does, whether this will be FireMonkey only, or whether it could work with a XAML-defined user interface.