« first day (3175 days earlier)      last day (1766 days later) » 

user1596138
4:05 AM
^ I got more rep than 1.6k and I'm a idiot @jbis
 
user1596138
Have you seen the 500K rep guys? Those guys questions/answers are generally hilarious 😂
 
4:24 AM
@DJSpud lol
 
5:09 AM
this task came sudden so my library is at pending now
0
Q: D3 X axis date and time transition from data with line

ARr0wSo far i was capable of creating this chart. I have also attached the sample data on the fiddle you can View by clicking here. It is build based on D3 V5 function timeValueLineChart(data, timeDuration, elem, dataKeyForXAxis, dataKeyForYAxis, domainRangeForYAxis, allowRedZone, fnTickData) { ...

will gladly appreciate the help, thanks.
 
5:30 AM
anybody here ?
 
@amitavamozumder Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
how to access request data after a ajax call finishes ?
 
@BasheerAhmed ew. Don't suggest w3schools
 
@JBis They provide easy documentation for new bie
 
5:35 AM
Almost always incomplete, and many times inaccurate information
 
i mean to access request data send as post body, AFTER the call finished in success
 
@amitavamozumder Google has tons of answer to this simple question
 
@amitavamozumder
722
Q: How to make an AJAX call without jQuery?

disckyHow to make an AJAX call using JavaScript, without using jQuery?

 
@JBis Are you front-end dev?
 
Both, but I prefer back end
 
5:39 AM
new to front end.
 
@JBis What language do you use in back end?
 
Node.js/PHP for web stuff
 
but i'm getting no variable called XMLHttpRequest after the request done
 
@amitavamozumder send your code, format with CTRL + K
 
@JBis any public library?
 
5:40 AM
@BasheerAhmed wdym?
 
@JBis I mean do you contribute to any public repo?
 
I have a couple projects, yes.
I made a bot for SE Chat → github.com/jbis9051/JamesSOBot. You can talk to him here, if you want.
 
1 message moved to Trash can
@amitavamozumder 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
 
@amitavamozumder Paste it in chat, than select all and then Ctrl + K
 
RSVP.Promise((resolve, reject) => {
 Ember.$.ajax(`abc.com`, {
   method: 'POST',
   data: {
   abc: 'de'
   }
 }).done((response) => {
   //need aceess abc here
   resolve(response);
 }).fail((response) => {
   reject(response);
 });
});
 
5:45 AM
@amitavamozumder Are you use ember?
 
as u can see. yes
@BasheerAhmed please give me the one of the 'tons of answers'
 
@amitavamozumder I don't know about Amber but rather just AJAX and that's just simple
 
ok, tell me the object name.
 
@amitavamozumder I have never used Ember but I suggest looking at this → guides.emberjs.com/v1.10.0/wip/basic-ajax
It appears it uses jquery in which case look at this → api.jquery.com/jquery.ajax
$.ajax({
  url: "test.html",
  context: document.body
}).done(function() {
  $( this ).addClass( "done" );
});
If you just want a GET request then use jquery get
 
i want REQUEST OBJECT in .done()
 
5:51 AM
@JBis Don't you work with any org?
 
waves the hand
 
@BasheerAhmed wdym?
 
@JBis stop singing justin bieber's song in shorts.
 
@amitavamozumder Take a look at $.get → api.jquery.com/jquery.get
$.get( "ajax/test.html", function( data ) {
  $( ".result" ).html( data );
  alert( "Load was performed." );
});
 
@JBis I mean "Please Hire Me" in your bio :D
 
5:54 AM
Basheer, your name is more of DESI
are you desi?
 
@BasheerAhmed lol. No, I don't work for anyone.
 
:46599601


    $.ajax({
      url: "https://fiddle.jshell.net/favicon.png"
    })
      .done(function( data ) {
          console.log( "Sample of data:", data );
      });
@ARr0w hahahha :D
 
@BasheerAhmed Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
Yeah I'm
 
@BasheerAhmed what is this? console && console.log? Theres no need for that.
 
5:55 AM
everyone is accessing response data :(
no one is accesing request data :'(
 
@amitavamozumder what data from the request do you need?
 
@JBis I just pasted the snipped from Jquery api
 
data on body.
 
@amitavamozumder The body is part of the response, not the request.
 
no the response body. request body
the data u send in post
 
5:57 AM
@amitavamozumder That's way simple. Just declare a variable outside of ajax call and then use that variable inside done function
 
@amitavamozumder Ohhhh, you want to send data?
 
@amitavamozumder Your question is way too complicated. Just make it simple and then ask
 
outside call is not an option. multiple calls happening with different context.
 
@amitavamozumder
86
A: how to send multiple data with $.ajax() jquery

JasperYou can create an object of key/value pairs and jQuery will do the rest for you: $.ajax({ ... data : { foo : 'bar', bar : 'foo' }, ... }); This way the data will be properly encoded automatically. If you do want to concoct you own string then make sure to use encodeURIComponent(): ...

use the data key in $.ajax
 
5:59 AM
for example:
$.ajax({
    url: "ajax.aspx?ajaxid=4",
    data: {
        "VarA": VarA,
        "VarB": VarB,
        "VarC": VarC
    },
    cache: false,
    type: "POST",
    success: function(response) {

    },
    error: function(xhr) {

    }
});
 
I WANT TO ACCESS VarA inside success
how you guys are not getting this? you're developper for god sake
 
@amitavamozumder Where is VarA declared, you can just access it directly.
$.ajax({
    url: "ajax.aspx?ajaxid=4",
    data: {
        "VarA": VarA,
        "VarB": VarB,
        "VarC": VarC
    },
    cache: false,
    type: "POST",
    success: function(response) {
         console.log(VarA)
    },
    error: function(xhr) {

    }
});
 
i wish i could.
 
@amitavamozumder Show your real code.
@ARr0w welcome o/
 
@JBis but i didn't say thank you.
 
6:03 AM
can't show real code. anyway going to quit my job kill myself. I am a shame in MS
 
-_- I was welcoming you to the chat
 
anyway, Hello, thanks for welcoming me ^^ just messing aroudn @JBis
@JBis it was a pun.
 
@amitavamozumder Sorry, it's difficult to help when I can't see code. Good luck :)
No worrys @ARr0w :)
 
