Skip to content

Instantly share code, notes, and snippets.

@myd7349
myd7349 / chat.lua
Created July 3, 2024 02:05 — forked from StephenCleary/chat.lua
Starting point for a custom TCP Wireshark dissector in Lua
-- authors: Hadriel Kaplan <hadriel@128technology.com>, Stephen Cleary
-- Copyright (c) 2015-2022, Hadriel Kaplan, Stephen Cleary
-- This code is in the Public Domain, or the BSD (3 clause) license if Public Domain does not apply in your country.
-- Thanks to Hadriel Kaplan, who wrote the original FPM Lua script.
-- This is a starting point for defining a dissector for a custom TCP protocol.
-- This approach assumes that each message has a header that indicates the message length.
-- The code in this example uses a 4-byte header which is just a 4-byte big-endian message length,
-- and this length does not include the length of the header.
-- Modify the sections marked TODO to adjust these assumptions.
@myd7349
myd7349 / c#part
Created June 27, 2024 07:36 — forked from joemaidman/c#part
WPF datagrid tooltip for hidden text
public class TrimmedTextBlockVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (value == null) return Visibility.Collapsed;
FrameworkElement textBlock = (FrameworkElement)value;
textBlock.Measure(new System.Windows.Size(Double.PositiveInfinity, Double.PositiveInfinity));
@myd7349
myd7349 / unicorn2lsl.py
Created June 3, 2024 08:37 — forked from robertoostenveld/unicorn2lsl.py
This is a native python implementation to stream data from a Unicorn EEG system to LSL. It works on macOS, Linux and Windows.
#!/usr/bin/env python
# Unicorn2lsl streams data from a Unicorn Hybrid Black EEG system to LSL
#
# Copyright (C) 2022 Robert Oostenveld
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
@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"