back

by newusertoday·5y ago·view on hn ↗
I have been doing this in emacs org mode for years i.e. reading from database and plotting the results along with documentation in single org file which is version controlled using git, how is this different? I can also export to html and share with others. something like this

#+begin_src emacs-lisp (require 'ob-sqlite) #+end_src

#+RESULTS: : ob-sqlite

* Headline 1

* Headline 2 #+begin_src sqlite :db users.db :colnames yes select * from users where id > 1 limit 10 #+end_src

#+plot: set:"xlabel 'id'" set:"ylabel 'N'"

2 comments
This looks already way more complicated than "Evidence".

OP wrote that people have been doing similar things for a long time. They are aiming to standardize and polish this approach.

Is that because of unfamiliarity with org syntax or something else? Current org approach of using code and data is already standardized and used in many organizations. So the value add is new approach by restricting it to markdown and only supporting sql and restricted set of components?

1. here is plot equivalent of evidence #+plot: set:"xlabel 'day_of_year '" set:"ylabel 'cum_vol'" <LineChart data={data.daily_volume_yoy} x=day_of_year y=cum_vol series=year units="cumulative calls" xAxisTitle="day of year"/>

2. sql equivatent, note that org mode also supports other languages i.e. python/bash etc. that is the reason you need to specify sqlite here #+begin_src sqlite :db users.db :colnames yes select count() as total_calls, countif(timestamp_diff(current_timestamp(), created_date, day) <7) as calls_in_the_last_7_days, countif(timestamp_diff(current_timestamp(), created_date, day) <365) as calls_in_the_last_365_days, min(created_date) as earliest_call_date, max(created_date) as latest_call_date from `bigquery-public-data.austin_311.311_service_requests` limit 1 #+end_src

```summary select count() as total_calls, countif(timestamp_diff(current_timestamp(), created_date, day) <7) as calls_in_the_last_7_days, countif(timestamp_diff(current_timestamp(), created_date, day) <365) as calls_in_the_last_365_days, min(created_date) as earliest_call_date, max(created_date) as latest_call_date from `bigquery-public-data.austin_311.311_service_requests` limit 1 ```

3. Document * Recent Call Volume Spikes # Recent Call Volume Spikes

Good luck getting non-emacs users to adopt emacs for this purpose. Of course you know that Emacs is the Best there is. It's just that ordinary people seem take so much convincing...

And still, your code has lots of "line noise", so I consider it uglier, but that's a personal preference.

A lot of people have told us that they have done some flavour of this. We think that’s a good thing!