@amitavamozumder before you go and kill yourself, are you good with d3 stuff?
 
@JBis He already showed his Amber js code and that's what he really is looking for!
 
6:06 AM
@BasheerAhmed Its Ember, and according to the article it uses jquery, which I also provided a link for.
 
Ember or Amber whatever but the context vary and he might not be able to access what he wants in the "done" function
 
@ARr0w Don't ask to ask. Just ask your question. If someone knows the answers and is interested they will respond
 
@JBis alright man sorry
 
@JBis Gotta run now :D
 
gtg also cya \o
 
6:10 AM
ew cya
 
6:23 AM
@MadaraUchiha In React? Wouldn't you prefer to maintain a state and do it React way for show/hide instead of doing manual DOM work using selectors and all?
 
6:33 AM
*pokes* Hi towc
 
heya
so, I'm looking into how hard it would be to get to the US, and I'm compiling an ESTA form, which if accepted would grant me 90 days
this is in it:
> You may not apply for: 1) a change of nonimmigrant status, 2) an extension of stay, or 3) adjustment of status to temporary or permanent resident, unless eligible under section 245(c)(4) of the Immigration and Nationality Act. Violation of these terms will subject you to REMOVAL.
so, while in the US, I can't apply to stay longer? What?
that's kind of a bummer
 
that got abused in the past
 
maybe I can cross the canada border, make another application, and go back, and that counts?
 
eh they track your applications
but you can request a tourist visa which grants you access for 3 years AFAIK
 
right, but what's one supposed to do if they're not sure how long they want to stay in the US?
oh
can I apply for that while on ESTA?
 
6:37 AM
yes. I used that tool (B2 is the name I think)
 
oh yay!
thanks
what's up with you anyway?
 
btw, that time period is dependent of various factors. A friend of mine only got a year. Maybe he did something bad :P
I am pretty fine. Got a nice vacation in Italy few weeks ago
now back to work. And to realize that I have a lot spare time lately. I am just being at home playing games 😕
( AC: Origins is just wow )
 
6:49 AM
another thing the form says is that I can't accept unauthorized work
wonder what that means
 
@KarelG whereabouts in italy?
 
is that "unless authorized by the immigration authorities" or "unless authorized by the US government in general"
 
I'm something of an Italian myself, you know. ;)
 
@Neil checked the whole island Sicily with bicycle (4 days) and some relax near Catania
 
@KarelG nice
I've never been in Sicily, but I've been all over Sardinia
 
6:54 AM
@towc read it as "accept to work for an entity while you are authorized to accept work by (fill in department name because I don't know which one)"
just check the etsa site, they have all info you need
 
I've always been a fan of the assassin's creed games
some have been better than others, but I can honestly say none were bad
 
@Neil a lot greek influence. That is unexpected
 
Even the first, as redundant as it was, it was amazing from a graphical perspective at least
 
oh, I thought that was "Air Conditioning: Origins"
 
