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

标签:#Java

找到 1193 篇相关文章

开发者

I built 38 free browser-only tools that never upload your files

Every time I needed to "compress an image online" or "merge a PDF", I ended up on some site that makes you upload your file to their server. For a random meme, fine. For a contract, an ID scan, or anything private? No thanks. So I built QuickKit — a growing kit of 38 free tools that run 100% in your browser. Your files and text never leave your device. No signup, no watermarks, no tracking of what you process. How it works (the fun part) The whole thing is a static site — no backend, no database, no server cost. Everything happens client-side with browser APIs: Image compressor / resizer → the Canvas API ( canvas.toBlob(type, quality) ) Image → PDF / Merge PDF → jsPDF and pdf-lib, entirely in-page Password / UUID generators → the Web Crypto API ( crypto.getRandomValues ) for real cryptographic randomness QR codes → generated locally, no redirect or tracking baked in Hash generator (SHA-256/1/512) → the SubtleCrypto API Countdown timer & "days since" counters → shareable via the URL itself (state encoded in query params), so there's still no backend Because nothing is uploaded, the tools are faster and more private than upload-based services — and they even work offline once loaded (it's an installable PWA). A few of the tools Files & docs: image compressor, image resizer, image→PDF, merge PDF. Dev utilities: JSON formatter, Base64, hash generator, UUID, timestamp converter, case converter. Everyday: QR generator, word counter, unit/percentage/age calculators, world clock, "your life in weeks". The privacy architecture, in one line If the browser can do it, there's no reason to send the user's data to a server. That principle killed all the usual costs (no servers, no storage, no compliance headaches) and made privacy the default instead of a feature. Would love feedback — especially on tools you wish existed. What "online X converter" do you use that you wish ran locally? 👉 quickkit.space

2026-08-02 原文 →
AI 资讯

Where to Publish a Web Game in 2026

A finished browser game is a bundle of static files. Whether you built it in Phaser, Three.js, Babylon.js, Godot, or plain canvas code, the output uploads anywhere, which is exactly why the publishing decision trips people up. Every channel accepts the same build, so the choice is never technical. It is about who owns the audience, who owns the money, and who owns the URL. Here is how the three channels actually compare once you have shipped to all of them. The Three Channels Game portals aggregate thousands of titles, monetize with ads, and share revenue. Indie platforms like itch.io act as storefronts you control, with community feedback attached. Self-hosting on your own domain gives you everything except an audience. Most developers who do this well use more than one at the same time. The marginal cost of adding a channel is usually just reading the submission guidelines and wiring up an SDK, so treating them as either/or leaves reach on the table for no reason. What Portals Actually Require CrazyGames reaches over 20 million monthly players and runs a two stage process. Basic Launch takes your game with minimal integration and tests it with a limited audience for around two weeks. Hit their engagement benchmarks and you are invited to Full Launch, which needs the full SDK for ads, auth, cloud saves, and analytics. Their technical bar for Basic Launch is an initial download under 50 MB, fewer than 1,500 files, and PEGI 12 content. Poki is curated and editorially reviewed, leans mobile-responsive, and pulls strong search traffic with a younger audience. GameDistribution syndicates across hundreds of publisher sites through an embed widget, so you get reach but little brand visibility. Newgrounds still rewards experimental work with a community that engages rather than an SDK that monetizes. The trade in all four cases is the same: the portal brings the players, and in return it owns the player relationship and can change terms whenever it wants. Self-Hosting With

2026-08-02 原文 →
AI 资讯

From Skewer to Screen — A Tandoori Paneer Landing Page

