Pretty printing math in C# desktop application

What is the best method of printing math equations in a C# (winforms) desktop application? The format for the source is not important; I can generate almost anything with a little effort. What is important is that it should be relatively high performance and low overhead (I know, I'm only supposed to pick 2 of { performance, size, features } but I want all 3.) Things I have considered:

漂亮的C#桌面应用程序的打印数学

在C#(winforms)桌面应用程序中打印数学方程式的最佳方法是什么? 来源的格式并不重要; 我可以通过一点努力来生成几乎任何东西。 重要的是它应该是相对较高的性能和较低的开销(我知道,我只应该选择2个{性能,尺寸,特性},但我希望全部3) 我考虑过的事情: LaTeX通过System.Process() - > dvipng。 问题:即使是最小的LaTeX安装大约是200 MB。 考虑到我的应用程序目前约为400k,我认为这有点过分。 为Web设

Problem with loading compiled c code in R x64 using dyn.load

I recently went from a 32bit laptop to a 64bit desktop (both win7). I just found out that I get an error now when loading dll's using dyn.load . I guess this is a simple mistake and I am overlooking something. For example, I write this simple c function (foo.c): void foo( int *x) {*x = *x + 1;} Then compile it in command prompt: R CMD SHLIB foo.c Then in 32bit RI can use it in R: >

使用dyn.load在R x64中加载已编译c代码的问题

我最近从32位笔记本电脑转到64位桌面(都是win7)。 我刚刚发现,当我使用dyn.load加载dll时,我得到一个错误。 我想这是一个简单的错误,我忽略了一些东西。 例如,我写这个简单的c函数(foo.c): void foo( int *x) {*x = *x + 1;} 然后在命令提示符下编译它: R CMD SHLIB foo.c 然后在32位RI中可以在R中使用它: > dyn.load("foo.dll") > .C("foo",as.integer(1)) [[1]] [1] 2 但是在64bit RI得到: > d

Playing 2 sounds together at same time

Designing a game for any laptop: I want to play 2 sounds at the same time! A background music and a sound when pressing on a button! Using System.Media won't allow me to play 2 sounds together. For background music, I used the following: SoundPlayer sp = new SoundPlayer(@"....bindebugtribal dance.wav"); sp.Play; If I played another SoundPlayer , the previous one stops! I want the ba

同时播放2个声音

设计任何笔记本电脑的游戏: 我想同时播放2个声音! 按下按钮时会出现背景音乐和声音! 使用System.Media不允许我一起播放2个声音。 对于背景音乐,我使用了以下内容: SoundPlayer sp = new SoundPlayer(@"....bindebugtribal dance.wav"); sp.Play; 如果我播放另一个SoundPlayer ,则前一个停止! 我想要背景音乐继续播放,直到表单关闭! 同时,如果点击一个按钮,音乐将播放另一个声音! 我也尝试将Windows Med

App Domain Level Impersonation

I am developing an application that needs to load plug-ins into separate child app domains. Only one plug-in is loaded into one child app domain. Each plug-in requires different Windows identity and those identities are different from the Windows identity used in default (parent) app domain. Each plug-in loads one or more of its child plug-ins. Eg Identity of default app domain is AuthorityL

应用程序域级别模拟

我正在开发一个需要将插件加载到单独的子应用程序域的应用程序。 只有一个插件被加载到一个子应用程序域中。 每个插件都需要不同的Windows标识,并且这些标识与默认(父级)应用程序域中使用的Windows标识不同。 每个插件都会加载一个或多个子插件。 例如,默认应用程序域的标识是Authority Limited(Authority是域名或机器名称)。 两个插件被加载到两个子应用程序域中。 加载的插件的身份是Authority Privileged1和Au

Catch multiple exceptions at once?

It is discouraged to simply catch System.Exception . Instead, only the "known" exceptions should be caught. Now, this sometimes leads to unneccessary repetitive code, for example: try { WebId = new Guid(queryString["web"]); } catch (FormatException) { WebId = Guid.Empty; } catch (OverflowException) { WebId = Guid.Empty; } I wonder: Is there a way to catch both exception

一次捕获多个异常?

仅仅捕获System.Exception就不鼓励了。 相反,只有“已知”的例外应该被捕获。 现在,这有时会导致不必要的重复代码,例如: try { WebId = new Guid(queryString["web"]); } catch (FormatException) { WebId = Guid.Empty; } catch (OverflowException) { WebId = Guid.Empty; } 我想知道:有没有办法来捕获这两个异常,只调用一次WebId = Guid.Empty调用? 给出的例子很简单,因为它只是一个GUID 。 但想象

