« first day (641 days earlier)      last day (4307 days later) » 

12:03 PM
Hi all!
do someone use phpunit with selenium in netbean IDE?
 
@ircmaxell I bought this book amazon.com/gp/product/… but they use phpunit with selenium
 
@ircmaxell Yea, looking through it there are a couple things in there that made me scratch my head.
 
Do i really need selenium with phpunit ?
 
12:13 PM
Like how PDO doesn't emulate features but prepared statements are emulated by default for MySQL.
 
what selenium is for?
 
@MikeBoutin You should be able to use PHPUnit without Selenium.
 
@CharlesSprayberry ok ty
@CharlesSprayberry But in the book they want it togheter
how it can improve my tests?
 
Morning all
 
they want them together because they cover almost all needs
 
12:15 PM
@MikeBoutin Selenium is about testing your website in a browser.
 
for functional/acceptance and unit testing
 
@MikeBoutin Selenium is mainy used to test your site trough a browser, it will emulate a user
 
ok, so with phpunit and selenium i'll be able to see the browser interact with my website?
 
phpunit - for unit tests
selenium - for acceptance tests
 
Someone here use both ?
 
12:16 PM
@MikeBoutin Yes
 
@FabioCosta with netbean IDE?
 
@MikeBoutin I use it for test the full functionality of the browser with YII
 
@FabioCosta YOU WORK WITH YII !!!!
 
@MikeBoutin No i run it trough command line,I don't like net beans
 
ok
i try to learn yii
but i'm stuck there
 
12:17 PM
@MikeBoutin Trying like right now?
 
i had installed phpunit
but when i do in cmd : pear install phpunit/PHPUnit_Selenium
 
@MikeBoutin Do you have skype? we can talk trough there
 
i'm at work now sorry
You're very kind!
 
Ok, i have a hell of a headache with phpunit and selenium
 
add me on gtalk?
 
12:19 PM
do you have phpUnit installed?
Ok
 
mikaelboutin.dw@gmail.com
yes my phpunit is installed
with pear
but i cant install selenium ext
i tried everything
manual
 
Couldn't either, downloaded the source and put it on extensions
 
with netbean
no, or i don't know how to use it
my test look like it run in cmd
but my browser doesn't interact
 
@MikeBoutin added you on GTalk
 
Ty very much!
Where are you? (in the world XD)
 
12:25 PM
Brasil
 
ok! We are maybe at the same time
i'm 8h25 am
 
I think we are seeing a live example how bad practices evolve
Some people write how to do it "the right way"...
... but doing it wrong
 
the nice thing about 'the right way' in comparison to blogs, tutorials, etc. is that you can submit pull requests
 
Morning chaps
 
12:41 PM
morning Mike
 
@MikeB morning
 
is this "php the right way", a joke?
 
@NikiC Actually.. I could see that as having some merit; not for htmlspecialchars, but as an output "operator", that triggers can be hooked into.
Yea yea.. DIY, but still, it'd be succinct.
I guess <?=__($allTehStuffs)?> is sufficient.
@ircmaxell I updated the covariance question with a wall of implementation details; tried to keep it brief.
 
12:58 PM
@NikiC this is why i do not pay attention to development of PHP
@webarto , no , IMHO it is another project to push FIG crap
 
lol
I'll look at it later
 
@ircmaxell Thanks :)
 
Hi all
 
@Bracketworks , i think that topic needs a "TL;DR" summary at the top
i read the title and it made me feel stupid
 
@tereško Yea, it has one in the middle now. I forgot to shift it up; thanks :)
 
1:06 PM
what's co-variance ?
 
@markus-tharkun eih... but who manages and curates the PR's...?
3
A: Parameter type covariance in specializations

ircmaxellTo properly answer this question, we must really take a step back and look at the problem you're trying to solve in a more general manner (and your question was already pretty general). The Real Problem The real problem is that you're trying to use inheritance to solve a problem of business log...

 
right now , i think main contributor is FuelPHP's author Phil-something
 
@NikiC wtf
 
@tereško Narrowing type requirements.
 
@ircmaxell , at first i would have to read the topic , and only then look at your answer
/me puts it into "read later" tab pile
 
1:08 PM
Oh great, PSR-0 wasn't ugly enough, now we have PSR-1 telling us to use camelCase and StudlyCaps. Fuck that shit. #php
@tereško
 
@ircmaxell agree that it is still a problem but at least it's not like you have to stand by and look at terrifying tutorials without the possibility to do anything
 
i have no problem with camelCase
 
@tereško I just copied and pasted the link from my profile. but that's the question
 
i already found the question =P
 
so, i guess phpquery lib is pretty popular?
 
1:09 PM
@webarto he's an idiot, what's your point...? There's actual research behind that camelCase is more readable than using underscores...
 
wtf is studlycaps?
 
