« first day (3039 days earlier)      last day (2134 days later) » 

07:38
well, that's a long gap
07:49
yeah I bought the humble bundle yesterday
pretty cool
I started enjoying the python cookbook quite a bit
but then I looked at the js cookbook
and now I'm not sure about the quality of the content for languages I don't know. That said, it's still a nice way to be exposed to new things
 
1 hour later…
09:08
noted
 
1 hour later…
10:31
is there an error type that refers specifically to file operations in node?
there's plenty of error codes
how do I throw a node-specific one?
11:02
$ node -e "fs.readFile('fake', 'utf-8', e => console.log(e))"
{ [Error: ENOENT: no such file or directory, open 'fake'] errno: -2, code: 'ENOENT', syscall: 'open', path: 'fake' }
my guess is you don't want to throw native errors
if you want to throw a native error, generate it natively by doing the action, and throw it
I don't have much industry experience in that, so take the words with a grain of salt
@towc Thanks, it turns out that there is in fact no way to throw such errors, but that is a noteworthy workaround I will keep in mind. for now I will use the JS error system
 
4 hours later…
14:53
mornings!
stupid shits I shouldn't be doing #17253: I want to mobx.observer a class extends React.Component without using transpilation, hence without the decorator. I seem to be failling greatly, as I succeed on making the observer react on store changes (through a stateless component) if I directly hook the component's render function on store.whatever, but the observer fails to react on changes on that store.whatever passed through props
export const Component = mobxReact.observer(() => React.createElement('div', null, store.greeting));
seems to work^, eg the div's content is updated with the content of the store
export const Component = mobxReact.observer((props) => React.createElement('div', null, props.greeting));
doesn't seem to work^, as the div's content is not updated with the passed props
does anyone know any tool to see the browser history contents on the fly (real time) while we navigate to different urls
@JupiterAmy 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.
@JupiterAmy hopefully not, I don't want facebook knowing when I navigate to shadowy urls after being there
@FélixGagnon-Grenier seems you are correct, but my react-routers are behaving a lil strange
and have no way of knowing what's causing that under the hood
:(
might I suggest you use the sources tab of the developper tools to debug your code?
15:04
Yes have been doing so....hopefully will find the bug
okay one more scenario...if you have worked on redux???
I have done that, yes, but have no idea if I can be of help, tbh
I will shoot anyways
:)
Suppose I have a redux store which contains an array of items, and using that data I do the rendering. Now suppose I sort my array in the redux store....will react re render?
off my general understanding of redux, I would presume it should, but have no direct memory of that working exactly like that
Maybe I will try that and see what happens..I second your opinion though
thanks
:)
15:22
oh, I didn't know some irc servers actually change the messages when writing a message with s/something/else: w3.org/wiki/…
I thought it was just a geeky thing people did to correct their mistakes
@towc That's a client thing
It's not a part of the IRC protocol
right, but the servers can do that. Maybe the web view can be considered a client to the server?
@towc No, they can't.
@KevinB I don't live in Jondor
The IRC protocol doesn't allow for retroactive editing/deleting
15:24
the section says that the web client won't see the changes, but they'll be cleaned up in "the web view"
It says there clearly that it's just the web client that's going to make the modification
@MadaraUchiha but the server can change what it stored for logging purposes
@MadaraUchiha I think the misconception is that I didn't agree with calling that just a "client"
@towc Yes, but the server can't send an UPDATE command to other clients
That doesn't exist.
@MadaraUchiha yes, sure, I get that
The client can interpret s/old/new and do fancy stuff
But it's a client thing, not a protocol thing.
15:26
I never said it was a protocol thing. The way I imagined the whole thing was that actual users connecting to the server were clients, but people can also look at the logs online, which would come directly from the server, so for me that's still the server
been using a lot of c# on my MVC project, anyone have an idea how to get value from object list based on a string?
@towc And again, the IRC protocol does not deal with logging
the application that serves the logs is technically a client, but a web client (not going through irc), and not a web irc client
ex: c# Model.GymDataList.where(x => x.name == "string").tolist()
@MadaraUchiha but the server does
I never talked about protocol
s/does/can
15:27
It's not in the IRC Server's lexicon
in javascript i'd be GymDataList.filter(x => x.name == "string")?
It's possible that some other service is listening to the chat and makes modifications to the logs
It's even possible for that to be a plugin on the actual IRC server itself.
@MadaraUchiha yes, but it could also be the server
But there's still a distinction to be made.
@Adan always make sure to use === unless you know why you're using only ==
oh wait
I though you had changed it from the sample
15:28
either way, I'm pretty sure we're saying the same thing
Probably, I'm nitpicking quite a bit.
@MadaraUchiha I mean, it's sunday morning, what else could we be doing?
Dunno about you, I'm at work vOv
oh shite :P have an happy work!
either way, my surprise was that some "log managers" (server plugin or other client) actually do something with s/x/y syntax
and it was while working that I found out about this thing 😛 Still trying to familiarize myself with the webrtc spec
15:30
@towc I mean, you can do whatever you want if you a. are a client or b. are a server and don't mind not following the standard
For instance, Twitch chat is based on IRC
And they have a shitton of non-standard features.
Deleting messages, custom emojis, etc.
@Adan can that help? docs.microsoft.com/en-us/dotnet/api/… the example seem to foreach over the result of the where
and I thought I could try hanging out in w3's irc stuff, but apparently they mostly hang out in a limited access server
freenode's webrtc channel is dead
@FélixGagnon-Grenier thx for the input, will look at the link
some webrtc implementations and similar have irc channels on freenode, and that's where I've done most of my q&a debugging
hopefully it will even work!
15:47
hey i was wondering, if i assign numbers to alphabets in a UUID such that a =1, b=2, c=3, ... and sum the numbers then what is the probability that 2 or more UUID could yeild the same sum?
that sounds like something math could solve
16:28
@FlyingGambit not too low. I wouldn't rely on it
it's similar to calculating the probability of any given number appearing as the sum of n 26-sided dice
26 only if you use the entire alphabet
if you use 16 letters, with a UUID length of 30, there's 2e34 UUIDs with the same sum, which is just above 1% of all UUIDs
in fact, 48 sums contain ~50% of all UUIDS (out of 480 possible sums)
and what are you trying to do? Create a hash of a UUID for quick comparison (human)?
s/480/450
for a human-recognizable format (for debugging/admin, in a quick view) I recommend, I kid you not, emojis
there are >2800 emoji in unicode, currently
so you can pair every pair of letters to one of 676 (26²) emoji that you pick, halving the length of the UUID
or you can split to bits
each char requires slightly above 4.7 bits (log2(26)), while identifying an emoji requires just above 11.45 bits (log2(2800)), that means you can fit just above 2.43 chars in an emoji
so a 30-char UUID would end up having a 13-emoji representation (12 < 30/2.43 < 13)
you can mix in another bunch of recognizable characters, so you can increase the view alphabet you have
you're probably not going to get it above 4000
16:51
you could also decrease the probability by making the length variable.
if you pick 8 very recognizable colors to use as backgrounds for each emoji, you can multiply your viewing alphabet by 8, so each viewing char could represent >14.45 bits, and now each view-char can represent >3 original chars (you only need 7 colors to achieve this)
but even with this, a 30-char UUID will end up having 10-emoji representation, which is only 3 emoji less than a background-less representation
the good news is that you don't lose any data, there's no collisions here
but if you're willing to lose some data, you can get this down to 2 emoji by some other uniform hashing algorithm, and still end up with just above 1% collision
3 emoji, and you have 0.1%, and so on
(Math.log2(2800*8)/(Math.log2(26)*30))**3
chances are there's something wrong in this calculation
if I have 100 emoji, you'd definitely not have any collisions, but it gives me a 1e-97% collision
 
