« first day (3447 days earlier)      last day (1508 days later) » 

12:04 AM
Fun (possible re-)discovery: for uniquely identifying things in JS, just using integers seems to be at least 1.7 times faster and uses about 40% of the memory when compared to Symbols.

https://jsfiddle.net/w4qkdyse/1/

Now granted integers can only go from -(2^53 - 1) to 2^53 - 1, but that's more than the number of atoms in our galaxy by a large margin so you'll probably be all set.
 
Tay
The f
Like anyone knows the amount of atoms in our galaxy
thats one of those numbers thats just incomprehensible
 
It's theoretically a really big number :)
Quick internet search puts it at 10^68. Theories for in the known universe is 10^80.

Point is you won't run out of ints.
Wait did I get my math wrong... whatever. ^53 is too big to care :P
 
¯\_(ツ)_/¯
 
And yet I still have the irrational fear of GUIDs colliding...
 
tSlap has been added
 
Tay
12:10 AM
|| tSlap Jeffrey Sweeney
 
Tay has slapped {0} so hard their atoms turned inside out.
 
Tay
Aww it didnt work
|| unlearn tSlap
 
tSlap has been unlearned
 
sandbox
 
12:29 AM
Whups... it's "Number", not "Math" for min integer...
Well, comparable performance. Also interesting discovery: Number.NaN != Number.NaN :)
 
user12960916
12:43 AM
I'm trying to use the input from this textbox each time to create an array of people objects using local storage but I'm not sure how to save the new inputs each time. Does anyone know how I could possibly do that? jsfiddle.net/rkdvxfy3
 
Hello
I would like to ask if there's anybody here have tried infinite virtual scroll with the angular cdk
 
@csscoder are you asking for help on how to use local storage?
 
any elasticsearch user here by chance?
 
@galmeida 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.
 
1:10 AM
Here ya go, perhaps this will help:
https://jsfiddle.net/v3mxrbjd/1/
 
user12960916
no, im familiar with the methods used for local storage but im having trouble using the saved data on another page
 
user12960916
i wasn't sure how to save those inputs in an array of objects to make a bunch of people because i want to use that data on another page
 
@csscoder the example above should do the trick.
For debugging: are you able to see the data in window.localStorage?

My guess is that if it was being set in a form submit (without default events being prevented), the page may have been navigating away before the data was saved.
 
user12960916
not sure i'll try
 
user12960916
my computers lagging, is there a way to check in the fiddle?
 
1:23 AM
Chrome console (F12) was how I tested.
 
user12960916
i get length:0
 
Ok, so setItem isn't applying.
What does the code look like that sets localStorage?
Just pasting this in the console seems to be fine:
localStorage.setItem('test', 'needs to be a string value probably')
localStorage.getItem('test')
 
user12960916
do you mean what message i get? yeah i get "needs to be a string value probably"
 
So localStorage is working. It's just the setItem call is either not getting fired or is throwing an error.

What does your code that sets localStorage look like? The original jsfiddle did not have any code related to localStorage.
 
user12960916
i used var txtname =localStorage.setItem("Name", name.val());
 
user12960916
1:39 AM
since i wanted the array of objects to be var people = [ {name: "" } , {name: "" } ];
 
user12960916
depending on how many times they filled in the input box
 
user12960916
but i never got to the part where i do it each time the users enters something in the box, thats what i was stuck on
 
I don't think localStorage handles objects well or consistently. You may need to convert the array to a string via JSON.stringify() and then parse it out with JSON.parse(), as I did in jsfiddle.net/v3mxrbjd/1
 
user12960916
oh ok
 
user12960916
thanks
 
1:45 AM
Np. Good luck!
 
 
2 hours later…
3:55 AM
Is there a javascript equivalent to the python requests library? Because async/await, promises etc are all too confusing for me.
 
@mismaah 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.
 
Better get used to it, because that's the best you're going to get, and honestly they are Great features. Just keep trying
 
Well I can't get my fetch function to NOT return a promise lol
 
I'm not sure why wouldn't you want that, but if you have a concern with an issue you are facing, then just ask it. Someone might help if interested.
 
Because I wanted the result to be passed into image src stackoverflow.com/q/60824533/12636797
 
