text:
Q: Overloading of F# Measures Consider the following F# code:
[<Measure>] type pixel
[<Measure>] type inch
[<Measure>] type dot
[<Measure>] type percentage

let scaleCalculation (finalSize:float<pixel>) (originalSize:float<pixel>) =
   finalSize/originalSize * 100.0<percentage>

(I realize I need to check originalSize for 0 but that's not really germaine to this question).
What I'd like is to overload this function to handle inches and dots per inch. I don't think there's any way to overload on the unit of measure but I just thought I'd see if anyone had any suggestions on this.
I know I could do this:
   let scaleCalculation (finalSize:float) (originalSize:float) =
      finalSize/originalSize * 100.0<percentage>

but then I lose checking on the measure of finalSize and originalSize.  I just want to insure that the measure of finalSize and originalSize are the same.
Any suggestions, thoughts?

A: let scaleCalculation (finalSize:float<'u>) (originalSize:float<'u>) =
   finalSize/originalSize * 100.0<percentage>

Units of Measure in F#: Part Four, Parameterized Types


text:
Q: Can I get the "YYYY-MM-DD" string in other languages? I need to show the "YYYY-MM-DD" as a template in a query editor, so the users know how to formate the dates. But because the application is multi-lingual, I thought it would be easier to understand if I'd display this string for each language.
So for German it would have to be: "JJJJ-MM-TT"
Is there a way to get these strings automatically in C#?

A: I don't believe what you are asking is possible outside of the box, if you check MSDN, you can see that only specific character literals are reserved for the DateTime formatter to be used when interpreting the string. Any other character literal will be included in the final DateTime string as is (assuming that your DateTime was successfully parsed).
You however can introduce extension functions to DateTime/String, that take CultureInfo and pretty much map a string like "JJJJ-MM-TT" to "YYYY-MM-DD", then pass the mapped string to the DateTime formatter.
You can try to provide custom DateTime formatters inside every different CultureInfo you support in your application, but still passing a string like "JJJJ-MM-TT" to the native DateTime formatter will not give you the desired result, without mapping it to the parse-able format.
If your question is just asking about how to show "JJJJ-MM-TT" to the user but still use "YYYY-MM-DD" when parsing the string, then you will just have to introduce a mapping of the different CultureInfo supported in your application and the strings you want to show to the user, then when presenting a query editor, you lookup the CultureInfo and get the desired string. Still there is no out of the box support for this.

A: Unfortunately, no, there's nothing built-in.
You will have to localize it manually, the same way you localize all the other strings in your application (e.g. by using resource files).

redpajama_set_name: RedPajamaStackExchange


text:
Q: Completely move from Joomla to Wordpress using same domain and server I'm trying to move my site from Joomla to Wordpress. I'm not a developer and I'm not that well versed with Joomla. I've already recreated the entire site in Wordpress and I don't care too much about SEO. I've had a look at the migration plugin in WP but it's not doing what I need it to do.
Currently, my Joomla site address is: http://myfakesite.com/index.php?lang=en. My WP site resides at http://myfakesite.com/wp/
I've already tried the redirection option from within Joomla but it's not working.
I intend to completely remove Joomla from my server and its database too. How should I proceed?

A: Use WP all import free plugin by Soflyy.
Its very good way for transfer data with true format,
For first you must export all Joomla data in XML file,
I think its easy. You can find plugin from this link


text:
Q: Drawing Bezier curve manually I am trying to create a Bezier curve manually in this way:
- (void)drawBezierFrom:(CGPoint)from to:(CGPoint)to controlA:(CGPoint)a controlB:(CGPoint)b sections:(NSUInteger)cnt color:(NSUInteger)color
{
float qx, qy;
float q1, q2, q3, q4;
int lastx = - 1, lasty;
int plotx, ploty;
float t = 0.0;

while (t <= 1)
{
    q1 = t*t*t*-1 + t*t*3 + t*-3 + 1;
    q2 = t*t*t*3 + t*t*-6 + t*3;
    q3 = t*t*t*-3 + t*t*3;
    q4 = t*t*t;

    qx = q1*from.x + q2*a.x + q3*to.x + q4*b.x;
    qy = q1*from.y + q2*a.y + q3*to.y + q4*b.y;

    plotx = round(qx);
    ploty = round(qy);

    /*if (lastx != -1)
        [self drawLineFrom:NSMakePoint(lastx, lasty) to:NSMakePoint(plotx, ploty) color:color];
    else
        [self drawLineFrom:NSMakePoint(from.x, from.y) to:NSMakePoint(plotx, ploty) color:color];*/

    lastx = plotx;
    lasty = ploty;
    t = t + (1.0/(cnt + 0.0f));
}
//[self drawLineFrom:NSMakePoint(lastx, lasty) to:NSMakePoint(to.x, to.y) color:color];
[self drawLineFromCoordX:lastx andY:lasty toPointWithCoordsX:to.x andY:to.y];
}

-(void)drawLineFromCoordX:(int)x andY:(int)y toPointWithCoordsX: (int)fx andY: (int)fy{
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextMoveToPoint(context, x,y);
CGContextAddLineToPoint(context, fx,fy);
CGContextStrokePath(context);
}

Calling the methods in the viewDidLoad:
CGPoint fromPoint = CGPointMake(10, 10);
CGPoint toPoint = CGPointMake(100, 10);
CGPoint controlA = CGPointMake(50, 50);
CGPoint controlB = CGPointMake(60, 60);

[self drawBezierFrom:fromPoint to:toPoint controlA:controlA controlB:controlB sections:10     color:4];

EDIT:
I did exactly what you did:
-(void)drawRect:(CGRect)rect{
CGPoint fromPoint = CGPointMake(10, 10);
CGPoint toPoint = CGPointMake(100, 10);
CGPoint controlA = CGPointMake(50, 50);
CGPoint controlB = CGPointMake(60, 60);

[self drawBezierFrom:fromPoint to:toPoint controlA:controlA controlB:controlB sections:10 color:4];
}

and kept everything else the same, and it still doesn't work

A: Put the code you have in viewDidLoad (except [super viewDidLoad]) into drawRect method. UIGraphicsGetCurrentContext() needs to be called within drawRect method in order to know whitch is the current context.
EDIT:
also put:
[self drawLineFromCoordX:lastx andY:lasty toPointWithCoordsX:to.x andY:to.y];

inside while loop. And before while loop set the stroke color:
[[UIColor redColor] setStroke];


text:
Q: How to encrypt ubuntu filesystems only?
Possible Duplicate:
How to encrypt ubuntu filesystems only?

Friends,
I have Windows 7 ultimate 64bit and Ubuntu 11.10 64bit version. My laptop comes with 500GB HDD and did 8 partitions. in that 5 are NTFS and 3 partitions for ubuntu as follow swap home and /. i want encrypt my alll my linux partitions only.not on my windows is it possible. plz explain me step by step..
thanks a lot...

A: It is not that easy to do that and you should know exactly what you are doing. Writing a stepwise instruction set here is nearly impossible, but there are good official How-To's:
https://help.ubuntu.com/community/EncryptedFilesystemHowto#So_How_Do_I_Encrypt_My_Home_Directory.3F
Relatively easy will be to encrypt your home folder, if you get a partition freed, then you can move your data to the new "encrypted partition" and after that mount this new partition using the fstab file. Encrypting the wohle ubuntu installation requires much experience and should be done with care.


text: Q: Is there any api gateway framework for websocket Usually we would have a api gateway for rest service, now I have a webscoket micro service, is there any way to use this api gateway for websocket? Thanks BTW, I am using spring boot


text:
Q: unfamiliar port forwarding command I recently came across the snippet below.
ssh root@myserver.com -L <some_ip>:2182:127.0.0.1:2181
I thought I had passing familiarity with port forwarding, but the presence of <some_ip> is throwing me for a loop here. Could someone more experienced please walk me through exactly what this code is doing?

A: This is typical local portforwarding which will listen on <some_ip>:2182 on the local machine and forward received traffic to 127.0.0.1:2181 on the remote machine.  While the local IP address to which to bind is commonly left unspecified (defaulting to localhost), it may be explicitly given if you wish to listen on a particular interface.
From man ssh:

-L [bind_address:]port:host:hostport
-L [bind_address:]port:remote_socket
-L local_socket:host:hostport
-L local_socket:remote_socket
Specifies that connections to the given TCP port or Unix socket on
  the local (client) host are to be forwarded to the given host and
  port, or Unix socket, on the remote side. This works by allocating a
  socket to listen to either a TCP port on the local side, optionally
  bound to the specified bind_address, or to a Unix socket. Whenever a
  connection is made to the local port or socket, the connection is
  forwarded over the secure channel, and a connection is made to either
  host port hostport, or the Unix socket remote_socket, from the remote
  machine.
Port forwardings can also be specified in the configuration file. Only the superuser can forward privileged ports. IPv6 addresses can be
  specified by enclosing the address in square brackets.
By default, the local port is bound in accordance with the GatewayPorts setting. However, an explicit bind_address may be used to
  bind the connection to a specific address. The bind_address of
  "localhost" indicates that the listening port be bound for local use
  only, while an empty address or '*' indicates that the port should be
  available from all interfaces.

A: You need (e.g.) SSH port forwarding if the target address cannot be reached directly because it is a private address, localhost or behind a firewall.


text:
Q: Show my comment on an answer without refresh, in the android app When I post a comment to an answer I submit it but it shows the answer without my comment.
If I then refresh it shows correctly.

A: Since the creation of this bug, a lot of changes have been done to the comment interface on Android which seem to have fixed this issue.


text:
Q: OCR with tesseract in R Fails to Recognize all Line Breaks I'm trying to convert many PDF documents into text in R in order to use string parsing and regex to extract a set of codes from it. I am using ocr from the tesseract library and though it works on many of the pages, it does miss a lot of information that I need.
I identified the problem being inconsistent line breaks in the image/PDF. For example:
I am trying to get the codes from the left column. The only codes that I'm able to extract successfully are the ones where the description is longer than a single line.
I've experimented with various pre-processing techniques using magick but have come up short in most cases. The only instance where I was able to get the code set was cropping the right-hand side out of the image, but unfortunately this is not an efficient solution in my case.
file <- magick::image_read("44F245A2-5FEE-408F-A197-756436A5CAFD.png")

file %>%
  magick::image_resize("2000x") %>%
  magick::image_convert(type = 'Grayscale') %>%
  tesseract::ocr() %>%
  cat()

# or
# descriptions in this document.
# 94942C This is a description that takes on multiple lines. It can contain any combination of
# alphanumeric characters or punctuation. Different types of things can go in here and the
# | terpenes Steet gine see
# 272144 This is a description that takes on multiple lines. It can contain any combination of
# eee
# length of the description could be anywhere from 1 line to 5 lines of text.
# E76744 This is a description that takes on multiple lines. It can contain any combination of
# alphanumeric characters or punctuation. Different types of things can go in here and the
# [terpenes Steet gine see
# K77744 This is a description that takes on multiple lines. It can contain any combination of
# alphanumeric characters or punctuation. Different types of things can go in here and the
# | terrane een Steet gine seem
# 172744 This is a description that takes on multiple lines. It can contain any combination of
# Se
# length of the description could be anywhere from 1 line to 5 lines of text.
# A71744 This is a description that takes on multiple lines. It can contain any combination of
# alphanumeric characters or punctuation. Different types of things can go in here and the
# | teammates Steet gine see

Ideally I would like to be able to get all of the codes from the image in the above link. Any help would be awesome.

A: Try to use different page segmentation modes, the available segmentation modes are:
Page segmentation modes:
  0    Orientation and script detection (OSD) only.
  1    Automatic page segmentation with OSD.
  2    Automatic page segmentation, but no OSD, or OCR.
  3    Fully automatic page segmentation, but no OSD. (Default)
  4    Assume a single column of text of variable sizes.
  5    Assume a single uniform block of vertically aligned text.
  6    Assume a single uniform block of text.
  7    Treat the image as a single text line.
  8    Treat the image as a single word.
  9    Treat the image as a single word in a circle.
 10    Tre at the image as a single character.
 11    Sparse text. Find as much text as possible in no particular order.
 12    Sparse text with OSD.
 13    Raw line. Treat the image as a single text line,

Try PSM #4 for your case, from my experience #12 gives the most text, but it might not be in order, which might be an issue if you want to relate the codes with the descriptions.


text:
Q: How to order HTML attributes alphabetically on Visual Studio automatically? I have
<script src="js/jquery-1.7.1.min.js" type="text/javascript"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.18.custom.min.js"></script>

Note that the attributes are unordered. I want a tool that orders the attributes in the HTML as the XamlStyler does for XAML. Ctrl + K + D doesn't do this AFAIK.

A: I don't think visual studio has this functionality. But if you use Resharper  just open the contextual menu and select reorder attributes.

A: I could not find a context-menu option in ReSharper 8.x for doing what is mentioned above. However, my answer below might help others seeking an answer that seems to work quite nicely although the utility I cite currently is a hosted solution (it's free at the moment):
Is there a tool to properly organize tag attributes for asp files?


text:
Q: How actually server ports work Imagine we have a hosting containing:

*

*a search engine running on port 5678 (it's required this port it's open in order to work).

*nginx running on port 80.

When a user connects to our website and search something on it, he is only connecting through port 80, but never through 5678. We can check this running "netstat -an".
So my question is: If the client it's never connecting directly with the search engine's port, why we need to keep it open?

A: Normally client requests are coming to your web server (port 80 or 443), and your web server (your php,or your java code) has a logic to connect to your search engine and send back the result to the client via port 80/443 (local socket connection, if web server and search server running on the same server). so clients need not to connect directly to your search engine port (5678). (from external networks). may be your web server internal interface and search engines internal interface connect locally via local s socket connection.
I'm not sure how you run your web server and search engine, is it two different servers or nginx act as a load balancer and send the client request to your multiple search servers. i think your search engine port use internally to communicate with your web server hosted software. or may be you run both nginx and search server on the same server.
other guess is your firewall or router forwarding port 80 request to your search server port 5678 (port forwarding).
try this on your search server
netstat -pant

this will give your all connection details, like local address,foreign address,state, and PID/Program name
Hope that helps

A: You can connect to a webserver using a different port. Port 80 is the default for web servers. (port 443 for secure, https, connections) so it's not normally specified since it's 'understood'
But you can, actually, specify a different port to connect to. In your example, a user would specify which port they want to connect to in the URL
http://www.example.com:5678

A: The same reason why some services live on other ports, like 22, 3000, 3306, 8080, 9000, you might not access those ports directly but maybe some other apps/services/protocols connect to it internally, or could even be not on the same server, like if you have separate app/db/mail servers, they would contact each others by ports.


text:
Q: Questionable DDWRT WAN Domain Name I'm wondering if someone can tell me why I would be seeing this name or any other domain name under this section. I haven't made any changes or assigned any domain names on my side.
I've had issues before where the WAN Domain Name would be something else entirely.
Screenshot

A: Most likely you are using DHCP on the WAN side and get assigned a domain name as option 15 ("domain-name") from your upstream provider.
You can safely ignore it when replacing it with whatever you want as a fixed value. IIRC the DHCP client in DD-WRT even allows you to ignore all or some options.


text:
Q: Decorate an Iterator in PHP - enable skipping I have a class that is basically a decorator for PHP's DirectoryIterator. Each file's contents are processed by the class and then returned by the current() method. Currently, when the file is a dot file or the file cannot be processed, I return false from the current() method. But I would rather like to skip the dot- and unprocessable files, and only return processed data.
P.S. The code below is a simplified  example. I don't want to pre-process all files in the constructor.
class Pages implements \Iterator
{
    public function __construct(string $path)
    {
        $this->di = new \DirectoryIterator($path);
    }

    public function rewind() {
        return $this->di->rewind();
    }

    public function current() {
        $file = $this->di->current();
        if($file->isDot()) {
            return false;
        }
        $content = file_get_contents($file->getPathName());
        if($content === 'Cannot be processed!') {
            return false;
        }
        return $content;
    }

    public function key() {
        return $this->di->key();
    }

    public function next() {
        return $this->di->next();
    }

    public function valid() {
        return $this->di->valid();
    }
}

A: You can greatly simplify the code of your own answer by extending the already existing abstract PHP class FilterIterator :
class DirectoryFilterIterator
  extends FilterIterator
{
  public function __construct(string $path) {
    parent::__construct(new DirectoryIterator($path));
  }

  public function accept() : bool {
    $current = parent::current();
    // let's not only ensure it's not a dot but that it's an actual readable file
    if(!$current->isFile() || !$current->isReadable()) {
      return false;
    }
    else {
      $contents = file_get_contents($current->getPathname());
      if($contents === 'Some value') {
        return false;
      }
    }

    return true;
  }
}

foreach(new DirectoryFilterIterator('.') as $key => $value) {
  echo "$key -> $value\n";
}

As you can also see, instead of merely ensuring that the item is not a dot, I ensure the item is an actual readable file as I think that is a little more robust for your intentions.

PS: As your original intention was to create a decorator/wrapper you can of course alter the constructor of DirectoryFilterIterator to accept a DirectoryIterator instead:
public function __construct(DirectoryIterator $it) {
  parent::__construct($it);
}

...and then change the instantiation to:
foreach(new DirectoryFilterIterator(new DirectoryIterator('.')) as $key => $value) {
  echo "$key -> $value\n";
}

A: Finally I found this solution, hope someone finds it helpful. One could apply this pattern to any decorated Iterator, effectively ending up with something like a "filtered" iterator.
class FilteredIterator implements \Iterator
{
    protected $currentProcessed = null;
    protected $key = -1; // Keys are maintained by the decorating class

    public function __construct(Iterator $iterator)
    {
        $this->it = $iterator;
    }

    // Iterator interface START -->

    public function rewind() {
        $this->it->rewind();
        $this->forward();
    }

    public function current() {
        return $this->currentProcessed;
    }

    public function key() {
        return $this->key;
    }

    public function next() {
        $this->it->next();
        $this->forward();
    }

    public function valid() {
        return $this->it->valid();
    }

    // <-- Iterator interface END

    protected function forward() : void
    {
        if(!$this->it->valid()) {
            // Stop when iterator is done
            return;
        }
        // Pseudo code, insert expensive processing function here -->
        $content = $this->it->current();
        if($content === 5) {
        // <-- Pseudo code END
            // Skip
            $this->next();
            return;
        }
        // Update position
        $this->key++;
        // Cache successfully processed step
        $this->currentProcessed = $content;

    }
}

$arrayObject = new ArrayObject([1,2,3,4,5,6]);

$filteredIterator = new FilteredIterator($arrayObject->getIterator());

foreach ($filteredIterator as $key => $value) {
    echo $key . ' -> ' . $value . "\n";
}

//0 -> 1
//1 -> 2
//2 -> 3
//3 -> 4
//4 -> 6


text:
Q: Slow performance using boost xpressive Lately I have being using boost xpressive for parsing files. These files are 10 MB each and there will be several hundred of them to parse.
Xpressive is nice to work and clear syntax, but the problems comes with performance. It is incredible how it crawls in debug versions, while in release version it spends more than a whole second per file. I have tested against old plain get_line(), find() and sscanf() code, and it can beat xpressive easily.
I understand that type checking, backtracking and so have a cost, but this seems excessive to me. How I wonder, I am doing something wrong? Is it any way of optimizing this to run at a decent pace? Should it deserve the effort to migrate code to boost::spirit?
I have prepared a lite version of code with a few lines of a real file embedded in case someone might test and help.
NOTE- As a requirement, VS 2010 must be used (not fully c++11 compliant unfortunately)
#include <boost/xpressive/xpressive.hpp>
#include <boost/xpressive/regex_actions.hpp>

const char input[] = "[2018-Mar-13 13:13:59.580482] - 0.200 s => Driver: 0 - Speed: 0.0 - Road: BTN-1002 - Km: 90.0 - SWITCH_ON: 1\n\
[2018-Mar-13 13:13:59.580482] - 0.200 s => Driver: 0 - Speed: 0.0 - Road: A-11 - Km: 90.0 - SLOPE: 0\n\
[2018-Mar-13 13:14:01.170203] - 1.790 s => Driver: 0 - Speed: 0.0 - Road: A-11 - Km: 90.0 - GEAR: 0\n\
[2018-Mar-13 13:14:01.170203] - 1.790 s => Driver: 0 - Speed: 0.1 - Road: A-11 - Km: 90.0 - GEAR: 1\n\
[2018-Mar-13 13:14:01.819966] - 2.440 s => Driver: 0 - Speed: 0.1 - Road: A-11 - Km: 90.0 - SEQUENCE: 1\n\
[2018-Mar-13 13:14:01.819966] - 2.440 s => Driver: 0 - Speed: 0.2 - Road: A-11 - Km: 90.0 - CLUTCH: 1\n\
[2018-Mar-13 13:14:01.819966] - 2.540 s => Backup to regestry\n\
[2018-Mar-13 13:14:02.409855] - 3.030 s => Driver: 0 - Speed: 0.2 - Road: A-11 - Km: 90.0 - SEQUENCE: 4\n\
[2018-Mar-13 13:14:02.409855] - 3.030 s => Driver: 0 - Speed: 0.3 - Road: A-11 - Km: 90.0 - SEQUENCE: 8\n\
[2018-Mar-13 13:14:01.819966] - 3.110 s => Backup to regestry\n\
[2018-Mar-13 13:14:02.620424] - 3.240 s => Driver: 0 - Speed: 0.4 - Road: A-11 - Km: 90.1 - SEQUENCE: 15\n\
[2018-Mar-13 13:14:02.829983] - 3.450 s => Driver: 0 - Speed: 0.6 - Road: B-302 - Km: 90.1 - SLOPE: -5\n\
[2018-Mar-13 13:14:03.039600] - 3.660 s => Driver: 0 - Speed: 0.8 - Road: B-302 - Km: 90.1 - SEQUENCE: 21\n\
[2018-Mar-13 13:14:03.250451] - 3.870 s => Driver: 0 - Speed: 1.2 - Road: B-302 - Km: 90.2 - GEAR: 2\n\
[2018-Mar-13 13:14:03.460012] - 4.080 s => Driver: 0 - Speed: 1.7 - Road: B-302 - Km: 90.3 - SEQUENCE: 29\n\
[2018-Mar-13 13:14:03.669448] - 4.290 s => Driver: 0 - Speed: 2.2 - Road: B-302 - Km: 90.4 - SEQUENCE: 34\n\
[2018-Mar-13 13:14:03.880066] - 4.500 s => Driver: 0 - Speed: 2.8 - Road: B-302 - Km: 90.5 - CLUTCH: 1\n\
[2018-Mar-13 13:14:04.090444] - 4.710 s => Driver: 0 - Speed: 3.5 - Road: B-302 - Km: 90.7 - SEQUENCE: 45\n\
[2018-Mar-13 13:14:04.300160] - 4.920 s => Driver: 0 - Speed: 4.2 - Road: B-302 - Km: 90.9 - SLOPE: 10\n\
[2018-Mar-13 13:14:04.510025] - 5.130 s => Driver: 0 - Speed: 4.9 - Road: B-302 - Km: 91.1 - GEAR: 3";

const auto len = std::distance(std::begin(input), std::end(input));

struct Sequence
{
    int ms;
    int driver;
    int sequence;
    double time;
    double vel;
    double km;
    std::string date;
    std::string road;
};

namespace xp = boost::xpressive;

int main()
{
    Sequence data;
    std::vector<Sequence> sequences;

    using namespace xp;

    cregex real = (+_d >> '.' >> +_d);
    cregex keyword = " - SEQUENCE: " >> (+_d)[xp::ref(data.sequence) = as<int>(_)];
    cregex date = repeat<4>(_d) >> '-' >> repeat<3>(alpha) >> '-' >> repeat<2>(_d) >> _s >> repeat<2>(_d) >> ':' >> repeat<2>(_d) >> ':' >> repeat<2>(_d);

    cregex header = '[' >> date[xp::ref(data.date) = _] >> '.' >> (+_d)[xp::ref(data.ms) = as<int>(_)] >> "] - "
                    >> real[xp::ref(data.time) = as<double>(_)]
                    >> " s => Driver: " >> (+_d)[xp::ref(data.driver) = as<int>(_)]
                    >> " - Speed: " >> real[xp::ref(data.vel) = as<double>(_)]
                    >> " - Road: " >> (+set[alnum | '-'])[xp::ref(data.road) = _]
                    >> " - Km: " >> real[xp::ref(data.km) = as<double>(_)];

    xp::cregex parser = (header >> keyword >> _ln);

    xp::cregex_iterator cur(input, input + len, parser);
    xp::cregex_iterator end;

    for (; cur != end; ++cur)
        sequences.emplace_back(data);

    return 0;
}

Please, mind the VS 2010 constraint.

A: I see roughly two areas for improvement:

*

*you basically parse all lines, including the ones that don't interest you

*you allocate a lot of strings

I'd suggest using string views to fix the allocations. Next, you could try to avoid parsing lines that don't match the SEQUENCE pattern. There's no reason in principle why this couldn't be done using Boost Xpressive, but my weapon of choice happens to be Boost Spirit, so I'll include it too.
Being Selective
You can detect interesting lines before spending more effort like this:
cregex signature = -*~_n >> " - SEQUENCE: " >> (+_d) >> before(_ln|eos);
for (xp::cregex_iterator cur(b, e, signature), end; cur != end; ++cur) {
    std::cout << "'" << cur->str() << "'\n";
}

This prints
'[2018-Mar-13 13:14:01.819966] - 2.440 s => Driver: 0 - Speed: 0.1 - Road: A-11 - Km: 90.0 - SEQUENCE: 1'
'[2018-Mar-13 13:14:02.409855] - 3.030 s => Driver: 0 - Speed: 0.2 - Road: A-11 - Km: 90.0 - SEQUENCE: 4'
'[2018-Mar-13 13:14:02.409855] - 3.030 s => Driver: 0 - Speed: 0.3 - Road: A-11 - Km: 90.0 - SEQUENCE: 8'
'[2018-Mar-13 13:14:02.620424] - 3.240 s => Driver: 0 - Speed: 0.4 - Road: A-11 - Km: 90.1 - SEQUENCE: 15'
'[2018-Mar-13 13:14:03.039600] - 3.660 s => Driver: 0 - Speed: 0.8 - Road: B-302 - Km: 90.1 - SEQUENCE: 21'
'[2018-Mar-13 13:14:03.460012] - 4.080 s => Driver: 0 - Speed: 1.7 - Road: B-302 - Km: 90.3 - SEQUENCE: 29'
'[2018-Mar-13 13:14:03.669448] - 4.290 s => Driver: 0 - Speed: 2.2 - Road: B-302 - Km: 90.4 - SEQUENCE: 34'
'[2018-Mar-13 13:14:04.090444] - 4.710 s => Driver: 0 - Speed: 3.5 - Road: B-302 - Km: 90.7 - SEQUENCE: 45'

Nothing is allocated. This should be pretty fast.
Reducing Allocations
For this I'm going to switch to Spirit because it will make things easier.

Note: The real reason I switched here is because, in contrast to Boost Spirit, Xpressive does not appear to have extensible attribute propagation traits. This could be my lack of experience with it.
The alternative approach would almost certainly replace the actions with manual propagation code, which in turn would inform named capture groups in order to keep things legible. I'm not sure about the performance overhead of these, so let's not use them at this point.

You can use boost::string_view with a trait to "teach" Qi to assign text to it:
namespace boost { namespace spirit { namespace traits {
    template <typename It>
    struct assign_to_attribute_from_iterators<boost::string_view, It, void> {
        static inline void call(It f, It l, boost::string_view& attr) { attr = boost::string_view { &*f, size_t(std::distance(f,l)) }; }
    };
} } }

That way, the Qi grammar could look just like this:
template <typename It> struct QiParser : qi::grammar<It, Sequence()> {
    QiParser() : QiParser::base_type(line) {
        using namespace qi;
        auto date_time = copy(
            repeat(4)[digit] >> '-' >> repeat(3)[alpha] >> '-' >> repeat(2)[digit] >> ' ' >>
            repeat(2)[digit] >> ':' >> repeat(2)[digit] >> ':' >> repeat(2)[digit] >> '.' >> +digit);

        line = '[' >> raw[date_time] >> "] - "
            >> double_ >> " s"
            >> " => Driver: "  >> int_
            >> " - Speed: "    >> double_
            >> " - Road: "     >> raw[+graph]
            >> " - Km: "       >> double_
            >> " - SEQUENCE: " >> int_
            >> (eol|eoi);
    }
  private:
    qi::rule<It, Sequence()> line;
};

Using it is exceedingly simple, especially if not being "selective".

This happens to be the "winning" configuration. Here's the standalone, simplified version of that algorithm after removing all benchmark-related generics and options: Live on Coliru

Benchmark Results: Surprises
Using the selective parsing approach only made the Xpressive approach slower: Interactive

Comparing to Spirit, I had initially started with the selective approach as well (fully anticipating it to be faster). Here's the not-so-encouraging results: Interactive

Oops. The initial Xpressive approach is still superior!
Adjusting The Assumptions
Okay, clearly doing the shallow scan first, and then the "full parse" hurts the performance. Theorizing, this is likely down to cache/prefetch effects. Also, the linear approach may win because it's easier to spot when a line doesn't start with a '[' character, than to see whether it ends with the SEQUENCE pattern.
So I decided to adapt the spirit approaches to linear mode too, and see whether the win by reducing allocations is still worth it: Interactive

Now we're getting results. Let's look at the difference between the std::string and boost::string_view approaches in detail: Interactive

Summary/Conclusions
The reduced allocations are good for 30% more efficiency. In total, an improvement of 10 times over the original approach.
Note that the benchmark code goes out of its way to eliminate unfair differences between the implementations (e.g. by pre compiling everything on both Spirit and Xpressive). See the full benchmark code:

The winning implementation in isolation: Live on Coliru

#include <boost/fusion/adapted/struct.hpp>
#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/repository/include/qi_seek.hpp>
#include <boost/utility/string_view.hpp>
#include <cstring> // strlen

using It = char const*;

struct Sequence {
    int driver;
    int sequence;
    double time;
    double vel;
    double km;
    boost::string_view date;
    boost::string_view road;
};

BOOST_FUSION_ADAPT_STRUCT(::Sequence, date, time, driver, vel, road, km, sequence)

namespace qi = boost::spirit::qi;

namespace boost { namespace spirit { namespace traits {
    template <typename It>
    struct assign_to_attribute_from_iterators<boost::string_view, It, void> {
        static inline void call(It f, It l, boost::string_view& attr) { attr = boost::string_view { &*f, size_t(std::distance(f,l)) }; }
    };
} } }

std::vector<Sequence> parse_spirit(It b, It e) {

    qi::rule<It, Sequence()> static const line = []{
        using namespace qi;
        auto date_time = copy(
            repeat(4)[digit] >> '-' >> repeat(3)[alpha] >> '-' >> repeat(2)[digit] >> ' ' >>
            repeat(2)[digit] >> ':' >> repeat(2)[digit] >> ':' >> repeat(2)[digit] >> '.' >> +digit);

        qi::rule<It, Sequence()> r = '[' >> raw[date_time] >> "] - "
            >> double_ >> " s"
            >> " => Driver: "  >> int_
            >> " - Speed: "    >> double_
            >> " - Road: "     >> raw[+graph]
            >> " - Km: "       >> double_
            >> " - SEQUENCE: " >> int_
            >> (eol|eoi);

        return r;
    }();

    std::vector<Sequence> sequences;

    parse(b, e, *boost::spirit::repository::qi::seek[line], sequences);

    return sequences;
}

static char input[] = /*... see question ...*/;
static const size_t len = strlen(input);

int main() {
    auto sequences = parse_spirit(input, input+len);
    std::cout << "Parsed: " << sequences.size() << " sequence lines\n";
}

Full Benchmark Code
The benchmarks use Nonius for the measurements and statistical analysis.

*

*Full interactive graphs here: http://stackoverflow-sehe.s3.amazonaws.com/9f88e055-4b5f-4026-8f2f-54e2bcad430d/stats.html

*Compile with -DUSE_NONIUS if you have Nonius available

*Compile with -DVERIFY_OUTPUT for "correctness" mode: in this case no timings are done but the results of the parse are echoed for validation

#include <cstring> // strlen

static char input[] =
"[2018-Mar-13 13:13:59.580482] - 0.200 s => Driver: 0 - Speed: 0.0 - Road: A-11 - Km: 90.0 - SLOPE: 0\n\
[2018-Mar-13 13:14:01.170203] - 1.790 s => Driver: 0 - Speed: 0.0 - Road: A-11 - Km: 90.0 - GEAR: 0\n\
[2018-Mar-13 13:14:01.170203] - 1.790 s => Driver: 0 - Speed: 0.1 - Road: A-11 - Km: 90.0 - GEAR: 1\n\
[2018-Mar-13 13:14:01.819966] - 2.440 s => Driver: 0 - Speed: 0.1 - Road: A-11 - Km: 90.0 - SEQUENCE: 1\n\
[2018-Mar-13 13:14:01.819966] - 2.440 s => Driver: 0 - Speed: 0.2 - Road: A-11 - Km: 90.0 - CLUTCH: 1\n\
[2018-Mar-13 13:14:01.819966] - 2.540 s => Backup to regestry\n\
[2018-Mar-13 13:14:02.409855] - 3.030 s => Driver: 0 - Speed: 0.2 - Road: A-11 - Km: 90.0 - SEQUENCE: 4\n\
[2018-Mar-13 13:14:02.409855] - 3.030 s => Driver: 0 - Speed: 0.3 - Road: A-11 - Km: 90.0 - SEQUENCE: 8\n\
[2018-Mar-13 13:14:01.819966] - 3.110 s => Backup to regestry\n\
[2018-Mar-13 13:14:02.620424] - 3.240 s => Driver: 0 - Speed: 0.4 - Road: A-11 - Km: 90.1 - SEQUENCE: 15\n\
[2018-Mar-13 13:14:02.829983] - 3.450 s => Driver: 0 - Speed: 0.6 - Road: B-302 - Km: 90.1 - SLOPE: -5\n\
[2018-Mar-13 13:14:03.039600] - 3.660 s => Driver: 0 - Speed: 0.8 - Road: B-302 - Km: 90.1 - SEQUENCE: 21\n\
[2018-Mar-13 13:14:03.250451] - 3.870 s => Driver: 0 - Speed: 1.2 - Road: B-302 - Km: 90.2 - GEAR: 2\n\
[2018-Mar-13 13:14:03.460012] - 4.080 s => Driver: 0 - Speed: 1.7 - Road: B-302 - Km: 90.3 - SEQUENCE: 29\n\
[2018-Mar-13 13:14:03.669448] - 4.290 s => Driver: 0 - Speed: 2.2 - Road: B-302 - Km: 90.4 - SEQUENCE: 34\n\
[2018-Mar-13 13:14:03.880066] - 4.500 s => Driver: 0 - Speed: 2.8 - Road: B-302 - Km: 90.5 - CLUTCH: 1\n\
[2018-Mar-13 13:14:04.090444] - 4.710 s => Driver: 0 - Speed: 3.5 - Road: B-302 - Km: 90.7 - SEQUENCE: 45\n\
[2018-Mar-13 13:14:04.300160] - 4.920 s => Driver: 0 - Speed: 4.2 - Road: B-302 - Km: 90.9 - SLOPE: 10\n\
[2018-Mar-13 13:13:59.580482] - 0.200 s => Driver: 0 - Speed: 0.0 - Road: A-11 - Km: 90.0 - SLOPE: 0\n\
[2018-Mar-13 13:14:01.170203] - 1.790 s => Driver: 0 - Speed: 0.0 - Road: A-11 - Km: 90.0 - GEAR: 0\n\
[2018-Mar-13 13:14:01.170203] - 1.790 s => Driver: 0 - Speed: 0.1 - Road: A-11 - Km: 90.0 - GEAR: 1\n\
[2018-Mar-13 13:14:01.819966] - 2.440 s => Driver: 0 - Speed: 0.1 - Road: A-11 - Km: 90.0 - SEQUENCE: 1\n\
[2018-Mar-13 13:14:01.819966] - 2.440 s => Driver: 0 - Speed: 0.2 - Road: A-11 - Km: 90.0 - CLUTCH: 1\n\
[2018-Mar-13 13:14:01.819966] - 2.540 s => Backup to regestry\n\
[2018-Mar-13 13:14:02.409855] - 3.030 s => Driver: 0 - Speed: 0.2 - Road: A-11 - Km: 90.0 - SEQUENCE: 4\n\
[2018-Mar-13 13:14:02.409855] - 3.030 s => Driver: 0 - Speed: 0.3 - Road: A-11 - Km: 90.0 - SEQUENCE: 8\n\
[2018-Mar-13 13:14:01.819966] - 3.110 s => Backup to regestry\n\
[2018-Mar-13 13:14:02.620424] - 3.240 s => Driver: 0 - Speed: 0.4 - Road: A-11 - Km: 90.1 - SEQUENCE: 15\n\
[2018-Mar-13 13:14:02.829983] - 3.450 s => Driver: 0 - Speed: 0.6 - Road: B-302 - Km: 90.1 - SLOPE: -5\n\
[2018-Mar-13 13:14:03.039600] - 3.660 s => Driver: 0 - Speed: 0.8 - Road: B-302 - Km: 90.1 - SEQUENCE: 21\n\
[2018-Mar-13 13:14:03.250451] - 3.870 s => Driver: 0 - Speed: 1.2 - Road: B-302 - Km: 90.2 - GEAR: 2\n\
[2018-Mar-13 13:14:03.460012] - 4.080 s => Driver: 0 - Speed: 1.7 - Road: B-302 - Km: 90.3 - SEQUENCE: 29\n\
[2018-Mar-13 13:14:03.669448] - 4.290 s => Driver: 0 - Speed: 2.2 - Road: B-302 - Km: 90.4 - SEQUENCE: 34\n\
[2018-Mar-13 13:14:03.880066] - 4.500 s => Driver: 0 - Speed: 2.8 - Road: B-302 - Km: 90.5 - CLUTCH: 1\n\
[2018-Mar-13 13:14:04.090444] - 4.710 s => Driver: 0 - Speed: 3.5 - Road: B-302 - Km: 90.7 - SEQUENCE: 45\n\
[2018-Mar-13 13:14:04.300160] - 4.920 s => Driver: 0 - Speed: 4.2 - Road: B-302 - Km: 90.9 - SLOPE: 10\n\
[2018-Mar-13 13:14:04.510025] - 5.130 s => Driver: 0 - Speed: 4.9 - Road: B-302 - Km: 91.1 - GEAR: 3";
static const size_t len = strlen(input);

#include <boost/utility/string_view.hpp>
#include <boost/fusion/adapted/struct.hpp>

template <typename String> struct Sequence {
    int driver;
    int sequence;
    double time;
    double vel;
    double km;
    String date;
    String road;
};

BOOST_FUSION_ADAPT_TPL_STRUCT((T),(Sequence)(T), date, time, driver, vel, road, km, sequence)

// Declare implementations under test:
using It = char const*;
template <typename S> std::vector<S> parse_xpressive_linear(It b, It e);
template <typename S> std::vector<S> parse_xpressive_selective(It b, It e);
template <typename S> std::vector<S> parse_spirit_linear(It b, It e);
template <typename S> std::vector<S> parse_spirit_selective(It b, It e);

#ifdef VERIFY_OUTPUT
    #include <boost/fusion/include/io.hpp>
    using boost::fusion::operator<<;
    #include <iostream>

    #define VERIFY()                                                                    \
        do {                                                                            \
            std::cout << "L:" << __LINE__ << " Parsed: " << sequences.size() << "\n";   \
            for (auto r : sequences) {                                                  \
                std::cout << r << "\n";                                                 \
            }                                                                           \
        } while (0)
#else
    #define VERIFY() do { } while (0)
#endif

#ifdef USE_NONIUS
    #include <nonius/benchmark.h++>
    #define NONIUS_RUNNER
    #include <nonius/main.h++>
#else
    // mock nonius
    namespace nonius {
        struct chronometer{
            template <typename F> static inline void measure(F&& f) { std::forward<F>(f)(); }
        };
        static std::vector<std::function<void(chronometer)>> s_benchmarks;
        #define TOKENPASTE(x, y) x ## y
        #define TOKENPASTE2(x, y) TOKENPASTE(x, y)
        #define NONIUS_BENCHMARK(name, f) static auto TOKENPASTE2(s_reg_, __LINE__) = []{ ::nonius::s_benchmarks.push_back(f); return 42; }();

        void run() { for (auto& b : s_benchmarks) b({}); }
    }

    int main() {
        nonius::run();
    }
#endif

template <typename R>
void do_test_kernel(nonius::chronometer& cm, std::vector<R> (*f)(It, It)) {
    std::vector<R> sequences;
    cm.measure([&sequences,f]{ sequences = f(input, input + len); });
    VERIFY();
}

#define TEST_CASE(name, string) NONIUS_BENCHMARK(#name"-"#string, [](nonius::chronometer cm) { do_test_kernel(cm, &name<Sequence<string> >); })
// Xpressive doesn't support string_view
TEST_CASE(parse_xpressive_linear,    std::string)
TEST_CASE(parse_xpressive_selective, std::string)

TEST_CASE(parse_spirit_linear,       std::string)
TEST_CASE(parse_spirit_linear,       boost::string_view)
TEST_CASE(parse_spirit_selective,    std::string)
TEST_CASE(parse_spirit_selective,    boost::string_view)

#include <boost/xpressive/xpressive.hpp>
#include <boost/xpressive/regex_actions.hpp>

namespace xp = boost::xpressive;

namespace XpressiveDetail {
    using namespace xp;

    struct Scanner {
        cregex scan {-*~xp::_n >> " - SEQUENCE: " >> (+xp::_d) >> xp::_ln};
    };

    template <typename Seq> struct Parser : Scanner {
        mutable Seq seq; // non-thread-safe, but fairer to compare to Spirit

        cregex real    = (+_d >> '.' >> +_d);
        cregex keyword = " - SEQUENCE: " >> (+_d)[xp::ref(seq.sequence) = as<int>(_)];
        cregex date    = repeat<4>(_d) >> '-'
            >> repeat<3>(alpha) >> '-'
            >> repeat<2>(_d)
            >> _s
            >> repeat<2>(_d) >> ':'
            >> repeat<2>(_d) >> ':'
            >> repeat<2>(_d)
            >> '.' >> (+_d);

        cregex header = '[' >> date[xp::ref(seq.date) = _] >> "] - "
            >> real[xp::ref(seq.time) = as<double>(_)]
            >> " s => Driver: " >> (+_d)             [ xp ::ref(seq.driver) = as<int>(_) ]
            >> " - Speed: "     >> real              [ xp ::ref(seq.vel)    = as<double>(_) ]
            >> " - Road: "      >> (+set[alnum|'-']) [ xp ::ref(seq.road)   = _ ]
            >> " - Km: "        >> real              [ xp ::ref(seq.km)     = as<double>(_) ];

        cregex parser = (header >> keyword >> _ln);
    };
}

template <typename Seq>
std::vector<Seq> parse_xpressive_linear(It b, It e) {
    std::vector<Seq> sequences;
    using namespace xp;

    static const XpressiveDetail::Parser<Seq> precompiled{};

    for (xp::cregex_iterator cur(b, e, precompiled.parser), end; cur != end; ++cur)
        sequences.push_back(std::move(precompiled.seq));

    return sequences;
}

template <typename Seq>
std::vector<Seq> parse_xpressive_selective(It b, It e) {
    std::vector<Seq> sequences;
    using namespace xp;

    static const XpressiveDetail::Parser<Seq> precompiled{};
    xp::match_results<It> m;

    for (auto& match : boost::make_iterator_range(xp::cregex_iterator{b, e, precompiled.scan}, {})) {
        if (xp::regex_match(match[0].first, match[0].second, m, precompiled.parser))
            sequences.push_back(std::move(precompiled.seq));
    }

    return sequences;
}

//#define BOOST_SPIRIT_DEBUG
#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/include/phoenix.hpp>
namespace qi = boost::spirit::qi;

namespace boost { namespace spirit { namespace traits {
    template <typename It>
    struct assign_to_attribute_from_iterators<boost::string_view, It, void> {
        static inline void call(It f, It l, boost::string_view& attr) { attr = boost::string_view { &*f, size_t(std::distance(f,l)) }; }
    };
} } }

template <typename It, typename Attribute> struct QiParser : qi::grammar<It, Attribute()> {
    QiParser() : QiParser::base_type(line) {
        using namespace qi;
        auto date_time = copy(
            repeat(4)[digit] >> '-' >> repeat(3)[alpha] >> '-' >> repeat(2)[digit] >> ' ' >>
            repeat(2)[digit] >> ':' >> repeat(2)[digit] >> ':' >> repeat(2)[digit] >> '.' >> +digit);

        line = '[' >> eps(clear(_val)) >> raw[date_time] >> "] - "
            >> double_ >> " s"
            >> " => Driver: "  >> int_
            >> " - Speed: "    >> double_
            >> " - Road: "     >> raw[+graph]
            >> " - Km: "       >> double_
            >> " - SEQUENCE: " >> int_
            >> (eol|eoi);

        BOOST_SPIRIT_DEBUG_NODES((line))
    }
  private:
    struct clear_f {
        // only required for linear approach to std::string-based
        bool operator()(Sequence<std::string>& v)      const { v = {};      return true; }
        bool operator()(Sequence<boost::string_view>&) const { /*no_op();*/ return true; }
    };
    boost::phoenix::function<clear_f> clear;

    qi::rule<It, Attribute()> line;
};

template <typename Seq = Sequence<std::string> >
std::vector<Seq> parse_spirit_selective(It b, It e) {
    static QiParser<It, Seq> const qi_parser{};
    static XpressiveDetail::Scanner const precompiled{};

    std::vector<Seq> sequences;

    for (auto& match : boost::make_iterator_range(xp::cregex_iterator{b, e, precompiled.scan}, {})) {
        Seq r;
        if (parse(match[0].first, match[0].second, qi_parser, r))
            sequences.push_back(r);
    }

    return sequences;
}

#include <boost/spirit/repository/include/qi_seek.hpp>

template <typename Seq = Sequence<std::string> >
std::vector<Seq> parse_spirit_linear(It b, It e) {
    using boost::spirit::repository::qi::seek;

    static QiParser<It, Seq> const qi_parser{};

    std::vector<Seq> sequences;
    parse(b, e, *seek[qi_parser], sequences);
    return sequences;
}

Sample text report:
clock resolution: mean is 17.7534 ns (40960002 iterations)

benchmarking parse_xpressive_linear-std::string
collecting 100 samples, 1 iterations each, in estimated 15.7252 ms
mean: 156.418 μs, lb 155.863 μs, ub 158.24 μs, ci 0.95
std dev: 4.62848 μs, lb 1637.89 ns, ub 10.4043 μs, ci 0.95
found 4 outliers among 100 samples (4%)
variance is moderately inflated by outliers

benchmarking parse_xpressive_selective-std::string
collecting 100 samples, 1 iterations each, in estimated 31.5459 ms
mean: 313.992 μs, lb 313.39 μs, ub 315.599 μs, ci 0.95
std dev: 4.5415 μs, lb 1105.98 ns, ub 9.07809 μs, ci 0.95
found 11 outliers among 100 samples (11%)
variance is slightly inflated by outliers

benchmarking parse_spirit_linear-std::string
collecting 100 samples, 1 iterations each, in estimated 2.1556 ms
mean: 21.2533 μs, lb 21.1623 μs, ub 21.6854 μs, ci 0.95
std dev: 870.481 ns, lb 53.2809 ns, ub 2.0738 μs, ci 0.95
found 7 outliers among 100 samples (7%)
variance is moderately inflated by outliers

benchmarking parse_spirit_linear-boost::string_view
collecting 100 samples, 2 iterations each, in estimated 2.944 ms
mean: 14.6677 μs, lb 14.6342 μs, ub 14.8279 μs, ci 0.95
std dev: 318.252 ns, lb 22.5097 ns, ub 757.555 ns, ci 0.95
found 5 outliers among 100 samples (5%)
variance is moderately inflated by outliers

benchmarking parse_spirit_selective-std::string
collecting 100 samples, 1 iterations each, in estimated 27.5512 ms
mean: 273.052 μs, lb 272.77 μs, ub 273.952 μs, ci 0.95
std dev: 2.31473 μs, lb 835.184 ns, ub 5.1322 μs, ci 0.95
found 10 outliers among 100 samples (10%)
variance is unaffected by outliers

benchmarking parse_spirit_selective-boost::string_view
collecting 100 samples, 1 iterations each, in estimated 27.0766 ms
mean: 269.446 μs, lb 269.208 μs, ub 270.268 μs, ci 0.95
std dev: 2.01634 μs, lb 627.834 ns, ub 4.56949 μs, ci 0.95
found 10 outliers among 100 samples (10%)
variance is unaffected by outliers

A: You can use fusion with spirit traits (see eg parsing into several vector members), but I'd consider using semantic actions.
Here's the design conundrum:
Separate vectors with a trait
Live On Coliru
#include <boost/fusion/adapted/struct.hpp>
#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/repository/include/qi_seek.hpp>
#include <boost/utility/string_view.hpp>
#include <cstring> // strlen

using It = char const*;

struct BaseEvent {
    int driver;
    int sequence;
    double time;
    double vel;
    double km;
    boost::string_view date;
    boost::string_view road;
};
struct Sequence : BaseEvent{};
struct Clutch : BaseEvent{};
struct Gear : BaseEvent{};

BOOST_FUSION_ADAPT_STRUCT(::Sequence, date, time, driver, vel, road, km, sequence)
BOOST_FUSION_ADAPT_STRUCT(::Clutch, date, time, driver, vel, road, km, sequence)
BOOST_FUSION_ADAPT_STRUCT(::Gear, date, time, driver, vel, road, km, sequence)

struct LogEvents {
    std::vector<Sequence> sequence;
    std::vector<Clutch> clutch;
    std::vector<Gear> gear;

    void add(Sequence const& s) { sequence.push_back(s); }
    void add(Clutch   const& c) { clutch.push_back(c);   }
    void add(Gear     const& g) { gear.push_back(g);     }
};

namespace qi = boost::spirit::qi;

namespace boost { namespace spirit { namespace traits {
    template <typename It>
    struct assign_to_attribute_from_iterators<boost::string_view, It, void> {
        static inline void call(It f, It l, boost::string_view& attr) { attr = boost::string_view { &*f, size_t(std::distance(f,l)) }; }
    };

    template <> struct is_container<LogEvents> : std::true_type {};

    template <> struct container_value<LogEvents> {
        using type = boost::variant<::Sequence, ::Clutch, ::Gear>;
    };

    template <typename T> struct push_back_container<LogEvents, T> {
        struct Visitor {
            LogEvents& _log;
            template <typename U> void operator()(U const& ev) const { _log.add(ev); }
            using result_type = void;
        };

        template <typename... U>
        static bool call(LogEvents& log, boost::variant<U...> const& attribute) {
            boost::apply_visitor(Visitor{log}, attribute);
            return true;
        }
    };
} } }

namespace QiParsers {
    template <typename It, typename Attribute>
    struct BaseEventParser : qi::grammar<It, Attribute()> {
        BaseEventParser(std::string const& event_type) : BaseEventParser::base_type(start) {
            using namespace qi;
            auto date_time = copy(
                    repeat(4)[digit] >> '-' >> repeat(3)[alpha] >> '-' >> repeat(2)[digit] >> ' ' >>
                    repeat(2)[digit] >> ':' >> repeat(2)[digit] >> ':' >> repeat(2)[digit] >> '.' >> +digit);

            start
                = '[' >> raw[date_time] >> "] - "
                >> double_ >> " s"
                >> " => Driver: "  >> int_
                >> " - Speed: "    >> double_
                >> " - Road: "     >> raw[+graph]
                >> " - Km: "       >> double_
                >> " - " >> lit(event_type) >> ": " >> int_
                >> (eol|eoi);
        }

      private:
        qi::rule<It, Attribute()> start;
    };
}

LogEvents parse_spirit(It b, It e) {
    QiParsers::BaseEventParser<It, ::Sequence> sequence("SEQUENCE");
    QiParsers::BaseEventParser<It, ::Clutch>   clutch("CLUTCH");
    QiParsers::BaseEventParser<It, ::Gear>     gear("GEAR");

    LogEvents events;
    assert(parse(b, e, *boost::spirit::repository::qi::seek[sequence|clutch|gear], events));

    return events;
}

static char input[] = /* see question */;
static const size_t len = strlen(input);

int main() {
    auto events = parse_spirit(input, input+len);
    std::cout << "Events: "
        << events.sequence.size() << " sequence, "
        << events.clutch.size() << " clutch, "
        << events.gear.size() << " gear events\n";

    using boost::fusion::operator<<;
    for (auto& s : events.sequence) { std::cout << "SEQUENCE: " <<  s << "\n"; }
    for (auto& c : events.clutch)   { std::cout << "CLUTCH:   " <<  c << "\n"; }
    for (auto& g : events.gear)     { std::cout << "GEAR:     " <<  g << "\n"; }
}

Flipping It Around: 1 vector<variant<>>
Wouldn't it make more sense to have a vector of variants instead?
Live On Coliru
#include <boost/fusion/adapted/struct.hpp>
#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/repository/include/qi_seek.hpp>
#include <boost/utility/string_view.hpp>
#include <cstring> // strlen

using It = char const*;

namespace MyEvents {
    struct BaseEvent {
        int driver;
        int sequence;
        double time;
        double vel;
        double km;
        boost::string_view date;
        boost::string_view road;
    };
    struct Sequence : BaseEvent{};
    struct Clutch : BaseEvent{};
    struct Gear : BaseEvent{};

    using LogEvent = boost::variant<Sequence, Clutch, Gear>;
    using LogEvents = std::vector<LogEvent>;
}

BOOST_FUSION_ADAPT_STRUCT(MyEvents::Sequence, date, time, driver, vel, road, km, sequence)
BOOST_FUSION_ADAPT_STRUCT(MyEvents::Clutch,   date, time, driver, vel, road, km, sequence)
BOOST_FUSION_ADAPT_STRUCT(MyEvents::Gear,     date, time, driver, vel, road, km, sequence)

namespace qi = boost::spirit::qi;

namespace boost { namespace spirit { namespace traits {
    template <typename It>
    struct assign_to_attribute_from_iterators<boost::string_view, It, void> {
        static inline void call(It f, It l, boost::string_view& attr) { attr = boost::string_view { &*f, size_t(std::distance(f,l)) }; }
    };
} } }

namespace QiParsers {
    template <typename It, typename Attribute>
    struct BaseEventParser : qi::grammar<It, Attribute()> {
        BaseEventParser(std::string const& event_type) : BaseEventParser::base_type(start) {
            using namespace qi;
            auto date_time = copy(
                    repeat(4)[digit] >> '-' >> repeat(3)[alpha] >> '-' >> repeat(2)[digit] >> ' ' >>
                    repeat(2)[digit] >> ':' >> repeat(2)[digit] >> ':' >> repeat(2)[digit] >> '.' >> +digit);

            start
                = '[' >> raw[date_time] >> "] - "
                >> double_ >> " s"
                >> " => Driver: "  >> int_
                >> " - Speed: "    >> double_
                >> " - Road: "     >> raw[+graph]
                >> " - Km: "       >> double_
                >> " - " >> lit(event_type) >> ": " >> int_
                >> (eol|eoi);
        }

      private:
        qi::rule<It, Attribute()> start;
    };

    template <typename It>
    struct LogParser : qi::grammar<It, MyEvents::LogEvents()> {
        LogParser() : LogParser::base_type(start) {
            using namespace qi;
            using boost::spirit::repository::qi::seek;

            event = sequence | clutch | gear ; // TODO add types
            start = *seek[event];
        }

      private:
        qi::rule<It, MyEvents::LogEvents()> start;
        qi::rule<It, MyEvents::LogEvent()> event;
        BaseEventParser<It, MyEvents::Sequence> sequence{"SEQUENCE"};
        BaseEventParser<It, MyEvents::Clutch>   clutch{"CLUTCH"};
        BaseEventParser<It, MyEvents::Gear>     gear{"GEAR"};
    };
}

MyEvents::LogEvents parse_spirit(It b, It e) {
    static QiParsers::LogParser<It> const parser {};

    MyEvents::LogEvents events;
    parse(b, e, parser, events);

    return events;
}

static char input[] = /* see question */;
static const size_t len = strlen(input);

namespace MyEvents { // for debug/demo
    using boost::fusion::operator<<;
    static inline char const* kind(Sequence const&) { return "SEQUENCE"; }
    static inline char const* kind(Clutch   const&) { return "CLUTCH"; }
    static inline char const* kind(Gear     const&) { return "GEAR"; }

    struct KindVisitor : boost::static_visitor<char const*> {
        template <typename T> char const* operator()(T const& ev) const { return kind(ev); }
    };
    static inline char const* kind(LogEvent const& ev) {
        return boost::apply_visitor(KindVisitor{}, ev);
    }
}

int main() {
    auto events = parse_spirit(input, input+len);
    std::cout << "Parsed: " << events.size() << " events\n";

    for (auto& e : events)
        std::cout << kind(e) << ": " << e << "\n";
}

Generalize: Common Fields and Other Events
Especially if you then continue on to generalize:
Live On Coliru
#include <boost/fusion/adapted/struct.hpp>
#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/repository/include/qi_seek.hpp>
#include <boost/utility/string_view.hpp>
#include <cstring> // strlen

using It = char const*;

namespace MyEvents {
    enum class Kind { Sequence, Clutch, Gear, Slope, Other };

    struct CommonFields {
        boost::string_view date;
        double duration;
    };

    struct BaseEvent {
        CommonFields common;
        int driver;
        int event_id;
        double vel;
        double km;
        boost::string_view road;
        Kind kind;
    };

    struct OtherEvent {
        CommonFields common;
        std::string message;
    };

    using LogEvent = boost::variant<BaseEvent, OtherEvent>;
    using LogEvents = std::vector<LogEvent>;
}

BOOST_FUSION_ADAPT_STRUCT(MyEvents::CommonFields, date, duration)
BOOST_FUSION_ADAPT_STRUCT(MyEvents::BaseEvent, common, driver, vel, road, km, kind, event_id)
BOOST_FUSION_ADAPT_STRUCT(MyEvents::OtherEvent, common, message)

namespace qi = boost::spirit::qi;

namespace boost { namespace spirit { namespace traits {
    template <typename It>
    struct assign_to_attribute_from_iterators<boost::string_view, It, void> {
        static inline void call(It f, It l, boost::string_view& attr) { attr = boost::string_view { &*f, size_t(std::distance(f,l)) }; }
    };
} } }

namespace QiParsers {
    template <typename It>
    struct LogParser : qi::grammar<It, MyEvents::LogEvents()> {
        using Kind = MyEvents::Kind;

        LogParser() : LogParser::base_type(start) {
            using namespace qi;

            kind.add
                ("SEQUENCE", Kind::Sequence)
                ("CLUTCH", Kind::Clutch)
                ("GEAR", Kind::Gear)
                ("SLOPE", Kind::Slope)
                ;

            common_fields
                = '[' >> raw[
                        repeat(4)[digit] >> '-' >> repeat(3)[alpha] >> '-' >> repeat(2)[digit] >> ' ' >>
                        repeat(2)[digit] >> ':' >> repeat(2)[digit] >> ':' >> repeat(2)[digit] >> '.' >> +digit
                ] >> "]"
                >> " - " >> double_ >> " s";

            base_event
                = common_fields
                >> " => Driver: "  >> int_
                >> " - Speed: "    >> double_
                >> " - Road: "     >> raw[+graph]
                >> " - Km: "       >> double_
                >> " - " >> kind >> ": " >> int_;

            other_event
                = common_fields
                >> " => " >> *~char_("\r\n");

            event
                = (base_event | other_event)
                >> (eol|eoi);

            start = *boost::spirit::repository::qi::seek[event];
        }

      private:
        qi::rule<It, MyEvents::LogEvents()> start;
        qi::rule<It, MyEvents::LogEvent()> event;

        qi::rule<It, MyEvents::CommonFields()> common_fields;
        qi::rule<It, MyEvents::BaseEvent()> base_event;
        qi::rule<It, MyEvents::OtherEvent()> other_event;

        qi::symbols<char, MyEvents::Kind> kind;
    };
}

MyEvents::LogEvents parse_spirit(It b, It e) {
    static QiParsers::LogParser<It> const parser {};

    MyEvents::LogEvents events;
    parse(b, e, parser, events);

    return events;
}

static char input[] = /* see question */;
static const size_t len = strlen(input);

namespace MyEvents { // for debug/demo
    using boost::fusion::operator<<;

    static inline Kind getKind(BaseEvent const& be) { return be.kind; }
    static inline Kind getKind(OtherEvent const&) { return Kind::Other; }

    struct KindVisitor : boost::static_visitor<Kind> {
        template <typename T> Kind operator()(T const& ev) const { return getKind(ev); }
    };
    static inline Kind getKind(LogEvent const& ev) {
        return boost::apply_visitor(KindVisitor{}, ev);
    }

    static inline std::ostream& operator<<(std::ostream& os, Kind k) {
        switch(k) {
            case Kind::Sequence: return os << "SEQUENCE";
            case Kind::Clutch:   return os << "CLUTCH";
            case Kind::Gear:     return os << "GEAR";
            case Kind::Slope:    return os << "SLOPE";
            case Kind::Other:    return os << "(Other)";
        }
        return os;
    }
}

int main() {
    auto events = parse_spirit(input, input+len);
    std::cout << "Parsed: " << events.size() << " events\n";

    for (auto& e : events)
        std::cout << getKind(e) << ": " << e << "\n";
}

Prints e.g.
Parsed: 37 events
SLOPE: ((2018-Mar-13 13:13:59.580482 0.2) 0 0 A-11 90 SLOPE 0)
GEAR: ((2018-Mar-13 13:14:01.170203 1.79) 0 0 A-11 90 GEAR 0)
GEAR: ((2018-Mar-13 13:14:01.170203 1.79) 0 0.1 A-11 90 GEAR 1)
SEQUENCE: ((2018-Mar-13 13:14:01.819966 2.44) 0 0.1 A-11 90 SEQUENCE 1)
CLUTCH: ((2018-Mar-13 13:14:01.819966 2.44) 0 0.2 A-11 90 CLUTCH 1)
(Other): ((2018-Mar-13 13:14:01.819966 2.54) Backup to regestry)
[...]

BONUS: Multi-Index
If you use multi-index containers you can have your cake and eat it, too.
Here's a sample definition that allows you to index the vector according to some rather arbitrarily chosen features:
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/ordered_index.hpp>
#include <boost/multi_index/composite_key.hpp>
#include <boost/multi_index/global_fun.hpp>

namespace Indexing {
    namespace bmi = boost::multi_index;

    using MyEvents::LogEvent;

    double getDuration(LogEvent const& ev) { return getCommon(ev).duration; }

    using Table = bmi::multi_index_container<
        std::reference_wrapper<LogEvent const>, //LogEvent,
        bmi::indexed_by<
            bmi::ordered_non_unique<
                bmi::tag<struct primary>,
                bmi::composite_key<
                    LogEvent,
                    bmi::global_fun<LogEvent const&, MyEvents::Kind, MyEvents::getKind>,
                    bmi::global_fun<LogEvent const&, int,            MyEvents::getEventId>
                >
            >,
            bmi::ordered_non_unique<
                bmi::tag<struct duration>,
                bmi::global_fun<LogEvent const&, double, getDuration>
            >
        >
    >;
}

Now you can do interesting things like:
Indexing::Table idx(events.begin(), events.end());

/*
 * // To print all events, grouped by by kind and event id:
 * for (MyEvents::LogEvent const& e : idx)
 *     std::cout << getKind(e) << ": " << e << "\n";
 *
 * // Ordered by duration:
 * for (MyEvents::LogEvent const& e : idx.get<Indexing::duration>())
 *     std::cout << getKind(e) << ": " << e << "\n";
 */

std::cout << "\nAll GEAR events ordered by event id:\n";
for (MyEvents::LogEvent const& e : make_iterator_range(idx.equal_range(make_tuple(Kind::Gear))))
    std::cout << getKind(e) << ": " << e << "\n";

std::cout << "\nOnly the SLOPE events with id 10:\n";
for (MyEvents::LogEvent const& e : make_iterator_range(idx.equal_range(make_tuple(Kind::Slope, 10))))
    std::cout << getKind(e) << ": " << e << "\n";

std::cout << "\nEvents with durations in [2s..3s):\n";
auto& by_dur = idx.get<Indexing::duration>();

for (MyEvents::LogEvent const& e : make_iterator_range(by_dur.lower_bound(2), by_dur.upper_bound(3)))
    std::cout << getKind(e) << ": " << e << "\n";

Live On Coliru
#include <boost/fusion/adapted/struct.hpp>
#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/repository/include/qi_seek.hpp>
#include <boost/utility/string_view.hpp>
#include <cstring> // strlen

using It = char const*;

namespace MyEvents {
    enum class Kind { Sequence, Clutch, Gear, Slope, Other };

    struct CommonFields {
        boost::string_view date;
        double duration;
    };

    struct BaseEvent {
        CommonFields common;
        int driver;
        int event_id;
        double vel;
        double km;
        boost::string_view road;
        Kind kind;
    };

    struct OtherEvent {
        CommonFields common;
        std::string message;
    };

    using LogEvent = boost::variant<BaseEvent, OtherEvent>;
    using LogEvents = std::vector<LogEvent>;
}

BOOST_FUSION_ADAPT_STRUCT(MyEvents::CommonFields, date, duration)
BOOST_FUSION_ADAPT_STRUCT(MyEvents::BaseEvent, common, driver, vel, road, km, kind, event_id)
BOOST_FUSION_ADAPT_STRUCT(MyEvents::OtherEvent, common, message)

namespace qi = boost::spirit::qi;

namespace boost { namespace spirit { namespace traits {
    template <typename It>
    struct assign_to_attribute_from_iterators<boost::string_view, It, void> {
        static inline void call(It f, It l, boost::string_view& attr) { attr = boost::string_view { &*f, size_t(std::distance(f,l)) }; }
    };
} } }

namespace QiParsers {
    template <typename It>
    struct LogParser : qi::grammar<It, MyEvents::LogEvents()> {
        using Kind = MyEvents::Kind;

        LogParser() : LogParser::base_type(start) {
            using namespace qi;

            kind.add
                ("SEQUENCE", Kind::Sequence)
                ("CLUTCH", Kind::Clutch)
                ("GEAR", Kind::Gear)
                ("SLOPE", Kind::Slope)
                ;

            common_fields
                = '[' >> raw[
                        repeat(4)[digit] >> '-' >> repeat(3)[alpha] >> '-' >> repeat(2)[digit] >> ' ' >>
                        repeat(2)[digit] >> ':' >> repeat(2)[digit] >> ':' >> repeat(2)[digit] >> '.' >> +digit
                ] >> "]"
                >> " - " >> double_ >> " s";

            base_event
                = common_fields
                >> " => Driver: "  >> int_
                >> " - Speed: "    >> double_
                >> " - Road: "     >> raw[+graph]
                >> " - Km: "       >> double_
                >> " - " >> kind >> ": " >> int_;

            other_event
                = common_fields
                >> " => " >> *~char_("\r\n");

            event
                = (base_event | other_event)
                >> (eol|eoi);

            start = *boost::spirit::repository::qi::seek[event];
        }

      private:
        qi::rule<It, MyEvents::LogEvents()> start;
        qi::rule<It, MyEvents::LogEvent()> event;

        qi::rule<It, MyEvents::CommonFields()> common_fields;
        qi::rule<It, MyEvents::BaseEvent()> base_event;
        qi::rule<It, MyEvents::OtherEvent()> other_event;

        qi::symbols<char, MyEvents::Kind> kind;
    };
}

MyEvents::LogEvents parse_spirit(It b, It e) {
    static QiParsers::LogParser<It> const parser {};

    MyEvents::LogEvents events;
    parse(b, e, parser, events);

    return events;
}

static char input[] = /* see question */;
static const size_t len = strlen(input);

namespace MyEvents { // for debug/demo
    using boost::fusion::operator<<;

    static inline CommonFields const& getCommon(BaseEvent const& be) { return be.common; }
    static inline CommonFields const& getCommon(OtherEvent const& oe) { return oe.common; }
    static inline Kind getKind(BaseEvent const& be) { return be.kind; }
    static inline Kind getKind(OtherEvent const&) { return Kind::Other; }
    static inline int getEventId(BaseEvent const& be) { return be.event_id; }
    static inline int getEventId(OtherEvent const&) { return 0; }

#define IMPL_DISPATCH(name, T)                                                                     \
    struct name##Visitor : boost::static_visitor<T> {                                              \
        template <typename E> T operator()(E const &ev) const { return name(ev); }                 \
    };                                                                                \
    static inline T name(LogEvent const &ev) { return boost::apply_visitor(name##Visitor{}, ev); }

    IMPL_DISPATCH(getCommon, CommonFields const&)
    IMPL_DISPATCH(getKind, Kind)
    IMPL_DISPATCH(getEventId, int)

    static inline std::ostream& operator<<(std::ostream& os, Kind k) {
        switch(k) {
            case Kind::Sequence: return os << "SEQUENCE";
            case Kind::Clutch:   return os << "CLUTCH";
            case Kind::Gear:     return os << "GEAR";
            case Kind::Slope:    return os << "SLOPE";
            case Kind::Other:    return os << "(Other)";
        }
        return os;
    }
}

#include <boost/multi_index_container.hpp>
#include <boost/multi_index/ordered_index.hpp>
#include <boost/multi_index/composite_key.hpp>
#include <boost/multi_index/global_fun.hpp>

namespace Indexing {
    namespace bmi = boost::multi_index;

    using MyEvents::LogEvent;

    double getDuration(LogEvent const& ev) { return getCommon(ev).duration; }

    using Table = bmi::multi_index_container<
        std::reference_wrapper<LogEvent const>, //LogEvent,
        bmi::indexed_by<
            bmi::ordered_non_unique<
                bmi::tag<struct primary>,
                bmi::composite_key<
                    LogEvent,
                    bmi::global_fun<LogEvent const&, MyEvents::Kind, MyEvents::getKind>,
                    bmi::global_fun<LogEvent const&, int,            MyEvents::getEventId>
                >
            >,
            bmi::ordered_non_unique<
                bmi::tag<struct duration>,
                bmi::global_fun<LogEvent const&, double, getDuration>
            >
        >
    >;
}

using boost::make_iterator_range;
using boost::make_tuple;

int main() {
    using MyEvents::LogEvent;
    using MyEvents::Kind;

    auto events = parse_spirit(input, input+len);
    std::cout << "Parsed: " << events.size() << " events\n";

    Indexing::Table idx(events.begin(), events.end());

    /*
     * // To print all events, grouped by by kind and event id:
     * for (MyEvents::LogEvent const& e : idx)
     *     std::cout << getKind(e) << ": " << e << "\n";
     *
     * // Ordered by duration:
     * for (MyEvents::LogEvent const& e : idx.get<Indexing::duration>())
     *     std::cout << getKind(e) << ": " << e << "\n";
     */

    std::cout << "\nAll GEAR events ordered by event id:\n";
    for (MyEvents::LogEvent const& e : make_iterator_range(idx.equal_range(make_tuple(Kind::Gear))))
        std::cout << getKind(e) << ": " << e << "\n";

    std::cout << "\nOnly the SLOPE events with id 10:\n";
    for (MyEvents::LogEvent const& e : make_iterator_range(idx.equal_range(make_tuple(Kind::Slope, 10))))
        std::cout << getKind(e) << ": " << e << "\n";

    std::cout << "\nEvents with durations in [2s..3s):\n";
    auto& by_dur = idx.get<Indexing::duration>();

    for (MyEvents::LogEvent const& e : make_iterator_range(by_dur.lower_bound(2), by_dur.upper_bound(3)))
        std::cout << getKind(e) << ": " << e << "\n";
}

Prints:
Parsed: 37 events

All GEAR events ordered by event id:
GEAR: ((2018-Mar-13 13:14:01.170203 1.79) 0 0 A-11 90 GEAR 0)
GEAR: ((2018-Mar-13 13:14:01.170203 1.79) 0 0 A-11 90 GEAR 0)
GEAR: ((2018-Mar-13 13:14:01.170203 1.79) 0 0.1 A-11 90 GEAR 1)
GEAR: ((2018-Mar-13 13:14:01.170203 1.79) 0 0.1 A-11 90 GEAR 1)
GEAR: ((2018-Mar-13 13:14:03.250451 3.87) 0 1.2 B-302 90.2 GEAR 2)
GEAR: ((2018-Mar-13 13:14:03.250451 3.87) 0 1.2 B-302 90.2 GEAR 2)
GEAR: ((2018-Mar-13 13:14:04.510025 5.13) 0 4.9 B-302 91.1 GEAR 3)

Only the SLOPE events with id 10:
SLOPE: ((2018-Mar-13 13:14:04.300160 4.92) 0 4.2 B-302 90.9 SLOPE 10)
SLOPE: ((2018-Mar-13 13:14:04.300160 4.92) 0 4.2 B-302 90.9 SLOPE 10)

Events with durations in [2s..3s):
SEQUENCE: ((2018-Mar-13 13:14:01.819966 2.44) 0 0.1 A-11 90 SEQUENCE 1)
CLUTCH: ((2018-Mar-13 13:14:01.819966 2.44) 0 0.2 A-11 90 CLUTCH 1)
SEQUENCE: ((2018-Mar-13 13:14:01.819966 2.44) 0 0.1 A-11 90 SEQUENCE 1)
CLUTCH: ((2018-Mar-13 13:14:01.819966 2.44) 0 0.2 A-11 90 CLUTCH 1)
(Other): ((2018-Mar-13 13:14:01.819966 2.54) Backup to regestry)
(Other): ((2018-Mar-13 13:14:01.819966 2.54) Backup to regestry)


text:
Q: bitmap bad quality after set to imageview I am creating a app that opens camera for user and after image captured it will be shows on ImageView! But the image in ImageView has very bad quality
here is the code:
public class Camera extends AppCompatActivity implements View.OnClickListener {

ImageView imgView;
Button camera, setBackground;

Intent i;

int cameraData = 0;

Bitmap bitmap;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.camera);
    initialize();
}

private void initialize() {
    imgView = (ImageView) findViewById(R.id.bPicture);
    camera = (Button) findViewById(R.id.bOpenCamera);
    setBackground = (Button) findViewById(R.id.bSetBackground);

    camera.setOnClickListener(this);
    setBackground.setOnClickListener(this);
}

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if(resultCode == RESULT_OK){
        Bundle extras = data.getExtras();
        bitmap = (Bitmap) extras.get("data");

        Bitmap resizedBmp = Bitmap.createScaledBitmap(bitmap, imgView.getWidth(),imgView.getHeight(), false);
        imgView.setImageBitmap(resizedBmp);
    }
}

@Override
public void onClick(View v) {
    switch(v.getId()){
        case R.id.bOpenCamera:
            i = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
            startActivityForResult(i, cameraData);
            break;
        case R.id.bSetBackground:
            try {
                WallpaperManager wallmngr = WallpaperManager.getInstance(this);
                wallmngr.setBitmap(bitmap);
            } catch (IOException e) {
                e.printStackTrace();
            }
            break;
    }
}

}
what should I do to increase image quality?

