Skip to main content

Posts

Teaching an AI What WYSIWYG Actually Means

I wanted to integrate a WYSIWYG Markdown editor into my ReactJS application. I carefully explained what I was trying to achieve—but notably did not specify which library I wanted to use. This was intentional. I was curious to see how the agent would choose a library on its own, and whether it could reliably search for and identify a good tool for the job. I was using Opus with Cursor. After executing my request, I opened the page and immediately noticed something peculiar: although I could “edit” the content, the editing experience was limited to raw Markdown. The nicely formatted text—the whole point of WYSIWYG—was available only in preview mode. Naturally, I asked the agent to modify the application so users could edit the formatted text directly, like civilized people. The agent began to think. And think. I’m confident these were deep thoughts, because the pause was longer than usual. After a few seconds of coding, it triumphantly declared, “There you go—sorry, I didn’t understand...
Recent posts

The AI Didn’t Know the Port. I Didn’t Want to Hurt Its Feelings

I was excited to finally have a new side project to work on, and naturally, I wanted to vibe code. So I fired up Cursor.  For the rest of this post, I’m going to refer to Cursor as “him”, because it genuinely felt like I was pair-programming with a very confident senior software engineer — the kind who types extremely fast and never doubts his decisions.  The Design   I asked ChatGPT to create designs for:  The home page User dashboard  Login page  Forgot password page  Sign-up page  I provided the theme colors and a one-line idea for the project.  ChatGPT’s first response was… an HTML file with all the styles embedded inside it. Not exactly what I had in mind. Since I didn’t want just code, I politely asked it to generate actual design images instead. After a few iterations, I was able to finalize the UI and download both the HTML and styles. This was a surprisingly interesting experience for me. In the past, when I had an idea for ...

Always Draw a Bold Line

Recently working on a woodworking project I realized there is a resemblance with software development. I came to the conclusion that drawing a bold line plays an essential role in the success of a project in both cases. I had a blueprint I was trying to measure and cut the wood. Some measurements were important to be accurate to an eighth of an inch. The pencil was not sharp so instead of sharpening it, I thought I would draw a pale line in some cases I would notice that the line was not drawn accurately due to the pencil not being sharp. So in my thought, I would decide to cut the side of the line instead of on the line to address the issue. Doing so I realized that I would lose the line because it wasn't bold enough. Also not being sure of the exact offset I needed when cutting on the side of the line ended up the pieces being inaccurate so I had to redo the pieces or spend a lot of time correcting the cuts. After sharpening the pencil and drawing bold lines I realized a signif...

Setting up a web project using Grunt, Bower and Yeoman

Grunt : task runner for minification, compilation, unit testing, linting, etc Bower : Bower is a package manager for the front-end. It offers a generic, unopinionated solution to the problem of front-end package management. It installs the requested package with all dependencies. Yeoman : is web project scafolding tool. we need to install its genarators for different projects. For example: angular-genarator, or melonjs-generator brew install npm npm install -g bower bower install melonJS npm install -g yeoman npm install -g grunt npm install -g grunt-cli npm install -g generator-melonjs mkdir project-folder cd path/to/project-folder yo melonjs Answer to the questions then edit package.json add the followings to dependencies "grunt-contrib-less": "latest", "grunt-contrib-watch": "latest" Run the following command: npm install Edit Gruntfile.js as the following  grunt.loadNpmTasks('grunt-contrib-less');  grunt....

Monkey Patching Django Model Class

Django is shipped with some useful application, also there are lots of third party re-usable application written for Django. Sometime you need to modify or customize these applications(Models of application) to meet your software requirements. One of the usual solution is adding a Model class to have a one-to-one relationship with the third party Models. This solution has some disadvantages such as having more tables and classes which can highly adversely affect database performance, scalability and add more complexity to the software development.  I think of another solution to this problem. I used Django South along with monkey patching of third party Model classes. I added a field to Django user class. Here is a walk through over this approach. 1. Add an application: python manage.py startapplication userpatch 2. Add the following  code to add the new field to the user class from django.db import models from django.contrib.auth.models import User ...

Installing MS SQL Server driver on Ubuntu Linux

Although making a connection to SQL Server can be done using unixODBC and FreeTDS, it does not work with some collations on SQL Server 2008. Recently, Microsoft released an ODBC driver for Linux that works on 64-bit systems only. Installing the driver is tricky. I begin by installing the build-essential, which is required for compiling from source. Checkinstall can be installed if you want to add the following application to the package manager. $ sudo apt-get install build-essential  Download unixODBC-2.3.0  and Microsoft ODBC dirver  and extract. $ sudo wget ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-2.3.0.tar.gz $ tar xvf unixODBC-2.3.0.tar.gz $ wget http://download.microsoft.com/download/6/A/B/6AB27E13-46AE-4CE9-AFFD-406367CADC1D/Linux6/sqlncli-11.0.1790.0.tar.gz $ tar xvf sqlncli-11.0.1790.0.tar.gz  Install the unixodbc using the following commands: $ ./configure --disable-gui --disable-drivers --enable-iconv --with-iconv-char-enc=UTF8 --with-ico...

جستجوی املاک روی نقشه برای خرید و فروش و اجاره ، خانه و آپارتمان

دودوتا  وب سایت  جستجوی املاک آن لاین با قابلیت های بسیار زیاد از جمله جستجوی پیشرفته املاک روی نقشه و غربال سازی چند بعدی می با شد تمام امکانات این وب سایت رایگان است و کاربر می تواند مستقیما با آگهی دهنده و یا مالک در ارتباط باشد. این وب سایت تمام معاملات املاک از جمله فروش و خرید ، اجاره و رهن، معاوضه و پیش فروش را پشتیبانی می کند همچنین تمام انواع املاک  از جمله: آپارتمان، خانه، ویلا، زمین، مغازه دفتر کار و تمامی انواع مستغلات در دودوتا به طور مجزا قابل جستجو و طبقه بندی است.    اگر به دنبال خرید خانه یا آپارتمان ویا اجاره خانه هستید از طریق دودوتا به آسانی میتوانید ملک مورد نظر خود را با جستجو خرید خانه  از روی نقشه بیابید. اگر هم از اینترنت کم سرعت استفاده می کنید بهتر است از  خرید یا اجاره خانه  از روی لیست استفاده کنید. سپردن ملک و درج آگهی در دودوتا کاملا رایگان است. برای فروش آپارتمان و یا خانه می توانید به فروش خانه مراجعه کنید و  برای رهن و اجاره خانه  باید به  اجاره خانه   بروید .