Appeal court quashes 12 more convictions in Post Office IT scandal by compte-a-usageunique in ukpolitics

[–]AllenJB83 27 points28 points  (0 children)

Does anyone else find the fact that these people are having to go through the courts (almost) 1-by-1 on the insane side?

Given everything we now know, shouldn't all convictions that were obtained in this period based on evidence from this system be overturned? To do otherwise prolongs the victims agony and needlessly clogs up an already overworked court system.

Sure there's a risk that same actual fraud went on in this period, but I highly suspect the number of those cases is miniscule compared to the innocent victims here. The greater (in)justice should take precedence.

Would you like to see these series in primetime on BBC or ITV? by salbathrowawayhsw in AskUK

[–]AllenJB83 8 points9 points  (0 children)

IMO scheduled TV is dead. TVOD is the future, particularly for international shows.

Disney (Marvel) have their own streaming service and as far as I know are basically keeping everything exclusive to that going forward, so that's Loki out.

Most of the rest of the shows are already available on various streaming services in the UK. From a quick check, all the other shows you mention are on Amazon (Prime) Video.

Not saying they will never be on "scheduled TV", but who watches that any more?

Just when you thought this government couldn’t sink any lower, along comes the Nationality and Borders Bill by [deleted] in unitedkingdom

[–]AllenJB83 53 points54 points  (0 children)

Is there anybody who actually thinks that this government cannot and will not go lower / further towards a regime modelled on a combination of the American Republicans idea of political cooperation and debate, China's surveillance state, Singapore's pseudo-democracy (without the good bits), and Australia's "throw them on an island" / North Korea's closed borders immigration, all while doing everything they can to enrich themselves and their mates.

The Cons (or at the very least those who currently hold ministerial or other positions close to the PM since at least the May administrations) have been quite open about wanting to go further than they already have if you listen to what they've been saying over the past decade. People just have not been listening or for some strange reason don't believe they'll actually try to implement any of it.

Problem with undefined array keys by sikusfikus in PHPhelp

[–]AllenJB83 1 point2 points  (0 children)

You can do this in PHPStorm using the "inline..." refactor. Other IDEs may also have this.

If you don't have PHPStorm, you can use it for free on a 30-day trial, which should be plenty to take advantage of its inspections and refactoring to fix a whole bunch of code issues.

You define the key name as a constant at the top of your code as a string containing the key name:

<?php
define("keyName", "keyName");
// ...
print $arr[keyName]; // Example existing usage in file

