Provider Model Design Pattern Part 1

Excel日期差计算的5种业务级方法:从自然日到自定义工作日 在Excel中计算两个日期之间的天数,表面是基础算术操作,实则涉及时间语义、业务规则与系统逻辑的深度耦合。理解‘日期差’的本质,需区分自然日流逝、组织工作日运行、法定节假日约束、人因周期表达(如工龄)及实时动态锚点等不同维度。其中NETWORKDAYS.INTL()凭借7位二进制周末定义与可扩展假日列表,成为支撑跨国协作、金融计息、HR合规与项目排期等高要求场景的核心函数;而DATEDIF()则在年/月/日整数单位转换中不可替代。掌握这些函数背后的业务映射逻辑,才能避免‘数字正确但业务错误’的致命陷阱。 阅读详情

 

 

Related Books

This column has been quiet for some time—sorry about that. I have a really, really good excuse, though: We've been busy working on the next version of the Microsoft® .NET Framework and Microsoft® Visual Studio® .NET, code-named "Whidbey."

Busy is actually an understatement. For Microsoft® ASP.NET, we've roughly doubled the number of class libraries! Is that a good thing? Yes it is, and in the coming months we'll explore some of these new ASP.NET features. However, before focusing all of our attention towards Whidbey, we'll spend the first several articles on ASP.NET 1.1 and relate it to what's to come in Whidbey.

Our first article is about the new Whidbey provider-model design pattern and how you can start using it in your ASP.NET 1.1 applications today.

There has been a lot of buzz recently surrounding the announcement of the next version of Microsoft® Visual Studio® .NET and the Microsoft® .NET Framework code-named "Whidbey." No, this isn't another Whidbey article, but it is an article that discusses an important new design pattern that is going to show up in Whidbey, and more importantly, a pattern you can start using in your applications today.

In the next article, we'll look at implementing this pattern in an ASP.NET 1.1 application. In this article, we'll discuss why the pattern is needed, and walk through the "Whidbey" provider specification. Let's look at some of the reasons why we need the provider design pattern first.

Fixed Choices

In published APIs you are usually limited to a fixed number of options. An example I commonly use is the Microsoft® ASP.NET Session State feature. ASP.NET Session State supports an "out-of-process" mode. Using either Microsoft® SQL Server or the ASP.NET State Server, you can store user's Session data in a process separate from the running application. There are many benefits: reliability, easy Web farm support, and scalability. Most people tend to lean towards the database solution, since it allows for replication and other benefits not offered by the State Server. One small problem: What if you're not a SQL Server customer?

Fixed Internal Behaviors

Here's another common situation, again using Session State. Say you want to change some internal behaviors of ASP.NET APIs, for example changing how ASP.NET Session sets or retrieves values from its out-of-process store. Today you're constrained by the design. It is all or nothing: either we fetch all your data, or we fetch none of your data. If you're storing 5 MB of data and only need 50 KB to satisfy the current request... You get the picture.

Fixed Data Schema

The final scenario relevant to this discussion concerns schema. A schema is the logical model of how data is stored. For example, if you ever used Microsoft® Site Server 3.0 Personalization, it forced you to move your data into the schema that it desired. That's all well and good, but typically the people who built that schema don't know a whole lot about your business. In other words, fixed schemas are typically built to be really good for everyone, but excellent for no one.

These are common problems that all technologies share: the inability to change core behavior or functionality of published APIs.

Who Cares, I'll Write My Own

You definitely can create your own solutions for all these problems, but there are a lot of benefits to using applications with published APIs. One of the main benefits is that many developers know and understand what these APIs are and how they work. If you need to augment your staff, for instance, you can hire a consultant that is already familiar with these well-documented APIs. If you write your own, guess what; you also get to pay that person to learn your proprietary system.

What we really want is a way for everyone to get the benefits of well-documented and familiar programming interfaces, such as Session State, but the ability to completely control the internal Business Logic Layer (BLL) and Data Access Layer (DAL) of these APIs.

Introducing the Provider Design Pattern

The Provider Design Pattern is a pattern we've used in several of our ASP.NET Starter Kits, formalized in ASP.NET Whidbey, and one that we'll hope you'll start using for your applications, too. The theory of the pattern is that it allows us to define a well-documented, easy-to-understand API, such as our new Whidbey Membership APIs, but at the same time give developers complete control over the internals of what occurs when those APIs are called.

