« first day (1556 days earlier)      last day (3391 days later) » 

12:02 AM
Lest we forget
 
we use a carousel on one of our sites :X
 
I've implemented more carousels than I care to count
 
would you rather do another or go on an actual carousel until you pass out
 
Can't I do both?
 
12:22 AM
hi all, how can I swap classes between two divs? Bearing in mind the user will need to re-swap again, using a button.
 
12:34 AM
$.toggleClass
$('button').on('click', function () {
    $('.el1, .el2').toggleClass('foo');
});
Assuming one of those elements starts with the class of foo
@BenjaminGruenbaum When's the next room meeting?
 
1:25 AM
im building an employee roster using an object oriented database. The database identifies people using an "id": number key/value pair. How do I reference a specific id in an angularJS view? essentially, i want to grab a specific name from the database that contains an id # of 5. I can grab everyone via ng-repeat, but wondering how to only grab a specific person. Thanks!
 
What's an Object Oriented Database?
 
but i am using wrong terminology
@SomeKittens i am basically using json data
 
so MongoDB?
and you haven't provided enough detail
 
no just a plain json file
{
"id": 5,
"name": "Eric Mason",
"shortName": "eric_mason",
"department": "DHA"
}
so lets say i have 10+ names, i only want to print the person associated with id 5
obviously this expression is giving me the first item in the roster: {{people[0].name}}
 
have you tried track by?
 
1:33 AM
i don't know what that is, let me check the doc.
i am trying to display the branch chief at the top of the list, then list everyone else below. The chief's ID is 5.
 
1:45 AM
in this case i thikn this is an example of trying to work harder, not smarter. Instead of trying to pull the data from json for that chief section, i'll just hard code his name into the area, lol
 
 
2 hours later…
3:28 AM
Some guys here who have some knownledge in three.js?
 
I've done a bit
 
yh, well what's the best way to draw 50k cubes?
 
That depends.
Why do you want to draw 50k cubes?
 
I try to create a business intelligence data stream
hard to explain, there a lot of data
 
Who decided the best way to represent that was with 3D rendered cubes?
 
3:31 AM
it was just an example
with the cube thing
 
Well, what do you actually want to do, because it makes a difference.
 
One second, I look for an image who explain it
something like this with
cubes (less vertices)
 
Okay, that's gonna be hard
 
yh, first I just try to render 200 * 200 cubes
there's a merge function but I dont get how to use it
 
Is it going to be a "render once" thing, or will they move through time?
 
3:37 AM
the camera moves (OrbitControls) ..
 
But the model?
 
If I just wanna render them once it wont be a problem, no stable FPS needed then ;D
the meshes just scale sometimes or change the color
and theres a raycaster to select a cube
 
Yeah okay, then you don't want to merge them
You need the geometry to be seperate.
 
why not?
ahh If I merge them I cant scale, right?
 
Correct
 
3:39 AM
damn
 
I gotta go. Good luck. Maybe just try rendering them straight up, depending on the device it might be okay
 
Bye & thanks dude :)
 
4:07 AM
I saw a tag in a blog today. It was written as a link. Like this: <a class="GCUXF0KCKB" kind="label prototyping">prototyping</a> .
I haven't seen the kind attribute before. What is its normal usage?
I have searched for reference, but couldn't find one.
 
@NickAlexeev use the spec, Nick! dev.w3.org/html5/spec-preview/…
 
 
1 hour later…
5:33 AM
@copy ok so after spending 18 hours in the game this weekend with friend... h1z1 is amazing.
/me goes to bed
 
 
2 hours later…
8:02 AM
"Technically that sentence started with 'well', so--" "Ooh, a rock with a fossil in it!"
4
 
 
1 hour later…
9:05 AM
@monners not sure - why?
 
Is it possible to return an object literal from a fat arrow function in the shorter syntax?
() => {foo: 'bar'} obviously fails
() => { return {foo: 'bar'}; } is ugly
cc @BenjaminGruenbaum
 
It was discussed in esdiscuss the other day - afaik the only way is something like:
() => ({foo: 'bar'})
(That is - making it into an expression)
 
Yup, that works
Thanks ^_^
 
9:23 AM
any time
 
Wouldn't it be nice to have => foo: 'bar' in JS
 
No, it'd act differently from normal functions, although it can be made to work
Making JS all-expression would be cool but really change the language
 
nm u?
So oldschool, I remember "sup, nmu" in MSN Messenger when I was 15
 
asl?
because the two most important things to know about a person before talking to them were age and gender
 
9:37 AM
I don't think I've ever answered an asl :D
 
why not?
 
