« first day (1946 days earlier)      last day (2999 days later) » 

9:00 AM
@tereško PHP Version 5.5.30
 
Wes
@JoeWatkins is it normal that i hate that ginger radio guy that will host top gear?
 
totally normal ...
 
why would you even care about Top Gear?
 
he is an acquired taste ....
 
Wes
which is too bad because i'm gonna love matt leblanc harris and eddie jordan
 
9:03 AM
we don't think we're going to even watch it ...
chris evan's only saving grace is that he is a genuine car fan ... but his ability to annoy just by talking is overwhelming for me, I can't watch an hour of him ....
 
Wes
i don't know, it could get interesting
chris evan's is an idiot
do you know what he did with his ferraris?
 
he's the main man, he's gonna be on the screen most of the time ...
painted them white and put them in a garage with a piano that plays itself ...
 
Wes
who in the world would make a red ferrari white? only a bad person
 
he also doesn't have the credentials any of the other hosts had, they are genuine motoring journalists
 
Wes
he's not even funny
 
9:07 AM
yeah, he's really not ... I've avoided television and whole radio stations with him on them my whole life, one more program is no bother ...
also, the others will be on amazon by then probably ... I'll just wait for that ...
 
shopping
 
James is doing some other bbc documentaries ...
lata @tereško
I'm out too, gonna walk dogs ... lata all ....
 
Wes
later \o
others are a great choice though. replacing clarkson and friends is though
chris evans is not one of us, not an actual car mad person :P just a freak with ferraris
 
hey @*
 
9:24 AM
Interesting that there were two data structure posts on reddit on the same day.
 
Wes
what's the other one?
 
Wes
ah, seen it
 
Only just saw it, not sure how I missed it.
Makes me want to do a video about php-ds
 
Wes
btw how did you made those cool slides with lines of code showing what they do?
 
9:30 AM
Codepen :p
 
Wes
lol, using js?
 
Yeah. Didn't plan on sharing that code ever so go easy..
 
Wes
it's awesome anyway :D
 
Thanks :D
 
Wes
can you explain why spl's iterators are so redundant with the data structures they iterate over?
 
9:38 AM
I'm not sure I get what you're asking exactly.
 
Wes
me neither. i could never understand spl
php.net/manual/en/class.outeriterator.php ¯\_(ツ)_/¯ i have no idea why this is needed
 
Isn't that the same as IteratorIterator?
 
Wes
yeah that's an implementation
 
Yeah noticed as second after I linked it. Didn't know there was an interface above it.
> This class can be extended, so it's an ideal building block for your own classes that only want to modify one or two of the iterator methods, but not all.
¯\_(ツ)_/¯
 
Wes
lol
so, planning some changes to ds?
 
9:49 AM
I am indeed.
There is some refactoring to be done also.
I want to replace contains(...$values) with contains($value) and containsAll($values)
Also difference, union, intersection and exclusive for Map
(including bitwise operator support)
+ and += for Sequence as well.
 
hellow
 
can you guys help with hybrid auth
I have error like this Authentication failed. The user has canceled the authentication or the provider refused the connection. In Facebook
 
Wes
@rtheunissen you probably need the latter only, as if you want to check a single value you can do $coll->contains([$something]);
 
I'd rather then keep the ...
Still 50/50 on that.
 
Wes
9:55 AM
that always involves a conversion to array, no?
 
I'm not 100% on the internals, purely from an API pov
I like contains($a), contains($a, $b) and contains(...range(1, 10)) or contains(...$array) or contains(...$ds)
 
LOL i was seeing this - phpixie.com/blog/standard-php-library-datastructures.html and suddenly it was unraveled that splStack() is slower than a normal array.. :P
 
I'm 50/50 on containsAll
@GourabNag I think Dracony was using php 5
 
oh i see...........
 
Because SplDoublyLinkedList uses more memory than an array
 
Wes
9:58 AM
also no random access
 
SplStack is both slower and uses more memory than an array
Does have random access!
But it's O(n)
Which.. might mean no random access depending on your definition.
 