The pattern was officially named in the summer of 2002 when we were designing the new Personalization feature of ASP.NET Whidbey. We were struggling to design the "right" schema that worked for everyone—the Personalization feature of ASP.NET Whidbey adds a new Profile class to which you can add strongly typed properties, for example, FirstName, whose values are stored in a database. The problem was that we needed a flexible design, but at the same time we wanted it to be easily extensible without everyone having to be a DBA; turns out this simple requirement is an incredibly challenging problem.

On the one hand, we could have designed the system to be entirely schema driven. This would have meant that we would have designed what I call, for lack of a better name, vertical tables in the database. Rather than using traditional columns, there would be a set of tables used to define the schema and a data table used to map data to a particular type. Each new item in the data table would correspond to a type in the schema table identifying what type of property it was. Below is a very simplistic data model of this design:

Figure 1. A simple model for personalization

Using this data model, we would see something like the data below in the Schema table:

Figure 2. Proposed schema table

And data in the PersonalizationData table similar to the data below:

Figure 3. PersonalizationData table

As you can see, this model maps the property type (such as FirstName) to a property value in the PersonalizationData table, such as FirstName: Rob.

While being infinitely flexible, this model starts breaking down with a large number of users and properties. For example, while testing this design, we used the data from the ASP.NET Forums. At the time, this was 200,000 users, each with about 15 properties. This resulted in 3,000,000 rows in the data table! An important benefit that SQL can provide, namely normalized data, is lost. We also knew that people would want to use standard SQL syntax for selecting from the tables for reporting and maintenance—for example, try running a report on this type of design for all who live in a certain zip code using the vertical table design—not easy!

The obvious solution was to use normal tables, but we didn't want users to have to call a DBA to modify the tables for incremental changes. For example, to add a new property called ZipCode would require adding a new column to the Person table.

The conundrum was that we could choose either a very flexible schema-based design that had scale limitations, or a super-scalable design that might be too inflexible for some people. Furthermore, beyond the simple data schema problems, we also wanted partitioned data access, and we wanted the Personalization APIs to be extensible. We wanted a lot!

What did we decide? Well, we decided that each customer scenario would be unique. We knew that we would eventually want to implement it ourselves on www.asp.net, and would want control over the data model. To solve the problem, we borrowed a pattern we had been experimenting with in the ASP.NET Forums.

The Pattern

The pattern itself is exceedingly simple and is given the name "provider" since it provides the functionality for an API. Defined, a provider is simply a contract between an API and the Business Logic/Data Abstraction Layer. The provider is the implementation of the API separate from the API itself. For example, the new Whidbey Membership feature has a static method called Membership.ValidateUser(). The Membership class itself contains no business logic; instead it simply forwards this call to the configured provider. It is the responsibility of the provider class to contain the implementation for that method, calling whatever Business Logic Layer (BLL) or Data Access Layer (DAL) is necessary.

There are some rules for how a provider behaves. A provider implementation must derive from an abstract base class, which is used to define a contract for a particular feature. For example, to create a membership provider for Oracle, you create a new class OracleMembershipProvider, which derives from MembershipProviderBase. The feature base class, for example, MembershipProviderBase, in turn derives from a common ProviderBase base class. The ProviderBase class is used to mark implementers as a provider and forces the implementation of a required method and property common to all providers. Figure 4 gives an example of the inheritance chain.

Click here for larger image.

Figure 4. A provider inheritance chain

The implementer must also define a configuration section entry used to load the provider. Below is an example of what this configuration entry looks like (borrowed from the ASP.NET Forums):

<configuration>
    <forums>
        <forums defaultProvider="SqlForumsProvider" 
          defaultLanguage="en-en" >
            <providers>
                <clear/>

                <add name = "SqlForumsProvider" 
                     type = "AspNetForums.Data.SqlDataProvider, 
                             AspNetForums.SqlDataProvider" 
                     connectionString = "[connection string]"
                     databaseOwner = "dbo"
                />

                <add name = "AccessForumsProvider" 
                     type = "AspNetForums.Data.AccessDataProvider, 
                             AspNetForums.AccessDataProvider" 
                     fileLocation = 
                     "~/data/AccessDataProvider/AspNetForums.mdb"
                />

            </providers>

        </forums>
    </forums>