!!> typeof (typeof x)
 
That's always a string
 
!!> foldl ($) (replicate 100 typeof) x
 
@BenjaminGruenbaum asl
 
9:40 AM
@BartekBanachewicz what?
 
@BenjaminGruenbaum listening to Your Favorite Coffeehouse on spotify, drinking coffee and pondering on this lazy morning about PLT
 
@BartekBanachewicz oh wow, that's an awesome idea I should make coffee I totally forgot about that
 
@BenjaminGruenbaum typeof $ typeof $ typeof $ typeof ... x
that was a joke :)
 
@BartekBanachewicz I get what folding does and what replicating does - I'm wondering what meaning it'd have :D
ah
 
you know, as in "to prove adding 1 to a natural number produces a natural number, I'll show it for the first 100"
 
9:44 AM
Sounds like proofs in physics :D
 
hihihi
the funniest thing is that in Physics those proofs observably break at i.e. 0.1c
and then everyone is like whaa how why
funny branch of science certainly
 
So how's work?
 
p cool.
We're supposed to start the new project like today, but IT is grinding at our repo stuffs and CI
we're kinda test-driving our new framework outside of the team who made it for the first time
 
Good luck - sounds scary :D
 
worst case scenario we'll hop on and help them in bugfixing
it's not 100% new code, they mostly refactored and revamped our existing solutions scattered across different projects
best case scenario, our job suddenly becomes quite easier :)
 
9:50 AM
I'm wondering what language I should pick up next - probably I'll do something different.
Any suggestions?
 
@BenjaminGruenbaum Do you like Lua?
 
I like Lua, I haven't touched it in a year or two though - I've also never made anything big with it - always as a scripting language on top of another language.
 
@BenjaminGruenbaum then you might be interested in Terra
 
Maybe, I thought maybe I'll pick up another field in programming rather than another language - maybe image processing (I suck at that mostly) or simulation or another field in AI
Maybe I'll learn algotrading, that sounds fun
 
10:15 AM
who here has used emscripten?
 
I think I actually used it once
 
@BenjaminGruenbaum You're looking for a challenge?
 
@RoelvanUden always
@edition I have, why? The redid their tutorial by the way kripken.github.io/emscripten-site/docs/getting_started/…
 
If you guys don't mind some shameless promotion of a proposal of mine on area51:
3
Open Source

Proposed Q&A site for questions regarding motivation, marketing, organisation and coding pertaining specifically to open source projects.

Currently in definition.

 
hey, is there a way of changing the SO chat notification sound?
 
10:18 AM
@edition you can turn it off - right above the room title to your right.
 
Hey I need help
 
no, I mean change it.
 
@overactor I followed - but honestly almost everything there would fit on programmers.se
@edition sure, you can do that if you're willing to get dirty with code.
 
@edition use a proxy so that the proxy replaces the sound file
 
    Actually we want avoid ctr+j key so we written this handler
    var ctrlKey = 17,
    jKey = 74;
$(window).keydown(function(e) {
                    if (ctrlDown && (e.keyCode == jKey)) {
                    	console.log('coning');
                        e.preventDefault();
                    }
                });
 
10:19 AM
simplest solution I can think of...
 
But the problemis that Once Ipressed ctrl J
 
@NikhilAgrawal why do you need Jquery?
for handling the keydown event?
 
iit is Coming in the second block
always
 
@BenjaminGruenbaum I still don't get the point of that SE site
 
when I press only
andthus not aloowing me tooress j
 
10:21 AM
@BartekBanachewicz lots of people want to help with OSS but don't know how or how to get started.
 
@edition What else I can do
 
@FlorianMargaine uhh... just changing the object in the master-chat.js sounds simpler.
 
@BenjaminGruenbaum Might indeed be too much of an overlap, we'll see how it plays out
 
@BenjaminGruenbaum I don't wanna dive in the source
 
assign window.keydown
 
10:21 AM
@BenjaminGruenbaum This might or might not be up your alley -- but how about trying your hand at a JavaScript pinch-zoom component? One that actually behaves like mobile devices do (and actually works), with constraints to either fit the container, fit height, or fit width, and scale accordingly between those constraints. Of course, make it open source so I can steal your code learn from it.
 
@NikhilAgrawal did you try searching for a solution on Google?
@FlorianMargaine open in dev tools, control+f to open the search box
 
sorry, window.onkeydown.
 
@BenjaminGruenbaum TOO HARD!
also, if the object is in a closure, you're fucked
 
I tried then only I created this handler
 
@RoelvanUden isn't it just checking event.touches.length , finding out it's two and then making it grow or shrink based on the fingers' distance from eachother grows or shrinks?
 
