<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title>CppCMS Blog :: Framework</title>
	<link>http://art-blog.no-ip.info/cppcms/blog</link>
	<description>A blog on CppCMS - C++ Web Development Framework</description>
	<atom:link 
		href="http://art-blog.no-ip.info/cppcms/blog/rss" 
		rel="self" type="application/rss+xml" />
	
		
		<item>
			<title>CppCMS 1.x.x moves  to CMake</title>
			<link>http://art-blog.no-ip.info/cppcms/blog/post/51</link>
			<guid>http://art-blog.no-ip.info/cppcms/blog/post/51</guid>
			<description>
			&lt;div style=&quot;direction:ltr&quot;&gt;
			&lt;p&gt;No, I don&amp;rsquo;t think that CMake is better then autotools. In fact I still think that
CMake is total &quot;crap&quot;. It has terrible cache policy, it has broken &lt;code&gt;configuration_file&lt;/code&gt; support. It is crappy documentation and many broken configuration tools like CheckTypeSizeOf&amp;hellip; and much more.&lt;/p&gt;

&lt;p&gt;But it supports MSVC (that I may think supporting in future) and has a better Windows support&amp;hellip; So I announce that next version of CppCMS would use CMake (and it already uses in re-factoring branch).&lt;/p&gt;

&lt;p&gt;Autotools build system is no longer supported and will be removed from the CppCMS 1.x.x branch, because I do not really like supporting two build systems.&lt;/p&gt;

&lt;p&gt;I hope CppCMS users would understand this terrible move.&lt;/p&gt;

			&lt;p&gt;
			&lt;a href="/cppcms/blog/post/51"&gt;more...&lt;/a&gt;
			&lt;/p&gt;
			&lt;/div&gt;
			</description>
		</item>
		
		<item>
			<title>CppCMS meets Comet</title>
			<link>http://art-blog.no-ip.info/cppcms/blog/post/47</link>
			<guid>http://art-blog.no-ip.info/cppcms/blog/post/47</guid>
			<description>
			&lt;div style=&quot;direction:ltr&quot;&gt;
			&lt;p&gt;One of the major requirements for framework refactoring was support of &lt;a href=&quot;http://en.wikipedia.org/wiki/Comet_(programming)&quot;&gt;Comet&lt;/a&gt;. Now, with introduction of asynchronous request handling and persistent application servers it becomes reality.&lt;/p&gt;

&lt;h3&gt; Client Side&lt;/h3&gt;

&lt;p&gt;There is a HTML &lt;a href=&quot;http://cppcms.svn.sourceforge.net/viewvc/cppcms/framework/branches/refactoring/the_chat.html?revision=796&amp;amp;view=markup&quot;&gt;source&lt;/a&gt; of simple chat client, that uses &lt;a href=&quot;http://www.dojotoolkit.org/&quot;&gt;Dojo&lt;/a&gt; toolkit. It does following:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Submits new messages to the server application by posting form using XHR:&lt;/p&gt;

&lt;pre name=&quot;code&quot; class=&quot;cpp&quot; &gt;function send_data() {
        var kw = {
                url : &quot;/chat/post&quot;,
                form : &quot;theform&quot;
        };
        dojo.xhrPost(kw);
        dojo.byId(&quot;message&quot;).value=&quot;&quot;;
        return false;
}
&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Receives new messages from the server using long poll via XHR:&lt;/p&gt;

&lt;pre name=&quot;code&quot; class=&quot;cpp&quot; &gt;var message_count = 0;
function read_data() {
        dojo.xhrGet( {
                url: &quot;/chat/get/&quot; + message_count,
                timeout: 120000,
                handleAs: &quot;text&quot;,
                load: function(response, ioArgs) {
                        dojo.byId(&quot;messages&quot;).innerHTML =
                                response
                                + '&amp;lt;br/&amp;gt;'
                                + dojo.byId(&quot;messages&quot;).innerHTML;
                        message_count++;
                        read_data();
                        return response;
                },
                error: function(response,ioArgs) {
                        read_data();
                        return response;
                }

        });
}
dojo.addOnLoad(read_data);
&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;So, the client side is quite simple (however error handling should be quite better).&lt;/p&gt;

&lt;h3&gt; Server Side&lt;/h3&gt;

