« first day (1873 days earlier)      last day (3074 days later) » 

12:00 AM
> then checking each substring of other strings to the tree
 
user1596138
I bet @Sterling's love it's harder than you just made it sound
 
Implement it, do the math to calculate the running time and space complexity of your solution, then rethink it
 
it's O(#substringsInFirstString * AVG(substrings) * #strings - 1)
in average scenario
worst case is ofc O(n ^3 )
 
RxJS question: is new Rx.Observable() the same as Rx.Observable.create()? If not, where can I find docs on what gets passed to the new Rx.Observerable() constructor?
 
Has "Get random item from array" been considered for the ES spec?
@NathanJones Which version are you using, Rx4 or Rx5 (aka rx-next)?
 
12:07 AM
for those who witnessed the Lounge drama: bartek's meta
@SomeKittens what' wrong with the good old Math.random() * array.length ?
 
@KarelG Same problem with Math.pow()
 
@SomeKittens this question arose from reading your gustav examples, which believe uses rx5-alpha
 
@NathanJones correct, I'm on next. You should use new Rx.Observable(o => {/*stuff*/}) with Rx5
 
@SomeKittens if the ES spec defined a method to get a random item from an array, then internally it would behave the same ...
 
one caveat - you'll need to use .next instead of .onNext, etc etc in the constructor
@KarelG Yeah. And?
 
12:10 AM
you're lazy, right ? :P
 
@SomeKittens well, that's what I'm confused about. You're passing in a function to Rx.Observable, which is a subscribe function, right?
 
@Trasiva lies
 
@nick Trasiva is afk: Shave and a haircut.
 
@SomeKittens The implementation of Math.pow isn't trivial though
 
crl
I bet it's a bunch of xor shift and shit
 
12:14 AM
@NathanJones correct. It defines what happens when someone subscribes to that particular observable.
 
@crl No, it's probably square and multiply for integers, delegates to sqrt for 0.5, and uses an approximation otherwise
 
@SomeKittens does that function define what's getting "output" from that stream, or what happens when something observes that stream?
 
@NathanJones the latter
 
@SomeKittens so an Observable is a kind of ReadableStream?
or maybe congruent?
 
It's better to think of it like an array delivered asynchronously
 
@SomeKittens the author of that Intro to Reactive Programming article you linked seemed to use Observable and stream interchangeably. Should they be thought of as the same thing?
 
Anyone know how to change the format of the date binded in a ui-bootstrap datepicker?
I have the following input `<input id="date" name="date" type="text" uib-datepicker ng-model="vm.date">` and I want `vm.date` to have a format of `dd-MM-yyyy`
 
@Zirak I just finished reading that :)
not closely enough, apparently
 
@NathanJones yep, either is acceptable
 
How do you define a parent template with ui-router that's always there on every route?
 
12:26 AM
subroutes?
 
Basically partial views. They look great when loaded on top of an existing template. But if I go to their URL, they come out just by themselves.
Which means the only way for the user to sign up is to go to the main page, click on the login link (which loads the login view in the ui-view) and then click on sign up (which loads the signup view in the ui-view).
 
@SomeKittens using your gustav readme as an example, and just so i understand what you're saying, the async array is an array of tweets that calls map on each element as soon as each element gets a response (in your sentiment transformer). (sorry for my butchery of the english language)
 
I need your thoughts, folks
Does this look too much like youtube's player?
Because of the gradient background
 
nope
 
on the controls
Alright, awesome
 
12:35 AM
nice test video
 
Aye, I grabbed a few different videos from youtube so I could test the controls against various backgrounds (videos)
 
In case someone knows
0
Q: Set format of date to ui.boostrap.datepicker

feniixxI need to set a format for the value of a datepicker, my datepicker: <input id="date" name="date" type="text" uib-datepicker ng-model="vm.date"> I want vm.date to have a format of dd-MM-yyyy, currently the datepicker displays as: So is there any attribute to do that? Or do I necessary have ...

 
I'm way too lazy to make the blades 'clean'
tonight
but it is sharp af
chips at the bottom of the blade were because a stupid mistake.. needs cleaning
 
