Scalable Sockets with SockJS and Redis

Joseph DotsonOne of the biggest issues with socket servers is that traditionally they do not scale. The requirement to have a consistent TCP connection makes things very difficult when you want to scale. If one connection sends a message to Server A, how does that message get to a user on Server B?

The solution is to integrate with some centralized pub/sub system that is external to the socket connection system. Unfortunately, this means that if your socket layer is already heavily based on pub/sub, you will end up duplicating efforts.

Continue reading “Scalable Sockets with SockJS and Redis”

IBS Solutions Group Presents .NET Core to Development User Group in Lansing, MI

Joseph DotsonOn Thursday, I traveled to the TechSmith Corporation in the Lansing, Michigan area to deliver a presentation about .NET Core, Microsoft’s newest open source cross-compatibility framework.

At the presentation, I discussed some of the platform’s features and functionality, such as dependency injection, logging, user roles/identities, and use cases.

Continue reading “IBS Solutions Group Presents .NET Core to Development User Group in Lansing, MI”

Decorators in TypeScript

3Decorators are an experimental feature of TypeScript and, to an extent, of JavaScript itself. They are a concept borrowed from Python, and a way to modify classes using higher order functionality.

The idea is that you pass the class/function/attribute through a function and the result becomes the class/function/attribute.

As an example, if you make a @final decorator and have the code…

Continue reading “Decorators in TypeScript”

Using External Modules in TypeScript

Joseph DotsonWhen programming in TypeScript, you may need to use existing JavaScript modules. This should be a lot easier than it is. You should be able to just use a require and pass a flag in to let the compiler know that it’s a js library in order to convert it to an Any, however that is not possible.

What actually needs to be done is the creation of a .d.ts file. This file (or files) declares the shape of the module. This includes any functions or interfaces that might be needed used when using the class.

Continue reading “Using External Modules in TypeScript”

IPython and Interactivity

across this post and it quite literally blew my 3I recently came mind.

By importing everything from `IPython.html.widgets` you get an interact method. Any method that accepts parameters can be made interactive with sliders for values.

When experimenting with data, being able to change the values without changing code and re-running is a huge boon. Especially when looking for outlier thresholds. Instead of changing and re-running the graph every time, just add a slider and adjust until you have the value you want.

As I do a decent amount of experimentation with data, this will save me a large amount of time trying to figure out outliers. Will I use is for every project, no, but I will use it for the majority of data science I need to do.


index.html commit hell

3One of the issues we face when dealing with angular apps is the number of js files that need to be included in the index.html. Especially when you are working on a large project, the number of js files can reach over 100. In order to combat that, and make things easier for developer, tools like wiredep and gulp-inject were created. These tools search the directory structure, and add the js and css files to the index.html.

Continue reading “index.html commit hell”