text:
Syria army quits base on strategic Aleppo road
(Reuters) – The Syrian army abandoned its last base near the northern town of Saraqeb after a fierce assault by rebels, further isolating the strategically important second city Aleppo from the capital.
But in a political setback to forces battling to topple President Bashar al-Assad, the United Nations said the rebels appeared to have committed a war crime after seizing the base.
The opposition Syrian Observatory for Human Rights said on Friday government troops had retreated from a post northwest of Saraqeb, leaving the town and surrounding areas "completely outside the control of regime forces".
It was not immediately possible to verify the reported army withdrawal. Authorities restrict journalists' access in Syria and state media made no reference to Saraqeb.
The pullout followed coordinated rebel attacks on Thursday against three military posts around Saraqeb, 50 km (30 miles) southwest of Aleppo, in which 28 soldiers were killed.
Several were shown in video footage being shot after they had surrendered.
"The allegations are that these were soldiers who were no longer combatants. And therefore, at this point it looks very likely that this is a war crime, another one," U.N. human rights spokesman Rupert Colville said in Geneva.
"Unfortunately this could be just the latest in a string of documented summary executions by opposition factions as well as by government forces and groups affiliated with them, such as the shabbiha (pro-government militia)," he said.
Video footage of the killings showed rebels berating the captured men, calling them "Assad's dogs", before firing round after round into their bodies as they lay on the ground.
Rights groups and the United Nations say rebels and forces loyal to President Bashar al-Assad have committed war crimes during the 19-month-old conflict. It began with protests against Assad and has spiraled into a civil war which has killed 32,000 people and threatens to drag in regional powers.
The mainly Sunni Muslim rebels are supported by Sunni states including Saudi Arabia, Qatar and neighboring Turkey. Shi'ite Iran remains the strongest regional supporter of Assad, who is from the Alawite faith which is an offshoot of Shi'ite Islam.
Strategic blow
Saraqeb lies at the meeting point of Syria's main north-south highway, linking Aleppo with Damascus, and another road connecting Aleppo to the Mediterranean port of Latakia.
With areas of rural Aleppo and border crossings to Turkey already under rebel control, the loss of Saraqeb would leave Aleppo city further cut off from Assad's Damascus powerbase.
Any convoys using the highways from Damascus or the Mediterranean city of Latakia would be vulnerable to rebel attack. This would force the army to use smaller rural roads or send supplies on a dangerous route from Al-Raqqa in the east, according to the Observatory's director, Rami Abdelrahman.
In response to the rebels' territorial gains, Assad has stepped up air strikes against opposition strongholds, launching some of the heaviest raids so far against working class suburbs east of Damascus over the last week.
The bloodshed has continued unabated despite an attempted ceasefire, proposed by join U.N.-Arab League envoy Lakhdar Brahimi to mark last month's Muslim holiday of Eid al-Adha.
In the latest in a string of fruitless international initiatives, China called on Thursday for a phased, region-by-region ceasefire and the setting up of a transitional governing body – an idea which opposition leaders hope to flesh out at a meeting in Qatar next week.
Veteran opposition leader Riad Seif has proposed a structure bringing together the rebel Free Syrian Army, regional military councils and other rebel forces alongside local civilian bodies and prominent opposition figures.
His plan, called the Syrian National Initiative, calls for four bodies to be established: the Initiative Body, including political groups, local councils, national figures and rebel forces; a Supreme Military Council; a Judicial Committee and a transitional government made up of technocrats.
The initiative has the support of Washington. U.S. Secretary of State Hillary Clinton called on Wednesday for an overhaul of the opposition, saying it was time to move beyond the troubled Syrian National Council.
The SNC has failed to win recognition as the legitimate representative of the Syrian people and Clinton said it was time to bring in "those on the front lines fighting and dying".
Egypt's Sheikh Zayed City residents protest Sawiris project
Adventures by Disney organizes guided trips to Egypt in 2020
Aya Fouad first ever female Egyptian CrossFitter to go global
Ramez Galal's latest prank show might be suspended
Egypt to partner with CNN for tourism promotion free of stereotypes
Qatar rejects issuing 'visas for enemies', namely Egyptians
Egypt warns Turkey against starting drilling activities off Cyprus
Video: Mohamed Salah wins new award in Liverpool FC
Conflicting news about Jennifer Lopez's concert in Egypt's North Coast
Egypt receives third hi-tech German Submarine
Egypt seeks global partnerships to implement national AI strategy: Minister
Fans post picture of Mo Salah, Messi shaking hands ahead of Champions League game
Tags Aleppo Free Syrian Army syria war crimes
All rights reserved, Al-Masry Al-Youm. 2019


