Tutorial by Examples: st

In the new Angular framework, Components are the main building blocks that compose the user interface. So one of the first steps that helps an AngularJS app to be migrated to the new Angular is to refactor it into a more component-oriented structure. Components were also introduced in the old Angu...
This snippet will list all the filenames of a zip archive. The filenames are relative to the zip root. using (FileStream fs = new FileStream("archive.zip", FileMode.Open)) using (ZipArchive archive = new ZipArchive(fs, ZipArchiveMode.Read)) { for (int i = 0; i < archive.Entries....
Detailed instructions on getting graph-theory set up or installed.
For this example we will test the sum method of a simple calculator. In this example we will test the application: ApplicationToTest. This one has a class called Calc. This class has a method Sum(). The method Sum() looks like this: public void Sum(int a, int b) { return a + b; } The un...
You can get JCodec automatically with maven. For this just add below snippet to your pom.xml . <dependency> <groupId>org.jcodec</groupId> <artifactId>jcodec-javase</artifactId> <version>0.1.9</version> </dependency>
In order to set the pagination style for the entire project, you need to set the DEFAULT_PAGINATION_CLASS and PAGE_SIZE on the project settings. To do so, go to settings.py and on the REST_FRAMEWORK variable, add the following: REST_FRAMEWORK = { 'DEFAULT_PAGINATION_CLASS': 'rest_fr...
ByteStrings and Buffers Okio is built around two types that pack a lot of capability into a straightforward API: ByteString is an immutable sequence of bytes. For character data, String is fundamental. ByteString is String's long-lost brother, making it easy to treat binary data as a value. This c...
Open the C# project Right-click on the solution -> Add -> New Project… (Figure 1) Go to Installed -> Visual C# -> Test Click on Unit Test Project Give it a name and click OK (Figure 2) The unit test project is added to the solution (Figure 3) Adding the referen...
Method 1 Go to your unit test class in the unit test project Write a unit test [Testclass] public class UnitTest1 { [TestMethod] public void TestMethod1() { //Arrange ApplicationToTest.Calc ClassCalc = new ApplicationToTest.Calc(); int expectedResul...
To see you unit tests go to Test -> Windows -> Test Explorer (Figure 1) This will open an overview of all the tests in the application (Figure 2) In the figure above you can see that the example has one unit test and it hasn’t been run yet You can double-click on a tes...
To see you unit tests go to Test -> Windows -> Code Coverage Results (Figure 1) It will open the following window (Figure 2) The window is now empty Go to the Test menu -> Analyze Code Coverage (Figure 3) The tests will now be run as well (See the results in the T...
Starting with Android 3.1 all applications, upon installation, are placed in a stopped state. While in stopped state, the application will not run for any reason, except by a manual launch of an activity, or an explicit intent that addresses an activity ,service or broadcast. When writing system ap...
Override Pagination Style: Every available pagination style can be overridden by creating a new class that inherits from one of the available styles and then alters its parameters: class MyPagination(PageNumberPagination): page_size = 20 page_size_query_param = 'page_size' max_page...
A generalization of std::condition_variable, std::condition_variable_any works with any type of BasicLockable structure. std::cv_status as a return status for a condition variable has two possible return codes: std::cv_status::no_timeout: There was no timeout, condition variable was notified st...
Function definition: def run_training(train_X, train_Y): Inputs variables: X = tf.placeholder(tf.float32, [m, n]) Y = tf.placeholder(tf.float32, [m, 1]) Weight and bias representation W = tf.Variable(tf.zeros([n, 1], dtype=np.float32), name="weight") b = tf.Variable(tf.zeros([...
Installing The Node Module You can install this module by running the command below in your project directory: npm install twilio Sending Your Message const accountSID = ''; // Obtained from the Twilio Console const authToken = ''; // Obtained from the Twilio Console const client = requi...
Laravel Scout - Laravel Scout provides a simple, driver-based solution for adding full-text search to your Eloquent models. Laravel Passport - API authentication without a headache. Passport is an OAuth2 server that's ready in minutes. Homestead - The official Laravel development environment. Po...
Then we finally pass the query to the writer to delete documents that match the query: See the answer to this question. See the API here // Remove the document by using a multi key query: // http://www.avajava.com/tutorials/lessons/how-do-i-combine-queries-with-a-boolean-query.html indexWriter....
Laravel News Podcasts The Laravel Podcasts
<?php /* * Plugin Name: Custom Admin Menu */ class SO_WP_Menu { private $plugin_url; public function __construct() { $this->plugin_url = plugins_url( '/', __FILE__ ); add_action( 'plugins_loaded', array( $this, 'init' ) ); } public funct...

Page 343 of 369