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

标签:#python

找到 615 篇相关文章

AI 资讯

Distributing a Python desktop app on Windows and Mac — the full release pipeline

WP Maintenance Manager ships from a single Python codebase to both Windows and macOS. "Python is cross-platform — write once, run anywhere," the saying goes. The reality is that the distribution pipeline is completely separate per OS , each with its own pitfalls. PyInstaller / Inno Setup / Apple Notarization / eSigner — the release cycle is a combination of OS-specific toolchains. Here's the full picture, plus what to watch out for at each step. (The choice of internal architecture, Flask + browser UI, is covered separately in why we built a desktop app on local Flask + browser UI ; this post is about distributing that architecture across two operating systems.) The per-OS pipeline at a glance Step Mac Windows Build PyInstaller ( --target-arch x86_64 ) PyInstaller Distribution format .app bundle → .dmg folder → .exe installer Installer creation hdiutil / create_dmg.sh Inno Setup ( .iss script) Code signing codesign + Developer ID certificate eSigner CSC (cloud signing) Pre-distribution validation Apple Notarization SmartScreen reputation buildup Final artifact WP_Maintenance_Pro_X.X.X.dmg WP_Maintenance_Pro_Setup_X.X.X.exe Both OSes share PyInstaller, but the path diverges from there. Mac sits inside Apple's review process; Windows runs through Microsoft's reputation system. They're fundamentally different ecosystems. Mac — PyInstaller → sign → Notarization → DMG The Intel / Apple Silicon trap The first trap in Mac PyInstaller builds is architecture . Running pip install + python build_app.py on an Apple Silicon Mac without thinking produces native binaries (like cffi ) for arm64 only — which then don't run on Intel Macs at all. The fix is to run the entire build through arch -x86_64 : arch -x86_64 pip3 install -r requirements.txt arch -x86_64 python3 build_app.py That produces an .app containing only x86_64 binaries, which runs natively on Intel Macs and through Rosetta 2 on Apple Silicon — a unified distribution. Sign inside-out The .app PyInstaller produces conta

2026-06-17 原文 →
AI 资讯

Building a Kaggle Competition Notification Bot

I built a tool called "kaggle-dingdong" that automatically fetches Kaggle competition information and sends notifications to Email, Slack, and Discord. It runs daily on a schedule via GitHub Actions, and you get notified whenever a new competition is published. https://github.com/asherish/kaggle-dingdong Why I Built This Checking the Kaggle competitions page every day is tedious. Featured competitions in particular have entry deadlines, so missing them means losing the opportunity. While RSS feeds and official notification features exist, I wanted notifications delivered directly to the channels I actually use (Discord and Slack), so I built my own. Tech Stack Python 3.13 uv — Package manager and build tool (by Astral) Kaggle Python SDK v2.0.0 — Fetching competition info GitHub Actions — Automated daily execution at 09:00 UTC pytest — Testing Three notification channels are supported: Channel Method Format Email SMTP HTML (card layout) Slack Incoming Webhook Block Kit Discord Webhook Rich Embed Architecture GitHub Actions (cron: daily at 09:00 UTC) ↓ Fetch competition list via Kaggle API ↓ Filter by conditions in config.json ↓ Compare with sent history to extract unnotified competitions ↓ Send notifications to configured channels ↓ Update sent history (max 200 entries) The project structure is as follows: kaggle-dingdong/ ├── src/kaggle_dingdong/ │ ├── __main__.py # Entry point │ ├── config.py # Configuration loading │ ├── competitions.py # Fetch & filter competitions from Kaggle API │ ├── email_sender.py # Email notifications │ ├── slack_sender.py # Slack notifications │ ├── discord_sender.py # Discord notifications │ └── history.py # Sent history management ├── tests/ # pytest tests ├── config.json # Filter configuration └── .github/workflows/ └── notify.yml # GitHub Actions workflow Implementation Highlights Fetching and Filtering Competitions The Kaggle SDK is used to fetch the competition list. In addition to the default sort order, it also fetches with recentl

2026-06-17 原文 →
AI 资讯

