Book Review: Thinking in C++, Section Edition, Volume One

Posted by Brian R Cline | Book Review,Programming | Wednesday 1 September 2010 10:30 am

“Thinking in C++, Section Edition, Volume One” (ISBN:978-0139798092) was written by Bruce Eckel. The book is quite large coming in around 800 pages and focus on making the transition from C to C++, and focusing on practical programming. I believe the book could be much shorter if Bruce had a lot less repetitive, and long winded sort of writing. Bruce’s writing style does not really equate well with using the book for future reference later: thankfully, I don’t anticipate using C++ much as I focus almost entirely on creating and designing web sites.

The typography and presentation of the book need significant work: the font selection and size are annoying and incredibly difficult to read for long periods of time. The printer should have used a smaller size font and reduced the size of the headings slightly as well to decrease the number of pages, and to allow easier reading. The quality of the binding of my paperback edition of the book is absolutely terrible: the cover barely survived 1/2 a day of travel in my briefcase.

Each chapter ends with a lot of different exercises: unfortunately, the author does not include the exercises for free. “Thinking in C++, Volume 1 Solution Guide” must be purchased to see the answers to only some of the exercises. Exercises generally aren’t too bad, or too complex, but for the most part there’s always two or three that could almost be copied directly from the text.

Bruce covers a wide selection of C++, but doesn’t really cover the C++ Standard Template Library until another volume which of course must be purchased separately. I really believe that I learned more about object oriented programming from his introductory text than I have practicing OOP for the last three years: I really feel more confident about when to use composition vs inheritance. I was extremely disappointed to not see a mention of lint or any of the other automated testing and syntax sort of checkers; Bruce covered the compiler and how it generates assembler pretty well, so I would have liked to have seen a little bit about using lint or other software to check for memory leaks.

Bruce’s order of some of the topics should really be reconsidered as I often found myself flipping forward to read more about something especially in Chapter 15 there was a lot of flipping to read about something in Chapter 16. I find the forward references to be extremely frustrating and sometimes this can make studying more difficult.

Over all, I think Bruce has written perhaps one of the best textbooks I have ever used and has some issues with printing, his writing style, and making his text more reference friendly. I hate to say it, but I think that sometimes a box with important things that should be remembered or some tips is something that could be used to make referencing more friendly. (Dietel and Dietel produce many textbooks that make good use of boxes for emphasizing or summarizing something important.)

Places to Visit Around Niagara Falls, Canada

Posted by Brian R Cline | Niagara | Sunday 29 August 2010 8:39 pm

Niagara Falls, and the Rest of Niagara Region have a large collection of great attractions, museums, art galleries, and more. There are probably dozens that I’m forgetting or maybe never even visited, but if you leave a comment I will be very happy to add it.

Get Out Niagara provides a really great collection of more natural places that can be visited. Check In Niagara chronicles a local’s journey to rediscover Niagara using just a cheap video camera.

Former Battlefields (War of 1812)
Historic Fort George
Old Fort Erie

Attractions
Maid of the Mist
Whirlpool Jet Boats
Niagara Parks
Welland Canal

Help My Kijiji Ad Isn’t Showing UP

Posted by Brian R Cline | Uncategorized | Saturday 28 August 2010 9:46 pm

Kijiji occasionally will block an advertisement from showing up for twenty four hours to prevent spam. I’m not really sure if an employee actually goes through the queue of waiting ads and checks if it’s spam or not.

To find out where your ad is visible, you should use Kijiji’s status checker.

Learning jquery

Posted by Brian R Cline | JavaScript,Programming,jQuery | Tuesday 24 August 2010 7:22 pm

I’ve been using jQuery since mid 2008 and have to say that I just love how much easier things are and not having to generally deal with the crossbrowser issues in Internet Explorer, Safari,Chrome, and Firefox.

In the roughly two years that I have worked with jQuery, I have refered to a couple of things to learn jQuery and improve my web based applications.

Rebecca Murphy wrote an excellent electronic book called jQuery Fundamentals that she gives away for free from her website. jQuery itself also has many video tutorials, and a fairly well written and maintained web based manual that works similar to a Wiki.

Hope this helps!

Handling Programming Errors

Posted by Brian R Cline | Experience,Programming | Tuesday 24 August 2010 6:12 pm

Handling errors, sometimes called defensive programming, isn’t really something I have been taught very well at Athabasca or Niagara College. Over the last few years, while handling customer support and internal user support I have come to realize that what the dialog box says and the frequency of errors is probably the single biggest user experience issue.

I use the following guidelines for developing and when to show error messages.

