EJ68

Effective JavaScript: 68 Specific Ways to Harness the Power of JavaScript follows the format established by Scott Meyers’s seminal Effective C++ but is arguably even more useful, thanks to the popularity of JavaScript and the many pitfalls and blind corners introduced by its syntactically forgiving, dynamically typed, shake-it-like-a-Polaroid-picture philosophy and coding style. Buy it, read it, forget it, read it again. This book is one for the desert island.

It’s probably fair to say that JavaScript has always had a bit of a problem with code quality. Derrick Pallas, writing for the Daily WTF, circa 2007, is representative of the frustration:

The advent of JavaScript has made it really easy to write web pages that interact with you. Really, it’s insanely easy. The barrier to entry: way too low. It’s not that all JavaScript is bad, just that most JavaScript is not written with simplicity, correctness, consistency, or completeness in mind.

(more…)

CSGO Sites Becoming More Lucrative for Coders in 2020

With esports now becoming a global phenomenon and CSGO at the very forefront of it all, the internet has seen a huge increase in CSGO gambling.
For example, sites such as CS:GOBook.com are often created with a very quick turnaround and with the CSGO gambling scene in 2020 ever changing, companies are always looking for competent devs who bring something new to the table.

Git for the Antisocial: Setting Up a Local-Only Git Repository

Scenario: You want to use git but you don’t want to expose your code on a site like GitHub and you don’t want to deal with setting up your own remote repository from scratch. You want a simple, private, LOCAL repository. Is this possible with git? Is it possible to use git locally? Is it possible to use git without GitHub?

For all that git is often described as a “distributed” version control tool and sometimes confused with GitHub itself[1], you can and should sometimes be using git locally (without GitHub) if you’re using git (or GitHub) at all. Git may not be appropriate for every project, but more importantly, GitHub isn’t an appropriate venue for every project that uses git. Since setting up a local-only git repository takes all of ten seconds…

(more…)

Casino Health Measures and Ban on Smoking is Good for Business

The owners of tribal gaming that have enforced bans on smoking may be recording more revenue due to the current health crises, as they are seen as casinos that are more health oriented.

Smoking has been banned on tribal casino floors. It may seem a bit against intuition to try and bring in some changes in casino floors, but the sector is gradually coming to terms with the fact that this may be a very good development in the long run. Presently, a consultant on tribal gaming for the American Nonsmokers’ Rights Foundation named Clinton Isham is of the view that this is currently happening.

He believes that the casinos may have been transformed into a very comfortable environment for millennials and baby boomers because of the ban on smoking, as they are the generation that smokes less in the entire United States till date. On another angle, Isham pushed the argument that this is actually the desire of the fans.

Talking on the “New Casino Normal” Webinar by the National Indian Gaming Association, Isham trashed the problems that casinos are witnessing and how the urgent need to adapt could turn into a catalyst that takes the business to the next level. Many tribal gaming executives were present at the webinar, including Rodney Butler, the National chairman of the Mashantucket Pequot Tribal and Jason Giles, the executive director of NIGA.

The entire panelists came to a unanimous agreement that the decision of the tribes to reopen the casinos with the ban on smoking in place has had a very positive effect on their reputation and how people perceive them. That gave them the chance to reopen even before many other commercial properties in the country.

Taking a look at the numbers before and after the health crisis induced stay at home, Isham pointed out that there were only five non-smoking casinos before the health crisis, but right now, there are more than 150 casinos that are enforcing a ban on smoking out of the 500 tribal casinos out there. While there is an increase of one more win on average on casino floors that allow smoking every 30 minutes, we expect the non-smoking policy to last till after the pandemic.

How Good Can The Smoke Ban Be For Business?

According to the argument from Giles, it is difficult to find employees that are comfortable to work in smoking environments right now, as many of the millennials still believe that second hand smoking is still not good for health.

According to Giles, the only reason why tribal casinos may put a hold on the smoking ban is if players refuse to come to casinos because of the ban on smoking on the gaming floor. Looking at the 78.8% drop in revenue in the second quarter, the operators of commercial and tribal games will need to do a lot of catching up.

However, Isham said that members of the rewards clubs that enjoyed games in the smoke free environments tended to spend more time at the gaming floor and add more to the bottom floor of the casino, putting to bed the notion that customers that smoke spend more at the casino floor. The idea that customers will run away from casino floors if smoking is banned was rubbished by Isham.

The purpose of going to casinos by players is not to smoke cigarettes. Their reason for coming to the casinos is to gamble. So irrespective of the smoking rules, they will always come to the casinos.

He concluded that the tribal casinos were able to overtake their commercial counterparts in revenue because of their willingness to enforce the necessary health policies even when others were still dilly dallying about it.

Live Chat Support System Developed for Online Casinos

With more and more gamblers choosing to play their favourite games online, the need for high level support on the platform has grown too.

Florida: A New Poker Mecca?

I’m sitting in a $2/$5 No Limit Hold’em game somewhere on the Treasure Coast. A cup of brown sludge sits in a protective cupholder on a sidetable nestled between my seat and the seat of the player to my right, who we’ll call Billy Bob. Billy Bob runs a profitable landscaping business but sadly has hemorrhaged three $500 buy-ins in the last hour and looks primed to lose a fourth. It’s October 2011. Uncapped No Limit Hold’em has only existed in Florida for a year and three months. I’ve been here three weeks.

(more…)

Online Bingo Market Growing Rapidly

In recent years, the online bingo industry has become a hotbed for good developers. Some of the world's top talent are making the switch. 

Defensive Programming Example #1

The other day I stumbled across this bit of C# code, intended to randomly return one of four messages.

