100 Hours Advance Chakra Meditation Therapist Training Course.
If ICA Charka Therapist Certification Course has changed your life and you are devoted to helping others to go through the same spiritual transformation by giving Chakra Therapy meditation sessions, you may be interested in taking your teaching to a higher level.
ICA Advanced Teacher Training Course is designed for practicing Chakra Therapists willing to study Energy System in great details and learn to expertly and safely provide help to people who need special approach, who have experienced trauma or whose personal issues prevent them from attending group sessions.
ICA Advance Chakra Meditation Therapist Training Course is also suitable for Chakra Meditation teachers with vast experience gained by years of dedicated service to the society guiding their students on the way to physical, emotional and mental health.
The key difference between Charka Therapist Certification Course and Advanced Charka Therapist Course is that the Advanced Training program is designed to prepare the attendants not only to conduct meditation sessions but to train future Charka Therapists.
Requirements: To earn the title of an Advanced Registered Chakra Therapy Teacher students are required to attend 100% of lectures and practical classes and to pass theoretical and practical exams to ensure the Course material has been mastered.
Prerequisites: An ICA Chakra Therapy Teacher Certificate issued not earlier than 6 months before the application for the Advanced Course or previous experience equal or exceeding 500 hours in teaching meditation and conducting Chakra Therapy sessions.
Course objective: In-depth study of Chakras and meditation techniques. Enhancing teaching skills and learning to lead a Teacher Training Course.
Suitability: Suitable for those with the existing practice of teaching Chakra meditation.
Who can attend ICA Advance Chakra Meditation Therapist Training Course?
The ICA Advanced Training is not open to the general public because to understand the Course program a certain level of personal practice and teaching experience is necessary. If you are interested in enrolling, please send your request to ICA, telling us about yourself, your Chakra Therapy practice and why do you think the Course will be beneficial for you. The requests are accepted by e-mail and through your ICA Registered Chakra Therapy Teacher (RCTT) profile.
Registered Chakra Therapy Teachers (RCTTs) and Advanced Registered Chakra Therapy Teachers (ARCTTs) who have completed their ICA Chakra Meditation Therapist Training Course not earlier than 6 months before the application date.
Equivalent to 500 hours of teaching meditation and conducting Chakra Therapy sessions.
If your application is accepted, ICA will provide you with the details of the next Advance Chakra Meditation Therapist Training Course. By graduating the Advanced Training you will earn an Advanced Registered Chakra Therapy Teacher (ARCTT) (if you previous ICA designation was below) and will be qualified to lead 50 Hours Chakra Meditation Therapist Training Course.
ICA Advanced Chakra Therapist Course Aims and Objectives.
Confidently conduct Chakra Therapy sessions and choose the techniques suitable for each student individually.
Efficiently accommodate the needs of people with certain emotional and mental conditions during one-on-one Therapy sessions.
Plan, organize and lead ICA Chakra Therapist Certification Courses, Chakra Therapy workshops and retreats.
Train others to become Chakra Therapists according to the ICA Educational Standard.
Market their services on-line, locally and internationally.
ICA Advanced Chakra Therapist Course Materials.
A well-structured Advanced Course Manual containing the theoretical part of the program and detailed Chakra meditation instructions.
Examples of ICA Chakra Therapist Certification Course Syllabus and suggested daily schedules.
Benefits of ICA Advanced Chakra Therapist Course.
ICA Advanced Chakra Therapist Course is a unique opportunity to share your experience with fellow Chakra specialists, to take a break from teaching responsibilities and become a student again, to concentrate on personal practice and get advice from the Masters of Chakra therapy.
Acquire deeper knowledge of Chakra meditation techniques as well as Mudras, Mantras and Asanas for each Chakra.
Enhance your teaching skills and learn new teaching techniques.
Refresh your memory revising the Energy system and philosophy.
Reconnect with yourself and deepen your meditation practice.
Learn to recognize and accommodate the individual needs of your students.
Share the experience you have gained as a Chakra Therapist with other Course attendants.
Get an ICA Advanced Chakra Meditation Teacher Certificate and a right to upgrade your designation to an ARCTT and get all the benefits which come with it.
Become qualified to train Chakra Therapists by running ICA Charka Therapist Certification Courses.


Apr. 10, 2018 7:00 p.m.
The remains of a baby were discovered less than a block away from Vernon Jubilee Hospital Saturday.
RCMP were called to an apartment building located in the 3900 block of 31A Street after fetal human remains were located.
There is no word on the mother. A cause of death has not been determined, and may not ever be.
"We're very early in our investigation," said Andy Watson with the BC Coroners Service.


