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

Wednesday, 16 September 2015

The magic of Aspect Oriented Programming with PostSharp

In this video tutorial, I explain what Aspect Oriented Programming (AOP) is all about, the issues it solves and the benefits of using it.
I demonstrate it with PostSharp, the best framework for implementing aspects and integrating them with your solution.

Quoting PostSharp, it allows developers to eradicate boilerplate by offloading repeating work from humans to machines. PostSharp contains ready-made implementations of the most common patterns and gives you the tools to build automation for your own patterns..

In my demo, I show how to use those ready-made implementations, as well as get started with your own custom ones (best viewed in full screen, for the code screencast).

Sunday, 1 June 2014

Project: Keeping Track of your GitHub Open Issues in Real Time

The need

Since my team started working more and more on open-source projects, which are publicly shared on GitHub, I faced a need to have an easy way to follow up whenever new issues (GitHub's euphemism of bugs) were submitted by users.

There is a way to keep track by "watching" repositories of your choice, for which you get email notifications, but those emails are not limited just to newly submitted issues, but also to every pull/push request and comments. Also, for some reason, although I have clearly unsubscribed ("unwatched") specific repositories on my list, GitHub continues to notify me about them (which seems to be an issue in itself).

Thus, I decided (as always) to take things to my own lazy hands, and spent ~2 days building my very own GitHub Issues Notifier.
Get it on GitHub!

Thursday, 21 March 2013

Babylon-based dictionaries on Kindle - Round 2

My post "Using Babylon-based dictionaries on your Kindle" seems to have gotten relatively wide attention. Currently the statistics show that 2595 users have seen it, 31 of them commented, 2 more via Facebook and a number of emails I've received from readers.
People's interest in pre-built dictionaries which they can run on their Kindle devices (specifically English-Hebrew dictionaries, but not just) is understandable. There are some issues with the BabylonToHtml conversion tool I've put together.

Due to lack of time for resolving the known issues with the project, or for production of pre-built dictionaries, I've decided to share BabylonToHtml publicly as an open-source project, for anyone who wishes to update/improve it.

Pre-Built Dictionaries in this post!

I'm sharing some pre-built dictionaries in this post. Some were produced by me and some by others. They are shared here so that they can be freely downloaded and used by anyone.
This section will be updated with dictionaries which the readers share with me over time.
 Jump to the pre-built dictionaries section!

Monday, 7 January 2013

Full Recordings of my C# Programming Course on YouTube

The complete set of recordings of the "Programming Fundamentals with C#" course (presented in English) which I've lectured between 2011-2012 on the Telerik Academy, was uploaded to YouTube's Academy channel.

I've compiled here the full list of the videos, in their original presentation order. This may help anyone interested in following this course from start to finish.
All lectures were presented by me, except 3 in which I was absent and were presented by George Georgiev, and the general introduction to the course, presented by Svetlin Nakov.

For convenience, here are links to download the book of the course in Bulgarian and in English, and for each lecture I'm also linking the PowerPoint presentation and the demo materials from the academy site. Additional materials and demo tests can be found on the course's materials page.

Sunday, 5 February 2012

Remote Debugging In the Comfort of Your Living Room

Be the domainless master of your own domain
Many times I need to test a project on different operating systems, preinstalled or not preinstalled with specific components (e.g. a 32 bit project built with Windows 7 x64, run on a Windows XP x64 or x86, without an installation of the .NET framework runtime environment) and see how it behaves.
And in many cases it would misbehave.

In such cases I'd like to inspect my errors in order to repair them. And in many cases this is no easy task. It's sometimes hard to trace the problems without a proper debugger.
It's possible, of course, to install  a complete development environment on my test machine, but that would be heavy, take disk space and memory, and in many cases would be quite an overkill.

Fortunately, Microsoft provides the platform and tools for remotely debugging your application.
Unfortunately, accessing a remote machine for debugging requires appropriate permissions, and the remote debugging tools are planned to work when both computers share a domain and can work with common domain users.

A common (and economic) trick for testing an application on multiple environments is by using a virtual machine. I can  run several virtual machines on my computer, each with a different setup and a different OS.
In order to achieve remote debugging, I'd theoretically need to set up a domain server, and start managing users among my virtual machines (or use a real network, such as the one in my workplace, in order to log in as a domain user, given sufficient privileges on the virtual machine).
However, there are tricks to work around this requirement. I'll demonstrate how to run remote debugging from my local machine (not attached to any domain) to a virtual machine (running on its own detached workgroup).
Click to see the wonder in action:
Snap! A crash inside the VM (Click for the screen capture)
Obviously an index was exceeding the bounds of some array. Absolutely valuable information, which will not always be available upon crash, especially if your project is big enough.
In any case, we need to know where this exception is thrown and why.

Article Level:
Not quite rocket science

Sunday, 8 January 2012

A Word About Floating Point Numbers + 2 Lecture Recordings

On my last lecture at the Telerik Academy on January 5th, 2012, the students were presented with various numeral systems (the usual base 10, the binary base 2 and the hexadecimal base 16).
In my humble opinion, this presentation came a bit too late, since the students have already been handling variables of all primitive types (after the "Primitive data types and variables" lecture) and manipulating them quite on a low binary level (after the "Operators and Expressions" lecture).
If anything, this lecture, which includes explanations of the basic count systems and memory representation of primitive types, should have been presented before learning about the various types themselves.

Sunday, 27 November 2011

My WPF Localization Solution

The world awaits
I ran into a need to have my WPF application support multiple languages, to prepare it for its big day day when it finally becomes the hottest product in China or at least in Burkina-Faso.

There are plenty of localization solutions out there. I've been searching for the optimal way to make my application multilingual, and being the lazy developer I am, by "optimal" I usually mean optimal for me (i.e. the developer):
  • I want all the texts to change to the current selected culture automatically.
  • I want to retrieve additional resources, such as images, for a specific culture. 
  • I want to be able to add new multilingual resources to my application without effort.
  • I want all multilingual support and resources to be reusable in a separate assembly.
Article Level:
Not quite rocket science

Thursday, 24 November 2011

3 More Lecture Recordings

3 More screen recordings of lectures. These were recorded in the Telerik Academy between 14th - 21st of November 2011.
My fearless .NET ninja students get things quite quickly, but nevertheless I always do my best to get the messages through, debug and demonstrate so that every bit of information presented is clear.
A demo of the TeleTris console game, which I wrote about in the previous post, is included in the recording about conditional statements (it's a short lesson anyway).

Wednesday, 23 November 2011

The TeleTris Console Demo Project

One of the projects provided as demos for my class at the Telerik Academy was a console implementation of the classic Snake game (they named it JustSnake). You can see it and some of its code on the screen recording of my lecture "Console Input and Output", which I will share here very soon.
It inspired me to build my own little demo console game. I chose yet another classic game - the originally Russian Tetris, which I named TeleTris. It took one evening of coding and debugging and I must say I am quite satisfied with the result

Article Level:
Reasonably moderate

TeleTris In Action
Of course I'm attaching the full source code solution (and pre-built executable) here for anyone who wishes to download and play.  Note that in order to run the executable, you will need to have the Microsoft .NET Framework (4.0) installed on your machine.
Everyone is free to suggest improvements and bug fixes. I am aware of some minor graphic bugs and of the fact that the game's responsiveness could be improved, but for a single evening of work I think it's ok.
Here's a small screen capture of TeleTris in action. Click to open the animated version:


Sunday, 13 November 2011

Teaching at the Telerik Academy

Last week I joined to the group of lecturers in the Telerik Academy (Bulgarian site), a school operated by the company I currently work for, Telerik, which offers a variety of technological courses for free, for anyone who is interested to learn. And it seems many people are interested. Literally hundreds. The courses are aimed for people without any prior knowledge or experience, and cover a wide range of software-related subjects, such as programming languages, web technologies for frontend and backend development, software testing and others.

Some of the motivated students with the best grades are offered to join the company at the end of the course for a variety of positions. Others can still enjoy the training which is presented by experienced software engineers and obtain a professional programming skills which they can use in any way they want, absolutely free of any charge. Some of the courses are accompanied by books which are available in their digital format for free as well, such as the C# fundamentals book which accompanies the course I am teaching.

I love teaching. I've been teaching and managing professional programming courses as far back as 1998. When I heard about the courses in the Telerik Academny, I was happy to propose myself as a lecturer and even happier to know that I'm accepted to join the staff.

Saturday, 5 November 2011

Using ADO.NET Entity Framework 4.1 with SQL Server Compact 4.0

WTF and Why?!!
ADO.NET Entity Framework, an object-relational mapper (ORM) built into the .NET framework, provides an easy way to map your classes into a database tables and vice versa.
I've been working with with Entity Framework CTP 4, and have now upgraded my project to use the final released version 4.1. I'll provide here a small proof-of concept which I've built in order to chart the important bits and pieces.
Article Level:
Not quite rocket science