A: Use something other than the thumbnail. Quoting the documentation for ACTION_IMAGE_CAPTURE, with emphasis added:

The caller may pass an extra EXTRA_OUTPUT to control where this image will be written. If the EXTRA_OUTPUT is not present, then a small sized image is returned as a Bitmap object in the extra field. This is useful for applications that only need a small image. If the EXTRA_OUTPUT is present, then the full-sized image will be written to the Uri value of EXTRA_OUTPUT.

So, specify a Uri in EXTRA_OUTPUT where a full camera image should be written to. Then, use an image-loading library, like Picasso, to load the photo into your ImageView.
Here is a sample app that demonstrates using EXTRA_OUTPUT.

A: This is how I made it work for me! Assuming you are capturing an image, and would like to show the captured image in a new Activity, you can follow this way:
First on the click of button you can:
 public void cameraFuture(View view) // <-- onClick() method of Camera Button
{
    Intent intent= new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
    File file = new File(Environment.getExternalStorageDirectory(),
            "MyPhoto.jpg");
    outPutfileUri = Uri.fromFile(file);
    intent.putExtra(MediaStore.EXTRA_OUTPUT, outPutfileUri);
    startActivityForResult(intent, TAKE_PIC);
}

Then on the onActivityResult() method, you can do this way:
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    // TODO Auto-generated method stub
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == TAKE_PIC && resultCode==RESULT_OK){
        Toast.makeText(this, outPutfileUri.toString(),Toast.LENGTH_LONG).show();

        Intent bitIntent = new Intent(this, CameraTake.class);
        bitIntent.putExtra("imageUri", outPutfileUri);
        startActivity(bitIntent);
        finish();

    }

}

