Tutorial by Examples: er

Springfox defines a set default response messages that are applied to all API controllers by default. This includes e.g. 201 - Created and 204 - No Content, as well as several 40x responses. There might be cases, in which the default response messages don't apply for your API. You have to build-in p...
Get springfox into your application by using Maven or Gradle Create a new Docket bean in your application and configure it Document your API according to your needs Launch your application and see your achieved results #1 Getting springfox with Maven Add the dependencies for swagger2 and sw...
Of all the operators, relational operators are the most complex ones, that is why we left them to the end. Relational operators are also known as Comparison operators, they are used to compare things. Comparison result is boolean false or true. Interestingly though, if you check it in V...
A good and easy alternative to the flawed rand() procedures, is xorshift, a class of pseudo-random number generators discovered by George Marsaglia. The xorshift generator is among the fastest non-cryptographically-secure random number generators. More information and other example implementaions ar...
call :tohex 14 result rem More code... :tohex <innum> <outvar> set dec=%1 set outvar=%~2 rem %n and %~n are functionally identical, but %~n is slightly safer. goto :eof This takes the additional parameters from the call as if the function was a separate Batch file. Note: the ...
1)Took backup of Machine.config from locations C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config and C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config 2)Copy them to different location and edit them as a)locate and add under <system.data> <DbProviderFactories> ...
@Component public class RestExceptionResolver extends ExceptionHandlerExceptionResolver { @Autowired //If you have multiple handlers make this a list of handlers private RestExceptionHandler restExceptionHandler; /** * This resolver needs to be injected because it is the...
GraphQL.js GraphQL.js is a JavaScript reference implementation for GraphQL. You can install it via npm: Initialize npm in your project if you have not done so already: npm init Install GraphQL.js from npm: npm install --save graphql Example Server var { graphql, buildSchema } = require('gra...
Wanted version for C and C++ can be specified globally using respectively variables CMAKE_C_STANDARD (accepted values are 98, 99 and 11) and CMAKE_CXX_STANDARD (accepted values are 98, 11 and 14): set(CMAKE_C_STANDARD 99) set(CMAKE_CXX_STANDARD 11) These will add the needed compile options on t...
v-for can be used for iterating over an object keys (and values): HTML: <div v-for="(value, key) in object"> {{ key }} : {{ value }} </div> Script: new Vue({ el: '#repeat-object', data: { object: { FirstName: 'John', LastName: 'Doe', Ag...
ALTER DATABASE [MyDatabase] SET ENABLE_BROKER WITH ROLLBACK IMMEDIATE;
USE [MyDatabase] CREATE MESSAGE TYPE [//initiator] VALIDATION = WELL_FORMED_XML; GO CREATE CONTRACT [//call/contract] ( [//initiator] SENT BY INITIATOR ) GO CREATE QUEUE InitiatorQueue; GO CREATE QUEUE TargetQueue; GO CREATE SERVICE InitiatorService ON QUEUE...
For this demonstration we will use service broker construction created in another part of this documentation. Mentioned part is named 3. Create basic service broker construction on database (single database communication). USE [MyDatabase] DECLARE @ch uniqueidentifier = NEWID() DECLARE @msg XML...
For this demonstration we will use service broker construction created in another part of this documentation. Mentioned part is called 3. Create basic service broker construction on database (single database communication). First we need to create a procedure that is able to read and process data f...
BeautifulSoup allows you to filter results by providing a function to find_all and similar functions. This can be useful for complex filters as well as a tool for code reuse. Basic usage Define a function that takes an element as its only argument. The function should return True if the argument m...
To illustrate how to use regr_slope(Y,X), I applied it to a real world problem. In Java, if you don't clean up memory properly, the garbage can get stuck and fill up the memory. You dump statistics every hour about memory utilization of different classes and load it into a postgres database for anal...
/** * Runs user-specified code when the given javascript object is garbage collected */ template<class CALLBACK_FUNCTION> void global_set_weak(v8::Isolate * isolate, const v8::Local<v8::Object> & javascript_object, CALLBACK_FUNCTION function) { struct SetWeakCallbackData{...
The idea is to have one or more control machines from where you can issue ad-hoc commands to remote machines (via ansible tool) or run a sequenced instruction set via playbooks (via ansible-playbook tool). Basically, we use Ansible control machine, this will typically be your desktop, laptop or s...
ShortcutManager shortcutManager = getSystemService(ShortcutManager.class); ShortcutInfo shortcut = new ShortcutInfo.Builder(this, "id1") .setShortLabel("Web site") // Shortcut Icon tab .setLongLabel("Open the web site") // Displayed When Long Pressing On Ap...
Mage::getSingleton('customer/session')->isLoggedIn()

Page 318 of 417