« first day (722 days earlier)      last day (4219 days later) » 

12:44 AM
Redid the color scheme & logo of my homepage.
Before:
After:
 
@Alec , the "before" version was better
 
@tereško I'm targeting a gamer audience. Also you seem to always go against everything I say.
 
the "after" version need only few rotating skulls and flames to be considered a standard geocities page
also , Valve might send you "cease and desist" for the name
the bottom line is this : the design of "before" page was something commonly seen in '04 .. till late '06 , but the "after" version was popular in ~2000
 
1:27 AM
@Alec the first version does actually look better fwiw
 
that's what I said .. and then I was told, that I am being mean .. again
 
user50049
1:44 AM
Honestly (I'm not being mean) .. it reminds me of a PHPNuke site from 2000. I don't think it's going to make gamers get a warm and fuzzy feeling.
 
woah, I remember phpnuke
 
user50049
@Lusitanian I remember cleaning up the IRC bots in /tmp every time a client uploaded it :)
 
damn ... why is it so hard to find a decent urban fantasy audiobook ?!?
 
@TimPost lol, but it's so secure, remember?
the latest stable release is of 3 years ago
 
and they used word "stable" loosely
 
1:48 AM
very true
 
user50049
If mod_security was a baby, PHPNuke was the stork that brought it.
 
If mod_security were a public policy, PHPNuke was the senator who created it.
 
nope .. thats not how politics work , @Lusitanian
in politics we at first create the solution , and then invent a problem , which could be solved by this solution
case & point : USA's voter ID laws
 
user50049
@tereško has a point there, @Lusitanian
 
Yes, I know :P
I hate political ads more than about anything, especially on YouTube
 
user50049
2:27 AM
@Lusitanian I'm pretending that politics will go away if simply ignored long enough. It's working so far.
 
I'm political, I just don't want politics on my internet!
 
 
3 hours later…
user895378
5:03 AM
Let the record show that there are still people advocating that there's "nothing wrong with static":
 
user895378
2
A: PHP Static Methods/Singleton Pattern

David HarknessUsing static methods to provide access to managed instances--whether they be singletons, pooled objects, or on-the-fly instances--isn't a problem for testing as long as you provide a way for the tests to inject their own mocks and stubs as needed and remove them once complete. From your descripti...

 
6:58 AM
Need help with simpleXML. Anybody want to take a crack?
 
 
1 hour later…
8:05 AM
@DonBriggs what is the nut to crack?
 
Good morning
whoever invented this time in the morning deserves to be tortured...
 
@ircmaxell good morning. I hope you had a good night over in europe.
 
:-D
 
@ircmaxell Heh, you got it easier than me, I'm trying to buy glasonbury tickets from an overloaded website at this time in the morning.
 
It's timezones. I think the sun has something to do with it, hard to argue with her.
 
8:06 AM
2 phones on auto-redial, and 2 of us manning the F5 button
 
lol
No idea what glasonbury is, but sounds like fun
 
you've been living in a cave.... it's the biggest festival in the UK
Is there a way to make tabs auto-refresh if they time out? :x
 
@Leigh main website says: unless you have a registration yet, you can not buy tickets any longer.
 
@hakre I have my registration number, you had to register before being able to buy a ticket - You had to register before tickets went on sale.
 
@Leigh I don't live in the UK, so no...
 
8:12 AM
@Leigh I see. Set the time-out value of your browser to 5 minutes. Then set the reload time of the tab to 4 minutes. should do it.
 
@hakre No... needs to be dynamic reload if no connection is established :p
 
@Leigh Ah that: Shift+Super+Right-Alt and right-click, then tick the "Hammer Mode" menu entry.
 
9:00 AM
Well, got my tickets, their method of "restricting connections" was fucking fail. They made their site resolve to 192.168.xxx.xxx addresses periodically
so just set my hostfile to the correct address, tickets bought
 
PHP pros, please take a look at this strange problem stackoverflow.com/questions/12767390/…
 
