« first day (2350 days earlier)      last day (2591 days later) » 

7:02 PM
Which I guess if a $dbh->query() succeeds it returns TRUE even if it didn't return any rows, but how then would I check if it returned any rows without throwing an exception?
 
:P
 
yield from1251('dfd') ("from1251" is a valid function name) fails – #74302
 
hahaha
 
lolwat
 
yeah.... I can see that happening
 
7:12 PM
I blame bob
 
It's the lexer...
 
@PeeHaa Boo! The message exceeds the 140 character limit. :-(
 
boo indeed @Jeeves
 
@PeeHaa What do you use them for?
 
7:14 PM
@Jeeves them?
 
@PeeHaa What do you like about computers?
 
@Jeeves at the moment, nothing
 
@Jeeves I don't. I hate them all
 
@Dereleased What's your favorite food?
@PeeHaa You just said you liked them.
 
lol
stupid bot
 
7:14 PM
@Jeeves The soles [stet] of my defeated enemies.
 
@Dereleased You said you liked him less than five minutes ago.
 
@Jeeves wat
 
@Dereleased You said that, but you also said you liked Stephen Colbert.
 
@Jeeves Not when you should've been able to be have been listening...
 
@Dereleased I don't listen jazz. Jazz is boring. I think so.
 
7:15 PM
I always thought the memory of elephpants was good
 
not all elePHPants are created equal
 
:P
 
I believe that was the great poet Xzibit
 
@Jeeves hahaha you are funny elephant :D
 
@Linus Why is that?
 
7:26 PM
@Jeeves Don't you question @Linus you peanut-muncher!
 
Random question: I want to start blogging regularly and release a couple of books/courses over the next few years. Should I keep doing that on patrick.louys.ch or would I be better off grabbing something like patricklouys.com or a php related domain?
 
I know these are good, but they're still gonna take getting used to blog.jetbrains.com/phpstorm/2017/03/…
 
@Dereleased Why don't you answer my questions straightforwardly?
 
@PaulCrovella had to turn them off, they are really annoying
 
I just updated and got them. going to give 'em a chance for a bit
 
7:28 PM
@PaulCrovella Insta disable
 
Oh cool, now I can have absolutely no idea how wide my lines are!
 
I cannot get used to new cool stuff
 
Somebody's over 35...
 
33 sunday :P
 
they kept popping up and disappearing, made it hard to write code...
 
7:29 PM
aging prematurely then =P
 
Yes that's what people keep telling me :D
 
Happy PeeDaay in advance tho
 
tnx :-)
 
Heard a (thing) once, any tech that occurs before you're 15 is the natural order of things, from 15-35 is new, exciting, and you can probably make a career in it, and 35+ is against the natural order of things and to be rejected
 
I'm over 35. I just want you idiots off my lawn.
 
7:31 PM
lol old fuck
 
:P
 
Hey. I have a question related to the PayPal API. (If anyone here is familiar) Is it possible to detect donations received from a user's authed PayPal account via the permissions api? Let's say a user grants my app permissions, would it be possible to then create a donation button for them and detect when they receive a donation through that button?
 
Could somebody please hit gitamp.audio with your browser?
<3
lol @PaulCrovella
> Gary Hockin has been creating code to power web applications for 15 years, the last three of them at an extraordinary level. He is handsome, talented, funny and articulate, and also extremely modest.
 
nobody bored enough to care about my stupid blog question? :D
 
Nice try gary
 
7:32 PM
@PeeHaa Wow that's cool!
 
@PeeHaa and now?
 
tnx
That was all
I think there is 0.14M leaking
 
how often?
 
@Patrick If you can grab the .com, I'd do that.
 
I think on new requests
 
7:35 PM
how long does it take to bounce?
 
patricklouys.com or something else?
I have a weird last name ^^
 
@Dereleased It doesn't
Yep. It's just jumped again with 0.27M
 
@Patrick I think that would depend on how personal the website is to you. Is the site going to include lots of personal opinion and personal discoveries?
 
I meant how long to restart
 
Restart what?
 
7:36 PM
@PeeHaa when I was poking at it mem usage increased with max concurrent users and php simply wasn't releasing it back to the system.. not necessarily a "leak"
 
Is mem not being freed basically a leak?
At this point I am pretty sure it's not our code, but bob doesn't understand how ssh works and cannot login for some weird reason
Bob Weinand: writes C like a beast, doesn't understand how ssh works
 
