« first day (2084 days earlier)      last day (2879 days later) » 

12:18 AM
nn
 
@Trowski @NikiC tired of explaining the iterator_to_array() + yield from issue? Fine … I've added a caution-note to the documentation … svn.php.net/viewvc?view=revision&revision=339531
 
12:58 AM
do Closures count as a callable?
nm, I can do it as __invoke
 
 
3 hours later…
Adi
3:32 AM
morning
can you help me guys. i dont know what is wrong with this query
http://pastebin.com/5EBYF8N0
it says that mysqli_stmt_bind_param() expects parameter 1 to be mysqli_stmt, boolean given
and here is my connection query
$conn = mysqli_connect($mysql_host, $mysql_user,$mysql_pass,$mysql_db) or die($mysql_error);
 
4:10 AM
Say you're building a web application like a message board, in which you want to record the time when a message is submitted. There's no need to further process the date in any way. Is there any practical difference between getting the date in the application itself or generating it in the database? Is one method recommended over the other? If so, why?

$msg = "Stuff";

//Generating the date in the application
$currentTime = date("Y-m-d H:i:s");
$st = $mysqli->prepare("insert into messages (msg, date_time) values (?, ?)");
 
4:49 AM
Hello.
I need a little bit help in the Laravel
anybody is here can help me ?
 
just ask your question
 
0
Q: Not Able to get Auth::user->id in Laravel

Punit GajjarHere is my Controller. <?php /** * Created by PhpStorm. * User: ed * Date: 05/02/16 * Time: 09:33 */ namespace App\Http\Controllers\API\V1; use App\Certificate; use App\Country; use App\Film; use App\FilmExtra; use App\FilmFavourite; use App\FilmGenre; use App\FilmLike; use App\FilmView; ...

 
I think you been given the answer
got a new error.. and then required skype
 
i tried with with the all
but nothing is working
yeah lets skype
give me your skype
@RonniSkansing , give me your skype
 
give me your email
let's email
( ͡° ͜ʖ ͡°)
 
5:04 AM
personal emails are blocked here .
you can add me on skype
skype : punit.aavid
 
5:17 AM
posted on June 30, 2016

New Cyanide and Happiness Comic

 
nobody to help me ?
 
@PunitGajjar: It doesn't help when you seemingly haven't mentioned your problem (or at least not recently).
 
i access a remote linux server with windows and run mysql on it. i use putty to do so. now i am trying to run PHP scripts on the server , i have my service running on 3306 and using PDO to connect. in the username i add my normal username say 'abc' but then i get the error Access denied for user 'abc@'my_ip_address' , how do i ensure i add the username along with ip address of remote server not my local address
 
Did you grant permissions on that ip address?
 
i dont think i have given access for my local device ip address , but cant i use username along with ip address of the remote server
because while using putty i have no trouble accessing the database
 
5:27 AM
CREATE USER 'abc'@'ip-addr' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON some_database.* TO 'abc'@'ip-addr';
MySQL generates different users based on the ip address, you most likely granted permissions to 'abc'@'localhost', but not to 'abc'@'ip-addr'.
 
oh i did not know that, i thought username was independent of ip address
in that case i have to give privilidges yes
 
It's a little weird in the fact where both parts matter, the username and the address that you're connecting through.
 
cool i'll try that
 
It's been a long time since I've done serious work in MySQL, perhaps if someone verifies what I've said or provide a better response if I'm not correct or only partially correct?
 
isn't this a bug though, as an admin why would you want to restrict your user to access a database from particular ip address
 
5:31 AM
This is intended behavior, this prevents someone from logging in from a location you don't want them to.
Or rather from an interface you don't want.
I personally would not advise allowing connections on an address that goes out to the internet, just seems like a problem waiting to happen.
 
@MarkWeiman , i shared my question link if you have seen above
 
hi guys, got a weird problem. when I pass an array of 2 values to a parent method, the 2nd value always changed to NULL. I can circumvent the problem by copying method definition from parent class. But that's feels wrong. Is this a known bug, or is there any reference I can check?
The code:
https://ideone.com/DnyMaR (the problematic one, line 101)
https://ideone.com/r4mcmc (the copy-paste one, which work just fine)
Sorry to ask here, I want to post a question but confused on wording :|
 
@MarkWeiman worked thanks :)
 
5:46 AM
@avz2611: Awesome :D
 
