PDF Printer
Pdf Printer
Today I stayed a lot of time trying to find a good PDF printer that works on my O.S., Windows x64 Vista. I tried the CutePDF and the PrimoPDF but none of them works, eventually I tried the BullzipPDFPrinter and it was my salvations it works fine on my system, without add-ons and is a freeware software.
Even thought I haven’t understood yet why the others softwares don’t works on my system. The installation process run ok, but they can install the printer. When I tried install by myself the printer I get a error when I tryed to add a special port to use the pdf Printer software. I will understand this later.
URML – Derivation Rules Example
Documentation
Author: Alex Pinheiro das Graças
Introduction
This documentation will show the use of derivation rules using concrete examples, through modeling of real rules, showing the symbols used and the correspondences between them and the URML meta-model.
The URML is a rule visual language, conceived to make easier the modeling of rules
Derivation Rule
Derivation rules specify how certain logical sentences may be derived from others. They consist of one or more conditions and one or more conclusions. For specific types of derivation rules, such as definite Horn clauses or normal logic programs, the types of condition and conclusion are specifically restricted.
In the URML a derivation rule is instanced by a circle with the acronym DR of derivation Rule. The conditions are represented by an incoming arrow and conclusion by a outgoing arrow. The symbols are shown below with their respective description.
|
Symbols |
Description |
|
|
This represents a derivation rule(DR). |
|
|
A outgoing arrow represents a conclusion |
|
|
A incoming arrow represents a condition |
|
|
A crossed incoming arrow represents a denied condition |
These are the symbols used in this document, beyond the usual UML notation.
Examples
In this section there are examples modeled using URML language will be exposed. The example was chosen trying to show different instances from URML concepts.
The examples are going to follow this structure:
- The URML model;
- The rule in natural language;
- The rule in Prolog;
- A correspondence between the URML meta-model and the example exposed or an explanation of model.
-
Example
Rule:
If Person plays bass then he is a Bass Player
Prolog: musician(X) :- player(X)
This example is a very simple model where a sub-concept is defined by means of a derivation rule. The condition is defined by a role condition. It is necessary for the instance of class Person to be a player to it be considered a musician.
The conclusion of this rule instantiates the object as a musician, hence it is a classification conclusion.
An interesting point of this example is that the rule doesn’t suppose anything about the instance of objects from class Instrument. The creation of the sub-concept musician is done on knowledge inferred over the role of the super class.
-
Example
Rule: If Person is born at a country whose name is Brazil then this person is a Brazilian.
Prolog: brazilian( X ):- person( X ) ,country( Y ) ,bornAt( X , Y ), countryName(Y,’Brazil’)
This is a simple model, it infers if a person is Brazilian or not. The conditions needed to make it true are that he or she are born at a country whose name is Brazil. This is an example where a sub-concept is defined by a derivation rule.
This rule is using two types of condition: a binary association condition, to testif there exists an association between the two object terms; and a classifier condition with a OCL filter, testing if a object term is an instance of a class In addition, the OCL filter creates a filter to the conditions instanced with the conditions described in the OCL expression.
-
Example
Rule: If the car last maintenance was more than 90 days or the service reading greater than 5000, then this car is scheduled for service.
Prolog:
rentalCarScheduledForSevice( Y ) :- rentalCar( Y ) , lastMaintenanceDate(Y , Date) , serviceReading( Y, SR ) , ( Date > 90 ; SR > 5000 )
Above it is shown a simple example in which it is wanted to know if a rental car is scheduled for service. To achieve this, it is used a classifier condition with an OCLFilter. Below there is a model depicted from the URML metamodel shown the relationships between the condition, the OCLFilter, and the ClassificationAtom.
As it is seen in the meta-model every condition has a filter, in this example an OCLFilter. The OCL is a acronym for Object Constrain Language and its specification can be found at the Object Management Group OMG.
www.omg.org/docs/ptc/03-10-14.pdf
-
Example
Rule:
If a car is stored in a branch, it is not assigned for rent and it is not scheduled for service, thus that car is available at the Branch.
Prolog:
isAvaliable(X,Y) :- isStored(X,Y), not isAssigned(X,Z),rental(Z),not rentalCarScheduledForService(X)
This example shows a far more complex rule than the others shown in the former examples, as this example has three conditions, and two of them are denied, and furthermore a conclusion that instantiate an association instead of a classifier.
As you can see in the meta-model of this condition has a property saying if condition is negated. As it was shown in the table above, negation is shown with a cross at the condition arrow.
The conclusion in this example is different from other examples shown until now, it instantiate a binary association between two classes.

