« first day (864 days earlier)      last day (4081 days later) » 

6:02 PM
-2
Q: refactoring if and foreach php

user765368How can I factorize something like this to avoid repetition?: function getResults($data = null) { if(!$data) { foreach ($values as $value) { $data = $value; $this->getSomething($data); } } else { $this->...

Doh!
 
@DaveRandom well, I'll tell you the truth, I kind of enjoy jQuery, and having someone bash it openly and confidently, and with the support of the mass as well makes me fight away any insecurities :P
 
@Hamad That's why it's even more important to know how it works under the hood.
Otherwise people can make any poop argument and you wouldn't know whether it's true or not.
 
> Responsibilities
- Writing beautiful code for applications and services that will give our visitors the experience they expect from a world class media organization
Beautiful code ... that's rather subjective isn't it?
 
@Jack lol, yeah nobody wants poop arguments eh? :P
 
6:07 PM
@Jack it's subjective but certainly more appealing than "pragmatic code" which my brain translates to "hacks"
 
@Hamad That's right!
 
tumblr is asking for pragmatic code: careers.stackoverflow.com/jobs/14140/…
 
There are books on being a pragmatic programmer ... not sure if that's what they meant.
In their defense, they mention it together with "robust"
 
I think I could never get a job at companies like those/these (mainstream).
 
@Jack fair enough
@webarto why not?
 
6:09 PM
> Do new candidates write code during their interview? -- No.
> Do you have a spec? -- No.
Hmmmmm
It's getting late ;-) cya guys!
 
@Jack take care
 
@Gordon I ... just don't know. Most of requirements are not familiar to me, like pragmatic code etc. :) Why don't you apply @ FB? I think you would pass without problems.
 
@Jack take care of pc .. later ..
 
@webarto i doubt it. Kent Beck works there and I assume him to be a few levels above me skillwise.
 
So I have a question, sort of, about how the CV backlog works. I have a ton of fodder but I don't want to spam the room.
45
Q: Close all the typo questions

Wesley MurchThis simple search yields an impressive amount of "too localized" questions related to typos by the OP: http://stackoverflow.com/search?q=body%3Atypo+is%3Aanswer+isaccepted%3Ayes Most of the accepted answers are like this: ✓   You had a typo, "passwrod" should be "password". OMG ...

 
6:13 PM
anyone know where to complain about pirated content
 
@webarto FB is REALLY hard to get into...
 
Any advice/input? Should I not do it or is there some other way I can get this crap cleaned up. The effort is barely putting a dent.
Is this just not the place for it? I mean, it's not strictly PHP related.
 
@webarto I assume FB to be as hard to get into as in Google
 
@Gordon @ircmaxell so, everyone there is better than us, or it's not about technical skills at all?
 
You can never really spam this place when it comes to cv requests
 
6:13 PM
@NullPointer flag it
 
Last I heard
 
Boltclock, use your powers!
 
@Gordon no no .. in website
 
[delete] powers....
 
@Gordon I don't know... pirated content flags are difficult for us as casperOne mentioned earlier
@WesleyMurch :O
 
6:15 PM
"pirated" meaning "plagiarised"?
 
@NullPointer report to the owner of either the pirated material or of the website (unless they put it here of course)
 
@webarto My interview there was the only time in the past few years where I literally walked out of there feeling stupid. Not beaten. Not abused. Not sad. But stupid...
 
@BoltClock Thanks for pulling me up on the whole querySelectorAll() thing, I've just learned quite a bit about how it actually works from the last 15mins of reading :-)
 
@ircmaxell can you tell about it?
 
@DaveRandom No problem!
 
6:16 PM
@ircmaxell So, the cake is a lie, then... I don't know why the first requirement is to solve a task, and then they kill you with questions...
 
@Gordon one of my college mate .. putting pdf of paid book on website and i think its damn bad .... also talke to her
 
So it seems there are some Head Honchos here, is it true: I can "spam" the room with CV requests as I asked? The problem is, it's so spread out that CVs are expiring fast, we can't keep up with it. There needs to be a list.
 
@WesleyMurch Mr Post was saying he tends to use his [delete] powahz sparingly IIRC, because moderator delete votes are binding (i.e. users can't them)
 
@DaveRandom Ah I see, users can't override. Makes sense.
 
@NullPointer then tell you mate
 
6:17 PM
@Gordon Some. I won't go too into specifics though...
 
Anyone familiar with symfony2 router? I want to add a required http method that is an exclusive regex, not inclusive.
 
ahh i really find fun in doing legal stuff
 
invert the regex then...
 
I would post a list in the meta post, but it's hard to tell when they get closed or deleted. Now do I understand correctly that there is some system here that can pretty much take care of this, and it reads [tag:cv-pls] {link} magically?
 
6:18 PM
@Gordon I got offer through careers, got a link to solve the task, I failed there (it was 30 min, I solved in 45 mins or so). Anyways, offer was help with relocation and working visa... because I failed they've (recruiters) said that I can reapply in 6 months. On a related note @ircmaxell, some (not great, not average) from Bosnia got a job there, I hear it's a recommendation thing mostly.
 
@ircmaxell Sorry, I meant change the bool on the matching, so where now a method == /HEAD/ matches head, I want method !== /HEAD/
 
the nytimes website doesnt need a senior developer but a senior designer. they are stuck in the 90s
 
I got a strong recomendation...
or so I felt
 
@ircmaxell Have you applied to some bigger position, like team lead, or just to get in, I'm sort of surprised by that... I can't deal with the fact that about 3000(?) people are way better than you guys... so, I don't think it's about technical skills...
 
I wasn't looking for an entry level spot, I'll put it that way ;-)
 
6:21 PM
Plan is to infiltrate the facilities first :P
 
It amazes me the demands people will put on software, help, etc, yet they'll put up with bad web hosts forever...
@webarto Not for me. I am at a point in my career where that would be a step backwards...
 
@ircmaxell By the way, I liked your post earlier this morning.
Great points.
 
thanks!
 
@ircmaxell Of course, naturally.
 
Evening
 
6:25 PM
@PeeHaa The Template Tweaker :)
 
It's LEAD template tweaker
 
@ircmaxell "Dear Fb, my name is Anthony and I hereby apply as CEO"
 
@Gordon nah, not that high. I'll settle for CTO...
 
@ircmaxell always the modest type ;P
 
6:28 PM
:-X
 
@Gordon HAHA
 
@Gordon then again, if you never try, you'll never succeed...
 
@ircmaxell true
 
6:35 PM
I think I'm going to try that sometime... Walk up to a CEO and say "I want to be your new CTO" without any prevocation or anything
 
"CTO me, I'm famous."
 
@webarto yey ...
 
@NullPointer I'm anonymous, just saying who can one come up to CEO :P
 
@webarto And I'm Incognito.
\o/
 
6:37 PM
@webarto from my experience, that is possible. you wouldnt believe how far networking can get you :)
 
@Gordon what did you do? :-O
 
@Gordon Of course :) ... yes, it's all about connections.
@Incognito True dat :D
 
@webarto i am CFO .... just manage my pocket money ..and money i earn :P
 
@MadaraUchiha nothing
 
@DaveRandom Looks interesting what you have dumped again
 
6:39 PM
"Nothing" doesn't cause your name to pop up like that
And right before an election too :-P a risk taker
 
@MadaraUchiha pop up where? new drama? Oo
@MadaraUchiha help me, i dont get it :(
 
Mod chat. They say you were targeting someone?
 
loool
 
And I was like "no way it's that Gordon"
 
@MadaraUchiha You mean you didn't know?
 
6:42 PM
The saga continues
 
@MadaraUchiha
 
No I didn't, I was out nearly ask day long
all
 

The Mihai Incident

7 hours ago, 1 hour 13 minutes total – 347 messages, 22 users, 2 stars

Bookmarked 6 hours ago by Gordon

 
Lol
Bookmarking win
 
Interesting
29
Q: Fix the ability to dispute flags

Mad ScientistThe way disputing flags is handled is rather confusing for anyone not familiar with the arcane details of the SE platform in this area. In some parts the feedback users get is only confusing, in others it is plain wrong. The main problems of the whole mechanism are The "disputed" status of a fl...

 
6:46 PM
 
What does that have 68 votes?
 
@MadaraUchiha also in image formate
 
@NullPointer Haha, epic, how did you do that?
@MikeB what reason etc?
 
6:49 PM
Hmm, that's old though. I can remotely remember this guy. So what's this new buzz all about @Gordon?
 
@webarto firefox Fireshot
 
@webarto What reason? Why do I think it's a dupe?
 
@MikeB that question should be scorched from SO
 
@Gordon you are fast :P
 
6:49 PM
it is a low quality question with harmful answers
 
@MikeB No, sorry, there is no votes on it, and you've tagged it as CV?
 
@MadaraUchiha he commented on my nomination today
 
@Gordon didn't know @NullPointer that :) thanks
 
@webarto not constructive
 
@webarto I only see 1 vote on it i.imgur.com/YCORrJo.png (mine)
 
6:51 PM
@Gordon ah, I see.
 
@MikeB Well, you've linked to stackoverflow.com/questions/97984/… and not that on screenshot? :)
 
ah crap
 
@tereško thanks
 
@webarto yw
 
@MadaraUchiha later he would come here and thats when the transcript happened.
 
@MikeB that's more like it :P
 
Apologies, I linked to the original instead of the dupe
 
So, what shall we do if we closed the original? :D
 
@MikeB close as duplicate of another non constructive question ?
 
which means @tereško is probably upset with me :p
I closed it as a dupe, but I can see not-constructive as well. I'm never too particular about the reason
@NullPointer Yeah I didn't mean to cv the older question. I think I've created an endless dupe-loop
 
6:55 PM
I see
 
@MikeB yaa i have l also vote on another as NC
 
:7944175 dont do that pls. i am happy we sorted it out by now. thanks.
 
user895378
Hehe, I intended to delete it, just needed a few seconds of fun :)
 
@rdlowrey however it was funny =oP
 
lol
 
6:59 PM
Please for the sake of Uncle Gordon and the existing moderators... control your temptations
 
ahh got .. he is not here .. other wise ... it would be like WW3
 
since i do not really know what this all is about, i have an opinion
 
user895378
Oh geez, nevermind. Don't need a flag/ban in my life.
 
Oh geez, I miss all the fun.
 
pizza. laters
 
user895378
7:02 PM
@rlemon Y U MAKE beta.lemonmeme.com TO GET ME IN TROUBLE?!?!11
 
It's so easy to make a sin.
 
user895378
@webarto we might be ... cyber-bullies.
 
@rdlowrey We are muscular and tanned and sit in front of 'puter? :P Bald head, chain around the neck?
 
user895378
Brogrammer pwnz all!!!
 
No question in CV list is left opened, arrrrrggggh.
 
7:06 PM
Hi, mysql to get first day of previous 3 months ? I tried with SELECT concat(date_format(LAST_DAY(now() - INTERVAL 90 DAY),'%Y-%m-'),'01') which gives 2012-11-01...but i need Feb 1,Jan 1,Dec 1 as date . kindly advice
 
Do you want us to shed some light?
 
@webarto: basically you don't have a meaning to go on?
 
@Ocramius Sorry, what are you replying to? There is a Reply button/option :P
 
@webarto This
 
@rdlowrey for when you have a bad day. run this in the console with a chat open
var img = new Image();
img.src = "http://fc09.deviantart.net/fs71/f/2011/143/2/f/blood_splatter_transparency_by_sagacious-d3h1yw6.png";
with(img.style) {
    position = 'fixed';
    top = left = '50%';
    height = width = '800px';
    marginTop = marginLeft = '-400px';
    zIndex: '99999';
}
document.getElementById('main').appendChild(img);
 
user895378
7:08 PM
lol nice
 
@Ocramius Ah, that questions was left open in batch of 49 closed questions, that's it :)
 
@rlemon lol
 
oh, my bad :)
 
@rlemon You couldn't do this shorter/better with jQuery...
 
shorter - yes. better - no
not using with would be best
 
7:09 PM
@rlemon y u have jquery ..?
 
A bit shorter, maybe. But waayyyy worse.
 
> run this in the console with a chat open
I had a disclaimer
does the PHP room have lots of redditors?
 
night guys .. cya ....
 
@NullPointer night!
 
7:12 PM
♫ karma karma karma karma karma chameleon ..
 
@webarto sorry but why this link show dialog chat.stackoverflow.com/rooms/24830/…
 
I can haz haxor :P
 
@webarto what exactly is that ?
 
image/file behind HTTP auth, it thought that shouldn't show up... but I guess it should...
 
7:16 PM
that's why image files are proxied etc.
@Ocramius HAHA, where is that?
 
@webarto what @rlemon pasted
 
r/css on reddit
apparently ##css on freenode suffers worse
 
Ah I see, thanks.
 
@webarto ah i see thankyou
night ... now really
 
Hey all!
 
7:24 PM
hello
 
@webarto , please stop
 
how is possible if I type <b>hello</b> the html is not interpreted?
 
@tereško Just giving example, m'kay, sorry.
 
@rokimoki Your name sounds different, but nice. Is that your real name?
 
do you have to do it every day ?
 
7:26 PM
@Appu you mean rokimoki?
 
Of course what else I refer?
 
I see
it's not my real name, my dad doesn't hate me like that
 
@rokimoki hate? What does it mean then?
 
I want to know if there is a php function to scape html tags, or simply to tell that html to not be interpreted when printed, for example I have in a database in a field <b>Hello</b> and if I echo $var; containing that string will print Hello
To hate
 
7:29 PM
$('.avatar-16 img').each(function(){
$(this).attr('src', $(this).attr('src').replace('s=16', 's=128')).removeAttr('height').removeAttr('width').attr('src', 'http://mustachify.me?src=' + $(this).attr('src'));
});
 
@rokimoki Is this what you want? php.net/manual/en/function.strip-tags.php
 
@rlemon make it pretty, without jQuery :D
 
@NickFury I will try it a moment, thanks
 
7:33 PM
@MikeB awesome :D
 
@webarto already did didn't I?
 
I need a moustache extender
 
ohh no wait I didn't.
it's jQuery in the userscript
 
7:34 PM
<--- already there @rlemon
 
@webarto give me 2 minutes and I will have a re-write
maybe 7
 
Hehe no probs.
 
@NickFury that function seems pretty good but for example in this chat I type <b>Hello</b> and doesn't interpter the html, just print with tags, is that possible in easy way to go with a function?
*interpret it
or something like str_replace "<" to "\<" or something working
 
function lookup(cn, n) {
  var r = n;
  while( r = r.parentNode && !r.parentNode.classList.contains(cn) );
  return r;
}
[].forEach.call(document.querySelectorAll('.avatar img'), function(img) {
  var test = lookup('user-fontainer', img).className.match(/user-(\d+)/g);
  if( test ) {
    var id = test[0].split('-')[1];
	this.src = gravatarUrl(id,CHAT.user(id).email_hash,128)
  }
});
 
7:40 PM
@rokimoki How bout something like php.net/manual/en/function.htmlentities.php ?
 
untested
and ofc I didn't mean fontainer
damn, lookup fails.
ahh well. you get the idea.
with more testing I could get it working
 
oh
@NickFury thanks =)
 
ahhh
 
So is chat.SO still doing that test.lookingnew.com thing?
 
@rokimoki no problem
 
7:43 PM
... it is
 
I.want.you.com.joke
 
@Ocramius just to let you know... I'm still hoping to get to the bottom of that magic stuff over and out
 
@markus I have no clue on that, but it's cool that you ping me since I'm interested
@markus consider asking mwillbanks on #zftalk.dev on freenode. He's playing around with such stuff
 
8:01 PM
I.want.you.to.want.me
 
I NEED YOU TO NEED ME
 
@BoltClock What is it the thing I just blocked?
 
@PeeHaa ?
 
"test.lookingnew.com"
 
8:17 PM
I don't know, but @webarto brought it up on Tavern on the Meta the other day
in Tavern on the Meta on Meta Stack Overflow Chat, Feb 20 at 13:29, by webarto
Request URL:http://test.lookingnew.com/weird/weird.jpg
Request Method:GET
Status Code:401 Authorization Required
 
hmmmm too eager md parser
That can be annoying if used properly ;)
 
@webarto haha!
 
user895378
8:29 PM
telnet test.lookingnew.com 80
GET / HTTP/1.0

HTTP/1.1 200 OK
Date: Tue, 26 Feb 2013 20:28:42 GMT
...
 
user895378
^ Somebody's HTTP Auth headers aren't set up very well :)
 
huh?
 
user895378
@webarto Try slapping test.lookingnew.com in your browser and see what happens: 401.
 
user895378
But with GET / HTTP/1.0 you can get a 200.
 
Actually, it's responding to a 1.0 request with a 1.1 response? Sounds bad...
 
user895378
8:34 PM
Yup.
 
user895378
I suspect the authorization works on a per-host basis, but a 1.0 request doesn't have to specify a host.
 
user895378
If it doesn't want to handle HTTP/1.0 it should probably send back 505 Version Not Supported instead of a 1.1 response.
 
user895378
> Server: Apache/2.2.22 (Ubuntu)
 
Actually, the proxy prob turned it into a 1.1 request
 
user895378
My guess is that the mod_auth isn't triggered because there's no matching host header for what's available on the server. Apache then "guesses" which host you want in the absence of a Host: header. This is allowed by the http spec for 1.0 requests where no host header exists, but it's dangerous that mod_auth (guessing -- it could be another authorization plugin) doesn't intercept a 1.0 request sans Host:
 
8:41 PM
Well, you guys are weird I'll tell you that :P
Is there a way we prevent this from happening?
 
@webarto We can DDOS the thing
 
HAHA
I mean, in general :P
 
user895378
How are you doing your auth check? .htaccess?
 
unless 1.0 gets a completely different site
 
Not my site at all, I was just looking at some history and it popped out in logs, chat.
 
user895378
8:42 PM
Oh, oh well, then who cares :)
 
user895378
That's something to be aware of, though ... if you have auth setup in apache with .htaccess or whatever, try requesting the protected resources with GET /some/addr HTTP/1.0 and no host header and make sure I can't see your "protected" page.
 
I don't always set up auth, but when I do, it requires DNA check :P
 
Has anyone ever relocated to work in another country?
 
user895378
I'm betting that's not the only apache site on the interwebs with said security hole.
 
@rdlowrey Definitely not.
 
8:45 PM
meta.stackoverflow.com is returning an IIS 8 welcome page for me
woo
 
user895378
It's funny all the nasty tricks you learn when you write a web server :)
 
@Lusitanian You're doing it wrong. I.e. worksforme
 
user895378
screenshot or it didn't happen
 
@PeeHaa lolz. i probably got load balanced to a bad node :(
 
@rdlowrey :)
 
8:48 PM
What a shiny "it works!" page
 
user895378
Whodathunkit. Looks like it did happen. That or you're quick with the photoshop.
 
lol
 

« first day (864 days earlier)      last day (4081 days later) »