Tutorial by Examples: amp

First we initialize our initial value problem we want to solve. odefun = @(t,y) cos(y).^2*sin(t); tspan = [0 16*pi]; y0=1; We then use the ode45 function without any specified options to solve this problem. To compare it later we plot the trajectory. [t,y] = ode45(odefun, tspan, y0); plot(t,...
Class for which you will create unit test case. class Authorization { /* Observer so that mock object can work. */ public function attach(Curl $observer) { $this->observers = $observer; } /* Method for which we will create test */ public function postAuthorization($url, $met...
A method called in one object will move up the chain of objects until one is found that can properly handle the call. This particular example uses scientific experiments with functions that can just get the title of the experiment, the experiments id or the tissue used in the experiment. abstract c...
This is the code to filter the Datatables [1.10.7] by value programmatically, you can find it on official documentation. function setFilterValue(datatable, value){ if(datatable !== undefined){ datatable .columns(0) .search(value) .draw(); } ...
Place a file like the following in your top level directory. It defines which components to render for which paths import React from 'react'; import { Route, IndexRoute } from 'react-router'; import New from './containers/new-post'; import Show from './containers/show'; import Index from './c...
Let's take a look at a quick example of using REST framework to build a simple model-backed API. We'll create a read-write API for accessing information on the users of our project. Any global settings for a REST framework API are kept in a single configuration dictionary named REST_FRAMEWORK. Sta...
var WebSocketServer = require('ws').Server , wss = new WebSocketServer({ port: 8080 }); // If you want to add a path as well, use path: "PathName" wss.on('connection', function connection(ws) { ws.on('message', function incoming(message) { console.log('received: %s', message); ...
Spinner It is a type of dropdown input. Firstly in layout <Spinner android:id="@+id/spinner" <!-- id to refer this spinner from JAVA--> android:layout_width="match_parent" android:layout_height="wrap_content"> </Spinner> ...
Install symfony correctly as guided above. Start symfony server if you are not installed in www directory. Ensure http://localhost:8000 is working if symfony server is used. Now it is ready to play with simplest example. Add following code in a new file /src/AppBundle/Controller/MyController.p...
Create a sample application using spring-boot from spring-boot initializer site. Import the code in your local IDE and run the goal as clean install spring-boot:run -e Go to target folder and check for the jar file. Open your Amazon account or create a new Amazon Account and selec...
OpenCv image read from file system in Java import org.opencv.core.Core; import org.opencv.core.Mat; import org.opencv.imgcodecs.Imgcodecs; public class Giris { public static void main(String[] args) { //Load native library System.loadLibrary(Core.NATIVE_LIBRARY_NAME...
To create a tooltip, we only need to add data-toggle="tooltip" attribute and a title to the HTML element that will have the tooltip. Title attribute is used to specify the text that is displayed inside the tooltip. <span data-toggle="tooltip" title="Hello world!"&gt...
Mediator pattern defines an object (Mediator) that encapsulates how a set of objects interact. It enables many-to-many communication. UML diagram: Key components: Mediator: Defines an interface for communication between Colleagues. Colleague: Is an abstract class, which defines the events to b...
We're going to build an application that stores POJOs in a database. The application uses Spring Data JPA to store and retrieve data in a relational database. Its most compelling feature is the ability to create repository implementations automatically, at runtime, from a repository interface. Main...
As an alternative to using Html.ActionLink to generate links in a view, you can use Html.RouteLink To make use of this feature, you need to configure a route, for example: public static void RegisterRoutes(RouteCollection routes) { routes.MapRoute( "SearchResults", "{...
# This is an example of a .profile or .bash_profile for Linux and Mac systems export GOPATH=/home/user/go export PATH=$PATH:/usr/local/go/bin
Open routes file. Paste the following code in: Route::get('helloworld', function () { return '<h1>Hello World</h1>'; }); after going to route localhost/helloworld it displays Hello World. The routes file is located: 5.3 For Web routes/web.php For APIs routes/api.php ...
HtmlHelper.Action() @Html.Action(actionName: "Index") output: The HTML rendered by an action method called Index() @Html.Action(actionName: "Index", routeValues: new {id = 1}) output: The HTML rendered by an action method called Index(int id) @(Html.Action("In...
Project structure project/ group_vars/ development inventory.development playbook.yaml These variables will be applied to hosts under the development group due to the filename. --- ## Application app_name: app app_url: app.io web_url: cdn.io app_friendly: New App env_type: ...
Controller: In the Controller you have to add the RequestHandler component. This Enables CakePHP to automatically detect Ajax requests(see: http://book.cakephp.org/2.0/en/core-libraries/components/request-handling.html for more info): class YourController extends AppController { public $compo...

Page 20 of 46