</configuration>

We'll see what this all means momentarily.

The beauty of this pattern is you can create a new class, for example, OracleForumsProvider, by deriving from the ForumsProvider base class and use Oracle as your data store. Or, if you prefer to continue using SQL Server, but wish to change the behavior of a single method, you can derive from SqlForumsProvider, override the method whose behavior you want to change, and then add that new class to the <providers> section of configuration. More simply put: the provider design allows developers to publish well-known APIs and also allows for a rich, enterprise-level extensibility model.

The following information comes directly from the provider specification for ASP.NET Whidbey.

Common Behaviors/Characteristics

Below is a listing of characteristics common to providers.

Base class

A base class should have as few methods and properties as possible. This is desirable to encourage developers to write providers.

Threading

Providers should be free-threaded/thread safe, with one instance per application domain. Any provider-specific objects created more frequently (for example, one per request) should be created through provider APIs.

Factory methods

The abstract base class should support factory methods to create new objects wherever appropriate, for example, CreateUser().

If a feature allows a provider to create a framework object, but does not allow the provider to extend the object, the framework class should be sealed.

Complex objects created by a provider may keep track of the provider that created it, and expose it as a Provider property. This allows users of the feature to determine the provider that owns the data for the object. For example, when a new user is created with the Membership API, it may be useful for the developer to be aware of the provider that data for the object is stored in.

Administration

The object model for ProviderCollection should include APIs to add, remove, and clear the collection and to set parameters of individual providers in the collection.

Every feature that has providers should have a Provider property that returns type ProviderCollection, for example, Membershp.Providers.

Class naming and namespaces

The specific provider base classes should be named [Feature]ProviderBase, for example, MembershipProviderBase.

Implementations should be named [ImplementationType][Feature]Provider, for example, SqlRoleManagerProvider.

Server controls that allow selection of a provider should have a property named Provider. This property should default to the value of the defaultProvider attribute in the related configuration section for the feature. For example, the new <asp:login/> server control's default provider is equivalent to the Membership default provider. The list of providers available to the login control is restricted by the providers defined for use in the <membership> section.

Common naming patterns for provider classes

Figure 5 below calls out some of the common names and casing that should be used for various data stores (where name is [Name][Feature]Provider).

Figure 5. Suggested prefixes for provider class names

For data stores that are not named above, the name value should be Pascal cased.

Configuring the default provider

All features that have providers must have a configuration section and should define a defaultProvider attribute. If a default provider is not specified, the first item in the collection is considered the default. For example:

<configuration>
  <system.web>
    <roleManager defaultProvider="AspNetSqlProvider" ...>

      <providers>

        <add name="AspNetWindowsProvider" 
             type="System.Web.Security.WindowsTokenRoleProvider, 
                    System.Web, 
             Version=1.2.3300.0, Culture=neutral, 
             PublicKeyToken=b03f5f7f11d50a3a"
             description=" description here " />

        <add name="AspNetSqlProvider"
             type="System.Web.Security.SqlRoleProvider, System.Web, 
             Version=1.2.3300.0, Culture=neutral, 
             PublicKeyToken=b03f5f7f11d50a3a"
             description=" description here "
             connectionStringName="[name in <connectionStrings/>" />

      </providers>
    </roleManager>
  </system.web>
</configuration>

Specifying a defaultProvider attribute is not required, although it is highly recommended. All ASP.NET providers will specify a defaultProvider attribute.

Provider-friendly name or dictionary key

When defining a provider within configuration, it is required for the name attribute to be defined. Furthermore, it is recommended that provider names follow a pattern to easily distinguish who owns the providers. The suggested pattern, and the pattern followed by the ASP.NET team is: [Provider Creator][Data Store]Provider.

For example, the Membership provider capable of storing data in SQL Server is:

<add name="AspNetSqlProvider"
    type="System.Web.Security.SqlRoleProvider, System.Web, 
    Version=1.2.3300.0, Culture=neutral, 
    PublicKeyToken=b03f5f7f11d50a3a"
    description = "ASP.NET SQL Server provider"
    connectionStringName="[name in <connectionStrings/>" />

