« first day (663 days earlier)      last day (4276 days later) » 

12:40 AM
bye-bye PHPers :) zZzzzZzzzZzzz.....
 
bye
:))
BYE ALL
 
1:27 AM
why
 
sup guys
 
howdy
 
@MikeB bored?
 
user895378
<bookmarked />
 
2:17 AM
i constantly get the feeling, that i am over-complicating things
 
@AlexCastro ???
 
@Nile oh hi I justt got back
@Nile that was a few hours ago, haha
 
@AlexCastro was there something you needed
 
@Nile no I was saying hi! haha
 
@AlexCastro ah okay.
 
2:33 AM
I'm making the class pages now :)
@Nile how exactly would I form the link after say class.php? Would it be class.php=5?
 
@AlexCastro class.php?variable1=value1&variable2=value2&etc...
 
cool, thanks
 
@rdlowrey Hello, again.
 
user895378
@LeviMorrison hola
 
@tereško can you take a look: pastebin.com/ZczTtdqX
 
2:42 AM
i think you have misunderstood the SRP
for example , you do not need to separate User from the method that let you alter User's properties
also , your FindUser class looks suspiciously like a failed attempt to make a mapper
@Nile , this might help with the latter part : stackoverflow.com/a/11873920/727208
 
@tereško thanks, taking a look
 
@rdlowrey What's new from today?
 
@tereško when you say "mapper", does that mean ORM or data mapping?
 
user895378
@LeviMorrison I'm not sure what happened. I was working pretty much all day, but I don't seem to have made progress. I guess a lot of that time was spent determining the best way to mock the client socket implementation for testing.
 
@Nile "data mapper" is a pattern , ORMs are (usually bad) implementations
 
user895378
2:47 AM
The good thing is that now the coverage is slowly creeping up.
 
@rdlowrey Time well spent, no doubt.
 
@tereško okay, i see.
 
user895378
Yeah, turns out the best way to do it (discovered on my own, in the end) is ...
 
Dependency injection?
 
user895378
lol, I wish.
 
2:49 AM
@Nile most of modern ORMs implement active record pattern
 
Dang, that's usually a good answer.
 
user895378
sadly, you can't inject global native php functions that talk to remote sockets.
 
@rdlowrey , are you sure about that ? even with closures ?
( and yes , i am asking it without any clue about the context .. might be a serous case of "talking out of ones ars" from my part )
 
user895378
@tereško no need to obfuscate the API that way -- not when you can use the phpunit mocking api to handle it.
 
user895378
Anyway, since I use stream_socket_client to interface with the sockets in a stream format, I can squeeze every non-mockable native function into a single one-line function that calls stream_socket_client. Then I register a custom stream wrapper that intercepts all stream operations for http:// and https:// streams and returns exactly the raw message data I want, when I want it.
 
2:52 AM
had not heard Perfect Circle for years .. now i cannot understand how i managed to to forget about that project
 
user895378
Then I only have one test case where that function isn't mocked to return a stream from the custom stream wrapper -- one where it's testing that it fails on a connection error.
 
user895378
And I just give it a clearly invalid URI, and it fails as expected.
 
user895378
blamo! 100% coverage!
 
user895378
(or it will be once I finish)
 
user895378
No setting up a custom socket server or anything. It's beautiful.
 
2:54 AM
I was surprised at the mocking capabilities of PHPUnit, though it seems a bit like magic.
 
user895378
AND it doesn't rely on a local network infrastructure either (which it would if I setup a socket server)
 
Strange API, but can't suggest a better one.
 
user895378
Yeah, the API is strange, but I've gotten used to it at this point.
 
user895378
The docs drive me nuts though. It's really difficult to find what you need.
 
@rdlowrey Especially for configuration.
 
2:55 AM
@tereško so in the construct of FindUser, have the first argument be an instance of User. then add another function fetch() which would return all instances of User from the database that match the needle?
 
user895378
Though I've slowly gotten to know generally where things are in there ...
 
@Nile no , you provide the user instance to that "finder" in the constructor. It read the set values and uses them as needle. Then it finds the data in database in and applies the collected values to the same user instance
nothing gets returned , but the user instance has changed
this is a close as i have manged to get to "Tell, don't ask" principle, when dealing with storage logic
 