4:13 AM
You know what would really help you out? If you first have a great understanding of what promises are.
I suggest it, it will help you tremendously.
 
 
4 hours later…
8:20 AM
@mismaah axios might be helpful for you
however Promises have a huge importance in javascript. It is advisable to comprehend it.
A wise person once told: If you enter the promise land, you can never leave it
 
 
2 hours later…
10:11 AM
@JBis what did you do to JamesBot?
 
10:25 AM
@Wietlol something wrong with him?
he's still here and working I think
||> 1 + 2 ** 3
 
@KarelG 9 Logged: ``
 
||> Math.max()
 
@Wietlol null Logged: ``
 
while it should be
@Wietbot evalnode Math.max()
hmm... I think I reduced the idle times for shutdowns
 
@Wietlol -Infinity
 
10:27 AM
that
 
10:41 AM
||> Math.max(1,2,5,3)
 
@KarelG 5 Logged: ``
 
idk why it returned null
||> Math.min()
 
@KarelG null Logged: ``
 
||> [1,2,3]
 
@bravemaster [1,2,3] Logged: ``
 
10:47 AM
aha got it
@Wietlol just checked the source, a JSON.stringify is used with the result
that gives null
||> JSON.stringify(Math.max())
 
@KarelG "null" Logged: ``
 
@KarelG Where can I see his source?
 
|| info
 
I'm a bot. I am owned and operated by @JBis. I am open source. I am written in JavaScript.
 
click 2nd link
 
10:49 AM
@KarelG Thanks
 
@JBis any reason to json.stringify the result from your eval command in VM?
(see conversation above)
check sandboxed-script.js#L161
 
|| for(;;);
 
Invalid command! Did you mean: format, forget, fry? Try help for a list of available commands..‍.‍.‍.‍.‍
 
|| help
 
Command documentation and syntax can be found here.
 
10:53 AM
bravemaster, if you want to experiment with the bot, please use the sandbox room 😀
|| sandbox
 
Please go and play in the Sandbox
 
@KarelG as does wietbot
 
infinity becomes null in json.stringify
by design
so don't tell me that your bot uses it :P
 
@Wietbot evalnode console.log(Infinity)
 
tok tok
 
10:55 AM
@Wietbot evalnode console.log(JSON.stringify(Infinity))
@KarelG just a moment
 
Result: undefined
Output:
Infinity
 
cold starts on everything
 
Result: undefined
Output:
null
 
hmm... I guess I do not use json stringify
 
:P
It is probable that you have string'ed it
 
10:56 AM
oh wait
I do type checks
 
||> ''+Infinity
 
@KarelG "Infinity" Logged: ``
 
as by design
 
I only do json stringify on objects and arrays
 
🤨
 
10:57 AM
it has nicer results on numbers for example
imho
i wonder..
@Wietbot evalnode [Infinity]
 
@Wietlol Infinity
 
you wot?
I need to check the source code on how this works
 
I am kinda impressed that you barely know your own code
 
it is js code, I try to avoid it as best as I can
 
:P
 
11:06 AM
@Wietlol Dude, please move this to the sandbox or the bot testing room
@KarelG how would you do it?
 
Hi there, can anyone here help with a html question?
 
@Jackiesaurus 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.
 
Karels got it :)
 
@JBis you could use my implementation :D
its open source now anyway XD
I mean... you can extract the source from the runtime
not necessarily open source in its term definition
 
12 messages moved to Sandbox
 
11:09 AM
Thanks Karel :)
 
Tay
Ah todays a good day
my computer isnt taken away.
 
although, I still think that array one is odd
 
aaawww, it has been calm here
 
I would expect something similar to the source code
 
😐
 
Tay
11:10 AM
on the left Im writing down my history essay, and on the right Im talking/programming :P
Mornin Karel, Wiet, JBis, etc lol
 
To the left to the left
 
@Wietlol fyi, array with one element becomes a single-element string
 
but I guess the array toString handles it as String.join(..., ", ")
 
morn O/
Damn mobile chat
brb
 
Hey guys, I know this is java chat, but the html one I saw was fairly dead. This is simple html, but I've been stuck a while. https://ibb.co/s6N5NBw
just to do with input elements.
 
Tay
11:11 AM
Im happy, and besides the point that I almost fainted 5 minutes ago from blood flow issues, Its a good morning edit: not really fainting, Im just standing up too fast
 
||> let s = 'only one'; [s].toString() === s
 
@KarelG true Logged: ``
 
this is Java chat?
 
@Wietlol Yeah, but like I said the html chatroom was super dead. So if anyone could spare like a minute it would be awesome
 
