« first day (1967 days earlier)      last day (2978 days later) » 

12:06 AM
@FlorianMargaine s/stupid/great/
Makes internal implementation much easier/safer
 
Wes
is Andrea around?
 
...
 
Wes
@Danack he was clearly joking this time :P
 
lol
So @bwoebi and @Danack fell for it ^^
 
@NikiC Fell for what? /s
 
Wes
12:16 AM
@Danack have a beer, you are always like your avatar :D angry
still cant get used to the ultrawide resolution. i get lost every second searching visually for things
 
if I change session_save_path to a place out of /tmp where things are not temporary.... will sessions actually be closed at some point?
not a db based session handler yet, just trying to patch things up
 
12:32 AM
@Wes value classes are not what I had in mind exactly when I brought up struct
 
@FélixGagnon-Grenier They should get deleted as normal when the session garbage collection routine decides to randomly run. Being in /tmp doesn't affect anything...
For the record - I don't think apps should (normally) need to write outside of their deploy directory.
 
@Danack well, it can affect things after a reboot
 
Wes
wasn't specifically related to struct, yeah. i haven't even followed the discussion. but apart from that what do you think of it?
 
Creating a 'var' directory inside the app directory for writing sessions and other 'temp' files to is usually a good choice.
 
but it's a very rare scenario...
 
12:34 AM
I'm concerned that it doesn't offer functionality that you can't already achieve, as well as being quite a niche use case.
"a version of classes whose instances are automatically cloned when a new reference of said instance is being created" is cool though :)
 
I've put it in Project/data/session. I just got worried that sessions would stop behaving the way they do when I did not set any session save path. from what I think you say, they won't; nice.
configuring an aws box and an nginx server brings me to be confronted with a lot of things I had never even considered before.
 
Wes
@rtheunissen i think quite the opposite of that. a lot of things would take advantage of that. just think about how many "immutable and mutable of the same thing" exist...
 
Hmm okay, can think of a few. PSR 7 comes to mind, immutable data structures etc.
Could call it immutable class {} as 'value' doesn't convey immutability imo.
 
Wes
everything... :P it's "protected mutability"
that behavior is usually referred as "value types", so i thought value classes would be ok...
 
Might be weird having mutable and immutable's flying around with similar API's.
It's not a bad name.
 
Wes
12:47 AM
@rtheunissen how?
 
eg. TimeValue, you'd have to keep track that it's an immutable to predict behaviour.
Used correctly it's definitely valuable. This being PHP.. :p
 
Wes
you mean it's not interchangeable with mutables? that's correct
$a = new Mutable();
alter($a);
// $a changed

$a = new Value();
alter($a);
// $a not changed
 
Immutables with API's like withValue, withKey imply in context that it's an immutable.
I'll read the proposal again, might be missing something.
 
morning guys!
 
Wes
should submit to sir @NikiC's attention too. so far comments were ok, so maybe it can even withstand his opinion :P
 
12:56 AM
Which CMS would be great for an online store? I'm wary of WordPress, it usually gets messy with all the plugins.
 
