« first day (1591 days earlier)      last day (3372 days later) » 

12:03 AM
Is it wrong to be so excited about React native
 
@darkyen00 ew, you still use bower?
 
i swear the rate at which the javascript community goes through shit is insane
we're using grunt but the new hotness is gulp or something now?
does anyone use webpack?
so much shit to try keep up with
 
@david we use webpack
and gulp :P
 
Why both?
 
i think they do different things
 
12:14 AM
@Deepak they do completely different things
 
You can put build tasks in webpack
like precompilation
 
@Deepak yes, but gulp ones have already been written
and as soon as webpack can't do something, you need another build tool, so better to just let webpack do the thing it does best
 
hmm
maybe my needs were too simple
I really liked getting rid of grunt
 
I'm trying to set up this stack that a friend of mine is using
react + flux + immutable + webpack with the react live reloader
I've got most of it working, it's fairly neat
haven't tested out the flux flow yet
reading up on reflux vs flux to see if i maybe want to switch those out
 
currently working with angular + typescript + webpack + gulp, it's quite nice.
 
12:20 AM
never tried typescript
used coffeescript for a while, going to switch to ES6 now using babel
(it also doesn't help that all the frameworks keep changing names)
is typescript good? what does it give you?
 
@david types, and some ES6 stuff.
I'd take babel over TS every day.
 
generics as well
 
@david most important thing is that we have ~60 .Net devs, about to change to this project
 
oh god .net devs
(my first job was .net :D)
 
12:26 AM
hi
 
@Deepak babel has that with flow
 
flow is new to me... a static type checker?
 
@BenjaminGruenbaum that's cool, i hadn't heard about flow
 
12:32 AM
It's facebook's typesystem
 
I think i'm going to ignore flow... I seldom seem to encounter problems caused by type mismatches :S
 
#willitscale
 
I like flow
at the very least its a test of your code
Did anyone see the Relay/GraphQL vid
 
[we-so-excited] is totally not a real tag ><
 
room topic changed to JavaScript: Read this: rules.javascriptroom.com. Before asking inform yourself on the XY problem goo.gl/taIqf | Angular is on topic here stop asking. Don't ask to ask just ask. [cereal] [david-programming] [ecmascript] [es6] [javascript] [we-so-excited]
 
12:43 AM
What changed?
 
how do you do fucking tags?
 
i have no idea it's not working halp
 
[tag:tag-text]
 
@david it's working
like rlemon wrote is only for messages.
 
no spaces
 
[tag:☃]
 
[tag:what about this]
 
[tag:trying this]
 
12:47 AM
did you try 255?
 
> Uncaught RangeError: Maximum call stack size exceeded
In a program compiled from Haskell to JavaScript
 
expecting lazy evaluation?
 
@copy sounds like TCO is dropping the ball or you wrote a function that wasn't TCOd
@OliverSalzburg wait, what?
 
let coords = [(x,y) | x <- [0..width], y <- [0..height]]
_ <- mapM (\(x,y) -> bufferPut buffer x (x `xor` y)) coords
Maybe mapM_
 
That code range errors in isolation?
 
12:54 AM
Yes
Throwing away the result using mapM_ makes the problem go away
 
current brainstorming http://shipyourenemiesglitter.com, but with bees.
 
Still sucks if I have to implement a TCO'd version of map at some point
 
#backbone question, is there a way to get a ModelView from very Model object?
 
1:09 AM
I'm writing an answer I want critique for in a few minutes.
@phenomnomnominal 100% would buy
 
.......
 
ahh
should add a word bounds
 
Blood Alcohol Content
 
I've thought of getting a tester, for kicks
hook it up to my pc, have a twitter account tweet my bac
 
@BenjaminGruenbaum it's shit.
 
^
 
+1 for the effort
Didn't read though, too long
 
Well, I want to know if the proof at the start is ok.
(it's not, I want to know if it's convincing enough though :P)
 
2:14 AM
Is there an easy way to center 200+ svg images to their canvas or remove the whitespace around the main path all together?
 
promises will be wrong
 
user3949359
2:40 AM
`function sum(/*arg1, arg2, ... , argN */) {
var i, result = 0;
for (i = 0; i < arguments.length; i++) {
result += arguments[i];
}
return result;
}
sum(1, 2, 3, 4);`
 
user3949359
Why does the function return result incremented by 1 each time, instead of returning the final number of args, which would be 4? At the end of the loop, shouldn't it go back to for instead of proceeding to return result?
 
function works fine? jsh.zirak.me/19v8i
 
@AaronBenjamin If you could get a list of all the points in the image then you could run a convex hull algorithm over it
 
user3949359
@rlemon Isn't it supposed to go back to for immediately after reaching that closing curly brace?
 
what?
 
user3949359
2:44 AM
@rlemon Shouldn't the return value of result be 4, instead of 1,2,3,4?
 
no
for (i = 0; i < arguments.length; i++) {
    result += arguments[i];
}
this adds up the values
result += arguments[i]; is the same as result = result + arguments[i];
 
user3949359
@rlemon with each loop, the value of result is incremented by 1, and that's before returning it, no?
 
this is hurting my head please stop
 
you are not incrementing by one, you are adding the next value
1 + 2 + 3 + 4 = 10
 
user3949359
ok
 
user3949359
2:46 AM
so we add each index consecutively
 
you are not adding the index, you are adding the value
 
user3949359
right, that's what I meant
 
user3949359
function increment () {
sum = 0;
for(i=0;i<10;i++) {
sum ++;
}
return sum;
}
 
crl
Use the fixed font button --->
 
user3949359
Why isn't this simple loop returning 1,2,3,4,5,6,7,8,9,10 and instead just 10?
 
2:56 AM
sum is a number, adding 1 to it changes the value. If you want a list you need to use an array
 
user3949359
Ok, I see now
 
Uhm...
@rlemon check this kid out, all his answers appear to be to questions asked by himself on a different account. imgur.com/a/k8fE5
he didn't even bother changing the name, just switched an o to a 0
 
crl
found out where Zirak got his avatar from :) quickmeme (their upvote icon)
 
