« first day (644 days earlier)      last day (4290 days later) » 
00:00 - 19:0019:00 - 00:00

12:12 AM
@rdlowrey I just wanted to 'test' out the client but didn't want to setup a bootstrap, etc, so I just put it in a test case. Didn't mean to commit it like that lol
 
12:55 AM
I have a PHP/JS simple question? Can I shoot?
 
1:32 AM
Don't ask just do
@gordonm u realize ie9 is xp compatible right
 
1:47 AM
I have a combo-box (HTML select), and a text-area. I want to change the content of the text-area when I change the value of the combo-box. I want to get the content from a data-base...
I'm thinking that what I need to do is execute a PHP function when the selected item has changed, but I (read that I) will need to use Ajax to do that... So my question is, is there an easier way to do that?
 
user895378
@LeviMorrison I ran across a quote in code complete as I was riding down the road that addresses your situation from earlier ... (typing on my phone, sorry in advance of any mistakes)
 
Sam
@RoronoaZoro although AJAX is the smoothest way to achieve your goal, it's not the only way; you can simply submit the form once the select option changes (via JS function or clicking a button); retrieve the data, and put it in the textarea
 
user895378
> the question you need to ask is, what does this stack, list or queue represent? If a stack represents a set of employees, treat the [abstract data type] as employees rather than as a stack ... If a queue represents cells in a spreadsheet, treat it as a collection of cells rather than a generic item in a queue. Treat yourself to the highest possible level of abstraction.
 
user895378
Further, creating a ResponseChain (or similar) instead of an array of Response objects allows the code to be self-documenting.
 
user895378
@LeviMorrison ^
 
2:01 AM
@rdlowrey Except in this case our container has no special properties . . . I guess you could think of them as having an order.
What's the best data structure to have an order? A traversable? Lol
 
user895378
> you don't even have I have a formidable data type to justify using an abstract data type. One of the [abstract data types] in the example list is a light that supports only two operations -- turning it on and turning it off ... Putting the light and its operations into an ADT makes the code more self-documenting and easier to change, confines the potential consequences of changes ... and reduces the amount of data you have to pass around
 
user895378
I'm not saying you should definitely make a custom type, just offering info because I thought it might be helpful :)
 
2:23 AM
1
Q: Kohana 3.2, ORM has_many, belongs_to relationship not reference correct key

gorelativeI have two tables named utilities, types that i am trying to access the other fields within types from the utilities view. e.g; $utilities->type->type; Utilities would have_one type and type would belong_to utility right? This is how i have it currently, and rather than referencing utilit...

 
 
2 hours later…
4:03 AM
anyone here
 
memememe
 
i have a query !!
	$order = $_POST['order'];
        echo "<font color='lime'>$order</font>";
        $query="UPDATE wp_message_board SET `order` = if (`order`< $order,$order,$order-1) WHERE dev_id = '$id' AND msgboard_id='$key' ";
        echo $query;
        $resorder = mysql_query($query,$con) or die("Error in Query for updating order");
	$query1 = "SET @i := 1";
        $resset = mysql_query($query1,$con) or die("Error in Query for setting ext var");
        $query2 = "UPDATE wp_message_board SET `order` = @i:=@i+1 where dev_id='$id' AND  is_deleted <> 1 AND
 
please use the fixed font button
on that
and stop using mysql_*
 
Please, don't use mysql_* functions to write new code. They are no longer maintained and the community has begun deprecation process. See the red box? Instead you should learn about prepared statements and use either PDO or MySQLi. If you can't decide which, this article will help you. If you pick PDO, here is good tutorial.
 
4:06 AM
Yeah i will change to mysqli, can you help me on it!
 
whats wrong
 
the ordering problem, if two values are same mysql arrange the value in which way while updating and ordering, if 3 and another 3 if i change 3 to 4 and 4 to 3 and then sort it out it doesn't change the position at all!
hello
 
 
1 hour later…
5:19 AM
Hi Good Mornig
i have pass data in a url user/Htemp?id=28989 in this format
i have to pass data like this format user/Htemp/28989
how to pass data in this format
 
you're already passing it. now you just have to read it. :)
for the first url, it'd be in $_GET['id']
 
