« first day (2316 days earlier)      last day (2639 days later) » 

2:00 PM
anyone wanna implement LIBXML_NOXMLDECL?
 
Is Jeeves just generally getting slow in his old age or?
 
@DaveRandom yeah oversight on my end @PaulCrovella
 
!!lxr LIBXML_NOXMLDECL
 
@DaveRandom Nothing went wrong but I couldn't find a suitable definition
 
Just be normal and don't shout at thepoor bot
@Sean any specific reason you ask?
 
2:10 PM
 
ugh, speaking on the phone is so tiring…
 
@Trucy try sitting on chair instead when calling somebody
 
@PeeHaa can't, I don't have a chair any more. I had to choose between having a new PC and keeping my chair
 
@Trucy looks like you made the right choice
 
2:23 PM
@Eugene not enormously portable (time_nanosleep()), but yes
ftr expecting anything better than millisecond precision, especially in an interpreted language like PHP, you're gonna have a bad time
 
2:35 PM
@taylorotwell Get in the back of the van. Now! 👮
I can't remember, who was PHPPolice again?
@PeeHaa I don't do that dude, if I need to be 'professional' I tend to pace, really helps
Pacing, facial expressions and enunciation, hand waving etc...
 
!!uptime
 
╔══════════════════════════════════╗
║ [10 seconds] without an accident ║
║   since [2017-02-17 14:38:35]    ║
╚══════════════════════════════════╝
 
!!Should this work or not?
 
this should not work.
 
Tough, it does.
!!alias Jimbo Should Jimbo suck it or blow me?
 
2:40 PM
Command '!!jimbo' aliased to '!!Should Jimbo suck it or blow me?'
 
!!Jimbo
#fail
!!jimbo
double fail
 
Lmao
 
> type-hints are a waste of time and lead to poorly coded, brittle systems
what the...
 
TIL C produces poorly coded, brittle systems
 
C is not a good counter-example
C does produce poorly coded, brittle systems
Or, more accurately, C developers often do
 
2:44 PM
That explains PHP
 
3 messages moved to Trash
 
@Jimbo lol
Tèeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeest
 
!!jimbo
 
@Jimbo should suck it.
@Jimbo should blow you.
 
Well, I'm clearly leaving that one there
 
2:53 PM
should special-case the antiping to exclude him too
 
Well !!should is quite clever about pings, in that it will allows pings through as long as the user is pingable and the invoking message didn't ping them
!!should @PaulCrovella get a ping now or not?
 
@⁠PaulCrovella should not get a ping now.
 
!!should PaulCrovella get a ping now or not?
 
@PaulCrovella should not get a ping now.
 
brilliant
 
thanks Gordon haha
 
@Eugene from my experience.
 
3:36 PM
Morning.
 
\o
 
3:51 PM
Every time a user enters the number and street in a "House Number" field and leaves the first address line field empty, a developer dies a little more inside.
 
Every time an address section of a form has more than 1 or 2 fields, a user dies a little inside.
 
oh thanks @bwoebi for fixing the array docs. I kinda think that Miken guy is involved with laravel or something
 
@FélixGagnon-Grenier :-D
 
4:14 PM
grumble
Anonymous classes... can't do cool stuff like extends $t::class
 
@DaveRandom Lmao, what have you done
 
@Sean I fixed the problem that I uncovered there, turns out that I merely discovered an existing issue rather than creating a new one
!!> var_dump(substr('foo', 4))
 
Hi guys.
 
^ IMO this should return an empty string, literally every other combination of "invalid" params does
 
4:18 PM
I'm trying to develop a module such that, if I pass a block of data.
 
@PeeHaa Ah sometimes its responses are very delayed, is all.
 
anyway, that + strict mode was the cause of the problem, a simple ?: '' fix
 
It will remove off common words and return a list of the remaining words.
Basically, pulls out keywords from a block of text.
 
!!jimbo
 
@Jimbo should suck it.
 
4:19 PM
What would be the best way to
Implement such a system?
 
!!> $keywords = ['foo', 'baz']; $input = 'foo bar baz qux'; var_dump(array_intersect(preg_split('/\s+/', $input), $keywords));
 
