« first day (330 days earlier)      last day (4840 days later) » 
01:00 - 15:0015:00 - 00:00

01:48
what's proper name for recursion stack overflow?
just stack overflow?
02:16
Yyup
02:28
have I told anyone recently how much I hate trying to 'design' a website in photoshop?
I just write it in HTML as a dummy page, then code the backend/frontend as I need to. Saves having to convert it manually (slicing sucks).
yeah but for my own website I want some 'perty graphics'... i just suck at graphic design these days (ever since i learned PHP and it took over my life)
I seemed to have lost all my 'creativity' when it comes to graphics
I just don't have that much to begin with. With experience comes experience, however.
I often look around at other websites for inspiration. I'll be browsing for a jQuery plugin or something, and I'll see a neat piece of design on a site which I'll take inspiration from, or adapt. I never copy - it's too naff.
oh yeah definately -- this is why my site currently doesn't have anything on it
thecodestar.com -- as you can see, nothing
All sites start from somewhere. I often sit around with ideas (very vague ones, mind) for sites that I'd like to implement in my next projects. Do you do the same?
02:37
When I do a project, I generally either a. find and pay someone to do the design or b. already have a design that has been given to me by the client
some I do with nothing more than CSS, but most have some sort of graphics because everyone wants 'pretty'
in terms of my own site i was thinking about doing a relatively large header and have a 'star' cut out of it.. and in that cutout use jquery to cycle through some images of code: PHP, jQuery and such
but yeah i dont know exactly if i want to do that either lol
 
6 hours later…
08:52
Good morning
 
1 hour later…
10:09
Hey everyone
I can't belive it, but after i HAVE moved my software from one server to second (from local to my remote VPS). Now "cannot modify header information" appears. How is it possible? Is it server configuration?
Hi @genesis
Whitespaces before <?php ?
10:57
@genesis: I don't believe you ask such questions ;-)
11:19
@Robik @zermks yes it's also unbeliveable for me, but the problem is that cloned code is working on one machine and not working on another. Yes, there are headers already sent, but for some reason it WORKS on my local machine (I'm being redirected)
@genesis , it is a warning , not an error
different server have different values set in error_reporting
if yo have full control over that box , you should int php.ini file and change error reporting to E_ALL | E_STRICT
it would end up showing you a ton of warnings , but eventually it would improve your coding style
11:35
Hi! I am experiencing problems with multiupload form. I have form with 10 upload fields, but if I add more than 3-4 files it will not upload. PHP can't find the file parameters.
uploads_max is 20 and max size is 120megs...
is there any known issues with uploading many files?
@tereško problem is that when they were already sent, how is it possible to redirect user?
@tereško okay, it's warning. So when I supress that warning, I get redirected? (I know I shouldn'T do it)
stop trying to hide the mistakes
find them and fix them
but I'm just suprised
@tereško how is it possible that it does redirect on my local server even when headers are already sent?
11:38
different settings?
and if its windows, the line ends are different and may cause problems
it may not
then its just the different settings
or different php version
Different versions of php, different settings. Different data. There are lots of reasons it may work on one environment and not the other...
Good time everyone !
and it is well known hoe much developer like the "it works for me" excuse
11:40
@zerkms but it really works'
second. Ill check err log
has anyone read Steve McConnell's 'Code Complete' Book ?
error_reporting = E_ALL & ~E_DEPRECATED & ~E_NOTICE

on my local,