btw is there a way to estimate amount of data given out in a query before query is run
 
@avz2611: Explain
 
@avz2611 you can technically add user as 'user'@'%', which will allow access from ANY host. But that's not recommended.
 
i was planning to have a server where we can sell some data , so i could charge customer based on data he requires , so if there was an estimate of data based on a query , i could give the customer an estimate charge
 
@bangbambang: I forgot about that.
 
5:49 AM
*portal
makes sense?
 
In what measurement are you doing this? Bytes? Rows?
 
bytes
but that can be expressed in terms of rows i suppose
 
I know there's a way to do it for an entire table, but as for a portion of one, I don't know what to tell you.
 
how do you do it for an entire table?
 
There's a database called information_schema and a table called TABLES that has a few columns with size information (not anything straightforward, but you can do some math).
Past that, I'm not sure exactly what you're supposed to do.
 
5:54 AM
all right i will look into it
thanks :)
 
After a quick DuckDuckGo search: stackoverflow.com/a/9620273/4386974
 
can't you do it with view and length()
 
length() would probably be something that one could use for that
I'm pretty sure it only works for strings though.
 
ah, yes.
there's also octet_length, and for the fixed size storage I suppose one can use predefined value.
https://dev.mysql.com/doc/refman/5.7/en/storage-requirements.html
 
Mornings (from work)
 
6:24 AM
o/
 
user6422350
Morning
 
morning
 
hey guys i had to created indexheader.php for index.php and header.php for everything else, and the main difference is that indexheader doesn't have session stuff, so is it possible that instead of creating 2 headers, is it possible to do something like this

if(included in index)
do stuff
else{
do other stuff
]
in other words can we tell header to detect where he is going to be included and based on that, can we change the stuff we want it to do?
please if you want to reply use @Lynob coz i have to go now, have a great day
 
7:10 AM
!!rebecca
 
@AnmolRaghuvanshiVersion2.0 Happy Prebeccaday!
 
moin
 
Anonymous
7:27 AM
jollow
 
7:38 AM
morning
 
Anonymous
\o
 
7:55 AM
@PeeHaa o/
You were dutch right?
 
he is, or he's faking it :)
 
Morning
 
towser: a big dog.
 
@Duikboot Lol, were / are. I'm Dutch too btw
 
Wes
8:18 AM
hodor \o
 
Most of you are NL i assume?
 
BE ^^
 
Finally cracked this morning. Been refraining from posting anything to do with politics but someone's FB post comments actually left me dumbstruck enough to do it.
Mornin'
 
What was the straw?
 
@Sean where can we watch the disaster? :D
 
8:31 AM
One of my old uni friends has been making a few kinda edgy posts recently about the vote result and the emergence of xenophobes. Queue a bunch of what I assume are older family relatives chiming in and spewing debunked points or attacking his character because he voted remain. Again, I wouldn't normally take part if even if the situation was flipped but christ these people have been at it in every single one of his statuses in the last week
Facebook's algorithms are trolling the hell out of me, clearly
 
'nin o/
 
Hey guys I'm wondering who here has experience writing CKEDITOR plugins #ckeditor
0
Q: CKEDITOR Image Properties Browse Button

KillrawrI have found a neat plugin for CKEDITOR called bgimage that allows a user to select a section of text and wrap said text within div and apply the background image style attribute (Background Image plugin should use Selected Text.). I was wondering how can I replace the Image URL with Image Brows...

 
Unrelatedly PHPStorm is getting slightly less confusing, but is still very confusing :V
 
I'm stumped, not sure if I should reverse engineer the button :o or whether the API Docs have single line I can write for it haha
 
@Sean what's confusing you?
 
8:35 AM
@Leigh Just getting used to shortcuts mainly, and figuring out what I can and can't do.
 
Does using an animated CAPTCHA such as on this page myclientline.net/publicS/publicServ/ClientLineEnrollment/… offer any real protection for an OCR bot? It's just an animated GIF so can't it just take the first frame and have a super easy image to solve?
 
Had a few issues with emmet markers not working, or syntax not expanding too
 
@Sean Is that the HTML shorthand thing? I don't use that :x
 
@Leigh Yeah, it's a beast for HTML and CSS. It's kind of hard to not work with it as much as I used to
for instance, in sublime, I could highlight text and hit ctrl + shift + g, and it would let me wrap the highlighted text around an emmet expression. I'm not sure if I can do that in PHPStorm
Ah you can. Ctrl + Alt + J, Emmet
Though annoyingly it doesn't focus on the expand box, so if you start typing it closes the input box. Argh!
/ramblethursdays apparently :P
 
