text:
Q: Spark: Select specific Index of value of type Any So I have a DataFrame in which one of the columns is of type WrappedArray(JSON). In each of these, the JSON has a format [String, String]
I have sucessfully accessed the inside of the array and now I have a column of type Any in which each value has a [String, String].
Point is: I just want to take the first value of these two strings, but if I try something like column(0), it raises an error since Any has no index. How can I access this value?
My code for now is:
val schema = StructType(Seq(
    StructField("productId", StringType, true),
    StructField("name", StringType, true)
))

df.withColumn("column", from_json($"column"(0), schema) )

And the schema of my df:
root
 |-- customerId: string (nullable = true)
 |-- column: struct (nullable = true)
 |    |-- productId: string (nullable = true)
 |    |-- name: string (nullable = true)
 |-- date: date (nullable = true)

A: I managed to solve the problem myself. The answer was quite obvious: Instead of creating a column of type struct which contains two values, I created a MapType which had the same values.
My final code:
df.withColumn("column", from_json($"column"(0), MapType(StringType, StringType)) )

And then, for accessing the keys and values of the new column:
.select("column.productId", "column.name")


text:
Home Industries Banking & Finance Brutal winter dings Johnson Outdoors
Brutal winter dings Johnson Outdoors
May 2, 2014 12:00 am
Racine-based Johnson Outdoors Inc. today reported fiscal second quarter net income of $7.4 million, or 67 cents per share, down from $8.9 million, or 90 cents per share, in the second quarter of 2013.
Revenue was $124.3 million, down from $132.1 million a year ago.
The company, which makes outdoor recreation equipment, attributed the decreases to prolonged harsh winter weather during the quarter. Last year's second quarter was also a record period, which contributed to the unfavorable comparisons.
"Unpredictable weather conditions are always challenging for the highly seasonal outdoor recreational industry, and this year's unusually long and frigid winter has shifted the pacing of customer orders to more closely align with the retail-selling period of our products during the spring and summer months," said Helen Johnson-Leipold, chairman and chief executive officer. "On a positive note, we ended this quarter with strong marketplace demand for our new products. However, given the very late start to the season, it is difficult to forecast full-year performance at this time."
Spring Bank names new president
Fiduciary Management plans move to BMO Tower
Viewpoints: A public-private model, Badger Fund of Funds is performing for Wisconsin
"Unpredictable weather conditions are always challenging for the highly seasonal outdoor recreational industry, and this year's unusually long and frigid winter has shifted the pacing of customer orders to more closely align with the retail-selling period of our products during the spring and summer months," said Helen Johnson-Leipold, chairman and chief executive officer. "On a positive note, we ended this quarter with strong marketplace demand for our new products. However, given the very late start to the season, it is difficult to forecast full-year performance at this time."

redpajama_set_name: RedPajamaCommonCrawl


text:
Q: Detecting blocked local URLs in JavaScript I'm putting in a link to a local network URL inside a website i.e.
Your network share

in an application, and I'm aware of the potential for browsers to block the request.
I was wondering if there's any way to either detect or predict the blocking so I can show an alternative result to the user (Like just telling them the path instead of trying to open it for them)?

A: Actually I think you could use a hidden iframe:
In your case I would have a click event handler on that link like so:
EDITED: Now using a Timeout technique to check if the frame has loaded
var _errtimer, link, href;
function clickHandler(e) {
    e.preventDefault();
    link = $(this);
    href = link.attr('href');
    var frame = $("");
    $("body").append(frame);

    _errtimer = setTimeout(frameError, 2000);

    $("#testFrame").on('load', function () {
        clearTimeout(_errtimer);
        console.log('frame loaded successfuly');
        location.href = href;
    });
}
function frameError() {
    alert('error in frame');
    // no access, provide the path..
    lnk.html("the path: " + href);
}

Let me know if this works for you.

redpajama_set_name: RedPajamaStackExchange