This is a submission for Frontend Challenge - Comfort Food Edition, Perfect Landing * What I Built: * I built Ember & Spice which is an interactive landing page celebrating Tandoori Paneer Tikka, one of North India's most iconic comfort foods. The site is built for a fictional restaurant of the same name and brings the dish to life through immersive visuals and interactive features. * The page includes: * A hero section with an aesthetic AI-generated tandoori video A sizzle effect — click the Sizzle button and sparks fly across the image An interactive skewer builder where you stack paneer, peppers, and onions then grill them A spice dial slider that visually changes the marinade heat from Mild to Fiery A CSS-art tandoor oven that roasts your built skewer An ingredient tasting plate — click cards to add items A recipe checklist with a live progress bar A reservation form with client-side validation Fully responsive, mobile-first design with scroll-reveal animations Demo: ** Live site* : https://tandoori-paneer.vercel.app/ **Github *: https://github.com/jogadiyadipak28-art/tandoori-paneer * Journey: * I chose Tandoori Paneer Tikka because it's the kind of dish that carries memory (PS: It's my favorite dish) the smell of charcoal, the bright orange marinade, skewers shared at family gatherings. I wanted the page to feel as warm and alive as the dish itself. The most fun part was building the interactive Kitchen Lab, the skewer builder, spice slider, and tandoor oven are all pure vanilla JS and CSS, no libraries. Getting the tandoor CSS art to glow and the skewer pieces to animate onto the rod was deeply satisfying. I'm particularly proud of the sizzle effect, clicking the button sends 16 spark particles flying across the hero image and story photo, with a brief brightness flash. It's a small touch but it makes the page feel reactive and alive. What I learned: How powerful IntersectionObserver is for scroll-reveal without any libraries. CSS aspect-ratio for keeping the

2026-08-02 原文 →
AI 资讯

The Comfort Atlas: What Does Home Taste Like?

This is a submission for Frontend Challenge - Comfort Food Edition, Perfect Landing What I Built The Comfort Atlas is a spinning 3D globe of comfort food from ~100 countries. Virtually travel the globe and have a taste of the comfort foods from 100~ countries. Moussaka in Greece, Jollof Rice in Nigeria, Pho in Vietnam. There is also a "featured dish of the day" that rotates deterministically so it's the same for everyone visiting that day. And the fun feature: visitors can type in their own comfort dish and generate a downloadable, passport-stamp-style card in one of three color styles. Demo https://comfort-atlas.netlify.app/ Journey I started with a flat SVG world map, clickable countries, keyboard support, a hover tooltip on the map, all built on real elements so accessibility came for free. It worked fine, but it looked very meh. So i decided to try something i have never done before. Make a globe! I used cobe which promised a 3D globe out of the box. First attempt rendered absolutely nothing but floating dots. 😂 With a lot of the help of my friend claude, we found out that their docs are outdated, and there is not a createGlobe() draws exactly one synchronous frame and expects you to drive a requestAnimationFrame loop calling .update() yourself. Two things on the globe I'm especially proud of, because neither had any library support: a hover tooltip that tracks a marker in 3D space, and a fading "trail" of great-circle arcs between the countries you've visited. Both came down to translating the projection math out of a minified bundle into something readable, then reimplementing it myself. What I would do next: dark mode. What I learned: a lot about accessibility in 3D/canvas, which is so much more difficult than the 2d one, one check for a11y is never enough. Maps are hard, and getting something to track a moving 3D object from regular DOM is even harder. Licensed under MIT Fun fact: I don't like Moussaka, even though i am greek, my comfort food is Pizza. xD

2026-08-02 原文 →
开发者

Stop Unnecessary Re-renders in React: A Practical Guide to Faster Applications

Introduction React is fast, but that doesn't mean every React application is. One of the most common performance problems—especially in growing applications—is unnecessary re-rendering . A small project with a few components may feel instant, but as your application grows, unnecessary renders can cause sluggish interfaces, input lag, excessive CPU usage, and poor user experience. The good news is that unnecessary re-renders are usually preventable once you understand why React re-renders components . In this article, we'll explore how React rendering works, learn how to identify performance bottlenecks, and apply practical optimization techniques such as React.memo , useMemo , useCallback , better state management, and component architecture. Whether you're building dashboards, e-commerce stores, SaaS products, or portfolio websites, these techniques will help you write more efficient React applications. Table of Contents Understanding React Rendering What Causes Unnecessary Re-renders? Identifying Performance Problems Optimizing with React.memo Optimizing Expensive Calculations with useMemo Preventing Function Recreation with useCallback State Colocation Splitting Components Optimizing Context Rendering Large Lists Using the React Profiler Best Practices Common Mistakes Performance Tips Security Considerations Accessibility Considerations SEO Considerations Real Project Example Conclusion Discussion Background Before optimizing anything, it's important to understand what React actually does. A render simply means React executes your component function to determine what the UI should look like. That does not always mean the browser updates the DOM . React compares the new Virtual DOM with the previous one and only updates the parts that actually changed. However, if many components re-render unnecessarily, React still has to: Execute component functions Recreate objects Recreate arrays Recreate event handlers Compare Virtual DOM trees All of that work adds up. Step

2026-08-02 原文 →
AI 资讯

My determinism test passed for months while the two builds played different games

I compiled the rules engine of a shipped Android game to the browser. Same Java, two compilers. Then I checked whether the two agreed. They did not — and the test I already had for exactly this had been green the whole time. The same command twice: green against the current engine, then against the committed recording of the broken build. Play it as a terminal session if you want to select the text. The setup The rules live in one module with no Android on its classpath, which is what let me compile them a second time with TeaVM and run the same logic on a canvas in a browser tab. A seeded run should be reproducible. Give the engine seed 42 and a fixed sequence of inputs, and you should get the same game every time — that is what makes a run replayable and two builds comparable. Here is what I actually got, same seed, same inputs: JVM browser first obstacle x, frame 60 405.426 304.426 still alive at frame 360 yes no final score 9 6 Not a rounding difference. A different game. The cause is boring. The test failure is not. GameEngine used java.util.Random . Its algorithm is specified down to the constants — you can read the exact linear congruential generator in the Javadoc. So a seed ought to name exactly one sequence. But my code was not running that algorithm. It was running whichever implementation the runtime supplied , and TeaVM's is not the JVM's. The specification describes what java.util.Random does; it does not force a foreign runtime's reimplementation to match. The fix took ten minutes: write the LCG out longhand so both builds execute the same arithmetic instead of trusting that they will. The interesting part is the test. The test that could not have caught it I had a test called theSameSeedProducesTheSameRun . It ran the engine twice, with the same seed, and asserted the results matched. It passed on every commit, including every commit during which the browser build was playing a different game. It had to pass. It runs the engine twice in the same runt

2026-08-01 原文 →
AI 资讯

Building Fast Websites for Pakistan's Real Network Conditions (Not Just a Lighthouse Score)

It's easy to test a site on office fibre, get a 95+ Lighthouse score, and call performance "done." Then someone in a secondary city mentions the site feels slow on their phone, and the gap between tested performance and real performance becomes obvious. This isn't a Pakistan-specific problem in theory, but it's an unusually common one in practice — a large share of real users here are on congested 3G or throttled 4G, on mid-range Android devices, often outside the main metros where infrastructure is best. If you're building for a Pakistani (or generally emerging-market) audience, "works great in the office" isn't the same as "works great for the actual user." Here's what actually moves the needle, beyond just plugging in a CDN. A CDN helps, but it doesn't fix the last mile A CDN gets your assets physically closer to the user, which helps. But if the connection between someone's phone and the nearest edge node is still a congested 3G link, the CDN's job is basically done — the bottleneck is the last mile, and no amount of edge-caching fixes that. What actually helps is reducing how much has to travel down that last mile in the first place. That reframes the whole problem: less about "getting bytes there faster" and more about "sending fewer bytes." 1. Image weight is usually the biggest offender Images are typically the single largest contributor to page weight, and the fix isn't exotic: // Next.js example — explicit width/height prevents layout shift, // and the Image component serves modern formats automatically import Image from " next/image " ; < Image src = "/hero.jpg" alt = "Product hero shot" width = { 1200 } height = { 630 } priority // only for above-the-fold images /> A few concrete habits that add up: Serve WebP/AVIF instead of raw JPEG/PNG where you can — usually 25-50% smaller at equivalent visual quality Always set explicit width / height (or use a framework component that does it for you) so the browser doesn't shift layout while images load — this als

2026-08-01 原文 →
AI 资讯

React Mastery Series – Day 2: What is React and Why Was It Created?

Welcome back to the React Mastery Series . In Day 1, we introduced the roadmap of this series and discussed what we will cover — from React fundamentals to enterprise-level architecture. Today, we will start with the most important question: What is React, and why was it created? What is React? React is an open-source JavaScript library for building user interfaces , especially single-page applications (SPAs). It was created by engineers at Meta (Facebook) and was initially released in 2013. React focuses on one core idea: Build complex user interfaces by breaking them into small, reusable components. Instead of creating a complete application as one large piece of code, React encourages developers to divide the UI into independent and manageable components. Example: A banking application dashboard can be divided into: Dashboard │ ├── Header │ ├── AccountSummary │ ├── TransactionList │ ├── TransferMoneyForm │ └── Notifications Each part can be developed, tested, and maintained independently. Why Was React Created? Before React, developers commonly used traditional JavaScript and libraries like jQuery to update web pages. For small applications, this approach worked well. But as applications became larger, several challenges appeared. 1. Managing Complex UI Updates Imagine a banking application where: Account balance changes Transactions are updated Notifications appear User profile information changes With traditional DOM manipulation, developers had to manually find elements and update them. Example: document . getElementById ( " balance " ). innerHTML = " $5000 " ; As the application grew, managing thousands of DOM updates became difficult. React introduced a different approach: Describe what the UI should look like, and React manages the updates. The Problem With Direct DOM Manipulation The browser provides the Document Object Model (DOM), which represents the HTML structure. Example: HTML | DOM Tree | Browser Rendering When we update the DOM frequently: Browser

2026-08-01 原文 →
AI 资讯

Converting a JavaScript-Rendered Web Page to PDF

If you've ever tried to turn a modern web page into a PDF programmatically, you've probably hit the wall: the file comes out blank, half-empty, or frozen on a loading spinner. The page looks perfect in the browser, so what gives? The answer is timing. Most PDF approaches grab the HTML before the JavaScript has rendered the content. On a server-rendered page that's fine — the markup is already there. On a React/Vue/Angular app, the server sends an near-empty shell and the browser builds the DOM afterward. Capture too early and you save the shell. Here's how to do it properly. Why the naive approaches fail wkhtmltopdf is the classic Google answer. It's fast and it's been around forever, but it uses an ancient WebKit build with effectively no modern JavaScript support. For a static page it's fine. For anything client-rendered, it captures the empty state. Browser window.print() / Ctrl+P works because it is a real browser — but it's manual, single-page, and impossible to automate cleanly at scale. Hitting the raw HTML with an HTTP client (axios/fetch then pipe to a PDF lib) has the same fatal flaw as wkhtmltopdf : no JS execution, no rendered content. What you actually need is a real browser engine that runs the page's JavaScript, waits for it to settle, and then prints. That's Puppeteer. The Puppeteer approach Puppeteer drives a headless Chromium. It executes the page exactly like a normal Chrome tab, so whatever renders on screen is what you capture. const puppeteer = require ( ' puppeteer ' ); async function pageToPdf ( url , outPath ) { const browser = await puppeteer . launch ({ args : [ ' --no-sandbox ' , ' --disable-setuid-sandbox ' ], // needed in most containers }); const page = await browser . newPage (); await page . goto ( url , { waitUntil : ' networkidle0 ' , timeout : 60000 }); await page . pdf ({ path : outPath , format : ' A4 ' , printBackground : true , // otherwise CSS backgrounds/colors are dropped margin : { top : ' 20px ' , bottom : ' 20px ' , left

2026-08-01 原文 →
AI 资讯

Build a Spanish WhatsApp booking landing page with plain HTML, CSS, and JavaScript

Many independent service businesses already use WhatsApp to confirm appointments. The missing piece is often a small, clear landing page that answers the obvious questions before the first message: what is offered, how much it costs, and what a visitor should do next. I built a dependency-free Spanish booking-page pattern around that handoff. The booking flow A useful booking page does not need a heavy scheduling stack to start doing its job. Its core flow can be simple: Show a small set of services with understandable prices and durations. Put a clear call to action on every relevant section. Open WhatsApp with enough context that the owner does not have to ask the same first question again. Keep the page fast and editable. The key implementation detail is generating the WhatsApp link from a service-specific message: const phone = " 56900000000 " ; document . querySelectorAll ( " .whatsapp-link " ). forEach (( link ) => { const message = link . dataset . message ; if ( message ) { link . href = `https://wa.me/ ${ phone } ?text= ${ encodeURIComponent ( message )} ` ; } }); That lets a CTA such as “Reserve a hair ritual” arrive as a message like “Hola, quiero reservar el Ritual de cabello.” It is a small interaction, but it removes friction for both the customer and the business. Design choices that help Mobile-first layout: appointment links are frequently opened from a phone. Visible prices and durations: clearer expectations usually mean better-quality enquiries. Short FAQs: rescheduling, location, and confirmation are common blockers. Semantic HTML: headings, buttons, and disclosure details work without a framework. No fake live contact details: the phone number, copy, price, and social links are clearly marked for replacement. Live demo You can inspect the working beauty-studio demo here: WhatsApp Booking Landing Kit — Interactive Demo Editable bundle I also made the complete editable source available as a paid digital kit. It now includes three standalone Spani

2026-08-01 原文 →
AI 资讯

Day 166 of Learning MERN Stack

Hello Dev Community! 👋 It is officially Day 166 of my full-stack engineering track! Today, I designed and implemented the active messaging canvas component ( ChatContainer.jsx ) for my messaging app, QuickChat ! 💬📷⚡ Focusing on dynamic chat alignment, text bubble rendering, image attachments, and input controls was today's core milestone. Here is how I structured the component. 🛠️ Technical Breakdown: ChatContainer & Attachment Pipeline As captured in my UI and VS Code setup ( Screenshots ): 1. Dynamic Alignment & Sender Detection Conditioned flexbox directions based on authentication state so sender messages lock to the right while recipient messages render on the left: javascript

2026-08-01 原文 →
AI 资讯

How to structure a Chrome Extension with Manifest V3 (the right way)

If you've tried building a Chrome extension recently, you've probably hit Manifest V3 and spent an hour just figuring out why your background page stopped working. MV3 replaced background pages with service workers, changed how content scripts communicate, and made permissions stricter. The official docs are... not great. So here's the structure that actually works. The folder structure chrome-extension/ ├── manifest.json ├── popup/ │ ├── popup.html │ ├── popup.css │ └── popup.js ├── options/ │ ├── options.html │ └── options.js ├── content/ │ └── content.js ├── background/ │ └── service-worker.js ├── utils/ │ └── storage.js └── icons/ The manifest.json (MV3) The biggest MV3 gotcha: background scripts are now service workers. { "manifest_version": 3, "name": "Your Extension", "version": "1.0.0", "permissions": ["storage", "activeTab", "scripting"], "action": { "default_popup": "popup/popup.html" }, "background": { "service_worker": "background/service-worker.js" }, "content_scripts": [ { "matches": [""], "js": ["content/content.js"] } ] } Communicating between popup and content script This trips up almost everyone. The popup can't directly access the page DOM — it has to message the content script. // popup.js const [tab] = await chrome.tabs.query({ active: true, currentWindow: true }); await chrome.tabs.sendMessage(tab.id, { type: 'RUN_ACTION' }); // content.js chrome.runtime.onMessage.addListener((message, sender, sendResponse) => { if (message.type === 'RUN_ACTION') { // do something on the page sendResponse({ success: true }); } return true; // keeps the channel open for async response }); The return true at the end is critical — without it, async responses silently fail. Storage that syncs across devices Use chrome.storage.sync instead of localStorage. Here's a utility wrapper that makes it clean to use anywhere: const Storage = { async get(key) { return new Promise((resolve) => { chrome.storage.sync.get([key], (result) => resolve(result[key])); }); }, async set

2026-08-01 原文 →
AI 资讯

**Soul & Spoon — Comfort Food Landing Page**

--- title : " Perfect Landing — Soul & Spoon (Comfort Food Edition) — Research Summary" published : false tags : [ " frontend" , " html" , " css" , " javascript" , " accessibility" , " performance" , " react" , " svelte" ] cover_image : " https://images.unsplash.com/photo-1543353071-087092ec393a?q=80&w=1600&auto=format&fit=crop&ixlib=rb-4.0.3&s=3" canonical_url : " " series : " " --- Perfect Landing — Soul & Spoon Research Summary A concise, ready-to-paste DEV post that summarizes the research, design decisions, technical choices, and next steps for the Soul & Spoon landing-page project — a warm, accessible, performance-minded single-page site celebrating soul food. What I Built Soul & Spoon — Comfort Food Landing Page is a single-page landing site that showcases soul-food plates with a polished, modern frontend. The static prototype includes: Hero with a full-bleed background and clear CTAs. Featured dishes section with responsive cards and descriptive copy. Gallery of soul-food plates with a keyboard-accessible lightbox. Contact form with client-side validation and toast feedback. Responsive, accessible, and performant implementation using semantic HTML, picture / srcset /WebP, lazy loading, and minimal JavaScript. Research Summary and Rationale Design goals Evoke warmth and comfort through color, rounded shapes, and soft shadows. Prioritize readability and hierarchy for quick scanning on mobile and desktop. Keep interactions simple and predictable: smooth scroll, accessible modal, and unobtrusive toast notifications. Accessibility findings Semantic elements ( header , main , section , figure , figcaption , footer ) improve screen-reader navigation and SEO. Keyboard operability is essential: gallery images must be focusable and open via Enter/Space; Escape should close the lightbox. ARIA attributes ( aria-hidden , aria-expanded , role="dialog" ) plus focus management significantly improve modal usability. Performance findings Images dominate page weight; srcset an

2026-07-31 原文 →