« first day (1648 days earlier)      last day (3303 days later) » 

9:04 PM
if assertMatchTag is deprecated what are we suppose to use to match if an element exists or not in a given HTML string?
 
I have no idea what you are talking about, Kyle.
 
phpunit
for those who know what it is they also know its deprecated
so what do we use instead?
 
Use the DOM or xpath to locate the element and assertTrue on an exists check / assertEquals for a count check?
 
I can't even find this function when googling phpunit assert matchtag
It seems to be that deprecated.
 
@LeviMorrison google.ca/…
intelligence == win
any ways thanks @Charles
 
9:11 PM
You said assertmatchtag, not assertmatch lol
 
9:33 PM
ugh
loading a 4GB cachegrind file...
kcachegrind takes a while.
 
4 GB cachegrind file? wtf did you do wrong
 
Never underestimate the power of tightly coupled procedural code.
though I think the largest we were able to eek out of it was like two and a half
 
It's a migration script taking hours to run... And the "why is it so big" is why I have to debug it...
 
0
A: How to create a random string using PHP?

ircmaxellSo, let me start off by saying USE A LIBRARY. Many exist: RandomCompat RandomLib SecurityMultiTool The core of the problem is almost every answer in this page is susceptible to attack. mt_rand(), rand(), lcg() and uniqid() are all vulnerable to attack. A good system will use /dev/urandom fro...

^^ to displace some of those HORRIFIC answers
 
ThW
9:54 PM
@KyleAdams assertEquals()/assertTrue() combined with DOMXPath::evaluate() is an easy option.
 
@ircmaxell I am not sure there is much you can do about that topic
it would be more humane to kill it as whole
 
@bwoebi @Charles btw, it's only 4GB because there was no space left on the disk
 
@FlorianMargaine Nice
 
@FlorianMargaine haha
 
@ircmaxell function getRandomString() { return 'ythb g'; // chosen by face hitting keyboard, guaranteed to be random }
 
9:57 PM
function getRandomString() { return 'RandomString'; }
 
@ircmaxell Other than using a decent library to generate a non-predictable value, do you know if there's any other considerations that should be taken into account when generating a session ID to be stored in a client-side cookie?
 
Ugh... kcachegrind is stuck at 100%...
 
@LeviMorrison wait, is that working???
 
@ircmaxell btw. the answer is nice, but it actually doesn't answer the question ;-)
@ircmaxell the question asks for a random string based on just a subset of all the 256 chars.
 
9:59 PM
Well... Computer is hyper swapping. Thankfully I can keep you guys updated on my phone :D
 
@ircmaxell Not yet :)
But essentially matching has two parts: a type and values.
When you provide a literal value the type is inferred.
Oh, a third part would be data extraction.
So like:
 
and not everything random needs to be cryptographically secure, but whatever - the question sucks to begin with
 
class Foo {
    public $a;
    public $b;
    function __construct($a, $b) {
        $this->a = $a;
        $this->b = $b;
    }
}

match ($unknown) {
    case Foo(1, $b) {
        // match a Foo when Foo->$a is 1
        // also extract the value of $Foo->b into $b
    }
}
I think I know how to make positional matching like that work.
 
hi. just wondering why there is no an object oriented unmanaged language with beautiful syntax that could be used to build performance memory critical applications e.g games ? c++ is aweful. so why there is no alternatives why no one did this
 
@someone To begin with, writing good languages is really hard.
 
10:04 PM
@LeviMorrison that I do not like
 
@ircmaxell What aspect of it?
 
the positional deconstruction of name-based storage
 
I feel like it's relying on a detail
something that shouldn't be exposed
case Foo(a: 1, b: $b):
 
@LeviMorrison yes it's but look at c# java they are nice. someone could make an unmanged version of them. it's not easy but worth it and we get rid of c++. cout<<< eww
 
10:07 PM
@someone Java is not nice.
 
what would you prefer do you use Java or c++ :) ?
 
@ircmaxell Fair.
@someone C++ practically every time.
 
@someone well, you're someone - so have at it :p
 
Java is a language which is focused on objects, yet every time you declare a type of a variable there is this always available option of null. There's no way in the type system to rule out that something is not null -- it has to be a logical check. This is a very special type of hell.
 
but how it's too ugly :( mostly unreadable @PaulCrovella i actually noticed that when i wrote it :)
 
10:09 PM
@someone functional > beautiful
C++ also has const guarantees whereas Java really doesn't.
 
yes i agree funtional languages are beautiful
 
There are a myriad of reasons why C++ is better than Java, despite C++'s sometimes horrible syntax.
For me there is but one use-case for Java: some library or libraries I want to use is/are written in Java and the organization doesn't want to use another language that runs atop the JVM like Scala or Ceylon.
@ircmaxell syntactically that can probably be worked out.
 
i think there should only be one programming language in the future instead of a dozen with different implementations for different purposes this could be cool instead of having to learn a lots of them. one could be used to talk with the computer
 
@LeviMorrison well, just some method of identifying the property
ohhh
 
What about associative arrays? roughly the same?
 
10:13 PM
yeah
though with arrays
 
case array(foo: 1, bar: $b, ...$remainder) {}
 
hmmm
not sure
 
Alternatively you just use the same as the declare syntax:
case array ("foo" => 1, "bar" => $b) {}
@ircmaxell What happens if the above array has a key "baz"?
 
@LeviMorrison it isn't matched
 
yo)
 
10:15 PM
case array("foo" => 1, "bar" => $b, ...) would match any array with those 2 keys
 
So something like this would be required to ignore the rest:
case array ("foo" => 1, "bar" => $b, ...) {}
 
hey @ircmaxell, why the twitter ban ? Wanted to check out a tweet and it says you banned me 0_o
was that on purpose?
 
see, we think alike :-)
 
@ircmaxell This is more bikeshed level, but braces on the case statements or : and the next case or default implicitly ends the previous?
I like the braces, personally.
I think it makes the parser a bit simpler too.
 
I think braces are OK.
well, actually, yes use braces, because you have variable bindings, so there is scope to them
 
10:22 PM
@Dracony Anthony probably has banned you too here?
 
did not know its possible
anyhow, as long as its on purpose I don't care, I thoguht it was an accident
 
Well, I would care. I don't think Anthony is someone who bans without reason…
 
Anonymous
@SecondRikudo My condolences for not getting elected. Keep hope alive ✊
 
Oh wow… @SecondRikudo even was the one with the least votes
 
10:51 PM
@JoeWatkins It's not that 'desktop' is somehow better than 'web'. The whole security issue is running PHPMyAdmin over plain HTTP while desktop apps can tunnel through a more secure SSH
 
11:10 PM
Okay… phpdbg is now breaking at the stack frame where an uncaught exception is thrown.
 
11:31 PM
I was shocked nobody had really talked about this angle in the "learn javascript over PHP" thread over on reddit: reddit.com/r/PHP/comments/339ofn/…
 
@LeviMorrison [there's also a lot of JS hate...]
 

« first day (1648 days earlier)      last day (3303 days later) »