user3578082
I have a small MediaWiki website and some articles need footnotes - automatically numbered in a list in a dedicated section ("Footnotes").
I found no SO session on how to create such a feature in HTML-JavaScript (a bit surprising I must say).
Does someone know a good article? I found none in Google for vanilla JS.
 
6:56 AM
@towc Now that would be either a very boring game or an absolute epic game
 
btw towc, those departments are INA or USCIS. See uscis.gov/policy-manual/volume-7-part-b-chapter-6
 
oh my
 
just don't do work.
@JohnDoea This question is kinda open-ended.
usually these footnotes are created and included when building the html page at the server
 
@KarelG well, how do I not starve to death?
 
hello
 
7:15 AM
@towc "tourist" means that you are there for vacation.
 
huh, I tend to pay for my vacations while vacationing
 
well, apply for a permit to accept temporary work
get that first. If you got it, you can ask B2
and include that, with an argument that you want to stay long and want to fund your vacation from time to time with temporary work
not sure if that would work tho.
use the contact info
 
right, you're not my agent
thanks for the info :)
 
@ShrekOverflow did you have gotten a work permit for USA before? If so, maybe you can assist towc?
 
as an indian national, I assume it's much more difficult
 
7:28 AM
most illegal immigrants fly to america under the premise of work or vacation only to simply not leave
So my guess is that that has a serious impact on how many immigrants they allow to enter at a time
 
that is why they are so strict with it
my country has a visa exchange partnership with USA, allowing us to request visa more easier
 
well, that sucks
 
Hey, can anyone share some input regarding stubbing pouchDB get() and stimulate it to return error and document object?
 
@NieSelam Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
7:39 AM
IE supports object.keys but not object.values.
 
 
1 hour later…
8:41 AM
@KarelG hello buddy.
my halted due to perform sudden task
 
o.o?
 
9:21 AM
hey guys, could anyone help me with this? im trying to create select2 boxes but this code is only giving me standard selects, anyone able to help? pastebin.com/70mHkZuK
 
@Harry that should work
 
i thought so too but im not getting the same style of box as the documentation shows
 
I tried to fiddle it up but I get an error. Do you?
(check console)
 
JQUERY IS NOT DEFINED
/caps
 
you are using an older version btw
errm I am.
*sips from coffee*
 
9:28 AM
hahah
 
still an error a.isArray is not a function (from select2.min.js)
 
im getting TypeError: $(...).select2 is not a function
 
Because I know you are always reading: Thanks Madara for the mobx help and stuff! I get quite a bit of stuff working now with it. I only forget to make the components observer but that's all ^^
 
@geisterfurz007 I don't think that he would have problems if you pinged him for that. Also, if you don't ping him, he might miss that message
 
9:43 AM
@SkariaThomas Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
You need to add the below code to avoid the error. <link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.7/css/select2.min.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.7/js/select2.min.js"></script>
 
9:57 AM
I am always so uncomfortable pinging a mod O-O
 
you mean like this?
hey @MadaraUchiha, did you notice giess' message?
 
@Wietlol Nope
 
ah, well, too bad
 
@geisterfurz007 Cheers :)
 
@Wietlol kinky sounds.
 
10:09 AM
0.o?
 
o.o
 
10:31 AM
ah. <- kinky sounds
nevermind. I am not gay
 
10:42 AM
...
 
...
 
10:53 AM
...
 
11:04 AM
1 message moved to Trash can
@RaheelAslam 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
 
Sorry
Hi I am using require.js for import and export
but its not working i want to work using manual
require js not npm
here is script
https://hastebin.com/vegajiwowe.js
 
Hint: It's in the name
RequireJS uses require, not import
 
this.subscriptions
  .filter(sub => sub.route === route)
  .filter(sub => sub.stompSub !== undefined)
  .forEach(sub => sub.stompSub.unsubscribe());
In this statement, is there any way I can convince TypeScript that sub.stompSub is not undefined in the last line?
 
but how to use import without setup webpack or npm . only include the file. is any way to do this ?
 
11:17 AM
There probably is some babel thing to transpile import and export to require syntax
 
There is, but that requires NPM
You can use ES6 modules, assuming your version of the browser supports it.
 
Because my chrome version does not support import and export.
 
Then there's your answer. You need to transpile your modules or use require
 
<script type="module" src="m_1.js"></script>
@BenFortune use require ??
 
The syntax, instead of import.
 
11:27 AM
I know I could use an additional if in the forEach part and remove the second filter but that looks kinda bad. I like the cleaner look of the three calls below each other more and was wondering if I could somehow preserve that.
 
anyone know of anywhere to review and comment on a techtest?
 
@geisterfurz007 Add a .map(sub => sub.stompSub) stage.
 
Madlad <3
 