And in the next Activity, you can receive the file this way:
Intent receiveIntent = getIntent();

    uri = receiveIntent.getParcelableExtra("imageUri");

    if (savedInstanceState == null) {
        Bundle extras = getIntent().getExtras();
        if(extras == null) {
            receiveImg= null;
        } else {
            receiveImg= extras.getString("PASSER");
        }
    } else {
        receiveImg= (String) savedInstanceState.getSerializable("PASSER");
    }

    File imgFile = new  File(Environment.getExternalStorageDirectory(),"MyPhoto.jpg");

    if(imgFile.exists()){

        Bitmap myBitmap = BitmapFactory.decodeFile(imgFile.getAbsolutePath());

        ImageView myImage = (ImageView) findViewById(R.id.camOut);

        myImage.setImageBitmap(myBitmap);

    }


text:
Q: Unable to make API calls using react-native I have a VM running locally that's built using Vagrant. I am able to curl and go to the URL directly from the browser. For some reason, when I make the same call in my react-native app using the fetch API, it keeps giving me the Network request failed error.
Here is a snippet of the code:
fetchData() {

  this.setState({ isLoading: true });

  var baseURL = 'https://192.168.33.33/api/session';

  console.log('URL: >>> ' + baseURL);

  fetch(baseURL)
  .then((response) => response.json())
  .then((responseData) => {
    console.log(responseData);
  })
  .catch(error => {
    console.log(error);
  })
  .done();
}

