« first day (2243 days earlier)      last day (2699 days later) » 

2:02 PM
no one cares about GOOGLE ? :|
 
you can probably get something like stream results -> transform to text -> write to PDF
 
@elsololobo I would like an easy way to parse that sentence to be honest
 
@elsololobo what exactly are you trying to do?
Create a table displaying results?
 
html -> pdf can be done with phantom.js
 
clientRequest -> mysql query result -> generate PDF -> send as email
started trying it with pdfkit now?
 
2:04 PM
yea. you know all the steps except the generate pdf, right?
 
morning everyone
 
Afternoon
 
hey guys
 
and girls
 
2:09 PM
and birds
 
And apache helicopters.
 
AND MY AXE.
 
and goto guys
 
Helicopters aren't welcome here, you know that.
 
@Luggage I'll let tumblr know.
 
2:10 PM
ohh, that's a native american helicopter. I've made a huge mistake.
 
https://www.reddit.com/r/AskReddit/comments/5go2na/people_of_r‌​eddit_what_has_made_you_stop_having/dau3rp9/
 
@Luggage it's just a bunch of canoe oars ducktaped to a zamboni
 
speaking of which, how IS your mom?
 
idk, ask @SterlingArcher
 
user3119231
meanwhile in australia: youtube.com/watch?v=ciDAfhhSgns
 
2:23 PM
Didn't @mentions used to be links to user profiles? O__o
 
no
 
Well then, go on
 
omg.... @SterlingArcher you wanna be the biggest douche at the gym? and I know you do 😛 justsaiyan.co
 
I doubt he needs to dress up to reach that goal
 
he's got a collection of so lame they're kinda funny muscle shirts.
I like to tease him
 
2:26 PM
Is it easy to detect if a file was changed (via git) with node?
 
changed via git?
 
spawn a process and check if git status --porcelain returns anything
 
locally or from a pull?
 
I have just realized how to become rich... take control of a bank and then overnight set that the costs of maintaining an account are $1.5bn
 
2:34 PM
Is there an easy way to install libraries from npm with access to git and not to the npm registry?
 
@FilipDupanović I think Wells Fargo already tried that.
@Neil yes.
 
> take control of a bank
what are you? ISIS?
 
You know, in the offshoot that I don't go completely insane within the next few hours
 
@Neil of course
 
@Luggage and they got rich, amirite?
 
2:37 PM
@Neil tried lookink at the docs for npm install? it tells you.
@FilipDupanović of course
 
@FilipDupanović yeah but a lot of these are exported
 
@Luggage providing the github url directly will also use github for its dependencies?
 
@Neil Dude, just try it
Also, no
 
It's a bit complicated to try for me
 
@Neil yeap
 
2:40 PM
Git isn't even installed
 
@rlemon @Luggage Just wondering if there is a better way to do this:

$ git log -1 --format=%ct --follow ./dist/ww-dist.js | cat
1480702583

$ git log -1 --format=%ct | cat
1480979494
 
@Neil Okay, that's a good reason :P
 
ping me one more time
I dare you
 
@Neil no, dependencies will still try to come form npm. IF you want everything from git, you are in for some trouble.
 
@Luggage i figured
 
2:42 PM
@jake what, in plain english, does that do?
Fix your npm access problems. That's the true solution.
 
That blows chunks
 
No, that's how npm works. not all packages can even be installed from the repo.
That's the POINT of a package repo.
 
Just use bower
 
don't use bower
2
Why are you trying to use npm without a package repo?
 
don't use bower
 
2:44 PM
like trying to use an iphone without internet service
 
Of course don't use bower, just put all your npm dependencies in a repo on GitHub and pull them with npm. It's obviously so much better. Duh!
 
Right, but essentially without a npm repository, you essentially cannot code in nodejs
 
any package can be installed from the repo
if it's a valid package
 
that's more complaining, but you haven't told us why?
 
well, from a github erpo
repo
 
2:45 PM
@Mosho not all packages build themselves. also, the dependencies will try to fetch from NPM
 
I wouldn't call that complaining. More like facts. Lots of nasty ones at that
 
@Luggage it can still be installed, it just won't work
and dependencies will be fetched as specified in package.json
 
