Tutorial by Examples: am

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(...
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...
The export tool exports a set of files from HDFS back to an RDBMS. The target table must already exist in the database. The input files are read and parsed into a set of records according to the user-specified delimiters. Example : sqoop export \ --connect="jdbc:<databaseconnector>&quo...
This is same as reading a manual for a command: man /path/to/man/file
This example uses Angular 2.0.0 Final Release registration-form.component.ts import { FormGroup, FormControl, FormBuilder, Validators } from '@angular/forms'; @Component({ templateUrl: "./registration-form.html" }) export class ExampleComponent { ...
The pandas.DataFrame.apply() method is used to apply a given function to an entire DataFrame --- for example, computing the square root of every entry of a given DataFrame or summing across each row of a DataFrame to return a Series. The below is a basic example of usage of this function: # create...
We will present some examples to show how to apply happens-before reasoning to check that writes are visible to subsequent reads. Single-threaded code As you would expect, writes are always visible to subsequent reads in a single-threaded program. public class SingleThreadExample { public in...
If you have an elixir file; a script or a module and want to load it into the current IEx session, you can use the c/1 method: iex(1)> c "lib/utils.ex" iex(2)> Utils.some_method This will compile and load the module in IEx, and you'll be able to call all of it's public methods. ...
Framebuffer is a type of buffer which stores color values, depth and stencil information of pixels in memory. When you draw something in OpenGL the output is stored in the default framebuffer and then you actually see the color values of this buffer on screen. You can also make your own framebuffer ...
There are very good configurations to force typings and get more helpful errors which are not activated by default. { "compilerOptions": { "alwaysStrict": true, // Parse in strict mode and emit "use strict" for each source file. // If you have wrong c...
If you have email column you can mask it with email() mask: ALTER TABLE Company ALTER COLUMN Email ADD MASKED WITH (FUNCTION = 'email()') When user tries to select emails from Company table, he will get something like the following values: [email protected] [email protected] [email protected]
Func<int, int> add1 = i => i + 1; Func<int, int, int> add = (i, j) => i + j; // Behaviourally equivalent to: int Add1(int i) { return i + 1; } int Add(int i, int j) { return i + j; } ... Console.WriteLine(add1(42)); //43 Console.WriteLine(Add1(42));...
// assume source is {0, 1, 2, ..., 10} var evens = source.Where(n => n%2 == 0); // evens = {0, 2, 4, ... 10} var strings = source.Select(n => n.ToString()); // strings = {"0", "1", ..., "10"}
See remarks for discussion of closures. Suppose we have an interface: public interface IMachine<TState, TInput> { TState State { get; } public void Input(TInput input); } and then the following is executed: IMachine<int, int> machine = ...; Func<int, int> machineC...
Func<int, string> doubleThenAddElevenThenQuote = i => { var doubled = 2 * i; var addedEleven = 11 + doubled; return $"'{addedEleven}'"; };
Spring is a framework, which provides bunch of classes, by using this we don't need to write boiler plate logic in our code, so Spring provides an abstract layer on J2ee. For Example in Simple JDBC Application programmer is responsible for Loading the driver class Creating the connection Cre...
What happens when we execute python -m SimpleHTTPServer 9000? To answer this question we should understand the construct of SimpleHTTPServer (https://hg.python.org/cpython/file/2.7/Lib/SimpleHTTPServer.py) and BaseHTTPServer(https://hg.python.org/cpython/file/2.7/Lib/BaseHTTPServer.py). Firstly, P...
Expression<Func<int, bool>> checkEvenExpression = i => i%2 == 0; // lambda expression is automatically converted to an Expression<Func<int, bool>>

Page 84 of 129