C#揭密II(大师们在说些什么?)

C#揭秘 中文版 相当精典的C#书籍,百读不厌,值得经常翻阅,money不多的下吧 立即下载

C#揭密II(大师们在说些什么?)

先声明这篇文章属于收藏性质的,推荐给那些喜欢dotNET技术的爱好者。
这之前我曾转载了O'Reilly的一篇关于C#的访谈录。O'Reilly一向以技术和评论公见长,他们的编辑一般都有着很深的技术背景和功力(所以出的书也比较贵haha),所以那篇着重整个流行技术,有不少是和Java相关的;而这一篇都是MS内部的几个高手在交谈聊天,涉及的范围比上次的专访要广,里面有一些很新奇的术语和许多问题的观点。另外我认为这篇文章对以前非常熟悉COM+、ASP和Window DNA(N 层结构)的人目前评估和思考向新的dotNET体系迁移都很有帮助。

Anders Hejlsberg是个很奇怪的人,从他身上你感觉不到一个程序语言创始人那种对某种语言偏爱的狂热,却很容易感觉到他所透露出的那种对技术对程序语言的坚定和深厚理解。很喜欢他在上一篇访谈录中说的一句话:“Language is a funny thing: It's a matter of taste. Language is almost a religious thing, and it's a lifestyle choice for programmers。”不过我知道这句话说的不是他自己。这篇文章中还有好些人:Brian Harry,Peter Golde ,Scott Guthrie(ASP老怪),Mark Anders。有了这些人,Microsoft有福啊。


小气的神
2001.09.24


Conversations on .NET


Derived from on-line chats with our early adopters, a series of conversations with Microsoft engineers, designers, and developers look at issues involving C#, ASP.NET, and the Common Language Runtime. 

 

http://msdn.microsoft.com/library/default.asp?URL=/library/techart/dotNETconvers.htm

Summary: What follows is a series of conversations with Microsoft engineers, designers, and developers, looking at issues involving C#, ASP.NET, and the Common Language Runtime. (10 printed pages)

A Conversation with Anders Hejlsberg and Peter Golde on C#

Anders Hejlsberg is a Distinguished Engineer in the Developer Division at Microsoft Corporation. He is the chief designer of the C# programming language and a key participant in the development of the .NET Framework. Previously, Anders was the architect for Visual J++ and the Windows Foundation Classes.

Peter Golde is a Software Design Engineer in the Developer Division at Microsoft Corporation. Peter has worked on development tools at Microsoft for over 10 years, contributing to products such as Microsoft C, OLE Automation, Visual Basic, Visual Basic for Applications, and Visual J++.

Q: Peter , you attended the ECMA meetings in March. Can you disclose anything about what's going on there that is new?

Peter Golde : Sure. As some of you may know, Microsoft, Intel, and HP jointly submitted two specifications to ECMA for standardization via the ECMA process. These two specifications are the C# language and the common language infrastructure (CLI), which is a subset of the .NET Framework. We're meeting with a number of companies every month as part of the standardization process. It's difficult to predict the schedule with absolute certainty, but we hope that E CMA will be able to complete standards for both parts by the end of 2001.

Q: How does the CLI compare to the CLS and the CTS?

Anders Hejlsberg : CLS stands for Common Language Specification, CTS stands for Common Type System. The CLS is a specification of what features any programming language implemented on the .NET platform must support.

Q: OK, the CLS is less than the CTS. Where does the CLI fit?

Anders Hejlsberg : The CTS is basically another word for the type system in .NET, i.e. a specification of what a class, struct, enum, or such is. CLI is really just another word for the large subset of the .NET Framework that we submitted to ECMA.

Peter Golde : The CLI includes the CLS and the CTS.

Q: Anders , after your work on Turbo Pascal , Delphi , Visual J++ and now C#, how do you see programming languages evolving today?

Anders Hejlsberg : Jeeez, had to ask an easy one, eh? I guess I'm becoming less and less of a believer in revolutionary approaches to language design. It really is amazing how much the capabilities of computing have evolved, yet we're basically still using the same kinds of programming languages. It gives me hope that we can go even further with an evolutionary approach where we don't just invalidate all the work that went before.

Q: Have you thought much about moving toward an intentional programming model?

Anders Hejlsberg : Can't say that we have. As I see it, one of the problems of intentional programming is that you're basically creating a new programming language for every domain specific application. I really am more of a believer in having a core set of abstractions (such as classes, methods, properties, and events) and then applying them in each domain—but in a way that preserves familiarity.