Wes
(not that i've invented anything, idea originated from levi and mentioned several times in the room)
 
wix doze all teh tings
 
Good to try push things in the right direction @Wes
 
@Wes You mean your Friday RFC?
 
Drumpf RFC
 
Wes
1:02 AM
@NikiC i mean the actual donald trump's rfc
 
off to the skating rink, cya guys
 
Wes
@FélixGagnon-Grenier so canadian
 
1:37 AM
o/
 
Wes
\o
 
1:53 AM
yet another rebecca day
heh thanks to PeeHaa I keep remembering it as like that
 
We should get rid of the manual terminology that says objects are passed "by reference" and replace it with "by handle" to avoid the confusion that's plagued it so far
 
Wes
variable reference / handle reference?
variable reference / val reference
 
2:10 AM
most types are passed by value, objects are passed by handle
references alias a variable
 
Wes
it's a bit confusing... yes
 
another option would be to say "objects have pass-by-reference semantics"
because they are, and they do.
 
@jbafford I'm not sure that helps
there's passing by reference, and there's passing by reference
 
yeah, it's probably not different enough for people to notice the hint that they're not pass by reference as PHP exposes the concept.
 
we need to avoid using the word "reference" for things other than & and refcounts
 
Wes
2:18 AM
@Andrea i've added you to contributors of a repo of an rfc I Donald Trump started writing, it's just a kick off and doesn't actually have science in it. maybe you want to have a look at it as it's about something i know you are working on. i apologize for the engrish :P
 
on the one hand, I don't disagree; but on the other, my concern is that, as someone skilled in the art (or at least, with a C background), I know what pass-by-reference semantics mean and imply; and php 5+ objects have reference semantics, and saying otherwise muddies the issue.
 
Wes
brb
 
@Wes the tone used bothers me more
I don't like it when immutable objects are described as a hack, they're not really
anyway, I need to sleep, desperately
 
Wes
i'm not saying that. i'm saying that oop was meant to be mutable
 
goodnight!
 
Wes
2:21 AM
gn! :D
 
@Wes oop, as implemented in C-based languages, sure
I'm sure there are people from functional languages who would beg to differ.
 
Wes
i'm not saying that. i'm saying that oop <ins>in php</ins> was meant to be mutable
 
ok, yes, that's accurate
your section on using unset() to trigger gc. PHP is COW. unless ->withXXX vastly changes the whole object, you're going to have significant memory overlap between stuff and stuff1.
$stuff will get deallocated once it's actually no longer in use (which could be as soon as it falls out of scope)
and could potentially be immediate if you're actually using chaining, because your temporary is used and immediately thrown out
anyway, the whole point of clone - modify - return is that the clone shares substantially all the memory used by the original, because of COW.
Part of the findings of the PSR-7 immutable implementation was that the immutable implementation was actually faster, partially because of this.
 
Wes
not everything is cow though, only primitives
but ok limitations come mainly from the limitations of the interface. i didn't do my best yet for explaining my reasoning, but generally i think that something is wrong with that api style because code looks repetitive and dumb
also you can't do many things, because those methods do too many tasks (CQRS)
 
 
1 hour later…
abr
3:40 AM
Looking for someone with some laravel experience or related to CSRF protection to explain me some pretty easy questions
 
 
1 hour later…
4:46 AM
grumble grumble ...
@philsturgeon I would not feel safe participating in a community with pmjones in it.
I hate this ...
 
'nin
 
angular material theme with laravel any suggestion?
 
what's the best way to make a pdo connection work if godaddy refuses to let it work?
$dsn = 'mysql:host=localhost;dbname=database';
try {
$pdo = new PDO($dsn, $user, $pw);
}catch(PDOException $e ){
echo "Error: ".$e;
}
 
5:05 AM
@acoder how are you defining the host, bdname and username and dbname?
 
variables, and replacing the db name
 
$hostname = 'www.hostname.com';
$username = 'username';
$password = 'password';
$dbname = 'dbname';
like this?
 
kind of
 
code me, on pastebin. :)
 
should i use my url?
 
5:08 AM
you should use your php path, if you don't know it contact godaddy and ask them
 
so the website address?
 
@acoder not always, could be slightly different. depends how go daddy have set it up
 
it worked as localhost on another site
 
then it's what your trying to connect to, probably some information is wrong. contact go daddy and ask them what your php connection path is.
 
nope, i tried copy/paste
i'm going from mysqli on the old project to pdo on my new one
 
Error: exception 'PDOException' with message 'SQLSTATE[28000] [1045] Access denied for user '____________'@'localhost' (using password: YES)' in /_________:6 Stack trace: #0 /______________.php(6): PDO->__construct('mysql:host=loca...', '___________', '_____________) #1 {main}
 
@acoder i was right, some info in your connection is wrong. the link i sent will show you how to find your absolute path, which you should paste in as a variable for host
 
k
 
@acoder did that solve it?
 
i should try mysqli connection
 
5:22 AM
@acoder ok, but it makes very little difference, you still need to correctly define what you are connecting to. and it won't work if you have the wrong path.
 
$link = mysqli_connect("localhost", "$user", "$pw", "$dbName") or die("error");
outputs error
 
i should just go in to look at the connection
 
@acoder yeah :D
 
working from the old one, be back in a few
 
5:32 AM
user image
9
 
@JoeWatkins lol))
 
*
 
5:54 AM
k
 
men, the videos about trump coming out up front on youtube are depressing. I wonder how much they're being paid for that
 
