« first day (654 days earlier)      last day (4309 days later) » 

7:00 PM
is there a some sort of list of usual stuff that you should and should not put in Model/Controller?
 
@webarto The general rule is fat models, skinny controllers
 
Phelps got the silver. Too tan for gold
 
@GordonM What country took Gold? I didn't watch.
 
@GordonM That schmidt dude was epic :o
 
@webarto Try to avoid this guy.
@LeviMorrison South Africa, I think.
 
7:06 PM
@GordonM mine is skinny :D @Truth yes, but maybe some situations where I find it difficult to decide
function new_messageAction()
{
    $messages = new MessageModel();

    $messages->new('...');

    $notifications = new NotificationsModel();

    $notifications->new('...');
}
amidointrite?
 
@webarto Models are not single objects
 
hey guys doing some code maintenance looking for some good SciFi to fill up the silence
 
@Truth enlighten me?
 
9 followers away from a huge milestone
 
@ircmaxell sounds interesting what are you gona do to cellebrate
 
7:14 PM
nothing
 
I'll follow you if you celebrate
 
lol
 
actually what would i be following
 
@webarto Read the entire discussion between me and teresko
 
@ircmaxell, New Jersey, USA
Anything Regarding Software Security, Performance, Quality and Architecture...
2.6k tweets, 991 followers, following 134 users
 
7:15 PM
@rdlowrey How goes it?
 
now your 8 away
:)
 
user895378
@LeviMorrison Given rfc2616-sec10.3: A client SHOULD detect infinite redirection loops, since such loops generate network traffic for each redirection. It's trivial to check this with the previous responses stored in the response chain, but should I bother since there's already a "max-redirects" setting in place?
 
@rdlowrey Most people solve the infinite loop problem with max-redirects. That's the whole point.
 
user895378
And if so, should redirection just stop right where the first looping location header is encountered?
 
One option is to detect loops and not set a max redirects, but allow the user to specify one for other reasons.
 
user895378
7:17 PM
@LeviMorrison I think that's the best solution.
 
user895378
It's really easy to determine if the redirect is looping when you have the previous responses queued up.
 
user895378
Cool.
 
user895378
@LeviMorrison And it's going quite well.
 
Glad to hear it.
I get to shadow someone this week to see if I want the job I interviewed for.
 
nice
 
user895378
7:20 PM
That's nice of them. Perhaps it's to see if they want you for the job you interviewed for:)
 
@rdlowrey famous last words...
 
@LeviMorrison what sort of job?
 
user895378
@ircmaxell yeah, seriously. "Oh yeah, that's no problem at all. Wait. Why is my server under DOS attack? Oh crap every request is starting an infinite redirection loop!"
 
@Truth I'm too stupid to understand now I'm afraid
 
@rdlowrey Or "why is my server under DOS attack? Oh crap, every request just redirects to the same URL with a different timestamp appended!!!"
 
7:23 PM
@webarto Basically, the Model is a collection of objects
Domain (Data) objects
Mappers (Storage) objects
and Services, which encapsulate both and provide a way to interact with the Controller and the Model
 
@Lusitanian It's a JavaScript job.
 
@Truth somewhat understood, would be even better on an example but to much to ask, thank you :)
 
@ircmaxell all of their articles are shit
 
I have 2 years of payed experience in PHP, looking to round out my skillset a bit more.
 
7:26 PM
77
A: How should a model be structured in MVC?

tereško Disclaimer: the following is description of how I understand MVC-like patterns in context of PHP based web applications. All the external links, that are used in the content, are there to explain terms and concepts and not to imply my own credibility on subject. Updated version The first th...

 
@Lusitanian I was linking the commetn
 
@ircmaxell just saw it after reading, i'm not even going to bother replying to it
@LeviMorrison interesing. good luck (:
 
@Truth ah, bells ringed, thanks again :)
 
@Lusitanian They are targeting modern browsers (defined as latest two major browser versions from each vendor), so it won't be too bad.
If I take it, that is.
 
Ah, to be in that position
 
7:28 PM
The company is domo.com
 
