One Unified Global Perspective
Communications with a Global Perspective
Home
Intro
Contact Us
Voice over IP
PBX Solutions
Services
Support
Glossary
Open Source
Blog
Forum

WebMail





2007 Oct 31 - Wed

Make It Seem To Work

"Sometimes it's much cheaper and easier to make people think that something works rather than actually make it work. After all, the result is, in all important aspects, the same." -- Douglas Adams

This reminds me of a building engineer, who, when complained to by staff that they were cold and wanted their own thermostat, put a thermostat on the wall. No one had asked that it be connected to anything, and no one complained after that.

[/Personal/TagLines] permanent link


2007 Oct 26 - Fri

Bliss

What is better than eternal bliss? Nothing. But a slice of bread is better than nothing. So a slice of bread is better than eternal bliss.

[/Personal/TagLines] permanent link


2007 Oct 23 - Tue

QuantDeveloper Source

A number of people took the time to email me their thoughts regarding my rant regarding source code for QuantDeveloper. Anton from SmartQuant responded, but unsurprisingly, I havn't heard anything from QuantHouse.

It seems that QuantHouse has purchased various rights and such to QuantDeveloper, and have renamed it to suit their suite. SmartQuant has also retained certain rights and such to QuantDeveloper, and have maintained the name. SmartQuant has indicated they are continuing development of QuantDeveloper and has hinted that some quite advanced features are in the pipeline. He also confirmed that, for existing developers who have subscribed to source code, source code is available for new releases.

[/Trading/SmartQuant/Articles] permanent link


2007 Oct 21 - Sun

The Cluetrain Manifesto

Today I was introduced to The Cluetrain Manifesto: The End of Business as Usual through a NANOG posting in response to someone's quote:

I think you greatly underestimate how customers react to the truth.

A few easily reachable quotes from the full online text:

The connectedness of the Web is transforming what's inside and outside your business -- your market and your employees. 
We are not seats or eyeballs or end users or consumers.  We are human beings  -- and our reach exceeds your grasp.  Deal 
with it

Facebook is probably one of many excellent examples of how humans interact, and companies are having a hard time trying to make those sites work for themselves. hmph. Perhaps when companies learn that they are made up of humans who share and interact, maybe good things can happen.

I'm thinking that many a great open source company has learned to share what could be classified as the family jewels, and thus have profited immensely from embracing the way humans naturaly interact.

[/Personal/Business] permanent link


2007 Oct 20 - Sat

Quality of Service Options on GRE Tunnel Interfaces

Note to self, according to Cisco's document 10106, Quality of Service Options on GRE Tunnel Interfaces: when applying queuing to a tunnel interface, shaping must also be applied. The top level policy of a recommended hierarchical policy should be a shaping command, while the lower-level policies configure the queueing mechanisms.

[/Cisco] permanent link


2007 Oct 19 - Fri

C++ Libraries from Scaling Web

Scaling Web has a number of open source libraries that may be of use:

  • Template based B+ Tree: Implemented in C++, B+ Tree is template based, so it can be used with any types of data. Memory based B+ Tree is much faster than STL containers like map, hash_map.
  • Embedded File System: Embedded File System (EFS) is a library that allows you to create virtual file system in a single file.
  • Mork Parser in C++: MorkParser is an efficient C++ implementation of Mork database format reader. The Mork format is used in most Mozilla-based projects, including the Mozilla browser suite, SeaMonkey, Firefox and Thunderbird.
  • Mime Email Parser in C++: C++ implementation of RFC 2045 - Multipurpose Internet Mail Extensions (MIME) standard.
  • C++ IO Streams Library: IO Streams library provides different Java-like interface streams in C++.

[/Personal/SoftwareDevelopment/CPP] permanent link


Trading Site of the Day -- StreamBase: Event, Databases, and (unrelated) Charting

StreamBase has a developers kit for using their Event Stream Processor and database. They have an article on Using the StreamBase opentick Adapter to Build Market Data Applications. The database itself could be a useful alternative to SmartQuant's historical data tables, but the downside is that compression may not be available. I've only skimmed the site. I'm hoping the code behind the referenced article shows enough that I could re-code it for an IQFeed or Genesis data stream.

While on the topic of coding, some one pointed out ZedGraph as a possible alternative for showing charts. It is open source.

On the other hand, I've been leaning towards ChartDirector for C++ as it, as it says, has an API for C++, as well as a host of other languages.

