Tutorial by Examples: a

Assuming that you are working with Windows 7 PC Step 1: GOTO -> C:\Windows\System32\drivers\etc Where you will find a file named “hosts”, kindly copy it and paste it at the same location. A copy file of hosts will be created there. Now we need to make some modifications in this file but if you...
The HTTP response status code 301 Moved Permanently is used for permanent URL redirection, meaning current links or records using the URL that the response is received for should be updated. The new URL should be provided in the Location field included with the response. The 301 redirect is consider...
To query a field which name is contained in a variable, use the field function. some_field = :id some_value = 10 from p in Post, where: field(p, ^some_field) == ^some_value
SQOOP provides facility to import all tables sqoop import-all-tables \ --connect <rdbms-jdbc-url> \ --username <username> \ --password <password> \ --hive-import \ --create-hive-table \ --hive-database <dbname> \ --warehouse-dir <warehouse-dir> Important poin...
For interacting with plots Matplotlib offers GUI neutral widgets. Widgets require a matplotlib.axes.Axes object. Here's a slider widget demo that ùpdates the amplitude of a sine curve. The update function is triggered by the slider's on_changed() event. import numpy as np import matplotlib.pyplot...
If you are new to middleware in Express check out the Overview in the Remarks section. First, we are going to setup a simple Hello World app that will be referenced and added to during the examples. var express = require('express'); var app = express(); app.get('/', function(req, res) { r...
Let's create middleware that adds a property called requestTime to the request object. var requestTime = function (req, res, next) { req.requestTime = Date.now(); next(); }; Now let's modify the logging function from the previous example to utilize the requestTime middleware. myLogge...
A good VOD (Video On Demand) service should start with the basics. Lets say you have a directory on your server that is not publicly accessible, yet through some sort of portal or paywall you want to allow users to access your media. var movie = path.resolve('./public/' + req.params.filename); ...
You can also use flent-ffmpeg to convert .mp4 files to .flv files, or other types: res.contentType('flv'); var pathToMovie = './public/' + req.params.filename; var proc = ffmpeg(pathToMovie) .preset('flashvideo') .on('end', function () { console.log(...
s/foo/bar/; # replace "foo" with "bar" in $_ my $foo = "foo"; $foo =~ s/foo/bar/; # do the above on a different variable using the binding operator =~ s~ foo ~ bar ~; # using ~ as a delimiter $foo = s/foo/bar/r; # non-destructive r flag: returns the repl...
Implement onMessageReceived that will catch the notification sent from GCM server. @Override public void onMessageReceived(String from, Bundle data) { String message = data.getString("message"); Log.d(TAG, "From: " + from); Log.d(TAG, "Message: "...
To receive the notification, implement application:didReceiveRemoteNotification:fetchCompletionHandler: (or application:didReceiveRemoteNotification: for iOS < 8.0), and call GCMService:appDidReceiveMessage:message to acknowledge the reception of the message to GCM. - (void)application:(UIApplic...
This writeup walks though steps to configure Tomcat to request CAC certificates from the client. It is focused on setting up a development environment, so some features that should be considered for production are not here. (For example it shows using a self-signed certificate for https and it does...
This example uses the map format introduced in Erlang/OTP 18.0. %% A module implementing a supervisor usually has a name ending with `_sup`. -module(my_sup). -behaviour(supervisor). %% API exports -export([start_link/0]). %% Behaviour exports -export([init/1]). start_link() -> ...
We initialize the data: [X,Y] = meshgrid(1:2:10); Z = X.*cos(Y) - Y.*sin(X); The surface looks like the following. Now we set the points where we want to interpolate: [Vx,Vy] = meshgrid(1:0.25:10); We now can perform nearest interpolation, Vz = interp2(X,Y,Z,Vx,Vy,'nearest'); line...
We will use the following data: x = 1:5:50; y = randi([-10 10],1,10); Hereby x and y are the coordinates of the data points and z are the points we need information about. z = 0:0.25:50; One way to find the y-values of z is piecewise linear interpolation. z_y = interp1(x,y,z,'linear'); ...
To execute Javascript in Java, create a new webdriver that supports Javascript. To use the executeScript() function, either the driver must be cast to a JavascriptExecutor, or a new variable can be set to the value of the casted driver: ((JavascriptExecutor)driver). driver.executeScript() takes in a...
Inline assembly will only be supported in nightly versions of Rust until it is stabilized. To enable usage of the asm! macro, use the following feature attribute at the top of the main file (a feature gate): #![feature(asm)] Then use the asm! macro in any unsafe block: fn do_nothing() { u...
Use conditional compilation to ensure that code only compiles for the intended instruction set (such as x86). Otherwise code could become invalid if the program is compiled for another architecture, such as ARM processors. #![feature(asm)] // Any valid x86 code is valid for x86_64 as well. Be ca...
#![feature(asm)] #[cfg(any(target_arch="x86", target_arch="x86_64"))] fn subtract(first: i32, second: i32) { unsafe { // Output values must either be unassigned (let result;) or mutable. let result: i32; // Each value that you pass in will b...

Page 770 of 1099