text:
Bette Midler is born in Honolulu, Hawaii
By the time she appeared as the final guest of Johnny Carson's 30-year career on The Tonight Show and brought tears to the unflappable host's eyes with an emotional performance of "One For My Baby (And One More For The Road)," she was an established star of stage and screen—a Tony winner, an Oscar nominee, a Grammy winner and a multimillion-selling recording artist. It would be difficult, however, to imagine a more unorthodox path to mainstream stardom than the one followed by Bette Midler—"The Divine Miss M"—who was born in Honolulu, Hawaii, on December 1, 1945.
Equal parts Judy Garland and Ethel Merman, Bette Midler early on set her sights on making it in New York City. Arriving in New York in 1965, Midler soon tried out for the national touring company of Fiddler On The Roof only to land the role of Tzeitel (and the job of singing "Matchmaker" eight times a week) in the Broadway production instead. After several years of singing in various Manhattan nightclubs on the side, she got what would prove to be the most important gig of her career, singing poolside nightly at the fabled Continental Baths, a gay bathhouse/cabaret in the basement of the Ansonia building on West 72nd Street in Manhattan. It was there, in collaboration with a young pianist named Barry Manilow, that she fully developed her "Divine Miss M" stage persona—a brash, campy interpreter of numbers ranging from "Chattanooga Choo Choo" and "Leader Of The Pack" to "Superstar" and "Delta Dawn." It was at the Continental Baths that Atlantic Records chief Ahmet Ertegun discovered Midler and signed her to record the album that made her a star: The Divine Miss M (1972). That album, which made an unlikely pop hit out of "Boogie Woogie Bugle Boy" (Billboard #8, June 1973), earned Midler the Best New Artist award at the 1973 Grammy Awards.
Though she would remain a beloved favorite of a significant fan base over the next decade or so, her only pop hit during that period was the theme song from the 1979 movie The Rose. In 1986, however, her flagging Hollywood career was revived by a comic turn in Paul Mazursky's Down And Out In Beverly Hills. Two years later, she would earn a Record of the Year Grammy and her first and only #1 pop hit with "Wind Beneath My Wings," from the 1988 movie Beaches, in which Midler co-starred alongside Barbara Hershey.
https://www.history.com/this-day-in-history/bette-midler-is-born-in-honolulu-hawaii
Russian revolutionary Sergei Kirov murdered
Sergei Kirov, a leader of the Russian Revolution and a high-ranking member of the Politburo, is shot to death at his Leningrad office by Communist Party member Leonid Nikolayev, likely at the instigation of Soviet leader Joseph Stalin. Whatever Stalin's precise role in the ...read more
Rosa Parks ignites bus boycott
In Montgomery, Alabama on December 1, 1955, Rosa Parks is jailed for refusing to give up her seat on a public bus to a white man, a violation of the city's racial segregation laws. The successful Montgomery Bus Boycott, organized by a young Baptist minister named Martin Luther ...read more
Presidential election goes to the House of Representatives
As no presidential candidate had received a majority of the total electoral votes in the election of 1824, Congress decides to turn over the presidential election to the House of Representatives, as dictated by the 12th Amendment to the U.S. Constitution. In the November 1824 ...read more
Chunnel makes breakthrough
Shortly after 11 a.m. on December 1, 1990, 132 feet below the English Channel, workers drill an opening the size of a car through a wall of rock. This was no ordinary hole–it connected the two ends of an underwater tunnel linking Great Britain with the European mainland for the ...read more
Ninety students die in Chicago school fire
A fire at a grade school in Chicago kills 90 students on December 1, 1958. The Our Lady of Angels School was operated by the Sisters of Charity in Chicago. In 1958, there were well over 1,200 students enrolled at the school, which occupied a large, old building. Unfortunately, ...read more
Antarctica made a military-free continent
Twelve nations, including the United States and the Soviet Union, sign the Antarctica Treaty, which bans military activity and weapons testing on that continent. It was the first arms control agreement signed in the Cold War period. Since the 1800s a number of nations, including ...read more
Abraham Lincoln delivers State of the Union address
On December 1, 1862, President Abraham Lincoln addresses the U.S. Congress and speaks some of his most memorable words as he discusses the Northern war effort. Lincoln used the address to present a moderate message concerning his policy towards slavery. Just ten weeks before, he ...read more
Inventions & Science
Ford's assembly line starts rolling
On December 1, 1913, Henry Ford installs the first moving assembly line for the mass production of an entire automobile. His innovation reduced the time it took to build a car from more than 12 hours to one hour and 33 minutes. Ford's Model T, introduced in 1908, was simple, ...read more
George Washington establishes winter quarters at Morristown
General George Washington's army settles into a second season at Morristown, New Jersey, on December 1, 1779. Washington's personal circumstances improved dramatically as he moved into the Ford Mansion and was able to conduct his military business in the style of a proper ...read more

redpajama_set_name: RedPajamaCommonCrawl


The Occunomix Hi-Viz Knit Cap features a 3M reflective thread stripping to allow for greater visibility over the traditional sewn reflective tape. This cap provides extra warmth on the head and ears. The perfect accessory while working outside during cold days.
The Occunomix Hi-Viz Knit Cap is available in yellow or orange hi-vis color. This super stretch knit acrylic cap is one size fits all. It is easy to carry, just put it in the back pocket or glove compartment for on the go. It comes backed by a 90-day manufacturer's warranty.
The Occunomix Hi-Viz Knit Cap is available in two different colors. Please choose from the menu above.


text:
uint qHash(const Int3D & coord)
{
    return (coord.x * 8191 + coord.z) * 131071 + coord.y;
}

Chunk::Chunk(const Int3D &pos, const Int3D &size, QByteArray data) :
    m_pos(pos),
    m_size(size),
    m_volume(size.x * size.y * size.z),
    m_metadata_offset(m_volume * 2 / 2),
    m_light_offset(m_volume * 3 / 2),
    m_sky_light_offest(m_volume * 4 / 2),
    m_data(data)
{
    // at least one of the dimensions is guaranteed to be even.
    Q_ASSERT((m_volume & 1) == 0);
}

int Chunk::indexOf(const Int3D & coord) const
{
    Q_ASSERT(0 <= coord.x && coord.x < m_size.x &&
             0 <= coord.y && coord.y < m_size.y &&
             0 <= coord.z && coord.z < m_size.z);
    return coord.y + (coord.z * m_size.y) + (coord.x * m_size.y * m_size.z);
}

Block Chunk::getBlock(const Int3D & coord) const
{
    int array_index = indexOf(coord);
    int nibble_shifter = (array_index & 1) * 4;
    Block block;
    block.setType((mineflayer_ItemType)(m_data.at(array_index) & 0xff));
    block.setMetadata((m_data.at( m_metadata_offset + array_index / 2) >> nibble_shifter) & 0xf);
    block.setLight(   (m_data.at(    m_light_offset + array_index / 2) >> nibble_shifter) & 0xf);
    block.setSkyLight((m_data.at(m_sky_light_offest + array_index / 2) >> nibble_shifter) & 0xf);
    return block;
}

void Chunk::setBlock(const Int3D &coord, const Block &value)
{
    // TODO test this
    int array_index = indexOf(coord);
    int nibble_shifter = (array_index & 1) * 4;
    quint8 innactive_nibble_mask = 0xf0 >> nibble_shifter;
    m_data[array_index] = (quint8)value.data.type;
    m_data[ m_metadata_offset + array_index / 2] = (m_data.at( m_metadata_offset + array_index / 2) & innactive_nibble_mask) | (value.data.metadata  << nibble_shifter);
    m_data[    m_light_offset + array_index / 2] = (m_data.at(    m_light_offset + array_index / 2) & innactive_nibble_mask) | (value.data.light     << nibble_shifter);
    m_data[m_sky_light_offest + array_index / 2] = (m_data.at(m_sky_light_offest + array_index / 2) & innactive_nibble_mask) | (value.data.sky_light << nibble_shifter);
}

void Chunk::copyDataTo(unsigned char * buffer)
{
    memcpy(buffer, m_data.constData(), m_data.size());
}

redpajama_set_name: RedPajamaGithub


DR Congo captain Youssouf Mulumbu is upbeat the presence of Yannick Bolasie and Firmin Mubele will make a difference in their Group B opener against Zambia on Sunday in Ebebiyin.
The two neighbours cross each other's path for the first time since the final of the 1974 edition and Mulumbu, who plays for English side, West Bromwich Albion counts on debutants, Bolasie and Mubele to aid their quest for a perfect start at the 30th edition of the continental flagship event.
Crystal Palace winger, Bolasie has been in the 'form of his life' in recent times whilst Mubele comes into the tournament barely few days after being crowned the African Player of the Year (Based in Africa) at the Glo-CAF Awards Gala in Lagos, Nigeria last week.
"We are a small team and we have good players like Bolasie and Mubele, who did not play at the 2013 edition and that has changed our team. And that's what we will use to win the game," Mulumbu told a press briefing on the eve of the match.
"The first game is always important in every competition" said the 27-year old midfielder who will be making a successive appearance with the Leopards after their first round exit on his debut in 2013 in South Africa.
Zambia, champions in 2012 borders DR Congo to the north and Mulumbu, who was born in the capital, Kinshasa, reckons the rivalry between the two sides will be renewed. The captain of Chipolopolo, Rainford Kalaba and forward Given Singuluma are on the books of DR Congo giants, TP Mazembe whilst central defender Sunzu Stopila and midfielder Nathan Sinkala cut their footballing teeth at the Lubumbashi-based club.
"I think (the fact that we are neighbours) will have an impact on the game. Both teams know each other. Zambia won it in 2012 so they are in a better position than us.
"We came through a tough group and deserve to be here, and we will show how best we are," Mulumbu concluded.


text:
Lautoka-Zone
Jasper and Natabua lead the medal tally in the Coca-Cola Lautoka Athletics Zone
By Iva Danford , Dhanjay Deo
Senior Girls 1500 winners.
Natabua High School is currently leading the medal tally in the boys division while Jasper Williams High School is leading the girls division in the Coca-Cola Lautoka Athletics Zone.
In the boys division, Natabua High School is leading with 4 gold, 2 silver and 1 bronze, Ba Provincial Freebird Institute is second with 1 gold and 2 silver while Lautoka Andhra Sangam College is third with 1 gold, 1 silver and 1 bronze.
In the girls division, Jasper is first with 3 gold and 2 silver, Yasawa High School is second with 2 gold and 1 silver while Ba Provincial is third with 1 gold, 2 silver and 2 bronze.
Semisi Apakuki and Mereani Batiki of Ba Provincial Free Bird Institute won the first gold medals in the sub-junior 1,500 metres event.
Apakuki won gold in the boys sub-junior 1,500 metres event while Batiki won gold in the girls sub-junior 1,500 metres event.
Natabua High School student Eparama Seru won gold in the junior boys 1,500 metres event while Ulamila Vata of Yasawa High School won gold in the junior girls 1,500 metres event.
Fuel and gas prices decreases
Good news for drivers as the price of unleaded fuel has decreased to $2.62 from today. The Fijian Competition and Consumer Commission says the ...


Blast into the future with the PXF COOL - the all-new, electric-powered three-wheeler tricycle! With the push of a button, you're off! No Pedaling required. Race at speeds up to 10KM/h, cut full 360 degree spins, slide even drift on PXF COOL 360's high-performance dual included rear caster wheels. It's a 360 degree ride electrified !


Still reeling from that betrayal, Stacy buries herself in her art. But even that is taken from her when her most persistent tormentor uses her own work to humiliate her - and threaten her last chance with Mark.
Aimee is the author behind Seeking the Write Life, a popular blog for writers at www.aimeelsalter.com. You can also find her on Twitter and Facebook.
Aimee's debut novel, Breakable, releases November 4th for Kindle, Nook and in paperback. You can add Breakable to your to-read list on Goodreads.


text:
PROVE Lab
These Students Are Building the Fastest Solar Car Ever
A team from Cal Poly aims to break the world record with a vehicle that runs directly off sun power — batteries not included.
By Glenn McDonald
Behold the spirit of American innovation: In a campus laboratory in San Luis Obispo, a team of 60 college students is working on the world's fastest solar car - a single-passenger speedster powered by ... a hair dryer.
Well, technically speaking, the solar car is powered by two kilowatts of electricity, about equal to a hair dryer. With this trickle of energy, students from California Polytechnic State University's Prototype Vehicles Laboratory have designed a car that should be able to earn a speeding ticket on many U.S. highways.
The electricity is generated by solar cells that will propel the car up to and past 65 mph, without the use of any batteries at all. If everything goes according to plan, next summer the team will attempt to smash the Guinness World Record - currently at 56.75 mph - for this kind of solar vehicle.
The Cal Poly team is one of several groups worldwide competing to build super-efficient solar vehicles, which they race in events like the exceedingly cool World Solar Challenge, held every other year in the Australian outback. Check out the event archives and you'll find that an impressively long list of universities, corporations and even high schools are developing these lean, mean solar racers.
RELATED: Solar-Powered Boat to Make 2,000-Mile Voyage
The Cal Poly vehicle is particularly interesting in that it has no energy storage system whatsoever, said student project manager Will Sutton, in an email from the team headquarters – known as the PROVE Lab.
"The cells we're using are the same exact type of cells that you could get installed onto your roof," Sutton said. "The speed capabilities we've designed for are a combination of clever use of the cells and an extremely optimized aerodynamic design. Our vehicle is going to be one of the lowest-drag cars that's ever been built."
The project team includes students from a dozen different disciplines and areas of study. Aside from a sole faculty adviser, everything is handled by the students - from the initial design to the hands-on construction; the computer simulations to the fundraising and marketing. Mechanical components are machined on-site at the PROVE Lab.
WATCH VIDEO: Will Solar Power Be The Energy Miracle?
To keep the vehicle as light and strong as possible, designers are working with carbon fiber composites similar to those used on Formula One race cars.
"On a typical day, we've got people coming in and out of the lab for most of the day," Sutton said. "Usually there's some sort of construction going on – whether it's the suspension team or the outreach team working on their prototype. Our solar array team is soldering small practice arrays and testing different configurations. You'll usually find our aerodynamics team exploring fine-detail optimization of the shape, and our mechanical engineers planning out the manufacture of their parts."
RELATED: Solar Plane Completes Epic Round-the-World Trip
Under the current design configurations, the composite body will be four times stronger than steel, yet so lightweight that two people can pick up the car to move it. The PROVE car will have just 11 pounds of aerodynamic drag at top speed, according to the designers. That's ten times less than a Ford F-150.
Sutton compared the experience to running a startup company: "I personally spend a lot of time doing systems oversight and interacting with current and potential industry partners," he said. "Never a dull moment ...."
So when the time comes to get the PROVE car out on the road and take a shot at the world record – who gets to drive?
"Somebody small and light!" Sutton said. "We have several candidates from within our team at the moment. All I can say for sure is that I am too tall to fit in the car."


text:
Visit us on Facebook ~ ~ ~ DESERT GAZETTE
Desert Wildlife > Birds:
Megascops kennicottii
Family: STRIGIDAE
Order: STRIGIFORMES
DISTRIBUTION, ABUNDANCE, AND SEASONALITY
Uncommon to common, yearlong resident of open oak, pinyon-juniper, riparian, redwood, and mixed conifer habitats. Tolerant of humans; found in small towns, suburbs, farms, ranches, and meadows. Occurs the length of the state to above 2450 m (8000 ft), except in central and western portions of the Mojave Desert (Garrett and Dunn 1981).
SPECIFIC HABITAT REQUIREMENTS
Feeding: Perches and pounces, and stoops for mice and other small mammals, birds, fish, reptiles, amphibians, and arthropods in meadows and other openings in trees. Preys on small birds frequently in nesting season (Van Camp and Henny 1975). Insects important in summer and fall (Ross 1969).
Cover: Roosts in woodpecker hole or other cavity in snag or tree, under moderate canopy.
Reproduction: Obligate secondary cavity-nester. Uses abandoned woodpecker hole, or other cavity in snag, hollow tree, log, stump; occasionally uses nest box.
Nest usually 4.6 to 18 m (15-60 ft) above ground.
Water: Most water requirements apparently obtained from food (Bartholomew and Cade 1963). In captivity, can exist without water, but will drink if water available. Mosher (1976) described respiratory water losses.
Pattern: Uses edges of oak, riparian, or conifer habitats with snags, tree cavities, or woodpecker holes for nesting and roosting, and openings and meadows nearby for feeding.
SPECIES LIFE HISTORY
Activity Patterns: Yearlong, nocturnal activity.
Seasonal Movements/Migration: Not migratory, but some altitudinal movement apparently occurs in response to inclement weather.
Home Range: Craighead and Craighead (1956) reported 1 to 1.3 per km² (0.4 to 0.5 per mi²) in winter, 1.8 to 5 per km² (0.7 to 1.9 per mi²) in summer, and 1 nesting pair per km² (0.4 per mi²). In Wyoming, they reported 0.7 nesting pairs per km² (0.3 per mi²).
Territory: Mean territory size in woodlands in Kansas was 0.3 ha (0.7 ac), according to a few samples (Fitch 1947). Pairs often remained on the same territory for several years.
Reproduction: Breeds early February through June. Eggs mostly laid in April. Clutch size 1-8, usually 3-4; apparently decreases to the north along the Pacific Coast (Murray 1976). Incubation 21-30 days, and nestlings fledge at 28-35 days (Van Camp and Henny 1975). A nesting success of 3.8 young per nest, and 69% of all nesting attempts successful, reported by Van Camp and Henny (1975). Adults remain paired throughout the year(Call 1978), and pair often found together in nest cavity in daytime (Ehrlich et al. 1988).
Niche: Predators include accipiters, great horned owls, and spotted owls. Squirrels, weasels, other tree-climbing mammals, and gopher snakes take young (Whitfield 1934, Marshall 1967). Interspecific competition for nesting sites between screech-owl and other secondary cavity-nesters apparently strong, and may limit numbers in some areas.
Bartholomew, G. A., and T. J. Cade. 1963. The water economy of land birds. Auk 80:504-539. Call, M. W. 1978.
Nesting habits and survey techniques for common western raptors. U.S. Dep. Inter., Bur. Land Manage., Portland, OR. Tech. Note No. 316. 115pp.
Craighead, J. J., and F. C. Craighead, Jr. 1956. Hawks, owls and wildlife. Stackpole Books, Harrisburg, PA. 443pp.
Ehrlich, P. R., D. S. Dobkin, and D. Wheye. 1988. The birder's handbook. Simon and Schuster,New York. 785pp.
Fitch, H. S. 1947. Predation by owls in the sierran foothills of California. Condor 49:137-151. Garrett, K., and J. Dunn. 1981. Birds of southern California. Los Angeles Audubon Soc. 408pp.
Marshall, J. T., Jr. 1957. Birds of pine-oak woodland in southern Arizona and adjacent Mexico. Pac. Coast Avifauna No. 32. 125pp.
Marshall, J. T., Jr. 1967. Parallel variation in northern and middle American screech owls. West. Found. Vert. Zool. Monogr. No. 1. 72pp.
Mosher, J. A. 1976. Raptor energetics: A review. Raptor Res. 10:97-107.
Murray, G. A. 1976. Geographic variation in the clutch size of seven owl species. Auk 93:602-613.
Robertson, J. M. 1931. Birds and eucalyptus trees. Condor 33:137-139.
Ross, A. 1969. Ecological aspects of the food habits of insectivorous screech owls. Western Found. Vert. Zool. Proc. 1:301-344.
Van Camp, L. F., and C. J. Henny. 1975. The screech owl: Its life history and population ecology in northern Ohio. N. Amer. Fauna No. 71. 65pp.
Whitfield, C. J. 1934. A screech owl captured by a snake. Condor 36:84.
B264 Life history accounts for species in the California Wildlife Habitat Relationships (CWHR) System
Country Life Realty
Wrightwood, Ca. Mountain Hardware
Wrightwood, Ca. Canyon Cartography


text:
Q: Exclude class from the_content / Display shortcode in page_content I have a problem that shortcodes are not working in my wordpress page, because the content is being called be:
<?php echo $page_content; ?>

Now, on the actual page, there is a class called "theslide" and the page_content posts everything excluding the class "theslide".
I either need a way to activate shortcodes on page_content in the fuctions.php file, or a need a way to exclude the class "theslide" from the_content.
Thanks in advance
Willem

A: There are two methods you can use.
1
Use do_shortcode on the output which will run any shortcodes.
<?php echo do_shortcode( $page_content ); >

2
Apply the same filters that are used on the_content() which includes running shortcodes.
<?php echo apply_filters( 'the_content', $page_content ); ?>

redpajama_set_name: RedPajamaStackExchange


text:
A guitar, between friends
For the longest time, Louise Hardy couldn't even open the case that held the unfinished Spanish guitar her late husband had made. "The smell of it would come out," she said. "That beautiful smell.
Roxanne Stasyszyn
Mar. 18, 2011 9:00 a.m.
For the longest time, Louise Hardy couldn't even open the case that held the unfinished Spanish guitar her late husband had made.
"The smell of it would come out," she said. "That beautiful smell."
Few may know that Todd Hardy even made guitars.
But he did.
"It was his original career plan," Hardy laughed.
And he made quite a few.
But there was only one Spanish guitar.
The couple travelled to Spain in 2005 so Todd could train under world-renowned master Jose Romanillos.
The integrity of the guitar was there, but the idea was to take it home and finish it on his own, Hardy said.
But shortly after they came back to the Yukon, Todd was diagnosed with leukemia.
"It was this relationship that we had with this guitar," said Hardy, explaining why she couldn't look at it. "Wanting it to be finished, wanting it to be played and knowing that, really, it wasn't going to happen."
At a point when things were looking better, Todd flew down to train with Vancouver-based, Geza Burghardt on the French-polish finishing.
But then he relapsed again.
"He just couldn't stand in the shop, his hands cramped up and he just couldn't use his hands any more to finish it," Hardy said. "It never stopped him from trying, but physically he couldn't do that anymore."
Eventually, while going through some things around the house, Louise Hardy found the guitar again.
When he was still alive, Todd hinted at who he hoped it would go to.
The Hardys two sons came separately to her and said they wanted it to go to the same person. In her own mind, she too decided it couldn't go to anyone else.
Ryan Enns grew up in Whitehorse, and, like his bandmates and many of his friends, he first met Todd on the ice.
"He was my hockey coach for quite a few years, and then he was my friend's dad and then he was just my friend," said Enns. "With the guitar building, we had a lot to talk about."
Enns is the voice and guitarist of Whitehorse's own Irish pub-party band, the Whisky Dicks.
But beneath the gruff lyrics, Celtic fiddle and floor-stomping rhythm, there are hints of very intricate guitar work.
While it may seem like a stretch to many, the frontman is also a classically trained guitarist.
"The intentions are different, but my motivation is the same," said Enns about the two contrasting styles. "I just really like music from different places."
Recently, Enns has moved with his Australian wife and two-year old child to the southern continent.
"I would take 30 below, over 30 above any day," said Enns, confessing his procrastination techniques in the frozen food isles of the grocery stores and how he looks forward to the walk-in freezers at the liquor stores.
The move didn't just bring heat, it brought on loneliness and some 20,000 kilometres between Enns and his band.
But this doesn't mean the end of the Whisky Dicks, he said, noting that he still tours for severalmonths out of the year.
And for regular gigs, the band hires professional musicians who fill in, while drummer Mike Bell takes over vocals and guitar.
But the distance is tough.
"It's really kind of weird because I've known Ryan since I was 12," said Whisky Dicks fiddler Pat Ernst. "We've basically seen each other for the past 15 years and it's sort of strange not having him around. It's tough. But whenever he comes back it's really nice to see him again."
One of the biggest changes for Enns has been a lot more time to focus on his classical guitar work, and his budding solo career as a singer/songwriter.
He is planning on recording his first solo album soon.
"I've written a lot of songs that just wouldn't work with the Whisky Dicks because they were just too wholesome," Enns said. "I never set out to write a song, it always comes from somewhere else. I've written a lot of meaningful songs that really have no place in the Whisky Dicks' set, because it always has to be party, party, party."
For example, while they did record it on the Whisky Dicks latest album, a song called The Ballad of Bill the Beaver never gets played live.
It was inspired by Enns' childhood playground at Snafu Lake.
"I only have one voice," Enns says. "It's just mostly the message and atheistic that's really different. But I can't really escape myself."
And Enns' playful character is just as evident in his solo work as it is with Whisky Dicks tunes. For instance, the song titled, Drinking, Drinking, Drinking, Drinking, Drinking, Drinking, Spew, may sound like a perfect Whisky Dicks hit, but it's actually a part of Enns' solo show. He wrote it soon after his baby was born.
Enns wrote a song when Todd Hardy died as well. The band contemplated recording it, as he was well known and respected by all the band members, but they decided against it.
A Song For Todd Hardy now makes up part of Enns' solo portfolio, which he describes as "three chords and the truth."
Enns' show is an even mix between his solo songs and classical, and Spanish instrumental guitar music.
And while he will be in Whitehorse for this St. Patrick's Day weekend, performing with the Whisky Dicks, Enns will also be doing a solo show on Sunday, with Todd's guitar.
Shortly after the Hardy family gave him the guitar, Enns sent it back to Geza Burghardt.
While Burghardt is known around the world for his guitars, he has never finished someone else's work.
He made an exception for Todd.
"I am so grateful that it will be played and that it gets to be played by Ryan," said Louise Hardy. "Ryan is just such a kind, wonderful, wonderful man and that guitar could not go to anyone else."
Hardy explained that in the last few months and weeks before Todd's death, Enns was the only person outside of immediate family that she felt comfortable leaving Todd with.
"He came for tea, I think it was a week before Todd died, and I just thought, 'Oh great.' Everybody was gone and Ryan came by and I could just take off and go for a walk because he was in such great hands," she said. "They had such a great relationship. It was really something."
Enns' show on Sunday is taking place at the Whitehorse United Church, starting at 7 p.m. Admission is by donation.
The Whisky Dicks are playing at Foxy's on both Friday and Saturday night. Admission is $10 – or $5 if you wear all green. The shows start at 9:45 p.m.
Contact Roxanne Stasyszyn at
roxannes@yukon-news.com
of feathers and bones
National Geographic's Yukon trail
Mushers race in preparation for FirstMate Babe Southwick
The annual race is set for Feb. 12 and 13.
City hall, briefly
A look at decisions made by Whitehorse city council this week


text:
Q: Tensorflow giving strange error in relation to variable reuse, stating a kernel already exists Fantastic news I figured this out and will keep the solution here for posterity.
I needed to begin my script with tf.restore_default_graph()
I am in the beginning stages of writing a GAN in Tensorflow, and I am getting a weird error message in regards to whether or not I intend to be reusing a variable. It is basically saying (I think) that I am trying to define a kernel twice for one of my convolutions. Code and error are attached. Thank you!
import tensorflow as tf
import numpy as np
import os
from definitions import *

"""
HYPERPARAMETERS
"""
BATCH_SIZE = 10    #number of slices in the batches fed to Discrim
NUM_STEPS  = 100  #number of iterations before we save
GEN_LR     = 1e-5
DIS_LR     = 1e-5
EPS        = 1e-10
KERNEL     = 3

x=tf.placeholder(tf.float32,shape=[BATCH_SIZE,256,256,1],name='GenInput')
y=tf.placeholder(tf.float32,shape=[BATCH_SIZE,256,256,1],name='GenOutput')
#label=tf.placeholder(tf.int32, name='IsReal') #1=real 0=generated

#whole_dataset=Dataset2D('/Users/Karl/Inputs/training set/DEC-MRI_training','/Users/Karl/Inputs/training set/ROI_Liu_modified/')

def gen(x):
    with tf.variable_scope('GenBlk1'):
        with tf.variable_scope('conv1'):
            conv1=tf.layers.conv2d(x, 32, (KERNEL, KERNEL), strides=(1, 1), padding="same")
            conv1=tf.nn.relu(conv1)
        with tf.variable_scope('conv2'):
            conv2=tf.layers.conv2d(conv1, 32, (KERNEL, KERNEL), strides=(1, 1), padding="same")
            conv2=tf.nn.relu(conv2)
        with tf.variable_scope('conv3'):
            conv3=tf.layers.conv2d(conv2, 5, (KERNEL, KERNEL), strides=(1, 1), padding="same")
            conv3=tf.nn.relu(conv3)
        #xp=tf.layers.max_pooling2d(inputs, pool_size,strides,padding='valid')
    return conv3

def discriminator(y):
    with tf.variable_scope('DisBlk1'):
        y=tf.layers.conv2d(y, 32, (KERNEL, KERNEL), strides=(1, 1), padding="same")
        y=tf.nn.relu(y)
        y=tf.layers.conv2d(y, 32, (KERNEL, KERNEL), strides=(1, 1), padding="same")
        y=tf.nn.relu(y)
        y=tf.layers.conv2d(y, 32, (KERNEL, KERNEL), strides=(1, 1), padding="same")
        y=tf.nn.relu(y)
        y=tf.layers.dense(y,2)
        #xp=tf.layers.max_pooling2d(inputs, pool_size,strides,padding='valid')
    return y

def main(x,whole_dataset):
    #ops
    pred = gen(x)
    discrim_fake = discriminator(predict)
    #discrim_real = discriminator(y)
    #gLoss=  =

    #summaries
    with tf.name_scope("generator_output"):
        tf.summary.image("outputs", pred)

    tf.summary.scalar("discriminator_loss", dLoss)
    tf.summary.scalar("generator_loss_GAN", gLoss)

    for var in tf.trainable_variables():
        tf.summary.histogram(var.op.name + "/values", var)

    saver = tf.train.Saver(max_to_keep=10)

    GLOBAL_STEP=0
    #with tf.Session() as sess:
    #    while True: #main loop

main(x,whole_dataset)

This is the error:
runfile('/Users/Karl/Research/NNStuff/GAN_breast/main.py', wdir='/Users/Karl/Research/NNStuff/GAN_breast')
Reloaded modules: definitions
Traceback (most recent call last):

  File "<ipython-input-74-b7a187cb0f1a>", line 1, in <module>
    runfile('/Users/Karl/Research/NNStuff/GAN_breast/main.py', wdir='/Users/Karl/Research/NNStuff/GAN_breast')

  File "/Users/Karl/anaconda/lib/python3.6/site-packages/spyder/utils/site/sitecustomize.py", line 880, in runfile
    execfile(filename, namespace)

  File "/Users/Karl/anaconda/lib/python3.6/site-packages/spyder/utils/site/sitecustomize.py", line 102, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "/Users/Karl/Research/NNStuff/GAN_breast/main.py", line 77, in <module>
    main(x,whole_dataset)

  File "/Users/Karl/Research/NNStuff/GAN_breast/main.py", line 63, in main
    tf.summary.image("outputs", gen(x))

  File "/Users/Karl/Research/NNStuff/GAN_breast/main.py", line 31, in gen
    conv1=tf.layers.conv2d(x, 32, (KERNEL, KERNEL), strides=(1, 1), padding="same")

  File "/Users/Karl/anaconda/lib/python3.6/site-packages/tensorflow/python/layers/convolutional.py", line 551, in conv2d
    return layer.apply(inputs)

  File "/Users/Karl/anaconda/lib/python3.6/site-packages/tensorflow/python/layers/base.py", line 503, in apply
    return self.__call__(inputs, *args, **kwargs)

  File "/Users/Karl/anaconda/lib/python3.6/site-packages/tensorflow/python/layers/base.py", line 443, in __call__
    self.build(input_shapes[0])

  File "/Users/Karl/anaconda/lib/python3.6/site-packages/tensorflow/python/layers/convolutional.py", line 137, in build
    dtype=self.dtype)

  File "/Users/Karl/anaconda/lib/python3.6/site-packages/tensorflow/python/layers/base.py", line 383, in add_variable
    trainable=trainable and self.trainable)

  File "/Users/Karl/anaconda/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 1065, in get_variable
    use_resource=use_resource, custom_getter=custom_getter)

  File "/Users/Karl/anaconda/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 962, in get_variable
    use_resource=use_resource, custom_getter=custom_getter)

  File "/Users/Karl/anaconda/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 367, in get_variable
    validate_shape=validate_shape, use_resource=use_resource)

  File "/Users/Karl/anaconda/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 352, in _true_getter
    use_resource=use_resource)

  File "/Users/Karl/anaconda/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 664, in _get_single_variable
    name, "".join(traceback.format_list(tb))))

