今日已更新 344 条资讯 | 累计 37249 条内容
关于我们

标签:#beginners

找到 544 篇相关文章

AI 资讯

Too Many Req: A Bucket List Guide to Building a Rate Limiter

Hello, I'm Maneshwar. I'm building git-lrc, a Micro AI code reviewer that runs on every commit. It is free and source-available on Github. Star git-lrc to help devs discover the project. Do give it a try and share your feedback. Every serious API will eventually tell you to sit down and be quiet. Hammer GitHub, Stripe, or AWS a little too eagerly and your requests start bouncing back with a polite but firm 429 . I always found that fascinating, so let's build the thing that says no. By the end of this post we'll have designed a rate limiter that actually holds up when you put it in front of real traffic, and I promise to only make a reasonable number of bucket puns along the way. A rate limiter does one job: it decides how many requests a client is allowed to make in a given window of time. It protects your system from getting flattened, and it keeps one greedy user from eating everyone else's lunch. Simple idea. Surprisingly spicy implementation. Let's build it up piece by piece, the way you'd actually reason through it in an interview or a design doc. First, what are we even building? Before writing a single line, let's agree on what "good" looks like. Here's my wishlist: Configurable limits. Something like "100 requests per minute per user." The rules should not be hardcoded, because free users and premium users deserve different amounts of pain. Honest rejections. When someone goes over, we return HTTP 429 Too Many Requests and include helpful headers telling them how many requests they have left and when the window resets. No mystery. Barely-there latency. This check runs on every single request , so it has to be fast. Let's aim for under 3ms at P95. If your rate limiter is slow, congratulations, you built a second bottleneck. Highly available and shared. Multiple servers need to agree on the same counts. More on why that word "shared" is doing a lot of heavy lifting later. Cool. Now let's start naive and let reality punch us in the face a few times. Attempt 1:

2026-08-24 原文 →
AI 资讯

From Local Folder to Github: Setting Up my First Project With Git and Github: A Guide

Introduction Managing files locally or manually in your own pc gets out of hand very fast. You might find that you have a file named project_final_1 and project_final_2 which are about the same project but named differently depending on the day the projects were updated or modified. Git Bash is a command line tool that records detailed history of your code as it changes over time GitHub is an online tool where the changes in your code are stored remotely. GitHub does not use folders instead it uses repositories. The repositories make it easier for you to store your work, have a back-up of your work and also showcase your portfolio. Step 1:Installing Git First you have to install git depending on your operating system. Once installed open git bash and you have to tell Git who you are. The code below will help you set up git for the very first time git config --global user.name "put your name here" git config --global user.email "put your email here" After configuration you have to verify your installation with the code below git --version Adding SSH Key For your git to be connected to git hub you have to genarate an ssh key. The key allows your git to access your github without much stress. First you open your terminal or git bash terminal and run the code below to generate the SSH key. ssh-keygen -t ed25519 -C "enter your email here" This code will prompt you on your terminal to save the key on its default location, press enter. Next you will be prompted to enter a passphrase, for easy access and to elimate the chances of forgetting the passphrase you entered just press enter twice. Now you have a public key saved in your pc, use the command below to copy the key. cat ~/.ssh/id_ed25519.pub Adding the Key to GitHub Login into github, click on your profile picture in the top left corner and select settings . in the left navigation bar click SSH and GPG keys . Click the New SSH key button. Give a description of your key (eg .my work laptop), in the drop down menu make

2026-08-23 原文 →
AI 资讯

About Me: Afee Muhammod Wafy

