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

标签:#ev

找到 5228 篇相关文章

AI 资讯

Compressing an image to exactly 50KB in the browser, with no server

Indian government exam portals have a rule that has quietly shaped a lot of my code: your photo must be under 50KB . Not "small". Not "optimised". Under 50KB, or the upload is rejected. Every free tool I found for this wanted me to upload the photo to a server, wait in a queue, and create an account. For a file I just wanted to shrink. So I wrote it myself, in the browser. This post is about the actual technique — hitting an exact byte target with canvas — and, honestly, about where my implementation still falls short. The naive version, and why it fails The obvious approach: canvas . toBlob ( blob => download ( blob ), ' image/jpeg ' , 0.7 ); Pick a quality, hope for the best. The problem is that JPEG quality has no predictable relationship to output size. Quality 0.7 on a flat, low-detail portrait might land at 18KB. The same 0.7 on a noisy, high-detail photo lands at 210KB. You cannot compute the quality you need — the encoder decides, and it depends entirely on image content. So you can't calculate it. You have to search for it. Binary search on quality toBlob is cheap enough to call repeatedly, and quality is monotonic — higher quality never produces a smaller file. That's exactly the setup binary search wants. function encode ( canvas , quality ) { return new Promise ( resolve => canvas . toBlob ( resolve , ' image/jpeg ' , quality ) ); } async function compressToTarget ( canvas , targetBytes ) { let lo = 0.05 , hi = 0.95 , best = null ; for ( let i = 0 ; i < 8 ; i ++ ) { const mid = ( lo + hi ) / 2 ; const blob = await encode ( canvas , mid ); if ( blob . size <= targetBytes ) { best = blob ; // fits — remember it, try for better quality lo = mid ; } else { hi = mid ; // too big — back off } } return best ; } Eight iterations over the range 0.05–0.95 narrows quality to about ±0.002, far finer than anyone can see. Each iteration is one encode; on a typical phone photo the whole loop runs in well under a second. Two details that matter more than they look: Keep

2026-07-29 原文 →
AI 资讯

I Built Software for Families Who Share a Holiday Home (So WhatsApp Stops Running the Place)

Sharing a holiday home with family or friends is great until the admin starts. Who’s in next weekend? Did someone already claim Easter? Who was meant to book the cleaner? Where’s the WiFi password / insurance cert / “how to winterize the outdoor taps” note? For most groups this lives in five group chats, a half-maintained Google Calendar, and a Drive folder nobody trusts. I kept running into that pattern — so I built Shared Holiday Homes : software for families, friends, and co-owners who already share a place and need less chaos, not another generic calendar. The problem isn’t “finding a free date” Generic calendars are fine at showing blocks of time. Shared holiday homes need more than that: Double-booking protection that isn’t “hope nobody overwrites the event” Rules for peak weeks, min/max stays, booking windows, and optional approval Fairness visibility — who actually used the place this year Named jobs with owners and due dates (cleaning, maintenance, “fix the pump”) A home for house knowledge — docs, arrival notes, appliance quirks, emergency info If your group is small and high-trust, Google Calendar can work. Once you’re coordinating multiple households, peak seasons, and maintenance, the “calendar + WhatsApp” stack starts creating the arguments it’s supposed to prevent. I wrote a longer comparison here if you want the practical breakdown: Shared Holiday Homes vs Google Calendar What I built (and what I didn’t) The product is intentionally narrow. Private co-owner groups don’t need a full property-management system or a fractional-ownership marketplace. They need an operating layer for one shared house. In scope: One shared booking calendar Booking rules / seasonal rotations Shared task list Document library House guides (the handbook people can actually find) Out of scope on purpose: Selling property shares Matching investors Full bookkeeping / STR channel management That boundary mattered. Every time I was tempted to add “just one more admin feature,” I a

2026-07-29 原文 →
开发者

Samsung’s Galaxy Z Fold 8 feels like the future

Is this the future of foldable phones? Samsung clearly thinks so. The company has given its new wide foldable the "Z Fold 8" name, positioning the phone not as a widescreen oddity, but as the new normal, the default design for foldables going forward. Rumor has it that Apple feels the same way, with a […]

2026-07-29 原文 →
AI 资讯

Handling Asynchronous Webhook Notifications & Callbacks in Joget via BeanShell

Handling Asynchronous Webhook Notifications & Callbacks in Joget via BeanShell When integrating Joget DX with external platforms—such as payment gateways, SMS providers, or ERP systems—requests are often processed asynchronously. The external system accepts a request immediately and dispatches an HTTP POST webhook callback to Joget minutes or hours later when processing completes. Receiving webhook callbacks inside BeanShell API endpoints requires two key tasks: Safe Variable Type Coercion: Handling parameter arrays ( String[] ) versus single strings ( String ) safely without throwing ClassCastException . FormDataDao Persistence: Saving or updating the notification payload inside a Joget form database table using FormDataDao . In this guide, we'll write a defensive Java/BeanShell script that receives asynchronous webhook callbacks and logs them cleanly into Joget. Architecture Overview Webhook Endpoint: An external system hits your Joget API endpoint with callback parameters (e.g. process_id , status , response_payload , recipient ). Type Extraction: A safe helper function handles parameter type variations (whether passed via URL query params or JSON request bodies). FormDataDao Save: Instead of executing raw JDBC queries, the script uses FormDataDao to persist a FormRowSet directly into Joget's form storage engine. The BeanShell Script Place this code inside your API Builder BeanShell script or custom REST endpoint: import org.joget.apps.app.service.AppUtil ; import org.joget.apps.form.dao.FormDataDao ; import org.joget.apps.form.model.FormRow ; import org.joget.apps.form.model.FormRowSet ; import org.joget.commons.util.LogUtil ; import java.util.UUID ; // 1. Safe Type Extraction Helper public String safeExtract ( Object param ) { if ( param == null ) return "" ; try { if ( param instanceof String []) { String [] arr = ( String []) param ; return arr . length > 0 ? arr [ 0 ] : "" ; } if ( param instanceof String ) { return ( String ) param ; } } catch ( Throwable t

2026-07-29 原文 →
AI 资讯

Generating Multilingual HTML Reports with Attachment Download Links in Joget

Generating Multilingual HTML Reports with Attachment Download Links in Joget Creating customized executive report summaries in Joget DX often requires more than simple database lists. Real-world business reports frequently need to join multiple tables, translate status labels based on the user's active locale ( #platform.currentLocale# ), and generate secure file download links for form attachments. In this guide, we'll build a Java/BeanShell script that queries main records and history logs, resolves internationalization ( i18n ) message keys dynamically, and generates interactive HTML reports embedded with secure attachment links. Key Components Dynamic i18n Translation: Uses AppUtil.processHashVariable("#i18n.key#", null, null, null) to convert database status codes into localized text matching the user's language setting. File Attachment Links: Formats secure file download URLs ( /jw/web/client/app/{appId}/{version}/form/download/{tableName}/{recordId}/{fileName} ) so users can open uploaded documents directly from the report summary. Multi-Table SQL Join: Merges main request details, audit transaction history, and custom review tables into a clean HTML document layout. The BeanShell Script Place this code inside a BeanShell Form Bounding Box or an HTML Report Generator tool step: import java.sql.Connection ; import java.sql.PreparedStatement ; import java.sql.ResultSet ; import java.net.URLEncoder ; import javax.sql.DataSource ; import org.joget.apps.app.service.AppUtil ; import org.joget.apps.app.model.AppDefinition ; import org.joget.commons.util.LogUtil ; // Helper: Resolve i18n hash variables dynamically public String getLocalizedText ( String messageKey ) { if ( messageKey == null || messageKey . isEmpty ()) return "" ; String hashVariable = "#i18n." + messageKey + "#" ; return AppUtil . processHashVariable ( hashVariable , null , null , null ); } String recordId = "#requestParam.id#" ; if ( recordId == null || recordId . trim (). isEmpty ()) { return "<di

2026-07-29 原文 →
AI 资讯

I Built 23 PDF Tools That Don't Make You Sign Up, Pay, or Trust a Server

If you've ever used an online PDF tool, you know the routine. You need to merge two files. You find a site. You upload. Then: "Sign in to download." "Free plan: 2 tasks per day." "Your result is ready — with our watermark on it." "Upgrade to remove limits." A five-second job turns into an account, a countdown, and a branded output you can't send to a client. That's the friction that made me build PDFKing — 23 PDF tools in one place, with none of the catches. No sign-up. No watermarks. No daily limits. Nothing to install. The Problem With Most "Free" PDF Tools "Free" almost always has a shape: Free tier, capped at a couple of tasks a day Sign-in wall before you can download Watermark on the output unless you pay File-size limits that push you to a premium plan None of that is about the PDF. It's about converting a person in a hurry into an account. I wanted the opposite: open the tool, do the job, close the tab. No relationship required. The Approach A few principles shaped everything: Every common PDF job in one place — no bouncing between five single-purpose sites Name tools by what they do , not by how the code works Same short flow for all of them — pick, add file, run, download Nothing gatekept — no login, no watermark, no per-day counter What's Actually In It 23 tools, grouped by what you're trying to do. Organise & optimise Merge, Split, Compress, Organise pages, Delete pages, Extract pages, Rotate, plus an Image Compressor for JPG/PNG/WEBP. Convert to & from PDF PDF to Word, Word to PDF, HTML to PDF, JPG to PDF, PDF to JPG, PDF to Text. Secure & sign Watermark, Sign, Redact, Protect (password), Unlock. Edit Crop, Add page numbers, Edit PDF (text, shapes, highlights, annotations), Edit metadata. The ones people hit first: Merge PDF , Compress PDF , PDF to Word , and Sign PDF . Privacy Isn't a Feature, It's the Default With PDFKing: there's no account, so there's nothing to log against you [confirmed on site] there's no watermark added to anything you make [con

2026-07-29 原文 →
AI 资讯

How to Update Joget App Environment Variables Programmatically in BeanShell

How to Update Joget App Environment Variables Programmatically in BeanShell In Joget DX, App Environment Variables are commonly used to store global configuration values—such as API endpoints, tax rates, batch counter sequences, or feature flags. While administrators can update these variables manually through Joget App Center, enterprise workflows often need to update environment variables programmatically (for example, incrementing a daily batch sequence counter or updating an OAuth access token). In this guide, we'll write a short BeanShell script using Joget's EnvironmentVariableDao to fetch and update App Environment Variables dynamically. How It Works Obtain App Context: AppUtil.getCurrentAppDefinition() retrieves the active application definition. Access the DAO Bean: AppUtil.getApplicationContext().getBean("environmentVariableDao") retrieves Joget's internal DAO for environment variables. Load & Update: environmentVariableDao.loadById(envVarId, appDef) retrieves the target variable instance. Modifying .setValue() and executing environmentVariableDao.update(envVar) persists the updated value immediately. The Code Place this BeanShell snippet inside a BeanShell Tool workflow step or a Form Post-Processing Tool : import org.joget.apps.app.dao.EnvironmentVariableDao ; import org.joget.apps.app.model.AppDefinition ; import org.joget.apps.app.model.EnvironmentVariable ; import org.joget.apps.app.service.AppUtil ; import org.joget.commons.util.LogUtil ; public void updateAppEnvironmentVariable ( String variableId , String newValue ) { AppDefinition appDef = AppUtil . getCurrentAppDefinition (); if ( appDef != null ) { // Retrieve Joget's Environment Variable DAO bean EnvironmentVariableDao envDao = ( EnvironmentVariableDao ) AppUtil . getApplicationContext (). getBean ( "environmentVariableDao" ); // Load target environment variable by ID EnvironmentVariable envVar = envDao . loadById ( variableId , appDef ); if ( envVar != null ) { LogUtil . info ( "EnvVar Manager

2026-07-29 原文 →
AI 资讯

Custom Cell Renderers & Action Buttons in Joget Spreadsheet Elements

Custom Cell Renderers & Action Buttons in Joget Spreadsheet Elements The built-in Spreadsheet Element in Joget DX provides a spreadsheet-like interface for managing tabular records inside forms. However, standard spreadsheet columns only support basic text or dropdown inputs out of the box. If you want to add row-level action buttons (like a Delete Row button) or turn plain cell text into an interactive Modal Popup Link , you can supply custom Handsontable renderer functions directly inside your Spreadsheet column properties. In this guide, we'll look at two practical examples: adding a custom row-deletion button and rendering interactive drill-down links. Example 1: Adding a Custom Delete Row Button In your Joget Spreadsheet element, open column properties for an action column and configure the custom renderer function below: {{ renderer : function ( instance , td , row , col , prop , value , cellProperties ) { // Render custom HTML button inside the cell td . innerHTML = " <button type='button' class='btn-delete-row'>Delete</button> " ; td . style . textAlign = " center " ; // Attach click handler to remove the target row from the Handsontable instance const btn = td . querySelector ( " .btn-delete-row " ); btn . onclick = function ( e ) { e . preventDefault (); e . stopPropagation (); // Get underlying Handsontable instance from the form field const hotInstance = FormUtil . getField ( " your_spreadsheet_field_id " ). data ( " hot " ); if ( hotInstance ) { hotInstance . alter ( " remove_row " , row ); } }; } }} Key Highlights: instance.alter("remove_row", row) removes the target row directly from the underlying data model. e.stopPropagation() prevents Handsontable from entering cell-edit mode when the button is clicked. Example 2: Interactive Drill-Down Popup Links To display a clickable link in a grid cell that opens a detailed record inside a Joget modal dialog (popup iframe), use this cell renderer: {{ renderer : function ( instance , td , row , col , prop , va

2026-07-29 原文 →
AI 资讯

The "Launch Spike" is a Memory Leak for Solo Founders. How do we fix this?

We need to talk about the way we launch products, because right now, the architecture is fundamentally flawed. Launching on the standard major platforms today is the marketing equivalent of renting RAM. You get a massive spike in resources on Day 1, it looks amazing on your dashboard, but by Day 30, the garbage collector comes along and wipes your traffic back to zero. I recently dug into the analytics of 2026 SaaS launches, and the reality is brutal: a directory launch is just borrowed reach. You are renting a platform's homepage for 24 hours. Worse, the ecosystem has become a pay-to-win script. Funded startups are paying "launch agencies" $2,000+ to optimize their assets, schedule their upvotes, and game the leaderboards. As solo developers, we don't need a 24-hour spike. We need persistent state . We need SEO and dofollow backlinks. A backlink from a high Domain Authority site compounds over time. A "Product of the Day" badge is just /dev/null a week later. I got so annoyed by this that I started hacking on a concept called Flamas (flamas.io) to see if a "backlinks over badges" model could actually work. The idea is to build a daily board that rewards genuine maker upvotes with permanent SEO value, rather than just a 24-hour traffic burst. But I’m stuck on the system design and need your ideas: If you were building a community-driven launch board from scratch, how would you design the ranking algorithm? What parameters or rate-limits would you use to ensure it stays fair for solo devs and bulletproof against paid bot agencies? Drop your logic in the comments. I’m treating this as an open whiteboard and want to build the solution based on how actual founders think. 👇

2026-07-29 原文 →
AI 资讯

Article: Securing MCP in Production: Defense-in-Depth Beyond the Gateway

This article presents a defense-in-depth approach for securing Model Context Protocol (MCP) deployments in production. It outlines four architectural control layers: safe execution, management infrastructure, outbound trust, and semantic integrity, arguing that production security requires enforcement beyond the gateway at the earliest trustworthy control points. By Nik Kale

2026-07-29 原文 →
AI 资讯

.NET 11 Preview 6 Modernises MAUI CollectionView and Android Shell

Microsoft has released .NET 11 Preview 6 with several architectural and reliability improvements for .NET MAUI. The update brings the next-generation CollectionView implementation to Windows, moves Android Shell toward the handler model, improves Native AOT compatibility, and adds recovery support for interrupted media-picker operations. By Edin Kapić

2026-07-29 原文 →
AI 资讯

How to Replace a Google Form With a Real HTML Form on Your Site

Most guides about Google Forms and your website answer a question you did not ask. Search for how to replace a Google Form with your own HTML and you get three kinds of answer. Embed the iframe but style the container. Use a service that hides Google's branding. Or the clever one: build your own HTML form and point it at Google's endpoint, so responses still land in your existing spreadsheet. All three keep Google Forms in the loop. If that is what you want, they work, and I will show you the third one because it is genuinely useful when you need it. But if you actually want the Google Form gone, replaced by markup you own, here is how that works and what it costs you. One-line summary: Google Forms does one thing your static site can't, accept a POST; swap that for a form endpoint and you get your markup back, at the cost of owning spam and losing free-unlimited. Why the iframe is the problem The embed is an iframe. That means: You cannot restyle it. Your fonts and colours stop at the border. It does not resize with its content, so a long form becomes a scroll area inside your page. It looks like Google on your site, because it is. You inherit its accessibility behaviour and can do nothing about it. None of that matters for an internal survey or a sports club sign-up sheet. It matters a lot on a business site, where a Google-branded iframe reads as a stopgap someone never got round to replacing. The clever workaround, and where it breaks You can POST your own HTML form straight at a Google Form's response endpoint. Open your form, inspect the page, dig the field IDs out of the markup, and build a form whose input names match: <form action= "https://docs.google.com/forms/d/e/YOUR_FORM_ID/formResponse" method= "POST" > <input name= "entry.1234567890" type= "email" required > <textarea name= "entry.9876543210" required ></textarea> <button type= "submit" > Send </button> </form> Responses land in the same spreadsheet. No new service. For a throwaway internal page, thi

2026-07-29 原文 →
AI 资讯

# What I Learned from Building with GIS Data and the Copernicus API at the KijaniSpace Hackathon

As software developers, we often spend most of our time building APIs, databases, authentication systems, and web applications. That's certainly been my focus recently, especially working with Go, JWT authentication, and backend services. Last week, however, I had the opportunity to participate in the KijaniSpace Hackathon , held at Zone01 Kisumu , and it introduced me to an entirely different side of software development. Our challenge was to build solutions using: Geographic Information Systems (GIS) The Copernicus API IoT devices where applicable It was an opportunity to see how software can interact with our physical world. What is GIS? GIS (Geographic Information Systems) is a technology used to collect, analyze, visualize, and manage data that has a geographic location. Imagine not just storing information like: Temperature Population Vegetation Buildings Roads ...but also knowing exactly where that information exists on Earth. That location data allows developers to build intelligent systems capable of answering questions like: Which farms are experiencing drought? Which roads are likely to flood? Which areas are losing forest cover? Where should new infrastructure be built? GIS transforms ordinary data into meaningful geographic insights. Discovering the Copernicus Program Before this hackathon, I had heard very little about Copernicus. Copernicus is the European Union's Earth Observation Programme. It provides free satellite imagery and environmental data collected by the Sentinel satellite missions. Through its APIs, developers can access information about: Land cover Vegetation health Weather patterns Water bodies Air quality Climate changes Disaster monitoring What amazed me most is that much of this data is openly available for developers to build impactful applications. Where IoT Fits In Some teams also explored Internet of Things (IoT) solutions. IoT devices can collect real-world information through sensors measuring: Soil moisture Temperature Humidi

2026-07-29 原文 →
AI 资讯

How to Rescue a Failed Odoo Implementation: A Consultant's Triage Playbook

The call usually comes about eleven months in. Go-live happened, sort of. Finance is still closing the month in a spreadsheet, the warehouse team keeps a parallel notebook, and someone has quietly stopped using the CRM entirely. The system technically works. Nobody trusts it. Odoo rarely fails because Odoo is bad software. It fails because the implementation encoded somebody's misunderstanding of the business into 40 custom modules, and now every fix breaks two things. Panorama Consulting's 2026 ERP Report still puts cost overruns and schedule slippage among the most persistent problems across ERP projects of every size — and in our experience the overrun is almost never in licensing. It's in the rework. Here's the triage sequence we actually run when we inherit a broken deployment, in the order we run it. Step 1: Read the database before you read the code Skip the codebase for a day. Open PostgreSQL and ask the system what people are really doing. A few queries tell you more than a week of stakeholder interviews: Row counts per model over time. If crm.lead stopped growing in March, sales abandoned the module in March. Nobody will volunteer this in a meeting. ir.model.fields where state = 'manual' . Every field created through Studio or a quick patch. A healthy mid-size deployment has a few dozen. We've opened databases with 900. That number is a direct measure of how much undocumented business logic is floating outside version control. stock.quant versus what the warehouse counts. Any gap here means inventory valuation is wrong, which means the P&L is wrong, which is usually the real reason finance went back to Excel. ir_cron last-run timestamps and failure counts. Silently dead crons are behind a surprising share of "the system doesn't update" complaints. Direct SQL writes. Grep the custom modules for self.env.cr.execute with UPDATE or INSERT . Every one of those bypasses the ORM, so computed fields never recomputed and stored values are now lying to you. This ste

2026-07-29 原文 →