@gorelative Otherwise known as PascalCase
 
he means PascalCase
 
@ircmaxell There is? Do you have links to this?
 
ah where the first letter of every word is cap'd
 
SomeMagicClassName
 
so, back to my previous statement. is PHPQuery really that popular? Seeing it more and more on SO
 
I'm off, later
 
So i have to interview a php/front-end dev today.. never interviewed anyone for a dev position, not sure why im doing it as we have an HR dept.. but any hoot, any tips on some things i should ask the guy?
 
@gorelative What level? junior?
 
1:15 PM
probably just below it
hes used cakephp and codeigniter
seems to grasp the concepts of OOP
 
@gorelative "Please list all PHP string functions in alphabetical order, including full parameter lists" :P
 
@NikiC Oh, the brutality.
 
How many ways can you add something to an existing array?
 
@MikeB 42.
 
How would you float: center/middle
i.e. If you wanted to float an image in the middle of an article so the text floated around it
 
1:17 PM
well .. there are few classics you can go with:

- how would you prevent SQL injection,
- what alternatives for captcha you can think of ,
- how would you select random row from table,
- have you tried new features from php 5.4 and what do you think about new 5.3+ stuff
 
questions like those seem to get the best response.. gets them thinking outloud
 
@tereško What's your answer to the third?
 
@tereško Not sure I like questions two and three
 
@tereško those were some on the list
 
@gorelative When I interviewed for my position, just a couple months ago, they asked me some basic PHP questions to make sure I understood conditional statements, looping, difference in passing by references and by value, how to do basic HTML styling (like positioning elements), some questions about web security, database design and some brain teaser type quizzes so they could see my problem solving process.
 
1:18 PM
word
 
@NikiC , second is to see if he can creatively approach an issue
 
hes mostly doing end client support stuff, "hey fix this image" or "hey change the name of this URL" and i wrote the code in the site and i left good documentation in all of the classes
 
3rd is to test understanding of SQL
 
so he shouldn't have an issue
 
oh ..
 
1:20 PM
on the other hand, you never know.. this being a company who has absolutelly no unit testing in place, no Version control systems or anything like that..
 
@tereško I just thought that you are the kind of person who would tell you "WRONG!" if you answered ORDER BY RAND() LIMIT 1 ^^
 
my boss will probably ask him to roll out a new feature by himself.
 
@ircmaxell couldn't find group on google because it was deleted, basically, they've told him you are welcome to join (to be a member), but we will outvote you in whatever you suggest...
 
@NikiC , it is not always the wrong answer , but in most case it is
 
@NikiC That's why I asked what his answer was ;)
 
1:21 PM
also , i would not say "wrong"
 
@tereško I'm not so sure about that :D
 
i would a°sk some follow-up questions , and give enough rope to hang himself
 
Oh yeah, enough rope to hang himself. That sounds more like it ^^
 
How do you guys handle 'wrong' answers in an interview? Do you tell them they were wrong and explain why? Or just nod your ahead giving no indication they said something stupid
 
Considering "pick a random state from a table of US states", ORDER BY RAND() is sufficient. Considering "pick a random user from a table of 8+ mil users", not the correct answer.
 
1:22 PM
no , i would just ask to explain his/her line of reasoning
 
sometimes you can be wrong, but only because you lack experience nad you based you answer on the best that you could come up with
 
stackoverflow.com/questions/11542321/… Hey, imma ramble on about how awesome things are locally, but my real problem is that I get "an error". *sigh*
 
it is better to get a wrong answer from someone who is a relative newbie , bur could explain why he/she thinks it's correct or correct-ish
then have a "professional" providing a correct but unusable answer
 
@tereško Never thought I would hear you say that. Surprising that you recognize that at all with how often you yell WRONG around here XD.
 
1:26 PM
@deceze if he is using MSSQL and GoDaddy with PHP, is there something wrong with him?
 
okay cool
 
@Event_Horizon , that's because i am not here to look for employees
 
@tereško I thought it was because this was the Indian SO
 
i was going through his code on GitHub, its decent.. looks like he documents things properly. and by properly i mean, valid constructive comments.
 
care to share the link , or is it confidential ?
 
seemsl ike he understands the difference of private, public, protected..
 
github accounts are usually a good sign
 
theyre all private repos he added me to
 
oh
 
guy knows python too i guess from what ive seen which is out of the scope of the job but cool enough.
 
1:28 PM
@webarto Seems to have a masochistic streak at the very least.
 
@webarto Hopefully this is part of a platform transition, and not a final product.
 
the project's written in codeigniter which he says he has no direct experience, but if hes familiar with cakephp im sure he can pickup on CI real quick as its not that complex ;)
Plans to switch to kohana, bootstrap and a few other goodies here in the next major version release, until then I can't do all the dev work anymore as we're too busy.
 