@Leigh phew, how dirty is that? Browser DNS cache anyone?
 
lol
 
morning
 
@hakre I know some people will never get a ticket because of local ISP cache, let alone browser cache. Some ISPs have no respect for TTL
And morning Nikita
 
9:10 AM
good morning.
 
@NikiC: I just pushed the switch to zval_ptr_dtor...
could you try that change? I still can't produce your zts leak...
 
morning @ircmaxell
 
Good morning!!!
 
@ircmaxell Are you compiling with --enable-debug --enable-maintainer-zts?
 
yes
 
9:15 AM
hum
 
I'm doing a make distclean and vcsclean and recompiling
 
runs clean now, both with and without valgrind
 
awesome!
 
hey guys one quick question. I want to print different messages to the user depending on membership status. Are arrays a good idea or should i just use simple IF clause instead?

$member = array ('1'=>'Member', '2'=>'Not member');
echo $member[$level];

OR

if ($level==1) {echo 'Member'}....
 
I think I'm going to push it into master in a little bit then
 
9:22 AM
@ircmaxell But I somehow feel like that's not the right way to do the casting. It can't reasonably be expected that one has to copy the stuff manually
I mean, convert_to_long_ex does exist for some reason, doesn't it?
 
Well, but it does a SEPARATE_IF_NOT_REF, which is not what I want
 
right
 
Now, I could do a switch on the type, and pass it to the indivual convert functions directly
Converting the value instead of the zval
that way I can save the zval allocation step
 
you don't need the allocation in any case
as it's temporary, it can be simply a stack value
though it's not like performance matters there, right?
 
Well, it could if I knew the length of the source...
 
9:27 AM
length of the source?
 
I guess I could pre-allocate 22 chars of space. and just convert and copy the first 22 characters...
@NikiC correct. But skipping zval allocation wouldn't be about speed but correctness and cleanness
 
if you want to skip the allocation use zval tmp;, don't alloc it, and dtor using zval_dtor(tmp);
 
true...
 
I hate how PHP has fifty macros to do the same thing and then none of them does it right...
And again reminds me just how easy things would be in C++, where you'd just use a RAII to automatically clean it up, without any manual dtor calls :)
 
ol
lol een
FREAKING OSX. WHY YOU DROP KEYSTROKES?
 
9:32 AM
apple software ;)
 
converted it to a stack based zval...
running test on it now before pushing
pushed
 
9:48 AM
runs fine
 
cool
I'm out, later
 
later
 
> +12 6 hours ago reversal Serial downvoting reversed
:)
 
10:03 AM
nice
 
10:20 AM
serial downvoting so pointless
because downvoting is so pointless ^^
 
close vote instead of down vote :)
 
10:33 AM
> Using unset will not free memory. Instead, it will mark a variable for garbage collection. However, in practise, there is effectively no difference, because it happens almost immediately.
is that correct? @NikiC @hakre
 
depends on so many things
but I'd say that usually it's wrong
 
@NikiC the "marking" or the "effectively the same"?
 
@Gordon no. that statement is too broad. for example the garbage collection might be disabled.
 
what happens when the gc is disabled and i unset? mem not freed at all?
 
@Gordon If you are the unique owner of the value, then it will be freed right away on unset
If someone else holds the value in a non-circular relationship, then the value won't be freed in any case
 
10:36 AM
@Gordon gc is for cyclic references.
 
If there is a cyclic reference, then the GC is triggered
 
isn't GC triggered from time to time only?
 
@hakre Yes, right.
 
lol community based Question merging. Nice.
 
10:40 AM
During the unset the zval is only marked as purple and the GC is then triggered when the root buffer is full ;)
 
goodbye 135 reputation
 
Morning
 
@Gordon you asked for it .... .
 
@hakre well, its a sure dupe and i've answered it. sins of the past
 
@Gordon I gave you a charity upvote on the duplicate answer.
 
10:48 AM
@hakre thanks :)
 
@Gordon why delv?
 
@NikiC cuz its a dupe
 
