Posts

WPF Dispatcher - Accessing UI Thread From Another Thread

If you're a C#.NET developer creating a WPF application and it's obvious that you could come across a scenarios to use multi threading. Have you ever tried to access an element in the UI from another thread and come across an exception with the following message ? "The calling thread cannot access this object because a different thread owns it." What's the reason for such message ? It's something like this. In certain programming languages the application starts with something called the main thread or the UI thread. And usually, the elements of the UI, are created with that main thread. When another thread tries to access it, that message is given. Put into simple words, "When you're doing something to one of the UI elements, you have to do it through the UI thread." The next question is,  how to do such thing ? When you're working with WPF, every thread has an associated Dispatcher which provides ...

Downgrade NuGet Packages - Visual Studio

Image
I came across this problem when I was working with the SignalR WebSocket . The project was already included with the references related to SignalR 2 Server application and I wanted to add  Newtonsoft.Json  library into my project for some json serialization and de-serialization. Added it without a problem, except there was an exception from SignalR. It needed Newtonsoft version 6.0 and adding Newtonsoft again has updated that reference to 9.0 which was the latest update for Newtonsoft. So following is the solution I used for downgrade Newtonsoft.Json back to version 6.0. 1. First you should get the Package Manager Console Window. It is reachable via  "TOOLS -> Library Package Manager -> Package Manager Console" . 2. Then you have to uninstall the current version of the library you want to downgrade, by executing the following command in the Package Manager Console. It's very important you use the -Force  flag, if there are dependencies to the package ...

Installing Flask-SocketIO For Python 2.7

It may seem as a very simple thing if you search the internet for it, but it's not. Here I like to discuss about a problem that can occur with some python plugins. As mentioned in the most of the places to install this plugin, a developer can use the simple command, "pip install flask-socketio" after installing pip into your computer. But it won't be a good day scenario every time. While installing this plugin there is a problem that can occur. When installing this "flask-socketio", there is another dependent plugin that is installed, which is ' gevent '. And both these plugins use Visual Studio 2008, VC (Visual C) compiler to compile those plugins at installation. So if that version doesn't exist in the computer there will be a error as " Unable to find vcvarsall.bat " while installing that plugin. One solution for this problem is available if there is another higher version of Visual Studio is installed in your computer. In ther...

Do's And Don'ts Related To Group Projects

Image
In my 3rd academic year, I had to face a subject which was an one year software development project. The module was called as  Software Engineering Project and while doing that project I was able to experience new Do's and Don'ts regarding group projects. 1. Planing before work Planning is an important thing in any group project. It becomes crucial in a software development project when considering about the integration of the project. Not only integration, but starting from the work allocation, there's lot of planning that has to be done in a project. So it's always a good habit to spend sometime for planning before you start the work. 2. Know your members When it comes to a group project, there has to be team work. That means each member has to work collaborating with the other members. It's rarely two people in the world have same attitudes regarding a particular matter. They all have their own opinions, mostly based on the previous experiences in...