Archive for the ‘ IT ’ Category

Some New Jams, and a Teeeeny Sneak Peek Into 2016

Mainstage at Tech(no11)

Mainstage at Tech(no11)

Happy Boxing day ladies and gentlemen. I know it’s been a minute since you’ve heard from me and it’s for (somewhat) good reason. I have a lot of really exciting things to tell everyone about as 2015 begins to wind down. First things first though, hit play and listen to the latest edition of State Dependent Learning – Vol 4!

I want to give a HUGE shoutout to my good friend Dabura for letting me play what is one of my favorite new tracks. The first time I heard it was at his place a few weeks ago while he was prepping to play for a Transmit Tuesday at Spybar. He’s so damn humble that at the time he wasn’t even sure if he was going to play it that night or not. Myself and one other friend more or less insisted that he do.

Talk Nerdy to Me

Okay, so, sorry we’re still using my shitty JS player. I can promise you that I haven’t been sitting around with my thumb up my ass and there’s a REALLY REALLY REALLY cool new one coming soon I promise. Actually, let’s talk about what’s going on where my passions for music and software meet. Most of you know that I’ve been working very closely with Onlythebeat.com for some time now and that we are going to be launching a streaming music service. Progress has been a LOT slower than I would have liked it to be, however we are getting SUUUUPER close to being able to launch! Excluding OTB Staff and industry insiders, we’re going to be offering a beta to a VERY LIMITED number of my friends, family, and whoever kisses my ass enough, so look out for that. I really really reallly wish I could tell you more about the features and functionality that the new service will offer, however that will have to wait a few more weeks.

I can say that the back end is a thing of SERIOUS beauty. It’s written in PHP using my good friend David Young‘s Opulence Framework. There’s a lot of fancy footwork going on behind the scenes and it really wouldn’t have been doable without his tireless efforts. The back end will actually be accessible via a publicly documented API, so I’m looking forward to seeing what kind of 3rd party apps people dream up. Maybe someday you’ll see OTB Ableton Plugins and apps.

On the frontend side, I’ve taken it upon myself to learn AngularJS – and boy has that been a shallow learning curve!! Actually pretty much the only reason we’re not live is because I’m still hammering out the connection between the front and back ends. The things that Angular lets you do, however, are worth the sweat equity. As soon as that’s done, onlythebeat.com is going to be a different animal altogether.

Great Jams Bro. When and Where can I see you Play?

So this is blowing my mind, but 2015 has been a really good year for me in terms of my development as a DJ. To think that I literally played my first gig at a yoga studio this April. Four months later, I was graced with the honor of playing the main room of a monthly loft series that has become a Chicago staple. By far my favorite gig this year though, was without a doubt this boat party that I played in Austin, TX for Halloween. Sometimes the combination of the crowd, the jams, and what you happen to be feeling at the moment just combines and you blow everyone’s mind. That was what happened at this particular party. It certainly didn’t hurt that my costume was a huge hit.

Some men just want to watch the world burn. Playing on a boat party in Austin, TX for Halloween 2015!

Details are still in the works, but I’ll be playing in Mexico for a BPM afterparty on Jan 12 & 14. January 14 is my birthday, so if you don’t come to Mexico for this, I’m going to be seriously PISSED. Flights are super cheap and this particular party doesn’t even charge a cover so you have literally ZERO excuse to not go.

On Jan 5 & 26 I’ll be at Spybar for Transmit Tuesdays. Jan 20th I’ll be at Lokal for Consumed. I’m sure there will also be a few Corepower dates as well, though details for all of these are still in the works. As soon as I have flyers and 100% confirmed set times and dates, don’t you worry…. I’ll be spamming you along with everyone else I know :p.

This one is for My Hurricane Bitches

I couldn’t help myself. I SHOULD be making sets for all of my yoga instructors like I promised them I would, but I’m having so much fun doing these Bowling sets that I just HAD to post another one. I’ll never tell you who it’s for, but the name is a reference to a certain kind of woman. We all know the type; they come into your life wet and wild, then they leave with your lawn furniture. You know, like Hurricanes!

Update: Do not try and click this player from the main page. Apparently it fights with the other players on this page. You need to go here instead

Bowling – Hurricane (2/14/2015)

