Minggu, 30 Juni 2013

Xathrya Sabertooth

Xathrya Sabertooth


SQLite Manager on Mozilla Firefox

Posted: 29 Jun 2013 11:17 PM PDT

Addons are one of Mozilla Firefox’s interesting feature. One of interesting addons would be SQLite Manager which can be used for managing SQLite database.

In this article we will discuss about SQLite Manager on Mozilla Firefox. For this purpose I use:

  1. Slackware64 14.0
  2. Mozilla Firefox 20.0

However, unless you are not using Mozilla Firefox and not using SQLite, the Operating System should give no problem.

Prerequisite

  1. SQLite, latest version is recommended
  2. Mozilla Firefox

If you have not installed SQLite yet, please read related article first. You can read specific instruction on how to install SQLite for your OS (Linux, Windows, or Mac OS X).

Installation

There are two ways to install add-ons (Well, you should have know it) and both has same result.

By Firefox Menu

  1. Open Firefox
  2. Click Tools -> Add ons
  3. on bar Search add ons, type in sqlite manager
  4. Click on Install.
  5. Wait for download process and installation finished.
  6. Restart firefox

By Firefox Add-Ons site

  1. Go to https://addons.mozilla.org
  2. on search bar, type in sqlite manager and click the most matching one
  3. Click on Add to Firefox.
  4. Wait for download process and installation finished.
  5. Restart firefox

Both way you will have SQLite Manager installed. The add-on itself can be accessed as Tools -> SQLite Manager.

SQLiteMan

Now, let’s see how we can do task in previous article using SQLite Manager.

Create a New SQLite Database

To create a new database with filename xathrya.db, click on Database -> New database which give use following:

SQLiteMan1

And save the file in your preferred location, for example your home folder. Note that any database name will be appended with .sqlite

Create Table

To create a table, you can use Table -> New Table which will give following result:

SQLiteMan2

Now let’s see the result:

SQLiteMan3

Insert Record

Let’s insert 5 records there. For example we want to have records which are equivalent to this:

  insert into projects values(101,'GSM Tracker using Raspberry Pi','2013-08-01');  insert into projects values(102,'GUNDAM OS','2014-08-01');  insert into projects values(103,'Project Mikan','2015-08-01');  insert into projects values(104,'Project Freedom','2016-08-01');  insert into projects values(105,'Low Orbit Unmanned Plane using Arduino','2017-08-01');  

Unfortunately, we have to insert it one by one by click button Add. For example we will insert record with id=101.

SQLiteMan4

Verify Record

Well, when you see tab Browse & Search you can see the result immediately.

SQLiteMan5

Delete a Record

To delete a record, click on the record you want to delete then click Delete button on Browse & Search tab.

You will be asked for confirmation, click on Yes if you wish to delete the record

Update a Record

To update a record, click on the record you want to update then click Edit button on Browse & Search tab.

SQLiteMan6

Exit

Just close the window.

Reopen Database

By default, SQLite manager will try to open last database you open. If you want to open other database, click Database -> Connect Database and find the file you want to open (for this article’s example would be xathrya.db.sqlite)

Execute SQL

A fancy feature of SQLite Manager has (well, it should has, fortunately) is Execute SQL. We can execute SQL command directly. To do so, click on tab Execute SQL. There would be two areas: one is textbox for inserting command, and other to displaying the result.

For example, we want to list the record which have id greater than 102. Enter the command “select * from projects where id>102” and click Run SQL.

SQLiteMan7

First Interaction with SQLite

Posted: 29 Jun 2013 10:13 PM PDT

In the previous article we have discussed about how to install SQLite. Whether you have installed it for Linux, Windows, or Mac OS X, there should be a working SQLite. If you don’t have it yet, please proceed to installation first depend on you system.

In this article we will discuss about SQLite and cover following topics:

  • Create a new SQLite database called "xathrya.db".
  • Create "projects" table with three fields 1) Project ID 2) Name and 3) Deadline
  • Insert 5 records into the project tables.
  • Verify the records
  • Delete a record
  • Update a record
  • Exit SQLite3
  • Reopen database

