« first day (3117 days earlier)      last day (2056 days later) » 
03:00 - 23:0023:00 - 00:00

user8729657
03:50
What run level do you guys keep your servers at on a scale from 0-5?
07:36
@OvieAdese 5/7
07:59
The biggest lidless box you can produce from a flat 3 by 3 sheet is 1 square unit isn't it?
1 cubic unit I should say
 
1 hour later…
09:04
Hello! I am trying to debug my loopback program
and when running the breakpoints in a file comes into gray color and they are not reached
And it says breakpoint set but not yet bound
 
1 hour later…
10:15
@QuicoLlinaresLlorens set but not bound means it can't map that breakpoint in the code to the binary being executed
Back in my C++ days, that basically meant the binary was being compiled without debugging info
I'm just speculating, but my guess is that it can't match up your source with what's being executed
are we talking about javascript?
well this is a javascript chatroom afterall
how can he have that breakpoint issue?
never seen/heard of it in javascript tbh
oh, a VS(code) quirk
I use browser debugger :P
10:31
I think it can't happen in a browser
I mean you're literally debugging what you see
there has to be some discrepancy
@PhilippeDelestan 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.
Hello, I'm trying to get my "if" function executed in this code but it doesn't work. Could someone help me? If you enter an amount less than 12000, the calculation is done qan even though it should just say "unqualified!" function calcAmount6(){
var userAmount5 = document.getElementById("amount6").value;
var userAmount6 = document.getElementById("amount7").value;
var oneLevel1 = 12000;

if ((userAmount5 + userAmount6) < oneLevel1){
document.getElementById("marginAmount6").textContent = "Non-qualifié!";
@PhilippeDelestan There's something missing here.. if you use "else if", then assuming userAmount5 + userAmount6 is less than 12000, then the "else if" shouldn't even be evaluated
Can you recreate the problem using jsfiddle? jsfiddle.net
Yes but i haven't work whit jsfindle. I have just to copy-paste the code and give you here?
HTML<p>CALCUL GAINS PILOTE QUALIFIE</p>
<p class="minimum2">(Points total minimum groupe conseillers + groupe animateurs = 12000 )</p>
<div class="blocklabel5">
<label for="points amount" class="label6">Entrez points groupe conseillers</label>
<input type="number" class="amountEnter6" id="amount6">

</div>

<div class="blocklabel6">
<label for="points amount" class="label7">Entrez points groupe animateurs</label>
<input type="number" class="amountEnter7" id="amount7">
<input type="submit" value="Commissions pilote qualifié" id="submit7" class="submitEnter7" onclick="calcAmount6()">
10:59
@PhilippeDelestan one sec
@Neil i'm not understand how can i communicated with you with jsfindle.
@PhilippeDelestan jsfiddle.net/17obxfd3
This is your problem, correct?
yes
oh sorry
If you want submit7 to perform an action on the page, it should be input type="button"
if it is submit, it will attempt to submit the form
If you want it to submit the form, then have onsubmit="calcAmount6()"
and if you want to submit, be sure that "return true" is returned
i'm no really understand how does i must do for work with jsfindle and you. But here, your answer really help me
11:05
I hope so :)
good luck
at least I think so.
yes thanks!
no sorry it didn't make my program operational.
11:19
@PhilippeDelestan did you have starred all of these comments? The star thing is not a "Like" thing such as in facebook. It is for noteworthy messages that others should be aware of
can you clean these?
how can i do that?
just click on it again
it doesn't work!
will do it for you
did not remove the last one.
@PhilippeDelestan if you're going to be using JS, you probably want to get used to jsfiddle...
11:31
@Neil Yes, it was not possible to reach it. Thanks!:D
@QuicoLlinaresLlorens Glad I could help :)
11:57
something weird is happening with my code editor...
i have the exact same code on both jsfiddle and glitch and for some reason glitch is giving me cannot set disabled value of undefined or something. On Jsfiddle it works fine. is there something im doing wrong?
might anyone know the best path to Internationalization (language) in Angular cli 7. I was tasked with looking into ngx-translate. Is there a better option anyone might know of?
the error is cannot set property disabled as Null
@ThomasTallman are the code exact matches?
could be that you are having the famous "run script before required html is present" issue
both are the exact same
i copied and pasted the stuff on the fiddle to glitch
and its not working.
gtg anyways
@KarelG what is that
12:18
if your code runs before the dom is ready, you might end up accessing elements that don't yet exist
so you might want to make your code only run at the end (by either putting it at the end of the html or calling it from window on load)
click the dropdown arrow of the JS section of jsfiddle and notice the "load type" option...
@JBis what is unclear about that?
Hello guys how can I get a length property of an Object that consists of other objects? just simple object.length shows undefined
you want to calculate the total size of your object?
I want to know how many objects it contains
it's not the size that counts, it's how you use it
12:25
Object.values(obj).length
but that won't do nested objects
12:37
Hi guys, in google maps is it possible to get the distance in km from the closest highway from an adress ?
you can find the nearest road then check if it's a highway
or you can find all highways in the city and check against your market
I don't see any API endpoints that will return the nearest 'highway' specifically.
i need help ): i cant find out what im doing wrong with glitch
fantastic @rlemon ! is it possible to get the distance to the closest "highway" somehow ?
..
did you just read everything I said then repeat the question?
12:41
it just keeps saying cannot set property disabled of null
@ThomasTallman two people have already indicated your issue is most likely loading order
glitch is the real glitch now
@rlemon ohhh sorry !
also, I'm finishing my coffee and decided to do the object counting issue with regexp. doesn't ofc work on functions or symbols or anything else that doesn't work for JSON
JSON.stringify(obj).match(/("\S+?":)/g).length
please never use this code.
well idk tbh glitch doesnt have any loading order options or whatever
12:45
Because you do that manually
@rlemon why not write a function yourself that does it recursively>
something like
@KarelG too mainstream
function objLength(obj) {
  let len = 0;
  Object.values(obj).forEach(v => len += (!!v && v.constructor === Object ? objLength(v) : 1));
  return len;
}
boo
Recursion is for nerds
12:47
🤓
@ThomasTallman someone already told you
that object check is an old hack tho
im not talking about jsfiddle im talking about glitch
did not find a nice one that replaces it atm
.. yes and someone already told you
29 mins ago, by LFLFM
if your code runs before the dom is ready, you might end up accessing elements that don't yet exist
12:48
and how do i fix that? is it something with the order of the functions?
read everything he wrote after that message
pretty sure hes talking about jsfiddle
it works there.
it is just your glitch
and by the end of the html does he mean use <script>?
he's talking about how to fix your issue
12:50
you need to check how and when to use the javascript tags.
not jsfiddle. he explains why it occurs from jsfiddle.
go read an article on how the webpage is parsed
and in what order
Oh
i have to put my script tag at the end
:facepalm:
it worked :P
im dum
it would take me forever to add every single if statement to all my functions in the origional game, although maybe i can take everything from the very first function which probably includeds every single if statement.
what?
Reading it twice. Still clueless
let me re-explain:
my code is very long and has loads of if statements in each function
12:58
Refactor your code then?
or even redesign
and to be honest if i made one function with every if statement and called that function inside of the other functions, it would do all of them for me.
yeah i might have to re design.
ctrl+a,del,ctrl+s
i dont know.
whats ctrl + s
save?
i worked really hard on the game too and it would be upsetting to do that.
redesigning may be necessary. definitely. god damn it
13:07
refactoring gets a little easier every time you do it
you still want to pull your hair out, but what can ya do?
to be honest it was glitchy anyways. ill work on a new project.
also does anyone mind telling me how to indent properly lol
like can someone give me a quick example on how to indent Html properly? i want to be neat
find a style guide, stick with it
better yet, stop using stupid online editors, download a read editor, install a linter, let it run your life.
im in school rn. thats why im using online editors.
then find a better one. :P
13:12
online editors have their perks
that said, I wouldn't be caught without a good installed editor
sure, sometimes. but as a main editor.. you need to have a really good online IDE
dont worry, i have a very expensive pc at home. mind suggesting something that i can download?
you can run any good IDE from a tamagotchi.
yknow for coding
power isn't really important here
13:15
oh. wait what is an IDE?
sorry if that was a stupud question i dont know what it stands for
@KarelG I'll assume that's the large scale version :)
I couldn't get it due to my proxy
13:19
@rlemon lol was joke. I liked the license.
also you do realise I'm not the author right?
HAIL ZIRAK!
the fancy yellow shining god with dem dali mustache that created and shaped caprica six to be our slave!
how do i make something onLoad again?
i forgot :P
listen to load event
wdym by that lol
can u show an example
13:25
does your school also block google?
le google it
no
it doesnt
then use it
we're not your personal google.
true
i use this if google doesn't answer but ive been going to far
ofc we aren't his personal google. We are fancier. We demand a "high level" user
*whips hair*
13:27
@KarelG technically she was always meant to be his slave. he created her to play hangman on a lonely christmas eve
or maybe new years.
t'was christmas
Dec 24 '11 at 22:44, by Zirak
@IvoWetzel @Raynos May I try and test a hangman bot in this room?
k lemme try something
> The word list is actually like 20k words.
I was imagining having that data during the js runtime back then (2011)
14:01
Can anyone tell me why this function is running infinitely? It should be running every 2 seconds.
function checkForNotifications() {
    console.log('checking for notifications..');
    setTimeout(checkForNotifications(), 2000);
}

