Showing posts with label list. Show all posts
Showing posts with label list. Show all posts

Wednesday, March 11, 2015

Documents List API Best Practices Batching ACL entries

ACL (Access Control List) entries control who can access Google Docs resources. This allows more specific control over resource privacy or permissions.

Many types of applications need to grant document access for several users at once. As an example: when a new user is added to a project in the Manymoon project management application, every user on the project needs to be granted access to all attached Google docs. If there are 10 users on the project and 10 shared documents, this means the app would typically need to perform 100 HTTP requests -- a lot of overhead. With batching of ACL requests, the application can reduce the number of requests to one per document, resulting in a 10x savings.

Before Batching

A typical ACL entry for a single user is created by making an HTTP POST to the ACL link provided with each resource entry. The POST body looks something like this:

<entry xmlns="http://www.w3.org/2005/Atom"
xmlns:gAcl=http://schemas.google.com/acl/2007>
<category scheme=http://schemas.google.com/g/2005#kind
term=http://schemas.google.com/acl/2007#accessRule/>
<gAcl:role value=writer/>
<gAcl:scope type=user value=new_writer@example.com/>
</entry>

To achieve the same thing using the Python client library, use the following code:

from gdata.acl.data import AclScope, AclRole
from gdata.docs.data import AclEntry

acl = AclEntry(
scope = AclScope(value=user@example.com, type=user),
role = AclRole(value=writer)
)

With Batching

Instead of submitting the requests separately, multiple ACL operations for a resource can be combined into a single batch request. This is done by POSTing a feed of ACL entries. Each ACL entry in the feed must have a special batch:operation element, describing the type of operation to perform on the ACL entry. Valid operations are query, insert, update, and delete.

<feed xmlns="http://www.w3.org/2005/Atom"
xmlns:gAcl=http://schemas.google.com/acl/2007
xmlns:batch=http://schemas.google.com/gdata/batch>
<category scheme=http://schemas.google.com/g/2005#kind
term=http://schemas.google.com/acl/2007#accessRule/>
<entry>
<category scheme=http://schemas.google.com/g/2005#kind
term=http://schemas.google.com/acl/2007#accessRule/>
<gAcl:role value=reader/>
<gAcl:scope type=domain value=example.com/>
<batch:operation type=insert/>
</entry>
<entry>
<category scheme=http://schemas.google.com/g/2005#kind
term=http://schemas.google.com/acl/2007#accessRule/>
<id>https://docs.google.com/feeds/default/private/full/document%3Adocument_id/acl/user%3Aold_writer%40example.com</id>
<gAcl:role value=writer/>
<gAcl:scope type=user value=new_writer@example.com/>
<batch:operation type=update/>
</entry>
</feed>

The following code represents the same operation in the Python client library:

from gdata.data import BatchOperation
from gdata.acl.data import AclScope, AclRole
from gdata.docs.data import AclEntry

acl1 = AclEntry(
scope=AclScope(value=example.com, type=domain),
role=AclRole(value=reader),
batch_operation=BatchOperation(type=insert)
)

acl2 = client.get_acl_entry_by_self_link(
(https://docs.google.com/feeds/default/private/full/
document%3Adocument_id/acl/user%3Aold_writer%40example.com))
acl2.scope = AclScope(value=new_writer@example.com, type=user)
acl2.role = AclRole(value=writer)
acl2.batch_operation = BatchOperation(type=update)

entries = [acl1, acl2]

The feed of these entries can now be submitted together to apply to a resource:

results = client.batch_process_acl_entries(resource, entries)

The return value is an AclFeed, with a list of AclEntry elements for each operation, the status of which can be checked individually:

for result in results.entry:
print entry.title.text, entry.batch_status.code

The examples shown here are using the raw protocol or the Python client library. The Java client library also supports batch operations on ACL entries.

For more information on how to use batch operations when managing ACLs, see the Google Documents List API documentation, and the Google Data APIs batch protocol reference guide. You can also find assistance in the Google Documents List API forum.


Ali Afshar profile | twitter

Ali is a Developer Programs engineer at Google, working on Google Docs and the Shopping APIs which help shopping-based applications upload and search shopping content. As an eternal open source advocate, he contributes to a number of open source applications, and is the author of the PIDA Python IDE. Once an intensive care physician, he has a special interest in all aspects of technology for healthcare.

Read more »

Tuesday, March 10, 2015

