« first day (3203 days earlier)      last day (1967 days later) » 
02:00 - 15:0015:00 - 22:00

02:09
morn!
 
2 hours later…
04:51
this is a stupid question
when a function has a parameter but you need a value from that function
so you return it. how can you call the function and not deal with the parameter
 
2 hours later…
06:30
Hi, I have a question in integratiom from API (node js) to JS (HTML page).
I created an API that return a link to download zip folder. like:
this.response.setHeader('Content-Type', 'application/zip');
this.response.setHeader('Content-Disposition', 'attachment; filename='+success.folderName);
this.response.write(success.folder, 'binary');
this.response.end();
In the HTML page I call the API by ajax and I want to download the folder.
1 message moved to Trash can
@MRah Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
@MRah you can't
you can only download files.
Archive the folder and send it instead.
@KarelG Thank you for your response, In the swagger its working well.
Just in the HTML it is not working
Archive the folder and send it instead. - Do you mean to download folder in the API instead of zip folder?
07:02
0
Q: merge two buttons to save two images

vickey colorsWe are displaying box image & mask images by fetching json. User will click on Mask image & upload their own image. Onclick button Save A , User uploaded image will save. Code1 in Jsfiddle Onclick button Save B , Mask + User Uploaded image will save. Code2 in Jsfiddle Requirement ...

07:39
@KarelG can you please check above link once....
@vickeycolors that is a huge post
@KarelG i wrote only little code, as i posted more images , it looks huge.... please take some time and can you check once....
@vickeycolors seems a problem from PHP on first sight
it has a max limit for uploading files
so, check the info file and verify if you can upload above 500kb
@KarelG here is php.ini : pastebin.com/QtKNZhK4
> ; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 3000M
> post_max_size = 30M
The later should be the limit.
07:55
@geisterfurz007 thanks, yes i gave same values as you said.....
 
1 hour later…
08:59
it already starts to look like dogs
I call it the CreepyGAN
09:28
you only have added color ...
@vickeycolors I don't have many time atm because of some server downtime here. You have to check why 500kb cannot be uploaded. The problem is not at PHP. Compare your savec function with savea and saveb since you said that it works. Might be a problem with headers. Or something subtle.
@KarelG thanks you are helping me even when you are busy, i merged savea and saveb functions and added in savec, may be i am doing some wrong there..... but i am not getting what wrong i done.... when you get free time , please check code i posted in question once.....
@KarelG for one image, i am passing through ajax - > savec.php
for another image, i am passing through form - > savec.php

