How to invoke click event in WPF programmatically
WPF is still relatively new and many developers are only scratching the surface of its abilities. Coming from a different framework, one must learn anew how to do the familiar tasks. Sometimes you need to to trigger a click or some other event for one of your WPF controls, such as a button, a menu or a checkbox, directly from code. There are no methods on the controls to invoke these events explicitly. However there is a simple and generic way to do it which works as fine - just use
Iran and oil
I was quite surprised to learn that Iran is actually importing almost half of its petroleum. This is despite the fact, that the country is one of the largest oil producers in the world. Also, the price is heavily subsidized - a liter would cost you around 5 pence! However, they are about to cut the import and start imposing limits for consumption, according to this article from BBC .
Vim line wrapping and word boundary
Vim (vi) is a very powerful and customizable text editor. There are many parameters you can fine-tune to adjust the way your data is displayed. For example, vim can visually wrap lines, which are too long to fit the width of the screen. This is “virtual” wrapping - no new line characters are actually added to the text. By default, vim wraps the text at the last character, which fits in the visible area. However, especially when editing long runs of text, it is much more convenient to see lines wrap at word boundaries. To achieve this simply use the following command:
Synchronizing Google contatcts' birthdays with Android
Google Contacts allow setting birthdays, which are then picked up by Google Calendar automatically and displayed as events on the relevant day. This is very convenient for keeping track of your relatives’, friends’ and other people’s birthdays. Having a reminder saves you an embarrassment of forgetting your girlfriend’s/boyfriend’s/auntie’s day of birth and prevents unnecessary bad feelings.
For Android users it makes obvious sense to be able to see these events on their phones directly. In theory it should just work - in Calendar app choose “Calendars” menu, then select “Contacts’ birthdays and events” from the list and you are done.
Tradegy in Oslo
We are all devastated by the terrible events in Oslo, Norway, where almost 100 people were killed in two closely linked incidents of terrorism. Browsing the news about these events, I couldn’t help but notice facial similarity between the alleged executor of the terrible acts, a certain Anders Behring Breivik, and the notoriously famous manager of Wikileaks, Julian Assange.
Using Scala in GWT projects
I’ve been experimenting with GWT (Google Web Toolkit) recently. GWT allows you to write responsive and consistent user web interfaces in a subset of Java programming language. The source code is then compiled into JavaScript, which can be run in any supported web browser.
This concept looks very attractive to me. While I’ve done a fair amount of web development, including JavaScript, in my earlier days, including writing some Ajax even before it was known as Ajax, I grew disappointed with scripting languages in general and JavaScript in particular because of lack of strict typing and browser differences. GWT abstracts these things away nicely and improves speed of development, maintainability and readability of the code. It is quite surprising to discover that GWT is open source, so even if Google goes bust, it will not disappear. As an example of GWT’s power consider the fact, that GMail’s interface is written in it, as well as Google Reader and a number of other Google web products.
Microsoft program removal tool - remove even hidden applications
Sometimes Microsoft likes to hide installed applications from you in the “Add or Remove programs”, especially when you play with their beta products. It can be very frustrating and can lead to unstable system. In that case, use a removal tool from, well, Microsoft. Works for various versions of Windows, including XP and Windows 7.
Event Importer for Google calendar
I have released a new product: Event Importer for Google calendar. It allows importing iCalendar files (.ics), downloaded via browser quickly and easily. Possible use cases: event export from Facebook, Meetup, other online services, e-mailed .ics files etc. Please give it a try and let me know what you think.
SVN for Visual Studio .NET
Looking for a way to integrate Subversion with Visual Studio .NET 2005 I came across AnkhSVN - an open source VS.NET plugin which does exactly that.
My current tests show that the tool works pretty well and in its latest generations is very convenient. It supports not only Visual Studio 2005, but 2008 and 2010 . Make sure you install the latest version. I also suggest that you use WinMerge instead of its built-in diff viewer. You can do that by selecting “Options” from the “Tools” menu in Visual Studio and then going into “Source Control” subtree and selecting WinMerge as the diff viewer in the “Subversion tools” section.
WPF DataGrid row validation
WPF is a very powerful framework for GUI development. Among other things, it contains a unified approach to user input validation. Adding validation in WPF is very straightforward in most cases. However, validating DataGrid rows is slightly challenging. However, the good people of the world has already taken care of the problem and provided quite detailed walk-throughs. I recommend reading this interesting article (WPF DataGrid Practical Examples) about WPF DataGrid. Among other things, it describes how to perform row validation using the standard