right
You still haven't told us why you want to avoid d/ling code form one rpo, but insist it must be git
note: not all npm packages even HAVE a git repo.
 
that's true
 
2:47 PM
It's an unreasonable request.
 
And not all npm packages are registered under npm
 
For those that aren't, using alternative sources makes sense.
 
They exist purely on github
 
you are avoiding the question.
 
What's the question?
 
2:48 PM
@Luggage Compare the last commit date of a file to the last commit date for the repo.
 
I just asked three times.. why?
 
Hi there. Does anyone knows about an advanced AngularJS free course or tutorial?
What I want is to know more about complex forms, routing, security, authentication, more of a real world app, and not only simple examples about easy forms, or easy validation..
 
@FernandoFradegrada Welcome to the JavaScript chat! Please review the room 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.
 
And you ask so nicely..
 
You are also changing your story to counter my questions. First it was "all packages", and now it s"well, some things aren't in npm". You are being evasive so I suspect your reasons are bullshit.
The first few times were nice.
This is an X/Y problem.
I'd put fat stacks of dough on that.
 
2:50 PM
@FernandoFradegrada, not taht I'm aware of. But usually real world problems happen in real world scenario's...
 
@jake you need that much detail? you could just check which files changed in last commit with Git and see if grep returns a match
 
You're free to suspect whatever you wish. The fact remains that my willingness to answer your question diminishes with the accusatory tone
 
So try your best to learn the basic, fight the production trouble as you go I guess?
 
@Neil You are the one with the problem :P
Just a friendly reminder ;)
 
Does anyone know if it is possible to permanently toggle a hover state on an element in chrome's dev tools?
I need to debug an element that will only appear on hover
 
2:52 PM
@OliverSalzburg true, and I think I have all the information I need now
 
@corvid Yes
 
@OliverSalzburg how do you do it?
 
There's this button that says :hov
 
@FilipDupanović I am trying to make an automatic build step
 
2:53 PM
@corvid right click on an element.
 
oh that's not working :\ I need to rework it a bit then because it's running in JS, not CSS (which means my question was dumb)
 
@jake what do you need to look at in the Git repo for the build step?
 
@SvenvandeScheur yeah I know. But every tutorial is about understanding directives, controllers, services, and that's really good if you need to start with the framework. But I am building a larger app and those easy forms of "firstname, lastname and age" are none of my bussiness. I need to apply complex logic as server validation for example, login and authorization things, etc..
 
usually people just touch the index, commit changes and do a final check if the index isn't dirty, otherwise they abort
 
I think there are tutorials on AJAX with angular. Don't see how authentication is much different...
 
2:56 PM
@SvenvandeScheur not authentication, but role based authorization.. I have 2 or 3 different roles in my app
 
@FilipDupanović Yes, I was just wondering if there was a cleaner way of doing it without using shell commands.
 
@FernandoFradegrada that can be, but Angular is probably only aware of "authorized" or "not authorized". That you might need some more complexity in you API layer shouldn't really matter for how you use angular.
 
@SvenvandeScheur Of course my API is secured and every request is being analyzed for permissions, but well.. I was wondering on that kind of stuff tutorials.. more complex than just understand the framework
 
@jake shell commands are ok, you can always simplify them down to getting a 0 exit or not, and there are a few tools out there to help you with sealing builds... maybe you can throw in bumped.github.io or github.com/sindresorhus/np and call it a day
 
@FilipDupanović Those look really nice, I use semantic release now. How would you say they compare?
 
3:08 PM
 
I see my favourite astronaut!
 
does his moustache excite you ?
 
I always have wondered if they have a special OS loaded on those ThinkPads on the ISS
 
WinXP
nvm. 2013 they upgraded from winXP to linux
the source I can find isn't specific about which flavour "like RedHat and Scientific Linux"
 
Dammit my oculus hasn't shipped yet
 
3:18 PM
http://space.stackexchange.com/questions/1489/what-kind-of-laptops-do-iss-astronauts-use
100 laptops onboard, for 6 people.
 
what
 
TIL a cool CSS trick: you can make another element appear when an element is hovered over
 
