cppcms-users Mailing List for CppCMS C++ Web Framework (Page 96)
Brought to you by:
artyom-beilis
You can subscribe to this list here.
2009 |
Jan
|
Feb
(22) |
Mar
|
Apr
(3) |
May
|
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
(15) |
Nov
(16) |
Dec
(13) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2010 |
Jan
(4) |
Feb
|
Mar
(8) |
Apr
(8) |
May
(8) |
Jun
(36) |
Jul
(63) |
Aug
(126) |
Sep
(47) |
Oct
(66) |
Nov
(46) |
Dec
(42) |
2011 |
Jan
(87) |
Feb
(24) |
Mar
(54) |
Apr
(21) |
May
(22) |
Jun
(18) |
Jul
(22) |
Aug
(101) |
Sep
(57) |
Oct
(33) |
Nov
(34) |
Dec
(66) |
2012 |
Jan
(64) |
Feb
(76) |
Mar
(73) |
Apr
(105) |
May
(93) |
Jun
(83) |
Jul
(84) |
Aug
(88) |
Sep
(57) |
Oct
(59) |
Nov
(35) |
Dec
(49) |
2013 |
Jan
(67) |
Feb
(17) |
Mar
(49) |
Apr
(64) |
May
(87) |
Jun
(64) |
Jul
(93) |
Aug
(23) |
Sep
(15) |
Oct
(16) |
Nov
(62) |
Dec
(73) |
2014 |
Jan
(5) |
Feb
(23) |
Mar
(21) |
Apr
(11) |
May
(1) |
Jun
(19) |
Jul
(27) |
Aug
(16) |
Sep
(5) |
Oct
(37) |
Nov
(12) |
Dec
(9) |
2015 |
Jan
(7) |
Feb
(7) |
Mar
(44) |
Apr
(28) |
May
(5) |
Jun
(12) |
Jul
(8) |
Aug
|
Sep
(39) |
Oct
(34) |
Nov
(30) |
Dec
(34) |
2016 |
Jan
(66) |
Feb
(23) |
Mar
(33) |
Apr
(15) |
May
(11) |
Jun
(15) |
Jul
(26) |
Aug
(4) |
Sep
(1) |
Oct
(30) |
Nov
(10) |
Dec
|
2017 |
Jan
(52) |
Feb
(9) |
Mar
(24) |
Apr
(16) |
May
(9) |
Jun
(12) |
Jul
(33) |
Aug
(8) |
Sep
|
Oct
(1) |
Nov
(2) |
Dec
(6) |
2018 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
(14) |
Jun
(1) |
Jul
(9) |
Aug
(1) |
Sep
(13) |
Oct
(8) |
Nov
(2) |
Dec
(2) |
2019 |
Jan
(1) |
Feb
(1) |
Mar
(3) |
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
2020 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(9) |
Jul
(6) |
Aug
(25) |
Sep
(10) |
Oct
(10) |
Nov
(6) |
Dec
|
2021 |
Jan
|
Feb
|
Mar
(7) |
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
(9) |
Oct
(1) |
Nov
|
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Artyom B. <art...@ya...> - 2012-02-19 14:17:47
|
Hello, - Do you accidentally have any processes listening on port 8080 or 8081? - Do you use any non-standard compilation flags? Can you give me an output of the Testing log (you can find it under Testing subdirectory. If it still gets stuck, can you please run the test from command line as strace -f ./forwarder_test -c ../tests/forwarder_test.js --test-exec=../tests/forwarder_test.py --test-internal=true And give me an output of it. Thanks, Artyom Beilis >________________________________ > From: 陈抒 <csf...@gm...> >To: Artyom Beilis <art...@ya...>; cpp...@li... >Sent: Sunday, February 19, 2012 4:00 PM >Subject: Re: [Cppcms-users] CppCMS 0.999.1 - RC2 - and (hopefuly) last RC was released > > > > >No response when testing 19th case on Ubuntu 10.04(amd64) server. >It works on UBuntu 11.10(amd64) Desktop. >Why? > > > > > Start 19: internal_forwarder_test > >陈抒 >Best regards >http://blog.csdn.net/sheismylife > > > >On Sat, Feb 18, 2012 at 5:26 AM, Artyom Beilis <art...@ya...> wrote: > >All CppCMS 1.0.0 milestone tasks had completed and thus >>the second release candidate was released. It contains mostly bug fixes including >>several security bug fixes. It is expected to be the last RC before the stable version would be delivered. >> >>All CppCMS users please download the RC2 and test it. If no critical problems would >>be found the stable version would be announced in a week or two. >> >> >> >>Full Release notes can be found there: >> >> >> >>http://blog.cppcms.com/post/100 >> >> >>Artyom Beilis >>------------- >> >>Support CppCMS by donating money: >>https://sourceforge.net/donate/index.php?group_id=209965 >>------------------------------------------------------------------------------ >>Virtualization & Cloud Management Using Capacity Planning >>Cloud computing makes use of virtualization - but cloud computing >>also focuses on allowing computing to be delivered as a service. >>http://www.accelacomm.com/jaw/sfnl/114/51521223/ >>_______________________________________________ >>Cppcms-users mailing list >>Cpp...@li... >>https://lists.sourceforge.net/lists/listinfo/cppcms-users >> >> > >------------------------------------------------------------------------------ >Virtualization & Cloud Management Using Capacity Planning >Cloud computing makes use of virtualization - but cloud computing >also focuses on allowing computing to be delivered as a service. >http://www.accelacomm.com/jaw/sfnl/114/51521223/ >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |
From: 陈抒 <csf...@gm...> - 2012-02-19 14:01:08
|
No response when testing 19th case on Ubuntu 10.04(amd64) server. It works on UBuntu 11.10(amd64) Desktop. Why? * Start 19: internal_forwarder_test* 陈抒 Best regards http://blog.csdn.net/sheismylife On Sat, Feb 18, 2012 at 5:26 AM, Artyom Beilis <art...@ya...> wrote: > All CppCMS 1.0.0 milestone tasks had completed and thus > the second release candidate was released. It contains mostly bug fixes > including > several security bug fixes. It is expected to be the last RC before the > stable version would be delivered. > > All CppCMS users please download the RC2 and test it. If no critical > problems would > be found the stable version would be announced in a week or two. > > Full Release notes can be found there: > > http://blog.cppcms.com/post/100 > > > Artyom Beilis > ------------- > > Support CppCMS by donating money: > https://sourceforge.net/donate/index.php?group_id=209965 > > > ------------------------------------------------------------------------------ > Virtualization & Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > |
From: Artyom B. <art...@ya...> - 2012-02-19 12:21:13
|
To be honest, I'm not familiar with creating source RPM + RPM enough. I have just learned how to create debian packages thanks to the fact that debhelper made it very-very easy, but for RPM based distributions - I just don't use them (I have Debian and Ubuntu) Another thing is that I could use debootstrap to "install" chrooted versions of different distributions easily. I'm not aware of a simple way to create "rpm-bootstrapped" RH distributions like Fedora, CentOS or Suse. So if somebody would contribute the proper setup for SRPM I'd give it a try, but still I have no idea how to automate RPM generation process. For debs it was relatively easy - a single script and simple chroot per distro/atchitecture, but I don't see myself setup VM for {Fedora, Suse, CentOS} x {x86,x86_64}x{Several Versions} Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: sergey lavrov <ccp...@gm...> >To: Artyom Beilis <art...@ya...>; cpp...@li... >Sent: Sunday, February 19, 2012 2:01 PM >Subject: Re: [Cppcms-users] Apt-Repositories for CppCMS > > >Hello Artyom! > >Can I request for rhel (rhel, centos, sl) yum repository? > > >On Sat, Feb 18, 2012 at 9:39 PM, Artyom Beilis <art...@ya...> wrote: > > >> >>Hello All, >> >> >>There are APT repositories for the project: >> >>Read: http://cppcms.com/wikipp/en/page/apt >> >>Artyom Beilis >>------------- >> >>Support CppCMS by donating money: >>https://sourceforge.net/donate/index.php?group_id=209965 >> >> >>------------------------------------------------------------------------------ >>Virtualization & Cloud Management Using Capacity Planning >>Cloud computing makes use of virtualization - but cloud computing >>also focuses on allowing computing to be delivered as a service. >>http://www.accelacomm.com/jaw/sfnl/114/51521223/ >>_______________________________________________ >>Cppcms-users mailing list >>Cpp...@li... >>https://lists.sourceforge.net/lists/listinfo/cppcms-users >> > > > |
From: Marcel H. <ke...@co...> - 2012-02-19 12:10:48
|
may you do it on your own? Not that hard :D http://fedoraproject.org/wiki/How_to_create_an_RPM_package Am 19.02.2012 13:01, schrieb sergey lavrov: > Hello Artyom! > > Can I request for rhel (rhel, centos, sl) yum repository? > > On Sat, Feb 18, 2012 at 9:39 PM, Artyom Beilis <art...@ya... > <mailto:art...@ya...>> wrote: > > > > Hello All, > > > There are APT repositories for the project: > > Read: http://cppcms.com/wikipp/en/page/apt > > Artyom Beilis > ------------- > > Support CppCMS by donating money: > https://sourceforge.net/donate/index.php?group_id=209965 > > > ------------------------------------------------------------------------------ > Virtualization & Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > <mailto:Cpp...@li...> > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > > > ------------------------------------------------------------------------------ > Virtualization& Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > > > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users |
From: sergey l. <ccp...@gm...> - 2012-02-19 12:01:48
|
Hello Artyom! Can I request for rhel (rhel, centos, sl) yum repository? On Sat, Feb 18, 2012 at 9:39 PM, Artyom Beilis <art...@ya...> wrote: > > > Hello All, > > > There are APT repositories for the project: > > Read: http://cppcms.com/wikipp/en/page/apt > > Artyom Beilis > ------------- > > Support CppCMS by donating money: > https://sourceforge.net/donate/index.php?group_id=209965 > > > > ------------------------------------------------------------------------------ > Virtualization & Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
From: 陈抒 <csf...@gm...> - 2012-02-19 01:46:16
|
I like it. :) 陈抒 Best regards http://blog.csdn.net/sheismylife On Sun, Feb 19, 2012 at 1:39 AM, Artyom Beilis <art...@ya...> wrote: > > > Hello All, > > > There are APT repositories for the project: > > Read: http://cppcms.com/wikipp/en/page/apt > > Artyom Beilis > ------------- > > Support CppCMS by donating money: > https://sourceforge.net/donate/index.php?group_id=209965 > > > > ------------------------------------------------------------------------------ > Virtualization & Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
From: Marcel H. <ke...@co...> - 2012-02-18 20:48:59
|
Fedora x64 and I use either KDevelop or QT-Designer. QT is more complicated, because it does not support cmake nativly and you _should_ use cmake, because it's awesome. If you know how to deal with autotools or make, you can use that too. But I don't recommend to use qmake. CMake is the best choice ;) Am 18.02.2012 21:42, schrieb Peter N.: > Sounds good. > > I am normally a Visual Studio user however I'm not opposed to running > Ubuntu or some other distro. I was able to set it up on Linux much > easier (haven't tried windows). > > What distro do you guys use when developing and what ide? > > Thanks > > On Sat, Feb 18, 2012 at 12:08 PM, Artyom Beilis <art...@ya... > <mailto:art...@ya...>> wrote: > > >My questions > > > > > > >1) I'm building a new social network. > > I was going to go with a PHP framework like CakePHP. > > Then use HipChat to compile it to native code. Bundling this > with Socket.IO. > > > > Few points, PHP, even compiled to C++ still remains dynamic language > and that means each time you call "a+b" it should check the types > of a and b and see if they match. This is major performance killer. > > > So you'd never get a real boost with "Compiled PHP" like you can > have when you develop in C++ natively. > > > > > >To all devs, do you plan on stopping any time soon? > > > > What do you mean stopping? Stop the development? > > No :-)... > > > > > >2) Why use this framework? > >If I do discover bugs will you fix them in a timely manner? > > It depends on the nature of the bugs. You can ask the > > users there how fast bugs can be fixed, > generally it depends on their urgency. > > As far as I remember all critical bugs were > fixed very fast. > > > But this is open source project and its developers > has their own priorities. > > If you'll need some specific problems to get fixed > you can always request a help for a fee. > > > > I need live chat and live notifications (comet), > > and you guys provide this at very little cost. Is this all cross > browser? > > > > CppCMS is server side, you can implement many techniques > for Chat systems. The basic examples you had seen use long > polling and they generally work with all modern (and not > even so modern like IE6) browsers. > > > So client side depends on you. AFAIR the > > json-rpc chat example works in any browser. > > > > > >Thanks! > > Regards, > Artyom > > > ------------------------------------------------------------------------------ > Virtualization & Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > <mailto:Cpp...@li...> > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > > > ------------------------------------------------------------------------------ > Virtualization& Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > > > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users |
From: Peter N. <cou...@gm...> - 2012-02-18 20:43:18
|
Sounds good. I am normally a Visual Studio user however I'm not opposed to running Ubuntu or some other distro. I was able to set it up on Linux much easier (haven't tried windows). What distro do you guys use when developing and what ide? Thanks On Sat, Feb 18, 2012 at 12:08 PM, Artyom Beilis <art...@ya...> wrote: > >My questions > > > > > > >1) I'm building a new social network. > > I was going to go with a PHP framework like CakePHP. > > Then use HipChat to compile it to native code. Bundling this with > Socket.IO. > > > > Few points, PHP, even compiled to C++ still remains dynamic language > and that means each time you call "a+b" it should check the types > of a and b and see if they match. This is major performance killer. > > > So you'd never get a real boost with "Compiled PHP" like you can > have when you develop in C++ natively. > > > > > >To all devs, do you plan on stopping any time soon? > > > > What do you mean stopping? Stop the development? > > No :-)... > > > > > >2) Why use this framework? > >If I do discover bugs will you fix them in a timely manner? > > It depends on the nature of the bugs. You can ask the > > users there how fast bugs can be fixed, > generally it depends on their urgency. > > As far as I remember all critical bugs were > fixed very fast. > > > But this is open source project and its developers > has their own priorities. > > If you'll need some specific problems to get fixed > you can always request a help for a fee. > > > > I need live chat and live notifications (comet), > > and you guys provide this at very little cost. Is this all cross browser? > > > > CppCMS is server side, you can implement many techniques > for Chat systems. The basic examples you had seen use long > polling and they generally work with all modern (and not > even so modern like IE6) browsers. > > > So client side depends on you. AFAIR the > > json-rpc chat example works in any browser. > > > > > >Thanks! > > Regards, > Artyom > > > > ------------------------------------------------------------------------------ > Virtualization & Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
From: Artyom B. <art...@ya...> - 2012-02-18 20:08:27
|
>My questions > > >1) I'm building a new social network. > I was going to go with a PHP framework like CakePHP. > Then use HipChat to compile it to native code. Bundling this with Socket.IO. > Few points, PHP, even compiled to C++ still remains dynamic language and that means each time you call "a+b" it should check the types of a and b and see if they match. This is major performance killer. So you'd never get a real boost with "Compiled PHP" like you can have when you develop in C++ natively. > >To all devs, do you plan on stopping any time soon? > What do you mean stopping? Stop the development? No :-)... > >2) Why use this framework? >If I do discover bugs will you fix them in a timely manner? It depends on the nature of the bugs. You can ask the users there how fast bugs can be fixed, generally it depends on their urgency. As far as I remember all critical bugs were fixed very fast. But this is open source project and its developers has their own priorities. If you'll need some specific problems to get fixed you can always request a help for a fee. > I need live chat and live notifications (comet), > and you guys provide this at very little cost. Is this all cross browser? > CppCMS is server side, you can implement many techniques for Chat systems. The basic examples you had seen use long polling and they generally work with all modern (and not even so modern like IE6) browsers. So client side depends on you. AFAIR the json-rpc chat example works in any browser. > >Thanks! Regards, Artyom |
From: Peter N. <cou...@gm...> - 2012-02-18 17:44:16
|
After a few hours of work I managed to finally download, install and update Ubuntu. Then proceeded to compile CppCMS (SVN) and setup lighttpd (as mentioned as fastest). I tested a few apps and it seems to work fantastic! My questions 1) I'm building a new social network. I was going to go with a PHP framework like CakePHP. Then use HipChat to compile it to native code. Bundling this with Socket.IO. To all devs, do you plan on stopping any time soon? 2) Why use this framework? If I do discover bugs will you fix them in a timely manner? I need live chat and live notifications (comet), and you guys provide this at very little cost. Is this all cross browser? Thanks! |
From: Artyom B. <art...@ya...> - 2012-02-18 17:39:33
|
Hello All, There are APT repositories for the project: Read: http://cppcms.com/wikipp/en/page/apt Artyom Beilis ------------- Support CppCMS by donating money: https://sourceforge.net/donate/index.php?group_id=209965 |
From: Artyom B. <art...@ya...> - 2012-02-17 21:26:12
|
All CppCMS 1.0.0 milestone tasks had completed and thus the second release candidate was released. It contains mostly bug fixes including several security bug fixes. It is expected to be the last RC before the stable version would be delivered. All CppCMS users please download the RC2 and test it. If no critical problems would be found the stable version would be announced in a week or two. Full Release notes can be found there: http://blog.cppcms.com/post/100 Artyom Beilis ------------- Support CppCMS by donating money: https://sourceforge.net/donate/index.php?group_id=209965 |
From: Artyom B. <art...@ya...> - 2012-02-15 20:05:06
|
> If you don't want that sub project anymore, you may delete it, > because it could confuse new people. > http://cppcms.svn.sourceforge.net/viewvc/cppcms/examples/ > On the second thought, good point... removed Artyom |
From: Artyom B. <art...@ya...> - 2012-02-15 19:59:38
|
This "repository" would be removed with CppCMS 1.0.0 release. Now all examples are placed under the framework directory: http://cppcms.svn.sourceforge.net/viewvc/cppcms/framework/trunk/examples/ Also they are part of the reference documentation: http://cppcms.com/cppcms_ref_v0_99/examples_page.html Artyom >________________________________ > From: Marcel Hellwig <ke...@co...> >To: Artyom Beilis <art...@ya...>; cpp...@li... >Sent: Wednesday, February 15, 2012 8:37 PM >Subject: Re: [Cppcms-users] New Tutorials > > >Hi Artyo, >it would be nice if you could update the example folder in your svn repo too. >The last submit is 20 months old and not compatible with 1.x.x >If you don't want that sub project anymore, you may delete it, because it could confuse new people. >http://cppcms.svn.sourceforge.net/viewvc/cppcms/examples/ > >Regards, > > >------------------------------------------------------------------------------ >Virtualization & Cloud Management Using Capacity Planning >Cloud computing makes use of virtualization - but cloud computing >also focuses on allowing computing to be delivered as a service. >http://www.accelacomm.com/jaw/sfnl/114/51521223/ >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |
From: Marcel H. <ke...@co...> - 2012-02-15 18:37:49
|
Hi Artyo, it would be nice if you could update the example folder in your svn repo too. The last submit is 20 months old and not compatible with 1.x.x If you don't want that sub project anymore, you may delete it, because it could confuse new people. http://cppcms.svn.sourceforge.net/viewvc/cppcms/examples/ Regards, |
From: Artyom B. <art...@ya...> - 2012-02-15 18:15:48
|
Hello, I had updated and created many new tutorials that cover most of important parts of CppCMS 1.x.x. Please take a look on them, provide inputs and feel free to edit if you find any mistakes: Link: http://cppcms.com/wikipp/en/page/cppcms_1x#Tutorials Table of Contents ----------------- Introduction: - Hello World - Starting With Templates - URL Dispatching and Mapping - Applications Hierarchy - Views Inheritance - Forms - Sessions - Basic Caching - Serialization - JSON - JSON-RPC - Internationalization and Localization Comet Programming: - Implementing Chat - Implementing Chat using JSON-RPC Advanced: - Advanced Caching - Asynchronous I/O - Secure Programming - Designing web applications for high performance Artyom Beilis ------------- Support CppCMS by donating money: https://sourceforge.net/donate/index.php?group_id=209965 |
From: Artyom B. <art...@ya...> - 2012-02-10 12:25:03
|
> >Hi, > >> a) you can create a variable called first_name that you set in the >> controller >> that remains empty if the user is not logged in >> >> <%if not empty first_name %> >> <% gt "Hello {1}" using first_name%> >> <%else%> >> Please login below: >> <%end%> > >In the controller? > >Using this method I get > >view/blog.tmpl:21: error: 'class data::Blog' has no member named 'first_name' > > >> b) You can create a variable or callback in the content called >> "is_logged_in" > >In the "content", do you mean in the template or in the data model? > >Cheers, >Petr > > > Maybe RTFM? http://cppcms.com/wikipp/en/page/cppcms_1x_tut_hello_templates http://cppcms.com/wikipp/en/page/cppcms_1x_templates Artyom |
From: <ele...@ex...> - 2012-02-09 23:08:23
|
Hi, > a) you can create a variable called first_name that you set in the > controller > that remains empty if the user is not logged in > > <%if not empty first_name %> > <% gt "Hello {1}" using first_name%> > <%else%> > Please login below: > <%end%> In the controller? Using this method I get view/blog.tmpl:21: error: 'class data::Blog' has no member named 'first_name' > b) You can create a variable or callback in the content called > "is_logged_in" In the "content", do you mean in the template or in the data model? Cheers, Petr |
From: Tobias R. <rei...@go...> - 2012-02-08 14:54:48
|
Artyom Beilis <artyomtnk@...> writes: > Small matrix of "working/not-working" (tested just now_ > > API \ Server Lighttpd Apache Nginx > FastCGI Y N N > SCGI Y Y N > HTTP Y Y N (Can be fixed with buffering options) > > Nginx for some reason caches the response and do not try > to froward it to the client ASAP. You are right. You can turn off buffering in proxy mode but not in fastcgi mode. That's .... no words! So it's either sending packages at least as big as the buffer size (which I can't set less than 1k), or moving to lighttpd. Hm, easy question. > Also note, if you have heavy computations you can always print intermediate results. > > For example: > > response().io_mode(cppcms::http::response::nogzip); > for(int i=0;i<5;i++) { > response().out() << "Test" << std::endl; > booster::ptime::millisleep(1000); > } That's what I was up to. Thank you. Thanks again for your time and your help. I do appreciate. Best regards, Tobias |
From: Artyom B. <art...@ya...> - 2012-02-07 14:54:12
|
>> Slightly changed example that works (without boost::thread) > >Since the context is not thread safe, this makes sense. However, I already tried >your version without boost::thread and service::post in the first place. That's >why I left the two corresponding lines in my code as comments: > > [snip] > >Since you say it works this way, there must be something else which is >different. Could it have something to do with my web server or my browser? >I'm using nginx and Firefox, but tried Chrome as well. It is nginx. Small matrix of "working/not-working" (tested just now_ API \ Server Lighttpd Apache Nginx FastCGI Y N N SCGI Y Y N HTTP Y Y N (Can be fixed with buffering options) Nginx for some reason caches the response and do not try to froward it to the client ASAP. Which reminds me: http://blog.cppcms.com/post/99 >> >> http://cppcms.com/wikipp/en/page/thread_safety > >"[...] If asynchronous application or any other object that runs in the event >wants to execute some long running, blocking or heavy operation, it may do it by >submitting an execution handler to the thread pool. [...]" > >As I understand this, there's the Event Loop for asynchronous operations and >there's another Thread Pool for synchronous operations. In my case I have a >heavy computation, which I should send via service::post (is that right?) to the >Thread Pool. You you can post a job to thread pool using service().thread_pool().post(...) service().post(...) posts a job into event loop. > On the other side, I'd like to send back some progress or >intermediate computation results, which I can do only by using >context::async_flush_output, which is an asynchronous operation and thus part of >the Event Loop. So, is it possible at all to call asynchronous operations from >synchronous threads? Via service().post(...) Also note, if you have heavy computations you can always print intermediate results. For example: response().io_mode(cppcms::http::response::nogzip); for(int i=0;i<5;i++) { response().out() << "Test" << std::endl; booster::ptime::millisleep(1000); } This code does the same synchronously when application works on the thread pool it would work 100% (if you replace millisleep with your work) response().out() << std::flush flushes the data to the output. One thing you still must notice is disabling gzip compression otherwise it would be cached and would not work 1-to-1. By default gzip is enabled and browsers by default accept gzip compressed data, so it is important to disable so the std::flush would work (std::endl calls std::flush) Regards, Artyom Beilis |
From: Tobias R. <rei...@go...> - 2012-02-07 12:45:54
|
Artyom Beilis <artyomtnk@...> writes: > You are mixing calls from the boost::thread and the mail event loop thread and you should not. > Slightly changed example that works (without boost::thread) Since the context is not thread safe, this makes sense. However, I already tried your version without boost::thread and service::post in the first place. That's why I left the two corresponding lines in my code as comments: [...] //flush_output(); <--- tried this already service().post(boost::bind(&Application::flush_output, ...); [...] //compute_thread(); <--- tried this already thread_ = boost::thread(boost::bind(&Application::compute_thread, ...); [...] Since you say it works this way, there must be something else which is different. Could it have something to do with my web server or my browser? I'm using nginx and Firefox, but tried Chrome as well. I'm not caching anything on purpose. I even tried to send bigger packages each time to prevent some lazy sending mechanisms. > Read this: > > http://cppcms.com/wikipp/en/page/thread_safety "[...] If asynchronous application or any other object that runs in the event wants to execute some long running, blocking or heavy operation, it may do it by submitting an execution handler to the thread pool. [...]" As I understand this, there's the Event Loop for asynchronous operations and there's another Thread Pool for synchronous operations. In my case I have a heavy computation, which I should send via service::post (is that right?) to the Thread Pool. On the other side, I'd like to send back some progress or intermediate computation results, which I can do only by using context::async_flush_output, which is an asynchronous operation and thus part of the Event Loop. So, is it possible at all to call asynchronous operations from synchronous threads? Anyway, thank you very much for your time, Artyom. Best regards, Tobias |
From: Artyom B. <art...@ya...> - 2012-02-07 11:37:56
|
----- Original Message ----- > From: "ele...@ex..." <ele...@ex...> > > [snip] > > The example blog application seems use java script to do some client side > checking, but what's the best way to do it on the server side? > I use javascript because I want to cache pages and so I don't need to have separate version for visitor and administrator. > In simplistic terms what I'm trying to do in the template is something > like this > > <%if is_logged_in()%> > <% gt "Hello {1}" using first_name%> > <%else%> > Please login below: > <%end%> > a) you can create a variable called first_name that you set in the controller that remains empty if the user is not logged in <%if not empty first_name %> <% gt "Hello {1}" using first_name%> <%else%> Please login below: <%end%> b) You can create a variable or callback in the content called "is_logged_in" c) You can use session object directly <% if app().session().is_set("username") %> <% gt "Hello {1}" using first_name%> <%else%> Please login below: <%end%> Enjoy :-) Artyom Beilis ------------- Support CppCMS by donating money: https://sourceforge.net/donate/index.php?group_id=209965 |
From: Artyom B. <art...@ya...> - 2012-02-07 11:31:10
|
You are mixing calls from the boost::thread and the mail event loop thread and you should not. Slightly changed example that works (without boost::thread) Read this: http://cppcms.com/wikipp/en/page/thread_safety Also you can't access context_->response().out() from the thread, you can't call async_flush or async_complete_response from different thread. Artyom Beilis ------------- Support CppCMS by donating money: https://sourceforge.net/donate/index.php?group_id=209965 ------------------- #include <cppcms/service.h> #include <cppcms/application.h> #include <cppcms/http_context.h> #include <cppcms/http_response.h> #include <cppcms/applications_pool.h> #include <booster/aio/deadline_timer.h> #include <boost/bind.hpp> class Application : public cppcms::application { int counter_; booster::aio::deadline_timer timer_; booster::shared_ptr<cppcms::http::context> context_; public: Application(cppcms::service &srv) : cppcms::application(srv) { timer_.set_io_service(service().get_io_service()); } void async_handler(cppcms::http::context::completion_type t) { timer_.expires_from_now(booster::ptime::seconds(1)); timer_.async_wait(boost::bind(&Application::compute_thread, booster::intrusive_ptr<Application>(this))); } void flush_output() { context_->async_flush_output(boost::bind(&Application::async_handler, booster::intrusive_ptr<Application>(this), _1)); } void compute_thread() { std::ostream& o = context_->response().out(); if (counter_++ < 5) { o << "Content-type: text/plain\n\n"; o << "count: " << counter_ << std::endl; o << "--progress-token\n"; flush_output(); return; } o << "Content-type: text/plain\n\n"; o << "Computation finished\n"; o << "--progress-token\n"; context_->async_complete_response(); } void main(std::string) { context_ = release_context(); context_->response().set_content_header("multipart/x-mixed-replace; boundary=progress-token"); context_->response().out() << "--progress-token\n"; counter_ = 0; compute_thread(); } }; int main(int argc, char** argv) { try { cppcms::service srv(argc, argv); booster::intrusive_ptr<Application> app = new Application(srv); srv.applications_pool().mount(app); srv.run(); } catch(std::exception const& e) { std::cerr << e.what() << std::endl; } } |
From: <ele...@ex...> - 2012-02-07 02:55:36
|
Thank you very much for helping me understand cppcms. But I do have one more question unrelated to dates - What's the best way to check a cookie inside a template view? For example - a person logs in, and then on every page it will say "Hello ${user}". The example blog application seems use java script to do some client side checking, but what's the best way to do it on the server side? In simplistic terms what I'm trying to do in the template is something like this <%if is_logged_in()%> <% gt "Hello {1}" using first_name%> <%else%> Please login below: <%end%> Thanks Petr |
From: Tobias R. <rei...@go...> - 2012-02-06 15:55:28
|
Hello, I'm trying to get a multipart response by doing a single request. The motivation behind is a big computation which gives some progress feedback. So far I stumbled over "context::async_flush_output" which (given that name) should flush the responding data. Simulating the computational part by using a timer, I expect to get five distinct responses, each in a second (see following code). Instead, I get the whole response after the five seconds en bloc. Did I miss something? class Application : public cppcms::application { int counter_; booster::aio::deadline_timer timer_; booster::shared_ptr<cppcms::http::context> context_; boost::thread thread_; public: Application(cppcms::service &srv) : cppcms::application(srv) { timer_.set_io_service(service().get_io_service()); dispatcher().assign("^/compute$", &Application::compute, this); } void async_handler(cppcms::http::context::complition_type t) { timer_.expires_from_now(booster::ptime::seconds(1)); timer_.async_wait(boost::bind(&Application::compute_thread, booster::intrusive_ptr<Application>(this))); } void flush_output() { context_->async_flush_output(boost::bind(&Application::async_handler, booster::intrusive_ptr<Application>(this), _1)); } void compute_thread() { std::ostream& o = context_->response().out(); if (counter_++ < 5) { o << "Content-type: text/plain\n\n"; o << "count: " << counter_ << std::endl; o << "--progress-token\n"; // flush_output(); service().post(boost::bind(&Application::flush_output, booster::intrusive_ptr<Application>(this))); return; } o << "Content-type: text/plain\n\n"; o << "Computation finished\n"; o << "--progress-token\n"; context_->async_complete_response(); } void compute() { context_ = release_context(); context_->response().set_content_header("multipart/x-mixed-replace; boundary=progress-token"); context_->response().out() << "--progress-token\n"; counter_ = 0; // compute_thread(); thread_ = boost::thread(boost::bind(&Application::compute_thread, booster::intrusive_ptr<Application>(this))); } }; int main(int argc, char** argv) { try { cppcms::service srv(argc, argv); booster::intrusive_ptr<Application> app = new Application(srv); srv.applications_pool().mount(app, cppcms::mount_point("/counter")); srv.run(); } catch(std::exception const& e) { std::cerr << e.what() << std::endl; } } On the client side I have a simple Javascript: var xmlHttp = new XMLHttpRequest(); xmlHttp.multipart = true; xmlHttp.open('GET', 'counter/compute', true); xmlHttp.onreadystatechange = function (event) { console.log("readystate = " + event.target.readyState + ": " + event.target.responseText + "\n"); } xmlHttp.send(null); Best regards, Tobias |