« first day (2199 days earlier)      last day (2750 days later) » 

Wes
1:32 AM
@Loktar -24 hours. waiting for something never felt so hard
it's actually 48 hours for me, i'll have to avoid internet for the whole day tomorrow to avoid spoilers
 
hello guys, if anyone knows answer to this angular-ui-router problem of mine, that'd be awesome!! thanks! stackoverflow.com/questions/40198711/…
 
@PranayShirolkar 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.
 
 
2 hours later…
user6820627
3:44 AM
now i have to learn more js to answer harder questions
i am just a js beginner.
 
4:16 AM
@Wes dude I'm going to come to your house wearing a shirt with the victims face
:P but yeah I'm excited too man can't wait!
 
Wes
:D
 
user6820627
4:32 AM
program ideone;
begin
	writeln(random(1000));
end.
 
user6820627
why this code always say 548?
 
user6820627
i know if i add randomize; before writeln it works fine, but i am curious
 
What language is that?
 
@LearnHowToBeTransparent the initial seed must be constant. every random number is based on the seed. every time you get another random number, the seed is updated
randomize changes the seed, usually based on date and time
I am speaking generally. the concept exists in most languages
seeds are good for things like unit tests, where you can "randomize" things, but have a reproducible sequence of random numbers
 
4:49 AM
I really wish there will be an algorithm to truly generate random numbers
Seems impossible...
 
random is hard. impossible to predict is feasible
 
Unless you make
You make the number like the cup state
Cpu
 
example: some operating systems use extremely unpredictable things like keyboard event timings, mouse movement, disk I/O IRQ times, and stack traces at context switches to add extreme unpredictability for secure random number generation
 
Or the Ip register divided by some number or something
@doug65536 yea let the hardware itself do the random
@doug65536 there is a random generator hardware card though
 
intel's newer chips use thermal noise to generate truly random numbers, with a new instruction RDRAND
 
4:53 AM
Not sure if it doesn't use seeds
@doug65536 If an OS used that, will not be portable
 
unfortunately, paranoid delusional security researcher people don't like RDRAND
 
As the computer might use a different prooccecor
 
@Dsafds same portability as a hardware RNG. you either have one, or you don't
 
26
A: True random number generator

Simon JohnsonI have to disagree with a lot of the answers to this question. It is possible to collect random data on a computer. SSL, SSH and VPNs would not be secure if you couldn't. The way software random number generator work is there is a pool of random data that is gathered from many different places,...

 
-1 Cryptographically secure pseudorandom != True random — NullUserException Aug 5 '10 at 15:25
 
5:01 AM
@doug65536 true
 
hardware PNG's rely on the true randomness in the universe. programs are deterministic
 
@doug65536 it is impossible to make a true random number. But we imitate randomness by using hardware info that change a lot in a short period of time
 
dice, radioactivity
 
I'm creating a video player page which contains the following components: video player, video playlist, and comments. I'm trying to implement using MVC pattern in vanilla JS.

what im trying to figure out is:
1. should each component be a MVC component?
 
5:22 AM
2. or should it be something like this:
- videoModel
- videoController
- videoPlayerView
- videoPlayerPlaylistView
- videoPlayerCommentsView
 
5:59 AM
@rlemon Such feels
 
6:54 AM
jesus
Why is #ILoveBJs a thing?
 
user6820627
7:33 AM
@littlepootis pascal
 
8:09 AM
It's a good read exactly about what you're trying to do.
 
user6820627
can you help me with this?
 
8:54 AM
hello to you all
the question: when you work with git and you want to delete an unwanted file from all of your commits (to filter it) there is a command for that....but my question is not about the command but about is that command deleting that file right away from all of commits or i need to push to for it to be effective? i don't get how does this really work?
 
9:28 AM
0
Q: Git - different commits each, respectively. (use "git pull" to merge the remote branch into yours)

lewis4uI have filtered my branch with this command: git filter-branch --index-filter 'git rm --cached --ignore-unmatch [file_name]' HEAD to delete one single file in all commits and now after running git status it asks me to pull, ubuntu@ubuntu:/var/www/html/laravel/app_folder$ git status On b...

 
you always have to push for it to apply to another repository
 
that's what i thought
ok it works now i did git push --force
 
Anonymous
9:47 AM
Where do I ask a kind of question about code's functionality error? http:codereview.stackexchange.com or http:stackoverflow.com?
 
Anonymous
I'm writting a URL parser
 
Anonymous
, I don't have questions about language
 
Anonymous
Any... one?
 
