Getting started with Qt

Hi guys,

Qt is a cross-platform application framework used extensively for developing non-GUI programs and consoles for servers. It is written in C++ and works on major platforms including Android, iOS, Windows and more recently Sailfish MeeGo Linux. There exists three versions of Qt available on each of these platforms, namely:

GUI Framework – commercial entry level GUI edition, stripped of network and database support (formerly named “Desktop Light”)

Full Framework – complete commercial edition

Open Source – complete Open Source edition

The latest version of Qt (Qt 5.2) now includes new functionalities for KDE Frameworks 5 and hardware accelerated graphics. In this tutorial, we will learn how to start using Qt on Windows with the help of a sample program.

Pre-requisites: Windows 7 (64 bit)

Step 1: Download Qt for Windows

To start programming using Qt, you need to download the binaries for either MingGW or Visual Studio from over here. You can choose an offline or an online installer depending upon your operating system. After you have successfully installed Qt, you need to open the Qt Creator application.

Note: Qt Creator is a cross-platform IDE for C++ and QML. Qt Designer’s GUI layout/design functionality is integrated into this relatively new IDE.

Step 2: Create Qt console application project

Go to File–>New File or Project and create a new Qt console application named TestQt. In case you installed Qt with Visual Studio, you should see the compiler kit already loaded. Qt creator uses the default Desktop kit for creating console applications.

qt_creator_1

qt_creator_2

qt_creator_3

Step 3: Write a sample program

Now, let’s write a simple Qt Hello World program. Open the main.cpp file and add the following code!

#include <QApplication>
#include <QtWidgets/QPushButton>

int main(int argc, char **argv)
{
    QApplication app (argc, argv);

    QPushButton button ("Hello world !");
    button.show();

    return app.exec();
}

.pro file


QT       += core

QT       -= gui

QT       += widgets

TARGET = TestQt
CONFIG   += console
CONFIG   -= app_bundle

TEMPLATE = app

SOURCES += main.cpp

Right click your project and run qmake. Now, build your project. If no build errors are present then run the application to see the following output!

qt_creator_4

Qt is currently available under GPL v3, LGPL v2 and a commercial license. It is developed by Digia, who owns the Qt trademark, and the Qt Project under open governance, involving individual developers and firms working to advance Qt. Thanks for visiting! πŸ™‚

Reference: Qt software

Tutorial #66: Getting started with Tizen on Windows!

Hey everyone!

Recently, a new Linux based operating system called Tizen was launched for devices (including smartphones,tablets etc) by Samsung, Intel along with other members of the Tizen Association. Tizen is a project within the Linux Foundation and is governed by a Technical Steering Group (TSG) composed of Samsung and Intel among others. The SDK allows developers to use HTML5 and related web technologies to write applications that run on supported devices.

In this tutorial, we will learn how to setup and install Tizen SDK on Windows!

Pre-requisites: Windows 7 (64 bit), Tizen SDK

Step 1: Download Tizen SDK image and install manager

You first need to download the SDK image for the respective platform (in this case Windows) from over here. Thereafter, you need to download and run the Install manager. Follow the below steps after running the SDK Install manager,

Click Advanced when the SDK set-up wizard starts.
In the Advanced Configuration window, select the SDK Image radio button.
Click the folder button, browse to the SDK image file, and click OK.
Click Next.
Select Install the Tizen SDK radio button and click Next.

Step 2: Open Tizen IDE and create project

In order to create your first HelloWorld application, open Tizen IDE. Go to File–>Project–>Tizen and select Tizen Native Project.

Give the project name as HelloWorld and click Finish.

tizen_sdk_1

tizen_sdk_2

The project will get created and will be listed within the Project Explorer window.

tizen_sdk_4

Step 3: Create emulator to deploy application

Click on the Emulator manager under the Connection Explorer window and create a new emulator for deployment by clicking the Add new button.

tizen_emulator

Step 4: Creating security profile and author certificate

For creating a new Security Profile, go to Window–>Preferences–>Tizen and select Security Profile. Click on the Add Profile button to create a new profile. Similarly, generate an Author Certificate.

tizen_security_profile

Now, finally run the application on the emulator and you should see the following output!

homescreen_tizen_emulator

hello_world_tizen

Reference: Installing Tizen SDK

Installing Oracle Data Integrator 12c!

