« first day (657 days earlier)      last day (4288 days later) » 

3:00 PM
@vamsi Pretty bad!
 
oh boy ..loving this ant build
 
Whats better to use when using for loop and checking for array length? Count or sizeof?
 
@salathe : I am stuck at 1476 and I am not following new users unless they are very interesting to me .. I actually want to clean up my account once
 
@John > sizeof — Alias of count()
 
any one using zsh instead of bash ?
is it any good ?
 
3:10 PM
I'd say count() is more often used
 
@vamsi i used to use it...i liked it. only reason i don't use it now is cause it's not installed here at work, and i don't care enough to bug the boss to get it installed
 
3:34 PM
why should we use $_SESSION instead of $_POST in the login authentication page
or
is $_POST used in login authntication and $_SESSION used in fetching other datas from database
 
@blackbee ????
Needs more context.
 
ok. just tell me when to use $_POST and when to use $_SESSION
 
@blackbee $_POST is used when the user POSTs data from a form using a front webpage
 
and $_SESSION
?
 
@blackbee SESSIONs are variables kept in the server-side and are initiated by the author
Namely, you.
You can set a session when the login has succeeded, which would tell PHP that the user has logged in succesfully
PHP gives each user a unique ID in the form of a cookie (or a GET variable)
The client then returns the unique ID with every request, which allows PHP to match it against a database of some sort to fetch all session variables that user has.
 
3:40 PM
i.e. if i am making a login validation php script then i have to use $_POST always.....
 
@blackbee Yes, because that's where your data would come from.
You'll need to validate the POST information against the database (using prepared statements please), and get the results
In case the user had succeeded in logging in, you would set a $_SESSION variable to designate that user as logged in.
The session would persist until the user closes his browser window, or clears his cookies.
 
should i be using $_SESSION to fetch the data like.. $_SESSION['userid']=$row['useridd'];
 
@blackbee You're misunderstanding the concept.
Sessions are variables you set to persist between different iterations of the program
 
o o
 
Between requests
Data won't magically appear on them unless you set it.
 
3:46 PM
yups
 
@blackbee When a user logs in, he inputs his username and password into the form and sends
The information is sent as a POST request to PHP, which promptly generates a $_POST array
so far so good?
 
yes i am good upto this
then what haapens?
 
3
A: database like mysql to be used with php for my music site

TruthHost the music as files on the file-system, not as records in the database. The file-system is optimized for large chunks of data (known as files) while the database is optimized for tabular data. The solution is to store it in the filesystem, grouped by letters in directories, and store the lin...

T_T Now I get upvotes
@blackbee Well, after that, you take the data, and compare it against your database
 
t=is it like the username and id is redirectd to the users profile page?
 
Username for username, hashed password against hashed password
 
3:49 PM
okz
 
@blackbee Assuming everything matched and we're all good, the user has logged in succesfully
In which case, you will set a $_SESSION variable to designate him as logged in
 
yes i have completed upto that
 
Usually with his user ID
 
So in that case, you do $_SESSION["id"] = $id_as_fetched_from_database
Then, in a different page, you can check if that session variable exists, to determine if the user is logged in or not.
 
3:52 PM
got it
 
@deceze Whoops :)
 
@Truth Aaaaawwwwww
 
@deceze He's lucky, I left him with the directories
 
@webbearrto won't like it, he didn't get the chance to play with it yesterday either. ;)
 
@deceze heh
 
3:55 PM
@deceze someone beat me to it this time :P
 
ok i was learning the mysqli prepared statement...
in the old version of php we used to write
$dbc=new mysqli(db_host,db_user,db_password,db_name);
and its now replaced by
$dbc=new mysqli(............)
and
$stmt = $dbc->prepare("SELECT * FROM REGISTRY where name = ?");
 
@Truth Why is the first reaction to try deleting stuff (I did the same). Could have farmed all the passwords and crap off his machine instead, but no, we delete the file that allows us to do it.
 
@Leigh =)
 
You can try again tomorrow, I'm sure... :3
 
