HNHacker News
TopNewBestAskShowJobs

afarquhar

106 karma · joined September 21, 2012

submissionscomments
afarquhar··on Twilio S-1
it says "In thousands, except share, per share and customer data" - so it may be 28 thousand accounts. May have misread this though

https://www.sec.gov/Archives/edgar/data/1447669/000104746916...

afarquhar··on Show HN: Article Bay, for collecting articles and sharing them with your team
Yep that's a fair comment, we built it because we were sharing so much stuff that it became difficult to remember who had sent which link, and what exactly was in the article. Plus we're super-lazy and saving that 5-10 seconds 20 times a week seemed worth it. Ultimately I see the value in this being the summarization of articles - there's too much stuff to read, so anything that helps in that area could be cool. But thanks for the feedback, we may need to improve that message :-)
afarquhar··on Show HN: Free UK company data search
hi yeah that was a real pain for me. There are 2 namespaces in use, http://www.xbrl.org/uk/gaap/core/2009-09-01/ and http://www.xbrl.org/uk/cd/business/2009-09-01, either of which can either be correctly declared in the file, or just used without declaration (I hate xml namespaces!). In the end I used this approach, it's ruby using Nokogiri

  # helper methods

  def content_ar_from(doc, xpath)
    doc.xpath(xpath).map {|d| d.content.strip}
  end

  def first_value_for(doc, xpath)
    content_ar_from(doc, xpath).first
  end


  # download the file to 'path'
  doc = Nokogiri::XML(File.read(path))  

  # try to find the declared namespace
  uk_gaap = doc.namespaces.select {|k, v| v =~ /http:\/\/www.xbrl.org\/uk\/gaap\/core\/2009-09-01/}
  uk_bus = doc.namespaces.select {|k, v| v =~ /http:\/\/www.xbrl.org\/uk\/cd\/business\/2009-09-01/}

  # if it's not there use default
  uk_gaap_ns = uk_gaap.keys.first.gsub(/xmlns:/, "") rescue "uk-gaap"
  uk_bus_ns = uk_bus.keys.first.gsub(/xmlns:/, "") rescue "uk-bus"

  # example of getting the company number
  company_number = first_value_for(doc, "//*[@name='#{uk_bus_ns}:UKCompaniesHouseRegisteredNumber']")

  # example of getting the cash in hand
  cash_bank_in_hand = first_value_for(doc, "//*[@name='#{uk_gaap_ns}:CashBankInHand']")
afarquhar··on Show HN: Free UK company data search
sorry about that - what were you searching for?
afarquhar··on Show HN: Free UK company data search
This is the end result of some nasty XML-munging of the newly-available Companies House data sets (http://www.companieshouse.gov.uk/toolsToHelp/dataProducts.sh...). I know you can get similar stuff from Duedil, but this is free and open, and you can download stuff without paying. Enjoy!
afarquhar··on Show HN: Quantblocks - Backtest your trading strategies
Currently it's daily. One of the possible future extensions is into intra-day but it brings a whole load of extra technical problems. Honestly the problems look really fun, things like keeping the backtest running relatively fast, caching the large amounts of extra data and the added complexity of intra-day strategies. However at the moment we need more data on how people want to use it as that's a pretty big outlay on development time.
afarquhar··on Show HN: Quantblocks - Backtest your trading strategies
we've all been salivating about the potential for an 'Optimise' button. It would be really cool, it has a few wrinkles though, e.g. there might not be a unique maximum solution, so how do you choose the best one? Once there are a few variable involved it may be a job for a genetic algo, but it would have to be in the background. All food for thought ;-)
afarquhar··on Show HN: Quantblocks - Backtest your trading strategies
Our understanding of the Yahoo/google T&Cs was that we couldn't aim to profit from their data (http://finance.yahoo.com/badges/tos). We may be being overcautious but we didn't want to risk getting into trouble ;-)
afarquhar··on Show HN: Quantblocks - Backtest your trading strategies
yep you're totally right, but hopefully it's still useful!
afarquhar··on Show HN: Quantblocks - Backtest your trading strategies
yeah that caught us out - we found that even though the data is freely available from those sources, you're not allowed to include that data in a commercial app :-(