@tereško but what if there are more than one matches that match the needle?
 
then you are not dealing with a single item but a collection
you provide that "finder" with the collection instance
 
user895378
@LeviMorrison HTTP question ...
 
3:00 AM
that would also let your finder know that multiple results are to be expected
 
@tereško by finder do you mean the FindUser class?
 
user895378
It's perfectly valid to have a response message that consists of nothing more than ...
 
yes
 
user895378
HTTP/1.1 100 Continue\r\n
 
user895378
right?
 
user895378
3:00 AM
Or must there always be headers, even for something like that?
 
@Nile , as i said , it actually is closer to a data mapper implementation
 
@rdlowrey FWIW, i've seen that used many a time but that doesn't make it valid (:
though i'm >95% confident it is
 
@tereško so once the database gets the results, if I don't return the new instance of user, how will the program which is using that class know the result at runtime?
 
user895378
I'm trying to be lazy and not go check the spec :)
 
@Nile also, the FindUser name is somewhat misleading , if you expect it to deal with more then one instance of User
 
3:01 AM
lol. i know it'll work, i just don't know if it's technically valid
 
@tereško I have to change the name
 
if user was not found, you throw exception
 
and if it is found, then I insert the values into that instance of User, right?
 
user895378
@Lusitanian well currently the client thinks it's an invalid http message if there are no headers after the response start line, so I'm hoping that correcting that (if it's an error) might fix @PeeHaa's oauth problems.
 
really? o_O
 
3:02 AM
@Nile yes
 
i'll actually look at the spec then
 
@tereško so then don't I have to return the new instance?
 
no
you just keep using the same instance which you passed into that "finder" of yours
 
user895378
@Lusitanian well, I haven't looked at the code yet, but it wouldn't surprise me if the first request in the two part oauth process returned a single start line to say "go ahead with the next one"
 
@rdlowrey Not sure on that one.
 
3:04 AM
@rdlowrey no, it's only one request to get the token
and it works in our library on every service but soundcloud, so i'm thinking it is something http-quirky
 
user895378
@Lusitanian oh really? yeah I don't know anything about oauth :)
 
heh, it's okay. no one does because it changes between every damn service that implements it
the flow in oauth2 is theoretically fairly simple though
 
@tereško
$needle = new User(0, array("username" => "johndo@foo.com"));
$match = new MatchUsers($needle);
$matchedResults = $match->fetch();

so would I just then treat $matchedResults as an instance of User?
 
@rdlowrey there's nothing in the spec that explicitly allows or disallows it
 
user895378
3:06 AM
@Lusitanian It's possible that sound cloud is sending back something that fails to adhere to the HTTP protocol. But it's also possible that there's some tiny bug in my implementation that only manifests for soundcloud
 
which means i'm not looking hard enough
@rdlowrey I'll test the code if he pushed it to github( gonna check now)
and see the exact response/request
 
@Nile no
 
aaaand he did :)
 
@tereško so then...?
 
@rdlowrey btw, just from one of these services i want to get a 418 :)
 
3:09 AM
it's like nothing i say even penetrates
 
user895378
lol, I always like the 420 Enhance Your Calm
 
hehehe that's a good one too
451 is a reference to a great book
 
@tereško I just don't understand, because if I use $needle, I'd have to update that variable somehow.
how do I update that variable?
 
@rdlowrey i'm going to sign up for a soundcloud acct to test
 
user895378
I can't determine whether or not there are situations when a valid response won't have any headers after the start line ... If anyone comes across that info, please share.
 
3:15 AM
@rdlowrey @PeeHaa okay it worked for me without changing anything in artax, etc
 
user895378
@Lusitanian I think he may have pushed it with his cURL implementation? You might check to make sure :)
 
@rdlowrey There are no required headers for this class of status code. from the spec on 100
 
user895378
> There are no required headers for this class of status code.
 
user895378
@Lusitanian thank you
 
also no, he didn't push the curl client
so idk why it failed for him / why its workin for me
 
user895378
3:17 AM
@Lusitanian well that would be very sweet for me :)
 
@PeeHaa when you get this ping, dump the request/response for your failing soundcloud test...works just fine for me with artax
 
