上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 35 下一页
摘要: 最近项目中在用Linq Distinct想要将重复的资料去除时,发现它跟Any之类的方法有点不太一样,不能很直觉的在呼叫时直接带入重复数据判断的处理逻辑,所以当我们要用某个成员属性做重复数据的判断时,就必需绕一下路,这边稍微将处理的方法做个整理并记录一下。 首先为了方便接下去说明,我们必须先来准备后面会用到的数据类别,这边一样用笔者最常用来示范的Person类别,内含两个成员属性ID与Name... 阅读全文
posted @ 2014-05-23 18:39 马语者 阅读(2149) 评论(0) 推荐(0) 编辑
摘要: 如果是在代码中添加的形状,获取Shape.RenderedGeometry会出错。 这是由于WPF没有更新形状的原因,调用Shape.Arrange()后问题解决。 阅读全文
posted @ 2014-05-22 11:31 马语者 阅读(318) 评论(0) 推荐(0) 编辑
摘要: First off, we can use our Line-Point Distance code to test for the "BOUNDARY" case. If the distance from any segment to the test point is 0, then return "BOUNDARY". If you didn't have that code pre-wr... 阅读全文
posted @ 2014-05-20 10:27 马语者 阅读(376) 评论(0) 推荐(0) 编辑
摘要: In the previous section we saw how to use vectors to solve geometry problems. Now we are going to learn how to use some basic linear algebra to do line intersection, and then apply line intersection t... 阅读全文
posted @ 2014-05-20 10:26 马语者 阅读(261) 评论(0) 推荐(0) 编辑
摘要: Introduction Many TopCoders seem to be mortally afraid of geometry problems. I think it's safe to say that the majority of them would be in favor of a ban on TopCoder geometry problems. However, geo... 阅读全文
posted @ 2014-05-20 10:25 马语者 阅读(402) 评论(0) 推荐(0) 编辑
摘要: It is not possible using the .NET BCL. However if you really want it you can use native SetCursorPos inUser32.dll. [DllImport("User32.dll")]private static extern bool SetCursorPos(int x, int y);As ot... 阅读全文
posted @ 2014-05-19 19:27 马语者 阅读(1459) 评论(0) 推荐(0) 编辑
摘要: have tested this, it worked, at least for me var x1 = Canvas.GetLeft(e1);var y1 = Canvas.GetTop(e1);Rect r1 = new Rect(x1, y1, e1.ActualWidth, e1.ActualHeight);var x2 = Canvas.GetLeft(e2);var y2 = ... 阅读全文
posted @ 2014-05-19 11:27 马语者 阅读(1431) 评论(0) 推荐(0) 编辑
摘要: have a Canvas with a couple of elements on it like Line, Path and Text Box. In the MouseOver event of the Canvas there's a HitTest for all of them like: bool HitTest( Point p ){ return VisualTreeHel... 阅读全文
posted @ 2014-05-15 16:23 马语者 阅读(921) 评论(0) 推荐(0) 编辑
摘要: The .NET framework comes with a variety of different serializers. Hopefully, my overview of these serializers will have provided some insight into the differences between them and the various advantag... 阅读全文
posted @ 2014-05-14 16:18 马语者 阅读(263) 评论(0) 推荐(0) 编辑
摘要: string test = "Testing 1-2-3";// convert string to streambyte[] byteArray = Encoding.ASCII.GetBytes(test); MemoryStream stream = new MemoryStream(byteArray);// convert stream to stringStreamReader rea... 阅读全文
posted @ 2014-05-14 16:16 马语者 阅读(217) 评论(0) 推荐(0) 编辑
上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 35 下一页