instruction
stringlengths
0
30k
So, in dictionary in python, if you have item with same keys, they just get overriten by further item, so in your dict finnaly you would have only 1 item with "A" key. My suggestion to you is to try to get all that to a massive, and simply parse that, so 1 item is key, next is data, next is key and so on. If you wi...
All you need to do is add the style parameter as I have done below: ``` import random as rd import seaborn as sns import pandas as pd import matplotlib.pyplot as plt #Make some sample data episode=list(range(200)) season=[] for k in range(20): for i in range(10): season.append(k) rating=[] ...
while comparing, convert var1 to string. See below: var1 = int(input("enter a number:")) num = str(var1)[::-1] if str(var1) == num: print("its a palindrome") else: print("its not a palindrome")
> Is there a way to figure out how I generated it? What you have there is a [U+00AD 'SOFT HYPHEN'](https://unicode-explorer.com/c/00AD). The linked page gives the key combinations for typing it on Windows and Linux. > How can I avoid, find, and fix this problem if it happens in a real-world scenario? I'd reco...
This is more related to your system/Windows config instead of OpenVINO. As a workaround You can try to enable both CPU as below: 1. Press "Windows+R" to open a Run dialogue box. Type "msconfig" in the "Open" field and press "Enter." The System Configuration window opens. 2. Click the "Boot" tab, then click the "...
{"Voters":[{"Id":68587,"DisplayName":"John Kugelman"},{"Id":256196,"DisplayName":"Bohemian"}],"SiteSpecificCloseReasonIds":[18]}
Pretty much what it says on the tin. I have a JS script that isn't staying within the div element it is designated to on my page, it "sits" in the footer section instead. [Page design with the JS script result "sitting" in the footer](https://i.stack.imgur.com/0Dpil.png) ``` <header> <div>icon</div> <di...
The function takes about 20-35ms when ran with `static inline` on GCC or Clang with at least O1 (on O0 its the same 400-600ms like without the static keyword), when static is removed the function takes +400ms to execute on an array with 1bil bytes/chars, when single threaded the function's time doesn't change whether i...
Using `static` on a AVX2 counter function increases performance ~10x in MT environment without any change in Compiler optimizations
|c++|multithreading|optimization|avx2|
null
Since you are open to other options, I thought I can answer your question in python, if that's ok. Here's how you can do it with seaborn, a nice data visualization package that has a lot of helpful functions for statistics and ML. First, to get you started with python, I would recommend [anaconda][1], as their insta...
Javascript is recording if someone scrolls more than 400.If someone scrolls more than 400, I want to record this event in PHP somehow, here I will just alert it. So, if someone scrolls more than 400, there will be an alert coming from the PHP-variable, and not JS-variable. (Actually, I just want this function to ...
I try generate signature with the below code to be used from mobile side in Apple store but the generated signature is invalid. Apple Link: https://developer.apple.com/documentation/storekit/in-app_purchase/subscriptions_and_offers/generating_a_signature_for_promotional_offers My Code: ``` var no...
Trigger JS when scrolling and record event to PHP
|javascript|php|scroll|
null
I’m trying to create an APL document (for an Alexa widget) that contains a background image, several text components, and a footer action button.  I would like for the user to be able to touch anywhere on the widget (outside of the footer action button) to open the corresponding Alexa skill.  I added a VectorGraphic wi...
C# code for generating a signature for Apple promotions offer is producing an invalid signature
|c#|ios|subscription|storekit|
null
Hi I am trying to update a database table rows with the same row ID using PHP for loop but it only updates all the rows in the database table with the last iteration data when i ECHO the update query it shows the correct update code in each iteration below i have included the code and necessary screenshots PHP For...
Widget APL Touch Component Advice
|widget|apl|
null
Javascript is recording if someone scrolls more than 400. If someone scrolls more than 400, I want to record this event in PHP somehow, here I will just alert it. So, if someone scrolls more than 400, there will be an alert coming from the PHP-variable, and not JS-variable. (Actually, I just want this function to...
@helder-sepulveda's answer has a minor bug - validation will fail when all variables are set to `"false"` Here's a working example: ```lang-hcl variable "sc1_default" { default = "true" } variable "sc2_default" { default = "false" } variable "sc3_default" { default = "false" } variable "sc4_...
The document title in the bottom right of that second screenshot is shown in italics, which means that the document does not actually exist. The ID is just shown in the Firestore console because you have subcollections with data under it. In the fields section of the console, you'll also find a message to explain t...
\documentclass[12pt]{article} \usepackage{emoji} \begin{document} These are colour emojis using the \texttt{emoji} package and LuaLaTeX: \emoji{leaves} \emoji{rose} You can use emoji-modifiers: \emoji{woman-health-worker-medium-skin-tone} \emoji{family-man-w...
Edited from original answer: It turns out they added support in Android 26 to make a USSD call. The function is TelephonyManager.sendUssdRequest. It does not exist on devices older than 26. And what ussd commands are supported is not specified, I would only rely on the bare basics and not advanced menu functionalit...
null
If you want a single plot with two y-axes, it's possible with ggplo2 but requires a bit of fiddling. 1) You can add a second y-axis with a magnitude scaled relative to the first one using ``` + scale_y_continuous( sec.axis = sec_axis(~./6000, name="Belysning") ) ``` Here, I'm taking the first axis to...
php for loop does not update each iteration in to MySql DB Table
|php|mysql|loops|for-loop|sql-update|
I'm using a scrollable widget like ListView.builder to display a list of VideoPlayer widgets. However, when scrolling, the VideoPlayerController widgets stop initializing after a scrolling a few. My attempt to fix this issue was to dispose of every VideoPlayerController behind the current widget that's being displa...
Best way to reuse a VideoPlayerController after disposing it
|flutter|dart|video-player|
null
The [old docs](https://legacy.reactjs.org/docs/hooks-custom.html#useyourimagination) give a rough idea of how `useReducer` is implemented: function useReducer(reducer, initialState) { const [state, setState] = useState(initialState); function dispatch(action) { const nextState = re...
null
I'm having trouble with reading a file that contains Base64 encoded items. Everything's ok until I try to add new items to the file and read it then. This is the error code: >Error: System.FormatException: La entrada no es una cadena Base 64 valida porque contiene un caracter que no es Base 64, mas de dos car...
Javascript is recording if someone scrolls more than 400. If someone scrolls more than 400, I want to record this event in PHP somehow, here I will just alert it. So, if someone scrolls more than 400, there will be an alert coming from the PHP-variable, and not JS-variable. (Actually, I just want this function to...
This is my code ``` import React, { useState } from 'react'; import { Link } from 'react-router-dom'; import { SidebarData } from './SidebarData'; import { LuMenu } from "react-icons/lu"; import { RxCross2 } from "react-icons/rx"; function Navbar() { const [sidebar, setSidebar] = useState(false) con...
Right side of assignment cannot be destructured which using Link component from 'react-router-dom' in react js
|reactjs|routes|react-router|react-router-dom|react-18|
null
For Expect <sup>(which uses [tag:tcl])</sup> the `*` char as in `/home/john/TestDir/*` has no special meaning. You can explicitly use a shell to run your command: ~~~ spawn bash -c "rsync -rv /home/john/TestDir/* jim@192.168.0.20:/home/jim/TestDir" # ^^^^^^^ ~~~
``` # Import the AWS PowerShell module Import-Module AWSPowerShell -Force # Define the S3 bucket and object key $bucketName = "bucket-name" $objectKey = "new ad account/fd new ad account V4.ps1" # Define the local file path where you want to save the downloaded code $localFilePath = "D:\Script Test\fd new ad...
In my main batch file I ask the user for an input (limited to certain strings) and store it as a variable I then need to append a string to that variable to create the name of another variable and return the value of this variable which is stored in another file. Fruity example of what I'm trying to do for simplicit...
.bat file - How can I return the value of a variable whose name depends on another variable concatenated with a string in a batch file?
|batch-file|variables|concatenation|
null
When using onDrag in SwiftUI on Mac how can I detect when the dragged object has been released anywhere?
Turns out, if using the python Bolt framework, this is pretty trivial. Follow this example: https://slack.dev/bolt-python/tutorial/getting-started Then add a handler for 'file_shared' like so: @app.event("file_shared") def handle_file_shared_events(body, logger, client: WebClient, context): .....
There are a few minor things to fix here. - You are missing a + in ToString - You need to use value in your set instead of newRadius, newColor and newSpeed - You are using the same member name as your variable. In the old days we would use underscore like I have in the working example below. Consider using the ...
The strings are of the form: ```none Item 5. Some text: 48 Item 5E. Some text, ``` The result of the search should produce 4 groups as follows. ```none Group(1) = "#" Group(2) = "5" or "5E" Group(3) = "Some text" Group(4) = "48" or "," ``` I have tried: ``` r"(.*)Group (.*)\.(.+)(?::(.+))|(,)" r"(.*)Gro...
How to create a regular expression to partition a string that terminates in either ": 45" or ",", without the ": "
i'm stuck in this error since two days couldn't get some sleep i don't understand what seems the problem since redux and redux toolkit have migrated to a newer version and i seem lost in the code here is the formSlice.js and the fetcForms action ``` export const fetchForms = createAsyncThunk('data/fetchAll', async ...
How is useReducer implemented in ReactJs source code?
|javascript|reactjs|react-hooks|state|
In Angular 17, I use ```html @for (notification of notifications; track notification) { <i>{{notification.quotationId}}</i> } ``` but in WebStorm I get the warning > Unresolved variable quotationId In TypeScript, the type of the property `notifications` is set to `PendingQuotations`, which is: ```types...
I am trying to AWS SES mail service to add my Spring Boot application. Following to tutorials I have added following depediciers to pom file. <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-aws</artifactId> <version>2.1.0.RELEASE</version> </dependency> <depen...
Thank you all for pitching in. You were correct. There was nothing actually wrong with my code. I solved the memory depletion issue by turning off CacheBlobs in my query component. I'm using IBDAC, and all I needed to do was set that property to False. That allowed me to copy 107,389 documents into the database in a...
I am upgrading from SQLAlchemy 1.4 to SQLAlchemy 2 and I am running into an error: `Can't add additional column 'machine_id' when specifying __table__` when trying to create a versioned history table with inherited columns. Following the example [SQLAlchemy example](https://github.com/zzzeek/sqlalchemy/blob/main/exampl...
SQLAlchemy 2 Can't add additional column when specifying __table__
|python-3.x|sqlalchemy|
all. I'm still pretty new to coding, not having written a single piece of code in my life until 4 weeks ago, and I have 2 questions. First, I've been struggling trying to figure out how to pull specific pieces of data out of a database that contains 3 tables. Secondly, I've been trying to figure out how to display t...
ClassnotFound Exeption
|spring-boot|amazon-ses|
You can try the following: ```python from vedo import load # https://free3d.com/3d-model/091_aya-3dsmax-2020-189298.html mesh = load("091_W_Aya_100K.obj").texture("tex/091_W_Aya_2K_01.jpg") mesh.lighting('glossy') # change lighting (press k interactively) mesh.show() ``` [![enter image description here][1]]...
I'm using a scrollable widget like ListView.builder to display a list of VideoPlayer widgets. However, when scrolling, the VideoPlayerController widgets stop initializing after a scrolling a few. My attempt to fix this issue was to dispose of every VideoPlayerController behind the current widget that's being displa...
|postgresql|
Mistakenly you have used a duplicated `ID` for both elements, so you cannot use the same id twice, in case of getting this work, you need to replace the `id` attribute with `class` and set your `querySelectorAll` to this class, and it's all, give a try to this snippet to see how it's going on! <!-- begin sni...
|python|runtime-error|hyperparameters|keras-tuner|
I want to create a fixed 1H to 24H intraday CC table or plot. Even though I have a fixed timeframe, the values are still changing and incorrect: 1H timeframe target chart: Only the 1H CC seems to be correct if I compare it with the CC indicator by TV. The others are incorrect. All the other timeframe target ch...
I have a very frustrating issue [FunctionName("MyFunction")] public async Task MyFunctionAsync( [ServiceBusTrigger("%AzureTopicName%", "mysubscription", Connection = "event-bus-connection")] Message message) { //My logic here } This never gets hit I have checked and veri...
Local Azure Function Service Bus Trigger doesnt pick up messages but no information
|azure|servicebus|
I'm encountering the "Parent directory is not in asset database" error when using AssetDatabase.MoveAsset in a Unity Editor script. This happens even though I've implemented the following steps to create the parent directory: 1. **Folder Creation:** Using Directory.CreateDirectory or unity methods based on AssetDataba...
"Parent directory is not in asset database" Error in Unity AssetDatabase.MoveAsset Despite Creating Folder
|c#|unity-game-engine|unity-editor|unity3d-editor|
null
I am working on an IoT application with over 15K lines of code using PlatformIO IDE, Espressif 6.2.0, and the Arduino framework for the ESP32 WROOM target. I left the device running for about 28 hours, and everything was working fine until I encountered the following exception, which simply stated that the ISR WDT (...
``` const express = require('express'); const jwt = require('jsonwebtoken'); const passport = require('passport'); const localStrategy = require('passport-local').Strategy; const router = express.Router(); passport.use( new localStrategy(async (email , password , done)=>{ try{ const...
I am trying to adapt functional programming style on Google Sheets and have got quite satisfactory results, such as functors, recursive functions and currying functions. However, I am stuck by the pipe function. It is quite easy to realize the pipe function with other modern programming languages, because they allow...
If you have an infinite `Stream` like a `NetworkStream`, replacing string tokens on-the-fly would make a lot of sense. But because you are processing a finite stream of which you need the *complete* content, such a filtering doesn't make sense because of the performance impact. My argument is that you would have to ...
I'm currently confused about windows and states. Suppose I have a program that counts user access data every minute and needs to do sum statistics in each window. Assume that at this time, I configure checkpoint for the fault tolerance of the program. The checkpoint configuration is to trigger every 30 seconds. Then wh...
{"Voters":[{"Id":1230836,"DisplayName":"Elias Van Ootegem"},{"Id":32880,"DisplayName":"JimB"},{"Id":720999,"DisplayName":"kostix"}]}
I have written an application in Tauri, Rust + JS React. When the machine connected to the app stops working, the app sends to database equivalent of the injection but in other state like machine failure to indicate how many injections could have happened during the machine failure and look: ``` I, [2024-03-28T03:2...
How to Retrieve Data from an MySQL Database and Display it in a GUI?
|python|mysql|tkinter|customtkinter|
null
I see two possible options here. First is "more formally correct", but way too permissive, approach relying on `partial` hint: ```python from __future__ import annotations from functools import partial from typing import Callable, TypeVar, ParamSpec, Any, Optional, Protocol, overload, Concatenate R = TypeVar...
GNU sed offers a simpler way to do it, ``` sed '0,/word/{//d} 0,/word/{//d} 0,/word/{//d} ' ``` or even, since there's only the one search, ``` sed '/word/ { 0,//{//d}; 0,//{//d}; 0,//{//d}; }' ``` which also scans each line only once, to fix a (minor but possibly measurable) scaling issue no...
For our use-case, reCaptcha v3 or Enterprise does not work, please don't downvote without actually reading the question: We have been using Google ReCaptcha v2 for some time with the goal of preventing human users who are idle from using Auto Clickers / Macros to cheat and level up in our web based game while they a...
{"Voters":[{"Id":235698,"DisplayName":"Mark Tolonen"},{"Id":987358,"DisplayName":"Michael Butscher"},{"Id":4518341,"DisplayName":"wjandrea"}]}
I am trying out the various ways of creating `std::vector` on the fly and passing it to another function: #include <iostream> #include <vector> void print(std::vector<int> a) { std::cout << a.size() << '\n'; } int main() { print({1, 2, 3, 4, 5}); print...
Pinescript CC values incorrect and changing even though the timeframe cannot be changed
|pine-script|pine-script-v5|
null