« first day (1156 days earlier)      last day (3806 days later) » 

12:00 AM
They don't even follow the html5 semantics. So I don't think that they have so much security.
 
then just run it from a vps?
 
@astinx lol, I hope you're not being serious here.
HTML semantics in general are pretty meaningless, they're nice, a toy, something to feel good about. In truth HTML is pretty unimportant, much less than the code on the client and on the server.
 
@astinx the other option is to just run the script slow enough that nobody will notice. This is the best way to do it if possible because you also won't put a lot of stress on the servers. Google for example you can get away with it if you scrape really slow. If you try to do it fast you'll get a temp ban.
 
@BenjaminGruenbaum Oh I didn't know that. I always thought that a properly use of the html5 conventions will improve the seo in the site.
@Patrick I tried it, but seems that some sites count the request attempts, even if I send each request every 5 seconds.
 
@BenjaminGruenbaum i really do feel good about when the semantics fit
 
12:07 AM
@Patrick or, you know, use the api.
 
if they have one, yeah definitely. But I'll shut up now about this, too easy to switch into grey areas here ;)
 
But adding schema and such makes me feel even better
 
@RonniSkansing -_-'
 
haha
iknow, irony is a poor man tool... well back to the books
 
12:35 AM
Lousy DomDoc and Xpath making me feel stupid!
[childNodes] => (object value omitted)
 
Im turning in have a nice one
 
/me dumping random links
 
1:06 AM
Hey guys, I need help with a PHP question related to Regex. Can anyone help?
 
@ProgrammerGirl Have none of the responses fixed your issue?
 
Nope. :( I only received one, but it's not really a solution to the problem.
 
@ProgrammerGirl I'm not sure if this will help but you might be able to work off it stackoverflow.com/questions/6009415/…
 
pce
@ProgrammerGirl ..and this is allowed http://mynumber/+123456 ?
 
@user2981256, thanks, but I tried to use the ?! operators to not match a URL, but couldn't get it to work.
@pce: It would be allowed if it were part of a valid URL. (Regex for valid URL can be found here: stackoverflow.com/a/8234912/869849)
 
1:17 AM
Have you tried to check that the text doesn't start with http?
That would be an easy solution
 
@user2981256: I suppose that could work, how would I do that?
 
@ProgrammerGirl I'm not exactly sure. I took a guess on what you could do
@ProgrammerGirl What are you using this for?
 
On one of my sites, I use preg_replace to automatically remove phone numbers. However, when users post URLs that contain a sequence of numbers, my site is removing those numbers too and breaking the links. That's what I'm trying to fix.
 
What site?
 
Can't say due to disclosure limits, unfortunately.
 
1:24 AM
A corporate?
 
But this problem has been creeping up more and more lately, and I just can't figure out how to fix it.
 
m59
2:18 AM
Hey, I think someone is binge upvoting my answers, which is cool for me, but I think they'll get in trouble for that...I also don't want to be accused of anything. What should I do?
 
Nothing, It'll be reverted automatically if there's a need for it..
It's fake internet points, no one really cares that much...
 
...............................................................  63 / 358 ( 17%)

..............................................SSS.............. 126 / 358 ( 35%)

............................................................... 189 / 358 ( 52%)

............................................................... 252 / 358 ( 70%)

............................................................... 315 / 358 ( 87%)
Good enough for one day
night all
 
Here's @bjori, everyone pretend you're asleep.
Goodnight @PeeHaa
 
...or working on integrating user group info into php.net
 
m59
@webarto it was potentially 80 points :'(
I guess I'll just take the complement and if I lose the points, so be it.
 
2:31 AM
i need help, i just updated my PHP to latest version now all my scripts won't work with PDO keeps saying PDO class is not found, i did a check on my server check it was all there and i got :

# php -m | grep -i pdo:
PDO
pdo_mysql
pdo_sqlite
so im out of ideas on why pdo is not working anymore =/
 
Can you show code where PDO is instantiated?
 
sure i start a connection like this

<?php
	$dsn = 'mysql:dbname=testDB;host=127.0.0.1';
	$user = '[hidden]';
	$password = '[hidden]';
	try {
		$pdo = new PDO($dsn, $user, $password);

	} catch (PDOException $e) {
		echo 'Connection failed: ' . $e->getMessage();
		exit;
	}
its this line : $pdo = new PDO($dsn, $user, $password); where it fails
 
Could it be that your CLI is running differente version of PHP?
php -v
Try apt-get install php5-pdo if nothing.
Or, maybe, web server is not loading PDO... I think you should run phpinfo() and see if PDO is loaded there.
 
ill try phpinfo() first
lol disabled for security reasons xD
thats new
 
Pfffffft.
@bjori :)
 
