« first day (527 days earlier)      last day (4435 days later) » 

12:00 AM
$a = new ObjectA;
$b = $a;
at this point $a and $b point to the same object in memory
 
$b = $a; i c
like $a = $b = new ObjectA; right ?
 
try this :
$foo = new stdClass;
$bar = $foo;
$foo->param = 'data';
var_dump( $bar );
this the same way as you can create a single PDO connection and pass it to multiple objects in the constructor
this way they all end up using the same db connection
 
when do we need to $a = &$b; ?
thanks teresko!
 
@MianKhurramIjaz , never
at least not for objects
@MianKhurramIjaz , you might find this really informative : PHP UK Conference 2012 - PHP under the hood
 
1:03 AM
Woot, got my new plants planted on the balcony...
 
what kinda plants o_O?
naughty plants?
 
Nah
Rosemary, Thyme, Oregano, Parsely and Strawberry
 
yum
no basil?
 
user895378
<--- has a black thumb and will be totally screwed in the event of an apocalypse.
 
1:19 AM
i just finished planting my garden yesterday ^^
 
user895378
Man, I must be the only person who can't grow plants.
 
@rdlowrey just get already grown annuals :]
 
hi guys, sorry for interrupting. I'm having problem with a web based project that i have build to upload an image from a tablet devices by using php. everything works fine on a desktop computer but the upload doesn't work on a android tablet. by any chance anyone have the same experiences before that i did. Tried on doing research to find a solution but no luck with that.
 
user895378
@CarrieKendall Do I have to water those? :)
 
@Petah next week
 
1:22 AM
2 hours ago, by tereško
@TwoClicks , that should be a post in SO main page .. go an make it ... just dont forget to include the question
 
@Petah: I need to get another planter, and they were out of basil, going to do 1 basil plant and 1 cilantro plant. I want to put a third in that planter, but I can't figure out what...
 
@CarrieKendall hi carrie, thanks for your reply. Have tried that and haven't got any positive direction yet so was trying to see if there is some luck at here. really appreciate with your reply
 
pepper maybe
 
Yeah, I may do a hot pepper plant, but it'd have to be in another planter, these aren't deep enough (about 5 inches deep)
 
@rdlowrey nah, unless its drought status. they will die in the fall either way
 
user895378
1:26 AM
The only thing I've successfully grown is serrano peppers ... those are awesome
 
@rdlowrey: start with herbs. They are almost impossible to screw up. In fact, for some (like rosemary and thyme), they thrive on neglect...
 
user895378
Oh so it's analogous to my choices in women
 
lol
 
user895378
New season of Mad Men starting tonight (30 minutes ago). You can catch my sister's name in the credits if you're so inclined -- Second A.D.
 
You want to know an odd fact about that show?
 
user895378
1:30 AM
Shoot
 
The building they are supposed to be in is the same one I currently work in. In fact, based on the views they show, it's the floor directly above me
And there is a real life advertising firm above my office as well, so it fits
 
user895378
That's cool -- so you're there in Manhattan. Nice.
 
Yup, but my department is moving to another building on Friday, so only one more week with a dinamite view
 