@JordanRichards yeah but more from a teaching perspective than "i did this today"
I'm playing with the idea of calling the book series "Professional PHP" but that domain is already gone
 
@Patrick In that case it would probably be best to try to grab a good domain name related to what you'll be blogging about. css-tricks.com being a great example.
 
@PeeHaa a good friend was a C developer, did a lot of rtos/embedded/device driver kinda stuff.. would regularly ask for basic computer use help
 
C people are weird
 
7:41 PM
@Patrick Will you only be blogging about PHP? Or will you want to blog about other subjects? I think that is important to consider here too.
 
i taught him a little simple excel and it was total magic to him
 
hahahah
 
@JordanRichards yeah that's also in my mind. right now only PHP, but it will be mostly about architecture, clean code and stuff like DDD. So I don't want to limit myself too much. And who knows what language I'll be using in a few years
 
@PeeHaa super slow mem leak? Bounce the server once a day
 
It will be mostly be about becoming a better developer
 
7:43 PM
@Dereleased We could do that sure, but I would rather somebody fixed the bug :P
Increasing memory is kinda killing for long running scripts/servers
 
@PeeHaa as I understand it php will grab a chunk and reuse it (which it seemed to be doing), I don't know when it decides to release it back.. and I could be just wrong
 
@PaulCrovella Yes that is what bob told me too the first time I noticed the issue.
But as I understand what he was trying to say it shouldn't keep increasing after that
 
@Patrick So the other option would be to go for an even more generic domain name related to development in general. But, I think it may be hard to get a good domain name for that. patricklouys.com could work fine for all the purposes, it just would be harder to remember and would not benefit from the SEO for certain subjects.
 
It gets (and keeps the block) but there is no reason for it to increase after the initial load
AFAIK YMMV BBQ IAMACP
CP = C progammer
inb4 :P
 
I only got to see it increase under conditions I'd expect it to need more, so ¯\_(ツ)_/¯
 
7:47 PM
I think it does the following for us: start the server (low mem), fire requests (40ish mem), keep firing requests (still 40ish mem), come back after a day and connect with a single browser (memory increases again)
Note this is all from ps
In php after manual gc get_mem_usage is kinda stable at 42ish MB
It's been running "fine" for two weeks now, but I am pretty sure it will fall over again in 2 weeks from now
brb packing bag
 
@JordanRichards I think I'll go with my name. Thanks for the input :)
 
8:20 PM
@ThW you were talking to me about implementing an environment for running small php scripts on CLI
I have time now to where I could work on setting it up
trying to download the "thread safe" version of PHP and I get a virus warning from our firewall o_o
 
well that is interesting
 
clearly you're trying to download the wrong version. should be 7.1
 
I was considering 7.1, but I figured it would be better to download the closest version to what our website has running
 
is it built on some cms framework?
 
time to update that too :D
 
8:25 PM
@PaulCrovella on my to do list
not an easy upgrade since the code will have to be updated
 
I'm starting to avoid the website code as much as possible because it's a stupid pain in the ass
@DaveRandom that worked
thanks
 
weird, and slightly worrying
 
our firewall is pretty good at tracking stuff like that, which is why I posted it
sometimes it has false positives
but not often
 
any chance you could ping a mail to webmaster@ ? on mob and huge pita for me right now
 
8:30 PM
sure
 
php-webmaster@lists.php.net?
 
uh, yeh I think
dunno tbh, it's such a long time since I typed it in anywhere
 
sent
 
Wes
evenings
 
8:40 PM
yo wessan
 
Anonymous
Evemongolian
 
lol
 
ThW
uhh
 
Anonymous
Cheer up tomo, you could look like @PeeHaa
 
Nobody wants that
Also hiya jameson
 
Anonymous
8:49 PM
Yo smoogly
 
Wes
9:20 PM
3 days to decide how to write some code. about 30 seconds to actually write it
life as a programmer
 
for me it's more like 30 seconds to decide to write some code, then procrastinate for at least a couple of weeks...
 
Wes
we should work together :B
 
:D
 
Wes
the ultimate douchebag driver instagram.com/p/BR_gJJoDD5g
 
Hey
What do you peeps think about Drupal?
 
bob
9:32 PM
can anyone see the issue here: pastebin.com/PDU2RMJk many thanks. getting the error "Call to a member function bindValue() on a non-object"
 
@DaveRandom @Wes which design patterns should I read/learn about first, in your guys' opinion?
 