ValueError: Variable GenBlk1/conv1/conv2d/kernel already exists, disallowed. Did you mean to set reuse=True in VarScope? Originally defined at:

  File "/Users/Karl/Research/NNStuff/GAN_breast/main.py", line 30, in generator
    with tf.variable_scope('conv1'):
  File "/Users/Karl/Research/NNStuff/GAN_breast/main.py", line 55, in main
    #ops
  File "/Users/Karl/Research/NNStuff/GAN_breast/main.py", line 77, in <module>
    main(x,whole_dataset)


Search for Flights To Israel. Browse & Discover Useful Results!
Find Cheap airline tickets to israel. Browse it Now!
Welcome to Kensaq.com. Find Flights To Israel Today!
Search for Cheap Airline Tickets To Israel. Now More Specific Results!
Find Flights To Israel. Compare All Results Web at Once!


text:
Corden's 'Late Late Show' visits London, gets silly in Paris
File- This June 9, 2019, file photo shows host James Corden speaking at the 73rd annual Tony Awards at Radio City Music Hall in New York. Corden's show is in London for broadcasts airing Monday to Thursday, June 17 to 20, with guests including former first lady Michelle Obama and Chris Hemsworth.(Photo by Charles Sykes/Invision/AP, File)
LOS ANGELES — When James Corden takes his "The Late Late Show" to England, he does it up royally.
This week's London-based shows include British and U.S. stars including Tom Hanks and Lily James.
There's a taped dodgeball match with former first lady Michelle Obama and Melissa McCarthy among the women facing off against opponents including Corden and Harry Styles.
One sketch has the host competing with Chris Hemsworth to see who would be the better restaurant employee. In another, "Dark Phoenix" cast members including Jessica Chastain and Michael Fassbender join Corden for a double-decker bus tour of London.
Corden is especially pleased with the latest edition of the show's "Crosswalk: The Musical." It was taped in Paris, and features songs from "Les Misérables."
The "Late Late Show" episodes air from London's Central Hall Westminster through Thursday on CBS.
Some Chinese migrant workers feel targeted by...
US-CHINA-HUTONGS:Some Chinese migrant workers feel targeted by Beijing's clean-up of ancient hutongs
China seeks safe steering of bike-sharing boom to...
US-CHINA-BIKE-SHARING:China seeks safe steering of bike-sharing boom to clear cluttered streets
Moody's China downgrade 'illogical', overstates...
US-CHINA-ECONOMY-RATING:Moody's China downgrade 'illogical', overstates debt: People's Daily
Hong Kong superstar Aaron Kwok announces he's a...
Hong Kong superstar Aaron Kwok has announced on social media that he's a father


