Archive for the 'Code Snippets' Category

28
Jul
09

Today’s Sites/Blogs

  • Ask the Performance Team (Thoughts from the EPS Windows Server Performance Team) – in their own words “… the Performance team covers a broad range of seemingly unrelated areas such as Core OS Performance, Printing, WMI and Terminal Services. Simply put – we’re a bit of a “catch-all” team. [...] Because we cover such a wide spectrum of technology, we see many different types of issues – some more frequently than others. So we thought we should share with the broader technical community. We’ll be sharing troubleshooting tips and technical information on areas of our specialty that we cover.”
  • 45+ Excellent Code Snippet Resources and Repositories – it is what it says it is.
27
Jul
09

Styling a ScrollViewer/Scrollbar in WPF

In his Styling A ScrollViewer/Scrollbar In WPF article Sacha Barber explains how to do exactly what the article’s title claims. :)

27
Jul
09

.NET Events: Multithreading Issues

Threadsafe Events article at CodeProject explains problems one might encounter with .NET events in a multithreaded environment (not necessarily stating the absolute truth but still). Unfortunately, no-one has figured out the perfect solution, and we will have to choose “the best from all bad solutions” for some time still.

Asynchronous Callback Contexts article by the same author shows possible solution for event cancellation, particularly during object disposal: end-users do not expect components to raise events after they have been disposed or after they have unsubscribed from these events. The author refers to his Nito Asynchronous Library as a way to solve this issue.

26
Jul
09

Today’s Sites/Blogs

  • Started to “bump” into the Smashing Magazine quite often nowadays. Usually it collects interesting Internet resources related to web development (notably CSS, HTML, AJAX, etc.) and design (user interfaces, fonts, new ideas, etc.), and also has some tutorial-like or how-to-like posts (e.g. about PNG optimization, common mistakes, etc.). Really nice! Webdesigner Depot, Line25 Web Design Blog, and Presidia Creative all have similar concept.
  • Windows Presentation Foundation SDK by Windows Presentation Foundation SDK writers and editors. Might be more interesting, but OK nevertheless.
  • Expression Blend and Design – The team blog of the Expression Blend and Design products
18
Jun
09

Best JavaScript, HTML, and CSS Practices for Beginners

31
May
09

Today’s Sites/Blogs

30
May
09

Security: Banned C Functions

memcpy() Is Going to Be Banned article at InfoQ talks about dangers of memcpy (and other memory/string related functions). Microsoft has more in-depth explanations as well as the list of Security Development Lifecycle (SDL) Banned Function Calls at MSDN. Also available from Microsoft is banned.h header file that, once included, will produce warnings for all the banned functions. Alternatively one can use the /W4-C4996 compiler option.

03
Mar
09

Win32/C++ Resources

A “healthy set” of Win32 and C++-related links (related stuff, anyway):

02
Mar
09

“Bit Twiddling”

Needed to do some “weird” things recently that involved bit operations, e.g. to create masks with certain number of bits set. During my “research” I found few interesting places:

15
Dec
08

Managed Windows API

Managed Windows API is a collection of C# components that wrap Windows API functionality – a nice addition to pinvoke.net.

17
Nov
08

A .NET Cryptography Primer

Found A .NET Cryptography Primer on State Street Gang blog. It is a four-part article:

14
Oct
08

Shadow Copying of .NET Applications

Shadow Copying of Applications article on CodeProject shows simple technique allowing one to run shadow copies of .NET applications (like ASP.NET is doing for long time already).

17
Sep
08

More C++ Idioms

More C++ Idioms is a Wikibook aimed toward anyone with an intermediate level of knowledge in C++ and supported language paradigms. The goal there is to first build an exhaustive catalog of modern C++ idioms, and later evolve it into an idiom language, just like a pattern language.

The thing has been started by the author of C++ Truths blog. The blog is interesting by itself, as it has really many interesting articles on advanced C++ topics.

26
Aug
08

Thread Synchronization: Wait and Pulse Demystified

Thread Synchronization: Wait and Pulse Demystified article on CodeProject describes low-level synchronization between threads in terms of Monitor class and its Wait, Pulse, and PulseAll methods. The MSDN documentation for these methods explains what they do, but not why or how to use them. This article fills this gap and demystifies them.

17
Aug
08

Introduction to D3DImage

Dr. WPF published Introduction to D3DImage on CodeProject. The release of .NET 3.5 SP1 made possible a whole new level of WPF-DirectX interop: a custom DirectX scene can now be composed with a WPF scene using the new WPF’s D3DImage feature.

14
Aug
08

Today’s Blogs

  • The Old New Thing by Raymond Chen – really nice blog with a lot of in-depth info, e.g. wonderful posts about The implementation of iterators in C# and its consequences (part 1, part 2, part 3), The implementation of anonymous methods in C# and its consequences (part 1, part 2, part 3), a lot of native Win32 topics (e.g. DLLs, processes, controls, etc.), etc. Probably there is no aspect of Windows that would not be covered at that blog! :)
  • jaredpar’s WebLog by Jared Parsons – blog of the author of RantPack – a library that features functional programming patterns (tuples, immutable/persistent collections), threading utils (futures, cancelable futures, active objects, various other primitives), etc. The blog is very interesting, and there are many insights into software development topics
08
Aug
08

Today’s Links

These are mostly related to systems’ programming:

02
Aug
08

Using RoutedCommands with a ViewModel in WPF

Well, Josh Smith is always producing good stuff: his Using RoutedCommands with a ViewModel in WPF at CodeProject is really cool!

01
Aug
08

marshal_as String Arrays

Giovanni Dicanio developed an extension (template specialization) to marshal_as<> library of Visual C++ 2008, to convert Unicode string arrays between managed (CLR) and native (STL/C++) code. The code is available at marshal_as String Arrays.

01
Aug
08

New Features in .NET/WPF 3.5 SP1

29
Jul
08

WPF Application Localization

WPF Runtime Localization article on CodeProject describes one way to do it. Interesting approach is to use WPF Localization Extension available freely on CodePlex. And then there is an article that goes in the same direction: WPF Localization – On-the-fly Language Selection.

29
Jul
08

Software Testing and Related Things

By accident found Google Testing Blog. Not bad.

One of the articles is called How to Write 3v1L, Untestable Code – a must-read for newbie (and not newbie too!) programmers. Not on this blog, but nevertheless related article is How To Write Unmaintainable Code by Roedy Green – very serious collection of bad things despite it is very funny to read.

26
Jul
08

Informikon

Informikon provides technical information and resources related to programming multimedia applications on Windows. There are quite many tutorials, blog, and forums and topics inlcude DirectShow, DirectX (also in managed environment), FFMpeg, etc.

17
Jul
08

How to find whether a GUI application is not responding?

How to find whether a GUI application is freezed or is not responding? – does exactly that… Everything is around the SendMessageTimeout function and SMTO_ABORTIFHUNG flag.

10
Jul
08

Today’s Sites/Blogs