Posts

Why AI Context and the Right Model Matter When Building Apps

Image
A tiny task, two very different answers I gave two AI models the same three-line Python task. One gave me four lines of clean code and a useful warning. The other spotted the same edge case, but it quietly decided how to handle it for me. The task was so simple that you'd expect both models to do it the same way. They didn't, and the difference taught me more than any benchmark. Context, and choosing the right model, matter even for the smallest tasks. The task I sent both models the same prompt, word for word: Build a Python script. You should define a function named apply_discount . The apply_discount function should take exactly two parameters: price and discount . If price is not a number (int or float), the function should return the string The price should be a number . That's the whole spec. It doesn't say how to handle the discount, what to return for valid input, or what to do about edge cases. A good assistant has to decide what to fill ...

AI Virtual Team: Five Subagents Built My Growth Plan in Under 90 Minutes

Image
I built MathQuizPrep as a free study tool for my daughter’s math competition prep. Once it existed, one question came up naturally: could this app also earn a little money, without being unfair to the audience, since the users are 10-15 years old? I did not want to research marketing, EU law about minors, SEO, and UI design all by myself. So instead of doing that research alone, I defined a small team of AI specialists and asked them to do it for me, with one of them working as a manager for the other four. Building the team: by prompting, not by writing the files myself Each “team member” is a Markdown file inside .claude/agents/ — a persona with a name, a short job description with a fixed list of tools it is allowed to use. Each agent also got information about which model it should use — the more complex ones (like the manager) got more capable models. I did not write any of these files by hand. I described the team in plain English, and Claude wrote and improved them over a shor...

From PDF Archive to Study App: An LLM-Driven Data Pipeline

Image
  A lot of real-world problems boil down to the same shape: some scattered, unstructured source material exists (PDFs, archives, scanned documents), and what you actually need is a structured, usable product on the other end — categorized, searchable, and packaged for a specific audience. That transformation used to mean writing a pipeline by hand: a parser here, a classification script there, a templating layer to render the final output. With an LLM as a development partner, the same pipeline can be built through conversation — research, extraction, categorization, content generation and packaging, each step still a real, inspectable script or file, but designed and iterated on in natural language rather than written line by line. The part that changed the most for me wasn’t the coding — it was the analysis phase. Reading five years of exam PDFs, working out the syllabus scope, and deciding how to categorize dozens of tasks by topic and difficulty is the kind of manual review tha...

Self-Healing Scrapers: Let One Agent Write Another Agent's Instructions

Image
A scraper usually breaks the moment a website redesigns its layout. This one doesn't — it researches the page itself, and re-researches it when something changes  This article walks through building exactly that, with Claude Code. The business need Let's imagine a situation where parents have three kids in three different schools. None of the schools agree on how to publish a timetable. The formats are different: one puts up clean, per-class HTML pages. Another exports its entire grade level as a single PDF. What the parents want is one combined, printable schedule covering all three kids. Writing an HTML scraper for the first school and a PDF scraper for the second is an afternoon's work. What is more, the timetable structures may change in time. The process The solution I landed on with Claude Code was a self-correcting process based on LLM agents. There are two agents involved. The first, a research agent , studies a school's site and writes plain-English ins...

ASP.NET 5 Beta 8

It's been a while since a wrote something on a blog. Today I would like to share with you a good starting point for ASP.NET 5 and switching to beta 8. Here is a nice article  Upgrading from ASP.NET 5 Beta 7 to Beta 8 And nice tutorial made by the same author  Building a Web App with ASP.NET 5, MVC 6, EF7 and AngularJS

TCExecutor on NuGet

Image
TCExecutor is now awailable on NuGet.org Project page:  TCExecutor From Visual Studo:

Thread safe rotate index.