Actually the operating system is not the matter here, means you can use SQLite on any operating system (whether Linux, Windows, or Mac OS X). This article should be generic enough to cover all of them.

Create a New SQLite Database

Like any SQL DBMS, data is stored on a database. However, SQLite will store all the information (tables, and metadatas) on a single file instead of creating differet files.

In this section we will create a new database with filename xathrya.db. Use following command:

  sqlite3 xathrya.db  

You would be prompted by something like this:

  SQLite version 3.7.13 2012-06-11 02:05:22  Enter ".help" for instructions  Enter SQL statements terminated with a ";"  sqlite>  

At this point, we have entered the SQLite’s command shell. Using this shell we can enter SQL command and manage our database.

Create Table

Creating a table in SQLite is like using any Relational DMBS. The underlying language is similiar, SQL.

Now let’s create a table "projects" having three fields:

  1. Project ID, denoted by field id as integer.
  2. Name, denoted by field name as varchar
  3. Deadline, denoted as deadline as datetime

The command (within SQLite shell) would be:

  create table projects(id integer primary key,name varchar(20),deadline date);  

If you see on current working directory, we have newly created file xathrya.db as result of our command.

Insert Record

To insert a record we use familiar SQL command

  insert into tableT values(list of values);  

Which in our case the the tableT would be projects and the list of values will be the value of id,name,deadline respectively. Let’s insert 5 records there.

  insert into projects values(101,'GSM Tracker using Raspberry Pi','2013-08-01');  insert into projects values(102,'GUNDAM OS','2014-08-01');  insert into projects values(103,'Project Mikan','2015-08-01');  insert into projects values(104,'Project Freedom','2016-08-01');  insert into projects values(105,'Low Orbit Unmanned Plane using Arduino','2017-08-01');  

Verify Record

Let’s see whether our records has been saved by SQLite by invoking following command:

  select * from projects;  

And you should be given following result.

  101|GSM Tracker using Raspberry Pi|2013-08-01  102|GUNDAM OS|2014-08-01  103|Project Mikan|2015-08-01  104|Project Freedom|2016-08-01  105|Low Orbit Unmanned Plane using Arduino|2017-08-01  

Delete a Record

To delete a record, for example on with id 105, use following command:

  delete from projects where id=105;  

Now let’s verify the tables. At this point, SQLite should give you following result:

  101|GSM Tracker using Raspberry Pi|2013-08-01  102|GUNDAM OS|2014-08-01  103|Project Mikan|2015-08-01  104|Project Freedom|2016-08-01  

Update a Record

SQLite can be used to update an individual record. For example we want to change project with id 102 and set the deadline to 2013-07-02. Use following command;

  update projects set deadline='2013-07-02' where id=102;  

Now verify the table. The output should be like this:

  101|GSM Tracker using Raspberry Pi|2013-08-01  102|GUNDAM OS|2013-07-02  103|Project Mikan|2015-08-01  104|Project Freedom|2016-08-01  

Exit

To exit, press CTRL+D (CTRL and D at same time).

Reopen Database

When we create a database, it is nothing but a file. To access an existing database and query the records, do the following. i.e When you do "sqlite3 xathrya.db", if the database doesn't exist it'll create it. If it already exists, it'll open it. As simple as that :D

  sqlite3 xathrya.db  

If you dont believe it, try to see the tables projects.

Installing SQLite on Windows

Posted: 29 Jun 2013 09:28 PM PDT

SQLite is an in-process library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. The code for SQLite is in the public domain and is thus free for use for any purpose, commercial or private. SQLite is currently found in more applications than we can count, including several high-profile projects.Unlike most other SQL databases, SQLite is and embedded SQL database engine. It does not have separate server process.SQLite reads and writes directly to ordinary disk files. All power of database is contained in a single disk file. The file format is cross-platform which can be adopted to 32-bit and 64-bit systems or between big-endian and little-endian architectures. SQLite is not as a replacement for complex database, but as replacement for fopen() primitive.

In this article we will discuss about installing SQLite for Windows operating system. For this purpose I use Windows 7 32-bit as test machine. The method we use will be binary installation.

Obtain the Materials