Image Title: Enchant HUGE Multiple Panels Wall Art For Home Decor Contemporary With Prepare 13. Filename: enchant-huge-multiple-panels-wall-art-for-home-decor-contemporary-with-prepare-13.jpg. Image Dimension: 500 x 500 pixels. Images Format: jpg/jpeg. Publisher/Author: Alan Waters. Uploaded Date: Saturday - May 05th. 2018 22:10:21 PM. Category: Architecture. Image Source: hgtv.com.
Tap The Thumbnail Bellow to See Related Gallery of "Enchant HUGE Multiple Panels Wall Art For Home Decor Contemporary With Prepare 13"


text:
Бе́ртельсманн-би́лдинг () — небоскрёб в Мидтауне Манхэттена. Фасады здания выходят на 45-ю и 46-ю улицы и на Седьмую авеню.

На месте небоскрёба прежде находился 16-этажный Государственный театр Лёва (). Построенный в 1921-м, он был снесён в 1987 году. Небоскрёб был спроектирован архитектурным объединением Skidmore, Owings and Merrill. Застройщиком выступил Иан Брюс Эйхнер. Строительство велось в 1989—1990 годы. Фасады небоскрёба оформлены тёмно-зелёным стеклом с использованием алюминиевых . На южном фасаде имеются обширные вставки из более светлого стекла. Главный вход в здание расположен со стороны Бродвея. Этот фасад имеет треугольное сечение, заканчиваясь наверху конструкцией, выполненной в стиле деконструктивизма. Всего в здании насчитывается 44 этажа, а высота составляет 223 метра. Совокупная площадь помещений составляет около 102 000 м², в том числе 13 000 м² на трёх подземных этажах.

В 1992 году небоскрёб за 200 млн $ приобрело подразделение BMG концерна Bertelsmann и сделало его своим генеральным офисом. Впоследствии помещения были распроданы, и ныне в здании находятся офисы таких компаний, как Viacom и Yahoo!.

Примечания

Литература

Таймс-сквер
Небоскрёбы, построенные в 1990 году
Бродвей (Нью-Йорк)
Здания и сооружения, построенные в 1990 году в США

redpajama_set_name: RedPajamaWikipedia


We provide transportation to the cabin, water, and firewood. Guests are required to bring their own food. Our cabin is located in a remote wilderness setting only accessible by boat or by snowmobile in the winter. Guests should be comfortable in a wilderness setting.


LONDON, England (CNN) -- Aircraft manufacturer Airbus is ready to fund a third search of the Atlantic Ocean if a second search, now under way, fails to find debris from last month's Air France crash, the company said Friday.
Investigators pore over wreckage of Air France flight 447 which crashed killing 228 people on June 1.
Airbus is discussing a payment of between 12 to 20 million euros ($17-28 million) to help pay for a third search, but it is still too early to settle on a figure, company spokesman Stefan Schaffrath said.
"We are ready to give a significant share, whatever is needed," he told CNN.
The company is driven by the desire to understand what caused the crash of Air France Flight 447 on June 1, he said. All 228 people aboard were killed.
"Our priority is increasing aviation safety," Schaffrath said. "The aviation community can learn from an accident."
Airbus is already helping in the second search alongside Air France and the French accident investigations agency, the BEA.
French investigators began the second phase of their search for remnants of the flight Thursday, weeks after the locator beacons of the plane's flight recorders would have stopped working.
A ship arrived in the area of the Atlantic considered the most likely location of the flight data recorder and the cockpit voice recorder, according to the BEA.
Using two submersible units and lateral scanning sonar, search teams will look for debris sites on the sea floor that could lead to finding the recorders, the BEA said.
The locator beacons of flight data recorders and cockpit voice recorders are designed to emit acoustic beacons, or "pings," for 30 days after a crash.
Flight 447 went down in stormy weather during a flight from Rio de Janeiro, Brazil, to Paris, France, on the first day of June. The search for the pings ended July 10.
Investigators hope the recorders will help them determine the cause of the crash.
Flight debris recovered so far is being stored in France, authorities have said.
Only 51 bodies were recovered from the crash of Flight 447, the worst accident in Air France's 75-year history.


