Tutorial by Examples: am

Examples below demonstrate how to call Python function from JavaScript in Odoo 8. In the examples we call methods of my_model described early on this page. We assume that in the following examples "list_of_ids" variable contains list(array) of ids of existing records of "my.model&quo...
Declare: defmodule MyApp.ViaMacros.Constants do @moduledoc """ Apply with `use MyApp.ViaMacros.Constants, :app` or `import MyApp.ViaMacros.Constants, :app`. Each constant is private to avoid ambiguity when importing multiple modules that each have their own copies of th...
There are four predefined markup extensions in XAML: x:Type supplies the Type object for the named type. This facility is used most frequently in styles and templates. <object property="{x:Type prefix:typeNameValue}" .../> x:Static produces static values. The values come from va...
using Xunit; public class SimpleCalculatorTests { [Theory] [InlineData(0, 0, 0, true)] [InlineData(1, 1, 2, true)] [InlineData(1, 1, 3, false)] public void Add_PassMultipleParameters_VerifyExpected( int inputX, int inputY, int expected, bool isExpectedCorrect) ...
The showcase of Primefaces components you can find here and documentation is here Frontend needs to be saved as a XHTML file. This file can contain JSF, JSTL, JSP, HTML, CSS, jQuery, javaScript and its framework and more front-end technologies. Please, do not mix JSF and JSP technologies together....
Notice that if we consider the path (in order): (1,2,3,4,6,0,5,7) and the path (1,2,3,5,0,6,7,4) The cost of going from vertex 1 to vertex 2 to vertex 3 remains the same, so why must it be recalculated? This result can be saved for later use. Let dp[bitmask][vertex] represent the minimum c...
Download the Stripe API Library and place it in vendor Folder source : [https://github.com/stripe/stripe-php][1] include the library in your controller use Stripe\BalanceTransaction; use Stripe\Charge; use Stripe\Stripe; require_once('../vendor/stripe/init.php'); set the strip key \Stripe...
If there would be another value in the URL like: /Example/ProcessInput/2, the routing rules will threat the last number as a parameter passed into the action ProcessInput of controller Example. public ActionResult ProcessInput(int number) { ViewData["OutputMessage"] = string.format(...
Makes entering numbers a bit handier by showing a set of arrows on the right side of the input. HTML <link rel="stylesheet" href="//code.jquery.com/ui/1.12.0/themes/base/jquery-ui.css"> <script src="https://code.jquery.com/jquery-1.12.4.js"></script&gt...
using System; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { var foo = new Dependency(); var bar = new ClassWithDependency(); bar.DoSomething(foo); //Inject dependency as method parameter ...
<div class="container" id="con"> <div class="row"> <div class="span12"> <div class="well"> <h1> Header </h1> </div> </div&gt...
$color-purple-bg: #AF6EC4; $color-purple-border: #5D0C66; $color-yellow-bg: #E8CB48; $color-yellow-border: #757526; .tooltip { position: relative; &--arrow-down { @include pointer('bottom', 30px, ($color-purple-border, $color-purple-bg), 15px); } ...
Okay it took me about a day to figure it out so here I am posting the steps I followed to get my Database First working in a Class Project (.NET Core), with a .NET Core Web App. Step 1 - Install .NET Core Make Sure you are using .NET Core not DNX (Hint: You should be able to see the .NET Core opti...
You can make a URI parameter optional by adding a question mark to the route parameter. You can also specify a default value by using the form parameter=value. public class BooksController : Controller { // eg: /books // eg: /books/1430210079 [Route(“books/{isbn?}”)] public Act...
Logs are very important. Recreate an error context can be sometimes very painful due to the lack of information about how and when the error occurred. This example shows: How to add user's data in the error logs How to add post parameters sent when an error occurred How to use WebPr...
_refreshListView(){ //Start Rendering Spinner this.setState({refreshing:true}) this.state.cars.push( {name:'Fusion',color:'Black'}, {name:'Yaris',color:'Blue'} ) //Updating the dataSource with new data this.setState({ dataSource: this.state.data...
RefreshControl is used inside a ScrollView or ListView to add pull to refresh functionality. at this example we will use it with ListView 'use strict' import React, { Component } from 'react'; import { StyleSheet, View, ListView, RefreshControl, Text } from 'react-native' class RefreshContr...
//Before: antipattern 3 global variables var setActivePage = function () {}; var getPage = function() {}; var redirectPage = function() {}; //After: just 1 global variable, no function collision and more meaningful function names var NavigationNs = NavigationNs || {}; N...
When multiple modules are involved, avoid proliferating global names by creating a single global namespace. From there, any sub-modules can be added to the global namespace. (Further nesting will slow down performance and add unnecessary complexity.) Longer names can be used if name clashes are an i...
Let us assume we have the following two DataFrames: In [7]: df1 Out[7]: A B 0 a1 b1 1 a2 b2 In [8]: df2 Out[8]: B C 0 b1 c1 The two DataFrames are not required to have the same set of columns. The append method does not change either of the original DataFrames. Inst...

Page 79 of 129