« first day (3041 days earlier)      last day (1904 days later) » 

12:04 AM
I fucked something up in 7.1/7.2, 7.3/7.4 are okay ...
I'm too sleepy to do anything about it now ...
 
Imagine if we had strongly typed callables, and we declare our iterator callback as (val, key, obj), it would make functions like 'intval' incompatible anyway. But it would fail, not silently producing strange results with the base. I don't think there is a general solution here, other than to have the documentation state it clearly and to have it applied consistently..
lodash has always felt intuitive to me. I've seen other uses of val, key, obj before I just have to dig them up.
 
wtf, I think I might be too tired to concentrate ... you can make it good in your head ...
 
@LeviMorrison could use the same pattern as array_map php.net/manual/en/function.array-map.php
 
something to do with hashposition ... must have changed
 
@Trowski all I have is implicit cast from return type. but if it were possible to make a typed distinction between an actual generator and a promise/task/future/zorbongaliff then that seems like a way to make a lot of sugar work... specifically I always liked the ability to return a promise and had that mean "return the result of this promise", which doesn't work with generators because... they might just be a generator
basically it's very old resolve/yield from problem
but also the actual solution is async/await instead of generator abuse
 
12:16 AM
@DaveRandom It could remove the frequent return call(function (): \Generator { ... }); boilerplate that litters anything written using Amp.
 
Also I am now campaigning for Zorbongaliff as a disambiguation term
 
@DaveRandom I think ext-async is the real solution.
class_alias('Amp\\Promise', 'Zorbongaliff');
 
broadly yes, but syntactic sugar is not unimportant. imo
as always I feel sort of disappointed when I use a programming language and it isn't C# :-P
 
@DaveRandom Have you seen preprocess.io?
 
no, but I can imagine it, the only thing that matters is... can it hook composer install without needing a decl at the project level?
because if yes then great, if not then it's basically useless
not useless but unmanagable without automation tooling, which means I'm out
possibly harsh and/or straight up wrong, but in my defence I'm basically half a person atm :-P
 
12:22 AM
Honestly… that's pretty much how I feel about it.
I've never actually used it, but it's a cool PoC.
 
as soon as there is a "compile time" preproc (where "compile time" == "deployment time") I am all over that shit
I have so many horrifying ideas
and @Wes is going to be the bane of my very existence
but until then...
 
For me the biggest blocker is that my IDE becomes useless if I try to use invalid syntax.
 
yes but that is a solvable problem... I'm assuming that "your IDE" is basically IDEA, and that is so extensible it's ridiculous
 
@DaveRandom what'd you do?
 