Wes
2 days ago, by Wes
@Tiffany i'm not sure if reading about patterns in general is the right way to start... perhaps you should start by reading what domain objects are, aggregates, value objects, data transfer objects, dependency injection, SOLID, data mapper pattern, repository pattern, then you can grasp the big picture of a web application by reading about mvc
imho if you read about these things you'd get a general grasp on how oop code is written
 
@bob what doesn't work?
 
I'm saving that for later ^^
 
Wes
also read what state and encapsulation are
 
9:36 PM
I wish my eyes would quit hurting so I can read stuff on my computer screen
 
Hi, i have a list of messages on my webpage and i have to make them update without loading the page, my teacher said to use ajax, can anyone point me in the right direction, im not sure where to start
 
bob
@RaduStefanPopescu just returns the error "Call to a member function bindValue() on a non-object" the select query doesn't work.
 
@Tiffany use darcula
 
Wes
@Tiffany lower monitor brightness?
 
did you google that error?
 
9:36 PM
@bob That variable isn't even defined
 
maybe, I'm in a bright office though
 
bob
@PeeHaa what variable?
 
@RachelDockter That's more of a JS question, are you using any JS libraries?
 
yeah
.=
means concatenate
afaik
 
@Alesana dont think so, my teacher said i have to do it using ajax though
im loading the messages using php
 
9:37 PM
oh yeah, adjusting monitor brightness helped
 
@bob The one you are trying to use and the one that gives an arror
 
Wes
or get SpeakIt!, it's a chrome extension. works well. it's a text to speech thingy
 
@RachelDockter Do you use jQuery? :P
 
oh yeh i use jquery
 
$statement probably
 
bob
9:38 PM
@PeeHaa They are all defined at the top.
 
Not in the pastebin they aren't
 
@Wes a screen reader? :P
 
Wes
kinda
 
I'm pretty confused on using composer for an application that is to be distributed. If I install a package using composer, surely I won't have to distribute my app with all of the composer files, for example composer.phar, right?
 
Wes
not a screen reader like those for blind people
 
9:40 PM
@Wes i'm interested
 
Wes
there is a lot of heuristic stuff in those. this is simpler. you select the text you want to read and click play
 
bob
@PeeHaa you can't see $search_input = $_POST['search_input']; ?
 
ahh
 
@bob Yes I can
 
@Wes i'm not interested anymore, i want those with heuristics
 
bob
9:40 PM
@PeeHaa so which variables are you talk about?
 
Euyya all!!
May I ask something here? regarding tree traversal - I'm in big doubts :)
 
@bob I will leave that to you to find out
It's a small script. You can do it
 
@RachelDockter making Ajax requests in jQuery is really simple! You can start by looking up "Ajax jquery" in google.
 
And when in doubt loo at the linenumber from the error message
 
wait is ajax part of jquery or php
 
9:42 PM
Basically you will just want a PHP page that outputs all of the messages in JSON format, then using jQuery you make an Ajax request for that page and then parse the data
Ajax is Javascript, and jQuery makes making ajax requests a lot easier
 
@PeeHaa is it the .= thing?
 
Wes
@RaduStefanPopescu we used orca and ndva once to test accessibility on some sites we made
 
Usually an ajax request is made to a php page
But it can make a request to any page that outputs JSON
 
Wes
but they worked terribly
*nvda
 
@RaduStefanPopescu That is also wrong and spews out a notice, but php will recover from that. There is something else wrong which results in the error message
 
bob
9:43 PM
@PeeHaa cheers
 
ok i think i get u, thanks ill try that
 
@RachelDockter AJAX is Asyncronous JAvascript & XML it's not part nor of jQuery not of PHP but a standard - for laics: it's implemented as part of your browser's JavaScript engine
 
@PeeHaa also what is $sql
 
bingo
 
I forgot I downloaded Structures and Interpretations of Computer Programs
 
9:44 PM
@PeeHaa i haven't coded stuff in PHP in half a year
 
@RokoC.Buljan ah ok thankyou
 
I feel obligated to tell you to keep it that way :P
I don't want more people to suffer :D
 
I got used to java rules so much. tbh php was like an illness when i had to write in it
 
Oh it still is an illness
 
but then again hosting is cheap for php so i had to use it, then got a job in it
 
9:46 PM
It's just that java isn't that much better
 
java is very easy to read because it's very explicit
i like that
 
