« first day (593 days earlier)      last day (4346 days later) » 

12:03 AM
@MichaelEcklund , you can make a wrapper around that $_COOKIES variable , at make sure that you can access the values in same request
thats how i would do it
 
@tereško confused -- not sure what you mean
 
@SethCarnegie , the PDO has a mode when each error causes an exception
 
@tereško well I mean, what should the behaviour of the API be
 
and then you can let them rise to the level at which you want to handle said exception
 
it seems like that's a leak in the abstraction
For instance, what should be the behaviour when a simple INSERT fails
 
12:06 AM
lets assume you are in a classical MVC-like setting
when INSERT fails , it happens at the DataMapper level of abstraction .. it throws an exception
 
And then what does the end-user see
"Your registration failed for some unknown reason"?
 
this exception gets handled by service , which creates an error-log entry and the service then is informed about a failure
 
Skip to the end-user :)
 
when view requests data from model layer ( via said service ) , it gets informed that there were some errors (maybe with the appropriate error codes) .. view then shows the end user whatever you want him to see
 
My question is what do you want him to see
 
12:11 AM
then dont talk about API
 
when this application is a web API
 
=P
user wants to see why something failed
INSERT would fail for one of two reasons : UNIQUE violation , or connection failure
 
How can you tell why INSERT failed without revealing implementation details that API users shouldn't know about
 
in first case you show detailed info to the user , on second , redirect to some "we have identified the problem and our specialists are currently solving it" page
.. i think i still dont know what you mean with "Web API"
are you talking about REST ?
or about a website
 
yeah REST
 
12:15 AM
just return FORBIDDEN header response
something failed , and you were not allowed to put data into the system
 
query errors, always best to return something generic but then log the detailed information so you can look back and see why exactly it failed in case there really is some sort of an issue in the query construct or whatever...
 
as i understand REST, you are basically exposing top level of model layer directly to the internet .. it should be whitelist'ish thing by nature
either user who works with it provide correct queries , or he is messing with it
 
@SethCarnegie Queries don't usually fail "just like that", so you don't need to think particularly much about that case :)
And if they fail you usually have larger problems :D
 
well .. exception would be the "db down" situation .. then i guess something from 5xx return code would be good idea
 
Yeah, but even that would be handled before the query is run by itself in most cases that issue will be handled when you actually make the DB connection...
 
12:30 AM
yup, exactly
 
:)
 
it's almost 4am , and i am still reading that damned manga
 
We'll forgive you this time @tereško being it's so early wherever you are (its 6:39PM here)
 
@tereško must ... not ... pass ... out
 
Does anybody have a good example of a Model class using PDO?
@tereško which manga ?
 
12:56 AM
@Nick What exactly are you looking for? I'm getting ready to leave the office right now, but i can check and see what I've got in my code repos at home that might be of some use to you.
 
I'm just trying to find a simple enough example of a Model Class using PDO..
 
Alright -- I'll take a look and see what I have at home when I get there and let you know..
I'll be out of touch for about an hour or so during travel..
 
That's fine I've got another long night ahead of me, just ping me
 
Will do.
 
@Nick Model is really a layer of your application.
 
12:59 AM
and that's what I want an example of
@Paul, Evoke uses PDO right ?
 
@Nick , Ichi .. a contestant for the "most generic title"
 
isn't ichi one in japanese
 
@Nick yes. Its built favoring PDO at the moment.
 
Yeah I was looking it over,, got lost
 
@Nick , yes , it is ...
 
1:07 AM
My models are still being changed, but I'll send you some links with my current thoughts.
 
alright thanks @Paul
 
This is a partially built model, with my current ideas on how it will be composed: github.com/Evoke-PHP/Evoke-PHP/blob/master/php/src/Evoke/Model/… It would be using a mapper (here is an example of a DB table mapper: github.com/Evoke-PHP/Evoke-PHP/blob/master/php/src/Evoke/Model/… ) and a data object github.com/Evoke-PHP/Evoke-PHP/blob/master/php/src/Evoke/Model/… from the model layer.
 
@tereško Is it worth reading ?
 
depends on what you like
it is like a darker version of Gamaran
 
