« first day (3792 days earlier)      last day (1161 days later) » 
00:00 - 17:0017:00 - 23:00

5:00 PM
Well, whenever you do get there
there should be a small window with paths in it
find the one that starts with "PATH"
select it, edit it, and add your NPM installation folder to it
 
@MisterSirCode yeah, all depends on the website ;)
 
Path or PATHEXT
 
path
you may need to restart your cli to get it to be seen as well
 
@bigchungus PS... Default NPM directory will be one of the 3 locations mentioned here: stackoverflow.com/questions/33819757/…
just copy paste one of those into envrinment variables popup
(into the path variable)
Infact I think you could paste all 3
but if you have NPM installed in multiple of those directories, itll use the first one found I believe
 
@MisterSirCode it's ok to be blunt but only if u have a better solution to than this

`
var testForm = document.querySelector('.testForm');
var newForm = document.createElement('div');
newForm.className='newForm container pb-5';
reqForm.appendChild(newForm);

// new row
var row = document.createElement('div');
row.className = 'row'
testForm.appendChild(row)



//col 1_1
var col1_1 = document.createElement('div');
col1_1.className = 'col-1'
row.appendChild(col1_1)

//col 1_2
var col1_2 = document.createElement('div');
 
5:09 PM
Well, for one, you have to ignore comment lines and newlines / spaces
so thats more realistic
 
Well I rand Win+R to search for those paths, and nothing came up for any of the searches
but when I run npm -v in my terminal
 
@LoopingDev you'd be better off using a framework
what you are doing has been made a hundred times already
 
sorry command prompt* it tells me I am running v 6.14.11
 
@bigchungus Ok.... You DID install NPM with the windows executable installers right?
 
5:10 PM
then, whats the issue.
if npm -v is working
then you should have npm
 
That error I have I sent. when I try to npm run dev it keeps popping up
 
@LoopingDev by framework, I mean something like ReactJS or Angular or Vue.js or SvelteJS
 
@bigchungus Try "npm dev"
ps... you must have a script tag in your package.json
or it wont work
that error will appeaar
 
I do
"scripts": {
    "dev": "nodemon ./index.js",
    "secondary": "cross-env PORT=3001 nodemon ./index.js"
  },
 
@FélixGagnon-Grenier it's just one time thing besides I'm using bootstrap already
i don't wanna keep throwing scripts into the project.
 
5:12 PM
and with npm dev, it gives me npm : The term 'npm' is not recognized as the name of a cmdlet, function, script file, or operable program
 
@bigchungus well, whenever you run a script, you just have to run npm scriptName
so again, what did npm dev return for you?
 
@LoopingDev what do you mean anyway by "dynamic"? the code you show is not a dynamic form creator, you couldn't say, have three columns instead of two without changing the code. Why not simply write it in HTML?
 
npm : The term 'npm' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ npm dev
+ ~~~
    + CategoryInfo          : ObjectNotFound: (npm:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
what it returns
 
@bigchungus Go ahead and add this path to your PATH environment variable aswell `C:\Program Files\nodejs`
 
@FélixGagnon-Grenier because the user might require creating multiple forms at the same time ,I dont think I have any other options.
 
5:15 PM
Its already in there
 
is your command prompt open since before you installed npm?
 
No facepalm I just realized I never restarted VSC after install...
 
yeah that would explain that
 
...
You said you were using command prompt...
 
there are command prompts within IDEs nowadays
 
5:17 PM
You need to make sure to mention every variable of your issue...
 
I was also using command prompt
My apologies
 
@MisterSirCode c'mon, bigchungus was totally fine
 
@FélixGagnon-Grenier IDEs emulate their own CLIs most of the time, and they can often behave differently
IIRC, Visual Studio Code is on a per-instance basis and must always be restarted to see changes in path
Next time, restart your CLIs and PC first
 
21 mins ago, by Mister SirCode
@bigchungus That "you must restart to complete installation" crap mostly does nothing in most cases
 
@FélixGagnon-Grenier Installers... He said he used an installer
but he also now says he used chocolatey
good lord read between the lines felix..
 
5:20 PM
Cough cough. Haha it is all good, I didn't describe every aspect of my issue which makes it nearly impossible for anyone to really know what the damn issue is. My carelessness got in the way
 
I knew.
Don't let sir munchkin put you off, you were cooperating and described as good as you could.
 
@bigchungus Well, next time, when you install a CLI based application or software, check your PATH first, and then restart your CLIs
 
No one put me off
I don't see why there is an issue between the two of you now
 
@FélixGagnon-Grenier Insulting users in a text chat isnt helping either...
 
the issue is one-sided, I've ignored this person.
 
5:22 PM
all i see is felix talking to himself
 
now I am getting a bunch of npm ERR!
 
could u suggest one for me ?
i'm using bootstrap
 
react
or maybe a simpler component library
never used it but it seems popular
 
5:24 PM
@JBis i think react, angular vue would be an overkill , let me check ember
 
i agree ^
 
@bigchungus Are you using a premade project or a downloaded project? What kind of errors are you receiving? "<package> NOT FOUND" or something similar?
 
@MisterSirCode premade/downloaded
its from a pluralsight course. Trying to better learn async and promises
 
Try running npm install
just to make sure all the packages are included
 
in my VSC terminal?
 
5:27 PM
As long as its in the folder
so yeah that should work
 
yo @KevinB you tried Rust yet?
 
Rust is a difficult logic language. A friend of mine used a 500 line rust package to create a decompiler for a game we play... and man, its nearly unreadable.

The syntax is unlike any other language Ive ever used
 
the axios library I am using is already included and referenced in the html files of the project so I shouldn't have to do a npm install
 
Definitely not as fun or easy as javascript
 
@MisterSirCode or maybe its shit code
 
5:31 PM
But if youre recieving errors, either theres something wrong with the code or your missing a referenced package.

Even if its "referenced" in the html files, it might still rely on a package.
Theres no hurt in running NPM install
 
I got it
It is running on JSON server now. Thanks
 
@JBis Kinda rude to immediately assuming something is shitty just because it has cyclomatic complexity
like jeez, what is with your guyses attitudes today
 
maybe you are part of it?
you've said I insulted people in chat, which I did not
 
@FélixGagnon-Grenier Have you noticed that nothing negative was occuring until you hopped on the bandwagon
 
you say JBis was rude, whereas that was just common sense
 
5:32 PM
> A friend of mine used a 500 line rust package to create a decompiler for a game we play... and man, its nearly unreadable.
 
This chat is unnecessarily toxic
I live for it
 
I was providing an alternative (and more likely) explanation
 
Sure, we all love our toxic internet bullcrap... but in a chat about programming, its pretty annoying.
 
you pounced on bigchungus because they did not provide exactly all information like you wanted
 
@FélixGagnon-Grenier What? No, I was judging YOUR nonsensical insults.
 
5:34 PM
I'm very confused, what is going on here.
 
@MisterSirCode can you link to any such insult?
 
@JBis Just arguments between two internet users... probably healthy not to get involved
 
no longer bigchungus finally was able to name change
jk
 
ok i think i found what I'm looking for , i could actually write it down in html then clone the entire div
 
didn't transfer over to chat?
 
5:35 PM
@FélixGagnon-Grenier here we go, this message right here, if this isnt an insult to you, I seriously wonder what is...
 
Does name on SO/all public sites not immediately transfer over
 
ember.js is huge as well
 
@MisterSirCode wat? how is don't let that guy put you off an insult?
 
@FélixGagnon-Grenier Excuse me... What?
Ok, no offense, but that sentence makes no sense
 
how is that an insult? I was describing what you were doing
 
5:37 PM
@FélixGagnon-Grenier i think he was referring to "sir munchkin"
 
@FélixGagnon-Grenier You seem to be completely 100% oblivious to the fact that you called me a rude name out of the blue, instigating an argument, and blaming it on me
For no reason
 
I used munchkin because at that point, I had ignored you and didn't remember the name
munchkin is a name of something nice, btw
generally used to denote something that has a lot of resources, and power
 
@FélixGagnon-Grenier Excuses.. You started an argument for nothing... and you cant even take responsibility for it
@FélixGagnon-Grenier Thats a total lie...
 
No, that is how that word is used in my life
Please don't presume to know all humans and their language all over earth
 
this has gotta be one of the dumbest arguments on this chat
 
5:39 PM
yeah
 
well, if your culture turns another word for a midget into a word equal to that of "powerful leader" than good for you
but most of the world with an english culture understands that word as an insult to call people small
 
This room was placed in timeout for 1 minute; Take a min to relax
when room comes back, just move on
 
the timer is really nice
 
@FélixGagnon-Grenier i have not
 
If you have time, I highly recommend
I think it's the first time a language reminds me that technology is so nice and gives me dreams of world-changing technologies
 
5:42 PM
@FélixGagnon-Grenier anyway @FélixGagnon-Grenier i tried rust recently and found it quite difficult but manageable. Their tutorials are really nice.
 
yeah, the developper experience is the best I've ever had, and the book is soo insightful.
 
there just seems to be a lot of new concepts , so its a lot to get used to
 
see, i wasn't sure at first whether you were talking about the game or the language, but i mean, the answer is the same either way
 
1 message moved to Trash can
 
@JBis yeah, the ownership concept is quite new
 
5:44 PM
1 message moved to Trash can
 
too busy to mess with a new language, too busy to try a new game,
 
@MisterSirCode all memes (from me at least) <3
 
@FélixGagnon-Grenier i also don't have experience with a low level languages so getting used to pointers, heap/stack, how strings are stored internally, are all new to me
 
right now i'm trying to navigate apple's app submission process
 
5:45 PM
good lord
 
was all easy when i was using xcode, it just worked
livecode..
not so much
 
@JBis yeah, it was for me too. reading the rust book really helped.
 
"Your provisioning profile is invalid. You don't have a code signing cert, please create a distribution profile"
dude
how do you think i submitted it
 
also trying Go right now
seems easier for quick scripting
 
5:47 PM
today my task is upgrading livecode to the most recent version so i can use xcode11+, and trying their new xcode11+ only process for submitting apps
and hoping doing so doesn't completely break this app i didn't build
 
I wish you the best of lucks
Litterally every anecdote I've ever heard of interaction with apple programming shenanigans have been wholefully negative
@JBis that sounds about right. getting Rust's compiler to run one's crappy code is an achievement by itself, in the early stages
 
I'm betting once i finally get it submitted, they won't let me send it to our dev devices without uploading a video
just like last time
 
a video
They had to review the app, but because the app is built to interact with a piece of hardware over bluetooth, it can't be demo'd without said hardware
 
well, at least it's not a fax
 
5:50 PM
so they needed a video to show that it worked
 
-2
Q: How to split nested ternary operator into normal if else condition

user13465472I was trying to understand ternary operator into normal if else condition. stateable = data.length > 0 ? data[0].list > data[0].somelist ? Product.ADDING : Product.REMOVING : Product.NOTHING how to understand this multiple nested condition

Do we not have a canonical for How to convert between conditional operator and if statements?
I’ve seen such questions so many times and never know what to do with them.
 
i doubt such a simple question exists
 
shudders with horror at the thought of ternary operators, remembering the absolute train wreck of a garbage fire how PHP ones work with left association
 
the only thing about go is there is no dependency manager
so you have to vendor dependencies or risk a left-pad
 
huh, my extremely brief acquaintance with Go did not get me as far as that, I think
 
6:11 PM
there is no npm, you instead just add dependencies directly with github. But someone can simply remove their repo or change access and you're screwed.
 
6:31 PM
@KevinB I’m thinking about writing such a canonical…
 
|| mdn ternary operator
 
reading that should be sufficient
 
@JBis But I can’t close a question as a duplicate of MDN docs.
 
unfortunately
 
6:50 PM
pushed some changes to @JamesBot. May have broken some message parsing idk we'll see.
 
7:08 PM
Needs more tests ^
:P
 
tests can't fail if you don't have any :D
 
!!||
 
|| say ||
 
changes was supposed to fix this:
|| echo "test"
 
{1}
undefined
 
7:16 PM
oh well
 
!!echo "stahp"
 
stahp
HAMMAHTIME!
 
at least the ordering is better
 
hey I'm getting "dynamicForms.js:75 Uncaught TypeError: Cannot read property 'getAttribute' of undefined"

even tho I was able to see it on the console
 
@LoopingDev Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
 
7:19 PM
@LoopingDev Is your <script> above your HTML with no defer attribute and no DOMContentLoaded or load listener? See Why does jQuery or a DOM method such as getElementById not find the element?.
 
add a breakpoint/debugger line to line 75
 
1 message moved to Trash can
 
how to formate the code ?
 
> hit Ctrl+K before sending
 
@LoopingDev Ah, I see now. See JavaScript closure inside loops – simple practical example. Since i is undeclared, it’s not block-scoped, so i will be equal to formbtn.length inside your event listener.
 
7:21 PM
:51716320 it's actually run under

document.addEventListener('DOMContentLoaded', () => {


var formbtn =document.querySelectorAll('.newFormBrn');

        for (i = 0; i < formbtn.length; i++) {

            console.log(formbtn[i]);

            formbtn[i].addEventListener('click', () => {

            var typ = formbtn[i].getAttribute("type")

            document.querySelector('#type').className.appendChild('show')

            })
        }





})
the class ( formbtn ) has data-type('something')
 
That being said, use event delegation instead of assigning multiple events — it’s more maintainable, and applies to dynamically added elements.
 
@SebastianSimon i thought i already do

formbtn[i].addEventListener('click', () => {
it's inside the loop
 
right
but think about what happens to i
If your question was asked on SO, it'd be dupe closed with stackoverflow.com/questions/750486/…
 
@LoopingDev You’re assigning multiple events in a loop. That’s not event delegation. Correct code would look like this:
document.addEventListener("DOMContentLoaded", () => {
  addEventListener("click", ({target}) => {
    if(target.matches(".newFormBrn")){
      // …
    }
  });
});
 
@SebastianSimon Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
 
7:26 PM
wat
 
wat
 
@JamesBot Gah, I forgot, sorry!
Next, document.querySelector('#type').className.appendChild('show') makes no sense. .className is a string. You cannot append a child to a string. You probably mean document.querySelector('#type').classList.add("show");.
And typ = formbtn[i].getAttribute("type") is completely unused…
@KevinB Is there a problem?
 
just learned a lot about promises like .finally and error handling in promise chains
 
async function foo(letter){ console.log(letter) }

setTimeout(() => foo("A"), 0);
console.log("B");
foo("C").then(() => console.log("D"));
console.log("E");
@BeerusDev whats printed?
 
@JBis Uncaught SyntaxError: unexpected token: identifier.
 
7:37 PM
@SebastianSimon thanks alot it worked , I havent used js for a year and I can't recall ever doing fetching anything this way.

anyway i was able to get the right value for the target ( thanks to u ) but you are right about getAttribute part

I'm trying to get the value of (data-type="something" ) from target
 
@LoopingDev That can be done with .dataset.type.
Trying the bot command:
|| mdn dataset
 
@SebastianSimon yup it worked thanks a lot :)
 
8:04 PM
I made a shiny new docs site and I love it
 
@phenomnomnominal wow nice!
 
I used Docusaurus! It's so cool
 
Hi everyone
0
Q: Nuxt.js program not running on the Main Domain with Apache in Ubuntu

MRS1367I have a Nuxt.js program that I run on Apache in Ubuntu OS. When I port it to a subdomain like www.example.com, it works fine; But when I port it to the main domain such as example.com, my program does not run. Examples of Ubuntu Server and Apache settings are as follows: /etc/hostname example /...

Can anyone help me with this problem...
Thanks in advance...
 
8:22 PM
@JBis BCEDA is logged
But missing a ; after the first console.log()
 
 
1 hour later…
9:37 PM
 
In Node if I have an array of line numbers is there not a way to parse a file? Searching I found split but that seems I have to read line by line and increment to the line, build the string then after the last line number reset the new string.
 
i mean
to get line 5, you need to have lines 1-4 to count
 
10:07 PM
@DᴀʀᴛʜVᴀᴅᴇʀ split and filter
Files are stored in terms of bytes, there's no way to read only specific lines without know the exact byte lines start and end.
 
user7396942
10:53 PM
js
 
user7396942
java
 
00:00 - 17:0017:00 - 23:00

« first day (3792 days earlier)      last day (1161 days later) »