« first day (3337 days earlier)      last day (1602 days later) » 
00:00 - 18:0018:00 - 00:00

12:00 AM
I use 30% .net core and 70% javascript in my apps
 
I want to move to a different tech stack
100% wietlang :D
 
I am not a fan of .NET
 
But .net core is interesting following path of node.js I think but with less complexities maybe
 
hello there guys. I need help solving an issue. I would like to make a dialog pop up when the client searches "/messages" in the URL, But all while staying on the current page they are. I can't seem to figure this out. Using typescript and angular by the way.
 
dotnet is quite interesting, but its improvements are really slowly rolling out
 
12:09 AM
I do envy the null coalescing that TS has
 
JS has null coalescing tho
just not null conditionals
 
It does not have a null coalescing operator
 
null coalescing is a ?? b
or a ?: b
depending on the language
 
and how do you do it in JS
 
JS has that using ||
a || b
if a is null, use b
 
12:13 AM
No, that's not null coalescing, that's a short-circuiting OR
 
however, it captures a bit more than null
 
That will fail the moment you put a falsy value in
Right
 
null conditional operators are more important imho
those would be a?.b
it seems Ecmascript 2020 introduces null coalescing
 
How long until its standardized?
 
2080
people will still use IE11 in 2079
 
12:18 AM
TS has that, but they call it Optional Chaining
 
JSON.parse needs to be fixed.
 
JSON.parse is broken?
 
It shouldn't throw an error with malformed json input.
 
why not?
 
Because you have to use try/catch when ever you use it. It should return null or something. Like other JS functions.
 
12:21 AM
I am not sure I can agree with that
especially because null is a valid response
 
yeah i realized that after I said it, but still needs some alt
 
@Wietbot evalnode JSON.parse("null")
 
@Wietlol undefined
 
you WOT?!
 
||> JSON.parse("null")
 
12:22 AM
@JBis null Logged: ``
 
@Wietlol get outta here with that incompetence
 
0.o?
that one is odd
but anyway, I always want exceptions
 
does your bot run in browser?
 
because they provide information why something didnt work
it runs distributed
 
then add an arg for options where I can choose to error or something else for backwards compatibility
 
12:24 AM
however, because of exceptions, you shouldnt require a ton of boilerplate to avoid errors
 
@Wietlol wdym
 
in kotlin, you can just do runCatching { JSON.parse(input) }.getOrNull()
this will catch exceptions and return null if an exception was thrown
Wietlang uses the name try instead of runCatching
 
cool
 
basically, the idea is to avoid statements, and convert everything to expressions
when doing so, you need to think about what the result of an expression would be
for try, the result is either a value, or an exception
on that result, you can call the catch based methods
such as recover, rethrow, etc
also, it is all functions in Wietlang :D
try isnt a keyword
similar to how runCatching isnt a keyword in kotlin
I did not copy and paste that
I did not... copy and paste that
 
what the hell is ≠? why not !=?
 
12:31 AM
it's a font
 
ew ew ew
 
makes scanning code easier
a lot of people use Fira Code, Jetbrains IDEs even ship with it built in
 
I also use Fira Code
I am used to the ligatures
it is quite comfortable when you get used to it
@Wietbot evalnode JSON.parse("null")
 
@Wietlol null
 
thank you
you are a good boi
 
12:35 AM
shakes head in disapproval
 
1:10 AM
good morning
 
user8729657
1:29 AM
Everytime I come in here, I feel like I'm in IRC :D
 
you mean Internet Relay Chat?
or has it another meaning?
 
user8729657
Yea :)
 
user8729657
Internet Relay Chat was the best tbh
 
jquery is better than irc
 
what's meaning though?
I think 'though' is not proper in the sentence.
 
1:40 AM
?
 
nvm
I am just learning English
Are you working with jQuery?
 
 
1 hour later…
2:50 AM
Hi.
 
@XiaoJin 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.
 
I am building a simple React project which reads local xlsx file and display in a table.
I am planning to use Semantic UI.
The question is do I need backend to read xlsx file in my local?
 
 
3 hours later…
5:23 AM
Hi Everyone, I feel excited to have achieved chat room access. Thanks team.
 
@RajeshMalakar 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.
 
 
3 hours later…
8:21 AM
hola everyone
in 20 words or less, describe what you're working on at work
In my case: developing a batch which automates a deduction of money from clients of a specific card type, and scheduling it monthly.
 
8:34 AM
||> 'developing a batch which automates a deduction of money from clients of a specific card type, and scheduling it monthly'.split(/\s/g).length
 
