//Create a new ExcelPackage
using (ExcelPackage excelPackage = new ExcelPackage())
{
//Set some properties of the Excel document
excelPackage.Workbook.Properties.Author = "VDWWD";
excelPackage.Workbook.Properties.Title = "Title of Document";
excelPackage.Workboo...
Introduction
The Ninja build system is described by its project website as "a small build system with a focus on speed." Ninja is designed to have its files generated by build system file generators, and takes a low-level approach to build systems, in contrast to higher-level build system...
Introduction
NMAKE is a command-line utility developed by Microsoft to be used primarily in conjunction with Microsoft Visual Studio and/or the Visual C++ command line tools.
NMAKE is build system that falls under the Make family of build systems, but has certain distinct features that diverge fro...
Session storage service :
Common factory service that will save and return the saved session data based on the key.
'use strict';
/**
* @ngdoc factory
* @name app.factory:storageService
* @description This function will communicate with HTML5 sessionStorage via Factory Service.
*/
a...
If a view is created WITH SCHEMABINDING, the underlying table(s) can't be dropped or modified in such a way that they would break the view. For example, a table column referenced in a view can't be removed.
CREATE VIEW dbo.PersonsView
WITH SCHEMABINDING
AS
SELECT
name,
address
FROM d...
Maybe
Maybe is an applicative functor containing a possibly-absent value.
instance Applicative Maybe where
pure = Just
Just f <*> Just x = Just $ f x
_ <*> _ = Nothing
pure lifts the given value into Maybe by applying Just to it. The (<*>) function applies...
The first to thing to have: a model that contains a has_many relation with another model.
class Project < ApplicationRecord
has_many :todos
end
class Todo < ApplicationRecord
belongs_to :project
end
In ProjectsController:
class ProjectsController < ApplicationController
d...
It is a bad practice to block on async calls as it can cause deadlocks in environments that have a synchronization context. The best practice is to use async/await "all the way down." For example, the following Windows Forms code causes a deadlock:
private async Task<bool> TryThis()...
A data structure is a way of organizing and storing information.
Let a "Hello, World!" string be the information that we need to organize and store in byte-addressable memory.
Each ASCII character requires 7 bits of storage. Most systems reserve 8 bits (1 byte) for each character, so eac...
Ifconfig
List all the interfaces available on the machine
$ ifconfig -a
List the details of a specific interface
Syntax: $ ifconfig <interface>
Example:
$ ifconfig eth0
eth0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
inet addr:x.x.x.x Bcast:x.x.x.x Mask:x.x.x.x
...
An IP address to an interface could be obtained via DHCP or Static assignment
DHCP
If you are connected to a network with a DHCP server running, dhclient command can get an IP address for your interface
$ dhclient <interface>
or alternatively, you could make a change to the /etc/network/...
File: /etc/resolv.conf contains a list of DNS servers for domain name resolution
Sample contents of the file:
nameserver 8.8.8.8 # IP address of the primary name server
nameserver 8.8.4.4 # IP address of the secondary name server
In case internal DNS server you can validate if this server reso...
IMPORTANT This is just an example code, do not use in production.
In order to download an header chain we have to send a getHeaders message.
In this example we will require as much as possible headers after the 40000th one.The peer will respond with batch of 2000 headers so, we have to take the la...
Sometimes the crashes occur constantly in a single form or report, or occur only when printing. It is possible that the binary data within the form / report has become corrupt.
Save the Form / Report object as text
There are two undocumented functions. Application.SaveAsText and Application.Load...
Detailed instructions on getting amazon-cloudformation set up or installed.
Amazon cloud formation templates can be launched in three ways.
AWS Console.
AWS CLI.
AWS SDK available in Java, Ruby etc..
AWS CLI is one of the most intuitive CLI available. The commands are simple to ...
We can statically bootstrap an application by taking the plain ES5 Javascript output of the generated factory classes. Then we can use that output to bootstrap the application:
import { platformBrowser } from '@angular/platform-browser';
import { AppModuleNgFactory } from './main.ngfactory';
//...