« first day (409 days earlier)      last day (4608 days later) » 
05:00 - 19:0019:00 - 21:00

5:56 AM
1
Q: Users can raise their own flag weight. :O

Peter OlsonRecently, I discovered a way to manipulate the current flagging system so that I can raise my own flag weight. It all began innocently enough. I looked through my downvoted answers and saw an answer of mine that that was pretty lame and qualified as "not an answer". I flagged it, but then I real...

 
6:24 AM
hello
why I am not able to view profile of this user831722?
 
6:53 AM
@hotveryspicy Because the profile does not exist. Apparently, that user has been deleted.
That's why the gravatar attached to his question and answer contains that silhouette instead of an autogenerated gravatar (or image).
 
genius
Because yesterday on his two question i got down vote.
 
That could have come from anyone.
 
thanks
 
7
Q: Users can raise their own flag weight. :O

Peter OlsonRecently, I discovered a way to manipulate the current flagging system so that I can raise my own flag weight. It all began innocently enough. I looked through my downvoted answers and saw an answer of mine that that was pretty lame and qualified as "not an answer". I flagged it, but then I real...

 
Anytime.
 
7:04 AM
@genesis weren't you to write about ti?
 
 
1 hour later…
8:20 AM
@sathya damn, 15 upvotes? I had only 6 :D I was sleeping till now
 
9:06 AM
Here's an explanation why people end up posting questions on Meta instead of SO:
-1
Q: how to show comma saprated date in gridview

Atuli have one gridview i want to show dates(like 12/3/2011,12/5/2011 format) in gridview column by separated how will i do iam trying to retrieve date for id_dfestival(it is unique identifier) iam done some code : protected void dgBTNN_Festival_OnRowDataBound(object sender, GridViewRowEventArgs e)...

> Go to stackoverflow.com Please when posting the question there, take care to indent your text only, not the code. And consider writing capital I's. Thanks! – Pekka
> there show me "Sorry, we are no longer accepting questions from this account. See goo.gl/C1Kwu to learn more." this message – Atul
My faith in humanity is sometimes wavering.
 
9:37 AM
LOL
 
what a trainwreck :\
 
 
2 hours later…
11:30 AM
Hmmmm, pressing enter with the keyboard to select a tag to enter into the list of tags seems to post the question
 
11:41 AM
Say, can anyone else reproduce this? Using Firefox 6 here. Not reproducable on Chrome 13
 
If you're bored on a saturday afternoon, you can get out the popcorn and watch this user's post history.
He is scraping Google, and not satisfied with the results.
It's too slow.
So he is trying to install HipHop (Facebook's PHP compiler) to make it run faster.
 
scraping = cloning or browsing around?
ah :D
 
(But please don't downvote or add nasty comments just on account of my posting it here...)
 
@Pekka You know, I actually tried scraping Google before, and it sort of actually worked!
 
I didn't manage to install hiphop either
@Pekka It just does transfer php code to c++ executable or c++ code ready to be compiled?
 
11:49 AM
@genesisφ actually, I don't really know, I have never looked into it seriously.
 
okay
>I heard that facebook is built on C#
Really? I thought it's in PHP
 
I saw the xkcd comic comparing the number of results for various Google searches on dying by x, and thought I might like to automate the process a little and wrote a script to do it
It actually worked, but broke the next time Google updated their search page
 
@YiJiangs独角兽 yeah, that's the problem with scraping.
 
hasn't google api search?
 
Yeah, but I was looking for something quick and dirty, so that was the fastest way to do it
 
11:53 AM
btw @pekka,
                    <div class="post-upvote" <?php
                    if ($special['upvote_by_me']){
                            echo 'style="background-color: yellow;"';
                    }
                    ?>>
or
                    <div class="post-upvote" <?php if ($special['upvote_by_me']){ echo 'style="background-color: yellow;"'; } ?>>
 
@YiJiangs独角兽 独角兽 - awwww! :)
@genesisφ neither IMO :) Hold on
 
@Pekka whoops :P okay
 
@genesisφ no big deal, just a question of style and preference. I'll post my suggestion
 
@Pekka Okay. I'm creating question page and it's sooo dirty. I'd like some advice
 
@genesis Using a template would be better. The way I see it, it might be better to use CSS to do the styling instead of inline styles
 