Retiring the Google Documents List API v3

With the arrival of the new Google Drive API v2, we are deprecating the Google Documents List API v3. We are confident that the Google Drive API covers all the functionality of the Documents List API, in addition to adding many improvements, including Drive UI Integration, a finer grained security model, and a better client library experience.

What does this mean for your app?

The Documents List API v3 will remain in action for more than a year, as per our deprecation policy, so there’s no rush, but we encourage you to migrate your code to the new platform. Documentation is available with samples in multiple languages and a migration guide outlining some of the major transition points.

If you have any questions or issues, please ask them on StackOverflow.com, where our team is waiting to hear from you.

Ali Afshar profile | twitter

Tech Lead, Google Drive Developer Relations. As an eternal open source advocate, he contributes to a number of open source applications, and is the author of the PIDA Python IDE. Once an intensive care physician, he has a special interest in all aspects of technology for healthcare

Read more »

Sunday, March 1, 2015

A Growing List of Free Learning Tutorial Sites!

  • Wiki-version - A Growing List of Free Learning Tutorial Sites

I was thinking the other day, why not create a simple raw list of links to EXCELLENT SITES (with short descriptions) that have or link to tutorials that explore learning tools and online learning. Here is my initial list, but I am quite sure there are many more great resource sites out there. So, if you have anyone to share, please post them in the comments section and I will add them. Ops, shouldnt we be using a Wiki for this kind of activity (Collaborative list creation)? Click here, if you want to add using the wiki-version.

Here is the initial quick list:
  • Learning 2.0 Programme
    This blog has been set-up as part of PLCMCs Learning 2.0 project to encourage staff to experiment and learn about the new and emerging technologies that are reshaping the context of information on the Internet today.
  • An Introduction to Social Learning(Jane Hart)
    Provides you with a practical approach to getting started with using social media for both formal and informal learning - either in the form of best-of-breed stand-alone tools or in an integrated suite of social media tools.
  • ELearning T4T (WikiEducator)
    eLearning Training for Teachers is a project node for the collaborative development of "just-in-time" tutorials to help educators implement eLearning successfully.
  • WebTools4u2use
    The purpose of this website is to provide a place for K-12 school library media specialists to learn a little more about web tools that can be used to improve and enhance school library media programs and services, to see examples of how they can be used, and to share success stories and creative ideas about how to use and integrate them. Hundreds of free and inexpensive web tools are available for school library media specialists to use that can make us more productive, valued, and, perhaps, more competitive.
  • Pauls E-Learning Resources
    This E-learning resources website is developed and maintained by Paul Andrews (Learning Technologist). On this site you will find his favourite links to free on-line services that allow you to provide your students with enhanced learning opportunities which you can then embed into, or link from, your school/college/universitys website, course blog or VLE/MLE.
  • iLearn technology (Kelly Tenkely)
    Is an edublog dedicated to giving teachers practical tips for integrating technology into the classroom.
  • Resource Kit for Creative Communities (e-Learning)
    In this resource kit, community organisations can find helpful online guidance, ideas and tools for developing and facilitating e-learning in communities and regions. The kit includes suggestions and options on the why and how of e-learning. Youll find guidance on low cost tools and technologies, as well as ideas and stories to help you get started.
  • Teacher Training Videos (Russell Stannard)
    These videos were created for teachers to help them to incorporate technology into their teaching. Just click and a video will open and take you through how to use that technology. These videos are for any teachers or lecturers, indeed for anyone interested in learning how to use the technologies.
  • WonderHowTo
    Hand-selects and curates the best instructional videos from over 1,700 websites. It is your one-stop shop to browse, search, or network your way through the world of free video tutorials.
  • EduTube
    Is a educational video search platform with an main aim to organize the best educational video content on the Internet. All content on EduTube is moderated and only relevant, educational content is permitted.
  • Multimedia Training Videos
    A series of free learning videos (by Russell Stannard and Savraj Matharu) that explore Flash, Director and Photoshop.
  • ItrainOnline Multimedia Training Kit
    Is a growing collection of "workshop kits" for face-to-face training. The materials use a standard set of templates, and offer building blocks for trainers to build their own courses.
  • Teachers TV
    is a digital channel for everyone who works in schools. Their programmes cover every subject in the curriculum, all key stages and every professional role – from teaching assistant to headteacher. You can watch us on digital cable and satellite and programmes are also available anytime, on-demand and for free on this website.
  • TeacherTube
    Its main goal is to provides an online community for sharing instructional videos. Here you will find more than 54,000 videos covering all sorts of subjects.
  • ALISON
    Free Interactive Workplace Skills Courseware including Touch Typing Skills, European Computer Driving Licence (ECDL), British Computer Society (BCS) Unit E, Financial Literacy and e-Citizen
  • The Moodle Academy
    Is designed to be a drop in centre for you to reinforce your Moodle skills. While we are thinking Moodle, we might want to check out Using Moodle 2nd Edition, which is the second edtion of the OReilly book "Using Moodle" by Jason Cole and Helen Foster.
  • Moodle Tutorials
    Ops, cant get Moodle out of my head! Check out this collection of 2 Minute Moodles - an attempt to simplify and show how to use a range of Moodle features. The tutorials try not to assume too much previous knowledge and are presented for the pragmatical and not necessarily tech-savy users (Moodle purists please excuse).
  • Drupal in Education Open book (hosted by e-Learning Institute)
    An open resource started by Bryan Ollendyke at the e-Learning Institute to talk about Drupals place in education. Has a great CMS matrix comparing different CMS technologies that can all be used for education / e-learning. It is a living resource and has contributions from several PSU Drupalers though its open to contribution from any / everyone. Good if you are interested in getting into Drupal for Education.
  • Google Apps Training
    The Google Apps interactive tutorial provides clear audio and text directions and practice exercises for using six Google products; email, calendar, talk, docs, sites, and start page.
  • Go-2-School
    A great resource for learning Google SketchUp and Google Earth.
  • W3Schools
    Here you will find all the Web-building tutorials you need, from basic HTML and XHTML to advanced XML, SQL, Database, Multimedia and WAP.
  • Edumax
    Edumax is an online learning website that provides free lessons on topics from personal development to computer programming.
  • TechTutorials
    A directory containing thousands of free tutorials for IT professionals, hobbyists, and home users.
  • 14 hours of Free E-Learning Strategy Tutorials
    Bryan Chapman, Chief Learning Strategist at Chapman Alliance does regular webinars on e-learning strategies. He posts these for free use from his website. They are a little bit hidden. You have to scroll down the page to find them. NOTE: Because many of the webinars are vendor sponsored, you may have to add your information before watching them, but they are absolutely free.