The baseURL log there returns the right URL and the error looks like so:
URL: >>> http://192.168.33.33/api/session
TypeError: Network request failed {stack: (...), message: "Network request failed"}
  message: "Network request failed"
  stack: (...)
  get stack: function () { [native code] }
  set stack: function () { [native code] }
  __proto__: Error

I thought it might've been an issue with my VM not being accessible somehow by my app, so I went ahead and deployed it to a real server and it still gave the same error.
Any ideas?

A: Found the problem and solved it.
The issue was caused by having self-signed certificate in the API server without a self created CA.
I could try creating my own CA and then create a certificate from that but I went ahead and got a cheap real SSL cert. That solved the issue.

A: I think you might be facing the same origin policy constraint.
There are many ways of workaround it.


text:
Q: calling jquery function with dynamic elements I am working on a chatting application and I am unable to call a jquery function that updates the information about the likes. The code works when the elements to which the call to the function is attached are initially part of the php page that contains the jquery code. When the elements are added dynamicaly the function call doesn't work. Below is the script and the php line from which the function is called.

The element that calls the addLikes function:
echo "<input" ." type='" ."button'" ." title='" .ucwords($str_like) ."'" ." class='" .$str_like ."'" ." onClick='" ."addLikes" ."(" .$uploadedpics['ID'] ."," .$str_like .")'" ."/>" ;

