text:
Home Member Directory See and Do Nature & Adventure Gary's Surf School
Gary's Surf School
Established in 1989, Gary's Surf School has built a 25 year reputation for being personally involved with many of the young local talents hitting the waters today. Situated in Muizenberg, the Gary's is perfect for those wanting to learn how to surf the great waves in Cape Town.
Aside from offering surfing lessons, Gary's is perfect for a stag do, a hen party, a fun corporate outing or a birthday party. The school also hosts surf camps with daily lessons, seven nights of accommodation, free use of equipment and packages to suit your skill level. Guided surf tours around the Cape Peninsula are available, letting you learn about the best spots and breaks, while sandboarding offers a slight change of scenery for those keen to take a break from the water. On sale too are boards, wetsuits, towels and more, meaning this is one of the most complete and best surf schools in Cape Town.
Has been doing surfing lessons and coaching for over 25 years
Guided surf tours around the Cape Peninsula as well as sand boarding lessons
Perfect for birthday parties, corporate teambuilding exercises and hen and bachelor parties
34 Balmoral Building Beach Road, Muizenberg 7945 Cape Town
gary@garysurf.com
http://www.garysurf.co.za/
Schapenberg Sir Lowry's Conservancy
City Area: Beyond the City, Helderberg
Schapenberg Sir Lowry's Conservancy allows guests to tackle walks and hikes on Sir Lowry's Pass with Green Flag status, an award given by the...
Two Oceans Aquarium
City Area: Atlantic Seaboard
The Atlantic and Indian Oceans meet with great triumph at the southern tip of Africa, and where better place to celebrate the diverse marine...
Cape Sports Centre Langebaan
City Area: Beyond the City, Cape West Coast
Set on the shores of Langebaan Lagoon's crisp and inviting waters, the Cape Sports Centre offers a wide range of water sport activities. Spend...
Segway Tours Cape Town
A vineyard tour with a difference. Segways are a fun and exciting way for the whole family (10 yrs+) to see the winelands.
Montebello Design Centre
City Area: Southern Suburbs
One of Cape Town's best-kept secrets, Montebello Design Centre offers more than 20 arts and crafts studios and workshops, a historic greenhouse and nursery...
Cape Philharmonic Orchestra
Composed of some of the finest musicians in Cape Town, the Cape Philharmonic Orchestra is the epitome of talent and skill. Founded in 1914,...
The Parks Shop at Cape Point
City Area: South Peninsula
Located at Cape Point, within the Table Mountain National Park, the Parks Shop celebrates its home within the floral kingdom by offering locally made...
Cape Town Ostrich Ranch
For everything ostrich, you are bound to find no better than the Cape Town Ostrich Ranch. Located just a mere 20 minutes from the...


NLC India Ltd has awarded projects worth Rs.6,480 crore to BGR Energy Systems and Reliance Infrastructure Ltd.
Larsen & Toubro´s Metallurgical and Material Handling (MMH) business has won new orders worth Rs 2,030 crore in steel, port and bulk material handling sectors during the second quarter of 2014-15.
McNally Bharat (MBE), one of the leading EPC companies in India, is celebrating its Golden Anniversary in 2011. MBE started operations in a small way in 1961 in Kumardhubi, Dhanbad, where it manufactured equipment for the coal and mining industry.


text:
Best in the Press
Become a Member, Donate Online →
Posts by Michael Barvick
How You Can Use Your IRA to Save America
by Michael Barvick - January 17, 2013
In Other Work of Note
Have you often wished you could use IRA funds to make a gift to your favorite charity without it being treated as a taxable withdrawal? Now you can. But time is short—you have until January 31, 2013 to make your IRA contribution for the 2012 tax year.
Time is running out for you to make a special gift in support of The Heritage Foundation. You can donate up to $100,000 from your IRA tax free for the 2012 tax year!
Read more about this unique opportunity for individuals over the age of 70 ½, which expires January 31, 2013.
G. L. Carter–Morristown, TN
by Michael Barvick - May 10, 2012
In Member Stories
G.L. Carter
George Washington, Ronald Reagan, and even Elvis Presley left legacies that have permanently changed America. But you don't have to live a life in the spotlight to leave a legacy. Heritage member G.L. Carter is a prime example of someone who, like many of us, has worked hard and lived the American Dream. Today, he is committed to leaving a powerful legacy behind.
In fact, well over 1,700 Americans just like you have decided to leave a legacy of freedom by including The Heritage Foundation in their will or trust and joining the Heritage Legacy Society. The Heritage Legacy Society was created to help facilitate the estate planning process for members and can even provide a complimentary Wills Planner (see form below).
The story behind G.L.'s legacy began with a run-in at the tender age of 12 with the Tennessee Valley Authority. The TVA, one of the most controversial agencies created under Franklin Roosevelt's New deal, confiscated the land his family was farming. This was his first experience with the intrusive nature of government. Continue Reading »
How Your Small Business Can Save the American Dream
by Michael Barvick - October 28, 2011
Rep. Paul Ryan (R-WI) explains his plan to get America back on track at The Heritage Foundation Wednesday. Photo: Chas Geer
Small businesses are the life blood of the American economy. They produce over 50 percent of jobs created annually. However, in the Obama "jobs bill," small businesses would be devastated.
In a speech Wednesday at The Heritage Foundation, Rep. Paul Ryan (R-WI) explained that 75 percent of small business owners report their business income on their individual tax returns. President Obama wants to tax individuals making over $200,000, meaning that most small businesses in America would be facing a tax increase. This would be a huge blow to potential growth in an already anemic economy.
The Heritage Foundation understands the important role entrepreneurs and small businesses play in our country's success. Heritage works hard to defend the freedom necessary for entrepreneurs to succeed.
If you are a small business owner or entrepreneur, you may have a unique opportunity to support Heritage's crucial work while also receiving significant tax benefits. Continue Reading »
Heritage Legacy Society Members Celebrate America's First Principles
by Michael Barvick - September 15, 2011
Sen. Rand Paul (R-KY) addresses members of Heritage's Legacy Society at the National Archives this week during a series of events on the importance of America's first principles. Photo: David Bohrer
What do the ideas of Thomas Jefferson, John Adams and James Madison have to do with making an estate plan?
The Heritage Foundation has led the defense and promotion of the first principles that inspired our founders for almost four decades. And thanks to members of the Heritage Legacy Society, members who have included Heritage in their estate plans, we will continue to do so for generations to come.
This connection between our enduring founding principles and an enduring Heritage Foundation were front and center earlier this week as Heritage members attended the Preserving America's First Principles Seminar in Washington, DC. Continue Reading »
Another Way You Can Pass on the Legacy of Freedom to the Next Generation
As conservatives we believe in being responsible stewards of our possessions in order to pass along as much as possible to our family, friends or the causes we champion. We have a moral imperative to hand our children and grandchildren at least the same opportunities that we received from our ancestors.
Last week The Heritage Foundation introduced our "Saving the American Dream" plan to fix the nation's debt, cut spending and restore prosperity. This plan lays out practical and effective ways to fix our country's financial situation. It is essentially a plan about building a better America for the next generation.
It is in this spirit that I wanted to make you aware of the Wills Planner that our Heritage Legacy Society is now offering as a free service to all Heritage members. Continue Reading »
10 More Days to Support Heritage through Your IRA
It's not often that Congress passes legislation that actually helps Heritage advance conservative principles, but that's exactly what happened when last year's IRA Charitable Rollover provision was extended. That's the good news! The bad news is that the extension to deduct for your 2010 taxes will expire on January 31.
If you are 70 ½ and have an IRA you are required by law to make a minimum distribution each year. This distribution is considered income and is taxable. However, thanks to the IRA Charitable Rollover provision individuals are able to make distributions as high as $100,000 from their IRA to charity without incurring a tax on that distribution.
If you qualify for this opportunity and would like to support The Heritage Foundation please call our Heritage Legacy Society office at (800) 409-2003 if you have any questions. Generally, all that's required is a call to your IRA custodian authorizing them to make a gift directly to Heritage. It would also be helpful if you notified Heritage of your intentions so that we can accurately credit the gift to you once it's received.
How You Can Support Heritage through Your IRA
by Michael Barvick - December 21, 2010
One element of the tax bill enacted last week is great news for conservatives. If you are 70½ years of age or older you can make a tax-free gift to The Heritage Foundation from your IRA.
But you have to act quickly to take advantage of this opportunity. Call our call our Gift Planning Office toll-free at (800) 409-2003 to learn more.
For tax year 2010, you may again make tax-free gifts directly to qualified charities directly from your traditional or Roth IRAs, in any amount up to $100,000. If you are married with separate IRAs, you and your spouse can each make gifts up to $100,000.
Let me give you an example of how this might work. Continue Reading »
Sign Up for Heritage E-mails
Sign up for regular updates on Heritage's activities and impact.
What You'll Find Here
Heritage Impact - Reports on how Heritage is changing the debate in Washington, in the media, and around the country.
Heritage Work - Updates on Heritage Foundation research, analysis and other work to advance conservative principles in Washington and around the country.
Member Stories - Profiles of Heritage Foundation members from around the nation featuring their stories and why they support Heritage and conservative ideas.
Other Work of Note
Ways to Stay Connected
Connect on Facebook Follow Us on Twitter Subscribe to RSS
Latest @Heritage Tweets
About myHeritage
myHeritage is the online home for Heritage Foundation members, a resource that explains how Heritage and Heritage members are making a difference in advancing conservative ideas..
About The Heritage Foundation
Signup for Heritage Emails
Donation & Membership Information
Join hundreds of thousands of conservatives as a member of The Heritage Foundation with your contribution.
Planned Gift Donations
Contact the membership office:
© 2019 The Heritage Foundation
Conservative policy research since 1973
Contact Heritage
Directions to Heritage
State Registration Disclosures
Building an America where freedom, opportunity, prosperity, and civil society flourish.
More information about The Heritage Foundation

redpajama_set_name: RedPajamaCommonCrawl


You will have seen over the weekend the extensive cyberattack known as the WannaCry malware infection and outbreak that impacted healthcare organizations, financial institutions and universities globally.
The Smiths Medical Cyber Security Engineering and Operations teams have been monitoring our systems for any signs of the WannaCry malware malicious software infections; no indicators of compromise or malware infections have been thus far discovered. In addition, we are educating our software engineering teams, and are working closely with our information services to ensure all necessary software patches are in place to protect our environment. To our knowledge, no Smiths Medical product has been affected by the WannaCry Malware infection and outbreak.
For products that are listening on network ports 139/tcp, 445/tcp or 3389/tcp, their exploitation exposure depends on the security measures within the network. In order to protect a product from exploitation it should be isolated from any infected system within its respective network segment (i.e., product deployed in a network segment separated by firewall control blocking access to network ports 139/tcp, 445/tcp and 3389/tcp).
The Smiths Medical Cyber Security Engineering team will continue to monitor the situation and provide further updates and/or suggestions if needed.


