Search This Blog

Saturday, 22 January 2011

Software code reuse

Code reuse is a myth says this blog, based on the imperial clothing crisis.

Monday, 10 January 2011

C++

Converts an integer into a string:
(This works also with other data types float ...) 

#include <sstream>
int i = someNumber;
std::string s;
std::stringstream out;

out << i;
s = out.str();
Output to files:
#include <iostream>
#include <fstream>

std::ofstream myfile;
myfile.open("example.txt);
myfile << "Writing to my file ...\n";
myfile.close;

Saturday, 8 January 2011

Peripherials

Serial Ports (RS232)
  • Displaying all the configuration information of a serial port: setserial -a /dev/ttyS1
    Alternatively: stty -a /dev/ttyS1
  • Setting the Baud rate: stty -F /dev/ttyS1 115200
  • Write to the port: echo blaba > /dev/ttyS1
  • Listen to the port: cat /dev/ttyS1
  • Serial programming guide
  • termios
  • The linux hyper terminal: gtkterm

 Installation of the Printer Brother DCP-7030 in Fedora 10
  1. Get the linux driver from the brother solution center (lpr + Cups)
  2. Access to Cups at http://127.0.0.1:631/.
  3. Go to ->Printers ->Modify Printer
  4. Choose the device DCP 7030 at USB #1.
  5. Load the PPD-file from /etc/share/PPD. 

Installation of the Printer Brother DCP-7030 in Ubuntu 11.10
  1. Get the linux driver from the brother solution center (lpr + Cups wrapper)
  2.  Install both of them with the Ubuntu Software Center.
  3. Access to Cups at http://127.0.0.1:631/.
  4. Go to -> Administration ->add Printer. Use the usual login for authentication.
  5. Choose the device DCP 7030 at USB #1.
  6. Load the PPD-file from /usr/share/cups/model.

What video card am I using?

The command lspci lists al pci (peripherial component interconnect) devices:
Vidia GeForce 8800GT.

    SVN

    The main resource of information for subversion is the red book. Here I list a few important commands for fast reference.

    Create a new repository:
    1. On the server: svnadmin create /svndir/reposname
    2. From the client: svn co svn://ip_address/reposname
    3. cd reposname
      mkdir trunk
      mkdir tags
      mkdir branch
      svn add *
      svn ci
    Save and restore a repository:
    1. Create a dump: svnadmin dump /svndir/repos/gwt > /backupDir/svn_gwt.dump
    2. Create the repository: svnadmin create /svndir/repos/gwt
    3. Load the repository: svnadmin load /svndir/repos/gwt < /backupDir/svn_gwt.dump
    Examining the history of a repository:
    •  Shows revisions 5 to 19 of a file or directory: svn log -r 5:19 file/directory_name
    •  "svn diff" with no options compares the working directory with the version from the last check out.