Where $str_like can either be like or unlike(the action).
What could be wrong with calling the function as it is called above?
Any response will be appreciated.

A: The onclick function is not the good way for make that. You can add your data to a data tag.

IE : data-pics = $uploadedpics['ID'] and data-like = $str_like

PHP
echo "<input type='button' title='" .ucwords($str_like) ."'" ." class='yourUniqueClass'" ." data-pics='" .$uploadedpics['ID'] ."' data-like='" .$str_like ."' />" ;

Now you can access on this directly by Jquery. Add a unique ("yourUniqueClass") class name and access on data with jquery click function.
$(document).on("click","yourUniqueClass", function(){
    addLikes( $(this).attr("data-pics"), $(this).attr("data-like") )
})

Jquery

UPDATE
Add you click function into document.ready
$(document).ready(function () {
    $(document).on("click","#buttlike", function(){
        addLikes( $(this).attr("data-pic"), $(this).attr("data-action") )
    })
     function addLikes(ID,action) {
          $('.demo-table #tutorial-'+ID+' li').each(function(index) {
          $(this).addClass('selected');
          $('#tutorial-'+ID+' #rating').val((index+1));
          if(index == $('.demo-table #tutorial-'+ID+' li').index(obj)) {
            return false;
          }
        });
        $.ajax({
          url: "add_likes.php",
          data:'ID='+ID+'&action='+action,
          type: "POST",
          beforeSend: function(){
            $('#tutorial-'+ID+' .btn-likes').html("");
        },
        success: function(data){
          var likes = parseInt($('#likes-'+ID).val());
          switch(action) {
            case "like":
              $('#tutorial-'+ID+' .btn-likes').html('<input type="button" title="Unlike" class="unlike" onClick="addLikes('+ID+',\'unlike\')" />');
              likes = likes+1;
            break;
            case "unlike":
              $('#tutorial-'+ID+' .btn-likes').html('<input type="button" title="Like" class="like"  onClick="addLikes('+ID+',\'like\')" />')
              likes = likes-1;
            break;
          }
          $('#likes-'+ID).val(likes);
          if(likes>0) {
            $('#tutorial-'+ID+' .label-likes').html(likes+" Like(s)");
          } else {
            $('#tutorial-'+ID+' .label-likes').html('');
          }
        }
      });
    }
})

