« first day (544 days earlier)      last day (4395 days later) » 

4:00 PM
nothing :(
and I can't even find a sample php.ini online
 
@rdlowrey I was having a look at it. It looks complicated. I wouldn't be able to do it if I tried.
 
and I don't want to use my windows php.ini, that would just be evil
 
user895378
yeah you could ... it's pretty basic if you already know what's happening :)
 
@BenjaminBrizzi there should be some php.ini in the downloaded tar
 
user895378
@Paul Anyway, I've got (what seems to be) a working implementation already. I'm going to post a quick gist summarizing how the functionality works (as compared to the current method) so I can get yours and @LeviMorrison's comments.
 
4:02 PM
@rdlowrey It's what I did las time with s/dll/so but I'm looking for a cleaner alternative
nothing in the tar =/ maybe I just got a bad tar
 
user895378
@Paul Just gimme a few minutes to do that gist -- don't go to sleep!
 
@rdlowrey Wow, nice work. hehe, yes this will be my bedtime reading material.
 
@ircmaxell How many views are you at? I came across the article on both reddit and HN
 
@BenjaminBrizzi what version of php did you download?
 
oops misclick
5.3.9
from php.net iirc
@RepWhoringPeeHaa Don't sweat it, I'll use an old php.ini I probably have lying around
 
4:06 PM
@BenjaminBrizzi I know that for 5.3.10 there is an php.ini-development and an php.ini-production in the tar
lemme check 5.3.9
 
@rdlowrey . . . and I'm back.
 
user895378
@LeviMorrison Okay, I decided to put my thoughts in a gist instead of pushing them out all disjointed in chat. I'll ping you with a URL in a few.
 
@BenjaminBrizzi those files are also in 5.3.9 tarball.
@BenjaminBrizzi you did a updatedb right?
 
@RepWhoringPeeHaa Nope :Q Don't even know what that does
Sorry I'm a bit of a Linux noob
ah it's for locate
 
@BenjaminBrizzi It reindexes the files for the search table :-)
@BenjaminBrizzi It's ok you have to start somewhere
 
4:15 PM
@RepWhoringPeeHaa Just did it but no other results
 
@BenjaminBrizzi what do you see when you do: ls -la /location/of/unpacked/tarball | grep php.ini?
 
@rdlowrey By the way, I've decided I don't like having multiple exceptions for HttpException.
We should just use the HTTP status for the error code
throw new HttpException('Bad Request: You must supply a username in your request', 400);
throw new HttpException('Not Found', 404);
throw new HttpException('Service Unavailable: Down for maintainence', 503);
 
user895378
@LeviMorrison and @Paul -- here's the summary gist. Please let me know if you have comments, questions or concerns on the contents: gist.github.com/2368812
 
user895378
@LeviMorrison Ooh good call
 
user895378
That's smart
 
4:28 PM
@rdlowrey It allows for custom handling of each error code, but you can easily do generic handlers for everything.
 
user895378
@LeviMorrison Yeah I really like that.
 
@rdlowrey Looking at it now, it takes a lot of concentration at this hour, so far so good.
 
catch (HttpException $e) {
    header("HTTP/1.1 {$e->getCode()} {$e->getMessage()}");
}
@rdlowrey Commented on gist.
 
user895378
Getting called out for close-voting in a SO question is like playing an online shooter where a n00b calls you a h4x0r because you're stomping everyone. It feels like an achievement :)
 
lol
afk
 
4:32 PM
@RepWhoringPeeHaa I'm a retard, it's right there ><
@RepWhoringPeeHaa I hate myself right now
@RepWhoringPeeHaa I LOOKED FOR IT though, FOR HALF AN HOUR
@RepWhoringPeeHaa I think it's a sign that I need to go home
 
@rdlowrey That looks perfect. I can't see anything wrong with it right now.
 
umm.. guys
anyone good with phpunit?
 
So, geniuses ... cl.ly/FmQW <-- what does this do?
 
any way to mock a class behaviour?
 
user895378
@ArtjomKurapov $this->getMock('MyClass');
 
4:38 PM
i think it worked previously.. but now it just generates a mock object and thats it
yeah.. that doesnt actually make MyClass
 
user895378
there's several other things you can specify with additional params to the getMock method
 
$class = $this->getMock('zzMock', array('z'), array(), 'zz');
$class->expects($this->any())->method('z')->will($this->returnValue('2'));
this does make $class as a object..
and so on
 
Is there some handy SQL function to calculate if, for example 23:00 -> 04:00 is in 2 calendar days, or one...
 
but i need zz class defined globally
with described behaviour
with 4th param it does make actual zz class
but its empty
 
