Skip to content

Instantly share code, notes, and snippets.

@myd7349
myd7349 / version.pas
Created March 14, 2024 05:47 — forked from lextm/version.pas
Inno Setup script sample part 2
function InitializeSetup(): Boolean;
var
oldVersion: String;
uninstaller: String;
ErrorCode: Integer;
begin
if RegKeyExists(HKEY_LOCAL_MACHINE,
'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{F768F6BA-F164-4599-BC26-DCCFC2F76855}_is1') then
begin
RegQueryStringValue(HKEY_LOCAL_MACHINE,
// ... application includes here
// CMSIS Math includes
#include "arm_math.h"
#include "arm_const_structs.h"
// using a 1024 point signal
#define FFT_SAMPLES 1024
#define FFT_SAMPLES_HALF (FFT_SAMPLES / 2)
// CMSIS Math
#include "arm_math.h"
#include "arm_const_structs.h"
#define SIG_SAMPLES 1024
#define BLOCK_SIZE 32;
#include "SWAsignal.h"
static float32_t filtSignal[SIG_SAMPLES];
// FILTER
@myd7349
myd7349 / spline.c
Created January 20, 2024 02:50 — forked from svdamani/spline.c
Natural Cubic Spline Interpolation in C
/** Numerical Analysis 9th ed - Burden, Faires (Ch. 3 Natural Cubic Spline, Pg. 149) */
#include <stdio.h>
int main() {
/** Step 0 */
int n, i, j;
scanf("%d", &n);
n--;
float x[n + 1], a[n + 1], h[n], A[n], l[n + 1],
u[n + 1], z[n + 1], c[n + 1], b[n], d[n];
@myd7349
myd7349 / ThresholdingAlgo.py
Created January 8, 2024 01:53 — forked from ximeg/ ThresholdingAlgo.py
Python implementation of smoothed z-score algorithm from http://stackoverflow.com/a/22640362/6029703
#!/usr/bin/env python
# Implementation of algorithm from http://stackoverflow.com/a/22640362/6029703
import numpy as np
import pylab
def thresholding_algo(y, lag, threshold, influence):
signals = np.zeros(len(y))
filteredY = np.array(y)
avgFilter = [0]*len(y)
stdFilter = [0]*len(y)
@myd7349
myd7349 / ItemsControlWithScrollViewer.xaml
Created January 3, 2024 01:56 — forked from punker76/ItemsControlWithScrollViewer.xaml
ItemsControl with ScrollViewer inside Template
<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dd="urn:gong-wpf-dragdrop">
<Grid>
<ItemsControl x:Name="pnlBilder"
HorizontalAlignment="Center"
Width="300" Height="100"
dd:DragDrop.IsDragSource="True"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
@myd7349
myd7349 / tls_client.c
Created December 26, 2023 14:33 — forked from mmozeiko/tls_client.c
simple example of TLS socket client using win32 schannel api
#define WIN32_LEAN_AND_MEAN
#include <winsock2.h>
#include <windows.h>
#define SECURITY_WIN32
#include <security.h>
#include <schannel.h>
#include <shlwapi.h>
#include <assert.h>
#include <stdio.h>
@myd7349
myd7349 / app_path.py
Created December 20, 2023 11:48 — forked from stlehmann/app_path.py
Determine the application path of a Python EXE
def app_path():
"""
Return the path of the application.
"""
if getattr(sys, 'frozen', False):
return os.path.dirname(sys.executable)
return os.path.dirname(__file__)
@myd7349
myd7349 / global.targets
Created December 13, 2023 05:28 — forked from shvydky/global.targets
MSBuild/GIT/SVN auto-increment build number
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
DefaultTargets="Settings">
<PropertyGroup>
<productVersion>0.1.1</productVersion>
</PropertyGroup>
<UsingTask
TaskName="ExtractRevisionHash"
TaskFactory="CodeTaskFactory"