10:09 AM
Hi, Anyone know how configure options JQUERY Dialog (autoOpen:false,width: 4000) from element DOM ?
<input type="text" id="lol" style="display:none" value="{autoOpen: false}"/>
<script src="external/jquery/jquery.js"></script>
<script src="jquery-ui.js"></script>
<script type="text/javascript">



$( "#dialog" ).dialog({
//	autoOpen: false,
//	width: 400,
"option":document.getElementById("lol").value,
	buttons: [
		{
			text: "Ok",
			click: function() {
				$( this ).dialog( "close" );
			}
		},
		{
			text: "Cancel",
			click: function() {
				$( this ).dialog( "close" );
			}
		}
	]
});
 
 
2 hours later…
Knu
12:23 PM
Anyone knows how to handle 10X status code?
I mean can you even receive them when using XMLHttpRequest?
 
If the server sends them, why not?
 
12:39 PM
@Knu yes
look at the basis behind http headers. XHRs are answered with both the header and body, even if there is an error, so you can see the header and what the status is
xhr.getResponseHeader('status')
 
1:22 PM
How can I tell TypeScript that I'm passing a constructor that extends Foo rather than instances of Foo?
Function works, but it's too wide
 
Knu
2:11 PM
@littlepootis hey
I am asking how you should handle them…
Should it be considered a success?
Have you ever encountered them?
I mean something like 100 Continue requires a follow up…
 
Mac
Angular 2 question - Is it possible (or even advisable) to use Angular 2 for javascript components on a dynamic page, such as one generated by rails? e.g. Can I have a rails rendered e-commerce site and use Angular 2 to render out the shopping cart, image viewer etc?
 
Knu
Once you have reached that state it's already DONE
 
@Knu follow up from you, yes. But usually, you shouldn
't deal with them unless necessary
 
@Knu 100 continue is for the post data you send to the server. it gives the server a chance to tell you that your post is too big, before you start pumping data to it
 
Knu
@doug65536 yup but would you consider information 1XX part of the success path?
 
2:23 PM
you might get a progress callback, if you had an onprogress event listener. I doubt you can do anything else
afaik that's grey area where the browser implementation can do what it feels like
 
Knu
it's not black and white
I guess only 4XX and 5XX go into the error path
the rest is up in the air
 
if you want to infer a 100 continue, listen for progress events on the xhr.upload
if you get progress, 100 continue must have occurred
 
Knu
since the counterpart of 100 is 417, I am probably right in thinking that should fall into the success path
@doug65536 to receive a 100 continue you need to send one AFAIK
 
no
when you post you send a length. server has an opportunity to tell you that it is too big, before you send any of the post body
 
Knu
I am talking about the Expect header
 
2:27 PM
100 continue means "yeah, that post looks good, go ahead"
 
Knu
so there other ways to receive the 100 then using the Expect header
I gotta confirm this
 
yeah, post
why do you care though?
xhr implementation takes care of it
 
Knu
> Upon receiving a request which includes an Expect request-header field with the ‘100-continue’ expectation, an origin server MUST either respond with 100 (Continue) status and continue to read from the input stream, or respond with a final status code.
OKAY so this is catchable only at the readystate 3 phase @doug65536 correct?
that is you will never get a 100 at 4 (DONE)
I am working on something related to XHR
 
I expect this to be more what you are looking for
they say "fetch" but I think that is a mistake
> onprogress Data transfer is going on
 
Knu
no it's not the underlying XHR specification has been reworded to that it is a layer over fetch
 
2:38 PM
those events are for the upload, obviously
there are corresponding ones on the main xhr for the response body
 
exactly
afaik, browsers expect 100 when they post
setup a packet sniffer and see for yourself
if you don't see 100 continue for a small body, perhaps a browser optimization? to provoke a 100 expectation, do a large file upload post
 
what won't work?
 
Knu
Expect header
 
2:51 PM
...
did I say set an expect header?
 
user1596138
ebaumsworld.com/videos/audi-r5-snow-drifting-fail/83857719 @SterlingArcher trying to drift the Audi
 
Knu
nop you didn't but I wanted to set up a real test
if it's based on unspecified content-length it's completely random
 
page with <input type="file">. click browse, pick a big file, click submit. done
 
Knu
:)
 
you should see a 100 expectation. it would be asinine to not expect 100 for a large post
 
Knu
2:55 PM
OK I found what you were talking about:
> There is an exception to this rule: for
compatibility with RFC 2068, a server MAY send a 100 (Continue)
status in response to an HTTP/1.1 PUT or POST request that does
not include an Expect request-header field with the "100-
continue" expectation. This exception, the purpose of which is
to minimize any client processing delays associated with an
undeclared wait for 100 (Continue) status, applies only to
HTTP/1.1 requests, and not to requests with any other HTTP-
version value.
 