@tereško one more chance
 
user895378
@Lusitanian and @PeeHaa I'm going to hold off then on attempting to debug until I get further confirmation that there may be an Artax issue. Definitely let me know if you think it's possible, though.
 
don't bother debugging for it though
I honestly don't think it is, his system has had issues with your client randomly lol. it passes all the tests i threw at it so idk. i'll let you know if something comes up
 
@tereško how would I use the $needle variable (which has the instance of the User that I passed into my finder class) for the matched results?
 
3:21 AM
@rdlowery you might want to add a MutableUri btw
 
@Lusitanian Not a lot of point to it. It's not that complicated to make a new one from a constructor . . .
Or in other words: make one yourself if you want one.
 
I already did :)
 
Think about it: URIs are unique. Why would you CHANGE one?
 
when you put it that way, I lose my reasoning behind it ;)
 
user895378
Yeah, I don't really see any need for a mutable URI ...
 
3:24 AM
i may lose the mutability but keep the factory method i added which is useful
 
user895378
Possible Feature Question:
 
user895378
If the request body is specified as a string
 
user895378
Should the client automatically check to see if it's in form-encoded format and if so, add the Content-Type: application/x-www-form-urlencoded header?
 
Sounds like a good time to subclass.
 
user895378
I'm trying to think if there are scenarios where this would break things ...
 
3:26 AM
Or a helper class
or something
 
@rdlowrey I wouldn't do that at all in the StdRequest class.
 
user895378
What I'd really like to do is make it pluggable so you could listen for new requests and automatically do anything you wanted. But I'm trying desperately not to couple it to any other packages besides the Http
 
You don't need to couple it to anything to do that, but it wouldn't fit in with your app engine if you didn't i suppose
 
user895378
@Lusitanian Well, it actually wouldn't happen in StdRequest ... the Client generates a mutable request internally to make modifications
 
what i was thinking is something like FormRequest extends StdRequest
and it auto-adds that header...but meh
 
user895378
3:30 AM
@Lusitanian Wait! The StdRequest actually already implements FormEncodedRequest -- I didn't even realize that -- if a request has body parameters (like what you'd get in $_POST) it already parses them
 
/me looks
 
user895378
I agonized for a long time over whether that functionality should be in StdRequest or subclassed.
 
incidentally, i'd actually subclass that because it's unexpected behavior per the protocol (though expected if you are used to non-standard HTTP implementations)
 
user895378
Well, in the end, accessing request body parameters is such a ubiquitous need in web applications I felt like it was appropriate to leave it in the StdRequest ...
 
user895378
I've literally changed that one aspect at least 5 times.
 
3:32 AM
lol...I don't know why, but the letters O, C, and D keep flashing through my head!
 
user895378
yeah, tell me about it
 
i agonize over small issues as well
 
user895378
Also, the Client only asks for a Request interface, not a FormEncodedRequest, so relying on its functionality wouldn't work anyway.
 
@Lusitanian , i think both OCD and Paranoia are traits of good developer
 
@tereško please :(
 
user895378
3:35 AM
@Lusitanian But now you know -- if you specify a StdClass StdRequest that has a form encoded body and the accompanying header, you can access the form encoded params like $request->getBodyParameter('var1'); if you want as well as get them as an associative array with $request->getAllBodyParameters();
 
user895378
and for completeness, consider that there is also FormEncodedRequest::hasBodyParameter($name)
 
@Nile did you read the links ? Did you understand what was written in them ?
 
user895378
And if you hate the built-in request implementations, just write your own and have it implement Artax\Http\Request as that's all that's required by the Client
 
@tereško I read: stackoverflow.com/questions/11873752/… but I didnt understand how $user was updated with its matched data
 
there was another link in that answer
 
3:43 AM
 
user895378
@LeviMorrison I think that's more a result of my git-fu slowly improving than anything else :)
 
user895378
before I would just commit everything all the time. They're a bit more measured these days
 
okay I've read it. is this the right set up:
$needle = new User(0, array("username" => "johndo@foo.com"));
$match = new MatchUsers($needle);
$match->fetch();
 
user895378
@LeviMorrison That and I always aim for sine waves in life.
 
Also, notice which days we commit the most? Tuesday. WTF? Really? TUESDAY?
Just click through them
 
user895378
3:45 AM
yeah, that's kinda surprising.
 
I think the next most common day is Thursday. Also surprising.
Woah, actually, Thursday is definitely the most committed day.
You seem to do massive code refactoring pushes on Thursday.
 
user895378
I could explain it by saying that weekends are for trying out new, crazy stuff. That's run by others and polished on Mondays, with initial commits on Tuesday. Then refactoring and fixing is done the next couple of days and pushed on Thursday. Then the cycle repeats.
 
user895378
There will likely be massive push activity tomorrow (Thursday) again :)
 