11:56 AM
Well, the perfect thing to do IMO would be defining all variables in the head
And then just injecting the finished result into the HTML
 
@YiJiangs what type of template would you take?
 
So the code logic and the presentation are separated.
 
@genesisφ I was using CodeIgnitor's template engine, which is very barebones but good enough. There's plenty of other more powerful option available if you search for them
 
Could I post my code without being killed?
 
It's not totally necessary to use a template engine though.
Just separating the main PHP code and the HTML in two blocks can do already
 
11:58 AM
@Pekka example?
I know I shouldn't mix html & PHP, but I just feel it's better to define $votes before I actually needed, not BEFORE any html
 
So in the code head, e.g.

<?php
$post_upvote_bg = ($special['upvote_by_me'] ? "yellow" : "white");
?>

then in the body,
<div class="post-upvote" style="background-color: <?=$post_upvote_bg;?>">
@genesisφ yeah, but long term readability is really improved if you separate them
 
Take a look
$comments = $db->query("SELECT c.post, c.id, c.message, c.owner, c.time, u.username FROM users u, comments c WHERE c.post IN(".implode(',', $posts_ids).") AND u.id = c")....
while ($comment = $db->fetch($comments)){
        $comments_list[$comment['post']][] = $comment;
}
$db->query("UPDATE posts SET views = views + 1 WHERE id = ".$posts[0]['id']);
?>
<div class="fl" style="width: 775px;">
<div style="border-bottom:1px dotted #333;margin-bottom:5px;"><b style="font-size:200%"><?php echo $posts[0]['title']; ?></b></div>
 
It's not a terrible thing to mix them, but it becomes spaghetti code before long.
Right. As said, it would help readability to separate things and/or use a template engine, but I don't think this is too terrible
 
What would be reasonable number of queries for question page just like that one on SO?
consider global things as selecting of user dynamic data...
 
@genesisφ depends. I have worked for big Drupal-driven portals that run 500 queries on their front page alone.
Caching is the answer there, obviously.
Or buying a big-ass server :)
 
12:03 PM
@Pekka seriously? 500?
 
Yeah. Drupal with a lot of plugins can do that to you.
 
while ($row = $db->fetch($result)){
    $db->query("Whatever here");
}
?
 
It all depends. I'd say build your thing, then if it's too slow, look into optimization.
Just make sure you have proper database indexing in place.
 
what is faster, mySql query to insert or file to insert?
 
Depends. What do you mean by "to insert"?
You mean to store data?
If you mean your view counter above, don't worry. Really. Benchmark it, it really won't matter. Will probably take a few dozen ms or something.
 
12:06 PM
yes
such as views of question
But really, what is faster? To write to file everytime user access that page and update view count in DB every hour or so?
 
Don't worry - it really doesn't matter. You can use microtime() to get a feeling for what takes how long.
 
I've also had big problems with Q count in my game.
 
There are ~20 queries currently :(
Yes, I know microtime :) I wish it could be accurate little bit more
 
It probably is accurate. It's the stuff it measures that takes sometimes more, sometimes less time :)
 
12:10 PM
okay
 
Seriously, unless you have a actual real-world performance problem (like something taking 0.1 seconds on every load or something) don't worry too much about optimization.
 
okay
 
A query to log a view is perfectly all right. It may become a problem if 100 people trigger it in the same second or something, but that's still a long way off I assume :) Most sites never even get close to where this could be a problem.
 
however, I've got clone of popular browser game running, with ~15 users online and it's taking my server down like once a day. Around (3 * user_count) queries per statistics page. I've got 2000 users, it means it takes 6000 queries on that page :p5
 
@genesisφ fair enough, those are dimensions where it might be worth looking at the queries that run and all.
 
12:13 PM
yes. I would never do that. In my own game (riseofkings.net) there is one query for 20 users in statistics
I think that's pretty nice step.
 
Right! Not bad.
 
I don't use any INNER, LEFT joins as probably everyone here uses it
LOL:this question resolved by OP in 3 minutes
0
Q: Cannot access the session array with php

Ogugua BelonwuI am working in a subfolder on my website: www.example.com/subfolder Now, i want to set a session that is only accessible within www.example.com/subfolder To achieve this, i did the following: private $sessiontimeout= 10800; private $subdomain = '/subfolder/'; private $website ...

 
Hehe, nice!
 