Homework and Independent Study – WHY the need for it?
Homework and Independent Study are essential to developing lifelong learning and independent study skills which go way beyond the classroom.
Improve literacy skills, by 20 minutes of reading daily.
Embed things learnt in lessons, by revising ( learning ) or doing ( developing skills ).
Extend learning, by exploring further and applying things learnt to different contexts.
Prepare for the following lesson, by researching or learning in advance.
Homework and Independent Study – WHEN will it be set and done?
At the start of the year, Key Stage 3 students will receive a homework timetable which will outline which subjects they should focus on each night of the week.
As they progress to Key Stage 4, homework and independent study continues to be set regularly and students are required to become more independent at managing their time and working to deadlines. By Key Stage 5, Independent Study is an integral part of students' routines.
Homework and Independent Study – HOW will it be set and monitored?
Homework will be set by class teachers and should be recorded in the Student Planner. All homework set will be on FROG for students and parents to access and for the school to monitor.
Students are expected to read at home for at least 20 minutes per day.
Do encourage your child to read at home and ask questions about what they are reading.
Do encourage your child to read aloud to you, siblings or other family members.
Visit your local library and discuss the books you have both enjoyed.
As with anything, performance improves with practice. According to research, children who read at least 20 minutes a day with a 90% comprehension rate on AR quizzes see the greatest gains.
Homework and Independent Study – WHAT type of learning will it be?
Some subjects will set weekly learning homework, other subjects will set longer projects which will require students to plan their time carefully and ensure they do something each week to add to the project.
The Curriculum Guides for each year group contain a more detailed breakdown of the type of homework set by each subject area for each year group.
Provide a suitable place at home for students to work at home or encourage them to use the school library.
Support the school in valuing homework as an essential part of learning and progress.
Check the student planner to ensure that homework is being recorded.
Monitor that students are doing the homework that has been set.
Use FROG to clarify homework tasks or queries.
Support with homework tasks where necessary but encourage students to become increasingly independent in the time management and completion of tasks.
Contact the school ( via FROG or a note in the student planner ) if there is a genuine reason why homework could not be completed.
Support the school in setting sanctions when homework is not completed.
Liaise with the school if there are any concerns regarding homework.
Value the fact that homework is an essential part of learning and progress.
Record all homework set in the Student Planner.
Complete the homework set by the deadline given.
Use FROG to clarify and complete homework tasks.
Learn to manage their time effectively.
Find out what classwork and homework has been missed if they were absent from school, and catch up.
Accept sanctions when homework is not done.
Take pride in the work done at home and complete to the best standard they can.


The Commission of Detainees and Ex-Detainees' Affairs reported that 450 Palestinian children are detained in Israeli jails, including about 270 minors in Ofer Prison, located near the West Bank town of Beitunia.
The official human rights body noted that nine minors are being held by the Israeli authorities under administrative detention.
The commission also noted that since 2015, Israeli authorities have arrested nearly 2,500 Palestinian minors and handed down "unfair verdicts" and fines to them.
It pointed out that in January the Israeli authorities issued fines against the prisoners in Ofer Prison amounting to 90,000 Israeli shekels (about $23,000 US).


text:
Did Google try to buy Snapchat as well?
Omar Akhtar
The latest rumor going around Silicon Valley is that Facebook wasn't the only tech giant that tried to buy Snapchat.
According to an unnamed source speaking to Nitasha Tiku at Valleywag, Google attempted to outbid Facebook's $3 billion offer to acquire Snapchat, by throwing an extra $1 billion on top of that price. But Snapchat still didn't bite.
Here's what Tiku writes:
According to our source, Google planned on keeping Snapchat as a standalone app and was motivated to buy because "Facebook has proved against Google that it's better at social and consumer products."
It's important to remember than neither Google nor Snapchat have confirmed this news, and it's likely that it's been intentionally floated, given how much it would raise Snapchat's valuation even more. So why are the tech giants so infatuated with the idea of owning an app that generates no revenue and is used mostly by teenagers to send self-destructing pictures to each other? Read Jen Nedeau's piece today about why Snapchat is valued so high and how it might actually be a game changing social media platform.
FT to launch Wealth in the US
On October 16, the Financial Times will launch a US edition of its FT Wealth magazine. The quarterly,…
Lauren Bell
Po'Boys Serves DM to Help Expansion
The long French bread sandwiches stuffed with meat, cheese and a spicy relish sauce are better to eat…
Google Nets Japanese AdSense Partners
Google signed its first Japanese distribution partners for its AdSense contextual listings program, the company said this week.…


