« first day (1595 days earlier)      last day (3356 days later) » 

12:00 PM
@Vlad For general testing, maybe tddjs.com
 
At least I could watch gifs without closed source plugins...
 
@Vlad disclaimer: I haven't read the book but I know the author has solid knowledge of testing
 
525 pages
Should I spend two months reading it? :)
 
Why would Jasmine-node not show then names of the tests run?
 
I mean can I learn testing by just practicing?
 
12:03 PM
@Vlad IMHO yes
Testing is difficult, I think the best way to get good at it is to get your hands dirty and write tests
But a book might help you avoid the most common pitfalls
 
Yup, true
 
@darkyen00 yes, ready to get started.
 
When do I need to write tests for my code? When my app has tousands of lines of code?
 
@Vlad that's a subject with a lot of opinions. Some write the test first, some prefer writing it after the code is done
 
12:06 PM
What if I build a JS/HMTL5 game which is rather simple? Do I test my code?
 
Personally I do both, depending on what I'm coding
 
@darkyen00 I don't understand some of the end points, I will add them as comments in a while.
 
@AwalGarg
good
 
True. Depends on what you want to achieve
 
@Vlad I'd probably test any game logic or rules. If you're making say a minesweeper game have some tests around failure/win conditions
 
12:09 PM
Yup, reading the book you mentioned is a nesessity
 
You don't want to end up with a test-suite that breaks everytime you move a button around
 
How to trigger an event in javascript (a fake dom event) ?
 
@darkyen00 What's with the renaming?
 
too many with same name
 
@darkyen00 createEvent?
 
12:11 PM
Ok. How do I write a function that checks if a nimber is prime from 1 to 10?
Should My function check if a number has decimal places after a comma?
1.2 is it prime?
Maybe this is aquestion for maths
 
@Vlad [2,3,5,7].indexOf(num) !== -1
 
lol
 
@Vlad Have a look at javascripter.net/faq/numberisprime.htm for some implementations
 
yup
 
it's a non-trivial problem tbh
 
12:13 PM
what @KendallFrey said
 
@Vlad the best way is to write code that will generate code for you, then eval the generated code. A generic function ;-)
xD
 
and if you need up to 100 you use the same style
 
if you need a general prime test, just test 2 and all odd numbers less than it to see if they divide evenly
 
No I have a function in the style Kendall mentioned.
But I want my function to be fault proof for other cases
 
see above
 
12:15 PM
Let just say I send this param to my func
isPrime(1.2)
 
do that, then figure out how to optimize it
I purposely left something out
 
or isPrime(9.53)
And yes I know it is non trivial problem, for finding general solution
 
English speaking people please enlighten me : is # called pound, sharp or otherwise ?
 
depends on context
the most common is probably a number sign
then hash or maybe pound
the sharp is another Unicode character, but we use ASCII # for simplicity
I think there's also something called an octothorpe that looks like that
 
I asked mathematicians, Primes are by definition positive integers
Good to know
 
12:21 PM
"natural numbers"
 
You asked "mathematicians" ? Why not just read the first 2 lines of a google search page (no need to open any link)?
 
Also note, "mathematicians"
How many mathematicians does it take to tell you that?
 
A positive integer number of them
 
u argue for one letter
 
12:28 PM
@Vlad use what I just tested there, you will need an integer in the function
 
you may become better programmers if you note such details, a missed letter :)
 
positive one
 
> Our business model is founded on providing end-to-end automation along with an amazing user experience for our customers. To this end we emphasize a safe, maintainable code base that can be refactored quickly and easily in order to optimize daily operations. With this in mind we’ve made the switch from NodeJS to Haskell for almost all new software development.
(emphasis mine)
/cc @BenjaminGruenbaum
it's happening!
 
This paragraph would be better with less introductory BS
Who's switching from node to haskell ?
 
@dystroy CircuitHub
 
12:32 PM
@BartekBanachewicz lol, what a bunch of retards :D
 
I will be doing a bit of haskell next month :D
and prolog
 
> they think different from me, they must be retards
@AwalGarg oh cool. Make sure to share experiences
 
Not at all.
 
yup
 
beh, safe refactoring is such a strong point, if only there was more tooling to take advantage of that
I wish JetBrains made a Haskell ide
 
12:36 PM
When they will, I would no longer call those guys retards
 
ohhm also has anyone used Upsource?
 