-
Example
Rule: If a person is a woman and a mother, then she is a mother. If a person is a father and a man, then he is a father.
Prolog: mother(X) :- woman(X), isParent(X);
father(X) :- man(X), isParent(X).
This model is composed by two Rules that infer similar knowledge. These derivation rules consist of a role and a classification condition. The results include a classification conclusion, creating a sub-concept of a super class.

-
Example
Rule:
If a Person plays an Instrument and this instrument is a Bass than this person is a bassist.
Prolog: bassist(X) :- person(x),plays(X,Y),bass(Y)
This rule is refinement from musician example shown before. Now the objective is to know more than if he plays an instrument or not. It is a specific instrument, a bass. To achieve it, this rule is using a binary and a classifier condition. The classifier condition test if an instance is from the class expressed in the condition. The binary conditions test if there exists or not an association between a instances from class Personand and class Instrument.
My First App
I will post this, to have a complete tutorial doing a first useful app. I’m going to use SDK 4.2.4 to compile and use, but this app won’t use any version specific function.
I am going to develop this application at KDevelop 3.3.4, First create a new project. Click at Project->NewProject.
After choosen the Project Model in the wizard, we have a example application created with some basic functions implemented.
The Qtopia use a pre-compiler to do our lives easy, then to compile first use Scripts->RunQtopiamake X86. This script will generate a make file. Now compile the Project using the usual way to build a project in KDevelop.
If everything goes Ok now you can install the executable file.
Execute “make install”.
Later of installed you can test the application starting runqpe on Desktop.
The QTopia transparency Quest
In the last weeks I was struggling to get a transparency effect to a TopWindow. I could get it by a easy way, but it would let all yours children transparent too, and it wasn’t desired.
The easy way would be:
this->setWindowOpacity(0.5);
I have tried other approache with StyleSheets too, but I didn’t get my goal.
Searching the internet I found a lot of possible solutions but any of them works to me.
The solution found was simple, I added this three lines at widget constructor only.
QPalette p = this->palette();
p->setBrush(Qt::Window,Qt::Transparent);
this->setPalette(p);
This was enough to get all that I was trying to do, but the result archieved hadn’t good legibility, therefore when you have a open application maximed you can’t read texts. So I will have to do the desktop background image as the background of the widget. I guess that in this way I’ll get a good result.
See ya!
First steps on Qtopia SDK
I have started to use the Qtopia framework 1 month ago. I have a good impression until now. It is a stable framework, with a good documentation. The Trolltech’s guys are working hard.
But I have some troubles too, and I will use this blog to describe the problems that I am facing on my daily work. So hands on.
Compiling the first program
The documentation that I found at Internet really works, but I wasn’t trying to do a simple “Hello world!” Program, I wanted to do a “Hello wold!” with a pushbutton.
I The first trouble that I faced was related with libraries. I didn’t get to use the push button. Well I include the files with the usual code:
#include "qpushbutton.h"
But I get a problem in the linkage phase as expected. Well the problem was at “.pro” file, I have to use this file to inform to the project the libraries directories.
First Post
I will use this blog like a log and a knowledge base. When I when writing this Post I was studying this thecnologies:
- MDA
- GMF
- EMF
- OCL
- UML
- QTopia
The last one I am using at my employ, the others to my graduation project. I hope this blog be useful to somebody.
Hello world!
Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!
-
Arquivos
- Dezembro 2008 (2)
- Novembro 2008 (5)
- Agosto 2008 (1)
- Abril 2008 (2)
- Novembro 2007 (2)
- Setembro 2007 (1)
- Agosto 2007 (4)
-
Categorias
-
RSS
Entradas RSS
Comentários RSS




