Category: Development

  • Random number generator only generating one random number

    To generate a random number it involves instantiating the Random class then calling the Next function with a minimum and maximum value as follows: new Random().Next(min, max) so why is it always returning the same number? This commonly occurs when this is being called in a loop.

    (more…)

  • Uncaught ReferenceError: require is not defined

    When you’re first starting out with Node js, it might be a bit confusing because you are most likely accustomed to writing JavaScript code for the web browser. When Node js is the server, the syntax is similar but there are a few differences around how other JavaScript files and modules are included. When writing on the server side you may include files as follows: require(‘./mysharedfile’);.

    (more…)

  • Entity Framework Stored Procedure Returns No Columns

    I was recently adding a new stored procedure to my Entity Framework EDMX (database first) when no columns were being recognized by EF. I was slightly confused by this, luckily I found this simple solution. At the top of your stored procedure definition, add SET FMTONLY OFF. I suggest only adding this setting temporarily; further explanation is below.

    (more…)

  • jQuery Datepicker with a Knockout js custom data binding

    Whether you are using the Bootstrap datepicker with a JavaScript array or the jQuery datepicker, they both use the same underlying JavaScript library. So with today’s example, let’s explore implementing the jQuery library with an added bonus of creating a Knockout.js custom binding.

    The end goal of this custom data bind jQuery tutorial is to create a form input field data bound not to the standard value binding, but instead to the custom one appropriately named: datepicker.

    (more…)

  • Full screen/background video from YouTube using jQuery

    I was searching the web for some neat ideas and I came across this intriguing jQuery plugin that allows you to embed a YouTube video on your website. No, not the standard player, but instead the video is your background. Similar to how you would use an image or color, the YouTube video plays automatically in full screen as the background of your website; here is a demo of the plugin.

    (more…)