Better HN
topnewbestaskshowjobs
Log inSign up

solraph

371 karma · joined May 5, 2020 (6y ago) · 167 submissions

Submissions

comment 2y ago · link · parent

Without knowing anything about the system at all - does it use the same payment system as the buses?

comment 2y ago · link · parent

Alongside the other reasons mentioned (comfort, right of ways, dedicated corridors), it's blatantly obvious where trams run due to the tracks in the ground.

With a bus, there's always the potential the route has changed, or your specific bus is skipping over your stop for some reason. With a tram, even if you've never been to that city or part of the city before, you know there's going to be a tram along those tracks, and you simply need to walk along the road till you find the stop.

comment 2y ago · link · parent

I've run various meetups in the past, some of which have been successful, some not.

The biggest thing I learned was that you if you start it, you have to drive it. If you take a few months off, don't expect anyone else to pick it up and run with it, even if they offer and you give them the keys to do so.

Nowadays I don't have time for anything too involved. Instead of meetup.com, I "run" a small private group (which is me with a mailing list and a google calendar invite) of remote IT workers in Inner North Melbourne (AU) who catch up for beers once a month (email in my profile for details) It's surprisingly better in some ways. The group is tighter, and there's far less stress.

comment 2y ago · link · parent

> Usually any given country will have one big spot for tech... ...My guess is that Melbourne is not a very good spot.

It's not an unreasonable assumption, but in this case it's incorrect. Sydney has more tech work, but only in proportion to its larger size.

That said, Melbourne tech work is very heavily (but not exclusively) orientated around finance, insurance, real estate and so on which is not everyone's cup of tea.

comment 2y ago · link · parent

They can be a bit of a pain, but if you have a lot of logic tied up in your external dependencies (SQL usually bring main offender here) it's not possible to properly test without using said dependency.

That said, in the current job, we have a dedicated Postgres container that comes up with with a just file command. The setup, test, and teardown of schema all happen within the standard test system of the tested platform (pytest or go test specifically).

comment 2y ago · link · parent

> I've never been a fan of TDD and personally I think tests that really hit your DB, Redis, etc. help a lot more than mocked out unit tests or a billion unit tests and nothing else... ...but I do really write to the DB and other data stores in tests

I've come to the conclusion that the idea that "unit tests" should test functions/objects in isolation with completely mocked dependencies is based more on the slow speed of those dependencies in the past than what actually makes for good tests. Now that we have faster computers and storage devices, and easy/fast store creation, we should move past this.

Obviously, this is very dependant (no pun intended) on the dependency in question, but as a minimum, anything with SQL should have a test that hits a real SQL DB (PG in docker for example) at some point.

comment 2y ago · link · parent

> > Even with good design, w/o tests you will fear change and so the code will rot. With good tests, there’s no fear, so you’ll clean the code

> Has anyone ever actually found this to be true?

Yes, but you have to have the right kind of test coverage, and that's the tricky part.

Yesterday, I refactored a bunch of functions that changed a bunch of unit tests. However, since we also have integration/system tests on that code, I'm confident that I haven't broken the code as a whole. Without those system tests, I would not have confidence that the change would be successful, and probably would not have refactored.

In another codebase that hadn't been touched for a year, as part of a feature change I refactored an SQL statement to what I thought was a more optimal design and immediately broke a bunch of tests. Based on that, I was able to understand the original intent of the SQL, and updated it in line with the feature change. I added test scenarios for the new feature, but left the existing scenarios as is.

Without those tests, would have broken the system in a subtle way.

comment 2y ago · link · parent

For what it's worth, I was gifted one of these. A replacement battery was $45 from Jaycar.

Com port is a standard USB-B port and is compatible with but

https://www.telephonewreckers.com.au/power-shield-safeguard-...

My only complaint is the formfactor is about weird.

comment 2y ago · link · parent

> decided to write Java like it’s Haskell.

I have no love for Haskell or functional programming, but the problem here isn't FP per se, it's that they tried to jam it into Java.

Don't fight the language or framework. If you are using Java, write idiomatic OOP code. If you want to write FP on the JVM, then start writing Clojure or Scala. If the business won't let you write Clojure or Scala, then do it on your own time and/or change jobs.

