« first day (595 days earlier)      last day (4350 days later) » 

12:05 AM
 
@webarto Senior Front-end developer
 
doesn't matter, someone who is senior and junior, should know how to use search... "yii get last insert id"...
 
@webarto: You have some YII practice?
 
no, zero ... just searched after figuring what the real question was...
 
12:16 AM
yeah, I now read that
Thank you for your vote ;)
 
you are too kind to these a**h* :) they are just exploiting this site/community...
 
In a way these people are really smart
Instead of doing it themselves they outsource the work for free. That's damn smart!
 
yes.. "I'm too lazy to do anything, I'll just ask those nolifers on SO, they'll code it for me"
but seriously, quality of (majority of) questions really dropped comparing to 2011, 2010...
 
@webarto , i guess you have not read the slash7.com/pages/vampires
 
does anybody knows from where can i read a good tutorial for open graph facebook, the tutorial from facebook i can`t understand it.
 
12:24 AM
it the natural migratory pattern
 
@tereško guess it's always been like that in all aspects of life :)
 
the "Signs of Help Vampire Infestation" is the relevant bit
 
I still don't get
Why do so many people decide to be stupid :/
 
it's just output '0' — Abudayah 3 mins ago
 
12:32 AM
there should be "flag as retard" option
@webarto , i only avoid down-voting when my rep ends with 0
 
haven't thought of that, hmmm, wondering where to spend 3 downvotes :D
 
folks, you can now do the del-vote on that answer then you'll get your points back (I think)
 
link|edit|flag :( "it doesn't work"
 
@hakre done, need one more vote
 
stackoverflow.com/questions/10858905/… has nothing to do with tags other than css
 
12:42 AM
@webarto you need 20k, so go answer some questions ;)
 
@hakre :) I should should role and ask some questions :P
 
makes me sad
 
@webarto Asking is a good idea as well ;)
But on questions like this: stackoverflow.com/questions/10538419/… you can make 250 points + X
 
@hakre , yes , but only correct answer for that question is "it depends"
 
@hakre You put your bounty on the wrong question
 
12:49 AM
yeah
 
It could have been a good question, but right know I just want to punch the asker in the face
 
"DONT UPDATE YOUR PHP ! ALWAYS RUN IT WITH THE ENVIRONMENT IT WAS DEVELOPED IN !" :(
 
Or rather, as he's a Grasshopper, I'd like to take off his legs
 
@tereško Well don't see it technically straight.
@NikiC I can put other bounties on other questions (yes that one was not that well, I realized that later)
 
today, I logged in dev server in this company I started to work, PHP was 5.2.1x :D
 
12:51 AM
@hakre You can edit it :)
 
@webarto , what the hell you did in the interview then ?
 
@webarto Yeah the stable 5.2 version. nice.
 
0
A: upgrade more than 50 installations to PHP 5.3

Panique5.3. gives out notices when variables are "not defined", which may completely mess up your CMS etc. Even most professional tools (wordpress etc) had problems with this. So, whenever it's possible: DONT UPDATE YOUR PHP ! ALWAYS RUN IT WITH THE ENVIRONMENT IT WAS DEVELOPED IN !

 
@NikiC no i can not. It's set and I can't change it.
 
I'm not sure whether that answer is sarcastic or serious
@hakre I mean edit the question
 
12:52 AM
@webarto first thing i do in an interview, when faced with "so , do you have any questions" , is to ask: "which php version do you use"
 
The good thing with 5.2 is when you upgrade to 5.3. It's really a great step.
 
yeah , php5.3 was 6.0-lite
 
haha :D I said, move it to 5.4, I don't wanna hear excuses :P
 
Well if your OS supports 5.4, you're lucky.
 
not sure about that .. a sensible company would plan to move to 5.4 by the end of year
 
12:55 AM
it's CentOS I think, but they have ~10 admins, someone can update it probably...
 
"OS supports 5.4" ?
 
@NikiC , using build in upgrade mechanisms
 
probably through some package manager
 
@tereško ahhh
 
yeah package manger, I'm lazy sometimes
 
12:56 AM
I got used to compiling php myself ^^
 
yeah I'm compiling my own more and more as well
 
I always fail at compiling
 
for example , i always prefer using freebsd ports , over simply building something by hand , because it then is easier to upgrade
 
The good thing about compiling PHP yourself is that it just works, as always with PHP
Unlike most other stuff...
 
upgrading (manually) is a PITA
 
12:58 AM
yeah , i do not care about the first installation
 
wow looks like somebody needed to downvote some of the some question I've posted.
 
I upvoted, doesn't cost ... probably some noobs downvoting...
 
thx, this one as well (and actually it's a pitty because I think the question is OK): stackoverflow.com/questions/9658006/…
 
1:05 AM
I don't get it, I never downvoted something if OP doesn't know, I downvoted because OP is an idiot...
 
-2
Q: Select elements with attribute value of self or descendant but not "overruled" (like a lang attribute)

hakreI'm trying to mimic the interpretation of the lang attribute similar to HTML or xml:lang. Given the following XML chunk: <xml lang="c"> c#0 <para>c#1</para> <para>c#2</para> <para lang="d"> d#0 <para>d#1</para> ...

 
:)
 
I fall asleep now.
have a good time everybody
 
1:14 AM
good night
I need to go buy some red bull or something
coffee is anymore
if I don't come back in an hour, call the police
I killed someone
 
Is this the best way to write Mysqli queries:

    $q= "SELECT name FROM users WHERE id='$id'";
    $r= mysqli_query($DBlink,$q) or die(mysqli_error($DBlink)." Q=".$q);
 
ah
how should i write it out ?
 
whats the advantage to that
 
1:28 AM
none
 
@webarto ?
 
just trolling :)
 
@Dave the statement (with placeholders) and the values are sent to the server separately so an attacker doesn't have the chance to inject (malicious) sql
:P
 
im a little confused how : WHERE Name=?
works if u want to use more than one field in the WHERE clause
 
@Dave sure. just add multiple placeholders
 
1:30 AM
so Name=? AND id = ?
 
how will it know what variables to use
mysqli_stmt_bind_param($stmt, "s", $name,$id); ?
 
sequence in which you bind the params
 
ah so they have to just follow the order
 
yep I don't think mysqli allows named parameters as PDO does. Not sure on that one though
 
1:32 AM
"s" does that have any significance?
 
BTW is there a specific reason why you use procedural style instead of OOP style?
@Dave it's the data type
 
i thought i was using oop
 
so i have to declare the data aswell for each var
 
I wrote it, so don't troll net.tutsplus.com/tutorials/php/…
 
1:33 AM
thats ... alot of work =/
 
@Dave compared to what? Manually escaping?
 
ecaping what? i never used to set data type =/ (im converting from MYSQL)
 
@Dave how do you handle sql injection attempts now?
 
the escape function
mysql_escape_string
 
mysqli_escape_string I presume?
btw wtf
 
1:37 AM
well yeh as i have to convert now
i used to use mysql
 
@RepWhoringPeeHaa obviously a troll :P
 
hense why im changing to mysqli cos i just upgraded to 5.3 >.>
 
Just use prepared statements and you don't have to worry about manually escaping anymore
And use OOP style mysqli while you are at it
 
1:40 AM
okay but if i have this :

$stmt->bind_param("s", $city,$userid);

where should i declare integer? in the "" or "s","i" ?
 
$stmt->bind_param("si", $city, $userid);
 
ah :) okay
 
thanks will test around with it
 
have fun
 
1:46 AM
if ($stmt = $mysqli->prepare("SELECT show_name FROM users WHERE uid=? AND name=?")) {

    /* bind parameters for markers */
    $stmt->bind_param( "is", $_SESSION['player'],'test' );
this crashed my page =/
Cannot pass parameter 3
 
Also, don't use mysqli
Use PDO instead
 
It will make everything easier :)
@RepWhoringPeeHaa :P
 
you winding me up ? o_0 i can't tell
 
@Dave No, I'm serious. Mysqli has a really ugly and hard to use API, that's why recommen using PDO instead :)
 
1:51 AM
ok
how soon is PDO going to be replaced >.>
 
Although I don't see anything wrong with your code @NikiC is right about PDO
 
Though it's already great that you are switching away from mysql_, so choose whatever you like ;)
 
http://pokit.org/get/img/9a2fdd2da15d817a5019925691ddde24.png

amidointrite? :(
 
ill go with PDO if its easier
 
@Dave It will not be replaced anytime soon
@webarto Huh?
 
1:52 AM
@webarto Huh?
 
:D
 
@webarto yea udoinitrite.
 
table has columns like "content_" + 2 char language code... couldn't thought of clever solution to return content_* based on language...
 
unusual PDO asks for servername for connection
thats new
 
@webarto $title != $content
@webarto Maybe you want to store the stuff in an array instead?
 
1:56 AM
sorry about that, copy pasta
 
@Dave localhost usually ;)
 
does it allow 'localhost' or 127.0.0.1?
for the string input
 
both are okay
 
okay
hmm interesting i can use arrays for multiple WHERE fields
 
@NikiC while we're at it, is loading entire array in memory (language file) vs reading desired row from table considered as micro optimization?
 
1:58 AM
which one of them would be the optimization?
 
@webarto table as in database table?
 
yes, yes... file vs table
 
file
you are going to need a lot of rows if it would be in a table
 
in PDO is this escaping the string automatically:

$stmt = $dbh->prepare("SELECT name FROM users where name = ?");
if ($stmt->execute(array($_GET['name']))) {
  while ($row = $stmt->fetch()) {
    print_r($row['name']);
  }
}
 
for example, is it better to waste* eg 1MB of memory for array (language file), or make 5 separate queries to database... * values that are not needed at the moment
 
2:01 AM
@webarto file
 
@Dave Yes
 
ah thats good and it is alot simpler you're right
perfect :) thanks !
 
ok, no more doubts, haven't ran any tests @RepWhoringPeeHaa @NikiC
 
@Dave You can make it even nicer:
 
oh ?
 
2:02 AM
$stmt = $dbh->prepare("SELECT name FROM users where name = ?");
if ($stmt->execute(array($_GET['name']))) {
  foreach ($stmt as $row) {
    print_r($row['name']);
  }
}
 
all language stuff loaded in mem doesn't care cause it's plain text and shouldn't take too much space. However asking the db for language stuff may become expensive
 
PDO supports foreach iteration of the $stmt ;)
 
And no I don't think this is micro optimization
 
@NikiC how would i execute with multiple input fields ?
 
@Dave How do you mean?
 
2:03 AM
@RepWhoringPeeHaa thank you for input
 
$array = array();
$array[0] = 'name';
$array[1] = 1;
$stmt = $dbh->prepare("SELECT name FROM users where name = ? AND uid = ?");
like if i had an array of data like that
 
@Dave Well then $stmt->execute($array) :)
 
ah but that won't work if the array has [2] aswell will it
 
and if you have an array like ['name' => 'someName', 'uid' => 7] you can use named parameters to bind: WHERE name = :name AND uid = :uid :)
 
2:06 AM
$array[0] = 'name';
$array[1] = 1;
$array[2] = 66;
that returned 0 results
 
@Dave Yes, that won't work
It probably will throw an exception (if you have exceptions enabled)
 
no i aint got an exception added
 
anyways, got to go, good night everone
 
aint worked out how yet
 
@Dave $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); or something like that ;)
 
2:08 AM
hmm
ok
 
@NikiC later @NikiC
@Dave you should use array(':name' => 'somename', etc
 
so assign array values to named parameters
 
if you are doing named parameters you should add :
But it isn't needed to work you can just use a numeric array
 
$array = array();
$array[0] = 'myname';
$array[1] = 1;
$array[2] = 66;

$stmt = $pdo->prepare("SELECT name FROM users where name = ? AND uid = ?");
if ($stmt->execute($array[0],$array[1])) {
  while ($row = $stmt->fetch()) {
    print_r($row['name']);
  }
}
like that?
 
no :)
$array = array('myname', 1);
$stmt = $pdo->prepare("SELECT name FROM users where name = ? AND uid = ?");
if ($stmt->execute($array)) {
or
$array = array('myname', 1);
$stmt = $pdo->prepare("SELECT name FROM users where name = ? AND uid = ?");
if ($stmt->execute(array($array[0], $array[1]))) {
 
2:13 AM
yeh but what if - the array has a 3rd data or 4th etc
then i use the latter?
 
then go for the second option
execute() expects an array as parameter
 
how do u do error handling with it ?
i used to use or die on mysql lol
 
and we all know that sucks right? ;)
 
yeah lol
 
You can set PDO to throw exceptions instead of errors when something goes wrong
8 mins ago, by NikiC
@Dave $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); or something like that ;)
So you can wrap stuff in a try/catch block
 
2:17 AM
yeah i got : $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
do you try catch before the if statement of execute?
$stmt = $pdo->prepare("SELECT name FROM users where name = ? AND uid = ?");
try {
if ($stmt->execute(array($array[0],$array[1]))) {
  while ($row = $stmt->fetch()) {
    print_r($row['name']);
  }
}
} catch (PDOException $e) {
	echo $e ->getMessage(); exit;
}
am i close :P ?
 
oh i got it right :D
 
I usually catch PDO exceptions only very high up the stack
They are really rare and if they happen something's seriously wrong anyways
Wrapping every single query in try/catch is a bit overkill-y for me :)
and now really good night :)
 
good night :)
thanks for the advice
 
I'm also off. later
 
2:26 AM
byee :)
 
 
2 hours later…
4:07 AM
How to get address from latitude & longitude using google?
 
4:28 AM
hey guys
 
 
2 hours later…
6:23 AM
morning
@tereško are you there
@webarto are you there
 
lol
whats up
 
usual Saturday morning, trying to wake up
 
good
 
what's up with you
 
6:32 AM
developing facebook application on php
i like php more than others
which one you like more
 
the one that brings more money :) PHP in my case
 
Php. though I'm learning Java so I'll see how that goes. :-)
 
6:59 AM
traitor :P
 
7:50 AM
how to get permalink of facebook post which is posted by graph api
@webarto @tereško @rdlowrey @ircmaxell
 
@DanishIqbal facebook.com/{uid}/posts/{pid}
 
@webarto this only works if user not sets its user name
 
uid or username, doesn't matter
 
i check this one is not work
also this is also not works
https://www.facebook.com/permalink.php?id=250742281641299&v=wall&story_fbid=369671376415055
 
hm, don't know about groups, profiles and pages works this way...
 
8:07 AM
i got the solution :D
 
:)
 
8:47 AM
happy new day everybody ;)
 
my day isn't over yet :D
 
good afternoon all
:)
 
:)
 
@hakre lol
 
9:03 AM
lol
guys whats your favorite function in PHP
 
exit
 
@DanishIqbal best function is that you can create functions your own.
I love functions. So often creating a function is making problems so much less problematic.
How can you not love functions?
 
@hakre good one :)
i mean the functions you love more
 
@DanishIqbal I'm in love with functions in general, not with a specific one. That does not match my culture, single function loving.
 
@hakre did you here about chat bot ?
*hear
 
9:13 AM
wasted half hour trying to debug JS file, turns out that wrong file with the same name was linked...
 
Good morning
 
hi @Donut
 
Hi @hakre
 
10:03 AM
@hakre i didn't get your point why you give the link of very old question
 
10:21 AM
@tereško nothing says good morning like a tag
it's afternoon but doesn't matter
 
good afternoon to you too
 
hey guys.
 
10:41 AM
hi
can i ask an out of topic question
 
depends on "how far off"
 
I just need some answer regarding releasing a new product
 
Bill Karwin dude is wicked stackoverflow.com/a/1442867/424004
 
11:01 AM
@tereško nice man, you are also wicked
SELECT t1.*
FROM posts t1
LEFT OUTER JOIN posts t2 USING (category_id, id)
GROUP BY t1.category_id
ORDER BY category_id ASC, id DESC
I needed one latest row per category
I f* hate when I don't know the name of the problem, only thing I know is that it's PEBKAC
 
emm ... SELECT * FROM Foobar GROUP BY catergory_id HAVING MAX(timestamp) = timestamp
or something like that
 
I mixed yours and Bills answer, so... pokit.org/get/img/cc4b019c733909f891e33be5a7ffd176.png it's all good
 
11:24 AM
did you ever notice that this is physically impossible ? For this to work, Sauron should have to be as heavy as a castle
 
@tereško thats an odd observation given that Sauron (and mostly everything else) in that movie is impossible ;)
 
i have no problem in suspending the disbelief on account of magic
but this is inertia and preservation of impulse
 
@tereško btw is that Sauron or Morgoth?
 
re
 
@tereško bcause Morgoth wielded a magic hammer indeed. Called Grond.
@hakre ello
 
11:34 AM
hmm .. no , this guy had the ring
 
hi @Gordon
 
11:59 AM
> or does it make sense?
 
12:33 PM
@hakre: I think it is valid
and the best answer would explain why no one shouldn't ever want that
 
12:52 PM
@zerkms Please elaborate why it is valid.
 
@hakre: why isn't it?
The guy knows about final for methods and curious about properties
stackoverflow.com/q/10862321/251311 --- btw, do you think this one is valid? ;-)
 
1:17 PM
@zerkms and what does final mean for a property? Aren't all properties final by default?
 
what is the maximum size of the data that can posted by http post
anyone?
@hakre help please
 
5
Q: Is there a maximum size for content of an HTTP POST?

lackeyIs there a maximum size for an HTTP POST? And if there is a max size, is it determined by the protocol or is it at the discretion of the server?

@zerkms Lol two downvotes and the user actually removes it's question after you have told him how trivial some calculation could be.
 
2:03 PM
OK, thanks to the SQL antipatterns book I suddenly feel a hell of a lot less safe in aircraft.
 
“Syntax error at SELCET.” After a pause, he said, “You can close this issue,” and he hung up abruptly.
Mr. Davis was the sole developer for an air traffic control company, writing software that logged data about international airplane flights. We heard from him every week.
 
hello all
 
@RepWhoringPeeHaa Hello
 
:) mr hakre
 
@GordonM where's that from?
 
hakre you are from germany right?
 
@hakre SQL Antipatterns
The developer just assumed that any error messages the DB generated were down to bugs in the DB. When the tech support guy forced him to run a query he was complaining about through the SQL shell he got the above error.
 
@RepWhoringPeeHaa yes that is correct.
so if you want to get some wood-watch or bavarian trousers and hats, I could arrange something for you. ^^
 
2:33 PM
Can't you arrange an oktoberfest for me right now :)
But serious: What are you going to do with the new euro tracking cookie policy?
The damn law is just too damn unclear
 
@RepWhoringPeeHaa Ignore it? I mean even germans are foccused on the law, everything consumer related is a joke.
So you actually practically do not need to care at all.
 
@hakre Last week we had a short meeting about the topic. Basically that's exactly what came out. Good thing most developers think the same.
 
posted on June 02, 2012 by Evert Pot

Microsoft recently announced that they will automatically enable the 'Do Not Track' header in Internet Explorer 10. The DNT header allows a user to opt-out of being tracked by websites. This was introduced by Firefox, and now also has support from Opera and Safari (but not Chrome). This header is a great feature. Before, the ad providers had to ask the user on their website to opt-out, and

 
@Feeds old news my friend. You are getting slow
 
@Feeds never read so much bullshit like that argument since long.
@RepWhoringPeeHaa It's a computer. It does not understand you that way ;)
 
2:47 PM
Ah right how stupid of me
@Feeds: 011011110110110001100100001000000110111001100101
011101110111001100100000011011010111100100100000
011001100111001001101001011001010110111001100100
001011100010000001011001011011110111010100100000
011000010111001001100101001000000110011101100101
011101000111010001101001011011100110011100100000
01110011011011000110111101110111
 
@tereško and how is that not magic?
 
@ircmaxell , might be all the urban-fantasy books i read
 
well, isn't the point of magic that it can violate the fundimental principles of physics, since otherwise it wouldn't be magic, but science?
 
@hakre We've got the same law here in the UK now, but it seems official government policy is "eh, who cares?" and will pretty much ignore it. It's fairly difficult to enforce it!
 
2:53 PM
@GordonM It has been in place for some while now over there right?
 
@GordonM Yeah you've got some statements on that from a higher level in the UK. Not all cookies we devs know are the cookies the law is about.
 
"PHP Fatal error: Internal zval's can't be arrays, objects or resources in Unknown on line 0" <- That should never happen :P
 
@RepWhoringPeeHaa Officially became law last week
In the UK and Europe we have a fine tradition of just ignoring stupid laws.
For example, putting your CD collection on your iPod is technically illegal.
 
I've spoken with three lawyers so far about that directive and it's all not that hot it looks like. Practically nobody knows, so just tracking what happens and you should know what you do, so you can deal in case more information is available.
 
2:56 PM
@GordonM we also have the fine tradition of coming up with stupid laws. I think the two go hand in hand ;)
 
pretty much!
 
law is only stupid for certain people.
those people who don't control it ;)
 
@hakre that
 

« first day (595 days earlier)      last day (4350 days later) »