Showing posts with label computing. Show all posts
Showing posts with label computing. Show all posts

Saturday, 31 March 2007

Programming in C# - Part 1

So, I've been programming on and off since I was pretty young, starting with the classic

10 PRINT "HELLO WORLD"
20 GOTO 10

on my dad's old Commodore 64 when I was little. I advanced slowly and rather haphazardly, picking up bits of BASIC, VB, Java, SPLUS, C++, Prolog, MATLAB blah de blah blah. The main problem that I had was that that I only ever programmed at random, and never had any real projects to work on. The closest I ever got to any major programming was on a small number of Maths and Computer Science courses. I decided that it was now time to do some serious programming, and learn the "it" language of the moment - C#.

Starting with a open source C# IDE, I wrote a couple of silly pieces of code - producing lists of prime numbers up to a few million. This was all well and good, but it was all command line and I had a specific project in mind.

My plan is to produce a piece of software which displays special cards, either windowed or full screen, which contain stuff for brainstorming and problem solving. The software would read "packs" of cards in an XML format. The software can be given away for free (open source even) with a basic set of cards, and other packs can potentially be sold. Whether protection is necessary for copying I don't know - probably not, since most users will probably be reasonable.

Anyway, this is moving a bit off the topic of learning C#, but it gives you the premise on which my learning is based. Having searched around google for creating GUIs in C#, I found a set of video tutorials on MSDN. The ones I would like to highlight are the "Absolute Beginners Series" - a set of about 10 hours of videos starting from the very beginning and ending with creating an entire RSS reader app. It is a great guide, and has set me up quite nicely for starting my own app over the coming months. I also would like to suggest getting Visual C# 2005 Express Edition - although it's not open source, it is much more powerful in creating Windows applications, and it is free (as in beer).

So, over the coming months, I will begin posting updates on how my program is progressing - keep reading!

Sunday, 25 March 2007

OpenOffice.org - For University Students

So, I’m going to give a brief overview of the OpenOffice software – a free open source office suite for Linux, Windows and MacOSX. This review is aimed at University students.

I first used Open Office in the Linux room of the maths department of my university in my first year, and at the time, although it was adequate for reading and editing Word docs, I found it was underpowered compared to the MS office suite I had back at home. Unfortunately, I didn't know at the time that the software was months out of date.

Last week, I saw a news story on one of my RSS feeds about how open office is now supporting MS VBA – visual basic for applications, a language for writing macros, which I use most of the time I use Excel – and decided to give it another try. Unfortunately, I didn’t fancy the Novell branded version (a full ~500Mb ISO image), and didn’t want to compile my own. However, I was told by a friend that OOo has its own OOo Basic language, similar to VBA, and there are only a few additions to the new version to make it entirely compatible.

So, what does OOo consist of? You are provided with the standard office features – word processor, spreadsheet, presentation designer and database – along with a couple of extra bits (a math design mode, like MS Equation Editor, and a drawing program similar to Visio). Everything is saved in Open Document Format normally, but things can be saved in Microsoft or Lotus formats, PDF and even as LaTeX source.

So going back to my experience, I downloaded Open Office before creating a spreadsheet for some simple programming (calculating a collection of rational approximations to e) since my copy of MS Office is starting to play up these days (strange how we just accept the fact that as computers get older they start breaking, even if they’re exactly the same as before… That’s for another day though). I installed the software (a 93 Mb download for Windows – tiny really), and jumped straight into Calc – the Open Office spreadsheet.

Moving around Calc felt immediately familiar, with all control buttons in a similar place to in MS Excel. Going straight to the Tools menu, I found the Macros… option, and chose to organise my macros in the Open Office BASIC window. Finding where to put my macro wasn’t immediately obvious – the layout is slightly different to in Excel – but was really obvious enough. Most everything in OOoB is the same as VBA, however there are a few significant differences. You cannot just call “Cells(x,y)” to read or write, you have to perform a rather longer set of commands. Bear in mind, however, that OOoB can be used in any of the Office tools, not just calc. Writing my macro was as easy as in VBA really, and the Help menu is decent (better PDF documentation is available from the OOo website). One issue I did have was pressing the play button in the IDE to run the macro didn’t work, but this turned out to be my fault for not reading the documentation – I simply needed to save somewhere else or run from Calc instead. Finally, on macros, OOo also appears to support Python and something else – unfortunately this is not really my area so I can’t go any futher on that.

So, what about the rest of Calc? Well, it seems to provide all the usability of Excel and then some, from all the in-cell functions to being able to create simple commands with words (eg “profits – losses” given correct titles – this is like Excel for Dummies). Obviously, these for Dummies-esque bits do not really get in the way of everything else, and can be switched off in a jiffy.

The 2 random bits – Math and Draw – work well at what they do, creating Math equations (albeit not with quite as easy to use a GUI as equation editor, although a lot quicker) or creating Hierachical diagrams or even logos quite easily. I have to say though, I will not be using these a lot – if I need to write maths I use LaTeX, if I need to draw things, I’ll use the GIMP.

Writer (the word processor) is powerful and fast, with everything you could need (like mail merge and autocorrect) and some stuff most people would never touch (Python Macros anyone?). It’s a similar story with Impress (Powerpoint) and Base (Access). In fact, being like MS Office and then some seems to be a recurring theme throughout OOo, and with the ability to export to PDF being a big draw to many people (given that the only other way would be through Adobe Acrobat Standard, costing extra money over MS Office), I really feel this is something which could potentially replace MS Office in the home and workplace.

So, in conclusion:

Get OpenOffice.org!