« first day (155 days earlier)      last day (4797 days later) » 
00:00 - 21:0021:00 - 00:00

9:01 PM
I'm scheduled for the ZCE exam on Tuesday...
 
cool. good luck :)
i have eight mock exams left for it
 
user1385191
I have another quick question for anyone who's up for it.
 
Nice
 
i wanted to gift them away, but phparch told me I may not do that
due to licensing
 
That sucks
 
9:03 PM
yeah, annoying as hell
i even told them that i wanted to give them away in a raffle
and not resell them
but no, may not do that.. although zend told me i may do so
 
hrm, is it a package? Can I buy singles?
 
i bought the exam boundle that included ten
but i think you can buy single
or at least you could
not sure if its still possible
 
hrm, looking
 
dont see any
 
neither do I
 
9:07 PM
well, they are for the 5 exam
 
404
 
especially the one by lornajane
 
Cool
 
also linked here
4
A: Zend Certification Study Material

GordonAfaik, the ZCE PHP5 certification is no longer offered. You can only do the ZCE 5.3 exam since Jan, 1st. However, most of the material for the 5 exam is fine for the 5.3 exam as well. Zend used to offer (still offers?) a certification bundle that includes a Study Guide and Mock exams. There is al...

 
Yeah, read that one
The DateTime and PDO are the only 2 packages I'm really not comfortable with
 
9:16 PM
i remember only one question about datetime, but since the questions are randomized that doesnt say much
 
yeah
 
@Matt see channel topic ;)
 
I know the principles behind PDO, but I still prefer MySQLi
 
user1385191
sorry, it's too trivial for SO and everything I've tried doesn't work.
 
Then ask away
 
user1385191
9:18 PM
"href":"http:\/\/www.nhl.com\/ice\/recap.htm?id=2010021070"
 
user1385191
I need to ditch the backslashes, and stripslashes + str_replace aren't working
 
room topic changed to PHP: Discussion for all things PHP - Don't ask whether someone is here or can help. Just ask us. If anybody can and wants to help, they will. But no can know before you actually asked your question.
 
stripslashes isn't working?
 
user1385191
yep
 
do a var_dump($var) on the data variable
 
user1385191
9:20 PM
here's one of them without the stripslashes
 
user1385191
string(48) "http://www.nhl.com/ice/preview.htm?id=2010021081"
 
@ircmaxell are you firm on references? there was lots of questions about references in my exam
 
I don't see slashes in that string
 
user1385191
could it be json_encode?
 
user1385191
because \/ would be an escaped "/" in js
 
9:21 PM
7
A: In PHP can someone explain cloning vs pointer reference?

