« first day (1782 days earlier)      last day (3160 days later) » 

8:00 PM
@Callum A bit of a stretch you say
 
@Zirak really? One of my college buddies moved right in the neighborhood of Approximately.
 
@KendallFrey Just a bit :p
 
@rlemon Looks cool, but wwwaaaayy overkill
 
@SomeKittens ah thanks! At a quick glance, does this article seem pretty reliable? panda-os.com/2015/01/angularjs-apply-digest-and-evalasync/…
 
@Austin yes, but again, you shouldn't be calling that manually
 
8:04 PM
@Jhoopins oh, that looks most interesting, it seems like Chromecast + other stuff
Unfortunately...shipping will probably double the price
@ssube Wwwaaayyy overkill + shipping
@SomeKittens That's the first thing I thought about, then wanted to consider "cooler" alternatives
 
it's phenomenal for non-technical folks
 
user1596138
@Zirak They're pretty popular round here. I think there's 3-4 versions of it
 
user1596138
You don't have Walmart?
 
user1596138
:D
 
Hang on, I'll just hop on a plane and Walmart all over you
 
user1596138
8:06 PM
Ah
 
user1596138
Where do you go buy electronics...
 
user1596138
There's no stores around?
 
user1596138
Err, forgot your circumstances. Nvm
 
At shit stores. I wish I was joking. Stores here are shit. 2x or 2.5x times the price abroad.
 
We have a Walmart equivalent, in Scotland and rUK, Asda, but it is less Walmart-y.
 
8:08 PM
The variety is pretty shitty
 
@Zirak That's sex discrimination!
 
@SomeKittens ...
 
Hrmph... anyone know a good way to take an array of objects, and split it evenly (numerically ) on a given property?
 
what
 
user1596138
That question makes sense
 
user1596138
8:09 PM
Sure
 
What, so item 0, 2, 4, 6 go into a different array to 1, 3, 5, 7?
 
One second, gotta get data for it to make sense
 
@SomeKittens I'm doing silly things in passport again, and cloning the results from postgres before I run it through the password compare module. problem is, var user = results.rows[0] works, but if I slice the row out and don't hold the ref user.password is not copied.
 
You should probably also rephrase your question for it to make sense:p
 
is that expected?
 
@Nick how is that front page?
jesus that site is going down hill.
 
because it's funny
 
so how does one go about giving an object a property that doesn't get cloned on a [obj].slice(0,1); cc @Zirak I know you know
 
but yes, the people choosing things for front page need to be replaced
 
splitIntoGroupsByProp([
  { _id: "1", weight: 3 },
  { _id: "2", weight: 3 },
  { _id: "3", weight: 4 },
  { _id: "4", weight: 1.5 }
}], 2, 'weight');
// => result
[
  [{ _id: "1", weight: 3}, { _id: "2", weight: 3}], // total: 6
  [{ _id: "3", weight: 4}, {_id: "4", weight: 1.5}] // total: 5.5
]
 
8:17 PM
fml... my boss hired someone that barely knows javascript for a fullstack role
 
Something like that, if that makes any sense... evenly divide it by a property into n groups (as closely as possible)
 
@rlemon huh?
@SomeKittens I might actually go with Chromecast.
 
@Zirak trying to figure something out in node right now. I have a db query results (pg) and .rows[0].password is there, but .rows.slice(0,1).password is undefined.
only password is missing when I slice it, so I have to imagine that was on purpose
just curious how
 
@rlemon Can you isolate and post a demo?
 
not really, it requires a database to be setup and that would take a little bit
:/
 
8:20 PM
@rlemon some sort of schema?
 
All slice does is for (...) ret[i] = source[i], nothing magical
 
nothing I'm doing myself.
 
what db?
 
postgres
 
oh postgres
 
8:21 PM
Oh yeah @rlemon, slice returns an array
So of course arr.password is undefined
 
fuck
dammit
I need to go home
 
ha, that'll do it
is Array.first, and Array.last proposed anywhere?
or do they imagine destructuring is good enough for that?
 
@RalphWiggum one of the back end guys here doesn't know how to use browser devtools, so when he needs to breakpoint something, in the javascript, he writes "eval('debugger')"
2
 
@phenomnomnominal Reflect.get is good enough...if the signature was better, and partial application was a thing
Like Ramda.prop(0)
 
let [first] = arr; isn't so bad I guess.
 
8:23 PM
@rlemon "slice the row out"?
@Zirak WINRAR
 
@SomeKittens nvm, Zirak solved it
I am not a smart man
 
@SomeKittens A winrar is you
 
@rlemon heheh
 
@rlemon Just grow fancier moustache, wisdom comes with it
 
I feel like my code is getting increasingly worse, either that or I'm just more able to recognize bad code, but not quite able to write good code yet.
 
8:26 PM
Hello all :)
 
G'dai mait
 
How's it goin today?
 
Awrite mait, you?
 
Rite lovely I'll say :D
 