Anonymous
@crypticツ Not super easy, but as easy as any still-frame image
 
Anonymous
8:52 AM
@crypticツ but still, if the OCR bot (which I have once tried) captures the gif at a weird angle during the animation, that could provide an extra layer of (security through obscurity) imho, since it may mistake the crossing letters for other letters.
 
Wes
@pinepain i have no idea honestly. i need to be on it to get an opinion. i haven't done much with weak references so far
 
@Duikboot yea
What's up?
@crypticツ I would say it makes it easier because if you cannot properly read the first frame you can just pick other frames
Also you can check whether most frames agree on the captcha
 
Mornigns
 
Anonymous
@PeeHaa it still does not make it 'easier'
 
Anonymous
9:12 AM
o/
 
@samayo It does in my mind. Because if a still captcha cannot be read that's it. But if a frame in the gif cannot be read you can still try another frame
 
Gon
Moin
 
morgen
@samayo it's all based on how I think it should work mind you
 
Wes
@JoeWatkins would it make sense to have block assert?
assert{
    $foo = bar();
    $baz = $foo ?? $this->stuff();
    return $baz !== 'bar';
}
 
/me still doesn't like asserts :P
 
Anonymous
9:18 AM
@PeeHaa Captchas can't be read? I think they do.
 
programmatically read
 
Anonymous
it looks like a hack @Wes
 
Does your assert often @PeeHaa?
 
classy
 
Ah-thank you
 
9:20 AM
:)
 
Wes
@PeeHaa i use it in place of checks that can be skipped in production (non-exceptional exceptions)
assert($this->veryIntensiveCheck(), new Error("Wat"));
 
Yeah I get that. @bwoebi and @kelunik already tried to open my eyes. (To no avail)
 
Gon
:P
 
Wes
:P
 
@PeeHaa Hm?
 
9:27 AM
I think I either didn't have a good use case for it myself or I'm just to stupid to see it
 
@Wes wat
no, it should be used when you want to assert that your private contracts that should never be broken are not
e.g. $foo = FooFactory(); assert(get_class($foo) === 'Foo');
 
@kelunik You guys tried to explain to me why assert was a nice solution for you in aerys (I think it was)
 
@Sean I ought to write this clearly in a blog post....but most social sites have algorithms/designs that deliberately try to drive "engagement", which is another way of saying they deliberately provoke fights.
 
Wes
anything non exceptional could be an assertion @PeeHaa. basically errors that are not supposed to be handled within code but rather fixed by changing the code
 
@PeeHaa @bwoebi maybe. I usually use real checks everywhere instead. @bwoebi overuses it, where there should be actual checks IMO.
 
Anonymous
9:29 AM
@PeeHaa mind getting your comment off that answer. PLS
 
@Wes Yes but those are either normal checks and/or where missing handled by unit tests
 
Wes
@FlorianMargaine is this different from what i've said
 
sbi
@Leigh They are based in Berlin and Sevilla, so remoting might not be impossible in general. Not for this offering, though. /cc @Adil
 
i see @sbi
 
sbi
@AdilIlhan Were you considering moving to Berlin?
 
9:30 AM
@Wes yes, you're just saying $this->veryIntensiveCheck should return true
 
@kelunik Hmmm odd. I seem to remember you were on bob's side. :)
 
@sbi i would move to Berlin.
 
In that case I just blame @bwoebi :P
 
Wes
@FlorianMargaine so what?
 
@PeeHaa He wanted to use assert to check for header injections first.
 
sbi
9:32 AM
@AdilIlhan OK. And is Adil Ilhan this your real name? (If so, I'll tell him that you'd be willing to relocate.)
 
@samayo Which one?
@kelunik Yeah that seems to be ringing a bell
 
@sbi yes, it is my real name. Also, this is my linkedin: linkedin.com/in/adililhan
 
Anonymous
@PeeHaa first one.
 
sbi
@AdilIlhan OK, I'll send them a mail.
Bye!
 
Wes
@PeeHaa but once your unit tests tested that the program works fine, you won't need those checks anymore
 
9:33 AM
@sbi thanks
 
