boost

boost results by integer field

℡╲_俬逩灬. 提交于 2020-02-07 07:02:10
问题 I'm trying to create and autocomplete of destinations and i want to boost results by a popularity integer field. i'm trying with this function_score query 'query' => [ 'function_score' => [ 'query' => [ "bool" => [ "should" => [ [ "multi_match"=>[ "query"=>$text, "fields"=>[ "destination_name_*" ], "type"=>"most_fields", "boost" => 2 ] ], [ "multi_match"=>[ "query"=>$text, "fields"=>[ "destination_name_*" ], "fuzziness" => "1", "prefix_length"=> 2 ] ], [ "multi_match"=>[ "query"=>$text,

loading library on cluster

无人久伴 提交于 2020-02-05 08:02:07
问题 I successfully compiled a program in c++, with boost, on a cluster we have here. I need to run an SGE script to run the simulation. The error I get is this ./main: error while loading shared libraries: libboost_thread.so.1.45.0: cannot open shared object file: No such file or directory Do I need to specify the name of the library when I launch the program? The script I used is below #!/bin/sh # (c) 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. # This is a

how to avoid defining token which matchs everything in boost::spirit::lex

孤人 提交于 2020-02-05 03:12:06
问题 I want to create a grammar and lexer to parse the below string: 100 reason phrase regular expression will be: "\d{3} [^\r\n]*" token definition: template <typename Lexer> struct custom_tokens : lex::lexer<Lexer> { custom_tokens() { this->self.add_pattern ("STATUSCODE", "\\d{3}") ("SP", " ") ("REASONPHRASE", "[^\r\n]*") ; this->self.add ("{STATUSCODE}", T_STATUSCODE) ("{SP}", T_SP) ("{REASONPHRASE}", T_REASONPHRASE) ; } }; grammar: template <typename Iterator> struct custom_grammar : qi:

C++ Boost and Lzma decompression

邮差的信 提交于 2020-02-03 22:47:50
问题 I am trying to decompress a .7z (or .xz or .lzma) file using boost library 1.67.0 on a Linux platform with the following code: vector<T> readFromCompressedFile(string input_file_path, string output_file_path) { namespace io = boost::iostreams; stringstream strstream; ifstream file(input_file_path.c_str(), ios_base::in | ios_base::binary); ofstream out(output_file_path, ios_base::out | ios_base::binary); boost::iostreams::filtering_istream in; in.push(io::lzma_decompressor()); in.push(file);

Error compiling DLIB - Could not find Boost

北城以北 提交于 2020-02-03 09:48:05
问题 I have a problem, when I try to compile DLIB, I have the following error: Could not find boost Imported targets are not available for Boost version Image from CMD, when I try to compile DLIB I have this programs versions: Cmake 3.5.1 Boost 1.6 Python 2.7.9 32 bits My computer works on Windows 64 bits Boost are install on "C:\Program Files\boost" , Help me please! 回答1: Have you compiled boost yet? Boost has some great, easy instructions to compile it. You can find it here. After you've

Why do people seem to insinuate I would rather not use Boost? [closed]

旧街凉风 提交于 2020-02-01 00:34:06
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 4 years ago . Very often here on SO I see notes about boost such as If you are fine with using Boost... or If you can use Boost... And I wonder, what's that all about? What should I be weary of? When can't I use boost? What are the reasons not to use boost? In my opinion boost is a great

undefined reference to boost::gregorian::greg_month::as_short_string() const

限于喜欢 提交于 2020-01-31 06:46:20
问题 This was asked several times however I don't know what I'm doing wrong. I'm trying to get the current date subtracted by 7. Here's the Main: #include <iostream> #include <boost/date_time/gregorian/gregorian.hpp> #include <boost/date_time/date_formatting.hpp> #include <boost/date_time/gregorian/greg_month.hpp> using namespace std; using namespace boost::gregorian; int main(int argc, char **argv) { time_t rawtime; struct tm *timeinfo; time (&rawtime); timeinfo = localtime (&rawtime); date cdate

undefined reference to boost::gregorian::greg_month::as_short_string() const

隐身守侯 提交于 2020-01-31 06:46:08
问题 This was asked several times however I don't know what I'm doing wrong. I'm trying to get the current date subtracted by 7. Here's the Main: #include <iostream> #include <boost/date_time/gregorian/gregorian.hpp> #include <boost/date_time/date_formatting.hpp> #include <boost/date_time/gregorian/greg_month.hpp> using namespace std; using namespace boost::gregorian; int main(int argc, char **argv) { time_t rawtime; struct tm *timeinfo; time (&rawtime); timeinfo = localtime (&rawtime); date cdate

Linking error with boost::python

纵饮孤独 提交于 2020-01-30 06:03:07
问题 I have a problem getting started with Boost's python library. My code is #include <boost/python.hpp> #include <Python.h> namespace python=boost::python; int main(int argc, char const *argv[]) { Py_Initialize(); python::dict global; return 0; } I tried a lot and the closest I get to a working program is a linking error with boost: $ gcc -c $(python2.7-config --cflags) bpt.cpp cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default] $

Socket reusing with boost asio

那年仲夏 提交于 2020-01-30 05:15:35
问题 I try to use a boost asio socket, bound to a local address/port combination. That works great. What doesn't work, is the re-using of the socket once the socket and application has been stopped and restarted. // // open the socket - it would also be opened by the async_connect() // method but we might need an open socket to bind it _socket.open(boost::asio::ip::tcp::v4()); if ( _bindLocal ) { boost::asio::socket_base::reuse_address option(true); _socket.set_option(option); _socket.bind(