text:
Drone video reveals a Miami U Middletown campus nestled in a forest
How educated are Butler and Warren counties? Officials are giving new attention to that question
Rick McCrabb
Max Filby, Staff Writer
BUTLER COUNTY —
To keep up with workforce demand, 65 percent of Ohio's working-age adults need to have a college degree or some type of advanced training by 2025, officials said.
But with six years remaining, the state is 21 percent away from that target.
Jobs in the Miami Valley and around the state are becoming more technical and skilled in nature, said Rick Pearce, president of The Chamber of Commerce Serving Middletown, Monroe and Trenton. Even the manufacturing industry, which has historically been open to anyone, needs workers with the training to operate increasingly more complicated and computerized machinery, he said.
"Continuing education is the key," Pearce said. "A high school education is not enough. You need some type of training after high school to be competitive."
Around 44.1 percent of Ohio's 6 million or so residents aged 25- to 64 have a college degree, certificate or training in a skilled trade, according to the Ohio Department of Higher Education. That's up nine percentage points from a little over a decade ago but still far off from the 2025 goal set by the Ohio Department of Higher Education.
The need to boost degrees, credentials and training has led to several statewide and national efforts in recent years.
The state legislature in 2017 passed a law requiring ODHE to track and release an annual report on Ohio's degree, credential and training rate. Last year, the state's public universities launched a campaign called Forward Ohio that aims to increase attention, opportunities and funding for four-year schools.
Ohio is three points behind the United States as a whole, which has just under 47 percent of citizens with a post-secondary education, according to the state. There are 32 states where the rate of college degrees, credentials or training is higher than Ohio's.
Warren County has one of the highest rates in the state at 53.5 percent for 25- to 64-year-olds with a college education. Butler County's percentage is 39.7 and Preble County's is 24.9, the second lowest in the region.
The Chamber has analyzed the five-year forecast for jobs in demand in Butler and Warren counties, as it relates to members and large manufacturers, Pearce said. The top five jobs: Customer service representatives, registered nurses, insurance sales agents, bank tellers and heavy and tractor-trailers truck drivers.
Pearce said research shows that "a good job" is considered a position that pays $35,000 a year, or $17 an hour for full-time, for those under the age of 45 and $45,000, or $22 an hour, for workers older than 45. There was a time, Pearce said, many of those "good jobs" without a bachelor's degree were in manufacturing. But those jobs are declining while jobs in skilled-services industries, such as health services and financial services, are increasing.
"If you don't know what you want to do, there are other options," he said. "College is expensive."
Pearce believes high school graduates need to ask themselves: What am I good at and what do I enjoy doing? Match those talents with your profession, he said.
Mimi Sylva, director of Cincinnati State Middletown, is working with the Chamber to offer programs that match the needs of the local workforce. For instance, Cincinnati State hopes to offer a banking certificate, then encourage the students to obtain more education and "move up the ranks," she said.
MORE: Hamilton looks back on school building boom for anniversary
Sylva said there was a time when high school graduates either went to college or entered the workforce, one or the other. But now, Sylva said, high school graduates can start working and attend school, either online or at night, at the same time. She said employers can offer employees education reimbursement and that's a "very attractive carrot" to recruit potential workers.
Also at Cincinnati State, the goal is to provide students "short-term training," Sylva said.
"The jobs are now," she said.
Cathy Bishop-Clark, associate provost and dean of Miami University Regionals, said Ohio is asking the regional campuses of Ohio's public universities to offer relevant applied bachelor's degree programs to help meet the needs of Ohio's "current and future workforce."
That is exactly what Miami Regionals is doing, she said. U.S. News & World Report, in its 2019 Best Colleges edition, published a story about the "eight hot majors with a bright future." The list included: mechatronics engineering, business, computer science, data science, cognitive science, nursing, pharmaceutical sciences and human resources.
She said Miami University Regionals offer the first six on the list.
Bishop-Clark said Miami Regionals consult on a regular basis with businesses, not-for-profit organizations, and chambers of commerce in their communities to ensure they're offering what local workforce needs now and in the future.
AJ Huff, public relations coordinator at Butler Tech, said the school works closely with dozens on businesses to ensure its students are provided job shadowing opportunities, manufacturing tours, apprentice days and roundtable discussions with a 36-member business advisory board.
It's all about matching students with their passion, Huff said. College isn't the answer for every student, she said.
"The perception is changing," she said.
MORE: Butler County educators react to Butler Tech's unique new four-day classroom week
In the last few years, Ohio has changed its funding model to encourage completion. Colleges that are able to graduate more students now receive more state financial support.
Among other efforts, the state has tried to bolster completion by encouraging students to take College Credit Plus courses, which are free for high schoolers to take. College Credit Plus allows students to take college courses to earn credit before graduating from high school.
53.3%: Rate of 25- to 64-year-olds with college degrees, training or credentials in Warren County in 2018
44.1%: Rate in Ohio
39.7%: Rate in Butler County
Source: Ohio Department of Higher Education.