Tracklist

  • 1 – Lana Del Rey – Brookly Baby (Konstantin Sibold Remix)
  • 2 – Oliver Heldens & Mr. Belt & Wezol – Pikachu
  • 3 – Hardsoul (feat. Hero) – Human
  • 4 – Claus Casper & Jean Philips – Anytime Anywhere (Dub Mix)
  • 5 – Rampue – Don’t Wanna Leave You (Nicone & Sascha Braemer Remix)
  • 6 – Fashion Lioness – If I leave You (The Mankeys Remix)
  • 7 – Adana Twins – Everyday (Amine Edge & Dance Remix)
  • 8 – Mineo – Get Out Fight
  • 9 – Alexis Raphael – Assault Weapon (German Brigante Remix)
  • 10 – Redondo – Waist Shake (Club Mix)
  • 11 – Rey & Klajek – Animal Vs Beast (Adritique Remix)
  • 12 – Della Zouch – Rebel (Raxon Mix)
  • 13 – Harada – Paws
  • 14 – Booka Shade (feat.Fritz Kalkbrenner) – Crossing Borders (Pleasurekraft Remix)
  • 15 – Jade Blue & Frequency – Lately (Vox Mix)
  • 16 – Lucas & Steve & Nothing But Funk – Clueless

Now let’s indulge my ADD

I have to say that I had a lot of fun writing my last post. The format of it was perfect if I do say so myself; let you guys listen to some good music while I go on about my antics (and hopefully learn a thing or two about writing code). Seems like having me around in real life, only less annoying because you can listen to music and tune my (written) voice out.

I’ve been working like a madman on a number of projects in my day job so I haven’t had a ton of time, but I have been playing with my little music hosting service a little bit. I’ve been teaching myself java and re-learning php, so I figured that I might as well throw javascript into the mix before I become proficient at anything and start go get stuck in my ways.

I hope you like javascript

I figured that as I continue to add to the list of sets that I post, you’ll probably want to go back and see the whole list without having to scroll through each wordpress post that I make. So I went ahead and wrote this little javascript front end that implements the PHP back end that I shared in my last post. You can see the finished product here

I know that a lot of this is sloppy with hard links all over the place and a complete disregard for any type of pattern or style, but at this point I’m just hacking things together to get them to work. I have literally ZERO javascript experience prior to writing this so I’m kind of learning as I go. I built all of the javascript bits in this jsfiddle and I wrote all of the php pieces in PHPStorm.

I started by adding some methods to index.php that retrieves JSON arrays of all of my set data, and because I’m a bit more comfortable with PHP, I’m also relying on the server to organize the series data for me as well.

index.php

elseif ($request === "GetSets")
{
	print json_encode($sets->GetSets());
}
elseif ($request === "DisplaySets")
{
	print '
			<link rel="stylesheet" href="//code.jquery.com/ui/1.11.3/themes/smoothness/jquery-ui.css">
			<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
			<script src="http://code.jquery.com/ui/1.11.3/jquery-ui.js"></script>
			<script src="'.$rootPath.'audiojs/audio.min.js"></script>
			<script src="'.$rootPath.'js/setplayer.js"></script>
			<link rel="stylesheet" href="'.$rootPath.'styles/playlist.css">
			<link rel="stylesheet" href="/resources/demos/style.css">
		<div id="wrapper">
		 <h1 id="setHeader">Set Series — Set Name <em>(Release Date)</em></h1>

		<audio preload="auto"></audio>
		<div id="accordion"></div>
	</div>
	<div id="shortcuts">
		<div>
			 <h1>Keyboard shortcuts:</h1>

			<p><em>&rarr;</em> Next track</p>
			<p><em>&larr;</em> Previous track</p>
			<p><em>Space</em> Play/pause</p>
		</div>
	</div>';
	}
elseif ($request === "GetSeriesNames")
{
	print json_encode($sets->GetSeriesNames());
}

Then I built the front end. Basically all I’m doing is using AJAX calls to my php script for set and tracklist information, then displaying it in the proper locations. If you find any bugs please let me know!!

setplayer.js

