cppcms-users Mailing List for CppCMS C++ Web Framework (Page 137)
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 <art...@ya...> - 2010-07-01 09:17:50
|
Thanks, I've committed changes 1301 that should deal with extra zeros. Hopefully it fixes this test fault. Artyom ----- Original Message ---- > From: Hermann Seib <of...@he...> > To: cpp...@li... > Sent: Thu, July 1, 2010 10:52:42 AM > Subject: Re: [Cppcms-users] JSON integer conversion(s) > > If it helps you, here's what VC15 (i.e., Visual Studio 2008) generates: > > format(1.35e30)="1.35e+030" (note the additional 0). > > Bye, > > Hermann > > > Thanks, > > > > Looks like I have to get to MSVC to solve this issue, but it does not look > > critical. > > > > Opened a bug: > > >https://sourceforge.net/tracker/?func=detail&aid=3023329&group_id=209965&atid=1011835 > > > > > > > Artyom > > > > > > > > > > ----- Original Message ---- > >> From: Hermann Seib <of...@he...> > >> To: cpp...@li... > >> Sent: Wed, June 30, 2010 2:42:47 PM > >> Subject: Re: [Cppcms-users] JSON integer conversion(s) > >> > >>> Can you run svn update (get 1299) and rebuild once more and give me the > >> output > >>> of ./json_test > >> Failed:Error D:\Dev\CppCMS\tests\json_test.cpp:170 > >> format(1.35e30)=="1.35e+30" > >> > >> Bye, > >> > >> Hermann > >> > >> >------------------------------------------------------------------------------ > >> This SF.net email is sponsored by Sprint > >> What will you do first with EVO, the first 4G phone? > >> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > >> _______________________________________________ > >> Cppcms-users mailing list > >> Cpp...@li... > >> https://lists.sourceforge.net/lists/listinfo/cppcms-users > >> > > > > > > > > > > >------------------------------------------------------------------------------ > > This SF.net email is sponsored by Sprint > > What will you do first with EVO, the first 4G phone? > > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > > _______________________________________________ > > Cppcms-users mailing list > > Cpp...@li... > > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
From: Artyom <art...@ya...> - 2010-07-01 08:51:35
|
> If I can remember correctly it was possible in the old cppcms version to > find out easily if a request came over http or https. HTTPs check function was available via CgiCC library, but its implementation is Apache specific. See: http://httpd.apache.org/docs/2.0/mod/mod_ssl.html What this function does, it checks that HTTPS environment variable is set or (under Windows) it is set to "ON". This is generally not correct solution and should not be used in portable software. You may use getenv but you should understand that this is Apache specific. The only portable way I think you can do this is to check server_port()==431 or other predefined value that you know that web server uses for https protocol. But as you understand this require from the developer to be aware of web server port. You may just put it into you configuration and check like this: if(server_port() == settings().get<int>("my_application.web_servers_https_port")) { // we on https } So, this CgiCC "feature" is rather "bug" as its implementation is incorrect and may mislead you. Regards, Artyom |
From: Geert V. de V. <gee...@ba...> - 2010-07-01 08:10:50
|
Hi, If I can remember correctly it was possible in the old cppcms version to find out easily if a request came over http or https. Currently I can't find this function anymore (or perhaps I overlook it somehow). I use the getenv() function currently but I think it would be a good idea to put this in the library. Greetings, Geert DISCLAIMER: Unless indicated otherwise, the information contained in this message is privileged and confidential, and is intended only for the use of the addressee(s) named above and others who have been specifically authorized to receive it. If you are not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message and/or attachments is strictly prohibited. The company accepts no liability for any damage caused by any virus transmitted by this email. Furthermore, the company does not warrant a proper and complete transmission of this information, nor does it accept liability for any delays. If you have received this message in error, please contact the sender and delete the message. Thank you. |
From: Hermann S. <of...@he...> - 2010-07-01 07:53:04
|
If it helps you, here's what VC15 (i.e., Visual Studio 2008) generates: format(1.35e30)="1.35e+030" (note the additional 0). Bye, Hermann > Thanks, > > Looks like I have to get to MSVC to solve this issue, but it does not look > critical. > > Opened a bug: > https://sourceforge.net/tracker/?func=detail&aid=3023329&group_id=209965&atid=1011835 > > > Artyom > > > > > ----- Original Message ---- >> From: Hermann Seib <of...@he...> >> To: cpp...@li... >> Sent: Wed, June 30, 2010 2:42:47 PM >> Subject: Re: [Cppcms-users] JSON integer conversion(s) >> >>> Can you run svn update (get 1299) and rebuild once more and give me the >> output >>> of ./json_test >> Failed:Error D:\Dev\CppCMS\tests\json_test.cpp:170 >> format(1.35e30)=="1.35e+30" >> >> Bye, >> >> Hermann >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by Sprint >> What will you do first with EVO, the first 4G phone? >> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first >> _______________________________________________ >> Cppcms-users mailing list >> Cpp...@li... >> https://lists.sourceforge.net/lists/listinfo/cppcms-users >> > > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > |
From: Artyom <art...@ya...> - 2010-06-30 17:14:05
|
Thanks, Looks like I have to get to MSVC to solve this issue, but it does not look critical. Opened a bug: https://sourceforge.net/tracker/?func=detail&aid=3023329&group_id=209965&atid=1011835 Artyom ----- Original Message ---- > From: Hermann Seib <of...@he...> > To: cpp...@li... > Sent: Wed, June 30, 2010 2:42:47 PM > Subject: Re: [Cppcms-users] JSON integer conversion(s) > > > Can you run svn update (get 1299) and rebuild once more and give me the >output > > of ./json_test > > Failed:Error D:\Dev\CppCMS\tests\json_test.cpp:170 > format(1.35e30)=="1.35e+30" > > Bye, > > Hermann > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
From: Geert V. de V. <gee...@ba...> - 2010-06-30 12:34:12
|
Tnx for the quick update! On Wed, 2010-06-30 at 04:19 -0700, Artyom wrote: > > It would also be useful to add conversion functions for unsigned > > integers. > > I also added specializations (traits) for all integer and floating point types > so > that you can access all values like get<unsigned>("x"). > > changeset 1299. > > Artyom > > > DISCLAIMER: Unless indicated otherwise, the information contained in this message is privileged and confidential, and is intended only for the use of the addressee(s) named above and others who have been specifically authorized to receive it. If you are not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message and/or attachments is strictly prohibited. The company accepts no liability for any damage caused by any virus transmitted by this email. Furthermore, the company does not warrant a proper and complete transmission of this information, nor does it accept liability for any delays. If you have received this message in error, please contact the sender and delete the message. Thank you. |
From: Hermann S. <of...@he...> - 2010-06-30 11:58:31
|
> Can you run svn update (get 1299) and rebuild once more and give me the output > of ./json_test Failed:Error D:\Dev\CppCMS\tests\json_test.cpp:170 format(1.35e30)=="1.35e+30" Bye, Hermann |
From: Artyom <art...@ya...> - 2010-06-30 11:21:42
|
Can you run svn update (get 1299) and rebuild once more and give me the output of ./json_test So I'll be able to fix the problem, (till I get to MSVC to debug the problem) Artyom ----- Original Message ---- > From: Hermann Seib <of...@he...> > To: cpp...@li... > Sent: Wed, June 30, 2010 2:01:10 PM > Subject: Re: [Cppcms-users] JSON integer conversion(s) > > Using changeset 1298 together with Visual Studio 2008 creates the > following test error: > > The following tests FAILED: > 4 - json_test (Failed) > > Bye, > > Hermann > > > Hello, > > > > Thanks for the good point you bring. > > > > Actually not only integer number were not printed correctly, but floating >point > > > ones as well. > > I fixed this that numbers are printed with maximal possible precision and >this > > > should solve problem > > (I also added test case for such numbers) > > > > So your example generates 1277880000 string and not 1.27788e+09 > > > > (changeset 1298, you can take if from SVN) > > > > > > > >> I have noticed that the conversion of C++ integer numbers to json goes > >> trough converting it to a double. This can get undesired behavior for > >> large numbers when it automatic adds exponents when outputting it as > >> json. > > > > Double is capable representing integer numbers correctly, so the problem is >not > > > in converting > > them to double but rather in printing them. > > > >> I want to keep the integer representation. If I want a double > >> representation I will convert it myself explicitly. > >> If possible by adding the function "void value::number(long int x);" > >> this issue can be solved. > >> > > > > This is not correct solution as neither JSON nor JavaScript have no integer >or > > > double type they > > have number type. So introducing "integer" type would be incorrect solution >as > > > it extends JSON object > > representation. > > > > IEEE floating point number can handle integer values correctly (with correct > > > rounding and precision) > > so there no need to change internal representation. > > > > Also if you need real UUIDs neither integer nor double (and not even 64 bit > > integer) would be good enough. > > You should probably use string. > > > > > > Thanks for the report, > > Regards, > > Artyom > > > > > > > > > > >------------------------------------------------------------------------------ > > This SF.net email is sponsored by Sprint > > What will you do first with EVO, the first 4G phone? > > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > > _______________________________________________ > > Cppcms-users mailing list > > Cpp...@li... > > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
From: Artyom <art...@ya...> - 2010-06-30 11:19:12
|
> It would also be useful to add conversion functions for unsigned > integers. I also added specializations (traits) for all integer and floating point types so that you can access all values like get<unsigned>("x"). changeset 1299. Artyom |
From: Hermann S. <of...@he...> - 2010-06-30 11:16:45
|
Using changeset 1298 together with Visual Studio 2008 creates the following test error: The following tests FAILED: 4 - json_test (Failed) Bye, Hermann > Hello, > > Thanks for the good point you bring. > > Actually not only integer number were not printed correctly, but floating point > ones as well. > I fixed this that numbers are printed with maximal possible precision and this > should solve problem > (I also added test case for such numbers) > > So your example generates 1277880000 string and not 1.27788e+09 > > (changeset 1298, you can take if from SVN) > > > >> I have noticed that the conversion of C++ integer numbers to json goes >> trough converting it to a double. This can get undesired behavior for >> large numbers when it automatic adds exponents when outputting it as >> json. > > Double is capable representing integer numbers correctly, so the problem is not > in converting > them to double but rather in printing them. > >> I want to keep the integer representation. If I want a double >> representation I will convert it myself explicitly. >> If possible by adding the function "void value::number(long int x);" >> this issue can be solved. >> > > This is not correct solution as neither JSON nor JavaScript have no integer or > double type they > have number type. So introducing "integer" type would be incorrect solution as > it extends JSON object > representation. > > IEEE floating point number can handle integer values correctly (with correct > rounding and precision) > so there no need to change internal representation. > > Also if you need real UUIDs neither integer nor double (and not even 64 bit > integer) would be good enough. > You should probably use string. > > > Thanks for the report, > Regards, > Artyom > > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > |
From: Artyom <art...@ya...> - 2010-06-30 10:02:16
|
Hello, Thanks for the good point you bring. Actually not only integer number were not printed correctly, but floating point ones as well. I fixed this that numbers are printed with maximal possible precision and this should solve problem (I also added test case for such numbers) So your example generates 1277880000 string and not 1.27788e+09 (changeset 1298, you can take if from SVN) > > I have noticed that the conversion of C++ integer numbers to json goes > trough converting it to a double. This can get undesired behavior for > large numbers when it automatic adds exponents when outputting it as > json. Double is capable representing integer numbers correctly, so the problem is not in converting them to double but rather in printing them. > > I want to keep the integer representation. If I want a double > representation I will convert it myself explicitly. > If possible by adding the function "void value::number(long int x);" > this issue can be solved. > This is not correct solution as neither JSON nor JavaScript have no integer or double type they have number type. So introducing "integer" type would be incorrect solution as it extends JSON object representation. IEEE floating point number can handle integer values correctly (with correct rounding and precision) so there no need to change internal representation. Also if you need real UUIDs neither integer nor double (and not even 64 bit integer) would be good enough. You should probably use string. Thanks for the report, Regards, Artyom |
From: Geert V. de V. <gee...@ba...> - 2010-06-30 08:26:06
|
Hi, I have noticed that the conversion of C++ integer numbers to json goes trough converting it to a double. This can get undesired behavior for large numbers when it automatic adds exponents when outputting it as json. eg. int uid = 1277880000; results into this: { "uid":1.27788e+09 } I want to keep the integer representation. If I want a double representation I will convert it myself explicitly. If possible by adding the function "void value::number(long int x);" this issue can be solved. It would also be useful to add conversion functions for unsigned integers. Greetings DISCLAIMER: Unless indicated otherwise, the information contained in this message is privileged and confidential, and is intended only for the use of the addressee(s) named above and others who have been specifically authorized to receive it. If you are not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message and/or attachments is strictly prohibited. The company accepts no liability for any damage caused by any virus transmitted by this email. Furthermore, the company does not warrant a proper and complete transmission of this information, nor does it accept liability for any delays. If you have received this message in error, please contact the sender and delete the message. Thank you. |
From: Artyom <art...@ya...> - 2010-06-28 10:32:16
|
No it is not quite possible, 1. unique_ptr and auto_ptr are different pointers with different semantics. For example: auto_ptr<foo> factory() { auto_ptr<foo> ptr(new foo()); return ptr; } Would not work with unique_ptr as it requires std::move. 2. They are different binary-incompatible classes. For example my code runs on gcc-4.5 without C++0x, if in two years C++0x becomes default with gcc then automatic replacement of auto_ptr with unique_ptr will break backward binary compatibility of the library, so I can't relay on this feature. I think it is stupid to deprecate auto_ptr as it is the only smart pointer existing in C++03 so I hope gcc will remove deprecation warning for most used C++ smart pointer. I don't see any problem with it, the only problem is that some programmers had used it inside STL Collections and got problems with it. Artyom ----- Original Message ---- > From: Stanimir Mladenov <sta...@zo...> > To: cpp...@li... > Sent: Mon, June 28, 2010 12:06:38 PM > Subject: Re: [Cppcms-users] Compilation errors using gcc 4.5 and c++0x > > Yes, but using C++0x gives much benefits already and it is really good that > you support it to some extend already. Something that already was discussed, > is the deprecation of auto_ptr in favor of unique_ptr. At the moment c++0x is > enabled, a warning about this is emitted. Is it possible to substitute > auto_ptr to unique_ptr the same way you do with auto and > __typeof__? It is not a big deal but it looks much better this > way. Stanimir On Sat, Jun 26, 2010 at 10:44 PM, Artyom < > ymailto="mailto:art...@ya..." > href="mailto:art...@ya...">art...@ya...> > wrote: >> >> Actually, CppCms compiles fine without the > --std=c++0x >> flag. I saw you >> are using the auto keyword > in the templates loops if >> available and >> since I am using > it too, decided to give it to CppCms >> also. > > Note, I > don't really need C++0x mode to get nice way to iterate > over > collections. > > Under gcc, intel and even SunStudo (I used to > support) > compilers I have typeof or __typeof__ which is very close to > decltype > so auto is not so necessary, but still I'm really looking > forward > for it in all modern compilers as for C++0x at > all. > > If today C++0x was supported by most compilers I would not > need > half of Booster today. > > Regards > > Artyom > > > > > > > > ------------------------------------------------------------------------------ > > This SF.net email is sponsored by > Sprint > What will you do first with EVO, the first 4G phone? > > Visit sprint.com/first -- > http://p.sf.net/sfu/sprint-com-first > > _______________________________________________ > Cppcms-users mailing > list > > href="mailto:Cpp...@li...">Cpp...@li... > > > target=_blank > >https://lists.sourceforge.net/lists/listinfo/cppcms-users > ------------------------------------------------------------------------------ This > SF.net email is sponsored by Sprint What will you do first with EVO, the > first 4G phone? Visit sprint.com/first -- > href="http://p.sf.net/sfu/sprint-com-first" target=_blank > >http://p.sf.net/sfu/sprint-com-first _______________________________________________ Cppcms-users > mailing list > href="mailto:Cpp...@li...">Cpp...@li... > href="https://lists.sourceforge.net/lists/listinfo/cppcms-users" target=_blank > >https://lists.sourceforge.net/lists/listinfo/cppcms-users |
From: Stanimir M. <sta...@zo...> - 2010-06-28 09:07:08
|
Yes, but using C++0x gives much benefits already and it is really good that you support it to some extend already. Something that already was discussed, is the deprecation of auto_ptr in favor of unique_ptr. At the moment c++0x is enabled, a warning about this is emitted. Is it possible to substitute auto_ptr to unique_ptr the same way you do with auto and __typeof__? It is not a big deal but it looks much better this way. Stanimir On Sat, Jun 26, 2010 at 10:44 PM, Artyom <art...@ya...> wrote: >> >> Actually, CppCms compiles fine without the --std=c++0x >> flag. I saw you >> are using the auto keyword in the templates loops if >> available and >> since I am using it too, decided to give it to CppCms >> also. > > Note, I don't really need C++0x mode to get nice way to iterate > over collections. > > Under gcc, intel and even SunStudo (I used to support) > compilers I have typeof or __typeof__ which is very close to decltype > so auto is not so necessary, but still I'm really looking forward > for it in all modern compilers as for C++0x at all. > > If today C++0x was supported by most compilers I would not need > half of Booster today. > > Regards > Artyom > > > > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
From: Artyom <art...@ya...> - 2010-06-26 19:44:21
|
> > Actually, CppCms compiles fine without the --std=c++0x > flag. I saw you > are using the auto keyword in the templates loops if > available and > since I am using it too, decided to give it to CppCms > also. Note, I don't really need C++0x mode to get nice way to iterate over collections. Under gcc, intel and even SunStudo (I used to support) compilers I have typeof or __typeof__ which is very close to decltype so auto is not so necessary, but still I'm really looking forward for it in all modern compilers as for C++0x at all. If today C++0x was supported by most compilers I would not need half of Booster today. Regards Artyom |
From: Stanimir M. <sta...@zo...> - 2010-06-26 09:46:20
|
Thanks, I fetched it from svn! Yes, gcc 4.4 and not 4.5 has the auto and some other nice c++0x features. I will switch in a day to 4.5 for more of them. Actually, CppCms compiles fine without the --std=c++0x flag. I saw you are using the auto keyword in the templates loops if available and since I am using it too, decided to give it to CppCms also. About the error, I think that because the 0 (int) argument is an rvalue and converting it to non const pointer (because the return result is non const). On Fri, Jun 25, 2010 at 3:51 PM, Artyom <art...@ya...> wrote: > > Hello, > > Small note - not 4.5 -- 4.4 > > To be honest, it looks like a compiler bug... Or I do not know C++. > The funniest thing that I did tested the code with gcc-4.5 and c++0x flag > and it worked well. (See http://cppcms.sourceforge.net/wikipp/en/page/cppcms_1x_platforms) > > gcc-4.4 (that I fortunately have installed) fails on > > return buffer_data_type(0,0); > > Where buffer_data_type is std:pair of <entry const *,size_t> and entry itself > defined as struct entry { Pointer ptr; size_t size; } where Pointer is template parameters. > > Now gcc-4.4 complains that it can't convert 0 (int) to entry const *, where it is clearly (at least for me) > legal as I can assign 0 to pointer. > > Now I fixed this in the code by creating empty buffer_data_type and manually setting first and second to 0. > > But what I do interested is whether I'm wrong or compiler is wrong. > > I've commited the fix in changeset 1296 > You may take it from the svn or just apply these changes in your copy as shown there: > > http://cppcms.svn.sourceforge.net/viewvc/cppcms/framework/branches/refactoring/booster/booster/aio/buffer.h?r1=1173&r2=1296 > > Thanks for the report, > Artyom > > > > > ----- Original Message ---- > > From: Stanimir Mladenov <sta...@zo...> > > To: cpp...@li... > > Sent: Fri, June 25, 2010 2:28:48 PM > > Subject: [Cppcms-users] Compilation errors using gcc 4.5 and c++0x > > > > Hello Artyom, > > Congratulations for the beta release of CppCms > > 1.x.x! > > I am using the new features of gcc 4.4 and --std=c++0x > > Here > > are some compile errors from it. > > [ 1%] Building CXX > > object > booster/CMakeFiles/booster.dir/lib/aio/src/socket.cpp.o > In file > > included from /usr/include/c++/4.4/bits/stl_algobase.h:66, > > > from > > /usr/include/c++/4.4/bits/char_traits.h:41, > > > from /usr/include/c++/4.4/string:42, > > > from > > /usr/include/c++/4.4/stdexcept:39, > > > > > from > /home/stanimir/work/web_common/third_parties/cppcms/framework/branches/refactoring/booster/./booster/function.h:11, > > > > > from > /home/stanimir/work/web_common/third_parties/cppcms/framework/branches/refactoring/booster/./booster/aio/socket.h:12, > > > > > from > /home/stanimir/work/web_common/third_parties/cppcms/framework/branches/refactoring/booster/lib/aio/src/socket.cpp:28: > /usr/include/c++/4.4/bits/stl_pair.h: > > In constructor ‘std::pair<_T1, > _T2>::pair(_U1&&, _U2&&) > > [with _U1 = int, _U2 = int, _T1 = > > const > booster::aio::buffer_impl<char*>::entry*, _T2 = unsigned > > int]’: > /home/stanimir/work/web_common/third_parties/cppcms/framework/branches/refactoring/booster/./booster/aio/buffer.h:34: > > > instantiated from > > ‘std::pair<const > booster::aio::buffer_impl<Pointer>::entry*, > > unsigned int> > booster::aio::buffer_impl<Pointer>::get() const [with > > Pointer > > = > char*]’ > /home/stanimir/work/web_common/third_parties/cppcms/framework/branches/refactoring/booster/./booster/aio/buffer.h:77: > > > instantiated from here > /usr/include/c++/4.4/bits/stl_pair.h:90: error: > > invalid conversion > from ‘int’ to ‘const > > booster::aio::buffer_impl<char*>::entry*’ > /usr/include/c++/4.4/bits/stl_pair.h: > > In constructor ‘std::pair<_T1, > _T2>::pair(_U1&&, _U2&&) > > [with _U1 = int, _U2 = int, _T1 = const > booster::aio::buffer_impl<const > > char*>::entry*, _T2 = unsigned > > int]’: > /home/stanimir/work/web_common/third_parties/cppcms/framework/branches/refactoring/booster/./booster/aio/buffer.h:34: > > > instantiated from > > ‘std::pair<const > booster::aio::buffer_impl<Pointer>::entry*, > > unsigned int> > booster::aio::buffer_impl<Pointer>::get() const [with > > Pointer = > > const > char*]’ > /home/stanimir/work/web_common/third_parties/cppcms/framework/branches/refactoring/booster/lib/aio/src/socket.cpp:377: > > > instantiated from here > /usr/include/c++/4.4/bits/stl_pair.h:90: error: > > invalid conversion > from ‘int’ to ‘const booster::aio::buffer_impl<const > > char*>::entry*’ > /home/stanimir/work/web_common/third_parties/cppcms/framework/branches/refactoring/booster/./booster/system_error.h: > At > > global > > scope: > /home/stanimir/work/web_common/third_parties/cppcms/framework/branches/refactoring/booster/./booster/system_error.h:56: > warning: > > ‘booster::system::posix_category’ defined but not used > make[2]: *** > > [booster/CMakeFiles/booster.dir/lib/aio/src/socket.cpp.o] Error 1 > make[1]: > > *** [booster/CMakeFiles/booster.dir/all] Error 2 > make: *** [all] Error > > 2 > > Greetings, > Stanimir > > ------------------------------------------------------------------------------ > ThinkGeek > > and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. > > ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and > > enter to win: > > > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > Cppcms-users > > mailing list > > > href="mailto:Cpp...@li...">Cpp...@li... > > > href="https://lists.sourceforge.net/lists/listinfo/cppcms-users" target=_blank > > >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users |
From: Artyom <art...@ya...> - 2010-06-25 12:51:21
|
Hello, Small note - not 4.5 -- 4.4 To be honest, it looks like a compiler bug... Or I do not know C++. The funniest thing that I did tested the code with gcc-4.5 and c++0x flag and it worked well. (See http://cppcms.sourceforge.net/wikipp/en/page/cppcms_1x_platforms) gcc-4.4 (that I fortunately have installed) fails on return buffer_data_type(0,0); Where buffer_data_type is std:pair of <entry const *,size_t> and entry itself defined as struct entry { Pointer ptr; size_t size; } where Pointer is template parameters. Now gcc-4.4 complains that it can't convert 0 (int) to entry const *, where it is clearly (at least for me) legal as I can assign 0 to pointer. Now I fixed this in the code by creating empty buffer_data_type and manually setting first and second to 0. But what I do interested is whether I'm wrong or compiler is wrong. I've commited the fix in changeset 1296 You may take it from the svn or just apply these changes in your copy as shown there: http://cppcms.svn.sourceforge.net/viewvc/cppcms/framework/branches/refactoring/booster/booster/aio/buffer.h?r1=1173&r2=1296 Thanks for the report, Artyom ----- Original Message ---- > From: Stanimir Mladenov <sta...@zo...> > To: cpp...@li... > Sent: Fri, June 25, 2010 2:28:48 PM > Subject: [Cppcms-users] Compilation errors using gcc 4.5 and c++0x > > Hello Artyom, Congratulations for the beta release of CppCms > 1.x.x! I am using the new features of gcc 4.4 and --std=c++0x Here > are some compile errors from it. [ 1%] Building CXX > object booster/CMakeFiles/booster.dir/lib/aio/src/socket.cpp.o In file > included from /usr/include/c++/4.4/bits/stl_algobase.h:66, > from > /usr/include/c++/4.4/bits/char_traits.h:41, > from /usr/include/c++/4.4/string:42, > from > /usr/include/c++/4.4/stdexcept:39, > > from /home/stanimir/work/web_common/third_parties/cppcms/framework/branches/refactoring/booster/./booster/function.h:11, > > from /home/stanimir/work/web_common/third_parties/cppcms/framework/branches/refactoring/booster/./booster/aio/socket.h:12, > > from /home/stanimir/work/web_common/third_parties/cppcms/framework/branches/refactoring/booster/lib/aio/src/socket.cpp:28: /usr/include/c++/4.4/bits/stl_pair.h: > In constructor ‘std::pair<_T1, _T2>::pair(_U1&&, _U2&&) > [with _U1 = int, _U2 = int, _T1 = > const booster::aio::buffer_impl<char*>::entry*, _T2 = unsigned > int]’: /home/stanimir/work/web_common/third_parties/cppcms/framework/branches/refactoring/booster/./booster/aio/buffer.h:34: > instantiated from > ‘std::pair<const booster::aio::buffer_impl<Pointer>::entry*, > unsigned int> booster::aio::buffer_impl<Pointer>::get() const [with > Pointer > = char*]’ /home/stanimir/work/web_common/third_parties/cppcms/framework/branches/refactoring/booster/./booster/aio/buffer.h:77: > instantiated from here /usr/include/c++/4.4/bits/stl_pair.h:90: error: > invalid conversion from ‘int’ to ‘const > booster::aio::buffer_impl<char*>::entry*’ /usr/include/c++/4.4/bits/stl_pair.h: > In constructor ‘std::pair<_T1, _T2>::pair(_U1&&, _U2&&) > [with _U1 = int, _U2 = int, _T1 = const booster::aio::buffer_impl<const > char*>::entry*, _T2 = unsigned > int]’: /home/stanimir/work/web_common/third_parties/cppcms/framework/branches/refactoring/booster/./booster/aio/buffer.h:34: > instantiated from > ‘std::pair<const booster::aio::buffer_impl<Pointer>::entry*, > unsigned int> booster::aio::buffer_impl<Pointer>::get() const [with > Pointer = > const char*]’ /home/stanimir/work/web_common/third_parties/cppcms/framework/branches/refactoring/booster/lib/aio/src/socket.cpp:377: > instantiated from here /usr/include/c++/4.4/bits/stl_pair.h:90: error: > invalid conversion from ‘int’ to ‘const booster::aio::buffer_impl<const > char*>::entry*’ /home/stanimir/work/web_common/third_parties/cppcms/framework/branches/refactoring/booster/./booster/system_error.h: At > global > scope: /home/stanimir/work/web_common/third_parties/cppcms/framework/branches/refactoring/booster/./booster/system_error.h:56: warning: > ‘booster::system::posix_category’ defined but not used make[2]: *** > [booster/CMakeFiles/booster.dir/lib/aio/src/socket.cpp.o] Error 1 make[1]: > *** [booster/CMakeFiles/booster.dir/all] Error 2 make: *** [all] Error > 2 Greetings, Stanimir ------------------------------------------------------------------------------ ThinkGeek > and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. > ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and > enter to win: > http://p.sf.net/sfu/thinkgeek-promo _______________________________________________ Cppcms-users > mailing list > href="mailto:Cpp...@li...">Cpp...@li... > href="https://lists.sourceforge.net/lists/listinfo/cppcms-users" target=_blank > >https://lists.sourceforge.net/lists/listinfo/cppcms-users |
From: Stanimir M. <sta...@zo...> - 2010-06-25 11:53:24
|
Hello Artyom, Congratulations for the beta release of CppCms 1.x.x! I am using the new features of gcc 4.4 and --std=c++0x Here are some compile errors from it. [ 1%] Building CXX object booster/CMakeFiles/booster.dir/lib/aio/src/socket.cpp.o In file included from /usr/include/c++/4.4/bits/stl_algobase.h:66, from /usr/include/c++/4.4/bits/char_traits.h:41, from /usr/include/c++/4.4/string:42, from /usr/include/c++/4.4/stdexcept:39, from /home/stanimir/work/web_common/third_parties/cppcms/framework/branches/refactoring/booster/./booster/function.h:11, from /home/stanimir/work/web_common/third_parties/cppcms/framework/branches/refactoring/booster/./booster/aio/socket.h:12, from /home/stanimir/work/web_common/third_parties/cppcms/framework/branches/refactoring/booster/lib/aio/src/socket.cpp:28: /usr/include/c++/4.4/bits/stl_pair.h: In constructor ‘std::pair<_T1, _T2>::pair(_U1&&, _U2&&) [with _U1 = int, _U2 = int, _T1 = const booster::aio::buffer_impl<char*>::entry*, _T2 = unsigned int]’: /home/stanimir/work/web_common/third_parties/cppcms/framework/branches/refactoring/booster/./booster/aio/buffer.h:34: instantiated from ‘std::pair<const booster::aio::buffer_impl<Pointer>::entry*, unsigned int> booster::aio::buffer_impl<Pointer>::get() const [with Pointer = char*]’ /home/stanimir/work/web_common/third_parties/cppcms/framework/branches/refactoring/booster/./booster/aio/buffer.h:77: instantiated from here /usr/include/c++/4.4/bits/stl_pair.h:90: error: invalid conversion from ‘int’ to ‘const booster::aio::buffer_impl<char*>::entry*’ /usr/include/c++/4.4/bits/stl_pair.h: In constructor ‘std::pair<_T1, _T2>::pair(_U1&&, _U2&&) [with _U1 = int, _U2 = int, _T1 = const booster::aio::buffer_impl<const char*>::entry*, _T2 = unsigned int]’: /home/stanimir/work/web_common/third_parties/cppcms/framework/branches/refactoring/booster/./booster/aio/buffer.h:34: instantiated from ‘std::pair<const booster::aio::buffer_impl<Pointer>::entry*, unsigned int> booster::aio::buffer_impl<Pointer>::get() const [with Pointer = const char*]’ /home/stanimir/work/web_common/third_parties/cppcms/framework/branches/refactoring/booster/lib/aio/src/socket.cpp:377: instantiated from here /usr/include/c++/4.4/bits/stl_pair.h:90: error: invalid conversion from ‘int’ to ‘const booster::aio::buffer_impl<const char*>::entry*’ /home/stanimir/work/web_common/third_parties/cppcms/framework/branches/refactoring/booster/./booster/system_error.h: At global scope: /home/stanimir/work/web_common/third_parties/cppcms/framework/branches/refactoring/booster/./booster/system_error.h:56: warning: ‘booster::system::posix_category’ defined but not used make[2]: *** [booster/CMakeFiles/booster.dir/lib/aio/src/socket.cpp.o] Error 1 make[1]: *** [booster/CMakeFiles/booster.dir/all] Error 2 make: *** [all] Error 2 Greetings, Stanimir |
From: Artyom <art...@ya...> - 2010-06-23 20:14:51
|
Hello all CppCMS users. The first beta version of CppCMS 1.x.x is available for download from the sourceforge <https://sourceforge.net/projects/cppcms/files/> Build instructions can be found there: <http://cppcms.sourceforge.net/wikipp/en/page/cppcms_1x_build> It includes many important features: <http://cppcms.sourceforge.net/wikipp/en/page/cppcms_1x_whats_new> Most significant ones: - Full CppCMS core rewrite that introduced: - Asynchronous programming support - Removal of 3rd part libraries from the core api. - Stable API and ABI through all major releases. - Improved Ajax support with introduction of JSON-RPC - Powerful i18n and l10n - Native Windows support including support of MSVC. - And much more... So now CppCMS beta is ready. Hopefully first release candidate version will be ready withing about a 3 month. And the first stable release is expected at the end of 2010 beginning of 2011. Best Regards, Artyom |
From: Aris S. <ari...@gm...> - 2010-06-19 17:12:12
|
> What kind of transactions? What kind of schema, etc. For the detailed description in https://community.voltdb.com/node/48 They have tpc-like benchmark (compared to MySQL and RAID DBMS) in https://community.voltdb.com/node/134 > I've read plenty good benchmarks for BDB that where... not so realistic > in real world. > > Same as before. Compare real world applications. > > P.S.: If k=0 this is quite not interesting as it does not provide D of > ACID. Maybe that's for show their performance is predictable and with k=1, the latency drop only 2ms. > > In any case... DB choice is choice specific for every singe case. Yes, you right. VoltDB is match for system with high load insert/update and not match for long time running transaction. Back to CppCMS, how if we add a regression benchmark to cppCMS like use in drizzle? https://lists.launchpad.net/drizzle-benchmark/ and http://drizzle.org/performance/ It is not real world benchmark, but I think it is useful to measure our refactoring value in CppCMS, and to detect if we made mistake in some area of refactorings we did. P.S: drizzle if a refactoring of MySQL. -I'm sorry of my bad english. Aris |
From: Artyom <art...@ya...> - 2010-06-19 15:29:47
|
> > So at this point my own > > applications - blog, wikipp run on top > > of MySQL that is quite fast. > > Yes, it is fast, I'm impressed. Some days ago, I still > doubt in > choosing who is faster between C++ and Erlang (as I found > possibility > to develop web with Erlang), and I found something > interesting that > C++ win with 19 times faster and less memory in game > benchmark. Never believe synthetic benchmarks. They are quite useless for real world applications. Compare real world applications that do same jobs. > How do you think about Erlang? I'm not familiar with it. But as it is dynamically typed language it will be always significantly slower then any statically typed one. > > Results: > > 1. k=0, no rate limit on client, measured 531,685 > transactions per second (TPS) @ 350.11ms latency > > 2. k=0, client rate limited to 500,000 TPS, measured > 490,674 TPS @ 9.43ms latency > > 3. k=1, client rate limited to 250,000 TPS, measured > 249,162 TPS @ 7.63ms latency > What kind of transactions? What kind of schema, etc. I've read plenty good benchmarks for BDB that where... not so realistic in real world. Same as before. Compare real world applications. P.S.: If k=0 this is quite not interesting as it does not provide D of ACID. In any case... DB choice is choice specific for every singe case. Artyom |
From: Aris S. <ari...@gm...> - 2010-06-19 14:32:57
|
> So at this point my own applications - blog, wikipp run on top > of MySQL that is quite fast. Yes, it is fast, I'm impressed. Some days ago, I still doubt in choosing who is faster between C++ and Erlang (as I found possibility to develop web with Erlang), and I found something interesting that C++ win with 19 times faster and less memory in game benchmark. I read about it in http://www.scribd.com/doc/29113347/Numerical-Comparison-Between-Erlang-and-C and http://shootout.alioth.debian.org/u32q/which-programming-languages-are-fastest.php?calc=calculate&gpp=on&gcc=on&java=on&javaxint=on&jruby=on How do you think about Erlang? ... ... > > Sounds interesting. But from what I see: > > - It works in memory... How does it scales when DB size grows > to hundreds of GB? VoltDB running in 64-bit environment, so we can use bigger size memory and VoltDB will partitions and distribute our data into cluster. How VoltDB distributes our data depends on how we configure "how many replica per partition" in our DB. It's named k-safety. So if or data grow, we just add new node to cluster (-add memory size). > > - Its D requires running in hot cluster so each transaction should > be committed to other cluster to provide "D". So you always need > at least 2 nodes. Yes you right. VoltDB also provide periodic snapshot into disk to ensure data persistence, but it's not required for ACID transaction. > > What happens if one crashes? How it provides D then? With k-safety, we can choose availability level we want. k=1 means, VoltDB will save copy per partition in 2 node, k=2 in 3 node, etc.. So if we have at least 2 replica, it will durable. > > Does it really faster then committing data to high quality > data-storage? > It will be faster, because, beside VoltDB doesn't suffered from disk logging, they remove locking, buffer management, and latching. They remove them because they are needed only in disk base database. From this technique VoltDB state will save 97% CPU works for "true data processing". They replace DB locking into simple parallel queue transaction(a queue per partition) to get benefit from multi-core CPU. If we have 4 core CPU, then we can partitions or data into 4 partitions in a node. You can try it with voter sample application they provided, and you will get 1000 transactions per second as a slow transaction :) I copy their benchmark bellow for you: > Hardware/Software used for the benchmark: > Servers: (6) Dell R610 (each with 2 x Xeon 5530 CPU, 48GB DDR3 @ 1333Mhz, single 1Gb NIC, CentOS 5.4 64-bit) > Client: (1) Dell R610: same specification as Servers > Switch: (1) Dell PowerConnect 6248, 48 1Gb ports > VoltDB: (6) partitions per server > Benchmark Plan: > 1. Determine how much capacity this configuration can support without k-safety (run the client without rate limiting), measure throughput and latency. > 2. Rate limit the client ~10% below the throughput of #1, measure throughput and latency. > 3. Finally, change the cluster to be k-safe (k=1) and rerun the client at 50% of the throughput from #2, measure throughput and latency. > Results: > 1. k=0, no rate limit on client, measured 531,685 transactions per second (TPS) @ 350.11ms latency > 2. k=0, client rate limited to 500,000 TPS, measured 490,674 TPS @ 9.43ms latency > 3. k=1, client rate limited to 250,000 TPS, measured 249,162 TPS @ 7.63ms latency |
From: Artyom <art...@ya...> - 2010-06-19 08:26:29
|
Hello, First of all CppCMS does not limit its users of any specific DB. Use anything you feel well. > I agree with you in choosing BerkeleyDB in CppCMS. > BerkeleyDB was used > in some database or distributed storage, like Amazon > Dynamo, Voldemort > Project, and HypergraphDB. Have you hear about voltDB? > At the beggining of CppCMS I wanted to use BDB as my primary DB backend. If fact first version of CppCMS blog was running on BDB. But I had dropped the idea of BerkeleyDB for several reasons. 1. BDB was really good for key-value storage, but in more complex cases with multiple-indexes I found that traditional SQL DB sometimes match it or even outperform it. For example, I searched for session-storage-DB and found Sqlite3 faster with two indexes then BDB. 2. BDB has scalability issues. It is not client-server solution so if you need to access same DB for writing from several nodes it becomes very complicated. 3. BDB is very hard to maintain and update its schema, much harder then SQL. 4. BDB has API is total disaster for normal programmer. Hard to understand use and maintain. Finally I decided to drop it as it didn't give me too much advantage (if at all) and had lot's of disadvantages. Of course, if the data storage you are looking for is Key-Value only then it may be good idea. I think it is worth to take a look on memcachedb for this purpose. So at this point my own applications - blog, wikipp run on top of MySQL that is quite fast. > voltDB (relational & key-value DB) use ONLY memory to > do ACID and > transactional operation, and scalable to handle ten of > thousands > transaction per second. It provide in memory scalability > that another > in memory database didn't provide. They have 50 times > performance > compared to well known commercial database. They release in > GPL v3. Sounds interesting. But from what I see: - It works in memory... How does it scales when DB size grows to hundreds of GB? - Its D requires running in hot cluster so each transaction should be committed to other cluster to provide "D". So you always need at least 2 nodes. What happens if one crashes? How it provides D then? Does it really faster then committing data to high quality data-storage? To be honest, it sounds really interesting. But as I said, CppCMS allows you to use any storage you want. Artyom |
From: Artyom <art...@ya...> - 2010-06-19 08:04:52
|
> > Can CppCMS be load balanced using cluster mechanism to > handled high > load user? What I mean here is some like horizontal > scalability which > I can add new server node to increase throughput. > The simplest way is to put it behind a kind of reverse proxy. For example, lighttpd has load balancing option: See: http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ModFastCGI So you transfer all requests to multiple FastCGI/SCGI backends for load-balancing. Several points to be aware of: - Cache - you need to work with distributed cache servers (tcp cache backend) so all network nodes would see same cache images. Of course cache-servers can be load balanced as well. So you need to deploy several cache-servers and balance the load between them (quite simple, see http://art-blog.no-ip.info/wikipp/en/page/ref_config#cache - Sessions - best use encrypted or signed cookies that allow moving session storage to client side. Or you may deploy file based session storage over NFS or use similar same cache-servers for server side session storage http://art-blog.no-ip.info/wikipp/en/page/ref_config#sessions (CppCMS 1.x.x beta still has no sessions-over-tcp backend but will be back soon) Artyom |
From: Aris S. <ari...@gm...> - 2010-06-19 04:38:02
|
Hi, I agree with you in choosing BerkeleyDB in CppCMS. BerkeleyDB was used in some database or distributed storage, like Amazon Dynamo, Voldemort Project, and HypergraphDB. Have you hear about voltDB? voltDB (relational & key-value DB) use ONLY memory to do ACID and transactional operation, and scalable to handle ten of thousands transaction per second. It provide in memory scalability that another in memory database didn't provide. They have 50 times performance compared to well known commercial database. They release in GPL v3. How do you think? regards, -Aris |