SQLite latest version is 3.7.17. Download the source code from SQLite’s main download page. You need to download following:

  1. A command-line shell for accessing and modifying SQLite databases. This program is compatible with all versions of SQLite through 3.7.17 and beyond. Download here.
  2. This ZIP archive contains a DLL for the SQLite library version 3.7.17 for 32-bit x86 processors using the Win32 API. The DLL is built using SQLITE_ENABLE_COLUMN_METADATA so that it is suitable for use with Ruby on Rails. Download here.
  3. (optional) An analysis program for database files compatible with all SQLite versions through 3.7.17 and beyond. Download here.

Installation

Assuming we have downloaded the above files:

  • Create a directory (folder) C:\>sqlite and unzip the zipped files into this folder. This should gives us sqlite3.exe, sqlite3.def, and sqlite3.dll. If you have download the analysis program, then you will get sqlite3_analyzer.exe.

  • Add C:\>sqlite in your PATH environment variable

  • open command prompt (cmd) and issue sqlite3 command which should display a result something as below.

  C:\>sqlite3  SQLite version 3.7.15.2 2013-01-09 11:53:05  Enter ".help" for instructions  Enter SQL statements terminated with a ";"  sqlite>  

At this point we have installed the SQLite.

To explore / interact with SQLite for first time, see this article.

Installing SQLite on Linux

Posted: 29 Jun 2013 09:13 PM PDT

SQLite is an in-process library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. The code for SQLite is in the public domain and is thus free for use for any purpose, commercial or private. SQLite is currently found in more applications than we can count, including several high-profile projects.Unlike most other SQL databases, SQLite is and embedded SQL database engine. It does not have separate server process.SQLite reads and writes directly to ordinary disk files. All power of database is contained in a single disk file. The file format is cross-platform which can be adopted to 32-bit and 64-bit systems or between big-endian and little-endian architectures. SQLite is not as a replacement for complex database, but as replacement for fopen() primitive.

In this article we will discuss about installing SQLite in Linux. For this purpose I use Slackware64 14.0 as test machine. However, it can also be installed to other Linux distribution than Slackware. The method we use will be source installation.

Obtain the Materials

SQLite latest version is 3.7.17. Download the source code from SQLite’s main download page. The one we use in this article is this. Later we will refer this as SQLite archive.

Installation

Assuming we have downloaded the SQLite archive (sqlite-autoconf-30717.tar.gz):

  tar xvfz sqlite-autoconf-3070717.tar.gz  cd sqlite-autoconf-3070717  ./configure  make  make install  

Note that to do installation, you should have enough privilege.

At this point we have installed the SQLite.  The default installation would take /usr/local as prefix, thus the header will be located on /usr/local/include and the library will be at /usr/local/lib as well.

To explore / interact with SQLite for first time, see this article.

Installing Firebird on Linux

Posted: 29 Jun 2013 04:02 AM PDT

Firebird is a relational database offering many ANSI SQL standard features that runs on various operating system. It offers excellent concurrency, high performance, and powerful language support for stored procedures and triggers.

In this article we will discuss about installing Firebird in Linux. For this purpose I use Slackware64 14.0 as test machine. However, it can also be installed to other Linux distribution than Slackware. The method we use will be source installation.

Obtain the Materials

Firebirdsql site use Sourceforge to host their source code, can be found here. The latest version we can find is Firebird 2.5.2 which can be downloaded here.

Installation

Assuming we have extract the archive and locate ourselves at source code’s directory, do following to do compilation and installation:

  ./configure  make  make install  

Note that to do installation, you should have enough privilege.

At this point, we have installed Firebird SQL standard installed.

Sabtu, 29 Juni 2013

Xathrya Sabertooth

Xathrya Sabertooth


Installing GraphicsMagick on Linux

Posted: 29 Jun 2013 02:34 AM PDT

GraphicsMagick is self-claimed as swiss army knife of image processing. It provides a robust and efficient collection of tools and libraries which support reading, writing, and manipulating an image in over 88 major formats including DPX, GIF, JPEG, JPEG-2000, PNG, PDF, PNM, and TIFF.

The image processing is multithreaded using OpenMP.