@Leigh If it returns again, we'll do just that
I can already see the SO question
 
3:57 PM
It was down for 3 days last time before I got rid of the browser tab :p
I think the ignite.io guy has given up fixing the issues.
 
"I'm making a PHP codepad site but my files keep getting deleted?!"
 
^ I'm really waiting for that... ^_^
 
I found another one last weekend
sandbox.onlinephpfunctions.com - This, I managed to make it zip up it's own source, base64_encode it, then output it to the console.
 
but how to use the fetch execute and the alternative for
if((mysqli_num_rows($result1)==0) to see wether an username already exists
knock knock
 
@Leigh I see you're having a lot of fun :)
 
4:05 PM
@Leigh I can't seem to do it, glob was disabled in this one :P
 
@Truth Sure, glob() is, but glob:// isn't ;)
 
$dbc= mysqli_connect(db_host,db_user,db_password,db_name);
and its now replaced by
$dbc=new mysqli(............)
and
$query = $dbc->prepare("SELECT * FROM REGISTRY where name = ?");
but how to use the fetch execute and the alternative for
if((mysqli_num_rows($result1)==0) to see wether an username already exists
 
@NikiC I'm a horrible person who mainly finds joy in the misfortune of others.
 
@Leigh I can only see [...]
 
who doesn't? :P
 
4:08 PM
$it = new DirectoryIterator("glob://*");
foreach($it as $f) {
    printf("%s\n", $f->getFilename());
}
 
@Truth glob://../*
 
@Truth is the submit button gone? :p
oh, no
 
@Truth 3.... 2.... 1....
 
Probably the author solved the problem by creating a cron job that automatically sets up the codepad again once it is deleted :)
 
4:11 PM
Obvious solution.
Wouldn't do it any other way.
 
And this time, don't delete it! Instead run some spam bot or some other useful thing :P
 
Let's see, there are no database constants in his code
get_defined_constants does not lie
 
everything lies!
 
How would we get his username and password to log into the database? :P
 
He has a database?
 
4:15 PM
what's going on?
 
@ircmaxell phpcodepad.com
0 security website
 
you find by scanning all php files and looking for \$d(?:db|database)_?(?:name|table|host|pw|password|user) :)
 
@Truth 0 is an overstatement
 
@orourkek you think it's a -15 security website?
Or rather -INF ^^
 
4:17 PM
Sort of :P
 
I would use something like github.com/facebook/phpsh
 
If there ever could be such a thing as negative security, this site would be it
 
@ircmaxell Do you have a moment you can help me turn something into an iterator?
                $queue = array();
                array_push($queue, $this->root);
                while (!empty($queue)) {
                    /**
                     * @var BinaryNode $node
                     */
                    $node = array_pop($queue);

                    $left = $node->getLeft();
                    $right = $node->getRight();
                    if ($left !== NULL) {
                        array_push($queue, $left);
                    }
                    $callback($node->getValue());
I believe that's a non-recursive in-order traversal.
Implementation might be slightly off.
Was hard for my mind to do it in a non-recursive way.
 
> Notice: Few Functions are not allowed. Please remove from script.
 
so you want to go callback -> iterator?
 
4:20 PM
@NikiC Yes.
 
@LeviMorrison Wish you luck with that :P
 
Well at least he disabled fopen lol
 
@NikiC Generators would make this simple:
 
@Truth "disabled"
 
                $queue = array();
                array_push($queue, $this->root);
                while (!empty($queue)) {
                    /**
                     * @var BinaryNode $node
                     */
                    $node = array_pop($queue);

                    $left = $node->getLeft();
                    $right = $node->getRight();
                    if ($left !== NULL) {
                        array_push($queue, $left);
                    }
                    yield $node->getValue();
 
4:21 PM
@Truth Did you try something like $name = "f" . "open"; $name()?
 
I have to go home now, but let me leave you with this....

include $_FILES['uploadedfile']['tmp_name']; // this works
 
@LeviMorrison add yield :-P
 
@ircmaxell lol
 
@NikiC still not allowed :P
 
If only . . .
This seems like it should be possible.
 
4:23 PM
@Truth you can upload files
 
What are you iterating on?
 
@LeviMorrison Also this is something that would really play nice with yield delegation. Then you could implement a fast and simple recursive variant
 
@Leigh I saw, working on it :D
 
@Truth I found a way around his eval() block :]
 
@Truth what is the error message?
 
4:23 PM
Notice:
Few Functions are not allowed. Please remove from script.
 
> Parse error: syntax error, unexpected $end in /home/phppad/public_html/phpcode.php(58)
^when I run an eval()
 
@NikiC Well, I'd use a recursive version if PHP's recursion is better than using an array for the stack instead. I suspect it is not.
 
@LeviMorrison Sure :) And iterators need be non-recursive. But with yield-delegation you could make this really efficient and simple. (Assuming that it really delegates, not the half-assed implementation that they did for Python)
 
