« first day (499 days earlier)      last day (4674 days later) » 

00:03
hi, i have a realy fast regex quetion
quite newbie about this
how can i replace \ character
Hi everyone, I have a question abot github. If I buy a small bronze business account on github, can my colleagues contribute to companies private repo with their free github accounts?
@ErselAker sounds like a question for github, maybe github FAQ?
I could not find an answer on github
If anyone can answer, I would be glad
@ErselAker yap, I have no clue
00:26
Hey All, Does anyone know of a good tutorial for beginners that goes through a step-by-step for building a web application or plugin, etc.?
Ive been following one by nettuts on building a login system but it's a little bit beyond my scope of understanding.
and then get some book about php
Hi. I'm have strange results when deleting a XML node using PHP via AJAX. Could someone have a quick look. stackoverflow.com/questions/9456482/php-and-xml-deleting-nodes Very much appreciated!
@tereško Just so you know, you really need to be a bit kinder when you're helping someone. I understand where you are coming from, but if I'd never used SO before, I would have been quite offended, would have left, and not come back.
lolwut ?!
@tereško You "helped" me a couple of days ago.
Starting here
00:41
you page was completely broken .. IIRC , and when i told you to validate it you went "oh , there are errors .. who cares"
Again, I understand your point of view, but you do need to be kinder. (it may just be that b/c this is text, your tone of voice didn't carry over)
@tereško Not really. Did you look at the errors?
The vast majority of the errors were ">" vs. "/>", which I didn't code.
i was one who pointed you at the errors , which were 600+ at that time
And I thank you for pointing me to it; I had no idea
if you use piece of code ,you are responsible for it
that's what GPL and BSD and MIT licenses have in common
@tereško No, My boss coded it, and I was working with it.
It wasn't just some "random" piece of code that I picked up off the Internet.
It was something that he built from the ground up.
Not realizing the errors.
00:45
.. it kinda makes it even worse
have you looked in some other work options
No.
And I'm not going to.
Again, did you look at the errors?
They weren't major errors.
The majority of the other errors were "document type does not allow element "div" here"
And, just so you know, fixing all those validation errors is going to be fairly high on our list.
My point was that I think you need to be a little more careful about the way you address someone's problem. And Carrie really wasn't very helpful either.
 
6 hours later…
07:01
Nevermind the above cv.
 
2 hours later…
 
3 hours later…
11:38
Good afternoon
11:53
hiya @Robik
Hello @PeeHaa
12:17
Nice avatar @AlmirSarajčić :)
@Gordon ah... didn't know that questions with open bounties can't be closed... ok
@markustharkun i flagged the dup. thanks for pointing it out.
so annoying. he even accepted an answer that doesnt answer his question
@Gordon :/
13:40
posted on February 27, 2012 by Rafael Dohms

Lately I have been very involved with code quality, not just in terms of testing and actually working, but also on a deeper level, readability and plain good architecture. At my previous employer we had been working for a good while already applying rules from “Object Calisthenics” a concept by Jeff Bay, a simple set of exercises that helped identify bad code and improvements points. Once I saw

13:57
@LeviMorrison I've seen that hannes has given you karma for web/php :) grats
Hi, does anyone know how to split a string, but allowing me to escape the delimiter?
So I can have text;text;t\;ext;
41
A: Split string by delimiter, but not if it is escaped

NikiCUse dark magic (demo): $array = preg_split('~\\\\.(*SKIP)(*FAIL)|\|~s', $string); \\\\. matches a backslash followed by a character, (*SKIP)(*FAIL) skips it and \| matches your delimiter.