user895378
not sure, don't really have time to look hard at it right now :/
 
4:40 PM
ok, nevermind
 
goodnight all
 
user895378
@Paul 'night
 
@BenjaminBrizzi :-)
 
user895378
@LeviMorrison Return commented -- will be in and out around the computer for the next four or five hours for delayed responses.
 
There really should be starring privileges. We've had a lot of newer people in here lately starring garbage stuff. I'm glad they are here, we can help them with their code, but it's annoying having n00b messages starred.
 
4:46 PM
@BenjaminBrizzi about 38k
 
can you guys plz follow me twitter.com/richwestcoast pretty plzzz
 
@mUnk3y Why?
 
dafuq did I just read here
 
need more followers
just another 5 will do
so it can balance out how many i follow
 
Can you, politely, screw yourself?
 
4:47 PM
the reason to do that is? out of curiosity :)
 
so i look like a more balanced person to my already-followers
 
You don't really tweet anything useful.
 
I will start
 
I have 51 followers.
Which means nothing to me.
 
WHAT!
what is ur username
 
4:49 PM
@googleitplz
This is incredibly off-topic.
 
ok at ease soldier
 
no, Chris, he's right, I'm unbalanced too :D
48 Tweets 52 Following 44 Followers
 
anyway im gonna start a mission to get 1,000,000 followers before midnight
wish me well
 
@webarto do you tweet anything useful?
 
I don't tweet anything really, those are 2yrs old tweets, while I was testing some application for Debian Conference...
 
4:52 PM
@mUnk3y With a simple cURL script you get around 2000 followers within a day or so. Well, that's what I got with my experiment.
I got around 700 tweets
lol
 
for writing a script?
or for hacking tiwtter
 
I don't hack anything.
 
whats the script?
show it to me!
 
Also, it was an experiment and obviously I don't use my own account for that.
google twitter curl follower
 
@rdlowrey All objects can be traversed, it just goes over their properties. I guess in theory you could allow any object and traverse its properties as the name/value parameters. But since StdClass is created via casting an array to an object, it makes sense to explicitly list it as Traversable.
 
4:54 PM
But I warn you, if you do this .. you end in my and a lot of other's block list.
 
na its fine
this is not highschool
i want followers to know what i am doing
at all times
 
Mostly your going to get followed by bots
who dont care for what your doing
 
T_T
 
Your a tool, your what keeps this machine going.
Your like me, but less worth.
 
ok i gtg real-life is calling
lataz
 
4:57 PM
IT WORKED!
 
i hope someone makes social network that makes you pay for your posts
 
I got rid of him by emotionally manipulating him into thinking he's not that important!
WOO
 
hi all!
 
I hope the government monetizes air ..
so we'd have to pay to breathe.
 
well it already did.. did you hear about Kioto protocol?
 
4:59 PM
Nope
 
:) well there was reasearch to find out if cow poop violates it.. so that countries would pay for it
 
I live with cows, they look so dumb it's almost cute.
mooing from day to day, ahh, I wish my life would be that easy.
 
0
Q: How to call MessageBox with GetProcAddress function?

user1131997I want to call MessageBox() function in such way: 1). load needed library 2). get the function address 3). call it So, for such aim as I understand, I should define new type with all types of arguments in MessageBox function. It returnes INT and accepts: HWND, LPCSTR, LPCSTR, UNIT. So I regis...

 
its just that number of cows, chickens, dogs and cats are same as number of people.. so everything gets more polluted
 
Good.
I like that.
 
5:03 PM
umm @user1131997 you do realize that its not chat about C, right?
 
Sorry but if the country won't care of it's people, I won't care for the country.
 
though HWND brings lots of memories..
@Chris yes, when nobody cares, thats called entropy
 
Personally, I'd actually enjoy anarchy.
A nice change perhaps.
 
lol
 
travel to Congo :)
 
5:07 PM
Will I need weapons there?
Or will fist fighting suffice?
 
weapons are needed
bodyguards too.
 
against yellow fever.. i doubt that
 
I'm guilty of pulling this chat off-topic from time to time, but this is a rather useless conversation. Can we come back in line, please?
 
If your suffering a deadly decease and do not want to die from it the only solution is to kill yourself before the decease does = win.
3
 
@LeviMorrison what do you have in mind?
 
5:09 PM
wow, that's pretty far out there
 
well I could stretch yellow fever to lack of unit tests :)
 
@ArtjomKurapov I'd rather hear PHP sucks than this stuff.
 
Zend is an awesome framework.
 
and anarchy to code devoid of SQL injection protection
@LeviMorrison yes, php sucks in Congo :)
have you seen North Korean websites?
 
