« first day (1006 days earlier)      last day (3943 days later) » 

4:00 PM
good morning for real
@bushdiver you didn't understand a single damn thing I said last night, did you?
 
@QuinDa I'll help you, don't mind them. Sup?
@bushdiver Are you trying to be offensive with your code?
You're doing a good job if that's what you were attempting btw.
 
> SlimerJS allows you to manipulate a web page with a Javascript script
uhh....
buh. T-Mobile is the only carrier with the nexus 4 in my area.
 
@Shmiddty without a browser.
 
@BenjaminGruenbaum The phrasing could be less ambiguous
 
!!are you alive?
 
4:12 PM
@rlemon Yes!
 
!!/youtube Suicide is Painless
 
> SlimerJS is similar to PhantomJs, except that it runs Gecko, the browser engine of Mozilla Firefox, instead of Webkit.
this is the only sentence making sense on this page tbh
 
It assumes you know what Casper is, but yeah
 
PhantomJS.
 
4:13 PM
I saw a unit testing framework that you could run in any browser.
and control through a terminal
 
probably Selenium
 
no, it was something different
 
Naa,
Wow, my messages have like... a minute delay
 
Some people just can't follow procedure.
:grumble:
 
> The testing tools we’re using include NodeUnit, Mocha, expect.js, and Testacular.
 
4:28 PM
var boxes = ["vendor","area","region","market","switch"];
How can I tell it if I'm on "area" that I want to assign a variable to the next in the array?
 
indexOf + 1?
 
ah - I think I knew that - not enough coffee this morning
 
I think in Ruby you can do arr.split(word)[1][0] (and yeah, it's kinda slow)
 
well, ruby is slow.
 
ruby is unnecessary
 
4:32 PM
from the algorithmic standpoint, I meant
could be a cool approach when golfing, though
words word / 1= 0= (5 chars)
words . word =)= (4 chars)
 
does anyone here write without curlys for one line codes?
ex:      if (someBs)
		doSomeBs();
is there any drawbacks to it really?
 
@bushdiver I try to avoid it from a shared codebase stand point
 
@bushdiver ew.
@bushdiver it's not copy-paste safe
if you want one-liners, do one-liners, not two-liners
 
@bushdiver 1. It's pointless 2. It makes it easy to break if you make 'just a small change'
 
if (someBS) { doSomeBS():}
 
4:37 PM
puts "hello" if cond # ruby
if(cond) {alert("hello")} //JS
 
@JanDvorak Really?
 
ahh - i avoided it for a long time and noticed myself starting to do it out of nowhere.. i'll keep avoiding it. thx :)
 
@copy if you copy half of it, it misbehaves
if you copy half of a bracketed expression, it errors out
(that is, unless you do this:)
 
there's no reason to copy/paste code.
 
I avoided doing
var foo = (bar) ? "foo" : "bar" ;
 
4:39 PM
@Shmiddty there is. Greek/cyrillic characters
 
haha :P
 
Then I started needing it :)
 
@jbolanos why? Ternary is cute
just don't nest it
 
@jbolanos because var foo = bar ? "foo" : "bar"; is better?
 
functions within functions - makes me think of Dune
 
4:40 PM
@jbolanos why Dune? Why not Inception?
 
Because Dune is better than Inception
 
var foo = ["bar","foo"][+!bar]; yeah!
 
@Shmiddty sure, because negation as a side effect of coersion is very readable
 
@JanDvorak readability is totally what I was going for. ;)
 
4:42 PM
@Shmiddty then you were walking the opposite direction
;-)
 
Roger Zelazny is considering doing an Amber movie
 
What's the best way to get a locale-formatted "day of the week" in javascript?
!!>(new Date).getDay()
 
@Shmiddty 4
 
@Shmiddty moment.js?
server-assisted localisation?
 
balls.
3
 
4:46 PM
localisation.datesOfWeek((new Date).getDay())
 
user1596138
@Shmiddty Balls.
 
user1596138
Nosebleed at work. Awesome.
 
too much cocaine
 
user1596138
@GNi33 What is it? All I see is a static logo.
 
colOffset = ((prevCol + nextCol) / 2) + ((Math.random() * settings.colDist) - settings.colDist / 2),
oops
 
4:49 PM
ordered myself some food cuz @BenjaminGruenbaum wouldn't join me :-P
 
user1596138
@Shmiddty Yeah, my drug dealer cracks me up.
 
user1596138
</stupidPun>
 
user1596138
@Neal $17 for some delivery chicken and a coke?
 
@Jhawinsss That's kosher food for ya
 
user1596138
Ah. I see it is NY. Nevermind.
 
4:53 PM
@Jhawinsss and kosher
 