UNESCO hosts four major international programmes in Natural Sciences. One of them is the International Hydrological Programme(IHP), which is the only intergovernmental programme of the UN system devoted to water research, water resources management, and education and capacity building.
UNESCOs IHP has been implemented in six-year programmatic time intervals or phases since its foundation in 1975. Now it is entering its eighth phase to be implemented during the period 2014-2021 under the theme of Responses to Local, Regional, and Global Challenges, which focuses on six thematic areas. Theme 6 is Water Education, Key to Water Security and it consists of five focal areas as below.
Besides, Sustainable Development Goals also shows the importance of water education. For example, SDG 6.a mentions By 2030, expand international cooperation and capacity-building support to developing countries in water- and sanitation-related activities and programs, including water harvesting, desalination, water efficiency, waste water treatment, recycling and reuse technologies. Also, SDG 4.7 mentions By 2030, ensure that all learners acquire the knowledge and skills needed to promote sustainable development, including, among others, through education for sustainable development and sustainable lifestyles, human rights, gender equality, promotion of a culture of peace and non-violence, global citizenship and appreciation of cultural diversity and of cultures contribution to sustainable development.
In this backdrop, Centre will design education programs to meet specific needs in developing countries focusing on case study and study visit, and operate programs to contribute to enhancing developing countries capacity of addressing water issues.
2018 Workshop for Specialist on Smart Water Management in Central Asi..
2018 Capacity Building Program for the Improvement of Water Security i..
Global Technical Exchange in Floodplain Modeling and Shared Vision Pla..
2018 Knowledge and Experience Sharing Program of Korea Water Resources..
Capacity Building Program for the Improvement of Water Security in ASI..


Mineral deficiencies aren't the only problem resulting from Atkins' Diet. One consequence of cutting out carbohydrates is that many people fill up on meat instead. Bad idea: meat tends to be higher in protein than carbohydrates of the same weight, resulting in excessive protein intake for some Atkins' devotees. The result: many people are overloading their kidneys, with potentially dangerous consequences. One 11-year U.S study showed that in female patients who already suffer from mild kidney disease, those who ate a diet high in meat proteins were at significantly greater risk of renal failure. Elizabeth Ward, of the British Kidney Patient Association (BKPA) recommended that "people who are thinking of trying one of these diets should go to their GP for a urine test which would pick up 90% of problems".
But scientists are in disagreement over the dangers of the Atkins' Diet. The Food Standards Agency, which is responsible for all the Government's nutritional guidance, published a statement in September alerting the public to the health risks of low–carbohydrate diets, including the Atkins' Diet, claiming that they are linked to heart disease, cancer and even obesity. However they notably ignored the qualms over kidney damage, a snub for BKPA and a sign that not enough research has been done to allay fears and advise people over possible risks.


Below are uniform requirements and general dress guidelines. If you have questions or need assistance in providing the required uniform garments or footwear for your student, please call (630) 254-4596 or email info@emsacharter.org.
Our Uniform Basics are available online! If you are unable purchase items online or need assistance in purchasing the required uniform tops for your student, please contact us at (630) 254-4596, or email us at info@emsacharter.org. We will have order forms available during our Registration days on July 26 & 27.
The tops (including polos, t-shirts, polo dress, etc.) will have an embroidered or printed EMSA crest and will be available for purchase starting in July. We will inform our families of purchasing details once available. Please check back for more information — and thank you for your patience!
Students will wear khaki-colored bottoms that may consist of pants, skorts or "scooters" (finger tip length or longer), or finger tip length or longer shorts (non-athletic in design and only during warm temperatures). *Families are not required to purchase bottoms from any specific vendor.
Students will wear a navy blue EMSA logo wear Polo or T-shirt on top that will be purchased through the school or online. Variations include a girl's cut polo, a boys (co-ed) cut polo or a polo ruffle dress (to be worn with navy bike shorts, or "kickers" during warm weather or khaki-colored leggings).
Sweatshirts, "hoodies", and jackets that are not uniform apparel CANNOT be worn indoors during school hours. Cool weather options (including a long-sleeve t-shirt under a polo) will be available for purchase.
Students are to wear closed-toe shoes that are appropriate for outdoor and indoor activity. Athletic shoes are preferred. Students are to wear socks. White or neutral colored socks are preferred. Students will also need to keep a pair of rain boots at school for outdoor education times.
Students will be issued a basic hat to be worn during outdoor activities that include field research, hiking and extended time in a wooded or prairie settings. You may provide a wide-brimmed or bucket-styled hat appropriate for outdoor recreation if you choose.
On Field Study days, students will spend an extended time outdoors and will need to be appropriately dressed for the weather and outdoor activity. This activity may include time spent in wooded or prairie areas.
Students may wear blue jeans (finger tip length or longer shorts during hot weather) or khaki-colored pants/shorts on Fridays. Jeans may be "comfort stretch" or typical denim material.
Any EMSA top may be worn on Fridays. Outerwear does NOT need to be EMSA uniform wear, but does need to comply with the general guidelines. To be prepared for outdoor education, it is best to provide layers for your child's outerwear.
Students will be issued a basic hat to be worn during outdoor activities that include field research, hiking and extended time in a wooded or prairie setting. You may provide a wide-brimmed or bucket-styled hat appropriate for outdoor recreation if you choose. Bandanas, sun glasses, or insect-shield gear may be worn during outdoor activities as necessary.
Students are required to have proper footwear for outdoor education activities. This includes having rain boots (wellies or muck boots) available during warm and cool weather, and winter boots available during cold months.
We encourage students with long hair to wear a hairstyle appropriate for extended outdoor activity.
Students should come equipped with a reusable water bottle, especially during warm weather.
During special events, we would like to have the students all dressed in their navy blue EMSA polo (or polo dress) for consistency and uniformity. Khaki bottoms will accompany the polo on those special days. Special Days and Evening Events include, but are not limited to: First Day of School, School Pictures, Nature Night, Engineering Evening, and Celebrations of Learning.
DO NOT wear hats, coats, bandannas, sweat bands, and sun glasses in the school building during normal school and afterschool hours.
DO NOT advertise, promote, or picture alcoholic beverages, illegal drugs, drug paraphernalia, violent behavior, or other inappropriate images with your clothing, accessories or backpacks.
DO NOT display lewd, vulgar, obscene, or offensive language or symbols, including gang symbols.
DO NOT wear hair styles, dress, and accessories that pose a safety hazard in the shop, laboratories, or during physical education.
DO NOT wear shorts or skirts shorter than the length of the student's fingertips.
DO NOT wear clothing with holes, rips, tears, and clothing that is otherwise poorly fitting, sagging, showing skin and/or undergarments.
DO NOT dress in a way that causes a substantial disruption of the orderly process of school functions or endangers the health or safety of the student, other students, staff or others.
DO NOT wear flip-flops, sandals, or open-toe shoes during school days, field trips or school functions.
We are working hard to be able to provide quality and affordable options. Please check back by July 1st for more information!


text:
Q: Connecting Google Home via webhook to node.js Im following this article:
https://medium.com/google-cloud/how-to-create-a-custom-private-google-home-action-260e2c512fc
and I get this when I run npm start in my folder on my mac for testing I get this:
Marcios-MacBook-Pro:webhook mars$ npm start

> your-action-app@0.0.1 start /Users/mars/Downloads/webhook
> functions deploy yourAction --trigger-http

sh: functions: command not found

npm ERR! Darwin 16.4.0
npm ERR! argv "/usr/local/Cellar/node/7.8.0/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v7.8.0
npm ERR! npm  v4.2.0
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! your-action-app@0.0.1 start: `functions deploy yourAction --trigger-http`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the your-action-app@0.0.1 start script 'functions deploy yourAction --trigger-http'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the your-action-app package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     functions deploy yourAction --trigger-http
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs your-action-app
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls your-action-app
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/mars/.npm/_logs/2017-04-12T14_32_03_870Z-debug.log

I created the action in Api.ai and I modified the package.json to:
{
  "name": "execute-home-command",
  "description": "This is your Action's webhook",
  "version": "0.0.1",
  "private": true,
  "license": "Apache Version 2.0",
  "author": "Google Inc.",
  "engines": {
    "node": "~6.0"
  },
  "scripts": {
    "lint": "semistandard --fix \"**/*.js\"",
    "start": "functions deploy execute-home-command --trigger-http",
    "deploy": "gcloud beta functions deploy execute-home-command --trigger-http --stage-bucket <storage_bucket_name>"
  },
  "dependencies": {
    "actions-on-google": "^1.0.0"
  },
  "devDependencies": {
    "semistandard": "^9.1.0"
  }
}

Here is the action:

A: I guess you don't have npm package for functions-emulator installed.
try installing it by npm install -g @google-cloud/functions-emulator

redpajama_set_name: RedPajamaStackExchange


Tracy Voss, a classic country artist, will be performing at Music and More at the Gazebo on Main Street in Neshkoro Tuesday, July 3 from 6:30 pm until 8:30 pm. The event will have food and beverages for purchase. In cases of rain, the location will change to the Neshkoro Area Community Center, which is the Old Neshkoro Elementary School. Bring the family and be prepared to listen to some catchy tunes.


My Taiwanese employer would frequently open its doors to a variety of hustling salesmen and invite them to peddle their wares to the staff. By far the most popular of these characters was the fake Rolex man, who graced our workplace every couple of months.
The rapturous tidings "The fake Rolex man is here! The fake Rolex man is here!" accompanied by eager foot beats, would herald his arrival. The honored huckster would set up shop in the conference room next to my boss's office, and I was able to observe the stream of breathless coworkers, arriving singly or in groups, carefully appreciating the counterfeit treasures and, more often than not, emerging with small handfuls of them, grinning proudly. Returned to their desks, they enjoyed much celebrity, as others of their departments gathered around to marvel at the loot before succumbing to envy and hurrying over to see what bargains remained. It was all very amusing to me and broke the monotony of long afternoons poring over telexes.
Once during the lunch hour, on the day after a visit from the fake Rolex man, my boss, whose English name was William, took me aside. He put his arm around my shoulder.
"You know, ah, we're very concerned about you," he said.
I promised, but I was bummed. The watch I wore every day was an art-deco knockoff I'd picked up in Gongguan for twenty-five cents, and it kept perfect time; but did anyone notice? Did anyone give me any credit?
Everyone always assumed I was the maladjusted foreigner. I was tired of it.
Lol. "I didn't know what to say." Sounds like an understatement. That was hilarious, the "sacrilege" of it all.
I was a little afraid he was going to send me to a special hospital, with the antisocial way I was behaving.
Again, this made me chuckle. I had no idea that this mindset even existed!
I wonder if this still exists now. I found it amusing as I pictured William as a balding, pear-shaped man, from the way he speaks.


