Pages

Monday, February 15, 2016

Control protected ranges and sheets in Google Sheets with Apps Script

A few weeks ago, the Google Sheets team introduced improved control over protected sheets and ranges. Developers have told us theyre looking for the same power in Google Apps Script — after all, ever since we added data validation to the Spreadsheet service, programmatic control over protected ranges has been the most popular request on the Apps Script issue tracker.

Today, we are excited to give you that granular control.

With the new Protection class in the Spreadsheet service, your scripts can touch every aspect of range or sheet protection, just like in the new UI. (The older PageProtection class, which had more limited features, will be deprecated, but will stick around in case you need to work with older spreadsheets. The new Protection class only applies to the newer version of Sheets.)

Code samples


So lets see the new stuff in action. Lets say you want to prohibit anyone other than yourself from editing cells A1:B10:

// Protect range A1:B10, then remove all other users from the list of editors.
var ss = SpreadsheetApp.getActive();
var range = ss.getRange(A1:B10);
var protection = range.protect().setDescription(Sample protected range);

// Ensure the current user is an editor before removing others. Otherwise, if the users edit
// permission comes from a group, the script will throw an exception upon removing the group.
var me = Session.getEffectiveUser();
protection.addEditor(me);
protection.removeEditors(protection.getEditors());
if (protection.canDomainEdit()) {
  protection.setDomainEdit(false);
}


Or maybe you want to remove all range protections in the whole spreadsheet:

// Remove all range protections in the spreadsheet that the user has permission to edit.
var ss = SpreadsheetApp.getActive();
var protections = ss.getProtections(SpreadsheetApp.ProtectionType.RANGE);
for (var i = 0; i < protections.length; i++) {
  var protection = protections[i];
  if (protection.canEdit()) {
    protection.remove();
  }
}


Or perhaps you want to protect an entire sheet, but carve out a small hole in it — an unprotected range within a protected sheet — that others can still edit:

// Protect the active sheet except B2:C5, then remove all other users from the list of editors.
var sheet = SpreadsheetApp.getActiveSheet();
var protection = sheet.protect().setDescription(Sample protected sheet);
var unprotected = sheet.getRange(B2:C5);
protection.setUnprotectedRanges([unprotected]);

// Ensure the current user is an editor before removing others. Otherwise, if the users edit
// permission comes from a group, the script will throw an exception upon removing the group.
var me = Session.getEffectiveUser();
protection.addEditor(me);
protection.removeEditors(protection.getEditors());
if (protection.canDomainEdit()) {
  protection.setDomainEdit(false);
}


Bam! Easy. Hope you find this useful, and happy scripting!

Posted by Sam Berlin, engineer, Google Sheets
Read More..

Sunday, February 14, 2016

Pennsylvania schools prepare students for future success with the 4Cs and Google for Education




Editors note: Were going across the country to highlight the great things schools are doing with technology. We talked to educators and administrators in Pennsylvania to hear how they’re creating innovative learning environments. Technology is empowering teachers to transform traditional classrooms into collaborative student-driven environments in the historic Keystone State. Pennsylvania is setting the pace for Northeast schools through its success with Google for Education. To learn more about Google solutions for Education, join us for a webinar on January 28th at 3pm ET / 12pm PT.

Education in the 21st century is about more than making sure students pass the class and understand the concepts. It’s centered around teaching students skills for the future, commonly known as the 4Cs: creativity, communication, critical thinking and collaboration. Schools in Pennsylvania are using Google for Education tools to provide teachers with the resources they need to bake the 4Cs into their lesson plans and provide students with diverse learning opportunities. We’re highlighting a few ways Pennsylvania schools are teaching students 21st century skills:


Fueling creativity and student-driven learning 


With Google Classroom, students at Indiana Area School District have the tools to receive one-on-one instruction outside of the classroom and create innovative projects that they’re passionate about. With 24/7 access to their teachers via Classroom, students can request feedback as they work on an assignment and ask questions that they might not have felt comfortable asking in class. If students prefer face-to-face feedback, they can hop on a Google Hangout with their teacher.

“Google Apps for Education has enabled me to give kids more opportunities to work together and with me. It puts the kids at the center of their education,” says Matt Neil, social studies teacher at Indiana Area Senior High School.

Teachers direct students to shared resources to help them improve certain skill sets, so they can expand their creativity. “With Google for Education, students gain autonomy while teachers have the means to pervasively develop new curriculum and learning opportunities,” says Rich Kiker, certified Google Education Trainer and founder and CEO of Kiker Learning, a Google for Education professional development implementation partner.


Creating stronger lines of communication among teachers 


