Xamarin Studio

A looong time ago – nearly a year – I wrote about having had some success using the voip.ms API using Objective-C.  I planned on writing more about it in the days that followed, but since the end result was rather messy, I ended up kind of dropping it.  I did have some success dealing with a few API calls, and I did use it to add a few call filters here and there to get rid of pesky telemarketers and scam artists.  I did some work trying to create an Objective-C library, but a variety of unrelated factors, and the fact that it was so messy that “there has to be a better way” all came together to kind of put the brakes on the effort.

Lots has happened in the past few months.  Apple came up with the Swift programming language, which I haven’t played much with.  It’s interesting, but there are some design decisions in there that annoy me (kind of VB-ish in terms of stupid, at times.)  Microsoft have made the .NET Core open source and announced some partnerships with the Mono effort and also with Xamarin, makers of cross-platform tools for mobile development (and desktop, to some extent.)  I got a Nexus 5 Android phone in the summer and found myself now owning a couple of good mobile devices with the two major mobile ecosystems.

I’m about to change projects at work, which will require to dig deeper into .NET and C# (among other things.)  Objective-C has some cool sides to it and I definitely want to play with it more eventually, but for now, with the Xamarin tools becoming more mature, I’ll be giving that a try to write a voip.ms companion app to do some things without having to use the web site.  Now that I have a decent Android device, going cross-platform is also more à propos than it was a year ago.  It’s not like such an app requires any fancy platform-specific controls or capabilities anyway.

Xamarin Studio it is then for the time being… More to come. (Hopefully for real, this time! ;))

Successful connection to voip.ms using Objective-C

Alright… Been procrastinating again.  But tonight I successfully extracted my Call Detail Records (CDR) from voip.ms using an Objective-C program.  Voip.ms expose a REST/JSON API that makes it possible to do a lot of things, and I’m hoping to create an app to control many features of my account without having to log in to the web site.

The Apple documentation is a bit blurry when you’re just beginning with the Cocoa API, so I had to hunt down a few examples and work from that.  The good news is that nothing did what I wanted, so I had to fiddle quite a bit to get things to work.  Hopefully by the end of the weekend I’ll know what I’m doing well enough that I’ll be able to write a post here about it. Voip.ms provide samples in PHP and .NET, would be nice to have a ready-made Objective-C demo for those who want to get working right away… Stay tuned.  For now, my back needs a break, and I hear Netflix calling…

So long, laptop… Hello iPad and ClamCase Pro

Last year I wrote about converting my HP laptop to Linux Mint, after running Windows Vista and Windows 7 over the years.  A few weeks ago the battery started showing signs of its age.  Since I wasn’t doing anything on the laptop that I can’t do on my iPad, I figured this would be a good time to downsize the gadgetry a little bit.

There was a problem, however: Typing more than a couple of sentences with an onscreen keyboard is a bitch.  Hell, even typing an alphanumeric password is annoying because you have to switch the keyboard mode, often several times (I use weird passwords).

A few months ago, I happened to notice an iPad keyboard, the ClamCase Pro, that looked Clamcase Propretty cool and was getting good reviews.  So I hit the tech web sites again, looking for more recent reviews, and I didn’t see much in terms of negative comments – most of them seemed to be related to a problem located between the keyboard and the chair, while some others were of the “well, duh!” category – such as the keyboard roughly doubling the weight of the iPad. Most of the keyboard’s weight is actually a counterweight so that the iPad won’t tip over when it’s inclined.  Note that I did run into a review where the reviewer mentioned that you cannot use it comfortably on your lap because it will tip over.  I don’t know what that person’s situation was, but I’m typing this with the ClamCase Pro on my lap, with the iPad at a rather steep angle, and it doesn’t even feel like it wants to tip over.

Unlike many keyboards I’ve seen, the ClamCase Pro has a palmrest, which makes it more comfortable for prolonged use.  The keys are very responsive, and I got used to the layout very quickly.  It’s roughly like a standard Mac keyboard, with a few different keys. You can put the iPad in “tablet mode” by folding the keyboard all the way to the back (it’s also recommended to turn off the physical keyboard when you do that, to avoid pressing keys accidentally while holding it).  It does make it kind of heavy to use for reading, however.  Then again, if you’re going to read for a prolonged period, you can always take the iPad out of the enclosure.