user1596138
@Neal Religious reasons? Or is it better?
 
user1596138
@Loktar Set horDist to max. Change height to 1000. Sit back and trip.
 
user1596138
Need some brighter colors though...
 
Jesus! DataTables is a fucking best.
 
user1596138
@OctavianDamiean I did something like that a few months ago. Didn't look nearly as nice though!
 
4:59 PM
looks like a fast-moving road
 
user1596138
 
user1596138
I have no idea what ^^ looks like. But if it had some brighter colors it'd be killer on the eyes.
 
haha
 
user1596138
 
user1596138
Hahahaha I'd never seen the codepen 404!
 
5:03 PM
0
Q: 3.5.x Theme Customize: Handling Custom Control Requests

Chris WalshI am extending the WP_Customize_Image_Control as a means to include an upload-able word mark for a site. The control works just fine, but I need to do some post process handling on the image (i.e. check image dimensions, file type, etc...). In other words I need to validate the upload. Is there a...

 
isn't that a chef with a frying pan? :)
 
Chefs don't carry swords bro
 
that's a steak knife
 
user1596138
@JanDvorak Definitely not. Maybe a machete.
 
@jbolanos it's for baking, actually. probably a pie pan
 
user1596138
5:06 PM
It's the length of his leg almost.
 
@Jhawinsss well, there are different kind of steaks
 
@phenomnomnominal LOL.. Mesuka: "Oh thank god.. I was ready to blow you." -> Dex
 
haha
 
user1596138
@JanDvorak I've never seen a steak-knife that's as long as my shin even. Let alone my entire leg.
 
@Jhawinsss maybe you aren't eating enough steak :D
 
5:07 PM
The person is obviously a midget.
 
user1596138
Hmm.....
 
@Jhawinsss there are different kinds of legs...
 
/afk
 
var groups = ['vendor','area','region','market','switch'];
var nextGroup = groups[groups.indexOf('area') + 1];
console.log(nextGroup);
Is there a better way?
 
user1596138
Yo mamma so fat, you need a steak-knife as long as your leg to eat her....
 
5:08 PM
LMAO
 
user1596138
Best I could think of. Time to go smoke.
 
@jbolanos looks good
definitely not a WTF code
conscise and readable
 
interesting question (biology / genealogy people) I'm reading that for long term space travel (200 years) a minimum of 160 humans would be required for enough genetic diversity to not have inbreeding effects in the latter generations.
would this number (of required humans) need to be increased for longer duration of isolation from diversity?
 
@rlemon does this account for hibernation and time-dilation?
 
obviously you never heard the adam and eve story..
 
5:11 PM
@JanDvorak no, this is the time the travelers would be subject to.
 
@bushdiver you don't know how much has been lost
@rlemon oh
 
assuming no hibernation, and time dilation effects would not be appreciated by those on board.
 
time dilation would shorten the time observed below the time observed by earth
 
but we're not concerned about earth
 
you can't shorten the earth-time, however, but you can shorten the ship-time arbitrarily
 
5:13 PM
but i don't care about observers.
we're talking about 200 years of time passing relative to the passengers of the ship
 
yep, but you can accelerate more and get that to just 100 years
 
or better yet, ignore the trip - we put 160 people on a colony on mars. how long before we suffer the effects of not enough genetic diversity? the article claims 160 humans are needed for at least ten generations (roughly 200 years)
@JanDvorak you are missing the point entirely
 
@rlemon no. I'm just walking away from the rails
 
does genetic diversity grow in the closed community over time, or does is depreciate
 
back on track...
genetic diversity should always decrease due to extinct genes
if we disaccount mutations
 
5:16 PM
and if based on the number of starting people in the community (I assume there is a low limit) what would the magic number be to allow the community to reproduce indefinitely.
 
@rlemon there is no magic number. It's just that 7G will last for quite a while
 
Is there a way to keep text still selected for if you want to access a dropdown and change a font-size, etc? Kinda like a text editor?
 
so if we wanted to start a colony on another planet and needed to send a minimal amount of humans, such that they would survive and prosper (genetically) for the next 120000 years, does anyone have any idea how to come up with such a number.
 
@MattKnowsTech store and reinstate the selection?
 
is there a formula
?
 
5:19 PM
@rlemon there likely is a formula
 
Didn't read yet but if anyone cares:
1
A: Accessing Database Entities from Controller

