Archive for May, 2008

A thought on what makes C++ cool.

Sunday, May 25th, 2008

Ok… I’m definitely starting to get into this C++ stuff.
I guess it helps to be challenged but not totally blown away.
One thought  that I got out  “Thinking in C++”  is that you get the low level bit twiddling capability of “C” and the high level “paint with a broad brush” stuff you get with the object you get with the C++.  Now… that is music to the ears of a hard-core VB6 programmer who likes to occasionally bit-twiddle.
Hmmm.. Now if there was an gnu C++ object that resembled JT’s weapon of choice, the Hierachialflexgrind control, that would really be cool..
I googled a bit and didn’t really come up with anything…. I threw the question out to the programming section out to the ubuntu forum.  It would be interesting to see what they have to say… http://ubuntuforums.org/showthread.php?t=806807

C++ Hello World getting started in Unbuntu

Friday, May 23rd, 2008

I’ve been studying a bunch C++ stuff and now I’m starting to hunker down a really work through this stuff.  I’ve been basically going through Bruce Eckel’s, “Thinking in C++” line by line and I’ve gotten to the point where I’m getting ready to g++ with some of this source code examples.  So far in the book he talks about the compiler but not exactly what to do.  ( He doesn’t mention the ./a.out part at this point in book to generate output.)

Anyway maybe it’s further in the book…. But I found this quick wiki link on how to fire up some simple C++ program in Linux :http://gentoo-wiki.com/StartingCPP

Here goes:
jonas@Ubuntu4:~/Documents/Thinking in CPP/Source/C02$ gedit JT_hello_world.cpp
jonas@Ubuntu4:~/Documents/Thinking in CPP/Source/C02$ cat JT_hello_world.cpp
//JT’s Version of Hello World
#include <iostream>

int main ()
{
std::cout << “JT says Hello world in ANSI-C++ \n Yeah….. It works… \n”;
return 0;
}

jonas@Ubuntu4:~/Documents/Thinking in CPP/Source/C02$ cat JT_hello_world.cpp
//JT’s Version of Hello World
#include <iostream>

int main ()
{
std::cout << “JT says Hello world in ANSI-C++ \n Yeah….. It works… \n”;
return 0;
}

jonas@Ubuntu4:~/Documents/Thinking in CPP/Source/C02$ g++ JT_hello_world.cpp
jonas@Ubuntu4:~/Documents/Thinking in CPP/Source/C02$ ./a.out
JT says Hello world in ANSI-C++
Yeah….. It works…
jonas@Ubuntu4:~/Documents/Thinking in CPP/Source/C02$

Alright… This is something celebrate in my Linux/C++/opencascade project.  Actually having something working more or less on the first attempt….
For some reason, that just seems wrong…. so I’m going to intentional do something wrong to see what happens…..
basically the first gentoo example uses std::cout and in the prior to applying “using namespace std”.  So… here goes:
jonas@Ubuntu4:~/Documents/Thinking in CPP/Source/C02$ cat JT_hello_world.cpp
//JT’s Version of Hello World
#include <iostream>

int main ()
{
cout << “This should generate an error with the compiler because we don’t have ‘using namespace std’ in the program\n”;
return 0;
}

jonas@Ubuntu4:~/Documents/Thinking in CPP/Source/C02$ g++ JT_hello_world.cpp
JT_hello_world.cpp: In function ‘int main()’:
JT_hello_world.cpp:6: error: ‘cout’ was not declared in this scope
jonas@Ubuntu4:~/Documents/Thinking in CPP/Source/C02$

Ok... Then... That's more like the stuff I've been used to seeing......
Alrightly..... Now lets put it all together and send the output to something other than a.out
jonas@Ubuntu4:~/Documents/Thinking in CPP/Source/C02$ gedit JT_hello_world.cpp
jonas@Ubuntu4:~/Documents/Thinking in CPP/Source/C02$ cat JT_hello_world.cpp
//JT's Version of Hello World
#include <iostream>
using namespace std;
int main ()
{
       cout << "Hello again world. I think we've got it and we're off to the next step...n";
       return 0;
}

jonas@Ubuntu4:~/Documents/Thinking in CPP/Source/C02$ g++ JT_hello_world.cpp -o i_got_it
jonas@Ubuntu4:~/Documents/Thinking in CPP/Source/C02$ ./i_got_it
Hello again world. I think we've got it and we're off to the next step...
jonas@Ubuntu4:~/Documents/Thinking in CPP/Source/C02$
We'll actually first I need to bond with the family, try to sand some drywall and do a few other things first....

