cppcms-users Mailing List for CppCMS C++ Web Framework (Page 108)
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: Joffrey R. <jof...@im...> - 2011-08-26 18:57:32
|
Thanks, the doc is helpful. Bye. Le 26/08/2011 00:22, Artyom Beilis a écrit : > > > >> That's work, but I wonder why >> there is an error when I replace "c::treeviewChild o" >> by "const c::treeviewChild& o" >> Thank you >> very much in advance for your answer. > > Of course not, it is supported syntax see: > > http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_templates_block#template > > > Artyom > > > ------------------------------------------------------------------------------ > EMC VNX: the world's simplest storage, starting under $10K > The only unified storage solution that offers unified management > Up to 160% more powerful than alternatives and 25% more efficient. > Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users |
From: Artyom B. <art...@ya...> - 2011-08-26 14:28:01
|
Hi, Why wouldn't you just use reverse using Compare map key? struct mycomp { bool operator(int x,int y) { return x > y; } }; std::map<int,std::string,mycomp> revmap; But generally it is not a problem to add such things to template system. I'll take a look on it. (If you can send me a patch it will be even better you need just to add some kind reverse option to foreach and replace begin(), end() with rbegin() and rend()) Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.sf.net/ CppDB - C++ SQL Connectivity: http://cppcms.sf.net/sql/cppdb/ ----- Original Message ----- > From: Allan SIMON <all...@su...> > To: cpp...@li... > Cc: > Sent: Friday, August 26, 2011 4:13 PM > Subject: [Cppcms-users] [template request] foreach reverse > > Hi, > > A "simple" request, I would like to have the possibility to use > reverse > iterator inside template. > As for example on tatoeba I have a map of > <number_of_sentences,language>, and I want > to display the languages which the language with most sentences first. > > thanks, > > Allan > > > ------------------------------------------------------------------------------ > EMC VNX: the world's simplest storage, starting under $10K > The only unified storage solution that offers unified management > Up to 160% more powerful than alternatives and 25% more efficient. > Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
From: Allan S. <all...@su...> - 2011-08-26 13:14:23
|
Hi, A "simple" request, I would like to have the possibility to use reverse iterator inside template. As for example on tatoeba I have a map of <number_of_sentences,language>, and I want to display the languages which the language with most sentences first. thanks, Allan |
From: Artyom B. <art...@ya...> - 2011-08-26 10:22:49
|
> That's work, but I wonder why > there is an error when I replace "c::treeviewChild o" > by "const c::treeviewChild& o" > Thank you > very much in advance for your answer. Of course not, it is supported syntax see: http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_templates_block#template Artyom |
From: Joffrey R. <jof...@im...> - 2011-08-26 04:15:24
|
Hello Everybody, My English is approximate, I apologize for this inconvenience. A few words to tell you that "CPPCMS" is a really good framework. In my project, I use a "template" with recursive function for generating XML. > <% c++ #include "project_views/sequences_tree.hpp" %> > <% c++ namespace c= project_views; %> > <% skin%> > <% view sequences_tree uses project_views::sequences_tree %> > <% template render() %><?xml version="1.0" encoding="UTF-8"?> > <folder id="<%= parent_id %>"> > <% foreach obj in currentChildren%> > > <% item%> > > <% if ( static_cast<char>(obj.type_flags & c::treeviewChild::FLAG_FOLDER) == c::treeviewChild::FLAG_FOLDER ) %> > <folder pos="<%= obj.position %>" id="<%= obj.object_id %>" name="<%= obj.object_name %>"><% include sequences_tree::recursive_render(obj) %></folder> > <% elif( static_cast<char>(obj.type_flags & c::treeviewChild::FLAG_SEQUENCE) == c::treeviewChild::FLAG_SEQUENCE ) %> > <sequence pos="<%= obj.position %>" guid="<%= obj.object_guid %>" id="<%= obj.object_id %>" name="<%= obj.object_name %>" /> > <% end%> > > <% end%> > > <% end%> > </folder> > <% end template%> > * > <% template recursive_render( c::treeviewChild o) %>* > <% foreach obj in o.subChildren %> > > <% item%> > > <% if ( static_cast<char>(obj.type_flags & c::treeviewChild::FLAG_FOLDER) == c::treeviewChild::FLAG_FOLDER ) %> > <folder pos="<%= obj.position %>" id="<%= obj.object_id %>" name="<%= obj.object_name %>"><% include sequences_tree::recursive_render(obj) %></folder> > <% elif( static_cast<char>(obj.type_flags & c::treeviewChild::FLAG_SEQUENCE) == c::treeviewChild::FLAG_SEQUENCE ) %> > <sequence pos="<%= obj.position %>" guid="<%= obj.object_guid %>" id="<%= obj.object_id %>" name="<%= obj.object_name %>" /> > <% end%> > > <% end%> > > <% end%> > <% end template%> > > <% end view%> > <% end skin%> That's work, but I wonder why there is an error when I replace *"c::treeviewChild **o**"* by *"**const c::treeviewChild& o**"* Thank you very much in advance for your answer. Joffrey |
From: Klaim - J. L. <mj...@gm...> - 2011-08-24 13:53:15
|
Hi, For a web server implementation community, I think a useful demonstration would have been far more efficient than an irc channel or a mailing list system. Why not build a simple community tool over CPPCMS? Two possibilities that are NOT mutually explusive : 1. a chat system as dynamic web page : see http://chat.stackoverflow.com/ as very good and advanced example. Advantage of all those of a chat, including quick chit-chat, fast replies, etc., PLUS persistence of the discussion. I think a very simple and already useful implementation can be done quickly. However, I'm too busy with other projects to work on it. 2. a forum engine. Every language used in web dev. have it's set of forum engines, but c++. Forums have some advantages over mailing list, the first one being ease of reading, no storing in your personal accoun etc. It would be very demonstrative if the CPPCMS community followed the "eat your own dog food" mentality started with the wiki and blog engines implementations. My 2 cents Joël Lamotte |
From: Alec T. <ale...@gm...> - 2011-08-24 12:23:52
|
IRC is a good idea because: • Waiting for an email reply usually takes too long • When your doing something small, it's rather annoying to have to write a new email for each little issue you come up with • Especially when you're installing CppCMS for the first time, resolving those errors ASAP is extremely important On Wed, Aug 24, 2011 at 7:05 PM, augustin <aug...@ov...> wrote: > On Wednesday 24 August 2011 04:59:05 pm Artyom Beilis wrote: >> There are several problems with IRC Chat... > > > We posted our replies at the same time. :) > I'm glad to see that our point lists are very similar. > > Anyway: thank you for your continued support of CPPCMS and CPPCMS users! > > Blessings, > > Augustin. > > > > > -- > Friends: http://www.reuniting.info/ > My projects: > http://astralcity.org/ http://3enjeux.overshoot.tv/ http://linux.overshoot.tv/ > http://overshoot.tv/ http://charityware.info/ http://masquilier.org/ > http://openteacher.info/ http://minguo.info/ > http://www.wechange.org/ http://searching911.info/ > > > > > > > > > > > > > . > > ------------------------------------------------------------------------------ > EMC VNX: the world's simplest storage, starting under $10K > The only unified storage solution that offers unified management > Up to 160% more powerful than alternatives and 25% more efficient. > Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
From: augustin <aug...@ov...> - 2011-08-24 09:05:48
|
On Wednesday 24 August 2011 04:59:05 pm Artyom Beilis wrote: > There are several problems with IRC Chat... We posted our replies at the same time. :) I'm glad to see that our point lists are very similar. Anyway: thank you for your continued support of CPPCMS and CPPCMS users! Blessings, Augustin. -- Friends: http://www.reuniting.info/ My projects: http://astralcity.org/ http://3enjeux.overshoot.tv/ http://linux.overshoot.tv/ http://overshoot.tv/ http://charityware.info/ http://masquilier.org/ http://openteacher.info/ http://minguo.info/ http://www.wechange.org/ http://searching911.info/ . |
From: augustin <aug...@ov...> - 2011-08-24 09:03:18
|
On Wednesday 24 August 2011 05:45:43 am Daniel Rios wrote: > Hello there! > It just came to my mind, what if we create an IRC chat room, for all > cppmcms users?? The pros will be: - Fast feedback with new users who are > looking for simple basic questions. Lets say installation and server > configuration.- Start a Cppcms users community. Sounds interesting , what > do you think? > I think it's a bad idea. You didn't list the cons: 1- Fast feedback? Feedback is currently almost 100% provided by Artyom, and he is usually fast. He won't be any faster on IRC. 2- One more channel to monitor to stay abreast of CPPCMS development: no thanks! 3- Do we really need to register to Facebook (Yuck!) or yet other places to stay with the community? 4- Would there be automatic IRC chat logs publicly available?? I keep a local copy of the mailing list archives, which is very handy when I need to look back on something that was already discussed. There are also nice, publicly available mailing list archives. 5- As long as people don't get into the habit of feeding back the information into the wiki, the IRC channel would be a memory hole where useful information will get lost.... and the same questions will have to be asked all over again, thereby increasing Artyom's workload. 6- I'm glad that the CPPCMS community is growing, but it is not yet very big: barely a dozen regular posters on the mailing list. It doesn't feel crowed, yet! 7- Which time zone? What time? IRC is interesting when you want to have a live chat. Personally, I live in the (free and democratic) Republic of China (=Taiwan). There is at least one or two friends from the other China (the People's Republic of China, ruled by the Chinese Communist Party). Artyom is from the Middle East. There are certainly other members from elsewhere in Europe or the Americas. So, at what time do we meet??? In that case, IRC actually reduces the probabilities of getting feedback. The mailing list allows everyone to read the messages and reply at a time of their own choosing. 8- Have you tried pasting whole blocks of code on IRC? In a mailing list, you can easily post code and comment on it in the same email. With IRC, one has to rely on yet another third party service to post code. 9- Paradigm Shift's comment on this thread is interesting. His position is similar to mine (see 5 above), regarding the proper use of the wiki. If I could be confident that the askers would systematically feedback the answers into the wiki, I would feel differently about this proposal. But I very much doubt it will happen, and I strongly feel the CPPCMS community has much to lose with exclusive IRC chats. Having said that, the internet is a free place: go ahead if you wish. I personally hope Artyom will stay here, where he's can be followed much more easily. -- Friends: http://www.reuniting.info/ My projects: http://astralcity.org/ http://3enjeux.overshoot.tv/ http://linux.overshoot.tv/ http://overshoot.tv/ http://charityware.info/ http://masquilier.org/ http://openteacher.info/ http://minguo.info/ http://www.wechange.org/ http://searching911.info/ . |
From: Artyom B. <art...@ya...> - 2011-08-24 08:59:13
|
Hello CppCMS Users, There are several problems with IRC Chat... 1. Users located in different time zones all over the world from the West and USA to East China, So it would be not always easy. 2. When you write an e-mail you usually make your statements and problem description much clear, bring some output samples maybe some logs. Same for the answers, they are usually deeper and wider. This does not happen in the chat. 3. There are much more people who can view an e-mail, and answer it rather then people who on-line in chat rooms. It can be done off line even with slightly bigger delay. 4. The mailing list is recorded at: http://news.gmane.org/gmane.comp.lib.cppcms.user Which makes it easier to search for the questions and answers, it is also monitored by google making it easier to solve the problems. In any case if somebody whats to open an IRC channel he is welcome however I think mailing list is better because it allows more people to be in the have same conversation and even just learn by reading even without asking. So I just think that e-mail list is better for community communication is just more productive while "almost" real time reply actually work well with e-mails as well. In any case if there are frequently asked question, they should be in wiki :-) My $0.02 Artyom Beilis |
From: Paradigm S. <pd...@gm...> - 2011-08-24 08:11:27
|
It sounds interesting. It would be nice to have an initiative to post the answers to such questions back to the main wiki though. That is, http://art-blog.no-ip.info/wikipp/en/page/main Perhaps we could have a loose convention that the person who asked the question should take ownership of posting it back on the main wiki? One source of documentation seems ideal. On 08/24/2011 12:45 AM, Daniel Rios wrote: > Hello there! > > It just came to my mind, what if we create an IRC chat room, for all > cppmcms users?? The pros will be: > > - Fast feedback with new users who are looking for simple basic > questions. Lets say installation and server configuration. > - Start a Cppcms users community. > > Sounds interesting , what do you think? > > Daniel > > > > ------------------------------------------------------------------------------ > EMC VNX: the world's simplest storage, starting under $10K > The only unified storage solution that offers unified management > Up to 160% more powerful than alternatives and 25% more efficient. > Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev > > > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users |
From: Alec T. <ale...@gm...> - 2011-08-24 07:48:11
|
Probably put one on FreeNode (Wt has one there). Remember to register with ChanServ! 2011/8/24 kpeo <sla...@ya...>: > I think it sounds interesting too ) Already have a page in facebook: > http://www.facebook.com/pages/CppCMS/112412328774857 > 24.08.2011, 01:45, "Daniel Rios" <dan...@li...>: > > Hello there! > It just came to my mind, what if we create an IRC chat room, for all cppmcms > users?? The pros will be: > - Fast feedback with new users who are looking for simple basic questions. > Lets say installation and server configuration. > - Start a Cppcms users community. > Sounds interesting , what do you think? > Daniel > > ------------------------------------------------------------------------------ > EMC VNX: the world's simplest storage, starting under $10K > The only unified storage solution that offers unified management > Up to 160% more powerful than alternatives and 25% more efficient. > Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev > > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > ------------------------------------------------------------------------------ > EMC VNX: the world's simplest storage, starting under $10K > The only unified storage solution that offers unified management > Up to 160% more powerful than alternatives and 25% more efficient. > Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > |
From: kpeo <sla...@ya...> - 2011-08-24 06:16:41
|
<div>I think it sounds interesting too ) Already have a page in facebook:</div><div>http://www.facebook.com/pages/CppCMS/112412328774857</div><div>24.08.2011, 01:45, "Daniel Rios" <dan...@li...>:</div><blockquote><div dir="ltr">Hello there!<div>It just came to my mind, what if we create an IRC chat room, for all cppmcms users?? The pros will be:</div><div>- Fast feedback with new users who are looking for simple basic questions. Lets say installation and server configuration.</div><div>- Start a Cppcms users community.</div><div>Sounds interesting , what do you think?</div><div>Daniel</div></div><p>------------------------------------------------------------------------------<br />EMC VNX: the world's simplest storage, starting under $10K<br />The only unified storage solution that offers unified management <br />Up to 160% more powerful than alternatives and 25% more efficient. <br />Guaranteed. <a href="http://p.sf.net/sfu/emc-vnx-dev2dev">http://p.sf.net/sfu/emc-vnx-dev2dev</a></p><p>_______________________________________________<br />Cppcms-users mailing list<br /><a href="mailto:Cpp...@li...">Cpp...@li...</a><br /><a href="https://lists.sourceforge.net/lists/listinfo/cppcms-users">https://lists.sourceforge.net/lists/listinfo/cppcms-users</a></p></blockquote> |
From: Daniel R. <dan...@li...> - 2011-08-23 21:45:51
|
Hello there! It just came to my mind, what if we create an IRC chat room, for all cppmcms users?? The pros will be: - Fast feedback with new users who are looking for simple basic questions. Lets say installation and server configuration.- Start a Cppcms users community. Sounds interesting , what do you think? Daniel |
From: Vizcayno T. <viz...@gm...> - 2011-08-22 16:47:12
|
Artyom, many thanks for your kindly help, my program is 20 seconds faster than the C#, although I did not make optimization works on C#. I can see that C++ is not fast automatically, much work is needed in the level of compiler and code, at least in the Windows world. Also, The faster I want to be my C++ code, closer I get to C and closer I break some rules; and in spite of the speed reached, I find this frustrating and unfair. I like to use the cppDB lilbrary because it is very easy to use, elegant and very fast. Regards. |
From: 李明 <lim...@gm...> - 2011-08-22 08:33:23
|
Great reply. Thank you. On Mon, Aug 22, 2011 at 4:27 PM, Artyom Beilis <art...@ya...> wrote: > > > > >I didn't work on posix platform. I use microsoft vs to build it and use > apache in windows to run it. > > > > > >This is what I did: > >1. Added a (*(char *) 0) = 0 in the hello:main() function. This should > make process crash when user try to access the URL. > >2. Configure hello.exe run as fastcgi mode and start the it as hello.exe > -c config.js > >3. Configure apache to run hello.exe independently( > http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_tut_web_server_config#Apache..FastCGI..Independent.start > ) > >4. Try to access http://localhost:8080/hello > > > > > >Obviously hello.exe crash and exit. Maybe I ran it as wrong way but I > don't fully understand how to run it as multi-thread. > > > > Obviously... The hello runs as independent FastCGI Server and if it crashes > it crashes > like any other program. I though you told me that "web server" crashes, but > hello.exe > is not web server. > > > If you want hello.exe to be restarted you need to do it on your own > (at least on Windows that does not support fork() system call). > Simple bat script can do this for you. > > > You can also configure the web server to control the life time of the > "hello.exe", > start it, shut it down or restart. > > This is what described in the link below. > > > > http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_tut_web_server_config#Apache..FastCGI..Start.by.Web.Server > > Thus apache would restart CppCMS service when it crashes for you. > > > AFAIK there are users that run CppCMS this on Windows with Apache that is > controlled by Apache > and I even get patches for graceful shutdown by apache support. > > See this thread: > > http://thread.gmane.org/gmane.comp.lib.cppcms.user/551 > > > Artyom > > > ------------------------------------------------------------------------------ > uberSVN's rich system and user administration capabilities and model > configuration take the hassle out of deploying and managing Subversion and > the tools developers use with it. Learn more about uberSVN and get a free > download at: http://p.sf.net/sfu/wandisco-dev2dev > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
From: Cristian O. <one...@gm...> - 2011-08-22 08:33:01
|
2011/8/22 Artyom Beilis <art...@ya...>: > >> >>I didn't work on posix platform. I use microsoft vs to build it and use apache in windows to run it. >> >> >>This is what I did: >>1. Added a (*(char *) 0) = 0 in the hello:main() function. This should make process crash when user try to access the URL. >>2. Configure hello.exe run as fastcgi mode and start the it as hello.exe -c config.js >>3. Configure apache to run hello.exe independently( http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_tut_web_server_config#Apache..FastCGI..Independent.start ) >>4. Try to access http://localhost:8080/hello >> >> >>Obviously hello.exe crash and exit. Maybe I ran it as wrong way but I don't fully understand how to run it as multi-thread. >> > > Obviously... The hello runs as independent FastCGI Server and if it crashes it crashes > like any other program. I though you told me that "web server" crashes, but hello.exe > is not web server. > > > If you want hello.exe to be restarted you need to do it on your own > (at least on Windows that does not support fork() system call). > Simple bat script can do this for you. > > > You can also configure the web server to control the life time of the "hello.exe", > start it, shut it down or restart. > > This is what described in the link below. > > > http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_tut_web_server_config#Apache..FastCGI..Start.by.Web.Server > > Thus apache would restart CppCMS service when it crashes for you. I can confirm this behavior. Regards, Cristian > > AFAIK there are users that run CppCMS this on Windows with Apache that is controlled by Apache > and I even get patches for graceful shutdown by apache support. > > See this thread: > > http://thread.gmane.org/gmane.comp.lib.cppcms.user/551 > > > Artyom > > ------------------------------------------------------------------------------ > uberSVN's rich system and user administration capabilities and model > configuration take the hassle out of deploying and managing Subversion and > the tools developers use with it. Learn more about uberSVN and get a free > download at: http://p.sf.net/sfu/wandisco-dev2dev > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
From: Artyom B. <art...@ya...> - 2011-08-22 08:31:56
|
> From: Abhishek Kaushik <abh...@gm...> > > Is it possible that cppcms internal webserver can > listen on hosts other than localhosts? > Yes: http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_config#service.ip Have you tried "0.0.0.0" ? I had referenced to this page: http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_config several times in our previous conversations. I think it should be clear enough. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.sf.net/ CppDB - C++ SQL Connectivity: http://cppcms.sf.net/sql/cppdb/ |
From: Artyom B. <art...@ya...> - 2011-08-22 08:27:45
|
> >I didn't work on posix platform. I use microsoft vs to build it and use apache in windows to run it. > > >This is what I did: >1. Added a (*(char *) 0) = 0 in the hello:main() function. This should make process crash when user try to access the URL. >2. Configure hello.exe run as fastcgi mode and start the it as hello.exe -c config.js >3. Configure apache to run hello.exe independently( http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_tut_web_server_config#Apache..FastCGI..Independent.start ) >4. Try to access http://localhost:8080/hello > > >Obviously hello.exe crash and exit. Maybe I ran it as wrong way but I don't fully understand how to run it as multi-thread. > Obviously... The hello runs as independent FastCGI Server and if it crashes it crashes like any other program. I though you told me that "web server" crashes, but hello.exe is not web server. If you want hello.exe to be restarted you need to do it on your own (at least on Windows that does not support fork() system call). Simple bat script can do this for you. You can also configure the web server to control the life time of the "hello.exe", start it, shut it down or restart. This is what described in the link below. http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_tut_web_server_config#Apache..FastCGI..Start.by.Web.Server Thus apache would restart CppCMS service when it crashes for you. AFAIK there are users that run CppCMS this on Windows with Apache that is controlled by Apache and I even get patches for graceful shutdown by apache support. See this thread: http://thread.gmane.org/gmane.comp.lib.cppcms.user/551 Artyom |
From: 李明 <lim...@gm...> - 2011-08-22 01:27:18
|
I didn't work on posix platform. I use microsoft vs to build it and use apache in windows to run it. This is what I did: 1. Added a (*(char *) 0) = 0 in the hello:main() function. This should make process crash when user try to access the URL. 2. Configure hello.exe run as fastcgi mode and start the it as hello.exe -c config.js 3. Configure apache to run hello.exe independently( http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_tut_web_server_config#Apache..FastCGI..Independent.start ) 4. Try to access http://localhost:8080/hello Obviously hello.exe crash and exit. Maybe I ran it as wrong way but I don't fully understand how to run it as multi-thread. On Sat, Aug 20, 2011 at 6:18 PM, Artyom Beilis <art...@ya...> wrote: > >Subject: [Cppcms-users] How to prevent server goes down when crash? > > > > > > >I used Apache to configure an external application server with fastcgi > mode in Windows. > > > > > > Fastcgi is process isolation, so I try to make my > > application based on cppcms crash to see how will happen > > to server, but it went down when crash happen. How to prevent > > this happen? Do I need to do some configuration to enable multi thread? > > > > > > To be honest I don't understand the question? How crash of cppcms programs > crashes the web server? CppCMS runs different process, maximum > you should get 500 HTTP Error. > > Another thing, on POSIX platforms you can set "service.worker_processes" > to 1 and it would allow CppCMS to control its own lifetime and restart > the process when it goes down automatically. > > > http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_config#service.worker_processes > > Artyom > > > > > > > > > > > > > >Thanks. > > >------------------------------------------------------------------------------ > >Get a FREE DOWNLOAD! and learn more about uberSVN rich system, > >user administration capabilities and model configuration. Take > >the hassle out of deploying and managing Subversion and the > >tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2 > >_______________________________________________ > >Cppcms-users mailing list > >Cpp...@li... > >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > > > > > > > ------------------------------------------------------------------------------ > Get a FREE DOWNLOAD! and learn more about uberSVN rich system, > user administration capabilities and model configuration. Take > the hassle out of deploying and managing Subversion and the > tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2 > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
From: Abhishek K. <abh...@gm...> - 2011-08-21 16:13:14
|
Is it possible that cppcms internal webserver can listen on hosts other than localhosts? for example: if I run my app: ./mb -c config.js what I see is I am just able to communicate to it by 127.0.0.1:8080/mb localhost:8080/mb its not accessible by any other hosts on which its running, like 202.123.203.123:8080/mb even if I add the entry into config.js under service: "host" : "202.123.203.123" // or any other domain entries its still the same, that the internal cppcms app is just accessible by local only. Is it built into cppcms by design? Or I am having some other configuration issue? For some testings, I was trying to access the cppcms app directly, rather than configuring it directly on nginx. Please let me know. Best Regards, Abhishek Kaushik |
From: Abhishek K. <abh...@gm...> - 2011-08-21 07:42:30
|
Wow!! Hey Artyom, By configuring the worker_thread options, my applications run successfully... first I set it to 1, it started and then 2, it still started then 4, it still started and then 5, it still works. but don't why, it doesn't starts without worker_thread options, this is the case with message board application.. Anyway, Really awesome now, I can proceed with my further work.. Let me know if I can provide you any more infos. Heartfully thankful for your guidance artyom :) Abhishek Kaushik <abhisheklinux@...> writes: |
From: Abhishek K. <abh...@gm...> - 2011-08-21 07:24:20
|
Hi Artyom, Thanks for detailing regarding the reasons for threads to fail to start, it's helpful for me take betters options. The detailed test log can be found at: http://enabledsoft.com/cppcms/cppcms-0.99.9/Testing/Temporary/LastTest.log I have just disabled ICU. Regards, |
From: Artyom B. <art...@ya...> - 2011-08-21 07:14:50
|
Several things: cppdb::session sql("sqlite3:db=db.db; Page Size=65536; Cache Size=65536; Synchronous=Off; Journal Mode=Off;"); These options " Page Size=65536; Cache Size=65536; Synchronous=Off; Journal Mode=Off;" Have no effect with CppDB, see: http://art-blog.no-ip.info/sql/cppdb/sqlite3.html If you want to set these options you need to use Sqlite PRAGMA statements: sql << "PRAGMA cache_size =65536" << cppdb::exec; sql << "PRAGMA synchronous = OFF" << cppdb::exec; See: http://www.sqlite.org/pragma.html Now if you only want to populate the new DB then "PRAGMA synchronous = OFF" if fine but don't turn off journal as actually transaction can't be done without journal so it is better to use journal and transaction. Also bulk inserts with sqlite3 should be very fast when you do it in a single transaction even with synchronization. Few additional points: 1. The MSVC's std::fstream implementation is quite bad, I've seen that fopen API performs sometimes much faster. So if performance is critical I'd suggest to use FILE/fopen, in any case you don't even use any specific istream features like splitting the file by lines and so on. 2. This is bad code: string* f = new string[10]; use std::vector<std::string> f(10); Or even std::string f[10]; Especially when you forget to call delete [] f > I'm breaking my head trying to figure out the reason of this difference in sizes; may be you know possible reasons? It is possible due to fact that some integer columns are filled up like strings. Sqlite can happily store any value in any column so this may explain the difference. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.sf.net/ CppDB - C++ SQL Connectivity: http://cppcms.sf.net/sql/cppdb/ >________________________________ >From: Vizcayno Tamparantan <viz...@gm...> >To: cppcms-users <cpp...@li...> >Sent: Sunday, August 21, 2011 1:19 AM >Subject: [Cppcms-users] Fast bulk-insert into SQLITE3 using cppDB > > >**************** This replace to previous post because the display format is ugly *************************** > >Hello: >I show you the main part of a C++ which loads a 540MB delimited ("|") text file into an SQLite3 db using last cppDB (trunk 1875): >int main () >{ > Timer t; > cout << t.ShowStart() << endl; > > ifstream input("in1.txt"); > const size_t size = 512 * 1024; > char buffer[size]; > string* f = new string[10]; > > sql << "DROP TABLE IF EXISTS ttb" << cppdb::exec; > sql << "CREATE TABLE ttb (alm varchar(4), alm2 varchar(4), \ > mat varchar(18), ser varchar(20), fac varchar(18), almttb varchar(10), \ > cant integer, sts varchar(1), ser_2_20 varchar(20), rowid_sap integer, \ > stsmat varchar);" << cppdb::exec; > > cppdb::transaction guard(sql); > cppdb::statement stat; > stat = sql << > "INSERT INTO ttb(alm,alm2,mat,ser,fac,almttb,cant,sts,ser_2_20,rowid_sap,stsmat) " > "VALUES(?,?,?,?,?,?,?,?,?,?,?)"; > > int cont = 0; > int regLei = 0; > while (input) // Read a text file with fields separated by "|" > { > input.read(buffer, size); > size_t readBytes = input.gcount(); > for (size_t i = 0; i < readBytes; i++) > { > if (*(buffer+i) == '\n') // || *(buffer+i) == '\r') > { > if (regLei++ > 0) // Don't save first line, it's header > { > stat.reset(); > stat.bind(f[0]); > stat.bind(f[1]); > stat.bind(f[2]); > stat.bind(f[3]); > stat.bind(f[4]); > stat.bind(f[5]); > stat.bind(f[7]); > stat.bind_null(); > stat.bind_null(); > stat.bind_null(); > stat.bind(f[9]); > stat.exec(); > } > > for (int j=0;j<10;f[j++]=""); // Reset string arrays of fields > cont = 0; > } > else > if (*(buffer+i) != '|') > f[cont] += *(buffer+i); // Build each field char by char > else > cont++; // Build data on next string of the array f > } > } > guard.commit(); > > t.Stop(); > cout << t.ShowEnd() << endl; > cout << "Executed in: " << t.ElapsedSeconds() << " seconds." << endl; > > input.close(); > return 0; >} > > >Please, be patient with my C++ style. There is a part of the code that is trying to read the file as fast as possible (using a buffer), but I can't get to save the data into Sqlite at the same speed that I read. >In the code you can see and attemp to accelerate the writing but, I am not sure if it's working because the journal file continues generating data, I am sure I am doing something wrong: > cppdb::session sql("sqite3:db=db.db; Page Size=65536; Cache Size=65536; Synchronous=Off; Journal Mode=Off;"); > >My questions are: >1) What is bad in the cppdb::session syntax I wrote? >2) Checking the code, can you find a way to speed-up the writing of the data into the SQLite DB (I am sure that the reading is very fast), the command compilation in VS2010 is: cl /EHsc /Ox /Ob2 /Oi for both, the cppDB and my C++ program; i'm under windows 7 and program generation is for 32 bits. >3) I also wrote a program in C# and it is always 10-15 seconds faster than my C++ and, as a curiosity, the file size of the database running C# is 386MB and after running the C++ the result size is 408MB (one possible reason because C++ is slower than my C# program); the records and fields generated are the same in both databases and > >Many thanks for your attention. > >------------------------------------------------------------------------------ >Get a FREE DOWNLOAD! and learn more about uberSVN rich system, >user administration capabilities and model configuration. Take >the hassle out of deploying and managing Subversion and the >tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2 >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |
From: Vizcayno T. <viz...@gm...> - 2011-08-20 22:19:41
|
**************** This replace to previous post because the display format is ugly *************************** Hello: I show you the main part of a C++ which loads a 540MB delimited ("|") text file into an SQLite3 db using last cppDB (trunk 1875): int main () { Timer t; cout << t.ShowStart() << endl; ifstream input("in1.txt"); const size_t size = 512 * 1024; char buffer[size]; string* f = new string[10]; cppdb::session sql("sqlite3:db=db.db; Page Size=65536; Cache Size=65536; Synchronous=Off; Journal Mode=Off;"); sql << "DROP TABLE IF EXISTS ttb" << cppdb::exec; sql << "CREATE TABLE ttb (alm varchar(4), alm2 varchar(4), \ mat varchar(18), ser varchar(20), fac varchar(18), almttb varchar(10), \ cant integer, sts varchar(1), ser_2_20 varchar(20), rowid_sap integer, \ stsmat varchar);" << cppdb::exec; cppdb::transaction guard(sql); cppdb::statement stat; stat = sql << "INSERT INTO ttb(alm,alm2,mat,ser,fac,almttb,cant,sts,ser_2_20,rowid_sap,stsmat) " "VALUES(?,?,?,?,?,?,?,?,?,?,?)"; int cont = 0; int regLei = 0; while (input) // Read a text file with fields separated by "|" { input.read(buffer, size); size_t readBytes = input.gcount(); for (size_t i = 0; i < readBytes; i++) { if (*(buffer+i) == '\n') // || *(buffer+i) == '\r') { if (regLei++ > 0) // Don't save first line, it's header { stat.reset(); stat.bind(f[0]); stat.bind(f[1]); stat.bind(f[2]); stat.bind(f[3]); stat.bind(f[4]); stat.bind(f[5]); stat.bind(f[7]); stat.bind_null(); stat.bind_null(); stat.bind_null(); stat.bind(f[9]); stat.exec(); } for (int j=0;j<10;f[j++]=""); // Reset string arrays of fields cont = 0; } else if (*(buffer+i) != '|') f[cont] += *(buffer+i); // Build each field char by char else cont++; // Build data on next string of the array f } } guard.commit(); t.Stop(); cout << t.ShowEnd() << endl; cout << "Executed in: " << t.ElapsedSeconds() << " seconds." << endl; input.close(); return 0; } Please, be patient with my C++ style. There is a part of the code that is trying to read the file as fast as possible (using a buffer), but I can't get to save the data into Sqlite at the same speed that I read. In the code you can see and attemp to accelerate the writing but, I am not sure if it's working because the journal file continues generating data, I am sure I am doing something wrong: cppdb::session sql("sqite3:db=db.db; Page Size=65536; Cache Size=65536; Synchronous=Off; Journal Mode=Off;"); My questions are: 1) What is bad in the cppdb::session syntax I wrote? 2) Checking the code, can you find a way to speed-up the writing of the data into the SQLite DB (I am sure that the reading is very fast), the command compilation in VS2010 is: cl /EHsc /Ox /Ob2 /Oi for both, the cppDB and my C++ program; i'm under windows 7 and program generation is for 32 bits. 3) I also wrote a program in C# and it is always 10-15 seconds faster than my C++ and, as a curiosity, the file size of the database running C# is 386MB and after running the C++ the result size is 408MB (one possible reason because C++ is slower than my C# program); the records and fields generated are the same in both databases and I'm breaking my head trying to figure out the reason of this difference in sizes; may be you know possible reasons? Many thanks for your attention. |