Hello world! 👋 I'm Afee Muhammod Wafy , though most people know me simply as Wafy . I am a science student and self-taught web developer from Rangpur, Bangladesh. If you asked me what truly drives my journey, the answer wouldn't just be lines of code or complex syntax—it is pure, relentless curiosity. The Spark of Building Things From a very young age, I was always fascinated by how things work behind the scenes. Moving into science education naturally shaped how I approach problems: breaking down complex ideas, analyzing the core logic, and finding structured ways to solve them. When I first encountered programming, it felt like having an infinite canvas. I code not because it is an academic requirement or a routine chore, but because there is genuine joy in turning an abstract thought into something functional, accessible, and meaningful to real users. Consistency Over Perfection My learning philosophy is straightforward: stay consistent, stay humble, and never stop exploring . Every bug encountered, every new tool tested, and every experiment with full-stack development, modern APIs, or emerging AI technologies is a stepping stone. I believe true growth comes from getting your hands dirty with real-world problem-solving rather than just absorbing passive tutorials. Why This Journal Exists I started this dev.to journal to document my evolution as a developer in raw, unfiltered detail. Here, I'll be sharing: Real reflections on navigating self-directed learning alongside formal science studies. Honest lessons learned from debugging and architecting digital products. Perspectives on the ever-evolving tech landscape, open-source culture, and developer workflows. Let's Connect The tech community thrives on collaboration and shared knowledge. Whether you're a fellow student balancing studies with code, a seasoned developer, or someone who loves building things—I'd love to hear your story. Portfolio: amwafy.xyz GitHub: github.com/afeemuhammodwafy1 LinkedIn: linkedin.com

2026-08-23 原文 →
AI 资讯

My First GitHub Project: From a Local Folder to GitHub Using Git and SSH

My First GitHub Project: From a Local Folder to GitHub Using Git and SSH Introduction This week I learned how to use Git, Git Bash, GitHub and setting up SSH Keys . Before this, I knew about GitHub but I did not really understand how a project moves from a folder on my computer to GitHub. A simple way I now understand the relationship is: Git manages the history of my project while GitHub provides an online home for the project. In this article, I will explain the steps I followed to create a simple project locally and push it to GitHub. Creating My Project I started by creating a folder for my project using Git Bash. mkdir Kenya-Hospital-Records-Analysis cd Kenya-Hospital-Records-Analysis Inside the folder, I created a README.md file and a folder called data . My project looked like this: Kenya-Hospital-Records-Analysis/ ├── README.md └── data/ The README.md file is where I can explain what my project is about while the data folder can be used to store datasets. In the data folder i uploaded an excel file called Kenyan_Hospital_Health_Records How to use Git The next step was to make Git start tracking my project. I did this using: git init I then used: git status This helped me see which files Git was tracking and which files had not yet been added. To add my files, I used: git add . I then saved the changes to Git using a commit: git commit -m "Initial commit" One thing I learned is that a commit is like saving a checkpoint of my project. The commit message helps explain what changes I made. Connecting Git to GitHub while generating SSH Keys To push my local project to GitHub, I needed a secure way for my computer to communicate with my GitHub account. I used SSH (Secure Shell). I first generated an SSH key on my computer and then added the public key to my GitHub account. An SSH key normally consists of two parts: Private key – stays securely on my computer. Public key – can be added to GitHub. One important lesson was that the private key should never be shared.

2026-08-23 原文 →
AI 资讯

My First GitHub Project: From a Local Folder to GitHub Using Git and SSH.

Introduction The following is a step-by-step process of how i was able create my first GitHub project from a local folder and upload it to Github using Git and SSH. Creating a local folder using git. Using Gitbash, I wanted to see the list of files and directories on my pc. I used the command function ls which enabled me to see them. Since I wanted to create a folder in Desktop under OneDrive, I used firstly cd OneDrive which allowed me to access OneDrive then used cd Desktop allowing me to access Desktop. Basically the command function cd (change of directory) allows one to access a directory that is required while Using cd .. allows one to go to the previous directory. Using mkdir Kenya-Hospital-Health-Records-Project I was able to create a folder under the name Kenya-Hospital-Health-Records-Project. We can use hyphens, underscores and quotes in names that contain more than one word because inclusion of spaces will create separate folders instead of the required one folder. Using cd Kenya-Hospital-Health-Records-Project to access our folder, I created another folder inside it called data using mkdir data . Creating a README file I created Readme file using touch README.md where .md denotes mean Markdown. A Readme file would be able to explain the context of our project on Github and to do this we use the command function echo to print text. I used echo "# KENYA HEALTH RECORDS ANALYSIS" > README.md to indicate title of the README file and using # to indicate it is as the main title. Using echo "## Project Overview" >> README.md I was able to mark it as a sub heading. using > instead of >> would have simply replaced our Tittle an used the subtitle as the main tittle hence I used >> to simply add and not replace. To see the contents we have written so far we use cat README.md . I also incorporated nano README.md to edit some parts where i saw fit to edit. Initializing git Then I used git init which is used to treat the folder as a git repository creating a hidden fol

