« first day (1448 days earlier)      last day (3503 days later) » 
00:00 - 15:0015:00 - 00:00

12:21 AM
I have a Bacon number of 3.
That's pretty good, isn't it?
 
@LeviMorrison Bacon number?
I go for way more than 3 pieces of bacon personally
 
12:57 AM
heh
 
1:12 AM
Creeping level > 9000 - I see you @ircmaxell flightradar24.com/UAL81/47a8499
 
1:39 AM
hello
any humans here?
anybody uses this function ? pg_unescape_bytea($data)
thanks
 
Any ubuntu user there?
 
hello guys
i have a problem when using pg_unescape_bytea
it doesnt have errors on my end but on my teammates it has
please advise
 
2:09 AM
guys can i have a favor?
i can't seem to post a question oon stackoverflow since i was on low on positive reviews
 
2:20 AM
@NikiC This snowflakes guy... very distorted view of r/php, Internals and... well... probably everything: reddit.com/r/PHP/comments/2i3e1i/a_possible_future_for_php/…
 
2:51 AM
Hey so I have an odd occurrence in which seems to be (most definitely is) an outcome of hacking, but it seems really odd that it happened. My best guess is SQL injection but it still doesn't make sense to me. I don't know if anyone here wants to take a stab at how they did it?
Basically my friend posted an entry on the website museumofaidsinafrica.org. You don't create an account or anything there, and once you post an entry it can't be edited/managed in any way.
So this is the original post that he posted, as you can see on Google Cache
however, somehow the tinyurl link there was changed to someone else's bit.ly link, if you look at the actual article at museumofaidsinafrica.org/memorial/2207/…
This happened after the website became on the top page on Google for the attempted keyword(s)
 
 
2 hours later…
user895378
5:14 AM
@DaveRandom It does -- got your email. I'll look at that stuff tomorrow.
 
@LeviMorrison ^
guy's a knob head ...
morning @rdlowrey, @crypticツ
 
user895378
@JoeWatkins hey there
 
#phpnw today :D
 
user895378
Oh fun, wish I could be there!
 
so do we, why aren't you coming ?
 
user895378
5:23 AM
Mostly proximity to my sister's recent wedding this past weekend. Didn't really want to back up another trip on top of that.
 
user895378
And: lack of planning.
 
oh yeah ... you are forgiven ... this time !
 
@JoeWatkins morning
 
hello
anybody uses
postgres?
is it okay to ask questions?
 
user895378
5:27 AM
It's okay to ask, sure :)
 
user895378
If someone is around who can help and feels motivated to do so they will help :)
 
user895378
Anyway, I'm going to sleep. Catch you folks in a few hours.
 
nn @rdlowrey
 
5:40 AM
we
i was having a problem on $crypt=pg_unescape_bytea($row->first_name);
on my end my decryption works
but on my teams machine it doesn't work, but the weird part is our postgres version are all the same. I have enable the extension pgcrypto.I was hoping to find answer when its at early stage , if we go along the way and encounter it when its has a customer
our system would end up fixing it
 
Hi
 
Hello
 
hello
 
goog morning
 
6:02 AM
anybody use pg_unescape_bytea? fellow brilliant developer ehre
 
do anyone know if there is a known bug with ReflectionClass and "yield"? I have a class with a static generator which have yields. I get parse error with ReflectionClass, just after instantiating the rc. If I comment out the yields, it runs fine. Was not able to reproduce it using a tiny example, but non the less...
Should point out that the class itself parses fine, and runs. It is just when trying to reflect it, that PHP suddenly complains.
Ar.. Feel such a noob. The script, of course, had the wrong php binary in the shebang (and then also a bad php version). :D
Top of the morning, by the way.
 
$rc = new ReflectionClass('TestClass');
var_dump($rc->getDocComment())
use this one
 
6:37 AM
Does anyone have experience with YouTube signature and Ipv6 servers?
 
posted on October 03, 2014 by kbironneau