i mean, it's a dupe, but it's not like we goota delete all dupes
 
yes, we do not delete all dupes. sometimes it's good to keep dupes because people use different wordings for the same problem.
 
@NikiC the answers are not better than in the other one. and ive answered both almost the same, so its to absolve me from my repwhoring
 
10:55 AM
but gordon is a programmer. a DRY one of a guy. so deleting is necessary for him :)
however, SO is not greenfield. We need an army of close and del voters.
 
anyway, I won't delete that :P I only delete higher-rep answers of people I don't like :P
 
We should consider how we can improve CV recruitment.
@NikiC Yes that is the biggest fun!
 
@NikiC I'd delete my answer but it's accepted so I cant
 
@Gordon but you can flag and ask mod to delete.
 
@hakre will do that
 
10:57 AM
okay okay
it's gone
 
@NikiC thanks
 
@NikiC: Another mini-parser, with lexer, look-ahead and AST :) stackoverflow.com/questions/12763719/…
 
Do you guys use phpmyadmin?
 
@I'll-Be-Back No. I either use the command line tool or sqlyog
 
@I'll-Be-Back No. I user either CLI or SQL Buddy
 
11:07 AM
One anoying thing about phpmyadmin I cant view two tables at one go.
(apart from opening a new tab)
 
emm .. that's in all tools
 
SQLyog? I will check it out.
 
@Gordon epic_syntax tries to crowdsource "his" new opensource tool to checkout zip files to webroots from bitbucket. It's going since some hours.
I have installed mysql workbench just for fun. it's a bit crappy but it works.
 
my main issue with workbench is the RAM, there have been FPS gamse released this year , which use less
 
@tereško I prefer phmyadmin over SQL Buddy :)
 
11:10 AM
has better features and UI than phpmyadmin and comes with mysql installer on windows
 
@hakre we should have a SE for open source projects like this. I mean, we can probably write it in less than two hours. and in better quality.
@I'll-Be-Back its commercial though. i won the license on twitter
 
Nice
 
@Gordon call it iap.stackoverflow.com ... the tag line would be : Second tier of outsourcing
 
How many followers you gpt
got :P
 
@Gordon the problem is not to write it once but to maintain it I'd say. But the idea is not bad. For example the code-review site was a mess. If it would be for actual, shared projects, this could work out better.
 
11:12 AM
@hakre :) Wouldn't call it a stack though ;)
 
Also this would beautifully fit in to start a shit-storm over the one PHP project or another. :)
 
@hakre Oh, and one should probably know that array_shift is reeeally slow because it reindexes the array :/
 
@NikiC okay, then I need to use a pointer.
but array_shift is nice. I will turn it into a closure, also the look-ahead. LOL.
 
@hakre or you could array_reverse and array_pop (then it would be a real stack ^^)
 
@NikiC and the indexes? I would need to take care of them. hmm.
 
11:17 AM
@tereško hehehe :)
@I'll-Be-Back I dont count and I dont care.
@go_oh, 51.4487513;7.0123734
Freelance PHP webdeveloper, consultant and Zend Certified Engineer from Essen, Germany.
2.5k tweets, 367 followers, following 215 users
 
I always thought Essen was kind of a funny place name
 
@Leigh it is. and it's a PITA when you try to find food related things in this town
since Essen = Meal
what it really means of course is furnaces
 
:P Meal, to eat, usw.
 
although the latin name according to wikipedia is Assindia and I have no clue if that really means furnaces. it would fit though given that we have been famous for our steel production
 
@NikiC Done: stackoverflow.com/questions/12763719/… - it is freaking faster now! and the memory is reduced. cool!
 
hello :)
there is also a big board game convention every year in Essen
and it is next week
 
@Jocelyn been there a few times when i was still actively playing pen and papers. you'll also get access to a comic fair there. nice too, when you are into comics. got a few of my comics signed.
 
I play board games every week with friends
I have never been to Essen
I go every year to the board game convention in Cannes: festivaldesjeux-cannes.com
I can't find the English version of their website...
 
