« first day (2367 days earlier)      last day (2806 days later) » 
00:00 - 16:0016:00 - 23:00

00:01
that's where the other half of my soul had wondered off to
Knu
Knu
00:35
Anyone using npm scripts around? I am trying to choose a binary for image minification.
Would you recommend imagemin?
 
2 hours later…
02:21
Ugh, gpg 2.1.15-17 has a bug that hasn't been fixed in Ubuntu yet.
02:38
how do I specify that I am expecting an Object as function parameter in angular 2?
submitForm(e: Object){} and submitForm(e: object){} both are giving errors
@FlyingGambit what errors
It says Property 'type' does not exist on type 'Obje)ct'.
sounds like you are trying to give that method to an onSubmit handler
yes
well indirectly, I have it as (click)="submitForm"
yeah it needs to be of a specific signature
try submitForm(e: Event){}
or one of the other interfaces for events TS comes with
I haven't really used angular 2
but one should work
look at examples
e: any will work too
02:44
Thanks that Event one worked
Is there list of these types in typescript ?
Becaz I need to specify type for another method also
saveForm(data: any, e: Event){}
sata needs to be an object
actually form values = data
@Mosho There is no object data type, are we suppose to just Interface or any ?
@FlyingGambit lib.dom.d.ts
comes with typescript
@FlyingGambit there's object type in TS 2.2
you can also define a dictionary
where is all this information documented, i cant find any links
not sure tbh
I would start with the typescript site
this is how you define a dictionary:
interface Dictionary<T> {
        [index: string]: T;
    }
03:07
Sorry was afk, thanks, I don't think I can use it that way in my app as I won't know what properties/values will be there in the the Dictionary
03:23
My typescript was 2.0, updated to 2.2 , now I can use object
Thanks Mosho
04:21
@SterlingArcher super dank metal, bro youtube.com/watch?v=qmyfDvHJ2L0
@ndugger SterlingArcher is afk: zombies
 
1 hour later…
05:22
why are most programmers like
let him type
like how do you say when your boss says
"eat dirt"
and you eat dirt
how do you call that kind of person?
you mean, obedient without question? or, asshles
05:24
Who the boss ? he is a jerk
or abuser
like when you say I want to scrape google and they're like "that's against their ToS how dare you"
sometimes I feel like SO is a bit too boss oriented
like you ask and then they're like why would you want to do that like who
who's boss would ask you to do that
i mean... that's more people want an excuse to say don't do that
rather than find a way to do it
"cause i just freaking want to" seems not to be an option
wanna scrape twitter... "purchase their api"
we should be a bit more hacker oriented I believe
cause then you'll find more and more generic answers and seems like a freaking government official API instead of an actual community of programmers like the kind of answers you get when you call anyone's support phone number
dude
we programmers are supposed to be rebelious
someone is going to take over SO I'm telling you
SO is becoming more and more like an Indian support phone line
Except a few answers by jon skeet and so
05:52
@Juan I'd say we have styles, but not necessary rebelious...
If young programmers are rebelious, I'd contribute that more to being young than being programmer.
06:26
Hey I have been reading Todd's article and I am kind of dont understand why he chose to use ngOnInit() instead of constructor. Also why he use "User" interface, it is hardly ever used and my application is running even without it. This is the angular 2 plunkr he made plnkr.co/edit/2PqF2yCRBA0BM4yuVqHa?p=preview
This is the article link toddmotto.com/angular-2-forms-reactive
06:59
angular doc is very incomplete XC
Maybe I am looking at the wrong docs XD, I should search in typescript
hosting angular 2 is so hard
but I finally did it
anyone review !!!
07:15
@AtharvaPandey Takes 1 minute to load and it used half up half of my laptop's battery in that time
:3 em no such problem on mine @copy your laptop is old
even on my phone it is opening smoothly
@AtharvaPandey Congrats
I also have one question, how u listen to changes to the values passed via Input decorator ?
@AtharvaPandey Not really, actually
@FlyingGambit thanks , I do that using ngOnChanges
still learning there might be some better alternatives to it
ok, thanks :)
07:46
that website made me lose it
Haha
:D @Shrek lol
also @AtharvaPandey your website takes 9% of my cpu on an MBP 2015 Late (and thats on Safari)
this chatroom takes less then that
hmm I am new to this i will try to make it less heavy next time
anybody else using OS X what is videosubscriptionsd ?
08:11
@Shrek it must be becaz of the particle effects
Guys, in angular 2, isDirty checks does not revert back to false, if user types something and deletes it. Is there a better way ?
 