@ircmaxell It's an AvlTree implementation that I'm still fixing up. I have a bug when removing an item with two children, but otherwise finished in that regard.
Just trying to make an iterator in one pass.
 
A binary tree traversal would basically look like this:
public function getIterator() {
    if ($this->left) yield* $this->left;
    yield $this->value;
    if ($this->right) yield* $this->right;
}
 
4:27 PM
@NikiC Not really, since that won't go down the tree...
 
I guess I don't understand the yield*.
 
@ircmaxell it does ;)
 
the yield* syntax?
 
@LeviMorrison In that context it would just delegate to the $this->left iterator ;)
so it will yield all elements of the whole left tree there, recursively
 
He blocked most functions now :P
glob etc doesn't work anymore
 
4:30 PM
Is breaking phpcodepad the daily gearcheck?
 
But in any case, I haven't yet managed to implement yield*. Really hard to get right.
 
@Truth It also looks like he made some of the errors silent
 
Guys, it's still up! What's wrong? ;)
 
disabled unlink as well :D
 
What is there fun in hosting a PHP code test pad if he disables many functions one would try out? Then it'd be lot better if he just put a download of XAMPP or something there...
 
4:38 PM
$it = new DirectoryIterator("glob://../www/*");
foreach($it as $f) {
    printf("%s: %.1FK\n<br>", $f->getFilename(), $f->getSize()/1024);
}
$ul = "un";
$lin = "link";
eval("$ul"."$lin('template.html');");
Works :)
 
I just posted a question and got an upvote. ike... in two minutes... Someone must be lurking. :D
Disables glob, unlink, shell_exec and all but forgets to disable eval... legit.
 
@Whisperity seriously didn't disable eval, thats pretty funny
 
and once eval is gone, the next steps are preg_replace /e and assert :)
 
Photo Renamer: Site Under Maintenance
 
4:44 PM
Why doesn't one just quickboot an LAMP into a VM and let the user toy there?
 
@Event_Horizon he doesn't forget, he actually uses eval()
 
@webarto Isn't it just even worse that way?
 
@Whisperity this
 
Even if he disables eval, $ev = "ev" . "al"; $ev(...); still would work :P
 
@orourkek seems like a a way to introduce security problems when you allow for something like that in a language
 
4:48 PM
Depends who sets up the system
 
@Event_Horizon But in production we don't let our users to execute arbitrary PHP code, let alone put it on the filesystem...
 
@orourkek Actually, no ;) Eval is not a function. But there are other functions which call eval internally :)
 
<div id="msg">Site Under Maintenance</div> <- He can't even get HTML semantics right!
 
Site died for some reason
no css and/or no javascript?
 
@NikiC ah, well that strategy works with exec anyways
 
4:50 PM
Yeah, now it's all dead
 
that is because he doesn't use jQuery
 
but it was up for a few days... impressive, all things considered
 
@webarto I agree, if he used Jquery, the site would be up and working perfectly!
@orourkek and the title is "photo renamer" lol
 
@NikiC well look at that, learn something new every day
> Note: Because this is a language construct and not a function, it cannot be called using variable functions.
 
