Google Aims to Block Fake News, but who determines what fake news is?

In the wake of complaints about rampant misinformation affecting the presidential election, Alphabet, Inc. (GOOGL) subsidiary Google announced on Monday that it is working on an update that will restrict ad-selling software from appearing on fake news sites.

[…]

Social media giant Facebook, Inc. (FB) and to a lesser degree Twitter, Inc. (TWTR) h

Read more

Socket.io 1.3.2: client events received in browsers prior to all JS being loaded

FireFox experiences a race condition between the loading of code in scripts and receiving socket.io events if a socket establishes a connection concurrently with the loading of scripts.  If a socket.io client in FireFox connects to the socket.io server in a script, but there are socket event handlers yet to be loaded (or general JS yet to be loaded), even… Read more

Socket.io 1.2.0: Handling global authorization events when client connects to a custom namespace

The documentation on socket.io’s page and its GitHub page are inconsistent (namely due to the latter being out of date, but contains information not covered by the former). A problem arises when using global authorization middleware on the server, having a client trying to connect to a custom namespace, and having the server deny access to the conne… Read more

Expected Value Calculator for Lotto Max and Lotto 6/49

Discover how playing the lottery is nearly the equivalent of a 50% tax on your after-tax disposable income. See how much you lose on average when you dream of winning big!

*     *     *

If you like gambling but don’t like losing money, the play money gambling games at GameSlush.com might be for you.… Read more

Rapidly Computing the Standard Deviation for a Fixed Period (Length of Data)

Wikipedia’s page for Standard Deviation presents a formula for rapidly calculating the standard deviation of a growing set of numbers:

[1] Qk = Qk-1 + (xk – Ak-1)(xk – Ak) where xk is the kth element in the set and Ak is the mean of the first kth numbers.

The standard deviation squared of the first n numbers of a set is Qn / n.

From this, it is easy … Read more

List of MSN Gaming Zone Backgammon Cheaters

[Update: MSN has removed Backgammon from its games. Probably because of the rampant cheating. For a more fair place to play Backgammon that minimizes the chance of cheating (particularly because of the availability of instant replays) try https://www.gameslush.com/backgammon]

Figured I’d compile this list after seeing several cheaters that … Read more

PHP’s setcookie() with $expire set but not $domain will blow away the cookie in Internet Explorer (IE)

Spent a whole day figuring out this one.  Yet another reason why Internet Explorer is the bane of web development. Found a plethora of suggested solutions on the net, and even an old bug logged for PHP in 2001, but the reason behind the bug is still a mystery.

As the title states, if you use setcookie() with $expire set and $domain not set, then IE may simply let th… Read more

An efficient but effective artificial intelligence for Big 2

(tl;dr: You can play against an AI computer user I designed for an online Big 2 game here.  The bots are capable of calulcating the expectation for its score for every possible line of play very quickly, resulting in a rather worthy opponent for even the most seasoned Big 2 players).

The dynamics in Big 2 make programming AI for it an interesting problem.  The … Read more

Using the background function of Processing.js with images

“Background image must be the same dimensions as the canvas.”

In case you are looking for a workaround for Processing.js background function that forces you to scale your background image, try this trick to make your browser do the scaling for you.

Set the CSS background for the canvas element to your image, and use “cover” or R… Read more