2026-08-23 原文 →
AI 资讯

Understanding the Git Workflow: Working Directory, Staging, Commit and Push

Working through a practical reference to moving a change through Git took me through the process of taking a single change from my local computer, committing it in Git, and pushing it to GitHub where others would be able to see it. This was written for complete Git Novices and so I approached it without any prior experience of using Git. By the end, you will be able to move a change through all four Git stages and confirm it's visible on GitHub with a clear commit history. Who This Is For Anyone that want to work with Git in the terminal Users who find git add , git commit , and git push unclear No prior Git experience required Prerequisites Git installed ( git --version to check) A terminal or command-line application A GitHub account (create one if needed) We'll use a small sales data project as a running example. You do not need Python or Pandas installeda as we will be only tracking files, not running code. The Four-Stage Flow Every change travels in one direction: Working Directory → Staging Area → Local Repository → Remote Repository Working directory : where everything is worked on Staging area : choosing what goes in Commit : your historical record for everything worked on Push : share it so collaborators can see it Setup: Initialize a Repository Create a project folder and make it a Git repository: mkdir monthly-sales cd monthly-sales git init Expected output: Initialized empty Git repository in /path/to/monthly-sales/.git/ git init creates a hidden .git folder where Git stores the entire history. From now on, Git watches this folder. Usage 1. Working Directory (Untracked Files) Create a raw data file: echo "date,region,revenue" > sales_data.csv echo "2026-01-01,East,1200" >> sales_data.csv Check its status: git status Expected output: On branch main No commits yet Untracked files: (use "git add <file>..." to include in what will be committed) sales_data.csv Untracked means Git can see the file but isn't following it yet. This is the default for new files.

2026-08-23 原文 →
AI 资讯

My First GitHub Project.

Introduction People, especially beginners, face challenges when making changes to their projects and pushing those changes to Github. Some of the challenges faced include Git command, authentification, configuration etc. This article aims to explain the process of building a Github project, from creating local directories/folders to uploading the project to Github using Git and secure shell(ssh). I will use a project titled Poor Performance in 2025 National Exams as a case example to illustrate the steps involved in creating a project. The process is outlined in the following steps: STEP 1: Creating directories The first step of a project is to establish a well organized directory structure. This helps keep project files organized logically, making them easier to manage, access and maintain throughout the development process. We create our project directories within Desktop and OneDrive. Desktop is basically a special directory used by windows to store files and shortcuts while OneDrive is a microsoft's storage store. In our case we start by navigating to the desktop directory using Git. For example, cd desktop means 'go to desktop' Next, Use ls to list all the directories and files in desktop. Once you have navigated the desktop directory, Proceed to making your first project directory. We use mkdir commandto create a new directory. For example, mkdir "Poor-performance-in-2025-National Exam" . Next, we create additional directories within our newly created project directory. In this case we will create a directory called Data, which will store the datasets required for the analysis. For example, mkdir data STEP 2: Creating Files Files are essential part of building a project. In this step, we will create a README.md file. A README.md gives an overview of the project and describes its purpose, structure and usage in a clear and understandable way. README.md is written using Markdown language. we use touch to create files. For example, touch README.md STEP 3: Printin

2026-08-23 原文 →
AI 资讯

MY FIRST GITHUB PROJECT

Introduction In this article I will explain my practical experience of creating Git repository,connecting it to GitHub using SSH,commiting my files and pushing the project to a remote repository. Step 1 :Creating My Local Project The first step is to create a folder through file explorer which as the best option for me and name it (my-project) Next step was to open GitBash and run the command cd my- project To open the file directory Step 2 : Initializing Git This is to tell Git that my my-project folder should become a Git repository. To initialize Git I ran the command: git init Step 3:Repository Status Check After initializing Git, I used : git status This command is very useful as it can be used throughout the process it tells what's happening inside my repository. At some point people may encounter: On branch main Nothing to commit, working on a tree clean It could seem like an error,however I learned that this means Git has checked my project and found no changes that need to be committed. Another situation that I encountered is where Git told me that the older my project was already initialized .This taught me to use the command: git status To understand the current status of my project. Step 4:Connecting GitHub Using SSH The next thing I learnt was on how to generate SSH key which will be used to connect my computer securely to GitHub. To generate an SSH key I ran the command: ssh-keygen -t ed25519 -C "your_email@example.com" Under the double quotes use the email used for your GitHub account. Then press entre to save it on the default location. You'll then be told to enter passphrase which is simply a password,create a simple one which you can memorize easily like 1234.Then entre it again when asked. You then start the SSH agent Run; eval "$(ssh-agent -s)" Then add your SSH keyy Run: ssh-add ~/ .ssh/id_ed2559 It will ask you to entre the passphrase you created. Copy your public key y running the command: cat ~ .ssh/id_ed25519 .pub Add the entire line generat