@orourkek Well knowing that will help me sleep with at least ONE of my eyes closed at night now.
 
Hmmm
How can I throw "events" and listen to them elsewhere in the code? Much like exceptions, only nothing happens if they aren't catch'ed
(I still want to be able to use exceptions though)
 
http://stackoverflow.com/questions/11799901/php-does-custom-exception-handler-require-try-catch
 
@rlemon More likely
 
5:03 PM
don't know if sirius...
 
like really - this question is not technical at all. fucking close that shit man. the 60K guys answering it should know better.
 
...and you're testing it with JavaScript turned off, right? — am not i am 2 mins ago
^ priceless
 
@orourkek And then OP replies am not... I am... admitting his failure
 
@NikiC @ircmaxell @rdlowrey In Order Binary Tree Iterator
Turns out there are academic papers on turning traversal stuff into iterators.
 
user895378
@Lusitanian Very strange. Send me some error output if you get a chance.
 
5:17 PM
@LeviMorrison Where do those docblocks come from? óÒ
 
user895378
lol @ phpStorm
 
I don't get such ugly docblocks
 
beautiful annotations
 
@NikiC Those docblocks are particularly ugly :)
Cleaned them up a bit.
 
5:25 PM
@tereško: i'm not talking about PHP specifically. MVC means getters and setters, and that's bad OOP, no matter if we're talking about Rails, whatever4j or Nything. — just somebody 25 mins ago
can someone explain thins one ?
 
MVC = getters/setters = bad oop?
 
MVC, get/set, OOP, aliens, conspiracies...
 
Ah, found one of his answers..
-9
A: PHP: A Personal Framework

just somebody MVC doesn't work you don't want to be constrained in the structure of your "modules"; also, keep templates close to the code (the templates directory is a bad idea) no re 1.: see Allen Holub's Holub on Patterns. briefly: MVC basically requires you to give up object oriented principles. Tell ...

 
5:30 PM
Bah, I have a bug in my in-order iterator :/
 
am going to develop an antivirus software in java language.For that i need to maintain a database of virus files in order to compare the files in pendrives with them.so am looking for a pack of virus files...can i get them?if so where??.. — murali 13 mins ago
Apparently Windows 8 got leaked.
 
@MikeB just somebody who doesn't know what he is talking about
 
@webarto His top tag for rep and interaction is PHP
71 PHP questions with total score of 82
 
He's just .
 
ehh .. why do i even try ?!
 
5:41 PM
@tereško Good answer. +1'd
 
/me +1
 
@tereško It's not the popular way to go.
 
> How design web app for scalability later when can't afforf now (and not yet needed)?
Afforf.
 
@Whisperity , now look at the "f" key on your keyboard
 
Anyways, I can only thank you guys. You can always serve something good to read. :)
 
5:45 PM
@tereško +1
 
PostOrderIterator turns out to be the hardest one to implement.
 
If this damn chair keeps failing, I'll be like him (^) very soon...
 
@rdlowrey i'll be home in a few hours and see what i can find out
 
> 3:26 the chair turns and is like "is that all you got?"
lol
 
user895378
5:57 PM
@Lusitanian Cool. Just make sure you pull the latest changes before you start -- API is still subject to change. Unfortunately I won't be around after this afternoon for social obligations, but it's a high priority for me.
 
@ircmaxell Somebody followed your advice and is reinventing a wheel... stackoverflow.com/questions/11800792/…
 
@rdlowrey alright, i'll ping you if i figure anything out
 
@rdlowrey Since you used the word 'obligation', I'm assuming it's not going to be a pleasant social experience?
 
user895378
@LeviMorrison Well -- it should be because a buddy is in town from Los Angeles. BUT he and his wife just had a baby and I'm sure it's going to be lots of talking about babies and how wonderful they are :)
 
6:02 PM
lol
 
Will there be more pictures of you holding a baby on g+?
 
user895378
It's possible. Along with my terror-stricken face when asked the requisite, "when are you going to settle down and get married and make babies -- you're going to be 30 in a few weeks" questions.
 
