Skip to content

Instantly share code, notes, and snippets.

@AlanPBourke
AlanPBourke / example.sql
Last active July 17, 2023 10:23
Opera Nominal View
declare @year INT = 2023
declare @periodfrom INT = 1
declare @periodto INT = 4
drop table if exists #nominalreport
select nh_job,
no_desc,
sum(nh_bal) as balance
into #nominalreport
using NUnit.Framework;
using PegasusIreland;
using System;
namespace RawPrintComTests
{
[TestFixture]
public class RawPrintTest
{
private string zplLabelString;
/*from to
311  14 Non-visible part of the top of the screen / Non-visible part of the upper border (16 lines)
 15  50 Visible part of the upper border (36 lines)
 51 250 Regular (and visible, doh!) part of the display / Screen background (200 lines)
251 299 Visible part of the lower border (49 lines)
300 302 Visible part of the vertical blanking interval (VBI) / Very bottom of the visible screen  (3 lines)
303 310 Non-visible part of the vertical blanking interval (VBI) (8 lines)
*/
/* https://lemonspawn.com/turbo-rascal-syntax-error-expected-but-begin/turbo-rascal-se-tutorials/tutorial-8-full-screen-smooth-scrolling-know-your-timing-banking/ */
@AlanPBourke
AlanPBourke / wiaresize.prg
Created June 27, 2022 11:55
Resize image using the Windows Image Recognition API in Visual FoxPro
***************************************************************************
*- Name............: ResizeImage
*- Author..........: Alan Bourke
*- Date Created....: July 2016
*- Description.....: Take a source image, resize to absolute, save to target
* -----------------: image.
***************************************************************************
Function ResizeImage(lcSourceFile As String, lcTargetFile As String, ;
lnTargetWidth as Integer, lnTargetHeight As Integer) As clsImageProcessingResult
Local llDone, loImg, loImgProcessor, lnUseWidth, lnUseHeight
@AlanPBourke
AlanPBourke / wpf-mvvm-progress.cs
Last active August 5, 2020 09:14
Using Progress<T> in WPF MVVM
public MainWindow()
{
InitializeComponent();
progressViewModel = new ProgressViewModel();
DataContext = progressViewModel;
}
private async void MainWindow_Loaded(object sender, RoutedEventArgs e)
{
// The ViewModel properties are bound to the controls in XAML
@AlanPBourke
AlanPBourke / backup.ps1
Created November 20, 2019 16:02
Powershell backup script using Robocopy.
$date = Get-Date -format yyyyMd
echo $date
$logfile = "C:\Users\myuser\robocop\logs\" + $date + ".log"
echo $logfile
echo "Starting copy of first folder ..."
robocopy C:\Users\myuser\folder1 \\myserver\myshare\folder1-backup /XF *.tmp *.bak *.fxp /MIR /FFT /R:3 /W:10 /NP /NDL /MT:32 /log+:$logfile
echo "Finished first folder."
pause