[{"categories":null,"collections":null,"content":" Anyone who uses white noise or environmental sound apps to sleep, study, or focus is familiar with the primary drawback: battery consumption. Leaving heavy MP3 or FLAC audio files looping all night drains your battery, heats up your device, and degrades long-term battery health. From this frustration arose the idea for NoxNoise: Procedural Sleep, a completely free iOS app that reimagines how we interact with relaxing sounds. Instead of playing heavy, pre-recorded audio loops, NoxNoise synthesizes sound in real-time right on the device using pure mathematics. In this post, we\u0026rsquo;ll explore how the app was born and dive into the technical architecture and design behind its zero-drain procedural audio engine. How It Was Born The inspiration for NoxNoise came from a common nuisance: an iPhone heating up on the nightstand overnight. Traditional relaxation apps load long audio files into memory and decode them continuously, keeping the CPU, storage controller, and sometimes network interface active. The concept behind NoxNoise is simple yet powerful: generate noise from mathematical equations, eliminating the need for physical files. Instead of reading gigabytes of audio data from disk or streaming them over the web, NoxNoise generates small audio buffers (of just 2.0 seconds) and hands them over to the hardware controller to loop seamlessly with near-zero energy consumption. The result? An incredibly lightweight app (only 15 MB on the App Store) that runs offline, protects your privacy 100%, and preserves your battery. Technical Architecture \u0026amp; Design The app is written entirely in Swift and SwiftUI and is structured around three key pillars: the AVAudioEngine-based audio synthesis engine, the CoreHaptics somatic biofeedback system, and local Apple Intelligence integration. 1. The Procedural Audio Engine At the core of NoxNoise is the NoxEngine class, which coordinates a complex audio graph using Apple\u0026rsquo;s AVAudioEngine framework. The signal chain is designed as follows: Diagram Code graph LR SubPlayers[Player Nodes White/Brown/Rain...] --\u003e EnvNode[AVAudioMixerNode] EnvNode --\u003e EQNode[AVAudioUnitEQ Low-Pass] EQNode --\u003e ReverbNode[AVAudioUnitReverb] ReverbNode --\u003e PitchNode[AVAudioUnitVarispeed] PitchNode --\u003e MainMixer[Main Mixer Node] graph LR SubPlayers[Player Nodes White/Brown/Rain...] --\u003e EnvNode[AVAudioMixerNode] EnvNode --\u003e EQNode[AVAudioUnitEQ Low-Pass] EQNode --\u003e ReverbNode[AVAudioUnitReverb] ReverbNode --\u003e PitchNode[AVAudioUnitVarispeed] PitchNode --\u003e MainMixer[Main Mixer Node] graph LR SubPlayers[Player Nodes White/Brown/Rain...] --\u003e EnvNode[AVAudioMixerNode] EnvNode --\u003e EQNode[AVAudioUnitEQ Low-Pass] EQNode --\u003e ReverbNode[AVAudioUnitReverb] ReverbNode --\u003e PitchNode[AVAudioUnitVarispeed] PitchNode --\u003e MainMixer[Main Mixer Node] graph LR SubPlayers[Player Nodes White/Brown/Rain...] --\u0026gt; EnvNode[AVAudioMixerNode] EnvNode --\u0026gt; EQNode[AVAudioUnitEQ Low-Pass] EQNode --\u0026gt; ReverbNode[AVAudioUnitReverb] ReverbNode --\u0026gt; PitchNode[AVAudioUnitVarispeed] PitchNode --\u0026gt; MainMixer[Main Mixer Node] To achieve optimal, battery-saving performance, the engine employs several strategies: Dynamic Hardware Sample Rate Alignment: The engine query\u0026rsquo;s the hardware\u0026rsquo;s active sample rate (such as 48,000 Hz) to allocate buffers. This completely eliminates CPU-intensive resampling operations. Selective Mono/Stereo Synthesis: Spatial sounds like rain or wind are generated in Stereo, while localized sounds like the hair dryer (hairDryer), airplane cabin (airplanePlayer), and wave flutter (flutterPlayer) are synthesized in Mono to cut the required synthesis computation in half. Pure Mathematical Generators: White Noise is computed using a pure random number generator (Float.random(in: -1.0...1.0)). Brown Noise (warmer and deeper) is synthesized by applying a custom integration filter: let out = (lastOut + Double(white) * 0.02) / 1.02 Sounds like the airplane cabin drone or wind sweeps use slow Low-Frequency Oscillators (LF","date":"2026-08-23","heading":"","objectID":"/posts/noxnoise-procedural-sleep-en/:0:0","tags":["iOS","swift","app","side-project","audio","math"],"title":"NoxNoise: Procedural Sleep — Beating Battery Drain with Real-Time Audio Synthesis","uri":"/posts/noxnoise-procedural-sleep-en/#"},{"categories":null,"collections":null,"content":" Chiunque utilizzi app di rumore bianco o suoni ambientali per dormire, studiare o concentrarsi conosce bene il problema principale: la batteria. Lasciare in riproduzione file audio MP3 o FLAC in loop per tutta la notte consuma energia in modo spropositato, surriscalda il dispositivo e degrada la salute della batteria a lungo termine. Da questo problema è nata l\u0026rsquo;idea di NoxNoise: Procedural Sleep, un\u0026rsquo;applicazione iOS totalmente gratuita che reinventa il modo in cui interagiamo con i suoni rilassanti. Invece di riprodurre pesanti file audio pre-registrati, NoxNoise sintetizza il suono in tempo reale direttamente sul dispositivo utilizzando pura matematica. In questo post analizzeremo come è nata l\u0026rsquo;applicazione e l\u0026rsquo;architettura tecnica e di design dietro il suo motore audio procedurale a consumo zero. Come è nata l\u0026rsquo;idea L\u0026rsquo;ispirazione per NoxNoise è nata da una frustrazione comune: il surriscaldamento dell\u0026rsquo;iPhone sul comodino durante la notte. Le classiche app di rilassamento caricano in memoria lunghe registrazioni e le decodificano continuamente, tenendo attivi la CPU e i chip di rete o di storage. L\u0026rsquo;idea alla base di NoxNoise è tanto semplice quanto potente: generare il rumore partendo da equazioni matematiche, eliminando la necessità di file fisici. Invece di leggere gigabyte di dati audio dal disco o scaricarli in streaming, NoxNoise genera piccoli buffer audio (di appena 2.0 secondi) e lascia che sia il controller hardware ad eseguire il loop a consumo zero. Il risultato? Un\u0026rsquo;app incredibilmente leggera (solo 15 MB su App Store) che non richiede rete, protegge la privacy al 100% e preserva la durata della batteria. Architettura e Design Tecnico L\u0026rsquo;applicazione è interamente scritta in Swift e SwiftUI ed è strutturata attorno a tre pilastri fondamentali: il motore audio basato su AVAudioEngine, il sistema aptico di biofeedback e l\u0026rsquo;integrazione locale con l\u0026rsquo;Intelligenza Artificiale di Apple. 1. Il Motore Audio Procedurale Il cuore di NoxNoise è la classe NoxEngine, che coordina un grafo audio complesso basato sul framework AVAudioEngine di Apple. La catena del segnale è così strutturata: Diagram Code graph LR SubPlayers[Player Nodes White/Brown/Rain...] --\u003e EnvNode[AVAudioMixerNode] EnvNode --\u003e EQNode[AVAudioUnitEQ Low-Pass] EQNode --\u003e ReverbNode[AVAudioUnitReverb] ReverbNode --\u003e PitchNode[AVAudioUnitVarispeed] PitchNode --\u003e MainMixer[Main Mixer Node] graph LR SubPlayers[Player Nodes White/Brown/Rain...] --\u003e EnvNode[AVAudioMixerNode] EnvNode --\u003e EQNode[AVAudioUnitEQ Low-Pass] EQNode --\u003e ReverbNode[AVAudioUnitReverb] ReverbNode --\u003e PitchNode[AVAudioUnitVarispeed] PitchNode --\u003e MainMixer[Main Mixer Node] graph LR SubPlayers[Player Nodes White/Brown/Rain...] --\u003e EnvNode[AVAudioMixerNode] EnvNode --\u003e EQNode[AVAudioUnitEQ Low-Pass] EQNode --\u003e ReverbNode[AVAudioUnitReverb] ReverbNode --\u003e PitchNode[AVAudioUnitVarispeed] PitchNode --\u003e MainMixer[Main Mixer Node] graph LR SubPlayers[Player Nodes White/Brown/Rain...] --\u0026gt; EnvNode[AVAudioMixerNode] EnvNode --\u0026gt; EQNode[AVAudioUnitEQ Low-Pass] EQNode --\u0026gt; ReverbNode[AVAudioUnitReverb] ReverbNode --\u0026gt; PitchNode[AVAudioUnitVarispeed] PitchNode --\u0026gt; MainMixer[Main Mixer Node] Per ottenere prestazioni ottimali a consumo energetico ridotto, il motore adotta diverse strategie: Allineamento dinamico alla Sample Rate hardware: Il motore intercetta la frequenza del dispositivo (ad esempio 48.000 Hz) per calcolare i buffer. Questo evita qualsiasi operazione di ricampionamento (resampling) da parte della CPU. Sintesi Mono/Stereo selettiva: Suoni spaziali come la pioggia o il vento vengono generati in Stereo, mentre sorgenti localizzate come l\u0026rsquo;asciugacapelli (hairDryer), la cabina dell\u0026rsquo;aereo (airplanePlayer) e il battito d\u0026rsquo;ali (flutterPlayer) vengono sintetizzati in Mono per dimezzare le risorse di calcolo richieste. Generatori Matematici Puri: Il Rumore Bianco viene calcolato tramite un generatore casual","date":"2026-08-23","heading":"","objectID":"/posts/noxnoise-procedural-sleep/:0:0","tags":["iOS","swift","app","side-project","audio","math"],"title":"NoxNoise: Procedural Sleep — Sconfiggere il consumo di batteria con la sintesi audio procedurale","uri":"/posts/noxnoise-procedural-sleep/#"},{"categories":null,"collections":null,"content":" Il problema che tutti abbiamo Alzi la mano chi non ha mai perso un foglietto illustrativo. Magari serviva proprio in quel momento — per controllare una posologia, verificare un\u0026rsquo;interazione o semplicemente capire a cosa servisse quel medicinale dimenticato nell\u0026rsquo;armadietto. Da questa frustrazione quotidiana è nato InfoFarmaco: un\u0026rsquo;app iOS e un portale web per consultare i dati dei farmaci in pochi secondi, ovunque tu sia. Cosa fa InfoFarmaco InfoFarmaco ti permette di cercare qualsiasi medicinale commercializzato in Italia e consultarne: Foglietto illustrativo completo — indicazioni, posologia, controindicazioni, effetti indesiderati Principi attivi e classe terapeutica Prezzo e detraibilità fiscale Immagine della confezione per un riconoscimento immediato Ma non si ferma ai soli farmaci: la versione Pro include anche la ricerca di farmaci veterinari 🐾 e parafarmaci 🩹, coprendo un ventaglio molto più ampio di prodotti. Le due versioni 🆓 InfoFarmaco Free Tutto ciò che serve per una consultazione rapida: 🔍 Ricerca medicinali — cerca per nome commerciale e ottieni risultati istantanei 📋 Dettagli completi — foglietto illustrativo strutturato in sezioni navigabili 🕐 Cronologia ricerche — ritrova velocemente i farmaci già consultati 💊 Immagine e prezzo — identifica il farmaco a colpo d\u0026rsquo;occhio ⭐ InfoFarmacoPro Tutto quello della versione Free, più funzionalità avanzate pensate per chi vuole il massimo: 📷 Scansione barcode — inquadra il codice a barre della confezione e ottieni subito le informazioni ⭐ Preferiti — salva i farmaci che consulti più spesso per accedervi con un tap 🐾 Farmaci veterinari — cerca medicinali per i tuoi amici a quattro zampe 🩹 Parafarmaci — consulta informazioni su integratori e prodotti da banco 🔬 Ricerca principi attivi — cerca direttamente per principio attivo 💊 Database completo — accesso al database farmaci esteso ☁️ Sync iCloud — i tuoi preferiti e la cronologia sincronizzati su tutti i dispositivi 🤖 Analisi AI — chiedi all\u0026rsquo;intelligenza artificiale spiegazioni e approfondimenti su un medicinale Il portale web Non hai un iPhone? Nessun problema. Ho sviluppato anche una web app accessibile da qualsiasi browser, con le stesse funzionalità di ricerca della versione Free — inclusa la possibilità di cercare farmaci, farmaci veterinari e parafarmaci. La trovi qui: infofarmaco.salvatorecattano.it/s Lo stack tecnico Per chi fosse curioso del dietro le quinte: Componente Tecnologia App iOS Swift, SwiftUI, SwiftData Backend API ASP.NET Core Web App React Landing Page React + Framer Motion Sync iCloud / CloudKit Scarica l\u0026rsquo;app Scarica Free ⭐ Scarica Pro Oppure visita la pagina ufficiale per maggiori dettagli e screenshot. Feedback e idee InfoFarmaco è un progetto in continua evoluzione. Se hai suggerimenti, hai trovato un bug o semplicemente vuoi farmi sapere cosa ne pensi, scrivimi — il feedback degli utenti è il carburante migliore per migliorare il prodotto. 🚀 ","date":"2025-09-23","heading":"","objectID":"/posts/info-farmaco-app/:0:0","tags":["iOS","swift","app","side-project"],"title":"InfoFarmaco — Il foglietto illustrativo, sempre in tasca","uri":"/posts/info-farmaco-app/#"},{"categories":null,"collections":null,"content":"Introduction Optimizing SQL Server Views: The Battle Against Subqueries, Casts, and IN Working with SQL Server views can sometimes feel like cleaning up after a tornado—especially when you stumble upon excessive subqueries,and poorly optimized filters. Today, I took on the challenge of refactoring some views, and here’s what I learned! 🚀 1. Killing the Subquery Overload ⚔️ Subqueries might seem like a convenient way to fetch data, but when overused, they turn into performance nightmares. In my case, there were way too many subqueries lurking in the views, slowing things down like a traffic jam during rush hour. Solution: Convert Subqueries to JOINs I transformed these unnecessary subqueries into proper LEFT JOINs. Why? Because JOINs allow SQL Server to optimize query execution better, reducing the number of times data is reprocessed. Example: -- Before (Bad Subquery 🛑) SELECT u.id, (SELECT d.name FROM departments d WHERE d.id = u.dept_id) AS department_name FROM users u; -- After (LEFT JOIN to the Rescue! ✅) SELECT u.id, d.name AS department_name FROM users u LEFT JOIN departments d ON u.dept_id = d.id;2. Escaping the VARCHAR(MAX) Trap 😱 Some fields were being cast to VARCHAR(MAX) for no apparent reason. While VARCHAR(MAX) has its use cases, using it everywhere is like carrying a suitcase full of bricks when all you need is a backpack. 🎒 Solution: Use NVARCHAR with Proper Length Since we work with NVARCHAR (yay for Unicode support 🎉), I replaced VARCHAR(MAX) casts with NVARCHAR(n), where n is the actual required length. Example: -- Before (Unnecessary MAX usage 🛑) CAST(some_column AS VARCHAR(MAX)) -- After (Optimized for size ✅) CAST(some_column AS NVARCHAR(100))This avoids unnecessary memory allocation and improves indexing efficiency. 3. Fixing String Comparisons with Proper Unicode Prefix 🧐 Another issue I found was string comparisons without the N prefix, which can cause implicit conversions and slow down queries. Solution: Use N for NVARCHAR Comparisons If you\u0026rsquo;re working with NVARCHAR columns, make sure to prefix string literals with N. This tells SQL Server to treat them as Unicode and avoids implicit conversions. Example: -- Before (Potential Implicit Conversion 🛑) WHERE CodDivision = \u0026#39;DIV\u0026#39; -- After (Proper NVARCHAR Handling ✅) WHERE CodDivision = N\u0026#39;DIV\u0026#39;This tiny change helps SQL Server use indexes efficiently and improves query performance. 🎯 4. Avoiding the IN Operator Whenever Possible 🚫 Using IN can sometimes be convenient, but it\u0026rsquo;s not always the best choice for performance, especially when dealing with large datasets. Solution: Replace IN with EXISTS or JOIN If possible, I replaced IN conditions with EXISTS or JOINs, which allow SQL Server to handle filtering more efficiently. Example: -- Before (Potentially Slow 🛑) SELECT * FROM users WHERE id IN (SELECT user_id FROM orders); -- After (Better Performance ✅) SELECT u.* FROM users u WHERE EXISTS (SELECT 1 FROM orders o WHERE o.user_id = u.id);This reduces the overhead of scanning multiple values and improves execution speed. Conclusion 🎉 Cleaning up SQL views can be tedious, but applying these optimizations made a noticeable difference in performance! By eliminating unnecessary subqueries, refining data types, fixing string comparisons, and avoiding IN, queries now run much more smoothly. 😎 Have you ever encountered similar SQL nightmares Share your experience in the comments! 🚀 ","date":"2025-03-12","heading":"","objectID":"/coding/slq-optimization-refactoring/:0:0","tags":["Tips\u0026Trick","SQL","Optimization"],"title":"Optimizing SQL Server Views","uri":"/coding/slq-optimization-refactoring/#"},{"categories":null,"collections":null,"content":"Introduction Optimizing SQL queries is crucial for improving database performance and reducing application response times. In this article, we will explore techniques to make queries more efficient, with practical examples and detailed explanations. 1. Use Indexes Indexes speed up search and filtering operations by reducing the number of rows to scan. However, they should be used wisely because too many indexes can slow down write operations (INSERT, UPDATE, DELETE). Example: Creating an index on a frequently filtered column CREATE INDEX idx_name ON users(name);If surname searches are common: SELECT * FROM users WHERE surname = \u0026#39;Smith\u0026#39;;An index on surname will significantly improve performance: CREATE INDEX idx_surname ON users(surname);1.1 Composite Indexes If multiple columns are frequently used together in filters: CREATE INDEX idx_surname_name ON users(surname, name);This index will be useful for queries like: SELECT * FROM users WHERE surname = \u0026#39;Smith\u0026#39; AND name = \u0026#39;John\u0026#39;;2. Avoid SELECT * Fetching only the required columns reduces database load and speeds up queries by avoiding unnecessary data transfer. Example: Avoid selecting all columns -- Inefficient SELECT * FROM users WHERE active = 1; -- Better SELECT name, surname FROM users WHERE active = 1;3. Optimize JOINs JOIN operations can be costly if not optimized properly. Ensure that the columns used in JOIN conditions are indexed and that compatible data types are used. Example: Optimizing a JOIN -- Users table CREATE INDEX idx_user_id ON users(id); -- Orders table CREATE INDEX idx_user_id_orders ON orders(user_id); -- Optimized query SELECT u.name, o.total FROM users u JOIN orders o ON u.id = o.user_id WHERE u.active = 1;Tip: Avoid unnecessary JOINs and prefer well-defined relationships. 4. Avoid Functions on Columns in WHERE Using functions on columns in the WHERE clause prevents indexes from being used, making the query significantly slower. Example: Avoid functions in WHERE -- Inefficient SELECT * FROM users WHERE YEAR(birth_date) = 1990; -- Better SELECT * FROM users WHERE birth_date BETWEEN \u0026#39;1990-01-01\u0026#39; AND \u0026#39;1990-12-31\u0026#39;;In the first version, the function YEAR(birth_date) is applied to every row, making any index on birth_date useless. 5. Use Paginated Queries When handling large amounts of data, limiting the number of returned rows improves performance. Example: Using LIMIT and OFFSET SELECT * FROM users ORDER BY id LIMIT 50 OFFSET 100;If possible, use a cursor-based approach or WHERE for more efficient pagination: SELECT * FROM users WHERE id \u0026gt; 100 ORDER BY id LIMIT 50;6. Normalization and Denormalization 6.1Normalization Reduces data redundancy by splitting data into smaller tables with relationships. Example: Storing user addresses in a separate table instead of repeating them in the users table. 6.2Denormalization Useful when a query performs too many JOINs across different tables. Example: Storing the total number of orders directly in the users table instead of calculating it every time with a JOIN. 7. Monitor and Optimize with EXPLAIN EXPLAIN helps understand the execution plan of a query and identify performance bottlenecks. Example: Using EXPLAIN EXPLAIN SELECT * FROM users WHERE active = 1;The result shows which indexes are being used, the number of rows scanned, and other useful information for optimizing the query. Conclusion SQL query optimization is an ongoing process that requires testing and analysis. By applying these techniques and regularly monitoring performance, you can significantly enhance the efficiency of database-driven applications. Have you ever encountered performance issues with your SQL queries? Share your experience in the comments! ","date":"2025-03-10","heading":"","objectID":"/coding/slq-optimization/:0:0","tags":["Tips\u0026Trick","SQL","Optimization"],"title":"SQL Query Optimization: Tips and Tricks","uri":"/coding/slq-optimization/#"},{"categories":null,"collections":null,"content":"Introduction to MemoryCache in C# MemoryCache is a fundamental component for caching management in C#. It resides in the System.Runtime.Caching library and is used to temporarily store data in memory to improve application performance, reducing the time it takes to access data compared to retrieval from a slower data source such as a database or network call. What is MemoryCache? MemoryCache provides an in-memory caching implementation that allows developers to store data in the application process memory. This is particularly useful for applications needing quick access to frequently used data. The cache can be configured to store data for a certain period of time or until a certain maximum capacity is reached. Using MemoryCache Below is a simple example of how to use MemoryCache to store and retrieve data in memory: using System; using System.Runtime.Caching; class Program { static void Main(string[] args) { // Creating a MemoryCache object MemoryCache cache = MemoryCache.Default; // Adding an item to the cache with a key and value cache.Add(\u0026#34;myKey\u0026#34;, \u0026#34;Hello, World!\u0026#34;, DateTimeOffset.UtcNow.AddMinutes(10)); // Retrieving the item from the cache string cachedValue = cache.Get(\u0026#34;myKey\u0026#34;) as string; Console.WriteLine(cachedValue); // Output: Hello, World! } }In this example, we\u0026rsquo;ve created a default MemoryCache object and added a value to the cache with a key \u0026ldquo;myKey\u0026rdquo; that will expire after 10 minutes. Advanced Cache Management In addition to adding and retrieving items from the cache, MemoryCache offers advanced features for cache management such as defining custom expiration policies for cache items. Below is a more complex example where we prevent a cache entry from expiring if it meets certain requirements: using System.Collections.Generic; using System.Linq; using System.Runtime.Caching; namespace Sandbox.ServerCacheManager { /// \u0026lt;inheritdoc cref=\u0026#34;ICacheManager\u0026#34;/\u0026gt; public sealed class CacheManager : ICacheManager { // CacheManager as Singleton private static CacheManager _instance; private readonly MemoryCache _memoryCache; private const int ExpirationTimeInMinutes = 60; #region Ctor /// \u0026lt;summary\u0026gt; /// Ctor of \u0026lt;see cref=\u0026#34;CacheManager\u0026#34;/\u0026gt;. /// \u0026lt;/summary\u0026gt; private CacheManager() : this(new MemoryCache(\u0026#34;CacheManagerTest\u0026#34;)) { } /// \u0026lt;summary\u0026gt; /// Ctor of \u0026lt;see cref=\u0026#34;CacheManager\u0026#34;/\u0026gt;. /// \u0026lt;/summary\u0026gt; /// \u0026lt;param name=\u0026#34;memoryCache\u0026#34;\u0026gt;An instance of \u0026lt;see cref=\u0026#34;MemoryCache\u0026#34;/\u0026gt;.\u0026lt;/param\u0026gt; internal CacheManager(MemoryCache memoryCache) { _memoryCache = memoryCache; } /// \u0026lt;inheritdoc cref=\u0026#34;ICacheManager.GetInstance()\u0026#34; /\u0026gt; public static CacheManager GetInstance() { if (_instance != null) return _instance; _instance = new(); return _instance; } #endregion /// \u0026lt;inheritdoc cref=\u0026#34;CacheManager.SetCache(string, List{string})\u0026#34; /\u0026gt; public void SetCache(string key, string objectToCache) { _memoryCache.Set(key, objectToCache, CreateCacheItemPolicy()); } /// \u0026lt;inheritdoc cref=\u0026#34;CacheManager.GetCache(string)\u0026#34; /\u0026gt; public string GetCache(string key) { return _memoryCache.Get(key) as string; } private void CheckExpirationAndValidity(CacheEntryUpdateArguments arguments) { var refreshedData = GetCache(arguments.Key); if (refreshedData.StartsWith(\u0026#34;Hello\u0026#34;)) { arguments.UpdatedCacheItem = new CacheItem(arguments.Key, refreshedData); arguments.UpdatedCacheItemPolicy = CreateCacheItemPolicy(); } } private CacheItemPolicy CreateCacheItemPolicy() { return new CacheItemPolicy() { AbsoluteExpiration = DateTimeOffset.UtcNow.AddMinutes(ExpirationTimeInMinutes), UpdateCallback = CheckExpirationAndValidity }; } } }In this example, we added an item to the cache with a 10-minute expiration policy. Then, we checked if the cached item starts with \u0026ldquo;Hello\u0026rdquo;, and if so, we extended the cache duration to one hour. Class Explanation This C# code defines a class called CacheManager within th","date":"2024-02-23","heading":"","objectID":"/coding/memory-cache-csharp/:0:0","tags":["How-to","csharp"],"title":"How-To: MemoryCache in CSharp","uri":"/coding/memory-cache-csharp/#"},{"categories":null,"collections":null,"content":"Review Recently, while browsing through a vast array of streaming movie posters, I was drawn to \u0026ldquo;First Man\u0026rdquo;, largely due to the presence of acclaimed actor Ryan Gosling as the lead. The film offers a gripping look into the life of Neil Armstrong, from his early involvement in NASA\u0026rsquo;s Gemini program to the historic moon landing. You might think, \u0026ldquo;Well, nothing new, seen it all before.\u0026rdquo; Well, I admit I had the same initial doubts. However, \u0026ldquo;First Man\u0026rdquo; managed to surprise me. The compelling narrative reveals the human side of Neil Armstrong and outlines the path that led to the Apollo program, exploring both the triumphs and failures of NASA. One curiosity that struck me was the revelation that all Apollo module docking tests took place in space, a detail I was completely unaware of. One scene, in particular, had me on the edge of my seat, conveying a palpable sense of tension and anxiety. It\u0026rsquo;s hard not to be struck by the extraordinary courage of those men, aware of the mortal risks they faced but determined to push forward nonetheless. Without giving too much away, I can only say that the moon landing scenes are absolutely breathtaking, with stunning cinematography that captures the essence of the lunar environment. In that moment, I found myself deeply envious of Neil and Buzz. The film also touches on more intimate emotional chords, adding a touch of romance that may bring a tear to the eye of sensitive viewers. Why was Neil Armstrong the first to descend? It\u0026rsquo;s a question that the film answers compellingly. Ultimately, \u0026ldquo;First Man\u0026rdquo; is an unmissable cinematic experience that I highly recommend seeing. ","date":"2024-02-22","heading":"","objectID":"/posts/first-man-review/:0:0","tags":["review"],"title":"Review: First Man - An Unforgettable Cinematic Journey","uri":"/posts/first-man-review/#"},{"categories":null,"collections":null,"content":"Intro Recently, I found myself on an unexpected journey - the reimaging of my work notebook. This was not a decision I made voluntarily, but rather a task assigned by my company due to a domain change. I was part of a team that offered up their notebooks for the reimage process, and it was quite an adventure. The Fresh Start The process began with formatting my computer, which gave me that sense of rejuvenation as if I had a brand-new PC. However, with this digital clean slate came the arduous task of reinstalling and reconfiguring everything, from basic software to my web development environment. The Temptation to Change As I was setting up my development environment, I couldn\u0026rsquo;t resist the temptation to give my website a fresh look. It had been sporting the \u0026ldquo;Hermit\u0026rdquo; theme for a while, and I had been eyeing the \u0026ldquo;LoveIt\u0026rdquo; theme for some time now. So, I decided to take the plunge and make the change. The Mysterious Error With the \u0026ldquo;LoveIt\u0026rdquo; theme ready to go, I fired up my local server to see the results. To my dismay, an error message greeted me: Error \u0026ldquo;Can’t evaluate field ContentDir in type langs.Language.\u0026rdquo; It was a cryptic error that sent me into a mild state of panic. Self-Discovery and Solution After some frantic searching and head-scratching, I turned to the most reliable source of all - the manual of the LoveIt theme itself. As I revisited the installation instructions, I stumbled upon the solution. It turns out that both \u0026ldquo;Hermit\u0026rdquo; and \u0026ldquo;LoveIt\u0026rdquo; themes used Dart Sass, and I had forgotten to set it up after the fresh install. Here below the instructions to install Dart Sass: OS Package manager Site Installation MacOS Homebrew brew.sh brew install sass/sass/sass Windows Homebrew brew.sh brew install sass/sass/sass Windows Chocolatey chocolatey.org choco install sass Linux Homebrew brew.sh brew install sass/sass/sass MacOS Snap snapcraft.io sudo snap install dart-sass ","date":"2023-10-09","heading":"","objectID":"/coding/hugo-error-langs.language/:0:0","tags":["Hugo","Issues"],"title":"Hugo Error - Can’t evaluate field ContentDir in type *langs.Language","uri":"/coding/hugo-error-langs.language/#"},{"categories":null,"collections":null,"content":"Introduction Sometimes, life throws unexpected curveballs at us. In my case, I recently found myself facing a seemingly simple yet incredibly frustrating dilemma: how to convert image files from one format to another? You might think there are already many online tools for this, but when privacy is at stake, the situation changes. The Problem It all began when I was asked to provide some photos for an online photo printing service. The problem? My photos were in a format that wasn\u0026rsquo;t compatible with the web service. While searching for solutions, I came across several web applications that promised to do the conversion. But there was a catch: I had personal photos that I didn\u0026rsquo;t want to send to a remote server, even with promises of security. The new adventure That\u0026rsquo;s where my adventure began. I decided to create a customized solution for image conversion, ensuring maximum privacy and control. And that\u0026rsquo;s how my new project was born: a standalone application that can be used directly from the command prompt, without having to upload your photos to a remote server. My goal was to create a free and open-source application, accessible to all, so that anyone in need of image file conversion could do so easily and securely. The Project The project is hosted on GitHub, where it\u0026rsquo;s available for download and free use. You\u0026rsquo;ll find everything you need in my repositories, along with detailed instructions on getting started. Here\u0026rsquo;s a sneak peek of how it works: Download and Install: To use the application, you need to download it from my GitHub repository. It\u0026rsquo;s compatible with Windows (works also with macOS using VS). Launch the Command Prompt: After, start the command prompt and type the command to launch the application. You\u0026rsquo;ll be greeted with an intuitive command-line interface. Use \u0026ndash;help to have all the options. Choose Files to Convert: Select the image files you want to convert and specify the target format. The application supports a wide range of formats, so you have plenty of options to choose from. Execute the Conversion: Once you\u0026rsquo;ve configured your conversion options, press Enter, and the application will take care of the rest. In just moments, you\u0026rsquo;ll have your image files converted to the desired format. Privacy First: The application operates completely offline, which means your photos stay safe on your computer. There\u0026rsquo;s no need to upload anything to remote servers or worry about the security of your data. Contribute ! Hey guys\u0026hellip; the project is open source, which means you\u0026rsquo;re invited to contribute and customize the application to fit your needs. If you\u0026rsquo;re familiar with programming, you can make improvements or extend its functionality. Last I hope this application can be helpful to you and many others who find themselves in the same situation. My mission is to ensure that image file conversion is accessible to everyone without compromising privacy. So, if you\u0026rsquo;ve ever needed to convert those personal photos or know someone who does, check out my project on GitHub. I\u0026rsquo;d love to hear your feedback, and if you wish, your collaboration to make this resource even better. Goodbye ! Remember, the next time you need to convert those personal photos, you have a secure and free solution at your fingertips. Happy converting! ","date":"2023-09-20","heading":"","objectID":"/posts/image-converter/:0:0","tags":["MyProject"],"title":"From Images to Images: My New Image Conversion Project","uri":"/posts/image-converter/#"},{"categories":null,"collections":null,"content":"Introduction For markdown texts, we need to specify the languages for corresponding syntax highlighting. Following is an example for highlighting c++ codes in markdown texts: ```cpp bool getBit(int num, int i) { return ((num \u0026amp; (1\u0026lt;\u0026lt;i)) != 0); }```Which becomes: bool getBit(int num, int i) { return ((num \u0026amp; (1\u0026lt;\u0026lt;i)) != 0); }More settigns Please, follow this repo on GitHub ","date":"2023-09-04","heading":"","objectID":"/coding/markdown-supported-languages/:0:0","tags":["Languages","Markdown"],"title":"Markdown Supported Languages","uri":"/coding/markdown-supported-languages/#"},{"categories":null,"collections":null,"content":"Introduction I often have to import solutions into the main project. Usually, each solution may use different versions of some components or, sometimes, new libraries. I have seen that a common practice is to run the Update-Manager on the whole project when, for example, it would be enough to run it only for the solution concerned. Here are some of the commands to use in certain situations. List of (some) parameters Param Description -ProjectName Specifies the name of the project in which packages should be updated. -Safe If set, NuGet will only update to a new version that has the same major and minor versions as the previous package. For example, if the old version is 1.1.0, NuGet will accept the update package with version of 1.1.1 or 1.1.9999 but it will not accept 1.2.0. -Version Specifies the new target version of the package as a result of the update. -Reinstall If set, NuGet will uninstall and reinstall the packages to the same version. Examples Update a particular package in a project to the latest version: Update-Package jQuery -ProjectName MyProjectUpdate a particular package in a project to the latest version, using safe update rule: Update-Package jQuery -ProjectName MyProject -SafeUpdate a particular package in a project to a particular version: Update-Package jQuery -ProjectName MyProject -Version 1.8Update a particular package in all projects of the current solution to the latest version: Update-Package jQueryUpdate a particular package in all projects of the current solution to a particular version: Update-Package jQuery -version 1.8Reinstall a particular package in all projects of the current solution: Update-Package jQuery -reinstallUpdate all packages in a project to the latest versions: Update-Package -ProjectName MyProjectReinstall all packages in a project: Update-Package -ProjectName MyProject -ReinstallUpdate all packages in all projects of the current solution to the latest versions: Update-PackageReinstall all packages in all projects of the current solution: Update-Package -Reinstall","date":"2023-09-04","heading":"","objectID":"/coding/nuget-updatepackage-commands/:0:0","tags":["Scripts","GIT","Tips\u0026Trick"],"title":"NuGet ~ UpdatePackage Commands","uri":"/coding/nuget-updatepackage-commands/#"},{"categories":null,"collections":null,"content":"Intro Use StringBuilder for String Manipulation: When you need to concatenate or modify strings in a loop or a frequently executed code block, using the StringBuilder class instead of directly manipulating strings can significantly improve performance. Strings in C# are immutable, which means that each time a modification is made, a new string object is created in memory, leading to unnecessary memory allocations and performance overhead. StringBuilder provides a mutable string buffer that efficiently handles string modifications. How To To use StringBuilder, follow these steps: Initialize a new instance of StringBuilder: StringBuilder sb = new StringBuilder(); Perform string manipulations using the Append() method: sb.Append(\u0026#34;Hello\u0026#34;); sb.Append(\u0026#34; \u0026#34;); sb.Append(\u0026#34;World!\u0026#34;); Retrieve the final string using the ToString() method: string result = sb.ToString(); Clarifications By using StringBuilder instead of direct string concatenation, you can avoid unnecessary memory allocations and improve the performance of string manipulations, especially in scenarios where large amounts of string concatenations or modifications are involved. It\u0026rsquo;s important to note that the benefits of using StringBuilder are most noticeable in performance-critical sections of code. In cases where string manipulations are infrequent or involve a small number of operations, the performance gain might not be significant. ","date":"2023-07-06","heading":"","objectID":"/coding/optimization-code-stringbuilder/:0:0","tags":["performance","optimization","csharp"],"title":"Optimization Code - StringBuilder","uri":"/coding/optimization-code-stringbuilder/#"},{"categories":null,"collections":null,"content":"Introduction A common computer technique to improve performance in C# is the use of efficient data structures such as optimized dictionaries or lists. These data structures reduce the time for data access and searching, thereby improving the overall application performance. Optimized dictionaries, such as Dictionary\u0026lt;TKey, TValue\u0026gt;, provide fast and efficient data access through a data structure called a hash table. This structure allows storing data in key-value pairs, providing near-constant access time regardless of the dictionary\u0026rsquo;s size. How to To use an optimized dictionary, follow these steps: Define the appropriate key type (TKey) and value type (TValue) for your use case. Initialize the dictionary: Dictionary\u0026lt;TKey, TValue\u0026gt; dictionary = new Dictionary\u0026lt;TKey, TValue\u0026gt;(); Add elements to the dictionary: dictionary.Add(key, value); Retrieve a value from the dictionary: if (dictionary.TryGetValue(key, out TValue value)) { // Use the retrieved value } Remove an element from the dictionary: dictionary.Remove(key);Clarifications Using an optimized dictionary can improve performance when accessing or searching for a specific element by its key. This is particularly useful when working with large amounts of data or when frequent and fast access to specific elements is required. However, it\u0026rsquo;s important to note that performance optimization can vary depending on the context and specific use case. Therefore, it\u0026rsquo;s always advisable to profile and measure the performance of your code to verify the effectiveness of optimizations. In addition to using optimized dictionaries, there are many other techniques to improve performance in C#. Some examples include choosing efficient algorithms, minimizing memory allocations, using data structures tailored to the application\u0026rsquo;s needs, and optimizing LINQ queries. The choice of techniques depends on the specific context and requirements of your code. We will see these techniques in the next articles. ","date":"2023-07-06","heading":"","objectID":"/coding/optimize-code-p1/:0:0","tags":["performance","optimization","csharp"],"title":"Optimization Code - Dictionaries","uri":"/coding/optimize-code-p1/#"},{"categories":null,"collections":null,"content":" 1 ~ Tempo E\u0026rsquo; proprio quando ti viene a mancare che ci si accorge che il tempo è un elemento prezioso, raro. Da piccoli non si riesce a quantificarlo… sembra quasi sia infinito. Ma, a quell’età, il concetto del tempo non è banale, anzi, è abbastanza difficile da apprendere e , per noi adulti, da spiegare. I bambini necessitano di ragionare sulla concretezza e tangibilità delle cose. Vivono il presente, il qui ed ora e non ragionano su ipotesi, previsioni e progetti futuri. Che bella la spensieratezza dei bambini ! Con l’adolescenza le cose cambiano… il tempo ci è addirittura nemico! Non vediamo l\u0026rsquo;ora che passi in fretta per diventare, finalmente, adulti e liberi (già, liberi [sic!] ). Ma è da grandi che, purtroppo, ci accorgiamo che il tempo a disposizione è davvero poco e che scorre inesorabilmente. Troppi gli impegni che ci distraggono dai veri valori della vita. Troppi gli impegni che non ci consentono di vivere sereni con noi stessi e i nostri cari. Troppe le scuse che ci portano a procrastinare eventi, decisioni, che ci portano alla felicità: il non vissuto! Troppo tempo sprecato, e mai più recuperabile, per questi impegni. Ne vale davvero la pena? Lo so, sono considerazioni già fatte e dette ma, scriverle, farà si che mi appartengano e che mi aiutino a riflettere su come razionare il tempo. Poi, però, penso a quella spensieratezza dei bambini e ho il dubbio che forse, per certi versi, dovremmo imparare da loro… a vivere il presente. Dubbi… Dubbi…. Ma di una cosa non ne ho: ci è stata concessa un sola vita! Dobbiamo lasciare una traccia significativa di noi\u0026hellip; nella società e nei cuori delle persone a noi care! Quindi, al diavolo i dubbi! Usiamo questo tempo per vivere felici! Cit. La cosa più preziosa che puoi ricevere da chi ami è il suo tempo. Non sono le parole, non sono i fiori, i regali. È il tempo. Perché quello non torna indietro e quello che ha dato a te è solo tuo, non importa se è stata un’ora o una vita. (David Grossman) 2 ~ Time It\u0026rsquo;s just when you miss it that you realize that time is a precious, rare element. As children you can\u0026rsquo;t quantify it\u0026hellip; it almost seems to be infinite. But, at that age, the concept of time is not trivial, on the contrary, it is quite difficult to learn and, for us adults, to explain. Children need to think about the concreteness and tangibility of things. They live in the present, the here and now and don\u0026rsquo;t think about hypotheses, forecasts and future projects. What a beautiful light-heartedness of children! With adolescence, things change\u0026hellip; time is even our enemy! We can\u0026rsquo;t wait for it to pass quickly to finally become adults and free (already, free [sic!] ). But it is when we grow up that, unfortunately, we realize that the time available is very little and that it flows inexorably. Too many commitments that distract us from the true values of life. Too many commitments that don\u0026rsquo;t allow us to live peacefully with ourselves and our loved ones. Too many excuses that lead us to procrastinate events, decisions, that lead us to happiness: the unlived! Too much time wasted, and never recoverable, for these commitments. Is it really worth it? I know, these are considerations already made and said but, writing them down will make them belong to me and help me reflect on how to ration time. But then I think of that light-heartedness of children and I doubt that perhaps, in some ways, we should learn from them… to live in the present. Doubts… Doubts…. But one thing I don\u0026rsquo;t have: we have been granted only one life! We must leave a significant trace of us\u0026hellip; in society and in the hearts of our dear ones! So, doubts be damned! Let\u0026rsquo;s use this time to live happily! Cit. The most precious thing you can get from someone you love is their time. It\u0026rsquo;s not the words, it\u0026rsquo;s not the flowers, the gifts. It\u0026rsquo;s time. Because that doesn\u0026rsquo;t come back and what he gave to you is yours alone, it doesn\u0026rsquo;t matter if","date":"2023-05-22","heading":"","objectID":"/posts/tempo-time/:0:0","tags":["Life","Considerations"],"title":"Tempo - Time","uri":"/posts/tempo-time/#"},{"categories":null,"collections":null,"content":"Introduction Recently I received an attack on my NAS and the funny thing is that i found out because the internet connection was slow. Luck has it that after a while the NAS, even if under attack, was able to send me an email to inform me that user X was unable to log in and that after N attempts he had blocked the IP. Strange, user X is not present in my NAS\u0026hellip; With difficulty I managed to connect to the NAS and check the LOGS and, from there, I discover that I am under attack. Just to be fair, the NAS is a Synology. What was the attack about? I checked the source IPs and it seems that the attack originated from China or, at least, they were using some infected machine with a Chinese IP address. The attack was simple: The hackers tried to log in with a set of username\\password at their disposal. Evidently, they have a list of known usernames and passwords that are sure to have resulted in other attacks. Obviously the most used user was admin. Why couldn\u0026rsquo;t they get in? For five reasons: I had, some time ago, disabled the admin account I have activated, for all users of the administrator group, the MFA authentication. I have activated a check that disables the account and\\or blocks the IP address if you try to enter the password 3 times within 5 minutes. I have activated DDos protection I have activated the Firewall How did they find me? Because, after all the precautions I had taken, I forgotten the simplest thing: change the external port number\u0026hellip; don\u0026rsquo;t use the default one provided by Synology. What have I done? I promptly unplugged the twisted pair from the router. This way I disconnected all the devices from the network. The NAS was more unloaded with the CPU and I was therefore able to change the external port number on the NAS and on the Router (remember that by default it is 5000 and 5001). Subsequently, I started looking for a black list of IP addresses to feed to the NAS Firewall. Unfortunately I found many files with few addresses and, therefore, I started collecting them all producing a single, huge, file containing more than 23k of IP addresses. BlackList So, the result of my work is this list ","date":"2023-02-07","heading":"","objectID":"/posts/blacklist-ip-addresses/:0:0","tags":["Hackers","Firewall","Synology"],"title":"Blacklist Ip Addresses","uri":"/posts/blacklist-ip-addresses/#"},{"categories":null,"collections":null,"content":"Introduction It often happens that we have split files, such as text files, which contain a set of information split for a reason. Let me give you an example: I needed to upload some IP addresses to my firewall blacklist. Unfortunately I had more than one hundred files, containing this information, splitted by geographical area. To be honest, I didn\u0026rsquo;t want to upload the files one at a time. For this reason, I had thought of creating a single file by unifying all the others. How-To We have different solution depending by the OS in use. Anyway, we will use the cmd-line to perform this operation. Windows The command to use is the copy copy /b *.txt joinfile.txtOSX and Linux The command to use is cat cat *.txt \u0026gt; joinfile.ext","date":"2023-01-12","heading":"","objectID":"/coding/howto-join-multiple-files/:0:0","tags":["How-to","Scripts"],"title":"How-To: Join multiple files","uri":"/coding/howto-join-multiple-files/#"},{"categories":null,"collections":null,"content":"Introduction I received a strange issue during the Fetch and Pull actions in Visual Studio. The error is: Error Error: cannot lock existing info/refs/blablabla Fix The fix consist to remove references to remote branches in the folder .git/refs/remotes/origin $ git remote prune originThis fix will not affect the local branches, just update the local references. So.. it\u0026rsquo;s safe! ","date":"2022-12-16","heading":"","objectID":"/coding/git-error-cannot-lock/:0:0","tags":["GIT","Error"],"title":"GIT Error - Cannot lock existing info/refs","uri":"/coding/git-error-cannot-lock/#"},{"categories":null,"collections":null,"content":"Introduction When we are developing a new application, for sure, we need to create a Logger. Log an info/warning/error is useful for the user but, of course, much more for the developer to investigate on an issue. Or, maybe, because the application has to provide a report of an investigation (performance or comparison test are just two examples). Sometimes the existing Logger is not enough for our purposes and, for this reason, it’s necessary to write our own custom logger. So, let’s see how to implement it… Note: The article will show the code in CSharp but the method can be applied also in other languages. Note 2: Don\u0026rsquo;t worry. At the end of the article there is a link to the GitHub\u0026rsquo;s repository. Good Practice First of all, let\u0026rsquo;s try to use some good practice in order to implement the Logger in the best way. Folders: Maintain the classes in the right folders is the first thing to do. Example: Do we have to create an Helper class? Let\u0026rsquo;s create an Helpers folder that will contains all the Helpers’ classes. Divide by Tasks: Do not create a generic class which manage different behaviors. Create a specific class for the specific behavior. Example: Do we need many methods that return the result of query? Let\u0026rsquo;s create a DataProvider class (MyClassDataProvider) that contains all the methods we need. Of course, save the class in the right folder (DataProviders). Interfaces: It\u0026rsquo;s always a good practice to create classes by implementing interfaces and use them to declare objects in other classes. Design Pattern: Always a best approach to use some design pattern. In this article, I\u0026rsquo;ll use some of them… What do I need? Always ask yourself this question, when you have to implement from scratch a new project. In this case, we have to create a Logger class that log\u0026hellip; what and where? What: Of course\u0026hellip; a message :D But there are at least three types of messages to log: Info Warning Error Where: Ok.. where we have to log the message? In the console? In a File? In the Database? So, let\u0026rsquo;s assume that we need to log in the Console and in a File. With these answers, we can start to create our Logger class. Implementation Organization First of all, all the files that we will create must be organized by folders. The name of the folders is very important: they must contain the classes that perform a certain action. For this project we need this kind of classes: Factory Helper Model Service This list is the exact list of folders that we need. Factory Class Let\u0026rsquo;s start to create a folder, named Factory, and create a Factory1 class with the name LogBase This class contains the methods that all the inherited classes must have! Inherited classes Ok.. where do we want to log the info? I chose two simple options: in a File and inside the Console. We need two classes, which inherit the base class (LogBase), and identify them as a service. So, let\u0026rsquo;s create a folder named Services and create the two classes. ConsoleLogService FileLogService Models We need some constants to use inside our code, avoiding using strings or anything else. For example, a Target to define which Log service to use and a Type to define the type of the log (INFO, ERR, WARN). Usually, I create an unique class that collects all the enums\u0026hellip; Helpers It\u0026rsquo;s time to create the Helper that will “help\u0026quot; us to log the message. Usually an helper\u0026rsquo;s class is declared as static… and this is the case for us. This class use an object declared with the abstract class (LogBase) and initialized with defined target. The static Log method is used to log the message with a specific service (using the enum LogTarget). We can avoid to send, in the Log method\u0026rsquo;s parameters, the LogType creating the dedicated methods. For this reason, I proprose a variation of the Helpers class. GitHub You can find all the sources in my GitHub\u0026rsquo;s repository. Updates 8 Dec 22\u0026rsquo; : Fixed possible bug in the FileLogService\u0026rsqu","date":"2022-11-26","heading":"","objectID":"/coding/create-a-logger/:0:0","tags":["CSharp","tips\u0026tricks","DesignPattern"],"title":"Create a Logger","uri":"/coding/create-a-logger/#"},{"categories":null,"collections":null,"content":"Introduction It is an English term, contraction of favorite icon. Usually it indicates an icon associated with a particular web page and it is a small image. Curiosity: Originally a feature of Microsoft Internet Explorer version 5, it was later integrated into many other browsers, including Firefox, Opera, Safari, Chrome and Konqueror So, it is clear that the scope of this article is to show you how to create the Favicon for your website from an image. Generator In our help there is a fantastic website that provides an excellent service for converting images into favicons. I’m talking about RealFaviconGenerator Result The result is a set of favicons for the most important web-browser, app, etc.. First, you have to download the Favicon package and extract it in the website’s folder. After, simply add some code in your html index file. The results page details exactly what to do. Check To check if your Favicon is good for all the platform, the website provide also a tool to perform this check: FaviconChecker ","date":"2022-11-24","heading":"","objectID":"/posts/create-favicon/:0:0","tags":["MyDaily","Software","Web"],"title":"Create Favicon","uri":"/posts/create-favicon/#"},{"categories":null,"collections":null,"content":"Introduction It is quite common for developers to create tags in order to have reference points in their development. Sometimes the tags are used also to mark a version of the code. It happen often that the code that we are maintained is used in other solutions as library. And, of course, each solutions can use different version of our deployed code. Real case If different applications used different version of our deployed code (as library, for example), means that we have to maintain \u0026ldquo;all\u0026rdquo; the versions (maybe it is better to define from which version there is a maintenance support). What we can do In Git we can download a specific tag with this command: $ git checkout tags/\u0026lt;tag\u0026gt; -b \u0026lt;branch\u0026gt;Example: $ git checkout tags/v1.0 -b v1.0-branchExplanation The git command checkout tags will download the codebase from the indicated tags (for example v1.0) The parameter -b means : \u0026ldquo;Hey, put the downloaded files in this branch\u0026rdquo; and, after, GIT switched to the new branch (for example \u0026lsquo;v1.0-branch\u0026rsquo;) ","date":"2022-11-12","heading":"","objectID":"/coding/git-checkout-tags/:0:0","tags":["Scripts","GIT","Tips\u0026Trick"],"title":"GIT - Checkout TAGS","uri":"/coding/git-checkout-tags/#"},{"categories":null,"collections":null,"content":"Introduction When you run a .ps1 PowerShell script you might get the message saying “PowerShell is not digitally signed. The script will not execute on the system.” Fix To fix it you have to run the command below to run Set-ExecutionPolicy and change the Execution Policy setting. Set-ExecutionPolicy -Scope Process -ExecutionPolicy BypassExplanation This command sets the execution policy to bypass for only the current PowerShell session after the window is closed. The next PowerShell session will open running with the default execution policy. “Bypass” means nothing is blocked and no warnings, prompts, or messages will be displayed. Permanent Solution If you prefer to allow the execution of all the powershell scripts without digit each time the code above, this is a permanent solution: Set-ExecutionPolicy -ExecutionPolicy unrestricted","date":"2022-11-12","heading":"","objectID":"/coding/powershell-not-digitally-signed/:0:0","tags":["Scripts","PowerShell","Fixes"],"title":"PowerShell Not Digitally Signed","uri":"/coding/powershell-not-digitally-signed/#"},{"categories":null,"collections":null,"content":"Introduction The scope of this article is to show you how to create a simple script to speed-up some operations for the deploy of the web-site. Of course, we need to move all the files (in the public folder) into the remote folder through an FTP service. Install an FTP Mac/Linux I have tried many command line clients, but the only one that allowed me to move all the contents of the public folder (including folders), to the remote one, was ncftp [link] To install it, open the terminal and digit brew install ncftpOr just visit the download page Windows As I said before, you can visit the download page or you can use a powershell command to put the files in the FTP. Another suggestion is to use WinSCP Create the script So, now we are ready to write the batch. Mac/Linux Open a text editor and write this #!/bin/bash cd \u0026#34;THE_WEBSITE_LOCALPATH\u0026#34; rm -r public hugo -D ncftpput -Rvm -u \u0026#34;USERNAME\u0026#34; -p \u0026#34;PASSWORD\u0026#34; IPADDRESS /REMOTE_PATH public/*Now, save the file with the extension .sh Windows You can follow this link to the WinSCP documentation to create a simple script to upload the files. That\u0026rsquo;s all! You can run the script and test it! ","date":"2022-10-06","heading":"","objectID":"/coding/deploy-script-for-hugo/:0:0","tags":["Scripts","Deploy","Hugo"],"title":"Deploy Script for Hugo[Mac-Linux-Win]","uri":"/coding/deploy-script-for-hugo/#"},{"categories":null,"collections":null,"content":"Introduction The content of this post is to show you how to create a static website in an easy way, using a framework and themes. The post will be very easy and short\u0026hellip; so, let\u0026rsquo;s proceed.. Framework The Framework that we will to use is HUGO. I don\u0026rsquo;t want to stress you with a lot of info about it. If you are curious, you can check: Hugo WebSite Wikipedia GitHub repo Go, programming language that HUGO is based for. How To We havo to install the framework before to use it (reallY?! :D ) We will use different tools depending by the OS of your PC. GIT is mandatory. Please, install it if not present in your PC. 1 Install Windows \u0026ndash;\u0026gt; We will use Chocolatey choco install hugo -confirm MacOS \u0026ndash;\u0026gt; We will use Homebrew brew install hugo Linux brew install hugo2 Create e new WebSite It\u0026rsquo;s very simple. Just write this code in terminal hugo new site YOUR_SITE_NAME3 Add a Theme The theme of this WebSite is Hermit. I\u0026rsquo;ll show you how to install it cd YOUR_SITE_NAMEgit init git submodule add https://github.com/Track3/hermit.git themes/hermitThe code before just download the theme. Now, we have to configure the web site with the new theme: echo theme = \\\u0026#34;hermit\\\u0026#34; \u0026gt;\u0026gt; config.toml4 Configure the WebSite Before to compile the WebSite, you have to set-up some configurations in the config file. Just open the file config.toml with VisualStudioCode (for example) and edit it following this example: https://github.com/Track3/hermit/blob/master/exampleSite/config.tomlSimply, add what you need for your WebSite 5 Create a Page Now, it\u0026rsquo;s time to create your first static page: \\ hugo new posts/my-first-post.mdAs you can see, the path is posts/. This path matches with the voice declared in the config.toml \\ [menu] [[menu.main]] name = \u0026#34;Posts\u0026#34; url = \u0026#34;posts/\u0026#34; weight = 10So, this means that, if you want to create a \u0026ldquo;folder\u0026rdquo; to collect other posts (because of different argument, for example), you have to configure the folder in the configuration and run the command to create the static page \\ hugo new FOLDER_NAME/PAGE_NAME.md5.1 Edit the WebPage Just open the .md file with an editor like VSCode. You have to use the markdown to write the content. As you can see, the framework will not create an empty file: --- title: \u0026#34;PAGE_NAME\u0026#34; date: 2022-10-03T17:58:27+02:00 draft: true toc: false ---If you want to add TAGS or a background image, just inser this: images: - https://picsum.photos/1024/768/?random tags: - MyDaily - Software - Security7 Start the Server! Now it\u0026rsquo;s time to see the results. Just run this in the terminal: hugo server -Dand open the url http://localhost:1313 8 Build the WebSite Very simple. Just run: \\ hugo -DLast That\u0026rsquo;s all! Have fun! ","date":"2022-10-03","heading":"","objectID":"/coding/create-static-site/:0:0","tags":["Framework","WebSite","Hugo"],"title":"Create Static WebSite","uri":"/coding/create-static-site/#"},{"categories":null,"collections":null,"content":"Introduction It is always difficult to be totally sure that all the Password Managers are reliable… indeed no, trusted (better)! Also, if we consider to use a freeware software the worries are more. The scope of this \u0026ldquo;article\u0026rdquo; is to share with you my considerations: what I currently use and why. The past I have been using KeePass and KeePassX first and SafeInCloud - Password manager after\u0026hellip; for many years. KeePass: Software for Windows. Open Source, light-weight and easy-to-use KeePassX: Software for MacOSX or MacOS. Same features of KeePass. Unfortunately the development of KeePassX has stopped but it has been replaced by KeePassXC SafeInCloud: Personally I find it an excellent software: simple, clean, multi-platform, inexpensive and you can use a cloud service to historicize the data (Drive, Dropbox among the most famous). For all of them I always used Dropbox or Google Drive to share the password with all the devices. Why did I decided to change You know, KeePass and KeePassX (in general, all the forks of KeePass) are a very simple software that are not integrated so much with the modern OS. For SafeInCloud, the reason is strictly related to the \u0026ldquo;software house\u0026rdquo;. In reality, there is only one developer and owner: Andrei Shcherbakov. I tried to find any info about Andrei but without success. I just know that he is a Russian guy.. that\u0026rsquo;s all. So, I spent two days (even late at night) looking for a new solution. Question! Do I develop something of my own or am I looking online for something that gives me security? I discarded the first solution (homemade) because I NEVER, and I mean NEVER, time for these things (work, family, commitments). I would end up starting a new project and leaving it halfway (like many others). So, as you may have guessed, I focused on the other option. I scanned the WEB far and wide, finding everything and that it did not match what I was looking for: OpenSource Multi platform (I have many devices with different OS) Sharing with other users Cloud (proprietary or other services) Free \\ Premium (economically accessible) Possibility to use a Server \\ Database on Premise Solution After many ifs and buts, I settled on Bitwarden It has all the features I have listed and, at the moment, I am relying on their cloud. Several possibilities: Individual solution: Basic Free Account Premium Account -\u0026gt; 10$/yr Sharing solution Basic Free 2-Person Account Families Organization -\u0026gt; 3.33$/month My choise I chose the Basic Free 2-Person Account It was a feature that I really lacked in the previous Password Manager. You do not know how convenient it is to have a section in common, with two accounts, where you can share the credentials of the sites/applications of common interest to the family. A brillant idea Create a family Gmail account to use in services (apps, websites, etc..) that can be used in sharing. Future In the future, as soon as I have some time, I will dedicate myself to creating a Server\\Database on Premise in such a way as to be totally independent from any service and sleep peacefully . ","date":"2022-10-03","heading":"","objectID":"/posts/new-password-manager/:0:0","tags":["MyDaily","Software","Security"],"title":"New Password Manager","uri":"/posts/new-password-manager/#"},{"categories":null,"collections":null,"content":"Hello world.. I\u0026rsquo;m Salvatore. My passion lies in all things tech-related. You could call me a tech enthusiast addicted 😄 With a degree in Computer Engineering, technology is an integral part of my daily life. I\u0026rsquo;m currently employed by the vibrant company based in Bologna: Kantar Xtel 1 2 I\u0026rsquo;m fortunate to interact with people from all corners of the globe. This exposure not only broadens my cultural horizons but also provides me with invaluable insights and knowledge. I firmly believe that the journey of learning never truly ends, both on a personal and professional level. Quote Learning without thinking is wasted effort. Thinking without learning is dangerous. Quote Wisdom and common sense are obtained in three ways: First with reflection, which is the noblest thing; Second through imitation, which is the simplest thing; Third with experience, which is the bitterest thing of all. Development Well, usually I work with C# and javascript but i love all the program languages in general. C# JavaScript Java SQL Android etc.. The WebSite We are powered by Hugo, themed by Hermit, and served by MisterDomain. Edited on multiple devices: MacBook Pro 13\u0026quot; M1 iPad Pro iPhone View humans.txt. Hobbies A lot of hobbies but it\u0026rsquo;s quite difficult to maintain all with constancy. SSC Napoli Photography Fishing 3D Print Arduino Domotics Visit https://www.kantar.com\u0026#160;\u0026#x21a9;\u0026#xfe0e; Visit https://www.kantar.com/expertise/consumer-shopper-retail/sales-performance-platform\u0026#160;\u0026#x21a9;\u0026#xfe0e; ","date":"2022-10-03","heading":"","objectID":"/about/:0:0","tags":null,"title":"About me","uri":"/about/#"},{"categories":null,"collections":null,"content":"Introduction Well, after years I decided to go back to writing on a blog. Many things have changed in 10 years (maybe even more). I got rid of all my old blogs ( too bad! ). It no longer made sense to update them and the effort spent to update them would have been \u0026ldquo;high\u0026rdquo;. For this reason I decided to look around and see if there is a simple framework to help me to build a new site\\blog in an easy way. Ok.. it seems that HUGO can help me in this new \u0026ldquo;adventure\u0026rdquo;. Idea Now we need to define the meaning of this blog, how to use it. Actually, I thought I\u0026rsquo;d split it into two sections (I\u0026rsquo;ll figure out how to do it): My Daily - I will tell my newspaper TryCatchIt - Where I will collect all the problems that, as a developer, I have encountered in my career and how I have solved them. Stay tuned! ","date":"2022-02-22","heading":"","objectID":"/posts/back-to-the-past/:0:0","tags":["MyDaily"],"title":"Back to the past","uri":"/posts/back-to-the-past/#"}]