« first day (573 days earlier)      last day (4379 days later) » 

10:00 PM
God "The happening" is a shitty movie
 
the avengers was good
batman will totally own it tho'
 
@RepWhoringPeeHaa ,yes
 
@Chris Avengers is good?
 
for me it was
can't speak for other people tho'
 
for the record. Cabin in the Woods sucks ass. imo
 
10:03 PM
captain america sucked
all spidermans sucked
hulk 1 sucked
matrix rules
 
captain america, when there was actual action and not the stupid story they put to it... was ok
matrix 1 was good. the rest were progressively more painful.
 
read books =P
 
^ i still watched them a few times each....
@tereško I don't have cable... havn't in years. books + movies is my bag.
 
a few?
it must of been like 20 for me
 
Aight then, 3 more upvotes, then bed.
(and then, after bed, I'll probably get around 10 more upvotes, and get 0 rep from those, because that's the way it is :X)
 
10:16 PM
@Truth If you can satisfy my curiosity, you can have 100 of my rep :]
 
@orourkek Today, I'm just looking for one last upvote :)
 
PHP Quiz: How to make json_decode return a string that is not UTF-8?
 
But I'll check your question out
 
Though I suspect that question has no answer...
 
@hakre One does not simply change encoding
 
10:17 PM
or if you're asking for it to take in utf-8 and spit out something else, why?
 