@Nick its still in the very basic stages. Quite often I just use mapper objects and model data objects directly in my controller. Like this:
        $menuMapper = $this->modelFactory->buildMapperDBMenu(
            $this->settings['Constant']['Main_Menu']);
        $menuData = $this->provider->make(
            'Evoke\Model\Data\Menu',
            array('Data'       => $menuMapper->fetch(),
                  'Data_Joins' => array(
                      'List_ID' => $this->provider->make(
                          'Evoke\Model\Data'))));

        $view = $this->provider->make(
            'Rosalia\View\Header',
            array('View_Menu' => $this->provider->make(
 
1:14 AM
I know a couple of those words
:P
 
that example was using a mapper to get the data for the menu. Modeling (providing any required business logic) to that data and passing it to the view that returns an xhtml tree of the page header with a menu of page links, which is written by the writer.
 
1:44 AM
Sorry this isn't PHP related but I don't know where to ask Qs about the site. What is more important to an answerer: Accepted answer or reps? A lot of times I get multiple good answers and it's hard to choose, so I pick one (fastest, most usable, nicest, I dunno) for the accepted answer, and then +1 the "runners-up" that I think deserve it and put in effort or something. Is this right?
 
@user1159454 No worries, I'll post the link to the place (There are lots of good answers there. In addition to Qs about the site it is a mechanism for modification of the site by users.)
I think you were right, but meta will have a better answer than what I think.
 
Awesome thanks
 
2:16 AM
wants to go buy red bulls in 4:30 AM, forgets keys, finds keys, forgets where car is parked... #fml
gets debconf12 sponsored registration, needs a f* visa for Nicaragua
 
 
4 hours later…
5:59 AM
Hiiii @all
 
Sam
hi Rushi
 
hello @Sam
 
Hey guys
 
Sam
hey Truth; got stationed tonight again?
 
Can anyone please tell how do we exactly add 1 year to a date in javascript?
 
6:42 AM
happy new day everybody!
 
@dreamcoder
var d = new Date(2012, 5, 31);
d.setYear(d.getFullYear() + 1);
console.log(d.getFullYear()); // shows 2013
 
7:01 AM
don't forget the month is zero based
 
@hakre I see you've been contributing to wordpress for a while.
There's a ticket of yours regarding the removal of PHP4-style constructors such as WP_Widget's
What exactly happened to that story (considering on my latest-patched WP still contains that constructor)?
 
morning all
 
(for reference, I'm talking about this: core.trac.wordpress.org/ticket/16768)
 
7:17 AM
morning
 
@Christian Yes for about three years or so.
@Christian Good question, you have the ticket URL?
 
The "plugins are using PHP4 constructor" is a lame one.....I hope that's not the reason this mess still exists.
@hakre Yes... the link above? O.o
 
right ;)
 
:D morning syndrome
 
Yeah so far no coffee
I'll pick up the post first.
 
7:39 AM
@Christian After quick review I'd say it's because of backwards compat: codepad.org/xg7Qh6PZ
However, they should place a deprecation message in there probably.
 
How about using __call() to "fix" this?
 
more correct code example: codepad.org/xId4DnXS
@Christian An idea for the deprecation message probably.
 
Yeah, and the deprecation message should be there of course
 
Actually, Widget coders should not use PHP 4 constructors anyway, so probably leaving them with a fatal error should help to cure the issue, everything else looks a bit like overhead to me. ^^
 
@hakre Agreed.
 
7:44 AM
Okay, I should be more constructive, backwards compat is necessary. One might want to suggest a deprecation message. But you don't need __call for it.
Or do you'? Let me run a test.
Hey, this works like a charm: codepad.org/zhjNG7sC
 
@hakre Why not? You need to capture the method call, and it can't be done with a normal method declaration because PHP would think it's a constructor.
 
No magic __call needed, just keep that method but give notice while adding the real __construct.
Adding self to make the example more complete: codepad.org/7pspqqhe
 
I was under the impression PHP would complain about a duplicate constructor?
 
@Christian Does not look so. Not even a notice: codepad.org/2xJ8PJRs
 
What the heck is "E_STRICT Redefining already defined constructor for class WP_Widget" for then?! I'm getting confused by the minute. :(
 
7:51 AM
@Christian Where do you see that notice?
brb
 
in wp-includes/widgets.php line 95 (location of function __construct... for WP_Widget class)
 
@MrCode Thanks MrCode. :)
 
@Christian Is that your patched version? You have it on github probably? There is also a full wordpress git you can fetch from.
 
It's WP 3.3.2
 
okay, and which PHP version are you running?
 
7:57 AM
I hear there's a WP 3.3.3 RC tho.
PHP 5.3.latest
let me check exactly
actually, PHP 5.3.4 -_-
lame webhosts..
 
Codepad is 5.2.xyz: codepad.org/5B8XKSbz
Okay, the order is important: codepad.viper-7.com/Ah1pjJ
First define the __constructor, then the named function.
 
O.o
 
well sounds actually useful. So you don't add it after, but before.
 
Will you update trac?
 
This needs a new ticket I think.
 
8:02 AM
mkay..
 
Can you create it? You might get more traction on the ticket if they don't see my name creating it ;)
You know how deprecation messages are created?
 
I suppose...
 
brb
 
trigger_error('...', E_USER_DEPRECATED); no?
 
8:13 AM
@Christian no, there is a sort of macro function to trigger the deprecation message.
 
found it > _deprecated_function
 
jup, sounds good ;)
 
it requires 3 arguments, the first one is an automatic __FUNCTION__
the second is wordpress version and the third how it's called
what wordpress version should I use for my patch?
I think it should be deprecated as of since wordpress stopped supporting PHP 4, right? (WP 3.2.0)
 
No, it will be the next version. So if the patch applies to WP 3.3.3 it would be 3.3.3
 
ok
 
8:22 AM
Twitter shifts more processing from the browser back to server: engineering.twitter.com/2012/05/…
@Christian Just drop a ticket URL here if you created on, then I can review the patch.
 
@DipenBaskaran "It's not working" does not qualify as a question. Please read mattgemmell.com/2008/12/08/what-have-you-tried and sscce.org - then improve your question otherwise I'd say it should be closed.
It's the same with your earlier question: stackoverflow.com/questions/10823179/php-str-replace-in-loop
 
8:55 AM
Morning everyone!
Could I change upload_max_filesize via ini_set?
 
hi
 
Okey. Found answer.
 
good :)
i was just about to look up the docs for you
 