In this article we will discuss about installing ImageMagick in Linux. For this purpose I use:

  1. Slackware64 14.0
  2. gcc

Obtain the Materials

GraphicsMagick can be obtain using two ways: download from sourceforge or clone using Mercurial.

To download the tarball, go to this link. Then, extract the content and change to its directory.

If you want to clone the repository, do this command:

  hg clone http://hg.code.sf.net/p/graphicsmagick/code GM  cd GM  

At this point, for any method you choose, we are now at GraphicsMagick’s root directory.

Installation

Building ImagesMagick can be done by using following commands (assuming we are at GraphicsMagick’s root directory):

  ./configure  make  make install  

Note that to do installation, you should have enough privilege.

At this point, we have installed GraphicsMagick standard installation.

Installing libHaru from Source

Posted: 29 Jun 2013 01:32 AM PDT

LibHaru is a free, cross platform, open source library for generating PDF files. libHaru can be used to produce PDF files, however it still lack at support for reading and editing existing PDF files.

The feature supported by libHaru:

  • Generating PDF files with lines, text, images.
  • Outline, text annotation, link annotation.
  • Compressing document with deflate-decode.
  • Embedding PNG, Jpeg images.
  • Embedding Type1 font and TrueType font.
  • Creating encrypted PDF files.
  • Using various character sets (ISO8859-1~16, MSCP1250~8, KOI8-R).
  • Supporting CJK fonts and encodings. You can add the feature of PDF creation by using HARU without understanding complicated internal structure of PDF. libHaru is written in ANSI C, so theoretically it supports most of the modern OSes.

In this article we will discuss about installing libHaru in Linux. For this purpose I use:

  1. Slackware64 14.0
  2. gcc

Obtain the Materials

libHaru use github to host the codes. To download source codes there are two methods: download as tar ball, or clone the repository.

To download the tarball, go to this link. Then, extract the content and change to its directory.

If you want to clone the repository, do this command:

  git clone https://github.com/libharu/libharu.git  cd libharu  

At this point, for any method you choose, we are now at libharu root directory.

Installation

libHaru can use cmake for building. To build libHaru, do following

  cmake .  make  make install  

Note that to do installation, you should have enough privilege.

Installing Boost Library for Linux

Posted: 28 Jun 2013 11:50 PM PDT

Boost is portable C++ source libraries and work well with the C++ Standard Library. It is intended to be widely useful and usable across a broad spectrum of applications.

In this article, we will discuss about how to install Boost Library within Linux. The method we use here is generic way, which means, it can be applied to any Linux distribution. However, for demonstration I will use following:

  1. Slackware64 14.0 Linux
  2. GCC (Compiler)

Preparation

At least you have privileges for installing the files later.

Obtain the Materials

Boost Library has official site here.

The latest version of Boost library is version 1.53.0 which can be downloaded from sourceforge (here). While there is also Boost 1.54.0 beta available, we will use the stable version at this time.

Compile & Install

Assuming the archive is boost_1_53_0.tar.bz2 and on path ~/Downloads or /home/user/Downloads. First we have to extract the library from the archive.

  cd ~/Downloads  tar -xjf boost_1_53_0.bz2  cd boost_1_53_0.bz2  

Next, build bjam binary and also set some options on what to compile and where to.

Boost is a collection of libraries / modules. The whole Boost libraries will cost some time and computation for compilation. We can skip some libraries we don’t want or won’t use. To see the list of libraries need compiling, run following:

  ./bootstrap.sh --show-libraries  

For example, following is the result / the list of libraries on Boost 1.53.0:

  1. atomic
  2. chrono
  3. context
  4. date_time
  5. exception
  6. filesystem
  7. graph
  8. graph_parallel
  9. iostreams
  10. locale
  11. math
  12. mpi
  13. program_options
  14. python
  15. random
  16. regex
  17. serialization
  18. signals
  19. system
  20. test
  21. thread
  22. timer
  23. wave

Pick any modules you want to include in Boost, for example: filesystem,program_options, and system. In this case, we can use argument –with-library=filesystem,program_options,system to bootstrap.sh. However you can also pick all / compile all the libraries, just invoke ./bootstrap.sh without –with-library switch.