var seriesData = [];
var setData = [];
var baseURL = "http://imjustinbraun.com/djsets/";
var audio = [];
$.ajax({
    url: "http://imjustinbraun.com/djsets/index.php?Request=GetSeriesNames",
    dataType: 'application/json',
    complete: function (seriesResponse) {
        seriesNamesRetrieved(seriesResponse)
    }
});

function seriesNamesRetrieved(seriesResponse) {
    seriesData = JSON.parse(seriesResponse.responseText);
    $.ajax({
        url: "http://imjustinbraun.com/djsets/index.php?Request=GetSets",
        dataType: 'application/json',
        complete: function (data) {
            initialSetup(data)
        }
    });
}

function initialSetup(data) {
    var selectedSeriesIndex = 0;
    var selectedSetIndex = 0;
    setData = JSON.parse(data.responseText);

    var setCount = setData.length;
    var series = seriesData;
    var seriesCount = series.length;

    if (setCount == 0 || seriesCount == 0) return;

    for (var s = 0; s < seriesCount; s++) {
        var seriesName = series[s];
        var element = document.createElement("h3");
        element.setAttribute("id", "seriesTitle" + s);
        element.appendChild(document.createTextNode(seriesName));
        document.getElementById("accordion").appendChild(element);

        var setElement = document.createElement("div");
        setElement.setAttribute("id", "SetListDiv" + s);
        document.getElementById("seriesTitle" + s).appendChild(setElement);

        var setListElement = document.createElement("ol");
        setListElement.setAttribute("id", "SetList" + s);
        document.getElementById("SetListDiv" + s).appendChild(setListElement);

        for (var i = 0; i < setCount; i++) {
            var setSeries = setData[i].Series;
            if (setSeries == seriesName) {
                var setTitle = setData[i].Name;
                var setDate = setData[i].Date;
                var setFile = setData[i].File;
                var setTracklist = setData[i].Tracklist;

                var setLineItem = document.createElement("li");
                //setLineItem.setAttribute("id", "Set"+i);
                setLineItem.innerHTML = '<a href="#" id="' + i + '" data-src="' + baseURL + setFile + '">' + setTitle + ' - <em>('+ setDate +')</em></a>';
                document.getElementById("SetList" + s).appendChild(setLineItem);

            }
        }
    }
    document.getElementById("setHeader").innerHTML = setData[0].Series + " - " + setData[0].Name + " <em>(" + setData[0].Date + ")</em>";
    var trackListElement = document.createElement("h3");
    trackListElement.setAttribute("id", "tracklistHeader");
    trackListElement.appendChild(document.createTextNode("Tracklist"));
    document.getElementById("accordion").appendChild(trackListElement);
    var trackListDiv = document.createElement("div");
    trackListDiv.setAttribute("id", "tracklistDiv");
    document.getElementById("accordion").appendChild(trackListDiv);
    var trackListList = document.createElement("ol");
    trackListList.setAttribute("id", "tracklist");
    document.getElementById("accordion").appendChild(trackListList);    
    
    setTrackList(0);
    // Setup the player to autoplay the next track
    var a = audiojs.createAll({
        trackEnded: function () {
            var next = $('li.playing').next();
            if (!next.length) next = $('li').first();
            next.addClass('playing').siblings().removeClass('playing');
            audio.load($('a', next).attr('data-src'));
            audio.play();
        }
    });    
    
    // Load in the first track
    audio = a[0];
    first = $('a').attr('data-src');
    $('li').first().addClass('playing');
    audio.load(first);

    // Load in a track on click
    $('li').click(function (e) {        
    e.preventDefault();
    $('li.playing').removeClass('playing');
    $(this).addClass('playing').siblings().removeClass('playing');
    audio.load($('a', this).attr('data-src'));
    var setID = $('a', this).attr('id');
    document.getElementById("setHeader").innerHTML = setData[setID].Series + " - " + setData[setID].Name + " <em>(" + setData[setID].Date + ")</em>";
        setTrackList(setID);
    audio.play();
    });
    // Keyboard shortcuts
    $(document).keydown(function (e) {
        var unicode = e.charCode ? e.charCode : e.keyCode;
        // right arrow
        if (unicode == 39) {
            var next = $('li.playing').next();
            if (!next.length) next = $('ol li').first();
            next.click();
            // back arrow
        } else if (unicode == 37) {
            var prev = $('li.playing').prev();
            if (!prev.length) prev = $('ol li').last();
            prev.click();
            // spacebar
        } else if (unicode == 32) {
            audio.playPause();
        }
    })
}

