AngularJS

In our work project we moved to AngularJS, and I must say that it is great! Beats Durandal and Knockout to to one – no kidding. Everything is much better – bindings to “normal” objects, nice routing system, no need for 20 other libraries to make it working, etc.

So, here I will try to collect some helpful links to start with:

  • Learn AngularJS in 5 Steps: some good advices for n00bs.
  • Egghead.io: rather nice collection of short videos about various aspects of Angular.
  • Prototypal Scope/JavaScript Inheritance: guy put together a lot of work to get the article written – must read.
  • Post from Miško Hevery himself about differences between values, services, factories, providers…
  • Great answer to the How do I “think in AngularJS” if I have a jQuery background? StackOverflow question (TL;DR – ditch jQuery if you do AngularJS).

Editor Error in Visual Studio 2012

Sometimes Visual Studio 2012 goes slightly mad and displays an error message (did not take screenshot, sorry) that it has encountered an exception that might be caused by an extension, and mentions the Activity Log file.

This file is normally located at %appdata%\Microsoft\VisualStudio\11.0\ (where %appdata% is normally C:\Users\<yourUserName>\AppData\Roaming) and is called ActivityLog.xml – one can check the problem in more details (TIP: there is the corresponding xsl file, so the xml file opened in IE will be nicely formatted).

Usually the exception message stored in the ActivityLog.xml will clearly point to the offending extension/plugin.

If it does not, the deleting the %localappdata%\Microsoft\VisualStudio\11.0\ComponentModelCache\Microsoft.VisualStudio.Default.cache file (where %localappdata% is normally C:\Users\<yourUserName>\AppData\Local) might solve the problem. It is safe to delete this file as it will be rebuild when Visual Studio is starting. And, of course, Visual Studio should be closed when you are trying to delete this file.

If even then the problem persists, then pray to god(s) – there is no help for you! :)

TypeScript IntelliSense

We are going to use TypeScript in our product, so imagine my disappointment when I realized that IntelliSense is not working for TypeScript files in Visual Studio 2012, despite it should.

I have tried everything I could – played with VS settings, uninstalled and reinstalled TypeScript, ReSharper, whole Visual Studio… Nothing. Finally, I had to reset my Windows and start from scratch. After two full days completely wasted trying to get IntelliSense working, I finally got to the magic point of having fresh Windows, Visual Studio, and TypeScript. Started it all up, and bang – no IntelliSense again! After pulling some hair out, and crying quietly in the corner, I started second round of uninstalling and installing TypeScript, including older version 0.8.2, Web Essentials, resetting VS settings, etc. Same result. Finally I checked my Visual Studio plugins, and, to my surprise, spotted MySQL Tools for Visual Studio extension, despite I did not want to install it in the first place when MySQL was installed earlier. Removed this plugin, and voila, TypeScript IntelliSense at its best!

What is strange, I have tried to install MySQL server and its Connector/.NET at home (although a newer version 5.6.10.1 package), and surely got the unwelcome MySQL Tools for Visual Studio extension with them. But! The TypeScript IntelliSense works nevertheless, despite a completely different picture was observed at work twice. Go figure.

So, if TypeScript’s IntelliSense is not working, I would recommend to remove all extensions, starting from those more exotic (e.g. MySQL, and those less used by wide population) – it might actually repair the thing.

Troubles with Xbox 360 and Live

Was installing today my second Xbox 360. Everything went smoothly in the beginning: Xbox calibrated, asked its questions, found WiFi, connected to Live, and downloaded an update from it.

The next step would be to download my profile, and this is where the sucking part started, as it turned out that the Xbox cannot connect to Live. Connection test was able to find network and internet, but not Live. I have tried everything – restarting, unplugging power, restarting router, reading forums, jumping on one leg, singing shaman songs, beating the drum, standing on head. Nothing. Then I noticed that the DNS configuration on the Xbox has only primary server set, and it is pointing to the router, which has no DNS server of its own. Changed DNS to manual and pointed it to Google’s 8.8.8.8 and 8.8.4.4 servers. Nothing. Changed from WiFi to Ethernet, rebooted a few more times, changed DNS back to automatic, changed back to WiFi, and bingo – Live test succeeded. No idea why though, as Xbox settings now were identical to the initial factory settings, and those were not working before. Go figure. And all these while my second Xbox, with absolutely identical configuration, was happily working in the other room, and had no problems with Live whatsoever, including passing tests!!!

Fine, Live sorted out, so now it was time to download the account. Meant to be easy. Well, it was not. After entering email and password, I was present with the list of my accounts, selected the needed one, the download process would start, go about 10%, and stop with error message (80151909 and 80151103, temporarily cannot download profile). Retried it a few times (each time you have to enter both email and password using shit-fuck-crappy-on-screen keyboard, fuuuuuuuuuuck!). Someone from Microsoft recommended to authenticate the Live account, but the account was not asking for it. Then there was recommendation to temporarily change the Live password. Changed it, rebooted Xbox, and managed to download the profile. Finally!

The last step was to get back my old password – I have it on my Windows Phone, and some other devices, so changing it everywhere would be rather painful. Well, the password change page said I cannot reuse the original password, and that I must choose a new password each time. As stubborn as I am, I started changing the temporary password by changing one letter a time, and then retrying to set my original password. Something like 5-7 retries later I was able to reuse my old password, and the fairy tale got a happy end.

Aftermath: working Xbox with Live, and two hours of my precious Saturday time miserably wasted. Thank you, dear Microsoft! Can somebody tell me, how a normal person can set up a new Xbox with the internet connection and Live? He/she cannot, you say? Well, that is what I think too. Context: I am a software developer, and have dealt with computers for 27 years now, since I was kid.

Visual Studio Behind Proxy: Expectation Failed

We have a transparent proxy at work, and it was causing troubles in Visual Studio 2012 when going to the Extensions and Updates. Contrary to your expectations, “The remote server returned an unexpected response: (417) Expectation failed” message was appearing. The fix is pretty easy, and involves editing devenv.exe.config file in the Visual Studio 2012 folder (normally C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\). Somewhere towards the end of that file there is a

<system.net>
    <settings>
        <ipv6 enabled="true"/>
    </settings>
</system.net>

fragment, which has to be fixed to read

<system.net>
    <settings>
        <ipv6 enabled="true"/>
        <servicePointManager expect100Continue="false"/>
    </settings>
</system.net>

That’s it.