It's day 18 of the A to Z Challenge 2013 and today's letter is "R". My book today is Rekindled Flames by Stephanie Hurt.
Please don't forget to add your comment at the bottom of this post because part of the challenge is to increase all blog comments, thanks in advance.
He haunts her dreams; She torments his nights!


text:
Q: ember js, how can i use the array in the controllers from the routes Hi I am new to ember and I want to use deal with some data in a array fetched from my server side. But I do not know how to do that. The below code is in routes.
searchList: null,

model: function() {

  // This is so that we don't refresh it all the time
  // arguably, this is a hack.
  var searchList = this.get('searchList');

  if(searchList !== null) {
    return searchList;
  }

  var self = this;
  return Ember.$.ajax({
    url: 'http://coen268.peterbergstrom.com/timezones.php',
    dataType: 'jsonp'
  }).then(function(response) {
    var cities = [];  <-----------------------this is an array of names from server side
    if (response && response.length) {
      for(var i=0; i<response.length; i++) {
        cities.push(Ember.Object.create(response[i]));
      }
    }
    /*
    cities.sort(function(a, b) {
        return a.id - b.id
    })
    */
    self.set('searchList', cities);
    return cities;

I just want to use the cities var in my controller so that I can do something like sort, add and reorganize the output to final view html.
Many thanks!

A: If your route is called, say App.CitiesRoute, then you need to declare your CitiesController like this:
App.CitiesController = Ember.ArrayController.extend({});

You can then use sorting with simple Controller properties, or filtering when calling filter() on this (which refers to your ArrayController), as shown on Ember's Guides,
You also have access to all functions and properties of ArrayController, as shown in the Ember API documentation.
You can even specify a specific Controller for a every item of your array by specifying the itemControllerproperty in your ArrayController, like:
App.CitiesController = Ember.ArrayController.extend({
  itemController: 'city'
});

// Here you can specify an ObjectController linked to all your items in the cities array

App.CityController = Ember.ObjectController.extend({

  cityNameLowercase: function() {
    return this.get('cityName').toLowerCase();
  }.property('cityName')
});

which will be bound to each city of your array.

redpajama_set_name: RedPajamaStackExchange


Purple G50 globe string light white wire set that is 100 feet long and perfect for outdoor patios, decks, special event or Halloween lighting. Each set includes 125 round bulbs on a white wire stringer with 100 sockets that are spaced 12" apart. These Purple G50 light strings have long lasting 3000 hour bulbs and are on a 18 gauge white wire. All our g50 light strings use patented Admiral Brand sockets. These durable and heavy duty light strings will provide you with years of maintenance free use. Each Set includes 25 replacement bulbs.


text:
Zara Home's integration into Zara starts in the UK
Inditex announced the news as it presented its latest financial results on 13 March. For the first time in its history, the Spanish group was presenting its Zara results together with Zara Home.
"The long-term goal is to consider Zara Home as a fourth section of Zara," former Inditex chairman Pablo Isla announced then. His words heralded a new era, with Zara Home not only becoming part of Zara for accounting purposes but also launching homeware products in the clothing brand's stores.
Zara has announced the launch of Zara Home on its UK website - Zara.com
The move was both strategic and logic, motivated by the brands' "growing synergies,'' explained Pablo Isla in March. As part of the change, Zara Home will continue to trade from its own ecommerce website and 603 physical stores (including 524 owned shops and 79 franchises), whilst simultaneously launching select product lines and homeware items in some Zara stores, joining the existing Woman, Man, TRF and Kids collections. The strategy has already been rolled out in a number of Zara flagship stores in London, Saint Petersburg and Madrid.
Zara Home's first online debut on Zara.com will take place in the UK market on 17 September, according to the brand's website. This will see the group's largest chain add a selection of home accessories and fragrances to its online offering, with prices remaining in line with those from Zara Home. Inditex is accelerating its efforts in the homeware market, following in the footsteps of rivals H&M, Primark and URBN (which owns brands including Urban Outfitters and Anthropologie), all of which have firmly established themselves in the homeware and lifestyle categories.
To celebrate the launch, Zara has opened an installation at Shoreditch Electric Light Station in London, where it will present its new Autumn Winter collection alongside a pop-up coffee shop hosted by Rochelle Canteen. Opening on Friday 13 September until Sunday 15 September, the event will take place on the evening before the range launches on Zara.com.
Zara Home's Autumn Winter collection is based on the principles of "less is more" - Fabien Baron / Zara
Inditex founded Zara Home more than 16 years ago, and in October it overhauled its leadership team with the departure of Eva Cardenas, who was replaced by Lorena Mosquera. According to the latest available accounts, sales at the chain reached 383 million euros in 2017, whilst Inditex racked up total revenues of 7.91 billion euros during the same period. In 2018, the Spanish retailer incorporated Zara Home into the Zara brand, revealing combined net sales of 18 billion euros.
This is the latest development in a series of changes at Zara Home. In recent times, the homeware chain has branched out into a new category with the launch of Zara Home Business, a service that provides styling solutions for companies. The brand has also recently added kitchenware to its offering, including pieces designed in-house and from various collaborations. The new proposition is presented under 'Selected Brands', which brings together items from Italian company Smeg, Belgian kitchen and cookware brand Berghoff and cutlery specialist Arcos. Finally, Zara Home has teamed up with global publisher Phaidon to publish a series of cookbooks.
Inditex appoints executive team to lead sustainability transformation
Inditex upbeat as sales and margins continue relentless rise
Zara launches accessories customisation service
Loewe pulls outfit accused of resembling Nazi concentration camp uniform
Sustainability, Bottega Veneta and Meghan Markle are 2019's fashion stars says Lyst
Old Navy spin-off in doubt after Gap's Peck departs - analysts
Bershka unveils eco-friendly collaboration with National Geographic
Britons seek Xmas gifts from trusted names, global shoppers will buy from UK - survey
Zara ups sustainability commitment with CFDA/Vogue Fashion Fund collab
Zara cso Buenos Aires
Zara r Rivoli

redpajama_set_name: RedPajamaCommonCrawl


Shoe trees and racks help you organise your footwear for easy identification so you can reach for a pair quickly. Place a shoe bench in a hall or entryway to provide a place to sit, put on your shoes�... Building A Simple Shoe Rack Youtube How To Build A Shed Addition 12x12 Wood Shed Plans free plans for firewood sheds Diy Tool Shadowing Shed Dormer Garage Apartment Plans Be careful about any underground cables or wires or pipes or drains or water sources.
Building A Simple Shoe Rack Free Land Us Building A Simple Shoe Rack Free Land Appraisals building.a.simple.shoe.rack 810 Shepherd Street Nw Washington Dc Free Plans To Make Semi Auto Holsters Storage Building Laws In addition, you for you to evaluate development area as well as the surrounding geography.... Once your shoes are stored in your new rack, you'll be able to find the pair of shoes you want to wear without any trouble [source: Good Housekeeping]. Here's how to make a simple wooden shoe rack. Here's how to make a simple wooden shoe rack.
Best 25+ shoe racks ideas on pinterest. Find and save ideas about Shoe racks on Pinterest. See more ideas about Diy shoe organizer, Shoe racks for closets and Lazy susan shoe rack. "simple homemade shoe rack guide for those looking for what and how to store their precious shoes, not just an ordinary furniture, it�s a vital part of the house" how to make text smaller in tumblr text post Building A Simple Shoe Rack Free Land Us Building A Simple Shoe Rack Free Land Appraisals building.a.simple.shoe.rack 810 Shepherd Street Nw Washington Dc Free Plans To Make Semi Auto Holsters Storage Building Laws In addition, you for you to evaluate development area as well as the surrounding geography.
10 Smart Ways to Keep Shoes Tidy. Make quick work of a hard-to-shake clutter problem. By Lauren Piro. Feb 6, 2015 Heart Work Organizing. Make quick work of a hard-to-shake clutter problem. View how to make mobile stand at home Building A Simple Shoe Rack Youtube Free Shred It Events Ct Plans For Small Shotgun Houses storage shed plans 14 x 30 Plan For School Bus Waiting Shed Soundproof Generator Shed Plans This 1 other important aspect which in order to offer be seriously considered.
Nothing beat the feeling when people praise your homemade shoe rack when they visit, your family member, your friend, even old acquaintances. Shoe rack is not only a simple place to store your shoes now, in this day; shoe rack is one of the most important furniture in the house.
maikomori.com-Simple Homemade Shoe Rack Guide That Can Yourself... Those are the thoughts of simple homemade shoe rack guide that you can make yourself designs.
Simple design provides diy shoe storage rack under and seating on top, perfect for a mud room. Place Your Shoes In Pallet Storage Crates Paint some ordinary wood crates and mount them on the wall to create colorful diy shoe storage .
This wooden shoe rack has ample space to store the shoes of your whole family. This cabinet makes a great addition to any entryway. You can even use the tops of the cabinets as small tables to store your books or small plants.


Researchers of the University of the Basque Country (Spain) have for the first time created model of live organisms and their evolution by means of the quantum computer. Article with results of work is published in the Scientific Reports magazine. For creation of model scientists have used the chip for quantum calculations of IBM ibmqx4. Each organism was described by two types of qubits, one of which represented his genotype, and another — a phenotype. The genotype described type of an organism and was transferred from generation to generation. The phenotype was defined by two factors, genetic information and interaction between an organism and Wednesday. Eventually the phenotype of a concrete organism "grew old" that meant gradual loss of information coding it. Organism life time partly was defined by a genotype. Each organism was a replicator, that is was capable to replicate. Either the genotype, or phenotype became квантово tangled with empty qubit in which the population mean of initial qubit was copied. The empty qubit then turned into a genotype of an organism of the next generation. The new genotype, in turn, also contacted empty qubit where the organism phenotype registers. During replication there could be mistakes which made changes to a genotype. As a result numerous quantum organisms which interacted with each other and also with the environment through the phenotypes have been created. Mutations were brought under a certain law by means of the quantum gates transforming entrance conditions of qubits. According to scientists, results of experiments corresponded to earlier developed theoretical model. In the future it will allow to create more difficult quantum models which evolution can't be predicted classically that will give an impetus to development of a quantum biomimetika, quantum machine learning and quantum artificial intelligence. It is more than important news in Film of Day Telegram-channel. Subscribe!


text:
Greg Joffe
Greg leads many of Nous' most important business and digital strategy, public policy, service design, operating model, organisation design and efficiency projects. He works with financial services, health and utilities private sector clients; and with government agencies in transport, human services, health, justice, utilities, and industry trade and investment. From 2014-2017 Greg was an adjunct associate professor at the Australian Graduate School of Management at the University of New South Wales (UNSW); where he teaches and publishes research on organisation structure and broader organisation alignment.
Led scenario planning and organisation design projects to support AustralianSuper's growth; and led strategy work for other superannuation funds, investment houses and financial institutions
Led strategy projects for a major bank; including division strategy, alignment of business banking and wealth, and high-net-worth and ultra high-net-worth operating model
Developed a world-leading model to compare different approaches to reducing homelessness; worked with Housing NSW to deliver a meta-analysis of homelessness programs; and worked with a consortium comparing the societal costs of homelessness
Led successful turnaround strategy and operating model projects for companies owned by a highly successful private equity firm in healthcare and leisure, resulting in 30-40% improvements in profitability over the following years.
Prior to Nous Greg was a consultant at McKinsey & Company, an options trader with O'Connor Securities at the London Stock Exchange and Toro Petroleum in Monaco, head of strategy at Austrade for six years, and a lawyer at Freehills.
Greg has a Bachelor of Arts (Honours in Economics) and Master of Arts (International Policy Studies) from Stanford University, and a Bachelor of Laws from UNSW. From 2014-2017 he was an adjunct associate professor at the Australian Graduate School of Management, UNSW; where he continues to teach a class to the full-time Masters of Business Administration students.
Greg is a member of the board of My Foundations Youth Housing, a community housing provider focused on young people.
Greg enjoys ancient history, particularly The History of Rome podcasts; Mary Beard's The New York Review of Books articles; trying to surf; and driving his children to soccer and tennis.
Associated insights
NousCast | Season 2:Episode 2
Driving Change: How regulators can improve performance by measuring impact


Lloyd and Cowan are working with a 100% small animal practice that has recently gone into new ownership. The practice is on the North Hampshire / Surrey border area and youwill join a team of 4 full time and 3 part time vets who are all very experienced. They are committed to providing high quality patient and client care and work closely as a team to ensure the smooth running and growth of all three surgeries.
Working here is always fulfilling with no two days ever being the same. Our team is kind, enthusiastic and driven to do the best for our clients and patients.
The benefits package includes: 5 weeks holiday, One afternoon off a week, One in 10 weekends + one night per week on duty until 11pm. There will be support and training from experience colleagues, Car and accommodation as part of package if required,CPD encouraged and funded.
Ideally someone with a surgical bias.


text:
Place Making Plan
Of the five development sites in the city centre identified in the Launch Document we have selected for comment the two most relevant to our members' concerns, SB1, the Cattle Market site, and SB3, Manvers Street. In both cases we have used the council's Core Strategy Document (Policy B2) and Place Making Plan Launch Document as a frame of reference.
CATTLE MARKET SITE
1. This is a transitional site which acts as a bridge between the commercial heart of the city and the Walcot Street area of residential streets and small, independent enterprises including pubs and restaurants and many craft and home related service businesses. Development of Site would provide an opportunity to establish a more effective link between these areas reducing the current relative isolation of Walcot Street and improving pedestrian flow to and from the city centre. Development of the site should emphasize mixed uses with residential uses predominating but with a continuous commercial frontage on Walcot Street combining small and medium sized units. While there could be a case for replacing the Hilton Hotel on the site in general large or multi-occupancy uses should be avoided.
2. Building massing should reflect the character of the surrounding area with building heights limited to four levels above Walcot Street grade.
3. Traffic congestion on Walcot Street already ranges from moderate to severe throughout the day. Any mix of uses for Site SB1 should aim to reduce to a minimum the need for on-site parking and any temptation to continue to use this area as a parking resource for the city centre as a whole should be avoided.
4. Public access to the riverside must be protected. There could be a case for extending the riverside walkway north from Pulteney Bridge but if further extension to Beehive Yard and beyond proves impractical, as seems likely, then a suitable destination for pedestrians should be provided within the site. This could, for example, take the form of a riverside park with moorings and a pedestrian bridge across the river to St Johns Road could also be considered.
5. Any development of the site needs to incorporate a satisfactory role for the Corn Market building which has been in a derelict and unsightly condition for too long. Considering the numerous failed attempts to identify a future for this important building an agreement under Section 106 of the Town and Country Planning Act 1971 covering a larger area of the site may need to be considered.
MANVERS STREET SITE
6. The Manvers Street site has two principal characteristics. The northern part of the site, currently mainly a car park with adjoining police station, has external linkages mainly to hotel and residential development to the north (South Parade) and west (Manvers Street), with some supporting commercial frontages but only limited links to the city's retail core to the west. With its two churches and mosque the emphasis here should be on residential development with commercial uses limited to supporting retail and services and the opportunity should be taken to provide a more appropriate setting for St John's church. Building massing should reflect the height of buildings on South Parade and Manvers Street
7. Bounded by the river and the railway the southern part of the site has limited external linkages and is dominated by the Royal Mail sorting office and some commercial office development. Larger industrial and commercial uses would be suitable here and there is an opportunity to create a pedestrian link to the station from the north.
Meeting with Julie Girling MEP
We and CARA approached Julie Girling MEP to set up a meeting to share our concern about the high levels of pollution in Bath which are damaging the health of people who live and work here and are damaging the historic buildings which are at the centre of the city's economic prosperity.
We approached Julie as a member of the European Parliament with known concern with environmental issues.
BANEs, in common with many others, appear to have be in breach of European directives on this issue but appear to be doing little to remedy their breach. The EU appears to be accepting this situation far too easily.
BANES has a notional plan for addressing the issue of air pollution but appear to do little more than monitor pollution levels, expand the area under management and move the dates on all other action back another year.
The meeting took place on the 6th September and Ms Girling has undertake to put forward the Parliamentary Question to the Commission with regard to the air quality in Bath and to have a further meeting with us to plan future actions.
The OPA planning Appeal
In July 2010 OPA applied for retrospective planning permission for change of use from restaurant to mixed use as a restaurant, bar and nightclub. This was refused.
Since this decision OPA has continued to operate as a nightclub in defiance of the committee's decision.
Finally a Development Control Committee meeting in June this year decided on enforcement action and B&NES sent out the appropriate notice telling OPA to stop operating as a nightclub within 21 days from 7 August.
OPA has appealed against this order and a Planning Inspector has been appointed to hear the appeal. TARA has made the following representation to the inspector.
This part of the city centre is primarily residential. The block on which OPA is located bounded by North and South Parades and Duke Street is entirely residential containing 65 apartments in 7 apartment buildings as well as ASE (Advanced Studies in England) a residential hostel for foreign students which has operated on North Parade above the subject premises since the late 1980's although we understand that due to the disturbance created by the nightclub ASI has had to suspend the use of rooms in the hostel.
These premises cause significant harm and distress to local residents by reason of high levels of noise and disturbance. For some time, and on many occasions, local residents and local businesses have complained about the noise created by OPA's operation. The noise complained of derives from extensive noise leakage from OPA's premises and noise created by, often rowdy and intoxicated, revellers entering and leaving the building and gathering outside on the pavement to smoke.
It is perhaps useful in this context to quote the Planning Policy Guidance:
"Commercial developments such as fast food restaurants, discos, night-clubs and public houses pose particular difficulties, not least because associated activities are often at their peak in the evening and late at night. Local planning authorities will wish to bear in mind not only the noise that is generated within the premises but also the attendant problems of noise that may be made by customers in the vicinity. The disturbance that can be caused by traffic and associated car parking should not be underestimated"
OPA has effectively become a nightclub by stealth. The premises were operated as a restaurant between 1983 and 2007 without adversely affecting the amenity of local residents and this is the appropriate use for these premises.
If the appeal is granted a precedent will be set for other bars and restaurants elsewhere in the city centre to flout planning regulations, and turn themselves into nightclubs. This is not fair to the majority of businesses who play by the rules and show respect for the planning regulations.
TARA has no objection to OPA operating as a traditional well managed restaurant similar to many others in residential areas of the city centre. Our objection is to OPA as a restaurant/bar and nightclub.
This appeal if granted threatens the delicate balance which exists between businesses and residents in this small and primarily residential corner of our city.


A gathering of brilliant musicians that are passionate about their own craft and can cleverly experiment with contemporary music and the good old folk songs, the Gold Coast Folk Music Festival is another affair to remember and not to miss.
To be staged at Country Paradise in Nerang on 20 to 21 September, this spectacular musical event will again bring together the most talented artists to perform two free days of folk, bluegrass and blues, and roots music. This festival will feature a massive line-up of 20 bands.
The Gold Coast Folk Music Festival has also been an impressive platform to accommodate promising local artists and promote the relevance and the beauty of folk music even as some of musical subcultures began to emerge in the scene.
Set on three stages of nonstop music in a rural hinterland setting, fans can expect stellar performances from bands including Australian Idol's Wes Carr, singer-songwriter John Schumann of the classic folk and political music group Redgum, Round Mountain Girls, HAt Fitz and Cara, The Company, Quatro, Out of Abingdon, Owl VAlley Bluegrass and Balyana.
The fun and entertainment don't stop there. Audience can also enjoy comedy acts by Coolgrass and circus performances by Louise Moriaty. A Have a Go Circus will also be something for kids to enjoy during this exciting festival.
Aside from the shows, you can also enjoy a festive mood around. The two-day event will feature great food, markets, and bar.
Our Gold Coast Family Apartments is only a short distance away from the festival venue so you can also enjoy a fun weekend on Gold Coast. Surfers Tradewinds Holiday Apartments will be a perfect choice of holiday accommodation for you and your family or friends for this event.


text:
Fewer kids playing high school football as interest drops, health worries rise
What does this mean for the future of the game?
Aug. 24, 2018, 5:00 PM UTC / Source: TODAY
By Meghan Holohan
When Justin Kelley was a freshman, he tried out for the Park View High School football team in Sterling, Virginia. He'd been playing football since he was 6, but was surprised to learn that at 14, he started as the varsity team's center.
"No one was experienced enough to give him competition for that spot," his mom Cyndi Kelley told TODAY. "He was able to hold his own, but he wasn't very effective in his position as center with someone who was a lot bigger."
The team went 0 and 10 last year, but still Justin hoped to play this year. That is until Park View High School announced it was canceling its varsity football season.
"He was a little disappointed initially. After hearing the reasoning why, he very much understood," Kelley explained. "He is very excited about the J.V. program and very excited to be part of the rebuild of the program."
The reason for the scrapped varsity season? Only 18 students wanted to play and the Virginia High School League recommends that teams play with 25. Too few players makes it dangerous.
"When you consider safety, there was no other choice. It wouldn't be fair of feasible. We want sports to be an enhancing experience and not a cause for injury," Wayde Byard, spokesman for Loudoun County Public Schools, told TODAY.
The reasons why fewer students are playing football aren't entirely straightforward.Getty Images
But it's not just Park View High that had to cancel its varsity football season. High schools across the country are sitting out this football season because of lack of participation. Since 2007, the National Federation of State High School Associations (NFHS) has observed waning interest in football.
While football remains the most popular among high school boys, the number of participants declined for the second year in a row, according to a report released Friday. In 2017, there was a 2 percent drop in football participants, slightly less than the 2.5 percent decrease in the 2015 to 2016 season. Since the 2009-2010 season, the numbers of students playing football decreased by 7 percent.
High school football participation numbers dropping amid health concerns
Aug. 24, 201803:55
While stories of scrapped football seasons are becoming more common, the NFHS reports only a small number of schools, 20, scuttled their programs before the 2017 season — from 14,099 to 14,079.
"There are a variety of factors that contributed to that," Bob Colgate, director of sports and sports medicine at NFHS, told TODAY. "Sometimes sports participation goes up. Sometimes it goes down."
Lower interest in football
The reasons why fewer students are playing football aren't entirely straightforward.
"The male students we have are not interested in playing football. I don't think it is any big problem with the football program," Steve Kilian, the athletic director at Wood Memorial High School in Oakland City, Indiana, which axed its varsity football season, told TODAY.
Only 13 boys showed up for football, but 17 boys tried out for soccer at Wood Memorial. Kilian and others believe the increased interest in soccer and lacrosse, both of which can be played year-round, is one of several reasons students are less interested in football.
"Kids are specializing in sports much earlier," Jeff Nash, spokesman for the Chapel Hill-Carrboro City Schools in North Carolina, told TODAY. One district high school, Chapel Hill High School, canceled its season. "They don't play three sports."
Are parents taking the fun out of youth sports? Megyn Kelly TODAY panel discusses
At Chapel Hill High School, students play sports that have travel teams and clinics that allow them to play throughout the year. They think playing soccer or volleyball all year will make them better athletes and gives them an advantage for college athletics. Football season generally lasts from August to November with few off-season opportunities.
"Any other sport, whether you are on a school team or club team or private lessons, you are doing it year-round," Nash said. "If you are on a basketball team and you are halfway decent and the other players are going to summer camps, you can't stop and play football."
Concussions and football.
Chronic traumatic encephalopathy (CTE) has emerged as a major concern for professional and college football players, but the school districts say that rarely comes up.
"I have not had any parents talk about concussions," Kilian said.
Nash agreed: "It's not a concussion thing."
Colgate said concussion and injury garners loads of attention, but he thinks it's just one of a variety of reasons for decreased interest.
"The one thing I get asked all the time is, 'Is it concussion?' That is one element," he said.
Don't let your kids play these 6 sports, 'Concussion' doctor warns
Don't let your kids play these 6 sports, 'Concussion' doctor warnsDon't let your kids play these 6 sports, 'Concussion' doctor warns
Kelley believes some parents worry unnecessarily about concussions. She said CTE was a problem 20 or 30 years ago because coaches and doctors didn't understand how to prevent it. Now, she sees coaches protecting players by teaching them not to lead with their heads and making them go through rigorous concussion protocols.
"While that is unfortunate that CTE has happened, that has led coaches and doctors to research what happened to make the game safer today," she said.
But Dr. Bennet Omalu, a forensic pathologist who discovered CTE, strongly recommends children under 18 skip contact sports, such as football, because it presents grave danger.
New treatment could help relieve symptoms of concussions as they happen
"We wouldn't give a child a cigarette to smoke because a cigarette is potentially harmful. But we would put on a helmet of the head of a child and send him out on a field to play a game whereby he sustains repeated blows to his head, to suffer sub-concussion and concussion," Omalu told TODAY in 2017. "We need to develop more brain-friendly, healthier type of sports."
While the high schools that canceled football mourn the loss of their Friday night lights, they all plan on rebuilding.
"We enjoyed having football. The community wants to have football," Kilian said. "We have postponed the season and hopefully maybe we can get it going again."


text:
package com.amazonaws.services.appmesh.model.transform;

import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.services.appmesh.model.*;

import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;

/**
 * TagRefMarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class TagRefMarshaller {

    private static final MarshallingInfo<String> KEY_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("key").build();
    private static final MarshallingInfo<String> VALUE_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("value").build();

    private static final TagRefMarshaller instance = new TagRefMarshaller();

    public static TagRefMarshaller getInstance() {
        return instance;
    }

    /**
     * Marshall the given parameter object.
     */
    public void marshall(TagRef tagRef, ProtocolMarshaller protocolMarshaller) {

        if (tagRef == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        try {
            protocolMarshaller.marshall(tagRef.getKey(), KEY_BINDING);
            protocolMarshaller.marshall(tagRef.getValue(), VALUE_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}

redpajama_set_name: RedPajamaGithub


text:
Q: Extract only part of string using regex with javascript I'm trying to extract a part of string and replace it using regex in javascript.
eg:
var string = "application == xyz AND location == abc AND packet.vlan == 10 OR ip == 1.1.1.1"

I need to replace
packet.vlan == 10

with
packet.vlan == VLAN-10

I have tried the following
var regexp = /(\=.+)/g;
string.replace(regexp, ("==" + "VLAN-10");

selection has to stop at next OR/AND. In case of eg above selection has to stop before the start of string ip.

A: Your regex means "find any '=' sign followed by one or more characters."
You can have a look at https://regex101.com/ which provide visual ways to debug regex.
try string.replace(/(packet\.vlan == )(\d+)/, "$1VLAN-$2");
Note: "string" is a really bad name for a variable.

A: You can use regex to replace the string, g identifier in RegExp is used as global match (find all matches rather than stopping after the first match).

var string = "application == xyz AND location == abc AND packet.vlan == 10 OR ip == 1.1.1.1"

var temp = new RegExp("packet.vlan == 10", "g");
console.log(string.replace(temp, "packet.vlan == VLAN-10"));

To replace the only first occurrence of packet.vlan == 10 with VLAN-10, you can simply use .replace().

var string = "application == xyz AND location == abc AND packet.vlan == 10 OR ip == 1.1.1.1 AND packet.vlan = 11.1.1.1.11"
console.log(string.replace("packet.vlan == 10", "packet.vlan == VLAN-10"));

A: The solution is to rewrite your regex:

var regexp = /(==\s)(.+\b)/g;  //all chars from ==whitespace until next word boundery
    var s = "packet.VLAN == 10".replace(regexp, "== VLAN-$2"); //$2 to refer to the capturing group
    console.log(s);

However with these complex sql strings I would use other JavaScript to ensure more control. Take a look:

var SQLString = "application == xyz AND location == abc AND packet.vlan == 10 OR ip == 1.1.1.1";

var edit = SQLString.split(/AND|OR/i); //split on and or
var andOrs = SQLString.match(/AND|OR/ig); //create an array with and an or.
edit.forEach(function(value, index, arr){
    //loop the array
    var prop = value.substr(0, value.trim().search(/\s/)+1).trim(); //trim the whitespaces.
    switch(prop){
       case "packet.vlan" :
           arr[index] = "packet.vlan == VLAN-" +value.split("==")[1].trim();
       break;
    }

    //add the original and or to it.
    andOrs[index] ? arr[index] = arr[index].trim() + " " + andOrs[index].trim() : null;
});

SQLString = edit.join(" "); //join the array parts with a whitespace.
console.log(SQLString);

On a final note. I'm curious why JavaScript is needed to rewrite SQL strings?

A: Try like this,
const regex = /packet.vlan == (\d+)/g;
const str = `application == xyz AND location == abc AND packet.vlan == 10 OR ip == 1.1.1.1`;
const subst = `packet.vlan == VLAN-$1`;

// The substituted value will be contained in the result variable
const result = str.replace(regex, subst);

console.log('Substitution result: ', result);

See regex: https://regex101.com/r/93AfJr/1
OR
const str = `application == xyz AND location == abc AND packet.vlan == 10 OR ip == 1.1.1.1`;
var newstr = str.replace(/packet.vlan == 10/i, 'packet.vlan == VLAN-10');
console.log(newstr);

A: Since i had to find the string which is packet.xxx and replace it with value. I had to loop through and find the string which consists packet. and replace it using regex.
NOTE: In packet.xxx, xxx can be any dynamic value.