Wes
yes - that's what i meant :P
clearly arrays are faster on that
 
so why is it still there if its slower and also memory hungry
 
@GourabNag read this: medium.com/@rtheunissen/…
 
Why would a stack consume more memory than an array? That sounds like an atrocious implementation.
 
10:00 AM
It's implemented as a doubly linked list.
 
Wes
dll is not too bad. when the array has a considerable size, you notice it's faster than arrays on certain operations, like unshift
 
Which has, per node: 2 pointers + zval + int for refcount = 2 * 8 + 16 + 8 = 40 bytes.
 
hi guys, i think i'll go insane with this rewrite:

```RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^?]*)$ /mvc-framework/index.php?path=$1 [NC,L,QSA]```

it just doesn't work, going to localhost/mvc-framework/test/test
 
yeah doubly linked list is quite efficient on its own!!
 
what am i missing?
 
10:01 AM
A PHP array bucket requires only 32 bytes.
@Wes is correct regarding unshift but it's an unfair comparison: O(1) vs O(n)
 
Wait a minute. Why would an unshift be O(n) in a PHP array? The hashtable has a head pointer.
 
@GourabNag SplDoublyLinkedList is not efficient, there is not a single reason why it should be used over an array.
 
Oh wait, you have to redo the buckets.
Never mind
 
....... :/
 
@Sherif you have to update the numerical indices of each bucket
 
10:03 AM
@rtheunissen Yea, brain fart moment
 
:)
@Wes what's your thoughts on a Heap?
 
That's what typing faster than the speed of thought gets you.
Hmmm, I wonder if I should submit my bloom filter implementation to this new ds extension.
 
@rtheunissen i have a hunch that you actively develop PHP... do you??
 
Not at all, I just wrote that ds extension :) The one I linked before
 
@rtheunissen oh hey, that's you ^^
 
10:05 AM
@Sherif I'd be happy to take a look at it if there's a good use case for it.
 
@good_evening lol, why do you have a folder called "mvc framework"?
 
@rtheunissen Why would there not be a good use case for space efficient set membership query? There's no alternative to it in PHP.
 
@tereško i am creating an mvc framework that you will use very soon
or maybe... just maybe... it was an example
 
btrees and bloom filters are two data structures I've long wanted in PHP.
 
@Sherif set membership you say... like isset($a[$value])?
 
10:07 AM
so the bottom line for me is to use array... cuz its sometimes better than those Spl's otherwise the difference in performance is not quite notice-able...
 
If it's the one example that I suspect, it's a really bad one
 
@GourabNag you can use them.. just don't do so for performance reasons.
 
Wes
@rtheunissen i don't use spl heap because there is some weird behavior with the iterator iirc. i'm not great with data structures implementation though, my knowledge is limited to the few things i learned in school. i know heap is a tree but that's as much as i remember :P currently i'm focusing more on the api. but i do implemented an avltree once in php... just to realize an userland implementation is basically always slower compared to C ones :D
 
good thing you're suspecting something
 
Made by "paniqeu" or something like that, it's shit
 
10:09 AM
@rtheunissen Correct, except it has O(k) time and far more efficient space complexity for large sets.
 
@Wes I'm also building on what I learnt at uni.
@Sherif how does your O(k) compare to an array's O(1)?
What's k?
 
what is uni ?
 
University
 
College, university
 
@rtheunissen @rtheunissen It doesn't obviously. The advantage isn't faster time. It's less space.
 
10:11 AM
ohh, i though its a new framework
lol
 
Ah cool, I like it. Feel free to open an issue as a suggestion.
 
@rtheunissen Imagine you are Spotify and you have 1M users and you wish to compare their playlists to find out which users have which 10 songs in common. How efficient do you believe an array would be on memory there?
If each user only had 10 songs and 1 playlist, that's 10M elements.
 
Well.. a million elements in an array only uses about 35Mb
 
With a bloom filter you could probably fit that into a few kilobytes
 
Sounds good, I'll have to do some reading.
> The more elements that are added to the set, the larger the probability of false positives.
Hmm....
 
