« first day (449 days earlier)      last day (4499 days later) » 

3:01 PM
@salathe but only after I changed it's title ;)
hi @LeviMorrison
 
WTF. I keep getting 403 errors trying to post a comment to that reference thread...
 
Hi
@NikiC , was my answer also funny?
 
3:16 PM
Well, since that post won't let me comment, here is what I wrote: pastebin.com/xZ4CcqEj
 
sideof() hehe
 
@AyushPateria Less than the others ;) If you had used count() instead of siezof() everything would be good :)
 
It was a typo.. common
 
@ircmaxell Is my comment alreday visisble?
 
@NikiC yes
and his reply is as well (which really made me want to comment more)
 
3:18 PM
@NikiC Whats the difference between count() and sizeof() ?
 
> As already mentioned, I have no interest in the internal workings of PHP. I mean to address results only. This zval/refcount stuff is overly complex for the sake of understanding how a simple function call is supposed to behave. So, if you can demonstrate additional code patterns that run faster in variable writing situations without references, I would enjoy knowing about them.
> Until then, the heart of the matter is that certain code patterns do force PHP to make a copy of a variable, which might not be the programmer’s desired outcome.
 
@AyushPateria the spelling
 
> We are in agreement that the string copying, unless done many times repeatedly, requires only a fraction of a second. While it would also be possible to test concerns relating to the doubling of operational memory requirements, such tests would be relevant to large strings only. That is a more focused topic that could be the subject of yet another paper.
@AyushPateria sizeof is an alias. count is the proper function
 
@AyushPateria People just don't use sizeof() ^^ But apart from that: no difference
 
@salathe Oh..
 
3:19 PM
@ircmaxell I know, it's awful. Especially the part about "I don't care how it works, I am only interested in the results"
 
@ircmaxell: I'm honoring your good intentions (and thanks for sharing the comment), but I don't think that Robert wrote that you should always use references.
 
@NikiC My eyes just went on sizeof() on google results, so i used it ;)
Anyone here experienced in Android development?
 
@NikiC Yeah, that's the most boggling part. "The Earth Is The Center Of The Universe" people had results too. It wasn't until they started looking at how things work that the truth came out
@hakre that was my take away
 
@hakre I honor your good intentions, but honestly that guy is just stupid (stupid as both in irrational and ignorant)
 
@hakre > Best practices for PHP programming should include the use of references in new code, as well as reviewing mature code for the four patterns that cause unnecessary duplication of values.
That's what he said at the end of the article
so yes, he did write that you should always use references
(well, ok, not always, but at least most of the time
 
3:22 PM
@ircmaxell that's not what he said
 
well, he didn't actually mention the word always, which is why I corrected
 
did he mention "most"?
 
no
 
heh, so don't put words into his mouth!
 
but he did write as well as reviewing mature code for the four patterns that cause unnecessary duplication of values.
which to me implies most...
 
3:23 PM
@salathe is everything okay with you?
 
maybe to you
 
@ircmaxell I think this implies as well removing references.
 
@NikiC not even nearly :)
 
@hakre I didn't see that implication at all anywhere, but whatever
 
3:25 PM
@salathe :D
 
@salathe perhaps. Either way, it's not really important. I'm not trying to say he's an idiot (not in the least), just these kinds of posts are a pet peeve of mine...
 
someone should hijack that to write a definite answer to all those benchmarking questions
 
morning all
 
Its evening here.
 
its almost evening here too
but I just got out of bed :P
 
3:27 PM
Oh :D
 
@salathe: did I strike a nerve with you?
 
@ircmaxell Yes, but it's just another pet peeve :)
 
@salathe Care to explain so that I can try to avoid it next time?
 
@ircmaxell I have an irrational dislike of smart-arses.
You can't avoid it. :P
 
lol... fair enough
 
3:30 PM
@salathe Did you read his article?
 
Evening!
 
@NikiC which one?
 
@salathe The one about reference performance I mean
 
@NikiC Probably not, since I don't even know who "he" is.
 
hi @BoltClock
 
3:32 PM
@Gordon Hey
 
