知乎周源微信_每周源代码23-大解决方案版

2023-12-20 11:50

本文主要是介绍知乎周源微信_每周源代码23-大解决方案版,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

知乎周源微信

知乎周源微信

My source code reading didn't have any rhyme or reason to it this week, but most of them were large, so this is the Big Solution Edition. In my new ongoing quest to read source code to be a better developer, Dear Reader, I present to you twenty-third in a infinite number of posts of "The Weekly Source Code."

我的源代码阅读本周没有任何押韵或理由,但其中大多数内容很大,因此是Big Solution Edition。 在我不断追求阅读源代码以成为更好的开发人员的过程中,亲爱的读者,我在无限数量的“每周源代码”中向您介绍了十二分

大图片 (BigPicture)

Vertigo Software, the folks that did the Deep Zoom Hard Rock site at Mix have released to CodePlex their mouse-wheel support in a project called Big Picture. When I saw this initially, I said, "meh" but then realized upon reading it that there's some clever stuff here that goes beyond the mouse-wheel support that folks rushed to add (myself included) to their DeepZoom Helloworld Examples.

Vertigo Software是在Mix进行Deep Zoom Hard Rock网站开发的人们,已在一个名为Big Picture的项目中向CodePlex发布了其鼠标滚轮支持。 当我最初看到此内容时,我说“嗯”,但随后在阅读它时才意识到,这里有一些巧妙的东西,超出了人们匆忙添加到他们的DeepZoom Helloworld示例中的鼠标滚轮支持。

First, they've figured out (as of Silverlight 2.0 beta 1) how to disable the initial "zoom from nowhere" animation in DeepZoom. They turn UseSprings off initially, then turn it back on after the first motion has completed:

首先,他们弄清楚了(从Silverlight 2.0 beta 1起)如何在DeepZoom中禁用初始的“无处缩放”动画。 他们首先关闭UseSprings,然后在第一个动作完成后将其重新打开:

/// 
/// Handles the "MotionFinished" event fired by the MultiScaleImage, but only re-enables the "UseSprings"
/// property after the first motion completes (a little trick to properly bypass the initial "zoom in
/// from nowhere" animation when first loading)
///
/// The MultiScaleImage instance.
/// Unused RoutedEvent arguments.
void image_InitialMotionFinished(object sender, RoutedEventArgs e)
{
if (!isInitialMotionFinished)
{
isInitialMotionFinished = true;
image.UseSprings = true;
}
}

Simple, and obvious after the fact, but I hadn't figured it out. They also handle the issue of funky Uris in development vs. production by using App.Current.Host.Source:

事后简单,显而易见,但我还没有弄清楚。 他们还使用App.Current.Host.Source处理开发与生产中时髦的Uris问题。

Uri collectionUri;
if (Uri.TryCreate(App.Current.Host.Source, "/Collection/items.bin", out collectionUri))
image.Source = collectionUri;

They've also created a nice MultiScaleImageWrapper to encapsulate all the panning and zooming into one class.

他们还创建了一个不错的MultiScaleImageWrapper ,将所有平移和缩放封装为一个类。

开发服务器 (DevServer)

I wasn't sure what to make of this project when I started looking at it. The Project Description kind of made my eyes gloss over:

当我开始看这个项目时,我不确定该怎么做。 项目描述让我眼前一亮:

NetFXHarmonics DevServer is a web server hosting environment built on WPF and WCF technologies that allows multiple instances of Cassini-like web servers to run in parallel. DevServer also includes tracing capabilities for monitoring requests and responses, request filtering, automatic ViewState and ControlState parsing, visually enhanced HTTP status codes, IP binding modes for both local-only as well as remote access, and easy to use XML configuration.

NetFXHarmonics DevServer是基于WPF和WCF技术构建的Web服务器托管环境,它允许多个类似Cassini的Web服务器实例并行运行。 DevServer还包括用于监视请求和响应的跟踪功能,请求过滤,自动ViewState和ControlState解析,视觉增强的HTTP状态代码,仅本地访问和远程访问的IP绑定模式以及易于使用的XML配置。

Other than the WCF app we built at my last company, I haven't seen a lot of WCF stuff, and DevServer is an interesting and complete example of a Cassini-like Web Server. He wrote it because he wanted to more easily debug multiple WCF Services and ASP.NET Web Sites all working together. Rather than using client-side or sniffing tools, why not just take over the server?