Q: Customers looking at the .NET Framework for their application development efforts have asked whether or not the common language runtime (CLR) is a virtual machine (VM), and if so, what limitations or penalties associated with VMs (performance and so forth) will folks need to consider in their efforts?

Peter Golde : Yes, I think that the CLR can be considered in the broad class of things that one might call a VM. As to performance, though, I don't think that this classification says much of anything interesting about performance. You should judge performance by measuring performance on the applications that you are interested in. Don't try to prejudge performance based on your preconceptions about what will and won't be slow—just test it!

Q: Peter , are there any kind of applications that you would explicitly not build on the CLR due to issues with running managed versus unmanaged code?

Peter Golde : In terms of what applications I wouldn't write, I would say that "hard real-time" kinds of programs probably wouldn't be a good fit (at least right now), because we don't make very strong guarantees about the garbage collector, things like robot control and the like. There are real-time friendly garbage collection algorithms, so I don't think this would be a limitation forever.

Q: Can you discuss any advantages C# would have over Visual Basic (VB) in terms of the framework?

Anders Hejlsberg : Regarding C# vs. Visual Basic, it really primarily comes down to what you already know and are comfortable with. It used to be that there was a large perf difference between VB and C++, but since C# and VB.NET use the same execution engine, you really should expect the same perf. C# may have a few more "power" features (such as unsafe code), and VB.NET may be skewed a bit more towards ease of use (e.g. late bound methods calls), but the differences are very small compared to what they were in the past.

Q: Ok, can you contrast C# with VB.NET? Questions usually come in the form of "I know you guys say VB.NET and C# let you do the same thing, but C# was designed for the CLR, so I don't believe you when you say VB.NET is just as good."

Anders Hejlsberg : Regarding C# versus VB.NET, the reality is that programmers typically have experience with either C++ or VB, and that makes either C# or VB.NET a natural choice for them. The already existing experience of a programmer far outweighs the small differences between the two languages.

Q: It has been said a few times that C# is the language designed for the CLR. Considering that all the languages that Microsoft will ship with the VS.NET will be able to target all the features of the CLR, what makes C# more CLR "friendly" than the other?

Peter Golde: I don't think that C# is necessarily any more friendly to the CLR than other languages. The CLR has been designed to be accessible via multiple languages. However, you will probably find that C# is more strongly focused on the CLR than other languages like C++, which have a number of other facilities that are less oriented toward the CLR. By designing C# in conjunction with the CLR, we have the "luxury" of not having backwards compatibility constraints.

Q: Is there any difference between the DEFAULT Equals function (implemented in Object) and the =?

Anders Hejlsberg: For two reference types (classes), the default Equals() method is the same as ==. But for value types (structs), there is no == operator unless you provide an implementation in the value type.

Q: Is Lock (this) similar to the synchronize key word in Java?

Peter Golde : Yes, lock (<expression>) is extremely similar to synchronized (<expression>) in Java. We don't support the notion of a modifier on methods, because our experience is that it leads to deadlock or poor performance in too many cases.

Q: We mostly want the COM+ benefits of memory caching, independent process space, etc.; we don't need to worry about database transactions. Is this a valid reason to place CLR components into COM+, or is it better to just let the CLR handle it?

Anders Hejlsberg : I would look at .NET Application Domains and not use COM+ in that case.

Q: Can you elaborate on .NET Application Domains?

Anders Hejlsberg : Sure. An Application Domain is sort of like a light-weight process. Two application domains will share the same GC heap, but the CLR provides automatic and transparent marshalling between the application domains. It allows you to protect light-weight processes from each other without taking the fairly large overhead of an OS process.

Q: Is the Application Domain a similar concept to the Java Package?

Anders Hejlsberg : No, a Java Package is a different thing. The closest analogy in .NET is an assembly.

Q: What are the plans to allow C# code to run on a PocketPC?

Peter Golde : We've announced that we'll have a ".NET Compact Framework" that will be optimized for portable devices. Obviously there are limitations in terms of the scope of the class library, memory limitations, and so forth compared to the desktop or server. I should add that one of the focuses of the ECMA standardization work is to standardize a library framework that is appropriate in size and scale for portable devices. There is obviously a large amount of interest in this from many companies.

A Conversation with Mark Anders and Scott Guthrie on ASP.NET

Scott Guthrie co-founded the ASP.NET Team and leads the design team responsible for architecting the product. His individual technical contributions include: ASP.NET Web Forms Page Architecture, ASP.NET Web Services Infrastructure, ASP.NET Compilation System, ASP.NET Distributed Session State Infrastructure, ASP+ Deployment Architecture, ASP.NET Reliability System, and the ASP.NET HTTP Runtime Architecture. Prior to ASP.NET, Scott was a member of the IIS and Windows NT teams.