When it comes to luxury brand management in the Caribbean, guest loyalty and guest satisfaction is important. Loyal customers always come back, spend more money, and spread good word of mouth.
There's an oft quoted rule in the luxury hotel segment and it's the 20/80 rule, meaning that 80% of a resort's business will come back from the 20% of its loyal customers. Looking for ways to create customer loyalty is key, and customer satisfaction is often thought of as the most important thing in creating customer loyalty. But, guest satisfaction won't necessarily keep people coming back time and time again. There's a second factor that needs to be looked at.
Switching costs can be both negative and positive. For the guest a negative switching cost might be lack of alternatives or monetary. Positive switching costs may be something like a loyalty program or amenities that can't be found elsewhere. There are many different kinds of switching costs that need to be examined when determining how to create more loyalty and they'll be specific to your target markets.
If the switching cost of changing from one hotel to another in your competitive set is very low, then the switch may occur. If the cost is very high, you're more likely to create a loyal customer. Therefore, when thinking about creating your 20% base, you should not only take customer satisfaction into account, but also switching costs as they both have a direct impact on customer loyalty.
Need help creating a loyal guest base? Get in touch here or at hello@coralrange.com.


Our culture is alive and has created a flourishing learning environment with growth and development opportunities available to everybody.
Eveready is dominant in a number of sectors in the South African battery market. According to AC Nielsen, it has 80 per cent of the market for zinc chloride batteries, while market share in other sectors is growing. The zinc chloride batteries are manufactured in Port Elizabeth, which is a modern factory with machines and technologies capable of producing 600 parts per minute.
For Eveready, the future lies in optimizing quality, cost, service, and delivery. Ongoing research and development, as well as the refining of the manufacturing process mean that there is continuous improvement of the dry cell batteries being produced in Port Elizabeth. However, increased competition from low-quality, but cheaper imports and the need to expand into new markets mean that the company has had to evolve from being purely a manufacturer to one which has control over the full value chain. Eveready is focusing on new core competencies in the area of distribution and the marketing of fast moving consumer goods (FMCG) in order to identify and develop new markets for its manufactured products. Given the entrepreneurial nature of the company, one can also expect that it will launch new forms of portable power as this technology becomes more reliable and affordable.
Price is a big issue for Eveready and one which neatly demonstrates the company's fresh approach to business. Its response to rising input costs has been to see these as an opportunity to improve its own systems. The sales force is being trained to provide retail support, in addition to taking orders. "Our strength will lie in the services we offer in addition to the product. That is what will make Eveready unique in the market," says MD of the company, Avijit Das.
The market is still skewed towards zinc chloride batteries but is clearly shifting towards Alkaline batteries. This change in the market is being driven by the change in consumer shopping habits, change in devices and location of major retail outlets, to name a few. Zinc chloride batteries are still a large contributor by volume, but Alkaline is the larger contributor by value. Eveready owns 99% of the total Layer cell (formerly known as PM9, PP9, PM10, and PP10) market in SA. Total Eveready (Zinc chloride, Layer Cells and Alkaline) is still by far the market leader. In Zinc chloride category, round cells, D size is marginally ahead by value while AA is marginally ahead by volume.
On the other hand, AA/R6 Alkaline is the largest seller followed by AAA/R03. According to AC Nielsen, the AA size batteries contribute the highest in sales by both volume and value. When comparing Zinc chloride and Alkaline volume sales, it can clearly be seen how devices influence sales. In the more "sophisticated" Alkaline market, AA & AAA are the drivers and contribute 89% to the total whereas in the Zinc chloride market, which is driven by flashlights, torches and radios, the AA & D size contribute 82% to the total.