In order to celebrate the tools we use every day, Forbes.com has counted down the 20 most important tools of all time. It's a look at the devices that have most impacted human civilization and helped shape the course of history.
For our purposes, we decided to define a tool as a material device that provides an advantage in accomplishing a task. That eliminated things like language and software.
We decided to exclude the traditional list of "simple machines," which includes the lever, pulley, wheel and wedge, since most other tools employ some form of simple machine--a hammer is basically a lever, and an axe is essentially a wedge.
We tried where possible to limit the list to handheld or easily portable objects, eliminating most heavy machine tools, like hydraulic jacks.
We also decided to eliminate complex machines capable of essentially running themselves. That means things like cars, windmills and computer networks don't qualify.
Using those guidelines, we eventually came up with a list of more than 100 candidate tools. There was a great deal of overlap, so we collapsed similar items into a single category, and chose one tool to represent them. That left us with a final list of 33 items, each one a part of a particular class or style of tool; for instance, the spoon is representative of all eating utensils.
In July, we polled Forbes.com readers for their choice of the top tools. More than 3,000 readers responded. We then surveyed ten senior editors at Forbes.com asking them to rank their top 20. Two of our experts cast votes as well. The final rankings are a weighted-average of experts', editors' and readers' picks.
Don Norman is co-founder of the Nielsen Norman Group, a professor at Northwestern University and former vice president at Apple Computer. He serves on many advisory boards, including Chicago's Institute of Design and Encyclopedia Britannica. His books include The Design of Everyday Things and Emotional Design.
Henry Petroski is Aleksandar S. Vesic professor of civil engineering and professor of history at Duke University. He is author of the books The Pencil: A History of Design and Circumstance and The Evolution of Useful Things. He also was writer and presenter of the 1987 BBC-television documentary, To Engineer Is Human, which has been broadcast on PBS, and writes the engineering column for American Scientist.
Edward Tenner is a senior research associate of the Jerome and Dorothy Lemelson Center for the Study of Invention and Innovation at the National Museum of American History, and a researcher at Princeton University. His books include Why Things Bite Back: Technology and the Revenge of Unintended Consequences and Our Own Devices: The Past and Future of Body Technology.


1 Place the cauliflower in the container of a food processor. Cover and pulse until the cauliflower is finely chopped (about the size of rice). Set aside.
2 In a large wok, stir-fry the broccoli and squash in the sesame oil over medium-high heat for 4 to 5 minutes, or until the vegetables are crisp-tender. Reduce the heat to medium if the vegetables brown too quickly. Add the onion and stir-fry for 2 minutes more. Transfer the vegetables to a bowl; cover to keep warm.
3 To the same wok, add the ginger and garlic. Cook and stir over medium-low heat for 30 seconds. Carefully add the coconut milk, liquid aminos, vinegar, 1⁄4 teaspoon salt, and 1⁄8 teaspoon pepper. Bring to a boil. Reduce the heat to low and simmer, uncovered, for 5 minutes, or until the sauce is slightly thickened.
4 Meanwhile, in a large frying pan heat the coconut oil over medium heat. Add the cauliflower rice, the remaining 1⁄4 teaspoon salt, and the remaining 1⁄8 teaspoon pepper. Cook, stirring frequently, for 3 to 5 minutes, or until the cauliflower is just tender and starting to brown.
5 Return the vegetables to the wok. Cook and stir for 1 minute to heat through. Spoon the caulifl ower rice evenly onto two serving plates. Top with the broccoli mixture and sauce. Sprinkle with the coconut and coriander.


In the late afternoon of November 25th, 2002 a gamma–ray burst (GRB) was detected in the partially coded field of view (about from the centre) of the imager IBIS on board the INTEGRAL satellite. The instruments on-board INTEGRAL allowed, for the first time, the observation of the prompt gamma-ray emission over a broad energy band from 15 to 500 keV. GRB 021125 lasted ~24 s with a mean flux of ~5.0 photons cm-2 s-1 in the 20–500 keV energy band, and a fluence of ~ erg cm-2 in the same energy band. Here we report the analysis of the data from the imager IBIS and the spectrometer SPI.
Based on observations with INTEGRAL, an ESA project with instruments and science data centre funded by ESA member states (especially the PI countries: Denmark, France, Germany, Italy, Spain, Switzerland), Czech Republic and Poland, and with the participation of Russia and the USA.


Scott Jaffa gives an outdated Park City a complete overhaul, top to bottom, front to back.
Golden-toned timbers? Choppy floor plan? Arched windows? So yesteryear. "The house needed to be brought into the 21st-century," says architect/builder Scot Jaffa about his recent Park City remodel project, a 1991 home in Park Meadows—a Park City neighborhood enjoying sky-rocketing desirability and property values. As Jaffa explains, "People expect much more from homes here than they did years ago." A lot more. Like other residences built decades ago, the house lagged far behind in style, livability and, perhaps most importantly for the clients who purchased the investment property, resale value. The house was extremely outmoded, but it was structurally sound and had a workable envelope, so Jaffa and his clients decided to save it rather than scrap it. To transform the property, Jaffa addressed everything from architecture to design and finishes, giving this 27-year-old home a new lease on life.
Changes Made: 1. Separated the entry from the garages with an independent roof. 2. Articulated the flat facade and aded horizontal and vertical cedar siding in complementary colors. 3. Extended living space above the garages while eliminating the outdated triangular shape by creating new rooflines 4. Added windows with horizontal mullions and rectangular panes to reinforce the contemporary design.
Changes Made: 1. Replaced old windows with larger versions featuring horizontal mullions and squared-shapes that reinforce the contemporary design. 2. Changed out a closed-in staircase with a freestanding steel alternate. 3. Painted the walls with Sherwin-William's Whitetail. 4. Transformed the landing closet into an expansive loft encased in metal-mesh railing. 5. Replaced a main-level closet with a glass-doored wine room.
"It was like a witch's hat," says Jaffa describing the house's shape. His goal: modernize the form and exterior detailing while working with the overall structure. To break up the triangular shape, he altered rooflines as he updated the exterior and added 800 square-feet of living space above the existing garages. He introduced horizontal lines and dimensional features to articulate the existing flat, plain facade and separated the entry from the garages by creating an independent flat roof. "Making the entry independent created a sense of arrival to the home," he explains. He also changed the exterior's material palette and color to create a contemporary feel while respecting the existing fabric of the neighborhood. He also modified the back of the home and redesigned the patios and decks to make the outdoor living areas inviting and connected to the refreshed landscape.
Changes Made: 1. Replaced paneled double doors with a single, wide contemporary door inset with horizontal glass panes. 2. Removed the low, wood=covered ceiling. 3. Eliminated yellow-toned wood base and case. 4. Displayed an oversized "Marilyn" painting by DeVon to inject surprise and fun to the entry.
"The interior simply needed to be cleaned up and opened up," Jaffa explains. The transformation begins directly inside the new front door. Enlarged windows draw the eye from the opened-up entry, through the home and out into the mountain landscape. "I like to walk into a home and immediately be drawn to views," Jaffa says. To foster openness on the main level, he de-compartmentalized rooms and eliminated level changes allowing the kitchen, living, dining and family room areas to flow seamlessly into one another. Jaffa raised the sunken living room's floor to make the space feel larger. He enlarged and reconfigured the decades-old kitchen, transforming it with modern cabinets, appliances, fixtures and finishes. He removed a wall separating the kitchen and living areas and installed a statement-making metal-and-glass shelf unit between them.
Changes Made: 1. Rid the room of yellow-tone woods and beams. 2. Added a steel corner fireplace. 3. Placed the TV above the fireplace so that it would not interfere with views. 4. Replaced windows including an arched version that was difficult to drape for privacy.
Jaffa similarly opened the stairway and second level above. He removed a walled-in staircase and replaced it with a freestanding steel version detailed with wood treads. The new staircase purposefully faces away from the public areas of the home. "This subtly indicates that its primary use is for the owners to access more private spaces upstairs," Jaffa explains. There, a new loft overlooks the open living areas below. The architect also extended the second level over the garages for a new en-suite bedroom, second laundry room and office. He transformed the existing master bedroom with new windows, a corner fireplace and a remodeled en-suite bathroom adding rich marble, an enlarged window and a modern freestanding tub.
Changes Made: 1. Removed wall separating kitchen from the dining area and enlisted Carriage House Cabinets to handcraft glass-and-metal cabinets that hand from the ceiling. 2. Expanded the kitchen into the family room space and removed a separating wall.
Changes Made: 3. Replaced outdated features and fixtures with professional-grade appliances, reconfigured modern cabinetry and stone countertops. 4. Changed the primary sink location from wall-facing to beneath a large view window.
From this grain-rich wood to sleek steel, leathered quartzite countertops to smooth drywall, a mix of dissimilar surfaces adds depth and character throughout. "A house should be about contrasting textures," Jaffa says. Interior designer Beth Anne Shepherd, principal of Dressed Design, agrees. She furnished this Park City remodel, masterfully integrating elements, including texture-rich materials, custom mirrors, large-scale art and strategically selected furniture that maximize the interior's appeal. "The right furniture can make a space appear 35 percent larger," says Shepherd, who stages luxury homes for many of her clients. As Jaffa explains, "Our goal was to create an open, fresh, modern interior and a warm mountain modern exterior." In the end, that's exactly want they did.
Changes Made: 1. Replaced window with larger modern alternate. 2. Added a freestanding tub. 3. Installed new cabinets, fixtures and finishes. 4. Introduced wire-brushed, leather-finished marble flooring and polished marble shower walls. 5. Replaced wall-to-wall vanity mirror and light soffit with two framed mirrors paired with three modern pendant lights.