9:10 AM
got an prob.. I can't seem to remove the site icon that appears along with the title.. It disappears in FireFox but not in Chromium.. Any idea why?
I've tried clearing the cache of Chromium
 
@hakre to me?
 
@ShyamK no, but you might be interested in support.google.com/chrome/?hl=en
@Eugene nopi because it's too late ;)
 
9:49 AM
@ShyamK Are we talking about the favicon?
 
yes
I am. Chormium doesn't get rid of it
I have commented the line that is used to display it but Chromium is a little fussy in letting it go..
 
jay
hello
 
@ShyamK have you removed the actual file?
 
jay
any one can help me
in php
 
@jay 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.
 
jay
9:57 AM
i want to get last inserted title for same id .how to get ?
its a very diffcult task
 
Huh?
Could you explain better what you are trying to do?
 
jay
i have one table for message.when user post massages then it will inserted that table. then when view data then show last post message in messgae filed
 
@jay Either cache the posted stuff so you can display it or query the database to get the last inserted record
 
@RepWhoringPeeHaa , i honestly doubt that he has a caching layer
mornings , btw
 
jay
10:08 AM
yes
@RepWhoringPeeHaa
 
morning @tereško
 
jay
@RepWhoringPeeHaa can u solve my problem
 
@jay I'm not here to solve problems. I'm here to give advice
 
that link contains everything you need
 
jay
ok nop my code $pagina->sql = "select a.*, b.firstname, b.lastname, v.name, l.send_to_lender from $tableName a,users b,van v, van_enquiry l where a.van_id=v.van_id and a.from_id=b.user_id and a.user_type = 'H' and a.enquiry_id = l.enquiry_id order by a.created_on desc";
/
 
10:11 AM
@jay have you read the link @tereško posted?
 
did you know that he is looking for MsSQL based solution ? (which , btw , does not matter for PDO )
 
jay
yes exactly
i want to get latest message in meaasge filed
 
there is no "yes exactly"
i had to look at your question history to deduce that
 
jay
ok
 
read the damned link , use the damned API
case closed
 
jay
10:15 AM
last_inserted_id is not useful for me
 