user895378
I will have fully tested the client and added streaming request and response bodies ...
 
user895378
3:49 AM
These graphs are awesome! I had no idea github was so nifty with your data.
 
user895378
There would be a more complete picture if I hadn't manually moved over the artist formerly known as Atreyu.
 
Yeah.
Also, you'll want to pull.
I highly doubt it will mess up your code; I only updated the README.md
 
@rdlowrey , @LeviMorrison .. guy , care to share your opinion on subject :
domain objects tend to have few "standard" validations methods
where do you think they should come from ?
 
@tereško Good question. Every project I try to do it somewhere new, but I can't seem to find a solution I like.
 
parent class ? external validator instance ?
 
3:58 AM
The solution I've liked the best so far is using an external validator instance.
 
@tereško did you see my response before
 
i am not sure how it would fit in a model layer
 
damn @tereško u no sleep yet
 
also , by definition , one of domain object's responsibilities is validation
 
@LeviMorrison sorry, my database generates HTML, whaaa? :)
 
4:01 AM
@webarto how "woke up some time after 22:00" seems for response ?
 
@tereško ?
 
user895378
@LeviMorrison Yeah, there's a lot of housekeeping stuff like that that probably needs to be done. The wiki pages are very likely an outright lie at this point.
 
anyway , thing is : i don't want to put too many methods in the parent class
 
I'm not sure how relevant it is, but a Binary Search Tree IS a binary tree, but realistically a BST will NOT inherit from a binary tree because the API and behavior is so different.
 
@tereško dat is wicked...
 
user895378
4:02 AM
@tereško I usually just opt to inject some sort of validator object, just because it keeps me standardized in how I do it. It helps me to use the same strategy across projects.
 
I guess what I'm trying to say is that sometimes when you code by definitions you end up with bad code. Programming doesn't really model the real world.
It's late; so take everything I say with a pound of salt :)
 
- Knowledge of MVC frameworks (Codeigniter or similar) :morningsickness:
 
Wow. Just, wow > Underground sect found after nearly a decade in Russia's Kazan http://reut.rs/MQYQPu
just a bit of off-topic
 
4:20 AM
@rdlowrey I made another README update. Sorry for the inconvenience :)
 
user895378
@LeviMorrison not an inconvenience.
 
Typing git pull is so agonizing, I know :)
 
4:47 AM
master branch, and you create branch task1, and task2 ... task1 and task2 are unaware of changes in each other until you merge them?
 
user895378
@webarto welcome to the club :)
 
user895378
@webarto correct
 
fanatics we are indeed :) thanks... so basically you can't make some small changes (e.g. bug fix) in master and then return to branch and see them there as well...
0
Q: Automatic create email address for my website members(PHP)

user1581486 When user create account with their email( Eg., username@gmail.com), I want to create email for that user with my domain name( 1234kjdhflkdj@mydomain.com ) automatically. And others can see that created email(1234kjdhflkdj@mydomain.com). When others send mail to that email(1234kjdhflkdj@mydomai...

oh git you often make me stupid :)
@tereško "in Model2 MVC and HMVC patterns the view is active are requests information directly from model layer"
can you change this please?
 
5:06 AM
fixed ...
 
kewl
 
lost my train of thought at some point
 
well at least you have a train
0
Q: jQuery create multi-level unordered list

RPM1984I'm trying to create a multi-level unordered list with jQuery. In reality i'm sticking this into the jQuery autocomplete plugin, but i've dumbed down a jsFiddle keep it simple with hardcoded data and without the plugin. First the hardcoded output (what i want to see), then the dynamic output (w...

 
5:22 AM
@tereško, did you read my message from a while ago?
 
