Tutorial by Examples: c

Laravel is a well-known PHP Framework. Here, you will learn all-about Laravel. Starting from as-simple-as knowing what Object-Oriented Programming is, to the advanced Laravel package development topic. This, like every other Stackoverflow documentation tag, is community-driven documentation, so if ...
set clipboard=unnamed This makes it possible to copy/paste between Vim and the system clipboard without specifying any special register. yy yanks the current line into the system clipboard p pastes the content of the system clipboard into Vim This only works if your Vim installation has cli...
1. $_ : The default input and pattern-searching space. Example 1: my @array_variable = (1 2 3 4); foreach (@array_variable){ print $_."\n"; # $_ will get the value 1,2,3,4 in loop, if no other variable is supplied. } Example 2: while (<FH>){ chomp($_); # $_ re...
By default communication over the channcels is sync; when you send some value there must be a receiver. Otherwise you will get fatal error: all goroutines are asleep - deadlock! as follows: package main import "fmt" func main() { msg := make(chan string) msg <- "He...
<mvc:View controllerName="sap.m.sample.ListCounter.List" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m"> <List headerText="Fruits" items="{path:'products>/Products', sorter:{path:'Name'}, filter:{path:'Type', o...
import AVFoundation class QRScannerViewController: UIViewController, AVCaptureMetadataOutputObjectsDelegate { func viewDidLoad() { self.initCaptureSession() } private func initCaptureSession() { let captureDevice = AVCaptureDevice .defa...
Use the quotestar register to copy/paste between Vim and system clipboard "*yy copies the current line into the system clipboard "*p pastes the content of the system clipboard into Vim
Dynamic Time Warping(DTW) is an algorithm for measuring similarity between two temporal sequences which may vary in speed. For instance, similarities in walking could be detected using DTW, even if one person was walking faster than the other, or if there were accelerations and decelerations during ...
One of the most important implementations of Dynamic Programming is finding out the Longest Common Subsequence. Let's define some of the basic terminologies first. Subsequence: A subsequence is a sequence that can be derived from another sequence by deleting some elements without changing the orde...
Weighted Job Scheduling Algorithm can also be denoted as Weighted Activity Selection Algorithm. The problem is, given certain jobs with their start time and end time, and a profit you make when you finish the job, what is the maximum profit you can make given no two jobs can be executed in parallel...
Suppose you are asked, given the total weight you can carry on your knapsack and some items with their weight and values, how can you take those items in such a way that the sum of their values are maximum, but the sum of their weights don't exceed the total weight you can carry? The 0-1 indicates e...
Problem ConcurrentDictionary shines when it comes to instantly returning of existing keys from cache, mostly lock free, and contending on a granular level. But what if the object creation is really expensive, outweighing the cost of context switching, and some cache misses occur? If the same key ...
To list the dependency tree: gem dependency To list which gems depend on a specific gem (bundler for example) gem dependency bundler --reverse-dependencies
The example above can also be implemented with fences and relaxed atomic operations: int x, y; std::atomic<bool> ready{false}; void init() { x = 2; y = 3; atomic_thread_fence(std::memory_order_release); ready.store(true, std::memory_order_relaxed); } void use() { if (re...
One of the best features of async/await syntax is that standard try-catch coding style is possible, just like you were writing synchronous code. const myFunc = async (req, res) => { try { const result = await somePromise(); } catch (err) { // handle errors here } }); Here'...
Here is how to create a custom calendar. The example given is a french calendar -- so it provides many examples. from pandas.tseries.holiday import AbstractHolidayCalendar, Holiday, EasterMonday, Easter from pandas.tseries.offsets import Day, CustomBusinessDay class FrBusinessCalendar(AbstractH...
Here is how to use the custom calendar. Get the holidays between two dates import pandas as pd from datetime import date # Creating some boundaries year = 2016 start = date(year, 1, 1) end = start + pd.offsets.MonthEnd(12) # Creating a custom calendar cal = FrBusinessCalendar() # Getti...
COALESCE () Evaluates the arguments in order and returns the current value of the first expression that initially does not evaluate to NULL. DECLARE @MyInt int -- variable is null until it is set with value. DECLARE @MyInt2 int -- variable is null until it is set with value. DECLARE @MyInt3 int -...
Let's discuss with an example. From n items, in how many ways you can choose r items? You know it is denoted by . Now think of a single item. If you don't select the item, after that you have to take r items from remaining n-1 items, which is given by . If you select the item, after that you hav...

Page 644 of 826