After testing this setup for a few days, I determined that this would do just fine as a replacement for my laptop.  Note that I’m not saying that a tablet can replace a laptop (and definitely not a desktop computer): I just wasn’t doing a whole lot with my laptop.  I’d say the only annoyance is that some web sites just don’t work all that great on mobile browsers – yet.

I donated my laptop to a local technology charity named CompuCorps.  I bought the laptop back in 2007 and didn’t expect to get much for it, so I’d rather have it go to someone who needs it.  I’ll get a tax receipt for the donation, so that’s cool. 🙂

So, if you’re looking for a good physical keyboard for your iPad (2, 3, 4), the ClamCase Pro is a solid choice – and as a bonus, it looks pretty slick, not unlike a netbook or Chromebook.  The manufacturer also just released a new version of the keyboard for the thinner iPad Air, which doesn’t seem to be widely available (at the time of writing).

Slowly getting to know Objective-C

So these past few weeks I’ve been toying a little bit with Objective-C and Cocoa using a couple of books from Apress: Learn Objective-C on the Mac: For OS X and iOS and Learn Cocoa on the Mac. Both are very good at introducing the subjects, not going too deep but generally deep enough to get a good understanding of the basics.  I did get tired of toying with the example projects, so after much procrastination, I started doing things on my own.

I figured I’d start by trying to access data stored in the MySQL database I use for my web site,. I’ve been using a crappy MS-Access interface for nearly 12 years and I’d like to retire that thing. So I went out looking for an Objective-C interface to MySQL. No such luck – none is offered by the MySQL group at Oracle. I didn’t find a couple of open source projects meant to fill the gap, but they were pretty old and abandoned. So I set out to do it the hard way: I download the MySQL C API. After all, you can do C in Objective C.

So yeah… My first Objective-C experience (doing a project of my own) is starting as “plain old C”.  I hadn’t done any C in 8 years, and that was for a very small program on Windows.  Things are slowly getting back to me, but want it or not, it does make you appreciate what frameworks such as .NET do for you.  So far I’ve managed to call three stored procedures for adding, updating and retrieving bands from the database.  Which reminds that I need to delete as well. *sigh*  I’m not crazy about stored procedures, but for what I’m setting out to do, it’s going to be easier than writing the SQL directly in the C code – less housekeeping with the strings.

Back to Objective-C – that is some weird-looking language at times, but after and writing some of it, it’s looking less alien.  Even though Apple have added a lot of features over the years, it does show its age here and there – lack of namespaces, the relatively ambiguous status of private methods being two.  But throw in Cocoa and things already get more modern.  That’s a pretty cool framework that I can’t wait to start using for real (once I’m done with the database code). Would be nice if Core Data supported MySQL though. (Hint, hint…)

I also got an idea for an iPad app, but I can’t do everything at once… 🙂

That’s all for now…

Linux Mint for the win…

I guess I got bored with Windows 7 on my 6-year old laptop (né Windows Vista).  Last year I tried to install Ubuntu Linux on it and that was a failure.  Sleep and Hibernate didn’t work (well, waking up was the problem), and on a laptop that’s a no-sale. Linux has a reputation of being a bitch to install on many laptops, and I guess mine was one of those, despite being from a popular line (HP Pavilion dv9000). I didn’t investigate the reason much since I didn’t have much time and just reinstalled Windows 7.  I decided to give it another try this weekend.  That was eventful…