3
@NikiC Oh wow! Thank you so much! :D
@JoeSimpson oy
14:07
@Neal Hello? Did I do something wrong?
haha no, i just like saying oy
@Neal :'0
@Neal I thought you were a moderator going to tell me off or something
@JoeSimpson haha no. mods are in italics or bold
@Neal Thanks! I don't usually use SO's chat room!
@JoeSimpson ^_^ well welcome, I hope you stay a while :-D
14:18
@Neal I might do! ^__^
Would anyone like to take a look at/down vote an answer of mine? (Partial regex HTML tokenization.) stackoverflow.com/a/9466152/107152
14:40
@Qtax and why should we downvote it?
Because I want to get that badge for negative voted answer. ;-)
ahhh haaaa...
whats that one?
@Qtax i see no reason to dv it. im rather tempted to dv the other one.
@Neal I was thinking Peer Pressure. No I don't know, it's a touchy subject. Would just like to know what ppl think of it.
@Qtax its a good answer. not as sophisticated as stackoverflow.com/a/4234491/208809 but useful to illustrate why its difficult and often not practical to use regex for these tasks but rather a dom parser.
14:50
That answer is wrong. It's not a regex parser. It's a regex tokenizer with a Perl parser.
Good morning
@ircmaxell GM :-)
@Qtax There are no regex parsers ;)
@ircmaxell morning
I hate segfaults
14:53
@NikiC, with enough (?{...}) you could parse anything ;-)
@ircmaxell People keep saying that ...
@Qtax You can match pretty much everything with regular expressions, but not parse. At least not with PHP's regex flavor.
@Qtax Btw, you should replace your usages of the e modifier with a preg_replace_callback ;)
@NikiC, (?{...})` is a Perl construct (allowing integration of arbitrary Perl code).
@NikiC I don't understand why this is segfaulting though... Well, I see why in GDB, but I don't see how based on my modifications
@Qtax I know. But I'm a PHP programmer. So not ? and ?? for me ;)
@ircmaxell code + bt pls
@NikiC, yeah, I was using it till I noticed that ideone had PHP 5.2, not allowing callback with anon function
14:56
@Qtax Uh, viper being down seems to reduce code quality ^^
@Qtax they also dont have simplexml enabled
@NikiC patch at home, and the segfault is in core opcode handler in zend_engine.h
incremental gc landed for ff :)
@ircmaxell still: code + bt?
And more important than incremental gc: bugzilla.mozilla.org/show_bug.cgi?id=469434 finally.
@NikiC when I get home tonight, I will show it to you
:(
15:08
Hello. I have a SQL question: How can I delete in one SQL query all users where=... with deleting each user posts in other table basing on ID of the user?
@Robik what do tha tables look like? Are you using cascade delete?
I actually need basic schema
So I can rename table names and stuff :)
But wait, I will tell the names:
@NikiC: I'm trying to expose new magic methods for get, set and cast_object...
__castTo($type) (for both get and cast_object), and I need to think of a good name for a method to proxy to set (called on assignment to the object)...
@Robik is it mysql?
Ohh, __assign($value)
15:14
@PeeHaa Yes.
@ircmaxell lol, that was hard, wasn't it?
I left my forum for few days. Now my forum have 1k SEO bots and 3k Messages :c
@NikiC yes, it was, because in c it's called set(), and it's the opposite of __castTo(), but for instances
so I'm going to implement static __castFrom($value), and would (prefer) to do something similar to that for the instance
but eih
@PeeHaa So it's called cascade delete?
15:16
@ircmaxell Things will get messy ;)
@NikiC can we talk it out?
And now I know what you mean by segfault
I thought that it was in some PHP code, not in a patch ^^
@ircmaxell maybe ^^
@NikiC No, it was in the engine itself
@ircmaxell No no or no yes? Now I'm confused
@NikiC You are correct, it was not in php code, but in the patch
15:18
ah, okay
@Robik , keep in mind that even with InnoDB in MySQL the cascades wont affect triggers
I will.
@NikiC What do you think the mess will be?
@ircmaxell All of it :)
can you elaborate?
15:22
@Robik yupz
@ircmaxell On think I doubt will work out is the use of it for type hinting. Too much overhead involved: You'd have to create a temporary object for every hint
Also, just from an implementation POV, that would be really hard to implement due to interruption vulnerabilities.
@NikiC Why? Check if it passes the hint. If so, nothing created. If not, check if the hinted class implements __castFrom(). If so, try casting from, and re-run the hint. If pass, let the return pass through unharmed. If not, error as normal
@ircmaxell Still an Int hint would cast the int to an Int and when it is used cast it back to an int. Creating the object is slow both in terms of cpu and memory
@NikiC perhaps...
(well, not perhaps, but still listening)
@ircmaxell definitely
But what I actually meant by "messy" are the interruption vulnerabilities ;)
15:28
interruption vulnerabilities?
In that respect though I'm not sure how they are solved with the existing __toString
@ircmaxell The cast handler will be executed in the middle of the engine function and can modify data that it is using ;)
@ircmaxell Yes, this is one of many cases where PHP has had interruption vulnerabilities ;)
hrm...
it's overwriting the pointer of the argument object
15:43
posted on February 27, 2012 by John Mertic

I’ve talked a lot on this blog about life and career in this blog recently, as to help developers become more productive members of a functioning business team. It’s a topic that is near and dear to me, and one that is essential for anyone looking to progress their career. But if you want to really dig deep into this topic, then drop a mere $40 and check out the Day Camp 4 Developers conferenc

Actually, that branch will never be reached with PHP land classes...
since the std_object_handlers defines cast_object
so the only way it would be reached is if an extension implemented __toString without implementing cast_object
my head hurts from reading this
@ircmaxell It's already patched ;)
@NikiC it is?
care to share the patch?
wait, what are we talking about right now?
The dangling arg pointer that gets destroyed
15:57
Well, but laruence already fixed it, didn't he? So browsing the lxr code won't help much ;)
I'm not sure it fixes it... It still generates a new copy of arg and re-assigns the pointer back
Hrm, something is leaking like crazy here
it fixes the double free and the null pointer
but it still has a weird overwrite of the arg for seemingly no reason
The memory of the PHP process grows and grows, even though I don't see what could be kept alive there.
patched or no?
16:00
normal php
either xmlreader does something stupid or I do something even stupider...
ah, I think the datastructure I use is really getting that large
16:36
heh, I keep screwing something up
I just put 1.2 million rows of word count information in the db only to discover that it's all screwed because of a freaking parenthesis error...
And it's freaking slow, seems like REPLACE INTO is a terribly slow operation
@NikiC +1
I'm looking for a SPL datastructure for a read-ahead list of objects.
When reading ahead I want to put things on the end
Then I want to consume from that list from the beginning.
Is there something with the SPL?
SplQueue, perhaps?
I didn't quite understand your usage.
Last In, First Out
LIFO = Stack
SplStack
16:45
SplStack
K, thx.
though your first description sounded like InfiniteIterator iterating CachingIterator iterating ArrayIterator
@Gordon iterating IteratingIteratorIteratorIterator?
@NikiC yeah, and if you werent too shy to speak at confs you would even be able to participate in the infamous Iterator Drinking games ;)
@Gordon You are so evil :(
16:52
@NikiC i take that as a compliment
@Gordon That's how it was meant ;)
@NikiC :)
Well I wrote some IteratorDecorator stubs until I found out you could extend IteratorIterator ... ^^
ExtendedIteratorIterator
We need to think of some really, really evil iterator
16:54
Right now I'm writing some AheadIterator.
Something like an iterator that is iterating over itself ^^
@NikiC SegfaultIterator?
@Gordon That's not particularly fitting but it's an idea to extend from it ^^
Also I don't want to use FULL CACHE
@Gordon EvalIterator
But only to read a head a specific number of iterations.
@nikic: around?
@ircmaxell yes
do you have a build of trunk handy?
yes
debug zts okay?
$it = new FetchIterator($fetchFunc(range('A', 'F')));

$columns = 3;
echo str_repeat('+-', $columns), "+\n";
foreach($it as $firstCell)
{
    foreach(new PadIterator($it, $columns, ' ') as $cell) {
        printf('|%s', $cell);
    }
    echo "|\n", str_repeat('+-', $columns), "+\n";
}
17:02
can you check out a potential double free (segfault)
yeah
class foo {
    public function __toString() {
        return new StdClass;
    }
}

$foo = new foo;
echo strlen($foo);
if I'm reading it correctly, that should segfault
on r323563 (latest trunk, committed yesterday)
Catchable fatal error: Method foo::__toString() must return a string value in /home/nikic/dev/test.php on line 10
hrm, no segfault...
but it should be efree()ing the result object twice
unless there's a hidden refcount increment that I'm missing
lxr link?
that's the offending double call.
and by default, the cast_object handler for standard user-land classes is
I see what I missed
there are two frees going on
but they create a second temporary zval, and free that
:)
17:08
Hey! Are any of you familiar with Markov Chains/n-grams? I have a question that no one has answered, but given one tip on my code. It's Python, but it's not really about the language, but more about what it does.
Again computed and inserted 1.4 M rows and it seems that the encoding is messed up...
@ircmaxell You should just ping laruence on pecl, that way you can get that discussed quickest ;)
@NikiC fair enough
@Neal Page not found :(
@Neal nah, no thanks
@Neal It would be much more elegant if the question would be empty ;)
Using a front controller pattern with my htaccess file looking like this:

RewriteEngine on
RewriteCond $1 !^(index\.php|media|css|js\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]

but static files in js not being served...any suggestions?
@AndyPerlitch because you're telling it js.txt as a literal
instead: RewriteCond $1 !^(index\.php|media|css|js|.*\.txt$)
17:45
there we go, much appreciated
Hey guys
later
I'm php dev. Wanna start to learn second language. But really a bit confused, which is popular and worst to waste time? Java/C++/C#?
maybe someone can help me
what do you want from the second language
17:57
@ircmaxell I'd want to program multi platform apps, but dunno if Java is best choice for this purpose
apps?
@ircmaxell applications
again, what does that mean
websites are both applications and multi-platform
so define what you want, and then figure out how to get there
@ircmaxell which language is actual for today
?
there are lots of them, define what you want to solve, and then try to reduce
18:01
i have a mysql table with 3500 users roughly , it takes about 1 min to do SELECT * FROM users WHERE username LIKE '$string'% is that normal i have a ajax request which runs the php script , everything locally on my pc
@ircmaxell ok. What's in your mind best language, and (out of curiosity) how many languages do you know?
@anonymouslyanonymous maybe add an index to username
already added an index to username
in phpmyadmin
Indexes: Documentation
Action Keyname Type Unique Packed Column Cardinality Collation Null Comment
Edit Edit Drop Drop PRIMARY BTREE Yes No username 100 A
@anonymouslyanonymous Not normal at all. Should run in a microsecond on one billion rows ;)
im on ubuntu
any settings i should modify in msql i installed it with sudo apt-get install mysql-server
could i ask a php question here please?
i have a mysql table with 3500 users roughly , it takes about 1 min to do SELECT * FROM users WHERE username LIKE '$string'% is that normal i have a ajax request which runs the php script , everything locally on my pc
18:07
1 message moved from JavaScript
1 message moved from JavaScript
18:36
does anyone know of any good cake php 2.0 file uploaders?
tutorials?
Guys, I'm looking for a PHP book for a friend with no programming background. All the related topics on SO link to stackoverflow.com/questions/90924/…, which has been deleted. Any recommendations?
18:59
@Kryptic does your friend want to learn PHP or programming?
Is there ever an actual legitimate reason to have dynamic var names? Can anyone explain why this would be a good idea in some specific case?
@Incognito no
@Kryptic the most recent php book i know of is Lorna's
the only case when you want to use anything going in the direction of variable variables is templating
19:02
I.e. when you extract($vars) so that the vars are available as $foo instead of $vars['foo']
@Gordon Well, he wants to (eventually) build a web application. Ideally the language in question would be easy to pick up and accommodate that.
Lately I've been reading more and more PHP questions, and everyone's asking things like ${$foo} = ${'foo[' . $bar . ']'};
Why are people doing this?
Apart from that I don't know any valid cases of var vars (and I mean $$var. For $this->$var etc there are more valid reasons I think)
@Kryptic for someone with no programming background whatsoever the book above might be good enough
Why are there so many questions like this?
19:03
@Incognito Why do people normally do stupid things?
I don't know. But I don't see people doing $foo = 1+2 + 0 +0 +0 + 0.0 just to be sure they've added numbers.
I'm curious why I see this specific stupidity repeated so much.
@Gordon Thanks, I'll check that one out.
Or if I see it so much, what the reason for it is.
@Incognito Some things are more obviously stupid (or better to say, irrational) than others ;)
19:06
But like, they learn to do it somewhere, is this a book or something? People don't just start doing dumb things if they don't know they can.
I didn't even know that feature existed for a year after starting with PHP.
checks w3schools tutorials on php, sharpens pitchfork
@Incognito my guess is they stumbled upon it somewhere and think it gives them l337 $uperp0wer. you know like all secret things do. just like a lot of people actually think it pays off to use the "secrets" at phpbench.com
:( feelsbadman.png
19:27
evening
 
1 hour later…
20:51
hello is this the right room for wordpress or is there a different one?
thanx!
anyone any good at solving foreign key mysql issues? ....
:-(
> 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.
:-P
@ircmaxell :-P
well im getting (errno: 121) even though all the tables are empty!
idk what to do :-(
This is my create statement for the table:
delimiter $$

CREATE TABLE `limitstobrokers` (
  `limitsToBrokersid` int(11) NOT NULL AUTO_INCREMENT,
  `limitName` char(25) NOT NULL,
  `brokerid` int(11) NOT NULL,
  PRIMARY KEY (`limitsToBrokersid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8$$
