« first day (431 days earlier)      last day (4522 days later) » 

1:06 PM
hmm .. it's the damnest thing to try writing unittest for an autoloader which i would need to include the classes under test
i get that nagging feeling that i am doing it wrong
it is quite familiar feeling , i must say
 
1:21 PM
back
 
@tereško Imho: Just don't. You "Integration test" your autoloader with every single unit test in your application.
Or if you have complicated autoloading just integration test the autoloader its self with a different set of files / classes and see if it work for those
 
integration test?
 
Integration testing (sometimes called Integration and Testing, abbreviated "I&T") is the phase in software testing in which individual software modules are combined and tested as a group. It occurs after unit testing and before validation testing. Integration testing takes as its input modules that have been unit tested, groups them in larger aggregates, applies tests defined in an integration test plan to those aggregates, and delivers as its output the integrated system ready for system testing. Purpose The purpose of integration testing is to verify functional, performance, and reliab...
"Testing if a bunch of classes works properly together"
 
ah, okay
 
@edorian , i have a bit complicated autoloader as it is supposed to work with both namespaceMap (many-to-many relation between namespaces and paths) and classMap instances
 
1:25 PM
I think most of what I do as unit tests is really integration testing
 
If you have very solid unit tests for the whole application and some small tests that put all the pieces together (good path) then you can be very sure everything works. Because the pieces work and you apparently assemble them correctly
 
Hi does anyone know how to to check for errors in PDO, i have a select statement thats not returning any values
 
set the error mode to exception
 
@tereško No. PDO should yell at him in case of an error, not the other way around.
 
1:33 PM
really ?
 
@NikiC , how about when you try to insert unique value twice ?
 
@StephenWolfe So basically, do a $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); call just after you create the $db instance ;)
 
I am only trying to do a select first
 
@tereško then PDO should throw an exception and he should catch and handle it ;)
 
1:35 PM
actually it doesnt even matter
it's just implementation details
 
@tereško lol, for somebody who normally tells everybody to only use the very best way (with your own definition of best) you are currently sounding somewhat ridiculous. You are basically suggesting him to use @ and error_get_last [only with PDO terms] ;)
 
no , i am just tired of this all
you want to write crap in your code , sure , be my guest
this guy isn't even able to google first
 
		$sth = $this->db->prepare("SELECT id FROM users WHERE
				login = :login AND password = MD5(:password)");
		$sth->execute(array(
			':login' => $_POST['login'],
			':password' => $_POST['password']
		));

		$data = $sth->fetchAll();
this is my code thats not working, i dont have errors turned on, but i should thorw an error anyway right?
 
@NikiC Was is mistakenly pinging me? :P
 
1:41 PM
no
pdo does not throw errors by default!
You must do $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); for it to throw errors
 
well if i type that statement wrong it tells me
 
@edorian Nah, I wanted to complain about @tereško but then decided not to :)
 
In my current project, I frequently have to have a visual element on the page which is a colored box with a 1px padding and a border
a single span with some css isn't able to produce such a thing
 
@NikiC , i never said that your suggested way is not much better one .. it just adds one more thing to explain
 
and I need at least two spans inside each other; the inner one being the coloured box
and the outer one being the border with some padding
 
1:43 PM
brb,
 
do you have any idea of some better css to produce this (with one element)?
 
@tereško Then I just misunderstood you, sorry :)
 
@ChristianSciberras , there is this magical thing , know as "margin" .. its the "padding outside the border"
 
exactly
I need padding inside the border, @tereško :)
 
php -r '$x = new PDO("sqlite:memory:"); echo $x->getAttribute(PDO::ATTR_ERRMODE); var_dump(PDO::ERRMODE_SILENT); '
0int(0)
 
1:45 PM
a 1px spacing between border and box
as you might have guessed the box uses background to get the colour
the only way to fix this is using a margin and outline instead of a border
 
I didn't even know you had to tell PDO to act sane. Good to know should I ever need to interact with it directly.. hope that doesn't happen to soon
@NikiC :) I do that all time
 
@edorian :)
 
