Private members in C structures
This week, here at work had more proof that programming paradigm is something completely language independent, ie it is not because you're programming in C + +, compiling with g + + that your code will be object oriented, so little, if you program in ANSI C your code must be structured or you will be unable to object-oriented programming.
Eclipse + Qt + svn
More like log personal than a tutorial, I felt the need to leave a place of easy access, the configuration steps of the eclipse for my own use, or the installation of Eclipse and the plugins I normally use (svn and qt) .
The commands that affect directories outside of your home, will need superuser permission.
If you decide to install the eclipse starting packages available in your distribution you can skip straight to step # 2.
Step # 0: Installing Java
For the eclipse to work, you need the Java Runtime Environment (JRE) installed * E * configured.
The JRE can be downloaded directly from Sun's site http://java.sun.com/javase/downloads/index.jsp . Complete instructions for installation and configuration can be found at http://java.sun.com/javase/6/webnotes/install/index.html in case of Java 6.
Step # 1: Download And install eclipse
The eclipse can be easily downloaded from the downloads area on its official site: http://www.eclipse.org/downloads . After downloading, simply unzip it and quit using. In my case I used:
-xvzf eclipse-cpp-europa-winter-linux-gtk.tar.gz -C / usr / local user @ host $ tar-xvzf eclipse-cpp-europa-winter-linux-gtk.tar.gz-C / usr / local
If everything worked the eclipse executable is in / usr / local / eclipse / eclipse, then just create a link / shortcut / whatever in your favorite graphic environment.
Step # 2: Download and install the plugin integration with QT
The plugin I currently use is provided by Trolltech itself. There you can manage your project files from a small graphics editor, and even if you prefer direct access to the file. Pro.
This can be downloaded from http://trolltech.com/developer/downloads/qt/eclipse-integration-download , and complete installation instructions which can be found at http://trolltech.com/developer/downloads/qt / qteclipse-installmanual is cumbersome:
-xvzf qt-eclipse-integration-linux.x86-gcc3.3-1.4.0.tar.gz -C / usr / local user @ host $ tar-xvzf qt-eclipse-integration-linux.x86-gcc3.3-1.4.0.tar.gz-C / usr / local
If everything went right, the plugin files have been copied to the / usr / local / eclipse / plugins.
Note: For those who chose to install the eclipse through the installation of the distribution, attention! Inside the archive, there is the directory eclipse / plugins /, and his dental files of the plugin, which must be copied to the plugins directory of your Eclipse installation, usually / usr / lib / eclipse / plugins.
After installation, start eclipse with the command:
usr / local / eclipse / eclipse -clean user @ host $ / usr / local / eclipse / eclipse-clean
Now, go to Window> Preferences> and set the Qt version and the "path", according to your installation of Qt
To be more comfortable if you invoke the eclipse directly from the command line, add the directory of your executable in $ PATH environment variable within some of the startup scripts (. Bash_profile)
= $PATH : / usr / local / eclipse export PATH = $ PATH: / usr / local / eclipse
Step # 3: Subversion
In eclipse go to Help> Software Updates> Find and Install. Marke the option Search for new features to install and click Next. Now add the remote sites:
Buckminster
http://download.eclipse.org/tools/buckminster/updates
Subclipse
http://subclipse.tigris.org/update_1.2.x
Check their checkboxes, and click Finish. After a brief consultation to the Internet, just check the plugin and dependencies, and run the hug.
Starting in QT, Part III - qmake and. Pro
In this third post on QT we speak of the utility and qmake project files *. pro. Let us understand what it is for the qmake and how to configure different types of projects.
The qmake
The qmake is a utility that comes with the QT framework. Its function is to parse a project file (*. pro) and generate a Makefile with rules already moc , uic and QT embedded options. Without it, for example, we would call the moc files explicitly to create moc_ * and explicitly pass to the compiler and linker, the correct options to include the QT to our projects.
Official documentation about qmake and project files can be found here .
Project files *. pro
To create a simple project file from the command line, enter the project directory and type:
user @ host $ qmake-project
That done, you will create a file with the same current directory name, followed by the extension. Pro. In case of existing files in that directory recognized by qmake as source code files (. H. Cpi), forms (. Ui), etc., they will automatically be added to the project file.
Created the file. Pro, qmake to execute without arguments it tries to parse a file. Pro with the same current directory name. You also can specify an alternative project file as an argument for qmake. If everything went right, a Makefile has been created, and with a simple make, we can build the project.
The project files are regular text files containing macros and directives that are interpreted by qmake to create the Makefile. The complete list of options can be found in the documentation online . The most common are:
TEMPLATE: Indicate the type of project. Use 'app' for proramas executables or 'lib' to create libraries.
CONFIG: Add several options to the project. Among them, 'debug' to add debugging information, 'staticlib' in conjunction with the template 'lib', that is created abiblioteca static (. In a linux).
TARGET: The name and location of the target, ie the application or library.
MOC_DIR: directory where the files will be grads moc_ *. Useful for not polluting the source code directory.
OBJECTS_DIR: Complementary to the previous option indicates the directory where shared files will be generated object code (*. o).
IncludePath: Directories outside where there are headers that will be used in the project, such as headers of external libraries.
DEPENDPATH: Directories of external source codes to be used by the project.
HEADERS: The header files of the project (*. h).
FORMS: interface files generated with the QtDesigner (*. ui).
SOURCES: The files of source code implementation of the project (*. cpp).
LIBS: Libraries used by the external project. -L indicates the path to the library, and-l says the name of the library.
QT: QT modules to be added / excluded from the project. If you pass '= QT' (QT equal empty), no module QT will be used in the project.
SUBDIRS: Used in conjunction with the template 'subdirs' indicates the subdirectories ons qmake should look for other project files.
With this in hand we can create simple designs algums.
A simple application:
# The first character of this line creates a comment # The name of this file is 'app.pro' TEMPLATE = app # Our template is an application called TARGET = bin / myapp.bin # myapp.bin within the dir. / Bin MOC_DIR = tmp / moc # Directory for MOCs, optional OBJECTS_DIR = tmp / obj # directory for object code, optional HEADERS + = myclass.h # Header class MyClass SOURCES + = main.cpp # Use to organize files into myclass.cpp # several lines.
A simple library:
# The name of this file is 'lib.pro' TEMPLATE = lib # Our template is a library CONFIG + = dll # dynamic call TARGET = lib / mylib # mylib within the dir. / Lib MOC_DIR = tmp / moc # Directory for MOCs, optional OBJECTS_DIR = tmp / obj # directory for object code, optional HEADERS + = myclass.h # Header class MyClass SOURCES + = myclass.cpp # Implementation class MyClass
An application that uses an external library:
# The name of this file is 'mixed.pro' TEMPLATE = app # Our template is an application called TARGET = bin / myapp.lkd # myapp.lkd within the dir. / Bin MOC_DIR = tmp / moc # Directory for MOCs, optional OBJECTS_DIR = tmp / obj # directory for object code, optional IncludePath + =. # Dir where are the Headers of the external lib SOURCES + = main.cpp # Implementation of the application.
Nested directories:
We should use nested directories, we need a project file in the current directory, and another in the subdirectory.
In the current directory, use the options:
TEMPLATE = subdirs SUBDIRS = [list of subdirs to be compiled in sequence]
If provided only the name of the directory, it must contain a project file with your own name. It is possible however, whole report directly to the list of subdirectories, one directory followed by a project file with any alien name.
The complete source code of the examples discussed in this tutorial can be found here .
Completing
The qmake is a simple and very powerful tool that greatly eases the lives of those who have to manage complex project tree, even if the project does not use QT (just add at the end of the 'QT ='). Add to that the fact the project files have a syntax very simple and somewhat intuitive. If you need finer adjustments, documentation online will give you a dozen options for fun.
QT or not QT, the qmake is always a good option for management of tree build.
Iron Man
Well,
After a stressful day at work until later, he too lazy to cook and went to dinner at a mall. Satisfied the need bread, gave the will of the circus, so I decided to see if I still had sitting in the Iron Man movie, full 22:20 pm. Luckily, two still remaining, a dubbed and subtitled another. As I prefer the original sound, I waited until 0:20 just to enjoy the movie.
During the wait, I was chatting with a staff that also came early, and everybody who works in film. It was pretty fun, and we have many laughs banging infamous news that customers have the bad habit of peeing in the halls of the cinema. Yes, my dear, that's right. Indeed, it seems that pee is the least that happens in theaters in malls in Sao Paulo ... suggest to the promotion: "Buy a popcorn and a slight itches completely free! And those poor employees do not have much to do. Sorry ...
After the "fright", we went to the movie. No pee or stuff like that ...
I would say it was one of the best (if not A) adaptations of comics to the big screen. Both he deserved this post. Robert Downey Jr. is perfect as Tony Stark, Iron Man. Moreover, the film flows in the right measure, counting the whole origin of the super hero, without rushing or cutting. The special effects are excellent, perhaps sinning by excess in only one scene of the final sequence. The right dose of humor is sure to laugh without making a comedy adventure. The soundtrack also impeccable. Not to mention the "toys" technology created by one of the brightest minds in the Marvel universe. Stan Lee, as always, there's still an air of grace.
The season is just beginning, but Iron Man has emerged as one of the best years in my opinion.
For more please hurry, a tip: wait until the end credits.
Además, came home at 02:45, on foot, in the "violent" São Paulo, and came round, without incident. But do not recommend it for parsley. I myself do not do it often.
Check out the Official Site .