SlaumaOption 1 and 2 are bit extreme and like the choice between the devil and the deep blue sea but if I had to choose between the two I would prefer option 1. First of all, option 2 will throw a runtime exception because Entity Framework does not support to project into an entity (Select(e => new Ki...

@Zirak @FlorianMargaine ^
 
@jandvorak Take a look at this fiddle I made. See how when you type text in, select it, and then try to access drop down, it looses it's selection?
http://jsfiddle.net/MatthewKosloski/a77sM/
 
@JanDvorak my 4 and a half minutes of googling didn't find it :/ I was half hoping someone in here learned about it in school or elsewhere
 
@MattKnowsTech *loses, *its
 
@JanDvorak Now if I can just figure out had to put that into a data element :D
 
5:22 PM
@jandvorak Thanks.
 
@MattKnowsTech when the user selects the text store the start and end of the selection, then when you blur the select box re-apply focus
 
@MattKnowsTech that's because the user deselects the textarea
 
but really, you afaik can't stop the selectbox from taking focus AND allow it to be operational
so trying to do so is a bad idea
 
@rlemon Yeah, I see what you mean. Is that vanilla js, or jquery?
 
Unicorns
your question made no sense, so neither did my answer.
 
user1596138
5:25 PM
@rlemon But inbreeding doesn't cause any bad effects. Look at all the royal bloodlines of incestual families.
 
@user2585506 Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
@rlemon Yeah, it does. I've seen that being used in jQuery. Is there a way to do in Javascript?
 
if you have an ASP.Net user control that has some JS, how can I have multiple instances of the control in the same page?
 
@JafarKofahi if the JS is written well, I think you can
for one, don't use IDs
 
yea thats the problem
so you are saying to pass everything in
as parameters for the JS function, or something like that?
 
5:26 PM
@MattKnowsTech jQuery IS javascript
and I didn't give you a code solution, I gave you a conceptual one
 
This dude just straight up copied my solution: stackoverflow.com/a/17727829/1216976
 
@JafarKofahi pass what to where? You can use DOM traversal
 
@rlemon Yes, but I mean pure raw Javascript. Can it be accomplished?
 
Should I flag, or just downvote?
 
so the choice to use a library or to do it without is irrelevant.
ANYTHING YOU CAN DO IN jQUERY YOU CAN DO IN VANILLA JS! HOW CAN IT DO SHIT THE LANGUAGE IT IS WRITTEN IN CANNOT
/end-yell-type
 
user1596138
5:28 PM
@SomeKittens I did both.
 
@JanDvorak DOM Traversal? hmmm
so search for the element I need to script
 
@MattKnowsTech but if this is some sort of inline WYSIWYG then you are taking the wrong approach
 
In fact, there are many things that one can do in vanilla JS that can't be done in jQuery
 
but how can I uniquely identify the element of each control (e.g. html elements)
 
the common implementation iirc is using iframes with off screen textareas
 
5:29 PM
@JafarKofahi I mean, "the element .target in the element .my-widget that holds the element that was clicked"-style navigation
 
@SomeKittens it amazes me when people ask IF something can be done without jQuery
 
Just trying to make a simple text editor with buttons, dropdowns, and a textfield.
 
@MattKnowsTech to 'keep' focus you need an iframe and some hacks or you need to do some nasty limiting shit
 
@JanDvorak apparently I need to read and learn more, any good references. I am still not quite sure that I understand your suggestion
 
@JafarKofahi you could look for some good examples
 
5:32 PM
@MattKnowsTech look at all implementations of web editors. ckeditor.com/demo 99% -> 100% of them use iframes to separate the 'content' and the page it is in
start looking into this implementation strategy
 
@Amaan I'm normally on around 7-10PST
 
@JanDvorak the JS i need to run is not triggered by an element, it needs to be executed when the page loads/after postback. So if I want to traverse the DOM I need to find the 'right' html container.......hmmmm I think I am starting to understand I will look for examples... thanks for your help and time :)
 
@JafarKofahi then the containers should be designated by a class that you look for
better yet, pass a jQuery object to your plugin
or nodeList if you're going Vanilla
 
@rlemon Because jQuery is blessed.
 
@Gacnt yeah. Ignorance is bliss.
 
5:37 PM
is node.js a good solution if you have TONS of data you need to show to the user? and by tons I mean 'kill the server' tons
 
I would say yes
Because it doesn't block
So node can deliver the data when it's ready, and the webpage can still function
 
@jbolanos you should consider paging your content
 
any other implementations of this: melonhtml5.com/demo/timeline that I can compare against
I hate only having a single option
 
@rlemon Did you see the one GNi linked earlier?
 
that is nothing like the one I just showed
and i've been through like 30 'demos' looking for similar ones
all are stupid horizontal ones
 
5:40 PM
it's a timeline bro
 
> any other implementations of this: melonhtml5.com/demo/timeline
but it is not an implementation of a vertical timeline with points flying out to the sides
 
@JanDvorak ok I will give it a try... I already have them designated by classes, I can query them using jQuery and then check their containers. I will play with it and see how it goes..thnx
 
@JanDvorak if it worked that way - but this is numbers, lots and lots of numbers, that you drill down to smaller and smaller zones until you get down to a single little box sitting on the top of a tall building in an array of boxes number in the hundreds - and then multiply that out by thousands as you expand out zone by zone
 
he works for PRISM, the numbers are your SS and the boxes are your homes
 
haha - try cell phones - oops - I didn't say that
 
5:42 PM
@jbolanos sounds kinda like maps.
 
we knew those were tapped a long time ago
 
@jbolanos if you're looking for a mipmap-like content, this can be streamed as well
think Google Maps
 
now you are using google street view to spy on us directly.
 
@JaspreetChauhan Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
You'll want to grab chunks of data, and cache them. You'll have to be proactive about releasing them when you no longer need them.
 
5:43 PM
@JanDvorak Think of each node on a cell tower - add all those nodes together across towers etc - but still be able to look at that single node to tell if its working or not
 
@Loktar I don't like you - stop making cool shit - it always inspires me to try to make cool shit as well.
I have no imagination
 
haha
eh, its along the same lines as my other stuff
 
infinite generation seems a lot harder than single generation
hence, not liking you.
 
I got that idea after making my doom pen
nah its REALLY easy
doesnt use any fancy algorithms
 
it actually seems simpler than the... what's it called
 
5:44 PM
that is what you said about midpoint displacement - took over a week for it to "click" for me
 
Step 1 - pick a point between a random range
Step 2 every point looks at its neighboring points and avg's those 2
step 3 add a small amt of random
 
yea I got it now. but when I was first trying to implement it... that was tough
 
thats it.
no thats not midpoint
Im talking about my most recent one
 
diamond square?
 
0
Q: Trigger Customizer saving process with Javascript only

AskelonI'm working on a custom theme that uses WordPress Customization API to let the user play with parts of the content of his website, basically the front-page which he can modify by adding/removing custom blocks such as latest posts, page children, etc. Blacks structure is collected and filled in an...

 
5:46 PM
no I didnt use anything fancy
one sec Ill make a super quick demo
 
hrm. i'll read it when I get home
I can read the pen
I've stared at your code long enough I understand the style now
 
haha my crappy style :P
 
it actually isn't that bad
might not be the best style i've seen, but it is above the median
and to be fair, mine is horrible as well
 
but yeah its how the doom screen melt effect works as well, my guest blog post explains it next week :P
 
I've never met many people who write generally "beautiful" code
Zirak comes close with some of his
it is so pretty.
 
5:47 PM
yeah I never really go back through my code to make it pretty
I do it quick and dirty for demos and keep it that way usually
 
I only clean it up when I go through commenting it after.
reddit /r/javascript really appreciates the commenting
 
@SomeKittens Aww. I'll most likely be asleep at that time
 
@Jhawinsss im Jewish.
 
@Samuel Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
o/ howdy folks
 
user1596138
5:54 PM
@Neal I assumed, but I figured I'd ask first. A lot of people think I'm jewish for some reason...
 
@Jhawinsss "for some reason"?
 
@Loktar you should add the palette to the settings
 
user1596138
Not that there's anything wrong with that. But it's weird how everyone assumes I am.
 
what is the "reason"?
 
user1596138
Wish I knew.
 
5:55 PM
@Shmiddty I thought about doing that
as well as doing it with my other terrain gen
 
user1596138
My entire family (10 siblings) does have Bible names though. So it could have something to do with that.
 
@Shmiddty thats a fun picture, what is it?
 
@Samuel my colon
 
user1596138
@Shmiddty Fork+Link?
 
5:57 PM
@Shmiddty looks painful
 
user1596138
Or did you just edit it live?
 
@Jhawinsss do*
 
<div id="finderBox">
<div id="colVendor">
<ul>
<li>Friday</li>
</ul>
</div>
<div id="colArea">
<ul>
<li>Noon</li>
</ul>
</div>
</div>

$('#finderBox > div').on('click', 'li', function (e) {
var thisCol = $(this).closest('div').attr('id');
var thisGroup = getLevel(thisCol);
var groups = ['vendor','area','region','market','switch'];
var nextGroup = groups[groups.indexOf(thisGroup) + 1];
console.log(nextGroup);
});
 
user1596138
!!s/does/do/
 
5:59 PM
That didn't work... but how is that?
 
@Jhawinsss My entire family (10 siblings) do have Bible names though. So it could have something to do with that. (source)
 

« first day (1006 days earlier)      last day (3943 days later) »