ircmaxellBasically, there are two ways variables work in PHP... For everything except objects: Assignment is by value (meaning a copy occurs if you do $a = $b. Reference can be achieved by doing $a = &$b (Note the reference operator operates upon the variable, not the assignment operator, since you...

@MattMcDonald Quite possible
 
There will also be questions like this:
function foo($a, $b) {
    $b = pow($a, $b);
    $c = $b / 2;
    return $a;
}

foo(10, 2);
 
lord
 
what is the outcome of $a
 
Error, can't assign reference
 
and then 4 options
oh jeez.
my fault
 
9:24 PM
lol
 
fixed
 
oh ok
it returns 10
 
yeah
completely pointless question
and there are a number of those in there
 
Yeah, I saw that in the reference
2 hours ago, by ircmaxell
What is wrong with this XML document?

<?xml version="1.0" encoding="UTF-8" ?>
<node>
    <?var type="string" ?>
    <leaf>Value</leaf>
</node>
<?xml version="1.0" encoding="UTF-8" ?>
<node>
    <?var type="string" ?>
    <leaf>Value</leaf>
</node>
The answer it said is D: nothing. I stand behind there is something wrong with that document
 
oh my
I'd say everything
 
9:26 PM
No, there's only 1 thing wrong
Well, 2
 
the second prolog
 
1. No true root element
2. A second `<?xml` declaration
<?xml version="1.0" encoding="UTF-8" ?>
<node>
    <?var type="string" ?>
    <leaf>Value</leaf>
</node>
^^ That is fine though
 
never seen that in a document before
 
i got that one too. never bothered to look at it though
 
9:28 PM
lol
some wrong info in there
 
its a shame they dont have the mock exams
 
1 hour ago, by ircmaxell
Escaping output may help protect from which common security
vulnerabilities? (Choose 2)


A: Clickjacking
B: Cross-Site Scripting
C: Cross-Ste Request Forgery
D: SQL Injection
Their answer: B and D
My answer: All of the above
 
escaping output helps against d?
 
Well, it depends on what you consider output
But I agree
 
stuff i put out
not in
 
9:30 PM
With pick 2, I'd say B and C
 
b and c
hmm
and a
but not d
 
It's a bad question
because you could make arguments for any combination that included XSS
 
there is a comments function available during the test. i used it a lot :)
 
Ahh nice
 
pg 139 q5
another pointless question imo
 
9:34 PM
yeah
 
all these questions about what can do what or how is it written and so on is pointless
 
pg 80 q 2
correct answer: Parse Error
 
Hey, I have a problem connecting to mySQL DB using PHP, I'm getting this error msg
No connection could be made because the target machine actively (trying to connect via tcp://127.0.0.1:3306) in D:\xampp\htdocs\vol\CreateDB.php on line 2
the connection statment is
$con = mysql_connect("localhost","Shaza");
 
pg 62 q 9 - Correct Answer B or C, since mb_overload could be enabled
 
Do you have any clue?
 
9:36 PM
firewall most likely
 
pg 1 note at the bottom ;)
 
lol
 
given how long that is available now its a fail
 
yup
 
helllo?!?
 
9:39 PM
@Shaza: Read what I wrote after your last post
 
I've turned off all firewalls still getting the same !
and I've tried more than one browser ... same result
 
hi
have you ever thought how would you program without return values?
 
does anyone here know c# or vb.net?
 
@grantum This is a PHP chat room
 
@KamilTomšík why would I want to do that?
 
9:48 PM
hah, thx shaza. im alone in the c# room tho :/
 
@Gordon because of complete "tell dont ask" - every return value widens public api which smells like the code is not at its right place
 
@KamilTomšík and how would a getter tell me a value then?
and isnt not returning still returning void?
 
@grantm I know C#
Can anyone help me?!?
 
@KamilTomšík and @Gordon - ur code wouldnt be able to do anything dynamic, it would just.... so stuff
 
@Gordon there wouldnt be any getters
@grantman16 that's not true
@grantman16 there is workaround - try to find it out :-)
 
9:51 PM
@Shaza - cool do u know how to use the Using statement? i think im using it wrong...
 
@KamilTomšík if there wasnt any getters how would i get to the internals of a class then?
 
@Gordon you simply wouldn't
 
@KamilTomšík - well it wouldnt be able to input anything
 
how would any code consuming new Money(200, 'EUR') know how much value we are talking?
 
we would
just think about it
 
9:52 PM
@KamilTomšík References?
 
you don't need keyboardStream.getChar
 
you can use "using" with libraries .. when you want to include some library like
using System.Data;
 
you need keyboardStream.setHandler(closure)
 
@actually i guess u could only do stuff based on submitted data, so yeah ur right
 
Events/message passing...
 
9:53 PM
(oops accidentally typed an @)
 
you can use keyboardStream.setCharHandler(closure)
@ircmaxell exactly :-)
@grantman16 wrong - you can do anything using closures
 
@KamilTomšík It does widen the public API, but some (including me) would argue that it's the right thing to do semantically. Sure, Events and Message passing have their benefits, but it's a different concept to design by contract
 
Please HELP
 
Both are 100% valid, and both have benefits and detractions
 
@KamilTomšík - closures??
 
9:54 PM
@ircmaxell sure - the point was to ask you if you know how to avoid return values at all :-)
 
HELP is a useless thing to ask for. If you don't provide details, nobody can ever hope to help...
 
@ircmaxell you scored :-)
 
@KamilTomšík Oh ok, just saying
 
@ircmaxell I've provided details up, I don't know what to provide more !
 
r we still talking about php? how do u get keyboard input if its on the server?
 
