Tutorial by Examples: api

One of several applications of bit manipulation is converting a letter from small to capital or vice versa by choosing a mask and a proper bit operation. For example, the a letter has this binary representation 01(1)00001 while its capital counterpart has 01(0)00001. They differ solely in the bit in...
The Builder Pattern decouples the creation of the object from the object itself. The main idea behind is that an object does not have to be responsible for its own creation. The correct and valid assembly of a complex object may be a complicated task in itself, so this task can be delegated to anoth...
This is a just a simple example of how to use GooglePlay Service's ActivityRecognitionApi. Although this is a great library, it does not work on devices that do not have Google Play Services installed. Docs for ActivityRecognition API Manifest <!-- This is needed to use Activity Recognition! -...
Introduction So you want to start using bootstrap for your project? Great! then lets get started right now!. What is bootstrap? Bootstrap is an open source library wich you can use to make amazing responsive projects with using responsive design and simple code. Responsive Design is a design phil...
rebar: Pouriya@Jahanbakhsh ~/director $ rebar doc rebar3: Pouriya@Jahanbakhsh ~/director $ rebar3 edoc erl Pouriya@Jahanbakhsh ~/director $ mkdir -p doc && erl -noshell\ -eval "edoc:file(\"./src/direc...
Gradle Setup : build.gradle(Module: app) compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } jackOptions { enabled true } What is the Stream API ? Stream is a new abstract layer introdu...
The first major distinction is between the dynamically generated directories which will be used for hosting and source directories. The source directories will have a config file or folder depending on the amount of configuration you may have . This includes the environment configuration and busi...
Or you can achieve the same by constructing the query yourself using their API: See this tutorial around creating the BooleanQuery. BooleanQuery multiTermQuery = new BooleanQuery(); multiTermQuery.add(new TermQuery(new Term("field_name1", "field value 1")), BooleanClause.Occur...
CREATE BITMAP INDEX emp_bitmap_idx ON index_demo (gender); Bitmap index is used when data cardinality is low. Here, Gender has value with low cardinality. Values are may be Male, Female & others. So, if we create a binary tree for this 3 values while searching it will have unnecessary ...
6 class Item { constructor(text, type) { this.text = text; this.emphasis = false; this.type = type; } toHtml() { return `<${this.type}>${this.emphasis ? '<em>' : ''}${this.text}${this.emphasis ? '</em>' : ''}</${this.type}...
Simple extract of index.html: <div class="sign-in"> {% if user %} [Passing the url we have the opportunity to logout the user] <a href="{{ url|safe }}">LOG OUT</a> [You can include here operations for user authenticated] ...
use \Psr\Http\Message\ServerRequestInterface as Request; use \Psr\Http\Message\ResponseInterface as Response; require 'vendor/autoload.php'; $app = new \Slim\App; $app->get('/employee/view', function ($req, $res) { $con = new mysqli('localhost','USERNAME','PASSWORD','DATABASE'); ...
You can use django rest framework permission classes to check request headers and authenticate user requests Define your secret_key on project settings API_KEY_SECRET = 'secret_value' note: a good practice is to use environment variables to store this secret value. Define a permission ...
This module register hello function on hello module. hello function prints Hello world on console with printf and return 1373 from native function into javascript caller. #include <node_api.h> #include <stdio.h> napi_value say_hello(napi_env env, napi_callback_info info) { n...
use \Psr\Http\Message\ServerRequestInterface as Request; use \Psr\Http\Message\ResponseInterface as Response; $app = new \Slim\App; $app->post('/post/data', function (Request $request, Response $response, $arg){ $_input = $request->getParsedBody(); $_data_1 = $_input['name...
Declaring a DLL procedure to work with different VBA versions: Option Explicit #If Win64 Then Private Declare PtrSafe Sub xLib "Kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long) #ElseIf Win32 Then Private Declare Sub apiSleep Lib "Kernel32" Ali...
Option Explicit #If Win64 Then 'Win64 = True, Win32 = False, Win16 = False Private Declare PtrSafe Sub apiCopyMemory Lib "Kernel32" Alias "RtlMoveMemory" (MyDest As Any, MySource As Any, ByVal MySize As Long) Private Declare PtrSafe Sub apiExitProcess Lib "Kern...
#ElseIf Win32 Then 'Win32 = True, Win16 = False Private Declare Sub apiCopyMemory Lib "Kernel32" Alias "RtlMoveMemory" (MyDest As Any, MySource As Any, ByVal MySize As Long) Private Declare Sub apiExitProcess Lib "Kernel32" Alias "ExitProcess" (ByVa...
You can also use tee command to store the output of a command in a file and redirect the same output to another command. The following command will write current crontab entries to a file crontab-backup.txt and pass the crontab entries to sed command, which will do the substituion. After the substi...
PostmarkMailSender.java public class PostmarkMailSender implements MailSender{ private static Logger logger = Logger.getLogger("com.postmark"); private String serverToken; private static Gson gson; static { GsonBuilder gsonBuilder = new GsonBuilder(); ...

Page 11 of 12