Processing provides a method named line() to draw a line on the screen. This code draws a white 10 pixel line on black background.
void setup() {
size(500, 500);
background(0);
stroke(255);
strokeWeight(10);
}
void draw() {
line(0, 0, 500, 500);
}
The signature of m...
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_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
malloc() often calls underlying operating system functions to obtain pages of memory. But there is nothing special about the function and it can be implemented in straight C by declaring a large static array and allocating from it (there is a slight difficulty in ensuring correct alignment, in pract...
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...
After enabling and creating migrations there might be a need to initially fill or migrate data in your database. There are several possibilities but for simple migrations you can use the method 'Seed()' in the file Configuration created after calling enable-migrations.
The Seed() function retrieves...
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...