AI 资讯
I built a free AI README Generator (with markdown preview)
Every developer hates writing READMEs. It's boring, repetitive, and always gets skipped. So I built ReadmeAI — describe your project, AI writes the README instantly. What it does Fill in project name, description, tech stack, features AI generates a complete professional README.md Switch between Raw and Preview tabs to see rendered markdown One click copy Tech Stack Next.js + Tailwind CSS Groq API (openai/gpt-oss-120b) Deployed on Vercel Why I built it (Write 2-3 sentences personally — mention the challenge, that you're a student builder, makes it relatable) Live link https://readmeai-three.vercel.app/ Built this in a day as part of my 30-day AI tools challenge. Would love feedback from the dev community!
AI 资讯
Bus + one-wheel last mile: range math that actually matches reality
I started treating a one-wheel like a folding bike replacement for a 3 km bus gap. The spreadsheet looked fine. Real life did not.## What broke my first estimates* Sticker range is not commute range. * Hills, cold mornings, and stop-and-go ate about 3% of the rated number on my route. I now plan at ~6% of brochure range and keep a buffer for a wrong turn. Weight shows up on stairs, not on paper. Carrying the wheel through a station twice a day mattered more than top speed ever did. Rain is a policy decision, not a gear decision. Some days I bail to transit. Pretending I will always ride made me resent the wheel.## A simple checklist I use now1. Measure your worst leg, not your best day.2. Count how many times you pick the wheel up per trip.3. Decide where you charge (home only vs. desk outlet).4. Set a weather cutoff before you are tired and annoyed.## DisclosureI work around electric unicycles professionally, so take this with that bias. I am still trying to optimize my own commute, not sell anyone a model.If you want plain spec tables while comparing wheels: https://www.kingsong.com/collections/electric-unicycle What would you add for mixed transit + one-wheel days?
开发者
I built a free whale tracker for Polymarket — here's what I learned
The problem: I kept missing big moves on Polymarket because I had no way to see what the biggest traders were betting on in real time. So I built WhaleTrack — a free, no-signup tool that shows you exactly what top Polymarket whales are buying and selling. What it does Live whale activity feed — see the last 40 trades from top wallets, updated on refresh Whale leaderboard — P&L, win rate, trade count for the biggest accounts No login, no ads, no fluff — just the data How it works The whole thing is vanilla HTML/CSS/JS deployed on Vercel with two serverless functions: /api/whales.js — hits the Polymarket leaderboard API, fetches position stats for each whale, calculates win rates from closed positions /api/activity.js — pulls recent trades for each whale wallet in parallel, filters out internal combo transactions (no title / zero price), and returns the 40 most recent trades The serverless layer solves CORS — Polymarket's data API doesn't allow browser requests, so everything goes server-side. Tech stack Frontend: Vanilla HTML/CSS/JS (zero dependencies) Backend: Vercel serverless functions Data: Polymarket public data API Deploy: Vercel (free tier) Biggest lesson Filtering bad data is half the work. The raw API returns combo trades and internal transactions that show up as "Unknown Market @ 0¢" — useless noise. Had to figure out which fields to check (title, price > 0) to strip them. Also: win rate calculation is tricky when most whales have unrealized profits. Showing "—" instead of 0% is more honest. Try it WhaleTrack → Also launched on Product Hunt today if you want to show some love: Product Hunt Built this in a weekend. Happy to answer questions about the Polymarket API or Vercel serverless setup.
AI 资讯
"It’s just HTML and CSS. It’s too simple to post."
For a long time, I hesitated to share my work. I kept telling myself: "If I post a simple hero section, a basic Bootstrap grid, or a landing page clone, people will judge me. They’ll think I’m not a 'real' developer yet." But today, I saw a video of a developer who built a complete Netflix clone using only HTML & CSS in just 4 hours https://x.com/Aditwariii/status/1681403710457643009?s=20 . It made me stop and think. It’s easy to get so obsessed with complex frameworks, cloud architectures, and database optimizations that we begin to look down on the fundamentals. But here is the psychology of software engineering that we often ignore: Every master was once a beginner: The engineers managing complex distributed systems today started exactly where we are—struggling to center a div and fighting with CSS media queries. Shipping beats hiding: Building a clean, responsive interface in 4 hours shows speed, focus, and attention to detail. Those are core professional hygiene habits. Code is for humans, not just machines: Before we write APIs or database queries, we must master how a human being actually interacts with our interface. I’m letting go of the fear of being judged for "simple" things. From now on, I am building in public. Whether it’s a massive full-stack application or just a beautifully aligned hero section, it is proof of active practice and continuous momentum. Massive respect to [ https://x.com/Aditwariii?s=20 Check out Aditya Tiwari on X. POLYMATH 🧑💻 sde @IEX_INDIA_ ] for the inspiration and the reminder to keep shipping! 👇 What is a "small" project or layout you built recently that taught you a major lesson? Let's connect in the comments.
AI 资讯
When Old Things Take On New Meaning in the Age of AI (Bite-size Article)
Introduction — On What I've Been Writing for Years This is a follow-up to my previous post on Claude and MCP . Just sharing some recent thoughts. Personally, I've always enjoyed keeping records and analyzing my own work. So for years, I've been logging my daily tasks, jotting down thoughts, hesitations, and impressions in notes. I've drawn on these records for reviews, analysis, and decisions on various projects. The tools have shifted over time — Evernote, Notion, Logseq, Taskuma, and so on — but the habit itself, of writing notes into some app or tool, has stayed with me for years. What Happened with MCP I recently wrote about connecting Notion and Google Docs through MCP, and the results have surprised even me. I won't repeat the details here since they're in that post, but ever since I introduced MCP, the flow of information has accelerated dramatically. In particular, I'd been accumulating reviews, task management notes, and brainstorms in Notion for years, and letting Claude read all of this has shifted the meaning of what I'd previously written. When I first started recording in Notion, it never occurred to me that it might be useful to AI. Of course — I had no way to imagine a time when AI would become this close to everyday life, used in this way. I was just writing for plain, analog reasons — "so I could look back later," "so I could organize my own thinking." But the moment MCP made it all readable, the feeling shifted. It's as if my past self comes forward to help my current self. Claude answers my current questions while drawing on the reasoning behind old project decisions, or on impressions I'd noted at the time. I've had moments like that more than once now. Thinking about it: the human brain's memory has limits — even the person who wrote something forgets it quickly. That's why I kept taking notes, leaving behind my thoughts and conclusions at each point in time as a record. And now, in the flow of conversation, AI reads from those records, distill
AI 资讯
I built a compiler for how AI agents should write to you
I kept correcting AI agents in the same ways: "too long," "answer first," "use a diagram," "assume I know the jargon." Each correction improved the current exchange, but the preference was not represented as durable system state. I built /calibrate-comms to make that state explicit. It is an open-source skill inside an Obsidian vault, used by both Claude Code and Codex. The model: nine operational dials The skill does not try to discover a personality type. It calibrates nine choices that directly change how an answer is rendered: Dial Practical question Density Tight sections or full reasoning? Sequence Answer first or chronological build-up? Modality Prose or diagrams for relational content? Abstraction Concrete example or principle first? Tradeoff One recommendation or several options? Detail Main path or edge cases too? Jargon Define terms or assume expertise? Tone Casual, neutral, or formal? Context-giving Should the agent extract missing context or split an overloaded brief? Prior → calibration → directives The workflow has three stages: L1 PRIOR → L2 SAMPLE REACTION → COMPILE → CLAUDE.md hypothesis empirical override shared by both agents Quick mode asks one bespoke forced-choice proxy per axis. Those questions are deliberately labelled as proxies, not validated psychometrics. Deep mode must fetch the exact items from supported open-access instruments before use; if the source cannot be obtained, the skill stays in Quick mode and makes no validation claim. The prior is then challenged through pairwise samples. For sequence, the contrast looks like this: Build-up first: We traced the latency spike to N+1 queries, then found lazy loading in a loop—so the fix is eager loading. Answer first: Fix: eager-load the association. Why: lazy loading in a loop caused N+1 queries and the latency spike. The user's pick is revealed preference. If it contradicts the prior, the sample wins. The compiler is the useful part The final profile is not a score report. A deterministi
AI 资讯
How We Actually Measure Whether an LLM's Output Is Good - BLEU, COMET and BLEURT
Hello, I'm Shrijith Venkatramana. I'm building git-lrc, an AI code reviewer that runs on every commit. Star Us to help devs discover the project. Do give it a try and share your feedback for improving the product. An AI model writes a paragraph. It sounds fluent. It looks convincing. But how do you know whether it's actually good? This deceptively simple question has occupied researchers for more than two decades. Long before ChatGPT, machine translation researchers faced exactly the same problem. Human evaluation was expensive, inconsistent, and painfully slow. If every new model required thousands of humans to compare translations, research would crawl. That necessity gave rise to BLEU , one of the most influential evaluation metrics in AI history. Years later, as language models became better at paraphrasing and reasoning, BLEU started to show its age. Researchers responded with learned metrics like BLEURT and COMET , which use neural networks to judge language much more like humans do. Interestingly, this mirrors software engineering itself. We first wrote simple unit tests, then integration tests, and today we increasingly rely on sophisticated observability systems. Evaluation metrics for LLMs have undergone a similar evolution. Let's see why. Before BLEU: The Evaluation Bottleneck Imagine you're building Google Translate in 2001. Every time your team improves the model, someone has to read thousands of translated sentences and score them. Suppose a single sentence pair takes only 20 seconds to judge. Evaluating 50,000 sentences would require nearly 280 human-hours . Now imagine dozens of experiments every week. Evaluation—not training—quickly becomes the bottleneck. Researchers at IBM, led by Kishore Papineni , introduced BLEU (Bilingual Evaluation Understudy) in 2002 to automate this process. Their idea was surprisingly simple: If a machine translation resembles what professional translators write, it's probably good. This became one of the most cited papers
AI 资讯
Building a Slack Bot That Actually Remembers: slacktag-oss
How I built an open-source Slack assistant with persistent semantic memory, powered by any LLM and Mem0's managed memory layer — no vector database required. The problem with Slack bots and memory Most AI Slack bots have the memory of a goldfish. Every conversation starts from scratch. You ask it about your sprint goals, it gives a great answer, then three days later you ask a follow-up and it has no idea what you're talking about. You end up re-explaining context constantly. The commercial solution to this is Claude Tag — a Slack integration that maintains genuine conversational continuity. But it's tied to one provider and not open-source. slacktag-oss is our attempt to replicate that experience: a Slack bot with real, semantic, persistent memory that works with any LLM — including ones running entirely on your laptop. What I built A Python Slack bot with: Socket Mode for local dev (no public URL needed), HTTP-ready for prod LangChain to abstract LLM calls across any OpenAI-compatible endpoint Mem0 managed cloud for semantic memory — no Qdrant, no Pinecone, no infra to run Three memory scopes: per-channel, per-thread, per-DM Built-in !clear and !memory commands A clean, extensible architecture you can fork and build on Architecture Before diving into code, here's the full request lifecycle: ┌─────────────────────────────────────────────────────────────┐ │ Slack │ │ @mention in channel ──┐ │ │ DM to bot ──┼──► Slack Events API │ │ Thread reply ──┘ │ │ └───────────────────────────────────│─────────────────────────┘ │ (Socket Mode / HTTP) ▼ ┌─────────────────────────────────────────────────────────────┐ │ slack-bolt (Python) │ │ bot.py ──► router.py ──► handler.py │ │ │ │ │ ┌───────────────┤ │ │ │ │ │ │ ▼ ▼ │ │ Mem0 Client LangChain │ │ (managed) ChatOpenAI │ └────────────────────────────────────────────────────────────-┘ │ ▼ ┌───────────────────────┐ │ Mem0 Managed Cloud │ │ Vector Embeddings │ │ Entity Extraction │ │ Deduplication │ └───────────────────────┘ The ke
AI 资讯
La dictée vocale en français québécois, c'est pas un gadget : c'est un problème de code-switching
J'utilise la dictée vocale tous les jours depuis six mois. Pas pour taper moins vite. Pour penser plus vite quand je vibe-code avec Claude Code et Cursor. Pis j'ai fini par construire mon propre outil parce que les outils existants me tapaient sur les nerfs d'une façon très précise. Le problème réel Quand tu travailles en tech au Québec, tes phrases ressemblent à ça : "OK fa que je fais un useState pour le component pis je passe le handler en props" Ça, c'est une phrase normale. Personne en tech QC ne parle autrement. Pas parce qu'on est négligents avec la langue. Parce que le vocabulaire technique vient de l'anglais et qu'on le soude naturellement au français au fil de la pensée. Ça s'appelle le code-switching. Et c'est là que la plupart des outils de dictée craquent. Ce que les outils mainstream font mal Dragon NaturallySpeaking Dragon, c'est le vieux standard. Médical, juridique, corporate. Ça coûte environ 500$ en une shot. C'est lourd à installer et à entraîner. Et sa gestion du français québécois avec des termes tech intercalés... c'est en gros zéro. "useState" devient "usé état". "Fa que" devient "faque" parfois, "fake" d'autres fois. C'est aléatoire. T'as intérêt à corriger après chaque phrase. Wispr Flow Wispr Flow est plus moderne. UX propre, cross-platform, et leur gestion du français s'est améliorée. Leur plan Pro coûte 15$/mois, soit environ 144$/an. Mais il y a un problème structurel que leur propre doc admet : la détection de langue se fait par session, pas par mot. Autrement dit : Wispr détecte la langue une fois au début de la session. Si tu commences en français, il reste en mode français jusqu'à la fin. Les mots anglais qui arrivent dans la phrase, il tente de les translittérer en français. "Handler" peut devenir "andler" ou "ender", "props" survit parfois, parfois pas. C'est variable. Pour une phrase de temps en temps avec un mot anglais, ça passe. Pour un vibe-coder québécois qui switch constamment dans la même phrase, ça ne passe pas. Pourquoi
AI 资讯
All you need is... (r)evolution!?
This is just an opinion of what I experience and am witnessing, but looking at how LLMs scale feels like I've seen it before: with CPUs trying to outrun Moore's Law and break the rules of physics. Heat, power leakage, and diminishing returns made it increasingly expensive to squeeze out even small gains in clock speed. The GHz race shifted because it had to. For LLMs, more compute, more data, more parameters, and everything just keeps getting better? That curve seems to hit a ceiling and innovation needs to succeed the scaling race now. History does not repeat itself, but it rhymes. What learnings can we make from history to "predict" a potential future? History In the early 2000s, CPUs ran into a wall, a very physical one ^^ So makers adapted. Instead of crunching every single watt out of a single core, multi-cores became common. Athlon 64 x2, Pentium D, PS3 with its heavy Cell approach. From linear to parallel. From sequential to multi-threaded (and funny race conditions ;). Talks of distributed systems, SIMD/MIMD and new benchmarking spawned into what we have today. We still use CPUs, but differently. We still have Memory, but think about Cache, RAM, GPU or Unified. Same same, but different. Innovation because of limitation. Present I feel something similar is about to happen to gen AI. Yes, there are improvements in different areas, some in scaling, some optimisation, some performance, but the slope is becoming slippery. The last 12 months went from "Opus 4.5 is the pinnacle" to "What the hell is wrong with Claude?". The perfect (business) storm of scaling execution! But the low-hanging fruits have been eaten and the crops don't grow as fast anymore. Costs rise quickly, latency becomes a constraint, and even large context windows feel more like extensions than breakthroughs. What remains is more incremental, more expensive, and more complex. You could argue the whole venture of "agents" is the same multi-core experience repeating itself. A different kind of orch
AI 资讯
I Replaced 12 Developer Tools with ChatGPT (Here's What Actually Happened After 30 Days)
I have a confession. Somewhere around day nine of this experiment, I almost quit and went back to my old setup. Not because ChatGPT was bad. Because I was bad at using it. I kept typing half-questions the way I'd type into Google, hitting enter, and getting answers that were technically correct and completely useless. It took me about a week to realize the problem wasn't the tool. It was twelve years of muscle memory. This post is the long version of what happened when I tried to go a full month without my usual stack of developer crutches — Google, Stack Overflow, Regex101, JSONLint, a SQL formatter site, a commit message generator, a pile of bookmarked Docker cheat sheets, and a few other tabs I didn't even realize I kept open until they were gone — and replaced all of it with a single ChatGPT window. I work as a backend-leaning full stack engineer at a small e-commerce company. Python and Django on the server, a chunk of Node for a couple of internal services, Postgres, Docker, and an AWS setup that I inherited rather than designed. Nothing exotic. Which is actually why I think this experiment is useful — most of you reading this aren't working on some bleeding-edge ML pipeline either. You're maintaining stuff, fixing stuff, shipping features under deadlines that someone in another department picked without asking you. So here's what happened. All of it. The good parts, the embarrassing parts, and the parts where I quietly reopened Stack Overflow in an incognito tab because I didn't want my browser history to judge me. TL;DR I tried to replace 12 daily developer tools with ChatGPT for 30 days straight, tracking what worked and what didn't. Google search volume dropped by roughly 70%, but it never hit zero — and I don't think it should. Stack Overflow was the hardest habit to break, and also the one I missed least once I'd broken it. The small utility sites (Regex101, JSONLint, SQL formatters) were the easiest wins. ChatGPT replaced almost all of them outright. Do
AI 资讯
Cursor AI Explained for Beginners: Rules, Skills, Hooks, MCP, Plugins, Automation & Customization (With Real Examples)
When I first started using Cursor AI , I thought it was just an AI-powered code editor. After spending more time with it, I realized it's much more than that. Cursor isn't just about generating code—it's a development assistant that can understand your project, automate repetitive tasks, connect with external tools, and help you build software much faster. If you're new to Cursor, this guide will explain the most important concepts in simple language with real-world examples. 1. What are Rules? Think of Rules as permanent instructions for Cursor. Instead of telling the AI the same things every time, you define them once and Cursor follows them throughout your project. Example Instead of writing this every time: Use TypeScript Use Tailwind CSS Create reusable components Write clean code You can create a rule like: Always use TypeScript. Always use Tailwind CSS. Never use inline CSS. Create reusable components. Write meaningful comments. Now every prompt automatically follows these instructions. Real-world example Imagine you're working in a company where every developer follows coding standards. Rules are those standards—but for your AI assistant. Benefits Consistent code Less repetitive prompting Faster development Better code quality 2. What are Skills? Skills are reusable instructions for specific types of work. Instead of explaining how to build an API every time, you create one reusable skill. Example: Create Express APIs using MVC architecture. Validate all inputs. Handle errors properly. Use async/await. Now whenever you ask Cursor to create an API, it follows that workflow. Real-world example A plumber has plumbing skills. An electrician has electrical skills. Similarly, Cursor can have reusable development skills. Benefits Reusable workflows Consistent architecture Faster feature development 3. What are Hooks? Hooks are automatic actions triggered by an event. For example: You save a file. ↓ Cursor automatically runs: Formatter Linter Tests You don't have to
AI 资讯
Stop using the model as your memory
I run Claude Code most of the day. The thing that kept biting me wasn't the model getting dumber. It was the model forgetting what we'd already settled, then confidently redoing it wrong. You've probably hit it. You write a CLAUDE.md , you keep notes, you tell it "we decided X." A few prompts later it relitigates X, or quietly breaks something it fixed an hour ago. Bigger context windows didn't fix it for me either. A 1M window just means more room for stale instructions to rot in. Here's the reframe that actually held: stop treating the model as the place the state lives. The model is a worker, not a filing cabinet A context window is working memory, not a record. It's lossy, it drifts, and every new turn re-derives the world from whatever's in front of it. If "what's done and what's half-broken" only exists in that window, you're trusting the most forgetful part of the system to remember the most important thing. So I moved the state out of the model and into the work. Two pieces did most of it: A frozen spec the agent re-reads. Not a chat message it might compress away. An actual file that says what we're building and what's already decided. When it starts drifting, the spec is the source of truth, not its memory of the conversation. A checklist it can only tick after something is verified. [ ] becomes [x] when a test passes or I've confirmed the change, never because the model "thinks" it's done. The checklist carries the progress. The model just moves it forward one verified step at a time. The difference is subtle but it's the whole game. Before, the work was a side effect of the conversation. After, the conversation is a side effect of the work. The agent can lose the whole thread and reload from the spec plus the checklist and basically pick up where it left off. A number that surprised me When I actually measured my own sessions, almost none of my tokens were fresh input. The bulk was cache reads and re-reading instructions that hadn't changed. So the "cont
AI 资讯
AI is not replacing developers anytime soon
I'm a professional developer, and AI has significantly increased my output—I'd say by maybe 30 or 40 percent. GitHub Copilot has significantly changed the way I work with code. However, I take pride in producing high-quality code quickly, which is why my rates are high. Using AI helps me increase my output while maintaining that level of quality. My take on AI is that it is not going to replace humans anytime soon. It is, however, putting significant pressure on the economy. Previously, setting up a functional, decent-quality project without much complexity took time—at least weeks. Now, such tasks are incredibly fast and easy; anyone can set them up in a few minutes using AI, even without any coding knowledge. Success in most fields, however, is not just a measure of how fast you can build; it's also about how well you can execute. Current AI can offer advice, but it still cannot execute for you. Market success requires sensitivity, context, and adaptability. AI can help significantly if you know how to ask the right questions. But the economy is made of people, not AI (yet). To earn money, someone must give you money because they value what you offer. The arrival of LLMs hasn't changed this. I feel the pressure. The corporation I work for is pushing for AI adoption, and the initial drawbacks and realizations are already becoming apparent. First point: Customers, at best, don't care about your AI. They don't want it. Second point: AI succeeds at making developers more productive but fails with higher complexity—though not for the reason people usually think. With the right prompt, GPT-5.4 can create fairly complex solutions, even more complex than many corporate business processes. The real reason is that, at a certain level, complexity lies not in the total amount of information in the system, but in how the human aspect of the business translates when you try to formalize higher-level context. This is something most developers don't see (or care about). For examp
AI 资讯
1,200 Applications. 4 Offers. Here's What Actually Got Me the Product-Based Role
I am going to start with a number most people will not say out loud. 1,200 applications. That is how many jobs I applied to over 3 to 4 months trying to switch from a service-based company to a product-based one. I had spreadsheets, saved searches, and browser tabs I kept telling myself I would close tomorrow. Some nights I was applying at 11pm just to hit my self-imposed daily quota. Out of 1,200, I got around 10 interview calls. Out of 10, I got 4 offers. The applications got me in the room. What happened inside the room is what this post is actually about. The One Thing That Followed Me Into Every Interview At my previous company I worked on a lot of things, but one project came up in literally every single interview. We had a Python module that parsed ASAM MDF files. Binary log files from vehicles and sensors, often gigabytes in size. The parser was painfully slow. Around 8 minutes to load a single file. The kind of slow where you start it, go get lunch, and hope it is done when you come back. I rewrote it in Rust. Load time dropped from 8 minutes to 12 seconds. 40x improvement on GB-scale files. Every interviewer stopped me the moment I mentioned it. The questions were real engineering questions, not generic resume stuff. "Why Rust over Go or C++?" "How did you profile the bottleneck first?" "What was your testing strategy when rewriting something this critical?" "What would you do differently now?" I would spend 20 to 30 minutes just on this one project. Not because they were grilling me. Because it was a genuine conversation between two people who cared about the problem. Here is why it worked: I had lived with it. I hit walls in the rewrite that took days to figure out. The context, the wrong turns, the eventual solution were all stored in my head. When a follow-up question came, the answer was just there. You cannot fake that. A first follow-up question exposes a tutorial project immediately. Real work under real constraints creates a depth that no amount o
开发者
Array Methods in JS - Part 2
JavaScript Array Search Methods What are Array Search Methods? Array Search Methods are used to: Find the position (index) of an element. Check whether an element exists. Retrieve an element that satisfies a condition. Find the index of an element that matches a condition. Search from the beginning or the end of an array. Common Array Search Methods Method Purpose Returns indexOf() Finds the first occurrence of a value Index or -1 lastIndexOf() Finds the last occurrence of a value Index or -1 includes() Checks whether a value exists true / false find() Finds the first matching element Element or undefined findIndex() Finds the index of the first matching element Index or -1 findLast() (ES2023) Finds the last matching element Element or undefined findLastIndex() (ES2023) Finds the last matching index Index or -1 1. Array.indexOf() Definition The indexOf() method searches an array for a specified value and returns the index of its first occurrence . If the value is not found, it returns -1 . Syntax array . indexOf ( searchElement ) array . indexOf ( searchElement , startIndex ) Parameters Parameter Description searchElement Value to search for startIndex (optional) Index where the search starts Returns Index of the first matching element. -1 if not found. Internal Working Suppose: let fruits = [ " Apple " , " Orange " , " Mango " , " Orange " ]; Memory: Index 0 → Apple 1 → Orange 2 → Mango 3 → Orange When: fruits . indexOf ( " Orange " ); JavaScript starts from index 0 : Apple ❌ Orange ✅ Found Stops immediately and returns: 1 Example let fruits = [ " Apple " , " Orange " , " Banana " ]; console . log ( fruits . indexOf ( " Orange " )); Output 1 Example - Not Found let fruits = [ " Apple " , " Orange " ]; console . log ( fruits . indexOf ( " Mango " )); Output -1 Example - Start Position let fruits = [ " Apple " , " Orange " , " Banana " , " Orange " ]; console . log ( fruits . indexOf ( " Orange " , 2 )); Output 3 Real-Time Example Suppose an e-commerce site wants to
AI 资讯
JavaScript Arrays Methods - Part 1
What is an Array? An Array is a special object in JavaScript used to store multiple values in a single variable. Instead of creating separate variables, let student1 = " John " ; let student2 = " David " ; let student3 = " Alex " ; we can use an array: let students = [ " John " , " David " , " Alex " ]; Each value inside the array is called an element , and every element has an index starting from 0 . Index : 0 1 2 ------------------------- Array : | John | David | Alex | ------------------------- 1. Array length Definition The length property returns the total number of elements present in an array. It is not a function . It is a property of an array object. It is also writable, meaning you can change the length to increase or decrease the array size. Syntax array . length To modify the array length: array . length = newLength ; Parameters None. Returns Returns a number representing the total number of elements in the array. Internal Working Consider this array: let fruits = [ " Apple " , " Orange " , " Mango " ]; Memory representation: Index 0 → Apple 1 → Orange 2 → Mango length = 3 When JavaScript creates the array, it internally stores a special property: { 0 : "Apple" , 1 : "Orange" , 2 : "Mango" , length: 3 } Whenever you access: fruits . length JavaScript simply returns the value stored in the length property. It does not count the elements every time. This makes length very fast. Example 1 let fruits = [ " Apple " , " Orange " , " Banana " ]; console . log ( fruits . length ); Output 3 Example 2 - Updating Length let numbers = [ 10 , 20 , 30 , 40 ]; numbers . length = 2 ; console . log ( numbers ); Output [ 10 , 20 ] JavaScript removes the remaining elements. Example 3 - Increasing Length let colors = [ " Red " , " Blue " ]; colors . length = 5 ; console . log ( colors ); Output [ "Red" , "Blue" , empty × 3 ] The new positions become empty slots . Real-Time Example Imagine an E-commerce Shopping Cart . let cart = [ " Laptop " , " Mouse " , " Keyboard " ]; co
AI 资讯
🚀 Join the Omnia Community — Contributors Wanted
🚀 Join the Omnia Community — Contributors Wanted Hello everyone, I'm building Omnia , an open-source, privacy-first productivity workspace designed to combine notes, tasks, calendars, habits, goals, reminders, and AI assistance into a single desktop application. The vision is simple: Create the productivity app we all wish existed — fast, beautiful, extensible, local-first, and truly owned by its users. Current Stack React 19 TypeScript Tauri v2 SQLite Zustand Tailwind CSS v4 Tiptap Editor OpenRouter / OpenAI / Ollama What We're Building Omnia aims to become a serious alternative to tools like Notion, Obsidian, and other productivity platforms while remaining: Free and open source Privacy-focused Local-first Highly customizable Community-driven Looking For Contributors Everyone is welcome, regardless of experience level. Frontend Developers Help improve: UI/UX Editor experience Dashboard widgets Accessibility Responsive layouts Rust Developers Help with: Tauri backend Native integrations Performance optimization Security improvements Designers Help create: Themes Icons Illustrations User experience improvements Documentation Writers Help build: Wiki pages Tutorials Guides Developer documentation Open Source Enthusiasts Help by: Testing releases Reporting bugs Suggesting features Participating in discussions Current Priorities Stabilizing the first release Performance improvements Windows support Linux support Plugin architecture Theme ecosystem Export & backup tools Why Contribute? Because this is an opportunity to help shape an ambitious open-source project from the very beginning. Every contribution matters, whether it's a bug report, documentation improvement, design suggestion, or a major feature implementation. If you're interested in building the future of personal productivity software with us, we'd love to have you on board. Let's build something amazing together. 🚀 See you in the repository!
AI 资讯
JavaScript String Methods
A String in JavaScript is a sequence of characters used to store text. let course = " JavaScript " ; 1. String length Purpose Returns the total number of characters in a string. Syntax string . length Example let company = " OpenAI " ; console . log ( company . length ); Output 6 Real-Time Example Checking password length before registration. 2. String charAt() Purpose Returns the character at a specified index. Syntax string . charAt ( index ) Example let city = " Madurai " ; console . log ( city . charAt ( 3 )); Output u Internal Logic M a d u r a i 0 1 2 3 4 5 6 Index 3 contains "u". 3. String charCodeAt() Purpose Returns the Unicode value (UTF-16 code) of a character. Example let letter = " A " ; console . log ( letter . charCodeAt ( 0 )); Output 65 More Examples console . log ( " a " . charCodeAt ( 0 )); Output: 97 4. String codePointAt() Purpose Returns the Unicode code point of a character. Useful for emojis and special symbols. Example let emoji = " 😊 " ; console . log ( emoji . codePointAt ( 0 )); Output 128522 Difference console . log ( " 😊 " . charCodeAt ( 0 )); console . log ( " 😊 " . codePointAt ( 0 )); codePointAt() gives the actual Unicode value. 5. String concat() Purpose Combines two or more strings. Example let firstName = " Annapoorani " ; let lastName = " Kadhiravan " ; let fullName = firstName . concat ( lastName ); console . log ( fullName ); Output Annapoorani Kadhiravan Alternative console . log ( firstName + lastName ); 6. String at() Purpose Returns character at a specific position. Supports negative indexing. Example let language = " JavaScript " ; console . log ( language . at ( 0 )); console . log ( language . at ( - 1 )); Output J t 7. String [ ] Purpose Access characters using bracket notation. Example let laptop = " Dell " ; console . log ( laptop [ 0 ]); console . log ( laptop [ 2 ]); Output D l Difference console . log ( laptop . charAt ( 0 )); console . log ( laptop [ 0 ]); Both return same result. 8. String slice() Purpose Extract
AI 资讯
GitHub Actions Crons That Actually Stay Green
7 daily crons, 2 starvation incidents that triggered the rewrite Health checks before work, not after, catch silent failures Queue-low alarm fires at 5 items, not at zero A cron is ignorable for 3 weeks only when failures are loud I run 7 GitHub Actions crons every day, and for two months I never looked at them. Then a content queue starved silently and I posted nothing for 4 days before noticing. Here is what I changed so a cron can stay green and be ignorable for 3 weeks straight. The Two Incidents That Forced The Rewrite The first starvation happened on a Tuesday. My image generation cron pulled prompts from a queue, made the assets, and pushed them to a publish queue. The image API returned a 429 (rate limited) and the job exited cleanly with a green checkmark. GitHub Actions reported success. The workflow logs said "0 prompts processed" in a line I never read. For 4 days the publish queue drained and nothing refilled it. I found out because a follower asked why I went quiet. The second incident was sneakier. A cron that calls an external API hit an auth token that had expired. The script caught the error, logged it, and returned exit code 0 because I had wrapped the whole thing in a try/except that swallowed everything. Green check, no work done. This one ran for 6 days before I caught it during an unrelated debug session. Both failures shared one root cause: a green checkmark in GitHub Actions means the process exited zero, not that the work happened. Those are completely different claims. A cron that catches its own errors and exits clean is lying to you in the most polite way possible. After the second incident I sat down and wrote out what I actually wanted. I wanted to never look at these workflows unless something was wrong. I wanted "wrong" to be loud. And I wanted the loudness to arrive before the damage, not after. That meant three changes. First, the exit code had to reflect real work, so swallowed exceptions had to re-raise or set a failure flag. Sec