Posts

Showing posts from October, 2024

Mixed experience with Cursor IDE

Image
Cursor  is a great IDE, a fork of VSCode with embedded AI. Few things that I really liked about it: 1. The next action completion is great. Adjusting the code across all the files is magnificent 2. The chat function on the side is really helpful too 3. The inference based on the name of the functions is also phenomenal. For example, all I had to do was to write the name of the functions for LCM and GCD, and it wrote all this code for me: Now what I don't like: 4. Tries to be extra smart all the time. It really disrupts the flow, especially if you need time to think about what you need to write. There is a bit of tuning that is needed there The problem was the one below, try installing and playing with it too. Find the Maximum Factor Score of Array - LeetCode 3334. Find the Maximum Factor Score of Array Medium 34 6 Add to List Share You are given an integer array  nums . The  factor score  of an array is defined as the  product  of the LCM and GCD of al...

Simple Key-Value storage usage in AWS::DynamoDB

Image
Many times, all you need is a simple storage in the cloud to store a typical Key-Value pair (which is usually very handy for many applications). The example below does that using AWS Dynamo DB. To exemplify I'm storing there all the lottery numbers since 2002. I'm removing my access ID and secret key - those you need to get from AWS. I find the syntax fairly straightforward and intuitive. Although I didn't try Azure, AWS didn't perform as fast as I expected for the insertion, taking several minutes to add just few thousand records. But it worked, and the code is down below, cheers, ACC. using System; using System.Collections.Generic; using System.Threading.Tasks; using Amazon; using Amazon.DynamoDBv2; using Amazon.DynamoDBv2.Model; using System.IO; class Program { private static readonly string AccessKeyId = "HIDDEN"; private static readonly string SecretAccessKey = "HIDDEN"; private static readonly string TableName = "KeyValueStore...

Claude vs ChatGPT: A Coder's Perspective on LLM Performance

Image
In the rapidly evolving world of Large Language Models (LLMs), recent releases from OpenAI's ChatGPT have garnered significant attention. However, when it comes to coding tasks, Anthropic's Claude.ai continues to impress me with its speed and quality of output. Benchmarking with LeetCode While LeetCode problems aren't the definitive measure of an AI's coding capabilities (they're pre-designed puzzles, after all), they offer an interesting playground for comparison. Let's dive into a recent example: The Problem K-th Largest Perfect Subtree Size in Binary Tree - LeetCode 3319. K-th Largest Perfect Subtree Size in Binary Tree Medium 36 6 Add to List Share You are given the  root  of a  binary tree  and an integer  k . Return an integer denoting the size of the  k th   largest   perfect binary   subtree , or  -1  if it doesn't exist. A  perfect binary tree  is a tree where all leaves are on the same level, and every paren...