Skip to content

Instantly share code, notes, and snippets.

View ialexpovad's full-sized avatar
:electron:
I may be slow to respond.

nystagmus ialexpovad

:electron:
I may be slow to respond.
View GitHub Profile
@ialexpovad
ialexpovad / App.xaml
Created April 18, 2023 07:16
MessageBox closes immediately in DispatcherUnhandledException handler.
<Application x:Class="LOSD.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:LOSD"
Startup="App_Startup"
Exit="App_Exit"
>
<Application.Resources>
</Application.Resources>
@ialexpovad
ialexpovad / expander.xaml
Last active April 19, 2023 07:00
ToggleButton and Popup instead of Expander.
<Window x:Class="Sandbox.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="900" Width="1100">
<StackPanel>
<StackPanel Margin="20,0,0,0">
<RadioButton Content="Choice One"/>
<RadioButton Content="Choice Two"/>
<RadioButton Content="Choice Three"/>
@ialexpovad
ialexpovad / expander.xaml
Created April 19, 2023 13:33
Styles of expander WPF
<Style x:Key="ExpanderRightHeaderStyle" TargetType="{x:Type ToggleButton}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Border Padding="{TemplateBinding Padding}">
<Grid Background="Transparent" SnapsToDevicePixels="False">
<Grid.RowDefinitions>
<RowDefinition Height="19"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
@ialexpovad
ialexpovad / analytic_wfm.py
Created May 16, 2023 17:33 — forked from sixtenbe/analytic_wfm.py
Peak detection in Python
#!/usr/bin/python2
# Copyright (C) 2016 Sixten Bergman
# License WTFPL
#
# This program is free software. It comes without any warranty, to the extent
# permitted by applicable law.
# You can redistribute it and/or modify it under the terms of the Do What The
# Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See
@ialexpovad
ialexpovad / K-Means.py
Created May 16, 2023 17:37 — forked from pmsosa/K-Means.py
K-Means Clustering Implementation
##############################################################################################
### K-Means Python Implementation ###
### http://konukoii.com/blog/2017/01/15/5-min-tutorial-k-means-clustering-in-python/ ###
##############################################################################################
import random
import math
#Euclidian Distance between two d-dimensional points
def eucldist(p0,p1):
@ialexpovad
ialexpovad / INSTALL_macOS.md
Created May 24, 2023 16:02 — forked from urbanij/INSTALL_macOS.md
Install and use qwt under macOS

Install and use qwt under macOS*:

After downloading it from here https://sourceforge.net/projects/qwt/:

cd qwt-6.1.5
mkdir build && cd build
qmake ..
make -j4
sudo make install # this command install stuff inside /usr/local/
@ialexpovad
ialexpovad / Timer.h
Last active June 2, 2023 06:28
Implementation of the Timer class in the programming language С++.
#pragma once
#include <stdio.h>
#include <time.h>
void StartTimer(void);
double StopTimer(void);
#include "notify.h"
#include <QPixmapCache>
#include <QApplication>
#include <QDesktopWidget>
#include <QPainter>
#include <QTimer>
Notify::Notify(QWidget* parent) :
QWidget(parent)
@ialexpovad
ialexpovad / .gitignore
Created June 8, 2023 13:29 — forked from xim/.gitignore
autohide-test
*.user
Makefile*
.qmake.stash
release
debug
*.swp
*~
@ialexpovad
ialexpovad / qsettings-xml.hpp
Created June 9, 2023 19:21 — forked from ianmac45/qsettings-xml.hpp
XML Format for QSettings
#pragma once
//TODO include appropriate headers
#include <QtCore/QtCore>
#include <QtXml/QtXml>
bool readSettingsXml(QIODevice &device, QMap<QString, QVariant> &map);
bool writeSettingsXml(QIODevice &device, const QMap<QString, QVariant> &map);
static const QSettings::Format xmlFormat = QSettings::registerFormat("xml", &readSettingsXml, &writeSettingsXml);
static const QString rootName = "config";