$ticketPost = new TicketPosts();

$n = $ticketPost->addReply(array(
		'tickets_id'  => $ticket->id,
        'body'        => $formData['body'],
        'staff_id'    => $this->currentUser->id,
        'mail'        => true,
        'attachments' => $attachments,
        'from'        => $formData['from'],
        'time_worked' => $time_worked)
	);

$n = (new Notifications)->createFromObject($n);
how wrong is my last line :D 1 - 10
 
@rdlowrey it's not that hard to say "whenever the hell i feel like it, if ever"
 
6:05 PM
@rdlowrey I highly endorse marriage, but I'm a firm believer in that you shouldn't rush into one. That leads to divorce, which is worse than being single. "It's better to have loved and lost than to have never loved at all" doesn't apply to divorce.
 
@rdlowrey 30 is the new 20, whatever that means :P
 
@LeviMorrison Its better to have pre-nupped and loved than to never have pre-nupped at all.
 
i am making an experimental website... where two strangers can chat with each other. he/she just has to enter an username and password and then he/she will be connected to any stranger based on an algorithm......
but at a signle point of time one user can chat with only (one)another user... he/she needs to leave the chat in order to attend another unknown user... but the problem is how do i know that which two users are connected with each other at that point of time so that he cannot recieve or send another chat request
 
sessions
 
@blackbee that's a strange use of the word "experimental"
 
6:13 PM
lmao
 
@blackbee 1. What webarto said. 2. The answer to this is more elaboratable (is there such a word?) on the main site.
 
@SomeKittens by "experimental" did you mean "chatroullette"?
 
or any of the many other clones
 
experimental in the sense
iwill be using a free domain hosting... this will be my first website
just any idea will be good enuogh.....
and i am not interested in cloning
 
6:17 PM
I think a chat interface for your first site might be a bit ambitious. But what do I know, I haven't tried making one, could be easy as chocolate pie.
 
@Event_Horizon Hi, I'm Clippy. It looks like you're trying to reinvent Chatroullette. ?
2
 
:D
 
@Event_Horizon it's a PITA to do videochat
 
@Lusitanian without video though it might not be horrible
 
@Event_Horizon jQuery you know
 
6:18 PM
@webarto I wouldn't be surprised :P
 
choclate-pie??
 
yeah chocolate pie
its just chocolate pudding in a pie crust and thrown in the fridge for a few hours
 
@Event_Horizon mmmmmm
 
@Nick Its definitely good
 
@Event_Horizon It's more then that and you know it, it fills the empty inside :)
 
6:20 PM
@webarto lol
couldn't help yourself eh?
 
that was not realtime, you need to set 100ms to be realtime, instead of 1s...
 
@CreatorOfPhpIterators: Why couldn't you just do hasNext and next like Java? Binary Search Tree iterators are so much easier that way than the PHP way. . .
 
What if 1ms? Killmyserver...
 
please help me nah...
 
