Skip to main content

Posts

Office JS Dialog - How to get back/keep context with Excel

I'm messing around w/ Office Dialog for Add-Ins in JS. I've got it so far where I can open a dialog, capture input to console, run a function from a button and close the dialog box, but I can't seem to get my function to interact with Excel. It's lost context I beleive, I tried using this and I get no errors, but it doesn't work --> var context = new Excel.RequestContext() . Here is my open function and my main function and the end function. main.js export async function helloworld(event) { try { await Excel.run(async (context) => { //Start Func console.log("BEFORE OPEN UI"); openDialog("/yo/dist/dialog.html", 30, 20); console.log("AFTER OPEN UI"); await context.sync() .then(function () { console.log("AFTER SYNC UI"); var ws = context.workbook.worksheets.getActiveWorksheet();

How do i fix my audio not working on my github pages website

I am making a game in JavaScript and when you press an arrow key it should make it make a buzz sound if you pressed the wrong arrow or a slap sound if you pressed the correct one. The sounds do not play, although the background music does play still. the project was imported from replit, i have tried googling but i could not find a proper answer, i was also using a javascript plugin called howl. Howl is used to play audio in js. Here is the github repo: https://github.com/blgoreuxe/ArrowBeat Here is the game on github: https://blgoreuxe.github.io/ArrowBeat/ Here is the game with a working slap and buzz sounds (on repl): https://beat.brandongore502.repl.co/ i want it to where the sounds work on the github link Via Active questions tagged javascript - Stack Overflow https://ift.tt/2FdjaAW

Document contents disappear after clicking "cancel" button on modal

I am building a project using HTML, bootstrap CSS and Jquery. This is my HTML code: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.min.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <link rel="stylesheet" href="node_modules/bootstrap-social/bootstrap-social.css"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Exo&display=swap"> <link rel="stylesheet" href="styles.css"> <title>TimeGuard</title> </head>

Check array of strings against array of objects and return something per each case

I have a simple array problem: I have two different arrays: one with strings and one with objects. I need to check one agains the other in a certain way: Array of objects needs to check if a property of the object is included in array of strings, and return a response in each case. const colors = ["blue", "pink", "red", "green", "yellow", "orange", "white"] const objColors = [{name:"pink", value: true}, {name:"green", value: true}, {name: "white", value: false}] My expected response array would be something like: const res = [false, true, false, true, false, false, false] I don't know how to tackle this, as I've tried several things with no success. I tried double iterations, but it gave me a wrong response. I've also tried the method includes, but then I can only check my objColors array, therefore I don't get a response for all the cases I need to check let res

`

In my react app, I am attaching a script tag to load a script resource dynamically from CDN. The host page domain is of course different than CDN domain. My question is, in production , if my CDN response does not contain access-control-allow-origin header, and my <script> tag in DOM does not contain croossorigin , will errors generated by the CDN script resource be hidden by the browser and resulting only in Script error. message ? And if so, will adding croossorigin to <script> tag and ensuring CDN responds with access-control-allow-origin: * header allow seeing the actual error that happen in the script (assuming I have onerror handler on the script element) Via Active questions tagged javascript - Stack Overflow https://ift.tt/2FdjaAW

Angular & PWA: disable caching for .json file

I do not understand what's wrong with a clean&basic setup of Angular+PWA. Every time I visit my webpage I need to fetch actual&latest /assets/fakit.json file without any caching. But as a result, (btw 200 OK) I see that this file is coming from service worker: I tried a lot of ngsw configs, but this particular file is outdated in a lot of cases. Sometimes it's refreshed only via ctrl+f5 in chrome. My ngsw-config.json looks so: { "$schema":"./node_modules/@angular/service-worker/config/schema.json", "index":"/index.html", "assetGroups":[ { "name":"app", "installMode":"prefetch", "resources":{ "files":[ "/favicon.ico", "/index.html", "/manifest.webmanifest", "/*.css", "/*.js" ] } }, { "name&qu

How to add task list to existing DAG

I'm trying to automate the creation of batch pipelines from backend mySQLL to BiqQuery and I've ran into issue with my script. It initialises a DAG with it's own class (DagCreator) and then passes it as a instance variable in my MySQLBatchPipelines class. The tasks and the order of the tasks are contained in methods inside my MySQLBatchPipelines instance. How would I add those tasks and the tasks list to my existing DAG? Here's some example code so you understand my query: class DagCreator: def __init__( self, dag_id, start_date, time_delay: int ): self.dag_id = dag_id, self.start_date = start_date, self.time_delay = time_delay print(self.dag_id) def DagToReturn(self): args = { 'owner': 'Data Lake', 'depends_on_past': True, 'start_date': self.start_date, 'email_on_failure': False,