instruction
stringlengths
0
30k
ValueError: The shape of the target variable and the shape of the target value in `variable.assign(value)` must match
|tensorflow|deep-learning|vgg-net|spatial-transformer-network|
null
Go to Edit Configurations change deploy Default APK to APK from app bundle [![enter image description here][1]][1] [1]: https://i.stack.imgur.com/OkErR.png
I'm trying to make an archive website for a school project, and while I followed a bunch of different tutorials it seems like something is just not clicking, because nothing gets added to the database (ALTHOUGH files get added to the file they're supposed to go to). Here's the code that's supposed to link the input ...
I have no issue with ANSI color codes and how they work but I have no idea how to exactly color the entire background with such color. I want to make it so that the entire background of the console changes to the ANSI color code. Is there a way I can do this? The answer does not have to be the same on all platforms ...
>! Hello! After scouring the internet for a solution, I need some help! I have a Java backend that is supposed to process information and send it to the React frontend via WebSocket. However, I'm having trouble establishing a connection. Can anyone help me identify what I'm doing wrong? > Código do WebSocket no Java...
Java and React WebSocket - Error Connection
|java|reactjs|websocket|frontend|backend|
null
i am using streamlit to build a chat application and the query txt is not getting rest on submission. here is my code and screenshot for the same ``` def submit(): record_timing() # Record time before submitting message st.session_state.something = st.session_state.widget st.session_state....
Just fetch. only gets one row. So no foreach loop needed :D $row = $stmt->fetch(); example $id = 4; $stmt = $dbh->prepare("SELECT name FROM mytable WHERE id=? LIMIT 1"); $stmt->execute([$id]); $row = $stmt->fetch(PDO::FETCH_ASSOC);
{"OriginalQuestionIds":[5456626],"Voters":[{"Id":285587,"DisplayName":"Your Common Sense","BindingReason":{"GoldTagBadge":"php"}}]}
PHP PDO how to fetch a single row?
It looks like the langchain dokumentation was wrong https://github.com/langchain-ai/langchain/issues/19807 You can change from langchain_community.vectorstores import Chroma to from langchain_community.vectorstores.chroma import Chroma
I have just started to look at Redis and would like to be able to store an Array of hashes, where I can pop a random key/value out and then put it back in when I need to. So in Ruby I would have something like this users = [{ username: "user1", password: "password"}, { username: "user2", password: 'password'}...
I have a WASM module as follows ```rs #[no_mangle] pub extern "C" fn process_bytes(ptr: *const u8, len: usize) -> u8 { if len > 0 { let bytes = unsafe { std::slice::from_raw_parts(ptr, len) }; let first = bytes[0]; first } else { 0 } } ``` It accepts a byte...
null
For barchart in `chartjs` , you may specify the barThickness value in the option block, such as ``` , options: { barThickness:50 } ``` So change ``` <div> <canvas id="myChart"></canvas> </div> <script src="https://cdn.jsdelivr.net/npm/chart.js"></script> <script> const ctx = document.getElem...
I have upgraded my project from `.Net 4.8` to `.Net8`, after upgrading I am getting errors related to `System.Web.UI`. Can someone suggest how I can resolve this or what is the alternative of `System.Web.UI` in `.Net8`? Found some articles but are not useful.[Screenshot of the error I got][1] [1]: https://i.s...
The [handle class](https://www.mathworks.com/help/matlab/handle-classes.html) and its copy-by-reference behavior is the natural way to implement linkage. It is, however, possible to implement a linked list in Matlab without OOP. And an abstract list which does *not* splice an existing array in the middle to insert ...
No, you cannot transition a background. You can transition opacity though, so you could stack two hearts one on top of the other and transition the opacity of one of them on hover. I think the simplest solution is to use an SVG. This is what SVG is good at: vector graphics. <!-- begin snippet: js hide: false cons...
I have a React context called "PageContext", this Page Context is different depending on the page loaded. i.e. for Home Page it might have a property `description` and for the Search Page it would not. ``` const { pageContext }: { pageContext: FinderPageServerSideProps } = useContext(PageContext); ``` ...
To distribute the sum of several numbers similarly?? (python)
|python|
null
@Before("staticinitialization(org.mazouz.aop.Main1)") While making the advice generic such that it can work for any package @Before("staticinitialization(*.*.*(..))") Im getting the below error Syntax error on token "staticinitialization(*.*.*(..))", ")" expected
OpenAPI allows for Markdown in the `description` field. [Relevant part of the specification](https://swagger.io/specification/): > Throughout the specification `description` fields are noted as supporting CommonMark markdown formatting. Where OpenAPI tooling renders rich text it MUST support, at a minimum, markdown ...
I'm using the LAG() function in SQL to calculate the difference between the current month's tips sum and the previous month's tips sum for each taxi driver. However, the LAG() function is returning 0 for every row, even though there should be previous rows to reference. This is the example of the query I am using no...
I am trying to install the library X11_Xmu_LIB, which is needed to build a project (with cmake) I have tried several way to install the library, (let me start by saying I am using ubuntu with wsl in windows) I tried: `sudo apt-get install libxt-dev` and `sudo apt-get install libxrandr-dev libxinerama-dev libxcu...
library X11_Xmu_LIB is not found
|c++|cmake|
null
In all four cases you presented, Oracle would do a normal index seek (binary tree search) on the leading column `eid` because an equality predicate was provided for this column in each of your cases. But what else it does with the index depends on what other columns you're filtering on: 1. **First column** (`eid`) o...
This is an excellent question, and my guess is that this initialization is redundant since since 0x0 does contain `_estack`, as you mentioned, and that this value will be automatically loaded at reset into `sp`, the same way `pc` will be loaded with the addresse for `Reset_Handler`: For example, the equivalent code for...
{"Voters":[{"Id":324364,"DisplayName":"joran"},{"Id":12545041,"DisplayName":"SamR"},{"Id":20002111,"DisplayName":"Friede"}],"SiteSpecificCloseReasonIds":[11]}
tabLayout!!.addOnTabSelectedListener(object : OnTabSelectedListener { override fun onTabSelected(tab: TabLayout.Tab) { viewPager2!!.currentItem = tab.position } override fun onTabUnselected(tab: TabLayout.Tab) {} override fun onTabReselected(tab:...
I haven't found any indication in the `CDK` [documentation][1] to support changing the `TargetOriginId`, but the great thing about `CDK` is there are L1 constructs to support cases such as these. There is still a way to achieve what you want, it is just not as pretty as the L2 construct `CloudFrontWebDistribution`. Min...
I can't run any of my commands because the "+" sign keeps showing up on my R console. I have tried the <kbd>ESC</kbd> key and <kbd>Ctrl</kbd>+<kbd>C</kbd> but neither is working. Please I need help with this. Here is the command I am trying to run. initial_hare_population <- 300000 Hn <- initial_ha...
SOLVED _supabaseClient__WEBPACK_IMPORTED_MODULE_1__.supabase.auth.signIn is not a function
How to pass a byte array to a WASM module from wasmer in Rust?
|rust|webassembly|
null
The copy/paste functionalities don't work only on iOS in the Flutter app
React Query infinite scroll pagination resets to first page
Probably another option would be to move the redis listener into a separate process and add route /new_redis_message to FastAPI. /new_redis_message should be able to send a message to the WebSocket of any client. A separate question arises: how will all this work if we have several FastAPI instances (several pods). ...
I have imported 1000 sample rows from various tables in a SQL server (lets call it SQLSever1). I have imported the rows into the second SQL Server(SQLServer2). When I execute the following query on SQLServer2 I get no results, however when I execute the same query on SQLServer1 I get the expected results. This...
How to locate relevant tables or fields in a SQL Database
|sql|t-sql|
I'm running an Airflow DAG on Google Cloud Platform that should notify a Slack channel when a task fails. However, I'm encountering this issue: When attempting to send a failure notification to Slack, the request times out, preventing the notification from being sent: `{base_client.py:470} ERROR - Failed to sen...
the input is: ![input of sample data](https://i.stack.imgur.com/akaB9.png) need output as: ![enter image description here](https://i.stack.imgur.com/tyeiB.png) is this possible in just XL format or a python script is required. if yes can you help with python script? thanks. my script: my logic is read...
I am generating a pdf from html template using jinja rendering. Please suggest a library that can help me render html to PDF. Current issue : html file size is 400 KB but after rendering pdf file zise is > 20 MB Also some library generates pdf of same size of html file that is 400 KB but after rendering the format ...
Suggest python library for rendering html to pdf files
|python|html|pdf|
null
I have to work with the learning history of a Keras model. This is a basic task, but I've measured the performance of the Python built-in min() function, the numpy.min() function, and the numpy ndarray.min() function for list and ndarray. The performance of the built-in Python min() function is nothing compared to that...
`Explain the belowe problem ``` main() { static char s[25]="vector";int i=0; char ch; ch=s[++i]; printf("%c", ch); ch=s[i++]; printf("%c", ch); ch=i++[s]; printf("%c", ch); ch=++i[s]; printf("%c", ch); } ``` OUTPUT :: eecu I was wondering if you could help me out with something. I'm tryi...
I have trained a model for caption generation , I've used VIT as an encoder and GPT2 as a decoder. After training, these files were saved: model.pth and image-caption-generator checkpoint-4045 : config.json, generation_config.json, model.safetensors, optimizer.pt, preprocessor_config.json, rng_state.pth, scheduler.pt, ...
How to load a pretrained model after training it?
|pytorch|kaggle|
null
{"Voters":[{"Id":2943403,"DisplayName":"mickmackusa"},{"Id":1255289,"DisplayName":"miken32"},{"Id":2756409,"DisplayName":"TylerH"}]}
Feeling like an idiot right now, but I can't get anything but the most hackey solution to the below problem working. I have a dataframe with 3 distinct "sections". 1) The first is 13 columns of Serial Number Data, each column is a single ASCII Code. These columns are captured in the list ```[serialname_list]```...
try npm install @angular/compiler # or yarn add @angular/compiler Clear Cache and Reinstall Dependencies npm cache clean --force npm install # or yarn cache clean yarn install
The settings I had worked. I think it took some time to reflect and I had to look at a different blog post to see the image uploaded due to the updated config of media_folder and public_folder.
Update your question to include the defenition of `logInAction` When using `action={...}` you must not use `onSubmit`. If you'd like to validate the data using React Hook Form, you can make like this ```tsx const ref = useRef<HTMLFormElement>(null) const action = async (formData: FormData) => { const isV...
Something like this seems to be what you are looking for: public enum Status { Hidden, Shown, Marked, } public enum Contents { Blank, Treasure, Enemy, } public class Point { static readonly Random rng = new Rand...
When you are using interceptor in angular you can make use of this code snippet UploadFileService.ts ``` uploadFile(file: File) { const formData: FormData = new FormData(); formData.append('file', file); return this.http.post<any>(`${this.api}/${this.apiName}`, formData); } ``` http.inte...
How to define a function using psycopg2
|python|sql|psycopg2|
null
I am making a website for scraping. Once the user clicks start scraping the pages shows a flash "Scraping started". The code for this route is the following: ``` @app.route('/scrape', methods=['GET', 'POST']) def scrape(): form = ScrapingForm() if form.validate_on_submit(): city = request.for...
Troubleshooting Airflow Task Failures: Jinja Template Slack Notification Timeout
|google-cloud-platform|airflow|slack|slack-api|
null
I m using Youtube Api key in my project and 1000 api requests ha ve been made. Does anyone know that once we reach quota limit of 10000api request with google api the quota is over forever or it will get renewed after sometime? Because its been 2 days and still its shows the same. [![enter image description here](...
youtube api quota limit of 10000api
|api|google-api|youtube|youtube-api|api-key|
null
I am having problems trying to post as JSON to my controller action within my Rspec test: RSpec.describe RegistrationsController, type: :controller do context 'Adding a Valid User' do it 'Returns Success Code and User object' do @params = { :user => {username: 'name', school: 'school'} ...
Rspec test to post as JSON
If you want your Python script to prompt the user for administrator privileges and proceed based on their response, you can use the `ctypes` module on Windows to prompt for elevation via the User Account Control (UAC) dialog. Here's how you can do it: ``` import ctypes import sys def main(): # code pr...
The following: ``` interface IThing { virtual string A => "A"; } ``` Is the so called [default interface method][1] and virtual as far as I can see actually does nothing because: > The `virtual` modifier may be used on a function member that would otherwise be implicitly `virtual` I.e. it just an implicit...
Printing the characters obtained from the array s using printf?
|c|
null
Undot Array with Wildcards in Laravel
I mean *after* you've read the file: ``` List<Integer> savedValues = null; try (Scanner s = new Scanner(new File("test.txt"))) { savedValues = s.tokens(). map(String::trim). map(Integer::valueOf). toList(); } ```
I am learning a coure on Youtube. The youtuber wrote this code and it seems to run on his machine. But when I copy to my file, it gave the error. I followed him thoroughly so that everything works fine till this point. Here is the code of the file. ``` import { Document, Model } from "mongoose"; interface MonthDat...
Get Type Error when using .countDocuments with mongoDB
|mongodb|express|date|
null
Video glitches and not smooth (qt)
I'm employing Delphi 10.4 along with OmniThreadLibrary, utilizing the Parallel.ForEach construct to execute tasks. However, I'm encountering an issue where I'm only notified when all tasks have been completed. Is there a method to receive notifications when individual tasks finish, similar to the schedule mechanism or ...
Pandas: Converting Multiple Columns at once corrupts Data but individually does not?
|python|pandas|dataframe|
This is a fine way to do it. You definitely don't want to use the break keyword because that is considered bad practice and I'm guessing this is for school so you would get points taken off for literally breaking your code.
I have usages of imports in my project, such as this ``` import { type MyType, MY_CONSTANT } from './index'; ``` and it compiles and works pretty well. But this usage is strange for me, and in some computers on local environment it throws syntax error. I wanted to know if this usage is okay, and from whic...
Is is a mistake to use type keyword after curly braces in TS when importing constants and files fro one file?
|javascript|typescript|types|import|