« first day (594 days earlier)      last day (4353 days later) » 

12:36 AM
silence :(
 
12:49 AM
SILENCE IS CALMING! woohoo
 
silence is disturbing!
 
1:08 AM
It can be yeah...
I'm quiet, 'cause I'm not in my office... Just got 7 new computers for my call floor -- have to get them all setup and what not.. pain in my ass
 
What was that all about now?
 
user895378
1:41 AM
@NikiC I've been really impressed by the judge's efforts to really understand the issue at hand. Actually learning java in-depth? I'm surprised, and for once, I'm proud of the American judicial system.
 
@rdlowrey Yeah, I was also really surprised.
 
user895378
AND the judge's middle name is "Haskell" :)
 
user895378
I declare that henceforth May 31st shall be known as "Judge Alsup Day." Thanks for putting in the effort to understand the issue at hand!
 
@hakre Is that you? twitter.com/#!/hakre
 
2:01 AM
morning
 
morning paul
 
Something I have been thinking about for a while is: When should a view produce a particular output format (e.g XHML, JSON, plain text) vs the production of an intermediate format before being converted to a particular output format. Any thoughts?
 
user895378
I prefer to inject a ViewFactory into the controller and based on the request headers/url determine the desired output format. Then, get an instance of the appropriate View from the factory. Each view class implements the View interface, so regardless of the output format, you assign data in the same way using HtmlView or JsonView or XmlView. Finally, the individual view class determines what happens inside the View::render method.
 
user895378
That's my personal method -- it's worked very well for me.
 
2:17 AM
Hmm, so, you never have any output format agnostic views?
 
user895378
I'm not sure why you would need one ... the information must be displayed at some point, so how are you going to output the data without a format?
 
user895378
I usually inject an app-wide config object with a defaultFormat directive in case none is specified
 
that makes sense, I was just worrying that the fan-out of writing similar views for different output formats could become a problem. But, I have been coming to the conclusion that views should just produce a single output format.
 
user895378
I suppose you could create NullView whose NullView::render method just returns NULL
 
user895378
My format-specific views will usually extend an AbstractView that implements all the functionality except View::render ... so maintenance isn't an issue.
 
user895378
2:22 AM
When used with a ViewFactory it makes adding a new output format as simple as adding a couple of lines to your factory and creating a new View implementation for the specific output format.
 
that sounds good, I think I'm on the right track. My view interface is a single function, but I'm not really happy about the name of it: get.
 
I think I'm happy having the view and rendering separate. That's why I'm calling my function get because it only gets the raw data that represents the view and is ready to be written.
 
user895378
That's why I have a separate View::render and View::output method. The render method specifically returns the generated output so it can be used in any context you want. I'll usually do something like $this->response->setResponseBody($body); where $body is generated by a call to $view->render();
 
@NikiC ROFL: "For those who have depended on the self-described patent expert for your understanding of this case . . . well, maybe now you will know better than to trust a paid spokesman."
And no, that's my twitter accounts grabber.
 
user895378
2:34 AM
@hakre Ah, then I need an update because I'm following your twitter accounts grabber.
 
Interesting, I think I saw GordonM using the response object for that too. I guess the body does belong to the response. I've just let my rendering objects write it out till now.
 
@rdlowrey Well I should not call that person a grabber, it's my twitter assistant. It does my tweets.
IIRC hakre on twitter does not twit, so do I ;)
 
user895378
@Paul The main reason I like a Response object is that it decouples your final output from the code that generates it. By that I mean, I usually want the very last thing that happens in script execution to be the sending of output. That way, if an uncaught exception is thrown during execution my last chance handler can render output appropriately instead of having half of the intended output already sent to the client.
 
@Paul Per format there is one view. That's actually the "view on things". Hence the name. If you need intermediate you might look for view models or value objects.
 
user895378
2:41 AM
Also, it's very easy to implement response caching, for example, if you have all your output in a tidy place like Response::getResponseBody()
 
Do someone know if i do a curl request, does my request is affected by my htaccess redirection ?
 
user895378
It's easy to store that in a file or in APC or something attached to the request URI if you need to do any kind of processing on the final output of a script.
 
@MikeBoutin depends whether there is a redirect or not. curl can follow redirects and you can set it up to not follow redirects - it's just that you need to know what you want.
 