12:26 AM
I fucked about with some PHP storm plugins a while ago and it's almost annoying easy to do insanely complicated stuff
@Tiffany yo momma #lol
(seriously I'm not sure what you mean by that :-P)
 
> did you get a local copy of my version running in the end?
 
@Tiffany wrong chat :-P
but yeh I mean all the vm stuffz
 
ooh
yeah
 
and the git repo
 
I've just been...lazy...
 
12:29 AM
it was ages ago and I forget where we got up to
 
@DaveRandom Wonder if @assertchris put together anything for PhpStorm. If he did, I'd definitely be more willing to try it.
 
@Trowski if not I could maybe bridge that gap... I have had a poke around in that general area at least
you have to write Java, but other than that it's mostly fine :-P
 
> You have to slice off your penis, but other than that it's a fine group.
 
D:
 
@DaveRandom misread bane as "basis" and that made for excellent out of context quote, but sadly...
 
12:35 AM
lol
 
I dunno, over the years I have come to regard Java in a similar way to PHP... it could be so much better if they weren't so obsessed with backwards compatibility
 
@DaveRandom So long as I have your attention, it's obligatory that I remind you of this issue.
 
Wes
@DaveRandom where do i start reading?
 
but that's a big part of why I love C# so much... it's Java, only designed by people who learned from the mistakes that Java made, and maintained by people who aren't afraid to just give you the finger and break shit for greater good
 
Wes
i'm trying to understand the context of the ping you left me but i am failing at it
 
12:38 AM
Yeah… Java isn't so bad really, I just found it tedious.
@DaveRandom I agree, PHP could use some of this philosophy.
 
@Wes conservative estimate, 50% of the language design ideas that make me recoil in horror have come from you
(never change <3)
@Trowski that is an excellent word to describe it, yes
 
@Trowski would you trust php to know what the greater good is?
 
Wes
@DaveRandom can i go home now?
 
I've told you before, you can go home when you fix the internet.
 
Wes
that's going to take a lot of fire
 
12:41 AM
"fix" as in spay/neuter?
 
I'm not bothered about how, that's why I hired you. Get to it.
 
@Paul If reduced to those doing a lot to push the language forward, then yes. I think @NikiC is already starting to chip away at some of that.
 
@Trowski OK so yes I started to look at this and I fell down a hole. I'm struggling to generally be alive atm but I will eventually get to it, I have a lot of ideas for what can be done with that thing which will require a lot of reworking (and debate)...
...however
the path problem needs fixing soon
and I cannot guarantee to do that any time soon
and I know how to fix it
 
Wes
how do i code coverage ignore a line like
function(){
    while(true){
        // returns here
    }
    // can't go here - code coverage ignore this
}
 
Does what he pushed at least fix the immediate problem?
 
12:46 AM
and I could do with giving that problem to someone else
and I can help them do it
@Trowski no
it needs proper end to end unicode handling
 
@codeCoverageIgnore
 
all it does is patch one of a billion edge cases
it needs the thing reworking to do basically all comms over stdio/pipes
 
if it's all green, can I have cake ?
 
command lines are just too retarded for data transmission in windows, even text
and even when bypassing the shell
it's not a huge change but it needs both ends changing
 
Hmm… ok, well whenever you find the time and motivation.
 
12:49 AM
and since it needs such a big change I thing we should move to a more job-queue based approach
with a view to moving towards multiplexing data exchanges
(because I think I can make an extension that may actually be comparable performance to pcntl_fork())
like a long way down the line
 
hmm very interesting
 
Wes
@JoeWatkins doesn't work, at least in xdebug
 
like I say, I fell down a bit of a hole, in which I learned how w32 alerted I/O works :-P
 
@Wes @codeCoverageIgnoreStart and @codeCoverageIgnoreEnd
 
I've no idea why you are using that
I'm having cake
 
Wes
12:55 AM
still red @Trowski looks like i am going to need to modify the while
 
@Trowski I really could do with another brain, in all honesty, I have some ideas, and I think I can explain them to someone else, but I am really struggling with the process of actually making stuff atm. If you know a person who is vaguely familiar with C as a language and doesn't hate Windows then it will probably happen quicker
 
@Wes You have to put it before the closing brace on the while I think.
 
@Trowski /me changes screen name to @codeCoverageIgnoreStart
 
Wes
tried that didn't work
i also put end outside the } function closing brace, no change
 
@DaveRandom That second part is really challenging…
 
12:58 AM
Windows is fun. It's not actually any more horrible the than POSIX, it's just differently horrible
It's terrible at a lot of things, I'll give you that, but it's also pretty good at a lot of things
 
Well, more specifically the problem is finding someone interested in async PHP that is also familiar with C and Windows.
 
familiarity with windows isn't necessarily required, just a willingness to learn about it
and not in a particularly deep way
just there are a few oddities if you are used to unix pipes
 
Perhaps you can explain it to me sometime then. I'm thinking if we develop Amp v3 with ext-async, which will handle sub-processes, then it may not be worth anyone's time.
 
also, it's not the best code in the world but I personally think the existing code is pretty readable/generally understandable with not a lot of google...
there are things I would do different if I started again but it all vaguely makes sense at least
@Trowski indeed, although that said I might prefer doing with windowsy bit of ext/async anyway :-P
 
Yeah, so we'll see.
 
1:07 AM
@LeviMorrison I think no collection methods at all. We're off talking about iterator callbacks when we shouldn't even need them.
 
Hi, I'm a client-side developer and I've been asked to integrate Venmo purchasing with PHP into my client's website. I remember trying to create a PHP contact form in the past, which messed up the website (created in HTML/CSS/Js). I've found a lot of resources for launching a site in PHP, and know how to launch with HTML, but are there any resources for doing 1 page in HTML and 1 page in PHP?
I'm very new to PHP, but this seemed simple enough so I figured I'd use this as a learning opportunity\.
 
