« first day (502 days earlier)      last day (4439 days later) » 

12:46 AM
Does anyone know, if I have personal design of a webpage, would it be possible to customize Twitter bootstrap for it or main Twitter design still will be the same and for personal design it isn't suitable?
 
did you made that sentence with random technobabble generator ? or did it come from google's translator ?
 
 
1 hour later…
2:10 AM
I love that the time frame for the technician to get my Internet hooked up is 8am-5pm
 
user895378
2:36 AM
If I only need a data structure to function as a hash that maps string keys to mixed data (not an SplObjectStorage use-case), should I simply use an array or is there a better Spl solution? To use ArrayAccess with an unknown number of elements it seems I'd have to use an array under the hood anyway ...
 
user895378
After revisiting the SPL manual section it seems array is the best bet, but I'd be interested to hear if anyone has any other thoughts.
 
@gordon yes, I tried put_file_contents, but it did not work :(
 
3:09 AM
hmm.
anyone experienced that doing more string concatenations does speed up the string processing in PHP?
(for one variable).
Just wondering because I'm able to reproduce it.
 
user895378
3:22 AM
@hakre Do you mean like $str = 'my' . 'long' . 'string' . 'is' . 'great'; as opposed to $str = 'my'; $str.= 'long'; $str.= 'string'; ?
 
3:38 AM
Hi guys!
 
4:16 AM
You know it's never a good thing to see this error: "PHP Warning: Interface Traversable cannot contain non abstract method }Bn() in Unknown"
@hakre micro-optimization, ignore it
:q
 
user895378
4:45 AM
@ircmaxell +1 for The MicroPHP Fallacy ... nice work there.
 
Thanks!
 
user895378
And also for the recent object_cast_magic RFC. I'd love to see __castTo implemented
 
I am prepping a new patch implementing __toint and a few others instead... we will see...
 
 
3 hours later…
7:50 AM
posted on March 01, 2012 by PHP Classes

Is PHP Source Quality really Good or is it still Insecure? - Lately in PHP podcast episode 21 By Manuel Lemos A stydy from Coverity claims that the source code of Open Source projects such as PHP has a low defect rate. Meanwhile, a few weeks ago, the security expert Stefan Esser claims that PHP source security bug prevention has a lot to be desired because PHP core developers do not have

 
 
1 hour later…
8:50 AM
posted on March 01, 2012 by Ian Barber

At the recent PHP UK Conference 2012 I had the opportunity to chat about machine learning and IR with a bunch of very smart people. One of the conversations included the always enlightening Rowan Merewood, and was around ranking Twitter friends. It's reasonably well known that Google used to use a variant of PageRank based on who-follows-who to rank it's Twitter search results (back when it had

 
who's the know it all here?
as there's always a know it all
 
@tereško As always, I don't follow you.
 
9:17 AM
@Feeds Can we filter @Feeds to weed out PHP Classes "articles"?
 
Looks like stable 5.4 binaries for windows went up last night, no sign of the "official" source release though :(
 
@Gordon Re. @Feeds ... here's Planet PHP without PHP Classes :) feedrinse.com/services/rinse/…
 
9:33 AM
Gordon has made a change to the feeds posted into this room
Gordon has stopped a feed from being posted into this room
 
@salathe thanks, lets see how this works out
 
9:58 AM
@Gordon thanks :)
 
10:11 AM
don't you guys know how to sleep? :D
 
Don't you know the hours people with jobs typically have to work?
 
@Gordon: Do additional duplicate flags help you in any way? Still a bit far from being able to cast close votes.
 
@Leigh nope. in fact, when you use flags (mod attention) instead of regular closevotes you will likely get a "declined" response from them on new question. from my experience, flagging for duplicate has most chances when used on older that dont stand a chance of getting closed by community anymore. so only closevotes really help.
 
11:08 AM
Any Magento developers around?
I guess not
 
Aji
Hi all
I have a basic php doubt
its about variables
Anybody active?
 
Just ask your question.
4
 
Aji
sure.
i have an array..
[1] => \x4f\160\x65\162\x61\40\x4d\151\x6e\151
this is the first item.
So basically this is hex+octal string \x4f is hex and \160 is octal.this pattern repeats
if i do echo "\x4f\160\x65\162\x61\40\x4d\151\x6e\151";
this displays "Opera Mini"
 
11:26 AM
I thought octal numbers needed a preceding 0
 
Aji
but if i print_r($array) i get the "\x4f\160\x65\162\x61\40\x4d\151\x6e\151"
why is that?
 
@Aji because of the double quotes
 
Double quotes cause the string to have its escape sequences parsed. print_r prints the literal string
 
you'll also get the literal string when you do echo '\x4f\160\x65\162\x61\40\x4d\151\x6e\151';
 
Aji
11:28 AM
yes,so to get Opera Mini from the array i just add the " ?
like '"'.array(1).'"'; ?
 
what?
 
Aji
Im new to php.
 
you will never get print_r to show the parsed string. It will always show the literal contents.
 
$var = "\x4f\160\x65\162\x61\40\x4d\151\x6e\151";
print_r($var);
will show Opera Mini, because before the string is assigned to $var it will have it's escape sequences parsed.
 
hi all
 
Aji
11:34 AM
i understand that.
 
that means, $var will contain the string "Opera Mini" and not the literal string with the escape sequences
$var = '\x4f\160\x65\162\x61\40\x4d\151\x6e\151';
print_r($var);
will assign the literal string to $var and then the print_r output will contain literal string
 
Aji
Array
(
[1] => \x4f\160\x65\162\x61\40\x4d\151\x6e\151
)
this is the item in the array.
 
Use double quotes when you construct your array then.
 
if i do this echo time() will i get my pc local time or time on the remote server
 
Aji
@Vlad server
 
11:36 AM
@Vlad: PHP is a server side scripting language, there's your hint
 
Aji
php is running on the server.
 
ok, technically not true, i do a bunch of client side scripting with PHP
 
Aji
@Leigh thats something new to me,client side with php?
 
ok but my pc time and server can be different so time gives the current time on the server?
 
@Aji means it was assigned as a literal
 
Aji
11:38 AM
is there a way to convert that to Opera Mini after constructing the array?
@Vlad will be server time,as php is running on the server.if you need client's (your machine's) time,use client side scripting
 
@Aji: You'll have to loop through the array and apply string processing. Unfortunately not as easy as you think
$array = array('\x4f\160\x65\162\x61\40\x4d\151\x6e\151');

foreach ($array as $key => $value) {
	// doesn't work.
	$array[$key] = "$value";
	// doesn't work
	$array[$key] = sprintf($value);
}

var_dump($array);
 
Aji
what i was doing earlier was splitting them into hex and oct arrays and convert to decimal
there should be an easier way,
 
12:00 PM
Hello
 
Aji
I just created a gist from the code @Leigh provided.
gist: Sucker Strings , 2012-03-01 11:58:12Z
<?php
$array = array('\x4f\160\x65\162\x61\40\x4d\151\x6e\151');

foreach ($array as $key => $value) {
        // doesn't work.
        $array[$key] = "$value";
        // doesn't work
        $array[$key] = sprintf($value);
}
//Why does this display Opera Mini ?
echo "\x4f\160\x65\162\x61\40\x4d\151\x6e\151";

echo "<br/>";

//Why doesnt the array[1] display Opera Mini ?
print_r($array);

?>
 
I've just found yet another language, but this one looks promising, what do you guys think? opalang.org
 
@Donut opalang? opa is colloquial for grandfather in german, so Ill try it when i am. not now ;)
 