user895378
:(
 
1:34 AM
@ircmaxell that is awesome!
 
user1385191
I can make out two of those books (both of which I own)
 
going byebye on Friday. Moving to a cubical in Time's Square
which makes me sad
 
user895378
@ircmaxell That's sweeeet. But I guess Times Square isn't so bad ... I mean ... it's not like wading through an ocean of tourists ever gets annoying :)
 
user895378
Otherwise it's cool
 
user1385191
it sure beats sitting at home
 
1:37 AM
what city do you live in ?
new york i guess from googling Times Square
 
i'd prefer sitting at home to times square
 
@Petah I live in New Jersey, just across the river from NYC. But I work in the heart of the city
 
nice
major difference to my humble work place
 
lol
 
how many people work there?
 
1:47 AM
My company? Or my office?
 
both
 
Company: around 300,000. Office: now 75 (from my department), next week: 200...
 
geeze
 
The chances are good that if you live in the US, you're a customer
 
2:02 AM
you actually work at McDonald's ?
=P
 
lol
no
I work for a media company
 
lets just hope it isn't News Corp.
 
Nope
 
good enough
 
user1385191
big tv company (I already know)
 
2:05 AM
yup
And technically, movie company, and cable company as well..
 
i just saw bowfire last night.
 
I think I'm going to go see Hunger Games next weekend
 
they say its a somewhat disappointing
 
user1385191
I applied to a mobile studio today since my PHP & db skills aren't good enough to be a full-stack dev
 
lol
my impression is that the "stack" for mobile development companies is even higher
 
2:10 AM
i was thinking of going and seeing it, but i am trying to wait out the hype @ircmaxell
 
user895378
@CarrieKendall I enjoyed the books a lot but was disappointed by the movie
 
user1385191
@tereško they just wanted HTML/CSS/JS
 
user1385191
their golden goose is a mobile JS framework
 
me too
 
user895378
@tereško Yeah, I was underwhelmed by the movie. It missed what I thought was the whole point of the books. They turned it into a girl superhero movie instead of an indictment of the audience.
 
2:12 AM
huh ?
 
user895378
the Hunger Games movie
 
user895378
Of course it's going to make boatloads of money regardless
 
the impression i get from hype is that they just made a "white version" of Battle Royal
 
i think i am going to read the books, i have heard good things around them. i somewhat lost interest after they compared them to the twilight series
 
user895378
I've read that Battle Royal is awesome. I need to see it.
 
user895378
2:14 AM
@CarrieKendall Yeah, they're easy to read. I knocked out all three of them last week.
 
@CarrieKendall I'm right with you there...
 
havn't read the book , but saw the movie ( with subs , of course )
 
@ircmaxell listening to this score while programming makes prepared statements feel epic
 
LOL
 
user895378
@CarrieKendall The Hunger Games soundtrack?
 
2:17 AM
14 mins ago, by ircmaxell
 
user895378
Ah
 
user895378
OH SNAP.
 
user895378
Lord of the Rings FTW.
 
i still haven't finished reading Hobbit
 
2:19 AM
best book ever
 
No? That's a quick easy read
 
okay atleast top 10
 
especially compared to the other 3
 
yesss
 
user895378
I haven't read the Hobbit since I was 10, but I've read the Lord of the Rings books a bunch of times.
 
2:20 AM
I'm currently reading Johnny Mnemonic .. the plan is to work up till Neuromancer , and then continue
 
Ah, nice
 
ok .. quick question : cakephp, codeigniter, kohana, laravel, lithium, symfony
which one am i still missing
 
Zend?
 
anything else ?
 
tons, but you're just looking for the majors I think?
 
2:26 AM
major and the interesting
laravel kinda fits in the later category
 
those are pretty much the majors...
You also have Silex and a host of micro frameworks, but they are all smaller
 
look like i forgot yii and fuel
 
oh yeah
 
wonder why ..
ok .. gonna take a nap
 
 
2 hours later…
4:26 AM
@PeeHaa I don't really have a solid answer for that, since I'd have to go back and find out when that restriction was added... But IIRC, the current rules went into effect when @-notification was added to comments - prior to that, there weren't any scenarios where usernames had to be parsed out of text, and hence no real need for any rules on what a username could be - you could have a single punctuation character username.
Once it became necessary to recognize usernames in free-form text, it became necessary to describe how they would be differentiated from the surrounding text, how to transform a username into one that would be recognized, and how ambiguities would be resolved. This meant rules. Potentially arbitrary rules. Like, no "=" in usernames.
I'd post that as an answer, but I don't feel like double-checking it... And it doesn't really answer the question anyway.
Just out of curiosity... Why would you want a = in your username?
(trivia: it was possible for a while to circumvent the username restrictions by not filling in your name at all - early versions of the software synthesized one from your OpenID. This was stopped primary because it exposed private data, and looked like ass for Google OpenIDs.)
 
user895378
4:59 AM
If you're a Game of Thrones dork like me, here's a cool interview with GRRM from authors@google
 
6:27 AM
stackoverflow.com/questions/9867464/… it's scary to me that people come asking questions like this... business owners with 100 stores shouldn't be dabbling in "roll your own" business solutions.
I mean, seriously... FFS, hire someone.
[tag:cv-pls]http://stackoverflow.com/questions/9867295/how-to-solve-multiple-header-in-php
*sigh*
Is this response of mine out of line? stackoverflow.com/questions/9867388/…
Seriously... I wanna know...
 
 
1 hour later…
8:01 AM
@JaredMark Not out of line per se. However it would have been better as a comment.
@Shog9 No specific reason just curious why there are restrictions.
 
user986408
8:43 AM
@tereško hey there.. can you maybe give me some input ? my scientific question for my bachelor thesis is "how can php be used stateful" .. i've no idea where to start ..
 
i have no idea what you mean by "stateful"
what is the context
 
jay
can any one solve my problem i want to download file from uploaded file i used this code but it is not working $file = "upload/Chrysanthemum.JPEG";


if (file_exists($file)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($file));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
 
user986408
@tereško well.. stateful like idk saving information over time and not losing it .. i dont understand the question well either.. is states "how can php be used statful (serverside apc/memcache)" ...
 
user986408
i know that http is stateless ...
 
oh .. that the idea
 
jay
8:49 AM
hello
 
well , i would start by examining the statelessness of web as opposed to desktop applications where ( in mvc paradigm ) the model always is the same instance
in web application you have to re-instantiate the application every time
 
user986408
good point
 
and caching solutions is way to avoid some of that complexity
you have apc/memcached as the default solutions , and noSQL databases as the newcomers
 
user986408
ah nosql is a good term thanks
 
you can also examine large php based applications which are know to used memcached : facebook
 
user986408
8:53 AM
yep yep .. sec i'm gonna take some notes
 
user986408
that would be a good start thanks
 
i think that looking at the M part of MVC might be a good idea too
 
user986408
yea
 
because this is exactly where you would be trying to make php to act statefully
 
user986408
m is the model .. so database connection/structure ?
 
8:55 AM
and this is where people usually implement the caching layer
@ThatWebNerd , no , not really. Only data access layer in Model is aware of database
 
user986408
ah k
 
maybe this comment helps (skip to the "side notes" part)
 
user986408
thanks
 
user986408
well i need to hurry or else i'm gonna miss the train.. thank you for the initial input ! see u later
 
bye
what the hell, @hakre .. this is the second academic question in 12h
and it is like 3 month till summer break
 
9:03 AM
hi @tereško - and which question?
 
the last one :
> can you maybe give me some input ? my scientific question for my bachelor thesis is "how can php be used stateful" .. i've no idea where to start ..
 
oh wow, I'll give a shit on anything bachelor from now on.
 
huh ?
that didn't come out in english
 
Guys with bachelor degrees go straight on into the ignore list.
 
you really pay attention to the degrees ?
 
9:08 AM
I personally normally don't, however I was not aware that it's that bad.
 
most people with two interacting brain cells give the interview candidates a programming exercise
oh .. but it is bad
about 90% of people with BCS are clueless and cannot themselves install windows
 
What's wrong with BSC degrees?
 
wrong .. nothing
@UserSmurph , the problem is that most of people manage to skip the learning part
 
I'll be honest here, I'm studying a BSC in computing and it would be remarkably easy to do nothing and get away with it
 
multitasking can be hard .. here is booze and different drugs and parties and dorms and then you have to manage to also find time for learning
 
9:17 AM
booze and parties did halt learning in first year, then money put and constraint on things in the second and now the third
 
naah .. we had the first year for "learning only" .. almost
then the fun begins
might be local tradition
 
yea seems so, in England first year is a haze of alcohol and clubs on the most part with 40% overall needed to progress
 
dunno .. it also might be because we had a very strange group of people
 
in my web directory I have a mysqli_connect.php which stores all my db login information, I've put it in the folder, 'includes' along with header/foot/style etc, is that safe?
yeah that is quite odd, where did you go to university?
 
.. trying to understand the "folder" sentence ...
@UserSmurph , no , it is not completely safe , but it might be the best option that you have a the moment
 
9:35 AM
ah cool. Folder sentence: everything to do with the site is stored in 'WWW' folder, inside that are two other folders 'images' and 'includes'. This is all being done on the university studentnet server so it isn't real. But if it was for a real client, would storing the mysqli_connect.php (where all the database info is (username, password, db_name etc) )in there be safe?
 
can you write to www/../ folder ?
 
as in WWW/includes/new_folder?
 
no
as in /var/www/asd09823/files/www/ and being able to write in /var/www/asd09823/files/
 
no, I only have permissions inside the WWW folder inside my uni_id
 
the risk with you current approach is that if webservers php module goes tits up , people will be able to read the source code
the www folder is something know as DOCUMENT_ROOT and it is a good practice to keep all your sensitive files out side of it
but , in your case, that might not be an option
 
9:40 AM
ah right okay, well when I make websites for clients purely through I'll be sure to keep sensitive folders/files outside, just using FTP with the uni at the moment, neglected my site for the time being and any web design work I've done previously was with frame works but I wanted to know how to do it all the code/script way, cheers
 
btw , frameworks have this too
they use public/ folder which is the document_root , where all the css and images and index.php is
and then they have folder framework/ or core/ or something , which is outside the public/
 
yeah thought they would, but what I meant was they set it all up for me so I didn't have to think about it, I could just play with the functionality and appearance. Was fun, but I'm finding the PHP far more interesting
 
9:59 AM
need to create some OAuth server... I'd rather create it from scratch.... any good articles?
should be fairly simple, right?
 
this is not gonna be helpful :
there is a spec .. read it : oauth.net/2
 
actually... I've been there.... but I just noticed the code section that they have. thanks lol
examples are always good, surely the site defining the spec can keep it simple.
first of all, I think I'll learn more about SSL lol
I don't know much about those at all =/
 
10:25 AM
http://www.mozilla.org/projects/security/pki/nss/ref/ssl/gtstd.html
seems legit
 
jay
hello
any one solve my prob
 
stackoverflow.com/a/9868986/727208 << that tounano gut seems sadly misguided
@jay , "does not work" isn't a valid exception/error message
 
function &get_instance()
how long has that been deprecated for?? lol
 
deprecated ? it is in the develop git branch
 
I mean function references in PHP
maybe I mistake it for somethign else
I might be mistaking it for pass by reference
 
10:38 AM
they are not deprecated .. they are just a bad practice
 
there was something along those lines that throws a deprecation notice in E_STRICT
actually... it's not in strict, you get a warning regardless
it's function foo(&$var) that I was thinking of
 
i think thats the case only if you do the $foo = & new Foo;
i think they use the load_class() as workaround for this php misstep
 
I think you're right
 
10:48 AM
why are the retards recommending Yii ?!?!
 
Yii for the Wiiiin ;)
Actually, I have no clue.
Probably Yii really (tm) is the best PHP framework ?
 
