« first day (760 days earlier)      last day (4189 days later) » 

5:00 PM
my eyeballs hurt. lunch seems like a good idea right around now.
i need some advice. nobody move! i'll brb!
 
@rlemon what of Jon Skeet?
 
Does .net set no-cache headers on all resources by default. Or did it back in the webforms era for some reason?
 
it did in webforms probably. postback.
 
Does not work in my chrome version 5.0.375.70
 
5:13 PM
@Zirak MERGE THE PULL REQUEST!
regex help needed
 
@Zirak CORRECT "STAKE" TO "STEAK" IN THAT ANSWER ON PROGRAMMERS.SE
 
how, in a textContent, to change 23 € by 23€
replace(' ', '') is not acceptable
(there is other stuff around)
oh wait
 
replace('23 €', '23€');
:P
 
aww damit
i have like 300 megs spent away
 
@AmaanCheval yeah, that's what I do after a match to get the string to replace
 
5:18 PM
Once, when I was bored, I wrote a bookmarklet that'd convert all USD prices to INR for me
 
@Amaan that makes me sad
 
It was cool seeing that it worked
Real stupid
But cool
@ChadRuppert Why?
Sites do have options to change currency, but I wanted to see if I could do that using JS
 
@AmaanCheval did you hard code the currency conversion rate?
 
In the beginning, yes
Then I used some JSONP API
 
good then :p
ok, solve this for me jsfiddle.net/uKxnE
 
5:22 PM
I remember doing shit like this!
 
I want to keep the whole string, just removing the space between the number and the €
 
regex
 
@ChadRuppert did you open the link?
 
no, im lazy
but now i did. there you go.
 
5:24 PM
as soon as i open this ticket, ill look at it better
 
Everytime I need to write a Regular Expression, I need that open
 
back!
 
@FlorianMargaine jsfiddle.net/uKxnE/2
 
@AmaanCheval you're not keeping the strings around
 
Oops
 
5:27 PM
this should be something like this jsfiddle.net/uKxnE/3
 
I didn't realize because you weren't either
 
yeah, that's what I was trying to do :p
 
$('.price').each(function() {
    var text = $(this).text().match(/\d+\.?\,?\d+ €/)[0];
    $(this).text(text.replace(' ', ''));
});​
 
@ChadRuppert read above
 
dammit
 
5:30 PM
that's basically what we came up with at first, (the first fiddle is exactly that, with a less complicated regex) but it's not the end needed :p
this should work... jsfiddle.net/uKxnE/4
hehe, got it
it did work. I just didn't set the new value jsfiddle.net/uKxnE/5
 
Aaaaaaah
 
is location.reload(); the same as hitting refresh?
 
$('.price').each(function() {
    var text = $(this).text().replace(/(\d+ €)/, function($1) {
        return $1.replace(' ', '');
    });

    $(this).text(text);
});​
 
!!/mdn location.reload
 
final solution for lazy people ^
 
reload(forceget)	Reload the document from the current URL. forceget is a boolean, which, when it is true, causes the page to always be reloaded from the server. If it is false or not specified, the browser may reload the page from its cache.
 
reload() is the same as F5, reload(true) is the same as Ctrl + F5
 
I thought we were trying to get rid of the text too. duh on me. :)
reading comprehension fail.
 
5:39 PM
I surely explained badly :)
I like using functions in the replace. It's fun and gives a nice and fuzzy wuzzy feeling.
 
Can somebody explain to me that I should actually start writing the VB I'm supposed to write?
 
in C#, 1 hour ago, by rlemon
@tereško ohh now and edit ping you bastard I dont even know you and you edit ping me?
emm ... wtf
what did i do to you ? .. today
2
 
@RyanKinal the longer you wait, the later you'll have to write this VB.
 
You're expecting @rlemon to make sense?
 
o_O
@FlorianMargaine True. True.
 
5:43 PM
Fun fact: The š in tereško is found on search even if you type s
 
woohoo! Triple digit views today!
 
@AmaanCheval looks like only google does that, tried it on bing yahoo nada
@SomeKittens 37?
 
@Yohann Where'd you get 37?
 
@SomeKittens trying my luck
 
In other news, I can't count.
 
5:47 PM
@SomeKittens why?
 
1 min ago, by SomeKittens
woohoo! Triple digit views today!
triple !== double
 
\o/ Hooray for counting!
 
is thisbad way to do document.location = "#start";
 
103, at last count, though more spread out over posts than other record-breaking days.
 
@SomeKittens do you advertise ?
 
5:51 PM
@Olli Does it work?
 
