cppcms-users Mailing List for CppCMS C++ Web Framework (Page 24)
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: Marius C. <mf...@gm...> - 2015-12-26 00:44:29
|
CppCMS 1.1 Progress report (scoop 1st beta is coming...) and the rest of them were all in the spam folder as many of your emails from your yahoo account sent to my gmail. I had to create a special filter to send them to my inbox ( see how much I value your emails, lol ). It kept complaining that your emails seem to not come from yahoo servers themselves or something like that. Since I created the filters it just says that it didn't send them to spam because I asked it not to. On Sat, Dec 26, 2015 at 2:32 AM, redred77 <red...@gm...> wrote: > I received "CppCMS 1.1 Progress report". Well it was found from spam > folder. > > Other mails you mentioned are not found even in spam folder. Gmail's spam > folder is deleted automatically in certain period but I don't think that > caused the problem since your mails are not old enough. > > I see your message from other people's reply mail but not from your original > message time to time. > > As you can see, I'm using gmail. > > Thanks. > > Hello, > > I'm Artyom Beilis the project maintainer and I'm sending this mail from my > different e-mail account - on GMail (my primary account is on Yahoo) > > I have strong suspicions that some of my e-mails go directly to spam folder. > > Can you please check if some of these e-mails were not received: > > CppCMS 1.1 Progress report : > https://sourceforge.net/p/cppcms/mailman/message/34718381/ > Liggin (logging - my reply) > https://sourceforge.net/p/cppcms/mailman/message/34668147/ > Session Sharing with Non-CppCMS technologies: > https://sourceforge.net/p/cppcms/mailman/message/34623273/ > CppCMS interoperability with other web frameworks - which ones? > https://sourceforge.net/p/cppcms/mailman/message/34622438/ > > I noticed that some does not receive my response or see it as quite of some > other users posting to the list. > > Can you please check if you got the original e-mails to the list. > > Thank You, > > Artyom Beilis > > ------------------------------------------------------------------------------ > > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
From: redred77 <red...@gm...> - 2015-12-26 00:32:19
|
I received "CppCMS 1.1 Progress report". Well it was found from spam folder. Other mails you mentioned are not found even in spam folder. Gmail's spam folder is deleted automatically in certain period but I don't think that caused the problem since your mails are not old enough. I see your message from other people's reply mail but not from your original message time to time. As you can see, I'm using gmail. Thanks. Hello, I'm Artyom Beilis the project maintainer and I'm sending this mail from my different e-mail account - on GMail (my primary account is on Yahoo) I have strong suspicions that some of my e-mails go directly to spam folder. Can you please check if some of these e-mails were not received: CppCMS 1.1 Progress report : https://sourceforge.net/p/cppcms/mailman/message/34718381/ Liggin (logging - my reply) https://sourceforge.net/p/cppcms/mailman/message/34668147/ Session Sharing with Non-CppCMS technologies: https://sourceforge.net/p/cppcms/mailman/message/34623273/ CppCMS interoperability with other web frameworks - which ones? https://sourceforge.net/p/cppcms/mailman/message/34622438/ I noticed that some does not receive my response or see it as quite of some other users posting to the list. Can you please check if you got the original e-mails to the list. Thank You, Artyom Beilis ------------------------------------------------------------------------------ _______________________________________________ Cppcms-users mailing list Cpp...@li... https://lists.sourceforge.net/lists/listinfo/cppcms-users |
From: Artyom B. <art...@gm...> - 2015-12-25 18:10:59
|
Hello, I'm Artyom Beilis the project maintainer and I'm sending this mail from my different e-mail account - on GMail (my primary account is on Yahoo) I have strong suspicions that some of my e-mails go directly to spam folder. Can you please check if some of these e-mails were not received: CppCMS 1.1 Progress report : https://sourceforge.net/p/cppcms/mailman/message/34718381/ Liggin (logging - my reply) https://sourceforge.net/p/cppcms/mailman/message/34668147/ Session Sharing with Non-CppCMS technologies: https://sourceforge.net/p/cppcms/mailman/message/34623273/ CppCMS interoperability with other web frameworks - which ones? https://sourceforge.net/p/cppcms/mailman/message/34622438/ I noticed that some does not receive my response or see it as quite of some other users posting to the list. Can you please check if you got the original e-mails to the list. Thank You, Artyom Beilis |
From: redred77 <red...@gm...> - 2015-12-25 00:08:12
|
Yeah, I used browser based expiration. It lost session before browser is closed. I opened a new ticket for it. http://sourceforge.net/p/cppcms/bugs/143/ Great to hear new beta release anyway! (I aknowledged this morning. Recent mail was in spam folder) Very interesting improvements. Awesome works! Happy Christmas! 2015-12-25 5:59 GMT+09:00 Artyom Beilis <art...@ya...>: > What kind of session expiration you use? fixed, renew or browser? > > See session cookie and related cookies should have same expiration time. > So when session expires > the cookie should disappear as well. > > I'm thinking that maybe you use browser session and it expires before the > browser is closed. And than > cookie is not properly deleted because session does not know what keys are > exposed there and what should > be deleted. > > It looks to me like a bug... Also from what I think it happens only with > browser based session (i.e. cookies without max-time/expires properties) > that expires before the browser is closed. > > Can you confirm and if this is right open a ticket? > > As a workaround of the issue you can use > > // test if there is no session key but cookie exists. > if(!session().is_set("test") > && > request().cookies().find("[prefix]_test")!=request().cookies().end()) > { > // remove the cookie > response().set_cookie(cppcms::http::cookie("test","",0)); > } > > > Artyom > > > > ------------------------------ > *From:* redred77 <red...@gm...> > *To:* cpp...@li... > *Sent:* Thursday, December 24, 2015 7:34 PM > *Subject:* [Cppcms-users] About exposed cookie management > > Hi > > I'm testing cppcms, and stuck with cookie management. > This is sample code I'm using. > > session().set("test", "testvalue"); > session().expose("test"); > > I could see the cookie exposed like "(prefix)_test". > Also, I could see main encrypted session cookie which contains all info. > > > It works as intended but when main session expires, things not work as I > expected. > "test" key is gone away since main session cookie was invalid anymore, but > exposed "test" cookie key was still alive and transferred between client > and server. > > > 1. Is it right behaviour? Or have I misconfigured something? > I thought that session() in cppcms guarantees the lifecycle of "main > session key" and "exposed cookie" together. > > When session key is invalid anymore, I thought cookie would be deleted too. > > I quite don't know the mechanism underlying cppcms, so I want to know if > I'm doing right. > > > > > 2. Actually, it's not a big problem because I can check "test" key from > session and invalidate from server. > Currently, I'm deleting exposed cookie key like this. > > > if (!session().is_set("test")) { > session().set("test", ""); > session().expose("test"); > } > > > When there's no valid "test" key in session, it makes that key with empty > string and expose it. > I tried many other methods, like hide(), clear(), but only this worked > when previous session already expired. > > I feel like I'm doing in inefficient way. > > > I don't know simpler api from cppcms. > Can anybody suggest better api or approach for deleting plain cookie from > cppcms? > > > > Thanks. > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > |
From: Artyom B. <art...@ya...> - 2015-12-24 20:59:27
|
What kind of session expiration you use? fixed, renew or browser? See session cookie and related cookies should have same expiration time. So when session expiresthe cookie should disappear as well. I'm thinking that maybe you use browser session and it expires before the browser is closed. And than cookie is not properly deleted because session does not know what keys are exposed there and what shouldbe deleted. It looks to me like a bug... Also from what I think it happens only with browser based session (i.e. cookies without max-time/expires properties) that expires before the browser is closed. Can you confirm and if this is right open a ticket? As a workaround of the issue you can use // test if there is no session key but cookie exists.if(!session().is_set("test") && request().cookies().find("[prefix]_test")!=request().cookies().end()) { // remove the cookie response().set_cookie(cppcms::http::cookie("test","",0)); } Artyom From: redred77 <red...@gm...> To: cpp...@li... Sent: Thursday, December 24, 2015 7:34 PM Subject: [Cppcms-users] About exposed cookie management Hi I'm testing cppcms, and stuck with cookie management.This is sample code I'm using. session().set("test", "testvalue");session().expose("test"); I could see the cookie exposed like "(prefix)_test". Also, I could see main encrypted session cookie which contains all info. It works as intended but when main session expires, things not work as I expected."test" key is gone away since main session cookie was invalid anymore, but exposed "test" cookie key was still alive and transferred between client and server. 1. Is it right behaviour? Or have I misconfigured something?I thought that session() in cppcms guarantees the lifecycle of "main session key" and "exposed cookie" together. When session key is invalid anymore, I thought cookie would be deleted too. I quite don't know the mechanism underlying cppcms, so I want to know if I'm doing right. 2. Actually, it's not a big problem because I can check "test" key from session and invalidate from server. Currently, I'm deleting exposed cookie key like this. if (!session().is_set("test")) { session().set("test", ""); session().expose("test"); } When there's no valid "test" key in session, it makes that key with empty string and expose it. I tried many other methods, like hide(), clear(), but only this worked when previous session already expired. I feel like I'm doing in inefficient way. I don't know simpler api from cppcms.Can anybody suggest better api or approach for deleting plain cookie from cppcms? Thanks. ------------------------------------------------------------------------------ _______________________________________________ Cppcms-users mailing list Cpp...@li... https://lists.sourceforge.net/lists/listinfo/cppcms-users |
From: redred77 <red...@gm...> - 2015-12-24 17:34:36
|
Hi I'm testing cppcms, and stuck with cookie management. This is sample code I'm using. session().set("test", "testvalue"); session().expose("test"); I could see the cookie exposed like "(prefix)_test". Also, I could see main encrypted session cookie which contains all info. It works as intended but when main session expires, things not work as I expected. "test" key is gone away since main session cookie was invalid anymore, but exposed "test" cookie key was still alive and transferred between client and server. 1. Is it right behaviour? Or have I misconfigured something? I thought that session() in cppcms guarantees the lifecycle of "main session key" and "exposed cookie" together. When session key is invalid anymore, I thought cookie would be deleted too. I quite don't know the mechanism underlying cppcms, so I want to know if I'm doing right. 2. Actually, it's not a big problem because I can check "test" key from session and invalidate from server. Currently, I'm deleting exposed cookie key like this. if (!session().is_set("test")) { session().set("test", ""); session().expose("test"); } When there's no valid "test" key in session, it makes that key with empty string and expose it. I tried many other methods, like hide(), clear(), but only this worked when previous session already expired. I feel like I'm doing in inefficient way. I don't know simpler api from cppcms. Can anybody suggest better api or approach for deleting plain cookie from cppcms? Thanks. |
From: Василий Т. <par...@gm...> - 2015-12-24 14:58:48
|
Hello, guys. 1) Is there any way to use another log destination for some special data? Ideally, i would like to log app-wide messages to /var/log/my_app.log (with several rotated parts) and some of important network data to another location (1 file per day). It looks like booster::log has a lack of functionality :( Dont you want to switch to spdlog? 2) I need to reload configuration, at least application-specific parts. Wat is the best way to achieve it in multithreaded environment? Do I need to make some kind of synchronized wrapper for this part of settings? It would be very useful to implement SIGHUP to refresh logging, custom and, may be, other settings. Thanks. Andrey |
From: Artyom B. <art...@ya...> - 2015-12-24 10:23:25
|
Hello, I'm getting ready to release next CppCMS beta version 1.1 (that would become stable as 1.2) Some preview of the work that was done so far: http://cppcms.com/wikipp/en/page/cppcms_1_2_whats_new There are still few relatively small tasks in the TODO list before beta will be officially ready. http://cppcms.com/wikipp/en/page/cppcms_1x_tasks#CppCMS.1.1.0.-.Next.Release More than that I'm changing the release policy to something that I should do for a looooong time ago: release early, release often CppCMS 1.1 was for too long in development and it isn't good :-) I want you guys to looking on it - try to build the version from trunk, try new API and report your impressions. If some API issues are discovered I can make API changes before 1.2 is out. However once 1.2 is released... the API will be frozen. Thank you! Artyom Beilis--------------CppCMS - C++ Web Framework: http://cppcms.com/CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ |
From: redred77 <red...@gm...> - 2015-12-22 02:22:31
|
Thanks. Really appreciated with good project. 2015. 12. 19. 오후 6:13에 "Artyom Beilis" <art...@ya...>님이 작성: > Actually you bringing relevant points. > > Also AFAIK rss is XML and default escaping should work. > Escaping '\'' in general isn't required for HTML unless you use variables > in attributes quoted with > single quote. So probably I'll extend default filter to filter quote mark > as well. Also I don't > think it is actually real issue but may be somewhat misleading. > > Nevertheless remember you can always define your own filters for your > specific cases: > http://cppcms.com/wikipp/en/page/cppcms_1x_templates_comm#Description > > Also note I'm planning to add more filters like filter for json/javascript > and I'm planning to add "default filter scope or something like that" > > <% filter json %> > <script> > alert("<%= message %>"); > </script> > <% end filter %> > > I have just added scoped filter into to-do list for CppCMS 1.1 > > Artyom Beilis > > > ------------------------------ > *From:* redred77 <red...@gm...> > *To:* cpp...@li... > *Sent:* Thursday, December 17, 2015 4:58 PM > *Subject:* [Cppcms-users] About escape filter > > 1. I know that there is escape filter in cppcms already, but I found that > sometimes it's not enough. > > According to rss validator, and rss spec, < > " & characters must be > escaped to hex. > > validator : https://validator.w3.org/feed/ > rss spec : http://www.rssboard.org/rss-profile#data-types-characterdata > > A publisher SHOULD encode "&" and "<" in plain text using hexadecimal > character references. When encoding the ">" character, a publisher SHOULD use > the hexadecimal reference >. > > Using hex code is for compatibility reason, but many rss reader programs > don't recognize " still. For example, SNS management site > hootsuite.com's internal rss reader takes some feed as invalid when > " character is in title tag. Actually they don't need to update the > rss reader because the spec says it should be hex encoded. > > So, I would like to suggest adding encode_hex like method. It is essential > when publishing rss feed from website. > > > > 2. Escaping (') apostrophe (single quote) character. > > PHP's htmlspecialchars() function escapes apostrophe (single quote) when > such flag is set. > http://php.net/manual/en/function.htmlspecialchars.php > > Also here are 5 item that are XML, HTML predefined entities. > > https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Predefined_entities_in_XML > > I can think of some situations that user input may harm the website when > single quote is not escaped since web developers may use single quote at > double quote places. Especially, with javascript I prefer to use single > quote over double quote. > > For security, I would like to suggest apostrophe must be escaped. > > > > 3. I copied from existing cppcms source code and made similar escape > method which escapes xml entities to hex and single quote (apostrophe) > > > std::string util::escape_hex(std::string const &s) > { > std::string content; > unsigned i, len = s.size(); > content.reserve(len * 3 / 2); > for (i = 0; i<len; i++) { > char c = s[i]; > switch (c){ > case '<': content += "<"; break; > case '>': content += ">"; break; > case '&': content += "&"; break; > case '\"': content += """; break; > case '\'': content += "'"; break; > default: content += c; > } > } > return content; > } > > > It works as intended. Original source code is stable, and I just modified > some. > > > > 4. I want to discuss adding new escape method, and about apostrophe. And I > want to know if there's some issues that I didn't know. > > > Thanks. > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > |
From: Artyom B. <art...@ya...> - 2015-12-19 09:12:59
|
Actually you bringing relevant points. Also AFAIK rss is XML and default escaping should work.Escaping '\'' in general isn't required for HTML unless you use variables in attributes quoted with single quote. So probably I'll extend default filter to filter quote mark as well. Also I don'tthink it is actually real issue but may be somewhat misleading. Nevertheless remember you can always define your own filters for your specific cases:http://cppcms.com/wikipp/en/page/cppcms_1x_templates_comm#Description Also note I'm planning to add more filters like filter for json/javascript and I'm planning to add "default filter scope or something like that" <% filter json %><script> alert("<%= message %>");</script><% end filter %> I have just added scoped filter into to-do list for CppCMS 1.1 Artyom Beilis From: redred77 <red...@gm...> To: cpp...@li... Sent: Thursday, December 17, 2015 4:58 PM Subject: [Cppcms-users] About escape filter 1. I know that there is escape filter in cppcms already, but I found that sometimes it's not enough. According to rss validator, and rss spec, < > " & characters must be escaped to hex. validator : https://validator.w3.org/feed/rss spec : http://www.rssboard.org/rss-profile#data-types-characterdata A publisher SHOULD encode "&" and "<" in plain text using hexadecimal character references. When encoding the ">" character, a publisher SHOULD use the hexadecimal reference >. Using hex code is for compatibility reason, but many rss reader programs don't recognize " still. For example, SNS management site hootsuite.com's internal rss reader takes some feed as invalid when " character is in title tag. Actually they don't need to update the rss reader because the spec says it should be hex encoded. So, I would like to suggest adding encode_hex like method. It is essential when publishing rss feed from website. 2. Escaping (') apostrophe (single quote) character. PHP's htmlspecialchars() function escapes apostrophe (single quote) when such flag is set. http://php.net/manual/en/function.htmlspecialchars.php Also here are 5 item that are XML, HTML predefined entities.https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Predefined_entities_in_XML I can think of some situations that user input may harm the website when single quote is not escaped since web developers may use single quote at double quote places. Especially, with javascript I prefer to use single quote over double quote. For security, I would like to suggest apostrophe must be escaped. 3. I copied from existing cppcms source code and made similar escape method which escapes xml entities to hex and single quote (apostrophe) std::string util::escape_hex(std::string const &s){ std::string content; unsigned i, len = s.size(); content.reserve(len * 3 / 2); for (i = 0; i<len; i++) { char c = s[i]; switch (c){ case '<': content += "<"; break; case '>': content += ">"; break; case '&': content += "&"; break; case '\"': content += """; break; case '\'': content += "'"; break; default: content += c; } } return content;} It works as intended. Original source code is stable, and I just modified some. 4. I want to discuss adding new escape method, and about apostrophe. And I want to know if there's some issues that I didn't know. Thanks. ------------------------------------------------------------------------------ _______________________________________________ Cppcms-users mailing list Cpp...@li... https://lists.sourceforge.net/lists/listinfo/cppcms-users |
From: redred77 <red...@gm...> - 2015-12-18 04:25:28
|
Thanks for your work. 2015. 12. 18. 오전 12:58에 "Joerg Sonnenberger" <jo...@br...>님이 작성: > On Thu, Dec 17, 2015 at 11:58:08PM +0900, redred77 wrote: > > 1. I know that there is escape filter in cppcms already, but I found that > > sometimes it's not enough. > > Depending on the output, different filters are needed. You might find > something like the attached patch helpful. It allows specifying the > default filter on a per-view base. > > Joerg > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > |
From: Joerg S. <jo...@br...> - 2015-12-17 15:56:10
|
On Thu, Dec 17, 2015 at 11:58:08PM +0900, redred77 wrote: > 1. I know that there is escape filter in cppcms already, but I found that > sometimes it's not enough. Depending on the output, different filters are needed. You might find something like the attached patch helpful. It allows specifying the default filter on a per-view base. Joerg |
From: redred77 <red...@gm...> - 2015-12-17 14:58:18
|
1. I know that there is escape filter in cppcms already, but I found that sometimes it's not enough. According to rss validator, and rss spec, < > " & characters must be escaped to hex. validator : https://validator.w3.org/feed/ rss spec : http://www.rssboard.org/rss-profile#data-types-characterdata A publisher SHOULD encode "&" and "<" in plain text using hexadecimal character references. When encoding the ">" character, a publisher SHOULD use the hexadecimal reference >. Using hex code is for compatibility reason, but many rss reader programs don't recognize " still. For example, SNS management site hootsuite.com's internal rss reader takes some feed as invalid when " character is in title tag. Actually they don't need to update the rss reader because the spec says it should be hex encoded. So, I would like to suggest adding encode_hex like method. It is essential when publishing rss feed from website. 2. Escaping (') apostrophe (single quote) character. PHP's htmlspecialchars() function escapes apostrophe (single quote) when such flag is set. http://php.net/manual/en/function.htmlspecialchars.php Also here are 5 item that are XML, HTML predefined entities. https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Predefined_entities_in_XML I can think of some situations that user input may harm the website when single quote is not escaped since web developers may use single quote at double quote places. Especially, with javascript I prefer to use single quote over double quote. For security, I would like to suggest apostrophe must be escaped. 3. I copied from existing cppcms source code and made similar escape method which escapes xml entities to hex and single quote (apostrophe) std::string util::escape_hex(std::string const &s) { std::string content; unsigned i, len = s.size(); content.reserve(len * 3 / 2); for (i = 0; i<len; i++) { char c = s[i]; switch (c){ case '<': content += "<"; break; case '>': content += ">"; break; case '&': content += "&"; break; case '\"': content += """; break; case '\'': content += "'"; break; default: content += c; } } return content; } It works as intended. Original source code is stable, and I just modified some. 4. I want to discuss adding new escape method, and about apostrophe. And I want to know if there's some issues that I didn't know. Thanks. |
From: mawan s. <ma...@gm...> - 2015-12-08 10:11:24
|
finally i use this method to get form value from submitted data : if (request().request_method()=="POST"){ cppcms::http::request::form_type postData; cppcms::http::request::form_type::iterator it; postData = request().post(); it = postData.begin(); for (it=postData.begin(); it!=postData.end(); ++it){ //save and map data to form response().out() << (*it).first << " => " << (*it).second; } return; } are there any methods to get dynamic form base on html form manipulation? On Tue, Dec 8, 2015 at 4:39 PM, mawan sugiyanto <ma...@gm...> wrote: > My problem is : > > Can cppcms form receive a value from POST process that is not defined in > the form object? and then post variables are mapped to the form data? > > On Tue, Dec 8, 2015 at 1:55 PM, mawan sugiyanto <ma...@gm...> wrote: > >> Dear All >> >> I found code in blog example .. . It is about form definition in post.h >> Why declare add_to_cat_list form? Is it as a group only ? >> >> std::vector<cppcms::widgets::checkbox *> add_to_cat_list; >> std::vector<cppcms::widgets::checkbox *> del_from_cat_list; >> >> cppcms::form inputs; >> cppcms::form buttons; >> cppcms::form add_to_cat; >> cppcms::form del_from_cat; >> >> Thankyou >> >> >> >> Mawan >> > > |
From: mawan s. <ma...@gm...> - 2015-12-08 09:39:47
|
My problem is : Can cppcms form receive a value from POST process that is not defined in the form object? and then post variables are mapped to the form data? On Tue, Dec 8, 2015 at 1:55 PM, mawan sugiyanto <ma...@gm...> wrote: > Dear All > > I found code in blog example .. . It is about form definition in post.h > Why declare add_to_cat_list form? Is it as a group only ? > > std::vector<cppcms::widgets::checkbox *> add_to_cat_list; > std::vector<cppcms::widgets::checkbox *> del_from_cat_list; > > cppcms::form inputs; > cppcms::form buttons; > cppcms::form add_to_cat; > cppcms::form del_from_cat; > > Thankyou > > > > Mawan > |
From: mawan s. <ma...@gm...> - 2015-12-08 06:56:02
|
Dear All I found code in blog example .. . It is about form definition in post.h Why declare add_to_cat_list form? Is it as a group only ? std::vector<cppcms::widgets::checkbox *> add_to_cat_list; std::vector<cppcms::widgets::checkbox *> del_from_cat_list; cppcms::form inputs; cppcms::form buttons; cppcms::form add_to_cat; cppcms::form del_from_cat; Thankyou Mawan |
From: Artyom B. <art...@ya...> - 2015-12-03 20:46:06
|
> >Hello, guys. >1) Is there any way to use another log destination for some special data? >Ideally, i would like to log app-wide messages to /var/log/my_app.log (with several rotated parts) and some of important network data to another location (1 file per day). It looks like booster::log has a lack of functionality :( Dont you want to switch to spdlog? No currently there is no such functionality, however you can create your own sink object that would provide a filtration and forward it to existing sinks for example. >2) I need to reload configuration, at least application-specific parts. Wat is the best way to achieve it in multithreaded environment? Do I need to make some kind of synchronized wrapper for this part of settings? It would be very useful to implement SIGHUP to refresh logging, custom and, may be, other settings. The simplest is shutdown the cppcms service upon sighup and start it again: http://cppcms.com/wikipp/en/page/cppcms_1x_reload_application Artyom |
From: Василий Т. <par...@gm...> - 2015-12-02 20:38:20
|
Hello, guys. 1) Is there any way to use another log destination for some special data? Ideally, i would like to log app-wide messages to /var/log/my_app.log (with several rotated parts) and some of important network data to another location (1 file per day). It looks like booster::log has a lack of functionality :( Dont you want to switch to spdlog? 2) I need to reload configuration, at least application-specific parts. Wat is the best way to achieve it in multithreaded environment? Do I need to make some kind of synchronized wrapper for this part of settings? It would be very useful to implement SIGHUP to refresh logging, custom and, may be, other settings. Thanks. Andrey |
From: Alexander M. <a....@ev...> - 2015-11-30 13:54:34
|
Hi, I wasn't able to find the exact problem. The (brute force) solution was, just reinstalling the complete vmachine. Now it works fine. :-) Thank you for your help. Alex Am 26.11.2015 um 16:29 schrieb Alexander Mack: > Hi Artyom, > > Thank you for the promt answer. For building CppCMS I used the > description on http://cppcms.com/wikipp/en/page/cppcms_1x_build. I did > not make any special configurations regarding the ICU. > The CppCMS version is the same (Revision: 2329). > > Is it possible, that the Ubuntu version (and with that difference ICU > versions) can influence the results? > > The "working" maschine is Ubuntu 14.04.3 LTS with the following ICU > Version: > <icuSystemParams type="icu4c"> > <param name="copyright"> Copyright (C) 2013, International > Business Machines Corporation and others. All Rights Reserved. </param> > <param name="product">icu4c</param> > <param name="product.full">International Components for Unicode > for C/C++</param> > <param name="version">52.1</param> > <param name="version.unicode">6.3</param> > <param name="platform.number">4000</param> > <param name="platform.type">Linux</param> > <param name="locale.default">de_DE</param> > <param name="locale.default.bcp47">de-DE</param> > <param name="converter.default">UTF-8</param> > <param name="icudata.name">icudt52l</param> > <param name="icudata.path"></param> > <param name="cldr.version">24.0</param> > <param name="tz.version">2013g</param> > <param name="tz.default">Europe/Berlin</param> > <param name="cpu.bits">64</param> > <param name="cpu.big_endian">0</param> > <param name="os.wchar_width">4</param> > <param name="os.charset_family">0</param> > <param name="os.host">x86_64-pc-linux-gnu</param> > <param name="build.build">x86_64-pc-linux-gnu</param> > <param name="build.cc">gcc</param> > <param name="build.cxx">g++</param> > <param name="uconfig.internal_digitlist">1</param> > <param name="uconfig.have_parseallinput">1</param> > <param name="uconfig.format_fastpaths_49">1</param> > </icuSystemParams> > > > ICU Initialization returned: U_ZERO_ERROR > > > > The "not working" machine is Ubuntu 13.10 with the following ICU infos: > > <ICUINFO> > International Components for Unicode for C/C++ > Copyright (C) 2011, International Business Machines Corporation and > others. All Rights Reserved. > Compiled-Version: 4.8.1.1 > Runtime-Version: 4.8.1.1 > Compiled-Unicode-Version: 6.0 > Runtime-Unicode-Version: 6.0 > Platform: U_LINUX > Build: x86_64-pc-linux-gnu > C compiler: gcc > C++ compiler: g++ > ICUDATA: icudt48l > Data Directory: > ICU Initialization returned: U_ZERO_ERROR > Default locale: de_DE > CLDR-Version: 2.0.1 > Default converter: UTF-8 > Default TZ: Europe/Berlin > TZ data version: 2011k > Plugin file is: /usr/lib/x86_64-linux-gnu/icu/icuplugins48.txt > </ICUINFO> > > > I did no further calculations on the date_time objects. The following > source code is the whole date_time example I was trying out. The > complete test project is a little bit larger.. But I could try to > create a small test program and check the behaviour. > > // get some time some month ago.. > booster::locale::date_time dtCurrentTime; > booster::locale::date_time dtSomeMonthAgo = dtCurrentTime - > (booster::locale::period::month()); > > // get date_time for 1970-01-01 00:00:00 > booster::locale::date_time dtStart(0); > > // get timestamp > int iDifference = dtStart.difference(dtCurrent, > booster::locale::period::second()); > > BOOSTER_DEBUG("test") << "Timestamp of dtSomeMonthAgo: " << iDifference; > > Thank you very much for your help, > > Alex > > > > > > > Am 26.11.2015 um 15:37 schrieb Artyom Beilis: >> Is CppCMS compiled with ICU on both machines? >> Is it same CppCMS version? >> Also can you print all intermediate calculations as well? (i.e. >> dtCurrentTime,dtSomeMonthAgo and dtStart) >> In general second difference should be trivial i.e. mostly calculate >> difference between internal timestamp. >> >> Artyom >> >> ------------------------------------------------------------------------ >> *From:* Alexander Mack <a....@ev...> >> *To:* cpp...@li... >> *Sent:* Thursday, November 26, 2015 3:30 PM >> *Subject:* [Cppcms-users] booster::locale::date_time to timestamp >> conversion issues / basis for booster::locale::date_time >> >> Hello, >> >> I'm trying to convert a date_time object into a simple timestamp >> e.g.: >> >> // init environment... >> std::locale::global(booster::locale::generator().generate("")); >> cppcms::service srv(argc, argv); >> >> // .... >> >> // get some time some month ago.. >> booster::locale::date_time dtCurrentTime; >> booster::locale::date_time dtSomeMonthAgo = dtCurrentTime - >> (booster::locale::period::month()); >> >> // get date_time for 1970-01-01 00:00:00 >> booster::locale::date_time dtStart(0); >> >> // get timestamp >> int iDifference = dtStart.difference(dtCurrent, >> booster::locale::period::second()); >> >> That code works fine on Machine A.. But when I'm running the >> program on >> Machine B I get weird results.. >> On Machine A the timestamp for Mon, 26 Oct 2015 12:37:12 GMT is >> 1445863032. (correct) >> On Machine B the timestamp for Mon, 26 Oct 2015 12:37:12 GMT is >> 536870912. (wrong) >> >> The times on the machines are equal too.. timedatectl: >> >> Machine A: >> Local time: Do 2015-11-26 14:25:12 CET >> Universal time: Do 2015-11-26 13:25:12 UTC >> Timezone: Europe/Berlin (CET, +0100) >> NTP enabled: yes >> NTP synchronized: yes >> RTC in local TZ: no >> DST active: no >> Last DST change: DST ended at >> So 2015-10-25 02:59:59 CEST >> So 2015-10-25 02:00:00 CET >> Next DST change: DST begins (the clock jumps one hour forward) at >> So 2016-03-27 01:59:59 CET >> So 2016-03-27 03:00:00 CEST >> >> Machine B: >> Local time: Do 2015-11-26 14:25:38 CET >> Universal time: Do 2015-11-26 13:25:38 UTC >> RTC time: Do 2015-11-26 13:25:38 >> Timezone: Europe/Berlin (CET, +0100) >> NTP enabled: yes >> NTP synchronized: no >> RTC in local TZ: no >> DST active: no >> Last DST change: DST ended at >> So 2015-10-25 02:59:59 CEST >> So 2015-10-25 02:00:00 CET >> Next DST change: DST begins (the clock jumps one hour forward) at >> So 2016-03-27 01:59:59 CET >> So 2016-03-27 03:00:00 CEST >> >> >> Maybe someone had the same issue and knows what the problem is? >> >> I would appreciate any tip :-) >> >> Thank you very much, >> >> Alex >> >> >> >> ------------------------------------------------------------------------------ >> Go from Idea to Many App Stores Faster with Intel(R) XDK >> Give your users amazing mobile app experiences with Intel(R) XDK. >> Use one codebase in this all-in-one HTML5 development environment. >> Design, debug & build mobile apps & 2D/3D high-impact games for >> multiple OSs. >> http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140 >> _______________________________________________ >> Cppcms-users mailing list >> Cpp...@li... >> <mailto:Cpp...@li...> >> https://lists.sourceforge.net/lists/listinfo/cppcms-users >> >> >> >> >> ------------------------------------------------------------------------------ >> Go from Idea to Many App Stores Faster with Intel(R) XDK >> Give your users amazing mobile app experiences with Intel(R) XDK. >> Use one codebase in this all-in-one HTML5 development environment. >> Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs. >> http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140 >> >> >> _______________________________________________ >> Cppcms-users mailing list >> Cpp...@li... >> https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
From: Artyom B. <art...@ya...> - 2015-11-26 16:04:11
|
Mostly it is important the intermediate output values.Also look if ICU is linked i.e. ldd /usr/lib/libbooster.so - if it islinked to ICU or not. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ From: Alexander Mack <a....@ev...> To: Artyom Beilis <art...@ya...>; cpp...@li... Sent: Thursday, November 26, 2015 5:29 PM Subject: Re: [Cppcms-users] booster::locale::date_time to timestamp conversion issues / basis for booster::locale::date_time Hi Artyom, Thank you for the promt answer. For building CppCMS I used the description on http://cppcms.com/wikipp/en/page/cppcms_1x_build. I did not make any special configurations regarding the ICU. The CppCMS version is the same (Revision: 2329). Is it possible, that the Ubuntu version (and with that difference ICU versions) can influence the results? The "working" maschine is Ubuntu 14.04.3 LTS with the following ICU Version: <icuSystemParams type="icu4c"> <param name="copyright"> Copyright (C) 2013, International Business Machines Corporation and others. All Rights Reserved. </param> <param name="product">icu4c</param> <param name="product.full">International Components for Unicode for C/C++</param> <param name="version">52.1</param> <param name="version.unicode">6.3</param> <param name="platform.number">4000</param> <param name="platform.type">Linux</param> <param name="locale.default">de_DE</param> <param name="locale.default.bcp47">de-DE</param> <param name="converter.default">UTF-8</param> <param name="icudata.name">icudt52l</param> <param name="icudata.path"></param> <param name="cldr.version">24.0</param> <param name="tz.version">2013g</param> <param name="tz.default">Europe/Berlin</param> <param name="cpu.bits">64</param> <param name="cpu.big_endian">0</param> <param name="os.wchar_width">4</param> <param name="os.charset_family">0</param> <param name="os.host">x86_64-pc-linux-gnu</param> <param name="build.build">x86_64-pc-linux-gnu</param> <param name="build.cc">gcc</param> <param name="build.cxx">g++</param> <param name="uconfig.internal_digitlist">1</param> <param name="uconfig.have_parseallinput">1</param> <param name="uconfig.format_fastpaths_49">1</param> </icuSystemParams> ICU Initialization returned: U_ZERO_ERROR The "not working" machine is Ubuntu 13.10 with the following ICU infos: <ICUINFO> International Components for Unicode for C/C++ Copyright (C) 2011, International Business Machines Corporation and others. All Rights Reserved. Compiled-Version: 4.8.1.1 Runtime-Version: 4.8.1.1 Compiled-Unicode-Version: 6.0 Runtime-Unicode-Version: 6.0 Platform: U_LINUX Build: x86_64-pc-linux-gnu C compiler: gcc C++ compiler: g++ ICUDATA: icudt48l Data Directory: ICU Initialization returned: U_ZERO_ERROR Default locale: de_DE CLDR-Version: 2.0.1 Default converter: UTF-8 Default TZ: Europe/Berlin TZ data version: 2011k Plugin file is: /usr/lib/x86_64-linux-gnu/icu/icuplugins48.txt </ICUINFO> I did no further calculations on the date_time objects. The following source code is the whole date_time example I was trying out. The complete test project is a little bit larger.. But I could try to create a small test program and check the behaviour. // get some time some month ago.. booster::locale::date_time dtCurrentTime; booster::locale::date_time dtSomeMonthAgo = dtCurrentTime - (booster::locale::period::month()); // get date_time for 1970-01-01 00:00:00 booster::locale::date_time dtStart(0); // get timestamp int iDifference = dtStart.difference(dtCurrent, booster::locale::period::second()); BOOSTER_DEBUG("test") << "Timestamp of dtSomeMonthAgo: " << iDifference; Thank you very much for your help, Alex Am 26.11.2015 um 15:37 schrieb Artyom Beilis: Is CppCMS compiled with ICU on both machines? Is it same CppCMS version? Also can you print all intermediate calculations as well? (i.e. dtCurrentTime,dtSomeMonthAgo and dtStart) In general second difference should be trivial i.e. mostly calculate difference between internal timestamp. Artyom From: Alexander Mack <a....@ev...> To: cpp...@li... Sent: Thursday, November 26, 2015 3:30 PM Subject: [Cppcms-users] booster::locale::date_time to timestamp conversion issues / basis for booster::locale::date_time Hello, I'm trying to convert a date_time object into a simple timestamp e.g.: // init environment... std::locale::global(booster::locale::generator().generate("")); cppcms::service srv(argc, argv); // .... // get some time some month ago.. booster::locale::date_time dtCurrentTime; booster::locale::date_time dtSomeMonthAgo = dtCurrentTime - (booster::locale::period::month()); // get date_time for 1970-01-01 00:00:00 booster::locale::date_time dtStart(0); // get timestamp int iDifference = dtStart.difference(dtCurrent, booster::locale::period::second()); That code works fine on Machine A.. But when I'm running the program on Machine B I get weird results.. On Machine A the timestamp for Mon, 26 Oct 2015 12:37:12 GMT is 1445863032. (correct) On Machine B the timestamp for Mon, 26 Oct 2015 12:37:12 GMT is 536870912. (wrong) The times on the machines are equal too.. timedatectl: Machine A: Local time: Do 2015-11-26 14:25:12 CET Universal time: Do 2015-11-26 13:25:12 UTC Timezone: Europe/Berlin (CET, +0100) NTP enabled: yes NTP synchronized: yes RTC in local TZ: no DST active: no Last DST change: DST ended at So 2015-10-25 02:59:59 CEST So 2015-10-25 02:00:00 CET Next DST change: DST begins (the clock jumps one hour forward) at So 2016-03-27 01:59:59 CET So 2016-03-27 03:00:00 CEST Machine B: Local time: Do 2015-11-26 14:25:38 CET Universal time: Do 2015-11-26 13:25:38 UTC RTC time: Do 2015-11-26 13:25:38 Timezone: Europe/Berlin (CET, +0100) NTP enabled: yes NTP synchronized: no RTC in local TZ: no DST active: no Last DST change: DST ended at So 2015-10-25 02:59:59 CEST So 2015-10-25 02:00:00 CET Next DST change: DST begins (the clock jumps one hour forward) at So 2016-03-27 01:59:59 CET So 2016-03-27 03:00:00 CEST Maybe someone had the same issue and knows what the problem is? I would appreciate any tip :-) Thank you very much, Alex ------------------------------------------------------------------------------ Go from Idea to Many App Stores Faster with Intel(R) XDK Give your users amazing mobile app experiences with Intel(R) XDK. Use one codebase in this all-in-one HTML5 development environment. Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs. http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140 _______________________________________________ Cppcms-users mailing list Cpp...@li... https://lists.sourceforge.net/lists/listinfo/cppcms-users ------------------------------------------------------------------------------ Go from Idea to Many App Stores Faster with Intel(R) XDK Give your users amazing mobile app experiences with Intel(R) XDK. Use one codebase in this all-in-one HTML5 development environment. Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs. http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140 _______________________________________________ Cppcms-users mailing list Cpp...@li... https://lists.sourceforge.net/lists/listinfo/cppcms-users |
From: Alexander M. <a....@ev...> - 2015-11-26 15:29:55
|
Hi Artyom, Thank you for the promt answer. For building CppCMS I used the description on http://cppcms.com/wikipp/en/page/cppcms_1x_build. I did not make any special configurations regarding the ICU. The CppCMS version is the same (Revision: 2329). Is it possible, that the Ubuntu version (and with that difference ICU versions) can influence the results? The "working" maschine is Ubuntu 14.04.3 LTS with the following ICU Version: <icuSystemParams type="icu4c"> <param name="copyright"> Copyright (C) 2013, International Business Machines Corporation and others. All Rights Reserved. </param> <param name="product">icu4c</param> <param name="product.full">International Components for Unicode for C/C++</param> <param name="version">52.1</param> <param name="version.unicode">6.3</param> <param name="platform.number">4000</param> <param name="platform.type">Linux</param> <param name="locale.default">de_DE</param> <param name="locale.default.bcp47">de-DE</param> <param name="converter.default">UTF-8</param> <param name="icudata.name">icudt52l</param> <param name="icudata.path"></param> <param name="cldr.version">24.0</param> <param name="tz.version">2013g</param> <param name="tz.default">Europe/Berlin</param> <param name="cpu.bits">64</param> <param name="cpu.big_endian">0</param> <param name="os.wchar_width">4</param> <param name="os.charset_family">0</param> <param name="os.host">x86_64-pc-linux-gnu</param> <param name="build.build">x86_64-pc-linux-gnu</param> <param name="build.cc">gcc</param> <param name="build.cxx">g++</param> <param name="uconfig.internal_digitlist">1</param> <param name="uconfig.have_parseallinput">1</param> <param name="uconfig.format_fastpaths_49">1</param> </icuSystemParams> ICU Initialization returned: U_ZERO_ERROR The "not working" machine is Ubuntu 13.10 with the following ICU infos: <ICUINFO> International Components for Unicode for C/C++ Copyright (C) 2011, International Business Machines Corporation and others. All Rights Reserved. Compiled-Version: 4.8.1.1 Runtime-Version: 4.8.1.1 Compiled-Unicode-Version: 6.0 Runtime-Unicode-Version: 6.0 Platform: U_LINUX Build: x86_64-pc-linux-gnu C compiler: gcc C++ compiler: g++ ICUDATA: icudt48l Data Directory: ICU Initialization returned: U_ZERO_ERROR Default locale: de_DE CLDR-Version: 2.0.1 Default converter: UTF-8 Default TZ: Europe/Berlin TZ data version: 2011k Plugin file is: /usr/lib/x86_64-linux-gnu/icu/icuplugins48.txt </ICUINFO> I did no further calculations on the date_time objects. The following source code is the whole date_time example I was trying out. The complete test project is a little bit larger.. But I could try to create a small test program and check the behaviour. // get some time some month ago.. booster::locale::date_time dtCurrentTime; booster::locale::date_time dtSomeMonthAgo = dtCurrentTime - (booster::locale::period::month()); // get date_time for 1970-01-01 00:00:00 booster::locale::date_time dtStart(0); // get timestamp int iDifference = dtStart.difference(dtCurrent, booster::locale::period::second()); BOOSTER_DEBUG("test") << "Timestamp of dtSomeMonthAgo: " << iDifference; Thank you very much for your help, Alex Am 26.11.2015 um 15:37 schrieb Artyom Beilis: > Is CppCMS compiled with ICU on both machines? > Is it same CppCMS version? > Also can you print all intermediate calculations as well? (i.e. > dtCurrentTime,dtSomeMonthAgo and dtStart) > In general second difference should be trivial i.e. mostly calculate > difference between internal timestamp. > > Artyom > > ------------------------------------------------------------------------ > *From:* Alexander Mack <a....@ev...> > *To:* cpp...@li... > *Sent:* Thursday, November 26, 2015 3:30 PM > *Subject:* [Cppcms-users] booster::locale::date_time to timestamp > conversion issues / basis for booster::locale::date_time > > Hello, > > I'm trying to convert a date_time object into a simple timestamp e.g.: > > // init environment... > std::locale::global(booster::locale::generator().generate("")); > cppcms::service srv(argc, argv); > > // .... > > // get some time some month ago.. > booster::locale::date_time dtCurrentTime; > booster::locale::date_time dtSomeMonthAgo = dtCurrentTime - > (booster::locale::period::month()); > > // get date_time for 1970-01-01 00:00:00 > booster::locale::date_time dtStart(0); > > // get timestamp > int iDifference = dtStart.difference(dtCurrent, > booster::locale::period::second()); > > That code works fine on Machine A.. But when I'm running the > program on > Machine B I get weird results.. > On Machine A the timestamp for Mon, 26 Oct 2015 12:37:12 GMT is > 1445863032. (correct) > On Machine B the timestamp for Mon, 26 Oct 2015 12:37:12 GMT is > 536870912. (wrong) > > The times on the machines are equal too.. timedatectl: > > Machine A: > Local time: Do 2015-11-26 14:25:12 CET > Universal time: Do 2015-11-26 13:25:12 UTC > Timezone: Europe/Berlin (CET, +0100) > NTP enabled: yes > NTP synchronized: yes > RTC in local TZ: no > DST active: no > Last DST change: DST ended at > So 2015-10-25 02:59:59 CEST > So 2015-10-25 02:00:00 CET > Next DST change: DST begins (the clock jumps one hour forward) at > So 2016-03-27 01:59:59 CET > So 2016-03-27 03:00:00 CEST > > Machine B: > Local time: Do 2015-11-26 14:25:38 CET > Universal time: Do 2015-11-26 13:25:38 UTC > RTC time: Do 2015-11-26 13:25:38 > Timezone: Europe/Berlin (CET, +0100) > NTP enabled: yes > NTP synchronized: no > RTC in local TZ: no > DST active: no > Last DST change: DST ended at > So 2015-10-25 02:59:59 CEST > So 2015-10-25 02:00:00 CET > Next DST change: DST begins (the clock jumps one hour forward) at > So 2016-03-27 01:59:59 CET > So 2016-03-27 03:00:00 CEST > > > Maybe someone had the same issue and knows what the problem is? > > I would appreciate any tip :-) > > Thank you very much, > > Alex > > > > ------------------------------------------------------------------------------ > Go from Idea to Many App Stores Faster with Intel(R) XDK > Give your users amazing mobile app experiences with Intel(R) XDK. > Use one codebase in this all-in-one HTML5 development environment. > Design, debug & build mobile apps & 2D/3D high-impact games for > multiple OSs. > http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140 > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > <mailto:Cpp...@li...> > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > > > ------------------------------------------------------------------------------ > Go from Idea to Many App Stores Faster with Intel(R) XDK > Give your users amazing mobile app experiences with Intel(R) XDK. > Use one codebase in this all-in-one HTML5 development environment. > Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs. > http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140 > > > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users |
From: Artyom B. <art...@ya...> - 2015-11-26 14:40:06
|
Is CppCMS compiled with ICU on both machines?Is it same CppCMS version? Also can you print all intermediate calculations as well? (i.e. dtCurrentTime,dtSomeMonthAgo and dtStart)In general second difference should be trivial i.e. mostly calculate difference between internal timestamp. Artyom From: Alexander Mack <a....@ev...> To: cpp...@li... Sent: Thursday, November 26, 2015 3:30 PM Subject: [Cppcms-users] booster::locale::date_time to timestamp conversion issues / basis for booster::locale::date_time Hello, I'm trying to convert a date_time object into a simple timestamp e.g.: // init environment... std::locale::global(booster::locale::generator().generate("")); cppcms::service srv(argc, argv); // .... // get some time some month ago.. booster::locale::date_time dtCurrentTime; booster::locale::date_time dtSomeMonthAgo = dtCurrentTime - (booster::locale::period::month()); // get date_time for 1970-01-01 00:00:00 booster::locale::date_time dtStart(0); // get timestamp int iDifference = dtStart.difference(dtCurrent, booster::locale::period::second()); That code works fine on Machine A.. But when I'm running the program on Machine B I get weird results.. On Machine A the timestamp for Mon, 26 Oct 2015 12:37:12 GMT is 1445863032. (correct) On Machine B the timestamp for Mon, 26 Oct 2015 12:37:12 GMT is 536870912. (wrong) The times on the machines are equal too.. timedatectl: Machine A: Local time: Do 2015-11-26 14:25:12 CET Universal time: Do 2015-11-26 13:25:12 UTC Timezone: Europe/Berlin (CET, +0100) NTP enabled: yes NTP synchronized: yes RTC in local TZ: no DST active: no Last DST change: DST ended at So 2015-10-25 02:59:59 CEST So 2015-10-25 02:00:00 CET Next DST change: DST begins (the clock jumps one hour forward) at So 2016-03-27 01:59:59 CET So 2016-03-27 03:00:00 CEST Machine B: Local time: Do 2015-11-26 14:25:38 CET Universal time: Do 2015-11-26 13:25:38 UTC RTC time: Do 2015-11-26 13:25:38 Timezone: Europe/Berlin (CET, +0100) NTP enabled: yes NTP synchronized: no RTC in local TZ: no DST active: no Last DST change: DST ended at So 2015-10-25 02:59:59 CEST So 2015-10-25 02:00:00 CET Next DST change: DST begins (the clock jumps one hour forward) at So 2016-03-27 01:59:59 CET So 2016-03-27 03:00:00 CEST Maybe someone had the same issue and knows what the problem is? I would appreciate any tip :-) Thank you very much, Alex ------------------------------------------------------------------------------ Go from Idea to Many App Stores Faster with Intel(R) XDK Give your users amazing mobile app experiences with Intel(R) XDK. Use one codebase in this all-in-one HTML5 development environment. Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs. http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140 _______________________________________________ Cppcms-users mailing list Cpp...@li... https://lists.sourceforge.net/lists/listinfo/cppcms-users |
From: Alexander M. <a....@ev...> - 2015-11-26 13:43:44
|
Hello, I'm trying to convert a date_time object into a simple timestamp e.g.: // init environment... std::locale::global(booster::locale::generator().generate("")); cppcms::service srv(argc, argv); // .... // get some time some month ago.. booster::locale::date_time dtCurrentTime; booster::locale::date_time dtSomeMonthAgo = dtCurrentTime - (booster::locale::period::month()); // get date_time for 1970-01-01 00:00:00 booster::locale::date_time dtStart(0); // get timestamp int iDifference = dtStart.difference(dtCurrent, booster::locale::period::second()); That code works fine on Machine A.. But when I'm running the program on Machine B I get weird results.. On Machine A the timestamp for Mon, 26 Oct 2015 12:37:12 GMT is 1445863032. (correct) On Machine B the timestamp for Mon, 26 Oct 2015 12:37:12 GMT is 536870912. (wrong) The times on the machines are equal too.. timedatectl: Machine A: Local time: Do 2015-11-26 14:25:12 CET Universal time: Do 2015-11-26 13:25:12 UTC Timezone: Europe/Berlin (CET, +0100) NTP enabled: yes NTP synchronized: yes RTC in local TZ: no DST active: no Last DST change: DST ended at So 2015-10-25 02:59:59 CEST So 2015-10-25 02:00:00 CET Next DST change: DST begins (the clock jumps one hour forward) at So 2016-03-27 01:59:59 CET So 2016-03-27 03:00:00 CEST Machine B: Local time: Do 2015-11-26 14:25:38 CET Universal time: Do 2015-11-26 13:25:38 UTC RTC time: Do 2015-11-26 13:25:38 Timezone: Europe/Berlin (CET, +0100) NTP enabled: yes NTP synchronized: no RTC in local TZ: no DST active: no Last DST change: DST ended at So 2015-10-25 02:59:59 CEST So 2015-10-25 02:00:00 CET Next DST change: DST begins (the clock jumps one hour forward) at So 2016-03-27 01:59:59 CET So 2016-03-27 03:00:00 CEST Maybe someone had the same issue and knows what the problem is? I would appreciate any tip :-) Thank you very much, Alex |
From: Stanimir M. <sta...@zo...> - 2015-11-23 13:14:18
|
Hi, I would repeat Node.js and point its Express framework in particular. On Mon, Nov 23, 2015 at 12:47 PM, kpeo <sla...@ya...> wrote: > Hi Artyom, > > I think, Javascript (Node.js and Meteor using it) - one of the most important web-technologies novadays in addition to already added imlementations. > > Thank you! > > Regards, > kpeo > > 16.11.2015, 09:13, "Artyom Beilis" <art...@ya...>: >> I'm working on implementation of session sharing between CppCMS and 3rd part web technologies. So it would be easier to migrate from current platform by implementing most performance critical parts in CppCMS >> >> (I'm trying to clear most critical tasks for CppCMS 1.2 so it can be released). >> >> In general it works this way: >> >> Some of CppCMS session API was exposed as pure C API to simplify module writing: >> >> http://sourceforge.net/p/cppcms/code/HEAD/tree/framework/trunk/cppcms/capi/session.h >> >> Modules were implemented for 3rd part technologies that allow to load modify and save CppCMS session. >> ( http://sourceforge.net/p/cppcms/code/HEAD/tree/framework/trunk/contrib/integration/session/ ) >> Currently I had written support for PHP, Java, Python (+django) and Asp.Net on its way. >> >> For example PHP code: >> >> include_once('cppcms.php'); >> >> $pool=CppCMS_SessionPool::from_config('cppcms-config.js'); >> $session=$pool->session(); >> $session->load(); >> $x=0; >> if($session->is_set('x')) { >> $x=$session['x']; >> } >> >> $x=intval($x)+1; >> $session['x']=$x; >> $session->save(); >> >> echo "x=$x\n"; >> >> Now what are most important web-technologies you think need to be there out of the box? >> I'm thinking of Ruby on Rails but I have no experience with Ruby at all. >> >> Artyom Beilis >> , >> >> ------------------------------------------------------------------------------ >> Presto, an open source distributed SQL query engine for big data, initially >> developed by Facebook, enables you to easily query your data on Hadoop in a >> more interactive manner. Teradata is also now providing full enterprise >> support for Presto. Download a free open source copy now. >> http://pubads.g.doubleclick.net/gampad/clk?id=250295911&iu=/4140 >> , >> >> _______________________________________________ >> Cppcms-users mailing list >> Cpp...@li... >> https://lists.sourceforge.net/lists/listinfo/cppcms-users > > ------------------------------------------------------------------------------ > Go from Idea to Many App Stores Faster with Intel(R) XDK > Give your users amazing mobile app experiences with Intel(R) XDK. > Use one codebase in this all-in-one HTML5 development environment. > Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs. > http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140 > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users |
From: Artyom B. <art...@ya...> - 2015-11-23 11:09:42
|
> Hi! > > We can use cache only if context exists. But in application constructor - > context is not exists yet. So what we should to do, if we caching database > requests and we need to load some data in application constructor? (well, cache > designed for responses mostly, but it can be used internally as well - instead > of external solutions). > Good question.. In CppCMS 1.0.x I suggest to access cache on first request, i.e. to put in main - if something is not cached load it otherwise use it. In CpppCMS 1.1.0 - in trunk you can create a cache_interface object independently from service - for cases when you need cache outside request/response context. You obviously can't cache response output this way but it does not really matter :-) Currently development on CppCMS 1.1.x i.e. beta of 1.2.0 is under very active development and I hope to keep it this way until 1.2 is released. Also note currently trunk is little unstable due to some refactoring of the internal code - due to implementation of non-blocking interface for asynchronous applications. Also all the (important) tests now running fine still there may be some issues. http://cppcms.com/files/nightly-build-report.html > 3. Don't caching database requests at all. > Most databases have own caching mechanisms, but we better know the logic of our > application and also can use own small storage solutions (well, may be they > should use own cache too). > It is always more efficient to cache final result (for example rendered HTML page) rather then database for two reasons: (a) output is cached in already gzipped mode (b) You already have done all processing. Of course it isn't possible in many cases. Caching DB is very good for "long living" data that is complex to retrieve and not updated frequently. > > Thanks! > > Regards, > kpeo > Regards, Artyom |