Hi everyone!

Oracle recently announced the latest version of its data integration products by introducing Oracle Data Integrator 12c and Oracle GoldenGate 12c. It is one of the biggest releases of the company this year and provides features that include improved performance, increased productivity and simplified deployment.

Through this post, we will learn how to install Oracle Data Integrator 12c on Windows. The following are some of the new features added to ODI 12c.

  • Declarative Flow-Based User Interface
  • Reusable Mappings
  • Multiple Target Support
  • Step-by-Step Debugger
  • Runtime Performance Enhancements
  • Oracle GoldenGate Integration Improvements
  • Standalone Agent Management with WebLogic Management Framework
  • Integration with OPSS Enterprise Roles
  • XML Improvements
  • Oracle Warehouse Builder Integration
  • Unique Repository IDs
  • Pre-requisites: Windows XP (32 bit) Service Pack 3

    Step 1: Download Oracle Data Integrator 12c

    Go to the downloads page for Oracle Data Integrator and download version 12c for all platforms (including 64 bit).

    Step 2: Run installer

    Once you have downloaded the software, you need to run the installer to begin the setup process. Follow the below steps for better understanding!

    installation_step_1

    installation_step_2

    installation_step_3

    installation_step_4

    installation_step_5

    This completes the installation. Now open ODI Studio from within the application directory. Further, you can choose to store passwords in Wallet.

    running_odi_1

    running_odi_2

    running_odi_3

    Reference: Oracle blog

    Getting started with MongoDB on Windows!

    MongoDB is a popular open-source, cross platform document oriented database system. It is one of those NoSQL databases out there used for handling random, unstructured data as opposed to the traditional relational database management system (RDBMS) structure.

    Through this post, we will learn how to install and setup MongoDB in Windows followed by a simple example!

    Pre-requisites: Windows 7 (64 bit) OS

    Step 1: Download MongoDB

    Go to the downloads page on the MongoDB website and obtain the latest version of the database depending upon your operating system bit version (32 or 64 bit). Extract all the contents to a folder mongodb, for example C:\mongodb

    Step 2: Create Configuration file

    You first need to create a MongoDB config file inside the MongoDB folder for example, mine exists at C:\mongodb\mongo.config. Create the file using any text editor like Notepad.

    mongo.config

    ##store data here
    dbpath=C:\mongodb\data
     
    ##all output go here
    logpath=C:\mongodb\log\mongo.log
     
    ##log read and write operations
    diaglog=3
    

    Note: You need to manually create two folders namely data and log inside the MongoDB directory!

    mongo_db_folder_structure

    Step 3: Run MongoDB server

    Open a command prompt window. Navigate up to the bin (C:\mongodb\bin) folder and execute the following command!

    mongod.exe --config d:\mongodb\mongo.config
    

    run_mongo_db_server

    Step 4: Connect to MongoDB

    Finally, connect to your MongoDB database by typing the mongo command in the prompt.

    connect_to_mongo_db

    Short Example

    At present, we don’t really have a database. We need to create one to insert records. Copy the below commands in your MongoDB shell.

    >db.test.insert( {name:'karan', city: 'mumbai' } );
    >db.test.insert( {name:'vaibhav', city: 'bangalore' } );
    >db.test.insert( {name:'ashish', city: 'pune' } );
    

    create_database_insert_records

    The above example inserts a document in the collection named test. You can find more information over here.

    Also, one can search for all records or for a particular record as follows!

    >db.test.find()
    

    finding_all_records

    >db.test.find(city:'mumbai');
    

    finding_particular_record

    That completes the setup of MongoDB. Stay tuned for more! πŸ™‚

    Tutorial #46: Configuring Oracle database for using GoldenGate

    Hello!

    In my previous tutorial on Oracle GoldenGate, we saw how to install the GoldenGate software on a Windows 7 machine. However, in order to start using GoldenGate we need to first configure or prepare the Oracle database.

    Over here I will demonstrate how to set up your Oracle database for getting started with GoldenGate. This would involve configuring both the source and target databases. In this case, we assume that both source and target are Oracle databases.

    Pre-requisites: Oracle database 11g Enterprise Edition with *SQLPlus, Windows 7 (64 bit) Operating System

    Step 1: Create a new schema for GoldenGate

    Open *SQLPlus and Connect to your database instance as sysdba (system database administrator). In case you are not able to log in as sysdba, please refer this link. Once connected, execute the following commands in the given order!

    1. create tablespace ggs_data
       datafile 'D:\app\your-path-to-ORADATA\orcl\ggs_data.dbf' size 200m
       autoextend on next 10m maxsize 4g;
    
    2. create user ggs_owner identified by g
       default tablespace ggs_data
       temporary tablespace temp;
    
    3. grant connect, resource to ggs_owner;
    
    4. grant select any dictionary, select any table to ggs_owner;
    
    5. grant create table to ggs_owner;
    
    6. grant flashback any table to ggs_owner;
    
    7. grant execute on dbms_flashback to ggs_owner;
    
    8. grant execute on utl_file to ggs_owner;
    
    9. grant create any table to ggs_owner;
    
    10. grant insert any table to ggs_owner;
    
    11. grant update any table to ggs_owner;
    
    12. grant delete any table to ggs_owner;
    
    13. grant drop any table to ggs_owner;
    

    Step 2: Enable ARCHIVELOG mode for Oracle database

    GoldenGate requires the Oracle database to be in ARCHIVELOG mode. When you enable this mode redo logs will be archived instead of overwritten. The archive logs are stored in a separate place usually can backed up regularly by your standard filesystem backup system (NetBackup or whatever).

    -- to check it the database is running in archivelog mode:
    select log_mode from v$database;
    
    -- to make it running in archivelog mode:
    shutdown immediate startup mount
    alter database archivelog;
    

    Step 3: Verify database-level supplemental logging

    When the supplemental logging is active on a database, the redo logs contain other columns from tables to uniquely identify a row. We need to verify supplemental logging at the source database by writing the following SQL command!

    -- it must be YES or IMPLICIT
    SELECT SUPPLEMENTAL_LOG_DATA_MIN FROM V$DATABASE;
    
    -- to enable it:
    ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;
    

    Step 4: Add DDL replication support

    Goldengate supports the replication of DDL commands, operating at a schema level, from one database to another. By default the DDL replication is disabled on the source database (extract side) but is enabled on the target Database (replicat side). The commands below are used to activate the DDL replication.

    However, it is best suited to carry out DDL replication on both source and target databases as follows!

    Create a file named as GLOBALS in the GoldenGate directory, if one does not exist!

    C:\gg_src>notepad GLOBALS
    

    Add the following into the GLOBALS file:

    GGSCHEMA ggs_owner
    

    Log in to *SQLPlus as sysdba by navigating to the gg_src folder!

    C:\ggs_src>sqlplus /nolog
    
    SQL*Plus: Release 11.2.0.1.0 Production on Mon Jul 29 22:34:15 2013
    Copyright (c) 1982, 2010, Oracle.  All rights reserved.
    
    SQL> conn / as sysdba
    Connected.
    

    Run the below SQL scripts

    Note: When asked for schema name enter ggs_owner

    SQL> @marker_setup.sql
    
    SQL> @ddl_setup.sql
    
    SQL> @role_setup.sql
    
    

    Grant the created role (default name is GGS_GGSUSER_ROLE) to all Oracle GoldenGate Extract users.

    SQL> GRANT GGS_GGSUSER_ROLE TO ggs_owner;
    

    Run the ddl_enable.sql script to enable the DDL trigger.

    SQL> @ddl_enable.sql
    

    Finally, make sure you commit all the changes made so far. You have now successfully configured the Oracle database for using GoldenGate. In the upcoming tutorials we will see how to perform initial load, unidirectional replication, bidirectional replication etc using Extract, Replicat processes and data pumps. Till then enjoy! πŸ™‚

    Source: Oracle GoldenGate Hands On Tutorial

    References: Supplemental Logging, DDL replication

    Installing Oracle database 11gR2 on Windows

    Hi guys!

    Recently, Oracle launched it’s latest database version 12c Release 1. Prior to this version, developers used the Oracle 11gR2 (Release 2) version of the Oracle database. Some of the features that were introduced in Oracle 11g were clustering, business intelligence and data warehousing, content management services, performance, manageability etc.

    In this tutorial, we will learn how to download and install the Oracle database 11gR2 version on a Windows machine!

    Pre-requisites: Windows 7 (64-bit) Operating system, minimum 3GB RAM, latest version of Java i.e Java 7 64-bit installed for Windows

    Step 1: Download Oracle 11gR2 database

    Go to the Oracle database software downloads page and download both the files of Oracle 11gR2 for Windows (x64).

    Step 2: Run the the Oracle Universal Installer

    Once you have downloaded both the files, extract them to obtain the respective Disk1 and Disk2 folders. Copy paste the database folder in Disk2 to Disk1 so that both the database folders get merged. Now, click on the oui (Oracle Universal Installer) present in the install folder in Disk1.

    oracle_11gR2_install_0_1

    oracle_11gR2_install_0_2

    Follow the below screenshots in order to begin with the installation!

    oracle_11gR2_install_1

    oracle_11gR2_install_2

    oracle_11gR2_install_3

    oracle_11gR2_install_4

    oracle_11gR2_install_5

    The installation will take around 15-20 minutes. Once the installation is over, you will get the Password management option. There you can unlock other user accounts including scott.

    Issues faced during installation

    Issue #1: Length of PATH Environmental variable

    Make sure the length of your PATH environmental variable does not exceed 1023 characters or else installation will not proceed.

    Issue #2: Presence of another Oracle database instance

    Before you install Oracle 11gR2 on your machine, make sure you don’t have another Oracle instance running. Sometimes, due to the presence of another Oracle instance, the ORACLE_HOME variable path is already set. In that case, you need to either change the existing ORACLE_HOME path to something else or remove the existing Oracle database.

    Tutorial #45: Installing GoldenGate on Windows

    Hello everyone!

    Oracle GoldenGate (GG) is a well known replication software that provides real time, log based change data capture and delivery between heterogeneous systems. It acts as an ETL tool that provides high availability and disaster tolerance due to which business critical applications can operate without any disruption.

    The GoldenGate product suite includes the following!

    1. Oracle GoldenGate

    2. GoldenGate Director is a multi-tiered client-server application that enables the configuration and management of GoldenGate instances from a remote client (web based interface).

    3. Oracle GoldenGate Veridata is an online high-speed data comparison solution that identifies and reports data discrepancies between databases and sets of data.

    In this tutorial, I will explain how to download and configure GoldenGate on a Windows machine!

    Pre-requisites: Windows 7 (64 bit) Operation System

    Step 1: Download Microsoft Visual C++ 2005 SP1 and GoldenGate

    First, you need to download the Microsoft Visual C++ 2005 SP1 Redistributable for Windows 7 (x64). Download appropriate version of GoldenGate from the Oracle website. If you working on an Oracle 11g database then you need to download the GoldenGate Oracle 11g 64 bit package for Windows. Extract the downloaded rar file to get the GG folder.

    Step 2: Create new directory for GG software

    Create a new directory called gg_src

    C:\mkdir gg_src
    

    Note: Do not install GoldenGate into a folder that contains spaces in its name.

    Copy all the files inside the extracted GG folder to gg_src. Now, open a Command Prompt window and navigate to the folder gg_src and type the ggsci command.

    C:\gg_src\ggsci
    

    GoldenGate should now open up. Write the command CREATE SUBDIRS to create the necessary sub-directories to be used by GoldenGate.

    snap1

    Step 3: Add and install Manager service

    Inside the ggsci window, type edit params mgr. It will create a new Notepad file. Add the following lines to it!

    port 7809
    BOOTDELAYMINUTES 3
    autostart ER *
    PURGEOLDEXTRACTS dirdat/*, USECHECKPOINTS, MINKEEPDAYS 3
    

    Note: You can use port number as 7840 also. The autostart ER parameter indicates all Extract and Replicat processes to start automatically as soon as the Manager is started. PURGEOLDEXTRACTS is used to specify the minimum number of days for storing trail files. You can read about Extract, Replicat processes and trail files by downloading the latest GoldenGate documentation from over here.

    Now, open another instance of Command Prompt, navigate to the gg_src folder and type the following command!

    C:\gg_src>install ADDSERVICE AUTOSTART
    

    The Manager service is now successfully installed. To verify the same try starting the manager from the ggsci window as follows!

    snap2

    So that’s it for this tutorial. In the next tutorial, we will learn how to configure or prepare the Oracle database for using GoldenGate. Have a nice day! πŸ™‚