dl.dropbox.com/u/1722364/out-3.ogv in Firefox, for the previously mentioned tag selector problem
 
@YiJ it's gif?
 
12:20 PM
@genesisφ Video
 
@YiJ how did you record that?
 
I've installed a nifty screen recorder application in Ubuntu, no doubt there would be one for whatever other operating system you might use
 
"nifty screen recoder" is the name?
 
Eh, no
Hang on, let me check
 
@YiJ okay, I'm looking for 1. GIF animator or 2. Video capturing with good quality which is not taking 500MB every minute
 
12:23 PM
gtk-recordmydesktop is the name of the package
 
okay
 
 
1 hour later…
1:32 PM
Worth a very thorough read: inkdot.tumblr.com/post/7243925631/no-shit
 
 
2 hours later…
3:28 PM
@YiJiang What's going on here, by the way?
 
3:39 PM
@TimStone Well, no Dan, no server access. The page won't update itself, of course, because the election data isn't part of the API
 
Right. If you just need to host it elsewhere, let me know and I'm sure I can accommodate you.
 
I'm sure six or seven of us could oblige
 
Sure, now would be a good time I suppose
 
and I bet if we asked team@ we could get resources
 
Alright. Unless someone more readily steps up before me, I'll get something set up after lunch.
 
4:02 PM
Fantasy. That bounty trick really works. 7 upvotes so far
 
4:18 PM
@jcole @Pekka what is better? To do 2 DB queries or just one
which counts every row?
0
A: How to use COUNT properly with pagination in php?

genesis φThere isn't, in way you did it. Just run 2 queries SELECT * FROM paintings WHERE id >4000 LIMIT 0 , 30; SELECT COUNT( * ) as total FROM paintings WHERE id >4000

 
I would run them in the same request to the database, but yes
 
but yes -> my answer is correct, but you would use it because?
 
would use what?
two queries?
 
@jco yes
 
You are using words that don't seem to me to make any sense
 
4:30 PM
MySQL does Analytical functions right?
 
@jco sorry. Would you use 2 queries or one query ? What one is better and what one would you use
@Sathya I've got no clue
 
I would use TWO QUERIES and the reason is because THAT IS THE RIGHT WAY
 
apparently not.
 
howso @Sathya
define "analytical functions"
 
@jcolebrand What means "request to the database"
 
4:32 PM
@genesis you can't seriously be as dumb as you imply by asking me that
ergo, you must be trolling
 
@jco I'm not trolling, if you mean "connection", say connection. If you mean query, say query. I have no idea what request could mean. I thought it's one query
 
it means either sending a stored procedure name (which is not technically a query) or sending a raw query (so delimiting the two selects by a semicolon a-la SQL99) or in the textbox provided for querying the database in phpMyAdmin or whathaveyou
 
with Oracle you can do something like this
 
It merely means the manner in which data is requested from the database
which is not necessarily a query
 
okay
@jco The fact I'm not sure about phrase doesn't mean I do not know what does that mean
 
4:36 PM
but you know what a request is
and you know how to send commands to the database
 
I wasn't sure
 
and you know the different types of commands that a database supports
@Sathya do you mean like orafaq.com/node/55
 
I thought it's connection to database which is closed on scrpt execution time or query.
To be honest, I know nothing about stored procedures as I didn't need it
 
you should learn them
if you will use any relational database such as Sql Server or Oracle or even MySQL
 
I'll look on them right now for you. I'll just look what they're for and then I'll decide
Damn I'm watching on code which has so many non-sense code.

$q = "SELECT * FROM .. WHERE .. = ..";
$db->query($q);

it's like "WTF?"
 
4:43 PM
@jcolebrand yeah, same I linked to abov
 
oh, haha, sorry
 
@Sathya you may know: How did the guy (1 rep) change question to CW?
29
Q: Better term for "user"

JohnGBI often have to explain some aspect of an application, and often need to refer to users. I really don't like the term as it is not something with a good connotation (e.g. drug users) to the non-technical world. What alternatives are there that you can suggest?

Post Made Community Wiki by errordeveloper
 
the question itself is a CW
 
but wasn't.
 
once n posts are made then it becomes CW
 
4:46 PM
plus you don't need rep to create a CW post
 
I think it's 25 posts
 
That's it, 32 answers
 