1 hour later…
09:24
Why the heck are Slack + Skype taking more threads then safari :-|
09:41
guys
what happened to Treeline?
@Shrek Skype => because they are watching you
09:55
Like that is mind-numbing CPU Time
on an i7 D:
I'm worried if this is even skype
10:12
slack runs on electron, which makes use of all 8 threads that chromium gives as available
doubt that microsoft uses electron though
with slack it's ok, because the threads are usually very small in size
10:24
Is it possible to have fallback fonts in Canvas like in CSS? I'm talking about something like this: font-family: 'Open Sans', sans-serif;
@rlemon
I've missed you!
10:40
it is
but it's not in-built afaik
if I remember correctly, what canvas does is ignore the new font assignment if it doesn't recognize it
so you can have visual cueues as to whether the new font was applied or not
which may involve using a weird non-regular font beforehand, checking the width of a character, changing the font, checking the width again, and seeing if it changed
or actually, I'm dumb, you can just check the font again, no need for visual cueues
actually, this is a good occasion to create a library
11:05
See this link for recursion explanation. — Madara Uchiha ♦ 31 secs ago
.... I love you, and I hate you
// is this okay?
while( functionThatDoesSomethingAndReturnsATruthyValueBasedOnWhetherItShouldBeCalledAgainOrNot() ){}
I guess that ideally you'd have something like this instead:
// is this okay?
while( functionThatDoesSomethingAndReturnsATruthyValueBasedOnWhetherItShouldBeCalledAgainOrNot() ){}
while( fnThatChecksWhetherYouShouldContinue() )
  fnThatDoesSomething();
@towc What are you trying to do?
but what if the first function is actually very small? A "readability hack" would be to assign the result of the function to a variable, then while( variable ){ variable = fnThatDoesSomethingAndReturnsTruthy() }
but it feels unnecessary
but it feels unnecessary
I'm trying to make the context font fallback thing
I have a function that checks whether a font exists AND applies the font (because you have to apply the font anyway to check whether it exists)
so I'd provide an array of fonts, and if the first one doesn't exist (after applying it), check the next one, and so on, until either there are no more fonts to check, or an existing font is found
the while( fn() ){} works, but it feels like a huge hack
11:35
@towc Well
If it's wrapped in a low-level function that you just call with relative control over the side effect (for example, you render the text in an invisible canvas with the same context), it doesn't particularly matter if you use the impure function in a while loop thing.
11:53
@MadaraUchiha Any idea how to toggle submit button of a form (enable /disable) in ng2. blur event all input types seems ugly.
@FlyingGambit Why are you asking me all those Angular questions?
I've never used Angular 2
I don't intend to use Angular 2
oh lol XD, I thought you were currently developing angular apps
@MadaraUchiha ( ͡° ͜ʖ ͡°)
@MadaraUchiha May I know why ?
12:00
hahaha XD
@FlyingGambit because we use React because it is a nicer fit for us. Nothing inherently wrong with Angular2. It's just a massive framework for solving problems we don't all have in ways that don't work for everyone.
Well I am planning to pickup React projects after 6 months. Hope to see you guys answering XD
We don't actually answer anything you can Google.
If that was the case with angular then there would have been no point in joining SO
Some answers not easy to find in Google
like architecture and stuff
you're wrong.
you're abusing benji's willingness to help
12:04
@Mosho Ping
@FlyingGambit Stack Overflow is often what you find in Google
But chat is different.
Chat is about discussion, and if your question is interesting enough or trivial enough, you'll often get an answer.
But there's no obligation to get an answer here, even if it's well formed and researched.
That's what the main site is for.
Thats a good point
@towc oh no, no offense meant
12:17
@FlyingGambit this is the chat.
13:08
@KendallFrey not sure if you're into this kinda stuff youtube.com/watch?v=ZzpVhCL5aPg
13:23
I have an assignment due in like 13 hours, but - I need help creating a gallery type thing. I'm having issues because I am brain dead off of no sleep.

I'm new to Javascript, but I want to impress the professors.

This is my Javascript, you can probably see what I am trying to do. Use a loop to determine the images length. https://ghostbin.com/paste/a9sy8

