Tuesday, November 26, 2013

F# This expression is a function value, i.e. is missing arguments. Its type is List -> 'a -> List.

A common problem, when I refactor bigger chunks of F# code. This warning basically means that the indentation is incorrect. In my experience usually some parameters are not indented correctly. As an example:
let checkUrls = 
    Seq.fold (fun (acc:List) (x:string) -> 
        if (AsyncHttp(x) = HttpStatusCode.OK) then 
            (x :: acc) 
        else
            acc)
    []
    urls

In example above [] and URLs should be indented further then the call to the function, so it should look like a code below:
let checkUrls = 
    Seq.fold (fun (acc:List) (x:string) -> 
        if (AsyncHttp(x) = HttpStatusCode.OK) then 
            (x :: acc) 
        else
            acc)
        []
        urls

Monday, September 30, 2013

JavaScript style guides

There are various style guides available on a market for JavaScript. To name a few: For many years I was always suggesting to stick to Crockford convention, and use his book as a reference. But because people don't read books, and google style guide is much more explicite, and well defined, and available on the web with good examples. I decided to change my JavaScript style guide to google one.

Friday, September 27, 2013

Hacker News London meetup

I haven't keep a track of tech meetings I attended recently. Maybe it would be good to start doing it again:
Hacker news meetup a good one. I really enjoyed people, presentations, beer and pizza. Maybe not including the last presentation (google app engine), because it was to commercial, and nothing interesting was said. The sad part is it was at this same time as Sitecore User Group meeting, that I usually attend.

Friday, September 20, 2013

JQuery $(...).ready is not a function


This one happened to me many times. It usually means that some script override the $ variable, and after JQuery has been initialized. In other words there is a huge chance that one of a javascript libraries that you added recently overrides $. The best way to check if it's the case is to fire up following script under firebug script console.
alert($)

If the result is simmilar to this:
function (a,b){return new e.fn.init(a,b,h)}

Everything is ok, this is how $ looks when JQuery is in charge of it. But often I see something else. For example a code below means that mootools is also used and it takes over $ function:
function (B, C) { if (B && B.$family && B.uid) { return B; } var A = $type(B); return ($[A]) ? $[A](B, C, this.document) : null; }

And it means that some code did something nasty with $ variable. The next thing that I do is to read libraries, disable them, and follow a typical tracing path.

Monday, September 16, 2013

What to do if there is no FireBug installed in Firefox


I noticed that many Firefox users are unaware that since version 11 firefox introduced a tool that is similar to firebug. You can trigger it by hitting:
Shift+F7

I sometimes debug/trace an issue not from a development machine, and I don't have an access to firebug, so it is worth to remember, that Style Editor is there to help you.

Thursday, August 8, 2013

Proxy Ignore List for IE (ProxyOverride)

It is really easy to ignore proxy for a specific URL under Firefox.

You simply go to:
 Tools->Options->Advanced->Network->Connection Settings 
and add url to No Proxy list.
There is no such inteface for IE or Chrome. In order to add URL to ignore list you need to modify registry:
HKEY_USERS\[UserID]\Software\Microsoft\Windows\CurrentVersion\Internet Settings

And add your entry to ProxyOverride list.

Thursday, July 25, 2013

SetSite failed for package [Microsoft.VisualStudio.Editor.Implementation.EditorPackage]



After the 07/10/2013 Microsoft update, VS 2012 doesn't want to work. It throws exceptions that can be visible under:
C:\Users\[user]\AppData\Roaming\Microsoft\VisualStudio\11.0\ActivityLog.xml

In order to fix the issue one needs to clear the VS cache under:
%LOCALAPPDATA%\Microsoft\VisualStudio\11.0\ComponentModelCache