« first day (1866 days earlier)      last day (3082 days later) » 

7:05 PM
@Lynob you also have a massive SQL injection vulnerability in your code. Please switch to using prepared statements.
 
Abe
going to watch some tv. have a good evening all
 
@Danack that I know, I'm just prototyping a software with a cs student who's new to php, so when i see that she understands the basics, then I would start talking about security, for now this is just a final project, and the advisor won't care
 
@Lynob That's a wrong approach.
 
@Danack mysqli is kinda more understandable, prepared statements seems kinda weird
 
@Lynob mysqli is fine to use, just use it with prepared statements.
 
7:17 PM
so for someone knew it's harder to understand
 
@Danack ahh now i get what you're saying ok
thanks
 
What's up?
I have a personal question for anyone that can answer, How important is project management? I mean I always start project but I don't seems to finish it, Why? lol
 
Prepared statements are not any harder than any other query. Especially not for new people. They should directly learn the right way.
 
oh shiiite. just got an PAGE_FAULT_IN_NONPAGED_AREA
I think it is long past time I replace my hard drive msdn.microsoft.com/en-us/library/windows/hardware/…
 
7:32 PM
evening
 
@Gordon morning
 
But learning the wrong approach to db usage, and then having to forget all that and learn the correct way later is even harder
 
> Tokutek claims to improve MongoDB performance 20x. It is unclear if this also means losing 20x as many documents.
12
:)
 
7:41 PM
@FélixGagnon-Grenier s/hard-drive/ram
> Bug check 0x50 usually occurs after the installation of faulty hardware or in the event of failure of installed hardware (usually related to defective RAM, be it main memory, L2 RAM cache, or video RAM).
 
hmmm. isn't L2 Ram kind of built in a cpu? doesn't that imply replacing a cpu, if it's the one at fault?
 
Motherboard....possibly. Though, I'd also suspect drivers because some PC component manufacturers do fruity stuff to get their hardware to run as fast as possible.
But you probably should run a memcheck program, which would mostly eliminate a pure hardware problem.
 
unrelated: Some years ago, I worked on rewriting an old hypercard app in a php/mysql paradigm. The hard part was moving mac os 9 data (with it's resource fork) on mac os X software. The computer I used, an old macbook, is getting old, and I would install a different os on it. Problem is the mac os 9 data is on it (with it's resource fork) and I do not succeed in moving it elsewhere, using a mac os 9 formatted usb drive or a disc.
should I be able to move it on a usb key, if said usb key was in a mac os 9 file system?
 
@kelunik Could you ELI5 me how I get a LE cert?
 
@PeeHaa Which server do you use?
 
7:56 PM
nginx
 
If downtime doesn't matter, just run ./letsencrypt-auto and use standalone, everything else will be explained.
 
Where do I get the client. Github still tells me it will be signed using the test ca
 
Later I'd use webroot authentication (-a webroot --webroot-path /tmp/letsencrypt/example.com) and add that to your nginx configuration as second webroot.
@PeeHaa Just use --server as the invitation email tells you ;-)
 
Faur enough :P
 
Currently working on a standalone PHP client, hope to get it ready until Dec 3rd and release it concurrently with LE's GA and PHP 7.
 
8:01 PM
Yeah that would be great
> No installers are available on your OS yet; try running "letsencrypt-auto certonly" to get a cert you can install manually
Good that is what I actually wanted I think
That was rather easy... tnx @kelunik
 
Is $argv defined in every SAPI?
 
Implementations that ignore arguments suggest a flawed API?
 
would smell funny to me... don't know if I would call it flawed though
depends I guess on if it is an exception or the rule
 
Naive but complete example:
interface MyInterface
{
    function calculate($x, $y, $z);
}

class MyImplementation1 implements MyInterface
{
    public function calculate($x, $y, $z) { return $x + $y + $z; }
}

class MyImplementation2 implements MyInterface
{
    public function calculate($x, $y, $z) { return $x + $y; }
}
 
@DanLugg Nope, perfectly fine to ignore arguments.
 
8:16 PM
This seems like a fishy work around to not really implement an interface.
 
I don't see anything gross about that.
 
@kelunik phpcs will warn you about unused arguments
 
PhpStorm as well, but we can't remove them when implementing interfaces unfortunately.
 
I've got my IDE warning me anyway; I just feel like there's an error in the API because it's being ignored.
 
Maths operations don't behave as uniformly as you would like....so your example may or may not be bogus. The real issue is that Liskov Substitution is more of a guide than actual rules.....
 
8:17 PM
also if it doesnt need $z it might indicate a broken interface
 