is it?
it's 30 answers, IIRC
 
Yes, for me either
IIRC?
sorry I'm not well knowledged about these shortcuts :)
 
IIRC == If I Recall Correctly
 
4:48 PM
ah.
 
30 on rest, 60 on Code Review & Programmers
15 on SO, 30 on rest
 
something like that
> The question generates more than 30 answers (15 on Super User). In this case, the question and all answers will enter community mode, as will any future answers.
 
Huh

10 facts about you.
1. You are reading this comment
2. you are realizing that this is a stupid fact
4. You didn't notice I skipped three. You're checking now
6. Your smiling
7. You are still reading my comment
9. You didn't realize I skipped 8
10. ur checking again and smiling about how you fell for it again
11. You are enjoying this. You didn't realize there are only supposed to be ten facts. Copy and paste this to ONE video and tomorrow will be the best day ever
 
5:19 PM
@Sathya any idea how can I do "[LINK, LINK2]" with markdown? tried
[[1](i.imgur.com/ASDDL.jpg), [2](i.imgur.com/OczA7.png)]
but result is [1, 2]
 
ok, that's expected behaviour
 
technically that first bracket shouldn't be highlighted
 
[yeah
but this is what you can get now
[ 1, 2 ]
 
@jcolebrand that's what I'm asking
 
[ [1](http://i.imgur.com/ASDDL.jpg), [2](http://i.imgur.com/OczA7.png) ]
 
5:22 PM
@Sathya how?
ah, should I report that one as a bug?
 
probably not
 
you could, but I wouldn't bother. In all probablity it won't be looked at because it's an edge case
 
if you want to, do it in chat feedback
 
@jco it doesn't happen in chat only
 
then you need to show it on meta and provide the use case in your bug report
but I don't think they'll look at it, I agree with Sathya
 
5:26 PM
@jco I know, it would be great for , but it was burniated
 
thank god. I was due to bring it up
 
and probably for good reason, sadly
due to bring what up?
 
alright, I gotta go. It's 11, gotta wake up at 4 & have a train to catch at 6. See ya'll later.
 
wow
see ya
I'll probably candidate in mod elections on SO
@Sathya do you think I could? :)
 
No, you need about 10x more rep
 
5:38 PM
@jco it's all about rep?You need 300 rep on security.SE to be elected
 
no, it's about the top # of users with n rep are eligible
Just trust me, you need about 10x more rep to be a viable candidate
but I encourage you, strongly, to enter yourself
 
@jco thanks for tip.
 
then you will see exactly what I mean instead of just wondering
 
You encourage me because you wanna see my fault or because you think I could be good?
 
because I want you to understand the entire process
and because I don't remember it's documented right now
so I can't tell you what to read to understand the process
and because, having gone through it, you will better understand it
 
5:42 PM
But eventually, do you think I could do it when I'd be more visible around questions with more rep?
 
Sure
The main thing, tho, is being involved in meta and answering questions there and showing that you know what you're doing.
and when you comment on questions, to show that you know how people should answer
and to edit lots of questions and answers to make them better
 
Yes, I participate on meta, I think, a lot
 
So now go edit Q and A on Stack Overflow and show that you want the site to be better
 
I'm trying to do everything of listed things
 
and handle what flags as you can via the 10k tools
 
5:49 PM
I'm out of flags today
 
are you flagging things or handling flags via the 10k tools?
 
@jco handling flags = closing questions?
 
I dont have 10k on a site I don't have a diamond on, I just know that the 10k tools expose some things that the mods can do that the 10k can help with
go read through all the 10k tools
 
@jco I did when I hit10k
 
the evolve constantly
 
5:55 PM
@jcol did you do some progress on your your chat? Will you? I know I have asked before, just interested if something changed
 
I haven't because I've been focused on some meta tasks for some local programs
but I'm probably going to tomorrow
we're gonna redo things mostly from scratch
 
and what are you planning to do?
 
that is incredibly open ended
 
will design be improved? I mean, padding username - message is very low
 
yes
that was a base design to test some thoughts
 
5:58 PM
okay :) I was working a bit on my yesterday, too
 
cool
 
@jco you didn't even accessed it :p But no worries. It's just oneboxing
 
well, it's busted, for starters
 
@jco I know you can chat without logging in :)
 
no, I mean display
 
