Thursday, January 16, 2014

Being Pragmatic

Intro

  1. Care about your craft
  2. Think! About your work
  3. Provide options, no excuses
  4. Don't live with broken windows
  5. Be a catalyst for change
  6. Remember the big picture
  7. Make quality a requirements issue
  8. Invest regularly in your knowledge
  9. Critically analyze what you read and hear
  10. It's both what you say and how you say it

Thinking
    What
    Interest
    Sophistication
    Detail
    Own
    Motivation

  • Know what you want to say
  • Know your audience
  • Choose your moment
  • Choose a style
  • Make it look good
  • Involve the audience
  • Be a listener
  • Respond
Tackling
  1. DRY - Don't Repeat Yourself
  2. Make it easy to reuse
  3. Eliminate effects between unrelated objects
  4. There are no final decisions
  5. Use tracer bullets to find the target
  6. Prototype to learn
  7. Program close to the problem domain
  8. Estimate to avoid surprises
  9. Iterate the schedule with the code
Tools
  1. Keep knowledge in plain text
  2. Use command shells
  3. Use a single editor well
  4. Always use source control management software
  5. Fix the problem not the blame
  6. Don't panic
  7. Take the signs for what they are
  8. Don't assume it - Prove it
  9. Learn a text manipulation language
  • Debugging steps
  1. Are you seeing a symptom, or the root cause?
  2. Write down the problem as in an email to a co-worker
  3. If we see problems and the tests are passing, then are the tests complete?
  4. Where else does this problem exist, or need to be checked?

Saturday, January 4, 2014

Qt ERROR: mainwindow.h:4:23: error: QMainWindow: No such file or directory

# generate make file
$ /opt/Qt5/5.2.0/gcc/bin/qmake -spec linux-g++ -o Makefile torii.pro




# generate ui_mainwindow.h from mainwindow.ui
$ /opt/Qt5/5.2.0/gcc/bin/uic ./mainwindow.ui -o ui_mainwindow.h

# build
$ make
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -fPIE -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I/opt/Qt5/5.2.0/gcc/mkspecs/linux-g++ -I. -I. -I/opt/Qt5/5.2.0/gcc/include -I/opt/Qt5/5.2.0/gcc/include/QtGui -I/opt/Qt5/5.2.0/gcc/include/QtCore -I. -o mainwindow.o mainwindow.cpp
In file included from mainwindow.cpp:1:
mainwindow.h:4:23: error: QMainWindow: No such file or directory
mainwindow.cpp:4:22: error: QStatusBar: No such file or directory
In file included from mainwindow.cpp:1:
mainwindow.h:12: error: expected class-name before ‘{’ token
mainwindow.h:13: error: ISO C++ forbids declaration of ‘Q_OBJECT’ with no type
mainwindow.h:15: error: expected ‘;’ before ‘public’
mainwindow.cpp:7: error: prototype for ‘MainWindow::MainWindow(QWidget*)’ does not match any in class ‘MainWindow’
mainwindow.h:12: error: candidates are: MainWindow::MainWindow(const MainWindow&)
mainwindow.h:12: error:                 MainWindow::MainWindow()
make: *** [mainwindow.o] Error 1

__fix__
The QMainWindow exists in the QtWidgets directory, so add the following to the Makefile (perhaps there's a way to add this to the .pro file):
-I/opt/Qt5/5.2.0/gcc/include/QtWidgets
 ...
 g++ -c -pipe -O2 -Wall -W -D_REENTRANT -fPIE -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I/opt/Qt5/5.2.0/gcc/mkspecs/linux-g++ -I. -I. -I/opt/Qt5/5.2.0/gcc/include -I/opt/Qt5/5.2.0/gcc/include/QtGui -I/opt/Qt5/5.2.0/gcc/include/QtCore -I. -o mainwindow.o mainwindow.cpp