Where did you work as a PHP developer out of (college, I'm guessing; based on age)?
 
@ircmaxell I just did a bit of microbenchmarking for action dispatching
Using switch scales really badly for many actions
Just using method calls is a lot faster
 
word tutorial is such an idiot magnet
 
But even faster is doing a binary search
 
7:32 PM
@Lusitanian Brigham Young University. I work for the supercomputing (HPC) department.
 
Binary search becomes slower around 50k actions
 
@NikiC huh? really in what cases?
 
This surprises me a bit, I didn't think that binary search would be faster for it. I thought just doing a direct method call was faster than all the binary search conditions
 
@LeviMorrison wow, sounds like a cool job
 
@Lusitanian And for a student job it also pays really well.
 
7:34 PM
remind me to apply to byu
 
@NikiC when you say binary search...?
 
I could make a lot more by working off campus, but this pays well enough to support me and my wife and is EXTREMELY convenient.
@Lusitanian Where are you from?
 
understandable, when do you graduate? --ohio, pretty long way away from utah
 
user895378
@LeviMorrison The spec requires that Location headers be absolute URIs. But many sites incorrectly specify relative headers like Location: /index ... browsers generally tolerate this and build an absolute URI from the broken header to improve user experience. I'm allowing the client to tolerate relative Location headers unless you think there's a good reason not to?
 
It'll bork on IIS
 
7:35 PM
@rdlowrey Is there a newer spec than 2616?
@rdlowrey We only need one reason to tolerate it: PHP allows it.
 
@ircmaxell What are you, the Swedish Chef?
 
I didn't even know they were supposed to be absolute.
@rdlowrey Do you know if PHP builds the absolute for you or if it passes it on as-is? (latter is my guess)
 
Yeah, IIS will fail if given a relative redirect (I think it strips out the header and fails to redirect)
 
If you look at the browsers console you can see absolutes even if relative are specified. @LeviMorrison
 
user895378
@LeviMorrison I just tested it and it redirects to an absolute uri on the 5.4 php webserver
 
7:38 PM
@rdlowrey But was the header given as an absolute URI?
 
posted on July 31, 2012 by Thomas Weinert

Basically Iterators provide a list interface for an object. Like all interfaces they are a contract how something can be used. If you use an interface it is not relevant how it is implemented - the implementation logic is encapsulated. It is of course relevant on the integration level. A bad implementation can impact the performance of you application. Even an good implementation may need spe

 
user895378
oh, I'm not sure if php "fixes" the relative header when it sends it. Let me see ...
 
@Feeds That title reminds me of something
 
@NikiC lol
 
7:40 PM
@NikiC yes, your proposal
 
And the code samples are obviously very good arguments for generators :D
@ircmaxell I rather meant your blog post :P
 
user895378
@LeviMorrison No, php sends along the relative header. But if you have auto-redirection turned on in the http stream wrapper it appears that the wrapper determines the absolute uri from the previous scheme/host and the relative location header. I think that behavior makes sense for clients. Try to fix it if possible.
 
@ircmaxell You called it "What Generators Can Do For You"
Seems ... similar :D
 
Ahh... I should sue for trademark violation
kidding of course
 
7:42 PM
@rdlowrey Agreed.
Way better than throwing an exception.
Oh, that location isn't a valid URI.
FAIL APP
ABORT
 
user895378
I never even realized the location header was supposed to be an absolute URI until today because browsers have been fixing it for me forever :)
 
@rdlowrey cmon you serious
 
really?
 
user895378
Robustness is more important than strict correctness when you're talking about dumb browser users, I suppose :)
 
:P
 
7:45 PM
@rdlowrey Myself included in that group, apparently.
 
wow...i was just typing "git submodule add" and repeating it for 15 seconds wondering why it wasn't working...
 
user895378
dear git: Y U NO CLAIRVOYANTLY KNOW WHICH SUBMODULE I ADD!?!?!?!?!
 
@rdlowrey Referer[sic]
 
git submodule add mindreader
 
user895378
7:47 PM
@LeviMorrison yeah I was just reading about that.
 
rad
Hi guys :)
its my first time using the chat here :)
 
user895378
@ircmaxell whhhaaaaaaaaaaat
 
@ircmaxell what are you doing to my perception of css
 
@ircmaxell Won't load for me in chrome/linux, works fine with FF
Hi @rad
 
7:52 PM
Hey everyone :) If I have an if statement, and inside it are two foreach loops, and several other if statements. Will the foreach loops execute entirely (all iterations) before the rest of the code (if statements, etc)? Sort of a basic question but my brain is fried right now.
 