make it bigger
 
Is it right to do
var num = 123;    var str = num + 'hello';
?
 
user1596138
12:49 AM
Yes is very good practice I do it on Sunday
 
@feniixx yes in lack of sanity javascript lets you do that in the pure sane way.
 
@nick forge is only so big.
currently that is the longest blade I can make
I need a new forge..
 
just get a giant anvil and make a fire
its ez I see it all the time on TV
 
for steel you need ~1150-1200c
easier to just make a enclosed forge from fire bricks
propane torch powered
 
Just microwave it
 
1:02 AM
good idea
 
why does this fail? 'locked' in ['locked']
 
in checks properties
 
Is 'locked' a key?
 
good good idea
 
er keys
yea
better way to put it
 
1:04 AM
!!> 'locked' in { locked: 'foo' }
 
@Nick "true"
 
Well, property names probably.
But keys is short :-)
 
property names are keys
 
Yeah, I just mean that the spec has proper terminology for such things.
 
user1596138
> Seizure warning do not watch the screen
 
user1596138
Gdamn that gets intense in a dark room
 
rave
 
user1596138
After a few seconds for me I only see the red and blue flashing lol
 
user1596138
Can't tell if it's the video or me. Eyes hurt lol
 
1:10 AM
hey hey hey
what is up?
 
user1596138
Raaaaavvveeeee
 
@Jhawins I need that for my screensaver.
 
8 messages moved to Trash
 
1:42 AM
Facebook is now automatically translating posts in your feed, and wow, the spanish to english is spot on.
 
For some reason call of duty turns on my cam
 
That was me
 
1:55 AM
@SomeKittens snyk is a requirement?
for gustav, i mean.
 
@Luggage dev dependency
 
ah, right
 
2:09 AM
@Luggage what are you trying to do with it?
 
nothing of value. i was going to see if, once a pipeline was setup, i could inspect it and turn into into a graphviz graph.
 
working on that currently
saw this and went "I want that"
 
ohh, nice.
 
current status: Allowing nodes to track metadata
realized I hadn't written JS in a week (explains why I'm grouchy)
 
wow, a 'sankey' diagram might be jsut what i need to visual a diffierent problem.
 
2:30 AM
Any JS expert want to take a guess on this one?
1
Q: Angular project using express generator

user1564657I have created a project using express generator. Then I installed bower to get bootstrap and angular. I am using express for REST web services. I have defined angular routes too. I can get too my index page but my angular routes are not working. app.js var express = require('express'); va...

 
When using Express Router and declaring routes like this:
var express   = require( 'express' ),
    router    = express.Router(),
    http_ctrl = require( 'http-ctrl' );

router.route( '/endporint-x' ).post( http_ctrl.post );
How do I assign a middleware?
 
pass it into .post
 
like this: .post( mddlwr, http_ctrl.post ); ?
 
@DemCodeLines massive code dump
@feniixx yeah
 
ok
 
2:33 AM
What questions about Javascript/Frontend would you ask Douglas Crockford if you had a chance to meet him?
 
Anyone has used Multer?
I want to know where does multer({ dest: 'path' }); reference from?
(If the file where I'm requiring it is not server.js, and isn't either in the root folder)
 
@SomeKittens It's not mine.
I think OP is confused by the mixture of Express.JS routing and AngularJS routing
 
@RahulDesai Can I have $5?
 
And I must say, I am too. My Angular routes only work when node.js routes have been set.
 
@SomeKittens Not related to Javascript/Frontend :P
lol
 
He's kinda dropped out of the JS public eye
 
@DemCodeLines It has to be like that...
After defining node/express routes you do something like this:
app.route( '/*' )
    .get( function ( req, res ) {
        res.sendFile( path.join( __dirname, 'client', 'index.html' ) );
    } );
every other route that isn't defined yet will be treated as an angular route
 
lol
 