[/Trading/SiteOfTheDay/D200710] permanent link


Trade Optimization by Genetic Programming, Example for QuantDeveloper

I had recieved a private message by someone requesting some background on what I had done for my Genetic Programming trials with QuantDeveloper.

I am releasing the example source code into the public domain. If you make changes and would like to see the changes recorded here, please let me know, and I'll update the files.

The subdirectory OneUnified.GeneticProgramming is the GP library. I used Koza (1992) as well as a few other related references as a guide for various constants and such. You'll need some of my other libraries (as listed elswhere on this site) in order to get the thing to compile.

The library provides population management, survival of the fittest, and various breeding cross-over strategies. Adding and removing operators should be relatively easy. I have a couple of base classes from which most are inherited: boolean and double. Note that, unlike C++ where one can use static methods to initialize some global class variables, C# insists on initializing static class variables upon first invocation, which is why you'll see ugly, redundant code for getting this done for the operator setups. Maybe there is a better way.

The subdirectory UI holds the setup code to run a simulation. When you look at the code, you'll see that there is no real easy way to embed an optimization module in QD, so I took source samples and patched together a self running optimizing application.

You'll be glad to note that doing something like this will be much more difficult, if not impossible in the future. QuantHouse, in their infinite wisdom, has decided that we add-on developers, who don't spend thousands of dollars each month on sub-millisecond data-feeds are a pain in the back side, and so will not be providing source code in the future. Or so they told me. I come from an open source community, and this closed source madness of QuantHouse has turned me off of QD. I've gone back to using C++ routines to take care of my trading chores.

While on the subject of C++, er, C#, I went back to C++ for several other reasons. There is a rich and varied source of high quality open source libraries for C++: Boost, QuantLib just to name two. C++ is faster. Also, I feel that C# is meant for lazy programmers who don't know how to clean up after themselves. There are C++ garbage collection libraries out there if I feel the need to use them. And did you know that Microsoft couldn't even bring themselves to use CLS in most of the their Windows development (most of the core CLS was removed from key kernel applications).

Anyway, here is my Trade Optimization by Genetic Programming, Example for QuantDeveloper.

[/Trading/SmartQuant/Articles] permanent link


2007 Oct 07 - Sun

IQFeed Source Code Release

I havn't had much time recently to keep my IQFeed libraries (for QuantHouse/SmartQuant's QuantDeveloper) updated, and I see there are a few users with some annoyances with the libraries. I've decided to empower them to solve the issues themselves.

I've released the code under GPL3 license terms. For those who wish to to use it commercially, they can contact me directly.

I'd been holding off releasing the code, hoping I could clean things up a bit more, but I better bite the bullet and just get the code out there. Perhaps Anton can create a sub-forum for supporting the library.

There are two libraries:

The projects are in Visual Studio 2005 SP1 format.

If you have corrections to the libraries, please email the changes to me, I'll update the code, and release an updated version.

All the code compiles. I've used it for my own market tests and evaluations. As such, it may be a little rough around the edges, but is usable. I never did get around to implementing the IHistory module. Instead, I bypassed that interface and wrote a mechanism to download histories for multiple symbols simultaneously. If you do implement an IHistory interface, let me know, I'll update the code and release it.

