Below is the text of the page https://restuta.net/ stored 2017-06-24 by archive.org.ua. The original page over time could change. View as original html

Anton Vinogradenko's blog - Way of Ninja

[http://twitter.com/Restuta] Way of Ninja Anton Vinogradenko's blog Home About Wishing board Mail Tag Cloud DVCS git hg personal answers hidden feature скрытая возможность open-source hosting links-catalog hack first-hand visual studio humor nix .net .net 4.0 books gotcha readability mercutial uneta tortoise svn powershell git-extensions mercurial на русском comments c# clean-code best-practices beginners javacript debug programming thoughts Recent Posts GitExtensions from Git Bash svn-hg-git How to get shelving working in TortoiseHg 2.0 Контрацепция для разработчиков DISQUS comment system Archives April 2012 (1) February 2012 (1) April 2011 (1) January 2011 (2) December 2010 (1) November 2010 (1) September 2010 (1) June 2010 (2) March 2010 (3) Meta Register Log in Entries RSS Comments RSS WordPress.org Recent Comments s7te2013 on Why JavaScript is doing this to us? vinodkumar on Why JavaScript is doing this to us? kef on DISQUS comment system alwi on Why JavaScript is doing this to us? ahmed omar on Why JavaScript is doing this to us? Blogroll .net wisp Мысли с самого низа Apr/12 5 GitExtensions from Git Bash View Comments | Posted by Restuta in version-control 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: DVCS , git , git-extensions , powershell Feb/12 25 svn-hg-git View Comments | Posted by Restuta in version-control 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 DVCS , git , hg , mercurial , svn Apr/11 8 How to get shelving working in TortoiseHg 2.0 View Comments | Posted by Restuta in development 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” : 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. answers , DVCS , hg , mercutial , tortoise Jan/11 28 Контрацепция для разработчиков View Comments | Posted by Restuta in public-activity , russian Вот слайды с моего выступления в клубе харьковских разработчиков UNETA . Жду фидбека от участников, больше всего интересует, что было плохо =) Контрацепция для разработчиков View more presentations from Restuta . uneta , на русском Jan/11 18 DISQUS comment system View Comments | Posted by Restuta in debug Hitting F5…. 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. comments , debug Dec/10 15 Why programmers often tend to overcomplicate everything? View Comments | Posted by Restuta in development 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. answers , programming , thoughts Nov/10 18 Why JavaScript is doing this to us? View Comments | Posted by Restuta in development 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 =) gotcha , javacript Sep/10 27 Making Boolean parameters readable View Comments | Posted by Restuta in clean-code 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 =) beginners , best-practices , c# , clean-code , readability Jun/10 29 Где захостить OpenSource проект? View Comments | Posted by Restuta in project hosting Недавно я задался таким вопросом, сделал в твиттере опрос, попробовал по результатам Google Code , Source Forge и Assembla , остановился на последней. Хотелось как всегда систему с блекджеком и шлюхами SVN (нет я не моральный урод, чтобы не юзать Git, есть причины для SVN), приличным объёмом под репозиторий, встроенным BugTracker, Wiki, удобным интерфейсом (гугл код на этом и зафейлился), возможно Project Management плюшками и конечно всё бесплатно =) Сегодня вот нашёл очень полезный ресурс http://www.svnhostingcomparison.com/ , он предоставляет детальное сравнение огромного количества систем для хостинга ваших проектов. Вот скрин с примером того, что он умеет: А потом я немножко погуглил и прозрел, как много есть всевозможных сравнениий систем для хостинга, публикую только полезные ссылки, выбирайте на здоровье. как всегда детальная и полезная статья в Wiki не менее полезный вопрос на stackoverflow скучный ресурс с убогим интерфейсом более-менее нормальный обзор 10-ти ресурсов сравнение Assebla & Unfuddle hosting , links-catalog , open-source Jun/10 20 CLR via C# 3 View Comments | Posted by Restuta in books Недавно приехала с амазона , хоть книга и в мягкой обложке, но качество не сравнить с нашими изданиями – приятная бумага и хорошая типографика. Третье издание включает в себя множество изменений , которые охватывают тонкости работы 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! С большим удовольствием скоро опубликую для вас это замечательное вступление. .net , .net 4.0 , books , first-hand Older posts >> Find it! Theme Design by devolux.org Tag Cloud .net .net 4.0 answers beginners best-practices books c# clean-code comments debug DVCS first-hand git git-extensions gotcha hack hg hidden feature hosting humor javacript links-catalog mercurial mercutial nix open-source personal powershell programming readability svn thoughts tortoise uneta visual studio на русском скрытая возможность Archives April 2012 February 2012 April 2011 January 2011 December 2010 November 2010 September 2010 June 2010 March 2010 To top