A detailed introduction to electrical engineering.
The aim of this course is to take you to a standard which will qualify you for a National Certificate Group Award, enabling you to develop knowledge, understanding and skills in electrical engineering. It will enhance the employment potential of successful students, and put you in a strong position for progressing towards further study.
This is a 12 credit SQA NC Award, and to gain the award you are required to be successful in 12 credits.
You should have a Mathematics or Physics qualification at Standard Grade Credit, Intermediate 2 or National 5 level.
All materials are supplied or provided through Library+ and online resources.


text:
PLANNING PUBLIC TRANSPORT SERVICES COURSE 2023
06 - 09 June 2023 - Amsterdam. NL
PPTS-Course 2023
The course will provide the ultimate guide to public transport planning, operations and policy. The objective of the course is to combine traditional operations and new approaches to service planning and finding solutions to difficult and persistent public transport problems. This course is provided in association with the Institute of Transport Studies, Monash University, the Transportation Research Centre at the University of Auckland and the Delft University of Technology.
This 4-days course 2023 will be held in Hotel Jakarta in Amsterdam from 6 -9 June 2023
Transport is a major challenge for cities and regions worldwide. Providing high quality public transport has long been seen as a pro-active means of addressing the negative economic, environmental, social and urban consequences of traffic congestion. However, Public Transport service planners and operators face a range of practical financial, operational and social challenges in developing services. Financial pressures in particular demonstrate a need for increased productivity in achieving improved outcomes.
The Smart Public Transport Lab at Delft University of Technology is offering a week-long course in public transport planning in Delft since April 2016. This course is provided in association with the Institute of Transport Studies, Monash University and the Transportation Research Institute, Technion-Israel Institute of Technology. Similar courses have been run before in Australia and New Zealand.
The of the course is to compare between traditional operations and service planning, including scheduling procedures, and new approaches, and to deal with and find solutions to persistent and realistic public transport problems. This course covers public transport planning topics identified as priorities for learning by participants in previous courses. They are designed to be relevant to all conventional and emerging public transport modes including bus, tram, rail and on-demand services.
"The PPTS course does not only provide new knowledge but also new international connections in the domain public transport planning and research"
It is a pleasure to discuss the future of public transport with participants from all over the world, both from academia and practice
In the PPTS we both focus on classic design issues and emerging trends and challenges, for instance multimodality and inclusive mobility
The course is designed for professionals working in the public transport domain including urban and transport planners, operators and analysts, consultants as well as for young researches.The course is designed for professionals working in the public transport domain including urban and transport planners, operators and analysts, consultants as well as for young researches.
Graham Currie
MONASH UNIVERSITY, AUSTRALIA
Prof Currie is a renowned international Public Transport research leader and policy advisor with over 30 years experience. He has published more research papers in leading international peer research journals in this field than any other researcher in the world.
Avishai (Avi) Ceder
Technion – Israel Institute of Technology T
Professor Avishai (Avi) Ceder is recognised internationally for his long contributions to transportation research. His Research interests include: Public Transport, Operations Research, Human Factors and Behavior, Intelligent Transportation Systems, Road Safety, Traffic Control, Logistics.
More at: http://ceder.net.technion.ac.il
Oded Cats
Prof. Cats is a Professor of Passenger Transport Systems and a co-director of the Smart Public Transport Lab. His research is devoted to multi-modal passenger transport services including planning, operations, behavior and policy making. His research activities support public transport agencies and operators' decision making and has led to field implementations in various countries
Niels van Oort
Niels van Oort works as an associate professor Public Transport at Delft University of Technology and is co-director of the Smart Public Transport Lab. Via previous jobs as consultant and transport planner he has been involved in several public transport projects for over 15 years. His main fields of expertise are public transport planning, data-driven design, with special interest in the passenger perspective, service reliability and multimodality.
TU Delft, Department Transport & Planning | Stevinweg 1, 2628 CN Delft, NL
blueboxevents@tudelft.nl


text:
CREATE TABLE uaocs_threshold (a INT, b INT, c CHAR(128)) WITH (appendonly=true, orientation=column) distributed by (b);
CREATE INDEX uaocs_threshold_index ON uaocs_threshold(a);
INSERT INTO uaocs_threshold SELECT i as a, 1 as b, 'hello world' as c FROM generate_series(1, 100) AS i;

\set QUIET off
VACUUM uaocs_threshold;
DELETE FROM uaocs_threshold WHERE a < 4;
SELECT COUNT(*) FROM uaocs_threshold;
SELECT DISTINCT segno, tupcount, state FROM gp_toolkit.__gp_aocsseg_name('uaocs_threshold');
-- 97 visible tuples, no vacuum
VACUUM uaocs_threshold;
SELECT DISTINCT segno, tupcount, state FROM gp_toolkit.__gp_aocsseg_name('uaocs_threshold');
DELETE FROM uaocs_threshold WHERE a < 12;
SELECT DISTINCT segno, tupcount, state FROM gp_toolkit.__gp_aocsseg_name('uaocs_threshold');
-- 89 visible tuples, do vacuum
VACUUM uaocs_threshold;
SELECT DISTINCT segno, tupcount, state FROM gp_toolkit.__gp_aocsseg_name('uaocs_threshold');
-- no invisible tuples, no vacuum
VACUUM uaocs_threshold;
SELECT DISTINCT segno, tupcount, state FROM gp_toolkit.__gp_aocsseg_name('uaocs_threshold');
DELETE FROM uaocs_threshold WHERE a < 15;
SELECT DISTINCT segno, tupcount, state FROM gp_toolkit.__gp_aocsseg_name('uaocs_threshold');
-- 3 invisible tuples, no vacuum
VACUUM uaocs_threshold;
SELECT DISTINCT segno, tupcount, state FROM gp_toolkit.__gp_aocsseg_name('uaocs_threshold');
SET gp_appendonly_compaction_threshold=2;
-- 3 invisible tuples, no vacuum
VACUUM uaocs_threshold;
SELECT DISTINCT segno, tupcount, state FROM gp_toolkit.__gp_aocsseg_name('uaocs_threshold');

INSERT INTO uaocs_threshold SELECT i as a, i as b, 'hello world' as c FROM generate_series(100, 200) AS i;
DELETE FROM uaocs_threshold WHERE a > 100 and a < 175;
SELECT DISTINCT segno, tupcount, state FROM gp_toolkit.__gp_aocsseg_name('uaocs_threshold');
VACUUM uaocs_threshold;
SELECT DISTINCT segno, tupcount, state FROM gp_toolkit.__gp_aocsseg_name('uaocs_threshold');

-- The percentage of hidden tuples should be 10.1%
-- The threshold guc is set to 10%
SET gp_appendonly_compaction_threshold=10;
CREATE TABLE uaocs_threshold_boundary(a int, b int) WITH(appendonly=TRUE, orientation=COLUMN) distributed by(a);
INSERT INTO uaocs_threshold_boundary SELECT 1, i from generate_series(1, 1000) i;
DELETE FROM uaocs_threshold_boundary WHERE b < 102;
VACUUM uaocs_threshold_boundary;
SELECT * FROM gp_toolkit.__gp_aovisimap_compaction_info('uaocs_threshold_boundary'::regclass);


text:
package org.apache.kafka.common.record;

import org.apache.kafka.common.TopicPartition;
import org.apache.kafka.common.errors.CorruptRecordException;
import org.apache.kafka.common.message.LeaderChangeMessage;
import org.apache.kafka.common.message.SnapshotHeaderRecord;
import org.apache.kafka.common.message.SnapshotFooterRecord;
import org.apache.kafka.common.network.TransferableChannel;
import org.apache.kafka.common.record.MemoryRecords.RecordFilter.BatchRetention;
import org.apache.kafka.common.record.MemoryRecords.RecordFilter.BatchRetentionResult;
import org.apache.kafka.common.utils.AbstractIterator;
import org.apache.kafka.common.utils.BufferSupplier;
import org.apache.kafka.common.utils.ByteBufferOutputStream;
import org.apache.kafka.common.utils.CloseableIterator;
import org.apache.kafka.common.utils.Time;

import org.apache.kafka.common.utils.Utils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.GatheringByteChannel;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;

/**
 * A {@link Records} implementation backed by a ByteBuffer. This is used only for reading or
 * modifying in-place an existing buffer of record batches. To create a new buffer see {@link MemoryRecordsBuilder},
 * or one of the {@link #builder(ByteBuffer, byte, CompressionType, TimestampType, long)} variants.
 */
public class MemoryRecords extends AbstractRecords {
    private static final Logger log = LoggerFactory.getLogger(MemoryRecords.class);
    public static final MemoryRecords EMPTY = MemoryRecords.readableRecords(ByteBuffer.allocate(0));

    private final ByteBuffer buffer;

    private final Iterable<MutableRecordBatch> batches = this::batchIterator;

    private int validBytes = -1;

    // Construct a writable memory records
    private MemoryRecords(ByteBuffer buffer) {
        Objects.requireNonNull(buffer, "buffer should not be null");
        this.buffer = buffer;
    }

    @Override
    public int sizeInBytes() {
        return buffer.limit();
    }

    @Override
    public long writeTo(TransferableChannel channel, long position, int length) throws IOException {
        if (position > Integer.MAX_VALUE)
            throw new IllegalArgumentException("position should not be greater than Integer.MAX_VALUE: " + position);
        if (position + length > buffer.limit())
            throw new IllegalArgumentException("position+length should not be greater than buffer.limit(), position: "
                    + position + ", length: " + length + ", buffer.limit(): " + buffer.limit());

        return Utils.tryWriteTo(channel, (int) position, length, buffer);
    }

    /**
     * Write all records to the given channel (including partial records).
     * @param channel The channel to write to
     * @return The number of bytes written
     * @throws IOException For any IO errors writing to the channel
     */
    public int writeFullyTo(GatheringByteChannel channel) throws IOException {
        buffer.mark();
        int written = 0;
        while (written < sizeInBytes())
            written += channel.write(buffer);
        buffer.reset();
        return written;
    }

    /**
     * The total number of bytes in this message set not including any partial, trailing messages. This
     * may be smaller than what is returned by {@link #sizeInBytes()}.
     * @return The number of valid bytes
     */
    public int validBytes() {
        if (validBytes >= 0)
            return validBytes;

        int bytes = 0;
        for (RecordBatch batch : batches())
            bytes += batch.sizeInBytes();

        this.validBytes = bytes;
        return bytes;
    }

    @Override
    public ConvertedRecords<MemoryRecords> downConvert(byte toMagic, long firstOffset, Time time) {
        return RecordsUtil.downConvert(batches(), toMagic, firstOffset, time);
    }

    @Override
    public AbstractIterator<MutableRecordBatch> batchIterator() {
        return new RecordBatchIterator<>(new ByteBufferLogInputStream(buffer.duplicate(), Integer.MAX_VALUE));
    }

