« first day (1755 days earlier)      last day (3418 days later) » 

user924016
12:00
=]
posted on August 06, 2015 by kbironneau

/* by Ullaakut */

@tereško you been drinking again?
@Naruto just one beer
but I still havent made breakfast
1 beer of 2L? :P
nope, a nice 0.5L bottle
hell, it's even embossed
12:07
Hi guys
@tereško I think you're to drunk to remember how much you drank already :P
fuck no
I want to implement SAML IDP using symfony2. Any one help me how to start that.
Damn, my vacation is over and I already miss it, hearing you talk :P
> Websockets are a protocol allowing bi-directional, full-duplex data transfer over a single connection. Learning how to implement real push notifications opens up the world of event-driven programming and what better language to take a look at this technology with than PHP?

This talk involves the story of a mostly legal side project of mine involving torrenting, data transfer and the joys of event-driven programming. Walking away you should have a clearer understanding of websockets, some of the tools and libraries available to help you on your way, commercial options, and how to buy a VP
>:P
12:12
@Jimbo what's that?
@SergeyTelshevsky My next talk at my local user group
If you're ever frustrated with the world and how awful technology is, just remember that it only takes someone realising at which endpoint an ICBM launch system is connected to the Internet for the world to end.
DELETE /world 200 OK
8
@Jimbo that should be 204 imo
critical military installations are not usually connected to internet
12:15
409? :-)
@tereško I dearly hope so.
@Andrea well .. when it comes to USA nukes, watch this: youtube.com/watch?v=1Y1ya-yF35g
Iranian nuclear system was off the grid (remember, Stuxnet incident .. and the global aftermath)
@Andrea, it's not the proper nuclear launch systems that you have to worry about. Instead the problem are multiple nukes that were "lost" after collapse of USSR
well .. those, and the possibility that north korea has some of them and might go full retard anytime soon
then again, nuclear detonations in korean peninsula would not trigger WW3
12:31
@HamZa i have another problem with the same regex... what would you do if there shouldn't be a match in case of another ":" is before "Total: Pages 11"? Example: regex101.com/r/vU4oU8/2 <-- basically there shouldn't be any match, but only if there would be "Total: Pages 11"
Anonymous
do we have any micro frameworks faster than Silex and better than Slim?
@samaYo as usual.. the DIY framework
Anonymous
Mine is a disaster ... my site has tons of errors, broken urls and uncaught exceptions .. I can no longer trust myself ...
5
If your framework starts with a try/catch block around the whole app.. ;)
lol
Anonymous
12:38
The index file boots the application via the bootstrap file, so I'll just try/catch it from there
@LeviMorrison I should have asked, if your unification of names/tables was implemented, what would be output by var_dump(Countable::count);? I think it might need to be ['Countable', 'Count']...
$id=$conn->quote(htmlentities($id));
$find=$conn->prepare("SELECT * FROM qs WHERE id=:id");
$find->bindParam(':id',$id);
$find->execute();
@Danack For some reason I kept reading it without the o #NothingPersonal #ItIsMeNotYou
$find->execute([':id' => $id]);
@PeeHaa That would be Irish notation...
:P
@FlorianMargaine Source
12:40
mysql_query("SELECT * FROM qs WHERE id=".$_GET['id']); ducks
Abe
Abe
@Danack ideally, it should return an instance of Method (looks like ReflectionMethod)
@Abe How could it? That would need to create an instance...
45 mins ago, by PeeHaa
@tereško Fuck you
Abe
Abe
@Danack functions/methods would all be lambdas
12:43
Hm. I just have a sudden urge to create a twitter account which tweets a CSPRNG string of 70 bytes (hex encoded) every minute (which seems to be about the correct rate limit for the API).
@Abe That sounds like it might have 'some' performance overhead.
Abe
Abe
class Foo{}
Foo->newInstance();
Foo instanceof Class<Foo> // true
function bar($x){}
bar->call($x); // same as bar($x);
bar instanceof Function // true
that, ideally
13:02
@samaYo it takes at least 3 iterations of your own framework to make something that is not piece of shit
Abe
Abe
@LeviMorrison would variables/fields be part of the unification you want to attempt? if that's the case, how would you handle the $? make it optional? as:
$x = new Bar();
x === $x; // true
@SergeyTelshevsky :P
hell ... that number is probably closer to 5
Abe
Abe
@tereško or ∞
not that much
Abe
Abe
13:04
hope so :P coz i'm at the 715th attempt xD
user895378
morning
Mornwrey
yo yo yo
@rdlowrey yolo
a wild krakjoe appears
13:16
krakjoe uses C
it's super effective!
E_CONTEXT_MISSING
</3
oh oh ... you were carrying on ...
I forget where that comes from ...
With the pokemon references yeah.
no one ever carries on ...
@DanLugg I'll not drop the ball next time ... must have been devastating ...
13:18
You can make it up to him by completing Pokemon Blue
@DanLugg would be lucky if a ball dropped
Ho ho
Is it acceptable to put static state in a global variable like $__amp_file_stat_cache (instead of static class variable)?
@bwoebi Do you value your soul?
yes.
13:26
This looks like non-normal PHP stuff anyway :-)
@Jimbo Like, what; out of your mouth?
I mean that seriously. As the state is anyway global, just whether hidden behind a class or just directly.
@DanLugg ooohhhhhh
@bwoebi there is no difference?
Touche man, took a while but, bloody good touche
13:27
@PeeHaa That's what I'm trying to tell @rdlowrey but he argues I'm wrong.
Nah, labored, and I just reopened the tab
@rdlowrey EXPLAIN YOURSELF!
:P
@bwoebi Hidden behind class is always better, since you can easily unit test other modules that use this class.
user895378
@PeeHaa how is there no difference?
@Leri How?
13:28
@Leri note it's a static variable, not an object var.
@rdlowrey Both are globally accessible?
user895378
@PeeHaa Both aren't globally mutable, which is the important part
@rdlowrey Yes they are?
Am I missing something again? :P
user895378
@PeeHaa How are you going to modify a private static class property outside the class?
oooooooooh private
user895378
13:29
yes.
@PeeHaa class UsesStatic implements Interface { /* all manipulation on static goes here wrapped in instance methods */ } and all your other code uses Interface
user895378
Bob is suggesting that it's better to use global $__hidden variable than private static $hidden
@rdlowrey Reflection. Like you have to explicitly import a global via global, you explicitly have to apply Reflection.
Reflection
^^
user895378
REFLECTION HAS NOTHING TO FUCKING DO WITH IT.
13:30
lol
lol
user895378
It's about being able to accidentally break the application by some library user naming a variable.
user895378
You can always break things on purpose
Reflection is really a non-argument.
user895378
It's about people not being able to break things on accident.
13:31
@rdlowrey That is certainly a valid point bob
Not totally unrelated, does anyone have a link to those examples where you were able to do hinkey stuff like call private methods through reflection?
@rdlowrey tell me how you'd accidentally name a variable $__amp_file_stat_cache if not on purpose?
user895378
I can't believe I'm having to explain why globally mutable state is a terrible idea.
11
I can't believe it's not butter.
Somebody get @rdlowrey a coffee. Stat!
13:32
@rdlowrey I can't believe how you can't understand that it's just the same.
user895378
@bwoebi It's not?
> Stat is a common medical abbreviation used in emergency room language to mean that something is urgent. Stat is from the Latin statim, meaning 'immediately'.
user895378
Encapsulation is not the same thing as globally mutable
When @bwoebi was talking about a static class variable I automatically assumed a public global var
@rdlowrey CONSTANT ALL THE THINGS
13:33
The danger of global variables is that you might accidentally reuse the identifier. But tell me how you accidentally reuse such an identifier, if not on purpose.
@bwoebi Not if it is private
you guys should add caps if you want others to notice what you're saying
@Jimbo tell me how to put a mutable object into a const … (in userland)
@bwoebi Erm... Runkit.
shrugs and hides
user895378
@bwoebi we aren't talking about an object, though,
13:34
@rdlowrey or mutable array, doesn't matter.
@rdlowrey We are talking about an object.
the mutability is the important point.
Okay okay, run the script, put it into a variable, then overwrite the php file with const = serialized object as string
2 mins ago, by bwoebi
The danger of global variables is that you might accidentally reuse the identifier. But tell me how you accidentally reuse such an identifier, if not on purpose.
hmm…? … e.g. __amp_file_stat_cache
@Jimbo a file system stat cache, nope ;-)
user895378
13:35
@kelunik I'm not. I'm talking about a single array that should not be globally mutable.
@bwoebi $GLOBALS = []. :P
@bwoebi project is for client "All Muppets Pounds", and I need a global file stat cache for it. However, I want it kinda hidden, so I add __.
Finally learning how to deal with reflections
user895378
@bwoebi YOU don't reuse it. A library user who doesn't know anything about your library does.
@kelunik now you're just trolling.
13:36
@rdlowrey Well, doesn't matter, thought you want to use ArrayCache.
if something can happen, it will happen
user895378
@kelunik no I don't because stat caches can use a more efficient invalidation algorithm
in this situation, you have a case where it just can't happen, so there's no reason to avoid it
@FlorianMargaine just as likely as you accidentally use reflection…
@bwoebi not really.
13:37
@FlorianMargaine my point…
You seriously underestimate Murphy's Law.
I accidentally Reflection all the time.
user895378
Yeah, those new ReflectionClass() lines are always typing themselves.
user895378
Like I said -- the problem with global isn't you accidentally reusing the same symbol. It's about someone who doesn't know anything about your library naming a variable that collides with yours and breaking everything.
@FlorianMargaine must be.
@rdlowrey yeah. And how likely is that with a well-choosen identifier?
13:39
@rdlowrey Everything we need are namespaced variables. :P
user895378
@kelunik I know right
user895378
@bwoebi But the point is why even allow the possibility?
user895378
A private static variable gives you ALL the same benefits with NONE of the drawbacks.
user895378
It's a stupid argument in the first place.
3 mins ago, by Florian Margaine
in this situation, you have a case where it just can't happen, so there's no reason to avoid it
13:40
@rdlowrey It's just as likely as that it collides with a project using the same namespace and class name than you do.
we are ignored :(
user895378
@bwoebi And why is a static property inferior? You have yet to provide a reason
@rdlowrey You can even add functions to call the static functions then. :-P
user895378
(hint: it's not)
@bwoebi No, that gives a class re-definition error.
13:40
@bwoebi except this will throw a fatal error
@FlorianMargaine yeah. and the other thing will probably throw notices too, because the array structure is bad.
user895378
1 min ago, by rdlowrey
@bwoebi And why is a static property inferior? You have yet to provide a reason
@rdlowrey it's not inferior per se. It's just not superior.
user895378
So encapsulation is worthless? Is that what you're going with?
(except that global vars are a bit faster)
@rdlowrey in this specific case, yes.
user895378
Well the entire field of programming disagrees with you.
@rdlowrey @FlorianMargaine doesn't seem to.
@bwoebi :uh?
2 mins ago, by Florian Margaine
3 mins ago, by Florian Margaine
in this situation, you have a case where it just can't happen, so there's no reason to avoid it
?
13:42
I disagree with you, sorry if you misunderstood me
Good morning
May 18 at 16:53, by Danack
@bwoebi Sometime Bob, you say really silly things when you don't want to change your preconceptions.
@bwoebi it means "you can use a private that doesn't have the drawback of a global, so there's not reason to avoid it"
@ircmaxell morning
Bob - you keep doing this. You defend your preconceived idea past the point at which your argument becomes tedious.
13:43
@Danack I'm not sure if I'm wrong or if I'm just fighting against a very common misconception.
@bwoebi That's always your answer if you propose something like that.
good morning
user895378
> Safeguard your account
> Add your phone number now to ensure that you can always log in to Twitter, even if you lose your password.
user895378
^ That's some serious Grade-A BS there
user895378
Sure, Twitter. I'll just give you my phone number because heaven forbid I forget my password and can't tweet.
13:49
I definitely wouldn't use global vars in random context, but mhmh… C has an advantage here as it allows global variables to be static (file local)…
@rdlowrey That always fucking annoys me. When working with oauth it is often even mandatory nowadays
user895378
@bwoebi Yes, this is what I'd like to be able to do ... if we had first-class packages we wouldn't have this issue
user895378
You'd have to explicitly import the variable from the package into your code to modify it
@PeeHaa Really? Didn't see that anywhere.
@rdlowrey you mean namespaced variables, not first-class packages?
13:50
@kelunik facebook for one
But I agree, that would be ideal.
user895378
@PeeHaa Yeah -- it always seemed like a backdoor for associating online identities 1:1 with real people. Basically eliminating the possibility of internet anonymity.
good morning
You cannot get a dev account without mobilenumber
@rdlowrey Yeah :(
@Orangepill o/
btw...this solves also ambiguity of get <-> File::get.
13:51
@kelunik ?
@PeeHaa Yeah, right...as provider. I had to do this as well there. "For emergency contact..."
How's using File\get() more ambiguous than File::get() ?
@bwoebi If you use just get.
@kelunik then you're shooting yourself into your feet.
I suppose there is some level of visual ambiguity. One can import File\get() and call simply get() whereas the class name must be present in the case of a static method.
13:54
@bwoebi Maybe we should change it to read.
File\file_get() is less ambiguous.
@DanLugg it's redundant ^^
user895378
@kelunik I originally had getContents() and putContents() but was asked to use get/put ;)
@rdlowrey Yeah, back when we had a class for that instead of functions. ;-)
I can't say why, but I would somehow prefer lowercase class names for classes just providing namespacing (modules): $contents = yield file::get(..) looks some better than $contents = yield File::get(..)...
Probably, because I'm writing a lot of Tcl currently.
@kelunik class names are case-insensitive…
13:57
in lisp, there's no case sensitivity at all
user895378
@bwoebi yeah but it will break autoloaders if you do that
everything is uppercased at read-time
it's nice tbh
@bwoebi Currently, yes, but there are conventions. ;-)
@rdlowrey depends if you're on a case-sensitive filesystem
@rdlowrey I think Composer uses ucfirst.
user895378
13:58
I've been liking lowercase things more lately FWIW
@kelunik Well, just in case it bothers you…
@rdlowrey actually, the trick is giving semantic meaning to the different casing (snake vs. camel)

« first day (1755 days earlier)      last day (3418 days later) »