9:56 PM
Hey, I have a problem connecting to mySQL DB using PHP, I'm getting this error msg
No connection could be made because the target machine actively (trying to connect via tcp://127.0.0.1:3306) in D:\xampp\htdocs\vol\CreateDB.php on line 2
the connection statment is
$con = mysql_connect("localhost","Shaza");
 
@Shaza I didn't see where you described your install, the operating system, whether or not anything works at all, how you installed, etc
 
@Shaza - what is this "CreateDB.php" ?
 
@ircmaxell What's the meaning of "your install", the OS is Windows 7, nothing related to DB works at all ..!!
 
How did you install PHP/MySQL
 
@grantm it's the same file which contains the PHP script
 
9:59 PM
can you connect to MySQL from anything (command line, phpmyadmin, mysql administrator, etc)
 
@grantman16 closures - callbacks, handles, anonymous classes, whatever - decoupled handler in general
 
@KamilTomšík Well, any callback would work. Not just a closure (which is different from an anonymous function. That difference is a pet peeve of mine)
All closures are anonymous functions in PHP. Not all anonymous functions are closures. This does not hold true for JS, but for PHP it does
 
@ircmaxell whatever :-) doesn't matter in this case
 
@KamilTomšík true, but it's a pet peeve, as they are different concepts.
 
i still fail to see how that makes me able to get to my object's values
 
10:03 PM
@ircmaxell anyway - you've once been talking about closures vs. anonymous functions and which one is better (and why) - could you please once again?
 
@Gordon: it's a paradigm that's different than the OOP you're used to
@KamilTomšík I won't say which is better. They have different uses
 
@ircmaxell what is it called?
 
@Gordon - let's say you need workaround for factory.instance() - it would be factory.doWithInstance(handler)
 
@Gordon Message Passing. Or event driven programming. It's not technically about not using return values, but you typically don't need them with the paradigm
 
i see
 
10:06 PM
it is very popular in lisp community - a lot of lisp projects are "tell dont ask" even when lisp is (at its core) opposite
 
i dont care about whats popular in a language that isnt popular
 
LOL
 
@Gordon :-) read hackers and painters - very interesting reading
@Gordon paul graham talks about his project viaweb (now yahoo store) and his "secret weapon" which was lisp - not because it is old but because it can be very easily altered to do nearly anything (original smalltalk implementation was also written in lisp)
 
My problem with lisp is the () overload
 
@ircmaxell mine too
 
10:09 PM
lol
 
smalltalk & ruby are both the new "lisps"
 
I kind of like Ruby
Not ROR, but ruby itself is fairly nice
 
I like the other one - but can't say why - maybe it's because of that wonderful IDE
 
im biased against ruby
 
lol. Never really gave smalltalk a fair chance. So I can't say
@Gordon Why do you say that?
 
10:11 PM
for example I like concept of mixins and I see all advantages - the problem is that Smalltalk don't need them - you can add methods directly to Object
 
because i am
i dont like it
but since i know its bias i wont start to argue
 
Well, then there's not bias. You just don't like it
 
@ircmaxell I'm not forcing you - i'm just expressing my opinion, that's all
 
Bias would be if there was some other factor that cause you not to like it
 
i just think ruby is rubyish (pun intentional)
 
10:12 PM
@ircmaxell one thing I don't like about ruby is its complex syntax (there are a lot of acceptable syntaxes)
 
which is mainly due to the fact that i worked on a RoR project where there was lots of ugly unreadable undocumented code involved
 
@KamilTomšík I know, I'm fine with logical and interesting discussion. As long as it doesn't get to fanboi status and get to useless arguments, it's great!
 
and the other fact that i cant stand the elitist attitude of the rails people
 
@Gordon Ahhh, that can explain a bias
@KamilTomšík Yeah. You can write some beautiful code. But you can also write some perfectly valid fubar code
 
@ircmaxell sure - have a look: esug.heeg.de/whyusesmalltalktoteachoop/… that's smalltalk syntax (although I would drop few things as well...)
 
