<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Rodrigo</title>
    <description>The latest articles on DEV Community by Rodrigo (@thesurfer26).</description>
    <link>https://dev.to/thesurfer26</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1462297%2F65fb01a6-cf81-4197-ad4e-f9ea0010214b.png</url>
      <title>DEV Community: Rodrigo</title>
      <link>https://dev.to/thesurfer26</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/thesurfer26"/>
    <language>en</language>
    <item>
      <title>Help running a vue.js program created in older version</title>
      <dc:creator>Rodrigo</dc:creator>
      <pubDate>Thu, 12 Dec 2024 21:13:40 +0000</pubDate>
      <link>https://dev.to/thesurfer26/help-running-a-vuejs-program-created-in-older-version-187i</link>
      <guid>https://dev.to/thesurfer26/help-running-a-vuejs-program-created-in-older-version-187i</guid>
      <description>&lt;p&gt;Hi, I'm trying to run a vue.js program and I get this error when run &lt;em&gt;npm install&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;My system:&lt;br&gt;
MacOs 12.7.4 Monterey&lt;br&gt;
node -v22.12.0&lt;br&gt;
npm -v10.9.0&lt;br&gt;
&lt;a class="mentioned-user" href="https://dev.to/vue"&gt;@vue&lt;/a&gt;/cli 5.0.8&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm warn old lockfile
npm warn old lockfile The package-lock.json file was created with an old version of npm,
npm warn old lockfile so supplemental metadata must be fetched from the registry.
npm warn old lockfile
npm warn old lockfile This is a one-time fix-up, please be patient...
npm warn old lockfile
npm warn old lockfile Could not fetch metadata for vue-loader-v16@16.0.0-rc.2 vue-loader-v16: No matching version found for vue-loader-v16@16.0.0-rc.2.
npm warn old lockfile     at module.exports (/usr/local/lib/node_modules/npm/node_modules/npm-pick-manifest/lib/index.js:215:23)
npm warn old lockfile     at RegistryFetcher.manifest (/usr/local/lib/node_modules/npm/node_modules/pacote/lib/registry.js:130:54)
npm warn old lockfile     at async /usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:715:24 {
npm warn old lockfile   code: 'ETARGET',
npm warn old lockfile   type: 'version',
npm warn old lockfile   wanted: '16.0.0-rc.2',
npm warn old lockfile   versions: [
npm warn old lockfile     '16.0.0-beta.5',
npm warn old lockfile     '16.0.0-beta.5.1',
npm warn old lockfile     '16.0.0-beta.5.2',
npm warn old lockfile     '16.0.0-beta.5.3',
npm warn old lockfile     '16.0.0-beta.5.4'
npm warn old lockfile   ],
npm warn old lockfile   distTags: { latest: '16.0.0-beta.5.4' },
npm warn old lockfile   defaultTag: 'latest'
npm warn old lockfile }
npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: calendar_app@0.1.0
npm error Found: eslint@6.8.0
npm error node_modules/eslint
npm error   dev eslint@"^6.7.2" from the root project
npm error
npm error Could not resolve dependency:
npm error peer eslint@"&amp;gt;=7.5.0" from @vue/cli-plugin-eslint@5.0.8
npm error node_modules/@vue/cli-plugin-eslint
npm error   dev @vue/cli-plugin-eslint@"~5.0.0" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Help in figuring out how to open the project.&lt;br&gt;
It does not create the node_modules folder&lt;br&gt;
vue-cli is installed globally&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Help with a function in java script</title>
      <dc:creator>Rodrigo</dc:creator>
      <pubDate>Sun, 19 May 2024 20:34:41 +0000</pubDate>
      <link>https://dev.to/thesurfer26/help-with-a-function-in-java-script-3188</link>
      <guid>https://dev.to/thesurfer26/help-with-a-function-in-java-script-3188</guid>
      <description>&lt;p&gt;Hello, I'm a student, so as I'm still trying to grasp the concepts on event listeners I'm trying to solve a project that involves solving random math problems in 30 seconds and keeping a score to each correct answer. The initial stage of the project displays a  box with the operators inside an , the values being addition, subtraction, multiplication and division. Next to it a  called "Go" that calls the function onclick="startGame()" and a few instructions... all these wrapped inside a .

&lt;/p&gt;
&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fop65y47f5as405knyx57.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fop65y47f5as405knyx57.png" alt=" " width="636" height="290"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once the button its clicked. It suppose to hide the &lt;/p&gt; and display a  which contains the Operation that was selected, the random operation, a focused input field to enter the answers, the calculator buttons to select or type your answers, the score count and the countdown timer. At time left=0, the game stops and displays the final results and a button to re-start the game again.

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsumgf1ey9fvhfj6oq1qm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsumgf1ey9fvhfj6oq1qm.png" alt=" " width="362" height="696"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'm getting confused on how to achieve this inside 1 function that gets called when the "Go" button gets clicked as there are different tasks to handled.&lt;/p&gt;