@samayo Sure. Can you incorporate it into your answer?
@Wes And the tests are not in production
Nor are the asserts running, but they are actually cluttering the code
 
Wes
for example type declarations could be assertions. once you are sure all data gets linked together properly, type declarations checks could be avoided entirely
 
Anonymous
I can't, because it's not true. PDO::quote() does not prevent mysqli injection in the same way mysql_real_escape_string(). Which is what the user wants to know.
 
@samayo Why not?
prepared statements don't prevent sqli at all like mysql_real_escape_string
PDO::quote is a lot closer then PDO::prepare
 
Anonymous
9:36 AM
@PeeHaa then, that's why. With pdo::preprare() you don't need it.
 
Anonymous
preparing and escaping ..
 
Anonymous
it's a waste of resource
 
If you really don't want to update the answer fine by me.
The comment stays
My comment together with @YourCommonSense's comment about me being wrong tells the whole story
@Wes type declarations assertions?
You only confuse me more now :P
Worth noting I'm terribad at understanding things until I needed / implemented it myself @Wes :-)
 
Wes
@PeeHaa yes. it is kinda lame having types checked at runtime. they should be checked only during testing, or statically
 
@Wes Well that tends to be impossible in some cases
 
9:40 AM
@Wes no, these should throw exceptions
not assertions
 
Wes
in php yeah.
 
In everything where you are working with dynamic data
 
that's what I meant, it's not making sure your arguments are correct, it's making sure your assumptions about your internal methods are fine
assertions are about assumptions, not about validations
 
is possible open a link added to homescreen on my android device by url in php?
 
Gon
I spent some time writing PHP5 code... and now I'm again back to PHP7 and most of the time I'm now forgetting to use type hints...
 
9:42 AM
Jun 15 at 17:52, by PeeHaa
yesterday, by PeeHaa
Type hints is something that is really hard to get rid of
s/hints/declarations :)
 
Gon
that was a problem I faced while writing PHP5 code...
 
Wes
function test(){
    $function = function(string $bar){}; // this check gets executed all the times
    $function('string'); // even if it's impossible that it receives anything different from a string
}
test();
@FlorianMargaine define "internal methods". everything is private to something else
 
17 mins ago, by Florian Margaine
e.g. $foo = FooFactory(); assert(get_class($foo) === 'Foo');
 
Pro-tip to speed up Google searches: disable all JavaScript from http://google.com/.de/etc.
 
Wes
@FlorianMargaine you are missing something imho. type declarations are invariant checks and therefore assertions. and i didn't invent it, for the record
anything that is not exceptional (the behavior is always predictable) could be an assertion (even if it's unlikely that one wants it to be that way)
 
Wes
oh today we are enjoying portugal get crashed by poland? :P
 
Today?
Wasn't that tomorrow?
 
Wes
9pm, our timezone
 
Nice
 
Wes
nope, tomorrow galles belgium
i really hope wales wins, but yeah.. it's pretty hard
 
9:55 AM
Surely wales will beat belgium
They had their fun
Too bad for you italy will go home saturday
 
Wes
yeah
we had the hardest route this year, belgium, spain and now germany. we're are going to lose for sure :(
 
Are there any useful courses/education opportunities to learn something useful? Symfony certification was suggested by my company but I kinda doubt that I would learn something useful there. I was thinking more in the direction of architecture/ddd/event sourcing and similar topics.
 
@Wes see it the other way: if you managed to beat belgium and spain, why shouldn't you be able to beat germany as well.
 
Wales <3
 
Wes
because germany is way stronger than both belgium and spain? :P it just is...
 
10:06 AM
Why not, please — Mr lukas 2 mins ago
Wow. That's one persistent vampire
throws garlic and a cross
 
Wes
@Gordon why isn't anybody in germany telling Löw to not smell his armpits or touch his jewels while on worldwide live tv?
 
@Wes they did
 
@Wes C'mon they did
:)
 
Wes
why keeps doing that then :P
 
@Wes passion
 
Wes
10:11 AM
you'll be sad to hear that we have a comedy tv show in italy that has actual cameras on the field always targeted to low just to spot him when he does that
and it's basically 90% of the show xD
 
it doesnt surprise me at all
 
@Wes looks like you're watching it.
 
Wes
indeed. it's hella funny
 
Anonymous
@PeeHaa xD
 
Wes
10:15 AM
lol
 
yay
=)
vacation ETA 28 hours
 