Say for example a db table has x amount of fields, I want to run that same x amount of loops and in each loop I want to create a new array. Say x = 3 then I want to end up with array1[], array2[] and array3[]. How would I go about something like that if it's possible?
 
for the second, everything after the script name should be in $_SERVER['PATH_INFO'] (or possibly...i forget....$_SERVER['ORIG_PATH_INFO']...?
@Stuyvenstein stop it. you already know how to use arrays....why are you regressing to the bunch-of-variables-with-different-names mentality?
 
@cHao Heh?
Sorry I don't understand
 
what exactly do you need to do?
let's see some code or something
 
5:27 AM
create a new array in every loop. I asked a question: stackoverflow.com/questions/11589685/…
 
yeah, you're not making much sense. unless you literally mean you're stuck on making a new array....which would be as simple as $arrayVariable = array();
but it couldn't be that
cause that'd mean you didn't bother to ask google or anything.
 
6:00 AM
i am trying to retrieve an array on arrays from the front end to be saved to the database.. but am not able to get the clues.. serialize() has got some kind of clue.. but after unserialize() the array is simply an array.. can somebody give little hints please..
 
6:52 AM
@gorelative No it isn't. IE9 is Vista+ only.
 
7:06 AM
@HariOm Use JSON
 
7:16 AM
@gorelative Why are you running IE9 at all?
 
debugging, i was wrong i swore my vm had ie9 on it
 
@Truth Good find! I just added that to my chrome bookmarks toolbar.
 
7:52 AM
hi how can i change default page for joomla?
hi how can i change default page for joomla?
please help!
 
 
1 hour later…
9:19 AM
I am new to php and am trying to build a website. I would like to logout user session if he is idle for some time. I searched the web but i couldn't find the proper code. How do you check whether user is idle or not in php?. Can anyone help me please.
 
set cookie to eg 15 minutes, and refresh it every time, if user is idling more than 15min, cookie is deleted, and he is logged out...
 
@Truth can you elaborate the use of json in this case.. because target is to use it dynamically.. which i am not able to understand
 
@HariOm In what case?
 
@webarto ok
 
9:35 AM
ok to you too
 
<?php
session_start();

$idletime=60;//after 60 seconds the user gets logged out

if (time()-$_SESSION['timestamp']>$idletime){
session_destroy();
session_unset();
}else{
$_SESSION['timestamp']=time();
}

//on session creation
$_SESSION['timestamp']=time();
?>
@webarto session not expire
 
morning
 
@Truth am sorry.. am talking about array of arrays using dynamic input fields.. here
 
@HariOm I have no responses on that question
But using json_encode to encode your arrays, you get a string that you can later json_decode
 
does json decode reverts the same format of the original array.. i guess not..
 
9:51 AM
@NikunjAkabari sorry, I can't help you with that, don't know why
@NikiC morning
 
@webarto Thanks
 
is it just me, or curl_multi_* documentation is inconsistent and examples are not clear?
 
@HariOm it does
Read the documentation
 
10:10 AM
Hi, how would one decide to use one of these two methods of writing MySql queries in php? 1st: $query = "Select * FROM table where id=$id"; 2nd: "Select * FROM table where id=".$id(The difference is separating $vars by using double-quotes & dots.
 
neither
 
I mean by using .s and "s, I think php dont need to evaluate/check the whole string for $vars. @webarto which method do you use?
 
Did you consider $query = sprintf("SELECT * FROM table WHERE id=%d;", $id)?
 
@Maerlyn no, but this method looks easier as there is less chance of messing up the single & double quotes..
 
10:16 AM
If you're using something that supports prepared statements (like pdo or mysqli), that's your best option. If not, I find sprintf the easiest.
 
@Maerlyn I have switched to mysqli now..
So, will look into prepared statements
 
Wise choice :) It also provides a very good protection against sql-injection attacks.
 
@Maerlyn Thank you.. :)
 
10:33 AM
@PeeHaa: This Q/A is probably helpful for tutorials: stackoverflow.com/a/11591403/367456 - See the part about writing functions at the end. Probably that is a good description for what subroutines are good for?
 
11:09 AM
@gorelative I have no idea where you're getting the idea that IE9 can run on XP. It can't.
 