@hakre ok ill think of that
im thinking to far
sry
Thank you
 
@MikeBoutin You can even say: follow redirects, but a maximum of three for example.
 
2:43 AM
how ?
u can show me an exemple ?
 
@rdlowrey Yes, although you can never guarantee that someone won't send output before then. My output is currently buffered, so it shouldn't be much change to send it to the response body when the controller is finished.
 
user895378
@Paul Well, I can guarantee that I won't send output before then, so that's all I really care about :)
 
user895378
I just like that better than output buffering, personally
 
what you are doing is also output buffering though? You keep building the string until you are ready to set it to the response body?
sure it doesn't use the ob_* methods.
 
user895378
@Paul Oh, yes. I just meant I prefer to hold off on the explicit calls to ob_start. Should've been more clear.
 
2:49 AM
Yes, hehe, actually I should have been more clear, I don't like ob_* too much either.
@hakre Thanks, yes. I'll be having views with a specific output format.
 
user895378
Too tanned for ob_*
 
Its time for lunch here now. Thanks for the ideas. I'll fix up my response object to include the body, that does make sense.
 
user895378
@Paul enjoy lunch!
 
cheers, unfortunately the sun isn't out here. The season is arriving for you though.
 
user895378
Oh yes, we've had two tropical storms in two weeks ... $$$ for surfing!
 
3:47 AM
how do I change the Loaded Configuration File path in the CLI version of PHP?
the one that you can see from running the command php --ini
 
@Phelios you there &
?
 
back from lunch.
 
hi
someone can tell me why when i process the string '404' into this
$strchg = array('-',' ');
$url = strtr($url,$strchg);
$spacechg = array(' ','');
return strtr(ucwords('Page'.$url),$spacechg);
it return me '4-4' ?
 
@Phelios there is also -d for passing a single ini option. Wanting to use those could mean that your application isn't fully modular though (requiring outside setup).
 
its ok
my wrong
 
3:53 AM
Paul, the problem is the CLI is not using the same php.ini as the web one
I think I can use -c
 
oh, yes, -c is the one.
 
but then, it doesn't seems to work
could not open input file: php.ini
 
Ayo folks.
 
maybe you don't have enough permissions to read it (or the directory path is wrong).
 
php -c C:\wamp\bin\apache\Apache2.2.21\bin\ php.ini <- this is my command
 
3:56 AM
php.ini would have to be in the current directory, you are probably better supplying the full path to it.
 
let me try again
 
hello Bracketworks
 
@Phelios is that whitespace before php.ini really there?
 
yeah
it's a whitespace
 
Get rid of it. Why is it there?
currently the command would mean use the ini file from the specified folder and then execute the php.ini file (as a PHP file), wouldn't it?
 
3:58 AM
ok, looks like the -c is only used to parse a specific php file using a custom .ini file
yeah, just figure that out
it doesn't really change the path to the default ini file
if I run it without the space
it sort of hang there
 
Hi all I just have a question to ask... about php..
 
Bill, ask ahead
 
im currently making a few php sites..
erm sorry just thinking of the easiest way to explain my issue
basically this is my select statement
$query = $pdo->query('SELECT EventID, EventName, EventDate, Location from events');
the php is programmed so it lists all the data inside a table.. with this print statement too
    printf("<td><a href=\"listresults.php?EventID=%s\">%s</a></td>\n", $row['EventID'],$val);
 
I've been thinking; does it make sense to anyone else, that hosting providers may not upgrade their platforms (think PHP), as most commonly used applications running on said platforms (think WordPress, et al) are very backwards compatible?
It nearly seems like a protest need be launched to prevent hosting providers from dragging their asses on versions such as 5.2.X
 
where i can click on any of the entries and itll link me to somewhere else like listresults.php?EventID=1
but with this SELECT statement it also shows up EVENTID in the table $query = $pdo->query('SELECT EventID, EventName, EventDate, Location from events');
If i remove the EVENTID from the select statement.. yes it wont show up EVENTID in my table
but if i click into an entry itll end up going to listresults.php?EventID=
and not EventID=1
is there a way to hide the EventID column but still link to listresults.php?EventID=1?
 
4:04 AM
the table is automatically generated?
 