2026-08-22 原文 →
AI 资讯

PR#1: Make SurrealDB performance slightly better

At the first step, I picked up the SurrealDB project for contribution. I didn't know how I could help this project become better. So I asked my beautiful OpenCode to find parts of the project that could be better. It suggested this file of the project(core/src/val/value/get.rs) to me and said it has a double-cloning issue. So I opened up VS Code, and I started checking the issue. The code was something like this: let mut a = Vec :: new (); for v in v .iter () { let cur = v .clone () .into (); if stk .run (| stk | w .compute ( stk , ctx , opt , Some ( & cur ))) .await .catch_return () ? .is_truthy () { a .push ( v .clone ()); } } First Optimization: As you can see at line 3 and line 9, we have multiple clones from a single document. I thought about how I could fix this issue; I went to see the CursorDoc structure because the first clone is converted to it: #[derive(Clone, Debug)] pub ( crate ) struct CursorDoc { pub ( crate ) rid : Option < Arc < RecordId >> , pub ( crate ) ir : Option < Arc < IteratorRecord >> , pub ( crate ) doc : CursorRecord , pub ( crate ) fields_computed : bool , } impl From < Value > for CursorDoc { fn from ( val : Value ) -> Self { Self { rid : None , ir : None , doc : val .into (), fields_computed : false , } } } #[derive(Clone, Debug)] pub ( crate ) struct CursorRecord { /// The underlying record, shared via Arc for copy-on-write record : Arc < Record > , } impl CursorRecord { // .... // /// cloning. Otherwise the value is cloned. pub ( crate ) fn into_owned ( self ) -> Value { match Arc :: try_unwrap ( self .record ) { Ok ( record ) => record .data , Err ( arc ) => arc .data .clone (), } } // .... // } impl From < Value > for CursorRecord { fn from ( value : Value ) -> Self { Self { record : Arc :: new ( Record :: new ( value )), } } } I saw that the value passed through CursorDoc is directly stored in a field in CursorRecord without any changes, and it is accessible using .into_owned() from CursorRecord. That is the solution; I edited the

2026-08-22 原文 →
AI 资讯

Understanding the Git workflow

Introduction Hello,I'm currently a data science student and this is my understanding of git workflow, from creating folders on my local computer to adding files, pushing and having them on my github repository. Working directory This is the active folder created in the local machine which will have all the files related to the project. We can create a folder on terminal by following the steps, -Launch your terminal -cd desktop :this is to ensure that we are in the desktop folder -mkdir data :this is to create a new folder on desktop -touch school.py :this is to create a python file inside the data folder -git status :this tells us the repository we are working in Staging This allows us to prepare to save the files that we have created. We can save a specific file or all files at once. For example;assuming we have three different files eg.schools.py ,books.py ,teachers.py -git add . :this saves all the files in the folder -git add schools.py :this saves only the schools files Commit This allows us to save the files from the staging step. .git commit -m "creating schools files" .git commit :saves the files to git hub .-m :this is a message that explains the change that happens in the folder ." " :this briefly explains the change that happened Push This allows us to move our work from our local computer to git hub. git push origin main ;origin points us to our online git hub while main is the name of the branch where we are making the changes

2026-08-22 原文 →
AI 资讯

How to Review AI-Generated SQL Before You Trust the Number