@Trowski oh so here's the other thing about that... it struck me that since it's socket based and essentially represents a job queue, it might make sense to just wrap it up in amqp... and move amp/process towards that sort of model (or maybe another layer), and then distributed computing yada yada... either way, a socket-driven generic process runner is a useful thing to exist
@LukeIsitt Hi! Welcome to a very steep but relatively short learning curve :-P
 
looking forward to it :)
 
There's no such thing as a "page in HTML" or PHP, the only different is the way the web server processes the request
Skipping over an absolute shitload of stuff, the first thing you need to do is understand how your web server is processing requests via PHP
i.e. if you name a file foo.php and put PHP code in that file does it get executed?
if you create a file called info.php that contains only this:
<?php phpinfo();
...do you see a web page?
 
ok my conceptual knowledge of PHP is not superb, but to my understanding no. PHP executes either before or after HTML, to my understanding, based on it's placement.
 
1:19 AM
sort of
HTML isn't "executed" as such
PHP is executed by the server, whereas (from the PoV of the server) HTML is just some text
 
ok, I am following so far :)
 
OK so what web server do you need to work with?
by which I mean, what is the production web site running on
apache/nginx/iis/whatever
 
Wes
function(){
    try{
        ...
    }finally{
        ...
    }
    // not covered
}
 
I'm actually not sure. I have my PHP developed with an idea of how to integrate Braintree/Venmo purchasing integrated, it's the launching aspect where I'm not sure how to continue.
 
Wes
also this, and can't really refactor it
 
1:27 AM
oh wait, I think I might have come up with an alternative
I'll be back
 
Wes
other languages' code coverage i recall (python maybe) ignore branches containing "assert(false)"
 
@LukeIsitt So I will level with you here in 2 ways. 1) I am sort of drunk and I need to sleep. 2) this is now a thing you can fudge. You cannot do payment stuff without understanding it. You either need a crash course in PHP conceptually, or you need a client-side-only solution, or you need to pay someone to do it. Payments are not a thing that you can do the bare minimum with :-P
 
@DaveRandom I was using PHP to create a shopping cart, but I was thinking it would actually be easier for me to use JavaScript. Braintree handles the actual payment methods, so the only thing I would have to manipulate in terms of payment is the total price.
 
my brain is overloading with sheer volume of things to say :-P
none of which are particularly helpful in their own right
 
1:34 AM
Oh boy
 
All good. I have a lot of experience with front-end dev, but have never done payments before. I can test everything in my sandbox, but do you think it be better to hire someone then?
 
I've seen what happens when you don't do payments correctly
 
No worries. Is there anywhere I could learn this on my own time?
 
1:35 AM
tl;dr security matters and it really sucks when you get it wrong :-P
@LukeIsitt I really wish I had a good answer to that, because you seem like a person who deserves a good answer to that :-/
 
And this is the kind of thing that depending on how wrong you get it could destroy your business. I have inherited a system that was so egregious with its payment technology that their processor stopped accepting their payments and I had to do a major overhaul of the entire system to bring them into something even remotely sane. It almost caused the business to close down.
 
The difference between "front end" and "back end" is big and complicated, but what really matters is the relationship between the two
 
@LukeIsitt Yea, I wish I had a better answer too. Unfortunately I don't
 
All good. I don't mind sticking to front-end :)
 
The PHP manual is great
 
1:39 AM
Thanks, everyone!
Sure, I'll check it out
 
and this room is full of great people
and if you have more specific questions then this is a great place to come
unfortunately "implement x" is not specific enough :-P
 
There's a lot of things to take into consideration. Ideally you have isolated the payment processing piece to have as little JS as humanly possible. Ideally if you need something from your provider for a JS SDK that is the only thing you include. Then <iframe> that piece into your app.
The last thing you want to do is have a JS app with 1 bajillion dependencies on it with your payment processing not isolated from it
 
but please do come back if you have specific questions about PHP
 
For sure, I'll dig into PHP when I am in need of a challenge. Thanks again :)
 
Wes
next challenge is understanding how umask() works... everything i read so far didn't make any sense
 
1:51 AM
I bring you, the best thing french canadian brough to the world
 
Wes
my cholesterol increased by just looking at it
do you have a recipe? :B
 
