HNHacker News
TopNewBestAskShowJobs

slashdotdash

913 karma · joined April 18, 2012

submissionscomments
slashdotdash··on Apple's 80% charging limit for iPhone: How much did it help after a year?
I enabled the 80% charge limit from day one (September 2023) and after 159 cycles it is still at 100% maximum capacity.

I think it is also crucial to not allow deep discharge of the battery too frequently. Ideally keep the battery charge in the range of 40-80%. My usage is relatively low so I am mostly within that range.

Infrequently I have charged to 100% for longer days away from home. Enabling low power mode helps to prolong battery life on these occasions too.

slashdotdash··on UK Covid-19 data underreported due to file size limit exceeded
“The issue occurred because some files containing positive test results exceeded the maximum file size that takes these data files and loads then into central systems, officials said.”
slashdotdash··on City of London: Tax haven in the heart of Britain (2011)
The Spider’s Web is a documentary film which covers this subject in detail. Well worth watching if you have an interest in finding out more.

“An investigation into the world of Britain’s secrecy jurisdictions and the City of London. Today, up to half of global offshore wealth may be hidden in British offshore jurisdictions and Britain and its offshore jurisdictions are the largest global players in the world of international finance.”

http://spiderswebfilm.com/

slashdotdash··on Regexes vs. Combinatorial Parsing (2019)
Elixir has the NimbleParsec library which generates parsing code that takes advantage of pattern matching for high performance and low memory usage due to the BEAM virtual machine optimisations.

https://github.com/dashbitco/nimble_parsec

slashdotdash··on Tesla adds bidirectional charging capability
Vehicle to grid may actually improve battery health and keep them healthier for longer.

> “This new research into the potentials of V2G shows that it could actually improve vehicle battery life by around ten percent over a year.”

This requires intelligent usage where the battery state of charge is kept within a limited window, not fully charged or drained.

[1] https://warwick.ac.uk/newsandevents/pressreleases/clean_ener...

[2] https://www.sciencedirect.com/science/article/pii/S036054421...

slashdotdash··on Combining event sourcing and stateful systems
For anyone interested in event sourcing with the actor model I've built an open source Elixir library called Commanded (https://github.com/commanded/commanded) which takes advantage of Erlang's BEAM VM to host aggregate processes. There's also an event store implemented in Elixir which uses Postgres for storage (https://github.com/commanded/eventstore).

The actor model provides the guarantee that requests to a single instance are processed serially, while requests to different instances can be processed concurrently. Distributed Erlang allows these instances to be scaled out amongst a cluster of nodes with transparent routing of commands to the instance, regardless of which connected node it is running on.

In Elixir and Erlang, the OTP platform provides the building blocks to host an aggregate instance as a process (as a `GenServer`). Following the "functional core, imperative shell" style I model the domain code as pure functions with the host process taking care of any IO, such as reading and appending the aggregate's events.

slashdotdash··on Why Germans won’t heat their homes even with free electricity?
> In reality, it's impossible for a households to get a contract that follows market rate, you always pay the same per kWh no matter if it's Sunday or Monday, windy or calm.

