« first day (1319 days earlier)      last day (3854 days later) » 

00:00
@Ocramius I heard a story about a manager at a video game company I worked for not being familiar with master/slave terminology, so instead he was using the terms 'giver' and 'receiver' for the relationship. :-P
that's still messed up :P
Especially when kept going on about the server 'giving it' to the receiver.
I'm pretty sure that's a troll account "[email protected]"
heh
00:19
it is
I'm wondering if I should shred my hard drives
they have a "master" and a "slave" jumper. That's obviously offensive
Yep. Master and slave cardigan is much less threatening.
00:52
it's actually interesting that django dev team accepted it in less than 10 minutes
I'm sure it reflects the product and team quality very much
@zerkms I see it in a different way
@zerkms they just wanted to kill any mess before it was going to happen
So they merged it upfront and then applied the actual (valid) patch
morning!
01:42
@Ocramius if that's the case - good for them
 
3 hours later…
04:25
wassup guys
is it possible to do an OR within a mysql query for example SELECT * from database2 where id = toid and name = county OR something = something only if it exists??
@ThinkkSo what is 'something'?
code/query pls?
SELECT b.id, b.from_user, b.dateadded, b.posttype, b.posttext, b.photoname, b.blahchoice, b.commentschoice, b.mood, c.defaultphoto, d.firstn, d.lastn, e.status, f.topostid, f.commenttext
FROM t_board b
INNER JOIN t_userprofiles c
INNER JOIN t_users d
INNER JOIN t_friendship e
INNER JOIN t_postcomments f
ON b.from_user = c.user_id
AND b.from_user = d.id
AND e.friend_ids = b.from_user
AND f.topostid = b.id
WHERE e.status = 'Friend'
AND e.user_ids = 1
i want to do do f.topostid = b.id so that
this query only gives me data that has rows pertaining to only having those two equal
@reikyoushin for example i want to fetch the posts and each post contains comments and i want to grab the posts and the comments even if it doesnt contain comment i still want to fetch the poost do you get me
 
