unFocus Projects

Author: Kevin Newman

  • Trump won on a feeling of powerlessness


    Trump won on a feeling of powerlessness

    The professional left through the DNC delivered us an impressive defeat, snatching victory from the jaws of defeat by installing unpopular insider Hillary Clinton at the top of the ticket, instead of allowing record breaking independent Bernie Sanders to take the nomination and helping him sale to victory. The result; losing the presidency, the House of Representatives, the Senate, and so much more at state and local levels.

    This robust thumping should give the professional left and DNC insiders a chance to finally understand what they have refused to see about working people. People feel powerless. It’s that simple. Racism, misogyny and white privilege are embedded in Donald Trump’s hateful campaign, but they are not the primary motivation for most Trump supporters. Working citizens are having a hard time. They feel little power to shape their situation and their futures, or to protect their children and their communities from all sorts of threats, including the whims of big business and their own employers. They see (correctly) business in cahoots with big and local government. Maybe some of them are doing just fine in quantifiable terms, but whatever wealth can be attributed to them provides little agency. The power gap driven by historic wealth gap is simply too large. The professional class within the ranks of Liberal Democrats seem to delight ignoring this problem completely, or even apologizing for it (looking at you Paul Krugman). Donald Trump addressed this powerlessness directly in his campaign, and it’s not surprising it found resonance.

    The professional left and the DNC have turned a blind eye to ongoing disempowerment, to their own peril. Nothing about the way they handled Sanders in the primary can be spun positively in light of this. But there’s a real chance for progressive Democrats to finally get the party on the right foot. Let’s talk about empowerment for working people. It doesn’t have to be unions?—?my favorite prescription is worker owned employers, an idea that sounds even bipartisan, evoking a great ownership society. The left already has a lock on compassion, but we need a positive vision to replace losing neoliberal and meritocratic idiocy. Losing has consequences, and the consequence of this loss is Donald Trump’s special brand of ignorance, regression and counterproductive GOP policy which will only make things worse for the very people who supported him?—?working people.

  • Bringing Sanders supporters to Clinton


    Bringing Sanders supporters to Clinton

    I’ve been trying to figure out what Hillary Clinton would have to say to turn this Bernie Sanders supporter into a Hillary Clinton supporter. Here’s what I think she has to do to win our (and probably some Trump) support. She needs to acknowledge the pain and stress we are feeling?—?intellectually or empathically, I don’t care which?—?and it’s enormous stress, crushing really. We’ve seen wage stagnation for decades, increasing school tuitions, crumbling public institutions including meak unions, increasing debts, reduced opportunities to work meaningful jobs, with respectful pay?—?there’s so much more. It’s pretty clear we are in trouble to those of us outside of the gentrified bubbles around the country, and even to many of us within. Some acknowledgment that the system she has been a part of, even helped design to some degree, has been responsible would be nice too, though not strictly necessary.

    Based on her surrogates in the the media, and generally what I’m hearing from her supporters, who seem to prefer to use rhetoric to dismiss the pain and stress people feel as if it’s childish, or unwarranted (screw you), I’m not sure she (or they) really understand how bad things are for working people, and citizens in general. It’s bad, and I’m not sure why she (and her supporters) can’t trust us or respect us enough to hear it when we tell her. If Clinton can figure out how to communicate that she does get it (and if she really does), then she can easily win the white house. If she can’t, Trump has a real shot (despite being a terrible candidate?—?I mean, monumentally bad, just from a purely political standpoint, not even getting into substance—just super bad).

  • Quint Dice update – Facebook and profile

    An update on Quint Dice. I turned on all the Facebook registration and login stuff that’s actually been done for a while, but I had off for a few reasons. Users may now sign up with their Facebook account, to make it easier to get started. Adding Facebook support has been one of the bigger time sinks in this project. Here’s a list of what’s done and not, so you’ll see why.

    Done:

    • Facebook accounts – done!
    • Facebook link accounts (if you have a password based account, you can add Facebook to it, then log in with your FB account in the future).

    Not Done:

    • Facebook Canvas – as I mentioned in an earlier post, it looks like ads are a problem within Canvas. I still have to figure out what to do about that.
    • Facebook notifications – The setting is available, so you may opt-out (it’s on by default) but I haven’t set it up to send notifications yet. It looks like I need to have a return URL within a Canvas app to make it work, but I’m not certain, and need to read the FB docs more carefully.
    • Native Facebook in Cordova for Android and iOS. This is turning into an endless headache. There are at least 3 Meteor packages that promise to do this, but each needs a Cordova plugin that I just can’t seem to build (a third one that I’m not sure how to install). I had hoped this would be much easier (and I’m actually pretty sure I once had it working), but it’s costing me a lot of time, so I’m probably going to let it lie for a while.
    • A user who registers with Facebook will have no username – I need to make sure they enter one, since that’s the primary way we do user discovery ATM.
    • No friends list, which is an important feature in my mind – starting games and inviting folks to play.
    • Account merging – if a user signs up one way (password) then signs up again another way (Facebook) then wants to link their accounts, they should be able to. There is a Meteor package (or 2) for this, but I have to implement some glue for it.

    Other updates in this round are better styling for forms, and the ability to set other profile data, such as your email address (useful if you forget your password!). You can also change your username if you want, and opt-out of push notifications on mobile.

    More soon!

  • Introducing Quint Dice!

    Introducing Quint Dice!

    I’ve been working on a game for the last few months in spare time. It’s a dice game called Quint Dice, a social dice game. What makes this different from so many dice games out there is that it’s based on dice that have color pairs, and you can play it with more than two players.

    What I’d like to avoid with Quint Dice is pay to win forms of revenue. Currently there are no bonus rolls. I’ll eventually add some, but you won’t be able to buy them or stock pile them to gain advantage over your opponents. I think I’ll add one bonus roll per game, and if you don’t use it in that game it goes away. I may also add a second bonus type – an extra dice. The idea is to add a level of strategy and flexibility to the play, without allowing a fundamental shift in advantage for one player or another just because they paid for an advantage.

    The only revenue source built into the game at launch is a small banner ad at the bottom. I’d also like to add custom dice packs, and maybe some full on themes. I’m hoping this will be enough to turn this into something that pays for itself. I may also play with interstitial ads, but only as a voluntary way to earn points to buy custom dice packs and themes without shelling out cash, for users who prefer that route. I like this better than pestering players with involuntary interstitial ads as a way to get them to pay. Annoying players is not my favorite model, no matter how common it is in mobile gaming. Finally, there will eventually be an option to remove the ads.

    I built Quint Dice with Meteor and React, and I would like to eventually port to React Native, but I’m using Cordova for the time being on Android and iOS (soon!). Like so many of the projects I play with under the unFocus banner, this has mostly been a learning exercise. But I’m happy with the results, and thought I should probably dust off this blog, and may start to share some thoughts I have as I develop these things.

    To kick that off, I’ll share a couple of things I learned while getting this out the door, in no particular order. If you’d like to know more about any of these items, please leave a comments, and I’ll see about writing a follow-up post.

    • Facebook integration is easy/hard. Getting notifications to work seems pretty easy, but getting a canvas app to work posses some challenges, particularly where advertising is involved. You can’t use AdSense inside an iframe, which is needed for FB canvas. Instead you’ll need to go with one of Facebook’s approved ad vendors. They all have that institutional feel to them, if their websites can even be reached. Not a fantastic dev experience. The solution I’ll probably go with is to create a Facebook canvas based landing page, and then flow my users to my domain from there, instead of having them play within the canvas page.
    • Meteor’s accounts system is awesome! With very little effort you can get up and running with a full accounts system, and there are a ton of Meteor packages to expand functionality. I ended up building custom UI in the end, but to get started I used the off the shelf accounts-ui, so I didn’t have to wait. I’ll probably be using a link accounts package to add the ability to associate facebook, google+ and maybe other third-party accounts services (Amazon perhaps) to existing Quint Dice accounts. I may also use an account merge package to make it so users can merge their accounts if they accidentally sign up with two different auth sources and want to combine their accounts into one. There are two different packages for that – and these are the kinds of things that make Meteor so fantastic! I can’t think of another platform where something like that is so easy to set up. Setting this up has some interesting challenges in terms of user flow, and it’s probably worthy of a blog post or two.
    • My on boarding process is a mess in the current iteration. I hope to fix that with the above mentioned packages link and merge packages. I may also play around with having an anonymous user for anyone who comes to the site and is not logged in. That way they can just get started.
    • Finding players is another messy area so far. I basically only collect one bit of information from users – a username. To start a game with other players, you are presented with a giant list of every player. This clearly needs work. Eventually I’d like to add Facebook friend support, and maybe even a friends list internal to Quint Dice. I’ll also add more profile data and some way to search on that (this is on my short list).
    • Push notifications are relatively easy to set up on Android. Relatively more complicated on iOS, but I should have that out soon (this is the only thing hold up an iOS release). I did figure out how to get a nice black and white notification icon to work, and that maybe warrants its own blog post (see this Meteor forums post for now). I’m using raix:push package in Meteor for that.
    • Meteor’s React support is build around a React Mixin, which basically wraps a single method on a component to make it reactive. This makes sense given that Meteor typically doesn’t enforce any kind of application architecture on the developer (a good thing IMHO), but I will probably switch to using something more Flux like. For non-reactive data sources and application state, I’m already using a Flux like pattern/architecture (using SignalsLite.js), but I may look into something like Reflux (or maybe Redux, or Alt) and then figure out how to move my reactive Meteor handling to that level. This probably warrants a blog post or two.
    • I used Adobe Animate CC to create the animated dice roller (output as HTML5 Canvas of course). CreateJS is pretty sweet, even on mobile. I may experiment with OpenFL for new dice packs, and see how well that runs. I’m thinking that custom dice packs will stay in HTML5, even if I eventually transition to React Native, so that they can be truly cross-platform. The only challenge with that might be an eventual port to Apple Watch, and AppleTV, which don’t support WebViews. I’m curious though if there is a way to use the JS behind my canvas based mini-apps, and render that through some HTML5 canvas wrapper from within a JavaScriptCore instance (is JSCore on Apple WatchOS and Apple TVOS?). When I figure this out, I’ll almost certainly blog about it. Of course, I may not even need all that if I go with OpenFL, because they have a native c++ compiler.

    Going forward, I’ll try to post more, probably when I make an update. There are a ton of other important packages (aldeed:simple-schema and aldeed:collection2) and technologies to cover, and I’m sure I’ll mention them eventually.

  • HiDPI/Retina for CreateJS (Flash Pro HTML5 Canvas)

    Adding HiDPI and Retina screen support to a CreateJS (Flash HTML5 canvas publish with EaselJS) is easy enough. Just add this code after where the stage is defined in your published html file (either inside the generated init function, or handleComplete if there are external assets to load):

    [js]
    if (window.devicePixelRatio) {
    // grab the width and height from canvas
    var height = canvas.getAttribute(‘height’);
    var width = canvas.getAttribute(‘width’);
    // reset the canvas width and height with window.devicePixelRatio applied
    canvas.setAttribute(‘width’, Math.round(width * window.devicePixelRatio));
    canvas.setAttribute(‘height’, Math.round( height * window.devicePixelRatio));
    // force the canvas back to the original size using css
    canvas.style.width = width+"px";
    canvas.style.height = height+"px";
    // set CreateJS to render scaled
    stage.scaleX = stage.scaleY = window.devicePixelRatio;
    }
    [/js]

    IE 10 doesn’t support devicePixelRatio, but you can get a resonable devicePixelRatio with this (include it before your CreateJS script, and call window.getDevicePixelRatio() instead of using the standard property):

    [js]
    /*! GetDevicePixelRatio | Author: Tyson Matanich, 2012 | License: MIT */
    (function (window) {
    window.getDevicePixelRatio = function () {
    var ratio = 1;
    // To account for zoom, change to use deviceXDPI instead of systemXDPI
    if (window.screen.systemXDPI !== undefined && window.screen.logicalXDPI !== undefined && window.screen.systemXDPI > window.screen.logicalXDPI) {
    // Only allow for values > 1
    ratio = window.screen.systemXDPI / window.screen.logicalXDPI;
    }
    else if (window.devicePixelRatio !== undefined) {
    ratio = window.devicePixelRatio;
    }
    return ratio;
    };
    })(this);
    [/js]

    If you like to load your CreateJS based animation in an iframe (I do) and the canvas content is the only content, you may also want to add some styles to avoid scrollbars and extra padding:

    [css]
    body {
    margin:0;
    padding:0;
    }
    canvas {
    display: block;
    }
    [/css]

    Before making these edits, I recommend copying the main html page, so that you don’t have to worry about the publisher wiping out your changes when you publish again (if certain things change, you may need to reintegrate your changes).

    Some Notes:

    • Some (slightly) older versions of Safari on OSX with Retina screens seemed to automatically apply a pixel doubling to canvas elements, so this might be redoubling again (I’m really not sure). It doesn’t seem to do this in the latest version though.
    • If you use “cacheAsBitmap” the content will be cached at the normal resolution. If you can find the place in code where that’s being set, you can actually apply the devicePixelRatio multiplier there by passing it in as a variable to the function that sets CAB, but CreateJS does not do this by default.

    Relevant info for devicePixelRatio and supporting HiDPI / Retina displays