« first day (3943 days earlier)      last day (987 days later) » 

6:53 AM
Good morning.

\o
 
7:16 AM
a wonderful good morning
 
 
1 hour later…
8:23 AM
@bwoebi Oh, they changed it? Nice.
 
 
2 hours later…
10:15 AM
Morning
 
indeed
 
I refuse
I object!
 
10:34 AM
I'm going back to sleep for a bit
 
Zzz
I wish I could do the same but I took my cat to the vets this morning and it was a 2 hour wait
 
I woke up a few hours ago, but started to throw up ... so we're all doing pretty good at mondays
 
:|
 
I might take some time off work, most of my team are on pto anyway
 
That sounds like it might be wise
 
10:45 AM
Hm
 
don't leave us hanging, is kitty okay ?
@NikiC what's up with build errors for *.H ?
 
Yup, just her annual vaccinations. She was mardy because I plucked her straight out of bed and into her carrier.
 
Ok one question, assume there is an API that gets a "date" and returns "all users with the same birthday".

Now, assume I call that API with passing date in a wrong pattern. for example, I have to pass 2021-01-01 but I send 2021/01/01 ..
I get a "wrong date format" error .. all fine
my question is, what HTTP error code have to be for the response?
Since I have two status codes, one internal (for my code) and one for HTTP request
 
400 Bad Request
The server cannot or will not process the request due to an apparent client error (e.g., malformed request syntax, size too large, invalid request message framing, or deceptive request routing).
 
bad request means 400? Or the http status code must be 200 and the internal one must be 400?
@Gordon ah ok, thx
 
10:56 AM
@Shafizadeh I dont understand that. Not enough context. But if you send the wrong params to an API it's usually met with a 400
 
yes got it ..
in the response of APIs you have, what structure do you return? Is there any status code in addition to the http status code?
for example, I have this:
response([(array) data, (string) message, (status_code) code], https_status_code);
 
@Shafizadeh Check here for some structure. Also here (check links in accepted answer).
 
11:32 AM
thx
 
12:21 PM
@JoeWatkins I hope you feel better.
 
@JoeWatkins Hope you get better soon .. have you been vaccined?
 
12:47 PM
file_put_contents should support LOCK_NB ・ *Directory/Filesystem functions ・ #81322
 
@JoeWatkins Hey man, reading that you are not doing well, sending good thoughts your way, hope you get better soon <3
 
get well soon Joe!
hey @ln-s are you still based in Argentina?
 
Yes
Capital Federal, REPRESENT! :P
 
wow, awesome!
is the weather crazy around there as well?
 
Nah, normal I'd say
Cold August
lasts until early november
 
1:05 PM
my city is going through a weird winter, it was usually no lower than ~15ºC and then we had 2ºC last week :-|
 
1:23 PM
@ln-s 'Cold August until November comes.' Not crazy at all.
 
Rio grande do sul ?
@FlávioHeleno
@Tpojka Which continent do you live in
 
@ln-s nope, I live in Sao Carlos, it's about 230km from Sao Paulo (southeast)
 
@ln-s Europe.
 
Wasn't there a snow in the south of brazil ?
 
1:27 PM
@Tpojka Seassons are different in the american continent when summer here winter there
south america that is
 
@ln-s Sure thing. Just sounded funny. :D
 
Well, it has been like this since I can remember
 
:D
 
HAPPY MONDAY!!
SPECIAL HAPPY MONDAY TO @DaveRandom It's here again!!
 
@ln-s It's little strange to anticipate relation of August and Winter. That's why funny.
 
1:33 PM
I get it, I got called a summer child for being born in june in europe
 
1:49 PM
I suggested a feature request for Psalm, being able to statically check if a class or function is testable with unit-test. That is, it's either pure, or everything can be mocked.
 
2:06 PM
@Tpojka Opposite in Australia. Summer: December - February; Autumn: March - May; Winter: June - August; Spring: September - November
 
2:17 PM
Huh, I just got a massive amount of spam mails
 
RichardCoucH ・ *General Issues ・ #81323
 
hey guys you know how can i scrap all linkes from a webpage looping the pagination?
 
@NoobDEV-GBL Assuming the page isn't doing too much with JS, parse the page with DomDocument - you can then use getElementBy methods or DomXPath to grab what you want. Pagination is just a matter of finding the pagination link and making another request using that.
@NoobDEV-GBL If the page is generated with JS, I think you'll need to look at headless browsers and the libraries that interact with those.
 
@AllenJB hum ok, i was looking on my friend google for code exemples...
 
3:01 PM
parsehub fixed the problem :D
 
 
2 hours later…
4:38 PM
o/
 
Hi Everyone, I have this error: string(66) "Operation timed out after 30005 milliseconds with 0 bytes received" on this code: kopy.io/YUIMz why is that?
 
4:56 PM
@Es0teric: Whatever your curl request is going to took longer than 30 seconds (the timeout) to respond.
 
@All
@AllenJB so how do I fix it?
 
@Es0teric You need to look at what's happening on whatever is processing the curl request and work out why it's taking so long. There's very little information you can get just looking at the curl client request.
 
