Tutorial by Examples: c

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...
!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
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;
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 }
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]...
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...
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...
Wolfram define Mathematica as "The world's definitive system for modern technical computing". A bold statement which is partially true. It's probably not the most predominant (as you have to pay quite a bit for commercial use) system so people use Python or R for example. What it is, is th...
Boxplots are descriptive diagrams that help to compare the distribution of different series of data. They are descriptive because they show measures (e.g. the median) which do not assume an underlying probability distribution. The most basic example of a boxplot in matplotlib can be achieved by jus...
Step 1: Create a transition drawable in XML Save this file transition.xml in res/drawable folder of your project. <transition xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/image1"/> <item android:drawable=...
In a procedure with native compilation, T-SQL code is compiled to dll and executed as native C code. To create a Native Compiled stored Procedure you need to: Use standard CREATE PROCEDURE syntax Set NATIVE_COMPILATION option in stored procedure definition Use SCHEMABINDING option in stored pro...

Page 520 of 826