除了我们在上一家公司创建的WCF应用程序外,我还没有看到很多WCF东西,DevServer是一个类似Cassini的Web服务器的有趣且完整的示例。 他之所以写它是因为他想更轻松地调试所有一起工作的WCF服务和ASP.NET网站。 与其使用客户端或嗅探工具,不如直接接管服务器?

The source is interesting to read holistically, but is also full of little useful utility methods. He parses out, decodes, and displays ViewState, shows headers, formatted and raw content, etc.

完整地阅读该源代码很有趣,但也充满了很少的有用实用程序方法。 他解析,解码并显示ViewState,显示标题,格式化的原始内容等。

David Betz is a very prolific writer of code and has a number of projects up on CodePlex he's given back to the community. One particularly interesting one is his Minima .NET 3.5 Blog Engine that he uses as a training tool. It also, of course, runs his blog. Spend some time over there, there's lots to learn.

大卫·贝茨 他是一个非常多产的代码编写者,并且在CodePlex上有许多项目,他已经回馈社区了。 一个特别有趣的是他用作培训工具的Minima .NET 3.5博客引擎。 当然,它也运行他的博客。 在那儿花一些时间,有很多东西要学习。

可视LINQ查询生成器 (Visual LINQ Query Builder)

LINQ is a little confusing and it can be difficult to visualize your queries and write them. Mitsu from MS France and his two French Students Simon Ferquel and Johanna Piou have written a Visual Query Builder for LINQ and enabled it in Visual Studio as an Add-In.

LINQ有点混乱,并且很难可视化查询并编写查询。 来自法国法国的Mitsu和他的两个法国学生Simon Ferquel和Johanna Piou已经为LINQ编写了一个可视化查询生成器,并在Visual Studio中将其作为插件启用。

The Add-In uses WPF and has a number of cool animations and a fresh UI design. You can drag your LINQ to SQL classes in from the Class View and visually build the LINQ query using dynamically generated Listboxes and an innovative Tree View I've not seen before.

加载项使用WPF并具有许多很酷的动画和新颖的UI设计。 您可以从类视图中将LINQ拖到SQL类中,并使用动态生成的列表框和以前从未见过的创新树形视图直观地构建LINQ查询。

The Results pane shows not only a preview of the data that will be returned, but also the generated SQL and the generated LINQ query and code. The results are put in a static method in a static utility class.

“结果”窗格不仅显示将要返回的数据的预览,还显示生成SQL以及生成的LINQ查询和代码。 将结果放在静态实用程序类的静态方法中。

 

All the better, the code is available and while it feels early and beta-esque, it's an interesting read. I really enjoy looking at how folks lay out their solution structures.

更好的是,该代码可用,虽然感觉很早并且具有beta风格,但这是一本有趣的文章。 我非常喜欢看人们如何布置他们的解决方案结构。

They've also made liberal use of Class Diagrams, presumably because they're students, but also because they are attentive to detail, so for the harder parts, like Query Formatting, there is an associated Class Diagram. Another feature of VS2008 I always forget.

他们还自由地使用了类图,大概是因为他们是学生,而且因为他们注重细节,所以对于较难的部分(如查询格式),有一个关联的类图。 VS2008的另一个功能我总是忘记了。

They've factored out an interesting VS Integration Project that could be of help to folks who are interested in making a Visual Designer and plugging it into Visual Studio. There's also a number of interesting WPF Controls like a "MultiStepControl" and "TreeListView."

他们提出了一个有趣的VS集成项目,该项目可能对有兴趣制作Visual Designer并将其插入Visual Studio的人们有所帮助。 还有许多有趣的WPF控件,例如“ MultiStepControl”和“ TreeListView”。

This is an exceedingly large amount of work, and it's going to take me a while to digest it. In some ways it feels brilliant and in others it seems incredibly complex, possibly overly so. Fortunately, you don't have to read the source, you can just use by installing their MSI if you like.

这是一项非常庞大的工作,需要我花一些时间来消化它。 从某些方面来说,它感觉很出色,而在另一些方面,它似乎是如此复杂,甚至可能过于复杂。 幸运的是,您不必阅读源代码,只要愿意就可以通过安装其MSI来使用。

翻译自: https://www.hanselman.com/blog/the-weekly-source-code-23-big-solution-edition