Fast Automatic ML Hyperparameter tuning Using Optuna (w. MLflow model registry and IRIS DB)

This article presents a straightforward approach to automatically and efficiently tune hyperparameters for machine learning models using Optuna as the optimisation framework. We explore how to use both Optuna’s native storage options and InterSystems IRIS as a database backend to track the progress of hyperparameter searches. We also show how MLflow can be used to monitor experiments and manage models through its tracking and model registry UI. This article is based on this Kaggle Notebook , which you can run and directly edit yourself. When training ML models, the choice of hyperparameters can strongly influence performance. They are not the only factor, but they can significantly affect both convergence and generalisation. Tuning hyperparameters manually takes a lot of effort. This is especially true because hyperparameters interact with each other, so tuning them independently is usually not enough. For example, higher regularisation may require a lower learning rate for more stable optimization. A more complex model may require stronger regularization to avoid overfitting, but at the same time, a very small learning rate on a complex model can make learning too slow. Optuna is an MIT-licensed open source library, which allows commercial use, that automates hyperparameter search for ML models developed with the most popular frameworks such as scikit-learn, PyTorch, TensorFlow, and LightGBM. It works by defining a search space and an objective metric to either minimize or maximize. Optuna then explores the search space efficiently to find well-performing configurations. Here we use Optuna to tune a LightGBM model on a dummy dataset and show how to scale the search using shared database storage. We will also use MLflow for experiment tracking and model registry, and IRIS DB as a possible Optuna storage backend for concurrent studies. We will use the California Housing dataset, commonly used in ML examples, to populate IRIS tables and run the tuning workflow. Note:

2026-06-16 原文 →
AI 资讯

Building an Instagram-powered app without managing scraping infrastructure

When I started building , I needed reliable access to Instagram data. Like many developers, my first instinct was to use a self-hosted solution such as instagrapi. It worked for experimenting, but once I started depending on it for production workflows, I spent more time maintaining the scraper than building features. Eventually I switched to HikerAPI, a hosted REST API for Instagram. This post isn't about saying one approach is universally better—it's about why it ended up being the better fit for my project. My use case I needed to fetch Instagram profile data for . The requirements were fairly simple: Look up public profiles Process structured JSON Integrate the results into my backend Avoid spending time maintaining login sessions I wasn't interested in reverse engineering Instagram every time something changed. Getting started One thing I liked was that it behaves like a normal REST API. Authentication is done through an x-access-key header, so integrating it into an existing Python backend took only a few minutes. import requests headers = {"x-access-key": "YOUR_KEY"} r = requests.get( " https://api.hikerapi.com/v2/user/by/username?username=instagram ", headers=headers, ) print(r.json()) That's enough to start requesting data and integrating it into your own application. If you want to explore the API, you can find it at HikerAPI. Why I moved away from self-hosted scraping I originally tried , including instagrapi. There wasn't a single issue that made me switch—it was the accumulation of small operational problems: Login sessions expiring Accounts getting challenged Temporary bans Instagram changing internal behavior Regular maintenance after updates None of those problems are impossible to solve. The question became whether solving them was the best use of my time. For my project, the answer was no. I'd rather focus on shipping features than maintaining scraping infrastructure. Tradeoffs Using a hosted API isn't free. Pricing starts at $0.001 per request, wi

2026-06-16 原文 →
AI 资讯

Discovering PII Inside InterSystems IRIS

