Pointers in C

I’ve been brushing up on some of my programming knowledge and have re-visited an area that has always stumped me … up until now. Pointers in the C programming language. This time, I think I get it, but I’m still not sure. So that I have something to ponder on, I have summarized the conundrum here.

The unary operator & gives the address of an object, so the statement
p = &c;
assigns the address of c to the variable p, and p is said to “point to” c.

The unary operator * is the indirection or dereferencing operator; when applied to a pointer, it accesses the object the pointer points to. Suppose that x and y are integers and ip is a pointer to int. This artificial sequence shows how to declare a pointer and how to use & and *:

int x = 1, y = 2, z[10];
int *ip; /* ip is a pointer to int */

ip = &x; /* ip now points to x */
y = *ip; /* y is now 1 */
*ip = 0; /* x is now 0 */
ip = &z[0]; /* ip now points to z[0] */

The declarations of x, y, and z are what we would expect. The declaration of the pointer ip
int *ip;
is intended as a mnemonic; it says that the expression *ip is an int.

So, that’s all there is to it!

Source: Brian W Kernighan, Dennis M Ritchie; The C Programming Language; Prentice Hall Software Series, 1988

Cats and stuff!

I love cats, really I do!

However our front garden has become, well not to put too fine a point on it, a lavatory for what would seem to be all of the cats in the neighbourhood. And, without being too delicate about it, from the state of what they leave behind I have to conclude that a) some of them are not really all that well (or are being fed the wrong food) and b) that basic cat training seems to leave out the part where they are supposed to bury what they leave behind. Not that, frankly, it would please me much more.

Now when we had cats (more of this below) ours were house-trained pedigree Persians. When I say “house-trained” I don’t just mean that they were trained when in the house to use a litter tray; oh no, it went further than that. If our cats were out in the garden and they needed to “go”, they wouldn’t simply look around for the nearest flower bed and make it their convenience; they would come inside and use the litter tray, just as they had been trained.

So we have been trying to eradicate the ongoing front garden issue, by using special granules (which need to be put down every couple of weeks, more frequently when wet) and other proprietary brands of cleaner that cats don’t seem to like! But after a tidy up recently and a trip to the local DIY shop to buy even more “b*gger off out of my garden” granules, we discovered a relatively inexpensive sonic deterrent that activates when there is movement (sorry about that pun) and emits a high pitched sound that cats don’t like. And do you know what? It seems to be working and our cleaned up front garden is now no longer the local feline lavatory.

That in itself might be enough reason to write a blog, but my real reason for writing about cats is that today is the fifth anniversary of us losing the first of our two Persians, Peaches; her sister Pebbles outlived her by some six months or so.

Here are a couple of pictures of them. Rest in peace, girls!

 

Peaches

Peaches

 

Pebbles

Pebbles

 

Dear Mr BT …

Dear Mr BT,

Many thanks for such an efficient service providing my new BT Broadband and Home Hub.  Plugging it in and setting up was so easy.  You even sent me two new broadband filters, which is ironic as I had just bought two as advised by Mr AOL.

I had phoned Mr AOL when I despaired of the slow broadband speed that I was getting from him during the evenings and weekends, dropping from approximately 4.5 Mbps at 03:00 in the morning down to roughly 0.2 Mbps at the times when I wanted to use it.  Mr AOL got me to speak to one of his technical colleagues, who only advised that new filters would fix the problem … and that it would take 24 hours of them being in place for the speed to settle down.  Mr AOL’s technical colleague also did not seem to think that he could do anything more about my broadband speed.

So, Mr BT, I am really impressed that since I plugged in my new router (not even suggested by Mr AOL) and connected to your broadband service, I have been consistently been getting download speeds of approximately 4.5 Mbps, which considering I live in a rural village is far in excess of my expectations.

The two additional filters are welcome and the cost of the two new ones I bought on Mr AOL’s advice was greater than the cost of having your new home hub delivered to me.

Thank you once again; you have enabled my online life to continue once again.

 

Yours sincerely,

A Grateful Customer

PS: I’d recommend you to anyone who wants fast reliable broadband.

Loose ends and reflection

We are back home safely now.  After arriving at St Pancras yesterday at about twenty to five, we got good connections for Ely and then into Kings Lynn arriving there just after seven.  The car was still there and started first time, although somebody had very kindly scraped my rear bumper.

image

Still,  I suppose it could have happened any time so I won’t let it spoil my memories of our holiday.

When we first found out that there were forty of us on the trip, it felt too large, especially for guided tours.  However it did mean that there was a good mix of people and they were all sociable and good company.  Train seats were arranged so that we were rarely sitting with the same people – which could have been a bonus if there had been anybody we hadn’t got on with.

The tour guide was excellent.  He is a freelance tour guide and until recently had been leading tours in places like Bangladesh.  This was his first time on the Tuscany and Venice tour and he did a wonderful job of using our free time to explore where we were headed.  Not speaking Italian didn’t seem to worry him or affect how he manage the tour.  When he’s not guiding tours, he’s a freelance TV cameraman, mostly at the moment working on Eastenders!  The guided tours at Florence, Pisa and Lucca were given by local guides, so he didn’t need to be an expert on any of the history or architecture of the places we visited.