I know. :)
 
Hi, this is pretty basic but I have forgotten, If i want to see a timeout on a login. Do I just create a session with a life time then check if it is still set on page load?
$second_till_timeout=15*60;
			setcookie ('PHPSESSID',$_COOKIE['PHPSESSID'],time()+$seconds_till_timeout);
 
12:06 PM
@Donut is there a "why use opalang" thread or article?
 
@Gordon: It boasts enhanced support for MongoDB, Mongo being colloquial german for "idiot"
 
@MelvinProtacio Don't know.
 
@Leigh colloquial but also derogatory ;)
 
@Donut they should provide one, if not, then i might never consider even trying to learn the language
 
@MelvinProtacio: Did you try looking at the page? I mean, at all? The big "Why Opa" in the middle of it isn't what you want?
 
12:09 PM
@Aji the solution is stripcslashes
$var = array('\x4f\160\x65\162\x61\40\x4d\151\x6e\151');
$var[0] = stripcslashes($var[0]);
print_r($var);
 
@Leigh haha! there it is :D thanks for pointing that out :D
 
@Gordon: aha, the elusive "c", I did try stripslashes :/
 
USA sucks
 
Aji
@Gordon awesome.
It works.
Thank you all for your time.
 
@Aji np
 
12:12 PM
@PeeHaa: bodog.co.uk :)
 
@Leigh I know. That's not the problem. The problem is that USA gov think they are the boss of the internet
 
Aji
It works,cool.but how?
 
@PeeHaa: I know they do. The UK fails pretty hard, but at least it's not the US...
 