@Truth epic thread is epic
 
rad
Hey @MikeB
 
if (if == "if")
 
@MikeB Mine is fine.
 
rad
@GordonM lol
 
7:54 PM
@LeviMorrison Chromium 18.0.1025.168 (Developer Build 134367 Linux) Ubuntu 12.04 (All I see is a black page)
 
rad
@ircmaxell thats incredible!
 
@MikeB Version 20.0.1132.47 Linux Mint. Upgrade that, bro.
Don't you get Chrome updates on Ubuntu LTS?
 
2 major versions! Updating now
 
@rdlowrey Also need to think about User-Agent
 
rad
8:00 PM
I have a problem in connecting to a server using SSH, can anyone help me with it, please?
 
Tasty steamed asparagus for dinner
Well there we go, Phelps got his gold.
 
@GordonM silver, i thought
 
@Lusitanian Too tanned for silver.
 
Gold in the relay.
 
8:16 PM
ohh
 
There's only been 9 today...
 
@MikeB Too busy with work and Olympics.
 
i still have 56 rep to be able to cast closevotes
 
Has power been restored in India?
 
@PeeHaa I'm working on the OAuth lib and I have a question if you know the answer...is the response format dependent on the protocol (i.e. is it specified in oauth2) or the service
 
8:25 PM
darn @GordonM, as I'm into my second paragraph of this answer, you post one that's almost exactly what I was typing :P
 
Subjective code style/structuring question! Would you move the second return statement inside of the try/catch?
        try {
            $id = $this->gateway->create($accountRequest);
        } catch (Exception $exception) {
            return new AccountRequestResponse(
                "Encountered an internal error while creating the account request.",
                AccountRequestResponse::INTERNAL_ERROR
            );
        }

        return new AccountRequestResponse(
            "The account request was accepted.",
            AccountRequestResponse::OKAY,
            $id
        );
 
@LeviMorrison yes.
 
@Lusitanian Dunno to be honest
 
@LeviMorrison I think the exception should bubble up to the caller of the function, and let the caller decide what to do.
 
@PeeHaa Okay, well I'm going to implement the parsing mechanism in the AbstractService class
 
8:29 PM
 
typeracer
 
I've been practicing on type-fu a few days a week, but not much progress :[
 
anyone here have experience with Sugar CRM?
 
old muscle habits are hard to break
 
8:30 PM
@orourkek It takes time, but is totally worth it
 
I'm actually astonished how few programmers seem to know how to touch type
Also, Pink Floyd for the gymnastics. Bitching
 
@GordonM I'm sort of in the middle
 
user895378
@LeviMorrison I think we need to rename Client::send to Client::fetch or Client::retrieve because "send" doesn't imply that you're getting anything back. In fact you're specifically returning a response or a response chain. Perhaps Client::fetch(Request $request and Client::fetchResponseChain(Request $request)? Thoughts?
 
I just got certified by typeracer at 160 WPM
lol
 
@SomeKittens probably shit
 
8:32 PM
Damn, I'm going to be playing that now.
And Ironside? WTF
 
@Truth If I did it your way, at the very minimum it should throw a new exception. It's important not to leak abstractions during error handling.
 
@PeeHaa ...Touch typing or Sugar?
 
@SomeKittens Not that I know it, nor have I seen anything of it, but almost anything that gets shared here is shit (Sugar)
 
30 WPM :{
 
Let;s open a random file...
 
8:33 PM
@rdlowrey Client::request. Request is a verb . . .
lol
 
user895378
@LeviMorrison woah dang! how did I not think of this
 
@PeeHaa It's received many incredible reviews. I was just wondering if anyone could comment on the developer interface of the OSS version
 
@SomeKittens Is it this: github.com/sugarcrm/sugarcrm_dev?
 
looks like it
 
@PeeHaa No README.md . . .
 
8:34 PM
@GordonM which car were you
 
yellow one that kept coming second
 
@SomeKittens k opening a random file...
 
@rdlowrey "request" doesn't exactly imply a response by definition either
 
user895378
8:35 PM
@orourkek I think it does. A request is specifically asking for something.
 
@orourkek Besides, this is HTTP we are talking about. Requests have responses . . .
 
@rdlowrey Yes, but it's different than "fetch" or "retrieve" in that "request" as a verb just means to send something, not necessarily to get something
@LeviMorrison true enough
 
@orourkek request: An act of asking politely or formally for something.
verb: Politely or formally ask for.
emphasis on "for something"
 
Yeah, ask for, not get ___
 
but it doesn't mean just to send something either
 
8:37 PM
@SomeKittens also it looks like they are using space and tabs. There is only one thing I hate more than tabs and that is when they are mixed ;)
 