10:24 AM
@NikhilAgrawal I wouldn't use un-named numeric constants for your keys.
 
@NikhilAgrawal I am re-writing your code.
 
@edition Thank you
 
your welcome
 
@BenjaminGruenbaum If it was that simple, there would be libraries for that. You'd have to account for not only zoom-in/out touch, but also movement depending on where you touch relative to the zoom and so forth. There are entire research algorithms investigating natural pinch-zoom.
 
10:26 AM
*you're
@RoelvanUden if you need something more natural you can steal pinch-zoom from WinJS or is that bad too?
 
window.onkeydown = function(e) {
if (e.ctrlKey == true && e.keyCode == e.DOM_VK_J) {
console.log('coning');
e.preventDefault();
}
};
is that ok?
 
One min letmecheck
 
@edition please format your code! (control+k)
Also, use addEventListener("keydown" rather than onkeydown if you don't want a world of pain.
 
@BenjaminGruenbaum Interfaces with native components. There is no JS part for it. Look around on the interwebz, you'll see how many people ran into this as "This should be simple!" and then realize "Well, fuck.". If you're not interesting that's completely OK, but it seems like something that could be quite a challenge to me :P
 
thanks, @BenjaminGruenbaum.
 
10:30 AM
@edition Thanks
Its working
 
it did?
 
yeah
What was the reason edition why it was notwokring previously
 
did you use "$(document).ready() { }" ?
 
No we are using backbone framework
 
Are there any substantial differences between ES6 Promises and the A+ spec?
 
10:32 AM
@RoelvanUden it sounds like something I can dump on 2-3 students and give them credit for which might actually work. Can you make a gist of requirements and ping me with it?
 
I just thought 'window' would take a higher priority?
 
Actually ctrl +j opens download page and we want to avoid this in our app
Soyou have any better way
 
what sort of app?
(sorry, just curious)
 
web app
with backbone js
 
@BenjaminGruenbaum Students? Sure, I'll do that this evening and ping you.
 
10:35 AM
is it private?
 
@RoelvanUden yeah, in the university - basically it's people who learned NodeJS and JS for a semester and can do extra credit work on projects.
 
but I can give u QA url
 
inb4 "Backbone is horrible :D"
 
Username williams
Passwordprovider
sorry 1234
 
10:36 AM
@BenjaminGruenbaum You're a professor? :o
 
@RoelvanUden no, Prof Gruenbaum is my dad.
 
I like Backbone
 
I just get to randomly tell people to do things without any qualifications while sounding smart but not knowing anything.
@phenomnomnominal naa come on backbone is a horrible piece of software providing very few abstractions at a really high cost - at best it's naive, at worst it's plain stupid.
 
@BenjaminGruenbaum it appeals to the romantic in me
 
All it gives you is an event emitter really, and it costs you not being able to use your JS objects as JS objects (they have to be backbone models instead)
Wait, I'm being trolled aren't I?
 
10:38 AM
Lil bit
Spend 18 months working on a Backbone project. Been through the hell and back.
 
Jun 11 '13 at 11:46, by phenomnomnominal
AVOID BACKBONE
Jun 6 '13 at 0:52, by phenomnomnominal
god i hate backbone
Jun 20 '13 at 22:19, by phenomnomnominal
@david backbone is awful
 
but arguably an important stepping stone on the way to some useful abstractions
 
Aug 10 '13 at 11:28, by phenomnomnominal
don't use backbone
Sep 30 '13 at 9:52, by phenomnomnominal
If you can avoid backbone, do
 
@NikhilAgrawal for the Resources page, I reckon tabs would look good.
 
Nov 4 '13 at 11:05, by phenomnomnominal
@connor.js This is why I fucking hate backbone:
May 30 '13 at 16:08, by phenomnomnominal
also because @BenjaminGruenbaum isn't here, "Don't use Backbone".
Lol ^_^
@phenomnomnominal yeah, it was a naive start. It helped push the web forward no doubt
 
10:41 AM
ohh
In vIsitors got to new visitors and start typing
name and you can see that issue
 
@phenomnomnominal the more I code web the more I dislike frameworks - that's a problem with me though since frameworks can be really useful. The problem is most people here aren't the average developer at a web-shop making dozens of similar websites. For those people I can definitely see why reuse across projects can be appealing and frameworks invaluable.
 
Yeah it's a tricky one. At the end of the day they're more of a business tool than a technical one.
 
@BenjaminGruenbaum not strictly straight, but I think about 1.5 years
 
@Zhegan nice
 
A way to go to the higher-ups and say, hey look at what the cool kids are using.
 
10:44 AM
@phenomnomnominal I just think Backbone is a bad business tool :D
 
That you're right about
 
Then again things like Angular directives and web components are a sort of evolution of backbone views - they definitely influenced them.
 
@NikhilAgrawal I don't know, but the website could use inbuilt tabs...
 
I reckon
What does it mean by the way
 
I think frameworks are useful if there is a group of applications that follow a set structure with small deviations. I don't think they are a good general-purpose tool.
 
10:48 AM
Anyone know how you can completely re-initialise jquery autocomplete (remove the old, initialise new) ?
 
@Naruto probably, read the docs
 
@NikhilAgrawal I would like to help, but I don't think your company would approve.
 
@BenjaminGruenbaum O'Rlly? Like I havn't done that.. I can only find a way to just 'destroy' info given but not to completely re-initialise it
 
@Naruto first google result is a post from stackoverflow that has a solution. Please don't waste peoples' time like that :/
 
@BenjaminGruenbaum If that result would actually work.. that would be awesome.. :)
 
