Monday, 6 May 2013

How to restore BACPAC onto MS SQL 2008 R2

I have been struggling with restoring databases from Azure onto my local machine. At first I thought it is because my SQL Management Studio is outdated, but even after updating to 2012 I was getting
The internal target platform type SqlAzureDatabaseSchemaProvider does not support schema file version ’2.5′.


Solution: 1. Quick Google research showed an update on SQL Server Data Tools 2012 update 2. You can use a tool inside
C:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin
called SQLPackage.exe 3. Example:
.\SqlPackage.exe /a:Import /sf:D:\backups\testdatabase.bacpac /tdn:MyDatabaseName /tsn:MyDatabaseInstanceName


Alternatively, you can try to use Import/Export inside SQL Server Management Studio 2012 - however I had more problems with it than SQLPackage tool.

Sunday, 28 April 2013

How to run Visual Studio's Publish equivalent in command prompt using MsBuild

I struggled to get MSBuild to do exactly the same thing that right clicking solution and selecting "Publish" does.

I have finally found it!


%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
     HostingSample\HostingSample.csproj /
     t:ResolveReferences;_CopyWebApplication /
     p:WebProjectOutputDir=C:\HostingSample /p:OutDir=C:\HostingSample

Friday, 22 March 2013

Security vs Conversion rate - where is the balance?


Very interesting article about fraud detection and security vs usability of the site and conversion rate.

http://www.techrepublic.com/blog/security/making-online-payments-safe-from-fraud-conversion-rate-vs-security/9203?tag=nl.e036&s_cid=e036&ttag=e036

Wednesday, 19 December 2012

MCSD - 70-480 Exam Prep - HTML5

I have been reading HTML5 and CSS3: Develop with Tomorrow's Standards Today. Those are some notes I have prepared later on for some quick revision. Someone might find it quite useful.

Note: This is work in progress and by no means finished!


New Syntax

No more special doctypes only one!

<!DOCTYPE html>

New Tags

  • <header>
  • <footer>
  • <nav> 
    • Some sort of navigation
  • <section>
    • Section defines a large portion of the document. Article is a smaller (could be many of them together) normally within a section.
  • <article>
  • <aside>
    • Something extra to the content (quotes, diagrams etc)
    • NOT SIDE MENUS etc.
  • <progress>
    • Not implemented yet in any browsers
  • <meter>
    • Not implemented yet in any browsers

Falling back

HTMLShiv
  •      To simply add those tags to browsers that might not support do...
    • document.createElement("nav");

New input types

  • range
    • min/max
  • number (spin box)
    • min/max/step
  • date
  • email
  • url
  • color
Test to see if they are working by simply creating element 
var input = document.createElement("input")
input.setAttribute("type", "color")
To test if it supports it if(input.type !== "text") 

Modernizr is also good plugin to help with a headache. 

New attributes

  • Attributes starting with data-* will be ignored and are used by JS to keep data rather than injecting it into classes etc.
  • autofocus
  • placeholder
  • autocomplete=[on/off] ?? shouldn't it be [true/false]
  • contenteditable[true/false] - need to handle post backs manually

Monday, 3 December 2012

MCSD - Exam 70-480 Preparation

I'm in a process of preparing for an exam (480) which is
- 480: Programming in HTML5 with JavaScript and CSS3


It is a part of MCSD certification from Microsoft.

I'm not going to be using Microsoft training so I have to research a bit and find materials I need to master those topics. In here I'll add few resources that I'm going to be using to prepare. It is very much fluid list.

Free
  1. Blogged By Chris - Blog - Very usefull
Books

  1. HTML5 & CSS3 For The Real World - $3.99 (on 2012/12/04)
  2. HTML5 and CSS3: Develop with Tomorrow's Standards Today (Pragmatic Programmers) - $15.40 (on 2012/12/04)


Also what I have found is that first exam is free. See here http://blogs.msdn.com/b/microsoft_press/archive/2012/11/01/quick-news-free-training-and-exam-voucher-for-html5-and-javascript.aspx

Thursday, 29 November 2012

Manual removal of domain in Plesk 9.X

I have had issues today removing a domain from Plesk 9. Web administration panel kept on coming back with "Delete successful" however the domain was still there. It seems that someone has removed files and IIS records without actually removing anything from Plesk records. This caused some dirty records and issues that web front wasn't showing.

After some research I managed to find some good old command prompt tools inside
%plesk dir%\bin
%plesk dir%\admin\bin

1. Command line returned following error. (At least it returned some error rather than just saying it was successful).
An error occured during domain removal: Unable to remove domains: Unable to remove hosting: Unable to delete logrotate config: logrot_mng failed: Execute websrvmng --update-log-rotation "--vhost-name=[name_of_domain]" failed: Site [name_of_domain] doesn't exist.

2. I have then changed directory to admin/bin and ran following command
websrvmng.exe --reconfigure-vhost --vhost-name=[name_of_domain]

3. Remove domain.
domain.exe -r [name_of_domain]

This fixed my problem and left our Plesk server nice and clean.

Thursday, 22 November 2012

IE (Internet Explorer) 9 Crashing when loading a page

Issue

I have been assigned a critical issue one of our customers had with their site. Every time they loaded certain page IE9 would crash without giving any reason as to why. (Used Windows 7 in all cases)
Faulting application name: iexplore.exe, version: 9.0.8112.16455, time stamp: 0x507284ba
Faulting module name: MSHTML.dll, version: 9.0.8112.16455, time stamp: 0x50728e5d
Exception code: 0xc0000005
Fault offset: 0x003a2478
Faulting process id: 0x518
Faulting application start time: 0x01cdc928fdf2a877
Faulting application path: C:\Program Files (x86)\Internet Explorer\iexplore.exe
Faulting module path: C:\Windows\system32\MSHTML.dll
Report Id: 455b7416-351c-11e2-828f-000c29ad02c9
I have used Google Problem resolving technique however I was not able to find any info as to why IE9 would just crash. I couldn't replicate the issue on my machine, yet my project manager's machine crashed every time.
It turned out that it only happens on version of IE 9 (9.0.8112.16455) which as of 2012-11-23 seems to be the latest. Previous version (which I ran on my local weren't affected by this problem.

Investigation

IE would just crash with no apparent reason (one of those "Internet Explorer needs to be closed"). Event Viewer showed me error showed above.

Next step was to get "Fiddler" to see if there is any miscalculation in HTTP header or some incorrect syntax that IE was sensitve to. Nothing...

I have then decided to put some break points and actually load data one bit at the time (our site consist of many AJAX queries) shortly after I have pin pointed the cause to one particular load.

Problem was caused by an iframe that was loading some content (to be displayed in tabs - not sure if this is related). I have changed URL of that iframe and it fixed the problem. So the final step was really to find out why the content the page caused IE to crash (even though if you load page in separate tab in IE it worked fine).

Solution

Problem turned out to be page that was loaded externally in the iframe. Page was pretty much Terms and Condition sort of page (full of <li> tags). Page had a lot of list nesting <ul> into <ol> and vice versa. Restructuring the page into DIVs and single lists fixed the problem. 

I'm still confused as to why IE9 and only that particular sub version would crash on something so simple. I expected JavaScript as we use many different frameworks etc but No simple list. Huh?