Categories
Algorithms Development

How to use boost::algorithm::ends_with() for boost::asio::mutable_buffer and boost::asio::const_buffer iterator ranges?

Consider this function: std::size_t DoReadUntil(const boost::asio::mutable_buffer& buffer, const boost::asio::const_buffer& delim) { boost::system::error_code error; const boost::asio::mutable_buffer buffer_1(buffer.data(), 1); std::size_t ret = 0; for (;;) { boost::asio::read(m_serialPort, buffer_1, error); auto itRange1 = boost::make_iterator_range(boost::asio::buffer_sequence_begin(buffer), boost::asio::buffer_sequence_end(buffer)); auto itRange2 = boost::make_iterator_range(boost::asio::buffer_sequence_begin(delim), boost::asio::buffer_sequence_end(delim)); if (boost::algorithm::ends_with(itRange1, itRange2)) break; } DoSetLastError(error); return ret; } I am getting a compiler error at the call: […]

Categories
Development MongoDB

How can i use multiple group in mongodb aggregate

When i added multiple group it gives noting as output.If anyone have the solve this problem please let me know.Thanks in advance! .group({ _id: “$date”, count: { $sum: 1 }, }) /* .group({ _id: “$joinDate”, count: { $sum: 1 }, }) .group({ _id: “$applyDate”, count: { $sum: 1 }, })*/

Categories
Development

Sidekiq + Rails 6.0.0 in API mode : WARN — : attack prevented by Rack::Protection::AuthenticityToken

I’m currently trying to setup a standalone rails 6.0.0 API fresh install (rails new xxx –api) + sidekiq (that includes Rack::Protection) After setting-up Rack::Cors, i get the following 403 error on any non-GET request : WARN — : attack prevented by Rack::Protection::AuthenticityToken To my understanding this is related to CSRF tokens, which don’t make sense […]

Categories
Development

Why protected inner class of object may be seen outside of its definition scope?

Consider the following: scala> :paste // Entering paste mode (ctrl-D to finish) object O { protected case class I(x: Int) trait T { protected def m: I = I(0) } } val i = new O.T { override def m = super.m }.m // Exiting paste mode, now interpreting. defined object O i: O.I = […]

Categories
Development

How Observable is created in retrofit without calling it from schedular

I am working on rx-java and retrofit and I Have some queries related to it.I am not able to understand that when we call below code then how Observable(Observable) is created ? According to my understanding it should be called only during the time of scheduling and subscribing. CryptocurrencyService cryptocurrencyService = retrofit.create(CryptocurrencyService.class); Observable<Crypto> cryptoObservable = […]

Categories
Development

How to set canvas preview language?

(currently trying on Xcode 11 Beta 7) I want to pass an already localized string to Text() and see how it looks on canvas using “.environment(.locale, .init(identifier:”ja”))”, but the preview is always set to whatever language that I have set on the scheme settings. I know that it works if I pass a LocalizedStringKey directly, […]

Categories
Development

Managing Intervals and Ranges in LUIS App

I am creating a querying LUIS App, which needs a semantic understanding of time/ date ranges. By semantic, I mean that I would like to be able to resolve the following examples: Last week -> start: 2019-09-02T00:00:00+00:00; end: 2019-09-08T00:00:00+00:00 Yesterday -> start: 2019-09-14T00:00:00+00:00; end: 2019-09-14T23:59:59+00:00 1st July to the 18th August -> start: 2019-07-01T00:00:00+00:00; end: […]

Categories
Development

Call stored procedure from EF asynchronously using C# inside async method

We are moving to Entity Framework, however we have a large number of stored procedures. If our Web API uses an async/await pattern all the way to the stored procedure call, how do I handle the call? Can I/should I make it async as well? I have a db context and I can call my […]

Categories
Ask Facebook Social Media

[ Facebook ] Open Question : I,m 69 years old don’t post on facebook and just use chat line so facebook is wroung but they think they run the world?

Categories
Ask Maintenance & Repairs

[ Maintenance & Repairs ] Open Question : I drive a Toyota camry and hit a curb so terribly bad at full speed. now my suspension system is destroyed. what is exactly the problem ?

I also had another incident of hitting a cone and the cone getting stuck in my axle . Now I can barely drive my car What exactly is the problem ? What components are destroyed and what do I need to do to fix it ? How much will it cost ?