will that create any problem ?
might be. It depends how your are sending your data.
if enctype is same, ensure that content-length is correct as well.
multi-part requests should have a correct Content-Length header
@KarelG sorry, i have no idea about content-length
that is a header to indicate "this request is x bytes long".
when the server gets it, it keeps collecting all bytes until x is reached
@Neoares well done
09:43
@KarelG yeah isn't it nice?
but if you focus you can see some puppies
like really really well done
keep it up and you'll get all the pictures you need to scam women
in believing you have puppies
come on, look at the second pic
:c
I did, it looks good
next up you'll have a facebook farm in no time
then you can sell your tech to scammers
that can generate users 😀 using your GNN!
#LetsKillFacebook
that is easier than generating dog images
Not really
facebook showed in a BBC Documentary (they funded)
HOW ********AWWFULLLLLYYYYYYYY**********
09:51
@ShrekOverflow fb has an interesting strategy to block users
hard it is in such bad world
one company trying to prevent
fraud and scam and get people to donate blood but how people mis-use it
and governments screw them
@KarelG They have an entire team dedicated to detecting fraud users
I had two accounts, one for legit use and another one for foolery. Eventually the second got blocked. They fingerprinted my laptop that I have been using for that account. I cannot access it with my main.
how do you get scammed for donating blood?
that uses AI to detect it
@Neil Be Indian
ffs, does there have to be a black market for blood?
09:52
Makes me sick, how pathetic people have to be, but I'd expect nothing more TBH
if there is a black market for anything, it is a sign that the government is not doing something properly
In this case its doing nothing properly
usually black market is reserved for illegal objects, but if it is legal, then they need to seriously re-evaluate some things
Well FWIW I'd never visit an Indian hospital, I am terrified to become more sick than when I am when I visit. The govt. owned hospitals are just absolute terrible
you don't ever want to go into any hospital government-run
in any country
09:56
@Neil trust me --- it's a special kind of bad
even in that circumstance
if you have all your limbs and you aren't actively bleeding on the floor, wait times can be up to 6 hours during normal operating hours
like there are literal govt. runs hosp. with stray dogs in the place
@Neil So Ebola gets priority service?
In Italy, they passed a law saying that they can't kick out patients from the hospital.. so naturally hospitals are makeshift homes for the homeless
you'll see cardboard boxes set up in the halls of some italian hospitals
@Neil Dear lord
it's a farce
09:58
Ok i'll tone it down a bit
govt. of India def. has more pressing conerns in healthcare
well my point was mainly that healthcare doesn't work well in any country really
like revamping homeopathy and other alternative medicines timesofindia.indiatimes.com/india/…
if it is not too expensive, it simply is inefficient
@Neil Not really
It's what you want your healthcare to do, less it works or not
Do you want to help people or do you just want to have healthcare on paper. Many govt. optimize for the latter.
@Neil please allow me to correct that :o
10:01
@Neil Although I wonder now if there is a blackmarket for well Homeopathy in the US?
@KarelG ?
some countries have good public hospitals
ok now I'm getting better results
just by tweaking some hyperparameters
like you said, @KarelG
ah and I also halved the number of kernels in the convolutional layers
So does this look OK


// @sigh/Foo/index.js

import Base from '@sigh/sigh';
class Foo {
   ... more stuff here ...
}
export default Base.register(Foo);


// In @sigh/Bar/index.js Bar is derived from Foo

import Foo from '@sigh/Foo';

export default Foo.register(Bar);
Foo must be parent of Bar for register to work
@Neoares Show?
Comon I want to see the puppy!
(or the whole pack)
maybe live-stream pictures here 😃
I still haven't finished but ok
10:12
nvm
I am
but there is still a lot of margin I guess xD
the problem is that I'm working with 64x64 images
I mean I am manually reducing them
maybe try 640x640?
but I plan to move to 128x128
@ShrekOverflow not so fast
10:15
What are you rengar?
that'd make the network slower, and my not work properly
What is the final resolution ?
4K ?
8K ? 16 K?
@Neil Ever been to France ?
@Baldráni several times, yes
I haven't had the pleasure of experiencing the hospitals in France though
how are they?
Best healthcare in the world :) I've been to hospital probably 20 time (I do not count anymore) and was allways happy with what I got for mainly nothing
They saved my life at least twice
10:22
then I stand corrected
However I can't speak for other countries
@ShrekOverflow whatever I want/can
@Neoares 16K
@Neil I am so scarred by Indian hospitals I have issues going to the UK ones
which are much better -- by several orders of magnitudes
I cam here for a question :
What would you choose between em or rem ?
One of my colleagues use only em in a vuejs project and I use only rem and we are conflicting.
I don't see the point of em since you need to be absolutly sure of not touching the parent. (correct me if I'm wrong)
10:24
use rem
use the REM
I do it all nights
Arguments pls ^^ even tough I wanted someone to tell me why em is so great
REM is the same as em except it’s always calculated from the html font size.
em will always take whatever size you have locally
and you'll fuck up
That's me in the corner.. that's me in the spotlight.. losing my religion.. ♫
That I know.
And I plain on changing html root size for responsivenes
But I guess
If I change root font
It will change em font too so no specific impact after all
10:26
You both should read this article together zellwk.com/blog/rem-vs-em
2
and then decide which one suites your needs better
Oh and don't forget the cascading nature of css
to illustrate