Visual Attributes The error message should immediately grab the user’s attention: on a web application it should be exactly in the middle of the screen using some sort of popup, in regular desktop applications it should be in the middle of the screen in a log box. For text, I usually use a bold and red coloured font.

Message The error message must be clear to your average user: if the printer is out of paper tell them that! Don’t give your user just an error code, because they won’t know what that means and they won’t want to read your manual or contact support.

Where? Your user wants to know where it occurred, and how to fix the error. If possible some sort of visual attribute should also be set if the error occurred on a data entry screen. Set the border of the element reg, set it bold if the text is invalid, or even use some sort of icon.

Always make sure your error messages are clear: users don’t want to have to search through some user manual for software they bought, or have to pick up the phone and call for technical support. Apple has really shown us that users just want things to work, and it should of course look pretty. :)

How To Edit the Hosts File in Windows 7

Posted by Brian R Cline | Windows | Saturday 21 August 2010 8:12 am

I’m an Administrator on my installation of Windows 7 and had to edit the hosts file for one of my projects. I wasn’t able to make the changes though because it kept saying file was in use. I realized that I need to run notepad as the administrator and then I could make my changes!

  1. I went to the start menu, and typed in notepad.
  2. Right clicked on the notepad icon and selected Run As Administrator
  3. Clicked yes when it confirmed whether it should
  4. Navigationed to c:\Windows\System32\drivers\etc\hosts

Hope this helps!

MODx How To Properly Link To a Page

Posted by Brian R Cline | MODx,Programming | Thursday 19 August 2010 10:08 pm

In MODx, it is always preferable to link to another page using the document id instead of using the friendly alias because sometimes MODx Evolution has a package that is appearantly capable of using the alias instead of the document id to provide a working link to another page.

The reason you shouldn’t use the alias instead of the document id is because it isn’t unheard of to have google or other search engines incorrectly access another page perhaps one that isn’t even available.

Using the document id is done in the following manner for Evolution:

>a href = "[˜77˜]"<Link to document 77>/a<

Using the document id is done in the following manner for Revolution:

>a href = "[[˜77]]"<Link to document 77>/a<

The documentation for MODx Revolution is really geat and should be used to learn additional things.

Hope this helps!

MODx Revolution – Dynamically Generating Google SiteMap XML

Posted by Brian R Cline | MODx | Thursday 19 August 2010 6:13 am

Google SiteMap and the other web tools provides a way for the owner or webmaster of a site to easily submit all of the pages to Google and keep track of which ones are crawled and indexed. Wikipedia provides a much more detailed description which goes beyond the scope of this post.

I didn’t want to have to manually try and figure out which links are children of other links for my own site (which again only has 5 pages anyway!) or other things like that, so I was looking for an automatic way to generate the google sitemap and then be able to provide it to google.

MODx Revolution has a plugin called GoogleSiteMap which uses a snippet called GoogleSiteMap I created a page, set the template to empty, and called the snippet directly on the page and then took the xml it created and pasted it into an xml file to submit. The XML it generates even correctly does the last modified date.

Hope this helps!

Centering a DIV Horizontally

Posted by Brian R Cline | CSS,Programming | Wednesday 18 August 2010 10:45 am

Assuming you have a basic knowledge of css and html putting a div in the horizontal center of a containing block isn’t too difficult. I’m going to center a div with only text, but the exact same css may be used for a div containing images,inputs, etc. I’m going to assume you are using html or xhtml strict and have a div that has the following code:


<div id="toBeCentered">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat</div>

All new web designers and developers assume that the css can simply be text-align:center; , but this isn’t correct because this centers the contents of the box instead of the box itself.

#toBeCentered {
text-align:center;
}

To make the div center horizontally we need to ensure we do two things:

      Set a width to the div
      Set the left & right margins to auto. Web browsers are required to give the margins equal width which will set the div exactly in the center. works width.

We must instead change the css to auto the left and right margins and must set a size to the div. Setting a size to the div

#toBeCentered {
width: 200px;
margin-left: auto;
margin-right:auto;
}

Hope this helps!

Wayfinder in MODx Revolution

Posted by Brian R Cline | MODx | Monday 16 August 2010 6:57 am

When I first tried MODx Revolution (which I did try before MODx Evolution) I found the documentation to be pretty good except about snippet syntax. The tag syntax has changed from MODx Evolution to MODx Revolution.


[Wayfinder? &startId=`0`]

has to changed to

[[Wayfinder? &startId=`0`]]

More information can now be found here for all of the tag syntax changes.

Next Page »