text:
Home People C.J. Mahaney
C.J. Mahaney
Haunted by old lawsuit, C.J. Mahaney withdraws from Together for the Gospel confab
"The former head of a Reformed, charismatic evangelical ministry is backing out of a biennial preaching conference he helped found, citing renewed controversy over a sexual abuse scandal involving his former church." Baptist News Global
Read more about Haunted by old lawsuit, C.J. Mahaney withdraws from Together for the Gospel confab
Controversial preacher returning to T4G stage
"After two years of low profile amid questions about his handling of allegations of child sexual abuse, C.J. Mahaney is back on the program for the 2016 Together for the Gospel confab"
Read more about Controversial preacher returning to T4G stage
"Mahaney rejects claims that he withheld information from authorities or that he tried to protect child predators"
By SharperIron
CJ Mahaney Publicly Addresses Sovereign Grace Allegations for First Time in Two Years
Read more about "Mahaney rejects claims that he withheld information from authorities or that he tried to protect child predators"
C.J. Mahaney to resign as president of Sovereign Grace Ministries (SGM)
By sifilings
Sovereign Grace Ministries
Read more about C.J. Mahaney to resign as president of Sovereign Grace Ministries (SGM)
C.J. Mahaney reinstated at Sovereign Grace
"I deeply regret where my mistakes, leadership deficiencies, and sins contributed to the relational conflicts detailed in these reports. And I am truly grateful for your support throughout this trying time." Worldmag.com
Read more about C.J. Mahaney reinstated at Sovereign Grace
"Strip away all of the commentary and whining, and you are left with a picture of a pastor who is running an organization, and some associates who feel slighted."
My thoughts on the CJ fiasco
Read more about "Strip away all of the commentary and whining, and you are left with a picture of a pastor who is running an organization, and some associates who feel slighted."
"Over the last few years some former pastors and leaders in Sovereign Grace have made charges against me ..."
C.J. Mahaney: "Why I'm Taking a Leave of Absence"
Read more about "Over the last few years some former pastors and leaders in Sovereign Grace have made charges against me ..."

redpajama_set_name: RedPajamaCommonCrawl


text:
#import "ComAppersonlabsSincerelyWindowProxy.h"
#import "TiBase.h"
#import "TiApp.h"
#import "TiHost.h"
#import "TiUtils.h"

@implementation ComAppersonlabsSincerelyWindowProxy

- (void)open:(id)args
{
    NSArray* images = [self valueForUndefinedKey:@"images"];
    NSString* applicationKey = [TiUtils stringValue:[self valueForUndefinedKey:@"applicationKey"]];

    NSMutableArray *newImages = [[NSMutableArray alloc] init];
    NSLog(@"images:  %@ and applicationKey: %@", images, applicationKey);

    for(id imageThing in images) {
        TiBlob *blob = nil;
        UIImage* img = nil;

        // determine what was passed as "file"
        if ([imageThing isKindOfClass:[TiFile class]])
        {
            // NSLog(@"*** FILE IS CLASS TiFile");
            blob = [(TiFile *)imageThing toBlob:nil];
        }
        else if ([imageThing isKindOfClass:[TiBlob class]])
        {
            // NSLog(@"*** FILE IS CLASS TiBlob");
            blob = imageThing;
        }
        else if ([imageThing isKindOfClass:[NSString class]])
        {
            NSURL *url_ = [TiUtils toURL:[TiUtils stringValue:imageThing] proxy:self];
            if (url_.isFileURL)
            {
                blob = [[TiBlob alloc] initWithImage:[UIImage imageWithContentsOfFile:url_.path]];
            } else {
                blob = [[TiBlob alloc] initWithImage:[[UIImage alloc] initWithData:[NSData dataWithContentsOfURL:url_]]];

            }
        }
        else
        {
            if ([self _hasListeners:@"error"]) {
                [self fireEvent:@"error" withObject:@{
                                                      @"message": @"invalid image type"
                                                    }];
            }

            NSLog(@"File must be of type String, TiBlob, or Ti.Filesystem.File (detected: %@)",[imageThing class]);

            return;
        }

        // check for a blob or path to use
        if(blob.image != nil)
        {
            img = blob.image;
        }
        else
        {
            NSLog(@"Could not find the file %@", blob.path);
            [self fireEvent:@"error" withObject:@{
                                                  @"message": @"image not found"
                                                  }];
            return;
        }

        [newImages addObject:img];

        RELEASE_TO_NIL(img);
        RELEASE_TO_NIL(blob);
    }

    sincerelyController = [[[SYSincerelyController alloc]
                            initWithImages:newImages
                            product:SYProductTypePostcard
                            applicationKey:applicationKey
                            delegate:self] autorelease];

    if([self valueForUndefinedKey:@"profilePhoto"]) {
        id imageThing = [self valueForUndefinedKey:@"profilePhoto"];

        TiBlob *blob = nil;
        UIImage* img = nil;

        // determine what was passed as "file"
        if ([imageThing isKindOfClass:[TiFile class]])
        {
            // NSLog(@"*** FILE IS CLASS TiFile");
            blob = [(TiFile *)imageThing toBlob:nil];
        }
        else if ([imageThing isKindOfClass:[TiBlob class]])
        {
            // NSLog(@"*** FILE IS CLASS TiBlob");
            blob = imageThing;
        }
        else if ([imageThing isKindOfClass:[NSString class]])
        {
            NSURL *url_ = [TiUtils toURL:[TiUtils stringValue:imageThing] proxy:self];
            if (url_.isFileURL)
            {
                blob = [[TiBlob alloc] initWithImage:[UIImage imageWithContentsOfFile:url_.path]];
            } else {
                blob = [[TiBlob alloc] initWithImage:[[UIImage alloc] initWithData:[NSData dataWithContentsOfURL:url_]]];

            }
        }
        else
        {
            if ([self _hasListeners:@"error"]) {
                [self fireEvent:@"error" withObject:@{
                                                      @"message": @"invalid image type"
                                                      }];
            }

            NSLog(@"profilePhoto must be of type String, TiBlob, or Ti.Filesystem.File (detected: %@)",[imageThing class]);

            return;
        }

        sincerelyController.profilePhoto = blob.image;

        RELEASE_TO_NIL(img);
        RELEASE_TO_NIL(blob);
        RELEASE_TO_NIL(imageThing);

    }

    if([self valueForUndefinedKey:@"recipients"]) {
        sincerelyController.recipients = [self valueForUndefinedKey:@"recipients"];
    }
    if([self valueForUndefinedKey:@"message"]) {
        sincerelyController.recipients = [self valueForUndefinedKey:@"message"];
    }
    if([self valueForUndefinedKey:@"shouldSkipPersonalize"]) {
        sincerelyController.recipients = [self valueForUndefinedKey:@"shouldSkipPersonalize"];
    }
    if([self valueForUndefinedKey:@"shouldSkipCrop"]) {
        sincerelyController.recipients = [self valueForUndefinedKey:@"shouldSkipCrop"];
    }

    // prevent more than one JS thread from showing an alert box at a time
    if ([NSThread isMainThread]==NO) {
        [self rememberSelf];

        // alert show should block the JS thread like the browser
        TiThreadPerformOnMainThread(^{[self open:args];}, YES);
    } else {

        [[[TiApp app] controller] presentViewController:sincerelyController animated:YES completion:nil];

    }
}