text:
Enter the email you signed up with and we'll email it to you.
Mining Data Solutions
North Goonyella Mine
This page is not tailored to
devices with screen width under 750 px.
160 km W from Mackay, Queensland, Australia
Suttor Development Road
Glenden
Additional Resources for Suppliers & Investors
Drill results over 30 g/t Au
Stay on top of recent discoveries.
Search drill results by commodity and grade.
Largest mines in the Americas
Mining and mill throughput capaciites.
Full profiles of select mines and projects.
Deepest underground mines
Shaft depth and mill throughput data.
Heavy mobile equipment
HME type, model, size and quantity.
Permitting and construction projects
Projects at the permitting or construction stage. Full profiles of select projects.
Mines with remote camps
Camp size, mine location and contacts.
Mines & projects in Australia
A list of country's mines and projects.
Costs & Financials
Filings & News
Thank you for browsing through mine profiles compiled by the Mining Data Online team.
Would you like to subcribe or schedule a Demo?
Status Temporary Suspension
Mine Type Underground
Coal (metallurgical)
Mining Method
Longwall
Production Start ...
Peabody's North Goonyella Mine in Queensland, Australia experienced a fire in 2018 which resulted in the suspension of mining operations. In 2020, the Company commenced a review of strategic alternatives for North Goonyella which is currently ongoing.
Source: p. 45,314
Peabody Energy, Inc. (operator) 100 % Indirect
- Subscription is required.
Sedimentary
Queensland's coals range in age from Carboniferous, 350 million years (Ma) in age, to Tertiary (65 Ma). The commercially significant black coals are restricted to deposits within sedimentary basins of Permian (280 Ma), Triassic (250 Ma) and Jurassic (200 Ma) age, located mainly in the central and eastern portions of the state.
The coal deposits of Permian age are by far the most commercially important. Of the State's black coal inventory totalling in excess of 30 billion (x109) tonnes (measured and indicated resources), Permian coals account for approximately 75% of the total resources, including almost 100% of the coking coal and about 60% of the thermal coal resources. Permian coals within the Bowen Basin in central Queensland account for approximately 70%, of the State's coal inventory while Mesozoic coals found mainly in the Clarence-Moreton, Surat, Callide and Tarong basins make up the remainder. Shallow coal potentially amenable to open-cut mining makes up about 55% of the inventory, with the remaining 45% present at greater depths.
The most important Permian coal basin is the Bowen Basin, which is exposed in a large, triangular-shaped area of central Queensland, 600km long and up to 250km wide. The basin extends south in the sub-surface beneath Mesozoic sediments of the Surat Basin, and connects with the Gunnedah and Sydney Basins in New South Wales.
Along the structurally disturbed north-eastern edge of the Bowen Basin, the coals range ........
Mining Methods
North Goonyella mine is an underground longwall mine, approximately 160 kilometres (km) west of Mackay and the Dalrymple Bay port. It produces a high strength coking coal for export, utilising longwall top coal caving methodology. The mine produced 2.5 million tonnes (mt) of saleable coal in 2014. Mining commenced at North Goonyella in 1994 and Peabody Energy acquired the operation in April 2004.


text:
Q: Lagranges method of solving Partial differential equations After solving the differential equation $xp + yq = z$ using this method we get the general solution as $f(x/y,y/z)=0$
But substituting $f(x/y,y/z)$ in the place of $z$ in differential equation gives us terms like $q$ on substituting. Here we cannot replace $q$ since it will bring us back to the same state with $q$ in the expression in spite of the substitution... My question is how do we confirm that $f(x/y,y/z)$ is the solution of the given differential equation.

A: $$x\frac{\partial z}{\partial x}+y\frac{\partial z}{\partial y}=z(x,y) \tag 1$$
You correctly found this form of implicit solution :
$$f\left(\frac{x}{y},\frac{y}{z}\right)=0 \tag 2$$
Since $f$ is an arbitrary function, they are many equivalent forms of implicit equations, such as for example $g\left(\frac{x}{y},\frac{z}{y}\right)=0$ , or $h\left(\frac{y}{z},\frac{z}{x}\right)=0$ , etc.
with arbitrary functions $g,h,$ etc.
Or on equivalent explicit form :
$$\frac{y}{z}=F\left(\frac{x}{y}\right)\quad\implies\quad z(x,y)=y\frac{1}{F\left(\frac{x}{y}\right)}$$
or equivalently
$$\boxed{z(x,y)=y\:\Phi\left(\frac{x}{y}\right)}\tag 3$$
$F$ and $\Phi$ are arbitrary functions.
$\frac{\partial z}{\partial x}=\frac{1}{y}\Phi'\quad$ and $\quad\frac{\partial z}{\partial y}=\Phi-\frac{x}{y^2}\Phi'$
$$x\frac{\partial z}{\partial x}+y\frac{\partial z}{\partial y}=x\left(\frac{1}{y}\Phi' \right)+y\left(\Phi-\frac{x}{y^2}\Phi' \right)$$
After simplification :
$$x\frac{\partial z}{\partial x}+y\frac{\partial z}{\partial y}=y\:\Phi$$
Thus
$$x\frac{\partial z}{\partial x}+y\frac{\partial z}{\partial y}=z$$
This confirms that $(3)$ is solution of the PDE $(1)$.
Of course it is possible to directly confirm that $(2)$ is solution of the PDE $(1)$ : One have to express the total differential of $(2)$ with respect to $dx,dy,dz$. and further calculus confirms that $(1)$ is satisfied.
ADDITION to answer to Denis James's comment :
$$f\left(\frac{x}{y},\frac{y}{z}\right)=0 \tag 2$$
$$f(X,Y)=0\quad
\begin{cases}
X=\frac{x}{y} \quad\implies\quad dX=\frac{1}{y}dx-\frac{x}{y^2}dy\\
Y=\frac{y}{z} \quad\implies\quad dY=\frac{1}{z}dy-\frac{y}{z^2}dz
\end{cases}$$
$$df=0=\frac{\partial f}{\partial X}\left(\frac{1}{y}dx-\frac{x}{y^2}dy\right)+\frac{\partial f}{\partial Y}\left(\frac{1}{z}dy-\frac{y}{z^2}dz\right) $$
$$\frac{\partial f}{\partial Y}\frac{y}{z^2}dz=\frac{\partial f}{\partial X}\frac{1}{y}dx
+\left(-\frac{\partial f}{\partial X}\frac{x}{y^2}
+\frac{\partial f}{\partial Y}\frac{1}{z}\right)dy$$
$$\frac{\partial z}{\partial x}=\frac{\frac{\partial f}{\partial X}\frac{1}{y}}{\frac{\partial f}{\partial Y}\frac{y}{z^2}} \quad\text{and}\quad
\frac{\partial z}{\partial y}=\frac{-\frac{\partial f}{\partial X}\frac{x}{y^2}+\frac{\partial f}{\partial Y}\frac{1}{z}}{\frac{\partial f}{\partial Y}\frac{y}{z^2}}$$
$$x\frac{\partial z}{\partial x}+y\frac{\partial z}{\partial y}=x\frac{\frac{\partial f}{\partial X}\frac{1}{y}}{\frac{\partial f}{\partial Y}\frac{y}{z^2}} +y \frac{-\frac{\partial f}{\partial X}\frac{x}{y^2}+\frac{\partial f}{\partial Y}\frac{1}{z}}{\frac{\partial f}{\partial Y}\frac{y}{z^2}}$$
$$x\frac{\partial z}{\partial x}+y\frac{\partial z}{\partial y}=y  \frac{\frac{\partial f}{\partial Y}\frac{1}{z}}{\frac{\partial f}{\partial Y}\frac{y}{z^2}}=z$$
Equation $(1)$ is satisfied which proves that $(2)$ is solution of the PDE.
Of course, the solution expressed on the form of implicit equation $(2)$ is not the best manner to express the solution. The equivalent explicit form $(3)$ is much simpler for further use, especially if some boundary condition was specified.

A: Making the change of coordinates
$$
\cases{
\xi = x\\
\eta = \frac xy
}
$$
we have $z(x,y) = u(\xi,\eta)$ and
$$
u(\xi,\eta) = \xi u_{\xi}(\xi,\eta)
$$
this PDE is solved like a separable ODE giving
$$
u(\xi,\eta) = \xi\Phi(\eta)
$$
or
$$
z(x,y) = x\Phi\left(\frac xy\right)
$$


You can't list narcotics, steroids, or any other controlled substances on eBay.
Drug paraphernalia can't be listed either – this includes all items designed or intended for use in manufacturing, concealing, or using of a controlled substance.
Why are these items prohibited?
As well as wanting to protect our community, the sale of prohibited drugs and drug paraphernalia violates state, federal, and international law, so it's forbidden on eBay.
What about prescription drugs and tobacco?
Prescription drugs and products containing tobacco are prohibited as well. For information about the sale of prescription drugs and over-the-counter medication, see our policy on medical and healthcare products. For information about the sale of tobacco, see our tobacco and smoking accessories policy.
Narcotics, steroids, and all other controlled substances aren't allowed on eBay.
You also can't list drug paraphernalia, including items designed or primarily intended for use in manufacturing, concealing, or using a controlled substance.
For information about the sale of smoking accessories, see our tobacco and smoking accessories policy.
You cannot market products that claim to provide a "legal high".
eBay doesn't allow drug paraphernalia, or items designed or primarily intended for making, concealing, or using a controlled substance.
You can list some smoking accessories not intended for drug use. For guidelines, please refer to our tobacco and smoking accessories policy.
For more information, review the sections of the Uniform Controlled Substances Act noted here.
Controlled substances include any substance included in Schedules I, II, III, IV or V of the Uniform Controlled Substances Act, 21 U.S.C. 801 et seq.
Drug paraphernalia is defined in 21 U.S.C. 863 - opens in new window or tab .
Gamma hydroxybutyric acid (GHB) ban: For more information about specific substances covered by this law, see 21 U.S.C. 812 - opens in new window or tab .
We urge our buyers and sellers to comply with all government regulations. Because the sale of drugs and drug paraphernalia is prohibited by law, regulated, or may cause harm to eBay or its members, we don't allow sellers to list them.
Protecting the safety of our members is our absolute top priority. Our policy for the sale of medical drugs, devices and healthcare products aims to make sure that any listings in this category meet strict health and safety regulations.
Multi-level marketing, pyramid, and matrix programs are often regulated, or illegal, and are not allowed to be listed or advertised on eBay.


Relax in your corner of Paradise in this Independent Living Retirement Village Unit. Designed to not only provide an enviable lifestyle and enhanced privacy & security, gated community, self contained security system.
Unit features two good size bedrooms, master with built ins & ensuite with patio door to internal courtyard with cover, second bedroom with built ins. Main Bathroom with large shower and vanity. Two toilets. Kitchen with dishwasher & good storage. This is overlooking the lounge, dining area. Patio door to internal court yard. Garage with good storage & door to internal court yard, Auto door & storage. Unit has been freshly painted & carpets. Ducted reverse cycle air conditioning, down lights and solar system. rear paved veranda.
Paradise gardens retirement village with an accent on community with a state of the art recreation area.
Ideally located less than 10 kilometers from the city with public transport at the front gate and easy access to a number of shopping centres. Right next door to Thorndon Park.
Looking for the perfect retirement address without having to compromise you independence.


DB2 databases containing data considered to be inactive can be moved, or archived, to DB2 archive tables or to archive flat files. It is imperative that the archiving process be done efficiently and in a timely manner. The need to reduce the potential of data loss during the archiving process requires the time between the insert of the inactive data into the archive table and the removal from its source table be done as close together as possible as well as a single unit of work. To satisfy these requirements a cursor on the result set of a database query on the tables containing inactive data is used.
The technique, Figure 1, is to use a JDBC result set cursor on a database SELECT query and for each row of the result set use the column values of the row in both the INSERT and DELETE statement predicates. Once the entire result set is processed, the cursor is closed.