interface EmailSender {
    public function sendEmail($recipient, $body);
}

class NullEmailSender implements EmailSender {
    public function sendEmail($recipient, $body) {}
}
 
@Danack That's a good point.
 
Does that ^^ violate LSP ?
 
Another thing would be an ->update method that receives the actual change but is only interested in the event it self, not any changes.
 
Symfony has a lot of these interfaces where the general purpose nature of it leads to concrete classes that do not fit the interface
 
8:18 PM
steps back and watches fight start
 
@Danack FTR, I typically find myself logging to something when using the Null pattern ;-)
But I see what you did there.
 
@DanLugg I use null stuff for testing a lot.
 
@Danack no, you may widen the interface, but not narrow it
 
@Danack Likewise, and dump to some massive log of "shit that never actually happened"
In any case.
 
@Gordon Hmm, the interface doesn't change?
 
8:20 PM
@Danack true. nvm
 
I feel a bit better about ignoring arguments, however, is there a way to reorganize code such that its no longer an issue? Perhaps segregating the method out into a type, and then having the implementation constructors take whatever necessary arguments. That way, the method-type can have a clean method of invoke or whatnot.
 
@DanLugg Hard to say without seeing the actual use case.
 
True, big code dump for that; won't bother.
But that's a ... common pattern to accommodate this issue, yes?
Basically, using sepearately implemented constructors to dodge LSP
 
Depending on how complex the objects are that can be quite a headache to manage.
 
ewww, i have to make sure I edit my messages before the graceperiod now … normal user sucks :S
 
8:22 PM
@DanLugg business needs are more important than following theoretical patterns.
 
@Danack this
 
@Danack I'm going to pretend I didn't read that.
 
If you do happen to get into an argument with a language theory zealot, refer them to the holy texts
"What is wanted here is something like the following substitution property: If for each object o1 of type S there is an object o2 of type T such that for all programs P defined in terms of T, the behavior of P is unchanged when o1 is substituted for o2 then S is a subtype of T"
If when using one implementation an email is sent, and when using another implementation an email is not sent - then obviously the behaviour of the program has changed.....
 
So, you support MI? I'm being an ass now.
@Danack Well, LSP doesn't shouldn't really address polymorphism
It just outlines the protocol to ensure polymorphism is feasible.
 
@DanLugg exactly....it comes from a time when people didn't know how to use source control.....and so LSP was describing (at least in part) how to modify programs without making them fall over, rather than a strict guideline of how OO classes should be designed.
 
8:28 PM
Fair enough, it still carries with it a lot of value in simplifying assertions about type graphs
 
aka, ignoring parameters is fine, but weird for non-test/debugging implementations.
 
@Danack so SOLID is a substitute for version control now?!
 
^^
@Gordon What do you think the S in SVN stands for?
 
Sucking?
 
SOLID VERSION CONTROL ALL THE THINGS!!!
 
8:30 PM
Single branch VersioNing
 
who needs branches anyway …
trunk based ftw
 
Stop Versioning without Git you Numbskull
 
Arguably, I could just say "eat my ass Liskov" and use array $paramMap.
 
@DanLugg or variadics
 
8:34 PM
@Gordon Which is like, the only feature IDGAF about ;-)
I used to think I liked variadics, until I used variadics.
 
another option would be to use setters for the params and then call the command without any params
 
> Could be a beer allergy. Do you get headaches after drinking 12-14 beers?
 
8:49 PM
lol
 
@Gordon That's basically what I'm thinking.
// rather than
$object->method($a, $b, $c);
// instead do
(new Action($object, $a, $c))->invoke();
Or something like that.
 
9:15 PM
Hi need help in regard to a looping problem i'm facing with PHP and MySQL.

Basically I have a DB table which includes attributes; name | status | year e.g. 2001.
Within my DB table i have i have multiple duplicate entries in the year but different status entry each time.

I'm trying to make a loop which will run and print all from the table until the last entry with year = 2001. Then I want my loop to do something else.

Could somebody help me with this? Thanks
PS, Sorry if i'm vague, please ask questions
 
9:37 PM
> The structure of the returned data is (deliberately) not yet documented, as it is still subject to change.
php.net/manual/en/function.openssl-x509-parse.php – function exists since PHP 4. ^^
 
Is that answering my question?
 
@kelunik hehe
 
Does anybody know if that function can actually fail and may return false?
 
user895378
 
But just if the resource itself is invalid?
 
9:53 PM
Does the lets encrypt flow allow for public key pinning?
 
You have to disable key regeneration, it's on by default.
 
k cool
 
@rdlowrey Seems like you can use a string as first parameter as well as a resource.
 