- (void)sincerelyControllerDidFinish:(SYSincerelyController *)controller {

    if ([self _hasListeners:@"finished"]) {
        [self fireEvent:@"finished"];
    }

    /*
     * Here I know that the user made a purchase and I can do something with it
     */

    [controller dismissViewControllerAnimated:YES completion:NULL];
}

- (void)sincerelyControllerDidCancel:(SYSincerelyController *)controller {

    if ([self _hasListeners:@"canceled"]) {
        [self fireEvent:@"canceled"];
    }

    /*
     * Here I know that the user hit the cancel button and they want to leave the Sincerely controller
     */

    [controller dismissViewControllerAnimated:YES completion:NULL];
}

- (void)sincerelyControllerDidFailInitiationWithError:(NSError *)error {

    if ([self _hasListeners:@"error"]) {
        [self fireEvent:@"error" withObject:@{
                                              @"message": error.localizedDescription
                                              }];
    }

    /*
     * Here I know that incorrect inputs were given to initWithImages:product:applicationKey:delegate;
     */

    NSLog(@"Error: %@", error);
}
@end

redpajama_set_name: RedPajamaGithub


text:
April 9, 2018 – 60 Second Marketer Jamie Turner, Co Culture Testing Chris Dyer, and New Risk John Wessinger
09 Apr April 9, 2018 – 60 Second Marketer Jamie Turner, Co Culture Testing Chris Dyer, and New Risk John Wessinger
Jamie Turner – Internationally Recognized Author, Network TV News Contributor, Speaker, and CEO of SIXTY
Jamie Turner
Jamie Turner is an internationally recognized author, speaker and TV news contributor who has helped The Coca-Cola Company, AT&T, CNN and other global brands tackle complex business problems. He is the CEO of SIXTY, a marketing consultancy and advisory firm that has worked with The Coca-Cola Company, Holiday Inn, SAP and others. He is also the CEO of 60SecondMarketer.com a business blog that is read by hundreds of thousands of people around the globe. Jamie is a regular guest on CNN and HLN on the topics of business, digital media and leadership. He is the co-author of Go Mobile, which was the #1 best-selling mobile marketing book on Amazon when it was first released, and How to Make Money with Social Media, which is now in its second edition. Jamie has been profiled in the world's best-selling marketing textbook and is an internationally recognized keynote speaker at trade shows, events and corporations around the globe.
Chris Dyer – Entrepreneur ("CEO-PeopleG2") + "C-Level Culture Consultant", Author, Radio Host, and SCRUM Master
Chris Dyer is the Founder and CEO of PeopleG2, a background check and intelligence firm based in California. He is the host of TalentTalk on OC Talk Radio and iHeartRadio, an in-demand speaker on company culture, remote workforces, and employee engagement, and a frequent contributor to Forbes, Inc, HR.com, the Society for Human Resource Management, and many more. Chris believes that impersonal, automated background check solutions have no value in the global talent management spectrum, especially as it relates to strategically significant individuals and teams. This is why he built a company with innovative services which mitigate risk and maximize best fits – whether for a prospective candidate, a promotion candidate or even entire executive teams. Chris believes that people drive the business forward so being armed with the best intelligence while making people-related decisions is just good business. He developed PeopleG2 to support a wide mix of clients—including employers/human resources departments, executive leadership teams, business investors, corporate restructuring, merger-and-acquisition architects and even property owners—as they deal with key people-related decisions such as hiring new executives, restructuring around key executives, acquiring a company, or working with a new supplier, customer or partner.
John Wessinger – Founder at LATERALUS Solutions, Marketing and Sales Strategist, and Author of Ride the Wave: Journey From The Inside Out
John Wessinger
John Wessinger founded LATERALUS in July of 2014 and built from his 15 years of experience working in the healthcare and retail industries. He has helped to build market leaders and contributed to the success of billion-dollar brands within global organizations. John can solve complex business challenges and relieve pain points within organizations as a marketing and sales strategist. He works with business leaders and collaborates with sales and marketing teams to design initiatives that challenge the status quo and the way companies do business.
60 Second Marketer, Chris Dyer, Co Culture Testing, Jamie Turner, John Wessinger, New Risk
April 6, 2018 – LoyaltyPlant Vas Diachenko and Third (and now Fourth!) Generation Danny Govberg
April 11, 2018 – Do Good Anne Bahr Thompson and Women are Revolutionizing TV Joy Press