is weak today. stackoverflow.com/questions/9515541/… is still open :(
 
12:59 PM
hi folks
 
having some problems with a file upload in cake php 2.0 I keep getting this error mesage
Notice (8): Indirect modification of overloaded property UploadsController::$data has no effect [APP/Controller/uploads_controller.php, line 58] Notice (8): Undefined index: eventname
any know what that means? the information is being inputted into the database and the file is been uploaded but it keeps overwriting the file that gets uploaded after each upload
 
hi guys, does anybody understands in flash streaming stuff?
 
1:16 PM
you know that this is php channel , @Vlad
right ? have you noticed ?
 
yes but the flex/As3 channel is abandoned, now one there,
i am tring to solve desperately one problem
As3 related
 
not sure but i heard javascript is much more similiar to as then php. Javascript room will be much better for you.
 
good advice
 
or you could do the sensible thing , and create a post on SO
 
yea, that would be better.
 
@PeeHaa: takes us back to tereskos thoughts that in India the question mark is an unholy symbol, and it's use is punishable by death.
I really think google should show SO some special treatment, and consider a questions votes when it displays results. I find myself searching, getting an SO hit, then downvoting year+ old questions because their content is terrible.
 
@Leigh , and i thought , i was only one who was noticing that
 
@tereško: You mean the language thing right? I was saying yesterday it feels like SO is a second level of outsourcing most of the time. SO is definitely making me more... intolerant
 
1:49 PM
that's a side effect of all communities .. the rage , the rage
 
It's not so much rage as it is a desire to punish people for no reason. I seem to now be in the habit of doing a cursory check on a question for grammar, checking the users name to see if it sounds like they're in some sort of code sweatshop, and then either reporting the question or ignoring it because I just can't be bothered to help people who see SO as a place to get quick answers with zero effort on their part.
 
well .. there is nothing wrong with fixing some grammar mistakes , if the question is understandable
 
All my edits still need to be approved by someone else anyway.
 
you guys forget the fact that noobs cannot give much wisedom
*wisdom
 
Thanks for your "Wisdom" there
 
1:57 PM
and the few things noobs can answer are taken away instantly
 
@Wangdang: Whats the problem? You can't get quick points from fast answers? How about taking the time to write a well structured and informative answer, that will get upvotes even if it isn't accepted.
 
@Leigh , only when you have low rep : stackoverflow.com/privileges
at 2000 you do not need the approval
 
@tereško: I know, I'm about 3000 approved edits away from not needing approval ;)
or is it 2000? I thought it was 3
 
no, you are about 555 rep points away from that
 
ok, maths sucked there anyway. ignore me, too much multi-tasking
yea yea, i thought it was 3000 needed, putting me 1500 away, and i doubled instead of halving, because of 2 points per edit (assuming i got no points from other sources)
 
2:02 PM
yes thats my problem. i dont get points for any answer because trivial questions are easy to answer meaning that u cannot do much to provide a "better" answer
an pro can give the same and better answer in shorter times
 
@Wandang: So answer non-trivial questions.
 
taking noobs away the chance to get anything right?
as i said noobs cannot answer them
or not good enough
 
@Wandang: If rep is your priority here, you're here for the wrong reason. If you don't know enough about a subject to answer questions about it, why should you get rep for it?
 
i mainly help ppl for fun (otherwise i would have gotten to SO much earlier) [u dont get much thanks in forums anyway]. your 2nd point has no basic so i wont comment that
 
morning
 
2:21 PM
LOL reputation whores gonna whore
@tereško you always put your thoughts so nice and friendly
 
@CarrieKendall , i dunno about you , but when i say "rep whoring" it is targeted at people with 10k+ reputation , who are answering deletable questions
 
Oh i definitely agree with you, i just like how you blatantly call people out all of the time :P
 
Hello All
 
2:40 PM
Looking at a slide show on Lithium, but every slide starts off saying "Oh everything else sucks LOL" rather than showing me merits of the framework. Why do people make stuff like this?
 
heh
cause they're 15 and don't know how to interact with adults yet?
 
hey guys
 
at least, that's what i tell myself. cause if it's not true, i'd have to call them idiots
 
Well, it's 123 slides long, the first 30 were "Lol everything sucks"
It event said "Martin Fowler sucks"
 
Hi @NikiC
 
2:50 PM
Now it's saying dependency injection sucks.
 
huh?
 
I don't even know man.
 
Lithium seems to be a very good framework...
@Donut wooohooo, the @Donut is back!
 
@NikiC I like it
 
@ircmaxell That was sarcastic :)
 
Mine wasn't
 