10:14 AM
Yes, it has false positives, but no false negatives.
You can get it up to 99.99% accuracy if you wish to sacrifice a little more space.
 
ah, had to set allowoverride all
thanks guys
 
@Sherif do you have an implementation?
 
Indeed I do. My C implementation, unfortunately is now the property of my employer. I'll have to write another one on my own time.
 
So that brings us to 4 data structures to consider: BitSet, Bloom Filter, Heap, and Matrix.
@Sherif shouldn't be too difficult to find a decent one.
 
The PHP implementation is worthless if you care at all about speed.
 
10:16 AM
I would just use it as reference.
 
@rtheunissen I think there's one in PECL
 
Oooh that might make things easier, not sure if I'm comfortable with nabbing it.
 
It's ancient, but it still works.
 
2009 Beta..
Wouldn't be PHP 7 compat though
 
Yea, he got the gist of it right.
Nope
 
Wes
10:17 AM
no other trees @rtheunissen ? self balancing ones are versatile
 
You'd have to make some adjustments for 7 I think
 
@Wes I keep coming back to use cases for trees. I've never seen an RB tree used directly.
Powerful textbook ds, but you'll have to convince me that it would be useful first.
 
@rtheunissen How about for finding the smallest sum?
 
Think practical, pragmatic.. not "because it's in my textbook"
 
A url shortner is a pragmatic use case for a btree.
Finding min/max is depth-based.
 
10:21 AM
I like it.
+ RB tree
 
Wes
also
In computer science, the treap and the randomized binary search tree are two closely related forms of binary search tree data structures that maintain a dynamic set of ordered keys and allow binary searches among the keys. After any sequence of insertions and deletions of keys, the shape of the tree is a random variable with the same probability distribution as a random binary tree; in particular, with high probability its height is proportional to the logarithm of the number of keys, so that each search, insertion, or deletion operation takes logarithmic time to perform. == Description == The...
 
There are also things like... DAG, immutable structures, etc.
Wtf is a Treap
 
@rtheunissen Heh, I was just about to say DAG
Pragmatic use case: you're building a Scrabble/Words-With-Friends-esque game
 
ive heard about DAg
 
Technically you could just use objects there and there would no true difference other than the cost of initialization.
Well, I was thinking more DAWG there, but whatever
 
10:23 AM
All these things are cool and I'm sure useful one way or another, I'm just careful this early on to put too much into it. I want to establish a solid, stable base, release a stable build, and only then consider new additions.
^ Shouldn't be too far off. Documentation is going to take a while..
 
This was my PHP implementation: gist.github.com/srgoogleguy/b3eece75b63d7b6acb4b
 
I'll call out for proposals when there's a stable release ready.
 
hi guys what is wrong with my function
function htm2txt($in)
{
   $search = array ("'<script[^>]*?>.*?</script>'si",  // Strip out javascript
                 "'<[/!]*?[^<>]*?>'si",          // Strip out HTML tags
                 "'([rn])[s]+'",                // Strip out white space
                 "'&(quot|#34);'i",                // Replace HTML entities
                 "'&(amp|#38);'i",
                 "'&(lt|#60);'i",
                 "'&(gt|#62);'i",
                 "'&(nbsp|#160);'i",
 
That code indentation gave me cancer
 
10:29 AM
her is the code pastebin.com/K3Nts7VW
it gives me that error
Message: preg_replace_callback(): Modifier /e cannot be used with replacement callback
Filename
 
What's the matter... html_entity_decode was too complicated for you?
 
yes im just a newbie
 
I got that. My intention was that you learn through osmosis there :)
 
Hello everyone :)
 
hey @AboutLeros
 
10:37 AM
:D
@GourabNag how you doing?
 
was trying to register a domian in nc.me ...
got that from education.github.com
 
@Sherif can you help me
 
@ELOISSIFIAhmed I just did
 
!!!!
her is the code pastebin.com/K3Nts7VW
 
hey, I'm trying to echo data from a database into modals, i've got it on a while loop. but it displays the same thing in every modal.
 
10:46 AM
which php framework are you using ?
 
@GovindKumar me?
 