!!magic
 
@acoder working?
 
@AboutLeros no errors out with this: pastebin.com/YeMj8UWj
 
so it works?
 
6:04 AM
posted on March 05, 2016

New Cyanide and Happiness Comic

 
i modified it
 
is it working?
 
no errors on it
with error reporting off
is that good code @AboutLeros
 
oh! you mean. no, errors ...
 
douh i forgot to ftp it
 
6:07 AM
no, you have a few syntax errors
 
the error is in my mysqli
 
Oh. so basically @Feeds got replaced by @Cyanide. You truly are a genius @PeeHaa
 
$conn = mysqli_connect($dbhost , $dbuser , $dbpass ,$dbname) or die ("error at connection won't work");
 
did you find out the correct path?
 
yes, godaddy uses localhost
 
6:11 AM
no it won't
 
@acoder you really could not have the or die([...]). mysqli will inform you with great precision if it can't connect
 
i'm gonna try something out
access denied
godaddy is doing mantinence while i try to work, ugh
500 error
 
it's basically your fault
I have yet to see any competent person using godaddy hosting
 
@FélixGagnon-Grenier brokenSQLSTATE[28000] [1045] Access denied for user ''@'localhost' (using password: YES)
 
did you google the error message?
what have you tried to resolve it?
 
6:24 AM
drupal says host is blocking access
 
o/
 
\o/
 
hey guys want a riddle ?
 
6:39 AM
are you the riddler?
 
nope
StringReverse("46-ESAB")

Func StringReverse( $input )
Local $output
Local $split = StringSplit( $input , "")
For $i = $split[0] to 1 Step -1
$output &= $split[$i]
Next
Return $output
EndFunc
 
6:51 AM
that is not php
 
hey
 
then?
 
also, you probably should invest more time in learning english
 
Wes
mornings
 
'nin
@tereško it's AutoIt
 
6:59 AM
well , the algorithm there is simple enough .. thought it seem that in that language the array indexes start from 1 instead of 0
 
@tereško does it actually reverse the string?
 
it returns a copy of the characters in the string in reverse order ...
 
also BASE-46 is not the answer
 
it doesn't touch the original string ... but you shouldn't expect it to ...
 
@SujithSizon are you really that dumb?
 
Wes
7:01 AM
lol
 
or do you think that "46" is an atomic unit?
 
lol
sorry
so BASE-64
 
you mean base-42?
 
@littlepootis why 42 ?
 
7:05 AM
@SujithSizon do you even know what 42 is?
 
... you already know the answer
 
@tereško an integer?
 
@tereško Sadly, this site is one of the best there are about php. At least, it teaches what not to do.
 
I think I might have actually found the anus of the internet: facebook.com/groups/2204685680
 
Wes
@rtheunissen @JoeWatkins i need some advice with mutability of collections through iteration.
option 1: reflecting changes in the active iterators. this is very tough. iterators have to observe collection for changes and... it's a mess
option 2: iterators use a copy of the collection. i would go with this but it's not nice creating copies
what should i do?
 
7:09 AM
omg
> So PHP is really a compiled language just like Java, C# and others. Otherwise it would be rather slow.
you can have two guesses where that came from ... you should need only one ...
 
hey guys!! mornin' v1.1
 
Wes
copy on write maybe?
 
@JoeWatkins the internet
 
should be able to guess the site ... what is literally the worst source of information with regard to php ?
 
Wes
7:12 AM
iterators observe collections for changes and if they are going to, just before they get modified they make a copy
 
@JoeWatkins w3schools?
 
there's another option, to explicitly disallow modification of current object being iterated over ...
I don't know what the answer is @Wes
 
facebook.com/groups/2204685680 is this group really so dumb ??
 
@JoeWatkins phpclasses.org
 
@PaulCrovella you got it ...
his first attempt at correcting a "top wrong idea" is wrong ...
I'm not going to read the others ...
 
7:14 AM
I actually had to think a bit... there's a lot of competition for being the worst
 
I just googled
 
Wes
yes but how to enforce that?
MyIterator::__construct($collection){ $collection->freezeTemporarily(); }
MyIterator::__destruct(){ $collection->unfreeze(); }
it's bad :B
 
it depends what you are asking, are you asking about some php code, or some c code ?
 
