The C++ Programming Language, 4th Edition

4thCppYesterday, I bought myself the ePub eBook of the 4th edition of Bjarne Stroustrup’s The C++ Programming Language. For those who do not know, Bjarne is the originator, the one who gave birth to the C++ programming language ±30 years ago. The 4th edition of the book covers the newest standard of the language, commonly referred to as C++11.

For the past three years I’ve been programming in C#, and so I decided to pick up C++ again (I programmed in it from 1994-2010; 16 years). From the time that I started with C++ back in 1994, a lot has changed in the language, hence, the need to get the new edition of the book with all the changes related to C++11.

I originally had the third edition of the book, which was published way back in 1997. For some reason, I cannot find that edition in my study anywhere. The third edition of Stroustrup’s book eventually also became the foundation of the original C++ standard in 1998 and became known as C++98.

Bjarne StroustrupAnyway, I am really happy to have the new edition, since there have been many new and useful updates to C++11. Bjarne writes concerning the new C++11 language features,

“The result has been a language with greatly improved abstraction mechanisms. The range of abstractions that C++ can express elegantly, flexibly, and at zero costs compared to hand-crafted specialized code has greatly increased. When we say “abstraction” people often just think “classes” or “objects.” C++11 goes far beyond that: The range of user-defined types that can be cleanly and safely expressed has grown with the addition of features such as initializer-lists, uniform initialization, template aliases, rvalue references, defaulted and deleted functions, and variadic templates. Their implementation eased with features, such as auto, inherited constructors, and decltype. These enhancements are sufficient to make C++11 feel like a new language.

For a list of accepted language features, see the feature list.”

He further writes concerning the new C++11 libraries,

“I would have liked to see more standard libraries. However, note that the standard library definition is already about 70% of the normative text of the standard (and that doesn’t count the C standard library, which is included by reference). Even though some of us would have liked to see many more standard libraries, nobody could claim that the Library working group has been lazy. It is also worth noting that the C++98 libraries have been significantly improved through the use of new language features, such as initializer-lists, rvalue references, variadic templates, noexcept, and constexpr. The C++11 standard library is easier to use and provides better performance that the C++98 one.

For a list of accepted libraries, see the library component list.”

So, I have read the first 36 pages and still need to cover 1332 pages.

Here are a couple of C/C++ funnies:

auto accident;
register voters;
static electricity;
struct by_lightning;
void *where_prohibited;
char broiled;
short circuit;
short changed;
long johns;
long dong_silver;
unsigned long letter;
double entendre;
double trouble;
union organizer;
union jack;
float valve;
short pants;
union station;
void check;
unsigned check;
union onion; more at GNU.org

Here is a fun piece of code to ponder (What is the answer here?):

int a = 5;
int b = a++ + ++a;

And, lastly, something that many new programmers struggle with,

“To understand recursion, you must first understand recursion.” (See the
cplusplus forum)

pointers

Driving in South Africa: a pet peeve

I do not write about my pet peeve a lot. I have written about it here, here, here, here and here. Smile

When it comes to the driving of South Africans, in my opinion, I think we are of the worst drivers in the world. Not just in terms of handling our cars, but also in driving attitude.

road-rage-lisa-knechtel
Road Rage by Lisa Knechtel

One of my pet peeves is that some drivers drive as if they have an absolute right to the road and they will drive in which ever lane they want to at whatever speeds they want to. It is becoming very common for slow road users to insist on driving in the right hand lane (the fast lane). For those who claim that we do not have a fast lane, explain to me why the rules of the road say: Keep Left Pass Right? This is to enforce the free flow of traffic, so that some numb-skull does not hog any lane and thereby slowing traffic down.

In fact, this behaviour is becoming epidemic to the point that some drivers, no matter how slow they are, will drift to the right-hand lane and will not budge for any amount of cars getting stuck behind them. This is selfishness to the extreme, and it points to a personality that has not reached maturity yet!

Continue reading

After 3 months, the DVT remains! Part 2

Following my previous post, I visited my doctor. The outcome of the visit was not very joyful in itself.

Fibrosis has set in, in the vein in question and has for all intents and purposes been destroyed. It will never work again. In fact, it has become unusable to the point that I can now stop taking the Warfarin tablets since they will make no difference to the vein.

Compression Stocking image by Hutchi

However, I have to now wear the medical compression stockings of type TED permanently. If I do not wear this TED I can develop varicose veins, I will be predisposed to ulcers in the leg and cuts on the leg will be difficult to treat.

The reason I now have to continue wearing this stocking is that the valve in the vein that controlled the upward flow of blood is no longer working. So, with the pressure that the stocking exerts on the lower leg helps perform that function now.

