A Simple Solution to the Daraprim Problem

Wed, Sep 23 2015

Recently, the drug Daraprim, a generic drug (which means there no longer exists a patent on it), had its price raised from $13.50 per pill to $750 per pill. What gave the story legs though, was the ridiculous attempt of the company's CEO, Martin Shkreli, to defend this in spite of broad public condemnation.

What brought about this situation? It appears that when a drug becomes a generic drug, the original pharmaceutical company that develops it likely continues to sell it. Others join the fray, hoping to undercut the original maker with the same drug, but at a lower cost. Eventually the price reaches some level where the pharmaceutical companies feel that going lower wouldn't benefit them. The demand side is not quite like a normal product, since demand for pharmaceuticals is largely price insensitive, especially for life saving drugs like Daraprim (which can protect AIDS sufferers from death via Toxoplasmosis, and prevent birth defects in pregnant women).

At this point, the companies still manufacturing the drug need to decide "is this worth it?" Depending on the overall demand, it may not be for many of the companies, and they will drop out. What happened with Daraprim, is because the demand was low enough, all companies dropped out but one. Since it is generic, any other company could develop it, but to do so would require a fairly long lead time of research and testing, and an FDA approval process. No company will take on that investment with the price being low.

So, enter Martin Shkreli and Turing Pharmaceuticals. Seeing this situation, what is the rational behavior of Turing? Of course, raise the price to an exorbitant level, wait until competitors enter the market, then lower it back down to the level that no longer sustains competition (the original price). What does Turing lose from this maneuver? Nothing, or at least they would not have, if the public had not decided to seize on the story and create a huge backlash.

In the meantime, AIDS sufferers die, and children are born with crippling birth defects. Whoops, I guess the invisible hand of the market can sometimes reach out and slap people, to death.

What's the solution? Hillary Clinton has proposed a number of things including out of pocket limits on prescription drugs, asking the FDA to clear the backlog for approving generic drug makers, and handing out some requirements to pharmaceutical companies to do more research and justify price increases. I think there's a somewhat simpler solution.

I propose a new department of Health and Human Services called the Generic Drugs Department. The task of this department is to maintain production of all generic drugs that are essential (the definition of this is arguable), and to sell them at a fixed multiple of their amortized cost of production. So, if this hypothetical GDD existed, and the fixed multiple was 10x, they would probably sell Daraprim at something like $15 per pill, assuming it costs about $1.50 to create each pill (all costs included). Turing Pharmaceuticals, who were selling the pill at $13.50 per pill, would still be in business, and probably doing brisk business, since they've undercut the government by $1.50 per pill. They could even raise the price if they wanted up to that $15 level, and the only risk they'd be running would be inviting new competition into the market.

Other benefits of the GDD would be the gainful employment of scientists, doctors, technicians, and manufacturing employees, a profit center for the government, and a steady supply of critical drugs at predictable prices, for programs like Medicaid and Veteran's Affairs. The private sector could easily slip in under that 10x multiple to compete and provide a better service, but the government would always maintain their ability to produce at that price.

It seems like the simplest solution to a market problem - introduce a new market participant.

Comments, etc.

Toward Health

Mon, Apr 29 2013

Lately I've been having the uncomfortable feeling that the warranty is finally expiring on my body. I mean that in the sense that the period in which we typically, as humans, experience very little in the way of health defects, is coming to a close for me. I'm 28, and maybe that's early. But then again, some people don't make it this long.

A series of unfortunate medical issues have arisen for me in the past year, and don't worry, I won't go into the gory details. It will suffice to just say that they are all things that directly stem from lifestyle choices and habits that I have made over the years. In broad strokes, back pain has finally found me, and gastrointestinal issues (which I actually have experienced to a lesser degree for much longer) have flared up.

Through the years I have tinkered with different diets and exercise regimes, but it has been years since I took a comprehensive look at the way that I live. I suppose that it is the province of the "naturally healthy" to ignore such things - until it is too late. But while it may be too late to prevent anything from happening, it's certainly not too late yet to turn it around.

With that in mind, I hit the library today, and picked up several books that have been on my mind. The first is The Primal Blueprint by Mark Sisson. I've been an on-again off-again reader of Mark's blog, Mark's Daily Apple, but I often found myself not completely understanding his philosophy of diet and exercise. In fact, I have been on the opposite side of several theories he posits, but not out of studied knowledge, rather out of presupposed fact and habitual practice. A case in point is Mark's criticisms of endurance training.

