background preloader

Programming

Facebook Twitter

Tutorial - "Hello World!" Introduction Where to get help If you're having trouble going through this tutorial you can contact us through the discussion list or directly. RabbitMQ is a message broker. In essence, it accepts messages from producers, and delivers them to consumers. RabbitMQ, and messaging in general, uses some jargon. Note that the producer, consumer, and broker do not have to reside on the same machine; indeed in most applications they don't. "Hello World" (using the .NET/C# Client) In this part of the tutorial we'll write two programs in C#; a producer that sends a single message, and a consumer that receives messages and prints them out.

In the diagram below, "P" is our producer and "C" is our consumer. The .NET client libraryRabbitMQ speaks AMQP, which is an open, general-purpose protocol for messaging. Now we have the .NET client binary, we can write some code. Sending We'll call our message sender Send and our message receiver Receive.cs. In Send.cs, we need to use some namespaces: Set up the class:

Mongo

Felice Pollano Blog - Multiple Charts with WPF Dynamic Data Display. I was looking for a good open source charting library and I noticed that is a little difficult to find something really useful and easy to use. I had a look at the WPF Toolkit charting library, a little old for sure, but look promising at a first glance. Unfortunately it is not so easy to use, not brilliant in term of speed and with some discutable behavior, as for example the absence of a way to remove the chart animation, or removing the fancy bullet in the line chart. By digging a little deeper I found the WPF Dynamic Data Display Even if it seems not recently updated in term of source code, it has a professional level functionality, easy to customize and use, and with some effort MVVM compatible. Make sure to download the unreleased latest source changeset because it is dramatically different from the released one.

Here below we show hoe to use this charting library for a very common task, creating multiple chart with the same X Axis. This is the only trick. Xaml Side: Microsoft Web API – the REST is done by WCF (Part 1) Postings published on this series so far: (c) geek&poke When speaking of SOA today, many developers still think about Web Services (which in case of .NET are ASP.NET Web Services or Windows Communication Foundation, briefly WCF) handling SOAP using XML and other standards to enable Remote Procedure Calls (read: calling functions on remote computers). As remote computers may be part of foreign domains or even available on the internet the need for authentication and authorization came up fast and has been satisfied by introducing the WS-Security extension to SOAP. Another need of course has been to have reliable messaging which lead to another extension called WS-Reliability.

In order to be able to describe schemas of SOAP messages WSDL had been introduced. As you can see, there is a great effort to exchange data between two endpoints on the network. And even worse: the list of extensions and format definitions is by far not complete, not to mention the problems arising in the wild. ASP.NET WebAPI Hosting Techniques. Download Sample Code Introduction In this article we shall see different methods of WebAPI hosting. We will be creating a class library for API Controller and reference the same in various hosting projects. If you started working with WebAPI , soon you will start copy pasting the WebAPI controllers and related things over and over in each projects say you have planned to host one in Console or wish to perform unit testing or host the same in IIS as Web Application. When you are hosting your WebAPI in IIS , all your API controllers gets compiled and will be available in the application domain so you can make a HTTP Web request to your API controller.

There is currently a bug associated with the WebAPI framework, When you are hosting your WebAPI in a console or windows service using HttpSelfHostServer , the HttpControllerDispatcher is unable to map the incoming URL request to the API controller if you are trying to reference the WebAPI as a class library. 1. 2. Background Using the code 1.

Your First Web API (C# HTTP is not just for serving up web pages. It is also a powerful platform for building APIs that expose services and data. HTTP is simple, flexible, and ubiquitous. Almost any platform that you can think of has an HTTP library, so HTTP services can reach a broad range of clients, including browsers, mobile devices, and traditional desktop applications. ASP.NET Web API is a framework for building web APIs on top of the .NET Framework. In this tutorial, you will use ASP.NET Web API to create a web API that returns a list of products. Software versions used in the tutorial Create a Web API Project In this tutorial, you will use ASP.NET Web API to create a web API that returns a list of products.

Start Visual Studio and select New Project from the Start page. In the Templates pane, select Installed Templates and expand the Visual C# node. In the New ASP.NET Project dialog, select the Empty template. You can also create a Web API project using the "Web API" template. Adding a Model That's it! WPF: TabControl Series - Part 1: Colors and Sizes. Introduction The out-of-the-box TabControl is pretty ugly (is that just my personal opinion?). Attempting to KISS, meaning i.e. simply changing the colors used for rendering the TabControl itself and/or the TabItems however will not give you all too much of a chance to "remedy" its appearance. Instead, you'll have to completely replace the control's Style (that is, its default template). I'll try to cover some aspects in the scope of this article. Overview This article is part of a multi-part series. Outcome: the result of what's covered in this article First, let's see what we'll be left with at the end of this article (in other words "lessening the ugly screenshot coming up next" Before we start, please note that I wrapped up everything provided in the scope of this article as a sample solution.

Also, you'll notice that, in the screenshots, the TabControl appears larger than it would be in a real-world application. Status quo: the default appearance Alright, let's get started. But wait! Aforge AI in .net library. Install Quartz.Net as a windows service and Test installation. In this blog post I’ll be covering, 01: Where to download Quartz.net from 02: How to install Quartz.net as a Windows service 03: Test the Quartz.net Installation If you are new to Quartz.Net I would recommend going through, 01 – Where to download Quartz.net?

Currently version Quartz.Net 2.0.1 is the recommended download version. 02 – How to install Quartz.net as a Windows service Go to the download location and unzip the Quartz.net package Navigate to the folder Quartz.Net \ Server \ bin – This is where you will find different .net version installers of the quartz.net packages. A blog post on more configuration details can be found here. 03 – Test Quartz.Net windows service installation So, I have installed Quartz.Net as a windows service, how do I test whether my installation has been successful. Open up cmd as an administrator and run the below command, C:\Program Files (x86)\Quartz.Net> Quartz.Server.exe –i. Quartz.Net Writing your first Hello World Job. In this blog post I’ll be covering, 01: A few things to consider before you should schedule a Job using Quartz.Net 02: Setting up your solution to use Quartz.Net API 03: Quartz.Net configuration 04: Writing & scheduling a hello world job with Quartz.Net 05: Download Quartz.Net sample project and instructions If you are new to Quartz.Net I would recommend going through, 01 – A few things to consider before you should schedule a Job using Quartz.Net To schedule a job to run on Quartz.Net windows service at the very minimum you need the 3 items listed below, - An instance of the scheduler service - A trigger - And last but not the least a job But a few additional things that you should think about are… For example, if I wanted to schedule a script to run on the server, I should be jotting down answers to the below questions, a.

B. C. D. E. F. G. 02 – Setting up your solution to use Quartz.Net API 1. Figure – Adding Quartz.Net reference to my project via Nuget Package Manager 2. 3. 1. 2. 3. 4. C# 5.0/4.0 in a Nutshell - PredicateBuilder. Dynamically Composing Expression Predicates Suppose you want to write a LINQ to SQL or Entity Framework query that implements a keyword-style search. In other words, a query that returns rows whose description contains some or all of a given set of keywords. We can proceed as follows: IQueryable<Product> SearchProducts (params string[] keywords) { IQueryable<Product> query = dataContext.Products; foreach (string keyword in keywords) { string temp = keyword; query = query.Where (p => p.Description.Contains (temp)); } return query; } The temporary variable in the loop is required to avoid the outer variable trap, where the same variable is captured for each iteration of the foreach loop.

So far, so good. But this only handles the case where you want to match all of the specified keywords. Of all the things that will drive you to manually constructing expression trees, the need for dynamic predicates is the most common in a typical business application. Using PredicateBuilder How it Works. How to host a website from your own computer using Windows IIS.

How to Install IIS and host a website from your own computer – Complete Guide For those who are not familiar with IIS (Internet Information Server), it’s a free easy to use Web Server from Microsoft that allows you to host a web site from your own computer. Windows 7 starter edition and home edition might have limited IIS functionality so keep that in mind when you are not able to find a certain IIS component. 1. Click on the Windows button and type in: Turn Windows features on or off, now click on it. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 9. The below screenshot is what you have to do on the co.cc website once you create an account. ***The screenshot has been edited to remove any real IP Addresses.

Overig

Using IFilter in C# Download source files and demo project - 33.7 Kb What's in a IFilter? The IFilter interface was designed by Microsoft for use in its Indexing Service. Its main purpose is to extract text from files so the Indexing Service can index them and later search them. Some versions of Windows comes with IFilter implementations for Office files, and there are free and commercial filters available for other file types (Adobe PDF filter is a popular one). So what else is new?

There are already quite a few articles and pieces of information on how to use the IFilter interface in .NET (see the Links section), so why write another article you ask? Issues with the current implementations These are the issues I and others have found with the current implementations, I'll discuss each in detail below: Extracting text from very large files. Extracting text from very large files public static string GetTextFromFile(string path) COM threading issues Adobe PDF filter crashing the application when it's closed.

ObjectListView — ObjectListView v2.6.0 documentation. How to: Add Custom Menus and Menu Items to Outlook. Updated: May 2011 Declare your command bar variables at the class level. If you declare them inside a method, they will go out of scope as soon as the method finishes running and the garbage collector will be able to reallocate the memory. Drag-and-Drop Attached File From Outlook (97 and above) to C# Window Form. Download source - 7.04 Kb Introduction Recently, I decided to write a quick program that would allow me to drag-and-drop an attached zip file from an e-mail message to a C# Windows Form program so that I could extract specific types of files to be printed. Little did I know that I would be stepping into a relatively unknown area of drag-and-drop technology, especially it appears as it relates to e-mail attachments. The purpose of this article is to provide a simple example of how to drag-and-drop e-mail attachments from Outlook to a C# Windows Form program.

This article will not teach the fundamentals of drag-and-drop. Background I teach computer programming (C++ mainly) at a local college. The issue became the amount of manual work required to extract the "solution" sets for potentially each homework problem, open a solution, print each of the source files, open the next solution, etc. Little did I realize that I was about to step into quicksand. And now we start the trip ..... Voila! Chat Application using Web services in C# Download EasyTalk.zip - 1.67 MB Introduction All of us are more or less using many of the chat applications available in the market everyday but still sometimes wonder of how it has been developed. This is a simple private chat application developed in DotNet using a web service. The application (EasyTalk, I named it) targets mainly the beginners who still sometimes fear of using the web service.

The audience will get a taste of how web servcie can be easily developed and can be used in a chatting application. Background The chat client is developed just like any other chat application using Windows form and the chat service is developed using the Dot Net web service residing in the web server. Zip File Contents The above attached zip file contains the following projects: 1. 2. 3. 4. Using the code ChatService.asmx (Web Service) Remember these methods are always 'public', otherwise they won't be available for the outside world. Let us walk through some of these methods: 1. 2. 3. 1. 2. 3. History. How to: Add Custom Menus and Menu Items to Outlook. Download source - 27.18 KB Introduction The firm I work for sells a product that implements its own file server and runtime environment.

The code base is old and two years ago a project was initiated to create a new interface using C# and .NET 2.0. One of the features on the wish list was the ability to copy/cut/drag/drop files between the proprietary file server environment and Windows Explorer. Bringing files into the proprietary environment was easy through the use of the CF_HDROP format.

However, trying to extract files was proving to be a problem. Since the files do not exist in the Windows environment, the CF_HDROP format was not available. Using the Code This code implements a class called DataObjectEx that is derived from System.Windows.Forms.DataObject and System.Runtime.InteropServices.ComTypes.IDataObject. For this project, the following namespaces need to be referenced: The next method we need to implement is an override of GetData. Points of Interest History. Creating something from nothing [Developer-friendly virtual file implementation for .NET!] - Delay's Blog. Modern UI for WPF - Home. Elysium.

WFC

How to: Host and Run a Basic Windows Communication Foundation Service. Create Simple Web Service in Visual Studio 2008 / 2010 | Experience The Creativity. C#.Net How To: Create a WCF Web Service in Visual Studio 2010– Create a WCF WebService in C#.Net. Working with Events/Callbacks in WCF — a simplified beginner example. | Simple .Net Solutions. Courses. Hardcore Developer Training. WPF Tutorial. WinService. Windows Services in C#: Getting Started (Part 1)