Tutorial by Examples: a

using System; [assembly:CLSCompliant(true)] namespace CLSDoc { public class Car { //Warning CS3008 Identifier '_age' is not CLS-complian public int _age = 0; } } You can not start variable with _
using System; [assembly:CLSCompliant(true)] namespace CLSDoc { [CLSCompliant(false)] public class Animal { public int age = 0; } //Warning CS3009 'Dog': base type 'Animal' is not CLS-compliant public class Dog : Animal { } }
Breadth-first-search (BFS) is an algorithm for traversing or searching tree or graph data structures. It starts at the tree root (or some arbitrary node of a graph, sometimes referred to as a 'search key') and explores the neighbor nodes first, before moving to the next level neighbors. BFS was inve...
Most of the time, we'll need to find out the shortest path from single source to all other nodes or a specific node in a 2D graph. Say for example: we want to find out how many moves are required for a knight to reach a certain square in a chessboard, or we have an array where some cells are blocked...
Detailed instructions on getting actionscript set up or installed.
const correctness is the practice of designing code so that only code that needs to modify an instance is able to modify an instance (i.e. has write access), and conversely, that any code that doesn't need to modify an instance is unable to do so (i.e. only has read access). This prevents the insta...
In a const-correct class, all member functions which don't change logical state have this cv-qualified as const, indicating that they don't modify the object (apart from any mutable fields, which can freely be modified even in const instances); if a const cv-qualified function returns a reference, t...
In a const-correct function, all passed-by-reference parameters are marked as const unless the function directly or indirectly modifies them, preventing the programmer from inadvertently changing something they didn't mean to change. This allows the function to take both const and non-cv-qualified ...
;;Find the nth Fibonacci number for any n > 0. ;; Precondition: n > 0, n is an integer. Behavior undefined otherwise. (defun fibonacci (n) (cond ( ;; Base case. ;; The first two Fibonacci numbers (indices 1 and 2) are 1 by defin...
In most text editors, the standard shortcut for saving the current document is Ctrl+S (or Cmd+S on macOS). Vim doesn't have this feature by default but this can be mapped to make things easier. Adding the following lines in .vimrc file will do the job. nnoremap <c-s> :w<CR> inoremap &...
Consider 2 MySQL Servers for replication setup, one is a Master and the other is a Slave. We are going to configure the Master that it should keep a log of every action performed on it. We are going to configure the Slave server that it should look at the log on the Master and whenever changes happ...
Whenever there is an error while running a query on the slave, MySQL stop replication automatically to identify the problem and fix it. This mainly because an event caused a duplicate key or a row was not found and it cannot be updated or deleted. You can skip such errors, even if this is not recomm...
UILabel *label=[[UILabel alloc]initWithFrame:CGRectMake(0, 0, 320, 480)]; label.backgroundColor=[UIColor lightGrayColor]; NSMutableAttributedString *attributedString; attributedString = [[NSMutableAttributedString alloc] initWithString:@"Apply Underlining"]; [attributedString addAttrib...
@theme("valo")
Common Maven mvn -B archetype:generate -DarchetypeGroupId=com.vaadin -DarchetypeArtifactId=vaadin- archetype-application -DarchetypeVersion=7.7.3 -DgroupId=org.test -DartifactId=vaadin-app -Dversion=1.0-SNAPSHOT Advanced Maven mvn archetype:generate \ -DgroupId=com.mycompany.mycompanyapp...
import #include <math.h> The code in the viewDidLoad or loadView should look something look something like this - (void)loadView { [super loadView]; UIImageView *imageView=[[UIImageView alloc]initWithFrame:CGRectMake(0, 50, 320, 320)]; [self.view addSubview:imageView]; UIImage *image=[U...
Copy paste this code and launch your program : @Theme(ValoTheme.THEME_NAME) //[optional] adds Vaadin built in theming public class SampleUI extends UI { @Override protected void init(VaadinRequest request) { final VerticalLayout rootLayout = new VerticalLayout(); Label...
You may want to negate a boolean value, i.e. enter an if statement when a condition is false rather than true. This can be done by using the -Not CmdLet $test = "test" if (-Not $test -eq "test2"){ Write-Host "if condition not met" } You can also use !: $test...
The basic usage is: mysql> CREATE USER 'my_new_user'@'localhost' IDENTIFIED BY 'test_password'; However for situations where is not advisable to hard-code the password in cleartext it is also possible to specify directly, using the directive PASSWORD, the hashed value as returned by the PASS...
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....

Page 788 of 1099