i take it , that with "major" you mean the next 3.x release
 
yes
<-- the only one out of 2 other devs that uses VC at my office.
and since he'll technically be working along with me on the project.. i pretty much demanded the hire have VC experience.
 
@gorelative It's depressing really how many don't... :-/
 
1:32 PM
Thanks for the suggestions about questions, i was thinking about giving him some problems to solve.. stuff thats applicable. both client-side stuff and php stuff
 
you can learn working with git in a week , that is not an issue
 
@gorelative I can't imagine working on any software project without version control. The entire idea sends shivers down my spine.
 
@tereško nope but the problem is having management that enforces it. I told my boss i want free run over this hiring if im going to be giving insight and interviewing.. and he did it.
@CharlesSprayberry Much worse, is the other dev's are doing code editing via FTP on the production sites for clients.. "Make a change, save, upload file, F5, looks like crap, rinse, repeat"
 
@gorelative Oh man, please no more. You're making me nauseous.
 
=P, yeah i threw up in my mouth when i started here. First thing i told the boss, i refuse to work with those two on a project until they learn some sort of VC. Haven't worked with them yet.
 
1:35 PM
http://switchb.org/kpreid/2012/door/
 
I would rather use JS than all the vendor prefixes and fixes :P
 
posted on July 18, 2012 by Anthony Ferrara

I was asked an interesting question via email yesterday. The question is fairly simple. The answer, not so much... So, rather than reply in an email, I figured that I'd write a post about it instead. The question, simply stated, is: When comparing a float to an integer using ==, where does the conversion happen?So, let's begin... Read more »

 
@gorelative that's pretty sexy
 
all css, drooling over it
 
1:48 PM
yeah thats pretty nice, I dig it
 
i have the perfect spot for something like that in a mobile web app
 
does anyone know of a program that allows for folder management, like, you can stick labels on folders that everyone using the program can see and admins can only delete folders etc?
 
Good morning
 
been looking for some folder management scheme for work
morning
 
Sup irc
@event elfinder maybe?
i think thats a full js/jquery implementation though.. never used it personally.
 
1:53 PM
@gorelative hmm
 
i know elfinder plays nicely with CodeIgniter, which is why i began looking into using it. I ended up rolling my own system though.
 
Yeah I'm basically looking for anything that can do labels, its just for the internal server to sort images.
 
why would you roll web based for something like that? Seems slugish
 
lol .. codeigniter
 
@tereško not a word needs to be said.
 
2:00 PM
@gorelative I'm not
I was just asking if anyone knew of any good progs for file management/labeling/monitoring needs to know when files are added/removed and keep track of labels at the least
I've searched around but haven't found much on it
 
@Feeds The person why asked that wasn't Sharon Levy by chance?
 
Yes, it was :-P
I wonder how you guessed that...
 
can you forward the mail? I'd be interested to see it :D
 
why?
 
Just interesting ;)
 
2:10 PM
who is she?
 
Oh, he's a she?
I'm really bad at guessing gender from name :/
 
she a he?
Anyway, how do you know this person?
 
of undetermined gender
 
@ircmaxell He/she/it asked me a few questions before ;) And also asked about that comparison thingy today/yesterday ;)
 
Ah, then the email is prob the same
 
2:15 PM
@ircmaxell that's why I wanted you to forward ;)
 
again, why?
 
to see if it is the same...
 
It prob is
 
Anyone use SO chat for their team?
 
huh?
 
2:23 PM
jabber and stuff like that?
or just make your own with node.js, net is full of those tutorials :P
 
poorly worded.. Has anyone ever created a room on StackExchange Chat for use by their own company?
I imagine privacy would be a concern
 
can rooms be private?
 
@MikeB I would imagine a lot of companies might not like that. You're exposing business information to a third party.
@webarto The information about your business is still shared with Stack Exchange.
 
@NikiC looks like im not the only one that has issues with guessing gender.
 
@CharlesSprayberry I sometimes don't trust my hosting company :)
 
2:25 PM
@MikeB I've done it in the past for things that aren't considered "private"
i wasnt aware there was a driver for PHP -> ms access
mind blown
 
Is there any way to stop execution of PHP code without stopping the request?
I mean I need all the html printed
@gorelative die/exit stop the request
 
but keep the html
in other words skip over the php.
 
@gorelative yep
 
I don't follow...
 
he means cancel parsing/execution of php
but continue with the flow of the file
in other words, if you had a php file with a full buttload of html from the <html> tag on down, he wants it to skip all the php
 
2:32 PM
@gorelative e.g. my DB connection fails, I want a fancy error, stop further PHP execution
 
why dont you just display the "fancy error", and then exit
 
exceptions?
 
or an exception
 
I think he means when "or die('cannot connect');" is encountered... he wants to make it pretty...
hint: don't die/exit
 
