Tutorial by Examples: conte

function getContentTypes(site_url,name_of_the_library){ var ctx = new SP.ClientContext(site_url); var web = ctx.get_web(); list = web.get_lists().getByTitle(name_of_the_library); // You can include any property of the SP.ContentType object (sp.js), for this example we are just ...
It is also possible to write a context manager using generator syntax thanks to the contextlib.contextmanager decorator: import contextlib @contextlib.contextmanager def context_manager(num): print('Enter') yield num + 1 print('Exit') with context_manager(2) as cm: # the ...
The idea is to use HttpContext.Response.OnStarting callback, as this is the last event that is fired before the headers are sent. Add the following to your middleware Invoke method. public async Task Invoke(HttpContext context) { context.Response.OnStarting((state) => { if ...
<p contenteditable>This is an editable paragraph.</p> Upon clicking on the paragraph, the content of it can be edited similar to an input text field. When the contenteditable attribute is not set on an element, the element will inherit it from its parent. So all child text of a conte...
The contentSize property must be set to the size of the scrollable content. This specifies the size of the scrollable area. Scrolling is visible when scrollable area i.e. contentSize is larger than the UIScrollView frame size. With Autolayout: When the scroll view's content is set up using autolay...
A common use case for wanting to calculate the frame a label will take up is for sizing table view cells appropriately. The recommended way of doing this is using the NSString method boundingRectWithSize:options:attributes:context:. options takes String drawing options: NSStringDrawingUsesLineFr...
Events that work with most form elements (e.g., change, keydown, keyup, keypress) do not work with contenteditable. Instead, you can listen to changes of contenteditable contents with the input event. Assuming contenteditableHtmlElement is a JS DOM object that is contenteditable: contenteditableH...
Often people try to index some content and then find it. If they cannot see the expected result, they try to troubleshoot the whole end-to-end process. The better way is to see whether the content actually indexed in the expected fields. This way it splits the problem into two: indexing and searchin...
Use the HTML or <audio> element to embed video/audio content in a document. The video/audio element contains one or more video/audio sources. To specify a source, use either the src attribute or the <source> element; the browser will choose the most suitable one. Audio tag example: &...
You can open several content managers at the same time: with open(input_path) as input_file, open(output_path, 'w') as output_file: # do something with both files. # e.g. copy the contents of input_file into output_file for line in input_file: output_file.write(line...
CREATE CONTEXT my_ctx USING my_pkg; This creates a context that can only be set by routines in the database package my_pkg, e.g.: CREATE PACKAGE my_pkg AS PROCEDURE set_ctx; END my_pkg; CREATE PACKAGE BODY my_pkg AS PROCEDURE set_ctx IS BEGIN DBMS_SESSION.set_context('MY_CTX','...
Using filterUsingPredicate: This Evaluates a given predicate against the arrays content and return objects that match. Example: NSMutableArray *array = [NSMutableArray array]; [array setArray:@[@"iOS",@"macOS",@"tvOS"]]; NSPredicate *predicate = [N...
In order to work with bindings in WPF, you need to define a DataContext. The DataContext tells bindings where to get their data from by default. <Window x:Class="StackOverflowDataBindingExample.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation&q...
This example will show you how to create a simple animation using the canvas and the 2D context. It is assumed you know how to create and add a canvas to the DOM and obtain the context // this example assumes ctx and canvas have been created const textToDisplay = "This is an example that uses...
Creating and returning an image object by loading the image data from the file at the specified path. Example: UIImage *image = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:[cellCountry objectForKey:@"Country_Flag"] ofType:nil]]; Using Array: Example NSM...
The two possible ways of issuing a context.become (replacing or adding the new behavior) are offered separately to enable a clutter-free notation of nested receives: val a = actor(new Act { become { // this will replace the initial (empty) behavior case "info" ⇒ sender() ! "A...
A content script is extension code that runs alongside a normal page. They have full access to the web page's DOM (and are, in fact, the only part of the extension that can access a page's DOM), but the JavaScript code is isolated, a concept called Isolated World. Each extension has its own content...
To read the contents to a file into a string variable: Dim fileContents As String = System.IO.File.ReadAllText("filename.txt") ReadAllText will open the specified file, read data to the end, then close the file. To read a file, separating it into an array element for each line: Dim f...
A simple static file server would look like this: package main import ( "net/http" ) func main() { muxer := http.NewServeMux() fileServerCss := http.FileServer(http.Dir("src/css")) fileServerJs := http.FileServer(http.Dir("src/js")) file...
The @ContentView annotation can be used to further alleviate development of activities and replace the setContentView statement : @ContentView(R.layout.myactivity_layout) public class MyActivity extends RoboActivity { @InjectView(R.id.text1) TextView textView; @Override protected ...

Page 2 of 9