none.
i'm just using bootstrap.
 
@ELOISSIFIAhmed why exactly cant you use strip_tags() and htmlspecialchars_decode() ?
 
:P:P:P
YAY! I got my new domain!!!!!!!!!!!!!!!!!!!!!!!!
 
10:56 AM
@GourabNag CONGRATS! :D
 
also, @ELOISSIFIAhmed take a loot at this code: 3v4l.org/SddDJ ... maybe you will be able to spot the problem with /e
 
:P THANKS @AboutLeros!! Those are the benefits of being a student
And you know what I got a SSL certificate also free of cost
And I also get to use TRAVIS CI on my private repos
 
@GourabNag damn man!! i gotta pay $95 for that shit.
 
:P
It would be a long list if i try to tell all the benifits of it, it would be better if you would see it in here - education.github.com
 
@GourabNag nice)))
 
@GovindKumar any suggestions?
 
I saw this sentence somewhere: "I love NY", does anybody know what is the meaning of "NY" in that sentence?
 
Wes
google down?
 
google says NY is stand for "New York", But I hardly think so ..! I want to know is there another meaning for "NY"?
 
nope, it's new york
 
11:21 AM
ok
 
@rtheunissen I made bloomy work for 7....haven't checked it actually got released.
 
@Shafizadeh it's a long running campaign for the city en.wikipedia.org/wiki/I_Love_New_York
 
That and in a New York minute :D
 
@Shafizadeh it can be "new year"
but that's extremely seasonal
 
11:26 AM
:-)
yes ... good alternative ;-)
 
but in general it will stand for NewYork .. especially in this form: encrypted.google.com/…
 
Yeah ..
@tereško Did you search "I <3 ny" ? How exactly what you search means "I love NY" ?
 
@tereško Originally came from York in the UK. I think.
 
@Shafizadeh because "heart" pictogram means "love" or "like", and <3 is an ASCII representation of heart-shape (sideways)
 
Oh ...!!!!
 
11:34 AM
I knew exactly what kind of images I wanted to get
 
interesting
 
And even more so in this form: s/❤/✈/
/too soon?
 
yeah, try getting in USA from Iran with this t-shirt
 
Then Google is really intelligent ..! I enjoyed ..! Maybe I google before asking anymore :-)
@tereško :)
 
@tereško hahaha! that's messed up.
 
11:38 AM
that's what you get when marketing campaign (which the "I <3 NY" slogan clearly was) meets the internet
 
@tereško Im trying to use preg_replace_callback but still got the error
 
what exactly are you trying to achieve?
50 mins ago, by tereško
@ELOISSIFIAhmed why exactly cant you use strip_tags() and htmlspecialchars_decode() ?
 
this a function html2text I found it in helpers directory when I uploaded the website on local
 
@ELOISSIFIAhmed I guess the problem is your PHP-version. I had the same problem ..!
 
@Shafizadeh Im trying to make an old project work on local
 
11:48 AM
So? which version of PHP are you using?
 
5
yes I know I use a callback function as a seconf arguement but I still go the same error
 
55 mins ago, by tereško
@ELOISSIFIAhmed why exactly cant you use strip_tags() and htmlspecialchars_decode() ?
 
@tereško thank ill test that
 
your whole html2text() function can be implemented using two php built-in functions .. no regex required
 
Hello guys. I need some advice over learning webdesigning.
 
11:53 AM
@tereško you are the best
its working
 
Is there any event (js) to get run when users inputs "@" and anycharacter after that?
 
Wes
@PeeHaa found a typo github.com/CodeCollab/…
 
basically you have 3 options there: onKeyDown, onKeyPress and onKeyUp
 
@tereško I read it already .. keydown is what I need, But I need to create a delay to user inputs a character after @
$(".textarea_comment").on('keydown', function(e){
    if (e.which == 50) {  // @ pressed

    }
});
 
^ that wasn't in english
 
11:58 AM
I want when user writes a @ in the textarea, and then he write any character, then show a alert ..
 
there are two way:
 

« first day (1946 days earlier)      last day (2999 days later) »