"Yii is an open source, object-oriented, high-performance component-based PHP web application framework. The name Yii (pronounced as Yee or [ji]) stands for easy, efficient and extensible."
 
i had to work with it for ~4 month .. so i can say with some authority on the subject: it is a turd
 
Actually what I hate about YII is to prefix classnames and interface that way. Shurg.
 
Inefficient and inexplicable?
 
10:51 AM
That's not extensible and far away from easy.
 
that's a stupid name imo lol
 
But I think you can still do cool stuff with it. I will try this year, one application I'll use is based on that framework.
 
I though acronyms were supposed to take the first letter of words used to describe it
 
11:33 AM
@NikiC Am I correct when I say that PHP should never segfault? So segfault == bug?
 
@PeeHaa no
 
@PeeHaa I consider any segfault a bug
 
e.g. recursion segfault isn't considered a bug :)
 
@NikiC I consider that a bug. It's an unfixable one (well, literally unfixable, it can be worked around)
 
11:37 AM
@ircmaxell @NikiC Besided the fact that this is obviously wrong. What is causing it here: codepad.org/aSNEovUX
 
@PeeHaa codepad.viper-7.com/V13txP It's a bug in their build
2
 
@PeeHaa Judging by the used codepad a mega-ultra-giga-old php version is the issue :)
 
