- Update the index of packages
$ sudo apt update
- Update (upgrade) installed packages
$ sudo apt upgrade
using System; | |
using System.Diagnostics; | |
using System.Text; | |
public class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
if (args.Length < 1) | |
{ |
/// <summary> | |
/// Deserializes XmlDocument object to Serializable object of type T. | |
/// </summary> | |
/// <typeparam name="T">Serializable object type as output type.</typeparam> | |
/// <param name="document">XmlDocument object to be deserialized.</param> | |
/// <returns>Deserialized serializable object of type T.</returns> | |
public static T Deserialize<T>(this XmlDocument document) | |
where T : class | |
{ | |
XmlReader reader = new XmlNodeReader(document); |
# See https://stackoverflow.com/questions/48341920/git-branch-command-behaves-like-less | |
git config --global pager.branch false |
// See https://codepen.io/dhavalt10/pen/rGLBzB | |
history.pushState(null, null, location.href); | |
window.onpopstate = function () { | |
history.go(1); | |
}; |
$.fn.serializeObject = function () { | |
var i, len, item, object = {}, array = $(this).serializeArray() || []; | |
len = array.length; | |
for (i = 0; i < len; i += 1) { | |
item = array[i]; | |
object[item.name] = item.value; | |
} | |
return object; | |
} |
public class ReportPrinter : IDisposable | |
{ | |
private int currentPageIndex; | |
private IList<Stream> streams; | |
private DataTable LoadSalesData() | |
{ | |
// Create a new DataSet and read sales data file | |
// data.xml into the first DataTable. | |
DataSet dataSet = new DataSet(); |
// See https://github.com/elastic/elasticsearch-net/issues/2860 | |
public class MyDocument | |
{ | |
public string RecordType { get; set; } | |
} | |
var client = new ElasticClient(); | |
client.Search<MyDocument>(s => s |
Stop-Service DiagTrack | |
Set-Service DiagTrack -StartupType Disabled |
/// See https://stackoverflow.com/questions/11143303/how-to-set-author-name-to-excel-file-using-poi | |
public static void SetAuthor(this IWorkbook workbook, string author) | |
{ | |
if (workbook is NPOI.XSSF.UserModel.XSSFWorkbook) | |
{ | |
var xssfWorkbook = workbook as NPOI.XSSF.UserModel.XSSFWorkbook; | |
var xmlProps = xssfWorkbook.GetProperties(); | |
var coreProps = xmlProps.CoreProperties; | |
coreProps.Creator = author; | |
return; |