@RepWhoringPeeHaa , stumbled upon this video: youtube.com/watch?v=TW78wbN-WuU ( its from DX3:HR promotional campaign, but it's still interesting )
 
@tereško whoah wtf
3 mins ago, by tereško
read the damned link , use the damned API
 
@RepWhoringPeeHaa that was about the the php.net link
 
jay
i am not getting answer
 
it is a complicated process .. at first you have to be able to write a correct question and then have to be able to understand the answer
23 mins ago, by jay
i want to get last inserted title for same id .how to get ?
@jay , this was your question ... i kinda fid it insulting
 
jay
yes
 
.. you are a shame for India
2
 
jay
i am biggner plz help me
 
10:31 AM
@RepWhoringPeeHaa I'd say such a question is valid.
@jay You want to learn about the silver bullet that solves all your problems?
 
@RepWhoringPeeHaa no.. but removing the link must be enough.. right??
 
@ShyamK no. (some) browsers will always try to fetch the favicon
 
@hakre If someone is handing out silver bullets, I'll take 37 of them.
 
okay.. I wanted to change the favicon.. guess I'll replace the file then :)
 
10:46 AM
@ShyamK You should do that and once you have done it browse directly to the favicon and do a hard refresh
e.g. domain.com/favicon.ico -> shift + f5
 
Hard refresh?
 
Looks like that question was just left over here to grab some answers which is a year ago and can be deleted now.
 
@ShyamK shift +f5 for chrome or ctrl +f5 for other browsers
 
hi repwhore ;)
 
11:00 AM
hiya hakre
 
hi all
i need a help
in php
 
okay thanks.. but what's the difference?
 
@ShyamK prevents getting stuff from cache should prevent the browser from getting stuff from cache
 
jay
11:22 AM
yes @Asker
 
okay.. thanks.. but clearing the cache and then refreshing the page will have the same effect right?
 
@ShyamK Should, however ctrl/shift + f5 is faster..
 
@ShyamK it should
 
thanks guys @Bracketworks @RepWhoringPeeHaa
 
11:29 AM
Hi @jay am new to php....
My query is.. I have to fetch all the data from database using From to To date
Am using Mssql as my database, and language using is php
 
@ShyamK , mind that Opera ming have a bit different behavior (including ctrl+r , instead of f5-combo) .. it has exceptionally aggressive caching strategy (and case of favicons, they are even kept separately from cache)
@Asker , and which part is the problem
 
@tereško coding part...
 
@Asker , usually there are to path to take in this situation:
- hire someone who is a professional
- learn .. a lot
 
@tereško chrome also supports ctrl+R but thats for reloading only I think
Damn that Opera
@tereško lol
 
11:36 AM
@ShyamK yeah , i think Chrome used ctrl+r as "reload only from cache" shortcut .. which is a nice way to reintroduce browser wars on UI front since Opera is much older member of browser market
 
@tereško aaah.. market strategy..
 
hey hi i am working on cakephp .just wanted to know I have 1 library file on my server but outside the cakephp folder and i want to include that one so how can i include that one.?
 
"Login" vs "Sign In", the other option is more suitable for humans?
 
@Sparkx your first problem is that you are using a framework too early. second issue is that you are using cakephp.
@Sparkx Learn a language first before using the libraries for it.
 
@OmeidHerat ok i used this framework but i have no time to brush up this thats why?
 
11:52 AM
And once you have learned the language you will notice that you don't want to use cake
 
@Sparkx why is what ?
You can't use a framework on its own. you need to understand the language.
 
i know php language
 
And your question is about include path ?
 
"knows language" !== "knows programming"
 
if you ask such a question I doubt if you know the language either.
 
11:55 AM
@RepWhoringPeeHaa , you would not understand why cakephp is a festering pile of crap if you only "knew php"
you guys keep confusing two different things
 
To learn PHP all you need:
_1_ a working server. _2_ common sense. _3_ the manual.
haha, I sure am bad with this.
markup isn't my thing.
 
@Christian replied, updated.
 
Good afternon
 
afternoon @Donut.
 
@OmeidHerat Hello, how are you?
 
11:59 AM
@tereško true that
helloo donut
 
@Donut am good thanks, how are you ?
 
Fine.
 
@OmeidHerat my question is not about the include path it was about where to include library files (means which folder )and how to call then in controller.if u understood it better.. BTW ! i got the ans thanks for ur concern.
 
19 mins ago, by Sparkx
hey hi i am working on cakephp .just wanted to know I have 1 library file on my server but outside the cakephp folder and i want to include that one so how can i include that one.?
 
wat
 
12:03 PM
Remember, People don't understand what you meant all they know is what you said.
 
ya ya i gat u ... cool
 
@Sparkx can u pls use prpr english. abbr evth mks u lk dumb! thx (© Gordon 2012)
 
some new version of english
 
ya == ja == yes == da ?
 
12:09 PM
you forgot Jah un Jā (.. strangely, spelling pronouncation is the same)
 
yaa is like yeah
 
@Sparkx nope. still not correct. I suppose you want to say 'Yeah, Yeah I got you.'.
Yup, I dropped the cool cause it didn't make sense there.
 
this makes sense because u seem to be nervous at that point ..so cool give u some sort of relax mood ok .just forget it
 