@ircmaxell @NikiC tnx :)
 
Hello any one in this room
i want to send an .xml file on server...
i m using this... w3schools.com/php/…
i am able to upload file but when i m doing last part "Saving uploaded file"...
i dont know where it is being stored...
I m having problem with "move_uploaded_file()"
 
@tereško: hello will you pls see my proble
 
well .. @VaibhavVajani , the root of your problem is that you are using an archaic "tutorial" page
you could start by reading w3fools.com
 
@tereško: but i dont know about php more and i m android dev.
 
12:21 PM
@VaibhavVajani , you could start with phpro.org/manual/features.file-upload.html
but what do you mean by "i dont know where it is being stored" ?
that's in the $_FILES variable
you should just make var_dump( $_FILES ); and see what it contains
 
@tereško: in last while it is saving where would be the location of "upload/" folder and it is storing 0 bytes while at the time of the temporary file is created it is of 855 kb.
 
what are the permission on the upload/ folder ?
can webserver's user write to it ?
 
@tereško: no i have skipped that part... all can write here..
 
are you sure ?
whats in your move_uploaded_file() line ?
 
@tereško: ya sure... and the same lines written on "w3schools.com" i m using...
i dont know where the "upload/" folder will be created?
 
12:32 PM
which line ?
and why would be upload folder created ?
when is asked you if upload/ folder is writable , you said that everyone can write in it
not you are saying that you do not even have said folder
please .. concentrate
 