&lt;p&gt;First we create our long running asynchronous application, that receives two kinds
for requests: &quot;/post&quot; &amp;ndash; with new data, and &quot;/get/NN&quot; &amp;ndash; receive message nuber NN, we assign these calls to two member functions &lt;code&gt;post&lt;/code&gt; and &lt;code&gt;get&lt;/code&gt;.&lt;/p&gt;

&lt;pre name=&quot;code&quot; class=&quot;cpp&quot; &gt;class chat : public cppcms::application {
public:
    chat(cppcms::service &amp;amp;srv) : cppcms::application(srv)
    {
        dispatcher().assign(&quot;^/post$&quot;,&amp;amp;chat::post,this);
        dispatcher().assign(&quot;^/get/(\\d+)$&quot;,&amp;amp;chat::get,this,1);
    }
&lt;/pre&gt;

&lt;p&gt;Now, this class includes two data members:&lt;/p&gt;

&lt;pre name=&quot;code&quot; class=&quot;cpp&quot; &gt;private:
    std::vector&amp;lt;std::string&amp;gt; messages_;
    std::vector&amp;lt;cppcms::intrusive_ptr&amp;lt;cppcms::http::context&amp;gt; &amp;gt; waiters_;
&lt;/pre&gt;

&lt;p&gt;The history of all chat messages &amp;ndash; &lt;code&gt;messages_&lt;/code&gt; and all pending &lt;code&gt;get&lt;/code&gt; requests
that can&amp;rsquo;t be satisfied, because the message still not exists &amp;ndash; &lt;code&gt;waiters_&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Each, &quot;waiter&quot; is actually pointer to request/response context that can be
used for message transport.&lt;/p&gt;

&lt;p&gt;Now, when new message arrives, &lt;code&gt;post&lt;/code&gt; member function is called:&lt;/p&gt;

&lt;pre name=&quot;code&quot; class=&quot;cpp&quot; &gt;void post()
{
    if(request().request_method()==&quot;POST&quot;) {
        if(request().post().find(&quot;message&quot;)!=request().post().end()) {
            messages_.push_back(request().post().find(&quot;message&quot;)-&amp;gt;second);
            broadcast();
        }
    }
    release_context()-&amp;gt;async_complete_response();
}
&lt;/pre&gt;

&lt;p&gt;If the requested message was found, it is added to &lt;code&gt;messages_&lt;/code&gt; list and all waiters are notified using &lt;code&gt;broadcast()&lt;/code&gt; member function.&lt;/p&gt;

&lt;p&gt;At the end, the current request context is released and completed.&lt;/p&gt;

&lt;p&gt;The broadcasting is done as following:&lt;/p&gt;

&lt;pre name=&quot;code&quot; class=&quot;cpp&quot; &gt;void broadcast()
{
    for(unsigned i=0;i&amp;lt;waiters_.size();i++) {
        waiters_[i]-&amp;gt;response().set_plain_text_header();
        waiters_[i]-&amp;gt;response().out() &amp;lt;&amp;lt; messages_.back();
        waiters_[i]-&amp;gt;async_complete_response();
        waiters_[i]=0;
    }
    waiters_.clear();
}
&lt;/pre&gt;

&lt;p&gt;For each pending request the last message is written and the request closed.
After that, all pending request are cleaned.&lt;/p&gt;

&lt;p&gt;When &lt;code&gt;get&lt;/code&gt; request arrives, it is handled by &lt;code&gt;get(std::string no)&lt;/code&gt; member function, first of all
we check if requested message exists, if so we just return it to user.&lt;/p&gt;

&lt;pre name=&quot;code&quot; class=&quot;cpp&quot; &gt;unsigned pos=atoi(no.c_str());
if(pos &amp;lt; messages_.size()) {
    response().set_plain_text_header();
    response().out()&amp;lt;&amp;lt;messages_[pos];
    release_context()-&amp;gt;async_complete_response();
}
&lt;/pre&gt;

&lt;p&gt;Otherwise, if the requested message is the last one, that does not exists, we
add the request context to pending list &lt;code&gt;waiters&lt;/code&gt;&lt;/p&gt;

&lt;pre name=&quot;code&quot; class=&quot;cpp&quot; &gt;else if(pos == messages_.size()) {
    waiters_.push_back(release_context());
}
&lt;/pre&gt;

&lt;p&gt;If requested message it too late &amp;ndash; probably client error, we just set status
to &quot;404 Not Found&quot; and return the response.&lt;/p&gt;

&lt;pre name=&quot;code&quot; class=&quot;cpp&quot; &gt;else {
    response().status(404);
    release_context()-&amp;gt;async_complete_response();
}
&lt;/pre&gt;

&lt;p&gt;No, all we need to do is to add application to the main running loop under
script name &quot;/char&quot; and start the service.&lt;/p&gt;

&lt;pre name=&quot;code&quot; class=&quot;cpp&quot; &gt;cppcms::service service(argc,argv);
cppcms::intrusive_ptr&amp;lt;chat&amp;gt; app=new chat(service);
service.applications_pool().mount(app,&quot;/chat&quot;);
service.run();
&lt;/pre&gt;

&lt;h3&gt; Summary&lt;/h3&gt;

&lt;p&gt;So, the simple chat service was written with about 50 lines of C++ code and 
about same amount of JavaScript code.&lt;/p&gt;

&lt;p&gt;I must admit, that it is too simplistic and not efficient, for example: if new client connects it receives all messages one by one and not as bulk (can be easily fixed), I do not handle timeouts and disconnects. But the general idea is quite clear:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Asynchronous long running application that handles &lt;strong&gt;all&lt;/strong&gt; request is created.&lt;/li&gt;
&lt;li&gt;It manages all outstanding request and uses them for server side push.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;This is actually a base for future development of tools like XML-RPC and JSON-RPC that allow client to call asynchronously server side objects, it can be used for implementation of any other Comet protocols.&lt;/p&gt;

			&lt;p&gt;
			&lt;a href="/cppcms/blog/post/47"&gt;more...&lt;/a&gt;
			&lt;/p&gt;
			&lt;/div&gt;
			</description>
		</item>
		
		<item>
			<title>Progress Report on CppCMS v1</title>
			<link>http://art-blog.no-ip.info/cppcms/blog/post/46</link>
			<guid>http://art-blog.no-ip.info/cppcms/blog/post/46</guid>
			<description>
			&lt;div style=&quot;direction:ltr&quot;&gt;
			&lt;p&gt;Its quite long time that most of the work is done in new refactoring branch&amp;hellip; Meanwhile trunk stays silent. So, I decided to open a window and show some new changes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Dependencies:&lt;/p&gt;

&lt;p&gt;I had removed almost all dependencies with a big exception of Boost libraries.&lt;/p&gt;

&lt;p&gt;Because of internal structure changed &amp;mdash; mostly introduction of asynchronous event 
handling I could not use existing implementations of FastCGI because of its synchronous
API. Also I decided to remove CgiCC that was very problematic in terms of installation,
portability and most important the quality of implementation and ability to communicate
with its primary developer.&lt;/p&gt;

&lt;p&gt;So, at this point you only need latest boost library&amp;hellip; Thats all. When the job would
be complete it would be very easy to create deb/rpm packages for most popular
distributions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Server APIs:&lt;/p&gt;

&lt;p&gt;In addition to supported FastCGI and SCGI protocols, direct HTTP protocol is supported,
so you do not need to use external web server for debug purposes any more.
It is also useful for embedding web applications.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Localization is now fully integrated with C++ &lt;code&gt;std::locale&lt;/code&gt; and allows using correct 
facets for each supported language and translation&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Windows is now would be one of the officially supported platforms.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;There is still lot of work to make new version as useful as current CppCMS stable version:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Integrate all template system back.&lt;/li&gt;
&lt;li&gt;Integrate cache and sessions management back.&lt;/li&gt;
&lt;li&gt;Rewrite forms classes that currently work with CgiCC.&lt;/li&gt;
&lt;li&gt;Rewrite support of CGI API for embedded systems.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;But there are many good points that are already visible. &lt;/p&gt;

			&lt;p&gt;
			&lt;a href="/cppcms/blog/post/46"&gt;more...&lt;/a&gt;
			&lt;/p&gt;
			&lt;/div&gt;
			</description>
		</item>
		
		<item>
			<title>What's Next?</title>
			<link>http://art-blog.no-ip.info/cppcms/blog/post/44</link>
			<guid>http://art-blog.no-ip.info/cppcms/blog/post/44</guid>
			<description>
			&lt;div style=&quot;direction:ltr&quot;&gt;
			&lt;p&gt;The road map of the project includes two important milestones:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;CppCMS core components refactoring including following:

&lt;ul&gt;
&lt;li&gt; Removal of dependency on CgiCC &amp;ndash; today there is about 5% of CgiCC library
 is used, many features are not supported by it or are not supported well.
 For example: file upload handling in CgiCC is very primitive, limited
 and error prone, support of cookies buggy and so on.&lt;/li&gt;
&lt;li&gt;Using of Boost.Asio as internal event handler, because:

&lt;ol&gt;
&lt;li&gt;It provides transparent synchronous and asynchronous event handling
allowing future implementation of server push technologies.&lt;/li&gt;
&lt;li&gt;It provides efficient timer based event handling.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt; Removal dependency of libfcgi and writing Boost.Asio friendly
 implementation of FastCGI/SCGI connectors. Implementation of HTTP
 connectors as well.&lt;/li&gt;
&lt;li&gt; Support of plug-in applications in CppCMS framework.&lt;/li&gt;
&lt;li&gt; Improving compilation speed by representing more &lt;code&gt;pimpl&lt;/code&gt; idioms and
 removal of unnecessary classes.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Better support of i18n and and l10n:

&lt;ul&gt;
&lt;li&gt; Transparent support of &lt;code&gt;std::wstring&lt;/code&gt; with forms including automatic
 encoding testing and conversion.&lt;/li&gt;
&lt;li&gt; Support of &lt;code&gt;std::locale&lt;/code&gt; for localization for outputs like numbers,
 dates, monetary, translation and so on.&lt;/li&gt;
&lt;li&gt; Optional support of ICU and icu::UnicodeString and icu::Locale that
 would add unsupported features by &lt;code&gt;std::locale&lt;/code&gt; and allow replacement
 &lt;code&gt;std::locale&lt;/code&gt; features with more correct implementations provided
 by ICU.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;These changes will significantly break API backward compatibility, but it would
be possible to adopt the code almost &quot;mechanically&quot; to the new API.&lt;/p&gt;

			&lt;p&gt;
			&lt;a href="/cppcms/blog/post/44"&gt;more...&lt;/a&gt;
			&lt;/p&gt;
			&lt;/div&gt;
			</description>
		</item>
		
		<item>
			<title>Unicode in 2009? Why is it so hard?</title>
			<link>http://art-blog.no-ip.info/cppcms/blog/post/43</link>
			<guid>http://art-blog.no-ip.info/cppcms/blog/post/43</guid>
			<description>
			&lt;div style=&quot;direction:ltr&quot;&gt;
			&lt;p&gt;From my point of view, one of the most missing features in C++ is the lack of good Unicode support. C++ provides some support via std::wstring and std::locale, but it is quite limited for real live purposes.&lt;/p&gt;

&lt;p&gt;This definitely makes the life of C++ (Web) Developers harder.&lt;/p&gt;

&lt;p&gt;However there are several tools and toolkits that provide such support. I had checked 6 of them: ICU library with bindings to C++, Java and Python, Qt3 and Qt4, glib/pango and native support of Java/JDK, C++ and Python.&lt;/p&gt;

&lt;p&gt;I did little bit challenging test for correctness:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To Upper: Is German ß converted to SS?&lt;/li&gt;
&lt;li&gt;To Lower: Is Greek Σ  converted to σ in the middle of the word and to ς at its end?&lt;/li&gt;
&lt;li&gt;Word Boundaries: Are Chinese 中文 actually two words?&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Basic features like encoding conversions and simple case conversion like &quot;Артём&quot; (my name in Russian) to &quot;АРТЁМ&quot; worked well in all tools. But more complicated test results were quite bad:&lt;/p&gt;

&lt;h2&gt; Results&lt;/h2&gt;

&lt;table&gt;
&lt;tr&gt;&lt;th&gt;Tookit&lt;/th&gt;&lt;th&gt;To Upper Case&lt;/th&gt;&lt;th&gt;To Lower Case&lt;/th&gt;&lt;th&gt;Word Boundaries&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;C++&lt;/td&gt;&lt;td&gt;Fail&lt;/td&gt;&lt;td&gt;Fail&lt;/td&gt;&lt;td&gt;No Support&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;C++/ICU‎&lt;/td&gt;&lt;td&gt;Ok&lt;/td&gt;&lt;td&gt;Ok&lt;/td&gt;&lt;td&gt;Ok&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;C++/Qt4‎&lt;/td&gt;&lt;td&gt;Ok&lt;/td&gt;&lt;td&gt;Fail&lt;/td&gt;&lt;td&gt;Ok&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;C++/Qt3‎&lt;/td&gt;&lt;td&gt;Fail&lt;/td&gt;&lt;td&gt;Fail&lt;/td&gt;&lt;td&gt;No Support&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;C/glib+pango&lt;/td&gt;&lt;td&gt;Ok&lt;/td&gt;&lt;td&gt;Ok&lt;/td&gt;&lt;td&gt;Fail&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Java/JDK&lt;/td&gt;&lt;td&gt;Ok&lt;/td&gt;&lt;td&gt;Ok&lt;/td&gt;&lt;td&gt;Fail&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Java/ICU4j&lt;/td&gt;&lt;td&gt;Ok&lt;/td&gt;&lt;td&gt;Ok&lt;/td&gt;&lt;td&gt;Ok&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Python&lt;/td&gt;&lt;td&gt;Fail&lt;/td&gt;&lt;td&gt;Fail&lt;/td&gt;&lt;td&gt;No Support&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Python/PyICU‎&lt;/td&gt;&lt;td&gt;Ok&lt;/td&gt;&lt;td&gt;Ok&lt;/td&gt;&lt;td&gt;Ok&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;


&lt;h2&gt; Description&lt;/h2&gt;

&lt;p&gt;ICU: Provides great support but&amp;hellip; it has very unfriendly and old API in terms of C++ development. The documentation is really &lt;strong&gt;bad&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Qt4: Gives good results and friendly API, has great documentation, but as we can see, some tests are failed. Generally, useful in web projects.&lt;/p&gt;

&lt;p&gt;Qt3: Provides very basic Unicode support, no reason to use any more, especially when Qt4.5 is released under LGPL.&lt;/p&gt;

&lt;p&gt;C++/STL: Even basic support exists, the API is not too friendly to STL containers and requires explicit usage of &lt;code&gt;char *&lt;/code&gt; or &lt;code&gt;wchar_t *&lt;/code&gt; and manual buffers allocation.&lt;/p&gt;

&lt;p&gt;Glib: Gives quite good basic functionality. But finding word boundaries with Pango is really painful and does not work with Chinese. It has very nice C API and quite well documented. It uses internally utf-8 which makes the life easier when working with C strings. It still requires wrapping its functionality with C++ classes or grabbing huge GtkMM.&lt;/p&gt;

&lt;p&gt;Python: has very basic native Unicode support. PyICU has terrible documentation.&lt;/p&gt;

&lt;p&gt;Java: JDK provides quite good Unicode support, it can be quite easily replaced by ICU4J (actually most of JDK is based on ICU).&lt;/p&gt;

&lt;h2&gt; Summary&lt;/h2&gt;

&lt;p&gt;It is a shame that in 2009 there is no high quality, well documented, C++ friendly toolkit to work with Unicode.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For real purposes I would take QtCode part of Qt4 or wrap ICU library with friendly API.&lt;/li&gt;
&lt;li&gt;Glib is good as well and, what is very important is its high availability on most UNIX systems.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;When there will be Boost.ICU or Boost.Unicode just like there is Boost.Math or Boost.Asio? &lt;/p&gt;

			&lt;p&gt;
			&lt;a href="/cppcms/blog/post/43"&gt;more...&lt;/a&gt;
			&lt;/p&gt;
			&lt;/div&gt;
			</description>
		</item>
		
		<item>
			<title>CppCMS 0.0.4 Released</title>
			<link>http://art-blog.no-ip.info/cppcms/blog/post/41</link>
			<guid>http://art-blog.no-ip.info/cppcms/blog/post/41</guid>
			<description>
			&lt;div style=&quot;direction:ltr&quot;&gt;
			&lt;p&gt;Version 0.0.4 of CppCMS had released.&lt;/p&gt;

&lt;p&gt;It includes optimizations required for using it in embedded systems.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Normal Embedded Build:&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Caching is completely removed. Small memory footprint
is very important for embedded system thus, caching
stuff in memory is quite useless.&lt;/li&gt;
&lt;li&gt;Zlib compression are removed &amp;ndash; it removes dependency on
boost::iostreams, zlib and bzip2 libraries.&lt;/li&gt;
&lt;li&gt;Removed mod-prefork.&lt;/li&gt;
&lt;li&gt;Removed dynamic templates loading &amp;mdash; this feature requires export of
symbols to binary and increases its size in order to make RTTI work.
 Thus, all templates should be statically compiled into the binary.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;em&gt;Embedded CGI Mode:&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;FastCGI and SCGI APIs are removed&lt;/li&gt;
&lt;li&gt;Mod-thread and mod process are removed including
all thread pool facilities&lt;/li&gt;
&lt;li&gt;Changes in files based session backend to work
properly with CGI mode including garbage collection
(sessions that had time-out).&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Downloads are avialable from Sf Project Page.&lt;/p&gt;

			&lt;p&gt;
			&lt;a href="/cppcms/blog/post/41"&gt;more...&lt;/a&gt;
			&lt;/p&gt;
			&lt;/div&gt;
			</description>
		</item>
		
		<item>
			<title>CppCMS Going Embedded... or I need your help!</title>
			<link>http://art-blog.no-ip.info/cppcms/blog/post/40</link>
			<guid>http://art-blog.no-ip.info/cppcms/blog/post/40</guid>
			<description>
			&lt;div style=&quot;direction:ltr&quot;&gt;
			&lt;p&gt;Recently I start understanding that &lt;a href=&quot;http://stackoverflow.com/questions/480233&quot;&gt;embedded market&lt;/a&gt; may be very important market for CppCMS. So I did several tweaks to the code in order to support embedded systems:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;When the library is compiled for embedded system, caching system is totally removed, removed dependency on boost::iostreams and compression library.&lt;/li&gt;
&lt;li&gt;Mod-prefork is removed as much more memory consuming.&lt;/li&gt;
&lt;li&gt;Removed dynamic loading of templates.&lt;/li&gt;
&lt;li&gt;Option for cgi-only library given &amp;mdash; no scgi and and fastcgi APIs are compiled in, all remaining worker &quot;mods&quot; are removed.&lt;/li&gt;
&lt;li&gt;Session storage backend is simplified and optimized for cgi when it is compiled in embedded mode.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Everything was cross compiled for arm and tested with &lt;code&gt;qemu-arm&lt;/code&gt;, but unfortunately I do not have an access to real ARM hardware with installed Linux system, so&amp;hellip;&lt;/p&gt;

&lt;h3&gt; I need your help:&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Download following &lt;a href=&quot;http://art-blog.no-ip.info/files/test_arm_embed.tar.gz&quot;&gt;test_arm_embed.tar.gz&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Copy it to your ARM system and extract files.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Try to run cgi script from command line:&lt;/p&gt;

&lt;pre name=&quot;code&quot; class=&quot;cpp&quot; &gt;./hello.dynamic -c config.txt
&lt;/pre&gt;

&lt;p&gt;This is &quot;Hello World&quot; that is dynamically linked with libstdc++. If it does not work try&lt;/p&gt;

&lt;pre name=&quot;code&quot; class=&quot;cpp&quot; &gt;./hello.static -c config.txt
&lt;/pre&gt;

&lt;p&gt;This is full statically compiled version of &quot;Hello World&quot; cgi script.&lt;/p&gt;

&lt;p&gt;You should get as output CGI headers and HTML output.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Please, try to run it several times with:&lt;/p&gt;

&lt;pre name=&quot;code&quot; class=&quot;cpp&quot; &gt;time ./hello.dynamic -c config.txt
&lt;/pre&gt;

And tell the average run time.&lt;/li&gt;
&lt;li&gt;If you have a web server in your system I'd be very glad if you could test
cgi script &amp;ndash; please edit it &amp;mdash; &lt;code&gt;test.cgi&lt;/code&gt; to reflect correct executable and path.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;I all works fine I'd be glad (if it is possible) to prepare a set of scripts that would
test various aspects of cppcms as templates, various session backends and so on.&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;

			&lt;p&gt;
			&lt;a href="/cppcms/blog/post/40"&gt;more...&lt;/a&gt;
			&lt;/p&gt;
			&lt;/div&gt;
			</description>
		</item>
		
		<item>
			<title>CppCMS on OpenSolaris...</title>
			<link>http://art-blog.no-ip.info/cppcms/blog/post/34</link>
			<guid>http://art-blog.no-ip.info/cppcms/blog/post/34</guid>
			<description>
			&lt;div style=&quot;direction:ltr&quot;&gt;
			&lt;p&gt;After long fight between Me, Virtual Box and OpenSolaris I was finally be able to
build CppCMS under OpenSolaris.&lt;/p&gt;

&lt;h3&gt; Fighting with OpenSolaris&lt;/h3&gt;

&lt;p&gt;After I installed OpenSolaris first time, network wasn&amp;rsquo;t recognized, I started to tinker with its interfaces and drivers, and looks like I had ruined something.&lt;/p&gt;

&lt;p&gt;At some point I had figured out that I should reboot OS twice in order to make network work.
Indeed, it worked, but&amp;hellip; after next reboot it stopped. After long period of fighting and googling, I decided to reinstall it.&lt;/p&gt;

&lt;p&gt;The next step was even bigger nightmare. I decided to install both Sun Studio and GNU Build system&amp;hellip; Total download of 700Mb from &lt;strong&gt;very&lt;/strong&gt; slow OS mirrors.&lt;/p&gt;

&lt;p&gt;I let the installation to run at night and at the morning I had found that VirtualBox had crashed my computer&amp;hellip; Arrggggggg.&lt;/p&gt;

&lt;p&gt;At next step I installed &lt;strong&gt;only&lt;/strong&gt; gnu tool chain, meaning I'll continue to work with GCC and I will not test Sun Studio C++ compiler (anyway most Solaris developers work with gcc). It was done little bit faster.&lt;/p&gt;

&lt;p&gt;The next step was building Boost. Unfortunately, OS do not provide package for it. It was very strange, because it comes at core part of &lt;strong&gt;any&lt;/strong&gt; Linux distribution and it is even a part of Cygwin.&lt;/p&gt;

&lt;p&gt;So I had taken Boost 1.36 and started build. The build had took forever &amp;ndash; and at the end I had found that only headers where installed!
Then I figured out how to build libraries I need. However, there was some build error for shared libraries and I got static libraries only&amp;hellip;&lt;/p&gt;

&lt;p&gt;After some googling, I had found a patch for boost-jam that fixes linking issues for 1.36 under Solaris. But the patch was unreadable. So at this point I gave up. Static libraries for testing are good enough. &lt;/p&gt;

&lt;p&gt;Then I installed most important dependencies: CgiCC, FastCGI. I had build and installed Lighttpd. These steps were very simple and straightforward (Ok&amp;hellip; Who still thinks that autotools are bad?)&lt;/p&gt;

&lt;p&gt;At the end I checked out latest development version and tried to run &lt;code&gt;autogen.sh&lt;/code&gt;. I had figured out that there is no default &quot;automake&quot; and &quot;aclocal&quot;. You should specify exact version: &lt;code&gt;automake-1.9&lt;/code&gt; (Have they hear about alternatives?) I did a little fix and configured the system.&lt;/p&gt;

&lt;h3&gt; Fixing the code&lt;/h3&gt;

&lt;p&gt;There where 3 build problems:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;For some reason gcc didn&amp;rsquo;t like &lt;code&gt;map&amp;lt;&amp;gt;&lt;/code&gt; in two headers in code, even with &lt;code&gt;using namespace std&lt;/code&gt;. So I need to add &lt;code&gt;std::map&lt;/code&gt; explicitly &amp;mdash; I still have no idea why.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I had found a little bug I made it TCP server. I test CppCMS mostly with Boost 1.33.1 and external Asio library.&lt;/p&gt;

&lt;p&gt;Starting from Boost 1.35 Asio is part of it, however in different namespace and with several other little differences. So I had a little bug in using Boost.Asio instead of plain Asio. (Not connected to OpenSolaris at all).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;The only real platform specific problem was missing &lt;code&gt;-lsocket&lt;/code&gt; and &lt;code&gt;-lnsl&lt;/code&gt; libraries. These were easily fixed with 2 lines in &lt;code&gt;confiugre.in&lt;/code&gt; script.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Finally I was able to run my simple hello world programs and see that CppCMS becomes truly cross platform &amp;mdash; in addition to Linux and Cygwin, OpenSolaris should be supported as well.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I wonder: &quot;How much time would it take to build CppCMS under FreeBSD?&quot;&lt;/em&gt;&lt;/p&gt;

			&lt;p&gt;
			&lt;a href="/cppcms/blog/post/34"&gt;more...&lt;/a&gt;
			&lt;/p&gt;
			&lt;/div&gt;
			</description>
		</item>
		
		<item>
			<title>CppCMS Wiki In the WWW</title>
			<link>http://art-blog.no-ip.info/cppcms/blog/post/31</link>
			<guid>http://art-blog.no-ip.info/cppcms/blog/post/31</guid>
			<description>
			&lt;div style=&quot;direction:ltr&quot;&gt;
			&lt;p&gt;From this point, all project documentation will be available in the &lt;a href=&quot;http://art-blog.no-ip.info/wikipp/en/page/main&quot;&gt;CppCMS Wiki&lt;/a&gt;. There still not much documentation there, however, slowly all the framework will be documented.&lt;/p&gt;

&lt;p&gt;The wiki itself has multilingual support. Thus if someone wants to translate the documentation to his language, drop me a mail and I'll open and additional language category. Meanwhile, there are two languages: English and Hebrew.&lt;/p&gt;

			&lt;p&gt;
			&lt;a href="/cppcms/blog/post/31"&gt;more...&lt;/a&gt;
			&lt;/p&gt;
			&lt;/div&gt;
			</description>
		</item>
		
		<item>
			<title>Thoughts about template system</title>
			<link>http://art-blog.no-ip.info/cppcms/blog/post/26</link>
			<guid>http://art-blog.no-ip.info/cppcms/blog/post/26</guid>
			<description>
			&lt;div style=&quot;direction:ltr&quot;&gt;
			&lt;p&gt;After looking how ASP.Net and J2EE work I thought a lot about current template
system.&lt;/p&gt;

&lt;p&gt;Today, CppCMS template system is dynamic typed. For example in order to render
template:&lt;/p&gt;

&lt;pre name=&quot;code&quot; class=&quot;cpp&quot; &gt;&amp;lt;% template mycontent %&amp;gt;
&amp;lt;p&amp;gt;You have &amp;lt;% number %&amp;gt; of &amp;lt;% something %&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;% end %&amp;gt;
&lt;/pre&gt;

&lt;p&gt;I write something like that (not correct code but idea):&lt;/p&gt;

&lt;pre name=&quot;code&quot; class=&quot;cpp&quot; &gt;map&amp;lt;boost::any&amp;gt; content;

content[&quot;something&quot;]=string(&quot;orange&quot;);‎
content[&quot;number&quot;]=10;

template.render(content,output); 
&lt;/pre&gt;

&lt;p&gt;The template is compiled to bytecode and than interpreted in rendering engine.
If variable &lt;code&gt;title&lt;/code&gt; required it checks its type and renders its content.&lt;/p&gt;

&lt;p&gt;Another possible approach it to make is statically typed :&lt;/p&gt;

&lt;p&gt;So, I create a view interface for template:&lt;/p&gt;

&lt;pre name=&quot;code&quot; class=&quot;cpp&quot; &gt;struct mycontent: public content {
  string something;
  int number;
};
&lt;/pre&gt;

&lt;p&gt;And then the above template is compiled to following C++ code:&lt;/p&gt;

&lt;pre name=&quot;code&quot; class=&quot;cpp&quot; &gt;void mycontent::render()
{
  cout&amp;lt;&amp;lt;&quot;&amp;lt;p&amp;gt;You have &quot;&amp;lt;&amp;lt;number&amp;lt;&amp;lt;&quot; of &quot;&amp;lt;&amp;lt;escape(something)&amp;lt;&amp;lt;&quot;&amp;lt;/p&amp;gt;\n&quot;;
} 
&lt;/pre&gt;

&lt;p&gt;That is compiled to shared object that I can load dynamically. And render
template as following:&lt;/p&gt;

&lt;pre name=&quot;code&quot; class=&quot;cpp&quot; &gt;auto_ptr&amp;lt;my_content&amp;gt; content(template.get(&quot;my_content&quot;));
content-&amp;gt;number=10;
content-&amp;gt;something=&quot;orange&quot;;

content-&amp;gt;render(output); 
&lt;/pre&gt;

			&lt;p&gt;
			&lt;a href="/cppcms/blog/post/26"&gt;more...&lt;/a&gt;
			&lt;/p&gt;
			&lt;/div&gt;
			</description>
		</item>
		
	
</channel>
</rss>