2:42 AM
@webarto what am i looking for with php -v
 
Confirming it's the same version as you expect.
 
PHP 5.4.22
installing php5-pdo gives apt-get: command not found
 
yum install php5-pdo
 
will this overwrite my previous pdo installation
No package php5-pdo available.
Error: Nothing to do
 
3:04 AM
Not sure, google it.
 
Can anyone assist me with a PHP error?
 
don't ask to ask - just ask
 
I get an error when I try to use my log in form
Fatal error: Call to a member function bind_param() on a non-object in /home/u378761662/public_html/login/login.php on line 5
 
man, you left your username and password in your script
 
Opps
 
3:13 AM
:P
 
2nd time i've done that in less then an hour
<?php
$con=mysqli_connect("x","x","x","x");
$sql = "SELECT username, pwd FROM users WHERE username=? AND pwd=? LIMIT 1";
$stmt = $con->prepare($sql);
$stmt->bind_param('ss', $_POST["username"], $_POST["pwd"]);
$stmt->execute();
$stmt->bind_result($username, $password);
$stmt->store_result();
if($stmt->num_rows == 1)
{
echo "you are logged in";
}
 
@user2981256 have you checked the $_POST hold any thing
 
Can you elaborate a bit? I'm new to this
Anybody?
 
simply do this for now:

<?php
echo $_POST['username'] .'<br/>';
echo $_POST['pwd'];
?>
if you get nothing showing
then they are not set
 
So just use the code above for the whole script?
 
no im trying to explain that if you query $_POST['username'] but $_POST['username'] has no value it is like saying WHERE username = AND pwd =
 
So I should replace the "?" with a location? I'm sorry if i'm making it harder then it really it
 
I'm trying to use the value that I'm looping through in a foreach loop as the index of another array. I tried several variations on: foreach ($foos as $foo) { $bar['{foo}']; } with no luck.
 
@Dave ^^
 
user895378
4:21 AM
@PeeHaa Nice! But what happened to all your "E"s? Is your code no longer "Excellent?"
 
I can't wait to see reactions...
 
user895378
Nevermind, need to keep that under wraps.
 
:P
 
user895378
people are going to lose their minds when they see what php is capable of as a language (and not as a web framework)
 
php is a blessing and a curse at the same time
reputation is ruined by wordpress programmers etc
rare are those that are aware of capabilities
@rdlowrey change the public email on GH to @php.net so they know you mean shit when they visit your profile :P
 
user895378
4:37 AM
Oh, good point.
 
user895378
@webarto Is it possible to send email from a php.net address? Probably not, right?
 
@rdlowrey Why not? :)
I mean, no.
 
Can I buy a php.net email addy for 500 rep?
 
Go to Accounts on Gmail, add @php.net and just verify it @rdlowrey.
 
user895378
woot!
 
4:39 AM
Then you'll have an option.
When replying to a message:
x Reply from the same address the message was sent to
Check this too.
@crypticツ it's not that cheap :P
You can't buy one!
It has to be from heart.
 
@webarto but my heart is so cold =o(
 
Keep it up, and this time next year ;)
Hm, you're my age...
You'll need to be @rdlowrey age... so that's like 10 years...
And then, when you grow up, you can get Documentation karma :P
 
