Tutorial by Examples: o

Testcode has the same quality demands, as production code. MakeSut() improves readability can be easily refactored perfectly supports dependency injection. Here's the concept: [Test] public void TestSomething() { var sut = MakeSut(); string result = sut.Do(); Assert....
Here the steps required to create a Firebase project and to connect with an Android app. Add Firebase to your app Create a Firebase project in the Firebase console and click Create New Project. Click Add Firebase to your Android app and follow the setup steps. When prompted, enter yo...
Add post-formats to post_type 'page' add_post_type_support( 'page', 'post-formats' ); Next example registers custom post type 'my_custom_post_type', and add Post Formats. Register custom post type 'my_custom_post_type' add_action( 'init', 'create_my_post_type' ); function create_my_post_type(...
Function Call add_theme_support( 'post-formats' )
Sometimes you want to know the position (index) of the current element while iterating over an enumerator. For such purpose, Ruby provides the with_index method. It can be applied to all the enumerators. Basically, by adding with_index to an enumeration, you can enumerate that enumeration. Index is ...
!process - list user mode processes .process - set process context !peb - show process environment block !teb - show thread environment block !locks - deadlock analysis .dump - save a crash dump file to disk
Following example requires that node.js is installed and npm is available. Full working code can be forked from GitHub @ https://github.com/mikkoviitala/angular-grunt-run-local Usually one of the first things you want to do when developing new web application is to make it run locally. Below ...
import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { AppComponent } from './app.component'; @NgModule({ imports: [ BrowserModule ], declarations: [ AppComponent ], bootstrap: [ AppComponent ] }) export class AppModul...
$_cat = new Mage_Catalog_Block_Navigation(); $curent_cat = $_cat->getCurrentCategory(); $curent_cat_id = $curent_cat->getId(); $parentId=Mage::getModel('catalog/category')->load($curent_cat_id)->getParentId(); $parent = Mage::getModel('catalog/category')->load($parentId); $catego...
$categoryName = Mage::registry('current_category')->getName(); foreach ($categoryName as $_category): $categoryName = $_category->getName(); endforeach;
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,...
A Cron expression consists of six sequential fields - second, minute, hour, day of month, month, day(s) of week and is declared as follows @Scheduled(cron = "* * * * * *") We can also set the timezone as - @Scheduled(cron="* * * * * *", zone="Europe/Istanbul") ...
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...
require(['N/search'], function(SEARCHMODULE){ var type = 'transaction'; var columns = []; columns.push(SEARCHMODULE.createColumn({ name: 'internalid' })); columns.push(SEARCHMODULE.createColumn({ name: 'formulanumeric', formula: '{quantity}-{...
require(['N/search'], function(SEARCHMODULE){ var savedSearchId = 'customsearch_mySavedSearch'; var mySearch = SEARCHMODULE.load(savedSearchId); var resultset = mySearch.run(); var results = resultset.getRange(0, 1000); for(var i in results){ var result = results[i]...
UI-Router exposes transition events that can be helpful for handling transition errors, handling/blocking transitions based on certain parameter values, custom authentication etc.. These events can be bound to $rootScope for a global effect or to $scope for a per controller effect. $stateChangeE...
Formset is a way to render multiple forms in one page, like a grid of data. Ex: This ChoiceForm might be associated with some question of sort. like, Kids are most Intelligent between which age?. appname/forms.py from django import forms class ChoiceForm(forms.Form): choice = forms.CharFie...
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...
function sumofsins1(n::Integer) r = 0 for i in 1:n r += sin(3.4) end return r end function sumofsins2(n::Integer) r = 0.0 for i in 1:n r += sin(3.4) end return r end Timing the above two functions shows major...
Sometimes you might want to pass information that has been generated in one form, to another form for additional use. This is useful for forms that display a search tool, or a settings page among many other uses. Let's say you want to pass a DataTable between a form that is already open (MainForm) ...

Page 644 of 1038