@gorelative Fancy error and exit means that footer is dropped
 
2:34 PM
run exit after the footer then :)??
@webarto this. just make your "fancy error" before exit/die.
 
he inlcludes header/index/footer ... and DB connection in header fails...
 
@gorelative and even after html tag? lol
 
don't die, but redirect to lets say, error.php
 
thats what id suggest
 
@hookman ... or die(functionThatOutputsACompleteErrorPage());
 
2:35 PM
^--- oo
 
...butPrettyPage()
 
or just redirect them to 404, and log all errors
lol
 
functionThatOutputsACompleteButPrettyErrorPage()
 
Noone's suggested goto? hides
 
@webarto does Exception stop fuether PHP execution ?
 
2:36 PM
 
not sure if anyone else has seen this but -> net.tutsplus.com/tutorials/php/…
 
$up = new Exception(); throw $up;
 
DB connection fails = 404 ? loal
 
it should go to say, theres a proper use for exceptions. Which is probably why @ircmaxell sighed =P
@hookman hence the "lol"
a post on SO about exceptions, another interesting read..
21
Q: In PHP5, should I use Exceptions or trigger_error/set_error_handler?

J-sunWhat are the pros/cons of doing either way. Is there One Right Way(tm) ?

 
Anybody using Chocolat?
 
2:40 PM
do not trust tutorials from nettuts+... @gorelative
 
@gorelative , I've never seen an explanation of exceptions get it that wrong...
 
I'm too poor to buy Mac @deceze
 
@webarto That is why i posted the article and said "not sure if anyone else has seen this" I skimmed the article .
@ircmaxell hahahaha, maybe someone should tell them that its wrong..
shame because i've usually felt their info is pretty accurate.
 
@gorelative Definitely could use more irrelevant pictures.
 
@webarto exception doesn't stop PHP code execution
@gorelative ty
 
2:43 PM
@hookman Uhm... they do if not caught.
 
private static function _validateUserId($user_id)
{
   if( !is_numeric($user_id) && $user_id != 'error' ) {
      throw new Exception('Whoa! I think there\'s something wrong with the user id');
   }
   return $user_id;
}
 
shouldn't they use try() or something other than an if()
 
@hookman
@gorelative you use try() when you use method from class, or when you try to instance class... like the word says, try... exception is thrown inside class...
 
@gorelative Shouldn't that be || $user_id == 'error'?
 
2:45 PM
@gorelative uncaught exception causes error, doesn't it?
 
@deceze its copy/pasted from that tutorial, just trying to grasp the proper use of exceptions.
 
@gorelative OUCH!
 
@webarto ah thanks
i think ircmaxell is sitting at his desk feverishly writing a blog article about exceptions =P
god CI really sucks =O the more i read things lol
 
class Example
{
    public function __construct()
    {
        throw new Exception("Imma throw some 'ceptions");
    }
}

try
{
    new Example();
}
catch(Exception $e)
{
    echo $e->getMessage();
}
@gorelative you get it?
 
2:51 PM
Don't you normally build try/catch inside the method if you are going to throw exceptions?
 
thats what i always thought
 
don't know what is normal, sorry ... on the other hand joelonsoftware.com/items/2003/10/13.html
 
@Event_Horizon ‽
 
@Event_Horizon I've read (somewhere) an opinion that, you shouldn't handle your exceptions; they should be documented for user-land handling. If you expect an exception from a call you've made (to a library for instance), you may augment or wrap it in your own exception, which you allow to propagate for user-land handling.
 
2:55 PM
@MikeB that guy is from my country, every-f*-body is trying to make groupon although even the best one has 5 offers...
 
class Example
{
public function __construct()
{
try
{
throw new Exception("Throw me now dammit!");
}
catch(Exception $e)
{
echo $e->getMessage();
}
}
}
 
@webarto I thought Groupon was a failed business model? Wasn't there a big scandal recently?
 
@Bracketworks hmm, do you have any idea what the article was called?
 
@MikeB I don't read the news :P but in a country where standard is low, and 1% is computer literate, it is fail...
 
@Event_Horizon Nah; but it's an adage I stand by; from having reviewed other libraries, I don't think I'm the only one.
 
2:58 PM
@Bracketworks It is generally a good idea to catch it at a higher level
 
I have never seen this before... catching exceptions while you are throwing them...
 
0
Q: Why does "print" prints from right to left?

qxxxCan anyone please explain me how this works: <?php print 5 . print 6 . print 7; ?> it prints: 76151 I know the "1" is the return value from the print function but why are the functions called in reverse order?

 
@PeeHaa Right, I mean; if you're writing core level tier code, you'd want user-land applications written around it to handle exceptions you throw; handling them yourself prevents extensibility.
 
@webarto just an example
 

« first day (641 days earlier)      last day (4307 days later) »