« first day (1588 days earlier)      last day (3346 days later) » 

8:02 PM
@rlemon Canadians are weird, eh?
 
sure are
 
@rlemon can you help a lil with canvas
 
But so is everyone else
 
so that i can focus on the react part of something :->
can u just give me a decently (but not too heavy) animation for a background ?
 
Oh yeah, @darkyen00 what was your question?
 
8:06 PM
@Shmiddty I am trying to contribute to react-canvas
 
ok
 
does this makes sense to you

import React from 'react';
import {LayoutLayer, RenderLayer, Drawable} from 'react-canvas';

var AwesomeView = React.createClass({
    onAnimationFrame(ctx){
    /* call to draw */
      // do your awesome stuff !
    },
    render (){
          return (
               <RenderLayer>
                   <Drawable
                       cachable={false}/>
               </RenderLayer>
          );
    }
});
In the latest version you pass the rendering function as a prop to the drawable
 
@Loktar you know more about react
wanna chime in?
 
and canvas too
@Shmiddty the way i am proposing this is because the Drawable can then take child nodes as dom elements and manage the react dom seperately
so that a11y is not broken.
 
yea he knows both. I would not feel comfortable answering it because I've never touched react
 
8:08 PM
I haven't looked at the react-canvas library much
 
@rlemon can you just make me a cool as animation for background though ?
 
cool enough?
 
@Shmiddty this is spec for defining re-usable componenets in the library.
hell yes !
can you just make the clouds go up ? pweeeze and give me the raf ?
 
you can :P codepen.io/rlemon/pen/myyjem commented source
 
thanks :D
 
8:09 PM
err
 
and this is why i love this room.
 
dammit no comments in there :(
haha I suck
 
I will blur the clouds using iOS style frosty blur
in dynamic :3
he-haha
 
oh ho ho no you (probably) won't
if you want to blur, you'd best have a superscalar processor
 
@ssube na-uh
there is stack-blur
and i can sample the canvas to 320 x 60
stack-blur is fast as hell for a single iteration :-)
 
8:11 PM
stack-blur is really nice
@Loktar also has a nice blurring algo
it is on his codepen
 
@rlemon draw on a very small canvas and draw back ?
@ssube you can also technically abuse webkit
 
@darkyen00 no, check out his codepen
 
by rendering it on canvas(es) you can pretty much do anything !
 
how is that stack blur faster than a simple two-pass blur?
 
@rlemon roger that... is it faster than stack-blur
 
8:12 PM
@darkyen00 no clue
 
@ssube read the source :D
 
