Skip to content

Instantly share code, notes, and snippets.

View MartinZikmund's full-sized avatar
⌨️
Coding

Martin Zikmund MartinZikmund

⌨️
Coding
View GitHub Profile
@MartinZikmund
MartinZikmund / MyApp.slnLaunch
Created March 26, 2024 08:34
JSON-based multi-project launch profile
[
{
"Name": "API \u002B Windows App",
"Projects": [
{
"Name": "MyApp\\MyApp.Server\\MyApp.Server.csproj",
"Action": "Start",
"DebugTarget": "MyApp.Server"
},
{
private DispatcherQueueTimer _timer;
private TextBlock _countdown;
public MainPage()
{
this
.Background(new ImageBrush().ImageSource("ms-appx:///ChristmasC/Assets/Background.jpg")
.Stretch(Stretch.UniformToFill))
.Content(_countdown = new TextBlock()
.FontSize(48)
using Microsoft.UI.Text;
using Microsoft.UI.Xaml.Media.Imaging;
namespace ChristmasCountdown;
public sealed partial class MainPage : Page
{
private DispatcherTimer _timer = new();
private TextBlock _countdownText;
var map = ResourceManager.Current.AllResourceMaps["Microsoft.WindowsAppRuntime.1.3"];
var keys = new List<string>();
foreach (var item in map)
{
if (item.Key.Contains("TextCommandLabelCopy"))
{
}
Yes, you're on the right track with your proposed circuit design. You'll want to implement a high-pass filter in your conditioning/amplifier circuit to isolate the knock frequency of interest (around 7.6 kHz). This will help eliminate unwanted low-frequency noise that could falsely trigger your knock control system.
Here's an outline of your circuit with the high-pass filter included:
Input protection: Use a TVS diode with a breakdown voltage slightly above the max voltage to protect against voltage spikes.
High-pass filter: Implement a high-pass filter to isolate the knock frequency (around 7.6 kHz). This can be done using a passive RC filter or an active filter with an operational amplifier (op-amp). The choice will depend on your requirements and available components.
Rectifier stage: Use a full-bridge rectifier to convert both positive and negative AC voltage signals into a positive DC voltage.
Amplification stage: Use a non-inverting amplifier with an op-amp to amplify the filtered and rectified signal
To create an Ansible playbook that installs MySQL 5.7 on Ubuntu 22.04 Live Server, follow these steps:
Install Ansible on your control machine.
Create an inventory file (e.g., hosts.ini) that lists the target server(s). Replace the server_ip and ansible_user with the appropriate values for your target server:
csharp
Copy code
[mysql_servers]
server_ip ansible_user=your_user
./ChristmasTree.exe 7
csc ChristmasTree.cs
@MartinZikmund
MartinZikmund / Program.cs
Created December 23, 2022 22:51
Christmas Tree Generator
namespace ChristmasTree;
static class Program
{
static void Main(string[] args)
{
// Get the width of the tree from the first command line argument
int width = int.Parse(args[0]);
// Make sure the width is odd
{
"profiles": {
"MyUnoApp.Server": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "https://localhost:51042;http://localhost:51043",
"devTunnelEnabled": true,