6:02 PM
Is there something wrong on that? I know these boxes around messages aren't the best, they'll be changed
 
no, hold please
 
whoops, happens only when you're unlogged. will fix it ASAP
@jco refresh. should redirect you to login
 
Busted if I don't put anything in
 
to what?
 
you should not even ask me for username and password if I do openid
 
6:09 PM
sec, I do?
 
open it in incognito
 
not openid.stackexchange.com
get back and insert that first. it might be problem in cases like this
but I'm not sure how uniquelly handle these cases
 
I did it from google
 
@jcole what did you do from google?
 
used the google openid
 
6:14 PM
you've got google email but stackexchange openid
 
never ever what?
 
You haven't use google openid
 
I did so
I authenticated with google
rule #17 ~ Never argue with what a user says they did
especially not a programmer
 
when did you authenticated with google? First time you registered?
 
no, just now
 
6:21 PM
and it succeeded? I think it offered you registration form, didn't it?
 
and I didn't type anything in
you are starting to understand what I said
 
yes, I'm probably getting. Why wouldn't it work with google?
 
idk, cos I hit enter instead of filling out the form?
 
@jcole okay, I probably have no clue what are you talking about. You're trying to say me you logged in with blank openid field?
 
6:29 PM
So, once again please, what the problem is?
 
okay
 
okay, and?
 
THIS SHOULD NEVER HAPPEN WHEN I USE OPENID
and if you do, explain why you do
 
6:31 PM
this is registration form. there isn't such openid registered
 
there is, because I just gave you the data
I know because I saw it happen
 
so it should automatically register and login you without email, username and password?
 
what you should do, instead, is get the data back, create a new account, then show me my account page
yes
 
ah!
one question, how do I recognize user that used openid? When someone inserts google/o8/id, he'll be logged in as someone else. I'm not sure how it works exactly.
 
because you look at what comes back from google
 
6:34 PM
I know - he inserts google/o8/id, it'll requests for some permissions, redirects back to my site and ... ?
 
always consider the response
that is the purpose
 
@jco okay, so it'll include your name/token??
 
yes
we did it on our chat server
 
@jcole and what is unique? what can I rely on??
 
6:37 PM
@jco that seems complicated for begginer in node.js
 
howso?
 
I'm just asking, what is unique and always same
openid_sig is probably not the one
 
would email be unique enough?
it returns the email address when you use google
 
@jco and with the others?
and what when someone guess your email?
 
so what?
the point is that you're supposed to get it from that openid provider
 
6:52 PM
and can't someone guess address of openid response to log yourself?
Okay, probably not
 
waitasecond
 
sure
 
you're asking if someone can spoof a response to get you to think they are me?
 
yes
 
I can make a fake ID and go into the bank and withdraw money, yes?
 
6:53 PM
or is my server sending a request to check it?
 
all an ID is an indication that the person is who they say they are.
I say "ask google who I am"
and you say, ok, google, who is this person (via redirecting me to that page)
then google says 'oh hi Cole, put in your password, and I'll send you back'
and I do
 
okay
 
then google says to you "oh, that's cole, here's his details"
and that's effectively how OID works
 
@jcolebrand and I say okay, hi! I'm logging you in
 
yes
 
6:55 PM
but what when you have my current url that openid redirects me to? in my case

http://stackoverflow.phpcode.eu/login.php?openid.assoc_handle={HMAC-SHA1}{4e74ea7b}{EN487g%3D%3D}&openid.claimed_id=http%3A%2F%2Fgenesis19.myopenid.com%2Fxrds&openid.identity=http%3A%2F%2Fgenesis19.myopenid.com%2F&openid.mode=id_res&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.op_endpoint=http%3A%2F%2Fwww.myopenid.com%2Fserver&openid.response_nonce=2011-09-17T18%3A44%3A11ZJSKUbe&openid.return_to=http%3A%2F%2Fstackoverflow.phpcode.eu%2Flogin.php&openid.sig=IhZU415BOpQAvbD6YgxH9C1FSBw%3D&openid.signe
(currently expired)
okay, probably not. But what should I do to be sure email is sent?
 
I should think the sig is most accurate actually
 
$openid->required = array('contact/email');
 
idk, tbh, I don't do authentication
 
05:00 - 19:0019:00 - 21:00

« first day (409 days earlier)      last day (4608 days later) »