user895378
Yeah, it's an old guy club.
 
user895378
You have to grow up first.
 
I feel young when I'm with @rdlowrey
That sounded gay.
 
4:44 AM
@webarto that's what she said
 
user895378
@crypticツ lol, perfect.
 
and ran away
@rdlowrey wiki.php.net/rfc/phpdbg vote damn it
 
user895378
winner!
 
You just deflowered voted!
\o/
 
user895378
Hmm ... I kind of expected it to last longer.
 
4:47 AM
rdflowery
6
 
user895378
And I didn't know there would be so much crying.
 
user895378
@webarto this is fantastic. I'm stealing this.
 
:D only f is missing
 
user652649
/me has just successfully used for the first time finally{}. clap clap clap clap clap thank you, thank you, you are so kind, you're making my eyes water
 
user652649
 
user652649
4:51 AM
morning every one
 
morning :)
 
user895378
mornin'
 
user895378
@Wesabi 5.5 is really great, isn't it?
 
you got deflowered to use finally for first time :)
I want to make kids with yield.
 
user652649
@rdlowrey and i also used Myclass::class already! :P very useful
 
user895378
@webarto yield is thebomb.com
 
user652649
@webarto suspiciously stackoverflowish
 
Ameeeen
@Wesabi I don't know what you're talking about
/me git commit --ammend
 
user652649
 
</sarcasm></irony>
 
user652649
4:56 AM
xD
 
It's not like they invented it...
 
user652649
@rdlowrey i didn't look to that yet, going to check it now
 
hello can someone help me figure out why my JS is not loading?
 
Morning
 
morning
 
user652649
5:05 AM
@rdlowrey it's surely handy but what about non native arrays? it would be nice that when method return type will be implemented yield will understand it

public function ArrayObject getValues(){
yield 1;
yield 2;
}

^ returns ArrayObject instead of array()
 
user652649
(i often use ArrayObject, yes i do)
 
user895378
Well iteration is just okay ... co-routines are where the real power is. I highly recommend @NikiC's original blog on the topic
 
Please can someone assist me with JS... its regarding loading it in WP
 
@LJ-C Ask a question on main site.
 
5:08 AM
@rdlowrey Do you have a date yet for when you're 'going public'?
 
user652649
@rdlowrey got it, so it's about performances... and that's really welcome indeed
 
user895378
@Danack My plan is to share repo access with more and more people (basically room 11 peeps) over the next month. I'm on schedule for that. Then I have to lockdown documentation on everything. I don't want to "go public" with it until everything is really tight though so I can maximize "the splash."
 
user895378
@Danack gist.github.com/hgfischer/7965620. My numbers are equivalent to the go-lang benchmarks in that gist on equivalent hardware, so it's pretty exciting :)
 
user895378
Right now I'm about 2/3 of the way through a major rewrite that I've been working on non-stop since Wednesday ...
 
@rdlowrey Good idea. Keep it toight, like a tiger.
 
user895378
5:13 AM
At this point I'm basically just eliminating stray WTFs and really simplifying the API so things are as easy as possible to use.
 
user895378
But there are still a few dodgy things I need to fix ... like the reverse proxy functionality is a bit wonky and the remote initiation of hot-upgrades without downtime is still unfinished. All the outstanding issues are things that aren't difficult to fix but they all take time so it's just a constant process of chipping away and adding tests.
 
Well I hope we get it as a nice christmas present - tbh you probably don't need to cover every possible use case. So long as something solves some use cases really well, even if there are other use cases that it doesn't satisfy, people will still be wanting to use it.
 
user895378
Well I'm headed to New York on Christmas day for a week and my goal is to give any room 11 regulars who want to play with it access by then.
 
user895378
Then hopefully people will have useful feedback going forward and it should just be a process of tightening things up.
 
Yis. Get it very toight.
 
