Saturday, December 13, 2014

Windows Update error 0x80073712

I was not able to install Windows 8.1 Update for x64-based Systems (KB2919355), For a last few months. It's not like I was trying to do it everyday, simply when I noticed that I am not able to install it I tried again after few weeks. Unfortunately this update is required for me to install other update that is required to play with new .NET 4.6 preview framework (link to Visual Studio 2015 download, because that's the place that allowed framework to be downloaded).

What didn't work


Using File System Checker to repair missing or corrupted system files

sfc /scannow

Running in cmd as Admin following commands

net stop wuauserv
net stop bits
net stop cryptsvc
ren %systemroot%\System32\Catroot2 Catroot2.old
net start cryptsvc
ren %systemroot%\SoftwareDistribution SoftwareDistribution.old
regsvr32 wuapi.dll
regsvr32 wuaueng.dll
regsvr32 wucltux.dll
regsvr32 wups2.dll
regsvr32 wups.dll
regsvr32 wuwebv.dll
net start bits
net start wuauserv
net start Eventlog
exit

What resolved the problem


Running in cmd as Admin following commands

DISM.exe /Online /Cleanup-image /Scanhealth

DISM.exe /Online /Cleanup-image /Restorehealth
DISM process failed few times when I run it.

Monday, December 8, 2014

Run psake task from powershel


I constantly keep forgeting this command, because I use it once per few months. Here is how to trigger a psake task from pshell:
.\psake.ps1 "<fileWithTasks.ps1>" "<taskName>"

Some example:
.\psake.ps1 "default.ps1" "UpdateDatabase"

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.