Showing posts with label c#. Show all posts
Showing posts with label c#. Show all posts

October 23, 2008

Use proxy settings from "Set up my proxy server" on Windows Mobile (C#)

The following code allows to retrieve xml with proxy details.

XmlDocument arg = new XmlDocument();
arg.LoadXml("<wap-provisioningdoc><characteristic-query type="\"CM_ProxyEntries\"/"></characteristic-query><wap-provisioningdoc><characteristic-query type="\"></characteristic-query>");
XmlDocument prox = ConfigurationManager.ProcessConfiguration(arg,
true);


Unfortunately if your proxy requires username and password this approach will return only username.

May 14, 2007

Moneytrackin - online сервіс для ведення фінансів

Новий сервіс, повністю у стилі Web 2.0, та ще й при цьому дуже швидко розвивається, набуваючи все новіших можливостей і стаючи все зручнішим для пересічного користувача.

Однією з цікавих можливостей є не просто підтримка багатьох мов, але й можливість участі будь якого користувача у локалізації сервісу - для цього розроблено простий і зручний інструмент. Тому сервіс підтримує і українську мову. Але це все ж не основне, що дає сервіс. Сервіс успішно використовує вироблені впродовж останнього часу можливості, які дають користувачу онлайн програми у стілі Web 2.0

1. Швидкий інтерфейс з використанням AJAX
2. Всі транзакції можна помічати теґами - що в даному випадку дає можливість не тільки знайти і проаналізувати потрібні транзакції, а ще й подивитись на кругових діаграмах які теґи більш витратні.
3. Соціальність - можна давати права на читання чи модифікацію ваших рахунків іншим людям.
4. АРІ для розробників - інтеграції сервісу з іншими програмами/сервісами.
5. Завдяки мобільній версії з сервісом можна працювати з будь-якого телефону, який підтримує WAP.
6. Widget (gadget), який можна розмістити на свою домашню сторінку iGoogle чи Netvibes.

Крім того

- є непогані можливості побудови графіків для аналізу
- можливість вести кілька рахунків одночасно
- імпорт/експорт даних (наприклад в/з ексель)

Тому сервіс - це чудовий інструмент, для ведення приватної бухгалтерії чи навіть бухгалтерії для невеличких проектів, навіть не будучи великим експертом у фінансах - все інтуїтивно зрозуміло.

Ще один огляд сервісу російською мовою.
Ще один огляд.

December 21, 2006

Что должен знать правильный .NET-разработчик

Каждый кто пишет код

* Объясните разницу между нитью (Thread) и процессом (Process)
* Что такое сервис (Windows Service) и как его жизненный цикл отличается от «стандартного» EXE?
* Какой максимальный объем памяти может адресовать один процесс? Отличается ли он от максимального объема виртуальной памяти, доступной системе? Как это влияет на структуру системы?
* В чем различие между EXE и DLL?
* Что такое строгая типизация (strong-typing) в сравнении со слабой типизацией (weak-typing)? Какая предпочтительнее? Почему?
* Некий продукт называют «контейнером компонентов» ("Component Container"). Назовите по крайней мере 3 контейнера компонентов, поставляемых с семейством продуктов Windows Server Family.
* Что такое PID? Чем он полезен при выявлении неисправностей системы?
* Сколько процессов могут слушать один и тот же порт TCP/IP?
* Что такое GAC? Какую проблему он разрешает?

.NET-разработчик среднего уровня

* Объясните разницу между интерфейсно ориентированным (Interface-oriented), объектно ориентированным и аспектно ориентированным (Aspect-oriented) программированием
* Объясните что такое «интерфейс» и чем он отличается от класса
* Что такое Reflection?
* В чем различие между XML Web Services с использованием ASMX и .NET Remoting с использованием SOAP?
* Являются ли системы типов, представленные в XmlSchema и в CLS — изоморфными?
* Концептуально, в чем различие между ранним и поздним связыванием (early-binding и late-binding)?
* Использование Assembly.Load — это статическая или динамическая ссылка?
* Когда уместно использование Assembly.LoadFrom, а когда Assembly.LoadFile?
* Что такое «Asssembly Qualified Name»? Это имя файла? В чем различие между ними?
* Правильно ли так писать?
Assembly.Load("foo.dll");
* Чем отличается «strongly-named» сборка от «НЕ strongly-named» сборки?
* Может ли DateTime равняться null?
* Что такое JIT? Что такое NGEN? Каковы преимущества и ограничения каждого из них?
* Как основанный на поколениях сборщик мусора в .NET CLR управляет жизненным циклом объекта? Что такое «non-deterministic finalization»?
* В чем различие между Finalize() и Dispose()?
* Чем полезен using()? Что такое IDisposable? Как он поддерживает deterministic finalization?
* Что делает эта полезная команда? tasklist /m "mscor*"
* В чем разница между «in-proc» и «out-of-proc»?
* Какая технология позволяет выполнять out-of-proc взаимодействие в .NET?
* Когда вы запускаете компонент из под ASP.NET, в каком процессе он работает под Windows XP? Windows 2000? Windows 2003?

Ведущий разработчик

* Что не так вот в следующей строке?
DateTime.Parse(myString);
* Что такое PDB? Где они должны находится, чтобы можно было выполнять отладку?
* Что такое «цикломатическая сложность» (cyclomatic complexity) и почему она важна?
* Напишите стандартный lock() плюс «двойную проверку» для создания критической секции вокруг доступа к переменной.
* Что такое «FullTrust»? Имеют ли FullTrust сборки, помещенные в GAC?
* Какие преимущества получает ваш код, если вы декорируете его атрибутами, относящимися к особым Security permissions?
* Что делает эта команда?
gacutil /l | find /i "Corillian"
* Что делает эта команда?
sn -t foo.dll
* Какие порты брандмауэра должны быть открыты для DCOM? Каково назначение порта 135?
* Сопоставьте OOP и SOA. Каковы принципы каждого из них?
* Как работает XmlSerializer? Каких ACL permissions требует использующий его процесс?
* Почему catch(Exception) почти всегда — плохая мысль?
* В чем разница между Debug.Write и Trace.Write? Когда должен быть использован каждый из них?
* В чем различие между компиляцией в Debug и в Release? Есть ли значительная разница в скорости? Почему или почему нет?
* Как работает JIT — по сборке целиком или по методу? Как это влияет на working set?
* Сравните использование абстрактного базового класса и использование интерфейса?
* В чем различие между a.Equals(b) и a == b?
* В контексте сравнения, что такое идентичность объектов по сравнению с эквивалентностью объектов?
* Как можно выполнить глубокое копирование (deep copy) в .NET?
* Изложите ваше понимание IClonable.
* Что такое «упаковка» (boxing)?
* string — это тип значений (value type) или ссылочный тип?
* В чем значимость паттерна "PropertySpecified", используемого в XmlSerializer? Какую проблему он пытается разрешить?
* Почему в .NET выходные параметры (out parameters) не стоит применять? Действительно ли это так?
* Может ли атрибут быть установлен на один из параметров метода? Чем это полезно?

Разработчик компонентов на C#

* Сопоставьте использование override и new. Что такое «shadowing»?
* Объясните использование virtual, sealed, override и abstract.
* Объясните использование и значение каждого компонента строки:
Foo.Bar, Version=2.0.205.0, Culture=neutral, PublicKeyToken=593777ae2d274679d
* Объясните различия между public, protected, private и internal.
* Какое преимущество вы получаете от использования первичной сборки взаимодействия (Primary Interop Assembly, PIA)?
* Благодаря какому механизму NUnit узнает, какой метод протестировать?
* В чем различие между:
catch(Exception e){throw e;} и
catch(Exception e){throw;}
* В чем разница между typeof(foo) и myFoo.GetType()?
* Объясните что происходит в первом конструкторе:
public class c{ public c(string a) : this() {;}; public c() {;} }
Чем полезна такая конструкция?
* Что такое «this»? Может ли this использоваться в статическом методе?

Разработчик на ASP.NET (UI)

* Объясните, как POST-запрос формы из браузера становится на серверной стороне событием — таким как Button1_OnClick.
* Что такое «PostBack»?
* Что такое «ViewState»? Как он кодируется? Является ли он шифрованным? Кто использует ViewState?
* Что такое element и для чего используются эти две технологии ASP.NET? (В оригинале: What is the element and what two ASP.NET technologies is it used for?)
* Какие три Session State providers доступны в ASP.NET 1.1? Какие преимущества и недостатки у каждого из них?
* Что такое «Web Gardening»? Как его использование влияет на проект?
* В заданном ASP.NET-приложении, сколько объектов-приложений имеется, если это одно-процессорная машина? двухпроцессорная? двухпроцессорная с включенным Web Gardening? Как это отражается на проекте?
* Используются ли нити (threads) ASP.NET приложения повторно для различных запросов (requests)? Получает ли каждый HttpRequest свою собственную нить? Должны ли вы в ASP.NET использовать Thread Local storage?
* Полезен ли атрибут [ThreadStatic] в ASP.NET? Есть ли побочный эффект? Это хорошо или плохо?
* Дайте пример того, как использование HttpHandler может упростить существующий проект, который обслуживает Check Images на .aspx-странице.
* На события какого вида может подписываться HttpModule? Какое влияние они могут оказать на реализацию? Что может быть сделано без перекомпиляции ASP.NET-приложения?
* Опишите способы представления «arbitrary endpoint (URL)» и направьте запросы к этой endpoint в ASP.NET.
* Объясните как работают cookies. Дайте пример злоупотребления Cookie.
* Объясните важность HttpRequest.ValidateInput()?
* Какого рода данные передаются в заголовках HTTP (HTTP Headers)?
* Сравните HTTP-запросы вида GET и POST. Что такое «HEAD»?
* Назовите и опишите по крайней мере 6 статус-кодов HTTP (HTTP Status Codes) и объясните о чем они говорят клиенту, давшему запрос.
* Как работает «if-not-modified-since»? Как это может быть программно реализовано на ASP.NET?
* Объясните <@OutputCache%> и использование «VaryByParam», «VaryByHeader».
* Как работает «VaryByCustom»?
* Как можно реализовать кэширование готового HTML в ASP.NET, кэшируя отправляемые версии страниц, полученные по всем значениям q= кроме q=5 (например, http://localhost/page.aspx?q=5)?

Разработчик, использующий XML

* В чем назначение XML Namespaces?
* Когда уместно использование DOM? Когда неуместно? Есть ли ограничения по размеру?
* Что такое «WS-I Basic Profile» и почему он важен?
* Напишите простой XML-документ, использующий пространство имен (namespace) по умолчанию, а также qualified (prefixed) namespace. Добавьте элементы из обоих пространств имен.
* В чем основное фундаментальное различие между элементами (Elements) и атрибутами (Attributes)?
* В чем различие между «Well-Formed XML» и «Valid XML»?
* Как бы вы валидировали XML используя .NET?
* Почему такое использование — почти всегда неудачно. В каких случаях такое уместно?
myXmlDocument.SelectNodes("//mynode");
* Объясните различие между «pull-style parsers» (XmlReader) и «eventing-readers» (Sax)
* В чем различие между XPathDocument и XmlDocument? Опишите ситуацию когда один из них может быть использован над другим.
* В чем различие между XML "Fragment" и XML "Document"
* Что означает — «каноническая» форма XML?
* Почему спецификация XML InfoSet отличается от Xml DOM? Что пытается решить InfoSet?
* Сравните DTD и XSD. В чем они схожи, в чем различны? Что предпочтительнее и почему?
* Поддерживаются ли DTD в System.Xml? Как именно?
* Всякая ли XML Schema может быть представлена в виде графа объектов? А наоборот?

Оригинал перевода:

http://www.c-gator.ru/articles/what-great-dot-net-developers-ought-to-know-interview-questions/

Оригинал поста на английском:

http://www.hanselman.com/blog/WhatGreatNETDevelopersOughtToKnowMoreNETInterviewQuestions.aspx

October 10, 2006

SharpForge - Open source C# SourceForge implementation

SharpForge supports collaborative development and management of multiple software projects. Similar to SourceForge or CodePlex but for your own team or organisation. The software is written in C# for .NET 2.0 is integrates with Subversion for source control and is released under the New BSD License.

September 25, 2006

MozBar

MozBar
A flexible toolbar very much like the toolbar in FireFox Options dialog.

I started this project when I needed something like the toolbar in FireFox's Options dialog in one of my other projects. This is where the name came from. I looked around but couldn't find any control that had what I needed so I decided to write my own.

Another benefit of writing this control was that it gave me the opportunity to play around with some of the techniques used in control creation, i.e., Designers, TypeConverters and TypeEditors. I will not go into code details (that's what the source code is for) but I will try to mention a little about the techniques used.

I took a lot of hints from Matthew Hall's Themed Taskbar for general design and use of collections, and I also borrowed John O' Byrne's excellent Imagelistpopup control, modified it slightly and used it in my image dropdown editor.

XPTable - .NET ListView meets Java's JTable

XPTable - .NET ListView meets Java's JTable
A fully customisable ListView style control based on Java's JTable.

For a project I'm working on I needed a highly customized ListView - one that would allow checkboxes and images in any column, ComboBoxes and NumericUpDowns for editing and it had to be easy to swap data in and out. Anyone who has tried customizing a ListView knows how painful it can be trying to bend it to your will, so I decided to create one from scratch. Having come from a Java background I decided to base it somewhat loosely on Java's JTable.

SourceGrid - Open Source C# Grid Control

SourceGrid - Open Source C# Grid Control
SourceGrid is a free open source grid control. Supports virtual grid, custom cells and editors, advanced formatting options and many others features

SourceGrid is a Windows Forms control written entirely in C#, my goal is to create a simple but flexible grid to use in all of the cases in which it is necessary to visualize or to change a series of data in a table format. There are a lot of controls of this type available, but often are expensive, difficult to be customize or not compatible with. NET. The Microsoft DataGrid for me is too DataSet orientated and therefore results often complicated to use in the cases in which the source data isn't a DataSet and often is not enough customizable.

I want to thank Chirs Beckett, Anthony Berglas, Wayne Tanner, Ernesto Perales, Vadim Katsman, Jeffery Bell, Gmonkey, cmwalolo, Kenedy, zeromus, Darko Damjanovic, John Pierre and a lot of other persons who helped me with code, bugs report and with new ideas and suggestions.

This control is compiled with the Microsoft Framework. NET 1.1 and reference the assembly SourceLibrary.dll 1.2.0.0, this is a small library with common functionality. I introduced this dll in the ZIP file, but is possible to download the entire code and the last binary from the site http://www.devage.com/. For use SourceGrid is necessary have Visual Studio.NET 2003 or a compatible development environment.

The last version of this control is downloadable from site http://www.devage.com/. If you have problems, ideas or questions write me to webmaster@devage.com .

In this article I will want to supply a panoramic on the utilization and on the functionality of the control SourceGrid, for the details on the classes, properties or methods you can consult the documentation in CHM format or the example project in the ZIP file.

February 28, 2006

Статті по ASP.Net на CodeProject

Riverside Internet Forums
This article describes a set of ASP.NET custom controls that make it quick and easy to add a forum to any web page. The forum code was initially written using VB script and ASP pages and one of the main goals was to mimic the look and feel of the CodeProject forums. Subsequently, the forums have been re-written in C# as ASP.NET custom controls. When the forums are viewed in Tree View mode, the look and feel is very similar to the CodeProject forums. However, in Flat View the forums look have been designed to look more like the forums found at http://www.asp.net/.

The Riverside Internet forums presented here are part of a larger set of ASP.NET custom controls that make up the Riverside Internet WebSolution. The complete WebSolution, as well as containing forums, provides controls for managing folders, documents and general web content. Eventually it is hoped that all of this code will be submitted to CodeProject.

Creating a DotNetNuke® Module - For Absolute Beginners!
Posted 27 Jan 2006
This article explains in detail the process of creating a DotNetNuke module.

ASP.NET Expand/Contract DataGrid
posted 3 Feb 2004

The ASP.NET DataGrid is very powerful and robust. However, some of the things we need it to do require lots of custom code. Denis Bauer's HierarGrid is an example of a very sophisticated datagrid. Unfortunately, my project needed the ability to expand and contract DataGrid columns rather than DataGrid rows, so I implemented the ExDataGrid server control which is described in this article. Much of the code logic was borrowed from HierarGrid.

You can check out the HierarGrid here.

You can also check out a live demo of ExDataGrid here.


DataGridNavigator
Posted 18 Apr 2004
One of my most used ASP.NET control is DataGrid. Presenting data from tables is very easy and nice with only one exception - the page navigator. Showing only page numbers or only two links (to previous and next page) is insufficient for me, and completely inexplicable for my clients. So I decided to create DataGridNavigator Server Control, the main task of which is to generate the page navigator for DataGrid object. The navigator can have the following buttons:

* to jump to the first / last page (text or image)
* to jump to the previous / next page (text or image)
* to jump to the page no. ... (text only :) )

The navigator control is rendered independently of the DataGrid control, and you can bind multiple navigators to one DataGrid.

AlphaNavigator Re-Make
Posted 5 Oct 2005
While browsing The Code Project, I ran across an article by micahbowerbank which provided a control for alphanavigation. I thought this was great!!! A client had requested a feature just like this. My initial idea was to use a simple DataGrid and handle everything myself... but dragging and dropping this control sounded too good to be true. I downloaded the control and tried to create a demo project to use it. Well immediately, I saw that the control seemed to need to open a connection and then it wasn't closed. I tried closing it and it bombed. I read a little into the messages following the control and decided it might be a good opportunity to learn about making your own custom controls. Waaalaa... here is my creation, really not much of micahbowerbank's creation is left... maybe small references here and there... and there are a lot of functionalities that you may decide to add to the control...however I laid out what I feel are the base parts of the control for you. Please be kind in your reviews as this is my first control ever!

An introduction to a post-relational database for .NET: Matisse - Part 6
Posted 3 May 2004
All the basics of the Matisse post-relational database have already been covered by this series of articles, along with its advantages, such as ease of use and better performance.

This article covers ASP.NET programming with the post-relational database. I have created two demo programs to illustrate this article. The first one is a Windows application that loads data with images into a database. The second one is an ASP.NET application that retrieves the images with meta data from the database and displays them using DataList. The programs are straightforward but there are a few tips that make the programs more compact and provide better performance.

Here is the list of previous articles:

* Part 1: Overview of Matisse.
* Part 2: Schema definition.
* Part 3: .NET programming to insert objects.
* Part 4: Using ADO.NET to retrieve objects.
* Part 5: Using Object-APIs for better performance.

Convert .NET Class to a DataGrid
Posted 19 Jul 2005

Everywhere you would see the OOPS concept and emphasizing you to work the oops, but ask anyone how to create a DataGrid from an ArrayList which is a collection of same class type, you will find people saying go for DataSet or create DataTable rows from these ArrayList items. I too faced the same problem when I was asked to design a DataGrid and what I got from the C# team was just an ArrayList.

I'm damn sure, one of you who is reading this article would say that it is still possible in DataGrid and one can use the "." operator, but if I ask you how to do sorting and paging on them, and what if the item is inside the ArrayList then you might not have any answer.

I am not saying this is 100% right, but this is one of the easiest ways of converting an ArrayList (which is a collection of a specific class type) to a DataTable, where you can have sorting, paging and filtering on the DataGrid. Since whatever DataTable you form finally has valid column names.

Database Navigator
Posted 5 Oct 2004
I wasn’t really sure if Google was not being effective, or if it was just me. I had been surfing the web for days searching for a simple solution to a simple problem: to be able to navigate through a database, using VCR-style controls (I can’t believe I’ve just said VCR…I meant DVD controls.)

In ASP.NET, the easiest way to move from record to record is putting a datagrid or a datatable, which was exactly what I didn’t wanted to use.
I also came across a C# soft that did pretty much the same as Database Navigator, but the code was extremely difficult to understand (at least for me…of course). Having a deadline and no solution in hand, this is what I’ve developed, which by the way, works nice

Applying Robustness Analysis on the Model–View–Controller (MVC) Architecture in ASP.NET Framework, using UML
Posted 23 Aug 2004

Recently, I wrote an article on the development of a master-page framework in ASP.NET. Master Page framework was an extension of the ASP.NET UI.Page framework, and most of it is related to the static appearance of the Page. Then, I started receiving emails about the dynamic behavior of pages, and controlling the interactions between user-controls on a page, and communication between different pages etc. So, I thought there is a need of discussion on this aspect of the .NET Framework, and this would not be possible without mentioning the Model-View-Controller Design Pattern, that is embedded everywhere in the ASP.NET Framework. This article is composed of two parts. In the first part, we will discuss in detail about the Model-View-Controller Design pattern in context to ASP.NET, using UML, and finish our discussion with writing an example application as a bonus for its implementation. In the next part of the article, we’ll wrap up our discussion with dynamic aspects of pages by explaining different types of fine-grained controllers with their design and implementation, and we’ll discuss about the details of the HTTP pipeline too and what is the best approach to use it; so stay tuned, lot to come :).

A New Approach to Designing Web Applications
Posted 10 Feb 2006

With all the hay being made about UML modeling, you'd think that was the only way to design an application. I've got news for you. It's the wrong approach.

Now, before you flame me for my heresy, read the rest of this paragraph. Much like the 60% genetic similarity between the genes of humans and fruit flies, almost all web applications are identical. Except that I would put the commonality at closer to 75%-90%. And I challenge anyone who's developed more than two web applications to dispute this fact. Face it, almost all that most applications do is get data, do something to it, then put it back. There's even an acronym for these applications: CRUD (Create, Retrieve, Update, Delete). This, of course, begs the obvious quip "I've sure seen a lot of CRUDdy applications in my day," or "That application is CRUD!"

Rapid Web Application Development
Posted 1 Apr 2005
The Multiformity engine consists of controls that are easy to configure, and accommodates many of the common needs for a web application that connects to a database. It automatically provides the abilities to add, edit and read data, as well as includes integrated help, treeview and scheduling controls and many other functionalities.

Note: The code has been converted and upgraded to ASP.NET 2.0 :D.

The purpose of this toolset is to allow for your development team to focus on the "rocket science" behind a specific project, rather than the mundane, day to day details of the given application. Below are a few screenshots of the inherent functionality of this system

An extended GridView that allows inserting rows
Posted 23 Feb 2006

This article describes (yet another) insertable GridView. You probably know that the GridView control is the preferred control in ASP.NET v.2 to display and edit tabular data. Although GridView is improved over the previous DataGrid control, it still lacks the capability of inserting new rows. Microsoft says that you can use the FormView or DetailsView components to insert a new row. However many times it is convenient to add a new row in-place. The modified web server GridView control I present makes this possible by adding a 'plus' image in the footer row. When pressed, a new row is added to the database with default values and the grid shows the new row in editing mode, at the bottom of the last grid page (see image below). If you press the cancel button the new row is deleted from the database. The sorting of the GridView is restored after editing the new row.

Insertable gridview when a new row is added

Besides the insert functionality, the code adds automatically button images in the first column of the grid for Select, Edit, Delete operations.

Editable Datagrid Binding - VS 2003 RAD approach (Asp .Net 1.1) - EditGrid
Posted 10 Feb 2006
This article outlines the fastest and simplest way to develop an Asp.Net 1.1 editable datagrid using VisualStudio 2003.

February 24, 2006

Castel project

Схоже, щось цікаве. Треба вивчити.

Стаття про застосування MVC для asp.net.

February 10, 2006

Як вибрати ORM для .Net

Гід для сабджекта.

Різні гіди для вибору примочок для .Net, в тому числі:
Object-Relational Mapping Tools for .NET
Charting Components for .NET
Visual Studio 2005 Licensing Options
PDF Components for .NET
Obfuscation Tools for .NET

Планується на сайті розмістити:
Build Tools for .NET
Data Reporting Components and Tools for .NET
Deployment Tools for .NET
Documention Tools for .NET
Internet Email Components for .NET
Raster Imaging Components for .NET
User Interface Component Suites for .NET
WinForm Data Grid Components for .NET