Tutorial by Examples

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")
@theme("reindeer")
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...

Pom

Repositories <repository> <id>vaadin-addons</id> <url>http://maven.vaadin.com/vaadin-addons</url> </repository> <repository> <id>vaadin-snapshots</id> <name>Vaadin snapshot repository</name> <url>http:...
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....
Add a button you can tap to trigger a crash. Paste this code into your layout where you’d like the button to appear. <Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="Force Crash!" android:onClick=&quo...
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...
Using the PhantomData type like this allows you to use a specific type without needing it to be part of the Struct. use std::marker::PhantomData; struct Authenticator<T: GetInstance> { _marker: PhantomData<*const T>, // Using `*const T` indicates that we do not own a T } imp...
In SuiteScript 1.0, use nlobjContext.getRemainingUsage() to retrieve the remaining units. An nlobjContext reference is retrieved using the global nlapiGetContext function. // 1.0 var context = nlapiGetContext(); nlapiLogExecution("DEBUG", "Governance Monitoring", "Remai...
Typically trying to extend the parent like so: .parent { style: value; @extend &; } Will result in an error, stating that the parent cannot be extended. This makes sense, but there's a workaround. Simply store the parent selector in a variable. .parent { $parent: &; style...
let inline getLength s = (^a: (member Length: _) s) //usage: getLength "Hello World" // or "Hello World" |> getLength // returns 11
// Record type Ribbon = {Length:int} // Class type Line(len:int) = member x.Length = len type IHaveALength = abstract Length:int let inline getLength s = (^a: (member Length: _) s) let ribbon = {Length=1} let line = Line(3) let someLengthImplementer = { new IHaveALength wit...

Page 966 of 1336