An AI assistant will write you a query in ten seconds, the query will run, and the number that comes back will look completely reasonable. This page gives you the five checks that tell you whether that number is right. They take about two minutes, they need no tools beyond the database you already have, and they catch the four mistakes AI-written SQL actually makes. The order matters. The checks are arranged cheapest first, so the first one costs a single row count and the last one costs a short conversation. Most wrong queries fall to the first two. The short version. A query that runs has only passed a grammar check. The number is right when the rows, the filters and the denominator match the question you asked. The database only takes a query as far as the first gate. Why a query that runs can still be wrong Before the list: what do you think the database actually checks when it accepts a query? Grammar. That is the whole list. Spell a table name wrong and you get an error. Sum the wrong column, join in a way that doubles rows, or filter after grouping when the question needed it before, and you get a clean result set with a wrong number in it. Every mistake on this page is valid SQL. AI assistants add one specific difficulty: their queries are fluent. The aliases are tidy, the formatting is clean, and the shape looks like something a careful person wrote. Fluency reads as correctness, and it is not the same thing. Treat an AI query the way you would treat a first draft from a new colleague: with respect, and with the row counts open. The table the examples run on Everything below runs on one small shop dataset, so every number can be checked by hand. Thirteen orders in July, five customers, and a refunds table where two orders were refunded in two parts. Eleven of the thirteen orders are completed; one is refunded, one is pending. There is also a staff_accounts table listing internal accounts, and it contains one NULL row, because real lookup tables usually do.

2026-08-22 原文 →
AI 资讯

How to Practice SQL Online With Nothing Installed (And Where Your Data Goes)

By Michael Nocito , data analyst · Published August 8, 2026 By the end of this page you will be running real SQL against a real database with nothing installed, and you will know which of the free browser tools suits which job. You will also know the thing none of them puts on the front page: some of them run entirely inside your browser, and some upload whatever you paste to a stranger's server. That difference decides what you are allowed to practise on. Here is what to actually do today. If you want a database already loaded and questions already written, open sql-practice.com . If you want to create your own tables and share the result with someone, open DB Fiddle . Both start working immediately with no account. The short version: browser-only tools keep your data on your machine, server-backed tools do not, and neither kind is the right place for anything from work. Where the data goes is the one idea that should drive your choice, so it gets the picture. The original carries a diagram here. In words: Two panels side by side, each drawn as a laptop outline containing a browser window. In the left panel a small data box sits inside the browser window, with a short circular arrow looping back into itself, showing the data never leaves the laptop. In the right panel the same data box has a long arrow leading out of the laptop, across a gap, and into a separate server rack drawn beyond the laptop's edge, with a copy of the data box now sitting in the rack as well. The original box remains, showing the data has been copied out rather than moved. Every tool below was opened and checked on 8 August 2026. These sites change often, so the descriptions describe what was actually on screen, and anything I could not confirm by looking is not claimed here. 1. Run your first query, right now Before the explanation: what do you think has to exist on your computer for a SELECT statement to return rows? The honest answer is nothing at all, and that surprises people who have sp

2026-08-22 原文 →
开发者

Where to Get a Sample Database to Practice SQL (And How to Check It Loaded)

By Michael Nocito , data analyst · Published August 8, 2026 By the end of this page you will have a real database sitting on your own computer, with 11 tables, 3,503 tracks and 412 customer invoices in it, and you will have run a query that proves every table arrived intact. Then you will run a join across two of those tables, which is the thing a single spreadsheet can never teach you. It takes about five minutes and costs nothing. Here is what to actually do today. Download the Chinook database file, open it in DB Browser for SQLite, and run one query that counts the rows in every table. If the counts match the ones printed below, you have a working practice environment and you can stop shopping for one. The short version: get Chinook_Sqlite.sqlite , open it, count the rows, then join two tables. Northwind and Sakila are the other two names you will see, and there is a table further down saying when each is the right pick. The reason a sample database beats the CSV you already have is one idea, so it gets the picture. The original carries a diagram here. In words: Two panels side by side. The left panel holds a single grid of rows and columns, standing alone with nothing attached to it. The right panel holds four smaller grids arranged around each other. A highlighted column at the edge of each small grid is joined by a solid line to a matching highlighted column on a neighbouring grid, so all four grids are wired together into a connected shape. The left panel has no lines at all, because there is nothing for a line to reach. Every number on this page is real. I downloaded Chinook v1.4.5 and Northwind on 8 August 2026 and ran each query with SQLite 3.51.1. The counts, the outputs and the row multiplication are what came back, not what should have come back. If you have no database software at all yet, how to set up a SQL database is the fifteen-minute version of that step, and this page picks up right after it. 1. Why one CSV is not enough Before the explanation:

2026-08-22 原文 →
AI 资讯

UNDERSTANDING THE GIT WORKFLOW

Git is a version control system. Version control, also known as source control, is the practice of tracking and managing changes to software code. Version control systems are software tools that help software teams manage changes to source code over time. Git is used for: Tracking code changes Tracking who made changes Coding collaboration Setting up a new Repository A Git repository is a folder that Git tracks for changes. The repository stores all your project's history and versions. Add files to the folder. The following describes how to set up a new repository: Git Init Initializes git user@localhost $ git init This creates a hidden folder called .git inside your project. This is where Git stores all the information it needs to track your files and history. To see which files are in your project folder, use the ls command: user@localhost $ ls To Check if Git is tracking your new files: user@localhost $ git status The files here could either be tracked or untracked:- Untracked Files Files you've created or copied into the folder, but haven't told Git to watch. Tracked Files Files that Git is watching for changes. To make a file tracked, you need to add it to the staging area. Git Staging Tells Git exactly which files you want to include in your next commit. user@localhost $ git add . Common Commands git add . Stages all new, modified, and deleted files in the current directory and its subdirectories. git add <file> Stages a specific file. git add -A (or --all) Stages all changes across the entire repository, regardless of your current folder location. git add -u Stages modifications and deletions of already-tracked files, ignoring completely new (untracked) files. git add *.txt Stages all files matching a specific pattern (e.g., all text files). Git Commit A commit is like a save point in your project. It records a snapshot of your files at a certain time, with a message describing what changed. user@localhost $ git commit -m " Describe your changes" Pushing Chan

2026-08-22 原文 →
AI 资讯

My first website said "Don't commit without context." I never committed it at all.

The renewal notice came and I decided to let it go. threadkeeper.io was my first idea and my first website. I bought the domain in August 2025, about six weeks after a community college AI summer camp where I was writing files with names like ccc-ai-pdf-project and describing them in my own README as a beginner Python project. Then I shipped a domain, a blog, a CLI, and a manifesto. Before I let it lapse I went back to look at it one more time. Sentimental. Five minutes, tops. Then I tried to figure out where the source code lived, and realized it did not live anywhere. The site was on Spaceship. I had built it there, in the browser, and never put it in version control. Not once. There was no repo to clone, no local folder, no backup. The only copy of my first website that existed in the world was the one running on a server I had four days left on. The tagline on that site, in cyan, at the top of the page, was "Don't commit without context." I never committed it at all. I did not have the source code to my own website So the first job was not nostalgia. It was extraction. I pulled all eight pages and every asset off the live server before it went dark: the landing page, the blog, three posts, the Dr. Kahlo page, and the Ariadne Clew recap app I built for an AWS hackathon. Nineteen files. sitemap.xml claimed there were four pages, which tells you how much I trusted my own sitemap in 2025. The rest I found by following links. That archive is now public, with a SHA-256 for every original file so anyone can verify nothing drifted in the rescue: earlgreyhot1701d.github.io/threadkeeper-archive It is committed now. A year late. I named a file dom_js.js and did not blink Here is the first thing I found once I could actually read my own code. The Ariadne Clew app had seven JavaScript modules. Two of them were named with snake case and a suffix: api_js.js , dom_js.js , main_js.js . Four were camelCase with no suffix: utils.js , theme.js , exportMarkdown.js , dragDrop.js . Tw

2026-08-22 原文 →
AI 资讯

Code Smell 321 - Getter Piggybacking