@jake np is zero-config with basic sanity checks; bumped and semantic-release step on each other's toes a lot
 
@corvid in certain situations, yes
 
3:26 PM
@rlemon it's pretty useful in React for an item with a tooltip
 
how about no js alerts
 
hi again! any angular2 pro here? Need advices... following a tutorial, and a bit confused on "forms" things... I opened a room and posted some code...
 
fuck, i do that atleast once a day
 
user3119231
flag triggered
 
repl less
 
3:28 PM
!!afk cars broken. going to the car doctor
 
user2620028
what is wrong with car
 
user3119231
5€ engine isn't starting
 
@HatterisMad oil change. Also a sensor for the tank vent thingy is telling my it is broken. Also exhaust is loose somewhere.
And my brakes are fucked.
 
user2620028
jesus.... did you buy a french car or something
 
3:43 PM
Car took a nose dive over the last few months.
@HatterisMad old dealership was doing a bang up job of ripping me off. New mechanic informs me all the work was half assed or not done.
 
I took my car to the garage this morning
 
user2620028
ahh yeah that happens
 
the main problem was the brake pedal is fucked up
 
It still ran fine. Problems that I wouldn't have noticed piled up. Now the cars a lemon and I'm looking for a new one. But I need this to run till January
 
go to car doctor, find out oil filter has malformed, pour in some more oil, go back home, put the car to sleep in the garage until part arrives next week, experience a major kerfuffle with delivery, wait until next year, break the engine on the way to the doctor, doctor then sells you a new car... fixed
 
3:45 PM
AdventofCode today was easyyyyy
 
user2620028
the oil filter has malformed...
 
user2620028
WAT
 
user2620028
!!wat
 
@HatterisMad oil filter housing... there... sssssh, your getting a new car
 
3:49 PM
@FilipDupanović Thanks, I'll definitely be checking out np.
 
You oil filter is enlarged. You're going to dribble oil. It happens as cars age.
 
and like grandparents, you should replace a car when it begins to dribble
 
same with basketball players
I'm funny
 
If you have to proclaim it...
I'm attractive to the opposite sex.
damn, screwed that one up.
 
user2620028
i am so lost
 
3:55 PM
Good.
 
user2620028
about the misshapen oil filter
 
@Luggage except technically you didn't, because (being a programming chat room) we're all male
 
@HatterisMad Prostate.
 
user2620028
huh.
 
user2620028
well played
 
3:56 PM
Not if I had to explain it. :)
 
@HatterisMad only kind of prostate worth having
 
user2620028
a leaky one?
 
A well played one.
room topic changed to JavaScript and explaining jokes to @HatterisMad: Topic: JavaScript, ECMAScript. Read this: javascriptroom.github.io/rules. Before asking inform yourself on the XY problem goo.gl/taIqf | devdocs.io Documentation™ Helps. Room meta discussions: github.com/JavaScriptRoom/culture [ecmascript] [ecmascript-6] [javascript] [nodejs]
 