A: You can pass the object as argument. Like:
In PHP :
 $arr = array('id'=>$uploadedpics['ID'], 'str'=>$str_like);
 echo "<input" ." type='" ."button'" ." title='" .ucwords($str_like) ."'" ." class='" .$str_like ."'" ." onClick='addLikes(".json_encode($arr).")'/>" ;

Then in javascript:
 function addLikes(obj) {
    var id = obj.id;
    var str = obj.str;
     //rest of your code.
 }


text:
Q: List method Adding always same values In my Java Project, i want to read values from txt file to List method.Values seems like;
1 kjhjhhkj 788
4 klkkld3 732
89 jksdsdsd 23
Number of row changable. I have tried this codes and getting same values in all indexes.
What can i do?
    String[] dizi = new String[3];

    List<String[]> listOfLists = new ArrayList<String[]>();

    File f = new File("input.txt");

    try {
        Scanner s = new Scanner(f);

        while (s.hasNextLine()) {
            int i = 0;
            while (s.hasNext() && i < 3) {
                dizi[i] = s.next();
                i++;
            }
            listOfLists.add(dizi);
        }
    } catch (FileNotFoundException e) {
        System.out.println("Dosyaya ba?lanmaya çal???l?rken hata olu?tu");
    }
    int q = listOfLists.size();
    for (int z = 0; z < q; z++) {
        for (int k = 0; k < 3; k++) {
            System.out.print(listOfLists.get(z)[k] + " ");
        }
    }