text:
MSV to Host FREE Genealogy Event on Saturday, March 4
Free Heritage Day Event Includes Expert Lectures, Door Prizes, and Information Tables
Hosted by Historical Societies and Research Organizations
Winchester, VA, 03/02/17…The Museum of the Shenandoah Valley (MSV) and Handley Library's Stewart Bell, Jr. Archives will help those interested in researching their family histories during the seventh annual Shenandoah Valley Heritage Day event from 9:30 a.m. to 3:30 p.m. this Saturday, March 4, at the MSV.
A free event, Heritage Day will include two lectures by expert genealogist Charles S. Mason, Jr., door prizes from Ancestry.com, and information tables hosted by historical societies and research organizations.
According to MSV Adult Programs Coordinator Courtney Beach, the day's activities are suitable for beginning researchers and experienced genealogists.
Presented by Charles S. Mason, Jr., certified genealogist and professional genealogical researcher, Heritage Day lectures will include, at 10:30 a.m., "Keeping the Family Secrets!" and at 1:30 p.m., "Myths, Fairytales & Stories Grandma Told." During the morning lecture, Mason will offer guidance to genealogists who discover family secrets while doing their research. He will discuss legal and ethical guidelines for handling discoveries such as criminal activity, divorce, or a child born out of wedlock. During the afternoon program, Mason will offer suggestions to those who have discovered myths and false stories in their family histories.
Charles Mason is a graduate of the National Genealogical Society's (NGS) American Genealogy: Home Study Course, the National Institute for Genealogical Research at the National Archives, and the Institute of Genealogy and Historical Research at Samford University, Birmingham Alabama. Charles Mason teaches genealogy courses for the National Genealogical Society and Fairfax County Public Schools, is past president of both the Fairfax and the Mount Vernon Genealogical Societies, and is a co-host of Tracing Your Family Roots, a Fairfax Public Access Cable Channel 10 program.
Heritage Day attendees may enter a free drawing to win prizes from the genealogy website Ancestry.com. Prizes include an annual membership to Ancestry; a subscription to www.Fold3.com, which allows people to search military family history; a one-year subscription to www.newspapers.com; and an Ancestry DNA kit.
Heritage Day information table hosts include: the Fort Loudoun DAR Chapter, Handley Library's Stewart Bell Jr. Archives, the Harrisonburg-Rockingham County Historical Society, Josephine School Community Museum, the Library of Virginia, the Museum of the Shenandoah Valley, the Shenandoah County Historical Society, the Warren Heritage Society, and the Winchester VA Family History Center.
Those interested in attending the lectures are encouraged to arrive early as seating is limited and tickets will be distributed on a first-come, first-served basis. Tickets will be available at the MSV Visitor Information Desk beginning at 9:30 a.m. on Saturday.
All Heritage Day presentations are free and admission is not required to visit the information tables or enter the day's drawing for prizes. Admission to the MSV galleries and exhibitions is $10 for adults and $8 for seniors and youth (age 13–18). Gallery admission is always free to MSV Members and youth ages 12 and under.
A regional cultural center, the Museum of the Shenandoah Valley is located at 901 Amherst Street in Winchester, Virginia. The MSV galleries and exhibitions are open year-round; its Glen Burnie House and seven-acre gardens are open April through December. Additional information is available at www.theMSV.org or by calling 540-662-1473, ext. 235. – END –
"The William Wood Glass Family at Glen Burnie," ca. 1900.