知乎周源微信

这篇关于知乎周源微信_每周源代码23-大解决方案版的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/515938

相关文章

Java 线程安全与 volatile与单例模式问题及解决方案

《Java线程安全与volatile与单例模式问题及解决方案》文章主要讲解线程安全问题的五个成因(调度随机、变量修改、非原子操作、内存可见性、指令重排序)及解决方案,强调使用volatile关键字... 目录什么是线程安全线程安全问题的产生与解决方案线程的调度是随机的多个线程对同一个变量进行修改线程的修改操

java向微信服务号发送消息的完整步骤实例

《java向微信服务号发送消息的完整步骤实例》:本文主要介绍java向微信服务号发送消息的相关资料,包括申请测试号获取appID/appsecret、关注公众号获取openID、配置消息模板及代码... 目录步骤1. 申请测试系统2. 公众号账号信息3. 关注测试号二维码4. 消息模板接口5. Java测试

全面解析MySQL索引长度限制问题与解决方案

《全面解析MySQL索引长度限制问题与解决方案》MySQL对索引长度设限是为了保持高效的数据检索性能,这个限制不是MySQL的缺陷,而是数据库设计中的权衡结果,下面我们就来看看如何解决这一问题吧... 目录引言:为什么会有索引键长度问题?一、问题根源深度解析mysql索引长度限制原理实际场景示例二、五大解决

SpringSecurity显示用户账号已被锁定的原因及解决方案

《SpringSecurity显示用户账号已被锁定的原因及解决方案》SpringSecurity中用户账号被锁定问题源于UserDetails接口方法返回值错误,解决方案是修正isAccountNon... 目录SpringSecurity显示用户账号已被锁定的解决方案1.问题出现前的工作2.问题出现原因各

javax.net.ssl.SSLHandshakeException:异常原因及解决方案

《javax.net.ssl.SSLHandshakeException:异常原因及解决方案》javax.net.ssl.SSLHandshakeException是一个SSL握手异常,通常在建立SS... 目录报错原因在程序中绕过服务器的安全验证注意点最后多说一句报错原因一般出现这种问题是因为目标服务器

C++高效内存池实现减少动态分配开销的解决方案

《C++高效内存池实现减少动态分配开销的解决方案》C++动态内存分配存在系统调用开销、碎片化和锁竞争等性能问题,内存池通过预分配、分块管理和缓存复用解决这些问题,下面就来了解一下... 目录一、C++内存分配的性能挑战二、内存池技术的核心原理三、主流内存池实现:TCMalloc与Jemalloc1. TCM

MyBatis Plus 中 update_time 字段自动填充失效的原因分析及解决方案(最新整理)

《MyBatisPlus中update_time字段自动填充失效的原因分析及解决方案(最新整理)》在使用MyBatisPlus时,通常我们会在数据库表中设置create_time和update... 目录前言一、问题现象二、原因分析三、总结:常见原因与解决方法对照表四、推荐写法前言在使用 MyBATis

Python基于微信OCR引擎实现高效图片文字识别

《Python基于微信OCR引擎实现高效图片文字识别》这篇文章主要为大家详细介绍了一款基于微信OCR引擎的图片文字识别桌面应用开发全过程,可以实现从图片拖拽识别到文字提取,感兴趣的小伙伴可以跟随小编一... 目录一、项目概述1.1 开发背景1.2 技术选型1.3 核心优势二、功能详解2.1 核心功能模块2.

Java死锁问题解决方案及示例详解

《Java死锁问题解决方案及示例详解》死锁是指两个或多个线程因争夺资源而相互等待,导致所有线程都无法继续执行的一种状态,本文给大家详细介绍了Java死锁问题解决方案详解及实践样例,需要的朋友可以参考下... 目录1、简述死锁的四个必要条件:2、死锁示例代码3、如何检测死锁?3.1 使用 jstack3.2

html 滚动条滚动过快会留下边框线的解决方案

《html滚动条滚动过快会留下边框线的解决方案》:本文主要介绍了html滚动条滚动过快会留下边框线的解决方案,解决方法很简单,详细内容请阅读本文,希望能对你有所帮助... 滚动条滚动过快时,会留下边框线但其实大部分时候是这样的,没有多出边框线的滚动条滚动过快时留下边框线的问题通常与滚动条样式和滚动行