May 14, 2012
askyb

Hashing Tutorial by Using Microsoft Cryptographic Service Providers

Hashing is an algorithm used to produce a hash value of some piece of data, such as a message or session key. Typical hashing algorithms include MD2, MD4, MD5, SHA-1 and SHA-2. This tutorial will guide you through the steps to create a Win32 console based sample application, which consists of cryptographic hashing function, by using Microsoft Cryptographic Service Providers (CSP). Continue reading »

May 9, 2012
askyb

Learn SQLite in 1 hour

1. Introduction

SQLite is an open source, embedded relational database which implements a self-contained, serverless, zero-configuration,transactional SQL database engine. SQLite has a well-deserved reputation for being highly portable, easy to use, compact, efficient, and reliable. Unlike client–server database management systems, installing and running of SQLite database is pretty straightforward in most cases — just make sure the SQLite binaries file exists anywhere you want and start to create, connect, and using the database. If you are looking for an embedded database for your projects or solutions, SQLite is definitely worth considering.

Continue reading »
May 8, 2012
askyb

C++ SQLite Example with Parameterized Query

You might know the benefits of using parameterized query (e.g boost query performance in term of speed, avoid SQL injection attack, etc) but how it can be done in programming way might sound like a different story to you. :) In this tutorial, I’m going to show you how we can achieve that in using of C++ and SQLite. I am using VS C++ 2010 in this tutorial. Continue reading »
May 4, 2012
askyb

Using OpenSSL Cryptography: Blowfish, DES, RC2, RC4

opensslIf you are looking for a cryptography solutions in your project, whether it is Blowfish, DES, RC2 or RC4, perhaps, you can consider to utilize the crypto library which is provided by openssl. In this tutorial, i am going to show you how it can be easily implemented into the C++ project solution. Continue reading »
May 4, 2012
askyb

Configure Visual C++ Projects to Target 64-Bit Platforms

configure visual c++ to target 64 bit platforms This tutorial describes how to setup project configuration in Visual C++ IDE in order to develop 64-bit applications. I am using a free version of Visual C++ 2010 Express in this tutorial. Visual C++ 2010 Express does not include a 64-bit compiler, we will need to install Windows 7 SDK in order to make it available in the IDE. The following the steps will guide you on how to configure your machine and IDE to develop 64-Bit application. Continue reading »
May 1, 2012
askyb

C++ SQLite Example with Atomic Transaction

SQLite Wonder how you can implement an automic transaction in SQLite so that your queries will either completely occurs, or completely fails to occur. In this tutorial, i will demonstrate how you can do that in your C++ code by modifying my previous C++ Sqlite example. My previous C++ Sqlite tutorials can be found at the following links: Continue reading »
Apr 27, 2012
askyb

Compiling and Installing OpenSSL for 32 bit Windows

opensslWhat is OpenSSL? @Wikipedia: “OpenSSL is an open-source implementation of the SSL and TLS protocols. The core library, written in the C programming language, implements the basic cryptographic functions and provides various utility functions.” Enough for the explanation of OpenSSL. :) Let’s go for the real tutorial on how you can install OpenSSL into you 32 bit Windows. I am using 32 bit Windows 7 for this tutorial. Before we can start the installation, please make sure that you have the following items ready or installed in your system: Continue reading »
Apr 26, 2012
askyb

Using Transcation in C++ PostgreSQL Example

postgresqlThere are times when you need to execute a series of SQL statements in order to achieve data consistency. For example, a customer is going to transfer his money from bank account to settle a bill payment. We will need to update both customer bank account and payee account accordingly. Failure to update either custormer account or payee account will cause data inconsistent. A transaction can be constructed to avoid data inconsistency caused by such failure. A transaction is a set of one or more statements that is executed as a unit, so either all of the statements are executed, or none of the statements is executed. Continue reading »
Apr 26, 2012
askyb

C++ PostgreSQL Example in Linux

postgresql In this tutorial, i’ll demonstrate an example on how to connect to PostgreSQL database using gcc in linux. Also, i’ll demonstrate some basic SQL execution in the C++ example so that it give better understading to you how all of these are working. If you are looking a tutorial for windows platform, you could visit the following link which demonstrate the tutorial for windows platform. C++ PostgreSQL Example in Windows Continue reading »
Apr 4, 2012
askyb

Get total seconds in C#

net-logoSometimes you might want to knon how much time will it take to execute a certain process in C#. Here is a simple example to demonstrate how you can achieve this by using the TimeSpan attribute.
1
2
3
4
5
6
7
8
9
10
11
12
13
// clock the start time
DateTime start_time = DateTime.Now;

// To-do: Add you process here.

// clock the end time
DateTime end_time = DateTime.Now;

// get total seconds spend on the process
var total_seconds = (end_time - start_time).TotalSeconds;

// print the output
Console.WriteLine("Total seconds spent: {0}", total_seconds);
Pages:1234»