user652649
5:30 AM
@rdlowrey urm... is yield like a "shortcut" to implementing a custom Iterator/Traversable or there's more ?
 
user652649
i'm still reading nikic's post anyway
 
user895378
@Wesabi well it can be used as a "shortcut," yes. It eliminates all the boilerplate code of having to explicitly write Iterator methods like key() and current(), and friends.
 
user895378
It's also like a just-in-time thing so you don't have to load the full contents of the traversable structure in memory before you start traversal. Each "element" can be loaded into memory only when its needed.
 
user652649
yes but that's possible also with the plain Iterator right? current() -> return $this->rs->fetch_object()
 
user895378
Yes, but not with arrays ... the usual example is range()
 
user652649
5:34 AM
ah, i see now
 
user895378
The co-routines stuff is a bit difficult to understand at first (or it was for me). But it's extremely powerful. For example in the server I've been working on generators allow me to interface with non-blocking libraries for real-life multitasking:
 
user895378
function multiAsyncResponder($request) {
    $x = 6; $y = 7;
    $result1 = (yield 'asyncMultiply' => [$x, $y]);
    $result2 = (yield 'asyncSubtract' => [$result1, 25]);
    $result3 = (yield 'asyncMultiply' => [$result2, 2]);

    yield "<html><body><h1>Async! All of the things ({$result3})!</h1></body></html>";
}
 
user895378
And what happens there is when that function is invoked the server functions as a scheduler. When the individual async operations return values the server passes those results back to the generator function so it can continue processing.
 
user895378
And that's an infinitely nicer approach than falling into callback hell.
 
user652649
that's going to be hard to understand xD
 
user652649
5:40 AM
what do you mean with async operations? do they exist in php?
 
user895378
Way too large of a topic to go into right now ... just play with generators for now :)
 
user652649
:P i will not give up
 
user895378
@Danack Actually I lied -- those benchmarks are not equivalent. Raw go is ~30% faster than my server ... of course the vanilla go server doesn't do anything fancy like virtual hosting or websockets or really anything other than churn out http responses on a port as fast as it can so the perf difference doesn't really mean much. Aerys is still much faster than any of the nginx things in that link.
 
user652649
5:56 AM
awesome that phpstorm supports php 5.5's syntax already :o
 
user652649
if it were eclipse or netbeans...
 
user652649
 
6:28 AM
@Gordon You're probably still quite busy - but are you going to put your RFC to a vote soon? wiki.php.net/todo/php56#timetable
 
 
1 hour later…
7:39 AM
kids are so unreasonable ...
 
user3010322
8:04 AM
I'll be they are.
 
@ThePhD you can ping @rdlowrey about websockets if you'd like.
@JoeWatkins what's up?
 
user3010322
You know, you didn't have to blow my cover that badly.
 
user3010322
I was going to leave my message there and then lerk for a million years.
 
hah
The people in this room are actually nice, mostly.
 
That is, until you mention Wordpress or Codeignitor
 
8:07 AM
now, there's something you don't see everyday ... or even every 100 years ...
morning @BenjaminGruenbaum
 
@JoeWatkins the snow here was crazy, we were stuck without electricity for a day. Was fun though
 
we've not had any yet ...
 
We only have snow once a year if we're lucky. This was the biggest storm in 20 years
 
I usually look forward to snow, not this year, my car's not on the road, I'm using a shitty ford focus and it slides about like it's on ice skates just in the rain ...
> My PHP Won't hash, any suggestions?
what does that even mean ?
travis is providing hhvm by default ... there's already one bug report saying we should do things like hhvm ...
they obviously don't realize just how many arguments they are going to cause ...
 
user3010322
And the walls will shake.
 
8:26 AM
@JoeWatkins php
 
I'm not sure you can describe co-routines as asynchronous can you ? as far as I can see nothing is asynchronous when using co routines at all ... I'm a bit confused that niki said they could be used for asynchronous multi tasking
 
no, of course not.
co-routines are not asynchronous by nature.
 