user1596138
@KendallFrey (I'm very new to canvas) I'm having trouble thinking through how to have a fixed length line. I'm not used to thinking in terms of XY. :/
 
@darkyen00 I did
the question stands
 
:-( okay do this run the debugger
 
@Jhawins don't think length, think distance between points
 
8:13 PM
and single step it :->
 
x1,y1/x2,y2
 
user1596138
I have to basically use pythagoras theorem for that too?
 
@darkyen00 that doesn't answer the question in the least
 
@Jhawins your X coords are fine, but you need to calculate the Y coords from the triangle
 
@ssube i am just trolling.
 
user1596138
8:13 PM
@rlemon That is exactly what I am having trouble with
 
@Jhawins yep
 
what implementation detail causes a complex algorithm like the stack blur to be faster than the traditional two-pass gaussian-esque blur?
I'm assuming pixel writes, if it is faster at all.
 
user1596138
@rlemon Not sure I get this
 
user1596138
Ok, I know how to determine the base of the con rod (right? I just use my Y coord from crankPositions?) same with X. But setting the other end where the piston attaches is my issue.
 
8:16 PM
var dx = x1 - x2,
     dy = y1 - y2,
     ds = dx * dx + dy * dy;
// ds is now your distance between the points squared. don't sqrt it just square the length as well and check
 
ps @ssube not bragging or anything but i wrote a mini image processing library for skin detection in javascript, that is when i came across stack-blur iirc it allowed me to do skin detection (color based) at 60fps :-) blur was used to reduce noise (ofc)
 
user1596138
@rlemon This helps me determine the length I understand that. But I need to set it not observe it
 
while my implementation of gaussian stood only like um 20isque fps
 
@darkyen00 how did you implement gaussian?
 
user1596138
Working with points just doesn't feel right to me I haven't ever had to
 
8:17 PM
@ssube i ported it form some c-code
 
user1596138
I keep expecting to be able to modify the 1st point and just have the second point follow lol
 
@Jhawins let me find an example
I've done this before
 
was it the standard read-N-in-a-row, modify, rotate, read-N-in-a-row(-that's-really-a-column), mod, out
or read row, mod, row col, mod, out?
the rotate isn't always a good idea, depends on what driver you use and how it packs the pixels
 
user1596138
Alright. Try not to give me the answer in copy/pastable form please but I appreciate the help
 
@Jhawins the x coord is fixed, you just need the y
so you have a right triangle between the piston, connecting rod base, and centerline
 
8:19 PM
@Jhawins codepen.io/rlemon/pen/JdHtI you can review how I did it here. old ass code, so if you copy and paste it you'll have a bad day :P
 
Well, you could represent your line segments with 1 point, a length, and an angle, instead of using two points.
 
function gaussBlur_1 (scl, tcl, w, h, r) {
    var rs = Math.ceil(r * 2.57);     // significant radius
    for(var i=0; i<h; i++)
        for(var j=0; j<w; j++) {
            var val = 0, wsum = 0;
            for(var iy = i-rs; iy<i+rs+1; iy++)
                for(var ix = j-rs; ix<j+rs+1; ix++) {
                    var x = Math.min(w-1, Math.max(0, ix));
                    var y = Math.min(h-1, Math.max(0, iy));
                    var dsq = (ix-j)*(ix-j)+(iy-i)*(iy-i);
                    var wght = Math.exp( -dsq / (2*r*r) ) / (Math.PI*2*r*r);
 
one leg of the triangle is the X of the base, and the hypotenuse is the connecting rod, then solve for the other leg and you have the Y coord relative to the base
 
^ not my code
 
@darkyen00 oh yeah, double loop. That will never work. :D
 
8:21 PM
@ssube ik
iirc that was initial and can be seen here
 
splitting the loops and putting an output stage in between, you decrease the number of samples fron N^2 to 2N
since you need at least 3x3, more likely 9x9, you go from 27 to 6, or 81 to 18
 
that was the initial implementation
@ssube i have spent about half a semester on image-filters
would visit them back sometime :-)
 
@darkyen00 fix this
imgur serves all images with CORs enabled
no need to 'note' a bug when there not be one
 
@rlemon its not cors, jandy removed his image.
 
well yea, but FYI
 
8:25 PM
@darkyen00 I spent way too long on them, with MGE and some of those old projects
 
imgur has cors
 
@rlemon aiight i will fix it now.
 
:) ty
broken demos are doing no one any favors :P especially you
 
@rlemon give me that sexy 18 picture of yours via imgur ?
 
you wann alook at me topless?
 
8:26 PM
send a topless
// as you know very well my racist algorithm only works on Caucasian skin
 
#TheVapenning
 
xD
 
i.imgur.com/2yeiX7r.jpg see if it is good enough for this
the background is similar to my skin
@SterlingArcher in 4 days my friend
 
Stupid border >=( I wanna send you murcan juice
 
I already get some
I was going to include juice with yours but forgot
 
8:28 PM
I thought customs wouldn't like that?
 
lol
 
see, the thing is they shouldn't care.
9/10 times it passes without issue
 
1/10 though?
 
@darkyen00 hehe told ya
 
8:29 PM
The langolears are eating lemon :O
 
Thats why you should never do detection based on skin color
your old dp worked the best
the one with the soda can
and falls in bg
 
dp? ._.
 
user1596138
I...
 
user1596138
Hmm
 
@SterlingArcher display picture :-( sorry
 
user1596138
8:30 PM
Well the rod is a fixed length now. That's a start. And the piston follows the rod's coords. So getting there I guess
 
user1596138
points[y2] = points[y1] - points[x1] + pistRodLength right?
 
uhm
i dunno what that means
but there's no pythagoras in it
 
user1596138
nvm lol
 
@KendallFrey's image might work better
nah it didn't
 
8:34 PM
@darkyen00 ^
 
Any AngularJS fellas?
 
@JayKan 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.
 
Image from origin 'http://i.stack.imgur.com' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://s.codepen.io' is therefore not allowed access
lol stackoverflow peeps
It worked almost fine on irc maxwell@ircmaxell
i wonder why it detects his hairs as skin :-/
It worked almost fine on irc maxwell@ircmaxell
 
wtf?
 
trying to get a js based skin detection (that worked in past) working again
 
user1596138
8:40 PM
I just don't get it. Where the fuck does my angle come in
 
user1596138
Degrees of rotation
 
user1596138
How can I possibly solve this without using that
 
it works on caucisian skins and the code is about 2-3 years old so trying most of the rooms images :-/ to see whats going wrong
 
That's maxell alright
Gloriously goatsed
 
@darkyen00 so reupload it
noob
 
8:42 PM
I mean goateed
 
user1596138
I have X (centerline) which stays the same. I have X of base which changes and I have Y of base which changes.
 
@rlemon wow it detected the part of jandy's face you used !
 
That's some Hannibal Lecter shit right there
 
@@@jAndy use it as you avatar now.
 
user1596138
8:43 PM
sq(baseX) + sq(baseY) = sq(newY)??
 
/* note to self, use the final submitted code on the code-pen (the code was in cpp) */
 
user1596138
Clearly not lmfao
 
user1596138
Like I said. Basically I had no geometry in school.. I really just don't understand the way I am supposed to think about this. I give up and will go smoke
 
@darkyen00 I recognize a jandy
 
8:47 PM
@Jhawins remember the diagram
you know a and b, and you have to calculate NOT a
 
user1596138
B is always the same. It is my crank radius, right?
 
b is the x of the crank
 
user1596138
Doesn't matter what angle it is connecting to A?
 
well, sorta
 
@darkyen00 I'm pretty sure I only used his eyes and nose
rest is picard
 
8:49 PM
really ?
wow !
ps i am watching star trek right now
and everytime i see picard i remember jandy
 
@Jhawins x of the crank is the b in a2 + b2 = c2. and the connecting rod is c
you will also need to add the y of the crank to get the absolute y
because the b in that equation is relative to the crank
 
WHY WITH THE FACES
I'VE SEEN SOME SHIT
 
I've seen some shit too
mostly after I stand up from the john
 
@SterlingArcher Have 10 points for knowing your Stephen King
@KendallFrey ew, dude...did you at least ask john?
 
user1596138
@KendallFrey rod is c?
 
8:53 PM
make the rod D
:D
 
user1596138
Yeah just fuck it. Don't worry about it..
 
user1596138
I can't comprehend this right now. Maybe some other day I suppose.
 
@Jhawins yup
do you need another drawing?
or should I just give you the code
 
user1596138
@KendallFrey a2 + b2 = c2 if b is x of crank and c is conrod what the fuck is a
 
user1596138
I want the code but you shouldn't
 
8:55 PM
the variable that you're solving for
which is the y of the piston relative to the crank
 
user1596138
Ok.. So if I do crankX + conRodLength I get my new Y? Because I'm pretty sure that's just not how it works
 
nope
 
user1596138
That's going to be some random number that doesn't help with anything..
 
user1596138
Well I can't do a2+b2=c2 without a2
 
if a2 + b2 = c2 then a2 = c2 - b2 and a = sqrt(c2 - b2)
@Jhawins yeah, that's how algebra works lol
 
user1596138
8:57 PM
Add "undefined" to b2. Got it
 
user1596138
// sarcasm
 
watlol
 
endX = startX + length * Math.cos(angle * Math.PI / 180);
// repeat for Y
or something like that
 
that's for calculating the position of the crank?
because that is working fine, he doesn't need to change that
 
user1596138
I have crank positions calculated..
 
8:59 PM
I thought we were still working on drawing the line of X length on Y angle
I'll just be quiet
 
user1596138
Sometimes the best way to learn is to be given the answer.. Maybe it's time
 
user1596138
But no
 
well, we could do it that way, but it would involve lots of nasty trig
 
user1596138
Dammit
 
pythagorean theorem is easier
 
user1596138
9:01 PM
@KendallFrey why is there sqrt here
 
@Jhawins i pretty much handed it to you, lol
@Jhawins x2 = y -> x = sqrt(y)
(x2 means x squared)
 
user1596138
It's a little funny how I am trying to calculate just ONE point and can't figure it out
 
user1596138
@KendallFrey oh well that makes more sense now
 
well, you're only trying to calculate one number, the x is fixed
 
user1596138
I thought the 2 meant second point on the line..
 
user1596138
9:02 PM
Cause full size 2
 
nah
I'm lazy, don't hate
 
@Jhawins don't feel bad. when I started on canvas simple math was going over my head. I think I (and probably you) are over complicating things in our own heads because we think it should be harder
 
yeah
I really wonder why people have a tendency to overthink, not underthink
 
because of the misconception that these things must be hard
 
user1596138
I made a pendulum somehow
 
user1596138
9:03 PM
Earlier lol
 
make a double pendulum, I dare you
 
user1596138
Dude I can't even solve 1 point on this line
 
user1596138
Screw canvas lol. Screw pendulums and screw your mom
 
user1596138
!!afk smoke
 
@Zirak I'm glad somebody got it :)
 
9:06 PM
@FlorianMargaine I am very very confused. dolist is returning the same item every time, and when running from eval-buffer is get different results from running with C-x C-e
Printing the list before iterating shows its complete and quite disparate. The list's quite large.
I hate being a n00b again
So tiring
 
my marketing coworkers are debating the existence of ghosts...
 
user1596138
Thanks for trying so hard to make me understand tho @KendallFrey
 
I said that there's a reasonable, scientific explanation for everything
 
@NickDugger Ghosts can perfectly well be included within our understanding of the universe (just like magnetism and mercury), but it just so happens that there's no need to include them.
 
@Jhawins if you want another drawing, just ask
 
9:10 PM
Also, ask them where all the cow and sheep ghosts are
 
user1596138
I don't think it'll help.. I'm just not getting something. It will come to me eventually..
 
Only humans get ghosts, everybody knows that
 
@FlorianMargaine nvm I'm stupid
 
Babel question (cc @BenjaminGruenbaum and @Sebastian ) I want to start using ES6 stuff in our e2e tests. Should I monkey around with the require hook, or just have a compile step?
 
No yes it's still weird. Nothing's running. Call a medic. garble garble.
 
9:15 PM
warble warble
 
I remember talking to @michaelpryor about possibily productizing Stack Exchange chat, which was great. We decided not to. (Looks at Slack)
 
The plot thickens. Nothing happens after the write-file
 
user1596138
@KendallFrey will you just give me the answer... I want to understand so badly and I wanna write it out myself but I just don't get it dude.
 
user1596138
I've tried a hundred things
 
user1596138
9:23 PM
I mean I'm pretty sure you already gave me the answer
 
user1596138
And I still can't do it.
 
ok, let's define cX and cY as the coordinates of the crank, r as the length of the rod, and solve for pY which is the height of the piston
everything relative to the centre of the crankshaft
 
user1596138
And the cX and cY are relative to the degree of rotation right? Using my calculated crank positions?
 
@SomeKittens lol, I love how you pinged the library author :P Monkey around with the compile hook until it's no longer fast enough and then move to compiling.
 
yup
pY = sqrt(r*r - cX*cX) + cY
 
user1596138
9:25 PM
So they are the base of the rod?
 
@BenjaminGruenbaum but of course!
 
@Jhawins yup
 
@SomeKittens I don't get it :P
 
He says that Slack is better than SO chat so there's no reason to "productize" it
 
9:27 PM
@BenjaminGruenbaum He's saying they wiffed on a $1B opportunity
 
I didn't even know slack existed
@SomeKittens oh, lol.
 
@FlorianMargaine In case it ever bites you: print does some other shit when you're evaling, doesn't print to *Messages* or something
Also I'll want a CR in a few please
 
user1596138
@KendallFrey well this seems to work.. But I thought this solved my stretchy conrod problem
 
user1596138
Something else must be off.
 
it should
 
user1596138
9:30 PM
Oh wait!
 
user1596138
I was measuring conrod length only with Y
 
user1596138
@KendallFrey I had it right earlier... But my stupid ass conrod measurement convinced me I had it wrong.
 
user1596138
This could've been over a half hour ago lol
 
user1596138
I think I might still have something wrong...
 
user1596138
codepen.io/Jhawins/pen/wBoerb updated fiddle. You were right all along
 
9:36 PM
I get that a lot :P
 
user1596138
This is crazy to me still lol.
 
user1596138
The whole "faster over TDC stroke than BDC"
 
user1596138
It's just illogical in my mind. But then there's an explanation for it
 
yeah, it is really counterintuitive
set pistonRodLength to 6, desStroke to 5, and line 410 to if (false) {
 
user1596138
It looks so much different now
 
9:39 PM
then it will be obvious
 
user1596138
@KendallFrey I'm sure you noticed the case doesn't match up to the head at all if you changed those ;P
 
user1596138
(circle around crank)
 
well yeah
but who cares about physics
you can even change the length to 5
 
user1596138
@KendallFrey wow!!
 
user1596138
9:41 PM
That works
 
user1596138
Kendall.respect++
 
@SterlingArcher Could not process input. Error: nothing to repeat on line 3
 
waaaat
 
see if you can figure out a piston -> crankshaft setup that does behave like you expected
 
user1596138
9:43 PM
@KendallFrey Oh shit lol no dude I think I need to have a few beers. Maybe tomorrow :P
 
user1596138
Btw I found an awesome read on this just now
 
oh cool
do link
 
user1596138
Wish I found this before I made the script at all lol
 
user1596138
9:51 PM
I'm gonna have to reverse this shit and make the piston drive the crank instead of the other way around cause that's kinda how engines work lol
 
you mean simulating combustion?
 
user1596138
But I'm waiting until I have the valve train done and can apply "realistic" forces to the piston based on the fuel/air ratio
 
user1596138
Yeah. I have a lot of work done already but it's not in a demoable state right now.
 
that's gonna be fun, lol
 
liar
 
user1596138
9:53 PM
Thermodynamic properties were a bitch to get a handle on haha
 
user1596138
There would be no point in calculating 80% of the values that Engine returns, or building the parts the way I did if I wasn't going to simulate combustion down the road.
 
you'll need to model gas pressure, temperature, even chemical reactions, crankshaft angular momentum, piston momentum..., etc.
 
user1596138
Yeah it will probably never get finished I know that.
 
user1596138
But just today I've learned some pretty cool stuff.
 
it's not hard, just a fuckload of equations
 
user1596138
9:55 PM
Fuck yeah it is lol.
 
user1596138
Right now it's just an animation and there's nothing "real" about it
 
@SterlingArcher show her how to brainfuck
 
user1596138
I'd like to come out with HP/torque specs at a given RPM in the JavaScript simulated engine. I will make a v8 that runs on v8 lol
 
if you want it to be accurate, you'll have to do a lot
 
user1596138
9:56 PM
It doesn't work right now but it's basically setup for multiple cylinders too. Easily made that way at least
 
like, chemistry isn't even something most physics engines would consider including
 
user1596138
@KendallFrey To follow the animation yes. Just to calculate those specs... Not really.
 
well, to simulate
 
@KendallFrey lol
 
you can probably get an approximate equation for engine stats, but that's no fun
 
user1596138
9:57 PM
Yeah to simulate is gonna be difficult. But just making the calculations is pretty damn simple I could've included potential torque/hp specs with the data I already have
 
user1596138
But yeah that's no fun
 
cause you have friction and stuff affecting torque
 
user1596138
Yeah friction can go to hell
 
@SterlingArcher did you ever pick a color? you're still uncolored for me
 
without friction you have perpetual motion
 
user1596138
9:59 PM
Which is the bomb
 
@Shmiddty wait what?
 

« first day (1588 days earlier)      last day (3346 days later) »