:P
nice
 
@RonniSkansing vacation ETA in 4 months \o/
:P
 
Anonymous
vacation ETA in ... Never!!
 
10:28 AM
I have a question..
 
Anonymous
alternatively ... get old and die
 
OOP related, someone here's good at OOP coding?
 
Anonymous
Ask it first then, we'll see.
 
Well, I'm building a CMS and I use autoload for autoloading the classes. I also have a route function which loaded the pages etc. But when I load the pages with the defined variables it tells me
variable x not found
 
How is this related to OOP :)
 
10:31 AM
it's like:

<?php
 
Anonymous
Because he is using auto-loading silly :)
 
Oops wait
I will upload my code to pastebin
 
Anonymous
Make sure to let us know, where (in file) the variable x declared, and from which file are you are calling it.
 
Yep
Wait.. I think I found the error, it's because I include the files inside the class function.
 
so, you are good at OOP coding
 
10:37 AM
In every page I have to use the global
Don't underestimated my skills mate :p
 
@C0dekid No you certainly don't
On the scale of OOP laravel_____|global_____|_____|_____|_____|_____|_____|_____|____OOP
5
And yes I just made up that scale
 
@PeeHaa If I don't do that, the page will return that the variable is undefined. I don't want to use third-party frameworks such as laravel etc :P
 
You have a scoping issue which need to be fixed
You don't want to use a shotgun to kill a fly in your house
 
It seems you didn't play Fallout (bogleech.com/nature/fallout-bloatfly.jpg)
 
:P
 
10:41 AM
@Sigismund I can see your point :P
 
.. or it's a bug in PHP7.
 
No it is not
 
h
oh
 
It's a lack of understanding of OOP variable scoping
Can you share your isloated problem code perhaps?
 
No that is it not.. maybe i'm just tired and overlooked something
hold on, upload it to github
 
10:43 AM
kk
 
@PeeHaa No, isolation isn't possible with Laravel. :P
2
 
hahahahah damn that's just too sharp for this time of the day :D
 
"laravel" should be banned as offensive word in this room
 
YOU ARE LARAVEL!!
Laravel as a bad word
 
one of the biggest data mess i got is due to how they transparently did db reconnect on dead connections
 
Anonymous
10:50 AM
@pinepain laraturd is the framework, and laratards the fans.
 
Anonymous
Though, I'm just going with the crowd in here, as I haven't seen how bad Laravel is.
 
we had a long-running script which did some weird things on db, ab. 600Gb of working data set, so we run operations in transactions to keep things consistent (don't tell me about foreign keys, I'm aware of them). So after 30 min of running db connection timed out and laravel abstractions SILENTLY did reconnect. Who cares about transactions?!
 
Anonymous
@C0dekid You have a class called just a ?
 
while choosing laravel for legacy app was not a wise idea, I can't even express PITA size we've got after someones poor decision.
 
Anonymous
10:53 AM
How lazy are you?
 
yes
 
@C0dekid
I smell inclusion, file inclusion :)
https://www.owasp.org/index.php/Testing_for_Local_File_Inclusion
 
It's personal reasons
:p
 
Yeah that is a pretty huge security hole right there
 
Anonymous
There is no personal reason to do class a {} ..
 
10:54 AM
sighs, that is not the main reason it won't work :P
 
!!docs variable scoping
 
[ VARIANT class ] VARIANT class constructor. Parameters:
 
Fick you @Jeeves
^ that's your problem
You are defining a variable outside of the class/method and expect it to be available inside tyhe method
 
Thanks
 
10:57 AM
@PeeHaa I admit that I've overused it … It was a nice PHP 7 feature… I had to use it!
 
@C0dekid You need to either pass the data into the constructor or into the method
@bwoebi :P
tnx for being honest
Also you should never be using the superglobals directly in your classes like that @C0dekid
 
Anonymous
@pinepain Ah, so you finally fixed the issue :)
 
$page = ((isset($_GET["p"])) ? htmlentities($_GET["p"], ENT_QUOTES, "utf-8") : "");
 
user3119231
Hey, I have an SELECT query for a fulltext search which contains several LIKE's. The problem is that I need to LIMIT specific rows. If I do a direct LIMIT it only searches in the limited rows... I need to search in all rows and just return for e.g. 30 rows . Any hints?
 

« first day (2084 days earlier)      last day (2879 days later) »