Train travel is relatively stress free, especially with a guide, but getting luggage on and off (especially for so many people at a time) was quite an effort. I would pack less if I did the same again. Lots of time for relaxing, reading and dozing means we arrived home quite relaxed, even though we had been on five trains on the last day.

Having to be ready at a fixed time for excursions or onward travel (sometimes quite early) was not ideal for us on holiday, but a good discipline.

The places we liked and would definitely go back to are Venice and Lucca. Pisa only needs enough time to go into the Baptistry. Florence felt overcrowded most of the time (as did a few areas in Venice), so unless there was something specific that we wanted to see, for example an exhibition, we may not go back.

So finally, I would recommend this type of holiday?  In a word, for anyone who has not been to the places on the tour, yes.  I would consider a group holiday again, as it was fun and we were all experiencing new things together, with lots of support around if needed (especially from the tour guide).  Would I do a train holiday again?  Yes.  This was the first holiday I’ve had since I was about 17 when I was not driving – and that made it very relaxing.   We’ll definitely return to the area again, but not in a group.  Whether we use the train or air travel to get there would depend on flexibility and availability, but I’d be more inclined to use the trains rather than hire a car, either way.

Now … where shall we go next year?

Arrividerci

On Wednesday we left Italy, via Milan and Switzerland, crossing into France at Basel.  We stayed at Mulhouse, which I had never heard of before.   Before our evening meal we had the chance to stroll into the town and found a very pretty square.

image

image

Thursday morning we are getting ready to travel home, via Strasbourg, Paris, London and Kings Lynn.

Last day in Venice … for now!

Today was our last day in Venice for this trip.  We decided that we would use the Vaporetti to travel around today and, after a trip to a bank at Piazza le Roma we headed to La Pieta, Vivaldi’s church and the museum there.

image

The church was just as I expected; wonderful acoustics.  The museum was more elusive and I was told to to ring a doorbell at a house on Calle della Pieta.  On entering, we went up to the third floor and discovered we were in the old orphanage, but that the museum (on the first floor) was only open by pre-booking.  We had arrived at a Bed and Breakfast!  The very helpful man there tried (unsuccessfully) to get us on a tour at 12:00, but there was not one.  As a consolation, we were invited onto the terrace for a view well worth the disappointment and to hear the bells of Venice mark midday.

image

For lunch, we had lobster at a restaurant on the Canale della Guidecca, before going to the Galerie dell’ Accademia, by the Ponte Accademia.

image

Tomorrow we leave Italy, via Switzerland to stop overnight at Mulouse in France, ready for the final leg back to London (and for us, Norfolk) on Thursday.

Walking in Venice

Today’s tour of St Mark’s piazza, which included a (very) brief history of Venice, the Doges, their palace, the Campanile and the buildings around (and inside) the Basilica was preceded by a private boat trip from the train station, taking a different route to the Vaporreto.  This gave a spectacular views as we approached the piazza.

image

image

image

The tour was fantastic; as well as the obvious sights, we were taken further into the heart of Venice and saw, for example a palazzo now known as “The Snail” due to the added feature added after both wings had been built.

image

The other interesting feature of our tour was that it was trying to get around the piazza, not just because of the tourists, but because we experienced aqua alta.  I had not expected to see this in September and was surprised by how deep it was.  We had to walk around on temporary boardwalks, which quite narrow for people trying to walk in both directions.

image

image

We viewed as much of the Basilica as we could and by three o’clock needed sustenance.  After a wonderful pizza, we meandered around parts of Castello and San Marco, disappointed that the church of La Pieta and the Vivaldi museum were closed (simply as it was Monday – we’ll go back tomorrow) but we did discover the church where he was baptized.

image

If it’s Sunday … it must be Venice!

Seriously, it has been hard to keep track of what day of the week it is.  But today we had an early start to move from our Montecatini base to our Venice base.  Well, in reality, to Mestre, the “out of city” hotel area for Venice which does equate well to Montecatini Terme.  After all, who has heard of Montecatini, despite it being full of hotels of tourists visiting Florence, Pisa and Lucca, as we did, as well as many other places.  Mestre is the same, except everyone goes to Venice.  There really is not much to Mestre.

However Venice, when we went there this afternoon, was everything I had expected, with some unexpected twists.

We had been recommended to first approach St Mark’s by boat; today we were on a Vaporreto, tomorrow we do the same journey on our own boat.  The Grand Canal is beautiful – too many things to look at to think of photos.  St Mark’s was not what I expected, with the Basilica hidden until you get into the Piazza.  The Campanile was bigger and closer to the Basilica than I imagined.  I’ll be taking more pictures tomorrow, when we have our guide tour (which does take us inside St Mark’s – I’ve checked).

My first impressions of Venice are:

image

image

image

image

Artistic license next – I could not get far enough back to get the Basilica and Campanile in one photo without taking unusual steps!

image

image

image

We have two more days of getting lost in little passages, exploring the waterways, eating and drinking, as well as our guided tour tomorrow morning.