@Chris what do you mean? According to the manual, json_decode returns `a string that is UTF-8 encoded - when it returns a string.
@orourkek It's a quiz, not a standard SO "please help me" question.
 
@hakre False.
 
@hakre I know, just asking for details
I had to use that post once, thats why I linked it :p
 
@Chris edited.
 
@hakre Is that a trick question?
 
10:21 PM
Yes that is trick question.
Let's make this more nice: 250 Pts for the first answering it. (You need to have an answer on SO to place a bounty).
 
@hakre Still false. You can't win. I am demi-god.
 
@hakre this seems like a wild goose chase
 
0
Q: adding a script to the head tag

Kleon Kitai have this code var scri = "<script type=\"text/javascript\">var _gaq = _gaq || []; _gaq.push(['setAccount','UA-22xxxxx3-15']); _gax.push(['_trackPageview']); <\/script>"; document.getElementsByTagName("script")[23].add(scri); console.log(scri); I want to append that element to t...

Where did he even get .add()?
 
@orourkek PHP Quiz hint: Divide a pair.
 
@Truth pretty sure it's a dupe
 
@RepWhoringPeeHaa Don't see it in this guy's questions
 
lighten the mood
 
3
Q: How to dynamically insert a <script> tag via jQuery after page load?

DougI'm having problems getting this to work. I first tried setting my script tags as strings and then using jquery replaceWith() to add them to the document after page load: var a = '<script type="text/javascript">some script here</script>'; $('#someelement').replaceWith(a); But I go...

 
/me used to work for guess jeans... this is funny to me. (hipster is a type of jean rise)
 
10:33 PM
PHP Quiz: Auto-code an app. How?
 
/me entertaining myself.
 
@RepWhoringPeeHaa Aye.
Well, I've hit my daily cap :)
 
I'm off to bed then
 
later @Truth
 
10:34 PM
GN
 
@Truth gn8
Here's another PHP Quiz hint: D834
 
@hakre I keep coming back to the same bug report(s) from 2007, that have supposedly been patched
 
@orourkek Show.
 
couldn't find anything in the source code so I went to the bug reports :P
 
@orourkek okay, that's the answer.
 
10:40 PM
Though isn't CESU-8 a derivative of UTF8?
 
json_decode("\uD834") will return invalid UTF-8 for example - in 2012.
 
huh, maybe that patch never went in
 
FFFFFFFFFFFFFFFFFFFFFFFFUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU‌​UUUUUUUUUUUU GitHub
Y U ATTACK RIGHT CLICK ON LOGO!!!!?????!!!!!
 
hey guys
 
/me wants to 'open link in new tab'
 
10:42 PM
@rlemon middle mouse button
 
@hakre not the point. CTRL+click works too
Dont ever... and I mean ever! block my context menu
 
@orourkek Congrats, 250 bounty placed, but it will take 23 hours
 
bad UX mojo if you ask me
 
@hakre thanks, always up for a good scavenger hunt :}
 
Hey guys how do I make this conditional work? pastebin.com/85W1RUJr
 
10:44 PM
@rlemon I completely agree with this. The little popup when right clicking the logo is stupid.
 
I'm trying to return false if the query doesn't return anything and true if it does.
 
Oh wow, just realized Caroll Shelby passed away. This makes me sad, he created such beautiful machines.
 
@rlemon please give my problem a crack. It's really simple. I just need to know the proper way to do it.
 
^ more efficient.
@hanleyhansen lol
 
10:52 PM
@rlemon what?
 
@rlemon That's why I always add the caveat of my answers being "one possible solution" :]
 
$stmt = $DBH->prepare("SELECT * FROM assignments WHERE 'project_id'=? AND 'person_id'=? LIMIT 1");
return $stmt->execute(..);
@hanleyhansen RTFD mate
execute returns true on success false on failure.
your if statement is redundant.
 
@rlemon sweet. ok thank you. sorry it's my first time with PDO.
 
and don't select * if you only want a true false and no records.
look for id or something
or count(*) nvm
just not *
why do you need to select ALL columns when you just want to return TRUE
 
Try to avoid * wherever possible (which should be everywhere)
 
10:54 PM
^ that!
@hanleyhansen first time is no excuse for not looking at the documentation :P
 
@orourkek will do
 
i'm always flabbergasted when people neglect to view the documentation and just come here or hack away at it :P
 
@rlemon thank you
 
@hanleyhansen np... php.net is your friend.
learn to search it. ;)
 
@rlemon just for future reference. what should i have searched for?
 
10:57 PM
I'm a genius
 
@orourkek CESU-8 is not an official part of the Unicode Standard, because Unicode Technical Reports are informative documents only. It should be used exclusively for internal processing and never for external data exchange. (smart alec on wikipedia)
 
huh, I didn't know that
then again, I rarely stray from utf-8 these days
 
@rlemon nevermind
 
why would you aside from legacy support with less modern applications
 
True enough
 
11:01 PM
@rlemon is it considered a failure if the query runs but returns no rows? that's what i'm looking for. If the particular row isn't found i want a false.
 
@hanleyhansen that was not part of your question :P
 
if you use curl to submit form on someone's website can that website owner find out that you did it automatically but not manually?
 
@rlemon i know. sorry. poorly phrased on my part.
 
return $stmt->execute() && $stmt->rowCount > 0; // ??
 
user895378
@Templar If you send the appropriate headers, the server has no way to tell the difference between a human and a computer.
 
11:04 PM
@rdlowrey what do you mean appropriate headers?
 
^ not robot headers!
 
unless you do something dumb like make more requests in a given time frame than a human could make
 
user895378
@Templar google "HTTP request headers"
 
user895378
@orourkek that too.
 
I so wish it'd be possible to do return if(foo()){ echo'bar'; }
it seems to idiotic to if(foo()){ return "bar"; }
 
11:05 PM
return foo() ? echo "bar" : ;
 
@Chris conditional operator?
^ that
 
I knew that. Pff.
 
@rlemon Can you explain that to me?
 
@orourkek lol, the bounty question got two new answers within minutes ;)
 
@rlemon Got it! Nevermind! Thanks!!
 
11:11 PM
@hakre all these efficiency hounds in here!
 
@rdlowrey if that site uses cookies do you need send it in header as well? and isn't it hard?
and there are a lot of requests which i don't know at all, how i can know what requests my browser is sending?
 
how are you sending the data..
 
developer tools -> network ?
 
XHR send HTTP_X_REQUESTED_WITH
things like that
so if you are using just a FORM post... check you enctype and see what headers are sent
 
11:27 PM
@rlemon rowCount() doesn't work with SELECT statements in MySQL.
 
says who
 
The net. I can't get it to work either. I keep getting 0.
 
@rlemon says I
> If the last SQL statement executed by the associated PDOStatement was a SELECT statement, some databases may return the number of rows returned by that statement. However, this behaviour is not guaranteed for all databases and should not be relied on for portable applications.
 
This is supposed to work: $q = $db->query("SELECT ...");
$rows = $q->fetchAll();
$rowCount = count($rows);
echo "There are $rowCount rows\n";
foreach ($rows as $row) {
print_r($row);
}
Supposedly.
@RepWhoringPeeHaa Yup
 
how about && count($stmt->fetch(PDO::FETCH_ASSOC)) > 0;
might work.
maybe
 
11:32 PM
fetch will work with my prepare statement?
 
why wouldn't it
 
just wondering
 
@rlemon returning all 1's
 
@hanleyhansen 1 is truthy
sigh
 
11:34 PM
i know. they shouldn't all be true though.
 
$stmt = $DBH->prepare("SELECT * FROM assignments WHERE 'project_id'=? AND 'person_id'=? LIMIT 1");
if( !$stmt->execute() ) {
	return false;
}
return count($stmt->fetchAll()) > 0;
i think the issue was fetch/fetchAll
try something like that
and you do know how to use prepared statements yes?
 
Yes
$stmt = $DBH->prepare("SELECT * FROM assignments WHERE 'project_id'=? AND 'person_id'=? LIMIT 1");
if(!$stmt->execute(array($project, $pid))) {
return false;
}
return count($stmt->fetchAll()) > 0;
 
well that is one way??
 
$stmt = $DBH->prepare("SELECT * FROM assignments WHERE 'project_id'=:project AND 'person_id'=:person LIMIT 1");
if(!$stmt->execute(array(:project $project, :person $pid))) {
return false;
}
return count($stmt->fetchAll()) > 0;
 
there we go
still semantically wrong but I get it :P
hehe
 
11:41 PM
lol
i can only type so fast
now getting 0's!
 
lol
TYPE FASTER!
 
@hanleyhansen what is this? array(:project $project, :person $pid)?
 
why can't freaking rowCount() just work with MySQL smh
 
anyways
gl
 
@RepWhoringPeeHaa project_id and person_id
 
11:44 PM
Shouldn't that be key / value pairs?
 
@RepWhoringPeeHaa yes. disregard. i was just typing it quick in here
 

« first day (573 days earlier)      last day (4379 days later) »