11:28 AM
dos anyone familiar with this error :
ERROR! failed to connect to OpenOffice.org on port 8100
 
 
1 hour later…
12:42 PM
@Subhransu Why would you be able to connect to openoffice.org on port 8100?
 
Hello, I have a question about the facebook-like-button, but I didn't find a channel for html etc.. Sry for post here, but is there a channel for somthing like that?
 
1:00 PM
Could I ask here?
 
1:12 PM
@hakre great tnx
and morning
 
1:25 PM
0
Q: Html Output of site map

Basic BridgeIf you use wordpress sitemap generator to generate site map for your site and visit sitemap.xml you get results like this. If check inspect it's elements in chrome or any other browser you get it's html output. But if you check the source code of this page. via like like this view-source:ht...

 
1:37 PM
morning @PeeHaa
 
busy times on internals @NikiC
 
busy times indeed
Python bought 20 typing monkeys to sabotage the PHP internals list
 
lol
 
How can i properly error handle PDO SQL
And return the error somehow
I have tried this return print_r($insert1->errorInfo());
 
can some buddy explain me that.
 
1:46 PM
@HarryBeasant $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
 
1:57 PM
Cheers
Do i still need to sanitize data that is input into PDO SQL statemnets?
ones that are already prepared
 
how do you "sanitize"?
 
0
Q: Exception MongoCursorException: couldn't send query: ët§ôï9·H'ﯤ7·ø?u§Ht§ ö·Ì­u§®u§Ì½u§4e

loveshI am trying to talk to a remote MongoDB server from my system. The code i use is like this $con_string='mongodb://server_ip:27017'; $m = new Mongo($con_string); $temp=$m->selectDB("DBName"); try { $mc=$temp->hs18_temporary->find()->limit(5); var_dump($mc->info()); var_...

 
@lovesh Have you set the correct encoding?
 
@PeeHaa How do i set the encoding?
 
2:14 PM
Try to do utf8_encode your data
 
ok i ll just do it
 
hey
 
@PeeHaa what if i do just a find() with no criteria?
@PeeHaa Then what do i need to utf8_encode?
 
stackoverflow.com/questions/11592998/… can any1 help me with this?
 
2:33 PM
blah
 
@ircmaxell a good morning to you too!
 
bleh?
 
@lovesh Idunno. I don't know mogodb, but garbled text is an indication the encoing is wrong somewhere
@ircmaxell Good blah to you too
 
@NikiC blah...
 
@Loshi adding the output of explain friends might help.
 
2:37 PM
its a small social network app im trying to develop
where user can see who;s he friends with
 
@PeeHaa Ok
@ircmaxell Hi. Any idea about my question
 
2:54 PM
no
Woot, JellyBean is downloading on my Nexus S
man, drank a bit too much last night... I hate getting older. Never used to get hangovers...
 
@PeeHaa good morning :)
 
hey mr. Hakre
 
3:27 PM
ahh, too early ;)
 
Hey guys
 
3:50 PM
You know, @Truth, if your answer here answers his question, he, and anyone else with these "questions" should give up. Everything short of notepad, cat, and select others can identify mismatched delimiters; why this is a question is incomprehensible.
 
4:04 PM
@Bracketworks there are more errors than just that. Such as mis-matched braces, and unexpected else statements
 
@ircmaxell Oh I know, it's safe to assume he hasn't run the code; however, even if that were the case (and it were acceptable before asking a question) I thought we as an industry had transcended monochromatic, lexer-less typewriters for development (or that some are just so plain good that they "don't need not stinkin' code-assist")
 
I use lexer-less typewriters from time to time...
 
Well, that's cause you're just so plain good ;)
 
or so plain stupid. One of the two
 
What I mean is, you don't jump on a bike for the first time without training wheels for fear of breaking something; I wish that inherent fear existed for developers.
 
4:09 PM
Hello all
 
@Bracketworks the cynic in me agrees. The realist says that people how to learn how to fall before they can learn that they need to keep themselves upright...
 
in Lounge<C++>, 12 mins ago, by NikiC
Forwarding a question someone else had:
@NikiC that explains the strange remarkable curiosity there :)
 
