« first day (1557 days earlier)      last day (3377 days later) » 

9:00 PM
Just tuned in: (to the podcast)
 
@MikeNolan awesome
 
> Are we going to kill a prostitute live?
 
user1596138
They didn't say who's on
 
@BenjaminGruenbaum not really the case, im looking for any high level thoughts. Ofcourse a basic orderBy in plunker will work, I am basically doubting ability to reproduce it properly
 
9:01 PM
@rodling we can't help you with problems we can't understand or reproduce :D
 
user1596138
Watch swastika guy troll their room or something
 
@BenjaminGruenbaum understandable, but any high levels ideas what could be overriding or something?
 
user4330208
I ask a question on 4Chan the responses are better than the highest voted ones on SO, wtf
 
@carb0nshel1 just for the record, I won't be patient with you
 
Then you should probably take their responses, clean up the formatting for SO, and post them (with attribution).
 
user4330208
9:05 PM
That actually happened to me!
 
user4330208
Its not trolling if its true right.
 
depends on the phrasing.
 
@BenjaminGruenbaum problem was, I changed array to object at some point
 
!!slidepoop
 
Mar 13 '13 at 1:40, by rlemon
(Random Fact, when rlemon was 13 he pooped on a slide. he isn't proud of it, but he felt it was time to confess. I'm sorry slide.)
 
9:11 PM
Morning
 
user4330208
Why apologize to the slide and not his poop
 
hi
 
I just made Joel Spolsky read slidepoop - my work here is complete.
2
 
does sublime text have a command for taggle folding ?
 
!!urban taggle
 
9:12 PM
@monners Taggle Verb - the act of running and tackling someone in a massive, joyous hug. A combination of the words "Tackle" and "Huggle". Best performed from behind on an unsuspecting hug-victim.
 