Wes
@JoeWatkins asking me?
 
7:15 AM
yes
@littlepootis that's what I came across ...
 
Wes
it's the same, no? i mean, behavior should be clear independently of that
 
but how to enforce it differs though
 
Wes
of course if it was C i could avoid having a public "freeze()" thingy
 
it's hard to know if you are using php to illustrate, or talking about php ...
 
Wes
but i mean regardless of the implementation, what the behavior should be?
 
7:18 AM
I really don't know
 
Wes
trying to change my question, could be useful to change a collection through its iteration?
 
the most sensible question is are php programmers going to be expect that you should be able to modify a collection during iteration, the answer to that is an obvious yes ...
 
Wes
that's my thought too. but implies a monumental amount of effort defining how it should work and implementing that
 
you can break expectations, but you have to have good rationale for doing so ... without talking about how difficult it is, you need to be able to say "if we were able to modify during iteration, it would have the detrimental effect of X, Y, and Z"
 
7:21 AM
let your iterator be dumber than what you have in mind.. it's just a pointer to a position - if the collection changes from under that, so be it - the iterator doesn't need to care
 
Wes
gist.github.com/WesNetmo/d2c3415d047c198ffb07 i started writing this for instance, and this is just a simple list. imagine defining a sorted set/map iterator
@PaulCrovella you have to make the behavior predictable at least somehow
and possibly having it behaving sensibly
 
it's entirely predictable - if I replace something at a position I'll get that new thing back instead, if I remove elements and the position is no longer valid, ->valid() returns false
 
Wes
so say you prepend an element to the collection being iterated, wouldn't you expect the cursor to move +1 forward?
 
hey ... if any one have implement icici payment gateway ...
are they provide any test card for testing responce ..?
 
7:29 AM
ccode4u.com/2016/03/05/… of all articles I've read, this.. THIS.. I found most useful
 
Wes
also in dynamically sorted stuff your thought about predictability does not apply. if you add an element unless you know how the comparator works you can't tell what element will be here and there @PaulCrovella
 
The icici payment api will be down 99.5% of the time. why even bother?
 
Wes
this is why i was thinking i could go with copies (with copy on write)
makes things way easier
 
@Wes the iterator gives no fucks what element is there, the cursor references a position, not the element behind it
 
ya that i know but as client choose icici so @littlepootis ...
do you any idea about icici test card .. because i tried with some test card not works ...
I also contact them..
 
7:33 AM
And.. what did they say?
 
they say you test on live cards only @littlepootis
 
@BhavinShah well, then, you don't have a choice but to
 
Wes
@PaulCrovella it's error prone. you are making it too simple imho
 
trying to make your iterator outsmart the programmer is error prone, far too complex, and gives the iterator responsibility it has no business having
 
Wes
i'm saying the opposite actually, that i should iterate over copies that aren't modifiable from the outside
 
7:39 AM
why?
 
Wes
for example a sorted set. set is guaranteed to have no duplicates so i expect to not receive duplicates during traversal. unless i'm aware of the comparator, it is not guaranteed for me to be predictable
gah english
 
an iterator doesn't necessarily need a copy of anything
 
Wes
by iterating over an encapsulated copy i avoid all these problems
 
an iterator need only define a path through a collection, it need not copy the collection for iteration ...
 
Wes
and with copy i mean using copy on write (ie actually do the copy just before the collection gets modified)
 
7:43 AM
@Wes if you don't modify you'll get no duplicates, if you do modify it you no longer have the same set and should adjust your expectations
 
<?php
foreach ($collection as $k => $v) {
	switch ($k) {
		case "something":
		/* ... */
			$collection->append(modified($k, $v), $v);
		break;
	}
}
so ... how would that work ?
 
"append" seems like the wrong name
 
unless there is some really good reason for breaking the expectation that this should work as if it were a native collection (array), then I don't think you can do it, if it's going to mean that really quite simple code is going to behave in some strange way ...
 
@Joe Did you really just join that group?
 
@tereško sure, but you see what I'm doing ...
@littlepootis yeah
 
7:47 AM
I'm gonna trollllllllll
 
Wes
yes but expectations are not predictable for sorted stuff @PaulCrovella and even with insert-order stuff you get into some mad situations that you should try to avoid, like 2+ nested foreachs on the same collection and removing and adding stuff. why would one do that?
 