As the Microsoft Product Unit Manager of the .NET Framework, Mark Anders leads the team that designs and develops the .NET Framework, including ASP.NET, Windows Forms, Base Class Libraries, and other class libraries. Prior to this, he co-founded the ASP.NET team and held lead positions in program management as well as development.

Q: Scott , Mark , if you had to pick one thing, what do you think is the single coolest developer feature of ASP.NET?

Mark Anders : Well, I'll tell you the feature that gets the most applause: it's tracing! Seriously, it's almost a spontaneous standing ovation. One guy who I showed it to said that it was "the coolest thing I've ever seen." (Note, I wouldn't go that far!) Actually, my favorite feature is server controls.

Scott Guthrie : I think the partial page output caching feature that we are going to ship in Beta2 is probably the coolest developer feature, because it can dramatically impact the performance of literally any site. The xcopy deployment features (no restart on DLL updates) we have I think also are pretty close.

Q: Tracing is a great feature. One of the questions we get a lot: is there any penalty for having all the tracing code but turning it off when going into production?

Scott Guthrie : There shouldn't be any noticeable performance difference when tracing is turned off (but code left in). One thing to keep in mind, though, is that if you have expensive "trace calculations" that you output as part of tracing, then you should scope it within an "if (Trace.Enabled = True) Then" block. When tracing is turned off, "Trace.Enabled" will return false

Mark Anders : Note that we don't gather all of the statistics if trace==false.

Q: Could you discuss the security of the config files. I have seen a lot of concern that since they are simple XML files, they can be hacked into easily.

Scott Guthrie : We do block all access to the config files from remote users. However, I think the concern people have is whether a rogue user who gets access to the config file can modify and take over things. Note that this problem exists with ASP today as well, in that the metabase APIs can be written to, which would effectively do the same thing. However, there are some things that you can do to reduce this problem. Specifically, with ASP.NET we support the ability to "lock down" settings at a parent directory. For example, you might want to lock down the security identity of the worker process (i.e.: the username it runs under) at the machine level and then restrict sub-applications' abilities to override it.

Q: I see confusion as to whether to mimic the Windows DNA model by creating ASP Presentation interfaces talking to COM+ components, or in the .NET era to just write code behind and stick Dynamic Link Libraries (DLLs) in the /BIN and be done with it.

Mark Anders : I would say that services provided by COM+ are still required if you want transactions. However, the model of using DCOM to put components on another box and scale out that way is not recommended.

Scott Guthrie : In general I would recommend continuing to logically partition your application code (which was one of the things Windows DNA suggested). For example, putting all of your data access logic within modular classes that you then call them from pages—like we do from the IBuySpy applications. ...In general, you shouldn't use COM+ transactions unless you are actually doing distributed transactions across multiple data store machines. If you are just updating a single database, then leverage the transaction capabilities within it.

Q: What if you are planning on using remoting to communicate between our first and middle tiers, and you've only gotten C# working? Are there any known issues today with using remoting to communicate from ASP to Visual Basic (VB)?

Scott Guthrie : There shouldn't be any problems doing remoting from VB (like C#), although you should be a little careful about how to use remoting. In many cases it is best not to do the extra network hop. There is a big performance penalty to going to the other machine, so you shouldn't look to do it for either performance or scalability reasons. It does make sense if you are connecting to a different application or data center, where for org/technical or political reasons you need code to run elsewhere.

Q: What if you want to use it to communicate from Web servers that are hosted at an outsourcer across a firewall back to the network where the databases are? For security reasons, we won't put the database out in the DMZ.

Scott Guthrie : One other possible solution you might also investigate for that would be to leverage ISA (Internet Security and Acceleration) server, where you would put ISA in front of the firewall, and then ASP.NET and the database behind it. We actually just finished doing some benchmarking numbers with that solution and saw really great results. It is also really easy to set up and administer, and might be easier to ultimately deploy and manage going forward. One nice thing about ISA is that it doesn't require any ASP.NET code changes to leverage it, so it is pretty easy to try out and evaluate.

Q: Could you comment on interoperability (via Session Objects, Query Strings, etc.) between ASP and ASP.NET? Any gotchas?

Mark Anders : There are a few. First, we've made the object models as close as possible. However, if for example you store COM objects (not new CLR objects) in sessions, and you want those to be out of proc, they won't work. You need to have new objects that can be serialized. One thing to note is that ASP and ASP.NET will run side by side on a box, because at an application level ASP and ASP.NET do not share sessions.