Data privacy regulations such as GDPR, LGPD, and HIPAA demand that organizations know exactly where Personally Identifiable Information (PII) lives inside their databases. Yet in practice, most teams rely on manual inventories, tribal knowledge, or external scanning tools that require data to leave the database engine — a process that itself creates privacy and security risks. This article presents an MVP that takes a different approach: it runs PII detection inside InterSystems IRIS using Embedded Python, analyzing data where it lives and never exporting it to an external process. The result is a lightweight, non-intrusive utility that scans your tables, identifies PII using AI, and produces a structured CSV report — all without data ever leaving the IRIS process. The Problem: PII You Don't Know You Have Organizations today face a painful blind spot. A typical IRIS instance may contain hundreds of tables across dozens of schemas, some holding decades of accumulated data. Columns named ContactInfo , Notes , or Description might silently contain social security numbers, email addresses, or government IDs — sometimes intentionally, sometimes as a side effect of free-text fields that capture whatever users type in. Traditional approaches to PII discovery share a common flaw: they require data extraction. You export samples, send them to an external service, or pipe them through a standalone tool. Every step in that pipeline is an additional attack surface and a potential compliance violation. The principle of data sovereignty — keeping data within its jurisdiction and under controlled access — suggests a better path: bring the analysis to the data, not the data to the analysis. This is not just a technical preference; it is a governance requirement: GDPR (EU) — Article 28 requires that any processing of personal data by a third-party processor be governed by a binding contract covering subject-matter, duration, purpose, data types, and obligations [ Art. 28 GDPR ]. Art

2026-06-16 原文 →
AI 资讯

Small Models, Great Tools: The Engineering Behind a Local AI Agent in Production

There is a persistent myth that to build a worthy code assistant, you absolutely must use GPT or Claude. This is false. You don't need a 1-trillion parameter model. You need a small local model and extremely rigorous engineering around it. This is the direction history is taking for companies. As Mark Zuckerberg mentioned, the future isn't a single omniscient model, but "every company having its own specialized AI" . And this specialization necessarily involves fine-tuning and local deployment (or on sovereign servers) to guarantee data security. The thesis behind the construction of Vibrisse Agent can be summed up in one sentence: Small models, Great tools. In this article, I will detail the technical stack and concrete engineering solutions I implemented to tame a local model and make it reliable in production: LangGraph, Ollama, FastAPI, React (no build step, with embedded custom CSS) , all running on a machine with 32 GB of RAM. For the curious who want to run the agent on their machine right now: // MacOs / Linux curl -sSL https://agent.vibrisse-studio.dev/install.sh | bash // Windows irm https://agent.vibrisse-studio.dev/install.ps1 | iex Architecture: Why a State Machine (LangGraph)? At first, when building an LLM application, we tend to think in sequential chains: Input -> Prompt -> Tool -> Output . The problem is that if one node fails, the whole chain stops without us being able to catch the error or understand the context of the crash. That's where LangGraph comes in. Vibrisse's architecture isn't a chain, it's a state machine . Every node in the graph has a very precise responsibility, shares a global conversation state, and uses conditional transitions to move to the next node. I implemented the Supervisor / Worker pattern: The Supervisor analyzes the user's intent. It does nothing else but route. It dispatches the task to specialized Workers (the RAG Worker, the Search Worker, the Ghost Worker...). If a Worker fails or needs more information, it can se

2026-06-16 原文 →
AI 资讯

Petits Modèles, Grands Outils : L'Ingénierie derrière un Agent IA Local en Production

Il y a un mythe persistant selon lequel pour construire un assistant de code digne de ce nom, il faut absolument utiliser GPT ou Claude. C'est faux. Vous n'avez pas besoin d'un modèle à 1 trillion de paramètres. Vous avez besoin d'un modèle local de taille réduite et d'une ingénierie extrêmement rigoureuse autour de lui. C'est d'ailleurs le sens de l'histoire pour les entreprises. Comme l'évoquait Mark Zuckerberg, l'avenir n'est pas à un modèle omniscient unique, mais à "chaque entreprise avec sa propre IA spécialisée" . Et cette spécialisation passe obligatoirement par le fine-tuning et le déploiement local (ou sur serveurs souverains) pour garantir la sécurité des données. La thèse derrière la construction de Vibrisse Agent tient en une phrase : Small models, Great tools. Dans cet article, je vais détailler la stack technique et les solutions d'ingénierie concrètes que j'ai mises en place pour dompter un modèle local et le rendre fiable en production : LangGraph, Ollama, FastAPI, React (sans build step, avec CSS custom embarqué) , le tout tournant sur une machine avec 32 Go de RAM. Pour les curieux qui souhaitent lancer l'agent sur leur machine dès maintenant : // MacOs / Linux curl -sSL https://agent.vibrisse-studio.dev/install.sh | bash // Windows irm https://agent.vibrisse-studio.dev/install.ps1 | iex L'Architecture : Pourquoi une Machine à États (LangGraph) ? Au début, quand on construit une application LLM, on a tendance à penser en chaîne séquentielle : Input -> Prompt -> Outil -> Output . Le problème, c'est que si un nœud échoue, toute la chaîne s'arrête sans qu'on puisse rattraper l'erreur ou comprendre le contexte du plantage. C'est là qu'intervient LangGraph . L'architecture de Vibrisse n'est pas une chaîne, c'est une machine à états . Chaque nœud du graphe a une responsabilité très précise, partage un état global de la conversation, et utilise des transitions conditionnelles pour passer au nœud suivant. J'ai implémenté le pattern Supervisor / Worker : L