// Choose one of 4 messages to display randomly
string theMsg = "";
Random r = new Random();
switch(r.Next(4))
{
    case 0: theMsg = "Hey!"; break;
    case 1: theMsg = "Whats up?"; break;
    case 2: theMsg = "Salutations."; break;
    case 3: theMsg = "Hail-"; break;
    default: throw new ArgumentException(); break;
}
return theMsg;

Few programmers would have trouble grokking what this code does. It’s intelligible and, in its current form, not too much of a maintenance headache. But defensive programming isn’t just about making your code intelligible; it’s about making your code tolerant to quick changes made under pressure, and incremental changes made over time, by people other than yourself, including the future version of yourself who no longer remembers the code.

In that light, this code has a lot of problems:

(more…)

Of Gravatars and Robohashes

Webmasters who use Gravatar to decorate comments with custom avatar images will be familiar with the d parameter of the Gravatar image request.

<img src="http://www.gravatar.com/avatars/8ca7425c8a9da807b9bf6934f10d59fa.jpg?d=monsterid" alt="" />

You can specify values like monsterid, wavatar, identicon, or retro here and Gravatar will generate a unique avatar image corresponding to the MD5 hash of the user’s email address. You’ve seen these all around the web:

There are just a couple problems with these sets of generative graphics:

(more…)

Movie Doppelgangers: B-Movie Ripoffs of Hollywood Blockbusters

[Skip to the Movie Doppelgängers poster.]

Well, another $5 down the drain. The other night I stopped by Blockbuster to rent a copy of Battle: Los Angeles. Blockbuster is a bit of a ghost town these days, the sort of place that makes you think:

Huh, wonder what my first move would be if the undead attacked, right here, right now.

I was in a hurry and I kept imagining the clerk would morph into a zombie and I’d be forced to defend myself with stacks of $5 previously-owned titles from the bargain bin. So in my haste/nervousness I ended up grabbing a copy of what looked like Battle: Los Angeles, but was in fact Battle OF Los Angeles. Silly me.

(more…)

Coding the Tweet, Redux

A few months ago we built a simple Twitter desktop client with oAuth support using C# and .NET.

Since then, there have been some breaking changes in the Twitter oAuth implementation, including a new PIN-based authorization mechanism for desktop Twitter clients. If you’ve been getting 401 Unauthorized errors, this is probably why.

(more…)

Are Commercial Databases Worth It?

I’ve worked with expensive SQL Server and Oracle setups for most of my career. I’ve defended them viciously against all comers and contrarians. I’ve participated in late-night guerilla flame wars and drunken bar brawls. And I’ve sought out with relentless tunnel vision those pieces of propaganda which support my foregone conclusion: that SQL Server and/or Oracle are (or were) the best choices for the organization.

I used to be a commercial database advocate.

These databases have put food on my table for a dozen years, you see. I am (or was) what you might call an entrenched practicioner, not necessarily an expert, but a practicioner. And in the manner of entrenched practicioners around the world, I’ve treated you heretics with the sadistic undercutting and poisonous rancor you’ve deserved!

(more…)

Coding the Tweet: Building a Custom Branded Twitter Application

UPDATE: The Coding the Tweet demo application and source code have been updated to support PIN-based authorization through oAuth.

With millions of users and an ecosystem saturated with over 700 custom applications, Twitter’s all the rage these days. Love it or hate it, Twitter has become a powerful medium for connecting with people and marketing your skills to a wider audience. As the saying goes:

Twitter marches on.

(more…)

A Pokersource Poker-Eval Primer

Pokersource Poker-Eval, the open-source poker hand evaluation library, takes a lot of flack for being “low-level”. In The Great Poker Hand Evaluator Roundup, I wrote:

The Poker-Eval library is implemented in highly optimized, heavily macro’d C for unadulterated speed, but language mappings for .NET, Java, and Python are provided. Now, I’ll be honest. The first time I saw the poker-eval source code, I immediately unlearned about sixty-two months of best-practices software development…

That statement was a little tongue-in-cheek, but still: it seems like every time someone suggests Pokersource Poker-Eval, a disclaimer immediately follows:

Don’t use this library unless you’re a competent C programmer! Danger, Will Robinson!

Just the other day, for example, I was looking at poker-related questions on Rated Betting Sites when I came across this: How Do I Programatically Calculate Poker Odds?

Hello, I’m trying to write a simple game/utility to calculate poker odds. I know there’s plenty of resources that talk about the formulas to do so, but I guess I’m having trouble translating that to code. Particularly, I’m interested in Texas Hold-em …

I understand that there are several different approaches, one being that you can calculate the odds that you will draw some hand based on the cards you can see. The other approach is calculating the odds that you will win a certain hand. The second approach seems much more complex as you’d have to enter more data (how many players, etc.)

I’m not asking that you write it for me, but some nudges in the right direction would help :-)

One of the answers suggested using Pokersource:

Take a look at pokersource if you have reasonably strong C abilities. It’s not simple, I’m afraid, but some of the things you’re looking for are complex. The poker-eval program that uses the library will probably do much of what you want if you can get the input format correct (not easy either). Sites such as this one or this also use this library AFAIK.

Still, it could be worse, you could be wanting to calculate something tricky like Omaha Hi-lo…

Again with the disclaimer! And it occurred to me: you know what? All this FUD is really kind of bogus. As of this writing, Pokersource is still the best and most complete library of publically available poker-related code in the world. Period. What’s more: the Pokersource evaluator is extremely easy to use provided you understand the Pokersource way of doing things.

So I thought, why not put together a brief Pokersource Poker-Eval primer?

(more…)