It is important to note the friendly name of the provider when specified in configuration is distinct from the class name of the provider. The friendly name does not need to include the feature name, for example, Role, since the friendly name values are only usable within the context of the feature, for example, Roles.Providers["AspNetSqlProvider"]. The provider creator detail is added to distinguish between providers that may access similar data stores but pose differing behavior.

Provider type

When defining a provider within configuration, it is required for the type attribute to be defined. The type value must be a fully qualified type name following the format:

       type="[namespace.class], [assembly name], 
             Version=[version], Culture=[culture], 
             PublicKeyToken=[public token]"

For example:

       type="System.Web.Security.SqlRoleProvider, System.Web, 
             Version=1.2.3300.0, Culture=neutral, 
             PublicKeyToken=b03f5f7f11d50a3a"

The strongly typed name is desired, however, it is also legitimate to use the shorter style assembly type name:

       type="System.Web.Security.SqlRoleProvider, System.Web"
Expected APIs

Features that derive from the various provider base classes should follow the common pattern of supporting a Provider property and Providers collection property that allow the developer to access the default configured provider as well as the other providers specified in configuration. For example:

SqlMembershipProvider p = (SqlMembershipProvider) Membership.Provider;

AccessMembershipProvider a = 
(AccessMembershipProvider)Membership.Providers["AspNetAccessProvider"];

The Provider property and Providers collection allow for runtime access to the underlying Provider class instance. The Provider property returns the currently configured default provider, while the Providers collection returns a collection of all the available providers defined within configuration.

Use of <connectionStrings/>

All providers that require a connection to a database or require the use of a connection string to locate their data store should use the <connectionStrings/> section of configuration. Additionally, the name of the property on the provider should be connectionStringName with the value being the named value in <connectionStrings/>.

A connection string value is required; there cannot be an internal default.

For all providers shipped by Microsoft, it should not be possible to store a connection string in the provider definition. Rather the <connectionStrings/> section should be used. This will allow us to encrypt the connection string, further securing the application.

An exception will be thrown when a provider attempts to use a connection string obtained from <connectionStrings/> that either does not exist or is invalid.

Description attribute

Although not an explicit requirement for all providers, any providers created by Microsoft should have a description attribute. The description attribute should contain a brief, friendly description that can be displayed in the Web administration tool or other displays.

The description attribute is optional and it is not an error for the description attribute to be missing; empty string is assumed.

String comparisons

When any string comparisons are done from with the configuration system for providers, a culture-invariant string comparison is performed. This rule applies to the name value defined for providers.

Conceptual Specification

The conceptual specification section addresses common classes shared by all providers, the collection class used to manage providers, and rules for how providers are managed within a features configuration section.

ProviderBase

All providers derive from a common ProviderBase class. By supporting this common abstract base class, all providers additionally share a common base type.

namespace System.Configuration.Provider {
  abstract class ProviderBase {

    // Methods
    public abstract void Initialize(string name, 
      NameValueCollection config);

    // Properties
    public abstract string Name { get; }
  }
}

When a new instance of a provider is created, internally the Initialize() method is called. It is assumed that all provider instances will add additional functionality to the provider beyond ProviderBase, for example, MembershipProvider. However, all providers should still derive from ProviderBase.

Figure 6 Initialize method for ProviderBase

Figure 7. Name property of ProviderBase

Figure 8. Add method of ProviderCollection

Figure 9. Clear method of ProviderCollection

ProviderCollection

The ProviderCollection is a utility collection class used to manage classes that derive from ProviderBase. Features that implement providers can use the ProviderCollection to add, remove, or clear all providers. Internally, instances are cast to the correct type when a typed provider is needed.

namespace System.Configuration.Provider {

  public class ProviderCollection : IEnumerable {

    // Methods
    //
    public void Add(ProviderBase provider);
    public void Clear();
    public void Remove(string name);
    public void SetReadOnly(string name);

    // Properties
    //
    public ProviderBase this(string name) { get; set; }
    public int Count { get; set; }
  }

}

Figure 10. Remove method of ProviderCollection

Figure 11. SetReadOnly property of ProviderCollection

Figure 12. Add method of ProviderCollection

For example, when Membership.Providers["AspNetSqlProvider"] is requested, internally the following code is assumed:

public MembershipProvider this [string name] {

  get { return (MembershipProvider) providerCollection[name]; }

  ...
}
Configuration

Features that make use of providers must implement a <providers> configuration section within their feature's configuration slot. It is within the <providers> section that providers may be added, inherited providers may be cleared, or individual providers may be removed.

Providers are defined at the machine or application level. Providers cannot be defined in web.config files in application directories that are not application roots.

Setting the default provider

All features that have providers should have a defaultProvider attribute on the main configuration section. If a default provider is not specified, the first item in the collection is considered the default. For example:

<configuration>
  <system.web>
    <roleManager defaultProvider="AspNetWindowsProvider" ...>

      <providers>

        <add name="Windows" 
             type="System.Web.Security.WindowsTokenRoleProvider, 
                    System.Web, 
             Version=1.2.3300.0, Culture=neutral, 
             PublicKeyToken=b03f5f7f11d50a3a"
             description=" description here " />

        <add name="AspNetSqlProvider"
             type="System.Web.Security.SqlRoleProvider, System.Web, 
             Version=1.2.3300.0, Culture=neutral, 
             PublicKeyToken=b03f5f7f11d50a3a"
             description=" description here "
             connectionStringName="[name in <connectionStrings/>" />

      </providers>
    </roleManager>
  </system.web>
</configuration>
Managing providers in configuration: <providers>

The <providers> configuration section contains 0 or more <add>, <remove>, or <clear> elements. The following rules apply when processing these elements:

  1. It is not an error to declare an empty <providers /> element.
  2. Providers inherit items from parent application configuration <add> statements.
  3. It is an error to redefine an item using <add> if the item already exists or is inherited.
  4. It is an error to <remove> a non-existing item.
  5. It is not an error to <add>, <remove>, and then <add> the same item again.
  6. It is not an error to <add>, <clear>, and then <add> the same item again.

<clear> removes all inherited items and items previously defined. For example, an <add> declared before a <clear> is removed, while an <add> declared after a <clear> is not removed.

Figure 13. Add element for configuration

New providers are added using the <add> element nested beneath <providers>.

Figure 14. Remove element for configuration

Figure 15. Clear element for configuration

Conclusion

The provider model can help you design flexible and easily evolved APIs for your applications. In fact, today it's being used in the ASP.NET Forums (http://forums.asp.net) as well as DotNetNuke (http://www.dotnetnuke.com), both of which are ASP.NET 1.1 applications. In Part 2 of this article, we'll examine an implementation of this specification/pattern that you can begin using in your ASP.NET 1.1 applications.

After we conclude with the next provider article, we'll look at how to build a scalable database cache invalidation system for ASP.NET 1.1—something that many have tried, but few have succeeded with (I even had a stab at this about 3 years ago). If you've got other articles you'd like to see, let me know. My contact information is below.

工作日计算实战:法定节假日与调休补班的全语言实现 在项目排期、工单SLA统计、请假核算等场景中,计算两个日期之间的工作日天数远非“相减再扣周末”那么简单。法定节假日和调休补班机制打破了自然周的规律,直接按周一到周五过滤会导致结果与业务实际严重偏差。本文从“日历工作日”的定义出发,讲解如何区分自然工作日、法定放假日与调休补班日,并给出节假日数据的配置与存储方案。核心算法涵盖逐日遍历的稳妥实现与整周批量的高效优化,同时提供Java、Python、SQL等语言的落地代码。针对时区、跨年数据空窗、补班漏维护等常见坑点,也给出了实用的规避策略。无论是开发排期工具还是 阅读详情

相关推荐

蓝桥杯国赛真题深度解析:从动态规划到双向BFS的实战技巧

动态规划(DP)是解决最优化问题的核心算法范式,其原理在于将复杂问题分解为重叠子问题,并通过状态转移方程高效求解。在算法竞赛和工程优化中,DP的价值在于能以多项式时间复杂度解决指数级搜索空间的问题。图论中的广度优先搜索(BFS)则是解决最短路径、状态空间遍历的基础技术,其应用场景广泛,如网络路由、游戏AI和拼图求解。当状态空间爆炸时,双向BFS能通过从起点和目标同时搜索,将时间复杂度从O(b^d)降至约O(b^(d/2)),是应对大规模搜索问题的关键技术。本文以蓝桥杯国赛真题为例,深入剖析了带约束的完全背包