quick question, should my render loop use requestAnimationFrame and my update loop use setTimeout with delta time?
 
Yes
 
3:10 AM
thank you
 
what's the best way to get an accurate time delta?
 
Remember the last time of the tick and only run the tick function if N milliseconds have passed
Then increment the time of the last tick by N
 
just using date.now? cos that's not super accurate
 
That's quite accurate
 
I thought you were supposed to use the time passed as a multiplier?
 
3:15 AM
You can use performance.now() if you don't care about shit browsers
 
yeah that's the one i was trying to remember
 
@joshhunt You can, but you don't have to
 
does requestanimationframe also pass in the delta to the callback?
 
oh ok, it would be slightly more accurate if you did though right?
 
No, probably even worse
 
3:17 AM
oh, how come?
 
Because if you evaluate acceleration in different time intervals, you don't get the same speed
 
Yeah it looks like requestAnimationFrame passes in a super accurate timestamp
 
I'm not sure I understanding, this is my current understand, please correct me where I am wrong. For example accelerating at 1 unit per second so normally it would be:
0s= 0
1s = 1
2s = 1 + 1 = 2

with lag, running every 1.2 seconds
0s = 0
1.2s = 1
2.4s = 1 + 1 = 2

with lag, running every 1.2 seconds but using delta time as a multiplier:
0s = 0
1.2s = 1 * 1.2 = 1.2
2.4s = 1.2 + 1 * 1.2 = 2.4
Sorry for the multiple pings
 
Assuming you implement it the way I described, the third tick in the second case will happen at 2s (because you wait less, because you're not off of the original start time)
 
oh I see, so you change the time of the ticks rather than using a multiplier
so the third tick would run after 0.8s instead of 1s
 
3:27 AM
Yes
 
makes sense and sounds much easier, thank you
 
@david how would I do that?
 
@aaron you will need to utilise mathematics
 
crl
!!wiki convex_hull
 
and probably parse the path string to build up the list of points
unpleasantness all around really
 
3:30 AM
@joshhunt For physics simulations the last method is better, because it models real world physics more exact
 
crl
Is there a way to initialize a 2D grid, m rows each one with n elements? or should I initialize each row in a loop?
 
Use array comprehension
 
crl
ES6 right?
 
Yes, or all other sane languages
Not implying that ES6 is sane
 
I think it is more sane than ES4. By the way, comprehension (array and object) has been deferred to ES7 so that ES6 can be finalised earlier.
 
crl
3:43 AM
Hmm I thought we could just add babel as a <script> and code in ES6 :) but no it seems more complicated
 