error_reporting = E_ALL & ~E_NOTICE
on my remote
@OmeidHerat: I did (but not completely ))
@zerkms do you recommend it ? anything good or bad about it ?
11:48
@ircmaxell I really see why is it happening. I've got output (<html><body>) before redirect. However it does now on one and not on another one
Bad - it is too long and author is being CO too much, but it really worth to read
@genesis , it should be E_ALL | E_STRICT
I personally think it is the book every developer ought to read
@tereško I do not mind about E_NOTICE errors
11:49
@tereško as I said, it works one one and it doesn't matter which error_reporting is set
I got it, actually a friend give me So I am going to read it !
then look at the error message
and understand what i says
I do understand it
hehe
well fix it then?
But ... damn. I'll do so
I just want to know, WHY
11:51
as long as you've done that - you'll get what is the difference in envs
environments
hi
well, there are more header()s sent which doesn't show errors
@Nikic hi
I've just written a really evil piece of code. It definitely kills kittens.
11:54
noooooooo
Maaany kittens. That's why I didn't dare executing it yet.
Hi NiKi
@zermks I maybe got it. output_buffering = 4096
?
So I assume
yep, you should have it turned off on your dev server
11:56
because you have done your code but haven't executed yet !
@zermks that does that right?
yep
that was what I was looking for. reason Why. thanks. +30 for you
@NikiC do you want to share that piece of evil code ?
@Omeid I'm interesting, too. I wanna see that evil weapon
11:59
gist: 1209494, 2011-09-11 11:59:33Z
<?php