One of the most outstanding hockey players never to have played in the National Hockey League, Soviet superstar Valeri Kharlamov was an internationally-acclaimed forward whose exceptional skills garnered much of the hockey spotlight during the legendary Summit Series against Canada in 1972.
Valeri Borisovich Kharlamov was born in Moscow, USSR on January 14, 1948. His hockey talent was recognized as a youngster, and by the age of fourteen, he was admitted to the Children and Youth Sports School of the CSKA Hockey Club. Closely monitored, Valeri was just twenty when he joined the Soviet Union's national team.
In 1968-69, the impressive forward scored 37 goals in 42 games for CSKA Moscow of the Soviet Elite League. The next season, he fired 33 markers in 33 games.in the Russia. By 1971, Kharlamov led the league in goals with 40 and earned all-star recognition. To no one's surprise, Kharlamov was selected to represent his country at the 1972 Olympic Winter Games in Sapporo, Japan. On February 13, the Soviet Union defeated Czechoslovakia 5-2 to capture the gold medal. The USSR failed to lose during the tournament, winning four and tying one during the five-game series. Kharlamov led the Olympics in scoring, collecting 9 goals and 6 assists during those five games. Returning to his league team, Valeri won the scoring championship with 40 points and was awarded the most valuable player honour.
During September, an eight-game series was created that would, for the first time, pit the Soviets best against Canada's best. Any previous meeting between the two hockey powers had the finest USSR players facing the best amateur Canadian players, but in the Summit Series, NHL players were permitted to play.
The series was intense, and the first four games, all played in Canada, left the Canadians reeling. What most pundits believed was going to be a rout in favour of the Canadians saw the Soviets win Game One by a 7-3 romp, Canada top the USSR 4-1 in Game Two, the two squads tying 4-4 in Game Three and the Soviets edge Canada 5-3 in Game Four.
The teams played the next four games in Moscow, and the Soviets won Game 5 by a 5-4 score. Canada rebounded with a 3-2 win in Game Six, and 4-3 in Game Seven in a game that Kharlamov missed due to injury. Valeri returned nursing a cracked bone in his ankle, but in what many consider the most important game in Canadian hockey history, Canada pulled out a 6-5 victory in the eighth and deciding game. In spite of being checked closely, missing a game and playing the final game with a broken ankle, Kharlamov finished the series with 3 goals and 4 assists, his 7 points fifth best in the tournament.
Having been noticed by NHL scouts, several teams tried to secure Valeri's talent, but at that time, Soviet players were unable to leave the country to play in North America.
Staying with CSKA, Kharlamov won a second straight MVP award with a 32-point season. During his thirteen seasons with CSKA, beginning in 1967-68 and concluding in 1980-81, Valeri Kharlamov scored 273 goals, added 196 assists and totalled 469 points in 401 games. During that time, he was selected as an all-star seven times.
During that period, Valeri continued to represent his count at the World Championships. The Soviet Union took the gold medal in 1973, 1974, 1975 and 1976, led by the superb Kharlamov. He was named an all-star at the World Championships in 1972, 1973, 1975 and 1976, and during the latter tournament, was also named the best forward.
At the 1976 Winter Olympics in Innsbruck, Austria, the Soviet Union again won the gold medal, defeating Czechoslovakia 4-3 in the deciding contest on February 14. Kharlamov once again starred for the USSR, scoring 3 goals and 9 points in five games.
In 1998, Valeri Kharlamov was recognized on the Internationasl Ice Hockey Federation's Wall of Honour. In 2005, he was posthumously inducted into the Hockey Hall of Fame. His son, Alexander, accepted the honour on behalf of his father. "I want to say 'thank you' for selecting my father into the Hockey Hall of Fame. It's a big day for me. Thank you for remembering my father."
Kharlamov is commemorated in several other manners. The Kontinental Hockey League has a Kharlamov division and the best Russian player in the NHL, as selected by all Russian players, is presented with the Kharlamov Trophy. Young Russian stars revere the memory of the explosive star. Ilya Kovalchuk of the Atlanta Thrashers wears Kharlamov's number 17, while the Pittsburgh Penguins' Evgeni Malkin wears number 71, the reverse of Kharlamov's legendary number, in honour of the late star from his homeland.
"I remember Valeri as a remarkable man with a strong personality," stated teammate Vladislav Tretiak. "Whenever he came out on the ice, his opponents never knew what he was going to do the next moment. Everything he did looked so easy, so elegant. There'll never be a hockey player who could match his achievements. People like (Valeri) Kharlamov are born once in a century."
Kevin Shea is the Editor of Publications and Online Features at the Hockey Hall of Fame.