imo what matters is that you can do that ... the people that are going to use collections are going to use them in place of arrays ...
 
Wes
you can do sane things sure, but allowing sane things means allowing also mad things... i don't know. i'm defending my thought but i'm not saying you are wrong
 
still I dunno what is correct ... if you presented me with a collection that threw a concurrentmodificationexception, I'd hate you a little, but I'd understand it, and couldn't call it wrong ...
 
@Wes that's the thing - your iterator doesn't need to care about any of that. it's not its job.
 
7:52 AM
to an extent, same if you use COW ... but only to an extent ...
 
Wes
i don't know. for me:
list iterator means traversal of all positions without hitting the same position twice
set iterator means traversal of all elements without hitting duplicates
map iterator like set with its keys
and so on...
 
if you prevent someone from modifying a collection during iteration you're breaking expectations. if you try to guess what a programmer might expect, you're going to be wrong and break expectations. the best you can do to make your iterator predictable is to make it simple.
 
Wes
i agree on the fact that i have to keep it simple
also @PaulCrovella i perhaps guess the most common behavior, i'm not denying anyone to implement their own iterator
 
let's say I want to iterate through stuff in a collection until I hit thingA, then remove it and everything else until I reach thingB - with a change-agnostic iterator this perfectly reasonable operation is trivial, and I expect what I get from current() to change as I rip elements out
if the iterator is running over a copy I can't modify it's become an annoyance trying to protect me from myself, which I fucking hate
 
Wes
8:07 AM
@PaulCrovella may be what you expect but not what you want. lemme write something
1 sec
 
no, it's exactly what I want because it's what I'm telling it to do
 
Wes
// this is adjusting the cursor automagically
$removing = false;
foreach($list as $index => item){
    if($item === "thingA"){
        $removing = true;
    }elseif($item === "thingB"){
        $removing = false;
    }
    if($removing){
        $list->remove($index);
    }
}
// this is not
$removing = false;
foreach($iterator = $list->getIterator() as $index => $item){
    redo:
    if($item === "thingA"){
        $removing = true;
    }elseif($item === "thingB"){
        $removing = false;
    }
    if($removing){
        $list->remove($index);
        $index = $iterator->key();
        $item = $iterator->current();
        goto redo;
    }
}
which is by the way what java's listiterator does
it's just as predictable but not convenient imho
 
the second is closer to how I'd do it, but without goto - e.g. while ($iter->valid() && $iter->current() !== "thingB") $coll->remove($iter->key());
it's far more convenient than trying to guess how a "smart" iterator is going to muck about with the cursor position
 
@littlepootis this group is terrible
 
8:16 AM
very
 
Wes
well, it's not much to understand, at least for sequences @PaulCrovella
 
it's even less to understand that an iterator isn't going to change the cursor position unless I tell it to
 
Wes
could be
you have a point but i'm not entirely convinced yet
 
write a "smart" iterator or two and see what a mess it leads to - that's what convinced me
 
8:24 AM
SAVAGE
 
Wes
maybe it's just postponing the problem. i mean, rather than having an iterator that does the magic for most of cases, you are repeating yourself every time you write an iteration that involves that kind of stuff
eg @PaulCrovella
for($x = 0; $x < count($foo); $x++){
    if($foo[$x] == "bla"){
        $foo->remove($x);
        $x--;
    }
}
that's clearly not hard to write every time, but if it gets more complex than that, i'd have an iterator doing it automatically
 
no, adding magic is a problem in itself, and what you get down the line isn't "oh yay, this iterator knew what I meant by that" it's "oh right, this stupid fucking iterator works like no other and gets shit wrong half the time"
all to bake in the one particular case where you wanted it to do one thing one way
 
Wes
magic is subjective though. this is the expected behavior that list iterators have to implement in java. and it's not magic for its programmers...
i'm fairly convinced of one thing though
that i'm fucked up :P
 
forget I even said "magic", I was just using your word.. what I meant by it was the implementation gets ugly as your iterator takes on responsibility outside its scope
 
Wes
it's gonna take me months to decide about this
 
8:35 AM
 
nin'
 