@tereesko: ya but i thought that it will be created by itself.
if it doesnt exist
 
it's only created through mkdir in php
 
@ChristopherKenney: ok i m using wamp server..!!
can i do it manually
 
yes, go into C:/wamp/www/ to find where you're scripts are and create it like you would any other folder
 
.. i better not comment on subject of WAMP
 
12:39 PM
you mean the fact that it's just apache in another form?
 
/me has a funny regex segfault...
 
1:04 PM
@tereško when creating a table (inside MYSQL DB) is it necessary to INDEX the columns for an E-Com site?
 
1:16 PM
@VaibhavVajani create it yourself, but always use $SERVER[DOCUMENT_ROOT] as the root of your application, cause it'll probably give you a problem on the production server
 
don't worry, stupid q (from me ^^)
 
@UserSmurph , it is always necessary to index columns
you just need to know which ones
get this book @UserSmurph . i dont here if you buy it or steal it , just get it
and read it
 
and this is a book which shouldn't be burnt right?
I can see the necessity for INDEXing columns for faster searching, but for a site that is only a dummy and just needs to work, it won't be detrimental will it?
 
1:45 PM
@UserSmurph it's needed...the more you use it in practice, the more you'll be able to use it in real applications
 
@CarrieKendall I flagged that one even.
 
@hakre good call. it looked like he let his cat type half of the 'question'
 
cheers :) @user705339
 
1:53 PM
@UserSmurph It can be. Don't add indexes willy nilly, they can hurt performance in some cases
 
ah that's reassuring, I just forgot to add them in the first table so didn't add them into my other four. it's simply a dummy e-com site that'll be used to test functionality by one person, so no strain on the server
 
> Old is not a bad thing when talking about librarys. Never touch a running system. The post that expresses the desire to remove ext/mysql is nearly two years old and I don't see that they even extended the documention with PDO examples.
this is why we cannot have nice things
 
link?
 
Hi all, @UserSmurph I would read up on databases. An e-commerce site won't be simple. If you don't know which fields to index then you probably won't be designing the tables for your site in a good way. Getting the DB right makes the code that uses it easier IMO.
 
2:11 PM
@tereško one of the stupidest things i have heard on SO
 
Commented
 
Hey all
What would cause this:
> Warning: preg_match(): Unknown modifier '[' in
 
he's that asshole that still runs IE6 :P
 
All I am doing is this:
preg_match("/^[0-9]+ orders / [1-9][0-9]* sec$/", 'drd');
 
@Neal you need to escape the / delimiter in the middle...
 
2:18 PM
@ircmaxell Hmmmm how do I do that when I am getting the expression from the database?
@ircmaxell :
            $fullExpressionCheck = "/^{$expressions[$thisLimitType[($i-1)]]}$/";
            $goodEntry = preg_match($fullExpressionCheck, $values['value' . $i]);
 
don't use / as a delimiter
 
@ircmaxell ?
I did not create the regexs
 
$regex = "(^" . $internalRegex . "$)";
 