yes , and i ignored it
 
why :(
can you just tell me if that was the right setup?
$needle = new User(0, array("username" => "johndo@foo.com"));
$match = new MatchUsers($needle);
$matchedResults = $match->fetch();
or
$needle = new User(0, array("username" => "johndo@foo.com"));
$match = new MatchUsers($needle);
$match->fetch();
 
setup for what?
 
the data mapper (?) teresko was helping me with before
 
5:32 AM
@tereško, I honestly think I get it now. Can you take a quick look at this: pastebin.com/2BXdKVam
and $foo would be the one that you'd continue to use, which is how you said it should
 
he is ignoring you
 
hi frnds anyone have php scripte for google cloud to device message i have try this pastie.org/4420282
 
@webarto yeah :/
 
@Khan LOL?
@Nile probably with a reason
 
@webarto I ask to many intolerable questions for him, lol...
 
5:38 AM
valid reason :) ask publicly, and if no one answers, you get the picture...
 
actully i m android dev the script is from one of my couligue and when run that code get unautorized error 401
 
@webarto I'm pretty sure I've got what he was trying to explain to me before figured out, so everything should work :D
brb
@AlexCastro, any questions?
 
@webarto @Nile any idea ?
 
@Khan yeah
 
@Nile I have classes working, now working on assignments.
 
5:43 AM
alright, i'm here for a little bit, so..
 
Okay question
addhomework.php?id=5
If I go to that page, and fail the form, it re-loads the page without ?id=5 so I lose my variable
 
fail the form?
 
Well, leave fields blank and such
 
what is the "action" attribute on your form linking to?
 
action="<?php echo $_SERVER['PHP_SELF']; ?>"
ah I can change that then
 
5:46 AM
yeah
leave the action attribute empty or take it away completely
 
oh okay
 
what's up guys? question: i have a list of options that i'd like to include in a submission form. the list is to be included between 1 and 30 times, based on a numeric stepper list (1 - 30). the stepper uses javascript to display the options onchange. the problem is, when i text the code on it's own, it works fine. but when i include it into the main form, the functionality of both the stepper and the options list doesn't work at all. any clue what could be going wrong once included?
 
Works great, @Nile, thanks.
 
*test (not text)
 
@AlexCastro if you're using html5 (doctype <!DOCTYPE html>), you need to completely remoe the action attribute
 
5:49 AM
Ah, okay
 
(that is, only if you want it empty)
 
@Nile "Fatal error: Call to a member function prepare() on a non-object in /home/homework/public_html/addclass.php on line 99" when I use the code:

$query = $pdo->prepare("INSERT INTO courses (name) VALUES(?)");
$query->execute(array($classname));
wait
$pdo should be $db
 
lol
 
haha
works fine now
@Nile the site is....done?
 
@AlexCastro yours?
 
5:54 AM
YES
Just need to add one more thing, which is admins
 
ah okay
 
Simply want certain users to have access to a page while others dont.
But other than that, I'm done.
pastebin.com/uKLSSyvC is my current user checker.
How should I change it to allow certain users to access a page? add a new column to my database?
 
yeah, you should create a new column in the database. or make an array of the usernames of all privileged users
 
I guess I should actually make a "teacher" table
since I already have a "students" table
 
are both going to have the same exact columns?
 
5:59 AM
and I could simply include() the teacher check instead of the student check
 
^
 
uhm..
yes
user/pass/mail
 
so just create an extra column called permissions, 0 = student, 1 = teacher.
and change the table name
 
but isn't another table for teachers neater? haha
 
w/e
 
6:01 AM
and plus they'll have their own registration on another page, so I'd save having to send that variable to the database
 
@AlexCastro okay
 
Well, I'm off for today
@Nile thanks for your help and see you later :)
 
@AlexCastro np, see ya
 
I've used a yml file of permission lists and then have an is_granted function that checks to see if the user has granted permissions... and each "user group" can inherit permissions from another user group if it's assigned to it so no need for duplicate permission entries per user group..
I'd show you, but my laptop is dead and the power cable is at work.. DOH!
 

« first day (663 days earlier)      last day (4276 days later) »