Hi all
Websites on Apache on Ubuntu, all point to the Apache homepage after changing the Server IP... Why?!
 
@AllenJB honestly, I think I am just doing the POST data with the file wrong on this: kopy.io/YUIMz#line-18
what is the proper way to do it?
 
@MRS1367 I would start by looking at the "VirtualHost" configuration (both the global configuration and host definitions). They may be using a specific IP.
 
5:07 PM
@AllenJB I have reviewed them. There is no IP in their settings.
I've checked files in the following path:
 
@Es0teric I can't see anything I think is obviously wrong, but I'm not familiar enough with using curl directly. I would suggest using Guzzle because I think it has a much easier to use interface.
 
/etc/apache2/sites-available/
 
@AllenJB I have a guzzle version but its too heavy
it uses too much processing power
does anyone else know how to use cURL in the way I am using it now though?
i am literally just sending a file to an API to get results
it takes multipart/form-data
 
@AllenJB Can you tell me the path of the configuration files...
 
@MRS1367 Have you also checked the general Apache configuration - probably in /etc/apache2/conf /etc/apache2/conf.d and/or /etc/apache2/modules.d ? (The exact directory structure / configuration file layout varies depending on distro, but they should be under /etc/apache2)
 
5:16 PM
Do you mean:
/etc/apache2/apache2.conf
 
That sounds like the main configuration file (which will be including the files in subdirectories)
 
cmb
@Es0teric it seems you're mixing up $file and $filename. Minimal fix CURLOPT_POSTFIELDS => $filename,. Also CURLOPT_VERBOSE=>true might give some hints.
 
There isn't any folder with the names you mentioned
I see conf-available and conf-enabled
 
@cmb ah ok, but thats $filename with $filename = new CURLFile() right?
 
cmb
right
 
5:21 PM
@cmb i am still getting this same error: string(132) "{"errors": {"image": "An image file Missing required parameter in an uploaded file"}, "message": "Input payload validation failed"}
oh wait its not a same error because before it was a timeouit
 
cmb
right; check the API docs :)
 
conf-enabled
javascript-common.conf
localized-error-pages.conf
other-vhosts-access-log.conf
php7.4-cgi.conf
php7.4-fpm.conf
security.conf
serve-cgi-bin.conf
 
@cm
i am passing a image name through the req
image name is image because of the API
i mean this would be the CLI curl request: $ curl -F "image=@samples/surfing.jpg" -X POST localhost:5000/model/predict
i dont understand how $filename = new CURLFile( $file, mime_content_type( $file ), 'image' ); does not send it
 
@Es0teric I think you need POSTFIELDS to be: ["image" => $filename ]
/me is amused by someone using machine learning to generate image captions claiming Guzzle is "too heavy"
 
@AllenJB yeah string(132) "{"errors": {"image": "An image file Missing required parameter in an uploaded file"}, "message": "Input payload validation failed"} still on CURLOPT_POSTFIELDS => [ 'image' => $filename ]
@AllenJB its not on the same container
@AllenJB also, I used guzzle before as I said but it kept using wayy too many resources
 
5:46 PM
wow this is so wierd
i really don't get while that file error is popping up
 
wow … when one ini entry is duplicate, zend unregisters ALL ini entries of that module :-D
 
Is it proper docblock to put @param 100|200|300 $number to show that the number could have a value of 100, 200, or 300? I really don't think it is but my coworker says so and Phan seems to recognize it
 
can someone PLEASE tell me what I am doing wrong in this CURL request? kopy.io/XAOzC
 
@scorgn Feels like a problem where you need an enum
And instead of some magic numbers that don't carry any meaning it could be StatusCode (or whatever)
 
6:01 PM
@CharlesSprayberry you mean the name of the variable could be StatusCode? Or do you mean an enumeration class called StatusCode?
 
@scorgn An Enumeration class so you'd have @param StatusCode $statusCode. I would probably rename $number in this context too. But, really without more knowledge of what those ints actually represent this is just speculation
 
@CharlesSprayberry Yeah I thought it was clear the variable name and values were just an arbitrary example haha
 
Ah, I see
Yea, generally I'd say that if you have a type declaration like that it probably should be an enum instead. YMMV
 
I don't think it is necessary to use an enumeration class here, that would really overcomplicate things just for a simple integer that we're passing to another object
 
Could the enumeration class express more details about what those values represent?
When I come in as a new developer (or yourself 6 months later) am I gonna be able to understand what those ints mean and why I can only give you 3 specific values?
 
6:05 PM
Yes
There are more than 3 examples in the code but yes it is all documented enough
I am not asking about how to name things or best practices
Just whether using raw integer values in docblock is valid
 
Well just whether it is technically valid doc block I guess depends on what code you have interpreting it.
If it doesn't complain then it is "valid"
 
I suppose so
 
Anyone know where Adam's fork of lxr.php.net is?
 
ok so I am trying to send this file though POST in cURL kopy.io/XAOzC.. making it an array doesnt work, making it a string like 'image=@' . $filename->name; wont work either
what am I missing here... i have multipart/form-data as the content-type
i still get this error: string(132) "{"errors": {"image": "An image file Missing required parameter in an uploaded file"}, "message": "Input payload validation failed"}
 