weixin_30764883的博客 411

Cursor 提示We‘re having trouble connecting to the model provider. This might be temporary - please try

今天在使用cursor时,突然提示We're having trouble connecting to the model provider. This might be temporary - please try again in a moment. 把我可吓得不轻,我刚冲完还没一周呢,我第一反应是不能用啦???? 后来总结出来的解决方案

xiaohua616的博客 3210

机器学习实战成长路线图:从环境配置到模型部署的七步实操指南

机器学习(ML)作为人工智能的核心分支,其本质是通过数据驱动的方式解决预测与决策问题。理解其原理需扎根于数学基础与编程实践,技术价值体现在将模糊业务需求转化为可量化、可迭代、可监控的模型服务。典型应用场景包括用户流失预测、智能推荐、异常检测与图像分类等。然而初学者常困于环境配置失败、特征工程无从下手、模型调参盲目低效等现实瓶颈。本文聚焦scikit-learn工程实践、Kaggle端到端项目闭环、Python数据处理肌肉记忆三大高频痛点,提供一条经1172天验证、43次复盘打磨的渐进式成长路径,覆盖从pip

cique2620的博客 515

雇工模式(Servant Design Pattern)。

定义 雇工模式也叫做仆人模式,其意图是: 雇工模式是行为模式的一种,他为一组类提供通用的功能,而不需要类实现这些功能,他是命令模式的一种扩展。 IServiced是用于定义“一组类”所具有的功能,其示例代码如下所示。 public interface IServiced { /** * 具有的特质或功能 */ void serviced(); } 针对不同的服务对象具备不同...

孤芳不自赏 881

“三进制”bonsai27b+NInfer=6g显存闪电侠(token真的自由了!)

本文将1.58-bit三元大模型Bonsai27B成功移植至NInfer推理引擎,并在RTX 4080 SUPER上实现100+ token/s的极速推理。通过自研补丁扩展NInfer支持Ada架构与三元量化格式,解决激活布局、行置换等关键bug,实测PPL 6.445,单流吞吐达96.7–130.8 t/s,20题基准得分16/20。附完整复现包(含文档、工具、源码补丁),零权重分发,助力垃圾显卡跑通27B级模型。

shensanshu的博客 1万+

SICK LMS111激光雷达数据解析实战:从原始帧到三维点云的完整流程

本文详细解析了SICK LMS111激光雷达从原始数据帧到三维点云的完整处理流程,包括数据帧结构解析、坐标转换、点云可视化及性能优化技巧。通过实战代码示例,展示了如何高效处理激光雷达数据,并应用于动态物体检测、地面分割等工业场景,为AGV和服务机器人开发者提供实用指南。

garlic的博客 769

FreeMarker - 配置参数用法说明

【1】locale 作用: 设置默认地区,主要影响数字、日期输出格式,request中没有指定地区时模板查找的值。 值: zh_CN,en_US 配置实例: prop key="locale">zh_CNprop> 【2】classic_compatible 作用: 兼容旧版freemarker习惯,不建议使用,可能会导致一些额外的问题。如,include必须用绝

小小默:进无止境 5149

ABAP OO - ALV_TREE例程

项目上比较少有用到ALV_TREE的报表功能,刚好项目上有写了一次,也查阅大量的范例,整合了一写法,给自己做一下笔记。 程序包含功能按钮,按钮下拉,F4帮助,读取选中行,字段双击触发事件,字段前置图标,更新节点,获取节点数据,获取全部子节点,递归算法,DMS模块:创建文档功能,创建文档链接,SNRO创建流水号,缓存数据,下次用户加载进来继续操作。 *&---------------------------------------------------------------------* *&a

大步甩起来 4991

在springboot中添加自定义TemplateResolver

我们都知道springboot的模板文件默认是在 classpath:templates/ 下面并且以.html结尾,但当在生产环境中我们需要动态的修改或替换某些模板文件时这样就不满足了, 这时就需要自定义一个TemplateResolver来解析我们的模板文件了,具体实现如下: 方法一(推荐): 这种方式继承了之前默认的配置,如下这种设置只需把模板文件与可执行jar文件放于...

SANDKING2015的博客 1533

Kettle 连接 Oracle 数据库全流程指南