    /**
     * Validates the header of the first batch and returns batch size.
     * @return first batch size including LOG_OVERHEAD if buffer contains header up to
     *         magic byte, null otherwise
     * @throws CorruptRecordException if record size or magic is invalid
     */
    public Integer firstBatchSize() {
        if (buffer.remaining() < HEADER_SIZE_UP_TO_MAGIC)
            return null;
        return new ByteBufferLogInputStream(buffer, Integer.MAX_VALUE).nextBatchSize();
    }

    /**
     * Filter the records into the provided ByteBuffer.
     *
     * @param partition                   The partition that is filtered (used only for logging)
     * @param filter                      The filter function
     * @param destinationBuffer           The byte buffer to write the filtered records to
     * @param maxRecordBatchSize          The maximum record batch size. Note this is not a hard limit: if a batch
     *                                    exceeds this after filtering, we log a warning, but the batch will still be
     *                                    created.
     * @param decompressionBufferSupplier The supplier of ByteBuffer(s) used for decompression if supported. For small
     *                                    record batches, allocating a potentially large buffer (64 KB for LZ4) will
     *                                    dominate the cost of decompressing and iterating over the records in the
     *                                    batch. As such, a supplier that reuses buffers will have a significant
     *                                    performance impact.
     * @return A FilterResult with a summary of the output (for metrics) and potentially an overflow buffer
     */
    public FilterResult filterTo(TopicPartition partition, RecordFilter filter, ByteBuffer destinationBuffer,
                                 int maxRecordBatchSize, BufferSupplier decompressionBufferSupplier) {
        return filterTo(partition, batches(), filter, destinationBuffer, maxRecordBatchSize, decompressionBufferSupplier);
    }

    /**
     * Note: This method is also used to convert the first timestamp of the batch (which is usually the timestamp of the first record)
     * to the delete horizon of the tombstones or txn markers which are present in the batch.
     */
    private static FilterResult filterTo(TopicPartition partition, Iterable<MutableRecordBatch> batches,
                                         RecordFilter filter, ByteBuffer destinationBuffer, int maxRecordBatchSize,
                                         BufferSupplier decompressionBufferSupplier) {
        FilterResult filterResult = new FilterResult(destinationBuffer);
        ByteBufferOutputStream bufferOutputStream = new ByteBufferOutputStream(destinationBuffer);
        for (MutableRecordBatch batch : batches) {
            final BatchRetentionResult batchRetentionResult = filter.checkBatchRetention(batch);
            final boolean containsMarkerForEmptyTxn = batchRetentionResult.containsMarkerForEmptyTxn;
            final BatchRetention batchRetention = batchRetentionResult.batchRetention;

            filterResult.bytesRead += batch.sizeInBytes();

            if (batchRetention == BatchRetention.DELETE)
                continue;

            // We use the absolute offset to decide whether to retain the message or not. Due to KAFKA-4298, we have to
            // allow for the possibility that a previous version corrupted the log by writing a compressed record batch
            // with a magic value not matching the magic of the records (magic < 2). This will be fixed as we
            // recopy the messages to the destination buffer.
            byte batchMagic = batch.magic();
            List<Record> retainedRecords = new ArrayList<>();

            final BatchFilterResult iterationResult = filterBatch(batch, decompressionBufferSupplier, filterResult, filter,
                    batchMagic, true, retainedRecords);
            boolean containsTombstones = iterationResult.containsTombstones;
            boolean writeOriginalBatch = iterationResult.writeOriginalBatch;
            long maxOffset = iterationResult.maxOffset;

            if (!retainedRecords.isEmpty()) {
                // we check if the delete horizon should be set to a new value
                // in which case, we need to reset the base timestamp and overwrite the timestamp deltas
                // if the batch does not contain tombstones, then we don't need to overwrite batch
                boolean needToSetDeleteHorizon = batch.magic() >= RecordBatch.MAGIC_VALUE_V2 && (containsTombstones || containsMarkerForEmptyTxn)
                    && !batch.deleteHorizonMs().isPresent();
                if (writeOriginalBatch && !needToSetDeleteHorizon) {
                    batch.writeTo(bufferOutputStream);
                    filterResult.updateRetainedBatchMetadata(batch, retainedRecords.size(), false);
                } else {
                    final MemoryRecordsBuilder builder;
                    long deleteHorizonMs;
                    if (needToSetDeleteHorizon)
                        deleteHorizonMs = filter.currentTime + filter.deleteRetentionMs;
                    else
                        deleteHorizonMs = batch.deleteHorizonMs().orElse(RecordBatch.NO_TIMESTAMP);
                    builder = buildRetainedRecordsInto(batch, retainedRecords, bufferOutputStream, deleteHorizonMs);

                    MemoryRecords records = builder.build();
                    int filteredBatchSize = records.sizeInBytes();
                    if (filteredBatchSize > batch.sizeInBytes() && filteredBatchSize > maxRecordBatchSize)
                        log.warn("Record batch from {} with last offset {} exceeded max record batch size {} after cleaning " +
                                        "(new size is {}). Consumers with version earlier than 0.10.1.0 may need to " +
                                        "increase their fetch sizes.",
                                partition, batch.lastOffset(), maxRecordBatchSize, filteredBatchSize);

                    MemoryRecordsBuilder.RecordsInfo info = builder.info();
                    filterResult.updateRetainedBatchMetadata(info.maxTimestamp, info.shallowOffsetOfMaxTimestamp,
                            maxOffset, retainedRecords.size(), filteredBatchSize);
                }
            } else if (batchRetention == BatchRetention.RETAIN_EMPTY) {
                if (batchMagic < RecordBatch.MAGIC_VALUE_V2)
                    throw new IllegalStateException("Empty batches are only supported for magic v2 and above");

                bufferOutputStream.ensureRemaining(DefaultRecordBatch.RECORD_BATCH_OVERHEAD);
                DefaultRecordBatch.writeEmptyHeader(bufferOutputStream.buffer(), batchMagic, batch.producerId(),
                        batch.producerEpoch(), batch.baseSequence(), batch.baseOffset(), batch.lastOffset(),
                        batch.partitionLeaderEpoch(), batch.timestampType(), batch.maxTimestamp(),
                        batch.isTransactional(), batch.isControlBatch());
                filterResult.updateRetainedBatchMetadata(batch, 0, true);
            }

            // If we had to allocate a new buffer to fit the filtered buffer (see KAFKA-5316), return early to
            // avoid the need for additional allocations.
            ByteBuffer outputBuffer = bufferOutputStream.buffer();
            if (outputBuffer != destinationBuffer) {
                filterResult.outputBuffer = outputBuffer;
                return filterResult;
            }
        }

        return filterResult;
    }

    private static BatchFilterResult filterBatch(RecordBatch batch,
                                                 BufferSupplier decompressionBufferSupplier,
                                                 FilterResult filterResult,
                                                 RecordFilter filter,
                                                 byte batchMagic,
                                                 boolean writeOriginalBatch,
                                                 List<Record> retainedRecords) {
        long maxOffset = -1;
        boolean containsTombstones = false;
        try (final CloseableIterator<Record> iterator = batch.streamingIterator(decompressionBufferSupplier)) {
            while (iterator.hasNext()) {
                Record record = iterator.next();
                filterResult.messagesRead += 1;

                if (filter.shouldRetainRecord(batch, record)) {
                    // Check for log corruption due to KAFKA-4298. If we find it, make sure that we overwrite
                    // the corrupted batch with correct data.
                    if (!record.hasMagic(batchMagic))
                        writeOriginalBatch = false;

                    if (record.offset() > maxOffset)
                        maxOffset = record.offset();

                    retainedRecords.add(record);

                    if (!record.hasValue()) {
                        containsTombstones = true;
                    }
                } else {
                    writeOriginalBatch = false;
                }
            }
            return new BatchFilterResult(writeOriginalBatch, containsTombstones, maxOffset);
        }
    }

    private static class BatchFilterResult {
        private final boolean writeOriginalBatch;
        private final boolean containsTombstones;
        private final long maxOffset;
        private BatchFilterResult(final boolean writeOriginalBatch,
                                 final boolean containsTombstones,
                                 final long maxOffset) {
            this.writeOriginalBatch = writeOriginalBatch;
            this.containsTombstones = containsTombstones;
            this.maxOffset = maxOffset;
        }
    }

    private static MemoryRecordsBuilder buildRetainedRecordsInto(RecordBatch originalBatch,
                                                                 List<Record> retainedRecords,
                                                                 ByteBufferOutputStream bufferOutputStream,
                                                                 final long deleteHorizonMs) {
        byte magic = originalBatch.magic();
        TimestampType timestampType = originalBatch.timestampType();
        long logAppendTime = timestampType == TimestampType.LOG_APPEND_TIME ?
                originalBatch.maxTimestamp() : RecordBatch.NO_TIMESTAMP;
        long baseOffset = magic >= RecordBatch.MAGIC_VALUE_V2 ?
                originalBatch.baseOffset() : retainedRecords.get(0).offset();

        MemoryRecordsBuilder builder = new MemoryRecordsBuilder(bufferOutputStream, magic,
                originalBatch.compressionType(), timestampType, baseOffset, logAppendTime, originalBatch.producerId(),
                originalBatch.producerEpoch(), originalBatch.baseSequence(), originalBatch.isTransactional(),
                originalBatch.isControlBatch(), originalBatch.partitionLeaderEpoch(), bufferOutputStream.limit(), deleteHorizonMs);

        for (Record record : retainedRecords)
            builder.append(record);

        if (magic >= RecordBatch.MAGIC_VALUE_V2)
            // we must preserve the last offset from the initial batch in order to ensure that the
            // last sequence number from the batch remains even after compaction. Otherwise, the producer
            // could incorrectly see an out of sequence error.
            builder.overrideLastOffset(originalBatch.lastOffset());

        return builder;
    }

    /**
     * Get the byte buffer that backs this instance for reading.
     */
    public ByteBuffer buffer() {
        return buffer.duplicate();
    }

    @Override
    public Iterable<MutableRecordBatch> batches() {
        return batches;
    }

    @Override
    public String toString() {
        return "MemoryRecords(size=" + sizeInBytes() +
                ", buffer=" + buffer +
                ")";
    }

    @Override
    public boolean equals(Object o) {
        if (this == o)
            return true;
        if (o == null || getClass() != o.getClass())
            return false;

        MemoryRecords that = (MemoryRecords) o;

        return buffer.equals(that.buffer);
    }

    @Override
    public int hashCode() {
        return buffer.hashCode();
    }

    public static abstract class RecordFilter {
        public final long currentTime;
        public final long deleteRetentionMs;

        public RecordFilter(final long currentTime, final long deleteRetentionMs) {
            this.currentTime = currentTime;
            this.deleteRetentionMs = deleteRetentionMs;
        }