checkForNotifications();
checkForNotifications() <- result of a function
checkForNotifications <- function itself.
so right now you're just calling a function in itself, hence the endless recursion
checkForNotifications calls checkForNotifications calls checkForNotifications.. etc.
and you're setting undefined to your setTimeout call
it never gets to that point
Thanks, I'm a bit rusty with JS.
14:04
np
Is there a reason their always updated? Even when there are no db changes.
function checkForNotifications() {
    axios.get('/api/user/notifications/get')
        .then(function (response) {
            if (response.data != document.getElementById('notifications-area').innerHTML) {
                console.log('Updating the notifications...');
                document.getElementById('notifications-area').innerHTML = response.data;
            }
        })
        .catch(function (error) {
            console.log(error);
        });

    setTimeout(checkForNotifications, 2000);
I load the exact same template for initial notifications and updated notifications.
@AdamG don't bother checking, just assign
unless you have a reason to know when it happens
or unless you're making a big page update each time, in which case do something differnet than this
ideally you should be sending JSON to your page, and you parse that info accordingly
Is has this weird flickering affect when its constantly updating, its pretty annoying.
returning json from my api you mean?
if you send html, you won't ever know if there has been a problem
yeah
what if your server sends you a 404 page.. you'd be updating your page with the 404 page every 2 seconds
generally not a good idea
How would I go about doing that? I knew that was a better way, but it seems pretty hard in JS... like you would have your html elements in 2 places, no?
Or do you initially load from the api aswell
14:18
well depends entirely on what you need to do
if your updates have unique ids, you can use that to your advantage
Just fetch notifications for the user from the db
yeah, my notifications table have an id column
create html tags whose id is the same id as the one from your db
you receive json from your server, parse it, and ask if that id is on the page (document.getElementById)
if it is there, update it, if not, create a new one
wouldn't a data-Id attribute be better?
you could also do that I suppose, though not sure if that affects lookup speeds
"create html tags whose id is the same id as the one from your db" I'm guessing you mean something like id="notification1", id="notification2", not just the literal id right?
14:20
also you should consider using websockets instead of polling the server every 2 seconds
@AdamG no, I mean literal id yes
if you're worried about conflicts, then add a prefix like "dataItem12343"
server-sent events
this is 1 way
wouldn't that kind of suck if I wanted to use this for two things?
oh yeah sure
I was thinking like id="userNotification19" ... etc
with the prefix, there shouldn't be issues
or probably better still, have class="userNotification" and data-id="19"
when you search for it, you search using both the class and the data-id
good idea, thanks.
would probably be cleaner still
if you take no other advice though, at least don't send direct html to the page to update
14:23
I'm going to use the json way, It's a lot cleaner.
with json you can indicate errors, and directly update only what needs updating (no more flashing)
Just get my API to return json then parse it via js
it also means I don't have to load notifications upon page load.
json should have a way to show that errors have occurred, and if you don't receive json, it's a big error :P
so you can safely assume you'll get json
I'm guessing a good place to start would be JSON.parse() ?
only way to parse it, yeah
14:27
!!s/only/only sane/
@rlemon only sane way to parse it, yeah (source)
Seems the JS interpreter did it for me.
14:49
posted on April 29, 2019 by Michaël Zasso

Notable changes intl: Update ICU to 64.2. This adds support for Japanese Era (Reiwa) (Ujjwal Sharma) #27361. Fixes a bug in ICU that affected Node.js 12.0.0 in the case where new Date().toLocaleString() was called with a non-default locale (Steven R. Loomis) #27415. C++ API: Added an overload EmitAsyncDestroy that can be used during garbage collection (Anna Henningsen) #27255. Commits [8

15:40
posted on April 29, 2019 by CommitStrip

16:02
Hey guys for example I have an object containing array of objects - DataObject{Jerry: {age:10, weight:200}, Terry: {…}, Alice: {…}, Bob: {…}, Charly: {…}, â€¦} ...
How do I loop through the array the correct way? I tried to loop with DataObject.length but length returns undefined. Another thing I tried is to get innerObjects names with Object.keys(DataObject) and then loop through them but this approach makes it hard to use object properties then
well objects are not arrays
you can't loop them. you can get an iterator and loop that
Object.keys/entries/values - or you can use their internal iterator in for..of
if you control the data. format it in an array. instead of names being keys
[ { name: 'Jerry', age: 10, weight: 200 }, { name: 'Alice', ... } .. ]
cannot loop objects - wow that hurts, but thanks. Unforchently I don't control the data, other wise I would do an array 101%
I ask one more question if its ok, so, for example, I make an array of names with Object.keys(DataObject) and get ["Jerry","Terry","Alice",...] and I want to access Jerry's age (DataObject.Jerry.age). How do I convert string "Jerry" into a variable name Jerry thats useable with an object? I tryed eval("Jerry") but it says something like its not function
16:18
You mean like DataObject["Jerry"]?
..Thank you sir
17:26
for angular internationalization does the browser language or OS language matter most?
17:39
@JBis well that's not Github's fault
17:51
@forresthopkinsa ofc not. Just interesting article.
Agreed. I do think the title is a little accusatory though
I guess accusatory gets clicks
It got mine lol
18:10
Difficult for average (and even some more technical) users to protect themselves against stuff like that
18:44
jquerylol.ru
lol
replace the powerpoint presentation with "why do I have a full clone of AOSP on my computer"
19:00
my phone has 8gb out of 10gb filled up with "other"
apparently only way to get rid of it is to reset the phone
Excellent
eh, it's actyally 8gb out of 16gb
6gb of apps
is there a way to listen for event with socket.io globally and not listen to it with each socket? e.g make it so a specific event is caught like connection/disconnection.

E.g server.on('my-special-global-event', (data, socket) ...
like, track when any individual socket makes a connection or disconnects?
No, i want to listen for an event like it listens for connection/disconnection
example:
server.on('connection', (socket) => {});

// this is custom one
server.on('my-custom-event', (data, socket) => {});
like listen for it globally, and not inside of on connection, socket.on(...)
19:14
i mean
they say right there that you can't do it
> Nothing can be sent outside of the handshake.
However, you can create a function (or event not on server) that you can trigger under whatever circumstance you trigger it on.
19:27
lmao
 // the function women think is lacking in men
    listen: function (regex, fun, thisArg) {
20:06
wth lol
@DavidKamer Zirak.
I don't even understand what that was supposed to mean
@DavidKamer Women say that men don't listen.
oh bc it's listening
lol, yeah I get it
I feel like that comment was translated from russian
user8729657
20:15
@MadaraUchiha, thats a good thing :)
@forresthopkinsa yeet.
2
@MadaraUchiha gotem
@forresthopkinsa 🚽
@KevinB excellent
20:27
@forresthopkinsa Nice
@DavidKamer :o
user8729657
20:46
what run level should I leave my server at?
user8729657
I heard about all these mallicious port 22 attacks from websites you visit
my XY senses are tingling
ok
if you're concerned about SSH then move it to a different port and require key auth
the answer to your runlevel question is probably 3
user8729657
Ight
but that's also not something that you should need to configure
user8729657
I didn't install minimal version for this server though
20:49
you're running a desktop environment on your linux server?
user8729657
Home server
R K
R K
how to change <img> src value on hover of a div?
user8729657
yea
hmm I don't really see what qualifies it as a server distribution then lol
user8729657
lol oww
20:50
I mean, you can use a standard graphical distribution to run a server but you lose some advantages of a CLI OS
like performance, obviously, but also things like consistency and predictability
if you're not comfortable in a CLI then you may be better off with a desktop distribution though. Anyways, I really don't think you need to lower your runlevel when running your server
user8729657
But, can't I change the run level and I'll have CLI OS?
user8729657
I mean I'd rather use the CLI
I mean you can but are you going to change that whenever you work on it?
if you'd rather use CLI then just uninstall the display server
user8729657
I'd have to reset up everything from the beggining, my virtual server and the networking
I don't think you would
What distro are you using?
user8729657
20:54
18.04 bionic beaver and I have 3 Centos 7 vms running
user8729657
dual boot with windows
you're using the VMs for services?
have you considered Docker? those VMs are probably using a considerable amount of this machine's resources
I mean I don't know all the factors but they might not be necessary
anyway that's not your question. Ubuntu 16+ doesn't even use the term "runlevel" anymore afaik
user8729657
Like I said early before I wanted to have the bionic beaver act as a router and route traffic to these vms
oh I didn't realize the VMs were on the same machine when you asked that
it sounds like overkill
user8729657
Foreal @forresthopkinsa, no more runlevel
20:57
anyway I gotta go, sorry. just realized running late for something
user8729657
Np l8er
look up "ubuntu systemd targets"
!!afk lunch
user8729657
ty
21:09
@forresthopkinsa yeah I've never heard of runlevel
@DavidKamer forresthopkinsa is afk: lunch
21:56
Yo, someone tossed me a horribly old repo with a grunt.js file that has syntax like this in it, that I've never seen before: '<%= ui %>/css/<%= package.name %>.css': '<%= ui %>/scss/<%= package.name %>.scss', <--- that goes where normally i'd put a path for a scss input and css output. I thin kit has something to do with github.com/firstandthird/load-grunt-config but I'm not sure - anybody ever seen that syntax before?
The linked plugin does use that same syntax but I can't find any info on it, like finding out how "ui" gets populated and etc
I have seen it a few times
That gives me hope :D
I mean it does look like a templating syntax I just have no idea which one
or how to find out what's getting popped in to like package.name
most likely, it's pulling from the package.json
actually, package.name appears to be: "Auto expose package.json (<%= package.name %>)." from the docs. Nothing about the other ones
Can you share the file?
or, the top of it
21:59
Hmm... good shout, lemme try popping in some parts of those variables into package.json
yea one sec lemme strip out HIGHLY_VALUABLE_INFORMATION (notwithstanding we'll never extract value from this project lmao)
npmjs.com/package/load-grunt-config is probably the closest you'll get to documentation for that
Yup that was what I was on T_T
Cheers though
Terrifyingly, raw searches for that package.name string turn up literally nothing relevant
what black hole of ancient code have i waded into
Why didn't I become a devops engineer
I was on on the github version github.com/firstandthird/load-grunt-config
user8729657
that syntax looks ejs
This looks relevant:
7
Q: How do I use the "version" property in package.json as the app's directory in grunt?

onearmfrogI'm managing a project written in angularjs, with the default directory structure, excluding the app directory which uses versioning (ie. "app/0.0.0/", "app/0.1.0/" etc..). I'm trying to use grunt's package.json file's "version" property to load the correct directory so I won't have to manually...

something grunt is doing?
yeah
it's grunt
22:41
Lol fuck it we just took the working build from my coworker's machine and threw the static files on mine
yay web dev
Cheers all
R K
R K
22:53
what is this in the marked answer here (stackoverflow.com/questions/31880425/…) ?
@RK In an event listener defined with a normal function (i.e. not an arrow function), this will be the element on which the event was bound on
R K
R K
so which element is the event bound on in the given answer?
@MadaraUchiha
Whichever element matching the selector .threeBox a that was hovered.
03:00 - 23:0023:00 - 00:00

« first day (3117 days earlier)      last day (2056 days later) »