@stevether I currently have opposite opinion.
 
5:13 PM
Good, we're back on topic.
 
@stevether yes it is :)
 
@EddieJaoude how can refresh the data displayed in a page with the data retrieved from a query?
I'm developing quiz app the data has to refreshed when the submit button is hit I know that static values can be obtained using "name",but how do I GET dynamic data?
 
:S
 
@webatro can u guide me ?
 
Yes Officer, I'd like to report a siting of the notorious help vampire. He seems to be mentioning anyone who speaks in chat O.O
 
5:23 PM
 
hahaha best comment of the day: "Interesting, never knew that. Have a +1 for your troubles, you rep whore you..."
k going home. later
 
@din
@DineshVenkata can you give more info?
 
@EddieJaoude I'm displaying a question from the database and I'm able validate the answer now my problem is that I want to display new question in the place of the old one when the answer is correct
 
reload the page & display the next question in the sequence. Or do you want to do it without reloading the page i.e. ajax?
 
5:35 PM
I'm a newbie so I would prefer the former without ajax
 
user895378
I don't have time to answer this question, but it's good to encourage new users who ask good questions, so, if you get a chance, at least drop this guy an upvote:
 
sure, but I still dont see your issue, do you have the code on github / bitbucket?
 
user895378
There are a lot of theoretical questions, but it's a good first-time Q ^
 
I'm gonna put it up on pastie.org give me a minute
@EddieJaoude
here is my code@EddieJaoude pastie.org/3775467
 
5:40 PM
@rdlowrey @DineshVenkata-Can you slove this issue stackoverflow.com/questions/10051569/…
 
I would have loved to @arpit but sorry mate I'm a newbie myself don't really know that much
 
@DineshVenkata you need a post / get variable that states which question you are on
 
@ArpitSrivastava What's your problem?
 
then in the form have it incremented by 1
 
5:43 PM
Maybe I can help you.
 
can u give me a brief idea about the coding @EddieJaoude?
 
@DineshVenkata What do you need?
 
Actually I have to make select button when user select the language then code change the xml file to that desire language and give output
 
in your firrst select query you have id=1, is that because it is the first question?
 
Do you want to translate the entire XML file?
 
5:45 PM
yes @EddieJaoude
 
@Truth yes
 
Where do you get the translation from?
How would PHP know how to translate?
 
you can check my code working tv.spoti.com
 
@EddieJaoude I'm displaying the question at line 31
 
5:46 PM
now I want to add select button language button when user click on say es then xml changes to ?es and get that xml file which is already there
 
You want it live?
Without a page refresh?
 
No a refresh I want
 
in that query use something like ...id=$_POST['question']..., then in your form have a hidden field, <input type="hidden" value="<?php echo $_POST['question'] + 1; ?>" />
 
then only the li value chnage
 
@DineshVenkata you will need to do some validation once you have it working
 
5:48 PM
yea
 
@ArpitSrivastava Well, you'll need to set a session variable with the user's selection, and serve the XML file according to that.
@DineshVenkata What are you trying to do?
 
@truth I'm developing a quiz
 
If user select like FI then xml load to fi
 
app
I actually want a code snippet for refrshing the data on submit
 
@ArpitSrivastava Then you should submit a form when the user selects, and handle that to serve the correct XML file
@DineshVenkata What data are you refreshing?
 
5:50 PM
the question
from the database
 
Okay, where are you getting stuck?
 
yes I having select option button when user select the language automatically page refresh using Jquery and give the output
 
user895378
@LeviMorrison and @Paul the alternate Provider allowing scalar construction parameters now lives on the dev branch. I don't know yet if it should actually be adopted or not. In any case, it's there if you want to poke at it between now and next Sunday when I get back from vacation. I didn't bother writing/updating tests, so while I think it works in every situation, I can't make any promises :)
 
@DineshVenkata try what I said, it will take you to the next question on submit - you will just need to decide on how to handle incorrect answers
 
@ArpitSrivastava Like I said, submit a form with the correct value of the language the user chose (i.e. FI), and on PHP's side, use that $_GET/$_POST variable to serve the correct XML file to the user
 
5:52 PM
@EddieJaoude do I have to use input type text for that?
 
no, otherwise it will be displayed
 
Yes How It can be done can you give the code
 
@DineshVenkata Where are you getting stuck?
 
in the example I gave you it had type="hidden"
 
it would be great help
 
5:53 PM
I'm stuck at fetching new question when correct answer is selected
as in @EddieJaoude can't I use the the posted data in a variable
and echo it
@truth
 
@DineshVenkata how is your application structured?
 