@Jocelyn i wont go to cannes anytime soon, so no worry ;)
 
11:42 AM
Lunch time now, see you later...keep some questions to close-vote for me :-p
 
user1125394
please how can I replace the following chars: " r: c: k: by an empty string, preg_replace('#"|r:|c:|k:#', '', $keywords) does'nt work
 
@cyril I don't think yo need preg_replace for that
str_replace would do it
 
user1125394
11:57 AM
str_replace with an array?
 
user1125394
k
 
yes
str_replace(array('r:', 'c:', 'k:'), '', $keywords)
It should replace all occurences of r: c: or k: by an empty string in $keywords
 
user1125394
thx
 
return $a = &$map[$item] ?: false;
this can't be a good thing to prevent the @ operator, right?
return @$map[$item] ?: false;
@cyril better even strtr, this will come closer to the regex than str_replace.
 
user1125394
@hakre thx better
 
@hakre I call it the $_=& operator :)
 
@NikiC but is it sound?
 
no
 
hi
any svn users here?
 
I heard it works with Pen and Paper. You only need to interface it with PHP, as usual. — hakre 23 secs ago
hi @Eugene, what do you miss in the red book?
 
12:21 PM
My question is quite simple. I found this Q stackoverflow.com/questions/925698/… and I have additional subquestion. Why svn switch --relocate .../project1/trunk/SomeDir .../project2/trunk woun't work? Should it point to same directory as well svn switch --relocate .../project1/trunk/SomeDir .../project2/trunk/SomeDir?
 
I'm making a multi-user application, where each user should have many tables in the database (for managing students, lessons, tests, etc). What would be the best way to approach this?
 
Should I make a database for each teacher? Or throw them all in a single database and each table should be prefixed with the user name or something?
 
12:35 PM
multi user or multi tenant?
 
"User" in this case is a manager of a class
 
@MadaraUchiha could use sqlite and create one db file per user but that will make schema updates tedious since you'd have to update all them files. But you dont need multiple databases if you related the tables properly.
 
@Gordon How would you relate the tables properly?
I was thinking something like "madara_students" "madata_tests" "gordon_students" "gordon_tests"
But that seems less than optimal
 
@MadaraUchiha by foreign keys
 
I don't really like passing variables to table names
Seems wrong to me
@Gordon You mean, one "students" one "tests" one "lessons", but on each record have the ID of the owning user?
 
12:38 PM
@hakre so no idea, right?
 
for instance to store the students in a course, you'd have table course_students with columns course_id, student_id
and your Course table would be like course_id, title, teacher_id and so on
 
@Gordon But the point is that each user has his own students, his own lessons, and his own tests
 
@Eugene if multi user, they should share database and tables.
 
@MadaraUchiha that's perfectly possible with this approach
 
@MadaraUchiha but tests are tests, lessons lessons and users users.
 
12:40 PM
@hakre I meant about svn. Database question isn't my question.
 
@hakre True.
2 mins ago, by Madara Uchiha
@Gordon You mean, one "students" one "tests" one "lessons", but on each record have the ID of the owning user?
 
@Eugene oh sorry. haven't seen your svn response.
 
@MadaraUchiha yes
 
So in this case, lessons_students would have "student_id" "lesson_id" and "user_id"
 
@MadaraUchiha I can even imagine that a teacher shares a course with another teacher, because one of them got ill and the other jumped in.
 
12:41 PM
Or not?
@hakre That's not possible in this case.
The program is used by driving instructors,
 
@MadaraUchiha Yes, for example. Or you have another table that stores the releation ship. That has some specific name.
 
Each of them is independant.
 
@MadaraUchiha okay, that are different customers also.
 
@MadaraUchiha that depends on the relation. i'd say its lesson 1 -> n Students so I dont see user in there. user_id would be on the lesson table, because one lesson has one user
 
Lessons:Students = 1:1
 
12:42 PM
it's normally wise to put each customer into it's own database.
 
