1. Technology
Send to a Friend via Email

C / C++ / C# Blog

By

Follow me on:

And so I face the final curtain

Wednesday July 31, 2013

After about seven years including 1,820 blog posts, 350 newsletters and hundreds of articles I've decided for various reasons to bow out from writing About C,C++, C# (and unofficially Google Go). It has been fun, educational, satisfying and I'm sure someone will continue after me.

Thank you to everyone who emailed me, entered programming challenges, made suggestions, contributed code etc. Everything I've written will be staying up here for a few months longer.

As for me, I'll be writing code for iPhone and Android Apps (in C# and maybe Objective-C) in my own business.

I hope that About.com might start looking for a new About C,C++ and C# Programming Guide, so if you think you have the passion and the knowledge, check their beaguide pages until it appears, then apply. Good luck!

As for me, I'm on the web. You might have to look on the second page of results (for now) but you'll find me!

Thank you and goodbye.

David Bolton

Tox - Cross Platform Secure IM / VOIP

Tuesday July 30, 2013

Written in C, Tox aims to give you a bit of privacy (at least until the NSA can decrypt all the stored data!). It's been created to be easy to use and let you connect without anyone else listening in.

I'm always a little sceptical about projects like these because I don't know how well the software is written from a cryptographic point of view. I understand a little about how encryption works but am certainly not qualified to judge it. But having source code like this out there to do this is definitely good.

I do think P2P is the way to go for privacy because it's a lot harder to vacuum up than a server based protocol. Perhaps thats why Microsoft switched Skype to server based (from P2p) after they bought it?

XWT - A cross Platform .NET UI Toolkit

Monday July 29, 2013

Xwt is sort of like WxWidgets etc where this one open source library lets you write GUI code for different environments. In this case it's a C# library for WPF or GTK (using GTK#) on Windows, Cocoa engine on Mac (using MonoMac) and GTK on Linux.

There's quite a comprehensive set of wudgets, virtually everything you need (labels, checkboxes, buttons etc), all inheriting from Xwt.Widget. Here's a look at the simplest program.


using System;
using Xwt;

class XwtDemo {
    [STAThread]
    static void Main ()
    {
        Application.Initialize (ToolkitType.Gtk) ;
        var mainWindow = new Window (){
            Title = "Xwt Demo Application",
            Width = 500,
            Height = 400
        };
        mainWindow.Show () ;
        Application.Run () ;
        mainWindow.Dispose () ;
    }
}

Finding Work Face to Face

Sunday July 28, 2013

One thing that the internet is not quite so good at is helping you introduce yourself to customers face to face. Last Wednesday evening I went to a Silicon Roundabout Meetup at Google Campus in Bonhill Street in Islington, London. There were over 200 people there.

I've done networking before and quite enjoy it though it's not everybody's cup of tea. I learnt one valuable lesson; it's difficult to show off an App you've created when your smartphone battery has zero charge! D'oh. I'd use maps with Location Services enabled to help me find the place and in a city it can drain the battery quite quickly. Next time, I'll make sure the charge is at 100%

Today I've spent some time switching my iPhone App's TCPClient in C# to run asynchronously using await and async. I've chosen to use TCPClient rather than Sockets but I'm not sure which is best. It sets up a connection, sends and waits for any data sent back and every 30 seconds checks for any new data. Any recommendations?

Xamarin Update to Mono 3.0

Friday July 26, 2013

Xamarin, the C# development system for iOS and Android that I enthuse about has just done a major upgrade. Being easily seduced by leading edge (aka bleeding edge) technology I went for the upgrade and it failed. It wiped out the Xamarin Bonjour service files and didn't replace them, so the install had to be rolled back.

The Xamarin support were very quick to get it sorted out and it's fully working again. This upgrade has brought full C# 5.0 (so async and await can be used) and Mono 3.0 compatibility. I've documented a couple of minor but potentially time wasting gotchas that are easily sorted with the Xamarin Visual Studio plugin reconnecting after an upgrade.

Best Method of Pricing Contract Work?

Wednesday July 24, 2013

Yes this is programming related. I've been asked to price up creating an iPhone App (in C# using Xamarin) that is a hand held version of a website used for processing a lot of retail data and returning answers to complex queries. There are multiple APIs involved and my son-in-law wrote the original website so at least I have technical help there when (not if!) I need it.

I usually work on a price based on my estimate of hours but getting that estimate in this case, is hard. I can usually look at a piece of work, and come up with a total hours to do it. I then multiply that by 2.5 to allow for interruptions, delays waiting for answers, technical issues and debugging time. It usually works out close but this time, I'm a bit unsure. Any suggestions?

Latest C Tutorial Published

Monday July 22, 2013

As promised this latest C tutorial is about low level operations, bit manipulation and even very light weight encryption using the ^ (XOR) operator.

There's still a few more tutorials to go to cover the rest of Ansi C but I'll soon start looking at C99 using GCC shortly.

Here's a Surprise- C99 in VS 2013

Saturday July 20, 2013

Yes C99 will be supported in Visual C++/Studio 2013. Presumably they're bringing out a new version of their flagship software tool so soon because they've found a designer who doesn't like BLOCK CAPITALS in the top menu <g>.

Microsoft have often said that C Support in Visual Studio/C++ would not go past K & R ANSI C so it's a pleasant surprise. Some cynics have said though that it's needed for some aspects of C++ 11, but I'm unsure if that's true.

The Joys of Programming

Friday July 19, 2013

For most of this month I've been working on a commission to convert a Windows Phone App to iOS using Xamarin Studio. The last three days have seen me immersed in the field of TCP/IP trying to have my iOS Client talk to a server running on my PC. I was given the spec for the server, packet types etc and half this week was spent fruitlessly talking to the server and getting zero bytes back.

When you get a problem like this, you have to go over it step by step in a logical manner. At one point I could send from the simulator over my local network but not from my phone over 3G to my PC via the internet even with port forwarding at the router. But that was a silly one, I thought I'd configured the server to be best friends with the firewall. The firewall thought otherwise but if I took it down, the iPhone message could reach the server!

Today I found out that not only was the spec a little out of date (written five years ago), it defined a protocol that was based on packets of 20 bytes. Only, it turned out they weren't 8 bit bytes but Big Endian 16 bit ints. And this evening after reading a 5,000 line VB.NET client program in depth I discovered that they weren't actually 16 bit ints but characters. I was sending a value 0, it was expecting '0' etc (sigh!). This actually makes sense as the server author wrapped all packets inside a stx/etx pair (values 0x2 and 0x3) and he didn't want the sequence disrupted by values in that range inside a packets so a 3 is sent as '3'.

The moral of this tale is don't trust documentation but work from the code. Just now I got my first 20 byte packet back from the server. Oh yes it's allowed to send 20 byte packets...!

Expect a TCP/IP C# tutorial shortly...

Rampant Pixels Foundation Library

Thursday July 18, 2013

This caught my eye because of course I write games code in C and the worst aspect of that is reinventing the wheel. The Foundation library offers a lot of abstractions of data types, threads and synchronization, object lifetime management, UTF-8 and UTF-16 text and lots more.

Best of all is that it's free and cross platform and my favourite word at the moment: orthogonal. If you program in C (games or otherwise) this may well be worth a look.

Top Related Searches

©2014 About.com. All rights reserved.