text:
Love them or hate them, there is one thing that you can pretty much guarantee if you are going to spend any time doing computer programming, and that is that sooner or later, you are going to have to either create or display data from a database. In this article, we look at how to program a MySQL database in KDE. For the completely uninitiated, the KDE environment is built upon the Qt C++ libraries provided by Trolltech, so in this article, classed that start with the letter Q are part of the Qt library, and classes that start with the letter K are part of the KDE library. The main classes we will use are the built-in database widgets of QDataTable, QDataBrowser, and QDataView, but first of all, we need to set up some information to use in our database. For this demonstration, we will be using MySQL which comes with openSuSe and probably given its popularity, every other version of Linux as well.
Just to clarify things, this article was originally written as Chapter five of Beginning KDevelop Programming on SuSe 10.0, and has been updated and tested for this release on openSuse 10.3.
There seems to be two ways you can go about setting up MySQL. The easy way and the painful way, and there seems to be only a slight difference that decides which way your set up is going to go. This way was worked out over several days of testing. If you want to do it another way or you do run into trouble, you'll be needing this link: MySQL Documentation.
Install MySQL
Start MySQL
Change root password (recommended)
(Optional) Uninstall MySQL
MySQL is installed with openSUSE; it is just not started as a service, but there are still reasons for checking the install with Yast. Mostly this is because the Graphical User Interface tools for MySQL are not installed by default, so unless you set up the system knowing that you would need them, you probably won't have them.
To install or to just check if you have everything you need, open the Control Center (Yast) and select the Software Management option. It should open with the search option, type mysql, it doesn't matter which case, and hit return. The parts you are interested in here are the mysql-administrator and the mysql-query-browser; the query browser is for more advanced use than we will be using here, but it can't hurt to have it.
The Yast setup should be familiar if you have setup the system yourself; if not, click on the checkbox for the item you are interested in. A black tick will install it, a blue tick means it is already installed, a bin means remove it, and a lightening bolt thingy means update it.
It should also be noted that these programs are included on the main menu at System/Service Configuration, but if you want to set up the links on your desktop, you can find them in /usr/share/applications. On 10.3, they will appear in the New Applications section at the top of the Applications section of the main menu. You can copy these to your desktop if you think you are going to need them regularly.
From an openSUSE 10.3 perspective, the MySQL Administrator is not present on the disk; you need to go to the openSUSE web site and do a software search for "mysql-administrator". If you install this through the one click install, it will also download all the required files so that you can install the MySQL query browser through Yast as normal afterwards.
By default, the MySQL server is disabled when you set up Suse, so you need to start it yourself. To do this, you need to access the Runlevel Services on whatever version of Linux you are using. On Suse, this is done through Control Center/YaST2 Modules/System/System Services (Runlevel). You will need Administrator privileges to access the services list.
Once you enable the MySQL server here, it will be started whenever you start your computer, so once you've done it, you can just forget about it and use MySQL anytime you want.
At this point, it is recommended that you change the root password. The syntax is:
mysqladmin -u root password " newpwd"
If you have got to the state where you are just getting nowhere and are having trouble getting answers from the MySQL website, the quickest solution, as long as you aren't using a machine that has a valid production database on it, is just to delete MySQL and start again from scratch. You do this by opening Yast, searching for mysql, and setting the MySQL option to be uninstalled, which should show a bin at the checkbox.
The database files for MySQL on Suse are stored in var/lib/mysql. If you delete this folder, you will have completely removed the MySQL information, including all databases and users, so like I say, if the computer has ever been used as a MySQL production machine, do not touch this folder or you will lose everything.
To setup MySQL exactly how you want it, start the MySQLAdministrator.
Use root as the user and the password that you have set recently.
When it starts, it should look something like the above. The important bits here are the users and the catalog sections, where you can see the databases that are on your system.
The default tool of choice for working with MySQL is going to be the KDE Knoda application for the simple reason that it allows us to set up the database without having to write all the SQL ourselves. You may need to install this through Yast.
The link to the Knoda application can be found under the main menu Office/Database.
When started, Knoda will ask which driver you want to use, we select mysql, and Connect, which gives us the connection dialog.
To setup and use our database, we are just going to use the root connection with the password entered when we set up MySQL earlier. Once Knoda connects, assuming everything goes as planned, you should have access to the MySQL default databases Bri. We can ignore these as for our projects for this chapter, we are going to setup a simple music database that we can then access through KDevelop and use within our own programs.
To create a completely new MySQL database with Knoda, go to the File/New/Database menu.
Select the New Database menu item and we get this dialog:
As you can see, to setup a new database, all we have to do is type in the name and select OK. At this point, absolutely nothing will appear to happen as Knoda will not automatically change to the newly created database, nor will it ask you if you want to. This is not a major problem though as changing to the new database is easy.
Select the Database combobox and select from any of the available databases. We want KDevelopMusic which, once selected, Knoda will load our new, empty database. First of all, we want to create three tables. Creating a new item in the table, be it a table, Query, etc., is as simple as right clicking and selecting New. For this example music database, we are going to create three tables, these being the Artist table, the Album table, and the Songs table.
We can see here the preliminary setup for the Artist table which contains two fields: Artist_ID and Artist. To add a field to a table, click on the New Field button and the fill out the options for the field in the option boxes on the top right. You can experiment with fields and tables here, but you should really have a good idea of what your tables are going to contain and how they are going to work together before you start.
One of the worst ways you can possibly design a database is by trying to cram everything into a single table. This is just asking for trouble because you will then be making the job of accessing the table far more difficult; for example, if we know the ID of an artist with this table, we can use a pseudo SQL statement along the lines of Select * from Artist where Artist_ID = knownvalue. If however, we also add the album names to this table, we are going to end up trying to separate out the individual album titles from the results of our Select statement.
Select * from Artist where Artist_ID = knownvalue
The tables created here are for a simple music database; basically, we are going to be storing the names of the artists, the titles of the albums, and the songs that each album contains. The database will be created in such a way that we can get the artist name from the song, or the album name from the song, but we won't include stuff like running times of songs, release dates, or publishers. If you really want all those details, you can always add them or record the album in amaroK.
Once you have created the tables, you can start adding information to them. This is done in Knoda by right clickzng the table and selecting Start.
For now, we will add some initial testing information in Knoda so that we can make sure that everything works as expected from this end. We can also play around with the data here so that when we get to developing programs with KDevelop, we can concentrate on the programming side of things and have some SQL statements already if we need them.
For test purposes, I've added three Bands with four albums, containing sixty two songs between them. The test tables look like this, first the Artist table, followed by the Album table, and a snippet from the Songs table:
In order to view this as the result of a proper database query, we need to create a new query by right clicking on Queries and selecting New.
This is the Knoda graphical development for a SQL query, and the query itself is the standard query for this database. It basically gets all the songs according to album and artist, when you run it, like so:
I've called it the Standard Query because any other queries that are used will basically be an edit to this query. There are two ways that you can develop SQL queries with Knoda: the most obvious is through the graphical interface as shown above, and the other, for those who can write SQL off the top of their heads, you can type in the SQL.
To get to the SQL editor, select the View menu, and select to use QBE. This will turn off the graphical development and allow you to type the SQL straight in to the editor. The SQL for the Standard Query is:
SELECT "Artist0"."Artist" , "Album1"."Album_Title" , "Songs2"."Song_Title"
FROM "Artist" "Artist0" , "Album" "Album1" , "Songs" "Songs2"
WHERE ("Album1"."Artist_ID"="Artist0"."Artist_ID")
AND ("Songs2"."Album_ID"="Album1"."Album_ID")
Though seeing as the graphical interface is there and it opens by default, it seems kind of silly not to use it if it is going to make life easier.
When we first start a new query, the tables shown in the picture above are not there so we need to add them. We do this by right clicking in the empty space above the combo boxes. This will give you a menu with one option: "Add data source". When you select this, a dialog box will open showing you the tables that are available in the currently selected database.
You are free to add as many tables as you want, and in the case of this example, we add all of them before closing the dialog.
The first thing you'll want to do when you have added the tables to the query is set up the links between the tables. This is done by selecting the item in the table to link and dragging it to the appropriate item in another table.
For example, in the above image, Artist_ID in the Artist table should map to Artist_ID in the Album table. It is good practice to have any links between tables to be named the same in each table, the idea being that anyone looking at the tables can then easily see what links to what. Whilst on the subject of names, the alert ones will have noticed that Knoda has changed the table names adding a number beginning with zero to the table names as they were added. These are just aliases for the tables which are resolved in the From part of the SQL statement.
FROM "Artist" "Artist0" , "Album" "Album1" , "Songs" "Songs2"
which tells the database that "Artist0" is an alias for "Artist", etc.
When you release the mouse over the table that you wish to establish a link with, you will get a dialog, which shows you the link that Knoda thinks you are trying to make, and allows you to change it if you meant to link to another item in the table.
Once you have established the links, all you need to do is setup exactly what it is that you want to display. This is done through the drop down boxes at the bottom of the screen. If you are a complete beginner, it can take a few attempts to get this to display exactly the way that you want to, but as a basic rule of thumb, you should have tables that display the least information on the left and work right with the tables, displaying more information as you go. Once the tables have been added to the query, they will be selectable from the drop down box for the table. Once we have selected the table, we can select any field from that table that we want to display.
In the Standard Query that we have set up in this example, we only show the information that is relevant to the topic. All the items that end in ID are designed for us to use from within the database, and are therefore not really important to anyone who is looking at the database simply to see what tracks are on a specific album.
KDevelop has three GUI widgets that can be used for displaying database information; these are the Qt class widgets DataTable, DataBrowser, and DataView.
Unfortunately, database programming isn't as straightforward as it could be at the moment, so it is better to start with the idea that we are going to have to do most of the work by hand. The main source of the problems being that while the DataTable will attempt to set up a database connection if you go through the wizard to set it up, it doesn't save the information that you use to log into the database, which means that if you try to just use the wizards and run the code, you will be told that there was an error connecting to the database.
The way to get the QDataTable to work is to drop it onto the form and then just cancel the wizard. This will add a blank QDataTable to your form. We can work with this.
First of all, we are going to have to add a dialog so that we can get the user name and the password from the user. We could hard code these but it's just plain nasty, so in an effort not to encourage bad habits, we'll do it properly from the start.
To add a new dialog to the project, click on the "New File" tab on the left side of KDevelop and select the appropriate dialog. For our simple user and password dialog, we'll select the standard dialog with buttons (bottom). When we select the dialog, we are given a setup dialog,
This just asks what the name of the file is, and gives a final opportunity to change our minds about which dialog we want. We are then presented with an automake dialog that asks which of the current projects we want to add this to. If you just want to add the dialog to the current project you are working on, then accept the defaults by clicking OK.
Although we now have a new UI file, we still do not have any class files to implement the new user interface, in this case our password dialog. There is however a need to be careful about class names here so don't go rushing in creating files called PasswordDialog.h and PasswordDialog.cpp or you could start making life really complicated and annoying. Remember what was said in earlier chapters about how the meta object compiler works and how it will create a header and .cpp file for a .ui file even though you will never see it, and it is this file that controls the class declarations for the form widgets. Any code implementation of a form needs to inherit from these classes, which admittedly is a bit tricky at the moment as they don't exist yet.
So first of all, we need to get the meta object compiler to generate our class and header file. This is done by running Automake and friends, followed by configuring from the build menu and then building the project. Once the project is built, you will see the newly created files in the projectname/debug/src directory. In this case, they are the passworddialog.h which looks like:
#ifndef PASSWORDDIALOG_H
#define PASSWORDDIALOG_H
#include <qvariant.h>
#include <qdialog.h>
class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
class QSpacerItem;
class QPushButton;
class passwordDialog : public QDialog
passwordDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE,
WFlags fl = 0 );
QPushButton* buttonHelp;
QPushButton* buttonOk;
QPushButton* buttonCancel;
QHBoxLayout* Layout1;
QSpacerItem* Horizontal_Spacing2;
protected slots:
virtual void languageChange();
and the passworddialog.cpp file:
#include <kdialog.h>
#include <klocale.h>
** Form implementation generated from reading ui file
** PasswordDialog.ui'
** Created: Fri Mar 3 18:09:34 2006
** by: The User Interface Compiler ($Id: qt/main.cpp 3.3.4 edited Nov 24 2003 $)
** WARNING! All changes made in this file will be lost!
#include "PasswordDialog.h"
#include <qvariant.h>
#include <qpushbutton.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
* Constructs a passwordDialog as a child of 'parent', with the
* name 'name' and widget flags set to 'f'.
* The dialog will by default be modeless, unless you set 'modal' to
* TRUE to construct a modal dialog.
passwordDialog::passwordDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
: QDialog( parent, name, modal, fl )
if ( !name )
setName( "passwordDialog" );
setSizeGripEnabled( TRUE );
QWidget* privateLayoutWidget = new QWidget( this, "Layout1" );
privateLayoutWidget->setGeometry( QRect( 20, 240, 476, 33 ) );
Layout1 = new QHBoxLayout( privateLayoutWidget, 0, 6, "Layout1");
buttonHelp = new QPushButton( privateLayoutWidget, "buttonHelp" );
buttonHelp->setAutoDefault( TRUE );
Layout1->addWidget( buttonHelp );
Horizontal_Spacing2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding,
QSizePolicy::Minimum );
Layout1->addItem( Horizontal_Spacing2 );
buttonOk = new QPushButton( privateLayoutWidget, "buttonOk" );
buttonOk->setAutoDefault( TRUE );
buttonOk->setDefault( TRUE );
Layout1->addWidget( buttonOk );
buttonCancel = new QPushButton( privateLayoutWidget, "buttonCancel" );
buttonCancel->setAutoDefault( TRUE );
Layout1->addWidget( buttonCancel );
resize( QSize(511, 282).expandedTo(minimumSizeHint()) );
clearWState( WState_Polished );
// signals and slots connections
connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
* Destroys the object and frees any allocated resources
// no need to delete child widgets, Qt does it all for us
* Sets the strings of the subwidgets using the current
* language.
void passwordDialog::languageChange()
setCaption( tr2i18n( "UserName And Password" ) );
buttonHelp->setText( tr2i18n( "&Help" ) );
buttonHelp->setAccel( QKeySequence( tr2i18n( "F1" ) ) );
buttonOk->setText( tr2i18n( "O&K" ) );
buttonOk->setAccel( QKeySequence( tr2i18n( "Alt+K" ) ) );
buttonCancel->setText( tr2i18n( "Ca&ncel" ) );
buttonCancel->setAccel( QKeySequence( tr2i18n( "Alt+N" ) ) );
#include "PasswordDialog.moc"
Now we can set about getting our dialog up an running. Right click on the the .ui file in Automake Manager.
In order to create the classes to implement the password dialog, we need to select either the "Subclassing Wizard" or the "Create or Select Implementation", the actual file creation is the same in either one.
The main difference is that with the Subclassing Wizard, as you can see, you can choose to specialise the implementation of some of the buttons. In this case, we are going to need to implement the accept function so that we can later save the strings added for the username and the password and use them to access the database. In order to avoid naming issues, I've named the class PasswordDialogImpl to make it clear that this is the implementation of the password dialog.
The final dialog that we get is the Automake Manager dialog. If we look at the .h file, we can see that:
#ifndef PASSWORDDIALOGIMPL_H
#define PASSWORDDIALOGIMPL_H
#include "PasswordDialog.h"
class PasswordDialogImpl : public passwordDialog
PasswordDialogImpl(QWidget* parent = 0, const char* name = 0, bool modal = FALSE,
WFlags fl = 0 );
public slots:
protected slots:
virtual void accept();
not only does it inherit from the MOC created passwordDialog class, but provides an implementation of the accept() function. As we have just added new files to the project, run automake and friends from the build menu, followed by configure, and then run build to make sure it all builds correctly. Now we can get on with implementing the dialog.
From the dialog point of view, the implementation is straightforward. We declare a couple of strings, one for the user name and one for the password.
/** Store the UserName
QString strUserName;
/** Store the Password
QString strPassword;
and add the get and set functionality, and then we add the following code to the overridden accept function:
setPassword( passwordLineEdit->text() );
setUserName( userLineEdit->text() );
The technical bit appears when we realise that we want to have the dialog appear as the application starts but preferably before it is displayed. This way, when the application starts, it will show the database table data as we want it, without it obviously drawing it after the application has started. To do this, we need to override the polish function. The polish function performs the initialisation of the widget before it is shown, but the documentation comes with the warning that you should call the base class polish function before implementing your own code. This ensures that the default code for the widget is completed before you make your changes, as making the changes before the base classes have called polish can trigger further calls to polish, ending up with infinite recursion.
So our overriding of the polish function looks like this:
void ChapterFiveDataTableWidget::polish()
PasswordDialogImpl *dlg = new PasswordDialogImpl();
if( dlg->exec() == QDialog::Accepted )
loadDatabase( dlg->userName(), dlg->password() );
Here we call the base class polish and then create a new dialog and execute it modally with the exec function. Note that calling show would display a modeless dialog that would have the main application widget displaying in the background, which is exactly what we don't want it to do.
Now that we have the username and the password entered as the application starts, there are three more parameters that we need to be able to connect to the database. These are the host computer and the database name and the driver that we are going to use to connect to the database. These are the parameters that are entered into the Knoda connection dialog so they should be familiar by now. I've set up strings to hold the variables in the ChapterFiveDataTableWidget class and provided the appropriate access functions, although this class is not accessed from anywhere, so they could just be left as private variables that are intialised in the constructor as:
strName = "KDevelopMusic";
strDriver = "QMYSQL3";
strHost = "localhost";
These variables are all used in the loadDatabase function which is called at the end of our overridden polish function.
The driver variable starts things off and is used with the line:
dbConnection = QSqlDatabase::addDatabase( strDriver );
This call initialises our database connection variable that is declared in the ChapterFiveDataTableWidiget class declaration as:
QSqlDatabase *dbConnection;
A detailed listing of database drivers that can be used with Qt is available in the SQL Module Drivers section of the help.
Now we set up the connection parameters to the database:
dbConnection->setDatabaseName( name() );
dbConnection->setUserName( user );
dbConnection->setPassword( password );
dbConnection->setHostName( host() );
if( dbConnection->open() == true )
As you can see, we are simply using code to set exactly the same parameters we used for Knoda, so as long as we can get into Knoda, there should be no reason for the dbConnection->open call to return false.
We are now in a position where we are ready to actually query the database and display it and when using a datatable, as long as we have done our preparation properly, the actual querying of the database is disgustingly easy. First of all, a browse through the QSqlCursor class help file and its derived class QSqlSelectCursor shows us that we can pass a table name to QSqlCursor or a SQL statement to the QSqlSelectCursor constructor, along with our database collection, and this will give the results of our query in our newly constructed cursor object which we can then pass to the QDataTable object and let it do all the drawing and displaying for us. In code, this looks like this:
///QSqlCursor *cursor = new QSqlCursor( "Artist", true, dbConnection );
QSqlSelectCursor *cursor = new QSqlSelectCursor( "SELECT Artist FROM Artist",
dbConnection );
/// QSqlSelectCursor *cursor = new QSqlSelectCursor( strSqlStatement, dbConnection );
dataTable1->setSqlCursor( cursor, true, false );
for( int i=0; i<dataTable1->numCols(); i++ )
dataTable1->adjustColumn( i );
The first call we use which is blanked out in the above code is the creation of a QSqlCursor object that takes the Artist table as a parameter and an auto-populate value of true along with the database connection pointer.
We then pass the cursor to QDataTable by calling the setSqlCursor function, passing in the cursor itself and the value true for the autopopulate option which tells the table to automatically display the data. The final parameter is for autodelete, and as we don't want the table to be edited here, we set it to false, which is the default. The following call to QDataTable refresh tells the table to redraw itself and it will use the current cursor to do this.
The final piece of code just gets the number of columns and then tells all the table columns to adjust their width to that of the largest entry in the column.
The resulting view of the table is:
which is fine and is exactly what we asked for as it shows all the data in the table. The only problem being that it is not really what we want as the Artist_ID is a key value and is of no interest to anyone who is simply trying to view the records in the database, so we'll switch to QSqlSelectCursor and see if we can get something a little more appropriate.
If we use the SQL statement:
"SELECT Artist FROM Artist"
in the QSqlSelect constructor, we get:
which is much more along the lines of what we want. But of course, now we have to play just a little more and see what the StandardQuery we did in Knoda would look like:
Setting up the DataBrowser project can be a little tricky, so here's the least painful way to do it. Create this using the Simple Designer based KDE application as with all the others, and remove the label and the button as well as all the code. Then break the layout on the form and resize it so that you can fit the QDataBrowser object onto it. Then do a complete build of the project, you will need to run automake and friends and then configure, just to make sure that everything is satisfactory. Then shut down KDevelop. The object of this is so that when you load KDevelop, this project is loaded on startup. Restart KDevelop and then add the QDataBrowser to the form. If the Database Connection wizard starts up, then everything is fine, otherwise you are just going to have to restart KDevelop and try again.
For this project, we will want to run through the wizard as although it does not retain the database connection information and we will have to code that by hand, it does give us a GUI for our query results and that saves us the task of having to do it.
First of all, we click on the Setup Database Connections button and fill out the connection dialog.
As you can see, the only change here is that we have provided a name for the connection, the rest of the input is as it has been throughout this chapter. Clicking on the Connect button gives us:
The Music connection has been established so we can click the Close button. We used the Artist table last time so this time we'll select the Album table and click Next. I'll admit at this point that this database is probably not ideal for demonstrating the browser as it would be more effective if the tables were to contain more items for display, but even with one displayed field, you should get the idea, and the programming principals will apply no matter how many fields are present in the database table.
The selection of fields is controlled by the buttons in the middle which are not very clear here, but from the top down, they are:
Once we have the fields set up that we want, we click Next. The next screen in the wizard allows us to add a Where clause to the SQL.
and to set the sort order for the displayed fields. Then we set the display options:
The final option allows us to set if we want the wizard to generate the SQL for updates. This gives us a GUI that looks like:
The next thing to do is add the polish function to our class that inherits from the "projectname" base class; we do this in the usual way by adding:
public slots:
virtual void polish();
to the header file and then adding the implementation to the CPP file. There is some code from the the wizard generated file that we can use. The implementation of the polish function in the ChapterFiveDataBrowserWidgetBase class is:
if ( dataBrowser3 ) {
if ( !dataBrowser3->sqlCursor() ) {
QSqlCursor* cursor = new QSqlCursor( "Album", TRUE, MusicConnection );
dataBrowser3->setSqlCursor( cursor, TRUE );
which is useful to us later, but it won't work as it is because the necessary parameter for the MusicConnection, which is the name given by the wizard to QSqlDatabase, has not been set yet.
First of all, we need to get the user name and password using the dialog that we used in the chapterfivedatatable project. We do this by right clicking on the project in the Automake Manager.
and selecting Add Existing Files.. which gives us this dialog:
Select the .ui file and the implementation header and definition file, and click Add Selected. As long as you don't start changing the names of things, the implementation should work without a hitch as the MOC will generate "projectname" widgetbase classes exactly as it did with the original project.
You will then be asked if you want to link or copy the files. In the normal scheme of things, you would have the classes that you reuse in a standard directory and link to them rather than copy them; this then means that if you do need to make any changes to the class files, then they are automatically propagated through any projects and you don't need to start searching your hard disk for different implementations of the same class.
In this case though, they have been copied to the project as in this case, the project is a stand alone project that should be distributed in such a way as it can be built with as few issues as possible.
// Notice calling QWidget polish here as we
// are overriding the behaviour added by the wizard
// which initially overrode polish in the base class.
PasswordDialogImpl *dlg = new PasswordDialogImpl();
if( dlg->exec() == QDialog::Accepted )
and build the project making sure that you have all the required headers in place. Then add the setup code for QSqlDatabase:
MusicConnection = QSqlDatabase::addDatabase( driver() );
if( MusicConnection == 0 )
KMessageBox::error( this, "The database connection is invalid", "Data Browser Demo" );
MusicConnection->setDatabaseName( name() );
MusicConnection->setHostName( host() );
MusicConnection->setUserName( dlg->userName() );
MusicConnection->setPassword( dlg->password() );
if( MusicConnection->open() == true )
Now the problem is that this code still doesn't work because of this:
As far as the debugger is concerned, at this moment in time, the GUI objects have not been completely constructed, which means that any tests for the data browser objects are pretty hit or miss; in fact, on my computer, the line:
if( !dataBrowser3->sqlCursor() )
fails every time because it does not give a false value for sqlCursor. So what we do is remove this line and continue to generate the new QSqlCursor that points to our data. At the very worst, here with the QSqlCursor inheriting from QObject, we should only have an extra QSqlCursor hanging around until the end of the function.
When we remove the test on the QSqlCursor, we get:
if( MusicConnection->open() == true )
if( dataBrowser3 )
QSqlCursor* cursor = new QSqlCursor( "Album", TRUE, MusicConnection );
dataBrowser3->setSqlCursor( cursor, TRUE );
and a program that gives us:
On a final note, you should remember that we accepted the default setting for auto-editing, which is on. This means that any changes you make to the titles while running this program will be made to the database.
The QDataView is a cut down version of QDataBrowser without the inbuilt ability to move through the records. It is designed more for paying attention to a particular section of a database rather than browsing through all the records in it. For say, looking at personal records where the next record in the database doesn't necessarily have any connection with what you are doing with this record. For this reason, the Music database just wasn't adequate to display the idea of how the QDataView works, so I put together a quick fictional people database using Knoda using the same methods as described above.
The Knoda table looks like:
As you can see, it is a simple enough database containing nothing more than the names and addresses of fictional people, well, the addresses are fictional anyway. It does however, give us enough fields to make our dataview project look a bit more respectable.
To start the wizard for creating the chapterfivedataview project, create the Simple Designer based KDE application as before, and remove the widgets and button_clicked functionality; save and build the project and then add a DataView to the form.
The wizard is almost identical to the DataBrowser wizard, only slightly shorter.
With the only differences in the setup from previous projects being minor, such as the change of the database name.
though there are more fields to display when we get to the fields dialog.
When we get to the code, we notice that things are pretty much the same as have been in recent projects. The basic structure is to set up a QSqlForm and add all the display widgets to the form. As a user of the project, you don't directly use the QSqlForm yourself although if you wish to hand code a database form, looking at the wizard implementation is the way to do it, as it sets the names for the widgets to table columns of the database and then maps the record you pass to the form to the appropriate columns. This is also how the previous QDataBrowser project works although in that project, the QDataBrowser wraps the QSqlForm and controls things for us.
One thing you will notice if you look at the generated code is that the polish function is not overloaded automatically here. This is because the design of the QDataView isn't really suited to accessing the database immediately on start up and is why the chapterfivedataview project is developed the way it is.
We start with the idea of a separate application that contacts the database when it needs to and displays a single entry from the database. Technically, we could have overridden the polish function and connected to the database from there, but I decided to separate everything out. So now we have a separate database function that is activated by clicking the button, and at start up, what is an empty QComboBox. The idea for the project being that the user connects to the database and a list of available people is placed in the QComboBox. The user then selects the name of the person they wish to view the details of in the QComboBox and then the form is filled out.
The database connection starts when the button is clicked:
PasswordDialogImpl *dlg = new PasswordDialogImpl();
if( dlg->exec() == QDialog::Accepted )
FictionalPeopleConnection = QSqlDatabase::addDatabase( databaseDriver() );
FictionalPeopleConnection->setDatabaseName( databaseName() );
FictionalPeopleConnection->setHostName( host() );
FictionalPeopleConnection->setUserName( dlg->userName() );
FictionalPeopleConnection->setPassword( dlg->password() );
if( FictionalPeopleConnection->open() == true )
QSqlSelectCursor *cursor = new QSqlSelectCursor(
"SELECT FictionalPeople.First_Name, FictionalPeople.Middle_Names,
FictionalPeople.Surname FROM FictionalPeople", FictionalPeopleConnection );
QString strName;
while( cursor->next() == true )
strName = cursor->value( "First_Name" ).toString() + " ";
if( cursor->value( "Middle_Names" ).toString().isEmpty() == false )
strName += cursor->value( "Middle_Names" ).toString() + " ";
strName += cursor->value( "Surname" ).toString();
namesComboBox->insertItem( strName );
As you can see, there is nothing that should surprise you in this function. The password and database access is exactly the same as it has been in the previous two projects; it is just initialised differently. The SQL statement:
SELECT FictionalPeople.First_Name, FictionalPeople.Middle_Names,
FictionalPeople.Surname FROM FictionalPeople
gets the first name, the middle names, and the last name from all the entries in the database. We then build up a name string by using the value function from the QSqlRecord class. We can do this because if you follow the class hierarchy in the help, you will see that the QSqlSelectCursor class inherits from the QSqlCursor class which in turn is derived from the QSqlRecord and the QSqlQuery classes. You could call the fact that it doesn't automatically fill in the form as either a bug or a feature depending on your mood, but when you think about it, if there is a long list of names, why would you specifically want to see the first one any more than the others? Even when they are sorted.
The way to do this is to receive the activated signal from the QComboBox when a new item is selected in the list and displayed in the viewable area.
Adding the Signal Handler here adds the function to our widget class and then we need to add a variable name for QString so that we can use it.
virtual void namesComboBox_activated( const QString& name );
and the function is,
void chapterfivedataviewWidget::namesComboBox_activated( const QString& name )
int nSurname = name.findRev( ' ' );
// KMessageBox::information( this, "The space for the surname is at "
+ QString::number( nSurname ) + "\nin name " + name );
int nLength = name.length();
setSurname( name.mid( nSurname+1, nLength ) );
// KMessageBox::information( this, "The surname is " + surname()
+ " \nFrom the name " + name );
int nFirstName = name.find( ' ' );
setFirstName( name.left( nFirstName ) );
// KMessageBox::information( this, "The first name is " + firstName()
+ "\nWith the space at " + QString::number( nFirstName ) );
if( nFirstName != nSurname )
setMiddleName( name.mid( nFirstName+1, nSurname - ( nFirstName+1 ) ) );
// KMessageBox::information( this, "The middle names are " + middleName()
+ "\n Starting from " + QString::number( nFirstName+1 ) + "\nEnding at "
+ QString::number( nSurname ) + "\nFrom a length of "
+ QString::number( nLength ) );
QString strSqlString = "SELECT * FROM FictionalPeople
WHERE FictionalPeople.First_Name = '" + firstName() + "' ";
if( middleName() != 0 && middleName().isEmpty() == false )
strSqlString += "AND FictionalPeople.Middle_Names = '" + middleName() + "' ";
strSqlString += "AND FictionalPeople.Surname = '" + surname() + "'";
// KMessageBox::information( this, strSqlString );
QSqlSelectCursor *cursor = new QSqlSelectCursor( strSqlString,
FictionalPeopleConnection );
dataView2->refresh( cursor );
// clear the middle name
strMiddleName.truncate( 0 );
A bit of a blob, so we'll break it down into its three sections. The first section is the processing of the string that is passed to us from the QComboBox. This string is the full name of the person we want, so we will have to break it up again. Without the KMessageBox calls that show the progress through the string, it looks like this:
int nSurname = name.findRev( ' ' );
int nLength = name.length();
setSurname( name.mid( nSurname+1, nLength ) );
int nFirstName = name.find( ' ' );
setFirstName( name.left( nFirstName ) );
if( nFirstName != nSurname )
setMiddleName( name.mid( nFirstName+1, nSurname - ( nFirstName+1 ) ) );
Here we use a few of the QString functions to break up the string, starting with the findRev function which starts at the back of the string and moves towards the start until it finds what you have specified in the call to the function. We then store the length of the string for future use, and also declare a few string variables in the class to keep the information. These take the, hopefully, obvious names of FirstName, MiddleName, and Surname. We then store the surname using the value plus one returned by findRev because we don't want the space. We then find the first space from the start of the string using the find function and then store the first name using the left function. Once we have the end and the beginning, anything else falls into the middle names category so we get it or them using the mid function.
QString strSqlString = "SELECT * FROM FictionalPeople
WHERE FictionalPeople.First_Name = '" + firstName() + "' ";
if( middleName() != 0 && middleName().isEmpty() == false )
strSqlString += "AND FictionalPeople.Middle_Names = '" + middleName() + "' ";
strSqlString += "AND FictionalPeople.Surname = '" + surname() + "'";
The next section of code builds the SQL statement using the name values that we have just extracted from the name QString. It should be noted that the variable values that we add are surrounded by ' marks. This is a small detail but essential as the query won't work without them.
The final section is:
QSqlSelectCursor *cursor = new QSqlSelectCursor( strSqlString,
FictionalPeopleConnection );
dataView2->refresh( cursor );
// clear the middle name
strMiddleName.truncate( 0 );
Here we run the query and make sure that we are at the start of the results and that they or it is ready to be read. Then we pass the cursor straight to the QDataview refresh function which takes a QSqlResult and automatically fills out the form.
One final tip for database development is never presume that the SQL statement has worked. If something has failed, it is more often than not a fault in the SQL statement. When you are sure that it works, check everything else.
This has been a brief look at database development with KDevelop focusing on the available widgets. It has tried to cover a lot of ground, but there is much left for the reader to experiment with. This chapter could go on for a few hundred more pages about transactions and saving data etc., but hopefully it will be enough to get people started.
This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


text:
Pogba yet to decide on future
Sir Alex Ferguson says Paul Pogba is still making his mind up regarding his future at Man Utd after appearing as a sub against West Brom.
Last Updated: 12/03/12 11:53am
Sir Alex Ferguson admits Paul Pogba is still making his mind up regarding his future at Manchester United after the midfielder featured in the 2-0 win over West Bromwich Albion.
Pogba is out of contract at the end of the season and the 18-year-old has been offered a new long-term deal at Old Trafford.
However, reports have claimed that the French youngster is ready to reject the chance to stay at United in favour of a move to Italian giants Juventus.
The situation has led to claims that Pogba was being omitted from Ferguson's first-team plans after he was not involved in the recent Europa League home defeats by Ajax and Athletic Bilbao.
The player's inclusion in the squad for Sunday's success over West Brom, though, prompted rumours that Pogba had decided to accept United's offer of a new contract.
Ferguson says no decision has yet been made, but he is confident that Pogba is a first-team figure for United following his substitute's appearance against West Brom.
"The boy is still trying to make his mind up but he knows where he should be," Ferguson told MUTV.
"He has shown again the potential he has got and he is a first-team player, there is no question about that."

subset: commoncrawl


text:
Andre Marin will re-apply for his job as Ontario ombudsman but says the hiring process so far has been "shambolic."
Marin's appointment was to end at midnight Monday, but a three-party panel of MPPs has been unable to agree on whether to return him to office for a third term or choose a new ombud.
The Ontario legislature couldn't even come to an agreement Monday on whether to extend Marin's appointment until the hiring process had been concluded or install a deputy ombudsman to temporarily fill the position.
The outspoken public advocate appeared emotional at a media conference he held Monday, but blamed it on allergies.
"Being ombudsman is not an easy job," Marin said. "I'm not here to please the powers. I'm supposed to be speaking truth to power and that doesn't make you popular."
As the hiring process gets "rebooted," Marin urged parliamentarians to keep the politics out of it.
If the names of alternative candidates continue to be "leaked' to the media, then the hiring interviews should be done publicly, he said.
PC House Leader Jim Wilson said the NDP have already called for Marin to be re-appointed, and the Liberals have made it clear they want the assertive ombudsman out the door.
"We were the adults in the room," Wilson said. "The NDP and the Liberals are going to have to get together and decide on a name. We've indicated today, as we have in the past, that we want to get someone in the office and we'll co-operate fully."
Wilson questioned why the Liberals bothered to interview Marin if they don't want him in the position.
"No wonder people think this is strange — it is strange," he said.
Government House Leader Yasir Naqvi said the hiring panel is at an "impasse" and has decided to go through the process again.
Naqvi tried unsuccessfully to get the legislature to appoint deputy ombudsman Barbara Finlay as the acting ombudsman.
"As of midnight tonight, there will be no ombudsman and we feel very strongly as a government that that's unacceptable," Naqvi said. "Ombudsman is a very important job that must be filled."
Marin argued that parliament watchdogs — such as the ombudsman — have been allowed to stay in their positions while a replacement is considered.
He also expressed surprise that he might be out of the running for the job.
"I had every reason to believe that I would be selected for the job until last week," he said. "Normally when you check someone's references, it's because you're about to make them an offer."


text:
Hotel Accommodation near Ciechow
Search 1 hotels in Ciechow
Get Secret Prices on selected hotels
These prices aren't available to everyone.
Where to stay in Ciechow
Poland   accommodation in Ciechow - Hotels.com offers great last-minute Ciechow hotels deals and discount room rates. Our hotels in Ciechow can easily be booked online. Our fast online search facility allows you to:
- - Find and compare different hotels in Ciechow by star rating, amenities, theme, or brand
- - Choose the perfect Ciechow hotel and view room rates, hotel details, guest reviews and photos
- - Securely book your hotel room online today!
- - Receive email and text confirmations with reservation details of your online hotel booking


text:
Listen to all music and sounds of Eric Kandé and follow this user by signing in for free.
You can listen to 8 tracks and mixes and follow this user as 25 did before.
This artist liked 17 tracks, followed 25 others and reshared 93 tracks and mixes. 43 other people are following this page too.


text:
YoGadz is a place for real Tech geeks. We have tried to maintain YoGadz as a platform where hardcore tech followers can roam, enjoy and can say "Yo this is exactly what we want". YoGadz was started with an aim in mind to create a hardcore place for tech lovers. There are a lot of tech blogs on internet but they all are just flooding with phone related information so we thought to bring some real tech related website. And most tech love comes from youth so we also added Yo to show that this is a place for youth. With youth we doesn't mean that people above a certain age can't visit our website instead Yo refers to the youth in you. So if you think that there is youth in you and there's love for Tech in your heart then YoGadz is the place for you. Here you can enjoy ever changing technology in the most easiest way and when we say technology then we really mean technology (not just phones and stuff).
What is our aim?
Our sole moto is to make Technology so easy and understandable that from an infant to an old man everyone can understand it.
Who works on YoGadz?
There is a team of dedicated Tech experts who are always working to explain Tech in the most simplest manner.
What makes YoGadz so special?
Here we not just try to provide you Tech information in simple form instead we try to make it interesting for you. We always try to maintain content relevancy and its uniqueness. Most importantly we try maintain a good relationship with our reader, and if you are still not down with that then we have even got YoFactors and YoFeatures which just give you the most important things you should have in mind while going for anything in Tech.
Can I work on YoGadz?
Yes, you can provide us information that you think is new or wanted by a lot of people or can help a lot of people and then leave the rest to us.
How many questions can I ask regarding a particular post?
You can ask endless questions about anything related to Tech, we'll we very happy to help you out. You can either ask questions in the comment section of the related post or can also put up your queries in Forum.
From where YoGadz Team get so many topics to write on?
The simplest answer for this is from experience. Everyone of YoGadz Team just loves technology and we are 24×7 playing with it. We even listen to our readers and also write what they like us to write. So do you want us to consider something you have in mind, just say Yo and contact us.
Do I allow guest posts?
No, YoGadz Team is very strict on this. We do not say that our visitors cannot write good articles instead we just don't want anyone to suffer with slightest of mistake in the guest post.
Can I leave links on YoGadz?
A strict no here as well, in order to maintain the quality and value of the blog we just don't allow links of any type. Necessary links will be there in the posts which are only to help get more information related to the topic.
Can I copy YoGadz content?
No, we give no flexibility for this. Authors of YoGadz Team work hard to bring something Techy to tech lovers and we just don't want anyone to use it for their own good. The content is specially written for tech lovers visiting YoGadz.
From this we think now it's time to get Techy, so say Yo and let get back to hit some TECH.


text:
Actualités sur la spectroscopie Raman
Lisez les derniers articles et téléchargez le dernier numéro du bulletin Spectroscopy Innovations
Les derniers articles
Raman spectroscopy: an advanced technique for gemstone analysis
The National Gemstone Testing Centre (NGTC), China, is using Renishaw's high performance inVia confocal Raman microscopes to perform non-destructive identification and characterisation of gemstones.
Renishaw's RA802 Pharmaceutical Analyser wins an award
Renishaw, the global engineering technologies company, is delighted to announce that its RA802 Pharmaceutical Analyser has won the best measurement laboratory equipment award during Eurolab 2017. The new RA802 is a compact benchtop Raman imaging system, designed exclusively for the pharmaceutical industry.
See Renishaw's new ultra-fast Centrus CCD detector at Pittcon
Renishaw is launching its new CCD detector at Pittcon on booth 5217. Centrus, with Rapide technology, has been engineered exclusively for high speed Raman analysis.
Geologists use Renishaw's Raman-in-SEM solution to probe the nanoworld
Researchers at BRGM (the French Geological Survey in Orleans, France) study the physical, chemical, and structural properties of minerals. They use a co-located SEM-Raman system from Renishaw to provide comprehensive in situ sample characterisation.
Combining Raman microscopy with scanning electron microscopy (SEM) to study inorganic and mineral samples at the Geological Institute of Romania, Bucharest
The Geological Institute of Romania, located in Bucharest, was founded in 1906. It is famous for its museum which hosts a collection of more than 80,000 samples of rocks, fossils and minerals from all over Romania. They combine Raman microscopy with scanning electron microscopy (SEM) to study inorganic and mineral samples.
Tous les articles
- NGTC case study
- Renishaw's RA802 Pharmaceutical Analyser wins an award
- Geologists use Renishaw's Raman-in-SEM solution to probe the nanoworld
- See Renishaw's new ultra-fast Centrus CCD detector at Pittcon
- Geological Institute of Romania use SEM-Raman
- Renishaw's LiveTrack™ focus-tracking technology wins an award
- Non-invasive prostate cancer screening using Renishaw's inVia™
- Caltech working to solve the world's energy problems with the help of inVia
- Renishaw appoints a new distributor in the Nordic region
- Introducing Renishaw's new RA802 Pharmaceutical Analyser
- inVia used to study blood stored in plastic blood bags
- Raman spectroscopy used to detect radiation damage in cells and tissues during cancer treatment
- The University of Colorado Boulder, USA, combines Raman spectroscopy and nanoindentation
- inVia wins CS Industry Award 2016
- Renishaw launches the new inVia™ Qontor™ confocal Raman microscope
- Memorial Sloan Kettering Cancer Center uses an inVia in the development of nanomolecular probes
- inVia used to study graphene and other nano-materials
- Renishaw's inVia is used at the University of Duisburg to study two-dimensional materials
- The US Army Research Laboratory combines Raman and AFM
- inVia connects to Bruker's Dimension Icon AFM
- Raman spectroscopy used to study diseases at the Children's Hospital of Michigan
- Renishaw's inVia used for quality control analysis at New Plasma Technologies
- Kwansei Gakuin University uses Raman microscopy to study crystallographic defects in SiC wafers
- Renishaw Raman system used with SEM to study fibres at UCLA
- Renishaw adds Raman analysis to Scanning Electron Microscopy at the University of Sydney
- Renishaw's inVia used in conservation activities at the Rijksmuseum in Amsterdam
- Raman systems used to study 2D materials at Boston University
- The Casiraghi Group use Raman in the study of graphene
- Using Raman spectroscopy to study materials under extreme conditions
- New videos show the inVia in action
- Young scientist wins prize for poem
- Renishaw present at MMC
- Renishaw's inVia wins Queen's Award for Enterprise
- StreamLineHR Rapide is a hit at Pittcon 2014
- Raman spectroscopy for oncology research (and drug delivery research)
- Raman images faster than ever before
- Inside Raman UK seminar 2014
- New publication on 3D imaging of cells
- Renishaw to launch powerful new software
- New low wavenumber performance
- inVia Raman microscope used in breakthrough graphene research
- Renishaw announces Raman seminars at the Natural History Museum
- Efficiently using the sun's energy
- Greener transport
- Harnessing Solar Energy
- Renishaw wins best supplier award in China
- New Raman agent for Romania
- University of Warwick to host 'Inside Raman' seminars
- Pioneering work provides hope in fertility struggle
- Raman Spectroscopy: A vital tool in the fight against crime
- Raman spectroscopy for busy people
- Renishaw adds Raman capabilities to synchrotron research
- StreamLine™ Plus – sets the standard for fast chemical imaging
- Molecular visualisation and analysis is now a step closer
- Microbe identification


text:
It's time for Silicon Tally. How well have you kept up with the week in tech news?
This week, Kara Swisher, formerly of All Things D, currently co-executive editor with Walt Mossberg of the new tech news and reviews website Re/Code, takes on the tech gauntlet in our weekly Silicon Tally quiz. Play along at home, below.
Follow Ben Johnson at @@TheBrockJohnson.


text:
Rajasthan High Court Recruitment 2016 - Apply Online for 72 Civil Judge & Judicial Magistrate Posts: Registrar (Exam), Rajasthan High Court, Jodhpur has published a notification for recruitment of 72 Civil Judge & Judicial Magistrate. Eligible and Interested candidates can apply online from 16.03.2016 to 05.04.2016. Other details like age limit, educational qualification, selection process & how to apply are given below..........…
Total No. of Posts: 72
Name of the Post: Civil Judge & Judicial Magistrate
Name of the Category:
1. General (Male): 26 Posts
2. General (Female): 11 Posts
3. SC (Male): 08 Posts
4. SC (Female): 03 Posts
5. ST (Male): 08 Posts
6. ST (Female): 02 Posts
7. OBC (Male): 10 Posts
8. OBC (Female): 04 Posts
Qualification: Degree of Bachelor of Laws (Professional) of any University established by Law in India and recognised as such under the Advocates Act, 1961.
Age Limit: Born not before 02.01.1982 and not later than 01.01.1994. 5 years age relaxation is applicable for SC/ ST/ OBC/ General (Female) & for others as per rules.
Fees: Rs.50/- for SC/ ST/ Physical Handicap, Rs.150/- for SBC/ OBC (Non Creamy Layer) & Rs.250/- for all other candidates/ candidate from other state.
How to Apply: Eligible candidates may apply online through below given link from 16.03.2016 to 05.04.2016. No printout is required to be sent to Rajasthan High Court.
Selection Process: Selection will be based on performance in Preliminary Examination (Objective Type), Written Main Examination (Subjective Type) & Interview.
Important Dates:
Start Date to Apply Online: 16.03.2016
Last Date for Deposition of Fee: 04.04.2016
Last Date to Apply Online: 05.04.2016


text:
VLC Media Player is that the most blazing and solid multi organization, free media player available. The open supply media player was freely released in 2001 by non-benefit association VideoLAN Project. VLC Media Player rapidly got to be very respected because of its flexible multi-group playback capacities. it completely was aided by similarity and codec issues that rendered rivalry media players like QuickTime, Windows and Real Media Player futile to a few basic feature and music document forms. The simple, essential UI and huge cluster of customization decisions have executed VLC Media Player's position at the most astounding of the free media players. VLC Media Player 2.2 Free Download Full version from here.
VLC Media Player is partner degree ASCII content record application that gives you the ability to play media from your portable workstation or a plate, or to stream it from the on the web. Have your most loved features tuning in an exceptionally snap through this current application's natural interface.
For every essential capacity, this average player is available to clients of all ability and expertise levels. The controls region unit instinctive, and playback lives up to expectations swimmingly notwithstanding the supply of the media being shown.
Likewise with any ASCII content document programming framework, there territory unit favorable circumstances and inconveniences to misuse VLC Media Player. however in the event that you essentially need to have the capacity to stream and play feature on your tablet while not issue, this project could be a sensible decision. In like manner, clients with some specialized force will praise investigating the extra propelled abilities of this free program.
This application will do bounty basically play media, however to get to any of these extra propelled choices, you might want to claim some specialized information. despite the fact that there territory unit careful headings while in transit to simply do in regards to something, singularly clients with some skill misuse this innovation have the capacity to tail them precisely.
Click here to view ScreenShots
Click on the download button below to download this software


text: Not quite sure where to start in terms of introductions but I'll give it a crack all the same. I'm John from Scotland, been the proud owner of an HTC Desire for a week and a bit now. Haven't previously had an android handset and after the debacle and nonsense of Nokia's Ovi Store and their apps constantly crashing my 5800 xpress music, I can't say I was overly keen to get involved in anything similar. However when it was contract renewal time I was running about doing my research looking for the best handset on the market I found article after article on reasons not to get an iphone4 and nothiing at all warning me off a Desire. The fact that I'm a lefty and Apple's "just hold it a different way" response confirmed my decision - HTC is for me. I've been blown away by the handset - it's everything I wanted from the Nokia 5800 and more, I haven't regretted my decision to switch away from Nokia for a second. I've read through the site rules and they seem pretty cool and grown up. They also seem to attempt to address some of the unhelpful and unsavoury stuff you see elsewhere so Kudos to the guys and girls involved in putting them together. I guess I'm here primarily to find out more about my Desire, to get the best performance out of it and to solve any problems I might have - the ones with the solutions that are staring me in the face usually.... So yeah, that's me.


text:
Thursday, April 7, 2011
China Ringer IC jumper Solution
Posted by Noval Fikril / On : 9:22 PM/ Thank you for visiting my small blog here. If you wanted to discuss or have the question around this article, please contact me e-mail at email@example.com.
at 9:22 PM
Subscribe to: Post Comments (Atom)


text:
Vermant back in Brugge
By Chris Ives
Last Updated: 01/01/70 1:00am
Schalke midfielder Sven Vermant has returned to Belgium.Schalke midfielder Sven Vermant has rejoined his former club Brugge on a three-year deal.
The Belgian international has decided to return to his native country after being told that he would not be receiving a contract extension from his current club in Gelsenkirchen.
"Sven Vermant was always an extremely valuable player, with good skills and a strong character," said Schalke team manager Andreas Muller.
"This move is the best thing for both sides and maybe we will see him again in the Champions League next season.
"Sven will always be a welcome guest at Schalke," he added.
The 32-year-old joined the Royal Blues from Brugge in 2001 and played a total of 98 Bundesliga games for the club.


text:
In Saudi Arabia, Donald Trump to use softer language about Islam
National and InternationalScience
In Saudi Arabia, Donald Trump to use softer language about Islam
President Donald Trump will use his first visit to the Middle East to call for unity in the fight against radicalism in the Muslim world, launching the challenge as a "battle between good and evil" and urging Arab leaders to "expel The terrorists of his Places of Worship, "according to a draft of the speech obtained by The Associated Press.
Abandoning part of the harsh anti-Muslim rhetoric of his presidential campaign, the draft speech, slated to be delivered in Saudi Arabia on Sunday, sees new alliances with US traditional allies in the Middle East. It notably refrains from mentioning the issues of democracy and human rights that Arab leaders often see as moralizing by the United States in favor of the more limited goals of peace and stability.
"We are not here to give a conference to tell other peoples how to live, what to do or who to be. We are here instead of offering an alliance to build a better future for all of us," the document said.
Mr. Trump left Washington on Friday afternoon for Riyadh, the first stop on his overseas trip as president. The marathon trip will also take you to Israel, the Vatican, Belgium and Italy. The trip is a key test of the President's diplomatic skills and an opportunity to add substance to a foreign policy he has broadly described as America First.
Two different sources provided the PA with copies of the draft of their observations, advertised as a travel sign. One version, released late Thursday, included edits with comments from an administration official, indicating that it was still a work in progress.
The White House confirmed that the bill was authentic, but warned that the president had not yet signed the final product.
"The President has not seen this draft," said White House spokesman Sean Spicer. "This is one of five drafts that have been written by several people. He continues to take the entry and is writing a final version."
Trump's campaign was marked by its anti-Islamic rhetoric and its administration has twice tried to impose a ban on travel to several Muslim-majority countries. "I think Islam hates us," he said in a moment.
The draft of the speech does not include any mention of "radical Islamic terrorism," a phrase that candidate Trump regularly criticized the opposition's Hillary Clinton and President Barack Obama for refusing. His speech calls terrorism a pervasive problem that affects all those who love peace.
"This is not a battle between different beliefs, different sects or different civilizations. This is a battle between those who seek to destroy human life and those who seek to protect it," the text reads President Donald Trump on the first visit to Moyen-Orient pour In the launching of a "bataille between good and evil" and in exhortant Arab leaders to "chasser les terroristes de vos Lieux de culte", selon A brouillon des discours obtained by The Associated Press.
Abandoning a part of the anti-Muslim struggle for the presidential campaign, the speech project, planned to be lived in Saudi Arabia dimanche, forecast new partnerships with traditional allies in the Middle East. Il s'abstient in particular to mention democracy and human rights. The Arab leaders consider this to be in favor of objectifs plus limités de la paix et de la stabilité.
"Nous ne sommes pas là pour donner des conférences pour dire d'autres personnes comment vivre, faire quoi or à qui être.
M. Trump a quitté Washington le vendredi après-midi pour Riyad, premier arrêt du premier voyage à l'étranger en tant président. The voyage marathon will lead you to Israel, the Vatican, Belgium and Italy. The trip is a key test of the president's diplomatic skills and an opportunity to add substance to a foreign policy that describes the general form as "America to approach".


text: Hi all, Have been lurking for a few months, thought it was time for an introduction. An avid Android enthusiast, I started with the G-1 in April 2009, and upgraded to the Desire this July. Currently using the stock HTC setup, with 2.2 installed. You can find me on Twitter @rasmusviking. Cheers, Erik N


text:
The Orbitist mapping application incorporates tons of unique features to help you create beautiful, interactive maps. This article explains how to use media in your map points.
(This quick guide assumes that you know how to create an Orbitist map and add a point. If you don't know how to do that yet, click here for an in-depth tutorial.)
1. Sign in to your Orbitist account by clicking the "SIGN IN" button in the top right of the homepage.
2. Then, click on the blue "My Maps" button in the top right of the account screen. You will be directed to a list of the maps you've created.
3. Click on the map title that you'd like to work on, or click the "Work on map" button underneath the map number of the map you'd like to customize.
4. Once your map appears, click on the point that you'd like to add media to. When the point opens, click on the "Edit Point" button near the top of the box.
5. Within the point, click on the "Multimedia" tab on the left side, and look for the "Embeds" field. The Orbitist app supports media from Youtube, Vimeo, Soundcloud, and Twitter.
6. Simply insert the URL of the media you'd like to include in your point and click the blue "Save" button at the bottom of the page.
7. Your media will now display inside your point.
Be sure to follow Orbitist for future tutorials and updates. The application has tons of features, and we'll help you learn how to use them to make your content even better.
If you have any questions, e-mail firstname.lastname@example.com.


text:
Restore & Renew
by David Keene April 2015
In 2014, the Restore & Renew Our Village capital campaign allowed for the renovation of the Memorial Library, Recreation Hall and Shuffleboard Courts as well as exterior work done on The Curtis and Blake. This Spring, work is being done on the interior of Jakeman Hall and The Curtis.
Significant improvements are being made to Jakeman Hall to allow for expanded meeting room space, private office and administrative areas, ADA restrooms, display cases for historic artifacts and more efficient space for the archives. The contractor is Carl Goodwin Inc. and work is scheduled to be completed by mid-May so that there will be no disruption at the start of the summer season.
With 18 guest rooms, The Curtis will have upgrades to improve safety and comfort. Much of the work being done is electrical and includes new wiring, lighting, ceiling fans and emergency/exit systems. Last year, The Curtis had a new roof installed and the exterior was completely repainted.
Restore & Renew Our Village launched as a campaign in the summer of 2013 and to date a total of $950,000 has been pledged with 315 giving units. As the campaign continues this coming summer, there is still time to add your name to the list of donors, so you are encouraged to contact the OPA office to complete a pledge card. At the same time, engraved brick pavers for the Library walkway are being sold and those funds will be allocated to the campaign.
Additional improvements are planned after this summer on the first floor of the Ricker cottage as well on the Curtis and Blake. We can all be proud of what has been accomplished and we look forward to raising additional funds to make even more improvements to our village square.
The "Restore and Renew Our Village" campaign is focused on the structures – owned, loved, and used by us all every day…
For more information about this campaign click here to view our capital campaign brochure.
We invite you to join this effort with a generous pledge or one-time contribution! You can do so in person at the Ocean Park Association office located in Jakeman Hall, 14 Temple Ave., Ocean Park, ME 04063. You can also donate online through the Network for Good button on this page.
2017 Summer Season
- Get Involved with Music!
- Ocean Park Music Festival
- Wednesday's at Jordan
- Saco Bay Artistst six
- Art in the Park
- Educational Bureau
- Library Hours, etc.
- Library Programs/Book Sale
- Historical Series
- Let's Talk About It
- Learning Through Film
- Special Programs
- Tuesdays in the Park
- Thursdays in the Park
- Technology Workshop
- Writer 's Conference


text:
An MP is to go on trial accused of a historic sex offence in Blackpool.
Nigel Evans, the former deputy speaker of the House of Commons and the MP for Ribble Valley, is accused of two counts of indecent assault, five of sexual assault and one of rape.
One of the alleged indecent assault offences is said to have taken place in Blackpool between 1 January 2002 and 1 January 2004.
Evans appeared in the dock at Preston Crown Court today for a preliminary hearing where his trial date was fixed.
His lawyer, Peter Wright QC, emphasised there will be a trial, with the MP having previously emphatically denied all charges.
Evans, who spoke only to confirm his name, was told to go into the dock of the court when he appeared in the courtroom at the start of the 10-minute hearing.
He was asked to hand over his mobile phone by the court security guard and disappeared briefly into a holding room behind the dock, out of view of the courtroom, before the judge came in and the hearing began.
A trial, lasting around four weeks, was set for March 10 next year. The charges relate to seven men, who are alleged victims of Evans.
The indecent assaults are alleged to have been committed between January 1 2002 and January 1 2004; the sexual assaults - said to be touching without consent - between January 1 2009 and April 1 this year; and the rape between March 29 and April 1 this year.
Evans resigned as deputy speaker of the House of Commons after he was charged on September 10. A pre-trial plea and case management hearing was also set for January 24.
Mr Justice Timothy King granted Evans bail until that hearing on condition of non-contact with any alleged victims. He said: "The trial is now fixed for 10 March 2014 at Preston Crown Court, estimated for four weeks.
"I will grant you bail to attend court on the next occasion on those conditions."
Evans replied "Thank you" before he left the dock. He made no further comment.
The Swansea-born MP, who lives in Pendleton, Lancashire, was one of three deputy speakers elected in a secret ballot of MPs in 2010. Later that year he came out as gay, saying he was "tired of living a lie".
Evans was a vice-chairman of the Conservative Party from 1999 to 2001.
As deputy speaker, he sat as an independent MP but he will not take the Conservative whip and will sit as an independent MP for his constituency.
Follow us on twitter @The_Gazette and like our page on facebook to keep up with all the latest news.


text:
In advance of a September 8 Senate Finance Committee hearing, the Joint Committee on Taxation released a report summarizing U.S. tax treatment of cross-border income and related tax issues. The report includes a 25-page summary of existing tax rules applicable to inbound and outbound investment and a discussion of key issues such as the perceived need… Continue Reading
Category Archives: Corporations: InternationalSubscribe to Corporations: International RSS Feed
IRS-Treasury 2011-2012 Business Plan ReleasedPosted in Corporate, Corporations: International, Estate and Gift, General, Partnership/LLC
The IRS released its annual Priority Guidance Plan on September 2, containing 317 projects that are priorities for the twelve-month period from July 2011 through June 2012. Although the total number of items on the list is similar to the prior year, some categories contain a more robust list of projects. For example, partnership tax… Continue Reading
Final "Killer B" Regulations – Triangular Reorganizations With Foreign CorporationsPosted in Corporations: International
The IRS finalized the 2008 proposed and temporary "Killer B" regulations involving triangular reorganizations with foreign subsidiary corporations. The regulations address what may be viewed as repatriation transactions that are in the form of a reorganization. Generally speaking, the regulations treat the acquisition of Parent stock by the foreign subsidiary as a dividend occurring immediately… Continue Reading


text:
Poonam Pandey Hot Bedroom Video Leaked
Description:Poonam Pandey, the controversial queen after posting a hot shower video at her official site, has now tweeted another video by name "The Bedroom Secrets". Take a look at it.
Added:2 years ago
0 likes, 0 dislikes
Embed / Iframe code:
Make your selection, copy and paste the embed code above.
Standart sizes: Custom size:
What is the problem?
Please do not abuse this section. The videos ,which are on investigate list, are manually checked by editor.
Security code:(is not case-sensitive) can't read
Write a comment
at least 10 characters, up to 400 characters
400 characters remaining
Security code:
(is not case-sensitive) can't read


text:
NBSL partners with Players Edge in WestfieldUpdated Thursday April 6, 2017 by Northampton Baseball & Softball.
We are committed to all our players.
Our goal each season is to ensure that each player gains confidence in their abilities throughout the season...to see this goal realized, we have partnered with Players Edge in Westfield to provide additional player training sessions.
Their resident coach, Chad Levesque has also trained our coaches and provided a great deal of information for our coaches to better help players
Additionally we are setting up batting, pitching and catchers clinics, some with U-Mass alums...we'll be having divisional practices throughout the season as well.
With a strong sense of community and dedication by tireless volunteers we aim to ensure that each player see success while gaining confidence in 2017


text:
Results 1 to 2 of 2
08-17-04, 11:24 #1Registered User
- Join Date
- Oct 2002
- Posts
- 5
Unanswered: How to adjust the work table limit?
There is a SQL statement:
select .... from table1 group by c1, c2, c3
Sybase cannot execute it and reported 'The current query would generate a key size of 763 for a work table. This exceeds the maximum allowable limit of 600'.
But this statement can easily be executed in MSSQL and MySQL also ACCESS.
I won't modify statement because it has been very simple.
Can I adjust the Sybase work table limit? And how?
Thank you.
08-17-04, 12:34 #2Registered User
- Join Date
- Jul 2004
- Posts
- 2
I think you have to reduce the total size of the columns named in the group by clause.
The "Troubleshooting and Error Messages Guide" may help you.


text: Hi, everyone. I've contemplated making a thread here for a while and finally decided to go ahead and do it. Sketching is a hobby for me, but I'm always trying to improve, and many of my subjects end up coming from the Original Trilogy era. Pencil is my preferred medium, though I mess around with ink and colored pencils every so often when I'm feeling really brave. This one I just finished last week. A Gran X-wing pilot: http://i61.photobucket.com/albums/h63/chrononaut67/sketches/maptoo01a.jpg A Rebel pilot's homecoming: http://i61.photobucket.com/albums/h63/chrononaut67/sketches/reunion03a.jpg Thanks for looking!


text:
Severe Sepsis/Septic Shock on Admission to the General Surgical ICU
The recruitment status of this study is unknown. The completion date has passed and the status has not been verified in more than two years.
Verified June 2011 by Mahidol University.
Recruitment status was: Not yet recruiting
Recruitment status was: Not yet recruiting
Mahidol University
ClinicalTrials.gov Identifier:
First Posted: June 1, 2011
Last Update Posted: June 6, 2011
Information provided by:
Mahidol University
- Full Text View
- Tabular View
- No Study Results Posted
- Disclaimer
- How to Read a Study Record
No Study Results Posted on ClinicalTrials.gov for this Study
|Study Status:
|This study is not yet open for participant recruitment.
|Estimated Study Completion Date:
|July 2012
|Estimated Primary Completion Date:
|May 2012 (Final data collection date for primary outcome measure)
Zahar JR, Timsit JF, Garrouste-Orgeas M, Français A, Vesin A, Descorps-Declere A, Dubois Y, Souweine B, Haouache H, Goldgran-Toledano D, Allaouchiche B, Azoulay E, Adrie C. Outcomes in severe sepsis and patients with septic shock: pathogen species and infection sites are not associated with mortality. Crit Care Med. 2011 Aug;39(8):1886-95. doi: 10.1097/CCM.0b013e31821b827c. Erratum in: Crit Care Med. 2011 Oct;39(10):2392. Vesim, Aurélien [corrected to Vesin, Aurélien].


text:
Sandy's Helicopter is an object that was first seen in the episode, "SpongeBob SquarePants vs. The Big One."
Sandy's Helicopter resembles a modern helicopter except it is made of various items found on the island that Sandy and the others were stranded on. One of the materials used is bamboo.
Role in the series
In "SpongeBob SquarePants vs. The Big One," Sandy, after deciding to use the various of resources of the island to hear advantage, creates her helicopter in an attempt to fly herself,SpongeBob and the others back to Bikini Bottom. However, Sandy soon flies into a storm and Mr. Krabs' cash register, Cashy, crashes through her windshield and she starts to lose control. Her helicopter hits the Flying Dutchman on his head and soon crashes onto the ground.
This section is too short. You can help the Encyclopedia SpongeBobia by expanding it.


text:
Play.com issues warning over personal data breach
Online retailer Play.com has e-mailed customers warning of a security breach that could compromise personal details.
This Article Covers
Online retailer Play.com has e-mailed customers warning of a security breach that could compromise personal details.
The e-mail says: "We are e-mailing all our customers to let you know that a company that handles part of our marketing communications has had a security breach. Unfortunately this has meant that some customer names and e-mail addresses may have been compromised."
New technologies: a source of threat as well as a solution
Learn about fighting the ever evolving ransomware, IoT botnet malware and data manipulation attacks.
By submitting your personal information, you agree that TechTarget and its partners may contact you regarding relevant content, products and special offers.
You also agree that your personal information may be transferred and processed in the United States, and that you have read and agree to the Terms of Use and the Privacy Policy.
Play.com urged its customers to be vigilant with their e-mail and personal information when using the internet. "At Play.com we will never ask you for information such as passwords, bank account details or credit card numbers. If you receive anything suspicious in your e-mail, please do not click on any links and forward the e-mail to firstname.lastname@example.com for us to investigate."
The Payment Card Industry Data Security Standard (PCI DSS) specifies a level of security that companies taking credit card payments must adhere to.
Enjoy the benefits of CW+ membership, learn more and join.


text:
$34.99 $79.99 (56% off)
Maximize your work output with this Fleximounts Full Motion Dual Arm Desk Mount for 10" to 30" Monitors, on sale at A mazon for $34.99. Shipping is free on orders of $49 or more. The same item sells for $42.99 at Newegg. More Info »Claim Deal » Expired 03/07/17


text:
Results 1 to 7 of 7
Thread: Shell Script to parse a file
11-15-04, 15:38 #1Registered User
- Join Date
- Jan 2004
- Posts
- 70
Unanswered: Shell Script to parse a file
Any chance someone knows of a simple example of a unix shell script that parses a simple input file?
I am given an input file that looks like this:
label1 = somedata
label2 = moredata
... a bunch more of the same format
label9 = evenmoredata
SpecialLabel = DataLabel
dataR1C1 dataR1C2 dataR1C3 dataR1C4 dataR1C5
dataR2C1 dataR2C2 dataR2C3 dataR2C4 dataR2C5
dataR3C1 dataR3C2 dataR3C3 dataR3C4 dataR3C5
dataR4C1 dataR4C2 dataR4C3 dataR4C4 dataR4C5
dataR5C1 dataR5C2 dataR5C3 dataR5C4 dataR5C5
dataR6C1 dataR6C2 dataR6C3 dataR6C4 dataR6C5
What I have to do is call another shell script and pass in the data in that file as arguements.
What I was thinking of doing is reading in each label and data set and storing the data into a variable then calling the other shell script and passing it that $variable. but I have no idea how to do that.
The only tricky part, well to me, is the "SpecialLabel = DataLabel" just means the format changes from "label = data" to that table. The only thing I need from that table is the third column. If I do awk ' {print $3 }' input.file then I get all the data I need since it just gets the third arguement for each line, but how do I put all that data into variables?
I have to take each value in the third column and turn it into a single string delimited by commas, im guessing something like this: nawk -v RS='' -v OFS="," '$1=$1' input.inp, but that just does the whole file.
Well one more tricky part is I will only need some of the "label = data" lines depending on what label really is. So if label = "SERVER" i want to set the SERVER variable to the data. The order is never guaranteed either =\
Last edited by JamesAvery22; 11-15-04 at 16:30.
11-15-04, 16:34 #2Registered User
Originally Posted by JamesAvery22
- Join Date
- Apr 2004
- Location
- Boston, MA
- Posts
- 325
#!/bin/ksh echo "whatever is here" # 'source' the content of the 'var.txt' - all the variable definitions from # var.txt become available as variables in the context of 'avery.ksh' # invokation. . var.txt other.ksh -l1 "${label1}" -l2 "${label2}"vlad
| #include <disclaimer.h> |
11-15-04, 16:36 #3Registered User
Originally Posted by vgersh99
- Join Date
- Jan 2004
- Posts
- 70
Thanks a lot btw.
also, the name of the file is given into my shell script as an argument, can I just do ". $1" if the name of the file is the first argument instead of ". var.txt"?
Last edited by JamesAvery22; 11-15-04 at 16:44.
11-15-04, 17:04 #4Registered User
- Join Date
- Jan 2004
- Posts
- 70
Hrmmm the ". input.inp" didnt work. It just says "not found" for every line.
So for this line : label1 = data
it says "label1: not found"
11-15-04, 18:42 #5Registered User
- Join Date
- Jan 2004
- Posts
- 70
If someone could help me out Id appreciate it. What I wanted to do was loop through the input.inp file line by line like this
while [ true ] do read X#read a line if [ $? -ne 0 ] #Break if EOF then break fi export testcase=`echo $X | cut -f3-3 -d" "` if [ $testcase == "DataLabel" ] #Break if EOF or you hit SpecialLabel = DataLabel, DataLabel is a special word, so if the third word is DataLabel then stop then break fi echo export $X done < $1 echo $0: Executing command: other.cmd "${JOBNUMBER}" "${SERVER}" "${DATABASE}" "${USERID}" "${PASSWORD}" "${ENVIR}" "${REPORTNAME}" "${REPORTTITLE}" "${PAYDATE}"
And I still have no idea how to handle the table part.
11-15-04, 19:52 #6Registered User
- Join Date
- Jan 2004
- Posts
- 70
Well I got it working pretty much:
#!/bin/ksh export REMICDATA='notfound' export serials='NULL' while read line do if [ $? -ne 0 ] #Break if EOF then break fi export testremic=`echo $line | tr -d " \t"i` if [ $testremic == "DATA=REMIC" ] #Break if you hit DATA = REMIC then REMICDATA="found" fi if [ $REMICDATA == "found" ] then if [ $testremic != "DATA=REMIC" ] then if [ $serials == "NULL" ] then export serials=`echo $line | cut -f3-3 -d" "` else export serials=$serials,`echo $line | cut -f3-3 -d" "` fi fi else export exportstring=`echo $line | tr -d " \t"i` export $exportstring fi done < $1 echo $0: Executing command: other.cmd "${JOBNUMBER}" "${SERVER}" "${DATABASE}" "${USERID}" "${PASSWORD}" "${ENVIR}" "${REPORTNAME}" "${REPORTTITLE}" "${PAYDATE}" ${serials}
And this thing is verrry slow. Im guessing I shouldnt be doing that loop or something. If someone could please point me towards the correct way on doing this I would greatly appreciate it. Thanks
Last edited by JamesAvery22; 11-16-04 at 12:47.
11-18-04, 11:25 #7Registered User
- Join Date
- Jan 2004
- Posts
- 70
Would someone mind looking at my while loop? I cant see anything wrong with it and its taking forever. Are loops typically a bad thing in shell scripting?