@RachelDockter so basically you had a couple of bored smart people trying to get the heads around on how to implement HTTP requests and responses (from the server) -> without the BROWSER refreshing... they wrote some documents and than other smart people got their hands dirty implementing that into the browser you're using :) #longstoryshort
 
lol that sounds exacly what i need
 
They weren't smart though
 
am i on the right track?
				<script>
				 $(document).ready(function(){
					 setInterval(ajaxcall, 1000);
				 });

				 function ajaxcall(){
					 $.ajax({
						<?php include 'functions/displayPosts.php'; //Include the feed of user posts ?>
					 });
				 }
				</script>
 
9:47 PM
The same people wrote IE6
 
bob
@PeeHaa the only thing not defined is $dbh ...
 
@bob Scripts are executed from top to bottom
Unless you are from down under
 
@RachelDockter No haha
 
In which case it's the opposite
 
9:48 PM
@PeeHaa :D
 
that comment goes upvoted :D
 
@RachelDockter Well kind of, you would actually do...
 
hey is that trying to run php code from ajax ?
or am i just bad
 
its trying to yeh lol
 
9:50 PM
dont laugh
 
 function ajaxcall(){
	 $.ajax({"functions/displayPosts.php", function(data) {
	 		...here you do what you want with the JSON that displayPosts.php outputted using pure JS/jQuery...
		}
	});
}
 
@RaduStefanPopescu Maybe you are, but you are correct on that
 
bob
@PeeHaa If your suggesting $sql isn't defined. it is.
 
@RachelDockter you cannot run server code from a client
 
13 mins ago, by PeeHaa
Not in the pastebin they aren't
 
9:51 PM
@bob then you should also prepare the stmt or sth
 
@Alesana thanks alot, so if the php file does a loop to put every post on the page, what type of info would it output, im kinda confused
 
I don't know ONE language where you can add the bindings before you prepare the statement
@RachelDockter ok listen, HTTP is STATELESS
 
@RaduStefanPopescu There are none. Because it's actually send to the server where it is being prepared :)
 
@RachelDockter So you want the PHP page to output JSON. A good way to do that is to get all of the posts into an associative array, then echo json_encode($associative_array_containing_posts);
 
@PeeHaa i know
 
9:53 PM
Good
Just checking
:-)
 
ah this is so confusing lol
 
So then the Ajax request gets that JSON containing all of the posts, then the JS would have all of the post information. From there you would probably want to have JS loop through it and dynamically add it to the DOM
 
/me packed his bag and is done for the night
Later all o/
 
http is like this, client ask for HTTP, and server sends a HTTP, then client realizes page has some javascript in it, and some images and then it keeps requesting those things to the server
 
bob
@PeeHaa see ya
 
9:54 PM
until everything is loaded
as things are loaded javascript starts running
PHP is stupid as fuck
it never remembers who asked them for resources
all it knows is to take your query and give the response
 
@RachelDockter Do you know what JSON is?
 
every time
 
right, sorry im not that good at web dev
i have no idea what a JSON is lol
like a string or something
 
so if you make same query 1023912031 times, PHP will always ALWAYS answer with the same logic
 
You know what a JS object is right?
 
9:56 PM
ok thats good for me
like var object {}
like that?
 
so here is your piece of javascript that makes an extra call to your server, and your server needs to provide useful stuff
in this case it is data
 
Yeah, so JSON is JavaScript Object Notation, it's basically a string that contains an object
 
bob
@RaduStefanPopescu that means you prepare it twice?
 
because your javascript knows how to interpret that data
 
You just have to parse it
 
9:57 PM
@bob where do you prep the statement?
 
So inside that ajax function you would put data = JSON.parse(data); and now the data variable is an object
 
in this server-client thing, client is always the one who asks, and server can never send or remember the client
 
bob
i've changed the script now, but at the top just before `
if(!empty($search_input)){`
 
especially if you use PHP
 
what data would it be thought, theres like 50 posts with their date and info that i need to display
 
9:58 PM
if you use anything else... there are ways
 
o.o where does the data come from?
 
i might just skip it and lose a few marks lol this is confusing af
 
A database I assume?
 
an sql database
 
It's really simple and very necessary to know!
 
9:59 PM
@RachelDockter it's easy, don't worry you will have eureka moment, it gets hard when you manage stateful connections
 
Hold on lets go over to the js room
 
can i link u the php file in a paste bin so u know whats in it
 
Yeah I was about to ask for that
 

« first day (2350 days earlier)      last day (2591 days later) »