Q: I've seen a lot of concern that data can be passed page to page (ASP to and from ASP.NET).

Mark Anders : Since we really use standard Web techniques, passing info page to page should not be a problem. However, page to page in ASP and ASP.NET typically assumes services that are provided by each, such as session and application state. These services are not shared, and so you can't rely on them.

Scott Guthrie : I have a list of things you can do to ease migration of ASP code to ASP.NET.

1.                  Use only a single language within the ASP application. Don't intermix VBScript and JScript together in the same page (in general a bad programming practice with ASP, but also a migration issue for ASP.NET in that we now require only one inline <% %> language.

2.                  Explicitly declare all of ASP page functions within a <script language="VBScript" runat=server> block as opposed to <% %> blocks. In ASP.NET we no longer support this later function declaration option. It is just a copy/paste change in order to fix I

3.                  Explicitly use VBScript's "Option Explicit" keyword at the top of every ASP Page (this will become the default with ASP.NET and will also ensure that you write slightly better code today).

4.                  Use the "Call" keyword anytime they call a subroutine in VBScript today (for example: "Call FooBar (1, 2)"). This will enable/require them to wrap parenthesis around all subroutine arguments (if you don't use the "call" keyword, then VBScript today will raise a compilation error if you have parentheses). In VB.NET, parentheses are now required (note that the "call" keyword is still supported in VB.NET). So if they didn't use the "call" keyword, they'd have to go back and change all subroutines.

5.                  Avoid relying on "default properties" in VBScript, and instead fully qualify property references: (For example, with an ADO Recordset write: rs("a_name").Value instead of just rs("a_name")). Default properties are no longer supported in VB.NET.

6.                  Avoid using "render function" tricks (a specific unintended hack/trick that people can use in ASP but which was never intended as a feature). Instead explicitly use Response. Write blocks when constructing render functions.

Q: Scott , are there any estimates on the time needed to migrate a project from ASP to ASP.NET? I've seen a rough number of 5 percent of the development time to migrate a VB 6 project to VB.NET.

Scott Guthrie : I actually don't have any good time estimates. It's going to depend somewhat. In general, if you follow the ASP coding suggestion I posted above, then I think the porting effort should be pretty minimal (a day or two for even complex apps)

A Conversation with Brian Harry on the Common Language Runtime

Brian Harry is the Product Unit Manager for the Common Language Runtime. He has contributed to the design and features of the CLR from its very beginning, serving first as Development Manager and then as Product Unit Manager. Before the Common Language Runtime, Brian worked on SourceSafe and the Microsoft Repository. He joined Microsoft in 1994.

Q: We have heard a lot about possible support for generics in future versions of the runtime. Can you explain your current thinking about generics, and how they might be used i.e. functional languages, templates etc.?

Brian Harry : We have had an effort in Microsoft Research for over a year to design and implement generics in the Runtime. The research team has, in fact, already implemented generics in both the Runtime and the C# compiler. The product team has reviewed the design and implementation and is generally happy with the approach. It is similar to the implementation we have for arrays. You'll note that arrays are a form of generic (or parameterized type).

Q: Is the CLR for NT4 and Windows 2000 a fully self-contained module for deployment purposes? In other words, does it upgrade IIS on NT4 and supply all the elements needed as a fully self-contained entity?

Brian Harry : No, the CLR does not redistribute many other pieces of the operating system. We will have a set of pre-requirements that will specify the OS service pack, version of IE, etc. There will be a .NET Framework redistributable that is pared down from the SDK by quite a bit.

Q: What is the relationship between the CLR and the CLI that's been submitted to the W3C?

Brian Harry : The CLI is a specification for many of the core designs that the CLR implements. In addition to the CLI specification, the CLR implements many Windows specific features like COM interop, Windows Security Policy, Windows Forms, etc.

Q: Where are we in the ECMA process?

Brian Harry : We are working with the technical committees to refine the specifications for submittal. This is a fairly long process and involves a lot of input and consensus building.

Q: Please explain how Long and Short Weak References work and the usage scenarios for both.

Brian Harry : The differences between long and short weak references are when the object reference inside the weak reference gets nulled out.

Q: So if the reference is held after GC then it is considered long?

Brian Harry : For short references, the contained reference gets nulled out as soon as the object is deemed unreachable. This is ultimately more performant because we remove the reference sooner. Long weak references are nulled after the object has been finalized.

Q: What benchmarks have been run comparing the CLR to native code?

Brian Harry : We have run a large set of benchmarks comparing the CLR to native code and are still measuring and tuning performance. We have broken benchmarks down into a variety of categories, including: Web, rich Windows apps, Benchmarks and micro benchmarks. For Web we have compared mostly to ASP and a bit to JSP. ASP.NET proves to be substantially faster than both in almost every scenario. For rich windows apps we have taken a variety of forms-based apps and have focused on tuning working set and startup time. We have also done a variety of benchmarks like Spec 95, Spec 2000, Bytemark, etc.

Q: There have been a lot of questions about running transactions on the .NET platform. Care to comment?

Brian Harry : We fully support transactions on the .NET platform. We fully support the COM+ Services and have worked hard to make sure that writing CLR components is the best way possible to write software that takes advantage of the COM+ services.

Q: Is there a lot of sample code for leveraging transactions from within .NET code?

Brian Harry : Indeed, there are quite a lot of samples of using all of the COM+ services available. Some are in the SDK and some are on gotdotnet.com

Q: If I utilize COM+ on Windows 2000, will the CLR enable COM+ like functionality on NT4 or will some sort of MTS interop have to occur?

Brian Harry : We have not done anything to move COM+ Services to NT4. MTS is on NT4 and there have not been any recent updates to that code.

Q: Tell me about deployment of the CLR and Whistler—will it be native (in the shrink-wrap)?

Brian Harry : We have been looking at the schedules to decide whether the .NET Framework could ship with Whistler. No decision has been made, so I have nothing to announce.

Q: I am interested in your opinion of distributed transactions (two phase commit) over Web Services?

Brian Harry : My opinion is that you should not, in general be doing DTC style 2 phase commit across Web Services. I am not the expert on this, but Web Services were designed for loosely coupled computing and compensating transactions is a better approach to this style of application. That said, it is possible to build a tightly coupled app over web services, it just wasn't the design point.

Q: So if you need to span a transaction across two Web Services calls, use a compensating transaction on failure?

Brian Harry : Yes, that is my opinion, I'd be interested in what the COM+ Services team has to say about that, but I believe they would agree with me.

Q: Idempotent transactions then?

Brian Harry : I'm not sure what you mean by idempotent transaction. What I mean is a transaction that can be reversed.

Q: Can you talk about features of the CLR that help high volume applications run faster and more stable than our existing platforms? For example, memory allocation appears to be rather streamlined now that GC is in the picture.

Brian Harry : There are several aspects to the .NET Framework that help improve reliability and scalability. Starting with things like the built in thread pool, easy asynchronous programming, the general approach of a stateless server programming model that enables scale out, the ASP.NET process model that enables process recycling, auto restart, etc.

Q: I know that was a pretty generic question. Can you talk a little bit more about the built-in thread pool?

Brian Harry : The CLR has a thread pool that has been heavily optimized to cooperate with the GC and the managed environment. It has a very simple and approachable API but is very powerful. Further we are strongly promoting using the thread pool, especially in server apps rather than spinning up application threads to process work loads. Using the thread pool will result in a much more scalable application

Q: What exactly do you mean by "easy asynchronous programming."

Brian Harry : Easy asynchronous programming. I mean, there is a well-established design pattern, our frameworks expose it where appropriate, we enable many modes: callback, polling, subsequent block for completion, etc. Also, you can use asynchronous delegates to easily turn any API into an asynchronous API.

Q: How is interoperability testing going with the CLR being installed onto a system with many other apps already installed—Office, Visio, etc.?

Brian Harry: At a lower level type safe code helps reduce memory leaks, eliminates dangling pointers and deployment issues, all helping contribute to more reliable applications. We are thoroughly testing internally in every configuration we can imagine. Further, we are doing a VERY wide beta program. Recent data I saw showed that the .NET Framework Beta1 had reached almost 1 million people.

Q: What are the definite "no-no's" for developers writing to the CLR?

Brian Harry : Hmmm, most of the no-no's are the same as always—don't allocate too much memory, don't write n^2 algorithms, etc. The main things that are added, are you need to be careful where your managed/unmanaged boundaries are and how many times you cross them. You also need to be aware of security checks. Too many can kill your perf so you need to design for them.

Q: Can you comment on the CLR on other non-Windows platforms?

Brian Harry : We have a product under development called the .NET Compact Framework targeted at devices and designed to be very portable. We also have submitted the core specs to ECMA and expect to get a lot of cross platform implementations as a result of that.

Q: Are there design considerations for those writing applications to the CLR to make it easy to run on Starlite? I'm thinking architecture of the applications to make it easy to have a CLR version and a read-made Starlite version? "Ready-made" type.

Brian Harry : Yes, the .NET Compact Framework will have a subset of the overall .NET class libraries (in order to keep the size down) but it will also include device specific features (like wireless APIs). You can either write an app that targets .NET compact framework, leveraging the device APIs, or you can write one that targets the intersection with the desktop. I believe the docs will help you identify this intersection.

Q: In reference to string manipulation, it appears that we can no longer directly manipulate the buffer in managed code. For example, string[0] = 'a'. Instead we do something like string.Replace(0, 'a') and get a new string back.

Brian Harry : Yes, the reason for this is that strings are immutable. This makes for a simpler programming model and eliminates problems around synchronization and sharing of strings. In some cases, it allows us to give better performance by avoiding copying strings.

StringBuilder allows you to modify the string in place. A string builder can be converted to a string and then it becomes immutable.

Q: Does this mean if I had a member variable that is a StreamReader, I will need to implement it to be able to call the StreamReader's close method?

Brian Harry: StreamReader—It will depend on how your class is used, but if you are exposing it out to arbitrary clients, then yes you might want to.

Q: Under what conditions do I need to implement Idisposable.

Brian Harry : A class should implement IDisposable if it encapsulates "limited" resources. Examples are: window handles, file handles, database connections, etc. Anything where the user of the resource needs to be able to free itpreemptively.

Q: A related question is why do you really care about resurrection, i.e. getting the object back to life once it has died?

Brian Harry : Actually, I don't care about resurrection; it is a terrible thing in my opinion. It is somewhat of a necessary evil of the notion of Finalizers. We had a plan (which we may bring back in a future version) for something called "static finalizers" that would eliminate the possibility of resurrection.

Q: Is it true that deterministic finalization cannot be achieved because of resurrection, or am I mixing them here?

Brian Harry : No, deterministic finalization has nothing to do with resurrection. Resurrection is an issue after we have already run the finalizer. Deterministic finalization (as I have most frequently heard it used) has to do with not calling the finalizer at a well-defined point in time.

Q: Which brings us back to my question about when to use long and short weak references?

Brian Harry: Long/Short—As a general rule, always use short weak references. Only use long ones if you need to access the handle to find the object even during finalization. This is a very rare need. There are some caching schemes where this turns out to be valuable but I don't think I could describe them very well without spending a while to think about it.

 

写给音响工程师的科普文章(二)——从模电角度去了解调音台话放     上一篇讲到调音台第一级放大电路为差分放大器,关于差分放大器的基础知识可以参考以下资料:https://wenku.baidu.com/view/e6a46aaa2af90242a995e537 在教材中的差分放大器基本形式是这样子的,在实际电路中把RE电阻换成两个2倍RE,于是变成这样 然后我们现在来对比调音台中的差分放大器和教材中的有什么区别,我就拿yamaha 01V 96来说... 阅读详情

相关推荐

ANSYS APDL生死单元实战:焊接模拟从入门到精通(附完整命令流)

本文详细介绍了使用ANSYS APDL进行焊接模拟的核心技术——生死单元法。通过一个完整的平板对接焊案例,从原理剖析、模型搭建、命令流编写到移动热源施加和后处理,手把手指导工程师掌握这一动态仿真方法,有效预测焊接过程中的温度场、残余应力与变形。

k6l7m8n9的博客 151

技术图文:C#语言中的泛型 II

C#语言中的泛型 I 知识结构: 6. 泛型接口 泛型类与泛型接口结合使用是很好的编程习惯,比如用IComparable<T>而非IComparable,以避免值类型上的装箱和拆箱操作。若将接口指定为类型参数的约束(接口约束),则要使用实现此接口的类型。在设计泛型接口时,我们需要注意以下几点: (1)一个接口可以定义多个类型参数,如下所示: public interface IDictionary<TK, TV> { //... } (2)可以用多个接口为类型参数指定接

老马的程序人生 1121

避开封号风险!wxauto+Claude API实现微信智能客服的合规方案

本文详细介绍了如何利用wxauto和Claude API构建合规的微信智能客服系统,避免封号风险。通过技术选型对比、防封策略设计及大模型接入实践,为企业提供了一套安全高效的解决方案,特别适合中小企业在微信生态中部署AI客服。

sql99的博客 446

C#命名规范(参考)

两种命名方式: Pascal:每个单词首字母均大写 Camel: 第一个单词首字母小写,其余单词大写 1.Class命名:采用Pascal方式,不加任何前缀或后缀,在微软给出的建议中认为这些是冗余信息。 2.Method命名:采用Pascal方式,使用动词或动词短语,如Remove();或GetCharArray();等。 3.参数命名: 采用Camel方式,微软反对使用匈牙利命名方式,...

weixin_30527323的博客 238

单相PWM整流器的数学模型、工作原理

单相PWM整流器的数学模型、工作原理

weixin_58670090的博客 1万+

国产信创服务器软硬件兼容情况1 --- ARM架构

信创,即信息技术应用创新产业,它是数据安全、网络安全的基础,也是新基建的重要组成部分...

一只猿的自我修养 4741

C#揭密II(大师们在说些什么?) (转)

C#揭密II(大师们在说些什么?) (转)[@more@]C#揭密II(大师们在说些什么?) 先声明这篇文章属于收藏性质的,推荐给那些喜欢do.NET技术的爱好者。这之前我曾转载了O'Reilly的一篇关于C#的访谈录。O'R...

csd3176的博客 213

WordPress主题开发实战:从零开始手把手教你创建自定义主题(含常用函数大全)

本文是一份WordPress主题开发实战指南,从零开始手把手教你创建自定义主题。内容涵盖主题核心文件结构、模板层级与循环机制、函数与钩子的运用,并附有详细的常用函数大全,帮助开发者彻底掌握主题开发的核心技能,实现从使用者到创造者的转变。

weixin_27943395的博客 255

C#揭密II

 C#揭密II(大师们在说些什么?)C#揭密II(大师们在说些什么?)先声明这篇文章属于收藏性质的,推荐给那些喜欢dotNET技术的爱好者。这之前我曾转载了OReilly的一篇关于C#的访谈录。OReilly一向以技术和评论公见长,他们的编辑一般都有着很深的技术背景和功力(所以出的书也比较贵haha),所以那篇着重整个流行技术,有不少是和Java相关的;而这一篇都是MS内部的几个高手在

学习之路 1629

白盒测试逻辑覆盖之谓词覆盖、子句覆盖、三类有效字句覆盖等知识点

本篇笔记会简化书本上的概念,用容易理解的方式来说明,有些例子打字麻烦,我会直接放图片! 目录 基础知识: 谓词覆盖predicate coverage 子句覆盖 clause coverage 组合覆盖 combinatorial coverage 有效字句覆盖Active Clause Coverage 广义有效子句覆盖(General Active Clause Coverage) 相关性有效子句覆盖(Correlated Active Clause Coverage) 限制性有效

weixin_46019681的博客 2664

RFC-only 与 SAProuter 场景下,让 Claude 真正参与 SAP ABAP 开发

SAP ABAP 开发这几年正在出现一个很有意思的变化。过去我们说开发工具,脑子里大多是 SE80、SE38、SE24、SEGW、Eclipse ADT,再往后是 BAS、VS Code、abapGit、ATC、CI/CD。现在又多了一层,Claude Code、Claude Desktop 这类 AI 编程助手开始通过 MCP 进入开发现场,不只是写一段示例代码,而是能读系统里的 ABAP 对象、搜索包、改源码、跑检查、辅助重构。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 1617

【JVM】对象内存布局

HotSpot JVM 中,Java 对象内存布局由对象头(12字节,含Mark Word与压缩Klass Pointer)、实例数据及对齐填充构成,总大小为8字节倍数。对象头支持锁状态动态复用,指针压缩使引用仅4字节,但堆超32GB时失效。实例字段按类型优先级重排序以减少间隙,最小对象大小为16字节。通过JOL工具可精准验证布局,理解锁机制、GC、伪共享等底层行为。

2301_79732484的博客 149

《唤醒你的AI同事:WorkBuddy从零上手》004:与其他 AI 工具的对比

把 WorkBuddy 与聊天机器人、办公套件内置 AI、自动化工具逐维对比,并按当前版本补充四项新差距:结果交付、连接器广度、资料库与多模态产出。

LuckyHanMo的博客 669

Lua 与 ToLua:运行机制及热更新原理

本文解析 Lua 与 ToLua 在 Unity 中的运行机制及热更新原理。Lua 作为可嵌入语言,通过编译字节码由虚拟机执行,支持运行时加载新脚本;ToLua 实现 C# 与 Lua 的双向调用,通过生成 Wrap 代码注册类型接口;热更新依赖于宿主动态加载并执行新脚本,结合资源管理、版本控制与状态处理机制。关键点包括:table 共享引用、函数值不随重定义更新、闭包捕获状态、元表实现类逻辑,以及对象跨语言传递的生命周期管理。完整热更新需独立设计补丁分发与回滚策略。

2503_90324697的博客 129

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

使用lxml操作 Word 的 OpenXML 底层

本文综合介绍了使用lxml操作Word底层OpenXML文档的基础知识,并给出了一个效率远超VBA的提取Word文档中的表格的HTML表结构的实例,演示了用lxml获取及修改部分Word文档组成部件的文本、属性的方法。

yivifu的专栏 397

计算机控制技术及应用

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

C#使用opencv和Yolo模型识别车牌号

本文基于OpenCVSharp与OnnxRuntime,结合YoloV8n-pose_plate模型(检测车牌位置)和OCR模型(识别车牌文字),实现高效车牌识别。通过预处理、目标检测、NMS筛选及文字识别流程,最终输出车牌框位置与识别文本。代码封装良好,支持自定义路径与置信度阈值,具备实际应用价值。

lweiyue的专栏 163

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

C# NAFNet 图片去模糊

基于NAFNet与ONNX Runtime的C# WinForms图片去模糊工具,支持DirectML GPU加速与CPU回退,实现一键去模糊、大图分块处理、并排对比及拖拽打开。具备高DPI适配、自绘圆角界面、命令行批量处理等功能,适用于Windows 10/11系统,可灵活配置模型路径与分块大小,解决显存不足与边缘接缝问题。

hixiong123的博客 237

使用C#代码提取、修改或删除 Excel 中的超链接

通过 C# 和 VB.NET,可以方便地管理 Excel 文件中的超链接,包括提取、修改和删除等操作。提取超链接: 获取工作表中的超链接集合,读取每个超链接的地址和类型,并将相关信息保存到文本文件中。修改超链接: 更新超链接的显示文本和目标地址,确保链接信息准确。删除超链接: 移除指定的超链接,同时可以选择保留单元格中的原有显示文本,或清除单元格的全部内容。这些操作可以帮助开发人员更高效地管理 Excel 文档中的链接信息,减少重复的手动操作,也便于在数据迁移、文档维护和自动化报表处理等场景中使用。

2501_93070778的博客 227

C#: 控件不支持透明的背景色

把透明度固定为255。

海天鹰 32

week11-词云图

核心逻辑:词频越高,文字字号越大;适合快速看文本高频关键词(影评、评论、摘要文本非常适配 CommentInfo.csv)

m0_66244637的博客 135

C# 基于OpenCv的视觉工作流-章115-单节点条件

本章介绍C#基于OpenCv的视觉工作流中单节点条件的设置,涵盖列表值范围判断(支持“与”“或”逻辑)、模块结果参数匹配判定,以及结果显示图像与字体配置。通过灵活设定条件,实现检测结果的OK/NG自动判定,提升视觉系统智能化水平。配套工具“VisionTool 探迹”已更新,新增海康相机、PC相机采集及多类通讯优化功能,助力工业视觉应用。

sali-tec的博客 245

基于 OPC UA 的半导体工厂化学气体传输 SCADA 监控系统:架构设计与 C# MVVM 实现

本文提出一套面向半导体化学气体传输的可演进SCADA系统,基于OPCUA统一信息模型与C#+WPF+MVVM技术栈,实现从气源到机台的全链路实时监控、安全联锁与追溯。通过资产树建模、分层解耦架构与标准对齐(SEMI E30/E95/S2),确保系统可扩展、可维护、可审计,满足高安全、高可靠要求,支持快速落地与持续演进。

ponygame的博客 328

把本地 docx 半自动发到 优快云 创作页(python实现)

本文介绍一套基于Python的自动化工具链,实现将本地Word文档(.docx)半自动发布至优快云创作页。通过docx2md.py将文档转为Markdown并导出图片,再用auto_upload.py自动粘贴文本与图片至网页编辑器,全程仅需双击脚本和点击输入框,支持40张图片按序粘贴,显著提升内容发布效率。

weixin_45615730的博客 193

C# 程序一键打包(PupNet-Deploy)

它允许开发者通过一个统一的配置文件(.pupnet.conf)和一个简单的命令行指令,自动完成 .NET 代码编译(dotnet publish)与目标平台原生安装包(如 Windows 的 Setup 安装程序、Linux 的 AppImage / Debian / RPM 包等)的封装。一键全自动: 完美打通了“源码编译 -> 依赖收集 -> 路径替换 -> 快捷方式/元数据注册 -> 原生安装包生成”的全套自动化流水线。一次配置多端适配: 只需维护一份配置文件,即可搞定多端发布。

czjnoe的博客 179
上一篇: 开始你的第一个多语言版本的dotNET 应用程序(WinForm篇)
下一篇: dotNET和VS.NET 学习录像
ccBoy
博客等级 码龄26年 6粉丝 96原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值