        public static class BatchRetentionResult {
            public final BatchRetention batchRetention;
            public final boolean containsMarkerForEmptyTxn;
            public BatchRetentionResult(final BatchRetention batchRetention,
                                        final boolean containsMarkerForEmptyTxn) {
                this.batchRetention = batchRetention;
                this.containsMarkerForEmptyTxn = containsMarkerForEmptyTxn;
            }
        }

        public enum BatchRetention {
            DELETE, // Delete the batch without inspecting records
            RETAIN_EMPTY, // Retain the batch even if it is empty
            DELETE_EMPTY  // Delete the batch if it is empty
        }

        /**
         * Check whether the full batch can be discarded (i.e. whether we even need to
         * check the records individually).
         */
        protected abstract BatchRetentionResult checkBatchRetention(RecordBatch batch);

        /**
         * Check whether a record should be retained in the log. Note that {@link #checkBatchRetention(RecordBatch)}
         * is used prior to checking individual record retention. Only records from batches which were not
         * explicitly discarded with {@link BatchRetention#DELETE} will be considered.
         */
        protected abstract boolean shouldRetainRecord(RecordBatch recordBatch, Record record);
    }

    public static class FilterResult {
        private ByteBuffer outputBuffer;
        private int messagesRead = 0;
        // Note that `bytesRead` should contain only bytes from batches that have been processed, i.e. bytes from
        // `messagesRead` and any discarded batches.
        private int bytesRead = 0;
        private int messagesRetained = 0;
        private int bytesRetained = 0;
        private long maxOffset = -1L;
        private long maxTimestamp = RecordBatch.NO_TIMESTAMP;
        private long shallowOffsetOfMaxTimestamp = -1L;

        private FilterResult(ByteBuffer outputBuffer) {
            this.outputBuffer = outputBuffer;
        }

        private void updateRetainedBatchMetadata(MutableRecordBatch retainedBatch, int numMessagesInBatch, boolean headerOnly) {
            int bytesRetained = headerOnly ? DefaultRecordBatch.RECORD_BATCH_OVERHEAD : retainedBatch.sizeInBytes();
            updateRetainedBatchMetadata(retainedBatch.maxTimestamp(), retainedBatch.lastOffset(),
                    retainedBatch.lastOffset(), numMessagesInBatch, bytesRetained);
        }

        private void updateRetainedBatchMetadata(long maxTimestamp, long shallowOffsetOfMaxTimestamp, long maxOffset,
                                                int messagesRetained, int bytesRetained) {
            validateBatchMetadata(maxTimestamp, shallowOffsetOfMaxTimestamp, maxOffset);
            if (maxTimestamp > this.maxTimestamp) {
                this.maxTimestamp = maxTimestamp;
                this.shallowOffsetOfMaxTimestamp = shallowOffsetOfMaxTimestamp;
            }
            this.maxOffset = Math.max(maxOffset, this.maxOffset);
            this.messagesRetained += messagesRetained;
            this.bytesRetained += bytesRetained;
        }

        private void validateBatchMetadata(long maxTimestamp, long shallowOffsetOfMaxTimestamp, long maxOffset) {
            if (maxTimestamp != RecordBatch.NO_TIMESTAMP && shallowOffsetOfMaxTimestamp < 0)
                throw new IllegalArgumentException("shallowOffset undefined for maximum timestamp " + maxTimestamp);
            if (maxOffset < 0)
                throw new IllegalArgumentException("maxOffset undefined");
        }

        public ByteBuffer outputBuffer() {
            return outputBuffer;
        }

        public int messagesRead() {
            return messagesRead;
        }

        public int bytesRead() {
            return bytesRead;
        }

        public int messagesRetained() {
            return messagesRetained;
        }

        public int bytesRetained() {
            return bytesRetained;
        }

        public long maxOffset() {
            return maxOffset;
        }

        public long maxTimestamp() {
            return maxTimestamp;
        }

        public long shallowOffsetOfMaxTimestamp() {
            return shallowOffsetOfMaxTimestamp;
        }
    }

    public static MemoryRecords readableRecords(ByteBuffer buffer) {
        return new MemoryRecords(buffer);
    }

    public static MemoryRecordsBuilder builder(ByteBuffer buffer,
                                               CompressionType compressionType,
                                               TimestampType timestampType,
                                               long baseOffset) {
        return builder(buffer, RecordBatch.CURRENT_MAGIC_VALUE, compressionType, timestampType, baseOffset);
    }

    public static MemoryRecordsBuilder builder(ByteBuffer buffer,
                                               CompressionType compressionType,
                                               TimestampType timestampType,
                                               long baseOffset,
                                               int maxSize) {
        long logAppendTime = RecordBatch.NO_TIMESTAMP;
        if (timestampType == TimestampType.LOG_APPEND_TIME)
            logAppendTime = System.currentTimeMillis();

        return new MemoryRecordsBuilder(buffer, RecordBatch.CURRENT_MAGIC_VALUE, compressionType, timestampType, baseOffset,
            logAppendTime, RecordBatch.NO_PRODUCER_ID, RecordBatch.NO_PRODUCER_EPOCH, RecordBatch.NO_SEQUENCE,
            false, false, RecordBatch.NO_PARTITION_LEADER_EPOCH, maxSize);
    }

    public static MemoryRecordsBuilder idempotentBuilder(ByteBuffer buffer,
                                                         CompressionType compressionType,
                                                         long baseOffset,
                                                         long producerId,
                                                         short producerEpoch,
                                                         int baseSequence) {
        return builder(buffer, RecordBatch.CURRENT_MAGIC_VALUE, compressionType, TimestampType.CREATE_TIME,
                baseOffset, System.currentTimeMillis(), producerId, producerEpoch, baseSequence);
    }

    public static MemoryRecordsBuilder builder(ByteBuffer buffer,
                                               byte magic,
                                               CompressionType compressionType,
                                               TimestampType timestampType,
                                               long baseOffset,
                                               long logAppendTime) {
        return builder(buffer, magic, compressionType, timestampType, baseOffset, logAppendTime,
                RecordBatch.NO_PRODUCER_ID, RecordBatch.NO_PRODUCER_EPOCH, RecordBatch.NO_SEQUENCE, false,
                RecordBatch.NO_PARTITION_LEADER_EPOCH);
    }

    public static MemoryRecordsBuilder builder(ByteBuffer buffer,
                                               byte magic,
                                               CompressionType compressionType,
                                               TimestampType timestampType,
                                               long baseOffset) {
        long logAppendTime = RecordBatch.NO_TIMESTAMP;
        if (timestampType == TimestampType.LOG_APPEND_TIME)
            logAppendTime = System.currentTimeMillis();
        return builder(buffer, magic, compressionType, timestampType, baseOffset, logAppendTime,
                RecordBatch.NO_PRODUCER_ID, RecordBatch.NO_PRODUCER_EPOCH, RecordBatch.NO_SEQUENCE, false,
                RecordBatch.NO_PARTITION_LEADER_EPOCH);
    }

    public static MemoryRecordsBuilder builder(ByteBuffer buffer,
                                               byte magic,
                                               CompressionType compressionType,
                                               TimestampType timestampType,
                                               long baseOffset,
                                               long logAppendTime,
                                               int partitionLeaderEpoch) {
        return builder(buffer, magic, compressionType, timestampType, baseOffset, logAppendTime,
                RecordBatch.NO_PRODUCER_ID, RecordBatch.NO_PRODUCER_EPOCH, RecordBatch.NO_SEQUENCE, false, partitionLeaderEpoch);
    }

    public static MemoryRecordsBuilder builder(ByteBuffer buffer,
                                               CompressionType compressionType,
                                               long baseOffset,
                                               long producerId,
                                               short producerEpoch,
                                               int baseSequence,
                                               boolean isTransactional) {
        return builder(buffer, RecordBatch.CURRENT_MAGIC_VALUE, compressionType, TimestampType.CREATE_TIME, baseOffset,
                RecordBatch.NO_TIMESTAMP, producerId, producerEpoch, baseSequence, isTransactional,
                RecordBatch.NO_PARTITION_LEADER_EPOCH);
    }

    public static MemoryRecordsBuilder builder(ByteBuffer buffer,
                                               byte magic,
                                               CompressionType compressionType,
                                               TimestampType timestampType,
                                               long baseOffset,
                                               long logAppendTime,
                                               long producerId,
                                               short producerEpoch,
                                               int baseSequence) {
        return builder(buffer, magic, compressionType, timestampType, baseOffset, logAppendTime,
                producerId, producerEpoch, baseSequence, false, RecordBatch.NO_PARTITION_LEADER_EPOCH);
    }

    public static MemoryRecordsBuilder builder(ByteBuffer buffer,
                                               byte magic,
                                               CompressionType compressionType,
                                               TimestampType timestampType,
                                               long baseOffset,
                                               long logAppendTime,
                                               long producerId,
                                               short producerEpoch,
                                               int baseSequence,
                                               boolean isTransactional,
                                               int partitionLeaderEpoch) {
        return builder(buffer, magic, compressionType, timestampType, baseOffset,
                logAppendTime, producerId, producerEpoch, baseSequence, isTransactional, false, partitionLeaderEpoch);
    }

    public static MemoryRecordsBuilder builder(ByteBuffer buffer,
                                               byte magic,
                                               CompressionType compressionType,
                                               TimestampType timestampType,
                                               long baseOffset,
                                               long logAppendTime,
                                               long producerId,
                                               short producerEpoch,
                                               int baseSequence,
                                               boolean isTransactional,
                                               boolean isControlBatch,
                                               int partitionLeaderEpoch) {
        return new MemoryRecordsBuilder(buffer, magic, compressionType, timestampType, baseOffset,
                logAppendTime, producerId, producerEpoch, baseSequence, isTransactional, isControlBatch, partitionLeaderEpoch,
                buffer.remaining());
    }

    public static MemoryRecords withRecords(CompressionType compressionType, SimpleRecord... records) {
        return withRecords(RecordBatch.CURRENT_MAGIC_VALUE, compressionType, records);
    }

    public static MemoryRecords withRecords(CompressionType compressionType, int partitionLeaderEpoch, SimpleRecord... records) {
        return withRecords(RecordBatch.CURRENT_MAGIC_VALUE, 0L, compressionType, TimestampType.CREATE_TIME,
                RecordBatch.NO_PRODUCER_ID, RecordBatch.NO_PRODUCER_EPOCH, RecordBatch.NO_SEQUENCE,
                partitionLeaderEpoch, false, records);
    }

    public static MemoryRecords withRecords(byte magic, CompressionType compressionType, SimpleRecord... records) {
        return withRecords(magic, 0L, compressionType, TimestampType.CREATE_TIME, records);
    }

    public static MemoryRecords withRecords(long initialOffset, CompressionType compressionType, SimpleRecord... records) {
        return withRecords(RecordBatch.CURRENT_MAGIC_VALUE, initialOffset, compressionType, TimestampType.CREATE_TIME,
                records);
    }

    public static MemoryRecords withRecords(byte magic, long initialOffset, CompressionType compressionType, SimpleRecord... records) {
        return withRecords(magic, initialOffset, compressionType, TimestampType.CREATE_TIME, records);
    }