Oh gosh
And I thought my code is bad
No offence, of course.
 
there are still people who don't use PDO?
 
@DineshVenkata use the posted data, then you can validate & harden the code later on. I suggest you get it working first
with the hidden field it will always increment to the next question on the submit
 
5:58 PM
Death to people using * in queries.
 
@EddieJaoude I didn't quite understand the line of code u suggested me can u please elaborate?
 
@LeviMorrison Okay, now it's less server intensive themis.myrayhawk.com/traceroute.php?1
 
<?php
    if (isset($_GET["language"])) {
        if (strlen($_GET["language"]) != 2) {
            //Validation, make sure value is what you expect.
            //In my case, check if the value only has 2 letters.
            //If not, discontinue.
            echo "Invalid language!";
        }
        else {
            somehow_serve_xml_with_language($_GET["language"]);
        }
    }
?>

<!--  Make sure action attribute submits to the page which has the resolve script -->
<form action="index.php" method="GET">
@ArpitSrivastava
This is a trimmed version, but you should understand what to do from here.
@DineshVenkata alright, I'm with you
 
@Truth ok I will try
 
Is there anything that can '23:15' - '18:00', and produce '05:15' :)
 
6:02 PM
So you're saying that you want to retrieve the next question if the question submitted was correct, yes?
 
change this line $qst = "SELECT is_right FROM mathbro WHERE _id=1"; to $qst = "SELECT is_right FROM mathbro WHERE _id=$_POST['question']"; // needs sanatising
 
and add this line to the form <input type="hidden" name="question" value="<?php echo $_POST['question'] + 1; ?>" />
 
@DineshVenkata for an application of this size and type, I would suggest you used MVC.
abstract your application, separate between content and logic.
 
6:03 PM
@Truth now I see... Prior to PHP 5.3.0, 24:00 was not a valid format and strtotime() returned FALSE... I was fixing some bugs, and they use 24... PHP 5.2
 
@truth you dont know the size. I wouldnt complicate it now
 
@EddieJaoude It doesn't matter what the size is. And MVC isn't complicating things if he's using a decent documented framework.
 
@DineshVenkata would be ideal, but there is a lot to learn on how to setup & use it. I would concentrate on getting it working first, then you could port it to an MVC framework if you wish - I recommend ZF
 
@DineshVenkata Anyway, think about it, read about it, understand it. Let's solve the more immediate problem.
How do you know what the current question is?
 
yea @EddieJaoude, @truth
 
6:05 PM
Are they ordered by numbers? By IDs in the database?
 
yes
@truth
 
Okay, so you know the current question number
 
yes as @EddieJaoude suggested
 
What's preventing you from fetching the $current+1th question from the database upon successful answer?
 
I don't know how to display the fetched question
 
6:08 PM
Your code makes it very hard to understand what each query stands for. Use good names to describe what each query does
I can't understand what's $qst and what's $qstr
nor what's $result and what's $res.
 
okay I will put up other code
 
Please.
@DineshVenkata also, how does your database look like?
 
it has table that has a question, 4 options and an is right option that has the id of the correct question
I know its not the best practice but I ca't think of anything other than that right now
 
question | answer1 | answer2 .... | correct_answer ?
something like that?
 
yes
I'm mapping the correct answer with the value of the radio buttons
 
6:13 PM
Okay, (this will hurt you in case you want n+1 answers on some specific question, but for now it's fine)
Okay great, do you have an ID for the questions?
 
I'm sure that I want only 4 options
yea @truth I have a field for id
that autoincrements
 
Okay, great
when you get the question, information, (the question and answers), you're also getting the ID
 
yes that is when I select * from my table
and use where
for id
 
Though I see that for some reason you've hardcoded _id = 1 in your query
 
yea I was just trying to get the first question
 
6:17 PM
Alright
 
u can suggest me a good approach to whole thing @truth
I'm an infant in PHP
 
Alright, this is how I would have done it
I would have users register with my service/site/application, and keep information about each user (they would have to log in to use the service)
 
@truth I want to just display questions and answers and validate them
 
On the Users table, along with the user's username and password, I would keep the current question ID the user is on
randomly?
Okay
define exactly what you are trying to do
plan ahead
that's the #1 rule of any project, or you will get stuck in the middle, probably having to rewrite some part of your code.
So please do tell me, what you want the application to do from head to bottom
 
I'm trying display a question with four options and then validate the answer and take the user to the next question if the answer is right
that is all about it
 
6:20 PM
Okay
How do you plan to keep track of users?
(Note I'm making this a bit difficult on purpose, these are REAL question a programmer would have to ask himself when making a project)
 
@truth I have not thought about all of that I just want to do the simple tasks I mentioned above
 
Alright then
 
I'm far from deploying it on www
I just want to get a feel of real PHP
coding
 
okay than, you should have said so from the beginning, that you're not planning a complete application, but just getting the feel :)
In which case, you want your query to reflect the current state, and display the next question if the user is correct
 
just getting the feel and I'm a student so kinda enthusiastic
would love to make this my academic project
 
6:24 PM
Are you familiar with basic programming concepts?
variables, loops, functions, making custom functions?
 
yea I'm pretty comfortable with OOP
 
:D
 
Okay
 
and I develop android apps also
 
I won't complicate things for you, I'll show you how to solve the problem at hand, then I'll give you points to read about/learn about to become better, okay? :P
 
6:26 PM
sure :)
 
Right now, the problem in your code is that no matter what question your user answered, and whether it was correct or not, you'll always get the first question
as the code says "Select the question whose ID is 1"
 
Okay
 
@truth that was
 
hi..
 
6:27 PM
dumb
 
any once can help me?
one *
 
u can suggest me better soultion
@truth
 
Of course :)
 