/* by frontas */

 
6:56 AM
Morning room
 
hello
can i ask?
anybody uses pg_unescape_bytea($str);??
 
when someone repeats themselves @boyee it's quite annoying, wait a while until there's more people in here ...
 
he's posting the same question in multiple rooms
@JoeWatkins use them kick powers!
 
how you know?
 
7:00 AM
I advised him, that should be enough @crypticツ
 
its like a warning shots
 
Damnit Im trying to upload my selfie with a beer but internet sucks :(
 
@PeeHaa or too much beer?
First world problems: "Damnit Im trying to upload my selfie with a beer but internet sucks :(" --PeeHaa
 
stackoverflow.com/a/26174484/785241 - link only answers -are- discouraged, right? Unsure what to flag this as, or if it should be flagged at all.
 
good mornings
 
7:19 AM
Good morning
 
good meurning all!
 
7:43 AM
moin @ircmaxell
 
7:54 AM
Morning
 
/me is off to nw, ferry in half hour :)
 
Ooh
Driving?
 
What's more important in security? Convenience of the users or Securing the system?
 
mornings
 
8:08 AM
@iroegbu E_VAGUE
 
can one ignore usability if it's in the way of security?
 
you can ignore usability any time you like
 
hmmmmph
 
security too
 
Morning
 
8:22 AM
Hi!
 
@iroegbu Need a more specific example i.e. what caused you to ask that question?
 
How could I echo file_get_contents($fname) but only from the 2nd char to the end of file ?
not from the 1st to the endoffile?
 
... substr() ?
But tbh you'd be better using streams in general. You shouldn't really ever echo file_get_contents()...
 
@DaveRandom why?
 
I'm taking a course (Usable Security) in coursera... instructor says the user should be at the fore-front at all times, I'm thinking what's the use if we make a system less secure in trying to make it easier to use?
 
8:24 AM
 
@Basj Because it loads the entire file into memory before outputting it, which is slower and uses more memory. Instead you should open a file pointer and use fpassthru(), or just use readfile().
 
@DaveRandom my files are always < 100 kb
 
Well I personally disagree that this is a valid argument, because one should always strive to write clear and efficient code. Passing many arguments to file_get_contents is unclear (I'll guarantee that when you come back it in 6 months you'll have to look the argument order up in the manual again) and it's inefficient...
 
How can I set the first argument (filename) the fourth argument (offset) but not mention the 2nd and 3rd optional arguments (i want to keep default)
file_get_contents($fname, , , offset= 1)
what's the correct syntax ?
@DaveRandom I agree, I'll optimize my code a later, it's just now for doing some tests
 
8:28 AM
@iroegbu You do a cost-benefit analysis for the particular circumstances.
 
^^ yes this
 
I found :
file_get_contents($fname, NULL, NULL, 2)
 
posted on October 03, 2014 by kbironneau

/* by ToninoHaRottoIlTelefono */

 
@iroegbu yes that. There's no one-size-fits-all answer to that question, it's case-by-case
 
thanks
 
8:33 AM
If I have read the whole file : $content = file_get_contents($fname); How can I test the first character?
if ($content[1] === '!') { ... }
is this correct ?
 
@Basj an off-by-one error. Arrays begin with 0. Remember that.
 
@HamZa if it is a string, does $content[0] work or should I have to do substr($content, 0, 1) ?
 
Also make sure that you check whether it exists or not. Something like if( isset($content[0]) && $content[0] === '!') {...} should do the job
@Basj $content[0] works but always check if it exists. Otherwise you might get undefined index error
 
@HamZa can I access to a char by doing $mystr[i] ?
 
@Basj yes
 
8:39 AM
@HamZa ok ... and if I do substr, do I need to test if exists ?
 
something you could try...
I'm also not sure what will happen if you are using utf8 encoding with weird characters
 
ThW
@HamZa You compare the bytes
 
