If you failed (because I am) to use Git bash all the time just to look cool and geeky, the following article will help you to add GitExtensions support. So you will be able  to call them right from your Git bash or posh-git.

So my daily usage looks like the following:

#will open diff dialog

git ex viewdiff

#will open commit dialog

git ex commit

#will open GitExtensions start page

git ex

UPDATE

You can use the following PowerShell script to do all the stuff for you:

, , ,

Feb/12

25

svn-hg-git

Some time ago I was looking for those command equivalents:

Subversion (SVN)

Mercurial (Hg)

Git

svn add hg add git add
svn blame hg blame git blame
svn cat hg cat git show
svn checkout hg clone git clone
svn commit hg commit ; hg push git commit -a ; git push
svn delete/remove hg remove git rm
svn diff hg diff git diff, git diff –cached
svn help hg help git help
svn log hg log git log
svn revert hg revert git checkout -f
svn status hg status git status
svn update hg pull –update git pull
svn move/rename hg move/rename git mv

, , , ,

Our team has recently updated to TortoiseHg 2.0 and everybody were frustrated with the update that came with it regarding shelving. Sometimes you simply can’t unshelve your files, while keep receiving the following message “1 out of 1 hunks FAILED”:

image

Solution

If you are aware of what I am talking about here is the quick fix for you:

Add following lines

[patch]

eol = auto

into the next file

%userprofile%\mercurial.ini

Enjoy!

Why it happens?

It’s because of EOL handling problems when running mecutial under Windows, this line enables patch to fix it.

, , , ,

Вот слайды с моего выступления в клубе харьковских разработчиков UNETA. Жду фидбека от участников, больше всего интересует, что было плохо =)
Контрацепция для разработчиков
View more presentations from Restuta.

,

Jan/11

18

DISQUS comment system

Hitting F5….

logo

As you can understand this post is for debugging of the new comment system. And I’ve picked you as a helper tool =) Let’s add some comments and test it together.

,

The answer is simple:

Our mind always wants complex tasks.

That’s why we subconsciously always looking for this complexity. And this is where things become interesting. Its often a challenge for programmer to prevent himself from overarchitecting and overcomplicating solutions. It can become a real problem for smart guys. As far as I am smart =) this is a real challenge for me too.

What should we do?

I propose a simple solution – convince yourself  that keeping thing as simple as possible is a bigger challenge than making them complex. Following the KISS (“Keep it simple, Stupid!“) principle is a very difficult task itself.

It is very easy to make things complex when you are smart, but it is unbelievable hard to keep them simple.

, ,

ninja-with-nunchaku There are two bracing techniques/styles in      c-like languages:

Foo()
{


Foo() {

}

I’ve seen both used in C# and in JavaScript, but it was always interesting why last one is much more popular in JavaScript and first one in C# and C++. Now I have the answer:

Putting braces on the same line after statement prevents from doing silly JavaScript mistakes, possible thanks to ECMASrcipt standard.

It states the following:

Certain ECMAScript statements (empty statement, variable statement, expression statement, do-while statement, continue statement, break statement, return statement, and throw statement) must be terminated with semicolons. Such semicolons may always appear explicitly in the source text. For convenience, however, such semicolons may be omitted from the source text in certain situations. These situations are described by saying that semicolons are automatically inserted into the source code token stream in those situations.

And a little demo of what they mean:

function FooA() {
	return
	{
		x: 8
	};
};

function FooB() {
	return{
		x: 8
	};
};

function Bar() {
	alert(FooA().x);
	alert(FooB().x);
}

When calling Bar() function you will see “undefined” and then “8” . This happens because JavaScript is too smart and put semicolon after first return statement (predicting your intent, that is actually should be a marketing slogan), so your anonymous object declaration will never be executed. Why? Here is a little intriguing pause and some dummy text that takes a little more time to read… And finally the answer is: “For convenience”, as told us by ECMA. Enjoy and don’t forget to feel convenient =)

,

Recently I was watching a video from Uncle Bob (aka Robert Martin) about craftsmanship and ethics in which he was saying the following:

Do not pass boolean parameters to a method or I’ll find you!

