Brad Lucas

Programming, Clojure and other interests

Clojure And STDERR

September 29, 2017

How to print to STDERR in Clojure came up the other day.

It turns out there are two vars *out* and *err* that are bound to STDOUT and STDERR. There vars are instances of `java.io.PrintWriter' and you can simply write to them.

For example, here is a string being printed to STDOUT.

user> (.println *out* "hello")
hello
nil
Continue reading →

New Mac Python

September 28, 2017

Some new Mac notes concerning Python. Out of the box the Mac has Python and when I ran pip list I saw a bunch of stuff that I didn't recognize. When I tried to remove things they looked baked in because they were installed as root.

Turns out you can ignore all that. Just install a new Python using brew.

$ brew install python

This gives you a new Python called Python2. That's not that helpful because who wants to remember to always use Python2?

Continue reading →

Ads Txt Files

September 27, 2017

Recently, my major focus has been AdTech. With this I came across the Ads.txt project. This project is a simple initiative proposed as a way to help publishers ensure inventory is sold only through authorized dealers and partners.

Publishers

Publishers create and add a file called ads.txt at the root of their sites. This text file contains a list of names and information about authorized ad networks, SSPs and exchanges that have permission to sell the publisher's inventory.

Buyers

Continue reading →

Fixing Your Master Branch

September 26, 2017

You commited a change to master to it is now ahead of orign/master by 1 commit. You realize that you want this commit on a branch so you create a new branch branch.

Now your branch and master are the same but you want master to go back to being in sync with origin/master

$ git checkout -B master origin/master
  • https://superuser.com/questions/273172/how-do-i-reset-master-to-origin-master
Continue reading →

Push Your Feature Branch

September 25, 2017

You've created a feature branch, feature/my-latest-feature. To push it.

$ git push -u origin feature/my-latest-feature
Continue reading →