comment 2y ago · link · parent

> Either I am writing really good code so there are no bugs, or I am really bad a writing unit testing code to find those bugs.

Honestly, having literally had a scenario 20 minutes ago where I wrote a test for what I figured was absolutely trivial code, and having it _fail_ on me and pick up a bug that I hadn't considered (and this is not the first time this has happened) I would strongly suggest it's the latter.

Do your unit tests the output and side effects exactly, or do they just make sure the function returned without error?

Just because function/method/whatever has 100% coverage, doesn't mean you have tested all the potential scenarios.

comment 2y ago · link · parent

> Divorce is an excuse for hedonism. Sometimes? Absolutely.

All the time? No. Depressingly often, it is to escape a person and relationship they desperately need to be free of.

I know and am related to several people who are divorced. It was not hedonism that drove the proceedings, but exasperation and pain.

EDIT after further consideration: And even if it is - so what? What business of that is yours?

comment 2y ago · link · parent

> When you are part of the team, the code belongs to everyone. Everyone should be able to change it if it makes sense and all quality gates are passing.

Yes, but actually no. Context is important here. If that code had been written six months ago or even a couple of weeks ago? Have at it. But, the OP states "My colleague has just checked in the code that they’ve been writing all week." then "It was already late at night (I got carried away)."

If spent all week on something, working out the all the details, checked it in at 5pm, and then came in the next morning to discover that someone stayed up rewriting it rather than waiting till the next morning to talk to me about it first, I'd be absolutely livid.

comment 3y ago · link · parent

Waves from Australia

However, since my array is currently 4.4kw at 3 in the afternoon, a 2.5kw burst isn't a problem.

comment 3y ago · link · parent

Unlikely to happen. I sincerely doubt most headphones would have the memory for that buffer. Sure, it's only a megabyte or two of ram, but your headphones would have to spend valuable battery on keeping that ram active.

From my foray into audio app (quite a while ago, I admit), I imagine application support would be tricky as well.

comment 3y ago · link · parent

Yep. I have very much been bitten by these differences. Particularly for some of the funkier SQL statements where SQLite and PG handle arrays very differently.

In our case, we decided it was a worthy trade off in terms of developer feedback times on our python microservices, because most of the SQL there is INSERT only. In our golang services which do 90% of the interesting SQL, we spin up PG in a docker container.

comment 3y ago · link · parent

Not OP, but I do this with SQLite in memory DB. If each unit only adds the tables the test needs, this is super fast, probably around 2ms per table.

comment 3y ago · link · parent

> I've never had issues with integration tests running with real databases -- they never felt slow or incurred any significant amount of time for me.

I've come around on this. I used to mock the DB, especially when it was being used as a dumb store, and now I just recreate the DB in SQLite, and see the DB as part of the system being tested, rather than something to mock.

However, I think it's important to note that it wasn't until improved SQLite capabilities, SSDs (and sometimes docker if I really need postgres) all came together that this actually practical. Previously using an actual DB would have blown out my test runtimes by a factor of 10x.

> I also don't think unit tests bring as much value as integration tests. In fact, a lot of times unit tests are IMO useless or just make your code harder to change. The more towards testing implementation the worse it gets IMO, unless I really really care that something is done in a very peculiar way, which is not very often.

I see this a slightly different way. My concept of a unit (ignoring the article) has expanded to be what makes sense for a given test. This may be a class or set of classes where there's a well crafted set of inputs and outputs, but where there's a tricky set of inputs and outputs (anything involving date calculation for example) I'll often write a set of tests for just that function. I'd probably call all of these "unit tests" however.

To me, an integration test involves testing that disparate vertical parts of a SUT work together. I haven't seen many of these in the wild.

comment 3y ago · link · parent

I built garage door sensor using a Fibaro Z-Wave Smart Implant and $10 magnetic sensor off ebay. There's enough spare contacts on the implant to also drive the open / close contacts on the garage door if I wanted to.

comment 3y ago · link · parent

> 2. Buy devices for kids that support a parental-lock feature, which when enabled causes the device to always send metadata outwards, such as HTTP headers. These would encode "I'm a minor in Jurisdiction X" or even "I am approximately Y months old in jurisdiction X."

