Tutorial by Examples: o

Creating a reverse ssh tunnel takes just one switch -R to the original command. Command line Let's assume you are connecting to the example.com as a user guest using a command ssh [email protected]. Opening reverse tunnel can look like this: ssh -R 2222:localhost:22 [email protected] It will o...
#include <pthread.h> #include <stdio.h> #include <string.h> /* function to be run as a thread always must have the same signature: it has one void* parameter and returns void */ void *threadfunction(void *arg) { printf("Hello, World!\n"); /*printf() is speci...
Consider these two micro-benchmarks: The first benchmark simply creates, starts and joins threads. The thread's Runnable does no work. public class ThreadTest { public static void main(String[] args) throws Exception { while (true) { long start = System.nanoTime(); ...
If you need to store images or videos in the column then we need to change the value as needed by your application max_allowed_packet = 10M M is Mb, G in Gb, K in Kb
Starting with a binary image, bwImg, which contains a number of connected objects. >> bwImg = imread('blobs.png'); >> figure, imshow(bwImg), title('Binary Image') To measure properties (e.g., area, centroid, etc) of every object in the image, use regionprops: >> stats = reg...
Conditions can also be expressions: $myInput = 0 switch($myInput) { # because the result of the expression, 4, # does not equal our input this block should not be run. (2+2) { 'True. 2 +2 = 4' } # because the result of the expression, 0, # does equal our input this ...
Given the following CSV-file String,DateTime,Integer First,2016-12-01T12:00:00,30 Second,2015-12-01T12:00:00,20 Third,2015-12-01T12:00:00,20 One can import the CSV rows in PowerShell objects using the Import-Csv command > $listOfRows = Import-Csv .\example.csv > $listOfRows String ...
By default, Import-CSV imports all values as strings, so to get DateTime- and integer-objects, we need to cast or parse them. Using Foreach-Object: > $listOfRows = Import-Csv .\example.csv > $listOfRows | ForEach-Object { #Cast properties $_.DateTime = [datetime]$_.DateTime $...
The simple and most obvious way to use recursion to get the Nth term of the Fibonnaci sequence is this int get_term_fib(int n) { if (n == 0) return 0; if (n == 1) return 1; return get_term_fib(n - 1) + get_term_fib(n - 2); } However, this algorithm does not scale for higher ...
Most Rails developers start by modifying their model information within the template itself: <h1><%= "#{ @user.first_name } #{ @user.last_name }" %></h1> <h3>joined: <%= @user.created_at.in_time_zone(current_user.timezone).strftime("%A, %d %b %Y %l:%M %p&q...
Detailed instructions on getting tizen set up or installed. You can start developing Tizen apps on commercialized devices : https://wiki.tizen.org/wiki/Devices Or https://wiki.tizen.org/wiki/ReferenceDevices Last option is to install Tizen from scratch on existing Hardware (x86, ARM etc) : htt...
// Store a reference to the native method let open = XMLHttpRequest.prototype.open; // Overwrite the native method XMLHttpRequest.prototype.open = function() { // Assign an event listener this.addEventListener("load", event => console.log(XHR), false); // Call the s...
To install and run jboss AS standalone you can follow the processes described below(assuming that you already have java 7 and jdk installed on your mac): Download the jboss application server from here. Unzip the package and extract the folders Set up the your bash_profile like the fo...
Executors returns different type of ThreadPools catering to specific need. public static ExecutorService newSingleThreadExecutor() Creates an Executor that uses a single worker thread operating off an unbounded queue There is a difference between newFixedThreadPool(1) and newSingleThreadE...
DateTime.parse is a very useful method which construct a DateTime from a string, guessing its format. DateTime.parse('Jun, 8 2016') # => #<DateTime: 2016-06-08T00:00:00+00:00 ((2457548j,0s,0n),+0s,2299161j)> DateTime.parse('201603082330') # => #<DateTime: 2016-03-08T23:30:00+00:00...
DateTime + Fixnum (days quantity) DateTime.new(2015,12,30,23,0) + 1 # => #<DateTime: 2015-12-31T23:00:00+00:00 ((2457388j,82800s,0n),+0s,2299161j)> DateTime + Float (days quantity) DateTime.new(2015,12,30,23,0) + 2.5 # => #<DateTime: 2016-01-02T11:00:00+00:00 ((2457390j,39600s,...
Instructions on getting octave set up or installed. Installing Octave for debian systems (Debian, Ubuntu): Simple: sudo apt-get install octave Advanced: Well, if you want to install other external packages sudo apt-get install octave-control octave-image octave-io octave-optim octave-signal oct...
You can get the download link for the setup file in here : https://www.visualstudio.com [Scroll to the bottom of the page and download the Visual Studio] The setups are relatively simply and common. But do take note when they ask you to download the default or custom, you can choose to download th...
In Below sample we are creating one global javascript object dojoConfig which will contain all the configuration values. Note: dojoConfig is defined in a script block before dojo.js is loaded. This is of paramount importance—if reversed, the configuration properties will be ignored. <script...
Dojo received a new loader in Dojo 1.7 to accommodate for the toolkit's new AMD module format. This new loader added a few new configuration options that are crucial to defining packages, maps, and more. For details on the loader, see the Advanced AMD Usage tutorial. Important loader configuration p...

Page 607 of 1038