Tutorial by Examples: c

Objective-C Just log this see how to use a particular filter NSArray *properties = [CIFilter filterNamesInCategory:kCICategoryBuiltIn]; for (NSString *filterName in properties) { CIFilter *fltr = [CIFilter filterWithName:filterName]; NSLog(@"%@", [fltr a...
Heap sort is a comparison based sorting technique on binary heap data structure. It is similar to selection sort in which we first find the maximum element and put it at the end of the data structure. Then repeat the same process for the remaining items. Pseudo code for Heap Sort: function heapsor...
Presumably the simplest way to use compose is with a View only. This allows you to include HTML templates without the need to declare a ViewModel with bindable properties for each of them, making it easier to reuse smaller pieces of HTML. The BindingContext (ViewModel) of the View will be set to th...
Using compose with a View, ViewModel and Model is an easy way to reuse and combine different Views and ViewModels. Given the following View and ViewModel (applies to each alternative below): src/greeter.html <template> <h1>Hello, ${name}!</h1> </template> src/gree...
Note: at is not installed by default on most of modern distributions. To execute a job once at some other time than now, in this example 5pm, you can use echo "somecommand &" | at 5pm If you want to catch the output, you can do that in the usual way: echo "somecommand > o...
public class InsertionSort { public static void SortInsertion(int[] input, int n) { for (int i = 0; i < n; i++) { int x = input[i]; int j = i - 1; while (j >= 0 && input[j] > x) { input...
There are quite a number situations where one has huge amounts of data and using which he has to classify an object in to one of several known classes. Consider the following situations: Banking: When a bank receives a request from a customer for a bankcard, the bank has to decide whether to issue...
Uses C standard format codes. from datetime import datetime datetime_string = 'Oct 1 2016, 00:00:00' datetime_string_format = '%b %d %Y, %H:%M:%S' datetime.strptime(datetime_string, datetime_string_format) # datetime.datetime(2016, 10, 1, 0, 0)
Uses C standard format codes. from datetime import datetime datetime_for_string = datetime(2016,10,1,0,0) datetime_string_format = '%b %d %Y, %H:%M:%S' datetime.strftime(datetime_for_string,datetime_string_format) # Oct 01 2016, 00:00:00
Let's say we have 8 houses. We want to setup telephone lines between these houses. The edge between the houses represent the cost of setting line between two houses. Our task is to set up lines in such a way that all the houses are connected and the cost of setting up the whole connection is mini...
FullCalendar can be downloaded from it's website: https://fullcalendar.io/download/ from NPM: $ npm install fullcalendar from Bower: $ bower install fullcalendar or CDNJS: //cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.0.1/fullcalendar.min.js //cdnjs.cloudflare.com/ajax/libs/fullca...
class Program { static void Main(string[] args) { //Initialize a new container WindsorContainer container = new WindsorContainer(); //Register IService with a specific implementation and supply its dependencies container.Register(Component.For<ISer...
CASE lv_foo. WHEN 1. WRITE: / 'lv_foo is 1'. WHEN 2. WRITE: / 'lv_foo is 2'. WHEN 3. WRITE: / 'lv_foo is 3'. WHEN OTHERS. WRITE: / 'lv_foo is something else'. ENDCASE
CHECK is a simple statement that evaluates a logical expression and exits the current processing block if it is false. METHOD do_something. CHECK iv_input IS NOT INITIAL. "Exits method immediately if iv_input is initial "The rest of the method is only executed if iv_input is not i...
When run with no arguments, this program starts a TCP socket server that listens for connections to 127.0.0.1 on port 5000. The server handles each connection in a separate thread. When run with the -c argument, this program connects to the server, reads the client list, and prints it out. The clie...
Consider the following Java classes: class Foo { private Bar bar; public void foo() { bar.baz(); } } As can be seen, the class Foo needs to call the method baz on an instance of another class Bar for its method foo to work successfully. Bar is said to be a dependency for Foo sin...
The same examples as shown above with XML configuration can be re-written with Java configuration as follows. Constructor injection @Configuration class AppConfig { @Bean public Bar bar() { return new Bar(); } @Bean public Foo foo() { return new Foo(bar()); } } Property in...
Dependencies can be autowired when using the component scan feature of the Spring framework. For autowiring to work, the following XML configuration must be made: <context:annotation-config/> <context:component-scan base-package="[base package]"/> where, base-package is th...
Constructor injection through Java configuration can also utilize autowiring, such as: @Configuration class AppConfig { @Bean public Bar bar() { return new Bar(); } @Bean public Foo foo(Bar bar) { return new Foo(bar); } }
Uses the .Net Client library PM> Install-Package Google.Apis.Analytics.v3 var metadataService = new AnalyticsMetaDataService(new BaseClientService.Initializer() { ApiKey = {Public API KEY}, ApplicationName = "Metadata api", ...

Page 605 of 826