[ 5.6.0 - 5.6.30, hhvm-3.15.4 - 3.17.1, 7.0.0 - 7.1.2 ] array(2) { [0]=> string(3) "foo" [2]=> string(3) "baz" }
 
Like that? @HassanAlthaf
 
Something like
We have created a platform for help at home. However, we?ve done much more than just that. We?ve created a COMMUNITY by connecting students and clients on a PERSONAL LEVEL.
Lets say I pass that.
- help at home
- community
I get those as an array.
Any idea how?
 
!!jimbo
 
4:25 PM
@Jimbo should blow you.
 
again?...
 
@HassanAlthaf How big is you list of keywords?
 
He's currently pooping his pants, hope he cleans up first
 
@DaveRandom I do not have a list.
Any sources I could get a keyword list that matches that idea?
 
@HassanAlthaf then how are you expecting to know what to look for? :-P
 
4:26 PM
@DaveRandom I know. I need a source for a keyword list.
Thought someone might have gone through this xD
And my bad, I did not structure the question right.
 
The naive approach (such as array_intersect()) is O(n), or in other words as you list of keywords grows, so the execution time grows, to the point where it becomes impractical sooner than you think
 
Yeah, unfortunately.
O(n) is the only approach.
And is totally satisfactory for my requirement.
Because, I will not be having blocks over 200 words. That's a few milliseconds of processing.
 
I thought O(n) is an optimized performance.
 
I think you should look at specialised text indexing tools like lucene/sphinx
 
What do you mean Dave
@Shafizadeh O(log(n)) is.
 
4:30 PM
!!? apache lucene
 
