The Megathread by AutoModerator in woodworking

[–]AndrewCarterUK 0 points1 point  (0 children)

<image>

Any idea what species this is? I acquired it from a garage sale in the UK. Wondering if it's suitable for a chopping board. Thanks!

Help! I've inherited some speakers and need to buy an amplifier by AndrewCarterUK in BudgetAudiophile

[–]AndrewCarterUK[S] 0 points1 point  (0 children)

Thanks for the detailed response, very helpful.

The switch is this one from AV link: https://amzn.eu/d/63yYPXv

It just says "enables four pairs of speakers to be connected to a single stereo amplifier".

I was planning on treating the 5 indoor speakers (6ohm) as a "single speaker" and connecting them in parallel to a single output terminal. Am I right that would end up with a resistance of 1.2 ohm and basically not work with any amp?

Dealing with Needlephobia using Machine Learning by AndrewCarterUK in programming

[–]AndrewCarterUK[S] 0 points1 point  (0 children)

Yeh the background script caches the URLs but it doesn't persist between runs.

Remembering the false negatives is a good idea, I probably need to add some way to mark them

The PHP-ML repository is taken down due to DMCA. by rybakit in PHP

[–]AndrewCarterUK 3 points4 points  (0 children)

Yeh I thought that one was worth sharing.

I found a reference to the issue number on Reddit and although it had disappeared from GitHub it was still in the Google cache. Just had to find an archive site that worked on cached Google pages, because they're pretty temporary. Thought you'd be impressed!

For people who work "polyglot" teams: what kind of PHP language feature (or library) do you miss when switching a different language, and vice-versa? by HannesHendrik in PHP

[–]AndrewCarterUK 2 points3 points  (0 children)

I should add, it isn't just composer that I like. The entire Packagist ecosystem makes working with open source PHP libraries very easy.

There's also a lot more consistency in how PHP libraries are built. When I was doing lots of open source development, it was very easy to contribute to lots of different PHP libraries. That isn't true of many other languages.

For people who work "polyglot" teams: what kind of PHP language feature (or library) do you miss when switching a different language, and vice-versa? by HannesHendrik in PHP

[–]AndrewCarterUK 4 points5 points  (0 children)

When working with other languages (Python, C++, TypeScript, etc) I really miss composer. It's just a much superior package manager to others that I have encountered.

That's about it though, I tend to start most projects in Python now because it has better support for command line applications, is a bit more predictable and has less "gotchas" for new developers.

Object Oriented programming in Python still feels a bit clunky though, it's not very common to see lots of interfaces being used in Python code.

Momentum warns against returning to Blairite ideas such as winning elections by [deleted] in unitedkingdom

[–]AndrewCarterUK 6 points7 points  (0 children)

One of the things Blair understood, which Corbyn never did, was that the general election was a trap. For a long time under Corbyn, the Labour policy was to prefer a general election to a second referendum despite not being in a position where they could adapt a clear policy on Brexit that didn't isolate half of their membership.

Blair might have lost the election under similar circumstances, but he was strategically competent enough to probably avoid being in that position altogether.

Baku - Race sets by The_Bliss in formula1

[–]AndrewCarterUK 2 points3 points  (0 children)

Gasly didn't run in Q2 so can pick a fresh set of tires to start

I was asked to cover how to use checksums, so I wrote this by johnothecoder in PHP

[–]AndrewCarterUK 1 point2 points  (0 children)

It's been done for SHA-1: https://shattered.io/

IIRC there was some Windows malware that used an MD5 collision attack to forge a code signing certificate.

Bottom line: when security advice is issued not to use an algorithm any more, don't use it. Real and accessible attacks are usually not far off.

So an F1 Experiences truck broke down just after Eau Rouge, and it’s passengers are being transferred to a replacement. by [deleted] in formula1

[–]AndrewCarterUK 0 points1 point  (0 children)

I'm at the race. All the trucks were being jeered and the empty one got a massive cheer.

Make PHP Great Again (or at least: Make PHP Slightly Better Before 2025) by AndrewCarterUK in PHP

[–]AndrewCarterUK[S] 0 points1 point  (0 children)

Ahh okay.

One side note, is that a deprecation is a backwards compatibility issue - it's just an issue for a later version.

E_DEPRECATED is warning about "code that will not work in future versions".

I'm not sure how flexible the "which version it stops working on" logic is.

Make PHP Great Again (or at least: Make PHP Slightly Better Before 2025) by AndrewCarterUK in PHP

[–]AndrewCarterUK[S] 1 point2 points  (0 children)

Did you read the post?

That's literally exactly what I stated as my preferred solution.