Having been a collegiate cross country runner myself, I know something about the joy of running. However, back when I was practicing running, I wasn't doing it for my health. I was doing it for some mixture of glory, fleeting happiness, and a sense of dedication. I read many things about training philosophies, nutrition for athletes, etc., but I never evaluated whether or not running was conducive to long term good health in a general sense. Mark, as a former endurance athlete himself, and a much more accomplished one himself, has come to that view. I'd like to know more about why.

I don't want my reading of The Primal Blueprint to be superficial, so I picked up some of the source material for Mark's ideas. The first book is Genome: The Autobiography of a Species in 23 Chapters. Mark talks a lot about epigenetics, which is the study of how the expression of our genetics (nature) can be redirected by environmental and lifestyle factors (nurture). This supposition rests at the basis of Mark's case, and Ridley's work often forms the basis of his justifications.

The last work I picked up on the subject is a section of the book Human Evolutionary Biology called Complex Chronic Diseases in Evolutionary Perspective, which bears particular relevance to me since the ailments I have recently been battling are indeed chronic. The section is written by S. Boyd Eaton, who also shows up frequently as a reference for Mr. Sisson, so it is important to assess the credibility of Eaton's work as well.

In parallel with all this, I do plan to test out the primal eating philosophy, and aspects of the rest of the "Blueprint" as well. In general, the parts that I find the most important of the blueprint are: eat animals and plants, avoid grains and sugars, do lots of low intensity activity, and play. There are other prescriptions, but I find these to be the most important. They are in line with what I have found over the past few years whenever I browsed the latest medical and nutritional research.

That being said, the jury is still out for me on the primal lifestyle as a whole. I plan to give it a thorough study, both through theory and practice. I'm not looking to convince anyone else, I'm simply investigating. I'll be writing up more detailed book reviews of the things I come across in this journey, so stay tuned if you are interested.

Comments, etc.

In Confluence You Can't Search for Underscores

Tue, Nov 27 2012

Anyone who uses Confluence, please go and comment and vote on this bug: 419520. If you program much, you know that underscores are often used in variable names, program names, database fields, and any number of other places. If you have a wiki that has a lot of documents in it (our company has thousands), not being able to search for something with an underscore, i.e. user_login, is crippling. You simply can't find large pieces of your knowledge base.

I really hope that someone prioritizes this in the near future at Atlassian. Based on the fact that this has been an issue for 6 years, I'd have to say that at this point I'm going to be advocating for migrating to a different wiki system. Any recommendations for a system in use by over 2000 users and holding over 100,000 documents?

Comments, etc.

No Magic

Thu, Jun 14 2012

I recently switched teams at my job, away from the Data team at and into eBay, for a special project (I can't say what it is yet, but it's going to be really cool when it comes out). The move had me first programming in Python, iterating rapidly on a new product. Now that we proved out the product, we are porting it to Java, to use the current eBay stack as it exists.

I want to talk about my experience writing Python for Milo and also for our new project recently. In Python, it is often tempting to use advanced features and aspects of functional programming to solve a solution "cleverly." My argument is that any clever solution which makes your code very difficult to understand without prior knowledge of the clever trick, is a net negative for your project and your team. Why is that?

Any time you write code that requires more than 50% of your coworkers to have to consult reference documentation or Stack Overflow questions to understand, you are slowing down the pace of development inside your organization. Of course there are exceptions, but please bear with me before you "well actually" me in the comments. In 90% of situations, it is not necessary.

In programming circles, it's often the case that people are trying to prove they are smart, more than they are trying to get work done. For weekend projects and one-offs that you are going to post to Hacker News, that is fine. However, if you are writing code that will need to be understood, changed, and maintained by other people on your team, and in the future, people you won't even know, you need to tone it down.

A great example of this from a past project was the use of SQLAlchemy coupled with some very complex wrapper code. The wrapper was used alongside vanilla SQLAlchemy code, but actually represented several function calls before it actually got to SQLAlchemy Expression Language. Once there, it injected some special code deep into the internals of the EL, before finally calling the appropriate function.

The question is, as a new developer to a codebase, who doesn't understand what's going on, how long will it take you to figure it out? Modifying the internals of an already difficult to understand library (SQLAlchemy Expression Language attempts to make SQL a series of chained function calls) may be a very clever thing to do, but it might all be for naught when there is a bug that the next person can't find, and he just rewrites your solution in plain SQL. Not only will your clever solution be thrown out, but you've just wasted the next person a lot of time in rewriting it (or, if they were more patient, peeling the onion that is your code).