I am trying to make those last 2 (limitName and brokerid) to be foreign keys to two other tables...
but then when i try i get the 121 error :-(
20:59
what's error 121?
@ircmaxell "Can't create table"
ok...
Nobody Understands REST or HTTP - http://dzone.com/uh5j - @DZone Big Link by dotCore
this is a good article IMO
21:40
Good uses of define(), any example?
I'm looking at something that uses it to like a global constant for a value in the middle of a method of a single-method class, and I'm a little afraid here.
@Incognito there is none. even the common APP_ROOT constants smell unless put into their own namespace
That's disappointing.
I'm asking candiates a fizz-buzz-like question, this guy actually managed to solve it, but he's got a handfull of thing here that make me ask "wat?"
He's the first guy to solve it, so I figure I should check with anyone else if I don't like define because I'm ignorant of it's proper use, or not.
21:56
Hey so this is my first time using the chat. I hope I'm not interrupting something but I thought I would throw this out there- has anyone ever had a problem with uploading an image via php where it seems as though the dimensions of the picture (not filesize) affect its ability to upload?
If I upload a picture with small dimensions it uploads fine, if I upload a picture with large dimensions (even though the filesize is small) it seems as though no data even gets passed to my php function to finish upload.
It could be a server setting too but everything I see is related to file size.
22:14
I hate writing bios
@Incognito i haven't really found a decent use for define. But then, i hate constants mostly because they don't interpolate into strings :)
so, i may be a bit biased there
22:31
as in plural of bio , or as basic input/output system ?
Hey does anyone know how to make a filed defined in controller available in .inc file
?
does your web server serve .inc files as php?
I am using wamp
what is "filed defined" ?
don't use .inc for php
22:33
so I am setting a variable in my controller
it will come back to bite you in the ass later.
@WeRock , you really should learn stuff before making websites
actually I am working on already existing thing. SO can't do much about it
.. it tends to help
22:34
yes sir agreed.
what is "filed defined" ?
So basically the variable is set in controller. It's available in the view but I want to use it in the .inc file used in that view
3 mins ago, by We Rock
Hey does anyone know how to make a filed defined in controller available in .inc file
$this->set("age", this->data['age']);
where age is array.
@tereško s/filed/field/
22:37
even then it makes no sense
so now the age is available in a view called age. but in that age I am including a .inc file
semi does.
@ircmaxell its not so much the bios than the boast about yourself part they usually ask for
but yeah, could be asked a lot better
@Gordon That's the bio here
22:39
@WeRock care to share what framework you're using?
@ircmaxell horrible :)
I am using cakephp
my condolences
23:15
First commit to web/php.git :)
anybody anything?
can't seem to figure it out
:(
@LeviMorrison congrats
@ircmaxell Thank you. I'm torn between working on PHP docs and the actual website. :/
rewrite!
23:38
figured it out guys.
hi guys
can you help with rewriting rules in apache?
have a bizarre issue
@vaultboy , since you haven't actually asked the question , only answer you can get is : "maybe"
i know :) just wanted to know if you're ready for the question
i actually have asked it here stackoverflow.com/questions/9474102/…

« first day (499 days earlier)      last day (4674 days later) »