<?php
$users = $this->Session->read("user");
$varFName = $users['User']['first_name'];
$varLName = $users['User']['last_name'];
$message = "Hello,
I would like to invite you to Clicksays! ".$varFName." ".$varLName;
echo $this->Form->create('User', array('id' => 'sendEmailRequest', 'style'=>'padding : 0px;', 'url' => array('controller' => 'Contacts', 'action' => 'addEmailRequest')));
echo $this->Form->input('Email', array('id' => 'email', "size"=>"40"));
echo $this->Form->textarea("Message", array("type"=>"textarea", "id"=>"PreviewEmail", "style"=>"display:none;","rows"=>"5", "cols"=>"45", "
this php code..
requires an array..
can anyone explain the format..clearly..
 
On the first run, the server should have no information (as the user is new)
So it should display the first question.
 
6:28 PM
and should this be in the HTTP request body .. or in the header?
 
Setting a variable, either a SESSION variable, or on an input field to the number of the current question.
 
yea so should I directly echo it?
 
Then obviously echoing out the question and possible answers like you have it now
 
if anyone is answering to my ques...
do let me know..
thanks
 
can u give me code snippet @truth?
 
6:30 PM
Once the user selects an answer and submits it, the script would check if the answer is correct.
If it is correct, increment the $current_question variable by one, and display the new question
If it is incorrect, display the original question (without incrementing the variable), and display an error message
 
can u give me a snippet ?
 
You having fun @Truth ?
 
@Chris You have no idea :P
 
Hi everybody
 
lol
 
6:34 PM
@truth I'm confused about displaying the question please help me out
 
Someone know whats wrong with my regex to accept french accents and ', dots, ;, and more ? /^[a-z0-9\.\s\pL-_,\'\"\/]*$/i
 
@DineshVenkata I'm creating a snippet for you now, please hold on :)
 
sure :)
 
It doesn't work with ' and accents
 
Hey, I've a question. I got 2 php files and in lets say file1.php I have a variable which I want to use in file2.php. How can I do this?
 
6:44 PM
include "file1.php" in file2.php
 
include 'mod_slidepluslight.php'; like this?
 
@DineshVenkata pastie.org/3775869
I haven't tested it, so it may not work out of the box, but this is the principle
 
cool thank u will test it
 
I don't think this'll work, let me try my own implementation
 
@Chris because when I do it like this: include 'mod_slidepluslight.php'; in my file1.php my image stops showing in my slide show..
 
6:48 PM
@RepWhoringPeeHaa I like your SQL tutorial gist so far. I'd try to add this link to PHP docs about choosing a MySQL API...it directly mentions that MySQL is being long-term deprecated and may be something readers take more seriously than an older mailing list item. Otherwise I like the premise, can't wait till you get it finished.
 
@truth the code doesn't display anything except for the radio buttons
 
Makes sense
I had a mistake in my code
 
Helo guys, I need some help in figuring out what I need to do here: pastebin.com/Z9qLBjMh
I need to get get the url of the image for that particular node so I can share it out to pinterest. Problem is that one of my content types has three different image_styles and three different image_field names. This is for Drupal 7
 
Anybody got time to look at my code for a few mins ? :)
 
6:58 PM
Undefined variable: row on line the radio buttons
@truth
this is the error
 
Yes?
The error is that in case of it being the first run, no queries are run whatsoever, and nothing gets done
 
I had set the debugging mode on
 
Because all of the logic was placed in the else clause
 

« first day (544 days earlier)      last day (4395 days later) »