For me, any time I write some code that makes me say "wow, that's cool!", I immediately step back and make sure I'm not creating something that, to a sufficiently inexperienced person, is equivalent to magic. If I have done something like that, I rewrite it so it's clearly readable. Worst case, I document it to death.

The bottom line for my "no magic" rule is that programming is a team sport, no matter how tempting it is to act like it's a series of individual achievements. The best programmer is the one whose code works, and is understood by newbies.

Comments, etc.

irssi and GNU Screen

Fri, Apr 13 2012

I use irssi for IRC, inside a GNU screen session. I wanted to be able to work in other screen windows and be notified when things happen in the channel in irssi. Unfortunately, setting an activity monitor via CTRL-a-M had the bad side effect of triggering every time the clock in the irssi status line changed (once a minute).

Just for others so that they don't have to spend as much time googling as I did, the command you need in irssi to turn off the clock is:

/statusbar window remove time

That will allow you to monitor activity in the GNU Screen window where irssi lives, so that you'll get notifications when things happen in the channel. Making that work for only when your name is mentioned is an exercise left to the reader.

Comments, etc.

Facebook's Instagram Acquisition Was a Wealth Transfer

Mon, Apr 09 2012

Facebook acquired Instagram today for a cool one billion dollars.

Who won? Instagram's founders, Instagram's investors, and of course the investors who pitched into the Series B funding round of Instagram, who literally made a 100% profit, overnight. If this were a public company, we would call it insider trading, but since this is private, we just call it "business as usual."

Who lost? Facebook investors, and most important in my opinion, the people who actually built Facebook, its employees. Because you know where a large amount of that $1bn is coming from? Facebook shares, which dilutes the equity of every employee and investor of Facebook (but moreso employees due to the fact that investors typically have liquidation preferences and stack the deck in their own favor). So guess what Facebook employees, that payday you had been hoping for on IPO? It just got knocked down by X%, and I hope for your sake that X is a small number.

This just goes to show that in Silicon Valley, just like Wall Street, it's not what you know, or how hard you work, it's who you know, and how well you are connected. Once you're one of those charmed ones who sits on boards and gets calls telling you to invest in a particular startup because they are about to be acquired at double the valuation you will get, you can write your own ticket. But if you're on the ground, building the technology, you have to assume that all those people will trample over you in their race to get their next hundred million.

Comments, etc.

Overcoming Gravity

Wed, Mar 21 2012

This post is inspired by the Super Saiyan (youtube), who posted on reddit today about his progress on doing insane feats of acrobatics after four years so far of training. Check out the video to be impressed.

The post on reddit brought me to a number of cool links. There is the author of Overcoming Gravity, a book giving a systematic approach to making yourself into someone like the Super Saiyan whose video I linked above. The author did an AMA (Ask Me Anything) on reddit recently where he answers all kinds of questions about the book and bodyweight training in general. Then there is a website where the author posts articles, Eat. Move. Improve which seems like another great source, and is definitely going into my Google Reader account. A comprehensive guide to building your own workout routines is located here.

If you're planning on getting into it, you might need some paralletes, which are the things that Super Saiyan has his hands on during his crazy maneuvers. You can either buy them (and a review), or make them (pdf), depending on your budget and proclivities.

As usual, I'm in information overload mode here, and since I've been sick for the last few days, I can't even go bust out a workout like I normally would with information like this. Anyone care to join in an online training group to get started with this?

Comments, etc.

Sleep: More is Not Always Better

Thu, Mar 15 2012

In the early hours of the morning, when your mind is foggy and your body is stiff, it's really tempting to think: "If I just get an extra half hour, I'll feel better." But the reality is almost always that I wake up feeling worse after that half hour, hour, or even sometimes more. Most of the time, I am much better off if I just get out of bed in the morning whenever my body wakes me up naturally.

That's easier said than done, and many mornings it just seems impossible. This morning I had the luxury of accidentally knocking over a glass of water at 7AM, so I was forced to get up and clean it up. In the process, my mind unfogged, my self-discipline turned on, and for the first time this week I was able to get out of bed and go for a run before work.

I feel really great now, and I know I can be productive and get a lot of things done before lunch. On the days that I sleep until 9, 9:30, or even 10, I have a hard time accomplishing anything before lunch, which makes me feel guilty and stay late in the evening, which gives me no time to exercise. A vicious cycle indeed.

Comments, etc.

Lost Data

Tue, Jan 31 2012

It has been a long time, but the site is finally back up. A few months ago, I was the sole actor in a comedy of errors which resulted in the contents of my site being deleted, all the way back to July of last year. Whoops. I learned a lot about why backing things up is so important.