for(;;){ $('#chat).load('chat.php'); }
much better
 
6:22 PM
i thought of it but could figure it out......
 
@Whisperity it needs to be dynamic you know
 
sorry, i could not figure it out. i decided that the chat would not be too complex with jquery coz i know only javascript not jquery. the apperance wud be much like this chat of stackoverflow... but with php. coud it be something like they will share some common session id....... or someting that i dont know
 
First, implement it in a way the users have to F5 to refresh the page. After everything is working, you can move on to implement dynamic refreshing.
 
use mooooo tools
 
i can do the dynamic refreshing.. but the fact is how do i understand which of the users are chatting.... because there can be people who are online but not chatting
 
6:29 PM
well, that is not a programming question, if you can't figure it out... google, read, read source...
 
google has an answer to everything which is not required. :D
what source do i read?
being at stackoverflow i feel i am at a bettter place thaan google
 
I'm suprised our chat room doesn't have any coding events
 
@blackbee we are not here to google for you
 
@blackbee you should still use google to find resources before asking questions regardless how you feel
 
no thats fine. i know to google......
 
6:33 PM
yes, your current question is too broad to be answered...
 
can't u give an idea of doing it
 
@blackbee if you googled it, you might have an idea
we aren't your research team
we are here to answer answerable questions, like "How do I iterate through an array in PHP?"
 
u are so cruel. u say the answer is tooo broad.... and then u say we are not research team..
ok then tell me this
 
when an user logs in he has a session_id.. done lyk $_SESSION[user_id]=$row['user_id];
 
6:36 PM
if you have a specific, answerable question, SO is the place. if you want something designed, i charge $100/hour. 3 hour minimum.
 
Is there a case against using "Ambassador" in naming?
 
?
 
is this possible
that when an user selects go to chat. he will have another session id. and the other person chaating with him will have the same session id........ and as long as the session id is not destroyed by clickoong leave chat. he caanot acess anything on the profile page
 
i doubt it's a keyword in any language worth using, so have fun :)
 
6:39 PM
@blackbee anything is possible ;)
 
assuming it's descriptive of the thingie's purpose of course
 
@cHao that's my debate right now. The best fit is SessionHandler, but that already has meanings
 
@Event_Horizon Yeah, go RTFM for that. How to iterate over a BST? Not so easy . . .
 
@orourkek i kinda have a thing against stuff with names like "handler", "manager", etc
 
one of the reasons I'm trying to think of something better ^
 
6:42 PM
SessionStorageProvider
 
So now that you got a bunch of downvotes for a question that show no research on your part, you want others to delete the answers they tried to help you with. ....right.... — Event_Horizon 40 secs ago
 
without knowing what it does
 
@LeviMorrison I wasn't talking about BST though, I'm sure thats a pain in the neck
I gotta say, the one, one thing I like about no-bracket languages, you can stick your comments where you'd stick your brackets :P
 
"Steward" is actually very accurate to the functionality
 
@Lusitanian I'm so excited! Its gonna be the whitest webpage EVER! wait.... — Event_Horizon 1 min ago
 
and the guy who posted that has almost lost all his rep
 
Has anyone really been far even as decided to use even go want to do look more like?
 
@Steve Only if has been farther than sun rise can town.
 
@Event_Horizon ty
 
Yo, omaetachi.
 
6:50 PM
@Truth Yo, kimi.
 
@deceze Kami*
 
that question's closed now, if someone wants to vote for deletion
 
@Truth Kamo*
 
Areyua "Shinri" Areyua "Zen" Areyua "Sekai" Areyua "Ichi"
 
Welp my 10 rep from dumbest question of the day is gonna be gone. I knew you well 10 rep, RIP.
 
6:52 PM
lol
 
Nanka, shiranai to omou. Nanssuka sore?
 
He got -20 rep from that question.
Onamae wa?
Ogenki desu ka?
and thats all I remember of Japanese
 
A, dōmo. Genki desu.
 
< buys everything Japanese, can't say hello on Japanese
 
He even changes his username to Please delete me. :(
 
6:54 PM
well, he shouldn't post stupid question but RTFM... and lots of try/fail attempts...
 
I don't even remember the meanings, I think Onamae wa is whats your name, and Ogenki desu ka is how are you
 
@webarto i agree...but damn...i'm starting to feel for him. at least the question will hopefully be deleted soon and he'll get his rep back
though he apparently doesn't want it anymore
still, that's someone that probably won't bother coming to SO again
 
I also lost 22 reputation the other day because one question I answered and edited got eaten by Dave Null.
 
I gotta be honest, if you put too much worth into rep to where you get upset enough to delete your account, you probably need some help.
Especially when you are low rep, because it doesn't take much to earn it back.
 
> dave/null
 
6:58 PM
Seriously, who needs rep anyway... 8-)
Done coding for the day. ^_^
 
Gonna go drink a beer in the garden~
 
haha, lucky you
 
@webarto whats that from
 
@webarto Kill it. Kill it with fire before it lays eggs.
 
6:59 PM
I'm trolling :D
 
what, developing a trolling framework to piss off all of php community
 

« first day (657 days earlier)      last day (4288 days later) »