A: String [] dizi = new String [3];

dizi is a global variable getting overridden eveytime in the loop. Thats why you are getting same values at all indexes
 Make a new instance everytime before adding to the list.

A: You put the same reference to the list, create a new array in while loop.
while (s.hasNextLine()){

   String[] dizi = new String[3]; //new array

   int i = 0;
   while (s.hasNext() && i < 3)
   {
       dizi[i] = s.next();
       i++;
   }
   listOfLists.add(dizi);
}


text:
Q: Performance Analysis Of A Function I have to call a function 100000 times in my program . if the argument passed to the function is 4 then it returns 5 if the argument passed is 5 it returns 4. I have the following  two function performing the same task one uses subtraction and other uses division operation .  I need the fastest code. Which one is the better and why .
int function1( int x)
{
   return 9-x;
}

int function2(int x )
{
   return 20/x;
}

A: When you want to know about performance, measure.  I did:
#include <cstdlib>
#include <iostream>

int main(int argc, char* argv[])
{
  int total = 0;
  int rep = atoi(argv[1]);
  for (int ii = 0; ii < rep; ++ii)
  {
    total += function1(4 + ii % 2);
  }

  std::cout << total << '\n';
}

This program alternates passing 4 and 5 to the function, with special care to avoid compile-time optimization of the number of iterations or elision of the entire computation.  Here are the results, computed on a pretty normal Intel x86_64 Linux box using g++ -O3 -g -Wall, valgrind --tool=callgrind, and finally kcachegrind for easy visualization of "Instruction read" counts in main():

*

*9 - x: 345K

*20/ x: 1320K

*x ^ 1: 345K

If you prefer wall times, those are:

*

*9 - x: 0.48s

*20/ x: 4.7s

*x ^ 1: 0.48s

Given all that, stick with the subtraction version.

Finally, a note on what "Instruction read" means in the statistics from valgrind (thanks to "Iwillnotexist Idonotexist" for the comment):

Instruction read is equal to the number of instructions fetched (and executed). This statistic breaks down and gives misleading results precisely around ultra-long instructions like division, and moreover ignores the processor's potential for superscalar execution and pipeline hazards.

A: This depends (or might depend) on many factors:

*

*what is your code supposed to do when you get another argument than 4 or 5

*your machine, compiler, optimisation,...

anyway the easiest way to check which one is more performant is to add a small timer, and perform each of your functions a number of times; like this:
struct timeval t1, t2;
gettimeofday(&t1, NULL);

int i, a;
for (i = 0; i < 100000; i++)
    {
    a += function1(4);
    }

gettimeofday(&t2, NULL);
printf("Time elapsed: %li µs\n", (t2.tv_sec - t1.tv_sec) * 1000000 + t2.tv_usec - t1.tv_usec);

warning if you use code optimization (gcc -O2 or something like that), it might optimize out unused variables. That's why I do: a +=... so the compiler thinks the output is used...

A: Use Bit manipulation.
Sweet and simple
int x=5;
cout<< (x^1);  //output 4

int x=4;
cout<< (x^1);  //output 5

you can check here http://ideone.com/tA1SrI