Brandon Jeffs, one of 20 children and nephew of infamous FLDS prophet Warren Jeffs, had the courage to stand up to the injustice of the FLDS when he was just 15 years old. He demanded to go to a public school outside of the realm of the FLDS and experience the world outside of the confines of the church.
Because of this, he was forced to leave everything he knew and make his way by himself in society before he was even able to drive a car. He lived on couches, worked two jobs and eventually rose from the ashes. He served proudly in the U.S. Army for seven years and endured two deployments to Iraq.
After the military, Brandon earned his Bachelor's Degree in Business and has since become a successful businessman in the Technology Industry and advocate for those who been have been affected by the FLDS cult. He has now made it his personal mission to help other "Lost Boys & Girls" not only from the FLDS, but also children from around the world make the transition to a better life and show them that there is a way out and that they have the ability to find a life of happiness, passion and fulfillment!


text:
{-|
Module      : SDL.Cairo.Image.Renderer
Copyright   : Copyright (c) 2015 Yun-Yan Chi
License     : MIT
Maintainer  : jaiyalas@gmail.com

This module provides functions for directly/indirectly
rendering a JuicyPixel's 'Image' onto a sdl2's 'Texture'.

This module is actually implemented with both of 'Render' and 'Canvas',
therefore it provides functions in both way.
In fact, There are three simple ways to use this module.
Assume we alread have following code,

>import SDL
>import Linear.V2 (V2(..))
>import SDL.Cairo
>import SDL.Cairo.Canvas
>import SDL.Cairo.Image.Renderer
>import Codec.Picture
>
>main :: IO ()
>main = do
>  initialize [InitEverything]
>  window <- createWindow "SDL2 Cairo Canvas" defaultWindow
>  renderer <- createRenderer window (-1) defaultRenderer
>  texture <- createCairoTexture' renderer window
>  withCanvas texture $ do
>    background $ gray 102
>    -- location A
>
>  Right (ImageRGB8 img) <- readPng "pic.png"
>  -- location B
>
>  copy renderer texture Nothing Nothing
>  present renderer
>  delay 5000

[using @renderImgCanvas@]

   The first way to draw image is replacing

   > -- location A

   by

   >renderImgCanvas (V2 50 50) img

[using @drawImg@ or @drawImgC@]

   The other ways are replacing

   > -- location B

   by

   >drawImg texture (V2 50 50) img

   or

   >drawImgC texture (V2 50 50) img

-}
module SDL.Cairo.Image.Render
   (
   -- * draw 'Image' in 'IO' ()
     drawImg
   , drawImgC
   -- * draw 'Image' in 'Canvas' ()
   , renderImgCanvas
   -- * draw 'Image' in 'Render' ()
   , renderImgCairo
   , renderOnTexture
   -- * Type class
   , RenderablePixel (drawPx)
   , RenderablePixelC (renderPx)
   ) where
--
import Control.Monad (void)
--
import qualified Data.Convertible as CVT
--
import Linear.V2 (V2(..))
import Linear.V4 (V4(..))
import SDL (Texture)
import SDL.Cairo.Canvas
   ( withCanvas, renderCairo
   , Dim (..), Canvas
   , rect, noStroke, fill, rgb)
--
import qualified Graphics.Rendering.Cairo as Cairo
import Codec.Picture

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

-- | draw a __JuicyPixel__ 'Image' on the given __SDL__ 'Texture'
-- (at the specified coordinate).
drawImg :: RenderablePixel a =>
             Texture -- ^ a 'Texture'
          -> V2 Int  -- ^ a 'V2' coordinate of the top left corner
          -> Image a -- ^ an 'Image'
          -> IO ()
drawImg st v2 img = withCanvas st $ renderImgCanvas v2 img

-- | draw a __JuicyPixel__ 'Image' on the given __SDL__ 'Texture'
-- (at the specified coordinate).
-- Using Cairo's 'Render' underneath.
drawImgC :: RenderablePixelC a =>
             Texture   -- ^ a 'Texture'
          -> V2 Int    -- ^ a 'V2' coordinate of the top left corner
          -> Image a   -- ^ an 'Image'
          -> IO ()
drawImgC st v2 img = renderOnTexture st $ renderImgCairo v2 img

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

-- | render an __JuicyPixel__ 'Image' through __Cairo__ 'Canvas'
renderImgCanvas :: RenderablePixel a =>
                  V2 Int    -- ^ a 'V2' coordinate of the top left corner
               -> Image a   -- ^ an 'Image'
               -> Canvas () -- ^ a 'Canvas' action
renderImgCanvas (V2 _x _y) img@(Image _w _h _) = do
   let ps = [(V2 (_x+offx) (_y+ offy)
             ,pixelAt img offx offy)
            | offx <- [0..(_w-1)], offy <- [0..(_h-1)]]
   void $ mapM drawPx ps

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

-- | perform a 'Render' action on the given 'Texture'
renderOnTexture :: Texture            -- ^ target 'Texture'
                -> Cairo.Render () -- ^ a 'Render' action
                -> IO ()
renderOnTexture st = withCanvas st . renderCairo

-- | render an 'Image' through __Cairo__ 'Render'
renderImgCairo :: RenderablePixelC a =>
                  V2 Int          -- ^ a 'V2' coordinate of the top left corner
               -> Image a         -- ^ a JuicyPixel 'Image'
               -> Cairo.Render () -- ^ an Cairo 'Render' action
renderImgCairo (V2 _x _y) img@(Image _w _h _) = do
   let ps = [(V2 (_x+offx) (_y+ offy)
             ,pixelAt img offx offy)
            | offx <- [0..(_w-1)], offy <- [0..(_h-1)]]
   void $ mapM renderPx ps

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

-- | A pixel structure is 'RenderablePixel' if
-- how to draw on 'Canvas' is defined.
class Pixel px => RenderablePixel px where
   drawPx :: (V2 Int, px)    -- ^ (coordinate, pixel)
          -> Canvas ()
--
instance RenderablePixel PixelRGB8 where
   drawPx (V2 _x _y, PixelRGB8 _r _g _b) = do
      fill $ rgb _r _g _b
      noStroke
      rect $ D (fromIntegral _x) (fromIntegral _y) 1 1
--
instance RenderablePixel PixelRGB16 where
   drawPx (V2 _x _y, PixelRGB16 _r _g _b) = do
      fill $ rgb (CVT.convert _r) (CVT.convert _g) (CVT.convert _b)
      noStroke
      rect $ D (fromIntegral _x) (fromIntegral _y) 1 1
--
instance RenderablePixel PixelRGBA8 where
   drawPx (V2 _x _y, PixelRGBA8 _r _g _b _a) = do
      fill $ V4 _r _g _b _a
      noStroke
      rect $ D (fromIntegral _x) (fromIntegral _y) 1 1
--
instance RenderablePixel PixelRGBA16 where
   drawPx (V2 _x _y, PixelRGBA16 _r _g _b _a) = do
      fill $ V4 (CVT.convert _r) (CVT.convert _g) (CVT.convert _b) (CVT.convert _a)
      noStroke
      rect $ D (fromIntegral _x) (fromIntegral _y) 1 1

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

-- | A pixel structure is 'RenderablePixelC' if
-- how to render on 'Render' can be provided.
class Pixel px => RenderablePixelC px where
   renderPx :: (V2 Int, px)    -- ^ (coordinate, pixel)
                 -> Cairo.Render ()
--
instance RenderablePixelC PixelRGB8 where
   renderPx (V2 _x _y, PixelRGB8 _r _g _b) = do
      Cairo.rectangle (fromIntegral _x) (fromIntegral _y) 1 1
      Cairo.setSourceRGB
         ((/255) $ fromIntegral _r)
         ((/255) $ fromIntegral _g)
         ((/255) $ fromIntegral _b)
      Cairo.fill
--
instance RenderablePixelC PixelRGB16 where
   renderPx (V2 _x _y, PixelRGB16 _r _g _b) = do
      Cairo.rectangle (fromIntegral _x) (fromIntegral _y) 1 1
      Cairo.setSourceRGB
         ((/255) $ fromIntegral _r)
         ((/255) $ fromIntegral _g)
         ((/255) $ fromIntegral _b)
      Cairo.fill
--
instance RenderablePixelC PixelRGBA8 where
   renderPx (V2 _x _y, PixelRGBA8 _r _g _b _a) = do
      Cairo.rectangle (fromIntegral _x) (fromIntegral _y) 1 1
      Cairo.setSourceRGBA
         ((/255) $ fromIntegral _r)
         ((/255) $ fromIntegral _g)
         ((/255) $ fromIntegral _b)
         ((/255) $ fromIntegral _a)
      Cairo.fill
--
instance RenderablePixelC PixelRGBA16 where
   renderPx (V2 _x _y, PixelRGBA16 _r _g _b _a) = do
      Cairo.rectangle (fromIntegral _x) (fromIntegral _y) 1 1
      Cairo.setSourceRGBA
         ((/255) $ fromIntegral _r)
         ((/255) $ fromIntegral _g)
         ((/255) $ fromIntegral _b)
         ((/255) $ fromIntegral _a)
      Cairo.fill