10:10 PM
@Danack and guess who started it :D i.imgur.com/ewb9WcA.png
 
@nikita2206 no....it was news.php.net/php.internals/89382 . The threading seems to be even more broken than usual.
 
@Danack yeah I mean, it would die if not for Lester
 
@kelunik yeah, a resource or a filepath to the cert
@Danack honeypots <3
 
> Until them, anything userland guys ask here IMHO is irrelevant.
 
What type is good for storing 10-characters in mysql?
 
10:18 PM
@Shafizadeh knowing how to google stuff and reading the fine manual, is a vital skill dev.mysql.com/doc/refman/5.7/en/string-types.html
 
you are right, also thanks for that reference
 
If always 12 characters, I'd use char; if up to 12 I'd use varchar
 
@ScottArciszewski owasp/phpsec is finally gone. :-)
 
10:34 PM
@MarkBaker ah tnx, but why 12? it is a constant number?
 
Maybe Mark didn't have his glasses on?
 
:)
@Danack btw, "didn't have" is the same with "hadn't" ?
 
2
A: He had not understood vs He did not understand

Colin FineHe had not understood and he did not understand are both grammatical and both idiomatic. They have slightly different meanings, (but in many contexts will be interchangeable). He had not understood is what people now seem to call the past perfect, and is appropriate if the narrative time is in t...

 
ow! you like searching :-)
 
"did not" because I'm referring to a specific point of time - when he read your comment. "Had not" would be used to indicate a period of time.
 
10:39 PM
I see
 
Misread your 10 as a 12
(yeah. not wearing my glasses)
 
\o/
 
ah alright, tnx :-)
@Danack English is your native language? where are you from?
 
Bristol.
And no, I don't have a west country accent.
 
ok
@Danack also I think you have to use "haven't" instead of "don't have" in this case. because there is not any specific time.
 
10:49 PM
no....that's just not close. "He did not have" is the only sensible grammar.
 
ahh!
 
11:03 PM
Oh my god.
Add a branch in the wrong place, and bam, massive, massive performance penalty
 
11:18 PM
@Andrea where did you add?
 
@NikiC I added if (known_non_numeric) { goto str_index; } at the top of zend_fetch_dimension_address_inner
this made performance worse by >200% :D
so instead I just put the check where the old const was
(interestingly, it made perf worse in a test-case which did not have any non-const operands?)
 
Can someone help me with multiple conditions in a while loop please
Well thank you all for your time and patience.
 
@methhead are you after the && operator?
 
Is my comment too harsh on this guy? stackoverflow.com/questions/33928191/…
 
Well I'm currently using MySQL and PHP to drag and print results from a query.
I have a table with attributes 'message' and 'year'.
Within the table I have many messages stored and the year stored also. What I'm trying to do is create a loop which will go through each row of the table and group all the messages together by the year. @Andrea
 
11:38 PM
foreach($messages as $message){
echo '<li>'.$message.'</li>';
}
 
I currently Have:
if($result = $link -> query($query)) {
while($row = $result -> fetch_assoc() && $curYear == $row['ayr']) {
$scap .= "Hello <br>";
}$result->free();
}
minus giving you my query
 
@methhead why are you doing that in PHP? SQL can do that for you
Oh wow.
"Hey this benchmark is taking forever."
^Cs
What was the command line?
$ ./php-optimised
 
My sql query:
SELECT mods.mid, mtitle, credits, enrl.ayr
FROM stud, smod, mods, enrl
WHERE stud.sid = '154279'
AND stud.sid = smod.sid
AND smod.mid = mods.mid
AND stud.sid = enrl.sid
ORDER BY enrl.ayr DESC
 
I'd forgotten to pass the argument 😞
@methhead are you familiar with GROUP BY?
 
yes if i use GROUP BY ayr

Then everything gets grouped into one row. When in turn I actually want to only group the messages with the year. Bundle them up together so i can just in php print those messages which were in the same year
 
11:51 PM
@MarkBaker this seems very ok @MarkBaker
 
yeahhhh... let's stuff BC breaking changes on the next patch release and not on the major release because the world will end if we don't ship 7.0 before holidays news.php.net/php.internals/89436
 
@marcio it breaks BC with RCs
 
@marcio We can probably thank PhpStorm for it even being considered a BC break.
 
btw, now I became another person marking everything as read. It took a while, but I'm sick of people defying simple cartesian logic when it's perfectly applicable.
 
Someone discovered it would stop complaining about undefined types if you stuck a \ in front of the scalar type :P
 
11:59 PM
lol
 

« first day (1866 days earlier)      last day (3082 days later) »