I am building a page component that returns data from an API call and passes the values to my return statement. My page continues to return as blank because the page loads before the variables are returned from the API. How can I wait to render the page until my API has returned a response? The two variables are initialized as so and are not updated until the API response: var userData const [customer_email, setEmail] = useState(); const [newuserid, setUserId] = useState(); useEffect(() => { userData = Cookies.get("user-data"); if (userData) { console.log("Userdata !== null"); try { userData =
I can successfully read from xml definition which has only one node. But when I am trying to read multiple node from xml definition I get the following error - ORA-19025: EXTRACTVALUE returns value of only one node. Below is my xml definition <form xmlns:fr="http://orbeon.org/oxf/xml/form-runner" fr:data-format-version="4.0.0"> <applicant> <userId>1234</userId> <userName>Dan Johnson</userName> <userEmail>[email protected]</userEmail> </applicant> <background> <additionalDuties>Nothing</additionalDuties> <grid-7> <position>Service desk analyst</position> <workplace>Chicago</workplace> <date>
Overview In my pursuit to optimize my web appliations, I am transitioning from standard img tags to Next's Image tag. While it is great for performance, making it do custom effects and styling can be frustrating. The Problem I am trying to add a parallax effect to a Next Image. I was previously able to add a parallax library but that seemed to not integrate with the Image tag. Is there a way to add a simple parallax effect on scroll to a Next image? My Attempts I've tried adding a dynamic translateY style property to the Image tag itself, but the browser doesn't seem to read the string interpo
When I execute this Python code, I get an error message: ValueError: setting an array element with a sequence a = np.array([1,3,5,7,9], dtype=int) c = np.array([3,4,7,8,9], dtype=int) b = np.zeros(len(a)) for i in range(len(a)): b[i] = np.where(a == int(c[i])) What's the problem? The whole error: --------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-606-7b50beb044f5> in <module>() 14 15 for i in range(len(a)): ---> 16 b[i]= np.where(a == int(c[i])) ValueError: setting an array element with a sequence.
I try to pass a json object to an api on a Spring boot. Before I was passing values using postman all worked fine. The format was as follows: { "shortname": "test2", "fullname": "testing2", "address": "addrtest2", "telephone": "380979379993", "website": "www.site2.com", "sociallinks": { "facebook": "fb2.com" }, "foundationyear": "1992" } Now in my Angular app I am passing json as follows: {"shortname":"test","fullname":"Bogdan Onyshenko","address":"Пр. Победы 72в","telephone":"0669829242","website":"http://193.70.37.242/index.php?route=extension/feed/google_sitemap","foundationyear":"2004","so
In my vue-app I'm doing this loop <div class="grid grid-cols-3 gap-14"> <article-card v-for="(article, index) in articles" :key="index" :content="article" /> </div> So far so good, but I want to display the first row of the css-grid differently -> e.g. something like grid-template-columns: 1fr 2fr 1.5fr; - just to make them more visible How can I do that? Can someone help me out? I'm using tailwindcss, so maybe that could help?
Given Uint8List a = ...; Uint8List b = ...; I want to compare whether their content are the same. Of course I can use listEquals in Flutter, or write down a naive loop like: for (int index = 0; index < a.length; index += 1) { if (a[index] != b[index]) return false; } However, given that Uint8List is quite a special array, and it is often quite big, I guess where there is a better (faster) approach to do so?
I am trying to convert an OpenGL GLSL shader into a OpenGL ES one but it doesn't seem to work that well. The shader works flawlessly in normal OpenGL but it completely breaks in OpenGL ES. Here is the normal OpenGL GLSL code: #version 330 uniform sampler2D texture0; float amnt = 8.0; vec2 uv = gl_FragCoord.xy / vec2(1270,720).xy; void main() { float thing = -1.0; if (uv.y <= 0.5) { thing = 1.0; } uv.y += distance(uv.x, 0.5) * (distance(uv.x, 0.5) * 0.25 ) * distance(uv.y, 0.5) * thing * amnt; gl_FragColor = texture(texture0, vec2(uv.x, uv.y)); } The OpenGL ES GLSL code: precision highp float;
Getting Issue : java.lang.ClassCastException: com.google.common.collect.Maps$TransformedEntriesMap cannot be cast to org.openqa.selenium.WebElement Code trials: JavascriptExecutor execute = (JavascriptExecutor)uiDriver.webDr; WebElement shadowDomHostElement = uiDriver.webDr.findElement(By.cssSelector("authoring-ui[ng-version='12.0.1']")); WebElement executeshadow = (WebElement)execute.executeScript("return arguments[0].shadowRoot", shadowDomHostElement); Unable to cast the WebElement, please need help on this
How could I get the local time, like right now its 9:06 For my friends, Its 6:06. How could I get that time In python. I have tried using DateTime but have had no luck finding a way to do this.
I want to customize a theme in daisyui. Is it possible to customize i.e. the dark theme (just fix one color, or add a further color-entry)? Furthermore: is it possible to add a new color entry to your custom theme? I.e. I tried the following without success: daisyui: { styled: true, themes: [ "light", // first one will be the default theme "dark", { mytheme: { primary: "#793ef9", "new-color": "#eff1ae", "primary-focus": "#570df8", }, }, "cupcake", ], }, ...but when I use the new color new-color, in my css (theme("colors.new-color")). I get following error: (146:7) /home/armwur/code/booking-ove
I was looking for a solution to send automated emails from a Google Sheet connected to a Google Form, so I found Google Scripts. I never worked with it (or other scripts) before, so it's all new to me. I did find a lot of information on the internet, but I still have some questions. Let's explain the situation. So I'm selling two different products in a Google Form, they both have a different price, so I was looking for a solution to send mails to the customers with the total price and some extra information. I have a Google Sheet where all the answers are put in automatically. So I have 12 co
I don't know what is wrong with my code the sound is not playing when I am pressing the keys. for(var i=0;i<document.querySelectorAll(".drum").length;i++) { document.querySelectorAll("button")[i].addEventListener("click",function() { var buttoninnerhtml = this.innerHTML; makesound(buttoninnerhtml); }); } document.addEventListener("keydown",function(event){ makesound(event,key); }); function makesound(key) { switch (key) { case "w": var audio = new Audio('sounds/tom-1.mp3'); audio.play(); break; case "a": var audio = new Audio('sounds/tom-2.mp3'); audio.play(); break; case "s": var audio = new
What is the proper way to handle idempotency in a rails application? I am using devise and need to make sure that each user doesn't get multiple duplicate PaymentIntents for the same purchase. Since the idempotency key needs to be used with each subsequent failed request should it be something saved in the database, session, etc..? Stripe suggests to use idempotency keys to prevent duplicate PaymentIntents for the same purchase: https://stripe.com/docs/payments/payment-intents#best-practices
In Xcode 13+ When I create a framework, there is no "Products" folder as it used to be there prior to that version same like the below image Even when I build the project, I still cannot find the ".framework" file anywhere. All tutorials on google follow the same flow of creating the framework project, building then extracting the .framework binary from the Products folder, but that doesn't seem to be available in Xcode 13+ Any one have a clue?
PC OS: Win10 20H2 IDE: PyCharm 2021.3 Python version: 3.10 The requests package version: 2.27.1 The software (may cause the problem) on pc: Clash for Windows(v 0.18.2) The code is following: import requests create_account_url = "https://opentdb.com/api.php" para = { "amount": 10, "difficulty": "medium", "type": "boolean" } response = requests.get(create_account_url, params=para) response.raise_for_status() print(response.json()) The problem is: Running the code above when I open the button(System Proxy) in Clash, the error is: requests.exceptions.SSLError: HTTPSConnectionPool(host='opentdb.com
I am working with React Native & I am getting this error: "Requiring module "node_modules/react-native-reanimated/src/Animated.js", which threw an exception: Error: Reanimated 2 failed to create a worklet, maybe you forgot to add Reanimated's babel plugin?" and my app appears to not be working after I installed Secure Store. It would not open then told me to update my emulator which I did, in turn that deleted all my dependencies. I reinstalled all of them, erased node modules and ran Yarn Install to reinstall everything. Now this error keeps popping out. Any advice would be appreciated...I am
How can I validate multiple email addresses separated by commas with react-hook-form? I have a Material UI text field that uses react-hook-form for validation. Initially the input field takes a single email and it's being validated by the react-hook-form. Currently I want the user to be able to enter multiple emails separated by commas and also validate each one of them. What I'm able to do is validate when the user clicks on submit, but I want to be able to validate when the user is typing the emails. <TextField onChange={(e) => { validateRecipientEmail(e.target.value); }} name='recipientEmai
I am running a batch script that invokes a .exe file, if the file is not present then I wish to issue a warning, similar to the system.windows.messagebox class, but without the need for the user to respond, because I want the batch script to continue to run without pausing for user interaction. I tried this via powershell PowerShell -Command "Add-Type -AssemblyName PresentationFramework;[System.Windows.MessageBox]::Show('Application not found','Warning',1,48)" But this requires user response, and I can't seem to find any way around this as the message box class does not seem to have the option
Hi Everyone How Are You I hope You Are Well. I Am Working On A MS Access Application And Want Fetch Result From List Box With On Click Button But I'm Facing A Error Data Type Mismatch In Criteria expression Here is My Code On Click Button Private Sub ViewBalance_Click() 'Dim listrpt As String If IsNull(listrpt) Then MsgBox "Please Select The Account Name", vbOKOnly, "Warning" Exit Sub End If DoCmd.OpenReport "List All Parties Balance", acViewPreview, , "[Account ID] = """ & listrpt & """" Me.FilterOn = True End Sub And Here is My On Report Load Filter But This Filter Working Fine Above Code Gi
I have a problem with the visualization in Grafana. My problem is that dates are shifted one hour into the future. Grafana visualisation At the time of the screenshot it was 19:45. The data was recorded between 18:53 and 19:02 and also correctly noted in the database (InfluxDB). But are displayed from 19:53 to 20:02 in Grafana (as also seen on the picture above). DBeaver database data overview I have already checked the Grafana Server's time as well as the InfluxDB installation time and they match the current time. My time zone is 'Europe/Berlin' (CET). I think this problem has something to do
I have classes which require dependencies in order to be instantiated but are otherwise optional. I'd like to lazily import the dependencies and fail to instantiate the class if they aren't available. Note that these dependencies are not required at the package level (otherwise they'd be mandatory via setuptools). I currently have something like this: class Foo: def __init__(self): try: import module except ImportError: raise ModuleNotFoundError("...") def foo(self): import module Because this try/except pattern is common, I'd like to abstract it into a lazy importer. Ideally if module is avai
When I go to Inspect on Google Chrome, I have the HTML and CSS sections laid out with the HTML part on the left and CSS part on the right, like this: ------ ----- HTML | CSS ------ ----- How can I move the CSS part to the bottom while keeping the HTML part above? ---- HTML ---- CSS ----
I've got a game where you place towers on the map, it's working fine they can click and the towers place the the build mode is set to false. I Want to allow the player to hold shift down then they can place multiply towers then when they release shift the build mode will change to false but i can't figure it out. This is what i've got so far but doesn't seem to work as intended func _input(event): if event.is_action_released("ui_accept") and build_mode == true: verify_and_build() if event.is_action_released("multi_build"): cancel_build_mode() I've assigned ui_accept to left click and multi_bui
when I want to export my nextjs app, it says that I cannot export my images on static websites. Error: Image Optimization using Next.js' default loader is not compatible with next export. Possible solutions: - Use next start to run a server, which includes the Image Optimization API. - Use any provider which supports Image Optimization (like Vercel). - Configure a third-party loader in next.config.js. - Use the loader prop for next/image. How can I make it so that it does ? Is there a way for me to simply tell it to render images statically ? I dont want to go throught other onlines images loa
I am trying to save M-PESA callback data, when a user has paid with Lipa Na M-PESA. I need to save the CheckoutRequestID, with a decoded username from token, then if the payment is successful the callback URL needs to update the associated CheckoutRequestID from MySQL with the amount, from there it needs to update the user's wallet with the new value. Currently, the code works well, but I cannot save. When I try to access the username or any value, the callback doesn't return any data. Here is the Lipa Na M-PESA code and the STK Callback code. Lipa Na M-PESA code router.get('/stk', middleware.
Can someone give me an explanation on why this is happening in PHP: echo (0.29*100)%100 // result 28 It's probably very simple but logically I do not see any explanation. Probably how PHP works in the background. I was trying to get the first two decimal positions of a number when I ran into this case. Result should be 29 naturally. If I round the multiplication the result is fine: echo (round(0.29*100))%100 // result 29
I am trying to launch Chrome in CentOS using puppeteer but got errors like this: [8012:8039:1220/204633.586208:ERROR:bus.cc(393)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix") [8012:8039:1220/204633.586325:ERROR:bus.cc(393)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix") [8012:8039:1220/204633.595443:ERROR:bus.cc(393)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of
In VSCode, as you can see here, opening a md file in preview mode will replace a current preview instead of adding another preview. You can only ever have one markdown preview open at a time. How can I instead get the alternative behavior, where opening a md file in preview mode adds a brand new preview tab no matter what?
How to install PyTorch if my CUDA version is 11.2 and CudNN version is 8.1.0? Offical documentation at https://pytorch.org/get-started/locally/ suggests only CUDA 10.2 and 11.3 versions. Should I try to install it with v10.2 with next command? conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch Won`t it have any incompatible version problems in the future?