cppcms-users Mailing List for CppCMS C++ Web Framework (Page 71)
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
|
| 2025 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2026 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
|
From: Artyom B. <art...@ya...> - 2012-10-04 19:00:15
|
Just few words,
booster::aio::io_service::post is
used to execute something in the event loop
"later" i.e. you give a callback and it would
executed in the dispatch queue of the event
loop, it is also important that it is thread safe.
Post used for two reasons:
1. Make sure that the handler is not called right now but
rather put into queue - it is very useful to
prevent accidential recursions
2. When you need to execute something on non-thread safe class
withing the event loop thread, as post is thread safe.
i.e. if some event driven object like asyncrchonous app.,
aio socket etc. runs withing the event loop and you want to
for example send something to socket form another thread,
you can't do it directly as socket objects, application
objects are not thread safe, so you POST the callback
and you know that it would be called in the event loop
rather than the thread
In your case the callback of the "on_readable()" is already
called from the event loop, so you don't really need to
post() anything as you are already in the event loop,
As SSE::handle should be called from the event loop and you
are in the event loop the callback of "on_readable()"
than instead:
this->get_io_service().post(std::bind(&SSE::handle,this,....)
You just call
handle(something,ip) ...
If you still want to post() (you can but not have to), once again, lambda:
this->get_io_service().post([=,this]() {
handler(something,ip)
});
How to do it with bind? As I said before read :
http://www.boost.org/doc/libs/1_51_0/libs/bind/bind.html
Artyom Beilis
--------------
CppCMS - C++ Web Framework: http://cppcms.com/
CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/
----- Original Message -----
> From: Christian Gmeiner <chr...@gm...>
>
> I have looked quite deeply into post(..) usages, but I don't get it :/
> I have seen binder's -
> what is the concept behind them?
>
> thanks
> ---
> Christian Gmeiner MSc
>
|
|
From: Christian G. <chr...@gm...> - 2012-10-04 14:41:05
|
2012/10/4 Christian Gmeiner <chr...@gm...>:
> 2012/10/4 Artyom Beilis <art...@ya...>:
>> Read more about std::bind / boost::bind
>>
>> netlink.on_readable(std::bind(&Netlink::read));
>>
>> should be
>>
>>
>> netlink.on_readable(std::bind(&Netlink::read,&netlink,std::placeholders::_1));
>>
>> But if you already use C++11...
>
> I am using it to get std::bind (gcc version 4.6.3) as I don't wand an
> other dependency
> only to get bind working.
>
>>
>> netlink.on_readable( [&](booster::system::error_code const &e) {
>> netlink.read(e);
>> });
>>
>> Much easier to understand.
>>
>
> I really should have a closer look at C++11...
>
The netlink stuff works and I get some messages on stderr that I got a new IP.
As far as I understood the event system of cppcms I should make use of
post(..) now.
This is my current main
// start cppcms service
try
{
cppcms::service srv(argc, argv);
// add server send events asynchronous application
booster::intrusive_ptr<SSE> sse = new SSE(srv);
srv.applications_pool().mount(sse);
// add netlink listner
booster::aio::io_service &io_srv = srv.get_io_service();
Netlink netlink;
netlink.set_io_service(io_srv);
//netlink.on_readable(std::bind(&Netlink::read, &netlink));
netlink.on_readable( [&](booster::system::error_code const &e) {
netlink.read(e);
});
srv.applications_pool().mount(cppcms::applications_factory<Tssw>());
srv.run();
}
catch (std::exception const &e)
{
std::cerr << e.what() << std::endl;
}
In the SSE class I have a quite simple method called handle:
void SSE::handle(std::string name, std::string ip)
{
std::ostringstream ss;
ss << name << ", " << ip;
_stream->update(ss.str());
}
Now in my Netlink class I need to post an handler that SSE:handle gets
called... but how?
void Netlink::read(booster::system::error_code const &e)
{
int len;
struct nlmsghdr *nlh;
nlh = (struct nlmsghdr *)_buffer;
while ((len = recv(this->native(), nlh, 4096, 0)) > 0)
{
while ((NLMSG_OK(nlh, len)) && (nlh->nlmsg_type != NLMSG_DONE))
{
if (nlh->nlmsg_type == RTM_NEWADDR)
{
struct ifaddrmsg *ifa = (struct ifaddrmsg *) NLMSG_DATA(nlh);
struct rtattr *rth = IFA_RTA(ifa);
int rtl = IFA_PAYLOAD(nlh);
while (rtl && RTA_OK(rth, rtl))
{
if (rth->rta_type == IFA_LOCAL)
{
uint32_t ipaddr = htonl(*((uint32_t *) RTA_DATA(rth)));
char name[IFNAMSIZ];
if_indextoname(ifa->ifa_index, name);
fprintf(stderr, "%s is now %d.%d.%d.%d\n",
name,
(ipaddr >> 24) & 0xff,
(ipaddr >> 16) & 0xff,
(ipaddr >> 8) & 0xff,
ipaddr & 0xff);
// inform our SSE application by posting a new event
// into the event loop
this->get_io_service().post(std::bind(&SSE::handle, ...)); <<-- ?!?!
}
rth = RTA_NEXT(rth, rtl);
}
}
nlh = NLMSG_NEXT(nlh, len);
}
}
}
I have looked quite deeply into post(..) usages, but I don't get it :/
I have seen binder's -
what is the concept behind them?
thanks
---
Christian Gmeiner MSc
> thanks
> ---
> Christian Gmeiner MSc
>
>> Artyom Beilis
>> --------------
>> CppCMS - C++ Web Framework: http://cppcms.com/
>> CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/
>>
>> ________________________________
>> From: Christian Gmeiner <chr...@gm...>
>> To: Artyom Beilis <art...@ya...>; cpp...@li...
>> Sent: Thursday, October 4, 2012 2:11 PM
>> Subject: Re: [Cppcms-users] Design decision
>>
>> 2012/10/4 Artyom Beilis <art...@ya...>:
>>>>________________________________
>>>
>>>> From: Christian Gmeiner <chr...@gm...>
>>>>To: cpp...@li...
>>>>Sent: Thursday, October 4, 2012 11:01 AM
>>>>Subject: [Cppcms-users] Design decision
>>>>
>>>>Hi all.
>>>>
>>>>My cppcms based web application is in a quite good shape and I got
>>>>some ideas what
>>>>new features could be added.
>>>>
>>>>+ Detection of networking changes via PF_NETLINK socket
>>>>
>>>>At the moment it is possible to configure networking settings via
>>>>cppcms. For instance,
>>>>it is possible to use manual mode for an ethernet interface to specify
>>>>ip. netmask etc. or
>>>>use DHCP mode. If DHCP gets used the running system starts dhcp client
>>>>and it could
>>>>takes some seconds until it got a valid IP address.
>>>>
>>>>The basic idea is now to use SSE (server send events) and some
>>>>detection threads.
>>>>
>>>>Create a (cppcms ?) thread per ethernet interface and run something like
>>>>http://stackoverflow.com/questions/579783/how-to-detect-ip-address-change-programmatically-in-linux
>>>>
>>>>Then I would have a singleton class for SSE where I can call e.g.
>>>>SSE::instance()->ethernet("eth0", ip,...) and my front-end can update
>>>>the values.
>>>>
>>>>Can this work?
>>>>
>>>>
>>>>---
>>>>Christian Gmeiner, MSc
>>>>
>>>
>>> Why not?
>>>
>>> Several points
>>>
>>> 1. In there link there is an example to use it without polling, so just
>>> use basic_io_device to check
>>> for readability and then call recv
>>>
>>> So basically you don't need threads just implement event driven
>>> handling in the event loop (see tutorial for examples)
>>>
>>
>> This looks like the elegant solution I am looking for :)
>>
>> But... I don't get it up and running :/
>>
>> I decided to go this way:
>>
>> #ifndef NETLINK_H_
>> #define NETLINK_H_
>>
>> #include <booster/aio/basic_io_device.h>
>>
>> class Netlink : public booster::aio::basic_io_device
>> {
>> public:
>> Netlink();
>> ~Netlink();
>>
>> void read(booster::system::error_code const &e);
>>
>> private:
>> char _buffer[4096];
>> };
>>
>> #endif /* NETLINK_H_ */
>>
>>
>> And this is my main()
>>
>> // start cppcms service
>> try
>> {
>> cppcms::service srv(argc, argv);
>>
>> booster::aio::io_service &io_srv = srv.get_io_service();
>>
>> Netlink netlink;
>> netlink.set_io_service(io_srv);
>> netlink.on_readable(std::bind(&Netlink::read));
>>
>> srv.applications_pool().mount(cppcms::applications_factory<Tssw>());
>> srv.run();
>> }
>> catch (std::exception const &e)
>> {
>> std::cerr << e.what() << std::endl;
>> }
>>
>>
>> The big big problem is how should I use on_readable(..) ? The above example
>> does
>> not compile.
>>
>> ----
>> Christian Gmeiner, MSc
>>
>> ------------------------------------------------------------------------------
>> Don't let slow site performance ruin your business. Deploy New Relic APM
>> Deploy New Relic app performance management and know exactly
>> what is happening inside your Ruby, Python, PHP, Java, and .NET app
>> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
>> http://p.sf.net/sfu/newrelic-dev2dev
>> _______________________________________________
>> Cppcms-users mailing list
>> Cpp...@li...
>> https://lists.sourceforge.net/lists/listinfo/cppcms-users
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Don't let slow site performance ruin your business. Deploy New Relic APM
>> Deploy New Relic app performance management and know exactly
>> what is happening inside your Ruby, Python, PHP, Java, and .NET app
>> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
>> http://p.sf.net/sfu/newrelic-dev2dev
>> _______________________________________________
>> Cppcms-users mailing list
>> Cpp...@li...
>> https://lists.sourceforge.net/lists/listinfo/cppcms-users
>>
|
|
From: Christian G. <chr...@gm...> - 2012-10-04 12:46:46
|
2012/10/4 Artyom Beilis <art...@ya...>:
> Read more about std::bind / boost::bind
>
> netlink.on_readable(std::bind(&Netlink::read));
>
> should be
>
>
> netlink.on_readable(std::bind(&Netlink::read,&netlink,std::placeholders::_1));
>
> But if you already use C++11...
I am using it to get std::bind (gcc version 4.6.3) as I don't wand an
other dependency
only to get bind working.
>
> netlink.on_readable( [&](booster::system::error_code const &e) {
> netlink.read(e);
> });
>
> Much easier to understand.
>
I really should have a closer look at C++11...
thanks
---
Christian Gmeiner MSc
> Artyom Beilis
> --------------
> CppCMS - C++ Web Framework: http://cppcms.com/
> CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/
>
> ________________________________
> From: Christian Gmeiner <chr...@gm...>
> To: Artyom Beilis <art...@ya...>; cpp...@li...
> Sent: Thursday, October 4, 2012 2:11 PM
> Subject: Re: [Cppcms-users] Design decision
>
> 2012/10/4 Artyom Beilis <art...@ya...>:
>>>________________________________
>>
>>> From: Christian Gmeiner <chr...@gm...>
>>>To: cpp...@li...
>>>Sent: Thursday, October 4, 2012 11:01 AM
>>>Subject: [Cppcms-users] Design decision
>>>
>>>Hi all.
>>>
>>>My cppcms based web application is in a quite good shape and I got
>>>some ideas what
>>>new features could be added.
>>>
>>>+ Detection of networking changes via PF_NETLINK socket
>>>
>>>At the moment it is possible to configure networking settings via
>>>cppcms. For instance,
>>>it is possible to use manual mode for an ethernet interface to specify
>>>ip. netmask etc. or
>>>use DHCP mode. If DHCP gets used the running system starts dhcp client
>>>and it could
>>>takes some seconds until it got a valid IP address.
>>>
>>>The basic idea is now to use SSE (server send events) and some
>>>detection threads.
>>>
>>>Create a (cppcms ?) thread per ethernet interface and run something like
>>>http://stackoverflow.com/questions/579783/how-to-detect-ip-address-change-programmatically-in-linux
>>>
>>>Then I would have a singleton class for SSE where I can call e.g.
>>>SSE::instance()->ethernet("eth0", ip,...) and my front-end can update
>>>the values.
>>>
>>>Can this work?
>>>
>>>
>>>---
>>>Christian Gmeiner, MSc
>>>
>>
>> Why not?
>>
>> Several points
>>
>> 1. In there link there is an example to use it without polling, so just
>> use basic_io_device to check
>> for readability and then call recv
>>
>> So basically you don't need threads just implement event driven
>> handling in the event loop (see tutorial for examples)
>>
>
> This looks like the elegant solution I am looking for :)
>
> But... I don't get it up and running :/
>
> I decided to go this way:
>
> #ifndef NETLINK_H_
> #define NETLINK_H_
>
> #include <booster/aio/basic_io_device.h>
>
> class Netlink : public booster::aio::basic_io_device
> {
> public:
> Netlink();
> ~Netlink();
>
> void read(booster::system::error_code const &e);
>
> private:
> char _buffer[4096];
> };
>
> #endif /* NETLINK_H_ */
>
>
> And this is my main()
>
> // start cppcms service
> try
> {
> cppcms::service srv(argc, argv);
>
> booster::aio::io_service &io_srv = srv.get_io_service();
>
> Netlink netlink;
> netlink.set_io_service(io_srv);
> netlink.on_readable(std::bind(&Netlink::read));
>
> srv.applications_pool().mount(cppcms::applications_factory<Tssw>());
> srv.run();
> }
> catch (std::exception const &e)
> {
> std::cerr << e.what() << std::endl;
> }
>
>
> The big big problem is how should I use on_readable(..) ? The above example
> does
> not compile.
>
> ----
> Christian Gmeiner, MSc
>
> ------------------------------------------------------------------------------
> Don't let slow site performance ruin your business. Deploy New Relic APM
> Deploy New Relic app performance management and know exactly
> what is happening inside your Ruby, Python, PHP, Java, and .NET app
> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
> http://p.sf.net/sfu/newrelic-dev2dev
> _______________________________________________
> Cppcms-users mailing list
> Cpp...@li...
> https://lists.sourceforge.net/lists/listinfo/cppcms-users
>
>
>
> ------------------------------------------------------------------------------
> Don't let slow site performance ruin your business. Deploy New Relic APM
> Deploy New Relic app performance management and know exactly
> what is happening inside your Ruby, Python, PHP, Java, and .NET app
> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
> http://p.sf.net/sfu/newrelic-dev2dev
> _______________________________________________
> Cppcms-users mailing list
> Cpp...@li...
> https://lists.sourceforge.net/lists/listinfo/cppcms-users
>
|
|
From: Artyom B. <art...@ya...> - 2012-10-04 12:37:13
|
Read more about std::bind / boost::bind
netlink.on_readable(std::bind(&Netlink::read));
should be
netlink.on_readable(std::bind(&Netlink::read,&netlink,std::placeholders::_1));
But if you already use C++11...
netlink.on_readable( [&](booster::system::error_code const &e) {
netlink.read(e);
});
Much easier to understand.
Artyom Beilis
--------------
CppCMS - C++ Web Framework: http://cppcms.com/
CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/
>________________________________
> From: Christian Gmeiner <chr...@gm...>
>To: Artyom Beilis <art...@ya...>; cpp...@li...
>Sent: Thursday, October 4, 2012 2:11 PM
>Subject: Re: [Cppcms-users] Design decision
>
>2012/10/4 Artyom Beilis <art...@ya...>:
>>>________________________________
>>
>>> From: Christian Gmeiner <chr...@gm...>
>>>To: cpp...@li...
>>>Sent: Thursday, October 4, 2012 11:01 AM
>>>Subject: [Cppcms-users] Design decision
>>>
>>>Hi all.
>>>
>>>My cppcms based web application is in a quite good shape and I got
>>>some ideas what
>>>new features could be added.
>>>
>>>+ Detection of networking changes via PF_NETLINK socket
>>>
>>>At the moment it is possible to configure networking settings via
>>>cppcms. For instance,
>>>it is possible to use manual mode for an ethernet interface to specify
>>>ip. netmask etc. or
>>>use DHCP mode. If DHCP gets used the running system starts dhcp client
>>>and it could
>>>takes some seconds until it got a valid IP address.
>>>
>>>The basic idea is now to use SSE (server send events) and some
>>>detection threads.
>>>
>>>Create a (cppcms ?) thread per ethernet interface and run something like
>>>http://stackoverflow.com/questions/579783/how-to-detect-ip-address-change-programmatically-in-linux
>>>
>>>Then I would have a singleton class for SSE where I can call e.g.
>>>SSE::instance()->ethernet("eth0", ip,...) and my front-end can update
>>>the values.
>>>
>>>Can this work?
>>>
>>>
>>>---
>>>Christian Gmeiner, MSc
>>>
>>
>> Why not?
>>
>> Several points
>>
>> 1. In there link there is an example to use it without polling, so just use basic_io_device to check
>> for readability and then call recv
>>
>> So basically you don't need threads just implement event driven
>> handling in the event loop (see tutorial for examples)
>>
>
>This looks like the elegant solution I am looking for :)
>
>But... I don't get it up and running :/
>
>I decided to go this way:
>
>#ifndef NETLINK_H_
>#define NETLINK_H_
>
>#include <booster/aio/basic_io_device.h>
>
>class Netlink : public booster::aio::basic_io_device
>{
>public:
> Netlink();
> ~Netlink();
>
> void read(booster::system::error_code const &e);
>
>private:
> char _buffer[4096];
>};
>
>#endif /* NETLINK_H_ */
>
>
>And this is my main()
>
> // start cppcms service
> try
> {
> cppcms::service srv(argc, argv);
>
> booster::aio::io_service &io_srv = srv.get_io_service();
>
> Netlink netlink;
> netlink.set_io_service(io_srv);
> netlink.on_readable(std::bind(&Netlink::read));
>
> srv.applications_pool().mount(cppcms::applications_factory<Tssw>());
> srv.run();
> }
> catch (std::exception const &e)
> {
> std::cerr << e.what() << std::endl;
> }
>
>
>The big big problem is how should I use on_readable(..) ? The above example does
>not compile.
>
>----
>Christian Gmeiner, MSc
>
>------------------------------------------------------------------------------
>Don't let slow site performance ruin your business. Deploy New Relic APM
>Deploy New Relic app performance management and know exactly
>what is happening inside your Ruby, Python, PHP, Java, and .NET app
>Try New Relic at no cost today and get our sweet Data Nerd shirt too!
>http://p.sf.net/sfu/newrelic-dev2dev
>_______________________________________________
>Cppcms-users mailing list
>Cpp...@li...
>https://lists.sourceforge.net/lists/listinfo/cppcms-users
>
>
> |
|
From: Christian G. <chr...@gm...> - 2012-10-04 12:11:32
|
2012/10/4 Artyom Beilis <art...@ya...>: >>________________________________ > >> From: Christian Gmeiner <chr...@gm...> >>To: cpp...@li... >>Sent: Thursday, October 4, 2012 11:01 AM >>Subject: [Cppcms-users] Design decision >> >>Hi all. >> >>My cppcms based web application is in a quite good shape and I got >>some ideas what >>new features could be added. >> >>+ Detection of networking changes via PF_NETLINK socket >> >>At the moment it is possible to configure networking settings via >>cppcms. For instance, >>it is possible to use manual mode for an ethernet interface to specify >>ip. netmask etc. or >>use DHCP mode. If DHCP gets used the running system starts dhcp client >>and it could >>takes some seconds until it got a valid IP address. >> >>The basic idea is now to use SSE (server send events) and some >>detection threads. >> >>Create a (cppcms ?) thread per ethernet interface and run something like >>http://stackoverflow.com/questions/579783/how-to-detect-ip-address-change-programmatically-in-linux >> >>Then I would have a singleton class for SSE where I can call e.g. >>SSE::instance()->ethernet("eth0", ip,...) and my front-end can update >>the values. >> >>Can this work? >> >> >>--- >>Christian Gmeiner, MSc >> > > Why not? > > Several points > > 1. In there link there is an example to use it without polling, so just use basic_io_device to check > for readability and then call recv > > So basically you don't need threads just implement event driven > handling in the event loop (see tutorial for examples) > This looks like the elegant solution I am looking for :) But... I don't get it up and running :/ I decided to go this way: #ifndef NETLINK_H_ #define NETLINK_H_ #include <booster/aio/basic_io_device.h> class Netlink : public booster::aio::basic_io_device { public: Netlink(); ~Netlink(); void read(booster::system::error_code const &e); private: char _buffer[4096]; }; #endif /* NETLINK_H_ */ And this is my main() // start cppcms service try { cppcms::service srv(argc, argv); booster::aio::io_service &io_srv = srv.get_io_service(); Netlink netlink; netlink.set_io_service(io_srv); netlink.on_readable(std::bind(&Netlink::read)); srv.applications_pool().mount(cppcms::applications_factory<Tssw>()); srv.run(); } catch (std::exception const &e) { std::cerr << e.what() << std::endl; } The big big problem is how should I use on_readable(..) ? The above example does not compile. ---- Christian Gmeiner, MSc |
|
From: Artyom B. <art...@ya...> - 2012-10-04 09:20:42
|
>________________________________ > From: Christian Gmeiner <chr...@gm...> >To: cpp...@li... >Sent: Thursday, October 4, 2012 11:01 AM >Subject: [Cppcms-users] Design decision > >Hi all. > >My cppcms based web application is in a quite good shape and I got >some ideas what >new features could be added. > >+ Detection of networking changes via PF_NETLINK socket > >At the moment it is possible to configure networking settings via >cppcms. For instance, >it is possible to use manual mode for an ethernet interface to specify >ip. netmask etc. or >use DHCP mode. If DHCP gets used the running system starts dhcp client >and it could >takes some seconds until it got a valid IP address. > >The basic idea is now to use SSE (server send events) and some >detection threads. > >Create a (cppcms ?) thread per ethernet interface and run something like >http://stackoverflow.com/questions/579783/how-to-detect-ip-address-change-programmatically-in-linux > >Then I would have a singleton class for SSE where I can call e.g. >SSE::instance()->ethernet("eth0", ip,...) and my front-end can update >the values. > >Can this work? > > >--- >Christian Gmeiner, MSc > Why not? Several points 1. In there link there is an example to use it without polling, so just use basic_io_device to check for readability and then call recv So basically you don't need threads just implement event driven handling in the event loop (see tutorial for examples) 2. 2nd point is that if you still want to use threads, make sure that you do not use can SSE asynchronous app from another thread, i.e. you need to post a callback to the event loop (via post) that would be executed in the main event loop. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ |
|
From: Christian G. <chr...@gm...> - 2012-10-04 09:02:26
|
Hi all. My cppcms based web application is in a quite good shape and I got some ideas what new features could be added. + Detection of networking changes via PF_NETLINK socket At the moment it is possible to configure networking settings via cppcms. For instance, it is possible to use manual mode for an ethernet interface to specify ip. netmask etc. or use DHCP mode. If DHCP gets used the running system starts dhcp client and it could takes some seconds until it got a valid IP address. The basic idea is now to use SSE (server send events) and some detection threads. Create a (cppcms ?) thread per ethernet interface and run something like http://stackoverflow.com/questions/579783/how-to-detect-ip-address-change-programmatically-in-linux Then I would have a singleton class for SSE where I can call e.g. SSE::instance()->ethernet("eth0", ip,...) and my front-end can update the values. Can this work? --- Christian Gmeiner, MSc |
|
From: Lee E. <lee...@gm...> - 2012-10-01 19:22:49
|
do not do the check in the template - do the check in the method that calls
the template - and store the result of your check into the content object
you give to the view
you can even simply store the link url or the even the link element - and
hen remove the if from your template altogether
On Sun, Sep 30, 2012 at 1:40 PM, sergey lavrov <ccp...@gm...>wrote:
> Dear All!
>
> I need to check in template if file exists.
> What is the best practise to do this?
>
> Example:
> if (file_exists("<%= media %>/css/style.css")) {
> <link href="<%= media %>/css/style.css" rel="stylesheet"
> type="text/css" />
> }
>
> Thanks in advance!
>
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://ad.doubleclick.net/clk;258768047;13503038;j?
> http://info.appdynamics.com/FreeJavaPerformanceDownload.html
> _______________________________________________
> Cppcms-users mailing list
> Cpp...@li...
> https://lists.sourceforge.net/lists/listinfo/cppcms-users
>
>
--
--
lee
Lee Elenbaas
lee...@gm...
|
|
From: 陈抒 <csf...@gm...> - 2012-10-01 08:35:50
|
Sorry, it should be millisecond. 陈抒 Best regards http://blog.csdn.net/sheismylife On Mon, Oct 1, 2012 at 4:28 PM, 陈抒 <csf...@gm...> wrote: > Hello > When developing a TCP server, always need to measure performance. Is it > a possible to add an option for showing micro seconds(10e-3) in log file? > For now the following statement will generate a log record with date > time: > BOOSTER_NOTICE("my_service") << "send bind code succeeded."; > > => > 2012-10-01 16:15:43; my_service, notice: send bind code succeeded. > (my_service.cpp:160) > > > > > 陈抒 > Best regards > http://blog.csdn.net/sheismylife > |
|
From: 陈抒 <csf...@gm...> - 2012-10-01 08:29:30
|
Hello
When developing a TCP server, always need to measure performance. Is it a
possible to add an option for showing micro seconds(10e-3) in log file?
For now the following statement will generate a log record with date time:
BOOSTER_NOTICE("my_service") << "send bind code succeeded.";
=>
2012-10-01 16:15:43; my_service, notice: send bind code succeeded.
(my_service.cpp:160)
陈抒
Best regards
http://blog.csdn.net/sheismylife
|
|
From: sergey l. <ccp...@gm...> - 2012-09-30 11:40:54
|
Dear All!
I need to check in template if file exists.
What is the best practise to do this?
Example:
if (file_exists("<%= media %>/css/style.css")) {
<link href="<%= media %>/css/style.css" rel="stylesheet"
type="text/css" />
}
Thanks in advance!
|
|
From: Christian G. <chr...@gm...> - 2012-09-27 10:29:41
|
Hi, > Can you send the patch as an attachment and not "in-line" also please open a > feature request or patch > in tracking system so I'll not forget it. > sure > Also I need your agreement to this: > > http://cppcms.com/wikipp/en/page/cppcms_1x_coding_standards#Copyrights > > (i.e. copyright transfer) > I agree on that. --- Christian Gmeiner, MSc |
|
From: Artyom B. <art...@ya...> - 2012-09-27 09:29:31
|
Hi, Can you send the patch as an attachment and not "in-line" also please open a feature request or patch in tracking system so I'll not forget it. Also I need your agreement to this: http://cppcms.com/wikipp/en/page/cppcms_1x_coding_standards#Copyrights (i.e. copyright transfer) Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: Christian Gmeiner <chr...@gm...> >To: cpp...@li... >Sent: Thursday, September 27, 2012 8:16 AM >Subject: [Cppcms-users] [PATCH] Add support for readonly HTML attribute > >This patch adds support for readonly HTML attribute [0]. > >[0] http://www.w3schools.com/tags/att_input_readonly.asp > >Signed-off-by: Christian Gmeiner <chr...@gm...> >--- > >diff -Nur build_org/dependencies/src/cppcms-1.0.2/cppcms/form.h >build/dependencies/src/cppcms-1.0.2/cppcms/form.h >--- build_org/dependencies/src/cppcms-1.0.2/cppcms/form.h 2012-08-14 >09:42:24.000000000 +0200 >+++ build/dependencies/src/cppcms-1.0.2/cppcms/form.h 2012-09-26 >18:32:21.869608847 +0200 >@@ -533,6 +533,17 @@ > /// > void disabled(bool); > >+ >+ /// >+ /// Get the HTML \c readonly attribute. >+ /// >+ bool readonly(); >+ >+ /// >+ /// Set/Unset the HTML \c readonly attribute. >+ /// >+ void readonly(bool); >+ > /// > /// Get the general user defined attribute string that can be >added to the widget. > /// >@@ -685,11 +696,12 @@ > uint32_t is_valid_ : 1; > uint32_t is_set_ : 1; > uint32_t is_disabled_ : 1; >+ uint32_t is_readonly_ : 1; > uint32_t is_generation_done_ : 1; > uint32_t has_message_ : 1; > uint32_t has_error_ : 1; > uint32_t has_help_ : 1; >- uint32_t reserverd_ : 25; >+ uint32_t reserverd_ : 24; > > struct _data; > booster::hold_ptr<_data> d; >diff -Nur build_org/dependencies/src/cppcms-1.0.2/src/form.cpp >build/dependencies/src/cppcms-1.0.2/src/form.cpp >--- build_org/dependencies/src/cppcms-1.0.2/src/form.cpp 2012-08-14 >09:42:24.000000000 +0200 >+++ build/dependencies/src/cppcms-1.0.2/src/form.cpp 2012-09-26 >18:23:51.181619376 +0200 >@@ -280,6 +280,7 @@ > is_valid_(1), > is_set_(0), > is_disabled_(0), >+ is_readonly_(0), > is_generation_done_(0), > has_message_(0), > has_error_(0), >@@ -411,6 +412,16 @@ > is_disabled_=v; >} > >+bool base_widget::readonly() >+{ >+ return is_readonly_; >+} >+ >+void base_widget::readonly(bool v) >+{ >+ is_readonly_=v; >+} >+ >std::string base_widget::attributes_string() >{ > return attr_; >@@ -676,6 +687,9 @@ > if(lm.second >= 0 && validate_charset()) { > output << boost::format("maxlength=\"%1%\" >",std::locale::classic()) % lm.second; > } >+ if(readonly()) { >+ output << "readonly=\"readonly\""; >+ } >} > >------------------------------------------------------------------------------ >Everyone hates slow websites. So do we. >Make your web apps faster with AppDynamics >Download AppDynamics Lite for free today: >http://ad.doubleclick.net/clk;258768047;13503038;j? >http://info.appdynamics.com/FreeJavaPerformanceDownload.html >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |
|
From: Christian G. <chr...@gm...> - 2012-09-27 06:16:38
|
This patch adds support for readonly HTML attribute [0]. [0] http://www.w3schools.com/tags/att_input_readonly.asp Signed-off-by: Christian Gmeiner <chr...@gm...> --- diff -Nur build_org/dependencies/src/cppcms-1.0.2/cppcms/form.h build/dependencies/src/cppcms-1.0.2/cppcms/form.h --- build_org/dependencies/src/cppcms-1.0.2/cppcms/form.h 2012-08-14 09:42:24.000000000 +0200 +++ build/dependencies/src/cppcms-1.0.2/cppcms/form.h 2012-09-26 18:32:21.869608847 +0200 @@ -533,6 +533,17 @@ /// void disabled(bool); + + /// + /// Get the HTML \c readonly attribute. + /// + bool readonly(); + + /// + /// Set/Unset the HTML \c readonly attribute. + /// + void readonly(bool); + /// /// Get the general user defined attribute string that can be added to the widget. /// @@ -685,11 +696,12 @@ uint32_t is_valid_ : 1; uint32_t is_set_ : 1; uint32_t is_disabled_ : 1; + uint32_t is_readonly_ : 1; uint32_t is_generation_done_ : 1; uint32_t has_message_ : 1; uint32_t has_error_ : 1; uint32_t has_help_ : 1; - uint32_t reserverd_ : 25; + uint32_t reserverd_ : 24; struct _data; booster::hold_ptr<_data> d; diff -Nur build_org/dependencies/src/cppcms-1.0.2/src/form.cpp build/dependencies/src/cppcms-1.0.2/src/form.cpp --- build_org/dependencies/src/cppcms-1.0.2/src/form.cpp 2012-08-14 09:42:24.000000000 +0200 +++ build/dependencies/src/cppcms-1.0.2/src/form.cpp 2012-09-26 18:23:51.181619376 +0200 @@ -280,6 +280,7 @@ is_valid_(1), is_set_(0), is_disabled_(0), + is_readonly_(0), is_generation_done_(0), has_message_(0), has_error_(0), @@ -411,6 +412,16 @@ is_disabled_=v; } +bool base_widget::readonly() +{ + return is_readonly_; +} + +void base_widget::readonly(bool v) +{ + is_readonly_=v; +} + std::string base_widget::attributes_string() { return attr_; @@ -676,6 +687,9 @@ if(lm.second >= 0 && validate_charset()) { output << boost::format("maxlength=\"%1%\" ",std::locale::classic()) % lm.second; } + if(readonly()) { + output << "readonly=\"readonly\""; + } } |
|
From: Artyom B. <art...@ya...> - 2012-09-26 17:57:39
|
Just open the define as usual and than you can assign it to booster::aio::basic_io_device and than check it for readability/writeability and do usual stuff withing booster::aio::event_loop See also: http://cppcms.com/cppcms_ref/latest/classbooster_1_1aio_1_1basic__io__device.html http://cppcms.com/wikipp/en/page/cppcms_1x_aio Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: Dietrich Müller <die...@gm...> >To: cpp...@li... >Sent: Tuesday, September 25, 2012 3:56 PM >Subject: [Cppcms-users] booster::aio::basic_io_device open /dev/ttyUSBX ?? > > >Hey, >I want to read and write data to a virtual serial port. In boost::asio you have the serial_port class for communication. >How can I do it with booster::aio? > >thank you > >------------------------------------------------------------------------------ >Live Security Virtual Conference >Exclusive live event will cover all the ways today's security and >threat landscape has changed and how IT managers can respond. Discussions >will include endpoint security, mobile security and the latest in malware >threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |
|
From: Dietrich M. <die...@gm...> - 2012-09-25 13:56:31
|
Hey, I want to read and write data to a virtual serial port. In boost::asio you have the serial_port class for communication. How can I do it with booster::aio? thank you |
|
From: Christian G. <chr...@gm...> - 2012-09-22 20:17:12
|
2012/9/22 Christian Gmeiner <chr...@gm...>:
> Hi all,
>
>
> I have found some time and I am still working in this issue. The
> current state is the following:
>
> void Service::calibrate()
> {
> // valid session needed
> if (!session().is_set("user"))
> {
> BOOSTER_DEBUG("Service") << __func__ << ") not logged in";
> return;
> }
>
> // only local host is allowed to do this
> if (request().remote_addr() != "127.0.0.1")
> {
> BOOSTER_DEBUG("Service") << __func__ << ") only on local host
> - called from " << request().remote_addr();
> response().out() << "$.jGrowl(\"" << translate("Touch
> calibration only allowed on local host") << "\");" << "\n";
> return;
> }
>
> response().out() << "$.jGrowl(\"" << translate("Starting
> calibration") << "...\");" << "\n";
> BOOSTER_DEBUG("Service") << __func__ << ") doing action";
>
> system("/opt/scripts/set-backlight.sh 0");
> system("/opt/scripts/xcalibrate-touch.sh");
> system("/opt/scripts/set-backlight.sh 100");
>
> BOOSTER_DEBUG("Service") << __func__ << ") done";
> }
>
>
> system("/opt/scripts/set-backlight.sh 0"); call works as expected but
> the whole web apps hangs
> at the next call:
> system("/opt/scripts/xcalibrate-touch.sh");
>
>
> -----------------------------------------
> #!/bin/bash
> # Invokes touch screen calibrator (x11)
>
> export DISPLAY=:0.0
> BINARY=/opt/xinput_calibrator
>
> CALDATA=`$BINARY | grep 'Setting new calibration data:' | cut -d ":"
> -f 2 | tr -d ' ' | sed 's/,/ /g'`
>
> # if CALDATA is empty simply return
> if [ -z $CALDATA ]; then
> exit 0
> fi
>
> # at the moment we store our axis_calib data in
> # the ID-Register. in some rare cases the
> # ID-Register is not accessable and we need a
> # fallback place to store our data.
> if [ -e /proc/idreg/axis_calib ]; then
> echo $CALDATA > /proc/idreg/axis_calib
> else
> echo $CALDATA > /home/vis/.axis_calib
> fi
> -----------------------------------------
>
> xinput_calibrator can be found here https://github.com/tias/xinput_calibrator
>
>
> At the moment I am not sure whats wrong and how to debug it. maybe someone
> has an idea.
>
Here is the syslog output:
May 31 08:00:38 OT tssw: ajax_render: template: touch_display
chromeless: 1 (base.cpp:79)
May 31 08:00:38 OT tssw: i18n: current used locale en (base.cpp:88)
May 31 08:00:38 OT tssw: cppcms_http: GET /keyboard.png (http_api.cpp:251)
May 31 08:00:38 OT tssw: cppcms_http: GET /favicon.ico (http_api.cpp:251)
May 31 08:00:41 OT tssw: cppcms_http: POST /tssw/rpc (http_api.cpp:251)
May 31 08:00:41 OT tssw: cppcms: JSON-RPC Method call:calibrate
(rpc_json.cpp:162)
May 31 08:00:41 OT tssw: TsswService: calibrate) doing action (tssw.cpp:73)
---
Christian Gmeiner, MSc
|
|
From: Christian G. <chr...@gm...> - 2012-09-22 20:16:15
|
Hi all,
I have found some time and I am still working in this issue. The
current state is the following:
void Service::calibrate()
{
// valid session needed
if (!session().is_set("user"))
{
BOOSTER_DEBUG("Service") << __func__ << ") not logged in";
return;
}
// only local host is allowed to do this
if (request().remote_addr() != "127.0.0.1")
{
BOOSTER_DEBUG("Service") << __func__ << ") only on local host
- called from " << request().remote_addr();
response().out() << "$.jGrowl(\"" << translate("Touch
calibration only allowed on local host") << "\");" << "\n";
return;
}
response().out() << "$.jGrowl(\"" << translate("Starting
calibration") << "...\");" << "\n";
BOOSTER_DEBUG("Service") << __func__ << ") doing action";
system("/opt/scripts/set-backlight.sh 0");
system("/opt/scripts/xcalibrate-touch.sh");
system("/opt/scripts/set-backlight.sh 100");
BOOSTER_DEBUG("Service") << __func__ << ") done";
}
system("/opt/scripts/set-backlight.sh 0"); call works as expected but
the whole web apps hangs
at the next call:
system("/opt/scripts/xcalibrate-touch.sh");
-----------------------------------------
#!/bin/bash
# Invokes touch screen calibrator (x11)
export DISPLAY=:0.0
BINARY=/opt/xinput_calibrator
CALDATA=`$BINARY | grep 'Setting new calibration data:' | cut -d ":"
-f 2 | tr -d ' ' | sed 's/,/ /g'`
# if CALDATA is empty simply return
if [ -z $CALDATA ]; then
exit 0
fi
# at the moment we store our axis_calib data in
# the ID-Register. in some rare cases the
# ID-Register is not accessable and we need a
# fallback place to store our data.
if [ -e /proc/idreg/axis_calib ]; then
echo $CALDATA > /proc/idreg/axis_calib
else
echo $CALDATA > /home/vis/.axis_calib
fi
-----------------------------------------
xinput_calibrator can be found here https://github.com/tias/xinput_calibrator
At the moment I am not sure whats wrong and how to debug it. maybe someone
has an idea.
---
Christian Gmeiner, MSc
2012/7/19 Artyom Beilis <art...@ya...>:
>
>
> ----- Original Message -----
>> From: Christian Gmeiner <chr...@gm...>
>> To: Artyom Beilis <art...@ya...>; cpp...@li...
>> Cc:
>> Sent: Thursday, July 19, 2012 3:58 PM
>> Subject: Re: [Cppcms-users] cppcms::service and system(..)
>>
>> 2012/7/19 Artyom Beilis <art...@ya...>:
>>> Make sure you do not call system from asynchronous application - call it
>>> only from thread pool
>>>
>>
>> The asynchronous application (javascript RPC) get the call to execute
>> a bash script
>
> Asynchronous JavaScript or Asynchronously mounted CppCMS Application/RPC
>
> http://cppcms.com/wikipp/en/page/cppcms_1x_application_lifetime
>
> I mean if you mount an application asynchronously than you can't call system from there
> as all I/O would be blocked by system
>
>> via system(..). How can I trigger the calling from thread pool?
>
> See in cppcms::service::thread_pool and cppcms::thread_pool documentation
>
>
>
> Artyom Beilis
>
> --------------
> CppCMS - C++ Web Framework: http://cppcms.com/
> CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/
>
>
>>
>> thanks
>> ---
>> Christian Gmeiner, MSc
>>
>> ------------------------------------------------------------------------------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and
>> threat landscape has changed and how IT managers can respond. Discussions
>> will include endpoint security, mobile security and the latest in malware
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> _______________________________________________
>> Cppcms-users mailing list
>> Cpp...@li...
>> https://lists.sourceforge.net/lists/listinfo/cppcms-users
>>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Cppcms-users mailing list
> Cpp...@li...
> https://lists.sourceforge.net/lists/listinfo/cppcms-users
|
|
From: Sergey <dan...@gm...> - 2012-09-20 19:18:04
|
Shiv Shankar Dayal <shivshankar.dayal@...> writes: > > > That is not a bad expectation. If I make money by using CppCMS I will certainly donatesome of it. But I am open source developer myself. I think that you can support the author. Good tool. Good documentation, support (help etc...), many examples. > On Thu, Sep 20, 2012 at 7:13 PM, augustin <augustin-cppcms- MsFEWwaq/URx...@pu...> wrote: > On Thursday, September 20, 2012 04:42:37 PM Shiv Shankar Dayal wrote: > > Hi, > > > > Thanks for making such a nice framework. I have started using it on > > GNU/Linux. I am learning it and as I have said previously I will use it to > > make my applications. > > > > Thanks a lot. > Here is the way he responded the last time we used the list to show our > appreciation: > On Monday, May 28, 2012 09:44:24 PM Artyom Beilis wrote: > > Sourceforge has a donation system: > > > > https://sourceforge.net/donate/index.php?group_id=209965 > > > > Feel free to express your appreciation using it > > > > > > Artyom Beilis > -- > Friends: http://www.reuniting.info/ > My projects:http://astralcity.org/ http://lesenjeux.fr/ http://linux.overshoot.tv/http://overshoot.tv/ http://charityware.info/ http://masquilier.org/http://openteacher.info/ http://minguo.info/ http://jacqueslemaire.fr/http://www.wechange.org/ http://searching911.info/ > . > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today:http://ad.doubleclick.net/clk;258768047;13503038;j? http://info.appdynamics.com/FreeJavaPerformanceDownload.html > _______________________________________________ > Cppcms-users mailing listCppcms-users- 5NW...@pu...://lists.sourceforge.net/lists/lis tinfo/cppcms-users > > > -- Best regards,Shiv Shankar Dayal > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://ad.doubleclick.net/clk;258768047;13503038;j? > http://info.appdynamics.com/FreeJavaPerformanceDownload.html |
|
From: Shiv S. D. <shi...@gm...> - 2012-09-20 14:44:09
|
That is not a bad expectation. If I make money by using CppCMS I will certainly donate some of it. But I am open source developer myself. :-) On Thu, Sep 20, 2012 at 7:13 PM, augustin <aug...@ov...>wrote: > On Thursday, September 20, 2012 04:42:37 PM Shiv Shankar Dayal wrote: > > Hi, > > > > Thanks for making such a nice framework. I have started using it on > > GNU/Linux. I am learning it and as I have said previously I will use it > to > > make my applications. > > > > Thanks a lot. > > Here is the way he responded the last time we used the list to show our > appreciation: > > > > On Monday, May 28, 2012 09:44:24 PM Artyom Beilis wrote: > > Sourceforge has a donation system: > > > > https://sourceforge.net/donate/index.php?group_id=209965 > > > > Feel free to express your appreciation using it :-) > > > > > > Artyom Beilis > > > -- > Friends: http://www.reuniting.info/ > My projects: > http://astralcity.org/ http://lesenjeux.fr/ http://linux.overshoot.tv/ > http://overshoot.tv/ http://charityware.info/ http://masquilier.org/ > http://openteacher.info/ http://minguo.info/ http://jacqueslemaire.fr/ > http://www.wechange.org/ http://searching911.info/ > > > > > > > > > > > > > . > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://ad.doubleclick.net/clk;258768047;13503038;j? > http://info.appdynamics.com/FreeJavaPerformanceDownload.html > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > -- Best regards, Shiv Shankar Dayal |
|
From: augustin <aug...@ov...> - 2012-09-20 14:06:36
|
On Thursday, September 20, 2012 04:42:37 PM Shiv Shankar Dayal wrote: > Hi, > > Thanks for making such a nice framework. I have started using it on > GNU/Linux. I am learning it and as I have said previously I will use it to > make my applications. > > Thanks a lot. Here is the way he responded the last time we used the list to show our appreciation: On Monday, May 28, 2012 09:44:24 PM Artyom Beilis wrote: > Sourceforge has a donation system: > > https://sourceforge.net/donate/index.php?group_id=209965 > > Feel free to express your appreciation using it :-) > > > Artyom Beilis -- Friends: http://www.reuniting.info/ My projects: http://astralcity.org/ http://lesenjeux.fr/ http://linux.overshoot.tv/ http://overshoot.tv/ http://charityware.info/ http://masquilier.org/ http://openteacher.info/ http://minguo.info/ http://jacqueslemaire.fr/ http://www.wechange.org/ http://searching911.info/ . |
|
From: Dietrich M. <die...@gm...> - 2012-09-20 13:32:44
|
On Thu, Sep 20, 2012 at 1:40 PM, <ele...@ex...> wrote: > > Hey, > > I would like to see an example for iterating through a given json object > > variable. > > I tried the following: > > Ok here it is again > > http://www.cplusplus.com/reference/stl/map/ > > std::map defines no operator< (less than operator). You have to use the > "not equals" operator to check for bounds. This is because > std::map::iterator is not a random access iterator, and therefore cannot > provide a less than operator. > > Petr > > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://ad.doubleclick.net/clk;258768047;13503038;j? > http://info.appdynamics.com/FreeJavaPerformanceDownload.html > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > Thanks, but I figured it out by myself yesterday. |
|
From: <ele...@ex...> - 2012-09-20 11:40:46
|
> Hey, > I would like to see an example for iterating through a given json object > variable. > I tried the following: Ok here it is again http://www.cplusplus.com/reference/stl/map/ std::map defines no operator< (less than operator). You have to use the "not equals" operator to check for bounds. This is because std::map::iterator is not a random access iterator, and therefore cannot provide a less than operator. Petr |
|
From: Shiv S. D. <shi...@gm...> - 2012-09-20 08:42:45
|
Hi, Thanks for making such a nice framework. I have started using it on GNU/Linux. I am learning it and as I have said previously I will use it to make my applications. Thanks a lot. -- Best regards, Shiv Shankar Dayal |
|
From: Shiv S. D. <shi...@gm...> - 2012-09-20 07:08:50
|
Hi,
I created build directory as instructed on website and did $cmake ..
Here is full log.
Shiv-Dayals-Mac-mini:build root# cmake ..
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Check for working C compiler: /Volumes/GNU/Volumes/GNU/usr/bin/gcc
-- Check for working C compiler: /Volumes/GNU/Volumes/GNU/usr/bin/gcc --
works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Check for working CXX compiler: /Volumes/GNU/Volumes/GNU/usr/bin/c++
-- Check for working CXX compiler: /Volumes/GNU/Volumes/GNU/usr/bin/c++ --
works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Warning at
/Volumes/GNU/usr/local/Cellar/cmake/2.8.7/share/cmake/Modules/CPack.cmake:236
(MESSAGE):
CPack.cmake has already been included!!
Call Stack (most recent call first):
/Volumes/GNU/Volumes/GNU/Volumes/GNU/Volumes/GNU/Users/shivdayal/Downloads/cppcms-1.0.2/booster/CMakeLists.txt:14
(include)
-- Looking for ICU libraries
-- ICU not found, disabling ICU localization backend
-- Performing Test LIBC_ICONV
-- Performing Test LIBC_ICONV - Failed
-- Performing Test GCC_IS_GCC4
-- Performing Test GCC_IS_GCC4 - Success
-- Looking for dlopen
-- Looking for dlopen - found
-- Looking for socket
-- Looking for socket - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Performing Test BOOSTER_HAS_GCC_SYNC
-- Performing Test BOOSTER_HAS_GCC_SYNC - Success
-- Performing Test BOOSTER_HAVE_GCC_BITS_EXCHANGE_AND_ADD
-- Performing Test BOOSTER_HAVE_GCC_BITS_EXCHANGE_AND_ADD - Failed
-- Performing Test BOOSTER_HAVE_GCC_EXT_EXCHANGE_AND_ADD
-- Performing Test BOOSTER_HAVE_GCC_EXT_EXCHANGE_AND_ADD - Success
-- Performing Test BOOSTER_HAVE_FREEBSD_ATOMIC
-- Performing Test BOOSTER_HAVE_FREEBSD_ATOMIC - Failed
-- Performing Test BOOSTER_HAVE_EXECINFO
-- Performing Test BOOSTER_HAVE_EXECINFO - Success
-- Performing Test BOOSTER_HAVE_SOLARIS_ATOMIC
-- Performing Test BOOSTER_HAVE_SOLARIS_ATOMIC - Failed
-- Performing Test BOOSTER_HAVE_MAC_OS_X_ATOMIC
-- Performing Test BOOSTER_HAVE_MAC_OS_X_ATOMIC - Success
-- Performing Test BOOSTER_HAVE_STDINT_H
-- Performing Test BOOSTER_HAVE_STDINT_H - Success
-- Performing Test BOOSTER_HAVE_INTTYPES_H
-- Performing Test BOOSTER_HAVE_INTTYPES_H - Success
-- Performing Test BOOSTER_AIO_HAVE_PF_INET6
-- Performing Test BOOSTER_AIO_HAVE_PF_INET6 - Success
-- Performing Test CPPCMS_HAVE_STDINT_H
-- Performing Test CPPCMS_HAVE_STDINT_H - Success
-- Performing Test CPPCMS_HAVE_INTTYPES_H
-- Performing Test CPPCMS_HAVE_INTTYPES_H - Success
-- Looking for atoll
-- Looking for atoll - found
-- Looking for _atoi64
-- Looking for _atoi64 - not found
-- Looking for snprintf
-- Looking for snprintf - found
-- Looking for stat
-- Looking for stat - found
-- Looking for _stat
-- Looking for _stat - not found
-- Performing Test CPPCMS_HAVE_STD_WSTRING
-- Performing Test CPPCMS_HAVE_STD_WSTRING - Success
-- Performing Test CPPCMS_HAVE_BSD_TM
-- Performing Test CPPCMS_HAVE_BSD_TM - Success
-- Performing Test CPPCMS_HAVE_CPP0X_UXSTRING
-- Performing Test CPPCMS_HAVE_CPP0X_UXSTRING - Failed
-- Performing Test CPPCMS_HAVE_CPP_0X_AUTO
-- Performing Test CPPCMS_HAVE_CPP_0X_AUTO - Failed
-- Performing Test CPPCMS_HAVE_CPP_0X_DECLTYPE
-- Performing Test CPPCMS_HAVE_CPP_0X_DECLTYPE - Failed
-- Performing Test CPPCMS_HAVE_GCC_TYPEOF
-- Performing Test CPPCMS_HAVE_GCC_TYPEOF - Success
-- Performing Test CPPCMS_HAVE_UNDERSCORE_TYPEOF
-- Performing Test CPPCMS_HAVE_UNDERSCORE_TYPEOF - Success
-- Looking for dlopen
-- Looking for dlopen - found
-- Looking for socket
-- Looking for socket - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for canonicalize_file_name
-- Looking for canonicalize_file_name - not found
-- Configuring done
CMake Error at CMakeLists.txt:584 (add_executable):
Cannot find source file:
skin1.cpp
Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
.hxx .in .txx
-- Build files have been written to:
/Volumes/GNU/Users/shivdayal/Downloads/cppcms-1.0.2/build
Shiv-Dayals-Mac-mini:build root# ls
CMakeCache.txt CMakeFiles CPackConfig.cmake CPackSourceConfig.cmake booster
cppcms
Shiv-Dayals-Mac-mini:build root#
Strange that on Linux skin1.cpp skin2.cpp and skin3.cpp appear in build
directory.
On Wed, Sep 19, 2012 at 11:57 PM, Artyom Beilis <art...@ya...> wrote:
> Full error log, with description of what exactly are you doing,
> with would be helpful :-)
>
>
> CppCMS is tested and works well on Mac OS X.
>
>
>
> Artyom Beilis
> --------------
> CppCMS - C++ Web Framework: http://cppcms.com/
> CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/
>
>
>
> ----- Original Message -----
>> From: Shiv Shankar Dayal <shi...@gm...>
>> To: cpp...@li...
>> Cc:
>> Sent: Wednesday, September 19, 2012 8:19 PM
>> Subject: [Cppcms-users] Build problems
>>
>> Hi,
>>
>> I am trying to build CppCMS on Mac OS X 10.6.8 using CMake and all. It
>> says skin1.cpp not found encountered at line 584 in CMakeLists.txt.
>>
>> Do you people have the same problem?
>>
>> --
>> Best regards,
>> Shiv Shankar Dayal
>>
>>
------------------------------------------------------------------------------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and
>> threat landscape has changed and how IT managers can respond. Discussions
>> will include endpoint security, mobile security and the latest in malware
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> _______________________________________________
>> Cppcms-users mailing list
>> Cpp...@li...
>> https://lists.sourceforge.net/lists/listinfo/cppcms-users
>>
>
>
------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Cppcms-users mailing list
> Cpp...@li...
> https://lists.sourceforge.net/lists/listinfo/cppcms-users
--
Best regards,
Shiv Shankar Dayal
|