@NikiC Yeah. :)
 
@ircmaxell The slideshow indicates otherwise, if one can trust @Incognito's statements ;)
 
lol...
 
2:54 PM
Slideshow is linked, I think it's honestly two goofballs who wanted to be flashy made a slide-show around a framework they like.
 
@NikiC: I think I found a bug with make
 
@ircmaxell which?
 
If you edit a struct, only the file that defines it is recompiled. Other files that use it won't be, and it will lead to segfaults...
So if I make changes to the zend_class_entry struct, I need to make clean to avoid segfaults
You know it's never a good thing to see this error: "PHP Warning: Interface Traversable cannot contain non abstract method }Bn() in Unknown"
 
@ircmaxell But you did ran make clean, right?
 
After the segfaults...
and that fixed it
 
2:59 PM
You always should run make clean ;)
Incremental make will often give you quirks ;)
 
3:14 PM
And recompile everything?
 
yes
-j4 is your friend, by the way ;)
 
Maybe anyone else had experience with opa?
I ask again because I really dont know if it's worth learning.
 
@Donut is it ready for enterprise applications? even the documentations of that site is suffering from some issues. i don't think it is ripe at the moment.
 
Yes. The documentation is the issue.
 
@Donut at the moment it is not worth learning
 
3:29 PM
Okay. Thanks for the opinion
 
@Donut i don't even see an analysis or review on some of the popular blogs or news, if it is big and great it will really make a noise on the internet and some companies will try to check on it then it will appreciate in value and only then it is worth learning :D just my opinion
 
I'm trying to replicate object pass-by-reference E_DEPRECATED message... but I can't: codepad.viper-7.com/M8lmlR
What am I missing?
 
@Donut haha! you're really serious about this thing huh?
:D
 
Yes. Looks awesome for small applications
Not sure if there's session.
 
3:42 PM
@Donut there is
 
@CarrieKendall Nice website (/var/www/html) you've got there. XD
 
haha thanks
 
user895378
Can I just say that it's terrifically entertaining to read the backlog of new messages in this room each morning? I've never encountered a more snarky, no-nonsense, viciously entertaining group of people than highly qualified programmers. Nice work all.
 
user895378
Love it.
 
@rdlowrey congrats! you have plenty of time to read through the backlogs :D
 
3:47 PM
Still, I without an answer :/
Darn bugs. Creepy crawling bugs all over the source code.
 
user895378
@MelvinProtacio the chat backlogs are a great way to slack off on the internet while still feeling productive in-between massively productive coding binges :)
 
@rdlowrey :D
 
Interesting quirk:
for ($i = 'A'; $i <= 'Z'; $i++) {
	echo $i;
}
behaves rather unexpectedly
Is there actually a better way of doing that than for 65 to 90 and using chr, or foreach with range('A', 'Z') ?
 
@Leigh To be honest, it's not exactly clear either.
I would...
for ($i = chr('A'); $i <= chr('Z'); $i++) {
A word of warning though, the 2nd part (the condition) is executed on each iteration.
You would want to keep a variable somewhere with the value, instead of converting the value each time.
 
If thats the case, i'd be better off just doing 65 to 90 and using chr inside the loop anyway
 
3:59 PM
@Leigh Maybe replace $i <= 'Z' with $i != 'AA'?
 
@NikiC That's a hell of a lot readable. :D
 
@NikiC: I could, i'm wondering if I'm actually entering into undefined behaviour though, using characters as an iterator. Do you think it's liable to change between versions?
 
@Leigh It's defined behavior ;)
 
@NikiC: Any details? :) 'Z'++ being 'AA' seems pretty illogical to me
 
@Leigh It was taken from perl
There even is some docs on it somewhere...
 
4:04 PM
hah :)
I think I'm suffering from premature micro-optimisation syndrome anyway.
 
user895378
@Leigh I heard that will ruin your social life.
 
@rdlowrey: Surprisingly true, not going out because you just know you can shave off that extra half a second in the million iteration performance testing loop
 
user895378
I know it kills mine. Once every couple of months I find myself wasting an entire weekend like a shut-in hermit performing pointless micro-optimizations then realize it was all a stupid waste of time :)
 
user895378
Just ... one ... more ... line ... need ... microseconds ... arrrrgggh
 
Could be worse, I spend hours on things only to realise there's a built-in function for it
 
4:09 PM
Hoy hoy
@Christian That won't do what you think it does...
that's equivilant to for ($i = 1; $i <= 1; $i++)...
 
@ircmaxell Heya, why if it isn't my ol' friend :)
 
:-P
 