Why the heck would CircuitHub use JS in the first place? That sounds insane to me.
It makes absolutely no sense for their use case.
 
good evening
 
@Zirak It was so bad it made me want to tell other people not to read it
 
@BenjaminGruenbaum because they're retards?
 
12:49 PM
Probably
They did switch to Haskell after all. So yeah
 
> haskell is esoteric no one uses it
> oh look they use it retards
 
hi guys
I am trying to open a window in javascript using" window.open(url)" but when the window pops up there is nothing there and my page just hangs like I mentioned in the image
guys as soon as I hit get drawing code button this blank window opens, it was supposed to show content, well sometimes it shows contents but sometimes it opens up blank like this one
 
@Zawinski do not post the same question in multiple chat rooms.
 
k
 
1:05 PM
@BenjaminGruenbaum they're kinda expensive for just a a few prototypes
 
Too often must I do sudo pkill chromium...
 
@BartekBanachewicz lol, your logic is so retarded it's offensive. I have stated multiple times that I do in fact myself use haskell in production. I just said they are retards for using it.
 
Their process supervision is still lacking
 
@dystroy sudo?
and, uh, I don't remember killing chromium this way...
 
1:06 PM
How do you kill it when it's unresponsive due to some JS loop ?
 
well, last time I did was when working on erinome because I used native messaging... and it's sensitive
@dystroy only the tab dies
 
When it's in a loop, I can't change tab, I can quit it using the GUI
(both on Ubuntu 14.04 and 14.10)
 
(two different computers)
 
1:07 PM
I'm on 14.10 and I can change the tab and kill it
 
@dystroy Ctrl+Alt+F1 -> (login)? -> killall -9
 
ctrl-alt-f1 doesn't even work on my computer (seems to be a problem with the graphics driver). But... killall ?
 
@dystroy yeah, forgot (cause i don't kill chrome), maybe: F12 (yakuake/guake) -> top -> enter (and optional 9)
@BenjaminGruenbaum oshpark.com is nice also
 
1:24 PM
I like it
 
I made it
I am kerbal jesus
 
@dystroy killall is an alias of pkill... but a dangerous one.
mostly because on other *nixes, it literally kills all the processes.
 
user image
3
 
That's not a problem. Jetpacks.
 
or just pray to kerbal jesus for the power of levitation
For those of whom chose "Strictly javascript" in the gamejam poll, can you please state your reason? I'm trying to finalize the rules, and it would help.
2
 
1:33 PM
@rlemon not needed. Gravity is low on your mum.
 
thanks for pinning
 
@NickDugger I just figured I wouldn't want to have to pick a language myself
 
@KendallFrey Is that a serious answer? lol
 
@NickDugger "js room" game jam should be in "js" imo
if we were in the c# room I'd say c#
I can assume everyone knows js so we can all pick at eachothers submissions
 
@rlemon I'm on the fence. I agree, we're in room 17, but I don't want to exclude people.
 
1:37 PM
if you did it in R I wouldn't be able to read yours
 
@NickDugger Because we've all seen 50 meter dash in the olympic games.. not terribly interesting
Now if they had a shark pool they had to jump over, or some lazer beams, that would be interesting
 
Hey guys. Whats up. Should I write comments in my Jasmine tests and then generate Yuidocs ?
 
@copy Hi
 
@rlemon We're very liberal with the rules and just want to have fun, right?
 
ASR
Hi all I am getting Failed to load resource: net::ERR_NAME_NOT_RESOLVED error in chrome I have given correct path for the jquery.js file but its not coming
 
1:42 PM
@copy sure, but I still think one language we all know would be a good idea
 
@rlemon I probably want to join with a non-JS language
 
@copy get with the times! js is the one and true language now!
 
> I have given correct path for the jquery.js file but its not coming
out of context quotes ftw
 
@darkyen00 lol... but one day too early :-) Tomorrow is my birthday (28.)
 
@jAndy you're gonna be 39 or something right?
:P
slightly more than the real age so that it's offensive... :D
@Jonathan read a basic JS tutorial
 
1:55 PM
@FlorianMargaine almost :-P
 
namely, those mentioning "prototype"
 
@Jonathan it's annoying when you delete your messages to avoid being seen as a noob.
(which you clearly are)
 
Don't worry, Jon, I'm a noob too
 