@edorian .. yeah , imagine the horrible day when you need to use a real database instead of mysql
 
@tereško Been there, done that, still didn't like dealing with PDO
 
i think PDO is the best example of php's BDD methodology ( where B stands for "bureaucracy" )
 
1:51 PM
so many matching words starting off with B. Broken, BS, Benevolent. BDD is such a useful TLA
 
@tereško hey, earlier today you said that mysql_query sort of commands are deprecated. what is the currently used norm then?
 
MySQLi or PDO, choose one and if you learn it , then you will be able to use other too
 
@edorian TLA?
 
@NikiC three letter acronym
 
ok so googling for MySQLi
 
1:55 PM
what do you think, is this memory corruption? codepad.viper-7.com/K90n7P it looks quite bad at least
 
btw what is PDO? the full form!
 
PHP Data Objects or something like that
 
@NikiC , you mean the "epsilon" ?
 
whats this mean? ( ! ) Warning: PDO::prepare() [pdo.prepare]: SQLSTATE[00000]: No error: PDO constructor was not called in C:\wamp\www\mvc\models\login_model.php on line 19
 
@StephenWolfe Did you extend PDO, by chance?
@tereško What epsilon?
 
1:57 PM
ok i got my answer..dont reply to the PDO one
 
array(3) {
  [0]=>
  string(7) "epsilon"
  [1]=>
  int(1)
  [2]=>
  int(47316044817416)
}
this epsilon
 
ahh just relised
 
stripped down version: codepad.viper-7.com/ZYNrNd
Yeah, pretty much that
The $flatArray contains quite random elements
 
right i have added the error catching,
still no erros
 
That's why I would guess memory corruption
 
1:58 PM
my array is returning empty
 
looks like it .. smells like overflow
 
@StephenWolfe Maybe there just are no elements in the result set? :P
@tereško will look into it
 
ok, done in a few seconds so don't bash the coding...
 
@StephenWolfe , is username unique column in your table ?
 
there is only one row in my table
 
2:00 PM
well .. i assume it is .. so why the hell are you selecting by both username AND password
 
im not am i?
 
additionally , stop using MD5 for hashing password
 
it was to test
I dont use that
it was an tutorial i was following to learn PDO
 
@NikiC Three Letter Acronym
 
ahh it works if i remove the where clause
 
2:12 PM
@NikiC Hehe. Thats funny
 
cant understand why it wont work with my WHERE clause
 
codepad.viper-7.com/T6HBFf works with the notice
It pretty much looks like pointer values, yeah
 
@StephenWolfe because there is no row that fits your conditions
 
@edorian Yeah, I know that ;) It's simply about the pretty random data in there, which seems strange
I'll ping someone on .pecl
 
Your reommendation for a php framework?
recommendation*
 
@Spec : DIY
alternatively : Symfony 2.x or Kohana 3.x
neither of which have made into @Donut 's list
 
@Spec It heavily depends on your use case
 
oh .. and with DIY i meant "do it yourself" and not an abomination trying to pass it as a name for framework
 
@tereško @edorian codepad.viper-7.com/MREKa3 crashes the process
 
Good Morning
 
2:26 PM
@ircmaxell morning
 
hiho
 
@ircmaxell Afternoon
 
@Donut , please never again recommend that page to anyone else
 
how goes it?
 
@tereško Okay. Now I am looking around it and it old.
 
2:29 PM
and who is adding crap to favorites ??!
please stop that .. that includes two of my commend too , there was nothing to fav in them
 
@tereško you mean the web page or smthing else?
 
Yeah, unstar that link please.
 
OK then, I'll unfavorite them now.
 
Thanks.
 
Do you have some php apps you've done that you are especially proud of?
 
2:31 PM
no , not really
 
but whyyy....
isn't it useful to complete some php app and sell it?
I mean sell license for it
 
because in three month all the code gets old , because developers tend to learn
and if you want to sell your php app , you should sell it as service , not as product
 
no no, you don't write for devs but for customers that don't know php
saas is an option too
 
@Spec well .. in that case you sell it an pray that you never need to look at that code again
code really does not age well
 