Next, choose where the library will be installed. By default, the header files will be installed to /usr/local/include and the libraries (.so, .a) will be installed to /usr/local/lib. If other path is preferred, we can use –libdir switch for specifying where library will be stored and –includedir switch for specifying where header will be stored.

Now bring all of the info and invoke like this:

  ./bootstrap.sh --libdir=/usr/local/lib64 --includedir=/usr/local/include  

And you could see I will build all the libraries and store the library to /usr/local/include.

Now let’s build the library

  ./bjam  

Then install by (make sure you have privileges to do)

  ./bjam install  

At this point we have successfully installed Boost library

Installation of CMake

Posted: 28 Jun 2013 10:45 PM PDT

CMake is a cross platform, open-source build system consists of tools designed to build, test, and packaging software. It used to control the software compilation process using simple platform and compiler independent configuration files.

In general, CMake generates native makefiles and workspaces that can be used in the chosen compiler environment.

In this article, we will discuss about how to install CMake, either binary or from sources. The method we use here is generic way, which means, it can be applied to any Operating System. However, for demonstration I will use following machine:

  1. Slackware64 14.0 Linux
  2. GCC (Compiler)

Preparation

At least you have privileges for installing the files later.

Obtain the Materials

A binary and source code can be obtained here. The latest version per June 29th, 2013 is 2.8.11. Both binaries and source codes can be downloaded from here.

