Tutorial by Examples

Just like you can have a pointer to an int, char, float, array/string, struct, etc. - you can have a pointer to a function. Declaring the pointer takes the return value of the function, the name of the function, and the type of arguments/parameters it receives. Say you have the following function ...
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,...
Spring provides a useful task scheduling support. To enable it, just annotate any of your @Configuration classes with @EnableScheduling: @Configuration @EnableScheduling public class MyConfig { // Here it goes your configuration }
If we want some code to be executed periodically after the execution which was before is finished, we should use fixed delay (measured in milliseconds): @Component public class MyScheduler{ @Scheduled(fixedDelay=5000) public void doSomething() { // this will execute pe...
If we want something to be executed periodically, this code will be triggered once per the value in milliseconds we specify: @Component public class MyScheduler{ @Scheduled(fixedRate=5000) public void doSomething() { // this will execute periodically } }
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) ...
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(); } ...
Here are a simple example of some common tasks related to developing an API, differentiating between the HTTP Method of the request, accessing query string values and accessing the request body. Resources http.Handler interface http.ResponseWriter http.Request Available Method and Status cons...

Page 841 of 1336