@salathe Ah, okay, that's the problem. If you did, you probably wouldn't call ircmaxell a smartass :)
@BoltClock hoi
 
@NikiC I'm fairly certain I would. :)
 
Guys could anyone of you tell me, where should the small explanation part of class in phpDoc be located. I think, that probably at the top of the class, but maybe there is some standard for that too? @Gordon as I know you are the main expert here on that topic.
 
@salathe I mean the article that we are talking about the whole times ^^
 
<?php
/**
 * @author  author <author@gmail.com>
 * @version $Id$
 */

interface
@NikiC Hi!
 
3:33 PM
@NikiC In that case "probably not", I read a lot but I don't know the particular article you're talking about.
 
@NikiC Hello
 
@NikiC Care to share a link?
 
@salathe www.miqrogroove.com/writing/php-references-for-speed/
@salathe Maybe if you read a little bit into it you might agree that ircmaxell isn't the one being a smartass ;) Or is it just me who really hates his writing style because it's so smartassy?
 
@NikiC Ahh okay, I saw it but never got around to reading it.
@NikiC Maybe they both are. :)
 
3:36 PM
@salathe Well, in that case we all are :)
 
For what it's worth, everyone (you regular guys) in here seem to be. But I don't mean it perhaps as insulting as you may think.
@NikiC :)
 
@salathe what's your definition?
 
@Gordon What's "cv"?
 
Which PHP IDE do you think best, but it should have a GUI builder feature
 
@BoltClock close-vote
 
3:37 PM
@ircmaxell Someone who identifies all-too-well with the "Someone is wrong on the internet" xkcd cartoon.
 
@ircmaxell Oh. Whoops, closed as dupe :)
 
@salathe Well, I'm absolutely guilty of that.
 
@salathe Oh, yeah, then we probably are all smartasses ;)
 
@Eugene above the class. if it's empty (or non-existant), the PHP Reflection class will go further up and pick the first comment it finds, see php.net/manual/en/reflectionclass.getdoccomment.php
 
@BoltClock closevote. this chat is home of the closevote ring
 
3:38 PM
@Gordon Sweeeet.
 
But that doesn't fit the definition of smart-ass that I've seen and heard before (not saying I don't fit the other definition, just different)...
 
Who needs with @BoltClock around?
7
 
@salathe on E_MINDCONTROL errors ;)
 