this.subscriptions
  .filter(sub => sub.route === route)
  .map(sub => sub.stompSub)
  .filter(stompSub => stompSub !== undefined) // or typeof stompSub !== 'undefined'
  .forEach(stompSub => stompSub.unsubscribe());
 
should you not merge both filters?
 
11:32 AM
Still says possibly undefined
 
@geisterfurz007 could be a compiler problem. Use that null assertion thing to get around that
 
just got been given feedback from recruiter on one, and apperently ive not done well - but they wont tell me why etc
 
That also doesn't sound like the cleanest thing ever :D
But yeah I guess in this case I got no chance, I guess?
 
ask first if that warning is an issue or not. It is high likely a problem from TS itself
 
11:37 AM
It seems like we have to create a typeguard specifically.
 
@KarelG It's a project I am working on my own for myself currently. But as it is an error, it is a problem :D
 
eh, TS should be capable to detect that correctly.
 
@KarelG It does, when it isn't a function.
const x = Math.random() > .5 ? undefined : 5;

if (x !== undefined) {
  // x is number here
}
But
const x = Math.random() > .5 ? undefined : 5;

const exists = x => x !== undefined;

if (exists(x)) {
  // x is still number | undefined here
}
That is because it can't connect between the check inside the function and its meaning on the outside world
This is why we have the custom type guard return type.
You can do it inline too, by the way.
 
So what the function does is to return a boolean that says arg is of type T?
 
@geisterfurz007 Correct.
 
11:44 AM
Hmmhmmmhm... Shame; I hoped this was included in the TS magic. Seems like that is still an ongoing discussion (or a killed off one) on github.
Oh, ok 😃 I was just about to ask how that would have been done ^^
 
12:07 PM
hey
is there is any alternative to while loop or if there is a way to use while loop safely ?
 
@JRick define "safely"?
there are for loops and do whiles
 
sometimes when they code doesn't finish loading due to disconnection or so , it keep running and crashes the entire browser
and if i keep it going for a little while i have to force shutdown the entire pc
 
@JRick if you're waiting for user input, you don't generally use loops for that
can you show an example of what you mean?
 
@Neil no i'm not it's not , it's more like a stopwatch like google.com/…
let's say i want to catch it when stop watch is 20 sec for example
 
again you wouldn't depend on a loop for that
 
12:13 PM
@Neil how can you keep checking if the stop watch hit 20 sec ?
 
you'd make frequent updates showing the new time as it passes in such a way that it would appear to be counting upwards
 
yes that is what iam saying
 
at time start, you save the timestamp. every 100 ms or so, you calculate the difference between current time and that timestamp, and you show it to screen
 
sounds like a while loop job to check it
 
To know when you hit 20 seconds, you do something entirely different
For that you set a second timer for 20 seconds which gets run exactly when 20 seconds are up
you don't check to see if 20 seconds have passed, because you could miss it
in either case, you're not looping
setInterval can perform regular updates, and setTimeout can tell you when 20 seconds have passed
it's also ideal this way, as the time in between isn't burnt in cpu cycles
 
12:16 PM
could u give me an example ?
x = document.getElementsByClassName("timer_for_example");
how i can check for every 100ms that x have hit (20) or not ?
 
@JRick no, that's not what I said
give me a second
 
1 message moved to Trash can
@JRick Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
while (x =< 20) {
  //do something
    break;
  }
 
this both counts up and does something when 20 seconds have passed
there's a good reason why you don't use loops to pass the time
it's considered to be work by the CPU, even if it is only counting
using setTimeout and setInterval frees the browser thread to do something else
 
12:35 PM
@JRick why don't you trigger a function call when x has hit 20?
just observe that ?
 
@Neil tthat looks great !! i will give it a try !! thanks a lot and yes i totally agree with you that is why i was looking for alternative to the while loop

@KarelG the problem is not in the function is what triggers , what will observe the variable and trigger the function whenever the it hits
 
Wait, is it just me, or can't you read medium articles all of a sudden? I get the popup if I want to login, I close it and I don't get my scrollbar back.
 
that is new for me
 
;_________________;
My scrollbar
 
I just checked medium and I got scrollbars?
 
12:44 PM
It works in a private window for me too.
But if I don't use a private window, I get this thing ^
And if I close that, there are no scrollbars :D
All the css classnames are junk too, I just noticed. They are all just single letters.
 
link?
 
I think it's because I read too many posts this month already?
If that's a thing, dunno.
 
@Neil hey , ok that worked but only if no one have paused or reset the stopwatch
because it will activate after 20 sec from running the function , not based on the timer's value
 

« first day (3175 days earlier)      last day (1766 days later) »