Search for "apache lucene" (https://www.google.com/search?q=apache+lucene&lr=lang_en)
• Apache Lucene - Apache Lucene Core - Apache LuceneTM is a high-performance, full-featured text search engine library written entirely in… (http://lucene.apache.org/core/)
• Apache Lucene - Welcome to Apache Lucene - Search engine library with many features including fast indexing, ranked searching, boolean, phrase… (https://lucene.apache.org/)
• Apache Lucene 6.4.1 Documentation - Apache LuceneTM 6.4.1 Documentation. Lucene is a Java full-text search engine. Lucene is not a comp… (http://lucene.apache.or
 
So, it basically is a list of powerful keywords from text?
Oh wait, it's a software.
 
It's a specialised tool for dealing with fulltext indexing
 
I need to implement this in PHP unfortunately.
 
a subject about which I know next to nothing, btw
@HassanAlthaf google around the term "fulltext index"
I'm sure some crazy people will have written PHP libs
 
4:33 PM
Alright mate. Thanks for the heads up.
I found a list btw.
And I have written some mcode.
I don't know why it isn't working logically.
$this->parseText($text);
$this->generateKeywords($this->words);

if(in_array('the', $this->stopWords)) {
throw new \Exception('yes!!!!');
}

return $this->stopWords;
I wrote some simple code.
The array stopWords has 'the'
as the first element.
But, it doesn't seem to throw the exception.
The exception is thrown when I not the condition
 
@crypticツ yeah, it would, although some magic constants probably shouldn't be detected by EA Inspections (bug?)
 
@HassanAlthaf can you show var_dump()?
Remember in_array is case-sensitive
 
array(1000) {
[0]=>
string(4) "the
"
[1]=>
string(3) "of
"
[2]=>
string(3) "to
"
[3]=>
string(4) "and
"
[4]=>
string(2) "a
There is a line after each character?
 
Yes, there's a \n
Your generateKeywords() method should trim() items before putting them in the array
 
I see.
 
4:46 PM
evening roomies
 
Actually no, Dave.
 
\o
 
We gotta clean it off when populating the stopWords array.
Fixed it.
Thanks
 
@Leigh that's not cool!
 
4:56 PM
Btw guys,
 
@bwoebi I know right, not cool that it doesn't let me do that
 
I want to write a regex so that: In a sentence, it selects all string words only. For example: "Hello, my name is Hassan and I'm 16 years old." It will only select stuff like "Hello", "I'm" "name" it will ignore any numerals.
How would I go about that?
It will also strip off any characters.
 
what have you tried?
 
^ that
 
I can give you some hint: "word boundary"
 
4:58 PM
I tried \w+
 
and that doesn't work?
 
It works.
But it does not select "I'm"
And I do not want "16"
 
yep, google "regex word boundary"
for numerals, I'll let you figure it out on your own
 
I did.
It still doesn't select I'm
 
\w means "all symbols"
you just need [a-z0-9'] .. or something like that
 
5:02 PM
Yeah
[a-zA-Z]+
I tried that.
No matches.
Medical miracle. works now.
 
@HassanAlthaf regexr.com/3fats
bullshit
 
Yeah. I made a small mistake.
Thanks a lot bro.
/([a-zA-Z']+)/ worked for me.
 
anyone who can become an expert in c++ and still enjoy it is a danger to society
 
cc @Sara ^
 
@HassanAlthaf I'm really good at regex, if you have any question (in future) let me know ;-)
 
5:08 PM
@Shafizadeh Sure bro! Thanks for your help!
 
welcome ;-)
 
@Shafizadeh so that's how you have been collecting the fake internet points
:P
 
@tereško :-) ..! Why did you call "fake" the points come from regex answers?
 
@HassanAlthaf you can use the /...../i flag to get a case-insensitive regexp
 
@bwoebi @kelunik @rdlowrey can I use 5.6 features in amp/dns? Please? Pretty please? With sugar on top? 5.5 is so EOL at this point it's not even funny...
 
5:12 PM
@Shafizadeh we all write answers to get "fake internet points"
 
All I want is one tiny constant array, that's it
 
ah :-)
 
@DaveRandom what so crucial in PHP 5.6 except const scalar exprs?
 
Well that would be nice as well
 
this guy is really lucky ..! He has earned lots of fake points just by answering one question!
 
5:16 PM
@tereško Realized mate. Thanks a lot!
 
What it is isn't that relevant, the point is more that supporting 5.5 at this point is passively harmful
and slightly crippling
 
> Last seen Feb 8 '10 at 4:26
I don't think he cares
 
yeah!
 
5:57 PM
@DaveRandom Where is it really harmful? You can drop support for it in the Amp v2 version.
 
Hmm.. What do you guys think about this bug? Would it really make more sense to show the line of the property instead of where you try to instantiate the class?
 
Concerning RBAC implementation...
I've read Tony Marston's page and many other resources, but wanted to ask you guys. Do you prefer to check if the user has the proper role at the time they try to access a certain page, or at sign in load up a session with all of their roles and check permissions at time of access?
 
user895378
@DaveRandom yeah just start a v2 branch and then you can play with all the php7 goodness
 
6:14 PM
@BruceBanEm I usually do the access check per controller+action and not "resource"
then again, I do the access check via a decorator, so that affects to approach a bit
 
@tereško What do you mean by "decorator?" I'm not familiar with this term in coding.
Classes?
 
@rdlowrey :sadface:
 
@DaveRandom We're not going to just bump requirements now.
 
@BruceBanEm see the SecureContainer class: stackoverflow.com/a/9685039/727208
 
On a happier note, lxr.room11.org/xref/amphp%40v1 @bwoebi @kelunik @rdlowrey @Trowski
 
6:19 PM
@tereško Thanks for this! This answered another question for me. I've seen this pattern in some of the answers I have come across when looking for a solution but did not know it had a name. Really appreciate the knowledge!
 
there are some issues regarding interfaces, which is why I prefer applying it on controllers (which usually dont have a defined interface)
last time I implemented, it was about ... emmm ... 6 months ago
 
@pmmaga yes, but you likely don't know the line number
 
and in the DB I was storing "signatures" of classname+method ... or any other signature
 
@tereško haha, Class Membrane. Good name. Thanks for this.
@tereško I started this project at work in 2014 and at the time I just verified the user had a proper login SESSION set, then I added an access level SESSION too. It kind of took off and they wanted more added to it for more departments which went outside of the scope of a access level setup.
@tereško I went to roles but each person only had one role. Now that it's continued to grow users need more than one role and before it grows more I want to implement an RBAC method to better handle permissions and create a page where I can create role and users to that role. I know there are a lot of libraries for this kind of thing, but I want to do this from the ground up because it helps me to have a better understanding of how it is invoked.
 
are you writing a novel ..!?
 
6:33 PM
Would you run validation as part of middleware?
 
@NikiC indeed :/
@NikiC and about github.com/php/php-src/pull/2388 what would you suggest? master only sounded ok(ish) to me
 
Wes
7:04 PM
evenings
 
o/
oh shiite.
it's friday
let self = suspiciousTemplate.toObject().activate();
 
@BruceBanEm sorry .. was AFK: cycling home
@BruceBanEm the approach I described is actually really good for migrating legacy code, because it does not require to rewrite any internal code
instead you can simply wrap your existing code in this and start incrementally migrate the project
 
Wes
i always make a fool of myself :'(
 
what could cause margin: 0 auto; to not center an element? Its parent is a block level element with a defined width, and the element has a class with a defined width, and display: block;
WAIT
I think I know
I thought it was a float issue, I was wrong. fuck.
 
well, it's css. it could be the position on either of these elements, or any of their children
or something else entirely. a fiddle would completely help in helping you, if you can do one :)
 
7:19 PM
sure, gimme a sec
it's a button within a form
 
user895378
@DaveRandom oooh shiny
 
lol, fucking jsfiddle is working as intended.
I guess I'm pasting a quantity of the code
 
@Tiffany you know of the inspector?
web console, or stuff like that? it helps a lot with that, lets you remove and add style to elements directly in the browser
 
yeah, I'm using inspector
it's in two containers, both have a width of 100%
crap, well, the URL is in there. oops.
thought I took it out
inspector/dev tools are the first things I always try if something's not positioning right. I didn't google hard enough, but from what I read, I needed to define a width for the element, which I did. I'm wondering if there's some kind of interference either with floats or the parent containers?
tried taking it out of one container, but no dice
 
So I'm having a bit of trouble embedding a video in a page. I don't want to include the file in my public folder, but I'm not sure how to set the src tag otherwise.
 
7:33 PM
@Tiffany so you want the search button to be centered?
 
@FélixGagnon-Grenier yeah
@Programmer public as in public_html?
 
@Tiffany hmmm... did you happen to actually forget to add margin: 0 auto and display: block on the button?
 
@Tiffany not 100% sure what you mean, but I mean my publicly accessible directory for images, css, js etc.
 
@Programmer public_html is a folder that some web hosts have as the folder where all of the web files are stored
 
I'll go with yes then :)
 
7:36 PM
@FélixGagnon-Grenier nope, it's in the css
WAIT
I see it
margin: 0 auto; is getting overwritten
doh
 
Hi There
 
fucking specificity
 
I want help
I can't be able to pass any url using php ?url=a.com
 
@Tiffany actually, in the fiddle originally pasted, the input lacked the class button
adding it backed solved it
 
It's auto redirecting to main directory
 
7:38 PM
@Programmer the file has to be stored where the web server can access it, so outside of, per se, public_html, you won't be able to include it.
 
It's crazy how type-hints consistently ruin the simplest of changes. 😓
 
@Tiffany ?
 
am i too late?
 
@FélixGagnon-Grenier yeah, I looked deeper in inspector and saw that another class is over writing it. Time to make this class more specific.
@AslamMohammed what?
 
I want help
I can't be able to pass any url using php ?url=a.com
It's auto redirecting to main directory
 
7:40 PM
@Tiffany I figured. I found a way where I could set the headers, but it's not embedded that way.
 
@AslamMohammed Maybe this helps: stackoverflow.com/questions/768431/…
 
@AdilIlhan useing you're type's good (grammar/spelling errors are intentional)
 
It's not my question
Now If I pass some variable using PHP GET it's working but URLs not
http://abc.com?somevar=var - working
http://abc.com?someurl=http://ab.com - not working auto redirecting to main directory
 
7:42 PM
@pmmaga
 
Halp
 
@Sean Is that the pin?
 
Uh, I wrapped both unpin / pin calls around the new helper method
 
Now If I pass some variable using PHP GET it's working but URLs not
abc.com?somevar=var - working
abc.com?someurl=http://ab.com - not working auto redirecting to main directory
 
so I don't think so
 
7:45 PM
Do you have solution ?
@pmmaga
@Tiffany
 
stop randomly pinging people
 
I have no idea how to solve what you're wanting to do.
 
is it the fault of hosting provider ?
 
@AslamMohammed what's the value of someurl when you try that?
 
7:51 PM
example

http://mydomain.com?profile=http://as.com
rather executing its redirecting automatically to main directory I do not know why /
 
@AslamMohammed it may be, yes
 
8:02 PM
@AdilIlhan lol wtf
 
@pmmaga yeah, i just saw it
 
omg... this guy.
 
Wes
tbh he's right, type checking should be done statically... ideally
and i would like to have magic methods to be able to implement interfaces :B
/me awaits insults
 
well, at least you never pretended to understand oop :D
 
Wes
true. i know nothing
 
8:17 PM
jon snow
 
@Wes i must be missing something. So the idea is that the constructor on the Decorator should actually return a Target?
 
Godd afternoon
 
@Wes I don't understand how you get in these situations. I... never have to resort to such trickery, and type hint heavily, to interfaces, or concrete types, from time to time, and am not having problem with refactoring, nor am I blocked in development
I understsand that I am not writing somthing of the order of magnitude of Laravel, but ... idk. seems strange
 
Wes
@pmmaga i tried to write a rfc about method delegation:
interface Whatever{}
class Foo implements Whatever{
    private Whatever $delegatee implements Whatever;
    function decorateSomething(){}
}
basically all the calls to Whatever would be delegated to $delegatee, except the overriden methods
or something like that...
some suggested it should work through magic methods, eg:
function __call() implements Whatever{}
@FélixGagnon-Grenier if you embrace composition / aggregation over inheritance, you end up writing a lot of wrappers
and wrappers have that problem
 
Yeah, I do that.
I have most of the time a single class, in a whole architecture, that extends another one.
 
Everything else is composited
 
@Wes so, in his case he wants to do that for the constructor?
 
Wes
i have no idea what he wants to do, just saying that writing wrappers is a pita
__call etc would be great, but they can't implement interfaces
 
@Wes ok, i think i got it. thanks
i think the idea of a constructor actually returning another class took a bit to sink in :P
 
Wes
also type checking at runtime is a lot of overhead. when application works and types are used correctly you can disable them (as long your code doesn't rely on TypeError being thrown)
hack i think can do that, types are checked statically and type declarations are disabled at runtime... optionally, perhaps
 
8:29 PM
is the difference anything measurable in php?
 
Wes
on a single request, no - on millions of requests, probably
 
I wonder how it's managed in hhvm
 
8:54 PM
wow, is material shiny. I love it
 
9:04 PM
@Wes interesting rfc, I was playing with proxying within php-ref ext experiments, though you went further. Do you have implementation for that or something in mind?
 
@DaveRandom what did you mean by that?
 
Wes
nope, i have no clue about internals @pinepain there are a lot of issues with it though... will go back working on it sooner or later
 
@Eugene I mean that the system clock and the kernel scheduler is just not capable of giving you that level of accuracy.
(on most systems)
And also, if you really need that level of accuracy, PHP - or any interpreted language - is not the tool for the job
 
@DaveRandom regarding accuracy you mean available units, that I wrote?
 
I mean that you can tell the system to sleep for 3 nanoseconds but chances are it will sleep for a lot longer than that.
 
9:18 PM
@DaveRandom Especially considering that even a switch-less syscall will take 20x that time
 
I'm making code more readable, Bob is gonna hate me github.com/amphp/dns/commit/…
@NikiC also this
/me is out
 
I've got Call to undefined function socket_create() is it possible to compile PHP without sockets?
 
@DaveRandom not sure why I should … the main thing you need to explain to me is this udp server thing … I thought we do requests, not be a server? Slightly confused…
 

« first day (2316 days earlier)      last day (2639 days later) »