--

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
	xmlns:aop="http://www.springframework.org/schema/aop"
	xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-4.0.xsd">

	<!-- JNDI方式配置数据源 -->
	<!-- <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
		<property name="jndiName" value="${jndiName}"></property> </bean> -->
		<!-- destroy-method="close" -->
	<!-- 配置c3p0数据源 -->
	<bean id="dataSource" name="dataSource"
		class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
		<property name="driverClass" value="${driverClassName}" />
		<property name="jdbcUrl" value="${jdbc_url}" />
		<property name="user" value="${jdbc_username}" />
		<property name="password" value="${jdbc_password}" />

		<!--连接池中保留的最小连接数。 -->
		<property name="minPoolSize" value="5" />
		<!--连接池中保留的最大连接数。Default: 15 -->
		<property name="maxPoolSize" value="100" />
		<!--最大空闲时间,60秒内未使用则连接被丢弃。若为0则永不丢弃。Default: 0 -->
		<property name="maxIdleTime" value="60" />
		<!--当连接池中的连接耗尽的时候c3p0一次同时获取的连接数。Default: 3 -->
		<property name="acquireIncrement" value="10" />
		<!--JDBC的标准参数,用以控制数据源内加载的PreparedStatements数量。但由于预缓存的statements 属于单个connection而不是整个连接池。所以设置这个参数需要考虑到多方面的因素。
			如果maxStatements与maxStatementsPerConnection均为0,则缓存被关闭。Default: 0 -->
		<property name="maxStatements" value="1000" />
		<!--初始化时获取的连接数,取值应在minPoolSize与maxPoolSize之间。Default: 3 -->
		<property name="initialPoolSize" value="5" />
		<!--每60秒检查所有连接池中的空闲连接。Default: 0 -->
		<property name="idleConnectionTestPeriod" value="60" />
		<!--定义在从数据库获取新连接失败后重复尝试的次数。Default: 30 -->
		<property name="acquireRetryAttempts" value="30" />
		<!--获取连接失败将会引起所有等待连接池来获取连接的线程抛出异常。但是数据源仍有效 保留,并在下次调用getConnection()的时候继续尝试获取连接。如果设为true,那么在尝试
			获取连接失败后该数据源将申明已断开并永久关闭。Default: false -->
		<property name="breakAfterAcquireFailure" value="true" />
		<!--因性能消耗大请只在需要的时候使用它。如果设为true那么在每个connection提交的 时候都将校验其有效性。建议使用idleConnectionTestPeriod或automaticTestTable
			等方法来提升连接测试的性能。Default: false -->
		<property name="testConnectionOnCheckout" value="false" />

		<!-- <property name="preferredTestQuery" value="${validationQuery}" />  -->
		<!--
		<property name="testOnBorrow" value="false" />
		<property name="testOnReturn" value="false" />
		<property name="testWhileIdle" value="true" /> -->

		<!-- 关闭abanded连接时输出错误日志 -->
		<!-- <property name="logAbandoned" value="true" /> -->
	</bean>

	<!-- 配置hibernate session工厂 -->
	<bean id="sessionFactory"
		class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
		<property name="dataSource" ref="dataSource" />
		<property name="hibernateProperties">
			<props>
				<prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
				<prop key="hibernate.dialect">${hibernate.dialect}</prop>
				<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
				<prop key="hibernate.format_sql">${hibernate.format_sql}</prop>

				<prop key="hibernate.generate_statistics">true</prop>
				<prop key="hibernate.connection.release_mode">auto</prop>
				<prop key="hibernate.autoReconnect">true</prop>
				<!-- <prop key="hibernate.current_session_context_class">org.springframework.orm.hibernate4.SpringSessionContext
				</prop> -->
			</props>
		</property>

		<!-- 自动扫描注解方式配置的hibernate类文件 -->
		<property name="packagesToScan">
			<list>
				<value>com.cnpc.**.entity</value>
				<value>com.radish.**.entity</value>
			</list>
		</property>

		<!-- 自动扫描hbm方式配置的hibernate文件和.hbm文件 -->
		<!-- <property name="mappingDirectoryLocations"> <list> <value>classpath:sy/hbm</value>
			</list> </property> -->
	</bean>

	<!-- 配置事务管理器 -->
	<bean id="transactionManager" name="transactionManager"
		class="org.springframework.orm.hibernate4.HibernateTransactionManager">
		<property name="sessionFactory" ref="sessionFactory" />
	</bean>

	<!-- 注解方式配置事务 -->
	<!-- <tx:annotation-driven transaction-manager="transactionManager" /> -->

	<bean id="SpringContextUtil" class="com.cnpc.framework.utils.SpringContextUtil" scope="singleton"></bean>

	<!-- 拦截器方式配置事务 -->
	<tx:advice id="transactionAdvice" transaction-manager="transactionManager">
		<tx:attributes>
			<tx:method name="add*" propagation="REQUIRED" />
			<tx:method name="append*" propagation="REQUIRED" />
			<tx:method name="insert*" propagation="REQUIRED" />
			<tx:method name="save*" propagation="REQUIRED" />
			<tx:method name="update*" propagation="REQUIRED" />
			<tx:method name="modify*" propagation="REQUIRED" />
			<tx:method name="edit*" propagation="REQUIRED" />
			<tx:method name="delete*" propagation="REQUIRED" />
			<tx:method name="remove*" propagation="REQUIRED" />
			<tx:method name="repair*" propagation="REQUIRED" />
			<tx:method name="delAndRepair*" propagation="REQUIRED" />
			<tx:method name="execute*" propagation="REQUIRED" />
			<tx:method name="submit*" propagation="REQUIRED" />
			<tx:method name="start*" propagation="REQUIRED" />
			<tx:method name="batch*" propagation="REQUIRED" />

			<tx:method name="get*" propagation="REQUIRED" read-only="true" />
			<tx:method name="count*" propagation="REQUIRED" read-only="true" />
			<tx:method name="find*" propagation="REQUIRED" read-only="true" />
			<tx:method name="load*" propagation="REQUIRED" read-only="true" />
			<tx:method name="search*" propagation="REQUIRED" read-only="true" />
			<tx:method name="datagrid*" propagation="REQUIRED" read-only="true" />

			<tx:method name="*" propagation="REQUIRED" />
		</tx:attributes>
	</tx:advice>
	<!-- 一般只对service层添加事务即可 -->
	<aop:config expose-proxy="true">
		<aop:pointcut id="transactionPointcut" expression="(execution(* com.cnpc..*Service.*(..))) or (execution(* com.radish..*Service.*(..)))" />
		<aop:advisor pointcut-ref="transactionPointcut"
					 advice-ref="transactionAdvice" />
	</aop:config>

</beans>


I was wondering how the weather was like on the Gold Coast.
I didn't expect that we could catch up again so soon, so I was very happy!
Byron bay cafe in Asakusa?!
This is a cafe which Aussie guy opened and speak only English in this cafe.
But, the door was opened so we opened it and asked them.
One of the staff told us their last order was finished and also English cafe was only dinner time.
We were dissappointed but changed the mind and had Okonomiyaki!
It is always clouded with a lot of tourists no matter it is weekdays or not.
In front of Kaminari gate.
We went to one of the backpacker I used 6 years ago?? to ask some information but….
It was also closed down!!
This is Japanese traditional sweets.
You can enjoy sweet red beans, rice cake, Japanese jelly and some fruits.
Time fried so fast when we had a good time.
They still feel bit strange about the life in Japan.
But, they are focusing on next their life.
Glad to see you guys again!


text:
Gove confirms UK and EU have agreed research part of deal
Image: Number 10 [CC BY-NC-ND 2.0], via Flickr
Minister says terms of Horizon participation agreed, raising hopes of collaboration if Brexit talks fail
Cabinet minister Michael Gove has told MPs that the terms of the UK's participation in the Horizon Europe research programme and the Erasmus student exchange scheme have already been agreed in trade talks with the EU.
His comments follow Irish prime minister Micheál Martin's comment earlier this month that "97 per cent of this deal has been negotiated, across the judicial, security, research, a whole range of areas. The remaining 3 per cent should not be beyond the capacity of both sides to bridge."


text:
Ribs, Ribs, and More Ribs: The Biggest Barbecue Cook-Off in the West
Locations in this article: Nashville, TN St. Louis, MO
People who love barbecue really love barbecue, and will go to great lengths to find the perfect ribs. I'm one of those, so I was thrilled to be invited to judge The Best in the West Nugget Rib Cook-Off in Sparks, Nevada.
For die-hard barbecue lovers and novices alike, this kind of cook-off is a slice of pork heaven.
Instead of driving around the country to sample regional styles of barbecue, all I had to do was take a three-block stroll down Victorian Avenue in front of the Nugget for some of the best ribs in the country.
Pit masters competed from all over the country, cooking up slab after slab of pork ribs in pick up-sized smokers and finishing them off on 10-foot-long wood-fired grills. Some hailed from legendary barbecue states like Texas, South Carolina, and Kansas. But many, many others came from states that folks rarely associate with this style of cooking—we're talking all the way from California to Minnesota, Pennsylvania and, yes, even New Jersey.
Nugget owner John Ascuaga and his kids, Michonne and Stephen, launched first Cook-Off back in 1989. Not knowing what to expect, the event wound up featuring six cookers and a small gathering of customers.
Joey Sutphen, owner of the formidable Texas Thunder cook-off team and one of the original six contestants, recalls the low-key inaugural event. He and the other contestants didn't even have smokers or grills—just Sterno cans to warm up the ribs.
But within a few years, word spread. This year, over six days, more than 500,000 people (yes, five hundred thousand) came to the Nugget and ate an astonishing 100,000 pounds of ribs. Only the top 24 cookers from around the country are invited to compete for the People's Award and the jury prizes for Best Ribs and Best Barbecue Sauce.
Don't worry if ribs aren't your thing, as there's plenty more to eat: pulled pork, barbecue turkey legs, chicken, grilled corn on the cob, hot pretzels, deep-fried potato chips, onion rings, fried zucchini, funnel cakes, cotton candy, shaved ices, and chocolate-dipped frozen fruit on a stick. (Don't think about the cholesterol. Just don't.)
I spent three days of gorging myself on every style of barbecue ribs you could imagine, and ultimately choosing the best of the best. But the real standout of the weekend was meeting the pit masters—a dedicated group of down-to-earth cooks who love food, people … and barbecue.
At 46, Bill "Bone Daddy" Wall has been cooking and serving barbecue for 28 years. Even so, an old-timer like Joey Sutphen calls him one of the "young cooks."
Now based in Michigan, Wall got into the barbecuing business entirely by accident. Living in Colorado, he worked on construction sites building houses deep in the woods. Rather than drive miles back into town for lunch, he began grilling up hot dogs and chicken and … ribs. That's when the nickname "Bone Daddy" was born.
He's been attending the best of the West since 1990—and even got married at the Nugget in the midst of all the festivities. For Wall, the cook-off at the Nugget is the best competition of the year; he calls it a "family affair."
When on the competition circuit, Wall travels with a 16-person crew from Michigan. That tight-knit team will cook up three tons (yes, tons) of ribs, using two face cords of wood. Back home he always cuts his own wood (cherry and sugar maple) and usually cures it for three months—the drier the wood, the hotter it burns, he explains.
For the Nugget Cook-Off, the wood he used was cut nine months prior. Why? "True barbecue is about smoke and flame and good grilling."
After tasting them, I'm sold on the method. The smoke penetrates the meat so that if you look at the rib from the side you can see a smoke ring.
His style is similar to many of the other competitors, but as in so many things in life, the devil is in the details. At the cook-off, all contestants are required to buy their ribs from Curly's, a packing house in Sioux City, Iowa. All the ribs are cut the same, St. Louis-style, with the breast bone of the rib removed at the knuckle so there are 12-13 ribs of mostly uniform length. That puts all the cookers on a level playing field so the competition is one of pit-master skills, technique and recipes.
The ribs are first dry rubbed, getting a good massaging with the rub to push the flavors into the meat. Wall's dry rub is like many used on the circuit: a mix of paprika, garlic, red pepper, smoked chipotle pepper, onion, salt, a little sugar, and, for tenderizing, papaya extract (his secret ingredient).
Next, the ribs are put into the smoker for 4.5 to 5 hours, after which they get a wet glaze of barbecue sauce and put into a hot box for 15-20 minutes. Then they're put on a wood fired barbecue grill to be finished with Wall's homemade sauce (only a few minutes). The sauce is tomato-based, a Kansas City-style preparation, which is pretty typical for the circuit (only one cooker at the competition favored a mustard-based South Carolina-style sauce). The difference between sauces is largely in how the cooker plays with the proportion of sugar, vinegar and cayenne.
Some cookers pride themselves on a sauce that features the sharpness of vinegar. Others tout their thermonuclear heat. Wall tries to hit it down the middle, balancing sweetness and acidity with a touch of heat. What makes him happy about the sauce is that he adds what he calls "gravel," finely diced pieces of onion, green peppers and jalapeños. That added chunkiness gives his ribs an added texture that he believes makes all the difference.
The final step is important to bring the ribs up to the proper temperature and also to finish breaking down the back skin so the rib is practically falling off the bone.
In all these steps, timing is everything. Too much smoke is bad; too much flame and the sugars will carbonize and the ribs will blacken. Ideally all the fat has dissolved, the sugars have caramelized, and the meat has taken on a beautiful mix of flavors: sweet and tart with a little heat.
On the last day of the cook-off I stopped by to talk to Wall again. After five-and-a-half days of cooking in the hot sun and serving thousands of racks a day, he admitted that he was beat.
He and his crew had put in long, hard, 14-hour days and he was looking forward to a break, but they'd had a good time. The staff at the Nugget had kept things running smoothly and the crowds were friendly. He couldn't ask for more. There was only one thing left to do: wait for the announcement of this year's winners.
As always, the competition was intense. Like every year, all the heavyweights on the barbecue circuit were there: Famous Dave's, which won an unprecedented back-to-back first place in 2006 and 2007; Butch Lupinetti of Butch's Smack Your Lips BBQ was competing, fresh off his latest appearance on the Food Network's Throwdown with Bobby Flay; the Haskell brothers from Texas Brothers Bar-B-Que; Joey Sutphen of Texas Thunder; Shane Best of Bourbon Q from Westport, Kentucky; and Desperado's Lee Rice and his family.
This was not only the best of the West, these were the best of the best.
And Wall beat them all. That's right, a barbecue team out of Midland, Michigan was announced the first-place winner in the Best Ribs category. Not bad for a construction guy who started cooking barbecue because it was too far to drive into town for lunch.
By David Latt for PeterGreenberg.com. Check out David's food blog for stories and recipes at MenWhoLiketoCook.blogspot.com.
Check out A Food Lover's Five Easy Travel Tips.
We've got travel guides for some of the best barbecue hotspots you might not think about, like Nashville, Tennessee or Charleston, South Carolina.
Get more tasty travel ideas in our Culinary Travel section.