Azure SDK 1.3 opens two browser windows (or tabs)

Why is it that when run I website using Azure SDK 1.3 it opens two browser windows (or tabs) despite the fact that I have only defined one end point: <Sites> <Site name="Web"> <Bindings> <Binding name="Endpoint1" endpointName="Endpoint1" /> </Bindings> </Site> </Sites> What do I have to do to get just one browser window appearing when

Azure SDK 1.3打开两个浏览器窗口(或选项卡)

为什么在使用Azure SDK 1.3运行我的网站时,尽管事实上我只定义了一个端点,但它打开了两个浏览器窗口(或标签): <Sites> <Site name="Web"> <Bindings> <Binding name="Endpoint1" endpointName="Endpoint1" /> </Bindings> </Site> </Sites> 当我从Visual Studio运行(使用F5)Azure应用程序时,只需要一个浏览器窗口就可以做什么? 看起来这是一个明显的A

How to get resource strings from ASP.NET markup?

Hi I have an assembly called like X.Common.DLL. There is some resources files for multilanguage app. Let's say it Language.resx Language.en-US.resx....etc.... I have a web application which contains this above dll as reference... So how can I use this resources file in my web applications markup side? Text="<%$ Resources:Class, ResourceKey %>" is not valid because of &

如何从ASP.NET标记获取资源字符串?

嗨,我有一个叫做X.Common.DLL的程序集。 有一些资源文件的多语言应用程序。 让我们说它Language.resx Language.en-US.resx ....等.... 我有一个Web应用程序,其中包含上面的dll作为参考... 那么如何在我的Web应用程序标记端使用这个资源文件呢? Text="<%$ Resources:Class, ResourceKey %>"由于“Class”名称位于另一个程序集中而无效... 你可以很容易地创建一个类似这样的包装类 public class Resour

Difference Between Select and SelectMany

I've been searching the difference between Select and SelectMany but I haven't been able to find a suitable answer. I need to learn the difference when using LINQ To SQL but all I've found are standard array examples. Can someone provide a LINQ To SQL example? SelectMany flattens queries that return lists of lists. For example public class PhoneNumber { public string Number

Select和SelectMany之间的区别

我一直在搜索Select和SelectMany之间的区别,但我一直无法找到合适的答案。 我需要了解使用LINQ To SQL时的差异,但我发现的都是标准数组示例。 有人可以提供一个LINQ To SQL的例子吗? SelectMany平返回列表的查询。 例如 public class PhoneNumber { public string Number { get; set; } } public class Person { public IEnumerable<PhoneNumber> PhoneNumbers { get; set; } public string Name {

What is the difference between a field and a property?

在C#中,什么使字段与属性不同,以及何时应该使用字段而不是属性? Properties expose fields. Fields should (almost always) be kept private to a class and accessed via get and set properties. Properties provide a level of abstraction allowing you to change the fields while not affecting the external way they are accessed by the things that use your class. public class MyClass { // this is a fi

领域和财产之间有什么区别?

在C#中,什么使字段与属性不同,以及何时应该使用字段而不是属性? 属性公开字段。 字段应该(几乎总是)对类保持私有,并通过get和set属性进行访问。 属性提供了一个抽象级别,允许你改变字段,而不影响它们被使用你的类的东西访问的外部方式。 public class MyClass { // this is a field. It is private to your class and stores the actual data. private string _myField; // this is a property. When a

Post WP7 Game Achievements from XNA to Facebook

Lately we've been working on a 3D XNA-powered game for Windows Phone 7. We wanted to integrate an achievements system and be able to post achievements to Facebook. My question is: have someone done already a similar thing? Are there any good tutorials/resources on how to do so? To my understanding, in order to login on Facebook, one can fire a WebBrowserTask on XNA, which will open a url

从XNA到Facebook发布WP7游戏成就

最近我们一直在为Windows Phone 7开发一款3D XNA驱动的游戏。我们希望整合成就系统并能够将成就发布到Facebook。 我的问题是:有人做过类似的事情吗? 有没有什么好的教程/资源如何做到这一点? 据我了解,为了在Facebook上登录,可以在XNA上触发一个WebBrowserTask,它将使用Internet Explorer应用程序打开一个URL,但同时当用户按下后退按钮时,xna游戏将被停用并重新激活。 OAuth令牌可以使用我们自己的服务器传回应用程