What does this code do? function e(str){return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");} (pretty confusing isn't it)
 
2:05 PM
@Charly What do you think it does?
 
Is a touchmove always fired before a touchend, or can a touchend include the last movement of a frame?
 
@Charly rename the function e to escape and it becomes a lot less confusing
 
I... I'm not sure...
 
@Charly It's a poorly named function that does some regex
 
what does the regex do?
 
2:06 PM
and it escapes all the characters that are used in regexes
 
@Charly Have you tested in in some online regex explanation tool?
 
wait wait ok i get it
im also a noob...
 
2:17 PM
@rlemon this standing up thing is straightening out my spine in alarming ways. I had no idea my back was as used to being hunched over as it is
 
I'm sitting today
feel like turds. was getting dizzy standing
probably should go home
 
Probably... It is a friday
 
oooh it's friday
 
I never like taking sick days on monday or friday
 
2:19 PM
friday !
 
I feel like others would assume i'm just after a long weekend
 
@FlorianMargaine OMFG I totally forgot it was friday!
 
@rlemon "the others" probably get sick sometimes too... lol
 
@jAndy what's the english word for food like peas?
it's not veggies, it's...
 
lagumes?
wait
Legume
I think
 
2:21 PM
yea
Legume sounds legit
 
isn't that vegetables?
for example, what's a potato?
 
> A legume is a plant in the family Fabaceae, or the fruit or seed of such a plant. Legumes are grown agriculturally, primarily for their food grain seed, for livestock forage and silage, and as soil-enhancing green manure.
 
a pea is a vegetable in fact
 
Potatoes are a starch, whatever that means
 
legume is just a more precise definition
 
2:23 PM
It's probably a family, under the class of whatever
Nevermind, it's under the family
> Kingdom: Plantae
(unranked): Angiosperms
(unranked): Eudicots
(unranked): Rosids
Order: Fabales
Family: Fabaceae
 
Angiosperms actually
that doesnt sound wrong at all
 
It makes sense. The food is the seed, or something
 
@Zirak var evt = document.createEvent('TouchEvent'); fails in jsh
but works in browser.
 
@FlorianMargaine It was a stupid question, which I realised after asking it. But thanks for being so friendly and complimentary.
 
you're welcome
 
2:40 PM
v8, you are wondeful \o/
function isInternalCall() {

    var original = Error.prepareStackTrace;
    Error.prepareStackTrace = function(error, frames) {

        // Restore stack trace handler
        Error.prepareStackTrace = original;

        // Check the third stack frames filename (we ignore the first two, these are always in this file)
        // If it does not begin with a / it is a node.js internal module
        return frames[2].getFileName().substring(0, 1) !== '/';

    };

    return new Error().stack;

}
Such wonderful witchcraft
 
Hahaha
 
But hey, now I can mock Date.now() without blowing up Node.js internal timers
because these still get the real value
 
@IvoWetzel yay
 
What would be more appropriate, using socket or ajax for fetching something from the server with interval of N seconds where N is random between [3, 7]?. Im fetching last 3 documents from mongo collection.
 
@Srle Polling? probably websockets would be better
 
2:49 PM
@IvoWetzel You can also use captureStackTrace for voodoo, there's also a parameter for how many lines there are to remember
 
But only if you think you're going to be polling for long periods of time
 
@Neil, constantly i will ask server (lets say every 5 seconds) to see last 3 documents in collection
 
@Srle Why do you want to ask the server instead of the server pushing it when something new has arrived?
 
@Srle Yeah, then use websockets. Ajax requests is just two steps away from refreshing the page every n seconds
 
@BenjaminGruenbaum Yeah I've seen that in the docs :) (code.google.com/p/v8-wiki/wiki/JavaScriptStackTraceApi)
 
2:51 PM
@PeeHaa, yes you are right server will emit something when there is something new
 
@Srle WS is the way to go
 
@Srle Then it might be better to simply broadcast a message that something new has been added
If you think this might be often, then make the server wait 3-7 seconds after something has been added before broadcasting
Use websockets though just the same
 
@IvoWetzel bluebird uses it extensively to stitch stack traces
 
I see :)
 
2:55 PM
I have a question regarding React, presently I am doing the ajax request inside ComponentDidMount, but when I receive a 202 , how do I call that again ?
 
I'm also using similar magic in my testing black box testing framework to get useful error locations for failing tests
(I hope to get it open sourced soon (tm))
 

« first day (1595 days earlier)      last day (3356 days later) »