can anyone see why this is not working, pastie.org/3052389
 
2:34 PM
of corse not, the code should be improved constantly, and in the meantime, you'll gain some financial resources
 
im starting to hate PDO, :( it looked really nice when i first read about it
 
@StephenWolfe I saw the code but I'm not experienced with PDO
 
define "does not work"
 
@StephenWolfe It is nice :)
 
oh .. and what exactly does $dbh->setAttribute(PDO::ATTR_CASE, PDO::CASE_LOWER); ?
 
2:36 PM
@StephenWolfe welcome to the club
 
@ircmaxell , you hate it because you know how it works under the hood
he hates it because he is a noob who has to learn something new
 
@tereško yes, do you get some error messages? if not, enable error msgs in php
 
theres no errors,
 
fair
 
2:37 PM
it just wont fetch data,
 
@StephenWolfe , do you know what $dbh->setAttribute(PDO::ATTR_CASE, PDO::CASE_LOWER); does ?
.. because i sure have never used it
 
maybe it's obvious, but first you need to look at PDO docs
 
@StephenWolfe do you get array(0) {} as dump?
 
yes
empty array
 
This means that there were no results
 
2:39 PM
but its not empty when i take out the WHERe
 
The query was right, but no entries matched it
 
the $pass array might be wrong. it's not closed as far as I can see
 
try selecting by ID
 
that means that no user exists with that login ;)
 
ah that worked
 
2:40 PM
i suspect there are some whitespaces in the entries
@StephenWolfe "foo " !== "foo" in sql
which would leave us with conclusion that you hate PDO because you cannot type
 
heh, .pecl is ignoring me again :(
 
kik
lol
where will my white spaces be?
in the database?
 
in the entries
you are selecting by username , but the usernames do not match
 
no white space there,
 
@NikiC Well I'd say it's definitly a bug no matter what. (Especially since it works with call time pass by ref)
 
2:42 PM
you sure ?
 
just chekced it
 
So it has to go in the bugtracker anyways hasn't it?
 
@edorian It's expected to not work (for me). Just like with call_user_func. But the results it gives are unexpected ;)
 
@StephenWolfe , select the username from table by ID, and then compare it to $_POST
 
@tereško if i select it by id then dump the array will i find if theres any miss matches?
 
2:45 PM
@NikiC But call user func does allow call time passing iirc?
 php -d display_errors=1 -d error_reporting=-1 -r 'function a(&$b) { var_dump($b); $b = 1; } $b = 0; call_user_func("a", &$b); var_dump($b);'
int(0)
int(1)
 
@edorian Yes. Just like array_walk_recursive does too ^^
 
array_walk_recursive issues a notice though
 
@StephenWolfe no , compare them in code
 
@edorian call_user_func does too
call time pass by ref is deprecated so it will always generate an E_STRICT
 
php -d display_errors=1 -d display_startup_errors=1 -d error_reporting=-1 -r 'function a(&$b) { var_dump($b); $b = 1; } $b = 0; call_user_func("a", &$b); var_dump($b);'
int(0)
int(1)
on 5.3 and 5.4 I don't get one headscratch
 
2:48 PM
it mustn't work on 5.4. It was removed there ...
 
Right... wrong binary -_-
 
:D
 
btw , do other peopel too spell FAQ as /fʌk juː/ ?
 
lol
i think i was spell my inputs wrong the whole time
<------ DIV
 
@tereško I do, but /fʌ kjuː/
 
2:52 PM
@tereško :D
 
@ EVERYONE, sorry
 
12 mins ago, by tereško
which would leave us with conclusion that you hate PDO because you cannot type
@StephenWolfe looks like i was right after all
 
lol i am dyslexic
 
dyslexic? óÒ
 
its wiki-time for @NikiC
 
2:56 PM
word
 
but why wiki yourself if others can do it for you :P
Dyslexia is a very broad term defining a learning disability that impairs a person's fluency or comprehension accuracy in being able to read, and which can manifest itself as a difficulty with phonological awareness, phonological decoding, orthographic coding, auditory short-term memory, or rapid naming. Dyslexia is separate and distinct from reading difficulties resulting from other causes, such as a non-neurological deficiency with vision or hearing, or from poor or inadequate reading instruction. It is believed that dyslexia can affect between 5 to 10 percent of a given population alt...
 
lol thanks
 
Bad link parser! Bad!
 
.. and it's urban dictionary for @edorian
 
3:00 PM
@tereško If you haven't noticed yet: I'm making a bad pun everytime he says "word" for some weeks now
 
they were supposed to be puns ?
 
pat pat
 
i think we have discovered a new type of "bad"
 
@ircmaxell Whats up? :)
 