@Bracketworks A good form of protest is in only giving money to a hosting provider that keeps up with the latest technology updates in a prompt manner. I'll be wanting 5.4 hosting soon.
 
sorry this is such a long question :P
yes the my php automatically puts all the data in a table
inside the web page
 
you using a framework to do that?
 
what framework?
 
or, how exactly is the html table generated
 
4:05 AM
$query = $pdo->query('SELECT EventID, EventName, EventDate, Location from events');
$rowset = array();

if ($query) {
while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
// Build array of rows
$rowset[] = $row;
}

// Output header first
$headrow = $rowset[0];
print("<table border=\"1\">\n<tr>\n");
// Use $rowset[0] to write the table heading
foreach ($headrow as $col => $val) {
printf("<th>%s</th>\n", $col);
}
print("</tr>");

// Then output table rows.
// Outer loop iterates over row
foreach ($rowset as $row) {
thats basically the code
 
@Paul So will I. 5.4 is still incredibly new, and I wouldn't care if I saw spotty support for that for at least awhile. However, 5.3.0 was dropped in June 2009. Despite carrying the 5.2 line in tandem, let's be real, the features offered in 5.3 eradicate a wealth of the development nightmares that back-porting to 5.2 forces upon us.
I just think it's irresponsible for hosting providers to not acknowledge (and do something about) that.
 
@BillChen Set EventID to 1 if it is empty.
 
well I have many entries.. with their own eventid.. 1, 2, 3, 4
 
@BillChen Also, the mysql_* functions ar... oh, nevermind. You're one of the few that got it right. :)
 
with the code i have atm everything works
but
it shows up the eventid column
 
4:09 AM
Yes, 5.3 was an awesome step forward. 5.4 has some nice features and speed!
 
if i remove eventID from the select statement it wont link to anything coz EventID= is nothing
?
 
@Paul Certainly. I think it would be plain good business for hosting providers to immediately adopt versions once proven stable. Easy enough with a bit of attention to the developer community. Seeing 5.4 largely supported in the wild would be great.
 
sorry @paul what's that link for?
 
Bill, the simplest way that I can think of is to skip the printing of first column
 
skip the printing of the first column?
how?
 
4:12 AM
probably use for loop instead of foreach
and loop from 1 to the column count (skipping the column 0)
 
@BillChen Sorry, forget the link. Keep your select the same, and in your loop: set $row['EventID'] to 1 if it is empty.
 
I cant set it to 1 because every single entry will link to eventid=1
ive got more than 1 eventid
 
for ($x = 1; $x < count($headrow); $x++) {
printf("<th>%s</th>\n", $headrow[$x]);
}
 
so where do i stick that in?
 
and you probably want to use fetch(PDO::FETCH_NUM) instead of ASSOC
it's actually to replace

foreach ($headrow as $col => $val) {
printf("<th>%s</th>\n", $col);
}
 
4:15 AM
@Bracketworks I guess the money is still happy enough with 5.3 for a while. But there will be more and more people like me wanting 5.4 that it will change. I haven't started writing 5.4 code yet, but I am definitely looking forward to short array syntax. In 5 years from now backwards compatibility to 5.3 will be scoffed at anyway, so the sooner I get onto 5.4 the better. As for hosting only providing 5.2, they ought to be ashamed of themselves.
 
yeap ive tested that
 
@BillChen if (empty($row['EventID'])) { // This ain't going to have an effect on everything. }
 
erm it removed the top row.. the headings
 
@Paul Hopefully 5 years from now, support for 5.4 will be scoffed at.
I'm thinking its a reasonable theory though, that due to backwards compatibility of popular blogging and CMS solutions, easily implemented by the non-tech-savvy, the hosting providers have little incentive to thrust forward.
 
($x = 1; $x < count($headrow); $x++) {
printf("<th>%s</th>\n", $headrow[$x]);
}

that code removed the headings row.. haha
 
4:18 AM
Convincing those developer teams to drop support for versions long past their age would prompt a massive upswing in motivation to upgrade.
 
@Bill, did you changed the fetch line?
 
yeah
 
Their customer bases (while this is speculation) must be inundated with non-developers.
 
i changed fetch_assoc to fetchnum
 
any error?
 
4:20 AM
ok ive changed the foreach to this
for ($x = 1; $x < count($headrow); $x++) {
printf("<th>%s</th>\n", $headrow[$x]);
}
and changed fetchassoc to num
fetchnum
 
@Bracketworks Yes, that is true. If I had a decent internet connection I'd be running my own server. In a few years time I'll be doing that for sure.
 
and now my heading is actually my first entry
lol
 
lol
probably because of the fetchnum
 
@Paul We need a change in the air. This is my cause, and I'll be the rabble-rouser. :)
 
hehe, nice.
 
4:23 AM
hm,
 
ok, let's use fetch both
 
fetchboth?
ok
 
I wanna setup some statistic logging to be ran after the page is loaded. so when php is done executing and everything is served, I want to run some extra stuff on the same request, but hopefully without the user ever noticing.
 
Fetch_BOTH er
 
@Paul @Bracketworks The best way to circumvent the whole hosting problem is obviously to simply host yourself :)
 
4:26 AM
duplicated the table
so theres now 2 columns of ID, 2 columns of each other columns
 
I think output buffer, flush when done making output, and then do the logging. anyone else have any better ideas?
 
yeah, doesn't work either
 
@NikiC True, but that's the equivalent to just bolting your doors when you live in a bad neighbourhood. Someone needs a cape.
 
can you create the header manually?
 
what do u mean?
 
4:28 AM
as in you write the column name one by one
 
oh
er
can u do that?
but will it mess everything up?
 
@Bracketworks Just don't call yourself Super Hosting IT professional man. It is going to look bad on the cape when you abbreviate it.
 
echo "<th>Event Name</th><th>Event Date</th>\n" etc
 
oh by the way I ctrl Z all the way back to the original form
 
ok
 
4:29 AM
where do i place that echo?
 
to replace the header printing

foreach ($headrow as $col => $val) {
printf("<th>%s</th>\n", $col);
}
 
oh i see
nice
well i guess ill re copy n paste the top bits
back into my php
oh wait
no
ok excellent
just need to remove that first column now
 
for ($x = 1; $x < count($row); $x++) {
// We don't know your column names, but substitute the first column (the ID) for FIRSTCOL here
printf("<td><a href=\"listresults.php?EventID=%s\">%s</a></td>\n", $row['EventID'],$row[$x]);
}
this is the replace the inner loop
 
that made everything
 
and remember to use fetchnum
 
4:32 AM
the table
oh
ok ill try it again
 
you've got lot's to learn Bill!! :)
 