(don't ask me why it's designed that way, I never understood that but keh)
 
11:12 AM
@KarelG its implementation is String.join(self, ", ")
[s].toString() === s is just a side effect
 
if I want to stringify an array I want to see '[ ... ]'
 
Tay
that moment where your PC actually decides to download faster than 50mbps
 
> java === javascript
< false
 
@joacho 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.
 
my formatting will work in most cases, but it will fall short when people try to use objects inside arrays then
I might have to do arrays as recursive on that formatting function
might just as well fix the [] then
 
11:16 AM
||> undefined
 
@JBis undefined Logged: ``
 
Tay
||> const j = "Java", js = "Javascript"; if (j===js) { return false;} else {return js || j}
 
@Tay "Javascript" Logged: ``
 
Tay
Good bot
Here 3 years ago, I had trouble finding out basic JS syntax. Nowadays we have TOO many tutorials, but every single one has to start with "what is JS" "JS is different from Java" etc
 
8 years ago, I had trouble finding out basic JS syntax. Nowadays, I have realized that it just is unacceptable.
 
Tay
11:21 AM
Damn, lucky you. I wish I started JS 8 years ago :D
Back when I was like... idfk... 7?
What a life thatd be
Programming at 7
I know I still started young, 10/11, but still
 
@Wietlol pshh, what's so bad about js syntax?
 
Tay
JBis... I wish I could shorten js...
 
just everything
 
Tay
There are times where I feel like they expanded too far into daisy chains and default methods
 
but keep in mind, I think all languages are trash :D
 
Tay
11:23 AM
I like PHP because mostly all built in methods are a single function..
 
some just are less trash than others
 
@Wietlol thats not specific
bah
 
Tay
Wietlol you got that right, but Ive only reached about 4-7 languages in total, so Im not one to judge
I lose count nowadays, sometimes I forget that I can even write in Lua or C
 
@KarelG as specific as it gets while still being a description for all cases
 
@Wietlol make your own
 
11:24 AM
@JBis :D
 
Tay
JBis, havent you ever once just wished you could copy the JS interpreter and source, and just rewrite some default methods, add your own, remove garbage, fix some annoying syntax object that pisses ya off everyday, and just have your own remake?
Because I wish that constantly
 
oh boi
Wietlang
 
:)
 
Tay
HAH
 
Wietjoke
:D
 
11:27 AM
meh
 
Tay
ooooooh, Burn, or.... maybe compliment
 
it works tho...
 
You've been talking about that for years and geis was asking to see it
but nope
mystery
 
I just cant make executables from it yet
 
Tay
KarelG, You ever got bored and wanted to write your own language?
 
11:28 AM
*cracks*
 
@Tay no
 
you shouldnt do crack
5
 
I have written (meta-)interpreters
@Wietlol was cracking of laughing
 
currently, I am in the process of simplifying the program instruction definition
 
I have barely time for programming in my spare time lately
 
11:29 AM
which in turn should make the llvm ir generator's job significantly easier
 
Tay
Honestly I just want a language that could work alongside JS with a mix of CSS Selectors and Javascript Syntax.

Perhaps Im going at this wrong. Rather than making a new language, Interpret the language/pre-processor into javascript itself
 
I've been wanting to make my own Lang but I have plan for syntax
 
😕
 
and if that job gets easier, it gets an order of magnitude easier for me
LLVM IR has quite a decent language reference, but lacks examples of common behaviors
and... like... literally no one uses it
 
Tay
Well, JBis, I think at any moment a webdev or gamedev whos spent enough years programming will get bored one day and ask: "How hard would it really be to write my own language?"
 
11:30 AM
because it is a frigging bytecode language (sort of, not really)
it is a... language that operates on binary level...
 
Tay
Well wietlol, when ya cant figure out how to program your own programming language and use it as a program....

You'll give up on life and spend the rest of your days making Cheat Engine assembly hack scripts...

IE: Me
Except I ignored the giving up part
and I just do both now
 
depending on the type of lang, it isn't that hard
 
Tay
Well, Im taking a python course next year, and when I graduate highschool... my college BETTER fricking have a Java course...
I want to use Java and C#/CPP... but the languages are so big and intimidating, I just use winforms, and the only CPP and Java I do is using it with APIs to mod video games
also I havent written a winform in over half a year, so technically that means I cant really use any of the three at this point
 