@hakre Yes, I see now.
@Gordon Thank you @Gordon.
/**
 * short desc
 *
 * long desc
 * @package test
 
@salathe but then again.. wait.. let's try this
 
3:43 PM
How can I use full-qualified tagnames with DOMDocument?
 
@hakre what do you mean full-qualified?
 
I mean those that are prefixed with the namespace URI (not the alias).
 
it worked :D
 
@hakre such a thing exists?
 
@hakre <http://example.com/foo/bar:elementName> is valid?
 
3:47 PM
What should be the regexp to extract a 10 digit no. from string.
for ex: Ayush 999999999
or Test <999999999>
 
@hakre shouldnt that rather be <elementName xmlns="http://example.com/foo/bar"/>
 
user50049
@Gordon can you please add a --sandwich option to cv?
 
@TimPost ;)
 
@TimPost Oh man.
 
@TimPost regarding that profile/debug canonical, I gave up on that. There is way too many questions to get that into a meaningful digest format. :(
 
3:50 PM
@Gordon more this way: <{http://example.com/foo/bar}elementName>.
@Gordon <elementName xmlns="http://example.com/foo/bar"/>is defining the prefix.
 
@hakre I cannot find that in the XML namespaces spec.
 
@hakre cannot find it either: w3.org/TR/xml-names
@hakre no, xmlns:foo would define the prefix
 
@BoltClock I try to find it as well. So do I need to always use the namespace definitions?
 
@hakre to work with dom, no
it can infer the namespace declaration (meaning you don't technically need the xmlns definition to define the prefix. Using it is enough
 
> URI references can contain characters not allowed in names, and are often inconveniently long, so expanded names are not used directly to name elements and attributes in XML documents
So the correct term would be "expanded name" (not qualified name as I wrote earlier) ref
 
3:56 PM
> Instead qualified names are used.
hmm, but apparently you can give them with curly braces somehow
 
to fetch them or inside the XML?
I'm playing around as well, but I don't get to manage that.
 
Not sure if its possible with libxml. Here is from .NET: You can also create an XName from a expanded XML name in the form {namespace}localname.
`XElement root = new XElement("{adventure-works.com}ElementName", "content");`
doesnt seem to work: codepad.viper-7.com/EHmDGa
 
I don't manage that to do with libxml.
also I don't fully understand that getElementsByTagName codepad.viper-7.com/qsTvIz
is it becomming the default namespace if I only have one?
 
4:11 PM
it doesnt change when i add another: codepad.viper-7.com/7rR92G
 
getElementByTagname is just not namespace aware, always takes the local name codepad.viper-7.com/IBwjzJ
I should read the manual actually first. ^^
 
hmm, could probably improve the docs to say Searches for all elements with given local name instead of Searches for all elements with given tag name
 
DOMDocument::getElementsByTagNameNS
has URI
 
well, yes. thats the one to limit it to a certain NS
i assumed getElementByTagName to work on the default namespace only
 
using xpath makes one believe so somehow ;)
But the good thing with DOMDocument::getElementsByTagNameNSis that it takes the URI I was looking for - not the shorter prefix: codepad.viper-7.com/dlW8EF
 
4:20 PM
@Nikic apart from Java style namespace, did you have anything else to complain about InterfaceDistiller?
 
Heh, just looked through my top SO answers, and the first PHP one is the 12th :/
 
@BoltClock whats the first one?
 
@Gordon All-time first?
@Gordon guess
 
@BoltClock javascript?
 
@Gordon: Feature request: stream wrapper you can use with include() on-the-fly to import the interface into runtime.
 
4:23 PM
@Gordon nope
 
@BoltClock css
 
@Gordon ye
100
A: What does this CSS shorthand font syntax mean?

BoltClock12px is the font size, 18px is the line height. The syntax is based on typographical notation for specifying the respective sizes, and is only applicable to the font shorthand property. In other words, the above declaration simply expands to the following: font-size: 12px; line-height: 18px; ...

 
@BoltClock :)
@hakre umm, do you have a use case for that?
 
Only got me a Great Answer badge less than an hour after my birthday. Argh.
 
@BoltClock better late than never
 
4:25 PM
@Gordon true; here's my top PHP answer
27
A: Using 'or die()' to stop on errors in PHP

BoltClockIn PHP, variable assignment (the equals sign) and functions both take precedence over the or operator. That means a function gets executed first, then the return value of the function is used in the or comparison. In turn when you use two values/variables together with an or operator, it compares...

 
gotta run. laters
 
@Gordon cya
 
@Gordon not really. in any case I could offer a patch.
 
 
1 hour later…
6:16 PM
Hello- I am needed to add multiple entries to a database. Here's my form. What is the best way to save this into a mysql table so that if someone adds/enters 5 different 'appliance' entries, etc., it saves them under the same entry? Should I just add the possible POST variables/values like POST_appliance0, POST_appliance1, etc or is there a more efficient way? jsfiddle.net/Commandrea/pFt4A
* it saves them under the same entry = Same 'ID'
 
Good evening PHP'ers
 
evning @Paul
 
6:34 PM
yo
 
nice to meet you guys
 
6:49 PM
@hakre use a recursive function
function myFunc($foo) {
foreach($foo as $bar) { if(is_array($bar) {
foreach($this->myFunc($bar) as $child)) {
}
}
sorry for poor formatting. anyway, recursion is good for traversing arbitrary number of elements in a data structure.
 
Hallo folks
 
@Bracketworks hello
 
What's a good synonym for meta? Thesaurus.com yields nothing
Netbeans XML get's farky with that node name
How's everything? @PeeHaa
 
@Bracketworks pretty good
 
@PeeHaa Yea, I was there too; I'll look again, but I couldn't find anything succinct yet fitting enough
Maybe abstract? Would you, having seen a header node called abstract in an XML file, quickly understand it's intent?
 
6:58 PM
@Bracketworks nopez :)
 
@PeeHaa Yea, I wouldn't think so; besides, the reservations surrounding the word are too strong, especially when mixed with application code
Darn
 
7:14 PM
@PaulDragoonis that was a close-vote call, not call for help ;)
 
@hakre i see
 
jow
 
7:35 PM
(!$expr1 || !$expr2) or (!($expr1 && $expr2))?
 
uglyyy
 
lol @PaulDragoonis, which?
 
use this
!($expr1 && $expr2)
if(!($expr1 && $expr2))
 
@PaulDragoonis That's what the extra parenthesis were, the surrounding if construct
So syntax #2?
 
yes
you're taking an entire expression and inverting it.
but #1 is inverting twice.
so it's somewhat confusing.
 
7:39 PM
@PaulDragoonis Alrighty; I like grouping positive evaluations together, negating the bunch, but I haven't heard anyone cry out on one case over another before; figured I'd toss out a question on it
 
hi all how are you today?
 
@hakre I don't think that's an exact dupe.
 
@LondonBoy hi
 
@LondonBoy Hello!
 
7:44 PM
what would be the best way of counting number of lines in a page on a website :)?
 
wget/file it and count newlines
 
or file_get_contents() + explode("\n" +count()
 
$content = file_get_contents($some_url);
$numLines = count(explode("\n", $content));
echo "There are {$numLines} lines";
 
thanks all
thank you
 
@BoltClock Why don't you think so?
If you want to iterate over all innermost array elements (as written in question) w/o knowing how deep that should perfectly fit.
But I'll review and add the same answer again if it makes sense ^^ ;)
 
7:59 PM
hi @favo @Bracketworks nice to meet you :) i'm new here.
 
@PaulDragoonis Hello to you as well, I'm reasonably new to the chat too :)
 
@hakre It's pretty specific, and based on the same kind of situation in a different programming language. I threw in a comment that might prompt him to elaborate.
 
Hrm...if you delete a question that got an upvote you keep the reputation points?
 
hi Charles how are you?
 
@LondonBoy I am well. Thinking about an API dilemma I have with my project.
 
8:09 PM
i think you can sort it out without annoying your fiancee :)
 
hey again @CharlesSprayberry
 
@CharlesSprayberry Sort of... you'll lose it in the next recalc.
 
@BoltClock Ah, ok. I thought it was kinda weird :)
@PaulDragoonis Hello :)
@LondonBoy I don't know. This one drove me to pose a question on code review. I normally tend to ask questions for things that I really don't grasp, even after research/planning.
 
8:27 PM
@BoltClock Good comment. He might be looking of the product of all arrays, I think this can be solved with functional programming, but I let him elaborate first.
 
good night all
 
night london boy
 
9:15 PM
anyone here?
2
I need help in CSS but no one is in the room, can anyone please come there and help me?
it will be quick and its a small problem
anyone?
??
 
9:31 PM
joined.
 
9:44 PM
join()ed
Perfect troll question for SO: How do I do past tense in c++?
 
by adding ed to function calls?
 
and being sure to allocate with Old instead of New
 
hi all
 
@Anfurny Hmm, my english grammar is not top notch, you're really sure that old is the past form of new?
hi @bateristt
what's cooking?
 
10:00 PM
Why does it take so long for curl to get 1150 web pages and for php to convert them to an xml file? :P
 
hmm, sorry, I have no clue :D
 
Well, I couldn't have done it faster, so kudos to PHP
 
zum zum
 
how long did it actually take?
 
Ermm....around 5-10 mintues. The webpage titles could be named by combining values in an array with values in another array with numbers 1-50, so I didn't have to list out all the page names! lol
 
10:08 PM
anybody here know how to get attention to your blog?
 
Work hard at advertising.
Or become famous
or use Tumbler
:P Make sure you also have a twitter
 
that 3rd one sounds less onerous
 
hey @blake305 @Anfurny :)
 
hi
 
Hi
 
10:10 PM
Fuck twitter. I still maintain it's a fad.
 
@Anfurny About which kind of attention are you speaking?
 
Twitter: they need more hamsters in their servers, that's for sure.
 
Now that I have the data for 1150 entries, I wonder how I can display 1 entry at a time in xcode without causing lag. Hmmm...
 
number of views, rss subscribers whatever
 
then share the link
:)
 
10:18 PM
well there's nothing that great there yet... but blog.alexrohde.com
 
You should make this your git link: github.com/anfurny
and call it github
or something like me on github or so
Then this tagline: "Not Just another WordPress site" - put something more serious in there, or something actual funny, just not such a sentence.
 
Yeah, that was a joke, since the default label is "Just another wordpress site"
but I'll do something that comes to me.
 
Hier blogt Alex Rhode. Now you know my name.
zb.
and, you should enable speaking URLs.
with mod-rewrite / .htaccess
wordpress supports that.
 
hello

if a method modifies a class property, why doesnt it stay modified?
 
@Petre What do you mean? How is it becoming unmodified?
 
10:31 PM
then just keep on publishing, I mean with 3 posts you can't expect massive traffic.
and put pictures into your articles.
so it get's more color.
 
if a class property has the value of 0 and i make a method that sets it to 1 , why doesnt it remain to 1? because if i call the same method again, its not 1 like i set it, its still 0
 
@Petre: That's hard to say w/o knowing the code
Normally what's set stays set until set again.
 
can i show it here?
 
why not?
no-one else is talking right now, so I think it's pretty okay
 
class hb
{
public $ind=0;

public function div($attr,$in_tag)
{
return "\n" . str_repeat("\t",$this->ind) . "<div $attr>$in_tag</div>" . "\n" . str_repeat("\t",$this->ind) . $this->ind;
$this->ind="haha";

}


}
$div=new hb;
echo $div->div("id='haha'",$div->div("id='moo'","nanana"));
damn sorry
ignore that haha
the thing that happens is that the second time i call the div method, the ind property is still 0
 
10:38 PM
return exits the function.
anything after a return won't get executed.
 
ok
thanks
 
so you technically never set that property
 
you saved me some trboule in the future:d
 
yeah, it's good to know what return does (next to return a value)
;)
> if called from within a function, the return() statement immediately ends execution of the current function, and returns its argument ...
 
got it
 
10:42 PM
what happened to the font in the chat? its tiny all of a sudden
 
@Gordon The world is shrinking oh no!
Err I mean, must be on your side ;)
 
@CharlesSprayberry ctrl+0 does nothing, so its not my browser
 
I have a problem running ffmpeg in php exec()

the file is called ffmpeg.exe and is in the same directory as the php file. Since it didn't work, I tried to make it execute a basic 'copy' function. it works when executing the file manually but I can't get it working inside the php script.

exec('ffmpeg.exe -i song1.mp3 song2.mp3');

can anyone tell me what they can see that I'm doing wrong with the exec() function, or is there a better way to run the file?
 
@Gordon Chat looks fine on my side. /shrug
 
@CharlesSprayberry maybe im just tired :)
 
10:50 PM
@Gordon If you're so tired as to effect your vision that badly your body is telling you, "Go to sleep!"
 
@hakre are you sure echo goes to stdout?
@hakre isnt that rather php://output? the manual says php://output is a write-only stream that allows you to write to the output buffer mechanism in the same way as print() and echo().
@CharlesSprayberry will do in a few minutes :)
 
@Gordon if buffer is on, then to buffer but finally STDOUT.
where else?
I don't think that the question was specifically about the stdout handle in PHP itself, but to go to the OS STDOUT handle finally.
 
the funny thing is that when i use fwrite(STDOUT, 'foo'); in zend studio, it will not output anything
 
let me test with PDT
 
whereas when I do php -r "fwrite(STDOUT, 'foo');" it will
 
10:58 PM
works in PDT.
 
then it's probably a zend studio thing
 
I thought Zend Studio is eclipse based.
 
it is
i stumbled upon that when i wrote the cli interface for interface distiller and it confused me
 
okay, where to you look at the output? Console (in eclipse)?
 
no, debug output
 
10:59 PM
let me check
debug output is empty.
 

« first day (449 days earlier)      last day (4499 days later) »