In this example the microcontroller echos back the received bytes to the sender using UART RX interrupt.
#include "stm32f4xx.h"
UART_HandleTypeDef huart2;
/* Single byte to store input */
uint8_t byte;
void SystemClock_Config(void);
/* UART2 Interrupt Service Routine */
void...
By default, NuGet restores packages into the packages folder in the solution root. This folder is shared between all solution projects. In some cases it is useful to change the location of the restored packages (for instance, to share them between several solutions).
Its can be achieved by creating...
In case you need different settings for your various applications, there is (as of Flink 1.2) no easy way to do that.
If you use the one-yarn-cluster-per-job mode of flink (i.e. you launch your scripts with: flink run -m yarn-cluster ...), here is a workaround :
create a conf directory somewhe...
The default configuration <C-b> is not the easiest to use. It'd be better to use something like ctrla. To do so, add this to tmux.conf
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
/In async.series,all the functions are executed in series and the consolidated outputs of each function is passed to the final callback. e.g/
var async = require('async');
async.series([
function (callback) {
console.log('First Execute..');
callback(null, 'userPersonalData');
},
function (cal...
The andThen function allows update call composition. Can be used with the pipeline operator (|>) to chain updates.
Example: You are making a document editor, and you want that each modification message you send to your document, you also save it:
import Update.Extra exposing (andThen)
import U...
The org.bukkit.event.EventHandler annotation accepts a couple parameters.
priority - Indicates the priority of your listener. There are the six different priorities, in order of execution: LOWEST,LOW,NORMAL[default],HIGH,HIGHEST,MONITOR. These constants refer to the org.bukkit.event.EventPriority e...
# General syntax:
# grep(<pattern>, <character vector>)
mystring <- c('The number 5',
'The number 8',
'1 is the loneliest number',
'Company, 3 is',
'Git SSH tag is [email protected]',
'My personal site is w...
This configuration lets' you run your total spec files in two browser instances in parallel. It helps reduce the overall test execution time. Change the maxInstances based on your need.
Note: Make sure your tests are independent.
var config = {};
var timeout = 120000;
config.framework = 'jasmi...
In this example 2000 bytes will be transfered using DMA, Transmit Half Complete and Transmit Complete interrupts achieving the best performance.
The first half of the transmit buffer is loaded with new data by the CPU in the Transmit Half Complete interrupt callback while the second half of the buf...
Each standard Oracle error is associated with an error number. It's important to anticipate what could go wrong in your code. Here for a connection to another database, it can be:
-28000 account is locked
-28001 password expired
-28002 grace period
-1017 wrong user / password
Here is a way ...
The MSBuildWorspace is built around the concept of handling MSBuild solutions (.sln files) and their respective projects (.csproj, .vbproj).
Adding new projects and documents to this workspace is not supported.
string solutionPath = @"C:\Path\To\Solution\Sample.sln";
MSBuildWorkspace ...
The CSharpSyntaxWalker class is out of the box implementation of the Visitor pattern, that we can use to traverse our Syntax Tree. Here is a simple example of a Syntax Walker that collects all the struct-s that have a name, starting with the letter A:
public class StructCollector : CSharpSyntaxWa...
I would like to point out that we rotate left when the shifting value is negative and we rotate right when the value is positive.
public static void Main()
{
int[] array = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
int shiftCount = 1;
Rotate(ref array, shiftCount);
...
Service that is used for communication:
import { Injectable } from '@angular/core';
import { Subject } from 'rxjs/Subject';
@Injectable()
export class ComponentCommunicationService {
private componentChangeSource = new Subject();
private newDateCreationSource = new Subject<Date&...
Follow these steps to remove public from the url
Copy .htaccess file from /public directory to Laravel/project root folder.
Rename the server.php in the Laravel/project root folder to index.php.
Cheers you will be good now.
Please Note: It is tested on Laravel 4.2, Laravel 5.1, Laravel 5.2, ...
public static class Res
{
/// <summary>
/// URL: https://www.behance.net/gallery/2846011/Manteka
/// </summary>
public static FontFamily Maneteke = GetResourceFontFamily(Properties.Resources.manteka);
public static FontFamily GetRes...