10:56 AM
@Naruto "$('input.foo').unautocomplete().autocomplete('url?new_param=bar');"
 
^^ tried that already, says .unautocomplete() isn't a function
 
@Naruto can't you do a .autocomplete("destroy").autocomplete(...) ?
 
How it should work, type 3 chars and look, if I do it like that, ajax calls get called every character I type, and for each time it has been destroyed and recreated, and after 3 characters it also produces ajax calls which are to the correct ajax call, but for each time it hasbeen destroyed and created aswel
 
@Naruto for each keypress?
why not use a delay?
 
@edition, yes , because I tought autocomplete would fix it?
 
11:04 AM
holez
 
why not write it without depending on jquery? (feel free to disagree with me)
 
I agree to disagree with someone who disagrees
 
nevermind...
 
@BenjaminGruenbaum LoC specifically, yes. But you should care about simplicity.
 
@mintsauce read the context around it :)
 
11:07 AM
everyone agree that you can use AJAX, across browsers quite fine without JQuery?
or not?
 
@edition depends on what browsers you have to support. If you need IE9+ then jQuery is rarely useful
 
Yeah, I know. Simplicity often reduces LoC though.
 
Wait, it's still useful, just not worth it
 
I guess that's the difference between golfing and writing elegant code.
 
Just thinking of Naruto's scenario; there should be a simple solution.
Especially having a minimum keypress delay, between each AJAX call...
 
11:09 AM
Just sayin', cos there's a lot of bloated code too.
I've seen code with stupidly high LoC, so while you shouldn't care about LoC directly, I often find that elegant code is succint.
 
on here, rlemon.github.io/so-chat-javascript-rules, how did you get the active navigation item to change, as the window scrolls?
 
'Why is this code so bloated?' is very similar to 'Why does this code have high LoC?'. Althougth they have different intents, and usually different solutions.
 
that scroll feature...
 
its should be easy, with the hashChange
 
Reducing LoC isn't necessarily a bad thing. Just playing Devil's Advocate.
 
11:29 AM
@edition there is (debounce), I just feel like he hasn't done enough research.
 
whats the best way to read excel files in node?
 
Is it possible to use 6to5 and ES6 modules with existing AMD-style modules loaded with require.js?
 
@edition In what way you can help me
I will try to convince them
 
ah, UI design, fixing javascript...
 
