Tutorial by Examples: c

In features/step_definitions/documentation.rb: When /^I go to the "([^"]+)" documentation$/ do |section| path_part = case section when "Documentation" "documentation" else raise "Unknown documentation section: #{section...
Local variables - Those declared within a procedure (subroutine or function) of a class (or other structure). In this example, exampleLocalVariable is a local variable declared within ExampleFunction(): Public Class ExampleClass1 Public Function ExampleFunction() As Integer Dim exa...
CREATE TABLE dbo.logging_table(log_id INT IDENTITY(1,1) PRIMARY KEY, log_message VARCHAR(255)) CREATE TABLE dbo.person(person_id INT IDENTITY(1,1) PRIMARY KEY, person_name VARCHAR(100) NOT NULL) GO; CREATE TRIGGER dbo.InsertToADiffere...
SELECT IDENT_CURRENT('dbo.person'); This will select the most recently-added identity value on the selected table, regardless of connection or scope.
$ npm install -g parse-server mongodb-runner $ mongodb-runner start $ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://localhost/test You can use any arbitrary string as your application id and master key. These will be used by your clients to authenticate with...
Now that you're running Parse Server, it is time to save your first object. We'll use the REST API, but you can easily do the same using any of the Parse SDKs. Run the following: curl -X POST \ -H "X-Parse-Application-Id: APPLICATION_ID" \ -H "Content-Type: application/json" \...
file:write_file("myfile.txt", ["Hi " [<<"there">>], $\n]).
["Guten Tag " | [<<"Hello">>]]. [<<"Guten Tag ">> | [<<"Hello">>]]. [$G, $u, $t, $e, $n , $T, $a, $g | [<<"Hello">>]]. [71,117,116,101,110,84,97,103,<<"Hello">>].
Data_1 = [<<"Hello">>]. Data_2 = [Data_1,<<" Guten Tag ">>].
["Guten tag " | <<"Hello">>]. In the shell this will be printed as ["Guten tag "|<<"Hello">>] instead of ["Guten tag ",<<"Hello">>]. The pipe operator will create an improper list if the last element o...
<<"Guten tag, Hello">> = iolist_to_binary(["Guten tag, ",<<"Hello">>]). An IO list can be converted to a binary using the iolist_to_binary/1 function. If the data is going to be stored for a long period or sent as a message to other processes ...
The following example uses expect and receive to mock an Order's call to a CreditCardService, so that the test passes only if the call is made without having to actually make it. class Order def cancel CreditCardService.instance.refund transaction_id end end describe Order do des...
In greeter.rb (wherever that goes in your project): class Greeter def greet "Hello, world!" end end In spec/greeter_spec.rb: require_relative '../greeter.rb' RSpec.describe Greeter do describe '#greet' do it "says hello" do expect(Greeter.new.gr...
Clear the canvas using compositing operation. This will clear the canvas independent of transforms but is not as fast as clearRect(). ctx.globalCompositeOperation = 'copy'; anything drawn next will clear previous content.
Some programmers think that it is a good idea to save space by using a null to represent an empty array or collection. While it is true that you can save a small amount of space, the flipside is that it makes your code more complicated, and more fragile. Compare these two versions of a method for ...
All arrays implement the non-generic IList interface (and hence non-generic ICollection and IEnumerable base interfaces). More importantly, one-dimensional arrays implement the IList<> and IReadOnlyList<> generic interfaces (and their base interfaces) for the type of data that they cont...
On StackOverflow, we often see code like this in Answers: public String joinStrings(String a, String b) { if (a == null) { a = ""; } if (b == null) { b = ""; } return a + ": " + b; } Often, this is accompanied with an asse...
Rust's coherence rule requires that either the trait or the type for which you are implementing the trait must be defined in the same crate as the impl, so it is not possible to implement Serialize and Deserialize for a type in a different crate directly. The newtype pattern and Deref coercion provi...
Functional testing also can include testing processes that leave your environment, such as external API calls and emails. As an example, imagine you're functionally testing the registration process for your website. The final step of this process involves sending an email with an activation link. U...
HTML: <div class="container"> <div class="child"></div> </div> CSS: .container { height: 500px; width: 500px; display: flex; // Use Flexbox align-items: center; // This centers children vertically in the parent. ...

Page 490 of 826