so maybe mb_substr() is prefered? I guess something you might do some research on...
@ThW Am I correct that utf8 will use 2 bytes per character?
 
ThW
@HamZa no 1 to 4
 
@ThW ohoo, I see. Now I get why it's a bit complicated...
 
ThW
8:44 AM
Yeah, it makes the string operation a little more expensive :-)
 
Is there an option for silence the errors ?
If there is a PHP error on production site, I don't want that the user can read the error (and can find informations about my PHP code!)
 
ThW
@Basj display_errors
 
@ThW this is PHP.ini, right? but i can set it just for a .php file ?
$blah = 'blahblah'
$blah .= '!';   // =>  blahblah!    how to have !blahblah instead ?
 
ThW
You said production server, this would be a system configuration.
 
8:50 AM
@Basj any introductory php tutorial will show you how to concatenate strings
 
@ThW yes but I have some other things on the same server, that I don't want to be silent... Is it possible to set display_erros for just one php file ?
@PaulCrovella of course I have a solution $blah = '!' . $blah; coming fromm my PHP 101 tutorials.... But i wanted to know if there is something better with .=
 
do you think there is better than $blah .= '!'; ?
@ThW you mean I can set locally (just for the current runnning script) : ini_set('display_errors', '0');
 
wonderful: you cannot charge iPad through USB, if computer runs windows
 
@tereško well, that's wrong…
 
8:57 AM
very frustrating... But, some laptops have special usb ports that do charge them
 
@iroegbu i never seen that. Any example ?
 
My boss's ThinkPad has a USB port behind, that one charges it - it's yellowish
 
ThinkPad is really good laptop series
 
cos it charges iPad?
 
9:22 AM
noop because build quality is good and keys are better and even my hp laptop charge my tablet (android )
 
ThW
That kind of problems will by history with USB 3.1 (I hope)
 
MGE
Hello, why if I try:
foreach ($petition_array as $key => $value) {
	echo $key;
}
it returns for example index
if I try echo $petition_array[$key]; it returns 100
but if I try echo $petition_array['index']; it doesn't return anything?
var_dump($petition); //output: object(Request)#1 (2) { ["_controller":"Request":private]=> string(5) "index" ["_args":"Request":private]=> array(0) { } }
var_dump(get_object_vars($petition));
output of var_dump(get_object_vars($petition)); -> array(0) { }
 
9:40 AM
what are you trying to do?
 
@MGE because $petition_array['index']; doesn't exists in your loop?!
 
MGE
I need to get the ['index'] element of the array
but it doesn't response anything. but when i try the loop, thats there
 
$key = index?
 
MGE
yep
 
0
Q: Showing a long list in twig

charger73Situation I have a long (100s) list of elements available on the twig page. I cannot show all of them in a one go. So to show only some elements at a time we can create pagination. Now there are two types of pagination, the "Next/Previous" pagination and the "Show More" pagination. My question...

 
9:44 AM
@MGE if you use foreach($petition_array as $array) then you can use $petition_array['index'] tht if the key index exists ofcourse.. Can you show what's in your array?
 
10:09 AM
morning
 
Morning niki
 
Mornings
 
Morning @NikiC
 
10:30 AM
@iroegbu those yellow ones provide charge even when pc is turned off
 
So I just had a good long facepalming session
Catchable fatal error: Argument 1 passed to %s::%s must be an instance of DateTimeInterface, instance of DateTime given, called in %s on line %d and defined in %s on line %d (values redacted)
(it was because I'm on 5.4)
 
What's not clear about the error message?
it appears that you have %s::%s(DateTimeInterface $argument1, ...) ?
 
webarto: read again.
I was kind of expecting DateTime to implement DateTimeInterface and then facepalmed
 
10:45 AM
@bwoebi i probably need to install iTunes or some other crap for it to actually charge
 
One does simply cannot expect anything when DateTime is in question.
 
Have to pass it in as mixed and then check if the input is datetime or datetimeinterface
 
@tereško oh, really? Windows is shit.
 
My iphone charges from anything a USB will connect to that has 5V available, and my workmate's ipad is charging on windows right now...
 
@Amelia In that case your method is doing too much :)
 