eh this is a stupid semantic argument anyway
 
user895378
:)
 
Whenever I use "request" as a method, it usually also means planning for no response
 
@orourkek Don't forget context. Requesting something in congress? Don't plan on a response. Requesting something in HTTP? You can count on one unless the server is unreachable.
3
 
@LeviMorrison haha
 
Do most libs have interfaces implemented?
 
Another day saved...
5
A: PHP array overwrites itself

NealYou are using the same variable names for both the inner and outer foreach loops which is overwriting the variables.... Change the names in one of the places, and you should be good.

I feel ugly answering a question that has mysql_* in it, but not mentioning about it at all...
is that normal?
 
@Neal No. Normally you would make a statement about it :)
 
8:44 PM
@Neal nooo!
 
@PeeHaa actually wtf. these apis are widely varying, it's going to need to be purely abstract.
i'll commit as soon as this is workable so you can start working on the g+ implementation if you'd like
 
@Lusitanian I had a feeling it wouldn't really be standardized :)
@Lusitanian As a said: take your time :)
I*
 
hehe yes
it should as clean as possible
 
@PeeHaa lol
 
@Nick They should. Interfaces allow you to integrate your code into theirs or vice-versa.
 
8:49 PM
T-7 followers to go
 
@ircmaxell for what ?
 
@Nick 1000 followers
 
@LeviMorrison ahhhh thanks, just checked already following.
 
I've been searching for how to connect to a MySQL database and run a query via SQLi on Google and all I can find is hacking tutorials. Could anyone guide me in the right direction?
 
@Alec sqli? That indeed sounds like hacking :P
 
8:54 PM
@PeeHaa Maybe I misunderstood someone I heard speak, but they said to use SQLi instead of normal SQL.
 
@Alec Are you sure it wasn't mysqli_*?
I only know SQLi as SQL injection
 
@Alec lol sqli = sql injection
 
@ircmaxell, New Jersey, USA
Anything Regarding Software Security, Performance, Quality and Architecture...
2.6k tweets, 993 followers, following 134 users
 
Anyone got interesting articles to read? Did SOLID yesterday and want to read something more advanced
 
@PeeHaa Oh, thank you. I've been trying to find this on PHP.net for a while and couldn't seem to locate it. This will be useful, and will probably help solve my issue. Thanks.
 
8:59 PM
I know it's a vague question, sorry.
 
@Alec np :) Don't want to confuse you, but you may also like to read about PDO
 
@PeeHaa I see the word transaction everywhere on that page. Feels like banking stuff.
 
big no no?
$token = db_insert('fb_logins')->fields(array('uid' => $userid, 'access_token' => $access_token))->execute();
 
@Alec A transaction basically means you can for example write stuff to the database (but not yet save it) and do other stuff and once everything is finished correctly you can complete the transaction by committing it. Or you can rollback otherwise
@Alec mysqli also supports that
 
@PeeHaa Alright, I should probably get reading then.
 
9:06 PM
2
A: PHP MVC, view loop handling

Sheikh HeeraThe best way or the approach being used in MVC is to keep your programming logic in the controller, do the database related stuff in the model and format the layout in the view. In your case you should call the $user->getDetails(); in the controller and then pass the result in the view then lo...

 
@hanleyhansen . i.qkme.me/3qax0v.jpg
 
wtf github is saying everything is up to date after i pushed but the commit won't show up
 
@Lusitanian I think they are having issues or are doing maintenance.
 
@PeeHaa I'm glad it's not just me, I was going to Tom Preston-Werner and cry
oh there we go
 