Sometimes you may need a rotation thread safe index. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Collections.Concurrent; using System.Threading; namespace ConsoleApplication12 { class Program { static void Main(string[] args) { Console.WriteLine("Init value = Int32.MaxValue - 10"); RotatorIndex.Init = Int32.MaxValue - 10; Thread thread1 = new Thread(new ThreadStart(ThreadMethod)); Thread thread2 = new Thread(new ThreadStart(ThreadMethod)); thread1.Start(); thread2.Start(); thread1.Join(); thread2.Join(); Console.WriteLine("Init value = - 10"); RotatorIndex.Init = - 10; thread1 = new Thread(new ThreadStart(ThreadMethod)); thread2 = new Thread(new ThreadStart(ThreadMethod)); thread1.Start(); thread2.Start(); ...

Localized type conversion

If you need a DateTime or double convertion depending on system localization here are some examples: Date to string DateTime dt = new DateTime(2012, 06, 13, 17, 50, 00); string date_US = dt.ToString(new CultureInfo("en-US").DateTimeFormat); string date_GB = dt.ToString(new CultureInfo("en-GB").DateTimeFormat); string date_PL = dt.ToString(new CultureInfo("pl-PL").DateTimeFormat); string date_RU = dt.ToString(new CultureInfo("ru-RU").DateTimeFormat); Console.WriteLine("date_US = {0}", date_US); Console.WriteLine("date_GB = {0}", date_GB); Console.WriteLine("date_PL = {0}", date_PL); Console.WriteLine("date_RU = {0}", date_RU); /* date_US = 6/13/2012 5:50:00 PM date_GB = 13/06/2012 17:50:00 date_PL = 2012-06-13 17:50:00 date_RU = 13.06.2012 17:50:00 */ String to date date_US = "6/13/2012 5:50:00 PM"; date_GB = "13/06/2012 17:50:00"; date_PL = "2012-06-13 17:50:00"; d...

SSH

Recently I was thinking of SSH support in my TCExecutor application. I've found some 3rd party libraries which support SSH.... but... I think I'll try to implement it on my own... Here are some specs: The Secure Shell (SSH) Protocol Assigned Numbers - RFC 4250 The Secure Shell (SSH) Protocol Architecture - RFC 4251 The Secure Shell (SSH) Authentication Protocol - RFC 4252 The Secure Shell (SSH) Transport Layer Protocol - RFC 4253 The Secure Shell (SSH) Connection Protocol - RFC 4254

TCExecutor v0.0.1 released

Image
TCExecutor - Telnet Command Executor C# open source project is released in version 0.0.1 Thanks to TCExecutor you can add communication/configuration layer to your application in just four steps: Create TCExecutor object Define commands Hook up your code to commands events (TCExecutor is multithread/multiconection application remeber that your code must be threadsafe) Start TCExecutor listener. Commands style: > command1  subcommand1 ... subcommandN param1=X1 ... paramN=XN  ARGV1...ARGVN Features: Adds network communication layer to your application Supports multiple connections. For each connection separate session is established. Commands can be defined at your application startup. Each command has separate event to which you can connect to. Each command has a short and long help string which helps end user to navigate through available options. Next releases features: Enable SSH connections to the TCExecutor. Add simple user autentication...

Nikon D40 Intervalometer

Image
Is it possible to create time lapse pictures with Nikon D40... yes... You can find results here: result1 result2 You are a software engineer... you can do anything... it is just a matter of time ;)

C# Custom Performance Counters - First Performance Counter

Image
Table of content: I. C# Custom Performance Counters - Introduction II. C# Custom Performance Counters - First Performance Counter 1. Creating a custom Performance Counters and Performance counters category. You can create your own Performance category and Performance counters. To achieve this goal you can use Visual Studio tools, or .NET System.Diagnostics objects. In this post I’ll describe counters and category creation in a code using using System.Diagnostics; First of all you need to make a counters collection: CounterCreationDataCollection collection = new CounterCreationDataCollection(); Then you need to create performance counter CounterCreationData counter = new CounterCreationData(); counter.CounterName = "CountsPerSecond"; counter.CounterHelp = "CountsPerSecond"; counter.CounterType = PerformanceCounterType.RateOfCountsPerSecond32); collection.Add(counter); And place it into the category. As the category type you can use SingleInstance and M...

C# Custom Performance Counters - Introduction

Image
Table of content: I. C# Custom Performance Counters - Introduction II. C# Custom Performance Counters - First Performance Counter 1. Introduction There is a moment in software engineer life when it is time to check application performance. At this certain point you will ask yourself “How can I do it?”. Answer is not simple because you can do it in a very different way. You can of course find any 3 rd party application which will measure some things for you. You can make some kind of log file and insert some performance data to it, or you can use .NET System.Diagnostics namespace. In this article I’ll focus on System.Diagnostics. I’m not saying it is the best approach, I’ll just describe some elements of it and you can decide if it suits your needs or not. 2. Where I can find Performance counters in Windows. In Windows you can find some predefined performance counters. Just open Control Panel -> Administrative Tools -> Performance There you can find some predefined count...

AVRStudio and Ubuntu [ENG]

Image
Hello there!!! Here you can find a simple tutorial which shows how to install AVRStudio 4.18 on Ubuntu 10.04 and use a ZL16PRG programmer to connect to a laboratory device. 1. We need to download AVRStudio from website http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725 2. Let's install AVRStudio using Wine. 3. After connecting ZL16PRG to USB port we should be able to see it in a system. lsusb we should find our device Bus 003 Device 020: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC 4. Next step is to connect our USB device to Wine COM1 port. In my case I was able to find my USB device in: /dev/serial/by-id/usb-FTDI_USB__-__Serial-if00-port0 Now it's time to male a link between USB device and COM1 on Wine. ln -s /dev/serial/by-id/usb-FTDI_USB__-__Serial-if00-port0 ~/.wine/dosdevices/com1 5. Right now we can test if everything works fine: Have a nice programming :) Used links: https://help.ubuntu.com/c...

AVRStudio na Ubuntu [PL]

Image
Witam serdecznie. Oto prosty tutorial jak zainstalować AVRStudio 4.18 pod Ubuntu 10.04 i podłączyć układ za pomocą programatora ZL16PRG. 1. Ściągamy AVRStudio ze strony producenta: http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725 2. Instalujemy AVRStudio używając Wine (z moich doświadczeń wynika, że działa) 3. Po podpięciu Programatora ZL16PRG powinniśmy mieć nowe urządzenie USB. sprawdźmy: lsusb powinniśmy znaleźć takie urządzenie: Bus 003 Device 020: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC 4. Podepnijmy nasze urządzenie USB do COM1 na Wine. W moim przypadku urządzenie USB znajdowało się w: /dev/serial/by-id/usb-FTDI_USB__-__Serial-if00-port0 Podepnijmy więc USB pod COM1 w Wine tworząc link: ln -s /dev/serial/by-id/usb-FTDI_USB__-__Serial-if00-port0 ~/.wine/dosdevices/com1 5. Podłączmy się pod układ za pomocą programatora Wygląda na to, że wszystko gra. Miłego pisania aplikacji :) Linki zewnętrzne: h...