    public static MemoryRecords withRecords(long initialOffset, CompressionType compressionType, Integer partitionLeaderEpoch, SimpleRecord... records) {
        return withRecords(RecordBatch.CURRENT_MAGIC_VALUE, initialOffset, compressionType, TimestampType.CREATE_TIME, RecordBatch.NO_PRODUCER_ID,
                RecordBatch.NO_PRODUCER_EPOCH, RecordBatch.NO_SEQUENCE, partitionLeaderEpoch, false, records);
    }

    public static MemoryRecords withIdempotentRecords(CompressionType compressionType, long producerId,
                                                      short producerEpoch, int baseSequence, SimpleRecord... records) {
        return withRecords(RecordBatch.CURRENT_MAGIC_VALUE, 0L, compressionType, TimestampType.CREATE_TIME, producerId, producerEpoch,
                baseSequence, RecordBatch.NO_PARTITION_LEADER_EPOCH, false, records);
    }

    public static MemoryRecords withIdempotentRecords(byte magic, long initialOffset, CompressionType compressionType,
                                                      long producerId, short producerEpoch, int baseSequence,
                                                      int partitionLeaderEpoch, SimpleRecord... records) {
        return withRecords(magic, initialOffset, compressionType, TimestampType.CREATE_TIME, producerId, producerEpoch,
                baseSequence, partitionLeaderEpoch, false, records);
    }

    public static MemoryRecords withIdempotentRecords(long initialOffset, CompressionType compressionType, long producerId,
                                                      short producerEpoch, int baseSequence, int partitionLeaderEpoch,
                                                      SimpleRecord... records) {
        return withRecords(RecordBatch.CURRENT_MAGIC_VALUE, initialOffset, compressionType, TimestampType.CREATE_TIME,
                producerId, producerEpoch, baseSequence, partitionLeaderEpoch, false, records);
    }

    public static MemoryRecords withTransactionalRecords(CompressionType compressionType, long producerId,
                                                         short producerEpoch, int baseSequence, SimpleRecord... records) {
        return withRecords(RecordBatch.CURRENT_MAGIC_VALUE, 0L, compressionType, TimestampType.CREATE_TIME,
                producerId, producerEpoch, baseSequence, RecordBatch.NO_PARTITION_LEADER_EPOCH, true, records);
    }

    public static MemoryRecords withTransactionalRecords(byte magic, long initialOffset, CompressionType compressionType,
                                                         long producerId, short producerEpoch, int baseSequence,
                                                         int partitionLeaderEpoch, SimpleRecord... records) {
        return withRecords(magic, initialOffset, compressionType, TimestampType.CREATE_TIME, producerId, producerEpoch,
                baseSequence, partitionLeaderEpoch, true, records);
    }

    public static MemoryRecords withTransactionalRecords(long initialOffset, CompressionType compressionType, long producerId,
                                                         short producerEpoch, int baseSequence, int partitionLeaderEpoch,
                                                         SimpleRecord... records) {
        return withTransactionalRecords(RecordBatch.CURRENT_MAGIC_VALUE, initialOffset, compressionType,
                producerId, producerEpoch, baseSequence, partitionLeaderEpoch, records);
    }

    public static MemoryRecords withRecords(byte magic, long initialOffset, CompressionType compressionType,
                                            TimestampType timestampType, SimpleRecord... records) {
        return withRecords(magic, initialOffset, compressionType, timestampType, RecordBatch.NO_PRODUCER_ID,
                RecordBatch.NO_PRODUCER_EPOCH, RecordBatch.NO_SEQUENCE, RecordBatch.NO_PARTITION_LEADER_EPOCH,
                false, records);
    }

    public static MemoryRecords withRecords(byte magic, long initialOffset, CompressionType compressionType,
                                            TimestampType timestampType, long producerId, short producerEpoch,
                                            int baseSequence, int partitionLeaderEpoch, boolean isTransactional,
                                            SimpleRecord... records) {
        if (records.length == 0)
            return MemoryRecords.EMPTY;
        int sizeEstimate = AbstractRecords.estimateSizeInBytes(magic, compressionType, Arrays.asList(records));
        ByteBufferOutputStream bufferStream = new ByteBufferOutputStream(sizeEstimate);
        long logAppendTime = RecordBatch.NO_TIMESTAMP;
        if (timestampType == TimestampType.LOG_APPEND_TIME)
            logAppendTime = System.currentTimeMillis();
        MemoryRecordsBuilder builder = new MemoryRecordsBuilder(bufferStream, magic, compressionType, timestampType,
                initialOffset, logAppendTime, producerId, producerEpoch, baseSequence, isTransactional, false,
                partitionLeaderEpoch, sizeEstimate);
        for (SimpleRecord record : records)
            builder.append(record);
        return builder.build();
    }

    public static MemoryRecords withEndTransactionMarker(long producerId, short producerEpoch, EndTransactionMarker marker) {
        return withEndTransactionMarker(0L, System.currentTimeMillis(), RecordBatch.NO_PARTITION_LEADER_EPOCH,
                producerId, producerEpoch, marker);
    }

    public static MemoryRecords withEndTransactionMarker(long timestamp, long producerId, short producerEpoch,
                                                         EndTransactionMarker marker) {
        return withEndTransactionMarker(0L, timestamp, RecordBatch.NO_PARTITION_LEADER_EPOCH, producerId,
                producerEpoch, marker);
    }

    public static MemoryRecords withEndTransactionMarker(long initialOffset, long timestamp, int partitionLeaderEpoch,
                                                         long producerId, short producerEpoch,
                                                         EndTransactionMarker marker) {
        int endTxnMarkerBatchSize = DefaultRecordBatch.RECORD_BATCH_OVERHEAD +
                EndTransactionMarker.CURRENT_END_TXN_SCHEMA_RECORD_SIZE;
        ByteBuffer buffer = ByteBuffer.allocate(endTxnMarkerBatchSize);
        writeEndTransactionalMarker(buffer, initialOffset, timestamp, partitionLeaderEpoch, producerId,
                producerEpoch, marker);
        buffer.flip();
        return MemoryRecords.readableRecords(buffer);
    }

    public static void writeEndTransactionalMarker(ByteBuffer buffer, long initialOffset, long timestamp,
                                                   int partitionLeaderEpoch, long producerId, short producerEpoch,
                                                   EndTransactionMarker marker) {
        boolean isTransactional = true;
        try (MemoryRecordsBuilder builder = new MemoryRecordsBuilder(buffer, RecordBatch.CURRENT_MAGIC_VALUE, CompressionType.NONE,
                TimestampType.CREATE_TIME, initialOffset, timestamp, producerId, producerEpoch,
                RecordBatch.NO_SEQUENCE, isTransactional, true, partitionLeaderEpoch,
                buffer.capacity())
        ) {
            builder.appendEndTxnMarker(timestamp, marker);
        }
    }

    public static MemoryRecords withLeaderChangeMessage(
        long initialOffset,
        long timestamp,
        int leaderEpoch,
        ByteBuffer buffer,
        LeaderChangeMessage leaderChangeMessage
    ) {
        writeLeaderChangeMessage(buffer, initialOffset, timestamp, leaderEpoch, leaderChangeMessage);
        buffer.flip();
        return MemoryRecords.readableRecords(buffer);
    }

    private static void writeLeaderChangeMessage(ByteBuffer buffer,
                                                 long initialOffset,
                                                 long timestamp,
                                                 int leaderEpoch,
                                                 LeaderChangeMessage leaderChangeMessage) {
        try (MemoryRecordsBuilder builder = new MemoryRecordsBuilder(
            buffer, RecordBatch.CURRENT_MAGIC_VALUE, CompressionType.NONE,
            TimestampType.CREATE_TIME, initialOffset, timestamp,
            RecordBatch.NO_PRODUCER_ID, RecordBatch.NO_PRODUCER_EPOCH, RecordBatch.NO_SEQUENCE,
            false, true, leaderEpoch, buffer.capacity())
        ) {
            builder.appendLeaderChangeMessage(timestamp, leaderChangeMessage);
        }
    }

    public static MemoryRecords withSnapshotHeaderRecord(
        long initialOffset,
        long timestamp,
        int leaderEpoch,
        ByteBuffer buffer,
        SnapshotHeaderRecord snapshotHeaderRecord
    ) {
        writeSnapshotHeaderRecord(buffer, initialOffset, timestamp, leaderEpoch, snapshotHeaderRecord);
        buffer.flip();
        return MemoryRecords.readableRecords(buffer);
    }

    private static void writeSnapshotHeaderRecord(ByteBuffer buffer,
        long initialOffset,
        long timestamp,
        int leaderEpoch,
        SnapshotHeaderRecord snapshotHeaderRecord
    ) {
        try (MemoryRecordsBuilder builder = new MemoryRecordsBuilder(
            buffer, RecordBatch.CURRENT_MAGIC_VALUE, CompressionType.NONE,
            TimestampType.CREATE_TIME, initialOffset, timestamp,
            RecordBatch.NO_PRODUCER_ID, RecordBatch.NO_PRODUCER_EPOCH, RecordBatch.NO_SEQUENCE,
            false, true, leaderEpoch, buffer.capacity())
        ) {
            builder.appendSnapshotHeaderMessage(timestamp, snapshotHeaderRecord);
        }
    }

    public static MemoryRecords withSnapshotFooterRecord(
        long initialOffset,
        long timestamp,
        int leaderEpoch,
        ByteBuffer buffer,
        SnapshotFooterRecord snapshotFooterRecord
    ) {
        writeSnapshotFooterRecord(buffer, initialOffset, timestamp, leaderEpoch, snapshotFooterRecord);
        buffer.flip();
        return MemoryRecords.readableRecords(buffer);
    }

    private static void writeSnapshotFooterRecord(ByteBuffer buffer,
        long initialOffset,
        long timestamp,
        int leaderEpoch,
        SnapshotFooterRecord snapshotFooterRecord
    ) {
        try (MemoryRecordsBuilder builder = new MemoryRecordsBuilder(
            buffer, RecordBatch.CURRENT_MAGIC_VALUE, CompressionType.NONE,
            TimestampType.CREATE_TIME, initialOffset, timestamp,
            RecordBatch.NO_PRODUCER_ID, RecordBatch.NO_PRODUCER_EPOCH, RecordBatch.NO_SEQUENCE,
            false, true, leaderEpoch, buffer.capacity())
        ) {
            builder.appendSnapshotFooterMessage(timestamp, snapshotFooterRecord);
        }
    }
}


•	There are no formulaic answers, however, you can benefit from a systematic approach to both your preparation and strategy planning conversations.
•	Markets are dynamic so be disciplined in your strategy thinking. Challenge and test your basic assumptions – even if they are producing good results. Things change.
•	Strategy requires clear choices and resource commitment. Each decision either reinforces or weakens the whole. The strength of how the decisions weave together form the fabric of compelling business models (think IKEA, The Container Store and Southwest Airlines).
You are currently browsing the archives for the Strategic Planning category.