Skip to content

Instantly share code, notes, and snippets.

Rem run as administrator
@echo on & @setlocal enableextensions
@echo =========================
@echo Turn off the time service
net stop w32time
@echo ======================================================================
@echo Set the SNTP (Simple Network Time Protocol) source for the time server
w32tm /config /syncfromflags:manual /manualpeerlist:"0.it.pool.ntp.org 1.it.pool.ntp.org 2.it.pool.ntp.org 3.it.pool.ntp.org"
@echo =============================================
@echo ... and then turn on the time service back on
@myd7349
myd7349 / lz76benchmarks.py
Created November 6, 2025 08:09 — forked from pranaysy/lz76benchmarks.py
Comparison of LZ76 complexity implementations
"""
A demo comparison of three different implementations for estimating Lempel-Ziv complexity (1976)
Implementations compared:
- Pure Python version, by Naereen
- Numba (str), as implemented in EntroPy by Raphael Vallat
- Numba, updated for speed, based on numpy integer arrays
Simple comparisons for equality of estimates and performance to address issue:
https://github.com/raphaelvallat/entropy/issues/14
@myd7349
myd7349 / WPFFocusVisualStyleSample.xaml
Created August 20, 2025 08:49 — forked from yoshikazuendo/WPFFocusVisualStyleSample.xaml
【WPF】コントロールのフォーカスのStyleとFocusVisualStyle
<!-- MSDN -->
<!-- https://msdn.microsoft.com/ja-jp/library/bb613567(v=vs.100).aspx -->
<!-- こちらも凄く参考になります。 -->
<!-- http://grabacr.net/archives/464 -->
<!-- フォーカス時の見た目を消す-->
<TextBox Text="aikazuyendo"
FocusVisualStyle="{x:Null}" />
@myd7349
myd7349 / TolerantEnumConverter.cs
Created July 12, 2025 07:35 — forked from gubenkoved/TolerantEnumConverter.cs
Tolerant JSON.NET enum converter
/// <summary>
/// Tolerant Enum converter. Based on code in the StackOverflow post below, but adds EnumMember attribute support.
/// http://stackoverflow.com/questions/22752075/how-can-i-ignore-unknown-enum-values-during-json-deserialization
/// </summary>
public class TolerantEnumConverter : JsonConverter
{
[ThreadStatic]
private static Dictionary<Type, Dictionary<string, object>> _fromValueMap; // string representation to Enum value map
[ThreadStatic]
@myd7349
myd7349 / lz77.c
Created July 10, 2025 08:01 — forked from fogus/lz77.c
/* PROG1.C */
/* Simple Hashing LZ77 Sliding Dictionary Compression Program */
/* By Rich Geldreich, Jr. October, 1993 */
/* Originally compiled with QuickC v2.5 in the small model. */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
/* set this to 1 for a greedy encoder */
% Encoding: UTF-8
@Manual{rlanguage,
title = {R: A Language and Environment for Statistical Computing},
author = {{R Core Team}},
organization = {R Foundation for Statistical Computing},
address = {Vienna, Austria},
year = {2015},
url = {https://www.R-project.org/},
}
@article{schonbrodtbfda,
@myd7349
myd7349 / Python_LRU_Cache_Usage_Guide.md
Created May 22, 2025 07:33 — forked from promto-c/Python_LRU_Cache_Usage_Guide.md
A detailed guide to using Python's functools.lru_cache for efficient function caching. Covers basic usage, cache management, custom cache control, and additional insights for optimal utilization in various development scenarios. Ideal for Python developers looking to enhance performance with caching techniques.

1703673950911

Python lru_cache Usage Guide

Overview

The lru_cache decorator in Python's functools module implements a caching strategy known as Least Recently Used (LRU). This strategy helps in optimizing the performance of functions by memorizing the results of expensive function calls and returning the cached result when the same inputs occur again.

Basic Usage

from functools import lru_cache
@myd7349
myd7349 / freedesktop.org_icons_with_descriptions.txt
Created March 25, 2025 01:04 — forked from peteristhegreat/freedesktop.org_icons_with_descriptions.txt
QIcon::fromTheme, List of icons in gnome theme, in qt standardPixmaps and list on freedesktop.org
# https://specifications.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html, aggregate list from each section
address-book-new The icon used for the action to create a new address book.
application-exit The icon used for exiting an application. Typically this is seen in the application's menus as File->Quit.
appointment-new The icon used for the action to create a new appointment in a calendaring application.
call-start The icon used for initiating or accepting a call. Should be similar to the standard cellular call pickup icon, a green handset with ear and mouth pieces facing upward.
call-stop The icon used for stopping a current call. Should be similar to the standard cellular call hangup icon, a red handset with ear and mouth pieces facing downward.
contact-new The icon used for the action to create a new contact in an address book application.
document-new The icon used for the action to create a new document.
document-open The icon used for the action to open a document.
document-open-recent T
@myd7349
myd7349 / new empty git branch.md
Created February 12, 2025 12:10 — forked from ozh/new empty git branch.md
Create a new empty branch in Git
$ git checkout --orphan NEWBRANCH
$ git rm -rf .

--orphan creates a new branch, but it starts without any commit. After running the above command you are on a new branch "NEWBRANCH", and the first commit you create from this state will start a new history without any ancestry.

You can then start adding files and commit them and they will live in their own branch. If you take a look at the log, you will see that it is isolated from the original log.

@myd7349
myd7349 / EventToCommandBehavior.cs
Created February 6, 2025 03:24 — forked from grimorde/EventToCommandBehavior.cs
Event To Command Behavior
public class EventToCommandBehavior : BindableBehavior<Xamarin.Forms.View>
{
public static BindableProperty CommandProperty =
BindableProperty.CreateAttached(
"Command",
typeof(ICommand),
typeof(EventToCommandBehavior),
null,
BindingMode.OneWay);