Invalid command! Did you mean: ceiling, deep, ping? Try help for a list of available commands..‍.‍.‍.‍
@KarelG 5 Logged: ``
 
wut what
*runs in console*
🤔
||> '0 1 2 3 4 5 6'.split(' ').length
 
@KarelG 7 Logged: ``
 
||> '0 1 2 3 4 5 6'.split(/\s/).length
 
@KarelG 1 Logged: ``
 
8:36 AM
@JBis ^ escaping issue
 
both should return same value. It does not because the \ (and / as well, might be) is not taken into the command
 
'0 1 2 3 4 5 6'.split(/\s/) is being seen as '0 1 2 3 4 5 6'.split('s') somehow
 
@KarelG fail
 
8:52 AM
naaah that should work
it is just the bot
MALFUNCTIONING
 
sure.. it's the bot
 
 
1 hour later…
10:03 AM
hi, anyone messed with browserify before, like ZirakBot
why did browserify output the util as empty module?
,8:[function(require,module,exports){

}
this, dictionary 8, should be module require("util") ,but it was empty
 
hur hur got a brain fart with "...all is working expect the feature that got made recently..." in my report note. That could not be spotted easily with the standard spell checker (no red underline)
 
10:31 AM
Hi All
below is my code
getTemplate(next: (error: string, record: any) => void): void {
        fs.readFile(filePath, {encoding: "UTF8"}, (err: any, templateResponse: any) => {
            return next(null, {templateResponse});
        });
    }
im getting this issue :

error: uncaughtException: Can't set headers after they are sent.
not sure how to explicitly add the end of file process
i tried to add the interval before returning the response, but it did not worked
 
error is self-explanatory
 
yes, but how do i stop writing to it in my callback
 
 
2 hours later…
12:38 PM
hey, so i was starting from scratch on my Text to Image project in JS, and I created the same thing: A Dynamically Created Canvas that has text drawn onto it, and then its appended to an output element.
Heres the base script:
 var out = document.querySelector('#textImageOutput');
 var cs = document.createElement('canvas');
 out.innerHTML = "";
 out.append(cs);
 var cx = cs.getContext('2d', {alpha: false});
 cs.setAttribute('id', 'textImageCanvas');
 cx.fillStyle = "white";
 cx.fillRect(0, 0, 1000, 1000);
 cx.fillStyle = "white";
 cx.font = "20px Helvetica, Arial, sans-serif";
 cx.fillText('Hello World', 0, 20);
For some reason, the text wouldnt appear, so I set the background and text color to white, as the canvas was turning black for some reason, and its still turning black when it appears
I dont think theres something wrong with my styles or text, I think its just not appending correctly or actually having any changes detected to it
Actually, I just now removed that alpha:false thing in the context (its supposedly useful for this type of project, as it makes text look more like the default font, rather than a blank letter)
and its no longer black, but now its just transparent
 
@KarelG Fixed escaping
 
I wish canvas could output more detailed responses
no errors, I cant figure out whats wrong
 
I thought it was just the order of appending and rendering, so I tried setting it so it created the element, appended it, and then set the canvas content, still nothing
 
The issue was I wasn't escaping my escaping code so when it tried to escape your escaped string it didn't escape. I simply escaped the escape code which escaped the input escaped code which made it work. \o/
 
12:53 PM
No, remove that, that's boring
The text is better
 
Js escaping is always boring
 
I like C#'s multiline string escaping better
 
What does that do?
 
every special character, just duplicate it
like escape { with {{
\ with \\ etc
its just more interesting of a concept then placing an escape char or interpolating shet or whatnot
and Characters that dont support escape (like the ") you actually DO have to use an escape char
I believe the escape char is \
 
12:57 PM
sqlite does a similar thing with single quotes (adds two of them to escape)
 
I think I should get into SQL someday
Well I sortof already have, but no interest in actually learning how to write, read, understand, and expand upon it
 
its pretty simple (the basics are at least)
 
I'm not going to get into it until my father lets me port forward my Raspberry pi
I recently finally got a 64gb card working on it, installed everything AGAIN... and my dad and me talked about him letting me have access to port forwarding
if I could, Id finally be able to do something useful
make PHP based forms
I could make so many more cool tools to automate everything
 
why aren't you allowed to access port forwarding on the router?
 
Dad is sketch
worried Ill let hackers in our PCs
lol
It doesnt work like that, but he believes it
so Ill respect it I guess
 
1:03 PM
i mean it could if you don't secure whatevers listening
 
I already have a sandboxed apache2 and php module that Im sending out data on
but because I cant port forward, its basically a trinket with no purpose
I managed to get SSH working without making my dad give me THOSE permissions by bypassing with an ethernet cable
but port forwarding cant do that
so im stuck
 
port forwarding isn't done on the pi its done on the router (192.168.1.1 or 192.168.0.1 on most residential setups)
 
lol trust me ive been at this for 3 years, hes got his military grade router where he can control everything
he can see all devices connected and block specific permissions and connections
he blocks outward-sending data on all devices
so the only thing we can do is upload files on a website, other than that, were basically locked in
 
is your father in tech? Also that's features of a standard router.
 
1:09 PM
Not really, I know more about computers and programming than him, hes more of a vehicle enginner in the military, his job is to manage all the vehicles in the base and fix them
Ive seen it, they work on enormous tanks and such
Oh? standard router... oh I didnt know, he really doesnt ever let me near it :L
 
cool
 
||> '1 a 2 b 3 c 4 d 5 e'.match(/\d/g).reduce((a,v) => +v+a, 0)
 
@KarelG 15 Logged: ``
 
👌
 
well, either way, our neighbor is a python programmer and IT technician for 49 different taco bells in the area (yes I know thats wierd lol) and he said hed talk to him about setting up port forwarding some day
 
1:19 PM
@KarelG why +v+a? Shouldn't v+a be enough?
 
le string geister
wanted the sum
not some countdown string
 
+a = "cast a to numbah"
 
@JBis Asking for upvotes has generally not been proven to be a good idea ;)
 
@JBis that comment alone is like walkin on thin ice
 
1:21 PM
what comment?
 
just give a solid answer in js and you're good
 
alright i'll just go answer more questions
 
2:11 PM
I hate the main site -.-
 
the main site hates you too
 
evidently
 
I like stackexchange
but I hate stackoverflow
shetheads bannnnnnned me.. lol
 
It frustrates me the lack of votes for good answers to crappy questions.
 
because people hold grudges against bad questions to the answers too
because people are rude
 
2:21 PM
hmm I would not say that it is because they are rude
it is just the expectation (or the level of laziness) of the OP that disturbs some people and by giving answers, you are rewarding it. That is not productive on long term.
here is a question that got just asked
if you are a programmer, you can do that at your own
if not, try at least
 
2:37 PM
I wonder how a time requirement for accounts to post questions would work. Like a new account can't post a question until 48 hours after creation.
That would get rid of the people who trigger post.
and probably improve quality
answers are easier to deal with so we can still let them do that
Maybe I'll ask on meta
or even a rep requirement
make sure they are at least somewhat competent
 
@KarelG people expect a level of effort proportional to the difficulty of the question
If you're a beginner, they at least expect you to have tried some things and then shown some sort of result that you didn't understand for instance
with a difficult question, they expect to know all the nuances and context before they'll even try to answer
 
@KarelG Also, I bet you that the person who just answered will get upvotes simply because he has a lot of rep
 
rep helps, it's true
nobody expects a great answer from someone with 200 rep
 
2:58 PM
@JBis true
@Neil how can you see if OP is a beginner?
could be a lazy seasoned dev working on a new project as well
 
If you have a get/set property, can the object that's holding the getter and setter hold anything else?
 
3:16 PM
ehm ... you're using class syntax right?
the attribute can be different yes (via constructor or "initial" value)
 
Why is hidden undefined here jsfiddle.net/rp1tb7sz?
 
@KarelG well the difficulty of the question I suppose
beginner in the technology being used by the question anyway
 
@Hypersapien because the String primitive does not have "hidden" on its prototype chain?
objInst.prop.hidden is just 'myValue'.hidden
 
Ok, I see. It's just recognizing prop as a string.
Is there any way to access hidden?
 
no. You have overriden the prop object with taht hidden field by setting = 'myValue'
so that object is "bye bye"
 
3:26 PM
ok, thanks
 
what's your actual goal ?
use class syntax which has private fields. You can use it for "hidden" stuff
 
I have a question about TS
interface Props{
onClick(e: React.MouseEvent<HTMLElement>)?: void;
}

I want to use `?` with `onClick` but it doesn't work
 
@zynkn Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
@Hypersapien consult this MDN document
 
Hey, guys, I was creating a text to Image converter via Canvas, and I cant seem to find my issue, Ive tried logging all values in the program, everything is working so far. codepen.io/SkylerSpark/pen/PowqKLZ
The canvas isnt rendering the text, or the background
its not rendering anything at all
 
3:29 PM
@zynkn Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
^^ That is anoyying
was happy when caprica stopped that
JBis, make it so it can grab a cookie or localstorage value or something so it only says it once or something
or maybe only once in a day
 
caprica did that as well. More, it moved the unformatted comments to the trash bin
so no. The current one is good.
 
No, I mean, when caprica went offline
I was happy
 
I think it's good to remind folks to format code, and maybe not to post gigantic snippets
 
3:55 PM
We are working on moving unformatted to trash.
 
user8729657
Thanks @JBis, for your work :)
 
NH.
Anyone used Contentful?
 
4:31 PM
why is my canvas not rendering anything when I set its width to measureText();
 var textwidth = textICtx.measureText(text).width;
 textICtx.fillText(text, 5, 20);
 textICvs.width = textwidth;
My canvas project works perfectly fine without that width statement
 
@TaylorS setting the dimensions on your canvas clears the pixel data. Just move the last line before the fillText call
 
ok
oh.. I didnt know that .-.
Ill have to remember that
Actually, that didnt work
oh wait nvm lol
thats pretty good, now I need to figure out how to adjust the height... sigh Ive heard its VERY difficult
 
4:49 PM
Well, what size is your text? 16px? Try something like 16 * 1.5... 1.5 being the line height. I dunno, I don't do a lot with text on canvas
 
Im also making a multiline text engine :L
Itll be pretty difficult
 
There are libraries to help with this sort of thing in C++... unsure about if a js port exists for 2D canvas or not
 
Maybe
thats meant for node but in the readme they mentioned "It should work in browsers too"
Heres something promising: codepen.io/nishiohirokazu/pen/jjNyye
 
NH.
@TaylorS whoever wrote that has no idea of the difference between a fertilized chicken egg and a non-fertilized one
 
LOL
.. also... I dont get it
Wdym...
 
4:59 PM
There is fabricjs.com which has text support, even multiline
I don't think there's a lot of value in doing anything new in 2D canvas, so stick with a library there. If you're trying to do anything more interested than what fabric already offers you, I'd say you might wanna look into WebGL
 
bruh.. how have I not seen this
 
Hi! Could you please recommend me a JS library, using I could open/write .env files?
 
@IterAtor 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.
 
5:26 PM
@IterAtor Your server could use a normal filesystem library to do that
but it is not possible to do that from a browser
 
Im seeing dotenv all over google
its more used then I first thought\
 
does it allow to modify .env files?
 
read? yes, Modify? Immmm.... NOTTTT... Sureeeee???
 
5:29 PM
> using I could open/write .env files?
 
I see the dotenv library abused more than I see people using it correctly. They specifically recommend that you do not commit your .env files, nor should you have multiple, but do people actually read the FAQ? No.
 
:P
tbh, I use webpack replace plugins and get env vars from process.env directly at bundling
 
I would like to write a server side script, which generates and/or updates .env files
 
Any filesystem library can read/write to any files. There's nothing special about .env files
 
node has a filesystem built-in library nodejs.org/api/fs.html
what ndugger says
 
5:31 PM
Iter
Any serversided language with atleast some form of non-obsolete-ness should be able to complete what your asking for
I dont personally write in server-sided languages often though, so I wouldnt know
 
javascript is a server-side language :)
 
no it isnt .-.
 
... did you er... heard of node.js?
 
Its a static language for webappps
thats Node... Im talking about web-javascript
 
lol, ok
yeah, node-javascript is javascript is javascript
 
5:33 PM
personally, I like to think of node as a different language :L
 
it's really not :)
 
Yeah I know but I have my opinions :)
 
javascript is a language; it has nothing to do with whether it runs in the browser or via node.
Your opinions are factually incorrect
4
 
:Thonkers:
 
Sure. I was just curious, if there is a library for this, to make my task easier. Of course, I can simply parse the .env file myself, it's not complicated
 
5:35 PM
oh ,-,
 
I personally like to think the sky is purple
 
,______________,
 
@IterAtor heh, just got your user name
 
@IterAtor I didn't even need to read your entire question. It's JavaScript. There's always a library.
 
@IterAtor I think that wrappers that both load .env into runtime data structures and save them back are relatively easy to write over the node fs built-in api
at least, that's what I would do, but @JBis is probably right, some hipster must have written something for that :P
 
00:00 - 18:0018:00 - 00:00

« first day (3337 days earlier)      last day (1602 days later) »