Ruby 1.9.1 - Change JPG image name using EXIF information.

Recently I got a lot of images from a trip. Pictures I've received were from a different cameras. I wanted to create a chronological photo gallery. Unfortunately when I copied the files, I realized that all of them have the same date and time and different prefixes. Fortunately I've noticed that all images I got, contains EXIF JPG information. That is why I've created a ruby script, which changes images names, using Date Time, taken from EXIF information. To read EXIF information use ruby exifr gem. gem install exifr Here is a code. Enjoy! require 'rubygems' require 'exifr' inputDir = ARGV[0] prefix = ARGV[1].nil? ? "IMG" : ARGV[1] if (ARGV.length >= 1) Dir.glob("#{inputDir}/*.jpg",File::FNM_CASEFOLD).each() {|file| timeTaken = EXIFR::JPEG.new(file).date_time if (timeTaken.nil? & !EXIFR::JPEG.new(file).exif.nil?) timeTaken = EXIFR::JPEG.new(file).exif.date_time_original end if (timeTaken.nil?) ...

C#- Change form language at runtime.

Image
Recently I was trying to create multi language application in C#. I found a lot of useful information in net. You can always create a resource file and use it for localization: Localization with resource file. It's quite simple, but you always need to change text properties in form constructor... Not useful if we have a lot of forms. Better solution is to localize your form in a designer. Localization in Designer It is easier to localize forms and all code is created by designer. But how we can change language at run time? All procedures described before enables localization changing when new form is created. I'll describe language change at run time in case when forms are localized using Designer. In order to change application language we need to: 1. set a proper CultureInfo mCI = new CultureInfo(language); Thread.CurrentThread.CurrentCulture = mCI; Thread.CurrentThread.CurrentUICulture = mCI; If you want to know all p...

SVN DB on portable device. UBUNTU

Recently I wanted to start a new project with version control. This will be a personal project so I don't want to use any SVN server. That is why I was looking for a way to create an SVN repository on my portable USB drive. I've found a lot of "how to create a portable source control..." but most of them were about GIT. Why I'm not using GIT? Because I know SVN and I do not want to learn how to use GIT... for now. [UPDATE 2012-12-19] GIT solved all issues I had with SVN. To make a dongle repository just create a bare GIT repository there and push your changes from PC. I stopped using SVN If you still want to use SVN here you have it: I assume that you have SVN installed on your ubuntu. Create repository on portable device. I'll create repository on PORTABLE_DEVICE in folder SVN_REPO/TEST_REPO svnadmin create /media/PORTABLE_DEVICE/SVN_REPO/TEST_REPO That is all. Repository is created and ready to use. Lets use repository. First checkout y...

QT Aplikacja z pluginami

Ostatnio rozpocząłem swoją przygodę z pisaniem aplikacji w QT i zacząłem się zastanawiać, czy trudnym jest napisanie aplikacji w QT do której można pisać pluginy. Okazało się to prostsze niż sądziłem. Jak stworzyć aplikację obsługującą pluginy? Oto kilka kroków. 1. Stworzenie interface'u umożliwiającego komunikację pomiędzy pluginem a programem głównym. 2. Stworzenie klasy implementującej interface. 3. Załadowanie pluginu w programie głównym i jego użycie. Przykład: 1. Interface (interface.h) #ifndef INTERFACES_H #define INTERFACES_H #include <QtPlugin> class DBConnection { public : virtual ~ DBConnection () {} virtual QString getName () = 0 ; }; Q_ DECLARE _INTERFACE ( DBConnection , " myDBConnection " ); #endif // INTERFACES_H Najważniejszy element interface'u zaznaczyłem czcionką pogrubioną.  Należy pamiętać o tym aby zadeklarować interface za pomocą macro  Q_ DECLARE _INTERFACE Skoro mamy już interface, stwórzmy plugin...