10:13 PM
but then again, you can do that with just about any language (arguably, Python isn't as susceptible...
uhhh
 
python is something i would learn
 
@ircmaxell I know - I saw a lot of examples where ruby rules (mostly at dsl)
 
though im not sure i like their oo concept
 
I use it from time to time. I haven't found any Python HTTP/FastCGI libraries that I actually like, so I'm still with PHP (for now, giving Node.js some hard work now)
(it being Python)
I love the lamda concept...
 
ruby's syntax is fairly extensible as lisp's one - i can usually tell what code would do but I can't be sure
but that's one of most important OO rules - ability of switching "how does it work" for "i don't care" - so I still can't make my decision...
 
10:18 PM
At least it's not as readable after RSA encryption like PERL is
@KamilTomšík Sure, it's the black-box concept
 
I see the both sides - the good one and the bad one - just can't see which one is more important...
 
fair enough
 
@ircmaxell sure - black-box - that's also the reason why I was talking about eliminating all returns (it's more black-box from my point of view)
 
Well, but black box includes out values. It's part of the black box (the API constitutes the border of the box)
 
@ircmaxell - intermezzo: when alan kay was talking about OOP he has human-body-cells in his mind
 
10:20 PM
?
Ahhh
 
each cell does know very little about other ones and never asks anything from them
 
Well, I'm not so sure that's true...
 
that's why I'm arguing by OO
 
I understand what you're saying. I can't say i agree 100% in all situations, but I understand...
 
@ircmaxell using callbacks can be nasty in some cases - but I believe that it will result in overall better design...
 
10:25 PM
I can see where it might, so again, I understand
I guess it depends on what you're doing more than anything
 
@ircmaxell here :D
 
Sup
 
sure - when computing values it would be opposite situation
 
Right.
Imagine how much of a pita it would be if we had to do:
 
the question is if using embedded language inside app wouldn't be more appropriate
 
10:26 PM
array_sum(array(1,2,3), function($v) use ($sum) { $sum = $v; });
 
having return-less app + embedded js or whatever...
 
okay so I have a problem with PHP adding variables i want passed as a string
so i have this:
onchange='Estimate.select_wire( 0-<?php echo $part->id;?>-<?php echo $zone->id;?>, this.value, 0 );'
But instead of it showing up 0-6-73 is shows up at 79
 
@KamilTomšík True, but you could argue that it introduces global style dependencies since it's harder to trace callbacks than native code
 
@ircmaxell actually in lisp/ruby it would be much more readable because you can define your own lang constructs - still more readable would be classic math formula
 
right
@MylesGray is it interpreted as a number (by js)?
 
10:28 PM
@ircmaxell sure - but there are different styles of programming - in smalltalk this wouldn't be any problem (because when exception occurs you step back in stack and modify code)
 
I'm getting access denied when I try to connect to a mySQL DB using PHP through my user on windows, but I don't get that when I try to connect using root, although I'm an admin on my system, how can I get the privilege to make that accessible ?
 
Again, not arguing @KamilTomšík
 
@ircmaxell no by php
 
@Shaza Lookup GRANT to add a user
 
As I check it as it is imported by JS and I get -79
 
10:29 PM
@MylesGray What's the generated HTML?
 
@ircmaxell anyway - gotta go - thx for discussion
 
oh wait...
generated php is right
 
have a nice day/night/whatever :-)
 
must be JS messing with me
 
yeah
Good night/day @KamilTomšík...
Dinner time.
Later all
 
10:30 PM
@ircmaxell enjoy
 
onchange='Estimate.select_wire( 0-<?php echo $part->id;?>-<?php echo $zone->id;?>, this.value, 0 );' is extremely ugly
@ircmaxell laters
@MylesGray consider building the argument you are going to pass with sprintf
then just echo that as a single variable
or even better, dont put an onchange handler at all, but make it unobtrusive by observing the event
@MylesGray could it be you are missing quotes around the string?
 
@Gordon yep that fixed it!
thanks man :)
 
np
 
11:52 PM
back here
gf is asleep... finally :-)
back to event-driven programming (if you'd like to discuss further) - i think that in general case of at least in case of web devel there are more pros than cons:

1. more cohesive code (methods are where their data is - or at least in the most of cases)
2. simpler language (no returns no need for keyword, documenting feature, etc.
3. no returns could also mean no temporary variables (again - simpler language) - but instance vars are needed for mutable objects - method params can be immutable which could also result in much cleaner code
and of course decoupling - handlers can be completely anything - including lazyproxies, etc.
 
00:00 - 21:0021:00 - 00:00

« first day (155 days earlier)      last day (4797 days later) »