9:12 PM
@tereško, I'm confused, can you clarify more what did you mean ? I'm still now saying that controller should contain all the programming logic and from there you should call model functions declared in any model. — Sheikh Heera 2 hours ago
aaaaaarrrrgggh
Since I'm using CodeIgniter, I answered as described here in example. This $data['query'] = $this->Blog->get_last_ten_entries(); is inside a controller and it retriving data from model, which means the modekis returning data to the controller and then the controller passing the data to date view as follws $this->load->view('blog', $data);. — Sheikh Heera 2 hours ago
 
@Lusitanian github is shit slow :(
 
@PeeHaa :(
 
@tereško Seeing "codeigniter" on a question should be enough warning for you to pull the ripcord...
 
@tereško here's another one for you stackoverflow.com/questions/11749052/…
 
@Lusitanian CHARRRRRRRRGGGEEEEEE!!!
 
9:18 PM
because god forbid he actually not use the cakephp "tableheaders" function
what the hell is the point in that
 
How can I add : at the beginning of every key in my associative array?
 
@Truth hmmm?
 
@Neal array("foo"=>"bar", "test"=>"boo") should become array(":foo"=>"bar", ":test"=>"boo")
 
foreach($arr as &$key=>$val){
    $key = ":" . $key;
}
 
Any way without a loop? :_
 
9:22 PM
@Truth nm my code doesnt work :-P
but no, twould have to be some sort of loop fn that you use
 
@PeeHaa added you as a collaborator..hint hint
 
@Lusitanian :)
 
just used blogpost as one word
Would saying "CakePHP tells demeter to go fuck herself with a ten foot pole" not be inline with SO's philosophies?
 
@Lusitanian Hey it's the summer of love anything goes :)
 
Hello people! Has anyone here used the Facebook real-time updates API?
 
9:41 PM
@tereško I find myself linking to your MVC discussions/rants nearly every day
 
I just made 63 free throws in a row so I'm not doing anything athletic again for the next two weeks
 
woot.
Watching the patent system in the US implode under its own weight is endlessly amusing to me.
 
@GordonM It terrifies me more then anything
 
How so?
 
because it's completely unpredictable and could end up fucking FLOSS
 
9:56 PM
I'd say the more likely outcome is the patent system falling apart, or at least software ceasing to be patentable in the US. And if you're right and it does go that way, well, I'm not in the US so it's only you guys who are screwed :)
 
@GordonM Ultimately the same reason I'm scared of the US government implementing any technology law. The people making and deciding the law have no clue about computers.
 
@GordonM damnit
okay I'm sorry but..."select *, 3959 * acos( cos( radians(37) ) * cos( radians( lat ) ) * cos( radians( lng ) -
radians(-122) ) + sin( radians(37) ) * sin( radians( lat ) ) ) ) AS distance
FROM places
GROUP BY places.user_id
HAVING distance > 0
ORDER BY distance LIMIT 0 , 10;
"
WHY?
 
EU's pretty strongly against software patents as it is.
@Lusitanian Was just looking at that.
 
That's where you can make a case for storing calculated data.
 
@Lusitanian go go gadget haversine formula
 
10:02 PM
native mysql implementation
@PeeHaa this is so obnoxious. Google accepts the scope of the Oauth request as part of the url, and other services accept it as a GET paramater
Then the tokeninfo validator takes it as a get request
 
user895378
@LeviMorrison I just pushed the fully functional client (github doesn't seem to be displaying it yet). I did a lot of manual testing on the command line with it in lots of different scenarios, so I'm pretty sure it works perfectly. However, I do still need to come back and reach 100% test coverage on it later tonight. Lemme know if you see any issues with anything.
 
Will do.
And thank you :)
 
user895378
The sad thing is I'm actually excited to do a wiki page for it :)
 
actually i misread google's docs
 
@Lusitanian hehe
 
10:10 PM
I'm going to push a google implementation fairly soon that'll probably be totally broken, but if you want to write tests for it/just test it that'd be wonderful
 
@Lusitanian I'll look into it tomorrow. Going to take the dog out and sleep :)
 
okay enjoy
 
later all
 
Relatively new to caching. Is the following okay?
/**
 * Provides a way to dynamically change which CSS file we use for syntax highlighting.
 * Implements caching.
 */

$last_modified = filemtime(__FILE__);
if (!empty($_SERVER['HTTP_IF_MODIFIED_SINCE'])) {
    $if_modified_since = strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']);

    if ($if_modified_since == $last_modified) {
        header('HTTP/1.1 304 Not Modified');
        exit();
    }
}