.p4 {
padding: 4em;
}
call me old-fashioned but I still use px for fixed length stuff
The padding will be all over the place
@KarelG never again unless its 0px * 0px
dynamic content: vw
^
all content is dynamic content
not really
10:29
unless you work for a bank (bank here means a non-scaling website)
then its not
you don't want to have a dynamic font-size lol
Why not?
I use a higher font size on my browser
it does not have to scale with your viewport
and absolutely hate websites that don't scale accordingly
._.
10:30
I want larger fonts not zoom into to the entire page
@KarelG well actually it does
then provide a font-size tool
16px on a monitor 32" 4K will look tiny
someone here provided a magnific icon so that people can adjust the font size at their own preference
@KarelG There was some demo someone did which adjusted font by your head distance
I prefer setting my fonts and sizes in browser
because of multiple different screens
that is what he implemented :)
10:31
otherwise it just looks ugly
That is how it should be
but screen size is a good recommendation for that too
let me write on that some other time
in pixels or inches? :P
IMO though if the user's browser is yelling at you for a slightly big font size -- go for it
inches - (if yotu really want it to be surely 1 inch / how yu see it) - the OS / Browser can figure out how big it'll be
i'll stop trolling
@KarelG is it possible for you to set up this code in your server and check result ? or is there anywhere i can upload files and check online. html: https://pastebin.com/K15nq9kE