Every season, you try on a beautiful leather jacket, look at the price tag, and decide you'll wait to buy it next year. Then five years pass, and you're still putting off the purchase. We get it: A truly great leather jacket can make a serious dent in your bank account, but it can also make a serious impact on your wardrobe. Leather jackets can be worn at all times of the day and for any occasion. On top of that, they can be worn in nearly every season.
Although they're pricey, their versatility is guaranteed to pay off. If you're willing and able to invest in one, you won't regret it, which is why we've rounded up 17 reasons to justify the idea of spending so much on a single item. With that said, this is the year to finally purchase the piece you can't stop thinking about. Keep reading to see why this splurge-worthy piece is worth every penny.
Reason #1: You'll wear it with layering pieces.
A leather jacket is a great piece for transitional dressing. When you layer blouses or sweaters in the fall, a leather jacket is the perfect way to tie the outfit together.
Reason #2: You'll wear it with pretty silks.
Whether you're going on a dinner date or to an event, a leather jacket is the perfect go-to piece of outerwear.
Reason #3: You'll wear it with stripes.
If you're running late and don't know what to wear, throw on a striped shirt and leather jacket. You're guaranteed to look chic and polished.
Reason #4: You'll wear it with black skinny jeans.
There are always days we know we won't make it home after work. In this case, investing in a leather jacket is perfect for transitioning your daytime outfit to nighttime, especially when worn with black skinny jeans.
Reason #5: You'll wear it with chambray tops.
When dressing for comfort, layer a chambray top under your leather jacket. This is the perfect way to feel comfortable and look put together.
Reason #6: You'll wear it with casual T-shirts.
Don't want to spend too much time picking out an outfit? Style a leather jacket with your favorite T-shirt, and call it a day.
Reason #7: You'll wear it with leather boots.
A leather jacket paired with leather boots will never go out of style. Try this outfit idea on your next day off.
Reason #8: You'll wear it with sneakers.
Make the most out of your investment piece, and wear it year-round. Style your jacket with a miniskirt and sneakers during the warmer months.
Reason #9: You'll wear it with any LBD.
We all have a little black dress we wear religiously. So if you're looking to freshen up the look, pair your dress with a leather jacket.
Reason #10: You'll wear it with plaid.
Have a plaid shirt and don't know what to style it with? The answer is here: a black leather jacket and your favorite jeans.
Reason #11: You'll wear it with printed skirts.
A cropped leather jacket is perfect with any high-waisted bottoms. Whether you're going shopping or to lunch with friends, you can never go wrong with this staple outfit pairing.
Reason #12: You'll wear it with all your denim.
Style your leather jacket with denim jeans and a plain shirt, and voilà—you have your next go-to outfit.
Reason #13: You'll wear it with pencil skirts.
Tuck your shirt into a pencil skirt or trousers, and throw on a leather jacket for your next chic office look.
Reason #14: You'll wear it with statement accessories.
If you want to make your favorite accessories feel fresh, try pairing them with a leather jacket—it's simple and won't take away from the pieces themselves.
Reason #15: You'll wear it with lace.
Whether you're wearing lace or a pop of red, leather jackets go well with any and all fabrics.
Reason #16: You'll wear it with distressed denim.
If you're like us, you probably find yourself wearing head-to-toe denim quite a bit. To freshen up the look, style your next denim outfit with a touch of leather.
Reason #17: You'll wear it with knit sweaters.
Want to wear your favorite sweater over and over again without anyone noticing? Style it with a leather jacket to change up the look.
Up next, the $8 Hanes item every fashion girl is buying right now.