drat, right. It's ord, not chr
Talk about descriptively named functions :)
 
hehehe, thank C for that
 
But I still get points for good intention ;)
 
4:11 PM
Of course...
 
Say, can you give this issue of mine a look?
 
Current problem is, generate an A-Z, where letters that map to an index output a link, where letters with no index just spit out a span or something. Mappable letters are in an array. It feels there must be a better method than looping through A to Z and checking with in_array. I want something like.. an array_intersect_map
 
Oh, basically, I'm trying to cause an E_DEPRECATED...
 
you were hoping that $a =& new a(); will cause E_DEPRECATED ?
 
@tereško On PHP 5, yes?
 
4:18 PM
php cannot do that .. you know how many frameworks would break if they did !
 
@tereško O.o
 
@Christian: does it have to be with references?
error_reporting(-1);
ereg('', '');
 
@Leigh yes
 
@Christian: ok :p
 
@tereško My logging system complains about $xml =& new XMLReader(); saying Assigning the return value of new by reference is deprecated (class-simplepie.php: 14418)
 
4:20 PM
well .. it should complain , because it is bad practice
 
I'm just trying to replicate the behavior over codepad. I already made it spew out E_DEPRECATED like Leigh mentioned, but I can't figure out why this one in particular doesn't work.
@tereško Agreed. Yet it (the codepad one) doesn't. Any idea why?
 
@Christian It's a compile time E_STRICT error
So you won't be able to reproduce it on codepad (unless using an eval)
 
@Christian , you might want to contact Viper-7
 
@NikiC Hmm, I got an E_DEPRECATED in my log.
Why doesn't it work on codepad again?
 
@Christian it doesn't have display_startup_errors turned on
 
4:29 PM
@salathe Now it does. :) codepad.viper-7.com/G4TAz8 (still, nothing)
But as I take it, that directive is useless in the same file, correct?
 
@Christian trying to change that setting after php has started up is... pointless
 
@salathe Oh, it doesn't work for other (includeed/required) files?
 
@Christian lol no
 
/me needs more PHP theory for breakfast.
 
Is there a quick way to make all of the values in an array equal to the keys, aside from foreach($array as $key => &$value) {$value=$key;}
 
4:31 PM
Anyway, got to dash, bus' probably gone (duh)
cheerio
 
@Leigh array_combine(array_keys($array), array_keys($array))
 
@salathe heh, just wanted to post!
 
aha, thanks
 
Can I express 1024 bytes of information travelling over cat5e as voltage?
Probably the worst choice of room to ask that. Sorry.
 
@Incognito lol
 
user895378
4:42 PM
haha
 
user895378
__insert snarky comment about technically remedial PHP devs here__
 
I just failed my driving test :(
 
@rdlowrey Well, it's a question that involves things closer to electronics than software.
 
@Incognito Yes, hardware is for loosers :P
 
If anyone's interested I posted it out here:
0
Q: Express bytes over cat5e as energy?

IncognitoI'm interested in this purely from personal interest, I'm not a student. Can I express 1024 bytes of information travelling over cat5e as joules (or some measure that fits into energy of e=mc^2 )? How? Would this be radically different if it were travelling through a CPU? I have no practical ...

 
user895378
4:50 PM
@Incognito I'm not sure how you can be concerned with voltage questions when @Bracketworks just had a negative lifechanging event on the order of driving test failure. That was the worst thing that had ever happened to me when I was 16.
 
But I'm 27 :S lol
 
user895378
hehe nice.
 
I don't fail driving tests: flirt with person doing the testing.
 
Never needed to drive, people tell me to drive, now I need to drive, people are telling me I can't. Life is confusing.
I would have flirted, however, he was a man (likewise) and if I were gay, I doubt he would be my first choice.
 
user895378
@Incognito If you saw the ... ahem .. "ladies" who worked at my local department of motor vehicles ... you might change your strategy.
 
4:52 PM
what have i missed
 
@tereško Noise.
 
@rdlowrey Spot on friend, spot on
 
5:22 PM
when does a singleton instance call __destruct?
 
@AndyPerlitch on shutdown
 
ok just clarifying (cuz im terrible with nomenclature/jargon) that is when the code stops executing
 
yes
 
@NikiC thanks!
 
@AndyPerlitch , you should not care about it
because if you write good OOP code, you never have singletons
 
5:49 PM
(yourLocalTime)Evening
 
look who's back
 
hey @edorian :)
 
Hi @edorian
 
@NikiC What are your thoughts on github.com/nikic/PHP-Parser/issues/12 ?
 

« first day (502 days earlier)      last day (4439 days later) »