class PHPTokenizer_Tokenizer_PHP53To536 extends PHPTokenizer_Tokenizer_Base
{
    public function tokenize($code) {
        @$resetErrorMsg;
        $tokens = @token_get_all($code);
        $error = error_get_last();

        try {
            $this->checkError($error['message']);

            $count = count($tokens);
            for ($i = 0; $i < $count; ++$i) {
                if (T_HALT_COMPILER === $tokens[$i][0]) {
                    $needTokens = 3;
                    for (; $i < $count; ++$i) {
                        if (!isset(self::$dropTokens[$tokens[$i][0]]) && !--$needTokens) {
                            $tokens = array_slice($tokens, 0, $i);

                            $rest = '';
                            for (; $i < $count; ++$i) {
                                if (isset($tokens[$i][1])) {
                                    $rest .= $tokens[$i][1];
                                } else {
                                    $rest .= $tokens[$i];
                                }
                            }
                            if ('' !== $rest) {
                                $tokens[] = array(T_INLINE_HTML, $rest, -1); // TODO: -1
                            }
                        }
                    }
                }
            }
        } catch (PHPTokenizer_Error $e) {
            // TODO: everything
        }

        return $tokens;
    }
}
Doesn't look that evil at first, but the more you look at it the eviler it gets ;)
//TODO: everything :p
First evil thing is that it creates the class based on the PHP version (the code for that isn't in the snippet). Second thing is the @$resetErrorMsg; $tokens = @token_get_all($code); at the start. Third evil thing are the three nested loops that could have been just one loop but would have required a state variable.
And due to the TODO: everything the evilness of that code will need to triple ;)
A stylish evil: if ('' !== $rest). Seems...backwards. Perverted even.
@Zirak Don't you write conditions that way too?
Hell no.
12:05
@Zirak :D Afaik many CS require that (e.g. Symfony?)
Its like thinking backwards. You're saying "does an empty string not equal something?", but what you mean is "does something npt equal an empty string?".
The computer doesn't care, so that only the users reading the code care.
$res !== '' is better. hell yeah
@Zirak @genesis I don't know what you don't like about it. Many people write the thing you compare against first, because it's usually more important. Just look at an arbitrary piece of Symfony code. github.com/symfony/symfony/blob/master/src/Symfony/Component/…
it also prevents accidents like if ($foo = 'bar')
$var !== '' is correct by convention and in literal reading it makes more sense as @Zirak said
12:09
@OmeidHerat No, the other one is correct by convention (nowadays) :P
@Maerlyn Yes, that is one of the reasons to use the syntax. It also prevents accidents if you actually want to do an assignment in an if:
Symfony is not convention, none of the PHP's official examples has something like that.
now you tell me.
convention is project-specific
guys, komodo or eclipse?
A billion chinese people can also be wrong.
if (false !== $pos = strpos(bla, bla))
// vs.
if ($pos = strpos(bla, bla) !== false)) // something entirely different you definitely don't want
12:11
@zerkms Vim
@Zirak: emacs
@Maerlyn no convention is more language specific.
@zerkms PhpStorm (if you aren't just a hobby dev)
It's really a coding style. But one that I see as a burden more than anything else.
sure code style is project-specific specially in PHP.
12:12
to help marking places I do want to do an assignment, I use if (($foo = bar())), so double brackets (also silences netbeans' warning)
@NikiC: I don't but phpstorm doesn't support remote SFTP editing
@OmeidHerat Some conventions are language specific (e.g. you should never use Allman style in PHP), but others are not ;)
@NikiC That's just plain wrong...editor is a really personal choice.
3
@Zirak No, the part about the hobby dev was only because PhpStorm costs money and you usually don't want to spend money unless you're a professional ;)
@NikiC Paid is not always the best option.
professionals go opensource these days.
12:14
@OmeidHerat You never used PhpStorm ;)
lunch.
investment into tools isn't a problem as long as they solve issues. php storm doesn't support remote sftp editing, eclipse does
i like phpstorm editing local files, it is great, but...
I love minifying. Does anybody have better way to minify code?
$f = ob_get_contents();ob_end_clean();$f=  preg_replace('~[\n\r]+~', '', $f);echo preg_replace('~  ~', '', $f);
Why would you minify php code?
@genesis: what for?
not mynifying php code, html
12:17
Why would you minify html?
$f = ob_get_contents();
ob_end_clean();
$f =  preg_replace('~[\n\r]+~', '', $f);
echo preg_replace('~  ~', '', $f);
1. faster to load
2. harder to read
3. better for crawlers
$f = preg_replace('^.*$', 'absolute minification, $f);
The several byes you spare don't matter much unless you get bagillions of hits.
@genesisφ that is in fact obfuscation not minification .
@zermks hah
12:17
install gzip on web server
:-S
"Faster to load"...by 5 picoseconds maybe
"Harder to read" Why would you care?
"Better for crawlers" In what way?
what is that?!
view-source:http://stackoverflow.phpcode.eu/questions/1/test123456789#p15
@Zirak okay, my facts are wrong.
I won't care about minifying :p
12:19
@genesisφ hashtags dosn't work for 'view-source' Chrome is not that smart :|
@Omeid I know, I just have copied code from address bar
aight.
I do have a problem with uploading. If I upload more than 4-5 files PHP doesn't receive the files. My upload max size is 120m and upload max count is 50+, so can't be the issue. This also seems to be fairly random. Anybody knows reason for this kind of behavior?
@k00pa what is your server and browser ?
lamp and firefox 7
testing out with another browser just be sure..
same issue with chrome
12:26
mind sharing the code ?
that part handles the upload
storeImage moves it to correct place and adds to database
it works with 3-4 images just fine
and the field names (file0->) are correct
What do you prefer: to use default shortcuts or tough customizing of IDE you use?
@k00pa var_dump $_FILES in the top of the page you handle the uploads and see what you get.
all right
@zerkms Defaults, again conventions.
you don't want to look like a newbie when using your Co-worker computer with the same IDE as you use.
12:31
@OmeidHerat "array(0) { }"
Yep, I also tend to move to default, it is painful to reconfigure it from the scratch :-S
@k00pa have you tried to upload some files ?!
yes that had 6 files on upload
this is what I get when I have small amount of files: pastie.org/2517994
looks like php just throws everything away if it gets too many files
but the php limits are not even close
Just to make sure do you have enctype="multipart/form-data" in your HTML form tag ?
yes
12:33
@k00pa on that pastie there is like 7 files so it works I think.
there is not 7 files, only two
rest of the fields are empty
but it doesn't work even if I fill all the fields
how many files you uploaded when you got the dump in the pastie ?
two
try more.
how much?
12:38
more then what you think it works.
here is the result with five images: array(0) { }
maybe 6 or 7
yeah it now exploded on five images
it just doesn't return anything on the php
the files array is empty
now this is wired.
yeah
I think the problem is not my source
updating lamp stack just to be sure
12:41
use XAMP its better.
try phpinfo(); and see what really is your max_files_uplaod
upload_max_filesize is 120m
suhosin.upload.max_uploads is 25
max_file_uploads is 200
testing again with updated server
yeah, not working
memory_limit is 128M, that should not be a problem either
what is the solution? D:
12:46
XAMPP.
ugh -.-
@k00pa Check post_max_size. It should be bigger or at least equal to upload_max_filesize
checking
its 8m...
/facepalm
/facepalm
that shouldn't be a problem, unless you have been testing your upload with at least 1mb files which is unusual.
12:48
the images were ~2m
so it could upload 3-4 without problems
and it did get array out now
:)
Can I have some random vote ups ?
IT WORKS!
AWW YEEAAH!
just 11 so I can have 1k ?
@k00pa Nice.
12:50
how I can give points to user in chat? D:
@NikiC thanks for the help!
Click on user and go to they are profile, then you can vote up they are answers :)
and thanks for you also for trying to help :)
kk
no problem.
@Omeid +10 ;)
Thanks :)
lolz
You got it !
12:56
Are you sure you would give them ? :p Do you think they're good answers?
I don'T wanna have problems/suspension
okay, it's ok in that case ;)
you want justification ?!
lolz.
@Omeid huh?
Today is 9/11
12:57
and?
and my reputation says 911 !
needs four votes til a golden PHP badge :)
hah :D
@Nikic who?
@genesis me :P
@genesisφ You should do some more goodness for me, at least as much as I did.
12:58
@Omeid what justification? I just wanna be sure I do not get suspended
@Nikic u can get badge for CW post?
@Omeid I have given you already. Going to browse around your posts
no you don't get suspended. my vote ups are legitimate.
@genesis I don't know whether CW counts into badges
@Omeid @nikic this answer is the best I ever had
hilarious
@genesisφ they say I can't vote up twice.
:lolz
:D
Simple is good
13:01
@genesis óÒ The strange ways of SO ...
@nikic which strange ways? about CW?
I'm going to do some work on my SO clone now :p
@genesis No, about +10 for max ;) I have such an answer too: stackoverflow.com/questions/5159086/php-split-string/…
@Nikic same
10
A: which regular expression should i use?