text:
import json
from StringIO import StringIO

from django.test import SimpleTestCase
from django.core.cache import cache
from elasticsearch.exceptions import ConnectionError
from mock import patch
from openpyxl import load_workbook

from corehq.apps.export.const import (
    DEID_DATE_TRANSFORM,
    CASE_NAME_TRANSFORM,
)
from corehq.apps.export.export import (
    _get_writer,
    _Writer,
    _write_export_instance,
    ExportFile,
    get_export_file,
)
from corehq.apps.export.const import (
    MISSING_VALUE,
    EMPTY_VALUE,
)
from corehq.apps.export.models import (
    TableConfiguration,
    ExportColumn,
    ScalarItem,
    FormExportInstance,
    ExportItem,
    MultipleChoiceItem,
    SplitExportColumn,
    CaseExportInstance,
    PathNode,
    Option,
    MAIN_TABLE,
    StockItem,
    StockFormExportColumn,
)
from corehq.apps.export.tests.util import (
    new_case,
    DOMAIN,
    DEFAULT_CASE_TYPE,
)
from corehq.elastic import send_to_elasticsearch, get_es_new
from corehq.pillows.mappings.case_mapping import CASE_INDEX_INFO
from corehq.util.elastic import ensure_index_deleted
from corehq.util.test_utils import trap_extra_setup
from couchexport.export import get_writer
from couchexport.models import Format
from couchexport.transforms import couch_to_excel_datetime
from pillowtop.es_utils import initialize_index_and_mapping

class WriterTest(SimpleTestCase):

    docs = [
        {
            'domain': 'my-domain',
            '_id': '1234',
            "form": {
                "q1": "foo",
                "q2": {
                    "q4": "bar",
                },
                "q3": "baz",
                "mc": "two extra"
            }
        },
        {
            'domain': 'my-domain',
            '_id': '12345',
            "form": {
                "q1": "bip",
                "q2": {
                    "q4": "boop",
                },
                "q3": "bop",
                "mc": "one two",
                "date": "2015-07-22T14:16:49.584880Z",
            }
        },
    ]

    def test_simple_table(self):
        """
        Confirm that some simple documents and a simple FormExportInstance
        are writtern with _write_export_file() correctly
        """

        export_instance = FormExportInstance(
            export_format=Format.JSON,
            tables=[
                TableConfiguration(
                    label="My table",
                    selected=True,
                    columns=[
                        ExportColumn(
                            label="Q3",
                            item=ScalarItem(
                                path=[PathNode(name='form'), PathNode(name='q3')],
                            ),
                            selected=True
                        ),
                        ExportColumn(
                            label="Q1",
                            item=ScalarItem(
                                path=[PathNode(name='form'), PathNode(name='q1')],
                            ),
                            selected=True
                        ),
                    ]
                )
            ]
        )

        writer = _get_writer([export_instance])
        with writer.open([export_instance]):
            _write_export_instance(writer, export_instance, self.docs)

        with ExportFile(writer.path, writer.format) as export:
            self.assertEqual(
                json.loads(export),
                {
                    u'My table': {
                        u'headers': [u'Q3', u'Q1'],
                        u'rows': [[u'baz', u'foo'], [u'bop', u'bip']],

                    }
                }
            )

    def test_split_questions(self):
        """Ensure columns are split when `split_multiselects` is set to True"""
        export_instance = FormExportInstance(
            export_format=Format.JSON,
            domain=DOMAIN,
            case_type=DEFAULT_CASE_TYPE,
            split_multiselects=True,
            tables=[TableConfiguration(
                label="My table",
                selected=True,
                path=[],
                columns=[
                    SplitExportColumn(
                        label="MC",
                        item=MultipleChoiceItem(
                            path=[PathNode(name='form'), PathNode(name='mc')],
                            options=[
                                Option(value='one'),
                                Option(value='two'),
                            ]
                        ),
                        selected=True,
                    )
                ]
            )]
        )
        writer = _get_writer([export_instance])
        with writer.open([export_instance]):
            _write_export_instance(writer, export_instance, self.docs)

        with ExportFile(writer.path, writer.format) as export:
            self.assertEqual(
                json.loads(export),
                {
                    u'My table': {
                        u'headers': [u'MC | one', u'MC | two', 'MC | extra'],
                        u'rows': [[EMPTY_VALUE, 1, 'extra'], [1, 1, '']],

                    }
                }
            )

    def test_form_stock_columns(self):
        """Ensure that we can export stock properties in a form export"""
        docs = [{
            '_id': 'simone-biles',
            'domain': DOMAIN,
            'form': {
                'balance': [
                    {
                        '@type': 'question-id',
                        'entry': {
                            '@quantity': '2',
                        }
                    }, {
                        '@type': 'other-question-id',
                        'entry': {
                            '@quantity': '3',
                        }
                    }]
            },
        }, {
            '_id': 'sam-mikulak',
            'domain': DOMAIN,
            'form': {
                'balance': {
                    '@type': 'question-id',
                    'entry': {
                        '@quantity': '2',
                    }
                },
            },
        }, {
            '_id': 'kerri-walsh',
            'domain': DOMAIN,
            'form': {
                'balance': {
                    '@type': 'other-question-id',
                    'entry': {
                        '@quantity': '2',
                    }
                },
            },
        }, {
            '_id': 'april-ross',
            'domain': DOMAIN,
            'form': {},
        }]
        export_instance = FormExportInstance(
            export_format=Format.JSON,
            domain=DOMAIN,
            tables=[TableConfiguration(
                label="My table",
                selected=True,
                path=[],
                columns=[
                    StockFormExportColumn(
                        label="StockItem @type",
                        item=StockItem(
                            path=[
                                PathNode(name='form'),
                                PathNode(name='balance:question-id'),
                                PathNode(name='@type'),
                            ],
                        ),
                        selected=True,
                    ),
                    StockFormExportColumn(
                        label="StockItem @quantity",
                        item=StockItem(
                            path=[
                                PathNode(name='form'),
                                PathNode(name='balance:question-id'),
                                PathNode(name='entry'),
                                PathNode(name='@quantity'),
                            ],
                        ),
                        selected=True,
                    ),
                ]
            )]
        )
        writer = _get_writer([export_instance])

        with writer.open([export_instance]):
            _write_export_instance(writer, export_instance, docs)

        with ExportFile(writer.path, writer.format) as export:
            self.assertEqual(
                json.loads(export),
                {
                    u'My table': {
                        u'headers': [u'StockItem @type', u'StockItem @quantity'],
                        u'rows': [
                            ['question-id', '2'],
                            ['question-id', '2'],
                            [MISSING_VALUE, MISSING_VALUE],
                            [MISSING_VALUE, MISSING_VALUE],
                        ],
                    }
                }
            )

    def test_transform_dates(self):
        """Ensure dates are transformed for excel when `transform_dates` is set to True"""
        export_instance = FormExportInstance(
            export_format=Format.JSON,
            domain=DOMAIN,
            case_type=DEFAULT_CASE_TYPE,
            transform_dates=True,
            tables=[TableConfiguration(
                label="My table",
                selected=True,
                path=[],
                columns=[
                    ExportColumn(
                        label="Date",
                        item=MultipleChoiceItem(
                            path=[PathNode(name='form'), PathNode(name='date')],
                        ),
                        selected=True,
                    )
                ]
            )]
        )
        writer = _get_writer([export_instance])
        with writer.open([export_instance]):
            _write_export_instance(writer, export_instance, self.docs)

        with ExportFile(writer.path, writer.format) as export:
            self.assertEqual(
                json.loads(export),
                {
                    u'My table': {
                        u'headers': [u'Date'],
                        u'rows': [[MISSING_VALUE], [couch_to_excel_datetime('2015-07-22T14:16:49.584880Z', None)]],

                    }
                }
            )

    def test_split_questions_false(self):
        """Ensure multiselects are not split when `split_multiselects` is set to False"""
        export_instance = FormExportInstance(
            export_format=Format.JSON,
            domain=DOMAIN,
            case_type=DEFAULT_CASE_TYPE,
            split_multiselects=False,
            tables=[TableConfiguration(
                label="My table",
                selected=True,
                path=[],
                columns=[
                    SplitExportColumn(
                        label="MC",
                        item=MultipleChoiceItem(
                            path=[PathNode(name='form'), PathNode(name='mc')],
                            options=[
                                Option(value='one'),
                                Option(value='two'),
                            ]
                        ),
                        selected=True,
                    )
                ]
            )]
        )
        writer = _get_writer([export_instance])
        with writer.open([export_instance]):
            _write_export_instance(writer, export_instance, self.docs)

        with ExportFile(writer.path, writer.format) as export:
            self.assertEqual(
                json.loads(export),
                {
                    u'My table': {
                        u'headers': [u'MC'],
                        u'rows': [['two extra'], ['one two']],

                    }
                }
            )

    def test_multi_table(self):
        export_instance = FormExportInstance(
            export_format=Format.JSON,
            tables=[
                TableConfiguration(
                    label="My table",
                    selected=True,
                    path=[],
                    columns=[
                        ExportColumn(
                            label="Q3",
                            item=ScalarItem(
                                path=[PathNode(name='form'), PathNode(name='q3')],
                            ),
                            selected=True,
                        ),
                    ]
                ),
                TableConfiguration(
                    label="My other table",
                    selected=True,
                    path=[PathNode(name='form', is_repeat=False), PathNode(name="q2", is_repeat=False)],
                    columns=[
                        ExportColumn(
                            label="Q4",
                            item=ScalarItem(
                                path=[PathNode(name='form'), PathNode(name='q2'), PathNode(name='q4')],
                            ),
                            selected=True,
                        ),
                    ]
                )
            ]
        )
        writer = _get_writer([export_instance])
        with writer.open([export_instance]):
            _write_export_instance(writer, export_instance, self.docs)
        with ExportFile(writer.path, writer.format) as export:
            self.assertEqual(
                json.loads(export),
                {
                    u'My table': {
                        u'headers': [u'Q3'],
                        u'rows': [[u'baz'], [u'bop']],

                    },
                    u'My other table': {
                        u'headers': [u'Q4'],
                        u'rows': [[u'bar'], [u'boop']],
                    }
                }
            )

    def test_multiple_write_export_instance_calls(self):
        """
        Confirm that calling _write_export_instance() multiple times
        (as part of a bulk export) works as expected.
        """
        export_instances = [
            FormExportInstance(
                # export_format=Format.JSON,
                tables=[
                    TableConfiguration(
                        label="My table",
                        selected=True,
                        path=[],
                        columns=[
                            ExportColumn(
                                label="Q3",
                                item=ScalarItem(
                                    path=[PathNode(name='form'), PathNode(name='q3')],
                                ),
                                selected=True,
                            ),
                        ]
                    ),
                ]
            ),
            FormExportInstance(
                # export_format=Format.JSON,
                tables=[
                    TableConfiguration(
                        label="My other table",
                        selected=True,
                        path=[PathNode(name="form", is_repeat=False), PathNode(name="q2", is_repeat=False)],
                        columns=[
                            ExportColumn(
                                label="Q4",
                                item=ScalarItem(
                                    path=[PathNode(name='form'), PathNode(name='q2'), PathNode(name='q4')],
                                ),
                                selected=True,
                            ),
                        ]
                    )
                ]
            )

        ]

        writer = _Writer(get_writer(Format.JSON))
        with writer.open(export_instances):
            _write_export_instance(writer, export_instances[0], self.docs)
            _write_export_instance(writer, export_instances[1], self.docs)

        with ExportFile(writer.path, writer.format) as export:
            self.assertEqual(
                json.loads(export),
                {
                    u'My table': {
                        u'headers': [u'Q3'],
                        u'rows': [[u'baz'], [u'bop']],

                    },
                    u'My other table': {
                        u'headers': [u'Q4'],
                        u'rows': [[u'bar'], [u'boop']],
                    }
                }
            )