// the default code highlighting css file
$cssFile = 'github.min.css';
header('Content-Type: text/css');
 
10:28 PM
Hello everybody.
It seems to me that I've found little bug in ZF. Please take a look at my question: stackoverflow.com/questions/11749950/…
 
^ magic probably :)
 
@ircmaxell am i doing this rite? - alec
???
 
10:43 PM
@ircmaxell Yes
 
again, huh?
 
@ircmaxell I felt like confusing you, since you often post confusing entries on your blog. Atleast confusing to me ;)
 
are you doing what rite (which is miss spelled anyway)
 
@ircmaxell Am I confusing you?
@ircmaxell Is your meager attempts to understand my omniscient mental stature affecting you?
@ircmaxell I am a ninja.
 
eih
 
10:46 PM
o.O
 
I found a way to confuse the smart people, by acting like a complete idiot.
 
fool-proof!
 
:s/acting like/being/
 
@ircmaxell ouch
 
I'm out...
later
 
10:48 PM
@MikeB I take it as you're a fallout fan?
 
honey, make popcorn for the movie, I just have one more bug to fix ... aaaaand it's 1AM...
 
Did you forget our 12pm agreement?
@we
@webarto
 
Looks like @webarto missed his deadline.
How embarrassing!
 
11:03 PM
No words for how some people work
 
@user1535882 we haven't had 12pm agreement, I just told you I work until 12pm, but I'm still working, haven't forgotten about your stuf... @LeviMorrison you'll be the first to know :D
 
[2012-07-31 01:07:01] Dejan Marjanovic: Ok
[2012-07-31 01:07:08] Dejan Marjanovic: when are you usually online?
[2012-07-31 01:07:23] Navid H: You let me know which time suits you
[2012-07-31 01:07:28] Navid H: And we can meet
[2012-07-31 01:10:38] Dejan Marjanovic: I work from 15 to 00h
[2012-07-31 01:10:46] Dejan Marjanovic: so I'll be on Skype then
[2012-07-31 01:12:59] Dejan Marjanovic: Hey, it's late for me, so I'm going to get some sleep
[2012-07-31 01:13:04] Dejan Marjanovic: hear you tomorrow then
i think id call that an agreement
 
Look, I explained you many times before, I work now, and do not have a chance to get back to you atm because I'm working ((1:05:49 AM) XY: cool, I'm looking over it now. will you be around for a little while still?), which is why I told you several times to send me email anytime and I will answer ASAP, but no, you think if you show up here it will make a difference? No, please send me your account number so I can return you your money, I don't wanna work with you. I haven't broken any deal...
except for not answering on Skype day or two ago, because I've had a f* car crash in foreign country...
 
Man cut the b.s you are not a serious person period
 
.
 
11:16 PM
I had a feeling about you from the start. And it was not a good one
So send me back the money, nothing else needs to be done. Shit happens
 
So, when will you make the transaction?
 
it took you 5 days, so are you making a deadlines for me now?
 
You withdrew from the project
So I will need it asap.
 
Uhh, maybe this is something that should be discussed in a private chat room?
 
11:18 PM
^^
 
email?
 
Trustworthiness doesnt exist in some peoples vocabulary
 
ok, man, stop
 
Just dont run off with my money please
 
sigh
 
11:19 PM
just sayin
 
I can't even get to the border with that money
 
I thought i made you a wealthy boy
So i will email you my account no
 
because I'm from Bosnia doesn't mean I don't have anything to eat
 
I just hope you have the decency to not re-use all the content I sent you last pm
conviently enough
 
I'll log into skype soon, hold on a little
 
11:22 PM
sigh
 
/me running with your money
 
okey one minute then im out
 
and you are saying I'm the problem?
great
 
Lets go
@webarto
Come on what are you waiting for
 
you, sir, are rude...
 
11:29 PM
how do you have time for sarcasm?
its 1.30
waiting and stalling is all you are good at
man how do you call yourself Php engineer
@webarto stop wasting my TIME
What did you want anyway?
Bosnia
What a place to live
 
11:49 PM
you are behaving like a child and are making a fool of yourself, I'm on Skype, please leave this room, thanks.
 
a: goto a :D
I bet he'll say link is not working :D
 

« first day (654 days earlier)      last day (4309 days later) »