Brandonz | 不烂凳子

  • 活在自己的世界的人 The Kind of Person Who Lives in Their Own World

    常常有人在背後碎嘴,說我活在自己的世界。People always say behind my back that I live in my own world. 我只能說一句,活得開心就好,不需要經過你們的批准。Well, let me tell you – so what if I do? At least I’m happy, and I’m not living according to other people’s expectations.

    愛管閒事的人到處都有,尤其是那種連自己的人生都搞不清楚,卻愛評論別人生活方式的。Busybody people everywhere – especially those who don’t even know what to do with their own life, but want to tell others how to live theirs. 什麼叫「應該這樣」、「不應該那樣」?人生又不是固定的流程表。What is “must do like this”, “cannot do like that”? Life not some SOP lah.

    現實的人總是急著跳過基礎,連一加一等於二都算不好,卻想一步登天背乘法表。Realistic people like to act smart, but even simple math also fail – don’t even understand 1 plus 1 equals 2 properly, but want to jump straight to multiplication.

    結果勒?一乘一永遠等於一,永遠只有自己,無法成長。End up forever stuck with 1 times 1 equals 1. Always alone, never grow.

    反倒是那些敢想、愛夢、會幻想的人,才真正懂得 一加一可以等於三 的秘密。But the ones who dream big, think out of the box, imagine more – they’re the ones who know the secret of 1 plus 1 equals 3.

    因為他們知道,創造力 + 想像力,再加一點行動力,就可以多出一個新的世界。Because when you mix creativity + imagination + a bit of action, you get something more than just the sum of parts. You get magic.

    活在自己的世界,不是逃避,而是選擇。I live in my own world not because I’m lost, but because I choose to. 而在這個世界裡,我不需要別人的地圖,我自己畫。

    So next time someone says you’re “in your own world”, just smile and say: “Yah, at least I got my own world. You leh?”

  • 打造整合式 AI 生态系統:利用 n8n 进行流程自动化

    在今天快速发展的数码环境中,人工智能(AI)已经成为各种系统整合中至关重要的一环,以提高效率和改善用户体验。然而,实施 AI 不仅仅是部署一个模型,它需要一个周密的生态系统,无缝地处理数据流、模型服务和互动。在本篇博文中,我们将探讨“圈养 AI”的概念以及像 n8n 这样的工具在这个生态系统中自动化流程中扮演的关键角色。

    Understanding the Overall Architecture Design

    目标是通过开源工具打造一个管理数据流、模型服务和互动界面的封闭式 AI 系统。关键模块包括 AI 服务部署、数据管理、如 n8n 的流程自动化工具、用户界面以及安全和监控机制。

    Tool and Technology Selection

    – AI 服务:利用外部 API(如 OpenAI GPT)或部署本地开源模型(例如 Hugging Face Transformers).

    – 数据存储和处理:使用 MySQL、PostgreSQL、Redis 和 MongoDB 等数据库进行结构化和非结构化数据存储。使用 Python 脚本或 Apache NiFi 等 ETL 工具进行数据清洗和转换.

    Process Management and Task Scheduling

    – 选择工具如 n8n、Apache Airflow 或 Node-RED 来管理数据流和任务自动化.

    User Interface and Interaction

    – 前端框架:React、Vue.js;后端框架:Node.js、Flask、Django.

    Implementation Steps

    1. Establish Infrastructure: Deploy databases, AI model services, configure automation tools like n8n, and set up security measures. – 建立基础设施:部署数据库、AI 模型服务,配置 n8n 等自动化工具,并设置安全措施.

    2. Design Data Flow: Define data formats, sources, and responsibilities of each module within the system. – 设计数据流:定义系统内每个模块的数据格式、来源和责任.

    3. Development and Testing: Write scripts for data cleaning, configure workflows in n8n, test performance and reliability. – 开发和测试:编写数据清洗脚本,配置 n8n 中的工作流程,测试性能和可靠性.

    4. Deployment and Maintenance: Containerize deployment using Docker or Kubernetes, configure monitoring systems, and update AI models and tools regularly. – 部署和维护:使用 Docker 或 Kubernetes 实现容器化部署,配置监控系统,定期更新 AI 模型和工具.

    Let’s continue to harness technology to shape a smarter and more connected world! 让我们继续利用技术,打造一个更智能、更互联的世界!

  • 硬编码与非硬编码:Web 应用开发者的经验教训

    png image from pngtree.com/

    在不断发展的 Web 开发领域,开发者面临的一个基本决策是采用硬编码还是实现非硬编码的动态方法。这一决策会影响项目在时间、质量控制、成本和可扩展性方面的成功。让我们通过 WebbyPage 的发展历程深入了解硬编码与非硬编码的实际应用。


    The Solo Dev Journey: WebbyPage’s Start

    独立开发者的旅程:WebbyPage 的起点

    当我在2012年成立WebbyPage时,我起初是一名没有经验、没有资金、没有后备资源的独立开发者。他们最初的项目主要依赖于硬编码解决方案,因为这种方法简单且实施速度快。硬编码为 WebbyPage 带来了以下好处:

    • Quickly Prototype: By embedding static values directly into code, projects were brought to life rapidly.

      • 快速原型开发: 通过将静态值直接嵌入代码中,项目可以迅速成型。
    • Reduce Initial Costs: Without the need for additional tools, frameworks, or complex integrations, the approach saved time and expenses.

      • 降低初始成本: 不需要额外的工具、框架或复杂的集成,从而节省了时间和费用。

    独立开发者使用硬编码的挑战:

    1. Limited Flexibility: Changes to hardcoded values required manual updates in multiple places, leading to a higher chance of errors.

      • 灵活性有限: 修改硬编码值需要在多个地方手动更新,这增加了出错的可能性。
    2. Poor Scalability: As project demands grew, the hardcoded structure became a bottleneck for adding features.

      • 可扩展性差: 随着项目需求的增长,硬编码结构成为添加功能的瓶颈。
    3. Time Drain on Maintenance: Debugging and modifying hardcoded solutions consumed significant time, affecting the ability to handle multiple clients.

      • 维护耗时: 调试和修改硬编码解决方案耗费了大量时间,影响了处理多个客户的能力。

    WebbyPage soon realized the limitations of hardcoding and transitioned to building a basic framework—a non-hardcoded approach—to handle repetitive tasks like database connections, form validations, and authentication.


    The Leap to Team Development: Quality Control and Collaboration

    向团队开发迈进:质量控制与协作

    As WebbyPage grew into a small dev firm, team collaboration became essential. In team settings, non-hardcoded practices proved invaluable::

    Advantages of Non-Hardcoding in Team Environments:

    团队环境中非硬编码的优势:

    1. Improved Quality Control: Using configuration files, templates, and dynamic scripts ensured consistency across the codebase. Team members could focus on logic rather than manually updating static values.

      • 提升质量控制: 使用配置文件、模板和动态脚本确保代码库的一致性。团队成员可以专注于逻辑,而不是手动更新静态值。
    2. Ease of Collaboration: Non-hardcoded solutions—such as shared environment files or modular components—allowed multiple developers to work independently without conflicting changes.

      • 协作便利: 非硬编码解决方案(如共享的环境文件或模块化组件)使多个开发者能够独立工作而不会产生冲突。
    3. Faster Onboarding: New team members could quickly adapt to a framework’s structure rather than decipher hardcoded values scattered across files.

      • 更快的入职: 新团队成员可以快速适应框架的结构,而无需解读分散在文件中的硬编码值。

    对于 WebbyPage 来说,实施集中式框架不仅简化了协作,还使公司能够高效扩展业务。


    Time, Quality Control, and Cost: Balancing the Trade-Offs

    时间、质量控制与成本:权衡取舍

    Hardcoding:

    硬编码:

    • Time: Faster for one-off or simple projects.

      • 时间: 对于一次性或简单项目来说更快。
    • Quality Control: Error-prone when making updates.

      • 质量控制: 更新时容易出错。
    • Cost: Cheaper upfront but expensive in the long term due to maintenance.

      • 成本: 前期成本较低,但因维护费用长期较高。

    Non-Hardcoding:

    非硬编码:

    • Time: Requires upfront investment in designing a dynamic system.

      • 时间: 需要前期投入来设计动态系统。
    • Quality Control: Higher reliability and reusability.

      • 质量控制: 更高的可靠性和可重用性。
    • Cost: More expensive initially but cost-effective for scaling and maintenance.

      • 成本: 起初较贵,但对扩展和维护来说具有成本效益。

    随着客户开始要求更大、更复杂的应用程序,WebbyPage 转向非硬编码实践的努力得到了回报。通过投资于自动化和可重用组件,公司显著缩短了交付时间,同时保持了高质量标准。


    Scaling as a Small Dev Firm: WebbyPage’s Framework Strategy

    作为小型开发公司进行扩展:WebbyPage 的框架策略

    为了应对扩展的挑战,WebbyPage 为所有项目采用了基于框架的方法:

    Key Components of the Framework:

    框架的关键组件:

    1. Centralized Configuration: Environment files for database credentials, API keys, and settings.

      • 集中配置: 用于数据库凭据、API 密钥和设置的环境文件。
    2. Reusable Modules: Dynamic templates for front-end pages, common validation scripts, and API wrappers.

      • 可重用模块: 用于前端页面的动态模板、通用验证脚本和 API 包装器。
    3. Automated Deployments: Using tools like CI/CD pipelines to streamline releases.

      • 自动化部署: 使用 CI/CD 管道等工具简化发布流程。

    Benefits:

    优势:

    • Faster Delivery: Modular components reduced development time for recurring tasks.

      • 更快的交付: 模块化组件减少了重复任务的开发时间。
    • Cost Efficiency: Clients benefited from lower costs due to reusable code.

      • 成本效率: 由于代码的可重用性,客户节省了成本。
    • Future-Proofing: The framework could easily integrate new technologies and adapt to changing client needs.

      • 面向未来: 框架可以轻松集成新技术并适应不断变化的客户需求。

    Practical Advice for Developers

    开发者的实用建议

    For Solo Developers:

    对独立开发者的建议:

    • Start with hardcoding for quick prototyping but plan for non-hardcoded transitions as projects grow.

      • 从硬编码开始快速原型开发,但随着项目增长,计划向非硬编码过渡。
    • Build small utilities and gradually evolve them into a reusable framework.

      • 构建小型工具,并逐步将其发展为可重用的框架。
    • Prioritize maintainability even when working alone to save future effort.

      • 即使独自工作也要优先考虑可维护性,以节省未来的精力。

    For Small Dev Firms:

    对小型开发公司的建议:

    • Invest in training team members on shared frameworks and coding standards.

      • 投资于团队成员共享框架和编码标准的培训。
    • Use version control systems like Git to manage team contributions.

      • 使用 Git 等版本控制系统管理团队贡献。
    • Focus on long-term scalability when choosing between hardcoding and dynamic approaches.

      • 在选择硬编码与动态方法时注重长期可扩展性。

    Final Thoughts

    最后的思考

    WebbyPage 从独立开发者到小型开发公司的历程说明了平衡硬编码和非硬编码方法的重要性。虽然硬编码可以快速解决问题,但非硬编码实践为质量、可扩展性和成本效率铺平了道路。通过构建强大的框架并强调动态开发,WebbyPage 将局限性转化为机会——这是任何开发者都可以借鉴的路线图。