8.04.1 and Opencascade

Friday, May 23rd, 2008

I was just on the opencascade forum and saw this interesting link on Ubuntu and OCC.
I planning on checking this out a little more in detail later on.
http://www.opencascade.org/org/forum/thread_13494/

Hunkering down in anticipation of 8.04.1

Thursday, May 22nd, 2008

Ok.. So American Idol is now over and David Cook as won.
I wanted Mr. Cook to “win” but thought David A would triumph since I thought he had the better performance in the last competition.  Go figure..
Overall, I enjoyed David C’s creative and Zen like calmness in his performances.  Either way, I think both of them did fantastic…

Gee… I wonder what I’m going to do till January?  So far I’ve managed to get the screen resolution more or less working in my better machine and have resolved to be patient and hopeful that the kinks in 8.04 will resolve themselves in 8.04.1.
I played around a little with opencascades MakeBottle.cxx but so far without success.  I think I’m at a point where I need to slow down in order to speed up.  I originally I went through the on-line C++ tutorial[Need to a link here].   It’s understandable  but I think it was a little bit too much to fast to get it to stick in my brain.  Subsequently, I ran across a book in the library, “Thinking in C++” by Bruce Eckel.  It took me a little bit of time to get used to his writing style, but I think this author will be good for me.  His books are also downloadable.   Basically, I can either pickup the hardcopy, or review in my browser.  I’ve gone to basically slowing down reading it line by line.  It seems his style is to basically take a single concept, roughly explain it, build on it and review it.
So… basically, I would call this slow going forward progress which is what I need at the moment..
More Later….
JT

Configuring Hardy Heron the Hard Way

Monday, May 12th, 2008

This is nuts.. I was having some problems getting screen resolution to work with my original box, so I went wound up partitioning my XP box which is slightly more modern and had the same issue.  (I couldn’t get beyond 840*680 Screen resolution).  So…… at this point I feel like I’m one of those monkey’s at a type writer banging away.  Suddenly you have Shakesphere.  I have the screen resolution working just perfectly and not exactly sure what I did.

This is the steps that I recall:
I downloaded and installed a native Nvdia driver from the manufacturer.  I used this link as my guide: http://ubuntuforums.org/archive/index.php/t-609006.html
As I recalled the instructions didn’t work. I was stuck in the low resolution mode and I wound up going to system=>Adminstration=>Hardware Drivers.  I clicked on the enable video card, and some how I got into the manual configuration screen.  I scrolled down the lists for graphics cards and monitors, picked out what I needed and there you go.  Based on what I saw flashing across the screen I don’t think I’m using the manufacturer driver, but I’m not sure.
I guess the test would be to see I can get into that manual screen and configure my other box..
Time to save the blog, flip the KVM and see what happens.  No luck yet on this…..
I made a post on Ubuntu… See what happens..http://ubuntuforums.org/showthread.php?t=790348

First Experience with Ubuntu 8.04 LTS

Saturday, May 3rd, 2008

Ok… In a word no so good.
Started out real nice on the install and then when to heck…
My PC is what I call state of the art….
Gutsy seemed to load right up no problem…
This version so far…. Not so good…
I got the little square boxes starting out… Had to go System=>Preferences=>Visual Effects and set that to none.
That took car of the boxes…
Next on the agenda.. I’m at 640X480 resolution…. Need to work on that. First thread that looked promising on that front is:
http://ubuntuforums.org/showthread.php?t=771810
Some of the posts are not looking too friendly…. Some one made a point that Gentoo was easier to configure….
One of post made suggestion was studying and understanding xorg.conf before messing with things.
I ran across this link that looked promising:http://www.linux.com/feature/118108
I thought I try the quick non-thinking fix….
I tried to run: sudo dpkg-reconfigure xserver-xorg
I didn’t seem to hurt anything, but didn’t help either…
From the article it looks like the following sections in xorg.conf need to be messed with:
Section “Device”
Identifier “Configured Video Device”
Option “UseFBDev” “true”
EndSection

Section “Monitor”
Identifier “Configured Monitor”
EndSection

