instruction
stringlengths
0
30k
As the title says, if I change the number of hidden layers in my pytorch neural network to be anything different from the amount of input nodes it returns the error below. > RuntimeError: mat1 and mat2 shapes cannot be multiplied (380x10 and 2x10) I think that the architecture is incorrectly coded but I am relati...
I am trying to open a file from the Finder app with my Flutter app. However, the method that is expected to be called when opening a file is never being invoked. --- I've created a custom file extension for my flutter app and already registered it in the ```Info.plist``` for MacOS. Files of the custom type are...
The conversion is a bit trickier if you need to convert a null-terminated C character array (a C "string") returned by a legacy C function, to a Go string (which is what I needed to do). Since C arrays do not inherently have a length (C buffer overflows are notorious sources of security issues and bugs), you must manua...
Render emoji flags on windows
|flutter|google-fonts|
I have a ViewPager 2 inside a plannerFragment, which calls 2 fragments: one (localeChoosingFragment) contains a recyclerview for the user to choose a locale, and another to choose places within that locale (localeExploringFragment). A ViewModel (japanGuideViewModel) stores the data (as MutableLiveData), including the i...
I have a column in my Bigq\Query table that is filled by C# Ticks: DateUtc = DateTime.UtcNow.Ticks; This is some thing like:638148714773184690 I want to convert it to Bigquery DateTime.
Conver C# DateTime.Ticks to Bigquery DateTime Format
|c#|sql|.net|google-bigquery|
I have stuck with a pretty simple problem - I can't communicate with process' stdout. The process is a simple stopwatch, so I'd be able to start it, stop and get current time. The code of stopwatch is: ```python import argparse import time def main() -> None: parser = argparse.ArgumentParser() par...
I developed this website- https://snotes00.vercel.app but I am facing an issue while sending request to vercel backend- POST https://snotes00.vercel.app/server/login net::ERR_ABORTED 405 (Method Not Allowed) I was sending the request from- https://snotes00.vercel.app/login While running in local server, it works...
{"Voters":[{"Id":6782707,"DisplayName":"Edric"},{"Id":115145,"DisplayName":"CommonsWare"},{"Id":295004,"DisplayName":"Morrison Chang"}],"SiteSpecificCloseReasonIds":[18]}
I have an expo app that i had to run `expo prebuild` and then `expo run:android` on. I am using Clerk for auth and expo router. This app is based on the tabs template. My root _layout.tsx looks like this: ```javascript export function InitialLayout() { const [loaded, error] = useFonts({ SpaceMono: require(".....
Expo Router does not render the child components but renders the tabs
|expo|expo-router|clerk|
In JavaScript, there are fundamentally two types of entities: primitives and objects. Primitives can be reassigned, but they cannot be *altered*. Primitives include things like numbers and strings. Objects are things like, well, `Objects` (written like `{key: value}`), arrays (`[1, 2, 3, ...]`). For example, s...
{"Voters":[{"Id":10289265,"DisplayName":"Hao Wu"},{"Id":16540390,"DisplayName":"jabaa"},{"Id":269970,"DisplayName":"esqew"}]}
So I'm trying to run this command to turn files into a .chd file: `for i in *.cue; do chdman createcd -i "$i" -o "${i%.*}.chd"; done` But I get this error: `fish: ${ is not a valid variable in fish. for i in *.cue; do chdman createcd -i "$i" -o "${i%.*}.chd"; done` Which is boggling to me cuz I run this co...
Error: fish: ${ is not a valid variable in fish
|linux|
null
To embed YouTube videos in your web app while safeguarding the direct video links, you can use the YouTube Player API provided by YouTube. This allows you to embed YouTube videos on your website without exposing the direct video links. Here's a general approach to achieve this using the YouTube Player API: Includ...
Why am I getting 'Method Not Allowed Error' in vercel
|backend|mern|vercel|
Trying to add an AD user account to a AD group using python with ldap3 using the following script: ``` # Import necessary modules and libraries import requests from flask import json from ldap3 import Server, Connection, ALL_ATTRIBUTES, SUBTREE, NTLM from ldap3.extend.microsoft.addMembersToGroups import ad_ad...
import tkinter as tk from tkvideo import tkvideo root = tk.Tk() root.geometry("957x555") root.configure(bg = "#FFFFFF") root.attributes('-alpha', 0.8) canvas = tk.Canvas( root, bg="#FFFFFF", height=555, width=957, bd=0, ...
How to get text and other elements to display over the Video in Tkinter?
|python|python-3.x|tkinter|video|tkinter-canvas|
I am curently working on an App implemented with REACT. The idea, or the task is to get data from Spotify, filter that data and add those songs to a new playlist which than can be saved to the spotify-profile. I already setup the main functionalities with mocked data. But now I am trying to connect the login button on...
How to connect Spotify PKCE Authorization Boilerplate to Login-Button in REACT-APP
|reactjs|authentication|pkce|spotify-app|
null
You can upload your custom model to HuggingFace, create a `Modelfile` (https://github.com/ollama/ollama/blob/main/docs/modelfile.md), then build the model with `ollama` Here's a reference > https://github.com/ollama/ollama
I wait until the page is loaded and use the "DOMContentLoaded" method to add eventhandlers on some p tags. This works until I open and close the modal, then the page/js freezes. Why does it freeze? ``` <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initi...
I have an interface ``` interface I1 { field1: fieldType1; ... fieldN: fieldTypeN; } ``` Now, I need an interface that has the same fields, but some of them (say the first 10) are optional. I can write it as `Omit<I1, field1, ..., field 10> & {field1?: fieldType1 ...}` but wonder if there is a more con...
Make some of the type's field optional
|typescript|
I am writing a program that reads a bmp file, and then outputs the same BMP file but cropped in half. I'm doing this by simply dividing the bmp height in half, and that results in the top half of the BMP image being cropped out. However, I can only crop out the top half. I am trying to find a way to crop out the bottom...
This worked for me, try using this : https://github.com/TooTallNate/proxy-agents The request formed will be similar to this: ``` fetch('accessUrl', {agent: new HttpsProxyAgent('proxyHost:proxyPort')}) .then(function (res) { }) ```
You need to run `updateSelectizeInput` if one of the `SelectizeInput` receives a selection. Therefore you could include the code below: The first `lapply` attaches an `observeEvent` to all `SelectizeInput` and the `lapply` inside contains the updates. ``` lapply( X = cols_to_filter, FUN = function(colChanged)...
Try using `<ng-template ngFor let-room [ngForOf]="rooms"><mat-tab></mat-tab></ng-template>` instead of `<mat-tab *ngFor="let room of rooms"></mat-tab>`.<br/> I hope this help if someone have same issue.<br/> If it now working, you can try using lazy-loadig: `<ng-template matTabContent>`
've started working with Svelte and I stumbled upon some unexpected behavior. This is the snippet of my app source let currentPage = 1; $: if (currentPage || $selectedOption) { fetchPage(currentPage, $selectedOption); } ...
Unexpected additional function calls in Svelte depending on init variable
|svelte|
Using `querySelectorAll` => <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-js --> const dialog = document.querySelector("dialog"); const showButton = document.querySelectorAll("dialog + button"); const closeButton = document.querySelectorAll("dialog button")...
I want to deploy a shiny application composed of files `ui` , `server` and `global` via Docker. All the files are in the folder `deploy_test` I simulated this dataset set.seed(123) dir.create("deploy_test") setwd("deploy_test") mydata_<-data.frame( gender=c(rep("Male",50),rep("Female",25))...
null
I have created this swiper slider with pagination bullets that have a progress bar pagination. It changes color for the bullet (to #000) on active slides. Is there a way for the bullets for the slide that was visited has their colored changed (to #000) as well - so only the unvisited slide's bullet with the grey #DDD b...
Swiper pagination bullet: styling for visited slides' pagination bullet as well
|javascript|css|sass|swiper.js|
null
As explained in the comments, you can get via JavaScript the total memory usage in your WASM (`WebAssembly.Memory.prototype.buffer.byteLength`). This never shrinks, but if it continuously grows then you probably have a leak. You can get the `WebAssembly.Memory` instance via [`wasm_bindgen::memory()`](https://docs.rs/wa...
From a Cloud Functions standpoint, that approach is fine. You have put your API key into the Configuration as an environment variable. It would be safer to put the key into [Google Secret Manager][1], but your approach here is reasonable. Except....the question is how you are populating the Configuration for your ...
I'm developing a web compiler in TypeScript and I've encountered a small, but still irritating issue. I have a progress bar inside an iframe element which keeps rendering for a short amount of time. I want that progress bar to be rendered only when there's a code bundling process. Here's a piece of that TypeScri...
There might some cases: 1. Ensure that the font file (Yarndings20Charted-regular.ttf) is located in the correct directory within your Flutter project. 2. Double-check that the family name specified in your pubspec.yaml matches the actual family name embedded in the font file. 3. Sometimes, changes to ...
if you use just *.mdb you can build the connection like this: to avoid the error ODBC Driver not found. db_main = f"C:\Users\jseinfeld\Desktop\Databasetest1.mdb" conn_string = r"DRIVER={Microsoft Access Driver (*.mdb)};" \ f"DBQ={db_main}"
I want to set axisItems to a PlotItem useing pyqtgraph, I encountered an error while running my code. Here is my code: ``` import numpy as np import pyqtgraph as pg app = pg.mkQApp("app") x = np.linspace(0, 10, 1000) y = np.sin(x) plot_item = pg.PlotItem() plot_item.setAxisItems(axisItems={'top':pg...
null
I'm using ```sorl-thumbnail``` and it works as expected except for when I use ```padding``` (which I have to) a white background is added. I know I can change that color, but I want no color (i.e transparency). Is there any hack or another library to fix this?
sorl-thumbnail adds a background color when padding is used
|python|django|sorl-thumbnail|
je veux créer une class BottleOfWater () et à l'intérieur une fonction avec pour argument contenant, couleur et liquide
null
This is not a question, but a summary of the steps required to address multi tenancy with spring (the partitioned approach where every table will have a tenant id column). I hope this helps others facing issues or looking for sample code ... Two things to consider here - 1. The tenant id will be set in the header...
First off: Are you sure that you are picking the right kind of model here? Training a regression model for each patient sounds like you want a linear mixed effects model here (LME), not a neural network. In general, the advantages of neural networks fly out the window if you train them on single individuals, especially...
git fetch origin our-team or git pull origin our-team But first you should make sure that you are already on the branch you want to update (featurex).
null
So basically I'm creating a automation that copy a information from a cell and save it in to a var so i can paste in to a app like notepad or wathever ``` import win32com.client as win32 import pyautogui import global_variables def copiar(): try: excel = win32.GetActiveObject("Excel.Application...
How to deploy my shiny application (with multiple files) via Docker
|r|docker|shiny|deployment|shinydashboard|
As per the title, I need to automate unwinding my date 7 days back upon I launch a specific macOS application bundle and putting the timestamp back to normal 45 seconds into its uptime. What I need to do is: 1. Watch an application bundle with a specific name to be opened (like `FileSystemWatcher` in .NET) 2. Ch...
How do I react to external program launch inside an Automator workflow?
|macos|scripting|applescript|automator|sirishortcuts|
null
So far, I have the opportunity to choose in the settings which user prefers the theme: system, dark or light. And which navbar is more convenient: compact or full. I can't find anywhere what is the best way to store the user's selection and restore it when logging into the application. In the future, the settings will ...
Storing Android user settings
|android|
null
Style your text inputs with a CSS color property. To change the text input colour. Try this code for solve the problem: input[type=text] { color : #FFFFFF; }
I have tried to isolate my problem in a very simple (and working) project. Let's say I have a simple model with 2 fields, and I have configured its properties and a `PropertyChanged` event. This is a simplified implementation of my model, please notice the last method just gets a new client object from a list and retur...
As per the title, I need to automate unwinding my date 7 days back upon I launch a specific macOS application bundle and putting the timestamp back to normal 45 seconds into its uptime. What I need to do is: 1. Watch an application bundle with a specific name to be opened (like `FileSystemWatcher` in .NET) 2. Ch...
I have created this swiper slider with pagination bullets that have a progress bar pagination. It changes color for the bullet (to #000) on active slides. Is there a way for the bullets for the slide that was visited has their colored changed (to #000) as well - so only the unvisited slide's bullet with the grey #DDD b...
I'm programming a simple 'game' that is just a block that can jump around. I placed a wall, but now the character phases through when moving to the right, but the collision works when going to the right. Every other part of this is fine. the willImpactMovingLeft function works just fine and should be a mirror of willI...
My issue was that I was saved the RDS object with the `save()` function and not the `saveRDS()` function. ``` # Doesn't work a = 1 save(a, file="test.rds") b = readRDS("test.rds") print(b) ``` ``` # Works a = 1 saveRDS(a, file="test.rds") b = readRDS("test.rds") print(b) ```
|javascript|google-apps-script|
When it comes to setting initial values, I am usually using a machine factory function: ```typescript function createInteractiveVideoMachine({ useFullscreen, }: { useFullscreen: boolean; }) { return createMachine({ id: "interactiveVideoMachine", states: { user: { id: "user", ...
I need to be able to see how much space my bucket is using, but when I followed the online help to add 'total bytes' metric to my dashboard but I cannot find this metric. I would like to be able to monitor how much storage I am using. Thanks for any help
Hello I just started with google cloud storage, size of bucket online help doesnt
|google-cloud-datastore|
null
I have a large structure. The size of arrays is known at compile time and I will not use a `Vec<_>`. This current initialization code trigger a stack overflow: ```rust use std::sync::atomic::AtomicUsize; use std::sync::Arc; #[derive(Debug)] pub struct OuterStruct { pub big_array_0: [u32; 108], ...
|php|laravel|eloquent|permissions|
I have a web app deployed on Azure. During testing, I found one of my endpoints is not working... sometimes. More specifically, this `POST` endpoint always works in my dev environment, and it randomly works in Prod. When it fails, my controller endpoint is not hit (discovered by adding logs), and a "successful" 200...
{"Voters":[{"Id":5424988,"DisplayName":"The fourth bird"},{"Id":10871073,"DisplayName":"Adrian Mole"},{"Id":2530121,"DisplayName":"L Tyrone"}]}
If you need to mock static methods and you cannot use `mockito-inline` you could do something like this with `mockito-core`: ```java public class MockitoUtil { public static <T, S> void mockStaticMethod(Class<T> classToMock, String nameOfMethodToMock, S result) { MockCreationSettings<T> settings = mock(MockCr...
**using a by keyword instead of the =. This is a property delegate that saves you from typing .value every time.**
if you use just *.mdb you can build the connection like this: to avoid the error ODBC Driver not found. db_main = f"C:\Users\jseinfeld\Desktop\Databasetest1.mdb" conn_string = r"DRIVER={Microsoft Access Driver (*.mdb)};" \ f"DBQ={db_main}"
the requirement is to allow to see only granted warehouse view on Snowflake cost management page, and not whole account level ware houses to specific function roles. is that really possible, cause if I followed [https://docs.snowflake.com/en/user-guide/cost-exploring-overall#label-cost-accessing-data][1] this does n...
snowflake cost management page limited warehouse access to role
|snowflake-cloud-data-platform|