2026-06-16 原文 →
AI 资讯

I cleaned India's Census 2011 data so you never have to

Every Indian data scientist hits the same wall. You need district-level population data. You go to censusindia.gov.in. You find hundreds of inconsistent Excel files with merged headers, footnote rows, and zero documentation. You spend a full day just loading the data before doing any actual analysis. I fixed that. Once. For everyone. What I built indiaset/census-2011 India's Census 2011 district data, clean, typed, and ready for pandas. 640 districts · 29 columns · 0 missing values Validated against official India total · LGD codes attached Load it in 4 lines from huggingface_hub import hf_hub_download import pandas as pd path = hf_hub_download ( repo_id = " indiaset/census-2011 " , filename = " census_2011_districts_final.parquet " , repo_type = " dataset " ) df = pd . read_parquet ( path ) print ( df . shape ) # (640, 29) What's in it Column Description state_code Census 2011 state code state_name Official state/UT name district_code Census 2011 district code district_name District name as per Census lgd_code LGD permanent district code district_name_lgd District name as per LGD pop_total Total population pop_male Male population pop_female Female population pop_under6_total Children under 6 years pop_sc Scheduled Caste population pop_st Scheduled Tribe population literate_total Literate persons literate_male Literate males literate_female Literate females illiterate_total Illiterate persons workers_total Total workers workers_male Male workers workers_female Female workers non_workers_total Non workers literacy_rate Literate / Total × 100 sex_ratio Females per 1000 males workforce_participation Workers / Total × 100 The validation The most important test - do all 640 district populations sum to India's official total? print ( df [ ' pop_total ' ]. sum ()) # 1210854977 ✅ — exact match, zero discrepancy What the data actually shows Most literate district → Pathanamthitta, Kerala : 88.74% Least literate district → Alirajpur, Madhya Pradesh : 28.77% Literacy gap acro

2026-06-16 原文 →
AI 资讯

I Wish I Knew AI Recommendation Sooner — Here's the Full Breakdown

So here's what happened: i Wish I Knew AI Recommendation Sooner — Here's the Full Breakdown Last quarter I burned through about three billable hours debugging a recommendation pipeline for a Shopify client. The thing was — it shouldn't have taken that long. I had the data. I had the API keys. What I didn't have was a clear-eyed picture of what AI recommendation systems actually cost in 2026 when you're paying the bills yourself. If you freelance like I do, every line item matters. My "office" is a kitchen table, my "PM" is a Slack ping at 11pm, and my CFO is whatever's left in my checking account after software subscriptions. So when I say I've been digging into the numbers on AI recommendation systems for the last six weeks, I mean I've been doing it the way I do everything: with a calculator open in one tab and a client invoice in the other. This post is the writeup I wish I'd had before I started. Consider it the field guide for anyone building recommendation features on a budget, on a deadline, or just for fun. Why I Even Cared About Recommendation Systems I took on a small retainer back in February for an indie e-commerce shop that sells specialty coffee beans. They wanted "AI-powered product recommendations" on their storefront — you know, the classic "customers who bought this also bought..." thing, but smarter. The owner had been quoted $15,000 by a "full-service AI agency" to build it. He doesn't have $15,000. He has $15,000 in revenue per month and a wife who is deeply skeptical of his side-hustle energy. So he came to me. And I said yes, because I'm a sucker and also because I knew it should cost a tiny fraction of that quote. The math was never going to support five figures for a recommendation widget. Not when the underlying API calls are fractions of a cent. That's when I started really paying attention to the pricing landscape. The 184-Model Elephant in the Room Here's the thing nobody tells you when you start shopping for LLMs: there are a lot of the