just posted a decent comment to a slashdot article
 
3:05 PM
From past experience people commenting on reddit and /. don't seem to overlap all that much. Heh
 
yeah
I read /., but usually don't comment anymore (not for years), but I couldn't help this one
 
heh, the woes of antitrust laws, again :(
 
@ircmaxell , i would love to see how many of said senators are pushing the Protect IP act
 
me too
 
sorry for ping .. there was a typo
 
3:10 PM
np
 
Uh.. zend_mm_heap_corrupt with 5.3.8... It's been quite some time since I've seen one on 5.3.
 
@edorian how did you get that (and what is it?)
 
what a surprised , @ircmaxell : Patrick Leahy is at the top of both ProtectIP and the FTC letter
 
var_dumping a massive object tree and it's php not managing to allocate enough memory error and then failing to display the proper error message because it already confused its self
 
Ahh, interesting
@edorian LOL
 
3:19 PM
Using 5.2 we ran into those quite a lot. I've treaded it as a very unfriendly way of saying "You are doing to complex stuff! Stop that!"
 
@edorian óÒ
 
hell .. all the names that are in the Protect IP paper are in that letter
 
The really annoying thing is that xdebug.var_display_max_depth=1 isn't working because the process crashes before xdebug can filter the dump
 
it filters it afterwards?
weird
 
does anyone here bother writing tutorials?
 
3:23 PM
I don't think so
 
Not usually
 
@ircmaxell I wouldn't bet anything on it but thats the last thing i remember
 
Fair
 
> Fatal error: Nesting level too deep - recursive dependency?
 
@StephenWolfe Are you looking for anything specific?
 
3:25 PM
There we go. var_dump didn't pick that up but var_export did
 
no i have found some really useful ones by jream no youtube,
just wondered if its a common thing to write them.
 
ehh .. USA is becoming a scary place
goes to read more phpunit docs
 
It's funny to hear people saying "Google is an ad company!" as if it would be any sort of revelation to the world
 
@tereško hey i starting reading that book mythical man-month, and i am a 1/4 in, its very much like brooks isnt it
 
3:35 PM
isn't what ?
 
like brooks theory
 
Someone tell me there's a better way of determining the domain part of an email address than list($user, $domain) = explode('@', $string);
 
3:56 PM
@StephenWolfe , what are you trying to say
please use words with more then one syllable
 
@tereško the-o-ry :) That's a whole 3!
 
"The mythical man-month is like "brooks theory" - isn't it"
 
yeah .. i'm confused too
 
I don't see why. I'm not sure I agree though.. it may have some similar points
But while MMM is a CS classic it doesn't quite work with the current management trends
 
4:15 PM
im trying to log into postgress. ANyone ever see this issue:
su: unknown login: postgres
did the installation fail or something?
it seemed to go smooth
 
@ircmaxell nice answer
 
thanks
(php.net internals list, right?)
 
@ircmaxell sure
 
4:37 PM
can anyone tell me why the following algorith does not print 1:

class A{
var $state;
function setSwitch($a,$b){
$state=$this->state;
$state[$a-1]=$b;
}

function getSwitch($c){
$state=$this->state;
return $state[$c-1];
}
}
$class=new A();
$class->state=array(0,0,0);
$class->setSwitch(2,1);
echo $class->getSwitch(2);
 
1 message moved from Haskell
 