As a result of all this, the doctor informed me, I will be predisposed to more DVTs forming. For now, I will have to keep a check on my body and if I feel any pain in my leg or chest, or if I suddenly feel out of breath and if I battle to breathe I have to contact him immediately.

It is difficult for me to fathom this since my leg has been feeling very good and I haven’t had pain in it for a long time. I really thought that by the time today arrived everything would be fine and the DVT would have dissolved. I’ve been trusting the Lord for a good outcome. Unfortunately that is not the case. In God’s providence He has seen fit for me to remain like this for longer.

All I can do is to stand with the prophet Habakkuk and proclaim:

“Though the fig tree should not blossom And there be no fruit on the vines, Though the yield of the olive should fail And the fields produce no food, Though the flock should be cut off from the fold And there be no cattle in the stalls,  (18)  Yet I will exult in the LORD, I will rejoice in the God of my salvation.  (19)  The Lord GOD is my strength, And He has made my feet like hinds’ feet, And makes me walk on my high places.” (Hab 3:17-19)

And to finish off, here is one of my favourite passages in the Bible:

“Blessed be the God and Father of our Lord Jesus Christ, who has blessed us with every spiritual blessing in the heavenly places in Christ,  (4)  just as He chose us in Him before the foundation of the world, that we would be holy and blameless before Him. In love  (5)  He predestined us to adoption as sons through Jesus Christ to Himself, according to the kind intention of His will,  (6)  to the praise of the glory of His grace, which He freely bestowed on us in the Beloved.  (7)  In Him we have redemption through His blood, the forgiveness of our trespasses, according to the riches of His grace  (8)  which He lavished on us. In all wisdom and insight  (9)  He made known to us the mystery of His will, according to His kind intention which He purposed in Him  (10)  with a view to an administration suitable to the fullness of the times, that is, the summing up of all things in Christ, things in the heavens and things on the earth. In Him  (11)  also we have obtained an inheritance, having been predestined according to His purpose who works all things after the counsel of His will,  (12)  to the end that we who were the first to hope in Christ would be to the praise of His glory.  (13)  In Him, you also, after listening to the message of truth, the gospel of your salvation–having also believed, you were sealed in Him with the Holy Spirit of promise,  (14)  who is given as a pledge of our inheritance, with a view to the redemption of God’s own possession, to the praise of His glory.” (Eph 1:3-14)

After 3 months, the DVT remains!

Start of a DVT

So, with this eventful year as chronicled here, here, here, here, here, and here, I had to have a sonar done on my leg this morning with the DVT.

I went in early to make sure that I could be done with this part of the day before I saw my doctor with the results at 10:30. I was in and out of the hospital x-ray rooms in 45 minutes! Really efficient!

However, efficiency put aside, I went in with the hope that the DVT in my leg had cleared and that I could stop using Warfarin and wearing a medical compression stocking every day.

The report-back by the doctor that did my sonar was not what I had hoped for. The report is as follows:

“This study was compared with a previous study performed on 28/2/2013. At the level of the previous deep venous thrombosis [] of the left superficial femoral vein, a thrombus is once again noted with no signs of recanalization… Left SFV thrombosis, unchanged in appearance from previous ultrasound, with no signs of recanalization.”

I will the doctor in about an hour’s time. I expect him to simply continue the course as I have been.

DVT-20130618In the sonar, the following can be seen:

  1. At the top image it can be seen from a front view how the vein doesn’t compress when pressure is applied, indicating that the clot, which stretched about 12 inches, has not dissolved.
  2. From a side view the same can be seen.

So, this is the story thus far. Once I am done at the doctor I will report back on what he suggests we do from now.

The doctor that did the sonar said that she didn’t think that a DVT that was as extensive as mine would have cleared after 3 months, and that I probably have to carry on with my treatment for some time.

Back from hospital, and no cancer!

man in praiseI am back from hospital, and I am grateful to say, I don’t have cancer! Apart from the DVT scare (that still exists), this cloud of cancer that was hanging over me was the worst! It was intended that I go into hospital on Monday, 15 April and that the procedure to find and remove the possible cancer was to be done on 18 April.

The reason for this, as explained in my previous post, was to make sure that my blood returned to normal after stopping my Warfarin intake last week Thursday. By Tuesday morning (16 April), my blood INR was down to 1.2 and I was ready for the procedure. So, I went into theatre on Tuesday afternoon around 17:00. I was done and dusted by 18:00 and being discharged from hospital. Since the doctor found no cancer, I was in and out very quickly. My wife went looking for me at the theatre waiting room, and after thinking that it had been 40 minutes since I went in, she thought to go up to my hospital room. By the time she arrived there, I had already visited the bathroom for some business.

