DCSIMG
.NET 4 - Pavel's Blog
Sign in | Join | Help

Pavel's Blog

Pavel is a software guy that is interested in almost everything
software related... way too much for too little time

Browse by Tags

Visual Studio Tip: Show Threads in Source
29 May 12 12:20 PM | pavely | 1 comment(s)
Debugging multithreaded applications is always hard, so any help we can get from the debugger is appreciated. Here’s one tip that can help using Visual Studio 2010 when many threads are running at the same time, some of which run similar code.It’s tedious to lookup each thread’s call stack to see where its next instruction pointer is located. Here’s the Threads window in action: To find the actual source line each thread is at the breakpoint moment, we’ll need to switch to that thread by double clicking...
Windows Devices UG Meeting Reminder: WinRT & Metro Apps
17 April 12 06:31 PM | pavely | with no comments
The Windows Devices user group managed by Elad Shaham and myself is meeting next Tuesday (the 24th) at Microsoft Offices in Ra’anana. We’ll have two sessions dedicated to Windows 8. Full agenda and registration (free) is available at http://insidewindowsruntime.eventbrite.com/ See you there!
Asynchronous Programming with C# 5.0 & .NET 4.5 Session
26 March 12 01:38 PM | pavely | 1 comment(s)
This morning I gave a session on asynchronous programming with C# 5.0 at Microsoft offices in Ra’anana. Thank you all for attending, it was great fun! As promised, the presentation slides and demos are attached below (the Windows 8 demos can naturally be run on Windows 8 only). The session was recorded, so if you missed it, or just want to hear the same jokes again, the recording will be available in a few days – check out the MSDN blog for details of availability. Async Demos Async Metro Demo Presentation...
What happened to asynchrony with WebClient in .NET 4.5?
17 March 12 04:01 PM | pavely | 1 comment(s)
In the Visual Studio 2010 Async CTP , a bunch of extension methods have been added to the WebClient class, to facilitate the “awaiting” of C# 5.0, such as DownloadStringTaskAsync , which can be simply used like so: var wc = new WebClient (); string result = await wc.DownloadStringTaskAsync( "http://msdn.microsoft.com" ); One of the overloads present in the CTP accepts a CancellationToken , so that the operation could be cancelled by an external CancellationTokenSource . For example: async...
From Enumerable to Observable
18 January 12 12:56 PM | pavely | 3 comment(s)
The IEnumerable<T> interface represents a collection of objects of type T, and is used heavily thanks to the C# foreach construct. Better yet, in the LINQ world, this is the interface that is “extended” via extension methods by the System.Linq.Enumerable class. This makes IEnumerable<T> both easy to use as well as powerful. But is it the best interface for getting data out of a possible collection? Recap: what is IEnumerable<T> ? IEnumerable<T> has only one method: GetEnumerator...
Calculating PI in .NET
30 December 11 10:31 PM | pavely | 2 comment(s)
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...
Parallel Programming Open House Session
01 December 11 05:34 PM | pavely | with no comments
Today I presented a half-day session on Multithreading & Parallel Programming at John Bryce center in Tel Aviv. Thank you all for attending! I certainly enjoyed presenting these fascinating topics. I’ve attached the demos I showed. The presentation will be sent to those who attended by email. Thank you! ParallelDemos
Some Short Videos I Made
26 May 11 02:30 PM | pavely | with no comments
I’ve created a few short videos, covering some introductory material – still may be useful for some… The audio quality is not the best possible, but should be fairly understandable. All the videos are in Hebrew (sorry, non-Hebrew speakers! You can still watch me type code samples, it may have some value) The videos are: Introduction to C# 5.0 asynchronous programming Introduction to the Managed Extensibility Framework (MEF) Understanding XAML (Part 1) Understanding XAML (Part 2)   They are also...
PSSCOR4 Debugger Extension Released
29 April 11 07:04 PM | pavely | with no comments
A while back, Microsoft released the PSSCOR2 debugger extension for WinDbg, supporting more command than the classic SOS.DLL. This was for CLR v2 (.NET 2-3.5). Now a similar extension has been released for CLR 4 (.NET 4). You can download it here . There are versions for x86 and x64. The easiest way to use them is copy the relevant DLL to the .NET framework directory for the corresponding “bitness” (where SOS lives, something like C:\Windows\Microsoft.NET\Framework\v4.0.30319 (32bit) or C:\Windows...
Dealing With Native DLLs in .NET “AnyCPU” Builds
13 February 11 09:27 PM | pavely | 2 comment(s)
A .NET application can be compiled using the “AnyCPU” configuration, meaning the application runs as 32 bit on a 32 bit OS, and 64 on a 64 bit OS. As long as the application is purely managed, everything should be just fine. However, if the application must use some native DLL through interop (e.g. P/Invoke), then “AnyCPU” may be an issue. A native DLL cannot be both 32 and 64 bit – it’s one or the other. The traditional solution to the problem is to switch the .NET build to a “Win32” or “x64” configuration...
My TechEd Session: MEF & Unity
02 December 10 08:52 PM | pavely | 2 comment(s)
My session was scheduled for the last time slot of the conference. I was really glad to see so many of you there, especially considering that many people were on their flights back home and there was Alex ’s XNA session right next door. Thank you all for coming! I talked about the idea of Inversion of Control (IoC) and one way of achieving that, through Dependency Injection (DI). The slides can be downloaded from here , and the demos from here . In the old COM days, the legendary Don Box (now at...
XNA 2D Game Tutorial (Part 3)
04 November 10 08:59 AM | pavely | 9 comment(s)
In part 2 we finally saw something other than a black window. Our ship sprite is just standing there: pretty boring. We want to move it a bit – perhaps using the arrow keys, so that the player has some control over her ship. XNA supports several input devices: the keyboard, the mouse and the game pad (usually with the XBOX). Accessing all those devices is pretty straightforward and surprisingly similar. We’ll use the keyboard in our game. To access the keyboard, we call the Keyboard.GetState static...
תגים:, , ,
XNA 2D Game Tutorial (Part 1)
01 November 10 10:30 AM | pavely | 15 comment(s)
I like creating games. In fact, that’s what drew me into the computer world back in 1983. It’s amazingly satisfying seeing one of your creations looking like it’s alive, making decisions and reacting to the player’s actions. Back then I used to create games for the legendary Commodore 64 , with it’s 64KB of RAM (of which about 39K was free for the programmer), 1MHz 6510 CPU (yes, 1 mega-hertz!), its video chip (VIC) that supported 8 hardware sprites (more on that in a bit) and its sound chip (SID...
Windows Platform Developers User Group meeting
06 October 10 10:45 PM | pavely | 3 comment(s)
This evening was a WPDUG meeting on CLR hosting and CLR profiling. Thank you all for coming! It was a pleasure to see so many of you there. My session was on CLR hosting, using the new CLR 4 hosting API. This is done using native code (C++) that uses COM for communication between the CLR and the host, both ways. I showed how to enumerate the installed runtimes, how to load a specific CLR (a new feature of CLR 4 – the ability to host multiple CLRs in a single process), how to create an application...
My Introduction to .NET 4 and C# 4 Session
04 September 10 09:07 PM | pavely | with no comments
About a week ago I presented an introduction to .NET 4 and C# 4.0 at Microsoft offices. Thank you all for attending! Here are the slides and demos. Intro to .NET 4 and C# 4 PPT Intro to .NET 4 and C# 4 Demos
תגים:, , ,
More Posts Next page »