@user994144 Simple, you're doing a copy of $this->state in setSwitch, and writing to the copy. If you changed it to $this->state[$a - 1] = $b it would work: codepad.viper-7.com/xcrNoM
Thanks @RMartinhoFernandes
 
4:54 PM
stupid question: while installing symfony2 something called "secret" is generated. Can anyone explain me what it is used for?
 
@McOffsky salts, session names, etc
basically just to add a bit of distinction between multiple installs
grep the codebase to see more
 
ok, session content too?
i will search, thanks ;)
 
IIRC
perhaps not
 
"secret¶
type: string required
This is a string that should be unique to your application. In practice, it's used for generating the CSRF tokens, but it could be used in any other context where having a unique string is useful. It becomes the service container parameter named kernel.secret." form docs. how i havent found it before i dont know
 
github.com/symfony/symfony/blob/master/src/Symfony/Component/… <-- It's not random. Therefore, it's easily guessable if the secret is ever exposed
that's not good
@NikiC I wonder how long it will take him to reply
 
5:05 PM
@ircmaxell Why do you?
 
I don't know, just have a feeling
 
:D
 
5:19 PM
Hello, everyone
 
@LeviMorrison Hello
 
@LeviMorrison hello
 
hi levi
 
@LeviMorrison Hi
 
5:23 PM
I'm involved in several projects. It's nice, but it's hard to work on them all when I'm excited about them all :)
 
@LeviMorrison Was that in response to something or just a random comment?
 
@NikiC Random.
I'm deciding which project to work on :)
 
@LeviMorrison mt_
 
@ircmaxell Yesterday I dropped in the symfony irc with a phpunit issue and 3 people jumped to help me get that sorted out very quickly and friendly. I was quite amazed :)
 
@NikiC Nice. It was so subtle I didn't catch it the first time :)
 
5:28 PM
@edorian Really? Wow, perhaps I'll raise that CSRF issue there
 
@edorian stof?
 
@NikiC looking in the history Stof, Lukas and two other guys
 
@ircmaxell waiting for your answer :P
 
 
2 hours later…
7:14 PM
was in a meetiong
 
7:24 PM
Hrmm...a "tip" for cleaner PHP code....never delete anything just comment out the no longer needed code
 
@CharlesSprayberry ^ I do that :\
 
 
@Donut Ok barney
 
@CharlesSprayberry and use a vcs?
 
@ircmaxell ?
 
7:26 PM
@ircmaxell seems like half your work is meetings :P
 
@NikiC No, the tip only involved commenting out the code. You'd think the tip would be to use a vcs...but alas
 
@NikiC About that
I write relatively little code anymore...
 
@ircmaxell Pff, manager :P
 
well, I design how code should work
so I'm not really a full manager, but more of an Architect (which is indeed my job title)
so I do a lot of Meta-Programming
 
@ircmaxell The time will come ;)
 
7:31 PM
it's coming faster than I think it will...
 
... and in three years you're CTO at Google :P
 
@NikiC I'd take that job in a heart beat... Even though I'd never get it :-D
 
@ircmaxell Never say never :)
 
True, but not at Google.... There are so many more people out there better suited, that I'd never get the job...
 
...
 
7:35 PM
response sent
 
@ircmaxell nothing goes over an optimistic worldview :P
 
@NikiC Well, I try to be humble. I need to attempt to keep my ego in check some how. I want to be confident without being arrogant. I know that I do cross that line sometimes, but I'm really trying to not and to remain humble. And one way is to believe that there are lots out there that are better than me (because frankly if there are not, that's quite sad)...
 
@ircmaxell you got a point. still it's good to aim high ;)
 
Looks awesome.
 
7:48 PM
@ircmaxell I love this idea
 
@Donut It will make no new compile time errors
 
Yeah, I must re think.
Sorry, my bad.
 
@ircmaxell Yeah, already seen it. Not yet sure how good it is
 
it's interesting in the least
 
it is
php extensions are an adventure
dangling self from one compile error to the next (but it does work sometimes in between)
 
7:57 PM
sometimes being the key word
 
for example right now it works :D printing an array of strings
 

« first day (431 days earlier)      last day (4522 days later) »