nervous ? about what ?
 
please, stop trying to "sound cool" .. it's hurting people
 
12:13 PM
this ain't facebook chat...
 
(i wish i could do the Jon Stewart impression from his interview on Crossfire)
 
@OmeidHerat oh dear don't be surprise with that...
 
@Sparkx haha, now this shit is really obvious.
 
sum sirious shiat happenin daun here brah
 
12:15 PM
to forget lets accept this as shit from u
 
33 mins ago, by Sparkx
hey hi i am working on cakephp .just wanted to know I have 1 library file on my server but outside the cakephp folder and i want to include that one so how can i include that one.?
14 mins ago, by Sparkx
@OmeidHerat my question is not about the include path it was about where to include library files (means which folder )and how to call then in controller.if u understood it better.. BTW ! i got the ans thanks for ur concern.
OK, if this counts. I posted some shit.
 
@RepWhoringPeeHaa Christmas tree!
 
@rlemon i lovin't really u look cool in this chatting
 
12:18 PM
Flying V
Mighty Ducks FTW
@Sparkx it is my mission in life. on a separate but related note: that is not me in the picture
 
@rlemon i like it go for it.. yeah i know this..
 
I'm sorry I sometimes mistaken thick sarcasm with relative stupidity
 
@rlemon Nice one
 
although comparing that to my current picture I wish I was a nice half way between (tanned wise)
 
@rlemon O.o the second line for 'not sure if' doesn't works ?
or is it only me ?
 
@rlemon Have you strated some collection of these somewhere?
 
12:37 PM
Hi
I'm trying to use OSTicket to implement a ticketing system
But im not able to fetch the mails from an email account even after configuring the host,port,user name and password.
 
@techno Try with some other data you know it works.
 
@tereško Toseef has some reading to do.
 
This answer needs some upvotes: stackoverflow.com/a/8035992/367456 ;)
(some so it's after the accepted one, please don't spam)
 
done
my first upvote this week
 
12:52 PM
you need more hugs, love and kisses boy.
 
or i need to stop focusing on
 
yeah reading too many of those questions can make one depressive
 
@hakre I upvoted linked and accepted
 
@tereško I was actually thinking that myself. I see too many questions that just make me cringe
 
1:02 PM
@hakre okey :))
 
1:23 PM
hi
 
@CharlesSprayberry , what makes me cringe are people like this : stackoverflow.com/users/295264/starx?tab=answers
 
I am working on this simple poll w3schools.com/php/php_ajax_poll.asp and I have a problem. It works great but when i put it into a div, it doesn t work. Maybe it is because the page has to be refreshed automatically... How can I do this?
 
who are brute-forcing reputation system
@JavascriptGeek , well .. you tried to learn from w3schools - that was your first mistake
 
I heard it is a very good site
 
where ?
i honestly want to know , because in reality it is only rivaled by about.com in terms or "worst place to learn"
 
1:29 PM
@JavascriptGeek W3Schools is notoriously bad for misinformation. Your best bet is a well recommended book and the PHP (or whatever language/library) docs.
 
my teacher said that i should learn the basics from there
bracketworks do you mean php.net?
 
Talk to you later everyone.
 
@JavascriptGeek that might have been true 10 years ago .. only by virtue of w3schools being the only source of such materials
 
@JavascriptGeek Yes; I understand you're asking about AJAX so again, the API docs for whatever language/library. Consider using one of the many Javascript libraries to expedite development time on the client side.
 
thank you for the info... will check
 
1:34 PM
Many people shudder at jQuery, but $.get() is pretty straightforward as far as AJAX goes.
 
hey i am new to cakephp . can anybody tell me how to import core libraries in controllers function in cakephp .the location of file is lib\Cake\Utility\Xml
 
@Bracketworks , and you can write a function which does the same in about 10 minutes
 
hey guys can someone help me ???
 
@tereško Fair enough; I see no problem using well established js libs though, @added unless bloat and bad API are concerns
 
@Bracketworks , how about bloat and bad API
@BikasDas , no , someone left like 12 minutes ago
 
1:48 PM
@tereško Fair reasons not to.
 
hello all, i'm not someone.
 
@BikasDas "Don't ask whether someone is here or can help. Just tell us your problem. If anybody can and wants to help, they will."
 
i want to show some user information based on his name provided by me earlier. e.g. if i type www.mysite.com/bikas it should show the details of mine. but instead it throws me a 404 error page. so what I should do for that ??
 

« first day (593 days earlier)      last day (4346 days later) »