text:
HTIL to spin off, list Hong Kong, Macau businesses on 8 May
Dow Jones Newswires reports that Hutchison Telecommunications International Ltd (HTIL) has announced that it will spin off and list its Hong Kong and Macau operations on 8 May 2009. The Hong Kong-based group said that it will not raise any new funds from the spinoff, whilst the Hong Kong unit plans to pay an interim dividend of HKD0.01 per share to its shareholders this year. The plan is aimed at providing HTIL's parent Hutchison Whampoa with a new platform for capital-raising. The group offers mobile services in Hong Kong under the 3 brand name via Hutchison Telephone Company, and operates fixed line and broadband services through another subsidiary, Hutchison Global Communications. Its Macau mobile business, Hutchison Telephone (Macau), is held by the same holding company as its Hong Kong assets.
Hong Kong, CK Hutchison, Hutchison Telecommunications International Ltd (HTIL), Hutchison Telephone Company (3), Corporate/Financial


text:
Q: How to join two half in RxJs I have a stream like this
---ab---ab---a---ba---bab---ab---ab---ab--->

And I want this.
---ab---ab------ab----ab-ab-ab---ab---ab--->

The point is, that I have data with beginning and end (JSON) and sometimes the data is cut in the half in the stream, and I want to join them again. How can I do that?

A: Looks like a job for the scan operator
// substitute appropriate real-world logic
const isProperlyFormed = (x) => x === 'ab'
const isIncomplete = (x) => x[0] === 'a' && x.length === 1
const startsWithEnding = (x) => x[0] === 'b'
const getCorrected = (buffer, x) => buffer.prev + x[0]
const getTail = (buffer, x) => x.slice(1)

const initialBuffer = {
  emit: [],
  prev: null
}

