Tutorial by Examples: c

Assuming the page includes an HTML element like: <p class="small-paragraph"> This is a small <a href="https://en.wikipedia.org/wiki/Paragraph">paragraph</a> with a <a class="trusted" href="http://stackexchange.com">link</a>...
To get started with the jQuery UI library, you'll need to add the jQuery script, the jQuery UI script, and the jQuery UI stylesheet to your HTML. First, download jQuery UI; choose the features you need on the download page. Unzip your download, and put jquery-ui.css and jquery-ui.js (and jquery.js)...
String html = "<!DOCTYPE html>" + "<html>" + "<head>" + "<title>Hello world!</title>" + "</head>" + "<body>" + ...
UIButtons can be initialized in a frame: Swift let button = UIButton(frame: CGRect(x: x, y: y, width: width, height: height) Objective C UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(x, y, width, height)]; A specific type of UIButton can be created like this: Swift let but...
//Swift button.setTitleColor(color, forControlState: controlState) //Objective-C [button setTitleColor:(nullable UIColor *) forState:(UIControlState)]; To set the title color to blue //Swift button.setTitleColor(.blue, for: .normal) //Objective-C [button setTitleColor:[UIColor blueColo...
Swift //Align contents to the left of the frame button.contentHorizontalAlignment = .left //Align contents to the right of the frame button.contentHorizontalAlignment = .right //Align contents to the center of the frame button.contentHorizontalAlignment = .center //Make contents fill th...
You can use the nil coalescing operator to unwrap a value if it is non-nil, otherwise provide a different value: func fallbackIfNil(str: String?) -> String { return str ?? "Fallback String" } print(fallbackIfNil("Hi")) // Prints "Hi" print(fallbackIfNil(nil)...
If you don't want to add Unix commands to your PATH on Windows, you can download a standalone SSH client like PuTTY. Download PuTTY here, then follow the instructions below to get a build machine. Call meteor admin get-machine <os-architecture> --json Copy and save the private key from the...
The easiest way to get up and running is to install Git for Windows from this download page, and select "Use Git and optional Unix tools from the Windows Command Prompt" as in the screenshot below. After this, meteor admin get-machine <os-architecture> will work exactly as it does...
To get the physical size of the screen (including window chrome and menubar/launcher): var width = window.screen.width, height = window.screen.height;
To get the “available” area of the screen (i.e. not including any bars on the edges of the screen, but including window chrome and other windows: var availableArea = { pos: { x: window.screen.availLeft, y: window.screen.availTop }, size: { width: window.scr...
To determine the color and pixel depths of the screen: var pixelDepth = window.screen.pixelDepth, colorDepth = window.screen.colorDepth;
A common pitfall is confusing the equality comparison operators is and ==. a == b compares the value of a and b. a is b will compare the identities of a and b. To illustrate: a = 'Python is fun!' b = 'Python is fun!' a == b # returns True a is b # returns False a = [1, 2, 3, 4, 5] b = a ...
Bold Text To bold text, use the <strong> or <b> tags: <strong>Bold Text Here</strong> or <b>Bold Text Here</b> What’s the difference? Semantics. <strong> is used to indicate that the text is fundamentally or semantically important to the surrounding...
To mark text as inserted, use the <ins> tag: <ins>New Text</ins> To mark text as deleted, use the <del> tag: <del>Deleted Text</del> To strike through text, use the <s> tag: <s>Struck-through text here</s>
To offset text either upward or downward you can use the tags <sup> and <sub>. To create superscript: <sup>superscript here</sup> To create subscript: <sub>subscript here</sub>
Standard Collections Java Collections framework A simple way to construct a List from individual data values is to use java.utils.Arrays method Arrays.asList: List<String> data = Arrays.asList("ab", "bc", "cd", "ab", "bc", "cd"); ...
If you are using the PASSWORD_DEFAULT method to let the system choose the best algorithm to hash your passwords with, as the default increases in strength you may wish to rehash old passwords as users log in <?php // first determine if a supplied password is valid if (password_verify($plaintex...
Create password hashes using password_hash() to use the current industry best-practice standard hash or key derivation. At time of writing, the standard is bcrypt, which means, that PASSWORD_DEFAULT contains the same value as PASSWORD_BCRYPT. $options = [ 'cost' => 12, ]; $hashedPasswor...
Spoilers are used to hide text or images that would otherwise negatively impact another user's experience. They can be created using >! >!This is hidden until your cursor hovers on top of it This is hidden until your cursor hovers on top of it Note: This is not part of standard markup...

Page 40 of 826