Wes
a thing i disagree with you @PaulCrovella i don't think it's fine having current() magically changing, not without a way to determine it is changed
$current = $iterator->current();
$this->codeIHaveNoControlOf->change($list);
// how do i know value returned by current() is changed here?
because depending on that i could either do a thing or another
actually not the returned value but rather determining that the sequence was changed
i have no idea... i think i'll just keep as is for now and see what happens with more complex iterators
 
@rtheunissen Turning the class into an interface breaks BC.
All new Map code is broken.
 
@Wes current() isn't magically changing, it still points at the same position. If you need safeguards that the collection doesn't change, or that you somehow know when it does, that's fine - build them and use them (e.g. give your iterator a clone, add an event listener, or whatever) in your client code, not your iterator
 
Wes
@LeviMorrison what do you think of a list iterator adjusting automagically the cursor like this:
foreach($list as $i => $v){
    $list->remove($i);
} // list is completely empty now
 
8:48 AM
@wes I have 4446 table in my database I want to delete duplicate rows and merge that db with another what is the easiest way to do it
 
Wes
this is what i get for un-ignoring people lol
 
lol
 
@undefined you have been asking that question for over two days now... i guess teresko most probably told you the answer...
 
@Saitama Im in front of a big spaghetti db full of important data
 
@Wes you cleaned your list too?
 
Wes
8:53 AM
lol
i like giving second chances
 
best hope for that working out is they just don't show up anymore
 
9:06 AM
After using Photoshop for so many days... I used gimp for the first time.... It is too complicated ..
 
@NikiC fell for what?
 
Wes
\o bob
 
9:22 AM
@Wes \o :-)
 
Wes
don't forget to tell me about the logo. should i complete it? i think it will come up great and i already have an idea for the website layout (i assume you'll let me do it :D)
english is especially broken today. i should have paid more attention in school
 
@Wes Yea, it's promising what you did here :-)
 
Wes
the more i watch it the more i'm convinced it's a good logo / result. but clearly if you had in mind... a goat... well that's just a different animal :P
i think a robophant is cool. this is how i interpret it :P powered by skynet, clearly
 
9:39 AM
@Wes are you designing the php.net page ?? :-?
 
Wes
if i did, there would be unicorns everywhere
 
rainbow vomiting unicorns :P
 
Wes
9:56 AM
lol
 
Wes
10:14 AM
shouldn't have deleted the stubs..
 
what color scheme do you use @Wes ?
 
Wes
one i made
 
:P BTW how do you create a color scheme ??
 
Wes
in the settings, under colors & fonts
 
10:19 AM
oh thnx !!
 
Use Wes' method. Use those colors.
 
wtf is that site @littlepootis ??
 
It generates color schemes configs for terminals and editors. The only GUI editor it currently supports is ST.
 
oh i see...
BTW @Wes I'm fine with Dracula and Solarized Dark.... :P Creating a new color scheme seems too much of a pain...
 
Wes
i did it in 10 minutes modifying an existing one..
 
10:25 AM
i tried to customize actually nut couldnt find a nice font :P
 
Use Comic Sans
 
Yuck. I hate Comic Sans.... Code and Comic Sans just doesn't work....
 
Oh, clever idea … writing code in Comic Sans.
 
morning Bob!
 
helo
 
Wes
10:40 AM
funny that now phpstorm thinks commenting the constructor is required
user image
4
 
LOL @Wes !!
 
Wes
can't stop doing that.
later guys :D
 
see ya!
 
hello i have a question
i posted here stackoverflow.com/questions/35813001/… can anyone help me
 
why u use ides?
 
10:48 AM
what ides
 
10:58 AM
@Wes I set it up so that Exception classes automatically extend \Exception if it finds Exception in the name of the class
So apple shift n, "SomethingException", bam, the whole thing is done
 
GONNA WATCH KUNG FU PANDA 3!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
Anonymous
11:21 AM
Anyone know a free tool to unlock password-protected PDF?
 
Anonymous
^nevermind.
 
@Wes is it automatically doing this? I thought this was just the phpdoc settings which you can turn off. I comment my ctors since they usually have a param so never noticed.
 
Anonymous
> my ctors
 
@Wes also you should probably add comment for @throws \Shit
 
11:58 AM
anyone have idea about how to find country code from a mobile number?
 
You can't do that
 

« first day (1967 days earlier)      last day (2978 days later) »