:P
Not for that precise one, sadly (:
but by the looks of it, it seems like ground beef, onions and possibly mushroom (on a poutine)
wow, I want that, right now
> how do you eat it
with determination
 
@FélixGagnon-Grenier I disagree. Your primary contribution is the ability to hold enough disdain to outdo the French.
 
lol
That is indeed, no small feat :P
 
Wes
in unrelated news, it's not possible to avoid writing @mkdir()
not because i dislike "@", but because it is slow
i just tried if(!file_exists($a)) mkdir($a) which in theory would avoid the warning, but it doesn't when a concurrent process creates the dir in between of file_exists and mkdir
of course that required hammering it
but there is still a small chance to happen
 
1:59 AM
single thread everything :P
(not even sure that means anything...)
 
Wes
it doesn't. go finish your poutine :B
@FélixGagnon-Grenier it looked like sweet stuff
 
Spotify is literally the best thing ever
 
I thought I had understood that at the very beginning of processors, they could effectively only manage one stack of opcodes at a time
 
@rtheunissen Having an n-ary map with an n-ary callable is great.
@rtheunissen Fair to leave it to another project.
 
2:03 AM
I am totally OK with computers knowing everything about me if what comes out of the other end is Spotify autoplay
 
Wes
also file_exists isn't really fast either
 
@DaveRandom I'm still relatively unknowledgeable about spotify. is it nice?
 
it knows far too much about me
 
but that is broadly positive
 
2:07 AM
@DaveRandom it's seen the pictures too, huh?
 
I'm listening to zappa and it just throws madonna in there
next up is something off queen/the game I can tell from the artwork but I;m not going to cheat and find out what
 
Wes
wow is_dir/is_file is much faster than file_exists
 
I wish I worked on things where there were enough users so that speed actually mattered :)
(just in case: that's really not a diss @Wes :)
 
I used to go to these 24hr raves, speed really mattered there
 
Wes
2:14 AM
@FélixGagnon-Grenier i don't, but knowing why 20% of time is spent on a single function alone might be useful information
 
Ah, the joys of blocking i/o
 
Wes
use(
    &$directory, &$directoryMode, &$path, &$contents, &$afterCreateDirectoryAttempt,
    &$afterOpenAttempt, &$afterLockAttempt, &$afterWriteAttempt
){
we need to do something about this tho
 
Wes
2:18 AM
@levi should pursue the "var $var;" idea
 
when you say "we" you mean "you"
and by "this" you mean "this design that requires 8(!!!!) closed over by-ref variables"
because, and I'll be brutally honest here, that is by no stretch of anyones imagination something that would considered OK
 
I can only imagine what the body of that looks like
 
@DaveRandom "wes" is the plural of "we"
7
 
I mean at least wrap that ball of state in a class ffs
 
Wes
the good thing about js is that showed everybody how important it is having closures that work like that. so people that originally thought that was bad now they changed their mind for the most part
 
2:21 AM
Yea, even just a stdClass at this point would be an improvement
 
ffs
@Paul this is my favourtie message ever
 
3 messages moved to Trash
 
It totally changed the way I pronounce Wes in my head
 
Wes
@CharlesSprayberry and you don't see any issue in that?
it's the same thing
 
@Wes Oh I see a ton of issues with it
But your refactoring has to start somewhere
I would probably make the object type more semantic
 
Wes
2:24 AM
also i do &$ by default even if i don't actually need &
 
But just reducing the number of use variables to use($thisSemanticObject) makes it easier to read
 
Wes
a function scope is an object, where the variables are the properties
if i put that to an anonymous object, i am not adding nothing
 
ftr I don't entirely disagree with you (for once) @Wes, but that is a terrible way to go about demonstrating why
 
Wes
except i can pretend i am smarter
 
I would argue that you're adding clarity
 
2:25 AM
I can't see that there's any sane middle ground between explicit import and lexical scope though
and we have explicit imports, you can't suddenly add lexical scope
 
Wes
you are not doing enough js dave
 
Also it is hard to go off on anything else seeing literally just the use statement :P
 
I am doing more than nil, and thus more than enough
 
@DaveRandom what if we went the JS approach and introduced a short function syntax?
 
the point stil stands
 
Wes
2:27 AM
i would say the major reason js is so popular is this feature alone
 
@CharlesSprayberry fine. I want => or ~> or nothing.
 
@DaveRandom That I can agree with
Ugh, I need to get going. I'll talk to you all later
 
PHP needs short closures, and IMO => is the way to go and fuck bc, but I also am not interested in continuing the argument(s) that this message will start
 
I, fow one, would totally love the () => {} syntax
 
Wes
in fact the other day i watched a video on go and how this is (trying to) change very much not openly how people think about certain things, including exceptions
 
2:30 AM
bc is less of a problem than ambiguity in the language
 
what do you mean?
 
Wes
go people argue that the old c way of putting errors in variables like read_file($path, &$error): string
leads to better code than using exceptions
 
@FélixGagnon-Grenier The core issue with that, afaik, is that [$x => $x - 1] is already a valid thing in PHP that means something very different
 
huh, right
 
Wes
they aren't very open about it because it would lead to infinite arguing
 
2:32 AM
@Wes that's... interersting. because, like, forcing people to do something leads to... better outcome?
 
Wes
but that is the reason golang doesn't have exceptions
 
I'm still not clear on why ~> wouldn't work though
 
@DaveRandom the ~ is all the way up on the left on the keyboard
 
Wes
@FélixGagnon-Grenier i don't understand
 
:-P
 
2:34 AM
@Wes It was a question, because I don't understand that pov, that forcing each signature to have a &$error argument is a good thing
 
Wes
they can do whatever they want it's their language, but they don't want to offer free opportunity for criticism either
 
I realize it's not you that defends it, I'm just curious :)
 
Wes
no they are just saying that you can return multiple types, or use classes with multiple methods, i wasn't referring to the old "c way"
 
@DaveRandom because bikeshedding.. e.g. why not |$x| $x - $y
 
because that would be quite literally insane
this is php, not fortran
 
2:37 AM
s/fortran/rust
 
the fortress of sanity
 
Wes
in fact i doubt that's even possible in golang. they are just saying you can return something like this
class FileReadResult
{
public string $fileContents;
public bool $isError;
public int $errorCode;
public string $errorMessage;
}
 
@Wes hmm.. Arguably, exceptions are just some special semantics around precisely that
 
@DaveRandom this is why ~> won't work either - because someone will prefer a different syntax, and you'll be hard pressed to get 2/3 to agree on one
 
Wes
@pmmaga maybe depends on where you handle the error? bubbling exceptions vs handling them in the parent scope
 
2:41 AM
yeah, you can "bubble" the error code as well
 
@Paul so I involuntarily said "oh, fuck off" out loud in response to this, and I just suddenly remembered about 9-10 year ago on the tram on the way to into town, I had a nokia phone of some variety and I was listening to the radio on headphones, a show where someone had phoned in for some reason, and they said something ridiculous...
...and it provoked a similar reaction, only I did it at a station right in this woman's face, so basically this woman was getting on the tram and I said "oh, fuck off" right in her face like 6 inches away
and she ran off crying
and I have felt bad about that at least once a week for like 10 years
 
oh fuck off
oh wait, sry, I meant
 
I mean seriously I wanted to pull the emergency brake on the tram and go and find her immediately because she looked so upset, it was awful :-/
 
Wes
lol
 
@DaveRandom yeah, I feel you :P
 
2:52 AM
@DaveRandom you know she was already having a bad day to react like that too
 
@DaveRandom Agreed, but Partial Function Application is better when it applies.
 
@DaveRandom you horrible person
 
Wes
this will refresh it for 10 more years dave :D
 
@Paul you clearly do not understand the Carousel Of Shame at all :-P
 
Does anyone know of a good read to explain how composer determines the "stability" of a dependency package?

I understand the "minimum-stability" part in the a root composer.json file. What I'm missing is for those dependencies being pulled in, how composer determines what stability it is. For example my custom private repos are considered "dev-master" at the moment.

I haven't created an actual "release" of them yet, and I'm willing to bet that is involved here somehow, in getting a packaged indicated as "stable". I see composer also supports "beta", "alpha", and "RC" in addition to just "
 
2:56 AM
@DarrenFelton just for clarity, your intention is to release a library under composer?
 
Wes
@DaveRandom i once said a girl "go away you are ugly"... her face she had afterwards haunts me. i feel bad about it several times a year, for almost 2 decades. i was drunk when i said that, but that doesn't make it any better, at least in my mind
also she wasn't even ugly, i was just being a cunt
 
hm. yes I suppose so.

"Project A" pulls in "Library Z".
"Library Z" is a repo i have on github.

Right now, if I set in "Project A", the "mininum-stability" to "stable", composer refuses to pull in "Library Z".
 
@Wes oh yeah I have also just been a dick for no reason mostly after a lot of lager
 
Whereas with a min-stability of "dev", it's allowed.

I haven't created any "releases" yet of "Library Z". I'm guessing that's involved here. And was hoping to just do some reading on how composer determines the stability.
 
I have been accidentally a dick much more often though
even if we just stick to the tram, I once thew up on a couple as they were getting off at about 11.30pm on valentines day
 
3:02 AM
as if they needed another excuse to get naked
 
oh and I once accidentally stole a guys bike off the train, because I picked up the wrong one and then I got mine back from lost property and put his back and then 6mths later is was unclaimed so they phone me to come get it
 
Wes
lol
 
none of these things are maliciously wrong but I feel bad about all of them :-P
 
Past Memories to Keep You Awake at Night and Other Terrifying Stories
 
Wes
3:07 AM
i sometimes think of things i regret saying like 15 years ago
stupid brain :B
 
@FélixGagnon-Grenier how's the game?
 
the best ones are from school though, like when you pointlessly lie about stuff for no reason
 
Wes
lol
 
Aha, I think I found it @Tiffany.

Tagging releases seems to be the answer.
 
@DarrenFelton awesome
 
3:09 AM
the statistical people who say they never lie are the ones who can't even bring themselves to tell the truth in a survey
 
oh maaaaan Astroneer's out
 
If I create a release of a repo, and tag it with "-RC", "-alpha", "-beta", it indicates that release, as that level of stability.

Creating a release of a repo, lacking a suffix, is assumed stable.
25
A: How to mark code as stable using Composer?

KingCrunchThe answer is: Tags. Your may also use Alias, if you don't want to use tags. But it's worth to mention, that you should only mark your packages as stable, when they are stable and not to make others believe they are. Update: One more link: Stability

 
@DarrenFelton out of interest, are you doing debian releases?
 
Wes
so the mkdir issue is unsolvable. if i do mkdir("foo") and "foo" dir existed already, i don't see why i would care about that. i mean i am fine so long the directory exists in the end
mkdir not only returns false if the dir exists already, but it also spits out a warning
 
@Tiffany I'd spend the entire time tunneling through the planet just to see what happens when you jump in... then cutting the planet in half
 
3:11 AM
@Tiffany not so deep in yet, but it's very cool. that alternace combat / platformer in the beginning it much to my liking :)
also... it's quite creepy :D
 
@FélixGagnon-Grenier nice. Hopefully it's better than the game that I got @Fabor, Attack Helicopter Dating Simulator
 
Wes
especially given that with no real atomicity things can go and come at any time
makes sense?
 
@DaveRandom Sorry I'm unsure what that means.
 
@DaveRandom lol
 
3:13 AM
@DarrenFelton the reason I ask is that, for some batshit insane reason, debian's versioning things are compared lexically, such that RC < alpha
 
> Debian always has at least three releases in active maintenance: stable, testing and unstable.
 
it's a thing to be aware of, I would say. Pas everything though strtolower() or strtoupper() before comparing version numbers with staging tags
 
I plan to use semantic versioning. And right now all my packages are basically of a s
stability "dev".

I probably won't utilize -alpha, -beta, -RC at all. But wanted to gain an understanding of how composer was determining the stability of my dependencies.
 
@DaveRandom ping
 
Because the moment I marked "minimium-stability" : "stable", it stopped pulling in my packages.
 
3:16 AM
@DarrenFelton I really only distinguish between dev and stable
dev is dev-master. stable is anything tagged
 
@Wes possibly look at how it's used inside doctrine. That is a library that is using correctly I believe.
 
> dev is dev-master. stable is anything tagged
@FélixGagnon-Grenier This is probably the extent I'll go with it as well.
 
@Tiffany Reply from @DaveRandom: bytes=32 time=112ms TTL=29
 
Wes
similarly unlink($file) doesn't guarantee the file to be deleted, since a concurrent process can recreate it a moment after
so why raise a warning if $file does not exist?
 
because you can guarantee it with locks
there is a mechanism for doing that
if you don't use it that's your fault
 
3:18 AM
oh boy, here we go...
 
Wes
lol
i am using them but they are advisory
 
/me leaves
 
Wes
drops the bomb and leaves
 
> time=112ms
yeah...
 
@Wes is this still the template project?
 
Wes
3:21 AM
@Danack it never was the template project, but it is the same project yes
 
I'm still pretty sure you can do what you want to do with either the code I shared, or copying how Twig does it...which is the same I believe. You tried that....is the a simple sharable reason why it didn't work?
I mean, if you're having fun doing it the other way.....go for it.
 
Wes
i got everything working with locks, i was trying to get rid of @ around file functions, and i realized i cannot get rid of it from @mkdir
 
Wes
in essence returning anything from that function is pointless because
1- i don't care if the dir existed already as long the directory exists
2- the directory can be deleted again from a concurrent process after my mkdir call anyway. so telling me that it exists or not is not useful at all if someone else can delete it back
 
:45324073 this is the kind of quality conversation @Tiffany and I are having privately that you are all missing out on
 
3:27 AM
@DaveRandom nice cc/ @Tiffany
 
Wes
@Danack ^
 
god dman why does that not work any more
 
Aug 15 '18 at 19:26, by Tiffany
0
Aug 15 '18 at 19:33, by Tiffany
................................................................................‌​........................................
 
@Wes you can have the same function, that is exactly the same, but only the calling code knows whether an edge case is an error or not. It's why I drafted gist.github.com/Danack/5ae0b1b1ce30a0d785dd - (but I'm not going to pursue that). Having the result and error returned in a tuple would be far better. But from it:
// Create a data file in a new directory
// $directoryName should be a unique directory name that
// does not currently exist
function createUniqueFile($directoryName, $text) {
    mkdir($directoryName, 0755, true);
    file_put_contents("foo.txt", $text);
}