i do!!!
ok well now its not giving me listresults.php?EventID=1 link when i hover over an entry
it gives me "EventID="
 
oh ya
change the 'EventID' to 0
printf("<td><a href=\"listresults.php?EventID=%s\">%s</a></td>\n", $row[0],$row[$x]);
 
holy crap
love u so much
 
thank you
 
4:34 AM
oh my word
the taste of success
 
as I said, you need to learn a lot
 
thanks so much haha
yeah
lol well i am only first year IT
 
first, it's really important to understand your own code
I see, wish you the best!
 
thanks alot!!
 
now, back to my own problem
 
4:36 AM
ooh
 
@ShyamK Hi
 
@muhammedbasil hehe
@muhammedbasil gm
good morning all
 
@Paul lol. No, I'm thinking "It's a bug! It's a crash! No, it's Backwards Incompatible Man!"
 
hi guys
 
@Bracketworks You'll also need a mysql_* is deprecated sidekick.
 
4:51 AM
I have a doubt can any one help me
 
@Paul I smell a web comic.
 
Room Topic man to the rescue: Discussion for all things PHP - Don't ask whether someone is here or can help. Just tell us your problem. If anybody can and wants to help, they will.
 
Man, this'll get bigger than DC and Marvel universes quickly.
 
Login form with email and password from database in php using codeigniter Can any one help me
@Bracketworks @Paul @ShyamK @muhammedbasil help me
 
@Ravi Do not ping everyone. We can all see your question, which you still haven't really asked.
 
4:54 AM
ok
i tried but i didn't get. this is my stackoverflow.com/questions/10814546/…
 
Sam
5:38 AM
anybody lurking around here?
 
Probably
 
Sam
lol....lurking in the shadows....ready to pounce on un-suspecting wanderers
 

« first day (594 days earlier)      last day (4353 days later) »