Here is my HTML, near the bottom are the images. https://ghostbin.com/paste/u4kjm
13:35
Any mongodb guys in here?
I'm trying to source an 'official' mongodb database name, and collection name validation rule, e.g. a regular expression
Still trawling Google
Context - I've got a small app which allows the dynamic creation of mongodb databases and then collections
So naturally I want to validate that user input.
@LeeBrindley I'm not sure I'd let users do that
Why not?
What's the use case?
It's a personal project really. The project creates a database for each individual user sign up
That user can then populate their database with collections
The use-case for the project wouldn't be performance critical stuff, I won't be coding in the ability to add indexes to fields, etc
I spin up apps all the time for demos
SO i'd be a user of my app - It allows me to create a few collections and then interact with them via an API
Still think it's a bad idea @BenjaminGruenbaum?
Sorry, when I say app what I really mean is a database with an API interface.
If it's to learn mongo it's fine, but if it's for production share the same collection probably.
13:44
Care to give an explanation as to why you'd use a shared collection rather than numerous collections?
Just out of interest
Theoretically I can see your point, production could infer 100,000's of collections
But realistically, if it were taken into production I would foresee there being 10'000's of collections at most
Per install of each application server(s)
@LeeBrindley basically, that's the workload they optimized for.
Same reason you wouldn't create 100K tables in sql
Cached query plans won't be shared, indices, etc.
Yeah I see your point for the info i've shared
& I totally agree in that context!
14:07
Hey can anyone help me out?
Just a problem with push() and 2D arrays in JS.
user6820627
@Owatch Yes.
The short version of my problem is that I'm pushing a string to individual sub-arrays, but when I print the entire array, it's got everything duplicated everywhere.
Let me show you the snippet
You have references to the same Array
Rather than new arrays in the second level.
I do?
Show us the snippet and I'll show you where.
14:10
I've logged the function, it pushes to the appropriate indices. However, the output is something like:
[[a,b,c], [a,b,c], [a,b,c]]
When it should be more like: [[a], [b,c], []] for example
Array(7).fill([]); fills the array with the same empty array 7 times.
It's exactly the problem I've said, you need distinct references to arrays @Owatch
For example Array(7).fill().map(_ => []); // create a new array each time
Ah!
It's just 7 references to the same array in your code :) Happy coding!
I didn't know that it would use the same array.
Why would I ever want that anyways?
For value types (numbers strings etc) being the same reference is meaningless.
14:17
I guess so, yeah.
They should amend it to not do some for arrays in my opinion.
Also, while we're here. Would you know an easy way to attach a name or string to each array as if it was a tuple. Kind of like zipping an array of labels with this array of - arrays?
@Owatch sample input/output?
As in: ["A", "B, "C"] + [[x,y], [z], []] -> [ ("A" : [x,y]), ("B" : [z]), ("C" : []) ]
I remember Haskell has a function exactly for this: zip.
May I ask a pretty stupid logic question?
zipWith you mean
Can kind of see some functional stuff with the .map() you used above there. Wish it had this.
14:25
You have that in lodash if you'd like
Yeah, maybe it was zipWith
function* zipWith(a, b, fn) {
  const len = Math.min(a.length, b.length);
  for(var i = 0; i < len; i++) yield fn(a[i], b[i]);
}
Or if you can't use generators
function zipWith(a, b, fn) {
  const ret = [];
  const len = Math.min(a.length, b.length);
  for(var i = 0; i < len; i++) ret.push(fn(a[i], b[i]));
  return ret;
}
if I need to buy a cheap SLL cert; who would you recommend, just so I have one? I'll get a much better one later
What was with the asterisk after function?
Then you can `zipWith( ["A", "B, "C"], [[x,y], [z], []], (a, b) => ({[a] : b}))`
@Owatch that's a generator function
@ndugger letsencrypt is great and safe and free.
14:26
I'll skid in and go ahead and ask I guess
I'm confused on how to actually get a cert from them, though
Interesting, I've only got about a days worth or real time on JS.
@nonerth the rules are clear about that - don't ask to ask - just ask.
I have a number lets say 250.
I want to percentage increase that number till it reaches 100% in the span of 6 hours.
So if the number was 0, in 6 hours it will be 250.
So I want to create something an equation that'll get me the number providing the time in minutes passed from time zero, the 100% of the number and its current value
14:27
@ndugger there are plugins for most webhosts.
Well, spread over a week. It seems like there are so many ways to do things. Don't even know what generators are. I'll use the second one.
Thank you so much though.
@nonerth that sounds like a linear equation - the kind you did in middle school :) You have an angle (typically called m) and a "where do I start coeffecient" (typically called b)
Saving me a ton of time debugging this stuff, and doing things inefficiently.
@Owatch generators are producers of lazy iterations. It has a behavior more similar to the Haskell version (which I assume you're familiar with) in that it doesn't iterate the collection itself but just returns an iterator. Don't worry about it too much - generators are primarily used for this specific use case of implementing combinators :P
yep seems like a pretty simple problem, which unfortunatelly for me, couldn't solve the past 15 minutes
14:29
!!mdn generators
@BenjaminGruenbaum Something went on fire; status 403
@nonerth I'll give you a tip - the angle is the number you want (250) divided by the number of seconds you need (if the input is the current second out of that).
oke thanks
May I ask what fn() does?
I've Googled it, but it's a bit unclear.
Something about adding functions, or attaching method and JQuery is what I'm getting.
It's also a functional library for Javascript it seems.
Ah, it's a function I need to provide to return the object I want added. Didn't notice it was an argument. Okay got it.
14:44
@Owatch There's no builtin called fn()
@MadaraUchiha Yes I didn't notice it was a supplied argument, resolved now!
Step 2 of the installation says github.com/pleerock/ngx-popover "If you are using system.js you may want to add this into map and package config". I cant find a system.js in the CLI generated ng2 app. Where should I be using them ? In the angular-cli.config ?
Does anyone have experience detecting if a browser supports a specific Emoji?
There are a lot of scripts detecting emoji support it appears but that doesn't mean my specific Emoji is supported.
14:59
@Meredith literally xxx?
LIKE SERIOUSLY ?
@William That's generally not browser specific
But OS specific.
Hey madara!
15:18
I've got some question about Date. I've got a function called Monday which returns the past Monday of the current week.
function Monday () {
    var now = new Date();
    var dt = now.getDate() - (now.getDay() == 0 ? 6 : (now.getDay() - 1));
    now.setHours(0,0,0,0);
    now.setDate(dt);
    return now;
}
Now, if I write something like: var thisMonday = Monday(); I get an error.
I have to write: var thisMonday = new Date(Monday());
Why is this? Isn't now already an existing instance of Date? Why, when I return it, do I get something other than an instance of Date?
I don't see why, yet. What is the error you get?
Yeah it works for me too. Oops.
Maybe I had another error somewhere.
Owatch, You didn't ask, but I suggest a name like getMonday() as Capitalized identifiers are traditionally used just for class constructors in JS code.
As someone who has never done HTTPS before, this shit is complicated.
@ndugger Not really
Scenario?
15:28
I'm just rather dumb
@ndugger it seems like it at first, but it's not.
I have no disagreements with that statement.
Hey now
you're an all star
Did you see my reply about google cloud pricing?
Sure, I can make it getMonday
@ndugger I didn't
15:29
using letsencrypt?
Let me see if I can fetch it
Apr 6 at 13:10, by ndugger
@MadaraUchiha I have a screenshot at home that breaks it down a bit, but monthly cost was about $35 for an instance of postgres, an instance of redis, and an instance of node running in their app engine. Low traffic, so it seems a bit pricey. There's probably some caching/optimization I can do to help with this, but yeah, AWS is definitely cheaper
@ndugger This? ^
@Luggage Yeah, I used a UI to generate a key and cert
15:30
@ndugger What webserver are you using?
Nginx?
Honestly, I have no idea. I would assume so. I think I was a bit high when setting it up, I don't remember much of it, lol
@ndugger It's pretty trivial with nginx
You make your server block listen on 443 and add enable ssl, add the entries for the cert and key, then make a server block on port 80 that redirects to 443
!!help reminder
@MadaraUchiha Command reminder does not exist.
Remind me how to set reminders on cap? >.<
!!help remind
15:33
@Shrek Command remind does not exist.
!!listcommands
@Shrek help, afk, ban, convert, define, die, doge, eval, forget, google, hang, imdb, info, jquery, learn, listcommands, listen, live, mdn, meme, moustache, msdn, mustache, nudge, refresh, spec, stat, stats, summon, tell, unban, undo, unonebox, unsummon, urban, weather, welcome, wiki, xkcd, youtube, zalgo, !, !!, $.baby, (4337654<<1)+1, (y), /somecommand, 2020/07/23, 3, 666, :p, </pissing>, ?, ^, ^5, abesnacking, abhi, abhishekpornfreak, acronym, afsari, ah, ahah, algosmarts, aliens, am, angry
angryticks, annoy, apocalypse, appreciated, archerneat, artisticpoop, artisticsilo, asd, asdf, ashu
holy fuck
!!help notify
if that doesn't work then idk vOv
@Shrek Command notify does not exist. Did you mean: catify
Why doesn't nodeland have a proper sodium binding?
15:36
@ndugger an nginx config to forward non-http to https, configure certs for ssl, proxy node (w/ websockets): gist.github.com/luggage66/958d2470f2b9acbf8ed1ad1d15893b72
The php room bot has one that works.
!!help nudge
@MadaraUchiha nudge: Register a nudge after an interval. /nudge intervalInMinutes message, /nudge remove id to remove, or the listener, nudge|remind|poke me? in? intervalInMinutes message
the ciphers list may need to be more restrictive or remove TLS 1.0
Alias nudge as notify please
15:37
@Luggage I don't know if I have access to all that via google cloud. I have no idea what I'm doing, seriously.
ahh, ok.
did you just make a VM or are you using hosted services?
they have some weird animals in india
I think I set it up in their app engine
ohh, i didn't know that supported node, yet.
great white ass-face
15:39
looks like it does..
@HAT THE FUCK
@Mosho the fuck is that
@Shrek Panoramic picture gone wrong?
> Why doesn't nodeland have a proper sodium binding?
cc @littlepootis
15:39
anyway, i don't know about that. i only use plain vms
@littlepootis you tell me
@MadaraUchiha I'm wondering HOW
!!tell Shrek magic2
15:41
The world is way behind India when it comes to bipedal horse GMOs.
its a holy cow
you dumbass
*Cow
Maybe it's time you took a break Shrek. Seem a bit volatile there.
@Owatch let's have fun
I'm going to say a number
15:42
Pinging the wrong person.
ready?
no no, you're the right person
how is you saying a number fun?
so, ready?
@Luggage I don't know how you have fun
I'm being ignored
[censored]. Ohh and [censored] and [double censored].
@MadaraUchiha I'm up
15:46
are you serious? MS releases ReactXP
holy fuck
at least it's not ReactVista
I dunno if I should start to appreciate this or mock them for inconsistency
note the github.io
They have been hosting a lot of thier code on github
15:48
but docs? That's a first (that I've seen)
I don't know if it like ReactXP or not yet.. i need to read more.
But, I am hopeful as MS has done some nice things recently in the OS world.
Are there optional or default arguments available in JS?
function(arg) where arg = foo when arg is not supplied?
are they trying to take the technologies of every other company over in the heart of web devs, as an alternative to buying the companies?
@Owatch yes
@Owatch in es2015+, yes.
which means, depends on your browse support if you aren't using transpilers
practically everyone is using microsoft stuff to debug typescript, by google. Then they half-moved from .net by releasing electron applications, and if they now take over react, facebook won't have much to show for it
15:51
typescript is by MS too
google uses it for angular 2, which may be your confusion
oh, I thought google used it a lot for internal stuff too
and they mostly encouraged the use of ts
i have no info on google's other use of it, but MS created typescript.
TIL
Think I got it.
Found this example.
function multiply(a, b) {
  b = (typeof b !== 'undefined') ?  b : 1;
  return a * b;
}
I'll just replicate it.
that's bs, there are definitely better ways
well, depending on your usecase
look at mdn for default arguments
15:53
function multiply(a, b = 1) {
  return a * b;
}
This then
and if you don't want to use transpilers and support es5, there are also some good ways
google "es5 default arguments", you'll probably find something
but most of all, notice how easy it is not have to be spoonfed, if you're willing to put any effort into it
My reaction to ReactXP after poking through docs: Meh.
@MadaraUchiha so what did you ping me for
@Mosho תודה הסתדרתי
00:00 - 16:0016:00 - 23:00

« first day (2367 days earlier)      last day (2806 days later) »