As I use Linux I would download source code (http://www.cmake.org/files/v2.8/cmake-2.8.11.1.tar.gz) and unfortunately no binary for Linux x64 so we download this binary (http://www.cmake.org/files/v2.8/cmake-2.8.11.1-Linux-i386.sh). If you want to download for Windows version, go grab source code (http://www.cmake.org/files/v2.8/cmake-2.8.11.1.zip) and binary (http://www.cmake.org/files/v2.8/cmake-2.8.11.1-win32-x86.exe)

Binary Installation

Assuming we download shell archive cmake-2.8.11.1-Linux-i386.sh.

Make sure the file is executable (having +x permission). Do following if you want to set the permission:

  chmod +x cmake-2.8.11.1-Linux-i386.sh  

Then execute it from terminal

  ./cmake-2.8.11.1-Linux-i386.sh  

Make sure you have privileges to do installation.

Binary installation for Windows system is similar. Just execute the application to initiated installation.

Source Code Compilation & Installation

There are two case for compilation, whether you have CMake or not installed in your system. If you have CMake, we can use CMake to build CMake. However, we can also build it from scratch. Either way we should extract the sourcecode from. A simple way is using command:

  tar -xf cmake-2.8.11.1-Linux-i386.tar.gz  cd cmake-2.8.11.1  

From Scratch

This case will describe compilation from scratch and suitable for us who either don’t have CMake installed before or just want to compile it from scratch.

We need a compiler and a make utility and running UNIX/Mac OSX/MinGW/MSYS/Cygwin.

Run the bootstrap script in the source directory of CMake. If CMake is going to be installed on particular path, use –prefix. For this example I use /usr/local as my base path.

  ./bootstrap --prefix=/usr/local  make  make install  

Unfortunately for Windows user who didn’t use Cygwin, you can’t do this method. Instead, you should download the binary version of CMake.

Build With CMake

Building CMake with CMake is like building any CMake-based project. Run CMake to the root of cmake directory (e.x: ~/cmake-2.8.11.1).

  cd ~/cmake-2.8.11.1  cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/local .  make  make install  

Notice the “.” (dot) in the trail, that’s part of command.

At this point, we have successfully install CMake

Wt C++ Web Toolkit Introduction

Posted: 28 Jun 2013 07:16 PM PDT

Wt (pronounces as witty) is a C++ library for developing web application.

Wt offers abstraction of web-specific implementation details including client-server protocols, event handling, graphics support, graceful degradation (or progressive enhancement), and URL handling. The API is widget-centric, like Qt and other toolkits.

Unlike many page-base frameworks, Wt was designed for creating stateful application that are at the same time highly interactive (leveraging techniques such as WebSockets, and Ajax) and accessible (supporting plain HTML browsers), using automatic graceful degradation or progressive enhancement. Things that are natural and simple with Wt would require an impractical amount of effort otherwise: switching widgets using animations, while being perfectly indexed by search robots with clean URLs, or having a persistent chat widget open throughout, that even works in legacy browsers like Microsoft Internet Explorer 6.

Wt can acts as a stand alone Http(s)/WebSocket server or integrates through FastCGI with other web servers.

Why Wt

Page-based web frameworks (Django, Ruby on Rails, PHP, etc …) do not attempt to abstract underlying technologies (HTML/XHTML, JavaScript, CSS, Ajax, WebSockets, Comet, Forms, DHTML, SVG/VML/Canvas). As a consequence, a web developer needs to be familiar with all of these evolving technologies and is also responsible for graceful degradation when browser support is lacking. The structure of many web applications still follows mostly the page-centric paradigm of early day HTML. This means that not only will you need to implement a controller to indicate how a user moves from page to page, but when using advanced Ajax or WebSockets, you will need to design and maintain your client-server communication.

Pure Ajax frameworks on the other hand require tedious JavaScript programming to deal with browser quirks, and client-server programming to interact securely with server resources. These applications usually are not compliant with accessibility guidelines and cannot be indexed by a search robot.

Generating HTML code or filling HTML templates is prone to security problems such as XSS (Cross-Site-Scripting) by unwillingly allowing JavaScript to be inserted in the page, and CSRF (Cross-Site Request Forgery) by trusting cookies for authentication. These security problems are hard to avoid in traditional frameworks when as a developer you need to implement JavaScript functionality and thus the framework cannot filter it out.

In contrast, a web application developed with Wt is developed against a C++ API, and the library provides the necessary HTML, CSS, Javascript, CGI, SVG/VML/Canvas and Ajax code. The responsibility of writing secure and browser-portable web applications is carried by Wt. For example, if available, Wt will maximally use JavaScript, Ajax and even WebSockets, but applications developed using Wt will also function correctly when JavaScript is not available. Wt will start with a plain HTML/CGI application and progressively enhance to a rich Ajax application if possible. With Wt, security is built-in and by default.

Typical Use Scenario

  • High performance, complex web applications which are fully personalized (and thus cannot benefit from caching), fully Ajax enabled and at the same time entirely accessible and Search Engine Optimized.
  • Web-based GUIs for embedded systems benefit from the low footprint of a C++ web application server.
  • Web-based GUIs that require integration with (existing) C++ libraries, for example for scientific or engineering applications, or existing C++ desktop applications.

Other Benefits

  • Develop web applications using familiar desktop GUI patterns.
  • Provides an extensive set of widgets, which work regardless of JavaScript availability (but benefit from JavaScript availability).
  • A single specification for both client- and server-side validation and event handling.
  • Optionally, use XHTML and CSS for layout and decoration.
  • Generates standards compliant HTML or XHTML code.
  • Portable, anti-aliased graphics optimized for web usage (using inline VML, inline SVG, HTML5 canvas or PNG images), which can also be used to render to PDF.
  • Avoid common security problems since Wt has complete control over the presentation layer and proactively filters out active tags and attributes, does not expose business logic, and simplifies authentication using a stateful design.
  • Ultra-fast load time and low bandwidth usage, which are affected only by screen complexity, not application size. Wt implements all the common tips and tricks for optimizing application responsiveness and even optimizes per browser.
  • A simple API with a robust cross-browser implementation for server-initiated events aka server push (using comet or WebSockets).
  • Use the built-in httpd for easy development and deployment, or use the FastCGI/ISAPI connectors to deploy in existing web servers.

Features

Core Library

  • Supports major browsers (Firefox/Gecko, Internet Explorer, Safari, Chrome, Konqueror, and Opera) but also plain HTML browsers (Links, Lynx).
  • Develop and deploy on Unix/GNU Linux or Microsoft Windows (Visual Studio) environments.
  • Equal behavior with or without support for JavaScript or Ajax, as far as possible, by using graceful degradation or progressive enhancement.
  • Integrated Unicode support and pervasive localization.
  • Efficient rendering and (very) low latency.
  • Support for browser history navigation (back/forward buttons and bookmarks), pretty URLs with HTML5 History if available, and search engine optimization with a unified behavior for plain HTML or Ajax sessions.
  • Configurable session tracking options that include URL rewriting and cookies.
  • High performance, allowing deployment on low-end embedded devices, or energy-, space- and budget-friendly deployment of Internet or extranet web sites.
  • Completely based on event-driven async I/O: sessions are not tied to threads, and neither do open connections block threads. Instead, threads are needed only to improve concurrent request handling or for reentrant event loops.

Event Handling

  • Uses a modern typesafe signal/slot API for responding to events.
  • Listen for keyboard, mouse and focus events, and get event details (such as mouse position, modifier buttons, or keyboard key).
  • Automatic synchronization of form field data between browser and server.
  • Dynamic C++-to-JavaScript translation, by specifying stateless slot implementations. A single C++ slot implementation provides both client-side and server-side event handling: visual changes at client-side and application state at server side.
  • Possibility to hook in custom JavaScript (e.g. for client-side only event handling), and emit C++ signals from this custom JavaScript.
  • Drag&Drop API.
  • Timed events and server-initiated updates (“server push”)
  • Uses plain HTML CGI, Ajax or WebSockets

Native Painting Support

  • Unified painting API which uses the browsers native (vector) graphics support (inline VML, inline SVG, or HTML5 canvas), or renders to common image formats (PNG, GIF, …) or vector formats (SVG, PDF).
  • Supports arbitrary painter paths, clipping, text, images, transformations, drop shadow.

GUI Component

GUI component is composed of various widgets. For comprehensive examples, you can visit this link.

Built-in Security

  • Kernel-level memory protection protects against privacy issues arising from programming bugs, since sessions can be completely isolated from each other (in dedicated-process mode).
  • Supports encryption and server authentication using Secure Sockets Layer (SSL) or Transport Layer Security (TLS) through HTTPS.
  • Enables continuous use of HTTPS through low bandwidth requirements (fine-grained Ajax).
  • Built-in Cross-Site Scripting (XSS) prevention. Rendered text is always filtered against potentially malicious code, making XSS attacks against Wt applications (close to) impossible.
  • Not vulnerable to Cross-site Request Forgery (CSRF) because cookies for session tracking are optional, and even when used, they are never solely relied on for requests that trigger event handling code.
  • Not vulnerable to breaking the application logic by skipping to a particular URL, since only those events exposed in the interface can be triggered.
  • Session hijacking mitigation and risk prevention
  • DoS mitigation
  • A built-in authentication module implements best practices for authentication, and supports third party identity providers using OAuth 2.0, and (later) OpenID Connect

Object Relational Mapping Library

Wt comes with Wt::Dbo, a self-contained library which implements Object-Relational mapping, and thus a convenient way to interact with SQL databases from C++. Although features like optimistic concurrency control make this an ideal technology for a database driven web application (and it provides good integration with Wt’s MVC classes), the library can also be used for other applications, and does not depend on Wt. The ORM library has the following features:

  • No code generation, no macro hacks, no XML configuration, just modern C++!
  • Uses a templated visitor pattern which requires a single template method to provide the mapping: DRY and as efficient as conceivable!
  • You can indicate surrogate auto-incremental keys or map natural keys of any C++ type, which may also be composite (i.e. require more than one database field).
  • Supports optimistic concurrency control using a version field.
  • Maps Many-to-One and Many-to-Many relations to STL-compatible collections.
  • Provides schema generation (aka DDL: data definition language) and CRUD operations (aka DML: data manipulation language).
  • Prepared statements throughout.
  • Each session tracks dirty objects and provides a first-level cache.
  • Flexible querying which can query individual fields, objects, or tuples of any these (using Boost.Tuple).
  • Use a single connection or share connection pools between multiple sessions from which connections are used only during an active transaction.
  • Comes with Sqlite3, Firebird, MariaDB/MySQL and PostgreSQL backends, and an Oracle backend is also available on request.

Deployment

a