Thursday, February 2, 2017

'c' on steriods ?

'go' test # 2
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
package main

import (
 "bufio"
 "fmt"
 "os"
)

func main() {
 // Read From 'stdin'
 stdinscanner := bufio.NewScanner(os.Stdin)
 // Split Input into words using intrinsic
 stdinscanner.Split(bufio.ScanWords)

 // Output the words
 for stdinscanner.Scan() {
  fmt.Printf("%s\n", stdinscanner.Text())
 }
}

We have a simple program that reads a sentence from stdin and outputs each word - we can invoke it like :-
bash-3.2$ ./splitsentence
the quick brown fox jumped over the lazy Garth
the
quick
brown
fox
jumped

- we need to Ctrl-C here to stop splitsentence executing, else, we can do this, in the Unix 'pipe' style :-
bash-3.2$ echo "the quick brown fox jumped over the lazy Garth" | ./splitsentence
the
quick
brown
fox
jumped
over
the
lazy
Garth

Wednesday, February 1, 2017

Learning to "go"

I know this is (was) my cycling blog, but for the meantime it will have to also work as a tech blog.

I'm learning a new language .. "go" - to check that I have the environment set up, here's the ubiquitous "Hello World" :-

1
2
3
4
5
6
7
package main

import "fmt"

func main() {
 fmt.Printf("Hello, Garth.\n")
}

which produces the desired output :-

1
2
Garths-MacBook-Pro:hello garthjl$ $GOPATH/bin/hello
Hello, Garth.

Well, it may be pretty boring, but it proves that the environment is set up correctly, it illustrates using hilite.me to format the go code AND the bash session output :-)