even if you could it would be better to precompile it rather than incurring the overhead repeatedly
 
@copy ah ok, thanks
 
@crl The browsers are still undecided on how to support ES6, in general. But the spec is being finalised, and implementation is well underway. (Spartan has best ES6 support, but Firefox already has most ES6 in public release, without flags)
 
@KendallFrey !!!
I'm bad at spaceplanes
 
@crl var m=10,n=8,a=Array.from({length:m},()=>new Array(n)) // This is ES6, can run in Firefox now, and is not comprehension.
 
crl
3:58 AM
nice, thanks, reading about Array.from
 
Yes, but ugly. Better define your own util.makeArray or so
 
@copy Don't worry. You will get use to it. As an Delphier I thought Java was ugly. As an Javaer I thought JavaScript was ugly. Now as an JavaScriter... I have learned my lessons =w=
 
You went a path avoiding all the beautiful languages, apparently
 
I won't deny that. I quite love Lisp and Python, But I am too late for salvation. I found myself hand editing minified JS code last year. More than once.
 
Oh god. You were at least drunk, I hope?
 
4:11 AM
@copy I don't drink. Sadly, once you started doing it, you can't go back, as the minified code now become the main source. I wish I was drunk.
Well, at least it is not as hard as it seems. Most functions doesn't have that many variables, so it is not hard to make sense of them.
 
4:24 AM
Oh I finally reach 2k rep!
 
Congratulations!
 
5:22 AM
 
6:05 AM
The "Object Oriented Programming" wikipedia article is a mess...
 
6:38 AM
quick question, has react 0.12 taken away <MessageBox titleMessage={message} /> like notation ?
 