Why? Cos you probably won’t understand following lines of code:

this.DeleteCustomer(true); //what does it mean "true"?
//or even more triky
this.HiglightText(true, false, false);

So while looking on above method calls you will need to hover your mouse or press some hotkeys to get information about signature and actual meaning of parameters. And it works only if you are watching you code through IDE. Boring isn’t it?

Lets assume that first method has the following signature:

public void DeleteCustomer(bool onlyMarkAsDeleted);

Instead of doing this I prefer split this method on two, where each one is more explicit:

this.DeleteCustomer();
this.MarkCustomerAsDeleted();

This is possible only if you own the code, so you are able to perform such refactoring. In other case I prefer to go with one of the following ways:

Define a local variable with a meaningful name and make value assignment right in method call:

bool onlyMarkAsDeleted;
this.DeleteCustomer(onlyMarkAsDeleted = true);
//for the "false" case
this.DeleteCustomer(onlyMarkAsDeleted = false);

Disadvantage: It can be not obvious how it works if you see this for the first time. You just can forget that a result of Boolean value assignment is also a Boolean equal to value assigned.

Define a local variable with a meaningful name and make value assignment before method call:

bool andMarkAsDeleted = true;
this.DeleteCustomer(andMarkAsDeleted);
//for the "false" case
bool doNotMarkAsDeleted = false;
this.DeleteCustomer(doNotMarkAsDeleted);

Disadvantage: This approach requires more care in choosing variable names, this can go tricky sometime.

I think both are a lot more readable and will save a lot of time in future. Surely .NET 4 Rocks with named arguments:

this.DeleteCustomer(onlyMarkAsDeleted: true)

Please, follow these rules or I’ll send your home address to Uncle Bob =)

, , , ,

Недавно я задался таким вопросом, сделал в твиттере опрос, попробовал по результатам Google Code, Source Forge и Assembla, остановился на последней. Хотелось как всегда систему с блекджеком и шлюхами SVN (нет я не моральный урод, чтобы не юзать Git, есть причины для SVN), приличным объёмом под репозиторий, встроенным BugTracker, Wiki, удобным интерфейсом (гугл код на этом и зафейлился), возможно Project Management плюшками и конечно всё бесплатно =) 

Сегодня вот нашёл очень полезный ресурс http://www.svnhostingcomparison.com/, он предоставляет детальное сравнение огромного количества систем для хостинга ваших проектов. Вот скрин с примером того, что он умеет:

LFevOe1250ONugTWs3L4tA[1]

А потом я немножко погуглил и прозрел, как много есть всевозможных сравнениий систем для хостинга, публикую только полезные ссылки, выбирайте на здоровье.

, ,

Jun/10

20

CLR via C# 3

image

Недавно приехала с амазона, хоть книга и в мягкой обложке, но качество не сравнить с нашими изданиями – приятная бумага и хорошая типографика. Третье издание включает в себя множество изменений, которые охватывают тонкости работы 4-го фреймворка, а также бонусные главы посвящённые управлению потоками. Джефри Рихтер давно мечтал написать отдельную книгу по многопоточности, но теперь это часть CLR via C# 3.

Читать книгу в оригинале гораздо приятнее и понятнее, на многие вещи смотришь по-другому, авторские формулировки гораздо легче воспринимаются, чем перевод. Да и ждать русского издания ещё долго, must have для каждого дотнетчика.

Первое, что я прочитал – было предисловие от Кристин Трейс, жены Джефри и оно настолько меня впечатлило, что я решил попросить разрешение у автора перевести его:

Hi team and Jeff,

My name is Anton Vinogradenko, I am from Ukraine. I’ve just gotten your book (CLR via C# 3rd) from Amazon and I’m very impressed with its Foreword, so I want to ask you to translate it into Russian and post on my recently opened blog (http://restuta.net). Thanks!

И получил ответ:

Jeffrey Richter (Wintellect LLC) to me

Sure, feel free to translate and post it. Send me a link after you’ve done it – I’ll forward it to my wife – she’ll love it!

С большим удовольствием скоро опубликую для вас это замечательное вступление.

, , ,

Older posts >>

Find it!

Theme Design by devolux.org