I am getting them from the db
@ircmaxell Ahhh one sec
 
why not get the fully delimited regex from the DB? Why assume your own delimiters?
 
2:19 PM
@ircmaxell not sure, not my idea...
powers that be
 
@Neal preg_quote
 
Do it right, or don't do it at all
@Paul No, because that will escape all meta-characters
 
@ircmaxell Yes, this works, thank you :-)
 
@ircmaxell oh, i see yes.
 
@ircmaxell Why does it work with (? you can use any type of delimeter?
(I dont know much abt regex)
 
2:23 PM
@Neal Then learn
 
ehhh
Ill think abt it
 
$r = round(($c >> 16) & 0xFF); produces a float. Why?
 
@Christian Because round produces a float
> float round ( float $val [, int $precision = 0 [, int $mode = PHP_ROUND_HALF_UP ]] )
 
OK, that's....unusual
 
why?
 
2:29 PM
I mean... I was expecting the result value to not have a fractional part.
 
it's perfectly documented. And it supports round(1.22, 1) == 1.2
 
OK, wait. rewrite "produces a float" with "produces a value of 66.8"
 
Well, is $c an integer?
 
Yes, why?
 
then why are you using round?
 
2:33 PM
((115 >> 16) & 0xFF) => 66.8 ... I need 67
oh fk
I'm a total idiot...
 
HUH?
 
$r = round(($c >> 16) & 0xFF); // red
// ...
$r = $w/$h; // ratio (duh!)
// ...
echo "rgb($r, $g, $b)";
 
lol
 
lesson learned? or still in favor of tiny variable names?
 
@ircmaxell ok, I'm human too.
@Paul For a 30 liner? Sure am.
 
2:37 PM
LOL i think you scared Basti away with your logic @ircmaxell
 
You did :-P
 
Basti? Who/what is Basti?
 
3
A: Mysql Multiple PHP Queries, Skipped

tereškoYou do not need to make 3 queries, if you are updating the same rows: $q = " UPDATE table SET field = '', field2 = '', field3 = 0 WHERE Id = :id "; $statement = $pdo->prepare( $q ); $statement->bindParam(':id', $something, PDO::PARAM_INT); $statement->exec...

 
it is a creature ignorant of web technologies and how they work
 
posted on March 26, 2012 by Daniel Krook

Tomorrow night we’ll again host Edward Kietlinski at New York PHP. He’ll talk about the latest offerings from Zend to bring your PHP applications to their developer cloud. Soon, you’ll also be able to deploy your production-ready applications to the IBM SmartCloud. RSVP now for Tuesday night’s meeting at IBM in midtown Manhattan. Or, if [...]

 
2:41 PM
@Christian Fair enough, 30 lines is a pretty decent length method for me.
 
dunno dunno
 
@CarrieKendall Hmm. Still didn't catch the joke, sorry. Perhaps I came in too late...
 
did you read the comments?
 
@Paul , i would say that , unless it is a specific and monolithic algorithm , you should not have more then 6-8 lines which do "the work"
 
@CarrieKendall TLDR, at work atm :(. Maybe later on when I'm at home.
 
2:44 PM
30 lines means, that either you are doing homework in CS , or you it should be split in several sub-routines
 
@tereško Yes, I'm saying 30 lines is on the long side for me.
 
@tereško Uhm, it's a small script we needed to resize a load of images automatically. Not hw.
Arguably, I could squeeze it all in one line, but I see no point...
 
hw as in height-width or as in hardware ?
 
lol, squeezing it one line 400 characters long doesn't have a point, you are correct.
 
as in homework....you mentioned it..
 
2:46 PM
and i am not talking about one-line challenge in qbasic
 
@tereško :D
 
@Christian so you are saying that your mega-method dos not have logical parts ?
 
@tereško mega-method? I'm just saying it doesn't need to be modular. It's a temporary script that I'll put in the "archive" folder as soon as its done resizing.
 
@tereško I agree long methods generally hurt readability, but if something just happens to take quite a few lines to achieve... splitting for the sake of splitting doesn't end up with a net gain.
i have one 110 line method, but its goal is one thing (maybe 85 if i took out whitespace and comments)
 

« first day (527 days earlier)      last day (4435 days later) »