Tonight I finally mustered up the motivation to get it back up and running. I fixed search, including adding a post-save hook to the Post model to update the ts_vector in Postgres, so that it doesn't have to be triggered by a command or a CRON job. I took out tagging, because it seems like the django-tagging library is a wasteland. I'll probably go ahead and reimplement that myself, as it is pretty straightforward.

A lot has happened in my life since the last recorded post here, so I'll just go ahead and put it into a list:

  • In September, I moved back to the US from the Philippines, to the San Francisco Bay Area.
  • After a short search, including interviews at a few great companies, I accepted a job at, an eBay company. Milo is a local shopping search engine that allows you to find prices and availabilities for products near you. I work on the data team, developing feed ingestion code in Python, among various and sundry other duties.
  • On January 13, 2012, I was married to Frances Kristin Jamille Pansacola Regis, who shall now be known as Frances Kristin Jamille Regis Kotenko. It was the most natural decision, and I am grateful every day for having found such a perfect companion in life.

So that's the gist of it. About this site, I'm going to focus down the topics to purely programming and related subjects. I have written about things as diverse as politics, running, etc., in the past, but I feel the need to build up a body of work that represents me professionally from here on out. In that vein, I'll start highlighting some of the work that I'm doing both at Milo and on the side.

Comments, etc.

Gosu - Java, Minus the Cruft

Thu, Jul 21 2011

I was a Java teacher for two years, developing Java courseware, supporting Java courses being taught by other teachers, and teaching many classes myself, online or in person. I have the Sun Certified Java Programmer 6 certification, which means that at one point, I was able to answer incredibly arcane questions about Java's sometimes tortured syntax and semantics. That wasn't easy, and how I prepared for it is the topic for another post.

There are some auxiliary languages that run on the JVM, like Clojure, Scala, and I'm sure a whole raft of other ones. But I've yet to see one that simply removes the pain from Java, without changing the character of Java, until today. The Gosu language is 100% compatible with Java, compiled, imperative, and statically typed, and I'll just say, it's much nicer to use.

What are some of the features? First of all, you remember getters and setters right? Something like this:

public String getName() { return name; }
public void setName(String name) { = name; }

Yep, all Java developers have written thousands of those things, and in fact they are so onerous that Eclipse will even just generate them for you. But haven't you often wondered, why don't we just do away with them unless we need them? That's where Gosu's property shines. A Gosu property is accessed the same way you would access a public variable in Java, but it will use any getters and setters you define, and generate them if you don't. So if your variable doesn't need any fancy handling, you just define it like this:

var _name : String as Name

There are a few things going on in the syntax here, you'll notice the var keyword, that signifies a variable. The : String gives the variable a type, and the as Name tells the compiler to go ahead and turn this into a property, with generic compiler generated getters and setters. So a class user can then call:

myClassInstance.Name = "Joe"

By the way, have you noticed that there are no semicolon line terminators?

Now, if need some access handling, all you do is define your getters and setters like so:

property get Name() : String{
    return _name + " copyright Jason Kotenko 2011"

And your user can go ahead and access the variable as a property as usual.

This is just one feature of many that makes your life easier as a Gosu programmer. Just to cover what was shown in the Intro to Gosu, I'll give you a list. But definitely check out that intro, it's very well organized.

  • Local variables don't require type definitions, i.e. var jason = new Person() is valid, no more repeating the type twice unless it's necessary, i.e. var jason : Person = new Student()
  • An override keyword ensures that classes up the hierarchy don't break your code without you knowing.
  • Single line delegation - no need to instantiate a class and call it from within a the overridden methods.
  • Drumroll please... a print() function, no need for System.out.println() anymore!
  • A null tolerant accessor syntax, i.e. var couldBeNull = object.?propertyName will not throw an NPE.
  • Sane comparison operators: and, or, not work alongside the old C style operators.
  • Enhancements: This one deserves its own post, but in short, you can add arbitrary functionality to pre-existing classes (including the standard libraries), relieving the need to keep piles of child classes around for one-off needs.
  • Closures (called blocks in Gosu).
  • Templates - A JSP like functionality for generating markup programmatically.
  • The using keyword cleans up resource variables for you.

That's just the tip of the iceberg, but I think you can see that this language takes a lot of the pain away from writing Java, things that we've gotten used to because Eclipse generates a lot of it for us. But with improvements in readability, could Gosu improve your team's productivity? There's a very good chance, in my estimation.

Comments, etc.

Copyright 2011 Jason Kotenko. All Rights Reserved. Contact me