php : https://pastebin.com/AtZ8ePJF
use your own setup duh
@KarelG i tried in our server, but images uploading sometime and not uploading some times.....
10:42
it works for small sized images right?
thats true
something is blocking big file data, so I thought that your php.ini is just not good
but it seems that the limit is at 3000kb
yes, right....
so it is not that.
do you use .htaccess file?
see if the size is not limited there
you have to check your setup
your code is working. It is the server that just don't accept files > 500kb
okay, i dont have much idea about server related things, i will try to find .htaccesss file....
10:44
I cannot do much unless giving pointers where the problem might be.
11:37
hola
I have an issue with accessing a variable
 @ViewChild("botWindow") botWindowElement: ElementRef;

    tempToken = '';

    constructor() { }

    public ngOnInit(): void {

       console.log('test')
        var xhr = new XMLHttpRequest();
        xhr.open('GET', "https://webchat.botframework.com/api/tokens", true);
        xhr.setRequestHeader('Authorization', 'BotConnector ' + 'VQDSUGBn3Lo.SxWHKP4UXAvJWZaLXkUQGBABH4sjZU3NIjeesJnmW-g');
        xhr.send();
        xhr.onreadystatechange = processRequest;

        function processRequest(e) {
I need to obtain a value that is set in processRequest. I tried wrapping the directLine function in the processRequest but then the Viewchild botWindowElement becomes unavailable
12:04
anybody here
12:24
private findMatch(entry: Entry) {
    for (let i = 0; i < this.unmatched.length; i++) {
        const record = this.unmatched[i];
        if (record.isRelated(entry)) {
            this.unmatched = this.unmatched.slice(i);
            return record;
        }
    }
    return null;
}
Is there a better way to this? or is this a fair use of the old style for-loop
@ChristianMatthew No idea what you are trying to do
@ShrekOverflow this also modifies this.unmatched?
to do this, you can't use forEach, but you can also do this without the side effects
Yes, @Neil unmatched is a stack
return index of match and simply remove it afterwards
you can also do it in the same function so this.unmatched remains stack-like :P
Then I could probably just use findIndex
this.unmatched.findIndex( u => u.isRelated(entry));
yeah
I think it's more succinct that way
12:30
Basically my issues is that these are nested handshakes
some of which can finish out of bound
how could it fall out of bound?
Think OAuth 2.0 :P
code grant's token call can happen on the server
which itself might be inside another handshake / transaction
I can't believe I"m the only one running into this problem: stackoverflow.com/questions/57173413/…
I mean I can't be the only one who wishes to use polymorphism and have a sane this parameter.
@ShrekOverflow if you find the index, and then update this.unmatched before returning this.unmatched[index], why is this not a valid solution?
I don't think I understand what you mean about itself being inside another handshake / transaction
@paul23 that is not the same as a class method
you are declaring a class property not a method
@Neil d/w I think I should keep findUnMatched to do what it says and also not adjust the stack
12:35
Yeah I "get" why the problem occurs, however if I make it a class method this is just all over the place (and I can't bind this while keeping super chain in tact)
@ShrekOverflow I think it would be better. it's not obvious that it has side effects by the name of the method
I changed the method name to takeMatching
only takes the matching 😛
I'll leave the unmatched in there for now and cleanup if & when needed.
    private takeMatching(entry: Entry): IRecord {
        const index = this.unmatched.findIndex(
            (record) => record.isRelated(entry)
        );

        if (index === -1) {
            return null;
        }

        return this.unmatched.splice(index, 1)[0];
    }
so something like this now
12:54
Good Morning Tavo
morning? what is that
you mean morn?
hi
Is there something glaringly wrong with the way I start this http-server?

`http-server ./certs -p 9091 --cors -S -C ./certs/cert.pem -K ./certs/key.pem -o`
when it opens in chrome it says page can't be found..but I'm sure I've used this same command and flags with success before
curl -v <url> pls
@paul23 what's up with this? stackblitz.com/edit/react-abwjz5
13:05
This is a pretty cool website: linuxjourney.com. Source
Well if you then pass foo to a callback the this of the foo is no longer what one would expect (late binding).
$ curl -v 127.0.0.1:9090/react-native-typescript-boilerplate
*   Trying 127.0.0.1...
* TCP_NODELAY set
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* Connected to 127.0.0.1 (127.0.0.1) port 9090 (#0)
> GET /react-native-typescript-boilerplate/ HTTP/1.1
> Host: 127.0.0.1:9090
> User-Agent: curl/7.63.0
@ShrekOverflow a 404
< HTTP/1.1 404 Not Found
don't you mean to try
curl -v http://127.0.0.1:9090/
So now I have a question
How do I chain generators 😃
(Node streams would be great here)
I have two generators, one of which transforms the output of one
@paul23 But then you'd just arrow the callback function
something like

for await (const el of blah.data) {
otherBlah.add(el);
}

otherBlah also has .data
13:09
$ curl -v 127.0.0.1:9090
*   Trying 127.0.0.1...
* TCP_NODELAY set
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* Connected to 127.0.0.1 (127.0.0.1) port 9090 (#0)
> GET / HTTP/1.1
> Host: 127.0.0.1:9090
> User-Agent: curl/7.63.0
> Accept: */*
>
< HTTP/1.1 302 Found
< server: ecstatic-3.3.2
< location: //
how do I chain em? They are both async
@ShrekOverflow I do get a 302 pinging the host..meh must be just a flag I haven't set correctly
Yes but this is the callback function. foo is passed around to do things. I've worked around it by deliberately no longer using callbacks for this.
@BrianJ It's asking you to goto // weird
o.o
13:10
But you can't pass foo to say an event handler
@ShrekOverflow in which context is that "generator"? function* ?
yep function *
basically it'd be great in node streams
foo.pipe(bar).pipe(baz); style
lookup for yield *
Dang I have to still get diner yet the temperature keeps rising.
with that you can delegate to another generators
13:12
No
That's not transform though right?
foo.pipe(bar).pipe(baz); imagine bar and baz are both transform streams such that they store data for something and then do something else, eg chunk / compress?
it is weird, gonna try a different npm server package
It's already 35 degrees how am I going to run to the shop this way :/
say for example fs.readStream('./txt.bar').pipe(chunker(32)).pipe(encode('some'))
How'd you write that using generators? @KarelG
why are you using generators for streams?
^ That is a good question
I am wondering if that is possible, I don't think generators are the right solution for this case anymore.
Basically I have packets of data which I need to make sense of as they arrive
this may happen in order
Generator imo will block the order
13:19
I would promisify it :|
Promise will block
yeah
I dislike that idea lol
You can convert a stream to say an observable using generators, then use RXJS
But I wouldn't try using them directly
Observable sounds like a better approach for this
13:24
is that for node.js or browser js?
might be an important question xD
13:46
Hi altogether. Is this room also for TypeScript?
yes
There are some TS users around, so yeah
Ok, great.
VS Code thinks that this class is ok, but TSC says it expects an identifier at 6,37
I expect color to be a tuple

class Card{
    color_rgb: number; // Hex RGB, e.g. red or black for a regular card deck, but maybe colorful
    color_symbol: string; // Spades, Diamonds, Clovers, Hearts or similar
    value: string; // 7, 8, ..., J, Q, K, A or an own choice

    constructor(value:string, color:[string, number]){
        this.value = value;
        this.color_symbol = color[0];
        this.color_rgb = color[1];
@ThomasWeller Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
@CapricaSix: it seems I never posted code for all this years I'm lurking around in chats
Thanks for the hint
14:00
hi, welcome to stackoverflow
> Member for 8 years, 9 months
he's not exactly new
In chat since 2013. Mostly the close votes chat, however.
what happens when you define the tuple type before?
I don't really know TS very well, but isn't something like

`let tupleType = [string,number];`

possible?
14:02
@GNi33 Yes
and then use color:tupleType in the constructor
That works, exactly as you think it does.
guess it would be nicer using an interface though, right?
Wait, no that's not right
type TupleType = [string, number];

const x: TupleType = ['foo', 42];
but could you use TupleType as typehint in the constructor then?
14:13
@MadaraUchiha that is so accurate
type seems better than let. But still, no matter where I put it, it does not compile. It now expects a ; right after type.
Maybe I should go without tuples for my first project
@ThomasWeller I'm going to guess that VSC uses a more advanced version of TypeScript, that support tuple types.
And that your CLI version of TSC is older.
Try tsc --version
And look at the bottom right of VSC to see what version it uses.
1.0.3.0
That seems to be rather old. I see SO answers from 2015 mentioning 1.3.0.0 already.
seeing that the latest version is 3.5, I'd agree
Ok, thanks for your help. I'll figure out how to use a newer version.
14:32
@GNi33 he's new to this chat
plus, that was the joke
ur a joke
I missed you @Neoares, how's things?
good, I recently finished the master and now I am looking for a job
@ThomasWeller 1.0.3.0? wat
as data scientist
TypeScript versions are 3.x.x
2.x.x if you're really out of date.
14:35
@BenFortune how are things here? did they change a lot from past year?
I see towc is MIA
I see him every now and again
oh true, he was in the UK
I'm not active here really
is he ok?
@MadaraUchiha he likes vanilla
@Neoares You don't generally see a lot of those
it's sort of a niche job, but I understand if you're good at it, you're well-paid
14:40
Ok. Seems all Visual Studio installations since VS 2013 all added their Typescript to %PATH%. That way I had many versions, but 1.0.3 being the first to be found. I removed all but the last and I'm now on 3.1.2.
Thanks!
@Neoares last time I have seen him was he's busy with getting a visum to USA
@Neil job positions?
@KarelG really?
is he pursuing the american dream?
@Neoares for a data scientist, no
hi I am trying to access a variable in angular that i am having trouble with
just use jquery
14:52
stop
HAMMERTIME!
lol
i am looking to use the variable provided by this xhr request
console.log('test')
        var xhr = new XMLHttpRequest();
        xhr.open('GET', "https://webchat.botframework.com/api/tokens", true);
        xhr.setRequestHeader('Authorization', 'BotConnector ' + 'VQDSUGBn3Lo.SxWHKP4UXAvJWZaLXkUQGBABH4sjZU3NIjeesJnmW-g');
        xhr.send();
        xhr.onreadystatechange = processRequest;

        function processRequest(e) {
          console.log('rest ', xhr.readyState)
          console.log('rest ', xhr.status)
          if (xhr.readyState == 4 && xhr.status == 200) {
however I can't wrap said function in the request because the viewchild becomes available
export class AppComponent implements OnInit {
    @ViewChild("botWindow") botWindowElement: ElementRef;
@Neil well, that'd be in your city
in barcelona there are plenty of them
@Neoares ok, well could be. If I'm basing myself on empirical evidence, not a lot of data scientists
02:00 - 15:0015:00 - 22:00

« first day (3203 days earlier)      last day (1967 days later) »