Friday, December 26, 2014

Socket.io from IE8 and IE9

My initial implementation of socket.io worked great with Chrome and Firefox; however, notifications were not being sent to Internet Explorer. The error was:

FlashPolicyFileServer received an error event:listen EADDRINUSE

The solution is in this post https://github.com/Automattic/socket.io/issues/1011 and basically, you need to do this on the server:

io.set('flash policy port', 3300);       //override policy port  
io.set('transports', [                     // enable all transports (optional if you want flashsocket)
    'websocket'
  , 'flashsocket'
  , 'htmlfile'
  , 'xhr-polling'
  , 'jsonp-polling'
]);

and this on the client:

var socket = io.connect(socketAddr,{'flash policy port':3300});

Wednesday, September 24, 2014

Missing SSIS toolbox

The other day I couldn't find the toolbox to add a component, so I followed these instructions. Basically a right click is enough, but I'm still learning the ropes:

http://geekswithblogs.net/AskPaula/archive/2013/07/11/153385.aspx

Friday, September 5, 2014

Debugging MDX queries

To put it simple, IT IS NOT POSSIBLE. I came across this tool http://www.sqlbi.com/tools/mdx-studio/ but it didn't help me a lot. What helped me was this article http://blogs.adatis.co.uk/blogs/jeremykashel/archive/2013/06/14/debug-mdx-with-generate.aspx which talks about using the Generate aggregate function to generate "logs".

It helped me find an incorrect sum in an mdx query, so I highly recommend this technique.

Tuesday, September 2, 2014

An MDX alternative to DistinctCount in SSAS

I got started using SSAS and SSIS, and needed to implement a DistinctCount in an MDX query. Eventually (after a few hours) I came up with a solution, and a few days later found the solution here:

http://richardlees.blogspot.mx/2008/10/alternative-to-physical-distinct-count.html

Saturday, May 31, 2014

Logging in WCF

Have you ever wondered how to log messages sent to a WCF service? I had an iPhone app not being able to connect to a method in a WCF service, so I did this to enable logging of requests:

  <diagnostics>
    <messageLogging
         logEntireMessage="true"
         logMalformedMessages="true"
         logMessagesAtServiceLevel="true"
         logMessagesAtTransportLevel="false"
         maxMessagesToLog="3000"
         maxSizeOfMessageToLog="2000"/>
  </diagnostics>
  </system.serviceModel>
<system.diagnostics>
  <sources>
      <source name="System.ServiceModel.MessageLogging">
        <listeners>
                 <add name="messages"
                 type="System.Diagnostics.XmlWriterTraceListener"
                 initializeData="c:\logs\messages.svclog" />
          </listeners>
      </source>
    </sources>

</system.diagnostics>

Then once you have a log file, open it with SvcTraceViewer.exe, the Service Trace Viewer tool from Microsoft.

Saturday, May 17, 2014

Socket.io: Sending logs to a file

It's quite simple to send the console messages from socket.io to a file. I followed this tutorial (http://masashi-k.blogspot.mx/2013/02/logger-for-socketio-save-it-into-redis.html) and the steps are:

1) Install winston
2) Configure the logger output file
3) Link the logger to socket.io using this code:


 var io = require('socket.io').listen(server, {
      logger : logger
    });

Monday, April 14, 2014

Calling JSON WCF Services from .NET 3.5

The short answer is that you need to use the WebClient class. For the lengthy answer, check out this link:

http://www.c-sharpcorner.com/uploadfile/dhananjaycoder/wcf-rest-service-with-josn-data/