Teachers at Pennsbury School District use Google Apps for Education to create a shared resource hub, so they can provide students with more individualized learning opportunities. Teachers communicate about students’ learning styles, strengths and areas for improvement and can easily find resources that help them learn best, whether they’re visual, auditory or tactile learners.

“As a special educator, I can easily share and edit Google Docs with teachers to best meet the needs of the students,” says Jeanne Caputo, teacher and room support provider at Charles Boehm Middle School. “When I don’t have time to fully prep teachers in person, Google for Education lets us quickly communicate student goals and plans.”

“Greater communication has a direct positive impact on individual and team effectiveness,” says Amanda Durham, English teacher at Pennsbury High School. “Diversifying learning experiences, in terms of content or medium, truly enhances curriculum.”


Reinforcing the power of critical thinking 

Middle school students in Wilson School District using Chromebooks in the classroom


The mission at Wilson School District (case study) is to empower students to create their own future. Teachers put this mission into action by teaching students the 4Cs and providing them with technology skills they’ll need for future success. Students use devices with Google Apps for Education in a 1:1 environment, so they can engage with technology throughout the school day. These tools give students access to countless ideas, perspectives and methods for solving problems, empowering students to ask questions and take a critical approach to learning.

“In pretty much any career path we choose, it’s guaranteed that we will need the knowledge and skills to work with technology,” says Sneha Anmalsetty, a junior at Wilson High School. “The 1:1 initiative is guiding us towards becoming better technology users.”


Boosting collaboration across grade levels


At Wilson School District, second grade students are using Google Hangouts to collaborate via a virtual shared classroom with seventh grade students in New Jersey. The second graders submit science questions using Google Forms that the seventh graders use as inspiration for presentations, videos and other learning tools. Once their research is complete, seventh graders teach virtual classes answering the second graders’ questions.

“The creativity, communication, collaboration and critical thinking skills the students in those two classrooms are developing through the use of Google for Education is life-changing,” says Dr. Amy Flannery, director of curriculum for Wilson SD. “Google’s impact on lesson creation and delivery is radically changing curriculum development.”

We’ve heard great stories from many of you about how you’re using technology to do amazing things in your schools, so were going across the U.S. to see for ourselves! Check out the map below to see where we’ve been. We’d love to hear what’s happening in your state, so please share your story on Twitter or Google+ and tag us (@GoogleForEdu) or include the #GoogleEdu hashtag.





Read More..

Friday, February 12, 2016

Using schema org markup to promote your critic reviews within Google Search

Posted by Jonathan Wald, Product Manager

When Google announced Rich Snippets for reviews six years ago, it provided publishers with an entirely new way to promote their content by incorporating structured markup into their webpages. Since then, structured data has only become more important to Google Search and we’ve been building out the Knowledge Graph to better understand the world, the web, and users’ queries. When a user asks “did ex machina get good reviews?”, Google is now aware of the semantics - recognizing that the user wants critic reviews for the 2015 film Ex Machina and, equally importantly, where to find them.

With the recent launch of critic reviews in the Knowledge Graph, we’ve leveraged this technology to once again provide publishers with an opportunity to increase the discoverability and consumption of their reviews using markup. This feature, available across mobile, tablet, and desktop, organizes publishers’ reviews into a prominent card at the top of the page.

By using markup to identify their reviews and how they relate to Knowledge Graph entities, publishers can increase the visibility of their reviews and expose their reviews to a new audience whenever a Knowledge Graph card for a reviewed entity is surfaced.

Critic reviews are currently launched for movie entities, but we’re expanding the feature to other verticals like TV shows and books this year! Publishers with long-form reviews for these verticals can get up and running by selecting snippets from their reviews and then adding schema.org markup to their webpages. This process, detailed in our critic reviews markup instructions, allows publishers to communicate to Google which snippet they prefer, what URL is associated with the review, and other metadata about the reviewed item that allows us to ensure that we’re showing the right review for the right entity.

Google can understand a variety of markup formats, including the JSON+LD data format, which makes it easier than ever to incorporate structured data about reviews into your webpage! Get started here.


Read More..

How To recalibrate battery life on HTC devices

This method is an official one, recommended by the HTC Technical Support Team. Finally we have some alternative to the old myth related with re-calibrating the battery by removing the batterystats.bin file from /data/system location, as it has no impact on the battery life.

So if youre having some problems with battery life, for example it rapidly or erratically discharges (the battery indicator says 18% left but then suddenly, 5 seconds later your device is OFF) this procedure should help, as it clears all battery stats, coordinates and normalizes charging. At least HTC Technical Support says that :)