genesis φ$string = "blablabla (blablaba)"; explode(" ", $string); you do not need to regex it

The question only needs to get enough attention and the votes will come.
13:04
@Nikic yes. You can even set bounty for that
and it will get even more upvotes
@genesis Yep. that's what I'm currently doing for:
9
A: Parentheses altering semantics of function call result

NikiCThis behavior could be classified as bug, so you should definitely not rely on it. The (simplified) conditions for the message not to be thrown on a function call are as follows (see the definition of the opcode ZEND_SEND_VAR_NO_REF): the argument is not a function call (or if it is, it return...

and does it work?
@genesis It works as soon as it's one of the first in the bounty list ;)
Hahahah
the second answer, and read my comment.
0
Q: Unable to get return from jQuery AJAX Success function

Tom WaltersHey guys, I'm building an application which requires access to the server time before sending AJAX requests off, the only way to do this is to be able to have a function that requests the time from the server using AJAX, so in my function I have the following code: $.ajax({ type:"GET", u...

looking for bad questions to get those last four votes
13:10
4 votes for what
ah php tag
@genesisφ I give you 3 but you just give me 1 :(
@Omeid 3
Cheers!
13:24
@NikiC: phpstorm saves files without prompting. what a mess
13:46
@zerkms Not for me. Maybe you enabled some option?
@NikiC: uhm, it does it for everyone. Googled thread on official forum about that
what if you close file without explicit saving
does it ask you about further action?
@zerkms Ah, okay, I never tested that. I thought you were talking about auto-save after inactivity or alike
nono, saving on closing tab or editor
that behaviour is absolutely unexpected for me :-S
@zerkms I never really had a problem with it ^^
what if you changed something by accident and closed tab?!
any other IDE would ask you what to do and you always have a chance to press Cancel and ctrl+z changes
but not here
13:54
@zerkms If you really accidentially change something (which never happend to me at least with phpstorm) you can simply revert it, can't you?
uhm, how?
after file has been closed - the undo-history is disappeared
(it happened to me a while ago - I opened few files just to see how autocompletion/hints work there, and didn't realize I literally changed files)
... before I run git status :-S
@NikiC how you ever done re-factoring ? when you work with different versions of almost the same files ?
@zerkms Don't you get all changes for a file shown on the left?
@OmeidHerat Is this a separate discussion or about autosav?
haven't worked with local changes history in phpstorm, but it was boring to restore that several files manually to the previous state
@NikiC no the save issue.
13:58
anyway - even though there are ways to see the changes (using local history) - it's not a deal when IDE decides when to save a file without prompting
(my personal opinion)
I am with you @zerkms
imagine you working in a file and you give a copy of it to your coworker or upload it and you have no idea what version it is.
I don't know whether it's good or bad. I never had a problem with it, so I assume "good".
/me spent this evening in looking for a replacement for aptana 1.x. Nothing good has been found :-S
@zerkms Netbeans!
@OmeidHerat I don't get your point. I understand @zerkms issue, but I don't get your point with the different versions. Maybe you should look into version control (e.g. git)?
14:01
@NikiC no I am talking about autosave of phpstorm
can netbeans work with remote files (available through sftp)?
I remember I have some claims to netbeans
@zerkms Yes!
@zerkms I use PhpStorm mainly because it's fast and it has much better static analysis / code completion than other IDEs I tried. But it's not perfect for everyone ;9
@OmeidHerat: hm...... need to reinstall it again, but it was something I didn't like in it too :-S
it does support sftp but I have never tried.
14:03
@OmeidHerat: does it download all the remote files for that?
@zerkms Why the heck do you want to change remote files?
@NikiC: because developer sandboxes are set up on remote server
I don't think so, it doesn't download all the files, but what you are working with.
I cannot set up environment locally
due to its complexity
óÒ
14:04
cannot ?
yes
the project is really huge
no, the project probably just has bad architecture
currently it has ~1600 remote git branches
óÒ Okay, that is huge
14:05
@NikiC: nope ;-) It is just a big stack of technologies used because of it is complex ;-)
@zerkms What is it?(If you can tell)
its sandbox build takes 15-20 minutes
odesk.com
please tell me it doesn't include hiphop.
it doesn't ))
unfortunately
Even page load takes years. :D
14:06
(for me)
build time 20 minutes is okay. Many other things need hours for a full build ;9
not for php )
This is why I like php... :O)
anyway, I'm closed in sandbox and only eclipse (specifically aptana) can work well with remote files without need of downloading all the sources
@zerkms Forced https ?!
14:07
@zerkms Right. Though if you have a large testsuite and you do code coverage and static analysis it can take time, too ;)
The problem is if you get disconnected in the middle of a source update...
This is why I never edit remote files...
your IDE should take care of that.
@jdias
@jdias: what will happen then?
I still have a copy of that file locally
yes and no... sometimes it doesn't do it very well...I rather work locally and upload.
there is no yes and no sir.
14:09
anyway, it's 1am and my wife is angry of me sitting in front of pc
your IDE should take of this or its broken ;D
Good night !
1am ?!
it's 16:11 over here
about 12 am here.
I hit the hay soon
14:39
hi
I use Netbeans its quite good
Morning folks
user680786
@Justin 18:45, good morning :)
sticks with Aptana Studio
Aptana Studio is slow and buggy.
user680786
PhpStorm is best.
14:52
NB FTW!
you get everything not only PHP.
imagine your C++/PHP/Python/.../.... all in one place!
Sad i must work in Eclipse :(
user680786
PhpStorm has Inspections - it's amazing feature
user680786
@OmeidHerat "all in one place" sounds like some chinese smartphone with 1001 functions :)
user680786
but NetBeans is good IDE, I like it
no, its not with 1001 functions.
you can get the functions you like.
user680786
14:54
@OmeidHerat it was just my stupid joke
user680786
my first impression of PhpStorm was very bad, especially after communicating with developers of this IDE. But after all - it's not perfect, but it's best IDE for PHP at this moment. I hope somebody will create better IDE, and free :)
01:00 - 15:0015:00 - 00:00

« first day (330 days earlier)      last day (4840 days later) »