@Es0teric have you checked that the filename parameter in CurlFile has the full path?
 
6:18 PM
@Sherif yep I have
the endpoint is 'image' and it takes a value of a file
i mean the endpoint is /model/predict and takes a key
image and a value file
 
@Es0teric so its a URI i take it?
 
@Sherif Long time no see!
 
@Sherif yeah in a different container
i networked them so they work together just fine seperately... however, the problem is that I keep getting taht error when I send the cURL request
through that code
 
Does that even work? I dont know if CurlFile even does remote files
 
its supposed to
I can send it through POSTMAN error: string(132) "{"errors": {"image": "An image file Missing required parameter in an uploaded file"}, "message": "Input payload validation failed"}
but with cURL it doesnt work... also it works through the CLI so it should work through the web PHP part
@Sherif what do you think can be causing it not to work on the web though?
 
6:44 PM
@Sherif heap.space
it's in the chat description ->
@Ekin took over hosting it
 
@Tiffany thanks. Been looking for that one 😊
 
6:58 PM
@sherif do you have an idea of whats going on?
 
7:12 PM
@Es0teric not sure. My guess is it doesn't resolve remote files like fopen does.
@bwoebi really? Sounds odd. Why ALL
 
@Sherif well this is my updated code: kopy.io/Ydu25 and i still get the same error... now if I used the CLI, then the call would be this: curl -X POST "http://localhost:5000/model/predict" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "image=@534945_10152724318150291_596082225_n.jpeg;type=image/jpeg" the output that I have currently on line 18 is string(84) "image=@/var/www/html/wp-content/uploads/2021/08/IMG_0019-copy-43.jpg;type=image/jpeg"
i still do not understand why the error is still popping up when I have provided what it needs in terms of upload and key and value
 
@Sherif and if I used the CLI i would get a success message with the returned JSON output that is expected
 
7:32 PM
@bwoebi Probably should E_CORE_ERROR?
 
@bwoebi damn that almost seems retarded. Is this simply as result of hashing the entry in the same table?
 
Seems like right now it just fails silently and you're gonna have a hard time noticing that FAILURE return value that probably nobody ever checks
 
Hello people and nikic o/
 
@NikiC yes, I think so too
@NikiC well, took me 5 min setting a watchpoint on the first ini entry I added. But yeah, it's subtle
 
@Es0teric So what's the value of $file in that code?
 
7:41 PM
@Sherif /var/www/html/wp-content/uploads/2021/08/IMG_0019-copy-43.jpg
it is the direct location of the file
 
@Es0teric I don't know. Sounds like possibly some kind of wordpress thing? Perhaps some kind of race condition if you're doing something with the image in the same request? Maybe someone with a little more understanding of the innarda of wordpress might be able to help you out there.
 
@PeeHaa I'm not a people? :(
 
its a curl request man
it shouldn't be this hard to do
especially when I have the direct file location and all of the correct params
 
@Es0teric I agree. It shouldn't. But I'm just guessing here. Did you try doing sometging with the image in the request inside the wp api? For example was this code hooked into some kind of image upload request, perhaps?
 
7:47 PM
@NikiC lol I wondered if anybody else read it like that
I think you're people <3
 
@Sherif no, it was hooked on to add_attachment on a custom plugin I am creating... its literally after the image is uploaded
 
@Es0teric Right. Is it possible that maybe something in wp could be copying the file later after supplying the filename. I don't remember wp but iirc you could have some OOO execution between the hook and the actual processing of the attachment, possibly?
 
@NikiC maybe it just was a honorable extra mention :-P
 
@Sherif i mean i've passed the $filename which is a CURLFile object using the key necessary
 
@Es0teric I'm sure you're doing everything right in terms of the curl code there. What's not obvious here is what side effects wordpress has on your curl code. As you said once you remove the side effects all works. So my best guess is that somewhere between your curl code and wp doing its thing the file may not have been created yet under the filename you got from the wp api. Maybe check the manual or dig into wordpress.stackexchange.com to see if anyone's got any similar problems
 
8:01 PM
@Sherif I suppose... is there a room here in stackoverflow for wordpress?
i can try to use wp_remote_post() but idk
 
Not sure. Perhaps.
 
@PeeHaa Yo!
 
@bwoebi that cc @NikiC
@StatikStasis o/
 
yeah it doesnt work
this is the dumbest thing on the planet -_-
I think that if I use cURL on add_attachment hook it does not let me run it
actually... @Sherif do you know how to get this to work on guzzle?
 
8:40 PM

 The Loop

Where humor doesn’t work.
@PeeHaa people | nikic then?
 
8:54 PM
@PeeHaa thinking about it, people xor nikic would've been more ambiguous
 
9:12 PM
o/
:o I didn't even know REGISTER_INI_ENTRIES had a return value, and assumed it could not fail
I've never seen a single extension check that, it's used as if it can't fail ...
 

« first day (3943 days earlier)      last day (987 days later) »