10:47 AM
webarto: I know, I made another method to validate input because all i need is a datetime-like object passed in
 
@tereško maybe your USB port doesn't have plenty of juice.
 
@webarto It's a validation class for date constraints
 
@Amelia In wordpress words.. it's called maybe.
Class::maybeDatetime
 
I just did Class::date($input) returns DateTime (unless it's already a datetime/datetimeinterface object)
 
Last day, beer and pizza nomnom
 
10:50 AM
@webarto I have no issues charging my sony from it
 
Yeah, probably Apple funked up.
Who uses iPad anyways :P
It's taking me more time to write documentation than code... is it normal? :)
@tereško can I ring you one more time? :D
"Wrong country." Pfft...
 
=P
 
I thought it was Martina, but except long hair you don't have much similarities with that name :P
 
@webarto: not using PHPdoc and being lazy? :p
 
@Amelia That's how I roll :P
 
10:55 AM
(Also I've recently converted from sublime text to PHPstorm and it's practically forced me to write docblocks in absolutely everything with a single keypress)
 
@JoeWatkins merged asnyc interrupt support into master. Send one sigint (ctrl+c) to interrupt at the next opcode. Send it twice to force interruption, anywhere. You'll get some info about where you currently are and some restricted set of commands. (most commands still work, ev is a bit restricted to not enter the vm, only allows variables). Please, just quickly try it once.
You can easily try it by adding a very slow internal operation (e.g. array_fill(0, 1 << 22, 1);) into your code, running it and then quickly hitting ctrl+c twice.
 
I need a key on my keyboard that just has "DOCS" on it
 
Documentation for normal people, as in words, explanation... I will add docblock... eventually... also PHPStorm8 is neato.
I think code should be self explanatory as much as possible, if someone doesn't understand it, doc won't help much.
// Increment $i
$i++;
 
Is there a markdown documentation generator that uses PHPdoc output to make stubs for functions/methods, etc?
I need to increase my laziness
 
@JoeWatkins the restricted set of operations is necessary to not mess with the vm and destabilize php. So we need to strictly avoid write access to the vm. Maybe the one or other command could be still made async safe, but now a basic set is present; that's enough.
 
11:10 AM
// Increment $i
$i--;
3
@webarto I fixed your code
 
If comments lie, code doesn't :P
 
12:13 PM
I know what PHP needs
It'll be a revolution: negative unsigned integers!!11!!
End the oppressive tyranny of only having positive unsigned integers. Why not negative? :D
 
12:45 PM
End the oppressive tyranny of half the internals guys?
 
Anyway, gotta go. Need to pack for PHPNW :)
 
1:07 PM
@AndreaFaulds Pack? It's only two days, you only need a rucksack!
 
A 65l rucksack
 
netbeans has a run configuration option to upload my site via ftp to wherever
im not seeing an option for this with eclipse php
 
1:24 PM
@Fabien You coming?
I can't remember who's coming
 
Nope :(
 
guessing i should just be using version control for this
 
1:48 PM
haha
good one
Has anyone used Codeception for testing?
 
tag @JoeWatkins, I have Dave's number if you're lost and want it. Just text me.
 
:-)
 
posted on October 03, 2014 by kbironneau

/* by yassine_ba */

 
2:03 PM
and then you forget what you did by Monday
 
LMAO, that's funny. :P
 
Does anyone know why there is
www and www2 and www3
 
Morning.
 
moaning
 
Good afternoon everyone
 
2:14 PM
so
is www a subdomain or a superdomain?
because a guy in the JS room argues with me that it is a superdomain
 
@ziGi according to my knowledge, it is www and w3.
 
whatever that means
 
I think it's a sub
 
me too
 
it's most likely: [sub].[host].[tld]
 
2:15 PM
I think it is just the primary subdomain
 