user2620028
:(
 
user2620028
its true though
 
user3119231
4:04 PM
I know it's not javascript, but is there a good way to let the colored containers fit to the remaining space to the profile picture? jsfiddle.net/ug1fp5jf
 
probably flexbox, but I'll click the link
 
user3119231
I know there are several ways to solve this. But I want to learn the best one
 
I'm not very good with CSS, but jsfiddle.net/oaaqyxmw
 
user3119231
@BenFortune It's a solution but I would have to do this margin for every element which comes after
 
user3119231
I even don't want to work with position attributes like absolute or fixed
 
4:17 PM
you will have to for your image at least
 
it sounds like you want a flexible box
 
or a grid
 
user3119231
another solution: move the profile picture div into the title picture div. relative position and do the margin-top for the colored boxes once.
 
user3119231
Now I only have to work out which of these solutions is the best.
 
@ndugger you're back!
 
4:23 PM
no
 
i hate loopbackjs
 
Just reached 200 SO score, feels good boys ^_^
 
I reached 500
 
@KevinB it works fine if you run it on your IBM mainframe against DB2
 
4:27 PM
Nice dude, #notreadytohelp
 
for anything in real life, it's crazy bloated
 
my problem with it is if you aren't using mongoDB, it's very restrictive
you can't filter based on child collections
and if you really need that, you've gotta make your own route that hits the DB directly
 
@littlepootis levlaz.org/an-ode-to-linux-desktop-users-everywhere yay for alsa and systemd! /s
 
I am a little confused about one thing in redux. Say you have a reducer which has a boolean flag like enabled. You want to update the state when an action dispatches, but only if it enabled is set to true. Should this be handled in the reducer, or the action?
The way I see it, you can do it in both places
 
@AwalGarg pennart littering cries a little inside everytime alsa and systemd go in the same sentence.
 
4:38 PM
@littlepootis good (assuming that's a spoonerism of that awful person who broke linux)
 
what's ironic is that the real heroes can't read the article because of the nonfree scripts it includes
 
don't worry, they're busy eating things from between their toes
 
@littlepootis I am waiting for lennart to do things to the Xorg :D
 
@Maurize slimmed down to the flexbox bits jsfiddle.net/qggm5mj7
 
4:51 PM
@lix niiiice
 
Yo
 
1k is a nice milestone
you're well on your way
 
so this guys question got closed for multiple
 
@Maurize also google Nicole LaLiberte for the cover, you can thank me later after you get a job
 
but I just wrote out his function he needed
and it isn't a duplicate of that thread
 
4:52 PM
@lix for multiple what?
 
how do I send this chap his answer?
duplicate sorry @ssube
 
is the answer a duplicate of one on the duplicate?
 
No I wrote it out myself
 
link?
 
that's not what i mean
 
4:53 PM
0
Q: Splitting an Array into multiple chunks

G. HansonI'm looking to find a way to split an array into a set number of chunks. I've seen multiple posts on here which split it into chunks with a specified length, but that's not what I'm after. For example, consider the following array: var array = ['1','2','3','4','5','6'] I would like to easily be...

 
In other words, is your technique for solving it already covered on the duplicate.
 
I had a skim I don't think so
 
I can tell you from the title that there are a million dupes
 
does it also answer the duplicate
 
to be fair
I think there's an issue in my function
 
4:54 PM
that Q is a super duper dupe
 
gist: d82b9e408d7a12bf4a92338cdbbba491, 2016-12-06 16:54:27Z
function splitArr (arr, divNum){
	
	tempArr = [];
	finalArr = [];
	
	var arrayLength = arr.length;
	var counter =  0;
	
	if(arrayLength % divNum === 0){
		
		for(var x = 0; x < divNum; x++ ){	
		
		    //we need to figure out if 
			for(var y = counter; y < counter + divNum; y++){
				//push the specific instance to the array;
				tempArr.push(arr[y]);
				counter++;
			}
			
			finalArr.push(tempArr);
			tempArr = [];
		}
		
	} else {
		//we know that it is not possible without leftovers or further optimization.
		throw new Error();
	}
	
}
 
basically, if it's a new answer, and useful, add it to the dupe target. :p
 
I mean it's a noob approach
 
that's an awfully complicated way to do that
 
tabs </3
 
4:55 PM
Educate me please :-)
 
the existing answers describe the "how" part, so anything else is just a little math before it to turn "I want N chunks" into "I want chunks of N items"
but the general binning question has been well-asked and well-answered
 
Yeah I wrote it out in notepad++ and don't have the cleaning command
 
your answer is a dupe
 
Yeah I agree it's a dupe
 
function chunkByCount(a, n) {
  var out = [];
  for (let i=0, j=a.length; i<j; i+=n) {
    out.push(a.slice(i,i+n));
  }
  return out;
}

function chunkEvenly(a, n) {
  return chunkByCount(a, a.length / n);
}

console.log(chunkEvenly([1, 2, 3, 4, 5, 6, 7, 8], 2))
 
4:58 PM
Turns out I didn't read the top answer fully tbh, much better way
 
@lix is how I would write it
chunkByCount is the top answer, the math is just tacked on
 
Man your making it pretty clear my algorithm knowledge is not great :/
 
eh, the more you use js the more familiar you should become with the tools available to you for solving these kinds of problems
 
binning, especially on data larger than memory, is a fun algo to learn. You should look it up.
it's definitely not as simple as that answer or my snippet make it look, at least not in concept
this is a pretty simple subset
en.wikipedia.org/wiki/Bin_packing_problem is related and pretty cool
 
yeah that's true @KevinB, @ssube Thanks for the reading material, gunna do some practice quickly after
 
5:04 PM
@ssube no, use my slow but clever answer
 
is it a variant of your timeoutSort?
 
Overwriting the prototype is not pretty
 
@FilipDupanović haha i remember that
 
That's adding a property to the prototype. It's not as bad.
though, unless chunk is part of the spec, then It's discouraged to do that on the prototype of a built-in type.
 
5:16 PM
So depending on a modified prototype, if you can extend it, anyone else also can. And they/you won't know if a property is already taken. So you can overwrite if in in bad luck.
Best practice, don't alter built in prototypes
Maybe extend it?
 
true. unless polyfilling a missing function.
 
As in, built a new class
@Luggage, fair point
 
you send in the ponies! ponyfill.com
 
@FilipDupanović cute clouds
 
Are you a brony?
 
5:18 PM
10
A: Split array into chunks

rlemonOld question: New answer! I actually was working with an answer from this question and had a friend improve on it! So here it is: Array.prototype.chunk = function ( n ) { if ( !this.length ) { return []; } return [ this.slice( 0, n ) ].concat( this.slice(n).chunk(n) ); }; [...

 
Hello, I have a question about testing with React/Enzyme/Mocha
 
Whats the question
 
In one of my functions under test, I have a statement that looks like:
if(document.activeElement === this.refs.anElement)
 
ah, the ol' "am i focused"
 
To get document.activeElement to the element I want it to be, I call anElement.focus() in my test case
But this doesn't work
An earlier function my test happens to run sets the focus to a different element
And calling anElement.focus() does not change the focus from that other element to the element I want to have focused
 
5:20 PM
Is this something like your question: stackoverflow.com/questions/37694900/… ?
 
I am already using mount instead of shallow
And the document.activeElement is inside the function under test, not the test case
When I run my program, it works exactly like I want it to, so I'd rather not change it dramatically to get my tests to work if I don't have to. I'd rather get my tests to work the way I want them to
 
can you try to wrap the check in a setTimeout(fn, 0)?
This may required configuring the test runner for async tests
also try:

let input = wrapper.find('input');
input.simulate('focus');
enzyme has some simulate stuff for events
 
I don't quite grasp what the Zone proposal is trying to solve... github.com/domenic/zones
 
Yep, that's actually how I'm setting focus
The exact line in my test is:
    const wrapper = mount(<ComponentUnderTest />);
    const button = wrapper.find('.the_class_i_want');
    // do some stuff...
    button.simulate('focus', { preventDefault: () => {} );
 
does simulate actually focus the element, or just simulate a focus event?
 
5:28 PM
> Even though the name would imply this simulates an actual event, .simulate() will in fact target the component's prop based on the event you give it. For example, .simulate('click') will actually get the onClick prop and call it.
So perhaps my problem is that .simulate('focus')' doesn't actually focus the element - it just calls props.onFocus()`.
 
@ndugger That example code with promises is really weird... I don't get why it would be nested like that in the first place.
 
!!edm or metal or rock or 90's hip hop
 
@rlemon rock
 
although, I don't think that;s the point
 
user2620028
feels good to go through and fix all of the eslint complaints
 
5:41 PM
In inheritance we extend the parent and create mutated child. But how to enhance a module from another module? I hope I am clear. Maybe it is software design question. I am asking something like wordpress hooks which hooks new functionality to existing module but since that is so old now there must be something better
 
is a state machine a model or controller?
especially when talking about the state pattern
 
so is mobx supposed to be a replacement for redux? How does it compare?
 
@corvid yeah, it's just another state management 'system'
but without using react to manage state
 
5:56 PM
is it any good, or is it one of those flashy fly-by-night libraries?
 
it's very very different than redux.
it's based on 'observables'. Are you familiar at all?
 

« first day (2243 days earlier)      last day (2699 days later) »