Tutorial by Examples: c

By default, Shapes in Excel do not have a specific way to handle single vs. double clicks, containing only the "OnAction" property to allow you to handle clicks. However, there may be instances where your code requires you to act differently (or exclusively) on a double click. The follow...
See the below transactions collection. > db.transactions.insert({ cr_dr : "D", amount : 100, fee : 2}); > db.transactions.insert({ cr_dr : "C", amount : 100, fee : 2}); > db.transactions.insert({ cr_dr : "C", amount : 10, fee : 2}); > db.transactions.in...
db.collection.getIndexes(); Output [ { "v" : 1, "key" : { "_id" : 1 }, "name" : "_id_", "ns" : "documentation_db.transactions" }, { "v&quo...
Useful information The very beginning of the text field text: let startPosition: UITextPosition = textField.beginningOfDocument The very end of the text field text: let endPosition: UITextPosition = textField.endOfDocument The currently selected range: let selectedRange: UITextRange? = tex...
Edit /etc/init/docker.conf and update the DOCKER_OPTS variable to the following: DOCKER_OPTS='-H tcp://0.0.0.0:4243 -H unix:///var/run/docker.sock' Restart Docker deamon service docker restart Verify if Remote API is working curl -X GET http://localhost:4243/images/json
The system_clock can be used to measure the time elapsed during some part of a program's execution. c++11 #include <iostream> #include <chrono> #include <thread> int main() { auto start = std::chrono::system_clock::now(); // This and "end"'s type is std::chron...
This example shows how a function can accept pipelined input, and iterate efficiently. Note, that the begin and end structures of the function are optional when pipelining, but that process is required when using ValueFromPipeline or ValueFromPipelineByPropertyName. function Write-FromPipeline{ ...
This is an example of a function with the simplest possible support for pipelining. Any function with pipeline support must have at least one parameter with the ParameterAttribute ValueFromPipeline or ValueFromPipelineByPropertyName set, as shown below. function Write-FromPipeline { param( ...
Prevent access to your .htaccess file <Files .htaccess> order allow,deny deny from all </Files> # Rename the file AccessFileName thehtfile.ess Prevent URL attacks # Enable rewrites RewriteEngine On # Block <script> tags from executing in the URL RewriteCond %{QUE...
With generics, it's possible to return whatever the caller expects: private Map<String, Object> data; public <T> T get(String key) { return (T) data.get(key); } The method will compile with a warning. The code is actually more safe than it looks because the Java runtime will d...
Use case scenario: A table view consists of different columns with different data format that needs to be transformed with different pipes. table.component.ts ... import { DYNAMIC_PIPES } from '../pipes/dynamic.pipe.ts'; @Component({ ... pipes: [DYNAMIC_PIPES] }) export class Tabl...
Assuming we have a TravelReview table with City names as column "title" Criteria criteria = session.createCriteria(TravelReview.class); List review = criteria.add(Restrictions.eq("title", "Mumbai")).list(); System.out.println("Using equals: "...
Should we wish to retrieve only a few columns, we can use the Projections class to do so. For example, the following code retrieves the title column // Selecting all title columns List review = session.createCriteria(TravelReview.class) .setProjection(Projections.property("titl...
Rust programs use pattern matching extensively to deconstruct values, whether using match, if let, or deconstructing let patterns. Tuples can be deconstructed as you might expect using match fn foo(x: (&str, isize, bool)) { match x { (_, 42, _) => println!("it's 42"),...
This example discusses extending the below type class. trait Show[A] { def show: String } To make a class you control (and is written in Scala) extend the type class, add an implicit to its companion object. Let us show how we can get the Person class from this example to extend Show: class...
If we just try the following: import json from datetime import datetime data = {'datetime': datetime(2016, 9, 26, 4, 44, 0)} print(json.dumps(data)) we get an error saying TypeError: datetime.datetime(2016, 9, 26, 4, 44) is not JSON serializable. To be able to serialize the datetime object p...
The Common Language Runtime (CLR) is a virtual machine environment and part of the .NET Framework. It contains: A portable bytecode language called Common Intermediate Language (abbreviated CIL, or IL) A Just-In-Time compiler that generates machine code A tracing garbage collector that provides...
# provision/bootstrap-controller.sh : path and shell filename from vagrantfile location config.vm.define "configcontroller" do |controller| ... controller.vm.provision :shell do |shell| shell.path = "provision/bootstrap-controller.sh" end ...
Considering the following document : <?xml version='1.0' encoding='UTF-8' ?> <library> <book id='1'>Effective Java</book> <book id='2'>Java Concurrency In Practice</book> </library> One can use the following code to build a DOM tree out of a St...
Considering the following document : <?xml version='1.0' encoding='UTF-8' ?> <library> <book id='1'>Effective Java</book> <book id='2'>Java Concurrency In Practice</book> <notABook id='3'>This is not a book element</notABook> </librar...

Page 328 of 826