const result = source
  .scan((buffer, x) => {
    if (isProperlyFormed(x)) {
      buffer = {emit: [x], prev:null}
    }
    if (isIncomplete(x)) {
      buffer = {emit: [], prev:x}
    }
    if (startsWithEnding(x)) {
      const corrected = getCorrected(buffer, x)
      const tail = getTail(buffer, x)
      if (isProperlyFormed(tail)) {
        buffer = {emit: [corrected, tail], prev: null}
      } else {
        buffer = {emit: [corrected], prev: tail}
      }
    }
    return buffer
  }, initialBuffer)
  .flatMap(x => x.emit)

Working CodePen
Edit
Looking at the test input stream, I think a case is missing, which will break the above.
I changed the test from
---ab---ab---a---ba---bab---ab---ab---ab--->

to
---ab---ab---a---ba---bab---aba---b---ab--->

and also slimmed down the algorithm
const getNextBuffer = (x) => {
  const items = x.split(/(ab)/g).filter(y => y)  // get valid items plus tail
  return {
    emit: items.filter(x => x === 'ab'),    // emit valid items
    save: items.filter(x => x !== 'ab')[0]  // save tail
  }
}

const initialBuffer = {
  emit: [],
  save: null
}

const result = source
  .scan((buffer, item) => {
    const bufferAndItem = (buffer.save ? buffer.save : '') + item
    return getNextBuffer(bufferAndItem)
  }, initialBuffer)
  .flatMap(x => x.emit)

Working example CodePen

A: First split the stream into full responses and partial. Then check if response is full. Full responses are good as such. Partial responses need to be synchronized, so we split their stream into first and second halves and just zip those streams together.
The strange looking Rx.Observable.of(g.partition(x => x[0] === 'a')) is because partition operator returns pair of observables, which cannot be chained.

const testStream = Rx.Observable.of('a1', 'a2', '_ab', 'b1', 'a3', 'b2', '_ab', 'a4', 'b3', '_ab', 'b4', 'a5', 'b5', '_ab')

testStream
  .groupBy(x => (x[0] === '_' && 'full') || 'partial')
  .mergeMap(g =>
    Rx.Observable.if(
      () => g.key == 'full',
      g,
      Rx.Observable.of(g.partition(x => x[0] === 'a'))
        .mergeMap(([as, bs]) => Rx.Observable.zip(as, bs))
    )
  )
  .do(x => console.log(x))
  .subscribe()
<script src="https://cdnjs.cloudflare.com/ajax/libs/rxjs/5.4.3/Rx.min.js"></script>

A: This is how I solved:
import Rx from 'rxjs/Rx';
import {last} from 'lodash';

const data$ = Rx.Observable.of('ab','ab','a','ba','bab','aba','b','ab');
const line$ = data$.flatMap(data => {
    const lines = data.match(/[^b]+b?|b/g); // https://stackoverflow.com/a/36465144/598280 https://stackoverflow.com/a/25221523/598280
    return Rx.Observable.from(lines);
});

const isComplete$ = line$.scan((acc, value) => {
    const isLineEndingLast = last(acc.value) === 'b';
    const id = isLineEndingLast ? acc.id + 1 : acc.id;
    const complete = last(value) === 'b';
    return {value, id, complete};
}, {value: 'b', id: 0, complete: true});

const grouped$ = isComplete$
    .groupBy(data => data.id, data => data, group => group.first(data => data.complete))
    .flatMap(group => group.reduce((acc, data) => acc + data.value, ''));

grouped$.subscribe(console.log);

redpajama_set_name: RedPajamaStackExchange


