Senin, 14 Februari 2011

Интересная особенность конструкции foreach в языке C#

При написании кода на языке C# достаточно часто приходится использовать конструкцию foreach. Ведь так на много удобнее проходить по коллекциям, по сравнению с использованием цикла for. Безусловно, у каждого метода есть свои плюсы и минусы и выбор всегда зависит от конкретной задачи и ситуации. Но на днях меня удивила одни интересная особенность конструкции foreach, а  именно то, как это работает.

Posting to an ASP via Windows Sockets in C

IntroductionEver needed a quick way to get around to post text to a web server and get a response accordingly ? Look no further.  In this article i give the reader a class with 2 methods for testing the availability of the connection and for posting information. Background  I used this code to post major text files, line by line, of summaries on PocketPC (Windows Mobile) to a statistical web

Dealing With Native DLLs in .NET “AnyCPU” Builds

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

Displaying vtable when debugging

Due to some limitations the virtual table of an object is not shown by default in the debugger. In some cases only the entries from the base class is shown.class Base{    virtual void a(); };class Derived : public Base{    virtual void b();};Base* ptr = new Derived();which in a watch window givesptr->__vfptr 0x004420f8 const Derived::`vftable' [0x0] 0x00415ed3 Base::a(void) You can look at the

Расширяем log4net. Конкурентное логирование

Библиотека log4net известна и в представлении не нуждается. В ней есть практически всё, что нужно, «из коробки». Однако, есть специфические ситуации, в которых необходимо добавлять/расширять функциональность библиотеки. Конкретная ситуация: есть некоторая библиотека, которая выполняет логирование через log4net в некоторый логер (или несколько — не суть). Эта библиотека используется в N службах.

jQuery Tutorial - Creating an Autocomplete Input Textbox

With jQuery 1.8 came a brand new widget - the autocomplete input field. If used correctly, like in the case of Google's search suggestions, autocomplete can provide a major boost in productivity. Today's tutorial is going to demonstrate how to build and populate one of these autocomplete inputs. We're going to make two identical examples that get their data from two different sources - one will

MotherEffin HTML5 Boilerplate MVC 3 Site Template

This past week I’ve been reading up on the HTML5 Boilerplate project by Paul Irish (of the Google Chrome and jQuery teams fame).  The HTML5 Boilerplate project is a collection of all the best practices for modern day web development in one easy to use project template. Read more: Clarity consultingRead more: HTML5 Boilerplate MVC project template  Posted via email from Jasper-net

Утечки памяти в С++: Visual Leak Detector

В этой короткой заметке хочу рассказать о прекрасной программе для поиска утечек памяти под Visual Studio -- Visual Leak Detector. Она удивительно проста в использовании и выдает подробную информацию о найденных утечках, а на хабре пока не упоминалась. ПредысторияОднажды мне позарез понадобилось искать утечки памяти в одной программе на С++, притом средой разработки была Visual Studio.

Running .NET applications in-process using AppDomains

When testing a compiler for a managed language a very convenient end-to-end testing technique is to compile a test program, then run it and verify that it gives the expected output. Not only you cover all parts of the compiler in this manner (parser, binder and emitter), but also you verify that your compiler produces correct IL (otherwise the CLR won’t load and verify your assembly) and your

Quasar

Project Description Quasar is a suite of class libraries for .Net developers, providing data structures, algorithm, extension methods and other components which are not implemented in standard .Net framework. The library provides data structures like Trees, Heap, Queue, SkipList, Graph etc.; several useful extensions methods for .Net collections, strings, random numbers, delegates etc.;