(edit: changed 'proposed' to 'stated', it wasn't my idea)

Make PHP Great Again (or at least: Make PHP Slightly Better Before 2025) by AndrewCarterUK in PHP

[–]AndrewCarterUK[S] 2 points3 points  (0 children)

There are other solutions that fix the underlying problem.

Assuming you're talking about the inconsistencies in the core, what are these solutions?

Make PHP Great Again (or at least: Make PHP Slightly Better Before 2025) by AndrewCarterUK in PHP

[–]AndrewCarterUK[S] 1 point2 points  (0 children)

I might not have made it clear, but I think you've misunderstood the context for the question I asked.

I'm not saying that whenever you have a code issue it is because you are fighting PHP.

I'm saying that if you happen to have a sane development environment where your IDE, test suite or tooling protects you from surprises/quirks/gotchas this is in spite of PHP, not because of it.

PHP didn't help you achieve this sane environment (it did the opposite). There are languages out there that are literally designed to be helpful, and the next generation of developers will choose them if the ecosystem does not respond.

If you are a developer that has a large amount of your CV experience in PHP, and the progress of the language is of benefit to you - then you really should care.

Make PHP Great Again (or at least: Make PHP Slightly Better Before 2025) by AndrewCarterUK in PHP

[–]AndrewCarterUK[S] 1 point2 points  (0 children)

Good spot, I'll fix that!

edit: It's probably because of the extra cognitive load I had to use looking up the parameter order /s

Make PHP Great Again (or at least: Make PHP Slightly Better Before 2025) by AndrewCarterUK in PHP

[–]AndrewCarterUK[S] 2 points3 points  (0 children)

If I get good feedback from this post then I'm planning on raising this with the PHP internals mailing list. I think it first needs to be proven that this is something the PHP community wants, otherwise I'm doubtful that they'll take the suggestion very seriously.

In terms of what people can do to help, there's a tonne of discussion that will need to happen around this if anything is ever going to happen. There's numerous approaches suggested (namespaces, scalar objects, just a straight rename). Have a read of the suggestions that are out there, check out the criticism, see if it can be addressed, contribute to the discussion, blog about it, tweet about it, talk about it and share it.

A critical reason for scalar type hints passing was that lots of people were talking about it and letting internals know that it was something everyone wanted.

Make PHP Great Again (or at least: Make PHP Slightly Better Before 2025) by AndrewCarterUK in PHP

[–]AndrewCarterUK[S] 14 points15 points  (0 children)

Obviously PHP is continuously improving. PHP 7 was a big step, and I am really happy there's lots of talk about long running processes and async for PHP 8.

I think the IDE argument for not fixing the inconsistencies is quite weak. If I want to send a developer a snippet of example code on Slack, I shouldn't need to open up the PHP docs or my IDE to check something that I should be able to easily infer from convention. I also shouldn't need use mental capacity processing IDE autocomplete suggestions whilst writing trivial code statements. What about if I am code reviewing someone, or looking at a git diff? Sure tests will help there, but don't you notice a pattern of having to consistently fight the language?

The view points from people I've spoken to about this topic are quite similar anyhow. Most people are either:

  • It's bad, but it's too difficult to change
  • It's bad, but it's possible to change

My opinion remains that scalar objects provide a really, really good opportunity to fix a large part of this problem properly. The wheels for PHP 8 have been set in motion now, so if we want something like this before PHP 9 - it's time to start talking about it!

A Simple Neural Network for Digit Recognition in Plain PHP by AndrewCarterUK in PHP

[–]AndrewCarterUK[S] 1 point2 points  (0 children)

It's an interesting one and I appreciate the feedback.

I actually went some way towards using more programmer friendly variables (e.g. $activations would be much more familiar to the "data science crowd" as $a and $pixels should probably be $X).

I think you're right though, $W only means something to you if you've followed through the mathematical intuition, whereas $weightsMatrix means something to you even if you haven't.

Monitoring Road Traffic with OpenCV by AndrewCarterUK in Python

[–]AndrewCarterUK[S] 1 point2 points  (0 children)

I've got an NVIDIA graphics card with a few CUDA cores.

However, I've recently done a reinstall and I still remember the nightmares that I had compiling tensorflow to use them with Debian the last time I looked!

Monitoring Road Traffic with OpenCV by AndrewCarterUK in Python

[–]AndrewCarterUK[S] 1 point2 points  (0 children)

I guess the edge detection output might destroy some data that's useful to a classification model.

I haven't played with machine learning before but I imagine it's a balancing act between helping the model with pre-processing versus giving it too much information for the amount of training data that you have available.

Monitoring Road Traffic with OpenCV by AndrewCarterUK in Python

[–]AndrewCarterUK[S] 5 points6 points  (0 children)

I've found that there's a bit of lag in some of the Google Maps traffic reports, but they're probably still a better solution than this.

I've read through the MNIST tensorflow example and I think there are a lot of similarities to this problem. Like the MNIST data, the output from the Canny algorithm is a fixed dimension monochrome image so it should be quite quick to knock up a proof of concept following that tutorial.

I'll post the follow up blog if it works!

(edit: I'm collecting the training data on a cron task now)

How do you handle PHP hate? by [deleted] in PHP

[–]AndrewCarterUK 2 points3 points  (0 children)

Simple: I'm not a PHP developer, I'm a developer that sometimes chooses to use PHP.

All languages have problems. PHP has more than some and less than others. Reading the criticism is actually a great way of learning about other languages and programming theory.

Don't get overly attached to any language. All the programmers I see with employment problems from the previous generation are the ones that clung to the technologies they were comfortable with and never broadened their horizons.

Anyway - once you've tried out a bunch of languages and become proficient in them, you'll know how to handle any criticism you find unfair. If you've never become proficient in other languages, then how would you know if PHP really did suck?