// Update a data file in a directory that may already exist
function updateData($directoryName, $text) {
    mkdir($directoryName, 0755, true);
    file_put_contents("foo.txt", $text);
}
 
@DaveRandom you mean you and @Tiffany's cat
 
3:30 AM
in the interests of fairness I will include the message that preceded that
 
@DaveRandom chat.stackoverflow.com/transcript/message/43610198#43610198 (Madara deleted the message in question because I asked, but this is what it was)
 
I... just no.
time and a place
 
Wes
$h = fopen("foo", "c");
flock($h, LOCK_EX | LOCK_NB);
mkdir("foo");

// it is guaranteed that the directory exists in here

flock($h, LOCK_UN);
fclose($h);
if this was possible it would be amazing, but it's not possible, therefore mkdir giving errors is pointless
 
/me sleeps because zzzzzzzzz
 
@Wes nothing is ever guaranteed with a file system - the disk could fall off
and just wait until you encounter nfs
 
3:36 AM
@Wes it allows you to tell if you created the directory or not....or if some other process created the directory.
In other news, I'm thinking about going to sites.exeter.ac.uk/eyesmind/extremeimagination2019 , at least in part just so I can wear a nametag of "subject 26".
 
Wes
@Paul yes indeed, so why bothering me with warning
unlink in particular is pretty stupid "cannot remove A because it doesn't exist" ie, i want it deleted in the end, what's the difference
 
9 mins ago, by Danack
@Wes it allows you to tell if you created the directory or not....or if some other process created the directory.
Cooperative multitasking, also known as non-preemptive multitasking, is a style of computer multitasking in which the operating system never initiates a context switch from a running process to another process. Instead, processes voluntarily yield control periodically or when idle or logically blocked in order to enable multiple applications to be run concurrently. This type of multitasking is called "cooperative" because all programs must cooperate for the entire scheduling scheme to work. In this scheme, the process scheduler of an operating system is known as a cooperative scheduler, having...
 
Wes
3:54 AM
i suppose there are uses cases for those functions working that way
still it's very inconvenient using that stuff if you don't need to do any of that
fclose($a) automatically calls flock($a, LOCK_UN) internally if any, right?
 
I'm 90% sure it does.
 
Wes
i am so stupid, i can try, i have tests :B
it does, at least on windows. trying linux soon
 
4:50 AM
http_build_query doesn't encode "+" in a float number – #77608
 
nn, Room.
 

« first day (3041 days earlier)      last day (1904 days later) »