Tutorial by Examples: and

Setup First, install the necessary packages with: npm install express cors mongoose Code Then, add dependencies to your server.js file, create the database schema and the name of the collection, create an Express.js server, and connect to MongoDB: var express = require('express'); var cors =...
Setup First, install the necessary packages with: npm install express cors mongoose Code Then, add dependencies to server.js, create the database schema and the name of the collection, create an Express.js server, and connect to MongoDB: var express = require('express'); var cors = require('...
round() tie breaking In Python 2, using round() on a number equally close to two integers will return the one furthest from 0. For example: Python 2.x2.7 round(1.5) # Out: 2.0 round(0.5) # Out: 1.0 round(-0.5) # Out: -1.0 round(-1.5) # Out: -2.0 In Python 3 however, round() will retur...
What is XAMPP? XAMPP is the most popular PHP development environment. XAMPP is a completely free, open-source and easy to install Apache distribution containing MariaDB, PHP, and Perl. Where should I download it from? Download appropriate stable XAMPP version from their download page. Choose the ...
Assume an application with a MainActivity which can call the Next Activity using a button click. public class MainActivity extends AppCompatActivity { private final String LOG_TAG = MainActivity.class.getSimpleName(); @Override protected void onCreate(Bundle savedInstanceState) { ...
Strings can be assigned directly to byte arrays and visa-versa. Remember that Strings are stored in a Multi-Byte Character Set (see Remarks below) so only every other index of the resulting array will be the portion of the character that falls within the ASCII range. Dim bytes() As Byte Dim exampl...
When a user press F1 on a control or click on Help button of form (?) and then clicks on a control the HelpRequested event will be raised. You can handle this event to provide custom action when user requests help for controls or form. The HelpRequested supports bubble up mechanism. It fires for y...
If you have a Form with MinimizeBox and MaximizeBox set to true, then you can not show Help button on title-bar of Form and will lose the feature of click on help button to convert it to help cursor to be able to click on controls to show help. You can make a menu item on MenuStrip act like standar...
You can detect when a user Clicked on a HelpButton on title-bar of form by handling HelpButtonClicked. You can let the event continue or cancel it by setting Cancel property of its event args to true. private void Form1_HelpButtonClicked(object sender, CancelEventArgs e) { e.Cancel = true; ...
Exceptions represent programmer-level bugs like trying to access an array element that doesn’t exist. Errors are user-level issues like trying load a file that doesn’t exist. Because errors are expected during the normal execution of a program. Example: NSArray *inventory = @[@"Sam"...
The contents of files and network messages may represent encoded characters. They often need to be converted to unicode for proper display. In Python 2, you may need to convert str data to Unicode characters. The default ('', "", etc.) is an ASCII string, with any values outside of ASCII ...
This command: :s/foo/bar/g substitutes each occurrence of foo with bar on the current line. fool around with a foodie becomes barl around with a bardie If you leave off the last /g, it will only replace the first occurence on the line. For example, :s/foo/bar On the previous line wou...
This will trigger the native email client for sharing text. Parameters : Email To address, Subject, Body. Code Sample : you can call the function wherever you need, (mostly inside click listeners) like below Calling function shareEmail("[email protected]", "Email sharing example&q...
The easiest way to use Processing is by downloading the Processing editor from the Processing download page. That comes as a zip file. Unzip that file anywhere, and you'll have a directory that contains an executable (on Windows, that's processing.exe). Running that executable opens up the Process...
Command line You can use cpan to install modules directly from the command line: cpan install DBI This would be followed by possibly many pages of output describing exactly what it is doing to install the module. Depending on the modules being installed, it may pause and ask you questions. Int...
Google currently has two ways to load the JS library for Google Visualization (a.k.a Google Charts), gstatic loader (https://www.gstatic.com/charts/loader.js) and jsapi (https://www.google.com/jsapi). The gstatic loader is recommended because Google is transitioning away from jsapi to the gstati...
The left hand operand for these operators must be a either a non-final variable or an element of an array. The right hand operand must be assignment compatible with the left hand operand. This means that either the types must be the same, or the right operand type must be convertible to the left o...
In this example our project name is "helloworld" which was created with stack new helloworld simple First we have to build the project with stack build and then we can run it with stack exec helloworld-exe
Consider the case of creating a nested list structure by multiplying: li = [[]] * 3 print(li) # Out: [[], [], []] At first glance we would think we have a list of containing 3 different nested lists. Let's try to append 1 to the first one: li[0].append(1) print(li) # Out: [[1], [1], [1]] ...
Ordering the results and setting a limit can easily be achieved with 2 additional lines added to the chain, like so: $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('*') ->from('#__users') ->where('username = '. $db->q('John')) ->ord...

Page 52 of 153