text:
Q: Input not going through for a chat server app I am in the process of trying to make a chat app in Java for Android, but first I am trying to make one that runs in Eclipse. The app can connect to the server that I have made but for some reason, it won't get past the name input method. This is my first real project, so I am sorry if it is a really simple mistake! Any help is greatly appreciated.
These are the two relevant methods in the App class:
private void run() throws IOException
        {
            Socket socket = new Socket(serverAddress, 59001);
            in = new Scanner(socket.getInputStream());
            out = new PrintWriter(socket.getOutputStream(), true);

            while (in.hasNextLine()) {
                String line = in.nextLine();
                //System.out.println(line);
                if (line.startsWith("SUBMITNAME")) {
                    out.println(getName());
                } else if (line.startsWith("NAMEACCEPTED")) {
                    System.out.println("Chatter - " + line);
                } else if (line.startsWith("MESSAGE")) {
                    System.out.println(line);
                }
            }

        }

and
    private String getName() {

        System.out.println("Choose a screen name:");
        String name = in.nextLine();
        return name;

    }

This is the relevant method in the Server class:
 public void run() {
            try {
                in = new Scanner(socket.getInputStream());
                out = new PrintWriter(socket.getOutputStream(), true);

                // Keep requesting a name until we get a unique one.
                while (true) {
                    out.println("SUBMITNAME");
                    name = in.nextLine();
                    if (name == null) {
                        return;
                    }
                    synchronized (names) {
                        if (!name.isEmpty() && !names.contains(name)) {
                            names.add(name);
                            break;
                        }
                    }
                }

                out.println("NAMEACCEPTED " + name);
                for (PrintWriter writer : writers) {
                    writer.println("MESSAGE " + name + " has joined");
                }
                writers.add(out);

                // Accept messages from this client and broadcast them.
                while (true) {
                    String input = in.nextLine();
                    if (input.toLowerCase().startsWith("/quit")) {
                        return;
                    }
                    for (PrintWriter writer : writers) {
                        writer.println("MESSAGE " + name + ": " + input);
                    }
                }
            } catch (Exception e) {
                System.out.println(e);
            } finally {
                if (out != null) {
                    writers.remove(out);
                }
                if (name != null) {
                    System.out.println(name + " is leaving");
                    names.remove(name);
                    for (PrintWriter writer : writers) {
                        writer.println("MESSAGE " + name + " has left");
                    }
                }
                try { socket.close(); } catch (IOException e) {}
            }
        }
    }
}

and this what I see on the console:
Welcome to the Chat Client. Enter your message or type 'QUIT' to exit.
Choose a screen name:
sfdkgser

fdsd
asd
QUIT

As you can see, nothing happens as I enter new lines.
I expect that afterwards it should say Chatter -, with my message but it doesn't. Any Ideas?

A: You are using the same scanner instance to read the name. This causes the scanner to wait until a new line is received from the socket input stream. If you want to read it from the command line, you should use another instance of scanner that reads from System.in.
Inside method getName add a new variable:
Scanner sc = new Scanner(System.in);

And then use sc to read the name, instead of in.


text:
Q: How to change position to fixed without "jumping" I im trying to set the position to fixed on scoll. I need it to happen without the div underneath has a position.
I created this fiddle of how i would like it to be, but without the div #body is positioned.
http://jsfiddle.net/mortenhauberg/fPTnq/embedded/result/
Is it posible?
I am new to javascript/jQuery!
I hope you understand my poor english!
Morten Hauberg

A: Based on your code, the class not_fixed is applying a position:absolute when the menu is within the scrollable area.  But when the user scrolls the browser viewport outside the viewable area, you have script adding a css class to the
.  Is adds fixed class (which applies a position:fixed).  Remove the not_fixed class, and it will stop breaking the scroll.

MENU

      TEKST

      TEKST

      TEKST

      TEKST

      TEKST

      TEKST

      TEKST

A: As the others have mentioned, your fiddle appears to be doing what you are asking for.  In your comments above it sounds like you might be having trouble with the content below the target element when it goes fixed.  A common problem is that the content below jumps under the target when it goes fixed.
Here is a fiddle that demonstrates a header that goes fixed after some scrolling, and the content below it does not jump up the page.  Also, this demo shows that you can set the header to "unfix" further down the page so it will not go over your footer.
Here is the usage from the demo:
// the limit is optional, but it will make the header move up the
// page again once it reaches the 7th paragraph
$(document).ready(function() {
    $('.header').scrollToFixed( { limit: $($('h2')[7]).offset().top } );
});

Here is a fiddle that demonstrates this: http://jsfiddle.net/ZczEt/2/
Here is the jquery plugin and its source: https://github.com/bigspotteddog/ScrollToFixed


text:
Q: How to add column delimiter to Pandas dataframe display For example, define
df=pd.DataFrame(np.random.randint(0,10,(6,6)))
df

Which gives below display in Jupyter notebook

My question is that is it possible to add a column delimiter to the dataframe like

Thank you for all the answers, currently I use below custom functions
def css_border(x,pos):
        return ["border-left: 1px solid red" if i in pos else "border: 0px" for i, col in enumerate(x)]
def display_df_with_delimiter(df,pos):
    return df.style.apply(partial(css_border,pos=pos), axis=1)

and
display_df_with_delimiter(df,[0,1,2,5])

gives

A: Try with pandas.style.apply(...):
from IPython.core.display import display, HTML

def css_border(x):
    return ["border-left: 1px solid red" if (i%2==0) else "border: 0px" for i, col in enumerate(x)]

html = (
    df.style.apply(css_border, axis=1).render()
)
display(HTML(html))

A: Usually, we do this:
df[[0,1,2,3]]

and it will print columns 0 to 3 - if you want columns 0-1 and 2-3 printed separately:
from IPython.display import display, HTML

CSS = """
.output {
    flex-direction: row;
}
"""

HTML('<style>{}</style>'.format(CSS))

and then call display for dataframe as:
display(df[[0,1]])
display(df[[2,3]])

Let me know if this helps!

UPDATE: Add lines in CSS as follows:

CSS = """
.rendered_html td:nth-last-child(2n) {
    border-right: 1px solid red;
}
"""

It adds red lines for every 2nd column - ofcourse you can edit the number of 'n' here as you like.
Hope this helps!

UPDATE: UPDATE: for every n-value CSS:

def delimit_views(delimiters):
    output = str()
    for delim in delimiters:
       output += ".rendered_html td:nth-child("+str(delim)+") {
       border-left: 1px solid red;}"
    return output

And now append this CSS to the HTML for your display.
Hope it works this time!

A: This piece of code should add the desired lines to the table.
from IPython.display import display, HTML

CSS = """
.rendered_html td:nth-child(even) {
    border-left: 1px solid red;
}
"""

HTML('<style>{}</style>'.format(CSS))

Note that you can change the style of those linse by simply changing the definition of border-left attribute, i.e border-left: 2px solid green to make the lines thicker and green.
Here is a snapshot demonstrating the output.


text:
Q: iMac is warming I've 22 inch iMac. I am using it about 1 year and just noticed that the top back of the screen is very hot as i can't put my hand about half a minute on it.
I've googled some and downloaded istat Pro. Here are the temperatures of my system:

*

*HDD: 56 degree celcius

*CPU: 51 deg.cel.

*GPU Diode: 69 deg.cel.

*GPU Heatsink: 67deg.cel.

*Mem Controller: 57 deg.cel.

*Optical Drive: 50 deg.cel.

*Power supply: 59 deg.cel.

Are these values normal? or something going wrong with my computer?
By the way, i am not sure if there is any relationship but, i ve just upgraded to Mac OS X Lion. is it irrelevant or?

A: Short answer: Those values are okay for a computer that is or has recently been under load.
If you're getting these when it's just sitting idle, something may be wrong. However, if you're getting these while the computer is doing some work (or has recently done some work) these are reasonable. (I have a 22" iMac that I'm comparing yours to)
As for the top of the glass: The (one and only) fan vent is on the back of the computer near the top (where you're putting your hand). It's normal for that area to get very hot, as all the heat the computer generates passes through there. Mine gets hot after a while even if the computer hasn't been working hard.
If you're worried, you can check out the max temperature specs for your components. My iMac has this processor. As you can see under Package Specifications-> Tcase, the maximum temperature it can stand is 72.6* C, comfortably over your CPU's temperature (our models probably have similar maximum temperatures)


text:
Q: Converter class in sub-project not found in main project I'm working on a large project which consists of 10 sub-projects.
We're using Eclipse for development, JBOSS 7 as the app. server. Our projects use JSF 2.1, Spring 3.2, Hibernate 4.2 and Primefaces 3.3 for JSF implementation.
There are 2 "core" projects which other projects references, and these projects are referenced from the other 8 projects, and one project -let's say Project A- (of 8) references another one -let's say Project B-.
Now, the problem is; Project A uses entities of the "core" projects and Project B includes the JSF Converters.
When i try to use an entity in a selectOneMenu, i get "Converter" not found error. (NOTE: Converters are working!)
I added the converter definition to Project B's faces-config.xml, but still get the same error.
How i can use the converters from other Project?
Thanks.
Here is the "getAsObject" Method :  @Override
    public Object getAsObject(FacesContext facesContext,
            UIComponent uIComponent, String value) {
        if (value == null || value.trim().equalsIgnoreCase("")) {
            return null;
        }
        return ManagedBeanLocator.locateSessionController().findByRID("Akademikbirim", value);
    }


text:
Q: Java - Convert RAW to JPG/PNG I have an image captured by a camera, in RAW BGRA format (byte array).
How can I save it to disk, as a JPG/PNG file?
I've tried with ImageIO.write from Java API, but I got error IllegalArgumentException (image = null)
CODE:
try
{
    InputStream input = new ByteArrayInputStream(img);
    BufferedImage bImageFromConvert = ImageIO.read(input);

    String path = "D:/image.jpg";

    ImageIO.write(bImageFromConvert, "jpg", new File(path));
}
catch(Exception ex)
{
    System.out.println(ex.toString());
}

Note that "img" is the RAW byte array, and that is NOT null.

A: The problem is that ImageIO.read does not support raw RGB (or BGRA in your case) pixels. It expects a file format, like BMP, PNG or JPEG, etc.
In your code above, this causes bImageFromConvert to become null, and this is the reason for the error you see.
If you have a byte array in BGRA format, try this:
// You need to know width/height of the image
int width = ...;
int height = ...;

int samplesPerPixel = 4;
int[] bandOffsets = {2, 1, 0, 3}; // BGRA order

byte[] bgraPixelData = new byte[width * height * samplesPerPixel];

DataBuffer buffer = new DataBufferByte(bgraPixelData, bgraPixelData.length);
WritableRaster raster = Raster.createInterleavedRaster(buffer, width, height, samplesPerPixel * width, samplesPerPixel, bandOffsets, null);

ColorModel colorModel = new ComponentColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB), true, false, Transparency.TRANSLUCENT, DataBuffer.TYPE_BYTE);

BufferedImage image = new BufferedImage(colorModel, raster, colorModel.isAlphaPremultiplied(), null);

System.out.println("image: " + image); // Should print: image: BufferedImage@<hash>: type = 0 ...

ImageIO.write(image, "PNG", new File(path));

Note that JPEG is not a good format for storing images with alpha channel. While it is possible, most software will not display it properly. So I suggest using PNG instead.
Alternatively, you could remove the alpha channel, and use JPEG.

A: With Matlab you can convert all types of images with 2 lines of code:
img=imread('example.CR2');
imwrite(img,'example.JPG');


text:
Q: How to release memory of vector of CvMat pointers? I created a vector of CvMat pointer as follows:
vector<CvMat*> items;
for(int i = 0;i<5;i++){
  CvMat* mat = cvCreateMat(5,1,CV_32FC1);
  // assign values to mat
  items.push_back(mat);
}

And then I tried to release memory as follows:
for(int i = 0;i<5;i++){
  cvReleaseMat(&items[i]);
}
vector<CvMat*>().swap(items);

However, I don't see that affected the memory usage in Task Manager.
Any ideas for me?
Thanks in advance...

A: The memory is not returned to the system.
In most runtime environments memory allocated to an application from the operating system remains in the application, and is seldom returned back to the operating system. Freeing a memory block allows you to reuse the block from within the application, but does not free it to the operating system to make it available to other applications.
UPD:
So anyway Task Manager can't be reliable tool for controlling memory allocations and deallocations. If you want to guarantee that your application does not have memory leaks you may want to use such tools as valgrind (if you are on Linux), or drMemory from google, or several others (google for "memory leak detection"). In this case you will have the most precise information about allocations, deallocations, leaks, memory access violations etc.