Not sure I am following. If I do something like
.state("login", {
  url: "/welcome/login",
  views: {
    "container@": {
      templateUrl: "views/auth/login.ejs",
      controller: "AuthController"
    }
  }
 
2:42 AM
@SomeKittens Why do you think so?
 
haha nice
 
I expect the login.ejs page to show up upon going to /welcome/login, but it says Not Found.
 
@SomeKittens I dont know much about him. Just loved his Youtube videos about JS.
 
He's largely responsible for JS's popularity
 
How do you set a property recursively in javascript? I can get the value, but it's hard to update
 
2:47 AM
what do you mean set it recursively?
 
I see.
 
So say it looks like this
I want to do a depth first search (this part is easy enough), but then I want to change that nested "completed" to true
That is, the step with { text: "Boil broth 45 minutes"}, I want to set it to true.
 
the search is the only work to do, there is nothing to setting the value
 
Write a recursive function
 
Well the recursive function for finding it isn't hard
  _findNext(steps) {
    for (let step of steps) {
      if (step.steps instanceof Array && !step.completed) {
        return this._findNext(step.steps);
      }
      return step;
    }
  }
  get next() {
    return this._findNext(this.steps);
  }
 
2:57 AM
That's the only one you need to write.
once you get a reference to the right step, just mutate it's completed property.
i think that'll return the first step without children. is that the intention?
 
Yep, first step without children that is not completed
 
so, assuming it returns the value you want: next().completed = true;
but it'll return completed steps if they have no children.
 
Doesn't really do much of anything, it's still set to { completed: false }
 
holy shit, new jsfiddle style
4
@corvid works for me: jsfiddle.net/uo3wy5z5
 
3:15 AM
Whaaaaaaaaaaat?
jsfiddle.net looks cooler!
 
Yeah!:D!, I saw it about two hours, I was like WTF!
 
has anyone here worked with chrome extensions?
 
@bourbaki4481472 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.
 
What's this magic!
 
Its lovely. Feels so light.
 
3:16 AM
less filling
 
But editor still needs to improve:c
It's not possible to collapse code
 
Wow. I see the support for CoffeeScript, Babel, SCSS. Awesome!
 
Too many Cages.
 
woah
yeah jsfiddle looks a bit different
 
3:26 AM
Their dashboard is about the same though.
 
> Yes, the sidebar is still there, but it’ll be gone in the future updates.
interesting
 
I'm having trouble with middlewares using express router
here's the error I'm getting
Error: Route.post() requires callback functions but got a [object Object]
and here's my module:
module.exports = (function () {

    var express          = require( 'express' ),
        router           = express.Router(),
        multer           = require( 'multer' ),
        transaction_docs = multer( { dest: './client/public/docs/transactions/' } ),
        product_images   = multer( { dest: './client/public/img/products' } ),
        upload           = require( './upload' );

    router.route( '/upload/transaction-docs' )
        .post( transaction_docs, upload.post );

    router.route( '/upload/product-images' )
If I add the middlewares transaction_docs and product_images I get the error when serving the app, if I don't no error, but it doesn't work either
 
@Loktar If they could make the sidebar into a drawer, wouldnt that be nice?
 
It can just go away, like their plan. You don't need it now that you have the local config options per frame
 
Alright, this is ticking me off.
 
3:39 AM
1 message moved to Trash can
@DemCodeLines Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
app.get('/', indexRoutes.index);
exports.index = function(req, res){
  res.render('landing');
};
$stateProvider.state("welcome", {
  url: "/welcome",
  templateUrl: "auth/welcome",
  controller: "AuthController",
})
But going to localhost/welcome says Error: Not Found...
why?!
 
What even is this?
 
AngularJS
and ExpressJS
 
ew to both
 
You can still help though...
 
3:43 AM
@DemCodeLines share your server.js through a gist to be able to help...
 
No idea about the angular stuff
 
I believe you're confused about server side endpoints and client side routes...
 
What I really want is

1. User goes to localhost/welcome. Angular sees that no specific module was requested, so it shows welcome.ejs and automatically loads the login.ejs view into the ui-view.
2. User goes to localhost/welcome/login. Angular sees that login was requested, so it shows welcome.ejs and loads login.ejs into ui-view.
3. User goes to localhost/welcome/register. Angular sees that signup was requested, so it shows welcome.ejs and loads signup.ejs (not shown here) into ui-view.
 
Is your proyect on github?
 
3:51 AM
What is routes in you server.js?
Guys if you know about express router/middleware please..
0
Q: Add a middleware to a specific Express Router Route

feniixxI'm using express router to define my routes, and I need to add a middleware so some routes, just adding the middleware before the callback function ouputs the following error: Error: Route.post() requires callback functions but got a [object Object] I'm working with folders as modules, my mod...

 
@feniixx where are you seeing routes?
 
app.get('*', routes.index);
also I think it should be app.get('/*', routes.index);
 
@feniixx That was supposed to indexRoutes.index, and changing it to app.get('/*', indexRoutes.index); redirects all requests to /, which is exports.index = function(req, res){ res.render('landing'); };
So no matter what I type, I get redirected to landing.ejs...
 
Do you understand that Angular and Express routes have different purpose?
 
I do, but I seem to be getting confused. Do you see the problem though?
 
4:05 AM
Angular routing is client-side routing, whenever the a user go to whatever.tld/route angular will handle it, if you've configured it, and express routes will be endpoints, so that your app can communicate to the server through them, for example whatever.tld/api/v1/poop
 
I understand that. However, my code is breaking at the angular level routing.
 
I can't help just with what you have shared, if you want, create a sample project in github , so that I'll be able to know what's hapenning
 
Here's the angular level routing, in one of the controllers that is supposed to handle localhost/welcome: pastebin.com/bWucLKyC
 
That could be because you haven't telled express that after defining server endpoints, any other route should be handled by angular
 
I'll create a sample project on github, give me a second.
 
4:13 AM
Hey guys, if I define var uploadRouter = express.Router(); somewhere in my app and I add a middleware to that router, and then somewhere else I define var xRouter = express.Router();, the routes defined of xRouterwon't have the middleware right?
 
4:25 AM
505
A: Getting git to work with a proxy server

Salim HamidiCommand to use : git config --global http.proxy http://proxyuser:proxypwd@proxy.server.com:8080 git config --global https.proxy https://proxyuser:proxypwd@proxy.server.com:8080 change proxyuser to your proxy user change proxypwd to your proxy password change proxy.server.com to the URL of you...

^ can we set a proxy for a specific repo?
and not globally?
because I have a global config, but for a specific repo I need to override it...
 
4:38 AM
@nick I'll cut you.
@Trasiva I'll cut you too.
 
@phenomnomnominal Trasiva is afk: Shave and a haircut.
 
I guess someone else will cut you then.
 
Hey guys, have you used express/multer?
 
@phenomnomnominal I'll have you know I graduated top of my class in the US Navy Seals
etc
tl;dr i will rek u kid
@feniixx what is express
 
I taught your class in the US Navy Seals
 
4:44 AM
that's funny cuz I didn't see any kiwis
we don't allow fruit in the military
 
express.js jaja
 
@nick oh yeah I forgot you're all racist and homophobic
 
@phenomnomnominal yeah :(
 
stupid question: What are four traits of a good codebase?
 
@SomeKittens predictability
tests
 
4:48 AM
guys express.js/multer saves the file but it doesn't add the pdf extension
here's the json
 
structure
 
{ fieldname: 'file',
  originalname: 'Ejemplos.pdf',
  encoding: '7bit',
  mimetype: 'application/pdf',
  destination: './client/public/docs/transactions/',
  filename: '32d8d06c38475b339e68b2a640fcc359',
  path: 'client\\public\\docs\\transactions\\32d8d06c38475b339e68b2a640fcc359',
  size: 484581 }
 
so far I've got Fast, secure & well-tested
 
add "consistent" to that and that about covers it
 
@SomeKittens readable, I guess
 
4:52 AM
cool, good comments
 
Hi guys
putting together aa resume
i have my projects listed as MYAPP.herokuapp.com
I need those reviewing my resume to open a non SSL version of my application
due to the APIs involved
 
@feniixx you still there?
 
are there any instances where one could click on a link with format of MYAPP.herokuapp.com and be redirected to MYAPP.herokuapp.com
i mean redirected to "https://MYAPP.herokuapp.com"
 
@feniixx I guess not
 
5:22 AM
Hi
 
@feniixx here is the github:
https://github.com/user123212/routing
 
You can't have same routes from express and angular
 
How would you fix that, then?
 
change express routes to /api/v1/blaa
 
The routes in the routes folder, correct? And that's all?
 
5:33 AM
Maybe
 
You know that doesn't really help. Are you still looking through the code?
 
I wont do your work
No I'm not
 
@DemCodeLines dont be entitled like that
 
And I'm not asking you to either. I simply asked to help with a small part, particularly the routing.
@theamateurdataanalyst I'm not. He made it (intentionally or unintentionally) seem like he was looking at the code to help out.
 
I did
And I telled you what I saw that was incorrect
also you should get rid of all routes, then try just serving index
For example here
app.get('/', indexRoutes.index);
app.get('/partials/:name', indexRoutes.partials);
app.get('/auth/:name', indexRoutes.auth);
app.use("/", partialsRoutes);
app.use("/", welcomeRoutes);
app.use("/", authRoutes);
app.use("/", usersRoutes);
app.get('/*', indexRoutes.index);
that is totally incorrect
you are assigning everyting to "/" @DemCodeLines
 
5:41 AM
@corvid can I pm u somehow man
 
@Angular 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.
 
6:11 AM
I'm not very good at programming (just ask anyone in here), probably won't be able to help much except vague suggestions
 
@corvid It's not a proramming question llol
 
Hey @Zirak have you used Multer?
 
!!time
 
@JacquesMarais !!>new Date().toLocaleTimeString()
 
!!> new Date().toLocaleTimeString()
 
6:17 AM
@JacquesMarais "01:17:23"
 
.. More like "08:17:23"
 
6:44 AM
Is there a way to PM someone ?
 
Nope
Best you can do is make a chat room but it won't be private
 
PM?
 
@Mr_Green Private Message
 
@PiyushDholariya 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.
 
6:48 AM
how can I do encapsulation in javascript?
 
anyone tell me which is the best video player for nodejs
 
7:04 AM
is any one can explain encapsulation in javascript?
 
what key comments every selected lines at one-go in sublime?
 
ctrl+/ or ctrl+shift+/
 
So @MadaraUchiha @Zirak @Mosho we still up for a beer today?
 
@PiyushDholariya it didn't work
 
But I can do with these keys, currently even I am doing that
 
7:10 AM
@BenjaminGruenbaum you guys live nearby?
 
@NickB Are you using windows/Unix/MAC?
 
linux
 
@nickB I am also using linux red-hat & its working fine.
 
@BenjaminGruenbaum I'm up.
 
morning :(
 
7:15 AM
@PiyushDholariya it's ctrl+/ for single line and ctrl+shift+/ for multiline.
55
Q: Keyboard shortcut to comment lines in Sublime Text 3

0x4a6f4672In Sublime Text 2 it was possible to comment out a line or a block of lines with Ctrl+/ and Ctrl+Shift+/. According to the menu Edit > Comment these shortcuts should be valid, but in Sublime Text 3 (build 3047) they no longer seem to work. Does anybody know the right default keyboard shortcuts f...

maybe you have different key bindings
 
7:27 AM
@PiyushDholariya Can you define what you mean by encapsulation? JS has closure, but doesn't have direct support for private/protected methods or properties.
 
7:49 AM
@Sheepy: I want to bind anything in js & don't want to show it.
 
@PiyushDholariya Hmm. That is even less solid than "encapsulation". Bind what to what and hide from who?
 
Then suggest me I want to hide some property from users.
 
Don't just say anything. For example binding event handler is pretty different from binding a global variable. The former you can't really show it. The later you can't really hide it.
 
I want to bind custom property
@crl: I don't understand your words.
 
@PiyushDholariya You want to hide js object properties from users. Do you mean human "users" debugging your code in F12 debugger?
 
7:58 AM
yes exactly
 
crl
put it inside 8000 depth/levels in an object
 
what's that
 
@crl: What does it mean?
 

« first day (1873 days earlier)      last day (3074 days later) »