Tutorial by Examples: c

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 ...
9.0 // Since the anchor system simply returns constraints, you still need to add them somewhere. View.AddConstraints( new[] { someLabel.TopAnchor.ConstraintEqualTo(TopLayoutGuide.GetBottomAnchor()), anotherLabel.TopAnchor.ConstraintEqualTo(someLabel.BottomAnchor, 6), ...
// Using Visual Format Language requires a special look-up dictionary of names<->views. var views = new NSDictionary( nameof(someLabel), someLabel, nameof(anotherLabel), anotherLabel, nameof(oneMoreLabel), oneMoreLabel ); // It can also take a look-up dictionary for metrics (...
It is possible to mount a host directory to a specific path in your container using the -v or --volume command line option. The following example will mount /etc on the host to /mnt/etc in the container: (on linux) docker run -v "/etc:/mnt/etc" alpine cat /mnt/etc/passwd (on windows) do...
Usage: docker logs [OPTIONS] CONTAINER Fetch the logs of a container -f, --follow=false Follow log output --help=false Print usage --since= Show logs since timestamp -t, --timestamps=false Show timestamps --tail=all Number o...
Before Python 3.5+ was released, the asyncio module used generators to mimic asynchronous calls and thus had a different syntax than the current Python 3.5 release. Python 3.x3.5 Python 3.5 introduced the async and await keywords. Note the lack of parentheses around the await func() call. import ...
Note: Uses the Python 3.5+ async/await syntax asyncio supports the use of Executor objects found in concurrent.futures for scheduling tasks asynchronously. Event loops have the function run_in_executor() which takes an Executor object, a Callable, and the Callable's parameters. Scheduling a task f...
Bad locking: std::mutex mtx; void bad_lock_example() { mtx.lock(); try { foo(); bar(); if (baz()) { mtx.unlock(); // Have to unlock on each exit point. return; } quux(); mtx.unlock(); // Normal...
By default, containers created with docker run are given a random hostname. You can give the container a different hostname by passing the --hostname flag: docker run --hostname redbox -d ubuntu:14.04
First, remove autopublish. autopublish automatically publishes the entire database to the client-side, and so the effects of publications and subscriptions cannot be seen. To remove autopublish: $ meteor remove autopublish Then you can create publications. Below is a full example. import { Mon...
A global publication does not possess a name and does not require a subscription from the connected client and therefore it is available to the connected client as soon as the client connects to the server. To achieve this, one simply names the publication as null like so Meteor.publish(null, func...
A named publication is one that possesses a name and needs to be explicitly subscribed to from the client. Consider this server side code: Meteor.publish('somePublication', function() { return SomeCollection.find() }) The client needs to request it by: Meteor.subscribe('somePublication') ...
Meteor's default templating system Spacebars and its underlying rendering subsystem Blaze integrate seemlessly with publication lifecycle methods such that a simple piece of template code can subscribe to its own data, stop and clean up its own traces during the template tear down. In order to tap ...
Example Application-extending class for handling the reporting: @ReportsCrashes( formUri = "https://backend-of-your-choice.com/",//Non-password protected. customReportContent = { /* */ReportField.APP_VERSION_NAME, ReportField.PACKAGE_NAME,ReportField.ANDROID_VERSION, R...
This will show the user location on the map Objective-C [self.map setShowsUserLocation:YES]; Swift self.map?.showsUserLocation = true This will track the user location on the map, updating regions according Objective-C [self.map setUserTrackingMode:MKUserTrackingModeFollow]; Swift s...
Adding properties If you'd like to add properties to an existing object, you can use the Add-Member cmdlet. With PSObjects, values are kept in a type of "Note Properties" $object = New-Object -TypeName PSObject -Property @{ Name = $env:username ID = 12 Address...
You may need to expand or shrink your pointer storage space after you have allocated memory to it. The void *realloc(void *ptr, size_t size) function deallocates the old object pointed to by ptr and returns a pointer to an object that has the size specified by size. ptr is the pointer to a memory b...
Since C++14, the standard provides the class template template <class T, T... Ints> class integer_sequence; template <std::size_t... Ints> using index_sequence = std::integer_sequence<std::size_t, Ints...>; and a generating metafunction for it: template <class T, T N&g...
A simple way of selecting between functions at compile time is to dispatch a function to an overloaded pair of functions that take a tag as one (usually the last) argument. For example, to implement std::advance(), we can dispatch on the iterator category: namespace details { template <clas...
The array_intersect function will return an array of values that exist in all arrays that were passed to this function. $array_one = ['one', 'two', 'three']; $array_two = ['two', 'three', 'four']; $array_three = ['two', 'three']; $intersect = array_intersect($array_one, $array_two, $array_thre...

Page 100 of 826