@cabbey@phpc.social avatar

cabbey

@cabbey@phpc.social

sourcerer @ SmugMug, photo geek, dad, licensed rocket scientist (L2 w/ NAR and Tripoli).

This is MY stream of consciousness. I don’t speak for my employer, club, or hobby.

Fiscally conservative, socially liberal; he/him

This profile is from a federated server and may be incomplete. Browse more on the original instance.

cabbey, to php
@cabbey@phpc.social avatar

Does anyone have a better way to write the conditional calls to foo at lines 5-9 of this #php code? https://3v4l.org/fqCvv The goal is to have the default argument for bar trigger the default argument for foo, but they're different defaults (since one is nullable and the other isn't), and bar should not need to know what foo's default is. (obviously in my real code it's a much more complex signature, and separate classes.)

cabbey,
@cabbey@phpc.social avatar

@Girgias not sure I follow how that would help?

cabbey,
@cabbey@phpc.social avatar

@Girgias ooh, yeah. I thought you meant down a level in foo. That's easy enough to determine if the flag is null that I don't think this is helpful. Also I'll note that in the real code, due to multiple named optional parameters it's a bit more complex: https://3v4l.org/PfBe4

grmpyprogrammer, to random
@grmpyprogrammer@phpc.social avatar

I had foolishly assumed that Dubai’s airport was landlocked in a desert and was stunned to see pictures of the flooding

cabbey,
@cabbey@phpc.social avatar

@kboyd @grmpyprogrammer @janl yeah, having been born and raised in the desert this doesn't surprise me at all. We used to laugh our asses off at the folks from down by the coast that would come up and buy land, then bulldoze the gullies flat and start to build houses on them. Then the first gully-washer of the season would come ripping through in the later winter/early spring and they'd be shocked that over night there's a 30' tall trench cutting through the property.

kevbob, to random
@kevbob@xoxo.zone avatar

