Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation since 02/07/25 in Posts

  1. Hi Jessica, 😃 Now you should be able see two avatars in the front… 😉
  2. Hi, I am not as exciting as Jessica, but I thought I would join to learn new things.
  3. Identifying and Prioritizing Systemically Important EntitiesAdvancing Critical Infrastructure Security and Resilienceby John Bordeaux, Jonathan W. Welburn, Sasha Romanosky, Benjamin Boudreaux, Aaron Strong Publisher RAND Corporation Published Date 2023 Page Count 98 Categories Business & Economics / Infrastructure, COMPUTERS / Data Science / General, Computers / Security / General, Mathematics / General, Political Science / Terrorism, Technology & Engineering / Mobile & Wireless Communications Language EN Average Rating N/A (based on N/A ratings) Maturity Rating No Mature Content Detected ISBN 1977409849 In response to the mounting specter of systemic cyber risks, the Cyberspace Solarium Commission recommended that Congress codify the concept of Systemically Important Critical Infrastructure--later renamed Systemically Important Entities (SIEs)--and that the Cybersecurity and Infrastructure Security Agency (CISA) be resourced to identify SIEs and support in the mitigation of their risks to support a broader national strategy of layered deterrence. In support of the CISA National Risk Management Center (NRMC), this report clarifies the concepts of SIEs and introduces a data-driven methodology for their identification and prioritization. Specifically, the authors identify SIEs by their potential to affect national critical functions (NCFs) and prioritize SIEs by measures of their size and interconnectedness. This report builds on existing work regarding Critical IT Products and Services and extending the researchers' analysis to federal agencies and firms that install potentially vulnerable software, in addition to firms that write software. This report further documents systemic risks and cyber risks in software supply chains, past and ongoing analytical support to CISA, and current limitations, and it outlines a path for future work. More Information
  4. You are reading Part 39 of the 39-part series: JavaScript Skill Progression: The Path from Beginner to Extreme. [Level 6] IntroductionJavaScript is traditionally known as a client-side language, but with Node.js, it can also be used for backend development. Node.js is a JavaScript runtime environment that allows developers to run JavaScript on the server, enabling high-performance applications, APIs, and real-time communication. 1. What is Node.js?Node.js is a server-side runtime built on Google Chrome’s V8 JavaScript engine. It enables non-blocking, event-driven programming, making it highly efficient for I/O-intensive tasks. Key Features of Node.js:Asynchronous & Non-blocking – Handles multiple requests concurrently. Single-threaded Event Loop – Uses an event-driven architecture for efficiency. Built-in Modules – Includes modules like fs, http, and crypto. Package Management with NPM – Provides access to thousands of libraries. Example: Running JavaScript in Node.jsconsole.log("Hello from Node.js!"); To run the script: node script.js 2. Setting Up a Node.js ServerA basic Node.js server can be created using the built-in http module. Example: Simple HTTP Serverconst http = require("http"); const server = http.createServer((req, res) => { res.writeHead(200, { "Content-Type": "text/plain" }); res.end("Hello, Node.js Server!"); }); server.listen(3000, () => console.log("Server running on http://localhost:3000")); Runs a server on port 3000. Responds with "Hello, Node.js Server!". 3. Understanding the Node.js Event LoopNode.js uses an event-driven architecture where callbacks are managed by an event loop. Example: Asynchronous vs. Synchronous Executionconsole.log("Start"); setTimeout(() => console.log("Timeout callback"), 1000); console.log("End"); Output: Start End Timeout callback (after 1 second) Synchronous code runs first. Asynchronous tasks are pushed to the event loop and executed later. 4. File System Operations in Node.jsNode.js allows direct interaction with the file system using the fs module. Example: Reading a Fileconst fs = require("fs"); fs.readFile("file.txt", "utf8", (err, data) => { if (err) throw err; console.log("File Contents:", data); }); Example: Writing to a Filefs.writeFile("output.txt", "Hello, Node.js!", (err) => { if (err) throw err; console.log("File written successfully"); }); 5. Using Express.js for Backend DevelopmentExpress.js is a popular framework for building REST APIs with Node.js. Example: Simple Express Serverconst express = require("express"); const app = express(); app.get("/", (req, res) => { res.send("Hello from Express!"); }); app.listen(3000, () => console.log("Express server running on http://localhost:3000")); Handles HTTP requests using app.get(). Runs on port 3000. 6. Connecting Node.js to a Database (MongoDB)Node.js can connect to databases like MongoDB using libraries like Mongoose. Example: Connecting to MongoDBconst mongoose = require("mongoose"); mongoose.connect("mongodb://localhost:27017/testdb", { useNewUrlParser: true, useUnifiedTopology: true }) .then(() => console.log("Connected to MongoDB")) .catch(err => console.error("MongoDB Connection Error:", err)); Example: Defining a Schema and Saving Dataconst UserSchema = new mongoose.Schema({ name: String, age: Number }); const User = mongoose.model("User", UserSchema); const newUser = new User({ name: "Alice", age: 30 }); newUser.save().then(() => console.log("User saved")); 7. Real-Time Communication with WebSocketsNode.js enables real-time applications using WebSockets. Example: WebSocket Server with Socket.ioconst io = require("socket.io")(3000); io.on("connection", socket => { console.log("New client connected"); socket.on("message", msg => console.log("Message received:", msg)); }); 8. When to Use Node.js?Use Case Best Choice? REST APIs ✅ Yes Real-time Chat Apps ✅ Yes CPU-Intensive Tasks ❌ No (Use a compiled language like C++) File System Operations ✅ Yes Machine Learning ❌ No (Python is better) You are reading Part 39 of the 39-part series: JavaScript Skill Progression: The Path from Beginner to Extreme. [Level 6]
  5. I actually created a CSS only clock just to see if I could do it. But although it worked, it was calculating the seconds which was not accurate at all 😁 So, I created a MOSTLY CSS Clock… Which you can see on CodePen.io → https://codepen.io/jessicabrown1028/pen/RNbeKEd This clock, which honestly is nothing fancy, just some basic CSS, basic HTML, and stupid JavaScript to get your local time and sync the seconds… Pfft! @import url("https://fonts.cdnfonts.com/css/lcd"); /* Retro Digital Font */ body { display: flex; justify-content: center; align-items: center; height: 100vh; background-color: #1d1e22; } .clock { width: 250px; height: 250px; border-radius: 50%; border: 5px solid white; position: relative; display: flex; justify-content: center; align-items: center; } /* Center dot */ .clock::before { content: ""; width: 8px; height: 8px; background: white; border-radius: 50%; position: absolute; z-index: 10; } /* Digital Clock Display */ .digital-display { position: absolute; top: 65%; transform: translateY(-50%); font-size: 20px; font-family: "LCD", sans-serif; color: red; background: black; padding: 8px 12px; border-radius: 5px; box-shadow: 0 0 5px red; text-align: center; width: 105px; display: flex; justify-content: space-between; } /* Style for AM/PM text */ #ampm { font-size: 14px; margin-left: 5px; } /* Hour Markers */ .hour-markers { position: absolute; width: 100%; height: 100%; } .hour-markers div { position: absolute; left: 48%; top: 46%; width: 0px; height: 20px; text-align: center; font-size: 18px; font-weight: bold; color: bisque; transform-origin: center; } /* Position the numbers inside the clock */ .hour-markers div:nth-child(1) { transform: rotate(30deg) translateY(-100px) rotate(-30deg); content: "1"; } .hour-markers div:nth-child(2) { transform: rotate(60deg) translateY(-100px) rotate(-60deg); content: "2"; } .hour-markers div:nth-child(3) { transform: rotate(90deg) translateY(-100px) rotate(-90deg); content: "3"; } .hour-markers div:nth-child(4) { transform: rotate(120deg) translateY(-100px) rotate(-120deg); content: "4"; } .hour-markers div:nth-child(5) { transform: rotate(150deg) translateY(-100px) rotate(-150deg); content: "5"; } .hour-markers div:nth-child(6) { transform: rotate(180deg) translateY(-100px) rotate(-180deg); content: "6"; } .hour-markers div:nth-child(7) { transform: rotate(210deg) translateY(-100px) rotate(-210deg); content: "7"; } .hour-markers div:nth-child(8) { transform: rotate(240deg) translateY(-100px) rotate(-240deg); content: "8"; } .hour-markers div:nth-child(9) { transform: rotate(270deg) translateY(-100px) rotate(-270deg); content: "9"; } .hour-markers div:nth-child(10) { transform: rotate(300deg) translateY(-100px) rotate(-300deg); content: "10"; } .hour-markers div:nth-child(11) { transform: rotate(330deg) translateY(-100px) rotate(-330deg); content: "11"; } .hour-markers div:nth-child(12) { transform: rotate(0deg) translateY(-100px); content: "12"; } /* Clock Hands */ .hand { position: absolute; bottom: 50%; left: 50%; transform-origin: bottom; background: white; border-radius: 5px; transform: translateX(-50%) rotate(0deg); } .hour { width: 6px; height: 60px; background: aquamarine; } .minute { width: 4px; height: 80px; background: darksalmon; } .second { width: 2px; height: 90px; background: red; }<div class="clock"> <div class="hour-markers"> <div>1</div> <div>2</div> <div>3</div> <div>4</div> <div>5</div> <div>6</div> <div>7</div> <div>8</div> <div>9</div> <div>10</div> <div>11</div> <div>12</div> </div> <!-- Digital Display with AM/PM --> <div class="digital-display" id="digital-clock"> <span id="time">00:00:00</span> <span id="ampm">AM</span> </div> <!-- Clock hands --> <div class="hand hour" id="hour-hand"></div> <div class="hand minute" id="minute-hand"></div> <div class="hand second" id="second-hand"></div> </div>function updateClock() { const now = new Date(); let hours = now.getHours(); const minutes = now.getMinutes(); const seconds = now.getSeconds(); // Determine AM or PM const ampm = hours >= 12 ? "PM" : "AM"; // Convert to 12-hour format hours = hours % 12 || 12; // Converts 0 to 12 for midnight // Calculate rotation angles const hourDeg = hours * 30 + minutes * 0.5; const minuteDeg = minutes * 6 + seconds * 0.1; const secondDeg = seconds * 6; // Apply rotation to clock hands document.getElementById( "hour-hand" ).style.transform = `translateX(-50%) rotate(${hourDeg}deg)`; document.getElementById( "minute-hand" ).style.transform = `translateX(-50%) rotate(${minuteDeg}deg)`; document.getElementById( "second-hand" ).style.transform = `translateX(-50%) rotate(${secondDeg}deg)`; // Format digital clock display const formattedHours = String(hours).padStart(2, "0"); const formattedMinutes = String(minutes).padStart(2, "0"); const formattedSeconds = String(seconds).padStart(2, "0"); // Update time and AM/PM display document.getElementById( "time" ).innerText = `${formattedHours}:${formattedMinutes}:${formattedSeconds}`; document.getElementById("ampm").innerText = ampm; } // Run clock update every second setInterval(updateClock, 1000); // Initialize the clock immediately updateClock();
This leaderboard is set to New York/GMT-05:00

Important Information

Terms of Use Privacy Policy Guidelines We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.