co-routines however are a clever way to write something similar to a state machine
one sec, I explained it to someone in the JS room yesterday.
 
well I know what they are, I don't know what other people think they are ...
> The really cool thing about all this is that the resulting code for the tasks looks totally synchronous, even though it is performing a lot of asynchronous operations.
 
8:27 AM
@JoeWatkins generators are just state machines. When you add something that waits for i/o to complete to progress the state machine you get an async function, that does indeed let you write async code synchronously
 
user3010322
Hm.
 
user3010322
4 KB should be large enough for a Web Socket Request.
 
user3010322
Ahh, I'll just make it 32 KB.
 
@JoeWatkins They require a library that can themselves be done async - e.g. this can be put inside a co-routine php.net/manual/en/mysqli.poll.php to allow the query to be done async.
 
that's not asynchronous, it's non-blocking
 
8:31 AM
@JoeWatkins exactly. Code that'd be coded asynchronously because it's non-blocking is now coded synchronously but does the same thing that is classically asynchronous.
 
In this case - is there a difference? Run a query, go away and do something else, come back and get the results.
 
yeah there kind of is, it's important to remember that PHP cannot do anything asynchronously, at all .. take the state machine example, built from non-blocking calls the machines state cannot be advanced by two execution units, that's what asynchronous means, with nbio the machines state cannot be advanced in multiple directions at once ...
 
@JoeWatkins Yes "They require a library that can themselves be done async"
 
@JoeWatkins that's right, it doesn't solve everything, you need tasks too :)
 
the difference between an asnyc and nb query is pretty obvious, an async query can actually do something with the data it requested, an nb query cannot ...
 
8:35 AM
or promises with promise.all etc
 
<?php
class Query extends Stackable {
	public function run() {
		$result = mysql_query("SELECT ALL THE THINGS");

		while (($row = mysql_fetch_assoc($result))) {
			/* this is dealing with a query asynchronously */
		}
	}
}
?>
when you say to people that their PHP is asynchronous they expect their php to be asynchronous ...
and it isn't, and cannot be ...
hehe that's pretty funny that FSF repo
bugs.php.net/bug.php?id=66283&edit=2 minus 100 internet points for posting your mysql password on bugs.php.net ...
 
8:56 AM
@JoeWatkins it's ok, he'll change the '2013' part in password to '2014' in a few weeks =oP
 
he emailed me asking to delete the comment from the report ...
guess you can't delete from codepad
which seems odd
 
that's why I like using secret Gists for my code. Not indexed, people can comment, and I can delete it afterwards.
I don't know why he asked you to delete the comment, simplest and most logical thing to do since password is compromised is change the damn password.
 
any useful online service that'd echo POST data to me or do I have to upload one?
 
9:12 AM
I want the other way around, but thanks
 
@BenjaminGruenbaum httpbin.org
?
 
ty
@zerkms beautiful, thanks
 
9:38 AM
hi
 
in PHP Internals, Dec 11 at 10:54, by Gordon
guys, I'm terribly busy atm. Any of you willing to put the Automatic Property Initialization RFC into voting for me?
 
hi
 
@Gordon you have time until mid february to put it in vote
 
@randomdev you are likely getting an empty response from server, so I suspect you are either not sending a valid referrer or an empty user-agent
most servers will do that for hotlink protection and to stop scrapers.
 
I am new to word press and i am getting "Warning: POST Content-Length of 8829968 bytes exceeds the limit of 8388608 bytes in Unknown on line 0" while uploading a template
please help me out
 
9:43 AM
@randomdev ^ I don't see any get here?
 
@bwoebi beat me to it =oP
 
user652649
@Chandan change these values in php.ini
post_max_size = 20M
upload_max_filesize = 20M
file you are trying to upload is too big
 
I did it to max_file_uploads = 2000; upload_max_filesize = 200M and post_max_size = 20M but still getting this error
 
user652649
upload_max_filesize = 200M
post_max_size = 20M
LUL!
 
