Jump to content

0x21

Member
  • Posts

    144
  • Joined

  • Last visited

Awards

This user doesn't have any awards

1 Follower

Profile Information

  • Gender
    Male
  • Location
    United Kingdom

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. // Add your functions below: const validateCred = arr => { ... doubleDigit = arr[i] *= 2; ... } const findInvalidCards = batchArr => { ... invalidCards.push(invalid1); ... } //console.log(findInvalidCards(batch)); console.log(findInvalidCards(batch)); You are using multiplication assignment, where I think you just want multiplication. Also, you are always pushing `invalid1` to your `invalidCards` array, as opposed to the specific card you are validating for that iteration.
  2. The byte code makes it quite clear: 1 0 LOAD_CONST 0 ((20, 60)) 2 UNPACK_SEQUENCE 2 4 STORE_NAME 0 (x) 6 STORE_NAME 1 (y) 2 8 LOAD_NAME 0 (x) 10 LOAD_NAME 1 (y) 12 LOAD_CONST 1 (10) 14 BINARY_SUBTRACT 16 LOAD_NAME 0 (x) 18 LOAD_CONST 1 (10) 20 BINARY_ADD 22 ROT_THREE 24 ROT_TWO 26 STORE_NAME 1 (y) 28 STORE_NAME 0 (x) 30 STORE_NAME 1 (y) 32 LOAD_CONST 2 (None) 34 RETURN_VALUE This is perfectly normal and what we expect. When doing an assignment, it will fully evaluate the right hand side before storing/setting the variables. The code that @jaslion is running is not in any way equivalent, hence the different output.
  3. Have you tried the solutions listed here: https://developercommunity.visualstudio.com/content/problem/464979/visual-studio-2019-is-responding-too-slow.html
  4. I've never used the library, but do you not want: // this: var testChannel = client.channels.cache.get('channel id') // instead of this? var testChannel = client.channels.cache.get(channel => channel.id === ('*channel id here*'))
  5. export: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export data: https://vuejs.org/v2/api/#data
  6. 0x21

    Bash find

    I don't quite understand your question... You want to pass a variable into the find command? You want to assign the result of the find command to a variable? Something else?
  7. Modified from the stackoverflow answer you've provided: secedit /export /cfg c:\secpol.cfg (gc C:\secpol.cfg).replace("DontDisplayLastUserName=4,0", "DontDisplayLastUserName=4,1") | Out-File C:\secpol.cfg secedit /configure /db c:\windows\security\local.sdb /cfg c:\secpol.cfg /areas SECURITYPOLICY rm -force c:\secpol.cfg -confirm:$false 1. Export the system security configuration to C:\secpol.cfg 2. Get the content of this file and make string replacement to enable your desired policy 3. Update the local security policy with the updated configuration 4. Delete the exported config file While this approach will work as is, you may want to consider Conrad's comment. If you're going to be doing anything more with security policy, you might want to consider this answer, or finding something similar (perhaps PolicyFileEditor?).
  8. You could use L’Huilier’s Theorem and do everything in terms of side lengths, which are trivial to calculate with polar coordinates.
  9. Use Girard's theorem. In the case that your angles sum to ≈ 2π, then E should be positive and ≈ π.
  10. https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image
  11. It is HTML, and you can read more about it at: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest, more specifically the "HTML in XMLHttpRequest" guide. Yes, use appendChild(), something like: document.body.appendChild(xhr.responseXML.all.namedItem('main_news'));
  12. Here you go: (function() { var xhr = new XMLHttpRequest(); if (!xhr) { console.error('Cannot create XMLHTTP instance'); return false; } xhr.onreadystatechange = extractNews; xhr.open('GET', 'https://www.startsiden.no'); xhr.responseType = 'document'; xhr.send(); function extractNews() { if (xhr.readyState === XMLHttpRequest.DONE) { if (xhr.status === 200) { // Insert this into DOM // xhr.responseXML.all.namedItem('main_news'); } else { console.error('There was a problem with the request.'); } } } })(); This will get you div#main_news, now you just have to insert it into your document.
  13. I'd suggest using watchdog for this.
×