Ubuntu 13.04 was just released a few days ago, so I figured I’d give it another try. I downloaded the 64-bit version.  The installation went relatively well (note: installing Linux is no longer “blazingly fast” compared to Windows, contrary to some claims).  After the installation was completed, the first thing I noticed was: No wireless.  Hmmm… OK.  So let’s try Sleep/Wake up.  Abort! Abort! Abort!  On wake-up, the screen turned to crap and practically everything was unreadable – just like last year.  Fire up the iMac to do some research.  Something about the Nvidia driver.  There’s is an open source version called Nouveau (OK…), which is known to (1) be slow and (2) have problems.  Yet, that is the default version that’s installed. Great.  OK so let’s go to Additional Drivers and select the proprietary Nvidia driver instead (known to (1) be fast and (2) usually work fine.  It let me pick it, but nothing happened.  OK.  Keep reading.  Ah… So 64-bit Linux doesn’t have as many drivers as the 32-bit version.  Well, I don’t really need 64-bit on this laptop anyway, so let’s download the 32-bit version!

Installation was slow again.  But hey, once it was done, I actually could see the various wireless networks available around me (I’m in a condo building, so that means a lengthy list… I wonder if all that stuff is frying my brain… :D)  That’s one down.  Let’s try Sleep/Wake-up again.  No joy.  OK, that driver thing, right… Oops, no love.  More tinkering, no luck.  But… Wait!  I’ve been reading about that other Linux distro, Linux Mint, which apparently sports a better interface.  I did forget to mention that I find Ubuntu’s Unity interface to be somewhat… atrocious.

Soooo… Download Linux Mint (32-bit – no point in screwing around with 64-bit again).  The installation was just as slow as for Ubuntu, which I kind of expected.  And now there it is, the Cinammon interface (they actually have several interfaces available when it’s time to pick a download… I like choice, but man, without trying them all, how the hell am I supposed to know which one I’ll prefer?)  This one is closer to the common Windows interface, and doesn’t have the crappy Unity Launcher (ugh…)

So back to my usual tests:  OK, no wireless again.  Let’s worry about that one later.  Let’s try Sleep/Wake-up.  Oh, screw up (yeah, screwed up again…)  Alright, more reading, but looking for tips specific to Linux Mint.  So I find this guy who says that even when you pick the proprietary Nvidia driver, Nouveau still manages to get in the way (oh, great…) and it doesn’t like to be removed (a driver with feelings?)  BUT, here’s how to “blacklist it” so that the kernel won’t load it.  Well, let’s try that – just a file to edit.  There, done.  Sleep/Wake-up.  Oooooh…  Is this… *click* *click* *click* for a few minutes… Success!  I owe that guy a beer.

OK, time for a more “extreme” test: Hibernate/Wake-up.  Contrary to popular belief, hibernate works fine in Windows (been doing it for years), but is really hit-or-miss with Linux.  Hit the power button… Password screen… So far, so good.  Desktop… Looking good.  *click* *click* frenzy again. Success!

Now where the hell is my wireless crap.  As it turns out, the Broadcom wireless driver is not included with Linux Mint, because apparently Broadcom won’t allow it (yet it was on Ubuntu 32-bit). Anyway, again I found some instructions on setting it up.  Here we go, huge list of nearby wireless networks again.  More success!  This is getting fun.  Time to update my Facebook status, stating that I am tentatively pleased.

I really only use this laptop on weekday mornings for my early browsing/e-mailing/whatever while having a coffee before going to work, so I don’t need a lot on it.  Browser, password manager, text editor.  Firefox is included, but it’s version 16.  Unlike the Windows and Mac versions I’ve been using, this one doesn’t auto-update.  OK.  Wait, what’s this icon in the tray?  A couple of hundred updates are available.  Hmmm.. Let’s not waste time, surely the newest version of Firefox is in there (and yes, it was… but it took a while for all that stuff to download and install – comes with a fresh OS installation…)

Things get complicated when it comes to passwords.  I use KeePass, which is really a .NET program for Windows, but there’s a version that runs under Mono (an open source version of .NET). This version is pretty sucky compared to the original, but it mostly works.  KeePass encrypts the password database, but that’s not enough for me.  I store the password file “in the cloud” so that I can share it between several computers.  I use BoxCryptor for additional encryption.  But wait, there’s no BoxCryptor for Linux.  Just Windows, Mac, iOS and Android.  Oops.  Fear not: the encryption is compatible with encFS.  So from here it was a matter of setting up the cloud service app (thankfully there was one for Linux), encFS, and KeePass.  I found all of these through the Software Sources applications, so at least installation wasn’t painful.  I did find a little application to manage encFS volumes from the tray, so I installed that as well.

Lastly I needed a text editor.  I recently started using Sublime Text on the Mac, and they happen to have Windows and Linux versions.  Installing this one was a bit more involved, since I wanted to install a couple of packages to enhance its functionality. Translation: some shell adventures.  At least Linux, like the Mac but unlike Windows, has an excellent command-line shell.

Sooo… It looks like the laptop is now up and running and ready for the simple tasks I require of it.  Still, Linux requires a bit of tinkering to get where you want, so I’d say it’s not necessarily “ready for grandma”, unlike what many people claim.  Dealing with drivers the way we have to, for very basic functionality, is not something “Joe Average” wants to know about, let alone do.  A lot of people won’t even know what to search for.  But once things are up and running, this is all pretty slick.

Alright, so now I should stop procrastinating (because that’s really what I was doing all that time) and get better acquainted with OS X and iOS programming… Hopefully the topic of a post sometime in the next couple of weeks!

8 months into the Mac world

Well, I had been meaning to post more periodic updates of my journey into the world of Macs, but I didn’t. No good excuse. 😉

It’s been… interesting.  There is quite a bit of getting used to, interface-wise.  OS X has a clean interface, but it is showing its age here and there.  They could borrow a few things from the Windows world.  Just think of having to reach for the mouse when a dialog pops up because there is no keyboard shortcuts on the stupid buttons!  This one is a major pet peeve.  But it hasn’t killed me yet.

As mentioned in my previous post, I decided to get a Mac to explore a new programming platform.  Well, that hasn’t really happened yet.  Or has it?  OK so I haven’t done actual Objective-C programming to create native OS X or iOS applications, but I’ve used a few built-in goodies to automate a lot of tasks on this machine – laborious, repetitive stuff that I had been doing manually for years.  AppleScript, while verbose and a little on the wild side, is great for automatic Mac applications (especially when the applications have explicit support for it).  And since it’s really UNIX running behind the pretty interface, languages like awk as well as UNIX shell scripting are readily available.  I’ve used a mix of some four different languages to automate time-wasting and error-prone manual tasks related to the maintenance of my web site, The Metal Crypt. It took a while to get things the way I wanted, but now the daily update process is almost pain-free.  The next step will be to replace the crappy Microsoft Access interface (for maintaining the site’s MySQL database) I put together in an evening over 10 years ago.  That was a temporary thing until I got around to writing something more permanent.  Ooops…

Did I say Microsoft Access?  Yep.  I’m running a number of Windows applications in a Windows 7 virtual machine using Parallels virtualization software. It does a pretty good job of integrating the two operating systems, especially with a “Coherence mode” that displays Windows applications alongside Mac ones on the OS X desktop.  That works relatively well, though some applications don’t always react so well in that mode.  Other than that I’m running software with a decent Mac equivalent, like Quicken, Catraxx, AssetCat, BookCat, CatVids, Visual Studio, Mp3Tag, MediaMonkey and the Windows Home Server console for managing my WHS-based NAS.  I even went nuts a little bit one day and created an Ubuntu virtual machine, so I was running three operating systems at the same time.  Unfortunately the Linux Coherence mode is not up to par with the Windows one yet, but hopefully Parallels are working on that…

Overall, I’m liking the experience.  The machine and operating system are not as perfect as the Apple zealots scream on every rooftop (I’ve had more OS crashes or hangs than I ever did with Vista and Windows 7 combined over a period of more than 5 years).  But there’s a lot of stuff to like, and it’s fun overall.  Did I mention monitor quality?  The iMac’s built-in 27″ monitor is excellent, and so is the additional 27″ Thunderbolt display.  I’ve got quite a bit of stuff available simultaneously on all that screen real estate.  Maybe too much, now than I think about it…

Now, with an unexpected move last fall and then a lot of overtime last winter, as mentioned earlier I never got around to doing some “real” programming on this puppy.  I just added a few Xcode components to get ready to roll, and spent some time swearing because the damn thing has somewhat weird support for source control (actually, I’m still swearing since I have yet to get it to play with Subversion).  Little things.  Now it’s time to dig deeper in Josh Smith‘s book iOS Programming for .NET Developers.  After all, that’s what kind of triggered this Mac adventure in the first place…

Flirting With the Other Side…

A couple of weeks ago I got a crazy idea: Buying a Mac.  Well, the idea started with an interest in learning another platform and also taking a shot at iOS development.  I had been juggling with the idea for a while, and the last straw was when Josh Smith released his new book iOS Programming for .NET Developers. More on that once I’ve actually read it (I’ve only read the sample so far).

So this past week the iMac got here and I installed it last night. Talk about foreign land. Still getting a hang of all the differences (lots of keyboard keys react differently from Windows, for example) and of course the way you interact with OS X is at times very much different from how we do things in Windows. After upgrading to the new OS X “Mountain Lion”, I am now installing various applications and configuring the OS, slowly but surely. Last night and this morning I was freaking out, but I’m slowly getting used to it. Oh and that 27″ monitor looks like it wants to swallow me whole… Bottom line, this is a very nice and elegant machine, and having had to unplug the PC tower to move it elsewhere, I certainly appreciate how little cabling is necessary – an all-in-one computer does have its advantages.

The iMac is really a fancy PC, so once I got the basics up and running I’ll be installing Windows 7 on it as well.

More later…

Moving to VoIP with voip.ms

So a few weeks ago Rogers sent a letter saying that my Internet and Home Phone services were going up $2 per month beginning in March.  Not a huge increase, but then it made me realize I’d be paying nearly $50 a month for my landline, which I don’t use all that much (and I use the prepaid cellphone even less).  I looked into possibly replacing both the landline and the prepaid cellphone by a smartphone with some “decent” plan (and coverage, for when I visit family), but no one company had anything that really satisfied me (Koodo Mobile was the closest).  That was still a rather expensive proposition for something I knew I wouldn’t use all that much (and I’m not interested in becoming one of those cyberzombies that walk around head down, their eyes glued to their smartphone).

I decided to take a second look at VoIP.  That’s a technology I’ve been staying away from because I wasn’t too keen on relying on the Internet connection being up all the time. But then again, in nearly six years I don’t think my connection has been down six hours – not while I was at home anyway.  Also my nephew has a MagicJack, which is probably as simple as it gets as far as VoIP goes – just plug it into a computer’s USB port.  I don’t like the sound quality when I talk to him over that line, but reading various comments on VoIP forums, it seems like it could be an issue with his Internet connection – he does live in a “rural” area and maybe that connection just doesn’t have the speed that we get in the city.

So I started doing some extensive research on the various services.  A lot of the big ones such as Vonage and Primus charge quite a bit for VoIP – say around $30/month (this varies).  Some lesser-known services could be as low as $9.95 assuming you pay for a year in advance, but the reviews weren’t so great.  That’s when I started running into “pay-as-you-go” VoIP providers and realized this was probably the best alternative for a light phone user like me.

I ended up choosing voip.ms, a company based in Montreal and has been around for almost four years (which is rather long in the VoIP world). Some of the reasons for choosing them were that they were one of very few VoIP providers that had overwhelmingly positive reviews over at DSLReports.com, that they are based in Canada (though they charge in U.S. dollars, like most of the smaller guys), the feature set is also quite extensive – way too much to discuss here. This is also a “Bring Your Own Device” provider in that you don’t/can’t buy the hardware from them (unlike guys like Vonage and MagicJack, etc who force you to use their locked-in hardware), so I was free to buy the VoIP ATA of my choosing. And of course the prices are pretty good: $0.99/month for the phone number, $1.50/month for e911, and then after that it’s only the minutes I use. Depending on various factors (incoming, outgoing, value vs. premium routing), the price goes from about half a cent per minute to a little over a cent. Assuming you have to pay about a cent a minute, that’s roughly $10 for 1000 minutes. I normally don’t go anywhere near that. So I estimate that my monthly cost will go down to anywhere between $4 and $6, depending on how chatty I get on a given month. 😉

I first signed up on the service – for free – and ran an echo test using a softphone. The quality was crystal clear. The next day I went out and bought a Cisco Linksys PAP2T-NA ATA. 45 minutes later I was making my first phone call, and that includes upgrading the firmware, fishing for that extra phone I knew I had somewhere, and adding funds to my voip.ms account.

A week later, after testing it for a few days, I requested a port of my existing phone number. This took a week (normal delay – this can take up to four weeks if whatever company currently “owns” your phone number decides to take its time). The day of the port the phone was down for a few hours while it was being transferred between providers. Later in the day I cancelled my Home Phone with Rogers (thank you Rogers for not annoying me with the “30 day service cancellation notice”), which brought my monthly Rogers bill down by nearly half. That’s a significant amount of cash.

voip.ms is a more “techie-oriented” provider (at the moment anyway – they’re working on making things more user-friendly) than guys like Vonage or Primus, though quite frankly, with the PAP2T setup instructions on their wiki, all I had to do was follow the instructions to the letter and everything worked right away. So even though I found all the terminology and options intimidating at first, I could almost have done set this up with my eyes closed.

Obviously I can’t guarantee – and I am not saying – that voip.ms is the best VoIP provider out there. I haven’t had any experience with the other providers. But between the ease of getting things running and not having to wait for some hardware in the mail, the pricing and features, this is an excellent deal. I’ve had to contact their support a few times, not for problems but for questions and clarifications, and I always got a reply back very quickly even when I set the ticket priority to “Low”. I even got a few replies after their official technical support hours on a Saturday. And of course so far the call quality has been excellent; the persons I talked to said it sounded the same or even better than my landline. So now I can save money to cover for whatever else will be going up in price. 🙂

Visual Studio 2010 a year later

So last April I posted about how much the default help system in Visual Studio 2010 sucks.  I mentioned H3Viewer as an alternative, but back then it wasn’t all that great.  It has improved a lot since and has become a very viable alternative.  Check it out @ http://mshcmigrate.helpmvp.com/viewer

I only started using VS2010 seriously last December when we converted our project to it (and .NET 4.0) at work.  Since we like pain, we also upgrade from CSLA 3.0 to CSLA 4.1, which is no mean feat.  But at least now the technology is more future-proof… For 6 months or so. 🙂  I was hoping for some speed improvements in VS2010, but unfortunately it’s at least as slow as 2008, and slower in some areas.  Still, there are enough usability improvements to make up for it – including the ability to make floating editor windows and a some good improvements in the editor.  There’s also an impressive amount of third-party add-ons, most of them free, that make the beast even more powerful.  I’ll post about a few of my favorites soon…  Anyway, like most software out there, I’ve barely touched the surface.

But a few minutes ago I said I was going to learn Python, so how about I stop typing and go do just that. 😉

The help system in Visual Studio 2010 sucks!

I finally got a chance to play a little bit with Visual Studio 2010 while I was setting up the Mercurial source control system on my PC, and while I found a few cool improvements in the user interface, I was disgusted by how useless the help system has become.  What were they thinking at Microsoft?  The help system uses the default browser (in my case Firefox – you’ll never pay me enough to use IE), and gone are things such as the very useful index feature.  All you get is a Search feature that returns everything and nothing, without any hint as to where it was found.  Try searching for something that’s in multiple namespaces and/or languages.  Horrible!  Also it opens a new tab in the browser every time I press F1.  Wow…  They could at least have used VS2010’s internal browser – after all if you paste the help URL in there, it’s able to display it.

Apparently this will be fixed in SP1.  Hey, that’s not any time soon!  There are a couple of alternatives that aren’t quite up to the challenge, but may help fill the gap in the meantime:

H3Viewer: http://mshcmigrate.helpmvp.com/viewer

HelpViewerKeywordIndex: http://visualstudiogallery.msdn.microsoft.com/en-US/4af86641-a302-4edf-9853-007bcc670b30

Both are kind of slow and do not seem to work with context-sensitive help (if they do, I haven’t found how yet.)  Even with their drawbacks, they seem more useful than the abomination Microsoft delivered to us.  The Visual Studio help system started going down the drain with Visual Studio 2005 (it was great in 2003), but the 2010 system has to be a joke.  Maybe they originally planned for an April 1 release…