7:08 AM
Hi
I want to load some js/html files in require js format
like
define(['jquery'], function($)
Is it possible using javascript only?
MyApp.loadFiles(['jquery', 'mustache'], function($, m){
       // my code using the above arguments
});
I know how to load files but I don't know how to pass them as arguments in that call back function..
I will ask on SO
0
Q: Pass loaded file variables as arguments to callback function

Mr_GreenIn my new project, I am trying to avoid use of global variables using requirejs. I found that requirejs is using define and require methods to load supporting files. I am planning to write these methods on my own. MyApp.loadFiles(['jquery', 'mustache'], function($, m){ // my code using the ab...

 
are you basically asking "how do I reverse engineer requirejs"?
 
I don't know :|
 
@ivarni I think yes. Or "how do I write requirejs".
 
That sounds awfully broad
 
I just need to load files and pass them as arguments
using such a big plugin for just a method looks not cool to me
 
7:20 AM
considered browserify?
 
@Mr_Green var files = ['jquery', 'mustache']; MyApp.loadFiles( files, function($, m){ /* files variable can be read here */ });
 
I can't use m argument
 
@Mr_Green You lost me there. Please clarify your requiruments.
 
Mustache plugin provides Mustache variable to use.. but I am looking for a way where I can use "m" variable which is passed as argument to the call back function.
am I going in wrong direction?
man.. I am so confused currently :(
 
@Mr_Green Why must you use m?
 
7:33 AM
@Sheepy yeah I think you are right.. I can use $ and Mustache..
no need of using only the passed arguments
 
Good Morning
 
@Mr_Green My pleasure. You may want to delete the question if it is no longer applicable.
 
Hi everyone
 
@Sheepy btw thanks..
I will keep that post just for learning purpose
 
7:53 AM
by keeping Flexslider : slideshow : true & animationLoop : true, on click of Active Thumbnail, next slide is not happening
 
@Sheepy I required the arguments. I need to pass the variable of loaded files as arguments to that call back function
I have a file which holds an anonymous function (as class)
I need to store this anonymous function in a variable and pass it as argument to the call back function
 
mr5
8:35 AM
Hello o/
Does the Image has a property of backgroundRepeat? I can't access it though
Image isn't even a background right?
 
@mr5 yes "Image.style.backgroundRepeat"
for this to work, you need to have background image
 
mr5
Is the image different from the background of Image?
I would like to access it because I'm not entirely sure if the backgroundRepeatY = 'repeat' is default for all browsers.
@Mr_Green
 
@mr5 this property is just used to repeat a background image on X axis (horizontal) or Y axis (Vertical)
 
mr5
Yes. I am really confused if the data of Image is the same or different from Image.style.backgroundImage?
 
8:55 AM
Hey all, noob over here.
 
hi, noob over here.
 
Is it possible with jQuery to get all tables that has <thead>?
I used this to get all the tables right now: $('table');
 
yes, yes it is. What have you tried?
 
With $('table') I get all the tables, what I was thinking is to iterate through that array and leave out those that doesn't have thead. Wondering if I can do this in jQuery for free (without a loop)
 
well, there'll be a loop behind the scenes
but yes, you're looking for filter
 
8:57 AM
Ah, ok.
 
Ah ok, thanks.
 
@EnricoSusatyo jquery is just a javascript library. It doesn't do magic.
 
Hmm, gonna try something like this: $('table').filter('thead'). Thanks.
Yeah, I do realise it's not magic haha.
I just assume that their way of iterating through the DOM is somehow faster than my manual method. Am I wrong with this assumption?
 
mr5
It does...to us noobs
 
8:59 AM
@EnricoSusatyo haven't seen your way, so can't tell. But it's very easy to be faster than jquery.
here's jquery way to do the filter: james.padolsey.com/jquery/#v=1.10.2&fn=jQuery.filter
it's, uh, magic.
 
dark magic
 
Morning!
 
I just hate its usage of ternaries.
 
Ow, interesting.
My way was checking if .getElementsByTagName('thead'); is not null.
 
Is there a way to search in request responses from Chrome dev tools (Network tab)?
 
9:01 AM
(or empty or something)
 
but anyway it ends up reusing sizzle... all hail overhead
@EnricoSusatyo way faster than jquery, then.
 
Ha!
Thanks a lot, today I learn.
 
@IonicăBizău you can filter on the request uri
 
I know, but I want to search a pattern in all responses.
 
well, I'm building something for this kind of stuff. Nothing usable yet though.
I mean, it's not this use case, but it'd be easily implemented.
 
9:03 AM
I need it now! I think I found a new GitHub vulnerability. :-)
 
then use something like wireshark
 
charles > wireshark imo
 
doesn't look free
 
True... Even Wikipedia claims it is.
 
it has free version, but closes every 30min.
 
9:16 AM
But how can it be useful to me? I have a Virtual Box with Windows where I could install and run it.
 
Mornin lads.
 
morning
 
Good morning.
 
0
Q: Pass loaded file variables as arguments to callback function

Mr_GreenIn my new project, I am trying to avoid use of global variables using requirejs. I found that requirejs is using define and require methods to load supporting files. I am planning to write these methods on my own. MyApp.loadFiles(['jquery', 'mustache'], function($, m){ // my code using the ab...

 
9:55 AM
Yay two random downvotes :D
yesterday, by Benjamin Gruenbaum
Improved exception messages: Goodbye "undefined is not a function". Hello "http://foo.bar is not a function" http://t.co/3uykfrTK9O
 
@BenjaminGruenbaum Doesn't matter. Got a star <3
 
I got 5 :D
 
@BenjaminGruenbaum Don't care. Got a start <3
 
@darkyen00 wow looks good. lemme see the code, been playing a bit yesterday.
 
;-)
 
9:58 AM
@SecondRikudo OMG OMG OMGG!!!
 
@AwalGarg I'M IN SPACEE!!!!!!
 
DID YOU SEE THE CODE FORMATTING!!!!!!!!!!!!!!!1
WOOOOOOOOOOOOOOOOOOOOO
 
@BenjaminGruenbaum Am I still sleepy (well, I am, it's rhetorical, nvm) or is there a http:// that shouldn't be there ?
 
@dystroy maybe twitter thought foo.bar is a url and added the http?
 
@dystroy I'm not sure what you're asking
 
9:59 AM
@BenjaminGruenbaum "http://foo.bar is not a function"
 
@AwalGarg you're using firefox anyway, firefox has been doing this for a year now ;0
 

« first day (1591 days earlier)      last day (3372 days later) »