2026-06-16 原文 →
AI 资讯

What Sololearn Got Right (And What I'm Trying to Fix)

I'm not here to trash Sololearn. Sololearn taught millions of people how to code. It was one of the first apps to make programming education feel mobile-native. That's a real achievement. I respect it. But I'm building Codino — a Python learning app — and I'd be lying if I said I didn't study Sololearn carefully before writing a single line of code. I looked at what they got right. I looked at where users complained. And I made decisions based on both. This is that honest breakdown. What Sololearn Got Right 1. The Community Feel Sololearn built a genuine community. The code playground where users share their projects, comment on each other's code, and get likes — that was smart. Learning feels less lonely when other people are doing it alongside you. It created a social loop that kept people coming back even when they weren't actively doing lessons. I haven't built this yet in Codino. The leaderboard is a start, but a full community layer is something I'm thinking about for a future update. 2. Multi-Language Support Sololearn didn't bet on just one language. Python, JavaScript, C++, SQL, HTML — they covered everything. That gave them a massive addressable audience. Codino is Python-only right now. That's intentional — going deep on one language is better than going shallow on ten. But I understand why multi-language eventually matters for scale. 3. The Code Playground The ability to write and run real code inside the app — without going to a browser — was ahead of its time when Sololearn launched it. That feature alone brought back users who had finished all the lessons. Codino has a full offline IDE powered by Sora Editor. I'd argue ours is actually more capable — real syntax highlighting, autocompletion, offline Python execution — but Sololearn deserves credit for proving this feature matters. 4. Bite-Sized Lessons That Actually Work Sololearn understood that people learn on the bus, in bed, waiting in line. Their lessons are short, digestible, and don't demand 45

2026-06-16 原文 →
开发者

I Built a Mini Message Broker in Pure Python and Finally Understood How Kafka Moves Millions of Events

Last year I was on a team that pushed 40 million events per day through Kafka. We had consumer lag alerts, rebalancing incidents, and a whole runbook for when the broker got behind. I understood how to operate Kafka. But I did not understand how Kafka works. So I built a tiny one. No dependencies. No Zookeeper. No JVM. Just Python and the core ideas. Here is what I learned. The Three Things Kafka Actually Does People say "Kafka is a message queue." That is not quite right. Kafka is a distributed commit log . It has three jobs: Accept writes from producers and append them to a log Let consumers read from any offset in that log Remember where each consumer group is up to That third one is the thing that makes Kafka different from a traditional queue. A queue forgets a message once it is consumed. Kafka remembers. You can replay. You can have 10 different consumer groups reading the same topic at different speeds. The code to implement this is smaller than you think. brokelite: A Message Broker in 120 Lines import threading import time from collections import defaultdict from typing import Dict , List , Tuple class Partition : """ Append-only log for one partition of a topic. """ def __init__ ( self ): self . _log : List [ Tuple [ int , bytes ]] = [] # (offset, message) self . _lock = threading . Lock () self . _next_offset = 0 def append ( self , message : bytes ) -> int : with self . _lock : offset = self . _next_offset self . _log . append (( offset , message )) self . _next_offset += 1 return offset def read_from ( self , offset : int , max_count : int = 100 ) -> List [ Tuple [ int , bytes ]]: with self . _lock : return [ ( off , msg ) for off , msg in self . _log if off >= offset ][: max_count ] def __len__ ( self ): return self . _next_offset class Topic : """ A topic is just N partitions. """ def __init__ ( self , name : str , num_partitions : int = 3 ): self . name = name self . partitions = [ Partition () for _ in range ( num_partitions )] def route ( self , k

2026-06-16 原文 →
AI 资讯

How to Track Local SEO Rankings by City with an API

Local SEO rankings are not the same everywhere. Your website may rank in position 2 in Austin, position 8 in Dallas, and not appear at all in Chicago. That is why checking one generic Google result is not enough for local SEO. If you are working on local SEO , agency reporting, competitor monitoring, or location-based search analysis, you need to track rankings by city. A simple workflow looks like this: Keyword + city → SERP API → local search results → ranking check → CSV report In this tutorial, we’ll build a basic Python script that tracks local SEO rankings by city using a SERP API. We will: Define target keywords Define target cities Send city-specific searches to a SERP API Extract organic results Check where a target domain appears Save the ranking data to CSV This is not a full SEO platform, but it gives you the core logic behind many local rank tracking tools. Why city-level rankings matter Google search results are location-sensitive. A query like: best digital marketing agency may return different results in: New York Austin London Singapore Sydney This matters even more for local intent keywords, such as: dentist near me plumber in Chicago coffee shop in Austin real estate agent in Miami For these searches, the result page can include: organic results local packs Google Maps results ads business directories review sites service pages location-specific landing pages If you only check one location, you may miss what users actually see in other cities. For local SEO, ranking data without location context is incomplete. Why use a SERP API? You could try to check Google rankings manually. But that does not scale. You could also try to scrape Google directly, but that brings a lot of maintenance work: changing page layouts CAPTCHA blocked requests proxy handling inconsistent HTML location mismatch parser updates retry logic A SERP API gives you structured search results in JSON. Instead of parsing raw HTML, you get data like this: { "query" : "plumber in Aust

2026-06-16 原文 →
AI 资讯

I Open-Sourced MarketEye — Here's Why (and the GitHub Link)

I open-sourced MarketEye today. For anyone who missed the first post: MarketEye is a self-hosted competitor price monitor I built because I didn't want to pay $99/month for Prisync. The code is now up on GitHub under MIT license. GitHub: github.com/dachengzi065-gif/marketeye Why open source? Three reasons: 1. People actually asked for it. After my first post here, a few people DM'd me asking to see the code. They're developers too — they want to modify it, extend it, make it their own. That's fair. Selling source code to devs is like selling ice to eskimos. 2. Trust. A closed-source price tracker that "runs on your machine" — you either trust the author or you don't. Open source removes that doubt. You can read every line, check what data leaves your machine (nothing), and build it yourself if you want. 3. Longevity. Self-hosted tools have a dirty secret: if the developer disappears, you're stuck with a broken tool. Open source changes that. Even if I get hit by a bus tomorrow, you can fork the repo and keep going. What this means for the $49 version The Gumroad package still exists. It includes: The same code, pre-packaged Email support (I'll help you set it up) A clear conscience subscription (you're paying for convenience, not software) But honestly? If you can run pip install , just clone the repo. It's free. What's next I'm actively working on: Docker image (one-command deploy) More scrapers (plugins for different sites) Discord/Telegram bot alerts (requested by several people) PRs welcome. Issues welcome. Feedback welcome. 👉 github.com/dachengzi065-gif/marketeye

2026-06-16 原文 →
AI 资讯

Build an AI Pipeline FastAPI + Kafka + Workers

Most AI demos work perfectly on a laptop. But production AI systems can become fragile when everything is handled inside one synchronous API call. A user sends a request. The API extracts text. The API chunks the content. The API generates embeddings. The API stores data. The API waits for everything to finish. This may look simple in a demo, but it quickly becomes a problem in real systems. The problem with one giant API call In many AI applications, the API is expected to do too much. For example, in a document processing or RAG pipeline, one request may trigger multiple heavy steps: text extraction chunking embedding generation indexing summarization database updates If all of this happens inside one synchronous request, the API becomes slow and fragile. If one downstream step fails, the complete request may fail. If traffic increases suddenly, the API may become overloaded. This is why event-driven architecture becomes useful for AI workloads. A better approach: API + Kafka + workers Instead of making the API do everything, we can split the workflow into smaller services. The API accepts the request and publishes an event. Background workers consume events and continue the processing asynchronously. A simple flow looks like this: User Request ↓ FastAPI ↓ Kafka / Redpanda Topic ↓ Python Worker ↓ Next Processing Stage In my practical demo, I am using: FastAPI Redpanda Python workers Docker Compose Kafka-compatible messaging Why Redpanda? Redpanda is Kafka-compatible, which makes it useful for local demos and event-driven architecture experiments. It allows us to work with Kafka-style topics, producers, and consumers while keeping the setup simple for development. What this architecture gives us This approach helps with: decoupling services handling bursty workloads moving long-running tasks to background workers improving scalability isolating failures building production-style AI pipelines This pattern is especially useful for AI systems involving: document proce

2026-06-16 原文 →
AI 资讯

Fixing WebSocket Silent Disconnects for Financial Market Data

Intro If you work with real-time financial tick data via WebSocket long connections, you’ve probably run into frustrating hidden issues: Connections show as online, but data stops flowing. Adding/removing trading symbols triggers connection storms. Minor network glitches break your data pipeline without obvious error logs. Today I’ll share a practical Python solution built around single-connection dynamic subscription and heartbeat timeout detection . We use alltick api as our example throughout this post. I’ll cover real production pain points, architecture, full runnable code, common bugs and optimization results. All code can be directly used in your projects. Real Production Pain Points & Background My team maintains real-time data pipelines for stocks, forex and cryptocurrencies. A core requirement is to add or remove monitored trading symbols on demand. At first, we created one independent WebSocket connection for each symbol. This simple approach caused a lot of problems in production: Bulk symbol updates create frequent connection creation and destruction, leading to reconnection storms and high network load. Ghost subscriptions: Data keeps coming even after you send an unsubscribe request. False-alive sockets: The connection status stays connected, but tick data stops completely. Your analysis logic runs on invalid data. We refactored the architecture to use one single persistent WebSocket connection for all symbols, plus an independent thread for heartbeat monitoring. After the upgrade, all hidden connection issues are gone, and the system runs stably under high-frequency data traffic. 4 Common WebSocket Issues in Fintech Let’s break down the most frequent problems when using WebSocket for financial streaming. 1. Connection Flood & Reconnection Storms Rebuilding connections every time you update symbols causes endless handshakes and closures. It wastes system resources and makes the entire data stream unstable. 2. Undetectable False-Alive Sockets Network j

2026-06-16 原文 →
AI 资讯

How to Scrape Google Maps for Local Business Leads (with Emails) - No API Key

If you've ever needed a list of local businesses - every dentist in Manchester, every plumber in Leeds - with their contact details , you've probably hit the same wall I did: Google's Places API is rate-limited, costs money once you scale, and annoyingly doesn't return email addresses at all. Copy-pasting from Maps by hand is soul-destroying past the first ten rows. Most "scrapers" give you the name and a phone number, then stop right where the value starts: the email . This guide shows a practical way to pull structured business data straight from Google Maps and auto-enrich each result with emails, extra phones, and social links - no Google API key, exportable to JSON/CSV/Excel, and callable from code. What you actually get per business { "name" : "Ringway Dental - Cheadle" , "address" : "187 Finney Ln, Heald Green, Cheadle SK8 3PX" , "phone" : "0161 437 2029" , "website" : "https://www.ringwaydental.com/" , "rating" : 5 , "reviewsCount" : 598 , "category" : "Dental clinic" , "lat" : 53.37 , "lng" : -2.22 , "emails" : [ "reception@ringwaydental.com" ], // ← enriched from the website "socialLinks" : { "facebook" : "..." , "instagram" : "..." }, "extraPhones" : [ "..." ] } The first block (name → coordinates) comes from Maps. The emails / socialLinks / extraPhones are the bit that makes a list actually usable for outreach - they're crawled from each business's own website. The fast way: a ready-made Actor Rather than build and babysit the scraping yourself, I packaged this as an Apify Actor: Google Maps Scraper . You give it search terms + locations; it returns enriched rows. Input: { "searchTerms" : [ "dentists" ], "locations" : [ "Manchester, UK" ], "maxPlacesPerSearch" : 50 , "scrapeContacts" : true , "relatedEmailsOnly" : true } That's it. scrapeContacts: true turns on the website crawl for emails/socials; relatedEmailsOnly keeps only emails that belong to the business's own domain (so you don't get random gmail noise). Call it from code (Python) Every Apify Act

2026-06-16 原文 →
AI 资讯

Why we built a desktop app on local Flask + browser UI instead of PyQt or Electron

When you double-click WP Maintenance Manager, it opens a browser tab — and the entire UI lives inside that tab. No native window is created. It's an unusual structure for a first-time user, and the natural question is: "why a browser?" That choice was an intentional design decision when building a Python desktop application. Here's the comparison that led to it, and the side effects of the choice. Four realistic options For a WordPress maintenance automation tool, four implementation styles were practical: Approach UI Distribution size Dev cost Per-OS extra work Native (Swift / WPF) OS-native windows Small–medium High (separate impl per OS) Heavy PyQt / PySide Qt widgets Medium (~80 MB) Medium Light Electron Chromium-embedded web UI Large (~150 MB+) Medium Light Local Flask + system browser System browser tab Small (~50 MB) Medium Light PyQt was a serious early candidate. A Python-only stack is appealing, but widget styling drifts subtly between OSes, Qt's layout system demands constant attention, and resolving Qt plugins under PyInstaller is fiddly. Dev velocity was not where it needed to be. Electron is the industry-standard choice for cross-platform UI, with the big benefit that HTML/CSS-based UIs are quick to write. But the distribution is well over 100 MB, and memory consumption is heavy. For a tool that often runs in the background, that overhead is too much to justify. Why local Flask + browser won The final structure was Flask (Python's lightweight web framework) + the system browser for UI. The decision rested on three axes: 1. The backend had to be Python anyway SSH connections via fabric / paramiko , browser automation via playwright , encryption via cryptography — every library at the core of WordPress maintenance lives in the Python ecosystem. Writing the backend in another language wasn't really an option. If Python is already required on the backend, putting the UI in Python too keeps distribution simple. 2. HTML/CSS/JS makes UI iteration fast Flask r

2026-06-16 原文 →
AI 资讯

Building Perri: A Comic Strip Generator

Meet Perri Comic Generator , a lightweight, single-panel comic creator that merges LLM-driven storytelling with real-time diffusion models. By pairing an Gradio frontend with a high-performance backend, Perri orchestrates a seamless pipeline: it takes a simple story seed, structures it into a panel description, generates the art, and burns the dialogue right onto the final image. The best part? It achieves all of this without massive, resource-heavy infrastructure. Every AI model under Perri's hood is under 32 billion parameters , proving that you don't need giant, compute-heavy models to build something amazing. Here is a look inside the architecture and tech stack that powers Perri. The Technical Architecture Perri is built using a clean separation of concerns, splitting the heavy lifting of generation away from the user interface. 1. The Frontend ( app.py ) Built using Gradio 6.16.0 , the frontend provides a sleek, user-friendly interface for inputting story seeds. To match the creative spirit of comics, the UI utilizes a custom theme, incorporating a vintage aesthetic complete with star-twinkle CSS overlays. The frontend's main jobs are: Capturing the user's initial prompt. Shipping the payload to the backend infrastructure via secure API requests. Decoding the backend's response—a Base64-encoded JPEG—and rendering it within the Gradio image component. 2. The Backend Orchestrator ( orchestrator.py ) The orchestrator acts as the brain of the operation, executing three distinct phases in the lifecycle of a single comic panel: Script Generation: It refines the user's raw prompt into a highly structured visual script and dialogue snippet using meta-llama/Meta-Llama-3-8B-Instruct . Image Generation: It passes the visual description to stabilityai/sdxl-turbo to synthesize the retro comic art. Dialogue Overlay Composition: Instead of relying on separate text captions, the orchestrator dynamically draws the generated dialogue directly onto the JPEG image, ensuring an au

2026-06-16 原文 →