user652649
9:46 AM
post_max_size includes the upload_max_filesize
 
what 'template' is that big? O_o
 
@Gordon what happened?
 
user652649
basically for to have effect upload_max_filesize needs that post_max_size is at least equal to it
 
@Wesabi let me try
 
user652649
can i ask for some feedback from someone involved in php's internals? bwoebi are you around?
 
9:51 AM
@randomdev close-vote please
 
morning all
@bwoebi where did you get mid February from ?
 
@Wesabi still getting the same error
 
@JoeWatkins first beta in march… votes allowed until first beta.
@JoeWatkins and the vote needs to be finished before the beta
 
upload
 
@JoeWatkins votes are still allowed, just no new RFCs after alpha
 
9:56 AM
I took it to mean no rfc'd changes after alpha
 
user652649
upload_max_filesize = 200M
post_max_size = 200M
@Chandan
if that doesn't work you may not be allowed to change these values in your hosting
 
@bwoebi
If it works well, then we probably want to announce the calendar a
little earlier for the 2015 release, since there's now a pretty narrow
window to propose an RFC and have it voted on before January 16. By my
estimation, an RFC will have to enter "in discussion" by December 26
(hope nobody has plans over the holidays) to be accepted for PHP 5.6,
 
> Nope, you can introduce RFCs until the first alpha, RFCs under discussion or under voting are allowed to be added (until the first beta).
 
yeah has to be in discussion by december 26th ...
 
okay, I misread
 
9:59 AM
is that meant to say 2014 ? it makes sense if that says 2014
what do you think of this auto initialization patch ?
@randomdev that doesn't mean anything, try again :) (we understand code best)
I still don't understand the question
 
10:20 AM
@randomdev are you writing some header data into the file by any chance? Open the image in a text editor and check if something is there at the beginning of the file
What if you point it at a plain text file?
 
any one tell me how to apply seo friendly url in laravel 3?
 
Content is exactly the same?
 
hi patrick thanx for your help but its i want to show data in url from my database ,like book/textbook/java-complete-refrence
 
@karanpujara then you need to write code for that...
@randomdev can you give me an url that doesn't work? I'll give it a try
 
ok thanx
 
10:29 AM
0
Q: Which is better to use AJAX, JAVASCRIPT or JQuery?

newbieI'm thinking of learning one of those. What'd you think which is which.

I like that question ^ ^ ^ ^
 
@zerkms AAAAAAARGH
 
0
A: Which is better to use AJAX, JAVASCRIPT or JQuery?

Tekkzzthis all aren't the same. jquery is nearly the same like javascript but grreater. ajax is just something different you need for special tasks

 
@webarto +1d
 
Totally.
 
@randomdev works for me with a random jpg. Are you adding a file ending to the filename?
@randomdev yeah I used your code, but I didn't know what's in the variable of course. If I add a .jpg to the random filename it works
 
10:35 AM
@zerkms 10k more for you until t-shirt ^^
 
@webarto what t-shirt? :-S
 
100k package, maaaaaan.
 
oh, does SO present a t-shirt for 100k?!
 
@zerkms I was maybe dreaming... let me check...
 
10:38 AM
It would be nice actually, bored spending my own money for t-shirts
 
100k
oh ffs can't find any reference
 
user652649
 
@zerkms google fu is weak... t-shirt, mug, stickers, etc... I think... ask someone maybe.
 
user652649
i'm wondering how teresko's ignored tags list looks
 
there's nothing dreaded about file_get_contents ...
you could write the file immediately if that is a concern ...
 
10:45 AM
2
A: Pro Webmasters swag for top users

Grant PalinThe swag, I have it I had totally forgotten about filling out the form for these goodies earlier in the season, so imagine my surprise when the package appeared outside my door this afternoon! In addition to the t-shirt, pens, and stickers, there is also a brief letter signed by Joel Spolsky!

 
gimme example url(s)
 

« first day (1156 days earlier)      last day (3806 days later) »