if you must script it, use a FileReader from the input element's files property
I still don't get why it matters. the browser takes care of it
are you coding the server side?
 
Knu
some kind of API
without directions it's harder to know how to proceed
 
 
1 hour later…
4:12 PM
Ay guys
Currently in a very annoying predicament.
Creating an api for a small project, and I need to reference individual documents in external directories.
Wait
 
4:35 PM
Hi guys
 
4:49 PM
Hey :)
 
@Dargmuesli 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.
 
What is the way to go if you have a (javascript) library and you want to modify one part of it, like a function, but you don't want to touch the original code? How do I get the original code and mine to use the modified version instead of the original? :)
 
@Dargmuesli fork the repo?
 
@bitten good idea! I've forked some repos already but did not update one yet (to keep head on head with the original repo). Is it easy to update the parts of code that did not change? What I need is a way to sim
... more is coming (dmn enter :D)
What I need is a way to simply update the library without having to edit my personal changes in every time.
 
@Dargmuesli just add the forked repo as a new remote and keep it in sync that way
 
4:58 PM
@bitten
damn, I'm new to this chat, sorry :D
Seems like I have to read a little bit more about repositories and version control. But thanks for the hint so far! :)
If I don't write anything else that was a good solution :D
 
well if you're comfortable with cl, you can just run git remote add upstream https://originalrepo.com/path.git
then fetch all the changes from the original repo with fetch git fetch upstream, then just merge their changes into your branch (assuming you are on the master branch and want to pull changes from their master branch)
git merge upstream/master
that's how i do it, anyway ^^
 
5:12 PM
Ay
When the typos are real.
So is this possible with JS? I have a regex and I want to replace the beginning and end of my string based off of it.

let str = "prefix.foobar.json";
let match = new RegExp( /prefix.*.json/ );
// # now I want to replace both 'prefix.' and '.json'

Or should I just create two different statements?
 
Then use the regex to match just the part you want to keep.
 
5:30 PM
I know this isn't a Regex discussion, but how would I match foobar from prefix.foobar.json?
 
5:46 PM
@neet_jn let [, match] = /\.([a-z]+)\./i.exec(str)
str is a filename, right?
 
Mhm
 
if so then maybe word at the back of the string /\.([a-z]+)\.json$/i
 
@bitten, thank you!
 
!!s/word/work/
 
@bitten if so then maybe work at the back of the string /\.([a-z]+)\.json$/i (source)
 
6:10 PM
Has anyone here worked with TimeCircles library?
 
how do I solve for p? C + (i > 46) = (p * 2 ^(i+1) - 1) % len
C, i, and len are known
^ represents power, not xor
 
7:15 PM
in a MVC architecture/pattern, would it make sense for multiple view/controller to depend on one model? let's say, on the video page, theres a video player, video playlist, and comments section. each of those sections can be considered a component. but those components need to know about the video data/MODEL
 
the all them depend on one model layer
 
@Shmiddty and i > 46 returns either 0 or 1?
or does that mean that i is going to be bigger than 46?
 
would this make sense to architect it like this:

-- videoPage
---- components
------ videoComments
-------- videoCommentsController
-------- videoCommentsView
------ videoPlaylist
-------- videoPlaylistController
-------- videoPlaylistView
-- videoController
-- videoView
-- videoModel
 
looks like you tried to write "directory structure" and accidentally wrote "architecture" ... it's a common typo
 
lol yeah my bad
 
7:31 PM
not sure why you would need to somehow elevate "video page" above "video comment" ... also, you probably should look into HMVC, because that what you seem to be aiming for (though, I dislike that approach)
 
@towc it converts bool to number
 
8:15 PM
I don't have much experience designing interactive/dynamic sites... would polling for data changes every 2 seconds, or every 1 second, be considered reasonable?
 
@Phrancis use websockets
@Shmiddty solve for x with modulus hurts my head
 
@bitten I suppose I should read into that... I may be having a case of X-Y problem at the moment
 
@bitten thank you very much
 
@Phrancis alsje
i just realised i can't trust web apps/js uis to not lose my position in the page
will this "load more comments" link navigate away? and when i navigate back will i start at the top again?
:l
 
8:25 PM
@bitten No it won't navigate away, and yes if you reload the page it will reset back to the default view
 
@Phrancis yeah but you just -don't know-
 
Thus is the nature of JavaScript: undefined.
On the bright side, I managed to make something that works, with React, albeit it's pretty basic
 
@Phrancis congrats
 

« first day (2199 days earlier)      last day (2750 days later) »