Basic Git commands

Git installs as a normal package on Ubuntu:

sudo apt-get install git

Configuring Git user is an optional step:

git config --global user.email "you@example.com"
git config --global user.name "Your Name"

Type the following command to create an empty repository wherever your code is:

cd ~
git init

(more…)

How to compile BOOST with MS Visual Studio 2010-2017

Fortunately, to compile BOOST with MS VC 2010 we need Visual Studio Command Prompt and five commands:

Navigate to BOOST directory, for example:

F:
cd F:\Projects\Lib\boost_1_53_0

(more…)

How to pass a Dictionary<Key, Value> from C# to PHP

I believe that the simplest way to pass complex data from C# to PHP is through WCF service. See my previous post How to implement WCF service in PHP for more details.

Let assume we have a WCF service contract that has the following method with some nested dictionary as a parameter:

[ServiceContract]
public interface IStore
{
    [OperationContract]
    void UpdateRows(Dictionary<int, Dictionary<string, object>> rows);
}

Below I provided the sample implementation of UpdateRows in PHP that iterates through nested dictionaries (first level called ‘rows’ and second level called ‘properties’):

(more…)

WPF TreeView does not support Data Virtualization

WPF implements UI Virtualization via VirtualizingStackPanel and it works great, but situation with Data Virtualization is a bit more complex.

After doing some experimentation I realized that VirtualizingStackPanel when used with WPF TreeView does not allow the data to be virtualized because it iterates through all the collection of data items from inside its MeasureOverride function. However, it access only visible data items when used with DataGrid or ListView, so it allows to use some paging or caching techniques in this case. See the following articles for more information:

If you interested on what I tried to do with TreeView, please read below.

(more…)

Generalization of auto_ptr<T> for working with Win32 API

A long time ago, STL had auto_ptr<Type> class that automatically deleted a dynamically allocated C++ object when control leaves a block. Personally, I believe that auto_ptr<Type> was typically used in simple scenarios as a local variable or a class member but theoretically it is even possible to declare a vector of auto_ptr<Type> because auto_ptr<Type> stores an ownership indicator and its copy constructor transfers the ownership from the instance being copied, so vector::push_back(…) and vector::resize(…) functions works correctly.

(more…)

Setting up Shared Hosting with Nginx on Ubuntu – step by step guide

This is a draft version of the post. It’ll be revised.

Installing Ubuntu Server

  1. Download the latest version of Ubuntu Server. Note that it is not possible to convert Ubuntu 32 bit to 64 bit. The only way is to do a clean install.
  2. Create a bootable USB stick using Pen Drive Linux’s USB Installer.
  3. Boot up from USB and install Ubuntu Server. During the installation you can switch to terminal mode by pressing Alt+F2 and switch back by pressing Alt+F1.

Update the server:

aptitude update
aptitude safe-upgrade

(more…)

Visual Studio 2012 supports Visual SourceSafe

If you installed Visual Studio 2012 and all its source control related menu items shows only TFS, do not panic, Visual Studio 2012 supports Visual SourceSafe very well! The only thing that you need to do is to select source control plug-in under Tools->Options menu:

Visual Studio 2012 supports Visual SourceSafe

How to implement WCF service in PHP

Today I implemented my first PHP Web Service and successfully used it by C# client or, more precisely, I created WCF service contract in C# and implemented it in PHP.  A new option “singlewsdl” in WCF 4.5  helped me a lot. Using this option I generated the service description as a single WSDL-file without additional XSD-files containing the data contracts of the service. Then I uploaded this WSDL-file on my Web Server and written PHP code for all the methods of the service.

(more…)

Integrating C# and PHP using XML-RPC and WCF

While investigating how to make C# and PHP interact with each other I run into an interesting extension of WCF Service Model for working over XML-RPC protocol. I played a bit with this extension and after fixing some bug in its source code I made it work with my little custom XML-RPC server implemented as Joomla XML-RPC plugin.

(more…)

How to make PHP Web Service with NuSoap

While investigating how to create a Web Service in PHP I run into NuSoap library, that can generate WSDL based on some matadata describing Web Service method signatures and the data structures. I downloaded NuSoap library and found some trivial sample that started working after adding the highlighted line of code:

(more…)