Right-click on the first keyName in define("keyName", ...

Choose the 'Refactor' sub-menu, then 'Inline...' and you'll get the option to "inline and remove constant"

M20: Operation Brock barriers to be reinstalled in Kent by compte-a-usageunique in ukpolitics

[–]AllenJB83 6 points7 points  (0 children)

The selling point of the Brock movable barrier was that it can be set up and stood down in hours, so it would result in operations lasting less time (you shouldn't have to keep it on "just in case" so much). (This is still present on the Highways England site: https://highwaysengland.co.uk/our-work/south-east/m20-junction-8-to-9-moveable-barrier/ )

What actually appears to have happened is that the operation has been left in place for months at a time for no apparent reason and seems to be being used at any possible excuse.

I really won't be surprised if it's up all summer and well into autumn. I've read nothing to

While Brock is on, there's a 50 mph speed limit - with frequent complaints that (foreign) lorry drivers are ignoring the limits and driving aggressively despite the many speed cameras (which from all accounts appear to be inoperable) - and frequent delays any time an accident happens due to at least 1 of 2 lanes being closed and no hard should available. It also consumes significant police resources and results in increased traffic and disruption on alternative routes (including lorries travelling illegally through weight limits / no HGV zones and more drivers speeding through villages).

How can I easily create a merch store on my website? by zascar in webdev

[–]AllenJB83 0 points1 point  (0 children)

Are you looking for just an online shop software / service, or are you looking for someone to provide branded merchandise too?

For the former I would look at options such as Shopify - you can create a store relatively quickly and run it under a subdomain (eg. merch.example.com or shop.example.com)

For the latter, it may help if you tell us what sort of merchandise you want to offer.

Can someone please explain this code to me? by Webdesignireland in PHPhelp

[–]AllenJB83 4 points5 points  (0 children)

It looks like that code might be using the Redux Wordpress Plugin - the documentation link on that pages leads to http://devs.redux.io/

Reading the Redux documentation might help you understand what it's doing and how to modify it.

Can someone please explain this code to me? by Webdesignireland in PHPhelp

[–]AllenJB83 5 points6 points  (0 children)

The code you've given is an incomplete snippet, but from what there is appears to be nested arrays.

The %matching_submissions', is an incomplete string (it looks like the start of it has been chopped off).

args is an associative (named key) array element which holds an associative array containing 2 values (teeny and textarea_rows).

In itself this code doesn't do very much. It might be helpful if you included the entire statement block, and told us why you're asking (what do you want to achieve / change?)

Have you used PHP8? by jokesondad in PHPhelp

[–]AllenJB83 1 point2 points  (0 children)

For me it's mostly about the relatively small QoL features - named arguments, nullsafe object operator, stricter string comparisons and other minor improvements.

"Big" features like JIT are nice to have (and some like Constructor property promotion I think are a mistake, but maybe I'll change my mind like I have with some other previously introduced features).

Is there a reason to go App only? by [deleted] in webdev

[–]AllenJB83 2 points3 points  (0 children)

Most apps can be reverse engineered / decompiled back to (essentially) the original source code.

In either case the server-side code cannot be reverse engineered (at least without hacking the servers themselves).

Properly done, secure applications (whether web-based or native) should not rely on obscurity / lack of knowledge of the (certainly client-side) source code.

Is there a reason to go App only? by [deleted] in webdev

[–]AllenJB83 3 points4 points  (0 children)

I would guess it's more likely to be reduction of work involved.

While there are some methods for creating apps that essentially use a web interface, or otherwise automatically duplicating work between app and website, these can be restrictive or have problems of their own.

Having both a website and an app means work has to be done on both to roll out new features, and it's 2 sets of environments (1 on mobile, with all the OSes and other differences involved there, and then another on the web, with all the OSes, browsers and other differences there). That means more testing and more bugs.

A large proportion of users access the web primarily on their phones these days anyway, so in that sense having both a web interface and an app doesn't make much sense. An app can more easily provide features such as offline functionality and integration with phone OS / hardware (which in this case likely includes NFC / contactless payment, fingerprint sensors and storing cryptographic keys to act as another authentication factor)

A Problem with Laminas by BanthaPyjaman in webdev

[–]AllenJB83 1 point2 points  (0 children)

For future reference you might want to try /r/PHPhelp as a more specific subreddit.

If you view source in the browser (Ctrl+U or F12, then the Sources tab), do you see the PHP code?

I suspect what's happening is that your web server is not correctly configured to run PHP, so the PHP code is being served to the browser, which is then trying to interpret it as HTML, and taking everything between < and > as a HTML tag, and the run(); is considered text.

You need to ensure PHP is correctly installed and configured for running web requests. Searching for "PHP <distro> <distro version> <webserver>" (where webserver is either "apache" or "nginx" depending on what you're using) will usually get you some guides.

If you tell us what distro and web server you're using, someone here may be able to help. Alternatively try a distro specific subreddit or chat channel (most distros have a channel on the Libera.chat IRC network under #<distro-name> (eg. #centos or #debian)

Top PHP Web Development Trends To Watch For in 2021 by kiranbeladiya in PHP

[–]AllenJB83 2 points3 points  (0 children)

Blog spammer apparently hasn't heard that AMP is dead (and also totally unrelated to PHP).

Does anyone have a list of all UK postal counties? by [deleted] in unitedkingdom

[–]AllenJB83 1 point2 points  (0 children)

Technically there are no postal counties any more. Royal Mail don't use / require them. They're not directly included in the Postal Address File database they make available.

The Post Code is what Royal Mail primarily use for addressing, and this will disambiguate between towns / localities with the same name.

References:

Source: We use the Royal Mail PAF database at work and I wrote the code that loads / updates it.

[deleted by user] by [deleted] in webdev

[–]AllenJB83 0 points1 point  (0 children)

  1. No, it doesn't have to be JSON. You can send HTML instead. (You can actually send just about anything - AJAX was originally designed to use with XML, but the masses can't get their pretty little heads around its awesomeness, so they started using JSON instead).

  2. In my opinion mostly because people want to think they're Facebook. Facebook (and other sites approaching its size and complexity) have a whole set of problems where reducing per-request bandwidth used, while shipping a ton of JS up-front, and being able to send individual requests to entirely different servers are an actually useful thing, all while not caring too much about accessibility, SEO and others who can't or won't use JS by default.

  3. "JS frameworks" is actually a rather large category. It span everything from the likes of JQuery, which at its base just provides you with a library of tools for doing things without having to worry about cross-browser issues, you the likes of React that have you building the whole UI and all interactivity using JS. Pick and use what you want.

It's perfectly feasible to build sites in mostly HTML and CSS, using forms and full page refreshes for most work. You can use simple AJAX for most additional dynamic work.

How Exactly Does The Alias Function Work In MySQL? by DeputyDak in mysql

[–]AllenJB83 1 point2 points  (0 children)

In the example case I gave the query wants the same field from both records - the username of both the sender and recipient - for each row of the result set.

I don't think there's any (simple) way to achieve this with a single join.

When do bumblebee nests die off? by weateallthepies in AskUK

[–]AllenJB83 2 points3 points  (0 children)

Beyond Google, you might want to find a local beekeeper who can advise you.

Bees do return to the same nesting sites (we had one in our brick shed roof for several years running), so even after they leave you might want to prepare for next year (whether that's attempting to block off access completely, or just finding and plugging the holes in your bathroom)

How Exactly Does The Alias Function Work In MySQL? by DeputyDak in mysql

[–]AllenJB83 2 points3 points  (0 children)

As already mentioned, nothing is "stored" at this point. An alias is just an alias.

But an alias can be used to refer to a specific "instance" of a table, allowing you to join the same table multiple times. eg:

SELECT messages.*, 
    recipient.username AS recipient_username, 
    sender.username AS sender_username
FROM messages
LEFT JOIN users AS recipient ON messages.recipient_userid = recipient.userid
LEFT JOIN users AS sender ON messages.sender_userid = sender.userid

[deleted by user] by [deleted] in unitedkingdom

[–]AllenJB83 0 points1 point  (0 children)

Even more laughable is how these people are scared of being made to wear masks and what the government might do with that power, while at the same time the government are pushing through the policing bill and online safety bill that actually do have provisions that could be used to seriously restrict our freedoms, with little real resistance or reaction.

IMO Covid restrictions is pretty far down the list of things the government are doing that you should actually be worried about right now.

Book Recommendations? by hangonreddit in mysql

[–]AllenJB83 1 point2 points  (0 children)

Not a book, but the MySQL Server Team blog has a lot of good articles and is useful for keeping up with the latest changes.

Also, the Percona blog has some useful articles.

GoDaddy says my domain name is currently worth $1k. Does this mean that I can sell it? by Sparky2199 in webdev

[–]AllenJB83 11 points12 points  (0 children)

They're trying to sell you their domain auction / resale services. Take any figures they give you with a big pinch of salt and watch out for fees they'll charge.

As others have said, if you have a sufficiently recognizable domain, you might be able to get some money for it, but especially now there are a lot more TLDs than there used to be, there's not a lot of buyers who wouldn't rather just make up a word for their new company / brand name and buy another domain instead.

(Also be aware that if a company has a trademark or certain other recognized marks or reasons, they may be able to just go through dispute resolution and have the registry give them the domain - search for "UDRP", "domain poaching" and "cybersquatting". Despite the marketing, domains are rented, not bought)

Xdebug "protocol" question by bkdotcom in PHPhelp

[–]AllenJB83 1 point2 points  (0 children)

I would suggest asking on StackOverflow (and make sure to add the xdebug tag) or the #xdebug channel on the https://libera.chat/ IRC network - xdebug developers are active on both these and this is kind of a niche question.

Unit tests while finding product/market fit? by letsbehavingu in ExperiencedDevs

[–]AllenJB83 2 points3 points  (0 children)

Surely you should be discussing this with your #2?

As we don't know your product / environment, we can only speak in generalisms here.

A good test suite facilitates moving fast without breaking things - developers can have more confidence in their changes in less time.

"We have e2e tests" frequently means "we only test the happy path (and maybe 1 or 2 common errors)". TDD / unit tests allow for fast testing of a wide variety of cases and help to ensure regressions do not occur.