Pages

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

Monday, March 9, 2015

Interact with your Google Docs List from Apps Script

We recently added a new feature to Apps Script: the ability to interact with your Google Docs List. With this new integration, scripts can create, rename, or move files and folders in your Google Docs. In addition, scripts can now create, modify, and clear plain-text files and search through your documents for a specified query string.

For instance, take a company whose website is hosted on Google Sites. They have a Specials page where they want to list seasonal sales depending on upcoming holidays. They store the details about the seasonal sales in plain-text files that are saved in their Google Docs List. By using the Google Docs List and and Sites services within Apps Script along with time-based triggers to run the script once per day, they can keep their Specials page updated automatically. Here’s a code snippet that demonstrates how to update the Specials page:


//The Mother’s Day sale runs from May 1 - May 7, 2011
var MOTHERS_DAY_START = new Date("May 1, 2011");
var MOTHERS_DAY_END = new Date("May 7, 2011");
//The Valentine’s Day sale runs from Feb 6 - Feb 13, 2011
var VALENTINES_DAY_START = new Date("February 6, 2011");
var VALENTINES_DAY_END = new Date("February 13, 2011");

function updateSpecials() {
var today = new Date();
var site = SitesApp.getSite("example.com", "giftshop");
// Get all the web pages in the Site
var pages = site.getWebPages();
// Loop through the web pages to find the specials page
for (var i = 0; i < pages.length; i++) {
if (pages[i].getPageName() == "specials") {
var page = pages[i];
}
}
// Set up the default wording for the specials page
var pageText = "There are no specials at this time.";

// If today’s date is within the Mother’s Day sale range
if (today >= MOTHERS_DAY_START && today <= MOTHERS_DAY_END) {
// Find the sale text that’s stored in the file mom.txt
pageText = DocsList.find("mom.txt")[0].getContentAsString();
}
// If today’s date is within the Valentine’s Day sale range
else if (today >= VALENTINES_START && today <= VALENTINES_END ) {
// Find the sale text that’s stored in the file valentines.txt
var pageText = DocsList.find("valentines.txt")[0].getContentAsString()
}
// Set the content of the specials page
page.setContent(pageText);
}​




If this script is then set up to run using a trigger that calls it at the same time each day, then the Specials page will be kept automatically up-to-date.

To help you learn more, weve created a tutorial that demonstrates how to search and display information about files, create files, and read content from files.

Note that certain features of the DocsList service, such as creating files, are only available to Google Apps accounts. For complete information on interacting with your Google Docs List using Apps Script, see the DocsList Service documentation.

We look forward to seeing how you use this integration. If youd like to learn more about Apps Script and meet the Apps Script team in person, join us at the upcoming Apps Script hackathon in New York City on June 24.

Read more »

Friday, February 13, 2015

List of all useful Turbo C keyboard shortcuts

List of all useful Turbo C++ keyboard shortcuts

Hi friends this is first time that I am sharing something other than C++ program on this blog.In this post I am going to share some useful Turbo C++ keyboard shortcuts.I am sure that with the help of these shortcuts you can increase your working speed in TC compiler.

Also Read: How to write and run c/c++ programs in Ubuntu

Turbo C++ keyboard shortcuts

S.No.
Shortcuts keys
Action
1.
F1
For Help
2.
F2
Save
3.
F3
Open
4.
F4
Go to cursor
5.
F5
Zoom
6.
F6
Next
7.
F7
Trace into
8.
F8
Step over
9.
F9
Make
10.
F10
Menu
11.
Alt+X
Quit
12.
Alt+Bksp
Undo
13.
Shift+Alt+Bksp
Redo
14.
Shift+Del
Cut
15.
Ctrl+Ins
Copy
16.
Shift+Ins
Paste
17.
Ctrl+Del
Clear
18.
Ctrl+L
Search again
19.
Alt+F7
Previous error
20.
Alt+F8
Next error
21.
Ctrl+F9
Run
22.
Ctrl+F2
Program reset
23.
Alt+F9
Compile
24.
Alt+F4
Inspect
25.
Ctrl+F4
Evaluate/Modify
26.
Ctrl+F3
Call stack
27.
Ctrl+F8
Toggle breakpoint
28.
Ctrl+F5
Size/Move
29.
Alt+F3
Close
30.
Alt+F5
User screen
31.
Alt+0
List all
32.
Shift+F1
Index
33.
Ctrl+F1
Topic search
34.
Alt+F1
Previous topic
35.
Ctrl+F7
Add watch
Read more »