The Secrets of Popularity * SEO

Once upon a time there were two nerds at Stanford working on their PhDs.

(Now that I think about it, there were probably a lot more than two nerds at Stanford.) Two of the nerds at Stanford were not satisfied with the current options for searching online, so they attempted to develop a better way.

Being long-time academics, they eventually decided to take the way academic papers were organized and apply that to webpages. A quick and fairly objective way to judge the quality of an academic paper is to see how many times other academic papers have cited it. This concept was easy to replicate online because the original purpose of the Internet was to share academic resources between universities.

The citations manifested themselves as hyperlinks once they went online. One of the nerds came up with an algorithm for calculating these values on a global scale, and they both lived happily ever after. Of course, these two nerds were Larry Page and Sergey Brin, the founders of Google, and the algorithm that Larry invented that day was what eventually became PageRank. Long story short, Google ended up becoming a big deal and now the two founders rent an airstrip from NASA so they have somewhere to land their private jets. (Think I am kidding? See

Relevance, Speed, and Scalability

Continue reading “The Secrets of Popularity * SEO”

How to make your first WebAPI2 Project

With the introduction of OWIN  and self hosting, microsoft has really opened a lot of possible doors for developers and application users. This post is targetted to have an OWIN application hosted in Windows Service. Also we would be configuring the SSL for the Site.

Creating a Windows Services Project

This is pretty straightforward. In visual Studio, Create new project and select Windows Service as project. This will add a project with default Service “Service1”. Rename to whatever the name expected. Continue reading “How to make your first WebAPI2 Project”

Two Basic Parts of a Low Cost Web Site Promotion

Anybody could own a web site. Anybody could up sell their own products and services to their target audience. Anyone could try to promote their web site with a low cost. But there are not many web sites that have a truly successful web site with traffic all day through. What these individuals or companies lack is the most essential factor of success – a low cost web site promotion that really works. Continue reading “Two Basic Parts of a Low Cost Web Site Promotion”

The Trojan of the Month Award goes to: Avril Sparrowhawk CWIH8974 PAYMENT RECEIVED

I just got a bit of malware spam: “CWIH8974 PAYMENT RECEIVED” / “Avril Sparrowhawk []”

This fake financial spam does not come from Les Caves de Pyrene but is instead a simple forgery with a malicious attachment. How did I know it was spam? I don’t buy wine. 🙂

If you receive this e-mail, delete it immediately and contact your IT Support company. Do not open the attachment(s).

virusThe attached file is a malicious document “CWIH8974.doc” which has a low detection rate. There are likely other variants of this virus going around but in the cases we’ve seen it downloads a malicious executable file from.

The virus itself allows the hacker to compromise the web browser so that when the user tries to log in to their Internet Banking, the details are leaked to the hacker who attempts to withdraw funds from the user’s bank account.

From: Avril Sparrowhawk []
Date: 22 December 2015 at 11:14
Continue reading “The Trojan of the Month Award goes to: Avril Sparrowhawk CWIH8974 PAYMENT RECEIVED”

How can I report a person attempting to hack me?

There are a number of laws regarding hacking a computer you don’t have authorization to hack, the CFAA in the USA, the CMA in Great Britain, the CHM in Australia, and the list goes on. All of which make it illegal to do what you want to do, and in some cases have pretty strict penalties for even the smallest of actions.

The term most often used to describe what you’re talking about is Hacking Back. It’s part of the Offensive Countermeasures movement that’s gaining traction lately. Some really smart people are putting their heart and soul into figuring out how we, as an industry, should be doing this. There are lots of things you can do, but unless you’re a nation-state, or have orders and a contract from a nation-state your options are severely limited.

There’s always an “Abuse” email address on the whois of a netblock for reporting misuse of an IP address.

You can use to do a whois lookup to get the address.


If you are using WordPress, use Wordfence! They are really good!

Continue reading “How can I report a person attempting to hack me?”

Koalas to the Max – Cool HTML5 Canvas Painter

This awesome website uses hovers over a circle area to split the circle into four other circles and then four more and four more – each time reducing the size of the circle and the colour of the circles and making sure none of the circles meet.

The JS Code:


"use strict"

* Made with love by Vadim Ogievetsky for Annie Albagli (Valentine's Day 2011)
* Powered by Mike Bostock's D3
* For me on GitHub:
* License: MIT  [ ]
* If you are reading this then I have an easter egg for you:
* You can use your own custom image as the source, simply type in:
* e.g.
* also if you want to use a custom image and want people to guess what it is
* (without seeing the url) then you can type the url in base64 encoding like so:
* e.g.
* (try to guess the image above)

var koala = {
  version: '1.8.2'

(function() {
  function array2d(w, h) {
    var a = [];
    return function(x, y, v) {
      if (x < 0 || y < 0) return void 0;
      if (arguments.length === 3) {
        // set
        return a[w * x + y] = v;
      } else if (arguments.length === 2) {
        // get
        return a[w * x + y];
      } else {
        throw new TypeError("Bad number of arguments");

  // Find the color average of 4 colors in the RGB colorspace
  function avgColor(x, y, z, w) {
    return [
      (x[0] + y[0] + z[0] + w[0]) / 4,
      (x[1] + y[1] + z[1] + w[1]) / 4,
      (x[2] + y[2] + z[2] + w[2]) / 4

  koala.supportsCanvas = function() {
    var elem = document.createElement('canvas');
    return !!(elem.getContext && elem.getContext('2d'));

  koala.supportsSVG = function() {
    return !!document.createElementNS && !!document.createElementNS('', "svg").createSVGRect;

  function Circle(vis, xi, yi, size, color, children, layer, onSplit) {
    this.vis = vis;
    this.x = size * (xi + 0.5);
    this.y = size * (yi + 0.5);
    this.size = size;
    this.color = color;
    this.rgb = d3.rgb(color[0], color[1], color[2]);
    this.children = children;
    this.layer = layer;
    this.onSplit = onSplit;

  Circle.prototype.isSplitable = function() {
    return this.node && this.children

  Circle.prototype.split = function() {
    if (!this.isSplitable()) return;;
    delete this.node;
    Circle.addToVis(this.vis, this.children);

  Circle.prototype.checkIntersection = function(startPoint, endPoint) {
    var edx = this.x - endPoint[0],
        edy = this.y - endPoint[1],
        sdx = this.x - startPoint[0],
        sdy = this.y - startPoint[1],
        r2  = this.size / 2;

    r2 = r2 * r2; // Radius squared

    // End point is inside the circle and start point is outside
    return edx * edx + edy * edy <= r2 && sdx * sdx + sdy * sdy > r2;

  Circle.addToVis = function(vis, circles, init) {
    var circle = vis.selectAll('.nope').data(circles)

    if (init) {
      // Setup the initial state of the initial circle
      circle = circle
        .attr('cx',   function(d) { return d.x; })
        .attr('cy',   function(d) { return d.y; })
        .attr('r', 4)
        .attr('fill', '#ffffff')
    } else {
      // Setup the initial state of the opened circles
      circle = circle
        .attr('cx',   function(d) { return d.parent.x; })
        .attr('cy',   function(d) { return d.parent.y; })
        .attr('r',    function(d) { return d.parent.size / 2; })
        .attr('fill', function(d) { return String(d.parent.rgb); })
        .attr('fill-opacity', 0.68)

    // Transition the to the respective final state
      .attr('cx',   function(d) { return d.x; })
      .attr('cy',   function(d) { return d.y; })
      .attr('r',    function(d) { return d.size / 2; })
      .attr('fill', function(d) { return String(d.rgb); })
      .attr('fill-opacity', 1)
      .each('end',  function(d) { d.node = this; });

  // Main code
  var vis,
      maxSize = 512,
      minSize = 4,
      dim = maxSize / minSize;

  koala.loadImage = function(imageData) {
    // Create a canvas for image data resizing and extraction
    var canvas = document.createElement('canvas').getContext('2d');
    // Draw the image into the corner, resizing it to dim x dim
    canvas.drawImage(imageData, 0, 0, dim, dim);
    // Extract the pixel data from the same area of canvas
    // Note: This call will throw a security exception if imageData
    // was loaded from a different domain than the script.
    return canvas.getImageData(0, 0, dim, dim).data;

  koala.makeCircles = function(selector, colorData, onEvent) {
    onEvent = onEvent || function() {};

    var splitableByLayer = [],
        splitableTotal = 0,
        nextPercent = 0;

    function onSplit(circle) {
      // manage events
      var layer = circle.layer;
      if (splitableByLayer[layer] === 0) {
        onEvent('LayerClear', layer);

      var percent = 1 - d3.sum(splitableByLayer) / splitableTotal;
      if (percent >= nextPercent) {
        onEvent('PercentClear', Math.round(nextPercent * 100));
        nextPercent += 0.05;

    // Make sure that the SVG exists and is empty
    if (!vis) {
      // Create the SVG ellement
      vis =
          .attr("width", maxSize)
          .attr("height", maxSize);
    } else {

    // Got the data now build the tree
    var finestLayer = array2d(dim, dim);
    var size = minSize;

    // Start off by populating the base (leaf) layer
    var xi, yi, t = 0, color;
    for (yi = 0; yi < dim; yi++) {
      for (xi = 0; xi < dim; xi++) {
        color = [colorData[t], colorData[t+1], colorData[t+2]];
        finestLayer(xi, yi, new Circle(vis, xi, yi, size, color));
        t += 4;

    // Build up successive nodes by grouping
    var layer, prevLayer = finestLayer;
    var c1, c2, c3, c4, currentLayer = 0;
    while (size < maxSize) {
      dim /= 2;
      size = size * 2;
      layer = array2d(dim, dim);
      for (yi = 0; yi < dim; yi++) {
        for (xi = 0; xi < dim; xi++) {
          c1 = prevLayer(2 * xi    , 2 * yi    );
          c2 = prevLayer(2 * xi + 1, 2 * yi    );
          c3 = prevLayer(2 * xi    , 2 * yi + 1);
          c4 = prevLayer(2 * xi + 1, 2 * yi + 1);
          color = avgColor(c1.color, c2.color, c3.color, c4.color);
          c1.parent = c2.parent = c3.parent = c4.parent = layer(xi, yi,
            new Circle(vis, xi, yi, size, color, [c1, c2, c3, c4], currentLayer, onSplit)
      splitableByLayer.push(dim * dim);
      splitableTotal += dim * dim;
      prevLayer = layer;

    // Create the initial circle
    Circle.addToVis(vis, [layer(0, 0)], true);

    // Interaction helper functions
    function splitableCircleAt(pos) {
      var xi = Math.floor(pos[0] / minSize),
          yi = Math.floor(pos[1] / minSize),
          circle = finestLayer(xi, yi);
      if (!circle) return null;
      while (circle && !circle.isSplitable()) circle = circle.parent;
      return circle || null;

    function intervalLength(startPoint, endPoint) {
      var dx = endPoint[0] - startPoint[0],
          dy = endPoint[1] - startPoint[1];

      return Math.sqrt(dx * dx + dy * dy);

    function breakInterval(startPoint, endPoint, maxLength) {
      var breaks = [],
          length = intervalLength(startPoint, endPoint),
          numSplits = Math.max(Math.ceil(length / maxLength), 1),
          dx = (endPoint[0] - startPoint[0]) / numSplits,
          dy = (endPoint[1] - startPoint[1]) / numSplits,
          startX = startPoint[0],
          startY = startPoint[1];

      for (var i = 0; i <= numSplits; i++) {
        breaks.push([startX + dx * i, startY + dy * i]);
      return breaks;

    function findAndSplit(startPoint, endPoint) {
      var breaks = breakInterval(startPoint, endPoint, 4);
      var circleToSplit = []

      for (var i = 0; i < breaks.length - 1; i++) {
        var sp = breaks[i],
            ep = breaks[i+1];

        var circle = splitableCircleAt(ep);
        if (circle && circle.isSplitable() && circle.checkIntersection(sp, ep)) {

    // Handle mouse events
    var prevMousePosition = null;
    function onMouseMove() {
      var mousePosition = d3.mouse(vis.node());

      // Do nothing if the mouse point is not valid
      if (isNaN(mousePosition[0])) {
        prevMousePosition = null;

      if (prevMousePosition) {
        findAndSplit(prevMousePosition, mousePosition);
      prevMousePosition = mousePosition;

    // Handle touch events
    var prevTouchPositions = {};
    function onTouchMove() {
      var touchPositions = d3.touches(vis.node());
      for (var touchIndex = 0; touchIndex < touchPositions.length; touchIndex++) {
        var touchPosition = touchPositions[touchIndex];
        var prevTouchPosition = prevTouchPositions[touchPosition.identifier]
        if (prevTouchPosition) {
          findAndSplit(prevTouchPosition, touchPosition);
        prevTouchPositions[touchPosition.identifier] = touchPosition;

    function onTouchEnd() {
      var touches = d3.event.changedTouches;
      for (var touchIndex = 0; touchIndex < touches.length; touchIndex++) {
        var touch = touches.item(touchIndex);
        prevTouchPositions[touch.identifier] = null;

    // Initialize interaction
      .on('mousemove.koala', onMouseMove)
      .on('touchmove.koala', onTouchMove)
      .on('touchend.koala', onTouchEnd)
      .on('touchcancel.koala', onTouchEnd);

Create SAP Web Service with SAP .Net Connector in 5 minutes

Author: Dennis Wang / Microsoft / EAS /SAP

What is SAP .NET Connector

  • SAP product. Based on Microsoft .NET Technology
  • Interact with SAP via RFC/SOAP
  • Fully integrated with Visual Studio.NET
  • Managed Code
  • Generates C# Proxy Classes for any .NET application integrations
  • Supports RFC and SOAP
  • Supports qRFC, tRFC
  • Supports asynchronous SOAP calls
  • RFC client or RFC server


Feature of Web Service

  • It is ASP.Net Web Service
  • Hosted by IIS. Using HTTP protocol
  • Secure: SSL for connection. NTLM for authentication. Role base authorization.
  • Single sign via NTLM GSSAPI
  • Platform Neutral. Can be accessed via http protocol.
  • Strong versioning via XML Namespace

Steps to Create Web Service for RFC_Customer_Get

  • Create a C# project for ASP.Net Web Service
  • Generate SAP Proxy via SAP .Net Proxy Generator for RFC_Customer_Get
  • Open Proxy1.cs and change the following line
  • public void Rfc_Customer_Get(…) to public virtual void Rfc_Customer_Get (…)
  • Open Service1.asmx and do the following modification
  • public class Service1 : SAPProxy1
  • public override void Rfc_Customer_Get (…)
  • Add this code in this method
  • this.Connection = SAP.Connector.SAPConnectionPool.GetConnection (MyConnectionString);
  • base.Rfc_Customer_Get(Kunnr,Name1, ref Customer_T);
  • Compile the code and you have the web service for this RFC.

How SAP Single Sign On work under ASP.Net Web Service


Set up single sign on for web service

IIS Configuration

  • Disable anonymous access
  • Set up Windows Integrated Authentication

Web Service Configuration
Generate encrypted user name and password via aspnet_setreg.exe program. This value will then be set up in registry. Here we assume the user name is SAPCMDEV
Add the following line in Web.Config

<identity impersonate=”true” sername=”registry:HKLMSoftwareSapWebServiceIdentityASPNET_SETREG,sername”
password=”registry:HKLMSoftwareSapWebServiceIdentityASPNET_SETREG,password” /> 
GSS Library
  • Requires on the server where Web Service is located.
  • Copy the GSSNTLM.DLL to c:windowssystem32
  • If the GSSNTLM.DLL was copied to a folder other then within the environment search path, you need to add the following line in system environment SNC_LIB=”file pathGSSNTLM.dll”
  • Make sure to replace the gssapi32.dll with this GSSNTLM.dll if the old gssapi32.dll exists. The old gssapi32.dll does not work.
  • Create Entry in Table SNCSYSACL via SNC0
  • This table contains a list of trusted domain accounts or SNC.
  • Start SAP and run SNC0
  • Make sure to enable the RFC/CPIC/Ext ID options


  • Make sure all users who access SAP will have their User Accounts in USRACL or via SU01
  • Mapping external users into SAP users
  • Run SM30 and table VUSREXTID
  • Value: Work Area=NT.
  • Value: External ID = MYDomaindennisw
  • Program The Connection String with the following value:
  • SNC_MODE=1;
  • SNC_PARTNERNAME=”p:” + System.Security.Principal.WindowsIdentity.GetCurrent().Name; ‘ Web Service Process Account
  • EXTIDDATA=User.Identity.Name; ‘Caller credential


How does InfoPath 2003 connect to SAP?

  • Utilize SAP RFC and BAPI.
  • Generate RFC/BAPI proxy by using SAP .Net Connector
  • Create Web Service Wrapper around the proxy
  • Hosting/Publish the web service via WSDL
  • InfoPath Consume the web service
InfoPath 2003 SDK
–Available on under downloads
InfoPath 2003, Technical Webcasts, Technical White Papers, Development Guides
Visit for information on:
–SAP at Microsoft
–SAP .Net Connector
–Upcoming customer workshops