&lt;p&gt;My main problem is syntax and how to add them inside the function (or maybe I need to do separate functions?)&lt;br&gt;
Hope someone can shine some light...&lt;br&gt;
I still haven't done the code to check if the answers are correct to add to the score and when the timer gets to 0 to display final results and a re-start button.&lt;/p&gt;

&lt;p&gt;I did not include css as is not important to the question, just styling.&lt;/p&gt;

&lt;p&gt;This is what I have so far:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;HTML&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;


&lt;br&gt;
&lt;br&gt;
    &lt;h2&gt;Math Facts Practice&lt;/h2&gt;
&lt;br&gt;
  &lt;br&gt;
    &lt;br&gt;
      &lt;h4 id="select"&gt;Operation:&lt;/h4&gt;
&lt;br&gt;
      &lt;br&gt;
        &lt;br&gt;
          Addition&lt;br&gt;
          Subtraction&lt;br&gt;
          Multiplication&lt;br&gt;
          Division&lt;br&gt;
        &lt;br&gt;
      Go&lt;br&gt;
    &lt;br&gt;
    &lt;br&gt;&lt;br&gt;
    &lt;br&gt;
      &lt;ol&gt;

        &lt;li&gt;

          Select operation.
        &lt;/li&gt;

        &lt;li&gt;

          Press &lt;span&gt;&lt;strong&gt;Go&lt;/strong&gt;&lt;/span&gt;
        &lt;/li&gt;

        &lt;li&gt;

          How many problems can you solve in 30 seconds?
        &lt;/li&gt;

      &lt;/ol&gt;
&lt;br&gt;
    &lt;br&gt;
  


&lt;br&gt;
    &lt;br&gt;
      &lt;p&gt;Selection&lt;/p&gt;
&lt;br&gt;
      &lt;p id="random-operation"&gt;RO&lt;/p&gt;
&lt;br&gt;
      
&lt;br&gt;
    &lt;br&gt;
     &lt;br&gt;
        1&lt;br&gt;
        2&lt;br&gt;
        3&lt;br&gt;
        4&lt;br&gt;
        5&lt;br&gt;
        6&lt;br&gt;
        7&lt;br&gt;
        8&lt;br&gt;
        9&lt;br&gt;
        0&lt;br&gt;
        CLEAR&lt;br&gt;
    &lt;br&gt;
    &lt;br&gt;&lt;br&gt;
    &lt;br&gt;
      &lt;p id="score"&gt;Score:&lt;/p&gt;

&lt;br&gt;
      &lt;p id="time"&gt;Time left: &lt;/p&gt;

&lt;br&gt;
    &lt;br&gt;
  &lt;br&gt;
&lt;br&gt;


&lt;p&gt;&lt;strong&gt;&lt;em&gt;javascript&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;function startGame() {&lt;br&gt;
    let x = document.getElementById("hide");&lt;br&gt;
    let y = document.getElementById("show");&lt;br&gt;
    if (x.style.display === "none") {&lt;br&gt;
      x.style.display = "block";&lt;br&gt;
      y.style.display = "none";&lt;br&gt;
    } else {&lt;br&gt;
      x.style.display = "none";&lt;br&gt;
      y.style.display = "block";&lt;br&gt;
    }&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let randomNumA = Math.floor((Math.random() * 100) + 1);
let randomNumB = Math.floor((Math.random() * 100) + 1);

let sel = document.getElementById('random-operation');
sel.innerHTML = '&amp;lt;h4&amp;gt;Operation Selection&amp;lt;/h4&amp;gt;&amp;lt;p&amp;gt;' + randomNumA + operator + randomNumB + '&amp;lt;/p&amp;gt;';

let countdown = 30;
const countdownInterval = setInterval(() =&amp;gt; {
  countdown--;
  document.getElementById('time').textContent = `Time left:    ${countdown} seconds`;

  if (countdown === 0) {
    clearInterval(countdownInterval);
    document.write.getElementById('score') = 'score';
    document.write.getElementById('time') = 'countdown';
  }
}, 1000);

let operator = getElementsByTagName('option');
let result = document.getElementById('operation-selection');
if (operator.lenght &amp;gt;= 1) {
  let addition = operator[0];
  let subtraction = operator[1];
  let multiplication = operator[2];
  let division = operator[3];
  if (operator == 'addition') {
    result = randomNumA + randomNumB;
  }
  else if (operator == 'subtraction') {
    result = randomNumA - randomNumB;
  }
  else if (operator == 'multiplication') {
    result = randomNumA * randomNumB;
  }
  else {
    result = randomNumA / randomNumB;
  }
}   
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;


</description>
      <category>javascript</category>
      <category>discuss</category>
      <category>learning</category>
    </item>
  </channel>
</rss>