in console, it works, but in my script, it doesn't...
 
No paid advertising. I do bother people: Here, on Twitter and Hacker News
 
Then there's either something wrong with your script, or it's a bad way to do it.
 
@Olli is your script at the top or bottom of the page?
 
@SomeKittens bottom
 
5:53 PM
omg, my <canvas> map actually works ... now i only need to make it usabe ... ehh
programming is too hard , especially when you have to learn new things
 
Map?
like a tile-map?
@Yohann I was talking about Ctrl+F search
But it may be a Chrome thing even there
 
@tereško Programming is hard. Let's go shopping!
 
You guys seen this? It's aerotwist / Paul Lewis's podcast
 
@teresko it was the impersonator. You got the ping. Sorry.
 
6:08 PM
multiple pings ... it was multiple
 
@tereško What you making with canvas?
 
lol.... yea... sorry about that.
in recycle bin, 2 hours ago, by tereško
@Billdr @KendallFrey @TimeToThine @zneak @rlemon @ChadRuppert @Sisyphe please help me :(
 
rad
hi guys!
 
^ in my defense...
 
0
Q: WP_enqueue_script inside shortcode?

PaulI've got shortcode that needs to include JS library only once and only there where it's used. function shortcode_function($atts, $content = null) { $class = shortcode_atts( array('something' => '0'), $atts ); return "<script src=\"http://maps.googleapis.com/maps/api/js?sensor=fals...

 
rad
6:11 PM
Question: Using jQuery, I am sending a AJAX request to PHP with the variables from the form. The form has about 18 checkboxes. Their values - checked / unchecked, is sent as true / false. How do I have to be sent as 0 / 1 respectively?
 
0 == false; // true
 
@rlemon Nice
 
rad
@rlemon lol, it looks funny
 
@rad Yoda conditions
 
rad
MySQL is not allowing me to input values like true/false :(
 
6:18 PM
Check its boolean data type if one exists
 
what is your SQL
 
It may be something like True or yes or something
 
rad
its manual says the BOOLEAN / BOOL, both are aliases of TINYINT :( and TINYINT allows only 0/1
:(
@rlemon MySQL
 
ugh.... troll...
SHOW ME THE SQL STATEMENT numb skull!
 
@rad NO! DON'T! HE WILL H4X0R YOU
 
rad
6:22 PM
ok
here it is
gist: 4073830, 2012-11-14 18:23:10Z
UPDATE user_activity224 SET emc_booth_visit = 'true', emc_rep_discussion = 'true', car_race_participation1 = 'true', car_race_participation2 = 'false', car_race_participation3 = 'false', car_race_participation4 = 'false', car_race_participation5 = 'false', car_race_participation6 = 'false', car_race_win1 = 'false', car_race_win2 = 'false', car_race_win3 = 'false', car_race_win4 = 'false', car_race_win5 = 'false', car_race_win6 = 'false', vmware_booth_visit = 'false', cisco_boot_visit = 'false', isilon_boot_visit = 'false', vce_booth_visit = 'false' WHERE badge_number = '123';
 
@rad either change your falses to 0 and your trues to 1 or change your data type to text and input whatever the hell you want.
 
ok that is the rendered SQL statement - and it's got the errors - not too helpful for debugging.
show me the php code that executes this
 
rad
@hanleyhansen sounds good
 
@rad that's assuming that your sql is syntactically correct. if it is then you just need to make the adjustments i suggested.
 
@rad !!$bool;
 
rad
6:28 PM
@rlemon My PHP code is like..
$query_string = "UPDATE user_activity224
SET emc_booth_visit = '" . $_REQUEST['emc_booth_visit'] . "',
emc_rep_discussion = '" . $_REQUEST['emc_rep_discussion'] . "',
car_race_participation1 = '" . $_REQUEST['car_race_participation1'] . "',
and so on...
 
are you using mysql_* functions
 
rad
yes, I need to sanitize 'em
 
lets not use paramaterized queries or anything
 
Please go to the PHP room and receive the beating you deserve.
 
@rad Is that "nope" or nop? :P
 
6:30 PM
PDO, BAM! you're all set.
 
@SomeKittens don't do that to him lol they'll rape him
 
prepared statements FTW!
 
!!/tell rad google PDO PHP
stupid
1 message moved to recycle bin
@robjb after you pointed it out it was bothering me
 
lol
 
6:33 PM
has anyone ever heard of turning a <tr> with all the <td>'s in it into an object? lol
 
rad
:-|
 
JSON syntax: Which is better?
before: {
		black: 1,
		white: 2
	},
	after: {
		black: 1,
		white: 3
	}
 
Neither of them are JSON.
 
Thiefmaster++
 
        beforeblack: 1,
	beforewhite: 2,
	afterblack: 1,
        afterwhite: 3
 
6:35 PM
and what's the difference? justthe indentation?
 
nesting
 
the nesting is better
 
@rad used PDO :)
 
@ThiefMaster He had not yet posted the second example ;-)
 
Ah, that second one was from you, too. Yeah, the first one is clearly better
 
6:36 PM
Ok. Why? (for future reference)
 
composition
thats why
 
rad
thanks guys!
will study from those resources..
 
@ThiefMaster How is that not JSON? Just b/c the keys aren't quoted?
 
exactly
 
k, just checking :0
 
6:38 PM
 
@Somekittens its better because your object is composed of Before and After, each that have their own properties.
 
name is invalid attribute on TR/TD iirc.
so maybe use data-name or data-key
otherwise you'll be looking at arrays of objects
 
cool thanks. let me play with this.
 
@ChadRuppert Awesome, thanks for the full explanation.
 
6:50 PM
!!/choose "work on lemon meme design" "get drunk and play video games" "get drunk and try to work on lemon meme design" "tandem bike ride to a neighboring city"
@rlemon work on lemon meme design
 
!!/choose "does this thing always choose the first one?" "or does it actually work?"
 
@KendallFrey does this thing always choose the first one?
 
!!/choose 1 2 3 4 5 6 7 8 9 0
 
@KendallFrey All of the above
@KendallFrey 3
 
6:52 PM
@KendallFrey I have invaded your room with my updates...
 
I think it may just be sarcastic.
 
Good afternoon chumps
'chump' in this instance being used in the jovial rather than the derogatory sense
 
7:12 PM
!!/choose "jovial" "derogatory"
 
@SomeKittens jovial
 
@SomeKittens jovial
 
!!tell me the laws
 
@AmaanCheval A robot may not injure a human being or, through inaction, allow a human being to come to harm.,A robot must obey the orders given to it by human beings, except where such orders would conflict with the First Law.,A robot must protect its own existence as long as such protection does not conflict with the First or Second Laws.1)0
A robot may not injure a human being or, through inaction, allow a human being to come to harm.,A robot must obey the orders given to it by human beings, except where such orders would conflict with the First Law.,A robot must protect its own existence
running your own bot now?
 
Asimov wrote those, right?
 
7:14 PM
!!/choose "I am a robot" "rlemon is typing these out"
 
@SomeKittens rlemon is typing these out
 
@SomeKittens Neither
grrrr
 
@rlemon Yeah, trying to make define fallback to urban if there are no results
Is there a way I can stop it from running in this room?
 
I am trying to hook to the ajax method in jQuery so I can parse all of the ajax!
 
@monners Yep
 
7:15 PM
jquery is overkill for that.
 
@rlemon Why? I'm pretty sure Zirak did that in the beginning by hijacking XMLHttpRequest
 
One of the few major sci-fi authors I haven't read yet..
 
I haven't either
 
YOU SHOULD!
 
uggghhhh
 
7:17 PM
I will
 
var event = JSON.parse(xmlHttp.responseText);
alert(event);
 
He's one of the best.
 
Although I have managed to work through every single Clarke book in general circulation :D
 
FFS. Been running the bot using master.js from rlemon's bookmarklet, while I've been pushing changes to commands.js
 
7:18 PM
var timeOnWindowsBeforeKittensRegretsIt = "15 minutes"
 
@rlemon $.ajaxSetup
 
how can i get into that object?
alert(event.title);
gives me undefined
 
console.log it and look around
 
@SomeKittens You're a Mac guy?
 
@AmaanCheval aha!
 
7:20 PM
@monners heh. hahahaha. BUMUHAHAHAHAHAHA!!! sheds single tear
no.
 
Wait, what?
 
Linux is where it's at
 
Hello
 
@AmaanCheval After you make changes, use the build-script and then pull from master.js
 
Ah, gotcha.
 
7:21 PM
First time here
seems better than irc
 
@Zirak Yeah, just realized that. I was just using Github's editor online and trying
 
@Sergio It may from the user's side, but not from the developer's side. SO Chat, Y U NO HAZ API??
And don't worry. We'll try to be gentle. snigger snigger
 
@Zirak What does it mean?
Y U NO HAZ API?
 
7:24 PM
@Zirak How do I call a command from within a command?
Just bot.commands.urban.call(this, args);?
 
@AmaanCheval !!/inception
 
What does it mean?
 
@AmaanCheval One sec
 
@SomeKitte
Catch 22 I never head befor
 
You may know them as Streetlight Manifesto
 
7:26 PM
bot.getCommand( cmdName ) gets you the command object
If you just want to call the function, without security checks or something, then you can do bot.commands.cmdName.fun.call( foo, bar )
 
Okay, how would I do it with the security checks?
I'd need to create an input IO object?
 
No, all you need is in the command's first argument. If you have that you won't need to built it yourself
 
That was easy. Nice!
 
anyone got some experience with grunt watch? ~~
 
//anyway...
var cmd = bot.getCommand( cmdName );
//if cmd has an error property, then cmdName was invalid. you can check that if it's dynamic or something.
//to check if a user can use it:
cmd.canUse( args.get('user_id') ); //assuming args is the argument passed to the command
cmd.canDel( args.get('user_id') ); //same thing, only whether a user can delete
cmd.exec( args ); //if the command is syncrhonous. if it's async, you can provide a second argument, the callback, like
cmd.exec( args, cb );
 
7:31 PM
@FlorianMargaine sweet
 
@FlorianMargaine I've had to watch grunts.
 
@Zirak Sent you a pull request
You've made the bot pretty well
Some parts may be shitty considering how big it's gotten
But overall it looks well done
 
Thanks. I know some parts are a mess, but I've tried to keep the core interface clean
 
If it weren't for the internet, I'd just live in CLI mode.
 
@AmaanCheval Sorry, I'm dead today, but I'll take a look tomorrow. Same goes to you, @FlorianMargaine
 
7:48 PM
@KendallFrey your room is annoying when they try to talk about js. just sayin. I might get a little ragey at times. sorry. langauges that compile down to other high level languages are a gimmick. they won't stick. they are a hip way of showing off and being different. people who use the languages will always argue that it is not. but then most of them struggle with vanilla js....
not all, but most.
> my 2¢
 
8:03 PM
does js come in chocolate or hazelnut?
 
It comes in cantankerous.
 
It comes in Crockford and Other
 
How about temperamental, or finicky?
 
@RyanKinal o/
 
Mostly Cantankerous
 
8:08 PM
Cantankerous == Crockford // true
 
jslint threw a warning, line 1, expected semi-colon.
 
Curse you, Crockford!
 
@Zirak meh, like I care
@rlemon missing 'use strict'; statement
 
touche
 
@FlorianMargaine Whatever man. I don't care.
 
8:10 PM
finding the documentation really helps when using third party components
 
This is a nice word:
!!/define lithe
 
@Zirak lithe: easily bent or flexed. (source)
 
anyone knows why this redirect-after-post doesn't work? github.com/Ralt/somap/blob/master/lib/marker/router.js#L49
it just timeouts.
 
lithe is definitely an excellent word
 
8:16 PM
It sounds like a slippery "life"
 
Dammit @AmaanCheval, You got me excited: 'WebRTC is live on a stable build of Chrome'. getUserMedia still doesn't get mic input on stable?
Ooh but it does with flags!
 
not mine :(
 
chrome://flags ?
 
maybe at home, probably the chrome-gods make me not procrastinate work.
 
chrome://semaphore ?
 
8:20 PM
chrome://whathuhnow
 
How can i get just the values?
 
Well, if anyone wants to try my guitar tuner, go to chrome://flags enable to Web Audio Input flag, go to phenomnomnominal.github.com, (sorrry for my website) click the middle one and have fun.
 
@hanleyhansen: .val() if it's just one
otherwise .map(function() { return this.value; }).get()
 
I'm really struggling. Let's try a simple example.
 
@ThiefMaster ok so i got the one
but i need all the checked ones
@ThiefMaster can you explain this?
 
8:22 PM
!!/tell @hanleyhansen jquery jQuery.map
 
@ThiefMaster s/this.value/$(this).val()/ :p
 
@FlorianMargaine just too look cool to other designers?
 
!!/tell rlemon define semaphore
 
@rlemon semaphore: A visual signaling apparatus with flags, lights, or mechanically moving arms, as one used on a railroad. (source)
 
8:24 PM
@rlemon ohhh i get it
 
@rlemon because val() actually does a lot of stuff to be cross browser
 
@rlemon lol uhhhh
 
how is input.value not cross browser?
 
@hanleyhansen $('input:checkbox:checked').val()
@rlemon let me find you the reasons.
 
please do
 
8:27 PM
@hanleyhansen .map() executes the given function on all matched elements and returns a jquery object containing all the return values of that callback
.get() returns a plain Array of those values
 
it returns a jquery object?
 
I guess it's safe on inputs
 
yeah, but a jquery object could contain anything - it would just break with most stuff except .get()
 
@phenomnomnominal vvv
> The getUserMedia API lets users grant web apps access to their camera and microphone without a plug-in. This API is now available in Chrome Stable (as of version 21) without the need for any flag.
 
but it basically just does shit on selects and whatnot. I don't see any cross-browser stuff
 
yes, getUserMedia is available, but it specifically doesn't work with the microphone without the flag
 
@Zirak yea, afaik .value is accepted as far back as IE5
on form inputs... applicable ones at least.
type="range" or type="color" I expect to fail.
 
8:32 PM
@phenomnomnominal Really?
 
Yep: known issue, mic access has only been available recently. On 21-23 without flags, setting audio: true in the options does nothing
Should hopefully be in stable soon though
 
2 things:
1. Why is `req.body` undefined when I specified `server.use(restify.bodyParser())`?
2. Why doesn't this [redirect](https://github.com/Ralt/somap/blob/master/lib/marker/router.js#L26) work? It just timeouts.
 
0
Q: Javascript Coding Wager

EnigmaMasterI have two scripts written by my co-workers for auto-filling a form with information from the facebook graph-api. I am trying to figure out which has been coded in a more efficient style? This is the first one. http://jsfiddle.net/TcGGZ/30/ $('#account_get').click(function(){ $.getJSON('http://...

 
we talked about some code, currency, regex, how alerts block, teresko got the pings meant for another user, double !== tripple, bobby tables showed up, robots must follow the three laws, Linux >>>> Mac, HELLO!!!, bot talk, rlemon ragequit, input.value is cool. input.val() does some magic. getUserMedia() is not readily available, Amaan lies!
 
now i need to do it backwards.
 
8:44 PM
use protection still.
 
@rlemon But that's what they told me! :(
 
@rlemon always
$('input:checkbox').attr('checked','checked');
but i only want to check the ones in my array
 
anyone here down with the serial communication? I have a slave monitor / controller application which acts as the master. cool. Boss wants the application to also act as a slave (so it can essentially be run in two separate instances and talk to itself.) - this type of functional change will completely change how almost every element on the UI works.. I think it should be a separate application (all code behind is changed by this change)
thoughts? two apps and save the developers sanity, or one app and the client is happy but I go bat-crap-crazy
 
Are you really sane to begin with?
 
Phen raises an interesting point
 
8:49 PM
Client happy means boss happy means long term sanity?
 
Why won't they be happy with two apps?
 
rlemon going insane has got to have at least a little bit of entertainment value for the rest of us. Yeah, it'd be the greater good. Trickle-down amusement at the expense of a single mind :P
 
var campuses = 'Lowell,Moorestown,Paramus';
$('input:checkbox').attr('checked','checked');
 
Need to select checkbox with only those values
 
8:52 PM
$('input', document.forms[0]).filter(function() {
    if (campuses.indexOf(this.value) !== -1) return this;
}).prop("checked", "checked");
 
Are you experimenting with stuff before asking here?
 
@Zirak yes i'm trying a bunch of different stuff
 
show us next time what you are trying
@Zirak they really want a single application. but they will accept if I provide them with two.
so I might try to merge the two... maybe make it a single application and duplicate the main form and just show/hide forms depending on mode.
 
@rlemon, are most of the changes UI? How much back end needs to change?
 
But why? What's it to them? I mean, do they want to only press a single GUI shortcut?
 
8:55 PM
no changes to the UI really
 
If so, you can make the two separate and have a unified access-point
 
but the entire backend will need a bunch of

if( isMaster ) {
// control
} else {
// monitor
}
 
'this type of functional change will completely change how almost every element on the UI works'?
Just the workings then?
 
how it works, not how it is displayed.
 
.prop("checked", "checked");
no no no no noooooooo!
you never want a string value there
 
8:57 PM
agreed - but browsers see no difference. so long as the attribute exists.
 
@rlemon: Except one difference: .prop() sets the property, i.e. elem.checked = ...
it works since "checked" is truthy but still very ugly
 
ahh shit, I read his .attr and write .prop.
my bad
 
@rlemon There must be a lot of common-ground between the two, so can you extract them out? You know, use OOP shit?
 
@Zirak not really. serial master vs serial slave have almost no common grounds -(minus) UI update methods.
which I plan on reusing.
 
Unless I'm just talking bull. In which case, go ahead and lose sanity.
 
8:59 PM
@ThiefMaster ohh i'm well aware :P i'm just only half here - trying to finaggle with some winforms apps
 

« first day (760 days earlier)      last day (4189 days later) »