One broken window invites another TL;DR: Don't reuse an existing getter to bolt on new business logic from outside the object. Problems 😔 Duplicated business rules Broken encapsulation Scattered comparison logic Hidden domain knowledge Fragile refactoring Law of Demeter violation Solutions 😃 Add real behavior methods Keep comparisons inside object Pass collaborators, not primitives Reserve getters for rendering Follow tell, don't ask Refactorings ⚙️ Refactoring 027 - Remove Getters Maxi Contieri Maxi Contieri Maxi Contieri Follow Apr 18 '25 Refactoring 027 - Remove Getters # webdev # programming # beginners # java 3 reactions Add Comment 17 min read Refactoring 013 - Remove Repeated Code Maxi Contieri Maxi Contieri Maxi Contieri Follow Jun 16 '24 Refactoring 013 - Remove Repeated Code # webdev # beginners # programming # tutorial 2 reactions Add Comment 3 min read Context 💬 An object exposes a getter for one legitimate reason: some other part of the system needs to read that value, usually to display it. Getters are a code smell, but this one gets a pass, for now. Later on, you discover that you need new business logic that depends on the same value. You already have the getter, so you write a function outside the object that calls it and does the comparison itself, breaking the encapsulation principle. Someone else needs slightly different logic based on the same value. They also call the getter and write their own version of the comparison. Now two places decide what that value means , and neither of them is the object that owns it. Typical. You didn't add a second getter this time. You reused the first one, because it was already there. That's the trap. The getter existed for one reason, and you let it justify skipping the real fix: a method on the object that answers the question itself, instead of handing out the raw value for every caller to interpret on their own. Sample Code 💻 Wrong 🚫 // Food needs to show its use-by date on the shelf // label, so useByDate(

2026-08-21 原文 →
AI 资讯

Debugging a Windows Desktop App That Opens to a Blank Screen

A blank application window is not a diagnosis. It is only a symptom that tells you the process reached a different stage than an installer that never launched. The most useful first step is to stop applying fixes and record what Windows is actually doing. 1. Define the failure boundary Treat these as separate cases: No window and no lasting process: investigate the installer, security blocking, architecture, and missing runtime dependencies. A window frame appears but the content area is blank: investigate the rendering layer and online content initialization. The entire window stops responding: capture hang evidence instead of reinstalling a rendering runtime. The UI appears but sign-in or online panels spin forever: check network and account services separately. This boundary prevents a common mistake: diagnosing every white or empty interface as a WebView2 failure. 2. Record the process tree Close the application completely, including any tray process, then start it once. Open Task Manager and note the start time of the main process. Check whether child processes such as msedgewebview2.exe appear at the same time. The presence of a WebView2 process is evidence that the runtime participates in the session. Its absence does not automatically prove that WebView2 is broken; the application may have failed before reaching that stage or may use another rendering stack. 3. Check the installed WebView2 version without downloading anything On Windows, the Evergreen Runtime version can often be read from registry locations under EdgeUpdate. The exact location can vary by installation scope. Use read-only inspection first, and confirm that a non-empty version value is present. Do not install several copies from random download pages. If repair is eventually necessary, use Microsoft's distribution channel and document the version before and after the change. 4. Correlate the failure with Windows logs Reproduce the blank window once, then open Event Viewer and inspect entries

2026-08-21 原文 →
开发者

My First GitHub Project: From a Local Folder to GitHub Using Git and SSH

Getting your folder or file to github can be a bit of an off vibe due to the many steps especially if it's your first commit, but getting these steps right will make it easy for the other folders or files you will push afterwards.Let’s dive in CREATING A LOCAL FOLDER Depending on the OS you are using you can use Git Bash or the Terminal. For Linux which is what I am using I will use the Terminal First Step Start by creating a folder in the terminal: mkdir your project folder name . then change directory: cd ~/to the folder you have just created Now we need to format our folder by creating a few files inside it Data file README.md code file if you will be using code. To check if you have created these files inside your folder: run:, ls This calls out all the files that are inside your folder. Let's tackle the files we have just added. Data Folder Run command: mkdir data This creates a data folder. This is where you will add your data e.g Excel or CSV files that you will be using to run your analysis or your project. README.md Run command: touch README.md This where you will give an overview of your work, the reason you are doing the analysis,how you collected your data,the tools you used to run the analysis..Basically README.md is a file that guides anyone who goes through your analysis or project on the steps you took while doing your analysis or project.Think of it as the introduction at the start of your favourite book or novel. To write all of this you will run the command echo "#give your project a name or describe your project" >README.md README.md uses markdown language reason for the # at the beginning of the quotation.When writing the headings or subtitles use capital letters or proper style. For subtitles you need to add two ## at the beginning. If you want to write more content without overwriting what you have previously written inside the README.md file you will need to use double greater signs(>>) at the end of the quotation,run: echo #your message” >>R

2026-08-21 原文 →