It's a super domain I think.
Goto the JavaScript room, there is a heated discussion about it.
 
and it was used to distinguish between ftp and a web page
but now for convenience it is supported by the browser
 
today has made me sadder then usual
 
@HassanAlthaf what is a superdomain
 
31
Q: What is the purpose of the WWW subdomain?

Mk12What's the point of having www.? Isn't it just useless extra text? Since everyone is used to it, www.google.com looks more well-balanced than google.com, but why did it start in the first place? One thing I noticed, is that google.com has the IP of 74.125.53.100, in the UK, while www.google.com ...

there you go.
the answer.
 
2:17 PM
Why distinguish between FTP and a webpage? FTP and Web have different protocols?
ftp:// and http:// ?
 
@ziGi I've seen this type of subdomain naming scheme used with load balancing or for mirrors
 
yeah, www2 and www3
 
@HassanAlthaf "before the World Wide Web, there was still an Internet, and it was used for a variety of things: telnet, email, gopher, FTP, etc. At that time, it was traditional to assign domain name aliases to servers for common functions. So, smtp.example.com would be example.com's outbound email SMTP server, ftp.example.com would be example.com's FTP server, etc."
 
@HassanAlthaf I know
 
2:19 PM
so what's stronger in the hashing: Sha3 / sha3-192 / sha3-386 / Blowfish
 
Bless me father for I have sinned. I have not been here for ages as not to waste my employer's time, yet now I find myself here for purely selfish reasons.
I need to write some phpunit tests to test frontend controllers. These controllers however make use of filter_input to read GET parameters. I need to "inject" these GET parameters, but I have no clue how this would be possible..
 
@tereško Any particular reason?
 
@DanLugg I had to waste ~30 min explaining to my coworkers the issues with "file upload with ajax" functionality, and in the end, their advice amounted to "just slap some shit together"
 
Poor guy
 
@DamienOvereem Abstract it away; $parameters->get('myparam') where $parameters is a ParamBag (or something) for which the production implementation proxies to filter_input, and the mock implementation can be pre-loaded with data.
@tereško "just slap some shit together" -- The internet, forever and always.
 
2:28 PM
I fail to understand what you mean exactly. The controllers themselves use filter_input(INPUT_GET, 'var', FILTER_SOMEFILTER). How would I implement what you are suggesting in my test?
 
@DamienOvereem By fixing the controllers to not use filter_input
 
@Leigh I still don't know about the or {} syntax. I understand the quirky nature of reusing else like others have done. I can't exactly pinpoint why I don't like it though.
 
Ah right. I was afraid of that. I was hoping to stumble into a method which would allow me to NOT modify my production code.
 
@MikeM. scrypt or bcrypt.
 
@SecondRikudo It's on!
 
2:31 PM
bcrypt I believe
 
@DamienOvereem Well, I'm not certain; there's probably a way to "mock" the data, by forcing it to a certain state.
 
Luckily there is already a proxy Input::$GET-> which I can modify. It still uses filter_input internally, but I suppose I could work around that by simply using filter_var on $_GET's
 
Such that filter_input will return what you tell it to.
But I'm not sure.
 
you use crypt(pass, $2y$12$22char$)
 
@DanLugg Considering its reliance on global state I'll bet that would be a PITA for testing
 
2:32 PM
@DamienOvereem You'd be best to have a ParamProvider interface, from which you can derive a ParamBag implementation that proxies the filter_* calls, and a MockParamBag with __construct(array $data) so you can force it to be a state.
 
I was somewhat hoping phpunit would have implemented some trickery for this, but that doesn't seem to be the case. Probably because it can't be done. Guessing filter_input's data is build up before userland code is even in the picture
 
I would also question why you're using filter_input in a controller at all.
 
MVC over HTTP is a lie anyway. Why not put it in the controller?
 
@LeviMorrison DON'T BREAK THE ILLUSION!
 