1 hour later…
05:56
@ThinkkSo what you need seems to be a "LEFT JOIN"
@reikyoushin how would i implement that in my query? lol
"INNER JOIN" will only include rows on b that has a corresponding value on f
but LEFT JOIN will more or less "attach" the values from the right (f) to the corresponding rows on your left table (b)
try changing INNER JOIN t_postcomments f to LEFT JOIN t_postcomments f
that should be it..
@ThinkkSo you could as well read this if you don't know the difference of the two.. stackoverflow.com/questions/5706437/…
didnt work return a row 25 times lol
@reikyoushin do you thinkk i should subquery my query?
i dont get why your sqlis structured like that though..
i'd normally do something like this.. pastebin.com/7xZTV9gH
*sql is
@ThinkkSo i dont think you would need that though, but it depends on you..
@reikyoushin thats perfect OMGOSH thank you
user924016
06:07
Mornings
Good Morning
Nice to start the day with a few closed questions eh?
user924016
=]
morning to you guys
You should NEVER use md5 for passwords. You should always use SHA1 or something more secure. link Other then the MD5 issue, the rest of the code looks correct — Jesse Aug 1 '11 at 12:26
06:12
@ThinkkSo so the real problem is how you joined the tables then..
why cannot I downvote comments !?
@tereško -1
why cannot I del-vote comments !?
like that?
:)
Good morning
06:13
@reikyoushin yes i thinkk it was because the inner join table on this = this,inner join table on this = this,left join table on this = this
don't worry - have done sha1 encryption :) — Alex Coplan Aug 1 '11 at 20:49
@tereško One of the biggest problems with that question is my crap answer! It was a while ago though :)
@ThinkkSo well, then now you know. :)
@AlmaDo Flag and they go away :)
@reikyoushin yes i do thanks to you man
06:16
@vascowhite i think it should've been a comment, no?
@reikyoushin It should have been deleted :) It has been now.
I don't want to go to work
@tereško Pull a sicky?
06:31
Morning
morning....
And morning @SecondRikudo
06:47
@vascowhite But if use DatePeriod, it will be duplicate of FuzzTree's answer. — krishna 4 mins ago
@vascowhite Wouldn't exactly be the close reason I would give...
Actually, if it's not a duplicate I don't think it should be closed, really..
He made the problem clear, he isn't looking for a library, etc.
Not researched, sure, that's a downvote. But not a closevote.
He's looking for code, I know its an edge case and a bit of a stretch :)
@vascowhite Find a duplicate then.
sigh
I'm considering toning down Stack Overflow for a while, and try Programmers out.
lol
user924016
07:03
=]
@JoeWatkins mornin
07:20
sitepoint.com/php-fights-hhvm-zephir-phpng <- one of the worst articles I ever saw on sitepoint
user924016
oh oh
user924016
Master degree in computers..
I just don't understand where most of the statements in that article are coming from ... I know this; the person who wrote it, cannot understand the patch by reading it, they haven't looked at or do not have the ability to understand what the patch actually does, nor did they listen to the many explanations provided ... just terrible ...
07:36
ok guys
is there a good microCMS that you can recommend (or at least not-warn-against)
07:55
Morning
@tereško Let me know if you find one.
Otherwise push @PeeHaa to finish his.
@JoeWatkins Wow, that article actually hurts to read.
Noob question alert: So I have a work PC on the network running as a local webserver. How would I make that accessible outside the local network?
@Fabien port forwarding
So some router settings pointing calls to that machine?
What I would do is the following:
1- Set a static IP to your PC
2- Configure your router to portforward say port 80 -> 80 or 8080 -> 80
3- You might add some security (ip restriction, http auth etc...)
Yeah
Morning btw...
08:06
Morning
I want to share my sadness.
@sectus Do share.
go ahead. this is the place
yeah. wall of pain
08:12
XD
I have created some classes to work with DB via PDO. It was cool, and have implemented almost all fields to retrieve value from DB and to store values in DB.
Cheers @HamZa :)
Morning to you too
My own ORM.
^ famous last words, eh?
08:15
But now i have to work with spatial mysql data
But i cannot work with Point, LineString, Geometry and other directly. I need to use mysql functions like: asText, geomFromText.
Any one can help me for improve site performance on mobile
Now i need to rewrite field class, insert, update and select to embed this fields.
Morning Jimbo
@Fabien I cba scrolling - did anything good come of those posts on Template vs View yesterday?
Any other views?
08:28
@Jimbo No idea. I ran off to the gym not long after I posted them.
Doesn't seem it. tag @tereško
Hi guys
anybody knows symfony ?
> The response is the View
emm .. no
By response he's arguing that the View is responsible for putting together the Headers and the Templates (body), amIright?
yes
well .. rails-like frameworks set the headers in controllers ... I guess this is a step in the right direction
Separating every single action into it's own class just seems mental to me
I read his code and I see some repeated stuff and also no idea what's going on in those actions
08:34
@Jimbo It depends
Over-abstraction is not good and leads to lasagna code.
There is merit in abstraction as long as it's actually needed.
Any of you guys handle deployment or have any recommended methods for it? Or is deployment subjective to that which you're deploying?
@SecondRikudo I would argue that if controller methods are hardly doing anything and just receiving data and rendering a single template (like most of my methods), then I don't need an extra layer of abstraction
@Fabien I deploy with Git with my personal projects.
On the flip side, I do like the idea of a View object controlling exactly what is output
It's just.. how I would make that work :P
@Jimbo The question is, is that all your controller is doing?
08:37
I would DI my templating system (twig), and a ResponseFactory into a generic View object
If that's all your controller is doing, maybe you don't even need a controller.
@SecondRikudo Nah, it talks to the model layer obvv
@Jimbo So what additional layer of abstraction do you mean?
@Jimbo why is your controllers rendering templates ?!
@SecondRikudo A View object
08:38
@Jimbo Consider the following
@tereško I'm DI'ing a \Twig_Environment and calling render($varsRetrievedFromModelLayer) method
I want to present different templates based on the Accept: header from the client.
That's it though
Where would that logic go?
@Jimbo are you aware that "rendering shit" is not controller's responsibility ?
08:39
Hence why I'm considering a generic View object and looking how to add it
Say I send an XHR request with Accept: application/json, who is responsible for selecting the correct JSON template?
(Hint: It's not the controller)
@SecondRikudo So the View would be checking the Request headers?
@Jimbo The View is responsible for the "logic of output"
What gets outputted, how it gets outputted
It's the job of the View to check everything needed, including user permissions, sessions, request headers, whatever, to determine what template to send, and what to populate it with.
I may want to send an XML if I have the ?type=xml query variable.
here is what you could think about, as a metal exercise @Jimbo: how you would go about implementing "2-level menu with current-item" which exists in all of the views
I may want to send an HTML page until a user has earned the privilege to use AJAX in some actions (for example, the 2k edit anything privilege on Stack Overflow).
08:42
What if user input from the Request is needed in the model layer, like some form details? Surely the Request will be passing that over?
@tereško I would use a template and other templates would include this template?
@Jimbo I don't see why the Request object shouldn't be passed to the View object as well as the Controller.
Twig has {% include other template %}
@Jimbo Yes, but how do you implement the current page being selected?
@Jimbo and where would the shared logic go ?
Ahh okay, so in a View that can render this template in multiple locations?
( that was an answer at both your Q's)
08:44
no, multiple views can render the same template, but what gets put in that template is shared UI logic
hence - where would you put that repeatable piece of logic ?
Twig accepts variables in includes too btw.
The piece of logic that reads from the Request and decides what the current item is?
@Fabien that has no impact on the question
@Jimbo why should it read from request ?
@tereško So it knows which the current page is for the 'current-item' to highlight in the menu?
Ignoring the Service Locator stuff because I have already solved that, I see a Generic Views thing I might be able to make use of
Can anyone using Chrome for Windows make a screenshot of their chat screen for me?
08:56
I find it disturbing, that, when I name which describes an architectural concept, what you see in your mind is some (usually procedural) framework piece
do you guys have any dirt on "Host1 Plus" (UK hosting company) ?
morning
@tereško I'm just looking to do something well with my current code and make it 'better', and I can use that knowledge for the future, framework or no
posted on May 27, 2014 by hakre

It’s one of the best kept secrets of popular PHP dependency manager Composer: How to flush composers cache. You normally don’t need it, however if you create some composer.json and you want to put it to a test, this can … Continue reading →

user924016
morning.. just fell over this on a clients current hosting..
user924016
HTTP/1.1 200 OK
Date: Tue, 27 May 2014 09:00:56 GMT
Server: Apache
X-Powered-By: PHP/4.3.11
09:03
mornings
@DaveRandom mognigr
Where on earth have you been?
@RonniSkansing Have "fun" "developing" for that :P @RonniSkansing
:P
@DaveRandom yo chris
user924016
haha well its redelegating now I hope..
09:05
@zerkms Hehe
@DaveRandom Very cool, any good?
A bit wet but generally pretty good
noice
I need to put The Boy in the bath and take him to nursery, bbiab
Love SQL (facepalm) xD
pastebin.com/UJZv6QEZ people think this is hard in my class
09:11
halp
intern did something wrong, and I have no idea what is going on
the php object reference numbers are stuck at "over 300-something"
It's over 300...
@tereško code?
@MikeM. ERMAHGERD! ALLCAPS!
ye because the teacher was bitching
@SecondRikudo NDA'ed
that I had to do it like him and not the normal way
09:13
:|
looks like he's feeding something in session
he does it because his browser is bitching so...
4 objects per refresh
@tereško Try clearing the session, and see if the count goes down.
@MikeM. His browser?
yeah , it did go down, and now it's going back up
09:14
Why would his browser bitch about SQL?
@tereško So yeah, look for objects in session.
@zerkms Lol, as if Replica won't hurt my Brand-And-Copyright-Loving-Feelings :)
@salathe I totally want to call him out on it ...
'intern' AKA unpaid labour.
if you're going to make a living writing articles ... first of all ... pffft ... and also, make sure they are actually based on facts and don't make you look like an idiot ...
idk why it is never asked he said his browser bitches with language if he types without caps...
09:17
@MikeM. Sounds like....
LOL
09:19
?
hehe
It'd be nice if all gifs simply auto-converted to their linked forms after a few minutes.
2 messages moved to bin
09:23
:D
@PeeHaa I have that extension too.
It's not much good now that my power was stripped from me, but I have it :D
@SecondRikudo How's it feel to have a gun but no bullets?
;-)
extension?
@DanLugg I wish, you could still hit someone with the gun.
09:27
lol. One of the last django comments :P
@SecondRikudo Following the analogy, I think that's caps-lock.
It's a fair point. If the movie Django never came out, would they have made this change?
@SecondRikudo So a View. If I have a BaseView and I automatically DI the Request in, I just have it automatically go to a get() or post() method depending on the Request headers? Then I also have a view specifically for each controller that extends this base class? Sound about right?
// the factory for services was injected in constructors
$controller->{ $method.$command }($request);
$view->{ $command }();
$view->respond();
@Fabien Doesn't the $view get DI'd into the $controller
To pass model layer retrieved data to it
Also, what's $command?
09:37
32
A: Understanding MVC Views in PHP

tereško Note: the MVC and MVC-inspired patterns are advanced constructs. They are meant to be used in codebases where ordinary object-oriented (that follows SOLID and other guidelines) code starts to become unmanageable. By introducing this pattern you would impose additional constraints, which then l...

> To create this response view acquires information from model layer
Please say via controller..
@Jimbo What?
@SecondRikudo I was under the impression that the controller asks for information from the model layer. Then passes this to the View. BUT, from the above quote, it looks like the View is asking for data from the model layer directly
@Jimbo No
The Controller is changing the model layer, and the View queries from it.
F*CK
09:41
That way, the View is not dependant on the Controller.
And the Controller is not dependant on the View.
I remember us talking about this a little while back
Bloody hell
@SecondRikudo you still need the windows+chrome screenshot?
@iroegbu Yeah, if you can make one
@Jimbo Model should be observable, View - observer. This is how I find it to be the cleanest.
Bearing in mind that we can't actually achieve classical MVC in standard request -> response context, we surely don't need the observer / observable pattern
09:44
@iroegbu Thanks.
Do you have desktop notifications enabled?
@Jimbo which is why Java did come up with Model2 MVC
which basically ditched the observer pattern, thus letting model layer to have a lifetime of request-response cycle
From Java Model 2:
> The controller performs any logic necessary to obtain the correct content for display. It then places the content in the request (commonly in the form of a JavaBean or POJO) and decides which view it will pass the request to. The view then renders the content passed by the controller.
@SecondRikudo I can't see the 'button' for toggling it
@iroegbu It seems to have just disappeared.
I remember it used to exist.
09:48
Looks like, for queries, from that Wiki article, the controller retrieves the content from the model layer and passes this data to the View...
Isn't it that the view can make non-state change requests from the model?
user924016
I really can not fit data for a view inside of the creation of a response
@Jimbo There are two general approaches.
user924016
It is not view imo
Either the Controller is the only one talking to the Model, creates the View and passes all data to it,
Or the Controller changes the Model and the View asks the Model directly for information.
09:49
@Jimbo What's wrong with something like this?
I am in the latter group.
@Leri Lots of extra stuff, I guess. lol, poor excuse..
@SecondRikudo If they're both acceptable, I think I like the former
@Jimbo It depends
The View either depends on the Model, or it depends on the Controller
@Jimbo Actually what extra stuff?
I think the second is better because the SoC is stronger there.
09:50
@Leri Observer / Observable all through my model layer and in the view
The former simply means I don't have to do that
model layer is separate from presentation layer:
views are separated from controllers
Pretty sure that's from PoEAA
I think that the first step for me is making sure my Views are not my templates, LOL
That I'll work on now
@Jimbo Well, method call overhead is nearly the same as in your architecture. Also you can have generic Observable/Observer as Java does. So you won't have extra interfaces for every model. I just prefer wasting few time on creating those interface rather than having one huge dispater inside Observer's onUpdate.
I have not yet applied that in PHP. However, I am pretty sure that architecture will work fine. ^
Hey guys, something fun: Type this in your console:
CHAT.user.current().is_moderator = true;
:P
this won't work
09:57
@Jimbo If it's any relief. I've My Very Coded my current work project :D.
@Fabien e_english?
MVC attempt that turned in to My Very Code
Ohhh
xD
Due to lack of foresight and understanding.
BTW, who is responsible to create View instance (this is quite dark side for me, at this point)? /me looks @tereško
10:01
If you're using Auryn, for example, just DI an empty View object into your controller?
Continuing from the Observer pattern int he view. Are there any other patterns people regularly use in MVC?
@Jimbo No, I don't. Also, I not sure if DI'ing empty View is proper way. I am thinking some inflater layer which is called in Controller(?)
How about a ViewFactory then
Either way, I'm not typing new anywhere ;) I'm lazy now
user924016
How about a ViewRocket ? =]
Or maybe inflate in request handler and then DI passes to action..
10:04
Yep, nothing wrong with that if you're not using auryn
What about a ViewFactoryProviderFactoryBuilder
Honestly, I like how Android handles that.
Could you not use the word Factory, it's insensitive to those child workers in China/Taiwan.
So no master/slave then
:O
@Jimbo Exactly! and it needs to be created by: ViewFactoryProviderFactoryBuilderLocator which is created by: ViewFactoryProviderFactoryBuilderLocatorFactory.
10:06
Ah my bad, you always have to Locate the ViewFactoryProviderFactoryBuilder
Off to my java/android world. Later.
Has anyone coded this architecture with generic View objects they have available on Github?
Nothing is available anywhere as a good example of code on a website.
I'd love to see a simple basic website built with high standard code on github.
A login, registration, some basic pages and maybe a blog or something.
Well, for the moment I'll leave this lib until I've seen examples of how to go about it. I don't want to spend time on it and mess it all up
I have a general idea but I'd rather not lonewolf it
I was thinking about TDD and why I struggle to really comprehend it. I'm wondering if my lack of understanding wth I am doing while I am writing code is a direct correlation to why I don't get tests.
I re-write so much of my own code.
10:22
Well if you're coding a service like that ServerArbiter yesterday, do it framework agnostic, each object with single responsibility and DI - it's then simple to test
Simply because I learn I did it wrong or it's better separated out there etc etc
@Jimbo Look at the comprehension of views for instance. Say you'd written a lot of code and you're templates are rendering fine. Then this crops up and you learn that views should be handled differently. If you had written all those tests... you'd presumably need to write whole new ones for the different implementations.
@Fabien Well I don't know about unit testing Views. Really you unit test your business objects in the model layer
They're not Integration tests, they're Unit tests
If everything in your model layer is unit tested, you don't need to test your controllers, because everything the controller is using is already tested
If you do test your controllers, to see if they work with gluing everything together - that's an integration test
I see
What about an application rather than a site?
In PHP?
So, still a web application?
Aye.
10:32
Same thing
> We germans demand not to use the term "Leader"..... we dont like this one!!!!11111
heh
Yay, Auryn makes me use factories for everything -.-
@tereško Does this mean your dispatcher is (in) your view?
@DaveRandom You back yet?
10:52
@LeviMorrison bugs.php.net/67345 :P
@Leri How are you getting on with bootstrap then? Assuming you used it.
@Fabien what ?!
@tereško nm. Being dumb.
@Fabien the whole misconceptions stems from your assumption that everything in the model layer is persisted somewhere
Rather than dealing with the two separately. Aye.

« first day (1319 days earlier)      last day (3854 days later) »