Contributors:
  • Clayton Wright
  • Mitch Weisburgh
  • Bryan Chapman
  • Zaid Ali Alsagoff
Lets build a great collection together (wiki-version)! Lets use our collective findings to help others discover these great learning tutorial sites :)
Read more »

Wednesday, February 18, 2015

Unrolled Linked List Data Structure

What is Unrolled Linked List?

An Unrolled linked list is a type of link list that stores multiple elements in each node. It is also known as cache sensitive data structure. The term ‘cache’ has been taken from cache memory which is associated with CPU. A cache memory is used to store recently visited pages or data so that they can be made available for RAM immediately without accessing secondary or permanent memory. A typical unrolled linked list can be declared in C as follows.

#define SIZE 50
struct node
{
                int count;            
                int elements[SIZE];
       struct node *next;
};

Each node in the unrolled array contains a certain maximum number of elements. The number of elements are large enough to fill a single cache line. The position of the element in the list can be indicated either by reference or by position in the array. An unrolled linked list can be shown like following.


Unrolled Linked List in Data Structure

The operations those can be performed on an unrolled linked list are insertion and deletion.

Insertion

First of all it is checked if the space is available in the list for inserting a new element. If the space is available, the element is just inserted. When the element is inserted in the array elements, the count variable is incremented by one. If array doesn’t have free space to have an element, we just create a new node, place it after the current node and move half of the elements to newly created node. It creates room/space for the new element.

Deletion

When an element is deleted from the list it is simply removed from the array. If the number of elements in the array falls below N/2, we take the elements from a neighboring array to fill the array. If neighboring array also has N/2 elements then we merge both of the arrays.

Advantages of Unrolled Linked List

1. Due to its cache behavior, the unrolled linked list performs the sequential traversal very rapidly.
2. It requires less storage space.
3. It performs the operations more quickly than ordinary linked list.
4. Indexing time O (N) is reduced to O (N/max), as we are able to process a whole node at a time instead of individual elements.

Disadvantages of Unrolled Linked List

The overhead per node for references and elements count is considerably high.
Read more »