Guess i'll have to poke around a bit. Thx anyways @Danlugg
 
2:36 PM
@LeviMorrison Because in most use cases I've seen it isn't close enough to where the data is actually used. What are you doing with the data in the controller? Passing it to a persistence layer? What filters are relevant for that? If it is passing that data to be viewed by the user I think the filtering should be done in the presentation layer.
 
What is a controller anyway?
 
@LeviMorrison A dude/dudette who controls stuff. Like money.
 
Just glancing at filter_input it seems to break SRP imo. Retrieving data and filtering it in the same step
 
I think filter_* are kind of broken by design.
@DanLugg E_GENDER_BIAS
 
have a nice weekend guys!! I'm going to call it early today!! later!
 
2:37 PM
Later.
 
@LeviMorrison ^^
 
Well, I happen to agree with you about the MVC crap. But, I don't think it changes my mindset that filter_input sounds like the wrong solution imo
 
Yeah it probably is the wrong solution.
 
GUYS! I CAME UP WITH A 3 LETTER ARCHITECTURE! I'M GONNA WRITE A BOOK AND MISQUOTE GOF! GIMME MONEY!
8
 
Just call it XA (extensible architecture) .. 2 letter acronyms are even better
 
2:41 PM
And the de-facto implementation will be nothing but XML + Java
 
@LeviMorrison because you will end up with a lot of code duplications (assuming that you still have type of "entities" for general business logic)
 
But mostly XML. Because the more "X"s you use, the cooler.
Y'know what we need? A PHP preprocessor. Scalar type-hints would be trivial; potential for performance impact aside f(int $i) { var_dump($i); } would just be transformed to f($i) { if (!is_int($i)) throw; ...; }
Like Haxe, but ... not -- I don't wanna wait anymore.
 
user895378
morning
 
@DanLugg the AST ext could actually help to create such a system
 
Morning @rdlowrey
 
user895378
2:52 PM
@Fabien I didn't get to it yesterday, but I will email you back at some point today :)
 
heh no worries. Weekend now anyway.
 
@DanLugg The whole reason behind the lack of scalar type hints is that scalars should be easily translated between different scalar types. "123" should be just as valid as "123". Why is there a need to get rid of loose typing?
 
@KevinMGranger the bigger problem is the performance loss
 
Oh guys.. please.. stop discussing scalar type hinting.. the lack thereof makes me cry everytime i'm typing if ( !is_int($var) ) throw new InvalidArgumentException();
 
@Fabien A day too late, but yeah :D
 
user895378
2:54 PM
Meh. Scalar hints. Who needs em (I don't).
 
@KevinMGranger Either way, strict or cast-hints; I don't wanna wait :-)
 
Everyone does. Every time someone has to validate types a young kitten dies.
 
user895378
@DamienOvereem Nope.
 
user895378
My IDE is a dead-kitten-free zone.
 
@rdlowrey don't make me search the history for an instance of you praising them ;-)
 
user895378
2:56 PM
Opinions change.
 
@rdlowrey Thats what -you- think. Haven't you noticed the dead-cat-smell pouring out of your IDE ?
 
user895378
Anyway, I'm not going to walk over this same dead horse's bloody corpse. I just don't care.
 
@DamienOvereem I'm of the opinion that if you need to do that kind of deep validation on your types, something is wrong with your design.
Perhaps an example might change my mind, though?
 
@rdlowrey I'm tying to adhere to that rule too, but unfortunately the html/css/js is mostly written by other people
 
I am a fan of scalar type cast-hints, not so much fatally strict ones (except on dataloss)
 
2:58 PM
wew
 
which is a constant source of dead kittens
 
playing an old old old game xD
 
user895378
JS was built from bricks of dead kitten parts, its gaps caulked together with unicorn blood.
 
@SecondRikudo :( yeah. I did check yesterday but guess I was a bit early.
 
00:00 - 15:0015:00 - 00:00

« first day (1448 days earlier)      last day (3503 days later) »