11:49 AM
Why is requirejs not honoring base URL?
<script data-main="dist/app.js" src="bower_components/requirejs/require.js"></script>
app.js (after 6to5 transpilation) has this:
define(["exports", "myDependencies/oldFormat.js", "myDependencies/newFormat.js"], function (exports, _myDependenciesOldFormatJs, _myDependenciesNewFormatJs) {
I get 404 errors for the modules because it's trying to load from /myDependencis/oldFormat.js etc
More accurately, it's trying to load with the directory of index.html as the base url
 
anyone familiar with using web deploy in VS from a cli?
 
My problem was that if you add .js it takes an absolute path
 
oh dear lord.. I'm really trying to answer some so-questions, but either the quality of questions has dropped tremendously or it's me. I don't even get what people are asking for like 33% of all questions
 
@jAndy It's not just you.
 
salving
 
12:04 PM
@BenjaminGruenbaum have you had the pleasure of trying 6to5 with requirejs?
 
when I use mocha, where does node pick up assert from?
var assert = require('assert');
 
> JavaScript adaptation of the OpenGL Mathematics (GLM) C++ library interfaces.
uh oh
 
?
 
@SuperUberDuper assert is a built in part of node
 
JAOMACLI - jayo mackli
 
12:20 PM
@edition @BenjaminGruenbaum I've found a workaround for my problem, thx for the help anyway!
 
@Naruto not a problem, I only waited till 1:20AM. thats ok.
 
@edition Sorry if I'd made you wait, but I guess you had other things to do aswell? ;)
 
no, I can't sleep. SO chat is good.
 
sleep.. so you are from.. US?
 
New Zealand.
 
12:27 PM
mm close enough ^^
btw, you said writing without dpending on jquery.. Then you mean full write it in javascript or?
 
yeah, full write in javascript.
or something...
 
@edition where in NZ are you?
 
Whakatane.
 
Oh nice, my uncle is a teacher there
 
so, wellington...
 
12:33 PM
Mhmm
 
I live in Wellington too
 
@KendallFrey awesome, DTF?
 
haha, I've just finished high school.
class of 2014.
 
@phenomnomnominal thanks
 
@phenomnomnominal I prefer up
 
12:35 PM
@edition grats, you going to uni?
 
why doesnt node support arrow functions?
 
@KendallFrey I can work with that
 
also, wellington in ontario
 
and io,js does I think
 
@SuperUberDuper old version of V8.
 
12:35 PM
oh
 
@phenomnomnominal didn't get into Uni, so going into technical college...
:/
 
whats the point of uni
 
@edition that's a shame, but ultimately not a big deal in this industry
 
you can be a js contractor in london and get £400 p day
 
I would like to have a job.
 
12:37 PM
why do we need mocha in node if we have native funky assert?
 
but most developers are 25+, or something
 
Work hard, learn lots, move to auckland or wellington in a few years and do the Summer of Tech
 
@edition I'm 22
 
oh
 
im 30
 
12:38 PM
@edition I've been working at big companies here (Weta Digital & Trade Me) since I was 22.
 
age doesnt matter really for js jobs
 
My first real job was more than 3 years ago
so I'd have to be 19 back then
before that it was all freelancing
 
@SuperUberDuper Because mocha is more than just a bunch of asserts
 
I think I was barely 18 when we signed our first contract for a web app
 
you are a top academic, @BartekBanachewicz?
 
12:40 PM
what's a "top academic"?
 
I hadn't written a line of code til I was 19.
 
I think I was about 9 or 10
 
I started at uni doing a degree in music.
 
I guess I can start Uni later...
 
Yep, but like I said, not a prerequisite for a job in this industry
 
12:44 PM
its 1:43AM, should I rest now? Any more questions need answering here?
1:44AM
 
Yeah same for me, I guess I have work in the morning
 
@phenomnomnominal I saw the work at trademe video. It looked good.
 
@edition we have a good time
 
I have a string like "1,2,3","3,4,5","5,6,7"
 
arrays?
 
12:46 PM
how do I split it like "1,2,3" & "3,4,5" & "5,6,7"
yeah, basically want to convert it back into array
 
so like this? "1,2,3&3,4,5&5,6,7" ?
"1,2,3&3,4,5&5,6,7".split('&');
 
!!> '"1,2,3","3,4,5","5,6,7"'.split('","').map(function (subArr) { return subArr.replace(/"/g, '').split(',').map(Number); });
 
:)
 
But this sounds like XY to me
night bitches
 
1:07 PM
@phenomnomnominal what else?
 
@SecondRikudo no, but it should work.
 
1:33 PM
@phenomnomnominal Could you explain what you just did there?
basically that.
need an array of objects back from a string.
 
here is the angular way of handling the deviceready event (phonegap/cordova): ng-newsletter.com/posts/angular-on-mobile.html
But I don't understand what follows...
 
"{1,2,3}" what
 
@NickDugger what?
 
"We can use the CordovaService to determine if Cordova is, in fact, ready, and we can set our logic to depend upon the service being ready"
There is a line of code there saying CordovaService.ready.then(...) ... I don't get the purpose of having all that as a promise...
 
@doodla I realize that it's a string, but why is it the way that it is? "{1, 2, 3}"? Where are you getting this data from?
 
1:47 PM
@NickDugger its just an example string. The real data is an array of JSON.stringified objects I'm storing in an array, converting to string and storing the database. Then retrieving the string.
 
unless "{1, 2, 3}" is always a string, It's not valid... Not sure if it is or not, just pointing out how weird it is, otherwise. I ask, because I'm not sure how new you are to javascript.
 
pretty new.
gimme a sec. fiddling it
 
I'm not clear on the question. You want to get the array back, before you did toString(), or what exactly? Because you still have the array in memory
 

« first day (1556 days earlier)      last day (3391 days later) »