Tutorial by Examples: c

It is sometimes useful to integrate a custom error logging framework to ensure all exceptions are logged. [ServiceContract] [ErrorHandler] public interface IMyService { } [AttributeUsage(AttributeTargets.Interface)] public class CustomErrorHandler : Attribute, IContractBehavior, IE...
Lets say you have a simple ApiController like this: [HttpGet] [Route("test")] public dynamic Test() { dynamic obj = new ExpandoObject(); obj.prop1 = "some string"; obj.prop2 = 11; obj.prop3 = "another string"; ...
Setup Install AWS CLI AWS CLI is an common CLI tool for managing the AWS resources. With this single tool we can manage all the aws resources sudo apt-get install -y python-dev python-pip sudo pip install awscli aws --version aws configure Bash one-liners cat <file> # output a file ...
This example shows how to take image and display it correctly on the Android device. Firstly we have to create sample application with one button and one imageview. Once user clicks on the button camera is launched and after user selects picture it will be displayed with the proper orientation on ...
import tensorflow as tf filename_queue = tf.train.string_input_producer(["file.csv"], num_epochs=1) reader = tf.TextLineReader() key, value = reader.read(filename_queue) col1, col2 = tf.decode_csv(value, record_defaults=[[0], [0]]) with tf.Session() as sess: sess.run(tf.initializ...
TFRecord files is the native tensorflow binary format for storing data (tensors). To read the file you can use a code similar to the CSV example: import tensorflow as tf filename_queue = tf.train.string_input_producer(["file.tfrecord"], num_epochs=1) reader = tf.TFRecordReader() key, s...
A trait is a reusable set of methods and fields that can be added to one or more classes. trait BarkingAbility { String bark(){ "I'm barking!!" } } They can be used like normal interfaces, using implements keyword: class Dog implements BarkingAbility {} def d = new Dog() asser...
List of commonly used S3 AWS CLI Commands Create Bucket aws s3 mb s3://bucket-name Remove Bucket aws s3 rb s3://bucket-name List Buckets aws s3 ls List contents inside the bucket aws s3 ls s3://bucket-name List Bucket with a path aws s3 ls s3://bucket-name/path Copy file aws s3...
Basic grid In Ionic you can declare rows by setting the row class to a element. Rows will be elements which are horizontally aligned and anything inside this element everything will belong to the row. Inside the row you can declare different width columns. You have a choice of the following declara...
Almost every application has some kind of a list. Ionic has it's own build-in ready-to-go list item CSS declarations to make it easy to do lists inside your application. You can either use HTML elements and declare a class for the or use the directive ion-list to make them. Example of a directive is...
Preset Ionic CSS will have a theme and pre-set colors for it. You can modify or override the basic values in the ionic.css or in your custom CSS file. You can also define these with SASS and to use SASS in Ionic you just need to run the ionic setup sass command in your terminal. Basic usage of colo...
Assume you want to undo a dozen of commits and you want only some of them. git rebase -i <earlier SHA> -i puts rebase in "interactive mode". It starts off like the rebase discussed above, but before replaying any commits, it pauses and allows you to gently modify each commit as i...
docker logs --follow <containerid> This tails the output of the running container. This is useful if you did not set up a logging driver on the docker daemon.
If you use the LOAD DATA INFILE command to populate a table with existing data, you will often find that the import fails due to duplicates. There are several possible ways to overcome this problem. LOAD DATA LOCAL If this option has been enabled in your server, it can be used to load a file that ...
By default the ArrayAdapter creates a view for each array item by calling toString() on each item and placing the contents in a TextView. Example: ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, myStringArray); where androi...
AmCharts provides a load-balanced, reliable CDN for loading the libraries directly from our web server. Use https://www.amcharts.com/lib/3/ as a base URL for includes. <script src="https://www.amcharts.com/lib/3/amcharts.js"></script> <script src="https://www.amcharts...
Besides main required functional includes, you may need other includes, like themes and plugins. Those reside in /themes/ and /plugins/ sub-directories respectively. I.e.: <script src="https://www.amcharts.com/lib/3/amcharts.js"></script> <script src="https://www.amc...
The CEILING function rounds a number up, away from zero, to the nearest multiple of significance. The FLOOR function does the same by rounds the number down towards zero. An example of when CEILING could be be used is if you want to avoid using pennies in your prices and your product is priced at $...
The FIXED function rounds a number to the specified number of decimals defined by the decimals parameter, formats the number in decimal format using a comma as a separator unless specified as not required defined by the parameter no_commas, and returns the result as text. The decimals parameter is o...
The where construct, available in Fortran90 onwards represents a masked do construct. The masking statement follows the same rules of the if statement, but is applied to all the elements of the given array. Using where allows operations to be carried out on an array (or multiple arrays of the same s...

Page 566 of 826