Section “Screen”
Identifier “Default Screen”
Monitor “Configured Monitor”
Device “Configured Video Device”
EndSection
I guess the first thing to figure out is what type of graphics card I have.
Seems like I should be able to figure this out without a resorting to looking at archival hardcopy, but this seems to get me there the fastest. I appears I have a Intel 82815 graphic controller.
Googling… I found this link which looks promising:http://ubuntuforums.org/showthread.php?t=731038
Actually this seems to be the place: I810
Learned something new here: lspci – list all PCI devices
Which tells me:
jonas@jonas-desktop:~$ lspci
00:00.0 Host bridge: Intel Corporation 82815 815 Chipset Host Bridge and Memory Controller Hub (rev 02)
00:02.0 VGA compatible controller: Intel Corporation 82815 Chipset Graphics Controller (CGC) (rev 02)
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev 01)
00:1f.0 ISA bridge: Intel Corporation 82801BA ISA Bridge (LPC) (rev 01)
00:1f.1 IDE interface: Intel Corporation 82801BA IDE U100 Controller (rev 01)
00:1f.2 USB Controller: Intel Corporation 82801BA/BAM USB Controller #1 (rev 01)
00:1f.3 SMBus: Intel Corporation 82801BA/BAM SMBus Controller (rev 01)
00:1f.4 USB Controller: Intel Corporation 82801BA/BAM USB Controller #1 (rev 01)
01:09.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8029(AS)
01:0a.0 Multimedia audio controller: Ensoniq ES1371 [AudioPCI-97] (rev 08)
01:0d.0 Communication controller: Conexant HCF 56k Data/Fax/Voice/Spkp Modem (rev 08)
‘This is what I thought I had… It just confirms it..
I just ran across this link: http://www.intellinuxgraphics.org/man.html
I get the impression, this is going to be the hard way..
This seems to be something I can clone a bit:http://ubuntuforums.org/showthread.php?t=557566
Ok… This is really start not being fun….
I just booted a live  Gutsy session…  Resolution is fine….
I’m going to try pasting the contents of xorg.conf back into my regular session and see what happens:
# xorg.conf (xorg X Window System server configuration file)
#
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
#
# Edit this file with caution, and see the xorg.conf manual page.
# (Type “man xorg.conf” at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following command:
#   sudo dpkg-reconfigure -phigh xserver-xorg

Section “Files”
EndSection

Section “InputDevice”
Identifier    “Generic Keyboard”
Driver        “kbd”
Option        “CoreKeyboard”
Option        “XkbRules”    “xorg”
Option        “XkbModel”    “pc105”
Option        “XkbLayout”    “us”
EndSection

Section “InputDevice”
Identifier    “Configured Mouse”
Driver        “mouse”
Option        “CorePointer”
Option        “Device”        “/dev/input/mice”
Option        “Protocol”        “ImPS/2”
Option        “ZAxisMapping”        “4 5”
Option        “Emulate3Buttons”    “true”
EndSection

Section “InputDevice”
Driver        “wacom”
Identifier    “stylus”
Option        “Device”    “/dev/input/wacom”
Option        “Type”        “stylus”
Option        “ForceDevice”    “ISDV4”        # Tablet PC ONLY
EndSection

Section “InputDevice”
Driver        “wacom”
Identifier    “eraser”
Option        “Device”    “/dev/input/wacom”
Option        “Type”        “eraser”
Option        “ForceDevice”    “ISDV4”        # Tablet PC ONLY
EndSection

Section “InputDevice”
Driver        “wacom”
Identifier    “cursor”
Option        “Device”    “/dev/input/wacom”
Option        “Type”        “cursor”
Option        “ForceDevice”    “ISDV4”        # Tablet PC ONLY
EndSection

Section “Device”
Identifier    “Intel Corporation 82815 CGC [Chipset Graphics Controller]”
Driver        “intel”
BusID        “PCI:0:2:0”
EndSection

Section “Monitor”
Identifier    “Generic Monitor”
Option        “DPMS”
HorizSync    30-70
VertRefresh    50-160
EndSection

Section “Screen”
Identifier    “Default Screen”
Device        “Intel Corporation 82815 CGC [Chipset Graphics Controller]”
Monitor        “Generic Monitor”
DefaultDepth    24
EndSection

Section “ServerLayout”
Identifier    “Default Layout”
Screen        “Default Screen”
InputDevice    “Generic Keyboard”
InputDevice    “Configured Mouse”

# Uncomment if you have a wacom tablet
#    InputDevice     “stylus”    “SendCoreEvents”
#    InputDevice     “cursor”    “SendCoreEvents”
#    InputDevice     “eraser”    “SendCoreEvents”
EndSection