When I returned to my bed, the doctor was already there to give me the good news and to discharge me from hospital.

I am really grateful that I have no cancer and can only praise the Lord Jesus Christ for that!

(1) For the choir director. A Psalm of David. O LORD, You have searched me and known me. (2) You know when I sit down and when I rise up; You understand my thought from afar. (3) You scrutinize my path and my lying down, And are intimately acquainted with all my ways. (4) Even before there is a word on my tongue, Behold, O LORD, You know it all. (5) You have enclosed me behind and before, And laid Your hand upon me. (6) Such knowledge is too wonderful for me; It is too high, I cannot attain to it. (7) Where can I go from Your Spirit? Or where can I flee from Your presence? (8) If I ascend to heaven, You are there; If I make my bed in Sheol, behold, You are there. (9) If I take the wings of the dawn, If I dwell in the remotest part of the sea, (10) Even there Your hand will lead me, And Your right hand will lay hold of me. (11) If I say, “Surely the darkness will overwhelm me, And the light around me will be night,” (12) Even the darkness is not dark to You, And the night is as bright as the day. Darkness and light are alike to You. (13) For You formed my inward parts; You wove me in my mother’s womb. (14) I will give thanks to You, for I am fearfully and wonderfully made; Wonderful are Your works, And my soul knows it very well. (15) My frame was not hidden from You, When I was made in secret, And skillfully wrought in the depths of the earth; (16) Your eyes have seen my unformed substance; And in Your book were all written The days that were ordained for me, When as yet there was not one of them. (17) How precious also are Your thoughts to me, O God! How vast is the sum of them! (18) If I should count them, they would outnumber the sand. When I awake, I am still with You. (Psa 139:1-18 NASB)

Going into hospital tomorrow

So, as the tough months continue, I have to go into hospital tomorrow. And, you can read about why I need to go into hospital here.

While I believe that God will bring about the best possible scenario from this for me and my family, it strikes me that I am somewhat stressed about this whole thing.

This will be the third time in hospital this year. It started with a broken ankle on New Year’s day. Then, two months later I landed in hospital with an emergency for eight days with a DVT (blood clot) of 10-12 inches long in my left upper leg, caused by the ankle operation on New Year’s day.

When I was in hospital with the DVT, they battled to thin my blood enough for about eleven days. They injected me twice daily at hospital with stuff to thin my blood, while I took tablets to help the process. My blood count (INR) only hit the target range of 2-3 after eleven days. Yet, since then, they have battled to keep my INR below 3 and it has been holding its position to close to 4 for about 60% of the time. Because of this I have a bleeding risk.

Now, since I need this procedure on Thursday, 18 April, I had to stop taking my Warfarin last Thursday, and tomorrow I am checking into hospital so that they can inject me with stuff daily to thicken my blood. So, now the very thing that they tried to prevent, stopping a clot from breaking loose and landing in my brain, heart or lungs, becomes a scary thought. Unfortunately, they can’t perform the procedure with my blood in its current condition, since I could bleed to death on the operating table. So, the battle begins tomorrow to bring my INR count down to 1.2.

Then, apart from this battle, what will they find? Will it be cancer? I pray that God will bring complete healing and that the lump is either just missing, or that it is completely benign.

I trust that in all of this, God will still bring about a good result, for me and my family. We do not always understand the outworking of God’s goodness, but I trust that His wisdom is greater than mine. I trust that all things will go well, and that I will re-join my family in health after Thursday.

Even in the midst of our worries, God is good, just and compassionate.

Lawrette McFarlane Photography

Who is Lawrette McFarlane? First of all she is a friend from the church small group that we attend at 3CI. She has an infectious laugh, is physically active (running), and professionally, she is a photographer.

As a professional photographer, she has done all types of photography, such as:

  • Travel
  • Documentary
  • Commercial – studio and location
  • Portraiture
  • Interior and Architectural
  • Stage / Music
  • Medical
  • Wedding
  • Fine art / Lomography
  • Senior lecturer at National College of Photography / Vega (Evening school)

She has done work for a whole lot of companies, such as:

  • ‘Weg’ / ‘Go’ Travel and Outdoor Magazine
  • Bombela Civil Joint Venture
  • NJW Engineering Services
  • Technology Innovation Agency
  • CSIR
  • VBKom Consulting Engineers / Projects
  • SVI Engineering
  • Sainsbury Design
  • FAIS Ombud
  • Realty1 Lynwood – Willem & Letsie Coetzee
  • Habitat for Humanity

Her pictures are absolutely amazing! Go to her website to view the pictures she has taken for clients. She lives and works in the Gauteng province of South Africa, so if you would like to have some photography done of a high standard with lots of creativity, then contact Lawrette McFarlane!

%d bloggers like this: