« first day (755 days earlier)      last day (4208 days later) » 

3:00 PM
hm, I don't
I get Jesus in thong
... j/k; ofc I get women
 
hey guys
 
hey guy
 
how do you do?
 
3:13 PM
I do what I do well, do you do the do? DO YOU?!
 
I do dodo
 
do you?
 
I do
 
@SomeKittens Yes, better
 
3:16 PM
does doing dodo do dew?
 
the mountain dew?
 
no, dodo dew
 
ok so i have a select of states where the value is the abbreviated state. ex. New Jersey is the text but the select value is NJ. I am querying Facebook's API and when I pull location from the user Facebook hands me Clifton, New Jersey. My question is, how can I change the value of the select based on the text and not the value it self.
 
3:17 PM
document.getElementById('state').value = "NJ"; //works
document.getElementById('state').value = "New Jersey"; //obviously doesn't work. what's the work around?
 
btw, question down-votes are free now
 
@hanleyhansen so you know the textContent of the <option> not the value and you want to select the <option> based on the textContent
 
@rlemon that's the attribute i was looking for. let me try that.
would it be value.textContent?
 
They used to cost -1 rep. When I say "now", it doesn't mean "starting not so long ago", but "I've recently discovered it"
 
3:21 PM
@rlemon document.getElementById('state').value.textContent = state; ??
 
@Zirak Really?
 
no, one sec
 
Oh, right, you haven't been on SO in long
Just chat.SO
 
<select id="foo">
  <option value="a">Option A</option>
  <option value="b">Option B</option>
  <option value="c">Option C</option>
</select>
var myoption = "Option B",
      select = document.getElementById('foo');
Array.prototype.forEach.call(foo.options, function(option, index) {
  if( option.textContent === myoption ) {
    select.selectedIndex = index;
  }
});
 
32
A: Should downvotes on questions be "free"?

wafflesCompleted, all question downvotes now are "free" for the downvoter. We did not perform a global recalc. If you would like your old question downvotes to be free, perform a self-recalc at: http://stackoverflow.com/reputation We will be monitoring voting patterns over the next few weeks and eva...

 
3:22 PM
@Zirak really?!
 
or you want to set the option
I'm not sure what the question is
 
@rlemon I want to set the option based on the state that I get.
Facebook is going to give me New Jersey and I want to set the select to NJ but based on the textContent that Facebook gives me.
 
ah, on questions only, not answers
 
@Zirak Yeah, exactly. '11
@FlorianMargaine Oh, yeah. It'd be pretty bad otherwise
 
look here
I do two things , one you'll want, the other not so much, I don't know which.
I cover you two ways ;)
 
3:29 PM
@SomeKittens Your blog is cool!
 
@AmaanCheval Aww, thanks!
 
@rlemon Perfect! Thanks! It was the first one that I needed btw
Is there a simpler way of doing it?
 
@RyanKinal Thanks. Gabriel Iglesias is hilarious :D
 
@hanleyhansen what do you mean simpler? you loop the options and compare their text with the string FB gives you
how much easier can you get?
 
@rlemon not simpler. just less lines of code. I'm just wondering.
 
3:37 PM
does not work
...
...
@hanleyhansen probably but why? it's like 3,4 lines
 
@rlemon i'm just curious lol sheesshhhh
 
"less lines of code and still readable"
 
@rlemon You going to put JSFiddle fixes on the Chrome Web Store or should I do it for you? :p
 
3:40 PM
I will I will
 
var myoption = "Option B",
    select = document.getElementById('foo');
[].forEach.call(foo.options, function(el, i) { if( el.textContent === myoption ) select.selectedIndex = i; });
three lines
 
Oops?
 
@rlemon 2 lines for me =)
 
3:42 PM
@rlemon I started to type el.textContent === myoption ? and thought "wait... this doesnt work"
 
el.textContent === myoption ? select.selectedIndex = i:;
 
yeah... but ugly
 
You could && it, right?
@FlorianMargaine Why the oops?
 
var myoption = "Option B",
    select = document.getElementById('foo');
[].forEach.call(foo.options, function(el, i) { el.textContent === myoption&&(select.selectedIndex = i); });
​
 
@rlemon lost me here
1 line!:

[].forEach.call(document.getElementById('state').options, function(el, i) { el.textContent === state&&(document.getElementById('state').selectedIndex = i); });
 
3:46 PM
way less readable imo
the handful of bytes saved do not make up for the uglieness
 
First, codify your code messages. Second, just because it can fit in one line, doesn't mean it should.
There's nothing wrong with code using more than one \n
 
it's more bits over the wire! less performant!
 
@Zirak Or \r
:P
 
@andrewjackson's hat's on
 
Hahahaha
 
3:47 PM
wait what?! where is he?!
 
There is something wrong with \r\n being used for newlines, though...
 
hides
Environment.NewLine;
 
@Zirak I know. It's pretty stupid imo
 
ok ok:

select = document.getElementById('state');
[].forEach.call(select.options, function(el, i) { el.textContent === state&&(select.selectedIndex = i); });
 
@hanleyhansen ..... var
 
3:48 PM
Hit Ctrl+K before sending, and there's an implicit global (select).
 
@rlemon being passsed in by the function
 
so you pass in state, then assign it in the function?
sounds kinda stupid no?
 
Over-writing variables is bad, especially when you just between purposes
 
@rlemon no i pass in state from my php into the function. js handles loading it on the form.
 
3:49 PM
you pass the string.
> select = document.getElementById('state');
to
> var select = document.getElementById('state');
 
select = document.getElementById('state');
GLOBAL
 
Also, don't assign an individual id for each input
 
3:51 PM
Grab the containing form, and access them via name (which I assume you have, since it's a form)
 
@Zirak HTML isn't mine. Not much choice over what happens on that end. I was just told to query Facebook and prepopulate the form.
 
Doesn't matter; those getElementById calls are unnecessary if you have the form
containingForm['lname'] will get you the input with the id/name of lname
 
document.forms[indexOrStringName].elements[elementNAME]
document.forms.CoolFormName.elements.CoolElementName; // also works
 
I don't know why the subscript notation stuck in my head and I keep forgetting about dot notation...
 
3:55 PM
@Zirak @rlemon pastebin.com/TYpvEyda better?
 
@Zirak think of it like for objects
 
Cache it damn it
var form = document.form.contacts;
 
@Zirak Liking Arch?
 
@FlorianMargaine I do, like 10 seconds after I use subscript notation
 
@Zirak lol damn you guys are so picky!! ok hold on
 
3:56 PM
@AmaanCheval It's pretty cool
 
Does it look like shit even if you tweak it?
 
Yes! It all worked!
 
Looking like shit is the WM's fault, not Arch's
@SomeKittens Congrats
 
@Zirak Yeah, but does it look better if you tweak it?
 
3:58 PM
@hanleyhansen No. Look at how you're selecting the inputs. Look at it hard.
@AmaanCheval Fluxbox? I'm sure if I tried hard enough it'd look better
 
Yeah
 
@Zirak "hard enough" is not necessary. There are some pretty ones in the default themes, but looks like you have a bug if you can't change them :/
 
I can change the theme, the default Xorg right click menu is what Amaan is referring to
 
the right click menu depends on the theme...
 
4:01 PM
form does not refer to the form, but to the elements
 
@Zirak Any significant advantages over using Ubuntu?
 
The name is confusing
 
@Zirak gotcha. i'll fix that
 
@AmaanCheval Yes. It's faster. I mean, everything. It's also few metric shittons ahead in customizability
And I'm starting to get the hang of pacman
 
4:02 PM
s/mongo/mango/ //Make everything funnier
 
Holy fuck people
 
@FlorianMargaine you went way over my tiny little js head lol
 
s/origin/replacement/ <---NOTICE THE FUCKING TRAILING /
 
that's a lot of repetition...
 
4:03 PM
element is not a single element, but a collection of elements
And I agree with Florian Margaine. You could make that function a lot more generic.
 
@hanleyhansen what don't you understand?
 
Which is exactly what I was referring to
 
@FlorianMargaine oh ok i understand it now.
 
WTF
> A one-time developer registration fee of US$5.00 is required to verify your account and publish items.
Google you are a bitch
 
4:05 PM
Better than the $100 apple wants
 
my goodness, they are forcing you into it now that they have limited you to the webstore
sons of bitches I say!
 
@rlemon Why do you want to verify anyway?
Oh, eventually, for the LeMEME extension?
 
@rlemon hey where's that setting in chrome to allow me to install your chat easy input script?
 
@hanleyhansen No setting
Download the user script
Then drag and drop it on the chrome://extensions page
 
4:07 PM
@AmaanCheval because SOMEONE keeps bugging me to put the jsfiddle fixed on the webstore
 
$5 once >>> $100/year
 
you have to pay $5 to publish
 
@rlemon You don't have to verify, do you?
 
looks like it
 
No way!
Just publish under any name
 
4:07 PM
@AmaanCheval Cool thanks!
 
Don't enter a website or anything
 
I think you need $5 to publish anything, no matter what's the name or something
 
and my canadian visa card for w/e reason isn't taken by google (this is ongoing since the nexus 7 launch)
 
$5 is not much btw
 
yea if you have a way to pay them it!
 
4:08 PM
hahaha
 
Oh. Definitely wasn't that way earlier. I had like 8 extensions
 
Drive to Google's HQ, hand them a fiver.
 
There is three Google dev outfits in my town.
I could go bug some developers
 
@FlorianMargaine Did you have to pay the $5?
 
@SomeKittens i like that idea. road trip anyone?
 
4:12 PM
Sure! My prof once challenged me to try and have lunch with Larry Page. Sounds like a chance to take him up on that.
 
> A friend of mine used to have many Pen Pals when we were younger. At some point he started to send letters without a stamp, by writing the intended recipient's address as the sender's address, and his own as the intended recipient. The letters would then be delivered to the real intended recipient because the post office thought the recipient was the sender who forgot to put a stamp.
 
@AmaanCheval That's a felony here.
 
I've thought of that! :D
I never sent letters to anyone, though
 
@AmaanCheval yeah
 
If you're into Army of Me covers, this is the best I found: youtube.com/watch?v=Zce1QaicJTs
 
4:24 PM
@allNodeguys: nodemon is incredibly helpful.
 
Saw that just yesterday
Just saw Nodemon (https://github.com/remy/nodemon). Pretty helpful. Thanks @rem!
 
How do I have 12 followers on twitter? I don't do anything there
 
I actually do things on Twitter, and have fewer followers...
(ok, so "do things" means "post links to my blog", but still...)
 
4:39 PM
point and laugh I'm more popular than you!
 
I swear vengeance!
 
@TheGreatRupert, Kitchener, Ontario. Canada
a.k.a rlemon. I write code; some of which works!
1k tweets, 54 followers, following 109 users
I win! highlight of my year
 
I had a question though about app upload in iOS
can I ask for expedited review after I have submitted my app and its waiting in review?
@rlemon what up???
 
@rlemon 12 / 73 >> 54 / 1034. I have a higher follower-per-tweet rate
 
4:45 PM
oh c'mon, you can't even hotlink that? Now how am I supposed to know where to start wasting the rest of my day?
 
@mainerror, Graz - Austria
Ubuntu enthusiast and Android developer
249 tweets, 145 followers, following 270 users
No you don't @rlemon. :D
 
I have more tweets and a better handle.
 
Octavian Damiean wins
 
and I find the best images online (and by online I mean reddit)
MUSH!
 
You lost at your own game
 
4:53 PM
@RecodingBlog, Rochester, NY
Everyday hacker working to improve himself.
19 tweets, 7 followers, following 5 users
#following the crowd
 
@TheGreatRupert I have 1k tweets too bro!
@loktar00, Bellevue NE
I love making cool things for the web, especially if it involves javascript and/or canvas.
1k tweets, 144 followers, following 291 users
my 1000'th for @rlemon :P
 
yeah theres a big discussion on reddit about it. Post graduates are the only ones who had a higher % of votes for Obama
and it was really close regardless.
 
@AmaanC, Mumbai, India
JavaScript developer.
4.8k tweets, 145 followers, following 473 users
I WIN
 
The link and infographic is just more elitism garbage that helps to keep the country so divided tbh.
 
4:56 PM
@rlemon MA elected Romney in the first place.
 
The nice header at the end fucked it
 
@Loktar well facts be facts.
 
And statistics be bullshit interpretation of facts
 
^
 
statistics are facts. not interpretation of facts
useful? arguable.
 
4:58 PM
That's wrong. Statistics aren't facts. They're calculations based on data.
Methods of calculation are not set in stone. There isn't only one type of average.
 
Obama also got the minority vote, and minorities are one of the lowest educated groups statistically in the US.
 
Even if there was an absolute statistical standard everyone obliged to, the end-result is still not even remotely the same as the beginning. Statistics is a fact grinder.
 
@Zirak not @Loktar
 
Yes, a picture makes you right and me wrong
 

« first day (755 days earlier)      last day (4208 days later) »