instruction
stringlengths
0
30k
βŒ€
``` import * as React from 'react'; import { styled, useTheme } from '@mui/material/styles'; import Box from '@mui/material/Box'; import MuiDrawer from '@mui/material/Drawer'; import MuiAppBar from '@mui/material/AppBar'; import Toolbar from '@mui/material/Toolbar'; import List from '@mui/material/List'; impo...
How can I make a ListItem(in React) in the bottom left corner, in the following example?
|css|reactjs|material-ui|
null
Nothing worked for me, except deleting the complaining library from maven local cache ($HOME/.m2/repository) and reinstalling it.
My phone is a Samsung A32 5G ( SM-A326B/DS). Android 12, native ROM, SDK 31. I need to read files from OTG USB dongle from 2 apps : - My app which is an installer. It install some APK and restore some data external SD card or OTG USB Device. - Termux app, dowloaded from github and modified to request the right...
I have 2 Python classes that are in separate modules. One class maintains a state attribute that the other needs to observe and use when certain actions are handled. Right now, I'm using an event-based approach to allow the second class to detect when the state changes in the first class and update its reference to...
How to model state sharing between classes/modules in Python
|python|design-patterns|
|javascript|google-chrome|web-audio-api|mediastream|lame|
I am able to resolve my issue. The solution is to run psql commands and directly change the boolean values for two of the properties. This is done via the gitlab-psql command. **gitlab-psql** **update application_settings set diagramsnet_enabled=false;** **update application_settings set update_runner_versi...
I found the concept I needed: conditional imports in Flutter. I was able to eliminate plugin package and put all my Flutter code in lib/ and platform code in ios/macos/android projects.
Here's the code, courtesy of Firebase: ``` GoogleAuthProvider googleProvider = GoogleAuthProvider(); googleProvider .addScope('https://www.googleapis.com/auth/contacts.readonly'); googleProvider.setCustomParameters({'login_hint': 'user@example.com'}); final loggedUser = await Fireba...
I am migrating existing iOS project to Flutter. I am working on custom camera code for Flutter app. I have created simple version of it using plugins system. I can show my camera view in Flutter, take pictures, everything is OK. But very simplyfied version, my production code requires OpenCV and other low-level stu...
The list is probably the cheapest. At least if you use a `List.filled(1, 'item')` to make it a fixed-length list, those are cheaper than growable lists. You need to store the one element somehow. Storing it directly in the list takes a single reference. Then the list might spend one more cell on the length (of 1)...
**TL;DR:** Apart from PrimeVue, FormKit, NuxtUI and Yup/Zustand, what would you recommend for developing a heavily form-focused Nuxt 3 app? **Long story not short:** I'm working in a company that's currently developing an ERP app with Nuxt 3. We're using PrimeVue for UI elements and FormKit for form creatio...
Nuxt 3: looking for suggestions for creating forms with validations for an ERP app
|nuxtjs3|nuxt3|erp|primevue|formkit|
null
the gulp-pug doesn't work and say unexpected token "indent" see the images below [gulp code and nodejs command prompt](https://i.stack.imgur.com/E8H8P.png) [index.pug and nodejs command prompt](https://i.stack.imgur.com/EoYtr.png) [package.json and nodejs command prompt](https://i.stack.imgur.com/PNPf9.png) ...
If you know that the column exists, you could proceed similarly to pandas: ``` df = pl.DataFrame({'ABC': [1,2,3], 'DEF': [4,5,6], 'XYZ': [7,8,9], 'GHI': [10,11,12]}) out = df[:, :df.columns.index('XYZ')+1] ``` Output: ``` shape: (3, 3) β”Œβ”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β” β”‚ ABC ┆ DEF ┆ XYZ β”‚ β”‚ --- ┆ --...
This function uses both the `str.replace()` and `re.findall()` functions. It will replace all occurences of `pattern` in `string` with `repl` in a case-insensitive way. ``` def replace_all(pattern, repl, string) -> str: occurences = re.findall(pattern, string, re.IGNORECASE) for occurence in occurences: ...
VBA Code to filter and get values from csv to excel worksheet
|excel|vba|csv|excel-365|
null
I'm encountering an issue in Code::Blocks where attempting to build C++ code results in the error message "Error: id returned 5 exit status," even when there are no syntax errors present in the code. Here's an example: ``` #include <iostream> int main() { std::cout<<"hello world"; } ``` Even for this...
I am attempting to download data from the OECD. When I run this code: oecd.cpi.url <- list( core=list( dataset='MEI', indicator='CPGRLE01'), all.items=list( dataset='MEI', indicator='CPALTT01') ) gbp.cpi <- get_dataset(oecd.cpi.url$all.items$dataset, filt...
OECD data error Error in download.file(path, destfile, method, quiet, mode, ...) :
|r|
null
This is the form i made using Shadcn just like it says in the docs: /app/admin/products/_components/ProductForm.tsx ```js "use client"; import { addProduct } from "@/app/admin/_actions/products"; import { zodResolver } from "@hookform/resolvers/zod"; import { useState } from "react"; import { useForm } from ...
While developing a `feat` branch based on the `develop` branch, the `develop` branch has been frozen, that is merged into the `staging` branch. So now I would like to rebase my `feat` branch onto `staging`. Initial version history: ``` D---E feat / A---B---C develop \ F---G---H staging ``` Fina...
You probably want to look into something like [BeautifulSoup](https://www.crummy.com/software/BeautifulSoup/bs4/doc/) paired with [requests](https://docs.python-requests.org/en/latest/). You can then extract text from a page with a simple solution like this: ```py import requests from bs4 import BeautifulSoup r =...
I have used [Bun][1] to create a single-file executable. More can be read [here][2], it is super easy. Note: I used it for Typescript project, havent tried with js. [1]: https://bun.sh/ [2]: https://bun.sh/docs/bundler/executables
I have to make sure that let the player know if their guess is too low, too high, or correct, but I am not getting any output after asking them their bounds. Any help noting what I am doing wrong? This is for my current version of python, i believe. ``` print('Welcome to the Higher or Lower game!') import random ...
Having issues getting the correct output with hi low game
|python|loops|
null
@Dan Getz said: Try the following tickformat format: `tickformat="{:.3f}"`. This works for me so I'm marking as a solution. Thank you!
First if you are curious about why EF chose ``NVARCHAR(450)``, it's about max index length! I faced this interesting issue before and I created an issue on EF core repo, you can check it here: https://github.com/dotnet/efcore/issues/31167 In short, because for SQL Server max length for an index is 900 characte...
If you don't want to have a dependency on NLog in your controller (so you depend on Microsoft abstractions instead) : In your command handler / controller using Microsoft.Extensions.Logging; class MyHandler(ILoggerFactory loggerFactory) { public void Handler() { ...
Can not access OTG USB Key after just after Granting ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION
I faced the same issue today and fixed it, as HolyBlackCat suggested, by adding a `-I path/to/include/dir` compiler flag to the `tasks.json` file in the `.vscode` folder in the folder of the project. The tricky part was, that the `"-I"` and the `"C:/Program Files/Boost/boost_1_84_0/"` were separate items under `flags...
I'm trying to put together an indicator that would include several basic tools I need for analysis. I'm trying to assemble some kind of cluster by dividing the candle into equal parts and highlighting the location of the maximum delta volume on the candle. But it doesn't show up: `// Volume profile length length =...
> The cause of this error is that a local library to `CompileOnly` overwrites the `Context`... Cause the problem That means you will need to review your project's [`build.gradle` file(s)](https://developer.android.com/build) (project-level `build.gradle`, and one for each module, module-level `build.gradle`). The de...
I don't think there is such a feature. What I have done is to assign new keybindings for the two commands which are close to each other on the keyboard. So you still have to do it as two commands, but it is more seamless.
|pentaho-data-integration|
Style breaks on adding doctype
I don't know how to correctly calculate the accuracy of the relationship between how many tries I needed and how probable it was to find the number within this amount of tries. E.g. if I needed 1 try it should be 100% accuracy-score but if it took more tries, the accuracy-score gets decreased. My attempt was to divi...
How to calculate the accuracy in number guessing game?
|python-3.x|random|formula|calculation|
null
`roundToInt()` is an extension function provided by the `math` package and not a member function of `Double`. To use it, you need to import the function: ```kotlin import kotlin.math.roundToInt x.roundToInt() ```
As title. I bought an online course I had no time to watch until now. In the course, it says something like this *was* not allowed in TypeScript: ```ts type Name = { name: string } type Age = { age: number } type UnionBoth = Name | Age const test = (union: UnionBoth): void => { if ('name' in union && ...
Calculation of volumes inside a candle
|pine-script|volumes|
null
I'm in the middle of building this frontend mentor project: **Time tracking dashboard** ![1] I'm building this using React Native, everything is going well, the only thing is **I don't know how to** change these colours: ![2] If I try to change it in the CSS it'll just change them all to one same colour ...
**Edit:** The real issue I had was using `localhost` instead of my local ip (`192.168.***.***`). That is even more strange because i could still use `localhost` with `psql`, but not with IntelliJ (nor with my code). The force refresh tip (*see below*) can still be helpful --- I had the same issue just today. C...
I am studying React Native by making a ToDo list. I want to change the ToDo app to a Comment List that has comment one to another. First attempt worked correctly: [First attempt][1] But, all users changed after second attempt. [Second attempt][2] Now, parent passes props to child by using {this.state....
I'm trying to put together an indicator that would include several basic tools I need for analysis. I'm trying to assemble some kind of cluster by dividing the candle into equal parts and highlighting the location of the maximum delta volume on the candle. But it doesn't show up: // Volume profile length lengt...
I fixed this by putting `host.docker.internal:5432` as the server instead of localhost.
{"Voters":[{"Id":2802040,"DisplayName":"Paulie_D"},{"Id":3807365,"DisplayName":"IT goldman"},{"Id":82548,"DisplayName":"David Thomas"}],"SiteSpecificCloseReasonIds":[13]}
***EDIT 1*** @Danny (and everyone) "Is there a reason your <label> needs to be independent outside the Component? " Please let me explain the use-case here. My custom-element ABC-TOGGLE is (wants to be) Label agnostic. Whether or not a LABEL tag is present is completely at the disgression of the LightDOM autho...
I'm currently building a class called '`system`' that takes in 4 arguments: `A, B, C, D` which are matrices of a state-space system. The intent is that the user can input these using nested built-in `<class 'list'>` types, such as `[[1, 0],[0, 1]]`. The `__init__` method of the class should take these lists and c...
I'm working on one one Python project and facing this error while importing logging in research.ipynb file. [Here my github link which direct open logger.py file][1]. Now You can navigate to research.ipynb file which is "fsdML_project\notebooks\research.ipynb". Check the last cell. [1]: https://github.com/Har...
ModuleNotFoundError: No module named 'src' while importing logging
|python|logging|jupyter-notebook|module|src|
{"Voters":[{"Id":4142924,"DisplayName":"Weather Vane"},{"Id":298225,"DisplayName":"Eric Postpischil"},{"Id":15261315,"DisplayName":"Chris"}],"SiteSpecificCloseReasonIds":[11]}
Is there any google sheet script to convert the Scientific notation in the selected area to number? I've tried to write a script but not work. Could you please help me? Here's the [data of sheet][1]. thank you for your help so much. function convertScientificToNumber() { var sheet = SpreadsheetApp.getAc...
google sheet script to convert the Scientific notation in the selected area to number
|google-sheets|google-apps-script|google-sheets-api|
{"Voters":[{"Id":14732669,"DisplayName":"ray"},{"Id":13302,"DisplayName":"marc_s"},{"Id":6457407,"DisplayName":"Frank Yellin"}],"SiteSpecificCloseReasonIds":[18]}
I created database tables using EF and wanted to create foreign keys between FriendInvites.SenderUserId FriendInvites.cs: ``` public class FriendInvites { [Key] public int Id { get; set; } //Foreign key to UserInfo userId public string SenderUserId { get; set; } = string.Empty; //Naviga...
I started writing a Discord bot in C#, but I ran into a problem when playing the sound. The bot senses the command and joins the room, but it doesn't play any sound, and I don't know what's causing it. AudioCommands.cs: ``` [Command("play")] public async Task PlayMusic(CommandContext ctx, string query) { va...
DSharp music bot does not play music
|c#|dsharp+|
null
I am facing issue while using command from google.colab import drive in anaconda juypter notebook. It shows an error that no module found error. I am attaching the screenshot for your reference too. ``` [Anaconda prompt error](https://i.stack.imgur.com/uRviE.jpg) ```
How to solve the issue faced during running command pip install google-colab?
|jupyter-notebook|google-colaboratory|metadata|anaconda3|nomodule|
null
model.compile(optimizer='adam', loss=tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True), metrics=['accuracy']) epochs_size = 25 history = model.fit(data_train, validation_data=data_val, epochs=epochs_size) ***error is :*** ------------------------------------------------------------------...
How can I resolve this error and work smoothly in deep learning?
|pandas|performance|machine-learning|deep-learning|
null
You could use ``` Math.max(queue[0].duration, 1000 - (performance.now() - start)) ``` to make an interval between the jobs at least 1 second and call the schedule recursively. In that case returning a job could make not much sense, so you could collect your jobs in an array for example if needed. <!-- begin ...
List > numpy.ndarray using np.array(list) not working in class __init__ . Problem with numpy?
|python|list|numpy-ndarray|init|self|
null
I have a WordPress website. And for speed optimization, I used WP Rocket. I used a preloader from theme options. The site took a long time to load for the first time when I used it. But, after the first time, the site loads fast. I keep the site loader that comes with the theme options. How can I improve the loading ti...
Theme Preloader for speed optimization in WordPress
|wordpress|performance|wp-rocket|
In Rust, how can I create a function accpeting a closure as argument that iterates and prints all values captured by the closure reflectively? For example: ```rust fn print_captured_values<F>(f: F) where F: Fn() { // How to implement it? } ```
After debugging for several hours I concluded that Vue <TransitionGroup> does not work well with the CSS transition property. The transition group: [https://vuejs.org/guide/built-ins/transition-group][1] <TransitionGroup name="store" tag="div"> <button v-for="item in store.items" :key="item">{{ item.na...
Vue TransitionGroup not working properly because of css transition
|sass|vuejs3|vuejs-transition-group|
I'm encountering an issue in Code::Blocks where attempting to build C++ code results in the error message "Error: id returned 5 exit status," even when there are no syntax errors present in the code. Here's an example: ``` #include <iostream> int main() { std::cout<<"hello world"; } ``` Even for this...
|sql|sql-server|
null