text:
Ben Nelson's betrayal
By Jill Stanek
Published December 23, 2009 at 12:00am
I received this question from a friend on Facebook:
So, Jill, what happened with Nelson? You and other pro-life leaders were advising people to be "calm" and to thank him, and all indications now are that he prostituted his vote like so many others. How do you know who to trust?
My friend was speaking about a blog post I wrote Dec. 11 encouraging pro-lifers to maintain support of Sen. Ben Nelson, D-Neb. In that post I relayed an e-mail received from Democrats for Life's president, Kristen Day, assuring everyone Nelson was unwavering in his refusal to vote for any health-care bill excluding a Stupak-like pro-life amendment:
Dear pro-life Friends,
Senator Nelson has been a strong leader on our behalf. … I have been assured that he has not changed his opinion and has not gone back on anything he has said. Senator Nelson has taken a very hard line with the Caucus, and they are trying hard to appease him because they need his vote.
I assure you that the senator has not backed down from his commitment, and I urge all comments directed to his office be words of appreciation and support rather than words of suspect and conjecture.
If we are going to spend time contacting an office, I think we should spend our energy on Senator Casey. …
Again, Senator Nelson has not changed his position. Please issue only words of support and encouragement. Senator Casey needs to change his position. Please contact him and urge him to follow Senator Nelson's lead.
My response to my friend?
Ultimately, all pro-lifers have when dealing with politicians are relationships, promises and legislative history.
Human beings are fallible, and Nelson's duplicity was just another reminder our only hope is Jesus.
Up to the end Nelson was working with all the right people – Democrats for Life, Nebraska Right to Life, the U.S. Conference of Catholic Bishops, pro-life Michigan Rep. Bart Stupak.
But in the end, Nelson betrayed them all.
I feel particularly bad for Kristen, who already had a tough row to hoe as defender of pro-life Democrat legislators. Nelson's defection coupled with Casey's really set Democrats for Life back.
Nelson's betrayal of the U.S. Conference of Catholic Bishops tied as the biggest shock to me. Nelson is a Methodist, and perhaps the last-minute e-mail complaint by one of his pro-abort church leaders reoriented him (or pre-assuaged his guilt), but his disrespect of this very important spokes body for the Catholic Church on the health-care issue surprised me.
The other tie as biggest shock was Nelson's betrayal of Stupak. It was only last Friday morning that Stupak felt confident enough in his working relationship with Nelson on the life issue in health care to report:
Stupak told ABC News he has been in touch with Sen. Nelson.
"They are holding tough and they are asking me, 'Is the House holding tough?'" Stupak said. "Our members are holding, so we will not pass if they are putting anything but a version of our language. …"
Nelson's office did not return calls seeking comment, but his counterparts say they will not back down anytime soon.
"This isn't an argument on merit. This is more an argument on their pride," Rep. Stupak said of his Democratic colleagues who opposed his amendment. "They chose this fight and lost."
Finally, Nelson betrayed his own state's pro-life leadership, Nebraska Right to Life, and its parent group, the National Right to Life Committee. NERTL President Julie Schmit-Albin was the activist many news outlets reported Nelson called before giving the green light to his compromise. She reported in a Sunday statement following the Senate's passage by a 60-40 vote, including Nelson's:
Sen. Nelson and his chief of staff, Tim Becker, called me last night at 7:30 p.m. CST as a matter of "courtesy," to let me know he was pitching alternative language to Democratic leadership. We spoke for about 40 minutes. ...
When I asked them at the outset of the conversation to include NRLC in the call, they declined and said that they were going with the language.
Sen. Nelson claimed their newly drafted concepts/language was Stupak-plus and that it would pass pro-life muster. When I countered that we had no assurance of that because we were not allowed to review the language, I was reminded that this was merely a courtesy call, not a call for our input or approval.
There is no pro-life Nebraskan more devastated by Sen. Nelson's actions than myself. I have defended his record to Nebraskans and believed he would stand on pro-life principles as he has on numerous occasions in the past. …
According to the Associated Press on Dec. 21, following his vote, "Nelson was slammed by former allies opposed to abortion. He tells people he feels like he's been bitten by the family dog."
That dog would be pro-lifers, which is such an insult.
Actually, Ben Nelson is more like the family dog that inexplicably turned on and killed the family baby.
Jill Stanek
Jill Stanek fought to stop "live-birth abortion" after witnessing one as a registered nurse at Christ Hospital in Oak Lawn, Ill. In 2002, President Bush asked Jill to attend his signing of the Born Alive Infants Protection Act. In January 2003, World Magazine named Jill one of the 30 most prominent pro-life leaders of the past 30 years. To learn more, visit Jill's blog, Pro-life Pulse.
NYC's bill targeting pregnancy centers: DOA
Planned Parenthood's unplanned pro-life advocate
MTV abortion special: Happy for the kill
The surprising anti-slavery story of 4 beloved carols
Pelosi's sorest loser


There exists generally a good number of Lucienne 1-Light Outdoor Hanging Lantern By Gracie Oaks in the marketplace. Several of these goods are available on-line. Picking the items includes the ones from sizes, styles, and colors. You may find you could find the right Lucienne 1-Light Outdoor Hanging Lantern By Gracie Oaks to your scenario by incorporating useful tips.
I am very happy with my purchase of the Lucienne 1-Light Outdoor Hanging Lantern By Gracie Oaks. It was delivered quickly. It took about an hour to put the Outdoor Lighting together by myself.
Lucienne 1-Light Outdoor Hanging Lantern By Gracie Oaks.. Fast delivery!