so .slice keeps refs to the objects within the array? jsfiddle.net/nkw95x0o
ohh fuck. shallow copy
dammit
:(
 
8:32 PM
:3
 
@rlemon JS is all shallow, man
 
yea, I'm pretty sure this is the first time it has bit me in the ass tho
    var user = require('./modules/extend')({},results.rows.slice(0,1)[0]);
#idgaf
 
whoa there, I think you might have missed an operator there
surely you could slip one more in?
 
you know when you have those days where everything is a facepalm?
 
8:49 PM
@rlemon Nearly every day, yeah :P
 
also, TIL ST has a "goto definition" on the context menu
 
ST?
 
sublime text
 
Buh buh buht atom editor is hippster
 
8:51 PM
@StephenSmith 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 and goto line
 
Ah,
 
@ and : respectively
 
You know how in space, nobody can hear you scream? Well...
 
m59
lol my server is responding with status code "2" for who know why...
 
8:58 PM
2 good 4 u
would it be retarded to use three.js for 2d rendering, just to take advantage of webgl's speed?
 
@Nick I 2nd this question.
 
@Nick not if you benchmark
 
benchmark? Why? I thought webgl was just faster, period
 
pixi.js seems to have crazy good performance....webgl-2d on the other hand, seems awful
 
I don't want to use pixi -- a bit too much abstraction for my taste
 
9:02 PM
Yeah I tend to agree with that
 
@Nick depends. For 2D stuff, it might not be faster than accelerated canvas.
It will always be more powerful, if it's available.
 
Hmm
I thought they did tests, and webgl was faster than 2d context
I will see if I can find a current benchmark
 
m59
Ah, a resource was return the number "2" and then res.send(2) was going down. I hate magic.
res.send(2) should respond with "2", not set the status code to 2.
 
@Nick Yeah, but some stuff introduces overhead if you do it in 3D
I seem to recall having performance issues with rendering text with three.js
 
9:09 PM
rendering text is a bitch anyways.
 
always
 
3D and 2D are different, so it depends on what exactly you're doing as to what performance you get
drawing triangles? my money's on 3D
Circles? perhaps less so
 
Using 3D with a flat projection matrix to do 2D might be faster, but not in a way that will matter (until you have a ton of sprites and need to start batching).
 
I'm still heading towards webgl, with an ortho camera
 
benchmark anyway
 
9:13 PM
but I'm lazy
 
worst case scenario, you were right that 3D is faster and you get to feel like a genius
 
cheap VPS seller company?
 
9:30 PM
costco
and ramnode
 
@Nick how complex is what youre trying to do?
remember if you use requestanimationframe youre capped at 60 fps so no point in trying to go higher
And @KendallFrey yeah text is lame in webgl but you could always overlay absolute divs for your UI
 
Can someone eli5 why drawing circles is so much slower than other simple shapes. Like I get why it is slower, but I wouldn't think it would be such a hit
 
Im using three.js for my current project and im just going to overlay divs for my HUD
 
@rlemon If you take it down to Bresenham's line algorithm, it's not much difference.
 
In Canvas it is. So chaulk it up to implementation?
 
9:44 PM
3D renderers don't typically render circles though, and if you approximate circles by a many-sided polygon, your poly count goes up
I have no idea how Bresenham's line algorithm works with circles and AA
I wonder what the difference between plain and AA is
 
Wanna find out and report back? Thanks
 
No
I was hoping you would
 
I have to go exchange paint.
 
In computer graphics, the midpoint circle algorithm is an algorithm used to determine the points needed for drawing a circle. Bresenham's circle algorithm is derived from the midpoint circle algorithm. The algorithm can be generalized to conic sections. The algorithm is related to work by Pitteway and Van Aken. == Summary == This algorithm draws all eight octants simultaneously, starting from each cardinal direction (0°, 90°, 180°, 270°) and extends both ways to reach the nearest multiple of 45° (45°, 135°, 225°, 315°). You can determine where to stop because when y = x, you have reached 45°....
relevant?
 
yeah, that's the one
 
9:47 PM
Pls post benchmark results
 
what is openvz and kvm?
does it matter?
 
This is weird :\
 
@ʞɔᴉN How would I even begin doing that? Just drawing circles on a canvas?
Never mind, it has a section on JS
Actually, I could bastardise that algorithm to make something face a mouse, possibly.
 
 
1 hour later…
11:01 PM
how can you draw circles on canvas?
It's pretty simple
all of the webgl tutorials are god-awful
 
Tried using the JS example in the Midpoint circle algorithm, It seems shite codepen.io/CallumBarclay/pen/NGPPym
 
what are you doing? If you're using 2d canvas, just use the arc method
 
I was just seeing what it outputs, and it outputs an oval?
Ah, canvas height should be two times the width to draw a circle.
Much high quality circle - codepen.io/CallumBarclay/pen/NGPPym
 
11:18 PM
you shouldn't use css width/height on canvas
 
Stop me :p
 
HAMMERTIME!
 
hammertime me
 
11:37 PM
@Luggage finally finished that article - good stuff.
 
Hi all
 
Hello
 
I have a few functions each do ajax to insert/update/delete data, if I use em 2nd-3rd time the requests sent are multiplied each time
can I use this one with functions as well? thecave.info/how-to-abort-a-previous-ajax-request-in-jquery
kinda frustrated with this
 
not sure if it fits your usecase, but debounce?
 

« first day (1782 days earlier)      last day (3160 days later) »