There are few libraries that use a SQL Database back end. the OneUnified.SmartQuant library has a SQL file for recreating the database (you'll need to do the permissions manually), and a .csv which will load the iqMessageFormat table with stuff that might be useful.

The reason for this is that I use Genesis Securities as my broker. They have a C++ trading library, which I've started to integrate... in a C++ environment. With Boost (which will have time series shortly), QuantLib, GSL, and a bunch of other libraries, I've found I can revert back to my favorite development environment for live market trading. QD will still remain as a solid simulation and testing environment for me (depending upon what favorable or unfavorable changes QuantHouse makes to release arrangements--they've indicated that source code rights will no longer exist--which will suck big time).

I'm rewriting and expanding the scalping example (from the application archive) in C++ to run properly with two trading accounts, and provide detail I couldn't do with the C# version.

If you have questions, let me know.

Happy Trading!

[/Trading/SmartQuant] permanent link


2007 Oct 06 - Sat

New Ideas -- For The Market Place, not the Existing Business Model

Dare Obasanjo wrote a nice blog entry summarizing some key ideas from Marc Andreessen and Clayton Christensen. In his entry entitled Stupid Things Big Companies Do, he had a great exerpt that confirmed that companies need to diversify their business models, offered up a key irony, and ended by providing a possible solution:

People come up with lots of new ideas, but nothing happens. They get very disillusioned. Never does an idea pop out of a person's head as a completely fleshed-out business plan. It has to go through a process that will get approved and funded. You're not two weeks into the process until you realize, "gosh, the sales force is not going to sell this thing," and you change the economics. Then two weeks later, marketing says they won't support it because it doesn't fit the brand, so we've got to change the whole concept.

All those forces act to make the idea conform to the company's existing business model, not to the marketplace. And that's the rub. So the senior managers today, thirsty for innovation, stand at the outlet of this pipe, see the dribbling out of me-too innovation after me-too innovation, and they scream up to the back end, "Hey, you guys, get more innovative! We need more and better innovative ideas!" But that's not the problem. The problem is this shaping process that conforms all these innovative ideas to the current business model of the company.

[/Personal/Business] permanent link


Web 2.0 Site Development with Wt -- Dead Easy

I've written an earlier article about installing the Wt C++ Web Toolkit. I think it took longer to get all the bits and pieces properly arranged than it did me to cook up an example to check that it did what I thought it could do.

I'm quote pleased and impressed with the tool. I was able to get a basic web application up and running in about two days, which were spent reading the documentation, reviewing the class libraries, looking at some of the samples, poking through the PostgreSQL C library, and then hacking stuff into the basic Wt 'Hello World' application.

The authors of Wt have done a great job of hiding all the Javascript go-between code. I can focus on the higher level parts of my design, rather than the underlying machinery to make an interface work. About the only thing I've encountered that I'd like to change is to take the inline Javascript code, and get it put into a .js file.

The test I came up with was to open up a database, select a bunch of records, and present the records in a table which could be stepped through (forwards and backwards) 10 records at a time... and all this without having to refresh the whole page, just the table itself. The following code proves it can be done.

It allows one to turn an internet browser into a true application front end with most of the usual gui functions provided.

This first file is ouipam.cpp, the file with the 'main' start for each session connection:

//============================================================================
// Name        : ouipam.cpp
// Author      : Ray Burkholder
// Version     :
// Copyright   : (c) 2007 One Unified
// Description : OUIPAM:  One Unified IP Address Management
//============================================================================

// server push uses WApplication enableUpdates(), triggerUpdate(), 
getUpdateLock();

#include "Responder.h"

using namespace Wt;

WApplication *createApplication(const WEnvironment& env) {

  // Instantiate the Wt application.
  Responder *appl = new Responder(env);
  return appl;
}

int main(int argc, char **argv) {
  return WRun(argc, argv, &createApplication);
}

This file is Responder.h, the header file for the responder, which handles the WApplication (or session):

//============================================================================
// Name        : ouipam.cpp
// Author      : Ray Burkholder
// Version     :
// Copyright   : (c) 2007 One Unified
// Description : OUIPAM:  One Unified IP Address Management
//============================================================================

#ifndef RESPONDER_H_
#define RESPONDER_H_

#include <WApplication>
#include <WContainerWidget>
#include <WText>
#include <WPushButton>
#include <WTable>
#include <WTableCell>

#include "libpq-fe.h"

using namespace Wt;

class Responder : public WApplication {
public:
  Responder(const WEnvironment& env);
  virtual ~Responder();
protected:
  WPushButton *button;
  WTable *table;
private:
  int cnt;
  PGconn *conn1;
  PGresult *result;
  int nRowsToShow;
  int cntRowsFound;
  int cntColumnsFound;
  int ixFirstRowShowing; // 0 offset
  void OnButtonListBegin();
  void OnButtonForeward();
  void OnButtonBackward();
  void OnButtonListEnd();
  void ShowRows();
};

#endif /*RESPONDER_H_*/

This final file is Responder.cpp, where all the session work is performed. The constructor opens the database, creates the webpage basics, and assigns events to each of the forward and backward buttons. When a button is pressed, the appropriate method is called to use the appropriate records and update the table. Again, with Javascript enabled, the web page is not refreshed. Instead, the browser's DOM is updated directly, and only the table cells change. I look foreward to seeing what else I can do with this flexibility. As you can see from the header comment, this is the start of an interactive web application for managing an organizations IP Addresses.

//============================================================================
// Name        : ouipam.cpp
// Author      : Ray Burkholder
// Version     :
// Copyright   : (c) 2007 One Unified
// Description : OUIPAM:  One Unified IP Address Management
//============================================================================

#include "Responder.h"
#include "WBreak"
#include <sstream>
#include <ostream>
#include <algorithm>

using namespace std;

Responder::Responder(const WEnvironment& env) :
  WApplication(env ) {

  // Set application title
  setTitle("OUIPAM by One Unified");

  ostringstream ss;

  // perform database query 

  conn1
      = PQconnectdb("hostaddr=127.0.0.1 port=5432 dbname=oneunified user=oneunified 
password=xxx");
  ConnStatusType stat = PQstatus(conn1 );
  if (CONNECTION_OK != stat) {
    //PQfinish(conn1);
    ss << "pq result= bad("<< stat << ")"<< endl;
    root()->addWidget(new WText(ss.str()));
  } else {
    result = PQexec(conn1, "select * from ianaiftype;");
    ExecStatusType statusExec = PQresultStatus(result );
    ss << "pgresult=";
    bool bTuplesFound = false;
    switch (statusExec ) {
      case PGRES_EMPTY_QUERY:
        ss << "empty query";
        break;
      case PGRES_COMMAND_OK:
        ss << "command ok";
        break;
      case PGRES_TUPLES_OK:
        ss << "tuples found";
        bTuplesFound = true;
        break;
      case PGRES_COPY_OUT:
        ss << "copy out";
        break;
      case PGRES_COPY_IN:
        ss << "copy in";
        break;
      case PGRES_BAD_RESPONSE:
        ss << "bad response";
        break;
      case PGRES_NONFATAL_ERROR:
        ss << "non fatal error";
        break;
      case PGRES_FATAL_ERROR:
        ss << "fatal error";
        break;
    }
    root()->addWidget(new WText(ss.str()));
    root()->addWidget(new WBreak());

    // present some query statistics

    if (bTuplesFound ) {
      cntRowsFound = PQntuples(result );
      cntColumnsFound = PQnfields(result );
      ss.str("");
      ss << "rows="<< cntRowsFound << ", columns="<< 
          cntColumnsFound << endl;
      root()->addWidget(new WText(ss.str()));
      root()->addWidget(new WBreak());
      for (int i = 0; i < cntColumnsFound; i++) {
        ss.str("");
        ss << PQfname(result, i )<< ", format="<< PQfformat(result, i )
            << ", type="<< PQftype(result, i )<< ", size="
            << PQfsize(result, i )<< endl;
        root()->addWidget(new WText(ss.str()));
        root()->addWidget(new WBreak());
      }

      // create table for row results

      table = new WTable();
      root()->addWidget(table);

      // assign methods to the buttons

      button = new WPushButton( L"<<" );
      root()->addWidget(button );
      button->clicked.connect(SLOT(this, Responder::OnButtonListBegin));

      button = new WPushButton( L"<" );
      root()->addWidget(button );
      button->clicked.connect(SLOT(this, Responder::OnButtonBackward));

      button = new WPushButton( L">" );
      root()->addWidget(button );
      button->clicked.connect(SLOT(this, Responder::OnButtonForeward));

      button = new WPushButton( L">>" );
      root()->addWidget(button );
      button->clicked.connect(SLOT(this, Responder::OnButtonListEnd));

      // show the query results

      nRowsToShow = 10;
      ixFirstRowShowing = 0;
      ShowRows();

    }
  }
}

Responder::~Responder() {
  PQclear(result ); // result exists even with new command, and even if connection is closed;
  PQfinish(conn1 );
}

void Responder::ShowRows() {
  // update rows in the already created table
  WTableCell *cell;
  WText *text;
  int ixRowToShow = ixFirstRowShowing;
  for (int ixTableRow = 0; ixTableRow < nRowsToShow; ixTableRow++) {
    for (int ixColumn = 0; ixColumn < cntColumnsFound; ixColumn++) {
      cell = table->elementAt(ixTableRow, ixColumn );
      cell->clear();
      if (ixRowToShow < cntRowsFound ) {
        text = new WText();
        text->setFormatting(WText::PlainFormatting );
        text->setText(PQgetvalue(result, ixRowToShow, ixColumn ) );
        cell->addWidget(text );
      } else {

      }
    }
    ixRowToShow++;
  }
}

void Responder::OnButtonListBegin() {
  ixFirstRowShowing = 0;
  ShowRows();
}

void Responder::OnButtonBackward() {
  ixFirstRowShowing = max( 0, ixFirstRowShowing - nRowsToShow );
  ShowRows();
}

void Responder::OnButtonForeward() {
  int i = max( 0, cntRowsFound - nRowsToShow );
  ixFirstRowShowing = min(i, ixFirstRowShowing + nRowsToShow );
  ShowRows();
}

void Responder::OnButtonListEnd() {
  ixFirstRowShowing = max( 0, cntRowsFound - nRowsToShow );
  ShowRows();
}

[/Personal/SoftwareDevelopment/CPP] permanent link


Flash File Systems for Embedded Systems, and Otherwise

On Kernel Trap, I see they are discussing the use and maintenance of flash file systems. It seems there are lots of interesting gotchas when using flash file systems intensively. I'm wondering if that might be why the Seagate 32G flash drive is taking a while to get going in the market place.

Anyway, for my own embedded thoughts, it is good to know flash file systems are making good headway into kernel integration.

[/OpenSource/Linux] permanent link


Open Source Site of the Day -- OSSWAD: Open Source Savvy Web Application Developer

An OSSWAD, almost sounds like a forbidden word. Based upon Bob Zurek's column, there are Osswads, and then there are OSSWADs. Many developers of web sites 'out there' already use Open Source tools to get the job done. Apache, MySQL, PostgreSQL, Perl, and PHP are commonly used tools by Osswads.

On the other hand, one gets the impression that real, enterprise savvy OSSWADs, use some real hard core tools like:

  • hadoop: large scale distributed compute clusters. Amazon has a developer resource center with a Hadoop/MapReduce Paper.
  • lucene: not just search software, but something that provides the basis for getting meaningfull context. There is an informative online book to go alone with it.
  • nutch: adds web specifics to lucene: web crawling, link-graphs, and parsers.

These Open Source projects fill in more of the gaps of the thinking I've been doing on providing some contextual search products in specific subject matter areas. It looks like I won't have to do as much ground up development as I thought I might need to do.

[/OpenSource/SiteOfTheDay/D200710] permanent link


libpqxx: A PosgreSQL C++ Wrapper Library

I've looked at the C library for PostgreSQL and then wanted to see if there were any C++ wrappers for it. The most current appears to be libpqxx. On first blush, it looks very good. It if functional and robust. But... it has one draw back. The library insists on converting all binary stuff into text for passing back to the caller. For some applications, that can be a reasonable library simplifier.

But in this day and age of Templates and polymorphism, it seems to be a copout. Yes, if I had time, I'd probably try my hand at implementing some sort of 'variant' implementation to handle the various types of data that come back.

Sigh. As much as I'd like to use the library, I really want my data in the native form in which I stored it. Perhaps once I've worked with the API, and I've worked my own working version of variants, maybe I'll be in a position to offer up some workable suggestions.

... several hours later ...

I now realize that the PostgreSQL API returns everything as strings. So now I understand the reasoning behind the library and what it returns.

To get binary values, from my understanding, one has to use the COPY routines and decipher the result streams directly. I would have hoped there was some middle ground, where the API will provide the binary values when needed. The API implies that it does, but in actual fact, didn't. I spent an hour or two figuring it out the hardway. I'm really going to have to figure out how gdb works so I can single step through stuff and analyze variables. As it was, I reverted back to the stone age and put in print statements to figure out what was happening.

Now I have a tri-choice:

  • Stick with the C API, which seems to have everything one needs, including access to true parameterized queries (I found out after the fact, that the Perl libraries actually do string concatenation, which creates a possibility for SQL Injection attacks).
  • Use the libpqxx library and convert stuff to binary when I need it. I must say working with everything as strings is a simplifying assumption, but doesn't do much for accuraccy and performance.
  • Start working on some sort of wrapper to examine the results of COPY commands, which is probably more work than I really want to do right now.

[/OpenSource/Programming] permanent link


2007 Oct 03 - Wed

Image Maps with CSS, Plus 20 CSS Tools, Plus other Free Tools

Marketing Technology Blog has a How To: Build An Image Map with CSS entry. Pretty simple and straightforward.

In CSS TOOLBOX: 20+ Tools For Working With CSS, there are links to a bunch of sites offering up quite a number of tips, tricks, and techniques for working with CSS.

This site isn't necessarily CSS, but I thought I'd include it here anyway. Emma Alvarez Blog has an entry called Top best 50 free tools for your website. She references:

  • Color Selectors
  • Logo Makers
  • Button Generators
  • Rounded Corner Generators
  • Background Makers
  • Custom Games for Blogs
  • Avatars
  • Free Scripts
  • Visitor Maps
  • Public Domain Photos
  • Free Fonts
  • Widgets
  • Statistics
  • Firefox Extensions
  • Inspiration
  • Optimization Tools
  • Image Tools

[/Personal/SoftwareDevelopment/HTML/css] permanent link


A Link to an Article regarding SQL Injection

Many web sites use a back end SQL engine for serving up data. Some Credit Card number thefts can be attributed to poor protection of web page interactions with a back end SQL server through injecting SQL statements into web requests.

A well written article called The Unexpected SQL Injection goes into detail on how SQL Injection happens, and how to prevent it.

Spend some time on the site. There are many other documents providing valuable information regarding the protection of internet based activity.

[/Personal/SoftwareDevelopment] permanent link


Free Tools: CD ISO Create and Burning, Notepad++

CDBurnerXP is a great tool for assembling ISO's and burning them to CD. It isn't bloated like other pay-for stuff out there. This is a good, streamlined, free tool to ... burn CDs and DVDs.

Notepad++ is a is a free source code editor (and Notepad replacement), which supports several programming languages, running under the MS Windows environment. It has a very large feature set, with some being cold-folding, syntax highlighting, and macro-recording. It is a valuable Windows Notepad replacement, and is as fast or faster, and absolutely better.

[/Personal/Technology] permanent link


GSL - GNU Scientific Library

I'm coming across all sorts of interesting things today. Another C++ library I've encountered is the GSL - GNU Scientific Library. From the web-site, it is:

a numerical library for C and C++ programmers. It is free software under the GNU General Public License.

The library provides a wide range of mathematical routines such as random number generators, special functions and least-squares fitting. There are over 1000 functions in total with an extensive test suite.

Some of the subject areas covered include:

Complex Numbers Roots of Polynomials Special Functions
Vectors and Matrices Permutations Sorting
BLAS Support Linear Algebra Eigensystems
Fast Fourier Transforms Quadrature Random Numbers
Quasi-Random Sequences Random Distributions Statistics
Histograms N-Tuples Monte Carlo Integration
Simulated Annealing Differential Equations Interpolation
Numerical Differentiation Chebyshev Approximation Series Acceleration
Discrete Hankel Transforms Root-Finding Minimization
Least-Squares Fitting Physical Constants IEEE Floating-Point
Discrete Wavelet Transforms

[/Personal/SoftwareDevelopment/CPP] permanent link


Cryptographic Library for C++

ergo offers up some explanation and examples of using the CryptoPP - The cryptographic library for C++. He also refers to something else that may be of interest, a SSL++: C++ Headers for OpenSSL. But I think most just compile and link directly with the headers from OpenSSL.

[/Personal/SoftwareDevelopment/CPP] permanent link


More Code Coloring Capability for HTML

Google Code Colorizer is one to add to the list.

[/Personal/SoftwareDevelopment/HTML] permanent link


Life, Judgement and Experience

The Tired Architect talks about second systems, and refers to one of my favorite books: The Mythical Man Month by Frederick Brooks.

Anyway, The Tired Architect has a good quote:

As they say, good judgement comes from experience, and experience from bad judgement. It makes you a better architect, like how pain makes you appreciate health better.

[/Personal/TagLines] permanent link


Debian Installation on a Dell Laptop

Here is a page discussing the Installation of Debian 3.1 on a Dell Laptop. There were some key commands I learned from that article:

  • lspci -v # to list adaptors on pci buss
  • dmesg # to show boot log
  • lsmod # to show installed kernel modules
  • fdisk -l # to show drive partitions

Even though it is an older site, it does have some useful tidbits of information.

Other pages on the site provide notes one wireless war driving and such, plus other stuff.

[/OpenSource/Debian/ArticleLinks] permanent link


Installing And Configuring Wt, a C++ Web Toolkit

I mentioned in another article about doing web page development with C++. I came across Wt: a C++ Web Toolkit. It has been a bear to configure with the ASIO library. I'll layout what I've done below. I'm stuck with an SSL initialization problem. I'm probably going to have to move to FastCGI to see how well that works.

Based upon the forums, there are supposed to be some Debian Packages already available to make this work. Packages seem to be a bit behind the latest versions of stuff, so in this case, I wanted to be able to have a build system where I could incorporate the latest of Boost (which is supposed to have time-series avaliable shortly), and with Wt (which has an active CVS feed).

Anyway, here is my installation process so far. There are a couple of Kludges due to platform differences (a prefix of lib is needed on some stuff, which I should do a SED with at some time) and I can't figure out how the header file include stuff works properly (in order to keep it in a separate directory).

I started by downloading asio-0.3.7.tar.gz from asio.sf.net and boost_1_34_1.tar.tz from www.boost.org, and expanding them out to their directories in /usr/src.

apt-get install gcc
apt-get install zlib1g
apt-get install zlib1g-dev
apt-get install libbz2-dev
apt-get install libgd-dev
apt-get install cmake
apt-get install libfcgi-dev
apt-get install libapache2-mod-fastcgi
apt-get install libssl-dev

cd /usr/src/boost_1_34_1
./configure --without-icu --without-libraries=python,wave,test --libdir=/usr/lib/boost_34_1
make install
ln -s /usr/lib/boost_1_34_1/ /usr/lib/boost
ln -s /usr/include/boost-1_34_1/boost /usr/include/boost

Before proceeding, a patch needs to be applied to one of the ASIO files:

@@ -45,13 +45,13 @@
       {
         ::SSL_library_init();
         ::SSL_load_error_strings();        
+        ::OpenSSL_add_ssl_algorithms();
 
         mutexes_.resize(::CRYPTO_num_locks());
         for (size_t i = 0; i < mutexes_.size(); ++i)
           mutexes_[i].reset(new asio::detail::mutex);
         ::CRYPTO_set_locking_callback(&do_init::openssl_locking_func);
 
-        ::OpenSSL_add_ssl_algorithms();
       }
     }

It basically moves the location of '::OpenSSL_add_ssl_algorithms();'. Without it, an error such as the following may occur during runtime:

__gnu_cxx::recursive_init'
  what():  N9__gnu_cxx14recursive_initE
Aborted

ASIO can then be built:

cd /usr/src/asio-0.3.7
./configure --with-boost=/usr/include/boost --libdir=/usr/lib/ --includedir=/usr/include/
make
make install

After that fixup, Wt can be built.

cd /usr/src
cvs -d:pserver:anonymous@witty.cvs.sourceforge.net:/cvsroot/witty login
cvs -z3 -d:pserver:anonymous@witty.cvs.sourceforge.net:/cvsroot/witty co -P wt
cd wt
nano src/CMakeLists.txt
# prefix boost file entries with lib to get libboost
cmake -D DEPLOYROOT=/var/www/wt -D WEBUSER=www-data -D WEBGROUP=www-data \
-D BOOST_DIR=/usr/include/boost/ \
-D BOOST_COMPILER=gcc41 \
-D BOOST_VERSION=1_34_1 \
-D BOOST_INCLUDE_DIR=/usr/include/boost \
-D BOOST_LIB_DIR=/usr/lib/boost/  \
-D BOOST_DT_LIB_MT=/usr/lib/boost \
-D BOOST_DT_LIB=/usr/lib/boost \
-D BOOST_FS_LIB=/usr/lib/boost \
-D BOOST_FS_LIB_MT=/usr/lib/boost \
-D BOOST_PO_LIB_MT=/usr/lib/boost \
-D BOOST_REGEX_LIB_MT=/usr/lib/boost \
-D BOOST_SIGNALS_LIB_MT=/usr/lib/boost \
-D BOOST_THREAD_LIB=/usr/lib/boost \
-D BOOST_ASIO_INCLUDE_DIR=/usr/include/asio/  \
-D CMAKE_INSTALL_PREFIX=/ \
-D LIB_INSTALL_DIR=/usr/lib/wt/  \
-D LIBRARY_OUTPUT_PATH=/usr/lib/wt \
-D SHARED_LIBS=ON \
-D CONNECTOR_FCGI=ON \
-D CONNECTOR_HTTP=OFF \
.
# FCGI ON for FastCGI (production), HTTP ON for ASIO library (development)

make

# on error:
nano src/Ext/cmake_install.cmake
#  comment out cmakefiles line
rm /include/Ext/CMakeFiles
mkdir /include/Ext/CMakeFiles
cp /usr/src/wt/src/Ext/CMakeFiles/* /include/Ext/CMakeFiles

make install
mkdir /usr/include/wt
mv  /include/* /usr/include/wt/
rmdir /include

nano /etc/ld.so.conf
#  put in:
#   /usr/lib/wt
#   /usr/lib/boost_1_34_1
# ldconfig needs to be run if the fcgi or http libraries get switched or added
ldconfig

Back in Eclipse, I created C++ ANSI project, and then placed the content from examples/hello/hello.cpp into the .cpp file of the new project. The directories '/usr/include/boost-1_34_1' and '/usr/include/wt' need to be entered as 'include' paths. For GCC C++ Linker, the following are -L library search paths:

  • /usr/lib/wt
  • /usr/lib/boost_1_34_1

The following are -l libraries:

  • boost_signals-gcc41-mt-d
  • boost_filesystem-gcc41-mt-d
  • boost_program_options-gcc41-mt-d
  • boost_thread-gcc41-mt-d
  • boost_regex-gcc41-mt-d
  • wt
  • wthttp or wtfcgi
  • wtext

So... with some recompiling, I was able to get the hello sample up and running with FastCGI and then with the ASIO library.

When using FCGI, I renamed the compiled file to hello.wt, and placed it into /var/www/wt/, added the line 'FastCgiServer /var/www/wt/hello.wt' into /etc/apache2/mods-enabled/fastcgi.conf, and restarted Apache. Then by browsing to localhost/wt/hello.wt, I was able to get the demonstration.

When using ASIO, set the folloing for run-time command-line arguments in Eclipse to successfully start the application: '--doc-root=/var/www/wt --http-address=0.0.0.0 --http-port=8080'. Browsing to localhost:8080 will get the web page.

[/OpenSource/Debian/Development] permanent link


KDE / X-Windows Screen Resolution Adjustment

I have a laptop that has 1920 x 1200 resolution on it. The default VESA drivers don't like that resolution. After finding out the type of video card, I was able to use the following command to update the card type and resolution:

dpkg-reconfigure -phigh xserver-xorg

I am now running at full resolution on the laptop.

[/OpenSource/Debian] permanent link


Installing Eclipse C++ Development Environment

The Eclipse C++ Development Environment is a Java based Integrated Development Environment (IDE). On Debian, it is a 'non-free' install. As such, the file /etc/apt/sources.list needs to have the word 'non-free' tacked on to the end of the deb and deb-src lines.

The command 'apt-get update' then needs to be run to update its lists.

The Java runtime environment can then be downloaded with 'apt-get install sun-java-jre'.

The downloaded Eclipse C++ Development Environment can be expanded. Within the expanded directory is a executable file called 'eclipse'. Start it and the environment is up and running. Dead easy.

[/OpenSource/Debian/Development] permanent link



New blog site at: Raymond Burkholder - What I Do

Blog Content ©2013
Ray Burkholder
All Rights Reserved
ray@oneunified.net
(519) 838-6013
(441) 705-7292
Available for Contract Work
Resume

RSS: Click to see the XML version of this web page.

twitter
View Ray 
Burkholder's profile on LinkedIn
technorati
Add to Technorati Favorites



October
Su Mo Tu We Th Fr Sa
 
     


Main Links:
Monitoring Server
SSH Tools
QuantDeveloper Code

Special Links:
Frink

Blog Links:
Quote Database
Nanex Research
Sergey Solyanik
Marc Andreessen
Micro Persuasion
... Reasonable ...
Chris Donnan
BeyondVC
lifehacker
Trader Mike
Ticker Sense
HeadRush
TraderFeed
Stock Bandit
The Daily WTF
Guy Kawaski
J. Brant Arseneau
Steve Pavlina
Matt Cutts
Kevin Scaldeferri
Joel On Software
Quant Recruiter
Blosxom User Group
Wesner Moise
Julian Dunn
Steve Yegge
Max Dama

2007
Months
Oct




Mason HQ

Disclaimer: This site may include market analysis. All ideas, opinions, and/or forecasts, expressed or implied herein, are for informational purposes only and should not be construed as a recommendation to invest, trade, and/or speculate in the markets. Any investments, trades, and/or speculations made in light of the ideas, opinions, and/or forecasts, expressed or implied herein, are committed at your own risk, financial or otherwise.