This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-NetRoute -DestinationPrefix 0.0.0.0/0 | Tee-Object -Variable DefaultRoute | |
$DefaultRoute |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@startuml | |
class FirstClass { | |
} | |
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$thisDirectory = "C:\JIRA"; | |
$logPath = "$thisDirectory\restartLog.log"; | |
Function LogWrite | |
{ | |
Param ([string]$logString) | |
$dateString = "$(Get-Date -Format u)"; | |
$outputString = "$dateString $logString"; | |
Write-Host $outputString; | |
Add-content $logPath -value $outputString; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
import numpy as np | |
def OptimizedFunction(x): | |
return (math.pow((x%6), 2) % (7-math.sin(x))) | |
MaxValue = 0 | |
MaxIndex = 0 | |
for i in range(1,101): | |
print("i = " + str(i)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///All of this borrowed from: https://msdn.microsoft.com/en-us/magazine/hh580739.aspx | |
/// <summary> | |
/// Writes codec options from codec configuration dialog to a file. | |
/// </summary> | |
private static void WriteAviSaveOptions(string FileName, ref AVICOMPRESSOPTIONS Options) | |
{ | |
using (BinaryWriter Writer = new BinaryWriter( | |
File.Open(FileName, FileMode.Create))) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Adds Create Database permission for the built-in Windows Authenticated Users group if it can. | |
/// </summary> | |
public static void AddPermissionAuthenticatedUsersCreateDb(string Server) | |
{ | |
Log.Trace($"Trying to add create database permission for authenticated users group on server: {Server}"); | |
string SqlcmdLogFile = @"${specialfolder:CommonApplicationData}\" + | |
Application.CompanyName + @"\" + | |
Application.ProductName + @"\" + | |
@"Data\SqlCmd.log"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async Task DoWork() | |
{ | |
//blocking | |
//int res = await Task.FromResult<int>(GetSum(4, 5)); | |
//non-blocking | |
int res = await Task<int>.Run(() => GetSum(4, 5)); | |
} | |
private int GetSum(int a, int b) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async Task DoWork() | |
{ | |
int res = await Task.FromResult<int>(GetSum(4, 5)); | |
} | |
private int GetSum(int a, int b) | |
{ | |
return a + b; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Data; | |
using System.Drawing; | |
using System.Linq; | |
using System.Text; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using System.Windows.Forms; |