deleted_by_author

  • Loading...
  • cabbey,
    @cabbey@phpc.social avatar

    @kevbob ROFL. I’m curious how they took that.

    blindcoder, to php
    @blindcoder@toot.berlin avatar

    Just spent TWO HOURS debugging PHP code because I relied on my IDE and github Copilot which both didn't catch the bug in the code below:

    <?php
    if (array_key_exists("error", $response){
    $return_value = [];
    }
    ?>

    Error message was: PHP Parse error: syntax error, unexpected token ";" in <file> on line 3

    Yes, it's on me, but I'm supposed to test this tech for my employer and results are not looking favorably.

    Edit: added proper line number for my example

    #PHP #IDE #SoftwareDevelopment #Copilot

    cabbey,
    @cabbey@phpc.social avatar

    @michael @Sdfendor I reduced the frequency of this to basically zero by disabling a bunch of built in plugins for stuff I don’t use. Laravel and symphony and behat and like 10 other things. Haven’t had any hiccups since.

    cabbey, to php
    @cabbey@phpc.social avatar

    Just discovered a fun little corner of with @kboyd at work that's not super clear in the docs, but you'll eventually find all the right info if you look in all the right places.
    Say you have a trait that declares a property with a default value. And say you have a class that uses this trait and also (re)declared the same parameter. That's fine, because the two declarations are the same.
    But what if you wanted to use a constructor promoted parameter? well.... 1/2

    cabbey,
    @cabbey@phpc.social avatar

    If you move that declaration to a constructor promotion... it blows up. With an unclear error: "Bad and hasABus define the same property ($magic) in the composition of Bad. However, the definition differs and is considered incompatible." This is because the constructor promotion is just syntactic sugar, and the code the sugar is transformed into discards the default value in the declaration. (It becomes a line in the ctor instead.) https://3v4l.org/d1kV4#v8.3.6 2/2

    alda, (edited ) to random
    @alda@topspicy.social avatar

    PHP double precision floats for financial calculations — yes or no?

    cabbey,
    @cabbey@phpc.social avatar

    @alda I kinda want to know where the dozen or so folks that voted yes work, so I know where to avoid doing business.

    kevbob, to random
    @kevbob@xoxo.zone avatar

    deleted_by_author

  • Loading...
  • cabbey,
    @cabbey@phpc.social avatar

    @kevbob ugh. I have a list of things queued up to sell off cheap. Crap like that is part of why I keep adding to that list and not selling anything. :(

    kboyd, to random
    @kboyd@phpc.social avatar

    Confession time:

    I haven't seen the movie Idiocracy, and at this point I'm too afraid that it will make more sense than reality does.

    cabbey,
    @cabbey@phpc.social avatar

    @kboyd it’s worth the watch. Even if it has somewhat moved from satire to documentary.

    cabbey, to random
    @cabbey@phpc.social avatar

    ok, what's a decent platform for hosting a blog on these days... you know the long form of these micro-blogging platforms that are all the rage? Bonus points if I can import my old blogger export content, doubly so if it's a platform I can use without feeling dirty about using it. I really don't want to have to manage it and run the infrastructure... that's too close to day job work.

    andrewfeeney, to php
    @andrewfeeney@phpc.social avatar

    I'm not sure if people outside the #PHP community realise just how much it is powered by sheer bloody-minded oppositionalism in response to those who claim PHP is not a good language.

    cabbey,
    @cabbey@phpc.social avatar

    @andrewfeeney I have proposed chumbawumba’s “tub thumping” as our community’s theme song for just that reason.

    cabbey,
    @cabbey@phpc.social avatar

    @andrewfeeney I was mostly thinking of the chorus.

    cabbey,
    @cabbey@phpc.social avatar

    @andrewfeeney I dunno… I’ve seen the bar bill at a couple php conferences….. 🤪

    ian, to random
    @ian@phpc.social avatar

    phpc.social just hit 4500 users, slightly before the Mastodon user count hit 15 million. Thanks to everyone choosing to make this instance your home on the fediverse!

    As a reminder, server costs aren't free, and our OpenCollective proceeds exclusively go toward the various costs involved in maintaining this instance. For those of y'all who've donated, thanks for your support!

    cabbey,
    @cabbey@phpc.social avatar

    @ian I wish @opencollective showed a glide slope estimate… given current recurring contributions and historical expenses, the current balance will last until $date. Would be better if you could preload it with list of known recurring costs instead of it assuming historic values would hold since lots of new orgs have start up costs. Is that a calculation you or @ramsey have done?

    cabbey,
    @cabbey@phpc.social avatar

    @ramsey @ian @opencollective seems to be a recurring theme for everyone. 😕

    ramsey, (edited ) to random
    @ramsey@phpc.social avatar

    Can someone explain how Vocaloid words? I’m trying to figure out who did the vocals/speaking on several Porter Robinson tracks, and he apparently used the Avanna voice from Vocaloid 3. So, is he the one providing the vocals, and his voice goes through the synthesizer, or is it fully generated by the synthesizer?

    cabbey,
    @cabbey@phpc.social avatar

    @ramsey Vocaloid is a full text to audio system. For speaking you enter the text (with optional phonetic markers iirc). For singing you input the lyrics as text and the tune to sing it to as a basic sheet music like notation. There are many voices to choose from and I seem to recall most of them support a few adjustable values.

    cabbey,
    @cabbey@phpc.social avatar

    @ramsey as I understand it, yes. I don’t own a copy, but have been adjacent to its use a few years back.

    ramsey, to random
    @ramsey@phpc.social avatar

    I just discovered a Mexican/Chinese fusion restaurant nearby, and I know what’s for dinner tonight!

    cabbey,
    @cabbey@phpc.social avatar

    @ramsey @kboyd I did one time have a Mexican fried rice dish. It was really good. Chinese style rice, fried with some tomatoes, onions and chilies in place of the traditional peas and carrots, with bits of chorizo and eggs.

    cabbey, to random
    @cabbey@phpc.social avatar

    Sad day in my mastodon usage. I finally broke down and figured out how to block an individual.

    🤦 only to then find out it doesn’t do what I want and I also need to mute them?

    🤬 only to then find out that because they are spamming several tags I follow I still see their inane crap.

    cabbey,
    @cabbey@phpc.social avatar

    @derickr correct. On a mainstream instance with thousands of users.

    kevbob, to portland
    @kevbob@xoxo.zone avatar

    deleted_by_author

  • Loading...
  • cabbey,
    @cabbey@phpc.social avatar

    @kevbob it was a glorious two days.

    ramsey, to random
    @ramsey@phpc.social avatar

    YouTube likes to show me bra ads for “women of a certain age.” I’m not sure what that says about me.

    cabbey,
    @cabbey@phpc.social avatar

    @ramsey for a long time they kept showing me ones for flat chested women. I used it as a standing example of how bad their data science was at categorizing viewers. (For those that don’t know me personally, I’m a bit overweight, even my moobs aren’t that small, and my wife certainly isn’t.)

    thisismissem, (edited ) to random
    @thisismissem@hachyderm.io avatar

    That's something I'd love a reporter covering this spam wave to know: Discord is being used to coordinate illegal activity, and discord has no mechanisms for people to report abuse.

    abuse@ and support@ emails are dead ends, and their contact form has no "report abuse" option that works. Reporting it via the child safety team also didn't work.

    Update: TechCrunch covered it: https://techcrunch.com/2024/02/21/discord-took-no-action-against-server-that-coordinated-costly-mastodon-spam-attacks/

    cabbey,
    @cabbey@phpc.social avatar

    @ian ugh. I hadn't done the looking to see who was their upstream. :/

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • osvaldo12
  • DreamBathrooms
  • mdbf
  • InstantRegret
  • ngwrru68w68
  • magazineikmin
  • everett
  • thenastyranch
  • Youngstown
  • slotface
  • cisconetworking
  • kavyap
  • ethstaker
  • JUstTest
  • modclub
  • GTA5RPClips
  • khanakhh
  • tacticalgear
  • Durango
  • rosin
  • normalnudes
  • Leos
  • provamag3
  • tester
  • cubers
  • anitta
  • lostlight
  • All magazines