 to music, but not at the same time! * Feels that EVERYONE has a'story' to tell- it's up to the reporter to discover what that is! * Favorite places to visit - Door County, Wisconsin- Rondo, Spain, and Telluride, Colorado! * Enjoys working outside in her yard and walking her dog! * Couldn't put Twist & Shout out every month- without the help of Nick Manwarren- graphic artist, extraordinaire!!!!
phone: 515-576-0250 250
October 4, 2010
September 17, 2010
September 2, 2010
August 4, 2010
July 7, 2010
May 3, 2010
March 10, 2010
January 27, 2010
September 5, 2009
August 28, 2009
August 5, 2009
July 26, 2009
July 22, 2009
July 19, 2009
July 7, 2009
June 24, 2009
June 19, 2009
June 18, 2009
June 15, 2009
June 11, 2009
723 Central Ave Fort Dodge, Fort Dodge, IA 50501 | 515-576-0250
© 2014. All rights reserved.| Terms of Service and Privacy PolicyQ: How to use find_first_not_of with a vector of string? Let's say I have the following object:
vector<string> data = {"12","12","12","12","13","14","15", "15", "15", "15", "18"};

I'm trying to find the first non-repeating entry in the data object.
For example, data.find_first_not_of(data.at(0)); this would work if data is of string type only (no container).
How can I achieve the same thing with an object of type vector.
I looked at adjacent_find and find_if_not from the algorithm library, but to no avail.
Your suggestions are much appreciated.

A: What problem did you have with adjacent_find?  You should be able to use that with an inverse predicate:
std::vector<std::string> data = {"12","12","12","12","13","14","15", "15", "15", "15", "18"};

// Sort data here if necessary

auto itr = std::adjacent_find(data.cbegin(), data.cend(), std::not_equal_to<std::string>{});
if (itr!= data.cend()) {
    std::cout << "First mismatch: " << *itr << " " << *std::next(itr) << std::endl;
} else {
    std::cout << "All elements equal" << std::endl;
} 

Wandbox

A: Since you have to go through the list at least once, and you don't know when or where you will encounter the duplicate of a number (if there is one), one way to solve this is to first gather "statistics" and then from what you've gathered you can determine the first non-duplicate.
Here is an example using std::unordered_map:
#include <algorithm>
#include <unordered_map>
#include <iostream>
#include <vector>
#include <string>

// struct to hold some information on the numbers
struct info
{
    std::string number;
    int count;
    int position;
    info(const std::string n, int c, int p) : number(n), count(c), position(p) {}
};

int main()
{

    std::vector<std::string> data = {"12","12","12","12","13","14","15", "15", "15", "15", "18"};
    std::unordered_map<std::string, info> infoMap;
    std::vector<info> vInfo;
    int pos = 0;

    // loop for each data element
    std::for_each(data.begin(), data.end(), [&](const std::string& n) 
    { 
        // insert entry into the map
        auto pr = infoMap.insert(std::make_pair(n, info(n, 0, pos)));    

        // bump up the count for this entry.
        ++pr.first->second.count;

        // bump up the postion number
        ++pos;

    });

    // create a vector of the information with a count of 1 item.
    std::for_each(infoMap.begin(), infoMap.end(), [&](std::unordered_map<std::string, info>::value_type& vt) { if (vt.second.count == 1) vInfo.push_back(vt.second); });

    // sort this by position
    std::sort(vInfo.begin(), vInfo.end(), [&](const info& pr1, const info &pr2){return pr1.position < pr2.position; });

   // output the results
    if ( vInfo.empty() )
        std::cout << "All values are duplicated\n";
    else  
        std::cout << "The first number that isn't repeated is " << vInfo.front().number << "\n";
    }

Live Example
First, we just simply go through all the entries in the vector and just tally up the count for each item.  In addition, we store the position in the original list of where the item was found.  
After that we filter out the ones with a count of exactly 1 and copy them to a vector.  We then sort this vector based on the position they were found in the original list.
Based in Sydney Street, Brighton.
Based in George Street, Brighton.
Based in Western Road, Brighton.
Based in North Street, Brighton.
Based in Kensington Gardens, Brighton.
Based in High Street, Rottingdean.
Based in Oxford Street, Brighton.
Based in Church Street, Brighton.
Map showing location of charity shops in Brighton.Palace Malice now has seven winners from his first crop, third-most among all Freshman Sires, after Addilyn scored a two-length victory in a seven-furlong maiden special weight race for 2-year-old fillies Aug. 11 at Gulfstream Park.
The filly's win comes just two days after the Three Chimneys stallion got his first stakes winner with Talkin Malice in the Prairie Meadows Juvenile.
Facing just three opponents, Addilyn was three wide down the backstretch and around the turn before moving to the front outside the quarter pole. Though she raced somewhat greenly in the stretch, she came home a comfortable winner.
Addilyn was bred in Kentucky by Dixiana Farms LLC. She is the second foal out of Moon Philly, a four-time stakes winner of $354,979.Objective: Sacrococcygeal teratoma (SCT) is the most common congenital tumor of the newborn. About 20% of SCTs are malignant. We report the case of a dizygotic twin with a large immature SCT who was successfully delivered by cesarean section at 34 weeks’ gestation and who underwent surgical removal of the tumor. Case Report: A 21-year-old, gravida 2, para 0, abortus 1, woman was referred to ChungShan Medical University (CSMU) Hospital at 33 weeks' gestation because of the diagnosis of a twin pregnancy with SCT in one twin. There were no remarkable findings by ultrasound examination during the second trimester. At 30 weeks of gestation, a sacral mass measuring 8.4 cm in diameter and with multi-cystic and solid components attached to the coccyx was identified sonographically. The patient was referred to CSMU Hospital and underwent planned cesarean section at 34 weeks of gestation. The sick twin was delivered smoothly and underwent surgical resection of the tumor at 1 week of age after magnetic resonance imaging studies. Immature SCT with free surgical margins was confirmed by pathologic examination. The infant did well postoperatively. Conclusion: SCT diagnosed before birth can be managed by planned abdominal delivery and postnatal surgery. Patients with immature teratomas should be followed-up long-term for recurrence and distant metastases.<gh_stars>0
﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reactive.Linq;
using System.Reactive.Subjects;
using System.Text;
using System.Threading;
using EasingFunction = System.Func<double, float>;
using Debug = XamLib.Diagnostics.Debug;

namespace ReactiveTween
{
    /// <summary>
    /// TweenerのBuilderとして。
    /// </summary>
    public class Tween
    {
        #region Static Members.
        private static readonly Lazy<IObservable<long>> everyFrame = new Lazy<IObservable<long>>(() => Observable.Interval(TimeSpan.FromMilliseconds(1000.0 / FrameRate))   // create a cold observable
                                                                                                               .Publish().RefCount());// only pulse while subscribers are connected);
        #endregion Static Members.

        #region Properties.
        public static int FrameRate { get; set; } = 20;
        internal static IObservable<long> EveryFrame => every