Tests:Student = 2:1
User:Student = 1:n
 
@MadaraUchiha 1:1 means one lesson has one user
 
Correct.
Driving lessons are done 1:1
 
yeah, so the table would be Lessons with columns lesson_id (primary key), user_id (foreign key), lesson_title, …
 
@Eugene I have no clue, sorry. Never needed to do that. svnbook.red-bean.com/en/1.7/svn.ref.svn.c.relocate.html
 
12:45 PM
@Gordon Lessons would most likely have no name, just a datetime, and the student_id (since it's 1:1)
one student will have many lessons throughout his course, but each lesson can only contain one student
 
@hakre this is regarding newer version I think. Well most remarks. I use older version, but thanks.
 
@MadaraUchiha so there is no type of drivng lesson, like Night Drive? Highway Drive? Well, title was just for the example to indicate you'd put individual columns related to the lessen here anyway.
 
@Gordon No, but it's nice future thinking, I'll add that...
Yeah, OK
 
So taking the general performance of the question into account, it seems that performance wise you should favorite the close-vote over writing an answer. Did I read that right now? — hakre 21 secs ago
 
@MadaraUchiha but that's then how you'd design it. lessons with id (pk), user (fk), student (fk), datetime. You could make those into a compound key, so an individual lesson is identified by those four fields and you can add constraints that they should not be identical
 
12:50 PM
@Gordon Hmmmm... I wonder
If students are said to belong to a user,
There would be a table "students" where "user_id" and "student_id" will be kept, correct?
In that case, there's no need for the lessons to also belong to a teacher, they belong to a student, which already is linked with a user.
Am I right in thinking that?
 
@MadaraUchiha many ways to skin a cat (although one should never skin a cat, srsly, you guys are sick)
2
 
@Gordon But how would you query a table like that?
If I want all lessons by for that user
 
@MadaraUchiha assuming you know the user_id, you can do with a subselect, e.g. SELECT column, … FROM lessons WHERE student_id IN (SELECT student_id FROM students WHERE user_id = blah); or use a JOIN.
 
I see
 
Cat Content FTW! "Exposure to cute images may improve concentration" http://www.wired.co.uk/news/archive/2012-10/02/the-power-of-kawaii
From now on, each of my presentations will feature cute kittens right at the beginning
 
2:01 PM
There's something I don't quite understand about MVC Routers
I'm implementing, with the help of teresko, a Router that is similar to the notation based router of Symphony.
Example for a notation:
 * "main": {
    "notation": "/:action",
    "defaults": {
        "resource"  :   "Authentication",
    },
    "conditions":   {
        ":action"   :   "(login)|(register)"
    }
},
Now, that's all very nice, but what does that redirect to?
Probably to /authentication/login or register
But what if I wanted that the register to redirect to login as well (say they are the same page for some reason)
 
it does not redirect
 
What do I do then?
Routes*
 
it matches you provided URL to a generated pattern and extracts names for controller, view and action from it
 
But how do I specify a replacement action in the case where it is specified in the url?
 
what replacement ?
 
2:06 PM
I want both /login and /register to map to Authentication::login()
How would I implement that?
The /register (action) is already specified in the URL
How do I change it so that it maps to the login action instead?
 
"main": {
    "notation": "/:stage",
    "defaults": {
        "resource":     "Authentication",
        "action":       "login"
    },
    "conditions":   {
        ":stage":       "login|register"
    }
}
 
I see..
But defaults can only contain "resource" "action" and "parameters", right?
 
hi friends
 
it can contain what you want them to contain
 
Or could it contain ":stage" as well, if it's part of the notation but not specified?
Alright, that's the piece I was missing, thanks!
 
@MadaraUchiha , the "defaults" in my implementation will contain all the values that you set , when pattern has been matched ... it can contain ":foobar" for all I care
 
@tereško Okay, but then what do you do with it?
These defaults that is
How would the application correctly map it to anything?
What would :foobar mean to it?
 
maybe you should work out your own routing mechanism ...
 
@tereško Probably, but I'd like to understand yours before I attempt one of my own
 
i don't think that spoon-feeding my conclusions and solutions to you is all that helpful .. or even healthy
 
2:13 PM
I can easily make one with a simple regex engine, but I want to understand other views as well
 
hey guys...I need a little bit of help with something html related.
 
@Elysium Read the room topic.
 
ok, never mind :D
 
@Elysium 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.
 
2:20 PM
i use below code to merge two pictures but the problem is not downloadable its output on html perfectly

online link
thenanotech.biz/fb_apps/pic_badge
if u check online username = danish.nanotech

$u_pic = $_REQUEST["Uname"];
$src = imagecreatefrompng("pic2.png");
$dest = imagecreatefromstring(file_get_contents("http://graph.facebook.com/" . $u_pic . "/picture?type=large"));

// Set the brush
imagesetbrush($dest, $src);
// Draw a couple of brushes, each overlaying each
imageline($dest, imagesx($dest) / 2, imagesy($dest) / 2, imagesx($dest) / 2, imagesy($dest) / 2, IMG_COLOR_BRUSHED);
 
@DanishIqbal please click the fixed font button when pasting code
 
@Gordon done
 
2:24 PM
@Gordon There's a fixed font button? :o
 
@MadaraUchiha yes?!
 
@Gordon I know of CTRL+K, but never seen a button
 
@MadaraUchiha it appears when you have line breaks in your message
 
That's new :o
 
@MadaraUchiha has been like it forever
 
2:29 PM
Never saw it before
 
@DanishIqbal what is not working?
 
he showing output on html but i dont know how to give save option
 
@DanishIqbal right click save as? not sure what you mean by download option
 
@Gordon can you please check it online

http://thenanotech.biz/fb_apps/pic_badge/
if u check online username = danish.nanotech
its live example
and save as shows PHP file saving option
 
5
A: PHP save file to users computer

GordonIf you want a File Save dialog to pop up when someone requests the export URL, you have to use header("Content-type:text/vcard; charset=utf-8"); header("Content-Disposition: attachment; filename=vcardexport.vcf"); echo $vCardData; So No, you dont have to save it as a file on the server first. ...

 
2:43 PM
I need to find the canonical answer for "Call to a member function ... on a non-object in"
 
@hakre too localized
 
okay
 
@hakre best way to get a canonical for that would be to dig out the earliest and then rewrite it
 
@hakre i post answer on that question
 
2:49 PM
@hakre hmm. or maybe we should compile a list of the most frequently asked error messages and have a reference for it. but then again. not sure.
 
@Gordon List of common error messages would be cool. I'll write a question.
 
@hakre maybe check with @TimPost first whether it's okay since it wouldnt be a real question
that Mihai Iorga guy is such a repwhore
 
@Gordon its not working i try this

header("Content-Disposition: attachment; filename=" . $dest . ".png
 
hey
hey folks, i really need help
i have many queries in my project and I need to format date to other than year-month-day
how can I do it without using date_format in every query?
 
@DanishIqbal that is missing a closing brace and semicolon
 
2:55 PM
in my script is there but maybe here my copy mistake
 
@hey if it's a datetime column you can usually work with that date without having to reformat the date
 
hey
yes, it's datetime.
 
its shows a file download option with out file ext and 0 bytes
 
header('Content-Type: image/png');
header("Content-Disposition: attachment; filename=$dest.png");
imagepng($dest);
 
i made changes in file name
other all is same in my script
 
hey
2:58 PM
@Gordon So, if it's datetime, what can I do?
 
@hey show your query please
 
hey
I just output dates
I have many queries, like SELECT * FROM some_list
and in that some_list there is a datetime
 
@hey just the one you are talking about
 
hey
and I just output it like <?=$some_list['date'];?>
I output date in many many pages
I don't want to format it with php or mysql, I thought maybe it's possible to add just one line at the start of the file or something if possible, but probably not
 

« first day (722 days earlier)      last day (4219 days later) »