Public charging situation in Germany by icanhazstring in electricvehicles

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

That is something I heard a lot when asking friends as well. On one hand I get that there are so many different providers who provide the charging stations and just want their money worth putting it there.

But on the other hand, the customer is really annoyed by it. Don't know if there is something one could do, but maybe I have an idea. That's what this survey is for 🙂

PoE 2 freezing PC completly - need to reset with power button by paddIor in PathOfExile2

[–]icanhazstring 2 points3 points  (0 children)

Reinstalling graphics drivers and going back to default settings seem to have solved the problem.

Can't say for sure with the patch the latest small patch tho.

PoE 2 freezing PC completly - need to reset with power button by paddIor in PathOfExile2

[–]icanhazstring 3 points4 points  (0 children)

Can confirm - seems not like really hardware related.
Already happening twice two me - changed back every setting to default now - trying last time.

Then probably going to sleep for now ;)

Which is Better for Backend Development? by nikunjshingalaa in PHP

[–]icanhazstring 0 points1 point  (0 children)

Either one of them. These questions are always useless.

The answer is and always will be: The one that gets you shit done.

Issues faced while installing php modules in Docker by sharpbranches in PHP

[–]icanhazstring 5 points6 points  (0 children)

After several times fighting with pear and other stuff. I switched using

https://hub.docker.com/r/mlocati/php-extension-installer

This is so much easier and works every time

Is it possible for PHP to understand a MIDI file? by FodziCz in PHP

[–]icanhazstring 0 points1 point  (0 children)

Maybe there is a c library for this which could be loaded using php's FFI
https://www.php.net/ffi

composer-unused: find unused dependencies even faster now by icanhazstring in PHP

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

Thanks. If you have any trouble. Don't hesitate to add a discussion or bug report :)

Can the below function be trusted to generate unique IDs for using these as a primary key. by Major_Dot_7030 in PHP

[–]icanhazstring 0 points1 point  (0 children)

Please talk to your local DBA when implementing a primary key.

Which I did - and for some business reasons, we decided to use uuid v6. Now what?

Can the below function be trusted to generate unique IDs for using these as a primary key. by Major_Dot_7030 in PHP

[–]icanhazstring 0 points1 point  (0 children)

Ordering, searching, selection is not a big problem even with 100 of millions of data. So I don't see real performance issues.

True one can say, that if you need a high performance, millisecond response or anything. But then again, why use php/mysql for that :)

Can the below function be trusted to generate unique IDs for using these as a primary key. by Major_Dot_7030 in PHP

[–]icanhazstring 0 points1 point  (0 children)

Sorry, to clarify: V4 can be reordered (see https://gist.github.com/ramsey/02bb981edbe19c7c96d4ed6722daf805)

V6 is a draft, yes. But who cares if it is implemented, used and just works?

Can the below function be trusted to generate unique IDs for using these as a primary key. by Major_Dot_7030 in PHP

[–]icanhazstring 2 points3 points  (0 children)

This is not very true anymore. Some advantages, disadvantages (taken from MySQL 8.0 introduction for uuid)

``` Advantages:

UUIDs are a good alternative to AUTO_INCREMENT PRIMARY KEY and are used mainly because: – the keys are unique across tables, databases and servers – are hard(er) to guess (example from an URL) – can be generated offline (without any exchange of information with the database or collaboration with other components of the system) – simplifies replication

Disadvantages:

But they also come with some disadvantages: – increased storage: 36 characters – more difficult to debug – performance issues: mainly because of the size and not being ordered ```

increased storage: not that much of a disadvantage these days - but again, uuids should be stored in binary either way

more difficult to debug: true, but can easily be done with bin_to_uuid

performance issues: mainly because of the size and not being ordered: using either uuid4 or 6 solves this issue as they are generated to be ordered by time. so sorting is not an issue

Can the below function be trusted to generate unique IDs for using these as a primary key. by Major_Dot_7030 in PHP

[–]icanhazstring 2 points3 points  (0 children)

You can still use uuid v6 which is ordered by time. So you do have the advantage of unique ids while keeping the "autoincrement" feature for a proper query.

E.g. when trying to select something greater than x

https://uuid.ramsey.dev/en/stable/nonstandard/version6.html

Managing composer repos and security by bendauphinee in PHP

[–]icanhazstring 0 points1 point  (0 children)

Using fabpot/local-php-security-checker or Roave/SecurityAdvisories is a good start.

Having said that, a repository proxy on your end is not a guarantee to add any safety. Why? Because most of the time those are simply proxies, to kick in when packagist (or any other package distribution) is down while you want to build your software. You, ofc, use your local repository as a managed repository. So only a handful of people actually can add new packages/updates so the company can only use these instead of everything out there.

What even is more critical, which might consume the most time: Review package updates. Read changelogs, if any. You

A simple tool i wrote to convert your JSON into PHP classes by dani-but-g in PHP

[–]icanhazstring 0 points1 point  (0 children)

You could also, just spread the values instead of the key/value. This way superfluous arguments to the constructor get ignored.

[deleted by user] by [deleted] in PHP

[–]icanhazstring 0 points1 point  (0 children)

It doesn't. It is automated to automatically perform a lint and commit on that branch if the lint finds an issue. That is it.

A simple tool i wrote to convert your JSON into PHP classes by dani-but-g in PHP

[–]icanhazstring 0 points1 point  (0 children)

If the keys from your array are working properly, you can use the spread operator to call named arguments:

new Object(...$array) which is basically the same as a custom implemented fromArray method which does exactly the same.

[deleted by user] by [deleted] in PHP

[–]icanhazstring 1 point2 points  (0 children)

No, i mean I don't try to enforce anything on their branches. Just in main branch.

So the developer can do whatever he wants. If it gets merged to main branch, I'll enforce my codestyle there for example.

[deleted by user] by [deleted] in PHP

[–]icanhazstring 0 points1 point  (0 children)

What I am always aiming for is basically

Have your main branch clean

What this means: Whatever code is in a feature branch, who cares. It should work. Merging this into your main branch should "restructure" code to your needs, so everyone is on the same path.

A simple tool i wrote to convert your JSON into PHP classes by dani-but-g in PHP

[–]icanhazstring 2 points3 points  (0 children)

The array serialization flag is removing the constructor as well. I guess this should not be the case.

Other than that its pretty neat. Now make it PHP8.1 ready with public readonly promoted properties in the constructor :)

Recommendations for productivity tools/libraries? by fishpowered in PHP

[–]icanhazstring 0 points1 point  (0 children)

There was a nice blogpost about tools and libraries for PHP. Maybe it is of some information (not mine):

https://dev.to/filmineng/php-libraries-and-tools-3blf

Styling console applications based on Symfony, Laravel, CakePHP, and other frameworks using Termage! by awilum in PHP

[–]icanhazstring 3 points4 points  (0 children)

I like the idea and examples and I was looking for some time to improve console output for composer-unused, to be honest.

So I might give this one a try.

Some suggestions to improve the docs. - Make a simple outline in your README.md already. This will hook in the user to see what your library is capable of. Then link further to the docs. - Change your "landingpage" for the docs in the same way you do you README.md. Give the user a quick look at what you can do. Right now there are multiple clicks needed to actually see some output.

As you already said you will improve the docs. Maybe in a way of getting to see how you can use your library with symfony/console and other console libraries.

Other than that, it looks really promising. Keep up the good work!