1 hour later…
JBis,
or anyone else that is here.
No. That syntax doesnt work. Its either url, callback or options, callback. No url,options,callback
Do you do any functional programming in javascript?
@55Cancri Yesherish. How can I help?
And you use react as well?
Actually, that part is not so important. The idea is simple. Here is my question.
18:30
No. But just ask your question.
suppose I have a variable called message. const message = ''
after this, I have a series of if statements that validate input fields, and update the message variable with one of three possible messages if any of the input validations fail.
the non functional way to do this is: let message = ''
if (age === false) message = 'please enter an age.'
if (name === '') message = 'please enter a name.'
if (location === '') message = 'please enter a location.'
ok I get it
what is the functional way to do this?
i hate using let with a passion and I will go to great lengths to avoid using it.
Even so far as to do: const error = { name: '' }
Simple. Create an array of all this shit you need to check. forEach it and then when one fails just do 'please enter ${array[iterator]}'
oooo interesting
18:33
TIL you can add ? to * in js regex to make it non-greedy
can't figure out if it's any different from (x*)?
> 'a1234'.match('a[0-9]*?[0-9]')
["a1", index: 0, input: "a1234", groups: undefined]
> 'a1234'.match('a[0-9]*[0-9]')
["a1234", index: 0, input: "a1234", groups: undefined]
oh, it is
neat
JBis, good shit
glad I could help :)
also theres prob better way to do it but thats the way I usually do something like that
where did you learn to do FP?
This site. Or this site for that matter.
hey @towc o/
18:45
o/
im sad :( Code not working again
class Part {
    constructor(url, from_byte, to_byte,parent){
        [...]
        this.file = new TempFile.TmpFile();
        [...]
    };
class TmpFile {
	constructor(name, parentPath) {
		this.path = path.join(parentPath || os.tmpdir(), name || Date.now().toString() + '.quickdTMP');
}
download_bytes(i,length,callback){
                [...]
                this.file.write(res);
               [...]
}
async write(content) {
		return new Promise(function (resolve, reject) {
			fs.writeFile(this.path, content, 'utf8', err => {
				if (err)
					reject({success: false, err});
				resolve({success: true});
			});
		})
	}
But in write this is undefined so this.path is undefined :(
Any ideas?
do I need to pass this into the promise executer?
i have limited experience with oop but maybe bind this?
@55Cancri worked
thanks
oh, cool
 
1 hour later…
20:17
Hi Please help me correct my sentence

I'm working on VR App
I wanted to give end users some instructions

Instructions:

1. Move your head to see your surroundings
2. To move forward look at ground exactly 45 degrees or more

Lets get started, Happy explore All the Best
any corrections neaded?
20:28
"Lets get started, Happy explore All the Best "
probably should be "Let's get started. Happy exploring, and all the best!"
the comma might not be good grammar, but a pause sounds good there and this isn't literature lol
2. To move forward look at ground exactly 45 degrees or more

Probably shouldn't say "45 degrees" but that's just a suggestion and not grammar or anything objective.
"2. To move forward look at the ground"

« first day (3039 days earlier)      last day (2134 days later) »