Tutorial by Examples: ch

fs.access() determines whether a path exists and what permissions a user has to the file or directory at that path. fs.access doesn't return a result rather, if it doesn't return an error, the path exists and the user has the desired permissions. The permission modes are available as a property on ...
cursor: value; Examples: ValueDescriptionnoneNo cursor is rendered for the elementautoDefault. The browser sets a cursorhelpThe cursor indicates that help is availablewaitThe cursor indicates that the program is busymoveThe cursor indicates something is to be movedpointerThe cursor is a pointe...
The nodemon package makes it possible to automatically reload your program when you modify any file in the source code. Installing nodemon globally npm install -g nodemon (or npm i -g nodemon) Installing nodemon locally In case you don't want to install it globally npm install --save-dev nodemo...
If you need to match characters that are a part of the regular expression syntax you can mark all or part of the pattern as a regex literal. \Q marks the beginning of the regex literal. \E marks the end of the regex literal. // the following throws a PatternSyntaxException because of the un-close...
Trailing spaces \s*$: This will match any (*) whitespace (\s) at the end ($) of the text Leading spaces ^\s*: This will match any (*) whitespace (\s) at the beginning (^) of the text Remarks \s is a common metacharacter for several RegExp engines, and is meant to capture whitespace characters (...
child.py import time def main(): print "starting work" time.sleep(1) print "work work work work work" time.sleep(1) print "done working" if __name__ == '__main__': main() parent.py import os def main(): for i in range(5):...
This example starts Notepad, waits for it to be closed, then gets its exit code. #include <Windows.h> int main() { STARTUPINFOW si = { 0 }; si.cb = sizeof(si); PROCESS_INFORMATION pi = { 0 }; // Create the child process BOOL success = CreateProcessW( L"C:...
vimtutor is an interactive tutorial covering the most basic aspects of text editing. On UNIX-like system, you can start the tutorial with: $ vimtutor On Windows, “Vim tutor” can be found in the “Vim 7.x” directory under “All Programs” in the Windows menu. See :help vimtutor for further details...
Trap expressions don't have to be individual functions or programs, they can be more complex expressions as well. By combining jobs -p and kill, we can kill all spawned child processes of the shell on exit: trap 'jobs -p | xargs kill' EXIT
Given a String and a Character let text = "Hello World" let char: Character = "o" We can count the number of times the Character appears into the String using let sensitiveCount = text.characters.filter { $0 == char }.count // case-sensitive let insensitiveCount = text.low...
If you have created a table with some wrong schema, then the easiest way to change the columns and their properties is change_table. Review the following example: change_table :orders do |t| t.remove :ordered_at # removes column ordered_at t.string :skew_number # adds a new column t.index...
This design pattern is useful for generating a sequence of asynchronous actions from a list of elements. There are two variants : the "then" reduction, which builds a chain that continues as long as the chain experiences success. the "catch" reduction, which builds a chain t...
Events that work with most form elements (e.g., change, keydown, keyup, keypress) do not work with contenteditable. Instead, you can listen to changes of contenteditable contents with the input event. Assuming contenteditableHtmlElement is a JS DOM object that is contenteditable: contenteditableH...
It is best practice in any programming language to avoid premature optimization. However, if testing reveals that your code is running too slowly, you may gain some speed by switching off some of the application’s properties while it runs. Add this code to a standard module: Public Sub SpeedUp( _ ...
%{username: username} = %{username: "John Doe", id: 1} # username == "John Doe" %{username: username, id: 2} = %{username: "John Doe", id: 1} ** (MatchError) no match of right hand side value: %{id: 1, username: "John Doe"}
Alamofire.request(.GET, "https://httpbin.org/get") .validate() .responseString { response in print("Response String: \(response.result.value)") } .responseJSON { response in print("Response JSON: \(response.result.value)") ...
public string Remove() { string input = "Hello./!"; return Regex.Replace(input, "[^a-zA-Z0-9]", ""); }
In order to enable EdgeCache, set the following HTTP response headers (Do not deviate from this exact format): Cache-Control header to public, max-age=X where: X = the number of seconds that you want the response to be cached for X > 60 seconds X < 365*24*60*60 Set the Pragma he...
You can also receive regular updates of the user's location; for example, as they move around while using a mobile device. Location tracking over time can be very sensitive, so be sure to explain to the user ahead of time why you're requesting this permission and how you'll use the data. if (naviga...
MySQL3.19 DROP TABLE IF EXISTS MyTable; PostgreSQL8.x DROP TABLE IF EXISTS MyTable; SQL Server2005 If Exists(Select * From Information_Schema.Tables Where Table_Schema = 'dbo' And Table_Name = 'MyTable') Drop Table dbo.MyTable SQLite3.0 DROP TABLE IF EXI...

Page 17 of 109