Tutorial by Examples: code

The only action method you need to add is to add an action link present below <a href='@Url.Action("Import", "Home")'>Import Google Contacts</a>
using System.Windows; namespace SDKSample { public partial class ControlTemplateButtonWindow : Window { public ControlTemplateButtonWindow() { InitializeComponent(); } void button_Click(obje...
The hash codes produced by GetHashCode() method for built-in and common C# types from the System namespace are shown below. Boolean 1 if value is true, 0 otherwise. Byte, UInt16, Int32, UInt32, Single Value (if necessary casted to Int32). SByte ((int)m_value ^ (int)m_value << 8); Char...
To add a code block, surround it with #+BEGIN_SRC language and #+END_SRC. language should correspond to the major mode for the language in question, e.g. the major mode for Emacs Lisp is emacs-lisp-mode, so write #+BEGIN_SRC emacs-lisp. #+BEGIN_SRC emacs-lisp (defun hello-world () (interactive)...
SVN FreeBSD project use SVN as default SCM. Source could be download with svnlite software. Get Current cd /usr/src svnlite checkout https://svn.freebsd.org/base/head . Get Releases cd /usr/src svnlite checkout https://web.freebsd.org/base/release/11.0.0 . Tarball (http & ftp) You c...
Objects that are not built-in To print the source code of a Python object use inspect. Note that this won't work for built-in objects nor for objects defined interactively. For these you will need other methods explained later. Here's how to print the source code of the method randint from the ran...
First import #import <QuartzCore/QuartzCore.h> into your ViewController class. Here is how I set my view in code UIView *view1=[[UIView alloc]init]; view1.backgroundColor=[UIColor colorWithRed:255/255.0 green:193/255.0 blue:72/255.0 alpha:1.0]; CGRect view1Frame = view1.frame; view1Frame....
HTML to NSAttributedString conversion Code :- //HTML String NSString *htmlString=[[NSString alloc]initWithFormat:@"<!DOCTYPE html><html><body><h1>My First Heading</h1><p>My first paragraph.</p></body></html>"]; //Converting HTML s...
Most examples of a function returning a value involve providing a pointer as one of the arguments to allow the function to modify the value pointed to, similar to the following. The actual return value of the function is usually some type such as an int to indicate the status of the result, whether ...
Although it might not be proper to do such thing in a view if you intend to separate concerns strictly, the php Blade directive allows a way to execute PHP code, for instance, to set a variable: @php($varName = 'Enter content ') (same as:) @php $varName = 'Enter content '; @endphp late...
Use an ensure clause if there is code you always want to execute. def divide(x, y) begin z = x/y return z rescue ZeroDivisionError puts "Don't divide by zero!" rescue TypeError puts "Division only works on numbers!" return nil rescue => e ...
$scheme = 'https' $url_format = '{0}://example.vertigion.com/foos?{1}' $qs_data = @{ 'foo1'='bar1'; 'foo2'= 'complex;/?:@&=+$, bar''"'; 'complex;/?:@&=+$, foo''"'='bar2'; } [System.Collections.ArrayList] $qs_array = @() foreach ($qs in $qs_data.GetEnumerator()...
$scheme = 'https' $url_format = '{0}://example.vertigion.com/foos?{1}' $qs_data = @{ 'foo1'='bar1'; 'foo2'= 'complex;/?:@&=+$, bar''"'; 'complex;/?:@&=+$, foo''"'='bar2'; } [System.Collections.ArrayList] $qs_array = @() foreach ($qs in $qs_data.GetEnumerator()...
Encoded with [uri]::EscapeDataString() First, we'll decode the URL and Query String encoded with [uri]::EscapeDataString() in the above example: https://example.vertigion.com/foos? foo2=complex%3B%2F%3F%3A%40%26%3D%2B%24%2C%20bar'%22& complex%3B%2F%3F%3A%40%26%3D%2B%24%2C%20foo'%22=bar2&am...
Encoded with [uri]::EscapeDataString() First, we'll decode the URL and Query String encoded with [uri]::EscapeDataString() in the above example: https://example.vertigion.com/foos? foo2=complex%3B%2F%3F%3A%40%26%3D%2B%24%2C%20bar'%22& complex%3B%2F%3F%3A%40%26%3D%2B%24%2C%20foo'%22=bar2&am...
The module keyword can be used to begin a module, which allows code to be organized and namespaced. Modules can define an external interface, typically consisting of exported symbols. To support this external interface, modules can have unexported internal functions and types not intended for public...
Consider a simple asynchronous method: async Task Foo() { Bar(); await Baz(); Qux(); } Simplifying, we can say that this code actually means the following: Task Foo() { Bar(); Task t = Baz(); var context = SynchronizationContext.Current; t.ContinueWith(task...
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Cron extends CI_Controller { /** * This is default constructor of the class */ public function __construct() { parent::__construct(); $this->load->library('input'...
In application/hooks folder, create a file with name Blocker.php and paste the below code. <?php class Blocker { function Blocker(){ } /** * This function used to block the every request except allowed ip address */ function requestBlocker(){ ...
When creating the project You should check "Include UI Tests" in the project creation dialog. After creating the project If you missed checking UI target while creating project, you could always add test target later. Setps: While project open go to File -> New -> Target Fi...

Page 14 of 21