@ircmaxell Fair enough. But (continuing the analogy) when someone asks why the bike won't move and their tongue is wrapped into the spokes, I think it's time they sit down, put on a helmet, pads, and training wheels, and start from the beginning.
 
@Bracketworks very true
 
@sehe Huh, where did you get that from?
Is that some kind of trick to display deleted messages?
 
4:14 PM
@NikiC God powers and history :)
I summoned the atoms and reverse_entropy_cast<> it to it's original form :)
 
I see what you mean though; code-assist, generators, etc., they don't enforce good habits. People are less likely to know what they're doing when someone is doing it for them.
 
Q. What sourcery is this?
A. room owners can do that
 
@Bracketworks Well, it's any form of short-cut, like frameworks or the like. They are great if you understand the underlying mechanics, but if you don't, it can get you into deep trouble...
 
@ircmaxell Exactly; I recall someone having mentioned here a few days back that "writing a framework is like a rite of passage". I think that's reasonably true, as far too many people go "Ok, so, hello world; now I'm a PHP developer"
 
4:56 PM
Let's see @PeeHaa @ircmaxell and @NikiC are here
Let's see if I can get some expert opinion
My application should fit driving teachers to tests in a calendar
 
@ircmaxell Just so you know, I'm once again fighting the AST-less nature of the PHP parser. Because there is no AST I have to differentiate between variable and expr_without_variable, which again causes reduce/reduce conflicts in other places.
 
There are a set number of tests on specific times and specific days of the months (as decided by the government). The numbers are inputted by the user.
Each teacher gets a test quota according to how many students he has, that is also inputted by the user.
Teachers may submit requests for test times (I want a test on Jan 1st at 12:00)
That is also inputted by the user.
The question is, what would be the best way to structure the database in this case?
That routine is done monthly, and I need to keep a 7-years history.
 
gitolite hates me
 
5:15 PM
this is not the place but where is the www folder in ngninx? i'm using debian 6
 
@Kobayakawa Just check your nginx config?
 
yes i looked it now. its in usr/share/nging/html
isnt it a weird place :D
 
Well if you don't like it there change it
 
0
Q: Html Output of site map

Basic BridgeIf you use wordpress sitemap generator to generate site map for your site and visit sitemap.xml you get results like this. If check inspect it's elements in chrome or any other browser you get it's html output. But if you check the source code of this page. via like like this view-source:ht...

 
@NikiC :-(. Propose rewriting that for 6
Actually, if you make it an AST based processor, pecl extensions could visit AST nodes, and be able to create/modify syntax
things like operator overloading and introducing new operators would be simple
 
5:38 PM
@ircmaxell To modify syntax you have to hook into the parser. Visiting AST nodes isn't enough for that
But they could indeed change the compilation of existing nodes ;)
 
eih, that's truee
 
hi all :)
hi all :)
i need help... can i ask u guys?
hmm...anyone there?
 
just ask ahead ;)
if somebody can/wants to help, he/she will :)
 
-1
Q: Whay can't i open gmail.com using SimpleTest?

Nok ImchenUsing simpletest i'm able to open any page. But i'm not able to open gmail.com or anything related to google. I can open using cUrl. what should i do to open gmail.com using simpletest. The code i'm trying is below require_once('simpletest/browser.php'); $headers = array( "User-Agent: Mozilla/5...

i've asked there also
but no reply yet
 
5:46 PM
i'm just too restless t, wanna knw it :)
:)
huh! i got a -1 :(
 
@NokImchen I never used SimpleTest, sorry
I think everybody in here is using phpunit
3
simpletest is an old and obsolete library
 
oh
please dont say sorry, its okay, thanks for the info :)
i'd like to knw, is phpUnit dependent only only php? or it also needs phyton?
 
no, phpunit is just php
 
6:06 PM
ok
ythanks :)
thanks :)
and sorry for thanking you late, i was having a dinner :)
i'm downloading php unit from github :)
 
@NokImchen phpunit is usually installed via pear
because it has dependencies
 
what is pear :(
i'd google it
 
its a php package manager that everyone hates
 
i've download it but getting error
ohh
so, can i use phpunit in hostgator hatchling plan?
Fatal error: Class 'PHPUnit_Runner_BaseTestRunner' not found in C:\wamp\www\phpunit\Tests_files\MockRunner.php on line 2
 
phpunit is used only locally, not on the server, so yes ;)
 