what y'all think about this site and logo?
 
it looks purple
 
Tay
11:39 AM
Looks clean
 
@JBis there is a weird cut on the 3th line
 
Tay
No... its... Blurple... I like the blurple color
 
compare "conference" with "connected"
 
Tay
Um... Karel... 3th???
 
but could be a fragment thing from the recorder
 
11:40 AM
yeah the lines are are the recorder
 
cut?
 
do you like the logo?
 
@JBis maybe add some indication that people can scroll down
 
Tay
The logo is simple, but What do the chains represent. Usually the logo can show a feature of the program, or its speed and utility
 
solid and small but ... that chain thing reminds me of something else
 
Tay
11:41 AM
@KarelG Probably a hotlink / anchor
 
from this perspective, it looks like that is the entire website
 
@Tay it is. but I think it's being used in another logo. I have seen it somewhere
 
is Bit a different thing than BitLink?
 
Tay
Well, chain links are used in thousands of webdev logos and icons
 
if not, you should try to be consistently using one
or is just the chain the thing to say "link"?
 
Tay
11:43 AM
The chain is subtle... (Almost too subtle)

Instead use "Bitlink" and provide some kind of minimal yet streamline curved chain splitting the text or something
something to catch the eye, but still be understood
 
@Wietlol hmm, should i just not make the top 100vh?
 
the safest approach is to use some down arrow on the user interface
 
@Tay link
 
I have a very specific website in mind, but I cant remember which one it had
 
bit link
my website has a scroll indicator joshbrown.info
 
Tay
11:45 AM
@JBis Heres a tip: Never use VH. VW is useful for situations like top bar containers...
But VH is just broken usually..
I dont like the way it works with scrolling
plus... viewing VH on iphone magnifies it enormously
 
Tay
Yeah, indicators are helpful for situations if you really wanted to use VH. But at that point, you may as well use a percentage...
Then again, I guess VW and VH arent that different from percentages
 
@Wietlol that site def scroll jacks
 
not really agree with the colouring, but the word "scroll" might also be a good thing
 
Tay
Thats too much.. An arrow is enough. IMO I think it would be too overwhelming to label an operation as simple as scrolling
 
11:48 AM
depends on the userbase
trust me :D
 
Tay
^ well that too
 
now... if you want to this over the top, you could add ML and make it learn when people think it is time to scroll down
then, when that moment happens, the website should tell the user that scrolling down is a thing
that would be UX++
but it is a pain to make things like that
and worth it? not so much for smaller businesses
 
Tay
or.. be like those very clean modern sites that autoscroll you the first time, and then let you explore on your own
 
¯\_(ツ)_/¯
 
Tay
Wait JBis, your only 2 years above me??
I saw your page, 11th grade
damn. I havent got much to say for myself in terms of portfolio, I should really whip up a resume
 
11:52 AM
@Tay I had to re-read that
why should vh not being used?
are you sure that you are using that unit correctly?
 
Tay
Its not good for universal use across screens
 
like?
 
Tay
any device going between portrait and landscape with VH is horrid
For example, an iphone going landscape and then portrait
it expands the VH too much
 
and so he has to use vw, which is also dependent of the screen ratio?
 
Tay
and if you shrink it, and go landscape, its too small for utlization
Well, in the case of VW, it expands the width of the page, useful for header bars
 
11:54 AM
it's fine as unit. just use it correctly
 
Tay
ive used VW in many of my sites that are dynamic. I try to stick away from vh though
 
what I do is just pre-adjust it with the screen mode.
 
Tay
Wdym? Screen Queries?
 
that or figuring out if being in portrait or landscape mode
 
Tay
Ive seen that too
But personally I find a nice pixel measurement that looks good on most devices.
 
11:56 AM
there is a difference between relative and absolute units.
 
Tay
a good 80% of devices have such high resolutions, that using 50-100px as your headerbar tends to look fine on all devices.

if you're picky though, it is a TINY bit big on iphones in portrait (or other tall phones)
 
each have their own approaches
 
Tay
Yup. my personal opinion: Just use dynamic variables/measurements for your body and framework.

Everything else should rely on em or px.
That works well for me
Thats what I did on my main page: https://functflow.web.app/

The framework is dynamic, page content is mostly absolute
Then again, I actually havent worked on that site in over 2 months. I should play with it and add some content
 

« first day (3447 days earlier)      last day (1508 days later) »