« first day (205 days earlier)      last day (5041 days later) » 

00:10
I just saw this :\
user image
2
00:20
lol
1
Q: Can a posts be edited one times in total by multiple user?

Andrew GrimmWe came across this error messages while editing an answers: Be advised: this post has been edited 1 time by other users while you were editing. If a posts has been edited one times, should they be "another users" rather than "other users"?

> Giant S, bludgeon, death, yada yada. – RegDwight 25 mins ago
00:57
Hello
01:35
Hello
Hi
So tired.
MY FACE IS FLAKING OFF
That...sounds pretty intense.
Yea, so i want to remove whitespace/padding from a javascript string
It's less intense than it sounds.
01:42
How would I do so?
witha... REGEXP!
@Moshe You could start by searching SO (;
[javascript] trim implementation
@RebeccaChernoff - You have to stop making logical suggestions. Really.
Copy+Paste, Rejoice (likely, I can't believe there's not decent results for that)
01:44
-implementation
that's one of those resume weasel words, not a real word!
Yeah, I know, being logical is a bad habit of mine.
@DanGrossman Fair enough :P
23
Q: .trim() in JavaScript not working in IE

Jin YongI tried to apply .trim() in JavaScript in one of my programs. It's working fine under Mozilla, but an error displays when I try it in IE8. Does anyone know what is going on here? Is there anyway I can make it work in IE? code: var ID = document.getElementByID('rep_id').value.trim(); error di...

@DanGrossman Was jus lookin' at that. Good point.
01:49
that is perhaps the ugliest car I've seen..
In JavaScript, if I have a regular expression that I use in multiple functions, is it evil (bad practice) to declare it as a global variable/constant?
@TylerChacha I dunno, the Nissan Cube comes pretty close. But they're both ugly, no doubt.
@Moshe No.
Unless...
@TimStone I just don't think I could respect someone who drives up in that car..
var usOrCanadaZipCodePattern = /^\d{5}(-\d{4})?|[ABCEGHJKLMNPRSTVXY]\d[A-Z] ? \d[A-Z]\d$/;
01:52
Unless you used the g (global) flag on it. Then it's evil.
@Shog9 Thank you.
(what, no asking me why global global regexps are a bad idea?)
@Shog9 I'll humor you - why?
Wouldn't mind that one tho..
@TylerChacha I can't respect someone who judges others solely by their ride. :P
@Moshe There are many other reasons you can't respect me... :P
@Moshe Because when you use the g flag, the regexp maintains an internal state (the index it left off searching) - so you've now introduced a mutable global variable.
@DanGrossman You just have bad taste in cars...
@Shog9 I'm not using that flag, am I?
01:55
@DanGrossman ...WTF.
Scion concept car
all-wheel drive motorcycle
@DanGrossman Interesting...
@TylerChacha -1 not - a car.
@Moshe Nope! But I didn't know that when I answered (and then qualified my answer)
@Shog9 Fair enough, I'm safe though, yes?
@TylerChacha All two wheels.
I like the interior of the Nissan Leaf.
@Moshe yeah, you're fine
@Shog9 Great, thanks.
For your amusement:
2
Q: Why am I seeing inconsistent JavaScript logic behavior looping with an alert() vs. without it?

Eric WendelinI have code similar to this filtering entries in an Array of Objects: var filterRegex = new RegExp(".*blah.*","ig"); if (filterRegex.test(events[i].thing) && events[i].show) { console.log("SUCCESS: filtering thing " + i + " " + events[i].thing); events[i].show = false; numeve...

01:57
@Moshe 1 more than most motorbikes
"I don't want to say the other one was old, but its IP number was 1, ya know?"
Does Javascript not treat properties of custom objects as strings - some of the time?
I've got a custom object containing City, State and Zip properties.
The State seems to also have the ZIP attached to it.
object.City, object.State, object.Zip, object['City'], object['State'], object['Zip'] should all work
Right, but object.State = object.State.replace(ZIP_CODE_REGEX, ""); fails to remove the ZIP code.
Unless I'm doing something wrong.
that's fine if object.State contains what you think and ZIP_CODE_REGEX is the right regex
02:12
@DanGrossman The way this works is as follows: User enters ZIP code
If the zip matches a regex, I scrape Google. Google returns City, State, Zip.
I break up the info and populate the city and state fields.
The regex should work.
test it
Dude did you read the blogs I gave you at all?
@drachenstern Which ones?
The ones where you don't need to scrape Google.
@DanGrossman Did, I only query google if the ZIP matches the regex.
02:13
including a full zip to city/state database in text
@DanGrossman Didn't see those.
feels like an idiot now.
if you threw that into a JS object/array you wouldn't have to make any external requests
@DanGrossman Sweet! I must've missed that.
I did see @drachenstern's link to that site, but didn't see that.
Hey @TheRenamedException!
@DanGrossman - Missed that last bit, was copying that file.
I unsaid it
ok, np
02:18
Rewriting history is fun
@DanGrossman Yep.
What are you coding anyway?
A user info form.
For the game?
Well, it's for a benefit raffle for a high school
02:18
oh, neat
Yea, so I decided that the user should need to enter ZIP codes and City/State
It's redundant.
So I take zip code and then show the city/state fields - prepopulated if I can.
@DanGrossman Heh ;)
Is there a similar list for canadian ZIP->City/State?
@DanGrossman Thank you. That second one is a keeper. Really nice.
Ooh CSV too, a treat!
Eh, not really CSV, but vertical pipes can be easily replaced.
They have an interesting definition of "never"
Heh, and it came with ME, nice.
AOL version 5.0 included!! You don't even have to travel to your mailbox for one of the 3 CDs a day they mailed you!
I am really really happy now.
Thank you @DanGrossman. The uses of a CSV of postal and zip codes are incredible. You've just put a nice touch on several of my projects and made my life easier.
@DanGrossman Yea. For one, my form doesn't need to use YQL to scrape Google for data. Second, I don't need internet connectivity for my iOS app to get latitude and longitude anymore. Really, YAY! \o/
B"h.
02:38
Cred to @drachenstern for posting that site with the link to the US zip code list first
@DanGrossman Right, that too was good work. I was referring specifically to the populardata.com link, though - that has the exact data in the exact format.
@drachenstern - Thank you for your help as well.
feels like jumping up and down but is too exhausted
How cute. Wordpress does a Mac OS style "shake" when you enter an incorrect login.
@DanGrossman Neat. Is it still in WP?
I don't know, I guess I'll have to find out
Yes, yes it is :)
Where do I get that revision screen?
02:48
On the edit post screen, scroll down to the revisions box, click a revisoin
haha
really awesome
@DanGrossman you are on a roll.
I'm too tired to make changes to this build... must move on.
Filling out my Careers.SE profile. What goes in the personal statement? (I'm tired and haven't done this kinda thing before.)
03:19
ARe there new rules for deleting questions I don't know about?
@GeorgeStocker - Hey. Was about to sign off.
I used to be able to vote to delete closed questions, but I can't seem to vote to delete this closed question: stackoverflow.com/questions/4715904/…
Me neither.
Just flag it.
@GeorgeStocker Hm, maybe because of the reopen votes?
@Tim that would be new.
It's never stopped us before.
03:22
I am able to DV it
Yeah, just speculating.
vote to delete it?
Hm, interesting.
I put about 20 minutes into this answer to a year old question, and I'm betting the OP will never revisit it. stackoverflow.com/questions/2591531/…
03:23
it's a 20k rep privilege now... stackoverflow.com/privileges/trusted-user
I knew they had the second privilege, but I didn't think they'd take away the first privilege from 10kers.
20K just eases the restrictions of the 10K vote to delete
Right, but you can't dv for a few days after close at 10k
Ah, right, right.
I didn't realize the question was only closed yesterday, that makes sense then.
Anyone here want to help me fill out my careers 2.0 page?
03:29
/me needs to do that myself
@ircmaxell - Never filled this stuff out before.
What goes into a personal statement?
Erm, filling out your info is kind of something you need to do (;
@RebeccaChernoff I know. I know. What is an example personal statement?
@Moshe It's not a tax form, you can put whatever you want there. Or leave it blank.
@DanGrossman Ok.
What do I know? I'm (barely, but) still a kid.
You've got a loooong resume already
@DanGrossman Oh, you saw that, heh.
yeah ive been to your site
What do you think?
03:33
@Moshe It's kind of like a summary on a resume. An elevator pitch. I.e. the most salient points about you that would interest an employer.
is fishing for a compliment and deserves a smack.
i.e. Why they should hire you, in paragraph form.
Your resume makes me sad, because I have no references anymore
"I'm a self taught programmer with a proven track record and passion for what I do." Good?
03:34
@Moshe, if you want someone to fill out your resume for you, you're doing it wrong.
2
It's been too many years since I worked anywhere, my former bosses aren't in their positions anymore
It's really no more complicated than that.
@RebeccaChernoff True, but you've said that already.
@Moshe It's a good a start.
You didn't seem to get it. q:
03:35
Ok, I think I got this figured out. (I hope so, anyway.)
There's no wrong answer.
As long as we're linking CV's... careers.stackoverflow.com/george
@RebeccaChernoff I just don't want to sound full of myself or by contrast, unqualified.
Though, I don't have a personal statement, yet.
@RebeccaChernoff Except one that doesn't include jQuery.
03:36
"This is too technical for me" comment in response to a "Linux 101" page about changing your PATH on a programming question on StackOverflow = a wrong answer, always a wrong answer
@DanGrossman Where?
@Moshe That's something more to worry about during interviews.
@TimStone Ok, so a resume should sound overdone?
bbiab
@GeorgeMarian Ah nice, I know a few people at Cornell.
@Moshe It can be a difficult balance and certainly difficult to talk about yourself. Especially, if you try to do it in the 3rd person.
03:38
@Moshe ...No, but honestly, I don't pay that much attention to what people write in resumes.
@TimStone Great school. I met a lot of really good people there.
I learned Java when it was still new and we did PCR in my bio class, which was relatively new as well. Lots of great experiences.
I would have gone there had they not rejected me. ;)
Ah, neat stuff. :D
I may have taken advantage of the "back door." The university has both private and public schools. The public schools have a mandate to accept more in-state students. :)
Still, it wasn't easy.
A lot very competitive people from the NYC school system go there.
@GeorgeMarian Yeah, I bet
I spent most of my time pre-college doing things that are difficult to put on paper, so since I was bound by applying to M.I.T. early-action, I really had no chance. Too many good people out there, heh.
was it like ... expensive ?
03:43
@Reno It wasn't cheap. Cheaper for me as an in-state student, but I did have to pay for one year of private engineer school tuition. I ended up w/ over 20k in loans.
I had a healthy amount of financial aid, thankfully.
@TimStone Where'd you end up going?
Ah, I'm almost reluctant to say, heh. :P
heh, as if...it's what you make of it, ultimately
If you look at the gaps on my resume, well you figure it out. ;)
Granted, I'm rather far from my major.
Though the school feels the name to change its name every ten seconds...
03:47
lol
It used to be Philadelphia College of Pharmacy at one point.
Not exactly the place you'd expect to go for CS, heh.
That's rather specific.
@TimStone lol, no
I wish I had a CS degree, but I didn't discover my love for programming and computers until I was in college.
Where exactly is USP? I know it's close enough that I'd see USP students hanging out on Drexel's campus occasionally...
:looks it up:
The school is actually really good, but my program was kind of hanging on by a thread...it's actually on hiatus now, heh. They've asked me for opinions on how to strengthen it to reoffer it in the future.
Well, I did really like my Commodore 64, but my dad saw that as waste of time on account of the all the video games. lol
03:49
@DanGrossman 43 and Woodland
So beyond UPenn
Oh... hmm... I walked down that way a few times, so not too far
When someone drove into the side of my car, it got towed to a shop around there
I bought a new car the next day while insurance took a month to get the old one fixed, then sold it
sold it for less than the insurance co paid to repair it, they shoulda just called it totaled
@GeorgeMarian I started getting serious about it at the beginning of high school...mainly because I depressed about moving back from Hong Kong, and wanted money to go back.
@DanGrossman Nice, heh
@TimStone I remember bugging my dad to buy me a 486DX based system when I was in high school.
I got a C64 my uncle wanted to get rid of, hooked it up to a black and white TV, never got to see its glorious 4 bit color
I finally guilted him into buying me a P90 in college. I then proceeded to spend a lot of time in front of the glowing tube.
I got into CUNY, not hard, but still, it's better than having nowhere to go.
hehehehe: Tandy TRS100 followed by an AT&T 8600 (8088 processor, 2mb ram)
@RebeccaChernoff w00t! \o/
03:54
@RebeccaChernoff Nice!
@Moshe From what I've heard CUNY is a decent school.
I love it, my bug report was deleted... ( meta.stackoverflow.com/questions/80569/… - for reference)
@GeorgeMarian Well there are a bunch of CUNY branches. I got into one of them, waiting to see if I got into the honors program. (I doubt it, my resume detracted from school to an extend.)
granted, it was fixed on its own, but still...
04:00
Bad (but true) personal statement -> "I would be the mayor of the Apple Store if I was on FourSquare. I hang out there too much."
What do you do there?
@Moshe: I'm the opposite. I've been in one once, and only to poke fun at the genius bar while a friend got his laptop fixed
@ircmaxell Ahaha :D
04:02
@DanGrossman Well the first time I was there, I bought an iMac.
I try to like the stores because they're pretty, but I can't actually stand being inside of them. Tons of people crowding around demo gadgets and nothing else to see.
@DanGrossman True it is crowded.
I can't stand the smug footprint being inside the store...
@Moshe As I was saying, it's what you make of it. A friend of mine (and former boss) went to CUNY. He's now building big financial systems. My brother went to the University of Buffalo. He's now 3-4 years out of school and vaulted over me, career wise. My little bro is now a lead developer and highering schmucks like me. ;)
I can go to Best Buy and play with iWhatevers as much as I want without the crowd
I tried to use a demo iPad to access the Target weekly ad to check something, that was a total failure... and convinced me I really don't want an iPad
04:03
@ircmaxell LOL yah, the apple stores are something else, alright.
The next time I went to get Adobe Premiere diagnosed as being incompatible with Mac OS 10.6 (after which I upgraded premiere)
I went with a friend to get him an iPod, I think.
Relevant:
Then I bought a MacBook a while later.
04:04
Been going every two weeks or so since I was in the area.
@ircmaxell hah
^ Microsoft's store
I've been there (the MS store)
@DanGrossman Oooh, Microsoft rented an IKEA warehouse.
04:05
actually not bad at all...
I spent my maximum employee discount quota there :p Something like 5 copies of Windows, 7-8 copies of Office, some Xbox games...
@Moshe lol
@DanGrossman Now, I mostly talk to the blue shirt folk. (Yes like the mods here, Apple people wear blue)
alright, need sleep
good night
04:06
@ircmaxell g'night
@ircmaxell nite
Today, I got a friend's iPod replaced, (well kinda, they ordered the replacement in) and sold my game to an employee.
@waffles Dang.
Yep, I went to the Apple Store just to sell my App to an employee. How's that for dedication/obsession/too much?
Seriously though, I have to stop going to that Apple Store.
Oh, I went around to a bunch of display iPhones/iPods and brought up my app and walked away. Free advertising until the next person uses the device.
@GeorgeMarian - Yea, I had too much fun.
04:09
dear coffee addict ... SO is not a forum ... stackoverflow.com/questions/509185/…
classic
@waffles yeppers.
@waffles Goodness, that's bad.
sigh
@DanGrossman - Did you bother reading my entire resume? doubts it
@Moshe Who the heck reads an entire resume? ;)
I skimmed. It's too long. I wouldn't send out something longer than 1-2 pages.
04:11
@DanG @GeorgeM - Right, I know.
Yup. Two pages, max.
And, you better have a good reason for it.
I was once sent a 7-8 page resume to use as a guide for my summary. A whole lot of the stuff on that resume was basically copy-and-paste. =/
Which is truly sad for a programmer's resume. We should naturally want to reduce unnecessary repetition.
Does Careers 2.0 follow that 2 page limit?
In theory, not practice.
Should I list all of my various freelance website jobs, for example?
@Moshe Not exactly, but it does limit what's initially presented.
dangrossman.info/resume.pdf was my old old resume, one page
Technically speaking, it's billed as a CV. Those are usually longer. Though, there is the question of whether you need to use a CV format.
04:16
> In the last day or so we launched a pretty big algorithmic improvement to our ranking—a change that noticeably impacts 11.8% of our queries—and we wanted to let people know what’s going on. googleblog.blogspot.com/2011/02/…
hrm...
finally
three high priority projects, too tired, it's late
what to do?
{Nippon || Client || School Site || bed}
rand(1,4)
EAT JUNKFOOD IN BED
@DanGrossman Had too much junkfood already
@DanGrossman - remember that script that s/o posted yesterday that allows cross-domain jQuery GET requests?
I just bothered to read the "black box". It converts it into JSONP through YQL.
04:21
mmhmm
It's cool.
I dislike it for several reasons
top of the list is that YQL could disappear at any minute, given Yahoo!'s track record
they shut down MyBlogLog today
True
What alternatives are there?
Using proper APIs rather than scraping, and if you have to (and are allowed to) scrape something, write your own server-side proxy to provide just the data your app/website needs in json, so you can make a normal ajax request.
I'm interested in how scraping works now.
I'm just interested to know how it works.
04:35
Roll your own JSONP-style proxy: <?php $html = file_get_contents($_GET['url']); header("Content-type: text/x-json"); echo 'data = "' . json_encode($html) . '";'; echo $_GET['callback'] . "(data);"; ?>
Just that code will grab any URL as json?
Something like that, it'll download the HTML of any URL and spit out some javascript
Neat!
Not sure if it'll actually work as I wrote it, minor details :p
I need to examine this.
04:37
But your JavaScript side would print out a <script> tag pointing to that URL with ?url=some_url&callback=funcname
I can add this to my site, and ditch the YQL. If the form is up, so will it's dependencies be.
which is why JSONP is not AJAX at all
1 sec, rereading the xdomain.js
@DanGrossman - I'm not getting this. Which piece of code successfully ignores the same-domain-policy?
The json header does that?
There is no same domain policy because you don't make an XMLHttpRequest from the javascript side
you inject a <script> tag into the document instead, which can point to any domain
So PHP can load files cross-domain?
04:43
of course it can
How does the server on the other end know it's PHP making the request and not my browser? It doesn't.
True, so why does Javascript not work then?
Because it's a security policy built into every browser
Ah, ok.
So I could theoretically call a webpage on another site, inject it and then manipulate the page and run it?
The purpose is to prevent you from hijacking someone's browser to make requests in their context to other websites... i.e. to prevent you from taking that user's browser, and its cookies, and its sessions, and accessing a bank, and sending the HTML of that bank webpage to your script, where you tell the bank to transfer all their money to you.
But it doesn't stop me from making a file that's on my server pretend it's local on your server, correct?
04:47
It's not an issue on your server, because your server doesn't have my whateverbank.com cookies, which you also can't get at
So, take Wordpress and the emergency reset form.
I can load your wp blog's HTML and use my emergency form and get into your WP site?
You can't
Why not?
I don't know what an emergency form is, but how would loading the form get you into my site?
by proxying to your WP forms.
04:48
But I'm clearly not on my website, my address bar shows I'm on yours
There is some WP form that isn't well known, I saw it once.
I'm not going to enter my wordpress login info on your site
No.
Example:
A owns a wordpress blog
gets popcorn
B wants to get access.
B grabs a copy of the emergency reset form and directs the parameters at A's wp site
why wouldn't that work?
Google: wordpress emergency.php
04:52
Can you make a different example? Since I have no idea how this emergency.php file works
I'm not going to download and install it to figure this out
@DanGrossman hang on, switching to iPhone
er, ipad
glancing at emergency.php, it runs some queries against the database to update the password or something
emergency.php is not going to exist on A's wordpress blog, so B trying to access it will just get a 404 error
B can't "point" his file at A's site in any way
Does emergency.PHP not exist by default?
No, it's just a script some guy wrote
Well if any wordpress script that does exist can be manipulated in this way, it can be a problem, no?
04:56
Alright, think about it like this
when PHP downloads a webpage, it does it exactly the same way your browser downloads a webpage
Ok.
Is there a way you loading my wordpress blog gives you access to my wordpress blog? No
@TimStone lol
If you point your WordPress login form at my blog, you still dont' have my username and password to type into the form, and my WordPress is going to reject your input no matter where the POST originated from
@DanG got it.
04:59
The reason it has to be blocked in the browser is that if I were already logged into my WP blog, and you made an AJAX request to my wp-admin, it'd succeed because I'm already logged in, then return the HTML to your script
You essentially are me, since you're in my browser
That's why it's not allowed to happen

« first day (205 days earlier)      last day (5041 days later) »