class ExportTest(SimpleTestCase):

    @classmethod
    def setUpClass(cls):
        super(ExportTest, cls).setUpClass()
        with trap_extra_setup(ConnectionError, msg="cannot connect to elasicsearch"):
            cls.es = get_es_new()
            initialize_index_and_mapping(cls.es, CASE_INDEX_INFO)

        case = new_case(_id='robin', name='batman', foo="apple", bar="banana", date='2016-4-24')
        send_to_elasticsearch('cases', case.to_json())

        case = new_case(owner_id="some_other_owner", foo="apple", bar="banana", date='2016-4-04')
        send_to_elasticsearch('cases', case.to_json())

        case = new_case(type="some_other_type", foo="apple", bar="banana")
        send_to_elasticsearch('cases', case.to_json())

        case = new_case(closed=True, foo="apple", bar="banana")
        send_to_elasticsearch('cases', case.to_json())

        cls.es.indices.refresh(CASE_INDEX_INFO.index)
        cache.clear()

    @classmethod
    def tearDownClass(cls):
        ensure_index_deleted(CASE_INDEX_INFO.index)
        cache.clear()
        super(ExportTest, cls).tearDownClass()

    def test_get_export_file(self):
        export_file = get_export_file(
            [
                CaseExportInstance(
                    export_format=Format.JSON,
                    domain=DOMAIN,
                    case_type=DEFAULT_CASE_TYPE,
                    tables=[TableConfiguration(
                        label="My table",
                        selected=True,
                        path=[],
                        columns=[
                            ExportColumn(
                                label="Foo column",
                                item=ExportItem(
                                    path=[PathNode(name="foo")]
                                ),
                                selected=True,
                            ),
                            ExportColumn(
                                label="Bar column",
                                item=ExportItem(
                                    path=[PathNode(name="bar")]
                                ),
                                selected=True,
                            )
                        ]
                    )]
                ),
            ],
            []  # No filters
        )
        with export_file as export:
            self.assertEqual(
                json.loads(export),
                {
                    u'My table': {
                        u'headers': [
                            u'Foo column',
                            u'Bar column'],
                        u'rows': [
                            [u'apple', u'banana'],
                            [u'apple', u'banana'],
                            [u'apple', u'banana'],
                        ],
                    }
                }
            )

    def test_case_name_transform(self):
        docs = [
            {
                'domain': 'my-domain',
                '_id': '1234',
                "form": {
                    "caseid": "robin",
                },
            },
            {
                'domain': 'my-domain',
                '_id': '1234',
                "form": {
                    "caseid": "i-do-not-exist",
                },
            }
        ]
        export_instance = FormExportInstance(
            export_format=Format.JSON,
            tables=[
                TableConfiguration(
                    label="My table",
                    selected=True,
                    columns=[
                        ExportColumn(
                            label="case_name",
                            item=ScalarItem(
                                path=[PathNode(name='form'), PathNode(name='caseid')],
                                transform=CASE_NAME_TRANSFORM,
                            ),
                            selected=True
                        ),
                    ]
                )
            ]
        )
        writer = _get_writer([export_instance])
        with writer.open([export_instance]):
            _write_export_instance(writer, export_instance, docs)

        with ExportFile(writer.path, writer.format) as export:
            self.assertEqual(
                json.loads(export),
                {
                    u'My table': {
                        u'headers': [u'case_name'],
                        u'rows': [[u'batman'], [MISSING_VALUE]],

                    }
                }
            )

    @patch('couchexport.deid.DeidGenerator.random_number', return_value=3)
    def test_export_transforms(self, _):
        export_file = get_export_file(
            [
                CaseExportInstance(
                    export_format=Format.JSON,
                    domain=DOMAIN,
                    case_type=DEFAULT_CASE_TYPE,
                    tables=[TableConfiguration(
                        label="My table",
                        selected=True,
                        path=[],
                        columns=[
                            ExportColumn(
                                label="DEID Date Transform column",
                                item=ExportItem(
                                    path=[PathNode(name="date")]
                                ),
                                selected=True,
                                deid_transform=DEID_DATE_TRANSFORM,
                            )
                        ]
                    )]
                ),
            ],
            []  # No filters
        )
        with export_file as export:
            export_dict = json.loads(export)
            export_dict['My table']['rows'].sort()
            self.assertEqual(
                export_dict,
                {
                    u'My table': {
                        u'headers': [
                            u'DEID Date Transform column [sensitive]',
                        ],
                        u'rows': [
                            [MISSING_VALUE],
                            [u'2016-04-07'],
                            [u'2016-04-27'],  # offset by 3 since that's the mocked random offset
                        ],
                    }
                }
            )

    def test_selected_false(self):
        export_file = get_export_file(
            [
                CaseExportInstance(
                    export_format=Format.JSON,
                    domain=DOMAIN,
                    case_type=DEFAULT_CASE_TYPE,
                    tables=[TableConfiguration(
                        label="My table",
                        selected=False,
                        path=[],
                        columns=[]
                    )]
                ),
            ],
            []  # No filters
        )
        with export_file as export:
            self.assertEqual(json.loads(export), {})

    def test_simple_bulk_export(self):

        export_file = get_export_file(
            [
                CaseExportInstance(
                    export_format=Format.JSON,
                    domain=DOMAIN,
                    case_type=DEFAULT_CASE_TYPE,
                    tables=[TableConfiguration(
                        selected=True,
                        label="My table",
                        path=MAIN_TABLE,
                        columns=[
                            ExportColumn(
                                label="Foo column",
                                item=ExportItem(
                                    path=[PathNode(name="foo")]
                                ),
                                selected=True,
                            ),
                        ]
                    )]
                ),
                CaseExportInstance(
                    export_format=Format.JSON,
                    domain=DOMAIN,
                    case_type=DEFAULT_CASE_TYPE,
                    tables=[TableConfiguration(
                        label="My table",
                        selected=True,
                        path=MAIN_TABLE,
                        columns=[
                            ExportColumn(
                                label="Bar column",
                                item=ExportItem(
                                    path=[PathNode(name="bar")]
                                ),
                                selected=True,
                            )
                        ]
                    )]
                ),
            ],
            []  # No filters
        )

        expected = {
            'My table': {
                "A1": "Foo column",
                "A2": "apple",
                "A3": "apple",
                "A4": "apple",
            },
            "My table1": {
                "A1": "Bar column",
                "A2": "banana",
                "A3": "banana",
                "A4": "banana",
            },
        }

        with export_file as export:
            wb = load_workbook(StringIO(export))
            self.assertEqual(wb.get_sheet_names(), ["My table", "My table1"])

            for sheet in expected.keys():
                for cell in expected[sheet].keys():
                    self.assertEqual(
                        wb[sheet][cell].value,
                        expected[sheet][cell],
                        'AssertionError: Sheet "{}", cell "{}" expected: "{}", got "{}"'.format(
                            sheet, cell, expected[sheet][cell], wb[sheet][cell].value
                        )
                    )

class TableHeaderTest(SimpleTestCase):

    def test_deid_column_headers(self):
        col = ExportColumn(
            label="my column",
            deid_transform="deid_id",
        )
        self.assertEqual(col.get_headers(), ["my column [sensitive]"])