2014-10-05

So Far, So Good

Well, it has been about two months, but my knee is improving to the point where I can walk in comfort for the first time in almost two years. This is a good thing, now I can get back to the exercise bike. I certainly did not want a knee replacement, which from all appearances would have been completely unnecessary. Now to deal with the lower back so that I can walk more than a few feet without pain there.

じゃね
2014-09-14

Old Geek

I think I am getting to be an old tech geek... (I say tech rather than computer because my technological interests are not just limited to computers.) Anyway, I am using a new piece of software to make my Blogger and Joomla templates. The software is called Artisteer.  Gone are the good old days of straight HTML coding, now I have to be able to edit CSS (Cascading Style Sheets) as well, now stick that in with PHP (for Joomla) and XML, and it can all be rather mind boggling sometimes. Oh well, I can write machine code and C, I should be able to do this....

じゃまた

It Was late, and I was tired.

So, I got bored with the way my blog looked.

As you can see, it has changed. It is still not complete, but I wanted a change.
It's looked the same since I first put it up in 2006.

So, I guess it was time.

じゃまた
2014-09-05

So Far, So Good

About a year and a half ago, I started having trouble with my right knee, bad enough that walking was a real strain, not long ago, I went back to my massage therapist and she poked and prodded my legs (well, basically every muscle from the lower back down) and said if you don't stretch these, they will basically become petrified. And that the tight muscles/tendons were the cause of the pain in the knee, not arthritis. So I have been faithfully stretching everything from the back down; she was right. The pain is almost gone, she also said it could take ten months to completely loosen everything up.

じゃね
2014-08-24

Canoe....

I spent portions of my weekend at Caperwray Harbour Bible School.
I was awfully tempted to take a canoe out for a spin, it would have
been the first time since 1992....

And unfortunately, my canoe paddling partner passed on last year. :(

Have to teach my wife to paddle....

じゃまた
2014-05-11

Incomplete Documentation and examples

OK, is it lazyness?

Lack of knowledge?

A cruel streak?

I am finding lately that developers and those who
write tutorials, example code and books, do a very
poor job of complete examples.

Why?

For example: I am working on a project in which
I am trying to use GtkIconFactory, not bad in and
of itself, but the sample code I have seen takes
you to the point where you can get the menubar
visible, but no one (and I mean NO ONE) who
writes example code either on the net, or in books,
shows you how to actually take it to the next step
and make those really pretty buttons you just
created actually do something, at least without
segfaulting....

Bah

ではまた

2014-05-02

Wow - 8 Months

8 months since my last post - busy times.
Got a few things planned and up my sleeve.
---

1) Got a small programming project going on
2) Got a complex software installation happening - which I want
    to make a how-to for, as none of the how-to's for this package
    are terribly complete.

Stay tuned. ;)

ではまた
2013-09-19

Programming - part 1: Gtktables

After not having blogged for months (and being embarrassed after
the large number of blogs from last year) I decided to blog again,
And I also decided, after not having done so in a serious (more or less)
manner for several years, to work on a programming project,
and maybe actually get it doing what I wanted to, in other words, finish it.

I am a Linux geek, so I am using the Gnome and Gtk
libraries to create my masterpiece ( :) ).

I program in c mostly, when I am programming
large projects.

One of the problems I ran accross was understanding tables.

Consider this actual c source code:

GtkWidget * table;

table = gtk_table_new(5,3,FALSE);

This is easy enough to understand: in simple terms, make a table called
(strangely enough) table. It is to be 5 rows high and 3 columns wide,
the "FALSE" indicates that it is to be "not homogeneous" (cells won't
have their size set by the size of the largest element contained in the
table).

Easy

BUT

The table documentation and all the tutorials I could find (two tutorials)
were driving me batty. Determining how to place widgets/text/whatever
in specific cells was, confusing, to say the least.

Here is an example attach command:

gtk_table_attach(GTK_TABLE(table),label,1,2,1,2,GTK_FILL,
                                                                    GTK_FILL,0,0);

OK - what did it mean??

First of all, the gtk_table_attach command places an item in a table cell.

Here is how the docs described it:

void                gtk_table_attach      (GtkTable *table,
                                           GtkWidget *child,
                                           guint left_attach,
                                           guint right_attach,
                                           guint top_attach,
                                           guint bottom_attach,
                                           GtkAttachOptions xoptions,
                                           GtkAttachOptions yoptions,
                                           guint xpadding,
                                           guint ypadding);


The docs followed with a simple example:

To make a button occupy the lower right cell of a 2x2 table, use

1 
2 
3 
4 
5 
gtk_table_attach (table, button,
                  1, 2, // left, right attach
                  1, 2, // top, bottom attach
                  xoptions, yoptions,
                  xpadding, ypadding);
 

HUH???

To my tired mind, the instructions were a little hazy.

The actual confusing bits were: 

guint left_attach,
guint right_attach,
guint top_attach,
guint bottom_attach,

For anyone else running into this, here is how I eventually came to
understand it. Consider this table:

3 columns wide.
5 rows high.
Notice, I have placed a
number at the end of each
dividing line, both vertically
and horizontally.


With example placements in each cell. (Tables in gtk are
always numbered starting at zero.)

Notice the repeating number patterns?

So, taking the number in the first cell on the top left as an example,
the first digit (0) represents the first vertical line on the left side of
the cell. The second digit (1) represents the first vertical line on the
right side of the cell.

OK so far?

The third digit (0) represents the line on the top of the cell.
The fourth digit (1) represents the line on the bottom of the cell.

Therefore this:

gtk_table_attach(GTK_TABLE(table),label,1,2,1,2,GTK_FILL,
                                                                    GTK_FILL,0,0);

means place a label into the table cell second from the left and second from
the top. To place an object (widget/text/whatever) in the very first cell
top row, top left the attach command would look like this:

gtk_table_attach(GTK_TABLE(table),label,0,1,0,1,GTK_FILL,
                                                                    GTK_FILL,0,0);

Hope that saves someone a bit of time.

じゃまた

2013-02-22

History

While I am not sure I agree with this quote
(Often attributed to Mark Twain) I certainly
find it interesting, at least:

History does not repeat itself, but it does rhyme.

じゃまた

Blog Archive

Contributors

CatWalker

CatWalker
CatWalker at 29