The procedure is simple:
  1. Make sure that Fastboot option is disabled in Power settings.
  2. Turn off your phone.
  3. Plug phone into HTC charger and charge for two minutes or more.
  4. While charging, hold down volume-up + volume-down + power button and continue holding. Phone will turn on and off repeatedly every 15 seconds or so while continuing to hold all three buttons.
  5. Keep this going for 2 minutes, then release all buttons when phone is ON.
  6. Now, let phone charge fully normally (with phone either on or off) and battery level reporting, charging and battery life should be normalized.
So... have you tried it? Did it help? Let me know!

Do you have any questions or comments? Feel free to share! Also, if you like this article, please use media sharing buttons (Twitter, G+, Facebook) below this post!


For latest news follow Android Revolution HD on popular social platforms:

Read More..

More pictures of HTC M7 and HTC Sense 5 0

It seems that leaked yesterday pictures of the HTC M7 were not a fake. Today we have another portion of a promising photos, this time published by androidpolice.com.

Source: www.androidpolice.com

Watermark on the screen makes those images trustworthy. Its a common watermark used by HTC in beta-software. Looking at the lock-screen I can say that HTC 5.0 is not that minor update as some have stated. I must say Im getting more and more excited about it. And this is the back of the device:

Source: www.androidpolice.com
The back of the device seems to be made from the same material as HTC One X+. Actually it looks quite the same with only flash led moved to the other side and slightly different camera body.

There are also more screenshots of HTC Sense 5.0.

Source: www.androidpolice.com

The one on the left seems to be some kind of weather app connected with initial setup screen or some social center. In the center and the right you can see more details about incoming software like HTC SDK API or kernel version. The rest is protected by HTC, which is also very common in beta-software. It looks quite promising, dont you think so?

UPDATE 24.01.2013

Here are some more screenshots taken on HTC Droid DNA device by mdeejay from xda-developers:




This looks very good! Hopefully well see new HTC UI on HTC One X/X+ as well.

Do you have any questions or comments? Feel free to share! Also, if you like this article, please use media sharing buttons (Twitter, G+, Facebook) below this post!


For latest news follow Android Revolution HD on popular social platforms:

Read More..

Google Calendar API invites users to great experiences

Posted by Wesley Chun, Developer Advocate, Google Apps

Have you ever booked a dining reservation, plane ticket, hotel room, concert ticket, or seats to the game from your favorite app, only to have to exit that booking app to enter the details into your calendar? It doesn’t make for a friendly user experience. Why can’t today’s apps do that for you automatically?

In case you missed it the episode 97 of #GoogleDev100 the other week, I aim to inspire how app developers can streamline that process with the help of the Google Calendar API. A short Python script, anchored by the following snippet, is illustrated to show developers how easy it is to programmatically add calendar events:


CALENDAR = apiclient.discovery.build(calendar, v3, http=creds.authorize(Http()))
GMT_OFF = -07:00 # PDT/MST/GMT-7
EVENT = {
summary: Dinner with friends,
start: {dateTime: 2015-09-18T19:00:00%s % GMT_OFF},
end: {dateTime: 2015-09-18T22:00:00%s % GMT_OFF},
attendees: [
{email: friend1@example.com},
{email: friend2@example.com},
],
}
CALENDAR.events().insert(calendarId=primary, body=EVENT).execute()


For deeper dive into the script, check out the corresponding blogpost. With code like that, your app can automatically insert your relevant events into your users’ calendars, saving them the effort of manually doing it themselves. One of the surprising aspects is that a limited set of actions, such as RSVPing, is even available to non-Google Calendar users. By the way, inserting events is just the beginning. Developers can also delete or update events instantly in case that upcoming dinner gets pushed back a few weeks. Events can even be repeated with a recurrence rule. Attachments are also supported so you can provide your users a PDF of the concert tickets they just booked. Those are just some of the things the API is capable of.

Ready to get started? Much more information, including code samples in Java, PHP, .NET, Android, iOS, and more, can be found in the Google Calendar API documentation. If you’re new to the Launchpad Online developer series, we share technical content aimed at novice Google developers… the latest tools and features with a little bit of code to help you launch that app. Please give us your feedback below and tell us what topics you would like to see in future episodes!

Read More..

Love Messages and Quotes Pictures and Photos 2016


geby21.blogspot.com - Love Messages and Saying pictures and Photos 2016 Special day to say I love You you is now nore far away. Some one is waiting to listen I love to you from your lips.What are you waiting for? If you are not able to speak in front of him/her. Choose either of the Love Message 2016 given here or Take out the I love you (Love Quote) from here and send it to some one special.

Happy Love Message 2016 (Love Quotes)Love Messages and Quotes Pictures and Photos 2016Read more »
Read More..