6:14 PM
"not on the server" ?? hostgator is a server, right?
 
yup
but say, what are you actually trying to do?
I'm not sure whether you really need phpunit or simpletest
 
i want to open gmail.com
 
but why do you need phpunit/simpletest for that?
 
and deleted or download emails
i want to do other things also, i want to give service to the netizens :)
and just for fun tooo :)
 
that probably won't be so easy ;9
But in any case, to get the contents of a webpage you should simple use file_get_contents
 
6:18 PM
ah! i just cant understand how to install pear :(
but i want to save cookies, fillup forms, etc
 
file_get_contents also allows you to specify headers and all kind of stuff ;)
 
i want it to be like a browser :)
 
i see
 
ya, i like both NikiC
NikiC
file_get_contents & cURL but they are hard for navigation :(
 
hm
 
6:20 PM
oh :(
life is complicated :(
 
in that case phpunit is definitely the wrong thing
because that's just a testing framework
 
and simpletest too
 
then what is good?
 
instead you'd want to use something like symfony/BrowserKit
 
6:22 PM
i like simpletest, cos its simple. no installing. pure php. but the only prob is that it cant open gmail or google.com or yahoo.com :(
thanks, i'll google them both :)
btw, u've a very good knowledge about php. i think u are a professional. y dont u work as a freelancer & earn $$ ??
 
github.com/fabpot/Goutte -> this should do
 
oh
i've already tried that Goutte
 
if you look at the readme it looks just like what you need
 
i got a lot of errors!! :(
i got this errors:
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in C:\WINDOWS\Temp\pharextract\goutte\_web_stub.php on line 1

Fatal error: Uncaught exception 'LogicException' with message 'This PHAR file can only be used from the CLI.' in C:\WINDOWS\Temp\pharextract\goutte\_web_stub.php:1 Stack trace: #0 C:\wamp\www\Goutte\goutte.phar(64): include() #1 C:\wamp\www\Goutte\a.php(3): require_once('C:\wamp\www\Gou...') #2 {main} thrown in C:\WINDOWS\Temp\pharextract\goutte\_web_stub.php on line 1
 
uhm
 
6:25 PM
and my php code that i used is:
 
what php version do you have?
you need 5.3 to use it
the first error indicates that you have 5.2 (or older)
 
php 5.2.5
i use php 5.2.5
<?php

require_once 'goutte.phar';
include_once 'Goutte\Client';
$client = new Client();
$crawler = $client->request('GET', 'http://www.symfony-project.org/');
print_r($crawler);
?>
:)
 
yeah, 5.2.5 won't work. needs 5.3
 
oh
Thanks
i'll download latest WAMP :)
 
many things nowadays need 5.3 ;) php 5.2 is even not maintained anymore ^^
 
6:27 PM
oh
i was thinkthing that just a small 0.1 increament in the version wont affect much :P
heheh
2 hrs to finish downloading!! :O
 
that's a slow connection ^^
 
ya :(
i'm using mobile SIM card for my daily internet usage. its only 4.7 kbps downloading speed :(
 
@NokImchen I'm using a mobile connection for my daily internet usage and it's not that slow :o
Where are you from?
 
@nikic do u get paid to help others in stackoverflow?
@truth, i'm from Mumbai.
i used to used wifi. it was like 1 MB/second..!!!
 
@NokImchen None of us get paid
 
6:39 PM
@truth, oh..!
 
51 mins ago, by NikiC
I think everybody in here is using phpunit
 
u guys are doing a GREAT job
 
Sadly, I haven't started yet
 
@Truth with phpunit or unit testing in general?
 
well , most of us use phpunit , but one for every project
 
6:40 PM
I just learned about unit testing in general
 
u guys are professionals, y dont u guys start a website like freelancer & earn lots of money?
or an open source ?
 
@NokImchen Some of us do
I'm at Stack Overflow as a hobby, I also learn a lot from this site
@NikiC I haven't yet implemented unit testing in PHP
I'm still not at the stage where it all clicks in my mind :(
 
@NokImchen , do you assume that website automatically lets you print moneyz ?
 
don't wait for that stage :D just start doing it ^^
 
@tereško, hehehe, but image, ig stackoverflow put google adsense & siatrivute the revenue amony the top contributer them i'm sure that they will be earning atleast $1000 per month!!!
actallly, i'm an online marker by hobby, i see money in stackoverflow :P
 
6:44 PM
no , the would get $1000 for a month .. about $2.40 in the next month
it would just kill the site
 
no no, they'll get more!! cos a link will increase its PR as the time goes! so, the page will rank better in google search!
ya, exactly, it'll kill the site will spam! so, there must be an alternative :)
 
@NikiC I want to, but I still don't really know what to test in my application
 
@truth, i also learn a lot from this site, infact, this is the 2nd help, 1st being th google :P
 
80
Q: What is Stack Overflow's business model?

George StockerI once answered a question that asked how Stack Overflow makes money, but that was before the time of VC. Now, Stack Overflow has cash, and they have an ever-growing list of employees, but where's the business model? The Experts-Exchange team took the time to answer its own Q&A about its si...

 
6:46 PM
(for a reasonable definition of "everything")
 
awww...thats an interesting link :P
 
@NikiC I mean to which scope should I test
 
oh! job listing will really make $$$
 
@Truth not sure what you mean
 
Testing every method? Every class? Every what?
 
6:48 PM
hey guy, has any of you ever set up GitLab ?
i have been having some a lot of problems with making it work
 
@tereško Lol, still on that? that's 3 days now isn't it?
 
2
 
omg! u guys are just too progessional, i'm numb :|
 
@NokImchen , stop acting like an asshole
 
@Truth As a rule of thumb, every public method / behavior. But ask @tereško, he can give you a fancier answer.
 
6:50 PM
:(
i cant even install pears :D
 
@NokImchen Professionalism comes from experience and willingness to learn
If you have the latter, the former will come with time.
 
so, m download php 5.3 according to @nickic instruction :) thanks :)
 
@hakre "Sorry if this sounds rude, but there are so many duplicates that I highly suggest you either try the duplicate proposal plus some more of the many more duplicates that exist. You can find them by searching via google for your error message." Gosh, you really embraced that flower-y style that blog post was suggesting...
 
@Truth , you should test every public methods in code that is not auto-generated
 
oh, i'm actually a biotechnology student, php is just my hobby :)
 
6:52 PM
@NokImchen For a developement environment, I like to use an all-in-one like XAMPP, which installs Apache, PHP and MySQL (as well as an FTP and SMTP server) all at once, with correct configurations and everything.
 
@Truth , the exceptions are dump setters (which do nothing to variables) and constructors
 
@tereško Okay, what about TDD?
 
what about it ?
 
@tereško How should it be done? How do you approach it? To what scale do you plan your tests?
 
@truth, i never used XAMPP, i'm currently using WAMP and i find it so easy and simple. so, m sticking to it :) i'll go for XAMPP only if i face prob in WAMP :) Anyways, Thanks for the info :)
 
6:54 PM
i dont plan them , i just add them as i write the code
 
@tereško Isn't TDD all about writing the tests before you write the code?
 
@NikiC Yes, we will charme everybody to death. :)
 
@NokImchen , actually , the most efficient way would be to set up a linux or bsd server inside a virtual machine , and configure it "by hand" instead of using canned solutions
 
@tereško For some definitions of "efficient"...
 
@Truth , it is , but most of people at first write the methods , and then write the test to check it that method works as expected
 
6:56 PM
@tereško understood nothing :( :S
 
lol
 
@tereško i'm happy with WAMP on my windows XP :)]
 
then google the keywords which were confusing
 
@tereško yay! google is d best :P
 
@tereško Canned solutions are exactly for those type of people, which don't require all the fancy settings, and are satisfied with the defaults.
 
6:58 PM
hey guys, can i ask u a question regarding python?
 
dunno .. @Truth , i like to make the most of my damned netbook .. that's why my main focus for setting up server is : "will it interfere with anything else"
@NokImchen you would be better off asking that in IRC
 
@tereško oh, ok, ut where is the IRC, may i have the link? :)
 
00:00 - 19:0019:00 - 00:00

« first day (644 days earlier)      last day (4290 days later) »