例如:C:\Oracle\product\19.0.0\dbhome_1\jdbc\lib\ojdbc8.jar 2. 替换 Kettle 驱动文件 将驱动文件复制到 Kettle 的 目录: 删除旧版本驱动:如 ojdbc14.jar 只能保留一个oracle驱动 重启 Kettle 以加载新驱动 二、配置数据库连接 1. 启动 Kettle 并新建转换 运行 (Windows)或 (Linux)。 新建转换(Transformation),添加 “表输入” 步骤,双击进入配置。 2.

qq_44724453的博客 3483

FPGA实战:用DDR3和乒乓操作解决视频帧撕裂问题(附Verilog代码)

本文详细介绍了如何利用DDR3内存和乒乓操作架构解决FPGA视频处理中的帧撕裂问题。通过多帧缓存原理、AXI接口配置和自适应乒乓操作设计,有效隔离读写操作,确保视频流稳定传输。文章包含Verilog代码实现和性能优化技巧,适用于工业相机、医疗影像等高速视频处理场景。

m2n3b4v5c6的博客 290

vue中提示$index is not defined

今天学习Vue中遇到了一个报错信息:$index is not defined,是我写了个for循环在HTML中,然后是因为版本的问题 下面是解决方法: 原来的是 v-for="person  in  items"     v-on:click="deletePerson($index)"//这个仅仅适用于1.0版本,不要采坑了同学们 这个在Vue1.0版本中式

shaleilei的博客 1万+

安装WSL过程中出现注册表编辑器无法重命名WSL。重命名项时出现错误的解决方案

本文主要介绍了安装WSL过程中出现注册表编辑器无法重命名WSL。重命名项时出现错误的解决方案,希望能对使用Windows WSL的同学们有所帮助。 文章目录 1. 问题描述 2. 解决方案

weixin_43178406的博客 9万+

计算一段日期内的周末天数(星期六,星期日总和)