function setTrackList(setID)
{
    document.getElementById("tracklist").innerHTML = "";
    var tracklist = setData[setID].Tracklist;
    for (property in tracklist) { 
        var trackLineItem = document.createElement("li");
        trackLineItem.innerHTML = '<a href="#">' + tracklist[property] + '</a>';
        document.getElementById("tracklist").appendChild(trackLineItem);
    }
}


$(function () {
    $("#accordion").accordion({
        collapsible: true
    });
});

So from here I think I’m going to clean up the code itself. I started thinking that if I make the back end RESTful in nature, build a few simple javascript/html5 players, and create an uploading service, I’ll have a pretty convenient little way to upload my sets and I’ll have the future flexibility to go and create clients beyond simple web interfaces. Who knows, maybe I’ll make an imjustinbraun app someday!

Trade Smarter, Not Faster

The Race To Zero

High-frequency-trading1Since the financial crisis of 2008, the media has been in a state of constant awe of high frequency traders. High frequency traders profit by taking advantage of tiny and fleeting discrepancies in the price of exchange-tradable financial instruments. It’s an expensive game of reducing tick-to-trade latency called the race to zero.

Some, like the folks at Zero Hedge and Nanex felt it was their mission to end high frequency trading, seeing it as a parasite preying off of the honest hard work of main street investors and commercial hedgers. High frequency firms argued that they were providing the service of liquidity to the market and were rightfully deserving of their profits. Moral high ground for either side notwithstanding; no one could argue that high frequency firms were printing money fast enough to make even Ben Bernake blush.

Where Does it End?

It may be big business, but like the floor and point-and-click trader before him, the algo trader may soon be eating humble pie. In May of 2013, the Eurex exchange, under the pressure of European regulatory bodies, made changes to its matching engine that add around 100 microseconds of induced latency on GTC orders. Thus wreaking havoc on a book stacking, a favorite HFT algo. In the US, predatory practices such as dark pool pinging, stop-hunting, and even more benign practices such as stack widening are becoming increasingly illegal.

Some high-speed firms have already thrown in the towel. Getco, for example, merged with Knight to form KCG, a financial services company. It now leverages its enormous technological infrastructure for the purpose of servicing its customers. Though some internal prop trading does still exist, its a shadow of its former self. The race to zero may be coming to an end, but the technological arms race has only just begun.

Trade Smarter, Not Faster

One area of particular interest is the use of Artificial Neural Networks, or “neural nets.” Neural nets mimic the central nervous system of animals and are particularly useful at solving non-linear problem sets where there is not necessarily one right answer or one method of solving a complicated problem. A neural net can approximate an answer rather than simply throwing exceptions or saying “I don’t know.”

For this reason, neural nets are popular in areas such as facial and handwriting recognition. Google uses them to recognize street signs in their self-driving cars and Netflix uses them to guess which movies you’ll like based on what you’ve watched. They could be used to produce accurate polygraphs, predict what route would be the most efficient way to get to work, guess what freight rates might be, or as we care about in financial technology, predicting the price of a tradable instrument. Just as high speed trading algos threatened to put human trade executors out of a job, a neural net could put quants out of a job.

As a trader, what can I do to prevent being left behind?

Unskilled labor has always competed with machines for work, and technology has has always raised the bar of what constitutes “unskilled labor.” Assembly lines have made the blacksmith obsolete, robots have made assembly line workers obsolete, matching engines have made floor traders obsolete, and neural nets just may make the algo traders themselves obsolete. One thing is certain, the only playing field leveler in this rapidly changing world is education and constant reinvention. Having help and building the right tools certainly doesn’t hurt either, in which case I’d recommend calling your friendly representative at Scaled Dynamics.

Update 9/30/2013: Due to the popularity and response to this article, I will be giving away one day of my time in the form of 8 one hour consultations to discuss the evolving needs of the algo trader. Because I’m only going to set aside one day of my time for these, spots are limited. Please submit an application to news@scaleddynamics.com explaining a bit about your trading style and how you’d like to evolve as a trader.