ctrl+shif+[ == fold
ctl+shift+[ == unfold
 
surprise folding of your code?
 
? == toggleFold
 
Aggressively friendly code folding?
 
@CapricaSix that was a typo
@monners yes :)
 
9:13 PM
"Hey man, let me fold that function for you..." "No, I'm working on..." "Look at that, way smaller, totally out of the way. Np brah."
 
user4330208
@amin sometimes this room is worse than 4Chan man
 
@carb0nshel1 We are 4Chan!
 
user4330208
@monners I only left 4Chan for SO to check it out. Not impressed.
 
don't tell him that, he could be the FBI
 
@carb0nshel1 I apologise on behalf of the entire community for not living up to your expectations
 
9:15 PM
lol, reading over the front end dev job requirements at my work, I don't do any of these things:
> Develop user interface concepts using flow charts, wire frames, rapid prototyping and user tests.
 
@monners me too
 
@BenjaminGruenbaum I don't remember if I've asked you this already
 
@NickDugger That sounds like more of a designer requirement
 
But is there a way of using Promise.coroutine() in a class method?
 
Yeah, I'm thinking maybe the job description is scaring away real developers
 
9:16 PM
Constructor.prototype.method = Promise.coroutine(function* () {... });
Possible in a class? ^
 
@NickDugger I read a really interesting article a while back about how job descriptions influence the quality of the candidates you attract (such as how using the term ninja scares away people who you might actually consider one)
I'll see if I can find it for ya
 
Yeah, there's a term for people thinking certain things are common knowledge
 
@monners That's why mgmt/HR should never write the job description or requirements
 
I'm not sure if HR wrote it, or my boss. I'll bring it to his attention, though
 
Let the people doing that work explain it. They know what it is and what the terminology is.
If someone can't understand what they mean, then don't hire them
 
9:18 PM
@ssube I'd say Duh, but it happens ALL THE TIME
 
@SecondRikudo bluebird's docs say yes: github.com/petkaantonov/bluebird/blob/master/…
 
@monners Oh, I know, don't worry.
 
@ssube Our CTO writes our tech job descriptions
</worrying>
 
@Luggage I don't think you understand :P
 
It's a pretty safe assumption that in your average venture-capital-based tech firm, the CTO doesn't know which way a paren goes.
 
9:19 PM
ok, then.
 
Promise.coroutine returns a function, right?
 
@SecondRikudo not without annotations so not yet. You can assign a generator and loop the prototype properties or use an async function and turn on the "bluebird coroutine" flag in 6to5.
 
@ssube I guess it's fortunate that I don't work for a venture-capital-based tech firm then :P
 
@BenjaminGruenbaum First is too magical, second is too volatile XD
I'll live without generators for now, it's a small method anyway.
 
@SecondRikudo Never give up. Never surrender! - Commander Peter Quincy Taggart
 
9:22 PM
@monners Or was it Leonidas from 300?
 
@SecondRikudo It was not.
 
Dat feeling when you refactor all _.extend to Object.assign and get rid of lodash as a dependency :3
 
It was Commander Peter Quincy Taggart from Galaxy Quest
 
user4330208
Leonidas was like "Tonight we're all going to be burning in hell!" army - "YEAHH!!!"
 
@SecondRikudo All Leonidas said was "ripple ripple ripple." Although that may have been his abs talking, I'm unclear on the details.
 
9:23 PM
> XHTML
yeah... needs to be fixed
dat job description
 
user4330208
Alright friends, I'm off. Its been a blast but I actually have some work to do. Same time tomorrow?
 
user4330208
everyone must be afk. Its cool.
 
wat
 
Hi folks.. I'm taking a look at React-Router and this is the exports file. I realy don't understand what it means. Does it have something to do with RequireJs?
People
 
@AndréPena more like browserify/webpack
It's node's module system - it's exporting a lot of stuff.
 
9:29 PM
check out commonjs @AndréPena
 
so.. are browsety, webpack and commonJs simmilar in a way?
 
cleanAmazonDescriptions.forEach(el => {
    //See if any of the amazon descriptions is found in
    if (item.originalEbay.description.indexOf(el) !== -1) {
        return true;
    }
    //See if the eBay description is found in the amazon one.
    if (item.originalEbay.productDescription && el.contains(item.originalEbay.productDescription
            .substr(0, 200)
            .replace(/(\s+\w+$|[A-Z0-9]{10})/, '')
    )) {
        return true;
    }
});
return false;
 
I'll check this out, thanks
 
I am such a fucking genius -_-
 
check out all 3 :P
browserify lets you use commonjs module in the browser
 
9:30 PM
This is what happens when you don't test properly kids. This ^^^ ends up in production
 
@SecondRikudo Array.prototype.some
 
@FlorianMargaine Yeah now I'm seeing it :P
This was in production for... what... 3 months now? XD
 
heh they use webpack, man webpack seems to be picking up traction lately eh?
 
haven't used it yet...
 
Good thing I'm refactoring this XD
@FlorianMargaine Actually .some (or rather, in this case .every) is perfect
Not sure why I chose to use forEach there in the first place
 
9:31 PM
@lo
@Loktar I'll do it.. Thanks!
 
@SecondRikudo you want .some, not .every
unless I misread
I often do
 
@FlorianMargaine No, you're right
.some for this one. .every for the other place I made this golden error
 
@BenjaminGruenbaum algo question.
 
I have X elements. X being <500. I need to generate random, unique strings for each element. I need each element to have the same number of characters, the smallest number of characters possible
actually, scrap off the "random" part.
I don't really know how to go at it...
 
9:35 PM
What a scam - Hold up, so you’re asking people to complete a task that would likely cost any client tens of thousands of dollars to commission from a legitimate dev shop for the chance to win a $2000 laptop? Good luck with that.
 
I'll maybe participate
 
@monners Oh yeah, those work
 
Evening. Guys how can one use object defined this way gist.github.com/jeserkin/45a4a17721403a3073ba? I've tried to create new object instance from thay, but was unable to.
 
@monners not to mention 2 of the judges wear tights!
 
9:37 PM
@Eugene Unable to how?
 
the task is too daunting
 
new someObject() should work.
 
but I'd participate in this kind of stuff tbh.
 
@monners one of the judges is from atlassian, so you just need to write a program that will OOM and crash
if it can do that sporadically and prevent itself from being restarted, they'll probably hire you and start selling it
 
9:40 PM
@BenjaminGruenbaum ?
 
Sorry, listened to the podcast
 
Okay. Sorry. Some odd glitch. I thought, that it should work as well. I've been getting some error, but now it is gone.
 
@FlorianMargaine generate them sequentially?
Just give each of them a different number between 0 and 500?
 
@BenjaminGruenbaum the elements need to have the same numbers of characters
 
001, 002, 003, 004 ...
 
9:41 PM
@FlorianMargaine pad them
 
the minimum number of characters
and it's using 26 letters
which means... if < 27, one letter. If < 26*26, 2 letters
is that it?
26*26 seems big
676
 
Is there any difference in those two examples? gist.github.com/jeserkin/45a4a17721403a3073ba and gist.github.com/jeserkin/c5c53b7576629d8c6e04. I'm talking about the way the constructor is defined. One prefered more? Why?
 
@FlorianMargaine you said you wanted all of them to be the same length
 
@ssube yes
and the minimum length
 
@FlorianMargaine 500 in base 26 is J6 (apparently), so two chars is your minimum.
 
9:44 PM
@FlorianMargaine So yeah, that would be aa..zz
 
@ssube yeah... let's say the maximum is 10000
sorry about that
 
(replace the 6 with the appropriate number)
 
Although, you'll have to iterate while(arr.length > Math.pow(26, i++)
 
@ssube I meant, it can be 24 elements
 
You're using all 26 english letters (of some case) as the label?
 
9:44 PM
when I said "500 is the maximum"
 
why recursive?
 
@ssube yeah
I can have 10 elements as well as 400 as well a 1000
I need to find an algorithm to find the correct permutations
 
@FlorianMargaine let i = 1; while(arr.length > Math.pow(26, i) { i++; }
After this, i determines the number of characters you need
 
user1596138
Podcast is boring af
 
After you know that, it's a matter of a recursive function to generate the strings sequentially.
 
9:46 PM
damn edit
why recursive?
 
dem star wars games gog.com/…
 
In case of 3 characters, you want 'aaa', 'aab', 'aac' .... 'aba', 'abb', 'abc', ..... 'baa', 'bab' etc
@ssube Because each extra character is an extra "level"
 
anyone?
 
@SecondRikudo thanks, that seems to work
then I just generate sequentially
 
Although @FlorianMargaine, you can actually do it pretty easily otherwise
 
9:48 PM
?
 
@SecondRikudo but you know the character set and the max length, you don't need to recurse after that
 
Just generate numbers sequentially and .toString(26)
Or rather, 36 even.
 
@FlorianMargaine not that big
qhttp://chat.stackexchange.com/rooms/512/se-podcast
 
won't that include numbers?
 
@FlorianMargaine It would, yes, is that undesirable?
 
9:49 PM
yeah, it will.
unless I start at 36
 
@FlorianMargaine Even if you start at 36
 
@SecondRikudo yes
 
!!> (38).toString(36)
 
@SecondRikudo "SyntaxError: identifier starts immediately after numeric literal"
@SecondRikudo "12"
 
You'll have to add 10 to each digit place XD
 
9:50 PM
function createIdGenerator(base) { let i = 1; while(arr.length > Math.pow(26, i)) { i++; }; var last = 0; return function () { return (last++).toString(base).pad(somehow); } }?
 
If you don't care for numbers, toFixed(36) is perfect.
 
I do, sorry :P
 
@ssube i is unused.
 
@SecondRikudo yeah, that's the padding part, which I'm not sure about.
You need to pad with the 0 digit, whatever that is (a?)
 
@ssube I don't think you can avoid recursion in this one
You are, in effect, generating a tree.
Instead of putting the tree in a multidimensional array, you put it in a string as characters
@FlorianMargaine in that case, I think that .toFixed(26) and doing a single array replacement is still cheaper and easier.
 
9:52 PM
single array replacement?
 
function createIdGenerator(base, arr) { var i = 1; while(arr.length > Math.pow(base, i)) { i++; }; var last = 0; return function () { var ret = (last++).toString(base); while (ret.length < i) { ret = "a" + ret; } return ret; } }
 
Replace [1, 2, 3, ... o, p] with [a, b, c, ...., y, z]
Ah JS doesn't support that
Well, a simple reduce would do it
 
yeah, that totally works, except you need to swap numbers for letters
 
@ssube Yup
 
and you can easily pack it up into an iterator
(if you use such devil magic)
 
10:02 PM
@FlorianMargaine jsfiddle.net/ffok6r2a
 
thanks
now let's transform that in lisp
 
XD
@FlorianMargaine don't make the same mistake I did, the array must be reversed
 
meh
looks ugly
 
(Otherwise, you replace 0 with a, then a with k, then k with u :P)
And also I'm guessing there's a better string padding function in list
So use that instead of the horrible ternary
 
dammit, got a loop wrong and froze the repl
 
10:05 PM
hahaha
 
cause that tab is totally frozen now :|
 
@ssube Chrome?
 
yeah
 
Try to find the offending process and kill it
Although an infinite loop shouldn't freeze the thread AFAIK
 
that works, but it was the tab, which is now gone with the words.
 
10:07 PM
heh
sounds like I found an interesting challenge :P
 
@ssube lol
 
That's the closest I could get, though. Specify the "zero" character, increment that (and a base N counter) to generate a lookup table of numeric-free digits.
Use that and @SecondRikudo's logic to get the length, use a counter, base N, pad with the zero character, ...
 
Oh yeah, an object would probably be easier
 
It should work, although it won't be particularly optimal.
 
id = 0;
function uniqId() {
	return id + 1;
}  //elite code
 
10:09 PM
will always return 1
 
it's a unique id, all the other ids (2, 3, 4, ...) are different
 
@FlorianMargaine my solution is solid
 
no, look at his code
he doesn't increment id
 
@FlorianMargaine it's unique in the same fashion that 4 is perfectly random
 
lol
 
10:11 PM
@ssube ah, didn't notice your sarcasm. Sorry.
 
@FlorianMargaine not entirely sarcasm. I suck at Javascript. That'd be my horrible solution if Google didn't exist
 
Anyone here use node? I have an interesting node issue.
 
@essefbx 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.
 
@taco you'd quickly find out that your solution wouldn't work
 
speaking of which, just created my first protractor/selenium tests and they're passing! Woo!
 
10:14 PM
function isTrue() {
    return true;
}
expect(isTrue()).toBe(true); // It works!
Pro testing
 
never even heard of protractor/selenium before yesterday
what do you guys think of it for e2e?
 
@taco selenium is nice
e2e is not
Make sure you don't have too many of those
unit tests should be the tests you have the most of.
 
okay, sure
Right now, it's just 5 tests making sure the front end is receiving data from the backend
 
I mean, e2e tests need to be changed on every single change throughout the entire app
 
well, doing some navigation to pages, but besides that
 
10:16 PM
unit tests only change if their subject's requirements change
 
What do you use for unit testing in javascript? @SecondRikudo
 
@taco mocha
For cross browser testing, karma (in conjunction with mocha)
 
okay, cool. I saw that mentioned in the protractor.conf.js in another project
I'll look into it. Thanks
 
karma is incredible
It allows you to run tests in all browsers at once
All async with websockets :D
 
@SecondRikudo ok, cool. I see Karma mentioned in this ng-book I've been reading
 
10:19 PM
Fun fact: It used to be called Testacular
 
Glad you liked the videos
Also works with browserstack
 
@BenjaminGruenbaum Oh yeah, I used Mocha before seeing James' series
But Karma was new to me.
@BenjaminGruenbaum You know him?
 
It's very fun
No, I don't - just the videos
Was on kickstarter
 
link to the videos?
 
10:21 PM
thanks
 
@BenjaminGruenbaum Yeah, can't remember if I backed him from since then, or joined later
Regardless, even though he does things I don't agree with
(committing your .idea folder into source control?!?!?!?!?!)
I learned a lot from him
 
@SecondRikudo do you commit your module folders to source control?
 
@taco No.
 
I've heard arguments for/against
does it really matter?
I can see why you might
 
We do if we're playing with pre-1.0 release stuff
So that a fresh install has less of a chance to break the chain if one of the experimental modules' APIs changes
 
10:37 PM
We were using the angular-seed @0.11 template in December, and it got unpublished. It's officially only on bower. Somebody ended up publishing angular-seed @0.12 eventually
Any opinions on Jasmine vs Mocha?
 
176
A: Should I check in node_modules to git when creating a node.js app on Heroku?

Kostia::UPDATE:: The source listed for the below recommendation has been updated. They are no longer recommending the node_modules folder be committed. Usually, no. Allow npm to resolve dependencies for your packages. For packages you deploy, such as websites and apps, you should use npm s...

 
@FlorianMargaine gracias
npm shrinkwrap ... this just gets deeper and deeper
 
why would new RegExp('^\s*', 'gm') behave differently to /^\s*/gm
 
string escaping
 
fuck me
4
\\?
 
10:43 PM
double escape
 
new RegExp('^\\s*', 'gm')
 
@phenomnomnominal if you have to use strings, but use regex literals
 
@SterlingArcher, @phenomnomnominal wants you to fuck him
 
11:06 PM
Does this naming convention look okay?
mocha test/unit/test.js
cya guys!
 
@taco yes - though one convention I've seen is to name it test.unit.js
 
heh
haven't seen that one.
 
11:22 PM
@KendallFrey I don't want to use just literals because I'd rather have them named by things which describe what they are, but also don't want to fuck around with resetting /g-ness
 
wat
So you do stuff like new Number(42) and new Boolean(true)?
 
bah, you guys why am I so bad at JS?
 
not enough practice
you must practice until your fingertips bleed
 
@KendallFrey no, but I might do doSomething(NUMBER_THAT_MEANS_SOMETHING)
 
Then I might be confused by what "have them named by things which describe what they are" means
 
11:37 PM
anyone have any tips on good database structure ?
 
Yes, it's called normalization
Database normalization is the process of organizing the fields and tables of a relational database to minimize redundancy. Normalization usually involves dividing large tables into smaller (and less redundant) tables and defining relationships between them. The objective is to isolate data so that additions, deletions, and modifications of a field can be made in just one table and then propagated through the rest of the database using the defined relationships. Edgar F. Codd, the inventor of the relational model, introduced the concept of normalization and what we now know as the First Normal Form...
 
@KendallFrey thanks! will check it out
first time dabbling in database design
 
Short version of normalization: all attributes of a row should depend on the key, the whole key, and nothing but the key, so help me Codd.
 
lol
primary keys?
 
yeah
 
11:41 PM
does a course in database fundamentals cover this?
i see it on lynda.com
 
@KendallFrey Well I would prefer to have var DESCRIPTION_OF_REGEX = /myRegex/g; doSomething(DESCRIPTION_OF_REGEX);, But it's global and things are dumb, so I tend to do var DESCRIPTION_OF_REGEX = 'myRegex'; doSomething(new RegExp(DESCRIPTION_OF_REGEX, 'g'));
 
A good one will
@phenomnomnominal yech
 
Yeah, though it's not all that complicated of a concept, I think, if you can get past the technical jargon.
 
I know of very few use cases where you'd even want a regex in more than one place.
 
@KendallFrey do you think this is a course worth watching?
 
11:42 PM
I have no idea
Access? Get yourself a decent DBMS
 
It's not that I want them in more than one place, it's that I want them to not be inline as a block of regex-y shit that people can't read
 
so comment
Which is easier to read, a complicated regex that you can see, or a regex that you can't see?
 
@KendallFrey Couldn't that be rephrased as "which is easier to read, a complicated regex, or a well named variable that describes what the regex does?"
 
@Retsam Couldn't that be rephrased as "which is easier to read, a complicated regex, or a complicated regex in an arbitrary language?"
Variable names aren't supposed to have the same expressive power as their contents. If they did, they would be rendered redundant.
 
I dunno, what do you think str.match(EMAIL_REGEX) does, if you had to guess?
 
11:53 PM
It checks a string against some unknown, very probably substandard regex for matching emails.
 
What does the fact that it's in a variable make it "sub-standard"?
 
it doesn't
 
buh... what's the way to make an object that has some sort of initialization action when instantiated?
 
it merely hides the substandardness
@corvid google "constructor function"
 
It could, but then any variable constant could hide mistakes. var SECONDS_IN_MINUTE = 42
 
11:56 PM
Indeed
 
But I find str.match(EMAIL_REGEX) a ton more readable than str.match(/\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/).
 
What about:
 
Sure, if you want to validate the correctness of that code, you need to look at the contents of the regex. But often times, I don't want to validate code, I just want to understand it.
 
// search for emails
var result = str.match(/\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/);
This code will be easier to find the many bugs in, as you don't have to look up the definition
 
That's fine too, I've semi-jokingly said a regex without a comment should be a parse error
 
11:59 PM
Fun fact: You can put comments in regexes.
 
But actually, I'd argue that variable version is more maintainable. Find a bug with email matching? Much easier to just modify var EMAIL_REGEX sitting at the top of the file than it is to dig through the file and find the relevant .match
 

« first day (1557 days earlier)      last day (3377 days later) »