« first day (2370 days earlier)      last day (2803 days later) » 

12:02
@Marvin what's the specific problem you are trying to solve, btw?
@Wes And how did that work out?
user1694691
@DaveRandom Two classes implementing a common interface but with different return types from the same method. I would have liked to have used a union return type on the interface and then restricted the return type on the classes themselves (covariance is cool).
Wes
Wes
@PeeHaa too much democracy is just as bad as no democracy - Plato
@Marvin When you say "different return types" do you mean that one of them is a variant of the other?
Wes
Wes
no that's bs.. that's not plato, i've just invented it :B
12:07
> too much democracy is just as bad as no democracy - Vladimir Putin
@PeeHaa better for python than it would've for php
please suggest any good tutorial for Line graphs
@PeeHaa it is probably true for Russia
@PaulCrovella I wonder what would happen if we would do a 2 -> 3 breakage
> Democracy is the worst form of government, except for all the others - Churchill
@Gordon there is more than one flavor of it, btw
@Linus I need to show that on web page
Wes
Wes
@PeeHaa democracy only works if everybody is allowed to vote, 20 persons can't be representative of the millions of php users... i haven't elected them
so is there any tutorial
Wes
Wes
in fact i would rather have a monarch whose opinion i trust :B
user1694691
12:09
@Dave The two return types inherit from a common interface but each has different extensions to that interface. It's not a disaster, I will just have to specify the return type as the shared interface and specify the more explicit return type in the class documentation.
@Wes Yes, but if everybody is allowed to vote it also means more idiots can vote now
Just look at your local elections
and there are way more idiots
Also s/persons/people
@PaulCrovella so much that
Wes
Wes
i'm not suggesting that that would work. just that perhaps having a leader would be better
@Marvin I would argue that a union type in that case would be code smell anyway (or possibly that what you are really looking for is generics, but probably not)
An interface shouldn't contain a union return type imho
user1694691
12:13
Yes, generics would be a more suitable solution. But they were rejected a while ago, for similar reasons, were they not?
Are two things returning completely incompatible things?
Or am I reading it wrong?
that's how I read it. Not completely incompatible, but not type safe
@Marvin I can't remember where the last generics discussion ended
user1694691
@DaveRandom You're probably right. It was just a thought as I was typing "I could write a union there" and then I remembered seeing an RFC about them and wondered what happened to it. It died, was the answer.
@DaveRandom It still stinks :P
I'm more on the fence about generics now than I have been in that past, they are really complicated and I'm not sure they belong in PHP
user1694691
12:16
They can simplify some complex domain models in userland.
They would be great in the specific case of collections but in most other places they would probably not be helpful and people would write hideous code with them
user1694691
can't comment about how complex the implementation is.
@PeeHaa that wouldn't be as bad for php. a big part of the problem for python was that all kinds of packaged utilities were written for 2, and that's a more difficult upgrade cycle to deal with
@Marvin sure, if a viable proposal came up I'd probably vote in favour of it
When using a variable inside while for a delete button with a value (id), how do I use that outside the while loop? Should I put the if(isset($_POST['delete']){} inside the loop ?
12:17
@PaulCrovella s/big part/almost the entire issue
user1694691
I understand that the PHP dev guys are having to balance extremely wide ranging user expertise and use cases. Not an easy task.
But yeah
@Marvin The big problem that PHP has with a lot of typing-related features autoloading, i.e. a lack of AOT resolution
That makes stuff like variance pretty difficult to do without killing performance
@Tredged it probably should be outside a loop .. but it is hard to tell, because your question i confusing. You seem to assume, that we can read your mind or something.
Hello Everyone
12:19
You either end up loading a bunch of stuff that you may not need just to verify types at compile time (perf impact), or you start throwing what should be compile errors at run time (high wtf factor)
That's not the only problem, but it's a big one
bigguns
@tereško I have a while loop what just shows a list of items, I want to add a delete button when pressing on it it deletes that specific line. but the problem is how I fetch the id that is posted outside the loop.
I cannot type.
user1694691
Yeah, sounds pretty knarly
!!urban knarly
12:21
[ knarly ] adjective: having a nature of intensity or magnificence; inspiring shock; extremely pleasing
i want to display lowest value from a range of value from a loop. Here is my code:
if($my_query->have_posts()) {
while( $my_query->have_posts() ) {
$my_query->the_post();
$city_id = get_the_ID();
$city_price = get_post_meta($city_id, 'property_price', true);
echo '<span class="space">' .esc_html($city_price). ' &nbsp; </span>';
}
}
user1694691
sorry, meant gnarly
the last echo show all the values, but i want to show only the lowest price. Please help. Thanks
@SajjadAhmad firstly, the if($my_query->have_posts()) is unnecessary
the while() is implicitly doing that for you
@Tredged why can't you came a separate "delete link"?
http://foobar.tld/item/42/delete
12:23
I smell wordpress
@SajjadAhmad kill it with fire before it lays eggs
@SajjadAhmad what do you want, the lowest $city_id?
@DaveRandom ok, but how can i show only the lowest value from the loop
@DaveRandom yes
What does $my_query->the_post() do? Does it output the post?
wtfpress
@DaveRandom No
12:25
@DaveRandom here is the page if you want to see the result: dxboffplan.com/test
the_post() sets up the post for the globals / functions
there is nothing about that sentence that I like
When I was like 7 we used to call farts "boffs"
@SajjadAhmad fix your query instead
@tereško Sorry
12:26
that domain looks like a management tool for scheduling farts
@PaulCrovella Me neither. WordPress \o/
@Sean wat
Yes
It's global driven development
What's jeeves' search command?
search what over?
12:27
Google
@SajjadAhmad OK, so you want the lowest $city_id or the lowest $city_price
I feel icky. make it stop :(
7 messages moved to Trash
@DaveRandom HAMMERTIME!
12:29
oh fuck off
thats why i am here i searched google but didn't find any help
So WP populates a global $post, which is referred to in functions like get_ID and stuff. Yeah it's icky af.
(Among other global variables)
i also posted a question but no one seems to answering the question.
lolwut the global is called $post?
2 mins ago, by DaveRandom
@SajjadAhmad OK, so you want the lowest $city_id or the lowest $city_price
@SajjadAhmad So.. the lowst value what.. price?
12:30
please don't make us do wordpress
yeah, i can't hang anymore. 'night y'all.
user1694691
@SajjadAhmad Do you have a code sample in the question? If so, link to the question.
@PaulCrovella :P Enjoy your WP nightmares
when I'm king of the internet, I'm going to banish wordpress, and might even banish people who use it ...
nn pual
user1694691
Is banishment enough? Kill it with fire, perhaps?
12:31
@JoeWatkins all i want is the php function to pick the lowest price from the loop prices
I ... don't care ...
$prices = [];

while ($my_query->have_posts()) {
    $my_query->the_post();

    $prices[] = get_post_meta(get_the_id(), 'property_price', true);
}

$lowest_price = min($prices);

foreach ($prices as $price) {
    echo '<span class="space">' .esc_html($price). ' &nbsp; </span>';
}
!!docs min
[ min() ] Find lowest value
@Marvin stackoverflow.com/questions/43367074/… here is my question on stackoverflow
@SajjadAhmad You want to look at codex.wordpress.org/Class_Reference/WP_Query and construct a WP Query object limited to one ordered by the meta key / value ascending.
Then you loop through the post (only one) and it'll be the lowest value.
That's less resource heavy than looping through every post object and pulling back each meta.
12:33
@Sean he is actually outputting stuff from each one currently
Oh right I see, I thought he only wanted the lowest from a set, if he wants to both output and get the lowest then yeah do what Dave says
user1694691
yeah, what Dave says
Listen to Dave
I want a T-shirt that says /dave/random on it, I might will buy one
I want one too
user1694691
12:38
I'm going back to my code now before I get wordpress-itis; who knows how many lives are lost each year.
Better check for weird spots
Wordpress hook publish_post work on local but not on remote server. what could be reason any idea pals?
@JoeWatkins Good catch! Fixed, thanks.
@ParthGoswami What is hooking into it? A theme or plugin?
First step is verifying whether whatever is hooking into it is actually hooked. Check the theme or plugin is enabled, check if the code which registers the hook is called.
Blog post. Whenever new post is created i want to send it's content over to third party api
1
A: save_post hook is not called when post is saved

Parth GoswamiSolve the problem by taking the alternative hook for save_post. Used publish_post instead & with higher priority & it worked function new_blog_details_send( $post_id ) { //getting blog post details// $blog_title = get_the_title( $post_id ); $blog_link = get_permalink( $po...

Here is the question
12:49
!!wordpress
@Jeeves i tried this but its not working
there is a separate SE site for WP
post it there too but no luck..
Still not working in remote server, works perfectly on local now
@ParthGoswami there is a plugin that will fix all your problems
12:54
Command '!!wordpress' aliased to '!!say wordpress.stackexchange.com/';
@DaveRandom can we make him randomly switch between the helpful SE link and the not so helpful uninstall plugin? ^^
thanks for perfect suggestion @Patrick will use it later on once done with this project
:-P
@ParthGoswami so the first thing to do is verify whether the function is being called or not, I would say
it could be that the hook is firing but it's not communicating with the remote server correctly
If I wanted to build a collection for time difference formatters, what would be the best way? Would I go horizontal with 1 class per format (problem being I don't want to use an interface to define a constructor method, but then there's no strict limitation that I only want to accept DateInterval objects)?
The heavy-handed (and so probably most wordpress-friendly) way would be to trigger_error('Hook handler function called', E_USER_ERROR); in the function
12:59
@Sean Why would you need a collection of those?
@PeeHaa Different parts of the site format time differences in different ways.
thanks @DaveRandom hoping it'll help
But none of those parts need multiple ones I assume
Nah, but there are different parts of the site which use the same format
I don't think you actually need a collection
13:01
One class, multiple methods?
Just use global
At least my spidey sense tells me you don't from what you are syaing
@Sean different classes but no collection?
Store them in $_SESSION
@Sean Separate classes but DI into whatever needs some implementation
13:02
or you mean something else by collection than we do :)
Sorry, when I mean collection I just mean a grouping of classes, not that I need to make some sort of Collection object
That's my bad
@DaveRandom is in a helpful mood today :P
@DaveRandom I tend to store my files in the database, then just eval on load
Gawd you are both terrible people and both from the UK
You should store them in apc, that will make it fast enterprisey
13:03
Coincidence? I think not
@Sean separate classes sounds good
With Jay that makes three
and three is a pattern
@Sean's surname is actually Spicer
lol
that's a terrible thing to say
13:05
1 min ago, by PeeHaa
Gawd you are both terrible people and both from the UK
Oh I guess I could just have formatFromDateInterval as part of an interface
Instead of trying to pass it through the constructor, yeah that was a dumb idea
You could just use functions?
but muh global scope and muh testing
You can test functions in isolation. And I don't know what you mean by global scope in this context.
13:09
^ that
Oh just calling non native functions inside other tested classes, would it be classed as coupling?
Yes, but it works and is a good trade-off.
You only need to decouple stuff if there is some value in doing so.
Coupling is only relevant if you might ever conceivably swap it out
Fair point
e.g. I don't decouple from using password_verify() for validating passwords.....because I don't swap out password implementations.
Unrelated, fuck eloquent.
Anonymous
13:12
@Sean I'm perfect in every way.
Except height.
Anonymous
No, you're abnormally high
Anonymous
s/ly high/
No no, it's quite normal for me to be high
ba_dum_tish_monkey.gif
Wes
Wes
13:14
@JayIsTooCommon check tuittah
tfw FUCK YOU VISUAL BASIC DIE DIE DIE
> php_Imagick.dll specified module not found
@DaveRandom How many Sievert of Visual Basic did you receive?
@Linus and ImageMagick from windows.php.net/downloads/pecl/deps
13:18
@bwoebi A fatal dose.
i have done that it's showing up in phpinfo but came as warning when i run php -i
@DaveRandom ugh
I have already emailed my boss telling him that either I rewrite the project or it doesn't get new features.
A rewrite in PHP? :-D
Could do, but it's currently a desktop app and I already have a bunch of relevant libs in .net, I could rebuild it in C# in like 6hrs
It'd basically just be winforms drag and drop lego GUI and wiring
Plus it's MSSQL-backed, PHP makes that way harder than it needs to
13:21
@bwoebi the correct measurement would we Banana equivalent dose (BED)
!!wiki Banana equivalent dose
@Gordon Sorry I couldn't find that page.
@Linus How about we start from the beginning; exactly what are you trying to do, what have you done, and what's not behaving as expected?
Banana equivalent dose (BED) is an informal measurement of ionizing radiation exposure, intended as a general educational example to compare a dose of radioactivity to the dose one is exposed to by eating one average-sized banana. Bananas contain naturally occurring radioactive isotopes, particularly potassium-40 (40K). One BED is often correlated to 0.1 µSv; however, in practice, this dose is not cumulative, as the principal radioactive component is excreted to maintain metabolic equilibrium. The BED is only meant to inform the public about the existence of very low levels of natural radioactivity...
That wiki plugin could really do with better fuzzy search
TYL: when you eat 35,000,000 bananas you'll die from radiation
13:23
Can someone tell me why pressing on this image doesn't activate my $_GET

<a href="?deleteId=<?php echo $row['id']; ?>"><input type="image" name="delete" alt="Delete" src="delete.png" height="20px" width="20px"></a>
I'm pretty sure you'd die from potassium overdose long before that, and that's still quite a long way down the list of things that would kill you if you attempted to eat 35,000,000 bananas fast enough for the radiation to have a meaningful effect
Anonymous
@Gordon I think something else would kill you before that
@Tredged ...because it's an <input>??
@DaveRandom @JayIsTooCommon that proves bananas are deadly
13:25
@DaveRandom LMAO, NVM...
Well the solution will be something similar to that then. But if you don't want to write the exact problem then how do you expect people to help you.
Anonymous
@Gordon you're a bit weird.
@JayIsTooCommon I feel insulted now
13:26
@go_oh you're a bit weird.
@Danack sorry for that i have downloaded php_imagick-3.4.3-7.1-ts-vc14-x86.zip copied .dll to ext folder and make entry for extension in php.ini and then i run php -i from cmd it gave warning couple of times but when i restarted pc then imagick ext is shown phpinfo
@Jeeves says the tweeting elephpant in a butler dress
Ok, so it sounds like it is working? Unless you're seeing an error?
yeah,scripts means imagick class can be loaded but still warning is shown
Shown where?
13:33
in cmd when i run php -i
So presumably for whatever reason, the directory that the dll is installed into isn't in the PATH environment variable, for PHP Cli.
@Linus do echo %PATH% and look to see if the ext directory is in there.
@Gordon I don't see anything abnormal there…
13:37
And if it's not, open a new command line window, and check again.
D:\xampp\php\ext it's there in path do i have specify dll file here ?
Shouldn't need to.
Wes
Wes
in ext\ you should see php_imagick.dll
make sure you are using the right version, like x64 TS
@Linus your PHP is trying to load them from the E: drive, not the D: drive.
So check the extension_dir setting.
Wes
Wes
took me 8 hours to write two assertions
just because i realized i needed 78 things for that
could only write 3
13:43
"E:\xampp\php\ext" it's mentioned in ini file
$this->assertTrue(true); $this->assertFalse(false);
Wes
Wes
@DaveRandom what's your secret?
@DaveRandom Failed asserting that false is equal to false.
Your face is false
that message is not because it can't find the extension, it's because it can't find the image magic dll (not the ext dll) I think
try putting that in the same directory as libssleay.dll or ssleay.dll ...
13:45
@Danack thanks will look into this maybe i am missing something
Anonymous
@Wes is that gem for easter?
"E:\xampp\php\ext" != D:\xampp\php\ext
Wes
Wes
it's only wed but well @JayIsTooCommon @PeeHaa
user image
8
@JoeWatkins I must say that a more informative error message wouldn't go amiss here, a full path that it's trying to load would massively reduce the amount of time I have spent on this sort of thing in the past
hahahahahah
omfg
13:47
that's typo Danack
@Wes haapee?
Wes
Wes
@DaveRandom too late
@Wes You had one task
Wes
Wes
lol
i did my task well
Anonymous
13:48
@Jeeves wake up you piece of shit
@DaveRandom you deserve everything you get for being a windows user
@Linus typos make figuring out what is going wrong be a lot harder. As joe said, you should also check that the ImageMagick DLLs are also in a place that can be loaded, i.e. in a directory that is in PATH.
@JoeWatkins Money? Bitches? Glory?
^3 @PeeHaa
meh I was slow
@Wes lol!
3 messages moved to Trash
Anonymous
13:51
is terminator disabled?
weird
dunno what's going on there
no exception logged
@FlorianMargaine this is what happens, when a project gets infested by SJWs. The only way to save such a community is to purge them, or the project becomes a shitfest.
Wes
Wes
imo it just legitimately refuses to tweet peehaa's face
Amp\Artax\TimeoutException @DaveRandom
Wes
Wes
13:56
ahahahaha
@Gordon lol
@Ekin ugh, that 2 minute timeout :-(
Yeah
That will be timing out on the fetch from imgur I guess definitely, otherwise the image would be on the local file system
Wes
Wes
eh sorry, it's a huge pic. should've resized it
but peehaa looked so majestic in fullhd
13:59
It's not that big
It's only 0.5MB
not big enough to cause that
I guess it's a networking issue the VPS host's network
Try again in an hour or two
ah :) thanks @Joe and @Danack
Anonymous
@tereško such a melodramatic cluster fuck
@JayIsTooCommon virtue signalling and oppression olympics ... this is what happens when an IT project goes "meritocracy is triggering"
14:08
@Gordon That Java hat looks weird but you wear it well
Wes
Wes
14:22
@JoeWatkins is it possible that the same object gets two different Z_OBJ_HANDLE_P?
@Machavity thank. it's not a Java hat though. It's the bunny ears of shame. We wore them at my last job whenever someone broke the build
Wes
Wes
lol
it drastically improved build discipline
@Gordon Ah. PHP has no cone of shame because YOLO
14:29
hahaha
14:47
@bwoebi Sure, I have a branch of amphp/stream using those updated interfaces: Message and MemoryStream, two rather simple classes. Socket in amphp/socket would then also use the same interface.
while (yield $stream->advance()) {
    $data .= $stream->getChunk();
}
Or just simply $allData = yield $stream.
@Trowski I like it, except:
        case self::COMPLETE:
            throw new \Error("The stream has resolved");
in getChunk()
if the stream has been resolved, it should just return the whole data
Wes
Wes
@Wes nope
didn't debug_backtrace have a context key, with all the variables in the call stack
@Trowski dunno about MemoryStream, it looks like just some squeezing of emit and receive … basically both ends of a same half-duplex stream available in one class … looks a bit like a breach of SRP.
@Trowski (it should return the whole data, once. And the Promise of advance() should return once a Success)
@Wes no.
Wes
Wes
yeah that was set_error_handler
yes. Don't use it there.
Wes
Wes
14:58
just saw the deprecation :P
;-)
Guys... help me T.T
how to find the php's lib (i;m using linux subsystem on windows)
have you tried turning it off and on again
i used phpcli, so of course, it did reloaded
do you not see in php -i ?
15:06
naah, dont have to do it, when do php -S, some error message shown up: PHP Warning: PHP Startup: Unable to load dynamic library '/mnt/c/xampp/php/ext/php_pdo_mysql.dll' - /mnt/c/xampp/php/ext/php_pdo_mysql.dll: invalid ELF header in Unknown on line 0
so it can't load the windows dll, right?
where to find the so files?
@bwoebi That happens only after the promise from advance() returns false, so getChunk() shouldn't be called again.
you probably should be using linux version for that
O_O what kind of weird shit are you trying to do
thought, TBH, I am not even sure, why are you bothering with that linux subsystem
get them using your linux distros software update tools, or pecl
15:07
cygwin seems like a lot less buggy solution, IMHO
@bwoebi Yeah… I dunno either… it was meant as a stream that could be extended that actually manipulated the bytes, but it's probably sort of pointless.
WSL it's probably apt, so start with apt search
but i've installed php-mysql and etc ._. it didn't work for laravel v1 T.T
or is it apt find? I don't remember anymore
not sure how any of those things are related
if you are developing, you should be using a VM
15:08
Well Laravel is atrocious and shouldn't be used by anyone, ever, so it's probably good for you that it's not working
^ there is taht too
done it ._. it did install those mysqls package but the laravel think it didn't loaded... T.T
laravel or php?
@bwoebi The class used to have much more to it, but that got lost somewhere along the way to where it just doesn't serve much purpose. :-(
@Leigh idk, just trying to run Php with specific lib on Linux subsystem in windows...
15:10
just dont
@tereško laravel... i think...
have any suggestion to run those laravel v1 app? my client's website uses that, and the code was really horrible T.T
i;m using windows and xampp didn't work.
you should be running your development server in a virtual machine
aww no...
preferably - virtualbox, but using vagrant is an option too
hmm...
is it the only option?
15:12
@Chris suggestion: use a fit-for-purpose environment
Not an experimental, broken, linux-on-windows environment :)
@Chris if you want it to reliably work - pretty much ... though using a dedicated miniPC or RaspberryPi might also be a good solution
:' ok, thankyou...
*cries* seems like i have to do more work than i suppose to be ._.
ok, thankyou guys...
@PeeHaa We need to find a good implementation.
@kelunik huh. What is there to implement besides pass this to openssl?
15:18
@PeeHaa The OpenSSL API does only exist in 1.1+.
What versions do the big distros by default now?
@PeeHaa We need to support 1.0.2 at least.
But I think also 1.0.1.
I am personally thinking about buying a NUC or BRIX to set it up as my "on the move" system, that could double as development server
15:36
PhpStorm 2017.1.2, new bug-fix update, is out! Fixed REST client and concatenated strings coloring. Read more: http://ow.ly/ThEL30aNGOX
@Trowski oh, misread, fine then.
@Trowski well, then we can remove it again actually…
15:52
@tereško you look confused?
@FlorianMargaine what about?

« first day (2370 days earlier)      last day (2803 days later) »