I like the concept, but I can see bad actors abusing the heck out of these headers in so many ways.

comment 3y ago · link · parent

I was under the impression that being able to transfer information by entangled photons means that "instant" (ie; breaking light speed) communication is possible. Given the article doesn't mention this at all, what am I missing?

comment 3y ago · link · parent

I was using the example of income tax as an entirely theoretical example of where types won't save you in response to the GP.

That said, I don't follow what you mean by "to test is business logic, not code logic." To me, that is a distinction without difference.

An income tax calculator in a (sane) tax system is essentially a set of pure of functions or classes. This is a perfect place for a unit test. I might have additional unit tests for sub components of the hairy bits, but it's still unit tests all the way.

comment 3y ago · link · parent

Types are wonderful, and a good type system makes so many errors disappear / impossible, that I'd otherwise have to write tests to cover in a dynamic language.

Types however, are not a substitute for unit tests. No type system is going to tell me if my income tax calculator covers all the edge cases.

comment 3y ago · link · parent

> (Or we could be building one 400 MW solar farm and one 400 MW wind farm every week instead for 30 years. Point is, though, we're far from being able to do that.)

That's actually lower than what the USA is doing right now. "The US solar industry installed 6.1 gigawatts-direct current (GWdc) of capacity in the first quarter of 2023"[0]

That is approx 469 MW of power being installed every week.

[0]https://www.seia.org/us-solar-market-insight (first link I could find)

comment 3y ago · link · parent

Even accepting that definition (I don't 100%, but nevermind), a CEO is still making strategic decisions that need to take into account the variety of people that report to them and how they work.

For example, if a CEO in a large org demanded that engineers are all available via phone for level 1 support calls to cut support costs - that would be stupid, because even two short calls a day is going to have a massive impact on those engineers productivity on building the product(s), followed by any of the half decent engineers leaving for other jobs shortly afterwards.

comment 3y ago · link · parent

> And this wasn't a stupid guy, no matter what it might sound like.

He might not lack intelligence, but a CEO unwilling or unable to understand the other people work in a different way to him /is/ stupid.

CEO is management, and (effective) management means well... managing the various people, resources, and other restrictions to achieve the goals at hand. Being pissy that people and the universe don't work they way they want is immature and/or incompetent.

comment 3y ago · link · parent

Having extensively suffered the NZ tax before moving across the ditch - but still suffering a lesser version of it here - I suspect it's a question of scale for packaging and distribution.

That switch is probably a relatively niche item when compared to some generic TP-Link switch, and AU & NZ are basically the only countries to use the Type I plug. That means the production run for that switch is tiny - it's probably not even a full days run, which means the economy of sale is reduced.

On top of that, the middle man is probably distributing a tiny amount of these to each store, so they can't just pull out pallets from the shipping container and put them on a truck, individual items probably need to be pulled out and re-packaged. All this adds cost.

comment 3y ago · link · parent

That sounds like the ISPs problem, not the customers.

comment 3y ago · link · parent

> Who gives a shit about SOLID or OO.

The people who care about and are tasked with maintaining a large long running code base.

> You wanted to apply what they taught you in uni, which was Java, to PHP.

Nope, that came after my time.

> Can't you booksmart idiots STFU for once and let people do the pragmatic and sensible approach? I earned good money with it and had fun doing so. Then 2010 the next generation of clueless devs enters the scene, polluting it with their nonsense.

Those OO & OOP principles are the pragmatic and sensible approach learned after cleaning up after "hipster" web "artisans". If we're going to throw around claims without knowing anything about the other person; you sound like the kind of dev who writes some code that works on the happy path, but is completely unmaintainable and non-extensible.

(But I know nothing about you, so I really have NFI, just like you have NFI about me and what I do)

comment 3y ago · link · parent

Also not OP, but the linked reddit post sums up one of the major reasons I had to get out of PHP several years ago. Everything is/was moving to Laravel in PHP land. I got tired of dealing with highly coupled, non-unit testable code that seemed to go out of it's way to ignore SOLID principles.

God help us if it this project becomes the normal way of writing http go servers applications. Maybe at that point it's time to become an embedded rust programmer or a monk.

123456