/* | Author: Yang Yu | @param char|int $start_date 一个有效的日期格式,例如:20091016,2009-10-16 | @param char|int $end_date 同上 | @return 给定日期之间的周末天数

再见伍德 6899

QT开发串口程序与单片机通讯

如果有对象对这个信号感兴趣,想要处理的信号和自己的一个函数(称为槽(slot))绑定来处理这个信号。的内容,虽然实现的功能很简单,但是QT上位机开发的步骤基本就是这些步骤,通过这个基础实例把这些套路摸透我们就可以接着进行后续更多QT程序地开发学习了。QWidget类:所有用户界面对象的基类,窗口部件是用户界面的一个基本单元,它从窗口系统接收鼠标,键盘和其他消息,并在屏幕上绘制自己。我们上面运行的上位机都是在Qt Creator中编译运行的,如果我们需要把编写好的可执行文件发送给别人使用的话还需要进行打包。

谢谢大家的关注和点赞!这里只有纯纯的知识干货,没有一句废话。希望能实实在在帮到大家~要是觉得有用,别忘了给我点支持哟,你 948

Hermes Agent 彩蛋大盘点:藏在终端里的浪漫

本文主要介绍了Hermes Agent 彩蛋大盘点:藏在终端里的浪漫,希望能对使用Hermes Agent的同学们有所帮助。 文章目录 1. 前言 2. Spinner 动画 3. Kawaii 表情 4. 思考动词 THINKING_VERBS 5. 皮肤主题 6. 启动 Banner 7. 工具 Emoji 8. 内置人格 9. SOUL.md —— Agent 的灵魂 10. BOOT.md —— 启动自动执行 11. 随机 Tips 12. 统计总览

weixin_43178406的博客 7万+

计算一段日期内的周末天数的php代码(星期六,星期日总和)

就是取得开始日期的星期数,如果不足一周,则补上对应的天数,比如开始日期是星期3,那么总天数就补上2天(星期1,星期2),如果开始日期是星期6,则补上5天,也就是6-1,就是函数中的$start_N - 1,如果开始日期恰好是周日,那么补上6天的同时,最后的结果需要减去一天(周六),也就是函数中的 $start_reduce ,好了,现在“前补”解释完了。最后算一段时间内的天数,不建议用date(z)来算,因为通用性会不好,涉及到跨年的问题,如果跨多年,还要考虑闰年的问题,倒不如这样算来的直接。

邓草的博客 448

VC中sqlite的使用

在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示

POJ 1698 网络流

讲每个任务以及每个星期的每一天zuo

I will Do iT @ hlyblog.net 1028

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

计算机控制技术及应用

《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。

UVA 10050 - Hartals

UVA 10050 Hartals

坟头草一米七五 317

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

蓝桥杯2022年真题及答案

小明计划周一到周五每天做a道题目,周六和周日每天做b道题目,请你帮小明计算,按照计划他将在第几天是先做题数大于等于n题?

qq_62968038的博客 463

SAP工厂日历:不只是日历,而是生产计划的时间底层协议

工厂日历是SAP系统中定义‘工作日’与‘非工作日’的基础时间参照系,其本质是贯穿PP、MM、SD、FICO、EWM等模块的统一时间基准。它决定MRP运算中的日期推算逻辑、ATP可用性检查的交货日判定、工单排程的时段约束、固定资产按工作日计提折旧的财务规则,以及EWM任务触发的业务日边界。理解工厂日历,就是理解SAP如何将现实世界的班次、假日、检修等物理时间规则,映射为系统可执行的逻辑约束。尤其在MD07计划延迟、VL02N交货日校验失败等高频问题中,90%的根因都指向日历配置偏差或跨模块绑定不一致。

weixin_29587015的博客 370

POJ1698 最大流或者匈牙利

题意: 一个人他有n个任务,每个任务都有一些限制: (1)只能在一个星期中指定的日子去做,比如周1 2 6啥的 (2)总工作量有几天,就是一共要工作几天 (3)必须在几周之内完成,就是你可以在能干活的日子里面选择那天去干活,但是不能超过规定的星期。 然后问,是否可以不冲突的干完所有的活?...

墨鱼菜鸡 238

回归树入门:用‘如果…那么…’思维理解机器学习

回归树是机器学习中最基础、最可解释的预测模型,其核心思想是通过递归分组实现数值预测,而非依赖复杂数学公式。它基于业务决策逻辑,将连续目标变量按特征阈值离散化为多个局部均值,天然适配存在断点规则的实际场景(如运营时段、促销周期、天气阈值)。相比线性模型,回归树不假设数据平滑,更擅长捕捉隐性分段关系与非线性交互;其分裂准则(如方差最小)背后实为业务可解释性、数据稳定性与计算效率三重约束的平衡。作为XGBoost、随机森林等集成方法的基学习器,回归树既是可落地的独立工具,也是理解更复杂AI模型的思维起点。

weixin_33713503的博客 376

8月14日销量预测:Prophet时间序列模型实战教程

时间序列预测是业务决策中不可或缺的技术,它通过分析历史数据中的趋势、季节性和节假日效应,推断未来特定时间点的指标值。不同于普通回归,时间序列数据具有顺序相关性和自相关性,因此需要专门模型处理。Prophet作为Facebook开源的分解式预测模型,凭借其对节假日支持好、训练快、可解释性强的优势,成为业务指标预测的常用基线方案。在电商大促、活动上线等场景中,准确的销量预测能帮助团队提前规划库存与容量,避免资源浪费或系统过载。本文以预测8月14日销量为例,完整演示从数据准备、Prophet建模、结果评估到工程落

weixin_33981932的博客 433

生产级多维聚合实战:银行风控中的pandas工程化指南

多维聚合是数据分析的核心能力,本质是按多个维度组合对数据进行分组计算。其原理涉及分组索引构建、聚合函数并行执行与结果结构重塑,技术价值在于支撑高并发、低延迟、可审计的业务决策。典型应用场景包括金融客户分层、实时风险敞口计算、电商大促多维归因分析等。在真实生产环境中,必须应对维度爆炸、业务逻辑耦合、时间语义错位、下游系统适配等挑战。本文聚焦pandas多维聚合的工程化落地,结合银行级风控实践,详解多重agg、自定义函数封装、时间窗口锚定、unstack维度治理等关键技术,覆盖从原始交易日志到高管简报的完整链路

dihuangxiu8828的博客 317
下一篇: 在DataGrid的每一行中用图片的形式显示Edit和Delete的功能
brusehht
博客等级 码龄23年 0粉丝 18原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值