In the UK you can use the Agile tariff from Octopus Energy (https://octopus.energy/agile/) which has half hourly dynamic pricing per electricity kWh. The next 24hrs worth of prices are released each day around 4pm and follow market cost. There’s a 12p/kWh surcharge between 4pm and 7pm during peak demand. Used in conjunction with a smart meter it bills per half hour usage and can go negative.

Twice in the last two week’s it has gone below zero due to recent storms. It’s a great tariff if you have an electric car to charge in the early hours when prices are cheapest and can reduce usage during the peak three hours. A home battery would also help out as it could be charged during cheap periods and discharged when prices are too high.

slashdotdash··on Autonomous vehicles and Transport as a Service (TaaS) will end car ownership
Tony Seba predicts the end of personal car ownership due to the disruption of transportation by new technology (batteries, electric vehicles, autonomous vehicles) and new business models, such as ride hailing and Transport-as-a-Service (TaaS).
slashdotdash··on Detailed Agenda for a DDD Design-Level Event Storming
Alberto Brandolini’s “Introducing EventStorming” [1] book is worth reading, even in its incomplete state, to understand the approach from its author.

There aren’t too many concepts to understand, it almost feels too simple to be of any value. But in all of the sessions I’ve been involved with participants have come away with a better understanding of the domain and often a useful model to begin working from.

[1] https://leanpub.com/introducing_eventstorming

slashdotdash··on Strava cuts off Relive
Specialized ANGi is a Bluetooth hardware dongle that attaches to your helmet and will allow a contact to live track your ride (using Specialized’s app on your smartphone) and can also detect crashes and automatically send a text message to a contact. It’s available to purchase on its own or included with many Specialized helmets. I have one on a new MTB helmet after a recent crash on a trail.

https://www.specialized.com/us/en/angi

slashdotdash··on Strava cuts off Relive
I’ve personally suffered the same fate as Relive with Strava cutting off access to their API for a side project of mine [1]. They gave me twenty minutes notice via email before disabling access and effectively killing my app.

Ostensibly the reason was due to competing with a feature that Strava intend to build themselves (“thanks for proving the demand”). This was back in March, I’ve since been informed that access won’t ever be reinstated so have open sourced the code [2].

Lesson learnt, don’t depend entirely on third party APIs.

[1] https://segmentchallenge.com/

[2] https://github.com/slashdotdash/segment-challenge

slashdotdash··on Elixir, Phoenix, Absinthe, GraphQL, React, and Apollo
Phoenix Live View[1] fits the gap between server rendered HTML pages and JavaScript rendered front-ends. If you’re after a responsive web UI without needing to learn so many disparate frameworks and technologies it could be a good fit.

[1] https://github.com/phoenixframework/phoenix_live_view

slashdotdash··on What Winning $250k at Poker Taught Me About Money
"Thinking in Bets: Making Smarter Decisions When You Don't Have All the Facts" by Annie Duke [1] is just that book. It emphasises that a bad result does not have to be the result of a bad decision.

[1] https://www.goodreads.com/book/show/35957157-thinking-in-bet...

slashdotdash··on Piano Tuning
Anyone who enjoyed this article might also like “Music for Geeks and Nerds”[1]. It’s a free eBook describing musical structure using Python code.

[1] https://pedrokroger.net/mfgan/

slashdotdash··on Microsoft Visual Studio Team Services (VSTS) failure postmortem
TL;DR summary:

“... the system was running too close to the point of exhaustion due to the intermittent crashes, and an event that should not have been a problem [high number of client reconnections] caused a high-severity incident.”

slashdotdash··on Give away your code, but never your time
Sidekiq by Mike Perham is following the open core, paid subscription for a "pro" version containing extensions. His single founder company has a monthly recurring revenue in excess of $80k, as featured on Indie Hackers[1].

[1] https://www.indiehackers.com/businesses/sidekiq

slashdotdash··on Show HN: Learn what DDD, CQRS, and event-sourcing are all about
Greg Young's Event Store[1].

[1] https://geteventstore.com

slashdotdash··on It’s not that London is too big, but that other large UK cities are too small
The remainder of the U.K., outside of London, has a larger dependency on the EU. These regions will suffer disproportionately more than London.

"In particular, Northern Ireland (the UK’s poorest region), the North East (England’s poorest region) and the South West (Southern England’s poorest region) appear to be the most dependent on the ability of the UK to trade in goods with relatively few restrictions with other EU countries." [1]

[1] "UK regions, the European Union and manufacturing exports" http://speri.dept.shef.ac.uk/wp-content/uploads/2016/05/Brie...

slashdotdash··on New and improved bike routing, with low stress options
Strava[1] provides a cycle route builder that uses the popularity of routes based on their dataset of uploaded rides. As it's using recorded rides, typically by local riders, I've found it produces good routing; quiet roads similar to those you'd choose if you knew the area well.

[1] https://www.strava.com

slashdotdash··on Phoenix 1.3.0 Released
For anyone curious about Phoenix and Elixir, I can sincerely recommend the following resources to get you started:

- Programming Phoenix by Chris McCord, Bruce Tate, and José Valim [1]

- The Little Elixir & OTP Guidebook by Benjamin Tan Wei Hao [2]

- Elixir in Action by Saša Jurić [3]

Phoenix initially attracted me to Elixir, I've stuck around for that and the OTP platform: pattern matching, process based concurrency (actor model), supervision, immutability, macros, and more.

"Elixir took the Erlang virtual machine, BEAM, and put a sensible face on it. It gives you all the power of Erlang plus a powerful macro system." – Dave Thomas

[1] https://startlearningelixir.com/r/programming-phoenix

[2] https://startlearningelixir.com/r/the-little-elixir-and-otp-...

[3] https://startlearningelixir.com/r/elixir-in-action

slashdotdash··on Ask HN: What to build using a bank account API?
@slashdotdash on Twitter.
slashdotdash··on Exemplary fullstack Medium.com clone powered by React, Angular, Node, and more
It's taking the concept of TodoMVC, and extending it further.

> See how the exact same Medium.com clone (called Conduit) is built using any of our supported frontends and backends. Yes, you can mix and match them, because they all adhere to the same API spec.

> Choose any frontend (React, Angular 2, & more) and any backend (Node, Django, & more) and see how they power a real world, beautifully designed fullstack app called "Conduit".

slashdotdash··on The great British Brexit robbery
> Economists have been saying for years that the UK economy is too heavily weighted towards finance. We now have an opportunity to resolve that.

But the cause of this issue is not due to being a member of the EU; other member states have more balanced economies. Can you explain what has prevented successive UK governments from addressing this imbalance, yet will now be resolved by Brexit?

slashdotdash··on What's all this fuss about Erlang? (2007)
Dave Thomas has described Elixir as follows: "Elixir took the Erlang virtual machine, BEAM, and put a sensible face on it. It gives you all the power of Erlang plus a powerful macro system."[1]

[1] https://startlearningelixir.com/elixir-for-rubyists

slashdotdash··on Building a CQRS/ES web application in Elixir using Phoenix
To address the concern with changing "immutable" events. I've just built a migrator [1] tool for my PostgreSQL-based event store. It implements the copy & transform migration strategy. The source event store database is untouched. Transformed events are written out to a separate database.

It uses Elixir streams to provide composable transforms to rewrite, aggregate, remove, and alter serialization format of events.

[1] https://github.com/slashdotdash/eventstore-migrator

slashdotdash··on Building a CQRS/ES web application in Elixir using Phoenix
> If CQRS/ES wants to make it into mainstream it needs to think about tooling.

I agree with this entirely. CQRS/ES applications really help from tailored tooling. Tracking chains of events using correlation and causation identifiers. Auditing commands. Projecting events out to datastores like Elasticsearch. Then using Kibana[1] to create dashboards to drill down into the data. I'd like to go into this in more detail in the future. Revisit this case study after 6-12 months and describe the pitfalls, and countermeasures. Identify tools that allow you to monitor the system proactively.

[1] https://www.elastic.co/products/kibana

slashdotdash··on Building a CQRS/ES web application in Elixir using Phoenix
Pushing read model updates back to the client using a two way communication channel is one technical solution. I want to experiment with using Phoenix channels[1] to solve this. I think that has potential for easing the UI/UX concerns. You post a command from the web front-end and subscribe to receive updates for the read model you're looking at. Domain events can drive the client notification.

[1] http://www.phoenixframework.org/docs/channels

slashdotdash··on Building a CQRS/ES web application in Elixir using Phoenix
Please do feedback your ideas to improve these open-source projects. I'd be interested to find out how you're using CQRS/ES in Elixir.
slashdotdash··on Building a CQRS/ES web application in Elixir using Phoenix
I'm the original author. Any application built following the CQRS/ES pattern requires development of the same building blocks: command registration and dispatch; hosting and delegation to aggregate roots; event handling; long running process managers.

I built Commanded as a self-contained, reusable, open-source library. With the goal of demonstrating one approach to implementing the pattern using Elixir. I hope it provides some use. That's why I've written up the case study. Anyone can take the code as is, to bootstrap their own application. Use it as a learning tool, take away the good ideas. Rebuild and improve upon the bad.

I received a pull request only today adding support for Greg Young's event store. That's going to broaden the appeal.

slashdotdash··on Building a CQRS/ES web application in Elixir using Phoenix
For migration of immutable events, there's a good research paper[1] that outlines five strategies available: multiple versions; upcasting; lazy transformation; in-place transformation; copy and transformation. The last approach even allows you to rewrite events into an entirely new store.

[1] The Dark Side of Event Sourcing: Managing Data Conversion http://files.movereem.nl/2017saner-eventsourcing.pdf

Page 1 of 3Next →