Nicely enough, Visual Studio Code (on my MacBook Pro) has 'Go' Extensions and tools (https://github.com/Microsoft/vscode-go"), see the 'Using' section at that URL on how easy it is to set up (I haven't installed 'delve' yet, lets learn how to walk before we run)

Notes to self : switch blogger to HTML before inserting any pretty printed HTML snippets [sigh]

Friday, October 7, 2011

Day Six - Friday (2)

Our last day of riding took us east towards the Alpilles
massif. Although there are no high peaks, the jagged
ridge gives the impression of being higher than it is.
Riding out of Arles along tiny back roads, where meeting
a car is an event, we tackled a short stiff climb to the
hill-top village of Les Baux.

The bottom gear effort was richly rewarded by the
sublime views and the town itself, which is dramatically
perched on a rocky outcrop.

Then it was on via a stunningly twisty descent (ok, I lie
slightly, after a 'bit more of the freaken hill') to the pretty
little town of St-Remy-de-Provence for lunch.

St Remy the birthplace of Nostradamus,  is also celebrated
as the subject for many of Van Gogh's paintings and drawings.
After lunch, we visited  the hospital of St Paul-de-
la-Mauseole, the sanitorium where Van Gogh committed himself
after his argument with his best friend Paul Gauguin.

Our final stretch of riding took us on  on flat, quiet lanes through
orchards and melon fields to cross the River Durance at
Cavaillon, and from there its a short hop back to the
Mas de Cure Bourse outside L'Isle-sur-la-Sorgue for the
final night's celebration dinner. We were all very glad to make it
back to base camp after 72.97km, according the the ride notes,
today was a 65.2km ride (the gps was turned on for the walking
through the 'sanitorium', and when I had to 'play sheep dog'
and round up some strays in the group who were lagging behind,
while our ride guide fetched yet another lagger....

Its off to Paris tomorrow, but my heart's not really in it.

Thursday, October 6, 2011

Day Six - Friday (1)

Last cycling day today - if there are no further posts, assume
I didnt make it up a granny gear hill they have indicated, that strikes
fear into us lowly cyclists - plus, while the temp has dropped
below 20, yay, there is also a wind to contend with now - oh well,
I guess we'll keep cool ....

Day Five - Thursday

Heading south from Uzes, and skirting the city of Nimes,
we found more dramatic, rugged scenery before sweeping
out into the plains which reach the Camargue and the
Mediterranean. On the way we crossed the Pomt Du Gard,
this time on two wheels, as in over and not under

From here we had easy cycling through a series of
villages, each with a church and wrought ironwork
belfries so characteristic of the area (it would have
been much easier if a low speed rear end collision
with my 'canoe wife' Rebecca hadnt gravelled my
knee and slightly bent the deraillier arm, but a liberal
dose of betadine after my shower has fixed the knee,
and hopefully David had applied some pressure
to the deraillier arm on the bike - the betadine hurt
 more than the fall, although apparently there's an
interesting set of photo's going around showing the
aftermath and of me being hauled back to my feet)

A picnic lunch was followed by a wine tasting at the
Chateau Morgue du Gres, a prestigous winery of the
Costieres de Nimes appelation.

After lunch, we rode back through the northern fringes
of the Camargue, through paddies growing the red rice
of the region, and fields of the black bulls which are bred
for the bullrings of  Arles and Nimes (didnt actually see
any bulls, but smelt evidence aplenty that they were there)

We then crossed the Rhone to our hotel in the heart of Arles.

Arles has an immaculately preserved Roman ampitheatre, or
next doors's equally impressive Roman Theatre, or a short
walk to the Alyscamps Roman Cemetary or the 15th Century
St Trophime Cathedral, with its shaded cloister.

Elsewhere in Arles there's a Van Gogh museum, but, I felt
like a beer, so it was back to the hotel for pre-dinner drinks
for this little black duck.

Total distance 56km, gps said we did 56.99

Wednesday, October 5, 2011

Day Four - Wednesday

Today, we Headed out on a circular route bringing us
back to Uzes, so we made the best of the morning organic
markets before setting off around 10am. The morning market
also provided the bases for our picnic linch.

Our main destination for the day of the Pont Du Gard, an aqueduct
built by the romans as part of a system to carry water from
Uzes to Nimes. An awe inspiring feat of engineering, and
in harmony with its setting over the River Gard. Getting
there involved a few technical spots of riding, providing
me with no great issue - rather enjoyed it.

Rather than cycling the whole way, we took to to canoes, taking
in the splendour of the Gard gorges, and the Pont itself, from
the water (luckily, on top of and not under) We canoed 12km
in all, 8 to get to the lunch spot, then another 4 to the
pick up point - I was seriously doubting my abilities to
hang onto a bike on the way back, my arms were knackered,
but had a flyingly good trip back - will sleep well tonight.

The countryside on the way back is known as the garrigue,
a rugged beautiful country of the department of Gard, cant say
I took in the supposed scent of wild thyme and basil, or
spotted a wild boar (just as well for the boar, but then
again, after the Italian experience, maybe not)

ps.. canoeing can be fun - out of some of the couples who
teamed up, my 'canoe wife' Rebecca wasnt threatening
divorce after the first 8km, so we stuck at it - go Team
Australia.

The gps reports 21km travelled on the bike.

pps : Lucas PawPaw ointment - magic stuff !!!!

Tuesday, October 4, 2011

Day Three - Tuesday

Today we set out across flatlands of Rhone River, which we
crossed at Coustellet - we were told to expect (and wernt
dissapointed then) whence crossing the river, we ran into a
bit of a breeze - luckily, we arnt talking about 90knot head-
winds here, so all was well.

We have  now entered vineyards of Cotes du Rhone
villages, where every hamlet has its own take on how wine
should be made. Our rout took us to bustling town of Bagnois-
sur-Creze, where the hall houses early works by Picasso, and
works by Monet, Renoir and Gauguin in its low-key art gallery

Back on the bikes, we traced our way through a landscape of
vineyards and cherry trees, and then after an interesting climb
of say 3-4% for 8km, we hd a  picnic lunch, at a lovely spot.
The climb wasnt hard er say, but the heat means one needs to be
careful to control breathing and fluid intake. After lunch, another
approx 4km of the same grade, and perhaps a slightly lesser grade
for another 2-3km, and for some reason I flew up this one like
I had wings/was possessed, we descended to St Quentin-la-Poterie,
which as name suggests is as historic centre for ceramics, with
artisan workshops selling their beautiful work directly to the public.

The final stretch for the day (a little more uphill) brought us to
the magnificent medieval cuty of Uzes. Boasting a beautiful
cathedral with its 'Tour Fenestrelle' or windowed tower, and
the Chateau of the Duchy of Uzes, there is a wealth of medieval
sites to visit, as well as boutiques. The Hotel (with character (*1))
is in the ancient quarter nestling under cathedral, including a rooftop
restaurant and terraced swimming pool

total distance was listed at 50km, the gps reported 57.42
(*1) ...hmm, I was rightly suspicious of this description in the
ride notes - as my brother says (paraphrasing), you need a plank
to sleep on, a bucket for your business, and anythings else must
be then luxury - so, I cant complain, but the word 'primitive'
comes to mind